@agimon-ai/po-plan 0.0.0-alpha.2 → 0.0.0-alpha.21
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 +149 -21
- package/README.md +2 -2
- package/dist/config-1hJV8Z69.mjs +25 -0
- package/dist/config-1hJV8Z69.mjs.map +1 -0
- package/dist/config-BGEbU75i.d.mts +13 -0
- package/dist/config-BGEbU75i.d.mts.map +1 -0
- package/dist/config-BjNpZeNO.cjs +42 -0
- package/dist/config-BjNpZeNO.cjs.map +1 -0
- package/dist/config.cjs +40 -10
- package/dist/config.d.mts +2 -2
- package/dist/config.mjs +1 -2
- package/dist/extensions/mcp-ui.mjs.map +1 -1
- package/dist/extensions/mcp.cjs +4 -4
- package/dist/extensions/mcp.cjs.map +1 -1
- package/dist/extensions/mcp.d.mts +1 -1
- package/dist/extensions/mcp.mjs +3 -3
- package/dist/extensions/mcp.mjs.map +1 -1
- package/dist/extensions/native.mjs +1 -1
- package/dist/extensions/native.mjs.map +1 -1
- package/dist/extensions/server.cjs +25 -24
- package/dist/extensions/server.cjs.map +1 -1
- package/dist/extensions/server.d.mts +2 -2
- package/dist/extensions/server.d.mts.map +1 -1
- package/dist/extensions/server.mjs +24 -23
- package/dist/extensions/server.mjs.map +1 -1
- package/dist/extensions/web.mjs +23 -23
- package/dist/extensions/web.mjs.map +1 -1
- package/dist/fableFlow.mjs +1 -2
- package/dist/{index-C9QBG9cw.d.mts → index-Dc38rONO.d.mts} +3 -3
- package/dist/{index-C9QBG9cw.d.mts.map → index-Dc38rONO.d.mts.map} +1 -1
- package/dist/index.cjs +41 -11
- package/dist/index.d.mts +3 -3
- package/dist/index.mjs +3 -3
- package/dist/logSinkTelemetry.cjs +12 -12
- package/dist/logSinkTelemetry.cjs.map +1 -1
- package/dist/logSinkTelemetry.d.mts +12 -12
- package/dist/logSinkTelemetry.mjs +13 -13
- package/dist/logSinkTelemetry.mjs.map +1 -1
- package/dist/planConfig.cjs +1 -1
- package/dist/planConfig.cjs.map +1 -1
- package/dist/planConfig.d.mts +2 -1
- package/dist/planConfig.mjs +1 -1
- package/dist/planConfig.mjs.map +1 -1
- package/dist/{prompts-DnVJGtEC.mjs → prompts-C32Hrpem.mjs} +4 -4
- package/dist/prompts-C32Hrpem.mjs.map +1 -0
- package/dist/{prompts-DUVUPNZd.cjs → prompts-xBLz0h6f.cjs} +4 -4
- package/dist/prompts-xBLz0h6f.cjs.map +1 -0
- package/dist/prompts.cjs +1 -1
- package/dist/prompts.d.mts +1 -1
- package/dist/prompts.mjs +1 -2
- package/llms.txt +1 -1
- package/package.json +21 -21
- package/src/prompts/po-use-plan/SKILL.md +2 -2
- package/src/types/planApi.ts +2 -2
- package/src/types/planSettings.ts +1 -1
- package/dist/config-BC-Tou05.mjs +0 -25
- package/dist/config-BC-Tou05.mjs.map +0 -1
- package/dist/config-D0iTexGm.cjs +0 -42
- package/dist/config-D0iTexGm.cjs.map +0 -1
- package/dist/config-DWo57HKB.d.mts +0 -13
- package/dist/config-DWo57HKB.d.mts.map +0 -1
- package/dist/prompts-DUVUPNZd.cjs.map +0 -1
- package/dist/prompts-DnVJGtEC.mjs.map +0 -1
package/dist/planConfig.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"planConfig.cjs","names":["CONFIG_ACTION"],"sources":["../src/types/planSettings.ts","../src/schemas/plan/planConfig.ts"],"sourcesContent":["/**\n * The planning settings, described once for both surfaces.\n *\n * The terminal panel and the cockpit settings page render the same five fields,\n * and the one thing they must agree on is which config key each one writes. So\n * the ids, labels and key paths live here rather than in either renderer.\n *\n * It lives under src/types because that is the one server root a browser bundle\n * may read, which also means it may import nothing: pulling the config package\n * in for the thinking levels would drag a node module into the page. They are\n * spelled out instead, and a test asserts they still match the parser's.\n */\n\nexport const PLAN_CONFIG_SECTION_ID = 'planning';\nconst PLANNING_PATH = ['modes', PLAN_CONFIG_SECTION_ID] as const;\nconst MAIN_KEY = 'main';\nconst SUBAGENTS_KEY = 'subagents';\n\n/** Both agents fall back to the session's own settings when left unset. */\nconst INHERIT_MODEL = 'inherit the session model';\nconst INHERIT_THINKING = 'inherit';\n\n/** Mirrors DOOM_PLANNING_THINKING_LEVELS; pinned by planConfig's test. */\nexport const PLAN_THINKING_LEVELS: readonly string[] = ['off', 'minimal', 'low', 'medium', 'high', 'xhigh', 'max'];\n\nexport interface PlanSettingShape {\n readonly id: string;\n readonly label: string;\n readonly keyPath: readonly string[];\n readonly placeholder: string;\n readonly detail: string;\n /** Present for a closed set; a renderer offers these rather than free text. */\n readonly options?: readonly string[];\n /** Offers the machine's authenticated models rather than free text. */\n readonly models?: boolean;\n}\n\nexport const PLAN_SETTING_SHAPES: readonly PlanSettingShape[] = [\n {\n id: 'main.model',\n label: 'main model',\n keyPath: [...PLANNING_PATH, MAIN_KEY, 'model'],\n placeholder: INHERIT_MODEL,\n detail: 'model the main agent switches to while plan mode is on.',\n models: true,\n },\n {\n id: 'main.thinking',\n label: 'main thinking',\n keyPath: [...PLANNING_PATH, MAIN_KEY, 'thinking'],\n placeholder: INHERIT_THINKING,\n detail: 'thinking level appended to the main model while planning.',\n options: PLAN_THINKING_LEVELS,\n },\n {\n id: 'subagents.model',\n label: 'subagent model',\n keyPath: [...PLANNING_PATH, SUBAGENTS_KEY, 'model'],\n placeholder: INHERIT_MODEL,\n detail: 'model forced onto delegated planning subagents.',\n models: true,\n },\n {\n id: 'subagents.thinking',\n label: 'subagent thinking',\n keyPath: [...PLANNING_PATH, SUBAGENTS_KEY, 'thinking'],\n placeholder: INHERIT_THINKING,\n detail: 'thinking level appended to the subagent model.',\n options: PLAN_THINKING_LEVELS,\n },\n {\n id: 'plansdirectory',\n label: 'plans directory',\n keyPath: [...PLANNING_PATH, 'plansDirectory'],\n placeholder: '~/.po/plans',\n detail: 'absolute, repo-relative, or under ~. written plans land here.',\n },\n];\n","/**\n * Plan mode's slice of the `SPC e c` config panel.\n *\n * Plan mode reads `modes.planning` from disk on every activation, so an edit\n * here lands on the next time the mode is turned on with no restart and nothing\n * to invalidate.\n *\n * The descriptor table is the whole design: the panel renders it and the write\n * handler looks the key path back up in it, so adding a setting means adding a\n * row rather than a case.\n */\n\nimport { CONFIG_ACTION, type ConfigChoice, type ConfigField, type ConfigSection } from '@agimon-ai/po-core/config';\n\nimport { PLAN_CONFIG_SECTION_ID, PLAN_SETTING_SHAPES, type PlanSettingShape } from '../../types/planSettings';\nimport type { PlanningModeConfig } from './config';\n\nexport { PLAN_CONFIG_SECTION_ID };\nconst SECTION_ORDER = 30;\n/** Selecting this clears the setting, which is how the file spells \"inherit\". */\nconst INHERIT_CHOICE_ID = 'inherit';\n\n/**\n * A planning setting as the terminal panel needs it: the shared shape, plus how\n * to read the value out of a loaded config. The reader stays here because it\n * touches the parsed config types, which the browser half never sees.\n */\nexport interface PlanSettingDescriptor extends PlanSettingShape {\n readonly read: (config: PlanningModeConfig | undefined) => string | undefined;\n}\n\nconst READERS: Readonly<Record<string, (config: PlanningModeConfig | undefined) => string | undefined>> = {\n 'main.model': (config) => config?.main?.model,\n 'main.thinking': (config) => config?.main?.thinking,\n 'subagents.model': (config) => config?.subagents?.model,\n 'subagents.thinking': (config) => config?.subagents?.thinking,\n plansdirectory: (config) => config?.plansDirectory,\n};\n\nexport const PLAN_SETTINGS: readonly PlanSettingDescriptor[] = PLAN_SETTING_SHAPES.map((shape) => ({\n ...shape,\n read: READERS[shape.id]!,\n}));\n\nexport function planSettingByFieldId(fieldId: string): PlanSettingDescriptor | undefined {\n return PLAN_SETTINGS.find((setting) => setting.id === fieldId);\n}\n\n/** A model this session could actually switch to, as the panel offers it. */\nexport interface PlanModelChoice {\n readonly provider: string;\n readonly id: string;\n}\n\n/**\n * The models the session can reach, plus the entry that clears the setting.\n *\n * Offered as a list because a model spec is `provider/id` and typing one from\n * memory is how a setting ends up naming a model this session cannot use. The\n * inherit entry CLEARS rather than writing a value: unset is what \"use the\n * session's own model\" means in the file.\n */\nfunction modelChoices(models: readonly PlanModelChoice[]): ConfigChoice[] {\n const inherit: ConfigChoice = {\n id: INHERIT_CHOICE_ID,\n label: PLAN_SETTING_SHAPES.find((shape) => shape.models === true)?.placeholder ?? INHERIT_CHOICE_ID,\n detail: 'Leaves the setting unset.',\n action: CONFIG_ACTION.clear,\n };\n return [\n inherit,\n ...models.map((model): ConfigChoice => ({\n id: `${model.provider}/${model.id}`,\n label: model.id,\n group: model.provider,\n detail: model.provider,\n action: CONFIG_ACTION.set,\n })),\n ];\n}\n\nfunction choicesFor(\n setting: PlanSettingDescriptor,\n models: readonly PlanModelChoice[],\n): { choices: ConfigChoice[]; kind: 'enum' | 'choice' } | undefined {\n // `set` rather than a bespoke action: choosing a level is the same write as\n // typing one, so it shares the handler.\n if (setting.options) {\n return {\n kind: 'enum',\n choices: setting.options.map((option) => ({ id: option, label: option, action: CONFIG_ACTION.set })),\n };\n }\n // A model setting with nothing to offer stays free text rather than opening\n // an empty list: a session with no authenticated provider can still be edited.\n if (!setting.models || models.length === 0) return undefined;\n return { kind: 'choice', choices: modelChoices(models) };\n}\n\nexport function planConfigSections(\n config: PlanningModeConfig | undefined,\n notice?: string,\n models: readonly PlanModelChoice[] = [],\n): readonly ConfigSection[] {\n const fields: ConfigField[] = PLAN_SETTINGS.map((setting) => {\n const value = setting.read(config);\n const offered = choicesFor(setting, models);\n return {\n id: setting.id,\n label: setting.label,\n kind: offered?.kind ?? ('text' as const),\n keyPath: setting.keyPath.join('.'),\n placeholder: setting.placeholder,\n detail: setting.detail,\n ...(value ? { value } : {}),\n ...(offered ? { choices: offered.choices } : {}),\n };\n });\n return [\n {\n id: PLAN_CONFIG_SECTION_ID,\n title: 'planning',\n order: SECTION_ORDER,\n detail: 'plan mode',\n fields,\n ...(notice ? { notice, noticeLevel: 'error' as const } : {}),\n },\n ];\n}\n"],"mappings":"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"}
|
|
1
|
+
{"version":3,"file":"planConfig.cjs","names":["CONFIG_ACTION"],"sources":["../src/types/planSettings.ts","../src/schemas/plan/planConfig.ts"],"sourcesContent":["/**\n * The planning settings, described once for both surfaces.\n *\n * The terminal panel and the cockpit settings page render the same five fields,\n * and the one thing they must agree on is which config key each one writes. So\n * the ids, labels and key paths live here rather than in either renderer.\n *\n * It lives under src/types because that is the one server root a browser bundle\n * may read, which also means it may import nothing: pulling the config package\n * in for the thinking levels would drag a node module into the page. They are\n * spelled out instead, and a test asserts they still match the parser's.\n */\n\nexport const PLAN_CONFIG_SECTION_ID = 'planning';\nconst PLANNING_PATH = ['modes', PLAN_CONFIG_SECTION_ID] as const;\nconst MAIN_KEY = 'main';\nconst SUBAGENTS_KEY = 'subagents';\n\n/** Both agents fall back to the session's own settings when left unset. */\nconst INHERIT_MODEL = 'inherit the session model';\nconst INHERIT_THINKING = 'inherit';\n\n/** Mirrors PO_PLANNING_THINKING_LEVELS; pinned by planConfig's test. */\nexport const PLAN_THINKING_LEVELS: readonly string[] = ['off', 'minimal', 'low', 'medium', 'high', 'xhigh', 'max'];\n\nexport interface PlanSettingShape {\n readonly id: string;\n readonly label: string;\n readonly keyPath: readonly string[];\n readonly placeholder: string;\n readonly detail: string;\n /** Present for a closed set; a renderer offers these rather than free text. */\n readonly options?: readonly string[];\n /** Offers the machine's authenticated models rather than free text. */\n readonly models?: boolean;\n}\n\nexport const PLAN_SETTING_SHAPES: readonly PlanSettingShape[] = [\n {\n id: 'main.model',\n label: 'main model',\n keyPath: [...PLANNING_PATH, MAIN_KEY, 'model'],\n placeholder: INHERIT_MODEL,\n detail: 'model the main agent switches to while plan mode is on.',\n models: true,\n },\n {\n id: 'main.thinking',\n label: 'main thinking',\n keyPath: [...PLANNING_PATH, MAIN_KEY, 'thinking'],\n placeholder: INHERIT_THINKING,\n detail: 'thinking level appended to the main model while planning.',\n options: PLAN_THINKING_LEVELS,\n },\n {\n id: 'subagents.model',\n label: 'subagent model',\n keyPath: [...PLANNING_PATH, SUBAGENTS_KEY, 'model'],\n placeholder: INHERIT_MODEL,\n detail: 'model forced onto delegated planning subagents.',\n models: true,\n },\n {\n id: 'subagents.thinking',\n label: 'subagent thinking',\n keyPath: [...PLANNING_PATH, SUBAGENTS_KEY, 'thinking'],\n placeholder: INHERIT_THINKING,\n detail: 'thinking level appended to the subagent model.',\n options: PLAN_THINKING_LEVELS,\n },\n {\n id: 'plansdirectory',\n label: 'plans directory',\n keyPath: [...PLANNING_PATH, 'plansDirectory'],\n placeholder: '~/.po/plans',\n detail: 'absolute, repo-relative, or under ~. written plans land here.',\n },\n];\n","/**\n * Plan mode's slice of the `SPC e c` config panel.\n *\n * Plan mode reads `modes.planning` from disk on every activation, so an edit\n * here lands on the next time the mode is turned on with no restart and nothing\n * to invalidate.\n *\n * The descriptor table is the whole design: the panel renders it and the write\n * handler looks the key path back up in it, so adding a setting means adding a\n * row rather than a case.\n */\n\nimport { CONFIG_ACTION, type ConfigChoice, type ConfigField, type ConfigSection } from '@agimon-ai/po-core/config';\n\nimport { PLAN_CONFIG_SECTION_ID, PLAN_SETTING_SHAPES, type PlanSettingShape } from '../../types/planSettings';\nimport type { PlanningModeConfig } from './config';\n\nexport { PLAN_CONFIG_SECTION_ID };\nconst SECTION_ORDER = 30;\n/** Selecting this clears the setting, which is how the file spells \"inherit\". */\nconst INHERIT_CHOICE_ID = 'inherit';\n\n/**\n * A planning setting as the terminal panel needs it: the shared shape, plus how\n * to read the value out of a loaded config. The reader stays here because it\n * touches the parsed config types, which the browser half never sees.\n */\nexport interface PlanSettingDescriptor extends PlanSettingShape {\n readonly read: (config: PlanningModeConfig | undefined) => string | undefined;\n}\n\nconst READERS: Readonly<Record<string, (config: PlanningModeConfig | undefined) => string | undefined>> = {\n 'main.model': (config) => config?.main?.model,\n 'main.thinking': (config) => config?.main?.thinking,\n 'subagents.model': (config) => config?.subagents?.model,\n 'subagents.thinking': (config) => config?.subagents?.thinking,\n plansdirectory: (config) => config?.plansDirectory,\n};\n\nexport const PLAN_SETTINGS: readonly PlanSettingDescriptor[] = PLAN_SETTING_SHAPES.map((shape) => ({\n ...shape,\n read: READERS[shape.id]!,\n}));\n\nexport function planSettingByFieldId(fieldId: string): PlanSettingDescriptor | undefined {\n return PLAN_SETTINGS.find((setting) => setting.id === fieldId);\n}\n\n/** A model this session could actually switch to, as the panel offers it. */\nexport interface PlanModelChoice {\n readonly provider: string;\n readonly id: string;\n}\n\n/**\n * The models the session can reach, plus the entry that clears the setting.\n *\n * Offered as a list because a model spec is `provider/id` and typing one from\n * memory is how a setting ends up naming a model this session cannot use. The\n * inherit entry CLEARS rather than writing a value: unset is what \"use the\n * session's own model\" means in the file.\n */\nfunction modelChoices(models: readonly PlanModelChoice[]): ConfigChoice[] {\n const inherit: ConfigChoice = {\n id: INHERIT_CHOICE_ID,\n label: PLAN_SETTING_SHAPES.find((shape) => shape.models === true)?.placeholder ?? INHERIT_CHOICE_ID,\n detail: 'Leaves the setting unset.',\n action: CONFIG_ACTION.clear,\n };\n return [\n inherit,\n ...models.map((model): ConfigChoice => ({\n id: `${model.provider}/${model.id}`,\n label: model.id,\n group: model.provider,\n detail: model.provider,\n action: CONFIG_ACTION.set,\n })),\n ];\n}\n\nfunction choicesFor(\n setting: PlanSettingDescriptor,\n models: readonly PlanModelChoice[],\n): { choices: ConfigChoice[]; kind: 'enum' | 'choice' } | undefined {\n // `set` rather than a bespoke action: choosing a level is the same write as\n // typing one, so it shares the handler.\n if (setting.options) {\n return {\n kind: 'enum',\n choices: setting.options.map((option) => ({ id: option, label: option, action: CONFIG_ACTION.set })),\n };\n }\n // A model setting with nothing to offer stays free text rather than opening\n // an empty list: a session with no authenticated provider can still be edited.\n if (!setting.models || models.length === 0) return undefined;\n return { kind: 'choice', choices: modelChoices(models) };\n}\n\nexport function planConfigSections(\n config: PlanningModeConfig | undefined,\n notice?: string,\n models: readonly PlanModelChoice[] = [],\n): readonly ConfigSection[] {\n const fields: ConfigField[] = PLAN_SETTINGS.map((setting) => {\n const value = setting.read(config);\n const offered = choicesFor(setting, models);\n return {\n id: setting.id,\n label: setting.label,\n kind: offered?.kind ?? ('text' as const),\n keyPath: setting.keyPath.join('.'),\n placeholder: setting.placeholder,\n detail: setting.detail,\n ...(value ? { value } : {}),\n ...(offered ? { choices: offered.choices } : {}),\n };\n });\n return [\n {\n id: PLAN_CONFIG_SECTION_ID,\n title: 'planning',\n order: SECTION_ORDER,\n detail: 'plan mode',\n fields,\n ...(notice ? { notice, noticeLevel: 'error' as const } : {}),\n },\n ];\n}\n"],"mappings":"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"}
|
package/dist/planConfig.d.mts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { n as PlanningModeConfig } from "./config-BGEbU75i.mjs";
|
|
2
2
|
import { ConfigSection } from "@agimon-ai/po-core/config";
|
|
3
3
|
//#region src/types/planSettings.d.ts
|
|
4
4
|
/**
|
|
@@ -44,4 +44,5 @@ export interface PlanModelChoice {
|
|
|
44
44
|
}
|
|
45
45
|
export declare function planConfigSections(config: PlanningModeConfig | undefined, notice?: string, models?: readonly PlanModelChoice[]): readonly ConfigSection[];
|
|
46
46
|
//#endregion
|
|
47
|
+
export {};
|
|
47
48
|
//# sourceMappingURL=planConfig.d.mts.map
|
package/dist/planConfig.mjs
CHANGED
|
@@ -19,7 +19,7 @@ const SUBAGENTS_KEY = "subagents";
|
|
|
19
19
|
/** Both agents fall back to the session's own settings when left unset. */
|
|
20
20
|
const INHERIT_MODEL = "inherit the session model";
|
|
21
21
|
const INHERIT_THINKING = "inherit";
|
|
22
|
-
/** Mirrors
|
|
22
|
+
/** Mirrors PO_PLANNING_THINKING_LEVELS; pinned by planConfig's test. */
|
|
23
23
|
const PLAN_THINKING_LEVELS = [
|
|
24
24
|
"off",
|
|
25
25
|
"minimal",
|
package/dist/planConfig.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"planConfig.mjs","names":[],"sources":["../src/types/planSettings.ts","../src/schemas/plan/planConfig.ts"],"sourcesContent":["/**\n * The planning settings, described once for both surfaces.\n *\n * The terminal panel and the cockpit settings page render the same five fields,\n * and the one thing they must agree on is which config key each one writes. So\n * the ids, labels and key paths live here rather than in either renderer.\n *\n * It lives under src/types because that is the one server root a browser bundle\n * may read, which also means it may import nothing: pulling the config package\n * in for the thinking levels would drag a node module into the page. They are\n * spelled out instead, and a test asserts they still match the parser's.\n */\n\nexport const PLAN_CONFIG_SECTION_ID = 'planning';\nconst PLANNING_PATH = ['modes', PLAN_CONFIG_SECTION_ID] as const;\nconst MAIN_KEY = 'main';\nconst SUBAGENTS_KEY = 'subagents';\n\n/** Both agents fall back to the session's own settings when left unset. */\nconst INHERIT_MODEL = 'inherit the session model';\nconst INHERIT_THINKING = 'inherit';\n\n/** Mirrors
|
|
1
|
+
{"version":3,"file":"planConfig.mjs","names":[],"sources":["../src/types/planSettings.ts","../src/schemas/plan/planConfig.ts"],"sourcesContent":["/**\n * The planning settings, described once for both surfaces.\n *\n * The terminal panel and the cockpit settings page render the same five fields,\n * and the one thing they must agree on is which config key each one writes. So\n * the ids, labels and key paths live here rather than in either renderer.\n *\n * It lives under src/types because that is the one server root a browser bundle\n * may read, which also means it may import nothing: pulling the config package\n * in for the thinking levels would drag a node module into the page. They are\n * spelled out instead, and a test asserts they still match the parser's.\n */\n\nexport const PLAN_CONFIG_SECTION_ID = 'planning';\nconst PLANNING_PATH = ['modes', PLAN_CONFIG_SECTION_ID] as const;\nconst MAIN_KEY = 'main';\nconst SUBAGENTS_KEY = 'subagents';\n\n/** Both agents fall back to the session's own settings when left unset. */\nconst INHERIT_MODEL = 'inherit the session model';\nconst INHERIT_THINKING = 'inherit';\n\n/** Mirrors PO_PLANNING_THINKING_LEVELS; pinned by planConfig's test. */\nexport const PLAN_THINKING_LEVELS: readonly string[] = ['off', 'minimal', 'low', 'medium', 'high', 'xhigh', 'max'];\n\nexport interface PlanSettingShape {\n readonly id: string;\n readonly label: string;\n readonly keyPath: readonly string[];\n readonly placeholder: string;\n readonly detail: string;\n /** Present for a closed set; a renderer offers these rather than free text. */\n readonly options?: readonly string[];\n /** Offers the machine's authenticated models rather than free text. */\n readonly models?: boolean;\n}\n\nexport const PLAN_SETTING_SHAPES: readonly PlanSettingShape[] = [\n {\n id: 'main.model',\n label: 'main model',\n keyPath: [...PLANNING_PATH, MAIN_KEY, 'model'],\n placeholder: INHERIT_MODEL,\n detail: 'model the main agent switches to while plan mode is on.',\n models: true,\n },\n {\n id: 'main.thinking',\n label: 'main thinking',\n keyPath: [...PLANNING_PATH, MAIN_KEY, 'thinking'],\n placeholder: INHERIT_THINKING,\n detail: 'thinking level appended to the main model while planning.',\n options: PLAN_THINKING_LEVELS,\n },\n {\n id: 'subagents.model',\n label: 'subagent model',\n keyPath: [...PLANNING_PATH, SUBAGENTS_KEY, 'model'],\n placeholder: INHERIT_MODEL,\n detail: 'model forced onto delegated planning subagents.',\n models: true,\n },\n {\n id: 'subagents.thinking',\n label: 'subagent thinking',\n keyPath: [...PLANNING_PATH, SUBAGENTS_KEY, 'thinking'],\n placeholder: INHERIT_THINKING,\n detail: 'thinking level appended to the subagent model.',\n options: PLAN_THINKING_LEVELS,\n },\n {\n id: 'plansdirectory',\n label: 'plans directory',\n keyPath: [...PLANNING_PATH, 'plansDirectory'],\n placeholder: '~/.po/plans',\n detail: 'absolute, repo-relative, or under ~. written plans land here.',\n },\n];\n","/**\n * Plan mode's slice of the `SPC e c` config panel.\n *\n * Plan mode reads `modes.planning` from disk on every activation, so an edit\n * here lands on the next time the mode is turned on with no restart and nothing\n * to invalidate.\n *\n * The descriptor table is the whole design: the panel renders it and the write\n * handler looks the key path back up in it, so adding a setting means adding a\n * row rather than a case.\n */\n\nimport { CONFIG_ACTION, type ConfigChoice, type ConfigField, type ConfigSection } from '@agimon-ai/po-core/config';\n\nimport { PLAN_CONFIG_SECTION_ID, PLAN_SETTING_SHAPES, type PlanSettingShape } from '../../types/planSettings';\nimport type { PlanningModeConfig } from './config';\n\nexport { PLAN_CONFIG_SECTION_ID };\nconst SECTION_ORDER = 30;\n/** Selecting this clears the setting, which is how the file spells \"inherit\". */\nconst INHERIT_CHOICE_ID = 'inherit';\n\n/**\n * A planning setting as the terminal panel needs it: the shared shape, plus how\n * to read the value out of a loaded config. The reader stays here because it\n * touches the parsed config types, which the browser half never sees.\n */\nexport interface PlanSettingDescriptor extends PlanSettingShape {\n readonly read: (config: PlanningModeConfig | undefined) => string | undefined;\n}\n\nconst READERS: Readonly<Record<string, (config: PlanningModeConfig | undefined) => string | undefined>> = {\n 'main.model': (config) => config?.main?.model,\n 'main.thinking': (config) => config?.main?.thinking,\n 'subagents.model': (config) => config?.subagents?.model,\n 'subagents.thinking': (config) => config?.subagents?.thinking,\n plansdirectory: (config) => config?.plansDirectory,\n};\n\nexport const PLAN_SETTINGS: readonly PlanSettingDescriptor[] = PLAN_SETTING_SHAPES.map((shape) => ({\n ...shape,\n read: READERS[shape.id]!,\n}));\n\nexport function planSettingByFieldId(fieldId: string): PlanSettingDescriptor | undefined {\n return PLAN_SETTINGS.find((setting) => setting.id === fieldId);\n}\n\n/** A model this session could actually switch to, as the panel offers it. */\nexport interface PlanModelChoice {\n readonly provider: string;\n readonly id: string;\n}\n\n/**\n * The models the session can reach, plus the entry that clears the setting.\n *\n * Offered as a list because a model spec is `provider/id` and typing one from\n * memory is how a setting ends up naming a model this session cannot use. The\n * inherit entry CLEARS rather than writing a value: unset is what \"use the\n * session's own model\" means in the file.\n */\nfunction modelChoices(models: readonly PlanModelChoice[]): ConfigChoice[] {\n const inherit: ConfigChoice = {\n id: INHERIT_CHOICE_ID,\n label: PLAN_SETTING_SHAPES.find((shape) => shape.models === true)?.placeholder ?? INHERIT_CHOICE_ID,\n detail: 'Leaves the setting unset.',\n action: CONFIG_ACTION.clear,\n };\n return [\n inherit,\n ...models.map((model): ConfigChoice => ({\n id: `${model.provider}/${model.id}`,\n label: model.id,\n group: model.provider,\n detail: model.provider,\n action: CONFIG_ACTION.set,\n })),\n ];\n}\n\nfunction choicesFor(\n setting: PlanSettingDescriptor,\n models: readonly PlanModelChoice[],\n): { choices: ConfigChoice[]; kind: 'enum' | 'choice' } | undefined {\n // `set` rather than a bespoke action: choosing a level is the same write as\n // typing one, so it shares the handler.\n if (setting.options) {\n return {\n kind: 'enum',\n choices: setting.options.map((option) => ({ id: option, label: option, action: CONFIG_ACTION.set })),\n };\n }\n // A model setting with nothing to offer stays free text rather than opening\n // an empty list: a session with no authenticated provider can still be edited.\n if (!setting.models || models.length === 0) return undefined;\n return { kind: 'choice', choices: modelChoices(models) };\n}\n\nexport function planConfigSections(\n config: PlanningModeConfig | undefined,\n notice?: string,\n models: readonly PlanModelChoice[] = [],\n): readonly ConfigSection[] {\n const fields: ConfigField[] = PLAN_SETTINGS.map((setting) => {\n const value = setting.read(config);\n const offered = choicesFor(setting, models);\n return {\n id: setting.id,\n label: setting.label,\n kind: offered?.kind ?? ('text' as const),\n keyPath: setting.keyPath.join('.'),\n placeholder: setting.placeholder,\n detail: setting.detail,\n ...(value ? { value } : {}),\n ...(offered ? { choices: offered.choices } : {}),\n };\n });\n return [\n {\n id: PLAN_CONFIG_SECTION_ID,\n title: 'planning',\n order: SECTION_ORDER,\n detail: 'plan mode',\n fields,\n ...(notice ? { notice, noticeLevel: 'error' as const } : {}),\n },\n ];\n}\n"],"mappings":"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"}
|
|
@@ -33,14 +33,14 @@ function reviewProtocolLines(capabilities) {
|
|
|
33
33
|
/**
|
|
34
34
|
* The host-independent plan mode block, pushed ahead of the flavor block.
|
|
35
35
|
*
|
|
36
|
-
* Both the Pi extension and the server
|
|
36
|
+
* Both the Pi extension and the server plugin append this. It lives here so the cockpit and the
|
|
37
37
|
* terminal cannot drift into giving the agent different instructions for the same mode. The two
|
|
38
|
-
*
|
|
38
|
+
* hosts may differ only through {@link PlanHostCapabilities}, so every other sentence is shared
|
|
39
39
|
* by construction.
|
|
40
40
|
*/
|
|
41
41
|
function buildPlanModeBasePrompt(plansDirectory, capabilities) {
|
|
42
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.
|
|
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. Po 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
44
|
}
|
|
45
45
|
/** Normal planning adds only the flavor-specific brief to the shared planning workflow. */
|
|
46
46
|
function buildNormalPlanningPrompt() {
|
|
@@ -65,4 +65,4 @@ function buildFlavorPlanningPrompt(flavor, plansDirectory, evidence, _fableStage
|
|
|
65
65
|
//#endregion
|
|
66
66
|
export { buildNormalPlanningPrompt as a, buildFlavorPlanningPrompt as i, buildDebugPlanningPrompt as n, buildPlanModeBasePrompt as o, buildFablePlanningPrompt as r, buildCodeReviewPlanningPrompt as t };
|
|
67
67
|
|
|
68
|
-
//# sourceMappingURL=prompts-
|
|
68
|
+
//# sourceMappingURL=prompts-C32Hrpem.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"prompts-C32Hrpem.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 plugin 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 * hosts 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. Po 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,81FAA81F,OAAO,WAAW,IAAI,KAAK,OAAO,OAAO,KAAK,IAAI;AACtjG;;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"}
|
|
@@ -33,14 +33,14 @@ function reviewProtocolLines(capabilities) {
|
|
|
33
33
|
/**
|
|
34
34
|
* The host-independent plan mode block, pushed ahead of the flavor block.
|
|
35
35
|
*
|
|
36
|
-
* Both the Pi extension and the server
|
|
36
|
+
* Both the Pi extension and the server plugin append this. It lives here so the cockpit and the
|
|
37
37
|
* terminal cannot drift into giving the agent different instructions for the same mode. The two
|
|
38
|
-
*
|
|
38
|
+
* hosts may differ only through {@link PlanHostCapabilities}, so every other sentence is shared
|
|
39
39
|
* by construction.
|
|
40
40
|
*/
|
|
41
41
|
function buildPlanModeBasePrompt(plansDirectory, capabilities) {
|
|
42
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.
|
|
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. Po 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
44
|
}
|
|
45
45
|
/** Normal planning adds only the flavor-specific brief to the shared planning workflow. */
|
|
46
46
|
function buildNormalPlanningPrompt() {
|
|
@@ -100,4 +100,4 @@ Object.defineProperty(exports, "buildPlanModeBasePrompt", {
|
|
|
100
100
|
}
|
|
101
101
|
});
|
|
102
102
|
|
|
103
|
-
//# sourceMappingURL=prompts-
|
|
103
|
+
//# sourceMappingURL=prompts-xBLz0h6f.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"prompts-xBLz0h6f.cjs","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 plugin 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 * hosts 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. Po 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,81FAA81F,OAAO,WAAW,IAAI,KAAK,OAAO,OAAO,KAAK,IAAI;AACtjG;;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
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
const require_prompts = require("./prompts-
|
|
2
|
+
const require_prompts = require("./prompts-xBLz0h6f.cjs");
|
|
3
3
|
exports.buildCodeReviewPlanningPrompt = require_prompts.buildCodeReviewPlanningPrompt;
|
|
4
4
|
exports.buildDebugPlanningPrompt = require_prompts.buildDebugPlanningPrompt;
|
|
5
5
|
exports.buildFablePlanningPrompt = require_prompts.buildFablePlanningPrompt;
|
package/dist/prompts.d.mts
CHANGED
|
@@ -1,2 +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-
|
|
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-Dc38rONO.mjs";
|
|
2
2
|
export { DebugEvidencePacket, PlanHostCapabilities, PlanningFlavor, buildCodeReviewPlanningPrompt, buildDebugPlanningPrompt, buildFablePlanningPrompt, buildFlavorPlanningPrompt, buildNormalPlanningPrompt, buildPlanModeBasePrompt };
|
package/dist/prompts.mjs
CHANGED
|
@@ -1,2 +1 @@
|
|
|
1
|
-
|
|
2
|
-
export { buildCodeReviewPlanningPrompt, buildDebugPlanningPrompt, buildFablePlanningPrompt, buildFlavorPlanningPrompt, buildNormalPlanningPrompt, buildPlanModeBasePrompt };
|
|
1
|
+
export { t as buildCodeReviewPlanningPrompt, n as buildDebugPlanningPrompt, r as buildFablePlanningPrompt, i as buildFlavorPlanningPrompt, a as buildNormalPlanningPrompt, o as buildPlanModeBasePrompt } from "./prompts-C32Hrpem.mjs";
|
package/llms.txt
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@agimon-ai/po-plan",
|
|
3
|
-
"version": "0.0.0-alpha.
|
|
3
|
+
"version": "0.0.0-alpha.21",
|
|
4
4
|
"description": "Reviewable Pi planning mode that removes file-editing tools and persists implementation plans.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"ai",
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
"bugs": {
|
|
19
19
|
"url": "https://github.com/AgiFlow/po/issues"
|
|
20
20
|
},
|
|
21
|
-
"license": "
|
|
21
|
+
"license": "BUSL-1.1",
|
|
22
22
|
"author": "Vuong Ngo",
|
|
23
23
|
"repository": {
|
|
24
24
|
"type": "git",
|
|
@@ -89,38 +89,38 @@
|
|
|
89
89
|
"registry": "https://registry.npmjs.org/"
|
|
90
90
|
},
|
|
91
91
|
"dependencies": {
|
|
92
|
-
"@agimon-ai/po-config": "0.0.0-alpha.
|
|
93
|
-
"@agimon-ai/po-core": "0.0.0-alpha.
|
|
94
|
-
"@agimon-ai/po-minor-mode": "0.0.0-alpha.
|
|
95
|
-
"@agimon-ai/po-telemetry": "0.0.0-alpha.
|
|
96
|
-
"@agimon-ai/po-web-components": "0.0.0-alpha.
|
|
97
|
-
"@agimon-ai/po-web-security": "0.0.0-alpha.
|
|
98
|
-
"@deepseek-ai/cordis": "4.0.
|
|
99
|
-
"hono": "4.13.
|
|
100
|
-
"typebox": "1.3.
|
|
92
|
+
"@agimon-ai/po-config": "0.0.0-alpha.21",
|
|
93
|
+
"@agimon-ai/po-core": "0.0.0-alpha.21",
|
|
94
|
+
"@agimon-ai/po-minor-mode": "0.0.0-alpha.21",
|
|
95
|
+
"@agimon-ai/po-telemetry": "0.0.0-alpha.21",
|
|
96
|
+
"@agimon-ai/po-web-components": "0.0.0-alpha.21",
|
|
97
|
+
"@agimon-ai/po-web-security": "0.0.0-alpha.21",
|
|
98
|
+
"@deepseek-ai/cordis": "4.0.5",
|
|
99
|
+
"hono": "4.13.13",
|
|
100
|
+
"typebox": "1.3.37"
|
|
101
101
|
},
|
|
102
102
|
"devDependencies": {
|
|
103
|
-
"@agimon-ai/po-build": "0.0.0-alpha.
|
|
104
|
-
"@agimon-ai/po-native-components": "0.0.0-alpha.
|
|
105
|
-
"@earendil-works/pi-coding-agent": "1.
|
|
103
|
+
"@agimon-ai/po-build": "0.0.0-alpha.21",
|
|
104
|
+
"@agimon-ai/po-native-components": "0.0.0-alpha.21",
|
|
105
|
+
"@earendil-works/pi-coding-agent": "1.3.0",
|
|
106
106
|
"@tanstack/react-store": "0.11.2",
|
|
107
107
|
"@tanstack/store": "0.11.2",
|
|
108
|
-
"@types/node": "26.6.
|
|
108
|
+
"@types/node": "26.6.5",
|
|
109
109
|
"@types/react": "19.3.0",
|
|
110
110
|
"@types/react-dom": "19.3.0",
|
|
111
|
-
"@vitest/coverage-v8": "5.0.
|
|
111
|
+
"@vitest/coverage-v8": "5.0.4",
|
|
112
112
|
"react": "19.3.0",
|
|
113
113
|
"react-dom": "19.3.0",
|
|
114
114
|
"react-native": "0.86.3",
|
|
115
|
-
"react-native-unistyles": "3.5.
|
|
115
|
+
"react-native-unistyles": "3.5.3",
|
|
116
116
|
"typescript": "7.0.2",
|
|
117
|
-
"vitest": "5.0.
|
|
117
|
+
"vitest": "5.0.4"
|
|
118
118
|
},
|
|
119
119
|
"peerDependencies": {
|
|
120
|
-
"@agimon-ai/po-native-components": "0.0.0-alpha.
|
|
121
|
-
"@earendil-works/pi-coding-agent": "1.
|
|
120
|
+
"@agimon-ai/po-native-components": "0.0.0-alpha.21",
|
|
121
|
+
"@earendil-works/pi-coding-agent": "1.3.0",
|
|
122
122
|
"react-native": "0.86.3",
|
|
123
|
-
"react-native-unistyles": "3.5.
|
|
123
|
+
"react-native-unistyles": "^3.5.3"
|
|
124
124
|
},
|
|
125
125
|
"peerDependenciesMeta": {
|
|
126
126
|
"@agimon-ai/po-native-components": {
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: po-use-plan
|
|
3
|
-
description: Use
|
|
3
|
+
description: Use Po Pi Plan to draft reviewable normal, debug, or code review plans, persist them, and exit safely.
|
|
4
4
|
---
|
|
5
5
|
|
|
6
|
-
# Use
|
|
6
|
+
# Use Po Pi Plan
|
|
7
7
|
|
|
8
8
|
Use Plan when the user wants investigation and a reviewable implementation plan before repository changes.
|
|
9
9
|
|
package/src/types/planApi.ts
CHANGED
|
@@ -22,7 +22,7 @@ export const API_BASE_PATH = 'plans';
|
|
|
22
22
|
* makes the cockpit's activity group appear at all. It outlives plan mode: the
|
|
23
23
|
* plan is most worth reading while the agent implements it.
|
|
24
24
|
*/
|
|
25
|
-
export const PLAN_STATUS_KEY = '
|
|
25
|
+
export const PLAN_STATUS_KEY = 'po-plan-document';
|
|
26
26
|
|
|
27
27
|
/** The selector contract shared by complete_plan and its cockpit composer prompt. */
|
|
28
28
|
export const PLAN_REVIEW_TITLE = 'Plan complete. What would you like to do?';
|
|
@@ -33,7 +33,7 @@ export const CONTINUE_PLAN_DECISION = 'continue';
|
|
|
33
33
|
|
|
34
34
|
/**
|
|
35
35
|
* The label the reader sees paired with the decision the tool acts on. A headless
|
|
36
|
-
* client answers with `value`, so a
|
|
36
|
+
* client answers with `value`, so a server plugin never has to recognise the wording; Pi's
|
|
37
37
|
* own `ui.select` carries labels only, so its half maps the label back itself.
|
|
38
38
|
*/
|
|
39
39
|
export const PLAN_REVIEW_CHOICES = [
|
|
@@ -20,7 +20,7 @@ const SUBAGENTS_KEY = 'subagents';
|
|
|
20
20
|
const INHERIT_MODEL = 'inherit the session model';
|
|
21
21
|
const INHERIT_THINKING = 'inherit';
|
|
22
22
|
|
|
23
|
-
/** Mirrors
|
|
23
|
+
/** Mirrors PO_PLANNING_THINKING_LEVELS; pinned by planConfig's test. */
|
|
24
24
|
export const PLAN_THINKING_LEVELS: readonly string[] = ['off', 'minimal', 'low', 'medium', 'high', 'xhigh', 'max'];
|
|
25
25
|
|
|
26
26
|
export interface PlanSettingShape {
|
package/dist/config-BC-Tou05.mjs
DELETED
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import { getHarnessState, globalDoomConfigPath, loadDoomConfig, loadHarnessState, mergeDoomConfigs, parseDoomConfig, parsePlanningModeConfig, repositoryDoomConfigPath, resolvePlanningPlansDirectory } from "@agimon-ai/po-config";
|
|
2
|
-
//#region src/schemas/plan/config.ts
|
|
3
|
-
const DEFAULT_PROJECT_TRUST = "ask";
|
|
4
|
-
function parseDoomConfig$1(content, filePath) {
|
|
5
|
-
const config = parseDoomConfig(content, filePath);
|
|
6
|
-
return config.modes ? { modes: config.modes } : {};
|
|
7
|
-
}
|
|
8
|
-
function mergeDoomConfigs$1(globalConfig, repositoryConfig) {
|
|
9
|
-
const merged = mergeDoomConfigs({
|
|
10
|
-
...globalConfig,
|
|
11
|
-
projectTrust: DEFAULT_PROJECT_TRUST
|
|
12
|
-
}, {
|
|
13
|
-
...repositoryConfig,
|
|
14
|
-
projectTrust: DEFAULT_PROJECT_TRUST
|
|
15
|
-
});
|
|
16
|
-
return merged.modes ? { modes: merged.modes } : {};
|
|
17
|
-
}
|
|
18
|
-
function loadDoomConfig$1(repoRoot, homeDirectory) {
|
|
19
|
-
const config = loadDoomConfig(repoRoot, homeDirectory);
|
|
20
|
-
return config.modes ? { modes: config.modes } : {};
|
|
21
|
-
}
|
|
22
|
-
//#endregion
|
|
23
|
-
export { mergeDoomConfigs$1 as a, repositoryDoomConfigPath as c, loadHarnessState as i, resolvePlanningPlansDirectory as l, globalDoomConfigPath as n, parseDoomConfig$1 as o, loadDoomConfig$1 as r, parsePlanningModeConfig as s, getHarnessState as t };
|
|
24
|
-
|
|
25
|
-
//# sourceMappingURL=config-BC-Tou05.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"config-BC-Tou05.mjs","names":["parseDoomConfig","parseSharedDoomConfig","mergeDoomConfigs","mergeSharedDoomConfigs","loadDoomConfig","loadSharedDoomConfig"],"sources":["../src/schemas/plan/config.ts"],"sourcesContent":["import {\n getHarnessState,\n globalDoomConfigPath,\n loadHarnessState,\n loadDoomConfig as loadSharedDoomConfig,\n mergeDoomConfigs as mergeSharedDoomConfigs,\n type PlanningAgentConfig,\n type PlanningModeConfig,\n type PlanningThinkingLevel,\n parsePlanningModeConfig,\n parseDoomConfig as parseSharedDoomConfig,\n repositoryDoomConfigPath,\n resolvePlanningPlansDirectory,\n} from '@agimon-ai/po-config';\n\nexport type { PlanningAgentConfig, PlanningModeConfig, PlanningThinkingLevel };\n\nexport interface DoomConfig {\n modes?: {\n planning?: PlanningModeConfig;\n };\n}\n\nconst DEFAULT_PROJECT_TRUST = 'ask' as const;\n\nexport {\n getHarnessState,\n globalDoomConfigPath,\n loadHarnessState,\n parsePlanningModeConfig,\n repositoryDoomConfigPath,\n resolvePlanningPlansDirectory,\n};\n\nexport function parseDoomConfig(content: string, filePath: string): DoomConfig {\n const config = parseSharedDoomConfig(content, filePath);\n return config.modes ? { modes: config.modes } : {};\n}\n\nexport function mergeDoomConfigs(globalConfig: DoomConfig, repositoryConfig: DoomConfig): DoomConfig {\n const merged = mergeSharedDoomConfigs(\n { ...globalConfig, projectTrust: DEFAULT_PROJECT_TRUST },\n { ...repositoryConfig, projectTrust: DEFAULT_PROJECT_TRUST },\n );\n return merged.modes ? { modes: merged.modes } : {};\n}\n\nexport function loadDoomConfig(repoRoot: string, homeDirectory?: string): DoomConfig {\n const config = loadSharedDoomConfig(repoRoot, homeDirectory);\n return config.modes ? { modes: config.modes } : {};\n}\n"],"mappings":";;AAuBA,MAAM,wBAAwB;AAW9B,SAAgBA,kBAAgB,SAAiB,UAA8B;CAC7E,MAAM,SAASC,gBAAsB,SAAS,QAAQ;CACtD,OAAO,OAAO,QAAQ,EAAE,OAAO,OAAO,MAAM,IAAI,CAAC;AACnD;AAEA,SAAgBC,mBAAiB,cAA0B,kBAA0C;CACnG,MAAM,SAASC,iBACb;EAAE,GAAG;EAAc,cAAc;CAAsB,GACvD;EAAE,GAAG;EAAkB,cAAc;CAAsB,CAC7D;CACA,OAAO,OAAO,QAAQ,EAAE,OAAO,OAAO,MAAM,IAAI,CAAC;AACnD;AAEA,SAAgBC,iBAAe,UAAkB,eAAoC;CACnF,MAAM,SAASC,eAAqB,UAAU,aAAa;CAC3D,OAAO,OAAO,QAAQ,EAAE,OAAO,OAAO,MAAM,IAAI,CAAC;AACnD"}
|
package/dist/config-D0iTexGm.cjs
DELETED
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
let _agimon_ai_po_config = require("@agimon-ai/po-config");
|
|
2
|
-
//#region src/schemas/plan/config.ts
|
|
3
|
-
const DEFAULT_PROJECT_TRUST = "ask";
|
|
4
|
-
function parseDoomConfig(content, filePath) {
|
|
5
|
-
const config = (0, _agimon_ai_po_config.parseDoomConfig)(content, filePath);
|
|
6
|
-
return config.modes ? { modes: config.modes } : {};
|
|
7
|
-
}
|
|
8
|
-
function mergeDoomConfigs(globalConfig, repositoryConfig) {
|
|
9
|
-
const merged = (0, _agimon_ai_po_config.mergeDoomConfigs)({
|
|
10
|
-
...globalConfig,
|
|
11
|
-
projectTrust: DEFAULT_PROJECT_TRUST
|
|
12
|
-
}, {
|
|
13
|
-
...repositoryConfig,
|
|
14
|
-
projectTrust: DEFAULT_PROJECT_TRUST
|
|
15
|
-
});
|
|
16
|
-
return merged.modes ? { modes: merged.modes } : {};
|
|
17
|
-
}
|
|
18
|
-
function loadDoomConfig(repoRoot, homeDirectory) {
|
|
19
|
-
const config = (0, _agimon_ai_po_config.loadDoomConfig)(repoRoot, homeDirectory);
|
|
20
|
-
return config.modes ? { modes: config.modes } : {};
|
|
21
|
-
}
|
|
22
|
-
//#endregion
|
|
23
|
-
Object.defineProperty(exports, "loadDoomConfig", {
|
|
24
|
-
enumerable: true,
|
|
25
|
-
get: function() {
|
|
26
|
-
return loadDoomConfig;
|
|
27
|
-
}
|
|
28
|
-
});
|
|
29
|
-
Object.defineProperty(exports, "mergeDoomConfigs", {
|
|
30
|
-
enumerable: true,
|
|
31
|
-
get: function() {
|
|
32
|
-
return mergeDoomConfigs;
|
|
33
|
-
}
|
|
34
|
-
});
|
|
35
|
-
Object.defineProperty(exports, "parseDoomConfig", {
|
|
36
|
-
enumerable: true,
|
|
37
|
-
get: function() {
|
|
38
|
-
return parseDoomConfig;
|
|
39
|
-
}
|
|
40
|
-
});
|
|
41
|
-
|
|
42
|
-
//# sourceMappingURL=config-D0iTexGm.cjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"config-D0iTexGm.cjs","names":["parseSharedDoomConfig","mergeSharedDoomConfigs","loadSharedDoomConfig"],"sources":["../src/schemas/plan/config.ts"],"sourcesContent":["import {\n getHarnessState,\n globalDoomConfigPath,\n loadHarnessState,\n loadDoomConfig as loadSharedDoomConfig,\n mergeDoomConfigs as mergeSharedDoomConfigs,\n type PlanningAgentConfig,\n type PlanningModeConfig,\n type PlanningThinkingLevel,\n parsePlanningModeConfig,\n parseDoomConfig as parseSharedDoomConfig,\n repositoryDoomConfigPath,\n resolvePlanningPlansDirectory,\n} from '@agimon-ai/po-config';\n\nexport type { PlanningAgentConfig, PlanningModeConfig, PlanningThinkingLevel };\n\nexport interface DoomConfig {\n modes?: {\n planning?: PlanningModeConfig;\n };\n}\n\nconst DEFAULT_PROJECT_TRUST = 'ask' as const;\n\nexport {\n getHarnessState,\n globalDoomConfigPath,\n loadHarnessState,\n parsePlanningModeConfig,\n repositoryDoomConfigPath,\n resolvePlanningPlansDirectory,\n};\n\nexport function parseDoomConfig(content: string, filePath: string): DoomConfig {\n const config = parseSharedDoomConfig(content, filePath);\n return config.modes ? { modes: config.modes } : {};\n}\n\nexport function mergeDoomConfigs(globalConfig: DoomConfig, repositoryConfig: DoomConfig): DoomConfig {\n const merged = mergeSharedDoomConfigs(\n { ...globalConfig, projectTrust: DEFAULT_PROJECT_TRUST },\n { ...repositoryConfig, projectTrust: DEFAULT_PROJECT_TRUST },\n );\n return merged.modes ? { modes: merged.modes } : {};\n}\n\nexport function loadDoomConfig(repoRoot: string, homeDirectory?: string): DoomConfig {\n const config = loadSharedDoomConfig(repoRoot, homeDirectory);\n return config.modes ? { modes: config.modes } : {};\n}\n"],"mappings":";;AAuBA,MAAM,wBAAwB;AAW9B,SAAgB,gBAAgB,SAAiB,UAA8B;CAC7E,MAAM,UAAA,GAASA,qBAAAA,gBAAAA,CAAsB,SAAS,QAAQ;CACtD,OAAO,OAAO,QAAQ,EAAE,OAAO,OAAO,MAAM,IAAI,CAAC;AACnD;AAEA,SAAgB,iBAAiB,cAA0B,kBAA0C;CACnG,MAAM,UAAA,GAASC,qBAAAA,iBAAAA,CACb;EAAE,GAAG;EAAc,cAAc;CAAsB,GACvD;EAAE,GAAG;EAAkB,cAAc;CAAsB,CAC7D;CACA,OAAO,OAAO,QAAQ,EAAE,OAAO,OAAO,MAAM,IAAI,CAAC;AACnD;AAEA,SAAgB,eAAe,UAAkB,eAAoC;CACnF,MAAM,UAAA,GAASC,qBAAAA,eAAAA,CAAqB,UAAU,aAAa;CAC3D,OAAO,OAAO,QAAQ,EAAE,OAAO,OAAO,MAAM,IAAI,CAAC;AACnD"}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { PlanningAgentConfig, PlanningModeConfig, PlanningThinkingLevel, getHarnessState, globalDoomConfigPath, loadHarnessState, parsePlanningModeConfig, repositoryDoomConfigPath, resolvePlanningPlansDirectory } from "@agimon-ai/po-config";
|
|
2
|
-
//#region src/schemas/plan/config.d.ts
|
|
3
|
-
interface DoomConfig {
|
|
4
|
-
modes?: {
|
|
5
|
-
planning?: PlanningModeConfig;
|
|
6
|
-
};
|
|
7
|
-
}
|
|
8
|
-
declare function parseDoomConfig$1(content: string, filePath: string): DoomConfig;
|
|
9
|
-
declare function mergeDoomConfigs$1(globalConfig: DoomConfig, repositoryConfig: DoomConfig): DoomConfig;
|
|
10
|
-
declare function loadDoomConfig$1(repoRoot: string, homeDirectory?: string): DoomConfig;
|
|
11
|
-
//#endregion
|
|
12
|
-
export { getHarnessState as a, loadHarnessState as c, parsePlanningModeConfig as d, repositoryDoomConfigPath as f, PlanningThinkingLevel as i, mergeDoomConfigs$1 as l, PlanningAgentConfig as n, globalDoomConfigPath as o, resolvePlanningPlansDirectory as p, PlanningModeConfig as r, loadDoomConfig$1 as s, DoomConfig as t, parseDoomConfig$1 as u };
|
|
13
|
-
//# sourceMappingURL=config-DWo57HKB.d.mts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"config-DWo57HKB.d.mts","names":["parseDoomConfig","mergeDoomConfigs","loadDoomConfig"],"sources":["../src/schemas/plan/config.ts"],"mappings":";;UAiBiB;EACf;IACE,WAAW;;;iBAeCA,kBAAgB,iBAAiB,mBAAmB;iBAKpDC,mBAAiB,cAAc,YAAY,kBAAkB,aAAa;iBAQ1EC,iBAAe,kBAAkB,yBAAyB"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"prompts-DUVUPNZd.cjs","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"}
|
|
@@ -1 +0,0 @@
|
|
|
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"}
|