@desplega.ai/agent-swarm 1.167.0 → 1.168.0
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/{acp-adapter-zpvy6321.js → acp-adapter-zhejfecx.js} +2 -2
- package/dist/{actions-fq2zrwtf.js → actions-7jg840nr.js} +11 -11
- package/dist/{amp-adapter-5gbk7501.js → amp-adapter-ye6rnetm.js} +1 -1
- package/dist/{app-nctetn1e.js → app-ffes2kyf.js} +3 -3
- package/dist/{assistant-0aq8gjvj.js → assistant-fhm5smyz.js} +12 -12
- package/dist/{boot-reembed-1ze5853n.js → boot-reembed-20q3nzvg.js} +2 -2
- package/dist/{boot-reembed-fmp5ww69.js → boot-reembed-jvfadhsk.js} +2 -2
- package/dist/{boot-scrub-sweep-cbp8xd4e.js → boot-scrub-sweep-jtfajzve.js} +3 -3
- package/dist/{boot-seeds-22tx8a53.js → boot-seeds-9qt0j8j2.js} +5 -5
- package/dist/{claude-adapter-0jhgeh1d.js → claude-adapter-a8znhthz.js} +3 -3
- package/dist/{claude-sdk-session-wh77rh83.js → claude-sdk-session-7x7chdrs.js} +7590 -7578
- package/dist/{cli-ypgba1a8.js → cli-0jngabtb.js} +1 -1
- package/dist/{cli-tx2zvn23.js → cli-43jg9xdw.js} +3 -3
- package/dist/{cli-6qxmjpem.js → cli-47zfzshm.js} +5 -5
- package/dist/{cli-mkdsy1nq.js → cli-74ez9b66.js} +3 -2
- package/dist/{cli-ykt8f7va.js → cli-9q0bh411.js} +1 -1
- package/dist/{cli-p8rt8spp.js → cli-9q24yyvs.js} +2 -2
- package/dist/{cli-cexctgn5.js → cli-aj1e0h0d.js} +1 -1
- package/dist/{cli-z1dqhc9y.js → cli-bcspch6h.js} +1 -1
- package/dist/{cli-wydz3feg.js → cli-ee0402n1.js} +107 -30
- package/dist/{cli-ty4bzkqr.js → cli-ew0c3a1j.js} +1 -1
- package/dist/{cli-v1pwxreq.js → cli-ewhwpyrb.js} +1 -1
- package/dist/{cli-kw0jcfje.js → cli-fhj4y16f.js} +1 -1
- package/dist/{cli-m7vmeepg.js → cli-fqq06kkb.js} +1 -1
- package/dist/{cli-577bxkf6.js → cli-g6gx2dn1.js} +31 -6
- package/dist/{cli-c8r99akr.js → cli-j05x7pnb.js} +8 -8
- package/dist/{cli-c2tpw9ck.js → cli-jb931ba2.js} +1 -1
- package/dist/{cli-mxry91sa.js → cli-nctfv2yy.js} +72 -3
- package/dist/{cli-ymmc1zxg.js → cli-ng1pmdx6.js} +3 -3
- package/dist/{cli-6vfz44sr.js → cli-p5jqk8fr.js} +1 -1
- package/dist/{cli-qzmzwegq.js → cli-pgehz8e1.js} +4 -4
- package/dist/{cli-cf2vgn9d.js → cli-rr5z1j4p.js} +14 -14
- package/dist/{cli-1yrcfa5s.js → cli-svah6b6w.js} +4 -4
- package/dist/{cli-y0kjpfm9.js → cli-ytmmyj7f.js} +2 -2
- package/dist/{cli-pkj1w46r.js → cli-z48ggfyq.js} +1 -1
- package/dist/cli.js +13 -13
- package/dist/{codex-adapter-cgesnjkr.js → codex-adapter-n63k33d3.js} +2 -2
- package/dist/{codex-session-runner-8kd7ddhr.js → codex-session-runner-xkxfd81a.js} +2 -2
- package/dist/{commands-h6zaaxym.js → commands-q4mfhn51.js} +2 -2
- package/dist/{db-qg3myn53.js → db-1t0bj3pc.js} +2 -2
- package/dist/{dispatcher-7vnwj9qw.js → dispatcher-k1fhavcf.js} +10 -10
- package/dist/{dsh-adapter-tz6hfp5r.js → dsh-adapter-5423p70m.js} +1 -1
- package/dist/{grok-adapter-jdt2dz2s.js → grok-adapter-phrndeb8.js} +3 -3
- package/dist/{handlers-2qtkpncr.js → handlers-59ywqwzh.js} +13 -13
- package/dist/{hook-qnbdgwvd.js → hook-atj0swc2.js} +2 -2
- package/dist/{hook-51yfcgsv.js → hook-mew1chq9.js} +1 -1
- package/dist/{http-jsmtag08.js → http-ef2fnn9v.js} +659 -26
- package/dist/{index-t4g06w93.js → index-48pb9erw.js} +10 -10
- package/dist/{index-ekywyv2v.js → index-9fc2h7ww.js} +10 -10
- package/dist/{index-2t9kesn1.js → index-gr69c43q.js} +2 -2
- package/dist/{index-cx1sb9bq.js → index-h26wjcfy.js} +16 -6
- package/dist/{index-bt8wkv1w.js → index-w2yhye23.js} +11 -11
- package/dist/{keepalive-4aezx4bj.js → keepalive-qhcqz56v.js} +4 -4
- package/dist/{lead-r44bkpm5.js → lead-hpk5r3b1.js} +18 -18
- package/dist/{maintenance-grz5jrzh.js → maintenance-nvkyp2xe.js} +2 -2
- package/dist/{oauth-refresh-sweep-wm4ctjfj.js → oauth-refresh-sweep-ngskthwh.js} +3 -3
- package/dist/{onboard-v60zgqf0.js → onboard-yfnkqhxc.js} +2 -2
- package/dist/{otel-impl-ghh4dyf8.js → otel-impl-hhm64r6m.js} +1 -1
- package/dist/{pricing-refresh-mjrqvnvw.js → pricing-refresh-35f91nx2.js} +4 -4
- package/dist/{rbac-roles-axv4d74x.js → rbac-roles-97w370qj.js} +3 -3
- package/dist/{rbac-roles-fd5tskj9.js → rbac-roles-z6sje3gy.js} +2 -2
- package/dist/{render-v2-k50j33qd.js → render-v2-n4v66bj3.js} +3 -3
- package/dist/{setup-4syh0pd2.js → setup-m3hhyv5f.js} +2 -2
- package/dist/{work-objects-jcdbg8rr.js → work-objects-mxf2c842.js} +13 -13
- package/dist/{worker-x8j8c9sx.js → worker-9t07z1gq.js} +18 -18
- package/openapi.json +72 -1
- package/package.json +3 -3
- package/src/be/script-connections.ts +40 -6
- package/src/be/swarm-config-guard.ts +1 -0
- package/src/extensions/catalog.generated.json +17 -0
- package/src/http/script-connections.ts +35 -0
- package/src/providers/acp-targets.ts +1 -1
- package/src/providers/amp-adapter.ts +1 -1
- package/src/providers/claude-adapter.ts +6 -0
- package/src/providers/claude-background-keepalive.ts +100 -0
- package/src/providers/claude-sdk-session.ts +6 -0
- package/src/providers/dsh-adapter.ts +1 -1
- package/src/scheduler/scheduler.ts +82 -13
- package/src/scripts-runtime/executors/registry.ts +1 -1
- package/src/tests/claude-background-keepalive-wiring.test.ts +220 -0
- package/src/tests/claude-background-keepalive.fixture.ts +162 -0
- package/src/tests/claude-background-keepalive.test.ts +139 -0
- package/src/tests/connection-embedded-auth.test.ts +51 -0
- package/src/tests/docs-index-footprint.test.js +3 -3
- package/src/tests/dsh-adapter.test.ts +1 -1
- package/src/tests/extensions-catalog.test.ts +1 -0
- package/src/tests/extensions-example-slack-reply-gate.test.ts +756 -0
- package/src/tests/schedule-target-type.test.ts +136 -0
- package/src/tests/script-connections-http.test.ts +45 -0
- package/src/tests/script-connections-mcp.test.ts +41 -0
- package/src/tests/script-executor-registry.test.ts +18 -0
- package/src/tests/send-task-self-send.test.ts +107 -0
- package/src/tools/script-connections/tool.ts +35 -3
- package/src/tools/send-task.ts +9 -1
- package/templates/extensions/README.md +1 -0
- package/templates/extensions/slack-reply-gate/README.md +98 -0
- package/templates/extensions/slack-reply-gate/hooks.ts +582 -0
- package/templates/extensions/slack-reply-gate/manifest.json +8 -0
- package/templates/skills/swarm-scripts/SKILL.md +10 -0
- package/templates/skills/swarm-scripts/content.md +10 -0
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import {
|
|
2
2
|
seedPricingFromModelsDev
|
|
3
|
-
} from "./cli-
|
|
3
|
+
} from "./cli-ewhwpyrb.js";
|
|
4
4
|
import {
|
|
5
5
|
ensureRbacSeedsSynced,
|
|
6
6
|
init_rbac_roles
|
|
7
|
-
} from "./cli-
|
|
7
|
+
} from "./cli-0jngabtb.js";
|
|
8
8
|
import {
|
|
9
9
|
getDb,
|
|
10
10
|
init_db1 as init_db
|
|
11
|
-
} from "./cli-
|
|
11
|
+
} from "./cli-74ez9b66.js";
|
|
12
12
|
|
|
13
13
|
// src/be/boot-seeds.ts
|
|
14
14
|
init_db();
|
|
@@ -5,12 +5,12 @@ import {
|
|
|
5
5
|
instantFlush,
|
|
6
6
|
requestSlackThreadSteering,
|
|
7
7
|
wasEventSeen
|
|
8
|
-
} from "./cli-
|
|
8
|
+
} from "./cli-svah6b6w.js";
|
|
9
9
|
import {
|
|
10
10
|
enrichSlackUserEmail,
|
|
11
11
|
resolveSlackUserId,
|
|
12
12
|
rewriteSlackMentions
|
|
13
|
-
} from "./cli-
|
|
13
|
+
} from "./cli-ytmmyj7f.js";
|
|
14
14
|
import {
|
|
15
15
|
TaskCreationBlockedError,
|
|
16
16
|
broadcastMatches,
|
|
@@ -23,14 +23,14 @@ import {
|
|
|
23
23
|
hasOtherUserMention,
|
|
24
24
|
notifySlackFileFailures,
|
|
25
25
|
routeMessage
|
|
26
|
-
} from "./cli-
|
|
26
|
+
} from "./cli-ee0402n1.js";
|
|
27
27
|
import {
|
|
28
28
|
ackSlackMessage,
|
|
29
29
|
buildTreeBlocks,
|
|
30
30
|
ensureSlackThreadTree,
|
|
31
31
|
isSlackRenderV2Enabled,
|
|
32
32
|
registerTreeMessage
|
|
33
|
-
} from "./cli-
|
|
33
|
+
} from "./cli-j05x7pnb.js";
|
|
34
34
|
import {
|
|
35
35
|
getAgentById,
|
|
36
36
|
getAgentWorkingOnThread,
|
|
@@ -43,7 +43,7 @@ import {
|
|
|
43
43
|
isExtensionAgent,
|
|
44
44
|
reactionName,
|
|
45
45
|
slackContextKey
|
|
46
|
-
} from "./cli-
|
|
46
|
+
} from "./cli-74ez9b66.js";
|
|
47
47
|
import {
|
|
48
48
|
init_resolver,
|
|
49
49
|
resolveTemplate
|
|
@@ -103,7 +103,7 @@ import {
|
|
|
103
103
|
import {
|
|
104
104
|
init_package,
|
|
105
105
|
package_default
|
|
106
|
-
} from "./cli-
|
|
106
|
+
} from "./cli-ng1pmdx6.js";
|
|
107
107
|
import {
|
|
108
108
|
init_bus,
|
|
109
109
|
realtimeBus
|
|
@@ -12118,7 +12118,7 @@ var init_runtime = __esm(() => {
|
|
|
12118
12118
|
// src/telemetry-identity.ts
|
|
12119
12119
|
async function loadUserRole(userId) {
|
|
12120
12120
|
try {
|
|
12121
|
-
const { getUserGrant } = await import("./rbac-roles-
|
|
12121
|
+
const { getUserGrant } = await import("./rbac-roles-97w370qj.js");
|
|
12122
12122
|
const grant = await getUserGrant(userId);
|
|
12123
12123
|
const role = grant.grantsAll ? "admin" : "member";
|
|
12124
12124
|
if (roleCache.size >= ROLE_CACHE_LIMIT) {
|
|
@@ -14790,6 +14790,7 @@ var init_swarm_config_guard = __esm(() => {
|
|
|
14790
14790
|
return `Invalid HARNESS_PROVIDER value (must be one of: ${ProviderNameSchema.options.join(", ")})`;
|
|
14791
14791
|
},
|
|
14792
14792
|
...enumValidator("CLAUDE_TRANSPORT", ["cli", "sdk"]),
|
|
14793
|
+
...enumValidator("SCRIPT_EXECUTOR", ["native", "quickjs"]),
|
|
14793
14794
|
...enumValidator("MODEL_WINDOW_EXHAUSTED_POLICY", ["fail", "fallback"]),
|
|
14794
14795
|
CODEX_CREDITS_EXHAUSTED_COOLDOWN_MS: (value) => {
|
|
14795
14796
|
const str2 = String(value).trim();
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import {
|
|
2
2
|
buildModelsDevSeedRows,
|
|
3
3
|
loadModelsDevCache
|
|
4
|
-
} from "./cli-
|
|
4
|
+
} from "./cli-ewhwpyrb.js";
|
|
5
5
|
import {
|
|
6
6
|
createLogEntry,
|
|
7
7
|
getActivePricingRow,
|
|
8
8
|
getDbClient,
|
|
9
9
|
init_db1 as init_db,
|
|
10
10
|
insertPricingRow
|
|
11
|
-
} from "./cli-
|
|
11
|
+
} from "./cli-74ez9b66.js";
|
|
12
12
|
import {
|
|
13
13
|
init_runtime_model_catalog,
|
|
14
14
|
setRuntimeModelCatalog
|
|
@@ -20,7 +20,7 @@ import {
|
|
|
20
20
|
import {
|
|
21
21
|
ensurePricingSeeded,
|
|
22
22
|
ensureRbacSeeded
|
|
23
|
-
} from "./cli-
|
|
23
|
+
} from "./cli-43jg9xdw.js";
|
|
24
24
|
import {
|
|
25
25
|
buildCatalogEntries,
|
|
26
26
|
getCatalogGeneration,
|
|
@@ -30,10 +30,10 @@ import {
|
|
|
30
30
|
requestModelCatalogRefresh,
|
|
31
31
|
startPricingRefreshLoop,
|
|
32
32
|
upsertModelCatalogOverlay
|
|
33
|
-
} from "./cli-
|
|
33
|
+
} from "./cli-9q24yyvs.js";
|
|
34
34
|
import {
|
|
35
35
|
loadModelsDevCache
|
|
36
|
-
} from "./cli-
|
|
36
|
+
} from "./cli-ewhwpyrb.js";
|
|
37
37
|
import {
|
|
38
38
|
AppDefinitionSchema,
|
|
39
39
|
AppElementsSchema,
|
|
@@ -64,6 +64,7 @@ import {
|
|
|
64
64
|
decodeAppDefinition,
|
|
65
65
|
definitionNodeIds,
|
|
66
66
|
deleteApp,
|
|
67
|
+
deleteScriptConnection,
|
|
67
68
|
disableCredentialBinding,
|
|
68
69
|
extractArgsJsonSchema,
|
|
69
70
|
extractScriptSignature,
|
|
@@ -106,7 +107,7 @@ import {
|
|
|
106
107
|
validateDefinition,
|
|
107
108
|
validateScriptImports,
|
|
108
109
|
writeBareImportShim
|
|
109
|
-
} from "./cli-
|
|
110
|
+
} from "./cli-g6gx2dn1.js";
|
|
110
111
|
import {
|
|
111
112
|
getApiKey
|
|
112
113
|
} from "./cli-f14fvzag.js";
|
|
@@ -121,7 +122,7 @@ import {
|
|
|
121
122
|
ensureToken,
|
|
122
123
|
ensureTokenOrThrow,
|
|
123
124
|
onAuthorizationRefreshed
|
|
124
|
-
} from "./cli-
|
|
125
|
+
} from "./cli-fhj4y16f.js";
|
|
125
126
|
import {
|
|
126
127
|
AgentFsProvider,
|
|
127
128
|
getFileStorageProvider,
|
|
@@ -156,11 +157,11 @@ import {
|
|
|
156
157
|
taskCitationWarnings,
|
|
157
158
|
upsertTaskCitations,
|
|
158
159
|
withSpan
|
|
159
|
-
} from "./cli-
|
|
160
|
+
} from "./cli-j05x7pnb.js";
|
|
160
161
|
import {
|
|
161
162
|
getUserGrant,
|
|
162
163
|
init_rbac_roles
|
|
163
|
-
} from "./cli-
|
|
164
|
+
} from "./cli-0jngabtb.js";
|
|
164
165
|
import {
|
|
165
166
|
can,
|
|
166
167
|
decideAdmission,
|
|
@@ -431,6 +432,7 @@ import {
|
|
|
431
432
|
promoteDraftTask,
|
|
432
433
|
reassociateSessionLogs,
|
|
433
434
|
recordBudgetRefusalNotification,
|
|
435
|
+
recordInlineScriptRun,
|
|
434
436
|
recordSlackMessage,
|
|
435
437
|
refreshDraftTaskLease,
|
|
436
438
|
rejectTask,
|
|
@@ -488,7 +490,7 @@ import {
|
|
|
488
490
|
upsertSwarmConfig,
|
|
489
491
|
validateConfigValue,
|
|
490
492
|
workflowContextKey
|
|
491
|
-
} from "./cli-
|
|
493
|
+
} from "./cli-74ez9b66.js";
|
|
492
494
|
import {
|
|
493
495
|
$OpenAPIRegistry,
|
|
494
496
|
$OpenApiGeneratorV31,
|
|
@@ -652,7 +654,7 @@ import {
|
|
|
652
654
|
import {
|
|
653
655
|
init_package,
|
|
654
656
|
package_default
|
|
655
|
-
} from "./cli-
|
|
657
|
+
} from "./cli-ng1pmdx6.js";
|
|
656
658
|
import {
|
|
657
659
|
init_event_bus,
|
|
658
660
|
workflowEventBus
|
|
@@ -14392,7 +14394,7 @@ async function notifyAutomationPreflightFailure(preflight) {
|
|
|
14392
14394
|
return;
|
|
14393
14395
|
}
|
|
14394
14396
|
try {
|
|
14395
|
-
const { getSlackApp: getSlackApp2 } = await import("./app-
|
|
14397
|
+
const { getSlackApp: getSlackApp2 } = await import("./app-ffes2kyf.js");
|
|
14396
14398
|
const app = getSlackApp2();
|
|
14397
14399
|
if (!app) {
|
|
14398
14400
|
console.warn("[Automation Preflight] Slack not available, cannot send notification");
|
|
@@ -18074,6 +18076,7 @@ var import_cron_parser = __toESM(require_dist2(), 1);
|
|
|
18074
18076
|
init_db2();
|
|
18075
18077
|
init_db();
|
|
18076
18078
|
init_telemetry();
|
|
18079
|
+
init_secret_scrubber();
|
|
18077
18080
|
|
|
18078
18081
|
// src/scheduler/deferred-task-waits.ts
|
|
18079
18082
|
init_db2();
|
|
@@ -18500,18 +18503,64 @@ async function executeScheduleScript(schedule) {
|
|
|
18500
18503
|
throw new Error(`Script '${schedule.scriptName}' not found`);
|
|
18501
18504
|
}
|
|
18502
18505
|
const agentId = schedule.createdByAgentId ?? "schedule";
|
|
18503
|
-
const
|
|
18504
|
-
|
|
18505
|
-
args: schedule.scriptArgs ?? {},
|
|
18506
|
-
fsMode: "none",
|
|
18506
|
+
const args = schedule.scriptArgs ?? {};
|
|
18507
|
+
const record2 = {
|
|
18507
18508
|
agentId,
|
|
18508
|
-
|
|
18509
|
-
|
|
18510
|
-
|
|
18511
|
-
|
|
18512
|
-
|
|
18509
|
+
scriptName: schedule.scriptName,
|
|
18510
|
+
source: `// Scheduled run of '${script.name}' v${script.version} (global, contentHash ${script.contentHash}) by schedule '${schedule.name}'.
|
|
18511
|
+
// Full source: script_versions row for this version.
|
|
18512
|
+
`,
|
|
18513
|
+
args,
|
|
18514
|
+
startedAt: new Date().toISOString()
|
|
18515
|
+
};
|
|
18516
|
+
let output;
|
|
18517
|
+
try {
|
|
18518
|
+
output = await runScript({
|
|
18519
|
+
source: script.source,
|
|
18520
|
+
args,
|
|
18521
|
+
fsMode: "none",
|
|
18522
|
+
agentId,
|
|
18523
|
+
egressSecrets: await buildScriptCredentialBindings({ agentId }),
|
|
18524
|
+
apiConnections: getScriptApiConnectionDescriptors({ agentId }),
|
|
18525
|
+
mcpConnections: getScriptMcpConnectionDescriptors({ agentId }),
|
|
18526
|
+
timeoutMs: 60000
|
|
18527
|
+
});
|
|
18528
|
+
} catch (err) {
|
|
18529
|
+
await recordScheduleScriptRun({
|
|
18530
|
+
...record2,
|
|
18531
|
+
status: "failed",
|
|
18532
|
+
error: err instanceof Error ? err.message : String(err)
|
|
18533
|
+
});
|
|
18534
|
+
throw err;
|
|
18535
|
+
}
|
|
18513
18536
|
if (output.exitCode !== 0 || output.error) {
|
|
18514
|
-
|
|
18537
|
+
const message = output.stderr || `Script '${schedule.scriptName}' exited with code ${output.exitCode}${output.error ? ` (${output.error})` : ""}`;
|
|
18538
|
+
await recordScheduleScriptRun({
|
|
18539
|
+
...record2,
|
|
18540
|
+
status: "failed",
|
|
18541
|
+
output: output.result,
|
|
18542
|
+
error: message
|
|
18543
|
+
});
|
|
18544
|
+
throw new Error(message);
|
|
18545
|
+
}
|
|
18546
|
+
await recordScheduleScriptRun({ ...record2, status: "completed", output: output.result });
|
|
18547
|
+
}
|
|
18548
|
+
async function recordScheduleScriptRun(run) {
|
|
18549
|
+
try {
|
|
18550
|
+
await recordInlineScriptRun({
|
|
18551
|
+
id: crypto.randomUUID(),
|
|
18552
|
+
agentId: run.agentId,
|
|
18553
|
+
scriptName: run.scriptName,
|
|
18554
|
+
source: run.source,
|
|
18555
|
+
args: scrubObject(run.args),
|
|
18556
|
+
status: run.status,
|
|
18557
|
+
output: scrubObject(run.output),
|
|
18558
|
+
error: run.error === undefined ? undefined : scrubSecrets(run.error),
|
|
18559
|
+
startedAt: run.startedAt,
|
|
18560
|
+
finishedAt: new Date().toISOString()
|
|
18561
|
+
});
|
|
18562
|
+
} catch (err) {
|
|
18563
|
+
console.warn(`[scheduler] could not record script run for '${run.scriptName}': ${scrubSecrets(err instanceof Error ? err.message : String(err))}`);
|
|
18515
18564
|
}
|
|
18516
18565
|
}
|
|
18517
18566
|
|
|
@@ -29180,7 +29229,7 @@ async function notifySlack(text) {
|
|
|
29180
29229
|
return;
|
|
29181
29230
|
}
|
|
29182
29231
|
try {
|
|
29183
|
-
const { getSlackApp: getSlackApp2 } = await import("./app-
|
|
29232
|
+
const { getSlackApp: getSlackApp2 } = await import("./app-ffes2kyf.js");
|
|
29184
29233
|
const app = getSlackApp2();
|
|
29185
29234
|
if (!app) {
|
|
29186
29235
|
console.warn("[Jira webhook keepalive] Slack not available, cannot send notification");
|
|
@@ -29251,7 +29300,7 @@ async function deleteJiraWebhook(webhookId) {
|
|
|
29251
29300
|
console.log(`[Jira webhook keepalive] Deleted webhook id=${webhookId}`);
|
|
29252
29301
|
}
|
|
29253
29302
|
async function overwriteWebhookIds(next) {
|
|
29254
|
-
const { getDbClient: getDbClient2 } = await import("./db-
|
|
29303
|
+
const { getDbClient: getDbClient2 } = await import("./db-1t0bj3pc.js");
|
|
29255
29304
|
await getDbClient2().transaction(async (tx) => {
|
|
29256
29305
|
const row = await tx.get("SELECT metadata FROM oauth_apps WHERE provider = 'jira'");
|
|
29257
29306
|
if (!row) {
|
|
@@ -103056,7 +103105,7 @@ async function reloadGlobalConfigsAndIntegrations() {
|
|
|
103056
103105
|
return runWithoutRequestAuth(() => reloadGlobalConfigsAndIntegrationsInner());
|
|
103057
103106
|
}
|
|
103058
103107
|
async function reloadGlobalConfigsAndIntegrationsInner() {
|
|
103059
|
-
const { getEmbeddingProvider: getEmbeddingProvider2, resetEmbeddingProvider } = await import("./index-
|
|
103108
|
+
const { getEmbeddingProvider: getEmbeddingProvider2, resetEmbeddingProvider } = await import("./index-gr69c43q.js");
|
|
103060
103109
|
const wasEmbeddingsConfigured = getEmbeddingProvider2().isConfigured();
|
|
103061
103110
|
const updated = await loadGlobalConfigsIntoEnv(true);
|
|
103062
103111
|
await stopSlackApp();
|
|
@@ -103069,10 +103118,10 @@ async function reloadGlobalConfigsAndIntegrationsInner() {
|
|
|
103069
103118
|
integrations.push("embeddings");
|
|
103070
103119
|
}
|
|
103071
103120
|
if (!wasEmbeddingsConfigured && isEmbeddingsConfigured) {
|
|
103072
|
-
import("./boot-reembed-
|
|
103121
|
+
import("./boot-reembed-jvfadhsk.js").then(({ runBootReembed }) => runBootReembed()).catch((err) => {
|
|
103073
103122
|
console.error("[config-reload] memory backfill failed (non-fatal):", err);
|
|
103074
103123
|
});
|
|
103075
|
-
import("./boot-reembed-
|
|
103124
|
+
import("./boot-reembed-20q3nzvg.js").then(({ runBootReembedScripts }) => runBootReembedScripts()).catch((err) => {
|
|
103076
103125
|
console.error("[config-reload] script backfill failed (non-fatal):", err);
|
|
103077
103126
|
});
|
|
103078
103127
|
}
|
|
@@ -104190,7 +104239,7 @@ function setPreloadedTools(server, names) {
|
|
|
104190
104239
|
async function applyPreToolCall(name, args, requestInfo, inputSchema) {
|
|
104191
104240
|
if (requestInfo.callOrigin !== "mcp")
|
|
104192
104241
|
return { args };
|
|
104193
|
-
const dispatcher = await import("./dispatcher-
|
|
104242
|
+
const dispatcher = await import("./dispatcher-k1fhavcf.js");
|
|
104194
104243
|
const result = await dispatcher.dispatchPre("pre.tool.call", { tool: name, args, requestInfo }, inputSchema ? {
|
|
104195
104244
|
validateModify: async (data) => {
|
|
104196
104245
|
const schema = normalizeObjectSchema(inputSchema) ?? inputSchema;
|
|
@@ -125161,8 +125210,16 @@ init_zod();
|
|
|
125161
125210
|
init_db2();
|
|
125162
125211
|
init_rbac();
|
|
125163
125212
|
var scriptConnectionsInputSchema = object({
|
|
125164
|
-
action: _enum([
|
|
125165
|
-
|
|
125213
|
+
action: _enum([
|
|
125214
|
+
"list",
|
|
125215
|
+
"upsert-openapi",
|
|
125216
|
+
"upsert-mcp",
|
|
125217
|
+
"upsert-graphql",
|
|
125218
|
+
"refresh",
|
|
125219
|
+
"disable",
|
|
125220
|
+
"delete"
|
|
125221
|
+
]).describe("List, create/update, refresh, disable, or delete a script connection. delete is permanent: it removes the connection, its managed credential binding, and any inline secret it owns."),
|
|
125222
|
+
id: string().uuid().optional().describe("Existing connection ID for update, refresh, disable, or delete."),
|
|
125166
125223
|
slug: string().min(1).max(80).optional().describe("Stable script namespace slug exposed under ctx.api or ctx.mcp."),
|
|
125167
125224
|
displayName: string().max(160).optional().describe("Human-readable connection name."),
|
|
125168
125225
|
scope: _enum(["global", "agent", "repo"]).optional().describe("Connection visibility scope."),
|
|
@@ -125251,6 +125308,26 @@ var registerScriptConnectionsTool = (server) => {
|
|
|
125251
125308
|
data: { yourAgentId: requestInfo.agentId, connections: connections2 }
|
|
125252
125309
|
});
|
|
125253
125310
|
}
|
|
125311
|
+
if (args2.action === "delete") {
|
|
125312
|
+
if (!args2.id) {
|
|
125313
|
+
return toolErr("id is required for delete.", {
|
|
125314
|
+
data: {
|
|
125315
|
+
yourAgentId: requestInfo.agentId,
|
|
125316
|
+
connections: listScriptConnections({ includeDisabled: true, allScopes: true })
|
|
125317
|
+
}
|
|
125318
|
+
});
|
|
125319
|
+
}
|
|
125320
|
+
const deleted = await deleteScriptConnection(args2.id);
|
|
125321
|
+
const connections2 = listScriptConnections({ includeDisabled: true, allScopes: true });
|
|
125322
|
+
if (!deleted) {
|
|
125323
|
+
return toolErr(`Script connection ${args2.id} not found.`, {
|
|
125324
|
+
data: { yourAgentId: requestInfo.agentId, connections: connections2 }
|
|
125325
|
+
});
|
|
125326
|
+
}
|
|
125327
|
+
return toolOk(`Script connection ${deleted.slug} deleted.`, {
|
|
125328
|
+
data: { yourAgentId: requestInfo.agentId, connections: connections2 }
|
|
125329
|
+
});
|
|
125330
|
+
}
|
|
125254
125331
|
if (args2.action === "refresh") {
|
|
125255
125332
|
if (!args2.id) {
|
|
125256
125333
|
return toolErr("id is required for refresh.", {
|
|
@@ -125946,7 +126023,7 @@ async function sendTaskHandler(ctx, {
|
|
|
125946
126023
|
data: { yourAgentId: creatorAgentId }
|
|
125947
126024
|
});
|
|
125948
126025
|
}
|
|
125949
|
-
if (ctx.kind === "owner" && requestedAgentId === ctx.agentId) {
|
|
126026
|
+
if (ctx.kind === "owner" && requestedAgentId === ctx.agentId && ctx.requestInfo?.callOrigin !== "script-sdk") {
|
|
125950
126027
|
return toolErr("Cannot send a task to yourself, are you drunk?", {
|
|
125951
126028
|
data: { yourAgentId: ctx.agentId }
|
|
125952
126029
|
});
|
|
@@ -134610,7 +134687,7 @@ class NotifyExecutor extends BaseExecutor {
|
|
|
134610
134687
|
}
|
|
134611
134688
|
}
|
|
134612
134689
|
case "slack": {
|
|
134613
|
-
const { getSlackApp: getSlackApp2 } = await import("./app-
|
|
134690
|
+
const { getSlackApp: getSlackApp2 } = await import("./app-ffes2kyf.js");
|
|
134614
134691
|
const app = getSlackApp2();
|
|
134615
134692
|
if (!app) {
|
|
134616
134693
|
return {
|
|
@@ -36,7 +36,7 @@ import { mkdir, mkdtemp, rm, writeFile } from "node:fs/promises";
|
|
|
36
36
|
import { tmpdir } from "node:os";
|
|
37
37
|
import { join } from "node:path";
|
|
38
38
|
init_secret_scrubber();
|
|
39
|
-
var AMP_PACKAGE = "@ampcode/cli@0.0.
|
|
39
|
+
var AMP_PACKAGE = "@ampcode/cli@0.0.1791547250-gb79b2a";
|
|
40
40
|
var AMP_MCP_SERVER_NAME = "agent-swarm";
|
|
41
41
|
var AMP_PLUGIN_MODE_KEY = "agent-swarm";
|
|
42
42
|
var AMP_LIVE_TEST_TIMEOUT_MS = 5000;
|
|
@@ -19,10 +19,10 @@ import {
|
|
|
19
19
|
generateRandomCodeVerifier,
|
|
20
20
|
generateRandomState,
|
|
21
21
|
oauthAppRowToProviderConfig
|
|
22
|
-
} from "./cli-
|
|
22
|
+
} from "./cli-fhj4y16f.js";
|
|
23
23
|
import {
|
|
24
24
|
getSlackApp
|
|
25
|
-
} from "./cli-
|
|
25
|
+
} from "./cli-j05x7pnb.js";
|
|
26
26
|
import {
|
|
27
27
|
CredentialBroker,
|
|
28
28
|
DEFAULT_CREDENTIAL_BINDINGS,
|
|
@@ -59,7 +59,7 @@ import {
|
|
|
59
59
|
updateAuthorizationTokens,
|
|
60
60
|
upsertAuthorization,
|
|
61
61
|
upsertSwarmConfig
|
|
62
|
-
} from "./cli-
|
|
62
|
+
} from "./cli-74ez9b66.js";
|
|
63
63
|
import {
|
|
64
64
|
TERMINAL_TASK_STATUSES,
|
|
65
65
|
defaultAssetKey,
|
|
@@ -175597,7 +175597,7 @@ class HumanInTheLoopExecutor extends BaseExecutor {
|
|
|
175597
175597
|
}
|
|
175598
175598
|
if (notification.channel === "slack") {
|
|
175599
175599
|
try {
|
|
175600
|
-
const { getSlackApp: getSlackApp2 } = await import("./app-
|
|
175600
|
+
const { getSlackApp: getSlackApp2 } = await import("./app-ffes2kyf.js");
|
|
175601
175601
|
const slackApp = getSlackApp2();
|
|
175602
175602
|
if (!slackApp) {
|
|
175603
175603
|
console.warn("[HITL] Slack not initialized — cannot send notification");
|
|
@@ -179515,6 +179515,31 @@ async function setScriptConnectionEnabled(id, enabled, userId) {
|
|
|
179515
179515
|
WHERE id = ? RETURNING *`, [enabled ? 1 : 0, new Date().toISOString(), userId ?? null, id]);
|
|
179516
179516
|
return row ? connectionFromRow(row) : null;
|
|
179517
179517
|
}
|
|
179518
|
+
async function deleteScriptConnection(id) {
|
|
179519
|
+
const deleted = await getDbClient().transaction(async (tx) => {
|
|
179520
|
+
await tx.run("PRAGMA defer_foreign_keys = ON");
|
|
179521
|
+
const row = await tx.get("SELECT * FROM script_connections WHERE id = ?", [
|
|
179522
|
+
id
|
|
179523
|
+
]);
|
|
179524
|
+
if (!row)
|
|
179525
|
+
return null;
|
|
179526
|
+
const connection = connectionFromRow(row);
|
|
179527
|
+
await deleteManagedBindingForConnection(id);
|
|
179528
|
+
await tx.run("DELETE FROM script_connections WHERE id = ?", [id]);
|
|
179529
|
+
const secretKey = derivedInlineSecretKey(connection);
|
|
179530
|
+
if (secretKey) {
|
|
179531
|
+
await deleteManagedConnectionSecret({
|
|
179532
|
+
scope: connection.scope,
|
|
179533
|
+
scopeId: connection.scopeId,
|
|
179534
|
+
key: secretKey
|
|
179535
|
+
});
|
|
179536
|
+
}
|
|
179537
|
+
return connection;
|
|
179538
|
+
});
|
|
179539
|
+
if (deleted && derivedInlineSecretKey(deleted))
|
|
179540
|
+
refreshSecretScrubberCache();
|
|
179541
|
+
return deleted;
|
|
179542
|
+
}
|
|
179518
179543
|
function getScriptApiConnectionDescriptors(context = {}) {
|
|
179519
179544
|
return listScriptConnections(context).filter((connection) => connection.kind === "openapi" || connection.kind === "graphql").map((connection) => {
|
|
179520
179545
|
if (!connection.generatedRuntimeJson)
|
|
@@ -180200,7 +180225,7 @@ var EXECUTORS = {
|
|
|
180200
180225
|
quickjs: () => new QuickJSScriptExecutor
|
|
180201
180226
|
};
|
|
180202
180227
|
function getScriptExecutor(name = process.env.SCRIPT_EXECUTOR ?? "native") {
|
|
180203
|
-
const factory = EXECUTORS[name];
|
|
180228
|
+
const factory = EXECUTORS[name.trim()];
|
|
180204
180229
|
if (!factory) {
|
|
180205
180230
|
throw new Error(`Unknown SCRIPT_EXECUTOR: ${name}. Available: ${Object.keys(EXECUTORS).join(", ")}`);
|
|
180206
180231
|
}
|
|
@@ -184927,4 +184952,4 @@ void _scriptMain;
|
|
|
184927
184952
|
});
|
|
184928
184953
|
}
|
|
184929
184954
|
|
|
184930
|
-
export { require_dist, isInvalidClientError, assertUrlSafe, publicEndpointSsrfOptions, discoverProtectedResourceMetadata, discoverAuthorizationServerMetadata, normalizeTokenEndpointAuthMethod, resolveAdvertisedTokenEndpointAuthMethod, authMethodForStoredClient, selectDcrTokenEndpointAuthMethod, registerClient, buildAuthorizeUrl, exchangeCodeForTokens, refreshMcpToken, revokeMcpToken, computeExpiresAt, getMcpOAuthToken, findReusableMcpOAuthClient, invalidateMcpOAuthClient, upsertMcpOAuthToken, applyMcpOAuthRefresh, markMcpOAuthTokenStatus, deleteMcpOAuthToken, insertMcpOAuthPending, consumeMcpOAuthPending, gcMcpOAuthPending, setMcpServerAuthMethod, ensureMcpToken, callMcpServerTool, listVendoredOpenapiEntries, ConnectionAuthInputSchema, connectionAuthSummary, listRelationalCredentialBindings, getCredentialBindingById, findCredentialBindingByIdentity, upsertCredentialBinding, disableCredentialBinding, listScriptConnections, listScriptConnectionsAsync, getScriptConnectionById, ScriptConnectionConflictError, connectionAuthInputFromFlat, upsertScriptConnection, refreshScriptConnection, setScriptConnectionEnabled, getScriptApiConnectionDescriptors, getScriptMcpConnectionDescriptors, getScriptApiTypes, getScriptMcpTypes, oauthAppToProviderConfig, getOAuthProviderConfig, getOAuthBindingTokenStatus, buildScriptCredentialBindingsWithFailures, buildScriptCredentialBindings, buildSandboxedCommand, sandboxSpawnEnv, createCappedStreamState, snapshotCapped, readStreamCapped, writeBareImportShim, MIN_SCRIPT_WALL_CLOCK_MS, SCRIPT_LONG_TIMEOUT_HINT_MS, MAX_SCRIPT_WALL_CLOCK_MS, DEFAULT_SCRIPT_RESOURCES, require_typescript, checkImportAllowlist, validateScriptImports, runScript, BaseExecutor, postApprovalCancellationUpdates, createApprovalFollowUpTask, HumanInTheLoopExecutor, resolveWorkflowLlmConfig, SYSTEM_ONE_DECISION_NODE_TYPE, systemOneRetryViolations, systemOneUnresolvedError, SystemOneDecisionExecutor, getNextTargets, generateEdges, findEntryNodes, resolveValidationPort, getSuccessors, definitionNodeIds, validateDefinition, applyDefinitionPatch, extractScriptSignature, extractArgsJsonSchema, getSavedScriptOwnerAgentId, runSavedScriptAsAgent, resolveSyncRunAs, AppNameSchema, ColumnKindSchema, isIso8601Date, SYSTEM_COLUMN_KINDS, SORTABLE_SYSTEM_DATE_COLUMNS, AppElementsSchema, AppDefinitionSchema, collectScriptReferences, parseAppDefinition, applyAppDefinitionPatch, upgradeAppDefinition, decodeAppDefinition, appDefinitionNeedsRepair, createApp, getApp, listApps, listAppRecords, updateApp, deleteApp, getScriptAppTypes, SCRIPT_SDK_TYPES, scriptSdkTypesWithGeneratedApis, SCRIPT_STDLIB_MODULE_TYPES, scriptStdlibTypesWithGeneratedApis, typecheckWithAmbient, typecheckScript };
|
|
184955
|
+
export { require_dist, isInvalidClientError, assertUrlSafe, publicEndpointSsrfOptions, discoverProtectedResourceMetadata, discoverAuthorizationServerMetadata, normalizeTokenEndpointAuthMethod, resolveAdvertisedTokenEndpointAuthMethod, authMethodForStoredClient, selectDcrTokenEndpointAuthMethod, registerClient, buildAuthorizeUrl, exchangeCodeForTokens, refreshMcpToken, revokeMcpToken, computeExpiresAt, getMcpOAuthToken, findReusableMcpOAuthClient, invalidateMcpOAuthClient, upsertMcpOAuthToken, applyMcpOAuthRefresh, markMcpOAuthTokenStatus, deleteMcpOAuthToken, insertMcpOAuthPending, consumeMcpOAuthPending, gcMcpOAuthPending, setMcpServerAuthMethod, ensureMcpToken, callMcpServerTool, listVendoredOpenapiEntries, ConnectionAuthInputSchema, connectionAuthSummary, listRelationalCredentialBindings, getCredentialBindingById, findCredentialBindingByIdentity, upsertCredentialBinding, disableCredentialBinding, listScriptConnections, listScriptConnectionsAsync, getScriptConnectionById, ScriptConnectionConflictError, connectionAuthInputFromFlat, upsertScriptConnection, refreshScriptConnection, setScriptConnectionEnabled, deleteScriptConnection, getScriptApiConnectionDescriptors, getScriptMcpConnectionDescriptors, getScriptApiTypes, getScriptMcpTypes, oauthAppToProviderConfig, getOAuthProviderConfig, getOAuthBindingTokenStatus, buildScriptCredentialBindingsWithFailures, buildScriptCredentialBindings, buildSandboxedCommand, sandboxSpawnEnv, createCappedStreamState, snapshotCapped, readStreamCapped, writeBareImportShim, MIN_SCRIPT_WALL_CLOCK_MS, SCRIPT_LONG_TIMEOUT_HINT_MS, MAX_SCRIPT_WALL_CLOCK_MS, DEFAULT_SCRIPT_RESOURCES, require_typescript, checkImportAllowlist, validateScriptImports, runScript, BaseExecutor, postApprovalCancellationUpdates, createApprovalFollowUpTask, HumanInTheLoopExecutor, resolveWorkflowLlmConfig, SYSTEM_ONE_DECISION_NODE_TYPE, systemOneRetryViolations, systemOneUnresolvedError, SystemOneDecisionExecutor, getNextTargets, generateEdges, findEntryNodes, resolveValidationPort, getSuccessors, definitionNodeIds, validateDefinition, applyDefinitionPatch, extractScriptSignature, extractArgsJsonSchema, getSavedScriptOwnerAgentId, runSavedScriptAsAgent, resolveSyncRunAs, AppNameSchema, ColumnKindSchema, isIso8601Date, SYSTEM_COLUMN_KINDS, SORTABLE_SYSTEM_DATE_COLUMNS, AppElementsSchema, AppDefinitionSchema, collectScriptReferences, parseAppDefinition, applyAppDefinitionPatch, upgradeAppDefinition, decodeAppDefinition, appDefinitionNeedsRepair, createApp, getApp, listApps, listAppRecords, updateApp, deleteApp, getScriptAppTypes, SCRIPT_SDK_TYPES, scriptSdkTypesWithGeneratedApis, SCRIPT_STDLIB_MODULE_TYPES, scriptStdlibTypesWithGeneratedApis, typecheckWithAmbient, typecheckScript };
|
|
@@ -69,7 +69,7 @@ import {
|
|
|
69
69
|
setSlackMessageTracking,
|
|
70
70
|
slackContextKey,
|
|
71
71
|
updateSlackMessageRecord
|
|
72
|
-
} from "./cli-
|
|
72
|
+
} from "./cli-74ez9b66.js";
|
|
73
73
|
import {
|
|
74
74
|
init_types,
|
|
75
75
|
isTerminalTaskStatus
|
|
@@ -52915,7 +52915,7 @@ async function initOtel(serviceRole = process.env.AGENT_ROLE || "api") {
|
|
|
52915
52915
|
return;
|
|
52916
52916
|
initialized = true;
|
|
52917
52917
|
try {
|
|
52918
|
-
const impl = await import("./otel-impl-
|
|
52918
|
+
const impl = await import("./otel-impl-hhm64r6m.js");
|
|
52919
52919
|
await impl.boot(serviceRole, {
|
|
52920
52920
|
exportConsoleLogs: serviceRole === "api" && isApiLogExportEnabled()
|
|
52921
52921
|
});
|
|
@@ -54410,15 +54410,15 @@ async function initSlackApp() {
|
|
|
54410
54410
|
...clientOptions ? { clientOptions } : {}
|
|
54411
54411
|
});
|
|
54412
54412
|
initialized2 = true;
|
|
54413
|
-
const { registerMessageHandler } = await import("./handlers-
|
|
54414
|
-
const { registerCommandHandler } = await import("./commands-
|
|
54415
|
-
const { registerActionHandlers } = await import("./actions-
|
|
54416
|
-
const { registerWorkObjectHandlers } = await import("./work-objects-
|
|
54413
|
+
const { registerMessageHandler } = await import("./handlers-59ywqwzh.js");
|
|
54414
|
+
const { registerCommandHandler } = await import("./commands-q4mfhn51.js");
|
|
54415
|
+
const { registerActionHandlers } = await import("./actions-7jg840nr.js");
|
|
54416
|
+
const { registerWorkObjectHandlers } = await import("./work-objects-mxf2c842.js");
|
|
54417
54417
|
registerMessageHandler(app);
|
|
54418
54418
|
registerCommandHandler(app);
|
|
54419
54419
|
registerActionHandlers(app);
|
|
54420
54420
|
registerWorkObjectHandlers(app);
|
|
54421
|
-
const { createAssistant } = await import("./assistant-
|
|
54421
|
+
const { createAssistant } = await import("./assistant-fhm5smyz.js");
|
|
54422
54422
|
app.assistant(createAssistant());
|
|
54423
54423
|
return app;
|
|
54424
54424
|
}
|
|
@@ -54427,7 +54427,7 @@ async function startSlackApp() {
|
|
|
54427
54427
|
await initSlackApp();
|
|
54428
54428
|
}
|
|
54429
54429
|
if (app) {
|
|
54430
|
-
const { isSlackRenderV2Enabled: isSlackRenderV2Enabled2 } = await import("./render-v2-
|
|
54430
|
+
const { isSlackRenderV2Enabled: isSlackRenderV2Enabled2 } = await import("./render-v2-n4v66bj3.js");
|
|
54431
54431
|
if (isSlackRenderV2Enabled2())
|
|
54432
54432
|
await ensureSlackRenderV2Activation();
|
|
54433
54433
|
await app.start();
|