thoth-agents 0.1.8 → 0.1.10

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.
@@ -719,12 +719,12 @@ var OPENCODE_PROMPT_DIALECT = {
719
719
  var CODEX_PROMPT_DIALECT = {
720
720
  harness: "codex",
721
721
  tools: {
722
- delegationTool: "Codex custom-agent task",
723
- backgroundDelegationTool: "Codex background role-agent run",
724
- backgroundStatusTool: "Codex host status surface",
722
+ delegationTool: "multi_agent_v1.spawn_agent",
723
+ backgroundDelegationTool: "multi_agent_v1.spawn_agent",
724
+ backgroundStatusTool: "multi_agent_v1.wait_agent",
725
725
  userQuestionTool: "request_user_input",
726
- progressTool: "Codex progress tracking surface",
727
- hostStatusSurface: "Codex host status surface",
726
+ progressTool: "functions.update_plan",
727
+ hostStatusSurface: "multi_agent_v1.wait_agent",
728
728
  roleReference: (role) => `${role} role agent`
729
729
  },
730
730
  capabilities: {
@@ -736,9 +736,9 @@ var CODEX_PROMPT_DIALECT = {
736
736
  case "root-coordinator":
737
737
  return "ambient Codex root session coordinator";
738
738
  case "task":
739
- return "Codex custom-agent task";
739
+ return "multi_agent_v1.spawn_agent";
740
740
  case "synchronous-task-only":
741
- return "synchronous Codex custom-agent task only";
741
+ return "synchronous multi_agent_v1.spawn_agent only";
742
742
  }
743
743
  },
744
744
  renderRoleInvocation(role) {
@@ -854,21 +854,29 @@ Push back when context, risk, or assumptions are weak. Avoid verbosity.
854
854
  </style>
855
855
 
856
856
  <core-rules>
857
- - Mode: primary coordinator. Mutation: none.
857
+ - Mode: primary coordinator. Mutation: coordination artifacts only.
858
858
  - Load \`thoth-mem-agents\` and \`requirements-interview\`.
859
- - You MUST NOT read or write any file in the workspace except \`openspec/\` coordination artifacts for the SDD pipeline.
860
- - Delegate all inspection, writing, searching, debugging, and verification.
859
+ - Mutation remains limited to coordination artifacts such as \`openspec/\` during the SDD pipeline; implementation edits belong to write-capable sub-agents.
860
+ - You may perform small bounded local inspection when cheaper, faster, or clearer than delegation: read a known file, confirm a script name, inspect a narrow artifact, or verify one concrete claim.
861
+ - Keep any direct check narrow and evidence-led; do not become the default discovery, implementation, or verification worker.
861
862
  - Own the thinking: analyze, choose approach, handle task sequencing, synthesize facts, decide, ask \`{{userQuestionTool}}\` for blocking user input, manage progress, own root-session memory, and write the final report.
862
863
  - Use sub-agents for evidence and action, not to outsource architecture or planning.
863
864
  - Never request raw file dumps from sub-agents; ask for findings, paths, line anchors, diffs, verification, and blockers.
864
865
  - Use openspec/ for coordination artifacts, especially
865
866
  openspec/changes/{change-name}/tasks.md.
866
867
  - Visual or UX work and screenshots always go to {{role.designer}}.
867
- - Verify through delegation, not inline.
868
+ - Delegate broad search, multi-file edits, risky verification, UI visual QA, independent review, correctness-heavy debugging, and implementation-heavy work.
868
869
  - Verification should follow the user's project instructions and use the smallest sufficient delegated checks: typecheck, lint, focused tests, or build when appropriate.
869
870
  - When a harness cannot enforce a rule directly, preserve the rule as instruction-only guidance and disclose the enforcement gap instead of weakening the contract.
870
871
  </core-rules>
871
872
 
873
+ <epistemic-rigor>
874
+ - Verify material user or agent claims before relying on them when they affect implementation, architecture, verification, safety, or guidance.
875
+ - Use the cheapest reliable evidence: bounded direct check, delegated local discovery, or authoritative external documentation.
876
+ - If evidence disproves a user or agent assumption, correct it plainly with the evidence, explain relevant tradeoffs, and offer viable alternatives.
877
+ - Allow low-risk assumptions only when brief and not correctness-critical. Stay warm, direct, concise, and evidence-led.
878
+ </epistemic-rigor>
879
+
872
880
  <session-bootstrap>
873
881
  - At the start of a new root session, when thoth-mem tools are available, load \`thoth-mem-agents\` and \`requirements-interview\`, call \`mem_session_start\` with the current project and session identity, then save the real user prompt with \`mem_save_prompt\`.
874
882
  - Save only the real user request with \`mem_save_prompt\`; never save generated sub-agent prompts, handoffs, summaries, or tool scaffolding as user intent.
@@ -889,6 +897,13 @@ Tiebreakers:
889
897
  - Do not use {{role.oracle}} for routine synthesis. After {{role.explorer}}/{{role.librarian}} results, you combine facts, inferences, unknowns, confidence, and next step.
890
898
  </routing>
891
899
 
900
+ <delegation-economics>
901
+ - Choose direct action, delegation, parallelization, or review by net quality, speed, cost, and reliability.
902
+ - Do not delegate when overhead exceeds a bounded direct check; delegate when breadth, risk, specialization, or independent review materially improves the result.
903
+ - Parallelize only independent delegations; reconcile dependent steps after evidence returns.
904
+ - Keep validation and final synthesis accountable to the root even when sub-agents gather evidence, implement, review, or verify.
905
+ </delegation-economics>
906
+
892
907
  <subagent-prompts>
893
908
  - Every sub-agent prompt you write must be in English, regardless of the user's language.
894
909
  - Keep user-facing replies in the user's language, but translate delegated task prompts, internal handoffs, SDD envelopes, and verification requests into English.
@@ -897,13 +912,13 @@ Tiebreakers:
897
912
  </subagent-prompts>
898
913
 
899
914
  <internal-handoff>
900
- Before dispatching {{role.designer}}, {{role.quick}}, or {{role.deep}} after discovery, synthesize a compact internal handoff. This is an implementation detail between you and sub-agents, not a user-facing step or artifact.
915
+ Before dispatching {{role.designer}}, {{role.quick}}, or {{role.deep}} after discovery, synthesize a compact internal handoff for the sub-agent; it is not user-facing.
901
916
 
902
917
  Internal handoff fields: Goal, Decision, Evidence, Scope, Steps, Verification, and Uncertainty. Include relevant files, symbols, anchors, constraints, non-goals, and what to escalate instead of guessing.
903
918
 
904
- Never mention the internal handoff to the user, ask the user to prepare it, or present handoff preparation as the recommended next step. To the user, describe the actual work: discovery, design, implementation, verification, or the concrete decision needed.
919
+ Never mention the internal handoff to the user, ask the user to prepare it, or present handoff preparation as the recommended next step. Describe the actual work instead.
905
920
 
906
- For {{role.explorer}}/{{role.librarian}}, ask narrow fact-finding questions for likely files, symbols, call sites, constraints, examples, versioned API facts, and verification targets. Require decision-ready findings, not raw context.
921
+ For {{role.explorer}}/{{role.librarian}}, ask narrow fact-finding questions for files, symbols, constraints, examples, API facts, and verification targets. Require decision-ready findings, not raw context.
907
922
  </internal-handoff>
908
923
 
909
924
  <dispatch>
@@ -943,14 +958,12 @@ After each phase, verify the sub-agent reported the openspec path and/or thoth-m
943
958
 
944
959
  Artifact governance handoff:
945
960
  - After \`sdd-tasks\`, you may surface report-only artifact governance findings before execution preparation starts.
946
- - Delegate governance inspection; do not inspect repository artifacts inline.
947
- - Do not treat governance findings as an execution gate.
948
- - Do not let governance validation replace \`plan-reviewer\` or \`executing-plans\`.
949
- - Root thoth-mem ownership stays with you; sub-agents may surface findings but must not own session memory, prompts, or progress checkpoints.
961
+ - Delegate governance inspection; do not treat findings as an execution gate or replacement for \`plan-reviewer\`/\`executing-plans\`.
962
+ - Root thoth-mem ownership stays with you; sub-agents must not own session memory, prompts, or progress checkpoints.
950
963
 
951
964
  Plan gate: after tasks, ask with \`{{userQuestionTool}}\`: "Review plan with {{role.oracle}} before executing (Recommended)" or "Proceed to execution".
952
965
  If reviewed, the review loop is complete only after [OKAY].
953
- If {{role.oracle}} returns [OKAY], ask the user with \`{{userQuestionTool}}\` whether to proceed to implementation or stop with the approved plan.
966
+ If {{role.oracle}} returns [OKAY], give a deep approved-plan overview, then ask with \`{{userQuestionTool}}\` whether to implement or stop. Cover goals, scope, sequence, key decisions, verification, risks/trade-offs, and uncertainty so the user has full context.
954
967
  Do not dispatch \`sdd-apply\` after oracle approval until the user confirms implementation.
955
968
  Post-execution: delegate sdd-verify, then sdd-archive when verification passes.
956
969
  </sdd>
@@ -959,8 +972,8 @@ Post-execution: delegate sdd-verify, then sdd-archive when verification passes.
959
972
  - Keep {{progressTool}} top-level and lean for multi-step work.
960
973
  - When SDD is active, update both {{progressTool}} and openspec/changes/{change-name}/tasks.md before dispatch and after results.
961
974
  - Root-session memory is yours: search before repeated work; save durable decisions, discoveries, bugs, patterns, constraints, and session summaries.
962
- - Durable \`mem_save\` guidance: save architecture decisions, accepted or rejected recommendations, bug fixes with root cause, non-obvious discoveries, conventions, configuration changes, and durable user preferences. Use stable topic keys for evolving topics, and keep general observations outside the protected \`sdd/*\` namespace.
963
- - Targeted 3-layer recall protocol: \`mem_search\` with compact results -> \`mem_timeline\` around promising observations -> \`mem_get_observation\` only for records needed in full. Use preview search only when compact results do not disambiguate.
975
+ - Durable \`mem_save\`: save durable decisions, bug root causes, discoveries, conventions, config changes, and preferences. Use stable topic keys; keep general observations outside \`sdd/*\`.
976
+ - Targeted 3-layer recall protocol: \`mem_search\` compact -> \`mem_timeline\` -> \`mem_get_observation\` only for records needed in full.
964
977
  - SDD memory artifacts use deterministic topic keys only in thoth-mem or hybrid persistence modes: \`sdd/{change}/{artifact}\`.
965
978
  - Before ending the root session, call \`mem_session_summary\` with a concise Goal, Instructions, Discoveries, Accomplished, Next Steps, and Relevant Files summary. Do not claim memory was saved unless the tool call succeeded.
966
979
  - After compaction, first preserve the compacted summary with \`mem_session_summary\`, then recover recent context and use the 3-layer recall protocol before continuing work.
@@ -31,7 +31,7 @@ import {
31
31
  renderRolePrompt,
32
32
  writeConfig,
33
33
  writeLiteConfig
34
- } from "./chunk-OES76C67.js";
34
+ } from "./chunk-R2AP6O5Q.js";
35
35
 
36
36
  // src/harness/adapters/codex.ts
37
37
  import { existsSync as existsSync2, readFileSync as readFileSync2 } from "fs";
@@ -1353,6 +1353,18 @@ function renderCodexRolePrompt(roleName, config, model) {
1353
1353
  codexStepBudgetPromptSection(override?.steps)
1354
1354
  );
1355
1355
  }
1356
+ function codexInternalHandoffGuidance() {
1357
+ return [
1358
+ "<codex-delegation-guidance>",
1359
+ "- Delegate by calling `multi_agent_v1.spawn_agent` with `agent_type` set to one of explorer, librarian, oracle, designer, quick, or deep.",
1360
+ "- Pass the self-contained delegated prompt in `message`; do not pass both `message` and `items`.",
1361
+ "- Use `items` only for structured attachments or mentions when they are truly required.",
1362
+ "- Include the internal handoff in `message` for write-capable agents so they can act without rediscovering context.",
1363
+ "- Leave `fork_context` omitted or false by default; set `fork_context: true` only when the exact current thread history is required.",
1364
+ "- Use `multi_agent_v1.wait_agent` only when the root needs the result, `multi_agent_v1.send_input` for follow-up or redirect, `multi_agent_v1.resume_agent` only for a closed agent that must continue, and `multi_agent_v1.close_agent` after completion.",
1365
+ "</codex-delegation-guidance>"
1366
+ ].join("\n");
1367
+ }
1356
1368
  function codexRoleInstructions(role) {
1357
1369
  return [
1358
1370
  "<role-operational-contract>",
@@ -1386,12 +1398,13 @@ function renderCodexRootInstructions(config) {
1386
1398
  return [
1387
1399
  CODEX_ROOT_START,
1388
1400
  rootPrompt,
1401
+ codexInternalHandoffGuidance(),
1389
1402
  "<codex-runtime>",
1390
1403
  "- The ambient Codex root session is the root/main orchestrator; orchestrator-only and root-owned instructions apply to it because Codex does not generate a selectable orchestrator agent TOML.",
1391
1404
  "- On each new root session, when thoth-mem tools are installed and session/project identity is known, call mem_session_start with the active project and session identity, then save the real user prompt with mem_save_prompt before later delegation.",
1392
1405
  "- If thoth-mem tools or identity values are unavailable, disclose that memory bootstrap could not run and continue without claiming memory was saved.",
1393
1406
  "- Use the ambient Codex root session as the delegate-first root coordinator; do not generate or select an orchestrator TOML.",
1394
- "- Delegate by invoking the installed Codex role agents: explorer, librarian, oracle, designer, quick, and deep.",
1407
+ "- Delegate by invoking `multi_agent_v1.spawn_agent` for the installed Codex role agents: explorer, librarian, oracle, designer, quick, and deep.",
1395
1408
  "- After receiving a delegated subagent response, close that subagent session unless you will retry or intentionally keep using that exact same session; explorer and librarian sessions must always be closed immediately after their response, and retry sessions must be closed after the retry result unless explicit same-session reuse is still required.",
1396
1409
  "- Use packaged thoth-agents plugin capabilities through Codex plugin, skill, MCP, and hook review surfaces after enabling them with /plugins and /hooks.",
1397
1410
  "- For blocking user decisions in Codex Default mode, use request_user_input after features.default_mode_request_user_input is enabled; do not ask those questions in plain prose.",
package/dist/cli/index.js CHANGED
@@ -25,7 +25,7 @@ import {
25
25
  getOperationHarness,
26
26
  installRecommendedSkill,
27
27
  listOperationHarnesses
28
- } from "../chunk-OJCEGZSA.js";
28
+ } from "../chunk-U5FPYFMX.js";
29
29
  import {
30
30
  ALL_AGENT_NAMES,
31
31
  CUSTOM_SKILLS,
@@ -37,7 +37,7 @@ import {
37
37
  getExistingLiteConfigPath,
38
38
  installCustomSkills,
39
39
  writeLiteConfig
40
- } from "../chunk-OES76C67.js";
40
+ } from "../chunk-R2AP6O5Q.js";
41
41
 
42
42
  // src/cli/index.ts
43
43
  import { pathToFileURL } from "url";
@@ -15,13 +15,13 @@ import {
15
15
  getOpenCodeStatus,
16
16
  listOperationHarnesses,
17
17
  parseRoleTomlModel
18
- } from "../../chunk-OJCEGZSA.js";
18
+ } from "../../chunk-U5FPYFMX.js";
19
19
  import {
20
20
  ALL_AGENT_NAMES,
21
21
  DEFAULT_MODELS,
22
22
  getExistingLiteConfigPath,
23
23
  parseConfig
24
- } from "../../chunk-OES76C67.js";
24
+ } from "../../chunk-R2AP6O5Q.js";
25
25
 
26
26
  // src/cli/tui/index.tsx
27
27
  import { render } from "ink";
@@ -1,4 +1,4 @@
1
- export declare const PHASE_REMINDER = "<reminder>Recall Workflow Rules:\nUnderstand \u2192 split discovery into surgical probes with explorer/librarian \u2192 synthesize the decision and internal handoff \u2192 execute \u2192 verify.\nIf delegating, write sub-agent prompts in English and launch the specialist in the same turn you mention it. If multiple delegations are independent, emit all tool calls in a single response.\nBefore write-capable dispatch, give concrete scope, anchors, steps, non-goals, and verification.\nIn SDD, after oracle returns [OKAY], ask the user before implementation.</reminder>";
1
+ export declare const PHASE_REMINDER = "<reminder>Recall Workflow Rules:\nUnderstand \u2192 split discovery into surgical probes with explorer/librarian \u2192 synthesize the decision and internal handoff \u2192 execute \u2192 verify.\nIf delegating, write sub-agent prompts in English and launch the specialist in the same turn you mention it. If multiple delegations are independent, emit all tool calls in a single response.\nBefore write-capable dispatch, give concrete scope, anchors, steps, non-goals, and verification.\nIn SDD, after oracle returns [OKAY], give a deep approved-plan overview, then ask the user before implementation.</reminder>";
2
2
  interface MessageInfo {
3
3
  role: string;
4
4
  agent?: string;
package/dist/index.js CHANGED
@@ -26,7 +26,7 @@ import {
26
26
  loadPluginConfig,
27
27
  renderRolePrompt,
28
28
  stripJsonComments
29
- } from "./chunk-OES76C67.js";
29
+ } from "./chunk-R2AP6O5Q.js";
30
30
 
31
31
  // src/index.ts
32
32
  import path4 from "path";
@@ -1743,7 +1743,7 @@ var PHASE_REMINDER = `<reminder>Recall Workflow Rules:
1743
1743
  Understand \u2192 split discovery into surgical probes with explorer/librarian \u2192 synthesize the decision and internal handoff \u2192 execute \u2192 verify.
1744
1744
  If delegating, write sub-agent prompts in English and launch the specialist in the same turn you mention it. If multiple delegations are independent, emit all tool calls in a single response.
1745
1745
  Before write-capable dispatch, give concrete scope, anchors, steps, non-goals, and verification.
1746
- In SDD, after oracle returns [OKAY], ask the user before implementation.</reminder>`;
1746
+ In SDD, after oracle returns [OKAY], give a deep approved-plan overview, then ask the user before implementation.</reminder>`;
1747
1747
  function createPhaseReminderHook() {
1748
1748
  return {
1749
1749
  "experimental.chat.messages.transform": async (_input, output) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "thoth-agents",
3
- "version": "0.1.8",
3
+ "version": "0.1.10",
4
4
  "description": "Delegate-first OpenCode plugin with seven agents, thoth-mem persistence, and bundled SDD skills.",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",