@desplega.ai/agent-swarm 1.114.0 → 1.116.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/{actions-bm8vdxys.js → actions-brtj223f.js} +6 -6
- package/dist/{app-bhwdxmvp.js → app-00sngzz7.js} +4 -4
- package/dist/{assistant-15mp2apr.js → assistant-j2ser3vg.js} +9 -9
- package/dist/{boot-reembed-b9sbk87z.js → boot-reembed-fv3r1kqg.js} +3 -3
- package/dist/{boot-reembed-awr2179r.js → boot-reembed-v4n0jphx.js} +4 -4
- package/dist/{boot-scrub-logs-c1zsaw9m.js → boot-scrub-logs-72sy5z1r.js} +2 -2
- package/dist/{claude-adapter-2k45y7p7.js → claude-adapter-3csn5bks.js} +2 -2
- package/dist/{cli-hq39e630.js → cli-0h9yzvhe.js} +95 -10
- package/dist/{cli-49j095n9.js → cli-0pwtr9f0.js} +1 -1
- package/dist/{cli-zmmp2r79.js → cli-2rxckty2.js} +13 -2
- package/dist/{cli-w3nq88yc.js → cli-3ys55x7x.js} +2 -2
- package/dist/{cli-7rgh0w0k.js → cli-50czs4qy.js} +10 -3
- package/dist/{cli-f9n2jg31.js → cli-5g3hx9cc.js} +2 -2
- package/dist/{cli-0kgcv878.js → cli-86fdnerz.js} +63 -2
- package/dist/{cli-a6tzw6vq.js → cli-96nd7vgs.js} +6 -6
- package/dist/{cli-2t4e4ayk.js → cli-9ys4kdd4.js} +46 -5
- package/dist/{cli-hvg05qwm.js → cli-b4hf0g0x.js} +1 -1
- package/dist/{cli-a0t7vapf.js → cli-bc89my0z.js} +1 -1
- package/dist/{cli-q4e2x252.js → cli-cjmz7pp9.js} +73 -24
- package/dist/{cli-tkmm5nf9.js → cli-e61fs2hp.js} +59 -2
- package/dist/{cli-5ktc9fd4.js → cli-et9ab56s.js} +1 -1
- package/dist/{cli-jzwtn8rm.js → cli-k4yp6w9w.js} +188 -18
- package/dist/{cli-6xd0bvf8.js → cli-ma04faw5.js} +1 -1
- package/dist/{cli-ggy8c7tk.js → cli-mnbgv3w7.js} +1 -1
- package/dist/{cli-312v3c41.js → cli-n9kkkmtm.js} +1 -1
- package/dist/{cli-f5pzfvwb.js → cli-qnnbe59j.js} +2 -2
- package/dist/{cli-113wmegp.js → cli-rmyjzd8s.js} +1 -1
- package/dist/{cli-k6h2zkw3.js → cli-tw7xjzk7.js} +1 -1
- package/dist/{cli-r3mtrrzp.js → cli-ty7qe0vp.js} +12 -12
- package/dist/{cli-w4wk3kx6.js → cli-vb7g0zgk.js} +2 -2
- package/dist/{cli-5afkmcfj.js → cli-vggz87j8.js} +6 -6
- package/dist/{cli-byjcad11.js → cli-vnvv6hvm.js} +1 -1
- package/dist/cli-wh91zby6.js +187222 -0
- package/dist/{cli-q1z5d5ss.js → cli-x4trwrcr.js} +4 -4
- package/dist/{cli-pnfyyp6h.js → cli-x9q6bghe.js} +6 -3
- package/dist/{cli-e2xbxmhd.js → cli-xj6zntcq.js} +90 -32
- package/dist/cli.js +11 -11
- package/dist/{codex-adapter-4z8m9mb5.js → codex-adapter-de3w0nch.js} +2 -2
- package/dist/{codex-session-runner-rbct46dg.js → codex-session-runner-bnw8cysk.js} +2 -2
- package/dist/{commands-zk4d6esf.js → commands-4jt6hvc9.js} +2 -2
- package/dist/{db-stn16jp2.js → db-1p5e9zj8.js} +12 -2
- package/dist/{handlers-gshprvpf.js → handlers-5n9gq3ek.js} +9 -9
- package/dist/{hook-amzx9tap.js → hook-ny4kv3r0.js} +1 -1
- package/dist/{http-6g0hfzax.js → http-bb3pva4d.js} +182 -65
- package/dist/{index-f03rnnrs.js → index-ajkj0aaf.js} +9 -9
- package/dist/{index-df8fmphk.js → index-dpcmhqy0.js} +331 -30
- package/dist/{index-jbm7qcqk.js → index-mheeg078.js} +8 -8
- package/dist/{index-ty42rxw9.js → index-nzghbv06.js} +10 -10
- package/dist/{keepalive-pm6g2wpw.js → keepalive-vbgjzp3y.js} +4 -4
- package/dist/{lead-h79fzpzw.js → lead-98bg3kfz.js} +24 -24
- package/dist/{maintenance-433zndy1.js → maintenance-1fp5fz08.js} +4 -4
- package/dist/{oauth-refresh-sweep-mjsbmsk2.js → oauth-refresh-sweep-91s6j3dq.js} +3 -3
- package/dist/{onboard-vdr9hc3f.js → onboard-n32hf2t4.js} +2 -2
- package/dist/{opencode-adapter-mqsxr170.js → opencode-adapter-p6bxnbm4.js} +2 -2
- package/dist/{otel-impl-yswd0fty.js → otel-impl-j42cnqry.js} +1 -1
- package/dist/{pi-mono-adapter-vbrvg1p8.js → pi-mono-adapter-05sck1ds.js} +1 -1
- package/dist/{pricing-refresh-2kk2ap9b.js → pricing-refresh-56gkeqaw.js} +4 -4
- package/dist/{rbac-roles-2wgh9b5t.js → rbac-roles-c1ky22v2.js} +11 -4
- package/dist/{rbac-roles-xdc5208b.js → rbac-roles-xwt8319h.js} +4 -4
- package/dist/{seed-pricing-m9h69d2t.js → seed-pricing-qagjzjqj.js} +3 -3
- package/dist/{setup-eynkvafa.js → setup-1kk84v0w.js} +2 -2
- package/dist/{worker-136q8dc2.js → worker-bmjqg3c6.js} +24 -24
- package/openapi.json +8 -4
- package/package.json +2 -2
- package/src/be/db.ts +253 -20
- package/src/be/migrations/113_task_routing_affinity.sql +9 -0
- package/src/be/migrations/114_backfill_gpt_5_6_pricing.sql +15 -0
- package/src/be/modelsdev-cache.json +135 -0
- package/src/be/rbac-audit.ts +19 -8
- package/src/be/rbac-roles.ts +8 -1
- package/src/be/script-connections.ts +4 -4
- package/src/be/scripts/typecheck.ts +11 -0
- package/src/be/seed-scripts/catalog/catalog-report.inline.ts +325 -24
- package/src/be/seed-scripts/catalog/catalog-report.ts +325 -24
- package/src/heartbeat/heartbeat.ts +143 -21
- package/src/http/favorites.ts +1 -5
- package/src/http/mcp-servers.ts +38 -0
- package/src/http/poll.ts +7 -2
- package/src/http/scripts.ts +6 -0
- package/src/http/skills.ts +11 -0
- package/src/http/tasks.ts +21 -9
- package/src/providers/codex-models.ts +100 -30
- package/src/providers/modelsdev-reasoning.json +51 -0
- package/src/providers/reasoning-effort.ts +11 -5
- package/src/rbac/admission.ts +26 -2
- package/src/rbac/index.ts +2 -2
- package/src/rbac/legacy-policy.ts +9 -0
- package/src/rbac/permissions.ts +36 -0
- package/src/scripts-runtime/api-client.ts +82 -6
- package/src/scripts-runtime/types/swarm-sdk.d.ts +11 -0
- package/src/server-user.ts +114 -59
- package/src/slack/responses.ts +91 -1
- package/src/slack/watcher.ts +9 -6
- package/src/tasks/worker-follow-up.ts +100 -3
- package/src/tests/codex-adapter.test.ts +46 -23
- package/src/tests/heartbeat.test.ts +48 -3
- package/src/tests/model-control.test.ts +8 -2
- package/src/tests/pool-affinity.test.ts +401 -0
- package/src/tests/rbac-admission-e2e.test.ts +152 -7
- package/src/tests/rbac-admission.test.ts +60 -1
- package/src/tests/rbac-engine.test.ts +9 -0
- package/src/tests/rbac-mcp-admission-e2e.test.ts +362 -0
- package/src/tests/rbac-roles.test.ts +2 -0
- package/src/tests/reasoning-effort.test.ts +15 -2
- package/src/tests/script-apis-mcp.test.ts +37 -13
- package/src/tests/script-connections.test.ts +27 -1
- package/src/tests/scripts-runtime.test.ts +187 -0
- package/src/tests/seed-scripts.test.ts +36 -0
- package/src/tests/slack-inline-output.test.ts +65 -0
- package/src/tests/user-token-rest-auth.test.ts +110 -0
- package/src/tools/script-apis.ts +62 -3
- package/src/tools/send-task.ts +15 -1
- package/src/tools/task-action.ts +34 -2
- package/src/tools/templates.ts +48 -0
- package/src/tools/utils.ts +2 -0
- package/src/types.ts +27 -5
- package/dist/cli-46b6kc7f.js +0 -1698
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import {
|
|
2
2
|
resolveSlackUserId
|
|
3
|
-
} from "./cli-
|
|
4
|
-
import"./cli-
|
|
3
|
+
} from "./cli-vb7g0zgk.js";
|
|
4
|
+
import"./cli-rmyjzd8s.js";
|
|
5
5
|
import {
|
|
6
6
|
buildCancelledBlocks,
|
|
7
7
|
getTaskLink
|
|
8
|
-
} from "./cli-
|
|
8
|
+
} from "./cli-ma04faw5.js";
|
|
9
9
|
import"./cli-wspgs9bt.js";
|
|
10
10
|
import {
|
|
11
11
|
createTaskWithSiblingAwareness,
|
|
12
12
|
slackContextKey
|
|
13
|
-
} from "./cli-
|
|
13
|
+
} from "./cli-n9kkkmtm.js";
|
|
14
14
|
import"./cli-dh55d5fg.js";
|
|
15
15
|
import {
|
|
16
16
|
cancelTask,
|
|
@@ -18,11 +18,11 @@ import {
|
|
|
18
18
|
getLeadAgent,
|
|
19
19
|
getTaskById,
|
|
20
20
|
init_db
|
|
21
|
-
} from "./cli-
|
|
21
|
+
} from "./cli-k4yp6w9w.js";
|
|
22
22
|
import"./cli-z2zcxes1.js";
|
|
23
23
|
import"./cli-bw80ck94.js";
|
|
24
24
|
import"./cli-xz9aq0rf.js";
|
|
25
|
-
import"./cli-
|
|
25
|
+
import"./cli-qnnbe59j.js";
|
|
26
26
|
import"./cli-4j2mrzag.js";
|
|
27
27
|
import"./cli-p9swy5t3.js";
|
|
28
28
|
|
|
@@ -3,17 +3,17 @@ import {
|
|
|
3
3
|
initSlackApp,
|
|
4
4
|
startSlackApp,
|
|
5
5
|
stopSlackApp
|
|
6
|
-
} from "./cli-
|
|
6
|
+
} from "./cli-0h9yzvhe.js";
|
|
7
7
|
import"./cli-rkndnn90.js";
|
|
8
8
|
import"./cli-b0p7rfnd.js";
|
|
9
|
-
import"./cli-
|
|
9
|
+
import"./cli-ma04faw5.js";
|
|
10
10
|
import"./cli-wspgs9bt.js";
|
|
11
11
|
import"./cli-dh55d5fg.js";
|
|
12
|
-
import"./cli-
|
|
12
|
+
import"./cli-k4yp6w9w.js";
|
|
13
13
|
import"./cli-z2zcxes1.js";
|
|
14
14
|
import"./cli-bw80ck94.js";
|
|
15
15
|
import"./cli-xz9aq0rf.js";
|
|
16
|
-
import"./cli-
|
|
16
|
+
import"./cli-qnnbe59j.js";
|
|
17
17
|
import"./cli-4j2mrzag.js";
|
|
18
18
|
import"./cli-e15jhafb.js";
|
|
19
19
|
import"./cli-7wmybrt5.js";
|
|
@@ -1,26 +1,26 @@
|
|
|
1
1
|
import {
|
|
2
2
|
bufferThreadMessage,
|
|
3
3
|
wasEventSeen
|
|
4
|
-
} from "./cli-
|
|
4
|
+
} from "./cli-vggz87j8.js";
|
|
5
5
|
import {
|
|
6
6
|
hasOtherUserMention
|
|
7
|
-
} from "./cli-
|
|
7
|
+
} from "./cli-et9ab56s.js";
|
|
8
8
|
import {
|
|
9
9
|
require_dist
|
|
10
|
-
} from "./cli-
|
|
10
|
+
} from "./cli-0h9yzvhe.js";
|
|
11
11
|
import"./cli-rkndnn90.js";
|
|
12
12
|
import"./cli-b0p7rfnd.js";
|
|
13
13
|
import {
|
|
14
14
|
resolveSlackUserId,
|
|
15
15
|
rewriteSlackMentions
|
|
16
|
-
} from "./cli-
|
|
17
|
-
import"./cli-
|
|
18
|
-
import"./cli-
|
|
16
|
+
} from "./cli-vb7g0zgk.js";
|
|
17
|
+
import"./cli-rmyjzd8s.js";
|
|
18
|
+
import"./cli-ma04faw5.js";
|
|
19
19
|
import"./cli-wspgs9bt.js";
|
|
20
20
|
import {
|
|
21
21
|
createTaskWithSiblingAwareness,
|
|
22
22
|
slackContextKey
|
|
23
|
-
} from "./cli-
|
|
23
|
+
} from "./cli-n9kkkmtm.js";
|
|
24
24
|
import"./cli-dh55d5fg.js";
|
|
25
25
|
import {
|
|
26
26
|
getAgentWorkingOnThread,
|
|
@@ -29,11 +29,11 @@ import {
|
|
|
29
29
|
init_db,
|
|
30
30
|
init_resolver,
|
|
31
31
|
resolveTemplate
|
|
32
|
-
} from "./cli-
|
|
32
|
+
} from "./cli-k4yp6w9w.js";
|
|
33
33
|
import"./cli-z2zcxes1.js";
|
|
34
34
|
import"./cli-bw80ck94.js";
|
|
35
35
|
import"./cli-xz9aq0rf.js";
|
|
36
|
-
import"./cli-
|
|
36
|
+
import"./cli-qnnbe59j.js";
|
|
37
37
|
import"./cli-4j2mrzag.js";
|
|
38
38
|
import"./cli-e15jhafb.js";
|
|
39
39
|
import"./cli-7wmybrt5.js";
|
|
@@ -3,16 +3,16 @@ import {
|
|
|
3
3
|
getEmbeddingProvider,
|
|
4
4
|
getMemoryStore,
|
|
5
5
|
init_constants
|
|
6
|
-
} from "./cli-
|
|
6
|
+
} from "./cli-vnvv6hvm.js";
|
|
7
7
|
import"./cli-q25ejbyn.js";
|
|
8
8
|
import {
|
|
9
9
|
getDb,
|
|
10
10
|
init_db
|
|
11
|
-
} from "./cli-
|
|
11
|
+
} from "./cli-k4yp6w9w.js";
|
|
12
12
|
import"./cli-z2zcxes1.js";
|
|
13
13
|
import"./cli-bw80ck94.js";
|
|
14
14
|
import"./cli-xz9aq0rf.js";
|
|
15
|
-
import"./cli-
|
|
15
|
+
import"./cli-qnnbe59j.js";
|
|
16
16
|
import"./cli-4j2mrzag.js";
|
|
17
17
|
import"./cli-p9swy5t3.js";
|
|
18
18
|
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
import {
|
|
2
2
|
embedScript,
|
|
3
3
|
embeddingProvider
|
|
4
|
-
} from "./cli-
|
|
5
|
-
import"./cli-
|
|
4
|
+
} from "./cli-5g3hx9cc.js";
|
|
5
|
+
import"./cli-vnvv6hvm.js";
|
|
6
6
|
import"./cli-q25ejbyn.js";
|
|
7
7
|
import {
|
|
8
8
|
getDb,
|
|
9
9
|
init_db
|
|
10
|
-
} from "./cli-
|
|
10
|
+
} from "./cli-k4yp6w9w.js";
|
|
11
11
|
import"./cli-z2zcxes1.js";
|
|
12
12
|
import"./cli-bw80ck94.js";
|
|
13
13
|
import"./cli-xz9aq0rf.js";
|
|
14
|
-
import"./cli-
|
|
14
|
+
import"./cli-qnnbe59j.js";
|
|
15
15
|
import"./cli-4j2mrzag.js";
|
|
16
16
|
import"./cli-p9swy5t3.js";
|
|
17
17
|
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import {
|
|
2
2
|
getDb,
|
|
3
3
|
init_db
|
|
4
|
-
} from "./cli-
|
|
4
|
+
} from "./cli-k4yp6w9w.js";
|
|
5
5
|
import"./cli-z2zcxes1.js";
|
|
6
6
|
import"./cli-bw80ck94.js";
|
|
7
7
|
import"./cli-xz9aq0rf.js";
|
|
8
|
-
import"./cli-
|
|
8
|
+
import"./cli-qnnbe59j.js";
|
|
9
9
|
import {
|
|
10
10
|
init_secret_scrubber,
|
|
11
11
|
scrubSecrets
|
|
@@ -12,12 +12,12 @@ import {
|
|
|
12
12
|
resolveClaudeBinary,
|
|
13
13
|
resolveClaudeBinaryArgv,
|
|
14
14
|
resolveClaudeBridgeEnabled
|
|
15
|
-
} from "./cli-
|
|
15
|
+
} from "./cli-mnbgv3w7.js";
|
|
16
16
|
import"./cli-tng3131n.js";
|
|
17
17
|
import"./cli-psrqtw2m.js";
|
|
18
18
|
import"./cli-zm7njwzd.js";
|
|
19
19
|
import"./cli-tghre7g6.js";
|
|
20
|
-
import"./cli-
|
|
20
|
+
import"./cli-e61fs2hp.js";
|
|
21
21
|
import"./cli-z2zcxes1.js";
|
|
22
22
|
import"./cli-4j2mrzag.js";
|
|
23
23
|
import"./cli-7zd05xb4.js";
|
|
@@ -14,8 +14,10 @@ import {
|
|
|
14
14
|
buildTreeBlocks,
|
|
15
15
|
formatAttachmentsBlockForSlack,
|
|
16
16
|
formatDuration,
|
|
17
|
-
|
|
18
|
-
|
|
17
|
+
getTaskLink,
|
|
18
|
+
markdownToSlack,
|
|
19
|
+
splitSlackSectionText
|
|
20
|
+
} from "./cli-ma04faw5.js";
|
|
19
21
|
import {
|
|
20
22
|
getAgentById,
|
|
21
23
|
getChildTasks,
|
|
@@ -25,7 +27,7 @@ import {
|
|
|
25
27
|
getTaskById,
|
|
26
28
|
init_db,
|
|
27
29
|
setSlackMessageTracking
|
|
28
|
-
} from "./cli-
|
|
30
|
+
} from "./cli-k4yp6w9w.js";
|
|
29
31
|
import {
|
|
30
32
|
require_receiver,
|
|
31
33
|
require_sender,
|
|
@@ -54212,9 +54214,89 @@ function classifySlackUpdateError(error) {
|
|
|
54212
54214
|
return "failed";
|
|
54213
54215
|
}
|
|
54214
54216
|
var isDev = process.env.ENV === "development";
|
|
54217
|
+
var MIN_INLINE_OUTPUT_LENGTH = 20;
|
|
54218
|
+
var MAX_INLINE_OUTPUT_MESSAGE_LENGTH = 4000;
|
|
54219
|
+
var INLINE_OUTPUT_FALLBACKS = new Set([
|
|
54220
|
+
"done",
|
|
54221
|
+
"completed",
|
|
54222
|
+
"complete",
|
|
54223
|
+
"task completed",
|
|
54224
|
+
"process completed successfully",
|
|
54225
|
+
"process completed successfully (no output captured)"
|
|
54226
|
+
]);
|
|
54215
54227
|
function getAgentDisplayName(agent) {
|
|
54216
54228
|
return isDev ? `(dev) ${agent.name}` : agent.name;
|
|
54217
54229
|
}
|
|
54230
|
+
function shouldPostInlineCompletionOutput(task, attachments) {
|
|
54231
|
+
if (task.status !== "completed")
|
|
54232
|
+
return false;
|
|
54233
|
+
if (!task.slackChannelId || !task.slackThreadTs)
|
|
54234
|
+
return false;
|
|
54235
|
+
if (task.slackReplySent)
|
|
54236
|
+
return false;
|
|
54237
|
+
const output = task.output?.trim();
|
|
54238
|
+
if (!output || output.length < MIN_INLINE_OUTPUT_LENGTH)
|
|
54239
|
+
return false;
|
|
54240
|
+
if (INLINE_OUTPUT_FALLBACKS.has(output.toLowerCase()))
|
|
54241
|
+
return false;
|
|
54242
|
+
return !attachments.some((attachment) => attachment.isPrimary);
|
|
54243
|
+
}
|
|
54244
|
+
function formatInlineCompletionOutputText(opts) {
|
|
54245
|
+
const header = `✅ *${opts.agentName}* completed with output (${getTaskLink(opts.taskId)}):
|
|
54246
|
+
|
|
54247
|
+
`;
|
|
54248
|
+
const tail = `
|
|
54249
|
+
|
|
54250
|
+
…(full output in task ${getTaskLink(opts.taskId)})`;
|
|
54251
|
+
const slackOutput = markdownToSlack(opts.output.trim());
|
|
54252
|
+
const maxBodyLength = MAX_INLINE_OUTPUT_MESSAGE_LENGTH - header.length;
|
|
54253
|
+
if (slackOutput.length <= maxBodyLength) {
|
|
54254
|
+
return header + slackOutput;
|
|
54255
|
+
}
|
|
54256
|
+
const maxTruncatedBodyLength = Math.max(0, maxBodyLength - tail.length);
|
|
54257
|
+
let cut = slackOutput.lastIndexOf(`
|
|
54258
|
+
`, maxTruncatedBodyLength);
|
|
54259
|
+
if (cut < maxTruncatedBodyLength / 2) {
|
|
54260
|
+
cut = slackOutput.lastIndexOf(" ", maxTruncatedBodyLength);
|
|
54261
|
+
}
|
|
54262
|
+
if (cut < maxTruncatedBodyLength / 2) {
|
|
54263
|
+
cut = maxTruncatedBodyLength;
|
|
54264
|
+
}
|
|
54265
|
+
return header + slackOutput.slice(0, cut).trimEnd() + tail;
|
|
54266
|
+
}
|
|
54267
|
+
async function sendInlineTaskOutput(task) {
|
|
54268
|
+
const app = getSlackApp();
|
|
54269
|
+
if (!app || !task.slackChannelId || !task.slackThreadTs || !task.agentId || !task.output) {
|
|
54270
|
+
return false;
|
|
54271
|
+
}
|
|
54272
|
+
const agent = getAgentById(task.agentId);
|
|
54273
|
+
if (!agent) {
|
|
54274
|
+
console.error(`[Slack] Agent not found for task ${task.id}`);
|
|
54275
|
+
return false;
|
|
54276
|
+
}
|
|
54277
|
+
const text = formatInlineCompletionOutputText({
|
|
54278
|
+
agentName: agent.name,
|
|
54279
|
+
taskId: task.id,
|
|
54280
|
+
output: task.output
|
|
54281
|
+
});
|
|
54282
|
+
try {
|
|
54283
|
+
await sendWithPersona(app.client, {
|
|
54284
|
+
channel: task.slackChannelId,
|
|
54285
|
+
thread_ts: task.slackThreadTs,
|
|
54286
|
+
text,
|
|
54287
|
+
username: getAgentDisplayName(agent),
|
|
54288
|
+
icon_emoji: getAgentEmoji(agent),
|
|
54289
|
+
blocks: splitSlackSectionText(text).map((chunk) => ({
|
|
54290
|
+
type: "section",
|
|
54291
|
+
text: { type: "mrkdwn", text: chunk }
|
|
54292
|
+
}))
|
|
54293
|
+
});
|
|
54294
|
+
return true;
|
|
54295
|
+
} catch (error) {
|
|
54296
|
+
console.error(`[Slack] Failed to send inline output for task ${task.id}:`, error);
|
|
54297
|
+
return false;
|
|
54298
|
+
}
|
|
54299
|
+
}
|
|
54218
54300
|
async function sendTaskResponse(task) {
|
|
54219
54301
|
const app = getSlackApp();
|
|
54220
54302
|
if (!app || !task.slackChannelId || !task.slackThreadTs) {
|
|
@@ -54904,7 +54986,8 @@ function startTaskWatcher(intervalMs = 3000) {
|
|
|
54904
54986
|
if (lastSent && now2 - lastSent < MIN_SEND_INTERVAL)
|
|
54905
54987
|
continue;
|
|
54906
54988
|
if (taskToTree.has(task.id)) {
|
|
54907
|
-
|
|
54989
|
+
const attachments = task.status === "completed" ? getTaskAttachments(task.id) : [];
|
|
54990
|
+
if (!shouldPostInlineCompletionOutput(task, attachments)) {
|
|
54908
54991
|
notifiedCompletions.set(task.id, now2);
|
|
54909
54992
|
continue;
|
|
54910
54993
|
}
|
|
@@ -54912,8 +54995,10 @@ function startTaskWatcher(intervalMs = 3000) {
|
|
|
54912
54995
|
notifiedCompletions.set(task.id, now2);
|
|
54913
54996
|
lastSendTime.set(completionKey, now2);
|
|
54914
54997
|
try {
|
|
54915
|
-
await
|
|
54916
|
-
|
|
54998
|
+
const sent = await sendInlineTaskOutput(task);
|
|
54999
|
+
if (!sent)
|
|
55000
|
+
throw new Error("sendInlineTaskOutput returned false");
|
|
55001
|
+
console.log(`[Slack] Sent inline output for tree-tracked completion ${task.id.slice(0, 8)}`);
|
|
54917
55002
|
} catch (error) {
|
|
54918
55003
|
notifiedCompletions.delete(task.id);
|
|
54919
55004
|
lastSendTime.delete(completionKey);
|
|
@@ -54988,13 +55073,13 @@ async function initSlackApp() {
|
|
|
54988
55073
|
socketMode: true,
|
|
54989
55074
|
logLevel: import_bolt.LogLevel.DEBUG
|
|
54990
55075
|
});
|
|
54991
|
-
const { registerMessageHandler } = await import("./handlers-
|
|
54992
|
-
const { registerCommandHandler } = await import("./commands-
|
|
54993
|
-
const { registerActionHandlers } = await import("./actions-
|
|
55076
|
+
const { registerMessageHandler } = await import("./handlers-5n9gq3ek.js");
|
|
55077
|
+
const { registerCommandHandler } = await import("./commands-4jt6hvc9.js");
|
|
55078
|
+
const { registerActionHandlers } = await import("./actions-brtj223f.js");
|
|
54994
55079
|
registerMessageHandler(app);
|
|
54995
55080
|
registerCommandHandler(app);
|
|
54996
55081
|
registerActionHandlers(app);
|
|
54997
|
-
const { createAssistant } = await import("./assistant-
|
|
55082
|
+
const { createAssistant } = await import("./assistant-j2ser3vg.js");
|
|
54998
55083
|
app.assistant(createAssistant());
|
|
54999
55084
|
return app;
|
|
55000
55085
|
}
|
|
@@ -2,7 +2,7 @@ import {
|
|
|
2
2
|
getScriptApiTypes,
|
|
3
3
|
getScriptMcpTypes,
|
|
4
4
|
require_typescript
|
|
5
|
-
} from "./cli-
|
|
5
|
+
} from "./cli-x9q6bghe.js";
|
|
6
6
|
import {
|
|
7
7
|
deleteSwarmConfigByKey,
|
|
8
8
|
getAgentById,
|
|
@@ -11,7 +11,7 @@ import {
|
|
|
11
11
|
getSwarmConfigs,
|
|
12
12
|
init_db,
|
|
13
13
|
upsertSwarmConfig
|
|
14
|
-
} from "./cli-
|
|
14
|
+
} from "./cli-k4yp6w9w.js";
|
|
15
15
|
import {
|
|
16
16
|
init_secret_scrubber,
|
|
17
17
|
scrubSecrets
|
|
@@ -362,6 +362,17 @@ var SCRIPT_SDK_TYPES = `
|
|
|
362
362
|
export type JsonValue = null | boolean | number | string | JsonValue[] | { [key: string]: JsonValue };
|
|
363
363
|
export type ScriptScope = "agent" | "global";
|
|
364
364
|
export type ScriptFsMode = "none" | "workspace-rw";
|
|
365
|
+
export type ScriptApiRawOptions = { raw: true };
|
|
366
|
+
export type ScriptApiDefaultOptions = { raw?: false };
|
|
367
|
+
|
|
368
|
+
export interface ScriptApiRawResult {
|
|
369
|
+
ok: boolean;
|
|
370
|
+
status: number;
|
|
371
|
+
statusText: string;
|
|
372
|
+
headers: Record<string, string>;
|
|
373
|
+
url: string;
|
|
374
|
+
response: Response;
|
|
375
|
+
}
|
|
365
376
|
|
|
366
377
|
export interface Redacted<T> {
|
|
367
378
|
readonly __redactedBrand?: T;
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import {
|
|
2
2
|
buildModelsDevSeedRows
|
|
3
|
-
} from "./cli-
|
|
3
|
+
} from "./cli-tw7xjzk7.js";
|
|
4
4
|
import {
|
|
5
5
|
createLogEntry,
|
|
6
6
|
getActivePricingRow,
|
|
7
7
|
getDb,
|
|
8
8
|
init_db,
|
|
9
9
|
insertPricingRow
|
|
10
|
-
} from "./cli-
|
|
10
|
+
} from "./cli-k4yp6w9w.js";
|
|
11
11
|
import {
|
|
12
12
|
init_secret_scrubber,
|
|
13
13
|
scrubSecrets
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import {
|
|
2
2
|
PermissionVerbSchema
|
|
3
|
-
} from "./cli-
|
|
3
|
+
} from "./cli-86fdnerz.js";
|
|
4
4
|
import {
|
|
5
5
|
getDb,
|
|
6
6
|
init_db
|
|
7
|
-
} from "./cli-
|
|
7
|
+
} from "./cli-k4yp6w9w.js";
|
|
8
8
|
|
|
9
9
|
// src/be/rbac-roles.ts
|
|
10
10
|
init_db();
|
|
@@ -24,7 +24,14 @@ var BUILTIN_ROLES = [
|
|
|
24
24
|
description: "Own-task lifecycle: what legacy policy grants user principals.",
|
|
25
25
|
isBuiltin: true,
|
|
26
26
|
grantsAll: false,
|
|
27
|
-
verbs: [
|
|
27
|
+
verbs: [
|
|
28
|
+
"task.create.own",
|
|
29
|
+
"task.read.own",
|
|
30
|
+
"task.cancel.own",
|
|
31
|
+
"task.action.own",
|
|
32
|
+
"task.fs.mutate",
|
|
33
|
+
"favorite.write.own"
|
|
34
|
+
]
|
|
28
35
|
}
|
|
29
36
|
];
|
|
30
37
|
var CREATE_USER_DEFAULT_ROLE_TRIGGER_SQL = `
|
|
@@ -4,11 +4,11 @@ import {
|
|
|
4
4
|
getEmbeddingProvider,
|
|
5
5
|
init_embedding,
|
|
6
6
|
serializeEmbedding
|
|
7
|
-
} from "./cli-
|
|
7
|
+
} from "./cli-vnvv6hvm.js";
|
|
8
8
|
import {
|
|
9
9
|
getDb,
|
|
10
10
|
init_db
|
|
11
|
-
} from "./cli-
|
|
11
|
+
} from "./cli-k4yp6w9w.js";
|
|
12
12
|
import {
|
|
13
13
|
init_secret_scrubber,
|
|
14
14
|
scrubSecrets
|
|
@@ -24,6 +24,10 @@ var PERMISSIONS = {
|
|
|
24
24
|
description: "Cancel any task (beyond tasks the caller created).",
|
|
25
25
|
namespace: "task"
|
|
26
26
|
},
|
|
27
|
+
"task.create.own": {
|
|
28
|
+
description: "Create a task the caller owns.",
|
|
29
|
+
namespace: "task"
|
|
30
|
+
},
|
|
27
31
|
"task.read.own": {
|
|
28
32
|
description: "Read details of a task the principal requested.",
|
|
29
33
|
namespace: "task"
|
|
@@ -40,6 +44,10 @@ var PERMISSIONS = {
|
|
|
40
44
|
description: "Mutate a task's filesystem artifacts and attachments.",
|
|
41
45
|
namespace: "task"
|
|
42
46
|
},
|
|
47
|
+
"favorite.write.own": {
|
|
48
|
+
description: "Set a favorite the caller owns.",
|
|
49
|
+
namespace: "favorite"
|
|
50
|
+
},
|
|
43
51
|
"memory.learning.inject": {
|
|
44
52
|
description: "Inject a learning into another agent's memory.",
|
|
45
53
|
namespace: "memory"
|
|
@@ -156,6 +164,10 @@ var PERMISSIONS = {
|
|
|
156
164
|
description: "Update an MCP server the caller does not own.",
|
|
157
165
|
namespace: "mcp-server"
|
|
158
166
|
},
|
|
167
|
+
"mcp-server.read.secrets": {
|
|
168
|
+
description: "Read resolved MCP server secret env/header values.",
|
|
169
|
+
namespace: "mcp-server"
|
|
170
|
+
},
|
|
159
171
|
"mcp-oauth.authorize.any": {
|
|
160
172
|
description: "Start an MCP-server OAuth authorize flow for a caller-supplied user scope.",
|
|
161
173
|
namespace: "mcp-oauth"
|
|
@@ -175,6 +187,30 @@ var PERMISSIONS = {
|
|
|
175
187
|
"script.global.delete": {
|
|
176
188
|
description: "Delete a global-scope script.",
|
|
177
189
|
namespace: "script"
|
|
190
|
+
},
|
|
191
|
+
"script.search": {
|
|
192
|
+
description: "Search reusable scripts visible to the caller.",
|
|
193
|
+
namespace: "script"
|
|
194
|
+
},
|
|
195
|
+
"script.api.read.secrets": {
|
|
196
|
+
description: "Reveal an external script API endpoint bearer token.",
|
|
197
|
+
namespace: "script"
|
|
198
|
+
},
|
|
199
|
+
"script.api.create": {
|
|
200
|
+
description: "Expose a script as an external HTTP API endpoint.",
|
|
201
|
+
namespace: "script"
|
|
202
|
+
},
|
|
203
|
+
"script.api.update": {
|
|
204
|
+
description: "Update an external script API endpoint.",
|
|
205
|
+
namespace: "script"
|
|
206
|
+
},
|
|
207
|
+
"script.api.rotate": {
|
|
208
|
+
description: "Rotate an external script API endpoint bearer token.",
|
|
209
|
+
namespace: "script"
|
|
210
|
+
},
|
|
211
|
+
"script.api.delete": {
|
|
212
|
+
description: "Delete an external script API endpoint.",
|
|
213
|
+
namespace: "script"
|
|
178
214
|
}
|
|
179
215
|
};
|
|
180
216
|
var PERMISSION_VERBS = Object.keys(PERMISSIONS);
|
|
@@ -201,6 +237,22 @@ function decideAdmission(input) {
|
|
|
201
237
|
}
|
|
202
238
|
return { allow: false, reason: "admission: route has no permission verb (operator-only)" };
|
|
203
239
|
}
|
|
240
|
+
function decideToolAdmission(input) {
|
|
241
|
+
if (input.grant.grantsAll) {
|
|
242
|
+
return { allow: true };
|
|
243
|
+
}
|
|
244
|
+
if (input.rbac && "permission" in input.rbac) {
|
|
245
|
+
const verb = input.rbac.permission;
|
|
246
|
+
if (input.grant.verbs.has(verb)) {
|
|
247
|
+
return { allow: true, verb };
|
|
248
|
+
}
|
|
249
|
+
return { allow: false, reason: `admission: missing permission '${verb}'`, verb };
|
|
250
|
+
}
|
|
251
|
+
if (input.readOnly) {
|
|
252
|
+
return { allow: true };
|
|
253
|
+
}
|
|
254
|
+
return { allow: false, reason: "admission: tool has no permission verb (operator-only)" };
|
|
255
|
+
}
|
|
204
256
|
// src/rbac/legacy-policy.ts
|
|
205
257
|
var leadOnly = {
|
|
206
258
|
name: "lead-only",
|
|
@@ -283,10 +335,12 @@ var LEGACY_POLICY = {
|
|
|
283
335
|
"agent.profile.update.any": leadOnly,
|
|
284
336
|
"agent.context.read.any": leadOnly,
|
|
285
337
|
"task.cancel.any": leadOrTaskCreator,
|
|
338
|
+
"task.create.own": anyAuthenticated,
|
|
286
339
|
"task.read.own": requesterOwnsTask,
|
|
287
340
|
"task.cancel.own": requesterOwnsTask,
|
|
288
341
|
"task.action.own": requesterOwnsTask,
|
|
289
342
|
"task.fs.mutate": taskFsMutate,
|
|
343
|
+
"favorite.write.own": anyAuthenticated,
|
|
290
344
|
"memory.learning.inject": leadOnly,
|
|
291
345
|
"memory.delete.any": memoryOwnerOrLeadSwarm,
|
|
292
346
|
"channel.delete": leadOnly,
|
|
@@ -316,11 +370,18 @@ var LEGACY_POLICY = {
|
|
|
316
370
|
"mcp-server.uninstall.any": leadOnly,
|
|
317
371
|
"mcp-server.delete.any": leadOrResourceOwner,
|
|
318
372
|
"mcp-server.update.any": leadOrResourceOwner,
|
|
373
|
+
"mcp-server.read.secrets": leadOnly,
|
|
319
374
|
"mcp-oauth.authorize.any": anyAuthenticated,
|
|
320
375
|
"kv.write.any": leadOrOwnNamespace,
|
|
321
376
|
"page.delete.any": leadOrResourceOwner,
|
|
322
377
|
"script.global.write": leadOnly,
|
|
323
|
-
"script.global.delete": leadOnly
|
|
378
|
+
"script.global.delete": leadOnly,
|
|
379
|
+
"script.search": anyAuthenticated,
|
|
380
|
+
"script.api.read.secrets": leadOnly,
|
|
381
|
+
"script.api.create": leadOnly,
|
|
382
|
+
"script.api.update": leadOnly,
|
|
383
|
+
"script.api.rotate": leadOnly,
|
|
384
|
+
"script.api.delete": leadOnly
|
|
324
385
|
};
|
|
325
386
|
|
|
326
387
|
// src/rbac/can.ts
|
|
@@ -341,4 +402,4 @@ function can(check) {
|
|
|
341
402
|
}
|
|
342
403
|
return decision;
|
|
343
404
|
}
|
|
344
|
-
export { isRbacEnabled, decideAdmission, setAuditSink, clearAuditSink, can, PermissionVerbSchema };
|
|
405
|
+
export { isRbacEnabled, decideAdmission, decideToolAdmission, setAuditSink, clearAuditSink, can, PermissionVerbSchema };
|
|
@@ -11,18 +11,18 @@ import {
|
|
|
11
11
|
getScriptVersion,
|
|
12
12
|
listRelationalCredentialBindings,
|
|
13
13
|
validateScriptImports
|
|
14
|
-
} from "./cli-
|
|
14
|
+
} from "./cli-x9q6bghe.js";
|
|
15
15
|
import {
|
|
16
16
|
ensureTokenOrThrow,
|
|
17
17
|
getOAuthApp,
|
|
18
18
|
getOAuthTokens,
|
|
19
19
|
isTokenExpiringSoon,
|
|
20
20
|
oauthAppRowToProviderConfig
|
|
21
|
-
} from "./cli-
|
|
21
|
+
} from "./cli-0pwtr9f0.js";
|
|
22
22
|
import {
|
|
23
23
|
withSiblingAwareness,
|
|
24
24
|
workflowContextKey
|
|
25
|
-
} from "./cli-
|
|
25
|
+
} from "./cli-n9kkkmtm.js";
|
|
26
26
|
import {
|
|
27
27
|
getAppUrl
|
|
28
28
|
} from "./cli-dh55d5fg.js";
|
|
@@ -71,7 +71,7 @@ import {
|
|
|
71
71
|
telemetry,
|
|
72
72
|
updateWorkflowRun,
|
|
73
73
|
updateWorkflowRunStep
|
|
74
|
-
} from "./cli-
|
|
74
|
+
} from "./cli-k4yp6w9w.js";
|
|
75
75
|
import {
|
|
76
76
|
init_zod
|
|
77
77
|
} from "./cli-bw80ck94.js";
|
|
@@ -2612,7 +2612,7 @@ class HumanInTheLoopExecutor extends BaseExecutor {
|
|
|
2612
2612
|
}
|
|
2613
2613
|
if (notification.channel === "slack") {
|
|
2614
2614
|
try {
|
|
2615
|
-
const { getSlackApp } = await import("./app-
|
|
2615
|
+
const { getSlackApp } = await import("./app-00sngzz7.js");
|
|
2616
2616
|
const slackApp = getSlackApp();
|
|
2617
2617
|
if (!slackApp) {
|
|
2618
2618
|
console.warn("[HITL] Slack not initialized — cannot send notification");
|
|
@@ -2726,7 +2726,7 @@ class NotifyExecutor extends BaseExecutor {
|
|
|
2726
2726
|
}
|
|
2727
2727
|
}
|
|
2728
2728
|
case "slack": {
|
|
2729
|
-
const { getSlackApp } = await import("./app-
|
|
2729
|
+
const { getSlackApp } = await import("./app-00sngzz7.js");
|
|
2730
2730
|
const app = getSlackApp();
|
|
2731
2731
|
if (!app) {
|
|
2732
2732
|
return {
|