@agimon-ai/po-plan 0.0.0-alpha.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +98 -0
- package/dist/apiContracts.cjs +57 -0
- package/dist/apiContracts.cjs.map +1 -0
- package/dist/apiContracts.d.mts +53 -0
- package/dist/apiContracts.d.mts.map +1 -0
- package/dist/apiContracts.mjs +52 -0
- package/dist/apiContracts.mjs.map +1 -0
- package/dist/config-BC-Tou05.mjs +25 -0
- package/dist/config-BC-Tou05.mjs.map +1 -0
- package/dist/config-D0iTexGm.cjs +42 -0
- package/dist/config-D0iTexGm.cjs.map +1 -0
- package/dist/config-DWo57HKB.d.mts +13 -0
- package/dist/config-DWo57HKB.d.mts.map +1 -0
- package/dist/config.cjs +12 -0
- package/dist/config.d.mts +2 -0
- package/dist/config.mjs +2 -0
- package/dist/extensions/mcp-ui.mjs +46 -0
- package/dist/extensions/mcp-ui.mjs.map +1 -0
- package/dist/extensions/mcp.cjs +93 -0
- package/dist/extensions/mcp.cjs.map +1 -0
- package/dist/extensions/mcp.d.mts +5 -0
- package/dist/extensions/mcp.d.mts.map +1 -0
- package/dist/extensions/mcp.mjs +88 -0
- package/dist/extensions/mcp.mjs.map +1 -0
- package/dist/extensions/server.cjs +1025 -0
- package/dist/extensions/server.cjs.map +1 -0
- package/dist/extensions/server.d.mts +5 -0
- package/dist/extensions/server.d.mts.map +1 -0
- package/dist/extensions/server.mjs +993 -0
- package/dist/extensions/server.mjs.map +1 -0
- package/dist/extensions/web.mjs +861 -0
- package/dist/extensions/web.mjs.map +1 -0
- package/dist/fableFlow-BDc8a__Y.mjs +214 -0
- package/dist/fableFlow-BDc8a__Y.mjs.map +1 -0
- package/dist/fableFlow-CzfrLPzJ.cjs +279 -0
- package/dist/fableFlow-CzfrLPzJ.cjs.map +1 -0
- package/dist/fableFlow.cjs +13 -0
- package/dist/fableFlow.d.mts +2 -0
- package/dist/fableFlow.mjs +2 -0
- package/dist/index-C8e7IK60.d.mts +68 -0
- package/dist/index-C8e7IK60.d.mts.map +1 -0
- package/dist/index-C9QBG9cw.d.mts +51 -0
- package/dist/index-C9QBG9cw.d.mts.map +1 -0
- package/dist/index.cjs +31 -0
- package/dist/index.d.mts +4 -0
- package/dist/index.mjs +4 -0
- package/dist/logSinkTelemetry.cjs +42 -0
- package/dist/logSinkTelemetry.cjs.map +1 -0
- package/dist/logSinkTelemetry.d.mts +33 -0
- package/dist/logSinkTelemetry.d.mts.map +1 -0
- package/dist/logSinkTelemetry.mjs +40 -0
- package/dist/logSinkTelemetry.mjs.map +1 -0
- package/dist/planConfig.cjs +190 -0
- package/dist/planConfig.cjs.map +1 -0
- package/dist/planConfig.d.mts +47 -0
- package/dist/planConfig.d.mts.map +1 -0
- package/dist/planConfig.mjs +186 -0
- package/dist/planConfig.mjs.map +1 -0
- package/dist/prompts-DUVUPNZd.cjs +103 -0
- package/dist/prompts-DUVUPNZd.cjs.map +1 -0
- package/dist/prompts-DnVJGtEC.mjs +68 -0
- package/dist/prompts-DnVJGtEC.mjs.map +1 -0
- package/dist/prompts.cjs +8 -0
- package/dist/prompts.d.mts +2 -0
- package/dist/prompts.mjs +2 -0
- package/llms.txt +9 -0
- package/package.json +164 -0
- package/src/prompts/po-use-plan/SKILL.md +44 -0
- package/src/types/planApi.ts +125 -0
- package/src/types/planSettings.ts +78 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"server.cjs","names":["Type","isRecord","os","path","piAgentDirectory","fs","createHash","defineApiRoutes","apiResponse","createHash","fs","Hono","routes","os","resolvePlanningPlansDirectory","loadDoomConfig","defineMinorMode","serverMinorModes","readPackageResource","DOOM_VOICE_AUTO_MODE_ID","mkdir","path","writeFile","buildPlanModeBasePrompt","buildFlavorPlanningPrompt","readFile","Buffer","defineRoot","defineRoute","defineRoutedContribution","defineRoutedContribution","defineRoutedContribution","defineRoutedContribution","defineToolRestriction","DOOM_VOICE_AUTO_MODE_ID","defineToolRestriction","defineRoutedContribution","defineRoutedContribution","defineRoutedContribution","defineServerPlugin","composeServerProviderOverrides","rootSession","composeRootHooks","apiRoute","hookBeforeAgentStart","hookContext","hookSessionStart","resourcePoUsePlan","toolRestrictionPlan","toolRestrictionPlanReadOnly","toolCompletePlan","toolRecordDebugEvidence","toolWritePlan"],"sources":["../../src/schemas/mcpTools.ts","../../src/services/mcpTools/index.ts","../../src/services/planPointer/index.ts","../../src/types/apiRoutes.ts","../../src/types/planApi.ts","../../src/services/planApi/index.ts","../../src/services/optionalTeamServices/index.ts","../../src/services/planServerSession/index.ts","../../src/extensions/workspaces/sessions/(backend)/root.server.ts","../../src/extensions/workspaces/sessions/(backend)/api/plans/route.server.ts","../../src/extensions/workspaces/sessions/(backend)/hook/beforeAgentStart.server.ts","../../src/extensions/workspaces/sessions/(backend)/hook/context.server.ts","../../src/extensions/workspaces/sessions/(backend)/hook/sessionStart.server.ts","../../src/extensions/workspaces/sessions/(backend)/resource/poUsePlan.server.ts","../../src/extensions/workspaces/sessions/(backend)/tool-restriction/plan.server.ts","../../src/extensions/workspaces/sessions/(backend)/tool-restriction/planReadOnly.server.ts","../../src/extensions/workspaces/sessions/(backend)/tool/completePlan.server.ts","../../src/extensions/workspaces/sessions/(backend)/tool/recordDebugEvidence.server.ts","../../src/extensions/workspaces/sessions/(backend)/tool/writePlan.server.ts","../../generated/server.ts"],"sourcesContent":["import { Type } from 'typebox';\n\nconst markdown = Type.String({ minLength: 1 });\n\nexport const remoteWritePlanParameters = Type.Object({ markdown }, { additionalProperties: false });\nexport const writePlanParameters = Type.Object({ markdown: Type.Optional(markdown) }, { additionalProperties: false });\n","import type { DoomHeadlessTool } from '@agimon-ai/po-core/headless';\nimport type { DoomMcpPluginContext } from '@agimon-ai/po-core/mcpFacet';\nimport type { Context } from '@deepseek-ai/cordis';\n\nimport { remoteWritePlanParameters } from '../../schemas/mcpTools';\n\nexport const PLAN_MCP_TOOLS_SERVICE = 'doom/plan-mcp-tools';\n\nconst MODE_ID = 'plan';\nconst MODE_LABEL = 'Plan';\n\nexport interface McpToolCatalog {\n get(name: string): DoomHeadlessTool | undefined;\n names(): readonly string[];\n}\n\nexport function mountMcpTools(tools: readonly DoomHeadlessTool[]) {\n return (context: Context): void => {\n context.plugin((providerContext) => {\n providerContext.provide(PLAN_MCP_TOOLS_SERVICE, {\n get: (name) => tools.find((tool) => tool.name === name),\n names: () => tools.map((tool) => tool.name),\n } satisfies McpToolCatalog);\n });\n };\n}\n\nexport function bindMcpTool(context: DoomMcpPluginContext, name: string): DoomHeadlessTool {\n const catalog = context.services.get<McpToolCatalog>(PLAN_MCP_TOOLS_SERVICE);\n const tool = catalog?.get(name);\n if (!tool || !catalog) throw new Error(`Plan tool is unavailable: ${name}`);\n const writesPlan = name === 'write_plan';\n return {\n ...tool,\n ...(writesPlan\n ? {\n description:\n 'Save the supplied Markdown plan in the bound session. Requires active Plan mode. Saving does not approve implementation.',\n parameters: remoteWritePlanParameters,\n annotations: { readOnlyHint: false, destructiveHint: false, openWorldHint: false },\n }\n : {}),\n execute(toolCallId, parameters, signal, onUpdate) {\n const activeModes = context.selection.read().state?.['minor-mode'] ?? [];\n if (!activeModes.includes(MODE_ID)) {\n const inactiveTools = [...catalog.names()].sort().join(', ');\n throw new Error(`${MODE_LABEL} minor mode is inactive. Inactive ${MODE_LABEL} tools: ${inactiveTools}.`);\n }\n if (\n writesPlan &&\n (typeof parameters !== 'object' ||\n parameters === null ||\n !('markdown' in parameters) ||\n typeof parameters.markdown !== 'string' ||\n !parameters.markdown.trim())\n ) {\n throw new Error(\n 'Supply the complete visible plan in the markdown argument. Remote calls cannot read the ChatGPT transcript.',\n );\n }\n const executionSignal = AbortSignal.any([context.signal, signal ?? context.signal]);\n return tool.execute(toolCallId, parameters, executionSignal, onUpdate, context.execution);\n },\n };\n}\n","import { createHash } from 'node:crypto';\nimport fs from 'node:fs';\nimport os from 'node:os';\nimport path from 'node:path';\n\nimport { piAgentDirectory } from '@agimon-ai/po-core/piSettings';\n\nimport type { PlanPointerRecord } from '../../types/planApi';\nimport type { PlanPointerPort } from '../../types/planPointer';\n\n/**\n * Record and read where write_plan left this session's plan file.\n *\n * Pi already gives every session an agent directory, so the records live under\n * it rather than in a second place a reader would have to know about. The\n * posture matches the plan file itself, 0700 on the directory and 0600 on the\n * record: a plan is a private working document, not something to leave\n * world-readable in a shared home.\n */\n\nconst POINTER_DIRECTORY = 'doom-plan';\nconst PRIVATE_DIRECTORY_MODE = 0o700;\nconst PRIVATE_FILE_MODE = 0o600;\n\nexport interface NodePlanPointerOptions {\n env?: NodeJS.ProcessEnv;\n homeDirectory?: string;\n}\n\nfunction isRecord(value: unknown): value is Record<string, unknown> {\n return typeof value === 'object' && value !== null && !Array.isArray(value);\n}\n\nexport class PlanPointerService implements PlanPointerPort {\n private readonly env: NodeJS.ProcessEnv;\n private readonly homeDirectory: string;\n\n constructor(options: NodePlanPointerOptions = {}) {\n this.env = options.env ?? {};\n this.homeDirectory = options.homeDirectory ?? os.homedir();\n }\n\n /** Where the records live; exposed so a test can look without guessing. */\n directory(): string {\n return path.join(piAgentDirectory(this.env, this.homeDirectory), POINTER_DIRECTORY);\n }\n\n /**\n * The record for one session. The id is hashed rather than used as written:\n * it reaches here from a host that may word it however it likes, and a\n * filename is not the place to find that out.\n */\n pathFor(sessionId: string): string {\n return path.join(this.directory(), `${this.hash(sessionId)}.json`);\n }\n\n read(sessionId: string): PlanPointerRecord | undefined {\n let raw: string;\n try {\n raw = fs.readFileSync(this.pathFor(sessionId), 'utf8');\n } catch {\n return undefined;\n }\n let parsed: unknown;\n try {\n parsed = JSON.parse(raw);\n } catch {\n return undefined;\n }\n if (!isRecord(parsed)) return undefined;\n const { path: planPath, title, writtenAt, planId } = parsed;\n // A record half-written by an interrupted run reads as no plan at all,\n // which is a state the cockpit already handles.\n if (typeof planPath !== 'string' || !path.isAbsolute(planPath)) return undefined;\n if (typeof title !== 'string' || typeof writtenAt !== 'string') return undefined;\n return { path: planPath, title, writtenAt, ...(typeof planId === 'string' ? { planId } : {}) };\n }\n\n write(sessionId: string, record: PlanPointerRecord): void {\n fs.mkdirSync(this.directory(), { recursive: true, mode: PRIVATE_DIRECTORY_MODE });\n fs.writeFileSync(this.pathFor(sessionId), JSON.stringify(record), { mode: PRIVATE_FILE_MODE });\n }\n\n clear(sessionId: string): void {\n fs.rmSync(this.pathFor(sessionId), { force: true });\n }\n\n private hash(value: string): string {\n return createHash('sha256').update(value).digest('hex').slice(0, 16);\n }\n}\n","import { apiResponse, defineApiRoutes } from '@agimon-ai/po-core/web';\n\nimport type { PlanDetailView, PlanSaveView } from './planApi';\n\n/**\n * This package's routes, as data.\n *\n * No scope and no base path. The build reads both off\n * `src/extensions/workspaces/sessions/(backend)/api/plans/`, so the mount is\n * stated once, by the folder that creates it. The paths used to be written\n * here as helpers, again in the contract, and again inside every URL the page\n * built, and the copies were free to disagree.\n *\n * This is the one file the routes, the Hono app and the browser all read, so a\n * path cannot move on one side alone.\n *\n * Neither route takes a query or a path parameter: a session has one current\n * plan, so `current` answers it and `save` takes the manual write back.\n */\nexport default defineApiRoutes({\n current: {\n method: 'GET',\n path: '/current',\n response: apiResponse<PlanDetailView>(),\n },\n save: {\n method: 'PUT',\n path: '/content',\n response: apiResponse<PlanSaveView>(),\n },\n});\n","/**\n * The wire vocabulary this package's API shares with whatever calls it.\n *\n * It lives under src/types because that is the one server root a browser\n * bundle may read: the routes answer with these shapes and the cockpit plugin\n * reads them, so neither half can drift from the other. The paths themselves\n * are not here; they are declared once in `./apiRoutes`, which the Hono app\n * and the generated client both read.\n *\n * Two routes, and neither takes a path. A session has one current plan, so\n * `current` answers it and `content` takes the manual save back; the file they\n * act on is the one write_plan recorded, never one the page named. That is\n * also why there is nothing to escape here: a reader cannot address a second\n * file through these URLs.\n */\n\n/** Where a host mounts this package's API; the segment after /api/plugins/. */\nexport const API_BASE_PATH = 'plans';\n\n/**\n * Footer status key the session publishes once a plan exists, which is what\n * makes the cockpit's activity group appear at all. It outlives plan mode: the\n * plan is most worth reading while the agent implements it.\n */\nexport const PLAN_STATUS_KEY = 'doom-plan-document';\n\n/** The selector contract shared by complete_plan and its cockpit composer prompt. */\nexport const PLAN_REVIEW_TITLE = 'Plan complete. What would you like to do?';\nexport const EXIT_PLAN_MODE_CHOICE = 'Exit plan mode and start implementation';\nexport const CONTINUE_PLANNING_CHOICE = 'Continue planning';\nexport const EXIT_PLAN_DECISION = 'exit';\nexport const CONTINUE_PLAN_DECISION = 'continue';\n\n/**\n * The label the reader sees paired with the decision the tool acts on. A headless\n * client answers with `value`, so a facet never has to recognise the wording; Pi's\n * own `ui.select` carries labels only, so its half maps the label back itself.\n */\nexport const PLAN_REVIEW_CHOICES = [\n { label: EXIT_PLAN_MODE_CHOICE, value: EXIT_PLAN_DECISION },\n { label: CONTINUE_PLANNING_CHOICE, value: CONTINUE_PLAN_DECISION },\n] as const;\n\n/** The same options as bare labels, which is all Pi's select and the composer prompt need. */\nexport const PLAN_REVIEW_OPTIONS = PLAN_REVIEW_CHOICES.map((choice) => choice.label);\n\n/** Between the plan's title and the stamp that marks a rewrite. */\nconst STATUS_SEPARATOR = ' · ';\n\n/** Strips the colour a session may have themed a status with. */\nconst ANSI = /\u001b\\[[0-9;]*m/gu;\n\n/** The status line the session publishes; the stamp changes on every write. */\nexport function formatPlanStatus(title: string, stamp: string): string {\n return `${title}${STATUS_SEPARATOR}${stamp}`;\n}\n\n/** What a reader gets out of the status line. */\nexport interface PlanStatusView {\n title: string;\n /** When the plan was last written, as the session worded it; empty when it said nothing. */\n stamp: string;\n}\n\n/**\n * Reading the status line back. Statuses reach a plugin raw, so the colour a\n * session may have added comes off here. A title can itself contain the\n * separator, so the stamp is taken from the last one rather than the first.\n */\nexport function parsePlanStatus(raw: string | undefined): PlanStatusView | undefined {\n if (raw === undefined) return undefined;\n const text = raw.replace(ANSI, '').trim();\n if (text === '') return undefined;\n const cut = text.lastIndexOf(STATUS_SEPARATOR);\n if (cut === -1) return { title: text, stamp: '' };\n return { title: text.slice(0, cut).trim(), stamp: text.slice(cut + STATUS_SEPARATOR.length).trim() };\n}\n\n/**\n * What write_plan recorded about this session's plan.\n *\n * The absolute path is the point of it: the extension resolves the plans\n * directory against the harness root, which no other process knows, so it\n * writes down where the plan landed rather than leaving the API to derive a\n * location it would sometimes get wrong.\n */\nexport interface PlanPointerRecord {\n path: string;\n title: string;\n writtenAt: string;\n planId?: string;\n}\n\n/** The plan as it stands on disk right now, which is what the source view edits. */\nexport interface PlanDetailView {\n path: string;\n title: string;\n writtenAt: string;\n planId?: string;\n content: string;\n /** sha256 of the content; the token a save hands back to prove it is not stale. */\n hash: string;\n /** True when the plan is missing or past the size cap, so `content` is empty. */\n unavailable: boolean;\n reason?: string;\n}\n\n/** What the save route takes. */\nexport interface PlanSaveRequest {\n /** The hash the reader loaded; a mismatch means the plan moved underneath them. */\n expectedHash: string;\n content: string;\n}\n\n/** What the save route answers with. */\nexport interface PlanSaveView {\n hash: string;\n}\n\n/** What a route reports when it refuses; the page shows `error` verbatim. */\nexport interface PlanErrorView {\n error: string;\n /** On a stale save, the hash the plan actually has now. */\n hash?: string;\n}\n","import { createHash } from 'node:crypto';\nimport fs from 'node:fs/promises';\n\nimport type { DoomApi, DoomApiContext, DoomApiHandler } from '@agimon-ai/po-core/packageApi';\nimport { Hono } from 'hono';\n\nimport { PlanPointerService } from '../../services/planPointer';\nimport routes from '../../types/apiRoutes';\nimport { API_BASE_PATH, type PlanDetailView, type PlanSaveRequest, type PlanSaveView } from '../../types/planApi';\nimport type { PlanPointerPort } from '../../types/planPointer';\n\n/**\n * This package's HTTP surface: the session's current plan, and the manual save.\n *\n * Each path comes from the route table the browser reads, so a route the page\n * calls and the route this serves cannot be spelled apart. Both are relative\n * to the mount its host gives it, so nothing here repeats where it was mounted. The host is one session's own server, which is what\n * makes the session id available without the page supplying it.\n *\n * Neither route takes a path. A session has exactly one current plan, and the\n * file both routes act on is the one the pointer names, so a page can address\n * the plan and nothing else; there is no traversal question to answer because\n * there is no path to traverse.\n *\n * The save refuses unless the reader proves they were looking at the content\n * that is still on disk. The agent may rewrite the plan while a tab is open,\n * and silently discarding whichever side finished second is the one outcome\n * worth ruling out.\n */\n\n/** Past this, the plan is reported rather than carried. */\nexport const MAX_PLAN_BYTES = 1024 * 1024;\n\nconst NO_PLAN = 'This session has not written a plan yet.';\nconst STALE_SAVE = 'The plan changed since it was opened.';\nconst NOT_A_FILE = 'The plan file is no longer a regular file, so it was not written.';\n\nexport interface PlanApiOptions {\n /** The session these routes answer for; absent when the host is the hub. */\n sessionId?: string;\n pointers?: PlanPointerPort;\n}\n\nfunction hashOf(content: string): string {\n return createHash('sha256').update(content, 'utf8').digest('hex');\n}\n\n/** Reads the plan as the source view will show it, or says why it cannot. */\nasync function readPlan(\n planPath: string,\n): Promise<Pick<PlanDetailView, 'content' | 'hash' | 'unavailable' | 'reason'>> {\n let raw: Buffer;\n try {\n raw = await fs.readFile(planPath);\n } catch {\n return { content: '', hash: '', unavailable: true, reason: 'the plan file no longer exists' };\n }\n if (raw.byteLength > MAX_PLAN_BYTES) {\n return { content: '', hash: '', unavailable: true, reason: `the plan is larger than ${MAX_PLAN_BYTES} bytes` };\n }\n const content = raw.toString('utf8');\n return { content, hash: hashOf(content), unavailable: false };\n}\n\nexport function createPlanApi(options: PlanApiOptions = {}): Hono {\n const app = new Hono();\n const pointers = options.pointers ?? new PlanPointerService({ env: process.env });\n const pointerFor = (): ReturnType<PlanPointerPort['read']> =>\n options.sessionId === undefined ? undefined : pointers.read(options.sessionId);\n\n app.get(routes.current.path, async (context) => {\n const pointer = pointerFor();\n if (pointer === undefined) return context.json({ error: NO_PLAN }, 404);\n const view: PlanDetailView = {\n path: pointer.path,\n title: pointer.title,\n writtenAt: pointer.writtenAt,\n ...(pointer.planId === undefined ? {} : { planId: pointer.planId }),\n ...(await readPlan(pointer.path)),\n };\n return context.json(view);\n });\n\n app.put(routes.save.path, async (context) => {\n let request: PlanSaveRequest;\n try {\n request = (await context.req.json()) as PlanSaveRequest;\n } catch {\n return context.json({ error: 'The save body is not JSON.' }, 400);\n }\n if (typeof request.content !== 'string' || typeof request.expectedHash !== 'string') {\n return context.json({ error: 'A save carries the content to write and the hash it was read at.' }, 400);\n }\n const pointer = pointerFor();\n if (pointer === undefined) return context.json({ error: NO_PLAN }, 404);\n\n const current = await readPlan(pointer.path);\n if (current.unavailable) return context.json({ error: current.reason ?? NO_PLAN }, 409);\n if (current.hash !== request.expectedHash) {\n return context.json({ error: STALE_SAVE, hash: current.hash }, 409);\n }\n // The same guard write_plan applies before it writes: a plan whose\n // destination has become a symlink or gained a second name is not written\n // through, whatever the pointer still says.\n const stats = await fs.lstat(pointer.path);\n if (!stats.isFile() || stats.nlink !== 1) return context.json({ error: NOT_A_FILE }, 409);\n\n await fs.writeFile(pointer.path, request.content, { encoding: 'utf8', mode: 0o600 });\n return context.json({ hash: hashOf(request.content) } satisfies PlanSaveView);\n });\n\n return app;\n}\n\n/** The named export a host imports from this package's built entry. */\nexport const api: DoomApi = {\n basePath: API_BASE_PATH,\n start(context: DoomApiContext): DoomApiHandler {\n const app = createPlanApi(context.sessionId === undefined ? {} : { sessionId: context.sessionId });\n return {\n fetch: (request) => app.fetch(request),\n // Nothing outlives a request here; an API that starts a watch or a timer\n // tears it down in this callback.\n close: () => undefined,\n };\n },\n};\n","import type { Context } from '@deepseek-ai/cordis';\n\nimport { FABLE_PLAN_REQUESTER, type FablePlanRequest, type FablePlanResult } from '../fableFlow';\n\nexport const DOOM_FABLE_PLAN_SERVICE = 'doom/fable-plan';\nexport const DOOM_SUBAGENT_POLICY_SERVICE = 'doom/subagent-policy';\n\nexport interface DoomFablePlanService {\n start(request: FablePlanRequest, signal: AbortSignal): Promise<FablePlanResult>;\n cancel(request: { requester: typeof FABLE_PLAN_REQUESTER; operationId: string; reason: string }): void;\n}\n\nexport interface SubagentPolicy {\n owner: string;\n allowedTools?: string[];\n requiredTools?: string[];\n allowMcpTools?: boolean;\n allowedExternalProfiles?: string[];\n denyExtensions?: boolean;\n}\n\nexport interface SubagentPolicyHandle {\n update(policy: SubagentPolicy): void;\n dispose(): void;\n}\n\nexport interface DoomSubagentPolicyService {\n register(policy: SubagentPolicy): SubagentPolicyHandle;\n}\n\ntype StructuralServiceContext = {\n get(name: string): unknown;\n};\n\nexport function readDoomFablePlanService(ctx: Context): DoomFablePlanService | undefined {\n return (ctx as unknown as StructuralServiceContext).get(DOOM_FABLE_PLAN_SERVICE) as DoomFablePlanService | undefined;\n}\n\nexport function readDoomSubagentPolicyService(ctx: Context): DoomSubagentPolicyService | undefined {\n return (ctx as unknown as StructuralServiceContext).get(DOOM_SUBAGENT_POLICY_SERVICE) as\n | DoomSubagentPolicyService\n | undefined;\n}\n","import { Buffer } from 'node:buffer';\nimport { readFile } from 'node:fs/promises';\nimport { mkdir, writeFile } from 'node:fs/promises';\nimport os from 'node:os';\nimport path from 'node:path';\n\nimport { type DoomHeadlessHostService, type DoomHeadlessModelSettings } from '@agimon-ai/po-core/headless';\nimport { type DoomHeadlessToolResult } from '@agimon-ai/po-core/headless';\nimport { readPackageResource, type DoomServerSessionPlugin } from '@agimon-ai/po-core/serverFacet';\nimport { DOOM_VOICE_AUTO_MODE_ID } from '@agimon-ai/po-core/voiceTools';\nimport { serverMinorModes } from '@agimon-ai/po-minor-mode';\nimport { defineMinorMode, type MinorModeOwner, type MinorModeState } from '@agimon-ai/po-minor-mode';\nimport type { Context } from '@deepseek-ai/cordis';\n\nimport { writePlanParameters } from '../../schemas/mcpTools';\nimport { loadDoomConfig, resolvePlanningPlansDirectory } from '../../schemas/plan/config';\nimport {\n buildFlavorPlanningPrompt,\n buildPlanModeBasePrompt,\n type DebugEvidencePacket,\n type PlanHostCapabilities,\n type PlanningFlavor,\n} from '../../services/prompts';\nimport {\n CONTINUE_PLAN_DECISION,\n EXIT_PLAN_DECISION,\n PLAN_REVIEW_CHOICES,\n PLAN_REVIEW_TITLE,\n PLAN_STATUS_KEY,\n formatPlanStatus,\n} from '../../types/planApi';\nimport {\n DOOM_SUBAGENT_POLICY_SERVICE,\n readDoomSubagentPolicyService,\n type SubagentPolicy,\n type SubagentPolicyHandle,\n} from '../optionalTeamServices';\nimport { PlanPointerService } from '../planPointer';\n\nconst RECORD_DEBUG_EVIDENCE_TOOL = 'record_debug_evidence';\nconst WRITE_PLAN_TOOL = 'write_plan';\nconst COMPLETE_PLAN_TOOL = 'complete_plan';\nconst PLAN_MODE_ID = 'plan';\nconst PLAN_MODEL_SNAPSHOT = 'plan-server-model-snapshot';\nconst PLAN_FLAVOR_SNAPSHOT = 'plan-server-flavor';\nconst PLAN_DEBUG_EVIDENCE = 'plan-debug-evidence';\nconst PLAN_DOCUMENT = 'plan-document';\n/** This host supports UI review without narrated decisions. */\nexport const PLAN_SERVER_CAPABILITIES: PlanHostCapabilities = {\n completePlanTakesDecision: false,\n narratesReview: false,\n fableAvailable: false,\n};\nconst PLAN_SUBAGENT_POLICY_OWNER = '@agimon-ai/po-plan';\nconst PLAN_SUBAGENT_POLICY: SubagentPolicy = {\n owner: PLAN_SUBAGENT_POLICY_OWNER,\n allowedTools: ['read', 'bash', 'grep', 'find', 'ls', 'mcp'],\n requiredTools: ['bash'],\n allowMcpTools: true,\n allowedExternalProfiles: [],\n denyExtensions: false,\n};\n\nfunction serverPlanSubagentPolicy(host: DoomHeadlessHostService): (context: Context) => void {\n return (context) => {\n context.inject([DOOM_SUBAGENT_POLICY_SERVICE], (child) => {\n const service = readDoomSubagentPolicyService(child);\n if (!service) return undefined;\n let handle: SubagentPolicyHandle | undefined;\n const sync = (): void => {\n if (modeSelected(host)) {\n if (handle) handle.update(PLAN_SUBAGENT_POLICY);\n else handle = service.register(PLAN_SUBAGENT_POLICY);\n } else {\n handle?.dispose();\n handle = undefined;\n }\n };\n sync();\n child.effect(() => host.subscribeSelection(sync));\n return () => handle?.dispose();\n });\n };\n}\n\nfunction modeSelected(host: DoomHeadlessHostService): boolean {\n return (host.context.selection.state?.['minor-mode'] ?? []).includes(PLAN_MODE_ID);\n}\n\nfunction output(value: unknown, isError = false): DoomHeadlessToolResult {\n return {\n content: [{ type: 'text', text: typeof value === 'string' ? value : JSON.stringify(value, null, 2) }],\n details: value,\n ...(isError ? { isError: true } : {}),\n };\n}\n\nexport function createPlanServerSession(\n host: DoomHeadlessHostService,\n): Omit<DoomServerSessionPlugin, 'tools'> & { tools: Parameters<DoomHeadlessHostService['registerTool']>[0][] } {\n let flavor: PlanningFlavor = 'normal';\n let debugEvidence: DebugEvidencePacket | undefined;\n let modeOwner: MinorModeOwner | undefined;\n const selected = (): boolean => modeSelected(host);\n const homeDirectory = (): string => host.context.environment.HOME ?? os.homedir();\n // One resolution for the prompt and for write_plan. They named different directories before,\n // so the prompt could advertise a path the tool would not write to.\n const plansDirectory = (): string =>\n resolvePlanningPlansDirectory(\n loadDoomConfig(host.context.repoRoot, homeDirectory()).modes?.planning?.plansDirectory,\n host.context.repoRoot,\n homeDirectory(),\n );\n const pointers = new PlanPointerService({ env: host.context.environment });\n /**\n * The activity group's line, and the pointer its panel reads.\n *\n * A cockpit drives this facet and never the Pi runtime, so both were written\n * only on the Pi side: the group never appeared, and when it did its panel\n * had no pointer to answer from.\n */\n const announcePlanDocument = (filePath: string, title: string, writtenAt: string): void => {\n try {\n pointers.write(host.context.sessionId, { path: filePath, title, writtenAt });\n } catch {\n // The plan is on disk either way. Losing the cockpit's view of it is not\n // a reason to fail the write that produced it.\n }\n host.context.client.setStatus(PLAN_STATUS_KEY, formatPlanStatus(title, planStampOf(writtenAt)));\n };\n const modeState = (): MinorModeState => {\n const active = selected();\n return {\n activation: active ? 'active' : 'inactive',\n condition: 'ready',\n ...(active ? { detail: `${flavor} - read only`, modelContextVariant: flavor } : {}),\n actions: [\n {\n id: 'activate',\n enabled: true,\n },\n {\n id: 'deactivate',\n enabled: active,\n ...(active ? {} : { disabledReason: 'Plan mode is inactive.' }),\n },\n ],\n };\n };\n const publishMode = (): void => modeOwner?.publish();\n const restoreModel = async (): Promise<void> => {\n const session = host.context.session;\n const entries = await session.entries({ type: 'custom', customType: PLAN_MODEL_SNAPSHOT, limit: 1 });\n const data = entries[0]?.data;\n if (data === undefined || data === null) return;\n if (\n typeof data !== 'object' ||\n !('thinkingLevel' in data) ||\n !['off', 'minimal', 'low', 'medium', 'high', 'xhigh', 'max'].includes(String(data.thinkingLevel))\n )\n throw new Error('The saved planning model settings are invalid.');\n if (!session.setModelSettings) throw new Error('This session cannot restore its model settings.');\n await session.setModelSettings(data as DoomHeadlessModelSettings);\n await session.appendCustomEntry(PLAN_MODEL_SNAPSHOT, null);\n };\n const selectPlan = async (enabled: boolean, nextFlavor = flavor): Promise<void> => {\n const wasEnabled = selected();\n const session = host.context.session;\n if (enabled && !wasEnabled) {\n const config = loadDoomConfig(host.context.repoRoot, homeDirectory()).modes?.planning?.main;\n if (config?.model || config?.thinking) {\n if (!session.readModelSettings || !session.setModelSettings)\n throw new Error('This session cannot apply planning model settings.');\n const previous = await session.readModelSettings();\n const settings: Partial<DoomHeadlessModelSettings> = {};\n if (config.model) {\n const separator = config.model.indexOf('/');\n const provider = separator > 0 ? config.model.slice(0, separator) : previous.model?.provider;\n if (!provider) throw new Error('The planning model needs a provider.');\n settings.model = { provider, id: separator > 0 ? config.model.slice(separator + 1) : config.model };\n }\n if (config.thinking) settings.thinkingLevel = config.thinking;\n await session.appendCustomEntry(PLAN_MODEL_SNAPSHOT, previous);\n try {\n await session.setModelSettings(settings);\n } catch (error) {\n await session.setModelSettings(previous);\n await session.appendCustomEntry(PLAN_MODEL_SNAPSHOT, null);\n throw error;\n }\n }\n } else if (!enabled && wasEnabled) {\n await restoreModel();\n }\n const modes = (host.context.selection.state?.['minor-mode'] ?? []).filter((mode) => mode !== PLAN_MODE_ID);\n await host.changeSelection({\n axis: 'state',\n key: 'minor-mode',\n values: enabled ? [...modes, PLAN_MODE_ID] : modes,\n });\n flavor = nextFlavor;\n // Persisted because the minor mode survives a server restart while this local does not, and\n // the prompt is built from it. Without this a restored debug session silently plans as normal.\n await session.appendCustomEntry(PLAN_FLAVOR_SNAPSHOT, enabled ? { flavor } : null);\n publishMode();\n };\n\n /** Newest value for a custom entry type, or undefined when none was recorded. */\n const latestEntry = async (customType: string): Promise<unknown> => {\n const entries = await host.context.session.entries({ type: 'custom', customType, limit: 1 });\n return entries[0]?.data ?? undefined;\n };\n\n const restorePlanState = async (): Promise<void> => {\n const saved = await latestEntry(PLAN_FLAVOR_SNAPSHOT);\n if (saved !== undefined && saved !== null && typeof saved === 'object' && 'flavor' in saved) {\n const candidate = String((saved as { flavor: unknown }).flavor);\n if (candidate === 'fable') flavor = 'normal';\n else if (candidate === 'normal' || candidate === 'debug' || candidate === 'code-review') flavor = candidate;\n }\n const evidence = await latestEntry(PLAN_DEBUG_EVIDENCE);\n if (evidence === undefined || evidence === null) return;\n try {\n debugEvidence = parseDebugEvidencePacket(evidence);\n } catch {\n // A packet written by an older shape must not stop the session from planning.\n debugEvidence = undefined;\n }\n };\n modeOwner = defineMinorMode({\n descriptor: {\n source: '@agimon-ai/po-plan',\n id: PLAN_MODE_ID,\n label: 'Plan',\n description: 'Read-only planning with normal, debug, and code review flavors.',\n order: 40,\n actions: [\n {\n id: 'activate',\n label: 'Activate',\n description: 'Activate plan mode or switch its planning flavor.',\n contexts: ['headless'],\n parameters: [\n {\n name: 'flavor',\n label: 'Flavor',\n kind: 'enum',\n required: true,\n choices: [\n { value: 'normal', label: 'Normal' },\n { value: 'debug', label: 'Debug' },\n { value: 'code-review', label: 'Code Review' },\n ],\n },\n ],\n },\n {\n id: 'deactivate',\n label: 'Deactivate',\n description: 'Exit plan mode and restore the previous agent configuration.',\n contexts: ['headless'],\n parameters: [],\n },\n ],\n },\n state: () => modeState(),\n async handleAction(_runtime, actionId, argumentsValue, { signal }) {\n signal.throwIfAborted();\n if (actionId === 'activate') {\n const nextFlavor = argumentsValue.flavor;\n if (nextFlavor !== 'normal' && nextFlavor !== 'debug' && nextFlavor !== 'code-review')\n throw new Error('A valid plan flavor is required.');\n await selectPlan(true, nextFlavor);\n return { message: `Plan mode is active with the ${nextFlavor} flavor.` };\n }\n if (actionId === 'deactivate') {\n await selectPlan(false);\n return { message: 'Plan mode deactivated.' };\n }\n throw new Error(`Unknown plan mode action: ${actionId}`);\n },\n }).createOwner(undefined);\n return {\n services: [serverMinorModes([modeOwner]), serverPlanSubagentPolicy(host)],\n resources: [\n {\n when: { state: { 'minor-mode': PLAN_MODE_ID }, attribution: { kind: 'minor', mode: PLAN_MODE_ID } },\n name: 'po-use-plan',\n kind: 'skill',\n read: () => readPackageResource(import.meta.url, 'src/prompts/po-use-plan/SKILL.md'),\n },\n ],\n tools: [\n {\n when: { state: { 'minor-mode': PLAN_MODE_ID }, attribution: { kind: 'minor', mode: PLAN_MODE_ID } },\n name: RECORD_DEBUG_EVIDENCE_TOOL,\n label: 'Record Debug Evidence',\n description: 'Record bounded debug evidence as optional planning context.',\n parameters: {\n type: 'object',\n properties: {\n issue: { type: 'string' },\n expectedBehavior: { type: 'string' },\n reproductionAttempt: { type: 'string' },\n actualBehavior: { type: 'string' },\n logs: { type: 'array', items: { type: 'string' } },\n correlatedTraceEvidence: { type: 'array', items: { type: 'string' } },\n processOutput: { type: 'array', items: { type: 'string' } },\n browserConsoleEvidence: { type: 'array', items: { type: 'string' } },\n correlationIds: { type: 'array', items: { type: 'string' } },\n timestamps: { type: 'array', items: { type: 'string' } },\n verifiedFacts: { type: 'array', items: { type: 'string' } },\n hypotheses: { type: 'array', items: { type: 'string' } },\n unavailableEvidence: { type: 'array', items: { type: 'string' } },\n },\n required: ['issue'],\n additionalProperties: false,\n },\n executionMode: 'serial',\n async execute(_toolCallId, parameters) {\n try {\n const parsedEvidence = parseDebugEvidencePacket(parameters);\n await host.context.session.appendCustomEntry(PLAN_DEBUG_EVIDENCE, parsedEvidence);\n // Held in memory too: the debug prompt is rebuilt every turn from this packet.\n debugEvidence = parsedEvidence;\n return output({ recorded: true });\n } catch (error) {\n return output(error instanceof Error ? error.message : String(error), true);\n }\n },\n },\n {\n when: { state: { 'minor-mode': PLAN_MODE_ID }, attribution: { kind: 'minor', mode: PLAN_MODE_ID } },\n name: WRITE_PLAN_TOOL,\n label: 'Write Plan',\n description: 'Save the supplied Markdown plan, or the plan already presented in the local session.',\n parameters: writePlanParameters,\n executionMode: 'serial',\n async execute(toolCallId, parameters, signal) {\n try {\n signal?.throwIfAborted();\n // Remote callers supply their own visible Markdown. Only local calls may use the journal.\n let content =\n typeof parameters === 'object' && parameters !== null && 'markdown' in parameters\n ? parameters.markdown\n : undefined;\n if (content !== undefined && typeof content !== 'string')\n throw new Error('Plan Markdown must be a string.');\n if (content === undefined)\n content = visiblePlanForToolCall(await host.context.session.entries(), toolCallId);\n if (content === undefined) {\n if (host.context.selection.state?.['minor-mode']?.includes(DOOM_VOICE_AUTO_MODE_ID))\n throw new Error('Supply Markdown to write_plan during autonomous Voice; UI input is unavailable.');\n const requested = await host.context.client.request(\n {\n kind: 'input',\n title: 'Implementation plan',\n multiline: true,\n },\n signal,\n );\n content = typeof requested === 'string' ? requested : '';\n }\n if (typeof content !== 'string' || !content.trim())\n throw new Error('No implementation plan content was supplied.');\n const directory = plansDirectory();\n await mkdir(directory, { recursive: true, mode: 0o700 });\n const title = planTitleOf(content);\n const writtenAt = new Date().toISOString();\n const filename = `${planTitleSlug(content)}-${Date.now()}.md`;\n const filePath = path.join(directory, filename);\n await writeFile(filePath, `${content.trim()}\\n`, { encoding: 'utf8', mode: 0o600, flag: 'wx' });\n await host.context.session.appendCustomEntry(PLAN_DOCUMENT, {\n path: filePath,\n content: content.trim(),\n title,\n writtenAt,\n });\n announcePlanDocument(filePath, title, writtenAt);\n await selectPlan(true);\n const saved = { path: filePath, written: true };\n return { ...output(saved), structuredContent: saved };\n } catch (error) {\n return output(error instanceof Error ? error.message : String(error), true);\n }\n },\n },\n {\n when: { state: { 'minor-mode': PLAN_MODE_ID }, attribution: { kind: 'minor', mode: PLAN_MODE_ID } },\n name: COMPLETE_PLAN_TOOL,\n label: 'Complete Plan',\n description:\n 'Request exit-or-continue approval in the local Po UI. Requires the user to interact there; this is not a ChatGPT approval dialog.',\n // No decision parameter: this facet has no narrated review to answer, so a model-supplied\n // decision would be the agent approving its own plan instead of the reader approving it.\n parameters: { type: 'object', properties: {}, additionalProperties: false },\n executionMode: 'serial',\n async execute(_toolCallId, _parameters, signal) {\n try {\n if (host.context.selection.state?.['minor-mode']?.includes(DOOM_VOICE_AUTO_MODE_ID))\n throw new Error(\n 'UI plan review is unavailable during autonomous Voice. Wait for explicit user direction.',\n );\n // The client answers with the option's `value`, so the decision travels with the\n // question instead of the facet having to recognise the label it rendered.\n const decision = await host.context.client.request(\n {\n kind: 'select',\n title: PLAN_REVIEW_TITLE,\n options: PLAN_REVIEW_CHOICES.map((choice) => ({ ...choice })),\n },\n signal,\n );\n // A dismissed or aborted prompt answers with nothing, and that is not approval.\n const exited = decision === EXIT_PLAN_DECISION;\n await host.context.session.appendCustomEntry('plan-review', {\n decision: exited ? EXIT_PLAN_DECISION : CONTINUE_PLAN_DECISION,\n });\n await selectPlan(!exited);\n return {\n content: [{ type: 'text', text: exited ? PLAN_EXIT_APPROVED_TEXT : PLAN_CONTINUE_TEXT }],\n details: { exited },\n };\n } catch (error) {\n return output(error instanceof Error ? error.message : String(error), true);\n }\n },\n },\n ],\n hooks: [\n {\n when: { state: { 'minor-mode': PLAN_MODE_ID }, attribution: { kind: 'minor', mode: PLAN_MODE_ID } },\n event: 'before_agent_start',\n async handle(event) {\n const prompt = typeof event.systemPrompt === 'string' ? event.systemPrompt : '';\n const directory = plansDirectory();\n const sections = [\n buildPlanModeBasePrompt(directory, PLAN_SERVER_CAPABILITIES),\n buildFlavorPlanningPrompt(flavor, directory, debugEvidence),\n ];\n const saved = await latestEntry(PLAN_DOCUMENT);\n if (saved !== undefined && saved !== null && typeof saved === 'object' && 'path' in saved) {\n const document = saved as { path: string; content?: string };\n // Read from disk rather than from what write_plan remembered: the plan is editable in\n // the cockpit, and a reader who corrected it expects that correction implemented.\n let content = document.content ?? '';\n try {\n content = await readFile(document.path, 'utf8');\n } catch {\n content = document.content ?? '';\n }\n if (content.trim()) sections.push(`[CURRENT PLAN]\\nSource: ${document.path}\\n\\n${content}`);\n }\n return { systemPrompt: `${prompt}\\n\\n${sections.join('\\n\\n')}`.trim() };\n },\n },\n {\n event: 'session_start',\n async handle() {\n await restorePlanState();\n // A plan written in an earlier session is still the session's plan, so\n // the dock has to hear about it again on every restart.\n const pointer = pointers.read(host.context.sessionId);\n if (pointer)\n host.context.client.setStatus(\n PLAN_STATUS_KEY,\n formatPlanStatus(pointer.title, planStampOf(pointer.writtenAt)),\n );\n // Restore a saved model override if Plan was not restored with the session.\n if (!selected()) await restoreModel();\n },\n },\n {\n // Older harness sessions persisted plan-mode context messages; keep them out of the model context.\n event: 'context',\n async handle(event) {\n if (!Array.isArray(event.messages)) return;\n return {\n messages: event.messages.filter(\n (message) => (message as { customType?: string }).customType !== PLAN_MODE_CONTEXT,\n ),\n };\n },\n },\n ],\n };\n}\n\nconst DEFAULT_PLAN_TITLE = 'implementation-plan';\nconst PLAN_TITLE_MAX_LENGTH = 64;\nconst DEBUG_EVIDENCE_MAX_BYTES = 32 * 1024;\nconst DEBUG_EVIDENCE_MAX_TEXT_BYTES = 4 * 1024;\nconst DEBUG_EVIDENCE_MAX_ITEMS = 32;\nexport const PLAN_MODE_CONTEXT = 'agent-harness-plan-mode-context';\nexport const PLAN_EXIT_APPROVED_TEXT =\n 'The user approved exiting plan mode. Full tool access is restored. Begin implementing the approved plan.';\nexport const PLAN_CONTINUE_TEXT = 'The user chose to continue planning. Remain read-only and refine the plan.';\n/** The plan's own heading, as the status line and the pointer record word it. */\nexport function planTitleOf(markdown: string): string {\n return markdown.match(/^#\\s+(.+?)\\s*$/m)?.[1] ?? DEFAULT_PLAN_TITLE;\n}\n\nexport function planTitleSlug(markdown: string): string {\n const heading = planTitleOf(markdown);\n return (\n heading\n .normalize('NFKD')\n .replace(/[\\u0300-\\u036f]/g, '')\n .toLowerCase()\n .replace(/[^a-z0-9]+/g, '-')\n .replace(/^-+|-+$/g, '')\n .slice(0, PLAN_TITLE_MAX_LENGTH) || DEFAULT_PLAN_TITLE\n );\n}\n\n/**\n * How the status line words when a plan was written. A malformed timestamp is\n * shown as it came rather than as an invalid date: the stamp's other job is to\n * change on a rewrite, and it can still do that.\n */\nexport function planStampOf(writtenAt: string): string {\n const at = new Date(writtenAt);\n return Number.isNaN(at.getTime()) ? writtenAt : at.toLocaleTimeString();\n}\n\nexport function visiblePlanForToolCall(entries: readonly unknown[], toolCallId: string): string | undefined {\n for (let index = entries.length - 1; index >= 0; index -= 1) {\n const entry = entries[index];\n if (!entry || typeof entry !== 'object') continue;\n const candidate = entry as {\n type?: string;\n message?: { role?: string; content?: unknown };\n };\n if (candidate.type !== 'message' || candidate.message?.role !== 'assistant') continue;\n if (!Array.isArray(candidate.message.content)) continue;\n\n const toolIndex = candidate.message.content.findIndex((block) => {\n if (!block || typeof block !== 'object') return false;\n const content = block as { type?: string; id?: string; name?: string };\n return content.type === 'toolCall' && content.id === toolCallId && content.name === WRITE_PLAN_TOOL;\n });\n if (toolIndex < 0) continue;\n\n const plan = candidate.message.content\n .slice(0, toolIndex)\n .flatMap((block) => {\n if (!block || typeof block !== 'object') return [];\n const content = block as { type?: string; text?: unknown };\n return content.type === 'text' && typeof content.text === 'string' ? [content.text] : [];\n })\n .join('\\n\\n')\n .trim();\n return plan || undefined;\n }\n return undefined;\n}\n\nfunction isRecord(value: unknown): value is Record<string, unknown> {\n return typeof value === 'object' && value !== null && !Array.isArray(value);\n}\n\nfunction isString(value: unknown): value is string {\n return typeof value === 'string';\n}\n\nfunction boundedDebugText(value: unknown, field: string, required: boolean): string {\n if (!isString(value)) throw new Error(`${field} must be a string.`);\n const text = value.trim();\n if (required && !text) throw new Error(`${field} must not be empty.`);\n if (Buffer.byteLength(text, 'utf8') > DEBUG_EVIDENCE_MAX_TEXT_BYTES) {\n throw new Error(`${field} exceeds the bounded debug evidence limit.`);\n }\n return text;\n}\n\nfunction boundedDebugList(value: unknown, field: string): string[] {\n if (!Array.isArray(value) || value.length > DEBUG_EVIDENCE_MAX_ITEMS) {\n throw new Error(`${field} must be a bounded string array.`);\n }\n return value.map((item, index) => boundedDebugText(item, `${field}[${index}]`, false));\n}\n\nfunction optionalDebugText(value: unknown, field: string): string {\n return value === undefined ? '' : boundedDebugText(value, field, false);\n}\n\nfunction optionalDebugList(value: unknown, field: string): string[] {\n return value === undefined ? [] : boundedDebugList(value, field);\n}\n\nfunction assertExactObjectKeys(value: Record<string, unknown>, keys: readonly string[], field: string): void {\n const allowed = new Set(keys);\n const unexpected = Object.keys(value).find((key) => !allowed.has(key));\n if (unexpected) throw new Error(`${field} contains unsupported field '${unexpected}'.`);\n}\n\nexport function parseDebugEvidencePacket(value: unknown): DebugEvidencePacket {\n if (!isRecord(value)) throw new Error('Debug evidence must be an object.');\n assertExactObjectKeys(\n value,\n [\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 'Debug evidence',\n );\n const packet: DebugEvidencePacket = {\n issue: boundedDebugText(value.issue, 'issue', true),\n expectedBehavior: optionalDebugText(value.expectedBehavior, 'expectedBehavior'),\n reproductionAttempt: optionalDebugText(value.reproductionAttempt, 'reproductionAttempt'),\n actualBehavior: optionalDebugText(value.actualBehavior, 'actualBehavior'),\n logs: optionalDebugList(value.logs, 'logs'),\n correlatedTraceEvidence: optionalDebugList(value.correlatedTraceEvidence, 'correlatedTraceEvidence'),\n processOutput: optionalDebugList(value.processOutput, 'processOutput'),\n browserConsoleEvidence: optionalDebugList(value.browserConsoleEvidence, 'browserConsoleEvidence'),\n correlationIds: optionalDebugList(value.correlationIds, 'correlationIds'),\n timestamps: optionalDebugList(value.timestamps, 'timestamps'),\n verifiedFacts: optionalDebugList(value.verifiedFacts, 'verifiedFacts'),\n hypotheses: optionalDebugList(value.hypotheses, 'hypotheses'),\n unavailableEvidence: optionalDebugList(value.unavailableEvidence, 'unavailableEvidence'),\n };\n if (Buffer.byteLength(JSON.stringify(packet), 'utf8') > DEBUG_EVIDENCE_MAX_BYTES) {\n throw new Error('Debug evidence exceeds the bounded packet size.');\n }\n return packet;\n}\n","import { defineRoot, type RootDeclaration } from '@agimon-ai/po-core/extensionFile';\nimport type { DoomServerPluginContext, DoomServerSessionPlugin } from '@agimon-ai/po-core/serverFacet';\n\nimport { mountMcpTools } from '../../../../services/mcpTools';\nimport { api } from '../../../../services/planApi';\nimport { createPlanServerSession } from '../../../../services/planServerSession';\n\nexport default defineRoot(\n ({ agent }: DoomServerPluginContext): RootDeclaration<DoomServerSessionPlugin, DoomServerPluginContext> => {\n const value = {\n api: [api],\n ...(agent ? createPlanServerSession(agent) : {}),\n };\n return {\n value,\n services: [...(value.services ?? []), ...(value.tools?.length ? [mountMcpTools(value.tools)] : [])],\n };\n },\n);\n","import { defineRoute, type WithRoot } from '@agimon-ai/po-core/extensionFile';\n\ntype Root = Awaited<ReturnType<typeof import('../../root.server').default>>['value'];\n\nexport default defineRoute((context: WithRoot<unknown, Root>) => context.root.api![0]!);\n","import { defineRoutedContribution, type WithRoot } from '@agimon-ai/po-core/extensionFile';\n\ntype Root = Awaited<ReturnType<typeof import('../root.server').default>>['value'];\n\nexport default defineRoutedContribution((context: WithRoot<unknown, Root>) => context.root.hooks?.[0], {\n cardinality: 'optional',\n});\n","import { defineRoutedContribution, type WithRoot } from '@agimon-ai/po-core/extensionFile';\n\ntype Root = Awaited<ReturnType<typeof import('../root.server').default>>['value'];\n\nexport default defineRoutedContribution((context: WithRoot<unknown, Root>) => context.root.hooks?.[2], {\n cardinality: 'optional',\n});\n","import { defineRoutedContribution, type WithRoot } from '@agimon-ai/po-core/extensionFile';\n\ntype Root = Awaited<ReturnType<typeof import('../root.server').default>>['value'];\n\nexport default defineRoutedContribution((context: WithRoot<unknown, Root>) => context.root.hooks?.[1], {\n cardinality: 'optional',\n});\n","import { defineRoutedContribution, type WithRoot } from '@agimon-ai/po-core/extensionFile';\n\ntype Root = Awaited<ReturnType<typeof import('../root.server').default>>['value'];\n\nexport default defineRoutedContribution((context: WithRoot<unknown, Root>) => context.root.resources?.[0], {\n cardinality: 'optional',\n});\n","import { defineToolRestriction } from '@agimon-ai/po-core/extensionFile';\nimport type { DoomHeadlessToolRestriction } from '@agimon-ai/po-core/headless';\nimport { DOOM_VOICE_AUTO_MODE_ID } from '@agimon-ai/po-core/voiceTools';\n\nexport default defineToolRestriction({\n when: { state: { 'minor-mode': DOOM_VOICE_AUTO_MODE_ID } },\n excludedTools: ['complete_plan'],\n} satisfies DoomHeadlessToolRestriction);\n","import { defineToolRestriction } from '@agimon-ai/po-core/extensionFile';\nimport type { DoomHeadlessToolRestriction } from '@agimon-ai/po-core/headless';\n\nexport default defineToolRestriction({\n when: { state: { 'minor-mode': 'plan' } },\n excludedTools: ['edit', 'write'],\n} satisfies DoomHeadlessToolRestriction);\n","import { defineRoutedContribution, type WithRoot } from '@agimon-ai/po-core/extensionFile';\n\ntype Root = Awaited<ReturnType<typeof import('../root.server').default>>['value'];\n\nexport default defineRoutedContribution((context: WithRoot<unknown, Root>) => context.root.tools?.[2], {\n cardinality: 'optional',\n});\n","import { defineRoutedContribution, type WithRoot } from '@agimon-ai/po-core/extensionFile';\n\ntype Root = Awaited<ReturnType<typeof import('../root.server').default>>['value'];\n\nexport default defineRoutedContribution((context: WithRoot<unknown, Root>) => context.root.tools?.[0], {\n cardinality: 'optional',\n});\n","import { defineRoutedContribution, type WithRoot } from '@agimon-ai/po-core/extensionFile';\n\ntype Root = Awaited<ReturnType<typeof import('../root.server').default>>['value'];\n\nexport default defineRoutedContribution((context: WithRoot<unknown, Root>) => context.root.tools?.[1], {\n cardinality: 'optional',\n});\n","// Generated by @agimon-ai/po-build. Do not edit by hand.\nimport { defineServerPlugin, type DoomServerSessionPlugin } from '@agimon-ai/po-core/serverFacet';\nimport { composeServerProviderOverrides } from '@agimon-ai/po-core/serverFacet';\nimport { composeRootHooks } from '@agimon-ai/po-core/extensionFile';\n\nimport rootSession from '../src/extensions/workspaces/sessions/(backend)/root.server';\nimport apiRoute from '../src/extensions/workspaces/sessions/(backend)/api/plans/route.server';\nimport hookBeforeAgentStart from '../src/extensions/workspaces/sessions/(backend)/hook/beforeAgentStart.server';\nimport hookContext from '../src/extensions/workspaces/sessions/(backend)/hook/context.server';\nimport hookSessionStart from '../src/extensions/workspaces/sessions/(backend)/hook/sessionStart.server';\nimport resourcePoUsePlan from '../src/extensions/workspaces/sessions/(backend)/resource/poUsePlan.server';\nimport toolRestrictionPlan from '../src/extensions/workspaces/sessions/(backend)/tool-restriction/plan.server';\nimport toolRestrictionPlanReadOnly from '../src/extensions/workspaces/sessions/(backend)/tool-restriction/planReadOnly.server';\nimport toolCompletePlan from '../src/extensions/workspaces/sessions/(backend)/tool/completePlan.server';\nimport toolRecordDebugEvidence from '../src/extensions/workspaces/sessions/(backend)/tool/recordDebugEvidence.server';\nimport toolWritePlan from '../src/extensions/workspaces/sessions/(backend)/tool/writePlan.server';\n\ntype Factory<T, C> = (context: C) => T;\nconst at = <T, C>(value: T | Factory<T, C>, context: C): T =>\n typeof value === 'function' ? (value as Factory<T, C>)(context) : value;\n/* v8 ignore next -- generated normalization branch */\nconst defined = <T>(values: readonly (T | undefined)[]): T[] =>\n values.filter((value): value is T => value !== undefined);\nconst via = <T>(identity: Record<string, unknown>, value: unknown): T =>\n (value === undefined ? undefined : { ...identity, ...(value as object) }) as T;\n\nexport const facet = defineServerPlugin({\n name: '@agimon-ai/po-plan',\n providerOverrides: composeServerProviderOverrides(rootSession),\n session: async (context) => {\n const scopeSession = await rootSession(context);\n const contextSession = { ...context, root: scopeSession.value };\n return {\n ...composeRootHooks(scopeSession),\n get api(): DoomServerSessionPlugin['api'] { return [at(apiRoute, contextSession)]; },\n get hooks(): DoomServerSessionPlugin['hooks'] { return defined([via({ event: 'before_agent_start' }, at(hookBeforeAgentStart, contextSession)), via({ event: 'context' }, at(hookContext, contextSession)), via({ event: 'session_start' }, at(hookSessionStart, contextSession))]); },\n get resources(): DoomServerSessionPlugin['resources'] { return defined([at(resourcePoUsePlan, contextSession)]); },\n get toolRestrictions(): DoomServerSessionPlugin['toolRestrictions'] { return [at(toolRestrictionPlan, contextSession), at(toolRestrictionPlanReadOnly, contextSession)]; },\n get tools(): DoomServerSessionPlugin['tools'] { return defined([via({ name: 'complete_plan' }, at(toolCompletePlan, contextSession)), via({ name: 'record_debug_evidence' }, at(toolRecordDebugEvidence, contextSession)), via({ name: 'write_plan' }, at(toolWritePlan, contextSession))]); },\n services: [...(scopeSession.services ?? [])],\n get activities(): DoomServerSessionPlugin['activities'] { return [...(scopeSession.activities ?? [])]; },\n };\n },\n});\n\nexport default facet;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEA,MAAM,WAAWA,QAAAA,KAAK,OAAO,EAAE,WAAW,EAAE,CAAC;AAEJA,QAAAA,KAAK,OAAO,EAAE,SAAS,GAAG,EAAE,sBAAsB,MAAM,CAAC;AAClG,MAAa,sBAAsBA,QAAAA,KAAK,OAAO,EAAE,UAAUA,QAAAA,KAAK,SAAS,QAAQ,EAAE,GAAG,EAAE,sBAAsB,MAAM,CAAC;;;ACCrH,MAAa,yBAAyB;AAUtC,SAAgB,cAAc,OAAoC;CAChE,QAAQ,YAA2B;EACjC,QAAQ,QAAQ,oBAAoB;GAClC,gBAAgB,QAAQ,wBAAwB;IAC9C,MAAM,SAAS,MAAM,MAAM,SAAS,KAAK,SAAS,IAAI;IACtD,aAAa,MAAM,KAAK,SAAS,KAAK,IAAI;GAC5C,CAA0B;EAC5B,CAAC;CACH;AACF;;;;;;;;;;;;ACLA,MAAM,oBAAoB;AAC1B,MAAM,yBAAyB;AAC/B,MAAM,oBAAoB;AAO1B,SAASC,WAAS,OA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