openpond 0.2.38 → 0.2.40
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.
- package/dist/app-server.js +1 -1
- package/dist/chunks/{actions-command-MHWHPQ66.js → actions-command-X2ERGYMA.js} +1 -1
- package/dist/chunks/{app-layer-JZTMHORT.js → app-layer-W2M7SM2L.js} +1 -1
- package/dist/chunks/app-server-runtime-IO3FDF37.js +2 -0
- package/dist/chunks/{apps-U5GIOD6W.js → apps-IBVU56HR.js} +1 -1
- package/dist/chunks/{chunk-MRGA6BKG.js → chunk-3QXPXBVG.js} +1 -1
- package/dist/chunks/{chunk-FKVP26MC.js → chunk-3UQU3KOS.js} +1 -1
- package/dist/chunks/{chunk-XHJUP7M4.js → chunk-4QURHV3Q.js} +1 -1
- package/dist/chunks/{chunk-KNEMKYHY.js → chunk-5OA57RW4.js} +1 -1
- package/dist/chunks/{chunk-GKRTXVNT.js → chunk-62H5KUOS.js} +1 -1
- package/dist/chunks/{chunk-GIPSOLAY.js → chunk-ALYT2HWV.js} +1 -1
- package/dist/chunks/{chunk-25OT6IYM.js → chunk-ASRSYRE3.js} +1 -1
- package/dist/chunks/{chunk-SHCRE7B2.js → chunk-CYZOPDTW.js} +1 -1
- package/dist/chunks/{chunk-GOHJHZVA.js → chunk-DWY6YCBI.js} +198 -198
- package/dist/chunks/{chunk-WCZRDULE.js → chunk-ELUCM7CG.js} +1 -1
- package/dist/chunks/{chunk-OCWH4BV7.js → chunk-FFTVDR3E.js} +1 -1
- package/dist/chunks/chunk-GTG2ODOV.js +5 -0
- package/dist/chunks/{chunk-V5BC6QT2.js → chunk-H7YH35JO.js} +1 -1
- package/dist/chunks/chunk-IYWNO4RB.js +3 -0
- package/dist/chunks/{chunk-IKM6ICPY.js → chunk-JARGGWF5.js} +1 -1
- package/dist/chunks/{chunk-SBBXUZWL.js → chunk-JIG7KQOX.js} +1 -1
- package/dist/chunks/{chunk-Q3X5WOVH.js → chunk-QCLVO56H.js} +1 -1
- package/dist/chunks/{chunk-JUX77H6K.js → chunk-TU5ITNMX.js} +1 -1
- package/dist/chunks/{chunk-ZPGTGQJT.js → chunk-WWCU4ETR.js} +1 -1
- package/dist/chunks/{chunk-ZCDOE3EO.js → chunk-XRI3HLZ3.js} +1 -1
- package/dist/chunks/{chunk-7BGT6Q2D.js → chunk-YHBIGFFA.js} +1 -1
- package/dist/chunks/{chunk-RELOOVWW.js → chunk-ZCPIVNCS.js} +1 -1
- package/dist/chunks/cli-QXO6OHZJ.js +2 -0
- package/dist/chunks/{configuration-command-RPNYWBKK.js → configuration-command-6VJUXQNZ.js} +1 -1
- package/dist/chunks/{core-commands-WFTASSGL.js → core-commands-J6OY62PE.js} +1 -1
- package/dist/chunks/{datasets-V7E4I5N3.js → datasets-W24QTQL7.js} +1 -1
- package/dist/chunks/{desktop-test-NZAZVXLK.js → desktop-test-SHS2VUYP.js} +1 -1
- package/dist/chunks/experiments-O7WTSICN.js +2 -0
- package/dist/chunks/{extension-OQ7CFD4Q.js → extension-3P3JNRYN.js} +1 -1
- package/dist/chunks/{help-4BB2A5JC.js → help-23QDOMG7.js} +1 -1
- package/dist/chunks/{hosted-harness-runtime-6TE37GBH.js → hosted-harness-runtime-U7JV7Z5T.js} +1 -1
- package/dist/chunks/{hosted-profile-compiler-7ZWCIHPA.js → hosted-profile-compiler-ZCVMUTFA.js} +1 -1
- package/dist/chunks/{opchat-QVB4UIZR.js → opchat-OI2YFNNY.js} +1 -1
- package/dist/chunks/{organizations-MUKXB6MX.js → organizations-LB5QXKWT.js} +1 -1
- package/dist/chunks/{profile-LZYR4CMX.js → profile-NJMKPS6Z.js} +1 -1
- package/dist/chunks/{project-agent-FHNWIH2D.js → project-agent-SZLUVG3U.js} +1 -1
- package/dist/chunks/{sandbox-command-GJN3HSJQ.js → sandbox-command-FQBOFZGM.js} +1 -1
- package/dist/chunks/{sandbox-template-6RLQYNTY.js → sandbox-template-RCDR2FXX.js} +1 -1
- package/dist/chunks/{src-PASASTIA.js → src-H7VE4J62.js} +1 -1
- package/dist/chunks/{src-2NVS6PNZ.js → src-JVSP6UKT.js} +107 -107
- package/dist/chunks/{teams-bot-UQB636V3.js → teams-bot-KCKZTM3N.js} +1 -1
- package/dist/chunks/{workspaces-2KYAFRX4.js → workspaces-J5QQUR53.js} +1 -1
- package/dist/cli.js +1 -1
- package/dist/index.js +1 -1
- package/docs/command-reference.md +1 -1
- package/package.json +1 -1
- package/dist/chunks/app-server-runtime-PDT6BJD2.js +0 -2
- package/dist/chunks/chunk-P5CFBE6Z.js +0 -3
- package/dist/chunks/chunk-TZNKOKQJ.js +0 -5
- package/dist/chunks/cli-OP4EDGZN.js +0 -2
- package/dist/chunks/experiments-7UBJCQAQ.js +0 -2
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { createRequire as __openpondCreateRequire } from "node:module"; var require = __openpondCreateRequire(import.meta.url);
|
|
2
|
-
import{m as f}from"./chunk-FUFIZ37W.js";import"./chunk-3HQEEZPO.js";import"./chunk-BSHAIAXY.js";import"./chunk-
|
|
2
|
+
import{m as f}from"./chunk-FUFIZ37W.js";import"./chunk-3HQEEZPO.js";import"./chunk-BSHAIAXY.js";import"./chunk-3UQU3KOS.js";import"./chunk-IYWNO4RB.js";import"./chunk-XWPC3AN4.js";import{a as g,c as a,d}from"./chunk-3M53YXEI.js";import"./chunk-OGPHXXCD.js";import"./chunk-GTG2ODOV.js";import"./chunk-SHCKK3SU.js";import"./chunk-AOBTILU5.js";import"./chunk-GLUWATL5.js";import"./chunk-ZCPIVNCS.js";import"./chunk-ALYT2HWV.js";import"./chunk-MJC26GOX.js";import"./chunk-TU5ITNMX.js";import"./chunk-QUNRWDVO.js";import"./chunk-QK2GLRCY.js";import"./chunk-HZP5U2AA.js";import"./chunk-ES2ISFJC.js";import"./chunk-H7IWJN7L.js";import{a as s}from"./chunk-FTQLQJQV.js";function c(){return["usage: teams-bot <overview|bind|rebind|diagnostics|diagnostic-run>"," teams-bot overview --team-id <id>"," teams-bot bind --team-id <id> --token <token> [--project-id <id>] [--agent-id <id>] [--microsoft-connection-id <id>]"," teams-bot rebind <bindingId> --team-id <id> [--project-id <id>] [--agent-id <id>] [--microsoft-connection-id <id>]"," teams-bot diagnostics <bindingId> --team-id <id>"," teams-bot diagnostic-run <bindingId> --team-id <id> --prompt <text> [--attachments-json <json-array>] [--action-input-json <json-object>]"].join(`
|
|
3
3
|
`)}s(c,"usage");function u(n,o){if(!(o in n))return;let t=a(n,o);return!t||t==="null"||t==="none"?null:t}s(u,"nullableOption");function b(n){let o=d(n,"usage: teams-bot rebind <bindingId>"),t=u(n,"sandboxId"),r=u(n,"projectId"),i=u(n,"agentId"),e=u(n,"microsoftConnectionId");return{teamId:o,...t!==void 0?{sandboxId:t}:{},...r!==void 0?{projectId:r}:{},...i!==void 0?{agentId:i}:{},...e!==void 0?{microsoftConnectionId:e}:{}}}s(b,"bindingTargetInput");function l(n){let o=a(n,"attachmentsJson");if(!o)return;let t=g(o,"attachments-json");if(!Array.isArray(t))throw new Error("attachments-json must be a JSON array");for(let r of t)if(!r||typeof r!="object"||Array.isArray(r))throw new Error("attachments-json entries must be JSON objects");return t}s(l,"attachmentsInput");function w(n){let o=a(n,"actionInputJson");if(!o)return;let t=g(o,"action-input-json");if(!t||typeof t!="object"||Array.isArray(t))throw new Error("action-input-json must be a JSON object");return t}s(w,"actionInput");async function j(n,o){let t=o[0]||"overview",r=await f(n);if(t==="overview"){let i=d(n,"usage: teams-bot overview");console.log(JSON.stringify(await r.getMicrosoftTeamsBotOverview({teamId:i}),null,2));return}if(t==="bind"){let i=a(n,"token");if(!i)throw new Error(c());let e=await r.bindMicrosoftTeamsBotConversation({...b(n),token:i});console.log(JSON.stringify(e,null,2));return}if(t==="rebind"){let i=o[1]?.trim();if(!i)throw new Error(c());let e=await r.rebindMicrosoftTeamsBotConversation(i,b(n));console.log(JSON.stringify(e,null,2));return}if(t==="diagnostics"){let i=o[1]?.trim(),e=d(n,"usage: teams-bot diagnostics <bindingId>");if(!i)throw new Error(c());console.log(JSON.stringify(await r.sendMicrosoftTeamsBotDiagnostic({teamId:e,bindingId:i}),null,2));return}if(t==="diagnostic-run"){let i=o[1]?.trim(),e=d(n,"usage: teams-bot diagnostic-run <bindingId>"),m=a(n,"prompt");if(!i||!m)throw new Error(c());console.log(JSON.stringify(await r.sendMicrosoftTeamsBotDiagnosticRun({teamId:e,bindingId:i,prompt:m,attachments:l(n),actionInput:w(n)}),null,2));return}throw new Error(c())}s(j,"runTeamsBotCommand");export{j as runTeamsBotCommand};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { createRequire as __openpondCreateRequire } from "node:module"; var require = __openpondCreateRequire(import.meta.url);
|
|
2
|
-
import{A,B,C,D,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-
|
|
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-JARGGWF5.js";import"./chunk-H7YH35JO.js";import"./chunk-FTQLQJQV.js";export{a as MACOS_GIT_MISSING_DEVELOPER_TOOLS_ERROR,C as appWorkspacePaths,B as assertSafeBranchName,d as checkWorkspaceGitAvailability,J as checkoutBranch,K as checkoutBranchAtPath,M as clearWorkspaceDiffCacheForTests,D as cloneWorkspace,H as createAndCheckoutBranch,I as createAndCheckoutBranchAtPath,A as expectedRemoteUrl,t as isGeneratedWorkspacePath,i as isGitRepo,c as isMacOSGitDeveloperToolsMissing,u as isVisibleGitWorkspaceFile,r as isWorkspaceDirectory,E as lastFetchAt,z as listPlainWorkspaceFiles,P as loadGitCommitDiffAtPath,N as loadWorkspaceDiff,O as loadWorkspaceDiffAtPath,Q as loadWorkspaceFile,T as loadWorkspaceFileAtPath,R as loadWorkspaceImageFile,S as loadWorkspaceImageFileAtPath,F as loadWorkspaceState,G as loadWorkspaceStateAtPath,n as localVideoContentType,L as mapWorkspaceDiffEntriesWithConcurrency,s as normalizeWorkspaceFilePath,w as parseBranchStatusLine,x as parseNumstat,v as parseStatusLine,h as pathExists,p as readLocalImageFile,q as readLocalVideoFile,l as readWorkspaceDocumentPreview,k as readWorkspaceFile,o as readWorkspaceImageFile,g as redactRemoteUrl,b as runWorkspaceCommand,f as sourceFromRemote,e as startMacOSCommandLineToolsInstall,j as truncatePatch,y as uniqueSortedPaths,m as workspaceImageContentType};
|
package/dist/cli.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { createRequire as __openpondCreateRequire } from "node:module"; var require = __openpondCreateRequire(import.meta.url);
|
|
3
|
-
import{a as m,b as l}from"./chunks/chunk-BSHAIAXY.js";import{b as u}from"./chunks/chunk-
|
|
3
|
+
import{a as m,b as l}from"./chunks/chunk-BSHAIAXY.js";import{b as u}from"./chunks/chunk-3UQU3KOS.js";import{a as c,j as d}from"./chunks/chunk-IYWNO4RB.js";import"./chunks/chunk-XWPC3AN4.js";import{f as s}from"./chunks/chunk-3M53YXEI.js";import"./chunks/chunk-GLUWATL5.js";import{a as t}from"./chunks/chunk-FTQLQJQV.js";function f(e){return!e.command&&s(e.options.version)?"version":s(e.options.checkUpdate)?"check-update":!e.command&&s(e.options.help)?"help":!e.command&&s(e.options.tui)?"tui":e.command?"command":"ui"}t(f,"resolveCliTopLevelAction");async function C(e=process.argv.slice(2)){if(await v(e))return;let{command:r,options:o,rest:i}=u(e);typeof o.home=="string"&&(process.env.OPENPOND_HOME=(await import("./chunks/dist-4OUZANXR.js")).resolveOpenPondHome({home:o.home}));let n=f({command:r,options:o});if(n==="version"){console.log(c());return}if(n==="check-update"){await(await import("./chunks/core-commands-J6OY62PE.js")).runCheckUpdate();return}if(n==="help"){(await import("./chunks/help-23QDOMG7.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-W2M7SM2L.js")).runOpenPondTerminalCommand(o,i);return}if(n==="ui"){await(await import("./chunks/app-layer-W2M7SM2L.js")).runOpenPondServerCommand("web",o,i);return}await d({command:r,options:o,rest:i})||((await import("./chunks/help-23QDOMG7.js")).printHelp(),process.exit(1))}t(C,"runOpenPondCli");async function v(e){if(e[0]==="__compile-hosted-profile")return await(await import("./chunks/hosted-profile-compiler-ZCVMUTFA.js")).runHostedProfileCompilerCli(e.slice(1)),!0;if(e[0]==="__app-server"){process.argv=[process.execPath,"openpond-app-server",...e.slice(1)];let[{createOpenPondAppServer:r},{runOpenPondAppServerCli:o}]=await Promise.all([import("./chunks/app-server-runtime-IO3FDF37.js"),import("./chunks/cli-QXO6OHZJ.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-JVSP6UKT.js"),import("./chunks/cli-QXO6OHZJ.js")]),{createOpenPondAppServer:i}=await import("./chunks/app-server-runtime-IO3FDF37.js");return await o({createOpenPondServer:r,createOpenPondAppServer:i}),!0}return e[0]==="__terminal"?(await(await import("./chunks/src-H7VE4J62.js")).runOpenPondTerminalCli(e.slice(1)),!0):!1}t(v,"runEmbeddedCompanion");C().catch(e=>{let r=e instanceof Error?e.message:String(e),o=e.issue;if(process.argv.includes("--json")&&!(e instanceof Error&&e.name==="OpenPondChildProcessExitError"))console.log(JSON.stringify({error:o??{code:"CLI_ERROR",message:r}}));else if(o&&typeof o=="object"){let n=o;console.error(`${n.code}: ${n.message}
|
|
4
4
|
${n.path}
|
|
5
5
|
${n.action}`)}else console.error(r);let i=typeof e.exitCode=="number"?e.exitCode:1;process.exit(i)});export{C as runOpenPondCli};
|
package/dist/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { createRequire as __openpondCreateRequire } from "node:module"; var require = __openpondCreateRequire(import.meta.url);
|
|
2
|
-
import"./chunks/chunk-X37KMV27.js";import"./chunks/chunk-OGPHXXCD.js";import"./chunks/chunk-
|
|
2
|
+
import"./chunks/chunk-X37KMV27.js";import"./chunks/chunk-OGPHXXCD.js";import"./chunks/chunk-GTG2ODOV.js";import{a as Er,b as Fr,c as Gr,d as Hr,e as Ir,f as Jr,g as Kr,h as Lr,i as Mr,j as Nr,k as Or,l as Pr}from"./chunks/chunk-T7Y5OYO2.js";import{a as qr,b as sr,c as ur,d as vr,e as wr,f as yr,g as zr,h as Ar,i as Br,j as Cr,k as Dr}from"./chunks/chunk-JEVA7YQL.js";import{a as kr,b as lr,c as nr}from"./chunks/chunk-22UARBPW.js";import{A as Mo,B as No,C as Oo,D as Po,E as Qo,F as Ro,G as So,H as To,I as Uo,J as Vo,K as Wo,b as ho,c as io,d as jo,e as ko,f as lo,g as no,h as qo,i as so,j as uo,k as vo,l as wo,m as yo,n as zo,o as Ao,p as Bo,q as Co,r as Do,s as Eo,t as Fo,u as Go,v as Ho,w as Io,x as Jo,y as Ko,z as Lo}from"./chunks/chunk-562Q5UVS.js";import"./chunks/chunk-DDHUSA3I.js";import{$ as go,A as M,B as N,C as O,D as P,E as Q,F as R,G as S,H as T,I as U,J as V,K as W,L as X,M as Y,N as Z,O as _,P as $,Q as oo,U as ro,V as eo,W as fo,X as mo,Y as po,Z as to,_ as xo,a as h,b as i,c as j,d as k,e as l,f as n,g as q,h as s,i as u,j as v,k as w,l as y,n as z,o as A,p as B,q as C,r as D,s as E,t as F,u as G,v as H,w as I,x as J,y as K,z as L}from"./chunks/chunk-SHCKK3SU.js";import{a as o,b as r,c as e,d as f,e as m,f as p,g as t,h as x,i as a}from"./chunks/chunk-AOBTILU5.js";import{a as b,b as c,c as d,d as g}from"./chunks/chunk-GLUWATL5.js";import"./chunks/chunk-ZCPIVNCS.js";import"./chunks/chunk-ALYT2HWV.js";import{f as ao,g as bo,h as co}from"./chunks/chunk-MJC26GOX.js";import"./chunks/chunk-TU5ITNMX.js";import"./chunks/chunk-QUNRWDVO.js";import"./chunks/chunk-3A7HZJNE.js";import{a as Xo,b as Yo,c as Zo,d as _o,e as $o,f as or,g as rr,h as er,i as fr,j as mr,k as pr,l as tr,m as xr,n as ar,o as br,p as cr,q as dr,r as gr,s as hr,t as ir,u as jr}from"./chunks/chunk-EAPFMACH.js";import"./chunks/chunk-6FA3GG5B.js";import"./chunks/chunk-QK2GLRCY.js";import"./chunks/chunk-HZP5U2AA.js";import"./chunks/chunk-ES2ISFJC.js";import"./chunks/chunk-H7IWJN7L.js";import"./chunks/chunk-FTQLQJQV.js";export{fo as DEFAULT_CACHE_TTL_MS,yo as DEFAULT_LOCAL_PROFILE,c as DEFAULT_OPENPOND_API_BASE_URL,g as DEFAULT_OPENPOND_CHAT_API_BASE_URL,d as DEFAULT_OPENPOND_OPCHAT_API_BASE_URL,b as DEFAULT_OPENPOND_WEB_BASE_URL,zo as DEFAULT_PROFILE_AGENT,Zo as OPENPOND_MANIFEST_FILE_NAME,ho as OpenPondProfileSetupRequiredError,bo as OpenPondSandboxClient,wo as PROFILE_MANIFEST,vo as PROFILE_REPO_MANIFEST,go as SANDBOX_RUNTIME_PROFILE_IDS,_o as SANDBOX_TEMPLATE_BUILD_PLAN_FILE_NAME,$o as SANDBOX_TEMPLATE_BUILD_PLAN_KIND,Yo as SANDBOX_TEMPLATE_PREVIEW_PORT_MAX,Xo as SANDBOX_TEMPLATE_PREVIEW_PORT_MIN,or as SandboxTemplateManifestSchema,rr as SandboxTemplateValidationDiagnosticSchema,h as apiFetch,jo as assertOpenPondProfileActionReady,io as buildOpenPondProfileSetupGate,Z as checkOpenPondApiHealth,lo as collectProfileSourceUploadEntries,Uo as commitActiveProfileChanges,i as commitFiles,Nr as computeAtr,Lr as computeBollinger,Ir as computeEma,Hr as computeEmaSeries,Kr as computeMaCross,Jr as computeMacd,Mr as computePriceChange,Er as computeRsi,Gr as computeSma,Fr as computeSmaSeries,Or as consumeAgentCreateStream,lr as consumeStream,V as createAgentFromPrompt,Pr as createClient,z as createHeadlessApps,w as createLocalProject,co as createOpenPondSandboxClient,y as createRepo,Co as defaultLocalProfileRepoPath,tr as defineSandboxTemplate,Q as deleteOrArchiveSchedule,j as deployApp,C as deployLatestTemplate,Do as emptyProfileState,eo as executeHostedTool,oo as executeUserTool,F as fetchToolManifest,ko as formatOpenPondProfileSetupRequirement,pr as formatSandboxTemplateDiagnostics,nr as formatStreamItem,E as getAppEnvironment,U as getAppExecutionTimeline,X as getAppRuntimeSummary,mo as getCachedApps,to as getCachedTools,o as getConfigPath,u as getDeploymentDetail,n as getDeploymentLogs,q as getDeploymentStatus,s as getLatestDeploymentForApp,vr as getOpChatModel,zr as getOpChatProvider,Y as getOpenPondAccount,K as getOpenToolRecipe,L as getOpenToolRules,T as getScheduleExecutionLog,A as getTemplateStatus,W as getUserPerformance,qo as hostedPublishStatusFromPayload,uo as hostedRunStatusFromRunSummary,so as hostedRunSummaryFromPayload,no as hostedSourceCheckStatusFromPayload,Eo as initLocalProfileRepo,Io as installAgentPackageIntoActiveProfile,H as listAppSchedules,v as listApps,m as listConfiguredProfiles,S as listDeploymentScheduleExecutionLogs,wr as listHostedModels,Ar as listHostedProviders,ur as listOpChatModels,yr as listOpChatProviders,I as listOpenToolRecipes,R as listScheduleExecutionLogs,B as listTemplateBranches,G as listUserTools,f as loadConfig,e as loadGlobalConfig,Fo as loadLocalProfileRepo,Lo as loadOpenPondProfileLibrary,Jo as loadOpenPondProfileState,Mo as loadOpenPondProfileStateForRef,Po as loadOpenPondProfileStateFromSource,Bo as mergeActiveLocalProfileConfig,Ao as mergeProfileRepoManifestEntry,kr as normalizeDataFrames,ao as normalizeSandboxApiUrl,Ko as openPondProfileRef,mr as parseSandboxTemplateYaml,$ as postAgentDigest,Wo as prepareAgentSdkRuntimePackage,k as promotePreviewToProduction,Go as registerLocalProfileRepo,Oo as removeOpenPondProfile,Ho as renameActiveProfileAgent,Qo as requireActiveLocalProfile,sr as resolveHostedChatApiBaseUrl,qr as resolveOpChatApiBaseUrl,ro as resolveWorkerBaseUrl,So as runAgentSdkProjectCommand,_ as runAssistantMode,Dr as runOpChatSmoke,To as runProfileCheck,Ro as runProfileSdkCommand,P as runScheduleNow,gr as sandboxTemplateBuildMetadata,hr as sandboxTemplateBuildPlan,ar as sandboxTemplateDurableVolume,dr as sandboxTemplateExecutableEntries,cr as sandboxTemplateFileInput,jr as sandboxTemplateJsonSchema,br as sandboxTemplatePreviewPort,xr as sandboxTemplateResources,ir as sandboxTemplateScaffoldFiles,x as saveConfig,a as saveGlobalConfig,t as saveProfileApiKey,Vo as saveProfilePushStatus,J as searchOpenToolRecipes,No as selectOpenPondProfile,Br as sendHostedChatTurn,p as setActiveProfile,po as setCachedApps,xo as setCachedTools,l as startAppLifecycle,M as startAppSchedules,N as stopAppSchedules,O as stopCurrentAppSchedules,Cr as streamHostedChatTurn,D as updateAppEnvironment,r as updateGlobalConfig,fr as validateSandboxTemplateManifest,er as validateSandboxTemplateYaml};
|
|
@@ -26,7 +26,7 @@ Options:
|
|
|
26
26
|
|
|
27
27
|
```text
|
|
28
28
|
Usage:
|
|
29
|
-
openpond experiments <save|read|list|executions|start|status|cancel|retry|score|passes|pass|cancel-pass|pass-result|result|compare> [id] [candidate-id] --team <id> [--input-file <path>] [--operation-id <id>] [--json]
|
|
29
|
+
openpond experiments <prepare-harness|save|read|list|executions|start|status|cancel|retry|score|passes|pass|cancel-pass|pass-result|result|compare> [id] [candidate-id] --team <id> [--input-file <path>] [--operation-id <id>] [--json]
|
|
30
30
|
|
|
31
31
|
Options:
|
|
32
32
|
--after-id <string>
|
package/package.json
CHANGED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import { createRequire as __openpondCreateRequire } from "node:module"; var require = __openpondCreateRequire(import.meta.url);
|
|
2
|
-
import{Lc as c,Mc as d}from"./chunk-GOHJHZVA.js";import{e as b}from"./chunk-KNEMKYHY.js";import"./chunk-25OT6IYM.js";import"./chunk-GKRTXVNT.js";import"./chunk-OCWH4BV7.js";import{i as a}from"./chunk-PKBU37CH.js";import"./chunk-IKM6ICPY.js";import"./chunk-V5BC6QT2.js";import"./chunk-XHJUP7M4.js";import"./chunk-7BGT6Q2D.js";import"./chunk-SBBXUZWL.js";import"./chunk-L3KS6MOV.js";import"./chunk-SHCRE7B2.js";import"./chunk-XEOEKFG6.js";import"./chunk-MRGA6BKG.js";import"./chunk-6MI4KKWF.js";import"./chunk-WCZRDULE.js";import"./chunk-RELOOVWW.js";import"./chunk-GIPSOLAY.js";import"./chunk-MJC26GOX.js";import"./chunk-JUX77H6K.js";import"./chunk-QUNRWDVO.js";import"./chunk-6FA3GG5B.js";import"./chunk-SDO4FC4Q.js";import"./chunk-IR3YJWPW.js";import"./chunk-QK2GLRCY.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,3 +0,0 @@
|
|
|
1
|
-
import { createRequire as __openpondCreateRequire } from "node:module"; var require = __openpondCreateRequire(import.meta.url);
|
|
2
|
-
import{f as S}from"./chunk-3M53YXEI.js";import{a as o}from"./chunk-FTQLQJQV.js";import{readFileSync as j}from"node:fs";import k from"node:path";function x(){let t=["../../../package.json","../../package.json","../package.json","./package.json","../../../../package.json"];for(let n of t)try{let s=new URL(n,import.meta.url),i=j(s,"utf-8"),r=JSON.parse(i);if(typeof r.version=="string")return r.version}catch{}try{let n=j(k.join(k.dirname(process.execPath),"package.json"),"utf-8"),s=JSON.parse(n);if(typeof s.version=="string")return s.version}catch{}return"unknown"}o(x,"getInstalledCliVersion");function I(t){let n=/^v?(\d+)\.(\d+)\.(\d+)(?:[-+].*)?$/.exec(t.trim());if(!n)return null;let s=Number.parseInt(n[1],10),i=Number.parseInt(n[2],10),r=Number.parseInt(n[3],10);return!Number.isFinite(s)||!Number.isFinite(i)||!Number.isFinite(r)?null:[s,i,r]}o(I,"parseSemver");function X(t,n){let s=I(t),i=I(n);if(!s||!i)return null;for(let r=0;r<3;r+=1){if(s[r]<i[r])return-1;if(s[r]>i[r])return 1}return 0}o(X,"compareSemver");async function Y(t){let n=new AbortController,s=setTimeout(()=>n.abort(),7e3);try{let i=await fetch(`https://registry.npmjs.org/${encodeURIComponent(t)}/latest`,{signal:n.signal});if(!i.ok){let d=await i.text().catch(()=>"");throw new Error(`npm registry request failed: ${i.status} ${d}`.trim())}let r=await i.json().catch(()=>({}));if(typeof r.version!="string"||r.version.trim().length===0)throw new Error("npm registry payload missing version");return r.version.trim()}finally{clearTimeout(s)}}o(Y,"fetchLatestNpmVersion");var a="boolean",m="integer",l="json",g="number",e="string",P={agent:e,approvalPolicy:e,cwd:e,json:a,maxOutputBytes:m,message:e,messageFile:e,model:e,noServerStart:a,nonInteractive:a,project:e,provider:e,resume:e,sandbox:e,server:e,stdin:a,timeoutSec:m,yes:a},O={access:e,agentId:e,all:a,artifactPaths:e,async:a,authHeader:e,authHeaderValue:e,authToken:e,autoStart:a,baseRef:e,branch:e,budget:g,budgetUsd:g,cleanup:a,cols:m,command:e,content:e,contentBase64:e,contents:e,contentsBase64:e,cpu:g,create:a,description:e,diskGb:g,dockerBuildArgs:l,dockerRegistrySecretRefs:e,dockerfile:e,dockerfileContext:e,dockerfileTarget:e,domain:e,env:e,environment:e,envLiteral:e,envName:e,envRef:e,expectedMppMode:e,expectedVersion:m,failOnUnpreservedChanges:a,ffOnly:a,forceWithLease:a,fork:a,fromPath:e,idempotencyKey:e,idleTimeoutSeconds:m,image:e,imageDigest:e,input:e,inputBase64:e,integrationCapabilities:e,integrationConnection:e,integrationScopes:e,intervalMs:m,json:a,keep:a,label:e,leaseId:e,lifecycleHint:l,manifestPath:e,maxDurationSeconds:m,maxEntries:g,maxResults:g,memoryGb:g,message:e,name:e,noPreview:a,overwrite:a,params:l,path:e,paths:e,payload:l,port:m,preview:a,projectId:e,publish:a,q:e,query:e,rebase:a,recursive:a,registrySecretRef:e,remote:e,replayState:e,repo:e,respondAsync:a,rows:m,runtimeAgentId:e,runtimeBaseBranch:e,runtimeBaseSha:e,runtimeId:e,runtimeProfileId:e,runtimeProjectId:e,runtimePromotionPolicy:e,runtimeWorkspaceRoot:e,sandboxId:e,scope:e,since:m,snapshot:a,snapshotId:e,sourceProjectId:e,sourceRepoUrl:e,sourceSandboxId:e,startPoint:e,status:e,stdin:a,summary:a,tag:e,tags:e,targetId:e,targetType:e,teamId:e,templateName:e,templateVersion:e,templateVisibility:e,timeoutSeconds:m,toPath:e,type:e,useCase:e,validationCommand:e,value:e,version:e,volumeDeleteOnSandboxDelete:a,volumeMountPath:e,volumeName:e,volumeStorageGb:g,workflowMode:e},A={action:e,agentId:e,budget:g,budgetUsd:g,build:e,branch:e,commit:a,commitMessage:e,description:e,dir:e,disableSchedule:e,disableSchedules:e,enableSchedule:e,enableSchedules:e,entrypoint:e,env:l,envRef:e,file:e,force:a,idleTimeoutSeconds:m,inherit:a,input:l,inputFile:e,inputFiles:e,inputJson:l,inputs:l,json:a,keepTokenRemote:a,manifest:e,maxDurationSeconds:m,name:e,noPush:a,noWrite:a,out:e,outDir:e,output:e,outputDir:e,params:l,path:e,plan:e,projectId:e,repo:e,runtimeAgentId:e,runtimeBaseBranch:e,runtimeBaseSha:e,runtimeId:e,runtimeProjectId:e,runtimePromotionPolicy:e,scheduleMode:e,scheduleOverride:l,scheduleOverrides:l,schedules:e,service:e,setRemoteToken:a,setupTimeoutSeconds:m,target:e,teamId:e,timeoutSeconds:m,token:e,workflowMode:e,yes:a},T={branch:e,commitMessage:e,defaultBranch:e,description:e,gitOwner:e,gitRepo:e,internalRepoPath:e,json:a,name:e,path:e,projectId:e,repo:e,sourceCheckDispatch:e,sourceType:e,teamId:e,templateRepoUrl:e},E={agentId:e,agentEdit:l,allowLatestSource:a,allowedActions:e,attachmentsJson:l,baseSha:e,chatMode:e,checkKind:e,conversationId:e,cwd:e,dispatch:e,entrypointName:e,entrypointScope:e,expectedManifestHash:e,evalStatus:e,expectedSourceCommitSha:e,idempotencyKey:e,input:l,inputFile:e,json:a,limit:m,message:e,metadata:l,name:e,path:e,payload:l,projectId:e,prompt:e,provider:e,publishedSnapshotId:e,ref:e,requirePublishedSnapshot:a,requiredEnv:e,requiredIntegrations:e,runtimePromotionPolicy:e,runtimeSourceMode:e,sourceCheckDispatch:e,sourceMode:e,sourceRef:e,status:e,targetProjectId:e,teamId:e,triggerType:e,workflowMode:e};var b={account:"string",apiBaseUrl:"string",apiBaseurl:"string",baseUrl:"string",baseurl:"string",chatApiBaseUrl:"string",chatApiBaseurl:"string",checkUpdate:"boolean",cwd:"string",help:"boolean",home:"string",json:"boolean",profile:"string",sandboxApiUrl:"string",sandboxApiurl:"string",tui:"boolean",version:"boolean"},ae={C:"cwd",f:"force",h:"help",j:"json",v:"version",y:"yes"},B={cwd:"string",input:"json",inputFile:"string",json:"boolean",path:"string"},C=[{name:"datasets",usage:"openpond datasets <upload|read|list|validate|publish> [folder|id] --team <id> --api-base-url <origin> [--operation-id <id>] [--expected-revision <n>] [--publish] [--project <id>] [--dataset-id <id>]",optionSchema:{team:"string",operationId:"string",expectedRevision:"integer",publish:"boolean",project:"string",datasetId:"string",cursor:"string",workspaceHash:"string",packageHash:"string",json:"boolean"},handler:o(async({options:t,rest:n})=>(await import("./datasets-V7E4I5N3.js")).runDatasetsCommand(t,n),"handler")},{name:"experiments",usage:"openpond experiments <save|read|list|executions|start|status|cancel|retry|score|passes|pass|cancel-pass|pass-result|result|compare> [id] [candidate-id] --team <id> [--input-file <path>] [--operation-id <id>] [--json]",optionSchema:{team:"string",inputFile:"string",operationId:"string",project:"string",datasetHash:"string",search:"string",afterId:"string",limit:"integer",json:"boolean"},handler:o(async({options:t,rest:n})=>(await import("./experiments-7UBJCQAQ.js")).runExperimentsCommand(t,n),"handler")},{name:"home",usage:"openpond home [--home <directory>]",optionSchema:{},handler:o(async()=>console.log((await import("./dist-4OUZANXR.js")).resolveOpenPondHome()),"handler")},{name:"config",usage:"openpond config <get|set|unset|path|validate|schema|doctor|migrate|recover|restart-migration|revisions|replace|effective|trust|untrust|export|backup|restore|collect-orphans|clear-cache> [key] [value] [--home <directory>] [--json]",optionSchema:{keyPath:"json",value:"string",file:"string",project:"boolean",revision:"string",expectedRevision:"string",sourceAppHome:"string",sourceConfig:"string",sourceBrowserState:"string",dryRun:"boolean"},handler:o(async({options:t,rest:n})=>(await import("./configuration-command-RPNYWBKK.js")).runConfigurationCommand(t,n),"handler")},{name:"help",usage:"openpond help",optionSchema:{},handler:o(async()=>(await import("./help-4BB2A5JC.js")).printHelp(),"handler")},{name:"version",usage:"openpond version",optionSchema:{},handler:o(()=>console.log(x()),"handler")},{name:"check-update",usage:"openpond check-update",optionSchema:{},handler:o(async()=>(await import("./core-commands-WFTASSGL.js")).runCheckUpdate(),"handler")},{name:"login",usage:"openpond login [--base-url <url>]",optionSchema:b,handler:o(async({options:t})=>(await import("./core-commands-WFTASSGL.js")).runLogin(t),"handler")},{name:"init",usage:"openpond init [--path <dir>] [--profile <name>] [--template <name>] [--force] [--json]",optionSchema:{...b,force:"boolean",path:"string",template:"string"},handler:o(async({options:t})=>(await import("./profile-LZYR4CMX.js")).runOpenPondInitCommand(t),"handler")},{name:"profile",usage:"openpond profile <current|init|load|check|push|commit|diff|catalog>",optionSchema:{checkKind:"string",conversationId:"string",ensureHosted:"boolean",expectedManifestHash:"string",force:"boolean",hostedCheckKind:"string",hostedRunAgentId:"string",hostedRunConversationId:"string",hostedRunIdempotencyKey:"string",hostedRunInput:"json",hostedRunRetry:"boolean",hostedRunTargetProjectId:"string",hostedSourceDispatch:"string",hostedSourceAgentId:"string",hostedSourceChecks:"boolean",hostedSourceProjectId:"string",json:"boolean",kind:"string",path:"string",publishHostedSource:"boolean",teamId:"string"},handler:o(async({options:t,rest:n})=>(await import("./profile-LZYR4CMX.js")).runOpenPondProfileCommand(t,n),"handler")},{name:"agents",usage:"openpond agents [--json]",optionSchema:{json:"boolean"},handler:o(async({options:t,rest:n})=>(await import("./profile-LZYR4CMX.js")).runOpenPondAgentsCommand(t,n),"handler")},{name:"actions",usage:"openpond actions <check|build|run|dev|publish> [action-id] [--cwd DIR] [--input JSON|--input-file PATH]",optionSchema:{apiKey:"string",baseUrl:"string",cwd:"string",input:"string",inputFile:"string",json:"boolean",outputDirectory:"string",sourceDirectory:"string",sourceCommitSha:"string",sourceRef:"string",projectId:"string",teamId:"string",timeoutMs:"integer"},handler:o(async({options:t,rest:n})=>(await import("./actions-command-MHWHPQ66.js")).runProjectActionsCommand(t,n),"handler")},...K(),{name:"extension",usage:"openpond extension <add|preview|list|inspect|update|remove> [owner/repo]",usages:["openpond extension add <owner/repo> [--ref <branch|tag|sha>] [--json]","openpond extension update <owner/repo> [--ref <branch|tag|sha>] [--json]","openpond extension update --all [--json]","openpond extension remove <owner/repo> [--json]"],optionSchema:{all:"boolean",json:"boolean",ref:"string"},handler:o(async({options:t,rest:n})=>(await import("./extension-OQ7CFD4Q.js")).runOpenPondExtensionCommand(t,n),"handler")},{name:"profiles",usage:"openpond profiles [args]",optionSchema:{json:"boolean"},handler:o(async({options:t,rest:n})=>(await import("./core-commands-WFTASSGL.js")).runProfiles(t,n),"handler")},{name:"account",usage:"openpond account",optionSchema:{json:"boolean"},handler:o(async()=>(await import("./core-commands-WFTASSGL.js")).runAccount(),"handler")},{name:"health",usage:"openpond health",optionSchema:{json:"boolean"},handler:o(async({options:t})=>(await import("./core-commands-WFTASSGL.js")).runHealth(t),"handler")},{name:"app-server",usage:"openpond app-server [--home DIR]",optionSchema:{home:"string"},handler:o(async({options:t,rest:n})=>(await import("./app-layer-JZTMHORT.js")).runOpenPondServerCommand("app-server",t,n),"handler")},{name:"serve",usage:"openpond serve [args]",optionSchema:{host:"string",hostname:"string",listen:"string",port:"integer"},handler:o(async({options:t,rest:n})=>(await import("./app-layer-JZTMHORT.js")).runOpenPondServerCommand("serve",t,n),"handler")},{name:"ui",usage:"openpond ui [--no-open] [--hostname HOST] [--port PORT]",optionSchema:{host:"string",hostname:"string",listen:"string",noOpen:"boolean",port:"integer",webRoot:"string"},handler:o(async({options:t,rest:n})=>(await import("./app-layer-JZTMHORT.js")).runOpenPondServerCommand("web",t,n),"handler")},{name:"tui",aliases:["interactive"],usage:"openpond tui [--provider <id>] [--model <id>] [--project <id>]",optionSchema:{cwd:"string",model:"string",noServerStart:"boolean",project:"string",provider:"string",server:"string"},handler:o(async({options:t,rest:n})=>(await import("./app-layer-JZTMHORT.js")).runOpenPondTerminalCommand(t,n),"handler")},{name:"chat",usage:"openpond chat (--message-file <path>|--message <text>|--stdin) --non-interactive [--provider <id>] [--model <id>] [--agent <id>] [--project <id>] [--resume <session-id>] [--yes] [--approval-policy <policy>] [--json] [--timeout-sec <n>] [--max-output-bytes <n>] [--sandbox <mode>]",optionSchema:P,handler:o(async({options:t,rest:n})=>(await import("./app-layer-JZTMHORT.js")).runOpenPondTerminalCommand(t,n),"handler")},{name:"tool",usage:"openpond tool <list|run> <handle>/<repo> [args]",optionSchema:{body:"json",json:"boolean"},handler:F},{name:"backtest",usage:"openpond backtest <run|events|get> <handle>/<repo> [args]",optionSchema:{body:"json",branch:"string",deploymentId:"string",limit:"integer",runId:"string"},handler:$},{name:"deploy",usage:"openpond deploy watch <handle>/<repo> [--branch <branch>]",optionSchema:{branch:"string"},handler:G},{name:"template",usage:"openpond template <status|branches|update> <handle>/<repo> [--env preview|production]",optionSchema:{env:"string"},handler:J},{name:"sandbox-template",usage:"openpond sandbox-template <command> [args]",optionSchema:A,handler:o(async({options:t,rest:n})=>(await import("./sandbox-template-6RLQYNTY.js")).runSandboxTemplateCommand(t,n),"handler")},{name:"repo",usage:"openpond repo <create|push> [--name <name>] [--path <dir>] [--branch <branch>]",optionSchema:{branch:"string",name:"string",path:"string"},handler:V},{name:"organizations",aliases:["organization"],usage:"openpond organizations <login|list|use|logout|whoami> [args]",optionSchema:{accessToken:"string",arguments:"json",callbackPort:"integer",clientId:"string",customDomain:"string",displayName:"string",email:"string",env:"string",environment:"string",json:"boolean",name:"string",open:"boolean",origin:"string",primaryContactEmail:"string",printToken:"boolean",resourceUrl:"string",role:"string",scope:"string",scopes:"string",slug:"string",status:"string",timeout:"integer",timeoutSeconds:"integer",tool:"string",toolName:"string",toolset:"string",url:"string"},handler:o(async({options:t,rest:n})=>(await import("./organizations-MUKXB6MX.js")).runOrganizationsCommand(t,n),"handler")},{name:"project",usage:"openpond project <list|create|upsert|get|update|sync|source-upload|archive> [args]",optionSchema:T,handler:o(async({options:t,rest:n})=>(await import("./project-agent-FHNWIH2D.js")).runProjectCommand(t,n),"handler")},{name:"agent",usage:"openpond agent <inspect|build|validate|eval|traces|list|create|upsert|get|update|run|run-test|bind-source|source|archive> [args]",usages:["openpond agent run <action> [--cwd <project>] [--input <json>]","openpond agent run <agentId> --team-id <id> [--conversation-id <id>] [--target-project-id <projectId>] [--input <json>]","openpond agent source checks <agentId> --team-id <id> [--check-kind <kind>]","openpond agent source publish <agentId> --team-id <id> [--expected-manifest-hash <hash>]"],optionSchema:E,handler:o(async({options:t,rest:n})=>(await import("./project-agent-FHNWIH2D.js")).runAgentCommand(t,n),"handler")},{name:"desktop-test",usage:"openpond desktop-test <run|attach> <scenario...> [--isolated|--attach|--packaged|--none] [--app <path>] [--artifacts-dir <path>] [--json <path>]",optionSchema:{artifactsDir:"string",attach:"boolean",cwd:"string",devtoolsPort:"integer",grep:"string",isolated:"boolean",json:"string",jsonPath:"string",keepHome:"boolean",none:"boolean",server:"string",timeoutMs:"integer",token:"string",tokenFile:"string"},handler:o(async({options:t,rest:n})=>(await import("./desktop-test-NZAZVXLK.js")).runDesktopTestCommand(t,n),"handler")},{name:"sandbox",usage:"openpond sandbox <command> [args]",optionSchema:O,handler:o(async({options:t,rest:n})=>(await import("./sandbox-command-GJN3HSJQ.js")).runSandboxCommand(t,n),"handler")},{name:"continual",usage:"openpond continual <init|validate|run|report> [manifest-or-series-id]",usages:["openpond continual init --from <tasks.jsonl> [--output <continual-support.yaml>] [--non-interactive]","openpond continual validate <continual-support.yaml> [--json]","openpond continual run <continual-support.yaml> [--api-base-url <url>] [--json]","openpond continual report <comparison-series-id> [--output <report.json>] [--json]"],optionSchema:{apiBaseUrl:"string",commit:"string",correctionCasesPerFamily:"integer",correctionSelection:"string",description:"string",from:"string",grader:"string",id:"string",json:"boolean",license:"string",name:"string",nonInteractive:"boolean",output:"string",repository:"string",seed:"string",semanticSimilarityThreshold:"number"},handler:o(async({options:t,rest:n})=>(await import("./continual-MHMPLLUZ.js")).runContinualCommand(t,n),"handler")},{name:"training",usage:"openpond training <create-project|start|status|watch|logs|cancel|resume|artifacts|benchmark> <taskset-id|model-run-id|run-id|model-id>",usages:["openpond training create-project <taskset-id> --recipe <path> [--project-id <id>] [--profile <id>] [--name <name>] [--objective <text>] [--destination <id>] [--rollout-placement <local|remote>] [--gpu-placement-objective <fast|balanced|economical>] [--run-preset <preset>] [--max-spend <usd>] [--retention-days <days>] [--json]","openpond training start <model-project-id> [--comparison-series-entry <entry-id>] [--manifest <path>] [--yes] [--export-approved] [--max-spend <usd>] [--retention-days <days>] [--detach] [--json]","openpond training status <run-id> [--json]","openpond training watch <run-id> [--interval-ms <ms>] [--json]","openpond training logs <run-id> [--json]","openpond training cancel <run-id> [--json]","openpond training resume <model-run-id> [--json]","openpond training artifacts <run-id> [--json]","openpond training benchmark <model-id> [--provider <id>] [--model <id>] [--reasoning-effort <level>] [--max-spend <usd>] [--json]"],optionSchema:{apiBaseUrl:"string",comparisonSeriesEntry:"string",detach:"boolean",destination:"string",exportApproved:"boolean",gpuPlacementObjective:"string",intervalMs:"integer",json:"boolean",manifest:"string",maxSpend:"number",model:"string",name:"string",objective:"string",profile:"string",projectId:"string",provider:"string",recipe:"string",reasoningEffort:"string",retentionDays:"integer",rolloutPlacement:"string",runPreset:"string",yes:"boolean"},handler:o(async({options:t,rest:n})=>(await import("./training-7PST5HZU.js")).runTrainingCommand(t,n),"handler")},{name:"taskset",usage:"openpond taskset <import|publish|readiness|delete-draft> <package-path|draft-id|taskset-id> [--profile <id>] [--model <id>] [--json]",usages:["openpond taskset import <package-directory|taskset.json> [--profile <id>] [--json]","openpond taskset publish <draft-id> [--model <id>] [--json]","openpond taskset readiness <taskset-id> [--json]","openpond taskset delete-draft <draft-id> [--json]"],optionSchema:{apiBaseUrl:"string",json:"boolean",model:"string",profile:"string"},handler:o(async({options:t,rest:n})=>(await import("./taskset-BZYQT65N.js")).runTasksetCommand(t,n),"handler")},{name:"opchat",usage:"openpond opchat <command> [args]",optionSchema:{compatModel:"string",compatibilityModel:"string",env:"string",environment:"string",effort:"string",json:"boolean",message:"string",model:"string",opchatApiBaseUrl:"string",opchatApiUrl:"string",prompt:"string",skipStream:"boolean",skipTool:"boolean",stream:"boolean"},handler:o(async({options:t,rest:n})=>(await import("./opchat-QVB4UIZR.js")).runOpChatCommand(t,n),"handler")},{name:"teams-bot",usage:"openpond teams-bot <command> [args]",optionSchema:{json:"boolean",teamId:"string"},handler:o(async({options:t,rest:n})=>(await import("./teams-bot-UQB636V3.js")).runTeamsBotCommand(t,n),"handler")},{name:"apps",usage:"openpond apps <list|code-visibility|tools|deploy|env get|env set|performance|summary|assistant|agent create> [args]",optionSchema:{appId:"string",body:"json",env:"json",json:"boolean",limit:"integer",refresh:"boolean",teamId:"string",watch:"boolean"},handler:q},{name:"opentool",usage:"openpond opentool <init|validate|build> [args]",optionSchema:{},handler:o(async({rest:t})=>(await import("./core-commands-WFTASSGL.js")).runOpentool(t),"handler")}],y=new Map;for(let t of C){y.set(t.name,t);for(let n of t.aliases??[])y.set(n,t)}function re(){return C}o(re,"listCliCommandDefinitions");function w(t){return y.get(t)??null}o(w,"getCliCommandDefinition");function ie(t,n){return w(t||"ui")?.optionSchema[n]??b[n]}o(ie,"getCliOptionKind");function se(t){let n=b[t];if(n)return n;for(let s of C){let i=s.optionSchema[t];if(i)return i}}o(se,"getAnyCliOptionKind");async function pe(t){let n=w(t.command);return n?S(t.options.help)?(L(n),!0):(await n.handler(t),!0):!1}o(pe,"runCliCommand");function H(t){let n=["Usage:",` ${t.usage}`,...(t.usages??[]).map(i=>` ${i}`)];t.aliases?.length&&n.push("","Aliases:",` ${t.aliases.join(", ")}`);let s=Object.entries(t.optionSchema).sort(([i],[r])=>i.localeCompare(r));if(s.length>0){n.push("","Options:");for(let[i,r]of s){let d=U(i);n.push(r==="boolean"?` --${d}`:` --${d} <${r}>`)}}return n.join(`
|
|
3
|
-
`)}o(H,"formatCliCommandUsage");function L(t){console.log(H(t))}o(L,"printCliCommandUsage");function U(t){return t.replace(/[A-Z]/g,n=>`-${n.toLowerCase()}`)}o(U,"cliOptionName");function K(){return["inspect","build","validate","eval","run"].map(n=>({name:n,usage:`openpond ${n} [args]`,optionSchema:B,handler:o(async({options:s,rest:i})=>(await import("./profile-LZYR4CMX.js")).runOpenPondProfileSdkAlias(n,s,i),"handler")}))}o(K,"profileSdkAliasDefinitions");async function F({options:t,rest:n}){let{runToolList:s,runToolRun:i}=await import("./core-commands-WFTASSGL.js"),r=n[0];if(r==="list"){let d=n[1];if(!d)throw new Error("usage: tool list <handle>/<repo>");await s(t,d);return}if(r==="run"){let d=n[1],c=n[2];if(!d||!c)throw new Error("usage: tool run <handle>/<repo> <tool> [--body <json>]");await i(t,d,c);return}throw new Error("usage: tool <list|run> <handle>/<repo> [args]")}o(F,"runToolCommand");async function $({options:t,rest:n}){let{runBacktestRun:s}=await import("./core-commands-WFTASSGL.js"),{runBacktestEvents:i,runBacktestGet:r}=await import("./apps-U5GIOD6W.js"),d=n[0]||"run";if(d==="run"){let c=n[1],f=n[2];if(!c||!f)throw new Error("usage: backtest run <handle>/<repo> <tool> [--body <json>] [--branch <branch>] [--deployment-id <id>]");await s(t,c,f);return}if(d==="events"){let c=n[1];if(!c)throw new Error("usage: backtest events <handle>/<repo> [--run-id <id>] [--limit <n>]");await i(t,c);return}if(d==="get"){let c=n[1];if(!c)throw new Error("usage: backtest get <handle>/<repo> --run-id <id>");await r(t,c);return}throw new Error("usage: backtest <run|events|get> <handle>/<repo> [args]")}o($,"runBacktestCommand");async function G({options:t,rest:n}){let{runDeployWatch:s}=await import("./core-commands-WFTASSGL.js");if((n[0]||"watch")!=="watch")throw new Error("usage: deploy watch <handle>/<repo> [--branch <branch>]");let r=n[1];if(!r)throw new Error("usage: deploy watch <handle>/<repo> [--branch <branch>]");await s(t,r)}o(G,"runDeployCommand");async function J({options:t,rest:n}){let{runTemplateBranches:s,runTemplateStatus:i,runTemplateUpdate:r}=await import("./core-commands-WFTASSGL.js"),d=n[0]||"status",c=n[1];if(!c)throw new Error("usage: template <status|branches|update> <handle>/<repo> [--env preview|production]");if(d==="status"){await i(t,c);return}if(d==="branches"){await s(t,c);return}if(d==="update"){await r(t,c);return}throw new Error("usage: template <status|branches|update> <handle>/<repo> [--env preview|production]")}o(J,"runTemplateCommand");async function V({options:t,rest:n}){let{runRepoCreate:s,runRepoPush:i}=await import("./core-commands-WFTASSGL.js"),r=n[0]||"create";if(r==="create"){await s(t,n.slice(1));return}if(r==="push"){await i(t);return}throw new Error("usage: repo <create|push> [--name <name>] [--path <dir>] [--branch <branch>]")}o(V,"runRepoCommand");async function q({options:t,rest:n}){let{runAppsAgentCreate:s,runAppsAssistant:i,runAppsCodeVisibility:r,runAppsDeploy:d,runAppsEnvGet:c,runAppsEnvSet:f,runAppsList:R,runAppsPerformance:N,runAppsSummary:M,runAppsTools:_,runAppsToolsExecute:D}=await import("./apps-U5GIOD6W.js"),u=n[0];if(u==="list"){await R(t);return}if(u==="code-visibility"){let p=n[1];if(!p)throw new Error("usage: apps code-visibility <handle>/<repo> --visibility public|private");await r(t,p);return}if(u==="tools"){if(n[1]==="execute"){let p=n[2],h=n[3],v=n[4];if(!p||!h||!v)throw new Error("usage: apps tools execute <appId> <deploymentId> <tool> [--body <json>]");await D(t,p,h,v);return}await _();return}if(u==="deploy"){let p=n[1];if(!p)throw new Error("usage: apps deploy <handle>/<repo> [--env preview|production] [--watch]");await d(t,p);return}if(u==="env"&&n[1]==="get"){let p=n[2];if(!p)throw new Error("usage: apps env get <handle>/<repo>");await c(t,p);return}if(u==="env"&&n[1]==="set"){let p=n[2];if(!p)throw new Error("usage: apps env set <handle>/<repo> --env <json>");await f(t,p);return}if(u==="performance"){await N(t);return}if(u==="summary"){let p=n[1];if(!p)throw new Error("usage: apps summary <handle>/<repo>");await M(t,p);return}if(u==="assistant"){let p=n[1],h=n[2];if(p!=="plan"&&p!=="performance"||!h)throw new Error("usage: apps assistant <plan|performance> <handle>/<repo> --prompt <text>");await i(t,p,h,n.slice(3));return}if(u==="agent"&&n[1]==="create"){await s(t,n.slice(2));return}throw new Error("usage: apps <list|code-visibility|tools|deploy|env get|env set|performance|summary|assistant|agent create> [args]")}o(q,"runAppsCommand");export{x as a,X as b,Y as c,b as d,ae as e,re as f,w as g,ie as h,se as i,pe as j,H as k};
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import { createRequire as __openpondCreateRequire } from "node:module"; var require = __openpondCreateRequire(import.meta.url);
|
|
2
|
-
import{a as ge,b as Ge}from"./chunk-RELOOVWW.js";import{B as De,D as ze,E as Ne,F as A,G as Ke,H as Fe,l as ue,z as Be}from"./chunk-GIPSOLAY.js";import{a as Q,b as I,c as O,h as Xe,i as fe,j as he}from"./chunk-MJC26GOX.js";import{$a as Ye,D as He,M as $e,Ma as Je,P as pe,_a as Ve,b as le,ga as me,h as X,k as qe,m as Le,v as We,z as Ue}from"./chunk-JUX77H6K.js";import{a as f,e as Ae,i as Te,l as p,m as Me}from"./chunk-HZP5U2AA.js";import{b as t}from"./chunk-ES2ISFJC.js";import{a as c}from"./chunk-FTQLQJQV.js";var j=t.object({id:t.string().trim().min(1).max(240),revision:t.number().int().positive(),contentHash:t.string().regex(/^[a-f0-9]{64}$/),targetId:t.string().trim().min(1).max(240).nullable()}).strict(),ye=t.array(t.object({role:t.enum(["system","user","assistant"]),content:t.string().max(1e5)}).strict()).max(100).superRefine((o,e)=>{o.reduce((n,r)=>n+r.content.length,0)>1e5&&e.addIssue({code:"custom",message:"Evaluation prompt exceeds 100,000 characters."})});var xe=$e.extend({mode:t.enum(["nightly","approved_count"]),minimumTasks:t.number().int().min(1).max(1e4),maximumSpendUsd:t.number().positive().max(1e5),maximumDailySpendUsd:t.number().positive().max(1e6)}).strict().superRefine((o,e)=>{o.maximumDailySpendUsd<o.maximumSpendUsd&&e.addIssue({code:"custom",path:["maximumDailySpendUsd"],message:"The daily budget must cover one update."})});var E=class extends Error{static{c(this,"OpenPondProtocolError")}code;constructor(e,n){super(n),this.name="OpenPondProtocolError",this.code=e}};function P(o){return JSON.stringify(be(o))}c(P,"canonicalJson");async function Z(o){let e=new TextEncoder().encode(P(o)),n=await globalThis.crypto.subtle.digest("SHA-256",e);return Array.from(new Uint8Array(n),r=>r.toString(16).padStart(2,"0")).join("")}c(Z,"canonicalSha256");function be(o){if(o===null||typeof o=="string"||typeof o=="boolean")return o;if(typeof o=="number"){if(!Number.isFinite(o))throw new E("non_json_value","Canonical JSON cannot contain a non-finite number.");return Object.is(o,-0)?0:o}if(Array.isArray(o))return o.map(e=>be(e));if(typeof o=="object"){let e=Object.getPrototypeOf(o);if(e!==Object.prototype&&e!==null)throw new E("non_json_value","Canonical JSON accepts only plain objects.");let n={};for(let r of Object.keys(o).sort()){let s=o[r];if(s===void 0||typeof s=="function"||typeof s=="symbol")throw new E("non_json_value",`Canonical JSON cannot contain ${typeof s} at ${r}.`);n[r]=be(s)}return n}throw new E("non_json_value",`Canonical JSON cannot contain ${typeof o}.`)}c(be,"normalizeCanonicalJson");var l=t.string().trim().min(1).max(500),v=t.string().regex(/^[a-f0-9]{64}$/),S=t.string().datetime({offset:!0}),_=t.object({id:l,contentHash:v}).strict(),k=_.extend({revision:t.number().int().positive()}).strict(),L=t.object({schemaVersion:t.literal("openpond.baseModelPreference.v1"),modelId:l,revision:t.string().trim().min(1).max(256).nullable(),tokenizerRevision:t.string().trim().min(1).max(256).nullable(),chatTemplateHash:t.string().trim().min(8).max(256).nullable(),modelAssetId:l.nullable(),source:t.enum(["managed","local","builtin"])}).strict(),Qe=t.enum(["sft","dpo","grpo","ppo","sdft","opd","opsd","sdpo"]),At=t.object({schemaVersion:t.string().regex(/^openpond\.[A-Za-z0-9]+Recipe\.v\d+$/),method:Qe,parameterization:t.enum(["lora","full"])}).catchall(t.unknown()),Tt=t.object({profileProjectId:l,sourceRevision:t.string().regex(/^[a-f0-9]{40,64}$/),harnessRelease:_}).strict(),Mt=t.object({profileProjectId:l,sourceRevision:t.string().regex(/^[a-f0-9]{40,64}$/),catalogHash:v,definitionId:l,harnessRelease:_,tasksetRelease:_}).strict(),Ze=t.object({tasksetRef:k.nullable().default(null),evaluationTasksetRef:k.nullable().optional(),profileSource:Tt.nullable().optional(),profileEvaluation:Mt.nullable().optional(),rewardBindingRef:k.nullable().optional(),tasksetRelease:_.nullable().default(null),harnessRelease:_.nullable().default(null),baseModel:L.nullable().default(null),method:Qe.nullable().default(null),destinationId:l.nullable().default(null),managedRolloutPlacement:t.enum(["local","remote"]).default("remote"),managedGpuPlacementObjective:t.enum(["fast","balanced","economical"]).default("balanced"),managedGpuRequirement:t.enum(["any","h100_hbm3"]).default("any"),runPreset:t.enum(["small","standard","custom","small_experiment"]).nullable().default(null),recipe:At.nullable().default(null),preferredMaximumSpendUsd:t.number().nonnegative().nullable().default(null),preferredRetentionDays:t.number().int().nonnegative().nullable().default(null)}).strict(),et=Ze.omit({managedGpuRequirement:!0}),qt=t.object({schemaVersion:t.literal("openpond.hostedModelProjectLink.v1"),apiOrigin:t.string().url().refine(o=>new URL(o).origin===o,"Use a canonical API origin.").nullable().default(null),teamId:l,projectId:l,portableProjectId:l,revision:t.number().int().positive(),etag:v,syncedSourceRevision:t.number().int().positive(),syncedAt:S,tasksets:t.array(t.object({localTasksetId:l,localTasksetHash:v.nullable().default(null),releaseId:l,releaseRevision:t.number().int().positive(),releaseHash:v,packageHash:v.nullable().default(null),hostedTasksetId:l,syncedAt:S}).strict()).max(1e4).default([])}).strict(),Lt=t.object({localTasksetId:l,releaseId:l,releaseRevision:t.number().int().positive(),releaseHash:v,state:t.enum(["syncing","synced","sync_failed"]),hostedTasksetId:l.nullable().default(null),lastAttemptAt:S,syncedAt:S.nullable().default(null),lastError:t.string().trim().min(1).max(5e3).nullable().default(null)}).strict(),Wt=t.object({schemaVersion:t.literal("openpond.modelProject.v2"),id:l,profileId:l,revision:t.number().int().positive().default(1),name:t.string().trim().min(1).max(200),objective:t.string().trim().max(5e3).nullable(),defaultBaseModel:L.nullable(),defaultDestinationId:l.nullable(),trainingSetup:Ze,hosted:qt.nullable().default(null),tasksetSyncs:t.array(Lt).max(1e4).default([]),createdAt:S,updatedAt:S}).strict(),Ut=Wt.pick({id:!0,profileId:!0,name:!0,objective:!0,defaultBaseModel:!0,defaultDestinationId:!0,trainingSetup:!0}),Cn=t.object({schemaVersion:t.literal("openpond.modelProjectSave.v1"),operationId:l,expectedRevision:t.number().int().nonnegative(),project:Ut,learning:xe.optional()}).strict().superRefine((o,e)=>{o.learning&&o.expectedRevision!==0&&e.addIssue({code:"custom",path:["learning"],message:"Use learning settings to edit an existing Model's policy."})}),jn=t.object({schemaVersion:t.literal("openpond.modelProjectConfigurationCheck.v1"),configurationHash:v,projectId:l,expectedRevision:t.number().int().nonnegative(),checkedAt:S,canSave:t.boolean(),deferred:t.array(t.enum(["base_model","taskset"])).max(2),findings:t.array(t.object({code:l,severity:t.enum(["error","warning"]),message:t.string().min(1).max(5e3),field:t.string().min(1).max(500).nullable()}).strict()).max(100)}).strict(),En=t.object({id:l,name:t.string().min(1).max(500),available:t.boolean(),preference:L}).strict();var _n=t.object({schemaVersion:t.literal("openpond.hostedModelProjectSync.v2"),portableProjectId:l,name:t.string().trim().min(1).max(200),objective:t.string().trim().max(5e3).nullable(),defaultBaseModel:L.nullable(),defaultDestinationId:l.nullable(),trainingSetup:et,sourceRevision:t.number().int().positive(),sourceUpdatedAt:S,expectedEtag:v.nullable().default(null)}).strict(),Ht=t.object({id:l,teamId:l,portableProjectId:l,name:t.string().trim().min(1).max(200),objective:t.string().trim().max(5e3).nullable(),defaultBaseModel:L.nullable(),defaultDestinationId:l.nullable(),trainingSetup:et,sourceRevision:t.number().int().positive(),sourceUpdatedAt:S,revision:t.number().int().positive(),etag:v,createdAt:S,updatedAt:S}).strict(),$t=t.object({kind:t.enum(["taskset_release","harness_release","dataset_release","evidence_set","model_version","reward_model_version","evaluation_receipt"]),ref:_,role:t.string().trim().min(1).max(200).nullable().default(null),updatedAt:S}).strict(),An=t.object({project:Ht,resources:t.array($t).max(1e4),jobCount:t.number().int().nonnegative(),latestJobIds:t.array(l).max(100)}).strict(),Tn=t.object({schemaVersion:t.literal("openpond.modelProjectApiError.v2"),code:t.string().trim().min(1).max(200),message:t.string().trim().min(1).max(5e3),retryable:t.boolean().default(!1),requestId:t.string().trim().min(1).max(500).nullable().default(null),details:t.record(t.string(),t.unknown()).default({})}).strict();var tt=t.object({schemaVersion:t.literal("openpond.experimentAttemptGrade.v1"),selectionHash:t.string().regex(/^[a-f0-9]{64}$/),grades:t.array(X).min(1).max(100),score:t.number().min(0).max(1).nullable(),passed:t.boolean(),rewardEligible:t.boolean(),gradingStatus:t.enum(["scored","unscorable","not_configured"]),failureClass:Te.nullable(),contentHash:t.string().regex(/^[a-f0-9]{64}$/)}).strict().superRefine((o,e)=>{let{contentHash:n,...r}=o;p(r)!==n&&e.addIssue({code:"custom",message:"Experiment grading integrity failed."});let s=o.grades.flatMap(i=>i.components);(s.length!==o.grades.length||new Set(s.map(i=>i.graderId)).size!==s.length)&&e.addIssue({code:"custom",message:"Each selected criterion requires exactly one distinct grader result."});for(let i of o.grades){let{contentHash:a,...d}=i;p(d)!==a&&e.addIssue({code:"custom",message:"A retained criterion changed."});for(let y of i.components){let{contentHash:x,...g}=y;p(g)!==x&&e.addIssue({code:"custom",message:"A retained grader result changed."})}}});var m=t.string().trim().min(1).max(200),W=t.string().regex(/^[a-f0-9]{64}$/),we=t.discriminatedUnion("kind",[t.object({kind:t.literal("hosted_chat"),modelId:m,messages:ye.optional(),maxOutputTokens:t.number().int().min(1).max(4096).default(1024),temperature:t.number().min(0).max(2).default(0),topP:t.number().gt(0).max(1).default(1)}).strict(),t.object({kind:t.literal("fixture"),fixtureId:m}).strict()]),Bt=t.object({schemaVersion:t.literal("openpond.modelStarterAttemptRequest.v1"),operationId:m,teamId:m,modelProjectId:m.nullable(),project:j.optional(),taskset:k,taskId:m,environmentSeed:t.number().int().min(0).max(2147483647).default(0),policy:we}).strict(),Vn=t.object({modelProjectId:m.nullable(),taskset:k,afterTaskId:m.optional(),limit:t.number().int().min(1).max(100).default(25)}).strict(),Yn=t.object({modelProjectId:m.nullable(),taskset:k,available:t.boolean(),unavailableReason:t.string().max(1e3).nullable(),models:t.array(t.object({id:m,name:t.string().max(500)}).strict()).max(200),tasks:t.array(t.object({id:m,split:t.enum(["train","validation","frozen_eval"]),inputPreview:t.string().max(500),fixtures:t.array(t.object({id:m,label:t.string().max(200)}).strict()).max(1e3)}).strict()).max(100),nextCursor:m.nullable()}).strict(),ee=t.object({schemaVersion:t.literal("openpond.modelStarterAttemptSummary.v1"),id:m,revision:t.number().int().positive(),request:Bt,status:t.enum(["queued","running","cancelling","completed","failed","cancelled"]),policySnapshot:t.object({modelId:m,provider:m,upstreamModelId:t.string().min(1).max(500),configurationHash:W}).strict().nullable(),createdAt:t.iso.datetime(),startedAt:t.iso.datetime().nullable(),completedAt:t.iso.datetime().nullable(),cleanupComplete:t.boolean(),resultAvailable:t.boolean(),score:t.number().min(0).max(1).nullable(),gradingStatus:t.enum(["not_started","scored","unscorable","not_configured"]).default("not_started"),passed:t.boolean().nullable(),outputPreview:t.string().max(500).nullable(),error:t.object({code:m,message:t.string().max(2e3)}).strict().nullable()}).strict().superRefine((o,e)=>{o.request.policy.kind==="fixture"!=(o.policySnapshot===null)&&e.addIssue({code:"custom",path:["policySnapshot"],message:"Fixture execution must not claim a model identity."}),o.status==="completed"&&(!o.cleanupComplete||!o.resultAvailable||!o.completedAt)&&e.addIssue({code:"custom",message:"Completed attempts require retained results and confirmed cleanup."})}),Xn=t.object({modelProjectId:m,afterId:m.optional(),limit:t.number().int().min(1).max(100).default(25)}).strict(),Qn=t.object({items:t.array(ee).max(100),nextCursor:m.nullable()}).strict(),Zn=t.object({schemaVersion:t.literal("openpond.modelStarterAttemptResult.v1"),attempt:ee,output:t.string().max(1048576).nullable(),messages:t.array(t.record(t.string(),t.unknown())).max(4002),composition:He.nullable(),grade:X.nullable().optional(),experimentGrade:tt.nullable().optional(),environment:t.object({status:t.enum(["completed","budget_exhausted","cancelled","timed_out","policy_failure","environment_failure"]),collected:t.boolean(),definition:k,initialStateHash:W.nullable(),finalStateHash:W.nullable(),attemptHash:W}).strict(),providerRequestIds:t.array(m).max(1001),contentHash:W}).strict().superRefine((o,e)=>{o.experimentGrade&&((o.grade||o.composition)&&e.addIssue({code:"custom",message:"Selected Experiment grading cannot claim another grade population."}),(!["completed","failed"].includes(o.attempt.status)||!o.attempt.resultAvailable||o.attempt.score!==o.experimentGrade.score||o.attempt.gradingStatus!==o.experimentGrade.gradingStatus||o.attempt.passed!==(o.experimentGrade.score===null?null:o.experimentGrade.passed))&&e.addIssue({code:"custom",message:"Experiment grading differs from its retained attempt summary."})),o.grade&&(o.composition&&e.addIssue({code:"custom",path:["grade"],message:"An ordinary grade cannot also claim a Reward composition."}),(!["completed","failed"].includes(o.attempt.status)||!o.attempt.resultAvailable||o.attempt.score!==o.grade.score||o.attempt.gradingStatus!==o.grade.gradingStatus||o.attempt.passed!==(o.grade.score===null?null:o.grade.passed))&&e.addIssue({code:"custom",path:["grade"],message:"Ordinary grade differs from its terminal attempt summary."}))});var R=t.string().trim().min(1).max(200),nt=t.string().regex(/^[a-f0-9]{64}$/),Dt=t.discriminatedUnion("kind",[we.options[0],t.object({kind:t.literal("fixture")}).strict()]),te=t.object({schemaVersion:t.literal("openpond.modelTasksetRunRequest.v1"),operationId:R,teamId:R,modelProjectId:R.nullable(),name:t.string().trim().min(1).max(200).optional(),project:j.optional(),taskset:k,policy:Dt,population:t.array(Ve).min(1).max(1e4)}).strict().superRefine((o,e)=>{new Set(o.population.map(n=>n.receiptId)).size!==o.population.length&&e.addIssue({code:"custom",path:["population"],message:"Run receipt identities must be unique."}),o.population.some(n=>n.fixtureId!==null!=(o.policy.kind==="fixture"))&&e.addIssue({code:"custom",path:["population"],message:"Only fixture runs require a fixture identity for every member."}),o.population.some(n=>!/^(0|[1-9][0-9]*)$/.test(n.seed)||Number(n.seed)>2147483647)&&e.addIssue({code:"custom",path:["population"],message:"Hosted environment seeds must be integers from 0 to 2147483647."})}),rt=t.object({schemaVersion:t.literal("openpond.modelTasksetRunSummary.v1"),id:R,revision:t.number().int().positive(),teamId:R,modelProjectId:R.nullable(),name:t.string().trim().min(1).max(200).optional(),project:j.optional(),operationId:R,taskset:k,policyKind:t.enum(["hosted_chat","fixture"]),manifestHash:nt,status:t.enum(["queued","running","cancelling","completed","failed","cancelled"]),totalCount:t.number().int().min(1).max(1e4),counts:t.object({pending:t.number().int().nonnegative(),running:t.number().int().nonnegative(),completed:t.number().int().nonnegative(),failed:t.number().int().nonnegative(),cancelled:t.number().int().nonnegative()}).strict(),createdAt:t.iso.datetime(),startedAt:t.iso.datetime().nullable(),completedAt:t.iso.datetime().nullable(),cleanupComplete:t.boolean(),resultAvailable:t.boolean(),score:t.number().min(0).max(1).nullable(),metricName:t.string().min(1).max(240),error:t.object({code:R,message:t.string().max(2e3)}).strict().nullable()}).strict().superRefine((o,e)=>{Object.values(o.counts).reduce((n,r)=>n+r,0)!==o.totalCount&&e.addIssue({code:"custom",path:["counts"],message:"Run counts must account for the complete population."}),o.status!=="completed"&&o.score!==null&&e.addIssue({code:"custom",path:["score"],message:"Only completed evaluations publish a metric value."}),["completed","failed","cancelled"].includes(o.status)&&(!o.completedAt||o.counts.pending||o.counts.running)&&e.addIssue({code:"custom",message:"Terminal runs require complete population accounting."}),o.status==="cancelled"&&!o.cleanupComplete&&e.addIssue({code:"custom",message:"Cancelled runs require confirmed cleanup."}),o.resultAvailable&&!["completed","failed","cancelled"].includes(o.status)&&e.addIssue({code:"custom",message:"Run results require terminal population accounting."}),o.status==="completed"&&(!o.cleanupComplete||!o.resultAvailable)&&e.addIssue({code:"custom",message:"Completed evaluations require retained results and confirmed cleanup."})}),ot=t.object({summary:rt,request:te,manifest:Ye,policySnapshot:ee.shape.policySnapshot}).strict(),ur=t.object({modelProjectId:R.optional(),projectId:j.shape.id.optional(),afterId:R.optional(),limit:t.number().int().min(1).max(100).default(25)}).strict(),gr=t.object({items:t.array(rt).max(100),nextCursor:R.nullable()}).strict(),fr=t.object({schemaVersion:t.literal("openpond.modelTasksetRunResult.v1"),run:ot,receipts:t.array(Je).min(1).max(1e4),metric:qe.nullable(),contentHash:nt}).strict();async function ne(o){let e=ot.parse(o),{summary:n,request:r,manifest:s,policySnapshot:i}=e;if(Me(s,"Taskset run manifest"),s.contentHash!==n.manifestHash||s.id!==n.id||s.createdAt!==n.createdAt||n.teamId!==r.teamId||n.modelProjectId!==r.modelProjectId||P(n.project??null)!==P(r.project??null)||P(s.metadata.project??null)!==P(r.project??null)||(n.name??null)!==(r.name??null)||n.operationId!==r.operationId||n.policyKind!==r.policy.kind||n.totalCount!==r.population.length||n.metricName!==s.metricPolicy.primaryMetric||P(n.taskset)!==P(r.taskset)||s.tasksetRelease.id!==r.taskset.id||s.tasksetRelease.contentHash!==r.taskset.contentHash||P(s.population)!==P(r.population))throw new Error("Evaluation run differs from its admitted request or manifest.");if(r.policy.kind==="fixture"){if(s.policy.kind!=="fixture"||i!==null)throw new Error("Fixture checks cannot claim a model identity.")}else if(s.policy.kind!=="model"||!i||i.modelId!==r.policy.modelId||s.policy.model.provider!==i.provider||s.policy.model.model!==i.upstreamModelId||s.policy.model.revision!==null||s.policy.model.artifactHash!==null||s.policy.model.tokenizerRevision!==null||s.policy.model.chatTemplateHash!==null||s.policy.configurationHash!==await Z({policy:r.policy,snapshot:i}))throw new Error("Evaluation model differs from its admitted policy.");return e}c(ne,"verifyModelTasksetRunDetails");var at=t.string().min(1).max(200).refine(o=>!["__proto__","prototype","constructor"].includes(o),"Use an ordinary field name."),zt=t.array(at).min(1).max(20),st=t.enum(["input","output","expectedOutput","evaluatorContext"]),Nt=t.object({destination:st,path:zt,source:st,sourcePath:t.array(at).max(20)}).strict(),U=t.array(Nt).max(100).superRefine((o,e)=>{for(let[n,r]of o.entries())o.slice(0,n).some(s=>s.destination===r.destination&&(it(s.path,r.path)||it(r.path,s.path)))&&e.addIssue({code:"custom",path:[n,"path"],message:"Mapped destination paths must not overlap."})});function it(o,e){return o.length<=e.length&&o.every((n,r)=>n===e[r])}c(it,"prefix");var C=t.string().trim().min(1).max(200),H=t.string().regex(/^[a-f0-9]{64}$/),T=t.object({id:C,revision:t.number().int().positive(),contentHash:H}).strict(),re=t.object({id:C,version:t.string().min(1).max(200),contentHash:H,feedbackKey:We,release:T.nullable(),mappings:U.optional()}).strict(),Kt=t.object({id:C,version:t.string().min(1).max(200),contentHash:H,mappings:U}).strict(),ct=t.object({operationId:C,id:C.optional(),expectedRevision:t.number().int().nonnegative(),request:te,maximumCostUsd:t.number().finite().positive().max(1e4),graders:t.array(Kt).min(1).max(100).optional()}).strict().superRefine((o,e)=>{o.request.name||e.addIssue({code:"custom",path:["request","name"],message:"Name this Experiment before saving it."}),!!o.id!=o.expectedRevision>0&&e.addIssue({code:"custom",path:["expectedRevision"],message:"An update requires its saved definition revision."}),Math.round(o.maximumCostUsd*1e6)<1&&e.addIssue({code:"custom",path:["maximumCostUsd"],message:"The budget must be at least $0.000001."}),o.graders&&new Set(o.graders.map(n=>n.id)).size!==o.graders.length&&e.addIssue({code:"custom",path:["graders"],message:"Select each grader once."})}),Ft=t.object({schemaVersion:t.literal("openpond.experimentDefinition.v1"),id:C,teamId:C,revision:t.number().int().positive(),request:te,maximumCostUsd:t.number().finite().positive().max(1e4),graders:t.array(re).min(1).max(100),createdAt:t.iso.datetime(),updatedAt:t.iso.datetime()}).strict(),Jt=Ft.extend({contentHash:H}),dt=t.object({operationId:C,definition:T}).strict(),lt=t.object({projectId:C.optional(),datasetHash:H.optional(),search:t.string().trim().max(200).optional(),afterId:C.optional(),limit:t.number().int().min(1).max(100).default(30)}).strict(),Or=t.object({definition:T,maximumCostUsd:t.number().finite().positive().max(1e4),graders:t.array(re).min(1).max(100)}).strict();function pt(o){let e=Jt.parse(o),{contentHash:n,...r}=e;if(n!==p(r)||e.request.teamId!==e.teamId||!e.request.name)throw new Error("Experiment definition differs from its immutable content.");if(new Set(e.graders.map(s=>s.feedbackKey)).size!==e.graders.length)throw new Error("Experiment feedback keys must be distinct.");return e}c(pt,"verifyExperimentDefinition");var Se=c(o=>({id:o.id,revision:o.revision,contentHash:o.contentHash}),"experimentDefinitionRef");var $=t.string().trim().min(1).max(200),Pe=t.object({operationId:$,execution:Ae,graders:t.array(Ue).min(1).max(100),maximumCostUsd:t.number().finite().min(1e-6).max(1e4),mappings:t.array(t.object({graderId:$,fields:U}).strict()).max(100).optional()}).strict().superRefine((o,e)=>{new Set(o.graders.map(n=>n.id)).size!==o.graders.length&&e.addIssue({code:"custom",path:["graders"],message:"Select each grader once."}),o.mappings&&(new Set(o.mappings.map(n=>n.graderId)).size!==o.mappings.length||o.mappings.some(n=>!o.graders.some(r=>r.id===n.graderId)))&&e.addIssue({code:"custom",path:["mappings"],message:"Map each selected grader at most once."})}),Gt=t.object({schemaVersion:t.literal("openpond.experimentScoringPass.v1"),id:$,teamId:$,revision:t.number().int().positive(),request:Pe,graders:t.array(re).min(1).max(100),status:t.enum(["queued","running","cancelling","completed","failed","cancelled"]),totalCount:t.number().int().min(1).max(1e4),counts:t.object({pending:t.number().int().nonnegative(),running:t.number().int().nonnegative(),scored:t.number().int().nonnegative(),unavailable:t.number().int().nonnegative(),failed:t.number().int().nonnegative(),cancelled:t.number().int().nonnegative()}).strict(),resultAvailable:t.boolean(),createdAt:t.iso.datetime(),startedAt:t.iso.datetime().nullable(),completedAt:t.iso.datetime().nullable(),error:t.object({code:$,message:t.string().max(2e3)}).strict().nullable()}).strict(),Vt=Gt.extend({contentHash:t.string().regex(/^[a-f0-9]{64}$/)});function mt(o){let e=Vt.parse(o),{contentHash:n,...r}=e;if(p(r)!==n||Object.values(e.counts).reduce((i,a)=>i+a,0)!==e.totalCount)throw new Error("Scoring pass integrity or population accounting failed.");let s=["completed","failed","cancelled"].includes(e.status);if(s&&(!e.completedAt||e.counts.pending||e.counts.running)||!s&&(e.completedAt!==null||e.resultAvailable)||e.status==="completed"&&!e.resultAvailable)throw new Error("Scoring pass lifecycle differs from its retained result.");if(e.graders.length!==e.request.graders.length||new Set(e.graders.map(i=>i.feedbackKey)).size!==e.graders.length||e.graders.some((i,a)=>p(i.release)!==p(e.request.graders[a])||p(i.mappings??[])!==p(e.request.mappings?.find(d=>d.graderId===i.release?.id)?.fields??[])))throw new Error("Scoring pass graders differ from their exact admission.");return e}c(mt,"verifyExperimentScoringPass");var u=t.string().trim().min(1).max(200),ke=class extends Error{constructor(n,r,s){super(s);this.status=n;this.code=r;this.name="OpenPondExperimentError"}status;code;static{c(this,"OpenPondExperimentError")}},oe=class{constructor(e){this.options=e;let n=new URL(e.baseUrl);if(!["http:","https:"].includes(n.protocol)||n.username||n.password||n.search||n.hash||!e.apiKey.trim()||!e.teamId.trim())throw new Error("A clean API origin and workspace credentials are required.");this.baseUrl=n.toString().replace(/\/+$/,"")}options;static{c(this,"OpenPondExperimentsClient")}baseUrl;async save(e,n){let r=ct.parse(e);if(r.request.teamId!==this.options.teamId)throw new Error("Experiment workspace mismatch.");let s=this.definition(await this.request("","POST",r,n),r.id);if(s.revision!==r.expectedRevision+1||p(s.request)!==p(r.request)||s.maximumCostUsd!==r.maximumCostUsd)throw new Error("Experiment save receipt differs from its submitted configuration.");if(r.graders&&p(r.graders)!==p(s.graders.map(i=>({id:i.id,version:i.version,contentHash:i.contentHash,mappings:i.mappings??[]}))))throw new Error("Experiment save receipt differs from its selected graders or mappings.");return s}async get(e,n={}){let r=n.reference?T.parse(n.reference):void 0;if(r&&r.id!==e)throw new Error("Experiment reference identity mismatch.");let s=r?`?${new URLSearchParams({revision:String(r.revision),contentHash:r.contentHash})}`:"",i=this.definition(await this.request(`/${encodeURIComponent(u.parse(e))}${s}`,"GET",void 0,n.signal),e);if(n.reference&&p(Se(i))!==p(n.reference))throw new Error("Experiment revision mismatch.");return i}async list(e={},n){let r=lt.parse(e),s=new URLSearchParams(Object.entries(r).map(([d,y])=>[d,String(y)])),i=t.object({items:t.array(t.unknown()).max(100),nextCursor:u.nullable()}).strict().parse(await this.request(`?${s}`,"GET",void 0,n)),a=i.items.map(d=>this.definition(d));if(a.length>r.limit||new Set(a.map(d=>d.id)).size!==a.length||a.some(d=>r.projectId&&d.request.project?.id!==r.projectId||r.datasetHash&&d.request.taskset.contentHash!==r.datasetHash))throw new Error("Experiment page differs from its selected scope.");return{items:a,nextCursor:i.nextCursor}}async start(e,n){let r=dt.parse(e),s=t.object({definition:t.unknown(),run:t.unknown()}).strict().parse(await this.request(`/${encodeURIComponent(r.definition.id)}/start`,"POST",r,n)),i=this.definition(s.definition,r.definition.id);if(p(Se(i))!==p(r.definition))throw new Error("Experiment Start revision mismatch.");let a=await ne(s.run);if(a.summary.teamId!==this.options.teamId||a.request.operationId!==r.operationId||p(a.request)!==p({...i.request,operationId:r.operationId})||p(a.manifest.metadata.experimentDefinition)!==p(r.definition)||a.manifest.metadata.experimentConfigurationHash!==p({definition:r.definition,maximumCostUsd:i.maximumCostUsd,graders:i.graders}))throw new Error("Experiment execution differs from its saved configuration.");return a}async result(e,n){let r=t.object({executionId:u,passId:u.nullable(),manifest:t.unknown(),result:t.unknown()}).strict().parse(await this.request(`/executions/${encodeURIComponent(u.parse(e))}/result`,"GET",void 0,n)),s=ge(r);if(r.executionId!==e||s.manifest.teamId!==this.options.teamId||s.manifest.lineage?.execution.id!==e||s.manifest.lineage.scoringPassId!==r.passId)throw new Error("Experiment result identity mismatch.");return{...s,executionId:e,passId:r.passId}}async executions(e,n={}){let r=new URLSearchParams(n.afterId?{afterId:u.parse(n.afterId)}:{}),s=t.object({items:t.array(t.unknown()).max(30),nextCursor:u.nullable()}).strict().parse(await this.request(`/${encodeURIComponent(u.parse(e))}/executions?${r}`,"GET",void 0,n.signal)),i=await Promise.all(s.items.map(a=>ne(a)));if(i.some(a=>a.summary.teamId!==this.options.teamId||T.parse(a.manifest.metadata.experimentDefinition).id!==e)||new Set(i.map(a=>a.summary.id)).size!==i.length)throw new Error("Experiment execution page has invalid ownership or repeated identities.");return{items:i,nextCursor:s.nextCursor}}async execution(e,n){return this.executionDetails(await this.request(`/executions/${encodeURIComponent(u.parse(e))}`,"GET",void 0,n),e)}async cancel(e,n){return this.executionDetails(await this.request(`/executions/${encodeURIComponent(u.parse(e))}/cancel`,"POST",{},n),e)}async retry(e,n,r){let s=await this.executionDetails(await this.request(`/executions/${encodeURIComponent(u.parse(e))}/retry`,"POST",{operationId:u.parse(n)},r));if(s.request.operationId!==n)throw new Error("Experiment retry operation mismatch.");return s}async score(e,n){let r=Pe.parse(e),s=this.pass(await this.request(`/executions/${encodeURIComponent(r.execution.id)}/scoring-passes`,"POST",r,n));if(p(s.request)!==p(r))throw new Error("Scoring admission differs from its submitted inputs.");return s}async scoringPass(e,n){return this.pass(await this.request(`/scoring-passes/${encodeURIComponent(u.parse(e))}`,"GET",void 0,n),e)}async scoringPasses(e,n={}){let r=new URLSearchParams(n.afterId?{afterId:u.parse(n.afterId)}:{}),s=t.object({items:t.array(t.unknown()).max(30),nextCursor:u.nullable()}).strict().parse(await this.request(`/executions/${encodeURIComponent(u.parse(e))}/scoring-passes?${r}`,"GET",void 0,n.signal)),i=s.items.map(a=>this.pass(a));if(i.some(a=>a.request.execution.id!==e)||new Set(i.map(a=>a.id)).size!==i.length)throw new Error("Scoring pass page differs from its execution ownership.");return{items:i,nextCursor:s.nextCursor}}async cancelScoringPass(e,n){return this.pass(await this.request(`/scoring-passes/${encodeURIComponent(u.parse(e))}/cancel`,"POST",{},n),e)}async scoringResult(e,n){let r=t.object({executionId:u,passId:u,manifest:t.unknown(),result:t.unknown()}).strict().parse(await this.request(`/scoring-passes/${encodeURIComponent(u.parse(e))}/result`,"GET",void 0,n)),s=ge(r);if(r.passId!==e||s.manifest.teamId!==this.options.teamId||s.manifest.id!==e||s.manifest.lineage?.execution.id!==r.executionId||s.manifest.lineage.scoringPassId!==e)throw new Error("Scoring result identity mismatch.");return{...s,executionId:r.executionId,passId:e}}async compare(e,n,r){let s=c(d=>d.startsWith("score_")?this.scoringResult(d,r):this.result(d,r),"read"),[i,a]=await Promise.all([s(e),s(n)]);return{baseline:i,candidate:a,comparison:Ge(i,a)}}definition(e,n){let r=pt(e);if(r.teamId!==this.options.teamId||n&&r.id!==n)throw new Error("Experiment identity mismatch.");return r}async executionDetails(e,n){let r=await ne(e);if(r.summary.teamId!==this.options.teamId||n&&r.summary.id!==n)throw new Error("Experiment execution identity mismatch.");return r}pass(e,n){let r=mt(e);if(r.teamId!==this.options.teamId||n&&r.id!==n)throw new Error("Scoring pass identity mismatch.");return r}async request(e,n,r,s){let i=await(this.options.fetch??fetch)(`${this.baseUrl}/v1/experiments${e}`,{method:n,signal:s,redirect:"error",headers:{Authorization:`Bearer ${this.options.apiKey}`,"X-OpenPond-Team-Id":this.options.teamId,"Content-Type":"application/json",Accept:"application/json"},...r===void 0?{}:{body:JSON.stringify(r)}}),a=await i.json();if(!i.ok){let d=t.object({code:t.string(),message:t.string()}).safeParse(a);throw new ke(i.status,d.success?d.data.code:"experiment_request_failed",d.success?d.data.message:"Experiment request failed.")}return a}};function ut(o,e){return{supportsResume:!e,get:c((...n)=>o.get(...n),"get"),start:e?async()=>{throw new Error("This runtime does not support resuming a stopped guest; start fresh Work with saved outputs")}:(...n)=>o.start(...n),exec:c((n,r)=>o.exec(n,e?{...r,timeoutSeconds:Math.min(r.timeoutSeconds??30,60)}:r),"exec"),mkdir:c((...n)=>o.mkdir(...n),"mkdir"),uploadFile:c((...n)=>o.uploadFile(...n),"uploadFile"),uploadFileBase64:c((...n)=>o.uploadFileBase64(...n),"uploadFileBase64"),listFiles:c((...n)=>o.listFiles(...n),"listFiles"),downloadFileResponse:c((...n)=>o.downloadFileResponse(...n),"downloadFileResponse"),stop:c((...n)=>o.stop(...n),"stop"),delete:c((...n)=>o.delete(...n),"delete"),createWork:c(({requestId:n,repo:r,budgetUsd:s,metadata:i})=>{if(e){if(r?.trim())throw new Error("This runtime does not support repository provisioning; provide Work inputs instead");if(s!==void 0)throw new Error("Hosted spending budgets are not supported by this runtime");let d={resources:e.resources??{cpu:1,memoryGb:2,diskGb:10},...n?{requestId:n}:{}};return o.create(d)}let a=s?.trim()||"1.00";return o.create({...r?.trim()?{repo:r.trim()}:{},runtimeProfileId:"openpond-work-v1",resources:{cpu:2,memoryGb:4,diskGb:16},budget:{maxUsd:a},quotas:{maxSpendUsd:a,maxDurationSeconds:3600,idleTimeoutSeconds:900,maxCommands:200,maxOpenPorts:4},metadata:{source:"openpond-sdk-work",...i,...n?{workRequestId:n}:{}}},{async:!0})},"createWork")}}c(ut,"workSandbox");function Re(o,e){let n=new URL(o);if(!["http:","https:"].includes(n.protocol)||n.username||n.password||n.search||n.hash)throw new Error(`${e} must be an HTTP(S) endpoint without embedded credentials, query or fragment`);return n.toString().replace(/\/$/,"")}c(Re,"configuredEndpoint");function se(o,e){if(!o?.trim())throw new Error(`${e} is required`);return o.trim()}c(se,"configuredKey");var Yt=t.object({choices:t.array(t.object({message:t.object({content:t.string().nullable().optional(),tool_calls:t.array(t.object({id:t.string().min(1),type:t.literal("function"),function:t.object({name:t.string().min(1),arguments:t.string()})})).optional()})})).min(1)});async function gt(o,e){if(!e)return he(o);let n=await fetch(`${o.apiBaseUrl}/chat/completions`,{method:"POST",headers:{authorization:`Bearer ${o.token}`,"content-type":"application/json"},body:JSON.stringify({model:o.model,messages:o.messages,tools:o.tools,tool_choice:"auto",stream:!1}),signal:o.signal,redirect:"error"});if(!n.ok)throw new Error(`Configured model request failed (${n.status})`);return Yt.parse(await n.json())}c(gt,"workModelTurn");var Xt="openpond-chat",Qt=24,Zt=4e4,Ie=2e4,Oe="outputs",ve="inputs/previous-outputs",bt="inputs/.openpond-context.json",en=100,ft=100,ht=100*1024*1024,D=class{static{c(this,"OpenPondWorkClient")}#e;#n;#t;#r;#o;#s;constructor(e){this.#e=e.apiKey,this.#n=e.apiBaseUrl,this.#t=e.chatApiBaseUrl,this.#r=ut(e.sandboxes,e.sandboxConfig),this.#o=e.defaultModel??Xt,this.#s=e.customModel??!1}async run(e){let n=e.prompt.trim();if(!n)throw new Error("Work prompt is required");e.signal?.throwIfAborted();let r=c(async b=>e.onEvent?.(b),"emit"),s=e.cleanup??"keep",i=rn(s),a=null,d=null,y=!1,x=xt(e.maxSteps,1,100,Qt),g="";try{await r({type:"status",message:"Preparing sandbox"}),a=await this.#g(e),await r({type:"sandbox",sandboxId:a.id,state:a.state}),await this.#m(a.id,e.inputs??[]),d=await this.#u(a.id);let b=[{role:"system",content:nn(a.id,(e.inputs?.length??0)>0)},...(e.history??[]).map(w=>({...w})),{role:"user",content:n}];for(let w=1;w<=x;w+=1){e.signal?.throwIfAborted(),await r({type:"status",message:`Thinking \xB7 step ${w}`});let _e=(await gt({apiBaseUrl:this.#t,token:this.#e,model:e.model?.trim()||this.#o,messages:b,tools:tn,toolChoice:"auto",signal:e.signal,metadata:{source:"openpond-sdk-work",sandboxId:a.id,apiBaseUrl:this.#n,...e.metadata}},this.#s)).choices?.[0],G=_e?.message?.content?.trim()??"",V=_e?.message?.tool_calls??[];if(b.push({role:"assistant",content:G||null,...V.length>0?{tool_calls:V}:{}}),G&&(g=G,await r({type:"assistant",text:G})),V.length===0){let q=await this.#d(a.id,d);for(let de of q)await r({type:"output",output:de});y=!0,await this.#i(a.id,q,e,i,r);let Y={sandboxId:a.id,text:g,steps:w,outputs:q,lifecycle:i};return await r({type:"done",...Y}),Y}for(let[q,Y]of V.entries()){e.signal?.throwIfAborted();let de=await this.#f(a.id,Y,q,e.timeoutSeconds,r);b.push(de)}}throw new Error(`Work did not finish within ${x} steps`)}catch(b){if(a&&d&&!y)try{let w=await this.#d(a.id,d);for(let Ee of w)await r({type:"output",output:Ee});await this.#i(a.id,w,e,i,r)}catch(w){yt(b,i,w)}throw yt(b,i),b}}async deleteSandbox(e){try{if((await this.#r.get(e)).state==="deleted")return;await this.#r.delete(e)}catch(n){if(n instanceof Q&&n.status===404)return;throw n}}async#m(e,n){if(n.length===0)return;if(n.length>ft)throw new Error(`Work inputs exceed the ${ft} file limit`);if(n.reduce((a,d)=>a+Buffer.byteLength(d.contentsBase64,"base64"),0)>ht)throw new Error(`Work inputs exceed the ${ht} byte limit`);await this.#r.mkdir(e,{path:ve,recursive:!0});let s=new Set,i=[];for(let[a,d]of n.entries()){let y=sn(d,a,s),x=`${ve}/${y}`;await this.#r.uploadFileBase64(e,x,d.contentsBase64),i.push({id:d.id,path:x,name:d.name,mimeType:d.mimeType??null,checksumSha256:d.checksumSha256??null,revision:d.revision??null,metadata:d.metadata??{}})}await this.#r.uploadFile(e,bt,JSON.stringify({version:1,files:i},null,2))}async#i(e,n,r,s,i){if(s.persistence.outputCount=n.length,n.length===0)s.persistence.status="not_needed";else if(r.persistOutput){s.persistence.status="running";for(let a of n){await i({type:"persistence",output:a,status:"started"});try{let d=on(this.#r,e,a);await r.persistOutput({output:a,download:d}),s.persistence.persistedCount+=1,await i({type:"persistence",output:a,status:"succeeded"})}catch(d){let y=B(d);throw s.persistence.status="failed",s.persistence.error=y,await i({type:"persistence",output:a,status:"failed",error:y}),(r.cleanup??"keep")!=="keep"&&await this.#a(e,s,i),d}}s.persistence.status="complete"}else{if((r.cleanup??"keep")==="delete"&&!r.discardOutputs)throw s.persistence.status="failed",s.persistence.error="Deleting a Work sandbox with outputs requires persistOutput or discardOutputs: true",await this.#a(e,s,i),new Error(s.persistence.error);s.persistence.status="not_requested"}await this.#c(e,r.cleanup??"keep",s,i)}async#a(e,n,r){if(this.#r.supportsResume){await this.#c(e,"stop",n,r);return}n.cleanup.status="pending",n.cleanup.finalSandboxState="running",n.cleanup.error="Output persistence must be retried before guest deletion",await r({type:"cleanup",policy:n.cleanupPolicy,status:"pending",sandboxState:"running",error:n.cleanup.error})}async#c(e,n,r,s){if(n!=="keep"){r.cleanup.status="running",await s({type:"cleanup",policy:n,status:"started"});try{let i=n==="delete"?await this.#r.delete(e):(await this.#r.stop(e)).sandbox;r.cleanup.finalSandboxState=i.state,r.cleanup.status=n==="delete"&&i.state==="deleted"||n==="stop"&&i.state==="stopped"?"complete":"pending",await s({type:"cleanup",policy:n,status:r.cleanup.status,sandboxState:i.state})}catch(i){let a=B(i);throw r.cleanup.status="failed",r.cleanup.error=a,await s({type:"cleanup",policy:n,status:"failed",error:a}),i}}}downloadOutput(e,n){return this.#r.downloadFileResponse(e,typeof n=="string"?n:n.path)}async#u(e){return await this.#r.mkdir(e,{path:Oe,recursive:!0}),an(await this.#l(e))}async#d(e,n){return(await this.#l(e)).filter(s=>n.get(s.path)!==wt(s)).sort((s,i)=>s.path.localeCompare(i.path)).slice(0,en).map(cn)}async#l(e){return(await this.#r.listFiles(e,{path:Oe,recursive:!0,maxEntries:500})).files.filter(r=>r.type==="file"&&!St(r.path).includes("/.openpond-"))}async#g(e){if(e.sandboxId){let r=await this.#r.get(e.sandboxId);if(r.state==="stopped")await this.#r.start(r.id,{async:!0});else if(r.state==="deleted"||r.state==="error")throw new Error(`Cannot resume sandbox ${r.id} in state ${r.state}`);return await this.#p(r.id,e.signal)}let n=await this.#r.createWork(e);return this.#p(n.id,e.signal)}async#p(e,n){let r=Date.now()+72e4,s=await this.#r.get(e);for(;Date.now()<r;){if(n?.throwIfAborted(),s.state==="running")return s;if(s.state==="error"||s.state==="deleted")throw new Error(`Sandbox ${s.id} entered ${s.state}${s.logs.length?`: ${s.logs.join(`
|
|
3
|
-
`)}`:""}`);await mn(2e3,n),s=await this.#r.get(e)}throw new Error(`Sandbox ${e} did not become ready before timeout`)}async#f(e,n,r,s,i){let a=n.id||`work_tool_${r}`,d=n.function?.name;if(d!=="run_command")return M(a,{error:`Unknown tool: ${d??"missing"}`});let y;try{y=JSON.parse(n.function?.arguments||"{}")}catch(g){return M(a,{error:`Invalid tool arguments: ${B(g)}`})}let x=typeof y.command=="string"?y.command.trim():"";if(!x)return M(a,{error:"command is required"});if(x.length>Ie){let g=`command exceeds the ${Ie} character limit`;return await i({type:"tool",toolCallId:a,command:x,status:"failed",output:g}),M(a,{status:"failed",error:g})}await i({type:"tool",toolCallId:a,command:x,status:"started"});try{let g=await this.#r.exec(e,{command:x,timeoutSeconds:xt(s,1,900,180)}),b=pn(g.command.output,Zt),w=g.command.status==="succeeded"?"succeeded":"failed";return await i({type:"tool",toolCallId:a,command:x,status:w,output:b,exitCode:g.command.exitCode}),M(a,{status:g.command.status,exitCode:g.command.exitCode,output:b})}catch(g){if(g instanceof Q)throw g;let b=B(g);return await i({type:"tool",toolCallId:a,command:x,status:"failed",output:b}),M(a,{status:"failed",error:b})}}},tn=[{type:"function",function:{name:"run_command",description:"Run a shell command inside the persistent OpenPond sandbox. Use standard shell tools to inspect, edit, build, and test files. Commands start in the repository workspace.",parameters:{type:"object",additionalProperties:!1,properties:{command:{type:"string",minLength:1,maxLength:Ie,description:"Shell command to execute."}},required:["command"]}}}];function nn(o,e){return["You are OpenPond Work, a careful coding agent operating in an isolated Linux sandbox.",`The active sandbox is ${o}.`,...e?[`The authoritative saved files for this turn are staged under /workspace/${ve}; their manifest is /workspace/${bt}.`,"Before revising a previous output, read its staged file and manifest. Copy the staged input into the output directory before editing it; previous output paths may not exist in this sandbox.","Preserve the actual file bytes. Never reconstruct a saved file from the conversation or claim to have preserved it without reading the staged input."]:[],"Use run_command to inspect the workspace, edit files, and validate your work.",`Place completed user-facing files in ${Oe}. The runtime collects new and revised files there automatically when the turn completes.`,"Do the requested work completely. Preserve existing user changes and avoid destructive commands.","Keep the user informed with concise prose, but call tools whenever verification or file changes are needed.","Before finishing, run relevant tests and summarize the concrete result."].join(`
|
|
4
|
-
`)}c(nn,"systemPrompt");function rn(o){return{cleanupPolicy:o,persistence:{status:"not_requested",outputCount:0,persistedCount:0},cleanup:{status:"not_requested"}}}c(rn,"initialLifecycle");function on(o,e,n){let r=null;return()=>(r??=o.downloadFileResponse(e,{path:n.path,maxBytes:Math.max(1,n.sizeBytes)}).then(s=>{let i=Buffer.byteLength(s.file.contentsBase64,"base64");if(s.file.truncated||s.file.returnedBytes!==s.file.totalSizeBytes||i!==n.sizeBytes)throw new Error(`Output download was incomplete for ${n.name}`);return s}),r)}c(on,"lazyOutputDownload");function sn(o,e,n){let r=o.id.replace(/[^a-zA-Z0-9._-]+/g,"-").slice(0,80)||`input-${e+1}`,s=o.name.replace(/[^a-zA-Z0-9._-]+/g,"-").slice(-120)||"file",i=`${r}-${s}`,a=i,d=1;for(;n.has(a);)d+=1,a=`${i}-${d}`;return n.add(a),a}c(sn,"uniqueInputName");function yt(o,e,n){!o||typeof o!="object"||Object.assign(o,{workLifecycle:e,...n?{workFinalizationError:B(n)}:{}})}c(yt,"attachWorkFailure");function an(o){return new Map(o.map(e=>[e.path,wt(e)]))}c(an,"outputSignatures");function wt(o){return`${o.sizeBytes}:${o.updatedAt}`}c(wt,"outputSignature");function cn(o){let e=St(o.path).split("/").at(-1)||o.path,n=dn(e);return{path:o.path,name:e,mimeType:n,sizeBytes:o.sizeBytes,updatedAt:o.updatedAt,isBinary:o.isBinary??null,previewable:o.previewable??(n.startsWith("image/")||n==="application/pdf"||n.startsWith("text/"))}}c(cn,"workOutputFromFile");function St(o){return o.replaceAll("\\","/")}c(St,"normalizedOutputPath");function dn(o){let e=o.toLowerCase().match(/\.[^.]+$/)?.[0]??"";return ln[e]??"application/octet-stream"}c(dn,"workOutputMimeType");var ln=Object.freeze({".avif":"image/avif",".csv":"text/csv",".docx":"application/vnd.openxmlformats-officedocument.wordprocessingml.document",".gif":"image/gif",".html":"text/html",".jpeg":"image/jpeg",".jpg":"image/jpeg",".json":"application/json",".m4a":"audio/mp4",".md":"text/markdown",".mov":"video/quicktime",".mp3":"audio/mpeg",".mp4":"video/mp4",".pdf":"application/pdf",".png":"image/png",".pptx":"application/vnd.openxmlformats-officedocument.presentationml.presentation",".svg":"image/svg+xml",".tsv":"text/tab-separated-values",".txt":"text/plain",".wav":"audio/wav",".webm":"video/webm",".webp":"image/webp",".xlsx":"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"});function M(o,e){return{role:"tool",tool_call_id:o,content:JSON.stringify(e)}}c(M,"toolMessage");function xt(o,e,n,r){return Number.isFinite(o)?Math.min(n,Math.max(e,Math.floor(o))):r}c(xt,"boundedInteger");function pn(o,e){return o.length<=e?o:`${o.slice(0,e)}
|
|
5
|
-
\u2026 output truncated by openpond-sdk`}c(pn,"truncate");function B(o){return o instanceof Error?o.message:String(o)}c(B,"errorMessage");function mn(o,e){return new Promise((n,r)=>{if(e?.aborted){r(e.reason);return}let s=setTimeout(n,o);s.unref?.(),e?.addEventListener("abort",()=>{clearTimeout(s),r(e.reason)},{once:!0})})}c(mn,"sleep");import{promises as Pt}from"node:fs";var z=class{static{c(this,"OpenPondProjectActionsClient")}#e;#n;constructor(e){this.#e=e.apiKey,this.#n=e.apiBaseUrl.replace(/\/+$/,"")}async list(e){let n=await I(this.#n,this.#e,ie(e.projectId,"releases",e.teamId));return(await O(n,"List Project Action releases")).releases}async catalog(e){let n=await I(this.#n,this.#e,ie(e.projectId,"catalog",e.teamId));return(await O(n,"Get Project Action catalog")).catalog}async publish(e){let[n,r]=await Promise.all([Pt.readFile(e.build.bundlePath),Pt.readFile(e.build.runnerPath)]),s=await I(this.#n,this.#e,ie(e.projectId,"releases",e.teamId),{method:"POST",body:JSON.stringify({sourceRef:e.sourceRef,sourceCommitSha:e.sourceCommitSha,bundleBase64:n.toString("base64"),runnerBase64:r.toString("base64"),registry:e.build.registry,manifest:e.build.manifest,metadata:e.metadata})});return(await O(s,"Publish Project Actions")).release}async run(e){let n=await I(this.#n,this.#e,ie(e.projectId,`actions/${encodeURIComponent(e.actionId)}`,e.teamId),{method:"POST",body:JSON.stringify({input:e.value??{},releaseId:e.releaseId,idempotencyKey:e.idempotencyKey,callerType:e.callerType??"sdk",callerId:e.callerId}),signal:e.signal,timeoutMs:9e5});return(await O(n,"Run Project Action")).invocation}};function ie(o,e,n){return`/v1/project-actions/${encodeURIComponent(o)}/${e}?teamId=${encodeURIComponent(n)}`}c(ie,"projectActionPath");var K=class{static{c(this,"OpenPondProfileActionsClient")}#e;#n;constructor(e){this.#e=e.apiKey,this.#n=e.apiBaseUrl.replace(/\/+$/,"")}async catalog(e){let n=N(e.teamId,"teamId"),r=new URLSearchParams({teamId:n});e.profileId?.trim()&&r.set("profileId",e.profileId.trim()),e.profileName?.trim()&&r.set("profileName",e.profileName.trim());let s=await I(this.#n,this.#e,`/v1/profile/actions?${r.toString()}`);return(await O(s,"Get Profile Action catalog")).catalog}async run(e){let n=N(e.teamId,"teamId"),r=N(e.actionKey,"actionKey"),s=N(e.idempotencyKey,"idempotencyKey"),i=N(e.catalogVersion,"catalogVersion"),a=await I(this.#n,this.#e,`/v1/profile/actions/run?${new URLSearchParams({teamId:n}).toString()}`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({...e.profileId?.trim()?{profileId:e.profileId.trim()}:{},...e.profileName?.trim()?{profileName:e.profileName.trim()}:{},actionKey:r,value:e.value??{},conversationId:e.conversationId??null,createConversation:e.createConversation,conversationTitle:e.conversationTitle??null,idempotencyKey:s,catalogVersion:i,externalCapabilityLeases:e.externalCapabilityLeases})});return O(a,"Run Profile Action")}};function N(o,e){let n=o.trim();if(!n)throw new Error(`${e} is required`);return n}c(N,"requiredValue");import{randomUUID as kt}from"node:crypto";var F=class{static{c(this,"OpenPondWorkflowsClient")}#e;#n;constructor(e){this.#e=e.apiKey,this.#n=e.apiBaseUrl.replace(/\/+$/,"")}async list(e={}){return this.#t("","List Workflows",{signal:e.signal})}async create(e,n={}){return this.#t("","Create Workflow",{method:"POST",body:JSON.stringify({...e,clientRequestId:e.clientRequestId?.trim()||kt()}),signal:n.signal})}async update(e,n,r={}){return this.#t(`/schedules/${encodeURIComponent(Ce(e,"scheduleId"))}`,"Update Workflow",{method:"PATCH",body:JSON.stringify(n),signal:r.signal})}async delete(e,n={}){return this.#t(`/schedules/${encodeURIComponent(Ce(e,"scheduleId"))}`,"Delete Workflow",{method:"DELETE",signal:n.signal})}async runNow(e,n={},r={}){return this.#t(`/schedules/${encodeURIComponent(Ce(e,"scheduleId"))}/run`,"Run Workflow",{method:"POST",body:JSON.stringify({clientRequestId:n.clientRequestId?.trim()||kt()}),signal:r.signal})}async#t(e,n,r={}){let s=await I(this.#n,this.#e,`/v1/saved-work${e}`,r);return O(s,n)}};function Ce(o,e){let n=o.trim();if(!n)throw new Error(`${e} is required`);return n}c(Ce,"requiredId");var ae=t.object({id:f,scope:f,sourceId:f,name:t.string().trim().min(1).max(100),keyPrefix:t.string().min(1).max(100),createdAt:t.iso.datetime(),expiresAt:t.iso.datetime(),revokedAt:t.iso.datetime().nullable()}).strict(),Rt=t.string().regex(/^opk_key_[A-Za-z0-9]{16}_[A-Za-z0-9]{48}$/),ce=t.discriminatedUnion("action",[t.object({action:t.literal("create"),scope:f,sourceId:f,name:t.string().trim().min(1).max(100),expiresAt:t.iso.datetime(),operationId:f,apiKey:Rt}).strict(),t.object({action:t.literal("list"),scope:f,sourceId:f,afterId:f.optional(),limit:t.number().int().min(1).max(100).default(30)}).strict(),t.object({action:t.literal("revoke"),scope:f,sourceId:f,id:f}).strict()]),It=t.object({credential:ae,apiKey:Rt}).strict(),Ot=t.object({items:t.array(ae).max(100),nextCursor:f.nullable()}).strict(),vt=t.object({scope:f,sourceId:f}).strict(),Ct=t.object({scope:f,source:pe,taskDefinition:pe,enabled:t.boolean(),allowedSplits:t.array(Le).min(1).max(4)}).strict();var un=t.object({batchId:t.string().trim().min(1).max(500),modelProjectId:t.string().trim().min(1).max(500)}).strict(),gn=t.object({batchId:t.string().min(1),projectId:t.string().min(1),tasksetId:t.string().min(1),releaseId:t.string().min(1),revision:t.number().int().positive(),contentHash:t.string().regex(/^[a-f0-9]{64}$/)}).strict(),h=class extends Error{constructor(n,r,s,i){super(s);this.status=n;this.code=r;this.details=i;this.name="OpenPondLearningError"}status;code;details;static{c(this,"OpenPondLearningError")}},J=class{static{c(this,"OpenPondLearningClient")}#e;constructor(e){if(!e.apiKey.trim()||!e.scope.trim())throw new Error("Learning API key and scope are required.");let n=new URL(e.baseUrl);if(!["http:","https:"].includes(n.protocol)||n.username||n.password||n.search||n.hash)throw new Error("Learning base URL must be an HTTP(S) endpoint without credentials, query, or fragment.");this.#e={...e,baseUrl:n.toString().replace(/\/+$/,"")}}async command(e,n={}){ze(e);let r=Ne.parse({scope:this.#e.scope,command:e}),s=Fe.parse(await this.#t("commands",r,n));if(s.operationId!==e.operationId)throw new h(502,"operation_identity_mismatch","Learning response did not match the submitted operation.",null);return s}submitExample(e,n={}){return this.command({action:"submit_example",operationId:e.idempotencyKey,example:e},n)}submitFeedback(e,n={}){return this.command({action:"submit_feedback",operationId:e.idempotencyKey,feedback:e},n)}async get(e,n,r,s={}){let i=A.parse({action:"get",scope:this.#e.scope,kind:e,id:n,...r===void 0?{}:{revision:r}});return ue[e].parse(await this.#t("read",i,s))}async inspectEvidence(e,n={}){let r=A.parse({action:"inspect_evidence",scope:this.#e.scope,evidence:e}),s=Ke.parse(await this.#t("read",r,n));if(!me(s.evidence,e))throw new h(502,"evidence_identity_mismatch","Inspection did not match the requested evidence release.",null);return s}async inspectTaskQueue(e=null,n={}){let r=A.parse({action:"inspect_task_queue",scope:this.#e.scope,modelProjectId:e}),s=De.parse(await this.#t("read",r,n));if(s.modelProjectId!==e)throw new h(502,"model_identity_mismatch","Task queue did not match the requested Model.",null);return s}async inspectPolicy(e,n={}){let r=A.parse({action:"inspect_policy",scope:this.#e.scope,policy:e}),s=Be.parse(await this.#t("read",r,n));if(!me(s.policy,e))throw new h(502,"policy_identity_mismatch","Inspection did not match the requested policy release.",null);return s}async createSourceCredential(e,n={}){let r=ce.parse({...e,action:"create",scope:this.#e.scope}),s=It.parse(await this.#t("credentials",r,n));if(this.#n(s.credential,e.sourceId),s.apiKey!==e.apiKey||!e.apiKey.startsWith(`${s.credential.keyPrefix}_`))throw new h(502,"credential_identity_mismatch","Credential response did not match the prepared credential.",null);return s}async listSourceCredentials(e,n={},r={}){let s=ce.parse({...n,action:"list",scope:this.#e.scope,sourceId:e}),i=Ot.parse(await this.#t("credentials",s,r));if(i.items.length>(n.limit??30))throw new h(502,"credential_page_invalid","Credential response exceeded the requested page size.",null);for(let a of i.items)this.#n(a,e);return i}async revokeSourceCredential(e,n,r={}){let s=ce.parse({action:"revoke",scope:this.#e.scope,sourceId:e,id:n}),i=ae.parse(await this.#t("credentials",s,r));if(this.#n(i,e),i.id!==n||i.revokedAt===null)throw new h(502,"credential_revocation_mismatch","Credential revocation did not match the requested credential.",null);return i}async sourceConfiguration(e,n={}){let r=vt.parse({scope:this.#e.scope,sourceId:e}),s=Ct.parse(await this.#t("source-config",r,n));if(s.scope!==this.#e.scope||s.source.id!==e)throw new h(502,"source_identity_mismatch","Source configuration did not match the requested source.",null);return s}#n(e,n){if(e.scope!==this.#e.scope||e.sourceId!==n)throw new h(502,"credential_scope_mismatch","Credential response did not match the requested source.",null)}async list(e,n={},r={}){let s=A.parse({action:"list",scope:this.#e.scope,kind:e,...n});return t.object({items:t.array(ue[e]).max(100),nextCursor:t.string().nullable()}).strict().parse(await this.#t("read",s,r))}async publishBatch(e,n={}){let r=un.parse(e),s=gn.parse(await this.#t("publish-batch",{...r,scope:this.#e.scope},n));if(s.batchId!==r.batchId)throw new h(502,"batch_identity_mismatch","Published batch response did not match the requested batch.",null);return s}async#t(e,n,r){le(n,16777216);let s=await(this.#e.fetch??globalThis.fetch)(`${this.#e.baseUrl}/v1/learning/${e}`,{method:"POST",headers:{Authorization:`Bearer ${this.#e.apiKey}`,"Content-Type":"application/json",Accept:"application/json","X-OpenPond-Team-Id":this.#e.scope},body:JSON.stringify(n),signal:r.signal,redirect:"error"}),i=await fn(s);if(!s.ok){let a=t.object({code:t.string().optional(),error:t.string().optional()}).passthrough().safeParse(i);throw new h(s.status,a.success?a.data.code??"learning_request_failed":"learning_request_failed",a.success?a.data.error??`Learning request failed (${s.status}).`:`Learning request failed (${s.status}).`,i)}return i}};async function fn(o){let n=o.body?.getReader();if(!n)throw new h(o.status,"empty_response","Learning response was empty.",null);let r=new TextDecoder,s=0,i="";try{for(;;){let d=await n.read();if(d.done)break;if(s+=d.value.byteLength,s>16777216)throw new h(o.status,"response_too_large","Learning response exceeded 16 MiB; request a smaller page.",null);i+=r.decode(d.value,{stream:!0})}i+=r.decode();let a=JSON.parse(i);return le(a,16777216),a}finally{await n.cancel(),n.releaseLock()}}c(fn,"readBoundedLearningResponse");var je=class{static{c(this,"OpenPondClient")}sandboxes;work;workflows;actions;profileActions;learning;experiments;constructor(e){let n=e.apiKey?.trim()??"";if(!n&&(!e.sandbox||!e.model))throw new Error("OpenPond API key is required when using a default sandbox or model");let r=e.sandbox?{...e.sandbox,endpoint:Re(e.sandbox.endpoint,"Sandbox endpoint"),apiKey:se(e.sandbox.apiKey,"Sandbox API key")}:void 0,s=e.model?{endpoint:Re(e.model.endpoint,"Model endpoint"),apiKey:se(e.model.apiKey,"Model API key"),model:se(e.model.model,"Model ID")}:void 0,i=e.baseUrl?.trim()||"https://api.openpond.ai";this.learning=a=>new J({apiKey:n,baseUrl:i,scope:a}),this.experiments=a=>new oe({apiKey:n,baseUrl:i,teamId:a}),this.sandboxes=Xe({apiKey:r?.apiKey??n,baseUrl:i,sandboxApiUrl:r?.endpoint??e.sandboxApiUrl,customEndpoint:!!r}),this.work=new D({apiKey:s?.apiKey??n,apiBaseUrl:i,chatApiBaseUrl:s?.endpoint||e.chatApiUrl?.trim()||fe({apiBaseUrl:i,env:{}}),sandboxes:this.sandboxes,sandboxConfig:r,defaultModel:s?.model,customModel:!!s}),this.workflows=new F({apiKey:n,apiBaseUrl:i}),this.actions=new z({apiKey:n,apiBaseUrl:i}),this.profileActions=new K({apiKey:n,apiBaseUrl:i})}};function Qo(o){return new je(o)}c(Qo,"createOpenPondClient");export{P as a,_ as b,k as c,L as d,At as e,ct as f,dt as g,Se as h,Pe as i,oe as j,Qo as k};
|
|
@@ -1,2 +0,0 @@
|
|
|
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-ZCDOE3EO.js";import"./chunk-KNEMKYHY.js";import"./chunk-25OT6IYM.js";import"./chunk-GKRTXVNT.js";import"./chunk-OCWH4BV7.js";import"./chunk-PKBU37CH.js";import"./chunk-V5BC6QT2.js";import"./chunk-XHJUP7M4.js";import"./chunk-7BGT6Q2D.js";import"./chunk-SBBXUZWL.js";import"./chunk-L3KS6MOV.js";import"./chunk-SHCRE7B2.js";import"./chunk-MRGA6BKG.js";import"./chunk-6MI4KKWF.js";import"./chunk-WCZRDULE.js";import"./chunk-GIPSOLAY.js";import"./chunk-MJC26GOX.js";import"./chunk-JUX77H6K.js";import"./chunk-QUNRWDVO.js";import"./chunk-6FA3GG5B.js";import"./chunk-SDO4FC4Q.js";import"./chunk-IR3YJWPW.js";import"./chunk-QK2GLRCY.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 +0,0 @@
|
|
|
1
|
-
import { createRequire as __openpondCreateRequire } from "node:module"; var require = __openpondCreateRequire(import.meta.url);
|
|
2
|
-
import"./chunk-FUFIZ37W.js";import{c as w}from"./chunk-3HQEEZPO.js";import{c as S,f as I}from"./chunk-BSHAIAXY.js";import"./chunk-FKVP26MC.js";import"./chunk-P5CFBE6Z.js";import"./chunk-XWPC3AN4.js";import{c as s}from"./chunk-3M53YXEI.js";import"./chunk-OGPHXXCD.js";import{f as m,g as x,h,i as g,j as E}from"./chunk-TZNKOKQJ.js";import"./chunk-SHCKK3SU.js";import{d as p}from"./chunk-AOBTILU5.js";import{b as u}from"./chunk-GLUWATL5.js";import"./chunk-RELOOVWW.js";import"./chunk-GIPSOLAY.js";import"./chunk-MJC26GOX.js";import"./chunk-JUX77H6K.js";import"./chunk-QUNRWDVO.js";import"./chunk-QK2GLRCY.js";import"./chunk-HZP5U2AA.js";import"./chunk-ES2ISFJC.js";import"./chunk-H7IWJN7L.js";import{a as d}from"./chunk-FTQLQJQV.js";import{readFile as q,stat as y}from"node:fs/promises";async function D(n,o){let[e,i]=o,l=s(n,"team");if(!l||!e||o.length>(e==="compare"?3:2))throw new Error("usage: experiments <save|read|list|executions|start|status|cancel|retry|score|passes|pass|cancel-pass|pass-result|result|compare> [id] [candidate-id] --team <id> [--input-file <path>] [--operation-id <id>]");let f=await p(),_={teamId:l,apiKey:await w(f,I(f)),baseUrl:S(n)??f.apiBaseUrl??u},r=new E(_),t;if(e==="save"){let a=s(n,"inputFile");if(!a||i)throw new Error("Saving requires --input-file with the complete configuration and stable operationId.");if((await y(a)).size>1048576)throw new Error("Experiment input exceeds one MiB.");t=await r.save(m.parse(JSON.parse(await q(a,"utf8"))))}else if(e==="list"){if(i)throw new Error("List does not accept an Experiment id.");let a=s(n,"limit");t=await r.list({projectId:s(n,"project")||void 0,datasetHash:s(n,"datasetHash")||void 0,search:s(n,"search")||void 0,afterId:s(n,"afterId")||void 0,...a?{limit:Number(a)}:{}})}else{if(!i)throw new Error(`${e} requires an id.`);if(e==="read")t=await r.get(i);else if(e==="start"){let a=s(n,"operationId");if(!a)throw new Error("Start requires --operation-id. Reuse it after a transport failure; use a new id for another execution.");let c=await r.get(i);t=await r.start(x.parse({operationId:a,definition:h(c)}))}else if(e==="executions")t=await r.executions(i,{afterId:s(n,"afterId")||void 0});else if(e==="status")t=await r.execution(i);else if(e==="cancel")t=await r.cancel(i);else if(e==="retry"){let a=s(n,"operationId");if(!a)throw new Error("Retry requires a stable --operation-id for the new execution.");t=await r.retry(i,a)}else if(e==="score"){let a=s(n,"inputFile");if(!a||(await y(a)).size>1048576)throw new Error("Score requires --input-file containing an exact execution reference, grader releases and explicit ceiling, within one MiB.");let c=g.parse(JSON.parse(await q(a,"utf8")));if(c.execution.id!==i)throw new Error("Scoring input belongs to a different execution.");t=await r.score(c)}else if(e==="passes")t=await r.scoringPasses(i,{afterId:s(n,"afterId")||void 0});else if(e==="pass")t=await r.scoringPass(i);else if(e==="cancel-pass")t=await r.cancelScoringPass(i);else if(e==="pass-result")t=await r.scoringResult(i);else if(e==="result")t=await r.result(i);else if(e==="compare"){if(!o[2])throw new Error("Compare requires a baseline and candidate execution id.");t=await r.compare(i,o[2])}else throw new Error(`Unknown Experiment action: ${e}`)}console.log(JSON.stringify(t,null,2))}d(D,"runExperimentsCommand");export{D as runExperimentsCommand};
|