typeclaw 0.49.0 → 0.50.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 (442) 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/compaction.d.ts +8 -0
  4. package/dist/types/agent/git-nudge.d.ts +6 -0
  5. package/dist/types/agent/guard-types.d.ts +25 -0
  6. package/dist/types/agent/guards.d.ts +7 -0
  7. package/dist/types/agent/idle-compaction.d.ts +7 -0
  8. package/dist/types/agent/index.d.ts +163 -0
  9. package/dist/types/agent/live-subagents.d.ts +113 -0
  10. package/dist/types/agent/llm-replay-sanitizer.d.ts +11 -0
  11. package/dist/types/agent/loop-guard.d.ts +67 -0
  12. package/dist/types/agent/model-fallback.d.ts +29 -0
  13. package/dist/types/agent/model-overrides.d.ts +8 -0
  14. package/dist/types/agent/multimodal/index.d.ts +2 -0
  15. package/dist/types/agent/multimodal/look-at.d.ts +60 -0
  16. package/dist/types/agent/multimodal/looker.d.ts +61 -0
  17. package/dist/types/agent/multimodal/read-redirect.d.ts +6 -0
  18. package/dist/types/agent/network/response-body.d.ts +1 -0
  19. package/dist/types/agent/network/safe-http.d.ts +46 -0
  20. package/dist/types/agent/plugin-tools.d.ts +129 -0
  21. package/dist/types/agent/proactive-next-step-nudge.d.ts +2 -0
  22. package/dist/types/agent/prompt-cache-key.d.ts +3 -0
  23. package/dist/types/agent/provider-error.d.ts +23 -0
  24. package/dist/types/agent/reload-tool.d.ts +10 -0
  25. package/dist/types/agent/restart/index.d.ts +31 -0
  26. package/dist/types/agent/restart-handoff/index.d.ts +32 -0
  27. package/dist/types/agent/restart-handoff/paths.d.ts +1 -0
  28. package/dist/types/agent/retry-same-ref.d.ts +41 -0
  29. package/dist/types/agent/reviewer-activity.d.ts +3 -0
  30. package/dist/types/agent/reviewer-bash-policy.d.ts +8 -0
  31. package/dist/types/agent/self.d.ts +1 -0
  32. package/dist/types/agent/session-meta.d.ts +28 -0
  33. package/dist/types/agent/session-origin.d.ts +65 -0
  34. package/dist/types/agent/subagent-cache-keepalive.d.ts +38 -0
  35. package/dist/types/agent/subagent-completion-reminder.d.ts +29 -0
  36. package/dist/types/agent/subagent-drain.d.ts +25 -0
  37. package/dist/types/agent/subagent-session.d.ts +3 -0
  38. package/dist/types/agent/subagents.d.ts +153 -0
  39. package/dist/types/agent/system-prompt.d.ts +7 -0
  40. package/dist/types/agent/throttle-circuit.d.ts +25 -0
  41. package/dist/types/agent/todo/continuation-policy.d.ts +54 -0
  42. package/dist/types/agent/todo/continuation-state.d.ts +11 -0
  43. package/dist/types/agent/todo/continuation-wiring.d.ts +32 -0
  44. package/dist/types/agent/todo/continuation.d.ts +21 -0
  45. package/dist/types/agent/todo/scope.d.ts +6 -0
  46. package/dist/types/agent/todo/store.d.ts +16 -0
  47. package/dist/types/agent/tool-error-remediation.d.ts +1 -0
  48. package/dist/types/agent/tool-file-safety.d.ts +78 -0
  49. package/dist/types/agent/tool-not-found-nudge.d.ts +9 -0
  50. package/dist/types/agent/tool-result-budget.d.ts +15 -0
  51. package/dist/types/agent/tools/channel-disengage.d.ts +18 -0
  52. package/dist/types/agent/tools/channel-edit.d.ts +19 -0
  53. package/dist/types/agent/tools/channel-fetch-attachment.d.ts +36 -0
  54. package/dist/types/agent/tools/channel-handoff.d.ts +13 -0
  55. package/dist/types/agent/tools/channel-history-render.d.ts +3 -0
  56. package/dist/types/agent/tools/channel-history.d.ts +25 -0
  57. package/dist/types/agent/tools/channel-log.d.ts +5 -0
  58. package/dist/types/agent/tools/channel-react.d.ts +23 -0
  59. package/dist/types/agent/tools/channel-read.d.ts +27 -0
  60. package/dist/types/agent/tools/channel-reply.d.ts +47 -0
  61. package/dist/types/agent/tools/channel-send.d.ts +42 -0
  62. package/dist/types/agent/tools/channel-session-search.d.ts +10 -0
  63. package/dist/types/agent/tools/curl-impersonate.d.ts +37 -0
  64. package/dist/types/agent/tools/ddg.d.ts +18 -0
  65. package/dist/types/agent/tools/grant-role.d.ts +25 -0
  66. package/dist/types/agent/tools/keyed-semaphore.d.ts +10 -0
  67. package/dist/types/agent/tools/post-github-review.d.ts +38 -0
  68. package/dist/types/agent/tools/restart.d.ts +25 -0
  69. package/dist/types/agent/tools/runtime-notice.d.ts +3 -0
  70. package/dist/types/agent/tools/search-retry.d.ts +16 -0
  71. package/dist/types/agent/tools/skip-response.d.ts +17 -0
  72. package/dist/types/agent/tools/spawn-subagent.d.ts +77 -0
  73. package/dist/types/agent/tools/stream-snapshot.d.ts +23 -0
  74. package/dist/types/agent/tools/subagent-access.d.ts +20 -0
  75. package/dist/types/agent/tools/subagent-cancel.d.ts +23 -0
  76. package/dist/types/agent/tools/subagent-output.d.ts +50 -0
  77. package/dist/types/agent/tools/todo/index.d.ts +14 -0
  78. package/dist/types/agent/tools/webfetch/adaptive-html.d.ts +29 -0
  79. package/dist/types/agent/tools/webfetch/fetch.d.ts +26 -0
  80. package/dist/types/agent/tools/webfetch/html-lexical.d.ts +27 -0
  81. package/dist/types/agent/tools/webfetch/index.d.ts +1 -0
  82. package/dist/types/agent/tools/webfetch/inline-style-visibility.d.ts +3 -0
  83. package/dist/types/agent/tools/webfetch/strategies/grep.d.ts +11 -0
  84. package/dist/types/agent/tools/webfetch/strategies/jq.d.ts +4 -0
  85. package/dist/types/agent/tools/webfetch/strategies/raw.d.ts +1 -0
  86. package/dist/types/agent/tools/webfetch/strategies/readability.d.ts +16 -0
  87. package/dist/types/agent/tools/webfetch/strategies/selector.d.ts +4 -0
  88. package/dist/types/agent/tools/webfetch/strategies/snapshot.d.ts +1 -0
  89. package/dist/types/agent/tools/webfetch/tool.d.ts +15 -0
  90. package/dist/types/agent/tools/webfetch/types.d.ts +32 -0
  91. package/dist/types/agent/tools/websearch.d.ts +17 -0
  92. package/dist/types/agent/tools/wikipedia.d.ts +7 -0
  93. package/dist/types/agent/tools-without-local-file-operands.d.ts +1 -0
  94. package/dist/types/agent/turn-runner.d.ts +36 -0
  95. package/dist/types/agent-messenger/config-dir.d.ts +19 -0
  96. package/dist/types/browser/dockerfile.d.ts +2 -0
  97. package/dist/types/browser/registry.d.ts +49 -0
  98. package/dist/types/bundled-plugins/bun-hygiene/policy.d.ts +18 -0
  99. package/dist/types/bundled-plugins/github-cli-auth/git-askpass.d.ts +5 -0
  100. package/dist/types/bundled-plugins/guard/keys.d.ts +6 -0
  101. package/dist/types/bundled-plugins/guard/policies/managed-config.d.ts +7 -0
  102. package/dist/types/bundled-plugins/guard/policies/memory-topics-delete.d.ts +11 -0
  103. package/dist/types/bundled-plugins/guard/policies/memory-topics-write.d.ts +7 -0
  104. package/dist/types/bundled-plugins/guard/policies/non-workspace-write.d.ts +9 -0
  105. package/dist/types/bundled-plugins/guard/policies/skill-authoring.d.ts +20 -0
  106. package/dist/types/bundled-plugins/guard/policies/uncommitted-changes.d.ts +12 -0
  107. package/dist/types/bundled-plugins/guard/policy.d.ts +11 -0
  108. package/dist/types/bundled-plugins/memory/secret-detector.d.ts +11 -0
  109. package/dist/types/bundled-plugins/memory/slug.d.ts +4 -0
  110. package/dist/types/bundled-plugins/security/permissions.d.ts +20 -0
  111. package/dist/types/bundled-plugins/security/policies/private-surface-read.d.ts +34 -0
  112. package/dist/types/bundled-plugins/security/policies/ssrf.d.ts +18 -0
  113. package/dist/types/bundled-plugins/security/policy.d.ts +4 -0
  114. package/dist/types/channels/adapter-namespace.d.ts +2 -0
  115. package/dist/types/channels/adapters/mention-hints.d.ts +12 -0
  116. package/dist/types/channels/adapters/webex-id-ref.d.ts +5 -0
  117. package/dist/types/channels/background-handoff.d.ts +56 -0
  118. package/dist/types/channels/background-obligations.d.ts +135 -0
  119. package/dist/types/channels/catch-up.d.ts +26 -0
  120. package/dist/types/channels/commands.d.ts +2 -0
  121. package/dist/types/channels/completion-claim.d.ts +20 -0
  122. package/dist/types/channels/continuation-willingness.d.ts +1 -0
  123. package/dist/types/channels/continuity-types.d.ts +75 -0
  124. package/dist/types/channels/describe-error.d.ts +1 -0
  125. package/dist/types/channels/engagement.d.ts +34 -0
  126. package/dist/types/channels/github-false-receipt.d.ts +20 -0
  127. package/dist/types/channels/github-repo.d.ts +2 -0
  128. package/dist/types/channels/github-rereview-guard.d.ts +24 -0
  129. package/dist/types/channels/github-review-check.d.ts +135 -0
  130. package/dist/types/channels/github-review-claim.d.ts +3 -0
  131. package/dist/types/channels/github-review-turn-ledger.d.ts +71 -0
  132. package/dist/types/channels/github-review-verdict-coordinator.d.ts +117 -0
  133. package/dist/types/channels/github-token-bridge.d.ts +20 -0
  134. package/dist/types/channels/github-verdict-activity.d.ts +12 -0
  135. package/dist/types/channels/inbound-journal.d.ts +272 -0
  136. package/dist/types/channels/last-alive.d.ts +3 -0
  137. package/dist/types/channels/membership-cache.d.ts +27 -0
  138. package/dist/types/channels/membership.d.ts +21 -0
  139. package/dist/types/channels/outbound-flood-filter.d.ts +7 -0
  140. package/dist/types/channels/participants.d.ts +4 -0
  141. package/dist/types/channels/persistence.d.ts +32 -0
  142. package/dist/types/channels/recovery-notice.d.ts +26 -0
  143. package/dist/types/channels/recovery-outbox.d.ts +58 -0
  144. package/dist/types/channels/router.d.ts +798 -0
  145. package/dist/types/channels/schema.d.ts +501 -0
  146. package/dist/types/channels/session-handoff.d.ts +58 -0
  147. package/dist/types/channels/session-search.d.ts +29 -0
  148. package/dist/types/channels/types.d.ts +414 -0
  149. package/dist/types/channels/waiting-reactions.d.ts +25 -0
  150. package/dist/types/cli/builtins.d.ts +2 -0
  151. package/dist/types/cli/command-meta.d.ts +9 -0
  152. package/dist/types/coding-agent/broker-body.d.ts +7 -0
  153. package/dist/types/coding-agent/broker.d.ts +22 -0
  154. package/dist/types/coding-agent/claude.d.ts +22 -0
  155. package/dist/types/coding-agent/codex.d.ts +19 -0
  156. package/dist/types/coding-agent/index.d.ts +71 -0
  157. package/dist/types/coding-agent/omo-state.d.ts +2 -0
  158. package/dist/types/coding-agent/omo-stream.d.ts +22 -0
  159. package/dist/types/coding-agent/omo.d.ts +133 -0
  160. package/dist/types/coding-agent/runner.d.ts +35 -0
  161. package/dist/types/coding-agent/tool.d.ts +27 -0
  162. package/dist/types/coding-agent/worktree.d.ts +22 -0
  163. package/dist/types/commands/index.d.ts +45 -0
  164. package/dist/types/config/config.d.ts +814 -0
  165. package/dist/types/config/index.d.ts +3 -0
  166. package/dist/types/config/model-overrides.d.ts +3 -0
  167. package/dist/types/config/providers.d.ts +1456 -0
  168. package/dist/types/config/reloadable.d.ts +9 -0
  169. package/dist/types/container/agent-operation-lock.d.ts +31 -0
  170. package/dist/types/container/build-cache.d.ts +39 -0
  171. package/dist/types/container/compose-project.d.ts +1 -0
  172. package/dist/types/container/controller.d.ts +25 -0
  173. package/dist/types/container/docker-app.d.ts +23 -0
  174. package/dist/types/container/exit-reason.d.ts +10 -0
  175. package/dist/types/container/index.d.ts +14 -0
  176. package/dist/types/container/log-archive.d.ts +68 -0
  177. package/dist/types/container/log-colors.d.ts +3 -0
  178. package/dist/types/container/log-timestamps.d.ts +9 -0
  179. package/dist/types/container/logs.d.ts +37 -0
  180. package/dist/types/container/memory-limit.d.ts +13 -0
  181. package/dist/types/container/memory-oversubscription.d.ts +20 -0
  182. package/dist/types/container/oom-events.d.ts +18 -0
  183. package/dist/types/container/port.d.ts +18 -0
  184. package/dist/types/container/require-running.d.ts +16 -0
  185. package/dist/types/container/restart.d.ts +32 -0
  186. package/dist/types/container/shared.d.ts +93 -0
  187. package/dist/types/container/shell.d.ts +35 -0
  188. package/dist/types/container/start.d.ts +144 -0
  189. package/dist/types/container/stats.d.ts +31 -0
  190. package/dist/types/container/status.d.ts +25 -0
  191. package/dist/types/container/stop.d.ts +24 -0
  192. package/dist/types/container/tool-oom-priority.d.ts +4 -0
  193. package/dist/types/container/verify-running.d.ts +49 -0
  194. package/dist/types/cron/consumer.d.ts +42 -0
  195. package/dist/types/cron/count-state.d.ts +24 -0
  196. package/dist/types/cron/index.d.ts +21 -0
  197. package/dist/types/cron/list.d.ts +33 -0
  198. package/dist/types/cron/reloadable.d.ts +11 -0
  199. package/dist/types/cron/scheduler.d.ts +51 -0
  200. package/dist/types/cron/schema.d.ts +108 -0
  201. package/dist/types/dependencies/bin-resolver.d.ts +28 -0
  202. package/dist/types/dependencies/bins.d.ts +22 -0
  203. package/dist/types/dependencies/index.d.ts +2 -0
  204. package/dist/types/git/bound-gc-config.d.ts +4 -0
  205. package/dist/types/git/hookless.d.ts +1 -0
  206. package/dist/types/git/reconcile-ignored.d.ts +13 -0
  207. package/dist/types/git/resolve-agent-git.d.ts +8 -0
  208. package/dist/types/git/resolve-identity.d.ts +10 -0
  209. package/dist/types/git/run.d.ts +24 -0
  210. package/dist/types/git/system-commit.d.ts +2 -0
  211. package/dist/types/hostd/client.d.ts +13 -0
  212. package/dist/types/hostd/models.d.ts +1 -0
  213. package/dist/types/hostd/paths.d.ts +17 -0
  214. package/dist/types/hostd/protocol.d.ts +93 -0
  215. package/dist/types/hostd/spawn.d.ts +17 -0
  216. package/dist/types/hostd/version.d.ts +18 -0
  217. package/dist/types/init/auto-upgrade.d.ts +41 -0
  218. package/dist/types/init/cli-version.d.ts +7 -0
  219. package/dist/types/init/dockerfile.d.ts +34 -0
  220. package/dist/types/init/ensure-deps.d.ts +17 -0
  221. package/dist/types/init/env-file.d.ts +3 -0
  222. package/dist/types/init/gitignore.d.ts +5 -0
  223. package/dist/types/init/local-source-stamp.d.ts +3 -0
  224. package/dist/types/init/packagejson.d.ts +7 -0
  225. package/dist/types/init/paths.d.ts +3 -0
  226. package/dist/types/init/reconcile-plugin-deps.d.ts +13 -0
  227. package/dist/types/init/run-bun-install.d.ts +16 -0
  228. package/dist/types/init/windows-dev-link.d.ts +8 -0
  229. package/dist/types/mcp/catalog.d.ts +7 -0
  230. package/dist/types/mcp/client.d.ts +58 -0
  231. package/dist/types/mcp/manager.d.ts +56 -0
  232. package/dist/types/mcp/tools.d.ts +23 -0
  233. package/dist/types/models/embedding-model.d.ts +20 -0
  234. package/dist/types/models/transformers-version.d.ts +1 -0
  235. package/dist/types/network/internal-destinations.d.ts +29 -0
  236. package/dist/types/operations/classify-tool-outcome.d.ts +35 -0
  237. package/dist/types/operations/incidents.d.ts +47 -0
  238. package/dist/types/operations/index.d.ts +3 -0
  239. package/dist/types/operations/remediations.d.ts +25 -0
  240. package/dist/types/path-safety/real-intended-path.d.ts +9 -0
  241. package/dist/types/permissions/builtins.d.ts +25 -0
  242. package/dist/types/permissions/grant.d.ts +19 -0
  243. package/dist/types/permissions/index.d.ts +6 -0
  244. package/dist/types/permissions/match-rule.d.ts +28 -0
  245. package/dist/types/permissions/permissions.d.ts +42 -0
  246. package/dist/types/permissions/resolve.d.ts +25 -0
  247. package/dist/types/permissions/schema.d.ts +14 -0
  248. package/dist/types/plugin/context.d.ts +20 -0
  249. package/dist/types/plugin/core-tool-names.d.ts +4 -0
  250. package/dist/types/plugin/define.d.ts +46 -0
  251. package/dist/types/plugin/hooks.d.ts +52 -0
  252. package/dist/types/plugin/index.d.ts +11 -0
  253. package/dist/types/plugin/load-skill.d.ts +14 -0
  254. package/dist/types/plugin/loader.d.ts +25 -0
  255. package/dist/types/plugin/manager.d.ts +42 -0
  256. package/dist/types/plugin/registry.d.ts +73 -0
  257. package/dist/types/plugin/skills.d.ts +11 -0
  258. package/dist/types/plugin/types.d.ts +336 -0
  259. package/dist/types/plugin/zod-introspect.d.ts +11 -0
  260. package/dist/types/reload/client.d.ts +11 -0
  261. package/dist/types/reload/docker-exec-client.d.ts +11 -0
  262. package/dist/types/reload/format.d.ts +2 -0
  263. package/dist/types/reload/index.d.ts +6 -0
  264. package/dist/types/reload/recover.d.ts +22 -0
  265. package/dist/types/reload/registry.d.ts +10 -0
  266. package/dist/types/reload/types.d.ts +25 -0
  267. package/dist/types/role-claim/client.d.ts +20 -0
  268. package/dist/types/role-claim/code.d.ts +4 -0
  269. package/dist/types/role-claim/controller.d.ts +59 -0
  270. package/dist/types/role-claim/index.d.ts +6 -0
  271. package/dist/types/role-claim/match-rule.d.ts +9 -0
  272. package/dist/types/role-claim/pending.d.ts +35 -0
  273. package/dist/types/role-claim/reload-after-claim.d.ts +16 -0
  274. package/dist/types/run/llm-fetch-observer.d.ts +50 -0
  275. package/dist/types/sandbox/availability.d.ts +21 -0
  276. package/dist/types/sandbox/build.d.ts +7 -0
  277. package/dist/types/sandbox/canonical-secrets.d.ts +8 -0
  278. package/dist/types/sandbox/coding-agent.d.ts +20 -0
  279. package/dist/types/sandbox/dependency-bins.d.ts +19 -0
  280. package/dist/types/sandbox/dev-source.d.ts +4 -0
  281. package/dist/types/sandbox/env-exposure.d.ts +1 -0
  282. package/dist/types/sandbox/errors.d.ts +20 -0
  283. package/dist/types/sandbox/hidden-paths.d.ts +11 -0
  284. package/dist/types/sandbox/index.d.ts +14 -0
  285. package/dist/types/sandbox/package-install.d.ts +1 -0
  286. package/dist/types/sandbox/policy.d.ts +71 -0
  287. package/dist/types/sandbox/privileged-runtime.d.ts +13 -0
  288. package/dist/types/sandbox/quote.d.ts +2 -0
  289. package/dist/types/sandbox/runtime-private.d.ts +1 -0
  290. package/dist/types/sandbox/session-tmp.d.ts +6 -0
  291. package/dist/types/sandbox/symlinks.d.ts +6 -0
  292. package/dist/types/sandbox/writable-zones.d.ts +15 -0
  293. package/dist/types/secrets/coding-agent-auth.d.ts +25 -0
  294. package/dist/types/secrets/defaults.d.ts +21 -0
  295. package/dist/types/secrets/export-github-cli-store.d.ts +22 -0
  296. package/dist/types/secrets/hydrate.d.ts +7 -0
  297. package/dist/types/secrets/index.d.ts +7 -0
  298. package/dist/types/secrets/provision-github-cli-store.d.ts +45 -0
  299. package/dist/types/secrets/refresh-provider-oauth.d.ts +22 -0
  300. package/dist/types/secrets/resolve.d.ts +14 -0
  301. package/dist/types/secrets/schema.d.ts +840 -0
  302. package/dist/types/secrets/storage.d.ts +56 -0
  303. package/dist/types/shared/host-locale.d.ts +1 -0
  304. package/dist/types/shared/index.d.ts +5 -0
  305. package/dist/types/shared/local-time.d.ts +4 -0
  306. package/dist/types/shared/platform.d.ts +2 -0
  307. package/dist/types/shared/protocol.d.ts +424 -0
  308. package/dist/types/shared/style-text.d.ts +3 -0
  309. package/dist/types/shared/wsl.d.ts +17 -0
  310. package/dist/types/stream/broker.d.ts +2 -0
  311. package/dist/types/stream/index.d.ts +2 -0
  312. package/dist/types/stream/types.d.ts +71 -0
  313. package/package.json +9 -2
  314. package/scripts/build-plugin-types.ts +105 -0
  315. package/scripts/check-plugin-sdk.ts +111 -0
  316. package/scripts/require-parallel.ts +5 -32
  317. package/src/agent/guard-types.ts +3 -0
  318. package/src/agent/guards.ts +4 -0
  319. package/src/agent/idle-compaction.ts +174 -0
  320. package/src/agent/index.ts +74 -16
  321. package/src/agent/live-subagents.ts +19 -0
  322. package/src/agent/multimodal/look-at.ts +22 -9
  323. package/src/agent/plugin-tools.ts +13 -1
  324. package/src/agent/reviewer-bash-policy.ts +41 -1
  325. package/src/agent/session-origin.ts +26 -10
  326. package/src/agent/subagent-cache-keepalive.ts +198 -0
  327. package/src/agent/subagent-session.ts +6 -0
  328. package/src/agent/subagents.ts +46 -8
  329. package/src/agent/system-prompt.ts +1 -1
  330. package/src/agent/tool-file-safety.ts +6 -1
  331. package/src/agent/tools/channel-edit.ts +20 -10
  332. package/src/agent/tools/channel-fetch-attachment.ts +12 -5
  333. package/src/agent/tools/channel-handoff.ts +72 -0
  334. package/src/agent/tools/channel-read.ts +57 -10
  335. package/src/agent/tools/channel-reply.ts +33 -26
  336. package/src/agent/tools/channel-send.ts +21 -13
  337. package/src/agent/tools/channel-session-search.ts +35 -0
  338. package/src/agent/tools/curl-impersonate.ts +11 -4
  339. package/src/agent/tools/ddg.ts +13 -5
  340. package/src/agent/tools/spawn-subagent.ts +27 -11
  341. package/src/agent/tools/stream-snapshot.ts +15 -2
  342. package/src/agent/tools/subagent-access.ts +11 -4
  343. package/src/browser/bsk-shim.mjs +74 -0
  344. package/src/browser/dockerfile.ts +84 -0
  345. package/src/browser/egress.ts +104 -0
  346. package/src/browser/managed-browser.ts +205 -0
  347. package/src/browser/registry.ts +110 -0
  348. package/src/browser/relay.ts +231 -0
  349. package/src/browser/sandbox-entry.ts +167 -0
  350. package/src/bundled-plugins/agent-browser/index.ts +2 -0
  351. package/src/bundled-plugins/browser-agent/browser-agent.ts +89 -0
  352. package/src/bundled-plugins/browser-agent/index.ts +12 -0
  353. package/src/bundled-plugins/doc-render/index.ts +0 -10
  354. package/src/bundled-plugins/doc-render/render.ts +83 -111
  355. package/src/bundled-plugins/doc-render/skills/typeclaw-render-pdf/SKILL.md +152 -257
  356. package/src/bundled-plugins/github-cli-auth/gh-command.ts +4 -0
  357. package/src/bundled-plugins/github-cli-auth/git-auth-diagnostic.ts +95 -0
  358. package/src/bundled-plugins/github-cli-auth/index.ts +75 -59
  359. package/src/bundled-plugins/managed-browser/index.ts +74 -0
  360. package/src/bundled-plugins/managed-browser/skills/browser-use/browser-use/SKILL.md +27 -0
  361. package/src/bundled-plugins/managed-browser/skills/browserskill/browserskill/SKILL.md +28 -0
  362. package/src/bundled-plugins/managed-browser/skills/omowright/omowright/SKILL.md +40 -0
  363. package/src/bundled-plugins/operator/operator.ts +1 -1
  364. package/src/bundled-plugins/qa/index.ts +11 -0
  365. package/src/bundled-plugins/qa/qa.ts +160 -0
  366. package/src/bundled-plugins/qa/skills/qa-cli.ts +50 -0
  367. package/src/bundled-plugins/qa/skills/qa-general.ts +30 -0
  368. package/src/bundled-plugins/qa/skills/qa-http.ts +39 -0
  369. package/src/bundled-plugins/qa/skills/qa-pr.ts +51 -0
  370. package/src/bundled-plugins/qa/skills/qa-web.ts +49 -0
  371. package/src/bundled-plugins/security/index.ts +53 -34
  372. package/src/bundled-plugins/security/policies/outbound-secret-scan.ts +1 -0
  373. package/src/channels/adapter-namespace.ts +13 -0
  374. package/src/channels/adapters/discord-bot.ts +97 -5
  375. package/src/channels/adapters/github/index.ts +16 -0
  376. package/src/channels/adapters/github/last-alive.ts +4 -16
  377. package/src/channels/adapters/slack-attachment-download.ts +14 -3
  378. package/src/channels/adapters/slack-bot-author-resolver.ts +4 -3
  379. package/src/channels/adapters/slack-bot-channel-resolver.ts +9 -6
  380. package/src/channels/adapters/slack-bot-classify.ts +1 -0
  381. package/src/channels/adapters/slack-bot-slash-commands.ts +3 -1
  382. package/src/channels/adapters/slack-bot.ts +299 -67
  383. package/src/channels/adapters/slack-classify.ts +1 -0
  384. package/src/channels/catch-up.ts +137 -0
  385. package/src/channels/continuation-willingness.ts +2 -2
  386. package/src/channels/continuity-types.ts +1 -0
  387. package/src/channels/engagement.ts +17 -1
  388. package/src/channels/github-false-receipt.ts +3 -3
  389. package/src/channels/github-rereview-guard.ts +9 -5
  390. package/src/channels/github-token-bridge.ts +24 -0
  391. package/src/channels/last-alive.ts +34 -0
  392. package/src/channels/manager.ts +8 -1
  393. package/src/channels/router.ts +427 -136
  394. package/src/channels/session-handoff.fixture.ts +144 -0
  395. package/src/channels/session-handoff.ts +175 -0
  396. package/src/channels/session-search.ts +71 -0
  397. package/src/channels/types.ts +12 -2
  398. package/src/cli/channel.ts +2 -3
  399. package/src/cli/init.ts +2 -3
  400. package/src/cli/model.ts +132 -3
  401. package/src/coding-agent/index.ts +7 -1
  402. package/src/coding-agent/omo-stream.ts +40 -0
  403. package/src/coding-agent/runner.ts +30 -8
  404. package/src/config/config.ts +111 -22
  405. package/src/config/model-overrides.ts +59 -0
  406. package/src/config/models-mutation.ts +185 -2
  407. package/src/config/providers-mutation.ts +12 -4
  408. package/src/config/providers.ts +59 -0
  409. package/src/container/start.ts +95 -4
  410. package/src/doctor/checks.ts +8 -6
  411. package/src/hostd/daemon.ts +13 -1
  412. package/src/init/auto-upgrade.ts +7 -1
  413. package/src/init/dockerfile.ts +57 -12
  414. package/src/init/index.ts +4 -3
  415. package/src/init/local-source-stamp.ts +68 -0
  416. package/src/init/models-dev.ts +4 -0
  417. package/src/init/validate-api-key.ts +3 -0
  418. package/src/permissions/builtins.ts +7 -0
  419. package/src/permissions/permissions.ts +18 -9
  420. package/src/permissions/resolve.ts +7 -1
  421. package/src/plugin/context.ts +2 -0
  422. package/src/plugin/hooks.ts +137 -0
  423. package/src/plugin/index.ts +6 -0
  424. package/src/plugin/manager.ts +4 -0
  425. package/src/plugin/types.ts +60 -0
  426. package/src/run/bundled-plugins.ts +6 -0
  427. package/src/run/index.ts +24 -14
  428. package/src/run/llm-fetch-observer.ts +12 -15
  429. package/src/sandbox/canonical-secrets.ts +4 -0
  430. package/src/sandbox/dev-source.ts +26 -0
  431. package/src/sandbox/hidden-paths.ts +16 -2
  432. package/src/secrets/storage.ts +13 -0
  433. package/src/skills/typeclaw-channel-github/SKILL.md +8 -8
  434. package/src/skills/typeclaw-config/SKILL.md +39 -5
  435. package/src/skills/typeclaw-config/references/dockerfile.md +2 -2
  436. package/src/skills/typeclaw-github-contributing/SKILL.md +1 -1
  437. package/src/skills/typeclaw-monorepo/SKILL.md +1 -1
  438. package/src/skills/typeclaw-permissions/SKILL.md +7 -7
  439. package/src/skills/typeclaw-troubleshooting/SKILL.md +12 -1
  440. package/typeclaw.schema.json +436 -5
  441. package/src/bundled-plugins/doc-render/templates/lib.typ +0 -339
  442. package/src/bundled-plugins/github-cli-auth/gh-store.ts +0 -733
