@namzu/sdk 68.0.1 → 69.1.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 (492) hide show
  1. package/CHANGELOG.md +96 -0
  2. package/dist/agents/QueryAgent.d.ts.map +1 -1
  3. package/dist/agents/QueryAgent.js +2 -0
  4. package/dist/agents/QueryAgent.js.map +1 -1
  5. package/dist/authorization/skill-grant.d.ts.map +1 -1
  6. package/dist/authorization/skill-grant.js +1 -0
  7. package/dist/authorization/skill-grant.js.map +1 -1
  8. package/dist/bridge/acp/permission.d.ts +10 -0
  9. package/dist/bridge/acp/permission.d.ts.map +1 -1
  10. package/dist/bridge/acp/permission.js.map +1 -1
  11. package/dist/bridge/acp/server.d.ts +12 -0
  12. package/dist/bridge/acp/server.d.ts.map +1 -1
  13. package/dist/bridge/acp/server.js +21 -0
  14. package/dist/bridge/acp/server.js.map +1 -1
  15. package/dist/compaction/context-window.d.ts +8 -0
  16. package/dist/compaction/context-window.d.ts.map +1 -1
  17. package/dist/compaction/context-window.js +14 -0
  18. package/dist/compaction/context-window.js.map +1 -1
  19. package/dist/compaction/loaded-skills.d.ts +10 -0
  20. package/dist/compaction/loaded-skills.d.ts.map +1 -1
  21. package/dist/compaction/loaded-skills.js +45 -1
  22. package/dist/compaction/loaded-skills.js.map +1 -1
  23. package/dist/compaction/manager.d.ts +8 -0
  24. package/dist/compaction/manager.d.ts.map +1 -1
  25. package/dist/compaction/manager.js +31 -0
  26. package/dist/compaction/manager.js.map +1 -1
  27. package/dist/compaction/manual.d.ts.map +1 -1
  28. package/dist/compaction/manual.js +7 -1
  29. package/dist/compaction/manual.js.map +1 -1
  30. package/dist/compaction/model-summary.js +2 -2
  31. package/dist/compaction/model-summary.js.map +1 -1
  32. package/dist/compaction/restore.d.ts +8 -0
  33. package/dist/compaction/restore.d.ts.map +1 -1
  34. package/dist/compaction/restore.js +65 -0
  35. package/dist/compaction/restore.js.map +1 -1
  36. package/dist/compaction/salience/working-set.d.ts.map +1 -1
  37. package/dist/compaction/salience/working-set.js +2 -2
  38. package/dist/compaction/salience/working-set.js.map +1 -1
  39. package/dist/compaction/tool-result-editing.d.ts +6 -0
  40. package/dist/compaction/tool-result-editing.d.ts.map +1 -1
  41. package/dist/compaction/tool-result-editing.js +7 -1
  42. package/dist/compaction/tool-result-editing.js.map +1 -1
  43. package/dist/compaction/types.d.ts +2 -0
  44. package/dist/compaction/types.d.ts.map +1 -1
  45. package/dist/compaction/wire.d.ts.map +1 -1
  46. package/dist/compaction/wire.js +4 -0
  47. package/dist/compaction/wire.js.map +1 -1
  48. package/dist/connector/index.d.ts +2 -2
  49. package/dist/connector/index.d.ts.map +1 -1
  50. package/dist/connector/index.js +1 -1
  51. package/dist/connector/index.js.map +1 -1
  52. package/dist/connector/mcp/client.d.ts +29 -0
  53. package/dist/connector/mcp/client.d.ts.map +1 -1
  54. package/dist/connector/mcp/client.js +59 -2
  55. package/dist/connector/mcp/client.js.map +1 -1
  56. package/dist/connector/mcp/errors.d.ts +7 -0
  57. package/dist/connector/mcp/errors.d.ts.map +1 -1
  58. package/dist/connector/mcp/errors.js +14 -0
  59. package/dist/connector/mcp/errors.js.map +1 -1
  60. package/dist/connector/mcp/index.d.ts +5 -1
  61. package/dist/connector/mcp/index.d.ts.map +1 -1
  62. package/dist/connector/mcp/index.js +3 -1
  63. package/dist/connector/mcp/index.js.map +1 -1
  64. package/dist/connector/mcp/skill-source.d.ts +144 -0
  65. package/dist/connector/mcp/skill-source.d.ts.map +1 -0
  66. package/dist/connector/mcp/skill-source.js +375 -0
  67. package/dist/connector/mcp/skill-source.js.map +1 -0
  68. package/dist/connector/mcp/skills.d.ts +137 -0
  69. package/dist/connector/mcp/skills.d.ts.map +1 -0
  70. package/dist/connector/mcp/skills.js +303 -0
  71. package/dist/connector/mcp/skills.js.map +1 -0
  72. package/dist/manager/session/turn-recorder.d.ts.map +1 -1
  73. package/dist/manager/session/turn-recorder.js +23 -1
  74. package/dist/manager/session/turn-recorder.js.map +1 -1
  75. package/dist/network/audit.d.ts +1 -1
  76. package/dist/network/audit.d.ts.map +1 -1
  77. package/dist/network/audit.js +2 -0
  78. package/dist/network/audit.js.map +1 -1
  79. package/dist/network/computer.d.ts +107 -0
  80. package/dist/network/computer.d.ts.map +1 -0
  81. package/dist/network/computer.js +250 -0
  82. package/dist/network/computer.js.map +1 -0
  83. package/dist/network/index.d.ts +2 -0
  84. package/dist/network/index.d.ts.map +1 -1
  85. package/dist/network/index.js +1 -0
  86. package/dist/network/index.js.map +1 -1
  87. package/dist/network/join.d.ts +13 -1
  88. package/dist/network/join.d.ts.map +1 -1
  89. package/dist/network/join.js +21 -3
  90. package/dist/network/join.js.map +1 -1
  91. package/dist/network/roster.d.ts +5 -0
  92. package/dist/network/roster.d.ts.map +1 -1
  93. package/dist/network/roster.js.map +1 -1
  94. package/dist/network/service.d.ts +12 -2
  95. package/dist/network/service.d.ts.map +1 -1
  96. package/dist/network/service.js +539 -60
  97. package/dist/network/service.js.map +1 -1
  98. package/dist/network/store.d.ts +33 -1
  99. package/dist/network/store.d.ts.map +1 -1
  100. package/dist/network/store.js +48 -4
  101. package/dist/network/store.js.map +1 -1
  102. package/dist/network/transport.d.ts +1 -1
  103. package/dist/network/transport.js +1 -1
  104. package/dist/network/wire.d.ts +14 -0
  105. package/dist/network/wire.d.ts.map +1 -1
  106. package/dist/network/wire.js +17 -1
  107. package/dist/network/wire.js.map +1 -1
  108. package/dist/plugin/shell-hook-tool-names.d.ts.map +1 -1
  109. package/dist/plugin/shell-hook-tool-names.js +1 -0
  110. package/dist/plugin/shell-hook-tool-names.js.map +1 -1
  111. package/dist/plugin/shell-hook.d.ts +8 -3
  112. package/dist/plugin/shell-hook.d.ts.map +1 -1
  113. package/dist/plugin/shell-hook.js +132 -7
  114. package/dist/plugin/shell-hook.js.map +1 -1
  115. package/dist/prompt/coding-agent-doctrine.d.ts +4 -4
  116. package/dist/prompt/coding-agent-doctrine.d.ts.map +1 -1
  117. package/dist/prompt/coding-agent-doctrine.js +7 -2
  118. package/dist/prompt/coding-agent-doctrine.js.map +1 -1
  119. package/dist/provider/fallback.d.ts.map +1 -1
  120. package/dist/provider/fallback.js +9 -0
  121. package/dist/provider/fallback.js.map +1 -1
  122. package/dist/provider/idle-timeout.d.ts.map +1 -1
  123. package/dist/provider/idle-timeout.js +8 -0
  124. package/dist/provider/idle-timeout.js.map +1 -1
  125. package/dist/provider/instrumentation.d.ts.map +1 -1
  126. package/dist/provider/instrumentation.js +10 -0
  127. package/dist/provider/instrumentation.js.map +1 -1
  128. package/dist/provider/model-window-suffix.d.ts.map +1 -1
  129. package/dist/provider/model-window-suffix.js +2 -0
  130. package/dist/provider/model-window-suffix.js.map +1 -1
  131. package/dist/provider/retry.d.ts.map +1 -1
  132. package/dist/provider/retry.js +8 -0
  133. package/dist/provider/retry.js.map +1 -1
  134. package/dist/public-runtime.d.ts +10 -7
  135. package/dist/public-runtime.d.ts.map +1 -1
  136. package/dist/public-runtime.js +12 -5
  137. package/dist/public-runtime.js.map +1 -1
  138. package/dist/public-tools.d.ts +7 -4
  139. package/dist/public-tools.d.ts.map +1 -1
  140. package/dist/public-tools.js +9 -3
  141. package/dist/public-tools.js.map +1 -1
  142. package/dist/public-types.d.ts +4 -1
  143. package/dist/public-types.d.ts.map +1 -1
  144. package/dist/registry/tool/presentation.d.ts +8 -1
  145. package/dist/registry/tool/presentation.d.ts.map +1 -1
  146. package/dist/registry/tool/presentation.js +14 -5
  147. package/dist/registry/tool/presentation.js.map +1 -1
  148. package/dist/runtime/jobs/registry.d.ts.map +1 -1
  149. package/dist/runtime/jobs/registry.js +2 -1
  150. package/dist/runtime/jobs/registry.js.map +1 -1
  151. package/dist/runtime/query/auto-review/classifier.d.ts.map +1 -1
  152. package/dist/runtime/query/auto-review/classifier.js +19 -3
  153. package/dist/runtime/query/auto-review/classifier.js.map +1 -1
  154. package/dist/runtime/query/auto-review/failure.d.ts +12 -0
  155. package/dist/runtime/query/auto-review/failure.d.ts.map +1 -0
  156. package/dist/runtime/query/auto-review/failure.js +46 -0
  157. package/dist/runtime/query/auto-review/failure.js.map +1 -0
  158. package/dist/runtime/query/auto-review/index.d.ts +1 -0
  159. package/dist/runtime/query/auto-review/index.d.ts.map +1 -1
  160. package/dist/runtime/query/auto-review/index.js +1 -0
  161. package/dist/runtime/query/auto-review/index.js.map +1 -1
  162. package/dist/runtime/query/executor/tool-call-admission.d.ts.map +1 -1
  163. package/dist/runtime/query/executor/tool-call-admission.js +10 -1
  164. package/dist/runtime/query/executor/tool-call-admission.js.map +1 -1
  165. package/dist/runtime/query/executor.d.ts +12 -0
  166. package/dist/runtime/query/executor.d.ts.map +1 -1
  167. package/dist/runtime/query/executor.js +43 -9
  168. package/dist/runtime/query/executor.js.map +1 -1
  169. package/dist/runtime/query/file-evidence-replay.d.ts.map +1 -1
  170. package/dist/runtime/query/file-evidence-replay.js +6 -6
  171. package/dist/runtime/query/file-evidence-replay.js.map +1 -1
  172. package/dist/runtime/query/index.d.ts +4 -0
  173. package/dist/runtime/query/index.d.ts.map +1 -1
  174. package/dist/runtime/query/index.js +40 -1
  175. package/dist/runtime/query/index.js.map +1 -1
  176. package/dist/runtime/query/iteration/index.d.ts.map +1 -1
  177. package/dist/runtime/query/iteration/index.js +2 -0
  178. package/dist/runtime/query/iteration/index.js.map +1 -1
  179. package/dist/runtime/query/iteration/phases/compaction.d.ts.map +1 -1
  180. package/dist/runtime/query/iteration/phases/compaction.js +21 -3
  181. package/dist/runtime/query/iteration/phases/compaction.js.map +1 -1
  182. package/dist/runtime/query/iteration/phases/context.d.ts +4 -0
  183. package/dist/runtime/query/iteration/phases/context.d.ts.map +1 -1
  184. package/dist/runtime/query/iteration/phases/context.js.map +1 -1
  185. package/dist/runtime/query/iteration/phases/per-call-review.d.ts +6 -2
  186. package/dist/runtime/query/iteration/phases/per-call-review.d.ts.map +1 -1
  187. package/dist/runtime/query/iteration/phases/per-call-review.js +24 -9
  188. package/dist/runtime/query/iteration/phases/per-call-review.js.map +1 -1
  189. package/dist/runtime/query/iteration/step-shaping.d.ts.map +1 -1
  190. package/dist/runtime/query/iteration/step-shaping.js +4 -0
  191. package/dist/runtime/query/iteration/step-shaping.js.map +1 -1
  192. package/dist/runtime/query/prepare-turn.d.ts +5 -1
  193. package/dist/runtime/query/prepare-turn.d.ts.map +1 -1
  194. package/dist/runtime/query/prepare-turn.js +13 -3
  195. package/dist/runtime/query/prepare-turn.js.map +1 -1
  196. package/dist/runtime/query/review-policy.d.ts +15 -4
  197. package/dist/runtime/query/review-policy.d.ts.map +1 -1
  198. package/dist/runtime/query/review-policy.js +15 -4
  199. package/dist/runtime/query/review-policy.js.map +1 -1
  200. package/dist/runtime/query/shell-line-escalation.d.ts +24 -0
  201. package/dist/runtime/query/shell-line-escalation.d.ts.map +1 -0
  202. package/dist/runtime/query/shell-line-escalation.js +38 -0
  203. package/dist/runtime/query/shell-line-escalation.js.map +1 -0
  204. package/dist/runtime/query/tooling.d.ts +7 -0
  205. package/dist/runtime/query/tooling.d.ts.map +1 -1
  206. package/dist/runtime/query/tooling.js +2 -0
  207. package/dist/runtime/query/tooling.js.map +1 -1
  208. package/dist/runtime/query/turn/outcome-ledger.d.ts +4 -0
  209. package/dist/runtime/query/turn/outcome-ledger.d.ts.map +1 -1
  210. package/dist/runtime/query/turn/outcome-ledger.js +47 -1
  211. package/dist/runtime/query/turn/outcome-ledger.js.map +1 -1
  212. package/dist/sandbox/provider/local.d.ts.map +1 -1
  213. package/dist/sandbox/provider/local.js +3 -1
  214. package/dist/sandbox/provider/local.js.map +1 -1
  215. package/dist/scheduler/local.d.ts.map +1 -1
  216. package/dist/scheduler/local.js +3 -1
  217. package/dist/scheduler/local.js.map +1 -1
  218. package/dist/skills/index.d.ts +4 -0
  219. package/dist/skills/index.d.ts.map +1 -1
  220. package/dist/skills/index.js +2 -0
  221. package/dist/skills/index.js.map +1 -1
  222. package/dist/skills/inline-shell-host.d.ts +103 -0
  223. package/dist/skills/inline-shell-host.d.ts.map +1 -0
  224. package/dist/skills/inline-shell-host.js +238 -0
  225. package/dist/skills/inline-shell-host.js.map +1 -0
  226. package/dist/skills/inline-shell.d.ts +176 -0
  227. package/dist/skills/inline-shell.d.ts.map +1 -0
  228. package/dist/skills/inline-shell.js +646 -0
  229. package/dist/skills/inline-shell.js.map +1 -0
  230. package/dist/store/index.d.ts +2 -0
  231. package/dist/store/index.d.ts.map +1 -1
  232. package/dist/store/index.js +1 -0
  233. package/dist/store/index.js.map +1 -1
  234. package/dist/store/task/file.d.ts +124 -0
  235. package/dist/store/task/file.d.ts.map +1 -0
  236. package/dist/store/task/file.js +498 -0
  237. package/dist/store/task/file.js.map +1 -0
  238. package/dist/teams/backend.d.ts +28 -0
  239. package/dist/teams/backend.d.ts.map +1 -0
  240. package/dist/teams/backend.js +2 -0
  241. package/dist/teams/backend.js.map +1 -0
  242. package/dist/teams/fs-sync.d.ts +19 -0
  243. package/dist/teams/fs-sync.d.ts.map +1 -0
  244. package/dist/teams/fs-sync.js +81 -0
  245. package/dist/teams/fs-sync.js.map +1 -0
  246. package/dist/teams/index.d.ts +14 -0
  247. package/dist/teams/index.d.ts.map +1 -0
  248. package/dist/teams/index.js +11 -0
  249. package/dist/teams/index.js.map +1 -0
  250. package/dist/teams/names.d.ts +15 -0
  251. package/dist/teams/names.d.ts.map +1 -0
  252. package/dist/teams/names.js +43 -0
  253. package/dist/teams/names.js.map +1 -0
  254. package/dist/teams/store.d.ts +133 -0
  255. package/dist/teams/store.d.ts.map +1 -0
  256. package/dist/teams/store.js +536 -0
  257. package/dist/teams/store.js.map +1 -0
  258. package/dist/teams/types.d.ts +97 -0
  259. package/dist/teams/types.d.ts.map +1 -0
  260. package/dist/teams/types.js +70 -0
  261. package/dist/teams/types.js.map +1 -0
  262. package/dist/tools/admit-facts.d.ts.map +1 -1
  263. package/dist/tools/admit-facts.js +28 -0
  264. package/dist/tools/admit-facts.js.map +1 -1
  265. package/dist/tools/builtins/bash.d.ts.map +1 -1
  266. package/dist/tools/builtins/bash.js +5 -2
  267. package/dist/tools/builtins/bash.js.map +1 -1
  268. package/dist/tools/builtins/browser.js +1 -1
  269. package/dist/tools/builtins/browser.js.map +1 -1
  270. package/dist/tools/builtins/computer-use.d.ts +60 -2
  271. package/dist/tools/builtins/computer-use.d.ts.map +1 -1
  272. package/dist/tools/builtins/computer-use.js +695 -80
  273. package/dist/tools/builtins/computer-use.js.map +1 -1
  274. package/dist/tools/builtins/content-fingerprint.d.ts.map +1 -1
  275. package/dist/tools/builtins/content-fingerprint.js +2 -1
  276. package/dist/tools/builtins/content-fingerprint.js.map +1 -1
  277. package/dist/tools/builtins/edit-apply.d.ts +1 -0
  278. package/dist/tools/builtins/edit-apply.d.ts.map +1 -1
  279. package/dist/tools/builtins/edit-apply.js +108 -21
  280. package/dist/tools/builtins/edit-apply.js.map +1 -1
  281. package/dist/tools/builtins/edit-match.d.ts +37 -0
  282. package/dist/tools/builtins/edit-match.d.ts.map +1 -1
  283. package/dist/tools/builtins/edit-match.js +193 -0
  284. package/dist/tools/builtins/edit-match.js.map +1 -1
  285. package/dist/tools/builtins/edit.d.ts.map +1 -1
  286. package/dist/tools/builtins/edit.js +14 -7
  287. package/dist/tools/builtins/edit.js.map +1 -1
  288. package/dist/tools/builtins/exit-semantics.d.ts +8 -0
  289. package/dist/tools/builtins/exit-semantics.d.ts.map +1 -1
  290. package/dist/tools/builtins/exit-semantics.js +19 -0
  291. package/dist/tools/builtins/exit-semantics.js.map +1 -1
  292. package/dist/tools/builtins/index.d.ts +3 -1
  293. package/dist/tools/builtins/index.d.ts.map +1 -1
  294. package/dist/tools/builtins/index.js +1 -0
  295. package/dist/tools/builtins/index.js.map +1 -1
  296. package/dist/tools/builtins/present-file.d.ts +24 -0
  297. package/dist/tools/builtins/present-file.d.ts.map +1 -0
  298. package/dist/tools/builtins/present-file.js +116 -0
  299. package/dist/tools/builtins/present-file.js.map +1 -0
  300. package/dist/tools/builtins/read-file.js +1 -1
  301. package/dist/tools/builtins/read-file.js.map +1 -1
  302. package/dist/tools/builtins/read-render.d.ts +12 -1
  303. package/dist/tools/builtins/read-render.d.ts.map +1 -1
  304. package/dist/tools/builtins/read-render.js +16 -3
  305. package/dist/tools/builtins/read-render.js.map +1 -1
  306. package/dist/tools/builtins/search-tools.d.ts +10 -0
  307. package/dist/tools/builtins/search-tools.d.ts.map +1 -1
  308. package/dist/tools/builtins/search-tools.js +36 -2
  309. package/dist/tools/builtins/search-tools.js.map +1 -1
  310. package/dist/tools/builtins/skill.d.ts +31 -0
  311. package/dist/tools/builtins/skill.d.ts.map +1 -1
  312. package/dist/tools/builtins/skill.js +232 -88
  313. package/dist/tools/builtins/skill.js.map +1 -1
  314. package/dist/tools/builtins/wait-for-job.d.ts.map +1 -1
  315. package/dist/tools/builtins/wait-for-job.js +5 -0
  316. package/dist/tools/builtins/wait-for-job.js.map +1 -1
  317. package/dist/tools/builtins/web.d.ts.map +1 -1
  318. package/dist/tools/builtins/web.js +13 -2
  319. package/dist/tools/builtins/web.js.map +1 -1
  320. package/dist/tools/task/create.d.ts.map +1 -1
  321. package/dist/tools/task/create.js +13 -4
  322. package/dist/tools/task/create.js.map +1 -1
  323. package/dist/tools/task/get.d.ts +8 -0
  324. package/dist/tools/task/get.d.ts.map +1 -0
  325. package/dist/tools/task/get.js +51 -0
  326. package/dist/tools/task/get.js.map +1 -0
  327. package/dist/tools/task/index.d.ts +7 -0
  328. package/dist/tools/task/index.d.ts.map +1 -1
  329. package/dist/tools/task/index.js +10 -2
  330. package/dist/tools/task/index.js.map +1 -1
  331. package/dist/tools/task/list.d.ts.map +1 -1
  332. package/dist/tools/task/list.js +10 -2
  333. package/dist/tools/task/list.js.map +1 -1
  334. package/dist/tools/task/number.d.ts +13 -0
  335. package/dist/tools/task/number.d.ts.map +1 -0
  336. package/dist/tools/task/number.js +30 -0
  337. package/dist/tools/task/number.js.map +1 -0
  338. package/dist/tools/task/present.d.ts.map +1 -1
  339. package/dist/tools/task/present.js +17 -3
  340. package/dist/tools/task/present.js.map +1 -1
  341. package/dist/tools/task/update.d.ts +2 -1
  342. package/dist/tools/task/update.d.ts.map +1 -1
  343. package/dist/tools/task/update.js +87 -20
  344. package/dist/tools/task/update.js.map +1 -1
  345. package/dist/types/acp/index.d.ts +10 -0
  346. package/dist/types/acp/index.d.ts.map +1 -1
  347. package/dist/types/agent/base.d.ts +4 -0
  348. package/dist/types/agent/base.d.ts.map +1 -1
  349. package/dist/types/agent/scheduler.d.ts +9 -0
  350. package/dist/types/agent/scheduler.d.ts.map +1 -1
  351. package/dist/types/computer-use/index.d.ts +7 -0
  352. package/dist/types/computer-use/index.d.ts.map +1 -1
  353. package/dist/types/computer-use/index.js.map +1 -1
  354. package/dist/types/connector/mcp.d.ts +10 -0
  355. package/dist/types/connector/mcp.d.ts.map +1 -1
  356. package/dist/types/permission/index.d.ts +20 -0
  357. package/dist/types/permission/index.d.ts.map +1 -1
  358. package/dist/types/permission/index.js +25 -0
  359. package/dist/types/permission/index.js.map +1 -1
  360. package/dist/types/plugin/index.d.ts +47 -3
  361. package/dist/types/plugin/index.d.ts.map +1 -1
  362. package/dist/types/plugin/index.js +4 -0
  363. package/dist/types/plugin/index.js.map +1 -1
  364. package/dist/types/provider/chat.d.ts +8 -0
  365. package/dist/types/provider/chat.d.ts.map +1 -1
  366. package/dist/types/provider/interface.d.ts +16 -0
  367. package/dist/types/provider/interface.d.ts.map +1 -1
  368. package/dist/types/provider/model.d.ts +6 -0
  369. package/dist/types/provider/model.d.ts.map +1 -1
  370. package/dist/types/provider/stream.d.ts +2 -0
  371. package/dist/types/provider/stream.d.ts.map +1 -1
  372. package/dist/types/tool/index.d.ts +28 -2
  373. package/dist/types/tool/index.d.ts.map +1 -1
  374. package/dist/types/tool/index.js.map +1 -1
  375. package/dist/types/tool/presentation.d.ts +15 -0
  376. package/dist/types/tool/presentation.d.ts.map +1 -1
  377. package/dist/utils/node-on-path.d.ts +27 -0
  378. package/dist/utils/node-on-path.d.ts.map +1 -0
  379. package/dist/utils/node-on-path.js +70 -0
  380. package/dist/utils/node-on-path.js.map +1 -0
  381. package/package.json +1 -1
  382. package/src/agents/QueryAgent.ts +2 -0
  383. package/src/authorization/skill-grant.ts +1 -0
  384. package/src/bridge/acp/permission.ts +11 -1
  385. package/src/bridge/acp/server.ts +26 -0
  386. package/src/compaction/context-window.ts +18 -0
  387. package/src/compaction/loaded-skills.ts +42 -1
  388. package/src/compaction/manager.ts +28 -0
  389. package/src/compaction/manual.ts +9 -1
  390. package/src/compaction/model-summary.ts +2 -2
  391. package/src/compaction/restore.ts +69 -0
  392. package/src/compaction/salience/working-set.ts +6 -2
  393. package/src/compaction/tool-result-editing.ts +8 -1
  394. package/src/compaction/types.ts +2 -0
  395. package/src/compaction/wire.ts +4 -0
  396. package/src/connector/index.ts +27 -0
  397. package/src/connector/mcp/client.ts +71 -2
  398. package/src/connector/mcp/errors.ts +14 -0
  399. package/src/connector/mcp/index.ts +36 -0
  400. package/src/connector/mcp/skill-source.ts +499 -0
  401. package/src/connector/mcp/skills.ts +367 -0
  402. package/src/manager/session/turn-recorder.ts +24 -1
  403. package/src/network/audit.ts +2 -0
  404. package/src/network/computer.ts +347 -0
  405. package/src/network/index.ts +20 -0
  406. package/src/network/join.ts +21 -2
  407. package/src/network/roster.ts +5 -0
  408. package/src/network/service.ts +674 -84
  409. package/src/network/store.ts +57 -4
  410. package/src/network/transport.ts +1 -1
  411. package/src/network/wire.ts +18 -1
  412. package/src/plugin/shell-hook-tool-names.ts +1 -0
  413. package/src/plugin/shell-hook.ts +144 -7
  414. package/src/prompt/coding-agent-doctrine.ts +7 -2
  415. package/src/provider/fallback.ts +10 -0
  416. package/src/provider/idle-timeout.ts +9 -0
  417. package/src/provider/instrumentation.ts +12 -0
  418. package/src/provider/model-window-suffix.ts +2 -0
  419. package/src/provider/retry.ts +9 -0
  420. package/src/public-runtime.ts +100 -0
  421. package/src/public-tools.ts +18 -0
  422. package/src/public-types.ts +29 -0
  423. package/src/registry/tool/presentation.ts +14 -4
  424. package/src/runtime/jobs/registry.ts +2 -1
  425. package/src/runtime/query/auto-review/classifier.ts +19 -3
  426. package/src/runtime/query/auto-review/failure.ts +50 -0
  427. package/src/runtime/query/auto-review/index.ts +1 -0
  428. package/src/runtime/query/executor/tool-call-admission.ts +10 -1
  429. package/src/runtime/query/executor.ts +57 -8
  430. package/src/runtime/query/file-evidence-replay.ts +6 -5
  431. package/src/runtime/query/index.ts +62 -0
  432. package/src/runtime/query/iteration/index.ts +2 -0
  433. package/src/runtime/query/iteration/phases/compaction.ts +25 -2
  434. package/src/runtime/query/iteration/phases/context.ts +4 -0
  435. package/src/runtime/query/iteration/phases/per-call-review.ts +24 -7
  436. package/src/runtime/query/iteration/step-shaping.ts +4 -0
  437. package/src/runtime/query/prepare-turn.ts +20 -2
  438. package/src/runtime/query/review-policy.ts +31 -5
  439. package/src/runtime/query/shell-line-escalation.ts +49 -0
  440. package/src/runtime/query/tooling.ts +6 -0
  441. package/src/runtime/query/turn/outcome-ledger.ts +56 -1
  442. package/src/sandbox/provider/local.ts +3 -1
  443. package/src/scheduler/local.ts +3 -1
  444. package/src/skills/index.ts +43 -0
  445. package/src/skills/inline-shell-host.ts +303 -0
  446. package/src/skills/inline-shell.ts +765 -0
  447. package/src/store/index.ts +8 -0
  448. package/src/store/task/file.ts +641 -0
  449. package/src/teams/backend.ts +29 -0
  450. package/src/teams/fs-sync.ts +91 -0
  451. package/src/teams/index.ts +47 -0
  452. package/src/teams/names.ts +49 -0
  453. package/src/teams/store.ts +607 -0
  454. package/src/teams/types.ts +102 -0
  455. package/src/tools/admit-facts.ts +26 -0
  456. package/src/tools/builtins/bash.ts +5 -2
  457. package/src/tools/builtins/browser.ts +1 -1
  458. package/src/tools/builtins/computer-use.ts +799 -86
  459. package/src/tools/builtins/content-fingerprint.ts +2 -1
  460. package/src/tools/builtins/edit-apply.ts +124 -24
  461. package/src/tools/builtins/edit-match.ts +200 -0
  462. package/src/tools/builtins/edit.ts +16 -7
  463. package/src/tools/builtins/exit-semantics.ts +23 -0
  464. package/src/tools/builtins/index.ts +3 -0
  465. package/src/tools/builtins/present-file.ts +127 -0
  466. package/src/tools/builtins/read-file.ts +1 -1
  467. package/src/tools/builtins/read-render.ts +18 -3
  468. package/src/tools/builtins/search-tools.ts +36 -2
  469. package/src/tools/builtins/skill.ts +291 -95
  470. package/src/tools/builtins/wait-for-job.ts +5 -0
  471. package/src/tools/builtins/web.ts +15 -2
  472. package/src/tools/task/create.ts +13 -4
  473. package/src/tools/task/get.ts +53 -0
  474. package/src/tools/task/index.ts +14 -2
  475. package/src/tools/task/list.ts +10 -2
  476. package/src/tools/task/number.ts +32 -0
  477. package/src/tools/task/present.ts +18 -3
  478. package/src/tools/task/update.ts +94 -20
  479. package/src/types/acp/index.ts +11 -1
  480. package/src/types/agent/base.ts +6 -0
  481. package/src/types/agent/scheduler.ts +9 -0
  482. package/src/types/computer-use/index.ts +7 -0
  483. package/src/types/connector/mcp.ts +10 -0
  484. package/src/types/permission/index.ts +29 -0
  485. package/src/types/plugin/index.ts +95 -39
  486. package/src/types/provider/chat.ts +9 -0
  487. package/src/types/provider/interface.ts +18 -0
  488. package/src/types/provider/model.ts +6 -0
  489. package/src/types/provider/stream.ts +2 -0
  490. package/src/types/tool/index.ts +23 -2
  491. package/src/types/tool/presentation.ts +14 -0
  492. package/src/utils/node-on-path.ts +81 -0
