@agimon-ai/doompi-plan 0.0.1-alpha.58 → 0.0.1-alpha.64

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.
Files changed (65) hide show
  1. package/dist/adapters/node/planPointer.cjs +1 -1
  2. package/dist/adapters/node/planPointer.cjs.map +1 -1
  3. package/dist/adapters/node/planPointer.mjs +1 -1
  4. package/dist/adapters/node/planPointer.mjs.map +1 -1
  5. package/dist/adapters/pi/extension.d.cts +2 -2
  6. package/dist/adapters/pi/extension.d.cts.map +1 -1
  7. package/dist/adapters/pi/extension.d.mts +2 -2
  8. package/dist/adapters/pi/extension.d.mts.map +1 -1
  9. package/dist/adapters/planApi.d.cts +3 -4
  10. package/dist/adapters/planApi.d.cts.map +1 -1
  11. package/dist/adapters/planApi.d.mts +3 -4
  12. package/dist/adapters/planApi.d.mts.map +1 -1
  13. package/dist/adapters/telemetry/logSinkTelemetry.d.cts +6 -7
  14. package/dist/adapters/telemetry/logSinkTelemetry.d.cts.map +1 -1
  15. package/dist/adapters/telemetry/logSinkTelemetry.d.mts +6 -7
  16. package/dist/adapters/telemetry/logSinkTelemetry.d.mts.map +1 -1
  17. package/dist/schemas/plan/config.d.cts +5 -5
  18. package/dist/schemas/plan/config.d.cts.map +1 -1
  19. package/dist/schemas/plan/config.d.mts +2 -2
  20. package/dist/schemas/plan/config.d.mts.map +1 -1
  21. package/dist/schemas/plan/planConfig.cjs +1 -1
  22. package/dist/schemas/plan/planConfig.cjs.map +1 -1
  23. package/dist/schemas/plan/planConfig.d.cts +6 -6
  24. package/dist/schemas/plan/planConfig.d.cts.map +1 -1
  25. package/dist/schemas/plan/planConfig.d.mts +6 -6
  26. package/dist/schemas/plan/planConfig.d.mts.map +1 -1
  27. package/dist/schemas/plan/planConfig.mjs +1 -1
  28. package/dist/schemas/plan/planConfig.mjs.map +1 -1
  29. package/dist/services/fableFlow.d.cts +21 -22
  30. package/dist/services/fableFlow.d.cts.map +1 -1
  31. package/dist/services/fableFlow.d.mts +21 -22
  32. package/dist/services/fableFlow.d.mts.map +1 -1
  33. package/dist/services/planMode.cjs +1 -1
  34. package/dist/services/planMode.cjs.map +1 -1
  35. package/dist/services/planMode.d.cts +20 -20
  36. package/dist/services/planMode.d.cts.map +1 -1
  37. package/dist/services/planMode.d.mts +20 -20
  38. package/dist/services/planMode.d.mts.map +1 -1
  39. package/dist/services/planMode.mjs +1 -1
  40. package/dist/services/planMode.mjs.map +1 -1
  41. package/dist/services/prompts.d.cts +6 -7
  42. package/dist/services/prompts.d.cts.map +1 -1
  43. package/dist/services/prompts.d.mts +6 -7
  44. package/dist/services/prompts.d.mts.map +1 -1
  45. package/dist/types/planApi.d.cts +1 -2
  46. package/dist/types/planApi.d.cts.map +1 -1
  47. package/dist/types/planApi.d.mts +1 -2
  48. package/dist/types/planApi.d.mts.map +1 -1
  49. package/dist/types/planPointer.d.cts +1 -2
  50. package/dist/types/planPointer.d.cts.map +1 -1
  51. package/dist/types/planPointer.d.mts +1 -2
  52. package/dist/types/planPointer.d.mts.map +1 -1
  53. package/dist/types/planSettings.d.cts +2 -3
  54. package/dist/types/planSettings.d.cts.map +1 -1
  55. package/dist/types/planSettings.d.mts +2 -3
  56. package/dist/types/planSettings.d.mts.map +1 -1
  57. package/package.json +14 -13
  58. package/src/web/{planApi.ts → api/planApi.ts} +4 -3
  59. package/src/web/{PlanActivitySection.tsx → components/PlanActivitySection.tsx} +1 -1
  60. package/src/web/{PlanPanel.tsx → components/PlanPanel.tsx} +2 -2
  61. package/src/web/{PlanReviewPrompt.tsx → components/PlanReviewPrompt.tsx} +1 -1
  62. package/src/web/{PlanToolMessage.tsx → components/PlanToolMessage.tsx} +1 -1
  63. package/src/web/index.ts +5 -5
  64. package/src/web/{planSettings.ts → lib/planSettings.ts} +1 -1
  65. /package/src/web/{planToolRender.ts → lib/planToolRender.ts} +0 -0
@@ -1,2 +1,2 @@
1
- const e=require("../../_virtual/_rolldown/runtime.cjs");let t=require("node:crypto"),n=require("node:fs");n=e.__toESM(n,1);let r=require("node:os");r=e.__toESM(r,1);let i=require("node:path");i=e.__toESM(i,1);const a=[`.pi`,`agent`];function o(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}var s=class{env;homeDirectory;constructor(e={}){this.env=e.env??process.env,this.homeDirectory=e.homeDirectory??r.default.homedir()}directory(){let e=this.env.PI_CODING_AGENT_DIR||i.default.join(this.homeDirectory,...a);return i.default.join(e,`doom-plan`)}pathFor(e){return i.default.join(this.directory(),`${this.hash(e)}.json`)}read(e){let t;try{t=n.default.readFileSync(this.pathFor(e),`utf8`)}catch{return}let r;try{r=JSON.parse(t)}catch{return}if(!o(r))return;let{path:a,title:s,writtenAt:c,planId:l}=r;if(!(typeof a!=`string`||!i.default.isAbsolute(a))&&typeof s==`string`&&typeof c==`string`)return{path:a,title:s,writtenAt:c,...typeof l==`string`?{planId:l}:{}}}write(e,t){n.default.mkdirSync(this.directory(),{recursive:!0,mode:448}),n.default.writeFileSync(this.pathFor(e),JSON.stringify(t),{mode:384})}clear(e){n.default.rmSync(this.pathFor(e),{force:!0})}hash(e){return(0,t.createHash)(`sha256`).update(e).digest(`hex`).slice(0,16)}};exports.NodePlanPointerAdapter=s;
1
+ const e=require("../../_virtual/_rolldown/runtime.cjs");let t=require("node:crypto"),n=require("node:fs");n=e.__toESM(n,1);let r=require("node:os");r=e.__toESM(r,1);let i=require("node:path");i=e.__toESM(i,1);const a=[`.pi`,`agent`];function o(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}var s=class{env;homeDirectory;constructor(e={}){this.env=e.env??process.env,this.homeDirectory=e.homeDirectory??r.default.homedir()}directory(){let e=this.env.PI_CODING_AGENT_DIR||i.default.join(this.homeDirectory,...a);return i.default.join(e,`doom-plan`)}pathFor(e){return i.default.join(this.directory(),`${this.hash(e)}.json`)}read(e){let t;try{t=n.default.readFileSync(this.pathFor(e),`utf8`)}catch{return}let r;try{r=JSON.parse(t)}catch{return}if(!o(r))return;let{path:a,title:s,writtenAt:c,planId:l}=r;if(typeof a==`string`&&i.default.isAbsolute(a)&&typeof s==`string`&&typeof c==`string`)return{path:a,title:s,writtenAt:c,...typeof l==`string`?{planId:l}:{}}}write(e,t){n.default.mkdirSync(this.directory(),{recursive:!0,mode:448}),n.default.writeFileSync(this.pathFor(e),JSON.stringify(t),{mode:384})}clear(e){n.default.rmSync(this.pathFor(e),{force:!0})}hash(e){return(0,t.createHash)(`sha256`).update(e).digest(`hex`).slice(0,16)}};exports.NodePlanPointerAdapter=s;
2
2
  //# sourceMappingURL=planPointer.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"planPointer.cjs","names":["os","path","fs","createHash"],"sources":["../../../src/adapters/node/planPointer.ts"],"sourcesContent":["import { createHash } from 'node:crypto';\nimport fs from 'node:fs';\nimport os from 'node:os';\nimport path from 'node:path';\nimport type { PlanPointerRecord } from '../../types/planApi.ts';\nimport type { PlanPointerPort } from '../../types/planPointer.ts';\n\n/**\n * Record and read where write_plan left this session's plan file.\n *\n * One technology per adapter. This is where node enters the package; the\n * services that depend on the capability keep importing the port.\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 AGENT_DIRECTORY = ['.pi', 'agent'];\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 NodePlanPointerAdapter implements PlanPointerPort {\n private readonly env: NodeJS.ProcessEnv;\n private readonly homeDirectory: string;\n\n constructor(options: NodePlanPointerOptions = {}) {\n this.env = options.env ?? process.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 const agentDirectory = this.env.PI_CODING_AGENT_DIR || path.join(this.homeDirectory, ...AGENT_DIRECTORY);\n return path.join(agentDirectory, 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"],"mappings":"iNAoBA,MACM,EAAkB,CAAC,MAAO,OAAO,EASvC,SAAS,EAAS,EAAkD,CAClE,OAAO,OAAO,GAAU,YAAY,GAAkB,CAAC,MAAM,QAAQ,CAAK,CAC5E,CAEA,IAAa,EAAb,KAA+D,CAC7D,IACA,cAEA,YAAY,EAAkC,CAAC,EAAG,CAChD,KAAK,IAAM,EAAQ,KAAO,QAAQ,IAClC,KAAK,cAAgB,EAAQ,eAAiBA,EAAAA,QAAG,QAAQ,CAC3D,CAGA,WAAoB,CAClB,IAAM,EAAiB,KAAK,IAAI,qBAAuBC,EAAAA,QAAK,KAAK,KAAK,cAAe,GAAG,CAAe,EACvG,OAAOA,EAAAA,QAAK,KAAK,EAAgB,WAAiB,CACpD,CAOA,QAAQ,EAA2B,CACjC,OAAOA,EAAAA,QAAK,KAAK,KAAK,UAAU,EAAG,GAAG,KAAK,KAAK,CAAS,EAAE,MAAM,CACnE,CAEA,KAAK,EAAkD,CACrD,IAAI,EACJ,GAAI,CACF,EAAMC,EAAAA,QAAG,aAAa,KAAK,QAAQ,CAAS,EAAG,MAAM,CACvD,MAAQ,CACN,MACF,CACA,IAAI,EACJ,GAAI,CACF,EAAS,KAAK,MAAM,CAAG,CACzB,MAAQ,CACN,MACF,CACA,GAAI,CAAC,EAAS,CAAM,EAAG,OACvB,GAAM,CAAE,KAAM,EAAU,QAAO,YAAW,UAAW,EAGjD,YAAO,GAAa,UAAY,CAACD,EAAAA,QAAK,WAAW,CAAQ,IACzD,OAAO,GAAU,UAAY,OAAO,GAAc,SACtD,MAAO,CAAE,KAAM,EAAU,QAAO,YAAW,GAAI,OAAO,GAAW,SAAW,CAAE,QAAO,EAAI,CAAC,CAAG,CAC/F,CAEA,MAAM,EAAmB,EAAiC,CACxD,EAAA,QAAG,UAAU,KAAK,UAAU,EAAG,CAAE,UAAW,GAAM,KAAM,GAAuB,CAAC,EAChF,EAAA,QAAG,cAAc,KAAK,QAAQ,CAAS,EAAG,KAAK,UAAU,CAAM,EAAG,CAAE,KAAM,GAAkB,CAAC,CAC/F,CAEA,MAAM,EAAyB,CAC7B,EAAA,QAAG,OAAO,KAAK,QAAQ,CAAS,EAAG,CAAE,MAAO,EAAK,CAAC,CACpD,CAEA,KAAa,EAAuB,CAClC,OAAA,EAAOE,EAAAA,WAAAA,CAAW,QAAQ,CAAC,CAAC,OAAO,CAAK,CAAC,CAAC,OAAO,KAAK,CAAC,CAAC,MAAM,EAAG,EAAE,CACrE,CACF"}
