@desplega.ai/agent-swarm 1.93.0 → 1.95.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/openapi.json +180 -1
- package/package.json +4 -3
- package/src/be/db.ts +74 -9
- package/src/be/migrations/090_model_tiers.sql +2 -0
- package/src/be/migrations/091_seed_swarm_operations_metrics.sql +12 -0
- package/src/be/migrations/092_metrics_dashboard_combobox_filters.sql +68 -0
- package/src/be/migrations/093_slack_message_tracking.sql +6 -0
- package/src/be/migrations/094_mcp_extra_authorize_params.sql +4 -0
- package/src/be/migrations/runner.ts +52 -0
- package/src/be/modelsdev-cache.json +2060 -198
- package/src/be/scripts/boot-reembed.ts +74 -0
- package/src/be/scripts/db.ts +19 -3
- package/src/be/seed/index.ts +1 -1
- package/src/be/seed/registry.ts +2 -2
- package/src/be/seed/runner.ts +5 -5
- package/src/be/seed/types.ts +6 -1
- package/src/be/seed-pricing.ts +1 -0
- package/src/be/seed-scripts/index.ts +3 -2
- package/src/be/skill-sync.ts +4 -4
- package/src/be/swarm-config-guard.ts +8 -0
- package/src/commands/provider-credentials.ts +14 -8
- package/src/commands/runner.ts +84 -13
- package/src/http/index.ts +13 -2
- package/src/http/mcp-oauth.ts +14 -0
- package/src/http/metrics.ts +55 -6
- package/src/http/schedules.ts +16 -15
- package/src/http/script-runs.ts +7 -1
- package/src/http/scripts.ts +147 -1
- package/src/http/tasks.ts +7 -0
- package/src/model-tiers.ts +140 -0
- package/src/oauth/mcp-wrapper.ts +14 -0
- package/src/providers/claude-managed-models.ts +9 -0
- package/src/providers/codex-skill-resolver.ts +22 -8
- package/src/providers/opencode-adapter.ts +21 -2
- package/src/providers/pi-mono-adapter.ts +143 -26
- package/src/providers/types.ts +12 -0
- package/src/scheduler/scheduler.ts +22 -34
- package/src/server-user.ts +8 -2
- package/src/slack/responses.ts +39 -11
- package/src/slack/watcher.ts +121 -8
- package/src/tests/agents-list-model-display.test.ts +13 -0
- package/src/tests/aws-error-classifier.test.ts +148 -0
- package/src/tests/claude-managed-adapter.test.ts +12 -0
- package/src/tests/context-window.test.ts +7 -0
- package/src/tests/credential-check.test.ts +185 -46
- package/src/tests/harness-provider-resolution.test.ts +23 -0
- package/src/tests/http-api-integration.test.ts +19 -0
- package/src/tests/mcp-oauth-queries.test.ts +71 -1
- package/src/tests/mcp-oauth-wrapper.test.ts +109 -0
- package/src/tests/metrics-http.test.ts +137 -3
- package/src/tests/migration-046-budgets.test.ts +33 -0
- package/src/tests/migration-runner-regressions.test.ts +69 -0
- package/src/tests/model-control.test.ts +162 -46
- package/src/tests/opencode-adapter.test.ts +38 -1
- package/src/tests/pi-mono-adapter.test.ts +319 -0
- package/src/tests/provider-command-format.test.ts +12 -0
- package/src/tests/providers/pi-cost.test.ts +9 -0
- package/src/tests/runner-fallback-output.test.ts +50 -0
- package/src/tests/scripts-boot-reembed.test.ts +163 -0
- package/src/tests/scripts-embeddings.test.ts +90 -0
- package/src/tests/seed.test.ts +26 -1
- package/src/tests/session-costs-model-key-normalize.test.ts +2 -0
- package/src/tests/skill-fs-writer.test.ts +7 -1
- package/src/tests/skill-sync.test.ts +15 -3
- package/src/tests/slack-watcher.test.ts +66 -0
- package/src/tests/workflow-agent-task.test.ts +5 -2
- package/src/tests/workflow-validation-port-routing.test.ts +181 -0
- package/src/tools/mcp-servers/mcp-server-create.ts +7 -0
- package/src/tools/mcp-servers/mcp-server-update.ts +8 -0
- package/src/tools/memory-get.ts +11 -0
- package/src/tools/memory-search.ts +18 -0
- package/src/tools/schedules/create-schedule.ts +71 -70
- package/src/tools/schedules/update-schedule.ts +43 -31
- package/src/tools/send-task.ts +16 -5
- package/src/tools/task-action.ts +11 -3
- package/src/types.ts +30 -0
- package/src/utils/aws-error-classifier.ts +97 -0
- package/src/utils/context-window.ts +2 -0
- package/src/utils/credentials.test.ts +68 -0
- package/src/utils/credentials.ts +44 -3
- package/src/utils/pretty-print.ts +25 -10
- package/src/utils/skill-fs-writer.ts +11 -3
- package/src/workflows/engine.ts +3 -2
- package/src/workflows/executors/agent-task.ts +3 -1
|
@@ -36,6 +36,56 @@ const BASELINE_TABLES = [
|
|
|
36
36
|
"context_versions",
|
|
37
37
|
];
|
|
38
38
|
|
|
39
|
+
// 090 was renumbered after being applied in production (2026-06-10): PR #722
|
|
40
|
+
// shipped the metrics seed as 090_seed_swarm_operations_metrics; PR #719 then
|
|
41
|
+
// took 090 for model tiers and renumbered the seed to 091. Databases that
|
|
42
|
+
// applied seed-as-090 recorded version 90 with the seed's checksum, so the
|
|
43
|
+
// runner skipped 090_model_tiers forever and task inserts crashed on the
|
|
44
|
+
// missing modelTier column. Detect that exact history and repair it in place:
|
|
45
|
+
// apply the missing ALTERs and repoint row 90 at 090_model_tiers. No-op on
|
|
46
|
+
// fresh databases and on histories where 090_model_tiers applied normally.
|
|
47
|
+
const SEED_APPLIED_AS_090_CHECKSUM =
|
|
48
|
+
"8ca4a05263b42d115b419f468bf5113caa5b7ee4363177568897513549224b01";
|
|
49
|
+
|
|
50
|
+
function repairRenumberedModelTiers(db: Database, migrations: Migration[]): void {
|
|
51
|
+
const modelTiers = migrations.find((m) => m.name === "090_model_tiers");
|
|
52
|
+
if (!modelTiers) return;
|
|
53
|
+
|
|
54
|
+
const row = db
|
|
55
|
+
.prepare<AppliedMigration, []>(
|
|
56
|
+
"SELECT version, name, checksum FROM _migrations WHERE version = 90",
|
|
57
|
+
)
|
|
58
|
+
.get();
|
|
59
|
+
if (
|
|
60
|
+
!row ||
|
|
61
|
+
row.name !== "090_seed_swarm_operations_metrics" ||
|
|
62
|
+
row.checksum !== SEED_APPLIED_AS_090_CHECKSUM
|
|
63
|
+
) {
|
|
64
|
+
return;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
console.warn(
|
|
68
|
+
"[migrations] Repairing renumbered migration 090: applying 090_model_tiers over seed-as-090 history",
|
|
69
|
+
);
|
|
70
|
+
|
|
71
|
+
db.transaction(() => {
|
|
72
|
+
for (const table of ["agent_tasks", "scheduled_tasks"]) {
|
|
73
|
+
const hasColumn = db
|
|
74
|
+
.prepare<{ n: number }, [string]>(
|
|
75
|
+
"SELECT COUNT(*) AS n FROM pragma_table_info(?) WHERE name = 'modelTier'",
|
|
76
|
+
)
|
|
77
|
+
.get(table);
|
|
78
|
+
if (!hasColumn?.n) {
|
|
79
|
+
db.run(`ALTER TABLE ${table} ADD COLUMN modelTier TEXT`);
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
db.run("UPDATE _migrations SET name = ?, checksum = ? WHERE version = 90", [
|
|
83
|
+
modelTiers.name,
|
|
84
|
+
modelTiers.checksum,
|
|
85
|
+
]);
|
|
86
|
+
})();
|
|
87
|
+
}
|
|
88
|
+
|
|
39
89
|
function shouldBootstrapInitialMigration(db: Database): boolean {
|
|
40
90
|
const rows = db
|
|
41
91
|
.prepare<{ name: string }, []>(
|
|
@@ -107,6 +157,8 @@ export function runMigrations(db: Database): void {
|
|
|
107
157
|
return;
|
|
108
158
|
}
|
|
109
159
|
|
|
160
|
+
repairRenumberedModelTiers(db, migrations);
|
|
161
|
+
|
|
110
162
|
// 3. Get applied migrations
|
|
111
163
|
const applied = new Map<number, AppliedMigration>();
|
|
112
164
|
const rows = db
|