Bridge API Reference
이 문서는 Worker runtime에서 plugin이 호출할 수 있는 bridge API를 설명합니다.
API Table
| API | Permission | Returns | Notes | |
|---|---|---|---|---|
readTextFile(path) | project:read | Promise<string> | 현재 project root 안의 file만 읽습니다. | |
listProjectFiles(globs?) | project:read | Promise<string[]> | index된 project file path를 반환합니다. globs filtering은 future behavior입니다. | |
getCurrentDiff() | diff:read | `Promise<PinpointDiffContext \ | null>` | 현재 Snapshot/Diff 결과를 반환합니다. |
Command Result
commandProvider의 run은 값을 반환하지 않거나 command result를 반환합니다.
return {
level: "success",
message: "Command finished.",
detail: "Optional detail",
};
level은 info, success, warning, error 중 하나입니다.
Diff Context
diffAnalyzer는 다음 구조를 받습니다.
type PinpointDiffContext = {
projectPath?: string;
snapshotId?: string;
summary: PinpointDiffSummary;
files: PinpointDiffFile[];
readTextFile(path: string): Promise<string>;
};
files의 status는 added, modified, deleted 중 하나입니다.
category는 source, style, test, config, docs, asset, other 중 하나입니다.