@sema-ai/core 1.275.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 (962) hide show
  1. package/CHANGELOG.md +5433 -0
  2. package/LICENSE +27 -0
  3. package/NOTICE.md +30 -0
  4. package/README.md +1040 -0
  5. package/dist/agents/agent-definition.d.ts +10 -0
  6. package/dist/agents/agent-definition.d.ts.map +1 -0
  7. package/dist/agents/agent-definition.js +18 -0
  8. package/dist/agents/agent-definition.js.map +1 -0
  9. package/dist/agents/builtin-agents.d.ts +69 -0
  10. package/dist/agents/builtin-agents.d.ts.map +1 -0
  11. package/dist/agents/builtin-agents.js +177 -0
  12. package/dist/agents/builtin-agents.js.map +1 -0
  13. package/dist/agents/cascade.d.ts +101 -0
  14. package/dist/agents/cascade.d.ts.map +1 -0
  15. package/dist/agents/cascade.js +189 -0
  16. package/dist/agents/cascade.js.map +1 -0
  17. package/dist/agents/observer.d.ts +209 -0
  18. package/dist/agents/observer.d.ts.map +1 -0
  19. package/dist/agents/observer.js +495 -0
  20. package/dist/agents/observer.js.map +1 -0
  21. package/dist/agents/repair-loop.d.ts +236 -0
  22. package/dist/agents/repair-loop.d.ts.map +1 -0
  23. package/dist/agents/repair-loop.js +293 -0
  24. package/dist/agents/repair-loop.js.map +1 -0
  25. package/dist/agents/session-util.d.ts +8 -0
  26. package/dist/agents/session-util.d.ts.map +1 -0
  27. package/dist/agents/session-util.js +9 -0
  28. package/dist/agents/session-util.js.map +1 -0
  29. package/dist/agents/subagent-steps.d.ts +93 -0
  30. package/dist/agents/subagent-steps.d.ts.map +1 -0
  31. package/dist/agents/subagent-steps.js +206 -0
  32. package/dist/agents/subagent-steps.js.map +1 -0
  33. package/dist/agents/subagent.d.ts +441 -0
  34. package/dist/agents/subagent.d.ts.map +1 -0
  35. package/dist/agents/subagent.js +2492 -0
  36. package/dist/agents/subagent.js.map +1 -0
  37. package/dist/agents/suspend-guard.d.ts +35 -0
  38. package/dist/agents/suspend-guard.d.ts.map +1 -0
  39. package/dist/agents/suspend-guard.js +48 -0
  40. package/dist/agents/suspend-guard.js.map +1 -0
  41. package/dist/agents/teacher.d.ts +137 -0
  42. package/dist/agents/teacher.d.ts.map +1 -0
  43. package/dist/agents/teacher.js +575 -0
  44. package/dist/agents/teacher.js.map +1 -0
  45. package/dist/agents/team.d.ts +211 -0
  46. package/dist/agents/team.d.ts.map +1 -0
  47. package/dist/agents/team.js +293 -0
  48. package/dist/agents/team.js.map +1 -0
  49. package/dist/agents/tool-filter.d.ts +29 -0
  50. package/dist/agents/tool-filter.d.ts.map +1 -0
  51. package/dist/agents/tool-filter.js +50 -0
  52. package/dist/agents/tool-filter.js.map +1 -0
  53. package/dist/agents/verify.d.ts +177 -0
  54. package/dist/agents/verify.d.ts.map +1 -0
  55. package/dist/agents/verify.js +305 -0
  56. package/dist/agents/verify.js.map +1 -0
  57. package/dist/bench/metrics.d.ts +714 -0
  58. package/dist/bench/metrics.d.ts.map +1 -0
  59. package/dist/bench/metrics.js +618 -0
  60. package/dist/bench/metrics.js.map +1 -0
  61. package/dist/bin/sema-tb.d.ts +3 -0
  62. package/dist/bin/sema-tb.d.ts.map +1 -0
  63. package/dist/bin/sema-tb.js +516 -0
  64. package/dist/bin/sema-tb.js.map +1 -0
  65. package/dist/bin/tb-env.d.ts +13 -0
  66. package/dist/bin/tb-env.d.ts.map +1 -0
  67. package/dist/bin/tb-env.js +26 -0
  68. package/dist/bin/tb-env.js.map +1 -0
  69. package/dist/brain/anthropic.d.ts +46 -0
  70. package/dist/brain/anthropic.d.ts.map +1 -0
  71. package/dist/brain/anthropic.js +830 -0
  72. package/dist/brain/anthropic.js.map +1 -0
  73. package/dist/brain/circuit-breaker.d.ts +46 -0
  74. package/dist/brain/circuit-breaker.d.ts.map +1 -0
  75. package/dist/brain/circuit-breaker.js +173 -0
  76. package/dist/brain/circuit-breaker.js.map +1 -0
  77. package/dist/brain/degrading.d.ts +98 -0
  78. package/dist/brain/degrading.d.ts.map +1 -0
  79. package/dist/brain/degrading.js +249 -0
  80. package/dist/brain/degrading.js.map +1 -0
  81. package/dist/brain/errors.d.ts +31 -0
  82. package/dist/brain/errors.d.ts.map +1 -0
  83. package/dist/brain/errors.js +58 -0
  84. package/dist/brain/errors.js.map +1 -0
  85. package/dist/brain/failover.d.ts +18 -0
  86. package/dist/brain/failover.d.ts.map +1 -0
  87. package/dist/brain/failover.js +118 -0
  88. package/dist/brain/failover.js.map +1 -0
  89. package/dist/brain/model-presets.d.ts +36 -0
  90. package/dist/brain/model-presets.d.ts.map +1 -0
  91. package/dist/brain/model-presets.js +54 -0
  92. package/dist/brain/model-presets.js.map +1 -0
  93. package/dist/brain/openai.d.ts +43 -0
  94. package/dist/brain/openai.d.ts.map +1 -0
  95. package/dist/brain/openai.js +784 -0
  96. package/dist/brain/openai.js.map +1 -0
  97. package/dist/brain/reasoning.d.ts +138 -0
  98. package/dist/brain/reasoning.d.ts.map +1 -0
  99. package/dist/brain/reasoning.js +146 -0
  100. package/dist/brain/reasoning.js.map +1 -0
  101. package/dist/brain/repetition.d.ts +60 -0
  102. package/dist/brain/repetition.d.ts.map +1 -0
  103. package/dist/brain/repetition.js +121 -0
  104. package/dist/brain/repetition.js.map +1 -0
  105. package/dist/brain/request-params.d.ts +29 -0
  106. package/dist/brain/request-params.d.ts.map +1 -0
  107. package/dist/brain/request-params.js +78 -0
  108. package/dist/brain/request-params.js.map +1 -0
  109. package/dist/brain/retry.d.ts +18 -0
  110. package/dist/brain/retry.d.ts.map +1 -0
  111. package/dist/brain/retry.js +42 -0
  112. package/dist/brain/retry.js.map +1 -0
  113. package/dist/brain/routing.d.ts +19 -0
  114. package/dist/brain/routing.d.ts.map +1 -0
  115. package/dist/brain/routing.js +44 -0
  116. package/dist/brain/routing.js.map +1 -0
  117. package/dist/brain/status-sink.d.ts +46 -0
  118. package/dist/brain/status-sink.d.ts.map +1 -0
  119. package/dist/brain/status-sink.js +36 -0
  120. package/dist/brain/status-sink.js.map +1 -0
  121. package/dist/brain/stream-engine.d.ts +85 -0
  122. package/dist/brain/stream-engine.d.ts.map +1 -0
  123. package/dist/brain/stream-engine.js +391 -0
  124. package/dist/brain/stream-engine.js.map +1 -0
  125. package/dist/brain/timeout.d.ts +44 -0
  126. package/dist/brain/timeout.d.ts.map +1 -0
  127. package/dist/brain/timeout.js +41 -0
  128. package/dist/brain/timeout.js.map +1 -0
  129. package/dist/brain/tool-call-repair.d.ts +15 -0
  130. package/dist/brain/tool-call-repair.d.ts.map +1 -0
  131. package/dist/brain/tool-call-repair.js +67 -0
  132. package/dist/brain/tool-call-repair.js.map +1 -0
  133. package/dist/brain/walltime.d.ts +14 -0
  134. package/dist/brain/walltime.d.ts.map +1 -0
  135. package/dist/brain/walltime.js +14 -0
  136. package/dist/brain/walltime.js.map +1 -0
  137. package/dist/core/arg-summary.d.ts +19 -0
  138. package/dist/core/arg-summary.d.ts.map +1 -0
  139. package/dist/core/arg-summary.js +96 -0
  140. package/dist/core/arg-summary.js.map +1 -0
  141. package/dist/core/ask-question.d.ts +113 -0
  142. package/dist/core/ask-question.d.ts.map +1 -0
  143. package/dist/core/ask-question.js +246 -0
  144. package/dist/core/ask-question.js.map +1 -0
  145. package/dist/core/auto-compaction.d.ts +341 -0
  146. package/dist/core/auto-compaction.d.ts.map +1 -0
  147. package/dist/core/auto-compaction.js +495 -0
  148. package/dist/core/auto-compaction.js.map +1 -0
  149. package/dist/core/auto-promote.d.ts +126 -0
  150. package/dist/core/auto-promote.d.ts.map +1 -0
  151. package/dist/core/auto-promote.js +171 -0
  152. package/dist/core/auto-promote.js.map +1 -0
  153. package/dist/core/background-shell.d.ts +128 -0
  154. package/dist/core/background-shell.d.ts.map +1 -0
  155. package/dist/core/background-shell.js +42 -0
  156. package/dist/core/background-shell.js.map +1 -0
  157. package/dist/core/cache-break-detector.d.ts +63 -0
  158. package/dist/core/cache-break-detector.d.ts.map +1 -0
  159. package/dist/core/cache-break-detector.js +0 -0
  160. package/dist/core/cache-break-detector.js.map +1 -0
  161. package/dist/core/canonical-json.d.ts +45 -0
  162. package/dist/core/canonical-json.d.ts.map +1 -0
  163. package/dist/core/canonical-json.js +132 -0
  164. package/dist/core/canonical-json.js.map +1 -0
  165. package/dist/core/checkpoint-store.d.ts +1101 -0
  166. package/dist/core/checkpoint-store.d.ts.map +1 -0
  167. package/dist/core/checkpoint-store.js +514 -0
  168. package/dist/core/checkpoint-store.js.map +1 -0
  169. package/dist/core/consolidate-scope.d.ts +94 -0
  170. package/dist/core/consolidate-scope.d.ts.map +1 -0
  171. package/dist/core/consolidate-scope.js +158 -0
  172. package/dist/core/consolidate-scope.js.map +1 -0
  173. package/dist/core/context-edit.d.ts +82 -0
  174. package/dist/core/context-edit.d.ts.map +1 -0
  175. package/dist/core/context-edit.js +149 -0
  176. package/dist/core/context-edit.js.map +1 -0
  177. package/dist/core/context-guard.d.ts +43 -0
  178. package/dist/core/context-guard.d.ts.map +1 -0
  179. package/dist/core/context-guard.js +171 -0
  180. package/dist/core/context-guard.js.map +1 -0
  181. package/dist/core/dynamic-recall.d.ts +100 -0
  182. package/dist/core/dynamic-recall.d.ts.map +1 -0
  183. package/dist/core/dynamic-recall.js +108 -0
  184. package/dist/core/dynamic-recall.js.map +1 -0
  185. package/dist/core/exec-gate.d.ts +74 -0
  186. package/dist/core/exec-gate.d.ts.map +1 -0
  187. package/dist/core/exec-gate.js +143 -0
  188. package/dist/core/exec-gate.js.map +1 -0
  189. package/dist/core/exec-output-tail.d.ts +37 -0
  190. package/dist/core/exec-output-tail.d.ts.map +1 -0
  191. package/dist/core/exec-output-tail.js +63 -0
  192. package/dist/core/exec-output-tail.js.map +1 -0
  193. package/dist/core/file-snapshot-store.d.ts +137 -0
  194. package/dist/core/file-snapshot-store.d.ts.map +1 -0
  195. package/dist/core/file-snapshot-store.js +319 -0
  196. package/dist/core/file-snapshot-store.js.map +1 -0
  197. package/dist/core/git-worktree-env.d.ts +41 -0
  198. package/dist/core/git-worktree-env.d.ts.map +1 -0
  199. package/dist/core/git-worktree-env.js +64 -0
  200. package/dist/core/git-worktree-env.js.map +1 -0
  201. package/dist/core/hooks.d.ts +372 -0
  202. package/dist/core/hooks.d.ts.map +1 -0
  203. package/dist/core/hooks.js +269 -0
  204. package/dist/core/hooks.js.map +1 -0
  205. package/dist/core/lsp-diagnostics.d.ts +74 -0
  206. package/dist/core/lsp-diagnostics.d.ts.map +1 -0
  207. package/dist/core/lsp-diagnostics.js +125 -0
  208. package/dist/core/lsp-diagnostics.js.map +1 -0
  209. package/dist/core/lsp-protocol.d.ts +28 -0
  210. package/dist/core/lsp-protocol.d.ts.map +1 -0
  211. package/dist/core/lsp-protocol.js +179 -0
  212. package/dist/core/lsp-protocol.js.map +1 -0
  213. package/dist/core/lsp-session.d.ts +56 -0
  214. package/dist/core/lsp-session.d.ts.map +1 -0
  215. package/dist/core/lsp-session.js +185 -0
  216. package/dist/core/lsp-session.js.map +1 -0
  217. package/dist/core/lsp.d.ts +132 -0
  218. package/dist/core/lsp.d.ts.map +1 -0
  219. package/dist/core/lsp.js +147 -0
  220. package/dist/core/lsp.js.map +1 -0
  221. package/dist/core/mcp.d.ts +294 -0
  222. package/dist/core/mcp.d.ts.map +1 -0
  223. package/dist/core/mcp.js +992 -0
  224. package/dist/core/mcp.js.map +1 -0
  225. package/dist/core/media-byte-cap.d.ts +34 -0
  226. package/dist/core/media-byte-cap.d.ts.map +1 -0
  227. package/dist/core/media-byte-cap.js +76 -0
  228. package/dist/core/media-byte-cap.js.map +1 -0
  229. package/dist/core/memory-engine/data-plane.d.ts +103 -0
  230. package/dist/core/memory-engine/data-plane.d.ts.map +1 -0
  231. package/dist/core/memory-engine/data-plane.js +272 -0
  232. package/dist/core/memory-engine/data-plane.js.map +1 -0
  233. package/dist/core/memory-engine/dual-root.d.ts +40 -0
  234. package/dist/core/memory-engine/dual-root.d.ts.map +1 -0
  235. package/dist/core/memory-engine/dual-root.js +95 -0
  236. package/dist/core/memory-engine/dual-root.js.map +1 -0
  237. package/dist/core/memory-engine/engine.d.ts +161 -0
  238. package/dist/core/memory-engine/engine.d.ts.map +1 -0
  239. package/dist/core/memory-engine/engine.js +1110 -0
  240. package/dist/core/memory-engine/engine.js.map +1 -0
  241. package/dist/core/memory-engine/file-backend.d.ts +162 -0
  242. package/dist/core/memory-engine/file-backend.d.ts.map +1 -0
  243. package/dist/core/memory-engine/file-backend.js +948 -0
  244. package/dist/core/memory-engine/file-backend.js.map +1 -0
  245. package/dist/core/memory-engine/frontmatter.d.ts +24 -0
  246. package/dist/core/memory-engine/frontmatter.d.ts.map +1 -0
  247. package/dist/core/memory-engine/frontmatter.js +135 -0
  248. package/dist/core/memory-engine/frontmatter.js.map +1 -0
  249. package/dist/core/memory-engine/index.d.ts +13 -0
  250. package/dist/core/memory-engine/index.d.ts.map +1 -0
  251. package/dist/core/memory-engine/index.js +28 -0
  252. package/dist/core/memory-engine/index.js.map +1 -0
  253. package/dist/core/memory-engine/layout.d.ts +123 -0
  254. package/dist/core/memory-engine/layout.d.ts.map +1 -0
  255. package/dist/core/memory-engine/layout.js +643 -0
  256. package/dist/core/memory-engine/layout.js.map +1 -0
  257. package/dist/core/memory-engine/memory-backend-contract.d.ts +22 -0
  258. package/dist/core/memory-engine/memory-backend-contract.d.ts.map +1 -0
  259. package/dist/core/memory-engine/memory-backend-contract.js +271 -0
  260. package/dist/core/memory-engine/memory-backend-contract.js.map +1 -0
  261. package/dist/core/memory-engine/migrate.d.ts +17 -0
  262. package/dist/core/memory-engine/migrate.d.ts.map +1 -0
  263. package/dist/core/memory-engine/migrate.js +35 -0
  264. package/dist/core/memory-engine/migrate.js.map +1 -0
  265. package/dist/core/memory-engine/scan.d.ts +20 -0
  266. package/dist/core/memory-engine/scan.d.ts.map +1 -0
  267. package/dist/core/memory-engine/scan.js +84 -0
  268. package/dist/core/memory-engine/scan.js.map +1 -0
  269. package/dist/core/memory-engine/scope-contract.d.ts +104 -0
  270. package/dist/core/memory-engine/scope-contract.d.ts.map +1 -0
  271. package/dist/core/memory-engine/scope-contract.js +288 -0
  272. package/dist/core/memory-engine/scope-contract.js.map +1 -0
  273. package/dist/core/memory-engine/sync-client.d.ts +100 -0
  274. package/dist/core/memory-engine/sync-client.d.ts.map +1 -0
  275. package/dist/core/memory-engine/sync-client.js +328 -0
  276. package/dist/core/memory-engine/sync-client.js.map +1 -0
  277. package/dist/core/memory-engine/sync.d.ts +97 -0
  278. package/dist/core/memory-engine/sync.d.ts.map +1 -0
  279. package/dist/core/memory-engine/sync.js +91 -0
  280. package/dist/core/memory-engine/sync.js.map +1 -0
  281. package/dist/core/memory-engine/types.d.ts +279 -0
  282. package/dist/core/memory-engine/types.d.ts.map +1 -0
  283. package/dist/core/memory-engine/types.js +9 -0
  284. package/dist/core/memory-engine/types.js.map +1 -0
  285. package/dist/core/memory-recall.d.ts +261 -0
  286. package/dist/core/memory-recall.d.ts.map +1 -0
  287. package/dist/core/memory-recall.js +600 -0
  288. package/dist/core/memory-recall.js.map +1 -0
  289. package/dist/core/memory-vector.d.ts +24 -0
  290. package/dist/core/memory-vector.d.ts.map +1 -0
  291. package/dist/core/memory-vector.js +51 -0
  292. package/dist/core/memory-vector.js.map +1 -0
  293. package/dist/core/memory.d.ts +502 -0
  294. package/dist/core/memory.d.ts.map +1 -0
  295. package/dist/core/memory.js +881 -0
  296. package/dist/core/memory.js.map +1 -0
  297. package/dist/core/message-utils.d.ts +7 -0
  298. package/dist/core/message-utils.d.ts.map +1 -0
  299. package/dist/core/message-utils.js +10 -0
  300. package/dist/core/message-utils.js.map +1 -0
  301. package/dist/core/oracle-isolation.d.ts +85 -0
  302. package/dist/core/oracle-isolation.d.ts.map +1 -0
  303. package/dist/core/oracle-isolation.js +121 -0
  304. package/dist/core/oracle-isolation.js.map +1 -0
  305. package/dist/core/permission-rules.d.ts +102 -0
  306. package/dist/core/permission-rules.d.ts.map +1 -0
  307. package/dist/core/permission-rules.js +357 -0
  308. package/dist/core/permission-rules.js.map +1 -0
  309. package/dist/core/present-plan-tool.d.ts +28 -0
  310. package/dist/core/present-plan-tool.d.ts.map +1 -0
  311. package/dist/core/present-plan-tool.js +119 -0
  312. package/dist/core/present-plan-tool.js.map +1 -0
  313. package/dist/core/pricing.d.ts +48 -0
  314. package/dist/core/pricing.d.ts.map +1 -0
  315. package/dist/core/pricing.js +46 -0
  316. package/dist/core/pricing.js.map +1 -0
  317. package/dist/core/property-harness.d.ts +126 -0
  318. package/dist/core/property-harness.d.ts.map +1 -0
  319. package/dist/core/property-harness.js +192 -0
  320. package/dist/core/property-harness.js.map +1 -0
  321. package/dist/core/push-queue.d.ts +10 -0
  322. package/dist/core/push-queue.d.ts.map +1 -0
  323. package/dist/core/push-queue.js +42 -0
  324. package/dist/core/push-queue.js.map +1 -0
  325. package/dist/core/remote-env.d.ts +432 -0
  326. package/dist/core/remote-env.d.ts.map +1 -0
  327. package/dist/core/remote-env.js +77 -0
  328. package/dist/core/remote-env.js.map +1 -0
  329. package/dist/core/roles.d.ts +74 -0
  330. package/dist/core/roles.d.ts.map +1 -0
  331. package/dist/core/roles.js +272 -0
  332. package/dist/core/roles.js.map +1 -0
  333. package/dist/core/runner/active-skill-scope.d.ts +64 -0
  334. package/dist/core/runner/active-skill-scope.d.ts.map +1 -0
  335. package/dist/core/runner/active-skill-scope.js +197 -0
  336. package/dist/core/runner/active-skill-scope.js.map +1 -0
  337. package/dist/core/runner/assemble-result.d.ts +191 -0
  338. package/dist/core/runner/assemble-result.d.ts.map +1 -0
  339. package/dist/core/runner/assemble-result.js +250 -0
  340. package/dist/core/runner/assemble-result.js.map +1 -0
  341. package/dist/core/runner/call-cap.d.ts +130 -0
  342. package/dist/core/runner/call-cap.d.ts.map +1 -0
  343. package/dist/core/runner/call-cap.js +151 -0
  344. package/dist/core/runner/call-cap.js.map +1 -0
  345. package/dist/core/runner/grounding-signal.d.ts +12 -0
  346. package/dist/core/runner/grounding-signal.d.ts.map +1 -0
  347. package/dist/core/runner/grounding-signal.js +94 -0
  348. package/dist/core/runner/grounding-signal.js.map +1 -0
  349. package/dist/core/runner/image.d.ts +23 -0
  350. package/dist/core/runner/image.d.ts.map +1 -0
  351. package/dist/core/runner/image.js +151 -0
  352. package/dist/core/runner/image.js.map +1 -0
  353. package/dist/core/runner/memory-consolidation.d.ts +112 -0
  354. package/dist/core/runner/memory-consolidation.d.ts.map +1 -0
  355. package/dist/core/runner/memory-consolidation.js +372 -0
  356. package/dist/core/runner/memory-consolidation.js.map +1 -0
  357. package/dist/core/runner/prepare-task.d.ts +583 -0
  358. package/dist/core/runner/prepare-task.d.ts.map +1 -0
  359. package/dist/core/runner/prepare-task.js +3612 -0
  360. package/dist/core/runner/prepare-task.js.map +1 -0
  361. package/dist/core/runner/prompt-suggestions.d.ts +33 -0
  362. package/dist/core/runner/prompt-suggestions.d.ts.map +1 -0
  363. package/dist/core/runner/prompt-suggestions.js +116 -0
  364. package/dist/core/runner/prompt-suggestions.js.map +1 -0
  365. package/dist/core/runner/runtask.d.ts +274 -0
  366. package/dist/core/runner/runtask.d.ts.map +1 -0
  367. package/dist/core/runner/runtask.js +4606 -0
  368. package/dist/core/runner/runtask.js.map +1 -0
  369. package/dist/core/runner/session-rule-policy.d.ts +28 -0
  370. package/dist/core/runner/session-rule-policy.d.ts.map +1 -0
  371. package/dist/core/runner/session-rule-policy.js +110 -0
  372. package/dist/core/runner/session-rule-policy.js.map +1 -0
  373. package/dist/core/runner/strict-output-schema.d.ts +36 -0
  374. package/dist/core/runner/strict-output-schema.d.ts.map +1 -0
  375. package/dist/core/runner/strict-output-schema.js +365 -0
  376. package/dist/core/runner/strict-output-schema.js.map +1 -0
  377. package/dist/core/runner/synthetic-tools.d.ts +72 -0
  378. package/dist/core/runner/synthetic-tools.d.ts.map +1 -0
  379. package/dist/core/runner/synthetic-tools.js +203 -0
  380. package/dist/core/runner/synthetic-tools.js.map +1 -0
  381. package/dist/core/runner/tool-disclosure.d.ts +117 -0
  382. package/dist/core/runner/tool-disclosure.d.ts.map +1 -0
  383. package/dist/core/runner/tool-disclosure.js +0 -0
  384. package/dist/core/runner/tool-disclosure.js.map +1 -0
  385. package/dist/core/runner/turn-attachments.d.ts +381 -0
  386. package/dist/core/runner/turn-attachments.d.ts.map +1 -0
  387. package/dist/core/runner/turn-attachments.js +596 -0
  388. package/dist/core/runner/turn-attachments.js.map +1 -0
  389. package/dist/core/runner/usage-accounting.d.ts +35 -0
  390. package/dist/core/runner/usage-accounting.d.ts.map +1 -0
  391. package/dist/core/runner/usage-accounting.js +45 -0
  392. package/dist/core/runner/usage-accounting.js.map +1 -0
  393. package/dist/core/runtime.d.ts +9 -0
  394. package/dist/core/runtime.d.ts.map +1 -0
  395. package/dist/core/runtime.js +17 -0
  396. package/dist/core/runtime.js.map +1 -0
  397. package/dist/core/safety-axis-vocab.d.ts +33 -0
  398. package/dist/core/safety-axis-vocab.d.ts.map +1 -0
  399. package/dist/core/safety-axis-vocab.js +35 -0
  400. package/dist/core/safety-axis-vocab.js.map +1 -0
  401. package/dist/core/safety-merge-corpus.d.ts +48 -0
  402. package/dist/core/safety-merge-corpus.d.ts.map +1 -0
  403. package/dist/core/safety-merge-corpus.js +203 -0
  404. package/dist/core/safety-merge-corpus.js.map +1 -0
  405. package/dist/core/scheduler.d.ts +126 -0
  406. package/dist/core/scheduler.d.ts.map +1 -0
  407. package/dist/core/scheduler.js +54 -0
  408. package/dist/core/scheduler.js.map +1 -0
  409. package/dist/core/secret-env.d.ts +23 -0
  410. package/dist/core/secret-env.d.ts.map +1 -0
  411. package/dist/core/secret-env.js +35 -0
  412. package/dist/core/secret-env.js.map +1 -0
  413. package/dist/core/select-model.d.ts +26 -0
  414. package/dist/core/select-model.d.ts.map +1 -0
  415. package/dist/core/select-model.js +58 -0
  416. package/dist/core/select-model.js.map +1 -0
  417. package/dist/core/sensitive-path-policy.d.ts +24 -0
  418. package/dist/core/sensitive-path-policy.d.ts.map +1 -0
  419. package/dist/core/sensitive-path-policy.js +96 -0
  420. package/dist/core/sensitive-path-policy.js.map +1 -0
  421. package/dist/core/session-policy-store.d.ts +102 -0
  422. package/dist/core/session-policy-store.d.ts.map +1 -0
  423. package/dist/core/session-policy-store.js +177 -0
  424. package/dist/core/session-policy-store.js.map +1 -0
  425. package/dist/core/session-reconcile.d.ts +63 -0
  426. package/dist/core/session-reconcile.d.ts.map +1 -0
  427. package/dist/core/session-reconcile.js +71 -0
  428. package/dist/core/session-reconcile.js.map +1 -0
  429. package/dist/core/session-store.d.ts +99 -0
  430. package/dist/core/session-store.d.ts.map +1 -0
  431. package/dist/core/session-store.js +298 -0
  432. package/dist/core/session-store.js.map +1 -0
  433. package/dist/core/session.d.ts +144 -0
  434. package/dist/core/session.d.ts.map +1 -0
  435. package/dist/core/session.js +56 -0
  436. package/dist/core/session.js.map +1 -0
  437. package/dist/core/spec-contract.d.ts +147 -0
  438. package/dist/core/spec-contract.d.ts.map +1 -0
  439. package/dist/core/spec-contract.js +340 -0
  440. package/dist/core/spec-contract.js.map +1 -0
  441. package/dist/core/strategy-store.d.ts +50 -0
  442. package/dist/core/strategy-store.d.ts.map +1 -0
  443. package/dist/core/strategy-store.js +100 -0
  444. package/dist/core/strategy-store.js.map +1 -0
  445. package/dist/core/stub-env.d.ts +35 -0
  446. package/dist/core/stub-env.d.ts.map +1 -0
  447. package/dist/core/stub-env.js +69 -0
  448. package/dist/core/stub-env.js.map +1 -0
  449. package/dist/core/task-notification.d.ts +115 -0
  450. package/dist/core/task-notification.d.ts.map +1 -0
  451. package/dist/core/task-notification.js +247 -0
  452. package/dist/core/task-notification.js.map +1 -0
  453. package/dist/core/task-outcome.d.ts +80 -0
  454. package/dist/core/task-outcome.d.ts.map +1 -0
  455. package/dist/core/task-outcome.js +40 -0
  456. package/dist/core/task-outcome.js.map +1 -0
  457. package/dist/core/task-registry.d.ts +349 -0
  458. package/dist/core/task-registry.d.ts.map +1 -0
  459. package/dist/core/task-registry.js +1751 -0
  460. package/dist/core/task-registry.js.map +1 -0
  461. package/dist/core/tighten-task-spec.d.ts +27 -0
  462. package/dist/core/tighten-task-spec.d.ts.map +1 -0
  463. package/dist/core/tighten-task-spec.js +95 -0
  464. package/dist/core/tighten-task-spec.js.map +1 -0
  465. package/dist/core/tool-detach.d.ts +31 -0
  466. package/dist/core/tool-detach.d.ts.map +1 -0
  467. package/dist/core/tool-detach.js +62 -0
  468. package/dist/core/tool-detach.js.map +1 -0
  469. package/dist/core/tool-errors.d.ts +72 -0
  470. package/dist/core/tool-errors.d.ts.map +1 -0
  471. package/dist/core/tool-errors.js +194 -0
  472. package/dist/core/tool-errors.js.map +1 -0
  473. package/dist/core/tool-name-aliases.d.ts +5 -0
  474. package/dist/core/tool-name-aliases.d.ts.map +1 -0
  475. package/dist/core/tool-name-aliases.js +130 -0
  476. package/dist/core/tool-name-aliases.js.map +1 -0
  477. package/dist/core/tool-policy.d.ts +295 -0
  478. package/dist/core/tool-policy.d.ts.map +1 -0
  479. package/dist/core/tool-policy.js +567 -0
  480. package/dist/core/tool-policy.js.map +1 -0
  481. package/dist/core/tool-result-budget.d.ts +44 -0
  482. package/dist/core/tool-result-budget.d.ts.map +1 -0
  483. package/dist/core/tool-result-budget.js +140 -0
  484. package/dist/core/tool-result-budget.js.map +1 -0
  485. package/dist/core/tool-result-store.d.ts +136 -0
  486. package/dist/core/tool-result-store.d.ts.map +1 -0
  487. package/dist/core/tool-result-store.js +219 -0
  488. package/dist/core/tool-result-store.js.map +1 -0
  489. package/dist/core/tools.d.ts +14 -0
  490. package/dist/core/tools.d.ts.map +1 -0
  491. package/dist/core/tools.js +98 -0
  492. package/dist/core/tools.js.map +1 -0
  493. package/dist/core/trace.d.ts +340 -0
  494. package/dist/core/trace.d.ts.map +1 -0
  495. package/dist/core/trace.js +12 -0
  496. package/dist/core/trace.js.map +1 -0
  497. package/dist/core/types.d.ts +2828 -0
  498. package/dist/core/types.d.ts.map +1 -0
  499. package/dist/core/types.js +2 -0
  500. package/dist/core/types.js.map +1 -0
  501. package/dist/core/untrusted-egress.d.ts +32 -0
  502. package/dist/core/untrusted-egress.d.ts.map +1 -0
  503. package/dist/core/untrusted-egress.js +49 -0
  504. package/dist/core/untrusted-egress.js.map +1 -0
  505. package/dist/core/untrusted-text.d.ts +64 -0
  506. package/dist/core/untrusted-text.d.ts.map +1 -0
  507. package/dist/core/untrusted-text.js +119 -0
  508. package/dist/core/untrusted-text.js.map +1 -0
  509. package/dist/core/warm-resume.d.ts +23 -0
  510. package/dist/core/warm-resume.d.ts.map +1 -0
  511. package/dist/core/warm-resume.js +28 -0
  512. package/dist/core/warm-resume.js.map +1 -0
  513. package/dist/core/with-retry.d.ts +43 -0
  514. package/dist/core/with-retry.d.ts.map +1 -0
  515. package/dist/core/with-retry.js +59 -0
  516. package/dist/core/with-retry.js.map +1 -0
  517. package/dist/core/workflow-journal-store.d.ts +44 -0
  518. package/dist/core/workflow-journal-store.d.ts.map +1 -0
  519. package/dist/core/workflow-journal-store.js +47 -0
  520. package/dist/core/workflow-journal-store.js.map +1 -0
  521. package/dist/core/workflow-run-store-contract.d.ts +31 -0
  522. package/dist/core/workflow-run-store-contract.d.ts.map +1 -0
  523. package/dist/core/workflow-run-store-contract.js +191 -0
  524. package/dist/core/workflow-run-store-contract.js.map +1 -0
  525. package/dist/core/workflow-run-store.d.ts +149 -0
  526. package/dist/core/workflow-run-store.d.ts.map +1 -0
  527. package/dist/core/workflow-run-store.js +110 -0
  528. package/dist/core/workflow-run-store.js.map +1 -0
  529. package/dist/engine/compaction/compaction.d.ts +139 -0
  530. package/dist/engine/compaction/compaction.d.ts.map +1 -0
  531. package/dist/engine/compaction/compaction.js +1030 -0
  532. package/dist/engine/compaction/compaction.js.map +1 -0
  533. package/dist/engine/compaction/utils.d.ts +45 -0
  534. package/dist/engine/compaction/utils.d.ts.map +1 -0
  535. package/dist/engine/compaction/utils.js +203 -0
  536. package/dist/engine/compaction/utils.js.map +1 -0
  537. package/dist/engine/execution-env/kill-tree.d.ts +20 -0
  538. package/dist/engine/execution-env/kill-tree.d.ts.map +1 -0
  539. package/dist/engine/execution-env/kill-tree.js +183 -0
  540. package/dist/engine/execution-env/kill-tree.js.map +1 -0
  541. package/dist/engine/execution-env/node-execution-env.d.ts +133 -0
  542. package/dist/engine/execution-env/node-execution-env.d.ts.map +1 -0
  543. package/dist/engine/execution-env/node-execution-env.js +1031 -0
  544. package/dist/engine/execution-env/node-execution-env.js.map +1 -0
  545. package/dist/engine/harness/agent-harness.d.ts +174 -0
  546. package/dist/engine/harness/agent-harness.d.ts.map +1 -0
  547. package/dist/engine/harness/agent-harness.js +1053 -0
  548. package/dist/engine/harness/agent-harness.js.map +1 -0
  549. package/dist/engine/harness/messages.d.ts +17 -0
  550. package/dist/engine/harness/messages.d.ts.map +1 -0
  551. package/dist/engine/harness/messages.js +122 -0
  552. package/dist/engine/harness/messages.js.map +1 -0
  553. package/dist/engine/harness/types.d.ts +713 -0
  554. package/dist/engine/harness/types.d.ts.map +1 -0
  555. package/dist/engine/harness/types.js +100 -0
  556. package/dist/engine/harness/types.js.map +1 -0
  557. package/dist/engine/llm/diagnostics.d.ts +23 -0
  558. package/dist/engine/llm/diagnostics.d.ts.map +1 -0
  559. package/dist/engine/llm/diagnostics.js +32 -0
  560. package/dist/engine/llm/diagnostics.js.map +1 -0
  561. package/dist/engine/llm/event-stream.d.ts +25 -0
  562. package/dist/engine/llm/event-stream.d.ts.map +1 -0
  563. package/dist/engine/llm/event-stream.js +103 -0
  564. package/dist/engine/llm/event-stream.js.map +1 -0
  565. package/dist/engine/llm/index.d.ts +12 -0
  566. package/dist/engine/llm/index.d.ts.map +1 -0
  567. package/dist/engine/llm/index.js +12 -0
  568. package/dist/engine/llm/index.js.map +1 -0
  569. package/dist/engine/llm/types.d.ts +753 -0
  570. package/dist/engine/llm/types.d.ts.map +1 -0
  571. package/dist/engine/llm/types.js +2 -0
  572. package/dist/engine/llm/types.js.map +1 -0
  573. package/dist/engine/llm/validation.d.ts +8 -0
  574. package/dist/engine/llm/validation.d.ts.map +1 -0
  575. package/dist/engine/llm/validation.js +318 -0
  576. package/dist/engine/llm/validation.js.map +1 -0
  577. package/dist/engine/loop/agent-loop.d.ts +74 -0
  578. package/dist/engine/loop/agent-loop.d.ts.map +1 -0
  579. package/dist/engine/loop/agent-loop.js +1490 -0
  580. package/dist/engine/loop/agent-loop.js.map +1 -0
  581. package/dist/engine/loop/runtime-deps.d.ts +17 -0
  582. package/dist/engine/loop/runtime-deps.d.ts.map +1 -0
  583. package/dist/engine/loop/runtime-deps.js +21 -0
  584. package/dist/engine/loop/runtime-deps.js.map +1 -0
  585. package/dist/engine/loop/types.d.ts +609 -0
  586. package/dist/engine/loop/types.d.ts.map +1 -0
  587. package/dist/engine/loop/types.js +2 -0
  588. package/dist/engine/loop/types.js.map +1 -0
  589. package/dist/engine/lsp/frame-decoder.d.ts +16 -0
  590. package/dist/engine/lsp/frame-decoder.d.ts.map +1 -0
  591. package/dist/engine/lsp/frame-decoder.js +53 -0
  592. package/dist/engine/lsp/frame-decoder.js.map +1 -0
  593. package/dist/engine/lsp/node-lsp-manager.d.ts +105 -0
  594. package/dist/engine/lsp/node-lsp-manager.d.ts.map +1 -0
  595. package/dist/engine/lsp/node-lsp-manager.js +343 -0
  596. package/dist/engine/lsp/node-lsp-manager.js.map +1 -0
  597. package/dist/engine/lsp/stdio-lsp-transport.d.ts +37 -0
  598. package/dist/engine/lsp/stdio-lsp-transport.d.ts.map +1 -0
  599. package/dist/engine/lsp/stdio-lsp-transport.js +185 -0
  600. package/dist/engine/lsp/stdio-lsp-transport.js.map +1 -0
  601. package/dist/engine/session/import-validate.d.ts +44 -0
  602. package/dist/engine/session/import-validate.d.ts.map +1 -0
  603. package/dist/engine/session/import-validate.js +92 -0
  604. package/dist/engine/session/import-validate.js.map +1 -0
  605. package/dist/engine/session/memory-repo.d.ts +25 -0
  606. package/dist/engine/session/memory-repo.d.ts.map +1 -0
  607. package/dist/engine/session/memory-repo.js +59 -0
  608. package/dist/engine/session/memory-repo.js.map +1 -0
  609. package/dist/engine/session/memory-storage.d.ts +14 -0
  610. package/dist/engine/session/memory-storage.d.ts.map +1 -0
  611. package/dist/engine/session/memory-storage.js +17 -0
  612. package/dist/engine/session/memory-storage.js.map +1 -0
  613. package/dist/engine/session/repo-utils.d.ts +11 -0
  614. package/dist/engine/session/repo-utils.d.ts.map +1 -0
  615. package/dist/engine/session/repo-utils.js +40 -0
  616. package/dist/engine/session/repo-utils.js.map +1 -0
  617. package/dist/engine/session/session.d.ts +34 -0
  618. package/dist/engine/session/session.d.ts.map +1 -0
  619. package/dist/engine/session/session.js +227 -0
  620. package/dist/engine/session/session.js.map +1 -0
  621. package/dist/engine/session/storage-base.d.ts +38 -0
  622. package/dist/engine/session/storage-base.d.ts.map +1 -0
  623. package/dist/engine/session/storage-base.js +157 -0
  624. package/dist/engine/session/storage-base.js.map +1 -0
  625. package/dist/engine/session/timestamps.d.ts +3 -0
  626. package/dist/engine/session/timestamps.d.ts.map +1 -0
  627. package/dist/engine/session/timestamps.js +15 -0
  628. package/dist/engine/session/timestamps.js.map +1 -0
  629. package/dist/engine/session/uuid.d.ts +2 -0
  630. package/dist/engine/session/uuid.d.ts.map +1 -0
  631. package/dist/engine/session/uuid.js +50 -0
  632. package/dist/engine/session/uuid.js.map +1 -0
  633. package/dist/index.d.ts +160 -0
  634. package/dist/index.d.ts.map +1 -0
  635. package/dist/index.js +374 -0
  636. package/dist/index.js.map +1 -0
  637. package/dist/internal/harness.d.ts +26 -0
  638. package/dist/internal/harness.d.ts.map +1 -0
  639. package/dist/internal/harness.js +24 -0
  640. package/dist/internal/harness.js.map +1 -0
  641. package/dist/internal/llm.d.ts +9 -0
  642. package/dist/internal/llm.d.ts.map +1 -0
  643. package/dist/internal/llm.js +8 -0
  644. package/dist/internal/llm.js.map +1 -0
  645. package/dist/orchestration/builtin-workflows.d.ts +44 -0
  646. package/dist/orchestration/builtin-workflows.d.ts.map +1 -0
  647. package/dist/orchestration/builtin-workflows.js +165 -0
  648. package/dist/orchestration/builtin-workflows.js.map +1 -0
  649. package/dist/orchestration/dev-vm-script-runner.d.ts +24 -0
  650. package/dist/orchestration/dev-vm-script-runner.d.ts.map +1 -0
  651. package/dist/orchestration/dev-vm-script-runner.js +106 -0
  652. package/dist/orchestration/dev-vm-script-runner.js.map +1 -0
  653. package/dist/orchestration/goal.d.ts +97 -0
  654. package/dist/orchestration/goal.d.ts.map +1 -0
  655. package/dist/orchestration/goal.js +248 -0
  656. package/dist/orchestration/goal.js.map +1 -0
  657. package/dist/orchestration/run-spec.d.ts +63 -0
  658. package/dist/orchestration/run-spec.d.ts.map +1 -0
  659. package/dist/orchestration/run-spec.js +274 -0
  660. package/dist/orchestration/run-spec.js.map +1 -0
  661. package/dist/orchestration/run-workflow-tool.d.ts +187 -0
  662. package/dist/orchestration/run-workflow-tool.d.ts.map +1 -0
  663. package/dist/orchestration/run-workflow-tool.js +612 -0
  664. package/dist/orchestration/run-workflow-tool.js.map +1 -0
  665. package/dist/orchestration/workflow-governance.d.ts +70 -0
  666. package/dist/orchestration/workflow-governance.d.ts.map +1 -0
  667. package/dist/orchestration/workflow-governance.js +176 -0
  668. package/dist/orchestration/workflow-governance.js.map +1 -0
  669. package/dist/orchestration/workflow-meta.d.ts +41 -0
  670. package/dist/orchestration/workflow-meta.d.ts.map +1 -0
  671. package/dist/orchestration/workflow-meta.js +426 -0
  672. package/dist/orchestration/workflow-meta.js.map +1 -0
  673. package/dist/orchestration/workflow-observe.d.ts +77 -0
  674. package/dist/orchestration/workflow-observe.d.ts.map +1 -0
  675. package/dist/orchestration/workflow-observe.js +177 -0
  676. package/dist/orchestration/workflow-observe.js.map +1 -0
  677. package/dist/orchestration/workflow-primitives.d.ts +31 -0
  678. package/dist/orchestration/workflow-primitives.d.ts.map +1 -0
  679. package/dist/orchestration/workflow-primitives.js +104 -0
  680. package/dist/orchestration/workflow-primitives.js.map +1 -0
  681. package/dist/orchestration/workflow-sandbox-conformance.d.ts +34 -0
  682. package/dist/orchestration/workflow-sandbox-conformance.d.ts.map +1 -0
  683. package/dist/orchestration/workflow-sandbox-conformance.js +301 -0
  684. package/dist/orchestration/workflow-sandbox-conformance.js.map +1 -0
  685. package/dist/orchestration/workflow-script-runner.d.ts +127 -0
  686. package/dist/orchestration/workflow-script-runner.d.ts.map +1 -0
  687. package/dist/orchestration/workflow-script-runner.js +48 -0
  688. package/dist/orchestration/workflow-script-runner.js.map +1 -0
  689. package/dist/orchestration/workflow-script-store.d.ts +99 -0
  690. package/dist/orchestration/workflow-script-store.d.ts.map +1 -0
  691. package/dist/orchestration/workflow-script-store.js +133 -0
  692. package/dist/orchestration/workflow-script-store.js.map +1 -0
  693. package/dist/orchestration/workflow-size-guideline.d.ts +50 -0
  694. package/dist/orchestration/workflow-size-guideline.d.ts.map +1 -0
  695. package/dist/orchestration/workflow-size-guideline.js +78 -0
  696. package/dist/orchestration/workflow-size-guideline.js.map +1 -0
  697. package/dist/orchestration/workflow.d.ts +624 -0
  698. package/dist/orchestration/workflow.d.ts.map +1 -0
  699. package/dist/orchestration/workflow.js +1596 -0
  700. package/dist/orchestration/workflow.js.map +1 -0
  701. package/dist/prompts/default.d.ts +474 -0
  702. package/dist/prompts/default.d.ts.map +1 -0
  703. package/dist/prompts/default.js +676 -0
  704. package/dist/prompts/default.js.map +1 -0
  705. package/dist/prompts/supervisor.d.ts +60 -0
  706. package/dist/prompts/supervisor.d.ts.map +1 -0
  707. package/dist/prompts/supervisor.js +162 -0
  708. package/dist/prompts/supervisor.js.map +1 -0
  709. package/dist/scenarios/env.d.ts +41 -0
  710. package/dist/scenarios/env.d.ts.map +1 -0
  711. package/dist/scenarios/env.js +65 -0
  712. package/dist/scenarios/env.js.map +1 -0
  713. package/dist/scenarios/full-body.d.ts +47 -0
  714. package/dist/scenarios/full-body.d.ts.map +1 -0
  715. package/dist/scenarios/full-body.js +36 -0
  716. package/dist/scenarios/full-body.js.map +1 -0
  717. package/dist/scenarios/scenario-registry.d.ts +107 -0
  718. package/dist/scenarios/scenario-registry.d.ts.map +1 -0
  719. package/dist/scenarios/scenario-registry.js +192 -0
  720. package/dist/scenarios/scenario-registry.js.map +1 -0
  721. package/dist/scenarios/teacher-quickstart.d.ts +41 -0
  722. package/dist/scenarios/teacher-quickstart.d.ts.map +1 -0
  723. package/dist/scenarios/teacher-quickstart.js +32 -0
  724. package/dist/scenarios/teacher-quickstart.js.map +1 -0
  725. package/dist/server/http.d.ts +36 -0
  726. package/dist/server/http.d.ts.map +1 -0
  727. package/dist/server/http.js +144 -0
  728. package/dist/server/http.js.map +1 -0
  729. package/dist/stores/file/checkpoint-store.d.ts +62 -0
  730. package/dist/stores/file/checkpoint-store.d.ts.map +1 -0
  731. package/dist/stores/file/checkpoint-store.js +250 -0
  732. package/dist/stores/file/checkpoint-store.js.map +1 -0
  733. package/dist/stores/file/file-snapshot-store.d.ts +43 -0
  734. package/dist/stores/file/file-snapshot-store.d.ts.map +1 -0
  735. package/dist/stores/file/file-snapshot-store.js +374 -0
  736. package/dist/stores/file/file-snapshot-store.js.map +1 -0
  737. package/dist/stores/file/fs-atomic.d.ts +95 -0
  738. package/dist/stores/file/fs-atomic.d.ts.map +1 -0
  739. package/dist/stores/file/fs-atomic.js +415 -0
  740. package/dist/stores/file/fs-atomic.js.map +1 -0
  741. package/dist/stores/file/index.d.ts +98 -0
  742. package/dist/stores/file/index.d.ts.map +1 -0
  743. package/dist/stores/file/index.js +109 -0
  744. package/dist/stores/file/index.js.map +1 -0
  745. package/dist/stores/file/memory-store.d.ts +95 -0
  746. package/dist/stores/file/memory-store.d.ts.map +1 -0
  747. package/dist/stores/file/memory-store.js +393 -0
  748. package/dist/stores/file/memory-store.js.map +1 -0
  749. package/dist/stores/file/session-policy-store.d.ts +24 -0
  750. package/dist/stores/file/session-policy-store.d.ts.map +1 -0
  751. package/dist/stores/file/session-policy-store.js +123 -0
  752. package/dist/stores/file/session-policy-store.js.map +1 -0
  753. package/dist/stores/file/session-store.d.ts +34 -0
  754. package/dist/stores/file/session-store.d.ts.map +1 -0
  755. package/dist/stores/file/session-store.js +175 -0
  756. package/dist/stores/file/session-store.js.map +1 -0
  757. package/dist/stores/file/tool-result-store.d.ts +23 -0
  758. package/dist/stores/file/tool-result-store.d.ts.map +1 -0
  759. package/dist/stores/file/tool-result-store.js +61 -0
  760. package/dist/stores/file/tool-result-store.js.map +1 -0
  761. package/dist/stores/file/workflow-journal-store.d.ts +36 -0
  762. package/dist/stores/file/workflow-journal-store.d.ts.map +1 -0
  763. package/dist/stores/file/workflow-journal-store.js +157 -0
  764. package/dist/stores/file/workflow-journal-store.js.map +1 -0
  765. package/dist/stores/file/workflow-run-store.d.ts +58 -0
  766. package/dist/stores/file/workflow-run-store.d.ts.map +1 -0
  767. package/dist/stores/file/workflow-run-store.js +178 -0
  768. package/dist/stores/file/workflow-run-store.js.map +1 -0
  769. package/dist/stores/pg.d.ts +210 -0
  770. package/dist/stores/pg.d.ts.map +1 -0
  771. package/dist/stores/pg.js +652 -0
  772. package/dist/stores/pg.js.map +1 -0
  773. package/dist/tools/fs/encoding.d.ts +51 -0
  774. package/dist/tools/fs/encoding.d.ts.map +1 -0
  775. package/dist/tools/fs/encoding.js +74 -0
  776. package/dist/tools/fs/encoding.js.map +1 -0
  777. package/dist/tools/fs/gh-rate-limit.d.ts +19 -0
  778. package/dist/tools/fs/gh-rate-limit.d.ts.map +1 -0
  779. package/dist/tools/fs/gh-rate-limit.js +35 -0
  780. package/dist/tools/fs/gh-rate-limit.js.map +1 -0
  781. package/dist/tools/fs/index.d.ts +246 -0
  782. package/dist/tools/fs/index.d.ts.map +1 -0
  783. package/dist/tools/fs/index.js +2130 -0
  784. package/dist/tools/fs/index.js.map +1 -0
  785. package/dist/tools/fs/pdf.d.ts +106 -0
  786. package/dist/tools/fs/pdf.d.ts.map +1 -0
  787. package/dist/tools/fs/pdf.js +178 -0
  788. package/dist/tools/fs/pdf.js.map +1 -0
  789. package/dist/tools/fs/repo-map.d.ts +15 -0
  790. package/dist/tools/fs/repo-map.d.ts.map +1 -0
  791. package/dist/tools/fs/repo-map.js +251 -0
  792. package/dist/tools/fs/repo-map.js.map +1 -0
  793. package/dist/tools/fs/safety.d.ts +168 -0
  794. package/dist/tools/fs/safety.d.ts.map +1 -0
  795. package/dist/tools/fs/safety.js +479 -0
  796. package/dist/tools/fs/safety.js.map +1 -0
  797. package/dist/tools/fs/search.d.ts +118 -0
  798. package/dist/tools/fs/search.d.ts.map +1 -0
  799. package/dist/tools/fs/search.js +650 -0
  800. package/dist/tools/fs/search.js.map +1 -0
  801. package/dist/tools/gitea-issue.d.ts +39 -0
  802. package/dist/tools/gitea-issue.d.ts.map +1 -0
  803. package/dist/tools/gitea-issue.js +91 -0
  804. package/dist/tools/gitea-issue.js.map +1 -0
  805. package/dist/tools/monitor.d.ts +64 -0
  806. package/dist/tools/monitor.d.ts.map +1 -0
  807. package/dist/tools/monitor.js +135 -0
  808. package/dist/tools/monitor.js.map +1 -0
  809. package/dist/tools/scheduler-tools.d.ts +48 -0
  810. package/dist/tools/scheduler-tools.d.ts.map +1 -0
  811. package/dist/tools/scheduler-tools.js +449 -0
  812. package/dist/tools/scheduler-tools.js.map +1 -0
  813. package/dist/tools/sql-adapters.d.ts +32 -0
  814. package/dist/tools/sql-adapters.d.ts.map +1 -0
  815. package/dist/tools/sql-adapters.js +31 -0
  816. package/dist/tools/sql-adapters.js.map +1 -0
  817. package/dist/tools/sql.d.ts +36 -0
  818. package/dist/tools/sql.d.ts.map +1 -0
  819. package/dist/tools/sql.js +131 -0
  820. package/dist/tools/sql.js.map +1 -0
  821. package/dist/tools/task-list.d.ts +26 -0
  822. package/dist/tools/task-list.d.ts.map +1 -0
  823. package/dist/tools/task-list.js +352 -0
  824. package/dist/tools/task-list.js.map +1 -0
  825. package/dist/tools/todo.d.ts +11 -0
  826. package/dist/tools/todo.d.ts.map +1 -0
  827. package/dist/tools/todo.js +126 -0
  828. package/dist/tools/todo.js.map +1 -0
  829. package/dist/tools/web.d.ts +59 -0
  830. package/dist/tools/web.d.ts.map +1 -0
  831. package/dist/tools/web.js +607 -0
  832. package/dist/tools/web.js.map +1 -0
  833. package/dist/tools/worktree.d.ts +88 -0
  834. package/dist/tools/worktree.d.ts.map +1 -0
  835. package/dist/tools/worktree.js +434 -0
  836. package/dist/tools/worktree.js.map +1 -0
  837. package/docs/A1-ATTRIBUTION-ROUND1-2026-07-09.md +181 -0
  838. package/docs/AB-ORACLE-GATE-VERDICT-2026-07-10.md +100 -0
  839. package/docs/ANCHOR-GAP-INVENTORY-2026-07-09.md +143 -0
  840. package/docs/ARCHITECTURE.md +125 -0
  841. package/docs/BUGHUNT-2026-07-05-NIGHT.md +98 -0
  842. package/docs/BUILD.md +63 -0
  843. package/docs/CANCEL-ASYNC-ATTRIBUTION-2026-07-09.md +98 -0
  844. package/docs/CC-198-VS-201-DRIFT-2026-07-09.md +70 -0
  845. package/docs/CC-BASELINE-FAKE-ZERO-AUDIT-2026-07-09.md +51 -0
  846. package/docs/CC-DRIFT-198-206-AGENT-TYPES-2026-07-10.md +82 -0
  847. package/docs/CC-DRIFT-198-206-CHANGELOG-2026-07-10.md +82 -0
  848. package/docs/CC-DRIFT-198-206-REMINDERS-2026-07-10.md +96 -0
  849. package/docs/CC-DRIFT-198-206-ROADMAP-2026-07-10.md +110 -0
  850. package/docs/CC-DRIFT-198-206-TOOL-INVENTORY-2026-07-10.md +53 -0
  851. package/docs/CC-DRIFT-198-206-USAGE-CONSTANTS-2026-07-10.md +64 -0
  852. package/docs/CC-DRIFT-198-206-WORKFLOW-2026-07-10.md +83 -0
  853. package/docs/CC-PARITY-CHECKLIST.md +220 -0
  854. package/docs/CC-PARITY-DEEP-SWEEP-2026-07-07.md +149 -0
  855. package/docs/CC-SUBAGENT-PROMPT-STUDY-2026-07-09.md +219 -0
  856. package/docs/CC-TASK-REMINDER-CADENCE-STUDY-2026-07-09.md +396 -0
  857. package/docs/CC-TOOL-PARITY-SWEEP-2026-07.md +56 -0
  858. package/docs/CC-TOOL-PROMPT-DEEP-DIFF-2026-07-08.md +274 -0
  859. package/docs/CC-TOOLSURFACE-DEEP-DIVE-2026-07-07.md +197 -0
  860. package/docs/CC206-OBSERVER-ANCHORS-2026-07-11.md +463 -0
  861. package/docs/CC207-CORE-SWEEP-BACKLOG-2026-07-12.md +155 -0
  862. package/docs/CENTER-CONTROL-PLANE-SEAM.md +86 -0
  863. package/docs/CLEANUP-CONTRACT-ANCHOR-2026-07-09.md +83 -0
  864. package/docs/COLD-START-RSI-2026-07-09.md +72 -0
  865. package/docs/COMPACTION-LIVE-AUDIT-2026-07-09.md +114 -0
  866. package/docs/CONTEXT-lifecycle-extension-points-and-stop-attribution.md +71 -0
  867. package/docs/COREWARS-POLYGLOT-TRIAGE-2026-07-09.md +85 -0
  868. package/docs/DEADTARGET-OVERFULL-HBOX-2026-07-10.md +92 -0
  869. package/docs/DEADTARGET-PATH-TRACING-REVERSE-2026-07-10.md +87 -0
  870. package/docs/DEADTARGET-WINNING-AVG-COREWARS-2026-07-10.md +96 -0
  871. package/docs/DEEPSEEK-API-LIMITS-PROBE-2026-07-09.md +118 -0
  872. package/docs/DESIGN-140-MOCK-VERIFY-2026-07-11.md +79 -0
  873. package/docs/DESIGN-140-VERIFICATION-2026-07-11.md +43 -0
  874. package/docs/DESIGN-DRAFT-workflow-collab-2026-07-11.md +56 -0
  875. package/docs/DESIGN-ORACLE-GROUNDING-GATE-2026-07-10.md +167 -0
  876. package/docs/DESIGN-TFRAG-RECONCILE-SCAFFOLD-2026-07-09.md +102 -0
  877. package/docs/EXP-PA2-PE-DESIGN-2026-07-11.md +220 -0
  878. package/docs/EXT-DOGFOOD-2026-07-12.md +50 -0
  879. package/docs/FINAL-VERIFY-SURFACE-AUDIT-2026-07-09.md +44 -0
  880. package/docs/FRAG-RECON-INVESTIGATION-2026-07-09.md +183 -0
  881. package/docs/HANDOFF.md +121 -0
  882. package/docs/KNOWN-ISSUES.md +96 -0
  883. package/docs/LEGW-WINDOW-TAX-2026-07-10.md +82 -0
  884. package/docs/LIVE-PROBE-BATCH-2026-07-11.md +207 -0
  885. package/docs/M2-CERT-ATTRIBUTION-2026-07-10.md +61 -0
  886. package/docs/M25-LEG-VARIANCE-ATTRIBUTION-2026-07-10.md +81 -0
  887. package/docs/MAILMAN-TIMEOUT-ATTRIBUTION-2026-07-10.md +88 -0
  888. package/docs/MEMORY-BACKEND-DIALECT-NOTES.md +69 -0
  889. package/docs/MTEB-ESCAPE-HATCH-ATTRIBUTION-2026-07-09.md +57 -0
  890. package/docs/MTEB-LEADERBOARD-ATTRIBUTION-2026-07-10.md +134 -0
  891. package/docs/ORACLE-GATE-NEGATIVE-SAMPLE-2026-07-11.md +28 -0
  892. package/docs/PARITY-CONTEXT-TRANSACTIONS-2026-07-10.md +67 -0
  893. package/docs/PARITY-PROGRESS-MATRIX-2026-07-10.md +37 -0
  894. package/docs/PARITY-SPOT-AGENT-TYPES-2026-07-10.md +70 -0
  895. package/docs/PARITY-SPOT-REMINDERS-2026-07-10.md +144 -0
  896. package/docs/PARITY-SPOT-TOOL-INVENTORY-2026-07-10.md +61 -0
  897. package/docs/PARITY-SPOT-USAGE-CONSTANTS-2026-07-10.md +95 -0
  898. package/docs/PARITY-SPOT-WORKFLOW-2026-07-10.md +93 -0
  899. package/docs/PASSWORD-RECOVERY-PANEL-VERDICT-2026-07-10.md +62 -0
  900. package/docs/R8-R9-FINALIZE-COORDINATION-2026-07-09.md +124 -0
  901. package/docs/REPL-CODE-MODE-EVALUATION-2026-07-10.md +187 -0
  902. package/docs/REPORT-1249-TARGETED.md +48 -0
  903. package/docs/RESEARCH-3P-MEMORY-SWAP-2026-07-12.md +273 -0
  904. package/docs/ROADMAP.md +111 -0
  905. package/docs/RSI-CLOUD-DEPLOY-2026-07-06.md +289 -0
  906. package/docs/RSI-PROCESS-AI-COLDSTART-2026-07-11.md +68 -0
  907. package/docs/S18-THOROUGHNESS-AUDIT-2026-07-09.md +113 -0
  908. package/docs/SERVICE-INTEGRATION-GUIDE.md +298 -0
  909. package/docs/SUBAGENT-STREAM-RESILIENCE-PARITY-2026-07-10.md +118 -0
  910. package/docs/SWEBENCH-PRO-RECON-2026-07-11.md +31 -0
  911. package/docs/TB-EFFICIENCY-TELEMETRY-2026-07-08.md +114 -0
  912. package/docs/TB-FAILURE-AUTOPSY-2026-07-05-RERUN.md +67 -0
  913. package/docs/TB-FAIRNESS-AUDIT-2026-07-08.md +141 -0
  914. package/docs/TB-FULL-1257-2026-07-08.md +77 -0
  915. package/docs/TB-LEG-GAP-ATTRIBUTION-1261-1263-2026-07-11.md +154 -0
  916. package/docs/TB-REGRESSION-DAEMON-KILL-2026-07-08.md +58 -0
  917. package/docs/TB-RSI-CROSSCHECK-2026-07-06.md +68 -0
  918. package/docs/TB-RSI-LEDGER.md +30 -0
  919. package/docs/TB-STABLE-SET-2026-07-08.md +127 -0
  920. package/docs/TB21-RECON-2026-07-11.md +28 -0
  921. package/docs/TEST-DESIGN-BATCH-1-2-3.md +97 -0
  922. package/docs/THIRD-PARTY-INTEGRATION.md +45 -0
  923. package/docs/TOKEN-ESTIMATE-CALIBRATION-LIVE-2026-07-09.md +102 -0
  924. package/docs/audit-2026-06-10-/347/254/254/344/272/214/350/275/256-/347/251/272/347/231/275/345/214/272/344/270/216/345/277/230/346/216/245/347/272/277.md +147 -0
  925. package/docs/audit-2026-06-10-/350/256/241/347/256/227bug/346/211/253/346/217/217.md +163 -0
  926. package/docs/audit-2026-06-11-/344/277/256/345/244/215/345/244/215/345/256/241/344/270/216/345/233/236/345/275/222/344/270/223/346/211/253.md +95 -0
  927. package/docs/audit-2026-06-12-design71-P1/346/275/234/344/274/217/351/235/242/350/243/201/345/206/263/344/270/216/345/220/236/351/224/231/345/256/241/350/256/241.md +45 -0
  928. package/docs/audit-2026-06-12-/345/205/254/345/274/200/346/227/213/351/222/256/346/264/273/346/200/247/344/270/216vendored/346/255/273/350/267/257.md +63 -0
  929. package/docs/audit-2026-06-15/ADDENDUM-second-pass.md +88 -0
  930. package/docs/audit-2026-06-15/ARCHITECTURE-AND-ROADMAP.md +187 -0
  931. package/docs/audit-2026-06-15/DOC-CORRECTIONS.md +105 -0
  932. package/docs/audit-2026-06-15/INDEX.md +49 -0
  933. package/docs/audit-2026-06-15/ORCHESTRATION-STATUS.md +98 -0
  934. package/docs/audit-2026-06-15/PRODUCTION-ISSUES.md +189 -0
  935. package/docs/audit-2026-06-15/REFERENCES-literature.md +139 -0
  936. package/docs/audit-2026-06-15/VENDOR-REFACTOR-PLAN.md +96 -0
  937. package/docs/cc-probe-198/README.md +72 -0
  938. package/docs/cc-probe-198/STABILITY-AUDIT.md +118 -0
  939. package/docs/cc-probe-198/live-schema-monitor-worktree-2026-07-09.json +56 -0
  940. package/docs/cc-probe-198/mount-variants.json +536 -0
  941. package/docs/cc-probe-198/plan-mode-run.json +1 -0
  942. package/docs/cc-probe-198/probe-bash-bg.json +224 -0
  943. package/docs/cc-probe-198/probe-edit-mismatch.json +120 -0
  944. package/docs/cc-probe-198/probe-read-missing.json +62 -0
  945. package/docs/cc-probe-198/probe-search-empty.json +127 -0
  946. package/docs/cc-probe-198/probe-task-family.json +227 -0
  947. package/docs/cc-probe-198/probes.status +6 -0
  948. package/docs/cc-probe-198/raw-capture-interactive.json +948 -0
  949. package/docs/cc-probe-198/raw-capture-print.json +787 -0
  950. package/docs/cc-probe-198/raw-capture2-interactive.json +948 -0
  951. package/docs/cc-probe-198/raw-capture2-print.json +787 -0
  952. package/docs/cc-probe-198/system-prompt.txt +135 -0
  953. package/docs/cc-probe-198/tools-array.json +962 -0
  954. package/docs/durability-boundary.md +63 -0
  955. package/docs/fix-2026-06-10-/350/256/241/347/256/227bug/344/277/256/345/244/215-search/346/211/271.md +75 -0
  956. package/docs/fix-2026-06-11-/347/254/254/344/272/214/350/275/256-/344/277/256/345/244/215-search/346/211/271.md +62 -0
  957. package/docs/parity-sweep/REPORT-DYNAMIC.md +97 -0
  958. package/docs/parity-sweep/REPORT-STATIC-GGB.md +127 -0
  959. package/docs/parity-sweep/REPORT-STATIC-RWE.md +133 -0
  960. package/docs/vendor-history.md +385 -0
  961. package/docs/vendored-upstream-diff-2026-07.md +83 -0
  962. package/package.json +70 -0