1
+ {"version":3,"file":"planPointer.cjs","names":["os","path","fs","createHash"],"sources":["../../../src/adapters/node/planPointer.ts"],"sourcesContent":["import { createHash } from 'node:crypto';\nimport fs from 'node:fs';\nimport os from 'node:os';\nimport path from 'node:path';\nimport type { PlanPointerRecord } from '../../types/planApi.ts';\nimport type { PlanPointerPort } from '../../types/planPointer.ts';\n\n/**\n * Record and read where write_plan left this session's plan file.\n *\n * One technology per adapter. This is where node enters the package; the\n * services that depend on the capability keep importing the port.\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 AGENT_DIRECTORY = ['.pi', 'agent'];\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 NodePlanPointerAdapter implements PlanPointerPort {\n private readonly env: NodeJS.ProcessEnv;\n private readonly homeDirectory: string;\n\n constructor(options: NodePlanPointerOptions = {}) {\n this.env = options.env ?? process.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 const agentDirectory = this.env.PI_CODING_AGENT_DIR || path.join(this.homeDirectory, ...AGENT_DIRECTORY);\n return path.join(agentDirectory, 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"],"mappings":"iNAoBA,MACM,EAAkB,CAAC,MAAO,OAAO,EASvC,SAAS,EAAS,EAAkD,CAClE,OAAO,OAAO,GAAU,YAAY,GAAkB,CAAC,MAAM,QAAQ,CAAK,CAC5E,CAEA,IAAa,EAAb,KAA+D,CAC7D,IACA,cAEA,YAAY,EAAkC,CAAC,EAAG,CAChD,KAAK,IAAM,EAAQ,KAAO,QAAQ,IAClC,KAAK,cAAgB,EAAQ,eAAiBA,EAAAA,QAAG,QAAQ,CAC3D,CAGA,WAAoB,CAClB,IAAM,EAAiB,KAAK,IAAI,qBAAuBC,EAAAA,QAAK,KAAK,KAAK,cAAe,GAAG,CAAe,EACvG,OAAOA,EAAAA,QAAK,KAAK,EAAgB,WAAiB,CACpD,CAOA,QAAQ,EAA2B,CACjC,OAAOA,EAAAA,QAAK,KAAK,KAAK,UAAU,EAAG,GAAG,KAAK,KAAK,CAAS,EAAE,MAAM,CACnE,CAEA,KAAK,EAAkD,CACrD,IAAI,EACJ,GAAI,CACF,EAAMC,EAAAA,QAAG,aAAa,KAAK,QAAQ,CAAS,EAAG,MAAM,CACvD,MAAQ,CACN,MACF,CACA,IAAI,EACJ,GAAI,CACF,EAAS,KAAK,MAAM,CAAG,CACzB,MAAQ,CACN,MACF,CACA,GAAI,CAAC,EAAS,CAAM,EAAG,OACvB,GAAM,CAAE,KAAM,EAAU,QAAO,YAAW,UAAW,EAGjD,UAAO,GAAa,UAAaD,EAAAA,QAAK,WAAW,CAAQ,GACzD,OAAO,GAAU,UAAY,OAAO,GAAc,SACtD,MAAO,CAAE,KAAM,EAAU,QAAO,YAAW,GAAI,OAAO,GAAW,SAAW,CAAE,QAAO,EAAI,CAAC,CAAG,CAC/F,CAEA,MAAM,EAAmB,EAAiC,CACxD,EAAA,QAAG,UAAU,KAAK,UAAU,EAAG,CAAE,UAAW,GAAM,KAAM,GAAuB,CAAC,EAChF,EAAA,QAAG,cAAc,KAAK,QAAQ,CAAS,EAAG,KAAK,UAAU,CAAM,EAAG,CAAE,KAAM,GAAkB,CAAC,CAC/F,CAEA,MAAM,EAAyB,CAC7B,EAAA,QAAG,OAAO,KAAK,QAAQ,CAAS,EAAG,CAAE,MAAO,EAAK,CAAC,CACpD,CAEA,KAAa,EAAuB,CAClC,OAAA,EAAOE,EAAAA,WAAAA,CAAW,QAAQ,CAAC,CAAC,OAAO,CAAK,CAAC,CAAC,OAAO,KAAK,CAAC,CAAC,MAAM,EAAG,EAAE,CACrE,CACF"}
@@ -1,2 +1,2 @@
1
- import{createHash as e}from"node:crypto";import t from"node:fs";import n from"node:os";import r from"node:path";const i=[`.pi`,`agent`];function a(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}var o=class{env;homeDirectory;constructor(e={}){this.env=e.env??process.env,this.homeDirectory=e.homeDirectory??n.homedir()}directory(){let e=this.env.PI_CODING_AGENT_DIR||r.join(this.homeDirectory,...i);return r.join(e,`doom-plan`)}pathFor(e){return r.join(this.directory(),`${this.hash(e)}.json`)}read(e){let n;try{n=t.readFileSync(this.pathFor(e),`utf8`)}catch{return}let i;try{i=JSON.parse(n)}catch{return}if(!a(i))return;let{path:o,title:s,writtenAt:c,planId:l}=i;if(!(typeof o!=`string`||!r.isAbsolute(o))&&typeof s==`string`&&typeof c==`string`)return{path:o,title:s,writtenAt:c,...typeof l==`string`?{planId:l}:{}}}write(e,n){t.mkdirSync(this.directory(),{recursive:!0,mode:448}),t.writeFileSync(this.pathFor(e),JSON.stringify(n),{mode:384})}clear(e){t.rmSync(this.pathFor(e),{force:!0})}hash(t){return e(`sha256`).update(t).digest(`hex`).slice(0,16)}};export{o as NodePlanPointerAdapter};
1
+ import{createHash as e}from"node:crypto";import t from"node:fs";import n from"node:os";import r from"node:path";const i=[`.pi`,`agent`];function a(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}var o=class{env;homeDirectory;constructor(e={}){this.env=e.env??process.env,this.homeDirectory=e.homeDirectory??n.homedir()}directory(){let e=this.env.PI_CODING_AGENT_DIR||r.join(this.homeDirectory,...i);return r.join(e,`doom-plan`)}pathFor(e){return r.join(this.directory(),`${this.hash(e)}.json`)}read(e){let n;try{n=t.readFileSync(this.pathFor(e),`utf8`)}catch{return}let i;try{i=JSON.parse(n)}catch{return}if(!a(i))return;let{path:o,title:s,writtenAt:c,planId:l}=i;if(typeof o==`string`&&r.isAbsolute(o)&&typeof s==`string`&&typeof c==`string`)return{path:o,title:s,writtenAt:c,...typeof l==`string`?{planId:l}:{}}}write(e,n){t.mkdirSync(this.directory(),{recursive:!0,mode:448}),t.writeFileSync(this.pathFor(e),JSON.stringify(n),{mode:384})}clear(e){t.rmSync(this.pathFor(e),{force:!0})}hash(t){return e(`sha256`).update(t).digest(`hex`).slice(0,16)}};export{o as NodePlanPointerAdapter};
2
2
  //# sourceMappingURL=planPointer.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"planPointer.mjs","names":[],"sources":["../../../src/adapters/node/planPointer.ts"],"sourcesContent":["import { createHash } from 'node:crypto';\nimport fs from 'node:fs';\nimport os from 'node:os';\nimport path from 'node:path';\nimport type { PlanPointerRecord } from '../../types/planApi.ts';\nimport type { PlanPointerPort } from '../../types/planPointer.ts';\n\n/**\n * Record and read where write_plan left this session's plan file.\n *\n * One technology per adapter. This is where node enters the package; the\n * services that depend on the capability keep importing the port.\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 AGENT_DIRECTORY = ['.pi', 'agent'];\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 NodePlanPointerAdapter implements PlanPointerPort {\n private readonly env: NodeJS.ProcessEnv;\n private readonly homeDirectory: string;\n\n constructor(options: NodePlanPointerOptions = {}) {\n this.env = options.env ?? process.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 const agentDirectory = this.env.PI_CODING_AGENT_DIR || path.join(this.homeDirectory, ...AGENT_DIRECTORY);\n return path.join(agentDirectory, 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"],"mappings":"gHAoBA,MACM,EAAkB,CAAC,MAAO,OAAO,EASvC,SAAS,EAAS,EAAkD,CAClE,OAAO,OAAO,GAAU,YAAY,GAAkB,CAAC,MAAM,QAAQ,CAAK,CAC5E,CAEA,IAAa,EAAb,KAA+D,CAC7D,IACA,cAEA,YAAY,EAAkC,CAAC,EAAG,CAChD,KAAK,IAAM,EAAQ,KAAO,QAAQ,IAClC,KAAK,cAAgB,EAAQ,eAAiB,EAAG,QAAQ,CAC3D,CAGA,WAAoB,CAClB,IAAM,EAAiB,KAAK,IAAI,qBAAuB,EAAK,KAAK,KAAK,cAAe,GAAG,CAAe,EACvG,OAAO,EAAK,KAAK,EAAgB,WAAiB,CACpD,CAOA,QAAQ,EAA2B,CACjC,OAAO,EAAK,KAAK,KAAK,UAAU,EAAG,GAAG,KAAK,KAAK,CAAS,EAAE,MAAM,CACnE,CAEA,KAAK,EAAkD,CACrD,IAAI,EACJ,GAAI,CACF,EAAM,EAAG,aAAa,KAAK,QAAQ,CAAS,EAAG,MAAM,CACvD,MAAQ,CACN,MACF,CACA,IAAI,EACJ,GAAI,CACF,EAAS,KAAK,MAAM,CAAG,CACzB,MAAQ,CACN,MACF,CACA,GAAI,CAAC,EAAS,CAAM,EAAG,OACvB,GAAM,CAAE,KAAM,EAAU,QAAO,YAAW,UAAW,EAGjD,YAAO,GAAa,UAAY,CAAC,EAAK,WAAW,CAAQ,IACzD,OAAO,GAAU,UAAY,OAAO,GAAc,SACtD,MAAO,CAAE,KAAM,EAAU,QAAO,YAAW,GAAI,OAAO,GAAW,SAAW,CAAE,QAAO,EAAI,CAAC,CAAG,CAC/F,CAEA,MAAM,EAAmB,EAAiC,CACxD,EAAG,UAAU,KAAK,UAAU,EAAG,CAAE,UAAW,GAAM,KAAM,GAAuB,CAAC,EAChF,EAAG,cAAc,KAAK,QAAQ,CAAS,EAAG,KAAK,UAAU,CAAM,EAAG,CAAE,KAAM,GAAkB,CAAC,CAC/F,CAEA,MAAM,EAAyB,CAC7B,EAAG,OAAO,KAAK,QAAQ,CAAS,EAAG,CAAE,MAAO,EAAK,CAAC,CACpD,CAEA,KAAa,EAAuB,CAClC,OAAO,EAAW,QAAQ,CAAC,CAAC,OAAO,CAAK,CAAC,CAAC,OAAO,KAAK,CAAC,CAAC,MAAM,EAAG,EAAE,CACrE,CACF"}
