@desplega.ai/agent-swarm 1.157.0 → 1.158.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-qhqrk4q0.js → acp-adapter-xaq4n6pc.js} +1 -1
- package/dist/{actions-9rrg0zxm.js → actions-p9hz5yat.js} +15 -15
- package/dist/{app-enysy1zd.js → app-g26wdcz6.js} +4 -4
- package/dist/{artifact-td4q4dch.js → artifact-3v5t9jtg.js} +1 -1
- package/dist/{assistant-zegamy48.js → assistant-wydfqkb3.js} +16 -16
- package/dist/{boot-reembed-r6shx5qx.js → boot-reembed-g5ckg9yb.js} +6 -6
- package/dist/{boot-reembed-zfxb937k.js → boot-reembed-se8zmdcp.js} +5 -5
- package/dist/{boot-scrub-logs-k5y0se6r.js → boot-scrub-logs-wfxqan61.js} +3 -3
- package/dist/{seed-pricing-vqxa06qf.js → boot-seeds-s3q01xj3.js} +10 -10
- package/dist/{claude-adapter-5yc7hxwv.js → claude-adapter-tv2x4f36.js} +7 -7
- package/dist/{claude-managed-adapter-ea2aga6w.js → claude-managed-adapter-41b2s7fd.js} +2 -2
- package/dist/{claude-sdk-session-j4ywn3xf.js → claude-sdk-session-t442qz6f.js} +8 -8
- package/dist/{cli-e781c6f9.js → cli-0xjkj1j7.js} +1 -0
- package/dist/{cli-58rgvkt4.js → cli-1hkrch3k.js} +2 -2
- package/dist/{cli-yscm6cv8.js → cli-20cj37vt.js} +1866 -9
- package/dist/{cli-h0wdadsx.js → cli-4198qc9v.js} +7 -3
- package/dist/{cli-awwphhcs.js → cli-47m6dkd3.js} +362 -126
- package/dist/{cli-wb2zvbfg.js → cli-53sz8gkz.js} +1 -1
- package/dist/{cli-005pze6s.js → cli-5d10vd2m.js} +1 -1
- package/dist/{cli-v53rbqp3.js → cli-65hjmev5.js} +57 -17
- package/dist/{cli-scwq51gn.js → cli-68w09sjw.js} +7 -1
- package/dist/{cli-s98skd5r.js → cli-7gtvvpbh.js} +4 -4
- package/dist/{cli-y3nxwx0t.js → cli-7s3syk22.js} +18 -11
- package/dist/{cli-74h6f2bp.js → cli-8qmme6vd.js} +2 -2
- package/dist/{cli-wsed24mk.js → cli-987hg0aa.js} +2 -2
- package/dist/{cli-9n76jszt.js → cli-9httdpyq.js} +1 -1
- package/dist/{cli-f3va018d.js → cli-aky8tctm.js} +26 -93
- package/dist/{cli-sgyqyyxe.js → cli-c07r9a2m.js} +2 -1
- package/dist/{cli-c41wjx0r.js → cli-fgqxwrpv.js} +291 -12
- package/dist/{cli-01vfmq8c.js → cli-ftfvggzx.js} +607 -164
- package/dist/{cli-ytxs7mn1.js → cli-g8djp6qe.js} +17 -0
- package/dist/{cli-avkd6mqv.js → cli-h967nb6r.js} +551 -0
- package/dist/{cli-r9ee9c4w.js → cli-j55n64b6.js} +23 -22
- package/dist/{cli-9p33cz9h.js → cli-j57qkrpq.js} +86 -28
- package/dist/{cli-tjmghmm5.js → cli-q67y4wzm.js} +6 -3
- package/dist/{cli-n6zq3kbd.js → cli-rj19hc34.js} +1 -1
- package/dist/{cli-jytrw2na.js → cli-rjehvrts.js} +4 -4
- package/dist/{cli-tpv97m71.js → cli-rqz8qbw7.js} +245 -75
- package/dist/{cli-p37sg0a9.js → cli-s8eet254.js} +1 -1
- package/dist/cli-t1ze64h3.js +811 -0
- package/dist/{cli-6jjzxv3b.js → cli-ws6rqycm.js} +3 -2
- package/dist/{cli-xf5b7y1f.js → cli-wscdvcqz.js} +13 -5
- package/dist/{cli-5j7bm4tb.js → cli-x24pshtq.js} +5 -5
- package/dist/{cli-nbp6m6gp.js → cli-xberxa1r.js} +51 -26
- package/dist/{cli-vx9p3qdt.js → cli-xhaeg2nc.js} +1 -1
- package/dist/cli.js +29 -15
- package/dist/{codex-adapter-gns3s6c3.js → codex-adapter-cnm8wk11.js} +5 -5
- package/dist/{codex-session-runner-gqnxys5w.js → codex-session-runner-gfg547zj.js} +5 -5
- package/dist/{commands-hxy2y2sp.js → commands-e3bn0p75.js} +3 -3
- package/dist/{db-w8ghhsgf.js → db-03v9kzr2.js} +17 -3
- package/dist/{dispatcher-cp1rknjz.js → dispatcher-nrmg8yht.js} +14 -14
- package/dist/{dsh-adapter-1dwg97zv.js → dsh-adapter-k03nfqa6.js} +2 -2
- package/dist/{handlers-egfhr351.js → handlers-aqcedbyb.js} +17 -17
- package/dist/{hook-x4kftwzt.js → hook-7vkskkre.js} +19 -11
- package/dist/{hook-fbxjqfjz.js → hook-ybvmrmhq.js} +4 -4
- package/dist/{http-c7jfx990.js → http-2eqa8t24.js} +432 -195
- package/dist/{index-4k9hct21.js → index-1yks3qcr.js} +14 -14
- package/dist/{index-jtvpgb8f.js → index-a3vn96n8.js} +30 -27
- package/dist/{index-dc2ek6bw.js → index-c6zsv1bd.js} +5 -5
- package/dist/{index-yy07ef2s.js → index-chgdkq36.js} +14 -14
- package/dist/{index-r6bty6tb.js → index-x71bvq0p.js} +15 -15
- package/dist/{keepalive-f7ekefyc.js → keepalive-vtkf5n99.js} +5 -5
- package/dist/{lead-h053syts.js → lead-h3sp357x.js} +26 -26
- package/dist/{maintenance-a3w6zs54.js → maintenance-jzeqtk3q.js} +6 -6
- package/dist/{oauth-refresh-sweep-vra1dhkd.js → oauth-refresh-sweep-qp3dzmdp.js} +4 -4
- package/dist/{onboard-mfgzeqxs.js → onboard-tmsp0qbz.js} +278 -81
- package/dist/{opencode-adapter-z64xjzec.js → opencode-adapter-x6x2da1z.js} +3 -3
- package/dist/{otel-impl-2ez6xk57.js → otel-impl-9mz73q65.js} +416 -301
- package/dist/{pi-mono-adapter-2b7mw16r.js → pi-mono-adapter-m6dvv0dz.js} +2 -2
- package/dist/{pricing-refresh-6sw65tck.js → pricing-refresh-v1cbr9te.js} +5 -5
- package/dist/{rbac-roles-nm6924sy.js → rbac-roles-c9wqz83x.js} +4 -4
- package/dist/{render-v2-f026j6c4.js → render-v2-gryrh9h8.js} +4 -4
- package/dist/{setup-w606fr1q.js → setup-q9720bt6.js} +2 -2
- package/dist/{virtual-modules-8qheft18.js → virtual-modules-3htpgn8x.js} +1 -1
- package/dist/{work-objects-ezmggdne.js → work-objects-b76x7deb.js} +17 -17
- package/dist/{worker-1mbyv29k.js → worker-6vrxbv41.js} +26 -26
- package/openapi.json +1626 -629
- package/package.json +2 -1
- package/src/apps/catalog.generated.json +229 -0
- package/src/apps/page-validator.ts +71 -16
- package/src/apps/row-store.ts +66 -11
- package/src/apps/sync.ts +59 -17
- package/src/artifact-sdk/browser-sdk.ts +436 -2
- package/src/be/approval-sweeps.ts +109 -0
- package/src/be/boot-seeds.ts +40 -0
- package/src/be/chunking.ts +1 -1
- package/src/be/db/agents.ts +20 -0
- package/src/be/db/approvals.ts +78 -0
- package/src/be/db/tasks/read.ts +197 -39
- package/src/be/db/tasks/write.ts +41 -9
- package/src/be/db-client.ts +107 -48
- package/src/be/db.ts +219 -76
- package/src/be/events.ts +33 -1
- package/src/be/memory/graph-expansion.ts +10 -3
- package/src/be/memory/providers/sqlite-store.ts +55 -13
- package/src/be/memory/raters/retrieval.ts +5 -2
- package/src/be/memory/reranker.ts +26 -2
- package/src/be/memory/types.ts +2 -0
- package/src/be/migrations/166_approval_request_auto_cancellation.sql +9 -0
- package/src/be/migrations/171_memory_retrieval_relevance.sql +8 -0
- package/src/be/migrations/175_workflow_runs_list_index.sql +11 -0
- package/src/be/migrations/177_events_event_agent_created_index.sql +11 -0
- package/src/be/models-catalog.ts +2 -0
- package/src/be/modelsdev-cache.json +1857 -0
- package/src/be/modelsdev-cache.ts +14 -1
- package/src/be/pricing-normalize.ts +2 -0
- package/src/be/scripts/typecheck.ts +1 -0
- package/src/be/seed-pricing.ts +3 -1
- package/src/be/seed-skills/bundled-files.generated.json +1 -1
- package/src/be/steering.ts +53 -3
- package/src/be/swarm-config-guard.ts +3 -0
- package/src/be/task-citations.ts +29 -0
- package/src/cli.tsx +14 -1
- package/src/commands/onboard/compose-generator.ts +8 -3
- package/src/commands/onboard/container-engine.ts +220 -0
- package/src/commands/onboard/manifest.ts +1 -0
- package/src/commands/onboard/steps/health-check.tsx +4 -1
- package/src/commands/onboard/steps/prereq-check.tsx +50 -54
- package/src/commands/onboard/steps/start.tsx +31 -16
- package/src/commands/onboard/types.ts +7 -2
- package/src/commands/onboard.tsx +39 -4
- package/src/commands/profile-sync.ts +79 -26
- package/src/commands/runner.ts +8 -1
- package/src/extensions/catalog.generated.json +17 -0
- package/src/extensions/contract-types.generated.ts +1 -1
- package/src/heartbeat/heartbeat.ts +263 -103
- package/src/hooks/hook.ts +21 -12
- package/src/http/agents.ts +35 -0
- package/src/http/approval-requests.ts +136 -64
- package/src/http/apps.ts +14 -3
- package/src/http/config.ts +15 -1
- package/src/http/events.ts +62 -2
- package/src/http/index.ts +6 -4
- package/src/http/memory.ts +21 -7
- package/src/http/schedules.ts +1 -1
- package/src/http/session-data.ts +9 -4
- package/src/http/sessions.ts +25 -18
- package/src/http/stats.ts +19 -7
- package/src/http/status.ts +11 -1
- package/src/http/tasks.ts +40 -8
- package/src/http/webhooks.ts +67 -46
- package/src/http/workflows.ts +15 -20
- package/src/linear/outbound.ts +37 -15
- package/src/otel-impl.ts +151 -1
- package/src/otel.ts +14 -3
- package/src/prompts/memories.ts +19 -2
- package/src/providers/claude-managed-models.ts +8 -0
- package/src/providers/modelsdev-reasoning.json +551 -0
- package/src/rbac/legacy-policy.ts +16 -0
- package/src/rbac/permissions.ts +4 -0
- package/src/scheduler/schedule-task.ts +3 -0
- package/src/scripts-runtime/sdk-allowlist.ts +1 -0
- package/src/scripts-runtime/swarm-sdk.ts +9 -0
- package/src/scripts-runtime/types/stdlib.d.ts +1 -0
- package/src/scripts-runtime/types/swarm-extension.d.ts +1 -0
- package/src/scripts-runtime/types/swarm-sdk.d.ts +1 -0
- package/src/server.ts +12 -7
- package/src/slack/app.ts +35 -4
- package/src/slack/connection-state.ts +17 -0
- package/src/tasks/context-key.ts +1 -0
- package/src/tasks/worker-follow-up.ts +6 -2
- package/src/tests/agent-task-activity.test.ts +74 -0
- package/src/tests/agents-list-model-display.test.ts +6 -1
- package/src/tests/approval-auto-cancellation-migration.test.ts +104 -0
- package/src/tests/approval-requests.test.ts +395 -0
- package/src/tests/approval-sweeps-config.test.ts +47 -0
- package/src/tests/approval-sweeps.test.ts +508 -0
- package/src/tests/apps-kibo-blocks.test.ts +77 -0
- package/src/tests/apps-spike.test.ts +56 -1
- package/src/tests/apps-sync-engine.test.ts +20 -9
- package/src/tests/boot-seeds.test.ts +170 -0
- package/src/tests/cancel-approval-request-tool.test.ts +115 -0
- package/src/tests/claude-managed-adapter.test.ts +6 -0
- package/src/tests/config-key-filter.test.ts +80 -0
- package/src/tests/context-window.test.ts +1 -0
- package/src/tests/db-client-busy-retry.test.ts +96 -0
- package/src/tests/db-client.test.ts +60 -1
- package/src/tests/db-task-read-contract.test.ts +10 -0
- package/src/tests/db-task-write-contract.test.ts +9 -0
- package/src/tests/docs-index-footprint.test.js +3 -3
- package/src/tests/events-http.test.ts +103 -0
- package/src/tests/extensions-catalog.test.ts +22 -17
- package/src/tests/extensions-pre-task.test.ts +107 -0
- package/src/tests/fixtures/kibo-blocks-definition.json.txt +105 -0
- package/src/tests/follow-up-config-inheritance.test.ts +260 -0
- package/src/tests/heartbeat-orphan-resume.test.ts +84 -0
- package/src/tests/heartbeat-reboot-live.test.ts +95 -0
- package/src/tests/heartbeat-stall-cas.test.ts +80 -0
- package/src/tests/heartbeat.test.ts +99 -3
- package/src/tests/hook-mcp-config.test.ts +29 -0
- package/src/tests/http-api-integration.test.ts +16 -2
- package/src/tests/kv-storage.test.ts +62 -0
- package/src/tests/linear-outbound-sync.test.ts +120 -5
- package/src/tests/list-endpoint-slimming.test.ts +91 -0
- package/src/tests/memory-graph-organic-route.test.ts +155 -0
- package/src/tests/memory-http-recall-gating.test.ts +14 -4
- package/src/tests/memory-hybrid.test.ts +161 -1
- package/src/tests/memory-prompt-recall-crowdout.test.ts +297 -0
- package/src/tests/memory.test.ts +22 -0
- package/src/tests/onboard-container-engine.test.ts +240 -0
- package/src/tests/otel-event-loop-and-logs.test.ts +99 -0
- package/src/tests/pricing-routes.test.ts +14 -0
- package/src/tests/profile-sync-warning.test.ts +8 -4
- package/src/tests/promote-draft-task-route.test.ts +19 -0
- package/src/tests/provider-registration.test.ts +296 -42
- package/src/tests/rbac-engine.test.ts +30 -0
- package/src/tests/reasoning-effort.test.ts +8 -0
- package/src/tests/script-connections.test.ts +7 -0
- package/src/tests/sdk-allowlist.test.ts +39 -0
- package/src/tests/session-costs-model-key-normalize.test.ts +1 -0
- package/src/tests/sessions-detail-batch.test.ts +250 -0
- package/src/tests/sessions.test.ts +118 -0
- package/src/tests/slack-config.test.ts +22 -0
- package/src/tests/sonnet-5-5-registry.test.ts +44 -0
- package/src/tests/status.test.ts +36 -1
- package/src/tests/swarm-diff.test.ts +316 -10
- package/src/tests/task-completion-idempotency.test.ts +2 -1
- package/src/tests/tasks-requested-by-filter.test.ts +3 -1
- package/src/tests/tool-annotations.test.ts +1 -1
- package/src/tests/ui-list-slim-projections.test.ts +158 -0
- package/src/tests/webhooks-task-blocked.test.ts +127 -0
- package/src/tests/workflow-approval-recovery.test.ts +203 -0
- package/src/tests/workflow-hitl-routing.test.ts +22 -1
- package/src/tests/workflow-hitl-slack-card.test.ts +52 -0
- package/src/tests/workflow-http-v2.test.ts +99 -8
- package/src/tests/workflow-retry-validation.test.ts +56 -0
- package/src/tests/workflow-tla-races.test.ts +389 -0
- package/src/tests/workflow-validation-port-routing.test.ts +113 -1
- package/src/tools/cancel-approval-request.ts +57 -0
- package/src/tools/memory-search.ts +1 -0
- package/src/tools/request-human-input.ts +4 -2
- package/src/tools/send-task.ts +4 -0
- package/src/tools/templates.ts +19 -0
- package/src/tools/tool-config.ts +2 -1
- package/src/tools/workflows/list-workflow-runs.ts +1 -0
- package/src/types.ts +38 -0
- package/src/utils/context-window.ts +1 -0
- package/src/workflows/approval-cancel.ts +152 -0
- package/src/workflows/approval-notifications.ts +84 -0
- package/src/workflows/checkpoint.ts +10 -5
- package/src/workflows/definition.ts +21 -0
- package/src/workflows/engine.ts +152 -21
- package/src/workflows/executors/human-in-the-loop.ts +1 -1
- package/src/workflows/recovery.ts +100 -45
- package/src/workflows/resume.ts +49 -18
- package/src/workflows/retry-poller.ts +71 -21
- package/templates/extensions/README.md +1 -0
- package/templates/extensions/github-sender-allowlist/README.md +18 -0
- package/templates/extensions/github-sender-allowlist/hooks.ts +55 -0
- package/templates/extensions/github-sender-allowlist/manifest.json +8 -0
- package/templates/skills/apps/content.md +20 -1
- package/templates/skills/code-quality/content.md +26 -1
- package/templates/skills/pages/content.md +16 -4
- package/templates/skills/pages/files/examples/multiplayer-board.html +3 -12
- package/dist/cli-2daksqps.js +0 -378
- package/dist/rbac-roles-3gxmnb20.js +0 -37
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
2
|
contentSha256,
|
|
3
3
|
init_profile_sync
|
|
4
|
-
} from "./cli-
|
|
4
|
+
} from "./cli-xberxa1r.js";
|
|
5
5
|
import {
|
|
6
6
|
OpenAI,
|
|
7
7
|
init_openai
|
|
@@ -11,7 +11,7 @@ import {
|
|
|
11
11
|
getDbClient,
|
|
12
12
|
init_db,
|
|
13
13
|
isSqliteVecAvailable
|
|
14
|
-
} from "./cli-
|
|
14
|
+
} from "./cli-47m6dkd3.js";
|
|
15
15
|
import {
|
|
16
16
|
__esm,
|
|
17
17
|
__export,
|
|
@@ -249,9 +249,27 @@ function computeScore(candidate, now) {
|
|
|
249
249
|
}
|
|
250
250
|
function rerank(candidates, options) {
|
|
251
251
|
const { limit, now = new Date } = options;
|
|
252
|
+
const uncapped = new Map;
|
|
253
|
+
for (const candidate of candidates)
|
|
254
|
+
uncapped.set(candidate.id, computeScore(candidate, now));
|
|
255
|
+
const byId = new Map(candidates.map((c) => [c.id, c]));
|
|
256
|
+
const capped = new Map;
|
|
257
|
+
const cappedScore = (candidate, seen) => {
|
|
258
|
+
const cached = capped.get(candidate.id);
|
|
259
|
+
if (cached !== undefined)
|
|
260
|
+
return cached;
|
|
261
|
+
let score = uncapped.get(candidate.id);
|
|
262
|
+
const parent = candidate.graphParentId ? byId.get(candidate.graphParentId) : undefined;
|
|
263
|
+
if (parent && !seen.has(parent.id)) {
|
|
264
|
+
seen.add(candidate.id);
|
|
265
|
+
score = Math.min(score, cappedScore(parent, seen));
|
|
266
|
+
}
|
|
267
|
+
capped.set(candidate.id, score);
|
|
268
|
+
return score;
|
|
269
|
+
};
|
|
252
270
|
const scored = candidates.map((candidate) => {
|
|
253
271
|
const rawSimilarity = candidate.rawSimilarity ?? candidate.similarity;
|
|
254
|
-
const compositeScore =
|
|
272
|
+
const compositeScore = cappedScore(candidate, new Set);
|
|
255
273
|
return {
|
|
256
274
|
...candidate,
|
|
257
275
|
rawSimilarity,
|
|
@@ -259,7 +277,7 @@ function rerank(candidates, options) {
|
|
|
259
277
|
similarity: compositeScore
|
|
260
278
|
};
|
|
261
279
|
});
|
|
262
|
-
scored.sort((a, b) => b.similarity - a.similarity);
|
|
280
|
+
scored.sort((a, b) => b.similarity - a.similarity || b.rawSimilarity - a.rawSimilarity);
|
|
263
281
|
return scored.slice(0, limit);
|
|
264
282
|
}
|
|
265
283
|
var MS_PER_DAY, MS_PER_HOUR;
|
|
@@ -275,6 +293,7 @@ __export(exports_sqlite_store, {
|
|
|
275
293
|
SqliteMemoryStore: () => SqliteMemoryStore,
|
|
276
294
|
applyEditMode: () => applyEditMode,
|
|
277
295
|
computeRrfScore: () => computeRrfScore,
|
|
296
|
+
fusedSimilarity: () => fusedSimilarity,
|
|
278
297
|
rowToCandidate: () => rowToCandidate
|
|
279
298
|
});
|
|
280
299
|
function rowToAgentMemory(row) {
|
|
@@ -325,6 +344,10 @@ function retrievalSourceFor(sources) {
|
|
|
325
344
|
function computeRrfScore(rank, decayFactor, k = 60) {
|
|
326
345
|
return 1 / (k + rank + 1) * decayFactor;
|
|
327
346
|
}
|
|
347
|
+
function fusedSimilarity(cosine, rrfScore, k = 60) {
|
|
348
|
+
const agreement = Math.min(1, rrfScore * (k + 1) / 2);
|
|
349
|
+
return cosine * (0.5 + 0.5 * agreement);
|
|
350
|
+
}
|
|
328
351
|
function applyEditMode(mode, currentContent, fields) {
|
|
329
352
|
if (mode === "replace") {
|
|
330
353
|
if (fields.content == null)
|
|
@@ -648,30 +671,47 @@ class SqliteMemoryStore {
|
|
|
648
671
|
...options,
|
|
649
672
|
limit: overfetchLimit
|
|
650
673
|
});
|
|
651
|
-
if (ftsCandidates.length === 0)
|
|
652
|
-
return vectorCandidates.slice(0, options.limit);
|
|
653
674
|
const byId = new Map;
|
|
654
|
-
const
|
|
675
|
+
const rrf = new Map;
|
|
676
|
+
const cosines = new Map;
|
|
655
677
|
const sources = new Map;
|
|
656
|
-
const now = new Date;
|
|
657
678
|
const add = (candidate, rank) => {
|
|
658
679
|
byId.set(candidate.id, byId.get(candidate.id) ?? candidate);
|
|
659
680
|
const retrievalSource = candidate.retrievalSource === "fts" ? "fts" : "vec";
|
|
660
681
|
const candidateSources = sources.get(candidate.id) ?? new Set;
|
|
661
682
|
candidateSources.add(retrievalSource);
|
|
662
683
|
sources.set(candidate.id, candidateSources);
|
|
663
|
-
|
|
664
|
-
|
|
684
|
+
if (retrievalSource === "vec")
|
|
685
|
+
cosines.set(candidate.id, candidate.similarity);
|
|
686
|
+
rrf.set(candidate.id, (rrf.get(candidate.id) ?? 0) + computeRrfScore(rank, 1));
|
|
665
687
|
};
|
|
666
688
|
vectorCandidates.forEach(add);
|
|
667
689
|
ftsCandidates.forEach(add);
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
690
|
+
await this.fillCosines(queryEmbedding, [...byId.keys()], cosines);
|
|
691
|
+
return [...byId.values()].map((candidate) => {
|
|
692
|
+
const similarity = fusedSimilarity(cosines.get(candidate.id) ?? 0, rrf.get(candidate.id) ?? 0);
|
|
693
|
+
return {
|
|
694
|
+
...candidate,
|
|
695
|
+
rawSimilarity: similarity,
|
|
696
|
+
similarity,
|
|
697
|
+
retrievalSource: retrievalSourceFor(sources.get(candidate.id) ?? new Set),
|
|
698
|
+
recencyDecayApplied: false
|
|
699
|
+
};
|
|
700
|
+
}).sort((a, b) => b.similarity - a.similarity).slice(0, options.limit);
|
|
701
|
+
}
|
|
702
|
+
async fillCosines(queryEmbedding, ids, cosines) {
|
|
703
|
+
const missing = ids.filter((id) => !cosines.has(id));
|
|
704
|
+
if (missing.length === 0)
|
|
705
|
+
return;
|
|
706
|
+
const rows = await getDbClient().query(`SELECT id, embedding FROM agent_memory WHERE id IN (${missing.map(() => "?").join(",")})`, missing);
|
|
707
|
+
for (const row of rows) {
|
|
708
|
+
if (!row.embedding)
|
|
709
|
+
continue;
|
|
710
|
+
const embedding = deserializeEmbedding(row.embedding);
|
|
711
|
+
if (embedding.length !== queryEmbedding.length)
|
|
712
|
+
continue;
|
|
713
|
+
cosines.set(row.id, Math.max(0, cosineSimilarity(queryEmbedding, embedding)));
|
|
714
|
+
}
|
|
675
715
|
}
|
|
676
716
|
async searchFts(queryText, agentId, options) {
|
|
677
717
|
const match = this.buildFtsMatch(queryText);
|
|
@@ -12,7 +12,7 @@ import {
|
|
|
12
12
|
clampContextPercent,
|
|
13
13
|
computeContextUsedUnified,
|
|
14
14
|
getContextWindowSize
|
|
15
|
-
} from "./cli-
|
|
15
|
+
} from "./cli-0xjkj1j7.js";
|
|
16
16
|
import {
|
|
17
17
|
checkToolLoop
|
|
18
18
|
} from "./cli-hp1n6zq3.js";
|
|
@@ -62,6 +62,12 @@ var CLAUDE_MANAGED_MODEL_PRICING = {
|
|
|
62
62
|
cacheReadPerMillion: 1,
|
|
63
63
|
cacheWritePerMillion: 12.5
|
|
64
64
|
},
|
|
65
|
+
"claude-sonnet-5-5": {
|
|
66
|
+
inputPerMillion: 2,
|
|
67
|
+
outputPerMillion: 10,
|
|
68
|
+
cacheReadPerMillion: 0.2,
|
|
69
|
+
cacheWritePerMillion: 2.5
|
|
70
|
+
},
|
|
65
71
|
"claude-sonnet-5": {
|
|
66
72
|
inputPerMillion: 2,
|
|
67
73
|
outputPerMillion: 10,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
runStopHookSessionSummarySubprocess
|
|
3
|
-
} from "./cli-
|
|
3
|
+
} from "./cli-7s3syk22.js";
|
|
4
4
|
import {
|
|
5
5
|
fetchInstalledMcpServers
|
|
6
6
|
} from "./cli-tng3131n.js";
|
|
@@ -16,7 +16,7 @@ import {
|
|
|
16
16
|
clampContextPercent,
|
|
17
17
|
computeContextUsedUnified,
|
|
18
18
|
getContextWindowSize
|
|
19
|
-
} from "./cli-
|
|
19
|
+
} from "./cli-0xjkj1j7.js";
|
|
20
20
|
import {
|
|
21
21
|
isClaudeBridgeEffective,
|
|
22
22
|
resolveClaudeTransport
|
|
@@ -28,7 +28,7 @@ import {
|
|
|
28
28
|
} from "./cli-npssxgaz.js";
|
|
29
29
|
import {
|
|
30
30
|
applyReasoningEffort
|
|
31
|
-
} from "./cli-
|
|
31
|
+
} from "./cli-h967nb6r.js";
|
|
32
32
|
import {
|
|
33
33
|
swarmRuntimeInstanceId
|
|
34
34
|
} from "./cli-re8z5p8p.js";
|
|
@@ -822,7 +822,7 @@ class ClaudeAdapter {
|
|
|
822
822
|
if (transport === "sdk" && isClaudeBridgeEffective(sourceEnv)) {
|
|
823
823
|
throw new Error("CLAUDE_TRANSPORT=sdk cannot run with an effective Claude Bridge configuration. Select CLI transport or disable the bridge.");
|
|
824
824
|
}
|
|
825
|
-
const claudeSdk = transport === "sdk" ? await import("./claude-sdk-session-
|
|
825
|
+
const claudeSdk = transport === "sdk" ? await import("./claude-sdk-session-t442qz6f.js") : undefined;
|
|
826
826
|
claudeSdk?.validateClaudeSdkAdditionalArgs([
|
|
827
827
|
...claudeBinaryArgv.slice(1),
|
|
828
828
|
...config.additionalArgs ?? []
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
2
|
materializeClaudeMd,
|
|
3
3
|
stopClaudeMd
|
|
4
|
-
} from "./cli-
|
|
4
|
+
} from "./cli-rj19hc34.js";
|
|
5
5
|
import {
|
|
6
6
|
summarizeSession
|
|
7
7
|
} from "./cli-cw9zck8j.js";
|
|
@@ -26,7 +26,7 @@ import {
|
|
|
26
26
|
init_profile_sync,
|
|
27
27
|
readIdentityBaselines,
|
|
28
28
|
warnProfileFileTooLarge
|
|
29
|
-
} from "./cli-
|
|
29
|
+
} from "./cli-xberxa1r.js";
|
|
30
30
|
import {
|
|
31
31
|
MAX_PROFILE_FILE_LENGTH,
|
|
32
32
|
getMcpBaseUrl,
|
|
@@ -35,7 +35,7 @@ import {
|
|
|
35
35
|
import {
|
|
36
36
|
init_package,
|
|
37
37
|
package_default
|
|
38
|
-
} from "./cli-
|
|
38
|
+
} from "./cli-c07r9a2m.js";
|
|
39
39
|
import {
|
|
40
40
|
init_secret_scrubber,
|
|
41
41
|
scrubSecrets
|
|
@@ -52,6 +52,20 @@ var IDENTITY_MD_PATH = "/workspace/IDENTITY.md";
|
|
|
52
52
|
var TOOLS_MD_PATH = "/workspace/TOOLS.md";
|
|
53
53
|
var HEARTBEAT_MD_PATH = "/workspace/HEARTBEAT.md";
|
|
54
54
|
var SETUP_SCRIPT_PATH = "/workspace/start-up.sh";
|
|
55
|
+
async function loadHookMcpConfig(projectDir, workspaceDir = "/workspace") {
|
|
56
|
+
for (const configDir of new Set([projectDir, workspaceDir])) {
|
|
57
|
+
try {
|
|
58
|
+
const mcpFile = Bun.file(`${configDir}/.mcp.json`);
|
|
59
|
+
if (!await mcpFile.exists())
|
|
60
|
+
continue;
|
|
61
|
+
const config = await mcpFile.json();
|
|
62
|
+
const serverConfig = config?.mcpServers?.[SERVER_NAME];
|
|
63
|
+
if (serverConfig)
|
|
64
|
+
return serverConfig;
|
|
65
|
+
} catch {}
|
|
66
|
+
}
|
|
67
|
+
return;
|
|
68
|
+
}
|
|
55
69
|
function shouldShowRegistrationNudge(opts) {
|
|
56
70
|
if (opts.agentInfoPresent)
|
|
57
71
|
return false;
|
|
@@ -279,14 +293,7 @@ async function runSessionSummaryFromStdin() {
|
|
|
279
293
|
}
|
|
280
294
|
async function handleHook() {
|
|
281
295
|
const projectDir = process.env.CLAUDE_PROJECT_DIR || process.cwd();
|
|
282
|
-
|
|
283
|
-
try {
|
|
284
|
-
const mcpFile = Bun.file(`${projectDir}/.mcp.json`);
|
|
285
|
-
if (await mcpFile.exists()) {
|
|
286
|
-
const config = await mcpFile.json();
|
|
287
|
-
mcpConfig = config?.mcpServers?.[SERVER_NAME];
|
|
288
|
-
}
|
|
289
|
-
} catch {}
|
|
296
|
+
const mcpConfig = await loadHookMcpConfig(projectDir);
|
|
290
297
|
let msg;
|
|
291
298
|
try {
|
|
292
299
|
msg = await Bun.stdin.json();
|
|
@@ -4,12 +4,12 @@ import {
|
|
|
4
4
|
linkIdentity,
|
|
5
5
|
recordUnmappedIdentity,
|
|
6
6
|
resolveIdentity
|
|
7
|
-
} from "./cli-
|
|
7
|
+
} from "./cli-ftfvggzx.js";
|
|
8
8
|
import {
|
|
9
9
|
getKv,
|
|
10
10
|
init_db,
|
|
11
11
|
upsertKv
|
|
12
|
-
} from "./cli-
|
|
12
|
+
} from "./cli-47m6dkd3.js";
|
|
13
13
|
|
|
14
14
|
// src/slack/enrich.ts
|
|
15
15
|
init_db();
|
|
@@ -4,11 +4,11 @@ import {
|
|
|
4
4
|
getEmbeddingProvider,
|
|
5
5
|
init_embedding,
|
|
6
6
|
serializeEmbedding
|
|
7
|
-
} from "./cli-
|
|
7
|
+
} from "./cli-65hjmev5.js";
|
|
8
8
|
import {
|
|
9
9
|
getDbClient,
|
|
10
10
|
init_db
|
|
11
|
-
} from "./cli-
|
|
11
|
+
} from "./cli-47m6dkd3.js";
|
|
12
12
|
import {
|
|
13
13
|
init_secret_scrubber,
|
|
14
14
|
scrubSecrets
|
|
@@ -1,16 +1,21 @@
|
|
|
1
1
|
import {
|
|
2
2
|
PermissionVerbSchema
|
|
3
|
-
} from "./cli-
|
|
3
|
+
} from "./cli-g8djp6qe.js";
|
|
4
|
+
import {
|
|
5
|
+
seedPricingFromModelsDev
|
|
6
|
+
} from "./cli-wscdvcqz.js";
|
|
4
7
|
import {
|
|
5
8
|
getDb,
|
|
6
9
|
getDbClient,
|
|
7
10
|
init_db
|
|
8
|
-
} from "./cli-
|
|
11
|
+
} from "./cli-47m6dkd3.js";
|
|
9
12
|
import {
|
|
10
|
-
init_env_flag
|
|
11
|
-
isEnvFlagEnabled
|
|
13
|
+
init_env_flag
|
|
12
14
|
} from "./cli-ej6gbxfb.js";
|
|
13
15
|
|
|
16
|
+
// src/be/boot-seeds.ts
|
|
17
|
+
init_db();
|
|
18
|
+
|
|
14
19
|
// src/be/rbac-roles.ts
|
|
15
20
|
init_env_flag();
|
|
16
21
|
init_db();
|
|
@@ -49,23 +54,6 @@ BEGIN
|
|
|
49
54
|
WHERE EXISTS (SELECT 1 FROM roles WHERE id = 'rbac-role-admin');
|
|
50
55
|
END;
|
|
51
56
|
`;
|
|
52
|
-
function roleRowToUserRole(row) {
|
|
53
|
-
return {
|
|
54
|
-
id: row.id,
|
|
55
|
-
name: row.name,
|
|
56
|
-
description: row.description,
|
|
57
|
-
isBuiltin: row.isBuiltin === 1,
|
|
58
|
-
grantsAll: row.grantsAll === 1,
|
|
59
|
-
createdAt: row.createdAt
|
|
60
|
-
};
|
|
61
|
-
}
|
|
62
|
-
async function requireRoleId(roleName) {
|
|
63
|
-
const row = await getDbClient().get("SELECT id FROM roles WHERE name = ?", [roleName]);
|
|
64
|
-
if (!row) {
|
|
65
|
-
throw new Error(`Unknown RBAC role: ${roleName}`);
|
|
66
|
-
}
|
|
67
|
-
return row.id;
|
|
68
|
-
}
|
|
69
57
|
function validateBuiltinVerb(roleName, verb) {
|
|
70
58
|
const parsed = PermissionVerbSchema.safeParse(verb);
|
|
71
59
|
if (!parsed.success) {
|
|
@@ -121,28 +109,6 @@ async function getUserGrant(userId) {
|
|
|
121
109
|
}
|
|
122
110
|
return { grantsAll: false, verbs };
|
|
123
111
|
}
|
|
124
|
-
async function attachRole(userId, roleName) {
|
|
125
|
-
await getDbClient().transaction(async (tx) => {
|
|
126
|
-
const roleId = await requireRoleId(roleName);
|
|
127
|
-
await tx.run(`INSERT OR IGNORE INTO principal_roles (principalType, principalId, roleId)
|
|
128
|
-
VALUES ('user', ?, ?)`, [userId, roleId]);
|
|
129
|
-
});
|
|
130
|
-
}
|
|
131
|
-
async function detachRole(userId, roleName) {
|
|
132
|
-
await getDbClient().transaction(async (tx) => {
|
|
133
|
-
const roleId = await requireRoleId(roleName);
|
|
134
|
-
await tx.run(`DELETE FROM principal_roles
|
|
135
|
-
WHERE principalType = 'user' AND principalId = ? AND roleId = ?`, [userId, roleId]);
|
|
136
|
-
});
|
|
137
|
-
}
|
|
138
|
-
async function listUserRoles(userId) {
|
|
139
|
-
const rows = await getDbClient().query(`SELECT r.id, r.name, r.description, r.isBuiltin, r.grantsAll, r.createdAt
|
|
140
|
-
FROM principal_roles pr
|
|
141
|
-
JOIN roles r ON r.id = pr.roleId
|
|
142
|
-
WHERE pr.principalType = 'user' AND pr.principalId = ?
|
|
143
|
-
ORDER BY r.name`, [userId]);
|
|
144
|
-
return rows.map(roleRowToUserRole);
|
|
145
|
-
}
|
|
146
112
|
function ensureRbacSeedsSynced(opts) {
|
|
147
113
|
const db = getDb();
|
|
148
114
|
const desiredVerbsByRoleId = validatedBuiltinVerbSets();
|
|
@@ -219,56 +185,23 @@ function ensureRbacSeedsSynced(opts) {
|
|
|
219
185
|
}
|
|
220
186
|
return stats;
|
|
221
187
|
}
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
row.grantsAll === 1 ? "yes" : "no",
|
|
233
|
-
String(row.verbCount),
|
|
234
|
-
String(row.attachedUserCount)
|
|
235
|
-
]);
|
|
236
|
-
const headers = ["name", "builtin", "grantsAll", "verbs", "attachedUsers"];
|
|
237
|
-
const widths = headers.map((header, column) => Math.max(header.length, ...tableRows.map((row) => row[column]?.length ?? 0)));
|
|
238
|
-
const format = (row) => row.map((cell, column) => cell.padEnd(widths[column] ?? cell.length)).join(" ");
|
|
239
|
-
console.log("Roles:");
|
|
240
|
-
console.log(format(headers));
|
|
241
|
-
console.log(format(widths.map((width) => "-".repeat(width))));
|
|
242
|
-
for (const row of tableRows) {
|
|
243
|
-
console.log(format(row));
|
|
244
|
-
}
|
|
245
|
-
}
|
|
246
|
-
async function getRbacRoleSummary() {
|
|
247
|
-
return getDbClient().query(`SELECT
|
|
248
|
-
r.name,
|
|
249
|
-
r.isBuiltin,
|
|
250
|
-
r.grantsAll,
|
|
251
|
-
COUNT(DISTINCT rp.verb) AS verbCount,
|
|
252
|
-
COUNT(DISTINCT CASE WHEN pr.principalType = 'user' THEN pr.principalId END)
|
|
253
|
-
AS attachedUserCount
|
|
254
|
-
FROM roles r
|
|
255
|
-
LEFT JOIN role_permissions rp ON rp.roleId = r.id
|
|
256
|
-
LEFT JOIN principal_roles pr ON pr.roleId = r.id
|
|
257
|
-
GROUP BY r.id, r.name, r.isBuiltin, r.grantsAll
|
|
258
|
-
ORDER BY r.isBuiltin DESC, r.name`);
|
|
188
|
+
|
|
189
|
+
// src/be/boot-seeds.ts
|
|
190
|
+
var pricingSeededDbs = new WeakSet;
|
|
191
|
+
var rbacSyncedDbs = new WeakSet;
|
|
192
|
+
function ensurePricingSeeded() {
|
|
193
|
+
const db = getDb();
|
|
194
|
+
if (pricingSeededDbs.has(db))
|
|
195
|
+
return;
|
|
196
|
+
seedPricingFromModelsDev();
|
|
197
|
+
pricingSeededDbs.add(db);
|
|
259
198
|
}
|
|
260
|
-
|
|
261
|
-
const
|
|
262
|
-
if (
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
const roles = await getRbacRoleSummary();
|
|
267
|
-
console.log("RBAC bootstrap complete");
|
|
268
|
-
console.log(`RBAC_ENABLED: ${describeRbacFlag()}`);
|
|
269
|
-
console.log(`Users backfilled this run: ${stats.usersBackfilled}`);
|
|
270
|
-
console.log("");
|
|
271
|
-
printRolesTable(roles);
|
|
199
|
+
function ensureRbacSeeded() {
|
|
200
|
+
const db = getDb();
|
|
201
|
+
if (rbacSyncedDbs.has(db))
|
|
202
|
+
return;
|
|
203
|
+
ensureRbacSeedsSynced();
|
|
204
|
+
rbacSyncedDbs.add(db);
|
|
272
205
|
}
|
|
273
206
|
|
|
274
|
-
export {
|
|
207
|
+
export { getUserGrant, ensurePricingSeeded, ensureRbacSeeded };
|
|
@@ -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.158.0",
|
|
11
11
|
description: "agent-swarm.dev — an open-source operating system for AI work: a lead agent breaks goals into tasks, routes them to specialized workers such as Claude Code or Codex, runs each worker in an isolated container, and preserves shared memory, tools, schedules, and review gates so delegated work compounds across sessions.",
|
|
12
12
|
keywords: [
|
|
13
13
|
"agent-swarm.dev",
|
|
@@ -210,6 +210,7 @@ var init_package = __esm(() => {
|
|
|
210
210
|
"@opencode-ai/sdk": "^1.18.32",
|
|
211
211
|
"@openfort/openfort-node": "^0.9.1",
|
|
212
212
|
"@opentelemetry/api": "^1.9.1",
|
|
213
|
+
"@opentelemetry/api-logs": "^0.218.0",
|
|
213
214
|
"@opentelemetry/exporter-metrics-otlp-http": "^0.218.0",
|
|
214
215
|
"@opentelemetry/exporter-trace-otlp-http": "^0.218.0",
|
|
215
216
|
"@opentelemetry/resources": "^2.7.1",
|