openpond 0.2.11 → 0.2.12

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 (41) hide show
  1. package/dist/app-server.d.ts +4 -0
  2. package/dist/app-server.js +1 -1
  3. package/dist/chunks/{actions-command-V5DZWEON.js → actions-command-GF4Y7XF4.js} +1 -1
  4. package/dist/chunks/{app-layer-Y7SEYQCA.js → app-layer-2GL42D4P.js} +1 -1
  5. package/dist/chunks/app-server-runtime-24KZ44ZT.js +2 -0
  6. package/dist/chunks/{apps-HSS4KWPK.js → apps-CABD3NMT.js} +1 -1
  7. package/dist/chunks/{chunk-LCKCUSP7.js → chunk-4LEX4GTH.js} +1 -1
  8. package/dist/chunks/{chunk-B6IIGPWS.js → chunk-4LSZK4MF.js} +1 -1
  9. package/dist/chunks/{chunk-2I4W24NK.js → chunk-645ZCJMN.js} +1 -1
  10. package/dist/chunks/chunk-F5JZYYKU.js +5 -0
  11. package/dist/chunks/{chunk-3T5XJEDM.js → chunk-GHN2HOZZ.js} +2 -2
  12. package/dist/chunks/{chunk-UW6ES5DM.js → chunk-I4FOBNHQ.js} +15 -15
  13. package/dist/chunks/{chunk-J2MP4LSF.js → chunk-L564A7TY.js} +1 -1
  14. package/dist/chunks/{chunk-WW5SGVGJ.js → chunk-NWSHAK3L.js} +1 -1
  15. package/dist/chunks/{chunk-O4IARD7H.js → chunk-R33VLNFY.js} +1 -1
  16. package/dist/chunks/{chunk-B3RE35SQ.js → chunk-RTHNSE6G.js} +1 -1
  17. package/dist/chunks/{chunk-3DJF6IZ7.js → chunk-UM2K7YHI.js} +1 -1
  18. package/dist/chunks/{chunk-GA7VBKCH.js → chunk-USXJTOD5.js} +11 -11
  19. package/dist/chunks/{chunk-ENCAWWFY.js → chunk-VAKLZZUV.js} +344 -335
  20. package/dist/chunks/{chunk-RPS53CGT.js → chunk-VTNKXJMD.js} +1 -1
  21. package/dist/chunks/{cli-KSVNPTUC.js → cli-5CB2IOBD.js} +1 -1
  22. package/dist/chunks/{configuration-command-QFJTY4ZU.js → configuration-command-ZLORYSWN.js} +1 -1
  23. package/dist/chunks/{core-commands-TO3M5MO4.js → core-commands-ZG7XHCIV.js} +1 -1
  24. package/dist/chunks/{desktop-test-5SU5G4FN.js → desktop-test-VHPQRCW4.js} +1 -1
  25. package/dist/chunks/{extension-DCZ5DPRY.js → extension-B25YICMA.js} +1 -1
  26. package/dist/chunks/{help-IHCPRO43.js → help-A3WX4THT.js} +1 -1
  27. package/dist/chunks/{opchat-YQVCNDDK.js → opchat-54TLTDTZ.js} +1 -1
  28. package/dist/chunks/{organizations-TJAS5AO2.js → organizations-BUWM3YH7.js} +1 -1
  29. package/dist/chunks/{profile-2XAUWXP5.js → profile-3WAMFPYW.js} +1 -1
  30. package/dist/chunks/{project-agent-EN66WJBL.js → project-agent-MODOYPZH.js} +1 -1
  31. package/dist/chunks/{sandbox-command-LYUXPY4U.js → sandbox-command-E5NLILGZ.js} +1 -1
  32. package/dist/chunks/{sandbox-template-HXH2CSY4.js → sandbox-template-JXBTBECW.js} +1 -1
  33. package/dist/chunks/{src-4DML3FLR.js → src-DCKMDSJG.js} +1 -1
  34. package/dist/chunks/{src-KE3LWA75.js → src-IBMTL45C.js} +107 -107
  35. package/dist/chunks/{teams-bot-YH7QUK2N.js → teams-bot-PBZVFB5A.js} +1 -1
  36. package/dist/chunks/{workspaces-DC33D43W.js → workspaces-A6ONMJW5.js} +1 -1
  37. package/dist/cli.js +1 -1
  38. package/dist/index.js +1 -1
  39. package/package.json +1 -1
  40. package/dist/chunks/app-server-runtime-R7O7EWVF.js +0 -2
  41. package/dist/chunks/chunk-5NGYLR3V.js +0 -5
