openpond 0.1.1 → 0.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (225) hide show
  1. package/README.md +4 -4
  2. package/dist/cache.d.ts +7 -10
  3. package/dist/chunks/actions-command-QP3NMDK4.js +2 -0
  4. package/dist/chunks/app-layer-N7VFRVJ2.js +3 -0
  5. package/dist/chunks/app-server-runtime-OCLPUI7F.js +2 -0
  6. package/dist/chunks/apps-AMG75TI4.js +2 -0
  7. package/dist/chunks/chunk-22UARBPW.js +3 -0
  8. package/dist/chunks/chunk-3A7HZJNE.js +1 -0
  9. package/dist/chunks/chunk-3M53YXEI.js +2 -0
  10. package/dist/chunks/chunk-3NDRIQTI.js +2 -0
  11. package/dist/chunks/chunk-5BBVEWG3.js +2 -0
  12. package/dist/chunks/chunk-5O7ZVCMV.js +6 -0
  13. package/dist/chunks/chunk-6FA3GG5B.js +33 -0
  14. package/dist/chunks/chunk-6MI4KKWF.js +2 -0
  15. package/dist/chunks/chunk-BBG546O6.js +6 -0
  16. package/dist/chunks/chunk-BX4J2VDU.js +2 -0
  17. package/dist/chunks/chunk-BZMVB3GS.js +2 -0
  18. package/dist/chunks/chunk-C5LOZSVS.js +2 -0
  19. package/dist/chunks/chunk-CWQWV2T3.js +2 -0
  20. package/dist/chunks/chunk-DUA3QP6Y.js +19 -0
  21. package/dist/chunks/chunk-EAPFMACH.js +10 -0
  22. package/dist/chunks/chunk-ES2ISFJC.js +66 -0
  23. package/dist/chunks/chunk-F65NIZLM.js +2199 -0
  24. package/dist/chunks/chunk-FGJ5LFPL.js +5 -0
  25. package/dist/chunks/chunk-FTQLQJQV.js +2 -0
  26. package/dist/chunks/chunk-FY7OQ5RK.js +24 -0
  27. package/dist/chunks/chunk-FYCJSUFV.js +53 -0
  28. package/dist/chunks/chunk-GLUWATL5.js +2 -0
  29. package/dist/chunks/chunk-H7IWJN7L.js +17 -0
  30. package/dist/chunks/chunk-HZP5U2AA.js +3 -0
  31. package/dist/chunks/chunk-I5K74TOH.js +3 -0
  32. package/dist/chunks/chunk-IR3YJWPW.js +7 -0
  33. package/dist/chunks/chunk-KU7QOHFT.js +2872 -0
  34. package/dist/chunks/chunk-KV553EWX.js +16 -0
  35. package/dist/chunks/chunk-MGN6GLNZ.js +2 -0
  36. package/dist/chunks/chunk-OG5Q6NXK.js +28 -0
  37. package/dist/chunks/chunk-OGPHXXCD.js +1 -0
  38. package/dist/chunks/chunk-PI36UHRA.js +18 -0
  39. package/dist/chunks/chunk-RWSAGQTP.js +2 -0
  40. package/dist/chunks/chunk-SAE4OIPC.js +2 -0
  41. package/dist/chunks/chunk-SDO4FC4Q.js +2 -0
  42. package/dist/chunks/chunk-UKUVMXOW.js +12 -0
  43. package/dist/chunks/chunk-VCLCFK3O.js +36 -0
  44. package/dist/chunks/chunk-VYUMTRB3.js +5 -0
  45. package/dist/chunks/chunk-X37KMV27.js +1 -0
  46. package/dist/chunks/chunk-XDHAGACI.js +3 -0
  47. package/dist/chunks/chunk-XEOEKFG6.js +71 -0
  48. package/dist/chunks/chunk-ZF7TEGY5.js +5 -0
  49. package/dist/chunks/chunk-ZVOO7FKM.js +2 -0
  50. package/dist/chunks/cli-M2FG7SSI.js +2 -0
  51. package/dist/chunks/configuration-command-XBKBIZBO.js +2 -0
  52. package/dist/chunks/continual-D75WA7E7.js +7 -0
  53. package/dist/chunks/core-commands-LUZVWXQR.js +2 -0
  54. package/dist/chunks/database-X2CUV732.js +2 -0
  55. package/dist/chunks/desktop-test-KGC4JVJ7.js +3 -0
  56. package/dist/chunks/dist-NKLXFA37.js +2 -0
  57. package/dist/chunks/extension-NQ7N5LEY.js +5 -0
  58. package/dist/chunks/help-MWK66XZK.js +8 -0
  59. package/dist/chunks/module-ES6BEMUI-ZVL3F6NW.js +2 -0
  60. package/dist/chunks/module-asyncify-2EFITU5U-R7TVXNAE.js +2 -0
  61. package/dist/chunks/opchat-XJZA3QKZ.js +3 -0
  62. package/dist/chunks/organizations-UECDFEYE.js +2 -0
  63. package/dist/chunks/profile-KUMIZURM.js +3 -0
  64. package/dist/chunks/project-agent-NILMJHLV.js +2 -0
  65. package/dist/chunks/sandbox-command-QHH65OSE.js +2 -0
  66. package/dist/chunks/sandbox-template-N7I63PNU.js +10 -0
  67. package/dist/chunks/src-724HF43W.js +82 -0
  68. package/dist/chunks/src-VTKTTKQO.js +319 -0
  69. package/dist/chunks/taskset-PISBOILQ.js +2 -0
  70. package/dist/chunks/teams-bot-UV4RU53M.js +3 -0
  71. package/dist/chunks/training-2NDOWH5S.js +2 -0
  72. package/dist/chunks/workspaces-XXT4KUD3.js +2 -0
  73. package/dist/cli.js +3 -101
  74. package/dist/client.d.ts +1 -1
  75. package/dist/config.d.ts +1 -0
  76. package/dist/index.js +1 -26305
  77. package/dist/private-json-file.d.ts +1 -2
  78. package/dist/sandbox-template/manifest.js +1 -18380
  79. package/dist/web/assets/App-DxecRQUL.js +176 -0
  80. package/dist/web/assets/AppDialog-B65Eo3gp.js +1 -0
  81. package/dist/web/assets/AppTerminalPanel-B2EKQM7W.js +2 -0
  82. package/dist/web/assets/{AppsView-Ck_OzQWf.js → AppsView-BBoVe7s2.js} +1 -1
  83. package/dist/web/assets/{BrowserSidebar-CqciX8aL.js → BrowserSidebar-CSM1atSJ.js} +1 -1
  84. package/dist/web/assets/{CartesianChart-Y0lsL4vC.js → CartesianChart-CJKfXiEG.js} +1 -1
  85. package/dist/web/assets/{CollaborationTabs-BOb9PjvS.js → CollaborationTabs-BMZamWFC.js} +1 -1
  86. package/dist/web/assets/{CommandMenu-Co6JnmTu.js → CommandMenu-B3U1z2eo.js} +1 -1
  87. package/dist/web/assets/{CommunityView-BbTSeL7h.js → CommunityView-CTyRUcfy.js} +1 -1
  88. package/dist/web/assets/{ComposerCreateImproveStrip-BGzCWVFp.js → ComposerCreateImproveStrip-D7usvRtK.js} +1 -1
  89. package/dist/web/assets/GetStartedView-Ibu7oKWJ.js +1 -0
  90. package/dist/web/assets/HostedModelLearningReview-qnzIkT70.js +1 -0
  91. package/dist/web/assets/HostedModelLearningSettings--PKjpYsy.js +1 -0
  92. package/dist/web/assets/LabModelVersionDetailPage-s9uUN6fV.js +1 -0
  93. package/dist/web/assets/{LabSkillSidebar-C5oS6UmH.js → LabSkillSidebar-BKYseMiJ.js} +1 -1
  94. package/dist/web/assets/LabsRoute-C1FWCoYb.css +1 -0
  95. package/dist/web/assets/LabsRoute-DoRs0K6v.js +32 -0
  96. package/dist/web/assets/MainChatThread-DvuyMcMB.js +2 -0
  97. package/dist/web/assets/MainPane-BWwcxgHD.js +8 -0
  98. package/dist/web/assets/{MarkdownText-DqJarmTh.js → MarkdownText-D8XC5UT_.js} +1 -1
  99. package/dist/web/assets/{Messages-BaT7HOzB.js → Messages-e4A8JUjD.js} +6 -6
  100. package/dist/web/assets/{NativeSkillSidebar-DXp8snN5.js → NativeSkillSidebar-D2Joh8XB.js} +1 -1
  101. package/dist/web/assets/{NewExperienceSwitcher-CLHuGUN5.js → NewExperienceSwitcher-CzGebt2E.js} +1 -1
  102. package/dist/web/assets/{NewProjectDialog-CzpHCAaC.js → NewProjectDialog-CdMTSxUE.js} +1 -1
  103. package/dist/web/assets/{OutputsPage-DIzx-Ge6.js → OutputsPage-m7cSb8dW.js} +1 -1
  104. package/dist/web/assets/{ProjectsPage-DojwrhOy.js → ProjectsPage-C9mz8W1g.js} +1 -1
  105. package/dist/web/assets/RightChatPanelStack-B4LEqKEj.js +1 -0
  106. package/dist/web/assets/{RightSidebarHomePanel-DTzfuEX3.js → RightSidebarHomePanel-DOeUsH7h.js} +1 -1
  107. package/dist/web/assets/ScheduledWorkPage-UXZSSWgA.js +1 -0
  108. package/dist/web/assets/SettingsView-CAH0vreE.css +1 -0
  109. package/dist/web/assets/SettingsView-CQm1ai73.js +9 -0
  110. package/dist/web/assets/TeamChatView-C4haojB7.js +3 -0
  111. package/dist/web/assets/{TerminalOverlay-DnNVrCtu.js → TerminalOverlay-p2GZsuyQ.js} +3 -3
  112. package/dist/web/assets/{TrainingCreationPanel-CDwwyucO.js → TrainingCreationPanel-BYJSlO8X.js} +1 -1
  113. package/dist/web/assets/{TrainingDraftPanel-BijDnV_0.js → TrainingDraftPanel-DR5KlayH.js} +1 -1
  114. package/dist/web/assets/{UsageSettingsSection-Y5BFAu1p.js → UsageSettingsSection-BQToNXE4.js} +5 -5
  115. package/dist/web/assets/{WorkSidebarPanel-CkJlvZKm.js → WorkSidebarPanel--EeytWeg.js} +1 -1
  116. package/dist/web/assets/WorkspaceDiffPanel-BrovSYhn.js +14 -0
  117. package/dist/web/assets/{WorkspaceEnvironmentMenu-D8knAy1q.js → WorkspaceEnvironmentMenu-l-keRgvj.js} +3 -3
  118. package/dist/web/assets/{WorkspaceGitDialogs-_LHTrvh6.js → WorkspaceGitDialogs-aicWzaZu.js} +1 -1
  119. package/dist/web/assets/{WorkspaceMonacoEditor-B2B7OM_L.js → WorkspaceMonacoEditor-CO_E74jM.js} +36 -36
  120. package/dist/web/assets/{arrow-up-right-4nAzMtjW.js → arrow-up-right-rwPXNfVn.js} +1 -1
  121. package/dist/web/assets/chat-file-links-B3jDstSC.js +1 -0
  122. package/dist/web/assets/chevron-up-D089nvYQ.js +1 -0
  123. package/dist/web/assets/{clipboard-BzjUoZFo.js → clipboard-DwEExyU4.js} +1 -1
  124. package/dist/web/assets/{cloud-upload-CsrrwS-b.js → cloud-upload-D2he0-vQ.js} +1 -1
  125. package/dist/web/assets/{cssMode-CIbSSHKJ.js → cssMode-DS4k0NcI.js} +1 -1
  126. package/dist/web/assets/{folder-open-vRTuLzpS.js → folder-open-CAOLduKD.js} +1 -1
  127. package/dist/web/assets/{folder-plus-hyqwgUnx.js → folder-plus-D56MrxVT.js} +1 -1
  128. package/dist/web/assets/{git-commit-horizontal-CaxKfeYa.js → git-commit-horizontal-CeNM0oKJ.js} +1 -1
  129. package/dist/web/assets/{htmlMode-C3MGQGam.js → htmlMode-Xkni5erh.js} +1 -1
  130. package/dist/web/assets/{index-ByQIHpc9.css → index-BGMzUaup.css} +1 -1
  131. package/dist/web/assets/{index-Dvq7bpBG.js → index-KwyAyscP.js} +1 -1
  132. package/dist/web/assets/{info-aYWeE1Iw.js → info-CcrBaEE_.js} +1 -1
  133. package/dist/web/assets/{jsonMode-CpD6UkT7.js → jsonMode-C4YPbQB7.js} +1 -1
  134. package/dist/web/assets/{lspLanguageFeatures-DpcK8ZI6.js → lspLanguageFeatures-CF5oMTz6.js} +1 -1
  135. package/dist/web/assets/{minimize-2-DeYg7XqB.js → minimize-2-DzHQnInk.js} +1 -1
  136. package/dist/web/assets/{monaco.contribution-CrrdDQgP.js → monaco.contribution-0EN4mGCC.js} +2 -2
  137. package/dist/web/assets/{monaco.contribution-JWFq0HzV.js → monaco.contribution-B4qcTP0w.js} +2 -2
  138. package/dist/web/assets/{monaco.contribution-BDTM0ZJq.js → monaco.contribution-CJK_NrBm.js} +2 -2
  139. package/dist/web/assets/{monaco.contribution-C-_ekTxy.js → monaco.contribution-CkPGKNd-.js} +2 -2
  140. package/dist/web/assets/{play-BqgRTddV.js → play-p3-AMTPL.js} +1 -1
  141. package/dist/web/assets/{python-B67wope9.js → python-B0kpTxAZ.js} +1 -1
  142. package/dist/web/assets/{refresh-cw-DwMA_2On.js → refresh-cw-_jbTIzzr.js} +1 -1
  143. package/dist/web/assets/{save-B0BKh5oQ.js → save-Cy6hEotx.js} +1 -1
  144. package/dist/web/assets/{square-LY3oz82L.js → square-DKQkcrOH.js} +1 -1
  145. package/dist/web/assets/{toggleHighContrast-B2jka5B1.js → toggleHighContrast-Bnk1VVVq.js} +1 -1
  146. package/dist/web/assets/{tsMode-1MUwluYD.js → tsMode-BDrSVy7V.js} +1 -1
  147. package/dist/web/assets/{upload-bSKSkFVa.js → upload-COn0my_O.js} +1 -1
  148. package/dist/web/assets/{useLocalAgentSchedules--jnnM4Fz.js → useLocalAgentSchedules-iZNB4Oee.js} +1 -1
  149. package/dist/web/assets/{wifi-off-DA34iPmr.js → wifi-off-Cqt-ZLXY.js} +1 -1
  150. package/dist/web/assets/{workers-CczIcRcl.js → workers-hu0Ym93h.js} +1 -1
  151. package/dist/web/assets/{yaml-DwEGoHA9.js → yaml-D-JLDGL6.js} +1 -1
  152. package/dist/web/index.html +2 -2
  153. package/docs/command-reference.md +28 -2
  154. package/package.json +10 -7
  155. package/dist/chunks/actions-command-6N5XWMR6.js +0 -185
  156. package/dist/chunks/app-layer-XEYHFJHI.js +0 -214
  157. package/dist/chunks/app-server-runtime-FJM2EQPH.js +0 -21
  158. package/dist/chunks/apps-GSXUDK6V.js +0 -427
  159. package/dist/chunks/chunk-2JABRRNR.js +0 -183
  160. package/dist/chunks/chunk-47EIAYI7.js +0 -2162
  161. package/dist/chunks/chunk-4L3ZJS2T.js +0 -1207
  162. package/dist/chunks/chunk-5TKZBMQM.js +0 -731
  163. package/dist/chunks/chunk-6G6MDZLM.js +0 -14509
  164. package/dist/chunks/chunk-BVY5JYM6.js +0 -512
  165. package/dist/chunks/chunk-C5TKGE5Y.js +0 -1275
  166. package/dist/chunks/chunk-CNTM26OW.js +0 -602
  167. package/dist/chunks/chunk-D7BO5Y5J.js +0 -1531
  168. package/dist/chunks/chunk-DJL4TJYG.js +0 -70
  169. package/dist/chunks/chunk-DLQQIWN2.js +0 -648
  170. package/dist/chunks/chunk-DNXBJZAU.js +0 -630
  171. package/dist/chunks/chunk-EFET7LB7.js +0 -1331
  172. package/dist/chunks/chunk-FQS2QL5F.js +0 -14522
  173. package/dist/chunks/chunk-HFPUR4CQ.js +0 -669
  174. package/dist/chunks/chunk-J3YDKJFD.js +0 -88
  175. package/dist/chunks/chunk-J7PYGDRY.js +0 -634
  176. package/dist/chunks/chunk-JTHL5XJ2.js +0 -1838
  177. package/dist/chunks/chunk-KSRWKXRB.js +0 -12
  178. package/dist/chunks/chunk-KWDOAJJI.js +0 -238
  179. package/dist/chunks/chunk-MUMPWI4O.js +0 -92
  180. package/dist/chunks/chunk-N3TGCM7J.js +0 -1135
  181. package/dist/chunks/chunk-NTK22KJD.js +0 -10707
  182. package/dist/chunks/chunk-O6B6YCMI.js +0 -57688
  183. package/dist/chunks/chunk-R3C3MNSI.js +0 -140
  184. package/dist/chunks/chunk-SMNFI2FU.js +0 -113
  185. package/dist/chunks/chunk-UACZUFIA.js +0 -47
  186. package/dist/chunks/chunk-W5GKHH77.js +0 -168
  187. package/dist/chunks/chunk-WBAZFKC7.js +0 -1643
  188. package/dist/chunks/chunk-X7ZG4TSW.js +0 -3063
  189. package/dist/chunks/chunk-YVCYVDNP.js +0 -746
  190. package/dist/chunks/cli-6PFRZ2WV.js +0 -21
  191. package/dist/chunks/continual-FYDKLCO7.js +0 -803
  192. package/dist/chunks/core-commands-MAN3CSJQ.js +0 -48
  193. package/dist/chunks/desktop-test-OE5SST2W.js +0 -146
  194. package/dist/chunks/extension-J3CIEDP4.js +0 -10041
  195. package/dist/chunks/help-JNGJJFU5.js +0 -67
  196. package/dist/chunks/opchat-6HEQJFLL.js +0 -167
  197. package/dist/chunks/organizations-MWAPNOCK.js +0 -804
  198. package/dist/chunks/profile-P7HMONTZ.js +0 -1134
  199. package/dist/chunks/project-agent-2RAK7GAZ.js +0 -514
  200. package/dist/chunks/sandbox-command-G22CPFNK.js +0 -1659
  201. package/dist/chunks/sandbox-template-S4WRUWJ6.js +0 -1653
  202. package/dist/chunks/src-BKBZ7WLO.js +0 -3624
  203. package/dist/chunks/src-RTGN2O4H.js +0 -65745
  204. package/dist/chunks/taskset-BMI7KOWP.js +0 -66
  205. package/dist/chunks/teams-bot-5VBYEN7M.js +0 -144
  206. package/dist/chunks/training-UPVSGDTB.js +0 -17
  207. package/dist/chunks/workspaces-IJQPWX3H.js +0 -99
  208. package/dist/web/assets/App-BOkhmdHu.js +0 -173
  209. package/dist/web/assets/AppDialog-BCjKFUBn.js +0 -1
  210. package/dist/web/assets/AppTerminalPanel-DRU8GIfy.js +0 -2
  211. package/dist/web/assets/GetStartedView-jEogFjxP.js +0 -1
  212. package/dist/web/assets/LabModelVersionDetailPage-CrudId_1.js +0 -1
  213. package/dist/web/assets/LabsRoute-9v8qwEBc.js +0 -2
  214. package/dist/web/assets/LabsRoute-CGFgymTX.css +0 -1
  215. package/dist/web/assets/MainChatThread-VtMpAxlP.js +0 -2
  216. package/dist/web/assets/MainPane-BbknUzp3.js +0 -8
  217. package/dist/web/assets/RightChatPanelStack-CIE5bgmO.js +0 -1
  218. package/dist/web/assets/ScheduledWorkPage-DdbcQGSv.js +0 -1
  219. package/dist/web/assets/SettingsView-CC5GXaE1.css +0 -1
  220. package/dist/web/assets/SettingsView-QT_OLmDh.js +0 -6
  221. package/dist/web/assets/TeamChatView-C4-nG1tC.js +0 -3
  222. package/dist/web/assets/WorkspaceDiffPanel-CBgzmBk8.js +0 -14
  223. package/dist/web/assets/chat-file-links-Bned0MT7.js +0 -1
  224. package/dist/web/assets/chevron-up-DK7ejCfk.js +0 -1
  225. package/dist/web/assets/index-66-ohHD5.js +0 -1
