openpond 0.0.60 → 0.0.62
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/chunks/{actions-command-BNVIILSL.js → actions-command-DZ6D7JTO.js} +2 -2
- package/dist/chunks/{app-layer-RNQXXM6L.js → app-layer-MSLVVYLM.js} +5 -5
- package/dist/chunks/{app-server-runtime-7LGK37P6.js → app-server-runtime-BRG7A5VD.js} +8 -8
- package/dist/chunks/{apps-LV3CSMLT.js → apps-6PAXKTB5.js} +5 -5
- package/dist/chunks/{chunk-XFZYNYRI.js → chunk-4NHAH3MT.js} +5979 -3817
- package/dist/chunks/{chunk-7QLVLGDM.js → chunk-64LYEFLR.js} +1 -1
- package/dist/chunks/{chunk-AHILPQXV.js → chunk-6JT34APP.js} +3 -3
- package/dist/chunks/{chunk-LMQ4MPQI.js → chunk-BFAL2CV3.js} +51 -57
- package/dist/chunks/{chunk-TOCZQEPW.js → chunk-FYB6ELFM.js} +1 -1
- package/dist/chunks/{chunk-RC3N77IV.js → chunk-GMX47RLP.js} +35 -33
- package/dist/chunks/{chunk-VG4H4TQG.js → chunk-IY2AW5F3.js} +1768 -57
- package/dist/chunks/{chunk-FHP7OMEI.js → chunk-J2REM7LE.js} +1 -1
- package/dist/chunks/{chunk-DXSHQ6TO.js → chunk-JGOP4GCK.js} +16 -5
- package/dist/chunks/{chunk-SKUS4NPW.js → chunk-K4JEWEJQ.js} +154 -5
- package/dist/chunks/{chunk-2J3LG4U7.js → chunk-KMBJLBQH.js} +2 -2
- package/dist/chunks/{chunk-LDRWEAOB.js → chunk-MBF44RYK.js} +1 -1
- package/dist/chunks/{chunk-NFNEENNR.js → chunk-OYWTQABY.js} +1 -1
- package/dist/chunks/{chunk-I23UKEYS.js → chunk-PLDCQVNW.js} +115 -18
- package/dist/chunks/{chunk-PVGJXCAK.js → chunk-T4FMK5GN.js} +54 -52
- package/dist/chunks/{chunk-63N6442Q.js → chunk-T55IL3GI.js} +1 -1
- package/dist/chunks/{cli-DBZ7S6ZF.js → cli-L25X2EZL.js} +7 -7
- package/dist/chunks/{core-commands-H2UC3LHG.js → core-commands-STKFZZVR.js} +6 -6
- package/dist/chunks/{desktop-test-TV64EY5A.js → desktop-test-ACKJN4UV.js} +5 -5
- package/dist/chunks/{extension-XMWCG6YG.js → extension-MVWXKSAD.js} +16 -51
- package/dist/chunks/{help-NEYFMHWQ.js → help-4MQ4EOIS.js} +1 -1
- package/dist/chunks/{opchat-ZL5JJQ5L.js → opchat-DUIZT4G6.js} +5 -5
- package/dist/chunks/{organizations-4IEC35QB.js → organizations-ATM4CZII.js} +7 -7
- package/dist/chunks/{profile-EVASCDIN.js → profile-5H3GF252.js} +12 -7
- package/dist/chunks/{project-agent-DMN64RZJ.js → project-agent-RSKSO5GT.js} +27 -7
- package/dist/chunks/{sandbox-command-WKGVO32R.js → sandbox-command-MTYSZR6P.js} +6 -6
- package/dist/chunks/{sandbox-template-BJUS4KJM.js → sandbox-template-RZ5AJ4KB.js} +7 -7
- package/dist/chunks/{src-KLQEJ6RO.js → src-PW337SIJ.js} +4 -4
- package/dist/chunks/{src-E2UCLY54.js → src-WKH7EP7W.js} +1273 -422
- package/dist/chunks/{teams-bot-HUXYJ6XA.js → teams-bot-FF3LDAYL.js} +5 -5
- package/dist/chunks/{workspaces-4OKABHI3.js → workspaces-QKADU2A6.js} +2 -2
- package/dist/cli.js +13 -13
- package/dist/index.js +16 -5
- package/dist/sandbox/client-handles.d.ts +2 -1
- package/dist/sandbox/client.d.ts +3 -1
- package/dist/sandbox/sandbox-instance-client.d.ts +2 -1
- package/dist/sandbox/types/org-project-agent.d.ts +23 -1
- package/dist/web/assets/{AppDialog-CxLYXiI1.js → AppDialog-1RkKL2v6.js} +1 -1
- package/dist/web/assets/{AppsView-CVTUkahv.js → AppsView-B6hDEt-h.js} +1 -1
- package/dist/web/assets/BrowserSidebar-CkAMOgiq.js +1 -0
- package/dist/web/assets/CommandMenu-9oAkS4X3.js +1 -0
- package/dist/web/assets/CommunityView-Dyuq5N28.js +1 -0
- package/dist/web/assets/ComposerCreateImproveStrip-D91cw5AT.js +1 -0
- package/dist/web/assets/{GetStartedView-l9MUYMYH.js → GetStartedView-BZpcZgjB.js} +1 -1
- package/dist/web/assets/LabModelVersionDetailPage-C0jNkciw.js +1 -0
- package/dist/web/assets/LabSkillSidebar-JGCPqTB1.js +1 -0
- package/dist/web/assets/LabsRoute-Dpv5Haqy.js +3 -0
- package/dist/web/assets/MainChatThread-B4_iIn3g.js +2 -0
- package/dist/web/assets/MainPane-o4HIxmNz.js +6 -0
- package/dist/web/assets/MarkdownText-DgS9KdyT.js +9 -0
- package/dist/web/assets/Messages-DjMa9H1T.js +10 -0
- package/dist/web/assets/NativeSkillSidebar-Q3fwLOiO.js +1 -0
- package/dist/web/assets/{NewProjectDialog-CiGPfI5s.js → NewProjectDialog-CUb0umRT.js} +1 -1
- package/dist/web/assets/OutputsPage-DD_1STRQ.js +1 -0
- package/dist/web/assets/RightChatPanelStack-2dFyjK7Z.js +1 -0
- package/dist/web/assets/ScheduledWorkPage-DPjweWpP.js +1 -0
- package/dist/web/assets/SettingsView-BS5m5vdt.css +1 -0
- package/dist/web/assets/SettingsView-DJGgGPL0.js +6 -0
- package/dist/web/assets/TeamChatView-CZmbzRk7.js +3 -0
- package/dist/web/assets/{TerminalOverlay-Bb0RJR04.js → TerminalOverlay-CpjrArXn.js} +1 -1
- package/dist/web/assets/TrainingCreationPanel-Tbj3qk8-.js +1 -0
- package/dist/web/assets/TrainingDraftPanel-BhggD-hn.js +1 -0
- package/dist/web/assets/{UsageSettingsSection-Cdc_jGFX.js → UsageSettingsSection-CXM6LKim.js} +1 -1
- package/dist/web/assets/WorkspaceDiffPanel-CoMkI8dY.js +14 -0
- package/dist/web/assets/WorkspaceEnvironmentMenu-CZyjk82C.js +32 -0
- package/dist/web/assets/{WorkspaceGitDialogs-CK6ahRty.js → WorkspaceGitDialogs-DTj3DOsf.js} +1 -1
- package/dist/web/assets/{WorkspaceMonacoEditor-BQoN7jWa.js → WorkspaceMonacoEditor-DaNMLEnU.js} +3 -3
- package/dist/web/assets/{arrow-up-right-CzBZuWNj.js → arrow-up-right-wvL_rSwe.js} +1 -1
- package/dist/web/assets/{chevron-up-DW-qEVSP.js → chevron-up-BbyiUcq_.js} +1 -1
- package/dist/web/assets/{cloud-upload-CjLR-8-r.js → cloud-upload-Bgv1fA6E.js} +1 -1
- package/dist/web/assets/{cssMode-CQQJhS7v.js → cssMode-BG9jdNNX.js} +1 -1
- package/dist/web/assets/{folder-open-BpUcIJHn.js → folder-open-CRAYp6pW.js} +1 -1
- package/dist/web/assets/{folder-plus-8NHsIAxQ.js → folder-plus-BgsuJVU0.js} +1 -1
- package/dist/web/assets/{git-branch-DO3iP_fL.js → git-branch-CicxCU5U.js} +1 -1
- package/dist/web/assets/{git-commit-horizontal-BSWa2I3g.js → git-commit-horizontal-BRkwl6bp.js} +1 -1
- package/dist/web/assets/{htmlMode-DaAKO9wk.js → htmlMode-B69EEM3s.js} +1 -1
- package/dist/web/assets/index-BGdmnwp7.js +1 -0
- package/dist/web/assets/index-Bt9mPk1q.css +1 -0
- package/dist/web/assets/index-Dcpm2LlR.js +178 -0
- package/dist/web/assets/{info-DiEvrUda.js → info-BxhCcEsF.js} +1 -1
- package/dist/web/assets/{jsonMode-Biu1ZTZ7.js → jsonMode-D0tzZkp2.js} +1 -1
- package/dist/web/assets/{lspLanguageFeatures-lwoDxGgl.js → lspLanguageFeatures-DFpYfxMH.js} +1 -1
- package/dist/web/assets/{monaco.contribution-Ce2MS2Nv.js → monaco.contribution-BFP-1c-A.js} +2 -2
- package/dist/web/assets/{monaco.contribution-Ic8LKME8.js → monaco.contribution-BzGRrg8l.js} +2 -2
- package/dist/web/assets/{monaco.contribution-DzHhgeLy.js → monaco.contribution-K53jgqut.js} +2 -2
- package/dist/web/assets/{monaco.contribution-BqQSY5-t.js → monaco.contribution-lS_l56Q7.js} +2 -2
- package/dist/web/assets/{play-D9F3t5Cx.js → play-B8en8HVG.js} +1 -1
- package/dist/web/assets/{python-BhVCwr-K.js → python-DPtRb2z3.js} +1 -1
- package/dist/web/assets/{refresh-cw-DRN17xPU.js → refresh-cw-CRZeaNu7.js} +1 -1
- package/dist/web/assets/{save-CDZwpzlG.js → save-oO8erge1.js} +1 -1
- package/dist/web/assets/{square-Cf_AXs4a.js → square-CSULphDY.js} +1 -1
- package/dist/web/assets/{toggleHighContrast-Bb_m9pXM.js → toggleHighContrast-CmDdOtfT.js} +1 -1
- package/dist/web/assets/{tsMode-BaWkaSHN.js → tsMode-B0TCT940.js} +1 -1
- package/dist/web/assets/{upload-Cef29aCP.js → upload-dz-oCLFE.js} +1 -1
- package/dist/web/assets/{useLocalAgentSchedules-CAAqoZ0V.js → useLocalAgentSchedules-DPga1Kwi.js} +1 -1
- package/dist/web/assets/{wifi-off-C8cC22F6.js → wifi-off-BZpON33U.js} +1 -1
- package/dist/web/assets/{workers-GOdHtcZt.js → workers-DXVEq1Aw.js} +1 -1
- package/dist/web/assets/{yaml-jBIxwMeR.js → yaml-B8TBCEpi.js} +1 -1
- package/dist/web/index.html +2 -2
- package/docs/command-reference.md +2 -0
- package/package.json +1 -1
- package/dist/web/assets/BrowserSidebar-oHniLA05.js +0 -1
- package/dist/web/assets/CommandMenu-Db_5OiKs.js +0 -1
- package/dist/web/assets/CommunityView-HTwMEO-T.js +0 -1
- package/dist/web/assets/ComposerCreateImproveStrip-ER26yFe-.js +0 -1
- package/dist/web/assets/LabModelVersionDetailPage-Dgf-DlJi.js +0 -1
- package/dist/web/assets/LabSkillSidebar-CyX8sVm1.js +0 -1
- package/dist/web/assets/LabsRoute-BC1ST9qT.js +0 -3
- package/dist/web/assets/MainChatThread-BfW92Rv1.js +0 -2
- package/dist/web/assets/MainPane-DlciH8yR.js +0 -6
- package/dist/web/assets/MarkdownText-CyOeCVjf.js +0 -9
- package/dist/web/assets/Messages-BDtEbIKv.js +0 -9
- package/dist/web/assets/NativeSkillSidebar-D0BlvEtE.js +0 -1
- package/dist/web/assets/OutputsPage-DNU2yD7q.js +0 -1
- package/dist/web/assets/RightChatPanelStack-Cs63fQwk.js +0 -1
- package/dist/web/assets/ScheduledWorkPage-DMKHFbeE.js +0 -1
- package/dist/web/assets/SettingsView-C39BqlSI.css +0 -1
- package/dist/web/assets/SettingsView-L0g-g2fL.js +0 -6
- package/dist/web/assets/TeamChatView-CSVMTUAE.js +0 -3
- package/dist/web/assets/TrainingCreationPanel-VIWlpVV2.js +0 -1
- package/dist/web/assets/TrainingDraftPanel-MTYsR-Ry.js +0 -1
- package/dist/web/assets/WorkspaceDiffPanel-BgIbxMMu.js +0 -14
- package/dist/web/assets/WorkspaceEnvironmentMenu-C97GqYn9.js +0 -32
- package/dist/web/assets/circle-alert-B_xROoPY.js +0 -1
- package/dist/web/assets/folder-git-2-ktXin28y.js +0 -1
- package/dist/web/assets/folder-tLv6TMN2.js +0 -1
- package/dist/web/assets/index-BtiK52K1.js +0 -1
- package/dist/web/assets/index-CE2hroF6.css +0 -1
- package/dist/web/assets/index-DHxBMQIJ.js +0 -174
- package/dist/web/assets/square-pen-ChJgNiDm.js +0 -1
|
@@ -265,6 +265,7 @@ function createSandboxAgentNamespace(client) {
|
|
|
265
265
|
sourceDeployPlan: (agentId, input) => client.getAgentSourceDeployPlan(agentId, input),
|
|
266
266
|
manifestSnapshots: (agentId, input) => client.listAgentManifestSnapshots(agentId, input),
|
|
267
267
|
requestSourceChecks: (agentId, input) => client.requestAgentSourceChecks(agentId, input),
|
|
268
|
+
configureSourceSetup: (agentId, input) => client.configureAgentSourceSetup(agentId, input),
|
|
268
269
|
publishSource: (agentId, input) => client.publishAgentSource(agentId, input)
|
|
269
270
|
};
|
|
270
271
|
}
|
|
@@ -1190,7 +1191,8 @@ var OpenPondSandboxClient = class extends OpenPondSandboxInstanceClient {
|
|
|
1190
1191
|
return this.requestApiRoot(`/projects?${query.toString()}`).then((payload) => payload.projects);
|
|
1191
1192
|
}
|
|
1192
1193
|
upsertProject(input) {
|
|
1193
|
-
|
|
1194
|
+
const query = new URLSearchParams({ teamId: input.teamId });
|
|
1195
|
+
return this.requestApiRoot(`/projects?${query.toString()}`, {
|
|
1194
1196
|
method: "POST",
|
|
1195
1197
|
body: JSON.stringify(input)
|
|
1196
1198
|
}).then((payload) => payload.project);
|
|
@@ -1257,7 +1259,8 @@ var OpenPondSandboxClient = class extends OpenPondSandboxInstanceClient {
|
|
|
1257
1259
|
return this.requestApiRoot(`/agents?${query.toString()}`).then((payload) => payload.agents);
|
|
1258
1260
|
}
|
|
1259
1261
|
upsertAgent(input) {
|
|
1260
|
-
|
|
1262
|
+
const query = new URLSearchParams({ teamId: input.teamId });
|
|
1263
|
+
return this.requestApiRoot(`/agents?${query.toString()}`, {
|
|
1261
1264
|
method: "POST",
|
|
1262
1265
|
body: JSON.stringify(input)
|
|
1263
1266
|
}).then((payload) => payload.agent);
|
|
@@ -1279,12 +1282,14 @@ var OpenPondSandboxClient = class extends OpenPondSandboxInstanceClient {
|
|
|
1279
1282
|
}).then((payload) => payload.agent);
|
|
1280
1283
|
}
|
|
1281
1284
|
runAgent(agentId, input) {
|
|
1282
|
-
|
|
1285
|
+
const query = new URLSearchParams({ teamId: input.teamId });
|
|
1286
|
+
const { teamId: _teamId, ...body } = input;
|
|
1287
|
+
return this.requestApiRoot(`/agents/${encodeURIComponent(agentId)}/run?${query.toString()}`, {
|
|
1283
1288
|
method: "POST",
|
|
1284
1289
|
headers: {
|
|
1285
1290
|
Prefer: "respond-async"
|
|
1286
1291
|
},
|
|
1287
|
-
body: JSON.stringify(
|
|
1292
|
+
body: JSON.stringify(body)
|
|
1288
1293
|
});
|
|
1289
1294
|
}
|
|
1290
1295
|
getAgentSourceDeployPlan(agentId, input) {
|
|
@@ -1302,9 +1307,15 @@ var OpenPondSandboxClient = class extends OpenPondSandboxInstanceClient {
|
|
|
1302
1307
|
const { teamId: _teamId, ...body } = input;
|
|
1303
1308
|
return this.requestApiRoot(`/agents/${encodeURIComponent(agentId)}/source/checks?${query.toString()}`, {
|
|
1304
1309
|
method: "POST",
|
|
1305
|
-
body: JSON.stringify(body)
|
|
1310
|
+
body: JSON.stringify(body),
|
|
1311
|
+
timeoutMs: 15 * 60 * 1e3
|
|
1306
1312
|
});
|
|
1307
1313
|
}
|
|
1314
|
+
configureAgentSourceSetup(agentId, input) {
|
|
1315
|
+
const query = new URLSearchParams({ teamId: input.teamId });
|
|
1316
|
+
const { teamId: _teamId, ...body } = input;
|
|
1317
|
+
return this.requestApiRoot(`/agents/${encodeURIComponent(agentId)}/source/setup?${query.toString()}`, { method: "POST", body: JSON.stringify(body) });
|
|
1318
|
+
}
|
|
1308
1319
|
publishAgentSource(agentId, input) {
|
|
1309
1320
|
const query = new URLSearchParams({ teamId: input.teamId });
|
|
1310
1321
|
const { teamId: _teamId, ...body } = input;
|
|
@@ -6,15 +6,16 @@ import {
|
|
|
6
6
|
readApiJson,
|
|
7
7
|
resolveOpChatApiBaseUrl,
|
|
8
8
|
sendHostedChatTurn
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-JGOP4GCK.js";
|
|
10
10
|
|
|
11
11
|
// ../../packages/sdk/src/work.ts
|
|
12
12
|
var DEFAULT_MODEL = "openpond-chat";
|
|
13
13
|
var DEFAULT_MAX_STEPS = 24;
|
|
14
14
|
var MAX_TOOL_OUTPUT_CHARS = 4e4;
|
|
15
|
-
var
|
|
16
|
-
var
|
|
17
|
-
var
|
|
15
|
+
var MAX_WORK_COMMAND_CHARS = 2e4;
|
|
16
|
+
var WORK_OUTPUT_DIRECTORY = "outputs";
|
|
17
|
+
var WORK_INPUT_DIRECTORY = "inputs/previous-outputs";
|
|
18
|
+
var WORK_INPUT_MANIFEST = "inputs/.openpond-context.json";
|
|
18
19
|
var MAX_WORK_OUTPUTS = 100;
|
|
19
20
|
var MAX_WORK_INPUTS = 100;
|
|
20
21
|
var MAX_WORK_INPUT_BYTES = 100 * 1024 * 1024;
|
|
@@ -332,6 +333,11 @@ var OpenPondWorkClient = class {
|
|
|
332
333
|
}
|
|
333
334
|
const command = typeof args.command === "string" ? args.command.trim() : "";
|
|
334
335
|
if (!command) return toolMessage(toolCallId, { error: "command is required" });
|
|
336
|
+
if (command.length > MAX_WORK_COMMAND_CHARS) {
|
|
337
|
+
const output = `command exceeds the ${MAX_WORK_COMMAND_CHARS} character limit`;
|
|
338
|
+
await emit({ type: "tool", toolCallId, command, status: "failed", output });
|
|
339
|
+
return toolMessage(toolCallId, { status: "failed", error: output });
|
|
340
|
+
}
|
|
335
341
|
await emit({ type: "tool", toolCallId, command, status: "started" });
|
|
336
342
|
try {
|
|
337
343
|
const response = await this.#sandboxes.exec(sandboxId, {
|
|
@@ -371,7 +377,12 @@ var WORK_TOOLS = [
|
|
|
371
377
|
type: "object",
|
|
372
378
|
additionalProperties: false,
|
|
373
379
|
properties: {
|
|
374
|
-
command: {
|
|
380
|
+
command: {
|
|
381
|
+
type: "string",
|
|
382
|
+
minLength: 1,
|
|
383
|
+
maxLength: MAX_WORK_COMMAND_CHARS,
|
|
384
|
+
description: "Shell command to execute."
|
|
385
|
+
}
|
|
375
386
|
},
|
|
376
387
|
required: ["command"]
|
|
377
388
|
}
|
|
@@ -601,11 +612,147 @@ function projectActionPath(projectId, suffix, teamId) {
|
|
|
601
612
|
return `/v1/project-actions/${encodeURIComponent(projectId)}/${suffix}?teamId=${encodeURIComponent(teamId)}`;
|
|
602
613
|
}
|
|
603
614
|
|
|
615
|
+
// ../../packages/sdk/src/profile-actions.ts
|
|
616
|
+
var OpenPondProfileActionsClient = class {
|
|
617
|
+
#apiKey;
|
|
618
|
+
#apiBaseUrl;
|
|
619
|
+
constructor(input) {
|
|
620
|
+
this.#apiKey = input.apiKey;
|
|
621
|
+
this.#apiBaseUrl = input.apiBaseUrl.replace(/\/+$/, "");
|
|
622
|
+
}
|
|
623
|
+
async catalog(input) {
|
|
624
|
+
const teamId = requiredValue(input.teamId, "teamId");
|
|
625
|
+
const search = new URLSearchParams({ teamId });
|
|
626
|
+
if (input.profileId?.trim()) search.set("profileId", input.profileId.trim());
|
|
627
|
+
if (input.profileName?.trim()) {
|
|
628
|
+
search.set("profileName", input.profileName.trim());
|
|
629
|
+
}
|
|
630
|
+
const response = await apiFetch(
|
|
631
|
+
this.#apiBaseUrl,
|
|
632
|
+
this.#apiKey,
|
|
633
|
+
`/v1/profile/actions?${search.toString()}`
|
|
634
|
+
);
|
|
635
|
+
return (await readApiJson(
|
|
636
|
+
response,
|
|
637
|
+
"Get Profile Action catalog"
|
|
638
|
+
)).catalog;
|
|
639
|
+
}
|
|
640
|
+
async run(input) {
|
|
641
|
+
const teamId = requiredValue(input.teamId, "teamId");
|
|
642
|
+
const actionKey = requiredValue(input.actionKey, "actionKey");
|
|
643
|
+
const idempotencyKey = requiredValue(input.idempotencyKey, "idempotencyKey");
|
|
644
|
+
const catalogVersion = requiredValue(input.catalogVersion, "catalogVersion");
|
|
645
|
+
const response = await apiFetch(
|
|
646
|
+
this.#apiBaseUrl,
|
|
647
|
+
this.#apiKey,
|
|
648
|
+
`/v1/profile/actions/run?${new URLSearchParams({ teamId }).toString()}`,
|
|
649
|
+
{
|
|
650
|
+
method: "POST",
|
|
651
|
+
headers: { "Content-Type": "application/json" },
|
|
652
|
+
body: JSON.stringify({
|
|
653
|
+
...input.profileId?.trim() ? { profileId: input.profileId.trim() } : {},
|
|
654
|
+
...input.profileName?.trim() ? { profileName: input.profileName.trim() } : {},
|
|
655
|
+
actionKey,
|
|
656
|
+
value: input.value ?? {},
|
|
657
|
+
conversationId: input.conversationId ?? null,
|
|
658
|
+
createConversation: input.createConversation,
|
|
659
|
+
conversationTitle: input.conversationTitle ?? null,
|
|
660
|
+
idempotencyKey,
|
|
661
|
+
catalogVersion,
|
|
662
|
+
externalCapabilityLeases: input.externalCapabilityLeases
|
|
663
|
+
})
|
|
664
|
+
}
|
|
665
|
+
);
|
|
666
|
+
return readApiJson(
|
|
667
|
+
response,
|
|
668
|
+
"Run Profile Action"
|
|
669
|
+
);
|
|
670
|
+
}
|
|
671
|
+
};
|
|
672
|
+
function requiredValue(value, name) {
|
|
673
|
+
const normalized = value.trim();
|
|
674
|
+
if (!normalized) throw new Error(`${name} is required`);
|
|
675
|
+
return normalized;
|
|
676
|
+
}
|
|
677
|
+
|
|
678
|
+
// ../../packages/sdk/src/workflows.ts
|
|
679
|
+
import { randomUUID } from "node:crypto";
|
|
680
|
+
var OpenPondWorkflowsClient = class {
|
|
681
|
+
#apiKey;
|
|
682
|
+
#apiBaseUrl;
|
|
683
|
+
constructor(input) {
|
|
684
|
+
this.#apiKey = input.apiKey;
|
|
685
|
+
this.#apiBaseUrl = input.apiBaseUrl.replace(/\/+$/, "");
|
|
686
|
+
}
|
|
687
|
+
async list(options = {}) {
|
|
688
|
+
return this.#request("", "List Workflows", {
|
|
689
|
+
signal: options.signal
|
|
690
|
+
});
|
|
691
|
+
}
|
|
692
|
+
async create(input, options = {}) {
|
|
693
|
+
return this.#request("", "Create Workflow", {
|
|
694
|
+
method: "POST",
|
|
695
|
+
body: JSON.stringify({
|
|
696
|
+
...input,
|
|
697
|
+
clientRequestId: input.clientRequestId?.trim() || randomUUID()
|
|
698
|
+
}),
|
|
699
|
+
signal: options.signal
|
|
700
|
+
});
|
|
701
|
+
}
|
|
702
|
+
async update(scheduleId, input, options = {}) {
|
|
703
|
+
return this.#request(
|
|
704
|
+
`/schedules/${encodeURIComponent(requiredId(scheduleId, "scheduleId"))}`,
|
|
705
|
+
"Update Workflow",
|
|
706
|
+
{
|
|
707
|
+
method: "PATCH",
|
|
708
|
+
body: JSON.stringify(input),
|
|
709
|
+
signal: options.signal
|
|
710
|
+
}
|
|
711
|
+
);
|
|
712
|
+
}
|
|
713
|
+
async delete(scheduleId, options = {}) {
|
|
714
|
+
return this.#request(
|
|
715
|
+
`/schedules/${encodeURIComponent(requiredId(scheduleId, "scheduleId"))}`,
|
|
716
|
+
"Delete Workflow",
|
|
717
|
+
{ method: "DELETE", signal: options.signal }
|
|
718
|
+
);
|
|
719
|
+
}
|
|
720
|
+
async runNow(scheduleId, input = {}, options = {}) {
|
|
721
|
+
return this.#request(
|
|
722
|
+
`/schedules/${encodeURIComponent(requiredId(scheduleId, "scheduleId"))}/run`,
|
|
723
|
+
"Run Workflow",
|
|
724
|
+
{
|
|
725
|
+
method: "POST",
|
|
726
|
+
body: JSON.stringify({
|
|
727
|
+
clientRequestId: input.clientRequestId?.trim() || randomUUID()
|
|
728
|
+
}),
|
|
729
|
+
signal: options.signal
|
|
730
|
+
}
|
|
731
|
+
);
|
|
732
|
+
}
|
|
733
|
+
async #request(suffix, label, options = {}) {
|
|
734
|
+
const response = await apiFetch(
|
|
735
|
+
this.#apiBaseUrl,
|
|
736
|
+
this.#apiKey,
|
|
737
|
+
`/v1/saved-work${suffix}`,
|
|
738
|
+
options
|
|
739
|
+
);
|
|
740
|
+
return readApiJson(response, label);
|
|
741
|
+
}
|
|
742
|
+
};
|
|
743
|
+
function requiredId(value, label) {
|
|
744
|
+
const normalized = value.trim();
|
|
745
|
+
if (!normalized) throw new Error(`${label} is required`);
|
|
746
|
+
return normalized;
|
|
747
|
+
}
|
|
748
|
+
|
|
604
749
|
// ../../packages/sdk/src/index.ts
|
|
605
750
|
var OpenPondClient = class {
|
|
606
751
|
sandboxes;
|
|
607
752
|
work;
|
|
753
|
+
workflows;
|
|
608
754
|
actions;
|
|
755
|
+
profileActions;
|
|
609
756
|
constructor(options) {
|
|
610
757
|
const apiKey = options.apiKey.trim();
|
|
611
758
|
if (!apiKey) throw new Error("OpenPond API key is required");
|
|
@@ -621,7 +768,9 @@ var OpenPondClient = class {
|
|
|
621
768
|
chatApiBaseUrl: options.chatApiUrl?.trim() || resolveOpChatApiBaseUrl({ apiBaseUrl, env: {} }),
|
|
622
769
|
sandboxes: this.sandboxes
|
|
623
770
|
});
|
|
771
|
+
this.workflows = new OpenPondWorkflowsClient({ apiKey, apiBaseUrl });
|
|
624
772
|
this.actions = new OpenPondProjectActionsClient({ apiKey, apiBaseUrl });
|
|
773
|
+
this.profileActions = new OpenPondProfileActionsClient({ apiKey, apiBaseUrl });
|
|
625
774
|
}
|
|
626
775
|
};
|
|
627
776
|
function createOpenPondClient(options) {
|
|
@@ -15,7 +15,7 @@ import {
|
|
|
15
15
|
resolveRepoUrl,
|
|
16
16
|
runCommand,
|
|
17
17
|
warnOnRepoHostMismatch
|
|
18
|
-
} from "./chunk-
|
|
18
|
+
} from "./chunk-J2REM7LE.js";
|
|
19
19
|
import {
|
|
20
20
|
normalizeTemplateRepoUrl,
|
|
21
21
|
resolveApiBaseUrlOption,
|
|
@@ -28,7 +28,7 @@ import {
|
|
|
28
28
|
compareSemver,
|
|
29
29
|
fetchLatestNpmVersion,
|
|
30
30
|
getInstalledCliVersion
|
|
31
|
-
} from "./chunk-
|
|
31
|
+
} from "./chunk-GMX47RLP.js";
|
|
32
32
|
import {
|
|
33
33
|
checkOpenPondApiHealth,
|
|
34
34
|
createHeadlessApps,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { createRequire as __openpondCreateRequire } from "node:module"; var require = __openpondCreateRequire(import.meta.url);
|
|
2
2
|
import {
|
|
3
3
|
now
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-FYB6ELFM.js";
|
|
5
5
|
|
|
6
6
|
// ../server/src/workspace/workspace-command.ts
|
|
7
7
|
import { spawn, spawnSync } from "node:child_process";
|
|
@@ -443,7 +443,7 @@ async function runProviderRound(input) {
|
|
|
443
443
|
const toolCallBatches = [];
|
|
444
444
|
try {
|
|
445
445
|
for await (const delta of input.stream) {
|
|
446
|
-
input.onDelta?.(delta);
|
|
446
|
+
await input.onDelta?.(delta);
|
|
447
447
|
if (input.signal.aborted) {
|
|
448
448
|
throw input.signal.reason ?? new Error("Provider round interrupted.");
|
|
449
449
|
}
|
|
@@ -15,7 +15,7 @@ import {
|
|
|
15
15
|
parseSandboxRuntimePromotionPolicyOption,
|
|
16
16
|
parseSandboxWorkflowModeOption,
|
|
17
17
|
runProcessCommand
|
|
18
|
-
} from "./chunk-
|
|
18
|
+
} from "./chunk-J2REM7LE.js";
|
|
19
19
|
import {
|
|
20
20
|
optionString,
|
|
21
21
|
optionalJsonObject,
|
|
@@ -123,9 +123,15 @@ function agentSdkRunScriptCommand(packageManager, scriptName) {
|
|
|
123
123
|
if (packageManager === "bun") return `bun run ${scriptName}`;
|
|
124
124
|
return `pnpm run ${scriptName}`;
|
|
125
125
|
}
|
|
126
|
+
function agentSdkRunJsonScriptCommand(packageManager, scriptName) {
|
|
127
|
+
if (packageManager === "pnpm") return `pnpm --silent run ${scriptName}`;
|
|
128
|
+
if (packageManager === "yarn") return `yarn --silent ${scriptName}`;
|
|
129
|
+
if (packageManager === "npm") return `npm run --silent ${scriptName}`;
|
|
130
|
+
if (packageManager === "bun") return `bun run --silent ${scriptName}`;
|
|
131
|
+
return `pnpm --silent run ${scriptName}`;
|
|
132
|
+
}
|
|
126
133
|
|
|
127
134
|
// ../../packages/cloud/src/profile/project-source-upload-agent-sdk.ts
|
|
128
|
-
var OPENPOND_PNPM_PACKAGE_MANAGER = "pnpm@11.13.0";
|
|
129
135
|
var AGENT_SDK_VENDOR_TARBALL_PATH = ".openpond/vendor/openpond-agent-sdk.tgz";
|
|
130
136
|
var AGENT_SDK_VENDOR_NPM_DEPENDENCY_DIR = ".openpond/vendor/npm";
|
|
131
137
|
var AGENT_SDK_MATERIALIZED_DEPENDENCY_SPEC = `file:${AGENT_SDK_VENDOR_TARBALL_PATH}`;
|
|
@@ -152,10 +158,15 @@ async function buildAgentSdkMaterializedDependency(projectPath, packageJson) {
|
|
|
152
158
|
if (!sdkSource) return null;
|
|
153
159
|
const tempDir = await fs.mkdtemp(path3.join(tmpdir(), "openpond-agent-sdk-pack-"));
|
|
154
160
|
try {
|
|
155
|
-
const sdkContents = sdkSource.kind === "package_root" ? await packOpenPondAgentSdkPackageRoot(sdkSource.packageRoot, tempDir) : sdkSource.
|
|
161
|
+
const sdkContents = sdkSource.kind === "package_root" ? await packOpenPondAgentSdkPackageRoot(sdkSource.packageRoot, tempDir) : sdkSource.kind === "registry" ? await packOpenPondAgentSdkRegistryPackage(
|
|
162
|
+
sdkSource.versionSpec,
|
|
163
|
+
tempDir
|
|
164
|
+
) : sdkSource.tarballContents;
|
|
156
165
|
const sdkDependencyTarballs = await packAgentSdkRuntimeDependencyTarballs({
|
|
157
166
|
sdkPackageJson: sdkSource.packageJson,
|
|
158
167
|
dependencyBaseDir: sdkSource.dependencyBaseDir,
|
|
168
|
+
projectPackageJson: packageJson,
|
|
169
|
+
projectPath,
|
|
159
170
|
tempDir
|
|
160
171
|
});
|
|
161
172
|
const packageManager = detectAgentSdkPackageManager(projectPath, packageJson);
|
|
@@ -226,23 +237,49 @@ ${details}` : ""}`
|
|
|
226
237
|
return fs.readFile(path3.join(tempDir, tarballName));
|
|
227
238
|
}
|
|
228
239
|
async function packAgentSdkRuntimeDependencyTarballs(params) {
|
|
229
|
-
const
|
|
230
|
-
const
|
|
240
|
+
const sdkDependencies = recordStringMap(params.sdkPackageJson.dependencies);
|
|
241
|
+
const projectDependencies = recordStringMap(
|
|
242
|
+
params.projectPackageJson.dependencies
|
|
243
|
+
);
|
|
244
|
+
const projectDevDependencies = recordStringMap(
|
|
245
|
+
params.projectPackageJson.devDependencies
|
|
246
|
+
);
|
|
247
|
+
delete projectDependencies["openpond-agent-sdk"];
|
|
248
|
+
delete projectDevDependencies["openpond-agent-sdk"];
|
|
249
|
+
const pending = [
|
|
250
|
+
...Object.entries(sdkDependencies).map(([packageName, versionSpec]) => ({
|
|
251
|
+
packageName,
|
|
252
|
+
versionSpec,
|
|
253
|
+
dependencyBaseDir: params.dependencyBaseDir
|
|
254
|
+
})),
|
|
255
|
+
...Object.entries(projectDependencies).map(([packageName, versionSpec]) => ({
|
|
256
|
+
packageName,
|
|
257
|
+
versionSpec,
|
|
258
|
+
dependencyBaseDir: params.projectPath
|
|
259
|
+
})),
|
|
260
|
+
...Object.entries(projectDevDependencies).map(
|
|
261
|
+
([packageName, versionSpec]) => ({
|
|
262
|
+
packageName,
|
|
263
|
+
versionSpec,
|
|
264
|
+
dependencyBaseDir: params.projectPath
|
|
265
|
+
})
|
|
266
|
+
)
|
|
267
|
+
].sort((left, right) => left.packageName.localeCompare(right.packageName));
|
|
231
268
|
const seen = /* @__PURE__ */ new Set();
|
|
232
269
|
const tarballs = [];
|
|
233
270
|
while (pending.length > 0) {
|
|
234
|
-
const { packageName, versionSpec } = pending.shift();
|
|
271
|
+
const { packageName, versionSpec, dependencyBaseDir } = pending.shift();
|
|
235
272
|
if (seen.has(packageName)) continue;
|
|
236
273
|
seen.add(packageName);
|
|
237
274
|
const packTarget = npmPackTargetForDependency({
|
|
238
275
|
packageName,
|
|
239
276
|
versionSpec,
|
|
240
|
-
dependencyBaseDir
|
|
277
|
+
dependencyBaseDir
|
|
241
278
|
});
|
|
242
279
|
const pack = await runCommand(
|
|
243
280
|
"npm",
|
|
244
281
|
["pack", "--silent", "--pack-destination", params.tempDir, packTarget],
|
|
245
|
-
{ cwd:
|
|
282
|
+
{ cwd: dependencyBaseDir }
|
|
246
283
|
);
|
|
247
284
|
if (pack.code !== 0) {
|
|
248
285
|
const details = [pack.stderr.trim(), pack.stdout.trim()].filter(Boolean).join("\n");
|
|
@@ -258,7 +295,14 @@ ${details}` : ""}`
|
|
|
258
295
|
);
|
|
259
296
|
}
|
|
260
297
|
const contents = await fs.readFile(path3.join(params.tempDir, tarballName));
|
|
261
|
-
|
|
298
|
+
let packedPackageJson;
|
|
299
|
+
try {
|
|
300
|
+
packedPackageJson = readPackageJsonFromNpmTarball(contents);
|
|
301
|
+
} catch (error) {
|
|
302
|
+
throw new Error(
|
|
303
|
+
`failed to inspect packed dependency ${packageName}: ${error instanceof Error ? error.message : String(error)}`
|
|
304
|
+
);
|
|
305
|
+
}
|
|
262
306
|
tarballs.push({
|
|
263
307
|
packageName,
|
|
264
308
|
source: "npm_dependency_tarball",
|
|
@@ -273,13 +317,21 @@ ${details}` : ""}`
|
|
|
273
317
|
for (const [dependencyName, dependencySpec] of Object.entries(
|
|
274
318
|
recordStringMap(packedPackageJson.dependencies)
|
|
275
319
|
)) {
|
|
276
|
-
pending.push({
|
|
320
|
+
pending.push({
|
|
321
|
+
packageName: dependencyName,
|
|
322
|
+
versionSpec: dependencySpec,
|
|
323
|
+
dependencyBaseDir
|
|
324
|
+
});
|
|
277
325
|
}
|
|
278
326
|
for (const [dependencyName, dependencySpec] of Object.entries(
|
|
279
327
|
recordStringMap(packedPackageJson.optionalDependencies)
|
|
280
328
|
)) {
|
|
281
329
|
if (!isSupportedSandboxOptionalDependency(dependencyName)) continue;
|
|
282
|
-
pending.push({
|
|
330
|
+
pending.push({
|
|
331
|
+
packageName: dependencyName,
|
|
332
|
+
versionSpec: dependencySpec,
|
|
333
|
+
dependencyBaseDir
|
|
334
|
+
});
|
|
283
335
|
}
|
|
284
336
|
}
|
|
285
337
|
return tarballs.sort((left, right) => left.packageName.localeCompare(right.packageName));
|
|
@@ -303,6 +355,33 @@ function npmPackTargetForDependency(params) {
|
|
|
303
355
|
function sanitizeNpmPackageNameForVendor(packageName) {
|
|
304
356
|
return packageName.replace(/^@/, "").replace(/[\/\\]/g, "__").replace(/[^a-zA-Z0-9._-]/g, "_");
|
|
305
357
|
}
|
|
358
|
+
async function packOpenPondAgentSdkRegistryPackage(versionSpec, tempDir) {
|
|
359
|
+
const pack = await runCommand(
|
|
360
|
+
"npm",
|
|
361
|
+
[
|
|
362
|
+
"pack",
|
|
363
|
+
"--silent",
|
|
364
|
+
"--pack-destination",
|
|
365
|
+
tempDir,
|
|
366
|
+
`openpond-agent-sdk@${versionSpec}`
|
|
367
|
+
],
|
|
368
|
+
{ cwd: tempDir }
|
|
369
|
+
);
|
|
370
|
+
if (pack.code !== 0) {
|
|
371
|
+
const details = [pack.stderr.trim(), pack.stdout.trim()].filter(Boolean).join("\n");
|
|
372
|
+
throw new Error(
|
|
373
|
+
`failed to pack openpond-agent-sdk for source upload${details ? `:
|
|
374
|
+
${details}` : ""}`
|
|
375
|
+
);
|
|
376
|
+
}
|
|
377
|
+
const tarballName = pack.stdout.trim().split(/\r?\n/).filter(Boolean).pop();
|
|
378
|
+
if (!tarballName) {
|
|
379
|
+
throw new Error(
|
|
380
|
+
"failed to pack openpond-agent-sdk for source upload: npm pack did not return a tarball name"
|
|
381
|
+
);
|
|
382
|
+
}
|
|
383
|
+
return fs.readFile(path3.join(tempDir, tarballName));
|
|
384
|
+
}
|
|
306
385
|
function resolveLocalOpenPondAgentSdkMaterializationSource(projectPath, packageJson) {
|
|
307
386
|
const versionSpec = readOpenPondAgentSdkVersionSpec(packageJson);
|
|
308
387
|
if (versionSpec?.startsWith("file:")) {
|
|
@@ -344,6 +423,23 @@ function resolveLocalOpenPondAgentSdkMaterializationSource(projectPath, packageJ
|
|
|
344
423
|
};
|
|
345
424
|
}
|
|
346
425
|
}
|
|
426
|
+
const installedPackageRoot = path3.join(
|
|
427
|
+
projectPath,
|
|
428
|
+
"node_modules",
|
|
429
|
+
"openpond-agent-sdk"
|
|
430
|
+
);
|
|
431
|
+
if (isOpenPondAgentSdkPackageRoot(installedPackageRoot)) {
|
|
432
|
+
const installedPackageJson = JSON.parse(
|
|
433
|
+
readFileSyncUtf8(path3.join(installedPackageRoot, "package.json"))
|
|
434
|
+
);
|
|
435
|
+
const installedVersion = text(installedPackageJson.version);
|
|
436
|
+
return {
|
|
437
|
+
kind: "registry",
|
|
438
|
+
versionSpec: installedVersion ?? versionSpec ?? "latest",
|
|
439
|
+
dependencyBaseDir: installedPackageRoot,
|
|
440
|
+
packageJson: installedPackageJson
|
|
441
|
+
};
|
|
442
|
+
}
|
|
347
443
|
return null;
|
|
348
444
|
}
|
|
349
445
|
function findOpenPondAgentSdkPackageRootInAncestors(projectPath) {
|
|
@@ -389,14 +485,14 @@ function readPackageJsonFromNpmTarball(tarballContents) {
|
|
|
389
485
|
}
|
|
390
486
|
const dataStart = offset + 512;
|
|
391
487
|
const dataEnd = dataStart + size;
|
|
392
|
-
if (entryPath === "package/package.json") {
|
|
488
|
+
if (entryPath === "package/package.json" || entryPath.endsWith("/package.json")) {
|
|
393
489
|
return JSON.parse(
|
|
394
490
|
tarContents.subarray(dataStart, dataEnd).toString("utf8")
|
|
395
491
|
);
|
|
396
492
|
}
|
|
397
493
|
offset = dataStart + Math.ceil(size / 512) * 512;
|
|
398
494
|
}
|
|
399
|
-
throw new Error("failed to read
|
|
495
|
+
throw new Error("failed to read npm package tarball: missing package.json");
|
|
400
496
|
}
|
|
401
497
|
function readTarString(header, start, length) {
|
|
402
498
|
const field = header.subarray(start, start + length);
|
|
@@ -417,8 +513,8 @@ function rewriteAgentSdkPackageJsonForMaterialization(packageJson, dependencyTar
|
|
|
417
513
|
if (Object.keys(overrides).length > 0) {
|
|
418
514
|
rewritten.overrides = overrides;
|
|
419
515
|
}
|
|
420
|
-
if (packageManager === "unknown") {
|
|
421
|
-
rewritten.packageManager
|
|
516
|
+
if (packageManager === "pnpm" || packageManager === "unknown") {
|
|
517
|
+
delete rewritten.packageManager;
|
|
422
518
|
}
|
|
423
519
|
for (const key of ["devDependencies", "peerDependencies"]) {
|
|
424
520
|
const entries = recordCopy(rewritten[key]);
|
|
@@ -954,7 +1050,8 @@ function buildAgentSdkCommandHints(packageJson, packageManager) {
|
|
|
954
1050
|
packageJson,
|
|
955
1051
|
packageManager,
|
|
956
1052
|
"agent:inspect",
|
|
957
|
-
"openpond-agent inspect --json"
|
|
1053
|
+
"openpond-agent inspect --json",
|
|
1054
|
+
true
|
|
958
1055
|
),
|
|
959
1056
|
build: buildAgentSdkCommandHint(
|
|
960
1057
|
packageJson,
|
|
@@ -976,11 +1073,11 @@ function buildAgentSdkCommandHints(packageJson, packageManager) {
|
|
|
976
1073
|
)
|
|
977
1074
|
};
|
|
978
1075
|
}
|
|
979
|
-
function buildAgentSdkCommandHint(packageJson, packageManager, scriptName, fallback) {
|
|
1076
|
+
function buildAgentSdkCommandHint(packageJson, packageManager, scriptName, fallback, jsonOutput = false) {
|
|
980
1077
|
const scripts = packageJson.scripts;
|
|
981
1078
|
const hasScript = scripts && typeof scripts === "object" && !Array.isArray(scripts) && typeof scripts[scriptName] === "string";
|
|
982
1079
|
if (!hasScript) return fallback;
|
|
983
|
-
return agentSdkRunScriptCommand(packageManager, scriptName);
|
|
1080
|
+
return jsonOutput ? agentSdkRunJsonScriptCommand(packageManager, scriptName) : agentSdkRunScriptCommand(packageManager, scriptName);
|
|
984
1081
|
}
|
|
985
1082
|
function readOpenPondAgentSdkVersionSpec2(packageJson) {
|
|
986
1083
|
for (const key of ["dependencies", "devDependencies", "peerDependencies"]) {
|