@m4ike1/ion-agent-core 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (370) hide show
  1. package/README.md +622 -0
  2. package/dist/agent-loop.d.ts +24 -0
  3. package/dist/agent-loop.d.ts.map +1 -0
  4. package/dist/agent-loop.js +560 -0
  5. package/dist/agent-loop.js.map +1 -0
  6. package/dist/agent.d.ts +122 -0
  7. package/dist/agent.d.ts.map +1 -0
  8. package/dist/agent.js +422 -0
  9. package/dist/agent.js.map +1 -0
  10. package/dist/harness/agent-harness.d.ts +716 -0
  11. package/dist/harness/agent-harness.d.ts.map +1 -0
  12. package/dist/harness/agent-harness.js +6 -0
  13. package/dist/harness/agent-harness.js.map +1 -0
  14. package/dist/harness/compaction/branch-summarization.d.ts +68 -0
  15. package/dist/harness/compaction/branch-summarization.d.ts.map +1 -0
  16. package/dist/harness/compaction/branch-summarization.js +176 -0
  17. package/dist/harness/compaction/branch-summarization.js.map +1 -0
  18. package/dist/harness/compaction/compaction.d.ts +126 -0
  19. package/dist/harness/compaction/compaction.d.ts.map +1 -0
  20. package/dist/harness/compaction/compaction.js +560 -0
  21. package/dist/harness/compaction/compaction.js.map +1 -0
  22. package/dist/harness/compaction/utils.d.ts +25 -0
  23. package/dist/harness/compaction/utils.d.ts.map +1 -0
  24. package/dist/harness/compaction/utils.js +120 -0
  25. package/dist/harness/compaction/utils.js.map +1 -0
  26. package/dist/harness/config.d.ts +9 -0
  27. package/dist/harness/config.d.ts.map +1 -0
  28. package/dist/harness/config.js +35 -0
  29. package/dist/harness/config.js.map +1 -0
  30. package/dist/harness/context.d.ts +9 -0
  31. package/dist/harness/context.d.ts.map +1 -0
  32. package/dist/harness/context.js +13 -0
  33. package/dist/harness/context.js.map +1 -0
  34. package/dist/harness/env/nodejs.d.ts +43 -0
  35. package/dist/harness/env/nodejs.d.ts.map +1 -0
  36. package/dist/harness/env/nodejs.js +865 -0
  37. package/dist/harness/env/nodejs.js.map +1 -0
  38. package/dist/harness/events.d.ts +25 -0
  39. package/dist/harness/events.d.ts.map +1 -0
  40. package/dist/harness/events.js +250 -0
  41. package/dist/harness/events.js.map +1 -0
  42. package/dist/harness/execution/assistant.d.ts +42 -0
  43. package/dist/harness/execution/assistant.d.ts.map +1 -0
  44. package/dist/harness/execution/assistant.js +82 -0
  45. package/dist/harness/execution/assistant.js.map +1 -0
  46. package/dist/harness/execution/effect-gate.d.ts +22 -0
  47. package/dist/harness/execution/effect-gate.d.ts.map +1 -0
  48. package/dist/harness/execution/effect-gate.js +49 -0
  49. package/dist/harness/execution/effect-gate.js.map +1 -0
  50. package/dist/harness/execution/tools.d.ts +67 -0
  51. package/dist/harness/execution/tools.d.ts.map +1 -0
  52. package/dist/harness/execution/tools.js +121 -0
  53. package/dist/harness/execution/tools.js.map +1 -0
  54. package/dist/harness/hooks.d.ts +38 -0
  55. package/dist/harness/hooks.d.ts.map +1 -0
  56. package/dist/harness/hooks.js +406 -0
  57. package/dist/harness/hooks.js.map +1 -0
  58. package/dist/harness/messages.d.ts +51 -0
  59. package/dist/harness/messages.d.ts.map +1 -0
  60. package/dist/harness/messages.js +102 -0
  61. package/dist/harness/messages.js.map +1 -0
  62. package/dist/harness/prompt-templates.d.ts +49 -0
  63. package/dist/harness/prompt-templates.d.ts.map +1 -0
  64. package/dist/harness/prompt-templates.js +225 -0
  65. package/dist/harness/prompt-templates.js.map +1 -0
  66. package/dist/harness/result.d.ts +133 -0
  67. package/dist/harness/result.d.ts.map +1 -0
  68. package/dist/harness/result.js +81 -0
  69. package/dist/harness/result.js.map +1 -0
  70. package/dist/harness/runtime/drive/boundary.d.ts +28 -0
  71. package/dist/harness/runtime/drive/boundary.d.ts.map +1 -0
  72. package/dist/harness/runtime/drive/boundary.js +173 -0
  73. package/dist/harness/runtime/drive/boundary.js.map +1 -0
  74. package/dist/harness/runtime/drive/checkpoint.d.ts +8 -0
  75. package/dist/harness/runtime/drive/checkpoint.d.ts.map +1 -0
  76. package/dist/harness/runtime/drive/checkpoint.js +133 -0
  77. package/dist/harness/runtime/drive/checkpoint.js.map +1 -0
  78. package/dist/harness/runtime/drive/deferred.d.ts +15 -0
  79. package/dist/harness/runtime/drive/deferred.d.ts.map +1 -0
  80. package/dist/harness/runtime/drive/deferred.js +179 -0
  81. package/dist/harness/runtime/drive/deferred.js.map +1 -0
  82. package/dist/harness/runtime/drive/generation.d.ts +8 -0
  83. package/dist/harness/runtime/drive/generation.d.ts.map +1 -0
  84. package/dist/harness/runtime/drive/generation.js +205 -0
  85. package/dist/harness/runtime/drive/generation.js.map +1 -0
  86. package/dist/harness/runtime/drive/reconcile.d.ts +5 -0
  87. package/dist/harness/runtime/drive/reconcile.d.ts.map +1 -0
  88. package/dist/harness/runtime/drive/reconcile.js +140 -0
  89. package/dist/harness/runtime/drive/reconcile.js.map +1 -0
  90. package/dist/harness/runtime/drive/recovery.d.ts +8 -0
  91. package/dist/harness/runtime/drive/recovery.d.ts.map +1 -0
  92. package/dist/harness/runtime/drive/recovery.js +85 -0
  93. package/dist/harness/runtime/drive/recovery.js.map +1 -0
  94. package/dist/harness/runtime/drive/response.d.ts +23 -0
  95. package/dist/harness/runtime/drive/response.d.ts.map +1 -0
  96. package/dist/harness/runtime/drive/response.js +394 -0
  97. package/dist/harness/runtime/drive/response.js.map +1 -0
  98. package/dist/harness/runtime/drive/retry.d.ts +4 -0
  99. package/dist/harness/runtime/drive/retry.d.ts.map +1 -0
  100. package/dist/harness/runtime/drive/retry.js +34 -0
  101. package/dist/harness/runtime/drive/retry.js.map +1 -0
  102. package/dist/harness/runtime/drive/structural.d.ts +32 -0
  103. package/dist/harness/runtime/drive/structural.d.ts.map +1 -0
  104. package/dist/harness/runtime/drive/structural.js +929 -0
  105. package/dist/harness/runtime/drive/structural.js.map +1 -0
  106. package/dist/harness/runtime/drive/terminal.d.ts +7 -0
  107. package/dist/harness/runtime/drive/terminal.d.ts.map +1 -0
  108. package/dist/harness/runtime/drive/terminal.js +49 -0
  109. package/dist/harness/runtime/drive/terminal.js.map +1 -0
  110. package/dist/harness/runtime/drive/tool-placement.d.ts +14 -0
  111. package/dist/harness/runtime/drive/tool-placement.d.ts.map +1 -0
  112. package/dist/harness/runtime/drive/tool-placement.js +244 -0
  113. package/dist/harness/runtime/drive/tool-placement.js.map +1 -0
  114. package/dist/harness/runtime/drive/tools.d.ts +6 -0
  115. package/dist/harness/runtime/drive/tools.d.ts.map +1 -0
  116. package/dist/harness/runtime/drive/tools.js +449 -0
  117. package/dist/harness/runtime/drive/tools.js.map +1 -0
  118. package/dist/harness/runtime/drive.d.ts +6 -0
  119. package/dist/harness/runtime/drive.d.ts.map +1 -0
  120. package/dist/harness/runtime/drive.js +93 -0
  121. package/dist/harness/runtime/drive.js.map +1 -0
  122. package/dist/harness/runtime/harness.d.ts +59 -0
  123. package/dist/harness/runtime/harness.d.ts.map +1 -0
  124. package/dist/harness/runtime/harness.js +311 -0
  125. package/dist/harness/runtime/harness.js.map +1 -0
  126. package/dist/harness/runtime/index.d.ts +2 -0
  127. package/dist/harness/runtime/index.d.ts.map +1 -0
  128. package/dist/harness/runtime/index.js +2 -0
  129. package/dist/harness/runtime/index.js.map +1 -0
  130. package/dist/harness/runtime/lane.d.ts +101 -0
  131. package/dist/harness/runtime/lane.d.ts.map +1 -0
  132. package/dist/harness/runtime/lane.js +1575 -0
  133. package/dist/harness/runtime/lane.js.map +1 -0
  134. package/dist/harness/runtime/progress.d.ts +15 -0
  135. package/dist/harness/runtime/progress.d.ts.map +1 -0
  136. package/dist/harness/runtime/progress.js +66 -0
  137. package/dist/harness/runtime/progress.js.map +1 -0
  138. package/dist/harness/runtime/reducer.d.ts +5 -0
  139. package/dist/harness/runtime/reducer.d.ts.map +1 -0
  140. package/dist/harness/runtime/reducer.js +240 -0
  141. package/dist/harness/runtime/reducer.js.map +1 -0
  142. package/dist/harness/runtime/restore.d.ts +24 -0
  143. package/dist/harness/runtime/restore.d.ts.map +1 -0
  144. package/dist/harness/runtime/restore.js +117 -0
  145. package/dist/harness/runtime/restore.js.map +1 -0
  146. package/dist/harness/runtime/transcript.d.ts +21 -0
  147. package/dist/harness/runtime/transcript.d.ts.map +1 -0
  148. package/dist/harness/runtime/transcript.js +72 -0
  149. package/dist/harness/runtime/transcript.js.map +1 -0
  150. package/dist/harness/runtime/types.d.ts +105 -0
  151. package/dist/harness/runtime/types.d.ts.map +1 -0
  152. package/dist/harness/runtime/types.js +61 -0
  153. package/dist/harness/runtime/types.js.map +1 -0
  154. package/dist/harness/session/commit.d.ts +53 -0
  155. package/dist/harness/session/commit.d.ts.map +1 -0
  156. package/dist/harness/session/commit.js +57 -0
  157. package/dist/harness/session/commit.js.map +1 -0
  158. package/dist/harness/session/context.d.ts +10 -0
  159. package/dist/harness/session/context.d.ts.map +1 -0
  160. package/dist/harness/session/context.js +49 -0
  161. package/dist/harness/session/context.js.map +1 -0
  162. package/dist/harness/session/fork-policy.d.ts +21 -0
  163. package/dist/harness/session/fork-policy.d.ts.map +1 -0
  164. package/dist/harness/session/fork-policy.js +55 -0
  165. package/dist/harness/session/fork-policy.js.map +1 -0
  166. package/dist/harness/session/fork.d.ts +16 -0
  167. package/dist/harness/session/fork.d.ts.map +1 -0
  168. package/dist/harness/session/fork.js +79 -0
  169. package/dist/harness/session/fork.js.map +1 -0
  170. package/dist/harness/session/in-memory-storage-state.d.ts +39 -0
  171. package/dist/harness/session/in-memory-storage-state.d.ts.map +1 -0
  172. package/dist/harness/session/in-memory-storage-state.js +276 -0
  173. package/dist/harness/session/in-memory-storage-state.js.map +1 -0
  174. package/dist/harness/session/index.d.ts +11 -0
  175. package/dist/harness/session/index.d.ts.map +1 -0
  176. package/dist/harness/session/index.js +9 -0
  177. package/dist/harness/session/index.js.map +1 -0
  178. package/dist/harness/session/jsonl/codec.d.ts +21 -0
  179. package/dist/harness/session/jsonl/codec.d.ts.map +1 -0
  180. package/dist/harness/session/jsonl/codec.js +45 -0
  181. package/dist/harness/session/jsonl/codec.js.map +1 -0
  182. package/dist/harness/session/jsonl/fork.d.ts +38 -0
  183. package/dist/harness/session/jsonl/fork.d.ts.map +1 -0
  184. package/dist/harness/session/jsonl/fork.js +264 -0
  185. package/dist/harness/session/jsonl/fork.js.map +1 -0
  186. package/dist/harness/session/jsonl/index.d.ts +4 -0
  187. package/dist/harness/session/jsonl/index.d.ts.map +1 -0
  188. package/dist/harness/session/jsonl/index.js +4 -0
  189. package/dist/harness/session/jsonl/index.js.map +1 -0
  190. package/dist/harness/session/jsonl/io.d.ts +14 -0
  191. package/dist/harness/session/jsonl/io.d.ts.map +1 -0
  192. package/dist/harness/session/jsonl/io.js +86 -0
  193. package/dist/harness/session/jsonl/io.js.map +1 -0
  194. package/dist/harness/session/jsonl/legacy-v3.d.ts +43 -0
  195. package/dist/harness/session/jsonl/legacy-v3.d.ts.map +1 -0
  196. package/dist/harness/session/jsonl/legacy-v3.js +462 -0
  197. package/dist/harness/session/jsonl/legacy-v3.js.map +1 -0
  198. package/dist/harness/session/jsonl/repo.d.ts +35 -0
  199. package/dist/harness/session/jsonl/repo.d.ts.map +1 -0
  200. package/dist/harness/session/jsonl/repo.js +301 -0
  201. package/dist/harness/session/jsonl/repo.js.map +1 -0
  202. package/dist/harness/session/jsonl/storage.d.ts +40 -0
  203. package/dist/harness/session/jsonl/storage.d.ts.map +1 -0
  204. package/dist/harness/session/jsonl/storage.js +200 -0
  205. package/dist/harness/session/jsonl/storage.js.map +1 -0
  206. package/dist/harness/session/jsonl/types.d.ts +39 -0
  207. package/dist/harness/session/jsonl/types.d.ts.map +1 -0
  208. package/dist/harness/session/jsonl/types.js +3 -0
  209. package/dist/harness/session/jsonl/types.js.map +1 -0
  210. package/dist/harness/session/memory.d.ts +48 -0
  211. package/dist/harness/session/memory.d.ts.map +1 -0
  212. package/dist/harness/session/memory.js +369 -0
  213. package/dist/harness/session/memory.js.map +1 -0
  214. package/dist/harness/session/mutation-line.d.ts +8 -0
  215. package/dist/harness/session/mutation-line.d.ts.map +1 -0
  216. package/dist/harness/session/mutation-line.js +21 -0
  217. package/dist/harness/session/mutation-line.js.map +1 -0
  218. package/dist/harness/session/session.d.ts +82 -0
  219. package/dist/harness/session/session.d.ts.map +1 -0
  220. package/dist/harness/session/session.js +361 -0
  221. package/dist/harness/session/session.js.map +1 -0
  222. package/dist/harness/session/testing/benchmark/datasets.d.ts +12 -0
  223. package/dist/harness/session/testing/benchmark/datasets.d.ts.map +1 -0
  224. package/dist/harness/session/testing/benchmark/datasets.js +24 -0
  225. package/dist/harness/session/testing/benchmark/datasets.js.map +1 -0
  226. package/dist/harness/session/testing/benchmark/session-repo.d.ts +42 -0
  227. package/dist/harness/session/testing/benchmark/session-repo.d.ts.map +1 -0
  228. package/dist/harness/session/testing/benchmark/session-repo.js +127 -0
  229. package/dist/harness/session/testing/benchmark/session-repo.js.map +1 -0
  230. package/dist/harness/session/testing/benchmark/storage.d.ts +25 -0
  231. package/dist/harness/session/testing/benchmark/storage.d.ts.map +1 -0
  232. package/dist/harness/session/testing/benchmark/storage.js +114 -0
  233. package/dist/harness/session/testing/benchmark/storage.js.map +1 -0
  234. package/dist/harness/session/testing/conformance/session-repo.d.ts +23 -0
  235. package/dist/harness/session/testing/conformance/session-repo.d.ts.map +1 -0
  236. package/dist/harness/session/testing/conformance/session-repo.js +809 -0
  237. package/dist/harness/session/testing/conformance/session-repo.js.map +1 -0
  238. package/dist/harness/session/testing/conformance/storage.d.ts +4 -0
  239. package/dist/harness/session/testing/conformance/storage.d.ts.map +1 -0
  240. package/dist/harness/session/testing/conformance/storage.js +600 -0
  241. package/dist/harness/session/testing/conformance/storage.js.map +1 -0
  242. package/dist/harness/session/testing/gating-storage.d.ts +26 -0
  243. package/dist/harness/session/testing/gating-storage.d.ts.map +1 -0
  244. package/dist/harness/session/testing/gating-storage.js +100 -0
  245. package/dist/harness/session/testing/gating-storage.js.map +1 -0
  246. package/dist/harness/session/testing/index.d.ts +10 -0
  247. package/dist/harness/session/testing/index.d.ts.map +1 -0
  248. package/dist/harness/session/testing/index.js +9 -0
  249. package/dist/harness/session/testing/index.js.map +1 -0
  250. package/dist/harness/session/testing/instrumented-storage.d.ts +11 -0
  251. package/dist/harness/session/testing/instrumented-storage.d.ts.map +1 -0
  252. package/dist/harness/session/testing/instrumented-storage.js +16 -0
  253. package/dist/harness/session/testing/instrumented-storage.js.map +1 -0
  254. package/dist/harness/session/testing/storage-decorator.d.ts +20 -0
  255. package/dist/harness/session/testing/storage-decorator.d.ts.map +1 -0
  256. package/dist/harness/session/testing/storage-decorator.js +41 -0
  257. package/dist/harness/session/testing/storage-decorator.js.map +1 -0
  258. package/dist/harness/session/testing/types.d.ts +12 -0
  259. package/dist/harness/session/testing/types.d.ts.map +1 -0
  260. package/dist/harness/session/testing/types.js +2 -0
  261. package/dist/harness/session/testing/types.js.map +1 -0
  262. package/dist/harness/session/types.d.ts +512 -0
  263. package/dist/harness/session/types.d.ts.map +1 -0
  264. package/dist/harness/session/types.js +9 -0
  265. package/dist/harness/session/types.js.map +1 -0
  266. package/dist/harness/session/values.d.ts +95 -0
  267. package/dist/harness/session/values.d.ts.map +1 -0
  268. package/dist/harness/session/values.js +81 -0
  269. package/dist/harness/session/values.js.map +1 -0
  270. package/dist/harness/skills.d.ts +46 -0
  271. package/dist/harness/skills.d.ts.map +1 -0
  272. package/dist/harness/skills.js +326 -0
  273. package/dist/harness/skills.js.map +1 -0
  274. package/dist/harness/system-prompt.d.ts +3 -0
  275. package/dist/harness/system-prompt.d.ts.map +1 -0
  276. package/dist/harness/system-prompt.js +30 -0
  277. package/dist/harness/system-prompt.js.map +1 -0
  278. package/dist/harness/telemetry.d.ts +1242 -0
  279. package/dist/harness/telemetry.d.ts.map +1 -0
  280. package/dist/harness/telemetry.js +527 -0
  281. package/dist/harness/telemetry.js.map +1 -0
  282. package/dist/harness/tools/bash.d.ts +27 -0
  283. package/dist/harness/tools/bash.d.ts.map +1 -0
  284. package/dist/harness/tools/bash.js +105 -0
  285. package/dist/harness/tools/bash.js.map +1 -0
  286. package/dist/harness/tools/edit-diff.d.ts +89 -0
  287. package/dist/harness/tools/edit-diff.d.ts.map +1 -0
  288. package/dist/harness/tools/edit-diff.js +386 -0
  289. package/dist/harness/tools/edit-diff.js.map +1 -0
  290. package/dist/harness/tools/edit.d.ts +19 -0
  291. package/dist/harness/tools/edit.d.ts.map +1 -0
  292. package/dist/harness/tools/edit.js +108 -0
  293. package/dist/harness/tools/edit.js.map +1 -0
  294. package/dist/harness/tools/file-mutation-queue.d.ts +5 -0
  295. package/dist/harness/tools/file-mutation-queue.d.ts.map +1 -0
  296. package/dist/harness/tools/file-mutation-queue.js +46 -0
  297. package/dist/harness/tools/file-mutation-queue.js.map +1 -0
  298. package/dist/harness/tools/image.d.ts +3 -0
  299. package/dist/harness/tools/image.d.ts.map +1 -0
  300. package/dist/harness/tools/image.js +106 -0
  301. package/dist/harness/tools/image.js.map +1 -0
  302. package/dist/harness/tools/index.d.ts +6 -0
  303. package/dist/harness/tools/index.d.ts.map +1 -0
  304. package/dist/harness/tools/index.js +5 -0
  305. package/dist/harness/tools/index.js.map +1 -0
  306. package/dist/harness/tools/path-utils.d.ts +5 -0
  307. package/dist/harness/tools/path-utils.d.ts.map +1 -0
  308. package/dist/harness/tools/path-utils.js +26 -0
  309. package/dist/harness/tools/path-utils.js.map +1 -0
  310. package/dist/harness/tools/read.d.ts +35 -0
  311. package/dist/harness/tools/read.d.ts.map +1 -0
  312. package/dist/harness/tools/read.js +108 -0
  313. package/dist/harness/tools/read.js.map +1 -0
  314. package/dist/harness/tools/tool-context.d.ts +6 -0
  315. package/dist/harness/tools/tool-context.d.ts.map +1 -0
  316. package/dist/harness/tools/tool-context.js +2 -0
  317. package/dist/harness/tools/tool-context.js.map +1 -0
  318. package/dist/harness/tools/write.d.ts +11 -0
  319. package/dist/harness/tools/write.d.ts.map +1 -0
  320. package/dist/harness/tools/write.js +31 -0
  321. package/dist/harness/tools/write.js.map +1 -0
  322. package/dist/harness/types.d.ts +305 -0
  323. package/dist/harness/types.d.ts.map +1 -0
  324. package/dist/harness/types.js +75 -0
  325. package/dist/harness/types.js.map +1 -0
  326. package/dist/harness/utils/adaptive-publisher.d.ts +24 -0
  327. package/dist/harness/utils/adaptive-publisher.d.ts.map +1 -0
  328. package/dist/harness/utils/adaptive-publisher.js +79 -0
  329. package/dist/harness/utils/adaptive-publisher.js.map +1 -0
  330. package/dist/harness/utils/output-capture.d.ts +31 -0
  331. package/dist/harness/utils/output-capture.d.ts.map +1 -0
  332. package/dist/harness/utils/output-capture.js +217 -0
  333. package/dist/harness/utils/output-capture.js.map +1 -0
  334. package/dist/harness/utils/shell-output.d.ts +29 -0
  335. package/dist/harness/utils/shell-output.d.ts.map +1 -0
  336. package/dist/harness/utils/shell-output.js +71 -0
  337. package/dist/harness/utils/shell-output.js.map +1 -0
  338. package/dist/harness/utils/truncate.d.ts +71 -0
  339. package/dist/harness/utils/truncate.d.ts.map +1 -0
  340. package/dist/harness/utils/truncate.js +296 -0
  341. package/dist/harness/utils/truncate.js.map +1 -0
  342. package/dist/harness/utils/usage.d.ts +4 -0
  343. package/dist/harness/utils/usage.d.ts.map +1 -0
  344. package/dist/harness/utils/usage.js +33 -0
  345. package/dist/harness/utils/usage.js.map +1 -0
  346. package/dist/index.d.ts +28 -0
  347. package/dist/index.d.ts.map +1 -0
  348. package/dist/index.js +26 -0
  349. package/dist/index.js.map +1 -0
  350. package/dist/node.d.ts +3 -0
  351. package/dist/node.d.ts.map +1 -0
  352. package/dist/node.js +3 -0
  353. package/dist/node.js.map +1 -0
  354. package/dist/proxy.d.ts +72 -0
  355. package/dist/proxy.d.ts.map +1 -0
  356. package/dist/proxy.js +310 -0
  357. package/dist/proxy.js.map +1 -0
  358. package/dist/search/index.d.ts +29 -0
  359. package/dist/search/index.d.ts.map +1 -0
  360. package/dist/search/index.js +2 -0
  361. package/dist/search/index.js.map +1 -0
  362. package/dist/stream-fn.d.ts +10 -0
  363. package/dist/stream-fn.d.ts.map +1 -0
  364. package/dist/stream-fn.js +17 -0
  365. package/dist/stream-fn.js.map +1 -0
  366. package/dist/types.d.ts +416 -0
  367. package/dist/types.d.ts.map +1 -0
  368. package/dist/types.js +2 -0
  369. package/dist/types.js.map +1 -0
  370. package/package.json +89 -0
