synorch 0.2.0 → 0.4.0-beta.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (1137) hide show
  1. package/CHANGELOG.md +55 -1
  2. package/README.md +338 -28
  3. package/dist/application/doctor-service.d.ts +16 -0
  4. package/dist/application/doctor-service.d.ts.map +1 -1
  5. package/dist/application/doctor-service.js +230 -32
  6. package/dist/application/doctor-service.js.map +1 -1
  7. package/dist/application/generated-skill-doctor.d.ts +9 -0
  8. package/dist/application/generated-skill-doctor.d.ts.map +1 -0
  9. package/dist/application/generated-skill-doctor.js +433 -0
  10. package/dist/application/generated-skill-doctor.js.map +1 -0
  11. package/dist/application/project-discovery.d.ts +26 -1
  12. package/dist/application/project-discovery.d.ts.map +1 -1
  13. package/dist/application/project-discovery.js +99 -6
  14. package/dist/application/project-discovery.js.map +1 -1
  15. package/dist/application/safe-path.d.ts +19 -0
  16. package/dist/application/safe-path.d.ts.map +1 -0
  17. package/dist/application/safe-path.js +35 -0
  18. package/dist/application/safe-path.js.map +1 -0
  19. package/dist/application/size-ceiling.d.ts +15 -0
  20. package/dist/application/size-ceiling.d.ts.map +1 -0
  21. package/dist/application/size-ceiling.js +32 -0
  22. package/dist/application/size-ceiling.js.map +1 -0
  23. package/dist/application/structure-service.d.ts.map +1 -1
  24. package/dist/application/structure-service.js +10 -1
  25. package/dist/application/structure-service.js.map +1 -1
  26. package/dist/build-info.json +4 -0
  27. package/dist/cli.js +135 -18
  28. package/dist/cli.js.map +1 -1
  29. package/dist/domain/canonical-contracts.d.ts +69 -0
  30. package/dist/domain/canonical-contracts.d.ts.map +1 -0
  31. package/dist/domain/canonical-contracts.js +92 -0
  32. package/dist/domain/canonical-contracts.js.map +1 -0
  33. package/dist/domain/generated-skill.d.ts +55 -0
  34. package/dist/domain/generated-skill.d.ts.map +1 -0
  35. package/dist/domain/generated-skill.js +90 -0
  36. package/dist/domain/generated-skill.js.map +1 -0
  37. package/dist/domain/generation.d.ts +15 -2
  38. package/dist/domain/generation.d.ts.map +1 -1
  39. package/dist/domain/observation-ledger.d.ts +118 -0
  40. package/dist/domain/observation-ledger.d.ts.map +1 -0
  41. package/dist/domain/observation-ledger.js +183 -0
  42. package/dist/domain/observation-ledger.js.map +1 -0
  43. package/dist/domain/product.d.ts +1 -1
  44. package/dist/domain/product.d.ts.map +1 -1
  45. package/dist/domain/product.js +1 -1
  46. package/dist/domain/product.js.map +1 -1
  47. package/dist/domain/relative-path.d.ts +21 -0
  48. package/dist/domain/relative-path.d.ts.map +1 -0
  49. package/dist/domain/relative-path.js +43 -0
  50. package/dist/domain/relative-path.js.map +1 -0
  51. package/dist/domain/skill-packs.d.ts.map +1 -1
  52. package/dist/domain/skill-packs.js +1 -0
  53. package/dist/domain/skill-packs.js.map +1 -1
  54. package/dist/domain/suggest.d.ts +5 -0
  55. package/dist/domain/suggest.d.ts.map +1 -0
  56. package/dist/domain/suggest.js +32 -0
  57. package/dist/domain/suggest.js.map +1 -0
  58. package/dist/domain/zod-issues.d.ts +21 -0
  59. package/dist/domain/zod-issues.d.ts.map +1 -0
  60. package/dist/domain/zod-issues.js +27 -0
  61. package/dist/domain/zod-issues.js.map +1 -0
  62. package/dist/harness/auth/api-key.d.ts +13 -0
  63. package/dist/harness/auth/api-key.d.ts.map +1 -0
  64. package/dist/harness/auth/api-key.js +87 -0
  65. package/dist/harness/auth/api-key.js.map +1 -0
  66. package/dist/harness/auth/claude-bridge.d.ts +22 -0
  67. package/dist/harness/auth/claude-bridge.d.ts.map +1 -0
  68. package/dist/harness/auth/claude-bridge.js +92 -0
  69. package/dist/harness/auth/claude-bridge.js.map +1 -0
  70. package/dist/harness/auth/command.d.ts +17 -0
  71. package/dist/harness/auth/command.d.ts.map +1 -0
  72. package/dist/harness/auth/command.js +223 -0
  73. package/dist/harness/auth/command.js.map +1 -0
  74. package/dist/harness/auth/credential-store.d.ts +30 -0
  75. package/dist/harness/auth/credential-store.d.ts.map +1 -0
  76. package/dist/harness/auth/credential-store.js +270 -0
  77. package/dist/harness/auth/credential-store.js.map +1 -0
  78. package/dist/harness/auth/index.d.ts +13 -0
  79. package/dist/harness/auth/index.d.ts.map +1 -0
  80. package/dist/harness/auth/index.js +10 -0
  81. package/dist/harness/auth/index.js.map +1 -0
  82. package/dist/harness/auth/json-file.d.ts +8 -0
  83. package/dist/harness/auth/json-file.d.ts.map +1 -0
  84. package/dist/harness/auth/json-file.js +57 -0
  85. package/dist/harness/auth/json-file.js.map +1 -0
  86. package/dist/harness/auth/jwt.d.ts +11 -0
  87. package/dist/harness/auth/jwt.d.ts.map +1 -0
  88. package/dist/harness/auth/jwt.js +37 -0
  89. package/dist/harness/auth/jwt.js.map +1 -0
  90. package/dist/harness/auth/keychain.d.ts +39 -0
  91. package/dist/harness/auth/keychain.d.ts.map +1 -0
  92. package/dist/harness/auth/keychain.js +191 -0
  93. package/dist/harness/auth/keychain.js.map +1 -0
  94. package/dist/harness/auth/locks.d.ts +19 -0
  95. package/dist/harness/auth/locks.d.ts.map +1 -0
  96. package/dist/harness/auth/locks.js +102 -0
  97. package/dist/harness/auth/locks.js.map +1 -0
  98. package/dist/harness/auth/notices.d.ts +6 -0
  99. package/dist/harness/auth/notices.d.ts.map +1 -0
  100. package/dist/harness/auth/notices.js +29 -0
  101. package/dist/harness/auth/notices.js.map +1 -0
  102. package/dist/harness/auth/openai-chatgpt.d.ts +32 -0
  103. package/dist/harness/auth/openai-chatgpt.d.ts.map +1 -0
  104. package/dist/harness/auth/openai-chatgpt.js +446 -0
  105. package/dist/harness/auth/openai-chatgpt.js.map +1 -0
  106. package/dist/harness/auth/profile-state.d.ts +25 -0
  107. package/dist/harness/auth/profile-state.d.ts.map +1 -0
  108. package/dist/harness/auth/profile-state.js +77 -0
  109. package/dist/harness/auth/profile-state.js.map +1 -0
  110. package/dist/harness/auth/providers.d.ts +27 -0
  111. package/dist/harness/auth/providers.d.ts.map +1 -0
  112. package/dist/harness/auth/providers.js +66 -0
  113. package/dist/harness/auth/providers.js.map +1 -0
  114. package/dist/harness/auth/resolved-credential.d.ts +11 -0
  115. package/dist/harness/auth/resolved-credential.d.ts.map +1 -0
  116. package/dist/harness/auth/resolved-credential.js +35 -0
  117. package/dist/harness/auth/resolved-credential.js.map +1 -0
  118. package/dist/harness/cli/appearance.d.ts +28 -0
  119. package/dist/harness/cli/appearance.d.ts.map +1 -0
  120. package/dist/harness/cli/appearance.js +123 -0
  121. package/dist/harness/cli/appearance.js.map +1 -0
  122. package/dist/harness/cli/args.d.ts +429 -0
  123. package/dist/harness/cli/args.d.ts.map +1 -0
  124. package/dist/harness/cli/args.js +372 -0
  125. package/dist/harness/cli/args.js.map +1 -0
  126. package/dist/harness/cli/attachments.d.ts +44 -0
  127. package/dist/harness/cli/attachments.d.ts.map +1 -0
  128. package/dist/harness/cli/attachments.js +176 -0
  129. package/dist/harness/cli/attachments.js.map +1 -0
  130. package/dist/harness/cli/canonical.d.ts +64 -0
  131. package/dist/harness/cli/canonical.d.ts.map +1 -0
  132. package/dist/harness/cli/canonical.js +455 -0
  133. package/dist/harness/cli/canonical.js.map +1 -0
  134. package/dist/harness/cli/claude-native-approvals.d.ts +45 -0
  135. package/dist/harness/cli/claude-native-approvals.d.ts.map +1 -0
  136. package/dist/harness/cli/claude-native-approvals.js +183 -0
  137. package/dist/harness/cli/claude-native-approvals.js.map +1 -0
  138. package/dist/harness/cli/command-grants.d.ts +23 -0
  139. package/dist/harness/cli/command-grants.d.ts.map +1 -0
  140. package/dist/harness/cli/command-grants.js +76 -0
  141. package/dist/harness/cli/command-grants.js.map +1 -0
  142. package/dist/harness/cli/config-command.d.ts +98 -0
  143. package/dist/harness/cli/config-command.d.ts.map +1 -0
  144. package/dist/harness/cli/config-command.js +561 -0
  145. package/dist/harness/cli/config-command.js.map +1 -0
  146. package/dist/harness/cli/config.d.ts +429 -0
  147. package/dist/harness/cli/config.d.ts.map +1 -0
  148. package/dist/harness/cli/config.js +504 -0
  149. package/dist/harness/cli/config.js.map +1 -0
  150. package/dist/harness/cli/conversation.d.ts +35 -0
  151. package/dist/harness/cli/conversation.d.ts.map +1 -0
  152. package/dist/harness/cli/conversation.js +3755 -0
  153. package/dist/harness/cli/conversation.js.map +1 -0
  154. package/dist/harness/cli/doctor.d.ts +32 -0
  155. package/dist/harness/cli/doctor.d.ts.map +1 -0
  156. package/dist/harness/cli/doctor.js +329 -0
  157. package/dist/harness/cli/doctor.js.map +1 -0
  158. package/dist/harness/cli/effort-command.d.ts +41 -0
  159. package/dist/harness/cli/effort-command.d.ts.map +1 -0
  160. package/dist/harness/cli/effort-command.js +133 -0
  161. package/dist/harness/cli/effort-command.js.map +1 -0
  162. package/dist/harness/cli/extensions/agents.d.ts +40 -0
  163. package/dist/harness/cli/extensions/agents.d.ts.map +1 -0
  164. package/dist/harness/cli/extensions/agents.js +66 -0
  165. package/dist/harness/cli/extensions/agents.js.map +1 -0
  166. package/dist/harness/cli/extensions/catalog.d.ts +134 -0
  167. package/dist/harness/cli/extensions/catalog.d.ts.map +1 -0
  168. package/dist/harness/cli/extensions/catalog.js +213 -0
  169. package/dist/harness/cli/extensions/catalog.js.map +1 -0
  170. package/dist/harness/cli/extensions/claude-home.d.ts +33 -0
  171. package/dist/harness/cli/extensions/claude-home.d.ts.map +1 -0
  172. package/dist/harness/cli/extensions/claude-home.js +78 -0
  173. package/dist/harness/cli/extensions/claude-home.js.map +1 -0
  174. package/dist/harness/cli/extensions/controller.d.ts +51 -0
  175. package/dist/harness/cli/extensions/controller.d.ts.map +1 -0
  176. package/dist/harness/cli/extensions/controller.js +67 -0
  177. package/dist/harness/cli/extensions/controller.js.map +1 -0
  178. package/dist/harness/cli/extensions/hooks.d.ts +164 -0
  179. package/dist/harness/cli/extensions/hooks.d.ts.map +1 -0
  180. package/dist/harness/cli/extensions/hooks.js +442 -0
  181. package/dist/harness/cli/extensions/hooks.js.map +1 -0
  182. package/dist/harness/cli/extensions/index.d.ts +10 -0
  183. package/dist/harness/cli/extensions/index.d.ts.map +1 -0
  184. package/dist/harness/cli/extensions/index.js +10 -0
  185. package/dist/harness/cli/extensions/index.js.map +1 -0
  186. package/dist/harness/cli/extensions/markdown.d.ts +46 -0
  187. package/dist/harness/cli/extensions/markdown.d.ts.map +1 -0
  188. package/dist/harness/cli/extensions/markdown.js +139 -0
  189. package/dist/harness/cli/extensions/markdown.js.map +1 -0
  190. package/dist/harness/cli/extensions/plugins.d.ts +160 -0
  191. package/dist/harness/cli/extensions/plugins.d.ts.map +1 -0
  192. package/dist/harness/cli/extensions/plugins.js +645 -0
  193. package/dist/harness/cli/extensions/plugins.js.map +1 -0
  194. package/dist/harness/cli/extensions/tool-hooks.d.ts +28 -0
  195. package/dist/harness/cli/extensions/tool-hooks.d.ts.map +1 -0
  196. package/dist/harness/cli/extensions/tool-hooks.js +63 -0
  197. package/dist/harness/cli/extensions/tool-hooks.js.map +1 -0
  198. package/dist/harness/cli/extensions-command.d.ts +64 -0
  199. package/dist/harness/cli/extensions-command.d.ts.map +1 -0
  200. package/dist/harness/cli/extensions-command.js +639 -0
  201. package/dist/harness/cli/extensions-command.js.map +1 -0
  202. package/dist/harness/cli/help.d.ts +9 -0
  203. package/dist/harness/cli/help.d.ts.map +1 -0
  204. package/dist/harness/cli/help.js +191 -0
  205. package/dist/harness/cli/help.js.map +1 -0
  206. package/dist/harness/cli/index.d.ts +52 -0
  207. package/dist/harness/cli/index.d.ts.map +1 -0
  208. package/dist/harness/cli/index.js +297 -0
  209. package/dist/harness/cli/index.js.map +1 -0
  210. package/dist/harness/cli/inspect.d.ts +40 -0
  211. package/dist/harness/cli/inspect.d.ts.map +1 -0
  212. package/dist/harness/cli/inspect.js +185 -0
  213. package/dist/harness/cli/inspect.js.map +1 -0
  214. package/dist/harness/cli/mcp-command.d.ts +61 -0
  215. package/dist/harness/cli/mcp-command.d.ts.map +1 -0
  216. package/dist/harness/cli/mcp-command.js +519 -0
  217. package/dist/harness/cli/mcp-command.js.map +1 -0
  218. package/dist/harness/cli/memory-desk.d.ts +28 -0
  219. package/dist/harness/cli/memory-desk.d.ts.map +1 -0
  220. package/dist/harness/cli/memory-desk.js +275 -0
  221. package/dist/harness/cli/memory-desk.js.map +1 -0
  222. package/dist/harness/cli/model-picker.d.ts +44 -0
  223. package/dist/harness/cli/model-picker.d.ts.map +1 -0
  224. package/dist/harness/cli/model-picker.js +267 -0
  225. package/dist/harness/cli/model-picker.js.map +1 -0
  226. package/dist/harness/cli/onboarding.d.ts +29 -0
  227. package/dist/harness/cli/onboarding.d.ts.map +1 -0
  228. package/dist/harness/cli/onboarding.js +101 -0
  229. package/dist/harness/cli/onboarding.js.map +1 -0
  230. package/dist/harness/cli/orchestrate-tool.d.ts +60 -0
  231. package/dist/harness/cli/orchestrate-tool.d.ts.map +1 -0
  232. package/dist/harness/cli/orchestrate-tool.js +167 -0
  233. package/dist/harness/cli/orchestrate-tool.js.map +1 -0
  234. package/dist/harness/cli/orchestration-view.d.ts +57 -0
  235. package/dist/harness/cli/orchestration-view.d.ts.map +1 -0
  236. package/dist/harness/cli/orchestration-view.js +371 -0
  237. package/dist/harness/cli/orchestration-view.js.map +1 -0
  238. package/dist/harness/cli/outcome.d.ts +11 -0
  239. package/dist/harness/cli/outcome.d.ts.map +1 -0
  240. package/dist/harness/cli/outcome.js +70 -0
  241. package/dist/harness/cli/outcome.js.map +1 -0
  242. package/dist/harness/cli/panels/common.d.ts +30 -0
  243. package/dist/harness/cli/panels/common.d.ts.map +1 -0
  244. package/dist/harness/cli/panels/common.js +143 -0
  245. package/dist/harness/cli/panels/common.js.map +1 -0
  246. package/dist/harness/cli/panels/mcp.d.ts +18 -0
  247. package/dist/harness/cli/panels/mcp.d.ts.map +1 -0
  248. package/dist/harness/cli/panels/mcp.js +132 -0
  249. package/dist/harness/cli/panels/mcp.js.map +1 -0
  250. package/dist/harness/cli/panels/plugins.d.ts +8 -0
  251. package/dist/harness/cli/panels/plugins.d.ts.map +1 -0
  252. package/dist/harness/cli/panels/plugins.js +114 -0
  253. package/dist/harness/cli/panels/plugins.js.map +1 -0
  254. package/dist/harness/cli/panels/session.d.ts +54 -0
  255. package/dist/harness/cli/panels/session.d.ts.map +1 -0
  256. package/dist/harness/cli/panels/session.js +221 -0
  257. package/dist/harness/cli/panels/session.js.map +1 -0
  258. package/dist/harness/cli/panels/skills.d.ts +16 -0
  259. package/dist/harness/cli/panels/skills.d.ts.map +1 -0
  260. package/dist/harness/cli/panels/skills.js +146 -0
  261. package/dist/harness/cli/panels/skills.js.map +1 -0
  262. package/dist/harness/cli/project-profile.d.ts +87 -0
  263. package/dist/harness/cli/project-profile.d.ts.map +1 -0
  264. package/dist/harness/cli/project-profile.js +709 -0
  265. package/dist/harness/cli/project-profile.js.map +1 -0
  266. package/dist/harness/cli/project-scope.d.ts +2 -0
  267. package/dist/harness/cli/project-scope.d.ts.map +1 -0
  268. package/dist/harness/cli/project-scope.js +55 -0
  269. package/dist/harness/cli/project-scope.js.map +1 -0
  270. package/dist/harness/cli/renderers.d.ts +75 -0
  271. package/dist/harness/cli/renderers.d.ts.map +1 -0
  272. package/dist/harness/cli/renderers.js +162 -0
  273. package/dist/harness/cli/renderers.js.map +1 -0
  274. package/dist/harness/cli/rewind.d.ts +54 -0
  275. package/dist/harness/cli/rewind.d.ts.map +1 -0
  276. package/dist/harness/cli/rewind.js +80 -0
  277. package/dist/harness/cli/rewind.js.map +1 -0
  278. package/dist/harness/cli/role-policy.d.ts +8 -0
  279. package/dist/harness/cli/role-policy.d.ts.map +1 -0
  280. package/dist/harness/cli/role-policy.js +53 -0
  281. package/dist/harness/cli/role-policy.js.map +1 -0
  282. package/dist/harness/cli/run-summary.d.ts +16 -0
  283. package/dist/harness/cli/run-summary.d.ts.map +1 -0
  284. package/dist/harness/cli/run-summary.js +105 -0
  285. package/dist/harness/cli/run-summary.js.map +1 -0
  286. package/dist/harness/cli/runtime.d.ts +182 -0
  287. package/dist/harness/cli/runtime.d.ts.map +1 -0
  288. package/dist/harness/cli/runtime.js +999 -0
  289. package/dist/harness/cli/runtime.js.map +1 -0
  290. package/dist/harness/cli/scripted-script.d.ts +50 -0
  291. package/dist/harness/cli/scripted-script.d.ts.map +1 -0
  292. package/dist/harness/cli/scripted-script.js +110 -0
  293. package/dist/harness/cli/scripted-script.js.map +1 -0
  294. package/dist/harness/cli/session-git.d.ts +76 -0
  295. package/dist/harness/cli/session-git.d.ts.map +1 -0
  296. package/dist/harness/cli/session-git.js +146 -0
  297. package/dist/harness/cli/session-git.js.map +1 -0
  298. package/dist/harness/cli/session.d.ts +22 -0
  299. package/dist/harness/cli/session.d.ts.map +1 -0
  300. package/dist/harness/cli/session.js +203 -0
  301. package/dist/harness/cli/session.js.map +1 -0
  302. package/dist/harness/cli/slash-commands.d.ts +85 -0
  303. package/dist/harness/cli/slash-commands.d.ts.map +1 -0
  304. package/dist/harness/cli/slash-commands.js +114 -0
  305. package/dist/harness/cli/slash-commands.js.map +1 -0
  306. package/dist/harness/cli/startup-notices.d.ts +32 -0
  307. package/dist/harness/cli/startup-notices.d.ts.map +1 -0
  308. package/dist/harness/cli/startup-notices.js +93 -0
  309. package/dist/harness/cli/startup-notices.js.map +1 -0
  310. package/dist/harness/cli/terminal.d.ts +32 -0
  311. package/dist/harness/cli/terminal.d.ts.map +1 -0
  312. package/dist/harness/cli/terminal.js +21 -0
  313. package/dist/harness/cli/terminal.js.map +1 -0
  314. package/dist/harness/cli/transparency.d.ts +39 -0
  315. package/dist/harness/cli/transparency.d.ts.map +1 -0
  316. package/dist/harness/cli/transparency.js +491 -0
  317. package/dist/harness/cli/transparency.js.map +1 -0
  318. package/dist/harness/cli/trust.d.ts +40 -0
  319. package/dist/harness/cli/trust.d.ts.map +1 -0
  320. package/dist/harness/cli/trust.js +133 -0
  321. package/dist/harness/cli/trust.js.map +1 -0
  322. package/dist/harness/cli/usage-stats.d.ts +57 -0
  323. package/dist/harness/cli/usage-stats.d.ts.map +1 -0
  324. package/dist/harness/cli/usage-stats.js +341 -0
  325. package/dist/harness/cli/usage-stats.js.map +1 -0
  326. package/dist/harness/context/compaction.d.ts +69 -0
  327. package/dist/harness/context/compaction.d.ts.map +1 -0
  328. package/dist/harness/context/compaction.js +149 -0
  329. package/dist/harness/context/compaction.js.map +1 -0
  330. package/dist/harness/context/context-builder.d.ts +76 -0
  331. package/dist/harness/context/context-builder.d.ts.map +1 -0
  332. package/dist/harness/context/context-builder.js +367 -0
  333. package/dist/harness/context/context-builder.js.map +1 -0
  334. package/dist/harness/context/history.d.ts +31 -0
  335. package/dist/harness/context/history.d.ts.map +1 -0
  336. package/dist/harness/context/history.js +105 -0
  337. package/dist/harness/context/history.js.map +1 -0
  338. package/dist/harness/context/index.d.ts +11 -0
  339. package/dist/harness/context/index.d.ts.map +1 -0
  340. package/dist/harness/context/index.js +9 -0
  341. package/dist/harness/context/index.js.map +1 -0
  342. package/dist/harness/context/instructions.d.ts +30 -0
  343. package/dist/harness/context/instructions.d.ts.map +1 -0
  344. package/dist/harness/context/instructions.js +82 -0
  345. package/dist/harness/context/instructions.js.map +1 -0
  346. package/dist/harness/context/model-view.d.ts +46 -0
  347. package/dist/harness/context/model-view.d.ts.map +1 -0
  348. package/dist/harness/context/model-view.js +136 -0
  349. package/dist/harness/context/model-view.js.map +1 -0
  350. package/dist/harness/context/scope.d.ts +9 -0
  351. package/dist/harness/context/scope.d.ts.map +1 -0
  352. package/dist/harness/context/scope.js +50 -0
  353. package/dist/harness/context/scope.js.map +1 -0
  354. package/dist/harness/context/skills.d.ts +75 -0
  355. package/dist/harness/context/skills.d.ts.map +1 -0
  356. package/dist/harness/context/skills.js +109 -0
  357. package/dist/harness/context/skills.js.map +1 -0
  358. package/dist/harness/context/tokens.d.ts +10 -0
  359. package/dist/harness/context/tokens.d.ts.map +1 -0
  360. package/dist/harness/context/tokens.js +39 -0
  361. package/dist/harness/context/tokens.js.map +1 -0
  362. package/dist/harness/contracts/auth.d.ts +214 -0
  363. package/dist/harness/contracts/auth.d.ts.map +1 -0
  364. package/dist/harness/contracts/auth.js +120 -0
  365. package/dist/harness/contracts/auth.js.map +1 -0
  366. package/dist/harness/contracts/choice.d.ts +115 -0
  367. package/dist/harness/contracts/choice.d.ts.map +1 -0
  368. package/dist/harness/contracts/choice.js +115 -0
  369. package/dist/harness/contracts/choice.js.map +1 -0
  370. package/dist/harness/contracts/common.d.ts +119 -0
  371. package/dist/harness/contracts/common.d.ts.map +1 -0
  372. package/dist/harness/contracts/common.js +66 -0
  373. package/dist/harness/contracts/common.js.map +1 -0
  374. package/dist/harness/contracts/digest.d.ts +59 -0
  375. package/dist/harness/contracts/digest.d.ts.map +1 -0
  376. package/dist/harness/contracts/digest.js +88 -0
  377. package/dist/harness/contracts/digest.js.map +1 -0
  378. package/dist/harness/contracts/errors.d.ts +70 -0
  379. package/dist/harness/contracts/errors.d.ts.map +1 -0
  380. package/dist/harness/contracts/errors.js +87 -0
  381. package/dist/harness/contracts/errors.js.map +1 -0
  382. package/dist/harness/contracts/events.d.ts +3094 -0
  383. package/dist/harness/contracts/events.d.ts.map +1 -0
  384. package/dist/harness/contracts/events.js +426 -0
  385. package/dist/harness/contracts/events.js.map +1 -0
  386. package/dist/harness/contracts/evidence.d.ts +286 -0
  387. package/dist/harness/contracts/evidence.d.ts.map +1 -0
  388. package/dist/harness/contracts/evidence.js +234 -0
  389. package/dist/harness/contracts/evidence.js.map +1 -0
  390. package/dist/harness/contracts/ids.d.ts +77 -0
  391. package/dist/harness/contracts/ids.d.ts.map +1 -0
  392. package/dist/harness/contracts/ids.js +126 -0
  393. package/dist/harness/contracts/ids.js.map +1 -0
  394. package/dist/harness/contracts/index.d.ts +23 -0
  395. package/dist/harness/contracts/index.d.ts.map +1 -0
  396. package/dist/harness/contracts/index.js +23 -0
  397. package/dist/harness/contracts/index.js.map +1 -0
  398. package/dist/harness/contracts/jsonl.d.ts +3386 -0
  399. package/dist/harness/contracts/jsonl.d.ts.map +1 -0
  400. package/dist/harness/contracts/jsonl.js +87 -0
  401. package/dist/harness/contracts/jsonl.js.map +1 -0
  402. package/dist/harness/contracts/memory.d.ts +271 -0
  403. package/dist/harness/contracts/memory.d.ts.map +1 -0
  404. package/dist/harness/contracts/memory.js +152 -0
  405. package/dist/harness/contracts/memory.js.map +1 -0
  406. package/dist/harness/contracts/model.d.ts +1201 -0
  407. package/dist/harness/contracts/model.d.ts.map +1 -0
  408. package/dist/harness/contracts/model.js +386 -0
  409. package/dist/harness/contracts/model.js.map +1 -0
  410. package/dist/harness/contracts/packets.d.ts +945 -0
  411. package/dist/harness/contracts/packets.d.ts.map +1 -0
  412. package/dist/harness/contracts/packets.js +535 -0
  413. package/dist/harness/contracts/packets.js.map +1 -0
  414. package/dist/harness/contracts/panel.d.ts +140 -0
  415. package/dist/harness/contracts/panel.d.ts.map +1 -0
  416. package/dist/harness/contracts/panel.js +19 -0
  417. package/dist/harness/contracts/panel.js.map +1 -0
  418. package/dist/harness/contracts/paths.d.ts +58 -0
  419. package/dist/harness/contracts/paths.d.ts.map +1 -0
  420. package/dist/harness/contracts/paths.js +204 -0
  421. package/dist/harness/contracts/paths.js.map +1 -0
  422. package/dist/harness/contracts/policy.d.ts +459 -0
  423. package/dist/harness/contracts/policy.d.ts.map +1 -0
  424. package/dist/harness/contracts/policy.js +338 -0
  425. package/dist/harness/contracts/policy.js.map +1 -0
  426. package/dist/harness/contracts/projection.d.ts +111 -0
  427. package/dist/harness/contracts/projection.d.ts.map +1 -0
  428. package/dist/harness/contracts/projection.js +2 -0
  429. package/dist/harness/contracts/projection.js.map +1 -0
  430. package/dist/harness/contracts/renderer.d.ts +291 -0
  431. package/dist/harness/contracts/renderer.d.ts.map +1 -0
  432. package/dist/harness/contracts/renderer.js +36 -0
  433. package/dist/harness/contracts/renderer.js.map +1 -0
  434. package/dist/harness/contracts/roles.d.ts +28 -0
  435. package/dist/harness/contracts/roles.d.ts.map +1 -0
  436. package/dist/harness/contracts/roles.js +36 -0
  437. package/dist/harness/contracts/roles.js.map +1 -0
  438. package/dist/harness/contracts/runtime.d.ts +283 -0
  439. package/dist/harness/contracts/runtime.d.ts.map +1 -0
  440. package/dist/harness/contracts/runtime.js +13 -0
  441. package/dist/harness/contracts/runtime.js.map +1 -0
  442. package/dist/harness/contracts/state.d.ts +124 -0
  443. package/dist/harness/contracts/state.d.ts.map +1 -0
  444. package/dist/harness/contracts/state.js +172 -0
  445. package/dist/harness/contracts/state.js.map +1 -0
  446. package/dist/harness/contracts/store.d.ts +117 -0
  447. package/dist/harness/contracts/store.d.ts.map +1 -0
  448. package/dist/harness/contracts/store.js +54 -0
  449. package/dist/harness/contracts/store.js.map +1 -0
  450. package/dist/harness/contracts/tools.d.ts +296 -0
  451. package/dist/harness/contracts/tools.d.ts.map +1 -0
  452. package/dist/harness/contracts/tools.js +117 -0
  453. package/dist/harness/contracts/tools.js.map +1 -0
  454. package/dist/harness/contracts/views.d.ts +468 -0
  455. package/dist/harness/contracts/views.d.ts.map +1 -0
  456. package/dist/harness/contracts/views.js +2 -0
  457. package/dist/harness/contracts/views.js.map +1 -0
  458. package/dist/harness/core/driver.d.ts +53 -0
  459. package/dist/harness/core/driver.d.ts.map +1 -0
  460. package/dist/harness/core/driver.js +566 -0
  461. package/dist/harness/core/driver.js.map +1 -0
  462. package/dist/harness/core/envelope.d.ts +11 -0
  463. package/dist/harness/core/envelope.d.ts.map +1 -0
  464. package/dist/harness/core/envelope.js +35 -0
  465. package/dist/harness/core/envelope.js.map +1 -0
  466. package/dist/harness/core/index.d.ts +7 -0
  467. package/dist/harness/core/index.d.ts.map +1 -0
  468. package/dist/harness/core/index.js +5 -0
  469. package/dist/harness/core/index.js.map +1 -0
  470. package/dist/harness/core/projection.d.ts +10 -0
  471. package/dist/harness/core/projection.d.ts.map +1 -0
  472. package/dist/harness/core/projection.js +268 -0
  473. package/dist/harness/core/projection.js.map +1 -0
  474. package/dist/harness/core/recovery.d.ts +14 -0
  475. package/dist/harness/core/recovery.d.ts.map +1 -0
  476. package/dist/harness/core/recovery.js +115 -0
  477. package/dist/harness/core/recovery.js.map +1 -0
  478. package/dist/harness/core/stream.d.ts +23 -0
  479. package/dist/harness/core/stream.d.ts.map +1 -0
  480. package/dist/harness/core/stream.js +102 -0
  481. package/dist/harness/core/stream.js.map +1 -0
  482. package/dist/harness/core/testing.d.ts +80 -0
  483. package/dist/harness/core/testing.d.ts.map +1 -0
  484. package/dist/harness/core/testing.js +258 -0
  485. package/dist/harness/core/testing.js.map +1 -0
  486. package/dist/harness/mcp/approvals.d.ts +14 -0
  487. package/dist/harness/mcp/approvals.d.ts.map +1 -0
  488. package/dist/harness/mcp/approvals.js +60 -0
  489. package/dist/harness/mcp/approvals.js.map +1 -0
  490. package/dist/harness/mcp/client.d.ts +74 -0
  491. package/dist/harness/mcp/client.d.ts.map +1 -0
  492. package/dist/harness/mcp/client.js +214 -0
  493. package/dist/harness/mcp/client.js.map +1 -0
  494. package/dist/harness/mcp/config.d.ts +156 -0
  495. package/dist/harness/mcp/config.d.ts.map +1 -0
  496. package/dist/harness/mcp/config.js +180 -0
  497. package/dist/harness/mcp/config.js.map +1 -0
  498. package/dist/harness/mcp/errors.d.ts +24 -0
  499. package/dist/harness/mcp/errors.d.ts.map +1 -0
  500. package/dist/harness/mcp/errors.js +67 -0
  501. package/dist/harness/mcp/errors.js.map +1 -0
  502. package/dist/harness/mcp/index.d.ts +9 -0
  503. package/dist/harness/mcp/index.d.ts.map +1 -0
  504. package/dist/harness/mcp/index.js +9 -0
  505. package/dist/harness/mcp/index.js.map +1 -0
  506. package/dist/harness/mcp/manager.d.ts +115 -0
  507. package/dist/harness/mcp/manager.d.ts.map +1 -0
  508. package/dist/harness/mcp/manager.js +361 -0
  509. package/dist/harness/mcp/manager.js.map +1 -0
  510. package/dist/harness/mcp/oauth.d.ts +54 -0
  511. package/dist/harness/mcp/oauth.d.ts.map +1 -0
  512. package/dist/harness/mcp/oauth.js +253 -0
  513. package/dist/harness/mcp/oauth.js.map +1 -0
  514. package/dist/harness/mcp/tools.d.ts +24 -0
  515. package/dist/harness/mcp/tools.d.ts.map +1 -0
  516. package/dist/harness/mcp/tools.js +142 -0
  517. package/dist/harness/mcp/tools.js.map +1 -0
  518. package/dist/harness/memory/bootstrap.d.ts +55 -0
  519. package/dist/harness/memory/bootstrap.d.ts.map +1 -0
  520. package/dist/harness/memory/bootstrap.js +124 -0
  521. package/dist/harness/memory/bootstrap.js.map +1 -0
  522. package/dist/harness/memory/desk.d.ts +74 -0
  523. package/dist/harness/memory/desk.d.ts.map +1 -0
  524. package/dist/harness/memory/desk.js +211 -0
  525. package/dist/harness/memory/desk.js.map +1 -0
  526. package/dist/harness/memory/graph.d.ts +24 -0
  527. package/dist/harness/memory/graph.d.ts.map +1 -0
  528. package/dist/harness/memory/graph.js +92 -0
  529. package/dist/harness/memory/graph.js.map +1 -0
  530. package/dist/harness/memory/index.d.ts +12 -0
  531. package/dist/harness/memory/index.d.ts.map +1 -0
  532. package/dist/harness/memory/index.js +10 -0
  533. package/dist/harness/memory/index.js.map +1 -0
  534. package/dist/harness/memory/markdown-memory-store.d.ts +122 -0
  535. package/dist/harness/memory/markdown-memory-store.d.ts.map +1 -0
  536. package/dist/harness/memory/markdown-memory-store.js +419 -0
  537. package/dist/harness/memory/markdown-memory-store.js.map +1 -0
  538. package/dist/harness/memory/memory-command.d.ts +22 -0
  539. package/dist/harness/memory/memory-command.d.ts.map +1 -0
  540. package/dist/harness/memory/memory-command.js +335 -0
  541. package/dist/harness/memory/memory-command.js.map +1 -0
  542. package/dist/harness/memory/memory-index.d.ts +71 -0
  543. package/dist/harness/memory/memory-index.d.ts.map +1 -0
  544. package/dist/harness/memory/memory-index.js +206 -0
  545. package/dist/harness/memory/memory-index.js.map +1 -0
  546. package/dist/harness/memory/note-format.d.ts +20 -0
  547. package/dist/harness/memory/note-format.d.ts.map +1 -0
  548. package/dist/harness/memory/note-format.js +69 -0
  549. package/dist/harness/memory/note-format.js.map +1 -0
  550. package/dist/harness/memory/obsidian.d.ts +14 -0
  551. package/dist/harness/memory/obsidian.d.ts.map +1 -0
  552. package/dist/harness/memory/obsidian.js +64 -0
  553. package/dist/harness/memory/obsidian.js.map +1 -0
  554. package/dist/harness/memory/redaction.d.ts +15 -0
  555. package/dist/harness/memory/redaction.d.ts.map +1 -0
  556. package/dist/harness/memory/redaction.js +64 -0
  557. package/dist/harness/memory/redaction.js.map +1 -0
  558. package/dist/harness/memory/relations.d.ts +29 -0
  559. package/dist/harness/memory/relations.d.ts.map +1 -0
  560. package/dist/harness/memory/relations.js +117 -0
  561. package/dist/harness/memory/relations.js.map +1 -0
  562. package/dist/harness/memory/vault.d.ts +35 -0
  563. package/dist/harness/memory/vault.d.ts.map +1 -0
  564. package/dist/harness/memory/vault.js +194 -0
  565. package/dist/harness/memory/vault.js.map +1 -0
  566. package/dist/harness/orchestration/approval.d.ts +29 -0
  567. package/dist/harness/orchestration/approval.d.ts.map +1 -0
  568. package/dist/harness/orchestration/approval.js +86 -0
  569. package/dist/harness/orchestration/approval.js.map +1 -0
  570. package/dist/harness/orchestration/artifact-review.d.ts +219 -0
  571. package/dist/harness/orchestration/artifact-review.d.ts.map +1 -0
  572. package/dist/harness/orchestration/artifact-review.js +319 -0
  573. package/dist/harness/orchestration/artifact-review.js.map +1 -0
  574. package/dist/harness/orchestration/attempt-log.d.ts +53 -0
  575. package/dist/harness/orchestration/attempt-log.d.ts.map +1 -0
  576. package/dist/harness/orchestration/attempt-log.js +138 -0
  577. package/dist/harness/orchestration/attempt-log.js.map +1 -0
  578. package/dist/harness/orchestration/budget.d.ts +110 -0
  579. package/dist/harness/orchestration/budget.d.ts.map +1 -0
  580. package/dist/harness/orchestration/budget.js +197 -0
  581. package/dist/harness/orchestration/budget.js.map +1 -0
  582. package/dist/harness/orchestration/capabilities.d.ts +6 -0
  583. package/dist/harness/orchestration/capabilities.d.ts.map +1 -0
  584. package/dist/harness/orchestration/capabilities.js +80 -0
  585. package/dist/harness/orchestration/capabilities.js.map +1 -0
  586. package/dist/harness/orchestration/claims.d.ts +148 -0
  587. package/dist/harness/orchestration/claims.d.ts.map +1 -0
  588. package/dist/harness/orchestration/claims.js +64 -0
  589. package/dist/harness/orchestration/claims.js.map +1 -0
  590. package/dist/harness/orchestration/control-plane.d.ts +18 -0
  591. package/dist/harness/orchestration/control-plane.d.ts.map +1 -0
  592. package/dist/harness/orchestration/control-plane.js +74 -0
  593. package/dist/harness/orchestration/control-plane.js.map +1 -0
  594. package/dist/harness/orchestration/coordinator.d.ts +132 -0
  595. package/dist/harness/orchestration/coordinator.d.ts.map +1 -0
  596. package/dist/harness/orchestration/coordinator.js +1628 -0
  597. package/dist/harness/orchestration/coordinator.js.map +1 -0
  598. package/dist/harness/orchestration/delegation.d.ts +80 -0
  599. package/dist/harness/orchestration/delegation.d.ts.map +1 -0
  600. package/dist/harness/orchestration/delegation.js +81 -0
  601. package/dist/harness/orchestration/delegation.js.map +1 -0
  602. package/dist/harness/orchestration/evidence.d.ts +124 -0
  603. package/dist/harness/orchestration/evidence.d.ts.map +1 -0
  604. package/dist/harness/orchestration/evidence.js +576 -0
  605. package/dist/harness/orchestration/evidence.js.map +1 -0
  606. package/dist/harness/orchestration/factories.d.ts +13 -0
  607. package/dist/harness/orchestration/factories.d.ts.map +1 -0
  608. package/dist/harness/orchestration/factories.js +20 -0
  609. package/dist/harness/orchestration/factories.js.map +1 -0
  610. package/dist/harness/orchestration/git.d.ts +77 -0
  611. package/dist/harness/orchestration/git.d.ts.map +1 -0
  612. package/dist/harness/orchestration/git.js +214 -0
  613. package/dist/harness/orchestration/git.js.map +1 -0
  614. package/dist/harness/orchestration/index.d.ts +25 -0
  615. package/dist/harness/orchestration/index.d.ts.map +1 -0
  616. package/dist/harness/orchestration/index.js +23 -0
  617. package/dist/harness/orchestration/index.js.map +1 -0
  618. package/dist/harness/orchestration/isolation.d.ts +181 -0
  619. package/dist/harness/orchestration/isolation.d.ts.map +1 -0
  620. package/dist/harness/orchestration/isolation.js +1357 -0
  621. package/dist/harness/orchestration/isolation.js.map +1 -0
  622. package/dist/harness/orchestration/paths.d.ts +18 -0
  623. package/dist/harness/orchestration/paths.d.ts.map +1 -0
  624. package/dist/harness/orchestration/paths.js +56 -0
  625. package/dist/harness/orchestration/paths.js.map +1 -0
  626. package/dist/harness/orchestration/plan.d.ts +219 -0
  627. package/dist/harness/orchestration/plan.d.ts.map +1 -0
  628. package/dist/harness/orchestration/plan.js +537 -0
  629. package/dist/harness/orchestration/plan.js.map +1 -0
  630. package/dist/harness/orchestration/planner.d.ts +137 -0
  631. package/dist/harness/orchestration/planner.d.ts.map +1 -0
  632. package/dist/harness/orchestration/planner.js +162 -0
  633. package/dist/harness/orchestration/planner.js.map +1 -0
  634. package/dist/harness/orchestration/recorder.d.ts +23 -0
  635. package/dist/harness/orchestration/recorder.d.ts.map +1 -0
  636. package/dist/harness/orchestration/recorder.js +50 -0
  637. package/dist/harness/orchestration/recorder.js.map +1 -0
  638. package/dist/harness/orchestration/scheduler.d.ts +40 -0
  639. package/dist/harness/orchestration/scheduler.d.ts.map +1 -0
  640. package/dist/harness/orchestration/scheduler.js +157 -0
  641. package/dist/harness/orchestration/scheduler.js.map +1 -0
  642. package/dist/harness/orchestration/testing.d.ts +233 -0
  643. package/dist/harness/orchestration/testing.d.ts.map +1 -0
  644. package/dist/harness/orchestration/testing.js +734 -0
  645. package/dist/harness/orchestration/testing.js.map +1 -0
  646. package/dist/harness/orchestration/verification-preflight.d.ts +46 -0
  647. package/dist/harness/orchestration/verification-preflight.d.ts.map +1 -0
  648. package/dist/harness/orchestration/verification-preflight.js +104 -0
  649. package/dist/harness/orchestration/verification-preflight.js.map +1 -0
  650. package/dist/harness/orchestration/worker-control.d.ts +64 -0
  651. package/dist/harness/orchestration/worker-control.d.ts.map +1 -0
  652. package/dist/harness/orchestration/worker-control.js +199 -0
  653. package/dist/harness/orchestration/worker-control.js.map +1 -0
  654. package/dist/harness/orchestration/worker-manager.d.ts +225 -0
  655. package/dist/harness/orchestration/worker-manager.d.ts.map +1 -0
  656. package/dist/harness/orchestration/worker-manager.js +1347 -0
  657. package/dist/harness/orchestration/worker-manager.js.map +1 -0
  658. package/dist/harness/orchestration/workspace-digest.d.ts +39 -0
  659. package/dist/harness/orchestration/workspace-digest.d.ts.map +1 -0
  660. package/dist/harness/orchestration/workspace-digest.js +147 -0
  661. package/dist/harness/orchestration/workspace-digest.js.map +1 -0
  662. package/dist/harness/policy/approval-broker.d.ts +13 -0
  663. package/dist/harness/policy/approval-broker.d.ts.map +1 -0
  664. package/dist/harness/policy/approval-broker.js +26 -0
  665. package/dist/harness/policy/approval-broker.js.map +1 -0
  666. package/dist/harness/policy/command-classifier.d.ts +29 -0
  667. package/dist/harness/policy/command-classifier.d.ts.map +1 -0
  668. package/dist/harness/policy/command-classifier.js +459 -0
  669. package/dist/harness/policy/command-classifier.js.map +1 -0
  670. package/dist/harness/policy/command-rules.d.ts +56 -0
  671. package/dist/harness/policy/command-rules.d.ts.map +1 -0
  672. package/dist/harness/policy/command-rules.js +588 -0
  673. package/dist/harness/policy/command-rules.js.map +1 -0
  674. package/dist/harness/policy/config.d.ts +27 -0
  675. package/dist/harness/policy/config.d.ts.map +1 -0
  676. package/dist/harness/policy/config.js +37 -0
  677. package/dist/harness/policy/config.js.map +1 -0
  678. package/dist/harness/policy/engine.d.ts +67 -0
  679. package/dist/harness/policy/engine.d.ts.map +1 -0
  680. package/dist/harness/policy/engine.js +483 -0
  681. package/dist/harness/policy/engine.js.map +1 -0
  682. package/dist/harness/policy/exec-allowlist.d.ts +66 -0
  683. package/dist/harness/policy/exec-allowlist.d.ts.map +1 -0
  684. package/dist/harness/policy/exec-allowlist.js +449 -0
  685. package/dist/harness/policy/exec-allowlist.js.map +1 -0
  686. package/dist/harness/policy/index.d.ts +10 -0
  687. package/dist/harness/policy/index.d.ts.map +1 -0
  688. package/dist/harness/policy/index.js +8 -0
  689. package/dist/harness/policy/index.js.map +1 -0
  690. package/dist/harness/policy/secret-patterns.d.ts +12 -0
  691. package/dist/harness/policy/secret-patterns.d.ts.map +1 -0
  692. package/dist/harness/policy/secret-patterns.js +48 -0
  693. package/dist/harness/policy/secret-patterns.js.map +1 -0
  694. package/dist/harness/policy/shell-parser.d.ts +40 -0
  695. package/dist/harness/policy/shell-parser.d.ts.map +1 -0
  696. package/dist/harness/policy/shell-parser.js +278 -0
  697. package/dist/harness/policy/shell-parser.js.map +1 -0
  698. package/dist/harness/policy/workspace-trust.d.ts +37 -0
  699. package/dist/harness/policy/workspace-trust.d.ts.map +1 -0
  700. package/dist/harness/policy/workspace-trust.js +164 -0
  701. package/dist/harness/policy/workspace-trust.js.map +1 -0
  702. package/dist/harness/providers/anthropic-messages.d.ts +48 -0
  703. package/dist/harness/providers/anthropic-messages.d.ts.map +1 -0
  704. package/dist/harness/providers/anthropic-messages.js +360 -0
  705. package/dist/harness/providers/anthropic-messages.js.map +1 -0
  706. package/dist/harness/providers/assembler.d.ts +29 -0
  707. package/dist/harness/providers/assembler.d.ts.map +1 -0
  708. package/dist/harness/providers/assembler.js +130 -0
  709. package/dist/harness/providers/assembler.js.map +1 -0
  710. package/dist/harness/providers/authenticated-stream.d.ts +9 -0
  711. package/dist/harness/providers/authenticated-stream.d.ts.map +1 -0
  712. package/dist/harness/providers/authenticated-stream.js +81 -0
  713. package/dist/harness/providers/authenticated-stream.js.map +1 -0
  714. package/dist/harness/providers/catalog.d.ts +75 -0
  715. package/dist/harness/providers/catalog.d.ts.map +1 -0
  716. package/dist/harness/providers/catalog.js +124 -0
  717. package/dist/harness/providers/catalog.js.map +1 -0
  718. package/dist/harness/providers/claude-code/adapter.d.ts +96 -0
  719. package/dist/harness/providers/claude-code/adapter.d.ts.map +1 -0
  720. package/dist/harness/providers/claude-code/adapter.js +863 -0
  721. package/dist/harness/providers/claude-code/adapter.js.map +1 -0
  722. package/dist/harness/providers/claude-code/mcp-relay.d.ts +2 -0
  723. package/dist/harness/providers/claude-code/mcp-relay.d.ts.map +1 -0
  724. package/dist/harness/providers/claude-code/mcp-relay.js +27 -0
  725. package/dist/harness/providers/claude-code/mcp-relay.js.map +1 -0
  726. package/dist/harness/providers/claude-code/mcp-server.d.ts +40 -0
  727. package/dist/harness/providers/claude-code/mcp-server.d.ts.map +1 -0
  728. package/dist/harness/providers/claude-code/mcp-server.js +171 -0
  729. package/dist/harness/providers/claude-code/mcp-server.js.map +1 -0
  730. package/dist/harness/providers/claude-code/native.d.ts +36 -0
  731. package/dist/harness/providers/claude-code/native.d.ts.map +1 -0
  732. package/dist/harness/providers/claude-code/native.js +153 -0
  733. package/dist/harness/providers/claude-code/native.js.map +1 -0
  734. package/dist/harness/providers/claude-code/process.d.ts +48 -0
  735. package/dist/harness/providers/claude-code/process.d.ts.map +1 -0
  736. package/dist/harness/providers/claude-code/process.js +128 -0
  737. package/dist/harness/providers/claude-code/process.js.map +1 -0
  738. package/dist/harness/providers/codex-app-server.d.ts +8 -0
  739. package/dist/harness/providers/codex-app-server.d.ts.map +1 -0
  740. package/dist/harness/providers/codex-app-server.js +45 -0
  741. package/dist/harness/providers/codex-app-server.js.map +1 -0
  742. package/dist/harness/providers/effort.d.ts +51 -0
  743. package/dist/harness/providers/effort.d.ts.map +1 -0
  744. package/dist/harness/providers/effort.js +108 -0
  745. package/dist/harness/providers/effort.js.map +1 -0
  746. package/dist/harness/providers/errors.d.ts +34 -0
  747. package/dist/harness/providers/errors.d.ts.map +1 -0
  748. package/dist/harness/providers/errors.js +143 -0
  749. package/dist/harness/providers/errors.js.map +1 -0
  750. package/dist/harness/providers/grammar.d.ts +17 -0
  751. package/dist/harness/providers/grammar.d.ts.map +1 -0
  752. package/dist/harness/providers/grammar.js +89 -0
  753. package/dist/harness/providers/grammar.js.map +1 -0
  754. package/dist/harness/providers/http-stream.d.ts +40 -0
  755. package/dist/harness/providers/http-stream.d.ts.map +1 -0
  756. package/dist/harness/providers/http-stream.js +134 -0
  757. package/dist/harness/providers/http-stream.js.map +1 -0
  758. package/dist/harness/providers/index.d.ts +20 -0
  759. package/dist/harness/providers/index.d.ts.map +1 -0
  760. package/dist/harness/providers/index.js +17 -0
  761. package/dist/harness/providers/index.js.map +1 -0
  762. package/dist/harness/providers/responses.d.ts +36 -0
  763. package/dist/harness/providers/responses.d.ts.map +1 -0
  764. package/dist/harness/providers/responses.js +435 -0
  765. package/dist/harness/providers/responses.js.map +1 -0
  766. package/dist/harness/providers/reviewer-route.d.ts +14 -0
  767. package/dist/harness/providers/reviewer-route.d.ts.map +1 -0
  768. package/dist/harness/providers/reviewer-route.js +31 -0
  769. package/dist/harness/providers/reviewer-route.js.map +1 -0
  770. package/dist/harness/providers/router.d.ts +50 -0
  771. package/dist/harness/providers/router.d.ts.map +1 -0
  772. package/dist/harness/providers/router.js +295 -0
  773. package/dist/harness/providers/router.js.map +1 -0
  774. package/dist/harness/providers/scripted.d.ts +22 -0
  775. package/dist/harness/providers/scripted.d.ts.map +1 -0
  776. package/dist/harness/providers/scripted.js +111 -0
  777. package/dist/harness/providers/scripted.js.map +1 -0
  778. package/dist/harness/providers/sse.d.ts +13 -0
  779. package/dist/harness/providers/sse.d.ts.map +1 -0
  780. package/dist/harness/providers/sse.js +82 -0
  781. package/dist/harness/providers/sse.js.map +1 -0
  782. package/dist/harness/providers/testing.d.ts +35 -0
  783. package/dist/harness/providers/testing.d.ts.map +1 -0
  784. package/dist/harness/providers/testing.js +93 -0
  785. package/dist/harness/providers/testing.js.map +1 -0
  786. package/dist/harness/providers/web-search.d.ts +110 -0
  787. package/dist/harness/providers/web-search.d.ts.map +1 -0
  788. package/dist/harness/providers/web-search.js +476 -0
  789. package/dist/harness/providers/web-search.js.map +1 -0
  790. package/dist/harness/store/blob-store.d.ts +4 -0
  791. package/dist/harness/store/blob-store.d.ts.map +1 -0
  792. package/dist/harness/store/blob-store.js +79 -0
  793. package/dist/harness/store/blob-store.js.map +1 -0
  794. package/dist/harness/store/durable-file.d.ts +17 -0
  795. package/dist/harness/store/durable-file.d.ts.map +1 -0
  796. package/dist/harness/store/durable-file.js +84 -0
  797. package/dist/harness/store/durable-file.js.map +1 -0
  798. package/dist/harness/store/event-store.d.ts +56 -0
  799. package/dist/harness/store/event-store.d.ts.map +1 -0
  800. package/dist/harness/store/event-store.js +210 -0
  801. package/dist/harness/store/event-store.js.map +1 -0
  802. package/dist/harness/store/index.d.ts +8 -0
  803. package/dist/harness/store/index.d.ts.map +1 -0
  804. package/dist/harness/store/index.js +4 -0
  805. package/dist/harness/store/index.js.map +1 -0
  806. package/dist/harness/store/layout.d.ts +12 -0
  807. package/dist/harness/store/layout.d.ts.map +1 -0
  808. package/dist/harness/store/layout.js +27 -0
  809. package/dist/harness/store/layout.js.map +1 -0
  810. package/dist/harness/store/lease.d.ts +37 -0
  811. package/dist/harness/store/lease.d.ts.map +1 -0
  812. package/dist/harness/store/lease.js +326 -0
  813. package/dist/harness/store/lease.js.map +1 -0
  814. package/dist/harness/store/segments.d.ts +49 -0
  815. package/dist/harness/store/segments.d.ts.map +1 -0
  816. package/dist/harness/store/segments.js +216 -0
  817. package/dist/harness/store/segments.js.map +1 -0
  818. package/dist/harness/store/session-store.d.ts +18 -0
  819. package/dist/harness/store/session-store.d.ts.map +1 -0
  820. package/dist/harness/store/session-store.js +319 -0
  821. package/dist/harness/store/session-store.js.map +1 -0
  822. package/dist/harness/tools/builtin/control-tools.d.ts +57 -0
  823. package/dist/harness/tools/builtin/control-tools.d.ts.map +1 -0
  824. package/dist/harness/tools/builtin/control-tools.js +72 -0
  825. package/dist/harness/tools/builtin/control-tools.js.map +1 -0
  826. package/dist/harness/tools/builtin/glob.d.ts +15 -0
  827. package/dist/harness/tools/builtin/glob.d.ts.map +1 -0
  828. package/dist/harness/tools/builtin/glob.js +164 -0
  829. package/dist/harness/tools/builtin/glob.js.map +1 -0
  830. package/dist/harness/tools/builtin/process-bg.d.ts +72 -0
  831. package/dist/harness/tools/builtin/process-bg.d.ts.map +1 -0
  832. package/dist/harness/tools/builtin/process-bg.js +360 -0
  833. package/dist/harness/tools/builtin/process-bg.js.map +1 -0
  834. package/dist/harness/tools/builtin/process-tools.d.ts +46 -0
  835. package/dist/harness/tools/builtin/process-tools.d.ts.map +1 -0
  836. package/dist/harness/tools/builtin/process-tools.js +263 -0
  837. package/dist/harness/tools/builtin/process-tools.js.map +1 -0
  838. package/dist/harness/tools/builtin/read-media.d.ts +10 -0
  839. package/dist/harness/tools/builtin/read-media.d.ts.map +1 -0
  840. package/dist/harness/tools/builtin/read-media.js +128 -0
  841. package/dist/harness/tools/builtin/read-media.js.map +1 -0
  842. package/dist/harness/tools/builtin/read-tools.d.ts +29 -0
  843. package/dist/harness/tools/builtin/read-tools.d.ts.map +1 -0
  844. package/dist/harness/tools/builtin/read-tools.js +329 -0
  845. package/dist/harness/tools/builtin/read-tools.js.map +1 -0
  846. package/dist/harness/tools/builtin/shared.d.ts +47 -0
  847. package/dist/harness/tools/builtin/shared.d.ts.map +1 -0
  848. package/dist/harness/tools/builtin/shared.js +94 -0
  849. package/dist/harness/tools/builtin/shared.js.map +1 -0
  850. package/dist/harness/tools/builtin/todo.d.ts +38 -0
  851. package/dist/harness/tools/builtin/todo.d.ts.map +1 -0
  852. package/dist/harness/tools/builtin/todo.js +55 -0
  853. package/dist/harness/tools/builtin/todo.js.map +1 -0
  854. package/dist/harness/tools/builtin/web-common.d.ts +18 -0
  855. package/dist/harness/tools/builtin/web-common.d.ts.map +1 -0
  856. package/dist/harness/tools/builtin/web-common.js +53 -0
  857. package/dist/harness/tools/builtin/web-common.js.map +1 -0
  858. package/dist/harness/tools/builtin/web-fetch.d.ts +33 -0
  859. package/dist/harness/tools/builtin/web-fetch.d.ts.map +1 -0
  860. package/dist/harness/tools/builtin/web-fetch.js +173 -0
  861. package/dist/harness/tools/builtin/web-fetch.js.map +1 -0
  862. package/dist/harness/tools/builtin/web-html.d.ts +14 -0
  863. package/dist/harness/tools/builtin/web-html.d.ts.map +1 -0
  864. package/dist/harness/tools/builtin/web-html.js +314 -0
  865. package/dist/harness/tools/builtin/web-html.js.map +1 -0
  866. package/dist/harness/tools/builtin/web-net.d.ts +59 -0
  867. package/dist/harness/tools/builtin/web-net.d.ts.map +1 -0
  868. package/dist/harness/tools/builtin/web-net.js +347 -0
  869. package/dist/harness/tools/builtin/web-net.js.map +1 -0
  870. package/dist/harness/tools/builtin/web-search.d.ts +40 -0
  871. package/dist/harness/tools/builtin/web-search.d.ts.map +1 -0
  872. package/dist/harness/tools/builtin/web-search.js +60 -0
  873. package/dist/harness/tools/builtin/web-search.js.map +1 -0
  874. package/dist/harness/tools/builtin/web-state.d.ts +67 -0
  875. package/dist/harness/tools/builtin/web-state.d.ts.map +1 -0
  876. package/dist/harness/tools/builtin/web-state.js +227 -0
  877. package/dist/harness/tools/builtin/web-state.js.map +1 -0
  878. package/dist/harness/tools/builtin/write-tools.d.ts +18 -0
  879. package/dist/harness/tools/builtin/write-tools.d.ts.map +1 -0
  880. package/dist/harness/tools/builtin/write-tools.js +335 -0
  881. package/dist/harness/tools/builtin/write-tools.js.map +1 -0
  882. package/dist/harness/tools/environment.d.ts +9 -0
  883. package/dist/harness/tools/environment.d.ts.map +1 -0
  884. package/dist/harness/tools/environment.js +59 -0
  885. package/dist/harness/tools/environment.js.map +1 -0
  886. package/dist/harness/tools/file-ledger.d.ts +9 -0
  887. package/dist/harness/tools/file-ledger.d.ts.map +1 -0
  888. package/dist/harness/tools/file-ledger.js +26 -0
  889. package/dist/harness/tools/file-ledger.js.map +1 -0
  890. package/dist/harness/tools/gateway.d.ts +52 -0
  891. package/dist/harness/tools/gateway.d.ts.map +1 -0
  892. package/dist/harness/tools/gateway.js +435 -0
  893. package/dist/harness/tools/gateway.js.map +1 -0
  894. package/dist/harness/tools/index.d.ts +20 -0
  895. package/dist/harness/tools/index.d.ts.map +1 -0
  896. package/dist/harness/tools/index.js +17 -0
  897. package/dist/harness/tools/index.js.map +1 -0
  898. package/dist/harness/tools/patch.d.ts +51 -0
  899. package/dist/harness/tools/patch.d.ts.map +1 -0
  900. package/dist/harness/tools/patch.js +450 -0
  901. package/dist/harness/tools/patch.js.map +1 -0
  902. package/dist/harness/tools/process.d.ts +28 -0
  903. package/dist/harness/tools/process.d.ts.map +1 -0
  904. package/dist/harness/tools/process.js +263 -0
  905. package/dist/harness/tools/process.js.map +1 -0
  906. package/dist/harness/tools/redaction.d.ts +26 -0
  907. package/dist/harness/tools/redaction.d.ts.map +1 -0
  908. package/dist/harness/tools/redaction.js +77 -0
  909. package/dist/harness/tools/redaction.js.map +1 -0
  910. package/dist/harness/tools/registry.d.ts +26 -0
  911. package/dist/harness/tools/registry.d.ts.map +1 -0
  912. package/dist/harness/tools/registry.js +57 -0
  913. package/dist/harness/tools/registry.js.map +1 -0
  914. package/dist/harness/tools/sandbox.d.ts +23 -0
  915. package/dist/harness/tools/sandbox.d.ts.map +1 -0
  916. package/dist/harness/tools/sandbox.js +117 -0
  917. package/dist/harness/tools/sandbox.js.map +1 -0
  918. package/dist/harness/tools/testing.d.ts +42 -0
  919. package/dist/harness/tools/testing.d.ts.map +1 -0
  920. package/dist/harness/tools/testing.js +143 -0
  921. package/dist/harness/tools/testing.js.map +1 -0
  922. package/dist/harness/tools/text-file.d.ts +38 -0
  923. package/dist/harness/tools/text-file.d.ts.map +1 -0
  924. package/dist/harness/tools/text-file.js +90 -0
  925. package/dist/harness/tools/text-file.js.map +1 -0
  926. package/dist/harness/tools/windows-launch.d.ts +52 -0
  927. package/dist/harness/tools/windows-launch.d.ts.map +1 -0
  928. package/dist/harness/tools/windows-launch.js +261 -0
  929. package/dist/harness/tools/windows-launch.js.map +1 -0
  930. package/dist/harness/tools/workspace-path.d.ts +34 -0
  931. package/dist/harness/tools/workspace-path.d.ts.map +1 -0
  932. package/dist/harness/tools/workspace-path.js +133 -0
  933. package/dist/harness/tools/workspace-path.js.map +1 -0
  934. package/dist/harness/tui/approvals.d.ts +44 -0
  935. package/dist/harness/tui/approvals.d.ts.map +1 -0
  936. package/dist/harness/tui/approvals.js +127 -0
  937. package/dist/harness/tui/approvals.js.map +1 -0
  938. package/dist/harness/tui/auth-interaction.d.ts +36 -0
  939. package/dist/harness/tui/auth-interaction.d.ts.map +1 -0
  940. package/dist/harness/tui/auth-interaction.js +76 -0
  941. package/dist/harness/tui/auth-interaction.js.map +1 -0
  942. package/dist/harness/tui/choice-modal.d.ts +58 -0
  943. package/dist/harness/tui/choice-modal.d.ts.map +1 -0
  944. package/dist/harness/tui/choice-modal.js +244 -0
  945. package/dist/harness/tui/choice-modal.js.map +1 -0
  946. package/dist/harness/tui/conversation-view.d.ts +250 -0
  947. package/dist/harness/tui/conversation-view.d.ts.map +1 -0
  948. package/dist/harness/tui/conversation-view.js +1115 -0
  949. package/dist/harness/tui/conversation-view.js.map +1 -0
  950. package/dist/harness/tui/describe.d.ts +21 -0
  951. package/dist/harness/tui/describe.d.ts.map +1 -0
  952. package/dist/harness/tui/describe.js +110 -0
  953. package/dist/harness/tui/describe.js.map +1 -0
  954. package/dist/harness/tui/index.d.ts +30 -0
  955. package/dist/harness/tui/index.d.ts.map +1 -0
  956. package/dist/harness/tui/index.js +26 -0
  957. package/dist/harness/tui/index.js.map +1 -0
  958. package/dist/harness/tui/input/attachments.d.ts +20 -0
  959. package/dist/harness/tui/input/attachments.d.ts.map +1 -0
  960. package/dist/harness/tui/input/attachments.js +100 -0
  961. package/dist/harness/tui/input/attachments.js.map +1 -0
  962. package/dist/harness/tui/input/autocomplete.d.ts +41 -0
  963. package/dist/harness/tui/input/autocomplete.d.ts.map +1 -0
  964. package/dist/harness/tui/input/autocomplete.js +85 -0
  965. package/dist/harness/tui/input/autocomplete.js.map +1 -0
  966. package/dist/harness/tui/input/clipboard.d.ts +44 -0
  967. package/dist/harness/tui/input/clipboard.d.ts.map +1 -0
  968. package/dist/harness/tui/input/clipboard.js +181 -0
  969. package/dist/harness/tui/input/clipboard.js.map +1 -0
  970. package/dist/harness/tui/input/commands.d.ts +23 -0
  971. package/dist/harness/tui/input/commands.d.ts.map +1 -0
  972. package/dist/harness/tui/input/commands.js +71 -0
  973. package/dist/harness/tui/input/commands.js.map +1 -0
  974. package/dist/harness/tui/input/file-index.d.ts +49 -0
  975. package/dist/harness/tui/input/file-index.d.ts.map +1 -0
  976. package/dist/harness/tui/input/file-index.js +170 -0
  977. package/dist/harness/tui/input/file-index.js.map +1 -0
  978. package/dist/harness/tui/input/index.d.ts +8 -0
  979. package/dist/harness/tui/input/index.d.ts.map +1 -0
  980. package/dist/harness/tui/input/index.js +8 -0
  981. package/dist/harness/tui/input/index.js.map +1 -0
  982. package/dist/harness/tui/input/mouse.d.ts +68 -0
  983. package/dist/harness/tui/input/mouse.d.ts.map +1 -0
  984. package/dist/harness/tui/input/mouse.js +141 -0
  985. package/dist/harness/tui/input/mouse.js.map +1 -0
  986. package/dist/harness/tui/interrupt.d.ts +25 -0
  987. package/dist/harness/tui/interrupt.d.ts.map +1 -0
  988. package/dist/harness/tui/interrupt.js +49 -0
  989. package/dist/harness/tui/interrupt.js.map +1 -0
  990. package/dist/harness/tui/jsonl-renderer.d.ts +68 -0
  991. package/dist/harness/tui/jsonl-renderer.d.ts.map +1 -0
  992. package/dist/harness/tui/jsonl-renderer.js +172 -0
  993. package/dist/harness/tui/jsonl-renderer.js.map +1 -0
  994. package/dist/harness/tui/line-source.d.ts +39 -0
  995. package/dist/harness/tui/line-source.d.ts.map +1 -0
  996. package/dist/harness/tui/line-source.js +137 -0
  997. package/dist/harness/tui/line-source.js.map +1 -0
  998. package/dist/harness/tui/logo-art.d.ts +9 -0
  999. package/dist/harness/tui/logo-art.d.ts.map +1 -0
  1000. package/dist/harness/tui/logo-art.js +24 -0
  1001. package/dist/harness/tui/logo-art.js.map +1 -0
  1002. package/dist/harness/tui/logo.d.ts +28 -0
  1003. package/dist/harness/tui/logo.d.ts.map +1 -0
  1004. package/dist/harness/tui/logo.js +88 -0
  1005. package/dist/harness/tui/logo.js.map +1 -0
  1006. package/dist/harness/tui/open-browser.d.ts +17 -0
  1007. package/dist/harness/tui/open-browser.d.ts.map +1 -0
  1008. package/dist/harness/tui/open-browser.js +45 -0
  1009. package/dist/harness/tui/open-browser.js.map +1 -0
  1010. package/dist/harness/tui/output-chunks.d.ts +8 -0
  1011. package/dist/harness/tui/output-chunks.d.ts.map +1 -0
  1012. package/dist/harness/tui/output-chunks.js +48 -0
  1013. package/dist/harness/tui/output-chunks.js.map +1 -0
  1014. package/dist/harness/tui/panels/index.d.ts +2 -0
  1015. package/dist/harness/tui/panels/index.d.ts.map +1 -0
  1016. package/dist/harness/tui/panels/index.js +2 -0
  1017. package/dist/harness/tui/panels/index.js.map +1 -0
  1018. package/dist/harness/tui/panels/panel-view.d.ts +98 -0
  1019. package/dist/harness/tui/panels/panel-view.d.ts.map +1 -0
  1020. package/dist/harness/tui/panels/panel-view.js +596 -0
  1021. package/dist/harness/tui/panels/panel-view.js.map +1 -0
  1022. package/dist/harness/tui/pi-tui-renderer.d.ts +363 -0
  1023. package/dist/harness/tui/pi-tui-renderer.d.ts.map +1 -0
  1024. package/dist/harness/tui/pi-tui-renderer.js +2696 -0
  1025. package/dist/harness/tui/pi-tui-renderer.js.map +1 -0
  1026. package/dist/harness/tui/plain-line-renderer.d.ts +102 -0
  1027. package/dist/harness/tui/plain-line-renderer.d.ts.map +1 -0
  1028. package/dist/harness/tui/plain-line-renderer.js +491 -0
  1029. package/dist/harness/tui/plain-line-renderer.js.map +1 -0
  1030. package/dist/harness/tui/render-queue.d.ts +34 -0
  1031. package/dist/harness/tui/render-queue.d.ts.map +1 -0
  1032. package/dist/harness/tui/render-queue.js +92 -0
  1033. package/dist/harness/tui/render-queue.js.map +1 -0
  1034. package/dist/harness/tui/sanitize.d.ts +9 -0
  1035. package/dist/harness/tui/sanitize.d.ts.map +1 -0
  1036. package/dist/harness/tui/sanitize.js +31 -0
  1037. package/dist/harness/tui/sanitize.js.map +1 -0
  1038. package/dist/harness/tui/style.d.ts +54 -0
  1039. package/dist/harness/tui/style.d.ts.map +1 -0
  1040. package/dist/harness/tui/style.js +64 -0
  1041. package/dist/harness/tui/style.js.map +1 -0
  1042. package/dist/harness/tui/terminal-lifecycle.d.ts +49 -0
  1043. package/dist/harness/tui/terminal-lifecycle.d.ts.map +1 -0
  1044. package/dist/harness/tui/terminal-lifecycle.js +100 -0
  1045. package/dist/harness/tui/terminal-lifecycle.js.map +1 -0
  1046. package/dist/harness/tui/theme.d.ts +77 -0
  1047. package/dist/harness/tui/theme.d.ts.map +1 -0
  1048. package/dist/harness/tui/theme.js +501 -0
  1049. package/dist/harness/tui/theme.js.map +1 -0
  1050. package/dist/harness/tui/tool-cards.d.ts +35 -0
  1051. package/dist/harness/tui/tool-cards.d.ts.map +1 -0
  1052. package/dist/harness/tui/tool-cards.js +122 -0
  1053. package/dist/harness/tui/tool-cards.js.map +1 -0
  1054. package/dist/harness/tui/tool-row.d.ts +51 -0
  1055. package/dist/harness/tui/tool-row.d.ts.map +1 -0
  1056. package/dist/harness/tui/tool-row.js +98 -0
  1057. package/dist/harness/tui/tool-row.js.map +1 -0
  1058. package/dist/harness/tui/views/board.d.ts +49 -0
  1059. package/dist/harness/tui/views/board.d.ts.map +1 -0
  1060. package/dist/harness/tui/views/board.js +293 -0
  1061. package/dist/harness/tui/views/board.js.map +1 -0
  1062. package/dist/harness/tui/views/cards.d.ts +8 -0
  1063. package/dist/harness/tui/views/cards.d.ts.map +1 -0
  1064. package/dist/harness/tui/views/cards.js +206 -0
  1065. package/dist/harness/tui/views/cards.js.map +1 -0
  1066. package/dist/harness/tui/views/components.d.ts +101 -0
  1067. package/dist/harness/tui/views/components.d.ts.map +1 -0
  1068. package/dist/harness/tui/views/components.js +186 -0
  1069. package/dist/harness/tui/views/components.js.map +1 -0
  1070. package/dist/harness/tui/views/diff.d.ts +11 -0
  1071. package/dist/harness/tui/views/diff.d.ts.map +1 -0
  1072. package/dist/harness/tui/views/diff.js +150 -0
  1073. package/dist/harness/tui/views/diff.js.map +1 -0
  1074. package/dist/harness/tui/views/graph.d.ts +49 -0
  1075. package/dist/harness/tui/views/graph.d.ts.map +1 -0
  1076. package/dist/harness/tui/views/graph.js +361 -0
  1077. package/dist/harness/tui/views/graph.js.map +1 -0
  1078. package/dist/harness/tui/views/index.d.ts +15 -0
  1079. package/dist/harness/tui/views/index.d.ts.map +1 -0
  1080. package/dist/harness/tui/views/index.js +15 -0
  1081. package/dist/harness/tui/views/index.js.map +1 -0
  1082. package/dist/harness/tui/views/kit.d.ts +112 -0
  1083. package/dist/harness/tui/views/kit.d.ts.map +1 -0
  1084. package/dist/harness/tui/views/kit.js +282 -0
  1085. package/dist/harness/tui/views/kit.js.map +1 -0
  1086. package/dist/harness/tui/views/trust-cards.d.ts +27 -0
  1087. package/dist/harness/tui/views/trust-cards.d.ts.map +1 -0
  1088. package/dist/harness/tui/views/trust-cards.js +181 -0
  1089. package/dist/harness/tui/views/trust-cards.js.map +1 -0
  1090. package/dist/harness/tui/views/usage.d.ts +4 -0
  1091. package/dist/harness/tui/views/usage.d.ts.map +1 -0
  1092. package/dist/harness/tui/views/usage.js +182 -0
  1093. package/dist/harness/tui/views/usage.js.map +1 -0
  1094. package/dist/harness/tui/views/worker.d.ts +47 -0
  1095. package/dist/harness/tui/views/worker.d.ts.map +1 -0
  1096. package/dist/harness/tui/views/worker.js +221 -0
  1097. package/dist/harness/tui/views/worker.js.map +1 -0
  1098. package/dist/harness/tui/welcome.d.ts +97 -0
  1099. package/dist/harness/tui/welcome.d.ts.map +1 -0
  1100. package/dist/harness/tui/welcome.js +271 -0
  1101. package/dist/harness/tui/welcome.js.map +1 -0
  1102. package/dist/harness/tui/wrap.d.ts +26 -0
  1103. package/dist/harness/tui/wrap.d.ts.map +1 -0
  1104. package/dist/harness/tui/wrap.js +38 -0
  1105. package/dist/harness/tui/wrap.js.map +1 -0
  1106. package/dist/infrastructure/build-info.d.ts +5 -0
  1107. package/dist/infrastructure/build-info.d.ts.map +1 -0
  1108. package/dist/infrastructure/build-info.js +21 -0
  1109. package/dist/infrastructure/build-info.js.map +1 -0
  1110. package/dist/infrastructure/frontmatter.d.ts +25 -0
  1111. package/dist/infrastructure/frontmatter.d.ts.map +1 -0
  1112. package/dist/infrastructure/frontmatter.js +75 -0
  1113. package/dist/infrastructure/frontmatter.js.map +1 -0
  1114. package/dist/templates/agent-manifests.d.ts +19 -0
  1115. package/dist/templates/agent-manifests.d.ts.map +1 -0
  1116. package/dist/templates/agent-manifests.js +302 -0
  1117. package/dist/templates/agent-manifests.js.map +1 -0
  1118. package/dist/templates/base-skills.d.ts +23 -0
  1119. package/dist/templates/base-skills.d.ts.map +1 -0
  1120. package/dist/templates/base-skills.js +477 -0
  1121. package/dist/templates/base-skills.js.map +1 -0
  1122. package/dist/templates/skill-creator-skill.d.ts +23 -0
  1123. package/dist/templates/skill-creator-skill.d.ts.map +1 -0
  1124. package/dist/templates/skill-creator-skill.js +235 -0
  1125. package/dist/templates/skill-creator-skill.js.map +1 -0
  1126. package/dist/templates/skill-references.d.ts +13 -0
  1127. package/dist/templates/skill-references.d.ts.map +1 -0
  1128. package/dist/templates/skill-references.js +280 -0
  1129. package/dist/templates/skill-references.js.map +1 -0
  1130. package/dist/templates/structure-templates.d.ts.map +1 -1
  1131. package/dist/templates/structure-templates.js +20 -144
  1132. package/dist/templates/structure-templates.js.map +1 -1
  1133. package/dist/templates/task-conductor-skill.d.ts +1 -1
  1134. package/dist/templates/task-conductor-skill.d.ts.map +1 -1
  1135. package/dist/templates/task-conductor-skill.js +50 -22
  1136. package/dist/templates/task-conductor-skill.js.map +1 -1
  1137. package/package.json +8 -2
