opencode-swarm 7.188.2 → 7.188.3

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.
Files changed (92) hide show
  1. package/binaries/win32-arm64/swarm-sandbox-runner.exe +0 -0
  2. package/binaries/win32-x64/swarm-sandbox-runner.exe +0 -0
  3. package/dist/cli/{auto-checkpoint-e4r8nfq5.js → auto-checkpoint-9scxvjvr.js} +7 -7
  4. package/dist/cli/{checkpoint-ejm8n9y5.js → checkpoint-rq5eqyft.js} +12 -12
  5. package/dist/cli/{coder-settlement-hped4xgs.js → coder-settlement-9rkvamnp.js} +8 -8
  6. package/dist/cli/{config-doctor-1qp1jmz4.js → config-doctor-ewbdfafa.js} +11 -11
  7. package/dist/cli/{core-j5yff7rq.js → core-ytxbej6s.js} +1 -1
  8. package/dist/cli/{curation-policy-v64ctcbd.js → curation-policy-n5kzg460.js} +5 -5
  9. package/dist/cli/{curator-jf60p665.js → curator-60ftt4mg.js} +35 -35
  10. package/dist/cli/{curator-drift-2sypkddx.js → curator-drift-jbjjkkbg.js} +5 -5
  11. package/dist/cli/{curator-llm-factory-we3t6fqd.js → curator-llm-factory-6r5vkvts.js} +35 -35
  12. package/dist/cli/{doctor-knowledge-receipt-phase-id-xyecjehq.js → doctor-knowledge-receipt-phase-id-f1b7ah16.js} +6 -6
  13. package/dist/cli/{evidence-summary-service-k2g6hj96.js → evidence-summary-service-vgtsevph.js} +15 -15
  14. package/dist/cli/{gate-evidence-vmzyfpsp.js → gate-evidence-2reyjm1v.js} +5 -5
  15. package/dist/cli/{guardrail-explain-cpr1hh21.js → guardrail-explain-b1ck5ey3.js} +36 -36
  16. package/dist/cli/{guardrail-log-2htm6kes.js → guardrail-log-9c078ms0.js} +6 -6
  17. package/dist/cli/{guardrail-reset-dbwzk3p9.js → guardrail-reset-h844v5k3.js} +35 -35
  18. package/dist/cli/{hive-promoter-c24qc0e1.js → hive-promoter-hndtg0g9.js} +35 -35
  19. package/dist/cli/{index-9hsnarbv.js → index-0vhaejxa.js} +1 -1
  20. package/dist/cli/{index-bf1meb32.js → index-1wfychd6.js} +1 -1
  21. package/dist/cli/{index-wb01w8ex.js → index-1xedjkyy.js} +2 -2
  22. package/dist/cli/{index-gd41qkx3.js → index-2y4v88xp.js} +4 -4
  23. package/dist/cli/{index-1466xg5c.js → index-322afz1z.js} +1 -1
  24. package/dist/cli/{index-rn5hh7pp.js → index-5jm1nkv7.js} +6 -6
  25. package/dist/cli/{index-b02cdy5w.js → index-63pm3wa2.js} +3 -3
  26. package/dist/cli/{index-vhwbxtzt.js → index-685ypb7s.js} +2 -2
  27. package/dist/cli/{index-m6k9fsae.js → index-78vg2tgj.js} +35 -35
  28. package/dist/cli/{index-rx9phqsj.js → index-7n7775g7.js} +37 -37
  29. package/dist/cli/{index-x2p51ka9.js → index-82q5nv5h.js} +4 -4
  30. package/dist/cli/{index-yay1xxzk.js → index-91ajdtc6.js} +4 -4
  31. package/dist/cli/{index-jd3hvnqn.js → index-9dp2zhvj.js} +2 -2
  32. package/dist/cli/{index-mb1reyw3.js → index-9kaerjtj.js} +1 -1
  33. package/dist/cli/{index-rwabrcsg.js → index-ats43ttc.js} +1 -1
  34. package/dist/cli/{index-0v2svrev.js → index-bt11gbj8.js} +1 -1
  35. package/dist/cli/{index-9wfjc4cn.js → index-crkx7tta.js} +1 -1
  36. package/dist/cli/{index-7sbyvk99.js → index-e3ddxfh4.js} +1 -1
  37. package/dist/cli/{index-fq78x7th.js → index-ebhxj1dk.js} +7 -7
  38. package/dist/cli/{index-0rzc71q8.js → index-gjnt7sfc.js} +2 -2
  39. package/dist/cli/{index-wxf5feq2.js → index-h3sty9qx.js} +2 -2
  40. package/dist/cli/{index-ea10gcja.js → index-jgkcsykf.js} +4 -4
  41. package/dist/cli/{index-51dww7y9.js → index-jh7s55h1.js} +75 -75
  42. package/dist/cli/{index-md4xx63t.js → index-nbmvxaa2.js} +1 -1
  43. package/dist/cli/{index-1hqybe51.js → index-p9y1t8tk.js} +1 -1
  44. package/dist/cli/{index-kxj8bqtj.js → index-pah0zema.js} +2 -2
  45. package/dist/cli/{index-k1aek1xr.js → index-pya6v67j.js} +3 -3
  46. package/dist/cli/{index-9b86vn97.js → index-q1ymkdnc.js} +6 -6
  47. package/dist/cli/{index-4e3qcwfb.js → index-q2nydddh.js} +1 -1
  48. package/dist/cli/{index-4htcpbs4.js → index-qx0npayj.js} +3 -3
  49. package/dist/cli/{index-zwgh0gty.js → index-r06m1jps.js} +1 -1
  50. package/dist/cli/{index-41v699sv.js → index-rszpn3zf.js} +3 -3
  51. package/dist/cli/{index-dwm3czmf.js → index-rw8bq18z.js} +4 -4
  52. package/dist/cli/{index-x73e0zkb.js → index-rysj8e3x.js} +1 -1
  53. package/dist/cli/{index-pz26qx3x.js → index-s51gwkgd.js} +4 -4
  54. package/dist/cli/{index-edf2eztc.js → index-tqdjsvrm.js} +3 -3
  55. package/dist/cli/{index-tr901ma3.js → index-vz6cjc6f.js} +3 -3
  56. package/dist/cli/{index-zyc869ys.js → index-vzd1a06e.js} +3 -3
  57. package/dist/cli/{index-b9pz70d0.js → index-yd36m8y5.js} +2 -2
  58. package/dist/cli/{index-3dvzvhrp.js → index-z7k42wpb.js} +4 -4
  59. package/dist/cli/index.js +36 -36
  60. package/dist/cli/{knowledge-escalator-5sqgd4pg.js → knowledge-escalator-n0k4zjgy.js} +12 -12
  61. package/dist/cli/{knowledge-events-05yp3j0n.js → knowledge-events-ywqkth1n.js} +10 -10
  62. package/dist/cli/{knowledge-link-9gx2djyd.js → knowledge-link-rv41fqwp.js} +4 -4
  63. package/dist/cli/{knowledge-store-zx3qkamt.js → knowledge-store-0svng5s4.js} +5 -5
  64. package/dist/cli/{knowledge-validator-pc399we4.js → knowledge-validator-s2ddkgxg.js} +7 -7
  65. package/dist/cli/{mcp-8ptynxsv.js → mcp-2xhqha8p.js} +1 -1
  66. package/dist/cli/{model-preflight-bhxpnrb6.js → model-preflight-zz20c518.js} +35 -35
  67. package/dist/cli/{pending-delegations-6wcwj6sp.js → pending-delegations-72k8zeye.js} +7 -7
  68. package/dist/cli/{pr-subscriptions-22q1p6wg.js → pr-subscriptions-9eftakcv.js} +7 -7
  69. package/dist/cli/{pr-workflow-gate-5v9yabv2.js → pr-workflow-gate-90j60vp7.js} +35 -35
  70. package/dist/cli/{runner-x8sbydkw.js → runner-zhnj544n.js} +5 -5
  71. package/dist/cli/{scan-cursor-dkd9jvvq.js → scan-cursor-swrnhys8.js} +6 -6
  72. package/dist/cli/{schema-nsnc7dm8.js → schema-g5qw8zv2.js} +1 -1
  73. package/dist/cli/{scope-persistence-hwafwz1n.js → scope-persistence-nd32ryps.js} +11 -11
  74. package/dist/cli/{server-k52tg8j6.js → server-nez5478r.js} +35 -35
  75. package/dist/cli/{skill-generator-ak2vxhqe.js → skill-generator-tr5femt4.js} +14 -14
  76. package/dist/cli/{snapshot-coordination-init-nwh6z0a6.js → snapshot-coordination-init-c82a9gd1.js} +35 -35
  77. package/dist/cli/{speckit-checkoff-wydtzjmn.js → speckit-checkoff-fr3jnnah.js} +3 -3
  78. package/dist/cli/{telemetry-d0j31j5d.js → telemetry-wb54p3hn.js} +1 -1
  79. package/dist/cli/{worktree-collision-ownership-5fbzrgnm.js → worktree-collision-ownership-q0kn3g0k.js} +7 -7
  80. package/dist/cli/{worktree-isolation-643nwna7.js → worktree-isolation-zz26e66q.js} +35 -35
  81. package/dist/context-map/post-agent-update.d.ts +16 -1
  82. package/dist/host/v2/agents-commands.d.ts +41 -0
  83. package/dist/host/v2/events.d.ts +39 -0
  84. package/dist/host/v2/guidance.d.ts +30 -0
  85. package/dist/host/v2/hooks.d.ts +31 -0
  86. package/dist/host/v2/setup.d.ts +61 -0
  87. package/dist/host/v2/tools.d.ts +41 -0
  88. package/dist/host/v2/types.d.ts +291 -0
  89. package/dist/index.d.ts +1 -0
  90. package/dist/index.js +7 -6
  91. package/dist/types/context-map.d.ts +1 -1
  92. package/package.json +1 -1