@@ -4,6 +4,7 @@ import type { ToolDefinition } from '../../types/tool/index.js'
4
4
  import { asTaskId } from '../../utils/id.js'
5
5
  import { defineTool } from '../defineTool.js'
6
6
  import type { TaskToolScope } from './index.js'
7
+ import { taskNumbers } from './number.js'
7
8
  import { presentTaskCreateCall, presentTaskCreateResult } from './present.js'
8
9
 
9
10
  export function buildTaskCreateTool(
@@ -13,7 +14,7 @@ export function buildTaskCreateTool(
13
14
  return defineTool({
14
15
  name: 'task_create',
15
16
  description:
16
- 'Create a task to track a unit of planned work. Use this to break down complex work into trackable steps before starting. Each task has a subject (imperative: "Fix auth bug") and optionally an activeForm (present continuous: "Fixing auth bug") for progress display. Returns the new task\'s id.',
17
+ 'Create a task to track a unit of planned work. Use this to break down complex work into trackable steps before starting. Each task has a subject (imperative: "Fix auth bug") and optionally an activeForm (present continuous: "Fixing auth bug") for progress display. Call task_list first so you do not add a duplicate. Returns the new task\'s id.',
17
18
  inputSchema: z.object({
18
19
  subject: z.string().describe('Brief title in imperative form ("Fix auth middleware")'),
19
20
  description: z.string().optional().describe('Detailed description of the work'),
@@ -37,7 +38,7 @@ export function buildTaskCreateTool(
37
38
  destructive: false,
38
39
  concurrencySafe: true,
39
40
  // Tasks are made to be moved through their statuses as the work goes.
40
- loadsWith: ['task_update'],
41
+ loadsWith: ['task_update', 'task_list'],
41
42
  presentCall: presentTaskCreateCall,
42
43
  presentResult: presentTaskCreateResult,
43
44
  async execute({ subject, description, activeForm, owner, blockedBy, metadata }) {
@@ -52,10 +53,18 @@ export function buildTaskCreateTool(
52
53
  metadata,
53
54
  })
54
55
 
56
+ const number = (await taskNumbers(taskStore)).get(task.id)
57
+ const named = number === undefined ? `${task.id}` : `#${number} (id ${task.id})`
55
58
  return {
56
59
  success: true,
57
- output: `Task created: ${task.id} — "${subject}"${owner ? ` [owner: ${owner}]` : ''}`,
58
- data: { id: task.id, subject: task.subject, status: task.status, owner: task.owner },
60
+ output: `Task created: ${named} — "${subject}"${owner ? ` [owner: ${owner}]` : ''}`,
61
+ data: {
62
+ id: task.id,
63
+ ...(number === undefined ? {} : { number }),
64
+ subject: task.subject,
65
+ status: task.status,
66
+ owner: task.owner,
67
+ },
59
68
  }
60
69
  },
61
70
  })
@@ -0,0 +1,53 @@
1
+ import { z } from 'zod'
2
+ import type { ClaimableTaskStore } from '../../store/task/file.js'
3
+ import type { ToolDefinition } from '../../types/tool/index.js'
4
+ import { asTaskId } from '../../utils/id.js'
5
+ import { defineTool } from '../defineTool.js'
6
+ import { taskNumbers } from './number.js'
7
+
8
+ /**
9
+ * Read one task in full: its description, owner and what it waits on. Only for a list several
10
+ * sessions share, where a teammate reads a task before it takes it.
11
+ */
12
+ export function buildTaskGetTool(taskStore: ClaimableTaskStore): ToolDefinition {
13
+ return defineTool({
14
+ name: 'task_get',
15
+ description:
16
+ 'Read one task in full: subject, description, status, owner, what it blocks and what blocks it. Read a task before you start it. A blocker only stops a task until that blocker is completed.',
17
+ inputSchema: z.object({
18
+ id: z.string().describe('Task ID'),
19
+ }),
20
+ category: 'custom',
21
+ permissions: [],
22
+ readOnly: true,
23
+ destructive: false,
24
+ concurrencySafe: true,
25
+ async execute({ id }) {
26
+ const task = await taskStore.get(asTaskId(id))
27
+ if (!task) return { success: false, output: `Task ${id} not found` }
28
+ const waiting = await taskStore.unresolvedBlockers(task)
29
+ const numbers = await taskNumbers(taskStore)
30
+ const number = numbers.get(task.id)
31
+ const data = {
32
+ id: task.id,
33
+ ...(number === undefined ? {} : { number }),
34
+ subject: task.subject,
35
+ description: task.description ?? null,
36
+ status: task.status,
37
+ owner: task.owner ?? null,
38
+ blocks: task.blocks,
39
+ blockedBy: task.blockedBy,
40
+ waitingOn: waiting,
41
+ activeForm: task.activeForm ?? null,
42
+ metadata: task.metadata ?? null,
43
+ }
44
+ const lines = [
45
+ `${number === undefined ? '' : `#${number} `}${task.subject} [${task.status}]${task.owner ? ` owner: ${task.owner}` : ''}`,
46
+ ...(task.description ? [task.description] : []),
47
+ ...(waiting.length > 0 ? [`Waiting on: ${waiting.join(', ')}`] : []),
48
+ ...(task.blocks.length > 0 ? [`Blocks: ${task.blocks.join(', ')}`] : []),
49
+ ]
50
+ return { success: true, output: lines.join('\n'), data }
51
+ },
52
+ })
53
+ }
@@ -1,7 +1,9 @@
1
+ import { isClaimableTaskStore } from '../../store/task/file.js'
1
2
  import type { SessionId, TurnId } from '../../types/ids/index.js'
2
3
  import type { TaskStore } from '../../types/task/index.js'
3
4
  import type { ToolDefinition } from '../../types/tool/index.js'
4
5
  import { buildTaskCreateTool } from './create.js'
6
+ import { buildTaskGetTool } from './get.js'
5
7
  import { buildTaskListTool } from './list.js'
6
8
  import { buildTaskUpdateTool } from './update.js'
7
9
 
@@ -18,17 +20,27 @@ export interface TaskToolScope {
18
20
  * time it first started. Absent: the time the tools were built.
19
21
  */
20
22
  readonly turnStartedAt?: number
23
+ /**
24
+ * The member the tools act for when the list is shared by a team: the name that moving a task to
25
+ * in_progress claims it under. Ignored for a store only this session uses.
26
+ */
27
+ readonly member?: string
21
28
  }
22
29
 
23
30
  export function buildTaskTools(taskStore: TaskStore, scope: TaskToolScope): ToolDefinition[] {
24
31
  const resolved = { ...scope, turnStartedAt: scope.turnStartedAt ?? Date.now() }
25
- return [
32
+ const tools = [
26
33
  buildTaskCreateTool(taskStore, resolved),
27
- buildTaskUpdateTool(taskStore),
34
+ buildTaskUpdateTool(taskStore, resolved),
28
35
  buildTaskListTool(taskStore, resolved),
29
36
  ]
37
+ // A list that several sessions share also lets a task be read in full.
38
+ if (isClaimableTaskStore(taskStore)) tools.push(buildTaskGetTool(taskStore))
39
+ return tools
30
40
  }
31
41
 
32
42
  export { buildTaskCreateTool } from './create.js'
43
+ export { buildTaskGetTool } from './get.js'
33
44
  export { buildTaskUpdateTool } from './update.js'
34
45
  export { buildTaskListTool } from './list.js'
46
+ export { plainTaskReceipt } from './number.js'
@@ -1,9 +1,11 @@
1
1
  import { z } from 'zod'
2
2
  import { selectTaskContext } from '../../store/task/context.js'
3
+ import { isClaimableTaskStore } from '../../store/task/file.js'
3
4
  import { type TaskStore, isTerminalTaskStatus } from '../../types/task/index.js'
4
5
  import type { ToolDefinition } from '../../types/tool/index.js'
5
6
  import { defineTool } from '../defineTool.js'
6
7
  import type { TaskToolScope } from './index.js'
8
+ import { taskNumbers } from './number.js'
7
9
  import { countTasks, presentTaskListCall, presentTaskListResult } from './present.js'
8
10
 
9
11
  export function buildTaskListTool(
@@ -26,16 +28,22 @@ export function buildTaskListTool(
26
28
  const all = await taskStore.list({ sessionId: scope.sessionId })
27
29
  // Blockers resolve against every task of the session, shown or not: a
28
30
  // blocker closed in an earlier turn is resolved, not unknown.
31
+ // A list several sessions share is shown whole, and a blocker only resolves by completing.
32
+ const shared = isClaimableTaskStore(taskStore)
29
33
  const terminalIds = new Set(
30
- all.filter((t) => isTerminalTaskStatus(t.status)).map((t) => t.id),
34
+ all
35
+ .filter((t) => (shared ? t.status === 'completed' : isTerminalTaskStatus(t.status)))
36
+ .map((t) => t.id),
31
37
  )
32
- const tasks = selectTaskContext(all, scope)
38
+ const tasks = shared ? all : selectTaskContext(all, scope)
33
39
 
40
+ const numbers = await taskNumbers(taskStore)
34
41
  const summary = tasks.map((task) => {
35
42
  const unresolvedBlockers = task.blockedBy.filter((bid) => !terminalIds.has(bid))
36
43
 
37
44
  return {
38
45
  id: task.id,
46
+ ...(numbers.has(task.id) ? { number: numbers.get(task.id) } : {}),
39
47
  subject: task.subject,
40
48
  status: task.status,
41
49
  owner: task.owner ?? null,
@@ -0,0 +1,32 @@
1
+ import { isClaimableTaskStore } from '../../store/task/file.js'
2
+ import type { TaskStore } from '../../types/task/index.js'
3
+
4
+ /**
5
+ * The number a task of a shared (team) list is shown under: its place in the list, lowest id first,
6
+ * from 1. A team's screens say `#2`, not a UUID, and this is the same count. A list only one session
7
+ * uses has no numbers; there the id stays the only handle.
8
+ */
9
+ export async function taskNumbers(store: TaskStore): Promise<ReadonlyMap<string, number>> {
10
+ if (!isClaimableTaskStore(store)) return new Map()
11
+ const tasks = await store.list()
12
+ const ids = tasks.map((task) => String(task.id)).sort(byId)
13
+ return new Map(ids.map((id, index) => [id, index + 1]))
14
+ }
15
+
16
+ function byId(a: string, b: string): number {
17
+ const left = Number(a)
18
+ const right = Number(b)
19
+ if (Number.isFinite(left) && Number.isFinite(right) && left !== right) return left - right
20
+ return a < b ? -1 : a > b ? 1 : 0
21
+ }
22
+
23
+ /** The id the model needs, set apart so a screen can leave it out. */
24
+ const ID_TAIL = /^(Task (?:created: )?#\d+) \(id [^)]*\)/
25
+
26
+ /**
27
+ * A task tool's receipt as a person reads it: the handle the model needs to call the next tool is
28
+ * dropped where the receipt already names the task by its number.
29
+ */
30
+ export function plainTaskReceipt(output: string): string {
31
+ return output.replace(ID_TAIL, '$1')
32
+ }
@@ -27,7 +27,16 @@ function activity(label: string): ToolCallView {
27
27
  return { kind: 'generic', presentation: 'activity', label }
28
28
  }
29
29
 
30
- /** A successful receipt: the call row already said it. */
30
+ /** The number a team's screens call the task by, when its receipt carries one. */
31
+ function numberOf(result: ToolResult): number | undefined {
32
+ const number = (result.data as { number?: unknown } | undefined)?.number
33
+ return typeof number === 'number' ? number : undefined
34
+ }
35
+
36
+ /**
37
+ * A successful receipt: the call row already said it. A task of a team's list has a number the
38
+ * rest of the screen uses (`task #2`), so there the receipt says which one.
39
+ */
31
40
  const HIDDEN_RESULT: ToolResultView = {
32
41
  kind: 'generic',
33
42
  label: '',
@@ -57,7 +66,8 @@ export function presentTaskCreateCall(input: {
57
66
 
58
67
  export function presentTaskCreateResult(_input: unknown, result: ToolResult): ToolResultView {
59
68
  if (!result.success) return failure(result, 'The task was not added')
60
- return HIDDEN_RESULT
69
+ const number = numberOf(result)
70
+ return number === undefined ? HIDDEN_RESULT : { kind: 'generic', label: `Task #${number} added` }
61
71
  }
62
72
 
63
73
  /** The verb for a `task_update` call, from the status it asks for. */
@@ -104,7 +114,12 @@ export function presentTaskUpdateResult(_input: unknown, result: ToolResult): To
104
114
  }
105
115
  return failure(result, 'The task was not changed')
106
116
  }
107
- return HIDDEN_RESULT
117
+ const number = numberOf(result)
118
+ if (number === undefined) return HIDDEN_RESULT
119
+ const status = (result.data as { status?: unknown } | undefined)?.status
120
+ const said =
121
+ status === 'in_progress' ? 'started' : typeof status === 'string' ? status : 'updated'
122
+ return { kind: 'generic', label: `Task #${number} ${said}` }
108
123
  }
109
124
 
110
125
  export function presentTaskListCall(): ToolCallView {
@@ -1,15 +1,21 @@
1
1
  import { z } from 'zod'
2
+ import { TaskListError, isClaimableTaskStore } from '../../store/task/file.js'
2
3
  import type { TaskStore } from '../../types/task/index.js'
3
4
  import type { ToolDefinition } from '../../types/tool/index.js'
4
5
  import { asTaskId } from '../../utils/id.js'
5
6
  import { defineTool } from '../defineTool.js'
7
+ import type { TaskToolScope } from './index.js'
8
+ import { taskNumbers } from './number.js'
6
9
  import { presentTaskUpdateCall, presentTaskUpdateResult } from './present.js'
7
10
 
8
- export function buildTaskUpdateTool(taskStore: TaskStore): ToolDefinition {
11
+ export function buildTaskUpdateTool(
12
+ taskStore: TaskStore,
13
+ scope?: Pick<TaskToolScope, 'member'>,
14
+ ): ToolDefinition {
9
15
  return defineTool({
10
16
  name: 'task_update',
11
17
  description:
12
- 'Update task fields, owner or dependencies. Built-in statuses move forward only; completed/failed are terminal. Create follow-up tasks instead of reopening. Record failures as failed. An unconfirmed status may leave other edits applied. Outcomes are reported, not verified. Use "deleted" to remove a task.',
18
+ 'Update task fields, owner or dependencies. Built-in statuses move forward only; completed/failed are terminal. Create follow-up tasks instead of reopening. Record failures as failed. An unconfirmed status may leave other edits applied. Outcomes are reported, not verified. Use "deleted" to remove a task that no longer applies.',
13
19
  inputSchema: z.object({
14
20
  id: z.string().describe('Task ID (e.g. "task_abc123")'),
15
21
  subject: z.string().optional().describe('Updated title'),
@@ -52,37 +58,104 @@ export function buildTaskUpdateTool(taskStore: TaskStore): ToolDefinition {
52
58
  // which tells the model its task disappeared rather than that it
53
59
  // named the wrong thing.
54
60
  const taskId = asTaskId(id)
61
+ // A team's list numbers its tasks; the screen says `#2`, so the receipt does too and keeps the id beside it.
62
+ const number = (await taskNumbers(taskStore)).get(taskId)
63
+ const named = number === undefined ? `${id}` : `#${number} (id ${id})`
55
64
 
56
65
  if (status === 'deleted') {
57
66
  const deleted = await taskStore.delete(taskId)
58
67
  return {
59
68
  success: deleted,
60
- output: deleted ? `Task ${id} deleted` : `Task ${id} not found`,
69
+ output: deleted ? `Task ${named} deleted` : `Task ${named} not found`,
61
70
  }
62
71
  }
63
72
 
64
- if (addBlocks) {
65
- for (const blockedId of addBlocks) {
66
- await taskStore.block(taskId, asTaskId(blockedId))
73
+ // Only a list several sessions share can refuse an edge or a claim, and only it is asked to.
74
+ const shared = isClaimableTaskStore(taskStore) ? taskStore : undefined
75
+
76
+ try {
77
+ if (addBlocks) {
78
+ for (const blockedId of addBlocks) {
79
+ await taskStore.block(taskId, asTaskId(blockedId))
80
+ }
81
+ }
82
+ if (addBlockedBy) {
83
+ for (const blockerId of addBlockedBy) {
84
+ await taskStore.block(asTaskId(blockerId), taskId)
85
+ }
86
+ }
87
+ } catch (error) {
88
+ if (shared && error instanceof TaskListError) {
89
+ return { success: false, output: error.message }
90
+ }
91
+ throw error
92
+ }
93
+
94
+ // Moving a shared task to in_progress is a claim: it goes to one owner, and a task that is
95
+ // owned, closed or still waiting on a blocker says so instead of being taken.
96
+ let claimed: Awaited<ReturnType<TaskStore['get']>>
97
+ if (shared && status === 'in_progress') {
98
+ const claimant = owner ?? scope?.member
99
+ if (claimant === undefined) {
100
+ return {
101
+ success: false,
102
+ output: `Task ${named} cannot move to in_progress without an owner; pass owner (your member name).`,
103
+ }
104
+ }
105
+ {
106
+ const result = await shared.claimTask(taskId, claimant)
107
+ if (!result.ok) {
108
+ const reason: Record<typeof result.code, string> = {
109
+ not_found: `Task ${named} not found`,
110
+ already_claimed: `Task ${named} is already claimed by ${result.task?.owner ?? 'another member'}`,
111
+ already_resolved: `Task ${named} is already ${result.task?.status ?? 'closed'}; create a follow-up task instead`,
112
+ blocked: `Task ${named} is blocked by ${result.blockedBy?.join(', ') ?? 'another task'}; finish those first`,
113
+ }
114
+ return {
115
+ success: false,
116
+ output: reason[result.code],
117
+ data: { code: result.code },
118
+ }
119
+ }
120
+ claimed = result.task
67
121
  }
68
122
  }
69
- if (addBlockedBy) {
70
- for (const blockerId of addBlockedBy) {
71
- await taskStore.block(asTaskId(blockerId), taskId)
123
+
124
+ // One member does not close another's task.
125
+ if (
126
+ shared &&
127
+ scope?.member !== undefined &&
128
+ (status === 'completed' || status === 'failed')
129
+ ) {
130
+ const current = await shared.get(taskId)
131
+ if (current?.owner !== undefined && current.owner !== scope.member) {
132
+ return {
133
+ success: false,
134
+ output: `Task ${named} is owned by ${current.owner}; only its owner closes it.`,
135
+ data: { code: 'already_claimed' },
136
+ }
72
137
  }
73
138
  }
74
139
 
75
- const updated = await taskStore.update(taskId, {
76
- subject,
77
- description,
78
- activeForm,
79
- status,
80
- owner,
81
- metadata,
82
- })
140
+ let updated: Awaited<ReturnType<TaskStore['update']>>
141
+ try {
142
+ updated = await taskStore.update(taskId, {
143
+ subject,
144
+ description,
145
+ activeForm,
146
+ status: claimed && status === 'in_progress' ? undefined : status,
147
+ owner: claimed ? undefined : owner,
148
+ metadata,
149
+ })
150
+ } catch (error) {
151
+ if (shared && error instanceof TaskListError) {
152
+ return { success: false, output: error.message, data: { code: error.code } }
153
+ }
154
+ throw error
155
+ }
83
156
 
84
157
  if (!updated) {
85
- return { success: false, output: `Task ${id} not found` }
158
+ return { success: false, output: `Task ${named} not found` }
86
159
  }
87
160
 
88
161
  // Stores can retain the old status while applying other edits. The
@@ -92,10 +165,11 @@ export function buildTaskUpdateTool(taskStore: TaskStore): ToolDefinition {
92
165
  return {
93
166
  success: statusApplied,
94
167
  output: statusApplied
95
- ? `Task ${id} updated — status: ${updated.status}`
96
- : `Task ${id} requested status "${status}" could not be confirmed; returned status is "${updated.status}". Other requested edits may have applied. Inspect the task and create a new task for follow-up work.`,
168
+ ? `Task ${named} updated — status: ${updated.status}`
169
+ : `Task ${named} requested status "${status}" could not be confirmed; returned status is "${updated.status}". Other requested edits may have applied. Inspect the task and create a new task for follow-up work.`,
97
170
  data: {
98
171
  id: updated.id,
172
+ ...(number === undefined ? {} : { number }),
99
173
  subject: updated.subject,
100
174
  status: updated.status,
101
175
  owner: updated.owner,
@@ -133,6 +133,11 @@ export interface AcpFileChangePreview {
133
133
  /** What the agent asks the client before running a tool batch. */
134
134
  export interface AcpRequestPermissionParams {
135
135
  readonly sessionId: string
136
+ /**
137
+ * Present when the ask is a teammate's: its name and team. A client names the member in the
138
+ * question ("<name> wants to run ..."). Absent on the session's own calls and from an older agent.
139
+ */
140
+ readonly teammate?: { readonly name: string; readonly team: string }
136
141
  readonly toolCalls: readonly {
137
142
  readonly id: string
138
143
  readonly name: string
@@ -152,7 +157,12 @@ export interface AcpRequestPermissionParams {
152
157
  * was allowed (it closes, deletes, sends or submits). Absent on other calls
153
158
  * and from an older agent.
154
159
  */
155
- readonly computer?: { readonly app?: string; readonly consequence?: string }
160
+ readonly computer?: {
161
+ readonly app?: string
162
+ readonly consequence?: string
163
+ /** Browsers this call acts in that the engine will put its own question about. */
164
+ readonly browserAsk?: readonly string[]
165
+ }
156
166
  }[]
157
167
  }
158
168
 
@@ -401,6 +401,12 @@ export interface AgentInput {
401
401
 
402
402
  taskStore?: TaskStore
403
403
 
404
+ /** The member name the task tools claim under when `taskStore` is a list a team shares. */
405
+ taskMember?: string
406
+
407
+ /** The team a teammate belongs to; with `taskMember` it names the teammate on the task hooks. */
408
+ taskTeam?: string
409
+
404
410
  runtimeToolOverrides?: RuntimeToolOverrides
405
411
 
406
412
  runtimeContext?: AgentRuntimeContext
@@ -35,6 +35,15 @@ export interface TaskHandle {
35
35
  export type SiblingFailurePolicy = 'continue' | 'cancel-siblings'
36
36
 
37
37
  export interface CreateTaskOptions {
38
+ /**
39
+ * The task list this one child works from, in place of the scheduler's own. A team's members each
40
+ * get the team's shared list this way.
41
+ */
42
+ readonly taskStore?: import('../task/index.js').TaskStore
43
+ /** The member name this child's task tools claim under when the list is shared by a team. */
44
+ readonly taskMember?: string
45
+ /** The team that member belongs to: with `taskMember` it names the teammate on the task hooks. */
46
+ readonly taskTeam?: string
38
47
  /**
39
48
  * Continue a child conversation under a NEW task, with this invocation's
40
49
  * parent authority, budget and configuration. Local managers accept only
@@ -301,6 +301,8 @@ export interface UiSnapshot {
301
301
  readonly region?: boolean
302
302
  /** For a region listed in pages: the `offset` that reads the page after this one. */
303
303
  readonly next?: number
304
+ /** The text selected in the window, when the host could read it. */
305
+ readonly selectedText?: string
304
306
  }
305
307
 
306
308
  /**
@@ -315,6 +317,11 @@ export interface UiSnapshotOptions {
315
317
  readonly offset?: number
316
318
  /** Only controls whose text contains this (case-insensitive), with the elements above them. */
317
319
  readonly query?: string
320
+ /**
321
+ * Only controls of this role (case-insensitive; several may be joined with
322
+ * a comma), with the elements above them. Combines with `query`.
323
+ */
324
+ readonly role?: string
318
325
  }
319
326
 
320
327
  /** Why a ref could not be acted on, as a typed failure. */
@@ -518,6 +518,16 @@ export interface MCPClientConfig {
518
518
  * nothing, so a server never returns a task to this client.
519
519
  */
520
520
  tasks?: boolean
521
+ /**
522
+ * Take part in the skills extension (2026-07-28). Default `false`.
523
+ *
524
+ * Server-supplied skills are server-supplied instructions, so a host opts
525
+ * in per server. When `true` and the server advertises
526
+ * `io.modelcontextprotocol/skills`, the client declares it on each
527
+ * request and `listSkillPage` and `getSkill` ask the server. `false`
528
+ * declares nothing and sends neither method.
529
+ */
530
+ skills?: boolean
521
531
  /**
522
532
  * Answer a server's `elicitation/create` (form mode) by asking the person.
523
533
  *
@@ -28,3 +28,32 @@ export const STRICT_MODE_REFUSAL =
28
28
  */
29
29
  export const PLAN_MODE_REFUSAL_WITH_PLAN_FILE =
30
30
  'Refused: plan mode is read-only. Explore with the reading tools (read, glob, grep, and shell commands that only read; run git on its own, not after cd), write the plan to the plan file, then call exit_plan_mode so the user can approve it. Change nothing else before then.'
31
+
32
+ /**
33
+ * Why a call made from inside another tool (a command a skill holds, run while
34
+ * it loads) may not run under a mode, or `undefined` when the mode has nothing
35
+ * to say about it.
36
+ *
37
+ * The tool that makes the call is read-only (the `skill` tool), so the mode
38
+ * never saw the call and the nested one has to be answered here, the way the
39
+ * mode answers the same call made directly:
40
+ *
41
+ * - `plan` runs only calls that read, whatever a rule or a skill's grant says.
42
+ * - `strict` runs only calls a rule allowed (or that only read). A skill's
43
+ * grant is not a rule, so it never lifts this.
44
+ *
45
+ * Every other mode answers a call that no rule decided by asking a person or a
46
+ * classifier, which a load cannot do; that stays the caller's refusal.
47
+ */
48
+ export function nestedCallModeRefusal(
49
+ mode: string | undefined,
50
+ call: { readonly readOnly: boolean; readonly allowedByRule: boolean },
51
+ ): string | undefined {
52
+ if (mode === 'plan' && !call.readOnly) {
53
+ return 'plan mode only runs commands that read, and this one can change something'
54
+ }
55
+ if (mode === 'strict' && !call.readOnly && !call.allowedByRule) {
56
+ return 'strict mode only runs what a rule allows by name or pattern, and no rule covers this (a skill’s allowed-tools is not a rule)'
57
+ }
58
+ return undefined
59
+ }