@@ -0,0 +1,1115 @@
1
+ import { describeEvent } from "./describe.js";
2
+ import { sanitizeInline, sanitizeTerminalText } from "./sanitize.js";
3
+ export const GLYPH_SETS = {
4
+ rich: { name: "rich", bullet: "●", result: "⎿", ok: "✓", fail: "✗", warn: "!", user: ">", sep: "·", minus: "−", resume: "↻", ellipsis: "…", spinner: ["⠋", "⠙", "⠹", "⠸", "⠼", "⠴", "⠦", "⠧", "⠇", "⠏"], spinnerMs: 80 },
5
+ safe: { name: "safe", bullet: "●", result: "└", ok: "√", fail: "×", warn: "!", user: ">", sep: "·", minus: "-", resume: "~", ellipsis: "…", spinner: ["-", "\\", "|", "/"], spinnerMs: 120 },
6
+ ascii: { name: "ascii", bullet: "*", result: "\\_", ok: "+", fail: "x", warn: "!", user: ">", sep: "-", minus: "-", resume: "~", ellipsis: "...", spinner: ["-", "\\", "|", "/"], spinnerMs: 120 },
7
+ };
8
+ /**
9
+ * `SYN_GLYPHS` > automatic detection (TUI §11.1): plain or `TERM=dumb` → ascii; Windows Terminal,
10
+ * VS Code or WezTerm → rich; classic conhost → safe (no braille, no ⎿); everything else → rich.
11
+ */
12
+ export function selectGlyphs(env, platform, plain) {
13
+ const wanted = env.SYN_GLYPHS?.trim().toLowerCase();
14
+ if (wanted === "rich" || wanted === "safe" || wanted === "ascii")
15
+ return GLYPH_SETS[wanted];
16
+ if (plain || env.TERM === "dumb")
17
+ return GLYPH_SETS.ascii;
18
+ if (platform === "win32") {
19
+ const modern = env.WT_SESSION !== undefined || ["vscode", "WezTerm", "Tabby", "Hyper"].includes(env.TERM_PROGRAM ?? "");
20
+ return modern ? GLYPH_SETS.rich : GLYPH_SETS.safe;
21
+ }
22
+ const locale = env.LC_ALL ?? env.LC_CTYPE ?? env.LANG;
23
+ if (locale !== undefined && locale !== "" && !/utf-?8/i.test(locale))
24
+ return GLYPH_SETS.ascii;
25
+ if (env.TERM === "linux")
26
+ return GLYPH_SETS.safe;
27
+ return GLYPH_SETS.rich;
28
+ }
29
+ const COORDINATION_TOOLS = new Set(["ask_user", "load_skill", "memory_propose", "plan_propose", "task_spawn", "task_status", "task_triage", "task_report", "review_report"]);
30
+ const PREVIEW_LINES = 8;
31
+ const DETAIL_LINES = 10;
32
+ export class ConversationPresenter {
33
+ options;
34
+ now;
35
+ tools = new Map();
36
+ /** Approval ids whose prompt offered "always allow <domain>" (K4.1). */
37
+ hostApprovals = new Set();
38
+ /** tool_call_id -> item id (a read group maps several calls to one item). */
39
+ toolItem = new Map();
40
+ assistant = new Map();
41
+ streamed = new Set();
42
+ counter = 0;
43
+ lastItem;
44
+ replaying = false;
45
+ turnStartedAt;
46
+ turnTokens = 0;
47
+ streamChars = 0;
48
+ activityVerb;
49
+ waiting = false;
50
+ contextTokens;
51
+ /** Highest window % per provider (this conversation's requests and its workers'). */
52
+ quotas = new Map();
53
+ requestProviders = new Map();
54
+ cost;
55
+ model;
56
+ effort;
57
+ contextWindow;
58
+ ledger = { files: new Map(), tests: undefined };
59
+ /** The turn's checklist item: later `todo` calls in the same turn update it in place. */
60
+ todoItem;
61
+ /** Enter was pressed and no turn has started yet: the activity line shows at once. */
62
+ submittedAt;
63
+ constructor(options) {
64
+ this.options = options;
65
+ this.now = options.now ?? (() => Date.now());
66
+ this.model = options.model;
67
+ this.contextWindow = options.contextWindowTokens;
68
+ }
69
+ /** Live facts of the conversation model (start, `/model`, `/effort`): `effort: null` clears it, undefined keeps it. */
70
+ configure(values) {
71
+ if (values.model !== undefined)
72
+ this.model = values.model;
73
+ if (values.effort !== undefined)
74
+ this.effort = values.effort ?? undefined;
75
+ if (values.contextWindowTokens !== undefined)
76
+ this.contextWindow = values.contextWindowTokens;
77
+ }
78
+ get glyphs() {
79
+ return this.options.glyphs;
80
+ }
81
+ /** Renders earlier events of a resumed conversation (the TUI shows past user messages too). */
82
+ replay(events) {
83
+ this.replaying = true;
84
+ try {
85
+ return events.flatMap((event) => this.apply({ kind: "session-event", event }));
86
+ }
87
+ finally {
88
+ this.replaying = false;
89
+ this.turnStartedAt = undefined;
90
+ this.activityVerb = undefined;
91
+ }
92
+ }
93
+ setWaiting(waiting) {
94
+ this.waiting = waiting;
95
+ }
96
+ /** The user just sent a message: show the activity line now, before the session reports the turn. */
97
+ markSubmitted() {
98
+ if (this.turnStartedAt === undefined)
99
+ this.submittedAt = this.now();
100
+ }
101
+ /** Drops a pending (not yet started) activity, e.g. when the session answered with an error. */
102
+ clearSubmitted() {
103
+ this.submittedAt = undefined;
104
+ }
105
+ /** The tool an approval prompt is about: its title and the edit it would make. */
106
+ pendingTool() {
107
+ const running = [...this.tools.values()].reverse().find((state) => state.status === "running");
108
+ if (running === undefined)
109
+ return undefined;
110
+ const added = running.pending.filter((line) => line.op === "+").length;
111
+ const removed = running.pending.filter((line) => line.op === "-").length;
112
+ return { title: running.title, stat: running.pending.length === 0 ? undefined : `+${added} ${this.options.glyphs.minus}${removed}`, preview: running.pending };
113
+ }
114
+ activity() {
115
+ if (this.turnStartedAt === undefined && this.submittedAt !== undefined) {
116
+ if (this.now() - this.submittedAt > 15_000)
117
+ this.submittedAt = undefined;
118
+ else
119
+ return { verb: "Thinking", detail: undefined, startedAt: this.submittedAt, tokens: 0, waiting: false };
120
+ }
121
+ if (this.turnStartedAt === undefined)
122
+ return undefined;
123
+ const verb = this.waiting ? { verb: "Waiting for you", detail: undefined } : (this.activityVerb ?? { verb: "Thinking", detail: undefined });
124
+ return { verb: verb.verb, detail: verb.detail, startedAt: this.turnStartedAt, tokens: this.turnTokens + Math.round(this.streamChars / 4), waiting: this.waiting };
125
+ }
126
+ footer() {
127
+ const window = this.contextWindow;
128
+ return {
129
+ model: this.model,
130
+ effort: this.effort,
131
+ contextPercent: this.contextTokens === undefined || window === undefined || window <= 0 ? undefined : Math.min(100, Math.round((this.contextTokens / window) * 100)),
132
+ ...this.topQuota(),
133
+ costUsd: this.cost,
134
+ };
135
+ }
136
+ topQuota() {
137
+ let top;
138
+ for (const entry of this.quotas)
139
+ if (top === undefined || entry[1] > top[1])
140
+ top = entry;
141
+ if (top === undefined)
142
+ return { quotaPercent: undefined };
143
+ return top[0] === "" ? { quotaPercent: top[1] } : { quotaPercent: top[1], quotaProvider: quotaProviderLabel(top[0]) };
144
+ }
145
+ noteQuota(provider, windows) {
146
+ const percent = maxQuota(windows);
147
+ if (percent !== undefined)
148
+ this.quotas.set(provider ?? "", percent);
149
+ }
150
+ apply(event) {
151
+ switch (event.kind) {
152
+ case "session-event":
153
+ return this.onEvent(event.event);
154
+ case "stream":
155
+ return this.onStream(event.requestId, event.event);
156
+ case "notice":
157
+ if (event.level !== "info")
158
+ this.submittedAt = undefined;
159
+ return [this.note(event.level, event.message)];
160
+ case "status":
161
+ return [];
162
+ }
163
+ }
164
+ /** A line the CLI adds itself (slash command output, trust decisions). */
165
+ note(level, text) {
166
+ // Leading indentation is layout (plan items, `Workspace` rows under an error): keep it, flatten the rest.
167
+ const item = { kind: "note", id: this.nextId(), level, text: `${/^ {0,8}/.exec(text)?.[0] ?? ""}${sanitizeInline(text, 2000)}` };
168
+ this.lastItem = item.id;
169
+ return { op: "append", item };
170
+ }
171
+ nextId() {
172
+ this.counter += 1;
173
+ return `v${this.counter}`;
174
+ }
175
+ onStream(requestId, event) {
176
+ if (event.type === "text_delta") {
177
+ this.streamed.add(requestId);
178
+ this.streamChars += event.text.length;
179
+ this.activityVerb = { verb: "Responding", detail: undefined };
180
+ const key = `${requestId}:${event.index}`;
181
+ const known = this.assistant.get(key);
182
+ if (known === undefined) {
183
+ const state = { id: this.nextId(), text: event.text };
184
+ this.assistant.set(key, state);
185
+ this.lastItem = state.id;
186
+ return [{ op: "append", item: { kind: "assistant", id: state.id, text: sanitizeTerminalText(state.text), done: false } }];
187
+ }
188
+ known.text += event.text;
189
+ return [{ op: "update", item: { kind: "assistant", id: known.id, text: sanitizeTerminalText(known.text), done: false } }];
190
+ }
191
+ if (event.type === "done") {
192
+ const ops = [];
193
+ event.message.content.forEach((part, index) => {
194
+ if (part.type !== "text")
195
+ return;
196
+ const known = this.assistant.get(`${requestId}:${index}`);
197
+ if (known === undefined)
198
+ return;
199
+ known.text = part.text;
200
+ ops.push({ op: "update", item: { kind: "assistant", id: known.id, text: sanitizeTerminalText(known.text), done: true } });
201
+ });
202
+ this.streamChars = 0;
203
+ if (this.activityVerb?.verb === "Responding")
204
+ this.activityVerb = undefined;
205
+ return ops;
206
+ }
207
+ if (event.type === "quota")
208
+ this.noteQuota(this.requestProviders.get(requestId), event.quota.windows);
209
+ return [];
210
+ }
211
+ onEvent(event) {
212
+ const debug = this.options.debug === true ? this.debugLine(event) : [];
213
+ return [...this.present(event), ...debug];
214
+ }
215
+ debugLine(event) {
216
+ const line = describeEvent(event);
217
+ return line === undefined ? [] : [this.note("debug", `[event] ${line.text}`)];
218
+ }
219
+ present(event) {
220
+ switch (event.type) {
221
+ case "turn/started":
222
+ this.ledger = { files: new Map(), tests: undefined };
223
+ this.todoItem = undefined;
224
+ if (!this.replaying) {
225
+ this.turnStartedAt = this.submittedAt ?? this.now();
226
+ this.submittedAt = undefined;
227
+ this.turnTokens = 0;
228
+ this.streamChars = 0;
229
+ this.activityVerb = undefined;
230
+ }
231
+ return [];
232
+ case "turn/ended":
233
+ return this.turnEnded(event);
234
+ case "message/recorded":
235
+ return this.message(event);
236
+ case "steer/queued":
237
+ return this.options.echoesUser && !this.replaying ? [] : [this.user(event.data.text)];
238
+ case "model/request_prepared":
239
+ this.contextTokens = event.data.context.reduce((sum, block) => sum + block.tokens_estimate, 0);
240
+ this.model ??= event.data.route.model_id;
241
+ this.requestProviders.set(event.data.request_id, event.data.route.provider_id);
242
+ return [];
243
+ case "provider/usage":
244
+ this.turnTokens += usageTokens(event.data.usage);
245
+ if (event.data.usage.cost_usd_estimate !== undefined)
246
+ this.cost = (this.cost ?? 0) + event.data.usage.cost_usd_estimate;
247
+ if (event.data.quota !== undefined)
248
+ this.noteQuota(event.data.provider_id ?? this.requestProviders.get(event.data.request_id), event.data.quota.windows);
249
+ this.requestProviders.delete(event.data.request_id);
250
+ return [];
251
+ case "model/response_failed":
252
+ if (event.data.error.code === "cancelled")
253
+ return [];
254
+ return [this.note("error", `${this.options.glyphs.fail} The model request failed: ${event.data.error.message}${event.data.error.retryable ? " · press Enter to try again" : ""}`)];
255
+ case "model/response_settled":
256
+ return event.data.stop_reason === "length" ? [this.note("warning", `${this.options.glyphs.warn} The reply was cut off (length limit)`)] : [];
257
+ case "tool/policy_decided":
258
+ return this.toolDecided(event);
259
+ case "tool/execution_started":
260
+ return this.toolStarted(event);
261
+ case "tool/result_recorded":
262
+ return this.toolFinished(event);
263
+ case "backend/tool_observed":
264
+ return this.backendTool(event);
265
+ case "approval/requested":
266
+ this.waiting = !this.replaying;
267
+ if (event.data.request.hosts !== undefined)
268
+ this.hostApprovals.add(event.data.request.approval_id);
269
+ return [];
270
+ case "approval/decided":
271
+ this.waiting = false;
272
+ // A domain grant has its own line (network/host_allowed).
273
+ if (this.hostApprovals.delete(event.data.decision.approval_id))
274
+ return [];
275
+ // The tool row already shows a one-off answer (it runs, or turns ✗ denied); only a lasting grant gets its own line.
276
+ return event.data.decision.decided_by === "user" && event.data.decision.outcome === "allowed-for-scope" ? [this.note("info", `${this.options.glyphs.ok} Allowed for the rest of this session`)] : [];
277
+ case "network/host_allowed":
278
+ return [this.note("info", `${this.options.glyphs.ok} Always allowed: ${event.data.host} (every project) ${this.options.glyphs.sep} /permissions lists and removes it`)];
279
+ case "web/searched":
280
+ return this.nativeSearch(event);
281
+ case "context/compacted":
282
+ // The footer's ctx% follows at once, not only at the next request.
283
+ this.contextTokens = event.data.tokens_after;
284
+ return [this.note("info", `${this.options.glyphs.bullet} Context compacted ${this.options.glyphs.sep} ${formatTokens(event.data.tokens_before)} → ${formatTokens(event.data.tokens_after)} tokens`)];
285
+ case "checkpoint/restored":
286
+ return [];
287
+ case "session/resumed":
288
+ return [];
289
+ default:
290
+ return [];
291
+ }
292
+ }
293
+ turnEnded(event) {
294
+ const started = this.turnStartedAt;
295
+ this.turnStartedAt = undefined;
296
+ this.submittedAt = undefined;
297
+ this.activityVerb = undefined;
298
+ this.waiting = false;
299
+ const ops = [];
300
+ const g = this.options.glyphs;
301
+ for (const state of this.tools.values()) {
302
+ if (state.status === "running") {
303
+ state.status = "cancelled";
304
+ state.summary = "interrupted · may have partly run";
305
+ ops.push({ op: "update", item: this.toolView(state) });
306
+ }
307
+ }
308
+ switch (event.data.outcome) {
309
+ case "cancelled":
310
+ if (!this.replaying)
311
+ ops.push(this.note("warning", `${g.result} Interrupted ${g.sep} tell Synorch what to do instead`));
312
+ break;
313
+ case "max_steps":
314
+ ops.push(this.note("warning", `${g.warn} Stopped: the turn reached its step limit ${g.sep} say "continue" to go on`));
315
+ break;
316
+ case "budget_exceeded":
317
+ ops.push(this.note("warning", `${g.warn} Stopped: the budget admits no further model request`));
318
+ break;
319
+ case "failed":
320
+ if (!this.replaying)
321
+ ops.push(this.note("error", `${g.fail} The turn stopped on an error ${g.sep} files are unchanged unless a tool line above says otherwise ${g.sep} say "try again", or /diff to check`));
322
+ break;
323
+ default:
324
+ break;
325
+ }
326
+ const result = this.resultLine(event.data.outcome);
327
+ if (result !== undefined)
328
+ ops.push(result);
329
+ if (started !== undefined && !this.replaying) {
330
+ const elapsed = this.now() - started;
331
+ if (elapsed >= 10_000)
332
+ ops.push(this.note("info", ` worked ${formatElapsed(elapsed)} ${g.sep} ${formatTokens(this.turnTokens)} tokens`));
333
+ }
334
+ return ops;
335
+ }
336
+ /** `Changed src/a.ts (+8 −3) · Tests: 12 passed · /diff /evidence`; undefined when nothing changed or ran. */
337
+ resultLine(outcome) {
338
+ const g = this.options.glyphs;
339
+ const files = [...this.ledger.files.entries()];
340
+ const tests = this.ledger.tests;
341
+ if (files.length === 0 && tests === undefined)
342
+ return undefined;
343
+ const parts = [];
344
+ let tone = "ok";
345
+ if (files.length > 0) {
346
+ const added = files.reduce((sum, [, file]) => sum + file.added, 0);
347
+ const removed = files.reduce((sum, [, file]) => sum + file.removed, 0);
348
+ const names = files.length === 1 ? (files[0]?.[0] ?? "") : `${files.length} files`;
349
+ parts.push(`Changed ${names} (+${added} ${g.minus}${removed})`);
350
+ }
351
+ if (tests === undefined) {
352
+ parts.push("Tests: not run");
353
+ tone = "warning";
354
+ }
355
+ else if (tests.ok) {
356
+ parts.push(`Tests: ${tests.passed === undefined ? "passed" : `${tests.passed} passed`}`);
357
+ }
358
+ else {
359
+ parts.push(`Tests: ${tests.failed === undefined ? `failed (exit ${tests.exit ?? "?"})` : `${tests.failed} failed`}`);
360
+ tone = "error";
361
+ }
362
+ if ((outcome === "cancelled" || outcome === "failed") && tone === "ok")
363
+ tone = "warning";
364
+ parts.push(files.length > 0 ? "/diff /evidence" : "/evidence");
365
+ const item = { kind: "result", id: this.nextId(), text: parts.join(` ${g.sep} `), tone };
366
+ this.lastItem = item.id;
367
+ return { op: "append", item };
368
+ }
369
+ user(text) {
370
+ const item = { kind: "user", id: this.nextId(), text: sanitizeTerminalText(text) };
371
+ this.lastItem = item.id;
372
+ return { op: "append", item };
373
+ }
374
+ message(event) {
375
+ const message = event.data.message;
376
+ if (message === undefined)
377
+ return [];
378
+ if (message.role === "user") {
379
+ // A user message inside a step (request id) is the harness's own: a tool image for the model (K4.2).
380
+ if (event.data.request_id !== undefined)
381
+ return [];
382
+ if (this.options.echoesUser && !this.replaying)
383
+ return [];
384
+ const text = message.content.flatMap((part) => (part.type === "text" ? [part.text] : [])).join("\n");
385
+ // A K3 completion turn carries only a harness note (no user text): nothing to show as the user's line.
386
+ const shown = stripHarnessNotes(text);
387
+ return shown.trim() === "" ? [] : [this.user(shown)];
388
+ }
389
+ if (message.role !== "assistant")
390
+ return [];
391
+ const ops = [];
392
+ const streamed = event.data.request_id !== undefined && this.streamed.has(event.data.request_id);
393
+ for (const part of message.content) {
394
+ if (part.type === "text" && !streamed && part.text.trim() !== "") {
395
+ const id = this.nextId();
396
+ this.lastItem = id;
397
+ ops.push({ op: "append", item: { kind: "assistant", id, text: sanitizeTerminalText(part.text), done: true } });
398
+ }
399
+ if (part.type === "tool_call")
400
+ ops.push(...this.toolProposed(part));
401
+ }
402
+ return ops;
403
+ }
404
+ toolProposed(part) {
405
+ if (COORDINATION_TOOLS.has(part.name) || part.tool_call_id === undefined)
406
+ return [];
407
+ const args = part.arguments;
408
+ if (part.name === "todo" && this.todoItem !== undefined) {
409
+ const existing = this.tools.get(this.todoItem);
410
+ if (existing !== undefined) {
411
+ existing.args = args;
412
+ existing.status = "running";
413
+ this.toolItem.set(part.tool_call_id, existing.id);
414
+ return [{ op: "update", item: this.toolView(existing) }];
415
+ }
416
+ }
417
+ if (part.name === "read_file") {
418
+ const last = this.lastItem === undefined ? undefined : [...this.tools.values()].find((state) => state.id === this.lastItem && state.group !== undefined);
419
+ const file = stringArg(args, "path") ?? "?";
420
+ if (last !== undefined && last.group !== undefined && last.status !== "denied" && last.status !== "failed") {
421
+ last.group.push(file);
422
+ last.title = `Read ${last.group.length} files`;
423
+ last.summary = shortList(last.group.map((entry) => entry.split("/").at(-1) ?? entry));
424
+ last.status = "running";
425
+ this.toolItem.set(part.tool_call_id, last.id);
426
+ return [{ op: "update", item: this.toolView(last) }];
427
+ }
428
+ }
429
+ const state = {
430
+ id: this.nextId(),
431
+ name: part.name,
432
+ args,
433
+ status: "running",
434
+ title: toolTitle(part.name, args),
435
+ summary: undefined,
436
+ preview: [],
437
+ detail: [],
438
+ stat: undefined,
439
+ group: part.name === "read_file" ? [stringArg(args, "path") ?? "?"] : undefined,
440
+ pending: pendingPreview(part.name, args),
441
+ };
442
+ this.tools.set(state.id, state);
443
+ this.toolItem.set(part.tool_call_id, state.id);
444
+ this.lastItem = state.id;
445
+ if (part.name === "todo")
446
+ this.todoItem = state.id;
447
+ return [{ op: "append", item: this.toolView(state) }];
448
+ }
449
+ stateFor(toolCallId) {
450
+ const id = this.toolItem.get(toolCallId);
451
+ return id === undefined ? undefined : this.tools.get(id);
452
+ }
453
+ toolDecided(event) {
454
+ const state = this.stateFor(event.data.tool_call_id);
455
+ if (state === undefined || event.data.decision.decision !== "deny")
456
+ return [];
457
+ state.status = "denied";
458
+ state.summary = denialSummary(event.data.decision.reasons, event.data.action.role === "session" ? event.data.action.command?.argv : undefined, this.options.glyphs);
459
+ return [{ op: "update", item: this.toolView(state) }];
460
+ }
461
+ toolStarted(event) {
462
+ const state = this.stateFor(event.data.tool_call_id);
463
+ if (state === undefined)
464
+ return [];
465
+ if (!this.replaying) {
466
+ this.activityVerb =
467
+ state.name === "exec"
468
+ ? { verb: "Running", detail: sanitizeInline(argvOf(state.args).join(" "), 60) }
469
+ : state.name === "apply_patch" || state.name === "write_file"
470
+ ? { verb: "Editing", detail: undefined }
471
+ : state.name === "web_search"
472
+ ? { verb: "Searching", detail: sanitizeInline(stringArg(state.args, "query") ?? "", 60) }
473
+ : state.name === "web_fetch"
474
+ ? { verb: "Fetching", detail: sanitizeInline(shortUrl(stringArg(state.args, "url") ?? ""), 60) }
475
+ : { verb: "Reading", detail: undefined };
476
+ }
477
+ return [];
478
+ }
479
+ toolFinished(event) {
480
+ const state = this.stateFor(event.data.tool_call_id);
481
+ if (!this.replaying)
482
+ this.activityVerb = undefined;
483
+ if (state === undefined)
484
+ return [];
485
+ if (event.data.state === "denied" && state.status === "denied")
486
+ return [];
487
+ const result = event.data.result;
488
+ const g = this.options.glyphs;
489
+ if (event.data.state === "denied") {
490
+ state.status = "denied";
491
+ state.summary = sanitizeInline(result.error?.message ?? "refused", 600);
492
+ return [{ op: "update", item: this.toolView(state) }];
493
+ }
494
+ if (event.data.state === "cancelled") {
495
+ state.status = "cancelled";
496
+ state.summary = "interrupted · may have partly run";
497
+ return [{ op: "update", item: this.toolView(state) }];
498
+ }
499
+ const failed = event.data.state !== "succeeded" || result.status === "error";
500
+ if (state.group !== undefined && state.group.length > 1) {
501
+ state.status = failed ? "failed" : "ok";
502
+ if (failed)
503
+ state.summary = `${state.summary ?? ""} ${g.sep} ${sanitizeInline(result.error?.message ?? "failed", 120)}`;
504
+ return [{ op: "update", item: this.toolView(state) }];
505
+ }
506
+ state.status = failed ? "failed" : "ok";
507
+ const outcome = summarizeResult(state.name, state.args, result, event.data.duration_ms, g);
508
+ state.summary = outcome.summary;
509
+ state.stat = outcome.stat;
510
+ state.preview = outcome.preview;
511
+ state.detail = outcome.detail;
512
+ if (state.name === "exec" && state.args.background === true && !failed) {
513
+ const handle = /^(p\d+) · /.exec(result.text)?.[1];
514
+ if (handle !== undefined && / · running · /.test(result.text.split("\n", 1)[0] ?? ""))
515
+ state.background = { handle, startedAt: Date.parse(event.timestamp) - event.data.duration_ms };
516
+ }
517
+ this.record(state, result, failed);
518
+ return [{ op: "update", item: this.toolView(state) }];
519
+ }
520
+ /**
521
+ * Claude Code native mode: a built-in tool Claude ran itself, as a tool row (`✓ Bash pnpm test
522
+ * 12 passed`, `✓ Edit src/x.ts +3 −1`). Display only; the row feeds the turn's result line.
523
+ */
524
+ backendTool(event) {
525
+ const data = event.data;
526
+ const g = this.options.glyphs;
527
+ const key = `backend:${data.tool_use_id}`;
528
+ let state = this.stateFor(key);
529
+ const fresh = state === undefined;
530
+ if (state === undefined) {
531
+ state = {
532
+ id: this.nextId(),
533
+ name: `claude:${data.tool_name}`,
534
+ args: {},
535
+ status: "running",
536
+ title: claudeToolTitle(data.tool_name, data.input_summary),
537
+ summary: undefined,
538
+ preview: [],
539
+ detail: [],
540
+ stat: undefined,
541
+ group: undefined,
542
+ pending: [],
543
+ };
544
+ this.tools.set(state.id, state);
545
+ this.toolItem.set(key, state.id);
546
+ this.lastItem = state.id;
547
+ }
548
+ if (data.phase === "started") {
549
+ if (!this.replaying) {
550
+ this.activityVerb =
551
+ data.tool_name === "Bash" || data.tool_name === "PowerShell"
552
+ ? { verb: "Running", detail: sanitizeInline(data.input_summary, 60) }
553
+ : CLAUDE_WRITE_TOOLS.has(data.tool_name)
554
+ ? { verb: "Editing", detail: undefined }
555
+ : { verb: "Working", detail: undefined };
556
+ }
557
+ return fresh ? [{ op: "append", item: this.toolView(state) }] : [];
558
+ }
559
+ if (!this.replaying)
560
+ this.activityVerb = undefined;
561
+ const failed = data.is_error === true;
562
+ state.status = failed ? "failed" : "ok";
563
+ const lines = data.lines_added === undefined ? undefined : `+${data.lines_added} ${g.minus}${data.lines_removed ?? 0}`;
564
+ const summary = sanitizeInline(lines ?? data.result_summary ?? "", 600);
565
+ state.summary = summary === "" ? undefined : summary;
566
+ if (!failed && CLAUDE_WRITE_TOOLS.has(data.tool_name) && data.input_summary !== "") {
567
+ const entry = this.ledger.files.get(data.input_summary) ?? { added: 0, removed: 0, created: data.tool_name === "Write" };
568
+ entry.added += data.lines_added ?? 0;
569
+ entry.removed += data.lines_removed ?? 0;
570
+ this.ledger.files.set(data.input_summary, entry);
571
+ }
572
+ else if (data.tool_name === "Bash" && isTestCommand(data.input_summary.split(/\s+/))) {
573
+ const body = data.result_summary ?? "";
574
+ const failures = testCount(body, "fail");
575
+ this.ledger.tests = { passed: testCount(body, "pass"), failed: failures === 0 ? undefined : failures, ok: !failed, exit: undefined };
576
+ }
577
+ return [{ op: fresh ? "append" : "update", item: this.toolView(state) }];
578
+ }
579
+ /** Feeds the turn's result line: edited files with their line counts, and test commands. */
580
+ record(state, result, failed) {
581
+ if (state.name === "apply_patch" && !failed) {
582
+ const patch = stringArg(state.args, "patch") ?? "";
583
+ const diff = patchDiff(patch);
584
+ const created = /^\*\*\* Add File: /m.test(patch);
585
+ patchPaths(patch).forEach((file, index) => {
586
+ const entry = this.ledger.files.get(file) ?? { added: 0, removed: 0, created };
587
+ // Line counts belong to the whole patch; the first file carries them so the totals stay exact.
588
+ if (index === 0) {
589
+ entry.added += diff.filter((line) => line.op === "+").length;
590
+ entry.removed += diff.filter((line) => line.op === "-").length;
591
+ }
592
+ this.ledger.files.set(file, entry);
593
+ });
594
+ }
595
+ else if (state.name === "write_file" && !failed) {
596
+ const file = stringArg(state.args, "path") ?? "?";
597
+ const content = stringArg(state.args, "content") ?? "";
598
+ const entry = this.ledger.files.get(file) ?? { added: 0, removed: 0, created: result.text.startsWith("created") };
599
+ entry.added += content === "" ? 0 : content.replace(/\r?\n$/, "").split(/\r?\n/).length;
600
+ this.ledger.files.set(file, entry);
601
+ }
602
+ else if (state.name === "exec" && state.args.background !== true && isTestCommand(argvOf(state.args))) {
603
+ const body = outputLines(result.text).join("\n");
604
+ const failures = testCount(body, "fail");
605
+ this.ledger.tests = { passed: testCount(body, "pass"), failed: failures === 0 ? undefined : failures, ok: !failed && result.exit_code === 0, exit: result.exit_code };
606
+ }
607
+ }
608
+ /** A search the provider ran natively inside the model turn (OpenAI hosted web_search). */
609
+ nativeSearch(event) {
610
+ const label = event.data.provider === "openai-hosted" ? "OpenAI" : event.data.provider === "claude-code" ? "Claude" : event.data.provider;
611
+ const summary = plural(event.data.sources, "source");
612
+ const state = {
613
+ id: this.nextId(),
614
+ name: "web_search",
615
+ args: { query: event.data.query },
616
+ status: "ok",
617
+ title: `Search (${label}) "${sanitizeInline(event.data.query, 80)}"`,
618
+ summary,
619
+ preview: [],
620
+ detail: [],
621
+ stat: summary,
622
+ group: undefined,
623
+ pending: [],
624
+ };
625
+ this.tools.set(state.id, state);
626
+ this.lastItem = state.id;
627
+ return [{ op: "append", item: this.toolView(state) }];
628
+ }
629
+ toolView(state) {
630
+ return {
631
+ kind: "tool",
632
+ id: state.id,
633
+ status: state.status,
634
+ title: state.title,
635
+ summary: state.summary,
636
+ preview: [...state.preview],
637
+ detail: [...state.detail],
638
+ stat: state.stat,
639
+ ...(state.background === undefined ? {} : { background: state.background }),
640
+ };
641
+ }
642
+ }
643
+ function usageTokens(usage) {
644
+ return (usage.input_tokens ?? 0) + (usage.output_tokens ?? 0);
645
+ }
646
+ /** Short footer name of a provider's subscription: `anthropic` -> `claude`, `openai` -> `chatgpt`. */
647
+ export function quotaProviderLabel(provider) {
648
+ if (provider === "anthropic")
649
+ return "claude";
650
+ if (provider === "openai")
651
+ return "chatgpt";
652
+ return sanitizeInline(provider, 16);
653
+ }
654
+ /**
655
+ * A `syn run` (or orchestrated) session: its goal and the orchestrator's own prompts. Inside a run
656
+ * (from `run/created` until the run reaches a terminal state) user-role messages are the planner's
657
+ * prompts, never something the person typed; the resume card shows `run: <goal>` instead.
658
+ */
659
+ export function runPrompts(events) {
660
+ const hidden = new Set();
661
+ let goal;
662
+ let active;
663
+ for (const event of events) {
664
+ if (event.type === "run/created") {
665
+ goal ??= event.data.goal;
666
+ active = event.run_id ?? "";
667
+ }
668
+ else if (event.type === "run/state_changed" && active !== undefined && (event.run_id ?? "") === active && RUN_ENDS.has(event.data.to)) {
669
+ active = undefined;
670
+ }
671
+ else if (active !== undefined && event.type === "message/recorded" && event.data.role === "user") {
672
+ hidden.add(event);
673
+ }
674
+ }
675
+ return { goal, hidden };
676
+ }
677
+ const RUN_ENDS = new Set(["completed", "failed", "cancelled"]);
678
+ function maxQuota(windows) {
679
+ if (windows.length === 0)
680
+ return undefined;
681
+ return Math.round(Math.max(...windows.map((window) => window.used_percent)));
682
+ }
683
+ export function formatTokens(tokens) {
684
+ if (tokens < 1000)
685
+ return String(tokens);
686
+ return `${(tokens / 1000).toFixed(tokens < 10_000 ? 1 : 0)}k`;
687
+ }
688
+ export function formatElapsed(ms) {
689
+ const seconds = Math.floor(ms / 1000);
690
+ if (seconds < 60)
691
+ return `${seconds}s`;
692
+ return `${Math.floor(seconds / 60)}m ${String(seconds % 60).padStart(2, "0")}s`;
693
+ }
694
+ /** The harness prefixes notes (an /undo) to the next user message; the transcript shows only what the user typed. */
695
+ function stripHarnessNotes(text) {
696
+ return text.replace(/^\[Synorch note:[^\]]*\]\s*/u, "");
697
+ }
698
+ function stringArg(args, key) {
699
+ const value = args[key];
700
+ return typeof value === "string" ? value : undefined;
701
+ }
702
+ function argvOf(args) {
703
+ const argv = args.argv;
704
+ return Array.isArray(argv) ? argv.filter((entry) => typeof entry === "string") : [];
705
+ }
706
+ const TEST_WORDS = /^(test|tests|vitest|jest|pytest|mocha|ava|tap|ctest|rspec|phpunit|--test)$/;
707
+ /** `npm test`, `pnpm run test`, `node --test`, `pytest -q`, `go test ./...`, `cargo test`. */
708
+ export function isTestCommand(argv) {
709
+ return argv.some((word, index) => {
710
+ const base = word.toLowerCase().replace(/\.(cmd|exe)$/, "").split(/[\\/]/).pop() ?? "";
711
+ return TEST_WORDS.test(base) || (index > 0 && /^test:[\w:-]+$/.test(base));
712
+ });
713
+ }
714
+ /** `12 passed`, `pass 12`, `ℹ pass 12`, `3 failed`; undefined when the output does not say. */
715
+ function testCount(body, kind) {
716
+ const word = kind === "pass" ? "pass(?:ed|ing)?" : "fail(?:ed|ing|ures?)?";
717
+ const after = new RegExp(`(?:^|\\s)(?:ℹ\\s+)?${word}\\s+(\\d+)`, "im").exec(body)?.[1];
718
+ const before = new RegExp(`(\\d+)\\s+${word}\\b`, "i").exec(body)?.[1];
719
+ const found = after ?? before;
720
+ return found === undefined ? undefined : Number(found);
721
+ }
722
+ /** The edit a pending apply_patch / write_file would make, for the approval prompt (≤ 12 lines). */
723
+ function pendingPreview(name, args) {
724
+ if (name === "apply_patch")
725
+ return patchDiff(stringArg(args, "patch") ?? "").slice(0, 12);
726
+ if (name === "write_file")
727
+ return (stringArg(args, "content") ?? "").split(/\r?\n/).slice(0, 12).map((text) => ({ op: "+", text: diffText(text) }));
728
+ return [];
729
+ }
730
+ function shortList(names) {
731
+ return names.length <= 2 ? names.join(", ") : `${names.slice(0, 2).join(", ")}, +${names.length - 2}`;
732
+ }
733
+ /** The files an apply_patch touches, in order (both patch formats). */
734
+ export function patchPaths(patch) {
735
+ const paths = [];
736
+ for (const line of patch.split(/\r?\n/)) {
737
+ const begin = /^\*\*\* (?:Update|Add|Delete) File: (.+)$/.exec(line) ?? /^\*\*\* Move to: (.+)$/.exec(line);
738
+ const unified = /^\+\+\+ (?:b\/)?(.+)$/.exec(line);
739
+ const found = begin?.[1] ?? (unified !== null && unified[1] !== "/dev/null" ? unified[1] : undefined);
740
+ if (found !== undefined && !paths.includes(found.trim()))
741
+ paths.push(found.trim());
742
+ }
743
+ if (paths.length === 0) {
744
+ for (const line of patch.split(/\r?\n/)) {
745
+ const removed = /^--- (?:a\/)?(.+)$/.exec(line);
746
+ if (removed?.[1] !== undefined && removed[1] !== "/dev/null")
747
+ paths.push(removed[1].trim());
748
+ }
749
+ }
750
+ return paths;
751
+ }
752
+ const CLAUDE_WRITE_TOOLS = new Set(["Edit", "Write", "MultiEdit", "NotebookEdit"]);
753
+ /** A Claude built-in's row title: `Bash pnpm test`, `Edit src/x.ts`, `Search (Claude) "q"`, `Fetch (Claude) host/path`. */
754
+ function claudeToolTitle(name, summary) {
755
+ const detail = sanitizeInline(summary, 2000);
756
+ const label = name === "WebSearch" ? "Search (Claude)" : name === "WebFetch" ? "Fetch (Claude)" : sanitizeInline(name, 40);
757
+ return detail === "" ? label : `${label} ${detail}`;
758
+ }
759
+ function toolTitle(name, args) {
760
+ switch (name) {
761
+ case "read_file":
762
+ return `Read ${stringArg(args, "path") ?? "?"}`;
763
+ case "list_dir":
764
+ return `List ${stringArg(args, "path") ?? "."}`;
765
+ case "search": {
766
+ const where = stringArg(args, "path");
767
+ return `Search "${sanitizeInline(stringArg(args, "pattern") ?? "", 60)}"${where === undefined || where === "." ? "" : ` in ${where}`}`;
768
+ }
769
+ case "apply_patch": {
770
+ const paths = patchPaths(stringArg(args, "patch") ?? "");
771
+ return `Edit ${paths.length === 0 ? "files" : paths.length === 1 ? paths[0] : `${paths[0]} +${paths.length - 1}`}`;
772
+ }
773
+ case "write_file":
774
+ return `Write ${stringArg(args, "path") ?? "?"}`;
775
+ case "exec": {
776
+ const command = sanitizeInline(argvOf(args).join(" "), 2000);
777
+ if (args.background !== true)
778
+ return `Run ${command}`;
779
+ const name = stringArg(args, "name");
780
+ return name === undefined ? `Start ${command}` : `${sanitizeInline(name, 40)} (${command})`;
781
+ }
782
+ case "glob": {
783
+ const where = stringArg(args, "path");
784
+ return `Find ${sanitizeInline(stringArg(args, "pattern") ?? "", 60)}${where === undefined || where === "." ? "" : ` in ${where}`}`;
785
+ }
786
+ case "todo":
787
+ return "Tasks";
788
+ case "process_output":
789
+ return `Output of ${stringArg(args, "handle") ?? "?"}`;
790
+ case "process_wait":
791
+ return `Wait for ${stringArg(args, "handle") ?? "?"}`;
792
+ case "process_kill":
793
+ return `Stop ${stringArg(args, "handle") ?? "?"}`;
794
+ case "process_list":
795
+ return "Background processes";
796
+ case "git_status":
797
+ return "Git status";
798
+ case "git_diff":
799
+ return "Git diff";
800
+ case "web_search":
801
+ return `Search "${sanitizeInline(stringArg(args, "query") ?? "", 80)}"`;
802
+ case "web_fetch":
803
+ return `Fetch ${sanitizeInline(shortUrl(stringArg(args, "url") ?? "?"), 100)}`;
804
+ case "orchestrate":
805
+ return `Workers ${sanitizeInline(stringArg(args, "goal") ?? "", 2000)}`.trimEnd();
806
+ default: {
807
+ const first = Object.values(args).find((value) => typeof value === "string");
808
+ return `${name}${first === undefined ? "" : ` ${sanitizeInline(first, 2000)}`}`;
809
+ }
810
+ }
811
+ }
812
+ /** `https://www.example.com/a/b?q` → `example.com/a/b?q` for a compact row. */
813
+ export function shortUrl(raw) {
814
+ try {
815
+ const url = new URL(raw);
816
+ const rest = `${url.pathname === "/" ? "" : url.pathname}${url.search}`;
817
+ return `${url.host.replace(/^www\./, "")}${rest}`;
818
+ }
819
+ catch {
820
+ return raw;
821
+ }
822
+ }
823
+ /** The `/allow` prefix to suggest for a refused argv: the program and, when it is not a flag, its first argument. */
824
+ export function allowPrefixFor(argv) {
825
+ const [program = "", first] = argv;
826
+ return first !== undefined && !first.startsWith("-") ? `${program} ${first}` : program;
827
+ }
828
+ /** `argv` is given only for the conversation agent: `/allow` never applies to a worker, so its refusal is explained instead. */
829
+ function denialSummary(reasons, argv, g) {
830
+ const codes = new Set(reasons.map((reason) => reason.code));
831
+ if (argv !== undefined && argv.length > 0 && reasons.some((reason) => reason.code === "exec-not-allowlisted" && reason.layer !== "role") && !reasons.some((reason) => /changes the repository|refused:/.test(reason.message))) {
832
+ return `not allowed here ${g.sep} type /allow ${allowPrefixFor(argv)} to permit it`;
833
+ }
834
+ if (codes.has("workspace-untrusted"))
835
+ return `runs repository code and this folder is not trusted ${g.sep} /trust to allow it`;
836
+ const first = reasons[0];
837
+ const message = first === undefined ? "blocked by policy" : first.message.replace(/^[^:]*? is refused: /, "");
838
+ return `blocked by policy ${g.sep} ${sanitizeInline(message, 160)}`;
839
+ }
840
+ function outputLines(text) {
841
+ const lines = text.split(/\r?\n/);
842
+ const body = [];
843
+ for (const line of lines.slice(2)) {
844
+ if (line === "--- stdout ---" || line === "--- stderr ---")
845
+ continue;
846
+ body.push(line);
847
+ }
848
+ while (body.length > 0 && body.at(-1)?.trim() === "")
849
+ body.pop();
850
+ return body;
851
+ }
852
+ function textLines(lines) {
853
+ return lines.map((text) => ({ op: " ", text: sanitizeInline(text, 2000) }));
854
+ }
855
+ function summarizeResult(name, args, result, durationMs, g) {
856
+ const failedText = friendlyError(result.error?.message ?? "failed");
857
+ const text = result.text;
858
+ switch (name) {
859
+ case "read_file": {
860
+ if (result.status === "error")
861
+ return { summary: failedText, preview: [], detail: [] };
862
+ const header = text.split("\n", 1)[0] ?? "";
863
+ const total = /of (\d+)\+?$/.exec(header.replace(/\s*\(.*\)$/, ""))?.[1];
864
+ const lines = text.split("\n").slice(1);
865
+ return { summary: header.includes("empty file") ? "empty file" : total === undefined ? "read" : plural(Number(total), "line"), preview: [], detail: textLines(lines.slice(0, DETAIL_LINES)) };
866
+ }
867
+ case "list_dir": {
868
+ if (result.status === "error")
869
+ return { summary: failedText, preview: [], detail: [] };
870
+ const entries = text === "(empty)" ? [] : text.split("\n").filter((line) => line.trim() !== "");
871
+ return { summary: plural(entries.length, "entry", "entries"), preview: [], detail: textLines(entries.slice(0, DETAIL_LINES)) };
872
+ }
873
+ case "search": {
874
+ if (result.status === "error")
875
+ return { summary: failedText, preview: [], detail: [] };
876
+ const matches = text === "(no matches)" ? [] : text.split("\n").filter((line) => /^[^:]+:\d+:/.test(line));
877
+ const files = new Set(matches.map((line) => line.split(":")[0]));
878
+ return { summary: matches.length === 0 ? "no matches" : `${matches.length} match${matches.length === 1 ? "" : "es"} in ${files.size} file${files.size === 1 ? "" : "s"}`, preview: [], detail: textLines(matches.slice(0, DETAIL_LINES)) };
879
+ }
880
+ case "apply_patch": {
881
+ if (result.status === "error")
882
+ return { summary: failedText, preview: [], detail: [] };
883
+ const diff = patchDiff(stringArg(args, "patch") ?? "");
884
+ const added = diff.filter((line) => line.op === "+").length;
885
+ const removed = diff.filter((line) => line.op === "-").length;
886
+ const preview = diff.slice(0, PREVIEW_LINES);
887
+ if (diff.length > PREVIEW_LINES)
888
+ preview.push({ op: "…", text: `+${diff.length - PREVIEW_LINES} lines (ctrl+o)` });
889
+ return { summary: `+${added} ${g.minus}${removed}`, preview, detail: diff };
890
+ }
891
+ case "write_file": {
892
+ if (result.status === "error")
893
+ return { summary: failedText, preview: [], detail: [] };
894
+ const content = stringArg(args, "content") ?? "";
895
+ const lines = content === "" ? 0 : content.replace(/\r?\n$/, "").split(/\r?\n/).length;
896
+ const created = text.startsWith("created");
897
+ return { summary: `${created ? "new file" : "rewritten"} ${g.sep} ${plural(lines, "line")}`, preview: [], detail: textLines(content.split(/\r?\n/).slice(0, DETAIL_LINES)) };
898
+ }
899
+ case "exec": {
900
+ if (args.background === true)
901
+ return backgroundSummary(result, g);
902
+ const body = outputLines(text);
903
+ const seconds = `${(durationMs / 1000).toFixed(1)}s`;
904
+ if (result.exit_code === undefined)
905
+ return { summary: `${g.fail} ${failedText}`, stat: failedText, preview: textLines(body.slice(-5)), detail: textLines(body.slice(-DETAIL_LINES)) };
906
+ if (result.exit_code === 0) {
907
+ const tests = /(?:^|\s)(?:ℹ\s+)?pass(?:ed)?\s+(\d+)/im.exec(body.join("\n"))?.[1] ?? /(\d+) passed/i.exec(body.join("\n"))?.[1];
908
+ return {
909
+ summary: `${g.ok} exit 0${tests === undefined ? "" : ` ${g.sep} ${tests} passed`} ${g.sep} ${seconds}`,
910
+ stat: `${tests === undefined ? "" : `${tests} passed ${g.sep} `}${seconds}`,
911
+ preview: [],
912
+ detail: textLines(body.slice(-DETAIL_LINES)),
913
+ };
914
+ }
915
+ const failures = testCount(body.join("\n"), "fail");
916
+ return {
917
+ summary: `${g.fail} exit ${result.exit_code} ${g.sep} ${seconds}`,
918
+ stat: `exit ${result.exit_code}${failures === undefined || failures === 0 ? "" : ` ${g.sep} ${failures} failed`} ${g.sep} ${seconds}`,
919
+ preview: textLines(body.slice(-5)),
920
+ detail: textLines(body.slice(-DETAIL_LINES)),
921
+ };
922
+ }
923
+ case "glob": {
924
+ if (result.status === "error")
925
+ return { summary: failedText, preview: [], detail: [] };
926
+ const [header = "", ...files] = text.split("\n");
927
+ const count = /^(\d+) files? match/.exec(header)?.[1];
928
+ return { summary: count === undefined ? "no files" : plural(Number(count), "file"), preview: [], detail: textLines(files.slice(0, DETAIL_LINES)) };
929
+ }
930
+ case "todo": {
931
+ if (result.status === "error")
932
+ return { summary: failedText, preview: [], detail: [] };
933
+ const items = todoItems(args);
934
+ if (items.length === 0)
935
+ return { summary: "checklist cleared", preview: [], detail: [] };
936
+ const done = items.filter((item) => item.status === "done").length;
937
+ const mark = (status) => (status === "done" ? g.ok : status === "in_progress" ? (g.name === "rich" ? "◐" : ">") : g.name === "rich" ? "○" : "o");
938
+ const lines = items.map((item) => ({ op: " ", text: `${mark(item.status)} ${sanitizeInline(item.text, 200)}` }));
939
+ const inline = items.map((item) => `${item.status === "done" ? "[x]" : item.status === "in_progress" ? "[>]" : "[ ]"} ${sanitizeInline(item.text, 80)}`).join("; ");
940
+ return { summary: `${done}/${items.length} done ${g.sep} ${inline}`, stat: `${done}/${items.length} done`, preview: lines.slice(0, 12), detail: lines };
941
+ }
942
+ case "process_output":
943
+ case "process_wait":
944
+ case "process_kill":
945
+ case "process_list": {
946
+ if (result.status === "error")
947
+ return { summary: failedText, preview: [], detail: [] };
948
+ const [first = "", ...rest] = text.split("\n");
949
+ const body = rest.filter((line) => !/^(output \d+-\d+|no new output|still running|wait cancelled)/.test(line));
950
+ if (name === "process_list")
951
+ return { summary: first === "no background processes" ? "none" : plural(text.split("\n").length, "process", "processes"), preview: [], detail: textLines(text.split("\n").slice(0, DETAIL_LINES)) };
952
+ const status = first.split(" · ").slice(2, 4).join(` ${g.sep} `);
953
+ const lines = rest.find((line) => line.startsWith("no new output")) !== undefined ? "no new output" : plural(body.length, "line");
954
+ return { summary: name === "process_kill" ? "stopped" : `${status}${name === "process_output" ? ` ${g.sep} ${lines}` : ""}`, preview: [], detail: textLines(body.slice(-DETAIL_LINES)) };
955
+ }
956
+ case "git_status": {
957
+ if (result.status === "error")
958
+ return { summary: failedText, preview: [], detail: [] };
959
+ const changed = text.split("\n").filter((line) => /^[ MADRCU?!]{2} /.test(line));
960
+ return { summary: changed.length === 0 ? "clean" : `${changed.length} changed`, preview: [], detail: textLines(changed.slice(0, DETAIL_LINES)) };
961
+ }
962
+ case "web_search": {
963
+ if (result.status === "error")
964
+ return { summary: failedText, preview: [], detail: [] };
965
+ const header = text.split("\n", 1)[0] ?? "";
966
+ const count = /: (\d+) results?$/.exec(header)?.[1];
967
+ const backend = / via ([\w-]+):/.exec(header)?.[1];
968
+ const titles = text.split("\n").filter((line) => /^\d+\. /.test(line));
969
+ const summary = `${count === undefined ? "done" : plural(Number(count), "result")}${backend === undefined ? "" : ` ${g.sep} ${backend}`}`;
970
+ return { summary, stat: summary, preview: [], detail: textLines(titles.slice(0, DETAIL_LINES)) };
971
+ }
972
+ case "web_fetch": {
973
+ if (result.status === "error")
974
+ return { summary: failedText, preview: [], detail: [] };
975
+ const header = text.split("\n", 1)[0] ?? "";
976
+ const size = /, (\d+(?:\.\d+)? (?:B|KB|MB))[,)]/.exec(header)?.[1];
977
+ const redirect = /redirects \(\d+\) to another host: (\S+)/.exec(header)?.[1];
978
+ const summary = redirect !== undefined ? `redirects to ${shortUrl(redirect)}` : (size ?? "read");
979
+ const title = /title: (.*?) chars \d+/.exec(header)?.[1];
980
+ return { summary, stat: summary, preview: [], detail: title === undefined ? [] : textLines([title]) };
981
+ }
982
+ case "orchestrate": {
983
+ if (result.status === "error")
984
+ return { summary: failedText, preview: [], detail: [] };
985
+ // K3: the background start is one concise line; the agent-facing instructions stay in the detail.
986
+ const started = /^Started worker run (\S+) in the background/.exec(text);
987
+ const lines = text.split("\n");
988
+ if (started !== null)
989
+ return { summary: `Workers running in background (${started[1]}) ${g.sep} keep chatting ${g.sep} /runs`, preview: [], detail: textLines(lines.slice(0, 20)) };
990
+ return { summary: sanitizeInline(lines[0] ?? "done", 600) || "done", preview: [], detail: textLines(lines.slice(0, 40)) };
991
+ }
992
+ default: {
993
+ if (result.status === "error")
994
+ return { summary: failedText, preview: [], detail: [] };
995
+ const lines = text.split("\n");
996
+ return { summary: sanitizeInline(lines[0] ?? "done", 600) || "done", preview: [], detail: textLines(lines.slice(0, 20)) };
997
+ }
998
+ }
999
+ }
1000
+ function todoItems(args) {
1001
+ const items = args.items;
1002
+ if (!Array.isArray(items))
1003
+ return [];
1004
+ return items.flatMap((item) => {
1005
+ if (typeof item !== "object" || item === null)
1006
+ return [];
1007
+ const record = item;
1008
+ return typeof record.text === "string" ? [{ text: record.text, status: typeof record.status === "string" ? record.status : "pending" }] : [];
1009
+ });
1010
+ }
1011
+ /** `exec {background: true}`: `running · p1` while it runs, or how it ended within the start window. */
1012
+ function backgroundSummary(result, g) {
1013
+ const [first = "", ...rest] = result.text.split("\n");
1014
+ const body = rest.slice(2);
1015
+ if (result.status === "error")
1016
+ return { summary: friendlyError(result.error?.message ?? "failed to start"), preview: textLines(body.slice(-5)), detail: textLines(body.slice(-DETAIL_LINES)) };
1017
+ const parts = first.split(" · ");
1018
+ const handle = parts[0] ?? "";
1019
+ const state = parts[2] ?? "";
1020
+ if (state === "running")
1021
+ return { summary: `running in the background ${g.sep} ${handle}`, stat: `running ${g.sep} ${handle}`, preview: [], detail: textLines(body.slice(-DETAIL_LINES)) };
1022
+ return { summary: `${state} ${g.sep} ${parts[3] ?? ""}`, stat: `${state} ${g.sep} ${parts[3] ?? ""}`, preview: textLines(body.slice(-5)), detail: textLines(body.slice(-DETAIL_LINES)) };
1023
+ }
1024
+ function plural(count, word, many = `${word}s`) {
1025
+ return `${count} ${count === 1 ? word : many}`;
1026
+ }
1027
+ const ERROR_WORDS = {
1028
+ ENOENT: "file not found",
1029
+ EACCES: "permission denied",
1030
+ EPERM: "not permitted",
1031
+ EISDIR: "is a folder, not a file",
1032
+ ENOTDIR: "not a folder",
1033
+ EEXIST: "already exists",
1034
+ ETIMEDOUT: "timed out",
1035
+ EBUSY: "file is busy (locked by another program)",
1036
+ };
1037
+ /**
1038
+ * Tool errors in plain words: `ENOENT … stat 'C:\\…\\missing.mjs'` becomes `file not found`;
1039
+ * absolute paths shrink to their file name (the tool line already names the file).
1040
+ */
1041
+ export function friendlyError(message) {
1042
+ const code = /\b(ENOENT|EACCES|EPERM|EISDIR|ENOTDIR|EEXIST|ETIMEDOUT|EBUSY)\b/.exec(message)?.[1];
1043
+ if (code !== undefined)
1044
+ return ERROR_WORDS[code] ?? code;
1045
+ return sanitizeInline(message.replace(/(?:[A-Za-z]:)?[\\/](?:[^\s'",:\\/]+[\\/])+([^\s'",:\\/]+)/g, "$1"), 200);
1046
+ }
1047
+ /** A diff line with its indentation kept (tabs as two spaces), control characters removed. */
1048
+ function diffText(text) {
1049
+ return sanitizeTerminalText(text).replaceAll("\t", " ").replace(/[\r\n]/g, "").slice(0, 300);
1050
+ }
1051
+ /** The -/+ lines of a patch in order, for the edit preview (context lines are left out). */
1052
+ export function patchDiff(patch) {
1053
+ const lines = [];
1054
+ let inAdd = false;
1055
+ for (const line of patch.split(/\r?\n/)) {
1056
+ if (/^\*\*\* Add File: /.test(line)) {
1057
+ inAdd = true;
1058
+ continue;
1059
+ }
1060
+ if (/^\*\*\* /.test(line)) {
1061
+ inAdd = false;
1062
+ continue;
1063
+ }
1064
+ if (line.startsWith("+++") || line.startsWith("---") || line.startsWith("@@"))
1065
+ continue;
1066
+ if (line.startsWith("+"))
1067
+ lines.push({ op: "+", text: diffText(line.slice(1)) });
1068
+ else if (line.startsWith("-"))
1069
+ lines.push({ op: "-", text: diffText(line.slice(1)) });
1070
+ else if (inAdd && line !== "")
1071
+ lines.push({ op: "+", text: diffText(line) });
1072
+ }
1073
+ return lines;
1074
+ }
1075
+ /** One-line header (TUI §8.1) and at most one warning line. */
1076
+ export function headerLines(options) {
1077
+ const g = options.glyphs;
1078
+ const title = [`Synorch ${options.version}`, `${options.folder}${options.branch === undefined ? "" : ` (${options.branch})`}`, options.model, options.mode]
1079
+ .filter((part) => part !== undefined && part !== "")
1080
+ .join(` ${g.sep} `);
1081
+ const warnings = [];
1082
+ if (options.sandboxEnforcement !== "full" && options.sandboxNoticeSeen !== true)
1083
+ warnings.push(`Sandbox is partial: allowed commands can write outside this folder ${g.sep} /permissions`);
1084
+ warnings.push(...options.warnings);
1085
+ if (warnings.length === 0)
1086
+ return { title, warning: undefined };
1087
+ const [first, ...rest] = warnings;
1088
+ return { title, warning: `${g.warn} ${first}${rest.length === 0 ? "" : ` ${g.sep} ${rest.length} more warning${rest.length === 1 ? "" : "s"} ${g.sep} syn doctor --runtime`}` };
1089
+ }
1090
+ /** `folder · branch · model · ctx 12% · quota 40%` (TUI §10.2, K0 subset). */
1091
+ export function footerText(footer, extra) {
1092
+ const g = extra.glyphs;
1093
+ return [
1094
+ extra.folder,
1095
+ extra.branch,
1096
+ footer.model === undefined ? undefined : footer.effort === undefined ? footer.model : `${footer.model} ${g.sep} ${footer.effort}`,
1097
+ extra.mode,
1098
+ footer.contextPercent === undefined ? undefined : `ctx ${footer.contextPercent}%`,
1099
+ footer.quotaPercent === undefined ? undefined : `quota ${footer.quotaPercent}%${footer.quotaProvider === undefined ? "" : ` ${footer.quotaProvider}`}`,
1100
+ footer.costUsd === undefined || footer.quotaPercent !== undefined ? undefined : `$${footer.costUsd.toFixed(2)}`,
1101
+ ]
1102
+ .filter((part) => part !== undefined && part !== "")
1103
+ .join(` ${g.sep} `);
1104
+ }
1105
+ /** `⠼ Thinking… 14s · 2.1k tokens · esc to interrupt` (TUI §10.1). */
1106
+ export function activityText(activity, now, frame, glyphs) {
1107
+ const g = glyphs;
1108
+ const parts = [`${activity.waiting ? "?" : frame} ${activity.verb}${activity.detail === undefined ? "" : ` ${activity.detail}`}${g.name === "ascii" ? "..." : "…"}`, formatElapsed(now - activity.startedAt)];
1109
+ if (activity.tokens > 0)
1110
+ parts.push(`${formatTokens(activity.tokens)} tokens`);
1111
+ if (!activity.waiting)
1112
+ parts.push("esc to interrupt");
1113
+ return parts.join(` ${g.sep} `);
1114
+ }
1115
+ //# sourceMappingURL=conversation-view.js.map