typeclaw 0.45.1 → 0.46.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (163) hide show
  1. package/README.md +1 -1
  2. package/package.json +3 -2
  3. package/src/agent/git-nudge.ts +2 -1
  4. package/src/agent/index.ts +44 -30
  5. package/src/agent/live-subagents.ts +18 -0
  6. package/src/agent/multimodal/index.ts +1 -1
  7. package/src/agent/multimodal/look-at.ts +78 -44
  8. package/src/agent/multimodal/looker.ts +161 -39
  9. package/src/agent/network/response-body.ts +26 -0
  10. package/src/agent/network/safe-http.ts +207 -0
  11. package/src/agent/plugin-tools.ts +377 -157
  12. package/src/agent/provider-error.ts +52 -1
  13. package/src/agent/restart/index.ts +61 -40
  14. package/src/agent/restart-handoff/index.ts +73 -4
  15. package/src/agent/reviewer-bash-policy.ts +42 -1
  16. package/src/agent/session-origin.ts +2 -0
  17. package/src/agent/subagent-drain.ts +117 -7
  18. package/src/agent/subagents.ts +49 -16
  19. package/src/agent/throttle-circuit.ts +25 -5
  20. package/src/agent/tool-error-remediation.ts +72 -0
  21. package/src/agent/tool-file-safety.ts +1310 -0
  22. package/src/agent/tools/channel-fetch-attachment.ts +10 -3
  23. package/src/agent/tools/ddg.ts +16 -2
  24. package/src/agent/tools/post-github-review.ts +199 -0
  25. package/src/agent/tools/spawn-subagent.ts +21 -18
  26. package/src/agent/tools/webfetch/fetch.ts +163 -183
  27. package/src/agent/tools/webfetch/tool.ts +2 -3
  28. package/src/agent/tools/websearch.ts +23 -2
  29. package/src/agent/tools-without-local-file-operands.ts +30 -0
  30. package/src/agent/turn-runner.ts +86 -6
  31. package/src/bundled-plugins/backup/README.md +23 -10
  32. package/src/bundled-plugins/backup/git-auth.ts +6 -4
  33. package/src/bundled-plugins/backup/index.ts +85 -44
  34. package/src/bundled-plugins/backup/runner.ts +85 -1
  35. package/src/bundled-plugins/doc-render/render.ts +93 -12
  36. package/src/bundled-plugins/doc-render/skills/typeclaw-render-pdf/SKILL.md +13 -13
  37. package/src/bundled-plugins/github-cli-auth/effective-approval.ts +16 -6
  38. package/src/bundled-plugins/github-cli-auth/gh-command.ts +555 -15
  39. package/src/bundled-plugins/github-cli-auth/git-askpass.ts +74 -26
  40. package/src/bundled-plugins/github-cli-auth/git-command.ts +224 -36
  41. package/src/bundled-plugins/github-cli-auth/graphql-auth-nudge.ts +9 -9
  42. package/src/bundled-plugins/github-cli-auth/index.ts +207 -132
  43. package/src/bundled-plugins/github-cli-auth/review-checkout.ts +138 -0
  44. package/src/bundled-plugins/github-cli-auth/token-class.ts +4 -6
  45. package/src/bundled-plugins/guard/policies/uncommitted-changes.ts +2 -1
  46. package/src/bundled-plugins/memory/README.md +32 -11
  47. package/src/bundled-plugins/memory/append-tool.ts +15 -8
  48. package/src/bundled-plugins/memory/citations.ts +22 -9
  49. package/src/bundled-plugins/memory/dreaming.ts +13 -8
  50. package/src/bundled-plugins/memory/find-entry-tool.ts +4 -0
  51. package/src/bundled-plugins/memory/index.ts +0 -4
  52. package/src/bundled-plugins/memory/load-memory.ts +8 -3
  53. package/src/bundled-plugins/memory/provenance-index.ts +717 -0
  54. package/src/bundled-plugins/memory/provenance-sanitize.ts +40 -0
  55. package/src/bundled-plugins/memory/references/store-reference-tool.ts +4 -0
  56. package/src/bundled-plugins/memory/search-tool.ts +163 -60
  57. package/src/bundled-plugins/memory/stream-events.ts +2 -0
  58. package/src/bundled-plugins/memory/vector/embed-threads.ts +36 -0
  59. package/src/bundled-plugins/memory/vector/embedder.ts +19 -1
  60. package/src/bundled-plugins/memory/vector/hybrid.ts +126 -13
  61. package/src/bundled-plugins/researcher/write-report.ts +8 -5
  62. package/src/bundled-plugins/reviewer/index.ts +2 -2
  63. package/src/bundled-plugins/reviewer/reviewer.ts +10 -3
  64. package/src/bundled-plugins/reviewer/skills/code-review.ts +19 -9
  65. package/src/bundled-plugins/scout/scout.ts +8 -0
  66. package/src/bundled-plugins/security/index.ts +4 -4
  67. package/src/bundled-plugins/security/policies/outbound-secret-scan.ts +1 -0
  68. package/src/bundled-plugins/security/policies/private-surface-read.ts +787 -36
  69. package/src/bundled-plugins/security/policies/secret-exfil-read.ts +1 -0
  70. package/src/bundled-plugins/security/policies/ssrf.ts +147 -42
  71. package/src/channels/adapters/discord-bot-channel-resolver.ts +26 -14
  72. package/src/channels/adapters/discord-bot-thread-room.ts +44 -12
  73. package/src/channels/adapters/discord-bot.ts +66 -6
  74. package/src/channels/adapters/discord-channel-resolver.ts +91 -23
  75. package/src/channels/adapters/discord-id.ts +4 -0
  76. package/src/channels/adapters/discord-resolver-cache.ts +41 -0
  77. package/src/channels/adapters/discord.ts +57 -7
  78. package/src/channels/adapters/github/auth-app.ts +41 -12
  79. package/src/channels/adapters/github/inbound.ts +11 -0
  80. package/src/channels/adapters/github/index.ts +71 -65
  81. package/src/channels/adapters/github/reconcile-cooldown-store.ts +178 -0
  82. package/src/channels/adapters/github/reconcile-open-prs.ts +31 -0
  83. package/src/channels/adapters/github/review-submitter.ts +302 -0
  84. package/src/channels/adapters/kakaotalk-channel-resolver.ts +5 -3
  85. package/src/channels/adapters/kakaotalk-fetch-attachment.ts +8 -4
  86. package/src/channels/adapters/kakaotalk-typing.ts +17 -15
  87. package/src/channels/adapters/slack-attachment-download.ts +71 -0
  88. package/src/channels/adapters/slack-bot-edit.ts +85 -20
  89. package/src/channels/adapters/slack-bot.ts +26 -10
  90. package/src/channels/adapters/slack-classify.ts +21 -2
  91. package/src/channels/adapters/slack-format.ts +245 -0
  92. package/src/channels/adapters/slack.ts +59 -7
  93. package/src/channels/adapters/telegram-bot.ts +18 -5
  94. package/src/channels/adapters/webex-bot.ts +8 -3
  95. package/src/channels/adapters/webex.ts +8 -3
  96. package/src/channels/fetch-attachment.ts +43 -0
  97. package/src/{bundled-plugins/github-cli-auth/approve-idempotency.ts → channels/github-review-verdict-coordinator.ts} +25 -1
  98. package/src/channels/github-token-bridge.ts +12 -6
  99. package/src/channels/manager.ts +9 -0
  100. package/src/channels/router.ts +248 -6
  101. package/src/channels/types.ts +28 -1
  102. package/src/cli/channel.ts +1 -1
  103. package/src/cli/init.ts +1 -1
  104. package/src/cli/model.ts +57 -7
  105. package/src/compose/stop.ts +17 -5
  106. package/src/config/config.ts +6 -6
  107. package/src/config/models-mutation.ts +13 -1
  108. package/src/config/providers.ts +176 -0
  109. package/src/container/docker-app.ts +42 -13
  110. package/src/container/start.ts +62 -10
  111. package/src/cron/bridge.ts +9 -2
  112. package/src/doctor/checks.ts +8 -3
  113. package/src/doctor/commit.ts +2 -1
  114. package/src/doctor/file-ownership.ts +52 -0
  115. package/src/dreams/git.ts +2 -1
  116. package/src/git/bound-gc-config.ts +82 -0
  117. package/src/git/hookless.ts +5 -0
  118. package/src/git/reconcile-ignored.ts +18 -5
  119. package/src/git/system-commit.ts +12 -6
  120. package/src/hostd/spawn.ts +133 -47
  121. package/src/init/dockerfile.ts +99 -5
  122. package/src/init/index.ts +17 -5
  123. package/src/init/models-dev.ts +4 -0
  124. package/src/init/validate-api-key.ts +2 -0
  125. package/src/inspect/replay.ts +21 -9
  126. package/src/inspect/session-list.ts +71 -33
  127. package/src/mcp/tools.ts +17 -3
  128. package/src/network/internal-destinations.ts +267 -0
  129. package/src/permissions/builtins.ts +3 -1
  130. package/src/plugin/context.ts +2 -0
  131. package/src/plugin/index.ts +1 -0
  132. package/src/plugin/manager.ts +4 -0
  133. package/src/plugin/types.ts +22 -0
  134. package/src/run/index.ts +40 -0
  135. package/src/run/llm-fetch-observer.ts +41 -4
  136. package/src/sandbox/build.ts +37 -15
  137. package/src/sandbox/canonical-secrets.ts +18 -0
  138. package/src/sandbox/env-exposure.ts +83 -0
  139. package/src/sandbox/errors.ts +13 -6
  140. package/src/sandbox/hidden-paths.ts +102 -44
  141. package/src/sandbox/index.ts +22 -4
  142. package/src/sandbox/package-install.ts +3 -27
  143. package/src/sandbox/policy.ts +16 -28
  144. package/src/sandbox/privileged-runtime.ts +256 -0
  145. package/src/sandbox/session-tmp.ts +8 -2
  146. package/src/sandbox/writable-zones.ts +204 -140
  147. package/src/secrets/index.ts +8 -0
  148. package/src/secrets/refresh-provider-oauth.ts +128 -0
  149. package/src/server/command-runner.ts +48 -4
  150. package/src/server/index.ts +4 -0
  151. package/src/skills/typeclaw-channel-github/SKILL.md +49 -56
  152. package/src/skills/typeclaw-claude-code/SKILL.md +24 -60
  153. package/src/skills/typeclaw-claude-code/references/auth-flow.md +17 -158
  154. package/src/skills/typeclaw-codex-cli/SKILL.md +19 -49
  155. package/src/skills/typeclaw-codex-cli/references/auth-flow.md +17 -154
  156. package/src/skills/typeclaw-config/SKILL.md +27 -11
  157. package/src/skills/typeclaw-config/references/recommended-mounts.md +24 -24
  158. package/src/skills/typeclaw-github-contributing/SKILL.md +23 -26
  159. package/src/skills/typeclaw-memory/SKILL.md +9 -3
  160. package/src/skills/typeclaw-permissions/SKILL.md +36 -19
  161. package/src/skills/typeclaw-plugins/SKILL.md +37 -0
  162. package/src/usage/scan.ts +11 -2
  163. package/typeclaw.schema.json +25 -0
