@corenel/harness 0.19.0 → 0.21.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.
Files changed (163) hide show
  1. package/dist/chat/engine.d.ts +47 -0
  2. package/dist/chat/engine.d.ts.map +1 -0
  3. package/dist/chat/engine.js +803 -0
  4. package/dist/chat/engine.js.map +1 -0
  5. package/dist/chat/events.d.ts +5 -0
  6. package/dist/chat/events.d.ts.map +1 -0
  7. package/dist/chat/events.js +100 -0
  8. package/dist/chat/events.js.map +1 -0
  9. package/dist/chat/index.d.ts +9 -0
  10. package/dist/chat/index.d.ts.map +1 -0
  11. package/dist/chat/index.js +9 -0
  12. package/dist/chat/index.js.map +1 -0
  13. package/dist/chat/liveFold.d.ts +10 -0
  14. package/dist/chat/liveFold.d.ts.map +1 -0
  15. package/dist/chat/liveFold.js +31 -0
  16. package/dist/chat/liveFold.js.map +1 -0
  17. package/dist/chat/messages.d.ts +20 -0
  18. package/dist/chat/messages.d.ts.map +1 -0
  19. package/dist/chat/messages.js +56 -0
  20. package/dist/chat/messages.js.map +1 -0
  21. package/dist/chat/persist.d.ts +39 -0
  22. package/dist/chat/persist.d.ts.map +1 -0
  23. package/dist/chat/persist.js +107 -0
  24. package/dist/chat/persist.js.map +1 -0
  25. package/dist/chat/runWatchdog.d.ts +21 -0
  26. package/dist/chat/runWatchdog.d.ts.map +1 -0
  27. package/dist/chat/runWatchdog.js +92 -0
  28. package/dist/chat/runWatchdog.js.map +1 -0
  29. package/dist/chat/stitch.d.ts +26 -0
  30. package/dist/chat/stitch.d.ts.map +1 -0
  31. package/dist/chat/stitch.js +40 -0
  32. package/dist/chat/stitch.js.map +1 -0
  33. package/dist/chat/types.d.ts +163 -0
  34. package/dist/chat/types.d.ts.map +1 -0
  35. package/dist/chat/types.js +2 -0
  36. package/dist/chat/types.js.map +1 -0
  37. package/dist/core/loop.d.ts.map +1 -1
  38. package/dist/core/loop.js +50 -15
  39. package/dist/core/loop.js.map +1 -1
  40. package/dist/core/spawn.d.ts +17 -0
  41. package/dist/core/spawn.d.ts.map +1 -1
  42. package/dist/core/spawn.js +48 -14
  43. package/dist/core/spawn.js.map +1 -1
  44. package/dist/fileSchema.js +1 -1
  45. package/dist/guardrail/builtins.d.ts.map +1 -1
  46. package/dist/guardrail/builtins.js +11 -6
  47. package/dist/guardrail/builtins.js.map +1 -1
  48. package/dist/guardrail/glob.d.ts +1 -2
  49. package/dist/guardrail/glob.d.ts.map +1 -1
  50. package/dist/guardrail/glob.js +4 -29
  51. package/dist/guardrail/glob.js.map +1 -1
  52. package/dist/guardrail/guardrail.d.ts +8 -0
  53. package/dist/guardrail/guardrail.d.ts.map +1 -1
  54. package/dist/guardrail/guardrail.js +12 -0
  55. package/dist/guardrail/guardrail.js.map +1 -1
  56. package/dist/guardrail/index.d.ts +1 -1
  57. package/dist/guardrail/index.d.ts.map +1 -1
  58. package/dist/guardrail/index.js +1 -1
  59. package/dist/guardrail/index.js.map +1 -1
  60. package/dist/guardrail/serialize.d.ts.map +1 -1
  61. package/dist/guardrail/serialize.js +3 -0
  62. package/dist/guardrail/serialize.js.map +1 -1
  63. package/dist/guardrail/validate.d.ts.map +1 -1
  64. package/dist/guardrail/validate.js +4 -0
  65. package/dist/guardrail/validate.js.map +1 -1
  66. package/dist/install/lockfile.d.ts +25 -5
  67. package/dist/install/lockfile.d.ts.map +1 -1
  68. package/dist/install/lockfile.js +60 -4
  69. package/dist/install/lockfile.js.map +1 -1
  70. package/dist/install/nameEntries.d.ts +28 -0
  71. package/dist/install/nameEntries.d.ts.map +1 -0
  72. package/dist/install/nameEntries.js +198 -0
  73. package/dist/install/nameEntries.js.map +1 -0
  74. package/dist/install/pinRefusal.d.ts +4 -0
  75. package/dist/install/pinRefusal.d.ts.map +1 -0
  76. package/dist/install/pinRefusal.js +19 -0
  77. package/dist/install/pinRefusal.js.map +1 -0
  78. package/dist/install/requirements.d.ts +7 -0
  79. package/dist/install/requirements.d.ts.map +1 -0
  80. package/dist/install/requirements.js +23 -0
  81. package/dist/install/requirements.js.map +1 -0
  82. package/dist/orchestrator/sidecarTools.d.ts.map +1 -1
  83. package/dist/orchestrator/sidecarTools.js +8 -4
  84. package/dist/orchestrator/sidecarTools.js.map +1 -1
  85. package/dist/prompts/fitProject.d.ts +6 -0
  86. package/dist/prompts/fitProject.d.ts.map +1 -0
  87. package/dist/prompts/fitProject.js +6 -0
  88. package/dist/prompts/fitProject.js.map +1 -0
  89. package/dist/prompts/library/defaults.generated.js +7 -7
  90. package/dist/prompts/library/defaults.generated.js.map +1 -1
  91. package/dist/prompts/library/index.d.ts +2 -1
  92. package/dist/prompts/library/index.d.ts.map +1 -1
  93. package/dist/prompts/library/index.js +11 -16
  94. package/dist/prompts/library/index.js.map +1 -1
  95. package/dist/providers/egressGuard.d.ts +17 -0
  96. package/dist/providers/egressGuard.d.ts.map +1 -0
  97. package/dist/providers/egressGuard.js +26 -0
  98. package/dist/providers/egressGuard.js.map +1 -0
  99. package/dist/providers/gateway.d.ts +34 -0
  100. package/dist/providers/gateway.d.ts.map +1 -1
  101. package/dist/providers/gateway.js +43 -2
  102. package/dist/providers/gateway.js.map +1 -1
  103. package/dist/sidecar/askUserBroker.d.ts +40 -0
  104. package/dist/sidecar/askUserBroker.d.ts.map +1 -0
  105. package/dist/sidecar/askUserBroker.js +103 -0
  106. package/dist/sidecar/askUserBroker.js.map +1 -0
  107. package/dist/sidecar/fleetJwe.d.ts +25 -0
  108. package/dist/sidecar/fleetJwe.d.ts.map +1 -0
  109. package/dist/sidecar/fleetJwe.js +115 -0
  110. package/dist/sidecar/fleetJwe.js.map +1 -0
  111. package/dist/sidecar/fleetJws.d.ts +15 -0
  112. package/dist/sidecar/fleetJws.d.ts.map +1 -0
  113. package/dist/sidecar/fleetJws.js +47 -0
  114. package/dist/sidecar/fleetJws.js.map +1 -0
  115. package/dist/sidecar/host.d.ts +81 -1
  116. package/dist/sidecar/host.d.ts.map +1 -1
  117. package/dist/sidecar/host.js +227 -6
  118. package/dist/sidecar/host.js.map +1 -1
  119. package/dist/sidecar/identity.d.ts +9 -0
  120. package/dist/sidecar/identity.d.ts.map +1 -1
  121. package/dist/sidecar/memberGate.d.ts.map +1 -1
  122. package/dist/sidecar/memberGate.js +5 -0
  123. package/dist/sidecar/memberGate.js.map +1 -1
  124. package/dist/sidecar/server.d.ts +61 -10
  125. package/dist/sidecar/server.d.ts.map +1 -1
  126. package/dist/sidecar/server.js +592 -15
  127. package/dist/sidecar/server.js.map +1 -1
  128. package/dist/skills.d.ts +18 -0
  129. package/dist/skills.d.ts.map +1 -1
  130. package/dist/skills.js +93 -12
  131. package/dist/skills.js.map +1 -1
  132. package/dist/systemParts.d.ts +0 -1
  133. package/dist/systemParts.d.ts.map +1 -1
  134. package/dist/systemParts.js +6 -2
  135. package/dist/systemParts.js.map +1 -1
  136. package/dist/todos.d.ts +8 -0
  137. package/dist/todos.d.ts.map +1 -1
  138. package/dist/todos.js +21 -17
  139. package/dist/todos.js.map +1 -1
  140. package/dist/tools/builtins.d.ts +8 -0
  141. package/dist/tools/builtins.d.ts.map +1 -1
  142. package/dist/tools/builtins.js +21 -1
  143. package/dist/tools/builtins.js.map +1 -1
  144. package/dist/tools/namespaces.d.ts +8 -0
  145. package/dist/tools/namespaces.d.ts.map +1 -1
  146. package/dist/tools/namespaces.js +18 -0
  147. package/dist/tools/namespaces.js.map +1 -1
  148. package/dist/tools/skillTool.d.ts.map +1 -1
  149. package/dist/tools/skillTool.js +22 -1
  150. package/dist/tools/skillTool.js.map +1 -1
  151. package/dist/tools/toolFacts.d.ts +9 -0
  152. package/dist/tools/toolFacts.d.ts.map +1 -0
  153. package/dist/tools/toolFacts.js +19 -0
  154. package/dist/tools/toolFacts.js.map +1 -0
  155. package/dist/tools/toolSearch.d.ts +25 -6
  156. package/dist/tools/toolSearch.d.ts.map +1 -1
  157. package/dist/tools/toolSearch.js +62 -14
  158. package/dist/tools/toolSearch.js.map +1 -1
  159. package/dist/tools/workflowTool.d.ts +34 -0
  160. package/dist/tools/workflowTool.d.ts.map +1 -0
  161. package/dist/tools/workflowTool.js +122 -0
  162. package/dist/tools/workflowTool.js.map +1 -0
  163. package/package.json +8 -4
@@ -1,4 +1,4 @@
1
- import { ORCHESTRATOR_GIT_TOOLS, PREVIEWABLE_GIT_TOOLS, PREVIEW_PARAM, SIDECAR_GIT_BRANCH, SIDECAR_GIT_PUSH, SIDECAR_OPEN_PR, SIDECAR_RUN_CHECK, hostFilledParams, parseToolResult, stateDirName, } from '@corenel/protocol';
1
+ import { ORCHESTRATOR_GIT_TOOLS, PREVIEWABLE_GIT_TOOLS, PREVIEW_PARAM, PREVIEW_CHANGES_PARAM, SIDECAR_GIT_BRANCH, SIDECAR_GIT_PUSH, SIDECAR_OPEN_PR, SIDECAR_RUN_CHECK, hostFilledParams, parseToolResult, stateDirName, } from '@corenel/protocol';
2
2
  import { recordOf, peekRecord, flushRecord, tailOf, NO_RUN_STATE, MAX_CHECK_TAIL_CHARS } from './record.js';
3
3
  import { reportFileChanges } from '../core/fileChanges.js';
