@desplega.ai/agent-swarm 1.115.0 → 1.117.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/README.md +2 -2
- package/dist/{actions-17ya5wde.js → actions-7bnvhcgs.js} +10 -8
- package/dist/{app-4f718yk0.js → app-976fykvr.js} +3 -3
- package/dist/{assistant-ah7csnjz.js → assistant-5drs03t0.js} +13 -11
- package/dist/{boot-reembed-4jpxhb25.js → boot-reembed-0zhftca3.js} +4 -4
- package/dist/{boot-reembed-qata34xa.js → boot-reembed-wce58xfv.js} +3 -3
- package/dist/{boot-scrub-logs-tv48nn3z.js → boot-scrub-logs-vkd2vvxp.js} +2 -2
- package/dist/{cli-zsrdty74.js → cli-09j7m5v3.js} +4 -4
- package/dist/{cli-beea4a3y.js → cli-1987vgjc.js} +3 -3
- package/dist/{cli-k3y4z3h5.js → cli-5ekf4gcj.js} +2 -76
- package/dist/{cli-cnwssmsr.js → cli-6058t3w0.js} +1 -1
- package/dist/{cli-tffvrh6j.js → cli-9kk0xa5w.js} +1 -1
- package/dist/{cli-q1rx7g0d.js → cli-e0xv4nd4.js} +11 -9
- package/dist/{cli-12vb0xg6.js → cli-f5cx2j92.js} +2 -2
- package/dist/{cli-3samkyap.js → cli-fep22bhf.js} +2 -2
- package/dist/{cli-t0vqevnm.js → cli-hmw1vk30.js} +1 -1
- package/dist/{cli-pet3aev6.js → cli-jkp1gndy.js} +5 -5
- package/dist/{cli-52fg7s7x.js → cli-kfjs4fjw.js} +1 -1
- package/dist/{cli-65ekje01.js → cli-m4p6c600.js} +10 -8
- package/dist/{cli-cchksf5q.js → cli-ndsyqqqk.js} +2 -2
- package/dist/{cli-tece6zgm.js → cli-q0yn57de.js} +1 -1
- package/dist/{cli-hrhye2rm.js → cli-r06ed00c.js} +70 -24
- package/dist/{cli-7xje5amz.js → cli-rymspw51.js} +1 -1
- package/dist/{cli-15y7qhzp.js → cli-s5q026mr.js} +295 -4
- package/dist/{cli-shvaxw27.js → cli-t6n84nqv.js} +8 -6
- package/dist/{cli-r9f6ngrf.js → cli-vwhg6sbn.js} +2 -2
- package/dist/{cli-6aq8xhvm.js → cli-w5axeg22.js} +1 -1
- package/dist/{cli-b23axgz4.js → cli-xcp5dmts.js} +2 -2
- package/dist/{cli-dcca6j8m.js → cli-yarjrgd5.js} +1 -1
- package/dist/{cli-cmw9rzy5.js → cli-z824vphk.js} +2 -2
- package/dist/cli.js +10 -10
- package/dist/{commands-hch4e2k1.js → commands-b3p0fjzd.js} +2 -2
- package/dist/{db-p3h2j06x.js → db-6xw82vz3.js} +2 -2
- package/dist/{handlers-9er4zx9q.js → handlers-kwrk085v.js} +13 -11
- package/dist/{hook-4axs756z.js → hook-e4wdztg5.js} +1 -1
- package/dist/{http-809fvtz2.js → http-x7svk8q5.js} +41 -37
- package/dist/{index-rm85cfdx.js → index-35tw5g2v.js} +6 -6
- package/dist/{index-47em3d2n.js → index-aadhkkde.js} +10 -10
- package/dist/{index-9fqaktjr.js → index-qb6nfqmy.js} +8 -8
- package/dist/{index-9ht8gr56.js → index-zj38e3q2.js} +9 -9
- package/dist/{keepalive-3cps6e3e.js → keepalive-enehyqc8.js} +4 -4
- package/dist/{lead-fkk95wgq.js → lead-nmzd0ykq.js} +18 -18
- package/dist/{maintenance-fweqh0yj.js → maintenance-staxb3xt.js} +4 -4
- package/dist/{oauth-refresh-sweep-sycqtbph.js → oauth-refresh-sweep-fqczcwxn.js} +3 -3
- package/dist/{onboard-cy0rkgvx.js → onboard-shmqj6ep.js} +2 -2
- package/dist/{otel-impl-wbns8hf7.js → otel-impl-726bmdyc.js} +1 -1
- package/dist/{pricing-refresh-0hvazmkf.js → pricing-refresh-rzwka8rf.js} +4 -4
- package/dist/{rbac-roles-kfesjy9y.js → rbac-roles-chkhakmf.js} +3 -3
- package/dist/{rbac-roles-mwcwhbxc.js → rbac-roles-j2k0h8sx.js} +2 -2
- package/dist/{seed-pricing-h2kdq4cq.js → seed-pricing-vta6a1q3.js} +3 -3
- package/dist/{setup-8506q97w.js → setup-yv9ctywz.js} +2 -2
- package/dist/{worker-4r5c6zyb.js → worker-7w6571j0.js} +18 -18
- package/openapi.json +1 -1
- package/package.json +2 -2
- package/src/be/db.ts +89 -3
- package/src/server-user.ts +1 -0
- package/src/tasks/slack-routing.ts +147 -0
- package/src/tests/approval-requests.test.ts +36 -0
- package/src/tests/http-api-integration.test.ts +38 -0
- package/src/tests/pages-complete-fetch.test.ts +54 -0
- package/src/tests/send-task-slack-routing-guard.test.ts +355 -0
- package/src/tests/slack-metadata-inheritance.test.ts +279 -1
- package/src/tests/slack-routing-guard.test.ts +164 -0
- package/src/tools/send-task.ts +145 -82
|
@@ -26,7 +26,7 @@ import {
|
|
|
26
26
|
import {
|
|
27
27
|
init_package,
|
|
28
28
|
package_default
|
|
29
|
-
} from "./cli-
|
|
29
|
+
} from "./cli-xcp5dmts.js";
|
|
30
30
|
import {
|
|
31
31
|
init_secret_scrubber,
|
|
32
32
|
scrubSecrets
|
|
@@ -259,6 +259,264 @@ var init_resolver = __esm(() => {
|
|
|
259
259
|
TEMPLATE_REF_REGEX = /\{\{@template\[([^\]]+)\]\}\}/g;
|
|
260
260
|
});
|
|
261
261
|
|
|
262
|
+
// src/tasks/context-key.ts
|
|
263
|
+
function assertSafePart(value, label) {
|
|
264
|
+
if (value === null || value === undefined) {
|
|
265
|
+
throw new Error(`context-key: "${label}" is required`);
|
|
266
|
+
}
|
|
267
|
+
const str = typeof value === "string" ? value : String(value);
|
|
268
|
+
if (str.length === 0) {
|
|
269
|
+
throw new Error(`context-key: "${label}" must be non-empty`);
|
|
270
|
+
}
|
|
271
|
+
if (str.includes(SEPARATOR)) {
|
|
272
|
+
throw new Error(`context-key: "${label}" must not contain "${SEPARATOR}"; caller must sanitize (got ${JSON.stringify(str)})`);
|
|
273
|
+
}
|
|
274
|
+
return str;
|
|
275
|
+
}
|
|
276
|
+
function slackContextKey(input) {
|
|
277
|
+
const channelId = assertSafePart(input.channelId, "channelId");
|
|
278
|
+
const threadTs = assertSafePart(input.threadTs, "threadTs");
|
|
279
|
+
return ["task", "slack", channelId, threadTs].join(SEPARATOR);
|
|
280
|
+
}
|
|
281
|
+
function agentmailContextKey(input) {
|
|
282
|
+
const threadId = assertSafePart(input.threadId, "threadId");
|
|
283
|
+
return ["task", "agentmail", threadId].join(SEPARATOR);
|
|
284
|
+
}
|
|
285
|
+
function githubContextKey(input) {
|
|
286
|
+
const owner = assertSafePart(input.owner, "owner");
|
|
287
|
+
const repo = assertSafePart(input.repo, "repo");
|
|
288
|
+
const kind = assertSafePart(input.kind, "kind").toLowerCase();
|
|
289
|
+
if (kind !== "issue" && kind !== "pr") {
|
|
290
|
+
throw new Error(`context-key: github "kind" must be "issue" or "pr" (got ${JSON.stringify(kind)})`);
|
|
291
|
+
}
|
|
292
|
+
const number2 = assertSafePart(input.number, "number");
|
|
293
|
+
if (!/^\d+$/.test(number2)) {
|
|
294
|
+
throw new Error(`context-key: github "number" must be a positive integer (got ${JSON.stringify(number2)})`);
|
|
295
|
+
}
|
|
296
|
+
return ["task", "trackers", "github", owner, repo, kind, number2].join(SEPARATOR);
|
|
297
|
+
}
|
|
298
|
+
function gitlabContextKey(input) {
|
|
299
|
+
const projectId = assertSafePart(input.projectId, "projectId");
|
|
300
|
+
const kind = assertSafePart(input.kind, "kind").toLowerCase();
|
|
301
|
+
if (kind !== "mr" && kind !== "issue") {
|
|
302
|
+
throw new Error(`context-key: gitlab "kind" must be "mr" or "issue" (got ${JSON.stringify(kind)})`);
|
|
303
|
+
}
|
|
304
|
+
const iid = assertSafePart(input.iid, "iid");
|
|
305
|
+
if (!/^\d+$/.test(iid)) {
|
|
306
|
+
throw new Error(`context-key: gitlab "iid" must be a positive integer (got ${JSON.stringify(iid)})`);
|
|
307
|
+
}
|
|
308
|
+
return ["task", "trackers", "gitlab", projectId, kind, iid].join(SEPARATOR);
|
|
309
|
+
}
|
|
310
|
+
function linearContextKey(input) {
|
|
311
|
+
const issueIdentifier = assertSafePart(input.issueIdentifier, "issueIdentifier");
|
|
312
|
+
return ["task", "trackers", "linear", issueIdentifier].join(SEPARATOR);
|
|
313
|
+
}
|
|
314
|
+
function buildJiraContextKey(issueIdentifier) {
|
|
315
|
+
const id = assertSafePart(issueIdentifier, "issueIdentifier");
|
|
316
|
+
return ["task", "trackers", "jira", id].join(SEPARATOR);
|
|
317
|
+
}
|
|
318
|
+
function scheduleContextKey(input) {
|
|
319
|
+
const scheduleId = assertSafePart(input.scheduleId, "scheduleId");
|
|
320
|
+
return ["task", "schedule", scheduleId].join(SEPARATOR);
|
|
321
|
+
}
|
|
322
|
+
function workflowContextKey(input) {
|
|
323
|
+
const workflowRunId = assertSafePart(input.workflowRunId, "workflowRunId");
|
|
324
|
+
return ["task", "workflow", workflowRunId].join(SEPARATOR);
|
|
325
|
+
}
|
|
326
|
+
function agentContextKey(input) {
|
|
327
|
+
const agentId = assertSafePart(input.agentId, "agentId");
|
|
328
|
+
return ["task", "agent", agentId].join(SEPARATOR);
|
|
329
|
+
}
|
|
330
|
+
function pageContextKey(input) {
|
|
331
|
+
const pageId = assertSafePart(input.pageId, "pageId");
|
|
332
|
+
return ["task", "page", pageId].join(SEPARATOR);
|
|
333
|
+
}
|
|
334
|
+
function parseContextKey(key) {
|
|
335
|
+
if (typeof key !== "string" || key.length === 0) {
|
|
336
|
+
throw new Error("context-key: key must be a non-empty string");
|
|
337
|
+
}
|
|
338
|
+
const parts = key.split(SEPARATOR);
|
|
339
|
+
if (parts.length < 3 || parts[0] !== "task") {
|
|
340
|
+
throw new Error(`context-key: malformed key (expected "task:..."): ${JSON.stringify(key)}`);
|
|
341
|
+
}
|
|
342
|
+
const family = parts[1];
|
|
343
|
+
switch (family) {
|
|
344
|
+
case "slack": {
|
|
345
|
+
if (parts.length !== 4) {
|
|
346
|
+
throw new Error(`context-key: malformed slack key: ${JSON.stringify(key)}`);
|
|
347
|
+
}
|
|
348
|
+
return {
|
|
349
|
+
family: "slack",
|
|
350
|
+
parts: { channelId: parts[2], threadTs: parts[3] }
|
|
351
|
+
};
|
|
352
|
+
}
|
|
353
|
+
case "agentmail": {
|
|
354
|
+
if (parts.length !== 3) {
|
|
355
|
+
throw new Error(`context-key: malformed agentmail key: ${JSON.stringify(key)}`);
|
|
356
|
+
}
|
|
357
|
+
return { family: "agentmail", parts: { threadId: parts[2] } };
|
|
358
|
+
}
|
|
359
|
+
case "schedule": {
|
|
360
|
+
if (parts.length !== 3) {
|
|
361
|
+
throw new Error(`context-key: malformed schedule key: ${JSON.stringify(key)}`);
|
|
362
|
+
}
|
|
363
|
+
return { family: "schedule", parts: { scheduleId: parts[2] } };
|
|
364
|
+
}
|
|
365
|
+
case "workflow": {
|
|
366
|
+
if (parts.length !== 3) {
|
|
367
|
+
throw new Error(`context-key: malformed workflow key: ${JSON.stringify(key)}`);
|
|
368
|
+
}
|
|
369
|
+
return { family: "workflow", parts: { workflowRunId: parts[2] } };
|
|
370
|
+
}
|
|
371
|
+
case "trackers": {
|
|
372
|
+
const subFamily = parts[2];
|
|
373
|
+
if (subFamily === "github") {
|
|
374
|
+
if (parts.length !== 7) {
|
|
375
|
+
throw new Error(`context-key: malformed github key: ${JSON.stringify(key)}`);
|
|
376
|
+
}
|
|
377
|
+
const owner = parts[3];
|
|
378
|
+
const repo = parts[4];
|
|
379
|
+
const kind = parts[5];
|
|
380
|
+
const numberStr = parts[6];
|
|
381
|
+
if (kind !== "issue" && kind !== "pr") {
|
|
382
|
+
throw new Error(`context-key: malformed github kind "${kind}": ${JSON.stringify(key)}`);
|
|
383
|
+
}
|
|
384
|
+
const number2 = Number.parseInt(numberStr, 10);
|
|
385
|
+
if (!Number.isFinite(number2)) {
|
|
386
|
+
throw new Error(`context-key: malformed github number "${numberStr}": ${JSON.stringify(key)}`);
|
|
387
|
+
}
|
|
388
|
+
return {
|
|
389
|
+
family: "trackers",
|
|
390
|
+
subFamily: "github",
|
|
391
|
+
parts: { owner, repo, kind, number: number2 }
|
|
392
|
+
};
|
|
393
|
+
}
|
|
394
|
+
if (subFamily === "gitlab") {
|
|
395
|
+
if (parts.length !== 6) {
|
|
396
|
+
throw new Error(`context-key: malformed gitlab key: ${JSON.stringify(key)}`);
|
|
397
|
+
}
|
|
398
|
+
const projectId = parts[3];
|
|
399
|
+
const kind = parts[4];
|
|
400
|
+
const iidStr = parts[5];
|
|
401
|
+
if (kind !== "mr" && kind !== "issue") {
|
|
402
|
+
throw new Error(`context-key: malformed gitlab kind "${kind}": ${JSON.stringify(key)}`);
|
|
403
|
+
}
|
|
404
|
+
const iid = Number.parseInt(iidStr, 10);
|
|
405
|
+
if (!Number.isFinite(iid)) {
|
|
406
|
+
throw new Error(`context-key: malformed gitlab iid "${iidStr}": ${JSON.stringify(key)}`);
|
|
407
|
+
}
|
|
408
|
+
return {
|
|
409
|
+
family: "trackers",
|
|
410
|
+
subFamily: "gitlab",
|
|
411
|
+
parts: { projectId, kind, iid }
|
|
412
|
+
};
|
|
413
|
+
}
|
|
414
|
+
if (subFamily === "linear") {
|
|
415
|
+
if (parts.length !== 4) {
|
|
416
|
+
throw new Error(`context-key: malformed linear key: ${JSON.stringify(key)}`);
|
|
417
|
+
}
|
|
418
|
+
return {
|
|
419
|
+
family: "trackers",
|
|
420
|
+
subFamily: "linear",
|
|
421
|
+
parts: { issueIdentifier: parts[3] }
|
|
422
|
+
};
|
|
423
|
+
}
|
|
424
|
+
if (subFamily === "jira") {
|
|
425
|
+
if (parts.length !== 4) {
|
|
426
|
+
throw new Error(`context-key: malformed jira key: ${JSON.stringify(key)}`);
|
|
427
|
+
}
|
|
428
|
+
return {
|
|
429
|
+
family: "trackers",
|
|
430
|
+
subFamily: "jira",
|
|
431
|
+
parts: { issueIdentifier: parts[3] }
|
|
432
|
+
};
|
|
433
|
+
}
|
|
434
|
+
throw new Error(`context-key: unknown trackers sub-family "${subFamily}": ${JSON.stringify(key)}`);
|
|
435
|
+
}
|
|
436
|
+
default:
|
|
437
|
+
throw new Error(`context-key: unknown family "${family}": ${JSON.stringify(key)}`);
|
|
438
|
+
}
|
|
439
|
+
}
|
|
440
|
+
var SEPARATOR = ":";
|
|
441
|
+
var init_context_key = () => {};
|
|
442
|
+
|
|
443
|
+
// src/tasks/slack-routing.ts
|
|
444
|
+
function slackChannelFromContextKey(key) {
|
|
445
|
+
if (!key)
|
|
446
|
+
return null;
|
|
447
|
+
try {
|
|
448
|
+
const parsed = parseContextKey(key);
|
|
449
|
+
if (parsed.family !== "slack")
|
|
450
|
+
return null;
|
|
451
|
+
return { channelId: parsed.parts.channelId, threadTs: parsed.parts.threadTs };
|
|
452
|
+
} catch {
|
|
453
|
+
return null;
|
|
454
|
+
}
|
|
455
|
+
}
|
|
456
|
+
function checkSlackRoutingCoherence(input) {
|
|
457
|
+
const { explicit, parent, inheritedContextKey } = input;
|
|
458
|
+
const hasChannel = !!explicit.channelId;
|
|
459
|
+
const hasThread = !!explicit.threadTs;
|
|
460
|
+
if (hasChannel !== hasThread) {
|
|
461
|
+
return {
|
|
462
|
+
verdict: "partial-unit",
|
|
463
|
+
detail: hasChannel ? `slackChannelId "${explicit.channelId}" was passed without slackThreadTs — both are required together for Slack delivery to work.` : `slackThreadTs "${explicit.threadTs}" was passed without slackChannelId — both are required together for Slack delivery to work.`
|
|
464
|
+
};
|
|
465
|
+
}
|
|
466
|
+
if (!hasChannel) {
|
|
467
|
+
return { verdict: "ok" };
|
|
468
|
+
}
|
|
469
|
+
const channelId = explicit.channelId;
|
|
470
|
+
const threadTs = explicit.threadTs;
|
|
471
|
+
if (parent?.slackChannelId && channelId !== parent.slackChannelId) {
|
|
472
|
+
return {
|
|
473
|
+
verdict: "mismatch",
|
|
474
|
+
field: "slackChannelId",
|
|
475
|
+
expected: parent.slackChannelId,
|
|
476
|
+
expectedSource: "parent",
|
|
477
|
+
got: channelId,
|
|
478
|
+
detail: `explicit slackChannelId "${channelId}" does not match the parent task's slackChannelId "${parent.slackChannelId}".`
|
|
479
|
+
};
|
|
480
|
+
}
|
|
481
|
+
if (parent?.slackThreadTs && threadTs !== parent.slackThreadTs) {
|
|
482
|
+
return {
|
|
483
|
+
verdict: "mismatch",
|
|
484
|
+
field: "slackThreadTs",
|
|
485
|
+
expected: parent.slackThreadTs,
|
|
486
|
+
expectedSource: "parent",
|
|
487
|
+
got: threadTs,
|
|
488
|
+
detail: `explicit slackThreadTs "${threadTs}" does not match the parent task's slackThreadTs "${parent.slackThreadTs}" (same channel "${parent.slackChannelId}").`
|
|
489
|
+
};
|
|
490
|
+
}
|
|
491
|
+
const contextKeySlack = slackChannelFromContextKey(inheritedContextKey);
|
|
492
|
+
if (contextKeySlack) {
|
|
493
|
+
if (channelId !== contextKeySlack.channelId) {
|
|
494
|
+
return {
|
|
495
|
+
verdict: "mismatch",
|
|
496
|
+
field: "slackChannelId",
|
|
497
|
+
expected: contextKeySlack.channelId,
|
|
498
|
+
expectedSource: "contextKey",
|
|
499
|
+
got: channelId,
|
|
500
|
+
detail: `explicit slackChannelId "${channelId}" does not match the channel encoded in contextKey "${inheritedContextKey}" ("${contextKeySlack.channelId}").`
|
|
501
|
+
};
|
|
502
|
+
}
|
|
503
|
+
if (threadTs !== contextKeySlack.threadTs) {
|
|
504
|
+
return {
|
|
505
|
+
verdict: "mismatch",
|
|
506
|
+
field: "slackThreadTs",
|
|
507
|
+
expected: contextKeySlack.threadTs,
|
|
508
|
+
expectedSource: "contextKey",
|
|
509
|
+
got: threadTs,
|
|
510
|
+
detail: `explicit slackThreadTs "${threadTs}" does not match the thread encoded in contextKey "${inheritedContextKey}" ("${contextKeySlack.threadTs}").`
|
|
511
|
+
};
|
|
512
|
+
}
|
|
513
|
+
}
|
|
514
|
+
return { verdict: "ok" };
|
|
515
|
+
}
|
|
516
|
+
var init_slack_routing = __esm(() => {
|
|
517
|
+
init_context_key();
|
|
518
|
+
});
|
|
519
|
+
|
|
262
520
|
// src/telemetry.ts
|
|
263
521
|
import { randomUUID } from "node:crypto";
|
|
264
522
|
function isEnabled() {
|
|
@@ -5639,13 +5897,14 @@ function createTaskExtended(task, options) {
|
|
|
5639
5897
|
if (options?.parentTaskId) {
|
|
5640
5898
|
const parent = getTaskById(options.parentTaskId);
|
|
5641
5899
|
if (parent) {
|
|
5900
|
+
const explicitForeignChannel = !!options.slackChannelId && !!parent.slackChannelId && options.slackChannelId !== parent.slackChannelId;
|
|
5642
5901
|
if (parent.slackChannelId && !options.slackChannelId) {
|
|
5643
5902
|
options.slackChannelId = parent.slackChannelId;
|
|
5644
5903
|
}
|
|
5645
|
-
if (parent.slackThreadTs && !options.slackThreadTs) {
|
|
5904
|
+
if (parent.slackThreadTs && !options.slackThreadTs && !explicitForeignChannel) {
|
|
5646
5905
|
options.slackThreadTs = parent.slackThreadTs;
|
|
5647
5906
|
}
|
|
5648
|
-
if (parent.slackUserId && !options.slackUserId) {
|
|
5907
|
+
if (parent.slackUserId && !options.slackUserId && !explicitForeignChannel) {
|
|
5649
5908
|
options.slackUserId = parent.slackUserId;
|
|
5650
5909
|
}
|
|
5651
5910
|
if (parent.agentmailInboxId && !options.agentmailInboxId) {
|
|
@@ -5723,6 +5982,37 @@ function createTaskExtended(task, options) {
|
|
|
5723
5982
|
options.slackUserId = sourceTask.slackUserId;
|
|
5724
5983
|
}
|
|
5725
5984
|
}
|
|
5985
|
+
if (!options?.slackChannelId) {
|
|
5986
|
+
const backfill = slackChannelFromContextKey(options?.contextKey);
|
|
5987
|
+
if (backfill && options) {
|
|
5988
|
+
options.slackChannelId = backfill.channelId;
|
|
5989
|
+
options.slackThreadTs = backfill.threadTs;
|
|
5990
|
+
}
|
|
5991
|
+
} else if (!options.slackThreadTs) {
|
|
5992
|
+
const backfill = slackChannelFromContextKey(options.contextKey);
|
|
5993
|
+
if (backfill && backfill.channelId === options.slackChannelId) {
|
|
5994
|
+
options.slackThreadTs = backfill.threadTs;
|
|
5995
|
+
}
|
|
5996
|
+
}
|
|
5997
|
+
const finalSlackContext = slackChannelFromContextKey(options?.contextKey);
|
|
5998
|
+
if (finalSlackContext && options?.slackChannelId) {
|
|
5999
|
+
if (options.slackChannelId !== finalSlackContext.channelId) {
|
|
6000
|
+
if (options.overrideSlackContext) {
|
|
6001
|
+
console.log(`[slack-routing] override: keeping slackChannelId="${options.slackChannelId}" despite disagreeing with contextKey channel "${finalSlackContext.channelId}" (contextKey=${options.contextKey}, sourceTaskId=${options.sourceTaskId ?? "n/a"}, parentTaskId=${options.parentTaskId ?? "n/a"})`);
|
|
6002
|
+
} else {
|
|
6003
|
+
console.warn(`[slack-routing] MISMATCH task creation: normalizing slackChannelId="${options.slackChannelId}" to contextKey channel "${finalSlackContext.channelId}" (contextKey=${options.contextKey}, sourceTaskId=${options.sourceTaskId ?? "n/a"}, parentTaskId=${options.parentTaskId ?? "n/a"})`);
|
|
6004
|
+
options.slackChannelId = finalSlackContext.channelId;
|
|
6005
|
+
options.slackThreadTs = finalSlackContext.threadTs;
|
|
6006
|
+
}
|
|
6007
|
+
} else if (options.slackThreadTs && options.slackThreadTs !== finalSlackContext.threadTs) {
|
|
6008
|
+
if (options.overrideSlackContext) {
|
|
6009
|
+
console.log(`[slack-routing] override: keeping slackThreadTs="${options.slackThreadTs}" despite disagreeing with contextKey thread "${finalSlackContext.threadTs}" (contextKey=${options.contextKey}, sourceTaskId=${options.sourceTaskId ?? "n/a"}, parentTaskId=${options.parentTaskId ?? "n/a"})`);
|
|
6010
|
+
} else {
|
|
6011
|
+
console.warn(`[slack-routing] MISMATCH task creation: normalizing slackThreadTs="${options.slackThreadTs}" to contextKey thread "${finalSlackContext.threadTs}" (contextKey=${options.contextKey}, sourceTaskId=${options.sourceTaskId ?? "n/a"}, parentTaskId=${options.parentTaskId ?? "n/a"})`);
|
|
6012
|
+
options.slackThreadTs = finalSlackContext.threadTs;
|
|
6013
|
+
}
|
|
6014
|
+
}
|
|
6015
|
+
}
|
|
5726
6016
|
const auditUserId = getCurrentRequestUserId() ?? null;
|
|
5727
6017
|
const row = getDb().prepare(`INSERT INTO agent_tasks (
|
|
5728
6018
|
id, agentId, creatorAgentId, task, status, source,
|
|
@@ -10201,6 +10491,7 @@ var init_db = __esm(() => {
|
|
|
10201
10491
|
init_provider_metadata();
|
|
10202
10492
|
init_package();
|
|
10203
10493
|
init_resolver();
|
|
10494
|
+
init_slack_routing();
|
|
10204
10495
|
init_telemetry();
|
|
10205
10496
|
init_types();
|
|
10206
10497
|
init_credentials();
|
|
@@ -10306,4 +10597,4 @@ var init_db = __esm(() => {
|
|
|
10306
10597
|
};
|
|
10307
10598
|
});
|
|
10308
10599
|
|
|
10309
|
-
export { interpolate, deepInterpolate, init_template, registerTemplate, getTemplateDefinition, getAllTemplateDefinitions, init_registry, configureHttpResolver, resolveTemplate, resolveTemplateAsync, init_resolver, initTelemetry, telemetry, init_telemetry, ModelTierSchema, ReasoningEffortSchema, splitLegacyModelAlias, resolveTaskModelSelection, AgentTaskStatusSchema, isTerminalTaskStatus, AgentTaskSourceSchema, ProviderNameSchema, FollowUpConfigSchema, AgentTaskSchema, AttachmentInputSchema, TaskAttachmentSchema, InboxItemTypeSchema, InboxItemStatusSchema, FavoriteItemTypeSchema, TaskTemplateKindSchema, AgentSchema, AgentLatestModelSchema, AgentCredStatusSchema, ChannelTypeSchema, ChannelSchema, ChannelMessageSchema, ServiceStatusSchema, ServiceSchema, ResumeReasonSchema, AgentLogSchema, EventCategorySchema, EventStatusSchema, EventSourceSchema, EventNameSchema, ScheduledTaskTargetTypeSchema, SwarmConfigScopeSchema, SwarmConfigSchema, RepoGuidelinesSchema, RepoHooksSchema, SwarmRepoSchema, AgentMemoryScopeSchema, AgentMemorySourceSchema, AgentMemorySchema, WorkflowDefinitionSchema, WorkflowNodePatchSchema, WorkflowPatchSchema, TriggerConfigSchema, CooldownConfigSchema, InputValueSchema, PageContentTypeSchema, PageAuthModeSchema, MetricDefinitionSchema, MetricVersionSchema, WorkflowRunStatusSchema, ScriptRunStatusSchema, TERMINAL_SCRIPT_RUN_STATUSES, PromptTemplateScopeSchema, PromptTemplateStateSchema, PromptTemplateSchema, PromptTemplateHistorySchema, ScriptScopeSchema, ScriptFsModeSchema, ScriptApiAuthModeSchema, ContextSnapshotEventTypeSchema, ContextFormulaSchema, BudgetScopeSchema, BudgetSchema, PricingProviderSchema, PricingTokenClassSchema, PricingRowSchema, BudgetRefusalCauseSchema, BudgetRefusalNotificationSchema, KvValueTypeSchema, KvNamespaceSchema, KvKeySchema, KvEntrySchema, init_types, setRequestAuth, getRequestAuth, getCurrentRequestAuth, init_request_auth_context, encryptSecret, decryptSecret, getEncryptionKey, init_crypto, normalizeDate, normalizeDateRequired, init_date_utils, init_session_templates, init_templates, init_templates2 as init_templates1, isReservedConfigKey, reservedKeyError, validateConfigValue, init_swarm_config_guard, onTaskStarted, init_task_lifecycle_events, generateDefaultClaudeMd, generateDefaultSoulMd, generateDefaultIdentityMd, generateDefaultToolsMd, init_defaults, isSqliteVecAvailable, initDb, getDb, closeDb, computeContentHash, createContextVersion, getLatestContextVersion, getContextVersion, getContextVersionHistory, agentQueries, updateAgentCredentialState, createAgent, getAgentById, getAllAgents, getLeadAgent, updateAgentStatus, updateAgentMaxTasks, updateAgentProvider, setAgentHarnessProvider, updateAgentCredStatus, listAgentsWithCredStatusByProvider, getAgentHarnessProviders, updateAgentActivity, MAX_EMPTY_POLLS, incrementEmptyPollCount, resetEmptyPollCount, shouldBlockPolling, deleteAgent, getActiveTaskCount, hasCapacity, getRemainingCapacity, updateAgentStatusFromCapacity, isPoolAffinityEnforcementEnabled, buildRoutingAffinityFromAgent, isAgentEligibleForTask, taskQueries, createTask, getPendingTaskForAgent, assignUnassignedTaskPending, startTask, getTaskById, markTaskSlackReplySent, setSlackMessageTracking, getChildTasks, hasNonTerminalResumeChild, hasNonTerminalRerouteDecisionChild, updateTaskClaudeSessionId, updateTaskVcs, getTasksByAgentId, getAgentCurrentTask, getTasksByStatus, findTaskByVcs, findTaskByGitHub, getAllTasks, getTasksCount, getTaskStats, getCompletedSlackTasks, getRecentlyFinishedWorkerTasks, markTasksNotified, resetTasksNotified, getInProgressSlackTasks, getInProgressTasksByContextKey, findExistingLinearTrackerContextWork, getLatestTaskByContextKey, getAgentWorkingOnThread, getLatestActiveTaskInThread, getMostRecentTaskInThread, findCompletedTaskInThread, findRecentCancelledTaskInThread, completeTask, failTask, cancelTask, supersedeTask, backfillSupersedeTaskResumeTaskId, pauseTask, resumeTask, getPausedTasksForAgent, getOrphanedInProgressTasksForAgent, resetOrphanedInProgressTasksForAgent, getRecentlyCancelledTasksForAgent, deleteTask, updateTaskProgress, insertTaskAttachment, deleteTaskAttachment, replaceTaskAttachment, getTaskAttachments, getAgentWithTasks, getAllAgentsWithTasks, logQueries, createLogEntry, getLogsByAgentId, getLogsByTaskId, getLogsByTaskIdChronological, getLogsByEventType, getAllLogs, findRecentSimilarTasks, createTaskExtended, claimTask, releaseTask, acceptTask, rejectTask, moveTaskToBacklog, moveTaskFromBacklog, releaseStaleReviewingTasks, getOfferedTasksForAgent, claimOfferedTask, getUnassignedTasksCount, getUnassignedTaskIds, getUnassignedTaskIdsForAgent, checkDependencies, getDependentTasks, cascadeFailDependents, updateAgentProfile, updateAgentName, createChannel, getMessageById, getChannelById, getChannelByName, getAllChannels, deleteChannel, postMessage, getChannelMessages, updateReadState, getLastReadAt, getUnreadMessages, getMentionsForAgent, getInboxSummary, claimMentions, releaseMentionProcessing, releaseStaleMentionProcessing, createService, getServiceById, getServiceByAgentAndName, getServicesByAgentId, getAllServices, updateServiceStatus, deleteService, upsertService, deleteServicesByAgentId, sessionLogQueries, createSessionLogs, getSessionLogsByTaskId, getSessionLogsBySession, createSessionCost, getSessionCostsByTaskId, getSessionCostsByAgentId, getAllSessionCosts, getSessionCostsFiltered, getSessionCostSummary, getDashboardCostSummary, createInboxMessage, getInboxMessageById, getUnreadInboxMessages, claimInboxMessages, markInboxMessageRead, markInboxMessageResponded, markInboxMessageDelegated, releaseStaleProcessingInbox, getConcurrentContext, getScheduledTasks, getScheduledTaskById, getScheduledTaskByName, createScheduledTask, updateScheduledTask, deleteScheduledTask, getDueScheduledTasks, autoEncryptLegacyPlaintextSecrets, maskSecrets, getSwarmConfigs, getInjectableGlobalConfigs, getSwarmConfigById, getSwarmConfigLookupById, upsertSwarmConfig, deleteSwarmConfig, deleteSwarmConfigByKey, getResolvedConfig, getSwarmRepos, getSwarmRepoById, getSwarmRepoByName, getSwarmRepoByUrl, createSwarmRepo, updateSwarmRepo, deleteSwarmRepo, getAgentMailInboxMapping, getAgentMailInboxMappingsByAgent, getAllAgentMailInboxMappings, createAgentMailInboxMapping, deleteAgentMailInboxMapping, findTaskByAgentMailThread, insertActiveSession, deleteActiveSession, deleteActiveSessionById, getActiveSessions, heartbeatActiveSession, cleanupStaleSessions, cleanupAgentSessions, updateActiveSessionProviderSessionId, getActiveSessionForTask, reassociateSessionLogs, getStalledInProgressTasks, getStalePinnedResumes, failPendingResumeIfUnclaimed, getIdleWorkersWithCapacity, getUnassignedPoolTasks, getStaleUnassignedAffinityTasks, getRecentFailedTasks, getRecentCompletedCount, getRecentFailedCount, createWorkflow, getWorkflow, listWorkflows, updateWorkflow, deleteWorkflow, getWorkflowsByScheduleId, createWorkflowRun, getWorkflowRun, updateWorkflowRun, listWorkflowRuns, createWorkflowRunStep, getWorkflowRunStep, updateWorkflowRunStep, getWorkflowRunStepsByRunId, getStuckWorkflowRuns, getLastSuccessfulRun, getLastRunStart, getRetryableSteps, getCompletedStepNodeIds, getTaskByWorkflowRunStepId, getStepByIdempotencyKey, getStepCountForNode, getLatestStepForNode, createWorkflowVersion, getWorkflowVersions, getWorkflowVersion, createPage, getPage, getPageBySlug, getLatestPageBySlug, listPagesByAgent, listAllPages, countAllPages, countPagesByAgent, updatePage, deletePage, incrementPageViewCount, createPageVersion, getPageVersions, getPageVersion, createMetric, getMetric, getMetricBySlug, listMetricsByAgent, listAllMetrics, countAllMetrics, countMetricsByAgent, updateMetric, deleteMetric, createMetricVersion, getMetricVersions, getMetricVersion, getPromptTemplates, getPromptTemplateById, upsertPromptTemplate, deletePromptTemplate, resetPromptTemplateToDefault, getPromptTemplateHistory, resolvePromptTemplate, checkoutPromptTemplate, getAllChannelActivityCursors, getChannelActivityCursor, upsertChannelActivityCursor, createApprovalRequest, getApprovalRequestById, resolveApprovalRequest, updateApprovalRequestNotifications, listApprovalRequests, getStuckApprovalRuns, getApprovalRequestByStepId, getExpiredPendingApprovals, createWaitState, getWaitStateById, getWaitStateByStepId, getDueWaitStates, getPendingEventWaitNames, getPendingWaitsByEvent, resolveWaitState, getStuckWaitRuns, SKILL_FILE_LIMITS, normalizeSkillFilePath, createSkill, updateSkill, listSkillFileManifest, getSkillFiles, getSkillFile, upsertSkillFile, upsertSkillFiles, deleteSkillFile, deleteSkill, getSkillById, getSkillByName, listSkills, searchSkills, installSkill, getSystemDefaultSkills, installSystemDefaultSkillsForAgent, uninstallSkill, getAgentSkills, toggleAgentSkill, createMcpServer, updateMcpServer, deleteMcpServer, getMcpServerById, getMcpServerByName, listMcpServers, installMcpServer, uninstallMcpServer, getAgentMcpServers, createContextSnapshot, getContextSnapshotsByTaskId, getContextSnapshotsBySessionId, getContextSummaryByTaskId, getAvailableKeyIndices, recordKeyUsage, markKeyRateLimited, recordKeyRateLimitWindows, setApiKeyName, clearKeyRateLimit, getKeyStatuses, getKeyCostSummary, getUserById, getAllUsers, createUser, updateUser, deleteUser, listInboxState, upsertInboxState, listUserFavorites, getFavoriteItemIdSet, setUserFavorite, withFavoriteFlags, listTaskTemplates, getRootTaskChain, listRecentSessions, countSessions, getBudget, getBudgets, upsertBudget, deleteBudget, getAllPricingRows, getPricingRows, getActivePricingRow, insertPricingRow, deletePricingRow, getDailySpendForAgent, getDailySpendGlobal, getDailySpendForUser, recordBudgetRefusalNotification, getBudgetRefusalNotification, getRecentBudgetRefusalNotifications, hasBudgetRefusalNotificationToday, setBudgetRefusalFollowUpTaskId, getLiveAgentCounts, getInstanceActivity, getSwarmMetrics, hasFirstCompletedTask, getKv, upsertKv, deleteKv, KvTypeCollisionError, incrKv, listKv, countKv, createScriptRun, recordInlineScriptRun, getScriptRun, getScriptRunByIdempotencyKey, listScriptRuns, countScriptRuns, countActiveScriptRuns, updateScriptRun, getRunningScriptRuns, getScriptRunJournalStep, upsertScriptRunJournalStep, listScriptRunJournalSteps, countScriptRunJournalSteps, countScriptRunJournalAgentTaskSteps, exports_db, init_db };
|
|
10600
|
+
export { interpolate, deepInterpolate, init_template, registerTemplate, getTemplateDefinition, getAllTemplateDefinitions, init_registry, configureHttpResolver, resolveTemplate, resolveTemplateAsync, init_resolver, slackContextKey, agentmailContextKey, githubContextKey, gitlabContextKey, linearContextKey, buildJiraContextKey, scheduleContextKey, workflowContextKey, agentContextKey, pageContextKey, init_context_key, checkSlackRoutingCoherence, init_slack_routing, initTelemetry, telemetry, init_telemetry, ModelTierSchema, ReasoningEffortSchema, splitLegacyModelAlias, resolveTaskModelSelection, AgentTaskStatusSchema, isTerminalTaskStatus, AgentTaskSourceSchema, ProviderNameSchema, FollowUpConfigSchema, AgentTaskSchema, AttachmentInputSchema, TaskAttachmentSchema, InboxItemTypeSchema, InboxItemStatusSchema, FavoriteItemTypeSchema, TaskTemplateKindSchema, AgentSchema, AgentLatestModelSchema, AgentCredStatusSchema, ChannelTypeSchema, ChannelSchema, ChannelMessageSchema, ServiceStatusSchema, ServiceSchema, ResumeReasonSchema, AgentLogSchema, EventCategorySchema, EventStatusSchema, EventSourceSchema, EventNameSchema, ScheduledTaskTargetTypeSchema, SwarmConfigScopeSchema, SwarmConfigSchema, RepoGuidelinesSchema, RepoHooksSchema, SwarmRepoSchema, AgentMemoryScopeSchema, AgentMemorySourceSchema, AgentMemorySchema, WorkflowDefinitionSchema, WorkflowNodePatchSchema, WorkflowPatchSchema, TriggerConfigSchema, CooldownConfigSchema, InputValueSchema, PageContentTypeSchema, PageAuthModeSchema, MetricDefinitionSchema, MetricVersionSchema, WorkflowRunStatusSchema, ScriptRunStatusSchema, TERMINAL_SCRIPT_RUN_STATUSES, PromptTemplateScopeSchema, PromptTemplateStateSchema, PromptTemplateSchema, PromptTemplateHistorySchema, ScriptScopeSchema, ScriptFsModeSchema, ScriptApiAuthModeSchema, ContextSnapshotEventTypeSchema, ContextFormulaSchema, BudgetScopeSchema, BudgetSchema, PricingProviderSchema, PricingTokenClassSchema, PricingRowSchema, BudgetRefusalCauseSchema, BudgetRefusalNotificationSchema, KvValueTypeSchema, KvNamespaceSchema, KvKeySchema, KvEntrySchema, init_types, setRequestAuth, getRequestAuth, getCurrentRequestAuth, init_request_auth_context, encryptSecret, decryptSecret, getEncryptionKey, init_crypto, normalizeDate, normalizeDateRequired, init_date_utils, init_session_templates, init_templates, init_templates2 as init_templates1, isReservedConfigKey, reservedKeyError, validateConfigValue, init_swarm_config_guard, onTaskStarted, init_task_lifecycle_events, generateDefaultClaudeMd, generateDefaultSoulMd, generateDefaultIdentityMd, generateDefaultToolsMd, init_defaults, isSqliteVecAvailable, initDb, getDb, closeDb, computeContentHash, createContextVersion, getLatestContextVersion, getContextVersion, getContextVersionHistory, agentQueries, updateAgentCredentialState, createAgent, getAgentById, getAllAgents, getLeadAgent, updateAgentStatus, updateAgentMaxTasks, updateAgentProvider, setAgentHarnessProvider, updateAgentCredStatus, listAgentsWithCredStatusByProvider, getAgentHarnessProviders, updateAgentActivity, MAX_EMPTY_POLLS, incrementEmptyPollCount, resetEmptyPollCount, shouldBlockPolling, deleteAgent, getActiveTaskCount, hasCapacity, getRemainingCapacity, updateAgentStatusFromCapacity, isPoolAffinityEnforcementEnabled, buildRoutingAffinityFromAgent, isAgentEligibleForTask, taskQueries, createTask, getPendingTaskForAgent, assignUnassignedTaskPending, startTask, getTaskById, markTaskSlackReplySent, setSlackMessageTracking, getChildTasks, hasNonTerminalResumeChild, hasNonTerminalRerouteDecisionChild, updateTaskClaudeSessionId, updateTaskVcs, getTasksByAgentId, getAgentCurrentTask, getTasksByStatus, findTaskByVcs, findTaskByGitHub, getAllTasks, getTasksCount, getTaskStats, getCompletedSlackTasks, getRecentlyFinishedWorkerTasks, markTasksNotified, resetTasksNotified, getInProgressSlackTasks, getInProgressTasksByContextKey, findExistingLinearTrackerContextWork, getLatestTaskByContextKey, getAgentWorkingOnThread, getLatestActiveTaskInThread, getMostRecentTaskInThread, findCompletedTaskInThread, findRecentCancelledTaskInThread, completeTask, failTask, cancelTask, supersedeTask, backfillSupersedeTaskResumeTaskId, pauseTask, resumeTask, getPausedTasksForAgent, getOrphanedInProgressTasksForAgent, resetOrphanedInProgressTasksForAgent, getRecentlyCancelledTasksForAgent, deleteTask, updateTaskProgress, insertTaskAttachment, deleteTaskAttachment, replaceTaskAttachment, getTaskAttachments, getAgentWithTasks, getAllAgentsWithTasks, logQueries, createLogEntry, getLogsByAgentId, getLogsByTaskId, getLogsByTaskIdChronological, getLogsByEventType, getAllLogs, findRecentSimilarTasks, createTaskExtended, claimTask, releaseTask, acceptTask, rejectTask, moveTaskToBacklog, moveTaskFromBacklog, releaseStaleReviewingTasks, getOfferedTasksForAgent, claimOfferedTask, getUnassignedTasksCount, getUnassignedTaskIds, getUnassignedTaskIdsForAgent, checkDependencies, getDependentTasks, cascadeFailDependents, updateAgentProfile, updateAgentName, createChannel, getMessageById, getChannelById, getChannelByName, getAllChannels, deleteChannel, postMessage, getChannelMessages, updateReadState, getLastReadAt, getUnreadMessages, getMentionsForAgent, getInboxSummary, claimMentions, releaseMentionProcessing, releaseStaleMentionProcessing, createService, getServiceById, getServiceByAgentAndName, getServicesByAgentId, getAllServices, updateServiceStatus, deleteService, upsertService, deleteServicesByAgentId, sessionLogQueries, createSessionLogs, getSessionLogsByTaskId, getSessionLogsBySession, createSessionCost, getSessionCostsByTaskId, getSessionCostsByAgentId, getAllSessionCosts, getSessionCostsFiltered, getSessionCostSummary, getDashboardCostSummary, createInboxMessage, getInboxMessageById, getUnreadInboxMessages, claimInboxMessages, markInboxMessageRead, markInboxMessageResponded, markInboxMessageDelegated, releaseStaleProcessingInbox, getConcurrentContext, getScheduledTasks, getScheduledTaskById, getScheduledTaskByName, createScheduledTask, updateScheduledTask, deleteScheduledTask, getDueScheduledTasks, autoEncryptLegacyPlaintextSecrets, maskSecrets, getSwarmConfigs, getInjectableGlobalConfigs, getSwarmConfigById, getSwarmConfigLookupById, upsertSwarmConfig, deleteSwarmConfig, deleteSwarmConfigByKey, getResolvedConfig, getSwarmRepos, getSwarmRepoById, getSwarmRepoByName, getSwarmRepoByUrl, createSwarmRepo, updateSwarmRepo, deleteSwarmRepo, getAgentMailInboxMapping, getAgentMailInboxMappingsByAgent, getAllAgentMailInboxMappings, createAgentMailInboxMapping, deleteAgentMailInboxMapping, findTaskByAgentMailThread, insertActiveSession, deleteActiveSession, deleteActiveSessionById, getActiveSessions, heartbeatActiveSession, cleanupStaleSessions, cleanupAgentSessions, updateActiveSessionProviderSessionId, getActiveSessionForTask, reassociateSessionLogs, getStalledInProgressTasks, getStalePinnedResumes, failPendingResumeIfUnclaimed, getIdleWorkersWithCapacity, getUnassignedPoolTasks, getStaleUnassignedAffinityTasks, getRecentFailedTasks, getRecentCompletedCount, getRecentFailedCount, createWorkflow, getWorkflow, listWorkflows, updateWorkflow, deleteWorkflow, getWorkflowsByScheduleId, createWorkflowRun, getWorkflowRun, updateWorkflowRun, listWorkflowRuns, createWorkflowRunStep, getWorkflowRunStep, updateWorkflowRunStep, getWorkflowRunStepsByRunId, getStuckWorkflowRuns, getLastSuccessfulRun, getLastRunStart, getRetryableSteps, getCompletedStepNodeIds, getTaskByWorkflowRunStepId, getStepByIdempotencyKey, getStepCountForNode, getLatestStepForNode, createWorkflowVersion, getWorkflowVersions, getWorkflowVersion, createPage, getPage, getPageBySlug, getLatestPageBySlug, listPagesByAgent, listAllPages, countAllPages, countPagesByAgent, updatePage, deletePage, incrementPageViewCount, createPageVersion, getPageVersions, getPageVersion, createMetric, getMetric, getMetricBySlug, listMetricsByAgent, listAllMetrics, countAllMetrics, countMetricsByAgent, updateMetric, deleteMetric, createMetricVersion, getMetricVersions, getMetricVersion, getPromptTemplates, getPromptTemplateById, upsertPromptTemplate, deletePromptTemplate, resetPromptTemplateToDefault, getPromptTemplateHistory, resolvePromptTemplate, checkoutPromptTemplate, getAllChannelActivityCursors, getChannelActivityCursor, upsertChannelActivityCursor, createApprovalRequest, getApprovalRequestById, resolveApprovalRequest, updateApprovalRequestNotifications, listApprovalRequests, getStuckApprovalRuns, getApprovalRequestByStepId, getExpiredPendingApprovals, createWaitState, getWaitStateById, getWaitStateByStepId, getDueWaitStates, getPendingEventWaitNames, getPendingWaitsByEvent, resolveWaitState, getStuckWaitRuns, SKILL_FILE_LIMITS, normalizeSkillFilePath, createSkill, updateSkill, listSkillFileManifest, getSkillFiles, getSkillFile, upsertSkillFile, upsertSkillFiles, deleteSkillFile, deleteSkill, getSkillById, getSkillByName, listSkills, searchSkills, installSkill, getSystemDefaultSkills, installSystemDefaultSkillsForAgent, uninstallSkill, getAgentSkills, toggleAgentSkill, createMcpServer, updateMcpServer, deleteMcpServer, getMcpServerById, getMcpServerByName, listMcpServers, installMcpServer, uninstallMcpServer, getAgentMcpServers, createContextSnapshot, getContextSnapshotsByTaskId, getContextSnapshotsBySessionId, getContextSummaryByTaskId, getAvailableKeyIndices, recordKeyUsage, markKeyRateLimited, recordKeyRateLimitWindows, setApiKeyName, clearKeyRateLimit, getKeyStatuses, getKeyCostSummary, getUserById, getAllUsers, createUser, updateUser, deleteUser, listInboxState, upsertInboxState, listUserFavorites, getFavoriteItemIdSet, setUserFavorite, withFavoriteFlags, listTaskTemplates, getRootTaskChain, listRecentSessions, countSessions, getBudget, getBudgets, upsertBudget, deleteBudget, getAllPricingRows, getPricingRows, getActivePricingRow, insertPricingRow, deletePricingRow, getDailySpendForAgent, getDailySpendGlobal, getDailySpendForUser, recordBudgetRefusalNotification, getBudgetRefusalNotification, getRecentBudgetRefusalNotifications, hasBudgetRefusalNotificationToday, setBudgetRefusalFollowUpTaskId, getLiveAgentCounts, getInstanceActivity, getSwarmMetrics, hasFirstCompletedTask, getKv, upsertKv, deleteKv, KvTypeCollisionError, incrKv, listKv, countKv, createScriptRun, recordInlineScriptRun, getScriptRun, getScriptRunByIdempotencyKey, listScriptRuns, countScriptRuns, countActiveScriptRuns, updateScriptRun, getRunningScriptRuns, getScriptRunJournalStep, upsertScriptRunJournalStep, listScriptRunJournalSteps, countScriptRunJournalSteps, countScriptRunJournalAgentTaskSteps, exports_db, init_db };
|
|
@@ -4,26 +4,27 @@ import {
|
|
|
4
4
|
handleScheduleTrigger,
|
|
5
5
|
runScript,
|
|
6
6
|
startWorkflowExecution
|
|
7
|
-
} from "./cli-
|
|
7
|
+
} from "./cli-e0xv4nd4.js";
|
|
8
8
|
import {
|
|
9
9
|
getScript,
|
|
10
10
|
getScriptApiConnectionDescriptors,
|
|
11
11
|
getScriptMcpConnectionDescriptors
|
|
12
|
-
} from "./cli-
|
|
12
|
+
} from "./cli-vwhg6sbn.js";
|
|
13
13
|
import {
|
|
14
|
-
createTaskWithSiblingAwareness
|
|
15
|
-
|
|
16
|
-
} from "./cli-k3y4z3h5.js";
|
|
14
|
+
createTaskWithSiblingAwareness
|
|
15
|
+
} from "./cli-5ekf4gcj.js";
|
|
17
16
|
import {
|
|
18
17
|
getDb,
|
|
19
18
|
getDueScheduledTasks,
|
|
20
19
|
getScheduledTaskById,
|
|
21
20
|
getWorkflow,
|
|
21
|
+
init_context_key,
|
|
22
22
|
init_db,
|
|
23
23
|
init_telemetry,
|
|
24
|
+
scheduleContextKey,
|
|
24
25
|
telemetry,
|
|
25
26
|
updateScheduledTask
|
|
26
|
-
} from "./cli-
|
|
27
|
+
} from "./cli-s5q026mr.js";
|
|
27
28
|
import {
|
|
28
29
|
__commonJS,
|
|
29
30
|
__require,
|
|
@@ -6845,6 +6846,7 @@ var version = package_default.version;
|
|
|
6845
6846
|
// src/scheduler/scheduler.ts
|
|
6846
6847
|
init_db();
|
|
6847
6848
|
var import_cron_parser = __toESM(require_dist(), 1);
|
|
6849
|
+
init_context_key();
|
|
6848
6850
|
init_telemetry();
|
|
6849
6851
|
var schedulerInterval = null;
|
|
6850
6852
|
var isProcessing = false;
|
|
@@ -3,7 +3,7 @@ import {
|
|
|
3
3
|
} from "./cli-jkhwmmgg.js";
|
|
4
4
|
import {
|
|
5
5
|
embedScript
|
|
6
|
-
} from "./cli-
|
|
6
|
+
} from "./cli-z824vphk.js";
|
|
7
7
|
import {
|
|
8
8
|
calculatePKCECodeChallenge,
|
|
9
9
|
generateRandomCodeVerifier,
|
|
@@ -22,7 +22,7 @@ import {
|
|
|
22
22
|
init_date_utils,
|
|
23
23
|
init_db,
|
|
24
24
|
normalizeDateRequired
|
|
25
|
-
} from "./cli-
|
|
25
|
+
} from "./cli-s5q026mr.js";
|
|
26
26
|
import {
|
|
27
27
|
init_zod
|
|
28
28
|
} from "./cli-bw80ck94.js";
|
|
@@ -7,7 +7,7 @@ var package_default;
|
|
|
7
7
|
var init_package = __esm(() => {
|
|
8
8
|
package_default = {
|
|
9
9
|
name: "@desplega.ai/agent-swarm",
|
|
10
|
-
version: "1.
|
|
10
|
+
version: "1.117.0",
|
|
11
11
|
description: "Multi-agent orchestration for Claude Code, Codex, Gemini CLI, and other AI coding assistants",
|
|
12
12
|
license: "MIT",
|
|
13
13
|
author: "desplega.sh <contact@desplega.sh>",
|
|
@@ -153,7 +153,7 @@ var init_package = __esm(() => {
|
|
|
153
153
|
"@inkjs/ui": "^2.0.0",
|
|
154
154
|
"@linear/sdk": "^77.0.0",
|
|
155
155
|
"@modelcontextprotocol/sdk": "^1.25.1",
|
|
156
|
-
"@openai/codex-sdk": "^0.
|
|
156
|
+
"@openai/codex-sdk": "^0.144.1",
|
|
157
157
|
"@opencode-ai/sdk": "^1.17.15",
|
|
158
158
|
"@openfort/openfort-node": "^0.9.1",
|
|
159
159
|
"@opentelemetry/api": "^1.9.1",
|
|
@@ -4,11 +4,11 @@ import {
|
|
|
4
4
|
getEmbeddingProvider,
|
|
5
5
|
init_embedding,
|
|
6
6
|
serializeEmbedding
|
|
7
|
-
} from "./cli-
|
|
7
|
+
} from "./cli-rymspw51.js";
|
|
8
8
|
import {
|
|
9
9
|
getDb,
|
|
10
10
|
init_db
|
|
11
|
-
} from "./cli-
|
|
11
|
+
} from "./cli-s5q026mr.js";
|
|
12
12
|
import {
|
|
13
13
|
init_secret_scrubber,
|
|
14
14
|
scrubSecrets
|
package/dist/cli.js
CHANGED
|
@@ -64,7 +64,7 @@ var import_react = __toESM(require_react(), 1);
|
|
|
64
64
|
// package.json
|
|
65
65
|
var package_default = {
|
|
66
66
|
name: "@desplega.ai/agent-swarm",
|
|
67
|
-
version: "1.
|
|
67
|
+
version: "1.117.0",
|
|
68
68
|
description: "Multi-agent orchestration for Claude Code, Codex, Gemini CLI, and other AI coding assistants",
|
|
69
69
|
license: "MIT",
|
|
70
70
|
author: "desplega.sh <contact@desplega.sh>",
|
|
@@ -210,7 +210,7 @@ var package_default = {
|
|
|
210
210
|
"@inkjs/ui": "^2.0.0",
|
|
211
211
|
"@linear/sdk": "^77.0.0",
|
|
212
212
|
"@modelcontextprotocol/sdk": "^1.25.1",
|
|
213
|
-
"@openai/codex-sdk": "^0.
|
|
213
|
+
"@openai/codex-sdk": "^0.144.1",
|
|
214
214
|
"@opencode-ai/sdk": "^1.17.15",
|
|
215
215
|
"@openfort/openfort-node": "^0.9.1",
|
|
216
216
|
"@opentelemetry/api": "^1.9.1",
|
|
@@ -654,7 +654,7 @@ function McpServer({ port, apiKey, dbPath }) {
|
|
|
654
654
|
if (dbPath) {
|
|
655
655
|
process.env.DATABASE_PATH = dbPath;
|
|
656
656
|
}
|
|
657
|
-
import("./http-
|
|
657
|
+
import("./http-x7svk8q5.js").then(() => {
|
|
658
658
|
setStatus("running");
|
|
659
659
|
}).catch((err) => {
|
|
660
660
|
setStatus("error");
|
|
@@ -740,7 +740,7 @@ function WorkerRunner({
|
|
|
740
740
|
}) {
|
|
741
741
|
const { exit } = use_app_default();
|
|
742
742
|
import_react.useEffect(() => {
|
|
743
|
-
import("./worker-
|
|
743
|
+
import("./worker-7w6571j0.js").then(({ runWorker }) => runWorker({
|
|
744
744
|
prompt: prompt || undefined,
|
|
745
745
|
yolo,
|
|
746
746
|
systemPrompt: systemPrompt || undefined,
|
|
@@ -757,7 +757,7 @@ function WorkerRunner({
|
|
|
757
757
|
function LeadRunner({ prompt, yolo, systemPrompt, systemPromptFile, additionalArgs }) {
|
|
758
758
|
const { exit } = use_app_default();
|
|
759
759
|
import_react.useEffect(() => {
|
|
760
|
-
import("./lead-
|
|
760
|
+
import("./lead-nmzd0ykq.js").then(({ runLead }) => runLead({
|
|
761
761
|
prompt: prompt || undefined,
|
|
762
762
|
yolo,
|
|
763
763
|
systemPrompt: systemPrompt || undefined,
|
|
@@ -797,8 +797,8 @@ function LazyComponent({
|
|
|
797
797
|
}
|
|
798
798
|
return import_react.createElement(Component, props);
|
|
799
799
|
}
|
|
800
|
-
var loadOnboard = () => import("./onboard-
|
|
801
|
-
var loadConnect = () => import("./setup-
|
|
800
|
+
var loadOnboard = () => import("./onboard-shmqj6ep.js").then(({ Onboard }) => Onboard);
|
|
801
|
+
var loadConnect = () => import("./setup-yv9ctywz.js").then(({ Setup }) => Setup);
|
|
802
802
|
function UnknownCommand({ command }) {
|
|
803
803
|
const { exit } = use_app_default();
|
|
804
804
|
import_react.useEffect(() => {
|
|
@@ -911,7 +911,7 @@ ${binName} docs \u2014 v${package_default.version}
|
|
|
911
911
|
}
|
|
912
912
|
process.exit(0);
|
|
913
913
|
} else if (args.command === "hook") {
|
|
914
|
-
const { runHook } = await import("./hook-
|
|
914
|
+
const { runHook } = await import("./hook-e4wdztg5.js");
|
|
915
915
|
await runHook();
|
|
916
916
|
} else if (args.command === "artifact") {
|
|
917
917
|
const artifactArgs = process.argv.slice(process.argv.indexOf("artifact") + 1);
|
|
@@ -931,7 +931,7 @@ ${binName} docs \u2014 v${package_default.version}
|
|
|
931
931
|
printHelp("scripts");
|
|
932
932
|
process.exit(scriptsArgs[0] === "reembed" || args.showHelp ? 0 : 1);
|
|
933
933
|
}
|
|
934
|
-
const { runScriptsMaintenanceCommand } = await import("./maintenance-
|
|
934
|
+
const { runScriptsMaintenanceCommand } = await import("./maintenance-staxb3xt.js");
|
|
935
935
|
await runScriptsMaintenanceCommand(scriptsArgs);
|
|
936
936
|
console.log("Scripts re-embedded.");
|
|
937
937
|
} else if (args.command === "rbac") {
|
|
@@ -941,7 +941,7 @@ ${binName} docs \u2014 v${package_default.version}
|
|
|
941
941
|
printHelp("rbac");
|
|
942
942
|
process.exit(args.showHelp ? 0 : 1);
|
|
943
943
|
}
|
|
944
|
-
const { runRbacCliCommand } = await import("./rbac-roles-
|
|
944
|
+
const { runRbacCliCommand } = await import("./rbac-roles-j2k0h8sx.js");
|
|
945
945
|
await runRbacCliCommand(rbacArgs);
|
|
946
946
|
} else if (args.command === "codex-login") {
|
|
947
947
|
const { runCodexLogin } = await import("./codex-login-0h18cy3e.js");
|
|
@@ -2,11 +2,11 @@ import {
|
|
|
2
2
|
getAllAgents,
|
|
3
3
|
getAllTasks,
|
|
4
4
|
init_db
|
|
5
|
-
} from "./cli-
|
|
5
|
+
} from "./cli-s5q026mr.js";
|
|
6
6
|
import"./cli-z2zcxes1.js";
|
|
7
7
|
import"./cli-bw80ck94.js";
|
|
8
8
|
import"./cli-xz9aq0rf.js";
|
|
9
|
-
import"./cli-
|
|
9
|
+
import"./cli-xcp5dmts.js";
|
|
10
10
|
import"./cli-4j2mrzag.js";
|
|
11
11
|
import"./cli-p9swy5t3.js";
|
|
12
12
|
|
|
@@ -390,11 +390,11 @@ import {
|
|
|
390
390
|
upsertSkillFiles,
|
|
391
391
|
upsertSwarmConfig,
|
|
392
392
|
withFavoriteFlags
|
|
393
|
-
} from "./cli-
|
|
393
|
+
} from "./cli-s5q026mr.js";
|
|
394
394
|
import"./cli-z2zcxes1.js";
|
|
395
395
|
import"./cli-bw80ck94.js";
|
|
396
396
|
import"./cli-xz9aq0rf.js";
|
|
397
|
-
import"./cli-
|
|
397
|
+
import"./cli-xcp5dmts.js";
|
|
398
398
|
import"./cli-4j2mrzag.js";
|
|
399
399
|
import"./cli-p9swy5t3.js";
|
|
400
400
|
init_db();
|