P!npoint

Plugins

Bridge API Reference

이 문서는 Worker runtime에서 plugin이 호출할 수 있는 bridge API를 설명합니다.

API Table

APIPermissionReturnsNotes
readTextFile(path)project:readPromise<string>현재 project root 안의 file만 읽습니다.
listProjectFiles(globs?)project:readPromise<string[]>index된 project file path를 반환합니다. globs filtering은 future behavior입니다.
getCurrentDiff()diff:read`Promise<PinpointDiffContext \null>`현재 Snapshot/Diff 결과를 반환합니다.

Command Result

commandProviderrun은 값을 반환하지 않거나 command result를 반환합니다.

return {
  level: "success",
  message: "Command finished.",
  detail: "Optional detail",
};

levelinfo, success, warning, error 중 하나입니다.

Diff Context

diffAnalyzer는 다음 구조를 받습니다.

type PinpointDiffContext = {
  projectPath?: string;
  snapshotId?: string;
  summary: PinpointDiffSummary;
  files: PinpointDiffFile[];
  readTextFile(path: string): Promise<string>;
};

filesstatusadded, modified, deleted 중 하나입니다.

categorysource, style, test, config, docs, asset, other 중 하나입니다.