opencode-swarm 7.123.0 → 7.125.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/.opencode/skills/critic-gate/SKILL.md +8 -0
- package/.opencode/skills/swarm/SKILL.md +12 -8
- package/.opencode/skills/swarm-pr-feedback/SKILL.md +252 -62
- package/.opencode/skills/swarm-pr-review/SKILL.md +242 -76
- package/README.md +6 -1
- package/dist/background/lane-output-store.d.ts +10 -0
- package/dist/background/pending-delegations.d.ts +3 -0
- package/dist/background/workspace-snapshot.d.ts +59 -0
- package/dist/cli/{config-doctor-3ksh1534.js → config-doctor-be9sxqx8.js} +6 -6
- package/dist/cli/{core-cwgb7ev8.js → core-d38hc85b.js} +4 -4
- package/dist/cli/{curation-policy-4j4qce5a.js → curation-policy-52kt6d7t.js} +2 -2
- package/dist/cli/{curator-drift-6b2fjsgr.js → curator-drift-h9a2sjvf.js} +7 -7
- package/dist/cli/{curator-tkyn9bzz.js → curator-hbst8nbc.js} +32 -30
- package/dist/cli/curator-llm-factory-frde1955.js +54 -0
- package/dist/cli/{dispatch-07jgc3hn.js → dispatch-f4hj1cj7.js} +3 -3
- package/dist/cli/{evidence-summary-service-96ndczbk.js → evidence-summary-service-9hq7n9k9.js} +12 -12
- package/dist/cli/{gate-evidence-xqks3kk2.js → gate-evidence-cy2te3x8.js} +2 -2
- package/dist/cli/guardrail-explain-112kqmbc.js +55 -0
- package/dist/cli/guardrail-log-c8zcab91.js +16 -0
- package/dist/cli/hive-promoter-448xs2tp.js +69 -0
- package/dist/cli/{index-hns7xjm7.js → index-09vd53pz.js} +4 -2
- package/dist/cli/{pending-delegations-68cbaqv2.js → index-0cz1ws47.js} +9 -21
- package/dist/cli/{index-det5jwfk.js → index-0y6tmm9v.js} +5 -1
- package/dist/cli/index-134d35c1.js +116 -0
- package/dist/cli/{index-m1abzg93.js → index-1kz6da87.js} +4 -2
- package/dist/cli/{index-22e127jw.js → index-23zsx7dm.js} +5 -3
- package/dist/cli/{index-kzj3fp7c.js → index-2445sx3d.js} +1 -1
- package/dist/cli/{index-ctpgsj84.js → index-2tn5h2zp.js} +1 -1
- package/dist/cli/{index-6xnxz6z0.js → index-3x761jqv.js} +4 -2
- package/dist/cli/{index-7cspygmb.js → index-4rzzzjtg.js} +11 -8
- package/dist/cli/{index-cqsak7bf.js → index-67hqr2zv.js} +1 -1
- package/dist/cli/{index-nprawcc0.js → index-6n2jpz7x.js} +1 -1
- package/dist/cli/{index-19zn67q6.js → index-6vfvc36k.js} +5 -1
- package/dist/cli/{index-6sgqnvpw.js → index-7j3sm7h8.js} +2 -2
- package/dist/cli/{index-2j25br0p.js → index-958hf0yr.js} +9 -9
- package/dist/cli/{index-j9kxwshw.js → index-99ed0h32.js} +8 -6
- package/dist/cli/{index-7g91saha.js → index-9hbwa5x1.js} +40 -32
- package/dist/cli/{index-jyrhy4ww.js → index-amspa811.js} +3179 -1557
- package/dist/cli/index-bk5tah7q.js +19 -0
- package/dist/cli/{index-293f68mj.js → index-bpmtbmy9.js} +4680 -4342
- package/dist/cli/{index-m0bmh3w0.js → index-dx2c2wjt.js} +2 -2
- package/dist/cli/{index-ye3fndsw.js → index-gacm5s2n.js} +9 -5
- package/dist/cli/{index-d6h5hq91.js → index-gnvg72y1.js} +2 -2
- package/dist/cli/{index-17eybc3z.js → index-jh6s75f6.js} +1 -1
- package/dist/cli/{index-vcgfqd8f.js → index-k5jrywpr.js} +4 -2
- package/dist/cli/{index-3rr0ese8.js → index-kt0awv1n.js} +41 -9
- package/dist/cli/index-mg54y5gc.js +564 -0
- package/dist/cli/{index-dywekeen.js → index-n6chz2g8.js} +1 -1
- package/dist/cli/{index-gnp9x6se.js → index-n832052r.js} +4 -2
- package/dist/cli/{index-816rkp4y.js → index-s9mj4rb9.js} +5 -3
- package/dist/cli/{index-gw3m5fw0.js → index-v2rdhwx8.js} +5 -3
- package/dist/cli/{index-q00e4s1s.js → index-vtwqjr4z.js} +11 -7
- package/dist/cli/index-xattnmyb.js +2502 -0
- package/dist/cli/{index-n2712byd.js → index-yt1v62pv.js} +8 -5
- package/dist/cli/{index-5e4e2hvv.js → index-z6xqpmqg.js} +4 -0
- package/dist/cli/{index-p0arc26j.js → index-zjygnfay.js} +7 -2
- package/dist/cli/index.js +35 -31
- package/dist/cli/{knowledge-escalator-dyxsm78k.js → knowledge-escalator-htafbhxg.js} +4 -4
- package/dist/cli/{knowledge-events-36q6nvae.js → knowledge-events-havw8c4t.js} +1 -1
- package/dist/cli/{knowledge-store-e07b4s54.js → knowledge-store-hqngpt2v.js} +2 -2
- package/dist/cli/{knowledge-validator-sfyf7wn2.js → knowledge-validator-g7mpnazh.js} +5 -5
- package/dist/cli/pending-delegations-7j8xqg5f.js +34 -0
- package/dist/cli/{pr-subscriptions-x653151h.js → pr-subscriptions-bxpqde8w.js} +5 -5
- package/dist/cli/{scan-cursor-hm0aqqae.js → scan-cursor-sx7cvh8v.js} +3 -3
- package/dist/cli/{schema-13bnng2n.js → schema-2418eqy3.js} +7 -4
- package/dist/cli/{scope-persistence-d9erwnvb.js → scope-persistence-habn4q8a.js} +4 -4
- package/dist/cli/{skill-generator-63r20a9k.js → skill-generator-zggy797r.js} +7 -7
- package/dist/cli/sqlite-loader-r1kgt2pq.js +12 -0
- package/dist/cli/workspace-snapshot-c9pxxt9a.js +48 -0
- package/dist/commands/memory-link.d.ts +28 -0
- package/dist/commands/registry.d.ts +26 -1
- package/dist/config/schema.d.ts +6 -0
- package/dist/hooks/pr-workflow-gate.d.ts +211 -0
- package/dist/hooks/pr-workflow-response-gate.d.ts +23 -0
- package/dist/hooks/pr-workflow-session-resolver.d.ts +14 -0
- package/dist/index.js +496 -451
- package/dist/knowledge/family-migration-shared.d.ts +24 -0
- package/dist/knowledge/family-migration.d.ts +5 -0
- package/dist/memory/config.d.ts +11 -0
- package/dist/memory/consolidation-log.d.ts +8 -2
- package/dist/memory/finalize-reward-sweep.d.ts +2 -1
- package/dist/memory/gateway.d.ts +13 -0
- package/dist/memory/index.d.ts +4 -2
- package/dist/memory/local-jsonl-provider.d.ts +25 -1
- package/dist/memory/memory-family-manifest.d.ts +52 -0
- package/dist/memory/memory-family-migration.d.ts +94 -0
- package/dist/memory/memory-link.d.ts +103 -0
- package/dist/memory/provider-pool.d.ts +35 -0
- package/dist/memory/redaction.d.ts +31 -0
- package/dist/memory/schema.d.ts +21 -0
- package/dist/memory/sqlite-provider.d.ts +58 -1
- package/dist/memory/storage-root.d.ts +93 -0
- package/dist/memory/types.d.ts +20 -1
- package/dist/services/knowledge-diagnostics.d.ts +25 -0
- package/dist/services/status-service.d.ts +16 -0
- package/dist/tools/complete-pr-workflow.d.ts +5 -0
- package/dist/tools/dispatch-lanes.d.ts +44 -0
- package/dist/tools/index.d.ts +2 -0
- package/dist/tools/manifest.d.ts +2 -0
- package/dist/tools/run-pr-feedback-stage-a.d.ts +69 -0
- package/dist/tools/tool-metadata.d.ts +8 -0
- package/dist/tools/write-pr-review-trigger-eval.d.ts +56 -46
- package/package.json +1 -1
- package/dist/cli/curator-llm-factory-mfvd4sqx.js +0 -52
- package/dist/cli/guardrail-explain-4vytbchb.js +0 -53
- package/dist/cli/guardrail-log-z291m4gw.js +0 -16
- package/dist/cli/hive-promoter-y5wsztkc.js +0 -67
- package/dist/cli/index-4rhcth7a.js +0 -14
- package/dist/cli/index-dqh3zhhc.js +0 -133
- package/dist/cli/index-wr8qgpz5.js +0 -2463
- package/dist/cli/workspace-snapshot-eyf6gd0d.js +0 -22
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
import {
|
|
3
|
-
createCuratorLLMDelegate
|
|
4
|
-
} from "./index-jyrhy4ww.js";
|
|
5
|
-
import"./index-19zn67q6.js";
|
|
6
|
-
import"./index-det5jwfk.js";
|
|
7
|
-
import"./index-7cspygmb.js";
|
|
8
|
-
import"./index-4905hd2m.js";
|
|
9
|
-
import"./index-nprawcc0.js";
|
|
10
|
-
import"./index-q00e4s1s.js";
|
|
11
|
-
import"./index-j9kxwshw.js";
|
|
12
|
-
import"./index-hns7xjm7.js";
|
|
13
|
-
import"./index-vxv732ex.js";
|
|
14
|
-
import"./index-c8s9a3zh.js";
|
|
15
|
-
import"./index-816rkp4y.js";
|
|
16
|
-
import"./index-22e127jw.js";
|
|
17
|
-
import"./index-m0bmh3w0.js";
|
|
18
|
-
import"./index-cqsak7bf.js";
|
|
19
|
-
import"./index-rtry5xyf.js";
|
|
20
|
-
import"./index-n2712byd.js";
|
|
21
|
-
import"./index-dywekeen.js";
|
|
22
|
-
import"./index-ae75rja9.js";
|
|
23
|
-
import"./index-q27bajqb.js";
|
|
24
|
-
import"./index-3rr0ese8.js";
|
|
25
|
-
import"./index-vcgfqd8f.js";
|
|
26
|
-
import"./index-gnp9x6se.js";
|
|
27
|
-
import"./index-wr8qgpz5.js";
|
|
28
|
-
import"./index-4rhcth7a.js";
|
|
29
|
-
import"./index-8fwhhayc.js";
|
|
30
|
-
import"./index-q1exe2b3.js";
|
|
31
|
-
import"./index-d6h5hq91.js";
|
|
32
|
-
import"./index-ctpgsj84.js";
|
|
33
|
-
import"./index-m1abzg93.js";
|
|
34
|
-
import"./index-gw3m5fw0.js";
|
|
35
|
-
import"./index-ye3fndsw.js";
|
|
36
|
-
import"./index-kzj3fp7c.js";
|
|
37
|
-
import"./index-5e4e2hvv.js";
|
|
38
|
-
import"./index-p0arc26j.js";
|
|
39
|
-
import"./index-zgwm4ryv.js";
|
|
40
|
-
import"./index-dqh3zhhc.js";
|
|
41
|
-
import"./index-6xnxz6z0.js";
|
|
42
|
-
import"./index-7mkpsw6g.js";
|
|
43
|
-
import"./index-fsrp8wp3.js";
|
|
44
|
-
import"./index-76kvm9z5.js";
|
|
45
|
-
import"./index-q2rrv0cy.js";
|
|
46
|
-
import"./index-293f68mj.js";
|
|
47
|
-
import"./index-7g4c7s5r.js";
|
|
48
|
-
import"./index-qe3v54nb.js";
|
|
49
|
-
import"./index-a76rekgs.js";
|
|
50
|
-
export {
|
|
51
|
-
createCuratorLLMDelegate
|
|
52
|
-
};
|
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
import {
|
|
3
|
-
handleGuardrailExplain
|
|
4
|
-
} from "./index-6sgqnvpw.js";
|
|
5
|
-
import"./index-jyrhy4ww.js";
|
|
6
|
-
import"./index-19zn67q6.js";
|
|
7
|
-
import"./index-det5jwfk.js";
|
|
8
|
-
import"./index-7cspygmb.js";
|
|
9
|
-
import"./index-4905hd2m.js";
|
|
10
|
-
import"./index-nprawcc0.js";
|
|
11
|
-
import"./index-q00e4s1s.js";
|
|
12
|
-
import"./index-j9kxwshw.js";
|
|
13
|
-
import"./index-hns7xjm7.js";
|
|
14
|
-
import"./index-vxv732ex.js";
|
|
15
|
-
import"./index-c8s9a3zh.js";
|
|
16
|
-
import"./index-816rkp4y.js";
|
|
17
|
-
import"./index-22e127jw.js";
|
|
18
|
-
import"./index-m0bmh3w0.js";
|
|
19
|
-
import"./index-cqsak7bf.js";
|
|
20
|
-
import"./index-rtry5xyf.js";
|
|
21
|
-
import"./index-n2712byd.js";
|
|
22
|
-
import"./index-dywekeen.js";
|
|
23
|
-
import"./index-ae75rja9.js";
|
|
24
|
-
import"./index-q27bajqb.js";
|
|
25
|
-
import"./index-3rr0ese8.js";
|
|
26
|
-
import"./index-vcgfqd8f.js";
|
|
27
|
-
import"./index-gnp9x6se.js";
|
|
28
|
-
import"./index-wr8qgpz5.js";
|
|
29
|
-
import"./index-4rhcth7a.js";
|
|
30
|
-
import"./index-8fwhhayc.js";
|
|
31
|
-
import"./index-q1exe2b3.js";
|
|
32
|
-
import"./index-d6h5hq91.js";
|
|
33
|
-
import"./index-ctpgsj84.js";
|
|
34
|
-
import"./index-m1abzg93.js";
|
|
35
|
-
import"./index-gw3m5fw0.js";
|
|
36
|
-
import"./index-ye3fndsw.js";
|
|
37
|
-
import"./index-kzj3fp7c.js";
|
|
38
|
-
import"./index-5e4e2hvv.js";
|
|
39
|
-
import"./index-p0arc26j.js";
|
|
40
|
-
import"./index-zgwm4ryv.js";
|
|
41
|
-
import"./index-dqh3zhhc.js";
|
|
42
|
-
import"./index-6xnxz6z0.js";
|
|
43
|
-
import"./index-7mkpsw6g.js";
|
|
44
|
-
import"./index-fsrp8wp3.js";
|
|
45
|
-
import"./index-76kvm9z5.js";
|
|
46
|
-
import"./index-q2rrv0cy.js";
|
|
47
|
-
import"./index-293f68mj.js";
|
|
48
|
-
import"./index-7g4c7s5r.js";
|
|
49
|
-
import"./index-qe3v54nb.js";
|
|
50
|
-
import"./index-a76rekgs.js";
|
|
51
|
-
export {
|
|
52
|
-
handleGuardrailExplain
|
|
53
|
-
};
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
import {
|
|
3
|
-
handleGuardrailLog
|
|
4
|
-
} from "./index-17eybc3z.js";
|
|
5
|
-
import"./index-19zn67q6.js";
|
|
6
|
-
import"./index-wr8qgpz5.js";
|
|
7
|
-
import"./index-4rhcth7a.js";
|
|
8
|
-
import"./index-5e4e2hvv.js";
|
|
9
|
-
import"./index-p0arc26j.js";
|
|
10
|
-
import"./index-zgwm4ryv.js";
|
|
11
|
-
import"./index-293f68mj.js";
|
|
12
|
-
import"./index-qe3v54nb.js";
|
|
13
|
-
import"./index-a76rekgs.js";
|
|
14
|
-
export {
|
|
15
|
-
handleGuardrailLog
|
|
16
|
-
};
|
|
@@ -1,67 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
import {
|
|
3
|
-
_internals1 as _internals,
|
|
4
|
-
checkHivePromotions,
|
|
5
|
-
countDistinctProjects,
|
|
6
|
-
createHivePromoterHook,
|
|
7
|
-
isHiveEligible,
|
|
8
|
-
promoteFromSwarm,
|
|
9
|
-
promoteToHive
|
|
10
|
-
} from "./index-jyrhy4ww.js";
|
|
11
|
-
import"./index-19zn67q6.js";
|
|
12
|
-
import"./index-det5jwfk.js";
|
|
13
|
-
import"./index-7cspygmb.js";
|
|
14
|
-
import"./index-4905hd2m.js";
|
|
15
|
-
import"./index-nprawcc0.js";
|
|
16
|
-
import"./index-q00e4s1s.js";
|
|
17
|
-
import"./index-j9kxwshw.js";
|
|
18
|
-
import"./index-hns7xjm7.js";
|
|
19
|
-
import"./index-vxv732ex.js";
|
|
20
|
-
import"./index-c8s9a3zh.js";
|
|
21
|
-
import"./index-816rkp4y.js";
|
|
22
|
-
import"./index-22e127jw.js";
|
|
23
|
-
import"./index-m0bmh3w0.js";
|
|
24
|
-
import"./index-cqsak7bf.js";
|
|
25
|
-
import"./index-rtry5xyf.js";
|
|
26
|
-
import {
|
|
27
|
-
resolveHiveKnowledgePath
|
|
28
|
-
} from "./index-n2712byd.js";
|
|
29
|
-
import"./index-dywekeen.js";
|
|
30
|
-
import"./index-ae75rja9.js";
|
|
31
|
-
import"./index-q27bajqb.js";
|
|
32
|
-
import"./index-3rr0ese8.js";
|
|
33
|
-
import"./index-vcgfqd8f.js";
|
|
34
|
-
import"./index-gnp9x6se.js";
|
|
35
|
-
import"./index-wr8qgpz5.js";
|
|
36
|
-
import"./index-4rhcth7a.js";
|
|
37
|
-
import"./index-8fwhhayc.js";
|
|
38
|
-
import"./index-q1exe2b3.js";
|
|
39
|
-
import"./index-d6h5hq91.js";
|
|
40
|
-
import"./index-ctpgsj84.js";
|
|
41
|
-
import"./index-m1abzg93.js";
|
|
42
|
-
import"./index-gw3m5fw0.js";
|
|
43
|
-
import"./index-ye3fndsw.js";
|
|
44
|
-
import"./index-kzj3fp7c.js";
|
|
45
|
-
import"./index-5e4e2hvv.js";
|
|
46
|
-
import"./index-p0arc26j.js";
|
|
47
|
-
import"./index-zgwm4ryv.js";
|
|
48
|
-
import"./index-dqh3zhhc.js";
|
|
49
|
-
import"./index-6xnxz6z0.js";
|
|
50
|
-
import"./index-7mkpsw6g.js";
|
|
51
|
-
import"./index-fsrp8wp3.js";
|
|
52
|
-
import"./index-76kvm9z5.js";
|
|
53
|
-
import"./index-q2rrv0cy.js";
|
|
54
|
-
import"./index-293f68mj.js";
|
|
55
|
-
import"./index-7g4c7s5r.js";
|
|
56
|
-
import"./index-qe3v54nb.js";
|
|
57
|
-
import"./index-a76rekgs.js";
|
|
58
|
-
export {
|
|
59
|
-
resolveHiveKnowledgePath,
|
|
60
|
-
promoteToHive,
|
|
61
|
-
promoteFromSwarm,
|
|
62
|
-
isHiveEligible,
|
|
63
|
-
createHivePromoterHook,
|
|
64
|
-
countDistinctProjects,
|
|
65
|
-
checkHivePromotions,
|
|
66
|
-
_internals
|
|
67
|
-
};
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
// src/hooks/knowledge-types.ts
|
|
3
|
-
var KNOWLEDGE_SCHEMA_VERSION = 3;
|
|
4
|
-
var INACTIVE_STATUSES = new Set([
|
|
5
|
-
"archived",
|
|
6
|
-
"quarantined",
|
|
7
|
-
"quarantined_unactionable"
|
|
8
|
-
]);
|
|
9
|
-
var OUTCOME_BLOCK_THRESHOLD = -0.3;
|
|
10
|
-
function isActiveStatus(status) {
|
|
11
|
-
return !INACTIVE_STATUSES.has(status ?? "");
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
export { KNOWLEDGE_SCHEMA_VERSION, OUTCOME_BLOCK_THRESHOLD, isActiveStatus };
|
|
@@ -1,133 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
// src/background/workspace-snapshot.ts
|
|
3
|
-
import * as child_process from "child_process";
|
|
4
|
-
import { createHash } from "crypto";
|
|
5
|
-
import * as path from "path";
|
|
6
|
-
var GIT_SNAPSHOT_TIMEOUT_MS = 3000;
|
|
7
|
-
var GIT_SNAPSHOT_MAX_BUFFER = 512 * 1024;
|
|
8
|
-
function runGit(directory, args) {
|
|
9
|
-
const result = _internals.spawnSync("git", ["-C", directory, ...args], {
|
|
10
|
-
cwd: directory,
|
|
11
|
-
encoding: "utf-8",
|
|
12
|
-
timeout: GIT_SNAPSHOT_TIMEOUT_MS,
|
|
13
|
-
maxBuffer: GIT_SNAPSHOT_MAX_BUFFER,
|
|
14
|
-
stdio: ["ignore", "pipe", "pipe"]
|
|
15
|
-
});
|
|
16
|
-
if (result.error || result.status !== 0)
|
|
17
|
-
return null;
|
|
18
|
-
return typeof result.stdout === "string" ? result.stdout.trimEnd() : null;
|
|
19
|
-
}
|
|
20
|
-
function parseNulPaths(output) {
|
|
21
|
-
return output.split("\x00").filter((entry) => entry.length > 0);
|
|
22
|
-
}
|
|
23
|
-
function parsePorcelainPaths(output) {
|
|
24
|
-
const entries = parseNulPaths(output);
|
|
25
|
-
const paths = [];
|
|
26
|
-
for (let index = 0;index < entries.length; index++) {
|
|
27
|
-
const entry = entries[index];
|
|
28
|
-
if (entry.length < 4 || entry[2] !== " ")
|
|
29
|
-
return null;
|
|
30
|
-
const status = entry.slice(0, 2);
|
|
31
|
-
const changedPath = entry.slice(3);
|
|
32
|
-
if (!changedPath)
|
|
33
|
-
return null;
|
|
34
|
-
paths.push(changedPath);
|
|
35
|
-
if (status.includes("R") || status.includes("C")) {
|
|
36
|
-
const originalPath = entries[++index];
|
|
37
|
-
if (!originalPath)
|
|
38
|
-
return null;
|
|
39
|
-
paths.push(originalPath);
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
return [...new Set(paths)];
|
|
43
|
-
}
|
|
44
|
-
function captureWorkspaceSnapshot(directory, optionsOrScope = null, prHeadShaArg = null) {
|
|
45
|
-
const scope = typeof optionsOrScope === "object" && optionsOrScope !== null ? optionsOrScope.scope ?? null : optionsOrScope;
|
|
46
|
-
const prHeadSha = (() => {
|
|
47
|
-
if (typeof optionsOrScope !== "object" || optionsOrScope === null) {
|
|
48
|
-
return prHeadShaArg;
|
|
49
|
-
}
|
|
50
|
-
if (optionsOrScope.resolveCurrentPrHeadSha) {
|
|
51
|
-
return runGit(directory, ["rev-parse", "@{upstream}"]);
|
|
52
|
-
}
|
|
53
|
-
return optionsOrScope.prHeadSha ?? null;
|
|
54
|
-
})();
|
|
55
|
-
const gitHead = runGit(directory, ["rev-parse", "HEAD"]);
|
|
56
|
-
const porcelain = runGit(directory, [
|
|
57
|
-
"status",
|
|
58
|
-
"--porcelain=v1",
|
|
59
|
-
"-z",
|
|
60
|
-
"--untracked-files=all"
|
|
61
|
-
]);
|
|
62
|
-
const changedFiles = porcelain === null ? null : parsePorcelainPaths(porcelain);
|
|
63
|
-
return {
|
|
64
|
-
directory: path.resolve(directory),
|
|
65
|
-
gitHead,
|
|
66
|
-
dirtyHash: porcelain === null ? null : digest(porcelain),
|
|
67
|
-
changedFiles,
|
|
68
|
-
prHeadSha,
|
|
69
|
-
scope
|
|
70
|
-
};
|
|
71
|
-
}
|
|
72
|
-
function changedFilesSinceSnapshot(directory, baseline) {
|
|
73
|
-
if (!baseline?.gitHead || baseline.changedFiles == null)
|
|
74
|
-
return null;
|
|
75
|
-
if (baseline.changedFiles.length > 0)
|
|
76
|
-
return null;
|
|
77
|
-
const current = captureWorkspaceSnapshot(directory);
|
|
78
|
-
if (!current.gitHead || current.changedFiles == null)
|
|
79
|
-
return null;
|
|
80
|
-
const changed = new Set(current.changedFiles);
|
|
81
|
-
if (baseline.gitHead !== current.gitHead) {
|
|
82
|
-
const committed = runGit(directory, [
|
|
83
|
-
"diff",
|
|
84
|
-
"--name-only",
|
|
85
|
-
"-z",
|
|
86
|
-
baseline.gitHead,
|
|
87
|
-
current.gitHead
|
|
88
|
-
]);
|
|
89
|
-
if (committed === null)
|
|
90
|
-
return null;
|
|
91
|
-
for (const changedPath of parseNulPaths(committed))
|
|
92
|
-
changed.add(changedPath);
|
|
93
|
-
}
|
|
94
|
-
return [...changed];
|
|
95
|
-
}
|
|
96
|
-
function workspaceSnapshotMatches(expected, current) {
|
|
97
|
-
if (!expected)
|
|
98
|
-
return { ok: true };
|
|
99
|
-
if (path.resolve(expected.directory) !== path.resolve(current.directory)) {
|
|
100
|
-
return {
|
|
101
|
-
ok: false,
|
|
102
|
-
reason: `directory changed: expected ${expected.directory}, got ${current.directory}`
|
|
103
|
-
};
|
|
104
|
-
}
|
|
105
|
-
const checks = ["gitHead", "dirtyHash", "prHeadSha"];
|
|
106
|
-
for (const key of checks) {
|
|
107
|
-
const expectedValue = expected[key];
|
|
108
|
-
if (expectedValue === null)
|
|
109
|
-
continue;
|
|
110
|
-
if (current[key] !== expectedValue) {
|
|
111
|
-
return {
|
|
112
|
-
ok: false,
|
|
113
|
-
reason: `${key} changed: expected ${expectedValue}, got ${current[key] ?? "unknown"}`
|
|
114
|
-
};
|
|
115
|
-
}
|
|
116
|
-
}
|
|
117
|
-
return { ok: true };
|
|
118
|
-
}
|
|
119
|
-
var compareWorkspaceSnapshot = workspaceSnapshotMatches;
|
|
120
|
-
function compareWorkspaceSnapshots(expected, current) {
|
|
121
|
-
const result = workspaceSnapshotMatches(expected, current);
|
|
122
|
-
if (result.ok)
|
|
123
|
-
return { stale: false };
|
|
124
|
-
return { stale: true, reason: result.reason };
|
|
125
|
-
}
|
|
126
|
-
function digest(text) {
|
|
127
|
-
return createHash("sha256").update(text).digest("hex");
|
|
128
|
-
}
|
|
129
|
-
var _internals = {
|
|
130
|
-
spawnSync: child_process.spawnSync
|
|
131
|
-
};
|
|
132
|
-
|
|
133
|
-
export { parsePorcelainPaths, captureWorkspaceSnapshot, changedFilesSinceSnapshot, workspaceSnapshotMatches, compareWorkspaceSnapshot, compareWorkspaceSnapshots, digest, _internals };
|