@@ -0,0 +1,716 @@
1
+ import type { JsonRepresentation } from "@m4ike1/chord";
2
+ import type { Api, AssistantMessage, AssistantMessageEvent, AssistantMessageFrame, DeferredHandle, ImageContent, Message, Model, Models, RetryPolicy, ToolResultMessage, Usage } from "@m4ike1/ion-ai";
3
+ import type { AgentMessage, AgentToolResult, QueueMode, ThinkingLevel } from "../types.ts";
4
+ import type { BranchPreparation, BranchSummaryResult } from "./compaction/branch-summarization.ts";
5
+ import type { CompactionPreparation, CompactionSettings, CompactResult } from "./compaction/compaction.ts";
6
+ import type { Context } from "./context.ts";
7
+ import type { Closed, InvalidMessage, InvalidNavigation, LaneBusy, NoActiveOperation, NothingToCompact, NothingToResume, OperationMismatch, Result, UnknownSkill, UnknownTarget, UnknownTemplate } from "./result.ts";
8
+ export { Closed, HarnessClosed, HarnessFault, InvalidLane, InvalidMessage, InvalidNavigation, LaneBusy, NoActiveOperation, NoActiveRun, NothingToCompact, NothingToResume, OperationMismatch, UnknownSkill, UnknownTarget, UnknownTemplate, } from "./result.ts";
9
+ export { SliceNotImplemented } from "./runtime/types.ts";
10
+ import { createAgentHarness } from "./runtime/harness.ts";
11
+ import type { BranchScan, Entry, EntryProjector, JsonValue, LaneConfiguration, OperationError, OperationResultRecord, Session, SessionStats, SettledAssistantMessage, UsageRow } from "./session/types.ts";
12
+ import type { AgentHarnessResources, AgentHarnessStreamOptions, AgentHarnessStreamOptionsPatch, AgentHarnessTool, PromptTemplate, Skill } from "./types.ts";
13
+ /** Convenience-only suspended run observation, constructed when M8 exposes public drive. */
14
+ export interface SuspendedRun {
15
+ operationId: string;
16
+ status: "suspended";
17
+ deferred: DeferredHandle;
18
+ }
19
+ export type RunResult = Result<OperationResultRecord | SuspendedRun, LaneBusy | InvalidMessage | UnknownSkill | UnknownTemplate | Closed>;
20
+ export type CompactionResult = Result<{
21
+ compaction: OperationResultRecord;
22
+ run?: OperationResultRecord | SuspendedRun;
23
+ }, LaneBusy | NothingToCompact | Closed>;
24
+ export type NavigationResult = Result<{
25
+ navigation: OperationResultRecord;
26
+ run?: OperationResultRecord | SuspendedRun;
27
+ }, LaneBusy | InvalidNavigation | UnknownTarget | Closed>;
28
+ export type ResumeResult = Result<OperationResultRecord | SuspendedRun, NothingToResume | Closed>;
29
+ export type QueueResult = Result<{
30
+ entryId: string;
31
+ }, InvalidMessage | Closed>;
32
+ export type CancelQueuedResult = Result<{
33
+ kind: "cancelled" | "already_consumed" | "not_found";
34
+ }, Closed>;
35
+ export type AbortResult = Result<{
36
+ operationId: string;
37
+ steer: AgentMessage[];
38
+ followUp: AgentMessage[];
39
+ }, NoActiveOperation | Closed>;
40
+ export type RecordUsageResult = Result<{
41
+ usageId: string;
42
+ }, Closed>;
43
+ export interface NavigateOptions {
44
+ summarize?: boolean;
45
+ label?: string;
46
+ customInstructions?: string;
47
+ }
48
+ export type OperationRequest = {
49
+ kind: "prompt";
50
+ operationId?: string;
51
+ prompt: string;
52
+ images?: ImageContent[];
53
+ } | {
54
+ kind: "prompt";
55
+ operationId?: string;
56
+ prompt: AgentMessage | AgentMessage[];
57
+ images?: never;
58
+ } | {
59
+ kind: "skill";
60
+ operationId?: string;
61
+ name: string;
62
+ additionalInstructions?: string;
63
+ } | {
64
+ kind: "prompt_template";
65
+ operationId?: string;
66
+ name: string;
67
+ args?: string[];
68
+ } | {
69
+ kind: "compaction";
70
+ operationId?: string;
71
+ customInstructions?: string;
72
+ } | {
73
+ kind: "navigation";
74
+ operationId?: string;
75
+ targetId: string | null;
76
+ options?: NavigateOptions;
77
+ };
78
+ export interface OperationAdmission {
79
+ operationId: string;
80
+ kind: "run" | "compaction" | "navigation";
81
+ startedAt: number;
82
+ }
83
+ export type OperationAdmissionError = LaneBusy | InvalidMessage | UnknownSkill | UnknownTemplate | NothingToCompact | InvalidNavigation | UnknownTarget | Closed;
84
+ export type OperationAdmissionResult = Result<OperationAdmission, OperationAdmissionError>;
85
+ export interface DriveOptions {
86
+ operationId: string;
87
+ waitForRetry?: boolean;
88
+ pollDeferred?: boolean;
89
+ }
90
+ export interface ModelIdentity {
91
+ provider: string;
92
+ modelId: string;
93
+ }
94
+ export type OperationStatus = "running" | "open" | "aborting";
95
+ export interface CurrentOperationInfo {
96
+ id: string;
97
+ kind: "run" | "compaction" | "navigation";
98
+ startedAt: number;
99
+ status: OperationStatus;
100
+ capturedModel?: ModelIdentity;
101
+ }
102
+ export interface LaneExecutionInfo {
103
+ lane: string;
104
+ tipId: string | null;
105
+ configuredModel: ModelIdentity;
106
+ current: CurrentOperationInfo | null;
107
+ lastOperationId: string | null;
108
+ }
109
+ export type DriveOutcome = {
110
+ kind: "settled";
111
+ outcome: OperationResultRecord;
112
+ } | {
113
+ kind: "waiting";
114
+ operationId: string;
115
+ reason: "retry";
116
+ notBefore: number;
117
+ } | {
118
+ kind: "waiting";
119
+ operationId: string;
120
+ reason: "deferred";
121
+ deferred: DeferredHandle;
122
+ };
123
+ export type DriveResult = Result<DriveOutcome, OperationMismatch | Closed>;
124
+ export type AbortRequestResult = Result<{
125
+ operationId: string;
126
+ newlyRequested: boolean;
127
+ steer: AgentMessage[];
128
+ followUp: AgentMessage[];
129
+ }, OperationMismatch | Closed>;
130
+ export interface WatchHandle<T> {
131
+ snapshot: T;
132
+ start(listener: EventListener): void;
133
+ resnapshot(context: Context): Promise<T>;
134
+ unsubscribe(): void;
135
+ }
136
+ export interface LaneInfo {
137
+ name: string;
138
+ tipId: string | null;
139
+ operation: CurrentOperationInfo | null;
140
+ }
141
+ export type LaneSnapshotTool = {
142
+ status: "running";
143
+ toolCallId: string;
144
+ toolName: string;
145
+ args: unknown;
146
+ result?: AgentToolResult<unknown>;
147
+ } | {
148
+ status: "settled";
149
+ toolCallId: string;
150
+ toolName: string;
151
+ args: unknown;
152
+ result: AgentToolResult<unknown>;
153
+ isError: boolean;
154
+ };
155
+ export interface OpenOperation {
156
+ lane: string;
157
+ operationId: string;
158
+ kind: "run" | "compaction" | "navigation";
159
+ startedAt: number;
160
+ aborting?: true;
161
+ }
162
+ export type LaneQueuedItem = {
163
+ entryId: string;
164
+ kind: "steer" | "followUp" | "nextRun" | "write";
165
+ type: "message";
166
+ message: AgentMessage;
167
+ } | {
168
+ entryId: string;
169
+ kind: "write";
170
+ type: "custom";
171
+ customType: string;
172
+ data?: JsonValue;
173
+ };
174
+ export interface LaneSnapshot {
175
+ lane: string;
176
+ transcript: Entry[];
177
+ tipId: string | null;
178
+ lastResult?: OperationResultRecord;
179
+ configuration: LaneConfiguration;
180
+ stats: SessionStats;
181
+ operation: null | {
182
+ id: string;
183
+ kind: "run" | "compaction" | "navigation";
184
+ startedAt: number;
185
+ fromTipId: string | null;
186
+ status: OperationStatus;
187
+ retry?: {
188
+ attempt: number;
189
+ maxAttempts: number;
190
+ nextAttemptAt: number;
191
+ };
192
+ deferred?: {
193
+ handle: DeferredHandle;
194
+ poll: number;
195
+ };
196
+ streamingMessage?: AssistantMessage;
197
+ runningTools: LaneSnapshotTool[];
198
+ };
199
+ queues: LaneQueuedItem[];
200
+ faulted: boolean;
201
+ }
202
+ export interface SessionSnapshot {
203
+ lanes: LaneInfo[];
204
+ faulted: boolean;
205
+ }
206
+ export type HarnessEventPayload = {
207
+ type: "run_start";
208
+ runId: string;
209
+ startedAt: number;
210
+ } | {
211
+ type: "run_resume";
212
+ runId: string;
213
+ } | {
214
+ type: "run_suspend";
215
+ runId: string;
216
+ reason: "deferred";
217
+ deferred: DeferredHandle;
218
+ poll: number;
219
+ } | {
220
+ type: "operation_abort";
221
+ operationId: string;
222
+ steer: AgentMessage[];
223
+ followUp: AgentMessage[];
224
+ } | ({
225
+ type: "run_end";
226
+ runId: string;
227
+ fromTipId: string | null;
228
+ tipId: string | null;
229
+ endedAt: number;
230
+ } & ({
231
+ status: "completed" | "aborted";
232
+ error?: never;
233
+ } | {
234
+ status: "failed";
235
+ error: OperationError;
236
+ })) | {
237
+ type: "fault";
238
+ code: string;
239
+ message: string;
240
+ } | ({
241
+ type: "handler_error";
242
+ error: string;
243
+ stack?: string;
244
+ } & ({
245
+ kind: "hook";
246
+ hook: string;
247
+ } | {
248
+ kind: "event";
249
+ event: string;
250
+ })) | {
251
+ type: "turn_start";
252
+ runId: string;
253
+ turnId: string;
254
+ } | {
255
+ type: "turn_end";
256
+ runId: string;
257
+ turnId: string;
258
+ message: AssistantMessage;
259
+ toolResults: ToolResultMessage[];
260
+ } | {
261
+ type: "retry_scheduled";
262
+ runId: string;
263
+ step: string;
264
+ attempt: number;
265
+ maxAttempts: number;
266
+ delayMs: number;
267
+ notBefore: number;
268
+ errorMessage: string;
269
+ } | {
270
+ type: "retry_start";
271
+ runId: string;
272
+ step: string;
273
+ attempt: number;
274
+ } | {
275
+ type: "retry_end";
276
+ runId: string;
277
+ step: string;
278
+ attempt: number;
279
+ success: boolean;
280
+ finalError?: string;
281
+ } | {
282
+ type: "message_start";
283
+ runId?: string;
284
+ message: AgentMessage;
285
+ } | {
286
+ type: "message_update";
287
+ runId: string;
288
+ message: AgentMessage;
289
+ event: AssistantMessageEvent;
290
+ frame?: AssistantMessageFrame;
291
+ } | {
292
+ type: "message_end";
293
+ runId?: string;
294
+ message: AgentMessage;
295
+ entryId?: string;
296
+ } | {
297
+ type: "tool_start";
298
+ runId: string;
299
+ turnId: string;
300
+ toolCallId: string;
301
+ toolName: string;
302
+ args: unknown;
303
+ } | {
304
+ type: "tool_update";
305
+ runId: string;
306
+ turnId: string;
307
+ toolCallId: string;
308
+ toolName: string;
309
+ partialResult: AgentToolResult<unknown>;
310
+ } | {
311
+ type: "tool_end";
312
+ runId: string;
313
+ turnId: string;
314
+ toolCallId: string;
315
+ toolName: string;
316
+ result: AgentToolResult<unknown>;
317
+ isError: boolean;
318
+ terminate: boolean;
319
+ } | {
320
+ type: "entry_added";
321
+ entry: Entry;
322
+ } | {
323
+ type: "queue_update";
324
+ queues: LaneQueuedItem[];
325
+ } | ({
326
+ type: "value_update";
327
+ } & ({
328
+ value: "session_name";
329
+ name: string | undefined;
330
+ } | {
331
+ value: "entry_label";
332
+ targetId: string;
333
+ label: string | undefined;
334
+ })) | ({
335
+ type: "config_update";
336
+ } & ({
337
+ property: "model";
338
+ value: {
339
+ provider: string;
340
+ modelId: string;
341
+ };
342
+ previous: unknown;
343
+ } | {
344
+ property: "thinkingLevel";
345
+ value: ThinkingLevel;
346
+ previous: ThinkingLevel;
347
+ } | {
348
+ property: "activeTools";
349
+ value: string[];
350
+ previous: string[];
351
+ } | {
352
+ property: "tools" | "resources";
353
+ } | {
354
+ property: "streamOptions";
355
+ value: AgentHarnessStreamOptions;
356
+ previous: AgentHarnessStreamOptions;
357
+ } | {
358
+ property: "retryPolicy";
359
+ value: RetryPolicy;
360
+ previous: RetryPolicy;
361
+ } | {
362
+ property: "compactionSettings";
363
+ value: CompactionSettings;
364
+ previous: CompactionSettings;
365
+ } | {
366
+ property: "steeringMode";
367
+ value: QueueMode;
368
+ previous: QueueMode;
369
+ } | {
370
+ property: "followUpMode";
371
+ value: QueueMode;
372
+ previous: QueueMode;
373
+ })) | {
374
+ type: "compaction_start";
375
+ runId: string;
376
+ reason: "manual" | "threshold" | "overflow";
377
+ startedAt: number;
378
+ } | ({
379
+ type: "compaction_end";
380
+ runId: string;
381
+ reason: "manual" | "threshold" | "overflow";
382
+ endedAt: number;
383
+ } & ({
384
+ status: "completed";
385
+ entryId: string;
386
+ error?: never;
387
+ } | {
388
+ status: "declined" | "aborted";
389
+ entryId?: never;
390
+ error?: never;
391
+ } | {
392
+ status: "failed";
393
+ entryId?: never;
394
+ error: OperationError;
395
+ })) | {
396
+ type: "navigation_start";
397
+ runId: string;
398
+ targetId: string | null;
399
+ startedAt: number;
400
+ } | ({
401
+ type: "navigation_end";
402
+ runId: string;
403
+ fromTipId: string | null;
404
+ tipId: string | null;
405
+ endedAt: number;
406
+ } & ({
407
+ status: "completed" | "declined" | "aborted";
408
+ error?: never;
409
+ } | {
410
+ status: "failed";
411
+ error: OperationError;
412
+ })) | {
413
+ type: "lane_created";
414
+ at: string | null;
415
+ } | {
416
+ type: "usage";
417
+ lane: string;
418
+ row: UsageRow;
419
+ totals: Usage;
420
+ };
421
+ export type SpecialEventPayload = Extract<HarnessEventPayload, {
422
+ type: "fault" | "value_update" | "usage" | "config_update" | "handler_error";
423
+ }>;
424
+ export type LaneEventPayload = Exclude<HarnessEventPayload, SpecialEventPayload>;
425
+ export type ConfigEventPayload = Extract<HarnessEventPayload, {
426
+ type: "config_update";
427
+ }>;
428
+ export type LaneConfigEventPayload = Extract<ConfigEventPayload, {
429
+ property: "model" | "thinkingLevel" | "activeTools";
430
+ }>;
431
+ export type GlobalConfigEventPayload = Exclude<ConfigEventPayload, LaneConfigEventPayload>;
432
+ export type HandlerErrorPayload = Extract<HarnessEventPayload, {
433
+ type: "handler_error";
434
+ }>;
435
+ export type HarnessEvent = (LaneEventPayload & {
436
+ lane: string;
437
+ recovery?: true;
438
+ }) | (LaneConfigEventPayload & {
439
+ lane: string;
440
+ recovery?: true;
441
+ }) | (Extract<HarnessEventPayload, {
442
+ type: "fault" | "value_update";
443
+ }> & {
444
+ lane?: never;
445
+ recovery?: never;
446
+ }) | (Extract<HarnessEventPayload, {
447
+ type: "usage";
448
+ }> & {
449
+ recovery?: never;
450
+ }) | (GlobalConfigEventPayload & {
451
+ lane?: never;
452
+ recovery?: never;
453
+ }) | (HandlerErrorPayload & ({
454
+ lane: string;
455
+ recovery?: true;
456
+ } | {
457
+ lane?: never;
458
+ recovery?: never;
459
+ }));
460
+ type LaneWatchSourceEvent = Exclude<HarnessEvent, {
461
+ type: "handler_error" | "turn_start" | "turn_end" | "value_update" | "lane_created" | "message_update";
462
+ } | ({
463
+ type: "config_update";
464
+ } & {
465
+ property: string;
466
+ })> | Extract<HarnessEvent, {
467
+ type: "config_update";
468
+ property: "model" | "thinkingLevel" | "activeTools";
469
+ }> | Omit<Extract<HarnessEvent, {
470
+ type: "message_update";
471
+ }>, "event">;
472
+ /** Strict-JSON snapshot representation published to remote transcript consumers. */
473
+ export type LaneTranscriptSnapshot = JsonRepresentation<LaneSnapshot>;
474
+ /** Reducer-relevant strict-JSON Harness events published to remote transcript consumers. */
475
+ export type LaneWatchEvent = JsonRepresentation<LaneWatchSourceEvent>;
476
+ export type HarnessEventType = HarnessEvent["type"];
477
+ export type EventListener<TEvent extends HarnessEvent = HarnessEvent> = (event: TEvent, context: Context) => void | Promise<void>;
478
+ export interface Events {
479
+ on<TType extends HarnessEventType>(type: TType, listener: EventListener<Extract<HarnessEvent, {
480
+ type: TType;
481
+ }>>): () => void;
482
+ }
483
+ export type Resources = AgentHarnessResources<Skill, PromptTemplate>;
484
+ type VoidHookResult = ReturnType<() => void>;
485
+ export interface HookMap {
486
+ before_run: {
487
+ event: {
488
+ prompt: AgentMessage[];
489
+ resources: Resources;
490
+ };
491
+ result: {
492
+ messages?: AgentMessage[];
493
+ } | undefined;
494
+ };
495
+ before_drive: {
496
+ event: {
497
+ operation: "run" | "compaction" | "navigation";
498
+ };
499
+ result: VoidHookResult;
500
+ };
501
+ before_run_end: {
502
+ event: {
503
+ runId: string;
504
+ messages: AgentMessage[];
505
+ };
506
+ result: {
507
+ followUp?: string;
508
+ } | undefined;
509
+ };
510
+ transform_context: {
511
+ event: {
512
+ messages: AgentMessage[];
513
+ systemPrompt: string;
514
+ };
515
+ result: {
516
+ messages?: AgentMessage[];
517
+ systemPrompt?: string;
518
+ } | undefined;
519
+ };
520
+ before_request: {
521
+ event: {
522
+ model: Model<Api>;
523
+ step: "assistant" | "deferred" | "compaction" | "branch_summary";
524
+ attempt: number;
525
+ streamOptions: AgentHarnessStreamOptions;
526
+ };
527
+ result: {
528
+ streamOptions?: AgentHarnessStreamOptionsPatch;
529
+ } | undefined;
530
+ };
531
+ before_payload: {
532
+ event: {
533
+ model: Model<Api>;
534
+ payload: unknown;
535
+ };
536
+ result: {
537
+ payload: unknown;
538
+ } | undefined;
539
+ };
540
+ after_response: {
541
+ event: {
542
+ status?: number;
543
+ headers?: Record<string, string>;
544
+ message: SettledAssistantMessage;
545
+ };
546
+ result: {
547
+ message?: SettledAssistantMessage;
548
+ } | undefined;
549
+ };
550
+ before_tool: {
551
+ event: {
552
+ toolCallId: string;
553
+ toolName: string;
554
+ args: Record<string, JsonValue>;
555
+ };
556
+ result: {
557
+ args?: Record<string, JsonValue>;
558
+ block?: {
559
+ reason: string;
560
+ terminate?: boolean;
561
+ };
562
+ } | undefined;
563
+ };
564
+ after_tool: {
565
+ event: {
566
+ toolCallId: string;
567
+ toolName: string;
568
+ args: Record<string, JsonValue>;
569
+ content: AgentToolResult<unknown>["content"];
570
+ details?: JsonValue;
571
+ isError: boolean;
572
+ usage?: Usage;
573
+ };
574
+ result: {
575
+ content?: AgentToolResult<unknown>["content"];
576
+ details?: JsonValue;
577
+ isError?: boolean;
578
+ usage?: Usage;
579
+ terminate?: boolean;
580
+ } | undefined;
581
+ };
582
+ before_compaction: {
583
+ event: {
584
+ reason: "manual" | "threshold" | "overflow";
585
+ preparation: CompactionPreparation;
586
+ customInstructions?: string;
587
+ };
588
+ result: {
589
+ decline?: boolean;
590
+ compaction?: CompactResult;
591
+ } | undefined;
592
+ };
593
+ before_navigation: {
594
+ event: {
595
+ targetId: string;
596
+ preparation: BranchPreparation;
597
+ customInstructions?: string;
598
+ };
599
+ result: {
600
+ decline?: boolean;
601
+ summary?: BranchSummaryResult;
602
+ } | undefined;
603
+ };
604
+ }
605
+ export type HookName = keyof HookMap;
606
+ export type HookInvocation<TName extends HookName> = HookMap[TName]["event"] & {
607
+ lane: string;
608
+ runId: string;
609
+ };
610
+ export type HookHandler<TName extends HookName> = (event: HookInvocation<TName>, context: Context) => Promise<HookMap[TName]["result"]> | HookMap[TName]["result"];
611
+ export interface Hooks {
612
+ on<TName extends HookName>(name: TName, handler: HookHandler<TName>, options?: {
613
+ id?: string;
614
+ }): () => void;
615
+ }
616
+ export type { EntryProjector } from "./session/types.ts";
617
+ export interface AgentHarnessOptions<TContext extends object | undefined = object | undefined> {
618
+ session: Session;
619
+ models: Models;
620
+ model: Model<Api>;
621
+ thinkingLevel?: ThinkingLevel;
622
+ activeToolNames?: string[];
623
+ tools?: AgentHarnessTool<TContext>[];
624
+ toolContext?: TContext | ((context: Context) => TContext | Promise<TContext>);
625
+ systemPrompt?: string | ((toolContext: TContext, context: Context) => string | Promise<string>);
626
+ resources?: Resources;
627
+ streamOptions?: AgentHarnessStreamOptions;
628
+ retry?: RetryPolicy;
629
+ compaction?: CompactionSettings;
630
+ steeringMode?: QueueMode;
631
+ followUpMode?: QueueMode;
632
+ toolExecution?: "sequential" | "parallel";
633
+ toProviderMessages?: (messages: AgentMessage[], context: Context) => Message[] | Promise<Message[]>;
634
+ entryProjectors?: Record<string, EntryProjector>;
635
+ }
636
+ export interface AgentLane {
637
+ readonly name: string;
638
+ getTipId(context: Context): Promise<string | null>;
639
+ findEntries(query: BranchScan | undefined, context: Context): Promise<Entry[]>;
640
+ findEntry(query: BranchScan | undefined, context: Context): Promise<Entry | undefined>;
641
+ appendMessage(message: AgentMessage, context: Context): Promise<string>;
642
+ appendCustomEntry(customType: string, data: JsonValue | undefined, context: Context): Promise<string>;
643
+ getResult(operationId: string, context: Context): Promise<OperationResultRecord | undefined>;
644
+ accept(request: OperationRequest, context: Context): Promise<OperationAdmissionResult>;
645
+ drive(options: DriveOptions, context: Context): Promise<DriveResult>;
646
+ requestAbort(operationId: string, context: Context): Promise<AbortRequestResult>;
647
+ inspectExecution(context: Context): Promise<LaneExecutionInfo>;
648
+ prompt(text: string, images: ImageContent[] | undefined, context: Context): Promise<RunResult>;
649
+ prompt(message: AgentMessage | AgentMessage[], context: Context): Promise<RunResult>;
650
+ skill(name: string, additionalInstructions: string | undefined, context: Context): Promise<RunResult>;
651
+ promptFromTemplate(name: string, args: string[] | undefined, context: Context): Promise<RunResult>;
652
+ compact(options: {
653
+ customInstructions?: string;
654
+ } | undefined, context: Context): Promise<CompactionResult>;
655
+ navigateTree(targetId: string | null, options: NavigateOptions | undefined, context: Context): Promise<NavigationResult>;
656
+ resume(context: Context): Promise<ResumeResult>;
657
+ abort(context: Context): Promise<AbortResult>;
658
+ steer(message: string | AgentMessage, images: ImageContent[] | undefined, context: Context): Promise<QueueResult>;
659
+ followUp(message: string | AgentMessage, images: ImageContent[] | undefined, context: Context): Promise<QueueResult>;
660
+ nextRun(message: string | AgentMessage, images: ImageContent[] | undefined, context: Context): Promise<QueueResult>;
661
+ cancelQueued(entryId: string, context: Context): Promise<CancelQueuedResult>;
662
+ recordUsage(usage: Usage, options: {
663
+ entryId?: string;
664
+ details?: JsonValue;
665
+ } | undefined, context: Context): Promise<RecordUsageResult>;
666
+ waitForIdle(context: Context): Promise<void>;
667
+ runWhenIdle(callback: (context: Context) => void | Promise<void>, context: Context): Promise<void>;
668
+ getModel(context: Context): Promise<Model<Api> | undefined>;
669
+ setModel(model: ModelIdentity, context: Context): Promise<void>;
670
+ getThinkingLevel(context: Context): Promise<ThinkingLevel>;
671
+ setThinkingLevel(level: ThinkingLevel, context: Context): Promise<void>;
672
+ getActiveTools(context: Context): Promise<string[]>;
673
+ setActiveTools(names: string[], context: Context): Promise<void>;
674
+ watch(context: Context): Promise<WatchHandle<LaneSnapshot>>;
675
+ }
676
+ export interface AcquireLaneOptions {
677
+ createAt?: string | null;
678
+ }
679
+ export interface AgentHarness<TContext extends object | undefined = object | undefined> {
680
+ lane(name: string, context: Context): Promise<AgentLane>;
681
+ lane(name: string, options: AcquireLaneOptions, context: Context): Promise<AgentLane>;
682
+ lanes(context: Context): Promise<LaneInfo[]>;
683
+ getName(context: Context): Promise<string | undefined>;
684
+ setName(name: string | undefined, context: Context): Promise<void>;
685
+ getLabel(targetId: string, context: Context): Promise<string | undefined>;
686
+ setLabel(targetId: string, label: string | undefined, context: Context): Promise<void>;
687
+ getTools(context: Context): Promise<AgentHarnessTool<TContext>[]>;
688
+ setTools(tools: AgentHarnessTool<TContext>[], context: Context): Promise<void>;
689
+ getResources(context: Context): Promise<Resources>;
690
+ setResources(resources: Resources, context: Context): Promise<void>;
691
+ getStreamOptions(context: Context): Promise<AgentHarnessStreamOptions>;
692
+ setStreamOptions(options: AgentHarnessStreamOptions, context: Context): Promise<void>;
693
+ getRetryPolicy(context: Context): Promise<RetryPolicy>;
694
+ setRetryPolicy(policy: RetryPolicy, context: Context): Promise<void>;
695
+ getCompactionSettings(context: Context): Promise<CompactionSettings>;
696
+ setCompactionSettings(settings: CompactionSettings, context: Context): Promise<void>;
697
+ getSteeringMode(context: Context): Promise<QueueMode>;
698
+ setSteeringMode(mode: QueueMode, context: Context): Promise<void>;
699
+ getFollowUpMode(context: Context): Promise<QueueMode>;
700
+ setFollowUpMode(mode: QueueMode, context: Context): Promise<void>;
701
+ watchSession(context: Context): Promise<WatchHandle<SessionSnapshot>>;
702
+ readonly hooks: Hooks;
703
+ readonly events: Events;
704
+ close(context: Context): Promise<void>;
705
+ }
706
+ export interface AgentHarnessConstructor {
707
+ create<TContext extends object | undefined = object | undefined>(options: AgentHarnessOptions<TContext>, context: Context): Promise<{
708
+ harness: AgentHarness<TContext>;
709
+ open: OpenOperation[];
710
+ }>;
711
+ }
712
+ /** Runtime constructor for attaching the durable harness to one open session. */
713
+ export declare const AgentHarness: {
714
+ create: typeof createAgentHarness;
715
+ };
716
+ //# sourceMappingURL=agent-harness.d.ts.map