@@ -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
  }
@@ -1405,6 +1405,60 @@ export const KNOWN_PROVIDERS = {
1405
1405
  },
1406
1406
  },
1407
1407
  },
1408
+ // Inception (Mercury diffusion LLMs) official API. OpenAI-compatible
1409
+ // /v1/chat/completions with Bearer auth, so it goes through pi-ai's
1410
+ // `openai-completions` adapter with a custom baseUrl. api-key only.
1411
+ //
1412
+ // Only Mercury 3 is listed: Mercury 2 / 2.5 are closed to new users as of
1413
+ // 2026-10-19 and shut down for existing ones on 2026-11-15. Mercury Voice is
1414
+ // enterprise-gated, Mercury Decide and Mercury Edit 2 don't serve chat.
1415
+ //
1416
+ // Cost is the standard rate from docs.inceptionlabs.ai/get-started/models
1417
+ // as of 2026-10-20, not the 50%-off launch price, so the record doesn't go
1418
+ // stale when the promotion ends. No cache-write surcharge is published.
1419
+ //
1420
+ // reasoning_effort accepts instant/low/medium/high and defaults to `low`
1421
+ // when omitted. `off` maps to `instant` so a non-reasoning turn really drops
1422
+ // to the fastest mode instead of silently reasoning at the default.
1423
+ //
1424
+ // The OpenAPI spec (api.inceptionlabs.ai/openapi.json) documents neither
1425
+ // `store` nor the `developer` role, and pi-ai doesn't auto-detect compat
1426
+ // for this baseUrl, so both are turned off.
1427
+ inception: {
1428
+ id: 'inception',
1429
+ name: 'Inception (Mercury)',
1430
+ baseUrl: 'https://api.inceptionlabs.ai/v1',
1431
+ auth: ['api-key'],
1432
+ apiKeyEnv: 'INCEPTION_API_KEY',
1433
+ oauthProviderId: null,
1434
+ models: {
1435
+ 'mercury-3': {
1436
+ id: 'mercury-3',
1437
+ name: 'Mercury 3',
1438
+ api: 'openai-completions',
1439
+ provider: 'inception',
1440
+ baseUrl: 'https://api.inceptionlabs.ai/v1',
1441
+ reasoning: true,
1442
+ thinkingLevelMap: {
1443
+ off: 'instant',
1444
+ minimal: 'low',
1445
+ low: 'low',
1446
+ medium: 'medium',
1447
+ high: 'high',
1448
+ xhigh: 'high',
1449
+ },
1450
+ input: ['text'],
1451
+ cost: { input: 0.2, output: 0.7, cacheRead: 0.02, cacheWrite: 0 },
1452
+ contextWindow: 1000000,
1453
+ maxTokens: 131072,
1454
+ compat: {
1455
+ supportsStore: false,
1456
+ supportsDeveloperRole: false,
1457
+ supportsReasoningEffort: true,
1458
+ },
1459
+ },
1460
+ },
1461
+ },
1408
1462
  } as const satisfies Record<string, KnownProvider>