@@ -0,0 +1 @@
1
+ {"version":3,"file":"web.js","sourceRoot":"","sources":["../../src/tools/web.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,SAAS,CAAC;AAC/B,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAG9C,OAAO,EAAE,gBAAgB,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAC;AAC9E,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAExD;;;;;;GAMG;AAEH,4GAA4G;AAC5G,MAAM,aAAa,GAAG,EAAE,CAAC,CAAC,6FAA6F;AACvH;oHACoH;AACpH,MAAM,cAAc,GAAG,IAAI,CAAC;AAC5B;2GAC2G;AAC3G,MAAM,eAAe,GAAG,+BAA+B,CAAC;AACxD,MAAM,2BAA2B,GAAG,oCAAoC,CAAC;AAyBzE,MAAM,iBAAiB,GAAG,CAAC,GAAG,IAAI,GAAG,IAAI,CAAC;AAC1C,MAAM,wBAAwB,GAAG,MAAM,CAAC;AAExC;yFACyF;AACzF,SAAS,cAAc,CAAC,CAAS;IAC/B,MAAM,EAAE,GAAG,CAAC,CAAS,EAAU,EAAE;QAC/B,IAAI,CAAC;YACH,OAAO,MAAM,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC;QACjC,CAAC;QAAC,MAAM,CAAC;YACP,OAAO,EAAE,CAAC;QACZ,CAAC;IACH,CAAC,CAAC;IACF,OAAO,CAAC;SACL,OAAO,CAAC,WAAW,EAAE,CAAC,CAAC,EAAE,CAAS,EAAE,EAAE,CAAC,EAAE,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC;SACrD,OAAO,CAAC,mBAAmB,EAAE,CAAC,CAAC,EAAE,CAAS,EAAE,EAAE,CAAC,EAAE,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC;SAC1E,OAAO,CAAC,SAAS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AG,CAAC,CAAC;YAC/G,MAAM,IAAI,GAAG,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,KAAK,QAAQ,CAAC,CAAC,GAAG,QAAQ,CAAC,CAAC,OAAO,EAAE,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;YACpG,6FAA6F;YAC7F,MAAM,MAAM,GAAG,gBAAgB,CAAC,aAAa,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,EAAE,EAAE,IAAI,IAAI,cAAc,CAAC,CAAC;YAC9F,yFAAyF;YACzF,uGAAuG;YACvG,2FAA2F;YAC3F,MAAM,SAAS,GAAG,GAAG,MAAM,0GAA0G,CAAC;YACtI,mGAAmG;YACnG,0GAA0G;YAC1G,0GAA0G;YAC1G,+FAA+F;YAC/F,OAAO;gBACL,OAAO,EAAE,SAAS;gBAClB,OAAO,EAAE;oBACP,IAAI,EAAE,YAAY;oBAClB,KAAK;oBACL,OAAO,EAAE,CAAC,EAAE,WAAW,EAAE,GAAG,CAAC,UAAU,EAAE,OAAO,EAAE,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,CAAC,KAAK,EAAE,GAAG,EAAE,CAAC,CAAC,GAAG,EAAE,CAAC,CAAC,EAAE,CAAC;oBACzG,eAAe,EAAE,CAAC,IAAI,CAAC,GAAG,EAAE,GAAG,SAAS,CAAC,GAAG,IAAI;oBAChD,WAAW,EAAE,CAAC;iBACf;aACF,CAAC;QACJ,CAAC;KACF,CAAC;AACJ,CAAC"}
@@ -0,0 +1,88 @@
1
+ /**
2
+ * 审计[485]③ / 深挖 G4 — the `EnterWorktree` / `ExitWorktree` tool pair: SESSION-level git-worktree
3
+ * isolation (CC 2.1.198 parity). EnterWorktree creates a managed worktree under `.sema-worktrees/`
4
+ * (the same {@link WORKTREE_PARENT} the subagent `isolation:"worktree"` lane uses) and REALLY switches
5
+ * the task's working directory into it; ExitWorktree returns to the original directory and cleans up.
6
+ *
7
+ * CC-parity semantics (198 bundle, verbatim-checked):
8
+ * ① worktrees live in a managed parent dir inside the repo (CC: `.claude/worktrees/`; sema:
9
+ * `.sema-worktrees/`) — never scattered;
10
+ * ② baseRef is two-state: `"head"` = the current local HEAD (unpushed commits present), `"fresh"` =
11
+ * the default branch tip (CC: `origin/<default-branch>` for a clean tree);
12
+ * ③ a second CREATING EnterWorktree (`name`) while one is active is REFUSED ("Already in a worktree
13
+ * session" — CC errorCode 2); switching into an EXISTING worktree via `path` is allowed (深对比残差
14
+ * M22 RESOLVED, live-CC anchor 2026-07-09: the previous worktree is left on disk untouched, only the
15
+ * new one is tracked for exit-time cleanup, and a path-entered tree is NEVER removed by ExitWorktree);
16
+ * ④ ExitWorktree outside a session is an honest NO-OP (CC errorCode 1), and a worktree with
17
+ * uncommitted files or commits is NOT deleted by default (CC refuses `remove` without
18
+ * `discard_changes`; sema keeps it and reports the path — inspect/merge in userland);
19
+ * ⑤ outside a git repository CC delegates to WorktreeCreate/WorktreeRemove hooks — sema has no such
20
+ * shell extension point, so the tool says so honestly and refuses (no silent degrade).
21
+ *
22
+ * cwd architecture (the load-bearing conclusion): the task's working directory IS mutable state — the
23
+ * hands band shares one {@link CwdRef} (`handsCwdRef` in prepare-task): Bash runs every command in
24
+ * `cwdRef.current` (and `cd` moves it), Read/Edit/Write resolve relative paths against it, Monitor
25
+ * spawns there. EnterWorktree therefore performs a REAL switch by assigning `cwdRef.current`; the
26
+ * Runner's per-tool cwd read reports it as `workspace_changed`, same as an observed `cd`. Path
27
+ * containment is untouched: the worktree lives UNDER the task root, so resolveKey's canonical-within
28
+ * check still holds for every subsequent fs op.
29
+ *
30
+ * ⚠️ Containment ruling (codex 终审 1.255 F4, deliberate): entering a worktree is a **cwd switch, NOT a
31
+ * sandbox**. resolveKey's containment anchor stays the ORIGINAL task root — it is deliberately NOT
32
+ * re-anchored/tightened to the worktree dir, so `../../` from inside the worktree can still reach the
33
+ * rest of the repository (which is WITHIN the task root and was reachable before Enter too), while
34
+ * anything outside the task root stays fenced exactly as before. This matches CC 2.1.198 semantics
35
+ * (CC worktrees live beside the repo with no containment tightening either); tightening here would buy
36
+ * no security (Bash/`cd` already roam the root) and would break legitimate repo-relative access. The
37
+ * tool description + Enter reply state this honestly so the model never assumes isolation.
38
+ *
39
+ * Security posture: both tools only ever run `git` against the task root / managed worktree (no
40
+ * arbitrary command surface), but they create/delete on-disk state ⇒ effect:"write" (plan mode gates
41
+ * them like every other write tool; read-only hands never mount them — see prepare-task).
42
+ *
43
+ * Durability (codex 终审 1.255 F2): the active session lives in a SHARED, ALL-SERIALIZABLE
44
+ * {@link WorktreeSessionRef} owned by prepare-task (never a closure-only var, and no captured destroy
45
+ * closure — Exit re-derives removal as a plain `git worktree remove`). A durable suspend stamps it into
46
+ * `CheckpointState.activeWorktree` (+ the cwd into `handsCwd`); resume re-seeds both, so
47
+ * Enter→suspend→resume→Exit behaves exactly like an unsuspended session.
48
+ */
49
+ import type { AgentTool, ExecutionEnv } from "../internal/harness.js";
50
+ import type { CwdRef } from "./fs/index.js";
51
+ /** codex 终审 1.255 F2 — the ACTIVE worktree session, ALL-SERIALIZABLE (plain strings, no closures):
52
+ * prepare-task owns the ref, stamps `current` into `CheckpointState.activeWorktree` at a durable
53
+ * suspend, and re-seeds it on resume, so ExitWorktree works across the suspend/resume boundary (the
54
+ * tree survives on disk; removal is re-derived as a plain `git worktree remove`). */
55
+ export interface ActiveWorktreeSession {
56
+ worktreeDir: string;
57
+ originalCwd: string;
58
+ baseSha: string;
59
+ /** M22 (live-CC anchor): true when the session ENTERED a pre-existing worktree via `path` instead of
60
+ * creating one — ExitWorktree then never removes it ("ExitWorktree will not remove a worktree entered
61
+ * this way"). Absent/false = created by EnterWorktree (removable per the normal rules). */
62
+ entered?: boolean;
63
+ }
64
+ /** The shared mutable holder for {@link ActiveWorktreeSession} — the worktree twin of {@link CwdRef}. */
65
+ export interface WorktreeSessionRef {
66
+ current?: ActiveWorktreeSession;
67
+ }
68
+ export interface WorktreeToolsOptions {
69
+ /** The task root (the repo root the managed worktrees nest under; `git` runs `-C` here). */
70
+ repoRoot: string;
71
+ /** The task's shared mutable working directory (the hands band's `handsCwdRef`) — EnterWorktree
72
+ * assigns it to the worktree path (a REAL cwd switch: Bash/Read/Edit/Write/Monitor all follow),
73
+ * ExitWorktree restores it. */
74
+ cwdRef: CwdRef;
75
+ /** codex 终审 1.255 F2: the shared session-state ref (checkpointable — prepare-task serializes it into
76
+ * the durable checkpoint and re-seeds it on resume). Omitted ⇒ a private per-mount ref (same live
77
+ * behavior, minus durable-suspend survival — prepare-task always passes one). */
78
+ session?: WorktreeSessionRef;
79
+ }
80
+ /**
81
+ * Build the EnterWorktree/ExitWorktree pair. One session-state closure per mount (= per task): the
82
+ * active worktree handle lives here, never in a model argument. Mounted by prepare-task only when the
83
+ * task has real write hands over a tracked cwd (`handsCwdRef` exists — same premise family as the
84
+ * Monitor mount); git-ness is probed honestly at Enter time (same posture as the subagent
85
+ * worktree-isolation helper — no per-task prepare-time git exec).
86
+ */
87
+ export declare function createWorktreeTools(env: ExecutionEnv, opts: WorktreeToolsOptions): AgentTool[];
88
+ //# sourceMappingURL=worktree.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"worktree.d.ts","sourceRoot":"","sources":["../../src/tools/worktree.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+CG;AAIH,OAAO,KAAK,EAAE,SAAS,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AAGtE,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AAE5C;;;sFAGsF;AACtF,MAAM,WAAW,qBAAqB;IACpC,WAAW,EAAE,MAAM,CAAC;IACpB,WAAW,EAAE,MAAM,CAAC;IACpB,OAAO,EAAE,MAAM,CAAC;IAChB;;gGAE4F;IAC5F,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;AAED,yGAAyG;AACzG,MAAM,WAAW,kBAAkB;IACjC,OAAO,CAAC,EAAE,qBAAqB,CAAC;CACjC;AAED,MAAM,WAAW,oBAAoB;IACnC,4FAA4F;IAC5F,QAAQ,EAAE,MAAM,CAAC;IACjB;;oCAEgC;IAChC,MAAM,EAAE,MAAM,CAAC;IACf;;sFAEkF;IAClF,OAAO,CAAC,EAAE,kBAAkB,CAAC;CAC9B;AAiID;;;;;;GAMG;AACH,wBAAgB,mBAAmB,CAAC,GAAG,EAAE,YAAY,EAAE,IAAI,EAAE,oBAAoB,GAAG,SAAS,EAAE,CAqS9F"}
@@ -0,0 +1,434 @@
1
+ /**
2
+ * 审计[485]③ / 深挖 G4 — the `EnterWorktree` / `ExitWorktree` tool pair: SESSION-level git-worktree
3
+ * isolation (CC 2.1.198 parity). EnterWorktree creates a managed worktree under `.sema-worktrees/`
4
+ * (the same {@link WORKTREE_PARENT} the subagent `isolation:"worktree"` lane uses) and REALLY switches
5
+ * the task's working directory into it; ExitWorktree returns to the original directory and cleans up.
6
+ *
7
+ * CC-parity semantics (198 bundle, verbatim-checked):
8
+ * ① worktrees live in a managed parent dir inside the repo (CC: `.claude/worktrees/`; sema:
9
+ * `.sema-worktrees/`) — never scattered;
10
+ * ② baseRef is two-state: `"head"` = the current local HEAD (unpushed commits present), `"fresh"` =
11
+ * the default branch tip (CC: `origin/<default-branch>` for a clean tree);
12
+ * ③ a second CREATING EnterWorktree (`name`) while one is active is REFUSED ("Already in a worktree
13
+ * session" — CC errorCode 2); switching into an EXISTING worktree via `path` is allowed (深对比残差
14
+ * M22 RESOLVED, live-CC anchor 2026-07-09: the previous worktree is left on disk untouched, only the
15
+ * new one is tracked for exit-time cleanup, and a path-entered tree is NEVER removed by ExitWorktree);
16
+ * ④ ExitWorktree outside a session is an honest NO-OP (CC errorCode 1), and a worktree with
17
+ * uncommitted files or commits is NOT deleted by default (CC refuses `remove` without
18
+ * `discard_changes`; sema keeps it and reports the path — inspect/merge in userland);
19
+ * ⑤ outside a git repository CC delegates to WorktreeCreate/WorktreeRemove hooks — sema has no such
20
+ * shell extension point, so the tool says so honestly and refuses (no silent degrade).
21
+ *
22
+ * cwd architecture (the load-bearing conclusion): the task's working directory IS mutable state — the
23
+ * hands band shares one {@link CwdRef} (`handsCwdRef` in prepare-task): Bash runs every command in
24
+ * `cwdRef.current` (and `cd` moves it), Read/Edit/Write resolve relative paths against it, Monitor
25
+ * spawns there. EnterWorktree therefore performs a REAL switch by assigning `cwdRef.current`; the
26
+ * Runner's per-tool cwd read reports it as `workspace_changed`, same as an observed `cd`. Path
27
+ * containment is untouched: the worktree lives UNDER the task root, so resolveKey's canonical-within
28
+ * check still holds for every subsequent fs op.
29
+ *
30
+ * ⚠️ Containment ruling (codex 终审 1.255 F4, deliberate): entering a worktree is a **cwd switch, NOT a
31
+ * sandbox**. resolveKey's containment anchor stays the ORIGINAL task root — it is deliberately NOT
32
+ * re-anchored/tightened to the worktree dir, so `../../` from inside the worktree can still reach the
33
+ * rest of the repository (which is WITHIN the task root and was reachable before Enter too), while
34
+ * anything outside the task root stays fenced exactly as before. This matches CC 2.1.198 semantics
35
+ * (CC worktrees live beside the repo with no containment tightening either); tightening here would buy
36
+ * no security (Bash/`cd` already roam the root) and would break legitimate repo-relative access. The
37
+ * tool description + Enter reply state this honestly so the model never assumes isolation.
38
+ *
39
+ * Security posture: both tools only ever run `git` against the task root / managed worktree (no
40
+ * arbitrary command surface), but they create/delete on-disk state ⇒ effect:"write" (plan mode gates
41
+ * them like every other write tool; read-only hands never mount them — see prepare-task).
42
+ *
43
+ * Durability (codex 终审 1.255 F2): the active session lives in a SHARED, ALL-SERIALIZABLE
44
+ * {@link WorktreeSessionRef} owned by prepare-task (never a closure-only var, and no captured destroy
45
+ * closure — Exit re-derives removal as a plain `git worktree remove`). A durable suspend stamps it into
46
+ * `CheckpointState.activeWorktree` (+ the cwd into `handsCwd`); resume re-seeds both, so
47
+ * Enter→suspend→resume→Exit behaves exactly like an unsuspended session.
48
+ */
49
+ import { resolve } from "node:path";
50
+ import { Type } from "typebox";
51
+ import { defineTool } from "../core/tools.js";
52
+ import { addWorktree, pruneWorktrees, WORKTREE_PARENT } from "../core/git-worktree-env.js";
53
+ // CC198 verbatim skeleton (cc-probe-198 tools-array, clay 2026-07-08 全面对齐判决): opening + When to Use /
54
+ // When NOT to Use (deep-diff M21: the "fix a bug / feature work → normal git workflow" bullet — the easiest
55
+ // mis-trigger — is restored verbatim). CC's "CLAUDE.md / memory" opt-in sources translate to sema's "project
56
+ // instructions". Sema deltas kept as trailing bullets, each for a reason:
57
+ // · 深对比残差 M22 RESOLVED (2026-07-09 live-CC probe, docs/cc-probe-198/live-schema-monitor-worktree-2026-07-09.json):
58
+ // `path` entry into an EXISTING registered worktree is now implemented (mutually exclusive with `name`;
59
+ // must appear in `git worktree list`; switch-while-in-session allowed with the previous tree left
60
+ // untouched; a path-entered tree is never removed by ExitWorktree). sema tightening: the target must
61
+ // also live UNDER the task root (containment stays anchored there — an outside-root worktree would
62
+ // strand every fs op, so it is refused honestly rather than half-working);
63
+ // · default baseRef is "head" here (CC defaults fresh) — sema truth, stated honestly;
64
+ // · cwd-switch-not-a-sandbox ruling (codex 终审 1.255 F4) — sema containment honesty, test-pinned;
65
+ // · no VCS-agnostic hook fallback (CC delegates to WorktreeCreate/WorktreeRemove hooks; sema has no shell
66
+ // extension point — refuses honestly).
67
+ const ENTER_DESCRIPTION = "Use this tool ONLY when explicitly instructed to work in a worktree — either by the user directly, or by " +
68
+ "project instructions. This tool creates an isolated git worktree and switches the current session into it.\n" +
69
+ "\n" +
70
+ "## When to Use\n" +
71
+ "\n" +
72
+ '- The user explicitly says "worktree" (e.g., "start a worktree", "work in a worktree", "create a worktree", "use a worktree")\n' +
73
+ "- Project instructions direct you to work in a worktree for the current task\n" +
74
+ "\n" +
75
+ "## When NOT to Use\n" +
76
+ "\n" +
77
+ "- The user asks to create a branch, switch branches, or work on a different branch — use git commands instead\n" +
78
+ "- The user asks to fix a bug or work on a feature — use normal git workflow unless worktrees are explicitly " +
79
+ "requested by the user or project instructions\n" +
80
+ '- Never use this tool unless "worktree" is explicitly mentioned by the user or in project instructions\n' +
81
+ "\n" +
82
+ "## Behavior\n" +
83
+ "\n" +
84
+ `- Creates a detached worktree under \`${WORKTREE_PARENT}/\` in the repository root and switches the ` +
85
+ "session's working directory to it: subsequent Bash commands run there, and relative paths in " +
86
+ "Read/Edit/Write resolve against it.\n" +
87
+ '- `baseRef` picks the starting point: `"head"` (default) starts from the current local HEAD (unpushed ' +
88
+ 'commits and current branch state present); `"fresh"` starts from the default branch tip ' +
89
+ "(origin's default branch when a remote exists, else local main/master).\n" +
90
+ "- Only one worktree session is tracked at a time: creating a NEW worktree (`name`) while one is active " +
91
+ "is refused — use ExitWorktree first (the unchanged worktree is removed; a changed one is kept and its " +
92
+ "path reported).\n" +
93
+ "- Pass `path` instead of `name` to switch the session into a worktree of this repository that already " +
94
+ "exists (it must appear in `git worktree list` and live under the task root). Switching with `path` also " +
95
+ "works while already in a worktree session — the previous worktree is left on disk, untouched, and only " +
96
+ "the new one is tracked for exit-time cleanup. ExitWorktree will not remove a worktree entered via `path`.\n" +
97
+ "- This is a working-directory switch, NOT a sandbox: file-access containment stays anchored at the " +
98
+ "original task root (the worktree lives under it), so paths outside the worktree but inside the task " +
99
+ "root remain reachable — do not rely on the worktree as an isolation boundary.\n" +
100
+ "- Requires a git repository — there is no VCS-agnostic fallback in this deployment.";
101
+ // CC198 verbatim skeleton (cc-probe-198 tools-array, clay 2026-07-08 全面对齐判决): opening + Scope block
102
+ // (the three NOT-touch bullets + no-op sentence) + "Restores the session's working directory" + "Once exited,
103
+ // EnterWorktree can be called again".
104
+ // 深对比残差 M19 RESOLVED (2026-07-09 live-CC probe, docs/cc-probe-198/live-schema-monitor-worktree-2026-07-09.json):
105
+ // live CC confirms `action` required enum[keep|remove] + `discard_changes` ("Required true when action is
106
+ // \"remove\" and the worktree has uncommitted files or unmerged commits. The tool will refuse and list them
107
+ // otherwise."). sema keeps its own shape (`keep?` + keep-changed-by-default) — the default KEPT reply IS the
108
+ // CC refuse-and-list step (it lists the changes and names the discard escape) — and adds `discardChanges?`
109
+ // as the second-invocation confirmation gate: only `discardChanges: true` force-removes a changed tree.
110
+ // Still NOT ported, with reasons:
111
+ // · CC `action` required enum — sema's `keep?`/default split carries the same three outcomes without a
112
+ // BREAKING param rename for durable replay;
113
+ // · CC "Do NOT call this proactively — only when the user asks" — CC is interactive-only; a sema autonomous
114
+ // run must exit the worktree itself when its task is done (EnterPlanMode-family recorded inversion);
115
+ // · tmux line — N/A (no tmux integration).
116
+ const EXIT_DESCRIPTION = "Exit a worktree session created by EnterWorktree and return the session to the original working directory.\n" +
117
+ "\n" +
118
+ "## Scope\n" +
119
+ "\n" +
120
+ "This tool ONLY operates on worktrees created by EnterWorktree in this session. It will NOT touch:\n" +
121
+ "- Worktrees you created manually with `git worktree add`\n" +
122
+ "- Worktrees from a previous session (even if created by EnterWorktree then)\n" +
123
+ "- The directory you're in if EnterWorktree was never called\n" +
124
+ "\n" +
125
+ "If called outside an EnterWorktree session, the tool is a no-op: it reports that no worktree session is " +
126
+ "active and takes no action. Filesystem state is unchanged.\n" +
127
+ "\n" +
128
+ "## Behavior\n" +
129
+ "\n" +
130
+ "- Restores the session's working directory to where it was before EnterWorktree.\n" +
131
+ "- Default: if the worktree has NO changes (clean `git status`, no new commits), it is removed and " +
132
+ "pruned; if it HAS uncommitted files or new commits, it is KEPT on disk and its path reported so the " +
133
+ "work can be inspected or merged — nothing is discarded.\n" +
134
+ "- A worktree entered via EnterWorktree `path` (not created by it) is NEVER removed — exit only restores " +
135
+ "the working directory.\n" +
136
+ "- `keep: true` always keeps the worktree on disk, changed or not.\n" +
137
+ "- `discardChanges: true` removes the worktree even when it HAS uncommitted files or new commits — they " +
138
+ "are permanently discarded. Only set this when the work is confirmed disposable (a throwaway experiment, " +
139
+ "or the user asked to discard it); it cannot be combined with `keep: true`.\n" +
140
+ "- Once exited, EnterWorktree can be called again to create a fresh worktree.";
141
+ /** Resolve the base commit for `baseRef`. Returns the commit sha plus an honest `note` when a `fresh`
142
+ * request had to fall back (no remote default / no local main|master → HEAD). */
143
+ async function resolveBaseCommit(env, repoRoot, baseRef) {
144
+ const rev = async (ref) => {
145
+ const r = await env.exec(`git rev-parse --verify --quiet ${ref}^{commit}`, { cwd: repoRoot });
146
+ return r.ok && r.value.exitCode === 0 ? r.value.stdout.trim() : undefined;
147
+ };
148
+ if (baseRef === "head") {
149
+ const sha = await rev("HEAD");
150
+ return sha ? { sha, label: "HEAD" } : { error: "cannot resolve HEAD (empty repository with no commits?)" };
151
+ }
152
+ // fresh: CC branches from origin/<default-branch>. Resolution chain: origin/HEAD symbolic-ref →
153
+ // local main → local master → HEAD (with an honest note — no silent reinterpretation).
154
+ const sym = await env.exec("git symbolic-ref --quiet refs/remotes/origin/HEAD", { cwd: repoRoot });
155
+ if (sym.ok && sym.value.exitCode === 0) {
156
+ const branch = sym.value.stdout.trim().replace(/^refs\/remotes\//, "");
157
+ if (branch) {
158
+ const sha = await rev(branch);
159
+ if (sha)
160
+ return { sha, label: branch };
161
+ }
162
+ }
163
+ for (const candidate of ["main", "master"]) {
164
+ const sha = await rev(candidate);
165
+ if (sha)
166
+ return { sha, label: candidate };
167
+ }
168
+ const sha = await rev("HEAD");
169
+ return sha
170
+ ? { sha, label: "HEAD", note: " (no remote default branch or local main/master found — fell back to HEAD)" }
171
+ : { error: "cannot resolve a fresh base (no default branch and no HEAD)" };
172
+ }
173
+ /**
174
+ * Build the EnterWorktree/ExitWorktree pair. One session-state closure per mount (= per task): the
175
+ * active worktree handle lives here, never in a model argument. Mounted by prepare-task only when the
176
+ * task has real write hands over a tracked cwd (`handsCwdRef` exists — same premise family as the
177
+ * Monitor mount); git-ness is probed honestly at Enter time (same posture as the subagent
178
+ * worktree-isolation helper — no per-task prepare-time git exec).
179
+ */
180
+ export function createWorktreeTools(env, opts) {
181
+ const { repoRoot, cwdRef } = opts;
182
+ // codex 终审 1.255 F2: the session state lives in the SHARED serializable ref (prepare-task checkpoints
183
+ // it), never a closure-only var — a resume re-mounts these tools around the SAME logical session. No
184
+ // destroy closure is kept: removal is re-derived at Exit as a plain `git worktree remove` (equivalent —
185
+ // the Enter-time rootEnvAt masks any base destroy, so addWorktree's destroy was exactly that command).
186
+ const session = opts.session ?? {};
187
+ const shq = (s) => `'${s.replace(/'/g, "'\\''")}'`;
188
+ const enter = defineTool({
189
+ name: "EnterWorktree",
190
+ description: ENTER_DESCRIPTION,
191
+ parameters: Type.Object({
192
+ name: Type.Optional(Type.String({
193
+ description: "Optional name for the new worktree (letters, digits, dots, underscores, dashes; other characters are sanitized). A random suffix is always appended. Generated if not provided. Mutually exclusive with `path`.",
194
+ })),
195
+ // M22 (live-CC anchor verbatim shape): path entry into an existing registered worktree.
196
+ path: Type.Optional(Type.String({
197
+ description: "Path to an existing worktree of the current repository to switch into instead of creating a new one. Must appear in `git worktree list` for the current repo (and live under the task root). Mutually exclusive with `name`.",
198
+ })),
199
+ baseRef: Type.Optional(Type.Union([Type.Literal("fresh"), Type.Literal("head")], {
200
+ description: '"head" (default) bases the worktree on the current local HEAD; "fresh" bases it on the default branch tip (origin default branch, else local main/master).',
201
+ })),
202
+ }),
203
+ effect: "write", // creates on-disk state (worktree dir + git metadata) — plan mode gates it
204
+ execute: async (args) => {
205
+ const { name, path, baseRef } = args;
206
+ // M22 (live-CC anchor): `name` and `path` are mutually exclusive; `baseRef` only applies to creation.
207
+ if (path !== undefined && name !== undefined) {
208
+ return "Error (EnterWorktree): `name` and `path` are mutually exclusive — `path` enters an existing worktree, `name` creates a new one.";
209
+ }
210
+ if (path !== undefined && baseRef !== undefined) {
211
+ return "Error (EnterWorktree): `baseRef` only applies when creating a new worktree — an existing worktree entered via `path` keeps whatever state it has.";
212
+ }
213
+ if (session.current && path === undefined) {
214
+ // CC parity (errorCode 2): only one worktree session at a time for CREATION; a `path` switch into
215
+ // another existing worktree is allowed (handled below — M22, live-CC anchor).
216
+ return (`Error (EnterWorktree): already in a worktree session (${session.current.worktreeDir}). ` +
217
+ "Use ExitWorktree to leave it before creating a new worktree, or pass `path` to switch into an " +
218
+ "existing worktree of this repository.");
219
+ }
220
+ // Honest precondition (same probe as the subagent isolation lane): a non-repo root yields a clear
221
+ // refusal — CC would delegate to WorktreeCreate/WorktreeRemove hooks here; sema has no shell
222
+ // extension point, so we say so instead of pretending.
223
+ const probe = await env.exec("git rev-parse --is-inside-work-tree", { cwd: repoRoot });
224
+ if (!probe.ok || probe.value.exitCode !== 0) {
225
+ const detail = probe.ok ? (probe.value.stderr || probe.value.stdout).trim().split("\n")[0] : String(probe.error);
226
+ return (`Error (EnterWorktree): the working directory ${repoRoot} is not a git repository` +
227
+ `${detail ? ` (${detail})` : ""}. This deployment has no VCS-agnostic worktree extension point, ` +
228
+ "so worktree isolation is unavailable here.");
229
+ }
230
+ if (path !== undefined) {
231
+ // ── M22: enter an EXISTING worktree (live-CC anchor: "The path must appear in `git worktree list`
232
+ // for the current repository — paths that are not registered worktrees of this repo are rejected.")
233
+ // Canonicalize via git itself (handles symlinked tmp dirs the same way `git worktree list` does);
234
+ // a relative `path` resolves against the session's tracked cwd, same as every other hands tool.
235
+ const candidate = resolve(cwdRef.current, path);
236
+ const top = await env.exec("git rev-parse --show-toplevel", { cwd: candidate });
237
+ if (!top.ok || top.value.exitCode !== 0) {
238
+ return `Error (EnterWorktree): ${candidate} is not an accessible git worktree (cannot resolve its top-level directory).`;
239
+ }
240
+ const target = top.value.stdout.trim();
241
+ const list = await env.exec("git worktree list --porcelain", { cwd: repoRoot });
242
+ if (!list.ok || list.value.exitCode !== 0) {
243
+ return "Error (EnterWorktree): could not read `git worktree list` for this repository.";
244
+ }
245
+ const registered = list.value.stdout
246
+ .split("\n")
247
+ .filter((l) => l.startsWith("worktree "))
248
+ .map((l) => l.slice("worktree ".length).trim());
249
+ if (!registered.includes(target)) {
250
+ return (`Error (EnterWorktree): ${target} is not a registered worktree of this repository ` +
251
+ "(it does not appear in `git worktree list`).");
252
+ }
253
+ if (target === registered[0]) {
254
+ // The first porcelain entry is the main working tree — "entering" it is not a worktree switch.
255
+ return `Error (EnterWorktree): ${target} is the main working tree, not a linked worktree — nothing to enter.`;
256
+ }
257
+ // sema containment tightening (recorded in the description): the task's fs containment stays
258
+ // anchored at the ORIGINAL task root, so a worktree OUTSIDE it would strand every subsequent
259
+ // Read/Edit/Write on the containment fence. Refuse honestly instead of half-working.
260
+ if (target !== repoRoot && !target.startsWith(repoRoot.endsWith("/") ? repoRoot : `${repoRoot}/`)) {
261
+ return (`Error (EnterWorktree): the worktree ${target} lives outside the task root ${repoRoot}; ` +
262
+ "file containment stays anchored at the task root, so it cannot be entered from this session.");
263
+ }
264
+ const head = await env.exec("git rev-parse HEAD", { cwd: target });
265
+ if (!head.ok || head.value.exitCode !== 0) {
266
+ return `Error (EnterWorktree): cannot resolve HEAD of the worktree ${target}.`;
267
+ }
268
+ // Live-CC anchor: switching while already in a worktree leaves the previous one on disk untouched —
269
+ // only the new one is tracked, and the ORIGINAL pre-worktree directory stays the exit target.
270
+ const previous = session.current;
271
+ const originalCwd = previous ? previous.originalCwd : cwdRef.current;
272
+ session.current = { worktreeDir: target, originalCwd, baseSha: head.value.stdout.trim(), entered: true };
273
+ cwdRef.current = target;
274
+ return (`Switched into the existing worktree at ${target}${previous ? ` (the previous worktree at ${previous.worktreeDir} was left on disk, untouched)` : ""}. ` +
275
+ "The session's working directory is now this worktree — subsequent commands and relative paths " +
276
+ "operate there. Note this is a cwd switch, not a sandbox: file containment stays anchored at the " +
277
+ "task root. ExitWorktree will restore the original directory but will NOT remove a worktree " +
278
+ "entered via `path`.");
279
+ }
280
+ const base = await resolveBaseCommit(env, repoRoot, baseRef ?? "head");
281
+ if ("error" in base)
282
+ return `Error (EnterWorktree): ${base.error}.`;
283
+ let createdDir;
284
+ try {
285
+ const { worktreeDir } = await addWorktree(env, {
286
+ repoRoot,
287
+ sessionId: name ?? "worktree",
288
+ commit: base.sha,
289
+ // The base env, re-rooted at the worktree with any base `destroy` MASKED — tearing the
290
+ // worktree down must never cascade into destroying the task's own env (subagent-helper
291
+ // precedent, verbatim posture). The returned env's destroy is NOT captured (1.255 F2:
292
+ // session state must stay serializable) — Exit re-derives the equivalent removal command.
293
+ rootEnvAt: (dir) => Object.create(env, {
294
+ cwd: { value: dir, configurable: true },
295
+ destroy: { value: undefined, writable: true, configurable: true },
296
+ }),
297
+ });
298
+ createdDir = worktreeDir;
299
+ }
300
+ catch (e) {
301
+ return `Error (EnterWorktree): ${e instanceof Error ? e.message : String(e)}`;
302
+ }
303
+ session.current = {
304
+ worktreeDir: createdDir,
305
+ originalCwd: cwdRef.current,
306
+ baseSha: base.sha,
307
+ };
308
+ // The REAL switch: the hands band's shared cwd now points at the worktree — Bash commands run
309
+ // there, relative Read/Edit/Write paths resolve there. The Runner observes this like a `cd`.
310
+ cwdRef.current = createdDir;
311
+ return (`Created worktree at ${createdDir} (base: ${base.label}${base.note ?? ""}). ` +
312
+ "The session's working directory is now the worktree — subsequent commands and relative paths " +
313
+ "operate there. Note this is a cwd switch, not a sandbox: file containment stays anchored at the " +
314
+ "task root, so the rest of the repository remains reachable. " +
315
+ "Use ExitWorktree to leave (an unchanged worktree is removed; a changed one is kept).");
316
+ },
317
+ });
318
+ const exit = defineTool({
319
+ name: "ExitWorktree",
320
+ description: EXIT_DESCRIPTION,
321
+ parameters: Type.Object({
322
+ keep: Type.Optional(Type.Boolean({
323
+ description: "true = always keep the worktree on disk. Default: keep only when it has uncommitted files or new commits; remove when unchanged.",
324
+ })),
325
+ // M19 (live-CC anchor: ExitWorktree `discard_changes` — "Required true when action is \"remove\" and the
326
+ // worktree has uncommitted files or unmerged commits. The tool will refuse and list them otherwise.").
327
+ discardChanges: Type.Optional(Type.Boolean({
328
+ description: "true = remove the worktree even when it has uncommitted files or new commits, permanently discarding them. Default false: a changed worktree is kept and its changes listed. Cannot be combined with `keep: true`.",
329
+ })),
330
+ }),
331
+ effect: "write", // may delete on-disk state — plan mode gates it
332
+ execute: async (args) => {
333
+ const { keep, discardChanges } = args;
334
+ if (keep === true && discardChanges === true) {
335
+ // Contradictory intent — refuse before touching any state (CC: discard_changes is only meaningful
336
+ // with action:"remove"; sema's `keep:true` IS the not-remove arm).
337
+ return "Error (ExitWorktree): `keep: true` and `discardChanges: true` contradict each other — pick one.";
338
+ }
339
+ if (!session.current) {
340
+ // CC parity (errorCode 1): honest no-op outside a session — never touches foreign worktrees.
341
+ return ("No-op: there is no active EnterWorktree session to exit. This tool only operates on the " +
342
+ "worktree created by EnterWorktree in this session; no filesystem changes were made.");
343
+ }
344
+ const active = session.current;
345
+ session.current = undefined;
346
+ // codex 终审 1.255 F5 (LOW): the original directory may have been deleted/moved while the session
347
+ // was active (or across a suspend/resume) — restoring the shared cwd to a dead path would strand
348
+ // every subsequent Bash/fs op on ENOENT. Verify it still exists; fall back to the task root with an
349
+ // honest note (never a silent switch to a broken cwd). A probe FAILURE (not a clean "false") keeps
350
+ // the original path — we don't degrade on flaky I/O, only on a verified absence.
351
+ let restoredTo = active.originalCwd;
352
+ let restoreNote = "";
353
+ const origThere = await env.exists(active.originalCwd);
354
+ if (origThere.ok && !origThere.value) {
355
+ restoredTo = repoRoot;
356
+ restoreNote = ` (the original directory ${active.originalCwd} no longer exists — fell back to the repository root)`;
357
+ }
358
+ cwdRef.current = restoredTo; // restore FIRST — the session must never stay pointed at a dir we may delete
359
+ // M22 (live-CC anchor: "ExitWorktree will not remove a worktree entered this way"): a path-entered
360
+ // worktree is NEVER removed — this session did not create it, so exit only restores the directory.
361
+ if (active.entered) {
362
+ const discardNote = discardChanges === true ? " (`discardChanges` does not apply to a worktree this session did not create)" : "";
363
+ return (`Exited the worktree session; working directory restored to ${restoredTo}${restoreNote}. ` +
364
+ `The worktree at ${active.worktreeDir} was entered via \`path\` (not created by this session) and ` +
365
+ `was left on disk, untouched${discardNote}.`);
366
+ }
367
+ // F5: the worktree itself may have been removed EXTERNALLY (rm -rf / another process) — an honest
368
+ // report, not a phantom "had no changes and was removed" (this session removed nothing). Prune the
369
+ // stale git metadata and say what actually happened. Probe failure falls through to the normal path
370
+ // (whose own probes fail SAFE to "changed/kept").
371
+ const wtThere = await env.exists(active.worktreeDir);
372
+ if (wtThere.ok && !wtThere.value) {
373
+ await pruneWorktrees(env, repoRoot).catch(() => undefined);
374
+ return (`Exited the worktree session; working directory restored to ${restoredTo}${restoreNote}. ` +
375
+ `The worktree at ${active.worktreeDir} was already gone from disk (removed externally, not by this ` +
376
+ "session — any uncommitted work in it is lost); stale git worktree metadata was pruned.");
377
+ }
378
+ // Changed = uncommitted files OR commits made on top of the base (CC counts both; a probe failure
379
+ // fails SAFE to "changed" — we never delete what we cannot verify, CC errorCode 3 posture).
380
+ let changed = true;
381
+ let changeDetail = "could not verify the worktree state — keeping it to be safe";
382
+ const status = await env.exec("git status --porcelain", { cwd: active.worktreeDir });
383
+ if (status.ok && status.value.exitCode === 0) {
384
+ const dirtyFiles = status.value.stdout.split("\n").filter((l) => l.trim() !== "").length;
385
+ const ahead = await env.exec(`git rev-list --count ${active.baseSha}..HEAD`, { cwd: active.worktreeDir });
386
+ const commits = ahead.ok && ahead.value.exitCode === 0 ? parseInt(ahead.value.stdout.trim(), 10) || 0 : -1;
387
+ if (commits >= 0) {
388
+ changed = dirtyFiles > 0 || commits > 0;
389
+ const parts = [];
390
+ if (dirtyFiles > 0)
391
+ parts.push(`${dirtyFiles} uncommitted ${dirtyFiles === 1 ? "file" : "files"}`);
392
+ if (commits > 0)
393
+ parts.push(`${commits} new ${commits === 1 ? "commit" : "commits"}`);
394
+ changeDetail = parts.join(" and ");
395
+ }
396
+ }
397
+ // M19 (live-CC `discard_changes` gate): a changed tree is removed ONLY under an explicit
398
+ // `discardChanges: true`. sema keeps its non-destructive default (KEPT + changes listed) instead of
399
+ // CC's refusal error — the session ends either way and nothing is lost, which is the same safety
400
+ // property the CC refuse-and-list step guarantees.
401
+ if (keep === true || (changed && discardChanges !== true)) {
402
+ const why = keep === true ? "keep was requested" : `it has ${changeDetail}`;
403
+ return (`Exited the worktree session; working directory restored to ${restoredTo}${restoreNote}. ` +
404
+ `The worktree was KEPT at ${active.worktreeDir} (${why}) — inspect or merge it there, and remove it ` +
405
+ "later with `git worktree remove` if no longer needed.");
406
+ }
407
+ // 1.255 F2: removal is a plain command against the base repo (equivalent to the addWorktree destroy —
408
+ // the Enter-time rootEnvAt masked any inner destroy). Works identically after a suspend/resume
409
+ // re-mount, where no live closure from the Enter leg exists. Best-effort; prune reaps orphans.
410
+ await env.exec(`git worktree remove --force ${shq(active.worktreeDir)}`, { cwd: repoRoot }).catch(() => undefined);
411
+ await pruneWorktrees(env, repoRoot).catch(() => undefined);
412
+ // F5: verify the removal actually happened — a failed `git worktree remove` (locked tree, fs error)
413
+ // must not be reported as removed (the session is still cleanly exited either way).
414
+ const stillThere = await env.exists(active.worktreeDir);
415
+ // M19: an honest per-outcome report — a discardChanges removal must SAY what it destroyed, never
416
+ // masquerade as the clean "had no changes" path. (An unverifiable tree can still be discarded — the
417
+ // explicit `discardChanges: true` accepted total loss — but the report says the truth about what
418
+ // was known, not the keep-path fallback phrasing.)
419
+ const detailForDiscard = changeDetail.startsWith("could not verify")
420
+ ? "changes that could not be enumerated"
421
+ : changeDetail;
422
+ const stateClause = changed ? `had ${detailForDiscard} (discarded — discardChanges was set)` : "had no changes";
423
+ if (stillThere.ok && stillThere.value) {
424
+ return (`Exited the worktree session; working directory restored to ${restoredTo}${restoreNote}. ` +
425
+ `The worktree at ${active.worktreeDir} ${changed ? "was marked for discard" : "had no changes"} but could NOT be removed — it is still on disk; ` +
426
+ "remove it manually with `git worktree remove --force` if no longer needed.");
427
+ }
428
+ return (`Exited the worktree session; working directory restored to ${restoredTo}${restoreNote}. ` +
429
+ `The worktree at ${active.worktreeDir} ${stateClause} and was removed.`);
430
+ },
431
+ });
432
+ return [enter, exit];
433
+ }
434
+ //# sourceMappingURL=worktree.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"worktree.js","sourceRoot":"","sources":["../../src/tools/worktree.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+CG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,IAAI,EAAE,MAAM,SAAS,CAAC;AAE/B,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC9C,OAAO,EAAE,WAAW,EAAE,cAAc,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAC;AAmC3F,sGAAsG;AACtG,4GAA4G;AAC5G,6GAA6G;AAC7G,0EAA0E;AAC1E,oHAAoH;AACpH,2GAA2G;AAC3G,qGAAqG;AACrG,wGAAwG;AACxG,sGAAsG;AACtG,8EAA8E;AAC9E,uFAAuF;AACvF,kGAAkG;AAClG,2GAA2G;AAC3G,0CAA0C;AAC1C,MAAM,iBAAiB,GACrB,2GAA2G;IAC3G,8GAA8G;IAC9G,IAAI;IACJ,kBAAkB;IAClB,IAAI;IACJ,iIAAiI;IACjI,gFAAgF;IAChF,IAAI;IACJ,sBAAsB;IACtB,IAAI;IACJ,iHAAiH;IACjH,8GAA8G;IAC9G,iDAAiD;IACjD,0GAA0G;IAC1G,IAAI;IACJ,eAAe;IACf,IAAI;IACJ,yCAAyC,eAAe,8CAA8C;IACtG,+FAA+F;IAC/F,uCAAuC;IACvC,wGAAwG;IACxG,0FAA0F;IAC1F,2EAA2E;IAC3E,yGAAyG;IACzG,wGAAwG;IACxG,mBAAmB;IACnB,wGAAwG;IACxG,0GAA0G;IAC1G,yGAAyG;IACzG,6GAA6G;IAC7G,qGAAqG;IACrG,sGAAsG;IACtG,iFAAiF;IACjF,qFAAqF,CAAC;AAExF,oGAAoG;AACpG,8GAA8G;AAC9G,sCAAsC;AACtC,iHAAiH;AACjH,0GAA0G;AAC1G,4GAA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