typeclaw 0.49.0 → 0.51.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 (502) hide show
  1. package/dist/types/agent/attention-escalation.d.ts +18 -0
  2. package/dist/types/agent/auth.d.ts +7 -0
  3. package/dist/types/agent/bash-sandbox-env.d.ts +15 -0
  4. package/dist/types/agent/bash-sandbox-proc.d.ts +8 -0
  5. package/dist/types/agent/bash-sandbox.d.ts +94 -0
  6. package/dist/types/agent/compaction.d.ts +8 -0
  7. package/dist/types/agent/git-nudge.d.ts +6 -0
  8. package/dist/types/agent/guard-types.d.ts +25 -0
  9. package/dist/types/agent/guards.d.ts +7 -0
  10. package/dist/types/agent/idle-compaction.d.ts +8 -0
  11. package/dist/types/agent/index.d.ts +151 -0
  12. package/dist/types/agent/live-subagents.d.ts +113 -0
  13. package/dist/types/agent/llm-replay-sanitizer.d.ts +11 -0
  14. package/dist/types/agent/loop-guard.d.ts +67 -0
  15. package/dist/types/agent/model-fallback.d.ts +29 -0
  16. package/dist/types/agent/model-overrides.d.ts +8 -0
  17. package/dist/types/agent/multimodal/index.d.ts +2 -0
  18. package/dist/types/agent/multimodal/look-at.d.ts +60 -0
  19. package/dist/types/agent/multimodal/looker.d.ts +61 -0
  20. package/dist/types/agent/multimodal/read-redirect.d.ts +6 -0
  21. package/dist/types/agent/network/response-body.d.ts +1 -0
  22. package/dist/types/agent/network/safe-http.d.ts +46 -0
  23. package/dist/types/agent/output-allowance.d.ts +4 -0
  24. package/dist/types/agent/plugin-tools.d.ts +58 -0
  25. package/dist/types/agent/proactive-next-step-nudge.d.ts +2 -0
  26. package/dist/types/agent/prompt-cache-key.d.ts +3 -0
  27. package/dist/types/agent/provider-error.d.ts +23 -0
  28. package/dist/types/agent/reload-tool.d.ts +10 -0
  29. package/dist/types/agent/restart/index.d.ts +31 -0
  30. package/dist/types/agent/restart-handoff/index.d.ts +32 -0
  31. package/dist/types/agent/restart-handoff/paths.d.ts +1 -0
  32. package/dist/types/agent/retry-same-ref.d.ts +41 -0
  33. package/dist/types/agent/reviewer-activity.d.ts +3 -0
  34. package/dist/types/agent/reviewer-bash-policy.d.ts +8 -0
  35. package/dist/types/agent/self.d.ts +1 -0
  36. package/dist/types/agent/session-meta.d.ts +28 -0
  37. package/dist/types/agent/session-origin.d.ts +65 -0
  38. package/dist/types/agent/subagent-cache-keepalive.d.ts +38 -0
  39. package/dist/types/agent/subagent-completion-reminder.d.ts +29 -0
  40. package/dist/types/agent/subagent-drain.d.ts +25 -0
  41. package/dist/types/agent/subagent-session.d.ts +3 -0
  42. package/dist/types/agent/subagents.d.ts +153 -0
  43. package/dist/types/agent/system-prompt-composition.d.ts +17 -0
  44. package/dist/types/agent/system-prompt.d.ts +7 -0
  45. package/dist/types/agent/throttle-circuit.d.ts +25 -0
  46. package/dist/types/agent/todo/continuation-policy.d.ts +54 -0
  47. package/dist/types/agent/todo/continuation-state.d.ts +11 -0
  48. package/dist/types/agent/todo/continuation-wiring.d.ts +32 -0
  49. package/dist/types/agent/todo/continuation.d.ts +21 -0
  50. package/dist/types/agent/todo/scope.d.ts +6 -0
  51. package/dist/types/agent/todo/store.d.ts +16 -0
  52. package/dist/types/agent/tool-error-remediation.d.ts +1 -0
  53. package/dist/types/agent/tool-file-safety.d.ts +78 -0
  54. package/dist/types/agent/tool-not-found-nudge.d.ts +9 -0
  55. package/dist/types/agent/tool-result-budget.d.ts +15 -0
  56. package/dist/types/agent/tools/channel-disengage.d.ts +18 -0
  57. package/dist/types/agent/tools/channel-edit.d.ts +19 -0
  58. package/dist/types/agent/tools/channel-fetch-attachment.d.ts +36 -0
  59. package/dist/types/agent/tools/channel-handoff.d.ts +13 -0
  60. package/dist/types/agent/tools/channel-history-render.d.ts +3 -0
  61. package/dist/types/agent/tools/channel-history.d.ts +25 -0
  62. package/dist/types/agent/tools/channel-log.d.ts +5 -0
  63. package/dist/types/agent/tools/channel-react.d.ts +23 -0
  64. package/dist/types/agent/tools/channel-read.d.ts +27 -0
  65. package/dist/types/agent/tools/channel-reply.d.ts +47 -0
  66. package/dist/types/agent/tools/channel-send.d.ts +42 -0
  67. package/dist/types/agent/tools/channel-session-search.d.ts +10 -0
  68. package/dist/types/agent/tools/curl-impersonate.d.ts +37 -0
  69. package/dist/types/agent/tools/ddg.d.ts +27 -0
  70. package/dist/types/agent/tools/grant-role.d.ts +25 -0
  71. package/dist/types/agent/tools/keyed-semaphore.d.ts +10 -0
  72. package/dist/types/agent/tools/post-github-review.d.ts +38 -0
  73. package/dist/types/agent/tools/restart.d.ts +25 -0
  74. package/dist/types/agent/tools/runtime-notice.d.ts +3 -0
  75. package/dist/types/agent/tools/search-retry.d.ts +16 -0
  76. package/dist/types/agent/tools/skip-response.d.ts +17 -0
  77. package/dist/types/agent/tools/spawn-subagent.d.ts +77 -0
  78. package/dist/types/agent/tools/stream-snapshot.d.ts +23 -0
  79. package/dist/types/agent/tools/subagent-access.d.ts +20 -0
  80. package/dist/types/agent/tools/subagent-cancel.d.ts +23 -0
  81. package/dist/types/agent/tools/subagent-output.d.ts +50 -0
  82. package/dist/types/agent/tools/todo/index.d.ts +14 -0
  83. package/dist/types/agent/tools/webfetch/adaptive-html.d.ts +29 -0
  84. package/dist/types/agent/tools/webfetch/fetch.d.ts +26 -0
  85. package/dist/types/agent/tools/webfetch/html-lexical.d.ts +27 -0
  86. package/dist/types/agent/tools/webfetch/index.d.ts +1 -0
  87. package/dist/types/agent/tools/webfetch/inline-style-visibility.d.ts +3 -0
  88. package/dist/types/agent/tools/webfetch/strategies/grep.d.ts +11 -0
  89. package/dist/types/agent/tools/webfetch/strategies/jq.d.ts +4 -0
  90. package/dist/types/agent/tools/webfetch/strategies/raw.d.ts +1 -0
  91. package/dist/types/agent/tools/webfetch/strategies/readability.d.ts +16 -0
  92. package/dist/types/agent/tools/webfetch/strategies/selector.d.ts +4 -0
  93. package/dist/types/agent/tools/webfetch/strategies/snapshot.d.ts +1 -0
  94. package/dist/types/agent/tools/webfetch/tool.d.ts +15 -0
  95. package/dist/types/agent/tools/webfetch/types.d.ts +32 -0
  96. package/dist/types/agent/tools/websearch.d.ts +17 -0
  97. package/dist/types/agent/tools/wikipedia.d.ts +7 -0
  98. package/dist/types/agent/tools-without-local-file-operands.d.ts +1 -0
  99. package/dist/types/agent/turn-runner.d.ts +36 -0
  100. package/dist/types/agent-messenger/config-dir.d.ts +19 -0
  101. package/dist/types/browser/dockerfile.d.ts +2 -0
  102. package/dist/types/browser/registry.d.ts +49 -0
  103. package/dist/types/bundled-plugins/bun-hygiene/policy.d.ts +18 -0
  104. package/dist/types/bundled-plugins/github-cli-auth/git-askpass.d.ts +5 -0
  105. package/dist/types/bundled-plugins/guard/keys.d.ts +6 -0
  106. package/dist/types/bundled-plugins/guard/policies/managed-config.d.ts +7 -0
  107. package/dist/types/bundled-plugins/guard/policies/memory-topics-delete.d.ts +11 -0
  108. package/dist/types/bundled-plugins/guard/policies/memory-topics-write.d.ts +7 -0
  109. package/dist/types/bundled-plugins/guard/policies/non-workspace-write.d.ts +9 -0
  110. package/dist/types/bundled-plugins/guard/policies/skill-authoring.d.ts +20 -0
  111. package/dist/types/bundled-plugins/guard/policies/uncommitted-changes.d.ts +12 -0
  112. package/dist/types/bundled-plugins/guard/policy.d.ts +11 -0
  113. package/dist/types/bundled-plugins/memory/secret-detector.d.ts +11 -0
  114. package/dist/types/bundled-plugins/memory/slug.d.ts +4 -0
  115. package/dist/types/bundled-plugins/security/permissions.d.ts +20 -0
  116. package/dist/types/bundled-plugins/security/policies/private-surface-read.d.ts +34 -0
  117. package/dist/types/bundled-plugins/security/policies/ssrf.d.ts +18 -0
  118. package/dist/types/bundled-plugins/security/policy.d.ts +4 -0
  119. package/dist/types/channels/adapter-namespace.d.ts +2 -0
  120. package/dist/types/channels/adapters/mention-hints.d.ts +12 -0
  121. package/dist/types/channels/adapters/webex-id-ref.d.ts +5 -0
  122. package/dist/types/channels/background-handoff.d.ts +56 -0
  123. package/dist/types/channels/background-obligations.d.ts +135 -0
  124. package/dist/types/channels/catch-up.d.ts +26 -0
  125. package/dist/types/channels/commands.d.ts +2 -0
  126. package/dist/types/channels/completion-claim.d.ts +20 -0
  127. package/dist/types/channels/continuation-willingness.d.ts +1 -0
  128. package/dist/types/channels/continuity-types.d.ts +75 -0
  129. package/dist/types/channels/describe-error.d.ts +1 -0
  130. package/dist/types/channels/engagement.d.ts +34 -0
  131. package/dist/types/channels/github-false-receipt.d.ts +20 -0
  132. package/dist/types/channels/github-repo.d.ts +2 -0
  133. package/dist/types/channels/github-rereview-guard.d.ts +24 -0
  134. package/dist/types/channels/github-review-check.d.ts +135 -0
  135. package/dist/types/channels/github-review-claim.d.ts +3 -0
  136. package/dist/types/channels/github-review-turn-ledger.d.ts +71 -0
  137. package/dist/types/channels/github-review-verdict-coordinator.d.ts +117 -0
  138. package/dist/types/channels/github-token-bridge.d.ts +20 -0
  139. package/dist/types/channels/github-verdict-activity.d.ts +12 -0
  140. package/dist/types/channels/inbound-journal.d.ts +272 -0
  141. package/dist/types/channels/last-alive.d.ts +3 -0
  142. package/dist/types/channels/membership-cache.d.ts +27 -0
  143. package/dist/types/channels/membership.d.ts +21 -0
  144. package/dist/types/channels/outbound-flood-filter.d.ts +7 -0
  145. package/dist/types/channels/participants.d.ts +4 -0
  146. package/dist/types/channels/persistence.d.ts +32 -0
  147. package/dist/types/channels/recovery-notice.d.ts +26 -0
  148. package/dist/types/channels/recovery-outbox.d.ts +58 -0
  149. package/dist/types/channels/router.d.ts +760 -0
  150. package/dist/types/channels/schema.d.ts +501 -0
  151. package/dist/types/channels/session-handoff.d.ts +58 -0
  152. package/dist/types/channels/session-search.d.ts +29 -0
  153. package/dist/types/channels/types.d.ts +414 -0
  154. package/dist/types/channels/waiting-reactions.d.ts +25 -0
  155. package/dist/types/cli/builtins.d.ts +2 -0
  156. package/dist/types/cli/command-meta.d.ts +9 -0
  157. package/dist/types/coding-agent/broker-body.d.ts +7 -0
  158. package/dist/types/coding-agent/broker.d.ts +22 -0
  159. package/dist/types/coding-agent/claude.d.ts +22 -0
  160. package/dist/types/coding-agent/codex.d.ts +19 -0
  161. package/dist/types/coding-agent/index.d.ts +71 -0
  162. package/dist/types/coding-agent/omo-state.d.ts +2 -0
  163. package/dist/types/coding-agent/omo-stream.d.ts +22 -0
  164. package/dist/types/coding-agent/omo.d.ts +133 -0
  165. package/dist/types/coding-agent/runner.d.ts +35 -0
  166. package/dist/types/coding-agent/tool.d.ts +27 -0
  167. package/dist/types/coding-agent/worktree.d.ts +22 -0
  168. package/dist/types/commands/index.d.ts +45 -0
  169. package/dist/types/config/config.d.ts +827 -0
  170. package/dist/types/config/index.d.ts +3 -0
  171. package/dist/types/config/model-overrides.d.ts +3 -0
  172. package/dist/types/config/providers.d.ts +1458 -0
  173. package/dist/types/config/reloadable.d.ts +9 -0
  174. package/dist/types/container/agent-operation-lock.d.ts +31 -0
  175. package/dist/types/container/build-cache.d.ts +39 -0
  176. package/dist/types/container/compose-project.d.ts +1 -0
  177. package/dist/types/container/controller.d.ts +25 -0
  178. package/dist/types/container/docker-app.d.ts +23 -0
  179. package/dist/types/container/exit-reason.d.ts +10 -0
  180. package/dist/types/container/index.d.ts +14 -0
  181. package/dist/types/container/log-archive.d.ts +68 -0
  182. package/dist/types/container/log-colors.d.ts +3 -0
  183. package/dist/types/container/log-timestamps.d.ts +9 -0
  184. package/dist/types/container/logs.d.ts +37 -0
  185. package/dist/types/container/memory-limit.d.ts +13 -0
  186. package/dist/types/container/memory-oversubscription.d.ts +20 -0
  187. package/dist/types/container/oom-events.d.ts +18 -0
  188. package/dist/types/container/port.d.ts +18 -0
  189. package/dist/types/container/require-running.d.ts +16 -0
  190. package/dist/types/container/restart.d.ts +32 -0
  191. package/dist/types/container/shared.d.ts +93 -0
  192. package/dist/types/container/shell.d.ts +35 -0
  193. package/dist/types/container/start.d.ts +145 -0
  194. package/dist/types/container/stats.d.ts +31 -0
  195. package/dist/types/container/status.d.ts +25 -0
  196. package/dist/types/container/stop.d.ts +24 -0
  197. package/dist/types/container/tool-oom-priority.d.ts +4 -0
  198. package/dist/types/container/verify-running.d.ts +49 -0
  199. package/dist/types/cron/consumer.d.ts +42 -0
  200. package/dist/types/cron/count-state.d.ts +24 -0
  201. package/dist/types/cron/index.d.ts +21 -0
  202. package/dist/types/cron/list.d.ts +33 -0
  203. package/dist/types/cron/reloadable.d.ts +11 -0
  204. package/dist/types/cron/scheduler.d.ts +51 -0
  205. package/dist/types/cron/schema.d.ts +108 -0
  206. package/dist/types/dependencies/bin-resolver.d.ts +28 -0
  207. package/dist/types/dependencies/bins.d.ts +22 -0
  208. package/dist/types/dependencies/index.d.ts +2 -0
  209. package/dist/types/eval/cell.d.ts +26 -0
  210. package/dist/types/eval/config.d.ts +19 -0
  211. package/dist/types/eval/dispatch.d.ts +7 -0
  212. package/dist/types/eval/kernel.d.ts +28 -0
  213. package/dist/types/eval/process.d.ts +23 -0
  214. package/dist/types/eval/protocol.d.ts +34 -0
  215. package/dist/types/eval/sandbox.d.ts +10 -0
  216. package/dist/types/eval/tool.d.ts +17 -0
  217. package/dist/types/eval/wire.d.ts +33 -0
  218. package/dist/types/git/bound-gc-config.d.ts +4 -0
  219. package/dist/types/git/hookless.d.ts +1 -0
  220. package/dist/types/git/reconcile-ignored.d.ts +13 -0
  221. package/dist/types/git/resolve-agent-git.d.ts +8 -0
  222. package/dist/types/git/resolve-identity.d.ts +10 -0
  223. package/dist/types/git/run.d.ts +24 -0
  224. package/dist/types/git/system-commit.d.ts +2 -0
  225. package/dist/types/hostd/client.d.ts +13 -0
  226. package/dist/types/hostd/models.d.ts +1 -0
  227. package/dist/types/hostd/paths.d.ts +17 -0
  228. package/dist/types/hostd/protocol.d.ts +93 -0
  229. package/dist/types/hostd/spawn.d.ts +17 -0
  230. package/dist/types/hostd/version.d.ts +18 -0
  231. package/dist/types/init/auto-upgrade.d.ts +41 -0
  232. package/dist/types/init/cli-version.d.ts +7 -0
  233. package/dist/types/init/dockerfile.d.ts +34 -0
  234. package/dist/types/init/ensure-deps.d.ts +17 -0
  235. package/dist/types/init/env-file.d.ts +3 -0
  236. package/dist/types/init/gitignore.d.ts +5 -0
  237. package/dist/types/init/local-source-stamp.d.ts +3 -0
  238. package/dist/types/init/packagejson.d.ts +7 -0
  239. package/dist/types/init/paths.d.ts +3 -0
  240. package/dist/types/init/reconcile-plugin-deps.d.ts +13 -0
  241. package/dist/types/init/run-bun-install.d.ts +16 -0
  242. package/dist/types/init/windows-dev-link.d.ts +8 -0
  243. package/dist/types/mcp/catalog.d.ts +7 -0
  244. package/dist/types/mcp/client.d.ts +58 -0
  245. package/dist/types/mcp/manager.d.ts +56 -0
  246. package/dist/types/mcp/tools.d.ts +23 -0
  247. package/dist/types/models/embedding-model.d.ts +20 -0
  248. package/dist/types/models/transformers-version.d.ts +1 -0
  249. package/dist/types/network/internal-destinations.d.ts +29 -0
  250. package/dist/types/operations/classify-tool-outcome.d.ts +35 -0
  251. package/dist/types/operations/incidents.d.ts +47 -0
  252. package/dist/types/operations/index.d.ts +3 -0
  253. package/dist/types/operations/remediations.d.ts +25 -0
  254. package/dist/types/path-safety/real-intended-path.d.ts +9 -0
  255. package/dist/types/permissions/builtins.d.ts +25 -0
  256. package/dist/types/permissions/grant.d.ts +19 -0
  257. package/dist/types/permissions/index.d.ts +6 -0
  258. package/dist/types/permissions/match-rule.d.ts +28 -0
  259. package/dist/types/permissions/permissions.d.ts +42 -0
  260. package/dist/types/permissions/resolve.d.ts +25 -0
  261. package/dist/types/permissions/schema.d.ts +14 -0
  262. package/dist/types/plugin/context.d.ts +20 -0
  263. package/dist/types/plugin/core-tool-names.d.ts +4 -0
  264. package/dist/types/plugin/define.d.ts +46 -0
  265. package/dist/types/plugin/hooks.d.ts +52 -0
  266. package/dist/types/plugin/index.d.ts +11 -0
  267. package/dist/types/plugin/load-skill.d.ts +14 -0
  268. package/dist/types/plugin/loader.d.ts +25 -0
  269. package/dist/types/plugin/manager.d.ts +42 -0
  270. package/dist/types/plugin/registry.d.ts +73 -0
  271. package/dist/types/plugin/skills.d.ts +11 -0
  272. package/dist/types/plugin/types.d.ts +336 -0
  273. package/dist/types/plugin/zod-introspect.d.ts +11 -0
  274. package/dist/types/reload/client.d.ts +11 -0
  275. package/dist/types/reload/docker-exec-client.d.ts +11 -0
  276. package/dist/types/reload/format.d.ts +2 -0
  277. package/dist/types/reload/index.d.ts +6 -0
  278. package/dist/types/reload/recover.d.ts +22 -0
  279. package/dist/types/reload/registry.d.ts +10 -0
  280. package/dist/types/reload/types.d.ts +25 -0
  281. package/dist/types/role-claim/client.d.ts +20 -0
  282. package/dist/types/role-claim/code.d.ts +4 -0
  283. package/dist/types/role-claim/controller.d.ts +59 -0
  284. package/dist/types/role-claim/index.d.ts +6 -0
  285. package/dist/types/role-claim/match-rule.d.ts +9 -0
  286. package/dist/types/role-claim/pending.d.ts +35 -0
  287. package/dist/types/role-claim/reload-after-claim.d.ts +16 -0
  288. package/dist/types/run/llm-fetch-observer.d.ts +50 -0
  289. package/dist/types/sandbox/availability.d.ts +21 -0
  290. package/dist/types/sandbox/build.d.ts +7 -0
  291. package/dist/types/sandbox/canonical-secrets.d.ts +8 -0
  292. package/dist/types/sandbox/coding-agent.d.ts +20 -0
  293. package/dist/types/sandbox/dependency-bins.d.ts +19 -0
  294. package/dist/types/sandbox/dev-source.d.ts +4 -0
  295. package/dist/types/sandbox/env-exposure.d.ts +3 -0
  296. package/dist/types/sandbox/errors.d.ts +20 -0
  297. package/dist/types/sandbox/hidden-paths.d.ts +11 -0
  298. package/dist/types/sandbox/index.d.ts +14 -0
  299. package/dist/types/sandbox/package-install.d.ts +1 -0
  300. package/dist/types/sandbox/policy.d.ts +71 -0
  301. package/dist/types/sandbox/privileged-runtime.d.ts +13 -0
  302. package/dist/types/sandbox/quote.d.ts +2 -0
  303. package/dist/types/sandbox/runtime-private.d.ts +1 -0
  304. package/dist/types/sandbox/session-tmp.d.ts +6 -0
  305. package/dist/types/sandbox/symlinks.d.ts +6 -0
  306. package/dist/types/sandbox/writable-zones.d.ts +15 -0
  307. package/dist/types/secrets/coding-agent-auth.d.ts +25 -0
  308. package/dist/types/secrets/defaults.d.ts +21 -0
  309. package/dist/types/secrets/export-github-cli-store.d.ts +22 -0
  310. package/dist/types/secrets/hydrate.d.ts +7 -0
  311. package/dist/types/secrets/index.d.ts +7 -0
  312. package/dist/types/secrets/provision-github-cli-store.d.ts +45 -0
  313. package/dist/types/secrets/refresh-provider-oauth.d.ts +22 -0
  314. package/dist/types/secrets/resolve.d.ts +14 -0
  315. package/dist/types/secrets/schema.d.ts +840 -0
  316. package/dist/types/secrets/storage.d.ts +56 -0
  317. package/dist/types/shared/host-locale.d.ts +1 -0
  318. package/dist/types/shared/index.d.ts +5 -0
  319. package/dist/types/shared/local-time.d.ts +4 -0
  320. package/dist/types/shared/platform.d.ts +2 -0
  321. package/dist/types/shared/protocol.d.ts +424 -0
  322. package/dist/types/shared/style-text.d.ts +3 -0
  323. package/dist/types/shared/wsl.d.ts +17 -0
  324. package/dist/types/stream/broker.d.ts +2 -0
  325. package/dist/types/stream/index.d.ts +2 -0
  326. package/dist/types/stream/types.d.ts +71 -0
  327. package/package.json +13 -6
  328. package/scripts/build-plugin-types.ts +105 -0
  329. package/scripts/check-plugin-sdk.ts +111 -0
  330. package/scripts/require-parallel.ts +5 -32
  331. package/src/agent/bash-sandbox-env.ts +104 -0
  332. package/src/agent/bash-sandbox-proc.ts +70 -0
  333. package/src/agent/bash-sandbox.ts +225 -0
  334. package/src/agent/compaction.ts +22 -10
  335. package/src/agent/guard-types.ts +3 -0
  336. package/src/agent/guards.ts +4 -0
  337. package/src/agent/idle-compaction.ts +178 -0
  338. package/src/agent/index.ts +139 -172
  339. package/src/agent/live-subagents.ts +19 -0
  340. package/src/agent/multimodal/look-at.ts +22 -9
  341. package/src/agent/output-allowance.ts +7 -0
  342. package/src/agent/plugin-tools.ts +39 -377
  343. package/src/agent/reviewer-bash-policy.ts +41 -1
  344. package/src/agent/session-origin.ts +28 -11
  345. package/src/agent/subagent-cache-keepalive.ts +198 -0
  346. package/src/agent/subagent-completion-reminder.ts +2 -2
  347. package/src/agent/subagent-session.ts +6 -0
  348. package/src/agent/subagents.ts +46 -8
  349. package/src/agent/system-prompt-composition.ts +141 -0
  350. package/src/agent/system-prompt.ts +5 -5
  351. package/src/agent/todo/scope.ts +1 -1
  352. package/src/agent/tool-file-safety.ts +6 -1
  353. package/src/agent/tools/channel-edit.ts +20 -10
  354. package/src/agent/tools/channel-fetch-attachment.ts +12 -5
  355. package/src/agent/tools/channel-handoff.ts +72 -0
  356. package/src/agent/tools/channel-read.ts +57 -10
  357. package/src/agent/tools/channel-reply.ts +33 -26
  358. package/src/agent/tools/channel-send.ts +21 -13
  359. package/src/agent/tools/channel-session-search.ts +35 -0
  360. package/src/agent/tools/curl-impersonate.ts +11 -4
  361. package/src/agent/tools/ddg.ts +84 -16
  362. package/src/agent/tools/spawn-subagent.ts +27 -11
  363. package/src/agent/tools/stream-snapshot.ts +15 -2
  364. package/src/agent/tools/subagent-access.ts +11 -4
  365. package/src/agent/tools-without-local-file-operands.ts +4 -0
  366. package/src/browser/bsk-shim.mjs +74 -0
  367. package/src/browser/dockerfile.ts +84 -0
  368. package/src/browser/egress.ts +104 -0
  369. package/src/browser/fill-secret.ts +307 -0
  370. package/src/browser/managed-browser.ts +205 -0
  371. package/src/browser/registry.ts +110 -0
  372. package/src/browser/relay.ts +231 -0
  373. package/src/browser/sandbox-entry.ts +167 -0
  374. package/src/bundled-plugins/agent-browser/index.ts +2 -0
  375. package/src/bundled-plugins/browser-agent/browser-agent.ts +89 -0
  376. package/src/bundled-plugins/browser-agent/index.ts +12 -0
  377. package/src/bundled-plugins/doc-render/index.ts +0 -10
  378. package/src/bundled-plugins/doc-render/render.ts +83 -111
  379. package/src/bundled-plugins/doc-render/skills/typeclaw-render-pdf/SKILL.md +152 -257
  380. package/src/bundled-plugins/explorer/explorer.ts +1 -1
  381. package/src/bundled-plugins/github-cli-auth/gh-command.ts +4 -0
  382. package/src/bundled-plugins/github-cli-auth/gh-review-detect.ts +40 -16
  383. package/src/bundled-plugins/github-cli-auth/git-auth-diagnostic.ts +95 -0
  384. package/src/bundled-plugins/github-cli-auth/graphql-auth-nudge.ts +12 -7
  385. package/src/bundled-plugins/github-cli-auth/index.ts +85 -60
  386. package/src/bundled-plugins/managed-browser/index.ts +179 -0
  387. package/src/bundled-plugins/managed-browser/skills/browser-use/browser-use/SKILL.md +27 -0
  388. package/src/bundled-plugins/managed-browser/skills/browserskill/browserskill/SKILL.md +28 -0
  389. package/src/bundled-plugins/managed-browser/skills/omowright/omowright/SKILL.md +40 -0
  390. package/src/bundled-plugins/memory/dreaming.ts +4 -1
  391. package/src/bundled-plugins/memory/load-memory.ts +2 -4
  392. package/src/bundled-plugins/memory/memory-logger.ts +74 -2
  393. package/src/bundled-plugins/memory/transcript-preload.ts +103 -0
  394. package/src/bundled-plugins/memory/vector/hybrid.ts +25 -14
  395. package/src/bundled-plugins/operator/operator.ts +1 -1
  396. package/src/bundled-plugins/qa/index.ts +11 -0
  397. package/src/bundled-plugins/qa/qa.ts +160 -0
  398. package/src/bundled-plugins/qa/skills/qa-cli.ts +50 -0
  399. package/src/bundled-plugins/qa/skills/qa-general.ts +30 -0
  400. package/src/bundled-plugins/qa/skills/qa-http.ts +39 -0
  401. package/src/bundled-plugins/qa/skills/qa-pr.ts +51 -0
  402. package/src/bundled-plugins/qa/skills/qa-web.ts +49 -0
  403. package/src/bundled-plugins/security/index.ts +53 -34
  404. package/src/bundled-plugins/security/policies/outbound-secret-scan.ts +1 -0
  405. package/src/bundled-plugins/security/policies/private-surface-read.ts +166 -201
  406. package/src/channels/adapter-namespace.ts +13 -0
  407. package/src/channels/adapters/discord-bot-reference.ts +5 -4
  408. package/src/channels/adapters/discord-bot.ts +98 -5
  409. package/src/channels/adapters/discord-classify.ts +8 -3
  410. package/src/channels/adapters/discord.ts +29 -0
  411. package/src/channels/adapters/github/index.ts +16 -0
  412. package/src/channels/adapters/github/last-alive.ts +4 -16
  413. package/src/channels/adapters/slack-attachment-download.ts +14 -3
  414. package/src/channels/adapters/slack-bot-author-resolver.ts +4 -3
  415. package/src/channels/adapters/slack-bot-channel-resolver.ts +9 -6
  416. package/src/channels/adapters/slack-bot-classify.ts +1 -0
  417. package/src/channels/adapters/slack-bot-slash-commands.ts +3 -1
  418. package/src/channels/adapters/slack-bot.ts +299 -67
  419. package/src/channels/adapters/slack-classify.ts +1 -0
  420. package/src/channels/catch-up.ts +137 -0
  421. package/src/channels/continuation-willingness.ts +2 -2
  422. package/src/channels/continuity-types.ts +1 -0
  423. package/src/channels/engagement.ts +17 -1
  424. package/src/channels/github-false-receipt.ts +3 -3
  425. package/src/channels/github-rereview-guard.ts +9 -5
  426. package/src/channels/github-review-check.ts +5 -1
  427. package/src/channels/github-review-verdict-coordinator.ts +68 -2
  428. package/src/channels/github-token-bridge.ts +24 -0
  429. package/src/channels/last-alive.ts +34 -0
  430. package/src/channels/manager.ts +8 -1
  431. package/src/channels/router.ts +515 -243
  432. package/src/channels/session-handoff.fixture.ts +144 -0
  433. package/src/channels/session-handoff.ts +175 -0
  434. package/src/channels/session-search.ts +71 -0
  435. package/src/channels/subagent-completion-bridge.ts +3 -2
  436. package/src/channels/types.ts +12 -2
  437. package/src/cli/channel.ts +2 -3
  438. package/src/cli/hostd.ts +3 -0
  439. package/src/cli/init.ts +2 -3
  440. package/src/cli/model.ts +132 -3
  441. package/src/coding-agent/index.ts +7 -1
  442. package/src/coding-agent/omo-stream.ts +40 -0
  443. package/src/coding-agent/runner.ts +30 -8
  444. package/src/config/config.ts +126 -22
  445. package/src/config/model-overrides.ts +59 -0
  446. package/src/config/models-mutation.ts +185 -2
  447. package/src/config/providers-mutation.ts +12 -4
  448. package/src/config/providers.ts +69 -4
  449. package/src/container/start.ts +132 -5
  450. package/src/doctor/checks.ts +33 -22
  451. package/src/doctor/index.ts +48 -12
  452. package/src/doctor/operational-incidents.ts +16 -1
  453. package/src/doctor/plugin-bridge.ts +14 -1
  454. package/src/doctor/stage.ts +14 -0
  455. package/src/doctor/types.ts +6 -0
  456. package/src/eval/cell.ts +93 -0
  457. package/src/eval/config.ts +32 -0
  458. package/src/eval/dispatch.ts +67 -0
  459. package/src/eval/entry.ts +261 -0
  460. package/src/eval/kernel.ts +154 -0
  461. package/src/eval/process.ts +113 -0
  462. package/src/eval/protocol.ts +26 -0
  463. package/src/eval/redeclare.ts +174 -0
  464. package/src/eval/sandbox.ts +114 -0
  465. package/src/eval/tool.ts +98 -0
  466. package/src/eval/wire.ts +93 -0
  467. package/src/hostd/daemon.ts +13 -1
  468. package/src/init/auto-upgrade.ts +7 -1
  469. package/src/init/dockerfile.ts +57 -12
  470. package/src/init/index.ts +4 -3
  471. package/src/init/local-source-stamp.ts +68 -0
  472. package/src/init/models-dev.ts +4 -0
  473. package/src/init/validate-api-key.ts +3 -0
  474. package/src/operations/classify-tool-outcome.ts +1 -1
  475. package/src/permissions/builtins.ts +7 -0
  476. package/src/permissions/permissions.ts +18 -9
  477. package/src/permissions/resolve.ts +7 -1
  478. package/src/plugin/context.ts +2 -0
  479. package/src/plugin/core-tool-names.ts +6 -1
  480. package/src/plugin/hooks.ts +137 -0
  481. package/src/plugin/index.ts +6 -0
  482. package/src/plugin/manager.ts +4 -0
  483. package/src/plugin/types.ts +60 -0
  484. package/src/run/bundled-plugins.ts +6 -0
  485. package/src/run/index.ts +24 -14
  486. package/src/run/llm-fetch-observer.ts +12 -15
  487. package/src/sandbox/canonical-secrets.ts +4 -0
  488. package/src/sandbox/dev-source.ts +26 -0
  489. package/src/sandbox/env-exposure.ts +20 -0
  490. package/src/sandbox/hidden-paths.ts +16 -2
  491. package/src/secrets/storage.ts +13 -0
  492. package/src/server/index.ts +46 -11
  493. package/src/skills/typeclaw-channel-github/SKILL.md +8 -8
  494. package/src/skills/typeclaw-config/SKILL.md +57 -5
  495. package/src/skills/typeclaw-config/references/dockerfile.md +2 -2
  496. package/src/skills/typeclaw-github-contributing/SKILL.md +1 -1
  497. package/src/skills/typeclaw-monorepo/SKILL.md +1 -1
  498. package/src/skills/typeclaw-permissions/SKILL.md +7 -7
  499. package/src/skills/typeclaw-troubleshooting/SKILL.md +12 -1
  500. package/typeclaw.schema.json +488 -5
  501. package/src/bundled-plugins/doc-render/templates/lib.typ +0 -339
  502. package/src/bundled-plugins/github-cli-auth/gh-store.ts +0 -733
