opencode-swarm 7.175.0 → 7.176.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/binaries/win32-arm64/swarm-sandbox-runner.exe +0 -0
- package/binaries/win32-x64/swarm-sandbox-runner.exe +0 -0
- package/dist/cli/{coder-settlement-f2n9yp7a.js → coder-settlement-y3ftsdje.js} +10 -10
- package/dist/cli/{config-doctor-zcyz614n.js → config-doctor-3x9d5y3w.js} +2 -2
- package/dist/cli/{core-jar8cmzf.js → core-hf9pjm7y.js} +3 -3
- package/dist/cli/{curation-policy-e5p147bb.js → curation-policy-8h25hyf8.js} +4 -4
- package/dist/cli/{curator-drift-x3tt8apf.js → curator-drift-qxgs5ee4.js} +2 -2
- package/dist/cli/{curator-llm-factory-rc7cqtx8.js → curator-llm-factory-rs8zyytn.js} +33 -33
- package/dist/cli/{curator-3xfz7wdp.js → curator-pf4n52b1.js} +33 -33
- package/dist/cli/{evidence-summary-service-bpe04ngj.js → evidence-summary-service-t4nnvgyz.js} +14 -14
- package/dist/cli/{gate-evidence-pyzzafp3.js → gate-evidence-d6wmarwz.js} +6 -6
- package/dist/cli/{guardrail-explain-ncrw7k8h.js → guardrail-explain-x8n8dtq6.js} +34 -34
- package/dist/cli/{guardrail-log-nn2t8xyd.js → guardrail-log-ehwt0w51.js} +6 -6
- package/dist/cli/{guardrail-reset-3c3c7e5e.js → guardrail-reset-ceqcapzm.js} +33 -33
- package/dist/cli/{hive-promoter-xfbabpnm.js → hive-promoter-9dgmk5nq.js} +33 -33
- package/dist/cli/{index-jn3m9s61.js → index-2xm1xtqy.js} +1 -1
- package/dist/cli/{index-a1w58b47.js → index-4ddpvd5c.js} +32 -0
- package/dist/cli/{index-ar3ve24w.js → index-509g4m8s.js} +70 -70
- package/dist/cli/{index-0hgmsyfp.js → index-549wxbe1.js} +1 -1
- package/dist/cli/{index-yk3es7m2.js → index-569pn3vz.js} +4 -4
- package/dist/cli/{index-4rm5saxs.js → index-580v9v50.js} +3 -3
- package/dist/cli/{index-qz6ee73z.js → index-68nc7zev.js} +3 -3
- package/dist/cli/{index-c60t3sw6.js → index-9fnjkqsr.js} +1 -1
- package/dist/cli/{index-jgkva4r4.js → index-bym86sb4.js} +1 -1
- package/dist/cli/{index-zz40vfbz.js → index-c45zvjeg.js} +2 -2
- package/dist/cli/{index-20q20gpd.js → index-cfjbrcv7.js} +3 -3
- package/dist/cli/{index-zpygn1tn.js → index-crx99j5b.js} +3 -3
- package/dist/cli/{index-hdwdapp6.js → index-dn5kkjfv.js} +35 -35
- package/dist/cli/{index-bmk77mpq.js → index-dq0fbb2g.js} +4 -4
- package/dist/cli/{index-hqmr21qx.js → index-eawhasqk.js} +1 -1
- package/dist/cli/{index-gtej1br8.js → index-fh8jh5n1.js} +5 -5
- package/dist/cli/{index-6yqszgky.js → index-g9pqwf7v.js} +3 -3
- package/dist/cli/{index-vqjkr1kd.js → index-gtjx3q5h.js} +1 -1
- package/dist/cli/{index-nr96hbpy.js → index-hvt8902r.js} +5 -5
- package/dist/cli/{index-z2deqhpp.js → index-n1tcj1q7.js} +1 -1
- package/dist/cli/{index-vt9a5rbg.js → index-n1wean2y.js} +8 -8
- package/dist/cli/{index-ppb5krpy.js → index-n5aa7f72.js} +2 -2
- package/dist/cli/{index-ddvva9fn.js → index-pd3yg1mh.js} +4 -4
- package/dist/cli/{index-n5jac8z9.js → index-r3ftkdvn.js} +1 -1
- package/dist/cli/{index-tr9jz898.js → index-rekx0gq7.js} +3 -3
- package/dist/cli/{index-hej0z0sm.js → index-rm1k8ekt.js} +33 -33
- package/dist/cli/{index-m6bsy0jb.js → index-s0w34gp3.js} +4 -4
- package/dist/cli/{index-mat5rawf.js → index-s1cm0jre.js} +2 -1
- package/dist/cli/{index-cpgh76bk.js → index-t4kwsbhj.js} +1 -1
- package/dist/cli/{index-j1yd2gbz.js → index-t5t6cqfb.js} +4 -4
- package/dist/cli/{index-2dv07mw2.js → index-twymcfj9.js} +1 -1
- package/dist/cli/{index-d0wq7paf.js → index-wdcsy80q.js} +6 -6
- package/dist/cli/{index-8bbhh3kx.js → index-wer28675.js} +7 -7
- package/dist/cli/{index-96hz14wr.js → index-wn00ra10.js} +2 -2
- package/dist/cli/{index-9gpe25nr.js → index-wpae4r9j.js} +5 -5
- package/dist/cli/{index-98r0bh1c.js → index-z9nzrjf7.js} +1 -1
- package/dist/cli/{index-fzvh6trw.js → index-zpa6ywts.js} +9 -9
- package/dist/cli/{index-0mhftbpp.js → index-zz7gzw57.js} +1 -1
- package/dist/cli/index.js +34 -34
- package/dist/cli/{knowledge-escalator-2zjpwg0q.js → knowledge-escalator-0eyjbhap.js} +12 -12
- package/dist/cli/{knowledge-events-gp2ckzqm.js → knowledge-events-64k22qmf.js} +10 -10
- package/dist/cli/{knowledge-link-s77cyqxk.js → knowledge-link-yx57s7zb.js} +3 -3
- package/dist/cli/{knowledge-store-kd88k067.js → knowledge-store-q3k2zf8a.js} +4 -4
- package/dist/cli/{knowledge-validator-22t16mba.js → knowledge-validator-ywbk1gpw.js} +6 -6
- package/dist/cli/{mcp-1fjc89yp.js → mcp-yas626k0.js} +1 -1
- package/dist/cli/{pending-delegations-k4hfqz12.js → pending-delegations-91a6nb8z.js} +6 -6
- package/dist/cli/{pr-subscriptions-8g6w41vz.js → pr-subscriptions-dyn9hn9g.js} +6 -6
- package/dist/cli/{pr-workflow-gate-kb3e709n.js → pr-workflow-gate-xwz3f6zm.js} +33 -33
- package/dist/cli/{runner-nzppg2ky.js → runner-j4hrfyve.js} +4 -4
- package/dist/cli/{scan-cursor-erm49azh.js → scan-cursor-etrpan51.js} +7 -7
- package/dist/cli/{schema-kts10txe.js → schema-aarfgdn3.js} +1 -1
- package/dist/cli/{scope-persistence-krnvsmsz.js → scope-persistence-j0vzwybd.js} +12 -12
- package/dist/cli/{server-9bqh036q.js → server-rhpwneb6.js} +33 -33
- package/dist/cli/{skill-generator-7q75h2kr.js → skill-generator-m6yrxy2s.js} +14 -14
- package/dist/cli/{snapshot-coordination-init-bw9mn21x.js → snapshot-coordination-init-1yn3fyt4.js} +33 -33
- package/dist/cli/{telemetry-7bk8ps5p.js → telemetry-1cfatyt0.js} +1 -1
- package/dist/cli/{workspace-snapshot-6aw002e8.js → workspace-snapshot-07rzjg7s.js} +3 -3
- package/dist/cli/{worktree-collision-ownership-ajagwzh8.js → worktree-collision-ownership-g6bjm090.js} +9 -9
- package/dist/cli/{worktree-isolation-rmqp04fx.js → worktree-isolation-6kebmn1t.js} +33 -33
- package/dist/index.js +504 -504
- package/dist/observability/startup-contract.d.ts +134 -0
- package/package.json +2 -1
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The startup and first-use latency contract (issue #2670).
|
|
3
|
+
*
|
|
4
|
+
* Stage model — every interval the issue names, measured and emitted
|
|
5
|
+
* SEPARATELY as single-line `STARTUP-CONTRACT <json>` rows on stdout:
|
|
6
|
+
*
|
|
7
|
+
* import performance.now() at the end of src/index.ts module
|
|
8
|
+
* evaluation (ms since performance.timeOrigin, i.e.
|
|
9
|
+
* process start). The fresh-process harness child's own
|
|
10
|
+
* external import timer additionally includes its
|
|
11
|
+
* node:perf_hooks import and preload; the two values are
|
|
12
|
+
* intentionally not expected to be identical.
|
|
13
|
+
* server server() entry -> resolution (the plugin wrapper in
|
|
14
|
+
* src/index.ts).
|
|
15
|
+
* first_turn time from server resolution until the FIRST
|
|
16
|
+
* experimental.chat.messages.transform invocation
|
|
17
|
+
* settles (success or rejection), once per process.
|
|
18
|
+
* first_tool time from server resolution until the FIRST tool
|
|
19
|
+
* execute settles (success or rejection), once per
|
|
20
|
+
* process, labeled with the tool name.
|
|
21
|
+
* readiness queue_settled: the wrapper-owned post-resolution queue
|
|
22
|
+
* has fully drained (every scheduled task settled),
|
|
23
|
+
* measured from drain scheduling. Optional work NEVER
|
|
24
|
+
* gates manifest delivery (AGENTS.md invariant 1).
|
|
25
|
+
* optional_task per-task outcome rows: task name, `completed|failed`,
|
|
26
|
+
* duration from drain start; failed rows carry a bounded
|
|
27
|
+
* error string (<=200 chars, no stack, single line).
|
|
28
|
+
*
|
|
29
|
+
* Emission is gated behind OPENCODE_SWARM_DEBUG=1 exactly like
|
|
30
|
+
* src/utils/logger.ts — ZERO contract rows appear with the env var unset
|
|
31
|
+
* (no chat-visible noise, invariant 10; asserted by the frozen acceptance
|
|
32
|
+
* checks' debug-off probe and the unit suite).
|
|
33
|
+
*
|
|
34
|
+
* All collectors are in-memory only: no filesystem writes, no awaits added
|
|
35
|
+
* to any init path, no new module-load side effects beyond one
|
|
36
|
+
* performance.now() capture (invariant 1). Per-boot state resets on every
|
|
37
|
+
* server() entry so repeated boots in one process (tests) stay coherent;
|
|
38
|
+
* the import mark is captured once per process.
|
|
39
|
+
*
|
|
40
|
+
* The advisory counter is a STARTUP-window counter: the window opens at
|
|
41
|
+
* server entry and closes at queue settle (or at server resolution when no
|
|
42
|
+
* queue is scheduled) and never re-opens — late-session advisories never
|
|
43
|
+
* contribute to `queue_settled.advisories`.
|
|
44
|
+
*/
|
|
45
|
+
type PostResolutionTaskLike = () => void | Promise<void>;
|
|
46
|
+
interface StartupContractState {
|
|
47
|
+
importMarkMs: number | null;
|
|
48
|
+
serverStartMark: number | null;
|
|
49
|
+
serverResolvedMark: number | null;
|
|
50
|
+
serverMs: number | null;
|
|
51
|
+
queueScheduledAt: number | null;
|
|
52
|
+
queuePending: number;
|
|
53
|
+
queueTasks: number;
|
|
54
|
+
queueCompleted: number;
|
|
55
|
+
queueFailed: number;
|
|
56
|
+
queueSettled: boolean;
|
|
57
|
+
queueSettledMs: number | null;
|
|
58
|
+
advisoryCount: number;
|
|
59
|
+
advisoryWindowOpen: boolean;
|
|
60
|
+
firstTurnDone: boolean;
|
|
61
|
+
firstToolDone: boolean;
|
|
62
|
+
firstToolName: string | null;
|
|
63
|
+
firstTurnMs: number | null;
|
|
64
|
+
firstToolMs: number | null;
|
|
65
|
+
}
|
|
66
|
+
/** Capture the import-stage mark. Called once at src/index.ts module scope. */
|
|
67
|
+
export declare function markStartupImportComplete(): void;
|
|
68
|
+
/**
|
|
69
|
+
* Begin the server-interval and open the startup advisory window. Resets
|
|
70
|
+
* per-boot state (the import mark persists). Called at server() entry.
|
|
71
|
+
*/
|
|
72
|
+
export declare function beginStartupServerInterval(): void;
|
|
73
|
+
/** Resolve the server interval and emit the init row. Called just before the wrapper returns its hooks. */
|
|
74
|
+
export declare function endStartupServerInterval(): void;
|
|
75
|
+
/**
|
|
76
|
+
* Record that optional tasks were scheduled onto the post-resolution queue:
|
|
77
|
+
* captures the settle-interval origin. Task and pending counts are owned by
|
|
78
|
+
* the wrapper (one increment per wrapped task, one decrement per settle), so
|
|
79
|
+
* late-appended tasks are accounted correctly.
|
|
80
|
+
*/
|
|
81
|
+
export declare function noteQueueScheduled(): void;
|
|
82
|
+
/**
|
|
83
|
+
* Wrap one post-resolution task so its settle outcome is recorded. Settle
|
|
84
|
+
* tracking is try/finally-structured: a synchronous throw and an async
|
|
85
|
+
* rejection both record and re-raise, preserving the drain loop's existing
|
|
86
|
+
* non-fatal catch semantics (src/index.ts). Tasks appended to the array
|
|
87
|
+
* after a settle still get outcome rows (bounded late-task behavior).
|
|
88
|
+
*/
|
|
89
|
+
export declare function wrapPostResolutionTask(task: PostResolutionTaskLike): PostResolutionTaskLike;
|
|
90
|
+
/**
|
|
91
|
+
* Observe the FIRST invocation of a host-facing handler (chat transform or
|
|
92
|
+
* tool execute) without changing it: returns the handler's own result /
|
|
93
|
+
* promise untouched and attaches a detached observation that records the
|
|
94
|
+
* first-use interval when the invocation SETTLES (success or rejection —
|
|
95
|
+
* an errored first call is still a first use). No extra awaits on the
|
|
96
|
+
* observed path, no writes to any argument, no rebinding.
|
|
97
|
+
*/
|
|
98
|
+
export declare function withStartupFirstUseTracking<Args extends unknown[], Result>(stage: 'first_turn' | 'first_tool', label: string | undefined, handler: (...args: Args) => Result): (...args: Args) => Result;
|
|
99
|
+
/**
|
|
100
|
+
* Tool-execute specialization of the first-use observation with a FIXED
|
|
101
|
+
* two-parameter signature: the plugin's ToolDefinition.execute contract is
|
|
102
|
+
* `(args, ctx) => ...`, and the registration-convention tests assert
|
|
103
|
+
* `execute.length >= 2` on tool definitions. The wrapper still returns the
|
|
104
|
+
* wrapped execute's own result untouched and records the interval when the
|
|
105
|
+
* invocation settles (success or rejection).
|
|
106
|
+
*/
|
|
107
|
+
export declare function withStartupFirstToolTracking<Args, Result>(name: string, execute: (args: Args, ctx: unknown) => Result): (args: Args, ctx: unknown) => Result;
|
|
108
|
+
/**
|
|
109
|
+
* Count a startup-window advisory (readiness warning). Called from
|
|
110
|
+
* warning-buffer's addDeferredWarning; the window opens at server entry
|
|
111
|
+
* and closes at queue settle (never re-opens), so late-session advisories
|
|
112
|
+
* never contribute.
|
|
113
|
+
*/
|
|
114
|
+
export declare function noteStartupAdvisory(): void;
|
|
115
|
+
/**
|
|
116
|
+
* The collected contract state, as a structured report.
|
|
117
|
+
*
|
|
118
|
+
* @internal Unit-test seam and future surfaces; not a public API.
|
|
119
|
+
*/
|
|
120
|
+
export declare function buildStartupContractReport(): StartupContractState;
|
|
121
|
+
/**
|
|
122
|
+
* DI seam for testability (repo convention; see src/utils/logger.ts).
|
|
123
|
+
* Internal calls route through `_internals` so tests can inject a
|
|
124
|
+
* deterministic performance clock and capture emissions without
|
|
125
|
+
* mock.module.
|
|
126
|
+
*/
|
|
127
|
+
export declare const _internals: {
|
|
128
|
+
performance: {
|
|
129
|
+
now: () => number;
|
|
130
|
+
};
|
|
131
|
+
isDebugEnabled: () => boolean;
|
|
132
|
+
emitLine: (line: string) => void;
|
|
133
|
+
};
|
|
134
|
+
export {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "opencode-swarm",
|
|
3
|
-
"version": "7.
|
|
3
|
+
"version": "7.176.0",
|
|
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",
|
|
@@ -112,6 +112,7 @@
|
|
|
112
112
|
"prepare": "bun run build",
|
|
113
113
|
"repro:704": "node scripts/repro-704.mjs",
|
|
114
114
|
"repro:2669": "node scripts/repro-2669.mjs",
|
|
115
|
+
"repro:2670": "node scripts/repro-2670.mjs",
|
|
115
116
|
"repro:1144": "bun scripts/repro-1144.mjs",
|
|
116
117
|
"repro:1873": "bun build scripts/repro-1873-entry.ts --outdir dist-build-test/repro-1873 --target node --format esm && node scripts/repro-1873.mjs",
|
|
117
118
|
"repro:2487": "bun build scripts/repro-2487-parity-entry.ts --outdir dist-build-test/repro-2487 --target node --format esm && node scripts/repro-2487-parity.mjs",
|