@@ -1,3 +1,3 @@
1
1
  import { createRequire as __openpondCreateRequire } from "node:module"; var require = __openpondCreateRequire(import.meta.url);
2
- import{p 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"./chunk-2I4W24NK.js";import"./chunk-NNLI4OWY.js";import"./chunk-HZP5U2AA.js";import"./chunk-ES2ISFJC.js";import"./chunk-H7IWJN7L.js";import"./chunk-3T5XJEDM.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{p as f}from"./chunk-G2VYRU27.js";import"./chunk-ZVOO7FKM.js";import"./chunk-OGPHXXCD.js";import"./chunk-4LSZK4MF.js";import"./chunk-SS3EG6S2.js";import"./chunk-GLUWATL5.js";import"./chunk-R33VLNFY.js";import"./chunk-J2S7BOZU.js";import"./chunk-I4FOBNHQ.js";import"./chunk-645ZCJMN.js";import"./chunk-NNLI4OWY.js";import"./chunk-HZP5U2AA.js";import"./chunk-ES2ISFJC.js";import"./chunk-H7IWJN7L.js";import"./chunk-GHN2HOZZ.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(`
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,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-RPS53CGT.js";import"./chunk-J2MP4LSF.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-VTNKXJMD.js";import"./chunk-L564A7TY.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-ZVOO7FKM.js";import"./chunks/chunk-GLUWATL5.js";import{b as u}from"./chunks/chunk-2I4W24NK.js";import{a as c,j as d}from"./chunks/chunk-3T5XJEDM.js";import{f as s}from"./chunks/chunk-3M53YXEI.js";import{a as i}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"}i(f,"resolveCliTopLevelAction");async function v(e=process.argv.slice(2)){if(await C(e))return;let{command:r,options:o,rest:t}=u(e);typeof o.home=="string"&&(process.env.OPENPOND_HOME=(await import("./chunks/dist-UA2RQUA4.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-TO3M5MO4.js")).runCheckUpdate();return}if(n==="help"){(await import("./chunks/help-IHCPRO43.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-Y7SEYQCA.js")).runOpenPondTerminalCommand(o,t);return}if(n==="ui"){await(await import("./chunks/app-layer-Y7SEYQCA.js")).runOpenPondServerCommand("web",o,t);return}await d({command:r,options:o,rest:t})||((await import("./chunks/help-IHCPRO43.js")).printHelp(),process.exit(1))}i(v,"runOpenPondCli");async function C(e){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-R7O7EWVF.js"),import("./chunks/cli-KSVNPTUC.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-KE3LWA75.js"),import("./chunks/cli-KSVNPTUC.js")]),{createOpenPondAppServer:t}=await import("./chunks/app-server-runtime-R7O7EWVF.js");return await o({createOpenPondServer:r,createOpenPondAppServer:t}),!0}return e[0]==="__terminal"?(await(await import("./chunks/src-4DML3FLR.js")).runOpenPondTerminalCli(e.slice(1)),!0):!1}i(C,"runEmbeddedCompanion");v().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-ZVOO7FKM.js";import"./chunks/chunk-GLUWATL5.js";import{b as u}from"./chunks/chunk-645ZCJMN.js";import{a as c,j as d}from"./chunks/chunk-GHN2HOZZ.js";import{f as s}from"./chunks/chunk-3M53YXEI.js";import{a as i}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"}i(f,"resolveCliTopLevelAction");async function v(e=process.argv.slice(2)){if(await C(e))return;let{command:r,options:o,rest:t}=u(e);typeof o.home=="string"&&(process.env.OPENPOND_HOME=(await import("./chunks/dist-UA2RQUA4.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-ZG7XHCIV.js")).runCheckUpdate();return}if(n==="help"){(await import("./chunks/help-A3WX4THT.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-2GL42D4P.js")).runOpenPondTerminalCommand(o,t);return}if(n==="ui"){await(await import("./chunks/app-layer-2GL42D4P.js")).runOpenPondServerCommand("web",o,t);return}await d({command:r,options:o,rest:t})||((await import("./chunks/help-A3WX4THT.js")).printHelp(),process.exit(1))}i(v,"runOpenPondCli");async function C(e){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-24KZ44ZT.js"),import("./chunks/cli-5CB2IOBD.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-IBMTL45C.js"),import("./chunks/cli-5CB2IOBD.js")]),{createOpenPondAppServer:t}=await import("./chunks/app-server-runtime-24KZ44ZT.js");return await o({createOpenPondServer:r,createOpenPondAppServer:t}),!0}return e[0]==="__terminal"?(await(await import("./chunks/src-DCKMDSJG.js")).runOpenPondTerminalCli(e.slice(1)),!0):!1}i(C,"runEmbeddedCompanion");v().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 t=typeof e.exitCode=="number"?e.exitCode:1;process.exit(t)});export{v 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-Y7ZYJQGZ.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-I5K74TOH.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-BB6DJKXX.js";import"./chunks/chunk-73KFNV3D.js";import"./chunks/chunk-OGPHXXCD.js";import"./chunks/chunk-B6IIGPWS.js";import{$,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,X,Y,Z,_,a as o,aa as oo,b as p,ba as ro,c as t,ca as eo,d as x,da as fo,e as a,ea as mo,f as b,fa as po,g as c,ga as to,h as d,ha as xo,i as g,ia as go,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-SS3EG6S2.js";import{a as r,b as e,c as f,d as m}from"./chunks/chunk-GLUWATL5.js";import"./chunks/chunk-O4IARD7H.js";import{f as ao,g as bo,h as co}from"./chunks/chunk-J2S7BOZU.js";import"./chunks/chunk-UW6ES5DM.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-NNLI4OWY.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{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-Y7ZYJQGZ.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-I5K74TOH.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-BB6DJKXX.js";import"./chunks/chunk-73KFNV3D.js";import"./chunks/chunk-OGPHXXCD.js";import"./chunks/chunk-4LSZK4MF.js";import{$,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,X,Y,Z,_,a as o,aa as oo,b as p,ba as ro,c as t,ca as eo,d as x,da as fo,e as a,ea as mo,f as b,fa as po,g as c,ga as to,h as d,ha as xo,i as g,ia as go,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-SS3EG6S2.js";import{a as r,b as e,c as f,d as m}from"./chunks/chunk-GLUWATL5.js";import"./chunks/chunk-R33VLNFY.js";import{f as ao,g as bo,h as co}from"./chunks/chunk-J2S7BOZU.js";import"./chunks/chunk-I4FOBNHQ.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-NNLI4OWY.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};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "openpond",
3
- "version": "0.2.11",
3
+ "version": "0.2.12",
4
4
  "openpondReleaseVersioned": true,
5
5
  "license": "MIT",
6
6
  "description": "OpenPond CLI and local harness",
@@ -1,2 +0,0 @@
1
- import { createRequire as __openpondCreateRequire } from "node:module"; var require = __openpondCreateRequire(import.meta.url);
2
- import{Wc as c,Xc as d}from"./chunk-ENCAWWFY.js";import"./chunk-RPS53CGT.js";import{j as a,t as b}from"./chunk-5NGYLR3V.js";import"./chunk-J2MP4LSF.js";import"./chunk-3DJF6IZ7.js";import"./chunk-WW5SGVGJ.js";import"./chunk-XEOEKFG6.js";import"./chunk-GA7VBKCH.js";import"./chunk-6MI4KKWF.js";import"./chunk-SDO4FC4Q.js";import"./chunk-IR3YJWPW.js";import"./chunk-O4IARD7H.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 AGENT_PROTOCOL_VERSION,c as APP_SERVER_COMPOSITION,d as createOpenPondAppServer,b as runAppServerJsonl};
@@ -1,5 +0,0 @@
1
- import { createRequire as __openpondCreateRequire } from "node:module"; var require = __openpondCreateRequire(import.meta.url);
2
- import{c as j,e as R,f as z,g as H,i as N,kb as O}from"./chunk-NNLI4OWY.js";import{b as a}from"./chunk-ES2ISFJC.js";import{a as y,c as P,f as C,h as d}from"./chunk-H7IWJN7L.js";import{a as i}from"./chunk-FTQLQJQV.js";import b from"node:path";import{AsyncLocalStorage as V}from"node:async_hooks";import{promises as M}from"node:fs";var B=new V;function me(e,t=!1){let r=B.getStore();r&&(t&&(r.length=0),r.push(e))}i(me,"onStartupFailure");async function pe(e,t){await O(e);let r;try{r=await H(b.join(d(e).runtime,"server-owner"),100)}catch(s){if(s instanceof P&&s.issue.code==="STORAGE_BUSY"){let o=await N(b.join(d(e).runtime,"endpoint.json"),()=>null);throw new P({code:"RUNTIME_ALREADY_RUNNING",path:e,message:"An OpenPond runtime already owns this home.",action:o?.url?`Connect to the existing runtime at ${o.url}, or stop it before starting another.`:"Stop the existing runtime before starting another with this home."})}throw s}let n=[];try{let s=await y(e,()=>B.run(n,t)),o=s.close.bind(s);n.length=0;let c;return{...s,close:i(()=>c??=(async()=>{try{await y(e,o)}finally{await M.rm(b.join(d(e).runtime,"endpoint.json"),{force:!0}),await r()}})(),"close")}}catch(s){try{for(let o of n.reverse())await Promise.resolve().then(()=>y(e,o)).catch(()=>{});await M.rm(b.join(d(e).runtime,"endpoint.json"),{force:!0})}finally{await r()}throw s}}i(pe,"ownHomeRuntime");async function fe(e,t,r){await R(b.join(d(e).runtime,"endpoint.json"),JSON.stringify({schemaVersion:"openpond.runtimeEndpoint.v1",pid:process.pid,url:t,serverId:r}))}i(fe,"publishRuntimeEndpoint");function ge(e){if(!e.maxContextTokens||!e.usableContextTokens)return{shouldCompact:!1,projectedTokens:e.projectedTokens,thresholdTokens:Number.MAX_SAFE_INTEGER,usableContextTokens:0,maxContextTokens:0,tokenSource:"heuristic"};let t=Math.max(.01,Math.min(1,(e.triggerPercent??85)/100)),r=Math.max(1,Math.floor(e.usableContextTokens*t));return{shouldCompact:e.projectedTokens>=r,projectedTokens:e.projectedTokens,thresholdTokens:r,usableContextTokens:e.usableContextTokens,maxContextTokens:e.maxContextTokens,tokenSource:"heuristic"}}i(ge,"agentCompactionDecision");async function be(e){await e.started();try{return await e.compact()}catch(t){throw await e.failed(t),t}}i(be,"runAgentCompaction");async function ke(e){let t=e.host.projectEvents(e.events),r=e.host.selectEvents(t,e.maxContextTokens),{summaryEvents:n,preservedEvents:s,preservedEventIds:o}=r;if(n.length===0)throw new Error("There is not enough prior context to compact.");let c=e.host.normalizeRecords(n),u=e.host.normalizeRecords(s),h=e.host.buildFileLedger(e.host.normalizeRecords(t)),l=e.host.serializeRecords(c,e.host.inputCharBudget(e.maxContextTokens));if(!l.text.trim())throw new Error("There is not enough prior context to compact.");let m=e.host.buildSummaryMessages({serializedHistory:l.text,fileLedger:h}),v=Date.now(),w=(await e.host.streamSummary({model:e.model,messages:m,signal:e.signal})).trim(),x=Date.now()-v;if(!w)throw new Error("Compaction summary was empty.");let I=e.host.estimateProjection({events:t,preservedEvents:s,summary:w}),_=e.host.createMetrics({sourceEvents:t.length,summarizedEvents:n.length,preservedEvents:s.length,sourceRecords:l.sourceRecordCount,includedRecords:l.includedRecordCount,omittedRecords:l.omittedRecordCount,preservedRecords:u.length,truncatedRecords:l.truncatedRecordCount,summaryInputTruncated:l.inputTruncated,sourceSelectionStrategy:l.selectionStrategy,summaryInputChars:l.inputChars,retainedTailTokens:r.retainedTailTokens,retainedTailBudgetTokens:r.retainedTailBudgetTokens,finalProviderContextTokens:I.inputTokensAfter,durationMs:x,fileLedgerEntries:h.length,splitTurnId:r.splitTurnId});return{summary:w,model:e.model,compactedThroughEventId:t[t.length-1]?.id??null,compactedThroughTurnId:e.host.lastTurnId(t),preservedFromEventId:s[0]?.id??null,preservedEventIds:o,preservedResourceRefs:e.host.durableResourceRefs(e.events),sourceEventCount:n.length,preservedEventCount:s.length,fileLedger:h,inputTokensBefore:I.inputTokensBefore,inputTokensAfter:I.inputTokensAfter,maxContextTokens:e.maxContextTokens,tokenSource:"heuristic",metrics:_}}i(ke,"runAgentCompactionProgram");var E="2026-09-20",Ee=["initialize","initialized","runtime/capabilities","thread/start","thread/resume","thread/read","turn/start","turn/steer","task/inbox","task/queue","task/inputUpdate","turn/interrupt","approval/resolve","userInput/resolve","profile/workflows","profile/evaluations","harness/inspect","harness/proposalReview","harness/review","harness/acceptEvaluationReview","harness/materializeEvaluationTaskset","harness/runEvaluationBaseline","harness/validate","harness/backgroundReview","harness/diff","harness/rollback","refiner/inspect","refiner/update","refiner/activate","refiner/rollback"],U=a.object({jsonrpc:a.literal("2.0"),id:a.union([a.string(),a.number()]),method:a.string().trim().min(1),params:a.unknown().optional()}).strict(),$=a.object({jsonrpc:a.literal("2.0"),method:a.string().trim().min(1),params:a.unknown().optional()}).strict(),G=a.object({jsonrpc:a.literal("2.0"),id:a.union([a.string(),a.number()]),result:a.unknown()}).strict(),W=a.object({jsonrpc:a.literal("2.0"),id:a.union([a.string(),a.number(),a.null()]),error:a.object({code:a.number().int(),message:a.string(),data:a.unknown().optional()}).strict()}).strict(),Te=a.union([U,$,G,W]),K=a.object({protocolVersion:a.string().trim().min(1),client:a.object({name:a.string().trim().min(1),version:a.string().trim().min(1)}).strict(),capabilities:a.record(a.string(),a.unknown()).default({})}).strict(),T=class{static{i(this,"AgentJsonRpcDispatcher")}#e;#n=null;#t=!1;constructor(t){this.#e=t}get initialized(){return this.#t}async handle(t){let r=$.safeParse(t);if(r.success&&!("id"in t)){if(r.data.method==="initialized"){if(!this.#n)throw new p(-32002,"initialize must be called first");this.#t=!0}return null}let n=U.safeParse(t);if(!n.success)return q(null,-32600,"Invalid Request",n.error.flatten());let s=n.data;try{let o=await this.#r(s.method,s.params);return{jsonrpc:"2.0",id:s.id,result:o}}catch(o){let c=o instanceof p?o:new p(-32603,o instanceof Error?o.message:String(o));return q(s.id,c.code,c.message,c.data)}}async#r(t,r){if(t==="initialize"){let n=K.parse(r);if(n.protocolVersion!==E)throw new p(-32001,"Incompatible agent protocol version",{requested:n.protocolVersion,supported:E});return this.#n=n,{protocolVersion:E,server:{name:"openpond-app-server",version:"1"},capabilities:await this.#e.capabilities()}}if(!this.#t)throw new p(-32002,"initialized notification is required");switch(t){case"runtime/capabilities":return this.#e.capabilities(r);case"thread/start":return this.#e.threadStart(r);case"thread/resume":return this.#e.threadResume(r);case"thread/read":return this.#e.threadRead(r);case"turn/start":return this.#e.turnStart(r);case"turn/steer":return this.#e.turnSteer(r);case"task/inbox":return this.#e.taskInbox(r);case"task/queue":return this.#e.taskQueue(r);case"task/inputUpdate":return this.#e.taskInputUpdate(r);case"turn/interrupt":return this.#e.turnInterrupt(r);case"approval/resolve":return this.#e.approvalResolve(r);case"userInput/resolve":return this.#e.userInputResolve(r);case"profile/workflows":return this.#e.profileWorkflows(r);case"profile/evaluations":return this.#e.profileEvaluations(r);case"harness/inspect":return this.#e.harnessInspect(r);case"harness/proposalReview":return this.#e.harnessProposalReview(r);case"harness/review":return this.#e.harnessReview(r);case"harness/acceptEvaluationReview":return this.#e.harnessAcceptEvaluationReview(r);case"harness/materializeEvaluationTaskset":return this.#e.harnessMaterializeEvaluationTaskset(r);case"harness/runEvaluationBaseline":return this.#e.harnessRunEvaluationBaseline(r);case"harness/validate":return this.#e.harnessValidate(r);case"harness/backgroundReview":return this.#e.harnessBackgroundReview(r);case"harness/diff":return this.#e.harnessDiff(r);case"harness/rollback":return this.#e.harnessRollback(r);case"refiner/inspect":return this.#e.refinerInspect(r);case"refiner/update":return this.#e.refinerUpdate(r);case"refiner/activate":return this.#e.refinerActivate(r);case"refiner/rollback":return this.#e.refinerRollback(r);default:throw new p(-32601,`Method not found: ${t}`)}}},p=class extends Error{static{i(this,"JsonRpcDispatchError")}code;data;constructor(t,r,n){super(r),this.code=t,this.data=n}};function q(e,t,r,n){return{jsonrpc:"2.0",id:e,error:{code:t,message:r,...n===void 0?{}:{data:n}}}}i(q,"jsonRpcError");import{createHash as Q}from"node:crypto";function A(e){if(e===null||typeof e=="boolean"||typeof e=="string")return e;if(typeof e=="number"){if(!Number.isFinite(e))throw new Error("Canonical JSON cannot encode a non-finite number.");return e}if(Array.isArray(e))return e.map(A);if(typeof e=="object"){let t={};for(let r of Object.keys(e).sort()){let n=e[r];n!==void 0&&(t[r]=A(n))}return t}throw new Error(`Canonical JSON cannot encode ${typeof e}.`)}i(A,"canonicalJson");function g(e){return Q("sha256").update(JSON.stringify(A(e)),"utf8").digest("hex")}i(g,"canonicalHash");var Y=a.enum(["thread.started","thread.resumed","turn.started","turn.steered","turn.interrupted","turn.completed","turn.failed","item.started","item.delta","item.completed","assistant.reasoning.delta","assistant.delta","tool.started","tool.completed","approval.requested","approval.resolved","user_input.requested","user_input.resolved","compaction.started","compaction.completed","harness.admitted","harness.refiner.queued","harness.refiner.started","harness.refiner.completed","harness.refiner.failed","diagnostic"]),X=a.object({sequence:a.number().int().nonnegative(),name:Y,source:a.enum(["runtime","provider","tool","host","refiner"]),status:a.string().trim().min(1).nullable().default(null),threadId:a.string().trim().min(1),turnId:a.string().trim().min(1).nullable().default(null),callId:a.string().trim().min(1).nullable().default(null),output:a.string().nullable().default(null),error:a.string().nullable().default(null),data:a.record(a.string(),a.unknown()).default({})}).strict();function He(e){return g(X.parse(e))}i(He,"canonicalEventHash");import{once as Z}from"node:events";import{createInterface as ee}from"node:readline";async function D(e){let t=new T(e.host),r=Promise.resolve(),n=[],s=i(l=>(r=r.then(async()=>{e.writable.write(`${JSON.stringify(l)}
3
- `)||await Z(e.writable,"drain")}),r),"write"),o=i(()=>{if(!(!t.initialized||n.length===0))for(let l of n.splice(0))s(l)},"flushPendingNotifications"),c=e.host.subscribe?.(l=>{if(!t.initialized){n.push(l);return}s(l)}),u=new Set,h=ee({input:e.readable,crlfDelay:1/0});try{for await(let l of h){if(!l.trim())continue;let m;try{m=JSON.parse(l)}catch{await s({jsonrpc:"2.0",id:null,error:{code:-32700,message:"Parse error"}});continue}let v=(async()=>{let x=await t.handle(m);x&&await s(x),o()})(),w=m&&typeof m=="object"&&"method"in m?m.method:null;if(w==="initialize"||w==="initialized"){await v;continue}u.add(v),v.finally(()=>u.delete(v))}await Promise.all(u),await r}finally{c?.()}}i(D,"runAgentJsonlServer");var S=a.object({threadId:a.string().trim().min(1)}).passthrough(),te=a.object({session:a.unknown()}).strict(),k=S.extend({input:a.unknown()}),ne=k.extend({idempotencyKey:a.string().trim().min(1).max(200)}),re=k.extend({inputId:a.string().trim().min(1)}),ae=S.extend({reason:a.string().trim().min(1).optional()}),se=a.object({approvalId:a.string().trim().min(1),input:a.unknown()}).strict();function L(e){let t=i(async(n,s,o)=>{let c=performance.now();e.telemetry?.({method:n,phase:"started",threadId:s,durationMs:null,errorClass:null});try{let u=await o();return e.telemetry?.({method:n,phase:"completed",threadId:s,durationMs:performance.now()-c,errorClass:null}),u}catch(u){throw e.telemetry?.({method:n,phase:"failed",threadId:s,durationMs:performance.now()-c,errorClass:u instanceof Error?u.name:"UnknownError"}),u}},"run"),r=i(async(n,s="thread/read")=>{let{threadId:o}=S.parse(n);return t(s,o,async()=>{let[c,u,h]=await Promise.all([e.readThread(o),e.listTurns(o),e.listEvents(o)]);return{thread:c,turns:u,events:h}})},"threadRead");return{capabilities:i(n=>t("runtime/capabilities",null,()=>e.capabilities(n)),"capabilities"),threadStart:i(async n=>t("thread/start",null,async()=>({thread:await e.createThread(te.parse(n).session)})),"threadStart"),threadResume:i(n=>r(n,"thread/resume"),"threadResume"),threadRead:r,turnStart:i(async n=>{let s=k.parse(n);return t("turn/start",s.threadId,async()=>({turn:await e.startTurn(s.threadId,s.input)}))},"turnStart"),turnSteer:i(async n=>{let s=k.parse(n);return t("turn/steer",s.threadId,async()=>({receipt:await e.steerTurn(s.threadId,s.input)}))},"turnSteer"),taskInbox:i(async n=>{let{threadId:s}=S.parse(n);return t("task/inbox",s,()=>e.readTaskInbox(s))},"taskInbox"),taskQueue:i(async n=>{let s=ne.parse(n);return t("task/queue",s.threadId,()=>e.queueTaskInput(s.threadId,s.input,s.idempotencyKey))},"taskQueue"),taskInputUpdate:i(async n=>{let s=re.parse(n);return t("task/inputUpdate",s.threadId,()=>e.updateTaskInput(s.threadId,s.inputId,s.input))},"taskInputUpdate"),turnInterrupt:i(async n=>{let s=ae.parse(n);return t("turn/interrupt",s.threadId,async()=>({turn:await e.interruptTurn(s.threadId,s.reason)}))},"turnInterrupt"),approvalResolve:i(async n=>{let s=se.parse(n);return t("approval/resolve",null,async()=>({approval:await e.resolveApproval(s.approvalId,s.input)}))},"approvalResolve"),userInputResolve:i(async n=>{let s=k.parse(n);return t("userInput/resolve",s.threadId,async()=>(e.isTurnActive(s.threadId)&&await e.waitForTurnSettlement(s.threadId),{turn:await e.startTurn(s.threadId,s.input)}))},"userInputResolve"),profileWorkflows:i(()=>t("profile/workflows",null,()=>e.listProfileWorkflows()),"profileWorkflows"),profileEvaluations:i(()=>t("profile/evaluations",null,()=>e.listProfileEvaluations()),"profileEvaluations"),harnessInspect:i(()=>t("harness/inspect",null,()=>e.inspectHarness()),"harnessInspect"),harnessProposalReview:i(n=>t("harness/proposalReview",null,()=>e.reviewHarnessProposal(n)),"harnessProposalReview"),harnessReview:i(n=>t("harness/review",null,()=>e.reviewHarness(n)),"harnessReview"),harnessAcceptEvaluationReview:i(n=>t("harness/acceptEvaluationReview",null,()=>e.acceptHarnessEvaluationReview(n)),"harnessAcceptEvaluationReview"),harnessMaterializeEvaluationTaskset:i(n=>t("harness/materializeEvaluationTaskset",null,()=>e.materializeHarnessEvaluationTaskset(n)),"harnessMaterializeEvaluationTaskset"),harnessRunEvaluationBaseline:i(n=>t("harness/runEvaluationBaseline",null,()=>e.runHarnessEvaluationBaseline(n)),"harnessRunEvaluationBaseline"),harnessValidate:i(()=>t("harness/validate",null,()=>e.validateHarness()),"harnessValidate"),harnessBackgroundReview:i(n=>t("harness/backgroundReview",null,()=>e.updateHarnessBackgroundReview(n)),"harnessBackgroundReview"),harnessDiff:i(n=>t("harness/diff",null,()=>e.diffHarness(n)),"harnessDiff"),harnessRollback:i(n=>t("harness/rollback",null,()=>e.rollbackHarness(n)),"harnessRollback"),refinerInspect:i(()=>t("refiner/inspect",null,()=>e.inspectRefiner()),"refinerInspect"),refinerUpdate:i(n=>t("refiner/update",null,()=>e.updateRefiner(n)),"refinerUpdate"),refinerActivate:i(n=>t("refiner/activate",null,()=>e.activateRefiner(n)),"refinerActivate"),refinerRollback:i(n=>t("refiner/rollback",null,()=>e.rollbackRefiner(n)),"refinerRollback"),subscribe:e.subscribeEvents&&e.eventNotification?n=>e.subscribeEvents(s=>n(e.eventNotification(s))):void 0}}i(L,"createAgentRuntimeService");var f=a.string().regex(/^[a-f0-9]{64}$/),et=a.object({harnessReleaseHash:f,instructionsHash:f,skillHashes:a.record(a.string(),f),agentAssetHashes:a.record(a.string(),f),toolCatalogHash:f,memoryRevision:a.number().int().nonnegative().nullable()}).strict(),ie=a.object({protocolVersion:a.string().trim().min(1),threadId:a.string().trim().min(1),turnId:a.string().trim().min(1),harnessReleaseHash:f,toolCatalogHash:f,context:a.record(a.string(),a.unknown()),pendingInteraction:a.record(a.string(),a.unknown()).nullable(),usage:a.record(a.string(),a.unknown())}).strict();function tt(e){return g(ie.parse(e))}i(tt,"checkpointHash");function nt(e){return[e.system,...e.harnessInstructions,...e.skillInstructions,...e.hostInstructions??[]].map(t=>t.trim()).filter(Boolean).join(`
4
-
5
- `)}i(nt,"materializeAgentPrompt");function it(e){let t=new Set,r=[...e].map(o=>{let c=o.name.trim();if(!c)throw new Error("Agent tool names cannot be empty.");if(t.has(c))throw new Error(`Duplicate agent tool: ${c}.`);if(t.add(c),!o.unavailableReason&&!o.executorAvailable)throw new Error(`Agent tool ${c} is declared as available without an executor.`);return{...o,name:c}}).sort((o,c)=>o.name.localeCompare(c.name)),n=r.filter(o=>!o.unavailableReason).map(o=>({name:o.name,description:o.description,inputSchema:o.inputSchema})),s=r.map(o=>({name:o.name,displayLabel:o.displayLabel??o.name,placement:o.placement,available:!o.unavailableReason,unavailableReason:o.unavailableReason??null}));return{byName:new Map(r.map(o=>[o.name,o])),tools:r,modelTools:n,capabilities:s,hash:g({modelTools:n,capabilities:s})}}i(it,"createAgentToolCatalogProjection");async function ot(e,t){let r=e.byName.get(t.name);if(!r)throw new Error(`Unknown agent tool: ${t.name}.`);if(r.unavailableReason)throw new Error(`Agent tool ${t.name} is unavailable: ${r.unavailableReason}`);if(!r.execute)throw new Error(`Agent tool ${t.name} has no executor.`);let n=r.validateArguments?r.validateArguments(t.arguments):t.arguments;return r.execute(n,t.context)}i(ot,"executeProjectedAgentTool");var F=class{static{i(this,"TaskSignals")}#e=new Map;notify(t){for(let r of[...this.#e.get(t)??[]])r()}subscribe(t,r){let n=this.#e.get(t);return n||this.#e.set(t,n=new Set),n.add(r),()=>{n.delete(r),n.size===0&&this.#e.delete(t)}}async wait(t){let r=i(()=>{},"wake"),n=0,s=i(()=>{n+=1,r()},"changed"),o=[...new Set(t.taskIds)].map(u=>this.subscribe(u,s)),c=setTimeout(s,Math.max(0,t.deadline-Date.now()));t.signal.addEventListener("abort",s);try{for(;;){t.signal.throwIfAborted();let u=n,h=await t.read();if(h!==null)return h;if(Date.now()>=t.deadline)return null;n===u&&await new Promise(l=>{r=l,(n!==u||t.signal.aborted)&&l()})}}finally{clearTimeout(c),t.signal.removeEventListener("abort",s);for(let u of o)u()}}},J=class{static{i(this,"TaskSerialExecutor")}#e=new Map;async run(t,r){let s=(this.#e.get(t)??Promise.resolve()).then(r),o=s.then(()=>{},()=>{});this.#e.set(t,o);try{return await s}finally{this.#e.get(t)===o&&this.#e.delete(t)}}};function Tt(e){return oe({runtime:L(e.ports),close:e.close})}i(Tt,"createAppServer");function oe(e){let t=!1;return{runtime:e.runtime,close:i(async()=>{t||(t=!0,await e.close?.())},"close")}}i(oe,"attachAppServer");async function St(e){try{await D({host:e.appServer.runtime,readable:e.readable,writable:e.writable})}finally{await e.appServer.close()}}i(St,"runAppServerJsonl");import{randomBytes as ce}from"node:crypto";function jt(){return C()}i(jt,"appDataDir");function zt(e){return d(e).config}i(zt,"providersConfigPath");function Ht(e){return d(e).credentials}i(Ht,"providerSecretsConfigPath");function Nt(e){return d(e).key}i(Nt,"providerSecretsKeyPath");async function Ot(e){let t=d(e).token;return z(t,async()=>{let r=(await j(t))?.trim(),n=process.env.OPENPOND_APP_TOKEN||r||ce(32).toString("base64url");return n!==r&&await R(t,n),{token:n,tokenFile:t}})}i(Ot,"ensureCapabilityToken");export{me as a,pe as b,fe as c,g as d,ge as e,be as f,ke as g,X as h,He as i,E as j,Ee as k,ie as l,tt as m,nt as n,it as o,ot as p,F as q,J as r,Tt as s,St as t,jt as u,zt as v,Ht as w,Nt as x,Ot as y};