opencode-swarm 7.144.8 → 7.145.1
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/background/workspace-snapshot.d.ts +29 -0
- package/dist/cli/{config-doctor-zbqfp0v6.js → config-doctor-96jmxr7s.js} +3 -3
- package/dist/cli/{core-pz9gwatq.js → core-w78pc1hh.js} +3 -3
- package/dist/cli/{curation-policy-a511r0qz.js → curation-policy-smyc2mrm.js} +7 -7
- package/dist/cli/{curator-sk0dyvke.js → curator-59hzdxrv.js} +33 -32
- package/dist/cli/{curator-drift-ckjm272w.js → curator-drift-r50x1rac.js} +4 -4
- package/dist/cli/{curator-llm-factory-3nq3p02z.js → curator-llm-factory-g794pv51.js} +33 -32
- package/dist/cli/dispatch-ndxbsk98.js +1 -1
- package/dist/cli/{evidence-summary-service-abwrjqd0.js → evidence-summary-service-41m0cna6.js} +15 -14
- package/dist/cli/{gate-evidence-aa7vvtcd.js → gate-evidence-7aywx7qa.js} +10 -9
- package/dist/cli/guardrail-explain-j88dhm6w.js +65 -0
- package/dist/cli/{guardrail-log-jw5mzs0d.js → guardrail-log-xcb3ke8s.js} +5 -5
- package/dist/cli/{hive-promoter-m20j63yg.js → hive-promoter-nnnx5692.js} +33 -32
- package/dist/cli/{index-7qb0hn8n.js → index-17e73wac.js} +1 -1
- package/dist/cli/{index-r2rkwvzq.js → index-19v4tccw.js} +2 -2
- package/dist/cli/{index-vdha477y.js → index-2qrd8mfa.js} +1 -1
- package/dist/cli/{index-6z5jtf7d.js → index-34tawmyx.js} +4 -4
- package/dist/cli/{index-jdxnzbah.js → index-41t3hgaa.js} +10 -10
- package/dist/cli/index-4evasm2b.js +514 -0
- package/dist/cli/{index-gfvkttvd.js → index-7axx11dt.js} +1 -1
- package/dist/cli/{index-8dbzaf0m.js → index-8ef23wex.js} +4 -4
- package/dist/cli/{index-k7fk9fjs.js → index-90w06fqr.js} +107 -29
- package/dist/cli/{index-t2ntgzts.js → index-b7ntt9cw.js} +3 -3
- package/dist/cli/{index-c2rpht77.js → index-bst6epnr.js} +2703 -2054
- package/dist/cli/{index-tffg4mwr.js → index-cqfp05jb.js} +3 -3
- package/dist/cli/{index-1jsmmx7y.js → index-dppzthm9.js} +92 -35
- package/dist/cli/{index-h1p08s3n.js → index-dzan8czb.js} +1 -1
- package/dist/cli/{index-cwtpqm5f.js → index-e1pxav9g.js} +1 -1
- package/dist/cli/{index-d1dbpxxk.js → index-evpgszmp.js} +2 -2
- package/dist/cli/{index-cx51wy0c.js → index-ff66fbjt.js} +10 -10
- package/dist/cli/{index-wknz5c8q.js → index-fwnhh6s7.js} +2 -2
- package/dist/cli/{index-hkdgkkhb.js → index-gey2257h.js} +2 -2
- package/dist/cli/{index-f9vvg5xb.js → index-gf03198s.js} +67 -2
- package/dist/cli/{index-z4fssj97.js → index-kxzgnz2h.js} +20 -20
- package/dist/cli/{index-9s8drsf9.js → index-mpf01swm.js} +4 -21
- package/dist/cli/{index-sxe5nyq4.js → index-mrkgxfeh.js} +13 -15
- package/dist/cli/{index-0v1f2sdb.js → index-neh8azwc.js} +2 -2
- package/dist/cli/{index-3k3nbs52.js → index-qpke2x5h.js} +9 -9
- package/dist/cli/{index-n4hwcsbd.js → index-rtkttser.js} +5 -5
- package/dist/cli/{index-xx8tm58n.js → index-sfemjcb8.js} +5 -5
- package/dist/cli/{index-bv44950t.js → index-tm0bezd9.js} +1 -1
- package/dist/cli/{index-r14qx363.js → index-tw8ck794.js} +1 -1
- package/dist/cli/{index-t72g4a7y.js → index-xz4x17z0.js} +35 -34
- package/dist/cli/{index-nmy6rss1.js → index-ymyke19q.js} +1 -1
- package/dist/cli/{index-f36ybbsv.js → index-z9yhhk6q.js} +93 -5
- package/dist/cli/{index-xp5g9eps.js → index-zpp507z0.js} +15 -1
- package/dist/cli/index.js +33 -32
- package/dist/cli/{knowledge-escalator-mg8qb7tm.js → knowledge-escalator-s6acdpwj.js} +15 -14
- package/dist/cli/{knowledge-events-3zxf8xpb.js → knowledge-events-jprkz49t.js} +13 -12
- package/dist/cli/{knowledge-link-4cg4776a.js → knowledge-link-zvtmj756.js} +6 -6
- package/dist/cli/{knowledge-store-awnm8s6c.js → knowledge-store-mc4awds4.js} +7 -7
- package/dist/cli/{knowledge-validator-3ke5scx3.js → knowledge-validator-pe4ncrvj.js} +9 -9
- package/dist/cli/model-preflight-77dwxfv5.js +170 -0
- package/dist/cli/{pending-delegations-9h1jmtw1.js → pending-delegations-epzht3d7.js} +6 -6
- package/dist/cli/{pr-subscriptions-8pg34pev.js → pr-subscriptions-2ahy8g87.js} +6 -6
- package/dist/cli/{runner-cqecp1na.js → runner-ra9pjhp2.js} +8 -7
- package/dist/cli/{scan-cursor-00rbxkb4.js → scan-cursor-hdzhqwzj.js} +8 -8
- package/dist/cli/{schema-5nmkp1pc.js → schema-pg85z06v.js} +1 -1
- package/dist/cli/{scope-persistence-6m79atw9.js → scope-persistence-v8we8ja7.js} +11 -7
- package/dist/cli/{skill-generator-gv70s796.js → skill-generator-ctskfct2.js} +17 -16
- package/dist/cli/{telemetry-cybx6cfz.js → telemetry-c21dgffc.js} +1 -1
- package/dist/cli/{workspace-snapshot-d89zm6wm.js → workspace-snapshot-kznz5e13.js} +3 -1
- package/dist/cli/{worktree-collision-ownership-vy0kxa98.js → worktree-collision-ownership-f7se4wbf.js} +10 -10
- package/dist/cli/{worktree-isolation-bne0p54w.js → worktree-isolation-j4qb7mgb.js} +35 -32
- package/dist/cli/{worktree-provisioning-owner-zzkjycp1.js → worktree-provisioning-owner-72cyddz5.js} +3 -3
- package/dist/commands/close.d.ts +8 -1
- package/dist/config/evidence-schema.d.ts +6 -6
- package/dist/config/plan-schema.d.ts +2 -2
- package/dist/config/schema.d.ts +7 -7
- package/dist/evidence/task-file.d.ts +16 -16
- package/dist/hooks/delegation-gate/worktree-isolation.d.ts +4 -0
- package/dist/index.js +603 -559
- package/dist/memory/schema.d.ts +3 -3
- package/dist/observability/catalog.d.ts +5 -4
- package/dist/observability/envelope.d.ts +2 -2
- package/dist/scope/scope-binding.d.ts +16 -0
- package/dist/services/model-preflight.d.ts +151 -0
- package/dist/services/session-reflection.d.ts +24 -0
- package/dist/services/swarm-residue.d.ts +151 -0
- package/dist/telemetry.d.ts +32 -2
- package/dist/tools/knowledge-receipt.d.ts +1 -1
- package/dist/tools/placeholder-scan.d.ts +64 -0
- package/dist/tools/sast-scan.d.ts +6 -0
- package/dist/utils/atomic-write.d.ts +185 -0
- package/package.json +1 -1
- package/dist/cli/guardrail-explain-hvtyr2fz.js +0 -64
- package/dist/cli/{index-fv0s19g9.js → index-w8pgjr75.js} +3 -3
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import {
|
|
3
|
-
loadDatabaseCtor
|
|
4
|
-
} from "./index-134d35c1.js";
|
|
5
2
|
import {
|
|
6
3
|
EvaluationRunV1Schema,
|
|
7
4
|
GateAuditResultV1Schema,
|
|
8
5
|
getProtectedEvaluationRunIds
|
|
9
|
-
} from "./index-
|
|
6
|
+
} from "./index-fwnhh6s7.js";
|
|
7
|
+
import {
|
|
8
|
+
loadDatabaseCtor
|
|
9
|
+
} from "./index-134d35c1.js";
|
|
10
10
|
import {
|
|
11
11
|
readEffectiveSpecSync
|
|
12
12
|
} from "./index-9ss2m4rs.js";
|
|
@@ -23,7 +23,7 @@ import {
|
|
|
23
23
|
readTaskEvidence,
|
|
24
24
|
readTaskEvidenceRaw,
|
|
25
25
|
sanitizeTaskId
|
|
26
|
-
} from "./index-
|
|
26
|
+
} from "./index-41t3hgaa.js";
|
|
27
27
|
import {
|
|
28
28
|
LedgerStaleWriterError,
|
|
29
29
|
appendLedgerEvent,
|
|
@@ -43,7 +43,7 @@ import {
|
|
|
43
43
|
replayFromLedgerWithStatus,
|
|
44
44
|
takeSnapshotEvent,
|
|
45
45
|
takeSnapshotWithRetry
|
|
46
|
-
} from "./index-
|
|
46
|
+
} from "./index-cqfp05jb.js";
|
|
47
47
|
import {
|
|
48
48
|
init_executor,
|
|
49
49
|
isUntrustedEnvKey,
|
|
@@ -54,13 +54,9 @@ import {
|
|
|
54
54
|
EvidenceBundleSchema,
|
|
55
55
|
EvidenceSchema
|
|
56
56
|
} from "./index-gprxjmm7.js";
|
|
57
|
-
import {
|
|
58
|
-
readSwarmFileAsync,
|
|
59
|
-
validateSwarmPath
|
|
60
|
-
} from "./index-fv0s19g9.js";
|
|
61
57
|
import {
|
|
62
58
|
PlanSchema
|
|
63
|
-
} from "./index-
|
|
59
|
+
} from "./index-17e73wac.js";
|
|
64
60
|
import {
|
|
65
61
|
GIT_BINARY_ENV_VAR,
|
|
66
62
|
describeGitResolution,
|
|
@@ -68,26 +64,30 @@ import {
|
|
|
68
64
|
resolveGitExecutable
|
|
69
65
|
} from "./index-9e6fdz2h.js";
|
|
70
66
|
import {
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
} from "./index-
|
|
67
|
+
readSwarmFileAsync,
|
|
68
|
+
validateSwarmPath
|
|
69
|
+
} from "./index-w8pgjr75.js";
|
|
70
|
+
import {
|
|
71
|
+
bunHash,
|
|
72
|
+
bunWrite,
|
|
73
|
+
mergeEnvForChild
|
|
74
|
+
} from "./index-zj6t9zgx.js";
|
|
74
75
|
import {
|
|
75
76
|
assertProjectRoot,
|
|
76
77
|
tryAcquireLock,
|
|
77
78
|
withEvidenceLock
|
|
78
|
-
} from "./index-
|
|
79
|
+
} from "./index-gf03198s.js";
|
|
79
80
|
import {
|
|
80
81
|
emit
|
|
81
|
-
} from "./index-
|
|
82
|
+
} from "./index-dppzthm9.js";
|
|
82
83
|
import {
|
|
83
84
|
ZodError,
|
|
84
85
|
init_zod
|
|
85
86
|
} from "./index-bpmtbmy9.js";
|
|
86
87
|
import {
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
} from "./index-zj6t9zgx.js";
|
|
88
|
+
invalidateCachedArtifact,
|
|
89
|
+
readCachedParsedFile
|
|
90
|
+
} from "./index-ed5ykebp.js";
|
|
91
91
|
import {
|
|
92
92
|
criticalWarn,
|
|
93
93
|
error,
|
|
@@ -1,16 +1,12 @@
|
|
|
1
1
|
// @bun
|
|
2
2
|
import {
|
|
3
|
-
|
|
4
|
-
} from "./index-
|
|
3
|
+
atomicWriteFileAnyRoot
|
|
4
|
+
} from "./index-4evasm2b.js";
|
|
5
5
|
import {
|
|
6
6
|
withEvidenceLock
|
|
7
|
-
} from "./index-
|
|
8
|
-
import {
|
|
9
|
-
bunWrite
|
|
10
|
-
} from "./index-zj6t9zgx.js";
|
|
7
|
+
} from "./index-gf03198s.js";
|
|
11
8
|
|
|
12
9
|
// src/evidence/task-file.ts
|
|
13
|
-
import { renameSync, unlinkSync } from "fs";
|
|
14
10
|
import * as path from "path";
|
|
15
11
|
function taskEvidenceRelPath(taskId) {
|
|
16
12
|
return path.join("evidence", `${taskId}.json`);
|
|
@@ -18,21 +14,8 @@ function taskEvidenceRelPath(taskId) {
|
|
|
18
14
|
function taskEvidencePath(directory, taskId) {
|
|
19
15
|
return path.join(directory, ".swarm", taskEvidenceRelPath(taskId));
|
|
20
16
|
}
|
|
21
|
-
var _internals = {
|
|
22
|
-
renameSync,
|
|
23
|
-
unlinkSync
|
|
24
|
-
};
|
|
25
17
|
async function atomicWriteFile(targetPath, content) {
|
|
26
|
-
|
|
27
|
-
try {
|
|
28
|
-
await bunWrite(tempPath, content);
|
|
29
|
-
_internals.renameSync(tempPath, targetPath);
|
|
30
|
-
} finally {
|
|
31
|
-
try {
|
|
32
|
-
_internals.unlinkSync(tempPath);
|
|
33
|
-
} catch {}
|
|
34
|
-
}
|
|
35
|
-
invalidateCachedArtifact(targetPath);
|
|
18
|
+
await atomicWriteFileAnyRoot(targetPath, content);
|
|
36
19
|
}
|
|
37
20
|
function withTaskEvidenceLock(directory, taskId, agent, fn) {
|
|
38
21
|
return withEvidenceLock(directory, taskEvidenceRelPath(taskId), agent, taskId, fn);
|
|
@@ -2,18 +2,18 @@
|
|
|
2
2
|
import {
|
|
3
3
|
ALLOWED_SKILL_PATH_PREFIXES,
|
|
4
4
|
validateSkillPath
|
|
5
|
-
} from "./index-
|
|
5
|
+
} from "./index-8ef23wex.js";
|
|
6
6
|
import {
|
|
7
7
|
computeOutcomeSignal,
|
|
8
8
|
readKnowledge,
|
|
9
9
|
resolveHiveKnowledgePath,
|
|
10
10
|
resolveSwarmKnowledgePath,
|
|
11
11
|
transactKnowledge
|
|
12
|
-
} from "./index-
|
|
12
|
+
} from "./index-qpke2x5h.js";
|
|
13
13
|
import {
|
|
14
14
|
effectiveRetrievalOutcomes,
|
|
15
15
|
readAuthoritativeKnowledgeCounterRollups
|
|
16
|
-
} from "./index-
|
|
16
|
+
} from "./index-ff66fbjt.js";
|
|
17
17
|
import {
|
|
18
18
|
advisoryWarn,
|
|
19
19
|
init_warning_buffer
|
|
@@ -22,6 +22,10 @@ import {
|
|
|
22
22
|
init_knowledge_types,
|
|
23
23
|
isActiveStatus
|
|
24
24
|
} from "./index-bk5tah7q.js";
|
|
25
|
+
import {
|
|
26
|
+
atomicWriteFileAnyRoot,
|
|
27
|
+
atomicWriteSwarmFile
|
|
28
|
+
} from "./index-4evasm2b.js";
|
|
25
29
|
import {
|
|
26
30
|
init_logger,
|
|
27
31
|
log,
|
|
@@ -33,7 +37,7 @@ import {
|
|
|
33
37
|
|
|
34
38
|
// src/services/skill-generator.ts
|
|
35
39
|
import { existsSync as existsSync2, unlinkSync } from "fs";
|
|
36
|
-
import { mkdir as mkdir4, readFile as readFile4,
|
|
40
|
+
import { mkdir as mkdir4, readFile as readFile4, unlink, writeFile as writeFile3 } from "fs/promises";
|
|
37
41
|
import * as path4 from "path";
|
|
38
42
|
|
|
39
43
|
// src/config/bundled-skills.ts
|
|
@@ -375,9 +379,7 @@ import {
|
|
|
375
379
|
readdir as readdir2,
|
|
376
380
|
readFile as readFile3,
|
|
377
381
|
realpath,
|
|
378
|
-
|
|
379
|
-
stat as stat2,
|
|
380
|
-
writeFile as writeFile3
|
|
382
|
+
stat as stat2
|
|
381
383
|
} from "fs/promises";
|
|
382
384
|
import * as path3 from "path";
|
|
383
385
|
var SLUG_PATTERN = /^[a-z0-9][a-z0-9-]{0,63}$/;
|
|
@@ -692,9 +694,7 @@ async function evaluateSkillChange(req) {
|
|
|
692
694
|
}
|
|
693
695
|
async function atomicWrite(filePath, content) {
|
|
694
696
|
await mkdir3(path3.dirname(filePath), { recursive: true });
|
|
695
|
-
|
|
696
|
-
await writeFile3(tmp, content, "utf-8");
|
|
697
|
-
await rename2(tmp, filePath);
|
|
697
|
+
await atomicWriteSwarmFile(filePath, content);
|
|
698
698
|
}
|
|
699
699
|
async function appendRejectedSkillEdit(req, evaluation) {
|
|
700
700
|
const filePath = rejectedEditsPath(req.directory);
|
|
@@ -1040,9 +1040,7 @@ function escapeMarkdown(s) {
|
|
|
1040
1040
|
}
|
|
1041
1041
|
async function atomicWrite2(p, content) {
|
|
1042
1042
|
await mkdir4(path4.dirname(p), { recursive: true });
|
|
1043
|
-
|
|
1044
|
-
await writeFile4(tmp, content, "utf-8");
|
|
1045
|
-
await rename3(tmp, p);
|
|
1043
|
+
await atomicWriteFileAnyRoot(p, content);
|
|
1046
1044
|
}
|
|
1047
1045
|
async function generateSkills(req) {
|
|
1048
1046
|
const minConfidence = req.minConfidence ?? DEFAULT_SKILL_MIN_CONFIDENCE;
|
|
@@ -1794,7 +1792,7 @@ async function retireSkill(directory, slug, reason) {
|
|
|
1794
1792
|
reason: reason ?? "manual_retire"
|
|
1795
1793
|
});
|
|
1796
1794
|
await mkdir4(markerDir, { recursive: true });
|
|
1797
|
-
await
|
|
1795
|
+
await writeFile3(markerPath, markerContent, "utf-8");
|
|
1798
1796
|
let clearedLinks = [];
|
|
1799
1797
|
try {
|
|
1800
1798
|
clearedLinks = await clearRetiredSkillLinks(directory, skillPath, cleanSlug);
|
|
@@ -1884,7 +1882,7 @@ async function clearSkillLinks(directory, skillFilePath, slug, mode) {
|
|
|
1884
1882
|
}
|
|
1885
1883
|
async function markSkillStale(skillDir, reason) {
|
|
1886
1884
|
await mkdir4(skillDir, { recursive: true });
|
|
1887
|
-
await
|
|
1885
|
+
await writeFile3(path4.join(skillDir, "stale.marker"), reason, "utf-8");
|
|
1888
1886
|
}
|
|
1889
1887
|
async function clearSkillStale(skillDir) {
|
|
1890
1888
|
const markerPath = path4.join(skillDir, "stale.marker");
|
|
@@ -2,10 +2,10 @@
|
|
|
2
2
|
import {
|
|
3
3
|
init_loader,
|
|
4
4
|
loadPluginConfigWithMeta
|
|
5
|
-
} from "./index-
|
|
5
|
+
} from "./index-17e73wac.js";
|
|
6
6
|
import {
|
|
7
7
|
init_schema
|
|
8
|
-
} from "./index-
|
|
8
|
+
} from "./index-7axx11dt.js";
|
|
9
9
|
import {
|
|
10
10
|
DEFAULT_WORKTREE_ISOLATION_CONFIG,
|
|
11
11
|
init_constants
|
|
@@ -6,13 +6,10 @@ import {
|
|
|
6
6
|
} from "./index-ae75rja9.js";
|
|
7
7
|
import {
|
|
8
8
|
resolveKnowledgeStoreDir
|
|
9
|
-
} from "./index-
|
|
9
|
+
} from "./index-dzan8czb.js";
|
|
10
10
|
import {
|
|
11
11
|
atomicWriteFile
|
|
12
|
-
} from "./index-
|
|
13
|
-
import {
|
|
14
|
-
readCachedParsedFile
|
|
15
|
-
} from "./index-ed5ykebp.js";
|
|
12
|
+
} from "./index-mpf01swm.js";
|
|
16
13
|
import {
|
|
17
14
|
init_knowledge_types,
|
|
18
15
|
isActiveStatus
|
|
@@ -20,6 +17,9 @@ import {
|
|
|
20
17
|
import {
|
|
21
18
|
require_proper_lockfile
|
|
22
19
|
} from "./index-7g4c7s5r.js";
|
|
20
|
+
import {
|
|
21
|
+
readCachedParsedFile
|
|
22
|
+
} from "./index-ed5ykebp.js";
|
|
23
23
|
import {
|
|
24
24
|
init_logger,
|
|
25
25
|
log
|
|
@@ -709,7 +709,7 @@ async function applyConfidenceFloorAction(directory, touched, options) {
|
|
|
709
709
|
const {
|
|
710
710
|
readAuthoritativeKnowledgeCounterRollups,
|
|
711
711
|
effectiveRetrievalOutcomes
|
|
712
|
-
} = await import("./knowledge-events-
|
|
712
|
+
} = await import("./knowledge-events-jprkz49t.js");
|
|
713
713
|
const rollups = await readAuthoritativeKnowledgeCounterRollups(directory);
|
|
714
714
|
const flagIds = new Set;
|
|
715
715
|
for (const e of atFloor) {
|
|
@@ -776,11 +776,11 @@ async function applyConfidenceFloorAction(directory, touched, options) {
|
|
|
776
776
|
});
|
|
777
777
|
}
|
|
778
778
|
if (action === "quarantine" && toQuarantine.length > 0) {
|
|
779
|
-
const { quarantineEntry } = await import("./knowledge-validator-
|
|
780
|
-
const { KnowledgeConfigSchema } = await import("./schema-
|
|
779
|
+
const { quarantineEntry } = await import("./knowledge-validator-pe4ncrvj.js");
|
|
780
|
+
const { KnowledgeConfigSchema } = await import("./schema-pg85z06v.js");
|
|
781
781
|
let config;
|
|
782
782
|
try {
|
|
783
|
-
const { loadPluginConfigWithMeta } = await import("./index-
|
|
783
|
+
const { loadPluginConfigWithMeta } = await import("./index-b7ntt9cw.js");
|
|
784
784
|
const { config: loadedConfig } = loadPluginConfigWithMeta(directory);
|
|
785
785
|
config = KnowledgeConfigSchema.parse(loadedConfig.knowledge ?? {});
|
|
786
786
|
} catch {
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
// @bun
|
|
2
2
|
import {
|
|
3
3
|
validateSwarmPath
|
|
4
|
-
} from "./index-
|
|
4
|
+
} from "./index-w8pgjr75.js";
|
|
5
|
+
import {
|
|
6
|
+
bunWrite
|
|
7
|
+
} from "./index-zj6t9zgx.js";
|
|
5
8
|
import {
|
|
6
9
|
withEvidenceLock
|
|
7
|
-
} from "./index-
|
|
10
|
+
} from "./index-gf03198s.js";
|
|
8
11
|
import {
|
|
9
12
|
exports_external,
|
|
10
13
|
init_zod
|
|
11
14
|
} from "./index-bpmtbmy9.js";
|
|
12
|
-
import {
|
|
13
|
-
bunWrite
|
|
14
|
-
} from "./index-zj6t9zgx.js";
|
|
15
15
|
import {
|
|
16
16
|
init_logger,
|
|
17
17
|
warn
|
|
@@ -6,12 +6,12 @@ import {
|
|
|
6
6
|
resolveSwarmKnowledgePath,
|
|
7
7
|
transactKnowledge,
|
|
8
8
|
wordBigrams
|
|
9
|
-
} from "./index-
|
|
9
|
+
} from "./index-qpke2x5h.js";
|
|
10
10
|
import {
|
|
11
11
|
queryHistoricalOutcomes,
|
|
12
12
|
readKnowledgeEvents,
|
|
13
13
|
recordKnowledgeEvent
|
|
14
|
-
} from "./index-
|
|
14
|
+
} from "./index-ff66fbjt.js";
|
|
15
15
|
import {
|
|
16
16
|
init_knowledge_types,
|
|
17
17
|
isActiveStatus
|
|
@@ -224,11 +224,11 @@ async function maybeQuarantineOnContradiction(directory, entryId, threshold, win
|
|
|
224
224
|
alreadyInactive: true
|
|
225
225
|
};
|
|
226
226
|
}
|
|
227
|
-
const { quarantineEntry } = await import("./knowledge-validator-
|
|
227
|
+
const { quarantineEntry } = await import("./knowledge-validator-pe4ncrvj.js");
|
|
228
228
|
let policyConfig;
|
|
229
229
|
try {
|
|
230
|
-
const { KnowledgeConfigSchema } = await import("./schema-
|
|
231
|
-
const { loadPluginConfigWithMeta } = await import("./index-
|
|
230
|
+
const { KnowledgeConfigSchema } = await import("./schema-pg85z06v.js");
|
|
231
|
+
const { loadPluginConfigWithMeta } = await import("./index-b7ntt9cw.js");
|
|
232
232
|
const { config: loadedConfig } = loadPluginConfigWithMeta(directory);
|
|
233
233
|
policyConfig = KnowledgeConfigSchema.parse(loadedConfig.knowledge ?? {});
|
|
234
234
|
} catch {
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
// @bun
|
|
2
2
|
import {
|
|
3
3
|
handleGuardrailExplain
|
|
4
|
-
} from "./index-
|
|
4
|
+
} from "./index-19v4tccw.js";
|
|
5
5
|
import {
|
|
6
6
|
handleGuardrailLog
|
|
7
|
-
} from "./index-
|
|
7
|
+
} from "./index-tm0bezd9.js";
|
|
8
8
|
import {
|
|
9
9
|
COMMAND_REGISTRY,
|
|
10
10
|
SWARM_COMMAND_TOOL_ALLOWLIST,
|
|
@@ -85,50 +85,48 @@ import {
|
|
|
85
85
|
handleWriteRetroCommand,
|
|
86
86
|
normalizeSwarmCommandInput,
|
|
87
87
|
resolveCommand
|
|
88
|
-
} from "./index-
|
|
89
|
-
import"./index-
|
|
90
|
-
import"./index-
|
|
91
|
-
import"./index-
|
|
88
|
+
} from "./index-bst6epnr.js";
|
|
89
|
+
import"./index-34tawmyx.js";
|
|
90
|
+
import"./index-ymyke19q.js";
|
|
91
|
+
import"./index-tw8ck794.js";
|
|
92
|
+
import"./index-kxzgnz2h.js";
|
|
93
|
+
import"./index-fwnhh6s7.js";
|
|
92
94
|
import"./index-134d35c1.js";
|
|
93
95
|
import"./index-abtrcs16.js";
|
|
94
|
-
import"./index-6z5jtf7d.js";
|
|
95
|
-
import"./index-wknz5c8q.js";
|
|
96
96
|
import"./index-y8552snf.js";
|
|
97
|
-
import"./index-
|
|
97
|
+
import"./index-sfemjcb8.js";
|
|
98
|
+
import"./index-evpgszmp.js";
|
|
98
99
|
import"./index-70ha9e09.js";
|
|
99
100
|
import"./index-c8s9a3zh.js";
|
|
100
101
|
import"./index-9ss2m4rs.js";
|
|
101
|
-
import"./index-
|
|
102
|
-
import"./index-
|
|
103
|
-
import"./index-
|
|
104
|
-
import"./index-
|
|
105
|
-
import"./index-
|
|
106
|
-
import"./index-vdha477y.js";
|
|
102
|
+
import"./index-z9yhhk6q.js";
|
|
103
|
+
import"./index-gey2257h.js";
|
|
104
|
+
import"./index-mrkgxfeh.js";
|
|
105
|
+
import"./index-8ef23wex.js";
|
|
106
|
+
import"./index-2qrd8mfa.js";
|
|
107
107
|
import"./index-rtry5xyf.js";
|
|
108
108
|
import"./index-zsrtt42s.js";
|
|
109
|
-
import"./index-
|
|
110
|
-
import"./index-
|
|
111
|
-
import"./index-
|
|
112
|
-
import"./index-
|
|
113
|
-
import"./index-
|
|
114
|
-
import"./index-
|
|
109
|
+
import"./index-rtkttser.js";
|
|
110
|
+
import"./index-e1pxav9g.js";
|
|
111
|
+
import"./index-41t3hgaa.js";
|
|
112
|
+
import"./index-zpp507z0.js";
|
|
113
|
+
import"./index-90w06fqr.js";
|
|
114
|
+
import"./index-cqfp05jb.js";
|
|
115
115
|
import"./index-556ja8an.js";
|
|
116
116
|
import"./index-7sy3aa9m.js";
|
|
117
117
|
import"./index-wx8zdh4a.js";
|
|
118
118
|
import"./index-3g0xk6tk.js";
|
|
119
119
|
import"./index-85gkedsf.js";
|
|
120
|
-
import"./index-
|
|
121
|
-
import"./index-
|
|
122
|
-
import"./index-
|
|
120
|
+
import"./index-qpke2x5h.js";
|
|
121
|
+
import"./index-ff66fbjt.js";
|
|
122
|
+
import"./index-neh8azwc.js";
|
|
123
123
|
import"./index-gprxjmm7.js";
|
|
124
124
|
import"./index-n832052r.js";
|
|
125
|
-
import"./index-
|
|
126
|
-
import"./index-z6xqpmqg.js";
|
|
127
|
-
import"./index-7qb0hn8n.js";
|
|
125
|
+
import"./index-17e73wac.js";
|
|
128
126
|
import {
|
|
129
127
|
init_schema,
|
|
130
128
|
stripKnownSwarmPrefix
|
|
131
|
-
} from "./index-
|
|
129
|
+
} from "./index-7axx11dt.js";
|
|
132
130
|
import {
|
|
133
131
|
AGENT_TOOL_MAP,
|
|
134
132
|
ORCHESTRATOR_NAME,
|
|
@@ -136,17 +134,20 @@ import {
|
|
|
136
134
|
} from "./index-v3y3qg48.js";
|
|
137
135
|
import"./index-9e6fdz2h.js";
|
|
138
136
|
import"./index-4rhhvd1a.js";
|
|
137
|
+
import"./index-w8pgjr75.js";
|
|
138
|
+
import"./index-z6xqpmqg.js";
|
|
139
|
+
import"./index-zj6t9zgx.js";
|
|
139
140
|
import"./index-zjygnfay.js";
|
|
140
141
|
import"./index-ae75rja9.js";
|
|
141
|
-
import"./index-
|
|
142
|
-
import"./index-
|
|
143
|
-
import"./index-ed5ykebp.js";
|
|
142
|
+
import"./index-dzan8czb.js";
|
|
143
|
+
import"./index-mpf01swm.js";
|
|
144
144
|
import"./index-bk5tah7q.js";
|
|
145
|
-
import"./index-
|
|
146
|
-
import"./index-
|
|
145
|
+
import"./index-4evasm2b.js";
|
|
146
|
+
import"./index-gf03198s.js";
|
|
147
|
+
import"./index-dppzthm9.js";
|
|
147
148
|
import"./index-7g4c7s5r.js";
|
|
148
149
|
import"./index-bpmtbmy9.js";
|
|
149
|
-
import"./index-
|
|
150
|
+
import"./index-ed5ykebp.js";
|
|
150
151
|
import"./index-zgwm4ryv.js";
|
|
151
152
|
import"./index-a76rekgs.js";
|
|
152
153
|
|
|
@@ -870,6 +870,90 @@ function parsePorcelainPaths(output) {
|
|
|
870
870
|
}
|
|
871
871
|
return [...new Set(paths)];
|
|
872
872
|
}
|
|
873
|
+
var SWARM_VISIBLE_CODE_EXTENSIONS = new Set([
|
|
874
|
+
".js",
|
|
875
|
+
".jsx",
|
|
876
|
+
".mjs",
|
|
877
|
+
".cjs",
|
|
878
|
+
".ts",
|
|
879
|
+
".tsx",
|
|
880
|
+
".py",
|
|
881
|
+
".pyw",
|
|
882
|
+
".go",
|
|
883
|
+
".rs",
|
|
884
|
+
".php",
|
|
885
|
+
".pl",
|
|
886
|
+
".java",
|
|
887
|
+
".kt",
|
|
888
|
+
".swift",
|
|
889
|
+
".scala",
|
|
890
|
+
".c",
|
|
891
|
+
".h",
|
|
892
|
+
".cpp",
|
|
893
|
+
".cs",
|
|
894
|
+
".rb",
|
|
895
|
+
".lua",
|
|
896
|
+
".r",
|
|
897
|
+
".sh",
|
|
898
|
+
".bash",
|
|
899
|
+
".zsh",
|
|
900
|
+
".ps1",
|
|
901
|
+
".psm1",
|
|
902
|
+
".bat",
|
|
903
|
+
".cmd",
|
|
904
|
+
".vb",
|
|
905
|
+
".fs"
|
|
906
|
+
]);
|
|
907
|
+
function isSwarmRuntimePath(p) {
|
|
908
|
+
if (p === ".swarm")
|
|
909
|
+
return true;
|
|
910
|
+
if (!p.startsWith(".swarm/"))
|
|
911
|
+
return false;
|
|
912
|
+
const dot = p.lastIndexOf(".");
|
|
913
|
+
const extension = dot === -1 ? "" : p.slice(dot).toLowerCase();
|
|
914
|
+
return !SWARM_VISIBLE_CODE_EXTENSIONS.has(extension);
|
|
915
|
+
}
|
|
916
|
+
function filterSwarmRuntimePorcelain(output) {
|
|
917
|
+
const records = output.split("\x00");
|
|
918
|
+
const kept = [];
|
|
919
|
+
for (let index = 0;index < records.length; index++) {
|
|
920
|
+
const record = records[index];
|
|
921
|
+
if (!record) {
|
|
922
|
+
continue;
|
|
923
|
+
}
|
|
924
|
+
if (record.startsWith("# ")) {
|
|
925
|
+
kept.push(record);
|
|
926
|
+
continue;
|
|
927
|
+
}
|
|
928
|
+
let primaryPath = null;
|
|
929
|
+
if (record.startsWith("? ")) {
|
|
930
|
+
primaryPath = record.slice(2);
|
|
931
|
+
} else if (record.startsWith("1 ")) {
|
|
932
|
+
primaryPath = porcelainV2PathAfterFields(record, 8);
|
|
933
|
+
} else if (record.startsWith("2 ")) {
|
|
934
|
+
primaryPath = porcelainV2PathAfterFields(record, 9);
|
|
935
|
+
} else if (record.startsWith("u ")) {
|
|
936
|
+
primaryPath = porcelainV2PathAfterFields(record, 10);
|
|
937
|
+
}
|
|
938
|
+
if (primaryPath !== null && isSwarmRuntimePath(primaryPath)) {
|
|
939
|
+
if (record.startsWith("2 ")) {
|
|
940
|
+
index += 1;
|
|
941
|
+
}
|
|
942
|
+
continue;
|
|
943
|
+
}
|
|
944
|
+
if (record.startsWith("2 ") && primaryPath !== null) {
|
|
945
|
+
const originalRecord = records[index + 1];
|
|
946
|
+
kept.push(record);
|
|
947
|
+
if (typeof originalRecord === "string" && originalRecord !== "" && isSwarmRuntimePath(originalRecord)) {
|
|
948
|
+
kept.push(primaryPath);
|
|
949
|
+
index += 1;
|
|
950
|
+
}
|
|
951
|
+
continue;
|
|
952
|
+
}
|
|
953
|
+
kept.push(record);
|
|
954
|
+
}
|
|
955
|
+
return kept.join("\x00");
|
|
956
|
+
}
|
|
873
957
|
function parsePorcelainV2Snapshot(output) {
|
|
874
958
|
const records = output.split("\x00");
|
|
875
959
|
const headers = [];
|
|
@@ -967,13 +1051,14 @@ function captureWorkspaceSnapshot(directory, optionsOrScope = null, prHeadShaArg
|
|
|
967
1051
|
})();
|
|
968
1052
|
const resolveCurrentPrHeadSha = typeof optionsOrScope === "object" && optionsOrScope !== null && optionsOrScope.resolveCurrentPrHeadSha === true;
|
|
969
1053
|
const upstreamBefore = resolveCurrentPrHeadSha ? runGit(directory, ["rev-parse", "@{upstream}"]) : null;
|
|
970
|
-
const
|
|
1054
|
+
const porcelainRaw = runGit(directory, [
|
|
971
1055
|
"status",
|
|
972
1056
|
"--porcelain=v2",
|
|
973
1057
|
"--branch",
|
|
974
1058
|
"-z",
|
|
975
1059
|
"--untracked-files=all"
|
|
976
1060
|
]);
|
|
1061
|
+
const porcelain = porcelainRaw === null ? null : filterSwarmRuntimePorcelain(porcelainRaw);
|
|
977
1062
|
const snapshot = porcelain === null ? null : parsePorcelainV2Snapshot(porcelain);
|
|
978
1063
|
const upstreamAfter = resolveCurrentPrHeadSha ? runGit(directory, ["rev-parse", "@{upstream}"]) : null;
|
|
979
1064
|
const prHeadSha = resolveCurrentPrHeadSha ? upstreamBefore && upstreamBefore === upstreamAfter ? upstreamBefore : null : configuredPrHeadSha;
|
|
@@ -994,7 +1079,8 @@ function captureWorkspaceSnapshot(directory, optionsOrScope = null, prHeadShaArg
|
|
|
994
1079
|
function changedFilesSinceSnapshot(directory, baseline) {
|
|
995
1080
|
if (!baseline?.gitHead || baseline.changedFiles == null)
|
|
996
1081
|
return null;
|
|
997
|
-
|
|
1082
|
+
const baselineDirt = baseline.changedFiles.filter((p) => !isSwarmRuntimePath(p));
|
|
1083
|
+
if (baselineDirt.length > 0)
|
|
998
1084
|
return null;
|
|
999
1085
|
const current = captureWorkspaceSnapshot(directory);
|
|
1000
1086
|
if (!current.gitHead || current.changedFiles == null)
|
|
@@ -1010,8 +1096,10 @@ function changedFilesSinceSnapshot(directory, baseline) {
|
|
|
1010
1096
|
]);
|
|
1011
1097
|
if (committed === null)
|
|
1012
1098
|
return null;
|
|
1013
|
-
for (const changedPath of parseNulPaths(committed))
|
|
1014
|
-
|
|
1099
|
+
for (const changedPath of parseNulPaths(committed)) {
|
|
1100
|
+
if (!isSwarmRuntimePath(changedPath))
|
|
1101
|
+
changed.add(changedPath);
|
|
1102
|
+
}
|
|
1015
1103
|
}
|
|
1016
1104
|
return [...changed];
|
|
1017
1105
|
}
|
|
@@ -1062,4 +1150,4 @@ var _internals = {
|
|
|
1062
1150
|
readChangedFileSync: (filePath) => fs.readFileSync(filePath)
|
|
1063
1151
|
};
|
|
1064
1152
|
|
|
1065
|
-
export { readGitTextAtRevision, resolveCurrentGitHead, resolveCurrentGitHeadAsync, resolveExactMergeBase, resolveExactMergeBaseAsync, resolvePrReviewDiffStats, resolvePrReviewDiffStatsAsync, resolveCurrentUpstreamRemoteRef, resolveCurrentUpstreamPushTarget, resolveCurrentUpstreamPushTargetAsync, resolveExactRemoteBranchHead, resolveExactRemoteBranchHeadAsync, resolveGitControlStateDigest, resolveGitControlStateDigestAsync, resolveIsWorkingTreeClean, resolveIsWorkingTreeCleanAsync, resolveCommitCountSince, resolveCommitCountSinceAsync, resolveIsExactSingleChildCommit, resolveIsExactSingleChildCommitAsync, resolveRemoteRefsContainingHead, resolveRemoteRefsContainingHeadAsync, resolvePrFeedbackTrackingCandidatesAsync, switchPrFeedbackTrackingCandidateAsync, resolvePrWorkflowRevisionDigestDetailed, resolvePrWorkflowRevisionDigest, resolvePrWorkflowRevisionDigestDetailedAsync, resolvePrWorkflowRevisionDigestAsync, parsePorcelainPaths, parsePorcelainV2Snapshot, captureWorkspaceSnapshot, changedFilesSinceSnapshot, workspaceSnapshotMatches, compareWorkspaceSnapshot, compareWorkspaceSnapshots, digest, _internals };
|
|
1153
|
+
export { readGitTextAtRevision, resolveCurrentGitHead, resolveCurrentGitHeadAsync, resolveExactMergeBase, resolveExactMergeBaseAsync, resolvePrReviewDiffStats, resolvePrReviewDiffStatsAsync, resolveCurrentUpstreamRemoteRef, resolveCurrentUpstreamPushTarget, resolveCurrentUpstreamPushTargetAsync, resolveExactRemoteBranchHead, resolveExactRemoteBranchHeadAsync, resolveGitControlStateDigest, resolveGitControlStateDigestAsync, resolveIsWorkingTreeClean, resolveIsWorkingTreeCleanAsync, resolveCommitCountSince, resolveCommitCountSinceAsync, resolveIsExactSingleChildCommit, resolveIsExactSingleChildCommitAsync, resolveRemoteRefsContainingHead, resolveRemoteRefsContainingHeadAsync, resolvePrFeedbackTrackingCandidatesAsync, switchPrFeedbackTrackingCandidateAsync, resolvePrWorkflowRevisionDigestDetailed, resolvePrWorkflowRevisionDigest, resolvePrWorkflowRevisionDigestDetailedAsync, resolvePrWorkflowRevisionDigestAsync, parsePorcelainPaths, isSwarmRuntimePath, parsePorcelainV2Snapshot, captureWorkspaceSnapshot, changedFilesSinceSnapshot, workspaceSnapshotMatches, compareWorkspaceSnapshot, compareWorkspaceSnapshots, digest, _internals };
|
|
@@ -92,7 +92,7 @@ var _internals = {
|
|
|
92
92
|
symlinkSync: fs.symlinkSync
|
|
93
93
|
},
|
|
94
94
|
writeScopeToDisk: async (directory, taskId, files) => {
|
|
95
|
-
const { writeScopeToDisk: realWrite } = await import("./scope-persistence-
|
|
95
|
+
const { writeScopeToDisk: realWrite } = await import("./scope-persistence-v8we8ja7.js");
|
|
96
96
|
return realWrite(directory, taskId, files);
|
|
97
97
|
},
|
|
98
98
|
writeLaneProfileToDisk: async (_worktreePath, _laneIndex, _envOverrides) => {
|
|
@@ -139,6 +139,7 @@ async function removeLaneProfileFromDiskReal(worktreePath, laneIndex) {
|
|
|
139
139
|
}
|
|
140
140
|
}
|
|
141
141
|
var WORKTREE_TIMEOUT_MS = 30000;
|
|
142
|
+
var WORKTREE_VERIFICATION_TIMEOUT_MS = 5000;
|
|
142
143
|
var WIN_PATH_BUDGET = 250;
|
|
143
144
|
var GIT_SPAWN_FAILURE_EXIT_CODE = 1;
|
|
144
145
|
async function runGit(args, cwd, timeoutMs = WORKTREE_TIMEOUT_MS) {
|
|
@@ -399,6 +400,19 @@ async function provisionWorktree(directory, id, sessionId, options) {
|
|
|
399
400
|
error: `Failed to create worktree: ${addResult.stderr.trim() || addResult.stdout.trim()}`
|
|
400
401
|
};
|
|
401
402
|
}
|
|
403
|
+
const revParseResult = await runGit(["rev-parse", "--git-dir"], worktreePath, WORKTREE_VERIFICATION_TIMEOUT_MS);
|
|
404
|
+
if (revParseResult.exitCode !== 0) {
|
|
405
|
+
const removeResult = await removeWorktree(worktreePath, directory, {
|
|
406
|
+
force: true,
|
|
407
|
+
worktreeDir: options.worktreeDir
|
|
408
|
+
}).catch((removalError) => ({
|
|
409
|
+
error: removalError instanceof Error ? removalError.message : String(removalError)
|
|
410
|
+
}));
|
|
411
|
+
const removalNote = "error" in removeResult ? `The lane could NOT be removed (${removeResult.error}) \u2014 it may collide with the next provisioning attempt; clear ${worktreePath} manually if retries fail.` : "The lane was removed; retry the dispatch.";
|
|
412
|
+
return {
|
|
413
|
+
error: `WORKTREE_VERIFICATION_FAILED: lane ${worktreePath} did not register as a usable git worktree (git rev-parse --git-dir failed in the lane: ${revParseResult.stderr.trim() || revParseResult.stdout.trim() || `exit ${revParseResult.exitCode}`}). ${removalNote}`
|
|
414
|
+
};
|
|
415
|
+
}
|
|
402
416
|
const strategy = options.depsStrategy ?? "skip";
|
|
403
417
|
if (strategy !== "skip") {
|
|
404
418
|
const hostDepDir = path.join(directory, "node_modules");
|