openpond 0.2.6 → 0.2.8

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 (155) hide show
  1. package/README.md +2 -0
  2. package/dist/api/core.d.ts +2 -0
  3. package/dist/app-server.d.ts +2693 -0
  4. package/dist/app-server.js +2 -0
  5. package/dist/chunks/{actions-command-R5R3KR5Q.js → actions-command-V5DZWEON.js} +1 -1
  6. package/dist/chunks/{app-layer-JNSKATX7.js → app-layer-SFV6ZPKZ.js} +1 -1
  7. package/dist/chunks/app-server-runtime-OYF6XBVI.js +2 -0
  8. package/dist/chunks/{apps-3TXUNF65.js → apps-SR7CAM42.js} +1 -1
  9. package/dist/chunks/{chunk-OD6AGGH6.js → chunk-4LLHOG7L.js} +1 -1
  10. package/dist/chunks/{chunk-NWI7H753.js → chunk-5N6YRABR.js} +2 -2
  11. package/dist/chunks/{chunk-3NDRIQTI.js → chunk-73KFNV3D.js} +1 -1
  12. package/dist/chunks/chunk-B6IIGPWS.js +6 -0
  13. package/dist/chunks/chunk-BB6DJKXX.js +19 -0
  14. package/dist/chunks/chunk-DY5RF2YE.js +26 -0
  15. package/dist/chunks/{chunk-37V5TT45.js → chunk-EEBLJPIB.js} +1 -1
  16. package/dist/chunks/{chunk-CCJG7GLE.js → chunk-G2VYRU27.js} +1 -1
  17. package/dist/chunks/chunk-J2S7BOZU.js +12 -0
  18. package/dist/chunks/chunk-KRNLKKN6.js +5 -0
  19. package/dist/chunks/{chunk-2LADHICK.js → chunk-LLJI6QAY.js} +1 -1
  20. package/dist/chunks/{chunk-FYCJSUFV.js → chunk-NNLI4OWY.js} +1 -1
  21. package/dist/chunks/{chunk-U6HOHOOI.js → chunk-O4IARD7H.js} +1 -1
  22. package/dist/chunks/{chunk-ZKA3XSM7.js → chunk-QOR55VHT.js} +1 -1
  23. package/dist/chunks/{chunk-A42DFLOR.js → chunk-QWE3RHNY.js} +1 -1
  24. package/dist/chunks/{chunk-4HIHSG5M.js → chunk-S64WASAO.js} +1 -1
  25. package/dist/chunks/chunk-SS3EG6S2.js +2 -0
  26. package/dist/chunks/{chunk-EESJULVS.js → chunk-T2GNPVRY.js} +7 -3
  27. package/dist/chunks/{chunk-FESS4IR4.js → chunk-UW4XDFLU.js} +439 -343
  28. package/dist/chunks/chunk-UW6ES5DM.js +28 -0
  29. package/dist/chunks/{chunk-K35OOAW2.js → chunk-V4ACXLID.js} +1 -1
  30. package/dist/chunks/{chunk-3ZEV5UKA.js → chunk-VJBEK64H.js} +1 -1
  31. package/dist/chunks/{chunk-RWSAGQTP.js → chunk-Y7ZYJQGZ.js} +1 -1
  32. package/dist/chunks/cli-MS4KADND.js +2 -0
  33. package/dist/chunks/{configuration-command-54D6TOEV.js → configuration-command-EBN7RH3X.js} +1 -1
  34. package/dist/chunks/{continual-D75WA7E7.js → continual-OJYXVTIZ.js} +1 -1
  35. package/dist/chunks/{core-commands-F35UFIXE.js → core-commands-2S4UQPXW.js} +1 -1
  36. package/dist/chunks/{desktop-test-U2MMP2NE.js → desktop-test-WN7ZLQVQ.js} +1 -1
  37. package/dist/chunks/{dist-NKLXFA37.js → dist-UA2RQUA4.js} +1 -1
  38. package/dist/chunks/extension-ERM5EUUO.js +6 -0
  39. package/dist/chunks/{help-VGDW6SBX.js → help-N25BKIHM.js} +1 -1
  40. package/dist/chunks/{opchat-QK2KIHN3.js → opchat-V4A4WCND.js} +1 -1
  41. package/dist/chunks/{organizations-MUDOF6VM.js → organizations-TSOT7MDT.js} +1 -1
  42. package/dist/chunks/{profile-FW5COIFH.js → profile-3JQ3XM6Q.js} +1 -1
  43. package/dist/chunks/{project-agent-G6GJOIVI.js → project-agent-S76FWVPV.js} +1 -1
  44. package/dist/chunks/{sandbox-command-H7INTQJZ.js → sandbox-command-YQDGQBBQ.js} +1 -1
  45. package/dist/chunks/{sandbox-template-7MXJQ3X4.js → sandbox-template-GM2A3437.js} +1 -1
  46. package/dist/chunks/{src-E7WA3OPU.js → src-BC7WOVGF.js} +1 -1
  47. package/dist/chunks/src-S7XTFQ4V.js +319 -0
  48. package/dist/chunks/{teams-bot-ZDTMGPCU.js → teams-bot-M6QLZAHA.js} +1 -1
  49. package/dist/chunks/{workspaces-UB2HJGNE.js → workspaces-MJVCPH22.js} +1 -1
  50. package/dist/cli.js +1 -1
  51. package/dist/index.js +1 -1
  52. package/dist/profile/local-profile.d.ts +7 -0
  53. package/dist/sandbox/sandbox-instance-client.d.ts +2 -1
  54. package/dist/sandbox/types/client.d.ts +2 -0
  55. package/dist/skills/openpond-agent-authoring/references/profile-layout.md +9 -0
  56. package/dist/web/assets/App-7h_oHCFd.css +1 -0
  57. package/dist/web/assets/App-Dx38Dhlo.js +176 -0
  58. package/dist/web/assets/{AppDialog-CtqbY289.js → AppDialog-DdWbnFnr.js} +1 -1
  59. package/dist/web/assets/AppTerminalPanel-BotH-2y4.js +2 -0
  60. package/dist/web/assets/{AppsView-BeGbrJkU.js → AppsView-B3ybXi71.js} +1 -1
  61. package/dist/web/assets/BrowserSidebar-CLE27mjT.js +1 -0
  62. package/dist/web/assets/{BrowserSidebar-D9i7gQzw.css → BrowserSidebar-lNqqj4Ip.css} +1 -1
  63. package/dist/web/assets/{CartesianChart-Cp_-LaJY.js → CartesianChart-SB3Jq3CQ.js} +1 -1
  64. package/dist/web/assets/{CollaborationTabs-BL6guh-3.js → CollaborationTabs-C3jO5y5v.js} +1 -1
  65. package/dist/web/assets/{CommandMenu-hNQCm8mw.css → CommandMenu-Cb3vNGJr.css} +1 -1
  66. package/dist/web/assets/{CommandMenu-B-DEtpTp.js → CommandMenu-DqtJane1.js} +1 -1
  67. package/dist/web/assets/{CommunityView-DaIS0cHw.css → CommunityView-CnZqWEjK.css} +1 -1
  68. package/dist/web/assets/{CommunityView-DcEhEMm_.js → CommunityView-Dg02tZmL.js} +1 -1
  69. package/dist/web/assets/{ComposerCreateImproveStrip-C4mCZcKl.js → ComposerCreateImproveStrip-BTJhG8aU.js} +1 -1
  70. package/dist/web/assets/{GetStartedView-BUlaCO6a.js → GetStartedView-BlyP6VY8.js} +1 -1
  71. package/dist/web/assets/HostedModelLearningReview-BwSAO9y6.js +1 -0
  72. package/dist/web/assets/HostedModelLearningSettings-CiY2K8Fz.js +1 -0
  73. package/dist/web/assets/{LabModelVersionDetailPage-Bb1XRvo_.js → LabModelVersionDetailPage-cE1kuSWk.js} +1 -1
  74. package/dist/web/assets/{LabSkillSidebar-CPucMztm.js → LabSkillSidebar-BrSa3H3m.js} +1 -1
  75. package/dist/web/assets/{LabsRoute-C_HDADl0.js → LabsRoute-CY7rB25U.js} +4 -4
  76. package/dist/web/assets/MainChatThread-BM8l-LiB.js +2 -0
  77. package/dist/web/assets/MainPane-CsAYR_EF.js +10 -0
  78. package/dist/web/assets/{MarkdownText-_zVYW4pN.js → MarkdownText-8GA7g1qR.js} +1 -1
  79. package/dist/web/assets/{Messages-DxctstDI.js → Messages-CX08x24k.js} +6 -6
  80. package/dist/web/assets/{NativeSkillSidebar-DV4AGiCD.js → NativeSkillSidebar-mSz4GlxA.js} +1 -1
  81. package/dist/web/assets/{NewExperienceSwitcher-CZCLJj99.js → NewExperienceSwitcher-CHAC2Zid.js} +1 -1
  82. package/dist/web/assets/{NewProjectDialog-CQSipZ5d.js → NewProjectDialog-5B17C6Vh.js} +1 -1
  83. package/dist/web/assets/{OutputsPage-aPJP4mTV.js → OutputsPage-27Gp1K5N.js} +1 -1
  84. package/dist/web/assets/{ProjectsPage-CyThuXQv.js → ProjectsPage-DJpPuKBP.js} +1 -1
  85. package/dist/web/assets/RightChatPanelStack-C_4rbc1i.js +1 -0
  86. package/dist/web/assets/{RightSidebarHomePanel-CtH0vZ36.js → RightSidebarHomePanel-PHndCapL.js} +1 -1
  87. package/dist/web/assets/{ScheduledWorkPage-BY_4jFm7.js → ScheduledWorkPage-CYQZ0Zal.js} +1 -1
  88. package/dist/web/assets/{SettingsView-ZPnupcpg.js → SettingsView-DQPMLKNH.js} +7 -7
  89. package/dist/web/assets/{TeamChatView-DWjwVxMp.js → TeamChatView-DRvqhiOV.js} +2 -2
  90. package/dist/web/assets/{TeamChatView-Br3VdxhD.css → TeamChatView-dL6B0qib.css} +1 -1
  91. package/dist/web/assets/{TerminalOverlay-DxuUGKYH.js → TerminalOverlay-C8FbaVVP.js} +1 -1
  92. package/dist/web/assets/{TrainingCreationPanel-CjIPEoTX.js → TrainingCreationPanel-BGsd95vF.js} +1 -1
  93. package/dist/web/assets/{TrainingDraftPanel-CxevAlkr.js → TrainingDraftPanel-Bm6j-IuS.js} +1 -1
  94. package/dist/web/assets/{UsageSettingsSection-CY1lQB_g.js → UsageSettingsSection-CTCDOE-_.js} +3 -3
  95. package/dist/web/assets/{WorkSidebarPanel-DMsiwOSi.js → WorkSidebarPanel-UaymQC_e.js} +1 -1
  96. package/dist/web/assets/WorkspaceDiffPanel-D6mKLQha.js +14 -0
  97. package/dist/web/assets/{WorkspaceEnvironmentMenu-7DSF_BpI.js → WorkspaceEnvironmentMenu-C4Uw5qMA.js} +3 -3
  98. package/dist/web/assets/{WorkspaceGitDialogs-Ck8BzH11.js → WorkspaceGitDialogs--t9VpTCT.js} +1 -1
  99. package/dist/web/assets/{WorkspaceMonacoEditor-gsEP4W37.js → WorkspaceMonacoEditor-CElU0vIN.js} +3 -3
  100. package/dist/web/assets/{arrow-up-right-BK6EpHpC.js → arrow-up-right-C0HJHPjq.js} +1 -1
  101. package/dist/web/assets/{chat-file-links-BQe708gU.js → chat-file-links-D5q1as_h.js} +1 -1
  102. package/dist/web/assets/chevron-up-B3Cyo8SJ.js +1 -0
  103. package/dist/web/assets/{clipboard-DOmCP7eR.js → clipboard-wiphvxrN.js} +1 -1
  104. package/dist/web/assets/{cloud-upload-DLtawDYW.js → cloud-upload-Bgm5_SSr.js} +1 -1
  105. package/dist/web/assets/{cssMode-C0Qw8i_8.js → cssMode-DudNT1l3.js} +1 -1
  106. package/dist/web/assets/{folder-open-B_Ayxxo8.js → folder-open-DLuZSDXn.js} +1 -1
  107. package/dist/web/assets/{folder-plus-CPgtt3pN.js → folder-plus-DXN0q9GR.js} +1 -1
  108. package/dist/web/assets/{git-commit-horizontal-23xCJjd8.js → git-commit-horizontal-CdiI4K5M.js} +1 -1
  109. package/dist/web/assets/{htmlMode-DuQ7zaau.js → htmlMode-B2sAXhgB.js} +1 -1
  110. package/dist/web/assets/index-C5EoPZr0.css +1 -0
  111. package/dist/web/assets/{index-BoaTQ0Rb.js → index-DSK9XSir.js} +2 -1
  112. package/dist/web/assets/{info-CQ2kJJ5E.js → info-DcmIP9D3.js} +1 -1
  113. package/dist/web/assets/{jsonMode-DVQSEPUy.js → jsonMode-aQlrpuz5.js} +1 -1
  114. package/dist/web/assets/{lspLanguageFeatures-DWKH3min.js → lspLanguageFeatures-BMskOvs7.js} +1 -1
  115. package/dist/web/assets/{minimize-2-1M-fFBeP.js → minimize-2-CvKd6Q_r.js} +1 -1
  116. package/dist/web/assets/{monaco.contribution-jXX7-l5p.js → monaco.contribution-BHv_qQG9.js} +2 -2
  117. package/dist/web/assets/{monaco.contribution-ytVV-s22.js → monaco.contribution-BSRllZgB.js} +2 -2
  118. package/dist/web/assets/{monaco.contribution-B5Jz7f4W.js → monaco.contribution-VS3RCwFP.js} +2 -2
  119. package/dist/web/assets/{monaco.contribution-DB7pp5Y-.js → monaco.contribution-tZUXzebU.js} +2 -2
  120. package/dist/web/assets/{play-D9jaK5MP.js → play-BzfQJMmu.js} +1 -1
  121. package/dist/web/assets/{python-_yRitN2I.js → python-Bm9eN64d.js} +1 -1
  122. package/dist/web/assets/{refresh-cw-DZHqZGos.js → refresh-cw-Cvy0BqFv.js} +1 -1
  123. package/dist/web/assets/{save-DOT3oYfU.js → save-miVdIz56.js} +1 -1
  124. package/dist/web/assets/{square-D_1V6onE.js → square-DlJ_-dur.js} +1 -1
  125. package/dist/web/assets/{toggleHighContrast-C06C-luq.js → toggleHighContrast-B8jte8Lm.js} +1 -1
  126. package/dist/web/assets/{tsMode-CTMYvh-R.js → tsMode-CmAPBzqb.js} +1 -1
  127. package/dist/web/assets/{upload-EAAHd0Nx.js → upload-C71OnfRd.js} +1 -1
  128. package/dist/web/assets/{useLocalAgentSchedules-DBsx4aIY.js → useLocalAgentSchedules-D9hDhAba.js} +1 -1
  129. package/dist/web/assets/{wifi-off-DYRTrfYa.js → wifi-off-DhI7P9WW.js} +1 -1
  130. package/dist/web/assets/{workers-DAytqxd3.js → workers-BDI2xQio.js} +1 -1
  131. package/dist/web/assets/{yaml-iZnWWABr.js → yaml-DNSpZj5_.js} +1 -1
  132. package/dist/web/index.html +2 -2
  133. package/package.json +6 -2
  134. package/dist/chunks/app-server-runtime-FV4KHBTY.js +0 -2
  135. package/dist/chunks/chunk-CWQWV2T3.js +0 -2
  136. package/dist/chunks/chunk-DUA3QP6Y.js +0 -19
  137. package/dist/chunks/chunk-K4QLUFGX.js +0 -5
  138. package/dist/chunks/chunk-KDXLNQNF.js +0 -12
  139. package/dist/chunks/chunk-LYWUCJTV.js +0 -28
  140. package/dist/chunks/chunk-QUW7WK32.js +0 -24
  141. package/dist/chunks/chunk-VYUMTRB3.js +0 -5
  142. package/dist/chunks/cli-ZZTJVJRT.js +0 -2
  143. package/dist/chunks/extension-WY2RL5ZH.js +0 -5
  144. package/dist/chunks/src-4QYE5G3N.js +0 -319
  145. package/dist/web/assets/App-DNZ5VhFd.js +0 -176
  146. package/dist/web/assets/AppTerminalPanel-C1U1RKU6.js +0 -2
  147. package/dist/web/assets/BrowserSidebar-XgQLeXw1.js +0 -1
  148. package/dist/web/assets/HostedModelLearningReview-CZyb95R_.js +0 -1
  149. package/dist/web/assets/HostedModelLearningSettings-D2o7rh0w.js +0 -1
  150. package/dist/web/assets/MainChatThread-CnXHxCy3.js +0 -2
  151. package/dist/web/assets/MainPane-DjnT-kvm.js +0 -8
  152. package/dist/web/assets/RightChatPanelStack-jsP9CukH.js +0 -1
  153. package/dist/web/assets/WorkspaceDiffPanel-HdfItqu2.js +0 -14
  154. package/dist/web/assets/chevron-up-CHxYR4AX.js +0 -1
  155. package/dist/web/assets/index-BGMzUaup.css +0 -1