1409
1463
 
1410
1464
  export type KnownProviderId = keyof typeof KNOWN_PROVIDERS
@@ -1492,6 +1546,11 @@ export const KNOWN_PROVIDER_VENDORS = {
1492
1546
  'moonshot-coding': { label: 'Coding Plan', hint: 'Kimi Code subscription' },
1493
1547
  },
1494
1548
  },
1549
+ inception: {
1550
+ id: 'inception',
1551
+ name: 'Inception (Mercury)',
1552
+ providers: ['inception'],
1553
+ },
1495
1554
  // Listed last because it is a reseller, not a lab: a user who knows they want
1496
1555
  // Anthropic should land on the Anthropic row, not the gateway that proxies it.
1497
1556
  opengateway: {
@@ -1,8 +1,8 @@
1
1
  import { randomBytes } from 'node:crypto'
2
2
  import { accessSync, constants as fsConstants, existsSync, realpathSync } 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
@@ -120,6 +150,7 @@ export type PlanStartOptions = {
120
150
  // rather than from os.totalmem(). Omitted by callers that have no exec (and
121
151
  // by tests), in which case the default applies unclamped.
122
152
  totalMemoryBytes?: number | undefined
153
+ hostHome?: string
123
154
  }
124
155
 
125
156
  export type HostDaemonControl = {
@@ -380,8 +411,18 @@ async function runStart({
380
411
  }
381
412
  }
382
413
 
383
- const githubCliDeniedRoots = resolveGithubCliDeniedRoots(cwd, await loadTypeclawConfig(cwd))
384
- const githubCliWarning = await refreshGithubCliStore(cwd, githubCliDeniedRoots, provisionGithubCliStoreForAgent)
414
+ const githubCliConfig = await loadTypeclawConfig(cwd)
415
+ if (!githubCliConfig.githubCli.importHostAuth) {
416
+ const removalFailure = removeGithubCliStore(cwd)
417
+ if (removalFailure !== null) return { ok: false, reason: removalFailure }
418
+ }
419
+ const githubCliWarning = githubCliConfig.githubCli.importHostAuth
420
+ ? await refreshGithubCliStore(
421
+ cwd,
422
+ resolveGithubCliDeniedRoots(cwd, githubCliConfig),
423
+ provisionGithubCliStoreForAgent,
424
+ )
425
+ : null
385
426
  if (githubCliWarning !== null) {
386
427
  if (streamOutput) process.stderr.write(githubCliWarning)
387
428
  else onWarning?.(githubCliWarning.trim())
@@ -520,7 +561,14 @@ async function runStart({
520
561
  // version bump (dir already present) or a removal (stale dir left behind)
521
562
  // would otherwise leave bun.lock/node_modules out of sync with the
522
563
  // reconciled package.json.
564
+ //
565
+ // A `file:` dep is a snapshot copy taken at install time, so pulling or
566
+ // editing the checkout leaves the agent running old code until something
567
+ // re-copies it. Fingerprint the checkout and force a reinstall only when it
568
+ // moved since the last install, so routine restarts stay fast.
569
+ const staleLocalFingerprint = await staleLocalTypeclawCopyFingerprint(cwd)
523
570
  const forceDepsReinstall =
571
+ staleLocalFingerprint !== null ||
524
572
  (forceBuild && (await hasLocallyLinkedTypeclawDep(cwd))) ||
525
573
  pluginReconcile.changed ||
526
574
  outcomeRequiresForceInstall(upgrade) ||
@@ -529,6 +577,7 @@ async function runStart({
529
577
  if (!deps.ok) {
530
578
  return { ok: false, reason: `dependency install failed: ${deps.reason}` }
531
579
  }
580
+ if (staleLocalFingerprint !== null) await writeLocalSourceStamp(cwd, staleLocalFingerprint)
532
581
  await commitSystemFile(cwd, DEPENDENCY_FILES, upgradeCommitMessage ?? 'Update dependencies')
533
582
  // Probe buildx up front so the Dockerfile we write matches the builder we
534
583
  // will use. buildx present -> emit the BuildKit Dockerfile and build with
@@ -855,6 +904,22 @@ async function refreshGithubCliStore(
855
904
  )
856
905
  }
857
906
 
907
+ // Without opt-in, a store persisted by an earlier start (when copying was
908
+ // unconditional) still carries the operator's identity. The container exports
909
+ // whatever store secrets.json holds, so a failed removal must stop the launch
910
+ // rather than run the agent as the operator.
911
+ function removeGithubCliStore(agentDir: string): string | null {
912
+ try {
913
+ new SecretsBackend(join(agentDir, 'secrets.json')).removeGithubCliSync()
914
+ return null
915
+ } catch {
916
+ return (
917
+ 'Could not remove the host GitHub CLI credential from secrets.json (githubCli.importHostAuth is off). ' +
918
+ 'Delete the `githubCli` entry from secrets.json by hand, or fix the file if it is malformed, then run typeclaw start again.'
919
+ )
920
+ }
921
+ }
922
+
858
923
  // An unreadable or malformed secrets.json cannot prove the store is absent, so
859
924
  // it takes the warning — silence is reserved for a confirmed no-store agent.
860
925
  function hasPersistedGithubCliStore(agentDir: string): boolean {
@@ -922,6 +987,7 @@ export async function planStart({
922
987
  hostIdentity = currentHostIdentity(),
923
988
  gitIdentity,
924
989
  totalMemoryBytes,
990
+ hostHome = homedir(),
925
991
  }: PlanStartOptions): Promise<StartPlan> {
926
992
  const containerName = containerNameFromCwd(cwd)
927
993
  const imageTag = imageTagFromCwd(cwd)
@@ -1162,6 +1228,12 @@ export async function planStart({
1162
1228
  runArgs.push(...dockerBindMount({ src: hostPath, dst: target, readonly: mount.readOnly }))
1163
1229
  }
1164
1230
 
1231
+ if (cfg.hostFonts) {
1232
+ for (const fontMount of resolveHostFontMounts({ platform, home: hostHome })) {
1233
+ runArgs.push(...dockerBindMount(fontMount))
1234
+ }
1235
+ }
1236
+
1165
1237
  // Shared model cache mount for embeddings. Vector memory is always on, and
1166
1238
  // the embedder runs with local_files_only inside the container.
1167
1239
  runArgs.push(...dockerBindMount({ src: join(homeRoot(), 'models'), dst: '/opt/models', readonly: true }))
@@ -1234,6 +1306,7 @@ export async function refreshDockerfile(
1234
1306
  // path. Mirrors the same gate in writeDockerAssets (src/init/index.ts).
1235
1307
  const devMode = await hasLocallyLinkedTypeclawDep(cwd)
1236
1308
  const next = buildDockerfile(cfg.docker.file, {
1309
+ browser: cfg.browser,
1237
1310
  baseImageVersion: devMode ? null : resolveBaseImageVersion(cwd),
1238
1311
  cjkFontsAuto: hostLocaleIsCjk(),
1239
1312
  buildKit: opts.buildKit,
@@ -1698,6 +1771,24 @@ async function hasLocallyLinkedTypeclawDep(cwd: string): Promise<boolean> {
1698
1771
  return spec !== null && (spec.startsWith('file:') || spec.startsWith('link:'))
1699
1772
  }
1700
1773
 
1774
+ // Returns the checkout's current fingerprint when the agent's `file:` copy of
1775
+ // typeclaw no longer matches it, else null. An install that resolves to the
1776
+ // checkout itself is live and never stale. A symlink alone does not prove that:
1777
+ // bun's isolated linker symlinks into its own store, which is still a copy.
1778
+ async function staleLocalTypeclawCopyFingerprint(cwd: string): Promise<string | null> {
1779
+ if (!(await readTypeclawDepSpec(cwd))?.startsWith('file:')) return null
1780
+ const source = await detectDevSource(cwd)
1781
+ if (source === null) return null
1782
+ try {
1783
+ if (realpathSync(join(cwd, 'node_modules', TYPECLAW_PACKAGE)) === realpathSync(source)) return null
1784
+ } catch {
1785
+ // Not installed yet, or the checkout is missing: fall through to the fingerprint.
1786
+ }
1787
+ const fingerprint = await localSourceFingerprint(source)
1788
+ if (fingerprint === null || fingerprint === (await readLocalSourceStamp(cwd))) return null
1789
+ return fingerprint
1790
+ }
1791
+
1701
1792
  async function readTypeclawDepSpec(cwd: string): Promise<string | null> {
1702
1793
  try {
1703
1794
  const raw = await readFile(join(cwd, PACKAGE_FILE), 'utf8')
@@ -3,7 +3,7 @@ import { readFile } from 'node:fs/promises'
3
3
  import { homedir } from 'node:os'
4
4
  import { join, relative } from 'node:path'
5
5
 
6
- import { loadConfigSync, validateConfig } from '@/config'
6
+ import { type Config, loadConfigSync, validateConfig } from '@/config'
7
7
  import {
8
8
  checkDockerAvailable,
9
9
  containerNameFromCwd,
@@ -535,7 +535,7 @@ function buildExpectedDockerfile(cwd: string): string | null {
535
535
  try {
536
536
  const cfg = loadConfigStrictForTemplate(cwd)
537
537
  if (cfg === null) return null
538
- return buildDockerfile(cfg.dockerfile, { baseImageVersion: resolveBaseImageVersion(cwd) })
538
+ return buildDockerfile(cfg.dockerfile, { browser: cfg.browser, baseImageVersion: resolveBaseImageVersion(cwd) })
539
539
  } catch {
540
540
  return null
541
541
  }
@@ -551,13 +551,15 @@ function buildExpectedGitignore(cwd: string): string | null {
551
551
  }
552
552
  }
553
553
 
554
- function loadConfigStrictForTemplate(
555
- cwd: string,
556
- ): { dockerfile: Parameters<typeof buildDockerfile>[0]; gitignore: Parameters<typeof buildGitignore>[0] } | null {
554
+ function loadConfigStrictForTemplate(cwd: string): {
555
+ dockerfile: Parameters<typeof buildDockerfile>[0]
556
+ browser: Config['browser']
557
+ gitignore: Parameters<typeof buildGitignore>[0]
558
+ } | null {
557
559
  const result = validateConfig(cwd)
558
560
  if (!result.ok) return null
559
561
  const cfg = loadConfigSync(cwd)
560
- return { dockerfile: cfg.docker.file, gitignore: cfg.git.ignore }
562
+ return { dockerfile: cfg.docker.file, browser: cfg.browser, gitignore: cfg.git.ignore }
561
563
  }
562
564
 
563
565
  // Normalizes CRLF to LF: the managed templates are emitted with `\n`, but a
@@ -238,7 +238,14 @@ async function restorePersistedRegistrations(
238
238
  log({ kind: 'registration-skipped', containerName: expectedName, reason: 'container not running' })
239
239
  continue
240
240
  }
241
- await apply(parsed)
241
+ // One registration whose revival throws (e.g. portbroker.start) must not
242
+ // abort the loop: restoreComplete would reject and every gated RPC would
243
+ // fail until the daemon is respawned.
244
+ try {
245
+ await apply(parsed)
246
+ } catch (error) {
247
+ log({ kind: 'registration-skipped', containerName: expectedName, reason: stringifyError(error) })
248
+ }
242
249
  }
243
250
  }
244
251
 
@@ -443,6 +450,11 @@ export async function startDaemon(opts: DaemonOptions = {}): Promise<Daemon> {
443
450
  void handleFatalAuthFailure(payload.containerName, brokerToken, reason)
444
451
  },
445
452
  })
453
+ } else if (opts.portbroker && brokerTokens.delete(payload.containerName)) {
454
+ // A re-register without broker fields must retire the previous broker;
455
+ // otherwise its stale token could later match a fatal-auth callback and
456
+ // tear down this live registration.
457
+ await withCleanupTimeout(opts.portbroker.stop(payload.containerName, 'deregistered'), cleanupStepTimeoutMs)
446
458
  }
447
459
  if (opts.kakaoRenewal) {
448
460
  opts.kakaoRenewal.start({ containerName: payload.containerName, cwd: payload.cwd })
@@ -141,8 +141,14 @@ export function outcomeForcesInstall(outcome: AutoUpgradeOutcome): boolean {
141
141
  // (file deps don't "update"), NOT the `bun update --latest` path above — and it
142
142
  // skips version verification, since a local install's version is whatever the
143
143
  // checkout declares. start.ts ORs this into its ensureDeps force flag.
144
+ //
145
+ // Leaving a local spec for a registry range needs the same force: `bun update
146
+ // --latest` rewrites bun.lock but keeps the local copy in node_modules when its
147
+ // version already satisfies the range, so the agent would keep running the
148
+ // checkout's code.
144
149
  export function outcomeRequiresForceInstall(outcome: AutoUpgradeOutcome): boolean {
145
- return outcome.kind === 'relinked-to-local'
150
+ if (outcome.kind === 'relinked-to-local') return true
151
+ return outcome.kind === 'spec-rewritten' && (outcome.from.startsWith('file:') || outcome.from.startsWith('link:'))
146
152
  }
147
153
 
148
154
  // The version we expect to find in node_modules/typeclaw after the
@@ -1,4 +1,6 @@
1
1
  import { CONTAINER_AGENT_MESSENGER_CONFIG_DIR } from '@/agent-messenger/config-dir'
2
+ import { renderBrowserLayers } from '@/browser/dockerfile'
3
+ import type { BrowserConfig } from '@/browser/registry'
2
4
  import { ASKPASS_SCRIPT, TYPECLAW_GIT_ASKPASS_PATH } from '@/bundled-plugins/github-cli-auth/git-askpass'
3
5
  import { CLAUDE_CODE_VERSION } from '@/coding-agent/claude'
4
6
  import { CODEX_CLI_VERSION } from '@/coding-agent/codex'
@@ -12,6 +14,8 @@ import { GHCR_BASE_IMAGE_REPO } from './cli-version'
12
14
  export const DOCKERFILE = 'Dockerfile'
13
15
 
14
16
  export type BuildDockerfileOptions = {
17
+ // `typeclaw.json#browser`; omitted = the default agent-browser-only image.
18
+ browser?: BrowserConfig
15
19
  // Null or omitted = emit the full inline heavy stack (dev mode, tests).
16
20
  baseImageVersion?: string | null
17
21
  // Host-locale decision for `cjkFonts: 'auto'`. Callers that have a host
@@ -784,6 +788,7 @@ export function buildDockerfile(
784
788
  const claudeCodeLayer = renderClaudeCodeInstallLayer(config.claudeCode)
785
789
  const codexCliLayer = renderCodexCliInstallLayer(config.codexCli, buildKit)
786
790
  const omoCliLayer = renderOmoCliInstallLayer(config.omoCli)
791
+ const browserLayers = renderBrowserLayers(options.browser ?? { engines: ['agent-browser'], extensions: [] })
787
792
  const fromAndHeavyLayers =
788
793
  baseImageVersion !== null
789
794
  ? renderVersionedHead(
@@ -794,6 +799,7 @@ export function buildDockerfile(
794
799
  claudeCodeLayer,
795
800
  codexCliLayer,
796
801
  omoCliLayer,
802
+ browserLayers,
797
803
  buildKit,
798
804
  )
799
805
  : renderInlineHead(
@@ -803,6 +809,7 @@ export function buildDockerfile(
803
809
  claudeCodeLayer,
804
810
  codexCliLayer,
805
811
  omoCliLayer,
812
+ browserLayers,
806
813
  buildKit,
807
814
  )
808
815
 
@@ -857,6 +864,7 @@ function renderVersionedHead(
857
864
  claudeCodeLayer: string,
858
865
  codexCliLayer: string,
859
866
  omoCliLayer: string,
867
+ browserLayers: string,
860
868
  buildKit: boolean,
861
869
  ): string {
862
870
  const toggleAptLayer = toggleAptArgs.length === 0 ? '' : `${renderToggleAptInstallLayer(toggleAptArgs, buildKit)}\n\n`
@@ -870,7 +878,7 @@ WORKDIR /agent
870
878
 
871
879
  ARG TARGETARCH
872
880
 
873
- ${ghKeyringLayer}${toggleAptLayer}${cloudflaredBlock}${claudeCodeBlock}${codexCliBlock}${omoCliBlock}${renderEntrypointShimLayer()}
881
+ ${ghKeyringLayer}${toggleAptLayer}${cloudflaredBlock}${claudeCodeBlock}${codexCliBlock}${omoCliBlock}${browserLayers}${renderEntrypointShimLayer()}
874
882
  ${renderGitAskPassLayer()}
875
883
 
876
884
  ${LAYER_TRANSFORMERS_INSTALL}
@@ -889,6 +897,7 @@ function renderInlineHead(
889
897
  claudeCodeLayer: string,
890
898
  codexCliLayer: string,
891
899
  omoCliLayer: string,
900
+ browserLayers: string,
892
901
  buildKit: boolean,
893
902
  ): string {
894
903
  const baselineAndToggleArgs = [...BASELINE_APT_PACKAGES, ...toggleAptArgs]
@@ -936,7 +945,7 @@ ${LAYER_4_5_AGENT_BROWSER_HEADED_WRAPPER}
936
945
 
937
946
  ${renderChromeForTestingLayer()}
938
947
 
939
- ${cloudflaredBlock}${claudeCodeBlock}${codexCliBlock}${omoCliBlock}${renderEntrypointShimLayer()}
948
+ ${cloudflaredBlock}${claudeCodeBlock}${codexCliBlock}${omoCliBlock}${browserLayers}${renderEntrypointShimLayer()}
940
949
  ${renderGitAskPassLayer()}
941
950
 
942
951
  ${LAYER_TRANSFORMERS_INSTALL}
@@ -1085,18 +1094,50 @@ RUN ARCH_TARBALL="$(if [ "$TARGETARCH" = "arm64" ]; then echo aarch64-linux-gnu;
1085
1094
  && rm curl-impersonate.tar.gz \\
1086
1095
  && /usr/local/bin/curl_${CURL_IMPERSONATE_PROFILE} --version > /dev/null`
1087
1096
 
1088
- const LAYER_3_AGENT_BROWSER_ARM64_CONFIG = `# Layer 3 (stable, arm64 only): point agent-browser at the apt-installed
1089
- # chromium. Independent of the npm install below so it stays cached across
1097
+ // Everything agent-browser needs at runtime lives under /usr: the model's
1098
+ // bwrap sandbox binds /usr but not /root, and its PATH has no `node`.
1099
+ const AGENT_BROWSER_ROOT = '/usr/local/lib/typeclaw-agent-browser'
1100
+ const AGENT_BROWSER_PACKAGE = `${AGENT_BROWSER_ROOT}/install/global/node_modules/agent-browser`
1101
+ // Stable browser path for both arches: a launcher that execs the real
1102
+ // browser, linked at AGENT_BROWSER_CHROME_BIN (apt chromium on arm64, Chrome
1103
+ // for Testing on amd64 in Layer 5).
1104
+ const AGENT_BROWSER_CHROME = `${AGENT_BROWSER_ROOT}/chrome`
1105
+ const AGENT_BROWSER_CHROME_BIN = `${AGENT_BROWSER_ROOT}/chrome-bin`
1106
+
1107
+ // The launcher adds --no-sandbox because Chromium's own sandbox cannot start
1108
+ // inside the model's bwrap sandbox: with the default proc-bind strategy /proc
1109
+ // is read-only, so Chromium's user-namespace sandbox cannot write
1110
+ // /proc/self/uid_map, and there is no setuid chrome-sandbox. agent-browser
1111
+ // only auto-adds --no-sandbox when it detects root or a container
1112
+ // (/.dockerenv, /proc/1/cgroup), and none of that is visible inside bwrap.
1113
+ // bwrap stays the isolation boundary for the browser. The flag lives in the
1114
+ // launcher, not AGENT_BROWSER_ARGS, because a CLI --args replaces that env
1115
+ // value wholesale and would silently drop it.
1116
+ const LAYER_3_AGENT_BROWSER_ARM64_CONFIG = `# Layer 3 (stable): point agent-browser at a browser launcher visible inside
1117
+ # the sandbox. arm64 links the apt chromium; amd64 links Chrome for Testing in
1118
+ # Layer 5. Independent of the npm install below so it stays cached across
1090
1119
  # agent-browser version bumps.
1091
- RUN if [ "$TARGETARCH" = "arm64" ]; then \\
1092
- mkdir -p /root/.agent-browser \\
1093
- && printf '%s\\n' '{"executablePath":"/usr/bin/chromium"}' > /root/.agent-browser/config.json; \\
1120
+ RUN mkdir -p ${AGENT_BROWSER_ROOT} \\
1121
+ && printf '%s\\n' '#!/bin/sh' 'exec ${AGENT_BROWSER_CHROME_BIN} --no-sandbox "$@"' > ${AGENT_BROWSER_CHROME} \\
1122
+ && chmod 0755 ${AGENT_BROWSER_CHROME} \\
1123
+ && if [ "$TARGETARCH" = "arm64" ]; then \\
1124
+ ln -sf /usr/bin/chromium ${AGENT_BROWSER_CHROME_BIN}; \\
1094
1125
  fi`
1095
1126
 
1127
+ // Layer 4: the npm tarball ships the native binaries without the exec bit and
1128
+ // the JS launcher chmods them on first run, which fails on the read-only /usr
1129
+ // inside the sandbox, so set it at build time. The launcher runs under bun
1130
+ // because the image's `node` fallback is outside the sandbox PATH, and it
1131
+ // defaults the browser path itself because the sandbox clears image ENV.
1132
+ // An inherited AGENT_BROWSER_EXECUTABLE_PATH (operator .env) still wins.
1096
1133
  const renderAgentBrowserInstallLayer = (buildKit: boolean): string =>
1097
- `# Layer 4 (volatile): install agent-browser globally so it survives the
1098
- # runtime bind-mount over /agent/node_modules.
1099
- RUN ${bunCacheMount(buildKit)}bun install -g agent-browser@^0.33.0`
1134
+ `# Layer 4 (volatile): install agent-browser under /usr so it survives the
1135
+ # runtime bind-mount over /agent/node_modules and stays visible in bwrap.
1136
+ RUN ${bunCacheMount(buildKit)}BUN_INSTALL=${AGENT_BROWSER_ROOT} BUN_INSTALL_BIN=${AGENT_BROWSER_ROOT}/bin BUN_INSTALL_CACHE_DIR=/root/.bun/install/cache bun install -g agent-browser@^0.39.1 \\
1137
+ && chmod 0755 ${AGENT_BROWSER_PACKAGE}/bin/agent-browser-linux-* \\
1138
+ && printf '%s\\n' '#!/bin/sh' ': "\${AGENT_BROWSER_EXECUTABLE_PATH:=${AGENT_BROWSER_CHROME}}"' 'export AGENT_BROWSER_EXECUTABLE_PATH' 'exec /usr/local/bin/bun ${AGENT_BROWSER_PACKAGE}/bin/agent-browser.js "$@"' > /usr/local/bin/agent-browser \\
1139
+ && chmod 0755 /usr/local/bin/agent-browser \\
1140
+ && agent-browser --version > /dev/null`
1100
1141
 
1101
1142
  // Layer 4.5: shim the agent-browser binary with a wrapper that calls
1102
1143
  // \`agent-browser close\` before \`open\`/\`goto\`/\`navigate\` when headed
@@ -1219,7 +1260,8 @@ exec env _TYPECLAW_AGENT_BROWSER_HEADED_HANDLED=1 "$real" "$@"
1219
1260
  TYPECLAW_AGENT_BROWSER_WRAPPER_EOF`
1220
1261
 
1221
1262
  // Layer 5: download the pinned Chrome for Testing build into
1222
- // ~/.agent-browser/browsers/. NO cache mount on that path because the
1263
+ // $HOME/.agent-browser/browsers/, with HOME pointed under /usr so the
1264
+ // sandbox can see it, then link it to the stable path. NO cache mount on that path because the
1223
1265
  // runtime needs the binary in the image, and no apt cache mount either
1224
1266
  // because nothing in this layer runs apt.
1225
1267
  //
@@ -1233,7 +1275,10 @@ TYPECLAW_AGENT_BROWSER_WRAPPER_EOF`
1233
1275
  const renderChromeForTestingLayer = (): string =>
1234
1276
  `# Layer 5 (heavy, amd64 only): Chrome for Testing download.
1235
1277
  RUN if [ "$TARGETARCH" != "arm64" ]; then \\
1236
- agent-browser install; \\
1278
+ HOME=${AGENT_BROWSER_ROOT} agent-browser install \\
1279
+ && chrome="$(find ${AGENT_BROWSER_ROOT}/.agent-browser/browsers -type f -name chrome -perm -u+x | head -n 1)" \\
1280
+ && [ -n "$chrome" ] \\
1281
+ && ln -sf "$chrome" ${AGENT_BROWSER_CHROME_BIN}; \\
1237
1282
  fi`
1238
1283
 
1239
1284
  function renderOmoCliInstallLayer(enabled: boolean): string {
package/src/init/index.ts CHANGED
@@ -760,8 +760,8 @@ function addCustomModel(
760
760
  customModels[ref] = meta ?? {}
761
761
  }
762
762
 
763
- // agent-browser ships in every agent: the bundled SKILL.md (src/skills/
764
- // agent-browser/SKILL.md) is a discovery stub that calls `agent-browser
763
+ // agent-browser ships in every agent: the bundled SKILL.md (src/bundled-plugins/
764
+ // agent-browser/skills/agent-browser/SKILL.md) is a discovery stub that calls `agent-browser
765
765
  // skills get core` at runtime, so the CLI must be installed for the skill
766
766
  // to function. The Dockerfile pre-downloads Chromium too, so the agent
767
767
  // can drive a browser without any first-run setup.
@@ -769,7 +769,7 @@ function addCustomModel(
769
769
  // Must match the Dockerfile Layer 4 global install (dockerfile.ts); they are
770
770
  // two installs of the same CLI and a skew is silent. Enforced by a guard test
771
771
  // in packagejson.test.ts.
772
- export const AGENT_BROWSER_VERSION = '^0.33.0'
772
+ export const AGENT_BROWSER_VERSION = '^0.39.1'
773
773
  function buildPackageJson(root: string, name: string, platform: NodeJS.Platform): Record<string, unknown> {
774
774
  return {
775
775
  name,
@@ -812,6 +812,7 @@ export async function writeDockerAssets(root: string): Promise<DockerAssetsResul
812
812
  await writeFile(
813
813
  join(root, DOCKERFILE),
814
814
  buildDockerfile(typeclawConfig.docker.file, {
815
+ browser: typeclawConfig.browser,
815
816
  // A local-spec dev install must inline the heavy stack: its unreleased
816
817
  // version has no published `typeclaw-base` tag, so resolving a base
817
818
  // image version would pin a nonexistent `FROM ghcr.io/...:<version>`.
@@ -0,0 +1,68 @@
1
+ import { execFile } from 'node:child_process'
2
+ import { createHash } from 'node:crypto'
3
+ import { mkdir, readFile, writeFile } from 'node:fs/promises'
4
+ import { dirname, join } from 'node:path'
5
+ import { promisify } from 'node:util'
6
+
7
+ const execFileAsync = promisify(execFile)
8
+
9
+ // Lives inside node_modules so a wiped or reinstalled node_modules also drops
10
+ // the stamp, which forces the next start to re-copy the checkout.
11
+ const STAMP_FILE = join('node_modules', '.typeclaw-local-source')
12
+
13
+ // Identifies the exact source a `file:` checkout would copy: committed HEAD plus
14
+ // uncommitted edits. Returns null when the checkout is not a Git repo, so the
15
+ // caller cannot tell whether the copy is stale and keeps its old behavior.
16
+ export async function localSourceFingerprint(sourceDir: string): Promise<string | null> {
17
+ try {
18
+ const git = async (...args: string[]) =>
19
+ (await execFileAsync('git', ['-C', sourceDir, ...args], { maxBuffer: 64 * 1024 * 1024 })).stdout
20
+ const [head, diff, untracked] = await Promise.all([
21
+ git('rev-parse', 'HEAD'),
22
+ git('diff', 'HEAD'),
23
+ git('ls-files', '--others', '--exclude-standard'),
24
+ ])
25
+ // `git diff HEAD` skips untracked files, so hash their contents too: an edit
26
+ // to a new, not-yet-added file must still count as a source change.
27
+ const paths = untracked.split('\n').filter((path) => path !== '')
28
+ const untrackedHashes =
29
+ paths.length === 0
30
+ ? ''
31
+ : (
32
+ await new Promise<string>((resolve, reject) => {
33
+ const child = execFile(
34
+ 'git',
35
+ ['-C', sourceDir, 'hash-object', '--stdin-paths'],
36
+ { maxBuffer: 64 * 1024 * 1024 },
37
+ (error, stdout) => (error ? reject(error) : resolve(stdout)),
38
+ )
39
+ child.stdin?.end(paths.join('\n'))
40
+ })
41
+ ).trim()
42
+ return createHash('sha256')
43
+ .update(head)
44
+ .update('\0')
45
+ .update(diff)
46
+ .update('\0')
47
+ .update(untracked)
48
+ .update('\0')
49
+ .update(untrackedHashes)
50
+ .digest('hex')
51
+ } catch {
52
+ return null
53
+ }
54
+ }
55
+
56
+ export async function readLocalSourceStamp(cwd: string): Promise<string | null> {
57
+ try {
58
+ return (await readFile(join(cwd, STAMP_FILE), 'utf8')).trim()
59
+ } catch {
60
+ return null
61
+ }
62
+ }
63
+
64
+ export async function writeLocalSourceStamp(cwd: string, fingerprint: string): Promise<void> {
65
+ const path = join(cwd, STAMP_FILE)
66
+ await mkdir(dirname(path), { recursive: true })
67
+ await writeFile(path, `${fingerprint}\n`)
68
+ }
@@ -52,6 +52,10 @@ const PROVIDER_TO_MODELS_DEV: Record<KnownProviderId, string | null> = {
52
52
  // `kimi-for-coding` alias is surfaced regardless of upstream membership.
53
53
  'moonshot-coding': 'moonshot',
54
54
  opengateway: null,
55
+ // models.dev's `inception` catalog lists only Mercury 2 / 2.5 / Edit 2, which
56
+ // are retired for new users or don't serve chat. Surface the curated
57
+ // Mercury 3 record alone.
58
+ inception: null,
55
59
  }
56
60
 
57
61
  function upstreamProviderFor(
@@ -32,6 +32,8 @@ const PROVIDER_PROBE: Partial<Record<KnownProviderId, Probe>> = {
32
32
  // validation, because init would vouch for a key that cannot complete a single
33
33
  // request. /v1/me is the cheapest endpoint that actually 401s on a bad key.
34
34
  opengateway: { url: 'https://apis.opengateway.ai/v1/me', authHeader: 'bearer', successShape: 'json-object' },
35
+ // inception has no probe: its /v1/models is public and returns 200 for any
36
+ // key, so probing it would vouch for garbage.
35
37
  }
36
38
 
37
39
  // When a base-URL override (ANTHROPIC_BASE_URL / OPENAI_BASE_URL) points at a
@@ -194,6 +196,7 @@ export const API_KEY_DASHBOARD_URL: Partial<Record<KnownProviderId, string>> = {
194
196
  moonshot: 'https://platform.moonshot.ai/console/api-keys',
195
197
  'moonshot-coding': 'https://www.kimi.com/code/console',
196
198
  opengateway: 'https://opengateway.ai/docs/reference/guides/authentication',
199
+ inception: 'https://platform.inceptionlabs.ai',
197
200
  }
198
201
 
199
202
  // MiniMax sells the same `minimax` provider under two billing surfaces that