thoth-agents 0.13.0 → 0.13.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -52,8 +52,8 @@ verification you can follow—without manually coordinating every agent.
52
52
  successful; see [provider outcomes](docs/installation.md#thoth-mem-companion-setup).
53
53
 
54
54
  > [!NOTE]
55
- > OpenCode is the CLI's default harness. Pi is our recommendation for the best
56
- > Thoth-Agents experience. All four harnesses share the workflow and role design,
55
+ > OpenCode is the CLI's default harness, fully supported on OpenCode v2 (`>=2.2.6`).
56
+ > All four harnesses share the workflow and role design,
57
57
  > but their permissions, delegation, and runtime capabilities are not identical.
58
58
  > Your harness's trust and approval rules still apply.
59
59
 
@@ -68,7 +68,7 @@ The commands below install at **global/user scope**.
68
68
  | <a href="https://github.com/anomalyco/opencode"><picture><source media="(prefers-color-scheme: dark)" srcset="https://svgl.app/library/opencode-dark.svg"><img src="https://svgl.app/library/opencode.svg" alt="OpenCode logo" width="48" height="48"></picture></a><br>**OpenCode** | OpenCode >=2.2.6 native v2 plugin, package skills, agent team, and memory setup. | `npx thoth-agents@latest install --agent=opencode` |
69
69
  | <a href="https://github.com/openai/codex"><img src="https://github.com/openai.png?size=120" alt="OpenAI logo — Codex" width="48" height="48"></a><br>**Codex** | Native plugin plus the required global agent and instruction setup. **Close Codex first.** | `npx thoth-agents@latest install --agent=codex` |
70
70
  | <a href="https://claude.com/product/claude-code"><img src="https://github.com/anthropics.png?size=120" alt="Anthropic logo — Claude Code" width="48" height="48"></a><br>**Claude Code** | Marketplace agents and skills, completed by the CLI's external skills and memory setup. | `npx thoth-agents@latest install --agent=claude` |
71
- | <a href="https://github.com/earendil-works/pi"><img src="https://raw.githubusercontent.com/EremesNG/thoth-mem/master/img/pi.svg" alt="Pi logo" width="48" height="48"></a><br>**Pi** | Native package, five specialists, delegation, research, theme, sidebar and background-task extensions, workflow skills, and memory setup. **Recommended for the best experience.** | `npx thoth-agents@latest install --agent=pi` |
71
+ | <a href="https://github.com/earendil-works/pi"><img src="https://raw.githubusercontent.com/EremesNG/thoth-mem/master/img/pi.svg" alt="Pi logo" width="48" height="48"></a><br>**Pi** | Native package, five specialists, delegation, research, theme, sidebar and background-task extensions, workflow skills, and memory setup. | `npx thoth-agents@latest install --agent=pi` |
72
72
 
73
73
  Codex hooks require your trust; installation does not silently grant it. Consent
74
74
  during setup, or review and trust them in Codex via `/hooks` or the startup
@@ -109,7 +109,8 @@ direct calls, independently controlled by `enable_ask_orchestrator` and
109
109
  `enable_notify_orchestrator` (default true, global/project cascade) and denials. See
110
110
  [tool selection controls](docs/installation.md#configure-specialist-tools-inside-pi).
111
111
 
112
- Pi setup currently supports the default `~/.pi/agent` root. See the
112
+ Pi setup requires **Pi `>=1.5.0`** and currently supports the default
113
+ `~/.pi/agent` root. See the
113
114
  [Pi installation guide](docs/installation.md#pi) for runtime requirements,
114
115
  existing-package conflicts, and recovery. Thoth manages its separate Pi
115
116
  delegation runtime as package `@thoth-agents/pi-subagents` through
@@ -122,6 +123,19 @@ points Pi at the fork under `pi-packages/pi-subagents`; publishing the fork is
122
123
  not required for that path. Pi extensions run with your user's system
123
124
  permissions; agent tool allowlists are not an OS sandbox.
124
125
 
126
+ ### Optional OpenCode multi-account plugin (manual install)
127
+
128
+ [`@thoth-agents/opencode-multi-codex`](opencode-packages/opencode-multi-codex/README.md)
129
+ lets you use ChatGPT accounts concurrently: account 1 uses `openai`,
130
+ with additional accounts exposed as numbered providers such as `openai-codex-2`.
131
+ Pin agents to different accounts, inspect quota, and rotate around usage-limit
132
+ 429s. Manage accounts with `/codex-add`, `/codex-remove`, `/codex-switch`, and
133
+ `/codex-status`.
134
+
135
+ Install it separately using the package guide; the thoth-agents CLI does **not**
136
+ install or manage it. It requires OpenCode's legacy ChatGPT/Codex OAuth login;
137
+ API keys and the newer ChatGPT token-sharing flow are not supported.
138
+
125
139
  ### Optional Pi extensions (manual install)
126
140
 
127
141
  The installer does **not** install or manage the Claude/Antigravity bridges,
@@ -150,7 +164,7 @@ for both `claude-bridge` and `antigravity`. See
150
164
 
151
165
  ### Pi package inventory
152
166
 
153
- The eleven first-party `@thoth-agents/pi-*` packages are:
167
+ The twelve first-party `@thoth-agents/pi-*` packages are:
154
168
 
155
169
  | Package | Setup |
156
170
  | --- | --- |
@@ -158,6 +172,7 @@ The eleven first-party `@thoth-agents/pi-*` packages are:
158
172
  | [`@thoth-agents/pi-askcodex`](pi-packages/pi-askcodex/README.md) | Optional/manual |
159
173
  | [`@thoth-agents/pi-background-tasks`](pi-packages/pi-background-tasks/README.md) | Installer-managed |
160
174
  | [`@thoth-agents/pi-claude-bridge`](pi-packages/pi-claude-bridge/README.md) | Optional/manual |
175
+ | [`@thoth-agents/pi-contained-shell`](pi-packages/pi-contained-shell/README.md) | Installer-managed |
161
176
  | [`@thoth-agents/pi-core`](pi-packages/pi-core/README.md) | Shared library; not installer-managed |
162
177
  | [`@thoth-agents/pi-openai-fast`](pi-packages/pi-openai-fast/README.md) | Optional/manual |
163
178
  | [`@thoth-agents/pi-questions-user`](pi-packages/pi-questions-user/README.md) | Installer-managed |
@@ -290,6 +305,14 @@ Use the interactive CLI to inspect setup and configure role models:
290
305
  npx thoth-agents@latest
291
306
  ```
292
307
 
308
+ Other CLI commands (run with `npx thoth-agents@latest <command>`):
309
+
310
+ - `list`: list managed surfaces and actions.
311
+ - `sync`: preview managed configuration sync.
312
+ - `model`: preview role model/provider settings.
313
+
314
+ Add `--apply` to apply a reviewed `sync` or `model` plan.
315
+
293
316
  Choose models your harness and provider account can access. OpenCode ships the
294
317
  **`openai` model profile**. Run `/subagents-model` inside OpenCode to edit named
295
318
  model/variant profiles for all six roles, including orchestrator. Selection is
@@ -329,11 +352,13 @@ diagnostics. To remove attributable Codex surfaces, preview with
329
352
  to apply.
330
353
 
331
354
  For Pi, the first-party `thoth-agents` package remains exact and receipt-verified.
332
- The nine selected extensions use stable minimum-only `>=` ranges, so
355
+ The nine selected external packages use stable minimum-only `>=` ranges, so
333
356
  Pi's native package manager can update them independently without waiting for a
334
357
  Thoth release. Install and applied Update now include
335
358
  `@thoth-agents/pi-thoth-theme`, `@thoth-agents/pi-background-tasks` and
336
- `@thoth-agents/pi-sidebar` at `>=0.3.0`.
359
+ `@thoth-agents/pi-sidebar` at `>=0.3.0`, plus
360
+ `@thoth-agents/pi-contained-shell` at `>=0.1.0` for Windows shell containment
361
+ (a no-op on other platforms).
337
362
  Existing copies of these three packages from any source are preserved and verified
338
363
  without reinstalling when compatible; older copies are left untouched and block
339
364
  completion with manual upgrade guidance. Ambiguous sources fail closed. Status
@@ -350,17 +375,27 @@ The status line uses `thoth:subagents:usage`, not the removed raw
350
375
  `>=0.3.0` together and `/reload` to retain subagent cost display; the usage
351
376
  checkpoint discriminator is unchanged.
352
377
 
378
+ In Pi, `/thoth-theme` opens settings for icons, animation intensity, tool density,
379
+ and module toggles. Visual settings apply live; module toggles require `/reload`.
380
+ Opt-in `tools.collapsed` settings (`frame` | `compact` | `line`) let you keep framed
381
+ cards or use compact tool rows, including subagent and todo cards. Expanded output
382
+ is unchanged. See the [theme guide](pi-packages/pi-thoth-theme/README.md).
383
+
353
384
  The shared Pi Work panel uses pi-core's v2 data-only provider contract and
354
385
  [discovery/action API](pi-packages/pi-core/README.md#discovery-and-actions).
355
386
  Upgrade pi-subagents, pi-background-tasks and pi-todo together to `>=0.3.0`, then
356
387
  `/reload`; first-owner arbitration hides incompatible sections in mixed v1/v2
357
388
  installs. Subagent state is v2; background state, usage, requests and Render KIT remain v1.
389
+ Todos support grouping, ordering, and archiving in compact views; completed-row
390
+ limits preserve pending work. A compact Work summary remains visible when another
391
+ component replaces the editor.
358
392
 
359
393
  The [Pi sidebar](pi-packages/pi-sidebar/README.md) adds read-only Session,
360
394
  Workspace, Cost and discovered Todos/Subagents/Background panels in fullscreen and
361
395
  regular mode. `/sidebar` toggles, `/sidebar panels` lists ids for show/hide/order
362
- commands, and `/sidebar resize` resizes. `/sidebar settings` edits panel order,
363
- visibility, startup and default width; `/sidebar cost` opens task-cost curves
396
+ commands. Todo rows share compact counts with Work, group by status, and respect
397
+ archive and completed-row limits. `/sidebar resize` resizes. `/sidebar settings`
398
+ edits panel order, visibility, startup and default width; `/sidebar cost` opens task-cost curves
364
399
  against elapsed time per task, labeled by display name or a short task-summary name.
365
400
  Themed Agents/Background headers show static status-icon counts, omitting zero
366
401
  counts (Todos keeps completed/total), and detail commands; Workspace shows a
@@ -374,8 +409,12 @@ state v2 adds up to 100 cost-ranked persisted session summaries in `history`. Pr
374
409
  have guarded fallback; regular mode covers the live viewport, not historical
375
410
  scrollback. Update related extensions together to avoid mixed old UI owners.
376
411
 
377
- Pi's question UI replaces the editor without covering chat. `Ctrl+]` collapses it
378
- to a one-line dock and returns input to the editor; during an active run, `Enter`
412
+ Pi's question UI replaces the editor without covering chat. Panels size to content,
413
+ capped at 45% of terminal height. Narrow previews start collapsed; `p` toggles them
414
+ outside editors, and Alt+arrow keys scroll context. Tool `context` is limited to
415
+ 500 characters; longer proposals belong in the response before the question.
416
+ `Ctrl+]` collapses the question UI to a one-line dock and returns input to the
417
+ editor; during an active run, `Enter`
379
418
  queues a steering message without answering the question. `Ctrl+]` re-expands
380
419
  with answers and drafts preserved, and the open tool-call card shows collapsed
381
420
  state. While open, `Ctrl+]` shadows editor `jumpForward`; collapsed `Esc` belongs
@@ -950,6 +950,17 @@ function detectCurrentConfig() {
950
950
 
951
951
  // src/config/loader.ts
952
952
  var PROMPTS_DIR_NAME = "thoth-agents";
953
+ function withoutInjectedDefaults(parsed, raw) {
954
+ if (parsed === null || typeof parsed !== "object" || Array.isArray(parsed) || raw === null || typeof raw !== "object") {
955
+ return parsed;
956
+ }
957
+ return Object.fromEntries(
958
+ Object.entries(parsed).filter(([key]) => Object.hasOwn(raw, key)).map(([key, value]) => [
959
+ key,
960
+ withoutInjectedDefaults(value, raw[key])
961
+ ])
962
+ );
963
+ }
953
964
  function loadConfigFromPath(configPath, unsupportedKeyPaths) {
954
965
  try {
955
966
  const content = fs2.readFileSync(configPath, "utf-8");
@@ -963,7 +974,7 @@ function loadConfigFromPath(configPath, unsupportedKeyPaths) {
963
974
  console.warn(result.error.format());
964
975
  return null;
965
976
  }
966
- return result.data;
977
+ return withoutInjectedDefaults(result.data, rawConfig);
967
978
  } catch (error) {
968
979
  if (error instanceof Error && "code" in error && error.code !== "ENOENT") {
969
980
  console.warn(
@@ -988,9 +999,9 @@ function findConfigPath(basePath) {
988
999
  function deepMerge(base, override) {
989
1000
  if (!base) return override;
990
1001
  if (!override) return base;
991
- const result = { ...base };
1002
+ const result = Object.assign(/* @__PURE__ */ Object.create(null), base);
992
1003
  for (const key of Object.keys(override)) {
993
- const baseVal = base[key];
1004
+ const baseVal = Object.hasOwn(base, key) ? base[key] : void 0;
994
1005
  const overrideVal = override[key];
995
1006
  if (typeof baseVal === "object" && baseVal !== null && typeof overrideVal === "object" && overrideVal !== null && !Array.isArray(baseVal) && !Array.isArray(overrideVal)) {
996
1007
  result[key] = deepMerge(
@@ -1030,7 +1041,16 @@ function loadPluginConfig(directory) {
1030
1041
  `[thoth-agents] Config keys preset/presets are unsupported and ignored (${[...unsupportedKeyPaths].join(", ")}).`
1031
1042
  );
1032
1043
  }
1033
- return config;
1044
+ const result = PluginConfigSchema.safeParse(config);
1045
+ if (!result.success) {
1046
+ const sourcePaths = [userConfigPath, projectConfigPath].filter(Boolean);
1047
+ console.warn(
1048
+ `[thoth-agents] Invalid merged config from ${sourcePaths.join(", ")}:`
1049
+ );
1050
+ console.warn(result.error.format());
1051
+ return {};
1052
+ }
1053
+ return result.data;
1034
1054
  }
1035
1055
  function loadAgentPrompt(agentName) {
1036
1056
  const promptsDir = path2.join(getConfigDir(), PROMPTS_DIR_NAME);
@@ -1259,37 +1279,37 @@ var AGENT_ROLES = [
1259
1279
  mode: "write-capable",
1260
1280
  dispatch: "task",
1261
1281
  canMutateWorkspace: true,
1262
- scope: "UI/UX decisions, implementation, and visual verification",
1263
- responsibility: "Own user-facing implementation choices and visual quality for UI work.",
1282
+ scope: "UI/UX and creative/artistic decisions, implementation, and verification",
1283
+ responsibility: "Own UI/UX, creative/artistic output, and aesthetic quality.",
1264
1284
  useWhen: [
1265
- "User-facing UI/UX, interaction, accessibility, or visual quality is material."
1285
+ "Material UI/UX, interaction, accessibility, visual quality, or creative/artistic work: visual style, motion/animation, layouts/levels/maps, characters, visual/audio assets, branding, creative copy, narrative."
1266
1286
  ],
1267
1287
  doNotUseWhen: [
1268
- "Not for backend-only, non-visual, or correctness-heavy cross-cutting work."
1288
+ "Not for engineering-only or correctness-heavy cross-cutting work."
1269
1289
  ],
1270
1290
  escalateWhen: [
1271
1291
  "Escalate coupled contracts, migrations, or high risk to worker."
1272
1292
  ],
1273
1293
  toolGovernance: [
1274
- "may edit focused UI/UX files",
1275
- "owns screenshots and visual QA",
1294
+ "may edit focused UI/UX and creative/artistic files",
1295
+ "owns visual and creative QA, including screenshots",
1276
1296
  "does not delegate further"
1277
1297
  ],
1278
- verification: ["includes visual verification when applicable"]
1298
+ verification: ["includes visual and creative verification when applicable"]
1279
1299
  },
1280
1300
  {
1281
1301
  name: "worker",
1282
1302
  mode: "write-capable",
1283
1303
  dispatch: "task",
1284
1304
  canMutateWorkspace: true,
1285
- scope: "bounded nonvisual implementation and verification",
1286
- responsibility: "Handle bounded nonvisual implementation with full local context, including exact low-risk edits and correctness-critical, multi-file, edge-case-heavy, or high-risk work.",
1305
+ scope: "bounded engineering implementation and verification",
1306
+ responsibility: "Handle bounded engineering implementation (business logic, backend, systems, mechanic scripts, calculations, AI) with full local context, including exact low-risk edits and correctness-critical, multi-file, edge-case-heavy, or high-risk work.",
1287
1307
  useWhen: [
1288
- "Known bounded nonvisual implementation is ready, regardless of complexity; root direct work is limited to the bounded implementation-ownership exceptions.",
1308
+ "Known bounded engineering implementation, regardless of complexity; root direct work only under bounded implementation-ownership exceptions.",
1289
1309
  "Correctness-critical work may be multi-file, edge-case-heavy, migration, concurrency, shared-contract, or high-risk."
1290
1310
  ],
1291
1311
  doNotUseWhen: [
1292
- "Not for visual-only work, reviewed commits, or work explicitly retained by the user in root."
1312
+ "Not for visual-only or artistic/creative work, reviewed commits, or work explicitly retained by the user in root."
1293
1313
  ],
1294
1314
  escalateWhen: ["Return product or architecture choices to root."],
1295
1315
  toolGovernance: [
@@ -1321,7 +1341,8 @@ var IMPLEMENTATION_OWNERSHIP_POLICY = {
1321
1341
  "Direct-work exceptions: known low-risk mechanical work (reviewed commits included), no rediscovery; minimal authorized low-risk edits with known scope/verification, no discovery/independent judgment."
1322
1342
  ],
1323
1343
  writerRouting: [
1324
- "Known bounded implementation: directly to designer/worker, no mandatory Explorer; librarian: external evidence; Oracle: independent judgment; no fixed all-role pipeline."
1344
+ "Known bounded implementation: directly to designer/worker, no mandatory Explorer; librarian: external evidence; Oracle: independent judgment; no fixed all-role pipeline.",
1345
+ "Split mixed creative/engineering units between designer and worker with an agreed interface. User/root spec owns system/game rules and balance; worker implements."
1325
1346
  ],
1326
1347
  evidenceHandling: [
1327
1348
  "Conclusions/localized evidence/uncertainty, not files/source/log dumps; next action only from Oracle/Worker/Designer. Never repeat delegated discovery; fill gaps via targeted requests or bounded identified-evidence inspection. Independent verification stays mandatory."
@@ -1442,7 +1463,7 @@ function cloneReturnContract(contract) {
1442
1463
  var VERIFICATION_PROTOCOL = [
1443
1464
  "Completion reports identify changed files and verification evidence.",
1444
1465
  "Behavior changes receive the smallest sufficient automated check or a declared manual check.",
1445
- "Visual changes receive designer-owned visual QA when applicable."
1466
+ "Visual and creative output receives designer-owned visual and creative QA when applicable."
1446
1467
  ];
1447
1468
  var AGENT_PACK_CONTRACT = {
1448
1469
  roles: [...AGENT_ROLES],
@@ -2398,8 +2419,9 @@ var ROLE_SPECIFIC_RULES = {
2398
2419
  "Reject self-review: implementing root/writer cannot substitute for independent oracle judgment."
2399
2420
  ],
2400
2421
  designer: [
2401
- "Own user-facing choices, implementation, and visual verification.",
2402
- "Check relevant responsive and interaction states when feasible."
2422
+ "Own UI/UX and creative/artistic choices, implementation, and verification.",
2423
+ "Check relevant responsive and interaction states when feasible. Self-check creative assets for intent/style consistency.",
2424
+ "Use the creative tools the harness or project provides; report a capability gap otherwise."
2403
2425
  ],
2404
2426
  worker: [
2405
2427
  "Start at supplied entrypoints; read further only to resolve a concrete missing fact. Use tests first for behavior changes.",
@@ -2557,7 +2579,7 @@ function getRoleModelProfile(role) {
2557
2579
  case "oracle":
2558
2580
  return "Challenge assumptions and return evidence-backed judgment.";
2559
2581
  case "designer":
2560
- return "Make concrete UX choices and verify the visible result.";
2582
+ return "Make concrete UX and creative choices; verify intent/style consistency.";
2561
2583
  case "worker":
2562
2584
  return "Trace shared behavior, test assumptions, and verify edge cases.";
2563
2585
  }
@@ -19,15 +19,14 @@ import {
19
19
  renderAgentRoutingDescription,
20
20
  renderPromptSection,
21
21
  renderRolePrompt
22
- } from "./chunk-YCWGTDFE.js";
22
+ } from "./chunk-5ANFI4LW.js";
23
23
 
24
24
  // src/harness/writers/pi-agent.ts
25
25
  var PI_MANAGED_OWNER = "thoth-agents";
26
26
  var PI_ROOT_START = "<!-- thoth-agents:pi-root:start -->";
27
27
  var PI_ROOT_END = "<!-- thoth-agents:pi-root:end -->";
28
28
  var LIBRARIAN_RESEARCH_TOOLS = [
29
- "resolve-library-id",
30
- "query-docs",
29
+ "mcp__context7",
31
30
  "mcp",
32
31
  "web_search",
33
32
  "fetch_content",
@@ -855,7 +854,7 @@ function diagnostics() {
855
854
  code: "pi.mcp.adapter-backed",
856
855
  harness: "pi",
857
856
  surface: "grep.app",
858
- message: "Pi has no generic native MCP client in this contract; only grep.app is exposed through pi-mcp-adapter, while Context7 and pi-web-access remain native extensions.",
857
+ message: "Pi has no generic native MCP client in this contract; grep.app and Context7 are exposed through pi-mcp-adapter, while pi-web-access remains a native extension.",
859
858
  fallback: "diagnostic-only"
860
859
  }
861
860
  ];