opencode-swarm 7.164.11 → 7.164.13
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/.opencode/skills/engineering-conventions/SKILL.md +1 -1
- package/.opencode/skills/loop/SKILL.md +1 -1
- package/.opencode/skills/{plan → swarm-plan}/SKILL.md +1 -1
- package/dist/background/pending-delegations.d.ts +7 -2
- package/dist/background/pr-subscriptions.d.ts +3 -3
- package/dist/cli/{coder-settlement-0rfk8y11.js → coder-settlement-em2fgg4p.js} +16 -17
- package/dist/cli/{config-doctor-j17b7qq2.js → config-doctor-1m4mrybp.js} +4 -4
- package/dist/cli/{core-evhjjrtt.js → core-zbzdffha.js} +3 -3
- package/dist/cli/{curation-policy-vj6z5hvr.js → curation-policy-bqpmry2n.js} +5 -6
- package/dist/cli/{curator-drift-ez81vg2t.js → curator-drift-hbc3w5zj.js} +14 -12
- package/dist/cli/curator-llm-factory-j76c96t7.js +70 -0
- package/dist/cli/{curator-vqd5yeck.js → curator-tn3x5j02.js} +49 -47
- package/dist/cli/{dispatch-dqybvj8v.js → dispatch-c7xjt7js.js} +3 -3
- package/dist/cli/{evidence-summary-service-937x7rbg.js → evidence-summary-service-7cn9z4sn.js} +25 -24
- package/dist/cli/{gate-evidence-q1cehr4k.js → gate-evidence-deyzt3hz.js} +10 -11
- package/dist/cli/guardrail-explain-4k2pqj46.js +71 -0
- package/dist/cli/{guardrail-log-3g93f3g2.js → guardrail-log-cnbv6vry.js} +11 -11
- package/dist/cli/{guardrail-reset-qe2r5qzq.js → guardrail-reset-xhh61cax.js} +49 -47
- package/dist/cli/hive-promoter-1m8zpz4d.js +85 -0
- package/dist/cli/{index-rhqdsc1x.js → index-0mwjamha.js} +9 -9
- package/dist/cli/{index-y1yqmkv7.js → index-3c0z1jnc.js} +56 -52
- package/dist/cli/{index-kch6yenm.js → index-4fhcbe14.js} +8 -8
- package/dist/cli/{index-ww6zm5hr.js → index-5ebgzb5a.js} +3 -3
- package/dist/cli/{index-4vb6qa73.js → index-5h60rtaa.js} +37 -3
- package/dist/cli/{index-w3gtqey0.js → index-6chhqq2n.js} +4 -4
- package/dist/cli/index-6m24v15v.js +429 -0
- package/dist/cli/{index-vdn32nws.js → index-6rx1rdaq.js} +3 -3
- package/dist/cli/{index-x43debgx.js → index-74514zkh.js} +15 -17
- package/dist/cli/{index-1ww7wj8d.js → index-7f2r3ysr.js} +41 -17
- package/dist/cli/{index-kc2tgcm7.js → index-7z9zqxqt.js} +4 -4
- package/dist/cli/{index-n8688d12.js → index-8bdk7124.js} +2 -2
- package/dist/cli/{index-3146wmgv.js → index-8d90gzaz.js} +1 -1
- package/dist/cli/{index-b2nj04q6.js → index-9ss2m4rs.js} +1 -434
- package/dist/cli/{index-50j914b5.js → index-a0d4fp6r.js} +29 -7
- package/dist/cli/{index-ggtmsm84.js → index-ajknebrc.js} +1 -1
- package/dist/cli/{index-zjg4chy2.js → index-anxs69ad.js} +2 -2
- package/dist/cli/{index-aqppaaqx.js → index-asey3tb3.js} +6 -4
- package/dist/cli/{index-kv2tdkk5.js → index-bvkd7at6.js} +1 -1
- package/dist/cli/{index-r656jh9j.js → index-c98rjgjq.js} +4301 -2877
- package/dist/cli/{index-r5q5gd2a.js → index-d224mhr9.js} +3 -3
- package/dist/cli/{index-nqsj0g5y.js → index-dh5th4jn.js} +8 -8
- package/dist/cli/index-e45htt92.js +361 -0
- package/dist/cli/{index-w95vxjde.js → index-f36hy1x4.js} +39 -8
- package/dist/cli/{index-hp22pzn5.js → index-f8jdar6q.js} +2 -2
- package/dist/cli/{index-47kh2103.js → index-fnyw5rzg.js} +14 -14
- package/dist/cli/{index-7m32fjb4.js → index-g11h1qpk.js} +9 -9
- package/dist/cli/{index-d9entpn3.js → index-g9weyhq6.js} +4 -4
- package/dist/cli/{index-qbw3yw2d.js → index-grn6tkbt.js} +11 -11
- package/dist/cli/{index-9gxbjkts.js → index-gy0nyfbw.js} +24 -21
- package/dist/cli/{index-5jx22kwc.js → index-hhzzyjm3.js} +544 -15
- package/dist/cli/{index-dsg9dw3b.js → index-j2svfhzk.js} +2 -2
- package/dist/cli/{index-2bgr671r.js → index-jre6tm3v.js} +20 -2
- package/dist/cli/{index-77z98j76.js → index-mpf1tvwf.js} +314 -130
- package/dist/cli/{index-e90em0x4.js → index-ndjjvxzz.js} +12 -17
- package/dist/cli/{index-r3mvsbtq.js → index-p612v1mv.js} +7 -1
- package/dist/cli/{index-zfs3zqeq.js → index-ptsqnxwd.js} +771 -21
- package/dist/cli/{index-ggrp3v00.js → index-qtxevgdx.js} +15 -17
- package/dist/cli/{index-c5v1w13g.js → index-s3k7xbqd.js} +807 -629
- package/dist/cli/{index-pp2nya9v.js → index-tqw8w2n5.js} +2 -4
- package/dist/cli/index-w6988bbc.js +675 -0
- package/dist/cli/{index-4gqxppcx.js → index-xwbn7c8m.js} +2 -2
- package/dist/cli/{index-mmjamc9b.js → index-y5hfk7ya.js} +6 -6
- package/dist/cli/{index-5kcvrpkt.js → index-zb6gdym8.js} +2 -2
- package/dist/cli/index.js +161 -80
- package/dist/cli/{knowledge-escalator-j04g450p.js → knowledge-escalator-3fax9y3s.js} +18 -19
- package/dist/cli/{knowledge-events-53z45rs0.js → knowledge-events-9cpdyhmb.js} +16 -17
- package/dist/cli/{knowledge-link-a6kfg3qm.js → knowledge-link-dgvbqjqg.js} +4 -5
- package/dist/cli/{knowledge-store-whm0gagt.js → knowledge-store-y35rka0p.js} +6 -7
- package/dist/cli/{knowledge-validator-h8m7065g.js → knowledge-validator-fd761gpx.js} +8 -9
- package/dist/cli/{model-preflight-288nsgpw.js → model-preflight-3s1c0zpc.js} +1 -1
- package/dist/cli/{pending-delegations-6hkpe5ze.js → pending-delegations-t3y19j3n.js} +17 -8
- package/dist/cli/{pr-subscriptions-11zca1mh.js → pr-subscriptions-00zp69mt.js} +17 -8
- package/dist/cli/{pr-workflow-gate-6g29rkg7.js → pr-workflow-gate-2h0j8c92.js} +51 -49
- package/dist/cli/{runner-5abw3t35.js → runner-0e3bjeev.js} +6 -7
- package/dist/cli/{scan-cursor-mkfx410t.js → scan-cursor-wppe2gxw.js} +9 -10
- package/dist/cli/{schema-jbbam3ev.js → schema-sec49ppy.js} +2 -2
- package/dist/cli/{scope-persistence-q1ct4k42.js → scope-persistence-59eyqaz4.js} +20 -13
- package/dist/cli/{skill-generator-cv8fg96x.js → skill-generator-56rbmpj7.js} +21 -22
- package/dist/cli/snapshot-coordination-init-dnkdc7gx.js +84 -0
- package/dist/cli/{telemetry-mbqqamsj.js → telemetry-a1yvjerj.js} +1 -1
- package/dist/cli/{workspace-snapshot-eh18vgkn.js → workspace-snapshot-6z9rk7xw.js} +3 -3
- package/dist/cli/{worktree-collision-ownership-xgnn8dsq.js → worktree-collision-ownership-fj9n4mhk.js} +21 -12
- package/dist/cli/{worktree-isolation-k2dgfmeg.js → worktree-isolation-vd1s86ya.js} +49 -47
- package/dist/commands/benchmark.d.ts +5 -1
- package/dist/commands/close.d.ts +13 -6
- package/dist/commands/registry.d.ts +34 -43
- package/dist/commands/reset-session.d.ts +4 -0
- package/dist/commands/turbo.d.ts +1 -1
- package/dist/config/bundled-skills.d.ts +4 -3
- package/dist/config/constants.d.ts +13 -0
- package/dist/db/coordination-store.d.ts +85 -0
- package/dist/db/durability.d.ts +22 -5
- package/dist/db/index.d.ts +1 -0
- package/dist/db/project-db.d.ts +12 -0
- package/dist/hooks/extractors.d.ts +9 -0
- package/dist/hooks/non-architect-advisory.d.ts +18 -0
- package/dist/hooks/repo-graph-injection.d.ts +16 -0
- package/dist/index.js +837 -730
- package/dist/memory/schema.d.ts +3 -3
- package/dist/pr-review/authorization.d.ts +5 -4
- package/dist/pr-review/persistence.d.ts +10 -1
- package/dist/scope/scope-binding.d.ts +10 -0
- package/dist/scope/scope-persistence.d.ts +10 -0
- package/dist/services/decision-drift-analyzer.d.ts +7 -0
- package/dist/services/handoff-service.d.ts +12 -0
- package/dist/services/status-service.d.ts +31 -0
- package/dist/session/snapshot-coordination-init.d.ts +49 -0
- package/dist/session/snapshot-reader.d.ts +2 -0
- package/dist/session/snapshot-store.d.ts +42 -0
- package/dist/session/snapshot-writer.d.ts +4 -1
- package/dist/state.d.ts +14 -3
- package/dist/tools/repo-graph/builder.d.ts +1 -25
- package/dist/tools/repo-graph/cache.d.ts +5 -1
- package/dist/tools/repo-graph/fallback-scanner.d.ts +71 -0
- package/dist/tools/repo-graph/indexed-storage.d.ts +11 -0
- package/dist/tools/repo-graph/storage.d.ts +7 -0
- package/dist/turbo/epic/state.d.ts +4 -20
- package/dist/utils/bun-compat.d.ts +10 -0
- package/dist/utils/context-decisions.d.ts +77 -0
- package/dist/utils/external-tool-runner.d.ts +2 -0
- package/dist/utils/sanitize-display.d.ts +7 -0
- package/package.json +5 -3
- package/dist/cli/curator-llm-factory-sxcpmcqq.js +0 -68
- package/dist/cli/guardrail-explain-xv9aw1bf.js +0 -69
- package/dist/cli/hive-promoter-09yc9mp5.js +0 -83
- package/dist/cli/index-xnb3tk7x.js +0 -24
- package/dist/cli/{ast-diff-ekd9v10f.js → ast-diff-b0esr2kf.js} +3 -3
|
@@ -1,10 +1,4 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import {
|
|
3
|
-
loadDatabaseCtor
|
|
4
|
-
} from "./index-n4fzmqz8.js";
|
|
5
|
-
import {
|
|
6
|
-
canonicalExistingFilesystemPath
|
|
7
|
-
} from "./index-ry16d01s.js";
|
|
8
2
|
import {
|
|
9
3
|
validateSpecContent
|
|
10
4
|
} from "./index-n832052r.js";
|
|
@@ -12,13 +6,6 @@ import {
|
|
|
12
6
|
advisoryWarn,
|
|
13
7
|
init_warning_buffer
|
|
14
8
|
} from "./index-4rhhvd1a.js";
|
|
15
|
-
import {
|
|
16
|
-
canonicalRootKeyFresh,
|
|
17
|
-
lexicalRootAliasKey
|
|
18
|
-
} from "./index-7qefgq4j.js";
|
|
19
|
-
import {
|
|
20
|
-
atomicWriteSwarmFileSync
|
|
21
|
-
} from "./index-9gxbjkts.js";
|
|
22
9
|
|
|
23
10
|
// src/sdd/effective-spec.ts
|
|
24
11
|
import { createHash } from "crypto";
|
|
@@ -704,424 +691,4 @@ function validateSpeckit(directory, options = {}) {
|
|
|
704
691
|
return { resolution, problems };
|
|
705
692
|
}
|
|
706
693
|
|
|
707
|
-
|
|
708
|
-
var DURABILITY_CLASSES = {
|
|
709
|
-
qa_gate_profile: "full",
|
|
710
|
-
qa_gate_profile_identity: "full",
|
|
711
|
-
task_checkpoint_receipt: "full",
|
|
712
|
-
insight_candidate: "normal",
|
|
713
|
-
phase_report: "normal",
|
|
714
|
-
project_constraints: "normal",
|
|
715
|
-
migration_failures: "normal",
|
|
716
|
-
schema_migrations: "normal"
|
|
717
|
-
};
|
|
718
|
-
function batchDurabilityClass(classes) {
|
|
719
|
-
for (const cls of classes) {
|
|
720
|
-
if (cls === "full")
|
|
721
|
-
return "full";
|
|
722
|
-
}
|
|
723
|
-
return "normal";
|
|
724
|
-
}
|
|
725
|
-
function applySynchronousForClass(db, cls) {
|
|
726
|
-
db.run(cls === "full" ? "PRAGMA synchronous = FULL;" : "PRAGMA synchronous = NORMAL;");
|
|
727
|
-
}
|
|
728
|
-
function withDurabilityClass(db, cls, fn) {
|
|
729
|
-
applySynchronousForClass(db, cls);
|
|
730
|
-
try {
|
|
731
|
-
return fn();
|
|
732
|
-
} finally {
|
|
733
|
-
applySynchronousForClass(db, "normal");
|
|
734
|
-
}
|
|
735
|
-
}
|
|
736
|
-
|
|
737
|
-
// src/db/project-db.ts
|
|
738
|
-
import { existsSync as existsSync2, mkdirSync as mkdirSync2, unlinkSync } from "fs";
|
|
739
|
-
import { join as join2 } from "path";
|
|
740
|
-
|
|
741
|
-
// src/db/db-errors.ts
|
|
742
|
-
class ProjectDbError extends Error {
|
|
743
|
-
category;
|
|
744
|
-
constructor(category, message) {
|
|
745
|
-
super(message);
|
|
746
|
-
this.name = "ProjectDbError";
|
|
747
|
-
this.category = category;
|
|
748
|
-
}
|
|
749
|
-
}
|
|
750
|
-
|
|
751
|
-
class DbWriteError extends Error {
|
|
752
|
-
category;
|
|
753
|
-
constructor(category, message) {
|
|
754
|
-
super(message);
|
|
755
|
-
this.name = "DbWriteError";
|
|
756
|
-
this.category = category;
|
|
757
|
-
}
|
|
758
|
-
}
|
|
759
|
-
function classifyDbWriteError(err) {
|
|
760
|
-
const errno = err?.code;
|
|
761
|
-
if (errno === "ENOSPC")
|
|
762
|
-
return "disk_full";
|
|
763
|
-
if (errno === "EACCES" || errno === "EROFS" || errno === "EPERM")
|
|
764
|
-
return "read_only";
|
|
765
|
-
const message = err instanceof Error ? err.message : String(err);
|
|
766
|
-
const upper = message.toUpperCase();
|
|
767
|
-
if (upper.includes("SQLITE_FULL") || upper.includes("DATABASE OR DISK IS FULL")) {
|
|
768
|
-
return "disk_full";
|
|
769
|
-
}
|
|
770
|
-
if (upper.includes("SQLITE_READONLY") || upper.includes("ATTEMPT TO WRITE A READONLY")) {
|
|
771
|
-
return "read_only";
|
|
772
|
-
}
|
|
773
|
-
if (upper.includes("SQLITE_CORRUPT") || upper.includes("DATABASE DISK IMAGE IS MALFORMED") || upper.includes("NOT A DATABASE")) {
|
|
774
|
-
return "corrupt";
|
|
775
|
-
}
|
|
776
|
-
if (upper.includes("SQLITE_BUSY") || upper.includes("DATABASE IS LOCKED")) {
|
|
777
|
-
return "busy";
|
|
778
|
-
}
|
|
779
|
-
return "unknown";
|
|
780
|
-
}
|
|
781
|
-
|
|
782
|
-
// src/db/project-db.ts
|
|
783
|
-
var MIGRATION_FAILURE_ERROR_MAX_CHARS = 500;
|
|
784
|
-
var MIGRATION_FAILURE_MARKER = "db-migration-failure.json";
|
|
785
|
-
var MIGRATIONS = [
|
|
786
|
-
{
|
|
787
|
-
version: 1,
|
|
788
|
-
name: "create_project_constraints",
|
|
789
|
-
sql: `CREATE TABLE project_constraints (
|
|
790
|
-
id INTEGER PRIMARY KEY AUTOINCREMENT,
|
|
791
|
-
constraint_type TEXT NOT NULL,
|
|
792
|
-
content TEXT NOT NULL,
|
|
793
|
-
created_at TEXT NOT NULL DEFAULT (datetime('now'))
|
|
794
|
-
)`
|
|
795
|
-
},
|
|
796
|
-
{
|
|
797
|
-
version: 2,
|
|
798
|
-
name: "create_qa_gate_profile",
|
|
799
|
-
sql: `CREATE TABLE qa_gate_profile (
|
|
800
|
-
id INTEGER PRIMARY KEY AUTOINCREMENT,
|
|
801
|
-
plan_id TEXT NOT NULL UNIQUE,
|
|
802
|
-
created_at TEXT NOT NULL DEFAULT (datetime('now')),
|
|
803
|
-
project_type TEXT,
|
|
804
|
-
gates TEXT NOT NULL DEFAULT '{}',
|
|
805
|
-
locked_at TEXT,
|
|
806
|
-
locked_by_snapshot_seq INTEGER
|
|
807
|
-
)`
|
|
808
|
-
},
|
|
809
|
-
{
|
|
810
|
-
version: 3,
|
|
811
|
-
name: "create_qa_gate_profile_immutability_trigger",
|
|
812
|
-
sql: `CREATE TRIGGER IF NOT EXISTS trg_qa_gate_profile_no_update_after_lock
|
|
813
|
-
BEFORE UPDATE ON qa_gate_profile
|
|
814
|
-
WHEN OLD.locked_at IS NOT NULL
|
|
815
|
-
BEGIN
|
|
816
|
-
SELECT RAISE(ABORT, 'qa_gate_profile row is locked and cannot be modified after critic approval');
|
|
817
|
-
END`
|
|
818
|
-
},
|
|
819
|
-
{
|
|
820
|
-
version: 4,
|
|
821
|
-
name: "add_qa_gate_profile_raw_swarm",
|
|
822
|
-
sql: "ALTER TABLE qa_gate_profile ADD COLUMN raw_swarm TEXT"
|
|
823
|
-
},
|
|
824
|
-
{
|
|
825
|
-
version: 5,
|
|
826
|
-
name: "add_qa_gate_profile_raw_title",
|
|
827
|
-
sql: "ALTER TABLE qa_gate_profile ADD COLUMN raw_title TEXT"
|
|
828
|
-
},
|
|
829
|
-
{
|
|
830
|
-
version: 6,
|
|
831
|
-
name: "add_qa_gate_profile_identity_hash",
|
|
832
|
-
sql: "ALTER TABLE qa_gate_profile ADD COLUMN identity_hash TEXT"
|
|
833
|
-
},
|
|
834
|
-
{
|
|
835
|
-
version: 7,
|
|
836
|
-
name: "create_qa_gate_profile_identity_hash_index",
|
|
837
|
-
sql: `CREATE UNIQUE INDEX IF NOT EXISTS idx_qa_gate_profile_identity_hash
|
|
838
|
-
ON qa_gate_profile(identity_hash)
|
|
839
|
-
WHERE identity_hash IS NOT NULL`
|
|
840
|
-
},
|
|
841
|
-
{
|
|
842
|
-
version: 8,
|
|
843
|
-
name: "create_qa_gate_profile_identity",
|
|
844
|
-
sql: `CREATE TABLE qa_gate_profile_identity (
|
|
845
|
-
identity_hash TEXT PRIMARY KEY,
|
|
846
|
-
profile_id INTEGER NOT NULL UNIQUE REFERENCES qa_gate_profile(id) ON DELETE CASCADE,
|
|
847
|
-
raw_swarm TEXT NOT NULL,
|
|
848
|
-
raw_title TEXT NOT NULL,
|
|
849
|
-
readable_plan_id TEXT NOT NULL
|
|
850
|
-
)`
|
|
851
|
-
},
|
|
852
|
-
{
|
|
853
|
-
version: 9,
|
|
854
|
-
name: "create_qa_gate_profile_identity_readable_plan_index",
|
|
855
|
-
sql: `CREATE INDEX idx_qa_gate_profile_identity_readable_plan_id
|
|
856
|
-
ON qa_gate_profile_identity(readable_plan_id)`
|
|
857
|
-
},
|
|
858
|
-
{
|
|
859
|
-
version: 10,
|
|
860
|
-
name: "backfill_qa_gate_profile_identity_from_legacy_columns",
|
|
861
|
-
sql: `INSERT INTO qa_gate_profile_identity (
|
|
862
|
-
identity_hash,
|
|
863
|
-
profile_id,
|
|
864
|
-
raw_swarm,
|
|
865
|
-
raw_title,
|
|
866
|
-
readable_plan_id
|
|
867
|
-
)
|
|
868
|
-
SELECT
|
|
869
|
-
identity_hash,
|
|
870
|
-
id,
|
|
871
|
-
raw_swarm,
|
|
872
|
-
raw_title,
|
|
873
|
-
plan_id
|
|
874
|
-
FROM qa_gate_profile
|
|
875
|
-
WHERE identity_hash IS NOT NULL
|
|
876
|
-
AND raw_swarm IS NOT NULL
|
|
877
|
-
AND raw_title IS NOT NULL
|
|
878
|
-
AND NOT EXISTS (
|
|
879
|
-
SELECT 1
|
|
880
|
-
FROM qa_gate_profile_identity AS qi
|
|
881
|
-
WHERE qi.profile_id = qa_gate_profile.id
|
|
882
|
-
)`
|
|
883
|
-
},
|
|
884
|
-
{
|
|
885
|
-
version: 11,
|
|
886
|
-
name: "create_task_checkpoint_receipt",
|
|
887
|
-
sql: `CREATE TABLE task_checkpoint_receipt (
|
|
888
|
-
plan_identity_hash TEXT NOT NULL,
|
|
889
|
-
task_id TEXT NOT NULL,
|
|
890
|
-
label TEXT NOT NULL,
|
|
891
|
-
state TEXT NOT NULL CHECK(state IN ('pending', 'committed', 'logged')),
|
|
892
|
-
sha TEXT,
|
|
893
|
-
created_at TEXT NOT NULL DEFAULT (datetime('now')),
|
|
894
|
-
updated_at TEXT NOT NULL DEFAULT (datetime('now')),
|
|
895
|
-
PRIMARY KEY(plan_identity_hash, task_id)
|
|
896
|
-
)`
|
|
897
|
-
},
|
|
898
|
-
{
|
|
899
|
-
version: 12,
|
|
900
|
-
name: "add_task_checkpoint_receipt_completion_generation",
|
|
901
|
-
sql: `ALTER TABLE task_checkpoint_receipt
|
|
902
|
-
ADD COLUMN generation INTEGER NOT NULL DEFAULT 1;
|
|
903
|
-
ALTER TABLE task_checkpoint_receipt
|
|
904
|
-
ADD COLUMN completion_active INTEGER NOT NULL DEFAULT 1
|
|
905
|
-
CHECK(completion_active IN (0, 1))`
|
|
906
|
-
},
|
|
907
|
-
{
|
|
908
|
-
version: 13,
|
|
909
|
-
name: "bind_task_checkpoint_receipt_to_completion_ledger_seq",
|
|
910
|
-
sql: `ALTER TABLE task_checkpoint_receipt
|
|
911
|
-
ADD COLUMN completion_ledger_seq INTEGER
|
|
912
|
-
CHECK(completion_ledger_seq IS NULL OR completion_ledger_seq >= 0)`
|
|
913
|
-
},
|
|
914
|
-
{
|
|
915
|
-
version: 14,
|
|
916
|
-
name: "create_migration_failures",
|
|
917
|
-
sql: `CREATE TABLE IF NOT EXISTS migration_failures (
|
|
918
|
-
id INTEGER PRIMARY KEY AUTOINCREMENT,
|
|
919
|
-
version INTEGER NOT NULL,
|
|
920
|
-
name TEXT NOT NULL,
|
|
921
|
-
error TEXT NOT NULL,
|
|
922
|
-
failed_at TEXT NOT NULL DEFAULT (datetime('now'))
|
|
923
|
-
)`
|
|
924
|
-
},
|
|
925
|
-
{
|
|
926
|
-
version: 15,
|
|
927
|
-
name: "create_insight_candidate_stream",
|
|
928
|
-
sql: `CREATE TABLE IF NOT EXISTS insight_candidate (
|
|
929
|
-
stream_id TEXT NOT NULL,
|
|
930
|
-
version INTEGER NOT NULL,
|
|
931
|
-
payload TEXT NOT NULL,
|
|
932
|
-
created_at TEXT NOT NULL,
|
|
933
|
-
consumed_at TEXT,
|
|
934
|
-
PRIMARY KEY(stream_id, version)
|
|
935
|
-
)`
|
|
936
|
-
},
|
|
937
|
-
{
|
|
938
|
-
version: 16,
|
|
939
|
-
name: "create_insight_candidate_pending_index",
|
|
940
|
-
sql: `CREATE INDEX IF NOT EXISTS idx_insight_candidate_pending
|
|
941
|
-
ON insight_candidate(stream_id, version)
|
|
942
|
-
WHERE consumed_at IS NULL`
|
|
943
|
-
},
|
|
944
|
-
{
|
|
945
|
-
version: 17,
|
|
946
|
-
name: "create_phase_report",
|
|
947
|
-
sql: `CREATE TABLE IF NOT EXISTS phase_report (
|
|
948
|
-
kind TEXT NOT NULL CHECK(kind IN ('curator_drift', 'design_doc_drift')),
|
|
949
|
-
phase INTEGER NOT NULL,
|
|
950
|
-
payload TEXT NOT NULL,
|
|
951
|
-
updated_at TEXT NOT NULL DEFAULT (datetime('now')),
|
|
952
|
-
PRIMARY KEY(kind, phase)
|
|
953
|
-
)`
|
|
954
|
-
}
|
|
955
|
-
];
|
|
956
|
-
var _projectDbs = new Map;
|
|
957
|
-
var _projectDbAliases = new Map;
|
|
958
|
-
var MAX_ALIASES_PER_PROJECT_DB = 128;
|
|
959
|
-
function lexicalAliasKey(directory) {
|
|
960
|
-
return lexicalRootAliasKey(directory);
|
|
961
|
-
}
|
|
962
|
-
function unbindAlias(alias, physicalKey) {
|
|
963
|
-
if (_projectDbAliases.get(alias) === physicalKey) {
|
|
964
|
-
_projectDbAliases.delete(alias);
|
|
965
|
-
}
|
|
966
|
-
_projectDbs.get(physicalKey)?.aliases.delete(alias);
|
|
967
|
-
}
|
|
968
|
-
function bindAlias(record, physicalKey, alias) {
|
|
969
|
-
const previousKey = _projectDbAliases.get(alias);
|
|
970
|
-
if (previousKey !== undefined && previousKey !== physicalKey) {
|
|
971
|
-
unbindAlias(alias, previousKey);
|
|
972
|
-
}
|
|
973
|
-
record.aliases.delete(alias);
|
|
974
|
-
record.aliases.add(alias);
|
|
975
|
-
_projectDbAliases.set(alias, physicalKey);
|
|
976
|
-
while (record.aliases.size > MAX_ALIASES_PER_PROJECT_DB) {
|
|
977
|
-
const evicted = [...record.aliases].find((candidate) => candidate !== record.primaryAlias && candidate !== alias);
|
|
978
|
-
if (evicted === undefined)
|
|
979
|
-
break;
|
|
980
|
-
unbindAlias(evicted, physicalKey);
|
|
981
|
-
}
|
|
982
|
-
}
|
|
983
|
-
function closeRecord(physicalKey, record) {
|
|
984
|
-
record.db.close();
|
|
985
|
-
_projectDbs.delete(physicalKey);
|
|
986
|
-
for (const alias of [...record.aliases])
|
|
987
|
-
unbindAlias(alias, physicalKey);
|
|
988
|
-
}
|
|
989
|
-
function recordMigrationFailure(db, migration, err, markerDir) {
|
|
990
|
-
const errorText = String(err instanceof Error ? err.message : err).slice(0, MIGRATION_FAILURE_ERROR_MAX_CHARS);
|
|
991
|
-
try {
|
|
992
|
-
db.run("INSERT INTO migration_failures (version, name, error) VALUES (?, ?, ?)", [migration.version, migration.name, errorText]);
|
|
993
|
-
return;
|
|
994
|
-
} catch {}
|
|
995
|
-
if (!markerDir)
|
|
996
|
-
return;
|
|
997
|
-
try {
|
|
998
|
-
atomicWriteSwarmFileSync(join2(markerDir, MIGRATION_FAILURE_MARKER), JSON.stringify({
|
|
999
|
-
schema_version: 1,
|
|
1000
|
-
version: migration.version,
|
|
1001
|
-
name: migration.name,
|
|
1002
|
-
error: errorText,
|
|
1003
|
-
failed_at: new Date().toISOString()
|
|
1004
|
-
}, null, 2));
|
|
1005
|
-
} catch {}
|
|
1006
|
-
}
|
|
1007
|
-
function removeMigrationFailureMarker(markerDir) {
|
|
1008
|
-
const marker = join2(markerDir, MIGRATION_FAILURE_MARKER);
|
|
1009
|
-
if (!existsSync2(marker))
|
|
1010
|
-
return;
|
|
1011
|
-
try {
|
|
1012
|
-
unlinkSync(marker);
|
|
1013
|
-
} catch {}
|
|
1014
|
-
}
|
|
1015
|
-
function isConcurrentMigrationApply(err) {
|
|
1016
|
-
const msg = (err instanceof Error ? err.message : String(err)).toLowerCase();
|
|
1017
|
-
if (msg.includes("unique constraint failed: schema_migrations"))
|
|
1018
|
-
return true;
|
|
1019
|
-
return msg.includes("already exists") && (msg.includes("table") || msg.includes("index") || msg.includes("trigger"));
|
|
1020
|
-
}
|
|
1021
|
-
function currentVersionNowCovers(db, version) {
|
|
1022
|
-
const row = db.query("SELECT MAX(version) as version FROM schema_migrations").get();
|
|
1023
|
-
return (row?.version ?? 0) >= version;
|
|
1024
|
-
}
|
|
1025
|
-
function runProjectMigrations(db, markerDir) {
|
|
1026
|
-
db.run(`CREATE TABLE IF NOT EXISTS schema_migrations (
|
|
1027
|
-
version INTEGER PRIMARY KEY,
|
|
1028
|
-
name TEXT NOT NULL,
|
|
1029
|
-
applied_at TEXT NOT NULL DEFAULT (datetime('now'))
|
|
1030
|
-
)`);
|
|
1031
|
-
const row = db.query("SELECT MAX(version) as version FROM schema_migrations").get();
|
|
1032
|
-
const currentVersion = row?.version ?? 0;
|
|
1033
|
-
for (const migration of MIGRATIONS) {
|
|
1034
|
-
if (migration.version <= currentVersion)
|
|
1035
|
-
continue;
|
|
1036
|
-
const apply = db.transaction(() => {
|
|
1037
|
-
db.run(migration.sql);
|
|
1038
|
-
db.run("INSERT INTO schema_migrations (version, name) VALUES (?, ?)", [
|
|
1039
|
-
migration.version,
|
|
1040
|
-
migration.name
|
|
1041
|
-
]);
|
|
1042
|
-
});
|
|
1043
|
-
try {
|
|
1044
|
-
apply();
|
|
1045
|
-
} catch (err) {
|
|
1046
|
-
if (isConcurrentMigrationApply(err) && currentVersionNowCovers(db, migration.version)) {
|
|
1047
|
-
continue;
|
|
1048
|
-
}
|
|
1049
|
-
recordMigrationFailure(db, migration, err, markerDir);
|
|
1050
|
-
throw new ProjectDbError("migration_failed", `swarm.db migration v${migration.version} (${migration.name}) failed: ${err instanceof Error ? err.message : String(err)}`);
|
|
1051
|
-
}
|
|
1052
|
-
}
|
|
1053
|
-
if (markerDir)
|
|
1054
|
-
removeMigrationFailureMarker(markerDir);
|
|
1055
|
-
}
|
|
1056
|
-
function projectDbPath(directory) {
|
|
1057
|
-
return join2(canonicalRootKeyFresh(directory), ".swarm", "swarm.db");
|
|
1058
|
-
}
|
|
1059
|
-
function projectDbExists(directory) {
|
|
1060
|
-
return existsSync2(projectDbPath(directory));
|
|
1061
|
-
}
|
|
1062
|
-
function getProjectDb(directory) {
|
|
1063
|
-
mkdirSync2(directory, { recursive: true });
|
|
1064
|
-
const key = canonicalRootKeyFresh(directory);
|
|
1065
|
-
const alias = lexicalAliasKey(directory);
|
|
1066
|
-
const existing = _projectDbs.get(key);
|
|
1067
|
-
if (existing) {
|
|
1068
|
-
bindAlias(existing, key, alias);
|
|
1069
|
-
return existing.db;
|
|
1070
|
-
}
|
|
1071
|
-
const swarmDir = join2(key, ".swarm");
|
|
1072
|
-
try {
|
|
1073
|
-
mkdirSync2(swarmDir, { recursive: true });
|
|
1074
|
-
} catch (err) {
|
|
1075
|
-
throw new ProjectDbError("mkdir_failed", `Failed to create .swarm/ for project ${key}: ${err instanceof Error ? err.message : String(err)}`);
|
|
1076
|
-
}
|
|
1077
|
-
let db;
|
|
1078
|
-
try {
|
|
1079
|
-
let Db;
|
|
1080
|
-
try {
|
|
1081
|
-
Db = loadDatabaseCtor();
|
|
1082
|
-
} catch (err) {
|
|
1083
|
-
throw new ProjectDbError("driver_unavailable", `Failed to resolve a SQLite driver for project ${key}: ${err instanceof Error ? err.message : String(err)}`);
|
|
1084
|
-
}
|
|
1085
|
-
db = new Db(join2(swarmDir, "swarm.db"));
|
|
1086
|
-
db.run("PRAGMA journal_mode = WAL;");
|
|
1087
|
-
db.run("PRAGMA synchronous = NORMAL;");
|
|
1088
|
-
db.run("PRAGMA busy_timeout = 5000;");
|
|
1089
|
-
db.run("PRAGMA foreign_keys = ON;");
|
|
1090
|
-
runProjectMigrations(db, swarmDir);
|
|
1091
|
-
} catch (err) {
|
|
1092
|
-
if (db) {
|
|
1093
|
-
try {
|
|
1094
|
-
db.close();
|
|
1095
|
-
} catch {}
|
|
1096
|
-
}
|
|
1097
|
-
if (err instanceof ProjectDbError)
|
|
1098
|
-
throw err;
|
|
1099
|
-
throw new ProjectDbError("open_failed", `Failed to open .swarm/swarm.db for project ${key}: ${err instanceof Error ? err.message : String(err)}`);
|
|
1100
|
-
}
|
|
1101
|
-
const record = {
|
|
1102
|
-
db,
|
|
1103
|
-
primaryAlias: alias,
|
|
1104
|
-
aliases: new Set
|
|
1105
|
-
};
|
|
1106
|
-
_projectDbs.set(key, record);
|
|
1107
|
-
bindAlias(record, key, alias);
|
|
1108
|
-
return db;
|
|
1109
|
-
}
|
|
1110
|
-
function closeProjectDb(directory) {
|
|
1111
|
-
const alias = lexicalAliasKey(directory);
|
|
1112
|
-
const currentPath = canonicalExistingFilesystemPath(directory);
|
|
1113
|
-
if (currentPath !== null) {
|
|
1114
|
-
const currentKey = canonicalRootKeyFresh(directory);
|
|
1115
|
-
const currentRecord = _projectDbs.get(currentKey);
|
|
1116
|
-
if (currentRecord)
|
|
1117
|
-
closeRecord(currentKey, currentRecord);
|
|
1118
|
-
return;
|
|
1119
|
-
}
|
|
1120
|
-
const previousKey = _projectDbAliases.get(alias);
|
|
1121
|
-
const previousRecord = previousKey === undefined ? undefined : _projectDbs.get(previousKey);
|
|
1122
|
-
if (previousKey !== undefined && previousRecord) {
|
|
1123
|
-
closeRecord(previousKey, previousRecord);
|
|
1124
|
-
}
|
|
1125
|
-
}
|
|
1126
|
-
|
|
1127
|
-
export { DURABILITY_CLASSES, batchDurabilityClass, applySynchronousForClass, withDurabilityClass, DbWriteError, classifyDbWriteError, projectDbPath, projectDbExists, getProjectDb, closeProjectDb, detectSpeckit, resolveSpeckitProjection, loadSddStatusSync, buildOpenSpecProjectionSync, readEffectiveSpecSync, writeProjectedSpecSync, validateSpeckit };
|
|
694
|
+
export { detectSpeckit, resolveSpeckitProjection, loadSddStatusSync, buildOpenSpecProjectionSync, readEffectiveSpecSync, writeProjectedSpecSync, validateSpeckit };
|
|
@@ -927,13 +927,13 @@ var init_tool_metadata = __esm(() => {
|
|
|
927
927
|
});
|
|
928
928
|
|
|
929
929
|
// src/config/constants.ts
|
|
930
|
-
function freezeSet(items) {
|
|
930
|
+
function freezeSet(items, name = "CLAUDE_CODE_NATIVE_COMMANDS") {
|
|
931
931
|
const set = new Set(items);
|
|
932
932
|
const proxy = new Proxy(set, {
|
|
933
933
|
get(target, prop) {
|
|
934
934
|
if (prop === "add" || prop === "delete" || prop === "clear") {
|
|
935
935
|
return () => {
|
|
936
|
-
throw new TypeError(
|
|
936
|
+
throw new TypeError(`${name} is readonly`);
|
|
937
937
|
};
|
|
938
938
|
}
|
|
939
939
|
if (prop === "forEach") {
|
|
@@ -946,16 +946,16 @@ function freezeSet(items) {
|
|
|
946
946
|
return typeof value === "function" ? value.bind(target) : value;
|
|
947
947
|
},
|
|
948
948
|
set() {
|
|
949
|
-
throw new TypeError(
|
|
949
|
+
throw new TypeError(`${name} is readonly`);
|
|
950
950
|
},
|
|
951
951
|
deleteProperty() {
|
|
952
|
-
throw new TypeError(
|
|
952
|
+
throw new TypeError(`${name} is readonly`);
|
|
953
953
|
},
|
|
954
954
|
defineProperty() {
|
|
955
|
-
throw new TypeError(
|
|
955
|
+
throw new TypeError(`${name} is readonly`);
|
|
956
956
|
},
|
|
957
957
|
setPrototypeOf() {
|
|
958
|
-
throw new TypeError(
|
|
958
|
+
throw new TypeError(`${name} is readonly`);
|
|
959
959
|
}
|
|
960
960
|
});
|
|
961
961
|
return proxy;
|
|
@@ -966,7 +966,7 @@ function isQAAgent(name) {
|
|
|
966
966
|
function isSubagent(name) {
|
|
967
967
|
return ALL_SUBAGENT_NAMES.includes(name);
|
|
968
968
|
}
|
|
969
|
-
var OPENCODE_NATIVE_AGENTS, CLAUDE_CODE_NATIVE_COMMANDS, EXTERNAL_SKILL_TOOL_NAMES, EXTERNAL_SKILL_AGENT_TOOL_MAP, COUNCIL_TOOL_NAMES, COUNCIL_AGENT_TOOL_MAP, GENERAL_COUNCIL_TOOL_NAMES, GENERAL_COUNCIL_AGENT_TOOL_MAP, TURBO_TOOL_NAMES, TURBO_AGENT_TOOL_MAP, SKILL_TOOL_NAMES, SKILL_AGENT_TOOL_MAP, PR_REVIEW_CHILD_TOOL_NAMES, PR_REVIEW_CHILD_AGENT_TOOL_MAP, WRITE_TOOL_NAMES, SUMMARIZER_EXEMPT_TOOL_NAMES, DEFAULT_MODELS, DEFAULT_AGENT_CONFIGS, SWARM_WORKTREE_DIR_NAME = ".swarm-worktrees", DEFAULT_WORKTREE_ISOLATION_CONFIG;
|
|
969
|
+
var OPENCODE_NATIVE_AGENTS, CLAUDE_CODE_NATIVE_COMMANDS, OPENCODE_NATIVE_COMMANDS, EXTERNAL_SKILL_TOOL_NAMES, EXTERNAL_SKILL_AGENT_TOOL_MAP, COUNCIL_TOOL_NAMES, COUNCIL_AGENT_TOOL_MAP, GENERAL_COUNCIL_TOOL_NAMES, GENERAL_COUNCIL_AGENT_TOOL_MAP, TURBO_TOOL_NAMES, TURBO_AGENT_TOOL_MAP, SKILL_TOOL_NAMES, SKILL_AGENT_TOOL_MAP, PR_REVIEW_CHILD_TOOL_NAMES, PR_REVIEW_CHILD_AGENT_TOOL_MAP, WRITE_TOOL_NAMES, SUMMARIZER_EXEMPT_TOOL_NAMES, DEFAULT_MODELS, DEFAULT_AGENT_CONFIGS, SWARM_WORKTREE_DIR_NAME = ".swarm-worktrees", DEFAULT_WORKTREE_ISOLATION_CONFIG;
|
|
970
970
|
var init_constants = __esm(() => {
|
|
971
971
|
init_agent_names();
|
|
972
972
|
init_tool_metadata();
|
|
@@ -1088,6 +1088,28 @@ var init_constants = __esm(() => {
|
|
|
1088
1088
|
"team-onboarding",
|
|
1089
1089
|
"bashes"
|
|
1090
1090
|
]);
|
|
1091
|
+
OPENCODE_NATIVE_COMMANDS = freezeSet([
|
|
1092
|
+
"plan",
|
|
1093
|
+
"new",
|
|
1094
|
+
"share",
|
|
1095
|
+
"clear",
|
|
1096
|
+
"undo",
|
|
1097
|
+
"redo",
|
|
1098
|
+
"compact",
|
|
1099
|
+
"export",
|
|
1100
|
+
"help",
|
|
1101
|
+
"exit",
|
|
1102
|
+
"models",
|
|
1103
|
+
"themes",
|
|
1104
|
+
"edit",
|
|
1105
|
+
"resume",
|
|
1106
|
+
"copy",
|
|
1107
|
+
"log",
|
|
1108
|
+
"messages",
|
|
1109
|
+
"summary",
|
|
1110
|
+
"tree",
|
|
1111
|
+
"session"
|
|
1112
|
+
], "OPENCODE_NATIVE_COMMANDS");
|
|
1091
1113
|
EXTERNAL_SKILL_TOOL_NAMES = [
|
|
1092
1114
|
"external_skill_discover",
|
|
1093
1115
|
"external_skill_list",
|
|
@@ -7,7 +7,7 @@ import {
|
|
|
7
7
|
readLinkPointer,
|
|
8
8
|
resolveKnowledgeStoreDir,
|
|
9
9
|
resolveLinkDir
|
|
10
|
-
} from "./index-
|
|
10
|
+
} from "./index-6rx1rdaq.js";
|
|
11
11
|
|
|
12
12
|
// src/knowledge/curation-policy.ts
|
|
13
13
|
import { appendFile, mkdir as mkdir2, readFile as readFile2 } from "fs/promises";
|
|
@@ -4,10 +4,10 @@ import {
|
|
|
4
4
|
} from "./index-z6xqpmqg.js";
|
|
5
5
|
import {
|
|
6
6
|
bunFile
|
|
7
|
-
} from "./index-
|
|
7
|
+
} from "./index-p612v1mv.js";
|
|
8
8
|
import {
|
|
9
9
|
readCachedTextFile
|
|
10
|
-
} from "./index-
|
|
10
|
+
} from "./index-gy0nyfbw.js";
|
|
11
11
|
import {
|
|
12
12
|
warn
|
|
13
13
|
} from "./index-zgwm4ryv.js";
|
|
@@ -3,7 +3,7 @@ import {
|
|
|
3
3
|
ALL_AGENT_NAMES,
|
|
4
4
|
SUMMARIZER_EXEMPT_TOOL_NAMES,
|
|
5
5
|
init_constants
|
|
6
|
-
} from "./index-
|
|
6
|
+
} from "./index-a0d4fp6r.js";
|
|
7
7
|
import {
|
|
8
8
|
OUTCOME_BLOCK_THRESHOLD,
|
|
9
9
|
init_knowledge_types
|
|
@@ -21,7 +21,7 @@ var package_default;
|
|
|
21
21
|
var init_package = __esm(() => {
|
|
22
22
|
package_default = {
|
|
23
23
|
name: "opencode-swarm",
|
|
24
|
-
version: "7.164.
|
|
24
|
+
version: "7.164.13",
|
|
25
25
|
description: "Architect-centric agentic swarm plugin for OpenCode - hub-and-spoke orchestration with SME consultation, code generation, and QA review",
|
|
26
26
|
main: "dist/index.js",
|
|
27
27
|
types: "dist/index.d.ts",
|
|
@@ -84,7 +84,7 @@ var init_package = __esm(() => {
|
|
|
84
84
|
".opencode/skills/swarm-pr-subscribe",
|
|
85
85
|
".opencode/skills/swarm-ci-monitor",
|
|
86
86
|
".opencode/skills/issue-ingest",
|
|
87
|
-
".opencode/skills/plan",
|
|
87
|
+
".opencode/skills/swarm-plan",
|
|
88
88
|
".opencode/skills/critic-gate",
|
|
89
89
|
".opencode/skills/execute",
|
|
90
90
|
".opencode/skills/phase-wrap",
|
|
@@ -119,7 +119,9 @@ var init_package = __esm(() => {
|
|
|
119
119
|
"lint:ci": "biome ci .",
|
|
120
120
|
"test:unit:ci": "bun scripts/ci/run-unit-tests-local.ts",
|
|
121
121
|
"drift:check": "bun run scripts/drift-check.ts",
|
|
122
|
+
"check:pre-push": "bun run scripts/drift-check.ts --enforce --no-report && bun run check:registry-citations",
|
|
122
123
|
"schema:generate": "bun run scripts/generate-config-schema.ts",
|
|
124
|
+
"generate:commands-docs": "bun run scripts/generate-commands-docs.ts",
|
|
123
125
|
"check:runtime-src-refs": "bun run scripts/check-runtime-src-refs.ts",
|
|
124
126
|
"drift:fix": "bun run scripts/drift-check.ts --fix --confirm",
|
|
125
127
|
"skills:sync": "bun run scripts/sync-qa-gate-skills.ts",
|
|
@@ -162,7 +164,7 @@ var init_package = __esm(() => {
|
|
|
162
164
|
"proper-lockfile": "^4.1.2",
|
|
163
165
|
"quick-lru": "^7.3.0",
|
|
164
166
|
"web-tree-sitter": "^0.25.0",
|
|
165
|
-
zod: "
|
|
167
|
+
zod: "4.3.6"
|
|
166
168
|
},
|
|
167
169
|
devDependencies: {
|
|
168
170
|
"@biomejs/biome": "2.3.14",
|