package/src/usage/scan.ts CHANGED
@@ -82,9 +82,15 @@ async function* readSessionFile(file: string, opts: ScanOptions): AsyncGenerator
82
82
  // Stays 'unknown' for legacy files (no stamp at all) so usage attribution
83
83
  // surfaces them as a distinct bucket rather than dropping the rows.
84
84
  const ctx: ParseCtx = { originKind: 'unknown', originPinned: false }
85
+ // Explicit reader + `finally` cancel so a consumer that abandons the generator
86
+ // early (or an exception mid-scan) releases the file descriptor deterministically
87
+ // instead of leaking it until GC — the scan runs over every session file on disk.
88
+ const reader = stream.getReader()
85
89
  try {
86
- for await (const chunk of stream) {
87
- buf += decoder.decode(chunk, { stream: true })
90
+ while (true) {
91
+ const { done, value } = await reader.read()
92
+ if (done) break
93
+ buf += decoder.decode(value, { stream: true })
88
94
  let nl = buf.indexOf('\n')
89
95
  while (nl !== -1) {
90
96
  const line = buf.slice(0, nl)
@@ -97,6 +103,9 @@ async function* readSessionFile(file: string, opts: ScanOptions): AsyncGenerator
97
103
  } catch (err) {
98
104
  opts.onWarn?.(`error reading ${basename}: ${describeFileError(err)}`)
99
105
  return
106
+ } finally {
107
+ await reader.cancel().catch(() => {})
108
+ reader.releaseLock()
100
109
  }
101
110
  // Tail line with no terminating \n: only emit if it parses cleanly so a
102
111
  // half-written record from a live writer is silently skipped (parseLine
@@ -57,6 +57,10 @@
57
57
  "minimax/MiniMax-M2",
58
58
  "deepseek/deepseek-v4-flash",
59
59
  "deepseek/deepseek-v4-pro",
60
+ "upstage/solar-open2",
61
+ "upstage/solar-pro3",
62
+ "upstage/solar-pro2",
63
+ "upstage/solar-mini",
60
64
  "moonshot/kimi-k2.7-code",
61
65
  "moonshot/kimi-k2.6",
62
66
  "moonshot/kimi-k2.5",
@@ -109,6 +113,10 @@
109
113
  "minimax/MiniMax-M2",
110
114
  "deepseek/deepseek-v4-flash",
111
115
  "deepseek/deepseek-v4-pro",
116
+ "upstage/solar-open2",
117
+ "upstage/solar-pro3",
118
+ "upstage/solar-pro2",
119
+ "upstage/solar-mini",
112
120
  "moonshot/kimi-k2.7-code",
113
121
  "moonshot/kimi-k2.6",
114
122
  "moonshot/kimi-k2.5",
@@ -162,6 +170,10 @@
162
170
  "minimax/MiniMax-M2",
163
171
  "deepseek/deepseek-v4-flash",
164
172
  "deepseek/deepseek-v4-pro",
173
+ "upstage/solar-open2",
174
+ "upstage/solar-pro3",
175
+ "upstage/solar-pro2",
176
+ "upstage/solar-mini",
165
177
  "moonshot/kimi-k2.7-code",
166
178
  "moonshot/kimi-k2.6",
167
179
  "moonshot/kimi-k2.5",
@@ -213,6 +225,10 @@
213
225
  "minimax/MiniMax-M2",
214
226
  "deepseek/deepseek-v4-flash",
215
227
  "deepseek/deepseek-v4-pro",
228
+ "upstage/solar-open2",
229
+ "upstage/solar-pro3",
230
+ "upstage/solar-pro2",
231
+ "upstage/solar-mini",
216
232
  "moonshot/kimi-k2.7-code",
217
233
  "moonshot/kimi-k2.6",
218
234
  "moonshot/kimi-k2.5",
@@ -265,6 +281,10 @@
265
281
  "minimax/MiniMax-M2",
266
282
  "deepseek/deepseek-v4-flash",
267
283
  "deepseek/deepseek-v4-pro",
284
+ "upstage/solar-open2",
285
+ "upstage/solar-pro3",
286
+ "upstage/solar-pro2",
287
+ "upstage/solar-mini",
268
288
  "moonshot/kimi-k2.7-code",
269
289
  "moonshot/kimi-k2.6",
270
290
  "moonshot/kimi-k2.5",
@@ -2912,6 +2932,7 @@
2912
2932
  "enabled": true,
2913
2933
  "idleMs": 30000,
2914
2934
  "pushToOrigin": true,
2935
+ "maintenance": true,
2915
2936
  "commitTimeoutMs": 30000,
2916
2937
  "networkTimeoutMs": 60000
2917
2938
  },
@@ -2931,6 +2952,10 @@
2931
2952
  "default": true,
2932
2953
  "type": "boolean"
2933
2954
  },
2955
+ "maintenance": {
2956
+ "default": true,
2957
+ "type": "boolean"
2958
+ },
2934
2959
  "commitTimeoutMs": {
2935
2960
  "default": 30000,
2936
2961
  "type": "integer",