@plannotator/pi-extension 0.15.1 → 0.15.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -30,6 +30,7 @@ export async function startAnnotateServer(options: {
30
30
  htmlContent: string;
31
31
  origin?: string;
32
32
  mode?: string;
33
+ folderPath?: string;
33
34
  sharingEnabled?: boolean;
34
35
  shareBaseUrl?: string;
35
36
  pasteApiUrl?: string;
@@ -71,7 +72,7 @@ export async function startAnnotateServer(options: {
71
72
  shareBaseUrl,
72
73
  pasteApiUrl,
73
74
  repoInfo,
74
- projectRoot: process.cwd(),
75
+ projectRoot: options.folderPath || process.cwd(),
75
76
  });
76
77
  } else if (url.pathname === "/api/image") {
77
78
  handleImageRequest(res, url);
package/tool-scope.ts ADDED
@@ -0,0 +1,24 @@
1
+ export type Phase = "idle" | "planning" | "executing";
2
+
3
+ export const PLAN_SUBMIT_TOOL = "plannotator_submit_plan";
4
+ export const PLANNING_DISCOVERY_TOOLS = ["grep", "find", "ls"] as const;
5
+
6
+ const PLANNING_ONLY_TOOLS = new Set<string>([PLAN_SUBMIT_TOOL]);
7
+
8
+ export function stripPlanningOnlyTools(tools: readonly string[]): string[] {
9
+ return tools.filter((tool) => !PLANNING_ONLY_TOOLS.has(tool));
10
+ }
11
+
12
+ export function getToolsForPhase(
13
+ baseTools: readonly string[],
14
+ phase: Phase,
15
+ ): string[] {
16
+ const tools = stripPlanningOnlyTools(baseTools);
17
+ if (phase !== "planning") {
18
+ return [...new Set(tools)];
19
+ }
20
+
21
+ return [
22
+ ...new Set([...tools, ...PLANNING_DISCOVERY_TOOLS, PLAN_SUBMIT_TOOL]),
23
+ ];
24
+ }