@@ -1,5 +1,5 @@
1
1
  import { createRequire as __openpondCreateRequire } from "node:module"; var require = __openpondCreateRequire(import.meta.url);
2
- import{q as z,r as V,s as G,t as q}from"./chunk-CCJG7GLE.js";import{a as A,f as v,g as k,h as p,i as f}from"./chunk-3M53YXEI.js";import{a}from"./chunk-FTQLQJQV.js";import{Buffer as Y}from"node:buffer";import{readdirSync as H,readFileSync as Q,statSync as F}from"node:fs";import b from"node:path";var K=500,Z=8*1024*1024,W=8*1024*1024;async function me(e,t){if(!t.sandboxRuntime&&!t.runtimeId)return{sandbox:await X(e,await e.create(t.sandbox,{async:!0}))};let n=t.runtimeId?void 0:await e.createSandboxRuntime(t.sandboxRuntime),r=t.runtimeId??n.id,o=await e.createSandboxRuntimeSandbox(r,t.sandbox);return{sandbox:await X(e,o.sandbox),runtime:o.runtime??n}}a(me,"createSandboxFromPlan");async function X(e,t){if(t.state==="running"||t.state==="stopped")return t;if(t.state==="error")throw new Error(`sandbox create failed: ${t.id}
2
+ import{q as z,r as V,s as G,t as q}from"./chunk-G2VYRU27.js";import{a as A,f as v,g as k,h as p,i as f}from"./chunk-3M53YXEI.js";import{a}from"./chunk-FTQLQJQV.js";import{Buffer as Y}from"node:buffer";import{readdirSync as H,readFileSync as Q,statSync as F}from"node:fs";import b from"node:path";var K=500,Z=8*1024*1024,W=8*1024*1024;async function me(e,t){if(!t.sandboxRuntime&&!t.runtimeId)return{sandbox:await X(e,await e.create(t.sandbox,{async:!0}))};let n=t.runtimeId?void 0:await e.createSandboxRuntime(t.sandboxRuntime),r=t.runtimeId??n.id,o=await e.createSandboxRuntimeSandbox(r,t.sandbox);return{sandbox:await X(e,o.sandbox),runtime:o.runtime??n}}a(me,"createSandboxFromPlan");async function X(e,t){if(t.state==="running"||t.state==="stopped")return t;if(t.state==="error")throw new Error(`sandbox create failed: ${t.id}
3
3
  ${t.logs.join(`
4
4
  `)}`);let n=12*6e4,r=3e3,o=Date.now()+n,i=t;for(;Date.now()<o;){if(await new Promise(s=>setTimeout(s,r)),i=await e.get(t.id),i.state==="running"||i.state==="stopped")return i;if(i.state==="error")throw new Error(`sandbox create failed: ${i.id}
5
5
  ${i.logs.join(`
@@ -1,5 +1,5 @@
1
1
  import { createRequire as __openpondCreateRequire } from "node:module"; var require = __openpondCreateRequire(import.meta.url);
2
- import{d as F}from"./chunk-37V5TT45.js";import{a as o}from"./chunk-FTQLQJQV.js";import{spawn as nt,spawnSync as At}from"node:child_process";import{accessSync as vt,constants as Rt,existsSync as _t,promises as Bt}from"node:fs";import et from"node:path";var rt="Git is required for OpenPond app workspaces, but macOS reports Apple Command Line Tools are not installed. OpenPond skipped /usr/bin/git to avoid opening the Xcode installer prompt. Install Command Line Tools with `xcode-select --install`, install Git from Homebrew, or put a non-Apple git binary earlier on PATH.",T;function Lt(e){try{return _t(e)?(vt(e,Rt.X_OK),!0):!1}catch{return!1}}o(Lt,"isExecutable");function Ot(){let e=(process.env.PATH??"").split(et.delimiter).map(t=>t.trim()).filter(Boolean);for(let t of e){let n=et.join(t,"git");if(!(n==="/usr/bin/git"||n==="/bin/git")&&Lt(n))return n}return null}o(Ot,"firstNonAppleGitOnPath");function it(){let e=At("/usr/bin/xcode-select",["-p"],{encoding:"utf8",stdio:["ignore","pipe","pipe"]});return e.status===0&&!!e.stdout.trim()}o(it,"appleDeveloperToolsAvailable");function Dt(e){if(e!=="git"||process.platform!=="darwin")return{command:e};if(T!==void 0)return{command:T};let t=Ot();return t?(T=t,{command:t}):it()?(T="git",{command:"git"}):{error:rt}}o(Dt,"resolveWorkspaceCommand");function u(e,t,n,r={},i){return new Promise(s=>{let a=Dt(e);if("error"in a){s({code:1,stdout:"",stderr:a.error});return}let c=nt(a.command,t,{cwd:n,env:{...process.env,...r,GIT_TERMINAL_PROMPT:"0"},stdio:[i===void 0?"ignore":"pipe","pipe","pipe"]}),d=[],p=[];i!==void 0&&c.stdin?.end(i),c.stdout?.on("data",h=>d.push(h)),c.stderr?.on("data",h=>p.push(h)),c.on("error",h=>{s({code:1,stdout:"",stderr:h.message})}),c.on("close",h=>{s({code:h??1,stdout:Buffer.concat(d).toString("utf8"),stderr:Buffer.concat(p).toString("utf8")})})})}o(u,"runCommand");function Gt(e){return!!(e&&e.includes(rt.slice(0,80)))}o(Gt,"isMacOSGitDeveloperToolsMissing");async function Se(e){await Bt.mkdir(e,{recursive:!0});let t=await u("git",["--version"],e);if(t.code===0)return{ok:!0,command:T??"git",version:(t.stdout||t.stderr).trim()};let n=t.stderr.trim()||t.stdout.trim()||"Git is required for OpenPond app workspaces.";return{ok:!1,error:n,installAction:process.platform==="darwin"&&Gt(n)?"macos_command_line_tools":"manual_git_install"}}o(Se,"checkWorkspaceGitAvailability");function ye(){if(process.platform!=="darwin")return{ok:!1,error:"Apple Command Line Tools installation is only available on macOS."};if(it())return{ok:!0,message:"Apple Command Line Tools already appear to be installed."};try{return nt("/usr/bin/xcode-select",["--install"],{detached:!0,stdio:"ignore"}).unref(),{ok:!0,message:"Opened the Apple Command Line Tools installer."}}catch(e){return{ok:!1,error:e instanceof Error?e.message:String(e)}}}o(ye,"startMacOSCommandLineToolsInstall");import{promises as k}from"node:fs";import m from"node:path";var st=24e3,ot=8e4,It=512*1024,ct=15*1024*1024,Tt=20*1024*1024,Mt=new Set([".cache",".eggs",".git",".ipynb_checkpoints",".mypy_cache",".next",".nox",".nuxt",".openpond",".output",".parcel-cache",".pytest_cache",".pyre",".ruff_cache",".svelte-kit",".tox",".turbo",".venv","__pycache__","artifacts","build","coverage","dist","env","node_modules","out","site-packages","target","venv","volumes"]),zt=new Set([".7z",".avif",".db",".doc",".docx",".gif",".gz",".ico",".jpeg",".jpg",".mov",".mp4",".pdf",".png",".sqlite",".tar",".webp",".xls",".xlsm",".xlsx",".zip"]),$t=new Map([[".avif","image/avif"],[".gif","image/gif"],[".jpeg","image/jpeg"],[".jpg","image/jpeg"],[".png","image/png"],[".webp","image/webp"]]),Nt=new Map([[".m4v","video/x-m4v"],[".mov","video/quicktime"],[".mp4","video/mp4"],[".webm","video/webm"]]),Ht=new Set([".doc",".docx",".pdf"]);function Ut(e){return e.replace(/[^a-zA-Z0-9._-]/g,"-").slice(0,120)||"app"}o(Ut,"safeAppSegment");function N(e){if(!e)return"unknown";try{let t=new URL(e).hostname.toLowerCase();if(t==="github.com"||t.endsWith(".github.com"))return"github";if(t==="openpond.ai"||t.endsWith(".openpond.ai"))return"openpond"}catch{return"unknown"}return"local_git"}o(N,"sourceFromRemote");function $(e){return e.replace(/x-access-token:[^@]+@/g,"x-access-token:***@").replace(/Authorization:\s*Basic\s+[A-Za-z0-9+/=]+/gi,"Authorization: Basic ***")}o($,"redactRemoteUrl");async function G(e){try{return await k.access(e),!0}catch{return!1}}o(G,"pathExists");async function O(e){return await G(e)?(await u("git",["rev-parse","--git-dir"],e)).code===0:!1}o(O,"isGitRepo");function X(e){return e.length<=st?e:`${e.slice(0,st)}
2
+ import{d as F}from"./chunk-EEBLJPIB.js";import{a as o}from"./chunk-FTQLQJQV.js";import{spawn as nt,spawnSync as At}from"node:child_process";import{accessSync as vt,constants as Rt,existsSync as _t,promises as Bt}from"node:fs";import et from"node:path";var rt="Git is required for OpenPond app workspaces, but macOS reports Apple Command Line Tools are not installed. OpenPond skipped /usr/bin/git to avoid opening the Xcode installer prompt. Install Command Line Tools with `xcode-select --install`, install Git from Homebrew, or put a non-Apple git binary earlier on PATH.",T;function Lt(e){try{return _t(e)?(vt(e,Rt.X_OK),!0):!1}catch{return!1}}o(Lt,"isExecutable");function Ot(){let e=(process.env.PATH??"").split(et.delimiter).map(t=>t.trim()).filter(Boolean);for(let t of e){let n=et.join(t,"git");if(!(n==="/usr/bin/git"||n==="/bin/git")&&Lt(n))return n}return null}o(Ot,"firstNonAppleGitOnPath");function it(){let e=At("/usr/bin/xcode-select",["-p"],{encoding:"utf8",stdio:["ignore","pipe","pipe"]});return e.status===0&&!!e.stdout.trim()}o(it,"appleDeveloperToolsAvailable");function Dt(e){if(e!=="git"||process.platform!=="darwin")return{command:e};if(T!==void 0)return{command:T};let t=Ot();return t?(T=t,{command:t}):it()?(T="git",{command:"git"}):{error:rt}}o(Dt,"resolveWorkspaceCommand");function u(e,t,n,r={},i){return new Promise(s=>{let a=Dt(e);if("error"in a){s({code:1,stdout:"",stderr:a.error});return}let c=nt(a.command,t,{cwd:n,env:{...process.env,...r,GIT_TERMINAL_PROMPT:"0"},stdio:[i===void 0?"ignore":"pipe","pipe","pipe"]}),d=[],p=[];i!==void 0&&c.stdin?.end(i),c.stdout?.on("data",h=>d.push(h)),c.stderr?.on("data",h=>p.push(h)),c.on("error",h=>{s({code:1,stdout:"",stderr:h.message})}),c.on("close",h=>{s({code:h??1,stdout:Buffer.concat(d).toString("utf8"),stderr:Buffer.concat(p).toString("utf8")})})})}o(u,"runCommand");function Gt(e){return!!(e&&e.includes(rt.slice(0,80)))}o(Gt,"isMacOSGitDeveloperToolsMissing");async function Se(e){await Bt.mkdir(e,{recursive:!0});let t=await u("git",["--version"],e);if(t.code===0)return{ok:!0,command:T??"git",version:(t.stdout||t.stderr).trim()};let n=t.stderr.trim()||t.stdout.trim()||"Git is required for OpenPond app workspaces.";return{ok:!1,error:n,installAction:process.platform==="darwin"&&Gt(n)?"macos_command_line_tools":"manual_git_install"}}o(Se,"checkWorkspaceGitAvailability");function ye(){if(process.platform!=="darwin")return{ok:!1,error:"Apple Command Line Tools installation is only available on macOS."};if(it())return{ok:!0,message:"Apple Command Line Tools already appear to be installed."};try{return nt("/usr/bin/xcode-select",["--install"],{detached:!0,stdio:"ignore"}).unref(),{ok:!0,message:"Opened the Apple Command Line Tools installer."}}catch(e){return{ok:!1,error:e instanceof Error?e.message:String(e)}}}o(ye,"startMacOSCommandLineToolsInstall");import{promises as k}from"node:fs";import m from"node:path";var st=24e3,ot=8e4,It=512*1024,ct=15*1024*1024,Tt=20*1024*1024,Mt=new Set([".cache",".eggs",".git",".ipynb_checkpoints",".mypy_cache",".next",".nox",".nuxt",".openpond",".output",".parcel-cache",".pytest_cache",".pyre",".ruff_cache",".svelte-kit",".tox",".turbo",".venv","__pycache__","artifacts","build","coverage","dist","env","node_modules","out","site-packages","target","venv","volumes"]),zt=new Set([".7z",".avif",".db",".doc",".docx",".gif",".gz",".ico",".jpeg",".jpg",".mov",".mp4",".pdf",".png",".sqlite",".tar",".webp",".xls",".xlsm",".xlsx",".zip"]),$t=new Map([[".avif","image/avif"],[".gif","image/gif"],[".jpeg","image/jpeg"],[".jpg","image/jpeg"],[".png","image/png"],[".webp","image/webp"]]),Nt=new Map([[".m4v","video/x-m4v"],[".mov","video/quicktime"],[".mp4","video/mp4"],[".webm","video/webm"]]),Ht=new Set([".doc",".docx",".pdf"]);function Ut(e){return e.replace(/[^a-zA-Z0-9._-]/g,"-").slice(0,120)||"app"}o(Ut,"safeAppSegment");function N(e){if(!e)return"unknown";try{let t=new URL(e).hostname.toLowerCase();if(t==="github.com"||t.endsWith(".github.com"))return"github";if(t==="openpond.ai"||t.endsWith(".openpond.ai"))return"openpond"}catch{return"unknown"}return"local_git"}o(N,"sourceFromRemote");function $(e){return e.replace(/x-access-token:[^@]+@/g,"x-access-token:***@").replace(/Authorization:\s*Basic\s+[A-Za-z0-9+/=]+/gi,"Authorization: Basic ***")}o($,"redactRemoteUrl");async function G(e){try{return await k.access(e),!0}catch{return!1}}o(G,"pathExists");async function O(e){return await G(e)?(await u("git",["rev-parse","--git-dir"],e)).code===0:!1}o(O,"isGitRepo");function X(e){return e.length<=st?e:`${e.slice(0,st)}
3
3
 
4
4
  [diff truncated]`}o(X,"truncatePatch");function jt(e){return e.length<=ot?e:`${e.slice(0,ot)}
5
5
 
@@ -1,2 +1,2 @@
1
1
  import { createRequire as __openpondCreateRequire } from "node:module"; var require = __openpondCreateRequire(import.meta.url);
2
- import{b as de}from"./chunk-22UARBPW.js";import{a as fe,c as ge,d as ye,f as Re,g as Ae,i as Ce,j as Oe}from"./chunk-I5K74TOH.js";import{A as z,B as J,C as $,D as V,E as Y,F as Q,G as X,H as Z,I as ee,J as te,K as ne,L as oe,M as se,N as re,O as ae,Q as le,V as pe,c as E,d as b,da as ie,e as x,ea as ce,f as L,fa as ue,g as B,ga as me,h as D,ha as he,i as I,j as v,l as U,o as M,p as _,q as H,r as N,s as q,u as k,v as K,w as F,x as G,y as j,z as W}from"./chunk-CWQWV2T3.js";import{a as P,b as w}from"./chunk-GLUWATL5.js";import{a as s}from"./chunk-FTQLQJQV.js";function xe(t,e=14){if(t.length<e+1)return null;let r=0,o=0;for(let l=1;l<=e;l+=1){let m=t[l]-t[l-1];m>=0?r+=m:o-=m}let a=r/e,i=o/e;for(let l=e+1;l<t.length;l+=1){let m=t[l]-t[l-1],d=m>0?m:0,n=m<0?-m:0;a=(a*(e-1)+d)/e,i=(i*(e-1)+n)/e}return i===0?100:100-100/(1+a/i)}s(xe,"computeRsi");function T(t,e){if(t.length<e)return[];let r=[],o=0;for(let a=0;a<t.length;a+=1)o+=t[a],a>=e&&(o-=t[a-e]),a>=e-1&&r.push(o/e);return r}s(T,"computeSmaSeries");function Le(t,e){let r=T(t,e);return r.length>0?r[r.length-1]:null}s(Le,"computeSma");function A(t,e){if(t.length<e)return[];let r=2/(e+1),a=t.slice(0,e).reduce((p,l)=>p+l,0)/e,i=[a];for(let p=e;p<t.length;p+=1)a=t[p]*r+a*(1-r),i.push(a);return i}s(A,"computeEmaSeries");function Be(t,e){let r=A(t,e);return r.length>0?r[r.length-1]:null}s(Be,"computeEma");function De(t){let e=A(t,12),r=A(t,26);if(e.length===0||r.length===0)return null;let o=e.length-r.length,a=r.map((m,d)=>e[d+o]-m),i=A(a,9);if(i.length===0)return null;let p=a[a.length-1],l=i[i.length-1];return{macd:p,signalLine:l,histogram:p-l}}s(De,"computeMacd");function Ie(t,e,r,o){if(t.length<o)return null;let a=e==="ema"?A(t,r):T(t,r),i=e==="ema"?A(t,o):T(t,o);if(a.length===0||i.length===0)return null;let p=a.length-i.length;if(p<0)return null;let l=i.length-1,m=a[l+p],d=i[l],n=l-1,c=n>=0?a[n+p]:null,u=n>=0?i[n]:null,h="neutral";return c!=null&&u!=null?c<=u&&m>d?h="bullish-cross":c>=u&&m<d?h="bearish-cross":m>d?h="bullish":m<d&&(h="bearish"):m>d?h="bullish":m<d&&(h="bearish"),{fast:m,slow:d,signal:h}}s(Ie,"computeMaCross");function ve(t,e=20,r=2){if(t.length<e)return null;let o=t.slice(-e),a=o.reduce((l,m)=>l+m,0)/e,i=o.reduce((l,m)=>l+Math.pow(m-a,2),0)/e,p=Math.sqrt(i);return{middle:a,upper:a+r*p,lower:a-r*p}}s(ve,"computeBollinger");function Ue(t,e=24){if(t.length<2)return null;let r=t[t.length-1],o=Math.max(0,t.length-1-e),a=t[o];if(a===0)return null;let i=(r-a)/a*100;return{previous:a,percent:i}}s(Ue,"computePriceChange");function Me(t,e=14){if(t.length<e+1)return null;let r=[];for(let i=1;i<t.length;i+=1){let p=t[i],l=t[i-1],m=p.high-p.low,d=Math.abs(p.high-l.close),n=Math.abs(p.low-l.close);r.push(Math.max(m,d,n))}return r.length<e?null:r.slice(-e).reduce((i,p)=>i+p,0)/e}s(Me,"computeAtr");function Te(t){return t.replace(/\/$/,"")}s(Te,"resolveUrl");function _e(t){let e=process.env.OPENPOND_BASE_URL,r=t.baseUrl||e||P;return Te(r.trim())}s(_e,"resolveBaseUrl");function He(t){let e=process.env.OPENPOND_API_URL,r=t.apiUrl||e||w;return Te(r.trim())}s(He,"resolveApiUrl");function Ne(t,e){return fe({apiBaseUrl:e,opChatApiBaseUrl:t.opChatApiUrl,chatApiBaseUrl:t.chatApiUrl})}s(Ne,"resolveChatApiUrl");function qe(t,e){let r=process.env.OPENPOND_TOOL_URL,o=t.toolUrl||r||e;return Te(o.trim())}s(qe,"resolveToolUrl");function ke(t){let e=t.apiKey?.trim();if(e)return e;let r=process.env.OPENPOND_API_KEY?.trim();if(r)return r;throw new Error("OPENPOND_API_KEY is required")}s(ke,"resolveApiKey");function Ke(t){let e=t.split("/").filter(Boolean);if(e.length!==2)throw new Error("expected <handle>/<repo>");return{handle:e[0],repo:e[1]}}s(Ke,"parseHandleRepo");function Pe(t){return(t||"").trim().toLowerCase()}s(Pe,"normalizeRepoName");function Fe(t){if(!t||typeof t!="object")return{name:"unknown",raw:t};let e=t,r=e.profile||e.function,o=typeof e.name=="string"?e.name:typeof r?.name=="string"?r.name:"unknown",a=typeof e.description=="string"?e.description:typeof r?.description=="string"?r.description:void 0;return{name:o,description:a,raw:t}}s(Fe,"normalizeToolSummary");function Ge(t){if(!t)return[];if(Array.isArray(t.toolsJson))return t.toolsJson;if(t.metadataJson&&typeof t.metadataJson=="object"){let e=t.metadataJson.tools;if(Array.isArray(e))return e}return[]}s(Ge,"extractDeploymentTools");async function O(t){let{handle:e,repo:r}=Ke(t.target),o=await Se({apiBase:t.apiBase,apiKey:t.apiKey,useCache:t.useCache,cacheTtlMs:t.cacheTtlMs,forceRefresh:t.forceRefresh}),a=Pe(r),i=o.find(p=>p.handle&&p.handle!==e?!1:[p.repo,p.gitRepo,p.id].map(Pe).includes(a));if(!i)throw new Error(`app not found for ${e}/${r}`);return{app:i,handle:e,repo:r}}s(O,"resolveAppTarget");async function Se(t){if(t.useCache&&!t.forceRefresh){let r=await ce({apiBase:t.apiBase,apiKey:t.apiKey,ttlMs:t.cacheTtlMs});if(r)return r}let e=await v(t.apiBase,t.apiKey);return t.useCache&&await ue({apiBase:t.apiBase,apiKey:t.apiKey,apps:e}),e}s(Se,"fetchAppsWithCache");async function we(t){if(t.useCache&&!t.forceRefresh){let o=await me({apiBase:t.apiBase,apiKey:t.apiKey,ttlMs:t.cacheTtlMs});if(o)return o}let e=await k(t.apiBase,t.apiKey),r=Array.isArray(e.tools)?e.tools:[];return t.useCache&&await he({apiBase:t.apiBase,apiKey:t.apiKey,tools:r}),r}s(we,"fetchToolsWithCache");function je(t){if(!t)return"POST";let e=t.toUpperCase();switch(e){case"GET":case"POST":case"PUT":case"DELETE":return e;default:throw new Error("method must be GET, POST, PUT, or DELETE")}}s(je,"normalizeMethod");async function We(t,e){let r,o,a;return await de(t,{...e,onConversationId:s(i=>{r=i,e?.onConversationId?.(i)},"onConversationId"),onItems:s(i=>{for(let p of i){let l=p;!o&&typeof l.appId=="string"&&(o=l.appId,e?.onAppId?.(l.appId)),!a&&typeof l.deploymentId=="string"&&(a=l.deploymentId,e?.onDeploymentId?.(l.deploymentId))}e?.onItems?.(i)},"onItems")}),{conversationId:r,appId:o,deploymentId:a}}s(We,"consumeAgentCreateStream");function Pt(t){let e=ke(t),r=_e(t),o=He(t),a=Ne(t,o),i=qe(t,r),p=t.cacheTtlMs??ie,l=t.useCache!==!1,m=s(async()=>{l&&await Promise.all([Se({apiBase:o,apiKey:e,useCache:l,cacheTtlMs:p,forceRefresh:!0}),we({apiBase:o,apiKey:e,useCache:l,cacheTtlMs:p,forceRefresh:!0})])},"refreshCache"),d=s(async(n,c)=>(await D(o,e,n,{branch:c}))?.id??null,"resolveLatestDeploymentId");return{baseUrl:r,apiUrl:o,chatApiUrl:a,toolUrl:i,apiKey:e,account:{get:s(async()=>se(o,e),"get"),health:s(async()=>re(o,e),"health")},chat:{providers:s(async()=>Re({apiBaseUrl:a,token:e}),"providers"),provider:s(async n=>Ae({apiBaseUrl:a,token:e,provider:n}),"provider"),models:s(async()=>ge({apiBaseUrl:a,token:e}),"models"),model:s(async n=>ye({apiBaseUrl:a,token:e,model:n}),"model"),send:s(async n=>Ce({...n,apiBaseUrl:a,token:e}),"send"),stream:s(n=>Oe({...n,apiBaseUrl:a,token:e}),"stream")},tool:{list:s(async(n,c)=>{let{app:u}=await O({apiBase:o,apiKey:e,target:n,useCache:l,cacheTtlMs:p,forceRefresh:c?.forceRefresh}),h=c?.deploymentId||await d(u.id,c?.branch);if(!h)return{app:u,deploymentId:null,tools:[]};let g=await I(o,e,h),y=Ge(g).map(Fe);return{app:u,deploymentId:h,tools:y}},"list"),run:s(async(n,c,u)=>{let{app:h}=await O({apiBase:o,apiKey:e,target:n,useCache:l,cacheTtlMs:p,forceRefresh:u?.forceRefresh}),g=u?.deploymentId||await d(h.id,u?.branch);if(!g)throw new Error("no deployments found");let f=je(u?.method);return pe(i,e,{appId:h.id,deploymentId:g,toolName:c,method:f,body:u?.body,headers:u?.headers})},"run")},deploy:{watch:s(async(n,c)=>{let{app:u}=await O({apiBase:o,apiKey:e,target:n,useCache:l,cacheTtlMs:p,forceRefresh:c?.forceRefresh}),h=c?.deploymentId||await d(u.id,c?.branch);if(!h)throw new Error("no deployments found");let g=c?.intervalMs??5e3,f=c?.timeoutMs??240*1e3,y=[],S=new Set,Ee=Date.now(),R=null;for(;Date.now()-Ee<f;){let be=await L(o,e,h);for(let C of be)S.has(C.id)||(S.add(C.id),y.push(C),c?.onLog?.(C));if(R=(await B(o,e,h)).status??null,c?.onStatus?.(R),R==="failed")return{deploymentId:h,status:R,logs:y};if(R==="running"||R==="deployed")return{deploymentId:h,status:R,logs:y};await new Promise(C=>setTimeout(C,g))}return{deploymentId:h,status:"timeout",logs:y}},"watch")},template:{status:s(async(n,c)=>{let{app:u}=await O({apiBase:o,apiKey:e,target:n,useCache:l,cacheTtlMs:p,forceRefresh:c?.forceRefresh});return M(o,e,u.id)},"status"),branches:s(async(n,c)=>{let{app:u}=await O({apiBase:o,apiKey:e,target:n,useCache:l,cacheTtlMs:p,forceRefresh:c?.forceRefresh});return _(o,e,u.id)},"branches"),update:s(async(n,c)=>{let{app:u}=await O({apiBase:o,apiKey:e,target:n,useCache:l,cacheTtlMs:p,forceRefresh:c?.forceRefresh}),h=c?.environment==="preview"?"preview":"production";return H(o,e,u.id,{environment:h})},"update")},opentool:{recipesList:s(async(n={})=>F(o,e,n),"recipesList"),recipesSearch:s(async n=>G(o,e,n),"recipesSearch"),recipeGet:s(async n=>j(o,e,n),"recipeGet"),rulesGet:s(async n=>W(o,e,n),"rulesGet")},apps:{list:s(async n=>{let c=await Se({apiBase:o,apiKey:e,useCache:l,cacheTtlMs:p,forceRefresh:n?.forceRefresh});return n?.handle?c.filter(u=>u.handle===n.handle):c},"list"),tools:s(async n=>we({apiBase:o,apiKey:e,useCache:l,cacheTtlMs:p,forceRefresh:n?.forceRefresh}),"tools"),performance:s(async n=>ne(o,e,{appId:n?.appId}),"performance"),summary:s(async n=>oe(o,e,n.appId),"summary"),schedules:s(async n=>K(o,e,n.appId),"schedules"),schedulesStart:s(async n=>{let{appId:c,...u}=n;return z(o,e,c,u)},"schedulesStart"),schedulesStop:s(async n=>J(o,e,n.appId),"schedulesStop"),schedulesStopCurrent:s(async()=>$(o,e),"schedulesStopCurrent"),scheduleRunNow:s(async n=>V(o,e,n),"scheduleRunNow"),scheduleDelete:s(async n=>Y(o,e,n.appId,n.scheduleId),"scheduleDelete"),scheduleExecutionLogs:s(async n=>Q(o,e,n.scheduleId,{limit:n.limit}),"scheduleExecutionLogs"),scheduleExecutionLog:s(async n=>Z(o,e,n.runId),"scheduleExecutionLog"),deploymentScheduleExecutionLogs:s(async n=>X(o,e,n.deploymentId,{limit:n.limit}),"deploymentScheduleExecutionLogs"),executionTimeline:s(async n=>ee(o,e,n.appId,{limit:n.limit}),"executionTimeline"),assistantRun:s(async n=>ae(o,e,n),"assistantRun"),agentCreate:s(async(n,c)=>{let{refreshCache:u,...h}=n,g={...h,streamDeployLogs:h.streamDeployLogs??!0},f=await te(o,e,g);if(!f.ok){let S=await f.text().catch(()=>"");throw new Error(`agent create failed: ${f.status} ${S}`)}let y=await We(f,c);if(l&&u!==!1)try{await m()}catch{}return y},"agentCreate"),toolsExecute:s(async n=>le(o,e,n),"toolsExecute"),deploy:s(async n=>E(o,e,n.appId,{environment:n.environment,commitSha:n.commitSha,branch:n.branch}),"deploy"),startApp:s(async n=>{let{appId:c,...u}=n;return x(o,e,c,u)},"startApp"),promotePreview:s(async n=>{let{appId:c,...u}=n;return b(o,e,c,u)},"promotePreview"),envGet:s(async n=>q(o,e,n.appId),"envGet"),envSet:s(async n=>N(o,e,n.appId,{envVars:n.envVars}),"envSet")},repo:{create:s(async n=>{let{refreshCache:c,...u}=n,h=await U(o,e,u);if(l&&c!==!1)try{await m()}catch{}return h},"create")},cache:{refresh:m}}}s(Pt,"createClient");export{xe as a,T as b,Le as c,A as d,Be as e,De as f,Ie as g,ve as h,Ue as i,Me as j,We as k,Pt as l};
2
+ import{b as de}from"./chunk-22UARBPW.js";import{a as fe,c as ge,d as ye,f as Re,g as Ae,i as Ce,j as Oe}from"./chunk-I5K74TOH.js";import{A as z,B as J,C as $,D as V,E as Y,F as Q,G as X,H as Z,I as ee,J as te,K as ne,L as oe,M as se,N as re,O as ae,Q as le,V as pe,c as E,d as b,da as ie,e as x,ea as ce,f as L,fa as ue,g as B,ga as me,h as D,ha as he,i as I,j as v,l as U,o as M,p as _,q as H,r as N,s as q,u as k,v as K,w as F,x as G,y as j,z as W}from"./chunk-SS3EG6S2.js";import{a as P,b as w}from"./chunk-GLUWATL5.js";import{a as s}from"./chunk-FTQLQJQV.js";function xe(t,e=14){if(t.length<e+1)return null;let r=0,o=0;for(let l=1;l<=e;l+=1){let m=t[l]-t[l-1];m>=0?r+=m:o-=m}let a=r/e,i=o/e;for(let l=e+1;l<t.length;l+=1){let m=t[l]-t[l-1],d=m>0?m:0,n=m<0?-m:0;a=(a*(e-1)+d)/e,i=(i*(e-1)+n)/e}return i===0?100:100-100/(1+a/i)}s(xe,"computeRsi");function T(t,e){if(t.length<e)return[];let r=[],o=0;for(let a=0;a<t.length;a+=1)o+=t[a],a>=e&&(o-=t[a-e]),a>=e-1&&r.push(o/e);return r}s(T,"computeSmaSeries");function Le(t,e){let r=T(t,e);return r.length>0?r[r.length-1]:null}s(Le,"computeSma");function A(t,e){if(t.length<e)return[];let r=2/(e+1),a=t.slice(0,e).reduce((p,l)=>p+l,0)/e,i=[a];for(let p=e;p<t.length;p+=1)a=t[p]*r+a*(1-r),i.push(a);return i}s(A,"computeEmaSeries");function Be(t,e){let r=A(t,e);return r.length>0?r[r.length-1]:null}s(Be,"computeEma");function De(t){let e=A(t,12),r=A(t,26);if(e.length===0||r.length===0)return null;let o=e.length-r.length,a=r.map((m,d)=>e[d+o]-m),i=A(a,9);if(i.length===0)return null;let p=a[a.length-1],l=i[i.length-1];return{macd:p,signalLine:l,histogram:p-l}}s(De,"computeMacd");function Ie(t,e,r,o){if(t.length<o)return null;let a=e==="ema"?A(t,r):T(t,r),i=e==="ema"?A(t,o):T(t,o);if(a.length===0||i.length===0)return null;let p=a.length-i.length;if(p<0)return null;let l=i.length-1,m=a[l+p],d=i[l],n=l-1,c=n>=0?a[n+p]:null,u=n>=0?i[n]:null,h="neutral";return c!=null&&u!=null?c<=u&&m>d?h="bullish-cross":c>=u&&m<d?h="bearish-cross":m>d?h="bullish":m<d&&(h="bearish"):m>d?h="bullish":m<d&&(h="bearish"),{fast:m,slow:d,signal:h}}s(Ie,"computeMaCross");function ve(t,e=20,r=2){if(t.length<e)return null;let o=t.slice(-e),a=o.reduce((l,m)=>l+m,0)/e,i=o.reduce((l,m)=>l+Math.pow(m-a,2),0)/e,p=Math.sqrt(i);return{middle:a,upper:a+r*p,lower:a-r*p}}s(ve,"computeBollinger");function Ue(t,e=24){if(t.length<2)return null;let r=t[t.length-1],o=Math.max(0,t.length-1-e),a=t[o];if(a===0)return null;let i=(r-a)/a*100;return{previous:a,percent:i}}s(Ue,"computePriceChange");function Me(t,e=14){if(t.length<e+1)return null;let r=[];for(let i=1;i<t.length;i+=1){let p=t[i],l=t[i-1],m=p.high-p.low,d=Math.abs(p.high-l.close),n=Math.abs(p.low-l.close);r.push(Math.max(m,d,n))}return r.length<e?null:r.slice(-e).reduce((i,p)=>i+p,0)/e}s(Me,"computeAtr");function Te(t){return t.replace(/\/$/,"")}s(Te,"resolveUrl");function _e(t){let e=process.env.OPENPOND_BASE_URL,r=t.baseUrl||e||P;return Te(r.trim())}s(_e,"resolveBaseUrl");function He(t){let e=process.env.OPENPOND_API_URL,r=t.apiUrl||e||w;return Te(r.trim())}s(He,"resolveApiUrl");function Ne(t,e){return fe({apiBaseUrl:e,opChatApiBaseUrl:t.opChatApiUrl,chatApiBaseUrl:t.chatApiUrl})}s(Ne,"resolveChatApiUrl");function qe(t,e){let r=process.env.OPENPOND_TOOL_URL,o=t.toolUrl||r||e;return Te(o.trim())}s(qe,"resolveToolUrl");function ke(t){let e=t.apiKey?.trim();if(e)return e;let r=process.env.OPENPOND_API_KEY?.trim();if(r)return r;throw new Error("OPENPOND_API_KEY is required")}s(ke,"resolveApiKey");function Ke(t){let e=t.split("/").filter(Boolean);if(e.length!==2)throw new Error("expected <handle>/<repo>");return{handle:e[0],repo:e[1]}}s(Ke,"parseHandleRepo");function Pe(t){return(t||"").trim().toLowerCase()}s(Pe,"normalizeRepoName");function Fe(t){if(!t||typeof t!="object")return{name:"unknown",raw:t};let e=t,r=e.profile||e.function,o=typeof e.name=="string"?e.name:typeof r?.name=="string"?r.name:"unknown",a=typeof e.description=="string"?e.description:typeof r?.description=="string"?r.description:void 0;return{name:o,description:a,raw:t}}s(Fe,"normalizeToolSummary");function Ge(t){if(!t)return[];if(Array.isArray(t.toolsJson))return t.toolsJson;if(t.metadataJson&&typeof t.metadataJson=="object"){let e=t.metadataJson.tools;if(Array.isArray(e))return e}return[]}s(Ge,"extractDeploymentTools");async function O(t){let{handle:e,repo:r}=Ke(t.target),o=await Se({apiBase:t.apiBase,apiKey:t.apiKey,useCache:t.useCache,cacheTtlMs:t.cacheTtlMs,forceRefresh:t.forceRefresh}),a=Pe(r),i=o.find(p=>p.handle&&p.handle!==e?!1:[p.repo,p.gitRepo,p.id].map(Pe).includes(a));if(!i)throw new Error(`app not found for ${e}/${r}`);return{app:i,handle:e,repo:r}}s(O,"resolveAppTarget");async function Se(t){if(t.useCache&&!t.forceRefresh){let r=await ce({apiBase:t.apiBase,apiKey:t.apiKey,ttlMs:t.cacheTtlMs});if(r)return r}let e=await v(t.apiBase,t.apiKey);return t.useCache&&await ue({apiBase:t.apiBase,apiKey:t.apiKey,apps:e}),e}s(Se,"fetchAppsWithCache");async function we(t){if(t.useCache&&!t.forceRefresh){let o=await me({apiBase:t.apiBase,apiKey:t.apiKey,ttlMs:t.cacheTtlMs});if(o)return o}let e=await k(t.apiBase,t.apiKey),r=Array.isArray(e.tools)?e.tools:[];return t.useCache&&await he({apiBase:t.apiBase,apiKey:t.apiKey,tools:r}),r}s(we,"fetchToolsWithCache");function je(t){if(!t)return"POST";let e=t.toUpperCase();switch(e){case"GET":case"POST":case"PUT":case"DELETE":return e;default:throw new Error("method must be GET, POST, PUT, or DELETE")}}s(je,"normalizeMethod");async function We(t,e){let r,o,a;return await de(t,{...e,onConversationId:s(i=>{r=i,e?.onConversationId?.(i)},"onConversationId"),onItems:s(i=>{for(let p of i){let l=p;!o&&typeof l.appId=="string"&&(o=l.appId,e?.onAppId?.(l.appId)),!a&&typeof l.deploymentId=="string"&&(a=l.deploymentId,e?.onDeploymentId?.(l.deploymentId))}e?.onItems?.(i)},"onItems")}),{conversationId:r,appId:o,deploymentId:a}}s(We,"consumeAgentCreateStream");function Pt(t){let e=ke(t),r=_e(t),o=He(t),a=Ne(t,o),i=qe(t,r),p=t.cacheTtlMs??ie,l=t.useCache!==!1,m=s(async()=>{l&&await Promise.all([Se({apiBase:o,apiKey:e,useCache:l,cacheTtlMs:p,forceRefresh:!0}),we({apiBase:o,apiKey:e,useCache:l,cacheTtlMs:p,forceRefresh:!0})])},"refreshCache"),d=s(async(n,c)=>(await D(o,e,n,{branch:c}))?.id??null,"resolveLatestDeploymentId");return{baseUrl:r,apiUrl:o,chatApiUrl:a,toolUrl:i,apiKey:e,account:{get:s(async()=>se(o,e),"get"),health:s(async()=>re(o,e),"health")},chat:{providers:s(async()=>Re({apiBaseUrl:a,token:e}),"providers"),provider:s(async n=>Ae({apiBaseUrl:a,token:e,provider:n}),"provider"),models:s(async()=>ge({apiBaseUrl:a,token:e}),"models"),model:s(async n=>ye({apiBaseUrl:a,token:e,model:n}),"model"),send:s(async n=>Ce({...n,apiBaseUrl:a,token:e}),"send"),stream:s(n=>Oe({...n,apiBaseUrl:a,token:e}),"stream")},tool:{list:s(async(n,c)=>{let{app:u}=await O({apiBase:o,apiKey:e,target:n,useCache:l,cacheTtlMs:p,forceRefresh:c?.forceRefresh}),h=c?.deploymentId||await d(u.id,c?.branch);if(!h)return{app:u,deploymentId:null,tools:[]};let g=await I(o,e,h),y=Ge(g).map(Fe);return{app:u,deploymentId:h,tools:y}},"list"),run:s(async(n,c,u)=>{let{app:h}=await O({apiBase:o,apiKey:e,target:n,useCache:l,cacheTtlMs:p,forceRefresh:u?.forceRefresh}),g=u?.deploymentId||await d(h.id,u?.branch);if(!g)throw new Error("no deployments found");let f=je(u?.method);return pe(i,e,{appId:h.id,deploymentId:g,toolName:c,method:f,body:u?.body,headers:u?.headers})},"run")},deploy:{watch:s(async(n,c)=>{let{app:u}=await O({apiBase:o,apiKey:e,target:n,useCache:l,cacheTtlMs:p,forceRefresh:c?.forceRefresh}),h=c?.deploymentId||await d(u.id,c?.branch);if(!h)throw new Error("no deployments found");let g=c?.intervalMs??5e3,f=c?.timeoutMs??240*1e3,y=[],S=new Set,Ee=Date.now(),R=null;for(;Date.now()-Ee<f;){let be=await L(o,e,h);for(let C of be)S.has(C.id)||(S.add(C.id),y.push(C),c?.onLog?.(C));if(R=(await B(o,e,h)).status??null,c?.onStatus?.(R),R==="failed")return{deploymentId:h,status:R,logs:y};if(R==="running"||R==="deployed")return{deploymentId:h,status:R,logs:y};await new Promise(C=>setTimeout(C,g))}return{deploymentId:h,status:"timeout",logs:y}},"watch")},template:{status:s(async(n,c)=>{let{app:u}=await O({apiBase:o,apiKey:e,target:n,useCache:l,cacheTtlMs:p,forceRefresh:c?.forceRefresh});return M(o,e,u.id)},"status"),branches:s(async(n,c)=>{let{app:u}=await O({apiBase:o,apiKey:e,target:n,useCache:l,cacheTtlMs:p,forceRefresh:c?.forceRefresh});return _(o,e,u.id)},"branches"),update:s(async(n,c)=>{let{app:u}=await O({apiBase:o,apiKey:e,target:n,useCache:l,cacheTtlMs:p,forceRefresh:c?.forceRefresh}),h=c?.environment==="preview"?"preview":"production";return H(o,e,u.id,{environment:h})},"update")},opentool:{recipesList:s(async(n={})=>F(o,e,n),"recipesList"),recipesSearch:s(async n=>G(o,e,n),"recipesSearch"),recipeGet:s(async n=>j(o,e,n),"recipeGet"),rulesGet:s(async n=>W(o,e,n),"rulesGet")},apps:{list:s(async n=>{let c=await Se({apiBase:o,apiKey:e,useCache:l,cacheTtlMs:p,forceRefresh:n?.forceRefresh});return n?.handle?c.filter(u=>u.handle===n.handle):c},"list"),tools:s(async n=>we({apiBase:o,apiKey:e,useCache:l,cacheTtlMs:p,forceRefresh:n?.forceRefresh}),"tools"),performance:s(async n=>ne(o,e,{appId:n?.appId}),"performance"),summary:s(async n=>oe(o,e,n.appId),"summary"),schedules:s(async n=>K(o,e,n.appId),"schedules"),schedulesStart:s(async n=>{let{appId:c,...u}=n;return z(o,e,c,u)},"schedulesStart"),schedulesStop:s(async n=>J(o,e,n.appId),"schedulesStop"),schedulesStopCurrent:s(async()=>$(o,e),"schedulesStopCurrent"),scheduleRunNow:s(async n=>V(o,e,n),"scheduleRunNow"),scheduleDelete:s(async n=>Y(o,e,n.appId,n.scheduleId),"scheduleDelete"),scheduleExecutionLogs:s(async n=>Q(o,e,n.scheduleId,{limit:n.limit}),"scheduleExecutionLogs"),scheduleExecutionLog:s(async n=>Z(o,e,n.runId),"scheduleExecutionLog"),deploymentScheduleExecutionLogs:s(async n=>X(o,e,n.deploymentId,{limit:n.limit}),"deploymentScheduleExecutionLogs"),executionTimeline:s(async n=>ee(o,e,n.appId,{limit:n.limit}),"executionTimeline"),assistantRun:s(async n=>ae(o,e,n),"assistantRun"),agentCreate:s(async(n,c)=>{let{refreshCache:u,...h}=n,g={...h,streamDeployLogs:h.streamDeployLogs??!0},f=await te(o,e,g);if(!f.ok){let S=await f.text().catch(()=>"");throw new Error(`agent create failed: ${f.status} ${S}`)}let y=await We(f,c);if(l&&u!==!1)try{await m()}catch{}return y},"agentCreate"),toolsExecute:s(async n=>le(o,e,n),"toolsExecute"),deploy:s(async n=>E(o,e,n.appId,{environment:n.environment,commitSha:n.commitSha,branch:n.branch}),"deploy"),startApp:s(async n=>{let{appId:c,...u}=n;return x(o,e,c,u)},"startApp"),promotePreview:s(async n=>{let{appId:c,...u}=n;return b(o,e,c,u)},"promotePreview"),envGet:s(async n=>q(o,e,n.appId),"envGet"),envSet:s(async n=>N(o,e,n.appId,{envVars:n.envVars}),"envSet")},repo:{create:s(async n=>{let{refreshCache:c,...u}=n,h=await U(o,e,u);if(l&&c!==!1)try{await m()}catch{}return h},"create")},cache:{refresh:m}}}s(Pt,"createClient");export{xe as a,T as b,Le as c,A as d,Be as e,De as f,Ie as g,ve as h,Ue as i,Me as j,We as k,Pt as l};
@@ -0,0 +1,2 @@
1
+ import { createRequire as __openpondCreateRequire } from "node:module"; var require = __openpondCreateRequire(import.meta.url);
2
+ import{i as a,j as b,k as c}from"./chunk-T2GNPVRY.js";import"./chunk-KRNLKKN6.js";import"./chunk-EEBLJPIB.js";import"./chunk-LLJI6QAY.js";import"./chunk-DY5RF2YE.js";import"./chunk-S64WASAO.js";import"./chunk-6MI4KKWF.js";import"./chunk-SDO4FC4Q.js";import"./chunk-IR3YJWPW.js";import"./chunk-J2S7BOZU.js";import"./chunk-UW6ES5DM.js";import"./chunk-6FA3GG5B.js";import"./chunk-NNLI4OWY.js";import"./chunk-HZP5U2AA.js";import"./chunk-ES2ISFJC.js";import"./chunk-H7IWJN7L.js";import"./chunk-FTQLQJQV.js";export{a as resolveWebLaunchMessages,c as runOpenPondAppServerCli,b as runOpenPondServerCli};
@@ -1,2 +1,2 @@
1
1
  import { createRequire as __openpondCreateRequire } from "node:module"; var require = __openpondCreateRequire(import.meta.url);
2
- import{a as f}from"./chunk-ZKA3XSM7.js";import{$a as I,Ba as J,Qa as N,Ra as q,Ua as k,Wa as A,Xa as B,_a as H,b as d,c as w,e as b,hb as E,ib as M,ja as C,jb as T,la as m,ma as j,na as x,oa as F,pa as v,qa as P}from"./chunk-FYCJSUFV.js";import"./chunk-HZP5U2AA.js";import"./chunk-ES2ISFJC.js";import{d as O,f as S,h as g}from"./chunk-H7IWJN7L.js";import"./chunk-NWI7H753.js";import"./chunk-3M53YXEI.js";import{a as l}from"./chunk-FTQLQJQV.js";import R from"node:path";import{readFile as p}from"node:fs/promises";var n=l((t,s)=>typeof t[s]=="string"?t[s]:void 0,"stringOption");function a(t){console.log(JSON.stringify(t,null,2))}l(a,"print");function U(t,s){let i=n(t,"keyPath");if(i){let r=JSON.parse(i);if(Array.isArray(r)&&r.length&&r.every(c=>typeof c=="string"&&c.length))return r;throw new f("--key-path must be a JSON array of key segments.")}if(!s)throw new f("Specify a setting key, or --key-path for keys containing dots.");return s.split(".")}l(U,"keyPath");async function G(t,s){let i=S({home:n(t,"home")}),r=s[0]??"get",c=g(i).config;if(r==="path"){console.log(c);return}if(r==="export"){let e=await T(i),o=n(t,"file");o?(await b(R.resolve(o),JSON.stringify(e,null,2),{privateParent:!1}),a({path:R.resolve(o),requiresRebinding:e.requiresRebinding})):a(e);return}if(r==="backup"||r==="restore"){let e=n(t,"file"),o=n(t,"keyFile");if(!e||!o)throw new f(`config ${r} requires --file <encrypted-backup> and --key-file <separate-32-byte-key-file>.`);let u=await p(o),y=u.length===32?u:Buffer.from(u.toString("utf8").trim(),"base64");try{a(r==="backup"?await E(i,e,y):await M(e,i,y))}finally{y.fill(0),u.fill(0)}return}if(r==="collect-orphans"){a(await N(i));return}if(r==="schema"){a(F());return}if(r==="migrate"){let e=n(t,"resolutionFile"),o=e?q.parse(JSON.parse(await p(e,"utf8"))):void 0;a(await k(i,{resolutions:o,sourceAppHome:n(t,"sourceAppHome"),sourceConfig:n(t,"sourceConfig"),sourceBrowserState:n(t,"sourceBrowserState"),dryRun:t.dryRun===!0||t.dryRun==="true"}));return}if(r==="recover"){let e=n(t,"revision");a(e?await x(i,e,n(t,"expectedRevision")??d(await w(c))):await A(i));return}if(r==="restart-migration"){a(await B(i));return}if(r==="effective"){a(await I(i,{projectRoot:n(t,"projectRoot"),accountId:n(t,"accountId")}));return}if(r==="trust"||r==="untrust"){let e=n(t,"projectRoot")??s[1];if(!e)throw new f("Specify the canonical project root with --project-root.");await H(i,e,n(t,"accountId")??"local",r==="trust"),a({root:e,trusted:r==="trust"});return}if(r==="revisions"){a(await m(i));return}if(r==="validate"){let e=n(t,"file")??c;C(await p(e,"utf8"),e,t.project===!0||t.project==="true"?"project":"user"),a({valid:!0,path:e});return}if(r==="replace"){let e=n(t,"file");if(!e)throw new f("config replace requires --file <validated-toml-file>.");a(await j(i,n(t,"expectedRevision")??d(await w(c)),await p(e,"utf8")));return}if(r==="doctor"){let e=await w(c),o=null;try{await v(i)}catch(u){o=O(u,c)}a({home:i,path:c,rawRevision:d(e),issue:o,recoverableRevisions:await m(i),migration:await w(R.join(g(i).runtime,"migration.json"))!==null}),o&&(process.exitCode=1);return}if(await k(i),r==="clear-cache"){await J(i),a({cleared:!0,path:g(i).cache});return}let h=await v(i);if(r==="get"){if(!s[1]&&!t.keyPath){a(h);return}let e=h.document;for(let o of U(t,s[1]))e=e&&typeof e=="object"?e[o]:void 0;a(e??null);return}if(r==="set"||r==="unset"){let e=U(t,s[1]),o;if(r==="set"){let u=n(t,"value")??s[2];if(u===void 0)throw new f("config set requires a value. Use JSON for arrays, tables, numbers and booleans.");try{o=JSON.parse(u)}catch{o=u}}a(await P(i,n(t,"expectedRevision")??h.rawRevision,[r==="set"?{op:"set",path:e,value:o}:{op:"unset",path:e}]));return}throw new f(`Unknown config command: ${r}`)}l(G,"runConfigurationCommand");export{G as runConfigurationCommand};
2
+ import{a as f}from"./chunk-QOR55VHT.js";import{$a as I,Ba as J,Qa as N,Ra as q,Ua as k,Wa as A,Xa as B,_a as H,b as d,c as w,e as b,hb as E,ib as M,ja as C,jb as T,la as m,ma as j,na as x,oa as F,pa as v,qa as P}from"./chunk-NNLI4OWY.js";import"./chunk-HZP5U2AA.js";import"./chunk-ES2ISFJC.js";import{d as O,f as S,h as g}from"./chunk-H7IWJN7L.js";import"./chunk-5N6YRABR.js";import"./chunk-3M53YXEI.js";import{a as l}from"./chunk-FTQLQJQV.js";import R from"node:path";import{readFile as p}from"node:fs/promises";var n=l((t,s)=>typeof t[s]=="string"?t[s]:void 0,"stringOption");function a(t){console.log(JSON.stringify(t,null,2))}l(a,"print");function U(t,s){let i=n(t,"keyPath");if(i){let r=JSON.parse(i);if(Array.isArray(r)&&r.length&&r.every(c=>typeof c=="string"&&c.length))return r;throw new f("--key-path must be a JSON array of key segments.")}if(!s)throw new f("Specify a setting key, or --key-path for keys containing dots.");return s.split(".")}l(U,"keyPath");async function G(t,s){let i=S({home:n(t,"home")}),r=s[0]??"get",c=g(i).config;if(r==="path"){console.log(c);return}if(r==="export"){let e=await T(i),o=n(t,"file");o?(await b(R.resolve(o),JSON.stringify(e,null,2),{privateParent:!1}),a({path:R.resolve(o),requiresRebinding:e.requiresRebinding})):a(e);return}if(r==="backup"||r==="restore"){let e=n(t,"file"),o=n(t,"keyFile");if(!e||!o)throw new f(`config ${r} requires --file <encrypted-backup> and --key-file <separate-32-byte-key-file>.`);let u=await p(o),y=u.length===32?u:Buffer.from(u.toString("utf8").trim(),"base64");try{a(r==="backup"?await E(i,e,y):await M(e,i,y))}finally{y.fill(0),u.fill(0)}return}if(r==="collect-orphans"){a(await N(i));return}if(r==="schema"){a(F());return}if(r==="migrate"){let e=n(t,"resolutionFile"),o=e?q.parse(JSON.parse(await p(e,"utf8"))):void 0;a(await k(i,{resolutions:o,sourceAppHome:n(t,"sourceAppHome"),sourceConfig:n(t,"sourceConfig"),sourceBrowserState:n(t,"sourceBrowserState"),dryRun:t.dryRun===!0||t.dryRun==="true"}));return}if(r==="recover"){let e=n(t,"revision");a(e?await x(i,e,n(t,"expectedRevision")??d(await w(c))):await A(i));return}if(r==="restart-migration"){a(await B(i));return}if(r==="effective"){a(await I(i,{projectRoot:n(t,"projectRoot"),accountId:n(t,"accountId")}));return}if(r==="trust"||r==="untrust"){let e=n(t,"projectRoot")??s[1];if(!e)throw new f("Specify the canonical project root with --project-root.");await H(i,e,n(t,"accountId")??"local",r==="trust"),a({root:e,trusted:r==="trust"});return}if(r==="revisions"){a(await m(i));return}if(r==="validate"){let e=n(t,"file")??c;C(await p(e,"utf8"),e,t.project===!0||t.project==="true"?"project":"user"),a({valid:!0,path:e});return}if(r==="replace"){let e=n(t,"file");if(!e)throw new f("config replace requires --file <validated-toml-file>.");a(await j(i,n(t,"expectedRevision")??d(await w(c)),await p(e,"utf8")));return}if(r==="doctor"){let e=await w(c),o=null;try{await v(i)}catch(u){o=O(u,c)}a({home:i,path:c,rawRevision:d(e),issue:o,recoverableRevisions:await m(i),migration:await w(R.join(g(i).runtime,"migration.json"))!==null}),o&&(process.exitCode=1);return}if(await k(i),r==="clear-cache"){await J(i),a({cleared:!0,path:g(i).cache});return}let h=await v(i);if(r==="get"){if(!s[1]&&!t.keyPath){a(h);return}let e=h.document;for(let o of U(t,s[1]))e=e&&typeof e=="object"?e[o]:void 0;a(e??null);return}if(r==="set"||r==="unset"){let e=U(t,s[1]),o;if(r==="set"){let u=n(t,"value")??s[2];if(u===void 0)throw new f("config set requires a value. Use JSON for arrays, tables, numbers and booleans.");try{o=JSON.parse(u)}catch{o=u}}a(await P(i,n(t,"expectedRevision")??h.rawRevision,[r==="set"?{op:"set",path:e,value:o}:{op:"unset",path:e}]));return}throw new f(`Unknown config command: ${r}`)}l(G,"runConfigurationCommand");export{G as runConfigurationCommand};
@@ -1,5 +1,5 @@
1
1
  import { createRequire as __openpondCreateRequire } from "node:module"; var require = __openpondCreateRequire(import.meta.url);
2
- import{a as V,c as D}from"./chunk-BZMVB3GS.js";import{a as M}from"./chunk-6MI4KKWF.js";import{a as J}from"./chunk-6FA3GG5B.js";import{c as U}from"./chunk-ZVOO7FKM.js";import"./chunk-GLUWATL5.js";import{b as n}from"./chunk-ES2ISFJC.js";import{c as k,f as O,g as te,h as q}from"./chunk-3M53YXEI.js";import{a as d}from"./chunk-FTQLQJQV.js";import{readFile as ge,writeFile as ye}from"node:fs/promises";import E from"node:path";import{createInterface as Ee}from"node:readline/promises";var Ae=Object.freeze({init:"openpond continual init --from ./tasks.jsonl",validate:"openpond continual validate ./continual-support.yaml",run:"openpond continual run ./continual-support.yaml",report:"openpond continual report <comparison-series-id>"});import{createHash as ke}from"node:crypto";function W(e){return`${JSON.stringify(G(e),null,2)}
2
+ import{a as V,c as D}from"./chunk-BZMVB3GS.js";import{c as U}from"./chunk-ZVOO7FKM.js";import{a as M}from"./chunk-6MI4KKWF.js";import"./chunk-GLUWATL5.js";import{a as J}from"./chunk-6FA3GG5B.js";import{b as n}from"./chunk-ES2ISFJC.js";import{c as k,f as O,g as te,h as q}from"./chunk-3M53YXEI.js";import{a as d}from"./chunk-FTQLQJQV.js";import{readFile as ge,writeFile as ye}from"node:fs/promises";import E from"node:path";import{createInterface as Ee}from"node:readline/promises";var Ae=Object.freeze({init:"openpond continual init --from ./tasks.jsonl",validate:"openpond continual validate ./continual-support.yaml",run:"openpond continual run ./continual-support.yaml",report:"openpond continual report <comparison-series-id>"});import{createHash as ke}from"node:crypto";function W(e){return`${JSON.stringify(G(e),null,2)}
3
3
  `}d(W,"canonicalJson");function w(e){return ke("sha256").update(W(e)).digest("hex")}d(w,"contentHash");function G(e){return Array.isArray(e)?e.map(G):e&&typeof e=="object"?Object.fromEntries(Object.entries(e).sort(([s],[t])=>s.localeCompare(t)).map(([s,t])=>[s,G(t)])):e}d(G,"normalize");function oe(e){let s=e.semanticSimilarityThreshold??.8;if(!(s>0&&s<=1))throw new Error("semanticSimilarityThreshold must be in (0, 1].");let t=new Set((e.allowSharedFamiliesBetween??[]).flatMap(([a,c])=>[`${a}\0${c}`,`${c}\0${a}`])),o=[];for(let a=0;a<e.panels.length;a+=1){let c=e.panels[a];for(let i=a+1;i<e.panels.length;i+=1){let f=e.panels[i];for(let l of c.tasks)for(let m of f.tasks){let g={leftPanel:c.id,rightPanel:f.id,leftTaskId:l.id,rightTaskId:m.id};if(l.id===m.id?o.push({...g,kind:"duplicate_id",similarity:1}):l.contentHash===m.contentHash&&o.push({...g,kind:"duplicate_content",similarity:1}),l.familyId===m.familyId&&!t.has(`${c.id}\0${f.id}`)&&o.push({...g,kind:"family_overlap",similarity:null}),l.prompt&&m.prompt){let u=Ie(l.prompt,m.prompt);u>=s&&o.push({...g,kind:"prompt_overlap",similarity:u})}}}}let r={schemaVersion:"openpond.continualBenchLeakageAudit.v1",threshold:s,findings:o.sort((a,c)=>JSON.stringify(a).localeCompare(JSON.stringify(c)))};return{...r,contentHash:w(r)}}d(oe,"auditContinualBenchLeakage");function Ie(e,s){let t=d(i=>new Set(i.toLowerCase().match(/[a-z0-9]+/g)??[]),"tokens"),o=t(e),r=t(s),a=new Set([...o,...r]);if(!a.size)return 1;let c=0;for(let i of o)r.has(i)&&(c+=1);return c/a.size}d(Ie,"jaccard");var S=n.string().trim().min(1).max(240),j=n.string().regex(/^[a-f0-9]{64}$/),Xe=n.object({id:S,contentHash:j}).strict(),ve=n.object({id:S,familyId:S,contentHash:j,prompt:n.string().max(1e6).optional(),payload:n.record(n.string(),n.unknown()).optional()}).strict(),Se=n.object({id:S,role:M,passLabel:S.nullable(),taskIds:n.array(S).min(1).max(1e6),disclosurePhase:n.enum(["review","evaluation","final"]),optimizerEligible:n.boolean()}).strict().superRefine((e,s)=>{let t=e.role==="correction"||e.role==="training_eligible";e.optimizerEligible!==t&&s.addIssue({code:"custom",path:["optimizerEligible"],message:"Only correction and training-eligible panels may be optimizer eligible."}),e.role==="frozen_final"&&e.disclosurePhase!=="final"&&s.addIssue({code:"custom",path:["disclosurePhase"],message:"The frozen-final panel may only be disclosed in the final phase."}),new Set(e.taskIds).size!==e.taskIds.length&&s.addIssue({code:"custom",path:["taskIds"],message:"Panel task ids must be unique."})}),Pe=n.object({label:S,familyIds:n.array(S).min(1).max(1e5)}).strict(),xe=n.object({adapter:n.literal("openpond"),apiBaseUrl:n.string().url().optional(),series:n.record(n.string(),n.unknown())}).strict(),T=n.object({schemaVersion:n.literal("openpond.continualBenchManifest.v1"),id:S,revision:n.number().int().positive(),name:n.string().trim().min(1).max(500),description:n.string().trim().min(1).max(2e4),license:n.string().trim().min(1).max(100),source:n.object({repository:n.string().trim().min(1).max(2e3).nullable(),commit:n.string().trim().min(1).max(500).nullable(),generatedBy:n.string().trim().min(1).max(2e3)}).strict(),split:n.object({seed:S,correctionCasesPerFamily:n.number().int().positive().max(100),correctionSelection:n.enum(["stable_hash","minimize_prompt_similarity"]),semanticSimilarityThreshold:n.number().gt(0).lte(1)}).strict(),passes:n.array(Pe).min(1).max(1e3),tasks:n.array(ve).min(1).max(1e6),panels:n.array(Se).min(1).max(1e5),grader:n.object({id:S,contentHash:j,outcomeScale:n.object({minimum:n.number().finite(),maximum:n.number().finite()}).strict()}).strict(),evaluation:n.object({seeds:n.array(n.number().int()).min(1).max(100),repetitions:n.number().int().positive().max(100),confidenceLevel:n.number().gt(0).lt(1),pairedBootstrapSamples:n.number().int().min(1e3).max(1e6)}).strict(),execution:xe.optional(),contentHash:j}).strict().superRefine((e,s)=>{let t=e.tasks.map(i=>i.id);new Set(t).size!==t.length&&s.addIssue({code:"custom",path:["tasks"],message:"Manifest task ids must be unique."});let o=new Set(t);for(let[i,f]of e.panels.entries())f.taskIds.some(l=>!o.has(l))&&s.addIssue({code:"custom",path:["panels",i,"taskIds"],message:"Every panel task must exist in the manifest inventory."});let r=e.passes.map(i=>i.label);new Set(r).size!==r.length&&s.addIssue({code:"custom",path:["passes"],message:"Pass labels must be unique."});let a=new Set(e.tasks.map(i=>i.familyId)),c=e.passes.flatMap(i=>i.familyIds);new Set(c).size!==c.length&&s.addIssue({code:"custom",path:["passes"],message:"An issue family may belong to only one pass."}),c.some(i=>!a.has(i))&&s.addIssue({code:"custom",path:["passes"],message:"Every assigned family must exist in the task inventory."})});function se(e){return T.parse({...e,contentHash:w(e)})}d(se,"sealPortableManifest");function ie(e){let s=T.parse(e),{contentHash:t,...o}=s;return t===w(o)}d(ie,"verifyPortableManifest");var L=n.string().trim().min(1).max(240),K=n.string().regex(/^[a-f0-9]{64}$/),Y=n.number().finite().nullable(),Ce=n.object({attemptId:L,seed:n.number().int(),repetition:n.number().int().nonnegative(),score:Y,passed:n.boolean().nullable(),latencyMs:n.number().nonnegative().nullable(),costUsd:n.number().nonnegative().nullable(),transcript:n.object({path:n.string().min(1),contentHash:K}).strict().nullable(),trace:n.object({path:n.string().min(1),contentHash:K}).strict().nullable(),graderOutputHash:K.nullable(),status:n.enum(["completed","failed","cancelled"])}).strict(),re=n.object({targetId:L,panelId:L,panelRole:M,taskId:L,familyId:L,attempts:n.array(Ce).min(1).max(1e4),meanScore:Y,passRate:Y,confidenceInterval:n.tuple([n.number().finite(),n.number().finite()]).nullable()}).strict(),ae=n.object({targetId:L,trainingGpuSeconds:n.number().nonnegative().nullable(),evaluationGpuSeconds:n.number().nonnegative().nullable(),providerSpendUsd:n.number().nonnegative().nullable(),totalSpendUsd:n.number().nonnegative().nullable(),durationSeconds:n.number().nonnegative().nullable(),optimizerGroups:n.number().int().nonnegative().nullable(),trajectories:n.number().int().nonnegative().nullable()}).strict(),le=n.enum(["systems_complete","correction_absorbed","issue_generalized","continually_current","frontier_pareto_result","inconclusive","loss"]);function ce(e){let s=[],t=[...e.families].sort((o,r)=>o.passLabel.localeCompare(r.passLabel));for(let o of t)s.push(F({id:`${o.passLabel.toLowerCase()}-correction`,role:"correction",passLabel:o.passLabel,taskIds:o.correctionTaskIds,familyIds:[o.familyId],optimizerEligible:!0})),s.push(F({id:`${o.passLabel.toLowerCase()}-siblings`,role:"sibling_verification",passLabel:o.passLabel,taskIds:o.siblingTaskIds,familyIds:[o.familyId],optimizerEligible:!1}));for(let o=0;o<t.length;o+=1){let r=t.slice(0,o+1);s.push(F({id:`known-${r[o].passLabel.toLowerCase()}`,role:"cumulative_known",passLabel:r[o].passLabel,taskIds:r.flatMap(a=>[...a.correctionTaskIds,...a.siblingTaskIds]),familyIds:r.map(a=>a.familyId),optimizerEligible:!1}))}return s.push(F({id:"training-eligible",role:"training_eligible",passLabel:null,taskIds:t.flatMap(o=>o.correctionTaskIds),familyIds:t.map(o=>o.familyId),optimizerEligible:!0})),s}d(ce,"createContinualBenchPanelAllocations");function Q(e){let s=new Set(["sibling_verification","development","retained","frozen_final"]),t=new Set(e.panels.filter(a=>s.has(a.role)).flatMap(a=>a.taskIds)),r=e.panels.filter(a=>a.optimizerEligible).flatMap(a=>a.taskIds).filter(a=>t.has(a));if(r.length)throw new Error(`Hidden evaluation tasks are optimizer eligible: ${[...new Set(r)].sort().join(", ")}`)}d(Q,"assertOptimizerIsolation");function F(e){let s={...e,taskIds:[...e.taskIds].sort(),familyIds:[...e.familyIds].sort()};return{...s,contentHash:w(s)}}d(F,"sealPanel");function A(e){let s=T.safeParse(e);if(!s.success)return{valid:!1,manifestHash:null,leakageHash:null,issues:s.error.issues.map(i=>({severity:"error",code:"schema",message:i.message,path:i.path.join(".")}))};let t=s.data,o=[];ie(t)||o.push({severity:"error",code:"content_hash",message:"Manifest contentHash does not match its canonical payload.",path:"contentHash"});let r=new Map(t.tasks.map(i=>[i.id,i])),a=[];for(let i of t.passes){let f=t.panels.find(u=>u.role==="correction"&&u.passLabel===i.label),l=t.panels.find(u=>u.role==="sibling_verification"&&u.passLabel===i.label);if(!f||!l){o.push({severity:"error",code:"missing_holdout",message:`Pass ${i.label} requires both correction and sibling-verification panels.`,path:"panels"});continue}a.push([f.id,l.id]);let m=new Set(f.taskIds.map(u=>r.get(u)?.familyId)),g=new Set(l.taskIds.map(u=>r.get(u)?.familyId));for(let u of i.familyIds)(!m.has(u)||!g.has(u))&&o.push({severity:"error",code:"insufficient_family",message:`Pass ${i.label} family ${u} lacks a correction or sibling case; the holdout was not weakened.`,path:"passes"})}let c=oe({panels:t.panels.filter(i=>i.role!=="cumulative_known"&&i.role!=="training_eligible").map(i=>({id:i.id,tasks:i.taskIds.map(f=>{let l=r.get(f);return{id:l.id,familyId:l.familyId,contentHash:l.contentHash,prompt:l.prompt}})})),allowSharedFamiliesBetween:a,semanticSimilarityThreshold:t.split.semanticSimilarityThreshold});for(let i of c.findings)o.push({severity:"error",code:`leakage_${i.kind}`,message:`${i.leftTaskId} in ${i.leftPanel} overlaps ${i.rightTaskId} in ${i.rightPanel}.`,path:"panels"});return{valid:!o.some(i=>i.severity==="error"),manifestHash:t.contentHash,issues:o,leakageHash:c.contentHash}}d(A,"validateContinualBenchManifest");function de(e){let s=A(e);if(!s.valid)throw new Error(s.issues.map(t=>`${t.code}: ${t.message}`).join(`
4
4
  `));return T.parse(e)}d(de,"requireValidContinualBenchManifest");var R=n.string().trim().min(1).max(240),me=n.string().regex(/^[a-f0-9]{64}$/),_e=n.object({id:R,label:n.string().trim().min(1).max(500),kind:n.enum(["candidate","accepted_head","base","master","external_reference"]),ordinal:n.number().int().nonnegative().nullable(),meanScore:n.number().finite().nullable(),confidenceInterval:n.tuple([n.number().finite(),n.number().finite()]).nullable(),taskMetrics:n.array(re).max(1e6),efficiency:ae.nullable(),evidenceUrl:n.string().url().nullable()}).strict(),pe=n.object({schemaVersion:n.literal("openpond.continualBenchReport.v1"),seriesId:R,protocol:n.object({id:R,revision:n.number().int().positive(),contentHash:me}).strict(),generatedAt:n.string().datetime({offset:!0}),status:n.enum(["partial","terminal"]),points:n.array(_e).min(1).max(1e4),outcomes:n.array(le).max(7),audit:n.array(n.object({requirement:R,status:n.enum(["passed","failed","unavailable"]),evidenceRefs:n.array(R).max(1e5)}).strict()).max(1e4),chart:n.object({x:n.literal("ordinal"),y:n.literal("meanScore"),series:n.array(n.object({pointId:R,label:n.string(),ordinal:n.number().nullable(),value:n.number().nullable(),lower:n.number().nullable(),upper:n.number().nullable(),kind:n.string()}).strict())}).strict(),contentHash:me}).strict();function ue(e){let s={x:"ordinal",y:"meanScore",series:e.points.map(o=>({pointId:o.id,label:o.label,ordinal:o.ordinal,value:o.meanScore,lower:o.confidenceInterval?.[0]??null,upper:o.confidenceInterval?.[1]??null,kind:o.kind}))},t={...e,chart:s};return pe.parse({...t,contentHash:w(t)})}d(ue,"createContinualBenchReport");function fe(e){let s=pe.parse(e),{contentHash:t,...o}=s;if(t!==w(o))throw new Error("Continual Support report content hash does not match its payload.");return W(s)}d(fe,"exportContinualBenchReport");function be(e){let s=e.correctionCasesPerFamily??1;if(!Number.isInteger(s)||s<1)throw new Error("correctionCasesPerFamily must be a positive integer.");let t=new Map,o=new Map;for(let l of e.tasks){if(t.has(l.id))throw new Error(`Duplicate task id: ${l.id}`);t.set(l.id,l);let m=o.get(l.familyId)??[];m.push(l),o.set(l.familyId,m)}let r=new Map;for(let l of e.passes){if(!l.label.trim())throw new Error("Pass labels cannot be empty.");for(let m of l.familyIds){if(r.has(m))throw new Error(`Family ${m} is assigned to more than one pass.`);r.set(m,l.label)}}let a=[],c=[],i=[];for(let[l,m]of[...o].sort(([g],[u])=>g.localeCompare(u))){let g=r.get(l);if(!g){i.push({code:"unassigned_family",familyId:l,taskCount:m.length});continue}let u=[...m].sort((y,v)=>{let P=w([e.seed,l,y.id,y.contentHash]),h=w([e.seed,l,v.id,v.contentHash]);return P.localeCompare(h)||y.id.localeCompare(v.id)});if(u.length<=s){i.push({code:"insufficient_siblings",familyId:l,taskCount:u.length});continue}e.correctionSelection==="minimize_prompt_similarity"&&s===1&&u.every(y=>y.prompt)&&(u=[...u].sort((y,v)=>{let P=he(y,u),h=he(v,u);return P-h||y.id.localeCompare(v.id)}));let I=u.slice(0,s),$=u.slice(s);a.push(...I.map(y=>({...y,passLabel:g,panelRole:"correction",optimizerEligible:!0})),...$.map(y=>({...y,passLabel:g,panelRole:"sibling_verification",optimizerEligible:!1}))),c.push({familyId:l,passLabel:g,correctionTaskIds:I.map(y=>y.id),siblingTaskIds:$.map(y=>y.id)})}for(let l of r.keys())if(!o.has(l))throw new Error(`Assigned family ${l} has no source tasks.`);let f={schemaVersion:"openpond.continualBenchSplit.v1",seed:e.seed,allocations:a.sort((l,m)=>l.passLabel.localeCompare(m.passLabel)||l.familyId.localeCompare(m.familyId)||l.id.localeCompare(m.id)),families:c.sort((l,m)=>l.passLabel.localeCompare(m.passLabel)||l.familyId.localeCompare(m.familyId)),advisories:i.sort((l,m)=>l.familyId.localeCompare(m.familyId)||l.code.localeCompare(m.code))};return{...f,contentHash:w(f)}}d(be,"createContinualBenchSplit");function he(e,s){return Math.max(...s.filter(t=>t.id!==e.id).map(t=>$e(e.prompt,t.prompt)))}d(he,"maximumSiblingSimilarity");function $e(e,s){let t=d(i=>new Set(i.toLowerCase().match(/[a-z0-9]+/g)??[]),"tokenize"),o=t(e),r=t(s),a=new Set([...o,...r]);if(!a.size)return 1;let c=0;for(let i of o)r.has(i)&&(c+=1);return c/a.size}d($e,"jaccard");async function et(e,s,t={}){let o=s[0];if(!o||!["init","validate","run","report"].includes(o))throw new Error("usage: openpond continual <init|validate|run|report> [manifest-or-series-id]");let r=t.log??console.log;if(o==="init"){await He(e,s.slice(1),t,r);return}if(o==="report"){await Re(e,s.slice(1),t,r);return}let a=s[1];if(!a||s.length!==2)throw new Error(`usage: openpond continual ${o} <manifest-path>`);let c=await ze(E.resolve(a),t.readFile??ge),i=A(c);if(o==="validate"){if(O(e.json))r(JSON.stringify(i,null,2));else{r(i.valid?`Valid Continual Support manifest ${i.manifestHash}.`:"Continual Support manifest is invalid."),r(`Leakage audit ${i.leakageHash??"unavailable"}; ${i.issues.length} finding(s).`);for(let l of i.issues)r(`${l.severity}: ${l.code} at ${l.path}: ${l.message}`)}if(!i.valid)throw Fe("Continual Support validation failed.",2);return}let f=de(c);Q(f),await Le(f,e,t,r)}d(et,"runContinualCommand");async function He(e,s,t,o){if(s.length)throw new Error("continual init accepts --from and --output options, not positional arguments.");let r=k(e,"from");if(!r)throw new Error("continual init requires --from <tasks.json|tasks.jsonl>.");let a=E.resolve(k(e,"output")||"continual-support.yaml"),c=await Be(E.resolve(r),t.readFile??ge),i=O(e.nonInteractive)||!process.stdin.isTTY,f=t.prompt??Me,l=await Oe(c,i,f),m=l.filter(p=>p.panelRole===null||p.panelRole==="correction"||p.panelRole==="sibling_verification"),g=[...new Map(m.map(p=>[p.passLabel,p])).keys()].sort().map(p=>({label:p,familyIds:[...new Set(m.filter(_=>_.passLabel===p).map(_=>_.familyId))].sort()})),u=l.map(p=>({id:p.id,familyId:p.familyId,contentHash:w(p.payload),...p.prompt?{prompt:p.prompt}:{},payload:p.payload})),I=be({tasks:m.map(p=>({id:p.id,familyId:p.familyId,contentHash:w(p.payload),prompt:p.prompt})),passes:g,seed:k(e,"seed")||"continual-support-v1",correctionCasesPerFamily:q(e.correctionCasesPerFamily,"correction-cases-per-family")??1,correctionSelection:k(e,"correctionSelection")==="stable_hash"?"stable_hash":"minimize_prompt_similarity"});if(I.advisories.length)throw new Error(`The proposed split is incomplete and was not weakened: ${I.advisories.map(p=>`${p.code}:${p.familyId}`).join(", ")}`);let $=ce(I).map(p=>({id:p.id,role:p.role,passLabel:p.passLabel,taskIds:p.taskIds,disclosurePhase:p.role==="sibling_verification"?"evaluation":"review",optimizerEligible:p.optimizerEligible})),y=["development","retained","frozen_final"];for(let p of y){let _=l.filter(x=>x.panelRole===p).map(x=>x.id).sort();_.length&&$.push({id:p.replace("_","-"),role:p,passLabel:null,taskIds:_,disclosurePhase:p==="frozen_final"?"final":"evaluation",optimizerEligible:!1})}let v=k(e,"id")||je(k(e,"name")||E.basename(r,E.extname(r))),P=k(e,"grader")||"user-supplied-grader-v1",h={schemaVersion:"openpond.continualBenchManifest.v1",id:v,revision:1,name:k(e,"name")||v,description:k(e,"description")||"A sealed continual-support workflow converted from an ordinary task set.",license:k(e,"license")||"UNSPECIFIED",source:{repository:k(e,"repository")||null,commit:k(e,"commit")||null,generatedBy:`openpond continual init --from ${r}`},split:{seed:I.seed,correctionCasesPerFamily:q(e.correctionCasesPerFamily,"correction-cases-per-family")??1,correctionSelection:k(e,"correctionSelection")==="stable_hash"?"stable_hash":"minimize_prompt_similarity",semanticSimilarityThreshold:te(e.semanticSimilarityThreshold,"semantic-similarity-threshold")??.8},passes:g,tasks:u,panels:$,grader:{id:P,contentHash:w({id:P}),outcomeScale:{minimum:0,maximum:1}},evaluation:{seeds:[1701,1709,1721],repetitions:3,confidenceLevel:.95,pairedBootstrapSamples:1e4}},H=se(h),ne=a.endsWith(".json")?`${JSON.stringify(H,null,2)}
5
5
  `:J.dump(H,{noRefs:!0,lineWidth:120,sortKeys:!1});await(t.writeFile??ye)(a,ne,"utf8"),o(`Created ${a}.`),o(`Manifest ${H.contentHash}; split ${I.contentHash}.`)}d(He,"initializeManifest");async function Le(e,s,t,o){if(!e.execution)throw new Error("This manifest validates locally but needs an execution.openpond series binding before `continual run`.");let r={...e.execution.series},a=r.benchmarkProtocol,c=C(a?.issueFamilyLedger);if(!a||c.contentHash!==e.contentHash)throw new Error("execution.series.benchmarkProtocol.issueFamilyLedger must bind the exact sealed portable manifest hash.");let i=U(s)??e.execution.apiBaseUrl??process.env.OPENPOND_LOCAL_API_URL?.replace(/\/$/,"")??V,f=t.request??await D(i),l=C(await X(f,`${i}/v1/training/comparison-series`,"POST",{series:r})),m=b(l.id)||b(r.id),g=ee(l.revision);if(!m||!g)throw new Error("OpenPond did not return a Comparison Series identity and revision.");await X(f,`${i}/v1/training/comparison-series/${encodeURIComponent(m)}/seal`,"POST",{expectedRevision:g});let u=`/models/comparisons/${encodeURIComponent(m)}`,I={comparisonSeriesId:m,canonicalUrl:u,protocolHash:e.contentHash};o(O(s.json)?JSON.stringify(I,null,2):`Created and sealed Comparison Series ${m}.
@@ -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}from"./chunk-OD6AGGH6.js";import"./chunk-CCJG7GLE.js";import"./chunk-ZVOO7FKM.js";import"./chunk-OGPHXXCD.js";import"./chunk-K4QLUFGX.js";import"./chunk-U6HOHOOI.js";import"./chunk-KDXLNQNF.js";import"./chunk-CWQWV2T3.js";import"./chunk-LYWUCJTV.js";import"./chunk-GLUWATL5.js";import"./chunk-ZKA3XSM7.js";import"./chunk-FYCJSUFV.js";import"./chunk-HZP5U2AA.js";import"./chunk-ES2ISFJC.js";import"./chunk-H7IWJN7L.js";import"./chunk-NWI7H753.js";import"./chunk-3M53YXEI.js";import"./chunk-FTQLQJQV.js";export{m as resolveGitBranch,f as runAccount,j as runBacktestRun,p as runCheckUpdate,k as runDeployWatch,g as runHealth,d as runLogin,o as runOpentool,e as runProfiles,l as runRepoCreate,n as runRepoPush,b as runTemplateBranches,a as runTemplateStatus,c as runTemplateUpdate,h as runToolList,i as runToolRun};
2
+ import{a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p}from"./chunk-4LLHOG7L.js";import"./chunk-G2VYRU27.js";import"./chunk-ZVOO7FKM.js";import"./chunk-OGPHXXCD.js";import"./chunk-B6IIGPWS.js";import"./chunk-SS3EG6S2.js";import"./chunk-GLUWATL5.js";import"./chunk-O4IARD7H.js";import"./chunk-J2S7BOZU.js";import"./chunk-UW6ES5DM.js";import"./chunk-QOR55VHT.js";import"./chunk-NNLI4OWY.js";import"./chunk-HZP5U2AA.js";import"./chunk-ES2ISFJC.js";import"./chunk-H7IWJN7L.js";import"./chunk-5N6YRABR.js";import"./chunk-3M53YXEI.js";import"./chunk-FTQLQJQV.js";export{m as resolveGitBranch,f as runAccount,j as runBacktestRun,p as runCheckUpdate,k as runDeployWatch,g as runHealth,d as runLogin,o as runOpentool,e as runProfiles,l as runRepoCreate,n as runRepoPush,b as runTemplateBranches,a as runTemplateStatus,c as runTemplateUpdate,h as runToolList,i as runToolRun};
@@ -1,3 +1,3 @@
1
1
  import { createRequire as __openpondCreateRequire } from "node:module"; var require = __openpondCreateRequire(import.meta.url);
2
- import{x as f}from"./chunk-CCJG7GLE.js";import"./chunk-ZVOO7FKM.js";import"./chunk-OGPHXXCD.js";import"./chunk-K4QLUFGX.js";import"./chunk-U6HOHOOI.js";import"./chunk-KDXLNQNF.js";import"./chunk-CWQWV2T3.js";import"./chunk-LYWUCJTV.js";import"./chunk-GLUWATL5.js";import{a as c}from"./chunk-ZKA3XSM7.js";import"./chunk-FYCJSUFV.js";import"./chunk-HZP5U2AA.js";import"./chunk-ES2ISFJC.js";import"./chunk-H7IWJN7L.js";import"./chunk-NWI7H753.js";import{c as p,f as u}from"./chunk-3M53YXEI.js";import{a as r}from"./chunk-FTQLQJQV.js";import d from"node:path";import{access as v}from"node:fs/promises";import{constants as C}from"node:fs";import{createRequire as P}from"node:module";var l=d.join("scripts","desktop-harness.ts");async function $(n,t){let o=await j({options:n,rest:t}),e=await f(o.command,o.args,{cwd:o.cwd,inherit:!0,timeoutMs:0});if(e.code!==0)throw new m(e.code)}r($,"runDesktopTestCommand");async function j(n){let t=n.options,o=n.rest,e=o[0];if(e!=="run"&&e!=="attach")throw new c(D());let a=o.slice(1);if(a.length===0)throw new c("usage: openpond desktop-test run <scenario...> [options]");let g=p(t,"cwd")||n.cwd||process.cwd(),w=await O(g),k=(n.env??process.env).OPENPOND_NODE_BINARY?.trim()||process.execPath,s=[P(import.meta.url).resolve("tsx/cli"),l,"run",...a],h=x(t,e);return h&&s.push(`--${h}`),i(s,"--app",t,"app"),i(s,"--server",t,"server"),i(s,"--token",t,"token"),i(s,"--token-file",t,"tokenFile"),i(s,"--devtools-port",t,"devtoolsPort"),i(s,"--artifacts-dir",t,"artifactsDir"),H(s,t),i(s,"--grep",t,"grep"),i(s,"--timeout-ms",t,"timeoutMs"),u(t.keepHome)&&s.push("--keep-home"),{command:k,args:s,cwd:w}}r(j,"buildDesktopHarnessInvocation");async function O(n){let t=d.resolve(n);for(;;){let o=d.join(t,l);if(await R(o))return t;let e=d.dirname(t);if(e===t)throw new c(`Could not find ${l}. Run this command from the OpenPond source checkout or pass --cwd <repo>.`);t=e}}r(O,"resolveDesktopHarnessRepoRoot");function x(n,t){let o=t==="attach"?"attach":null;for(let e of["isolated","attach","packaged","none"])if(u(n[e])){if(o&&o!==e)throw new c("Choose only one desktop harness launch mode: --isolated, --attach, --packaged, or --none.");o=e}return o}r(x,"resolveLaunchMode");function i(n,t,o,e){let a=p(o,e);a&&n.push(t,a)}r(i,"appendStringFlag");function H(n,t){let o=p(t,"json"),e=p(t,"jsonPath");if(o&&y(o))throw new c("harness --json requires a report path. Use --json <path> or --json-path <path>.");if(o&&e&&o!==e)throw new c("Use only one JSON report path: --json <path> or --json-path <path>.");let a=o||e;a&&n.push("--json",a)}r(H,"appendJsonFlag");function y(n){return/^(true|false|1|0|yes|no)$/i.test(n)}r(y,"isBooleanLiteral");async function R(n){try{return await v(n,C.R_OK),!0}catch{return!1}}r(R,"fileExists");function D(){return["usage: openpond desktop-test run <scenario...> [options]"," openpond desktop-test attach <scenario...> [options]","","Options include --isolated, --attach, --packaged, --none, --app <path>,","--server <url>, --token <token>, --token-file <path>, --devtools-port <port>, --artifacts-dir <path>,","--json <path>, --json-path <path>, --grep <pattern>, --timeout-ms <ms>,","--keep-home, and --cwd <repo>."].join(`
2
+ import{x as f}from"./chunk-G2VYRU27.js";import"./chunk-ZVOO7FKM.js";import"./chunk-OGPHXXCD.js";import"./chunk-B6IIGPWS.js";import"./chunk-SS3EG6S2.js";import"./chunk-GLUWATL5.js";import"./chunk-O4IARD7H.js";import"./chunk-J2S7BOZU.js";import"./chunk-UW6ES5DM.js";import{a as c}from"./chunk-QOR55VHT.js";import"./chunk-NNLI4OWY.js";import"./chunk-HZP5U2AA.js";import"./chunk-ES2ISFJC.js";import"./chunk-H7IWJN7L.js";import"./chunk-5N6YRABR.js";import{c as p,f as u}from"./chunk-3M53YXEI.js";import{a as r}from"./chunk-FTQLQJQV.js";import d from"node:path";import{access as v}from"node:fs/promises";import{constants as C}from"node:fs";import{createRequire as P}from"node:module";var l=d.join("scripts","desktop-harness.ts");async function $(n,t){let o=await j({options:n,rest:t}),e=await f(o.command,o.args,{cwd:o.cwd,inherit:!0,timeoutMs:0});if(e.code!==0)throw new m(e.code)}r($,"runDesktopTestCommand");async function j(n){let t=n.options,o=n.rest,e=o[0];if(e!=="run"&&e!=="attach")throw new c(D());let a=o.slice(1);if(a.length===0)throw new c("usage: openpond desktop-test run <scenario...> [options]");let g=p(t,"cwd")||n.cwd||process.cwd(),w=await O(g),k=(n.env??process.env).OPENPOND_NODE_BINARY?.trim()||process.execPath,s=[P(import.meta.url).resolve("tsx/cli"),l,"run",...a],h=x(t,e);return h&&s.push(`--${h}`),i(s,"--app",t,"app"),i(s,"--server",t,"server"),i(s,"--token",t,"token"),i(s,"--token-file",t,"tokenFile"),i(s,"--devtools-port",t,"devtoolsPort"),i(s,"--artifacts-dir",t,"artifactsDir"),H(s,t),i(s,"--grep",t,"grep"),i(s,"--timeout-ms",t,"timeoutMs"),u(t.keepHome)&&s.push("--keep-home"),{command:k,args:s,cwd:w}}r(j,"buildDesktopHarnessInvocation");async function O(n){let t=d.resolve(n);for(;;){let o=d.join(t,l);if(await R(o))return t;let e=d.dirname(t);if(e===t)throw new c(`Could not find ${l}. Run this command from the OpenPond source checkout or pass --cwd <repo>.`);t=e}}r(O,"resolveDesktopHarnessRepoRoot");function x(n,t){let o=t==="attach"?"attach":null;for(let e of["isolated","attach","packaged","none"])if(u(n[e])){if(o&&o!==e)throw new c("Choose only one desktop harness launch mode: --isolated, --attach, --packaged, or --none.");o=e}return o}r(x,"resolveLaunchMode");function i(n,t,o,e){let a=p(o,e);a&&n.push(t,a)}r(i,"appendStringFlag");function H(n,t){let o=p(t,"json"),e=p(t,"jsonPath");if(o&&y(o))throw new c("harness --json requires a report path. Use --json <path> or --json-path <path>.");if(o&&e&&o!==e)throw new c("Use only one JSON report path: --json <path> or --json-path <path>.");let a=o||e;a&&n.push("--json",a)}r(H,"appendJsonFlag");function y(n){return/^(true|false|1|0|yes|no)$/i.test(n)}r(y,"isBooleanLiteral");async function R(n){try{return await v(n,C.R_OK),!0}catch{return!1}}r(R,"fileExists");function D(){return["usage: openpond desktop-test run <scenario...> [options]"," openpond desktop-test attach <scenario...> [options]","","Options include --isolated, --attach, --packaged, --none, --app <path>,","--server <url>, --token <token>, --token-file <path>, --devtools-port <port>, --artifacts-dir <path>,","--json <path>, --json-path <path>, --grep <pattern>, --timeout-ms <ms>,","--keep-home, and --cwd <repo>."].join(`
3
3
  `)}r(D,"desktopHarnessCliUsage");var m=class extends Error{static{r(this,"HarnessCommandFailedError")}exitCode;constructor(t){let o=typeof t=="number"&&t>0?t:1;super(`desktop harness failed with exit code ${o}`),this.name="HarnessCommandFailedError",this.exitCode=o}};export{j as buildDesktopHarnessInvocation,O as resolveDesktopHarnessRepoRoot,$ as runDesktopTestCommand};
@@ -1,2 +1,2 @@
1
1
  import { createRequire as __openpondCreateRequire } from "node:module"; var require = __openpondCreateRequire(import.meta.url);
2
- import{$a as xa,Aa as Y,Ba as Z,Ca as _,Da as $,Ea as aa,Fa as ba,Ga as ca,Ha as da,Ia as ea,Ja as fa,Ka as ga,La as ha,Ma as ia,Na as ja,Oa as ka,Pa as la,Qa as ma,Ra as na,Sa as oa,Ta as pa,Ua as qa,Va as ra,Wa as sa,Xa as ta,Ya as ua,Za as va,_a as wa,a as l,ab as ya,b as m,bb as za,c as n,cb as Aa,d as o,db as Ba,e as p,ea as v,eb as Ca,f as q,fa as w,fb as Da,g as r,ga as x,gb as Ea,h as s,ha as y,hb as Fa,i as t,ia as z,ib as Ga,j as u,ja as A,jb as Ha,ka as B,kb as Ia,la as C,ma as D,na as E,oa as F,pa as G,qa as H,ra as I,sa as J,ta as K,ua as L,va as M,wa as N,xa as O,ya as W,za as X}from"./chunk-FYCJSUFV.js";import"./chunk-HZP5U2AA.js";import"./chunk-ES2ISFJC.js";import{a,b,c,d,e,f,g,h,i,k as j,l as k,m as P,n as Q,o as R,p as S,q as T,r as U,s as V}from"./chunk-H7IWJN7L.js";import"./chunk-FTQLQJQV.js";export{Ca as CLIENT_CHOICE_KEYS,Ba as ClientChoicesSchema,w as ConfigSchema,v as CredentialReferenceSchema,L as LAYOUT_PREFERENCE_KEYS,l as MISSING_REVISION,na as MigrationResolutionsSchema,P as PERSISTENCE_TABLES_SQL,c as PersistenceError,ea as accountId,r as acquireFileLock,ja as artifactReference,za as assertConfigRunCurrent,Ia as assertHomeCompatible,k as assertStorageAncestors,p as atomicWriteFile,b as bindHomeCallbacks,ya as captureConfigRun,Z as clearCache,ma as collectArtifactOrphans,F as configEditorSchema,C as configRecoveryRevisions,N as configToPreferences,da as credentialVersions,ba as deleteCredential,V as deleteLocalRecord,y as diffConfig,Aa as effectivePreferences,g as expandHome,Fa as exportRecoveryBackup,Ha as exportSettings,m as fileRevision,S as getLocalRecord,qa as initializeHome,e as isMissing,O as layoutPreferences,Y as listCache,T as listLocalRecords,J as mergeConfig,ca as newCredentialId,Q as openStorageDatabase,H as patchConfig,d as persistenceIssue,M as preferencesToConfig,o as privateDirectory,s as processIsDead,j as protectPrivateDirectory,ia as publishManagedArtifact,U as putLocalRecord,fa as readAccountConfiguration,W as readCache,Da as readClientChoices,G as readConfig,_ as readCredential,$ as readCredentials,t as readJsonFile,oa as readMigrationJournal,n as readOptionalFile,ua as readPreferences,sa as recoverMigration,la as releaseArtifactReference,B as rememberValidConfig,D as replaceConfigText,i as resolveConfigPath,xa as resolveEffectiveConfig,f as resolveOpenPondHome,pa as resolveStoredPath,ta as restartMigration,E as restoreConfigRevision,Ga as restoreRecoveryBackup,z as serializeConfig,wa as setProjectTrust,h as storagePaths,ga as updateAccountConfiguration,Ea as updateClientChoices,I as updateConfig,u as updateJsonFile,va as updatePreferences,x as validateConfigDocument,A as validateConfigText,ha as validateManagedArtifacts,ra as validateMigratedHome,K as watchConfig,q as withFileLock,R as withLocalDatabase,ka as withManagedArtifact,a as withOpenPondHome,X as writeCache,aa as writeCredential};
2
+ import{$a as xa,Aa as Y,Ba as Z,Ca as _,Da as $,Ea as aa,Fa as ba,Ga as ca,Ha as da,Ia as ea,Ja as fa,Ka as ga,La as ha,Ma as ia,Na as ja,Oa as ka,Pa as la,Qa as ma,Ra as na,Sa as oa,Ta as pa,Ua as qa,Va as ra,Wa as sa,Xa as ta,Ya as ua,Za as va,_a as wa,a as l,ab as ya,b as m,bb as za,c as n,cb as Aa,d as o,db as Ba,e as p,ea as v,eb as Ca,f as q,fa as w,fb as Da,g as r,ga as x,gb as Ea,h as s,ha as y,hb as Fa,i as t,ia as z,ib as Ga,j as u,ja as A,jb as Ha,ka as B,kb as Ia,la as C,ma as D,na as E,oa as F,pa as G,qa as H,ra as I,sa as J,ta as K,ua as L,va as M,wa as N,xa as O,ya as W,za as X}from"./chunk-NNLI4OWY.js";import"./chunk-HZP5U2AA.js";import"./chunk-ES2ISFJC.js";import{a,b,c,d,e,f,g,h,i,k as j,l as k,m as P,n as Q,o as R,p as S,q as T,r as U,s as V}from"./chunk-H7IWJN7L.js";import"./chunk-FTQLQJQV.js";export{Ca as CLIENT_CHOICE_KEYS,Ba as ClientChoicesSchema,w as ConfigSchema,v as CredentialReferenceSchema,L as LAYOUT_PREFERENCE_KEYS,l as MISSING_REVISION,na as MigrationResolutionsSchema,P as PERSISTENCE_TABLES_SQL,c as PersistenceError,ea as accountId,r as acquireFileLock,ja as artifactReference,za as assertConfigRunCurrent,Ia as assertHomeCompatible,k as assertStorageAncestors,p as atomicWriteFile,b as bindHomeCallbacks,ya as captureConfigRun,Z as clearCache,ma as collectArtifactOrphans,F as configEditorSchema,C as configRecoveryRevisions,N as configToPreferences,da as credentialVersions,ba as deleteCredential,V as deleteLocalRecord,y as diffConfig,Aa as effectivePreferences,g as expandHome,Fa as exportRecoveryBackup,Ha as exportSettings,m as fileRevision,S as getLocalRecord,qa as initializeHome,e as isMissing,O as layoutPreferences,Y as listCache,T as listLocalRecords,J as mergeConfig,ca as newCredentialId,Q as openStorageDatabase,H as patchConfig,d as persistenceIssue,M as preferencesToConfig,o as privateDirectory,s as processIsDead,j as protectPrivateDirectory,ia as publishManagedArtifact,U as putLocalRecord,fa as readAccountConfiguration,W as readCache,Da as readClientChoices,G as readConfig,_ as readCredential,$ as readCredentials,t as readJsonFile,oa as readMigrationJournal,n as readOptionalFile,ua as readPreferences,sa as recoverMigration,la as releaseArtifactReference,B as rememberValidConfig,D as replaceConfigText,i as resolveConfigPath,xa as resolveEffectiveConfig,f as resolveOpenPondHome,pa as resolveStoredPath,ta as restartMigration,E as restoreConfigRevision,Ga as restoreRecoveryBackup,z as serializeConfig,wa as setProjectTrust,h as storagePaths,ga as updateAccountConfiguration,Ea as updateClientChoices,I as updateConfig,u as updateJsonFile,va as updatePreferences,x as validateConfigDocument,A as validateConfigText,ha as validateManagedArtifacts,ra as validateMigratedHome,K as watchConfig,q as withFileLock,R as withLocalDatabase,ka as withManagedArtifact,a as withOpenPondHome,X as writeCache,aa as writeCredential};