opencode-swarm 7.126.0 → 7.126.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/.opencode/skills/swarm-pr-feedback/SKILL.md +19 -14
- package/.opencode/skills/swarm-pr-review/SKILL.md +17 -13
- package/dist/cli/{config-doctor-akxywx0c.js → config-doctor-23jxdqwv.js} +2 -2
- package/dist/cli/{core-v1kp7anb.js → core-wg3re04e.js} +1 -1
- package/dist/cli/{curation-policy-dptr1rfe.js → curation-policy-0t6hny6g.js} +2 -2
- package/dist/cli/{curator-23hynz78.js → curator-g8rggzbk.js} +14 -14
- package/dist/cli/{curator-llm-factory-r648jn8e.js → curator-llm-factory-36psae60.js} +14 -14
- package/dist/cli/{guardrail-explain-6atsd4vr.js → guardrail-explain-6ffgrjx9.js} +15 -15
- package/dist/cli/{guardrail-log-222xyxfp.js → guardrail-log-57sczn5h.js} +3 -3
- package/dist/cli/{hive-promoter-bnkhzd46.js → hive-promoter-c458rgp5.js} +14 -14
- package/dist/cli/{index-qzkcy22e.js → index-1p9z8cc4.js} +1 -1
- package/dist/cli/{index-cdx337js.js → index-3hkbegq2.js} +1 -1
- package/dist/cli/{index-gnvg72y1.js → index-4ff0x4cg.js} +79 -1
- package/dist/cli/{index-kwnsatzq.js → index-6j9p0c40.js} +2 -2
- package/dist/cli/{index-a1c9az5e.js → index-abw10n3f.js} +109 -151
- package/dist/cli/{index-r1gdkn2d.js → index-c8sqc3nh.js} +113 -21
- package/dist/cli/{index-2bnfwmk3.js → index-cnhp6c0k.js} +1 -1
- package/dist/cli/{index-dezgmvtw.js → index-echdpdhy.js} +1 -1
- package/dist/cli/{index-yfzn5r9s.js → index-k5xh81c9.js} +3 -3
- package/dist/cli/{index-mgrsx5hn.js → index-kx3533dm.js} +1 -1
- package/dist/cli/{index-bcgfhxzv.js → index-nkhp7j16.js} +5 -5
- package/dist/cli/{index-2yd75hms.js → index-nmyg9b7v.js} +4 -4
- package/dist/cli/{index-16z6txq3.js → index-vvwf9ark.js} +2 -2
- package/dist/cli/{index-jt7hnr7q.js → index-w0yztxgq.js} +1 -1
- package/dist/cli/{index-g4ef4v3m.js → index-w9cb5zwh.js} +1 -1
- package/dist/cli/{index-y4ry07h8.js → index-x1w4cx3n.js} +2 -2
- package/dist/cli/{index-0ff5cm9j.js → index-y9t766sw.js} +2217 -2195
- package/dist/cli/{index-68fpa7ff.js → index-yf4kvhrn.js} +16 -16
- package/dist/cli/index.js +14 -14
- package/dist/cli/{knowledge-escalator-4hc8w7sd.js → knowledge-escalator-kd80m9vp.js} +3 -3
- package/dist/cli/{knowledge-events-kyqjv1f8.js → knowledge-events-j7jfwm1d.js} +1 -1
- package/dist/cli/{knowledge-store-06k0p1gs.js → knowledge-store-1d4byc7y.js} +1 -1
- package/dist/cli/{knowledge-validator-42xjmcmh.js → knowledge-validator-63mkgt9x.js} +4 -4
- package/dist/cli/{scan-cursor-gjcvpyta.js → scan-cursor-qzn5jmbe.js} +2 -2
- package/dist/cli/{schema-69z8w1ka.js → schema-2j92wnns.js} +1 -1
- package/dist/cli/{scope-persistence-habn4q8a.js → scope-persistence-dm5bab50.js} +3 -1
- package/dist/cli/{skill-generator-t6j93mwt.js → skill-generator-sv6zvdvz.js} +5 -5
- package/dist/config/index.d.ts +1 -0
- package/dist/config/loader.d.ts +51 -36
- package/dist/hooks/pr-workflow-gate.d.ts +39 -0
- package/dist/hooks/scope-guard.d.ts +6 -1
- package/dist/index.js +29 -26
- package/dist/scope/scope-binding.d.ts +21 -2
- package/dist/scope/scope-persistence.d.ts +6 -0
- package/dist/tools/index.d.ts +2 -0
- package/dist/tools/manifest.d.ts +2 -0
- package/dist/tools/prepare-pr-feedback-scope.d.ts +5 -0
- package/dist/tools/tool-metadata.d.ts +98 -0
- package/dist/tools/write-pr-review-artifact.d.ts +5 -0
- package/package.json +3 -3
|
@@ -203,20 +203,25 @@ for the Fix Planning step.
|
|
|
203
203
|
|
|
204
204
|
## Pre-flight: Scope Discipline
|
|
205
205
|
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
206
|
+
When the plugin's mechanical controller is available, every coder Task must be
|
|
207
|
+
preceded by `prepare_pr_feedback_scope({ task_id, files })`. The controller is
|
|
208
|
+
available only after the immutable feedback-verification lanes have settled and
|
|
209
|
+
binds the exact file set to the current feedback revision, parent session, and
|
|
210
|
+
next matching Task call. The coder prompt must use the same numeric `task_id`,
|
|
211
|
+
contain matching `FILE:` directives, and include a literal `ACCEPTANCE:` line.
|
|
212
|
+
Once a Task consumes that scope, its `task_id` is immutable for the current
|
|
213
|
+
feedback revision. Any retry must prepare and dispatch a fresh nested numeric
|
|
214
|
+
task identity (for example `1.1.1`), never re-declare the consumed ID.
|
|
215
|
+
|
|
216
|
+
Do not create a synthetic `save_plan` merely to authorize feedback work, and do
|
|
217
|
+
not use `declare_scope`; those tools belong to the normal implementation-plan
|
|
218
|
+
lifecycle. There is no one-file or single-function carve-out from the dedicated
|
|
219
|
+
PR-feedback scope controller.
|
|
220
|
+
|
|
221
|
+
In runtimes without this controller, use the native scope mechanism. If none
|
|
222
|
+
exists, put exact allowed files and non-goals in the delegation and verify the
|
|
223
|
+
resulting diff mechanically. Never bypass an available scope controller merely
|
|
224
|
+
to reduce ceremony.
|
|
220
225
|
|
|
221
226
|
## Intake Surfaces
|
|
222
227
|
|
|
@@ -24,11 +24,11 @@ without running a fresh broad review.
|
|
|
24
24
|
When a review finishes with actionable validated findings, stop and ask the user
|
|
25
25
|
whether to continue into `swarm-pr-feedback`. Do not auto-dispatch fix work from
|
|
26
26
|
`PR_REVIEW`. Instead, write a handoff artifact under
|
|
27
|
-
`.swarm/pr-review/<run_id>/feedback-handoff.
|
|
28
|
-
exact continuation prompt:
|
|
27
|
+
`.swarm/pr-review/<run_id>/feedback-handoff.json` with `write_pr_review_artifact`
|
|
28
|
+
and include the exact continuation prompt:
|
|
29
29
|
|
|
30
30
|
```text
|
|
31
|
-
/swarm pr-feedback <PR_URL> continue from .swarm/pr-review/<run_id>/feedback-handoff.
|
|
31
|
+
/swarm pr-feedback <PR_URL> continue from .swarm/pr-review/<run_id>/feedback-handoff.json
|
|
32
32
|
```
|
|
33
33
|
|
|
34
34
|
`<run_id>` is a stable identifier for this review run, such as
|
|
@@ -459,10 +459,10 @@ The context pack must include, when available:
|
|
|
459
459
|
|
|
460
460
|
## Review Finding Persistence
|
|
461
461
|
|
|
462
|
-
Do not rely on conversation context to preserve review findings.
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
462
|
+
Do not rely on conversation context to preserve review findings. Use
|
|
463
|
+
`write_pr_review_artifact` with `kind: "findings"`; the controller creates and
|
|
464
|
+
appends `.swarm/pr-review/<run_id>/findings.jsonl` without granting generic
|
|
465
|
+
write authority over `.swarm/`.
|
|
466
466
|
|
|
467
467
|
Each persisted finding record must include at least:
|
|
468
468
|
|
|
@@ -484,11 +484,14 @@ Minimum field contract:
|
|
|
484
484
|
Persist after every major validation boundary:
|
|
485
485
|
|
|
486
486
|
1. **Post-explorer:** after Phase 3/4 candidate parsing and before reviewer
|
|
487
|
-
dispatch,
|
|
488
|
-
|
|
487
|
+
dispatch, call `write_pr_review_artifact` with `boundary: "post_explorer"`
|
|
488
|
+
and all candidates as `PENDING` with their lane provenance.
|
|
489
|
+
2. **Post-reviewer:** after Phase 6 reviewer validation, call the controller
|
|
490
|
+
with `boundary: "post_reviewer"` and update each reviewed
|
|
489
491
|
record to `CONFIRMED`, `DISPROVED`, `PRE_EXISTING`, or keep `PENDING` with a
|
|
490
492
|
concrete `next_action` if more evidence is required.
|
|
491
|
-
3. **Post-critic:** after Phase 8 critic challenge,
|
|
493
|
+
3. **Post-critic:** after Phase 8 critic challenge, call the controller with
|
|
494
|
+
`boundary: "post_critic"` and update final status,
|
|
492
495
|
severity/action notes in `evidence`, and final reporting or handoff action.
|
|
493
496
|
|
|
494
497
|
Resume/reload procedure:
|
|
@@ -1376,7 +1379,9 @@ Explain the recommendation in one short paragraph and list required actions befo
|
|
|
1376
1379
|
## Feedback handoff
|
|
1377
1380
|
|
|
1378
1381
|
When the review produced actionable validated findings or operational blockers,
|
|
1379
|
-
|
|
1382
|
+
call `write_pr_review_artifact` with `kind: "handoff"`. The controller writes
|
|
1383
|
+
`.swarm/pr-review/<run_id>/feedback-handoff.json` only when its finding IDs
|
|
1384
|
+
exactly match the latest confirmed `handoff_to_feedback` records. Include:
|
|
1380
1385
|
|
|
1381
1386
|
- the handoff artifact path,
|
|
1382
1387
|
- the preserved finding IDs and provenance that `swarm-pr-feedback` must carry
|
|
@@ -1387,7 +1392,7 @@ include:
|
|
|
1387
1392
|
Use this exact continuation prompt format:
|
|
1388
1393
|
|
|
1389
1394
|
```text
|
|
1390
|
-
/swarm pr-feedback <PR_URL> continue from .swarm/pr-review/<run_id>/feedback-handoff.
|
|
1395
|
+
/swarm pr-feedback <PR_URL> continue from .swarm/pr-review/<run_id>/feedback-handoff.json
|
|
1391
1396
|
```
|
|
1392
1397
|
|
|
1393
1398
|
---
|
|
@@ -1435,4 +1440,3 @@ unproductive wakes, and the only exits are:
|
|
|
1435
1440
|
Abort is a recovery tool, not a coverage shortcut. Use it only when the
|
|
1436
1441
|
bind/checkout path is genuinely unreachable; never use it to skip a
|
|
1437
1442
|
coverage obligation that is merely expensive or inconvenient.
|
|
1438
|
-
|
|
@@ -12,8 +12,8 @@ import {
|
|
|
12
12
|
shouldRunOnStartup,
|
|
13
13
|
writeBackupArtifact,
|
|
14
14
|
writeDoctorArtifact
|
|
15
|
-
} from "./index-
|
|
16
|
-
import"./index-
|
|
15
|
+
} from "./index-w0yztxgq.js";
|
|
16
|
+
import"./index-c8sqc3nh.js";
|
|
17
17
|
import"./index-bk5tah7q.js";
|
|
18
18
|
import"./index-z6xqpmqg.js";
|
|
19
19
|
import"./index-zjygnfay.js";
|
|
@@ -4,9 +4,9 @@ import {
|
|
|
4
4
|
authorizeCuration,
|
|
5
5
|
buildConfigFingerprintInput,
|
|
6
6
|
readCohortConfigFingerprint
|
|
7
|
-
} from "./index-
|
|
7
|
+
} from "./index-kx3533dm.js";
|
|
8
8
|
import"./index-rtry5xyf.js";
|
|
9
|
-
import"./index-
|
|
9
|
+
import"./index-cnhp6c0k.js";
|
|
10
10
|
import"./index-ae75rja9.js";
|
|
11
11
|
import"./index-q27bajqb.js";
|
|
12
12
|
import"./index-zgwm4ryv.js";
|
|
@@ -14,38 +14,38 @@ import {
|
|
|
14
14
|
runCuratorInit,
|
|
15
15
|
runCuratorPhase,
|
|
16
16
|
writeCuratorSummary
|
|
17
|
-
} from "./index-
|
|
18
|
-
import"./index-
|
|
19
|
-
import"./index-
|
|
17
|
+
} from "./index-y9t766sw.js";
|
|
18
|
+
import"./index-echdpdhy.js";
|
|
19
|
+
import"./index-w0yztxgq.js";
|
|
20
20
|
import"./index-kk1scggc.js";
|
|
21
21
|
import"./index-4905hd2m.js";
|
|
22
22
|
import"./index-134d35c1.js";
|
|
23
23
|
import"./index-6n2jpz7x.js";
|
|
24
|
-
import"./index-
|
|
25
|
-
import"./index-
|
|
26
|
-
import"./index-
|
|
24
|
+
import"./index-k5xh81c9.js";
|
|
25
|
+
import"./index-nkhp7j16.js";
|
|
26
|
+
import"./index-3hkbegq2.js";
|
|
27
27
|
import"./index-vxv732ex.js";
|
|
28
28
|
import"./index-c8s9a3zh.js";
|
|
29
29
|
import"./index-9ss2m4rs.js";
|
|
30
30
|
import"./index-23zsx7dm.js";
|
|
31
|
-
import"./index-
|
|
32
|
-
import"./index-
|
|
31
|
+
import"./index-6j9p0c40.js";
|
|
32
|
+
import"./index-kx3533dm.js";
|
|
33
33
|
import"./index-rtry5xyf.js";
|
|
34
|
-
import"./index-
|
|
35
|
-
import"./index-
|
|
34
|
+
import"./index-nmyg9b7v.js";
|
|
35
|
+
import"./index-cnhp6c0k.js";
|
|
36
36
|
import"./index-ae75rja9.js";
|
|
37
37
|
import"./index-q27bajqb.js";
|
|
38
|
-
import"./index-
|
|
38
|
+
import"./index-abw10n3f.js";
|
|
39
39
|
import"./index-k5jrywpr.js";
|
|
40
40
|
import"./index-n832052r.js";
|
|
41
|
-
import"./index-
|
|
41
|
+
import"./index-c8sqc3nh.js";
|
|
42
42
|
import"./index-bk5tah7q.js";
|
|
43
43
|
import"./index-8fwhhayc.js";
|
|
44
44
|
import"./index-q1exe2b3.js";
|
|
45
|
-
import"./index-
|
|
45
|
+
import"./index-4ff0x4cg.js";
|
|
46
46
|
import"./index-2tn5h2zp.js";
|
|
47
47
|
import"./index-1kz6da87.js";
|
|
48
|
-
import"./index-
|
|
48
|
+
import"./index-w9cb5zwh.js";
|
|
49
49
|
import"./index-4rhhvd1a.js";
|
|
50
50
|
import"./index-0cz1ws47.js";
|
|
51
51
|
import"./index-2445sx3d.js";
|
|
@@ -1,38 +1,38 @@
|
|
|
1
1
|
// @bun
|
|
2
2
|
import {
|
|
3
3
|
createCuratorLLMDelegate
|
|
4
|
-
} from "./index-
|
|
5
|
-
import"./index-
|
|
6
|
-
import"./index-
|
|
4
|
+
} from "./index-y9t766sw.js";
|
|
5
|
+
import"./index-echdpdhy.js";
|
|
6
|
+
import"./index-w0yztxgq.js";
|
|
7
7
|
import"./index-kk1scggc.js";
|
|
8
8
|
import"./index-4905hd2m.js";
|
|
9
9
|
import"./index-134d35c1.js";
|
|
10
10
|
import"./index-6n2jpz7x.js";
|
|
11
|
-
import"./index-
|
|
12
|
-
import"./index-
|
|
13
|
-
import"./index-
|
|
11
|
+
import"./index-k5xh81c9.js";
|
|
12
|
+
import"./index-nkhp7j16.js";
|
|
13
|
+
import"./index-3hkbegq2.js";
|
|
14
14
|
import"./index-vxv732ex.js";
|
|
15
15
|
import"./index-c8s9a3zh.js";
|
|
16
16
|
import"./index-9ss2m4rs.js";
|
|
17
17
|
import"./index-23zsx7dm.js";
|
|
18
|
-
import"./index-
|
|
19
|
-
import"./index-
|
|
18
|
+
import"./index-6j9p0c40.js";
|
|
19
|
+
import"./index-kx3533dm.js";
|
|
20
20
|
import"./index-rtry5xyf.js";
|
|
21
|
-
import"./index-
|
|
22
|
-
import"./index-
|
|
21
|
+
import"./index-nmyg9b7v.js";
|
|
22
|
+
import"./index-cnhp6c0k.js";
|
|
23
23
|
import"./index-ae75rja9.js";
|
|
24
24
|
import"./index-q27bajqb.js";
|
|
25
|
-
import"./index-
|
|
25
|
+
import"./index-abw10n3f.js";
|
|
26
26
|
import"./index-k5jrywpr.js";
|
|
27
27
|
import"./index-n832052r.js";
|
|
28
|
-
import"./index-
|
|
28
|
+
import"./index-c8sqc3nh.js";
|
|
29
29
|
import"./index-bk5tah7q.js";
|
|
30
30
|
import"./index-8fwhhayc.js";
|
|
31
31
|
import"./index-q1exe2b3.js";
|
|
32
|
-
import"./index-
|
|
32
|
+
import"./index-4ff0x4cg.js";
|
|
33
33
|
import"./index-2tn5h2zp.js";
|
|
34
34
|
import"./index-1kz6da87.js";
|
|
35
|
-
import"./index-
|
|
35
|
+
import"./index-w9cb5zwh.js";
|
|
36
36
|
import"./index-4rhhvd1a.js";
|
|
37
37
|
import"./index-0cz1ws47.js";
|
|
38
38
|
import"./index-2445sx3d.js";
|
|
@@ -1,39 +1,39 @@
|
|
|
1
1
|
// @bun
|
|
2
2
|
import {
|
|
3
3
|
handleGuardrailExplain
|
|
4
|
-
} from "./index-
|
|
5
|
-
import"./index-
|
|
6
|
-
import"./index-
|
|
7
|
-
import"./index-
|
|
4
|
+
} from "./index-x1w4cx3n.js";
|
|
5
|
+
import"./index-y9t766sw.js";
|
|
6
|
+
import"./index-echdpdhy.js";
|
|
7
|
+
import"./index-w0yztxgq.js";
|
|
8
8
|
import"./index-kk1scggc.js";
|
|
9
9
|
import"./index-4905hd2m.js";
|
|
10
10
|
import"./index-134d35c1.js";
|
|
11
11
|
import"./index-6n2jpz7x.js";
|
|
12
|
-
import"./index-
|
|
13
|
-
import"./index-
|
|
14
|
-
import"./index-
|
|
12
|
+
import"./index-k5xh81c9.js";
|
|
13
|
+
import"./index-nkhp7j16.js";
|
|
14
|
+
import"./index-3hkbegq2.js";
|
|
15
15
|
import"./index-vxv732ex.js";
|
|
16
16
|
import"./index-c8s9a3zh.js";
|
|
17
17
|
import"./index-9ss2m4rs.js";
|
|
18
18
|
import"./index-23zsx7dm.js";
|
|
19
|
-
import"./index-
|
|
20
|
-
import"./index-
|
|
19
|
+
import"./index-6j9p0c40.js";
|
|
20
|
+
import"./index-kx3533dm.js";
|
|
21
21
|
import"./index-rtry5xyf.js";
|
|
22
|
-
import"./index-
|
|
23
|
-
import"./index-
|
|
22
|
+
import"./index-nmyg9b7v.js";
|
|
23
|
+
import"./index-cnhp6c0k.js";
|
|
24
24
|
import"./index-ae75rja9.js";
|
|
25
25
|
import"./index-q27bajqb.js";
|
|
26
|
-
import"./index-
|
|
26
|
+
import"./index-abw10n3f.js";
|
|
27
27
|
import"./index-k5jrywpr.js";
|
|
28
28
|
import"./index-n832052r.js";
|
|
29
|
-
import"./index-
|
|
29
|
+
import"./index-c8sqc3nh.js";
|
|
30
30
|
import"./index-bk5tah7q.js";
|
|
31
31
|
import"./index-8fwhhayc.js";
|
|
32
32
|
import"./index-q1exe2b3.js";
|
|
33
|
-
import"./index-
|
|
33
|
+
import"./index-4ff0x4cg.js";
|
|
34
34
|
import"./index-2tn5h2zp.js";
|
|
35
35
|
import"./index-1kz6da87.js";
|
|
36
|
-
import"./index-
|
|
36
|
+
import"./index-w9cb5zwh.js";
|
|
37
37
|
import"./index-4rhhvd1a.js";
|
|
38
38
|
import"./index-0cz1ws47.js";
|
|
39
39
|
import"./index-2445sx3d.js";
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
// @bun
|
|
2
2
|
import {
|
|
3
3
|
handleGuardrailLog
|
|
4
|
-
} from "./index-
|
|
5
|
-
import"./index-
|
|
6
|
-
import"./index-
|
|
4
|
+
} from "./index-1p9z8cc4.js";
|
|
5
|
+
import"./index-echdpdhy.js";
|
|
6
|
+
import"./index-c8sqc3nh.js";
|
|
7
7
|
import"./index-bk5tah7q.js";
|
|
8
8
|
import"./index-z6xqpmqg.js";
|
|
9
9
|
import"./index-zjygnfay.js";
|
|
@@ -7,40 +7,40 @@ import {
|
|
|
7
7
|
isHiveEligible,
|
|
8
8
|
promoteFromSwarm,
|
|
9
9
|
promoteToHive
|
|
10
|
-
} from "./index-
|
|
11
|
-
import"./index-
|
|
12
|
-
import"./index-
|
|
10
|
+
} from "./index-y9t766sw.js";
|
|
11
|
+
import"./index-echdpdhy.js";
|
|
12
|
+
import"./index-w0yztxgq.js";
|
|
13
13
|
import"./index-kk1scggc.js";
|
|
14
14
|
import"./index-4905hd2m.js";
|
|
15
15
|
import"./index-134d35c1.js";
|
|
16
16
|
import"./index-6n2jpz7x.js";
|
|
17
|
-
import"./index-
|
|
18
|
-
import"./index-
|
|
19
|
-
import"./index-
|
|
17
|
+
import"./index-k5xh81c9.js";
|
|
18
|
+
import"./index-nkhp7j16.js";
|
|
19
|
+
import"./index-3hkbegq2.js";
|
|
20
20
|
import"./index-vxv732ex.js";
|
|
21
21
|
import"./index-c8s9a3zh.js";
|
|
22
22
|
import"./index-9ss2m4rs.js";
|
|
23
23
|
import"./index-23zsx7dm.js";
|
|
24
|
-
import"./index-
|
|
25
|
-
import"./index-
|
|
24
|
+
import"./index-6j9p0c40.js";
|
|
25
|
+
import"./index-kx3533dm.js";
|
|
26
26
|
import"./index-rtry5xyf.js";
|
|
27
27
|
import {
|
|
28
28
|
resolveHiveKnowledgePath
|
|
29
|
-
} from "./index-
|
|
30
|
-
import"./index-
|
|
29
|
+
} from "./index-nmyg9b7v.js";
|
|
30
|
+
import"./index-cnhp6c0k.js";
|
|
31
31
|
import"./index-ae75rja9.js";
|
|
32
32
|
import"./index-q27bajqb.js";
|
|
33
|
-
import"./index-
|
|
33
|
+
import"./index-abw10n3f.js";
|
|
34
34
|
import"./index-k5jrywpr.js";
|
|
35
35
|
import"./index-n832052r.js";
|
|
36
|
-
import"./index-
|
|
36
|
+
import"./index-c8sqc3nh.js";
|
|
37
37
|
import"./index-bk5tah7q.js";
|
|
38
38
|
import"./index-8fwhhayc.js";
|
|
39
39
|
import"./index-q1exe2b3.js";
|
|
40
|
-
import"./index-
|
|
40
|
+
import"./index-4ff0x4cg.js";
|
|
41
41
|
import"./index-2tn5h2zp.js";
|
|
42
42
|
import"./index-1kz6da87.js";
|
|
43
|
-
import"./index-
|
|
43
|
+
import"./index-w9cb5zwh.js";
|
|
44
44
|
import"./index-4rhhvd1a.js";
|
|
45
45
|
import"./index-0cz1ws47.js";
|
|
46
46
|
import"./index-2445sx3d.js";
|
|
@@ -136,6 +136,7 @@ var SCOPES_DIR = ".swarm/scopes";
|
|
|
136
136
|
var MAX_FILES_PER_SCOPE = 1e4;
|
|
137
137
|
var MAX_PLAN_BYTES = 10 * 1024 * 1024;
|
|
138
138
|
var MAX_SCOPE_BYTES = 2 * 1024 * 1024;
|
|
139
|
+
var MAX_BINDING_FILES_TO_SCAN = 1e4;
|
|
139
140
|
var WINDOWS_RESERVED = new Set([
|
|
140
141
|
"CON",
|
|
141
142
|
"PRN",
|
|
@@ -432,6 +433,83 @@ function resolveAuthorizedScopeBindingForSession(input) {
|
|
|
432
433
|
}
|
|
433
434
|
return matches[0] ?? null;
|
|
434
435
|
}
|
|
436
|
+
function readPrFeedbackBindingFile(directory, filePath, activeSessionId, taskId) {
|
|
437
|
+
try {
|
|
438
|
+
const leaf = fs2.lstatSync(filePath);
|
|
439
|
+
if (!leaf.isFile() || leaf.isSymbolicLink())
|
|
440
|
+
return null;
|
|
441
|
+
if (normalizePathForComparison(fs2.realpathSync(filePath)) !== normalizePathForComparison(filePath))
|
|
442
|
+
return null;
|
|
443
|
+
} catch {
|
|
444
|
+
return null;
|
|
445
|
+
}
|
|
446
|
+
const nofollow = fs2.constants.O_NOFOLLOW ?? 0;
|
|
447
|
+
let fd;
|
|
448
|
+
try {
|
|
449
|
+
fd = fs2.openSync(filePath, fs2.constants.O_RDONLY | nofollow);
|
|
450
|
+
} catch {
|
|
451
|
+
return null;
|
|
452
|
+
}
|
|
453
|
+
let raw = "";
|
|
454
|
+
try {
|
|
455
|
+
const stat = fs2.fstatSync(fd);
|
|
456
|
+
if (!stat.isFile() || stat.size > MAX_SCOPE_BYTES)
|
|
457
|
+
return null;
|
|
458
|
+
const buffer = Buffer.alloc(stat.size);
|
|
459
|
+
fs2.readSync(fd, buffer, 0, stat.size, 0);
|
|
460
|
+
raw = buffer.toString("utf8");
|
|
461
|
+
} catch {
|
|
462
|
+
return null;
|
|
463
|
+
} finally {
|
|
464
|
+
try {
|
|
465
|
+
fs2.closeSync(fd);
|
|
466
|
+
} catch {}
|
|
467
|
+
}
|
|
468
|
+
let parsed;
|
|
469
|
+
try {
|
|
470
|
+
parsed = JSON.parse(raw);
|
|
471
|
+
} catch {
|
|
472
|
+
return null;
|
|
473
|
+
}
|
|
474
|
+
const workspaceIdentity = canonicalWorkspaceIdentity(directory);
|
|
475
|
+
const files = Array.isArray(parsed.files) ? normalizeScopeFiles(parsed.files.filter((file) => typeof file === "string")) : null;
|
|
476
|
+
const now = Date.now();
|
|
477
|
+
if (parsed.version !== 2 || parsed.source !== "pr_feedback" || !workspaceIdentity || parsed.workspaceIdentity !== workspaceIdentity || !isSafeTaskId(parsed.taskId ?? "") || taskId !== undefined && parsed.taskId !== taskId || parsed.ownerSessionId !== activeSessionId || parsed.activation !== "active" || typeof parsed.dispatchCallId !== "string" || !parsed.dispatchCallId || parsed.ownerMessageId !== parsed.dispatchCallId || typeof parsed.parentOwnerSessionId !== "string" || !parsed.parentOwnerSessionId || parsed.ownerSessionId === parsed.parentOwnerSessionId || parsed.parentCallId !== parsed.dispatchCallId || parsed.workflowSessionId !== parsed.parentOwnerSessionId || typeof parsed.workflowRevisionDigest !== "string" || !parsed.workflowRevisionDigest || parsed.planId !== `pr-feedback:${parsed.workflowSessionId}` || parsed.planStructureHash !== parsed.workflowRevisionDigest || typeof parsed.declaredAt !== "number" || parsed.declaredAt > now || typeof parsed.expiresAt !== "number" || parsed.expiresAt <= now || !files)
|
|
478
|
+
return null;
|
|
479
|
+
const expectedPath = getBindingFilePath(directory, parsed.taskId, activeSessionId);
|
|
480
|
+
if (normalizePathForComparison(expectedPath) !== normalizePathForComparison(filePath))
|
|
481
|
+
return null;
|
|
482
|
+
return { ...parsed, files };
|
|
483
|
+
}
|
|
484
|
+
function resolveAuthorizedPrFeedbackScopeBindingFromDisk(input) {
|
|
485
|
+
if (!input.activeSessionId.trim())
|
|
486
|
+
return null;
|
|
487
|
+
const scopesDir = getScopesDir(input.directory);
|
|
488
|
+
if (!isScopesDirSafe(input.directory, scopesDir))
|
|
489
|
+
return null;
|
|
490
|
+
let candidates;
|
|
491
|
+
if (input.taskId) {
|
|
492
|
+
if (!isSafeTaskId(input.taskId))
|
|
493
|
+
return null;
|
|
494
|
+
candidates = [
|
|
495
|
+
getBindingFilePath(input.directory, input.taskId, input.activeSessionId)
|
|
496
|
+
];
|
|
497
|
+
} else {
|
|
498
|
+
try {
|
|
499
|
+
const names = fs2.readdirSync(scopesDir);
|
|
500
|
+
if (names.length > MAX_BINDING_FILES_TO_SCAN)
|
|
501
|
+
return null;
|
|
502
|
+
candidates = names.filter((name) => name.startsWith("binding-") && name.endsWith(".json")).map((name) => path2.join(scopesDir, name));
|
|
503
|
+
} catch {
|
|
504
|
+
return null;
|
|
505
|
+
}
|
|
506
|
+
}
|
|
507
|
+
const matches = candidates.map((candidate) => readPrFeedbackBindingFile(input.directory, candidate, input.activeSessionId, input.taskId)).filter((binding) => binding !== null);
|
|
508
|
+
if (matches.length !== 1)
|
|
509
|
+
return null;
|
|
510
|
+
registerScopeBinding(matches[0]);
|
|
511
|
+
return matches[0];
|
|
512
|
+
}
|
|
435
513
|
async function atomicWrite(targetPath, content) {
|
|
436
514
|
const tempPath = `${targetPath}.tmp.${Date.now()}.${Math.floor(Math.random() * 1e9)}`;
|
|
437
515
|
try {
|
|
@@ -561,4 +639,4 @@ function resolveScopeWithFallbacks(input) {
|
|
|
561
639
|
return null;
|
|
562
640
|
}
|
|
563
641
|
|
|
564
|
-
export { MAX_PENDING_SCOPE_BINDINGS, clearScopeBindings, writeScopeToDisk, writeScopeBindingToDisk, readScopeBindingFromDisk, clearScopeBindingFromDisk, resolveAuthorizedScopeBinding, resolveAuthorizedScopeBindingForSession, readScopeFromDisk, readPlanScope, clearScopeForTask, clearAllScopes, resolveScopeWithFallbacks };
|
|
642
|
+
export { MAX_PENDING_SCOPE_BINDINGS, clearScopeBindings, writeScopeToDisk, writeScopeBindingToDisk, readScopeBindingFromDisk, clearScopeBindingFromDisk, resolveAuthorizedScopeBinding, resolveAuthorizedScopeBindingForSession, resolveAuthorizedPrFeedbackScopeBindingFromDisk, readScopeFromDisk, readPlanScope, clearScopeForTask, clearAllScopes, resolveScopeWithFallbacks };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// @bun
|
|
2
2
|
import {
|
|
3
3
|
authorizeCuration
|
|
4
|
-
} from "./index-
|
|
4
|
+
} from "./index-kx3533dm.js";
|
|
5
5
|
import {
|
|
6
6
|
findNearDuplicate,
|
|
7
7
|
inferTags,
|
|
@@ -9,7 +9,7 @@ import {
|
|
|
9
9
|
resolveSwarmKnowledgePath,
|
|
10
10
|
resolveSwarmRejectedPath,
|
|
11
11
|
transactKnowledge
|
|
12
|
-
} from "./index-
|
|
12
|
+
} from "./index-nmyg9b7v.js";
|
|
13
13
|
import {
|
|
14
14
|
resolveKnowledgeStoreDir
|
|
15
15
|
} from "./index-q27bajqb.js";
|