1
+ {"version":3,"file":"planPointer.mjs","names":[],"sources":["../../../src/adapters/node/planPointer.ts"],"sourcesContent":["import { createHash } from 'node:crypto';\nimport fs from 'node:fs';\nimport os from 'node:os';\nimport path from 'node:path';\nimport type { PlanPointerRecord } from '../../types/planApi.ts';\nimport type { PlanPointerPort } from '../../types/planPointer.ts';\n\n/**\n * Record and read where write_plan left this session's plan file.\n *\n * One technology per adapter. This is where node enters the package; the\n * services that depend on the capability keep importing the port.\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 AGENT_DIRECTORY = ['.pi', 'agent'];\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 NodePlanPointerAdapter implements PlanPointerPort {\n private readonly env: NodeJS.ProcessEnv;\n private readonly homeDirectory: string;\n\n constructor(options: NodePlanPointerOptions = {}) {\n this.env = options.env ?? process.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 const agentDirectory = this.env.PI_CODING_AGENT_DIR || path.join(this.homeDirectory, ...AGENT_DIRECTORY);\n return path.join(agentDirectory, 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"],"mappings":"gHAoBA,MACM,EAAkB,CAAC,MAAO,OAAO,EASvC,SAAS,EAAS,EAAkD,CAClE,OAAO,OAAO,GAAU,YAAY,GAAkB,CAAC,MAAM,QAAQ,CAAK,CAC5E,CAEA,IAAa,EAAb,KAA+D,CAC7D,IACA,cAEA,YAAY,EAAkC,CAAC,EAAG,CAChD,KAAK,IAAM,EAAQ,KAAO,QAAQ,IAClC,KAAK,cAAgB,EAAQ,eAAiB,EAAG,QAAQ,CAC3D,CAGA,WAAoB,CAClB,IAAM,EAAiB,KAAK,IAAI,qBAAuB,EAAK,KAAK,KAAK,cAAe,GAAG,CAAe,EACvG,OAAO,EAAK,KAAK,EAAgB,WAAiB,CACpD,CAOA,QAAQ,EAA2B,CACjC,OAAO,EAAK,KAAK,KAAK,UAAU,EAAG,GAAG,KAAK,KAAK,CAAS,EAAE,MAAM,CACnE,CAEA,KAAK,EAAkD,CACrD,IAAI,EACJ,GAAI,CACF,EAAM,EAAG,aAAa,KAAK,QAAQ,CAAS,EAAG,MAAM,CACvD,MAAQ,CACN,MACF,CACA,IAAI,EACJ,GAAI,CACF,EAAS,KAAK,MAAM,CAAG,CACzB,MAAQ,CACN,MACF,CACA,GAAI,CAAC,EAAS,CAAM,EAAG,OACvB,GAAM,CAAE,KAAM,EAAU,QAAO,YAAW,UAAW,EAGjD,UAAO,GAAa,UAAa,EAAK,WAAW,CAAQ,GACzD,OAAO,GAAU,UAAY,OAAO,GAAc,SACtD,MAAO,CAAE,KAAM,EAAU,QAAO,YAAW,GAAI,OAAO,GAAW,SAAW,CAAE,QAAO,EAAI,CAAC,CAAG,CAC/F,CAEA,MAAM,EAAmB,EAAiC,CACxD,EAAG,UAAU,KAAK,UAAU,EAAG,CAAE,UAAW,GAAM,KAAM,GAAuB,CAAC,EAChF,EAAG,cAAc,KAAK,QAAQ,CAAS,EAAG,KAAK,UAAU,CAAM,EAAG,CAAE,KAAM,GAAkB,CAAC,CAC/F,CAEA,MAAM,EAAyB,CAC7B,EAAG,OAAO,KAAK,QAAQ,CAAS,EAAG,CAAE,MAAO,EAAK,CAAC,CACpD,CAEA,KAAa,EAAuB,CAClC,OAAO,EAAW,QAAQ,CAAC,CAAC,OAAO,CAAK,CAAC,CAAC,OAAO,KAAK,CAAC,CAAC,MAAM,EAAG,EAAE,CACrE,CACF"}
@@ -2,7 +2,7 @@ import { Context } from "@deepseek-ai/cordis";
2
2
  import { ExtensionAPI } from "@earendil-works/pi-coding-agent";
3
3
  //#region src/adapters/pi/extension.d.ts
4
4
  /** The package's single standard Pi factory, including all optional typed Doom integrations. */
5
- declare function activatePlanExtension(pi: ExtensionAPI): Promise<void>;
5
+ export declare function activatePlanExtension(pi: ExtensionAPI): Promise<void>;
6
6
  //#endregion
7
- export { activatePlanExtension, activatePlanExtension as default };
7
+ export { activatePlanExtension as default };
8
8
  //# sourceMappingURL=extension.d.cts.map
@@ -1 +1 @@
1
- {"version":3,"file":"extension.d.cts","names":[],"sources":["../../../src/adapters/pi/extension.ts"],"mappings":";;;;iBAcsB,sBAAsB,IAAI,eAAe"}
1
+ {"version":3,"file":"extension.d.cts","names":[],"sources":["../../../src/adapters/pi/extension.ts"],"mappings":";;;;wBAcsB,sBAAsB,IAAI,eAAe"}
@@ -2,7 +2,7 @@ import { Context } from "@deepseek-ai/cordis";
2
2
  import { ExtensionAPI } from "@earendil-works/pi-coding-agent";
3
3
  //#region src/adapters/pi/extension.d.ts
4
4
  /** The package's single standard Pi factory, including all optional typed Doom integrations. */
5
- declare function activatePlanExtension(pi: ExtensionAPI): Promise<void>;
5
+ export declare function activatePlanExtension(pi: ExtensionAPI): Promise<void>;
6
6
  //#endregion
7
- export { activatePlanExtension, activatePlanExtension as default };
7
+ export { activatePlanExtension as default };
8
8
  //# sourceMappingURL=extension.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"extension.d.mts","names":[],"sources":["../../../src/adapters/pi/extension.ts"],"mappings":";;;;iBAcsB,sBAAsB,IAAI,eAAe"}
1
+ {"version":3,"file":"extension.d.mts","names":[],"sources":["../../../src/adapters/pi/extension.ts"],"mappings":";;;;wBAcsB,sBAAsB,IAAI,eAAe"}
@@ -2,14 +2,13 @@ import { PlanPointerPort } from "../types/planPointer.cjs";
2
2
  import { DoomApi } from "@agimon-ai/doompi-extension-contracts/package-api";
3
3
  import { Hono } from "hono";
4
4
  //#region src/adapters/planApi.d.ts
