opencode-swarm 7.188.7 → 7.188.9
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/binaries/win32-arm64/swarm-sandbox-runner.exe +0 -0
- package/binaries/win32-x64/swarm-sandbox-runner.exe +0 -0
- package/dist/cli/{auto-checkpoint-1z9d2jrk.js → auto-checkpoint-8hn7sczv.js} +4 -4
- package/dist/cli/{checkpoint-f8165pv4.js → checkpoint-zagm80g6.js} +8 -8
- package/dist/cli/{coder-settlement-gaby6spt.js → coder-settlement-ea9wk0fa.js} +3 -3
- package/dist/cli/{config-doctor-4wgw6nak.js → config-doctor-482f83pc.js} +7 -7
- package/dist/cli/{core-y89texpp.js → core-jev9px23.js} +1 -1
- package/dist/cli/{curator-drift-rpwrx355.js → curator-drift-tzr8cq9d.js} +5 -5
- package/dist/cli/{curator-llm-factory-1qbcj7vs.js → curator-llm-factory-vwxengt1.js} +26 -26
- package/dist/cli/{curator-tkz65fvw.js → curator-sw5w1yxn.js} +26 -26
- package/dist/cli/{dispatch-qvcztbpf.js → dispatch-h8m1jntz.js} +47 -220
- package/dist/cli/{doctor-knowledge-receipt-phase-id-11q7en6t.js → doctor-knowledge-receipt-phase-id-78hqh9ds.js} +4 -4
- package/dist/cli/{evidence-summary-service-hn7vdm45.js → evidence-summary-service-dpx7844s.js} +9 -9
- package/dist/cli/{gate-evidence-sxh3r64f.js → gate-evidence-v5fbpnfe.js} +2 -2
- package/dist/cli/{guardrail-explain-e0wbeyk1.js → guardrail-explain-020gkz5c.js} +27 -27
- package/dist/cli/{guardrail-log-gzrj46h0.js → guardrail-log-z14b98cn.js} +3 -3
- package/dist/cli/{guardrail-reset-7z62s1j5.js → guardrail-reset-cg6kfk8r.js} +26 -26
- package/dist/cli/{hive-promoter-88d95wk8.js → hive-promoter-bse7dh34.js} +26 -26
- package/dist/cli/{index-7eajwwfg.js → index-0dp2ak7d.js} +1 -1
- package/dist/cli/{index-snwj9ptc.js → index-0e49htcs.js} +1 -1
- package/dist/cli/{index-61kszszd.js → index-0whh6em0.js} +2 -2
- package/dist/cli/{index-7k9hdn0b.js → index-2mmbzyqb.js} +1 -1
- package/dist/cli/{index-y3sk68m5.js → index-4xc838p0.js} +1 -1
- package/dist/cli/{index-5102w44y.js → index-64e9z08z.js} +2 -2
- package/dist/cli/{index-0j5ggeem.js → index-6nx6qf7v.js} +1 -1
- package/dist/cli/{index-2wctq2hn.js → index-7jtxt3qp.js} +1 -1
- package/dist/cli/{index-m9g7s9ee.js → index-804rs273.js} +1 -1
- package/dist/cli/{index-c016phsk.js → index-akkskstq.js} +4 -4
- package/dist/cli/{index-yj1cwps4.js → index-b2g020d7.js} +1 -1
- package/dist/cli/{index-xj3k6x1h.js → index-b913b1yc.js} +1 -1
- package/dist/cli/{index-c937rpbm.js → index-byfk6w9a.js} +3 -3
- package/dist/cli/{index-ytms8x1h.js → index-bzeegaem.js} +2 -2
- package/dist/cli/{index-vx8a8w3b.js → index-c0tjwb5k.js} +496 -201
- package/dist/cli/{index-kap459mr.js → index-cxybg712.js} +2 -2
- package/dist/cli/{index-03ad14qc.js → index-d1z2yrwq.js} +2 -2
- package/dist/cli/{index-ffmw6af9.js → index-ddgmj923.js} +26 -26
- package/dist/cli/{index-g39cmzpj.js → index-dhkgby53.js} +2 -2
- package/dist/cli/{index-eh0sg1pz.js → index-g0we5tpv.js} +3 -3
- package/dist/cli/{index-ghjg1rxe.js → index-gd602ztc.js} +1 -1
- package/dist/cli/{index-9tes309n.js → index-hjyakvcq.js} +1 -1
- package/dist/cli/{index-rw0c6qtt.js → index-kjb143pz.js} +3 -3
- package/dist/cli/{index-a4s5yrdd.js → index-ng5n8tp0.js} +3 -3
- package/dist/cli/{index-2vtrjm19.js → index-peyrzden.js} +28 -28
- package/dist/cli/{index-7zyktm9f.js → index-ps6fyxfc.js} +5 -5
- package/dist/cli/{index-xsdphmet.js → index-q6y176gs.js} +6 -6
- package/dist/cli/{index-pnfd3s7s.js → index-qdp9ny78.js} +1 -1
- package/dist/cli/{index-emh69vk9.js → index-sndyex1t.js} +304 -166
- package/dist/cli/{index-8sqyx5rh.js → index-t6tew3pf.js} +1 -1
- package/dist/cli/{index-y8z9x87e.js → index-v71w06rr.js} +1 -1
- package/dist/cli/index.js +27 -27
- package/dist/cli/{knowledge-escalator-ejfb2e7c.js → knowledge-escalator-wah5yybk.js} +7 -7
- package/dist/cli/{knowledge-events-3fzfehwy.js → knowledge-events-akz8013r.js} +5 -5
- package/dist/cli/{knowledge-store-swxk4tr6.js → knowledge-store-hy12373e.js} +1 -1
- package/dist/cli/{knowledge-validator-0a1at9gm.js → knowledge-validator-yrqkdt1w.js} +2 -2
- package/dist/cli/{mcp-0ah7s1j0.js → mcp-0srnsd05.js} +1 -1
- package/dist/cli/{model-preflight-nfvapzyj.js → model-preflight-m3v8hn9k.js} +26 -26
- package/dist/cli/{pending-delegations-hynywgkj.js → pending-delegations-40txwk2h.js} +2 -2
- package/dist/cli/{pr-subscriptions-k86p5qcn.js → pr-subscriptions-w6n5s9c7.js} +1 -1
- package/dist/cli/{pr-workflow-gate-3ett6hjh.js → pr-workflow-gate-mx9t1p5j.js} +26 -26
- package/dist/cli/{scan-cursor-9961dhv1.js → scan-cursor-phbwfaya.js} +2 -2
- package/dist/cli/{schema-s5zbnzmv.js → schema-t1xwd728.js} +1 -1
- package/dist/cli/{scope-persistence-2w562h83.js → scope-persistence-m6qrwt3d.js} +5 -5
- package/dist/cli/{server-vrk0k61v.js → server-7pt2zhnc.js} +26 -26
- package/dist/cli/{skill-generator-bfcjzp20.js → skill-generator-pnv8efrw.js} +8 -8
- package/dist/cli/{snapshot-coordination-init-8ykpp5m6.js → snapshot-coordination-init-514wtctt.js} +26 -26
- package/dist/cli/{speckit-checkoff-3x52vw64.js → speckit-checkoff-beh1nw7v.js} +3 -3
- package/dist/cli/{worktree-collision-ownership-kjw1pqfc.js → worktree-collision-ownership-f5wca0gg.js} +2 -2
- package/dist/cli/{worktree-isolation-xdgm4ekx.js → worktree-isolation-bd6c5x8h.js} +26 -26
- package/dist/commands/recover.d.ts +1 -1
- package/dist/commands/registry.d.ts +1 -1
- package/dist/hooks/knowledge-receipt-ledger.d.ts +23 -0
- package/dist/hooks/knowledge-receipt-validator.d.ts +10 -0
- package/dist/index.js +213 -213
- package/dist/lang/backends/java.d.ts +39 -0
- package/dist/lang/default-backend.d.ts +15 -0
- package/dist/state.d.ts +48 -0
- package/dist/tools/test-runner.d.ts +31 -1
- package/dist/utils/windows-batch.d.ts +53 -0
- package/dist/workflow/session-view.d.ts +47 -0
- package/dist/workflow/stage-a-repair.d.ts +1 -0
- package/package.json +1 -1
|
@@ -13,6 +13,9 @@
|
|
|
13
13
|
* - `selectEntryPoints` scans the tree for `.java` files declaring
|
|
14
14
|
* `public static void main`.
|
|
15
15
|
* - `selectFramework` detects Spring vs Servlet from pom.xml / build.gradle.
|
|
16
|
+
* - `buildTestCommand` builds the Maven test argv via the exported
|
|
17
|
+
* `buildMavenTestCommand` (runnable wrapper first, else `mvn`), which the
|
|
18
|
+
* test-runner's legacy switch shares so both paths emit identical argv.
|
|
16
19
|
*
|
|
17
20
|
* Invariants identical to other backends — see `python.ts` and `go.ts` for
|
|
18
21
|
* the rationale; `tests/unit/lang/backend-purity.test.ts` enforces them.
|
|
@@ -60,6 +63,41 @@ declare function resolveMvnwCommand(dir: string): string;
|
|
|
60
63
|
* Maven wrapper.
|
|
61
64
|
*/
|
|
62
65
|
declare function resolveGradlewCommand(dir: string): string;
|
|
66
|
+
/**
|
|
67
|
+
* True when `filePath` is a regular file with at least one POSIX execute bit
|
|
68
|
+
* set. Uses `statSync({ throwIfNoEntry: false })` so a missing wrapper is a
|
|
69
|
+
* plain `false` rather than exception-based control flow (the same rationale
|
|
70
|
+
* as {@link wrapperExists}); any other stat failure is also treated as "not
|
|
71
|
+
* executable". Only meaningful on POSIX — Windows reports no execute bits.
|
|
72
|
+
*/
|
|
73
|
+
declare function isExecutableFile(filePath: string): boolean;
|
|
74
|
+
/**
|
|
75
|
+
* Build the Maven wrapper invocation for `dir` when a RUNNABLE wrapper exists,
|
|
76
|
+
* otherwise null. This is the single source of truth for "is there a usable
|
|
77
|
+
* Maven wrapper" — the command builders below and the test-runner's nested
|
|
78
|
+
* Maven detection both use it, so detection never accepts a wrapper the
|
|
79
|
+
* command path would not launch.
|
|
80
|
+
*
|
|
81
|
+
* - win32: only `mvnw.cmd`, launched through a validated `cmd.exe`
|
|
82
|
+
* (`resolveContainedWindowsBatchCommand`): the wrapper's realpath must stay
|
|
83
|
+
* inside `dir`, and every token (wrapper path and `args`) is rejected when it
|
|
84
|
+
* contains a cmd.exe metacharacter. A bare `mvnw.cmd` argv[0] is never
|
|
85
|
+
* emitted (spawn resolves it against PATH, not the cwd), and a POSIX-only
|
|
86
|
+
* `mvnw` is never used on win32 (it is not runnable there).
|
|
87
|
+
* - POSIX: `./mvnw` (relative to the spawn cwd, which callers set to `dir`)
|
|
88
|
+
* only when it is a regular file with an execute bit. A wrapper that lost
|
|
89
|
+
* its mode bit (zip download, Windows-authored checkout) would fail with
|
|
90
|
+
* EACCES, so it is skipped.
|
|
91
|
+
*/
|
|
92
|
+
export declare function resolveMavenWrapperCommand(dir: string, args: string[]): string[] | null;
|
|
93
|
+
/**
|
|
94
|
+
* Build the Maven test argv for `dir`: the runnable wrapper from
|
|
95
|
+
* {@link resolveMavenWrapperCommand} when there is one, otherwise `mvn` from
|
|
96
|
+
* PATH. `-Dtest=<targets>` is appended when targets are given. Shared by the
|
|
97
|
+
* Java backend's dispatch `buildTestCommand` and the test-runner's legacy
|
|
98
|
+
* (`SWARM_LANG_BACKEND=legacy`) switch so both paths emit identical argv.
|
|
99
|
+
*/
|
|
100
|
+
export declare function buildMavenTestCommand(dir: string, targets?: string[]): string[];
|
|
63
101
|
/**
|
|
64
102
|
* Build the Java backend from the registered profile.
|
|
65
103
|
*/
|
|
@@ -69,6 +107,7 @@ export declare const _internals: {
|
|
|
69
107
|
isMainClass: typeof isMainClass;
|
|
70
108
|
detectFramework: typeof detectFramework;
|
|
71
109
|
wrapperExists: typeof wrapperExists;
|
|
110
|
+
isExecutableFile: typeof isExecutableFile;
|
|
72
111
|
resolveMvnwCommand: typeof resolveMvnwCommand;
|
|
73
112
|
resolveGradlewCommand: typeof resolveGradlewCommand;
|
|
74
113
|
MAX_ENTRY_POINT_ENTRIES: typeof MAX_ENTRY_POINT_ENTRIES;
|
|
@@ -34,6 +34,21 @@ export declare function defaultSelectTestFramework(profile: LanguageProfile, dir
|
|
|
34
34
|
* `opts.scope` defaults to `'all'`; `opts.coverage` defaults to `false`.
|
|
35
35
|
* Returns null when the framework name is not in the supported set.
|
|
36
36
|
*/
|
|
37
|
+
/**
|
|
38
|
+
* Build the Gradle test argv for `dir` (issue #3040). On win32 with a
|
|
39
|
+
* `gradlew.bat` wrapper, route through the contained cmd.exe launcher
|
|
40
|
+
* (`resolveContainedWindowsBatchCommand`) — Bun resolves a bare executable
|
|
41
|
+
* name against PATH only, never the spawn cwd, so a bare `gradlew.bat` can
|
|
42
|
+
* never start. Falls back to plain `gradle` from PATH when the helper rejects
|
|
43
|
+
* the wrapper or an argument (including a token ending in a backslash, which
|
|
44
|
+
* the launcher's quoting would mangle — the same guard `buildMavenTestCommand`
|
|
45
|
+
* carries). When `gradlew.bat` is absent, the historical chain applies on ANY
|
|
46
|
+
* platform — `./gradlew` when a `gradlew` file exists (yes, even on win32,
|
|
47
|
+
* preserving the pre-#3040 behavior), else `gradle`. Shared by
|
|
48
|
+
* `defaultBuildTestCommand` and the test-runner's legacy
|
|
49
|
+
* (`SWARM_LANG_BACKEND=legacy`) switch so both routes emit identical argv.
|
|
50
|
+
*/
|
|
51
|
+
export declare function buildGradleTestCommand(dir: string, targets?: string[]): string[];
|
|
37
52
|
export declare function defaultBuildTestCommand(profile: LanguageProfile, framework: string, files: string[], dir?: string, opts?: BuildTestCommandOpts): string[] | null;
|
|
38
53
|
export declare function buildNativeTargetCommand(target: NativeTestTarget): string[];
|
|
39
54
|
/**
|
package/dist/state.d.ts
CHANGED
|
@@ -844,6 +844,28 @@ export declare const swarmState: {
|
|
|
844
844
|
modelID?: string;
|
|
845
845
|
providerID?: string;
|
|
846
846
|
}>;
|
|
847
|
+
/**
|
|
848
|
+
* Issue #3036: dispatch lineage — child session id → the session id of the
|
|
849
|
+
* architect whose Task call dispatched that child. Populated authoritatively
|
|
850
|
+
* by the delegation gate's taskMetadata hook (host-observed pair; the parent
|
|
851
|
+
* id always comes from `part.sessionID`, never from tool-controlled
|
|
852
|
+
* metadata) and best-effort by injection-time pending adoption at child
|
|
853
|
+
* registration. Read by the knowledge_receipt tool to authorize a child's
|
|
854
|
+
* filing against its dispatching architect's receipt-membership stamps.
|
|
855
|
+
* Bounded via {@link MAX_TRACKED_DISPATCH_PARENTS} (AGENTS.md invariant 8);
|
|
856
|
+
* cleared with the other session-keyed maps on reset and end-of-session.
|
|
857
|
+
*/
|
|
858
|
+
dispatchParentByChildSession: Map<string, string>;
|
|
859
|
+
/**
|
|
860
|
+
* Issue #3036: injection-time dispatch facts awaiting child registration.
|
|
861
|
+
* Recorded when the architect-side delegate-directive injection commits a
|
|
862
|
+
* membership (parent session + delegated target role), consumed when a
|
|
863
|
+
* child session with a matching role is created before its taskMetadata
|
|
864
|
+
* event arrives. Entries expire via
|
|
865
|
+
* {@link PENDING_DISPATCH_AUTHORIZATION_TTL_MS} and the queue is capped by
|
|
866
|
+
* {@link MAX_TRACKED_DISPATCH_PARENTS}.
|
|
867
|
+
*/
|
|
868
|
+
pendingDispatchAuthorizations: PendingDispatchAuthorization[];
|
|
847
869
|
/** Per-session guardrail state — keyed by sessionID */
|
|
848
870
|
agentSessions: Map<string, AgentSessionState>;
|
|
849
871
|
/** In-flight rehydration promises — awaited by rehydrateState before clearing agentSessions */
|
|
@@ -883,6 +905,32 @@ export declare const MAX_REVIEWER_SCOPE_GENERATIONS = 256;
|
|
|
883
905
|
export declare const MAX_REVIEWER_SCOPE_OWNERSHIP_HISTORY = 256;
|
|
884
906
|
/** Generation expiry never exceeds the parent session's normal idle TTL. */
|
|
885
907
|
export declare const REVIEWER_SCOPE_GENERATION_TTL_MS = 7200000;
|
|
908
|
+
/**
|
|
909
|
+
* Issue #3036: dispatch-lineage bounds (AGENTS.md invariant 8). Both the
|
|
910
|
+
* child→parent map and the pending-authorization queue are capped and
|
|
911
|
+
* FIFO-evicted at the same limit; pendings additionally expire so an
|
|
912
|
+
* unconsumed dispatch fact cannot be adopted much later.
|
|
913
|
+
*/
|
|
914
|
+
export declare const MAX_TRACKED_DISPATCH_PARENTS = 200;
|
|
915
|
+
export declare const PENDING_DISPATCH_AUTHORIZATION_TTL_MS = 600000;
|
|
916
|
+
/** Issue #3036: an injection-time dispatch fact awaiting child registration. */
|
|
917
|
+
export interface PendingDispatchAuthorization {
|
|
918
|
+
parentSessionId: string;
|
|
919
|
+
agentName: string;
|
|
920
|
+
recordedAt: number;
|
|
921
|
+
}
|
|
922
|
+
/**
|
|
923
|
+
* Issue #3036: record an injection-time dispatch fact (parent session +
|
|
924
|
+
* delegated target role) so the child session created for that dispatch can
|
|
925
|
+
* adopt its dispatch parent at registration time if its taskMetadata event
|
|
926
|
+
* has not landed yet. Bounded FIFO; never throws.
|
|
927
|
+
*/
|
|
928
|
+
export declare function recordPendingDispatchAuthorization(parentSessionId: string, agentName: string): void;
|
|
929
|
+
export declare function setDispatchParent(childSessionId: string, parentSessionId: string): void;
|
|
930
|
+
/** Issue #3036: resolve a child session's registered dispatch parent, if any. */
|
|
931
|
+
export declare function resolveDispatchParent(childSessionId: string): string | undefined;
|
|
932
|
+
/** Issue #3036: clear dispatch lineage for a session (child-keyed and parent-valued). */
|
|
933
|
+
export declare function clearDispatchLineageForSession(sessionId: string): void;
|
|
886
934
|
/** Begin one exact coder generation after the full blocking before-chain passes. */
|
|
887
935
|
export declare function startReviewerScopeGeneration(input: {
|
|
888
936
|
parentSessionID: string;
|
|
@@ -16,6 +16,7 @@ export declare const MAX_SAFE_SOURCE_FILES = 1;
|
|
|
16
16
|
export declare const MAX_RAW_FILE_ENTRIES = 512;
|
|
17
17
|
export declare const MAX_FILE_PATH_LENGTH = 4096;
|
|
18
18
|
export declare const MAX_GRAPH_FILE_BYTES: number;
|
|
19
|
+
export declare const MAX_MAVEN_MODULE_PROBE_ENTRIES = 100;
|
|
19
20
|
/**
|
|
20
21
|
* Estimate the fan-out (number of unique test files) for given source files
|
|
21
22
|
* by reading the cached impact map without spawning a subprocess.
|
|
@@ -161,7 +162,35 @@ export declare function parseTestOutputViaDispatch(framework: TestFramework, out
|
|
|
161
162
|
totals: TestTotals;
|
|
162
163
|
coveragePercent?: number;
|
|
163
164
|
} | null>;
|
|
164
|
-
|
|
165
|
+
/**
|
|
166
|
+
* Resolve the nearest Maven module directory under `root`.
|
|
167
|
+
*
|
|
168
|
+
* When `files` is provided, each file is resolved against `root`, paths
|
|
169
|
+
* outside `root` are dropped, and the directory containing each remaining file
|
|
170
|
+
* is walked upward toward `root` until a `pom.xml` is found. The first match
|
|
171
|
+
* wins (files are tried in the given order; later files are consulted only
|
|
172
|
+
* when an earlier one resolves to no module).
|
|
173
|
+
*
|
|
174
|
+
* When `files` is absent/empty, the immediate entries of `root` are probed one
|
|
175
|
+
* level deep for a `pom.xml`: hidden entries (any name starting with `.`) and
|
|
176
|
+
* `node_modules` are skipped, the remaining entries are sorted by name and at
|
|
177
|
+
* most {@link MAX_MAVEN_MODULE_PROBE_ENTRIES} of them are inspected.
|
|
178
|
+
*
|
|
179
|
+
* Containment is checked on canonical paths: a candidate module directory is
|
|
180
|
+
* accepted only when its realpath stays inside the realpath of `root`, so a
|
|
181
|
+
* symlink or junction that leads outside the project is skipped (the walk /
|
|
182
|
+
* probe continues with the next candidate). If `root` itself cannot be
|
|
183
|
+
* realpath'd, no module is resolved (fail closed). The returned path is the
|
|
184
|
+
* LEXICAL module path under `root`.
|
|
185
|
+
*
|
|
186
|
+
* Known limitations:
|
|
187
|
+
* - Multi-module reactor: nearest `pom.xml` wins. A child module that depends
|
|
188
|
+
* on sibling reactor modules may require the aggregator pom (out of scope).
|
|
189
|
+
* - `scope:'target'` native execution remains rooted at the project root; this
|
|
190
|
+
* resolver does not change native target handling.
|
|
191
|
+
*/
|
|
192
|
+
export declare function resolveMavenModuleDir(root: string, files?: string[]): string | null;
|
|
193
|
+
export declare function detectTestFramework(cwd: string, files?: string[]): Promise<TestFramework>;
|
|
165
194
|
/**
|
|
166
195
|
* Returns true when `basename` matches a language-specific test file naming
|
|
167
196
|
* convention that is NOT captured by the compound-extension or dot-separated
|
|
@@ -207,6 +236,7 @@ export declare const _internals: {
|
|
|
207
236
|
existsSync: typeof fs.existsSync;
|
|
208
237
|
readdirSync: typeof fs.readdirSync;
|
|
209
238
|
readFileSync: typeof fs.readFileSync;
|
|
239
|
+
realpathSync: typeof fs.realpathSync;
|
|
210
240
|
resolveLocalNodeTool: typeof resolveLocalNodeTool;
|
|
211
241
|
bunSpawn: typeof bunSpawn;
|
|
212
242
|
buildNativeTargetCommand: typeof buildNativeTargetCommand;
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Safe launch of a Windows batch wrapper (`.cmd` / `.bat`) through a
|
|
3
|
+
* validated `cmd.exe`.
|
|
4
|
+
*
|
|
5
|
+
* Node and Bun cannot spawn a batch file directly (EINVAL since the
|
|
6
|
+
* CVE-2024-27980 hardening), and a bare wrapper name such as `mvnw.cmd` is
|
|
7
|
+
* resolved against PATH only — never against the spawn `cwd`. The supported
|
|
8
|
+
* shape is `[<cmd.exe>, '/d', '/s', '/v:off', '/c', 'call "<abs>" "<arg>" ...']`
|
|
9
|
+
* spawned with `windowsVerbatimArguments: true`, so the pre-quoted tail reaches
|
|
10
|
+
* cmd.exe unmodified (the same pattern `src/tools/lint.ts` and
|
|
11
|
+
* `src/tools/pkg-audit.ts` use).
|
|
12
|
+
*
|
|
13
|
+
* Every token (the canonical wrapper path and each argument) is rejected when
|
|
14
|
+
* it contains a cmd.exe metacharacter instead of being escaped, so a caller
|
|
15
|
+
* never builds a command line cmd.exe could re-interpret. Callers must treat a
|
|
16
|
+
* `null` result as "do not launch the wrapper" and fall back to a non-batch
|
|
17
|
+
* command.
|
|
18
|
+
*
|
|
19
|
+
* Extracted from `src/tools/lint.ts` without behaviour change. The functions
|
|
20
|
+
* take their filesystem/environment dependencies explicitly so each caller
|
|
21
|
+
* keeps its own DI seam: lint passes thunks over `lint._internals`, while
|
|
22
|
+
* other callers use this module's `_internals` (the default).
|
|
23
|
+
*/
|
|
24
|
+
export declare const WINDOWS_BATCH_WRAPPER_EXTENSIONS: readonly [".cmd", ".bat"];
|
|
25
|
+
/** Filesystem/environment dependencies of the batch-launch helpers. */
|
|
26
|
+
export interface WindowsBatchDeps {
|
|
27
|
+
platform: () => NodeJS.Platform;
|
|
28
|
+
comSpec: () => string | undefined;
|
|
29
|
+
realpathSync: (candidate: string) => string;
|
|
30
|
+
statSync: (candidate: string) => {
|
|
31
|
+
isFile(): boolean;
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* Build the constrained `cmd.exe /d /s /v:off /c call "<wrapper>" "<arg>"...`
|
|
36
|
+
* argv for an already-located batch wrapper, or null when the interpreter
|
|
37
|
+
* cannot be resolved, the wrapper is not a regular `.cmd`/`.bat` file, or any
|
|
38
|
+
* token contains a cmd.exe metacharacter.
|
|
39
|
+
*/
|
|
40
|
+
export declare function buildWindowsBatchCommand(wrapperPath: string, args: string[], deps?: WindowsBatchDeps): string[] | null;
|
|
41
|
+
/**
|
|
42
|
+
* Build the launcher argv for `<cwd>/<fileName>` only on win32, and only when
|
|
43
|
+
* the wrapper's canonical path stays inside the canonical `cwd` (a symlink or
|
|
44
|
+
* junction that escapes `cwd` is rejected). Returns null otherwise.
|
|
45
|
+
*/
|
|
46
|
+
export declare function resolveContainedWindowsBatchCommand(cwd: string, fileName: string, args: string[], deps?: WindowsBatchDeps): string[] | null;
|
|
47
|
+
/**
|
|
48
|
+
* True when `command` is a cmd.exe launcher that must be spawned with
|
|
49
|
+
* `windowsVerbatimArguments: true` (win32 only).
|
|
50
|
+
*/
|
|
51
|
+
export declare function isWindowsCommandInterpreterLaunch(command: readonly string[], platform?: NodeJS.Platform): boolean;
|
|
52
|
+
/** Default dependencies (live process/filesystem); a DI seam for tests. */
|
|
53
|
+
export declare const _internals: WindowsBatchDeps;
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { type TaskWorkflowSnapshot } from '../gate-evidence.js';
|
|
2
|
+
import { type AgentSessionState, type TaskWorkflowState } from '../state.js';
|
|
3
|
+
/**
|
|
4
|
+
* Session-view refresh for Stage A recovery writers (issue #3043).
|
|
5
|
+
*
|
|
6
|
+
* The Stage B settlement loop filters on the session's in-memory
|
|
7
|
+
* `taskWorkflowStates` view while dispatch admission reads the durable
|
|
8
|
+
* workflow evidence, so a recovery writer that advances the durable evidence
|
|
9
|
+
* WITHOUT refreshing the calling session's in-memory twin leaves every later
|
|
10
|
+
* verdict in that session silently skipped — the #3032 split-brain class.
|
|
11
|
+
* The blocked-start arm was the last uncovered shape: `blocked` is
|
|
12
|
+
* at-or-above the durable eligible states, so PR #3038's consumer-side
|
|
13
|
+
* `isRepairableStageBView` guard deliberately refuses to repair it (it
|
|
14
|
+
* protects `update_task_status`'s permissive fallback), and only the WRITER —
|
|
15
|
+
* whose own audited repair write is the authority that the blocked label was
|
|
16
|
+
* drift, not a real block — may refresh it.
|
|
17
|
+
*/
|
|
18
|
+
/**
|
|
19
|
+
* Apply a durable workflow snapshot to one session's in-memory view of one
|
|
20
|
+
* task. The exact mutation steps of the update_task_status recovery legs'
|
|
21
|
+
* `syncCallerWorkflowFromEvidence` (extracted so the clear-set can never
|
|
22
|
+
* drift between the two surfaces); the caller owns the refresh DECISION.
|
|
23
|
+
* Pure in-memory bookkeeping aligned to a durable write the caller already
|
|
24
|
+
* made or verified — it must never throw into the recovery result.
|
|
25
|
+
*/
|
|
26
|
+
export declare function applySessionWorkflowView(session: AgentSessionState, taskId: string, workflow: TaskWorkflowSnapshot): void;
|
|
27
|
+
/** States a Stage A recovery writer can leave durable evidence at. */
|
|
28
|
+
export type StageARecoveredState = 'pre_check_passed' | 'reviewer_run' | 'tests_run';
|
|
29
|
+
export declare function isStageARecoveredState(state: string): state is StageARecoveredState;
|
|
30
|
+
/**
|
|
31
|
+
* Whether a session's in-memory view may be refreshed to `recoveredState`
|
|
32
|
+
* after a Stage A recovery writer committed (or verified) that durable state.
|
|
33
|
+
*
|
|
34
|
+
* One ordered rule:
|
|
35
|
+
* - absent / `rework_required` / `blocked` views always refresh — the first
|
|
36
|
+
* two mirror the #3038 consumer-side guard's forward-progress exceptions;
|
|
37
|
+
* `blocked` is the #3043 arm and is repairable HERE only, because this
|
|
38
|
+
* predicate runs at the writer that just proved the blocked label was
|
|
39
|
+
* drift (the consumer-side guard keeps refusing it).
|
|
40
|
+
* - otherwise refresh only when the view is not barrier-ahead-or-terminal
|
|
41
|
+
* (`tests_run` / `closed` / `complete` are never downgraded — a map ahead
|
|
42
|
+
* of durable is the legitimate settlement-barrier shape, and terminal
|
|
43
|
+
* completions are never un-completed in memory) AND ranks below the
|
|
44
|
+
* recovered state (the map lags durable; refreshing is forward, not a
|
|
45
|
+
* downgrade).
|
|
46
|
+
*/
|
|
47
|
+
export declare function shouldRefreshStageARecoveryView(view: TaskWorkflowState | undefined, recoveredState: StageARecoveredState): boolean;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "opencode-swarm",
|
|
3
|
-
"version": "7.188.
|
|
3
|
+
"version": "7.188.9",
|
|
4
4
|
"description": "Architect-centric agentic swarm plugin for OpenCode - hub-and-spoke orchestration with SME consultation, code generation, and QA review",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|