@@ -0,0 +1,291 @@
1
+ /**
2
+ * Vendored structural types for the OpenCode 2 plugin API.
3
+ *
4
+ * Provenance: distilled from `@opencode/plugin@2.0.20`
5
+ * `dist/promise/{plugin,registration,tool,session,command,agent,event,storage,app,options}.d.ts`
6
+ * and `@opencode/schema@2.0.20` `dist/{tool,agent,location}.d.ts`,
7
+ * `@opencode/ai` `dist/schema/messages.d.ts` (fetched 2026-09-30, issue #3004).
8
+ * Structural only — deliberately no runtime dependency on `@opencode/plugin`.
9
+ *
10
+ * Drift guard: DEFERRED to the #2910 follow-up PR (a check-host-contract v2 digest leg over this corpus, plus the dual-host CI lane); until it lands, type truth rests on this provenance pin and the live-host smoke. See docs/host/v2-hook-inventory.md for the full v1-to-v2 map.
11
+ *
12
+ * Only the surfaces this adapter consumes are typed. Unknown fields are
13
+ * intentionally left off; the adapter never relies on their absence.
14
+ * Upstream: @opencode/plugin@2.0.20 and @opencode/schema@2.0.20 (MIT, sst/opencode).
15
+ */
16
+ /** v2 `App` — host identity (dist/app.d.ts). */
17
+ export interface V2App {
18
+ readonly name: string;
19
+ readonly version: string;
20
+ readonly channel: string;
21
+ }
22
+ /** v2 `Location.Info` — project anchor (dist/location.d.ts). */
23
+ export interface V2Location {
24
+ readonly directory: string;
25
+ readonly workspaceID?: string;
26
+ readonly project?: {
27
+ readonly id?: string;
28
+ readonly directory?: string;
29
+ readonly canonical?: string;
30
+ };
31
+ }
32
+ /** v2 `PluginOptions` (dist/options.d.ts). */
33
+ export type V2PluginOptions = Readonly<Record<string, unknown>>;
34
+ /** v2 `Registration` (dist/promise/registration.d.ts). */
35
+ export interface V2Registration {
36
+ readonly dispose: () => Promise<void>;
37
+ }
38
+ /** v2 `Tool.Result` content parts (schema/tool.d.ts). */
39
+ export type V2ToolContent = {
40
+ readonly type: 'text';
41
+ readonly text: string;
42
+ } | {
43
+ readonly type: 'file';
44
+ readonly uri: string;
45
+ readonly mime: string;
46
+ readonly name?: string;
47
+ };
48
+ /** v2 `Tool.Result` (schema/tool.d.ts). */
49
+ export interface V2ToolResult {
50
+ readonly output?: unknown;
51
+ readonly content?: string | ReadonlyArray<V2ToolContent>;
52
+ readonly metadata?: Readonly<Record<string, unknown>>;
53
+ }
54
+ /** v2 tool `ToolContext` (dist/promise/tool.d.ts). */
55
+ export interface V2ToolContext {
56
+ readonly sessionID: string;
57
+ readonly agent: unknown;
58
+ readonly messageID: string;
59
+ readonly id: string;
60
+ readonly signal: AbortSignal;
61
+ readonly progress: (update: Readonly<Record<string, unknown>>) => Promise<void>;
62
+ }
63
+ /** v2 `Tool.Info` shape accepted by `ToolEditor.add` (dist/promise/tool.d.ts). */
64
+ export interface V2ToolInfo {
65
+ readonly name: string;
66
+ readonly description: string;
67
+ readonly input: unknown;
68
+ readonly execute: (input: unknown, context: V2ToolContext) => Promise<V2ToolResult>;
69
+ }
70
+ /** v2 `ToolEditor` (dist/promise/tool.d.ts). */
71
+ export interface V2ToolEditor {
72
+ add(tool: V2ToolInfo): void;
73
+ list(): Array<V2ToolInfo & {
74
+ readonly id: string;
75
+ }>;
76
+ get(id: string): (V2ToolInfo & {
77
+ readonly id: string;
78
+ }) | undefined;
79
+ update(id: string, update: (tool: unknown) => void): void;
80
+ remove(id: string): void;
81
+ namespace(namespace: {
82
+ readonly name: string;
83
+ readonly description: string;
84
+ }): void;
85
+ }
86
+ /** v2 `ToolDomain` (dist/promise/tool.d.ts) — hook payloads inline. */
87
+ export interface V2ToolDomain {
88
+ readonly transform: (callback: (editor: V2ToolEditor) => void) => Promise<V2Registration>;
89
+ readonly reload: () => Promise<void>;
90
+ readonly hook: (name: 'execute.before' | 'execute.after', callback: (input: V2ToolHookInput) => Promise<void> | void) => Promise<V2Registration>;
91
+ }
92
+ export interface V2ToolHookInput {
93
+ readonly tool: string;
94
+ readonly sessionID: string;
95
+ readonly agent: unknown;
96
+ readonly messageID: string;
97
+ readonly id: string;
98
+ input?: unknown;
99
+ readonly status?: 'completed' | 'error';
100
+ readonly result?: V2ToolResult;
101
+ readonly error?: {
102
+ message?: string;
103
+ [key: string]: unknown;
104
+ };
105
+ }
106
+ /** v2 text part on the system surface (`SystemPart`, @opencode/ai messages.d.ts). */
107
+ export interface V2SystemPart {
108
+ type: 'text';
109
+ text: string;
110
+ cache?: unknown;
111
+ metadata?: Record<string, unknown>;
112
+ }
113
+ /** v2 `Message` (abbreviated to the text-relevant surface). */
114
+ export interface V2Message {
115
+ id?: string;
116
+ role: 'system' | 'user' | 'assistant' | 'tool';
117
+ content: Array<{
118
+ type: string;
119
+ text?: string;
120
+ [key: string]: unknown;
121
+ }>;
122
+ [key: string]: unknown;
123
+ }
124
+ /** v2 `SessionContext` event (dist/promise/session.d.ts; DeepMutable in place). */
125
+ export interface V2SessionContextEvent {
126
+ readonly sessionID: string;
127
+ readonly agent: unknown;
128
+ readonly model?: {
129
+ id?: string;
130
+ providerID?: string;
131
+ [key: string]: unknown;
132
+ };
133
+ system: V2SystemPart[];
134
+ messages: V2Message[];
135
+ options: Record<string, unknown>;
136
+ tools: Record<string, {
137
+ description: string;
138
+ input: unknown;
139
+ }>;
140
+ }
141
+ /** v2 `SessionCompaction` event (extends SessionContext + settable result). */
142
+ export interface V2SessionCompactionEvent extends V2SessionContextEvent {
143
+ result?: {
144
+ summary: string;
145
+ [key: string]: unknown;
146
+ };
147
+ }
148
+ /** v2 `SessionPrompt` event (dist/promise/session.d.ts). */
149
+ export interface V2SessionPromptEvent {
150
+ readonly sessionID: string;
151
+ readonly messageID: string;
152
+ prompt: {
153
+ text: string;
154
+ files?: unknown[];
155
+ agents?: unknown[];
156
+ skills?: unknown[];
157
+ };
158
+ readonly delivery?: string;
159
+ }
160
+ /** v2 `SessionDomain` (only hook used by this adapter). */
161
+ export interface V2SessionDomain {
162
+ readonly hook: (name: 'context' | 'compaction' | 'prompt', callback: (event: never) => Promise<void> | void) => Promise<V2Registration>;
163
+ readonly prompt?: (sessionID: string, input: {
164
+ text: string;
165
+ } | {
166
+ command: string;
167
+ args?: string;
168
+ }) => Promise<unknown>;
169
+ }
170
+ /** v2 `CommandDefinition` / `CommandEditor` (dist/promise/command.d.ts). */
171
+ export interface V2CommandInvocation {
172
+ readonly sessionID: string;
173
+ readonly prompt: {
174
+ text: string;
175
+ [key: string]: unknown;
176
+ };
177
+ readonly delivery?: string;
178
+ }
179
+ export interface V2CommandDefinition {
180
+ readonly name: string;
181
+ readonly description?: string;
182
+ readonly execute: (input: V2CommandInvocation) => Promise<void>;
183
+ }
184
+ export interface V2CommandDomain {
185
+ readonly transform: (callback: (editor: {
186
+ add(definition: V2CommandDefinition): void;
187
+ }) => void) => Promise<V2Registration>;
188
+ readonly reload: () => Promise<void>;
189
+ }
190
+ /** v2 `Agent.Info` (schema/agent.d.ts; only fields this adapter writes). */
191
+ export interface V2AgentInfo {
192
+ id: string;
193
+ name: string;
194
+ mode: 'subagent' | 'primary' | 'all';
195
+ hidden: boolean;
196
+ request: {
197
+ settings: Record<string, unknown>;
198
+ headers: Record<string, string>;
199
+ body: Record<string, unknown>;
200
+ };
201
+ system?: string;
202
+ description?: string;
203
+ model?: {
204
+ id: string;
205
+ providerID: string;
206
+ variant?: string;
207
+ };
208
+ permissions?: Array<{
209
+ action: string;
210
+ resource: string;
211
+ effect: 'allow' | 'deny' | 'ask';
212
+ }>;
213
+ }
214
+ /** v2 `AgentEditor` (dist/promise/agent.d.ts). */
215
+ export interface V2AgentEditor {
216
+ list(): V2AgentInfo[];
217
+ get(id: string): V2AgentInfo | undefined;
218
+ default(id: string | undefined): void;
219
+ update(id: string, update: (agent: V2AgentInfo) => void): void;
220
+ remove(id: string): void;
221
+ }
222
+ /** v2 `AgentDomain`. */
223
+ export interface V2AgentDomain {
224
+ readonly transform: (callback: (editor: V2AgentEditor) => void) => Promise<V2Registration>;
225
+ readonly reload: () => Promise<void>;
226
+ }
227
+ /** v2 `EventDomain.subscribe` — async iterable of host events. */
228
+ export interface V2EventEnvelope {
229
+ readonly type?: string;
230
+ readonly [key: string]: unknown;
231
+ }
232
+ export interface V2EventDomain {
233
+ readonly subscribe?: (...args: unknown[]) => AsyncIterable<V2EventEnvelope> | Promise<AsyncIterable<V2EventEnvelope>>;
234
+ }
235
+ /** v2 `PermissionDomain` (only used for the v1 ask() bridge, best-effort). */
236
+ export interface V2PermissionDomain {
237
+ readonly reply?: (input: unknown) => Promise<unknown>;
238
+ readonly list?: () => Promise<unknown[]>;
239
+ readonly hook?: (name: 'evaluate', callback: (input: unknown) => Promise<void> | void) => Promise<V2Registration>;
240
+ }
241
+ /**
242
+ * v2 `Context` (dist/promise/plugin.d.ts) — only the domains this adapter
243
+ * touches; everything else stays reachable through the index signature so a
244
+ * superset host context is accepted.
245
+ */
246
+ export interface V2PluginContext {
247
+ readonly app: V2App;
248
+ readonly location: V2Location;
249
+ readonly options: V2PluginOptions;
250
+ readonly tool: V2ToolDomain;
251
+ readonly agent: V2AgentDomain;
252
+ readonly command: V2CommandDomain;
253
+ readonly session: V2SessionDomain;
254
+ readonly event: V2EventDomain;
255
+ readonly permission?: V2PermissionDomain;
256
+ readonly [key: string]: unknown;
257
+ }
258
+ /** v2 `Cleanup` — the return of `setup`. */
259
+ export type V2Cleanup = () => Promise<void> | void;
260
+ /** The v1-shaped hooks object the adapter consumes (structural subset). */
261
+ export interface V1HooksSubset {
262
+ name?: string;
263
+ tool?: Record<string, {
264
+ description?: string;
265
+ args?: unknown;
266
+ execute?: (args: unknown, ctx: unknown) => Promise<unknown>;
267
+ }>;
268
+ agent?: Record<string, unknown>;
269
+ config?: (opencodeConfig: Record<string, unknown>) => Promise<void>;
270
+ event?: (input: {
271
+ event: {
272
+ type?: string;
273
+ properties?: Record<string, unknown>;
274
+ };
275
+ }) => Promise<void>;
276
+ dispose?: () => Promise<void>;
277
+ 'command.execute.before'?: (input: unknown, output: unknown) => Promise<void>;
278
+ 'tool.execute.before'?: (input: unknown, output: unknown) => Promise<unknown> | Promise<void>;
279
+ 'tool.execute.after'?: (input: unknown, output: unknown) => Promise<unknown> | Promise<void>;
280
+ 'chat.message'?: (input: unknown, output: unknown) => Promise<unknown> | Promise<void>;
281
+ 'experimental.chat.messages.transform'?: (input: unknown, output: {
282
+ messages: unknown[];
283
+ }) => Promise<void>;
284
+ 'experimental.chat.system.transform'?: (input: {
285
+ sessionID?: string;
286
+ model?: unknown;
287
+ }, output: {
288
+ system: string[];
289
+ }) => Promise<void>;
290
+ 'experimental.session.compacting'?: (input: unknown, output: unknown) => Promise<void>;
291
+ }
package/dist/index.d.ts CHANGED
@@ -86,6 +86,7 @@ type PendingCostCorrection = {
86
86
  declare const _default: {
87
87
  id: "opencode-swarm";
88
88
  server: Plugin;
89
+ setup: (ctx: unknown) => Promise<() => Promise<void>>;
89
90
  };
90
91
  export default _default;
91
92
  export type { AgentDefinition } from './agents';