@@ -1,731 +0,0 @@
1
- import { createRequire as __openpondCreateRequire } from "node:module"; var require = __openpondCreateRequire(import.meta.url);
2
- import {
3
- external_exports
4
- } from "./chunk-FQS2QL5F.js";
5
-
6
- // ../../packages/agent-runtime/dist/compaction.js
7
- function agentCompactionDecision(input) {
8
- if (!input.maxContextTokens || !input.usableContextTokens) {
9
- return {
10
- shouldCompact: false,
11
- projectedTokens: input.projectedTokens,
12
- thresholdTokens: Number.MAX_SAFE_INTEGER,
13
- usableContextTokens: 0,
14
- maxContextTokens: 0,
15
- tokenSource: "heuristic"
16
- };
17
- }
18
- const triggerRatio = Math.max(0.01, Math.min(1, (input.triggerPercent ?? 85) / 100));
19
- const thresholdTokens = Math.max(1, Math.floor(input.usableContextTokens * triggerRatio));
20
- return {
21
- shouldCompact: input.projectedTokens >= thresholdTokens,
22
- projectedTokens: input.projectedTokens,
23
- thresholdTokens,
24
- usableContextTokens: input.usableContextTokens,
25
- maxContextTokens: input.maxContextTokens,
26
- tokenSource: "heuristic"
27
- };
28
- }
29
- async function runAgentCompaction(host) {
30
- await host.started();
31
- try {
32
- return await host.compact();
33
- } catch (error) {
34
- await host.failed(error);
35
- throw error;
36
- }
37
- }
38
- async function runAgentCompactionProgram(input) {
39
- const projectionEvents = input.host.projectEvents(input.events);
40
- const selection = input.host.selectEvents(projectionEvents, input.maxContextTokens);
41
- const { summaryEvents, preservedEvents, preservedEventIds } = selection;
42
- if (summaryEvents.length === 0) {
43
- throw new Error("There is not enough prior context to compact.");
44
- }
45
- const summaryRecords = input.host.normalizeRecords(summaryEvents);
46
- const preservedRecords = input.host.normalizeRecords(preservedEvents);
47
- const fileLedger = input.host.buildFileLedger(input.host.normalizeRecords(projectionEvents));
48
- const serialized = input.host.serializeRecords(summaryRecords, input.host.inputCharBudget(input.maxContextTokens));
49
- if (!serialized.text.trim()) {
50
- throw new Error("There is not enough prior context to compact.");
51
- }
52
- const messages = input.host.buildSummaryMessages({
53
- serializedHistory: serialized.text,
54
- fileLedger
55
- });
56
- const startedAtMs = Date.now();
57
- const summary = (await input.host.streamSummary({
58
- model: input.model,
59
- messages,
60
- signal: input.signal
61
- })).trim();
62
- const durationMs = Date.now() - startedAtMs;
63
- if (!summary)
64
- throw new Error("Compaction summary was empty.");
65
- const projection = input.host.estimateProjection({
66
- events: projectionEvents,
67
- preservedEvents,
68
- summary
69
- });
70
- const metrics = input.host.createMetrics({
71
- sourceEvents: projectionEvents.length,
72
- summarizedEvents: summaryEvents.length,
73
- preservedEvents: preservedEvents.length,
74
- sourceRecords: serialized.sourceRecordCount,
75
- includedRecords: serialized.includedRecordCount,
76
- omittedRecords: serialized.omittedRecordCount,
77
- preservedRecords: preservedRecords.length,
78
- truncatedRecords: serialized.truncatedRecordCount,
79
- summaryInputTruncated: serialized.inputTruncated,
80
- sourceSelectionStrategy: serialized.selectionStrategy,
81
- summaryInputChars: serialized.inputChars,
82
- retainedTailTokens: selection.retainedTailTokens,
83
- retainedTailBudgetTokens: selection.retainedTailBudgetTokens,
84
- finalProviderContextTokens: projection.inputTokensAfter,
85
- durationMs,
86
- fileLedgerEntries: fileLedger.length,
87
- splitTurnId: selection.splitTurnId
88
- });
89
- return {
90
- summary,
91
- model: input.model,
92
- compactedThroughEventId: projectionEvents[projectionEvents.length - 1]?.id ?? null,
93
- compactedThroughTurnId: input.host.lastTurnId(projectionEvents),
94
- preservedFromEventId: preservedEvents[0]?.id ?? null,
95
- preservedEventIds,
96
- preservedResourceRefs: input.host.durableResourceRefs(input.events),
97
- sourceEventCount: summaryEvents.length,
98
- preservedEventCount: preservedEvents.length,
99
- fileLedger,
100
- inputTokensBefore: projection.inputTokensBefore,
101
- inputTokensAfter: projection.inputTokensAfter,
102
- maxContextTokens: input.maxContextTokens,
103
- tokenSource: "heuristic",
104
- metrics
105
- };
106
- }
107
-
108
- // ../../packages/agent-runtime/dist/canonical.js
109
- import { createHash } from "node:crypto";
110
- function canonicalJson(value) {
111
- if (value === null || typeof value === "boolean" || typeof value === "string") {
112
- return value;
113
- }
114
- if (typeof value === "number") {
115
- if (!Number.isFinite(value))
116
- throw new Error("Canonical JSON cannot encode a non-finite number.");
117
- return value;
118
- }
119
- if (Array.isArray(value))
120
- return value.map(canonicalJson);
121
- if (typeof value === "object") {
122
- const output = {};
123
- for (const key of Object.keys(value).sort()) {
124
- const member = value[key];
125
- if (member !== void 0)
126
- output[key] = canonicalJson(member);
127
- }
128
- return output;
129
- }
130
- throw new Error(`Canonical JSON cannot encode ${typeof value}.`);
131
- }
132
- function canonicalHash(value) {
133
- return createHash("sha256").update(JSON.stringify(canonicalJson(value)), "utf8").digest("hex");
134
- }
135
-
136
- // ../../packages/agent-runtime/dist/events.js
137
- var AgentEventNameSchema = external_exports.enum([
138
- "thread.started",
139
- "thread.resumed",
140
- "turn.started",
141
- "turn.steered",
142
- "turn.interrupted",
143
- "turn.completed",
144
- "turn.failed",
145
- "item.started",
146
- "item.delta",
147
- "item.completed",
148
- "assistant.reasoning.delta",
149
- "assistant.delta",
150
- "tool.started",
151
- "tool.completed",
152
- "approval.requested",
153
- "approval.resolved",
154
- "user_input.requested",
155
- "user_input.resolved",
156
- "compaction.started",
157
- "compaction.completed",
158
- "harness.admitted",
159
- "harness.refiner.queued",
160
- "harness.refiner.started",
161
- "harness.refiner.completed",
162
- "harness.refiner.failed",
163
- "diagnostic"
164
- ]);
165
- var CanonicalAgentEventSchema = external_exports.object({
166
- sequence: external_exports.number().int().nonnegative(),
167
- name: AgentEventNameSchema,
168
- source: external_exports.enum(["runtime", "provider", "tool", "host", "refiner"]),
169
- status: external_exports.string().trim().min(1).nullable().default(null),
170
- threadId: external_exports.string().trim().min(1),
171
- turnId: external_exports.string().trim().min(1).nullable().default(null),
172
- callId: external_exports.string().trim().min(1).nullable().default(null),
173
- output: external_exports.string().nullable().default(null),
174
- error: external_exports.string().nullable().default(null),
175
- data: external_exports.record(external_exports.string(), external_exports.unknown()).default({})
176
- }).strict();
177
- function canonicalEventHash(event) {
178
- return canonicalHash(CanonicalAgentEventSchema.parse(event));
179
- }
180
-
181
- // ../../packages/agent-runtime/dist/protocol.js
182
- var AGENT_PROTOCOL_VERSION = "2026-08-26";
183
- var AGENT_RPC_METHODS = [
184
- "initialize",
185
- "initialized",
186
- "runtime/capabilities",
187
- "thread/start",
188
- "thread/resume",
189
- "thread/read",
190
- "turn/start",
191
- "turn/steer",
192
- "turn/interrupt",
193
- "approval/resolve",
194
- "userInput/resolve",
195
- "harness/inspect",
196
- "harness/proposalReview",
197
- "harness/review",
198
- "harness/acceptEvaluationReview",
199
- "harness/materializeEvaluationTaskset",
200
- "harness/runEvaluationBaseline",
201
- "harness/validate",
202
- "harness/backgroundReview",
203
- "harness/diff",
204
- "harness/rollback",
205
- "refiner/inspect",
206
- "refiner/update",
207
- "refiner/activate",
208
- "refiner/rollback"
209
- ];
210
- var JsonRpcRequestSchema = external_exports.object({
211
- jsonrpc: external_exports.literal("2.0"),
212
- id: external_exports.union([external_exports.string(), external_exports.number()]),
213
- method: external_exports.string().trim().min(1),
214
- params: external_exports.unknown().optional()
215
- }).strict();
216
- var JsonRpcNotificationSchema = external_exports.object({
217
- jsonrpc: external_exports.literal("2.0"),
218
- method: external_exports.string().trim().min(1),
219
- params: external_exports.unknown().optional()
220
- }).strict();
221
- var JsonRpcSuccessSchema = external_exports.object({
222
- jsonrpc: external_exports.literal("2.0"),
223
- id: external_exports.union([external_exports.string(), external_exports.number()]),
224
- result: external_exports.unknown()
225
- }).strict();
226
- var JsonRpcErrorSchema = external_exports.object({
227
- jsonrpc: external_exports.literal("2.0"),
228
- id: external_exports.union([external_exports.string(), external_exports.number(), external_exports.null()]),
229
- error: external_exports.object({
230
- code: external_exports.number().int(),
231
- message: external_exports.string(),
232
- data: external_exports.unknown().optional()
233
- }).strict()
234
- }).strict();
235
- var AgentProtocolEnvelopeSchema = external_exports.union([
236
- JsonRpcRequestSchema,
237
- JsonRpcNotificationSchema,
238
- JsonRpcSuccessSchema,
239
- JsonRpcErrorSchema
240
- ]);
241
- var InitializeParamsSchema = external_exports.object({
242
- protocolVersion: external_exports.string().trim().min(1),
243
- client: external_exports.object({
244
- name: external_exports.string().trim().min(1),
245
- version: external_exports.string().trim().min(1)
246
- }).strict(),
247
- capabilities: external_exports.record(external_exports.string(), external_exports.unknown()).default({})
248
- }).strict();
249
- var AgentJsonRpcDispatcher = class {
250
- #host;
251
- #initializeParams = null;
252
- #initialized = false;
253
- constructor(host) {
254
- this.#host = host;
255
- }
256
- get initialized() {
257
- return this.#initialized;
258
- }
259
- async handle(value) {
260
- const notification = JsonRpcNotificationSchema.safeParse(value);
261
- if (notification.success && !("id" in value)) {
262
- if (notification.data.method === "initialized") {
263
- if (!this.#initializeParams)
264
- throw new JsonRpcDispatchError(-32002, "initialize must be called first");
265
- this.#initialized = true;
266
- }
267
- return null;
268
- }
269
- const parsed = JsonRpcRequestSchema.safeParse(value);
270
- if (!parsed.success)
271
- return jsonRpcError(null, -32600, "Invalid Request", parsed.error.flatten());
272
- const request = parsed.data;
273
- try {
274
- const result = await this.#dispatch(request.method, request.params);
275
- return { jsonrpc: "2.0", id: request.id, result };
276
- } catch (error) {
277
- const dispatchError = error instanceof JsonRpcDispatchError ? error : new JsonRpcDispatchError(-32603, error instanceof Error ? error.message : String(error));
278
- return jsonRpcError(request.id, dispatchError.code, dispatchError.message, dispatchError.data);
279
- }
280
- }
281
- async #dispatch(method, params) {
282
- if (method === "initialize") {
283
- const input = InitializeParamsSchema.parse(params);
284
- if (input.protocolVersion !== AGENT_PROTOCOL_VERSION) {
285
- throw new JsonRpcDispatchError(-32001, "Incompatible agent protocol version", {
286
- requested: input.protocolVersion,
287
- supported: AGENT_PROTOCOL_VERSION
288
- });
289
- }
290
- this.#initializeParams = input;
291
- return {
292
- protocolVersion: AGENT_PROTOCOL_VERSION,
293
- server: { name: "openpond-app-server", version: "1" },
294
- capabilities: await this.#host.capabilities()
295
- };
296
- }
297
- if (!this.#initialized)
298
- throw new JsonRpcDispatchError(-32002, "initialized notification is required");
299
- switch (method) {
300
- case "runtime/capabilities":
301
- return this.#host.capabilities(params);
302
- case "thread/start":
303
- return this.#host.threadStart(params);
304
- case "thread/resume":
305
- return this.#host.threadResume(params);
306
- case "thread/read":
307
- return this.#host.threadRead(params);
308
- case "turn/start":
309
- return this.#host.turnStart(params);
310
- case "turn/steer":
311
- return this.#host.turnSteer(params);
312
- case "turn/interrupt":
313
- return this.#host.turnInterrupt(params);
314
- case "approval/resolve":
315
- return this.#host.approvalResolve(params);
316
- case "userInput/resolve":
317
- return this.#host.userInputResolve(params);
318
- case "harness/inspect":
319
- return this.#host.harnessInspect(params);
320
- case "harness/proposalReview":
321
- return this.#host.harnessProposalReview(params);
322
- case "harness/review":
323
- return this.#host.harnessReview(params);
324
- case "harness/acceptEvaluationReview":
325
- return this.#host.harnessAcceptEvaluationReview(params);
326
- case "harness/materializeEvaluationTaskset":
327
- return this.#host.harnessMaterializeEvaluationTaskset(params);
328
- case "harness/runEvaluationBaseline":
329
- return this.#host.harnessRunEvaluationBaseline(params);
330
- case "harness/validate":
331
- return this.#host.harnessValidate(params);
332
- case "harness/backgroundReview":
333
- return this.#host.harnessBackgroundReview(params);
334
- case "harness/diff":
335
- return this.#host.harnessDiff(params);
336
- case "harness/rollback":
337
- return this.#host.harnessRollback(params);
338
- case "refiner/inspect":
339
- return this.#host.refinerInspect(params);
340
- case "refiner/update":
341
- return this.#host.refinerUpdate(params);
342
- case "refiner/activate":
343
- return this.#host.refinerActivate(params);
344
- case "refiner/rollback":
345
- return this.#host.refinerRollback(params);
346
- default:
347
- throw new JsonRpcDispatchError(-32601, `Method not found: ${method}`);
348
- }
349
- }
350
- };
351
- var JsonRpcDispatchError = class extends Error {
352
- code;
353
- data;
354
- constructor(code, message, data) {
355
- super(message);
356
- this.code = code;
357
- this.data = data;
358
- }
359
- };
360
- function jsonRpcError(id, code, message, data) {
361
- return {
362
- jsonrpc: "2.0",
363
- id,
364
- error: { code, message, ...data === void 0 ? {} : { data } }
365
- };
366
- }
367
-
368
- // ../../packages/agent-runtime/dist/jsonl.js
369
- import { once } from "node:events";
370
- import { createInterface } from "node:readline";
371
- async function runAgentJsonlServer(input) {
372
- const dispatcher = new AgentJsonRpcDispatcher(input.host);
373
- let writeChain = Promise.resolve();
374
- const pendingNotifications = [];
375
- const write = (message) => {
376
- writeChain = writeChain.then(async () => {
377
- if (!input.writable.write(`${JSON.stringify(message)}
378
- `))
379
- await once(input.writable, "drain");
380
- });
381
- return writeChain;
382
- };
383
- const flushPendingNotifications = () => {
384
- if (!dispatcher.initialized || pendingNotifications.length === 0)
385
- return;
386
- for (const notification of pendingNotifications.splice(0))
387
- void write(notification);
388
- };
389
- const unsubscribe = input.host.subscribe?.((notification) => {
390
- if (!dispatcher.initialized) {
391
- pendingNotifications.push(notification);
392
- return;
393
- }
394
- void write(notification);
395
- });
396
- const inFlight = /* @__PURE__ */ new Set();
397
- const lines = createInterface({ input: input.readable, crlfDelay: Infinity });
398
- try {
399
- for await (const line of lines) {
400
- if (!line.trim())
401
- continue;
402
- let parsed;
403
- try {
404
- parsed = JSON.parse(line);
405
- } catch {
406
- await write({
407
- jsonrpc: "2.0",
408
- id: null,
409
- error: { code: -32700, message: "Parse error" }
410
- });
411
- continue;
412
- }
413
- const operation = (async () => {
414
- const response = await dispatcher.handle(parsed);
415
- if (response)
416
- await write(response);
417
- flushPendingNotifications();
418
- })();
419
- const method = parsed && typeof parsed === "object" && "method" in parsed ? parsed.method : null;
420
- if (method === "initialize" || method === "initialized") {
421
- await operation;
422
- continue;
423
- }
424
- inFlight.add(operation);
425
- void operation.finally(() => inFlight.delete(operation));
426
- }
427
- await Promise.all(inFlight);
428
- await writeChain;
429
- } finally {
430
- unsubscribe?.();
431
- }
432
- }
433
-
434
- // ../../packages/agent-runtime/dist/provider-loop.js
435
- async function* providerRoundSequence(input) {
436
- if (!Number.isInteger(input.maxRounds) || input.maxRounds < 1) {
437
- throw new Error("Provider maxRounds must be a positive integer.");
438
- }
439
- for (let index = 0; index < input.maxRounds; index += 1) {
440
- if (input.signal.aborted)
441
- throw input.signal.reason ?? new Error("Provider loop interrupted.");
442
- yield {
443
- index,
444
- requestId: `${input.turnId}:model:${index}`,
445
- signal: input.signal
446
- };
447
- }
448
- }
449
- async function runProviderRoundLoop(input) {
450
- for await (const round of providerRoundSequence(input)) {
451
- const decision = await input.runRound(round);
452
- if (decision.type === "complete")
453
- return decision.result;
454
- }
455
- return input.onExhausted();
456
- }
457
- async function runProviderRound(input) {
458
- let text = "";
459
- let reasoningText = "";
460
- let usage;
461
- let continuation = null;
462
- let finishReason;
463
- const toolCallBatches = [];
464
- try {
465
- for await (const delta of input.stream) {
466
- await input.onDelta?.(delta);
467
- if (input.signal.aborted) {
468
- throw input.signal.reason ?? new Error("Provider round interrupted.");
469
- }
470
- if (delta.text)
471
- text += delta.text;
472
- if (delta.reasoningText)
473
- reasoningText += delta.reasoningText;
474
- if (delta.usage !== void 0)
475
- usage = delta.usage;
476
- if (delta.continuation !== void 0)
477
- continuation = delta.continuation;
478
- if (delta.toolCalls)
479
- toolCallBatches.push([...delta.toolCalls]);
480
- if (delta.finishReason !== void 0)
481
- finishReason = delta.finishReason;
482
- }
483
- const result = {
484
- text,
485
- reasoningText,
486
- usage,
487
- continuation,
488
- toolCallBatches,
489
- finishReason
490
- };
491
- await input.onCompleted?.(result);
492
- return result;
493
- } catch (error) {
494
- await input.onFailed?.(error);
495
- throw error;
496
- }
497
- }
498
-
499
- // ../../packages/agent-runtime/dist/service.js
500
- var ThreadIdParamsSchema = external_exports.object({ threadId: external_exports.string().trim().min(1) }).passthrough();
501
- var ThreadStartParamsSchema = external_exports.object({ session: external_exports.unknown() }).strict();
502
- var TurnParamsSchema = ThreadIdParamsSchema.extend({ input: external_exports.unknown() });
503
- var InterruptParamsSchema = ThreadIdParamsSchema.extend({ reason: external_exports.string().trim().min(1).optional() });
504
- var ApprovalParamsSchema = external_exports.object({ approvalId: external_exports.string().trim().min(1), input: external_exports.unknown() }).strict();
505
- function createAgentRuntimeService(ports) {
506
- const run = async (method, threadId, operation) => {
507
- const startedAt = performance.now();
508
- ports.telemetry?.({ method, phase: "started", threadId, durationMs: null, errorClass: null });
509
- try {
510
- const result = await operation();
511
- ports.telemetry?.({
512
- method,
513
- phase: "completed",
514
- threadId,
515
- durationMs: performance.now() - startedAt,
516
- errorClass: null
517
- });
518
- return result;
519
- } catch (error) {
520
- ports.telemetry?.({
521
- method,
522
- phase: "failed",
523
- threadId,
524
- durationMs: performance.now() - startedAt,
525
- errorClass: error instanceof Error ? error.name : "UnknownError"
526
- });
527
- throw error;
528
- }
529
- };
530
- const threadRead = async (params, method = "thread/read") => {
531
- const { threadId } = ThreadIdParamsSchema.parse(params);
532
- return run(method, threadId, async () => {
533
- const [thread, turns, events] = await Promise.all([
534
- ports.readThread(threadId),
535
- ports.listTurns(threadId),
536
- ports.listEvents(threadId)
537
- ]);
538
- return { thread, turns, events };
539
- });
540
- };
541
- return {
542
- capabilities: (params) => run("runtime/capabilities", null, () => ports.capabilities(params)),
543
- threadStart: async (params) => run("thread/start", null, async () => ({
544
- thread: await ports.createThread(ThreadStartParamsSchema.parse(params).session)
545
- })),
546
- threadResume: (params) => threadRead(params, "thread/resume"),
547
- threadRead,
548
- turnStart: async (params) => {
549
- const input = TurnParamsSchema.parse(params);
550
- return run("turn/start", input.threadId, async () => ({
551
- turn: await ports.startTurn(input.threadId, input.input)
552
- }));
553
- },
554
- turnSteer: async (params) => {
555
- const input = TurnParamsSchema.parse(params);
556
- return run("turn/steer", input.threadId, async () => {
557
- if (ports.isTurnActive(input.threadId)) {
558
- await ports.waitForTurnSettlement(input.threadId);
559
- }
560
- return { turn: await ports.startTurn(input.threadId, input.input) };
561
- });
562
- },
563
- turnInterrupt: async (params) => {
564
- const input = InterruptParamsSchema.parse(params);
565
- return run("turn/interrupt", input.threadId, async () => ({
566
- turn: await ports.interruptTurn(input.threadId, input.reason)
567
- }));
568
- },
569
- approvalResolve: async (params) => {
570
- const input = ApprovalParamsSchema.parse(params);
571
- return run("approval/resolve", null, async () => ({
572
- approval: await ports.resolveApproval(input.approvalId, input.input)
573
- }));
574
- },
575
- userInputResolve: async (params) => {
576
- const input = TurnParamsSchema.parse(params);
577
- return run("userInput/resolve", input.threadId, async () => {
578
- if (ports.isTurnActive(input.threadId)) {
579
- await ports.waitForTurnSettlement(input.threadId);
580
- }
581
- return { turn: await ports.startTurn(input.threadId, input.input) };
582
- });
583
- },
584
- harnessInspect: () => run("harness/inspect", null, () => ports.inspectHarness()),
585
- harnessProposalReview: (params) => run("harness/proposalReview", null, () => ports.reviewHarnessProposal(params)),
586
- harnessReview: (params) => run("harness/review", null, () => ports.reviewHarness(params)),
587
- harnessAcceptEvaluationReview: (params) => run("harness/acceptEvaluationReview", null, () => ports.acceptHarnessEvaluationReview(params)),
588
- harnessMaterializeEvaluationTaskset: (params) => run("harness/materializeEvaluationTaskset", null, () => ports.materializeHarnessEvaluationTaskset(params)),
589
- harnessRunEvaluationBaseline: (params) => run("harness/runEvaluationBaseline", null, () => ports.runHarnessEvaluationBaseline(params)),
590
- harnessValidate: () => run("harness/validate", null, () => ports.validateHarness()),
591
- harnessBackgroundReview: (params) => run("harness/backgroundReview", null, () => ports.updateHarnessBackgroundReview(params)),
592
- harnessDiff: (params) => run("harness/diff", null, () => ports.diffHarness(params)),
593
- harnessRollback: (params) => run("harness/rollback", null, () => ports.rollbackHarness(params)),
594
- refinerInspect: () => run("refiner/inspect", null, () => ports.inspectRefiner()),
595
- refinerUpdate: (params) => run("refiner/update", null, () => ports.updateRefiner(params)),
596
- refinerActivate: (params) => run("refiner/activate", null, () => ports.activateRefiner(params)),
597
- refinerRollback: (params) => run("refiner/rollback", null, () => ports.rollbackRefiner(params)),
598
- subscribe: ports.subscribeEvents && ports.eventNotification ? (listener) => ports.subscribeEvents((event) => listener(ports.eventNotification(event))) : void 0
599
- };
600
- }
601
-
602
- // ../../packages/agent-runtime/dist/snapshots.js
603
- var HashSchema = external_exports.string().regex(/^[a-f0-9]{64}$/);
604
- var AgentEffectiveSurfaceSchema = external_exports.object({
605
- harnessReleaseHash: HashSchema,
606
- instructionsHash: HashSchema,
607
- skillHashes: external_exports.record(external_exports.string(), HashSchema),
608
- agentAssetHashes: external_exports.record(external_exports.string(), HashSchema),
609
- toolCatalogHash: HashSchema,
610
- memoryRevision: external_exports.number().int().nonnegative().nullable()
611
- }).strict();
612
- var AgentCheckpointSchema = external_exports.object({
613
- protocolVersion: external_exports.string().trim().min(1),
614
- threadId: external_exports.string().trim().min(1),
615
- turnId: external_exports.string().trim().min(1),
616
- harnessReleaseHash: HashSchema,
617
- toolCatalogHash: HashSchema,
618
- context: external_exports.record(external_exports.string(), external_exports.unknown()),
619
- pendingInteraction: external_exports.record(external_exports.string(), external_exports.unknown()).nullable(),
620
- usage: external_exports.record(external_exports.string(), external_exports.unknown())
621
- }).strict();
622
- function checkpointHash(checkpoint) {
623
- return canonicalHash(AgentCheckpointSchema.parse(checkpoint));
624
- }
625
- function materializeAgentPrompt(input) {
626
- return [
627
- input.system,
628
- ...input.harnessInstructions,
629
- ...input.skillInstructions,
630
- ...input.hostInstructions ?? []
631
- ].map((part) => part.trim()).filter(Boolean).join("\n\n");
632
- }
633
-
634
- // ../../packages/agent-runtime/dist/tools.js
635
- function createAgentToolCatalogProjection(definitions) {
636
- const names = /* @__PURE__ */ new Set();
637
- const tools = [...definitions].map((definition) => {
638
- const name = definition.name.trim();
639
- if (!name)
640
- throw new Error("Agent tool names cannot be empty.");
641
- if (names.has(name))
642
- throw new Error(`Duplicate agent tool: ${name}.`);
643
- names.add(name);
644
- if (!definition.unavailableReason && !definition.executorAvailable) {
645
- throw new Error(`Agent tool ${name} is declared as available without an executor.`);
646
- }
647
- return { ...definition, name };
648
- }).sort((left, right) => left.name.localeCompare(right.name));
649
- const modelTools = tools.filter((tool) => !tool.unavailableReason).map((tool) => ({
650
- name: tool.name,
651
- description: tool.description,
652
- inputSchema: tool.inputSchema
653
- }));
654
- const capabilities = tools.map((tool) => ({
655
- name: tool.name,
656
- displayLabel: tool.displayLabel ?? tool.name,
657
- placement: tool.placement,
658
- available: !tool.unavailableReason,
659
- unavailableReason: tool.unavailableReason ?? null
660
- }));
661
- return {
662
- byName: new Map(tools.map((tool) => [tool.name, tool])),
663
- tools,
664
- modelTools,
665
- capabilities,
666
- hash: canonicalHash({ modelTools, capabilities })
667
- };
668
- }
669
- async function executeProjectedAgentTool(catalog, input) {
670
- const definition = catalog.byName.get(input.name);
671
- if (!definition)
672
- throw new Error(`Unknown agent tool: ${input.name}.`);
673
- if (definition.unavailableReason) {
674
- throw new Error(`Agent tool ${input.name} is unavailable: ${definition.unavailableReason}`);
675
- }
676
- if (!definition.execute)
677
- throw new Error(`Agent tool ${input.name} has no executor.`);
678
- const validated = definition.validateArguments ? definition.validateArguments(input.arguments) : input.arguments;
679
- return definition.execute(validated, input.context);
680
- }
681
-
682
- // ../../packages/app-server/dist/index.js
683
- function createAppServer(input) {
684
- return attachAppServer({
685
- runtime: createAgentRuntimeService(input.ports),
686
- close: input.close
687
- });
688
- }
689
- function attachAppServer(input) {
690
- let closed = false;
691
- return {
692
- runtime: input.runtime,
693
- close: async () => {
694
- if (closed)
695
- return;
696
- closed = true;
697
- await input.close?.();
698
- }
699
- };
700
- }
701
- async function runAppServerJsonl(input) {
702
- try {
703
- await runAgentJsonlServer({
704
- host: input.appServer.runtime,
705
- readable: input.readable,
706
- writable: input.writable
707
- });
708
- } finally {
709
- await input.appServer.close();
710
- }
711
- }
712
-
713
- export {
714
- canonicalHash,
715
- agentCompactionDecision,
716
- runAgentCompaction,
717
- runAgentCompactionProgram,
718
- CanonicalAgentEventSchema,
719
- canonicalEventHash,
720
- AGENT_PROTOCOL_VERSION,
721
- AGENT_RPC_METHODS,
722
- runProviderRoundLoop,
723
- runProviderRound,
724
- AgentCheckpointSchema,
725
- checkpointHash,
726
- materializeAgentPrompt,
727
- createAgentToolCatalogProjection,
728
- executeProjectedAgentTool,
729
- createAppServer,
730
- runAppServerJsonl
731
- };