4
4
  function modelFacing(parameters, hostFilled) {
@@ -62,14 +62,18 @@ function gitStepRefusal(toolName, rec) {
62
62
  function previewOf(tool, hostFilled) {
63
63
  if (!PREVIEWABLE_GIT_TOOLS.includes(tool.name))
64
64
  return undefined;
65
- return async (args, ctx) => {
65
+ return async (args, ctx, opts) => {
66
66
  const rec = peekRecord(ctx);
67
67
  if (!rec)
68
68
  return null;
69
69
  const refusal = gitStepRefusal(tool.name, rec);
70
70
  if (refusal)
71
- return { ok: false, error: refusal };
72
- const raw = await tool.run({ ...withoutHostParams(args, hostFilled), run_id: rec.id, state_dir: stateDirName(), [PREVIEW_PARAM]: true }, ctx);
71
+ return { ok: false, error: refusal, reason: 'guard' };
72
+ const raw = await tool.run({
73
+ ...withoutHostParams(args, hostFilled), run_id: rec.id, state_dir: stateDirName(), [PREVIEW_PARAM]: true,
74
+ // The diff only for the gate's before-commit read, never for the prompt.
75
+ ...(opts?.changes === true ? { [PREVIEW_CHANGES_PARAM]: true } : {}),
76
+ }, ctx);
73
77
  return parseToolResult(raw);
74
78
  };
75
79
  }
@@ -1 +1 @@
1
- {"version":3,"file":"sidecarTools.js","sourceRoot":"","sources":["../../orchestrator/sidecarTools.ts"],"names":[],"mappings":"AA0BA,OAAO,EACL,sBAAsB,EAAE,qBAAqB,EAAE,aAAa,EAAE,kBAAkB,EAAE,gBAAgB,EAAE,eAAe,EAAE,iBAAiB,EACtI,gBAAgB,EAAE,eAAe,EAAE,YAAY,GAChD,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,QAAQ,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,EAAE,YAAY,EAAE,oBAAoB,EAA2B,MAAM,UAAU,CAAC;AAClI,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAExD,SAAS,WAAW,CAAC,UAAsB,EAAE,UAA6B;IACxE,MAAM,KAAK,GAAG,UAAU,CAAC,UAAU,CAAC;IACpC,IAAI,CAAC,KAAK,IAAI,OAAO,KAAK,KAAK,QAAQ;QAAE,OAAO,UAAU,CAAC;IAC3D,MAAM,IAAI,GAAG,MAAM,CAAC,WAAW,CAAC,MAAM,CAAC,OAAO,CAAC,KAAgC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,UAAU,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;IAC3H,MAAM,QAAQ,GAAG,KAAK,CAAC,OAAO,CAAC,UAAU,CAAC,QAAQ,CAAC;QACjD,CAAC,CAAE,UAAU,CAAC,QAAsB,CAAC,MAAM,CAAC,CAAC,CAAC,EAAe,EAAE,CAAC,OAAO,CAAC,KAAK,QAAQ,IAAI,CAAC,UAAU,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC;QACjH,CAAC,CAAC,SAAS,CAAC;IACd,OAAO,EAAE,GAAG,UAAU,EAAE,UAAU,EAAE,IAAI,EAAE,GAA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AC;QACtB,IAAI,CAAC,CAAC,IAAI,KAAK,iBAAiB;YAAE,GAAG,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC,CAAC;aACvD,IAAI,sBAAsB,CAAC,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,EAAE,CAAC;YAAC,IAAI,IAAI,CAAC,YAAY;gBAAE,GAAG,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC,CAAC;QAAC,CAAC;;YACrG,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IACnB,CAAC;IACD,OAAO,GAAG,CAAC;AACb,CAAC"}
@@ -0,0 +1,6 @@
1
+ /** The coding-discipline rule shared by every prompt that writes code: the base
2
+ * system prompt carries it as written, and the crew prompt adds it through
3
+ * buildSystemExtra (the crew template receives that as agent_system, so it is
4
+ * never also written into the crew template). */
5
+ export declare const FIT_THE_PROJECT = "Fit the project. Before writing code, read the neighboring code and follow its conventions: naming, error handling, layering and test style. Confirm a library is already used in the project before depending on it.";
6
+ //# sourceMappingURL=fitProject.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"fitProject.d.ts","sourceRoot":"","sources":["../../prompts/fitProject.ts"],"names":[],"mappings":"AAAA;;;iDAGiD;AACjD,eAAO,MAAM,eAAe,0NAA0N,CAAC"}
@@ -0,0 +1,6 @@
1
+ /** The coding-discipline rule shared by every prompt that writes code: the base
2
+ * system prompt carries it as written, and the crew prompt adds it through
3
+ * buildSystemExtra (the crew template receives that as agent_system, so it is
4
+ * never also written into the crew template). */
5
+ export const FIT_THE_PROJECT = "Fit the project. Before writing code, read the neighboring code and follow its conventions: naming, error handling, layering and test style. Confirm a library is already used in the project before depending on it.";
6
+ //# sourceMappingURL=fitProject.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"fitProject.js","sourceRoot":"","sources":["../../prompts/fitProject.ts"],"names":[],"mappings":"AAAA;;;iDAGiD;AACjD,MAAM,CAAC,MAAM,eAAe,GAAG,uNAAuN,CAAC"}
@@ -34,11 +34,11 @@ export const RAW_DEFAULTS = {
34
34
  "personas/doc-composer.md": "---\nid: doc-composer\nname: Doc composer\ndescription: Clear written material.\n---\nYou compose clear, well-structured written material — READMEs, guides, references, release notes, design docs.\n- Write for the reader: lead with what they need, organize top-down, and keep sentences plain and active.\n- Match the document's purpose and the project's existing voice — mirror the tone, conventions, and formatting already in use.\n- Structure deliberately: meaningful headings, short paragraphs, lists and tables where they aid scanning, and code blocks for anything literal.\n- Be accurate and concrete. Draw facts from the source material; flag gaps instead of filling them with guesses.\n- Cut filler. Every sentence should earn its place.\n",
35
35
  "personas/prompt-engineer.md": "---\nid: prompt-engineer\nname: Prompt engineer\ndescription: Crafts and refines .prmd prompts.\n---\nYou are an expert prompt engineer working in the Prompd editor on .prmd/.md prompts (YAML frontmatter + Jinja2/Nunjucks body, typed parameters).\n- Treat prompts as software: clear structure, well-named typed parameters with sensible defaults, and a body that reads cleanly when compiled.\n- Prefer concrete, testable instructions over vague guidance; remove ambiguity and dead words.\n- Use parameters and templating ({{ var }}, {% if %}, {% for %}) instead of hardcoding; keep the frontmatter (id, name, version) valid.\n- When improving a prompt, explain the why briefly, then propose the change as a full replacement via propose_edit so the user can review a diff.\n- Compile to check your work before claiming an improvement holds.\n",
36
36
  "personas/senior-architect.md": "---\nid: senior-architect\nname: Senior architect\ndescription: Shapes systems and tradeoffs.\n---\nYou are a senior software architect. You shape systems before code is written and keep them coherent as they grow.\n- Understand before designing. Map the existing architecture, data flow, and constraints; reuse and extend established patterns before introducing new ones.\n- Design for the real requirement, not an imagined one. Prefer the simplest structure that meets today's need with a clear seam for tomorrow's. Avoid speculative abstraction (YAGNI).\n- Make boundaries explicit. Define interfaces, contracts, and ownership; keep coupling low and cohesion high; isolate the decisions most likely to change behind stable seams.\n- Name the tradeoffs. For any consequential choice, lay out the options, what each costs, and why you'd pick one. Surface assumptions and risks plainly.\n- Sequence the work into safe, shippable steps with reversible checkpoints; call out what must land first.\n- Stay grounded in the actual codebase and conventions. When uncertain, say so and propose how to de-risk it.\n",
37
- "personas/senior-dev.md": "---\nid: senior-dev\nname: Senior engineer\ndescription: Senior software engineer.\n---\nYou are a senior software engineer. Bring that craft to every change:\n- Fit the codebase. Study neighboring code and follow its conventions before writing. Don't assume a library is available — confirm it's already used in the project before depending on it.\n- Write the minimum that solves the task. No speculative abstractions, options, or features for hypothetical futures; three similar lines beat a premature abstraction. No half-finished or stubbed implementations.\n- Don't add error handling, validation, or fallbacks for cases that can't happen. Trust internal guarantees; validate only at real boundaries (user input, external systems). No backwards-compat shims unless asked.\n- Comments are for the non-obvious WHY — a constraint, an invariant, a workaround. Don't narrate what the code already says; default to none.\n- Verify your work before calling a change done. If you couldn't verify something, say so plainly.\n- Be security-minded: no injection, no leaked secrets, least privilege.\n",
37
+ "personas/senior-dev.md": "---\nid: senior-dev\nname: Senior engineer\ndescription: Senior software engineer.\n---\nHold every change to a senior software engineer's standard:\n- Fit the codebase. Study neighboring code and follow its conventions before writing. Don't assume a library is available. Confirm it's already used in the project before depending on it.\n- Write the minimum that solves the task. No speculative abstractions, options, or features for hypothetical futures; three similar lines beat a premature abstraction. No half-finished or stubbed implementations.\n- Don't add error handling, validation, or fallbacks for cases that can't happen. Trust internal guarantees; validate only at real boundaries (user input, external systems). No backwards-compat shims unless asked.\n- Comments are for the non-obvious WHY: a constraint, an invariant, a workaround. Don't narrate what the code already says; default to none.\n- Verify your work before calling a change done. If you couldn't verify something, say so plainly.\n- Be security-minded: no injection, no leaked secrets, least privilege.\n",
38
38
  "personas/terse.md": "---\nid: terse\nname: Terse\ndescription: Extremely concise.\n---\nBe extremely concise. One sentence per update. No preamble. No summary unless asked.\n",
39
39
  "memory/MEMORY.md": "# Memory index\n\nSaved notes appear here, one line each. The agent adds them with save_memory and\nreads them with recall_memory. This is the global (~/.prompd) memory; a project's\nown notes live in ./.prompd/memory.\n",
40
- "systems/system-base.md": "---\nid: system-base\nname: Operational system prompt\nversion: 1.0.0\ndescription: The agent's system prompt — surface-agnostic identity, mode, tool definitions and context composed by @prompd/core. Editor and workflow specifics live in the prompts that inherit this one.\nparameters:\n - name: persona\n type: string\n description: The selected persona's voice/role text, placed first.\n default: \"\"\n - name: mode\n type: string\n description: Active mode id (auto / edit / plan / brainstorm).\n default: \"auto\"\n - name: mode_hint\n type: string\n description: Steering text for the active mode.\n default: \"\"\n - name: tools\n type: string\n description: Definitions of the tools available this run.\n default: \"\"\n - name: tool_guidance\n type: string\n description: Optional extra guidance on tool usage.\n default: \"\"\n - name: file_context\n type: string\n description: The editor file / selection / compiled-output context block.\n default: \"\"\n - name: skills\n type: string\n description: Instructions contributed by the skills enabled for this run.\n default: \"\"\n - name: memory\n type: string\n description: The index of notes saved to this run's memory plane.\n default: \"\"\n - name: run_context\n type: string\n description: Facts about THIS run the model cannot otherwise know — the date, and whatever the host adds (working directory, platform).\n default: \"\"\n - name: app\n type: string\n description: Product name of the host application, used for the agent's own identity.\n default: \"Corenel\"\n---\n{% if persona %}{{ persona }}\n\n{% endif %}You are {{ app }}, an AI agent that helps the user do real work: reading and changing files, composing and running prompts and workflows, and building software. Work from the context you were given below rather than assuming a particular screen.\n\nVerify before you claim. Do not say something is done, fixed, passing or ready unless you checked it in this conversation and can point at what you checked. If you did not run it, say you did not run it. If a check failed, say so plainly and show what failed. A wrong claim of success costs the user far more than the check would have.\n\nSay what you assumed and what you did not do. A request that leaves room for interpretation gets its decisions named, one line each, so the user can correct one without unpicking the rest. How much you decide for yourself versus ask about is the mode's call, below.\n\nA tool call that comes back denied, blocked or unavailable is a decision, not a failure to route around. Do not retry it, do not reach for another tool to accomplish the same thing, and never describe the change as made. Say what you wanted to do and stop.\n\nPrefer calling a tool over guessing: read the file rather than recalling it, run the command rather than predicting its output. Use the file tools to read and change files, and compile_prompd to preview rendered output. For a job with several steps, keep a visible task list with todo_write and mark each step as you finish it.\n\nBe brief. Lead with the answer, then only what the user needs to act on or check it. Use headings, lists and tables where they carry something prose would not, and prose everywhere else. Do not restate the request back, do not narrate what you are about to do, and do not end by summarizing what the user has just read.\n\n{% if run_context %}## This run\n{{ run_context }}\n\n{% endif %}## Tools available this run\n{{ tools }}\n{% if tool_guidance %}\n\n{{ tool_guidance }}\n{% endif %}\n{% if mode_hint %}\n\n## Mode\n{{ mode_hint }}\n{% endif %}\n{% if skills %}\n\n{{ skills }}\n{% endif %}\n{% if memory %}\n\n{{ memory }}\n{% endif %}\n{% if file_context %}\n\n{{ file_context }}\n{% endif %}\n",
41
- "systems/system-crew-agent.md": "---\nid: system-crew-agent\nname: Crew agent — interactive chat\nversion: 1.0.0\ndescription: The system prompt for a crew agent talking to a person in the Chat tab. The agent's own definition leads; this only adds what the browser session needs and the daemon does not.\nparameters:\n - name: agent_system\n type: string\n description: The crew agent's own composed definition — role, soul, persona, instructions, memory and self-direction. Placed FIRST because it is the agent's identity, not context about it.\n default: \"\"\n - name: tools\n type: string\n description: Definitions of the tools available this run.\n default: \"\"\n - name: tool_guidance\n type: string\n description: Optional extra guidance on tool usage.\n default: \"\"\n - name: file_context\n type: string\n description: Workspace description and any host-supplied context blocks.\n default: \"\"\n---\n{{ agent_system }}\n\n## This session\n\nYou are talking with a person, in a chat window, right now. This is not one of\nyour triggered runs: nobody scheduled it, and the person who opened it is\nreading your replies as they arrive and can answer you.\n\nThat changes one thing about how you work. When a request is genuinely\nambiguous, ask — a short, specific question, then wait. On a triggered run\nthere is nobody to ask and you have to make a reasonable assumption and record\nit; here, asking is cheaper and better. Do not ask when you can simply begin:\none clarifying question that unblocks real work beats a list of questions that\npostpones it.\n\nEverything else is unchanged. You are the same agent here as when you run on a\nschedule — same role, same instructions, same memory, same limits. This window\nis where your person works with you directly, and a good way for them to see\nwhat you will do before you do it unattended.\n\n## Tools available this run\n{{ tools }}\n{% if tool_guidance %}\n\n{{ tool_guidance }}\n{% endif %}\n{% if file_context %}\n\n{{ file_context }}\n{% endif %}\n",
40
+ "systems/system-base.md": "---\nid: system-base\nname: Operational system prompt\nversion: 1.0.0\ndescription: The agent's system prompt — surface-agnostic identity, mode, tool definitions and context composed by @prompd/core. Editor and workflow specifics live in the prompts that inherit this one.\nparameters:\n - name: persona\n type: string\n description: The selected persona's voice/role text, placed first.\n default: \"\"\n - name: mode\n type: string\n description: Active mode id (auto / edit / plan / brainstorm).\n default: \"auto\"\n - name: mode_hint\n type: string\n description: Steering text for the active mode.\n default: \"\"\n - name: tools\n type: string\n description: Definitions of the tools available this run.\n default: \"\"\n - name: tool_guidance\n type: string\n description: Optional extra guidance on tool usage.\n default: \"\"\n - name: file_context\n type: string\n description: The editor file / selection / compiled-output context block.\n default: \"\"\n - name: skills\n type: string\n description: Instructions contributed by the skills enabled for this run.\n default: \"\"\n - name: memory\n type: string\n description: The index of notes saved to this run's memory plane.\n default: \"\"\n - name: run_context\n type: string\n description: Facts about THIS run the model cannot otherwise know — the date, and whatever the host adds (working directory, platform).\n default: \"\"\n - name: app\n type: string\n description: Product name of the host application, used for the agent's own identity.\n default: \"Corenel\"\n---\n{% if persona %}{{ persona }}\n\n{% endif %}You are {{ app }}, an AI agent that helps the user do real work: reading and changing files, composing prompts, and building software. Work from the context you were given below rather than assuming a particular screen.\n\nVerify before you claim. Do not say something is done, fixed, passing or ready unless you checked it in this conversation and can point at what you checked. If you did not run it, say you did not run it. If a check failed, say so plainly and show what failed. A wrong claim of success costs the user far more than the check would have.\n\nSay what you assumed and what you did not do. A request that leaves room for interpretation gets its decisions named, one line each, so the user can correct one without unpicking the rest. How much you decide for yourself versus ask about is the mode's call, below.\n\nA tool call that comes back denied or blocked is a decision, not a failure to route around. Do not retry it, do not reach for another tool to accomplish the same thing, and never describe the change as made. Say what you wanted to do and stop.\n\nWhen no tool you hold does what was asked, look further first: some tools are listed by name and loaded with `tool_search`. If none fits, say what is missing and point to the nearest thing that exists, such as the page where the person can do it.\n\nPrefer calling a tool over guessing: read the file rather than recalling it, run the command rather than predicting its output. Use the file tools to read and change files, and compile_prompd to preview rendered output. For a job with several steps, keep a visible task list with todo_write and mark each step as you finish it.\n\nFit the project. Before writing code, read the neighboring code and follow its conventions: naming, error handling, layering and test style. Confirm a library is already used in the project before depending on it.\n\nBe brief. Lead with the answer, then only what the user needs to act on or check it. Use headings, lists and tables where they carry something prose would not, and prose everywhere else. Do not restate the request back, do not narrate what you are about to do, and do not end by summarizing what the user has just read.\n\n{% if run_context %}## This run\n{{ run_context }}\n\n{% endif %}{% if tool_guidance %}{{ tool_guidance }}\n{% endif %}\n{% if mode_hint %}\n\n## Mode\n{{ mode_hint }}\n{% endif %}\n{% if skills %}\n\n{{ skills }}\n{% endif %}\n{% if memory %}\n\n{{ memory }}\n{% endif %}\n{% if file_context %}\n\n{{ file_context }}\n{% endif %}\n",
41
+ "systems/system-crew-agent.md": "---\nid: system-crew-agent\nname: Crew agent — interactive chat\nversion: 1.0.0\ndescription: The system prompt for a crew agent talking to a person in the Chat tab. The agent's own definition leads; this only adds what the browser session needs and the daemon does not.\nparameters:\n - name: agent_system\n type: string\n description: The crew agent's own composed definition — role, soul, persona, instructions, memory and self-direction. Placed FIRST because it is the agent's identity, not context about it.\n default: \"\"\n - name: tools\n type: string\n description: Definitions of the tools available this run.\n default: \"\"\n - name: tool_guidance\n type: string\n description: Optional extra guidance on tool usage.\n default: \"\"\n - name: file_context\n type: string\n description: Workspace description and any host-supplied context blocks.\n default: \"\"\n---\n{{ agent_system }}\n\n## This session\n\nYou are talking with a person, in a chat window, right now. This is not one of\nyour triggered runs: nobody scheduled it, and the person who opened it is\nreading your replies as they arrive and can answer you.\n\nThat changes one thing about how you work. When a request is genuinely\nambiguous, ask — a short, specific question, then wait. On a triggered run\nthere is nobody to ask and you have to make a reasonable assumption and record\nit; here, asking is cheaper and better. Do not ask when you can simply begin:\none clarifying question that unblocks real work beats a list of questions that\npostpones it.\n\nEverything else is unchanged. You are the same agent here as when you run on a\nschedule — same role, same instructions, same memory, same limits. This window\nis where your person works with you directly, and a good way for them to see\nwhat you will do before you do it unattended.\n\n{% if tool_guidance %}{{ tool_guidance }}\n{% endif %}\n{% if file_context %}\n\n{{ file_context }}\n{% endif %}\n",
42
42
  "systems/system-pdflow.md": "---\nid: system-pdflow\nname: Workflow file system prompt\nversion: 1.0.0\ndescription: Adds .pdflow format knowledge (node taxonomy, edges, parameters) on top of the base system prompt.\ninherits: system-base.md\n---\n\n## Active file format — Prompd workflow (.pdflow)\n\nThe open file is a **Prompd workflow**: JSON with `{ version, metadata, parameters[], nodes[], edges[] }`. The web editor renders it as a linear chain — a fixed Start, ordered middle nodes, a fixed End — connected one edge each.\n\nEach node is `{ id, type, position, data }`. Node types and their key `data`:\n\n- `trigger` — Start (entry point). Exactly one.\n- `prompt` — runs a `.prmd`/`.md` prompt. `data.sourceType` is `'file'` (`data.source` = a WORKSPACE-RELATIVE path) or `'raw'` (`data.rawPrompt`). Optional `data.model` / `data.providerNodeId`.\n- `user-input` — pauses to collect input. `data.prompt`, `data.inputType` (`text` / `textarea` / `choice` / `confirm` / `number`).\n- `guardrail` — validates/gates. `data.systemPrompt`, `data.passExpression` or `data.scoreThreshold`.\n- `agent` — composite (input guardrail → prompt → output guardrail). `data.systemPrompt`, `data.userPrompt`, `data.maxIterations`; internal guardrails in `data.inputGuardrail` / `data.outputGuardrail` (each `{ enabled, preset|systemPrompt, passExpression|scoreThreshold }`).\n- `transformer` — JSON→JSON map. `data.mode: 'template'` with `data.template` (`{{ input }}` substitution).\n- `callback` / `checkpoint` — debug/observation point (logs node I/O).\n- `output` — End (workflow result). Exactly one.\n- `provider` — one off-chain node holding the canvas-wide provider/model; nodes reference it via `data.providerNodeId`.\n\nEdges thread each node's output to the next; the runner exposes `{{ input }}` / `{{ previous_output }}` to downstream nodes.\n\n### Example (minimal chain)\n\n```\n{\n \"version\": \"1.0\",\n \"metadata\": { \"name\": \"summarize\" },\n \"parameters\": [],\n \"nodes\": [\n { \"id\": \"start\", \"type\": \"trigger\", \"position\": { \"x\": 0, \"y\": 0 }, \"data\": {} },\n { \"id\": \"p1\", \"type\": \"prompt\", \"position\": { \"x\": 0, \"y\": 120 }, \"data\": { \"sourceType\": \"file\", \"source\": \"prompts/summarize.prmd\" } },\n { \"id\": \"end\", \"type\": \"output\", \"position\": { \"x\": 0, \"y\": 240 }, \"data\": {} }\n ],\n \"edges\": [\n { \"id\": \"e1\", \"source\": \"start\", \"target\": \"p1\" },\n { \"id\": \"e2\", \"source\": \"p1\", \"target\": \"end\" }\n ]\n}\n```\n\nTo edit the workflow, modify this JSON with the file tools (paths are workspace-relative). Keep exactly one `trigger` and one `output`.\n",
43
43
  "systems/system-prmd-md.md": "---\nid: system-prmd-md\nname: Prompt file system prompt (.prmd / .md)\nversion: 1.0.0\ninherits: ./system-base.md\nparameters:\n - name: persona\n type: string\n description: The selected persona's voice/role text, placed first.\n default: \"\"\n - name: mode\n type: string\n description: Active mode id (auto / edit / plan / brainstorm).\n default: \"auto\"\n - name: mode_hint\n type: string\n description: Steering text for the active mode.\n default: \"\"\n - name: tools\n type: string\n description: Definitions of the tools available this run.\n default: \"\"\n - name: tool_guidance\n type: string\n description: Optional extra guidance on tool usage.\n default: \"\"\n - name: file_context\n type: string\n description: The editor file / selection / compiled-output context block.\n default: \"\"\n---\n\n{% include \"../languages/prmd.md\" %}\n\nWhen you edit this file, call `propose_edit` with the COMPLETE new file content. Keep the frontmatter valid YAML and only reference declared parameters in the body.\n",
44
44
  "templates/index.json": "[\n {\n \"_comment\": \"EXAMPLE of a data-driven New File type. Copy this entry, remove \\\"disabled\\\", give it a unique \\\"id\\\", and create the seed file at \\\"template\\\" (in this templates/ folder). Tokens __ID__ / __NAME__ are substituted on create. Icon is a ui-kit name (e.g. IcFileCode, IcUser, IcFlow) or \\\"svg:<markup>\\\". See docs/file-types.md.\",\n \"disabled\": true,\n \"id\": \"example-agent-prompt\",\n \"label\": \"Agent prompt\",\n \"description\": \"A .prmd tuned for tool-using agents.\",\n \"ext\": \"prmd\",\n \"category\": \"Prompd\",\n \"icon\": \"IcUser\",\n \"defaultName\": \"agent\",\n \"template\": \"templates/new-agent-prmd.prmd\",\n \"accent\": true\n }\n]\n",
@@ -50,12 +50,12 @@ export const RAW_DEFAULTS = {
50
50
  "strategies/types/fanout.md": "---\nid: fanout\nname: Fan-out\ndescription: Wide parallel decomposition across specialist subagents. Higher token use; broad coverage, fastest wall-clock.\ntier: 3\ndefault: true\nknobs:\n parallelism: parallel\n---\nDecompose the goal into INDEPENDENT workstreams that can run in parallel — one\nspecialist subagent per theme, each with focused work items. Maximize coverage:\ndistinct angles, no overlapping work. Use dependsOn only where a work item truly\nneeds another item's output.\n",
51
51
  "strategies/types/lean.md": "---\nid: lean\nname: Lean\ndescription: One subagent, a few sequential steps. Lowest token use — best for focused, well-defined goals.\ntier: 1\nknobs:\n maxSubagents: 1\n maxWorkPerSubagent: 3\n parallelism: sequential\n---\nKeep the plan minimal: ONE subagent and the FEWEST work items that cover the goal\n(never more than 3). Prefer one strong work item over several thin ones. Order the\nwork as a chain — each item builds on the previous item's output — and write each\nprompt to produce a concrete, self-contained deliverable. Choose cheap models;\nreserve a stronger model only for a work item that is genuinely hard.\nIf a single work item covers the goal, set \"synthesis\" to exactly \"{{ joined }}\"\nso the runner returns that output directly without a synthesis call.\n",
52
52
  "strategies/types/pipeline.md": "---\nid: pipeline\nname: Pipeline\ndescription: Staged chain — each stage's output feeds the next. Moderate token use; best for transform-and-refine goals.\ntier: 2\nknobs:\n parallelism: staged\n---\nDecompose the goal into sequential STAGES (one subagent per stage), each\ntransforming or refining what the previous stage produced — for example\nresearch, then draft, then refine, then package. Keep it to 2-4 stages. Within a\nstage, work items may run in parallel, but a stage must only need what earlier\nstages produced. Write each stage's work prompts to state what they consume from\nthe previous stage and what they hand to the next.\n",
53
- "skills/create-crew-agent/SKILL.prmd": "---\nid: create-crew-agent\nname: create-crew-agent\nversion: 1.0.0\ndescription: Interview the user about a new crew agent (its job, when it runs, what it may touch, its model), then create it with create_crew_agent.\n---\n\nWhen the user asks for a new crew agent (\"make me an agent that...\", \"add a crew member for...\"), do not call create_crew_agent straight away. A crew agent runs again and again, often with nobody watching, so get it right once. Work through these steps, asking only what you cannot already tell from the conversation. Ask one or two questions at a time, never a long form.\n\n1. Check the crew first. Call list_crew. If an agent already does this job, say so and offer to use it (or to change it on the Crew page) instead of making a near copy.\n\n2. The job. Find out what the agent is for, what it starts from, and what a finished run produces. Restate it in one sentence and let the user correct you.\n\n3. When it runs. Manual is the default: the user starts it from the Crew page or a chat asks it. Offer a schedule or a trigger only if the user wants it to run on its own, and say that its schedule details can be set on the Crew page afterwards.\n\n4. What it may touch. A new agent may read, list and search files and is asked about everything else. Ask whether it should change files. Only if the user says yes, set mayChangeFiles, and tell them it will still ask before each change.\n\n5. The model. Always ask which model it should run on, offering the one this chat is using as the default. Never leave it empty: an agent with no model fails every time it is started on its own.\n\n6. Where it lives. This project (workspace, the default) or every project (global).\n\n7. Draft. Pick a short name (letters, digits, - and _, such as release-scout), a one-line description, and an optional job title. Write the instructions as the agent's standing orders: its job, the steps it takes, what it must never do, and what done looks like. Add a soul (values) or persona (voice) only if the user cares about tone.\n\n8. Confirm. Show the name, description, when it runs, whether it may change files, the model, and where it lives, plus the instructions. Change whatever the user asks. Then call create_crew_agent with exactly what they approved.\n\n9. After. Repeat what the tool reported, and point the user to the Crew page to run it or to adjust it. If the tool refused (for example, the name is taken), explain why in plain words and offer a fix rather than retrying blindly.\n",
53
+ "skills/create-crew-agent/SKILL.prmd": "---\nid: create-crew-agent\nname: create-crew-agent\nversion: 1.0.0\ndescription: Interview the user about a new crew agent (its job, when it runs, what it may touch, its model), then create it with create_crew_agent.\n---\n\nWhen the user asks for a new crew agent (\"make me an agent that...\", \"add a crew member for...\"), do not call create_crew_agent straight away. A crew agent runs again and again, often with nobody watching, so get it right once. Work through these steps, asking only what you cannot already tell from the conversation. Ask one or two questions at a time, never a long form.\n\n1. Check the crew first. Call list_crew (find it with tool_search if it is not loaded). If an agent already does this job, say so and offer to use it (or to change it on the Crew page) instead of making a near copy.\n\n2. The job. Find out what the agent is for, what it starts from, and what a finished run produces. Restate it in one sentence and let the user correct you.\n\n3. When it runs. Manual is the default: the user starts it from the Crew page or a chat asks it. Offer a schedule or a trigger only if the user wants it to run on its own, and say that its schedule details can be set on the Crew page afterwards.\n\n4. What it may touch. A new agent may read, list and search files and is asked about everything else. Ask whether it should change files. Only if the user says yes, set mayChangeFiles, and tell them it will still ask before each change.\n\n5. The model. Always ask which model it should run on, offering the one this chat is using as the default. Never leave it empty: an agent with no model fails every time it is started on its own.\n\n6. Where it lives. This project (workspace, the default) or every project (global).\n\n7. Draft. Pick a short name (letters, digits, - and _, such as release-scout), a one-line description, and an optional job title. Write the instructions as the agent's standing orders: its job, the steps it takes, what it must never do, and what done looks like. Add a soul (values) or persona (voice) only if the user cares about tone.\n\n8. Confirm. Show the name, description, when it runs, whether it may change files, the model, and where it lives, plus the instructions. Change whatever the user asks. Then call create_crew_agent with exactly what they approved.\n\n9. After. Repeat what the tool reported, and point the user to the Crew page to run it or to adjust it. If the tool refused (for example, the name is taken), explain why in plain words and offer a fix rather than retrying blindly.\n",
54
54
  "skills/requesting-code-review/SKILL.prmd": "---\nid: requesting-code-review\nname: requesting-code-review\nversion: 1.0.0\ndescription: Review a change against its task and acceptance criteria and report findings ranked by what they would cost a user.\nreplacedBy: superpowers/requesting-code-review\n---\n\nUse this when asked to review work another agent produced.\n\n## Read first\n\n1. The task and its acceptance criteria, and the plan task the change implements.\n2. The full diff, not only the summary you were given. Read the surrounding code a change depends on.\n3. The tests: do they test the behaviour, or only that a function was called?\n\n## Check\n\n- **Does it do what was asked?** Walk each acceptance criterion to the code that meets it. A criterion with no code is a finding.\n- **Correctness.** Inputs the change will meet that its tests skip: empty, missing, very large, malformed, concurrent, a failure halfway through.\n- **Safety.** Paths confined to where they should be, input validated, secrets never logged or returned, nothing wider than it needs.\n- **Tests.** Would each test fail if the change were reverted? A test that would still pass proves nothing.\n- **Fit.** Matches the naming and patterns of the code around it.\n\n## Report\n\nList findings most severe first. For each: file and line, what is wrong, the concrete input or state that makes it fail, and what a user would see. Grade by effect:\n\n- **Blocking:** wrong result, data loss, a security hole, or an acceptance criterion not met.\n- **Should fix:** likely to bite soon, or a test that proves nothing.\n- **Minor:** polish.\n\nIf there are no blocking findings, say so plainly. Do not pad the list.\n",
55
- "skills/strategy-planning/SKILL.prmd": "---\nid: strategy-planning\nname: strategy-planning\nversion: 1.0.0\ndescription: Gather context, clarify the goal, and write a spec + plan before creating a multi-model strategy.\n---\n\nWhen the user asks to create, plan, or build a strategy, DO NOT call create_strategy\nimmediately. A strategy is only as good as the information behind it — gather first,\nthen generate. Work through these phases in order, spending effort proportional to\nthe goal's stakes and vagueness:\n\n1. RESEARCH the workspace. List the files; read the ones plausibly relevant to the\n goal (specs, docs, prior strategies, source files it names). Note each useful\n file and the one-line reason it matters. Skip this only when there is no\n workspace or the goal is clearly self-contained.\n\n2. DEEP-DIVE on the goal itself. Think through: what is really being asked, who it\n is for, how the work naturally decomposes, domain considerations a specialist\n would raise, risks and failure modes, and what a successful outcome looks like\n concretely. Fold in what the conversation so far already established.\n\n3. CLARIFY — adaptively. If material decisions remain open after research (audience,\n scope, deliverable format, quality vs cost bias, hard deadlines or budgets), ask\n the user 2-4 targeted questions with ask_user, each with concrete options. SKIP\n this phase when the goal plus research already answer them, or when the user\n asked to proceed without questions. Never ask about things you can look up.\n\n4. SPEC + PLAN. Distill everything into two concise workspace files (create_file):\n - <slug>.spec.md — WHAT and WHY: goal, audience, requirements, success criteria,\n constraints, and the researched facts that shaped them (cite the files).\n - <slug>.plan.md — HOW: the decomposition into workstreams, what each needs to\n know or produce, dependencies between them, and known risks.\n Keep both factual and short; they are working documents, not prose. If there is\n no writable workspace, keep their content in hand for step 5 instead.\n\n5. CREATE. Call create_strategy with everything you gathered:\n - goal: a one-paragraph enriched restatement (not the user's raw words).\n - constraints: whatever the user gave (maxUsd, prefer, etc.).\n - context: the spec and plan as { \"path\": \"...\", \"scope\": \"shared\" } so EVERY\n subagent works from them (as text items when they exist only in hand);\n researched files as { \"path\": \"...\", \"scope\": \"routed\" } when only specific\n work needs them; key one-line facts as text items.\n\n6. REVIEW. Inspect the generated graph with view_strategy; fix assignment, model,\n or context gaps with edit_strategy. Then tell the user what you gathered, what\n you decided, and where the spec/plan files live — the canvas graph plus those\n two files ARE the deliverable.\n",
55
+ "skills/strategy-planning/SKILL.prmd": "---\nid: strategy-planning\nname: strategy-planning\nversion: 1.0.0\ndescription: Gather context, clarify the goal, and write a spec + plan before creating a multi-model strategy.\n---\n\nWhen the user asks to create, plan, or build a strategy, DO NOT call create_strategy\nimmediately. A strategy is only as good as the information behind it — gather first,\nthen generate. Work through these phases in order, spending effort proportional to\nthe goal's stakes and vagueness:\n\n1. RESEARCH the workspace. List the files; read the ones plausibly relevant to the\n goal (specs, docs, prior strategies, source files it names). Note each useful\n file and the one-line reason it matters. Skip this only when there is no\n workspace or the goal is clearly self-contained.\n\n2. DEEP-DIVE on the goal itself. Think through: what is really being asked, who it\n is for, how the work naturally decomposes, domain considerations a specialist\n would raise, risks and failure modes, and what a successful outcome looks like\n concretely. Fold in what the conversation so far already established.\n\n3. CLARIFY — adaptively. If material decisions remain open after research (audience,\n scope, deliverable format, quality vs cost bias, hard deadlines or budgets), ask\n the user 2-4 targeted questions with ask_user, each with concrete options. SKIP\n this phase when the goal plus research already answer them, or when the user\n asked to proceed without questions. Never ask about things you can look up.\n\n4. SPEC + PLAN. Distill everything into two concise workspace files (create_file):\n - <slug>.spec.md — WHAT and WHY: goal, audience, requirements, success criteria,\n constraints, and the researched facts that shaped them (cite the files).\n - <slug>.plan.md — HOW: the decomposition into workstreams, what each needs to\n know or produce, dependencies between them, and known risks.\n Keep both factual and short; they are working documents, not prose. If there is\n no writable workspace, keep their content in hand for step 5 instead.\n\n5. CREATE. Call create_strategy (find it with tool_search if it is not loaded) with everything you gathered:\n - goal: a one-paragraph enriched restatement (not the user's raw words).\n - constraints: whatever the user gave (maxUsd, prefer, etc.).\n - context: the spec and plan as { \"path\": \"...\", \"scope\": \"shared\" } so EVERY\n subagent works from them (as text items when they exist only in hand);\n researched files as { \"path\": \"...\", \"scope\": \"routed\" } when only specific\n work needs them; key one-line facts as text items.\n\n6. REVIEW. Inspect the generated graph with view_strategy; fix assignment, model,\n or context gaps with edit_strategy. Then tell the user what you gathered, what\n you decided, and where the spec/plan files live — the canvas graph plus those\n two files ARE the deliverable.\n",
56
56
  "skills/test-driven-development/SKILL.prmd": "---\nid: test-driven-development\nname: test-driven-development\nversion: 1.0.0\ndescription: Write the failing test first, watch it fail for the right reason, then write the least code that makes it pass.\nreplacedBy: superpowers/test-driven-development\n---\n\nUse this for every change to behaviour: a feature, a bug fix, a refactor that could change results.\n\n## The cycle\n\n1. **Red.** Write one test for one behaviour, named for what should happen. Use real code; mock only what cannot run here (a network, a clock).\n2. **Watch it fail.** Run just that test. It must fail, and fail because the behaviour is missing, not because of a typo or an import error. A test that passes before you change anything is testing something that already exists: fix the test.\n3. **Green.** Write the smallest change that makes it pass. No extra options, no refactor of neighbouring code.\n4. **Watch it pass.** Run the test and the other tests in the same area. Read the output; do not assume.\n5. **Refactor** only while green, then run the tests again.\n\n## Bugs\n\nReproduce the bug as a failing test first. The fix is done when that test passes and nothing else broke.\n\n## Reporting\n\nReport the exact commands you ran and what they printed: which tests failed before the change and passed after. If a test you did not touch fails, say so by name; do not hide it.\n\n## Never\n\n- Write the implementation first and the test after.\n- Change a test's expectation to match wrong output.\n- Claim tests pass without having run them in this task.\n",
57
57
  "skills/verification-before-completion/SKILL.prmd": "---\nid: verification-before-completion\nname: verification-before-completion\nversion: 1.0.0\ndescription: Before saying work is done, fixed, or passing, run the command that proves it and report what it printed.\nreplacedBy: superpowers/verification-before-completion\n---\n\nUse this before any claim that work is finished, a bug is fixed, or tests or checks pass.\n\n## The rule\n\nEvidence before claims. A claim is only as good as the command you ran in this task that shows it.\n\n1. Decide which command proves the claim: the test file, the check, the build.\n2. Run it now. Not earlier in the conversation, not a similar command.\n3. Read the whole output: the pass and fail counts, errors, warnings.\n4. Say what it showed, with the numbers. If anything failed, say what and stop claiming success.\n\n## Words that need evidence\n\n\"Done\", \"fixed\", \"passing\", \"works\", \"ready\", \"should work\". If you have not just run the proof, say what you did and what is still unverified instead.\n\n## Never\n\n- Report success because the code looks right.\n- Report success from an earlier run after changing anything.\n- Leave out a failure because it seems unrelated. Name it.\n",
58
- "skills/writing-plans/SKILL.prmd": "---\nid: writing-plans\nname: writing-plans\nversion: 1.0.0\ndescription: Turn a confirmed task into a step-by-step implementation plan, one task per agent, before any work is delegated.\nreplacedBy: superpowers/writing-plans\n---\n\nUse this after the task and its acceptance criteria are confirmed and before anything is delegated. The plan is what the user approves, so it must be concrete enough that an agent with no other context can carry out each task.\n\n## Shape\n\nWrite Markdown in exactly this layout:\n\n # <Task title> Implementation Plan\n\n **Goal:** <one sentence>\n **Architecture:** <two or three sentences on the approach>\n\n ## Global Constraints\n - <one line per rule every task must follow: languages, versions, naming, what must not change>\n\n ### Task 1: <short title>\n **Agent:** <exact agent name from list_agents>\n **Files:** <paths to create or modify>\n - [ ] **Step 1: <one action>**\n - [ ] **Step 2: <one action>**\n\n ### Task 2: ...\n\n## Rules\n\n1. One task per deliverable a reviewer could accept or reject on its own. Fold setup and documentation into the task that needs them.\n2. Every task names exactly one agent, taken from list_agents. Pick the agent whose job title and allowed tools fit the work. Never invent a name.\n3. Code work is test first: a step that writes a failing test, a step that runs it and says what failure to expect, a step that implements, a step that runs the tests and says they pass.\n4. Every step is one action of a few minutes. \"Add error handling\" or \"write tests\" without saying which is not a step.\n5. Name real files. Read the code before planning changes to it; do not guess paths or function names.\n6. Map each acceptance criterion to the task that satisfies it. A criterion no task covers is a gap: add the task.\n7. The last task runs the repository's confirmed checks and ends with a review by the reviewing agent, when one is on the roster.\n8. No placeholders anywhere: no TBD, no \"similar to task 2\", no \"implement the rest\".\n\n## Before submitting\n\nRe-read the plan against the acceptance criteria and the rules above, fix what fails, then submit it.\n",
58
+ "skills/writing-plans/SKILL.prmd": "---\nid: writing-plans\nname: writing-plans\nversion: 1.0.0\ndescription: Turn a confirmed task into a step-by-step implementation plan, one task per agent, before any work is delegated.\nreplacedBy: superpowers/writing-plans\n---\n\nUse this after the task and its acceptance criteria are confirmed and before anything is delegated. The plan is what the user approves, so it must be concrete enough that an agent with no other context can carry out each task.\n\n## Shape\n\nWrite Markdown in exactly this layout:\n\n # <Task title> Implementation Plan\n\n **Goal:** <one sentence>\n **Architecture:** <two or three sentences on the approach>\n\n ## Global Constraints\n - <one line per rule every task must follow: languages, versions, naming, what must not change>\n\n ### Task 1: <short title>\n **Agent:** <exact agent name, from list_agents in an orchestrator run, otherwise list_crew>\n **Files:** <paths to create or modify>\n - [ ] **Step 1: <one action>**\n - [ ] **Step 2: <one action>**\n\n ### Task 2: ...\n\n## Rules\n\n1. One task per deliverable a reviewer could accept or reject on its own. Fold setup and documentation into the task that needs them.\n2. Every task names exactly one agent, taken from list_agents in an orchestrator run, otherwise list_crew. Pick the agent whose job title and allowed tools fit the work. Never invent a name.\n3. Code work is test first: a step that writes a failing test, a step that runs it and says what failure to expect, a step that implements, a step that runs the tests and says they pass.\n4. Every step is one action of a few minutes. \"Add error handling\" or \"write tests\" without saying which is not a step.\n5. Name real files. Read the code before planning changes to it; do not guess paths or function names.\n6. Map each acceptance criterion to the task that satisfies it. A criterion no task covers is a gap: add the task.\n7. The last task runs the repository's confirmed checks and ends with a review by the reviewing agent, when one is on the roster.\n8. No placeholders anywhere: no TBD, no \"similar to task 2\", no \"implement the rest\".\n\n## Before submitting\n\nRe-read the plan against the acceptance criteria and the rules above, fix what fails, then submit it.\n\n## Handoff\n\nOnce the plan is written and checked, call ask_user to ask how to carry it out, and wait for the answer before starting any task. If you do not hold ask_user, ask in your reply and stop there. Offer only the ways whose tools you hold or can find with tool_search:\n\n- Sub-agents: each task goes to the agent the plan names, through spawn_agents, or orchestrate where it is offered.\n- Strategy: turn the plan into a multi-model strategy with create_strategy (find it with tool_search if it is not loaded), review it on the canvas, then run it with run_strategy.\n- Here: you carry out the tasks yourself in this conversation, one at a time, ticking each off with todo_write.\n\nRecommend one with a one-sentence reason, based on the plan's shape: many independent tasks suit sub-agents, a multi-model pipeline suits a strategy, a few small tasks suit here. Then wait for the answer.\n",
59
59
  "roles/document-writer/PERSONA.md": "Clear, plain-spoken technical writer. Values accuracy and brevity over flourish.\n",
60
60
  "roles/document-writer/POLICY.yaml": "# A tool NOT named below falls through to mutatingDefault (if it mutates) or\n# defaultPermission. In an unattended daemon run there is nobody to prompt, so\n# `ask` resolves to `deny` -- an omitted mutating tool is simply unavailable,\n# with nothing here saying so. Name what the agent needs.\nversion: 1\nname: role:document-writer\ndefaultPermission: ask\nmutatingDefault: ask\npermissions:\n read_file: allow\n list_files: allow\n search_files: allow\n stat_file: allow\n # The agent's own state: it is told to keep durable notes and, when\n # self-directed, to schedule its own next wake. Both mutate, so both must be\n # named or the agent silently cannot do what its prompt tells it to.\n save_memory: allow\n recall_memory: allow\n kv_get: allow\n kv_set: allow\n schedule_self: allow\n # Room participation. Both are offered only inside a collaboration room, and a\n # room is convened deliberately by a person -- so, like schedule_self, the\n # offer is the authorisation. Without them an agent in a room can neither hand\n # over the floor nor end it, and every room runs to its turn cap, which the\n # room design calls a design failure rather than an ending.\n address_participant: allow\n close_room: allow\n # Attended-only, deliberately: these touch the user's project, not the\n # agent's own state.\n write_file: ask\n create_file: ask\n call_agent: ask\n",
61
61
  "roles/document-writer/ROLE.md": "---\nlabel: Document Writer\njobTitle: Document Writer\ndescription: Drafts and edits clear documentation from the codebase and context.\nsuggestedSkills: []\n---\nWrite clearly and concisely for the intended reader. Ground every claim in the source. Prefer short sentences and concrete examples.\n",
@@ -88,7 +88,7 @@ export const RAW_DEFAULTS = {
88
88
  "crew/marketing-strategist/PERSONA.md": "Direct and commercially minded. Argues from the audience's position rather than the\nseller's.\n",
89
89
  "crew/marketing-strategist/POLICY.yaml": "onViolation: stop\ndefaultPermission: ask\nmutatingDefault: ask\npermissions:\n read_file: allow\n list_files: allow\n search_files: allow\n stat_file: allow\n compile_prompd: allow\n web_search: allow\n save_memory: allow\n recall_memory: allow\n kv_get: allow\n kv_set: allow\nunattended: deny\n",
90
90
  "crew/marketing-strategist/SOUL.md": "Allergic to language that sounds impressive and says nothing. Would rather make one\nsharp claim that some people reject than a broad one nobody remembers.\n",
91
- "crew/orchestrator/AGENT.md": "---\nname: orchestrator\njobTitle: Orchestrator\ndescription: Turns a request into finished, checked work. Sets the task and its acceptance criteria, plans, delegates each step to a specialist and runs the confirmed checks. In a git repository it opens the pull request for a person to merge; anywhere else it reports what changed.\ntags:\n - planning\n - git\ntriggers:\n - type: manual\ncanCall:\n - senior-software-engineer\n - senior-test-engineer\n - code-reviewer\n - document-writer\n - research-analyst\n - generalist\norchestration:\n maxRounds: 3\n maxDelegations: 24\n traceRetentionDays: 30\n---\nYou coordinate; you do not write code. Specialists do the work, commands decide whether it passed, and a person decides what ships. Git is optional: when the work folder is a git repository and you have the git tools, the run ends in a pull request; otherwise the work happens in the folder as it is and the run ends in a report. Follow this loop in order.\n\n1. Readiness. Call set_task with a title, the body, and acceptance criteria: one testable statement each. If the request has no acceptance criteria you can test, set_task refuses. End your turn with specific questions and a proposed set of criteria for the user to confirm. Never invent them. If you have no tool that runs the confirmed checks, no check can run here (checks need a connected sidecar started with --allow-shell, with its checks confirmed in Settings): carry on, and say so in your report. If the acceptance criteria require a check that cannot run, say that plainly in the report.\n\n2. Plan. Call list_agents to see who you may call and what each may do; with many agents, pass a query describing a step (for example \"write tests\") to rank them. Load the writing-plans skill with use_skill and follow it. Follow it only for the plan's content and layout: do not save the plan file yourself and do not offer or wait for an execution choice; submit_plan records the plan and the host writes the file, and you then execute it as described below. Every task needs a `**Agent:** <name>` line naming an agent from list_agents; if the skill you loaded does not ask for one, add it yourself. Submit the whole plan with submit_plan with markdown. It is checked before anyone is asked: fix what it reports and submit again. If the person denies it, ask them what to change; do not resubmit the same plan.\n\n3. Branch. If you have sidecar_git_branch, call it. If it creates the branch, this run follows the git workflow. If it reports that the folder is not a git repository or that git is not installed, this run works without git: go on to step 4 in the folder as it is. If it refuses for any other reason (a dirty working tree, another run holding the folder), report why and stop. If you do not have sidecar_git_branch, work without git.\n\n4. Execute. For each plan task, call_agent with task: its number and a self-contained message: what to change, where, the acceptance criteria it serves, and what to report back. The agent you call cannot see this conversation. After implementation work, run the checks with sidecar_run_check when you have it. A red check goes back to the agent that can fix it, with the failing output. Then call code-reviewer; its findings go back to the implementer. You have a fixed number of review-and-fix rounds per agent: when the limit is reached, stop and report what still fails.\n\n5. Finish. When every check that can run is green and the review has no blocking findings: if this run follows the git workflow, call sidecar_git_commit with a message that says what changed and why, then sidecar_git_push, then sidecar_open_pr with a title and a body that lists the acceptance criteria and the check results, and report the pull request link. If this run works without git, do not call the git tools; finish with a report of what changed: the files touched, taken from the agents' reports. Either way, report the check results (or that no check could run), the rounds used and anything left undone.\n\nA check passes only when sidecar_run_check reports exit code 0; never report a pass on an agent's word. You never merge. A denied push or pull request is final for this run: say so and stop.\n",
91
+ "crew/orchestrator/AGENT.md": "---\nname: orchestrator\njobTitle: Orchestrator\ndescription: Turns a request into finished, checked work. Sets the task and its acceptance criteria, plans, delegates each step to a specialist and runs the confirmed checks. In a git repository it opens the pull request for a person to merge; anywhere else it reports what changed.\ntags:\n - planning\n - git\ntriggers:\n - type: manual\ncanCall:\n - senior-software-engineer\n - senior-test-engineer\n - code-reviewer\n - document-writer\n - research-analyst\n - generalist\norchestration:\n maxRounds: 3\n maxDelegations: 24\n traceRetentionDays: 30\n---\nYou coordinate; you do not write code. Specialists do the work, commands decide whether it passed, and a person decides what ships. Git is optional: when the work folder is a git repository and you have the git tools, the run ends in a pull request; otherwise the work happens in the folder as it is and the run ends in a report. Follow this loop in order.\n\n1. Readiness. Call set_task with a title, the body, and acceptance criteria: one testable statement each. If the request has no acceptance criteria you can test, set_task refuses. End your turn with specific questions and a proposed set of criteria for the user to confirm. Never invent them. If you have no tool that runs the confirmed checks, no check can run here (checks need a connected sidecar started with --allow-shell, with its checks confirmed in Settings): carry on, and say so in your report. If the acceptance criteria require a check that cannot run, say that plainly in the report.\n\n2. Plan. Call list_agents to see who you may call and what each may do; with many agents, pass a query describing a step (for example \"write tests\") to rank them. Load the writing-plans skill with use_skill and follow it. Follow it only for the plan's content and layout: do not save the plan file yourself and do not offer or wait for an execution choice; submit_plan records the plan and the host writes the file, and you then execute it as described below. Every task needs a `**Agent:** <name>` line naming an agent from list_agents; if the skill you loaded does not ask for one, add it yourself. Submit the whole plan with submit_plan with markdown. It is checked before anyone is asked: fix what it reports and submit again. If the person denies it, ask them what to change; do not resubmit the same plan.\n\n3. Branch. If you have sidecar_git_branch, call it (find it with tool_search if it is not loaded). If it creates the branch, this run follows the git workflow. If it reports that the folder is not a git repository or that git is not installed, this run works without git: go on to step 4 in the folder as it is. If it refuses for any other reason (a dirty working tree, another run holding the folder), report why and stop. If tool_search does not find sidecar_git_branch, work without git.\n\n4. Execute. For each plan task, call_agent with task: its number and a self-contained message: what to change, where, the acceptance criteria it serves, and what to report back. The agent you call cannot see this conversation. After implementation work, run the checks with sidecar_run_check when you have it. A red check goes back to the agent that can fix it, with the failing output. Then call code-reviewer; its findings go back to the implementer. You have a fixed number of review-and-fix rounds per agent: when the limit is reached, stop and report what still fails.\n\n5. Finish. When every check that can run is green and the review has no blocking findings: if this run follows the git workflow, call sidecar_git_commit (find the git tools with tool_search if they are not loaded) with a message that says what changed and why, then sidecar_git_push, then sidecar_open_pr with a title and a body that lists the acceptance criteria and the check results, and report the pull request link. If this run works without git, do not call the git tools; finish with a report of what changed: the files touched, taken from the agents' reports. Either way, report the check results (or that no check could run), the rounds used and anything left undone.\n\nA check passes only when sidecar_run_check reports exit code 0; never report a pass on an agent's word. You never merge. A denied push or pull request is final for this run: say so and stop.\n",
92
92
  "crew/orchestrator/PERSONA.md": "Brief and structured. Reports in steps, names who did what, and leads with anything that failed.\n",
93
93
  "crew/orchestrator/POLICY.yaml": "onViolation: stop\ndefaultPermission: ask\nmutatingDefault: ask\npermissions:\n fs:read_file: allow\n fs:list_files: allow\n fs:search_files: allow\n fs:stat_file: allow\n prompd:compile_prompd: allow\n web:web_search: allow\n memory:save_memory: allow\n memory:recall_memory: allow\n memory:kv_get: allow\n memory:kv_set: ask\n set_task: allow\n list_agents: allow\n submit_plan: ask\n agent:call_agent: allow\n sidecar:run_check: allow\n sidecar:git_branch: allow\n sidecar:git_commit: allow\n sidecar:git_push: ask\n sidecar:open_pr: ask\n fs:write_file: deny\n fs:create_file: deny\n fs:rename_file: deny\n fs:delete_file: deny\n prompd:propose_edit: deny\n sidecar:write_file: deny\n sidecar:write_bytes: deny\n sidecar:delete: deny\n sidecar:shell_exec: deny\n shell:spawn: deny\nskills:\n - writing-plans\n - verification-before-completion\nunattended: park\n",
94
94
  "crew/orchestrator/SOUL.md": "Owns the outcome, not the keystrokes. Would rather stop and say what is missing than hand over work it cannot stand behind.\n",
@@ -1 +1 @@
1
- {"version":3,"file":"defaults.generated.js","sourceRoot":"","sources":["../../../prompts/library/defaults.generated.ts"],"names":[],"mappings":"AAAA;;gFAEgF;AAChF,MAAM,CAAC,MAAM,YAAY,GAA2B;IAClD,wBAAwB,EAAE,4iFAA4iF;IACtkF,mBAAmB,EAAE,0PAA0P;IAC/Q,2BAA2B,EAAE,87EAA87E;IAC39E,qCAAqC,EAAE,wuBAAwuB;IAC/wB,aAAa,EAAE,ysBAAysB;IACxtB,mBAAmB,EAAE,soJAAsoJ;IAC3pJ,eAAe,EAAE,krBAAkrB;IACnsB,qBAAqB,EAAE,mZAAmZ;IAC1a,eAAe,EAAE,uVAAuV;IACxW,eAAe,EAAE,6gBAA6gB;IAC9hB,2BAA2B,EAAE,qlBAAqlB;IAClnB,gBAAgB,EAAE,mnCAAmnC;IACroC,cAAc,EAAE,86HAA86H;IAC97H,wBAAwB,EAAE,utBAAutB;IACjvB,wBAAwB,EAAE,q7GAAq7G;IAC/8G,yBAAyB,EAAE,49CAA49C;IACv/C,gBAAgB,EAAE,8hCAA8hC;IAChjC,qBAAqB,EAAE,g7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BAA6lB;IAC1oB,uCAAuC,EAAE,uIAAuI;IAChL,oCAAoC,EAAE,w7CAAw7C;IAC99C,sCAAsC,EAAE,4FAA4F;IACpI,uCAAuC,EAAE,6lBAA6lB;IACtoB,mCAAmC,EAAE,+HAA+H;IACpK,iDAAiD,EAAE,i/IAAi/I;IACpiJ,+CAA+C,EAAE,mgHAAmgH;IACpjH,sDAAsD,EAAE,44FAA44F;IACp8F,uDAAuD,EAAE,0qNAA0qN;IACnuN,yCAAyC,EAAE,ioJAAioJ;IAC5qJ,6CAA6C,EAAE,uwIAAuwI;IACtzI,4CAA4C,EAAE,s0JAAs0J;IACp3J,sDAAsD,EAAE,66IAA66I;IACr+I,+CAA+C,EAAE,2lJAA2lJ;CAC7oJ,CAAC;AAEF,gEAAgE;AAChE,MAAM,CAAC,MAAM,cAAc,GAA2B;IACpD,gBAAgB,EAAE,uvDAAuvD;CAC1wD,CAAC"}
1
+ {"version":3,"file":"defaults.generated.js","sourceRoot":"","sources":["../../../prompts/library/defaults.generated.ts"],"names":[],"mappings":"AAAA;;gFAEgF;AAChF,MAAM,CAAC,MAAM,YAAY,GAA2B;IAClD,wBAAwB,EAAE,4iFAA4iF;IACtkF,mBAAmB,EAAE,0PAA0P;IAC/Q,2BAA2B,EAAE,87EAA87E;IAC39E,qCAAqC,EAAE,wuBAAwuB;IAC/wB,aAAa,EAAE,ysBAAysB;IACxtB,mBAAmB,EAAE,soJAAsoJ;IAC3pJ,eAAe,EAAE,krBAAkrB;IACnsB,qBAAqB,EAAE,mZAAmZ;IAC1a,eAAe,EAAE,uVAAuV;IACxW,eAAe,EAAE,6gBAA6gB;IAC9hB,2BAA2B,EAAE,qlBAAqlB;IAClnB,gBAAgB,EAAE,mnCAAmnC;IACroC,cAAc,EAAE,86HAA86H;IAC97H,wBAAwB,EAAE,utBAAutB;IACjvB,wBAAwB,EAAE,q7GAAq7G;IAC/8G,yBAAyB,EAAE,49CAA49C;IACv/C,gBAAgB,EAAE,8hCAA8hC;IACh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2CAA2C,EAAE,6lBAA6lB;IAC1oB,uCAAuC,EAAE,uIAAuI;IAChL,oCAAoC,EAAE,w7CAAw7C;IAC99C,sCAAsC,EAAE,4FAA4F;IACpI,uCAAuC,EAAE,6lBAA6lB;IACtoB,mCAAmC,EAAE,+HAA+H;IACpK,iDAAiD,EAAE,i/IAAi/I;IACpiJ,+CAA+C,EAAE,mgHAAmgH;IACpjH,sDAAsD,EAAE,44FAA44F;IACp8F,uDAAuD,EAAE,0qNAA0qN;IACnuN,yCAAyC,EAAE,ioJAAioJ;IAC5qJ,6CAA6C,EAAE,uwIAAuwI;IACtzI,4CAA4C,EAAE,s0JAAs0J;IACp3J,sDAAsD,EAAE,66IAA66I;IACr+I,+CAA+C,EAAE,2lJAA2lJ;CAC7oJ,CAAC;AAEF,gEAAgE;AAChE,MAAM,CAAC,MAAM,cAAc,GAA2B;IACpD,gBAAgB,EAAE,uvDAAuvD;CAC1wD,CAAC"}
@@ -1,7 +1,8 @@
1
1
  /** The single source of truth for seeding the config store + resetting a file. */
2
2
  export declare const CONFIG_DEFAULTS: Record<string, string>;
3
3
  /** Per-extension system prompt: file extension -> config path. Excludes base.
4
- * Derived from the systems/system-*.md keys (pure — no bundler glob). */
4
+ * Explicit, not derived from file names: a system doc's stem is not a reliable
5
+ * extension list (system-crew-agent.md is a crew/agent prompt, not a filetype). */
5
6
  export declare const SYSTEM_BY_EXT: Record<string, string>;
6
7
  /** The default selected persona id (matches a personas/<id>.md key). */
7
8
  export declare const DEFAULT_PERSONA = "default";
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../prompts/library/index.ts"],"names":[],"mappings":"AAUA,kFAAkF;AAClF,eAAO,MAAM,eAAe,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAgB,CAAC;AAEpE;yEACyE;AACzE,eAAO,MAAM,aAAa,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAM,CAAC;AASxD,wEAAwE;AACxE,eAAO,MAAM,eAAe,YAAY,CAAC;AAEzC;4EAC4E;AAC5E,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../prompts/library/index.ts"],"names":[],"mappings":"AASA,kFAAkF;AAClF,eAAO,MAAM,eAAe,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAgB,CAAC;AAKpE;;mFAEmF;AACnF,eAAO,MAAM,aAAa,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAIhD,CAAC;AAEF,wEAAwE;AACxE,eAAO,MAAM,eAAe,YAAY,CAAC;AAEzC;4EAC4E;AAC5E,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC"}
@@ -3,26 +3,21 @@
3
3
  * `node generate.mjs` after editing any .md) so this is node-runnable — no Vite
4
4
  * `?raw` / import.meta.glob. CONFIG_DEFAULTS keys are config-workspace paths.
5
5
  *
6
- * `systems/system-<ext...>.md` are auto-mapped to per-filetype system prompts:
7
- * drop one in systems/, regenerate, and (unless it's `system-base`) it registers
8
- * for those extensions. See systemForFile. */
6
+ * `systems/system-<ext...>.md` docs are per-filetype system prompts, but they reach
7
+ * a file only through the explicit SYSTEM_BY_EXT map below. See systemForFile. */
9
8
  import { RAW_DEFAULTS } from './defaults.generated.js';
10
9
  /** The single source of truth for seeding the config store + resetting a file. */
11
10
  export const CONFIG_DEFAULTS = RAW_DEFAULTS;
11
+ /** One prompt serves both prompt file types. */
12
+ const PROMPT_FILE_SYSTEM = 'systems/system-prmd-md.md';
12
13
  /** Per-extension system prompt: file extension -> config path. Excludes base.
13
- * Derived from the systems/system-*.md keys (pure — no bundler glob). */
14
- export const SYSTEM_BY_EXT = {};
15
- for (const configPath of Object.keys(CONFIG_DEFAULTS)) {
16
- if (!configPath.startsWith('systems/system-'))
17
- continue;
18
- const file = configPath.split('/').pop(); // system-prmd-md.md
19
- const stem = file.replace(/^system-/, '').replace(/\.md$/, ''); // prmd-md | pdflow | base
20
- if (stem === 'base')
21
- continue;
22
- for (const ext of stem.split('-'))
23
- if (ext)
24
- SYSTEM_BY_EXT[ext] = configPath;
25
- }
14
+ * Explicit, not derived from file names: a system doc's stem is not a reliable
15
+ * extension list (system-crew-agent.md is a crew/agent prompt, not a filetype). */
16
+ export const SYSTEM_BY_EXT = {
17
+ prmd: PROMPT_FILE_SYSTEM,
18
+ md: PROMPT_FILE_SYSTEM,
19
+ pdflow: 'systems/system-pdflow.md',
20
+ };
26
21
  /** The default selected persona id (matches a personas/<id>.md key). */
27
22
  export const DEFAULT_PERSONA = 'default';
28
23
  /** Prompts the kernel's own enforcement reads. Shipped, never seeded into the
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../prompts/library/index.ts"],"names":[],"mappings":"AAAA;;;;;;;8CAO8C;AAC9C,OAAO,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AAEpD,kFAAkF;AAClF,MAAM,CAAC,MAAM,eAAe,GAA2B,YAAY,CAAC;AAEpE;yEACyE;AACzE,MAAM,CAAC,MAAM,aAAa,GAA2B,EAAE,CAAC;AACxD,KAAK,MAAM,UAAU,IAAI,MAAM,CAAC,IAAI,CAAC,eAAe,CAAC,EAAE,CAAC;IACtD,IAAI,CAAC,UAAU,CAAC,UAAU,CAAC,iBAAiB,CAAC;QAAE,SAAS;IACxD,MAAM,IAAI,GAAG,UAAU,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,GAAG,EAAY,CAAC,CAAU,oBAAoB;IACjF,MAAM,IAAI,GAAG,IAAI,CAAC,OAAO,CAAC,UAAU,EAAE,EAAE,CAAC,CAAC,OAAO,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC,CAAC,0BAA0B;IAC1F,IAAI,IAAI,KAAK,MAAM;QAAE,SAAS;IAC9B,KAAK,MAAM,GAAG,IAAI,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC;QAAE,IAAI,GAAG;YAAE,aAAa,CAAC,GAAG,CAAC,GAAG,UAAU,CAAC;AAC9E,CAAC;AAED,wEAAwE;AACxE,MAAM,CAAC,MAAM,eAAe,GAAG,SAAS,CAAC;AAEzC;4EAC4E;AAC5E,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../prompts/library/index.ts"],"names":[],"mappings":"AAAA;;;;;;kFAMkF;AAClF,OAAO,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AAEpD,kFAAkF;AAClF,MAAM,CAAC,MAAM,eAAe,GAA2B,YAAY,CAAC;AAEpE,gDAAgD;AAChD,MAAM,kBAAkB,GAAG,2BAA2B,CAAC;AAEvD;;mFAEmF;AACnF,MAAM,CAAC,MAAM,aAAa,GAA2B;IACnD,IAAI,EAAE,kBAAkB;IACxB,EAAE,EAAE,kBAAkB;IACtB,MAAM,EAAE,0BAA0B;CACnC,CAAC;AAEF,wEAAwE;AACxE,MAAM,CAAC,MAAM,eAAe,GAAG,SAAS,CAAC;AAEzC;4EAC4E;AAC5E,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC"}
@@ -0,0 +1,17 @@
1
+ import { type EgressSurface, type ModelEgress } from '@corenel/protocol';
2
+ /** The protocol's own surface type (EgressReport), so the two cannot drift. */
3
+ export type { EgressSurface };
4
+ export interface EgressRefusal {
5
+ surface: EgressSurface;
6
+ model: string;
7
+ endpoint: string;
8
+ }
9
+ export interface EgressGuard {
10
+ check(endpointUrl: string, model: string): string | null;
11
+ }
12
+ export declare function createEgressGuard(o: {
13
+ policy: () => ModelEgress;
14
+ onRefused: (e: EgressRefusal) => void;
15
+ surface: EgressSurface;
16
+ }): EgressGuard;
17
+ //# sourceMappingURL=egressGuard.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"egressGuard.d.ts","sourceRoot":"","sources":["../../providers/egressGuard.ts"],"names":[],"mappings":"AAIA,OAAO,EAA0C,KAAK,aAAa,EAAE,KAAK,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAEjH,+EAA+E;AAC/E,YAAY,EAAE,aAAa,EAAE,CAAC;AAC9B,MAAM,WAAW,aAAa;IAAG,OAAO,EAAE,aAAa,CAAC;IAAC,KAAK,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAA;CAAE;AAC1F,MAAM,WAAW,WAAW;IAAG,KAAK,CAAC,WAAW,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAAA;CAAE;AAEzF,wBAAgB,iBAAiB,CAAC,CAAC,EAAE;IACnC,MAAM,EAAE,MAAM,WAAW,CAAC;IAC1B,SAAS,EAAE,CAAC,CAAC,EAAE,aAAa,KAAK,IAAI,CAAC;IACtC,OAAO,EAAE,aAAa,CAAC;CACxB,GAAG,WAAW,CAUd"}
@@ -0,0 +1,26 @@
1
+ /* The one model egress check (fleet slice 2). Kernel-safe: protocol types and
2
+ * functions only, no @prompd/core, no fleet import. The policy is read on every
3
+ * call, so a new fleet document applies to the next request without a restart.
4
+ * A policy read that throws refuses (fail closed). */
5
+ import { checkModelEgress, egressRefusalMessage } from '@corenel/protocol';
6
+ export function createEgressGuard(o) {
7
+ return {
8
+ check(endpointUrl, model) {
9
+ let policy;
10
+ try {
11
+ policy = o.policy();
12
+ }
13
+ catch {
14
+ policy = { allow: [] };
15
+ }
16
+ if (checkModelEgress(policy, endpointUrl, model).ok)
17
+ return null;
18
+ try {
19
+ o.onRefused({ surface: o.surface, model, endpoint: endpointUrl });
20
+ }
21
+ catch { /* a sink never changes a refusal */ }
22
+ return egressRefusalMessage(model, endpointUrl);
23
+ },
24
+ };
25
+ }
26
+ //# sourceMappingURL=egressGuard.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"egressGuard.js","sourceRoot":"","sources":["../../providers/egressGuard.ts"],"names":[],"mappings":"AAAA;;;sDAGsD;AACtD,OAAO,EAAE,gBAAgB,EAAE,oBAAoB,EAAwC,MAAM,mBAAmB,CAAC;AAOjH,MAAM,UAAU,iBAAiB,CAAC,CAIjC;IACC,OAAO;QACL,KAAK,CAAC,WAAW,EAAE,KAAK;YACtB,IAAI,MAAmB,CAAC;YACxB,IAAI,CAAC;gBAAC,MAAM,GAAG,CAAC,CAAC,MAAM,EAAE,CAAC;YAAC,CAAC;YAAC,MAAM,CAAC;gBAAC,MAAM,GAAG,EAAE,KAAK,EAAE,EAAE,EAAE,CAAC;YAAC,CAAC;YAC9D,IAAI,gBAAgB,CAAC,MAAM,EAAE,WAAW,EAAE,KAAK,CAAC,CAAC,EAAE;gBAAE,OAAO,IAAI,CAAC;YACjE,IAAI,CAAC;gBAAC,CAAC,CAAC,SAAS,CAAC,EAAE,OAAO,EAAE,CAAC,CAAC,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,WAAW,EAAE,CAAC,CAAC;YAAC,CAAC;YAAC,MAAM,CAAC,CAAC,oCAAoC,CAAC,CAAC;YACzH,OAAO,oBAAoB,CAAC,KAAK,EAAE,WAAW,CAAC,CAAC;QAClD,CAAC;KACF,CAAC;AACJ,CAAC"}
@@ -1,6 +1,7 @@
1
1
  import OpenAI from 'openai';
2
2
  import type { ChatCompletionMessageParam, ChatCompletionTool } from 'openai/resources/chat/completions';
3
3
  import type { IAuthTokenProvider, Usage } from '@corenel/protocol';
4
+ import type { EgressGuard } from './egressGuard';
4
5
  export type { Usage };
5
6
  export declare function setGatewayBase(url: string): void;
6
7
  export interface StreamCompletionParams {
@@ -68,12 +69,14 @@ export type ModelRoute = {
68
69
  /** A custom provider that lists the model wins, whatever `gateway` says. */
69
70
  export declare function routeForModel(model: string, routing: ModelRouting): ModelRoute;
70
71
  export declare function modelRouteRefusalMessage(model: string): string;
72
+ export declare function localRefusalResponse(message: string): Response;
71
73
  /** A client whose every request is routed by the model it names: to the custom
72
74
  * provider that serves it, else to the gateway when `routing.gateway` is true,
73
75
  * else refused with no request made. Pure data in (no storage reads), so it is
74
76
  * Worker-safe. */
75
77
  export declare function createRoutedChatClient(auth: IAuthTokenProvider, routing: ModelRouting, opts?: {
76
78
  origin?: string;
79
+ onRoute?: (kind: ModelRoute['kind']) => void;
77
80
  }): OpenAI;
78
81
  /** Host-injected model→custom-provider lookup. The kernel transport knows how to
79
82
  * build a custom client but NOT how the host decides which model belongs to one
@@ -106,4 +109,35 @@ export declare function createCustomClient(p: {
106
109
  baseURL: string;
107
110
  apiKey: string;
108
111
  }): OpenAI;
112
+ /** Where one model call goes, decided by the host per request. `url` is the
113
+ * endpoint identity the egress policy names: the Corenel API base (`.../api`,
114
+ * the request goes to `{url}/v1/chat/completions`), or an OpenAI-format base
115
+ * (the request goes to `{url}/chat/completions`, nothing appended). Carries a
116
+ * provider key: never log a value of this type. */
117
+ export type EndpointRoute = {
118
+ api: 'corenel';
119
+ url: string;
120
+ } | {
121
+ api: 'openai';
122
+ url: string;
123
+ apiKey: string;
124
+ };
125
+ export type RouteDecision = {
126
+ ok: true;
127
+ route: EndpointRoute;
128
+ } | {
129
+ ok: false;
130
+ message: string;
131
+ };
132
+ /** A client whose every request is routed by its model, checked by `guard`,
133
+ * and only then sent: to the Corenel gateway with the host token (gatewayRequest),
134
+ * or to an OpenAI-format endpoint with its own key (customRequest, the same
135
+ * request function the routed browser client uses). A refusal of either kind
136
+ * returns before any network I/O. */
137
+ export declare function createGuardedChatClient(o: {
138
+ auth: IAuthTokenProvider;
139
+ origin?: string;
140
+ route: (model: string) => Promise<RouteDecision>;
141
+ guard: EgressGuard;
142
+ }): OpenAI;
109
143
  //# sourceMappingURL=gateway.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"gateway.d.ts","sourceRoot":"","sources":["../../providers/gateway.ts"],"names":[],"mappings":"AAIA,OAAO,MAAM,MAAM,QAAQ,CAAC;AAC5B,OAAO,KAAK,EAAE,0BAA0B,EAAE,kBAAkB,EAAE,MAAM,mCAAmC,CAAC;AACxG,OAAO,KAAK,EAAE,kBAAkB,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAM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;IAAE,GAAG,EAAE,SAAS,CAAC;IAAC,GAAG,EAAE,MAAM,CAAA;CAAE,GAC/B;IAAE,GAAG,EAAE,QAAQ,CAAC;IAAC,GAAG,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,CAAC;AACnD,MAAM,MAAM,aAAa,GAAG;IAAE,EAAE,EAAE,IAAI,CAAC;IAAC,KAAK,EAAE,aAAa,CAAA;CAAE,GAAG;IAAE,EAAE,EAAE,KAAK,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAAE,CAAC;AAIhG;;;;qCAIqC;AACrC,wBAAgB,uBAAuB,CAAC,CAAC,EAAE;IACzC,IAAI,EAAE,kBAAkB,CAAC;IACzB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,OAAO,CAAC,aAAa,CAAC,CAAC;IACjD,KAAK,EAAE,WAAW,CAAC;CACpB,GAAG,MAAM,CAwBT"}
@@ -190,9 +190,13 @@ export function modelRouteRefusalMessage(model) {
190
190
  * while a 4xx is surfaced with its body's message and never retried.
191
191
  * Its body carries LOCAL_FAILURE.refused, so streamCompletion reports it as
192
192
  * "Status 403 (refused locally, nothing was sent): <reason>" -- not as the
193
- * gateway, which was never contacted. */
193
+ * gateway, which was never contacted. Used for routing refusals, egress
194
+ * refusals and a missing provider key alike. */
195
+ export function localRefusalResponse(message) {
196
+ return new Response(JSON.stringify({ error: { message, code: LOCAL_FAILURE.refused } }), { status: 403, headers: { 'content-type': 'application/json' } });
197
+ }
194
198
  function refusalResponse(model) {
195
- return new Response(JSON.stringify({ error: { message: modelRouteRefusalMessage(model), code: LOCAL_FAILURE.refused } }), { status: 403, headers: { 'content-type': 'application/json' } });
199
+ return localRefusalResponse(modelRouteRefusalMessage(model));
196
200
  }
197
201
  /** The request body's `model`, or null when it is not a JSON object naming one. */
198
202
  function modelOfBody(body) {
@@ -273,6 +277,7 @@ export function createRoutedChatClient(auth, routing, opts = {}) {
273
277
  const route = model === null
274
278
  ? (routing.gateway ? { kind: 'gateway' } : { kind: 'refused' })
275
279
  : routeForModel(model, routing);
280
+ opts.onRoute?.(route.kind);
276
281
  if (route.kind === 'refused')
277
282
  return refusalResponse(model ?? '(unnamed)');
278
283
  if (route.kind === 'gateway')
@@ -336,4 +341,40 @@ export function createCustomClient(p) {
336
341
  },
337
342
  });
338
343
  }
344
+ const GUARDED_BASE = 'http://egress-routed.invalid/v1';
345
+ /** A client whose every request is routed by its model, checked by `guard`,
346
+ * and only then sent: to the Corenel gateway with the host token (gatewayRequest),
347
+ * or to an OpenAI-format endpoint with its own key (customRequest, the same
348
+ * request function the routed browser client uses). A refusal of either kind
349
+ * returns before any network I/O. */
350
+ export function createGuardedChatClient(o) {
351
+ return new OpenAI({
352
+ baseURL: GUARDED_BASE,
353
+ apiKey: 'prompd-gateway',
354
+ dangerouslyAllowBrowser: true,
355
+ fetch: async (url, init) => {
356
+ const target = String(url);
357
+ const req = init;
358
+ // The SDK only ever builds URLs under its baseURL; anything else is a
359
+ // programming error, never a destination to guess.
360
+ if (!target.startsWith(GUARDED_BASE))
361
+ throw new Error(`Refusing to route a request outside the chat API base: ${target}`);
362
+ const suffix = target.slice(GUARDED_BASE.length);
363
+ const model = modelOfBody(req?.body);
364
+ if (model === null)
365
+ return localRefusalResponse('Refused: the request names no model (nothing was sent)');
366
+ const decision = await o.route(model);
367
+ if (!decision.ok)
368
+ return localRefusalResponse(decision.message);
369
+ const refusal = o.guard.check(decision.route.url, model);
370
+ if (refusal !== null)
371
+ return localRefusalResponse(refusal);
372
+ const r = decision.route;
373
+ const base = r.url.replace(/\/+$/, '');
374
+ if (r.api === 'corenel')
375
+ return gatewayRequest(o.auth, o.origin ? { origin: o.origin } : {}, `${base}/v1${suffix}`, req);
376
+ return customRequest({ baseURL: base, apiKey: r.apiKey, models: [] }, `${base}${suffix}`, req);
377
+ },
378
+ });
379
+ }
339
380
  //# sourceMappingURL=gateway.js.map
@@ -1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