openpond 0.2.37 → 0.2.38

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 (158) hide show
  1. package/dist/app-server.js +1 -1
  2. package/dist/chunks/actions-command-MHWHPQ66.js +2 -0
  3. package/dist/chunks/{app-layer-BDAKS3DG.js → app-layer-JZTMHORT.js} +1 -1
  4. package/dist/chunks/app-server-runtime-PDT6BJD2.js +2 -0
  5. package/dist/chunks/apps-U5GIOD6W.js +2 -0
  6. package/dist/chunks/{chunk-DXOOJFFU.js → chunk-25OT6IYM.js} +2 -2
  7. package/dist/chunks/chunk-3HQEEZPO.js +2 -0
  8. package/dist/chunks/{chunk-YQPECTJ2.js → chunk-562Q5UVS.js} +2 -2
  9. package/dist/chunks/chunk-7BGT6Q2D.js +8 -0
  10. package/dist/chunks/{chunk-6EAQL7YX.js → chunk-AOBTILU5.js} +1 -1
  11. package/dist/chunks/{chunk-3YA2CD22.js → chunk-DDHUSA3I.js} +1 -1
  12. package/dist/chunks/{chunk-XLVFY2BA.js → chunk-FKVP26MC.js} +1 -1
  13. package/dist/chunks/{chunk-5YUITAUN.js → chunk-FUFIZ37W.js} +2 -2
  14. package/dist/chunks/chunk-GIPSOLAY.js +2 -0
  15. package/dist/chunks/{chunk-I6DQSOSF.js → chunk-GKRTXVNT.js} +1 -1
  16. package/dist/chunks/{chunk-SL7XLTIT.js → chunk-GOHJHZVA.js} +204 -204
  17. package/dist/chunks/{chunk-3I5BMVJI.js → chunk-IKM6ICPY.js} +1 -1
  18. package/dist/chunks/{chunk-4R4KM6LL.js → chunk-J4S7AVGF.js} +1 -1
  19. package/dist/chunks/chunk-JUX77H6K.js +13 -0
  20. package/dist/chunks/chunk-KNEMKYHY.js +2 -0
  21. package/dist/chunks/chunk-MRGA6BKG.js +19 -0
  22. package/dist/chunks/{chunk-FQOVC2GR.js → chunk-OCWH4BV7.js} +135 -141
  23. package/dist/chunks/chunk-P5CFBE6Z.js +3 -0
  24. package/dist/chunks/chunk-Q3X5WOVH.js +4 -0
  25. package/dist/chunks/{chunk-L6NNQUAT.js → chunk-QK2GLRCY.js} +1 -1
  26. package/dist/chunks/chunk-RELOOVWW.js +2 -0
  27. package/dist/chunks/chunk-SBBXUZWL.js +5 -0
  28. package/dist/chunks/{chunk-UJLZRM2M.js → chunk-SHCKK3SU.js} +1 -1
  29. package/dist/chunks/chunk-SHCRE7B2.js +2 -0
  30. package/dist/chunks/{chunk-3N4GQL6I.js → chunk-T7Y5OYO2.js} +1 -1
  31. package/dist/chunks/chunk-TZNKOKQJ.js +5 -0
  32. package/dist/chunks/{chunk-Z3RBK6LN.js → chunk-V5BC6QT2.js} +1 -1
  33. package/dist/chunks/{chunk-DG4DIFF4.js → chunk-WCZRDULE.js} +7 -7
  34. package/dist/chunks/chunk-XHJUP7M4.js +23 -0
  35. package/dist/chunks/{chunk-OO7JG7KM.js → chunk-ZCDOE3EO.js} +3 -3
  36. package/dist/chunks/{chunk-S4RSY6CR.js → chunk-ZCFX6HQO.js} +1 -1
  37. package/dist/chunks/{chunk-KCFVJDIV.js → chunk-ZPGTGQJT.js} +1 -1
  38. package/dist/chunks/cli-OP4EDGZN.js +2 -0
  39. package/dist/chunks/{configuration-command-URDRLDNY.js → configuration-command-RPNYWBKK.js} +1 -1
  40. package/dist/chunks/{continual-6EW2SLGL.js → continual-MHMPLLUZ.js} +3 -3
  41. package/dist/chunks/core-commands-WFTASSGL.js +2 -0
  42. package/dist/chunks/datasets-V7E4I5N3.js +13 -0
  43. package/dist/chunks/desktop-test-NZAZVXLK.js +3 -0
  44. package/dist/chunks/dist-4OUZANXR.js +2 -0
  45. package/dist/chunks/experiments-7UBJCQAQ.js +2 -0
  46. package/dist/chunks/{extension-DG2XISC6.js → extension-OQ7CFD4Q.js} +1 -1
  47. package/dist/chunks/{help-ZLJV3ZVW.js → help-4BB2A5JC.js} +1 -1
  48. package/dist/chunks/hosted-harness-runtime-6TE37GBH.js +2 -0
  49. package/dist/chunks/hosted-profile-compiler-7ZWCIHPA.js +3 -0
  50. package/dist/chunks/opchat-QVB4UIZR.js +3 -0
  51. package/dist/chunks/organizations-MUKXB6MX.js +2 -0
  52. package/dist/chunks/{profile-LMRN5QMQ.js → profile-LZYR4CMX.js} +1 -1
  53. package/dist/chunks/project-agent-FHNWIH2D.js +2 -0
  54. package/dist/chunks/sandbox-command-GJN3HSJQ.js +2 -0
  55. package/dist/chunks/{sandbox-template-LN5OQ55F.js → sandbox-template-6RLQYNTY.js} +1 -1
  56. package/dist/chunks/{src-LRJO4THC.js → src-2NVS6PNZ.js} +112 -112
  57. package/dist/chunks/{src-A5KEQW52.js → src-PASASTIA.js} +5 -5
  58. package/dist/chunks/{taskset-YPKY3HUM.js → taskset-BZYQT65N.js} +1 -1
  59. package/dist/chunks/{teams-bot-RY5M6AOW.js → teams-bot-UQB636V3.js} +1 -1
  60. package/dist/chunks/training-7PST5HZU.js +1 -1
  61. package/dist/chunks/{workspaces-KZ6ZJXXY.js → workspaces-2KYAFRX4.js} +1 -1
  62. package/dist/cli.js +1 -1
  63. package/dist/index.js +1 -1
  64. package/dist/web/assets/{App-BRZg56AC.js → App-BL1D_PLh.js} +9 -9
  65. package/dist/web/assets/{AppDialog-BR9UjEFe.js → AppDialog-CmPsGOzE.js} +1 -1
  66. package/dist/web/assets/{AppTerminalPanel-DNXVV6S_.js → AppTerminalPanel-0_Ewf4wJ.js} +2 -2
  67. package/dist/web/assets/{AppsView-DhaB7uT7.js → AppsView-Ddn9R2I-.js} +1 -1
  68. package/dist/web/assets/{BrowserSidebar-zecj1P2T.js → BrowserSidebar-j2Yyiaz-.js} +1 -1
  69. package/dist/web/assets/{CartesianChart-DRhWC0XA.js → CartesianChart-BWAkc0mY.js} +1 -1
  70. package/dist/web/assets/{CollaborationTabs-BzNNwOcD.js → CollaborationTabs-SVc7oX8N.js} +1 -1
  71. package/dist/web/assets/{CommandMenu-C7HuXmgN.js → CommandMenu-CcX5ypdX.js} +1 -1
  72. package/dist/web/assets/{CommunityView-C4HfU5ky.js → CommunityView-B7W1C8KG.js} +1 -1
  73. package/dist/web/assets/{ComposerCreateImproveStrip-CG8YZxWB.js → ComposerCreateImproveStrip-BBKdrbNP.js} +1 -1
  74. package/dist/web/assets/{GetStartedView-ZxtcgU5X.js → GetStartedView-BXuTBT4U.js} +1 -1
  75. package/dist/web/assets/HostedModelLearningReview-C3oAdyoF.js +1 -0
  76. package/dist/web/assets/{HostedModelLearningSettings-BKM_1-LZ.js → HostedModelLearningSettings-9e5z5eRf.js} +1 -1
  77. package/dist/web/assets/{LabModelVersionDetailPage-CklKwV_e.js → LabModelVersionDetailPage-CctGBUae.js} +1 -1
  78. package/dist/web/assets/{LabSkillSidebar-Cq_axOXr.js → LabSkillSidebar-Cl8Sdiqc.js} +1 -1
  79. package/dist/web/assets/{LabsRoute-BPGkQnKq.js → LabsRoute-di9O0XV1.js} +4 -4
  80. package/dist/web/assets/{MainChatThread-DvllW6Ej.js → MainChatThread-BaEeNsrh.js} +2 -2
  81. package/dist/web/assets/{MainPane-BaUIvio6.js → MainPane-Dw90VsN-.js} +4 -4
  82. package/dist/web/assets/{MarkdownText-DP7Hjp4L.js → MarkdownText-CGGUFrZe.js} +1 -1
  83. package/dist/web/assets/{NativeSkillSidebar-BSSKKH-y.js → NativeSkillSidebar-2mgh6WV4.js} +1 -1
  84. package/dist/web/assets/{NewExperienceSwitcher-cWw4m_pU.js → NewExperienceSwitcher-DMTe3jS9.js} +1 -1
  85. package/dist/web/assets/{NewProjectDialog-BMzXEHsC.js → NewProjectDialog-D6pvuCoo.js} +1 -1
  86. package/dist/web/assets/{OutputsPage-CGWtgJ_j.js → OutputsPage-DMeIKxzN.js} +1 -1
  87. package/dist/web/assets/{ProjectsPage-C00Wt3oR.js → ProjectsPage-V5oXwB-5.js} +1 -1
  88. package/dist/web/assets/{RightChatPanelStack-0D_jpeAm.js → RightChatPanelStack-B0y2XNdm.js} +1 -1
  89. package/dist/web/assets/{RightSidebarHomePanel-BgHpI97K.js → RightSidebarHomePanel-BksZR71F.js} +1 -1
  90. package/dist/web/assets/{ScheduledWorkPage-C-P_Jv04.js → ScheduledWorkPage-BRcVebWV.js} +1 -1
  91. package/dist/web/assets/{SettingsView-BJDvzvtZ.js → SettingsView-CtI170q1.js} +3 -3
  92. package/dist/web/assets/{TeamChatView-BdUQNXvx.js → TeamChatView-DWGM8eXj.js} +1 -1
  93. package/dist/web/assets/{TerminalOverlay-85H1eqcg.js → TerminalOverlay-DLSmAkbQ.js} +1 -1
  94. package/dist/web/assets/{TrainingCreationPanel-Bdx2BJzb.js → TrainingCreationPanel-C6e6zhC8.js} +1 -1
  95. package/dist/web/assets/{TrainingDraftPanel-TcvqZfYS.js → TrainingDraftPanel-Q1GXOAlQ.js} +1 -1
  96. package/dist/web/assets/{UsageSettingsSection-Dm8bsNIT.js → UsageSettingsSection-UET2vS1c.js} +1 -1
  97. package/dist/web/assets/{WorkSidebarPanel-C9bKi4NH.js → WorkSidebarPanel-DMsXId2s.js} +1 -1
  98. package/dist/web/assets/{WorkspaceDiffPanel-CFzHklbv.js → WorkspaceDiffPanel-B_eZE-bq.js} +3 -3
  99. package/dist/web/assets/{WorkspaceEnvironmentMenu-_e6IkhGw.js → WorkspaceEnvironmentMenu-C848cDBP.js} +1 -1
  100. package/dist/web/assets/{WorkspaceGitDialogs-BglcR8S9.js → WorkspaceGitDialogs-CSnIC26s.js} +1 -1
  101. package/dist/web/assets/{WorkspaceMonacoEditor-BuipCT-i.js → WorkspaceMonacoEditor-C5dvv9s_.js} +3 -3
  102. package/dist/web/assets/{arrow-up-right-jN0p0koy.js → arrow-up-right-CsvQameJ.js} +1 -1
  103. package/dist/web/assets/{clipboard-Bat4as9H.js → clipboard-fZsv7_ot.js} +1 -1
  104. package/dist/web/assets/{cloud-upload-CFs0F_2n.js → cloud-upload-CUXNsLn2.js} +1 -1
  105. package/dist/web/assets/{cssMode-Cg4Jey3B.js → cssMode-1tbsSShK.js} +1 -1
  106. package/dist/web/assets/{folder-open-BqInWH_9.js → folder-open-Da8t5AtB.js} +1 -1
  107. package/dist/web/assets/{folder-plus-BSA6I7ld.js → folder-plus-X7B8dzc3.js} +1 -1
  108. package/dist/web/assets/{git-commit-horizontal-CLDqrpDQ.js → git-commit-horizontal-CajQIfK5.js} +1 -1
  109. package/dist/web/assets/{htmlMode-DHHN3vwk.js → htmlMode-qapgENKW.js} +1 -1
  110. package/dist/web/assets/{index-VtbQYCWA.js → index-DUQK09vA.js} +2 -2
  111. package/dist/web/assets/{info-BSebzpyp.js → info-BYfs9_PT.js} +1 -1
  112. package/dist/web/assets/{jsonMode-mvqMGlEK.js → jsonMode-DYPkWxLK.js} +1 -1
  113. package/dist/web/assets/{lspLanguageFeatures-Bw_QMGcP.js → lspLanguageFeatures-Cbcp__rz.js} +1 -1
  114. package/dist/web/assets/{minimize-2-CaHjbHpF.js → minimize-2-Dp7tWjno.js} +1 -1
  115. package/dist/web/assets/{monaco.contribution-DubQum0F.js → monaco.contribution-COP3_DCK.js} +2 -2
  116. package/dist/web/assets/{monaco.contribution-KrPDFXc4.js → monaco.contribution-CcL6YtdZ.js} +2 -2
  117. package/dist/web/assets/{monaco.contribution-CBkwYqsg.js → monaco.contribution-DApKEq_e.js} +2 -2
  118. package/dist/web/assets/{monaco.contribution-CiXEi4Ka.js → monaco.contribution-cIq6c5M4.js} +2 -2
  119. package/dist/web/assets/{monitor-DwOfVMY6.js → monitor-nP1D5S_1.js} +1 -1
  120. package/dist/web/assets/{python-BPnA89YS.js → python-DXYfRGSs.js} +1 -1
  121. package/dist/web/assets/{refresh-cw-DO-hUyTn.js → refresh-cw-D_9Q01ox.js} +1 -1
  122. package/dist/web/assets/{save-C7WFI7Mn.js → save-BxG7d5Nm.js} +1 -1
  123. package/dist/web/assets/{square-DiLQ59tw.js → square--Ua9DQPL.js} +1 -1
  124. package/dist/web/assets/{toggleHighContrast-BWFPIQBM.js → toggleHighContrast-CqAtkn5E.js} +1 -1
  125. package/dist/web/assets/{tsMode-CWxqU0x6.js → tsMode-BCdfa4wT.js} +1 -1
  126. package/dist/web/assets/{upload-vUnuWYGk.js → upload-BkYSJcbc.js} +1 -1
  127. package/dist/web/assets/{useLocalAgentSchedules-BFbGmflA.js → useLocalAgentSchedules-CGlPbPZr.js} +1 -1
  128. package/dist/web/assets/{useSessionTurnCache-C0zgYrCB.js → useSessionTurnCache-DtNQyWXl.js} +1 -1
  129. package/dist/web/assets/{wifi-off-DbNO6u3Z.js → wifi-off-DF8YmlRa.js} +1 -1
  130. package/dist/web/assets/{workers-4I09fePv.js → workers-BUHY0ojx.js} +1 -1
  131. package/dist/web/assets/{yaml-DpHYonDY.js → yaml-CtBzXx8s.js} +1 -1
  132. package/dist/web/index.html +1 -1
  133. package/docs/command-reference.md +35 -0
  134. package/package.json +3 -1
  135. package/dist/chunks/actions-command-GNQREIDD.js +0 -2
  136. package/dist/chunks/app-server-runtime-D74FFS27.js +0 -2
  137. package/dist/chunks/apps-2SUP5JZE.js +0 -2
  138. package/dist/chunks/chunk-2O5UZOYL.js +0 -13
  139. package/dist/chunks/chunk-3LG4G5JR.js +0 -3
  140. package/dist/chunks/chunk-BLXEK5F7.js +0 -26
  141. package/dist/chunks/chunk-DAOLQUAK.js +0 -19
  142. package/dist/chunks/chunk-EIB7GHIQ.js +0 -4
  143. package/dist/chunks/chunk-FFEI7IRU.js +0 -2
  144. package/dist/chunks/chunk-FOW3LI6G.js +0 -2
  145. package/dist/chunks/chunk-IYROEHYB.js +0 -2
  146. package/dist/chunks/chunk-TZ6N7WFI.js +0 -5
  147. package/dist/chunks/chunk-XISNUB62.js +0 -2
  148. package/dist/chunks/cli-A2P56J7R.js +0 -2
  149. package/dist/chunks/core-commands-CMAAUKPQ.js +0 -2
  150. package/dist/chunks/desktop-test-5PKGG6H6.js +0 -3
  151. package/dist/chunks/dist-CEKBK32A.js +0 -2
  152. package/dist/chunks/hosted-harness-runtime-ABEMAABI.js +0 -2
  153. package/dist/chunks/hosted-profile-compiler-CSLJT75T.js +0 -3
  154. package/dist/chunks/opchat-IMGIFM4W.js +0 -3
  155. package/dist/chunks/organizations-G3UOHURO.js +0 -2
  156. package/dist/chunks/project-agent-DTAVYEB6.js +0 -2
  157. package/dist/chunks/sandbox-command-YO6RR5SD.js +0 -2
  158. package/dist/web/assets/HostedModelLearningReview-BhGIhvoc.js +0 -1
