P!npoint

Plugins

Bridge API Reference

This page documents bridge APIs available to plugins running in the Worker runtime.

API Table

APIPermissionReturnsNotes
readTextFile(path)project:readPromise<string>Reads files inside the current project root only.
listProjectFiles(globs?)project:readPromise<string[]>Returns indexed project file paths. globs filtering is future behavior.
getCurrentDiff()diff:read`Promise<PinpointDiffContext \null>`Returns the current Snapshot/Diff result.

Command Result

commandProvider run functions may return nothing or a command result.

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

level must be one of info, success, warning, or error.

Diff Context

diffAnalyzer receives this structure.

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

files status is one of added, modified, or deleted.

category is one of source, style, test, config, docs, asset, or other.