@agimon-ai/po-plan 0.0.0-alpha.0
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.
- package/LICENSE +21 -0
- package/README.md +98 -0
- package/dist/apiContracts.cjs +57 -0
- package/dist/apiContracts.cjs.map +1 -0
- package/dist/apiContracts.d.mts +53 -0
- package/dist/apiContracts.d.mts.map +1 -0
- package/dist/apiContracts.mjs +52 -0
- package/dist/apiContracts.mjs.map +1 -0
- package/dist/config-BC-Tou05.mjs +25 -0
- package/dist/config-BC-Tou05.mjs.map +1 -0
- package/dist/config-D0iTexGm.cjs +42 -0
- package/dist/config-D0iTexGm.cjs.map +1 -0
- package/dist/config-DWo57HKB.d.mts +13 -0
- package/dist/config-DWo57HKB.d.mts.map +1 -0
- package/dist/config.cjs +12 -0
- package/dist/config.d.mts +2 -0
- package/dist/config.mjs +2 -0
- package/dist/extensions/mcp-ui.mjs +46 -0
- package/dist/extensions/mcp-ui.mjs.map +1 -0
- package/dist/extensions/mcp.cjs +93 -0
- package/dist/extensions/mcp.cjs.map +1 -0
- package/dist/extensions/mcp.d.mts +5 -0
- package/dist/extensions/mcp.d.mts.map +1 -0
- package/dist/extensions/mcp.mjs +88 -0
- package/dist/extensions/mcp.mjs.map +1 -0
- package/dist/extensions/server.cjs +1025 -0
- package/dist/extensions/server.cjs.map +1 -0
- package/dist/extensions/server.d.mts +5 -0
- package/dist/extensions/server.d.mts.map +1 -0
- package/dist/extensions/server.mjs +993 -0
- package/dist/extensions/server.mjs.map +1 -0
- package/dist/extensions/web.mjs +861 -0
- package/dist/extensions/web.mjs.map +1 -0
- package/dist/fableFlow-BDc8a__Y.mjs +214 -0
- package/dist/fableFlow-BDc8a__Y.mjs.map +1 -0
- package/dist/fableFlow-CzfrLPzJ.cjs +279 -0
- package/dist/fableFlow-CzfrLPzJ.cjs.map +1 -0
- package/dist/fableFlow.cjs +13 -0
- package/dist/fableFlow.d.mts +2 -0
- package/dist/fableFlow.mjs +2 -0
- package/dist/index-C8e7IK60.d.mts +68 -0
- package/dist/index-C8e7IK60.d.mts.map +1 -0
- package/dist/index-C9QBG9cw.d.mts +51 -0
- package/dist/index-C9QBG9cw.d.mts.map +1 -0
- package/dist/index.cjs +31 -0
- package/dist/index.d.mts +4 -0
- package/dist/index.mjs +4 -0
- package/dist/logSinkTelemetry.cjs +42 -0
- package/dist/logSinkTelemetry.cjs.map +1 -0
- package/dist/logSinkTelemetry.d.mts +33 -0
- package/dist/logSinkTelemetry.d.mts.map +1 -0
- package/dist/logSinkTelemetry.mjs +40 -0
- package/dist/logSinkTelemetry.mjs.map +1 -0
- package/dist/planConfig.cjs +190 -0
- package/dist/planConfig.cjs.map +1 -0
- package/dist/planConfig.d.mts +47 -0
- package/dist/planConfig.d.mts.map +1 -0
- package/dist/planConfig.mjs +186 -0
- package/dist/planConfig.mjs.map +1 -0
- package/dist/prompts-DUVUPNZd.cjs +103 -0
- package/dist/prompts-DUVUPNZd.cjs.map +1 -0
- package/dist/prompts-DnVJGtEC.mjs +68 -0
- package/dist/prompts-DnVJGtEC.mjs.map +1 -0
- package/dist/prompts.cjs +8 -0
- package/dist/prompts.d.mts +2 -0
- package/dist/prompts.mjs +2 -0
- package/llms.txt +9 -0
- package/package.json +164 -0
- package/src/prompts/po-use-plan/SKILL.md +44 -0
- package/src/types/planApi.ts +125 -0
- package/src/types/planSettings.ts +78 -0
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
//#region src/services/prompts/index.ts
|
|
2
|
+
const EVIDENCE_FIELDS = [
|
|
3
|
+
"issue",
|
|
4
|
+
"expectedBehavior",
|
|
5
|
+
"reproductionAttempt",
|
|
6
|
+
"actualBehavior",
|
|
7
|
+
"logs",
|
|
8
|
+
"correlatedTraceEvidence",
|
|
9
|
+
"processOutput",
|
|
10
|
+
"browserConsoleEvidence",
|
|
11
|
+
"correlationIds",
|
|
12
|
+
"timestamps",
|
|
13
|
+
"verifiedFacts",
|
|
14
|
+
"hypotheses",
|
|
15
|
+
"unavailableEvidence"
|
|
16
|
+
];
|
|
17
|
+
function evidenceLines(packet) {
|
|
18
|
+
return EVIDENCE_FIELDS.flatMap((field) => {
|
|
19
|
+
const value = packet[field];
|
|
20
|
+
if (Array.isArray(value) && value.length === 0) return [];
|
|
21
|
+
if (typeof value === "string" && value.length === 0) return [];
|
|
22
|
+
return `${field}: ${Array.isArray(value) ? value.join(" | ") : value}`;
|
|
23
|
+
}).join("\n");
|
|
24
|
+
}
|
|
25
|
+
/** The review protocol sentences that exist only because a host's tools support them. */
|
|
26
|
+
function reviewProtocolLines(capabilities) {
|
|
27
|
+
return [
|
|
28
|
+
...capabilities.completePlanTakesDecision ? ["In an interactive text session, call complete_plan without a decision and it opens the exit-or-continue selector."] : [],
|
|
29
|
+
...capabilities.narratesReview ? ["Under autonomous voice, complete_plan displays and narrates the choices without opening a blocking dialog, then ends the turn."] : [],
|
|
30
|
+
...capabilities.completePlanTakesDecision ? ["Interpret the user's next ordinary message and call complete_plan again with decision \"exit\" or \"continue\"."] : []
|
|
31
|
+
];
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* The host-independent plan mode block, pushed ahead of the flavor block.
|
|
35
|
+
*
|
|
36
|
+
* Both the Pi extension and the server facet append this. It lives here so the cockpit and the
|
|
37
|
+
* terminal cannot drift into giving the agent different instructions for the same mode. The two
|
|
38
|
+
* facets may differ only through {@link PlanHostCapabilities}, so every other sentence is shared
|
|
39
|
+
* by construction.
|
|
40
|
+
*/
|
|
41
|
+
function buildPlanModeBasePrompt(plansDirectory, capabilities) {
|
|
42
|
+
const review = reviewProtocolLines(capabilities);
|
|
43
|
+
return `[PLAN MODE ACTIVE]\nYou are in repository read-only plan mode. The dedicated write_plan tool may write one unique Markdown plan file under ${plansDirectory}.\n\nExplore the codebase and produce a concrete implementation plan. For every plan, first call subagent with action "agents", cluster the exploration by independent domain, subsystem, or integration boundary, and create a provisional task graph with the task tool. Select specialized agents by matching their names and descriptions to each cluster. Assign every unblocked delegated task through the task tool, and use a one-shot inlineAgent with a focused systemPrompt when no discovered specialist fits. Treat the initial graph as provisional, not as a fixed contract. After findings arrive, review the entire graph at least once and perform one to three review passes in total. In each pass, use the evidence to add, rewrite, delete, cancel, reassign, or change blockedBy relationships for tasks when warranted. Do not keep following tasks that new information has made stale. Stop revising early when the graph is stable, or after the third pass.\n\nEvery plan must end with a delegated planning-draft stage blocked by all exploration and decision tasks. A single-boundary plan gets one planning draft. A complex plan spanning multiple subsystems, domains, packages, apps, or integration boundaries gets two planning drafts concurrently. Use three concurrent drafts instead when the work is cross-layer, migration-sensitive, security-sensitive, or similarly high risk. Assign each draft through the task tool to the discovered "planner" agent with context "fork" so it receives the conversation and gathered evidence. If the planner agent is unavailable, assign the same draft task through the task tool with a focused inlineAgent. All children receive read, Bash, grep, find, ls, and configured MCP tools with artifacts disabled. Bash and MCP tools are for read-only inspection and must not modify files, external systems, or repository state. Doom Team runs asynchronously, so do not poll. After launch, continue non-overlapping exploration or end your turn; completion notifications wake the parent session.\n\nAfter all planning drafts complete, the main agent must compare the candidates, pick the strongest draft, cross-check it against the gathered evidence and the other drafts, resolve conflicts and gaps, and ask the user only for product decisions. A child produces the draft, but the main agent owns and synthesizes the final plan. The edit and write tools are withheld while plan mode is active; do not modify files or repository state except through write_plan. Start the final plan with a meaningful Markdown H1 because write_plan derives the filename from it. Present the complete plan as visible Markdown in chat, then call write_plan with no arguments. After write_plan succeeds, clear the completed durable task graph and call complete_plan so the user can review the plan and choose whether to begin implementation or continue planning. Do not exit plan mode without explicit approval.${review.length === 0 ? "" : `\n\n${review.join("\n")}`}`;
|
|
44
|
+
}
|
|
45
|
+
/** Normal planning adds only the flavor-specific brief to the shared planning workflow. */
|
|
46
|
+
function buildNormalPlanningPrompt() {
|
|
47
|
+
return `[PLAN MODE ACTIVE: NORMAL]\nStandard planning: follow the plan mode brief above using the read-only tools directly.`;
|
|
48
|
+
}
|
|
49
|
+
function buildDebugPlanningPrompt(plansDirectory, evidence) {
|
|
50
|
+
return `[PLAN MODE ACTIVE: DEBUG]\nYou are in repository read-only adaptive debug planning. The dedicated write_plan tool may write one unique Markdown plan file under ${plansDirectory}.\n\n${evidence ? `A bounded debug evidence packet is recorded below. Cite its verified facts when making source findings. Keep verified facts and hypotheses distinct. Do not claim a verified root cause when reproduction or supporting evidence is unavailable.\n\n[DEBUG EVIDENCE]\n${evidenceLines(evidence)}` : "No structured debug evidence packet is recorded yet. First understand the reported issue, then gather only the evidence relevant to it. Recording evidence is optional and must not block source exploration, delegation, writing a plan, or completing a plan."}\n\nUse the exact read-only tools available for the issue. Bash is available for repository inspection, but commands must not modify files or repository state. Treat unavailable evidence as unavailable, never invent its contents, and keep verified facts separate from hypotheses. ${evidence ? "The final plan must separate verified facts from hypotheses and must not present an unsupported root cause as verified." : "You may call record_debug_evidence when structured notes would help, but continue investigating without it when it is not relevant."}`;
|
|
51
|
+
}
|
|
52
|
+
function buildCodeReviewPlanningPrompt(plansDirectory) {
|
|
53
|
+
return `[PLAN MODE ACTIVE: CODE REVIEW]\nYou are in repository read-only code review planning. The dedicated write_plan tool may write one unique Markdown review and remediation plan under ${plansDirectory}.\n\nReview the user-specified change, commit range, or files. When no target is specified, inspect git status and the staged and unstaged diffs; ask for the review target when there are no changes to review. Trace changed behavior through callers, contracts, and relevant tests. Focus on concrete bugs, regressions, security risks, error handling, and missing regression coverage rather than unrelated cleanup or style preferences.\n\nPresent actionable findings in severity order with file and line references, the affected scenario, supporting evidence, and a minimal proposed fix. Keep verified behavior separate from source-based inferences and clearly state which checks were not run. Do not invent findings; explicitly report when no actionable issues are found and note remaining risks or test gaps. Turn supported findings into a scoped remediation plan with validation steps. Do not implement fixes or modify repository state during review. Present the final review plan, save it with write_plan, and use complete_plan for explicit approval before implementation.`;
|
|
54
|
+
}
|
|
55
|
+
/** @deprecated Fable is no longer an activatable planning flavor. Retained for API compatibility. */
|
|
56
|
+
function buildFablePlanningPrompt(plansDirectory, stage, capabilities) {
|
|
57
|
+
if (!capabilities.fableAvailable) return `[PLAN MODE ACTIVE: FABLE]\nFable planning is unavailable in this host, so plan with the read-only tools directly.`;
|
|
58
|
+
return `[PLAN MODE ACTIVE: FABLE]\nYou are in repository read-only Fable planning. Pi owns final verification and synthesis. The dedicated write_plan tool may write one unique Markdown plan file under ${plansDirectory}.\n\nUse Pi read-only exploration first. When the bounded packet is ready, call run_fable_plan. Fable runs one fresh draft with repository inspection access and returns untrusted text. Cross-check every Fable claim against repository evidence, keep verified findings separate from explicitly inferred findings, resolve conflicts yourself, and present the final visible plan before calling write_plan. Never treat Fable output as repository evidence and never expose credentials, transcripts, commands, tools, or session data in the packet.\n\nCurrent Fable stage: ${stage}. An interrupted stage is not relaunched automatically.`;
|
|
59
|
+
}
|
|
60
|
+
function buildFlavorPlanningPrompt(flavor, plansDirectory, evidence, _fableStage, _capabilities) {
|
|
61
|
+
if (flavor === "debug") return buildDebugPlanningPrompt(plansDirectory, evidence);
|
|
62
|
+
if (flavor === "code-review") return buildCodeReviewPlanningPrompt(plansDirectory);
|
|
63
|
+
return buildNormalPlanningPrompt();
|
|
64
|
+
}
|
|
65
|
+
//#endregion
|
|
66
|
+
export { buildNormalPlanningPrompt as a, buildFlavorPlanningPrompt as i, buildDebugPlanningPrompt as n, buildPlanModeBasePrompt as o, buildFablePlanningPrompt as r, buildCodeReviewPlanningPrompt as t };
|
|
67
|
+
|
|
68
|
+
//# sourceMappingURL=prompts-DnVJGtEC.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"prompts-DnVJGtEC.mjs","names":[],"sources":["../src/services/prompts/index.ts"],"sourcesContent":["export type PlanningFlavor = 'normal' | 'debug' | 'code-review';\n\nexport interface DebugEvidencePacket {\n issue: string;\n expectedBehavior: string;\n reproductionAttempt: string;\n actualBehavior: string;\n logs: string[];\n correlatedTraceEvidence: string[];\n processOutput: string[];\n browserConsoleEvidence: string[];\n correlationIds: string[];\n timestamps: string[];\n verifiedFacts: string[];\n hypotheses: string[];\n unavailableEvidence: string[];\n}\n\nconst EVIDENCE_FIELDS: readonly (keyof DebugEvidencePacket)[] = [\n 'issue',\n 'expectedBehavior',\n 'reproductionAttempt',\n 'actualBehavior',\n 'logs',\n 'correlatedTraceEvidence',\n 'processOutput',\n 'browserConsoleEvidence',\n 'correlationIds',\n 'timestamps',\n 'verifiedFacts',\n 'hypotheses',\n 'unavailableEvidence',\n];\n\nfunction evidenceLines(packet: DebugEvidencePacket): string {\n return EVIDENCE_FIELDS.flatMap((field) => {\n const value = packet[field];\n if (Array.isArray(value) && value.length === 0) return [];\n if (typeof value === 'string' && value.length === 0) return [];\n return `${field}: ${Array.isArray(value) ? value.join(' | ') : value}`;\n }).join('\\n');\n}\n\n/**\n * What a host's plan tooling can actually do, declared as capabilities rather than as a host\n * name. The prompt must instruct only what the host's tool surface accepts: the server's\n * complete_plan takes no parameters, so telling that model to pass a decision asks for an\n * argument its provider schema rejects. A `cli | server` flag would encode identity and invite\n * the next divergence to hide behind it.\n */\nexport interface PlanHostCapabilities {\n /** The host's complete_plan accepts a `decision` argument. */\n readonly completePlanTakesDecision: boolean;\n /** The host can narrate the plan review under autonomous voice. */\n readonly narratesReview: boolean;\n /** The host has a Fable broker. */\n readonly fableAvailable: boolean;\n}\n\n/** The review protocol sentences that exist only because a host's tools support them. */\nfunction reviewProtocolLines(capabilities: PlanHostCapabilities): string[] {\n return [\n ...(capabilities.completePlanTakesDecision\n ? [\n 'In an interactive text session, call complete_plan without a decision and it opens the exit-or-continue selector.',\n ]\n : []),\n ...(capabilities.narratesReview\n ? [\n 'Under autonomous voice, complete_plan displays and narrates the choices without opening a blocking dialog, then ends the turn.',\n ]\n : []),\n ...(capabilities.completePlanTakesDecision\n ? ['Interpret the user\\'s next ordinary message and call complete_plan again with decision \"exit\" or \"continue\".']\n : []),\n ];\n}\n\n/**\n * The host-independent plan mode block, pushed ahead of the flavor block.\n *\n * Both the Pi extension and the server facet append this. It lives here so the cockpit and the\n * terminal cannot drift into giving the agent different instructions for the same mode. The two\n * facets may differ only through {@link PlanHostCapabilities}, so every other sentence is shared\n * by construction.\n */\nexport function buildPlanModeBasePrompt(plansDirectory: string, capabilities: PlanHostCapabilities): string {\n const review = reviewProtocolLines(capabilities);\n return `[PLAN MODE ACTIVE]\\nYou are in repository read-only plan mode. The dedicated write_plan tool may write one unique Markdown plan file under ${plansDirectory}.\\n\\nExplore the codebase and produce a concrete implementation plan. For every plan, first call subagent with action \"agents\", cluster the exploration by independent domain, subsystem, or integration boundary, and create a provisional task graph with the task tool. Select specialized agents by matching their names and descriptions to each cluster. Assign every unblocked delegated task through the task tool, and use a one-shot inlineAgent with a focused systemPrompt when no discovered specialist fits. Treat the initial graph as provisional, not as a fixed contract. After findings arrive, review the entire graph at least once and perform one to three review passes in total. In each pass, use the evidence to add, rewrite, delete, cancel, reassign, or change blockedBy relationships for tasks when warranted. Do not keep following tasks that new information has made stale. Stop revising early when the graph is stable, or after the third pass.\\n\\nEvery plan must end with a delegated planning-draft stage blocked by all exploration and decision tasks. A single-boundary plan gets one planning draft. A complex plan spanning multiple subsystems, domains, packages, apps, or integration boundaries gets two planning drafts concurrently. Use three concurrent drafts instead when the work is cross-layer, migration-sensitive, security-sensitive, or similarly high risk. Assign each draft through the task tool to the discovered \"planner\" agent with context \"fork\" so it receives the conversation and gathered evidence. If the planner agent is unavailable, assign the same draft task through the task tool with a focused inlineAgent. All children receive read, Bash, grep, find, ls, and configured MCP tools with artifacts disabled. Bash and MCP tools are for read-only inspection and must not modify files, external systems, or repository state. Doom Team runs asynchronously, so do not poll. After launch, continue non-overlapping exploration or end your turn; completion notifications wake the parent session.\\n\\nAfter all planning drafts complete, the main agent must compare the candidates, pick the strongest draft, cross-check it against the gathered evidence and the other drafts, resolve conflicts and gaps, and ask the user only for product decisions. A child produces the draft, but the main agent owns and synthesizes the final plan. The edit and write tools are withheld while plan mode is active; do not modify files or repository state except through write_plan. Start the final plan with a meaningful Markdown H1 because write_plan derives the filename from it. Present the complete plan as visible Markdown in chat, then call write_plan with no arguments. After write_plan succeeds, clear the completed durable task graph and call complete_plan so the user can review the plan and choose whether to begin implementation or continue planning. Do not exit plan mode without explicit approval.${review.length === 0 ? '' : `\\n\\n${review.join('\\n')}`}`;\n}\n\n/** Normal planning adds only the flavor-specific brief to the shared planning workflow. */\nexport function buildNormalPlanningPrompt(): string {\n return `[PLAN MODE ACTIVE: NORMAL]\\nStandard planning: follow the plan mode brief above using the read-only tools directly.`;\n}\n\nexport function buildDebugPlanningPrompt(plansDirectory: string, evidence: DebugEvidencePacket | undefined): string {\n const guidance = evidence\n ? `A bounded debug evidence packet is recorded below. Cite its verified facts when making source findings. Keep verified facts and hypotheses distinct. Do not claim a verified root cause when reproduction or supporting evidence is unavailable.\\n\\n[DEBUG EVIDENCE]\\n${evidenceLines(evidence)}`\n : 'No structured debug evidence packet is recorded yet. First understand the reported issue, then gather only the evidence relevant to it. Recording evidence is optional and must not block source exploration, delegation, writing a plan, or completing a plan.';\n return `[PLAN MODE ACTIVE: DEBUG]\\nYou are in repository read-only adaptive debug planning. The dedicated write_plan tool may write one unique Markdown plan file under ${plansDirectory}.\\n\\n${guidance}\\n\\nUse the exact read-only tools available for the issue. Bash is available for repository inspection, but commands must not modify files or repository state. Treat unavailable evidence as unavailable, never invent its contents, and keep verified facts separate from hypotheses. ${evidence ? 'The final plan must separate verified facts from hypotheses and must not present an unsupported root cause as verified.' : 'You may call record_debug_evidence when structured notes would help, but continue investigating without it when it is not relevant.'}`;\n}\n\nexport function buildCodeReviewPlanningPrompt(plansDirectory: string): string {\n return `[PLAN MODE ACTIVE: CODE REVIEW]\\nYou are in repository read-only code review planning. The dedicated write_plan tool may write one unique Markdown review and remediation plan under ${plansDirectory}.\\n\\nReview the user-specified change, commit range, or files. When no target is specified, inspect git status and the staged and unstaged diffs; ask for the review target when there are no changes to review. Trace changed behavior through callers, contracts, and relevant tests. Focus on concrete bugs, regressions, security risks, error handling, and missing regression coverage rather than unrelated cleanup or style preferences.\\n\\nPresent actionable findings in severity order with file and line references, the affected scenario, supporting evidence, and a minimal proposed fix. Keep verified behavior separate from source-based inferences and clearly state which checks were not run. Do not invent findings; explicitly report when no actionable issues are found and note remaining risks or test gaps. Turn supported findings into a scoped remediation plan with validation steps. Do not implement fixes or modify repository state during review. Present the final review plan, save it with write_plan, and use complete_plan for explicit approval before implementation.`;\n}\n\n/** @deprecated Fable is no longer an activatable planning flavor. Retained for API compatibility. */\nexport function buildFablePlanningPrompt(\n plansDirectory: string,\n stage: string,\n capabilities: PlanHostCapabilities,\n): string {\n if (!capabilities.fableAvailable) {\n return `[PLAN MODE ACTIVE: FABLE]\\nFable planning is unavailable in this host, so plan with the read-only tools directly.`;\n }\n return `[PLAN MODE ACTIVE: FABLE]\\nYou are in repository read-only Fable planning. Pi owns final verification and synthesis. The dedicated write_plan tool may write one unique Markdown plan file under ${plansDirectory}.\\n\\nUse Pi read-only exploration first. When the bounded packet is ready, call run_fable_plan. Fable runs one fresh draft with repository inspection access and returns untrusted text. Cross-check every Fable claim against repository evidence, keep verified findings separate from explicitly inferred findings, resolve conflicts yourself, and present the final visible plan before calling write_plan. Never treat Fable output as repository evidence and never expose credentials, transcripts, commands, tools, or session data in the packet.\\n\\nCurrent Fable stage: ${stage}. An interrupted stage is not relaunched automatically.`;\n}\n\nexport function buildFlavorPlanningPrompt(\n flavor: PlanningFlavor,\n plansDirectory: string,\n evidence: DebugEvidencePacket | undefined,\n _fableStage?: string,\n _capabilities?: PlanHostCapabilities,\n): string {\n if (flavor === 'debug') return buildDebugPlanningPrompt(plansDirectory, evidence);\n if (flavor === 'code-review') return buildCodeReviewPlanningPrompt(plansDirectory);\n return buildNormalPlanningPrompt();\n}\n"],"mappings":";AAkBA,MAAM,kBAA0D;CAC9D;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACF;AAEA,SAAS,cAAc,QAAqC;CAC1D,OAAO,gBAAgB,SAAS,UAAU;EACxC,MAAM,QAAQ,OAAO;EACrB,IAAI,MAAM,QAAQ,KAAK,KAAK,MAAM,WAAW,GAAG,OAAO,CAAC;EACxD,IAAI,OAAO,UAAU,YAAY,MAAM,WAAW,GAAG,OAAO,CAAC;EAC7D,OAAO,GAAG,MAAM,IAAI,MAAM,QAAQ,KAAK,IAAI,MAAM,KAAK,KAAK,IAAI;CACjE,CAAC,CAAC,CAAC,KAAK,IAAI;AACd;;AAmBA,SAAS,oBAAoB,cAA8C;CACzE,OAAO;EACL,GAAI,aAAa,4BACb,CACE,mHACF,IACA,CAAC;EACL,GAAI,aAAa,iBACb,CACE,gIACF,IACA,CAAC;EACL,GAAI,aAAa,4BACb,CAAC,iHAA8G,IAC/G,CAAC;CACP;AACF;;;;;;;;;AAUA,SAAgB,wBAAwB,gBAAwB,cAA4C;CAC1G,MAAM,SAAS,oBAAoB,YAAY;CAC/C,OAAO,8IAA8I,eAAe,g2FAAg2F,OAAO,WAAW,IAAI,KAAK,OAAO,OAAO,KAAK,IAAI;AACxjG;;AAGA,SAAgB,4BAAoC;CAClD,OAAO;AACT;AAEA,SAAgB,yBAAyB,gBAAwB,UAAmD;CAIlH,OAAO,mKAAmK,eAAe,OAHxK,WACb,yQAAyQ,cAAc,QAAQ,MAC/R,kQACqM,0RAA0R,WAAW,4HAA4H;AAC5mB;AAEA,SAAgB,8BAA8B,gBAAgC;CAC5E,OAAO,wLAAwL,eAAe;AAChN;;AAGA,SAAgB,yBACd,gBACA,OACA,cACQ;CACR,IAAI,CAAC,aAAa,gBAChB,OAAO;CAET,OAAO,oMAAoM,eAAe,sjBAAsjB,MAAM;AACxxB;AAEA,SAAgB,0BACd,QACA,gBACA,UACA,aACA,eACQ;CACR,IAAI,WAAW,SAAS,OAAO,yBAAyB,gBAAgB,QAAQ;CAChF,IAAI,WAAW,eAAe,OAAO,8BAA8B,cAAc;CACjF,OAAO,0BAA0B;AACnC"}
|
package/dist/prompts.cjs
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
+
const require_prompts = require("./prompts-DUVUPNZd.cjs");
|
|
3
|
+
exports.buildCodeReviewPlanningPrompt = require_prompts.buildCodeReviewPlanningPrompt;
|
|
4
|
+
exports.buildDebugPlanningPrompt = require_prompts.buildDebugPlanningPrompt;
|
|
5
|
+
exports.buildFablePlanningPrompt = require_prompts.buildFablePlanningPrompt;
|
|
6
|
+
exports.buildFlavorPlanningPrompt = require_prompts.buildFlavorPlanningPrompt;
|
|
7
|
+
exports.buildNormalPlanningPrompt = require_prompts.buildNormalPlanningPrompt;
|
|
8
|
+
exports.buildPlanModeBasePrompt = require_prompts.buildPlanModeBasePrompt;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { a as buildDebugPlanningPrompt, c as buildNormalPlanningPrompt, i as buildCodeReviewPlanningPrompt, l as buildPlanModeBasePrompt, n as PlanHostCapabilities, o as buildFablePlanningPrompt, r as PlanningFlavor, s as buildFlavorPlanningPrompt, t as DebugEvidencePacket } from "./index-C9QBG9cw.mjs";
|
|
2
|
+
export { DebugEvidencePacket, PlanHostCapabilities, PlanningFlavor, buildCodeReviewPlanningPrompt, buildDebugPlanningPrompt, buildFablePlanningPrompt, buildFlavorPlanningPrompt, buildNormalPlanningPrompt, buildPlanModeBasePrompt };
|
package/dist/prompts.mjs
ADDED
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { a as buildNormalPlanningPrompt, i as buildFlavorPlanningPrompt, n as buildDebugPlanningPrompt, o as buildPlanModeBasePrompt, r as buildFablePlanningPrompt, t as buildCodeReviewPlanningPrompt } from "./prompts-DnVJGtEC.mjs";
|
|
2
|
+
export { buildCodeReviewPlanningPrompt, buildDebugPlanningPrompt, buildFablePlanningPrompt, buildFlavorPlanningPrompt, buildNormalPlanningPrompt, buildPlanModeBasePrompt };
|
package/llms.txt
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
# Doom Pi Plan
|
|
2
|
+
|
|
3
|
+
## Resources
|
|
4
|
+
|
|
5
|
+
- [Package README](./README.md): Planning flavors, review flow, model configuration, storage, and safety boundaries.
|
|
6
|
+
|
|
7
|
+
## How to use
|
|
8
|
+
|
|
9
|
+
- [po-use-plan](./src/prompts/po-use-plan/SKILL.md): Draft reviewable normal, debug, or code review plans, persist them, and exit safely.
|
package/package.json
ADDED
|
@@ -0,0 +1,164 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@agimon-ai/po-plan",
|
|
3
|
+
"version": "0.0.0-alpha.0",
|
|
4
|
+
"description": "Reviewable Pi planning mode that removes file-editing tools and persists implementation plans.",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"ai",
|
|
7
|
+
"coding-agent",
|
|
8
|
+
"developer-tools",
|
|
9
|
+
"implementation-planning",
|
|
10
|
+
"pi-coding-agent",
|
|
11
|
+
"pi-extension",
|
|
12
|
+
"pi-package",
|
|
13
|
+
"planMode",
|
|
14
|
+
"po",
|
|
15
|
+
"tool-restrictions"
|
|
16
|
+
],
|
|
17
|
+
"homepage": "https://agimon.ai",
|
|
18
|
+
"bugs": {
|
|
19
|
+
"url": "https://github.com/AgiFlow/po/issues"
|
|
20
|
+
},
|
|
21
|
+
"license": "MIT",
|
|
22
|
+
"author": "Vuong Ngo",
|
|
23
|
+
"repository": {
|
|
24
|
+
"type": "git",
|
|
25
|
+
"url": "git+https://github.com/AgiFlow/po.git",
|
|
26
|
+
"directory": "packages/minor/po-plan"
|
|
27
|
+
},
|
|
28
|
+
"files": [
|
|
29
|
+
"dist",
|
|
30
|
+
"llms.txt",
|
|
31
|
+
"src/prompts",
|
|
32
|
+
"src/types/planApi.ts",
|
|
33
|
+
"src/types/planSettings.ts",
|
|
34
|
+
"README.md",
|
|
35
|
+
"LICENSE",
|
|
36
|
+
"package.json"
|
|
37
|
+
],
|
|
38
|
+
"type": "module",
|
|
39
|
+
"main": "./dist/index.cjs",
|
|
40
|
+
"module": "./dist/index.mjs",
|
|
41
|
+
"types": "./dist/index.d.mts",
|
|
42
|
+
"jsnext:main": "./dist/index.mjs",
|
|
43
|
+
"exports": {
|
|
44
|
+
".": {
|
|
45
|
+
"types": "./dist/index.d.mts",
|
|
46
|
+
"import": "./dist/index.mjs",
|
|
47
|
+
"require": "./dist/index.cjs"
|
|
48
|
+
},
|
|
49
|
+
"./config": {
|
|
50
|
+
"types": "./dist/config.d.mts",
|
|
51
|
+
"import": "./dist/config.mjs",
|
|
52
|
+
"require": "./dist/config.cjs"
|
|
53
|
+
},
|
|
54
|
+
"./extensions/server": {
|
|
55
|
+
"types": "./dist/extensions/server.d.mts",
|
|
56
|
+
"import": "./dist/extensions/server.mjs",
|
|
57
|
+
"require": "./dist/extensions/server.cjs"
|
|
58
|
+
},
|
|
59
|
+
"./extensions/web": {
|
|
60
|
+
"import": "./dist/extensions/web.mjs"
|
|
61
|
+
},
|
|
62
|
+
"./fableFlow": {
|
|
63
|
+
"types": "./dist/fableFlow.d.mts",
|
|
64
|
+
"import": "./dist/fableFlow.mjs",
|
|
65
|
+
"require": "./dist/fableFlow.cjs"
|
|
66
|
+
},
|
|
67
|
+
"./logSinkTelemetry": {
|
|
68
|
+
"types": "./dist/logSinkTelemetry.d.mts",
|
|
69
|
+
"import": "./dist/logSinkTelemetry.mjs",
|
|
70
|
+
"require": "./dist/logSinkTelemetry.cjs"
|
|
71
|
+
},
|
|
72
|
+
"./planConfig": {
|
|
73
|
+
"types": "./dist/planConfig.d.mts",
|
|
74
|
+
"import": "./dist/planConfig.mjs",
|
|
75
|
+
"require": "./dist/planConfig.cjs"
|
|
76
|
+
},
|
|
77
|
+
"./prompts": {
|
|
78
|
+
"types": "./dist/prompts.d.mts",
|
|
79
|
+
"import": "./dist/prompts.mjs",
|
|
80
|
+
"require": "./dist/prompts.cjs"
|
|
81
|
+
},
|
|
82
|
+
"./package.json": "./package.json"
|
|
83
|
+
},
|
|
84
|
+
"publishConfig": {
|
|
85
|
+
"access": "public",
|
|
86
|
+
"registry": "https://registry.npmjs.org/"
|
|
87
|
+
},
|
|
88
|
+
"dependencies": {
|
|
89
|
+
"@agimon-ai/po-config": "0.0.0-alpha.0",
|
|
90
|
+
"@agimon-ai/po-core": "0.0.0-alpha.0",
|
|
91
|
+
"@agimon-ai/po-minor-mode": "0.0.0-alpha.0",
|
|
92
|
+
"@agimon-ai/po-telemetry": "0.0.0-alpha.0",
|
|
93
|
+
"@agimon-ai/po-web-components": "0.0.0-alpha.0",
|
|
94
|
+
"@agimon-ai/po-web-security": "0.0.0-alpha.0",
|
|
95
|
+
"@deepseek-ai/cordis": "4.0.4",
|
|
96
|
+
"hono": "4.13.12",
|
|
97
|
+
"typebox": "1.3.34"
|
|
98
|
+
},
|
|
99
|
+
"devDependencies": {
|
|
100
|
+
"@agimon-ai/po-build": "0.0.0-alpha.0",
|
|
101
|
+
"@earendil-works/pi-coding-agent": "1.0.2",
|
|
102
|
+
"@tanstack/react-store": "0.11.2",
|
|
103
|
+
"@tanstack/store": "0.11.2",
|
|
104
|
+
"@types/node": "26.6.4",
|
|
105
|
+
"@types/react": "19.3.0",
|
|
106
|
+
"@types/react-dom": "19.3.0",
|
|
107
|
+
"@vitest/coverage-v8": "5.0.3",
|
|
108
|
+
"react": "19.3.0",
|
|
109
|
+
"react-dom": "19.3.0",
|
|
110
|
+
"typescript": "7.0.2",
|
|
111
|
+
"vitest": "5.0.3"
|
|
112
|
+
},
|
|
113
|
+
"peerDependencies": {
|
|
114
|
+
"@earendil-works/pi-coding-agent": "1.0.2"
|
|
115
|
+
},
|
|
116
|
+
"engines": {
|
|
117
|
+
"node": ">=24"
|
|
118
|
+
},
|
|
119
|
+
"poMcp": {
|
|
120
|
+
"entry": "./generated/mcp.ts",
|
|
121
|
+
"dist": "./dist/extensions/mcp.mjs",
|
|
122
|
+
"scopes": [
|
|
123
|
+
"session"
|
|
124
|
+
],
|
|
125
|
+
"ui": {
|
|
126
|
+
"entry": "./generated/mcp-ui.ts",
|
|
127
|
+
"dist": "./dist/extensions/mcp-ui.mjs",
|
|
128
|
+
"widgets": [
|
|
129
|
+
"@agimon-ai/po-plan/complete_plan",
|
|
130
|
+
"@agimon-ai/po-plan/record_debug_evidence",
|
|
131
|
+
"@agimon-ai/po-plan/write_plan"
|
|
132
|
+
]
|
|
133
|
+
}
|
|
134
|
+
},
|
|
135
|
+
"poServer": {
|
|
136
|
+
"entry": "./generated/server.ts",
|
|
137
|
+
"dist": "./dist/extensions/server.mjs",
|
|
138
|
+
"scopes": [
|
|
139
|
+
"session"
|
|
140
|
+
],
|
|
141
|
+
"contracts": {
|
|
142
|
+
"entry": "./src/exports/apiContracts.ts",
|
|
143
|
+
"dist": "./dist/apiContracts.mjs"
|
|
144
|
+
}
|
|
145
|
+
},
|
|
146
|
+
"poWeb": {
|
|
147
|
+
"pluginId": "plan",
|
|
148
|
+
"channels": [],
|
|
149
|
+
"client": "./dist/extensions/web.mjs",
|
|
150
|
+
"scopes": [
|
|
151
|
+
"global",
|
|
152
|
+
"workspace",
|
|
153
|
+
"session"
|
|
154
|
+
]
|
|
155
|
+
},
|
|
156
|
+
"scripts": {
|
|
157
|
+
"build": "tsdown && tsdown --config tsdown.mcp.config.ts",
|
|
158
|
+
"build:mcp": "tsdown --config tsdown.mcp.config.ts",
|
|
159
|
+
"test": "vitest --run",
|
|
160
|
+
"typecheck": "tsc --noEmit && tsc --noEmit -p tsconfig.web.json && tsc --noEmit -p tsconfig.mcp.json",
|
|
161
|
+
"lint": "oxlint . && oxfmt . --check",
|
|
162
|
+
"fixcode": "oxlint . --fix && oxfmt ."
|
|
163
|
+
}
|
|
164
|
+
}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: po-use-plan
|
|
3
|
+
description: Use Doom Pi Plan to draft reviewable normal, debug, or code review plans, persist them, and exit safely.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Use Doom Pi Plan
|
|
7
|
+
|
|
8
|
+
Use Plan when the user wants investigation and a reviewable implementation plan before repository changes.
|
|
9
|
+
|
|
10
|
+
## Remote MCP workflow
|
|
11
|
+
|
|
12
|
+
Call `load_context` to inspect the bound session and its active minor modes.
|
|
13
|
+
Use the available inspection tools to investigate and present the complete plan
|
|
14
|
+
as visible Markdown. Separate verified facts from hypotheses.
|
|
15
|
+
|
|
16
|
+
When Plan mode is already active, call `write_plan` with that exact text in the
|
|
17
|
+
`markdown` argument. Use the returned path with `read` to verify the saved text.
|
|
18
|
+
The host file is not a downloadable ChatGPT attachment. Do not substitute local
|
|
19
|
+
transcript content or claim that saving authorizes implementation.
|
|
20
|
+
|
|
21
|
+
When Plan mode is inactive, present the plan in chat and explain that persistence
|
|
22
|
+
requires the user to activate Plan mode in Po. Do not change modes through
|
|
23
|
+
Bash or a hidden interface to bypass that gate.
|
|
24
|
+
|
|
25
|
+
`complete_plan` requests approval in the local Po UI, not in ChatGPT. Only use
|
|
26
|
+
it when the user intends to review there. An explicit instruction in chat does
|
|
27
|
+
not itself exit server Plan mode. Do not simulate approval or bypass mode gates.
|
|
28
|
+
During autonomous Voice, the headless UI-only `complete_plan` tool is unavailable.
|
|
29
|
+
Supply Markdown to `write_plan`; it will not open a UI input dialog in that mode.
|
|
30
|
+
Present the plan and wait for explicit user direction, never approve it yourself.
|
|
31
|
+
Use repository inspection directly and do not launch background subagents through this remote workflow.
|
|
32
|
+
|
|
33
|
+
## Local Po workflow
|
|
34
|
+
|
|
35
|
+
The local TUI uses `SPC p e` for normal planning, `SPC p d` for debugging, and
|
|
36
|
+
`SPC p r` for Code Review. These are local shortcuts, not
|
|
37
|
+
remote tools. The local no-argument `write_plan` reads the visible plan from its
|
|
38
|
+
own session. `complete_plan` requires the user's explicit exit-or-continue choice.
|
|
39
|
+
|
|
40
|
+
Plan withholds `edit` and `write` while it is active, and adds its own tools without removing anything else. `bash` is not sandboxed: do not mutate the repository while planning, except to save the plan through `write_plan`. If exit restoration fails, report the failure and continue planning without starting implementation.
|
|
41
|
+
|
|
42
|
+
## Code Review planning
|
|
43
|
+
|
|
44
|
+
Select Code Review to inspect the requested diff, commit range, or files without editing them. Start with staged and unstaged changes when no target is specified. Report concrete findings in severity order with file and line references, distinguish verified behavior from source-based inferences, and propose the smallest fixes with validation steps. State when no actionable findings exist. Save the review and remediation plan with `write_plan`; implementation still requires explicit approval.
|
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The wire vocabulary this package's API shares with whatever calls it.
|
|
3
|
+
*
|
|
4
|
+
* It lives under src/types because that is the one server root a browser
|
|
5
|
+
* bundle may read: the routes answer with these shapes and the cockpit plugin
|
|
6
|
+
* reads them, so neither half can drift from the other. The paths themselves
|
|
7
|
+
* are not here; they are declared once in `./apiRoutes`, which the Hono app
|
|
8
|
+
* and the generated client both read.
|
|
9
|
+
*
|
|
10
|
+
* Two routes, and neither takes a path. A session has one current plan, so
|
|
11
|
+
* `current` answers it and `content` takes the manual save back; the file they
|
|
12
|
+
* act on is the one write_plan recorded, never one the page named. That is
|
|
13
|
+
* also why there is nothing to escape here: a reader cannot address a second
|
|
14
|
+
* file through these URLs.
|
|
15
|
+
*/
|
|
16
|
+
|
|
17
|
+
/** Where a host mounts this package's API; the segment after /api/plugins/. */
|
|
18
|
+
export const API_BASE_PATH = 'plans';
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* Footer status key the session publishes once a plan exists, which is what
|
|
22
|
+
* makes the cockpit's activity group appear at all. It outlives plan mode: the
|
|
23
|
+
* plan is most worth reading while the agent implements it.
|
|
24
|
+
*/
|
|
25
|
+
export const PLAN_STATUS_KEY = 'doom-plan-document';
|
|
26
|
+
|
|
27
|
+
/** The selector contract shared by complete_plan and its cockpit composer prompt. */
|
|
28
|
+
export const PLAN_REVIEW_TITLE = 'Plan complete. What would you like to do?';
|
|
29
|
+
export const EXIT_PLAN_MODE_CHOICE = 'Exit plan mode and start implementation';
|
|
30
|
+
export const CONTINUE_PLANNING_CHOICE = 'Continue planning';
|
|
31
|
+
export const EXIT_PLAN_DECISION = 'exit';
|
|
32
|
+
export const CONTINUE_PLAN_DECISION = 'continue';
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* The label the reader sees paired with the decision the tool acts on. A headless
|
|
36
|
+
* client answers with `value`, so a facet never has to recognise the wording; Pi's
|
|
37
|
+
* own `ui.select` carries labels only, so its half maps the label back itself.
|
|
38
|
+
*/
|
|
39
|
+
export const PLAN_REVIEW_CHOICES = [
|
|
40
|
+
{ label: EXIT_PLAN_MODE_CHOICE, value: EXIT_PLAN_DECISION },
|
|
41
|
+
{ label: CONTINUE_PLANNING_CHOICE, value: CONTINUE_PLAN_DECISION },
|
|
42
|
+
] as const;
|
|
43
|
+
|
|
44
|
+
/** The same options as bare labels, which is all Pi's select and the composer prompt need. */
|
|
45
|
+
export const PLAN_REVIEW_OPTIONS = PLAN_REVIEW_CHOICES.map((choice) => choice.label);
|
|
46
|
+
|
|
47
|
+
/** Between the plan's title and the stamp that marks a rewrite. */
|
|
48
|
+
const STATUS_SEPARATOR = ' · ';
|
|
49
|
+
|
|
50
|
+
/** Strips the colour a session may have themed a status with. */
|
|
51
|
+
const ANSI = /\[[0-9;]*m/gu;
|
|
52
|
+
|
|
53
|
+
/** The status line the session publishes; the stamp changes on every write. */
|
|
54
|
+
export function formatPlanStatus(title: string, stamp: string): string {
|
|
55
|
+
return `${title}${STATUS_SEPARATOR}${stamp}`;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
/** What a reader gets out of the status line. */
|
|
59
|
+
export interface PlanStatusView {
|
|
60
|
+
title: string;
|
|
61
|
+
/** When the plan was last written, as the session worded it; empty when it said nothing. */
|
|
62
|
+
stamp: string;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
/**
|
|
66
|
+
* Reading the status line back. Statuses reach a plugin raw, so the colour a
|
|
67
|
+
* session may have added comes off here. A title can itself contain the
|
|
68
|
+
* separator, so the stamp is taken from the last one rather than the first.
|
|
69
|
+
*/
|
|
70
|
+
export function parsePlanStatus(raw: string | undefined): PlanStatusView | undefined {
|
|
71
|
+
if (raw === undefined) return undefined;
|
|
72
|
+
const text = raw.replace(ANSI, '').trim();
|
|
73
|
+
if (text === '') return undefined;
|
|
74
|
+
const cut = text.lastIndexOf(STATUS_SEPARATOR);
|
|
75
|
+
if (cut === -1) return { title: text, stamp: '' };
|
|
76
|
+
return { title: text.slice(0, cut).trim(), stamp: text.slice(cut + STATUS_SEPARATOR.length).trim() };
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
/**
|
|
80
|
+
* What write_plan recorded about this session's plan.
|
|
81
|
+
*
|
|
82
|
+
* The absolute path is the point of it: the extension resolves the plans
|
|
83
|
+
* directory against the harness root, which no other process knows, so it
|
|
84
|
+
* writes down where the plan landed rather than leaving the API to derive a
|
|
85
|
+
* location it would sometimes get wrong.
|
|
86
|
+
*/
|
|
87
|
+
export interface PlanPointerRecord {
|
|
88
|
+
path: string;
|
|
89
|
+
title: string;
|
|
90
|
+
writtenAt: string;
|
|
91
|
+
planId?: string;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
/** The plan as it stands on disk right now, which is what the source view edits. */
|
|
95
|
+
export interface PlanDetailView {
|
|
96
|
+
path: string;
|
|
97
|
+
title: string;
|
|
98
|
+
writtenAt: string;
|
|
99
|
+
planId?: string;
|
|
100
|
+
content: string;
|
|
101
|
+
/** sha256 of the content; the token a save hands back to prove it is not stale. */
|
|
102
|
+
hash: string;
|
|
103
|
+
/** True when the plan is missing or past the size cap, so `content` is empty. */
|
|
104
|
+
unavailable: boolean;
|
|
105
|
+
reason?: string;
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
/** What the save route takes. */
|
|
109
|
+
export interface PlanSaveRequest {
|
|
110
|
+
/** The hash the reader loaded; a mismatch means the plan moved underneath them. */
|
|
111
|
+
expectedHash: string;
|
|
112
|
+
content: string;
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
/** What the save route answers with. */
|
|
116
|
+
export interface PlanSaveView {
|
|
117
|
+
hash: string;
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
/** What a route reports when it refuses; the page shows `error` verbatim. */
|
|
121
|
+
export interface PlanErrorView {
|
|
122
|
+
error: string;
|
|
123
|
+
/** On a stale save, the hash the plan actually has now. */
|
|
124
|
+
hash?: string;
|
|
125
|
+
}
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The planning settings, described once for both surfaces.
|
|
3
|
+
*
|
|
4
|
+
* The terminal panel and the cockpit settings page render the same five fields,
|
|
5
|
+
* and the one thing they must agree on is which config key each one writes. So
|
|
6
|
+
* the ids, labels and key paths live here rather than in either renderer.
|
|
7
|
+
*
|
|
8
|
+
* It lives under src/types because that is the one server root a browser bundle
|
|
9
|
+
* may read, which also means it may import nothing: pulling the config package
|
|
10
|
+
* in for the thinking levels would drag a node module into the page. They are
|
|
11
|
+
* spelled out instead, and a test asserts they still match the parser's.
|
|
12
|
+
*/
|
|
13
|
+
|
|
14
|
+
export const PLAN_CONFIG_SECTION_ID = 'planning';
|
|
15
|
+
const PLANNING_PATH = ['modes', PLAN_CONFIG_SECTION_ID] as const;
|
|
16
|
+
const MAIN_KEY = 'main';
|
|
17
|
+
const SUBAGENTS_KEY = 'subagents';
|
|
18
|
+
|
|
19
|
+
/** Both agents fall back to the session's own settings when left unset. */
|
|
20
|
+
const INHERIT_MODEL = 'inherit the session model';
|
|
21
|
+
const INHERIT_THINKING = 'inherit';
|
|
22
|
+
|
|
23
|
+
/** Mirrors DOOM_PLANNING_THINKING_LEVELS; pinned by planConfig's test. */
|
|
24
|
+
export const PLAN_THINKING_LEVELS: readonly string[] = ['off', 'minimal', 'low', 'medium', 'high', 'xhigh', 'max'];
|
|
25
|
+
|
|
26
|
+
export interface PlanSettingShape {
|
|
27
|
+
readonly id: string;
|
|
28
|
+
readonly label: string;
|
|
29
|
+
readonly keyPath: readonly string[];
|
|
30
|
+
readonly placeholder: string;
|
|
31
|
+
readonly detail: string;
|
|
32
|
+
/** Present for a closed set; a renderer offers these rather than free text. */
|
|
33
|
+
readonly options?: readonly string[];
|
|
34
|
+
/** Offers the machine's authenticated models rather than free text. */
|
|
35
|
+
readonly models?: boolean;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
export const PLAN_SETTING_SHAPES: readonly PlanSettingShape[] = [
|
|
39
|
+
{
|
|
40
|
+
id: 'main.model',
|
|
41
|
+
label: 'main model',
|
|
42
|
+
keyPath: [...PLANNING_PATH, MAIN_KEY, 'model'],
|
|
43
|
+
placeholder: INHERIT_MODEL,
|
|
44
|
+
detail: 'model the main agent switches to while plan mode is on.',
|
|
45
|
+
models: true,
|
|
46
|
+
},
|
|
47
|
+
{
|
|
48
|
+
id: 'main.thinking',
|
|
49
|
+
label: 'main thinking',
|
|
50
|
+
keyPath: [...PLANNING_PATH, MAIN_KEY, 'thinking'],
|
|
51
|
+
placeholder: INHERIT_THINKING,
|
|
52
|
+
detail: 'thinking level appended to the main model while planning.',
|
|
53
|
+
options: PLAN_THINKING_LEVELS,
|
|
54
|
+
},
|
|
55
|
+
{
|
|
56
|
+
id: 'subagents.model',
|
|
57
|
+
label: 'subagent model',
|
|
58
|
+
keyPath: [...PLANNING_PATH, SUBAGENTS_KEY, 'model'],
|
|
59
|
+
placeholder: INHERIT_MODEL,
|
|
60
|
+
detail: 'model forced onto delegated planning subagents.',
|
|
61
|
+
models: true,
|
|
62
|
+
},
|
|
63
|
+
{
|
|
64
|
+
id: 'subagents.thinking',
|
|
65
|
+
label: 'subagent thinking',
|
|
66
|
+
keyPath: [...PLANNING_PATH, SUBAGENTS_KEY, 'thinking'],
|
|
67
|
+
placeholder: INHERIT_THINKING,
|
|
68
|
+
detail: 'thinking level appended to the subagent model.',
|
|
69
|
+
options: PLAN_THINKING_LEVELS,
|
|
70
|
+
},
|
|
71
|
+
{
|
|
72
|
+
id: 'plansdirectory',
|
|
73
|
+
label: 'plans directory',
|
|
74
|
+
keyPath: [...PLANNING_PATH, 'plansDirectory'],
|
|
75
|
+
placeholder: '~/.po/plans',
|
|
76
|
+
detail: 'absolute, repo-relative, or under ~. written plans land here.',
|
|
77
|
+
},
|
|
78
|
+
];
|