@@ -6,6 +6,7 @@ import { commitSystemFileSync } from '@/git/system-commit'
6
6
  import {
7
7
  configSchema,
8
8
  loadConfigSyncOrDefaults,
9
+ modelOverrideRuleError,
9
10
  validateConfig,
10
11
  type CustomModelMeta,
11
12
  type ThinkingLevel,
@@ -280,6 +281,22 @@ function writeModels(
280
281
  models: RawModels,
281
282
  commitMessage: string,
282
283
  customModel?: { ref: ModelRef; meta: CustomModelMeta },
284
+ ): ModelMutationResult {
285
+ return writeConfig(
286
+ cwd,
287
+ (parsed) => {
288
+ parsed.models = models
289
+ },
290
+ commitMessage,
291
+ customModel,
292
+ )
293
+ }
294
+
295
+ function writeConfig(
296
+ cwd: string,
297
+ mutate: (parsed: Record<string, unknown>) => void,
298
+ commitMessage: string,
299
+ customModel?: { ref: ModelRef; meta: CustomModelMeta },
283
300
  ): ModelMutationResult {
284
301
  const path = join(cwd, CONFIG_FILE)
285
302
  let parsed: Record<string, unknown>
@@ -292,7 +309,7 @@ function writeModels(
292
309
  }
293
310
  return { ok: false, reason: `Failed to read ${CONFIG_FILE}: ${(error as Error).message}` }
294
311
  }
295
- parsed.models = models
312
+ mutate(parsed)
296
313
  if (customModel !== undefined) {
297
314
  const existingCustomModels = isObjectRecord(parsed.customModels) ? parsed.customModels : {}
298
315
  parsed.customModels = { ...existingCustomModels, [customModel.ref]: customModel.meta }
@@ -301,7 +318,7 @@ function writeModels(
301
318
  if (!check.success) {
302
319
  return {
303
320
  ok: false,
304
- reason: `models block would be invalid: ${check.error.issues.map((i) => i.message).join('; ')}`,
321
+ reason: `config would be invalid: ${check.error.issues.map((i) => i.message).join('; ')}`,
305
322
  }
306
323
  }
307
324
  try {
@@ -338,6 +355,172 @@ function writeModels(
338
355
  return { ok: true }
339
356
  }
340
357
 
358
+ export type ModelOverrideListing = {
359
+ name: string
360
+ match: string[]
361
+ profiles: { profile: string; refs: ModelRef[]; thinkingLevel?: ThinkingLevel }[]
362
+ }
363
+
364
+ export function listModelOverrides(cwd: string): ModelOverrideListing[] {
365
+ const overrides = loadConfigSyncOrDefaults(cwd).modelOverrides
366
+ return Object.entries(overrides).map(([name, override]) => ({
367
+ name,
368
+ match: override.match,
369
+ profiles: Object.entries(override.models).map(([profile, entry]) => ({
370
+ profile,
371
+ refs: entry.refs,
372
+ ...(entry.thinkingLevel !== undefined ? { thinkingLevel: entry.thinkingLevel } : {}),
373
+ })),
374
+ }))
375
+ }
376
+
377
+ export type SetOverrideProfileOptions = SetProfileOptions & {
378
+ // Rule added to the override's `match` (creating the override when it doesn't
379
+ // exist yet). Required to create one; optional when it already exists.
380
+ match?: string
381
+ }
382
+
383
+ export function setOverrideProfile(
384
+ cwd: string,
385
+ name: string,
386
+ profile: string,
387
+ ref: string,
388
+ options: SetOverrideProfileOptions = {},
389
+ ): ModelMutationResult {
390
+ const trimmed = profile.trim()
391
+ if (trimmed.length === 0) return { ok: false, reason: 'Profile name cannot be empty.' }
392
+ if (!isModelRef(ref)) {
393
+ return {
394
+ ok: false,
395
+ reason: `Unknown model "${ref}". Run \`typeclaw model list --available\` to see valid options.`,
396
+ }
397
+ }
398
+ if (options.match !== undefined) {
399
+ const ruleError = modelOverrideRuleError(options.match)
400
+ if (ruleError !== undefined) return { ok: false, reason: `Invalid match rule "${options.match}": ${ruleError}` }
401
+ }
402
+ const existing = readOverridesRaw(cwd)[name]
403
+ if (existing === undefined && options.match === undefined) {
404
+ return {
405
+ ok: false,
406
+ reason: `Override "${name}" does not exist. Pass --match <rule> to create it, e.g. --match 'slack:*'.`,
407
+ }
408
+ }
409
+ const providerId = providerForModelRef(ref)
410
+ if (options.force !== true && !hasUsableCredential(cwd, providerId, options.env ?? process.env)) {
411
+ return {
412
+ ok: false,
413
+ reason: `Provider "${providerId}" has no credentials. Run \`typeclaw provider add ${providerId}\` first, or pass --force to write anyway.`,
414
+ }
415
+ }
416
+ const match = existing?.match ?? []
417
+ const models = existing?.models ?? {}
418
+ const level = Object.hasOwn(options, 'thinkingLevel')
419
+ ? options.thinkingLevel
420
+ : rawProfileThinkingLevel(models[trimmed])
421
+ const next: RawOverride = {
422
+ match: options.match !== undefined && !match.includes(options.match) ? [...match, options.match] : match,
423
+ models: { ...models, [trimmed]: withRawProfileThinkingLevel(ref, level) },
424
+ }
425
+ const customModel = !isKnownModelRef(ref) && options.meta !== undefined ? { ref, meta: options.meta } : undefined
426
+ return writeOverride(cwd, name, next, `model: set ${trimmed} → ${ref} in override ${name}`, customModel)
427
+ }
428
+
429
+ // Removing an override's last profile removes the override itself, since an
430
+ // entry with no profiles would be schema-invalid and has nothing to apply.
431
+ export function removeOverrideProfile(cwd: string, name: string, profile: string): ModelMutationResult {
432
+ const existing = readOverridesRaw(cwd)[name]
433
+ if (existing === undefined) return { ok: false, reason: `Override "${name}" not found in ${CONFIG_FILE}.` }
434
+ if (!(profile in existing.models)) {
435
+ return { ok: false, reason: `Profile "${profile}" not found in override "${name}".` }
436
+ }
437
+ const models = { ...existing.models }
438
+ delete models[profile]
439
+ if (Object.keys(models).length === 0) return removeOverride(cwd, name)
440
+ return writeOverride(cwd, name, { ...existing, models }, `model: remove ${profile} from override ${name}`)
441
+ }
442
+
443
+ export function addOverrideMatch(cwd: string, name: string, rule: string): ModelMutationResult {
444
+ const ruleError = modelOverrideRuleError(rule)
445
+ if (ruleError !== undefined) return { ok: false, reason: `Invalid match rule "${rule}": ${ruleError}` }
446
+ const existing = readOverridesRaw(cwd)[name]
447
+ if (existing === undefined) {
448
+ return {
449
+ ok: false,
450
+ reason: `Override "${name}" not found. Create it with \`typeclaw model set <profile> <ref> --override ${name} --match '${rule}'\`.`,
451
+ }
452
+ }
453
+ if (existing.match.includes(rule)) return { ok: true }
454
+ return writeOverride(
455
+ cwd,
456
+ name,
457
+ { ...existing, match: [...existing.match, rule] },
458
+ `model: match ${rule} in override ${name}`,
459
+ )
460
+ }
461
+
462
+ export function removeOverrideMatch(cwd: string, name: string, rule: string): ModelMutationResult {
463
+ const existing = readOverridesRaw(cwd)[name]
464
+ if (existing === undefined) return { ok: false, reason: `Override "${name}" not found in ${CONFIG_FILE}.` }
465
+ if (!existing.match.includes(rule)) return { ok: false, reason: `Rule "${rule}" not found in override "${name}".` }
466
+ if (existing.match.length === 1) {
467
+ return {
468
+ ok: false,
469
+ reason: `"${rule}" is the last rule of override "${name}". Run \`typeclaw model override remove ${name}\` to delete the override.`,
470
+ }
471
+ }
472
+ const match = existing.match.filter((r) => r !== rule)
473
+ return writeOverride(cwd, name, { ...existing, match }, `model: unmatch ${rule} in override ${name}`)
474
+ }
475
+
476
+ export function removeOverride(cwd: string, name: string): ModelMutationResult {
477
+ if (readOverridesRaw(cwd)[name] === undefined) {
478
+ return { ok: false, reason: `Override "${name}" not found in ${CONFIG_FILE}.` }
479
+ }
480
+ return writeConfig(
481
+ cwd,
482
+ (parsed) => {
483
+ const overrides = { ...(isObjectRecord(parsed.modelOverrides) ? parsed.modelOverrides : {}) }
484
+ delete overrides[name]
485
+ parsed.modelOverrides = overrides
486
+ },
487
+ `model: remove override ${name}`,
488
+ )
489
+ }
490
+
491
+ type RawOverride = { match: string[]; models: RawModels }
492
+
493
+ function writeOverride(
494
+ cwd: string,
495
+ name: string,
496
+ override: RawOverride,
497
+ commitMessage: string,
498
+ customModel?: { ref: ModelRef; meta: CustomModelMeta },
499
+ ): ModelMutationResult {
500
+ return writeConfig(
501
+ cwd,
502
+ (parsed) => {
503
+ const overrides = isObjectRecord(parsed.modelOverrides) ? parsed.modelOverrides : {}
504
+ parsed.modelOverrides = { ...overrides, [name]: override }
505
+ },
506
+ commitMessage,
507
+ customModel,
508
+ )
509
+ }
510
+
511
+ // On-disk `modelOverrides` so writers preserve hand-authored profile shapes.
512
+ function readOverridesRaw(cwd: string): Record<string, RawOverride> {
513
+ try {
514
+ const parsed = JSON.parse(readFileSync(join(cwd, CONFIG_FILE), 'utf8')) as {
515
+ modelOverrides?: Record<string, RawOverride>
516
+ }
517
+ return parsed.modelOverrides ?? {}
518
+ } catch (error) {
519
+ if ((error as NodeJS.ErrnoException).code === 'ENOENT') return {}
520
+ throw error
521
+ }
522
+ }
523
+
341
524
  function isObjectRecord(value: unknown): value is Record<string, unknown> {
342
525
  return typeof value === 'object' && value !== null && !Array.isArray(value)
343
526
  }
@@ -4,7 +4,7 @@ import { SecretsBackend, type Secret } from '@/secrets'
4
4
  import { providerKeyDefaultEnv } from '@/secrets/defaults'
5
5
  import type { ProviderCredential, Providers } from '@/secrets/schema'
6
6
 
7
- import { type Models, loadConfigSync } from './config'
7
+ import { type ProfileEntry, loadConfigSync } from './config'
8
8
  import { KNOWN_PROVIDERS, type KnownProviderId, type ModelRef, providerForModelRef } from './providers'
9
9
 
10
10
  // Where a configured credential resolves from at runtime. Reported by
@@ -209,7 +209,7 @@ function readEnvKey(env: NodeJS.ProcessEnv, key: string): string | undefined {
209
209
  return value
210
210
  }
211
211
 
212
- function buildProviderReferenceMap(models: Models | null): Map<string, string[]> {
212
+ function buildProviderReferenceMap(models: Record<string, ProfileEntry> | null): Map<string, string[]> {
213
213
  const out = new Map<string, string[]>()
214
214
  if (models === null) return out
215
215
  for (const [profile, entry] of Object.entries(models)) {
@@ -238,9 +238,17 @@ function safeProviderForRef(ref: ModelRef): KnownProviderId | null {
238
238
  }
239
239
  }
240
240
 
241
- function readModelsOrNull(cwd: string): Models | null {
241
+ // Every profile that can put a provider in use: global `models` plus each
242
+ // `modelOverrides` entry's profiles, labelled `modelOverrides.<name>.<profile>`
243
+ // so removal guards and listings name the override that still needs the provider.
244
+ function readModelsOrNull(cwd: string): Record<string, ProfileEntry> | null {
242
245
  try {
243
- return loadConfigSync(cwd).models
246
+ const config = loadConfigSync(cwd)
247
+ const out: Record<string, ProfileEntry> = { ...config.models }
248
+ for (const [name, override] of Object.entries(config.modelOverrides)) {
249
+ for (const [profile, entry] of Object.entries(override.models)) out[`modelOverrides.${name}.${profile}`] = entry
250
+ }
251
+ return out
244
252
  } catch {
245
253
  return null
246
254
  }
@@ -121,8 +121,12 @@ export const KNOWN_PROVIDERS = {
121
121
  maxTokens: 128000,
122
122
  },
123
123
  // GPT-6 Sol and Luna use Responses because Chat Completions accepts tools
124
- // only at effort `none`. The full map and compat are pi-ai 0.87.1's
124
+ // only at effort `none`. The full map and compat are pi-ai 1.4.0's
125
125
  // catalog values, preserving every documented effort through `max`.
126
+ // With `supportsMidConvoEffort` (pi-ai 1.3.0), API-key requests keep a
127
+ // fixed reasoning.effort and carry the thinking level in
128
+ // configuration_update input items, so a mid-session level change keeps
129
+ // the prompt cache. Sign in with ChatGPT still sends reasoning.effort.
126
130
  'gpt-6-sol': {
127
131
  id: 'gpt-6-sol',
128
132
  name: 'GPT-6 Sol',
@@ -149,6 +153,7 @@ export const KNOWN_PROVIDERS = {
149
153
  supportsAdditionalTools: true,
150
154
  supportsToolSearch: true,
151
155
  supportsMidConvoSystemMessages: true,
156
+ supportsMidConvoEffort: true,
152
157
  supportsExplicitPromptCacheMode: true,
153
158
  },
154
159
  },
@@ -178,6 +183,7 @@ export const KNOWN_PROVIDERS = {
178
183
  supportsAdditionalTools: true,
179
184
  supportsToolSearch: true,
180
185
  supportsMidConvoSystemMessages: true,
186
+ supportsMidConvoEffort: true,
181
187
  supportsExplicitPromptCacheMode: true,
182
188
  },
183
189
  },
@@ -747,8 +753,8 @@ export const KNOWN_PROVIDERS = {
747
753
  apiKeyEnv: 'XAI_API_KEY',
748
754
  oauthProviderId: 'xai',
749
755
  models: {
750
- // pi-ai 0.87.1's xAI catalog caps Grok 4.3 at 30K and maps its efforts;
751
- // `minimal` is not an xAI effort, so it clamps to `low`. The current
756
+ // pi-ai 1.4.0's xAI catalog caps Grok 4.3 at 30K and maps its efforts,
757
+ // including `xhigh`; `minimal` is not an xAI effort, so it clamps to `low`. The current
752
758
  // transport sends model.maxTokens by default, so keep that vendor-safe cap.
753
759
  'grok-4.3': {
754
760
  id: 'grok-4.3',
@@ -767,7 +773,7 @@ export const KNOWN_PROVIDERS = {
767
773
  low: 'low',
768
774
  medium: 'medium',
769
775
  high: 'high',
770
- xhigh: null,
776
+ xhigh: 'xhigh',
771
777
  max: null,
772
778
  },
773
779
  compat: { supportsLongCacheRetention: false },
@@ -1405,6 +1411,60 @@ export const KNOWN_PROVIDERS = {
1405
1411
  },
1406
1412
  },
1407
1413
  },
1414
+ // Inception (Mercury diffusion LLMs) official API. OpenAI-compatible
1415
+ // /v1/chat/completions with Bearer auth, so it goes through pi-ai's
1416
+ // `openai-completions` adapter with a custom baseUrl. api-key only.
1417
+ //
1418
+ // Only Mercury 3 is listed: Mercury 2 / 2.5 are closed to new users as of
1419
+ // 2026-10-19 and shut down for existing ones on 2026-11-15. Mercury Voice is
1420
+ // enterprise-gated, Mercury Decide and Mercury Edit 2 don't serve chat.
1421
+ //
1422
+ // Cost is the standard rate from docs.inceptionlabs.ai/get-started/models
1423
+ // as of 2026-10-20, not the 50%-off launch price, so the record doesn't go
1424
+ // stale when the promotion ends. No cache-write surcharge is published.
1425
+ //
1426
+ // reasoning_effort accepts instant/low/medium/high and defaults to `low`
1427
+ // when omitted. `off` maps to `instant` so a non-reasoning turn really drops
1428
+ // to the fastest mode instead of silently reasoning at the default.
1429
+ //
1430
+ // The OpenAPI spec (api.inceptionlabs.ai/openapi.json) documents neither
1431
+ // `store` nor the `developer` role, and pi-ai doesn't auto-detect compat
1432
+ // for this baseUrl, so both are turned off.
1433
+ inception: {
1434
+ id: 'inception',
1435
+ name: 'Inception (Mercury)',
1436
+ baseUrl: 'https://api.inceptionlabs.ai/v1',
1437
+ auth: ['api-key'],
1438
+ apiKeyEnv: 'INCEPTION_API_KEY',
1439
+ oauthProviderId: null,
1440
+ models: {
1441
+ 'mercury-3': {
1442
+ id: 'mercury-3',
1443
+ name: 'Mercury 3',
1444
+ api: 'openai-completions',
1445
+ provider: 'inception',
1446
+ baseUrl: 'https://api.inceptionlabs.ai/v1',
1447
+ reasoning: true,
1448
+ thinkingLevelMap: {
1449
+ off: 'instant',
1450
+ minimal: 'low',
1451
+ low: 'low',
1452
+ medium: 'medium',
1453
+ high: 'high',
1454
+ xhigh: 'high',
1455
+ },
1456
+ input: ['text'],
1457
+ cost: { input: 0.2, output: 0.7, cacheRead: 0.02, cacheWrite: 0 },
1458
+ contextWindow: 1000000,
1459
+ maxTokens: 131072,
1460
+ compat: {
1461
+ supportsStore: false,
1462
+ supportsDeveloperRole: false,
1463
+ supportsReasoningEffort: true,
1464
+ },
1465
+ },
1466
+ },
1467
+ },
1408
1468
  } as const satisfies Record<string, KnownProvider>
1409
1469
 
1410
1470
  export type KnownProviderId = keyof typeof KNOWN_PROVIDERS
@@ -1492,6 +1552,11 @@ export const KNOWN_PROVIDER_VENDORS = {
1492
1552
  'moonshot-coding': { label: 'Coding Plan', hint: 'Kimi Code subscription' },
1493
1553
  },
1494
1554
  },
1555
+ inception: {
1556
+ id: 'inception',
1557
+ name: 'Inception (Mercury)',
1558
+ providers: ['inception'],
1559
+ },
1495
1560
  // Listed last because it is a reseller, not a lab: a user who knows they want
1496
1561
  // Anthropic should land on the Anthropic row, not the gateway that proxies it.
1497
1562
  opengateway: {
@@ -1,8 +1,8 @@
1
1
  import { randomBytes } from 'node:crypto'
2
- import { accessSync, constants as fsConstants, existsSync, realpathSync } from 'node:fs'
2
+ import { accessSync, constants as fsConstants, existsSync, realpathSync, statSync } from 'node:fs'
3
3
  import { cp, mkdtemp, readFile, rm, writeFile } from 'node:fs/promises'
4
- import { tmpdir } from 'node:os'
5
- import { isAbsolute, join, relative, resolve } from 'node:path'
4
+ import { homedir, tmpdir } from 'node:os'
5
+ import { isAbsolute, join, posix, relative, resolve } from 'node:path'
6
6
 
7
7
  import { migrateAgentMessengerConfigDir, resolveAgentMessengerConfigPolicy } from '@/agent-messenger/config-dir'
8
8
  import { expandMountPath, loadConfigSync, withDefaultPlugins, type Config, type PortForward } from '@/config'
@@ -27,6 +27,7 @@ import { resolveBaseImageVersion, resolveTypeclawSpec, typeclawCheckoutRoot } fr
27
27
  import { buildDockerfile, classifyDockerfileAppend, DOCKERFILE } from '@/init/dockerfile'
28
28
  import { ensureDepsInstalled, type EnsureDepsResult } from '@/init/ensure-deps'
29
29
  import { buildGitignore, GITIGNORE_FILE } from '@/init/gitignore'
30
+ import { localSourceFingerprint, readLocalSourceStamp, writeLocalSourceStamp } from '@/init/local-source-stamp'
30
31
  import { refreshPackageJson } from '@/init/packagejson'
31
32
  import { reconcilePluginDeps } from '@/init/reconcile-plugin-deps'
32
33
  import { runBunUpdate, type UpdateRunner } from '@/init/run-bun-install'
@@ -86,6 +87,35 @@ const CONTAINER_HOSTD_HOST = 'host.docker.internal'
86
87
  const HOST_GATEWAY_ALIAS = `${CONTAINER_HOSTD_HOST}:host-gateway`
87
88
 
88
89
  const MOUNT_TARGET_PREFIX = '/agent/mounts'
90
+ const HOST_FONTS_TARGET_PREFIX = '/usr/share/fonts/host'
91
+
92
+ // Only user-installed folders: macOS `/System/Library/Fonts` is licensed for
93
+ // macOS only and mostly holds system UI fonts no document needs.
94
+ export function resolveHostFontMounts({
95
+ platform,
96
+ home,
97
+ exists = existsSync,
98
+ }: {
99
+ platform: NodeJS.Platform
100
+ home: string
101
+ exists?: (path: string) => boolean
102
+ }): Array<{ src: string; dst: string; readonly: true }> {
103
+ const sources: Array<[string, string]> =
104
+ platform === 'darwin'
105
+ ? [
106
+ ['user', posix.join(home, 'Library', 'Fonts')],
107
+ ['system', '/Library/Fonts'],
108
+ ]
109
+ : platform === 'linux'
110
+ ? [
111
+ ['user', posix.join(home, '.local', 'share', 'fonts')],
112
+ ['system', '/usr/share/fonts'],
113
+ ]
114
+ : []
115
+ return sources
116
+ .filter(([, src]) => exists(src))
117
+ .map(([name, src]) => ({ src, dst: `${HOST_FONTS_TARGET_PREFIX}-${name}`, readonly: true }))
118
+ }
89
119
 
90
120
  export type StartPlan = {
91
121
  containerName: string
@@ -97,6 +127,7 @@ export type StartPlan = {
97
127
  hostPort: number
98
128
  tuiToken: string | null
99
129
  memoryLimitBytes: number
130
+ mountWarnings: string[]
100
131
  }
101
132
 
102
133
  export type PlanStartOptions = {
@@ -120,6 +151,7 @@ export type PlanStartOptions = {
120
151
  // rather than from os.totalmem(). Omitted by callers that have no exec (and
121
152
  // by tests), in which case the default applies unclamped.
122
153
  totalMemoryBytes?: number | undefined
154
+ hostHome?: string
123
155
  }
124
156
 
125
157
  export type HostDaemonControl = {
@@ -380,8 +412,18 @@ async function runStart({
380
412
  }
381
413
  }
382
414
 
383
- const githubCliDeniedRoots = resolveGithubCliDeniedRoots(cwd, await loadTypeclawConfig(cwd))
384
- const githubCliWarning = await refreshGithubCliStore(cwd, githubCliDeniedRoots, provisionGithubCliStoreForAgent)
415
+ const githubCliConfig = await loadTypeclawConfig(cwd)
416
+ if (!githubCliConfig.githubCli.importHostAuth) {
417
+ const removalFailure = removeGithubCliStore(cwd)
418
+ if (removalFailure !== null) return { ok: false, reason: removalFailure }
419
+ }
420
+ const githubCliWarning = githubCliConfig.githubCli.importHostAuth
421
+ ? await refreshGithubCliStore(
422
+ cwd,
423
+ resolveGithubCliDeniedRoots(cwd, githubCliConfig),
424
+ provisionGithubCliStoreForAgent,
425
+ )
426
+ : null
385
427
  if (githubCliWarning !== null) {
386
428
  if (streamOutput) process.stderr.write(githubCliWarning)
387
429
  else onWarning?.(githubCliWarning.trim())
@@ -520,7 +562,14 @@ async function runStart({
520
562
  // version bump (dir already present) or a removal (stale dir left behind)
521
563
  // would otherwise leave bun.lock/node_modules out of sync with the
522
564
  // reconciled package.json.
565
+ //
566
+ // A `file:` dep is a snapshot copy taken at install time, so pulling or
567
+ // editing the checkout leaves the agent running old code until something
568
+ // re-copies it. Fingerprint the checkout and force a reinstall only when it
569
+ // moved since the last install, so routine restarts stay fast.
570
+ const staleLocalFingerprint = await staleLocalTypeclawCopyFingerprint(cwd)
523
571
  const forceDepsReinstall =
572
+ staleLocalFingerprint !== null ||
524
573
  (forceBuild && (await hasLocallyLinkedTypeclawDep(cwd))) ||
525
574
  pluginReconcile.changed ||
526
575
  outcomeRequiresForceInstall(upgrade) ||
@@ -529,6 +578,7 @@ async function runStart({
529
578
  if (!deps.ok) {
530
579
  return { ok: false, reason: `dependency install failed: ${deps.reason}` }
531
580
  }
581
+ if (staleLocalFingerprint !== null) await writeLocalSourceStamp(cwd, staleLocalFingerprint)
532
582
  await commitSystemFile(cwd, DEPENDENCY_FILES, upgradeCommitMessage ?? 'Update dependencies')
533
583
  // Probe buildx up front so the Dockerfile we write matches the builder we
534
584
  // will use. buildx present -> emit the BuildKit Dockerfile and build with
@@ -611,6 +661,11 @@ async function runStart({
611
661
  totalMemoryBytes,
612
662
  })
613
663
 
664
+ for (const warning of plan.mountWarnings) {
665
+ if (onWarning !== undefined) onWarning(warning)
666
+ else if (streamOutput) process.stderr.write(`typeclaw: warning: ${warning}\n`)
667
+ }
668
+
614
669
  if (!skipMemoryOversubscriptionCheck) {
615
670
  await warnOnMemoryOversubscription({
616
671
  exec,
@@ -855,6 +910,22 @@ async function refreshGithubCliStore(
855
910
  )
856
911
  }
857
912
 
913
+ // Without opt-in, a store persisted by an earlier start (when copying was
914
+ // unconditional) still carries the operator's identity. The container exports
915
+ // whatever store secrets.json holds, so a failed removal must stop the launch
916
+ // rather than run the agent as the operator.
917
+ function removeGithubCliStore(agentDir: string): string | null {
918
+ try {
919
+ new SecretsBackend(join(agentDir, 'secrets.json')).removeGithubCliSync()
920
+ return null
921
+ } catch {
922
+ return (
923
+ 'Could not remove the host GitHub CLI credential from secrets.json (githubCli.importHostAuth is off). ' +
924
+ 'Delete the `githubCli` entry from secrets.json by hand, or fix the file if it is malformed, then run typeclaw start again.'
925
+ )
926
+ }
927
+ }
928
+
858
929
  // An unreadable or malformed secrets.json cannot prove the store is absent, so
859
930
  // it takes the warning — silence is reserved for a confirmed no-store agent.
860
931
  function hasPersistedGithubCliStore(agentDir: string): boolean {
@@ -922,6 +993,7 @@ export async function planStart({
922
993
  hostIdentity = currentHostIdentity(),
923
994
  gitIdentity,
924
995
  totalMemoryBytes,
996
+ hostHome = homedir(),
925
997
  }: PlanStartOptions): Promise<StartPlan> {
926
998
  const containerName = containerNameFromCwd(cwd)
927
999
  const imageTag = imageTagFromCwd(cwd)
@@ -1156,12 +1228,24 @@ export async function planStart({
1156
1228
  runArgs.push(...dockerBindMount({ src: devSourcePath, dst: DEV_SOURCE_CONTAINER_PATH, readonly: true }))
1157
1229
  }
1158
1230
 
1231
+ const mountWarnings: string[] = []
1159
1232
  for (const mount of mounts) {
1160
1233
  const hostPath = expandMountPath(mount.path, cwd)
1234
+ const conflict = describeMountTargetConflict(cwd, mount.name, hostPath)
1235
+ if (conflict !== null) {
1236
+ mountWarnings.push(conflict)
1237
+ continue
1238
+ }
1161
1239
  const target = `${MOUNT_TARGET_PREFIX}/${mount.name}`
1162
1240
  runArgs.push(...dockerBindMount({ src: hostPath, dst: target, readonly: mount.readOnly }))
1163
1241
  }
1164
1242
 
1243
+ if (cfg.hostFonts) {
1244
+ for (const fontMount of resolveHostFontMounts({ platform, home: hostHome })) {
1245
+ runArgs.push(...dockerBindMount(fontMount))
1246
+ }
1247
+ }
1248
+
1165
1249
  // Shared model cache mount for embeddings. Vector memory is always on, and
1166
1250
  // the embedder runs with local_files_only inside the container.
1167
1251
  runArgs.push(...dockerBindMount({ src: join(homeRoot(), 'models'), dst: '/opt/models', readonly: true }))
@@ -1179,7 +1263,31 @@ export async function planStart({
1179
1263
  hostPort,
1180
1264
  tuiToken,
1181
1265
  memoryLimitBytes: memoryLimit.bytes,
1266
+ mountWarnings,
1267
+ }
1268
+ }
1269
+
1270
+ // Docker leaves the bind target it created under the agent folder after the
1271
+ // container is gone, so a mount whose source switched between file and directory
1272
+ // collides with that leftover and fails the whole `docker run` ("not a
1273
+ // directory"). Skip just that mount so the agent still boots; deleting the
1274
+ // target is left to the operator because it lives in their agent folder.
1275
+ function describeMountTargetConflict(cwd: string, name: string, hostPath: string): string | null {
1276
+ const target = join(cwd, 'mounts', name)
1277
+ let targetIsDirectory: boolean
1278
+ let sourceIsDirectory: boolean
1279
+ try {
1280
+ targetIsDirectory = statSync(target).isDirectory()
1281
+ sourceIsDirectory = statSync(hostPath).isDirectory()
1282
+ } catch {
1283
+ return null
1182
1284
  }
1285
+ if (targetIsDirectory === sourceIsDirectory) return null
1286
+ const kind = (isDirectory: boolean): string => (isDirectory ? 'a directory' : 'a file')
1287
+ return (
1288
+ `mount "${name}" skipped: ${hostPath} is ${kind(sourceIsDirectory)} but its target ${target} is ` +
1289
+ `${kind(targetIsDirectory)}, so Docker cannot bind it. Remove ${target} and restart to restore the mount.`
1290
+ )
1183
1291
  }
1184
1292
 
1185
1293
  // Surfaces the arithmetic when every agent's cap together exceeds what Docker
@@ -1234,6 +1342,7 @@ export async function refreshDockerfile(
1234
1342
  // path. Mirrors the same gate in writeDockerAssets (src/init/index.ts).
1235
1343
  const devMode = await hasLocallyLinkedTypeclawDep(cwd)
1236
1344
  const next = buildDockerfile(cfg.docker.file, {
1345
+ browser: cfg.browser,
1237
1346
  baseImageVersion: devMode ? null : resolveBaseImageVersion(cwd),
1238
1347
  cjkFontsAuto: hostLocaleIsCjk(),
1239
1348
  buildKit: opts.buildKit,
@@ -1698,6 +1807,24 @@ async function hasLocallyLinkedTypeclawDep(cwd: string): Promise<boolean> {
1698
1807
  return spec !== null && (spec.startsWith('file:') || spec.startsWith('link:'))
1699
1808
  }
1700
1809
 
1810
+ // Returns the checkout's current fingerprint when the agent's `file:` copy of
1811
+ // typeclaw no longer matches it, else null. An install that resolves to the
1812
+ // checkout itself is live and never stale. A symlink alone does not prove that:
1813
+ // bun's isolated linker symlinks into its own store, which is still a copy.
1814
+ async function staleLocalTypeclawCopyFingerprint(cwd: string): Promise<string | null> {
1815
+ if (!(await readTypeclawDepSpec(cwd))?.startsWith('file:')) return null
1816
+ const source = await detectDevSource(cwd)
1817
+ if (source === null) return null
1818
+ try {
1819
+ if (realpathSync(join(cwd, 'node_modules', TYPECLAW_PACKAGE)) === realpathSync(source)) return null
1820
+ } catch {
1821
+ // Not installed yet, or the checkout is missing: fall through to the fingerprint.
1822
+ }
1823
+ const fingerprint = await localSourceFingerprint(source)
1824
+ if (fingerprint === null || fingerprint === (await readLocalSourceStamp(cwd))) return null
1825
+ return fingerprint
1826
+ }
1827
+
1701
1828
  async function readTypeclawDepSpec(cwd: string): Promise<string | null> {
1702
1829
  try {
1703
1830
  const raw = await readFile(join(cwd, PACKAGE_FILE), 'utf8')