@@ -1,6 +1,6 @@
1
1
  #!/usr/bin/env node
2
2
  import { createRequire as __openpondCreateRequire } from "node:module"; var require = __openpondCreateRequire(import.meta.url);
3
- import{p as vt,q as St}from"./chunk-DXOOJFFU.js";import{Ga as yt}from"./chunk-BLXEK5F7.js";import"./chunk-L3KS6MOV.js";import{n as pe,o as ht,q as me}from"./chunk-DAOLQUAK.js";import"./chunk-6MI4KKWF.js";import"./chunk-DG4DIFF4.js";import"./chunk-SDO4FC4Q.js";import"./chunk-IR3YJWPW.js";import"./chunk-MJC26GOX.js";import"./chunk-2O5UZOYL.js";import"./chunk-QUNRWDVO.js";import"./chunk-6FA3GG5B.js";import{J as He,K as ee,M as pt,N as mt,Q as ft,T as gt}from"./chunk-L6NNQUAT.js";import"./chunk-HZP5U2AA.js";import"./chunk-ES2ISFJC.js";import{f as dt,h as ct}from"./chunk-H7IWJN7L.js";import{a as i}from"./chunk-FTQLQJQV.js";import{createInterface as oo}from"node:readline/promises";import{stdin as Fe,stdout as k}from"node:process";import{pathToFileURL as io}from"node:url";function ge(){return{text:"",cursor:0,history:[],historyIndex:null}}i(ge,"createComposer");function wt(e,t){let r=e.text.slice(0,e.cursor),n=e.text.slice(e.cursor);return{...e,text:`${r}${t}${n}`,cursor:e.cursor+t.length,historyIndex:null}}i(wt,"insertText");function fe(e,t){return{...e,text:t,cursor:t.length}}i(fe,"replaceComposerText");function Rr(e){let t=e.text.trim();return t?{state:{text:"",cursor:0,history:[...e.history.filter(r=>r!==t),t].slice(-100),historyIndex:null},action:{type:"submit",text:t}}:{state:{...e,text:"",cursor:0,historyIndex:null},action:{type:"none"}}}i(Rr,"submitComposer");function Tt(e,t){if(t==="ctrl+c")return{state:e,action:{type:"cancel-or-exit"}};if(t==="ctrl+d")return{state:e,action:e.text?{type:"none"}:{type:"exit"}};if(t==="ctrl+l")return{state:e,action:{type:"rerender"}};if(t==="enter")return Rr(e);if(t==="alt+enter")return{state:wt(e,`
3
+ import{p as vt,q as St}from"./chunk-25OT6IYM.js";import"./chunk-XHJUP7M4.js";import{O as gt}from"./chunk-SBBXUZWL.js";import"./chunk-L3KS6MOV.js";import{E as pe,F as dt,H as me}from"./chunk-MRGA6BKG.js";import"./chunk-6MI4KKWF.js";import"./chunk-WCZRDULE.js";import"./chunk-MJC26GOX.js";import"./chunk-JUX77H6K.js";import"./chunk-QUNRWDVO.js";import"./chunk-6FA3GG5B.js";import"./chunk-SDO4FC4Q.js";import"./chunk-IR3YJWPW.js";import{A as ee,C as ct,D as pt,G as mt,J as ft,z as He}from"./chunk-QK2GLRCY.js";import"./chunk-HZP5U2AA.js";import"./chunk-ES2ISFJC.js";import{f as ht,h as yt}from"./chunk-H7IWJN7L.js";import{a as i}from"./chunk-FTQLQJQV.js";import{createInterface as oo}from"node:readline/promises";import{stdin as Fe,stdout as k}from"node:process";import{pathToFileURL as io}from"node:url";function ge(){return{text:"",cursor:0,history:[],historyIndex:null}}i(ge,"createComposer");function wt(e,t){let r=e.text.slice(0,e.cursor),n=e.text.slice(e.cursor);return{...e,text:`${r}${t}${n}`,cursor:e.cursor+t.length,historyIndex:null}}i(wt,"insertText");function fe(e,t){return{...e,text:t,cursor:t.length}}i(fe,"replaceComposerText");function Rr(e){let t=e.text.trim();return t?{state:{text:"",cursor:0,history:[...e.history.filter(r=>r!==t),t].slice(-100),historyIndex:null},action:{type:"submit",text:t}}:{state:{...e,text:"",cursor:0,historyIndex:null},action:{type:"none"}}}i(Rr,"submitComposer");function Tt(e,t){if(t==="ctrl+c")return{state:e,action:{type:"cancel-or-exit"}};if(t==="ctrl+d")return{state:e,action:e.text?{type:"none"}:{type:"exit"}};if(t==="ctrl+l")return{state:e,action:{type:"rerender"}};if(t==="enter")return Rr(e);if(t==="alt+enter")return{state:wt(e,`
4
4
  `),action:{type:"none"}};if(t==="backspace")return e.cursor<=0?{state:e,action:{type:"none"}}:{state:{...e,text:`${e.text.slice(0,e.cursor-1)}${e.text.slice(e.cursor)}`,cursor:e.cursor-1},action:{type:"none"}};if(t==="delete")return e.cursor>=e.text.length?{state:e,action:{type:"none"}}:{state:{...e,text:`${e.text.slice(0,e.cursor)}${e.text.slice(e.cursor+1)}`},action:{type:"none"}};if(t==="left")return{state:{...e,cursor:Math.max(0,e.cursor-1)},action:{type:"none"}};if(t==="right")return{state:{...e,cursor:Math.min(e.text.length,e.cursor+1)},action:{type:"none"}};if(t==="home"||t==="ctrl+a")return{state:{...e,cursor:0},action:{type:"none"}};if(t==="end"||t==="ctrl+e")return{state:{...e,cursor:e.text.length},action:{type:"none"}};if(t==="ctrl+u")return{state:{...e,text:e.text.slice(e.cursor),cursor:0},action:{type:"none"}};if(t==="ctrl+k")return{state:{...e,text:e.text.slice(0,e.cursor)},action:{type:"none"}};if(t==="up"){if(e.history.length===0)return{state:e,action:{type:"none"}};let r=e.historyIndex===null?e.history.length-1:Math.max(0,e.historyIndex-1);return{state:fe({...e,historyIndex:r},e.history[r]??""),action:{type:"none"}}}if(t==="down"){if(e.historyIndex===null)return{state:e,action:{type:"none"}};let r=e.historyIndex+1;return r>=e.history.length?{state:{...e,text:"",cursor:0,historyIndex:null},action:{type:"none"}}:{state:fe({...e,historyIndex:r},e.history[r]??""),action:{type:"none"}}}return t.length>0?{state:wt(e,t),action:{type:"none"}}:{state:e,action:{type:"none"}}}i(Tt,"handleComposerKey");var bt="A turn is already running. Wait for it to finish before sending another line.";function Mr(){let e=!1;return{isRunning(){return e},tryStartSubmission(){return e?!1:(e=!0,!0)},failSubmission(){e=!1},applyRuntimeEvent(t){t.name==="turn.started"&&(e=!0),(t.name==="turn.completed"||t.name==="turn.failed"||t.name==="turn.interrupted")&&(e=!1)}}}i(Mr,"createTerminalTurnSubmissionGuard");function Pt(){return Mr()}i(Pt,"createLineModeTurnGuard");var he=[{name:"help",usage:"/help",description:"show this help"},{name:"providers",usage:"/providers",description:"list providers"},{name:"provider",usage:"/provider [id]",description:"switch provider",requiresArgument:!0},{name:"model",usage:"/model [id]",description:"list or switch model"},{name:"apps",usage:"/apps",description:"list connectable apps"},{name:"install",usage:"/install <app>",description:"open app details",requiresArgument:!0},{name:"projects",usage:"/projects",description:"list projects"},{name:"project",usage:"/project <id>",description:"switch project",requiresArgument:!0},{name:"permissions",usage:"/permissions [ask|full-access]",description:"show or change command access"},{name:"profile",usage:"/profile [status|diff|catalog|check|push]",description:"show or sync profile"},{name:"agents",usage:"/agents",description:"list agents"},{name:"agent",usage:"/agent <id>",description:"select agent",requiresArgument:!0},{name:"run",usage:"/run <action> [json]",description:"run profile action",requiresArgument:!0},{name:"settings",usage:"/settings",description:"show settings"},{name:"logs",usage:"/logs",description:"show recent events"},{name:"compact",usage:"/compact",description:"compact current session"},{name:"clear",usage:"/clear",description:"clear terminal transcript"},{name:"exit",usage:"/exit",description:"exit"},{name:"hooks",usage:"/hooks",description:"show hook status"},{name:"start",usage:"/start",description:"start a new session"}];function ze(e){if(!e.startsWith("/"))return null;let[t="",...r]=e.slice(1).trim().split(/\s+/),n=t.toLowerCase();if(!n)return null;if(n==="exit"||n==="quit")return{type:"exit"};if(n==="help")return{type:"help"};if(n==="clear")return{type:"clear"};if(n==="agents")return{type:"agents"};if(n==="apps")return{type:"apps"};if(n==="agent")return{type:"agent",id:r.join(" ").trim()};if(n==="install")return{type:"install",id:r.join(" ").trim()};if(n==="projects")return{type:"projects"};if(n==="project")return{type:"project",id:r.join(" ").trim()};if(n==="model")return{type:"model",id:r.join(" ").trim()||null};if(n==="permissions")return{type:"permissions",args:r};if(n==="profile")return{type:"profile",args:r};if(n==="logs")return{type:"logs"};if(n==="providers")return{type:"providers"};if(n==="provider")return{type:"provider",id:r.join(" ").trim()||null};if(n==="compact")return{type:"compact"};if(n==="hooks")return{type:"hooks"};if(n==="start")return{type:"start"};if(n==="run"){let o=r[0]??"",s=r.slice(1).join(" ").trim();return s?{type:"run",action:o,input:JSON.parse(s)}:{type:"run",action:o,input:void 0}}return n==="settings"?{type:"settings",args:r}:{type:"unknown",command:n}}i(ze,"parseSlashCommand");function xt(e){let t=e.trim();if(!t.startsWith("!"))return null;let r=t.slice(1).trim();return r?{command:r}:null}i(xt,"parseDirectCommandPrompt");function Ct(){let e=Math.max(...he.map(t=>t.usage.length));return["Commands:",...he.map(t=>`${t.usage.padEnd(e+2)}${t.description}`)].join(`
5
5
  `)}i(Ct,"helpText");var ye=class{static{i(this,"RawInput")}input;onKey;previousRawMode=!1;dataHandler=null;constructor(t,r){this.input=t,this.onKey=r}start(){this.previousRawMode=this.input.isRaw??!1,this.input.setRawMode(!0),this.input.resume(),this.dataHandler=t=>{for(let r of Or(t))this.onKey(r)},this.input.on("data",this.dataHandler)}stop(){this.dataHandler&&this.input.off("data",this.dataHandler),this.dataHandler=null,this.input.setRawMode(this.previousRawMode),this.input.pause()}};function Or(e){let t=e.toString("utf8"),r=[];for(let n=0;n<t.length;n+=1){let o=t[n],s=t[n+1];if(o==="\x1B"){let a=jr(t,n);r.push(a.key),n=a.end;continue}o===""?r.push("ctrl+c"):o===""?r.push("ctrl+d"):o==="\f"?r.push("ctrl+l"):o===""?r.push("ctrl+a"):o===""?r.push("ctrl+e"):o==="\v"?r.push("ctrl+k"):o===""?r.push("ctrl+u"):o==="\x7F"||o==="\b"?r.push("backspace"):o==="\r"||o===`
6
6
  `?r.push("enter"):(o>=" "||o&&s)&&r.push(o)}return r}i(Or,"decodeKeys");function jr(e,t){let r=e.slice(t);return r.startsWith("\x1B\r")||r.startsWith(`\x1B
@@ -25,12 +25,12 @@ ${" ".repeat(n+2)} ${a}`}),"","Use /install <app> to open setup."].join(`
25
25
  `):"No local profile diff."}i(Jt,"formatProfileDiff");function Kt(e){return e.mode==="none"?"No active OpenPond profile. Run `openpond init`.":e.actionCatalog.length===0?"No profile actions found. Run `openpond profile check build`.":e.actionCatalog.map(t=>{let r=t.label??t.name??t.id,n=t.description?` - ${t.description}`:"",o=Me(e,t.id),s=o.length?` setup_required:${o.map(a=>a.label).join(",")}`:"";return`${t.id} ${r}${n}${s}`}).join(`
26
26
  `)}i(Kt,"formatProfileCatalog");function Vt(e,t){if(e.agents.length===0)return"No profile agents found.";let r=e.agents.map(o=>`${o.id===t?"*":" "} ${o.id} ${o.enabled?"enabled":"disabled"} ${o.path}`),n=e.actionCatalog.map(o=>{let s=Me(e,o.id),a=s.length?` setup_required:${s.map(l=>l.label).join(",")}`:"";return` /run ${o.id} ${o.label??o.name??""}${a}`.trimEnd()});return[...r,n.length?`
27
27
  Actions:`:"",...n].filter(Boolean).join(`
28
- `)}i(Vt,"formatProfileAgents");function Me(e,t){return e.setupGate.blockingRequirements.filter(r=>r.actionId===null||r.actionId===t)}i(Me,"blockingSetupRequirementsForAction");function on(e){return`${e.actionId?`${e.actionId}: `:""}${e.label} (${e.status})`}i(on,"formatProfileSetupRequirement");var G=class extends Error{static{i(this,"TerminalUsageError")}exitCode=2;constructor(t){super(t),this.name="TerminalUsageError"}};function Xt(e,t=process.cwd()){let[r="chat",...n]=e,o={server:"http://127.0.0.1:17874",provider:pt,model:null,cwd:t,agent:null,project:null,resume:null,noServerStart:!1,message:null,messageFile:null,stdin:!1,nonInteractive:!1,json:!1,yes:!1,approvalPolicy:"on-request",sandbox:"workspace-write",timeoutSec:null,maxOutputBytes:null};for(let s=0;s<n.length;s+=1){let a=n[s];if(a==="--server")o.server=n[++s]??o.server;else if(a==="--provider")o.provider=re(n[++s]??null)??o.provider;else if(a==="--model"){let l=Ae(n[++s]??null,o.provider);l.provider&&(o.provider=l.provider),o.model=l.model}else if(a==="--cwd")o.cwd=Qt.resolve(n[++s]??o.cwd),o.cwdExplicit=!0;else if(a==="--agent")o.agent=U(n,++s,"agent");else if(a==="--project")o.project=n[++s]??null;else if(a==="--resume")o.resume=n[++s]??null;else if(a==="--no-server-start")o.noServerStart=!0;else if(a==="--message")o.message=U(n,++s,"message");else if(a==="--message-file")o.messageFile=Qt.resolve(U(n,++s,"message-file"));else if(a==="--stdin"){let l=Oe(n,s);o.stdin=l.value,s=l.index}else if(a==="--non-interactive"){let l=Oe(n,s);o.nonInteractive=l.value,s=l.index}else if(a==="--json"){let l=Oe(n,s);o.json=l.value,s=l.index}else if(a==="--yes"){let l=Oe(n,s);o.yes=l.value,s=l.index}else if(a==="--approval-policy")o.approvalPolicy=un(U(n,++s,"approval-policy"));else if(a==="--sandbox")o.sandbox=dn(U(n,++s,"sandbox"));else if(a==="--timeout-sec")o.timeoutSec=Yt(U(n,++s,"timeout-sec"),"timeout-sec");else if(a==="--max-output-bytes")o.maxOutputBytes=Yt(U(n,++s,"max-output-bytes"),"max-output-bytes");else if(a.startsWith("-"))throw new G(`unknown option ${a}`)}return{command:r,options:o}}i(Xt,"parseTerminalArgs");function sn(e){return!!(e.nonInteractive||e.message||e.messageFile||e.stdin)}i(sn,"shouldRunOneShotChat");function Zt(e,t){return sn(e)?"one-shot":!t.inputIsTTY||!t.outputIsTTY?"line-mode":"interactive"}i(Zt,"resolveTerminalChatMode");function U(e,t,r){let n=e[t];if(!n||n.startsWith("--"))throw new G(`${r} requires a value`);return n}i(U,"readStringArg");function Oe(e,t){let r=e[t+1];return r&&an(r)?{value:ln(r),index:t+1}:{value:!0,index:t}}i(Oe,"readOptionalBoolean");function an(e){return/^(true|false|1|0|yes|no)$/i.test(e)}i(an,"isBooleanLiteral");function ln(e){return/^(true|1|yes)$/i.test(e)}i(ln,"parseBooleanLiteral");function un(e){if(e==="on-request"||e==="never"||e==="on-failure"||e==="untrusted")return e;throw new G("approval-policy must be on-request, never, on-failure, or untrusted")}i(un,"parseApprovalPolicy");function dn(e){if(e==="read-only"||e==="workspace-write"||e==="danger-full-access")return e;throw new G("sandbox must be read-only, workspace-write, or danger-full-access")}i(dn,"parseSandboxMode");function Yt(e,t){let r=Number(e);if(!Number.isInteger(r)||r<=0)throw new G(`${t} must be a positive integer`);return r}i(Yt,"parsePositiveInteger");import{spawn as rr}from"node:child_process";import{promises as cn}from"node:fs";import je from"node:path";import{createRequire as pn}from"node:module";import{fileURLToPath as mn}from"node:url";var nr=je.dirname(mn(import.meta.url)),rt=null,oe=null;function fn(){return ct(dt()).token}i(fn,"tokenFilePath");async function gn(){try{return(await cn.readFile(fn(),"utf8")).trim()||null}catch{return null}}i(gn,"readToken");async function C(e,t,r,n){let o=new Headers(n?.headers);o.set("Content-Type","application/json"),o.set("Authorization",`Bearer ${t}`);let s=await fetch(`${e}${r}`,{...n,headers:o});if(!s.ok){let a=await s.json().catch(()=>({})),l=a&&typeof a=="object"&&"error"in a?String(a.error):s.statusText;throw new Error(l)}return await s.json()}i(C,"apiFetch");async function hn(e){try{return(await fetch(`${e}/health`)).ok}catch{return!1}}i(hn,"health");function yn(){return je.resolve(nr,"../../..")}i(yn,"repoRoot");async function vn(e,t){let r=yn(),n=process.env.OPENPOND_SERVER_RUNNER,o=wn(process.env.OPENPOND_SERVER_ARGS),s=!n&&je.basename(nr)==="src",a=je.join(r,"apps","server",s?"src/index.ts":"dist/index.js"),l=n??process.env.OPENPOND_NODE_BINARY??process.execPath,c=[...n?o:s?[pn(import.meta.url).resolve("tsx/cli"),a]:[a],...Sn(e)],d=rr(l,c,{cwd:process.env.OPENPOND_SERVER_CWD||r,env:process.env,detached:process.platform!=="win32"});return rt=d,new Promise((h,g)=>{let A=!1,T=i(()=>{clearTimeout(E),d.stdout.off("data",D),d.stderr.off("data",$),d.off("error",O),d.off("exit",F)},"cleanup"),x=i(v=>{A||(A=!0,T(),h(v))},"finish"),m=i(v=>{A||(A=!0,T(),g(v))},"fail"),P=vt("OPENPOND_APP_SERVER_READY ",v=>{x(v.url||"http://127.0.0.1:17874")}),E=setTimeout(()=>m(new Error("server start timed out")),15e3),D=i(v=>{try{P.push(v.toString("utf8"))}catch(R){m(R instanceof Error?R:new Error(String(R)))}},"onStdout"),$=i(v=>{let R=v.toString("utf8").trim();R&&t(R)},"onStderr"),O=i(v=>m(v),"onError"),F=i((v,R)=>{P.flush(),m(new Error(`server exited with ${R?`signal ${R}`:`code ${v??"unknown"}`}`))},"onExit");d.stdout.on("data",D),d.stderr.on("data",$),d.once("error",O),d.once("exit",F)})}i(vn,"startServer");function Sn(e){let t;try{t=new URL(e)}catch{throw new Error(`Invalid OpenPond App server URL: ${e}`)}if(t.protocol!=="http:"&&t.protocol!=="https:")throw new Error(`OpenPond App server URL must use http or https: ${e}`);let r=t.hostname.replace(/^\[|\]$/g,""),n=t.port||(t.protocol==="https:"?"443":"80");return["--host",r,"--port",n]}i(Sn,"serverListenArgs");function wn(e){if(!e)return[];try{let t=JSON.parse(e);if(Array.isArray(t)&&t.every(r=>typeof r=="string"))return t}catch{}throw new Error("OPENPOND_SERVER_ARGS must be a JSON string array")}i(wn,"parseConfiguredServerArgs");async function ie(e,t){let r=e.server;if(!await hn(r)){if(e.noServerStart)throw new Error(`No server is listening at ${r}`);try{r=await vn(r,t)}catch(o){throw await V(),o}}let n=await gn();if(!n)throw new Error("Missing OpenPond App capability token");return{server:r,token:n}}i(ie,"ensureServer");function V(){if(oe)return oe;let e=rt;return rt=null,e?(oe=Tn(e).finally(()=>{oe=null}),oe):Promise.resolve()}i(V,"stopManagedServer");async function Tn(e,t={}){if(er(e,"SIGTERM"),!await tr(e,t.gracefulTimeoutMs??5e3)&&(er(e,"SIGKILL"),!await tr(e,t.killTimeoutMs??2e3)))throw new Error(`terminal-owned server process tree ${e.pid??"unknown"} did not exit`)}i(Tn,"stopTerminalProcessTree");function er(e,t){if(!(!e.pid||e.exitCode!==null)){if(process.platform==="win32"){let r=["/pid",String(e.pid),"/t",...t==="SIGKILL"?["/f"]:[]];rr("taskkill",r,{stdio:"ignore",windowsHide:!0}).unref();return}try{process.kill(-e.pid,t)}catch{e.kill(t)}}}i(er,"terminateProcessTree");async function tr(e,t){return e.exitCode!==null||e.signalCode!==null?!0:new Promise(r=>{let n=setTimeout(()=>{e.off("exit",o),r(!1)},t),o=i(()=>{clearTimeout(n),r(!0)},"onExit");e.once("exit",o)})}i(tr,"waitForExit");function Le(e,t){let r=bn(t);if(!r)return null;let n=e.localProjects.find(a=>Pn(a,r));if(n)return{kind:"local_project",id:n.id,label:n.name,session:{appId:n.linkedOpenPondApp?.appId??null,appName:n.linkedOpenPondApp?.appName??null,workspaceKind:"local_project",workspaceId:n.id,workspaceName:n.name,localProjectId:n.id,cloudProjectId:n.linkedSandboxProject?.projectId??null,cloudTeamId:n.linkedSandboxProject?.teamId??null,cwd:n.workspacePath}};let o=e.cloudProjects.find(a=>xn(a,r));if(o)return{kind:"cloud_project",id:o.id,label:o.name,provider:"openpond",session:{appId:null,appName:null,workspaceKind:"sandbox",workspaceId:o.id,workspaceName:o.name,cloudProjectId:o.id,cloudTeamId:o.teamId,cwd:null}};let s=e.apps.find(a=>Cn(a,r));return s?{kind:"sandbox_app",id:s.id,label:s.name,session:{appId:s.id,appName:s.name,workspaceKind:"sandbox_app",workspaceId:s.id,workspaceName:s.name}}:null}i(Le,"resolveTerminalProjectTarget");function nt(e){let t=[...e.localProjects.map(r=>`local ${r.id} ${r.name} ${r.workspacePath}`),...e.cloudProjects.map(r=>`cloud ${r.id} ${r.name}${r.slug?` (${r.slug})`:""}`),...e.apps.map(r=>`app ${r.id} ${r.name}`)];return t.length?t.join(`
29
- `):"No local projects, cloud projects, or OpenPond apps returned."}i(nt,"formatTerminalProjects");function bn(e){return e?.trim().toLowerCase()??""}i(bn,"normalizeProjectQuery");function Pn(e,t){return[e.id,e.name,e.path,e.workspacePath,e.repoPath??""].some(r=>r.trim().toLowerCase()===t)}i(Pn,"matchesLocalProject");function xn(e,t){return[e.id,e.name,e.slug??""].some(r=>r.trim().toLowerCase()===t)}i(xn,"matchesCloudProject");function Cn(e,t){return[e.id,e.name].some(r=>r.trim().toLowerCase()===t)}i(Cn,"matchesApp");import{realpath as or}from"node:fs/promises";import ir from"node:path";function sr(e){if(e.profile.mode!=="local")return"none";let t=e.profile.activeProfile??"local",r=e.profile.summary.state==="ready"?"":`:${e.profile.summary.state}`;return`${t}${r}`}i(sr,"profileLabel");function Ne(e,t){return t?[...e.sessions,...e.codexHistorySessions??[]].find(r=>r.id===t)??null:null}i(Ne,"findTerminalSession");function In(e,t,r){let n=Ne(e,t);return n?.modelRef?{provider:n.modelRef.providerId,model:n.modelRef.modelId}:n?.provider?{...r,provider:n.provider}:r}i(In,"resolveResumedTerminalSelection");async function _e(e,t,r){let n=Le(t,r.project);if(n&&r.cwdExplicit){if(n.kind!=="local_project"||!n.session.cwd)throw new Error("--cwd can only be combined with a local --project target.");await An(n.session.cwd,r.cwd)}let o=n?.provider??r.provider,s={...r,provider:o},a=n?{...n.session,...r.cwdExplicit?{cwd:r.cwd}:{}}:{appId:r.project,appName:null,cwd:r.cwd},l={...a.metadata??{},...r.headless?{openpondTerminalMode:"one-shot",openpondTerminal:{mode:"one-shot",sandbox:r.sandbox??null}}:{}},u={provider:o,modelRef:q(s,t.providers),title:n?.label?`${n.label} terminal`:"Terminal chat",...a,...Object.keys(l).length>0?{metadata:l}:{},...r.headless&&(r.yes||r.approvalPolicy==="never")?{openPondCommandAccessMode:"full-access"}:{}};return typeof a.cwd=="string"&&a.cwd&&(r.cwd=a.cwd),C(e.server,e.token,"/v1/sessions",{method:"POST",body:JSON.stringify(u),signal:e.signal})}i(_e,"createTerminalChatSession");async function se(e,t,r,n){let o=In(t,n,{provider:r.provider,model:r.model});if(n){if(r.cwdExplicit)throw new Error("--cwd cannot be combined with --resume; the resumed session workspace is authoritative.");let a=Ne(t,n);return a?.cwd&&(r.cwd=a.cwd),{sessionId:n,session:a,...o}}let s=await _e(e,t,{...r,...o});return{sessionId:s.id,session:s,...o}}i(se,"ensureTerminalChatSession");async function Q(e,t){return!t||t.workspaceKind!=="sandbox"&&t.workspaceKind!=="sandbox_template"?t:(await C(e.server,e.token,`/v1/sessions/${encodeURIComponent(t.id)}/workspace/ensure-ready`,{method:"POST",body:JSON.stringify({surface:"terminal"}),signal:e.signal})).session}i(Q,"ensureTerminalSessionWorkspaceReady");async function An(e,t){let[r,n]=await Promise.all([or(e),or(t)]),o=ir.relative(r,n);if(o.startsWith("..")||ir.isAbsolute(o))throw new Error(`--cwd must be the selected local project or one of its subdirectories: ${r}`)}i(An,"assertLocalProjectCwd");var ot=[{name:"yes",usage:"yes",description:"approve this command",submitText:"yes"},{name:"session",usage:"session",description:"approve this command family",submitText:"session"},{name:"no",usage:"no",description:"deny this command",submitText:"no"},{name:"skip",usage:"skip",description:"cancel this command request",submitText:"skip"}];function Y(e){let t=e?.trim().toLowerCase();return t==="yes"||t==="y"||t==="approve"?"yes":t==="session"||t==="s"?"session":t==="no"||t==="n"||t==="deny"?"no":t==="skip"||t==="cancel"?"skip":null}i(Y,"parseTerminalPermissionChoice");function ar(e){return e==="yes"?"accept":e==="session"?"acceptForSession":e==="skip"?"cancel":"decline"}i(ar,"terminalPermissionDecision");function lr(e){let t=e?.trim().toLowerCase();if(!t)return null;if(t==="full"||t==="full-access"||t==="full_access")return"full-access";let r=ft.safeParse(t);return r.success?r.data:null}i(lr,"parseTerminalPermissionMode");function it(e){return e==="full-access"?"Full access":e==="disabled"?"Disabled":"Ask"}i(it,"formatTerminalPermissionMode");function De(e,t){return!e||!t?null:(e.approvals??[]).filter(r=>r.kind==="command"&&r.status==="pending"&&r.sessionId===t).sort((r,n)=>Date.parse(n.createdAt)-Date.parse(r.createdAt))[0]??null}i(De,"latestPendingCommandApproval");function ur(e){if(e.name!=="approval.requested")return null;let t=yt.safeParse(e.data);return!t.success||t.data.kind!=="command"||t.data.status!=="pending"?null:t.data}i(ur,"commandApprovalFromRuntimeEvent");function dr(e){if(e.name!=="approval.resolved")return null;let t=e.data&&typeof e.data=="object"&&!Array.isArray(e.data)?e.data:null,r=t?.approvalId??t?.approval_id??t?.id;return typeof r=="string"&&r.trim()?r.trim():null}i(dr,"commandApprovalIdFromResolvedEvent");function cr(e,t){return(e?.sessions.find(n=>n.id===t)??e?.codexHistorySessions?.find(n=>n.id===t)??null)?.openPondCommandAccessMode??e?.preferences?.openPondCommandAccessMode??mt}i(cr,"commandAccessModeForSession");function pr(e){return[`Command access: ${it(e)}`,"Use /permissions ask or /permissions full-access to update this chat.","When a command approval is pending, /permissions opens yes/session/no/skip choices."].join(`
28
+ `)}i(Vt,"formatProfileAgents");function Me(e,t){return e.setupGate.blockingRequirements.filter(r=>r.actionId===null||r.actionId===t)}i(Me,"blockingSetupRequirementsForAction");function on(e){return`${e.actionId?`${e.actionId}: `:""}${e.label} (${e.status})`}i(on,"formatProfileSetupRequirement");var G=class extends Error{static{i(this,"TerminalUsageError")}exitCode=2;constructor(t){super(t),this.name="TerminalUsageError"}};function Xt(e,t=process.cwd()){let[r="chat",...n]=e,o={server:"http://127.0.0.1:17874",provider:ct,model:null,cwd:t,agent:null,project:null,resume:null,noServerStart:!1,message:null,messageFile:null,stdin:!1,nonInteractive:!1,json:!1,yes:!1,approvalPolicy:"on-request",sandbox:"workspace-write",timeoutSec:null,maxOutputBytes:null};for(let s=0;s<n.length;s+=1){let a=n[s];if(a==="--server")o.server=n[++s]??o.server;else if(a==="--provider")o.provider=re(n[++s]??null)??o.provider;else if(a==="--model"){let l=Ae(n[++s]??null,o.provider);l.provider&&(o.provider=l.provider),o.model=l.model}else if(a==="--cwd")o.cwd=Qt.resolve(n[++s]??o.cwd),o.cwdExplicit=!0;else if(a==="--agent")o.agent=U(n,++s,"agent");else if(a==="--project")o.project=n[++s]??null;else if(a==="--resume")o.resume=n[++s]??null;else if(a==="--no-server-start")o.noServerStart=!0;else if(a==="--message")o.message=U(n,++s,"message");else if(a==="--message-file")o.messageFile=Qt.resolve(U(n,++s,"message-file"));else if(a==="--stdin"){let l=Oe(n,s);o.stdin=l.value,s=l.index}else if(a==="--non-interactive"){let l=Oe(n,s);o.nonInteractive=l.value,s=l.index}else if(a==="--json"){let l=Oe(n,s);o.json=l.value,s=l.index}else if(a==="--yes"){let l=Oe(n,s);o.yes=l.value,s=l.index}else if(a==="--approval-policy")o.approvalPolicy=un(U(n,++s,"approval-policy"));else if(a==="--sandbox")o.sandbox=dn(U(n,++s,"sandbox"));else if(a==="--timeout-sec")o.timeoutSec=Yt(U(n,++s,"timeout-sec"),"timeout-sec");else if(a==="--max-output-bytes")o.maxOutputBytes=Yt(U(n,++s,"max-output-bytes"),"max-output-bytes");else if(a.startsWith("-"))throw new G(`unknown option ${a}`)}return{command:r,options:o}}i(Xt,"parseTerminalArgs");function sn(e){return!!(e.nonInteractive||e.message||e.messageFile||e.stdin)}i(sn,"shouldRunOneShotChat");function Zt(e,t){return sn(e)?"one-shot":!t.inputIsTTY||!t.outputIsTTY?"line-mode":"interactive"}i(Zt,"resolveTerminalChatMode");function U(e,t,r){let n=e[t];if(!n||n.startsWith("--"))throw new G(`${r} requires a value`);return n}i(U,"readStringArg");function Oe(e,t){let r=e[t+1];return r&&an(r)?{value:ln(r),index:t+1}:{value:!0,index:t}}i(Oe,"readOptionalBoolean");function an(e){return/^(true|false|1|0|yes|no)$/i.test(e)}i(an,"isBooleanLiteral");function ln(e){return/^(true|1|yes)$/i.test(e)}i(ln,"parseBooleanLiteral");function un(e){if(e==="on-request"||e==="never"||e==="on-failure"||e==="untrusted")return e;throw new G("approval-policy must be on-request, never, on-failure, or untrusted")}i(un,"parseApprovalPolicy");function dn(e){if(e==="read-only"||e==="workspace-write"||e==="danger-full-access")return e;throw new G("sandbox must be read-only, workspace-write, or danger-full-access")}i(dn,"parseSandboxMode");function Yt(e,t){let r=Number(e);if(!Number.isInteger(r)||r<=0)throw new G(`${t} must be a positive integer`);return r}i(Yt,"parsePositiveInteger");import{spawn as rr}from"node:child_process";import{promises as cn}from"node:fs";import je from"node:path";import{createRequire as pn}from"node:module";import{fileURLToPath as mn}from"node:url";var nr=je.dirname(mn(import.meta.url)),rt=null,oe=null;function fn(){return yt(ht()).token}i(fn,"tokenFilePath");async function gn(){try{return(await cn.readFile(fn(),"utf8")).trim()||null}catch{return null}}i(gn,"readToken");async function C(e,t,r,n){let o=new Headers(n?.headers);o.set("Content-Type","application/json"),o.set("Authorization",`Bearer ${t}`);let s=await fetch(`${e}${r}`,{...n,headers:o});if(!s.ok){let a=await s.json().catch(()=>({})),l=a&&typeof a=="object"&&"error"in a?String(a.error):s.statusText;throw new Error(l)}return await s.json()}i(C,"apiFetch");async function hn(e){try{return(await fetch(`${e}/health`)).ok}catch{return!1}}i(hn,"health");function yn(){return je.resolve(nr,"../../..")}i(yn,"repoRoot");async function vn(e,t){let r=yn(),n=process.env.OPENPOND_SERVER_RUNNER,o=wn(process.env.OPENPOND_SERVER_ARGS),s=!n&&je.basename(nr)==="src",a=je.join(r,"apps","server",s?"src/index.ts":"dist/index.js"),l=n??process.env.OPENPOND_NODE_BINARY??process.execPath,c=[...n?o:s?[pn(import.meta.url).resolve("tsx/cli"),a]:[a],...Sn(e)],d=rr(l,c,{cwd:process.env.OPENPOND_SERVER_CWD||r,env:process.env,detached:process.platform!=="win32"});return rt=d,new Promise((h,g)=>{let A=!1,T=i(()=>{clearTimeout(E),d.stdout.off("data",D),d.stderr.off("data",$),d.off("error",O),d.off("exit",F)},"cleanup"),x=i(v=>{A||(A=!0,T(),h(v))},"finish"),m=i(v=>{A||(A=!0,T(),g(v))},"fail"),P=vt("OPENPOND_APP_SERVER_READY ",v=>{x(v.url||"http://127.0.0.1:17874")}),E=setTimeout(()=>m(new Error("server start timed out")),15e3),D=i(v=>{try{P.push(v.toString("utf8"))}catch(R){m(R instanceof Error?R:new Error(String(R)))}},"onStdout"),$=i(v=>{let R=v.toString("utf8").trim();R&&t(R)},"onStderr"),O=i(v=>m(v),"onError"),F=i((v,R)=>{P.flush(),m(new Error(`server exited with ${R?`signal ${R}`:`code ${v??"unknown"}`}`))},"onExit");d.stdout.on("data",D),d.stderr.on("data",$),d.once("error",O),d.once("exit",F)})}i(vn,"startServer");function Sn(e){let t;try{t=new URL(e)}catch{throw new Error(`Invalid OpenPond App server URL: ${e}`)}if(t.protocol!=="http:"&&t.protocol!=="https:")throw new Error(`OpenPond App server URL must use http or https: ${e}`);let r=t.hostname.replace(/^\[|\]$/g,""),n=t.port||(t.protocol==="https:"?"443":"80");return["--host",r,"--port",n]}i(Sn,"serverListenArgs");function wn(e){if(!e)return[];try{let t=JSON.parse(e);if(Array.isArray(t)&&t.every(r=>typeof r=="string"))return t}catch{}throw new Error("OPENPOND_SERVER_ARGS must be a JSON string array")}i(wn,"parseConfiguredServerArgs");async function ie(e,t){let r=e.server;if(!await hn(r)){if(e.noServerStart)throw new Error(`No server is listening at ${r}`);try{r=await vn(r,t)}catch(o){throw await V(),o}}let n=await gn();if(!n)throw new Error("Missing OpenPond App capability token");return{server:r,token:n}}i(ie,"ensureServer");function V(){if(oe)return oe;let e=rt;return rt=null,e?(oe=Tn(e).finally(()=>{oe=null}),oe):Promise.resolve()}i(V,"stopManagedServer");async function Tn(e,t={}){if(er(e,"SIGTERM"),!await tr(e,t.gracefulTimeoutMs??5e3)&&(er(e,"SIGKILL"),!await tr(e,t.killTimeoutMs??2e3)))throw new Error(`terminal-owned server process tree ${e.pid??"unknown"} did not exit`)}i(Tn,"stopTerminalProcessTree");function er(e,t){if(!(!e.pid||e.exitCode!==null)){if(process.platform==="win32"){let r=["/pid",String(e.pid),"/t",...t==="SIGKILL"?["/f"]:[]];rr("taskkill",r,{stdio:"ignore",windowsHide:!0}).unref();return}try{process.kill(-e.pid,t)}catch{e.kill(t)}}}i(er,"terminateProcessTree");async function tr(e,t){return e.exitCode!==null||e.signalCode!==null?!0:new Promise(r=>{let n=setTimeout(()=>{e.off("exit",o),r(!1)},t),o=i(()=>{clearTimeout(n),r(!0)},"onExit");e.once("exit",o)})}i(tr,"waitForExit");function Le(e,t){let r=bn(t);if(!r)return null;let n=e.localProjects.find(a=>Pn(a,r));if(n)return{kind:"local_project",id:n.id,label:n.name,session:{appId:n.linkedOpenPondApp?.appId??null,appName:n.linkedOpenPondApp?.appName??null,workspaceKind:"local_project",workspaceId:n.id,workspaceName:n.name,localProjectId:n.id,cloudProjectId:n.linkedSandboxProject?.projectId??null,cloudTeamId:n.linkedSandboxProject?.teamId??null,cwd:n.workspacePath}};let o=e.cloudProjects.find(a=>xn(a,r));if(o)return{kind:"cloud_project",id:o.id,label:o.name,provider:"openpond",session:{appId:null,appName:null,workspaceKind:"sandbox",workspaceId:o.id,workspaceName:o.name,cloudProjectId:o.id,cloudTeamId:o.teamId,cwd:null}};let s=e.apps.find(a=>Cn(a,r));return s?{kind:"sandbox_app",id:s.id,label:s.name,session:{appId:s.id,appName:s.name,workspaceKind:"sandbox_app",workspaceId:s.id,workspaceName:s.name}}:null}i(Le,"resolveTerminalProjectTarget");function nt(e){let t=[...e.localProjects.map(r=>`local ${r.id} ${r.name} ${r.workspacePath}`),...e.cloudProjects.map(r=>`cloud ${r.id} ${r.name}${r.slug?` (${r.slug})`:""}`),...e.apps.map(r=>`app ${r.id} ${r.name}`)];return t.length?t.join(`
29
+ `):"No local projects, cloud projects, or OpenPond apps returned."}i(nt,"formatTerminalProjects");function bn(e){return e?.trim().toLowerCase()??""}i(bn,"normalizeProjectQuery");function Pn(e,t){return[e.id,e.name,e.path,e.workspacePath,e.repoPath??""].some(r=>r.trim().toLowerCase()===t)}i(Pn,"matchesLocalProject");function xn(e,t){return[e.id,e.name,e.slug??""].some(r=>r.trim().toLowerCase()===t)}i(xn,"matchesCloudProject");function Cn(e,t){return[e.id,e.name].some(r=>r.trim().toLowerCase()===t)}i(Cn,"matchesApp");import{realpath as or}from"node:fs/promises";import ir from"node:path";function sr(e){if(e.profile.mode!=="local")return"none";let t=e.profile.activeProfile??"local",r=e.profile.summary.state==="ready"?"":`:${e.profile.summary.state}`;return`${t}${r}`}i(sr,"profileLabel");function Ne(e,t){return t?[...e.sessions,...e.codexHistorySessions??[]].find(r=>r.id===t)??null:null}i(Ne,"findTerminalSession");function In(e,t,r){let n=Ne(e,t);return n?.modelRef?{provider:n.modelRef.providerId,model:n.modelRef.modelId}:n?.provider?{...r,provider:n.provider}:r}i(In,"resolveResumedTerminalSelection");async function _e(e,t,r){let n=Le(t,r.project);if(n&&r.cwdExplicit){if(n.kind!=="local_project"||!n.session.cwd)throw new Error("--cwd can only be combined with a local --project target.");await An(n.session.cwd,r.cwd)}let o=n?.provider??r.provider,s={...r,provider:o},a=n?{...n.session,...r.cwdExplicit?{cwd:r.cwd}:{}}:{appId:r.project,appName:null,cwd:r.cwd},l={...a.metadata??{},...r.headless?{openpondTerminalMode:"one-shot",openpondTerminal:{mode:"one-shot",sandbox:r.sandbox??null}}:{}},u={provider:o,modelRef:q(s,t.providers),title:n?.label?`${n.label} terminal`:"Terminal chat",...a,...Object.keys(l).length>0?{metadata:l}:{},...r.headless&&(r.yes||r.approvalPolicy==="never")?{openPondCommandAccessMode:"full-access"}:{}};return typeof a.cwd=="string"&&a.cwd&&(r.cwd=a.cwd),C(e.server,e.token,"/v1/sessions",{method:"POST",body:JSON.stringify(u),signal:e.signal})}i(_e,"createTerminalChatSession");async function se(e,t,r,n){let o=In(t,n,{provider:r.provider,model:r.model});if(n){if(r.cwdExplicit)throw new Error("--cwd cannot be combined with --resume; the resumed session workspace is authoritative.");let a=Ne(t,n);return a?.cwd&&(r.cwd=a.cwd),{sessionId:n,session:a,...o}}let s=await _e(e,t,{...r,...o});return{sessionId:s.id,session:s,...o}}i(se,"ensureTerminalChatSession");async function Q(e,t){return!t||t.workspaceKind!=="sandbox"&&t.workspaceKind!=="sandbox_template"?t:(await C(e.server,e.token,`/v1/sessions/${encodeURIComponent(t.id)}/workspace/ensure-ready`,{method:"POST",body:JSON.stringify({surface:"terminal"}),signal:e.signal})).session}i(Q,"ensureTerminalSessionWorkspaceReady");async function An(e,t){let[r,n]=await Promise.all([or(e),or(t)]),o=ir.relative(r,n);if(o.startsWith("..")||ir.isAbsolute(o))throw new Error(`--cwd must be the selected local project or one of its subdirectories: ${r}`)}i(An,"assertLocalProjectCwd");var ot=[{name:"yes",usage:"yes",description:"approve this command",submitText:"yes"},{name:"session",usage:"session",description:"approve this command family",submitText:"session"},{name:"no",usage:"no",description:"deny this command",submitText:"no"},{name:"skip",usage:"skip",description:"cancel this command request",submitText:"skip"}];function Y(e){let t=e?.trim().toLowerCase();return t==="yes"||t==="y"||t==="approve"?"yes":t==="session"||t==="s"?"session":t==="no"||t==="n"||t==="deny"?"no":t==="skip"||t==="cancel"?"skip":null}i(Y,"parseTerminalPermissionChoice");function ar(e){return e==="yes"?"accept":e==="session"?"acceptForSession":e==="skip"?"cancel":"decline"}i(ar,"terminalPermissionDecision");function lr(e){let t=e?.trim().toLowerCase();if(!t)return null;if(t==="full"||t==="full-access"||t==="full_access")return"full-access";let r=mt.safeParse(t);return r.success?r.data:null}i(lr,"parseTerminalPermissionMode");function it(e){return e==="full-access"?"Full access":e==="disabled"?"Disabled":"Ask"}i(it,"formatTerminalPermissionMode");function De(e,t){return!e||!t?null:(e.approvals??[]).filter(r=>r.kind==="command"&&r.status==="pending"&&r.sessionId===t).sort((r,n)=>Date.parse(n.createdAt)-Date.parse(r.createdAt))[0]??null}i(De,"latestPendingCommandApproval");function ur(e){if(e.name!=="approval.requested")return null;let t=gt.safeParse(e.data);return!t.success||t.data.kind!=="command"||t.data.status!=="pending"?null:t.data}i(ur,"commandApprovalFromRuntimeEvent");function dr(e){if(e.name!=="approval.resolved")return null;let t=e.data&&typeof e.data=="object"&&!Array.isArray(e.data)?e.data:null,r=t?.approvalId??t?.approval_id??t?.id;return typeof r=="string"&&r.trim()?r.trim():null}i(dr,"commandApprovalIdFromResolvedEvent");function cr(e,t){return(e?.sessions.find(n=>n.id===t)??e?.codexHistorySessions?.find(n=>n.id===t)??null)?.openPondCommandAccessMode??e?.preferences?.openPondCommandAccessMode??pt}i(cr,"commandAccessModeForSession");function pr(e){return[`Command access: ${it(e)}`,"Use /permissions ask or /permissions full-access to update this chat.","When a command approval is pending, /permissions opens yes/session/no/skip choices."].join(`
30
30
  `)}i(pr,"formatTerminalPermissionsSummary");function We(e){let t=$n(e);return["Command approval",`command: ${t.command??e.title}`,t.cwd?`cwd: ${t.cwd}`:null,t.risk?`risk: ${t.risk}`:null,t.timeoutSeconds?`timeout: ${t.timeoutSeconds}s`:null,t.familyLabel?`session approval family: ${t.familyLabel}`:null,"Choose: yes, session, no, or skip."].filter(Boolean).join(`
31
31
  `)}i(We,"formatTerminalCommandApprovalQuestion");function $n(e){try{let t=JSON.parse(e.detail),r=t.sessionApprovalFamily&&typeof t.sessionApprovalFamily=="object"&&!Array.isArray(t.sessionApprovalFamily)?t.sessionApprovalFamily:null;return{command:Be(t.command),cwd:Be(t.cwd),risk:Be(t.risk),timeoutSeconds:typeof t.timeoutSeconds=="number"?t.timeoutSeconds:null,familyLabel:Be(r?.label)}}catch{return{command:null,cwd:null,risk:null,timeoutSeconds:null,familyLabel:null}}}i($n,"commandApprovalDetail");function Be(e){return typeof e=="string"&&e.trim()?e.trim():null}i(Be,"stringValue");async function fr(e,t){let r=t.getConnection();if(r){if(e.type==="exit"){t.requestExit();return}if(e.type==="clear"){t.clearTranscript(),t.render();return}if(e.type==="help"){t.addItem(p(Ct()));return}if(e.type==="projects"){let n=await t.refreshBootstrap();t.addItem(p(nt(n)));return}if(e.type==="providers"){let n=t.getPayload()??await t.refreshBootstrap();t.addItem(p(ke(n.providers,t.options.provider)));return}if(e.type==="provider"){let n=t.getPayload()??await t.refreshBootstrap();if(!e.id){t.addItem(p(ke(n.providers,t.options.provider)));return}let o=re(e.id);if(!o){t.addItem(p(`Unknown provider: ${e.id}
32
32
 
33
- ${ke(n.providers,t.options.provider)}`,"warning"));return}t.options.provider=o,t.options.model=null,t.addItem(p(`Provider set to ${_(n.providers,o)} / ${ne(n.providers,t.options)}`)),t.render();return}if(e.type==="apps"){let n=t.getPayload()??await t.refreshBootstrap();t.addItem(p(tt(n)));return}if(e.type==="install"){let n=ht(e.id);if(!n){t.addItem(p(`Unknown app: ${e.id}
33
+ ${ke(n.providers,t.options.provider)}`,"warning"));return}t.options.provider=o,t.options.model=null,t.addItem(p(`Provider set to ${_(n.providers,o)} / ${ne(n.providers,t.options)}`)),t.render();return}if(e.type==="apps"){let n=t.getPayload()??await t.refreshBootstrap();t.addItem(p(tt(n)));return}if(e.type==="install"){let n=dt(e.id);if(!n){t.addItem(p(`Unknown app: ${e.id}
34
34
 
35
35
  ${tt(t.getPayload())}`,"warning"));return}let o=t.getPayload()??await t.refreshBootstrap(),s=me({appId:n.id,baseUrl:o.account.baseUrl??o.account.activeProfile?.baseUrl??null,teamId:o.preferences.defaultTeamId??null});t.openUrl(s),t.addItem(p(`Opened ${n.label} setup:
36
36
  ${s}`));return}if(e.type==="project"){if(!e.id){t.addItem(p("Usage: /project <id>","warning"));return}let n=t.getPayload()??await t.refreshBootstrap(),o=Le(n,e.id);if(!o){t.addItem(p(`Project not found: ${e.id}
@@ -51,7 +51,7 @@ ${nt(n)}`,"warning"));return}let s={...t.options,project:o.id,provider:o.provide
51
51
  `);r.write(`${Ee(x.providers,e)}
52
52
  `)}let D=st({maxOutputBytes:e.maxOutputBytes});g=D;let $=i(S=>{},"resolveTerminalEvent"),O=new Promise(S=>{$=S});u=Zn({server:l.server,token:l.token,activeSessionId:d,onEvent:i(S=>{D.apply(S),e.json||r.write(to(S)),ro(S)&&$(S)},"onEvent"),onStatus:i(S=>{e.json||r.write(S)},"onStatus")}),await s.run("event stream readiness",u.ready);let F=(x.profile.actionCatalog??[]).filter(S=>zn(S,e.agent)&&(!S.agentId||x.profile.agents.some(j=>j.enabled&&j.id===S.agentId))).map(S=>({...S,implementation:{...S.implementation??{},type:"openpond-profile-action",actionId:S.id}})),v=P?.localProjectId??m.session?.localProjectId??null,R=v?await s.run("Project Action catalog",Hn({...l,signal:s.signal},v)):[],H=[...F,...R];await s.run("turn submission",C(l.server,l.token,`/v1/sessions/${d}/turns`,{method:"POST",body:JSON.stringify({prompt:T,...e.cwdExplicit||!e.project&&!e.resume?{cwd:e.cwd}:{},model:E,modelRef:q(e,x.providers),...H.length>0?{openPondActionCatalog:H}:{},approvalPolicy:e.yes?"never":e.approvalPolicy,sandbox:e.sandbox,metadata:{openpondTerminalMode:"one-shot",openpondTerminal:{mode:"one-shot",nonInteractive:!0,sandbox:e.sandbox,...e.agent?{agentId:e.agent}:{}}}}),signal:s.signal})),A=!0;let z=await s.run("turn completion",O),Z=D.result({terminal:z.name,sessionId:d,provider:e.provider,model:E,cwd:e.cwd,startedAt:o,startedAtMs:n,error:z.error??(z.name==="turn.failed"?z.output??"Turn failed.":null)});return at(r,e,Z),Z.status!=="completed"&&(process.exitCode=1),Z}catch(T){if(T instanceof X)throw T;if(T instanceof qe){c=!0,l&&d&&A&&await eo(l.server,l.token,d);let m=(g??st({maxOutputBytes:e.maxOutputBytes})).result({terminal:"timeout",sessionId:d,provider:e.provider,model:h,cwd:e.cwd,startedAt:o,startedAtMs:n,error:T.message});return at(r,e,m),process.exitCode=124,m}let x=(g??st({maxOutputBytes:e.maxOutputBytes})).result({terminal:"error",sessionId:d,provider:e.provider,model:h,cwd:e.cwd,startedAt:o,startedAtMs:n,error:T instanceof Error?T.message:String(T)});return at(r,e,x),process.exitCode=1,x}finally{s.dispose(),u?.abort(),t.connection||await V(),c&&!e.json&&r.write(`
53
53
  [turn timeout]
54
- `)}}i(xr,"runOneShotChat");async function Hn(e,t){return(await C(e.server,e.token,`/v1/projects/${encodeURIComponent(t)}/actions`,{signal:e.signal})).actions}i(Hn,"loadLocalProjectActionCatalog");function zn(e,t){return t?e.agentId===t||e.id===t||e.id.startsWith(`${t}.`):!0}i(zn,"profileActionMatchesAgent");function Jn(e){let t=new AbortController,r="startup",n=null,o=i(a=>{},"rejectTimeout"),s=new Promise((a,l)=>{o=l});return s.catch(()=>{}),e&&(n=setTimeout(()=>{t.abort(),o(new qe(r,e))},e*1e3)),{signal:t.signal,async run(a,l){return r=a,e?Promise.race([l,s]):l},dispose(){n&&clearTimeout(n)}}}i(Jn,"createOneShotDeadline");function st(e={}){let t=0,r=0,n=0,o="",s=0,a=!1,l=null,u=null,c=e.maxOutputBytes??null;return{apply(d){if(t+=1,d.turnId&&(l=d.turnId),d.name==="assistant.delta"&&d.output&&!a){let g=Vn(o,s,d.output,c);o=g.text,s=g.bytes,a=g.truncated}(d.name==="command.output"||d.name==="tool.completed"&&d.action==="exec_command")&&(r+=1),(d.name==="workspace_action"||d.name==="workspace_action_result")&&(n+=1);let h=Kn(d);h&&(u=h)},result(d){let h=Date.now(),g=d.terminal;return{status:no(g),sessionId:d.sessionId,turnId:l,provider:d.provider,model:d.model,cwd:d.cwd,startedAt:d.startedAt,finishedAt:new Date(h).toISOString(),durationMs:Math.max(0,h-d.startedAtMs),finalMessage:o,output:{finalMessageBytes:s,truncated:a,maxOutputBytes:c},events:{terminal:g,total:t,commands:r,workspaceActions:n},usage:u,error:d.error}}}}i(st,"createOneShotAccumulator");function Kn(e){if(e.name!=="session.context.updated")return null;let t=gt.safeParse(e.data);return!t.success||t.data.source==="heuristic"?null:t.data}i(Kn,"contextUsageFromEvent");function Vn(e,t,r,n){if(n===null)return{text:e+r,bytes:t+Pr(r),truncated:!1};let o=e,s=t;for(let a of r){let l=Pr(a);if(s+l>n)return{text:o,bytes:s,truncated:!0};o+=a,s+=l}return{text:o,bytes:s,truncated:!1}}i(Vn,"appendWithinByteLimit");function Pr(e){return new TextEncoder().encode(e).byteLength}i(Pr,"utf8Bytes");async function Qn(e,t){let r=[],n=!!t.isTTY,o=[e.message!==null?"--message":null,e.messageFile!==null?"--message-file":null,e.stdin?"--stdin":null].filter(s=>s!==null);if(o.length>1)throw new X(`openpond chat --non-interactive accepts exactly one instruction source; received ${o.join(", ")}.`,2);return e.message!==null&&r.push(e.message),e.messageFile&&r.push(await Yn(e.messageFile)),(e.stdin||e.nonInteractive&&!n&&!e.message&&!e.messageFile)&&r.push(await Xn(t)),r.join(`
54
+ `)}}i(xr,"runOneShotChat");async function Hn(e,t){return(await C(e.server,e.token,`/v1/projects/${encodeURIComponent(t)}/actions`,{signal:e.signal})).actions}i(Hn,"loadLocalProjectActionCatalog");function zn(e,t){return t?e.agentId===t||e.id===t||e.id.startsWith(`${t}.`):!0}i(zn,"profileActionMatchesAgent");function Jn(e){let t=new AbortController,r="startup",n=null,o=i(a=>{},"rejectTimeout"),s=new Promise((a,l)=>{o=l});return s.catch(()=>{}),e&&(n=setTimeout(()=>{t.abort(),o(new qe(r,e))},e*1e3)),{signal:t.signal,async run(a,l){return r=a,e?Promise.race([l,s]):l},dispose(){n&&clearTimeout(n)}}}i(Jn,"createOneShotDeadline");function st(e={}){let t=0,r=0,n=0,o="",s=0,a=!1,l=null,u=null,c=e.maxOutputBytes??null;return{apply(d){if(t+=1,d.turnId&&(l=d.turnId),d.name==="assistant.delta"&&d.output&&!a){let g=Vn(o,s,d.output,c);o=g.text,s=g.bytes,a=g.truncated}(d.name==="command.output"||d.name==="tool.completed"&&d.action==="exec_command")&&(r+=1),(d.name==="workspace_action"||d.name==="workspace_action_result")&&(n+=1);let h=Kn(d);h&&(u=h)},result(d){let h=Date.now(),g=d.terminal;return{status:no(g),sessionId:d.sessionId,turnId:l,provider:d.provider,model:d.model,cwd:d.cwd,startedAt:d.startedAt,finishedAt:new Date(h).toISOString(),durationMs:Math.max(0,h-d.startedAtMs),finalMessage:o,output:{finalMessageBytes:s,truncated:a,maxOutputBytes:c},events:{terminal:g,total:t,commands:r,workspaceActions:n},usage:u,error:d.error}}}}i(st,"createOneShotAccumulator");function Kn(e){if(e.name!=="session.context.updated")return null;let t=ft.safeParse(e.data);return!t.success||t.data.source==="heuristic"?null:t.data}i(Kn,"contextUsageFromEvent");function Vn(e,t,r,n){if(n===null)return{text:e+r,bytes:t+Pr(r),truncated:!1};let o=e,s=t;for(let a of r){let l=Pr(a);if(s+l>n)return{text:o,bytes:s,truncated:!0};o+=a,s+=l}return{text:o,bytes:s,truncated:!1}}i(Vn,"appendWithinByteLimit");function Pr(e){return new TextEncoder().encode(e).byteLength}i(Pr,"utf8Bytes");async function Qn(e,t){let r=[],n=!!t.isTTY,o=[e.message!==null?"--message":null,e.messageFile!==null?"--message-file":null,e.stdin?"--stdin":null].filter(s=>s!==null);if(o.length>1)throw new X(`openpond chat --non-interactive accepts exactly one instruction source; received ${o.join(", ")}.`,2);return e.message!==null&&r.push(e.message),e.messageFile&&r.push(await Yn(e.messageFile)),(e.stdin||e.nonInteractive&&!n&&!e.message&&!e.messageFile)&&r.push(await Xn(t)),r.join(`
55
55
 
56
56
  `).trimEnd()}i(Qn,"resolveOneShotPrompt");async function Yn(e){try{return await Fn(e,"utf8")}catch(t){let r=t instanceof Error?t.message:String(t);throw new X(`openpond chat --message-file could not read ${e}: ${r}`,2)}}i(Yn,"readOneShotMessageFile");async function Xn(e){let t="";e.setEncoding("utf8");for await(let r of e)t+=String(r);return t}i(Xn,"readAll");function Zn(e){let t=ae({server:e.server,token:e.token,activeSessionId:i(()=>e.activeSessionId,"activeSessionId"),onEvent:e.onEvent,onStatus:i(n=>{n.state==="disconnected"&&e.onStatus(`
57
57
  [event stream] reconnecting in ${Math.ceil(n.nextDelayMs/1e3)}s: ${n.message}
@@ -1,2 +1,2 @@
1
1
  import { createRequire as __openpondCreateRequire } from "node:module"; var require = __openpondCreateRequire(import.meta.url);
2
- import{a as g,c as h,d as m}from"./chunk-6XF4GI35.js";import{c as f}from"./chunk-BSHAIAXY.js";import"./chunk-XWPC3AN4.js";import"./chunk-GLUWATL5.js";import{c as n,f as u}from"./chunk-3M53YXEI.js";import{a as c}from"./chunk-FTQLQJQV.js";import w from"node:path";async function A(r,l,k={}){let[t,e]=l;if(!t||!e||l.length!==2||!["import","publish","readiness","delete-draft"].includes(t))throw new Error("usage: taskset <import|publish|readiness|delete-draft> <package-path|draft-id|taskset-id> [--profile <id>] [--model <id>] [--json]");let i=f(r)??process.env.OPENPOND_LOCAL_API_URL?.replace(/\/$/,"")??g,d=new URL(i);if(d.protocol!=="http:"||!["127.0.0.1","localhost","::1"].includes(d.hostname))throw new Error("Taskset package import is available only through the local OpenPond app API.");let a=new m({baseUrl:i,request:k.request??await h(i)}),s=t==="import"?await a.importTasksetDraftPackage({packagePath:w.resolve(e),profileId:n(r,"profile")||"default"}):t==="publish"?await a.publishTasksetDraft(e,n(r,"model")||null):t==="readiness"?await a.tasksetReadiness(e):await a.deleteTasksetDraft(e);if(u(r.json)){console.log(JSON.stringify(s,null,2));return}let o=s&&typeof s=="object"?s:{};if(t==="import"){console.log(`Imported Taskset draft ${String(o.name??o.id??e)}.`),console.log("Open it in Models \u2192 Tasksets to review it, or publish it with the OpenPond CLI.");return}if(t==="publish"){let p=o.taskset&&typeof o.taskset=="object"?o.taskset:{};console.log(`Published Taskset ${String(p.name??p.id??e)}.`);return}if(t==="readiness"){console.log(`Checked Taskset ${e} readiness.`),console.log(JSON.stringify(s,null,2));return}console.log(`Deleted unpublished Taskset draft ${e}.`)}c(A,"runTasksetCommand");export{A as runTasksetCommand};
2
+ import{a as g,c as h,d as m}from"./chunk-6XF4GI35.js";import{c as f}from"./chunk-BSHAIAXY.js";import"./chunk-XWPC3AN4.js";import{c as n,f as u}from"./chunk-3M53YXEI.js";import"./chunk-GLUWATL5.js";import{a as c}from"./chunk-FTQLQJQV.js";import w from"node:path";async function A(r,l,k={}){let[t,e]=l;if(!t||!e||l.length!==2||!["import","publish","readiness","delete-draft"].includes(t))throw new Error("usage: taskset <import|publish|readiness|delete-draft> <package-path|draft-id|taskset-id> [--profile <id>] [--model <id>] [--json]");let i=f(r)??process.env.OPENPOND_LOCAL_API_URL?.replace(/\/$/,"")??g,d=new URL(i);if(d.protocol!=="http:"||!["127.0.0.1","localhost","::1"].includes(d.hostname))throw new Error("Taskset package import is available only through the local OpenPond app API.");let a=new m({baseUrl:i,request:k.request??await h(i)}),s=t==="import"?await a.importTasksetDraftPackage({packagePath:w.resolve(e),profileId:n(r,"profile")||"default"}):t==="publish"?await a.publishTasksetDraft(e,n(r,"model")||null):t==="readiness"?await a.tasksetReadiness(e):await a.deleteTasksetDraft(e);if(u(r.json)){console.log(JSON.stringify(s,null,2));return}let o=s&&typeof s=="object"?s:{};if(t==="import"){console.log(`Imported Taskset draft ${String(o.name??o.id??e)}.`),console.log("Open it in Models \u2192 Tasksets to review it, or publish it with the OpenPond CLI.");return}if(t==="publish"){let p=o.taskset&&typeof o.taskset=="object"?o.taskset:{};console.log(`Published Taskset ${String(p.name??p.id??e)}.`);return}if(t==="readiness"){console.log(`Checked Taskset ${e} readiness.`),console.log(JSON.stringify(s,null,2));return}console.log(`Deleted unpublished Taskset draft ${e}.`)}c(A,"runTasksetCommand");export{A as runTasksetCommand};
@@ -1,3 +1,3 @@
1
1
  import { createRequire as __openpondCreateRequire } from "node:module"; var require = __openpondCreateRequire(import.meta.url);
2
- import{m as f}from"./chunk-5YUITAUN.js";import"./chunk-FFEI7IRU.js";import"./chunk-BSHAIAXY.js";import"./chunk-XWPC3AN4.js";import"./chunk-OGPHXXCD.js";import"./chunk-TZ6N7WFI.js";import"./chunk-UJLZRM2M.js";import"./chunk-6EAQL7YX.js";import"./chunk-GLUWATL5.js";import"./chunk-IYROEHYB.js";import"./chunk-MJC26GOX.js";import"./chunk-2O5UZOYL.js";import"./chunk-QUNRWDVO.js";import"./chunk-XLVFY2BA.js";import"./chunk-L6NNQUAT.js";import"./chunk-HZP5U2AA.js";import"./chunk-ES2ISFJC.js";import"./chunk-H7IWJN7L.js";import"./chunk-3LG4G5JR.js";import{a as g,c as a,d}from"./chunk-3M53YXEI.js";import{a as s}from"./chunk-FTQLQJQV.js";function c(){return["usage: teams-bot <overview|bind|rebind|diagnostics|diagnostic-run>"," teams-bot overview --team-id <id>"," teams-bot bind --team-id <id> --token <token> [--project-id <id>] [--agent-id <id>] [--microsoft-connection-id <id>]"," teams-bot rebind <bindingId> --team-id <id> [--project-id <id>] [--agent-id <id>] [--microsoft-connection-id <id>]"," teams-bot diagnostics <bindingId> --team-id <id>"," teams-bot diagnostic-run <bindingId> --team-id <id> --prompt <text> [--attachments-json <json-array>] [--action-input-json <json-object>]"].join(`
2
+ import{m as f}from"./chunk-FUFIZ37W.js";import"./chunk-3HQEEZPO.js";import"./chunk-BSHAIAXY.js";import"./chunk-FKVP26MC.js";import"./chunk-P5CFBE6Z.js";import"./chunk-XWPC3AN4.js";import{a as g,c as a,d}from"./chunk-3M53YXEI.js";import"./chunk-OGPHXXCD.js";import"./chunk-TZNKOKQJ.js";import"./chunk-SHCKK3SU.js";import"./chunk-AOBTILU5.js";import"./chunk-GLUWATL5.js";import"./chunk-RELOOVWW.js";import"./chunk-GIPSOLAY.js";import"./chunk-MJC26GOX.js";import"./chunk-JUX77H6K.js";import"./chunk-QUNRWDVO.js";import"./chunk-QK2GLRCY.js";import"./chunk-HZP5U2AA.js";import"./chunk-ES2ISFJC.js";import"./chunk-H7IWJN7L.js";import{a as s}from"./chunk-FTQLQJQV.js";function c(){return["usage: teams-bot <overview|bind|rebind|diagnostics|diagnostic-run>"," teams-bot overview --team-id <id>"," teams-bot bind --team-id <id> --token <token> [--project-id <id>] [--agent-id <id>] [--microsoft-connection-id <id>]"," teams-bot rebind <bindingId> --team-id <id> [--project-id <id>] [--agent-id <id>] [--microsoft-connection-id <id>]"," teams-bot diagnostics <bindingId> --team-id <id>"," teams-bot diagnostic-run <bindingId> --team-id <id> --prompt <text> [--attachments-json <json-array>] [--action-input-json <json-object>]"].join(`
3
3
  `)}s(c,"usage");function u(n,o){if(!(o in n))return;let t=a(n,o);return!t||t==="null"||t==="none"?null:t}s(u,"nullableOption");function b(n){let o=d(n,"usage: teams-bot rebind <bindingId>"),t=u(n,"sandboxId"),r=u(n,"projectId"),i=u(n,"agentId"),e=u(n,"microsoftConnectionId");return{teamId:o,...t!==void 0?{sandboxId:t}:{},...r!==void 0?{projectId:r}:{},...i!==void 0?{agentId:i}:{},...e!==void 0?{microsoftConnectionId:e}:{}}}s(b,"bindingTargetInput");function l(n){let o=a(n,"attachmentsJson");if(!o)return;let t=g(o,"attachments-json");if(!Array.isArray(t))throw new Error("attachments-json must be a JSON array");for(let r of t)if(!r||typeof r!="object"||Array.isArray(r))throw new Error("attachments-json entries must be JSON objects");return t}s(l,"attachmentsInput");function w(n){let o=a(n,"actionInputJson");if(!o)return;let t=g(o,"action-input-json");if(!t||typeof t!="object"||Array.isArray(t))throw new Error("action-input-json must be a JSON object");return t}s(w,"actionInput");async function j(n,o){let t=o[0]||"overview",r=await f(n);if(t==="overview"){let i=d(n,"usage: teams-bot overview");console.log(JSON.stringify(await r.getMicrosoftTeamsBotOverview({teamId:i}),null,2));return}if(t==="bind"){let i=a(n,"token");if(!i)throw new Error(c());let e=await r.bindMicrosoftTeamsBotConversation({...b(n),token:i});console.log(JSON.stringify(e,null,2));return}if(t==="rebind"){let i=o[1]?.trim();if(!i)throw new Error(c());let e=await r.rebindMicrosoftTeamsBotConversation(i,b(n));console.log(JSON.stringify(e,null,2));return}if(t==="diagnostics"){let i=o[1]?.trim(),e=d(n,"usage: teams-bot diagnostics <bindingId>");if(!i)throw new Error(c());console.log(JSON.stringify(await r.sendMicrosoftTeamsBotDiagnostic({teamId:e,bindingId:i}),null,2));return}if(t==="diagnostic-run"){let i=o[1]?.trim(),e=d(n,"usage: teams-bot diagnostic-run <bindingId>"),m=a(n,"prompt");if(!i||!m)throw new Error(c());console.log(JSON.stringify(await r.sendMicrosoftTeamsBotDiagnosticRun({teamId:e,bindingId:i,prompt:m,attachments:l(n),actionInput:w(n)}),null,2));return}throw new Error(c())}s(j,"runTeamsBotCommand");export{j as runTeamsBotCommand};
@@ -1,2 +1,2 @@
1
1
  import { createRequire as __openpondCreateRequire } from "node:module"; var require = __openpondCreateRequire(import.meta.url);
2
- import{a,b,c,d}from"./chunk-6XF4GI35.js";import"./chunk-BSHAIAXY.js";import"./chunk-XWPC3AN4.js";import"./chunk-GLUWATL5.js";import"./chunk-3M53YXEI.js";import"./chunk-FTQLQJQV.js";export{a as DEFAULT_LOCAL_TRAINING_API_URL,d as TrainingApiClient,c as createLocalAuthenticatedRequest,b as runTrainingCommand};
2
+ import{a,b,c,d}from"./chunk-6XF4GI35.js";import"./chunk-BSHAIAXY.js";import"./chunk-XWPC3AN4.js";import"./chunk-3M53YXEI.js";import"./chunk-GLUWATL5.js";import"./chunk-FTQLQJQV.js";export{a as DEFAULT_LOCAL_TRAINING_API_URL,d as TrainingApiClient,c as createLocalAuthenticatedRequest,b as runTrainingCommand};
@@ -1,2 +1,2 @@
1
1
  import { createRequire as __openpondCreateRequire } from "node:module"; var require = __openpondCreateRequire(import.meta.url);
2
- import{A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z}from"./chunk-3I5BMVJI.js";import"./chunk-Z3RBK6LN.js";import"./chunk-FTQLQJQV.js";export{a as MACOS_GIT_MISSING_DEVELOPER_TOOLS_ERROR,C as appWorkspacePaths,B as assertSafeBranchName,d as checkWorkspaceGitAvailability,J as checkoutBranch,K as checkoutBranchAtPath,M as clearWorkspaceDiffCacheForTests,D as cloneWorkspace,H as createAndCheckoutBranch,I as createAndCheckoutBranchAtPath,A as expectedRemoteUrl,t as isGeneratedWorkspacePath,i as isGitRepo,c as isMacOSGitDeveloperToolsMissing,u as isVisibleGitWorkspaceFile,r as isWorkspaceDirectory,E as lastFetchAt,z as listPlainWorkspaceFiles,P as loadGitCommitDiffAtPath,N as loadWorkspaceDiff,O as loadWorkspaceDiffAtPath,Q as loadWorkspaceFile,T as loadWorkspaceFileAtPath,R as loadWorkspaceImageFile,S as loadWorkspaceImageFileAtPath,F as loadWorkspaceState,G as loadWorkspaceStateAtPath,n as localVideoContentType,L as mapWorkspaceDiffEntriesWithConcurrency,s as normalizeWorkspaceFilePath,w as parseBranchStatusLine,x as parseNumstat,v as parseStatusLine,h as pathExists,p as readLocalImageFile,q as readLocalVideoFile,l as readWorkspaceDocumentPreview,k as readWorkspaceFile,o as readWorkspaceImageFile,g as redactRemoteUrl,b as runWorkspaceCommand,f as sourceFromRemote,e as startMacOSCommandLineToolsInstall,j as truncatePatch,y as uniqueSortedPaths,m as workspaceImageContentType};
2
+ import{A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z}from"./chunk-IKM6ICPY.js";import"./chunk-V5BC6QT2.js";import"./chunk-FTQLQJQV.js";export{a as MACOS_GIT_MISSING_DEVELOPER_TOOLS_ERROR,C as appWorkspacePaths,B as assertSafeBranchName,d as checkWorkspaceGitAvailability,J as checkoutBranch,K as checkoutBranchAtPath,M as clearWorkspaceDiffCacheForTests,D as cloneWorkspace,H as createAndCheckoutBranch,I as createAndCheckoutBranchAtPath,A as expectedRemoteUrl,t as isGeneratedWorkspacePath,i as isGitRepo,c as isMacOSGitDeveloperToolsMissing,u as isVisibleGitWorkspaceFile,r as isWorkspaceDirectory,E as lastFetchAt,z as listPlainWorkspaceFiles,P as loadGitCommitDiffAtPath,N as loadWorkspaceDiff,O as loadWorkspaceDiffAtPath,Q as loadWorkspaceFile,T as loadWorkspaceFileAtPath,R as loadWorkspaceImageFile,S as loadWorkspaceImageFileAtPath,F as loadWorkspaceState,G as loadWorkspaceStateAtPath,n as localVideoContentType,L as mapWorkspaceDiffEntriesWithConcurrency,s as normalizeWorkspaceFilePath,w as parseBranchStatusLine,x as parseNumstat,v as parseStatusLine,h as pathExists,p as readLocalImageFile,q as readLocalVideoFile,l as readWorkspaceDocumentPreview,k as readWorkspaceFile,o as readWorkspaceImageFile,g as redactRemoteUrl,b as runWorkspaceCommand,f as sourceFromRemote,e as startMacOSCommandLineToolsInstall,j as truncatePatch,y as uniqueSortedPaths,m as workspaceImageContentType};
package/dist/cli.js CHANGED
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
2
  import { createRequire as __openpondCreateRequire } from "node:module"; var require = __openpondCreateRequire(import.meta.url);
3
- import{a as m,b as l}from"./chunks/chunk-BSHAIAXY.js";import"./chunks/chunk-XWPC3AN4.js";import"./chunks/chunk-GLUWATL5.js";import{b as u}from"./chunks/chunk-XLVFY2BA.js";import{a as c,j as d}from"./chunks/chunk-3LG4G5JR.js";import{f as s}from"./chunks/chunk-3M53YXEI.js";import{a as t}from"./chunks/chunk-FTQLQJQV.js";function f(e){return!e.command&&s(e.options.version)?"version":s(e.options.checkUpdate)?"check-update":!e.command&&s(e.options.help)?"help":!e.command&&s(e.options.tui)?"tui":e.command?"command":"ui"}t(f,"resolveCliTopLevelAction");async function C(e=process.argv.slice(2)){if(await v(e))return;let{command:r,options:o,rest:i}=u(e);typeof o.home=="string"&&(process.env.OPENPOND_HOME=(await import("./chunks/dist-CEKBK32A.js")).resolveOpenPondHome({home:o.home}));let n=f({command:r,options:o});if(n==="version"){console.log(c());return}if(n==="check-update"){await(await import("./chunks/core-commands-CMAAUKPQ.js")).runCheckUpdate();return}if(n==="help"){(await import("./chunks/help-ZLJV3ZVW.js")).printHelp();return}let a=m(o),p=l(o);if(a&&(process.env.OPENPOND_ACCOUNT=a),p&&(process.env.OPENPOND_BASE_URL=p),n==="tui"){await(await import("./chunks/app-layer-BDAKS3DG.js")).runOpenPondTerminalCommand(o,i);return}if(n==="ui"){await(await import("./chunks/app-layer-BDAKS3DG.js")).runOpenPondServerCommand("web",o,i);return}await d({command:r,options:o,rest:i})||((await import("./chunks/help-ZLJV3ZVW.js")).printHelp(),process.exit(1))}t(C,"runOpenPondCli");async function v(e){if(e[0]==="__compile-hosted-profile")return await(await import("./chunks/hosted-profile-compiler-CSLJT75T.js")).runHostedProfileCompilerCli(e.slice(1)),!0;if(e[0]==="__app-server"){process.argv=[process.execPath,"openpond-app-server",...e.slice(1)];let[{createOpenPondAppServer:r},{runOpenPondAppServerCli:o}]=await Promise.all([import("./chunks/app-server-runtime-D74FFS27.js"),import("./chunks/cli-A2P56J7R.js")]);return await o(r),!0}if(e[0]==="__server"){process.argv=[process.execPath,"openpond-server",...e.slice(1)];let[{createOpenPondServer:r},{runOpenPondServerCli:o}]=await Promise.all([import("./chunks/src-LRJO4THC.js"),import("./chunks/cli-A2P56J7R.js")]),{createOpenPondAppServer:i}=await import("./chunks/app-server-runtime-D74FFS27.js");return await o({createOpenPondServer:r,createOpenPondAppServer:i}),!0}return e[0]==="__terminal"?(await(await import("./chunks/src-A5KEQW52.js")).runOpenPondTerminalCli(e.slice(1)),!0):!1}t(v,"runEmbeddedCompanion");C().catch(e=>{let r=e instanceof Error?e.message:String(e),o=e.issue;if(process.argv.includes("--json")&&!(e instanceof Error&&e.name==="OpenPondChildProcessExitError"))console.log(JSON.stringify({error:o??{code:"CLI_ERROR",message:r}}));else if(o&&typeof o=="object"){let n=o;console.error(`${n.code}: ${n.message}
3
+ import{a as m,b as l}from"./chunks/chunk-BSHAIAXY.js";import{b as u}from"./chunks/chunk-FKVP26MC.js";import{a as c,j as d}from"./chunks/chunk-P5CFBE6Z.js";import"./chunks/chunk-XWPC3AN4.js";import{f as s}from"./chunks/chunk-3M53YXEI.js";import"./chunks/chunk-GLUWATL5.js";import{a as t}from"./chunks/chunk-FTQLQJQV.js";function f(e){return!e.command&&s(e.options.version)?"version":s(e.options.checkUpdate)?"check-update":!e.command&&s(e.options.help)?"help":!e.command&&s(e.options.tui)?"tui":e.command?"command":"ui"}t(f,"resolveCliTopLevelAction");async function C(e=process.argv.slice(2)){if(await v(e))return;let{command:r,options:o,rest:i}=u(e);typeof o.home=="string"&&(process.env.OPENPOND_HOME=(await import("./chunks/dist-4OUZANXR.js")).resolveOpenPondHome({home:o.home}));let n=f({command:r,options:o});if(n==="version"){console.log(c());return}if(n==="check-update"){await(await import("./chunks/core-commands-WFTASSGL.js")).runCheckUpdate();return}if(n==="help"){(await import("./chunks/help-4BB2A5JC.js")).printHelp();return}let a=m(o),p=l(o);if(a&&(process.env.OPENPOND_ACCOUNT=a),p&&(process.env.OPENPOND_BASE_URL=p),n==="tui"){await(await import("./chunks/app-layer-JZTMHORT.js")).runOpenPondTerminalCommand(o,i);return}if(n==="ui"){await(await import("./chunks/app-layer-JZTMHORT.js")).runOpenPondServerCommand("web",o,i);return}await d({command:r,options:o,rest:i})||((await import("./chunks/help-4BB2A5JC.js")).printHelp(),process.exit(1))}t(C,"runOpenPondCli");async function v(e){if(e[0]==="__compile-hosted-profile")return await(await import("./chunks/hosted-profile-compiler-7ZWCIHPA.js")).runHostedProfileCompilerCli(e.slice(1)),!0;if(e[0]==="__app-server"){process.argv=[process.execPath,"openpond-app-server",...e.slice(1)];let[{createOpenPondAppServer:r},{runOpenPondAppServerCli:o}]=await Promise.all([import("./chunks/app-server-runtime-PDT6BJD2.js"),import("./chunks/cli-OP4EDGZN.js")]);return await o(r),!0}if(e[0]==="__server"){process.argv=[process.execPath,"openpond-server",...e.slice(1)];let[{createOpenPondServer:r},{runOpenPondServerCli:o}]=await Promise.all([import("./chunks/src-2NVS6PNZ.js"),import("./chunks/cli-OP4EDGZN.js")]),{createOpenPondAppServer:i}=await import("./chunks/app-server-runtime-PDT6BJD2.js");return await o({createOpenPondServer:r,createOpenPondAppServer:i}),!0}return e[0]==="__terminal"?(await(await import("./chunks/src-PASASTIA.js")).runOpenPondTerminalCli(e.slice(1)),!0):!1}t(v,"runEmbeddedCompanion");C().catch(e=>{let r=e instanceof Error?e.message:String(e),o=e.issue;if(process.argv.includes("--json")&&!(e instanceof Error&&e.name==="OpenPondChildProcessExitError"))console.log(JSON.stringify({error:o??{code:"CLI_ERROR",message:r}}));else if(o&&typeof o=="object"){let n=o;console.error(`${n.code}: ${n.message}
4
4
  ${n.path}
5
5
  ${n.action}`)}else console.error(r);let i=typeof e.exitCode=="number"?e.exitCode:1;process.exit(i)});export{C as runOpenPondCli};
package/dist/index.js CHANGED
@@ -1,2 +1,2 @@
1
1
  import { createRequire as __openpondCreateRequire } from "node:module"; var require = __openpondCreateRequire(import.meta.url);
2
- import"./chunks/chunk-X37KMV27.js";import{a as Er,b as Fr,c as Gr,d as Hr,e as Ir,f as Jr,g as Kr,h as Lr,i as Mr,j as Nr,k as Or,l as Pr}from"./chunks/chunk-3N4GQL6I.js";import{a as kr,b as lr,c as nr}from"./chunks/chunk-22UARBPW.js";import{a as qr,b as sr,c as ur,d as vr,e as wr,f as yr,g as zr,h as Ar,i as Br,j as Cr,k as Dr}from"./chunks/chunk-JEVA7YQL.js";import{A as Mo,B as No,C as Oo,D as Po,E as Qo,F as Ro,G as So,H as To,I as Uo,J as Vo,K as Wo,b as ho,c as io,d as jo,e as ko,f as lo,g as no,h as qo,i as so,j as uo,k as vo,l as wo,m as yo,n as zo,o as Ao,p as Bo,q as Co,r as Do,s as Eo,t as Fo,u as Go,v as Ho,w as Io,x as Jo,y as Ko,z as Lo}from"./chunks/chunk-YQPECTJ2.js";import"./chunks/chunk-3YA2CD22.js";import"./chunks/chunk-OGPHXXCD.js";import"./chunks/chunk-TZ6N7WFI.js";import{$ as go,A as D,B as E,C as F,D as G,E as H,F as I,G as J,H as K,I as L,J as M,K as N,L as O,M as P,N as Q,O as R,P as S,Q as T,U,V,W as fo,X as mo,Y as po,Z as to,_ as xo,a as o,b as p,c as t,d as x,e as a,f as b,g as c,h as d,i as g,j as h,k as i,l as j,n as k,o as l,p as n,q,r as s,s as u,t as v,u as w,v as y,w as z,x as A,y as B,z as C}from"./chunks/chunk-UJLZRM2M.js";import{a as W,b as X,c as Y,d as Z,e as _,f as $,g as oo,h as ro,i as eo}from"./chunks/chunk-6EAQL7YX.js";import{a as r,b as e,c as f,d as m}from"./chunks/chunk-GLUWATL5.js";import"./chunks/chunk-IYROEHYB.js";import{f as ao,g as bo,h as co}from"./chunks/chunk-MJC26GOX.js";import"./chunks/chunk-2O5UZOYL.js";import"./chunks/chunk-QUNRWDVO.js";import"./chunks/chunk-3A7HZJNE.js";import{a as Xo,b as Yo,c as Zo,d as _o,e as $o,f as or,g as rr,h as er,i as fr,j as mr,k as pr,l as tr,m as xr,n as ar,o as br,p as cr,q as dr,r as gr,s as hr,t as ir,u as jr}from"./chunks/chunk-EAPFMACH.js";import"./chunks/chunk-6FA3GG5B.js";import"./chunks/chunk-L6NNQUAT.js";import"./chunks/chunk-HZP5U2AA.js";import"./chunks/chunk-ES2ISFJC.js";import"./chunks/chunk-H7IWJN7L.js";import"./chunks/chunk-FTQLQJQV.js";export{fo as DEFAULT_CACHE_TTL_MS,yo as DEFAULT_LOCAL_PROFILE,e as DEFAULT_OPENPOND_API_BASE_URL,m as DEFAULT_OPENPOND_CHAT_API_BASE_URL,f as DEFAULT_OPENPOND_OPCHAT_API_BASE_URL,r as DEFAULT_OPENPOND_WEB_BASE_URL,zo as DEFAULT_PROFILE_AGENT,Zo as OPENPOND_MANIFEST_FILE_NAME,ho as OpenPondProfileSetupRequiredError,bo as OpenPondSandboxClient,wo as PROFILE_MANIFEST,vo as PROFILE_REPO_MANIFEST,go as SANDBOX_RUNTIME_PROFILE_IDS,_o as SANDBOX_TEMPLATE_BUILD_PLAN_FILE_NAME,$o as SANDBOX_TEMPLATE_BUILD_PLAN_KIND,Yo as SANDBOX_TEMPLATE_PREVIEW_PORT_MAX,Xo as SANDBOX_TEMPLATE_PREVIEW_PORT_MIN,or as SandboxTemplateManifestSchema,rr as SandboxTemplateValidationDiagnosticSchema,o as apiFetch,jo as assertOpenPondProfileActionReady,io as buildOpenPondProfileSetupGate,Q as checkOpenPondApiHealth,lo as collectProfileSourceUploadEntries,Uo as commitActiveProfileChanges,p as commitFiles,Nr as computeAtr,Lr as computeBollinger,Ir as computeEma,Hr as computeEmaSeries,Kr as computeMaCross,Jr as computeMacd,Mr as computePriceChange,Er as computeRsi,Gr as computeSma,Fr as computeSmaSeries,Or as consumeAgentCreateStream,lr as consumeStream,M as createAgentFromPrompt,Pr as createClient,k as createHeadlessApps,i as createLocalProject,co as createOpenPondSandboxClient,j as createRepo,Co as defaultLocalProfileRepoPath,tr as defineSandboxTemplate,H as deleteOrArchiveSchedule,t as deployApp,q as deployLatestTemplate,Do as emptyProfileState,V as executeHostedTool,T as executeUserTool,v as fetchToolManifest,ko as formatOpenPondProfileSetupRequirement,pr as formatSandboxTemplateDiagnostics,nr as formatStreamItem,u as getAppEnvironment,L as getAppExecutionTimeline,O as getAppRuntimeSummary,mo as getCachedApps,to as getCachedTools,W as getConfigPath,g as getDeploymentDetail,b as getDeploymentLogs,c as getDeploymentStatus,d as getLatestDeploymentForApp,vr as getOpChatModel,zr as getOpChatProvider,P as getOpenPondAccount,B as getOpenToolRecipe,C as getOpenToolRules,K as getScheduleExecutionLog,l as getTemplateStatus,N as getUserPerformance,qo as hostedPublishStatusFromPayload,uo as hostedRunStatusFromRunSummary,so as hostedRunSummaryFromPayload,no as hostedSourceCheckStatusFromPayload,Eo as initLocalProfileRepo,Io as installAgentPackageIntoActiveProfile,y as listAppSchedules,h as listApps,_ as listConfiguredProfiles,J as listDeploymentScheduleExecutionLogs,wr as listHostedModels,Ar as listHostedProviders,ur as listOpChatModels,yr as listOpChatProviders,z as listOpenToolRecipes,I as listScheduleExecutionLogs,n as listTemplateBranches,w as listUserTools,Z as loadConfig,Y as loadGlobalConfig,Fo as loadLocalProfileRepo,Lo as loadOpenPondProfileLibrary,Jo as loadOpenPondProfileState,Mo as loadOpenPondProfileStateForRef,Po as loadOpenPondProfileStateFromSource,Bo as mergeActiveLocalProfileConfig,Ao as mergeProfileRepoManifestEntry,kr as normalizeDataFrames,ao as normalizeSandboxApiUrl,Ko as openPondProfileRef,mr as parseSandboxTemplateYaml,S as postAgentDigest,Wo as prepareAgentSdkRuntimePackage,x as promotePreviewToProduction,Go as registerLocalProfileRepo,Oo as removeOpenPondProfile,Ho as renameActiveProfileAgent,Qo as requireActiveLocalProfile,sr as resolveHostedChatApiBaseUrl,qr as resolveOpChatApiBaseUrl,U as resolveWorkerBaseUrl,So as runAgentSdkProjectCommand,R as runAssistantMode,Dr as runOpChatSmoke,To as runProfileCheck,Ro as runProfileSdkCommand,G as runScheduleNow,gr as sandboxTemplateBuildMetadata,hr as sandboxTemplateBuildPlan,ar as sandboxTemplateDurableVolume,dr as sandboxTemplateExecutableEntries,cr as sandboxTemplateFileInput,jr as sandboxTemplateJsonSchema,br as sandboxTemplatePreviewPort,xr as sandboxTemplateResources,ir as sandboxTemplateScaffoldFiles,ro as saveConfig,eo as saveGlobalConfig,oo as saveProfileApiKey,Vo as saveProfilePushStatus,A as searchOpenToolRecipes,No as selectOpenPondProfile,Br as sendHostedChatTurn,$ as setActiveProfile,po as setCachedApps,xo as setCachedTools,a as startAppLifecycle,D as startAppSchedules,E as stopAppSchedules,F as stopCurrentAppSchedules,Cr as streamHostedChatTurn,s as updateAppEnvironment,X as updateGlobalConfig,fr as validateSandboxTemplateManifest,er as validateSandboxTemplateYaml};
2
+ import"./chunks/chunk-X37KMV27.js";import"./chunks/chunk-OGPHXXCD.js";import"./chunks/chunk-TZNKOKQJ.js";import{a as Er,b as Fr,c as Gr,d as Hr,e as Ir,f as Jr,g as Kr,h as Lr,i as Mr,j as Nr,k as Or,l as Pr}from"./chunks/chunk-T7Y5OYO2.js";import{a as qr,b as sr,c as ur,d as vr,e as wr,f as yr,g as zr,h as Ar,i as Br,j as Cr,k as Dr}from"./chunks/chunk-JEVA7YQL.js";import{a as kr,b as lr,c as nr}from"./chunks/chunk-22UARBPW.js";import{A as Mo,B as No,C as Oo,D as Po,E as Qo,F as Ro,G as So,H as To,I as Uo,J as Vo,K as Wo,b as ho,c as io,d as jo,e as ko,f as lo,g as no,h as qo,i as so,j as uo,k as vo,l as wo,m as yo,n as zo,o as Ao,p as Bo,q as Co,r as Do,s as Eo,t as Fo,u as Go,v as Ho,w as Io,x as Jo,y as Ko,z as Lo}from"./chunks/chunk-562Q5UVS.js";import"./chunks/chunk-DDHUSA3I.js";import{$ as go,A as M,B as N,C as O,D as P,E as Q,F as R,G as S,H as T,I as U,J as V,K as W,L as X,M as Y,N as Z,O as _,P as $,Q as oo,U as ro,V as eo,W as fo,X as mo,Y as po,Z as to,_ as xo,a as h,b as i,c as j,d as k,e as l,f as n,g as q,h as s,i as u,j as v,k as w,l as y,n as z,o as A,p as B,q as C,r as D,s as E,t as F,u as G,v as H,w as I,x as J,y as K,z as L}from"./chunks/chunk-SHCKK3SU.js";import{a as o,b as r,c as e,d as f,e as m,f as p,g as t,h as x,i as a}from"./chunks/chunk-AOBTILU5.js";import{a as b,b as c,c as d,d as g}from"./chunks/chunk-GLUWATL5.js";import"./chunks/chunk-RELOOVWW.js";import"./chunks/chunk-GIPSOLAY.js";import{f as ao,g as bo,h as co}from"./chunks/chunk-MJC26GOX.js";import"./chunks/chunk-JUX77H6K.js";import"./chunks/chunk-QUNRWDVO.js";import"./chunks/chunk-3A7HZJNE.js";import{a as Xo,b as Yo,c as Zo,d as _o,e as $o,f as or,g as rr,h as er,i as fr,j as mr,k as pr,l as tr,m as xr,n as ar,o as br,p as cr,q as dr,r as gr,s as hr,t as ir,u as jr}from"./chunks/chunk-EAPFMACH.js";import"./chunks/chunk-6FA3GG5B.js";import"./chunks/chunk-QK2GLRCY.js";import"./chunks/chunk-HZP5U2AA.js";import"./chunks/chunk-ES2ISFJC.js";import"./chunks/chunk-H7IWJN7L.js";import"./chunks/chunk-FTQLQJQV.js";export{fo as DEFAULT_CACHE_TTL_MS,yo as DEFAULT_LOCAL_PROFILE,c as DEFAULT_OPENPOND_API_BASE_URL,g as DEFAULT_OPENPOND_CHAT_API_BASE_URL,d as DEFAULT_OPENPOND_OPCHAT_API_BASE_URL,b as DEFAULT_OPENPOND_WEB_BASE_URL,zo as DEFAULT_PROFILE_AGENT,Zo as OPENPOND_MANIFEST_FILE_NAME,ho as OpenPondProfileSetupRequiredError,bo as OpenPondSandboxClient,wo as PROFILE_MANIFEST,vo as PROFILE_REPO_MANIFEST,go as SANDBOX_RUNTIME_PROFILE_IDS,_o as SANDBOX_TEMPLATE_BUILD_PLAN_FILE_NAME,$o as SANDBOX_TEMPLATE_BUILD_PLAN_KIND,Yo as SANDBOX_TEMPLATE_PREVIEW_PORT_MAX,Xo as SANDBOX_TEMPLATE_PREVIEW_PORT_MIN,or as SandboxTemplateManifestSchema,rr as SandboxTemplateValidationDiagnosticSchema,h as apiFetch,jo as assertOpenPondProfileActionReady,io as buildOpenPondProfileSetupGate,Z as checkOpenPondApiHealth,lo as collectProfileSourceUploadEntries,Uo as commitActiveProfileChanges,i as commitFiles,Nr as computeAtr,Lr as computeBollinger,Ir as computeEma,Hr as computeEmaSeries,Kr as computeMaCross,Jr as computeMacd,Mr as computePriceChange,Er as computeRsi,Gr as computeSma,Fr as computeSmaSeries,Or as consumeAgentCreateStream,lr as consumeStream,V as createAgentFromPrompt,Pr as createClient,z as createHeadlessApps,w as createLocalProject,co as createOpenPondSandboxClient,y as createRepo,Co as defaultLocalProfileRepoPath,tr as defineSandboxTemplate,Q as deleteOrArchiveSchedule,j as deployApp,C as deployLatestTemplate,Do as emptyProfileState,eo as executeHostedTool,oo as executeUserTool,F as fetchToolManifest,ko as formatOpenPondProfileSetupRequirement,pr as formatSandboxTemplateDiagnostics,nr as formatStreamItem,E as getAppEnvironment,U as getAppExecutionTimeline,X as getAppRuntimeSummary,mo as getCachedApps,to as getCachedTools,o as getConfigPath,u as getDeploymentDetail,n as getDeploymentLogs,q as getDeploymentStatus,s as getLatestDeploymentForApp,vr as getOpChatModel,zr as getOpChatProvider,Y as getOpenPondAccount,K as getOpenToolRecipe,L as getOpenToolRules,T as getScheduleExecutionLog,A as getTemplateStatus,W as getUserPerformance,qo as hostedPublishStatusFromPayload,uo as hostedRunStatusFromRunSummary,so as hostedRunSummaryFromPayload,no as hostedSourceCheckStatusFromPayload,Eo as initLocalProfileRepo,Io as installAgentPackageIntoActiveProfile,H as listAppSchedules,v as listApps,m as listConfiguredProfiles,S as listDeploymentScheduleExecutionLogs,wr as listHostedModels,Ar as listHostedProviders,ur as listOpChatModels,yr as listOpChatProviders,I as listOpenToolRecipes,R as listScheduleExecutionLogs,B as listTemplateBranches,G as listUserTools,f as loadConfig,e as loadGlobalConfig,Fo as loadLocalProfileRepo,Lo as loadOpenPondProfileLibrary,Jo as loadOpenPondProfileState,Mo as loadOpenPondProfileStateForRef,Po as loadOpenPondProfileStateFromSource,Bo as mergeActiveLocalProfileConfig,Ao as mergeProfileRepoManifestEntry,kr as normalizeDataFrames,ao as normalizeSandboxApiUrl,Ko as openPondProfileRef,mr as parseSandboxTemplateYaml,$ as postAgentDigest,Wo as prepareAgentSdkRuntimePackage,k as promotePreviewToProduction,Go as registerLocalProfileRepo,Oo as removeOpenPondProfile,Ho as renameActiveProfileAgent,Qo as requireActiveLocalProfile,sr as resolveHostedChatApiBaseUrl,qr as resolveOpChatApiBaseUrl,ro as resolveWorkerBaseUrl,So as runAgentSdkProjectCommand,_ as runAssistantMode,Dr as runOpChatSmoke,To as runProfileCheck,Ro as runProfileSdkCommand,P as runScheduleNow,gr as sandboxTemplateBuildMetadata,hr as sandboxTemplateBuildPlan,ar as sandboxTemplateDurableVolume,dr as sandboxTemplateExecutableEntries,cr as sandboxTemplateFileInput,jr as sandboxTemplateJsonSchema,br as sandboxTemplatePreviewPort,xr as sandboxTemplateResources,ir as sandboxTemplateScaffoldFiles,x as saveConfig,a as saveGlobalConfig,t as saveProfileApiKey,Vo as saveProfilePushStatus,J as searchOpenToolRecipes,No as selectOpenPondProfile,Br as sendHostedChatTurn,p as setActiveProfile,po as setCachedApps,xo as setCachedTools,l as startAppLifecycle,M as startAppSchedules,N as stopAppSchedules,O as stopCurrentAppSchedules,Cr as streamHostedChatTurn,D as updateAppEnvironment,r as updateGlobalConfig,fr as validateSandboxTemplateManifest,er as validateSandboxTemplateYaml};