5
- interface PlanApiOptions {
5
+ export interface PlanApiOptions {
6
6
  /** The session these routes answer for; absent when the host is the hub. */
7
7
  sessionId?: string;
8
8
  pointers?: PlanPointerPort;
9
9
  }
10
- declare function createPlanApi(options?: PlanApiOptions): Hono;
10
+ export declare function createPlanApi(options?: PlanApiOptions): Hono;
11
11
  /** The named export a host imports from this package's built entry. */
12
- declare const api: DoomApi;
12
+ export declare const api: DoomApi;
13
13
  //#endregion
14
- export { PlanApiOptions, api, createPlanApi };
15
14
  //# sourceMappingURL=planApi.d.cts.map
@@ -1 +1 @@
1
- {"version":3,"file":"planApi.d.cts","names":[],"sources":["../../src/adapters/planApi.ts"],"mappings":";;;;UAwCiB;;EAEf;EACA,WAAW;;iBAwBG,cAAc,UAAS,iBAAsB;;cAmDhD,KAAK"}
1
+ {"version":3,"file":"planApi.d.cts","names":[],"sources":["../../src/adapters/planApi.ts"],"mappings":";;;;iBAwCiB;;EAEf;EACA,WAAW;;wBAwBG,cAAc,UAAS,iBAAsB;;qBAmDhD,KAAK"}
@@ -2,14 +2,13 @@ import { PlanPointerPort } from "../types/planPointer.mjs";
2
2
  import { Hono } from "hono";
3
3
  import { DoomApi } from "@agimon-ai/doompi-extension-contracts/package-api";
4
4
  //#region src/adapters/planApi.d.ts
5
- interface PlanApiOptions {
5
+ export interface PlanApiOptions {
6
6
  /** The session these routes answer for; absent when the host is the hub. */
7
7
  sessionId?: string;
8
8
  pointers?: PlanPointerPort;
9
9
  }
10
- declare function createPlanApi(options?: PlanApiOptions): Hono;
10
+ export declare function createPlanApi(options?: PlanApiOptions): Hono;
11
11
  /** The named export a host imports from this package's built entry. */
12
- declare const api: DoomApi;
12
+ export declare const api: DoomApi;
13
13
  //#endregion
14
- export { PlanApiOptions, api, createPlanApi };
15
14
  //# sourceMappingURL=planApi.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"planApi.d.mts","names":[],"sources":["../../src/adapters/planApi.ts"],"mappings":";;;;UAwCiB;;EAEf;EACA,WAAW;;iBAwBG,cAAc,UAAS,iBAAsB;;cAmDhD,KAAK"}
1
+ {"version":3,"file":"planApi.d.mts","names":[],"sources":["../../src/adapters/planApi.ts"],"mappings":";;;;iBAwCiB;;EAEf;EACA,WAAW;;wBAwBG,cAAc,UAAS,iBAAsB;;qBAmDhD,KAAK"}
@@ -1,6 +1,6 @@
1
1
  import { DoomTelemetryOptions } from "@agimon-ai/doompi-telemetry";
2
2
  //#region src/adapters/telemetry/logSinkTelemetry.d.ts
3
- declare const PLAN_EVENT: {
3
+ export declare const PLAN_EVENT: {
4
4
  readonly configLoadFailed: 'doom_plan.config_load_failed';
5
5
  readonly writePlanFailed: 'doom_plan.write_plan_failed';
6
6
  readonly writePlanTimedOut: 'doom_plan.write_plan_timed_out';
@@ -12,23 +12,22 @@ declare const PLAN_EVENT: {
12
12
  readonly planPointerFailed: 'doom_plan.plan_pointer_failed';
13
13
  readonly planReviewCompleted: 'doom_plan.plan_review_completed';
14
14
  };
15
- type PlanEventName = (typeof PLAN_EVENT)[keyof typeof PLAN_EVENT];
16
- type PlanEventAttributes = Record<string, string | number | boolean>;
17
- interface PlanTelemetryOptions {
15
+ export type PlanEventName = (typeof PLAN_EVENT)[keyof typeof PLAN_EVENT];
16
+ export type PlanEventAttributes = Record<string, string | number | boolean>;
17
+ export interface PlanTelemetryOptions {
18
18
  cwd?: string;
19
19
  workspaceRoot?: string;
20
20
  env?: NodeJS.ProcessEnv;
21
21
  telemetryFactory?: NonNullable<DoomTelemetryOptions['telemetryFactory']>;
22
22
  warn?: (message: string) => void;
23
23
  }
24
- interface PlanTelemetry {
24
+ export interface PlanTelemetry {
25
25
  recordError(event: PlanEventName, error: unknown, attributes?: PlanEventAttributes): Promise<void>;
26
26
  recordWarning(event: PlanEventName, error: unknown, attributes?: PlanEventAttributes): Promise<void>;
27
27
  recordEvent(event: PlanEventName, attributes?: PlanEventAttributes): Promise<void>;
28
28
  flush(): Promise<void>;
29
29
  shutdown(): Promise<void>;
30
30
  }
31
- declare function createPlanTelemetry(options?: PlanTelemetryOptions): PlanTelemetry;
31
+ export declare function createPlanTelemetry(options?: PlanTelemetryOptions): PlanTelemetry;
32
32
  //#endregion
33
- export { PLAN_EVENT, PlanEventAttributes, PlanEventName, PlanTelemetry, PlanTelemetryOptions, createPlanTelemetry };
34
33
  //# sourceMappingURL=logSinkTelemetry.d.cts.map
@@ -1 +1 @@
1
- {"version":3,"file":"logSinkTelemetry.d.cts","names":[],"sources":["../../../src/adapters/telemetry/logSinkTelemetry.ts"],"mappings":";;cAKa;WACX;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;;KAGU,wBAAwB,yBAAyB;KACjD,sBAAsB;UAEjB;EACf;EACA;EACA,MAAM,OAAO;EACb,mBAAmB,YAAY;EAC/B,QAAQ;;UAGO;EACf,YAAY,OAAO,eAAe,gBAAgB,aAAa,sBAAsB;EACrF,cAAc,OAAO,eAAe,gBAAgB,aAAa,sBAAsB;EACvF,YAAY,OAAO,eAAe,aAAa,sBAAsB;EACrE,SAAS;EACT,YAAY;;iBAGE,oBAAoB,UAAS,uBAA4B"}
1
+ {"version":3,"file":"logSinkTelemetry.d.cts","names":[],"sources":["../../../src/adapters/telemetry/logSinkTelemetry.ts"],"mappings":";;qBAKa;WACX;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;;YAGU,wBAAwB,yBAAyB;YACjD,sBAAsB;iBAEjB;EACf;EACA;EACA,MAAM,OAAO;EACb,mBAAmB,YAAY;EAC/B,QAAQ;;iBAGO;EACf,YAAY,OAAO,eAAe,gBAAgB,aAAa,sBAAsB;EACrF,cAAc,OAAO,eAAe,gBAAgB,aAAa,sBAAsB;EACvF,YAAY,OAAO,eAAe,aAAa,sBAAsB;EACrE,SAAS;EACT,YAAY;;wBAGE,oBAAoB,UAAS,uBAA4B"}
@@ -1,6 +1,6 @@
1
1
  import { DoomTelemetryOptions } from "@agimon-ai/doompi-telemetry";
2
2
  //#region src/adapters/telemetry/logSinkTelemetry.d.ts
3
- declare const PLAN_EVENT: {
3
+ export declare const PLAN_EVENT: {
4
4
  readonly configLoadFailed: 'doom_plan.config_load_failed';
5
5
  readonly writePlanFailed: 'doom_plan.write_plan_failed';
6
6
  readonly writePlanTimedOut: 'doom_plan.write_plan_timed_out';
@@ -12,23 +12,22 @@ declare const PLAN_EVENT: {
12
12
  readonly planPointerFailed: 'doom_plan.plan_pointer_failed';
13
13
  readonly planReviewCompleted: 'doom_plan.plan_review_completed';
14
14
  };
15
- type PlanEventName = (typeof PLAN_EVENT)[keyof typeof PLAN_EVENT];
16
- type PlanEventAttributes = Record<string, string | number | boolean>;
17
- interface PlanTelemetryOptions {
15
+ export type PlanEventName = (typeof PLAN_EVENT)[keyof typeof PLAN_EVENT];
16
+ export type PlanEventAttributes = Record<string, string | number | boolean>;
17
+ export interface PlanTelemetryOptions {
18
18
  cwd?: string;
19
19
  workspaceRoot?: string;
20
20
  env?: NodeJS.ProcessEnv;
21
21
  telemetryFactory?: NonNullable<DoomTelemetryOptions['telemetryFactory']>;
22
22
  warn?: (message: string) => void;
23
23
  }
24
- interface PlanTelemetry {
24
+ export interface PlanTelemetry {
25
25
  recordError(event: PlanEventName, error: unknown, attributes?: PlanEventAttributes): Promise<void>;
26
26
  recordWarning(event: PlanEventName, error: unknown, attributes?: PlanEventAttributes): Promise<void>;
27
27
  recordEvent(event: PlanEventName, attributes?: PlanEventAttributes): Promise<void>;
28
28
  flush(): Promise<void>;
29
29
  shutdown(): Promise<void>;
30
30
  }
31
- declare function createPlanTelemetry(options?: PlanTelemetryOptions): PlanTelemetry;
31
+ export declare function createPlanTelemetry(options?: PlanTelemetryOptions): PlanTelemetry;
32
32
  //#endregion
33
- export { PLAN_EVENT, PlanEventAttributes, PlanEventName, PlanTelemetry, PlanTelemetryOptions, createPlanTelemetry };
34
33
  //# sourceMappingURL=logSinkTelemetry.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"logSinkTelemetry.d.mts","names":[],"sources":["../../../src/adapters/telemetry/logSinkTelemetry.ts"],"mappings":";;cAKa;WACX;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;;KAGU,wBAAwB,yBAAyB;KACjD,sBAAsB;UAEjB;EACf;EACA;EACA,MAAM,OAAO;EACb,mBAAmB,YAAY;EAC/B,QAAQ;;UAGO;EACf,YAAY,OAAO,eAAe,gBAAgB,aAAa,sBAAsB;EACrF,cAAc,OAAO,eAAe,gBAAgB,aAAa,sBAAsB;EACvF,YAAY,OAAO,eAAe,aAAa,sBAAsB;EACrE,SAAS;EACT,YAAY;;iBAGE,oBAAoB,UAAS,uBAA4B"}
1
+ {"version":3,"file":"logSinkTelemetry.d.mts","names":[],"sources":["../../../src/adapters/telemetry/logSinkTelemetry.ts"],"mappings":";;qBAKa;WACX;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;;YAGU,wBAAwB,yBAAyB;YACjD,sBAAsB;iBAEjB;EACf;EACA;EACA,MAAM,OAAO;EACb,mBAAmB,YAAY;EAC/B,QAAQ;;iBAGO;EACf,YAAY,OAAO,eAAe,gBAAgB,aAAa,sBAAsB;EACrF,cAAc,OAAO,eAAe,gBAAgB,aAAa,sBAAsB;EACvF,YAAY,OAAO,eAAe,aAAa,sBAAsB;EACrE,SAAS;EACT,YAAY;;wBAGE,oBAAoB,UAAS,uBAA4B"}
@@ -1,13 +1,13 @@
1
1
  import { PlanningAgentConfig, PlanningModeConfig, PlanningThinkingLevel, getHarnessState, globalDoomConfigPath, loadHarnessState, parsePlanningModeConfig, repositoryDoomConfigPath, resolvePlanningPlansDirectory } from "@agimon-ai/doompi-config";
2
2
  //#region src/schemas/plan/config.d.ts
3
- interface DoomConfig {
3
+ export interface DoomConfig {
4
4
  modes?: {
5
5
  planning?: PlanningModeConfig;
6
6
  };
7
7
  }
8
- declare function parseDoomConfig(content: string, filePath: string): DoomConfig;
9
- declare function mergeDoomConfigs(globalConfig: DoomConfig, repositoryConfig: DoomConfig): DoomConfig;
10
- declare function loadDoomConfig(repoRoot: string, homeDirectory?: string): DoomConfig;
8
+ export declare function parseDoomConfig(content: string, filePath: string): DoomConfig;
9
+ export declare function mergeDoomConfigs(globalConfig: DoomConfig, repositoryConfig: DoomConfig): DoomConfig;
10
+ export declare function loadDoomConfig(repoRoot: string, homeDirectory?: string): DoomConfig;
11
11
  //#endregion
12
- export { DoomConfig, type PlanningAgentConfig, type PlanningModeConfig, type PlanningThinkingLevel, getHarnessState, globalDoomConfigPath, loadDoomConfig, loadHarnessState, mergeDoomConfigs, parseDoomConfig, parsePlanningModeConfig, repositoryDoomConfigPath, resolvePlanningPlansDirectory };
12
+ export { type PlanningAgentConfig, type PlanningModeConfig, type PlanningThinkingLevel, getHarnessState, globalDoomConfigPath, loadHarnessState, parsePlanningModeConfig, repositoryDoomConfigPath, resolvePlanningPlansDirectory };
13
13
  //# sourceMappingURL=config.d.cts.map
@@ -1 +1 @@
1
- {"version":3,"file":"config.d.cts","names":[],"sources":["../../../src/schemas/plan/config.ts"],"mappings":";;UAiBiB;EACf;IACE,WAAW;;;iBAeC,gBAAgB,iBAAiB,mBAAmB;iBAKpD,iBAAiB,cAAc,YAAY,kBAAkB,aAAa;iBAQ1E,eAAe,kBAAkB,yBAAyB"}
1
+ {"version":3,"file":"config.d.cts","names":[],"sources":["../../../src/schemas/plan/config.ts"],"mappings":";;iBAiBiB;EACf;IACE,WAAW;;;wBAeC,gBAAgB,iBAAiB,mBAAmB;wBAKpD,iBAAiB,cAAc,YAAY,kBAAkB,aAAa;wBAQ1E,eAAe,kBAAkB,yBAAyB"}
@@ -1,6 +1,6 @@
1
1
  import { PlanningAgentConfig, PlanningModeConfig, PlanningThinkingLevel, getHarnessState, globalDoomConfigPath as globalDoomConfigPath$1, loadHarnessState, parsePlanningModeConfig, repositoryDoomConfigPath, resolvePlanningPlansDirectory } from "@agimon-ai/doompi-config";
2
2
  //#region src/schemas/plan/config.d.ts
3
- interface DoomConfig {
3
+ export interface DoomConfig {
4
4
  modes?: {
5
5
  planning?: PlanningModeConfig;
6
6
  };
@@ -9,5 +9,5 @@ declare function parseDoomConfig$1(content: string, filePath: string): DoomConfi
9
9
  declare function mergeDoomConfigs$1(globalConfig: DoomConfig, repositoryConfig: DoomConfig): DoomConfig;
10
10
  declare function loadDoomConfig$1(repoRoot: string, homeDirectory?: string): DoomConfig;
11
11
  //#endregion
12
- export { DoomConfig, type PlanningAgentConfig, type PlanningModeConfig, type PlanningThinkingLevel, getHarnessState, globalDoomConfigPath$1 as globalDoomConfigPath, loadDoomConfig$1 as loadDoomConfig, loadHarnessState, mergeDoomConfigs$1 as mergeDoomConfigs, parseDoomConfig$1 as parseDoomConfig, parsePlanningModeConfig, repositoryDoomConfigPath, resolvePlanningPlansDirectory };
12
+ export { type PlanningAgentConfig, type PlanningModeConfig, type PlanningThinkingLevel, getHarnessState, globalDoomConfigPath$1 as globalDoomConfigPath, loadDoomConfig$1 as loadDoomConfig, loadHarnessState, mergeDoomConfigs$1 as mergeDoomConfigs, parseDoomConfig$1 as parseDoomConfig, parsePlanningModeConfig, repositoryDoomConfigPath, resolvePlanningPlansDirectory };
13
13
  //# sourceMappingURL=config.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"config.d.mts","names":[],"sources":["../../../src/schemas/plan/config.ts"],"mappings":";;UAiBiB;EACf;IACE,WAAW;;;iBAeC,kBAAgB,iBAAiB,mBAAmB;iBAKpD,mBAAiB,cAAc,YAAY,kBAAkB,aAAa;iBAQ1E,iBAAe,kBAAkB,yBAAyB"}
1
+ {"version":3,"file":"config.d.mts","names":[],"sources":["../../../src/schemas/plan/config.ts"],"mappings":";;iBAiBiB;EACf;IACE,WAAW;;;iBAeC,kBAAgB,iBAAiB,mBAAmB;iBAKpD,mBAAiB,cAAc,YAAY,kBAAkB,aAAa;iBAQ1E,iBAAe,kBAAkB,yBAAyB"}
@@ -1,2 +1,2 @@
1
- const e=require("../../types/planSettings.cjs");let t=require("@agimon-ai/doompi-extension-contracts/config");const n=`inherit`,r={"main.model":e=>e?.main?.model,"main.thinking":e=>e?.main?.thinking,"subagents.model":e=>e?.subagents?.model,"subagents.thinking":e=>e?.subagents?.thinking,plansdirectory:e=>e?.plansDirectory},i=e.PLAN_SETTING_SHAPES.map(e=>({...e,read:r[e.id]}));function a(e){return i.find(t=>t.id===e)}function o(r){return[{id:n,label:e.PLAN_SETTING_SHAPES.find(e=>e.models===!0)?.placeholder??n,detail:`Leaves the setting unset.`,action:t.CONFIG_ACTION.clear},...r.map(e=>({id:`${e.provider}/${e.id}`,label:e.id,group:e.provider,detail:e.provider,action:t.CONFIG_ACTION.set}))]}function s(e,n){if(e.options)return{kind:`enum`,choices:e.options.map(e=>({id:e,label:e,action:t.CONFIG_ACTION.set}))};if(!(!e.models||n.length===0))return{kind:`choice`,choices:o(n)}}function c(t,n,r=[]){let a=i.map(e=>{let n=e.read(t),i=s(e,r);return{id:e.id,label:e.label,kind:i?.kind??`text`,keyPath:e.keyPath.join(`.`),placeholder:e.placeholder,detail:e.detail,...n?{value:n}:{},...i?{choices:i.choices}:{}}});return[{id:e.PLAN_CONFIG_SECTION_ID,title:`planning`,order:30,detail:`plan mode`,fields:a,...n?{notice:n,noticeLevel:`error`}:{}}]}exports.PLAN_CONFIG_SECTION_ID=e.PLAN_CONFIG_SECTION_ID,exports.PLAN_SETTINGS=i,exports.planConfigSections=c,exports.planSettingByFieldId=a;
1
+ const e=require("../../types/planSettings.cjs");let t=require("@agimon-ai/doompi-extension-contracts/config");const n=`inherit`,r={"main.model":e=>e?.main?.model,"main.thinking":e=>e?.main?.thinking,"subagents.model":e=>e?.subagents?.model,"subagents.thinking":e=>e?.subagents?.thinking,plansdirectory:e=>e?.plansDirectory},i=e.PLAN_SETTING_SHAPES.map(e=>({...e,read:r[e.id]}));function a(e){return i.find(t=>t.id===e)}function o(r){return[{id:n,label:e.PLAN_SETTING_SHAPES.find(e=>e.models===!0)?.placeholder??n,detail:`Leaves the setting unset.`,action:t.CONFIG_ACTION.clear},...r.map(e=>({id:`${e.provider}/${e.id}`,label:e.id,group:e.provider,detail:e.provider,action:t.CONFIG_ACTION.set}))]}function s(e,n){if(e.options)return{kind:`enum`,choices:e.options.map(e=>({id:e,label:e,action:t.CONFIG_ACTION.set}))};if(e.models&&n.length!==0)return{kind:`choice`,choices:o(n)}}function c(t,n,r=[]){let a=i.map(e=>{let n=e.read(t),i=s(e,r);return{id:e.id,label:e.label,kind:i?.kind??`text`,keyPath:e.keyPath.join(`.`),placeholder:e.placeholder,detail:e.detail,...n?{value:n}:{},...i?{choices:i.choices}:{}}});return[{id:e.PLAN_CONFIG_SECTION_ID,title:`planning`,order:30,detail:`plan mode`,fields:a,...n?{notice:n,noticeLevel:`error`}:{}}]}exports.PLAN_CONFIG_SECTION_ID=e.PLAN_CONFIG_SECTION_ID,exports.PLAN_SETTINGS=i,exports.planConfigSections=c,exports.planSettingByFieldId=a;
2
2
  //# sourceMappingURL=planConfig.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"planConfig.cjs","names":["PLAN_SETTING_SHAPES","CONFIG_ACTION","PLAN_CONFIG_SECTION_ID"],"sources":["../../../src/schemas/plan/planConfig.ts"],"sourcesContent":["/**\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 {\n CONFIG_ACTION,\n type ConfigChoice,\n type ConfigField,\n type ConfigSection,\n} from '@agimon-ai/doompi-extension-contracts/config';\nimport type { PlanningModeConfig } from './config.ts';\nimport { PLAN_CONFIG_SECTION_ID, PLAN_SETTING_SHAPES, type PlanSettingShape } from '../../types/planSettings.ts';\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":"8GAsBA,MAEM,EAAoB,UAWpB,EAAoG,CACxG,aAAe,GAAW,GAAQ,MAAM,MACxC,gBAAkB,GAAW,GAAQ,MAAM,SAC3C,kBAAoB,GAAW,GAAQ,WAAW,MAClD,qBAAuB,GAAW,GAAQ,WAAW,SACrD,eAAiB,GAAW,GAAQ,cACtC,EAEa,EAAkDA,EAAAA,oBAAoB,IAAK,IAAW,CACjG,GAAG,EACH,KAAM,EAAQ,EAAM,GACtB,EAAE,EAEF,SAAgB,EAAqB,EAAoD,CACvF,OAAO,EAAc,KAAM,GAAY,EAAQ,KAAO,CAAO,CAC/D,CAgBA,SAAS,EAAa,EAAoD,CAOxE,MAAO,CACL,CANA,GAAI,EACJ,MAAOA,EAAAA,oBAAoB,KAAM,GAAU,EAAM,SAAW,EAAI,CAAC,EAAE,aAAe,EAClF,OAAQ,4BACR,OAAQC,EAAAA,cAAc,KAGhB,EACN,GAAG,EAAO,IAAK,IAAyB,CACtC,GAAI,GAAG,EAAM,SAAS,GAAG,EAAM,KAC/B,MAAO,EAAM,GACb,MAAO,EAAM,SACb,OAAQ,EAAM,SACd,OAAQA,EAAAA,cAAc,GACxB,EAAE,CACJ,CACF,CAEA,SAAS,EACP,EACA,EACkE,CAGlE,GAAI,EAAQ,QACV,MAAO,CACL,KAAM,OACN,QAAS,EAAQ,QAAQ,IAAK,IAAY,CAAE,GAAI,EAAQ,MAAO,EAAQ,OAAQA,EAAAA,cAAc,GAAI,EAAE,CACrG,EAIE,MAAC,EAAQ,QAAU,EAAO,SAAW,GACzC,MAAO,CAAE,KAAM,SAAU,QAAS,EAAa,CAAM,CAAE,CACzD,CAEA,SAAgB,EACd,EACA,EACA,EAAqC,CAAC,EACZ,CAC1B,IAAM,EAAwB,EAAc,IAAK,GAAY,CAC3D,IAAM,EAAQ,EAAQ,KAAK,CAAM,EAC3B,EAAU,EAAW,EAAS,CAAM,EAC1C,MAAO,CACL,GAAI,EAAQ,GACZ,MAAO,EAAQ,MACf,KAAM,GAAS,MAAS,OACxB,QAAS,EAAQ,QAAQ,KAAK,GAAG,EACjC,YAAa,EAAQ,YACrB,OAAQ,EAAQ,OAChB,GAAI,EAAQ,CAAE,OAAM,EAAI,CAAC,EACzB,GAAI,EAAU,CAAE,QAAS,EAAQ,OAAQ,EAAI,CAAC,CAChD,CACF,CAAC,EACD,MAAO,CACL,CACE,GAAIC,EAAAA,uBACJ,MAAO,WACP,MAAO,GACP,OAAQ,YACR,SACA,GAAI,EAAS,CAAE,SAAQ,YAAa,OAAiB,EAAI,CAAC,CAC5D,CACF,CACF"}
1
+ {"version":3,"file":"planConfig.cjs","names":["PLAN_SETTING_SHAPES","CONFIG_ACTION","PLAN_CONFIG_SECTION_ID"],"sources":["../../../src/schemas/plan/planConfig.ts"],"sourcesContent":["/**\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 {\n CONFIG_ACTION,\n type ConfigChoice,\n type ConfigField,\n type ConfigSection,\n} from '@agimon-ai/doompi-extension-contracts/config';\nimport type { PlanningModeConfig } from './config.ts';\nimport { PLAN_CONFIG_SECTION_ID, PLAN_SETTING_SHAPES, type PlanSettingShape } from '../../types/planSettings.ts';\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":"8GAsBA,MAEM,EAAoB,UAWpB,EAAoG,CACxG,aAAe,GAAW,GAAQ,MAAM,MACxC,gBAAkB,GAAW,GAAQ,MAAM,SAC3C,kBAAoB,GAAW,GAAQ,WAAW,MAClD,qBAAuB,GAAW,GAAQ,WAAW,SACrD,eAAiB,GAAW,GAAQ,cACtC,EAEa,EAAkDA,EAAAA,oBAAoB,IAAK,IAAW,CACjG,GAAG,EACH,KAAM,EAAQ,EAAM,GACtB,EAAE,EAEF,SAAgB,EAAqB,EAAoD,CACvF,OAAO,EAAc,KAAM,GAAY,EAAQ,KAAO,CAAO,CAC/D,CAgBA,SAAS,EAAa,EAAoD,CAOxE,MAAO,CACL,CANA,GAAI,EACJ,MAAOA,EAAAA,oBAAoB,KAAM,GAAU,EAAM,SAAW,EAAI,CAAC,EAAE,aAAe,EAClF,OAAQ,4BACR,OAAQC,EAAAA,cAAc,KAGhB,EACN,GAAG,EAAO,IAAK,IAAyB,CACtC,GAAI,GAAG,EAAM,SAAS,GAAG,EAAM,KAC/B,MAAO,EAAM,GACb,MAAO,EAAM,SACb,OAAQ,EAAM,SACd,OAAQA,EAAAA,cAAc,GACxB,EAAE,CACJ,CACF,CAEA,SAAS,EACP,EACA,EACkE,CAGlE,GAAI,EAAQ,QACV,MAAO,CACL,KAAM,OACN,QAAS,EAAQ,QAAQ,IAAK,IAAY,CAAE,GAAI,EAAQ,MAAO,EAAQ,OAAQA,EAAAA,cAAc,GAAI,EAAE,CACrG,EAIE,GAAC,EAAQ,QAAU,EAAO,SAAW,EACzC,MAAO,CAAE,KAAM,SAAU,QAAS,EAAa,CAAM,CAAE,CACzD,CAEA,SAAgB,EACd,EACA,EACA,EAAqC,CAAC,EACZ,CAC1B,IAAM,EAAwB,EAAc,IAAK,GAAY,CAC3D,IAAM,EAAQ,EAAQ,KAAK,CAAM,EAC3B,EAAU,EAAW,EAAS,CAAM,EAC1C,MAAO,CACL,GAAI,EAAQ,GACZ,MAAO,EAAQ,MACf,KAAM,GAAS,MAAS,OACxB,QAAS,EAAQ,QAAQ,KAAK,GAAG,EACjC,YAAa,EAAQ,YACrB,OAAQ,EAAQ,OAChB,GAAI,EAAQ,CAAE,OAAM,EAAI,CAAC,EACzB,GAAI,EAAU,CAAE,QAAS,EAAQ,OAAQ,EAAI,CAAC,CAChD,CACF,CAAC,EACD,MAAO,CACL,CACE,GAAIC,EAAAA,uBACJ,MAAO,WACP,MAAO,GACP,OAAQ,YACR,SACA,GAAI,EAAS,CAAE,SAAQ,YAAa,OAAiB,EAAI,CAAC,CAC5D,CACF,CACF"}
@@ -7,17 +7,17 @@ import { ConfigSection } from "@agimon-ai/doompi-extension-contracts/config";
7
7
  * to read the value out of a loaded config. The reader stays here because it
8
8
  * touches the parsed config types, which the browser half never sees.
9
9
  */
10
- interface PlanSettingDescriptor extends PlanSettingShape {
10
+ export interface PlanSettingDescriptor extends PlanSettingShape {
11
11
  readonly read: (config: PlanningModeConfig | undefined) => string | undefined;
12
12
  }
13
- declare const PLAN_SETTINGS: readonly PlanSettingDescriptor[];
14
- declare function planSettingByFieldId(fieldId: string): PlanSettingDescriptor | undefined;
13
+ export declare const PLAN_SETTINGS: readonly PlanSettingDescriptor[];
14
+ export declare function planSettingByFieldId(fieldId: string): PlanSettingDescriptor | undefined;
15
15
  /** A model this session could actually switch to, as the panel offers it. */
16
- interface PlanModelChoice {
16
+ export interface PlanModelChoice {
17
17
  readonly provider: string;
18
18
  readonly id: string;
19
19
  }
20
- declare function planConfigSections(config: PlanningModeConfig | undefined, notice?: string, models?: readonly PlanModelChoice[]): readonly ConfigSection[];
20
+ export declare function planConfigSections(config: PlanningModeConfig | undefined, notice?: string, models?: readonly PlanModelChoice[]): readonly ConfigSection[];
21
21
  //#endregion
22
- export { PLAN_CONFIG_SECTION_ID, PLAN_SETTINGS, PlanModelChoice, PlanSettingDescriptor, planConfigSections, planSettingByFieldId };
22
+ export { PLAN_CONFIG_SECTION_ID };
23
23
  //# sourceMappingURL=planConfig.d.cts.map
@@ -1 +1 @@
1
- {"version":3,"file":"planConfig.d.cts","names":[],"sources":["../../../src/schemas/plan/planConfig.ts"],"mappings":";;;;;;;;;UA+BiB,8BAA8B;WACpC,OAAO,QAAQ;;cAWb,wBAAwB;iBAKrB,qBAAqB,kBAAkB;;UAKtC;WACN;WACA;;iBAgDK,mBACd,QAAQ,gCACR,iBACA,kBAAiB,6BACP"}
1
+ {"version":3,"file":"planConfig.d.cts","names":[],"sources":["../../../src/schemas/plan/planConfig.ts"],"mappings":";;;;;;;;;iBA+BiB,8BAA8B;WACpC,OAAO,QAAQ;;qBAWb,wBAAwB;wBAKrB,qBAAqB,kBAAkB;;iBAKtC;WACN;WACA;;wBAgDK,mBACd,QAAQ,gCACR,iBACA,kBAAiB,6BACP"}
@@ -7,17 +7,17 @@ import { ConfigSection } from "@agimon-ai/doompi-extension-contracts/config";
7
7
  * to read the value out of a loaded config. The reader stays here because it
8
8
  * touches the parsed config types, which the browser half never sees.
9
9
  */
10
- interface PlanSettingDescriptor extends PlanSettingShape {
10
+ export interface PlanSettingDescriptor extends PlanSettingShape {
11
11
  readonly read: (config: PlanningModeConfig | undefined) => string | undefined;
12
12
  }
13
- declare const PLAN_SETTINGS: readonly PlanSettingDescriptor[];
14
- declare function planSettingByFieldId(fieldId: string): PlanSettingDescriptor | undefined;
13
+ export declare const PLAN_SETTINGS: readonly PlanSettingDescriptor[];
14
+ export declare function planSettingByFieldId(fieldId: string): PlanSettingDescriptor | undefined;
15
15
  /** A model this session could actually switch to, as the panel offers it. */
16
- interface PlanModelChoice {
16
+ export interface PlanModelChoice {
17
17
  readonly provider: string;
18
18
  readonly id: string;
19
19
  }
20
- declare function planConfigSections(config: PlanningModeConfig | undefined, notice?: string, models?: readonly PlanModelChoice[]): readonly ConfigSection[];
20
+ export declare function planConfigSections(config: PlanningModeConfig | undefined, notice?: string, models?: readonly PlanModelChoice[]): readonly ConfigSection[];
21
21
  //#endregion
22
- export { PLAN_CONFIG_SECTION_ID, PLAN_SETTINGS, PlanModelChoice, PlanSettingDescriptor, planConfigSections, planSettingByFieldId };
22
+ export { PLAN_CONFIG_SECTION_ID };
23
23
  //# sourceMappingURL=planConfig.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"planConfig.d.mts","names":[],"sources":["../../../src/schemas/plan/planConfig.ts"],"mappings":";;;;;;;;;UA+BiB,8BAA8B;WACpC,OAAO,QAAQ;;cAWb,wBAAwB;iBAKrB,qBAAqB,kBAAkB;;UAKtC;WACN;WACA;;iBAgDK,mBACd,QAAQ,gCACR,iBACA,kBAAiB,6BACP"}
1
+ {"version":3,"file":"planConfig.d.mts","names":[],"sources":["../../../src/schemas/plan/planConfig.ts"],"mappings":";;;;;;;;;iBA+BiB,8BAA8B;WACpC,OAAO,QAAQ;;qBAWb,wBAAwB;wBAKrB,qBAAqB,kBAAkB;;iBAKtC;WACN;WACA;;wBAgDK,mBACd,QAAQ,gCACR,iBACA,kBAAiB,6BACP"}
@@ -1,2 +1,2 @@
1
- import{PLAN_CONFIG_SECTION_ID as e,PLAN_SETTING_SHAPES as t}from"../../types/planSettings.mjs";import{CONFIG_ACTION as n}from"@agimon-ai/doompi-extension-contracts/config";const r=`inherit`,i={"main.model":e=>e?.main?.model,"main.thinking":e=>e?.main?.thinking,"subagents.model":e=>e?.subagents?.model,"subagents.thinking":e=>e?.subagents?.thinking,plansdirectory:e=>e?.plansDirectory},a=t.map(e=>({...e,read:i[e.id]}));function o(e){return a.find(t=>t.id===e)}function s(e){return[{id:r,label:t.find(e=>e.models===!0)?.placeholder??r,detail:`Leaves the setting unset.`,action:n.clear},...e.map(e=>({id:`${e.provider}/${e.id}`,label:e.id,group:e.provider,detail:e.provider,action:n.set}))]}function c(e,t){if(e.options)return{kind:`enum`,choices:e.options.map(e=>({id:e,label:e,action:n.set}))};if(!(!e.models||t.length===0))return{kind:`choice`,choices:s(t)}}function l(t,n,r=[]){let i=a.map(e=>{let n=e.read(t),i=c(e,r);return{id:e.id,label:e.label,kind:i?.kind??`text`,keyPath:e.keyPath.join(`.`),placeholder:e.placeholder,detail:e.detail,...n?{value:n}:{},...i?{choices:i.choices}:{}}});return[{id:e,title:`planning`,order:30,detail:`plan mode`,fields:i,...n?{notice:n,noticeLevel:`error`}:{}}]}export{e as PLAN_CONFIG_SECTION_ID,a as PLAN_SETTINGS,l as planConfigSections,o as planSettingByFieldId};
1
+ import{PLAN_CONFIG_SECTION_ID as e,PLAN_SETTING_SHAPES as t}from"../../types/planSettings.mjs";import{CONFIG_ACTION as n}from"@agimon-ai/doompi-extension-contracts/config";const r=`inherit`,i={"main.model":e=>e?.main?.model,"main.thinking":e=>e?.main?.thinking,"subagents.model":e=>e?.subagents?.model,"subagents.thinking":e=>e?.subagents?.thinking,plansdirectory:e=>e?.plansDirectory},a=t.map(e=>({...e,read:i[e.id]}));function o(e){return a.find(t=>t.id===e)}function s(e){return[{id:r,label:t.find(e=>e.models===!0)?.placeholder??r,detail:`Leaves the setting unset.`,action:n.clear},...e.map(e=>({id:`${e.provider}/${e.id}`,label:e.id,group:e.provider,detail:e.provider,action:n.set}))]}function c(e,t){if(e.options)return{kind:`enum`,choices:e.options.map(e=>({id:e,label:e,action:n.set}))};if(e.models&&t.length!==0)return{kind:`choice`,choices:s(t)}}function l(t,n,r=[]){let i=a.map(e=>{let n=e.read(t),i=c(e,r);return{id:e.id,label:e.label,kind:i?.kind??`text`,keyPath:e.keyPath.join(`.`),placeholder:e.placeholder,detail:e.detail,...n?{value:n}:{},...i?{choices:i.choices}:{}}});return[{id:e,title:`planning`,order:30,detail:`plan mode`,fields:i,...n?{notice:n,noticeLevel:`error`}:{}}]}export{e as PLAN_CONFIG_SECTION_ID,a as PLAN_SETTINGS,l as planConfigSections,o as planSettingByFieldId};
2
2
  //# sourceMappingURL=planConfig.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"planConfig.mjs","names":[],"sources":["../../../src/schemas/plan/planConfig.ts"],"sourcesContent":["/**\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 {\n CONFIG_ACTION,\n type ConfigChoice,\n type ConfigField,\n type ConfigSection,\n} from '@agimon-ai/doompi-extension-contracts/config';\nimport type { PlanningModeConfig } from './config.ts';\nimport { PLAN_CONFIG_SECTION_ID, PLAN_SETTING_SHAPES, type PlanSettingShape } from '../../types/planSettings.ts';\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":"4KAsBA,MAEM,EAAoB,UAWpB,EAAoG,CACxG,aAAe,GAAW,GAAQ,MAAM,MACxC,gBAAkB,GAAW,GAAQ,MAAM,SAC3C,kBAAoB,GAAW,GAAQ,WAAW,MAClD,qBAAuB,GAAW,GAAQ,WAAW,SACrD,eAAiB,GAAW,GAAQ,cACtC,EAEa,EAAkD,EAAoB,IAAK,IAAW,CACjG,GAAG,EACH,KAAM,EAAQ,EAAM,GACtB,EAAE,EAEF,SAAgB,EAAqB,EAAoD,CACvF,OAAO,EAAc,KAAM,GAAY,EAAQ,KAAO,CAAO,CAC/D,CAgBA,SAAS,EAAa,EAAoD,CAOxE,MAAO,CACL,CANA,GAAI,EACJ,MAAO,EAAoB,KAAM,GAAU,EAAM,SAAW,EAAI,CAAC,EAAE,aAAe,EAClF,OAAQ,4BACR,OAAQ,EAAc,KAGhB,EACN,GAAG,EAAO,IAAK,IAAyB,CACtC,GAAI,GAAG,EAAM,SAAS,GAAG,EAAM,KAC/B,MAAO,EAAM,GACb,MAAO,EAAM,SACb,OAAQ,EAAM,SACd,OAAQ,EAAc,GACxB,EAAE,CACJ,CACF,CAEA,SAAS,EACP,EACA,EACkE,CAGlE,GAAI,EAAQ,QACV,MAAO,CACL,KAAM,OACN,QAAS,EAAQ,QAAQ,IAAK,IAAY,CAAE,GAAI,EAAQ,MAAO,EAAQ,OAAQ,EAAc,GAAI,EAAE,CACrG,EAIE,MAAC,EAAQ,QAAU,EAAO,SAAW,GACzC,MAAO,CAAE,KAAM,SAAU,QAAS,EAAa,CAAM,CAAE,CACzD,CAEA,SAAgB,EACd,EACA,EACA,EAAqC,CAAC,EACZ,CAC1B,IAAM,EAAwB,EAAc,IAAK,GAAY,CAC3D,IAAM,EAAQ,EAAQ,KAAK,CAAM,EAC3B,EAAU,EAAW,EAAS,CAAM,EAC1C,MAAO,CACL,GAAI,EAAQ,GACZ,MAAO,EAAQ,MACf,KAAM,GAAS,MAAS,OACxB,QAAS,EAAQ,QAAQ,KAAK,GAAG,EACjC,YAAa,EAAQ,YACrB,OAAQ,EAAQ,OAChB,GAAI,EAAQ,CAAE,OAAM,EAAI,CAAC,EACzB,GAAI,EAAU,CAAE,QAAS,EAAQ,OAAQ,EAAI,CAAC,CAChD,CACF,CAAC,EACD,MAAO,CACL,CACE,GAAI,EACJ,MAAO,WACP,MAAO,GACP,OAAQ,YACR,SACA,GAAI,EAAS,CAAE,SAAQ,YAAa,OAAiB,EAAI,CAAC,CAC5D,CACF,CACF"}
1
+ {"version":3,"file":"planConfig.mjs","names":[],"sources":["../../../src/schemas/plan/planConfig.ts"],"sourcesContent":["/**\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 {\n CONFIG_ACTION,\n type ConfigChoice,\n type ConfigField,\n type ConfigSection,\n} from '@agimon-ai/doompi-extension-contracts/config';\nimport type { PlanningModeConfig } from './config.ts';\nimport { PLAN_CONFIG_SECTION_ID, PLAN_SETTING_SHAPES, type PlanSettingShape } from '../../types/planSettings.ts';\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":"4KAsBA,MAEM,EAAoB,UAWpB,EAAoG,CACxG,aAAe,GAAW,GAAQ,MAAM,MACxC,gBAAkB,GAAW,GAAQ,MAAM,SAC3C,kBAAoB,GAAW,GAAQ,WAAW,MAClD,qBAAuB,GAAW,GAAQ,WAAW,SACrD,eAAiB,GAAW,GAAQ,cACtC,EAEa,EAAkD,EAAoB,IAAK,IAAW,CACjG,GAAG,EACH,KAAM,EAAQ,EAAM,GACtB,EAAE,EAEF,SAAgB,EAAqB,EAAoD,CACvF,OAAO,EAAc,KAAM,GAAY,EAAQ,KAAO,CAAO,CAC/D,CAgBA,SAAS,EAAa,EAAoD,CAOxE,MAAO,CACL,CANA,GAAI,EACJ,MAAO,EAAoB,KAAM,GAAU,EAAM,SAAW,EAAI,CAAC,EAAE,aAAe,EAClF,OAAQ,4BACR,OAAQ,EAAc,KAGhB,EACN,GAAG,EAAO,IAAK,IAAyB,CACtC,GAAI,GAAG,EAAM,SAAS,GAAG,EAAM,KAC/B,MAAO,EAAM,GACb,MAAO,EAAM,SACb,OAAQ,EAAM,SACd,OAAQ,EAAc,GACxB,EAAE,CACJ,CACF,CAEA,SAAS,EACP,EACA,EACkE,CAGlE,GAAI,EAAQ,QACV,MAAO,CACL,KAAM,OACN,QAAS,EAAQ,QAAQ,IAAK,IAAY,CAAE,GAAI,EAAQ,MAAO,EAAQ,OAAQ,EAAc,GAAI,EAAE,CACrG,EAIE,GAAC,EAAQ,QAAU,EAAO,SAAW,EACzC,MAAO,CAAE,KAAM,SAAU,QAAS,EAAa,CAAM,CAAE,CACzD,CAEA,SAAgB,EACd,EACA,EACA,EAAqC,CAAC,EACZ,CAC1B,IAAM,EAAwB,EAAc,IAAK,GAAY,CAC3D,IAAM,EAAQ,EAAQ,KAAK,CAAM,EAC3B,EAAU,EAAW,EAAS,CAAM,EAC1C,MAAO,CACL,GAAI,EAAQ,GACZ,MAAO,EAAQ,MACf,KAAM,GAAS,MAAS,OACxB,QAAS,EAAQ,QAAQ,KAAK,GAAG,EACjC,YAAa,EAAQ,YACrB,OAAQ,EAAQ,OAChB,GAAI,EAAQ,CAAE,OAAM,EAAI,CAAC,EACzB,GAAI,EAAU,CAAE,QAAS,EAAQ,OAAQ,EAAI,CAAC,CAChD,CACF,CAAC,EACD,MAAO,CACL,CACE,GAAI,EACJ,MAAO,WACP,MAAO,GACP,OAAQ,YACR,SACA,GAAI,EAAS,CAAE,SAAQ,YAAa,OAAiB,EAAI,CAAC,CAC5D,CACF,CACF"}
@@ -1,17 +1,17 @@
1
1
  //#region src/services/fableFlow.d.ts
2
- declare const FABLE_PROVIDER_SOURCE = "@agimon-ai/doompi-team";
3
- declare const FABLE_PLAN_REQUESTER = "@agimon-ai/doompi-plan";
4
- declare const FABLE_PLAN_RUNTIME = "claude";
5
- declare const FABLE_PLAN_MODEL = "fable";
6
- declare const FABLE_PLAN_PROFILE = "claude/fable-plan-v1";
7
- declare const MAX_FABLE_PACKET_BYTES: number;
8
- declare const MAX_FABLE_TEXT_BYTES: number;
9
- declare const MAX_FABLE_ARRAY_ITEMS = 24;
10
- interface FablePlanFinding {
2
+ export declare const FABLE_PROVIDER_SOURCE = "@agimon-ai/doompi-team";
3
+ export declare const FABLE_PLAN_REQUESTER = "@agimon-ai/doompi-plan";
4
+ export declare const FABLE_PLAN_RUNTIME = "claude";
5
+ export declare const FABLE_PLAN_MODEL = "fable";
6
+ export declare const FABLE_PLAN_PROFILE = "claude/fable-plan-v1";
7
+ export declare const MAX_FABLE_PACKET_BYTES: number;
8
+ export declare const MAX_FABLE_TEXT_BYTES: number;
9
+ export declare const MAX_FABLE_ARRAY_ITEMS = 24;
10
+ export interface FablePlanFinding {
11
11
  path: string;
12
12
  finding: string;
13
13
  }
14
- interface FablePlanPacket {
14
+ export interface FablePlanPacket {
15
15
  goal: string[];
16
16
  constraints: string[];
17
17
  decisions: string[];
@@ -20,9 +20,9 @@ interface FablePlanPacket {
20
20
  unresolvedQuestions: string[];
21
21
  currentPlan?: string;
22
22
  }
23
- type FablePlanStatus = 'completed' | 'failed' | 'timed_out' | 'cancelled' | 'interrupted';
24
- type FablePlanStage = 'draft' | 'review' | 'completed' | 'failed' | 'cancelled' | 'interrupted';
25
- interface FablePlanResult {
23
+ export type FablePlanStatus = 'completed' | 'failed' | 'timed_out' | 'cancelled' | 'interrupted';
24
+ export type FablePlanStage = 'draft' | 'review' | 'completed' | 'failed' | 'cancelled' | 'interrupted';
25
+ export interface FablePlanResult {
26
26
  operationId: string;
27
27
  status: FablePlanStatus;
28
28
  stage: FablePlanStage;
@@ -33,7 +33,7 @@ interface FablePlanResult {
33
33
  durationMs: number;
34
34
  errorCode?: string;
35
35
  }
36
- interface FablePlanRequest {
36
+ export interface FablePlanRequest {
37
37
  requester: typeof FABLE_PLAN_REQUESTER;
38
38
  operationId: string;
39
39
  runtime: typeof FABLE_PLAN_RUNTIME;
@@ -41,11 +41,11 @@ interface FablePlanRequest {
41
41
  profile: typeof FABLE_PLAN_PROFILE;
42
42
  packet: FablePlanPacket;
43
43
  }
44
- interface FablePlanBroker {
44
+ export interface FablePlanBroker {
45
45
  start(request: FablePlanRequest, signal: AbortSignal): Promise<FablePlanResult>;
46
46
  cancel(operationId: string, reason: string): void;
47
47
  }
48
- interface FableFlowOptions {
48
+ export interface FableFlowOptions {
49
49
  broker?: FablePlanBroker;
50
50
  isAuthorized: () => boolean;
51
51
  /** Supplies operation ids. Injected so a test can pin them. */
@@ -54,15 +54,14 @@ interface FableFlowOptions {
54
54
  onStage?: (stage: FableStage) => void;
55
55
  onError?: (error: unknown) => void;
56
56
  }
57
- type FableStage = 'idle' | 'draft' | 'review' | 'completed' | 'failed' | 'cancelled' | 'interrupted';
58
- interface FablePlanFlow {
57
+ export type FableStage = 'idle' | 'draft' | 'review' | 'completed' | 'failed' | 'cancelled' | 'interrupted';
58
+ export interface FablePlanFlow {
59
59
  run(value: unknown, signal?: AbortSignal): Promise<FablePlanResult>;
60
60
  cancel(reason?: string): void;
61
61
  isActive(): boolean;
62
62
  }
63
- declare function containsSuspectedCredential(value: string): boolean;
64
- declare function sanitizeFablePacket(value: unknown): FablePlanPacket;
65
- declare function createFablePlanFlow(options: FableFlowOptions): FablePlanFlow;
63
+ export declare function containsSuspectedCredential(value: string): boolean;
64
+ export declare function sanitizeFablePacket(value: unknown): FablePlanPacket;
65
+ export declare function createFablePlanFlow(options: FableFlowOptions): FablePlanFlow;
66
66
  //#endregion
67
- export { FABLE_PLAN_MODEL, FABLE_PLAN_PROFILE, FABLE_PLAN_REQUESTER, FABLE_PLAN_RUNTIME, FABLE_PROVIDER_SOURCE, FableFlowOptions, FablePlanBroker, FablePlanFinding, FablePlanFlow, FablePlanPacket, FablePlanRequest, FablePlanResult, FablePlanStage, FablePlanStatus, FableStage, MAX_FABLE_ARRAY_ITEMS, MAX_FABLE_PACKET_BYTES, MAX_FABLE_TEXT_BYTES, containsSuspectedCredential, createFablePlanFlow, sanitizeFablePacket };
68
67
  //# sourceMappingURL=fableFlow.d.cts.map
@@ -1 +1 @@
1
- {"version":3,"file":"fableFlow.d.cts","names":[],"sources":["../../src/services/fableFlow.ts"],"mappings":";cAEa;cACA;cACA;cACA;cACA;cACA;cACA;cACA;UAYI;EACf;EACA;;UAGe;EACf;EACA;EACA;EACA,kBAAkB;EAClB;EACA;EACA;;KAGU;KACA;UAEK;EACf;EACA,QAAQ;EACR,OAAO;EACP;EACA;EACA;EACA;EACA;EACA;;UAGe;EACf,kBAAkB;EAClB;EACA,gBAAgB;EAChB,cAAc;EACd,gBAAgB;EAChB,QAAQ;;UAGO;EACf,MAAM,SAAS,kBAAkB,QAAQ,cAAc,QAAQ;EAC/D,OAAO,qBAAqB;;UAGb;EACf,SAAS;EACT;;EAEA;EACA;EACA,WAAW,OAAO;EAClB,WAAW;;KAGD;UAEK;EACf,IAAI,gBAAgB,SAAS,cAAc,QAAQ;EACnD,OAAO;EACP;;iBAec,4BAA4B;iBAuD5B,oBAAoB,iBAAiB;iBA8CrC,oBAAoB,SAAS,mBAAmB"}
1
+ {"version":3,"file":"fableFlow.d.cts","names":[],"sources":["../../src/services/fableFlow.ts"],"mappings":";qBAEa;qBACA;qBACA;qBACA;qBACA;qBACA;qBACA;qBACA;iBAYI;EACf;EACA;;iBAGe;EACf;EACA;EACA;EACA,kBAAkB;EAClB;EACA;EACA;;YAGU;YACA;iBAEK;EACf;EACA,QAAQ;EACR,OAAO;EACP;EACA;EACA;EACA;EACA;EACA;;iBAGe;EACf,kBAAkB;EAClB;EACA,gBAAgB;EAChB,cAAc;EACd,gBAAgB;EAChB,QAAQ;;iBAGO;EACf,MAAM,SAAS,kBAAkB,QAAQ,cAAc,QAAQ;EAC/D,OAAO,qBAAqB;;iBAGb;EACf,SAAS;EACT;;EAEA;EACA;EACA,WAAW,OAAO;EAClB,WAAW;;YAGD;iBAEK;EACf,IAAI,gBAAgB,SAAS,cAAc,QAAQ;EACnD,OAAO;EACP;;wBAec,4BAA4B;wBAuD5B,oBAAoB,iBAAiB;wBA8CrC,oBAAoB,SAAS,mBAAmB"}