opencode-swarm 7.192.4 → 7.193.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/swarm-pr-review/SKILL.md +2 -2
- package/.opencode/skills/swarm-pr-review/references/verdict-settlement-contract.md +17 -0
- 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-1xy6dprq.js → auto-checkpoint-taay16xe.js} +7 -7
- package/dist/cli/{checkpoint-wvhmkgv5.js → checkpoint-6229g3jq.js} +14 -14
- package/dist/cli/{coder-settlement-wpkmkgcf.js → coder-settlement-hexmmefv.js} +10 -10
- package/dist/cli/{config-doctor-xvhejh7g.js → config-doctor-3ghvthh5.js} +13 -13
- package/dist/cli/{core-yzgm8pcw.js → core-0k7t9fw0.js} +3 -3
- package/dist/cli/{curation-policy-yzdznz4z.js → curation-policy-8j6qn6nt.js} +4 -4
- package/dist/cli/{curator-drift-5c041yaf.js → curator-drift-a5142x0d.js} +8 -8
- package/dist/cli/{curator-3xh6246r.js → curator-kwwnkyr7.js} +40 -40
- package/dist/cli/curator-llm-factory-8gt3mvg9.js +82 -0
- package/dist/cli/{doctor-knowledge-receipt-phase-id-cx6n5jtp.js → doctor-knowledge-receipt-phase-id-11nsf9tz.js} +7 -7
- package/dist/cli/{evidence-summary-service-cc139a85.js → evidence-summary-service-y2ykc6ta.js} +17 -17
- package/dist/cli/{gate-evidence-7azk0xbt.js → gate-evidence-cd5299js.js} +5 -5
- package/dist/cli/guardrail-explain-hpgecr7x.js +83 -0
- package/dist/cli/{guardrail-log-env1h4wr.js → guardrail-log-g6krx0s2.js} +6 -6
- package/dist/cli/{guardrail-reset-1404ymcw.js → guardrail-reset-a3xv675m.js} +40 -40
- package/dist/cli/{hive-promoter-hap3dh02.js → hive-promoter-90svfzvs.js} +40 -40
- package/dist/cli/{index-8zj647hc.js → index-0e318vgt.js} +1 -1
- package/dist/cli/{index-s68yyat0.js → index-1dx5zyss.js} +1 -1
- package/dist/cli/{index-kn16k0fv.js → index-1p24bfn2.js} +5 -5
- package/dist/cli/{index-bgzpw6ge.js → index-3atkcqpb.js} +1 -1
- package/dist/cli/{index-s43zb23q.js → index-3xj89bf0.js} +42 -42
- package/dist/cli/{index-6k70exke.js → index-4gacy6y6.js} +2 -2
- package/dist/cli/{index-g2phkwh2.js → index-4mq8r4be.js} +3 -3
- package/dist/cli/{index-54p1vs33.js → index-5ev6f1gj.js} +3 -3
- package/dist/cli/{index-tww9qw9z.js → index-5n760fzn.js} +6 -6
- package/dist/cli/{index-1n7sf9gz.js → index-5rkh69f3.js} +1 -1
- package/dist/cli/{index-0e1nxkte.js → index-668npagp.js} +1 -1
- package/dist/cli/{index-xpwp9hw1.js → index-6dn16dre.js} +5 -5
- package/dist/cli/{index-g8jd3h4r.js → index-6s3ab22d.js} +2 -2
- package/dist/cli/{index-5gy5dc2n.js → index-7njm9jk1.js} +1 -1
- package/dist/cli/{index-eaess7dm.js → index-84k9zzv1.js} +1 -1
- package/dist/cli/{index-rsfvxaw0.js → index-bg19b84s.js} +7 -7
- package/dist/cli/{index-cp9h2sqb.js → index-bgtfvst1.js} +1 -1
- package/dist/cli/{index-22ww8fjt.js → index-bkpyff61.js} +2 -2
- package/dist/cli/{index-jb669k7s.js → index-cpt38e0e.js} +2 -2
- package/dist/cli/{index-gkr6ns9n.js → index-cs0p582p.js} +4 -4
- package/dist/cli/{index-v6ghzghn.js → index-d2emv8ap.js} +3 -3
- package/dist/cli/{index-ftatc9wj.js → index-db786kn6.js} +40 -40
- package/dist/cli/{index-fzqn2kk8.js → index-fd6b9f38.js} +2 -2
- package/dist/cli/{index-c5gb6a86.js → index-he2nyr7x.js} +10 -10
- package/dist/cli/{index-dtet46e6.js → index-hfnyykvm.js} +5 -5
- package/dist/cli/{index-nwswxes7.js → index-hfssjyxs.js} +2 -2
- package/dist/cli/{index-5gyq54c5.js → index-jx80ed6g.js} +4563 -4121
- package/dist/cli/{index-j4pxkvw3.js → index-jxs9qnad.js} +4 -4
- package/dist/cli/{index-xwxqtdwz.js → index-ma71x1aa.js} +4 -4
- package/dist/cli/{index-4twjbsfw.js → index-ndec8akq.js} +1 -1
- package/dist/cli/{index-rqapvhh5.js → index-ngk8hpc3.js} +1 -1
- package/dist/cli/{index-qzkrcz1r.js → index-nktwf2xm.js} +6 -6
- package/dist/cli/{index-c8fjbghs.js → index-ntmnse4d.js} +1 -1
- package/dist/cli/{index-2qpme44n.js → index-nz6ehpjn.js} +3 -3
- package/dist/cli/{index-c6wzbs0g.js → index-prvancd0.js} +2 -2
- package/dist/cli/{index-a9m7h5v0.js → index-qh93qjc2.js} +1 -1
- package/dist/cli/{index-vgktct21.js → index-r3mffz78.js} +4 -4
- package/dist/cli/{index-q47snsb2.js → index-rd9th57y.js} +3 -3
- package/dist/cli/{index-dt4cjxbz.js → index-st80sjg7.js} +1 -1
- package/dist/cli/{index-zya4a544.js → index-tr47q89d.js} +4 -4
- package/dist/cli/{index-6vwnm3sm.js → index-vbp35frb.js} +2 -2
- package/dist/cli/{index-mbn4vn3z.js → index-vg8sxg12.js} +1 -1
- package/dist/cli/{index-5dws7eyb.js → index-w2vbaczx.js} +1 -1
- package/dist/cli/{index-72eh47b2.js → index-x2phyvcv.js} +3 -3
- package/dist/cli/{index-myjqj3na.js → index-ymnathfr.js} +7 -7
- package/dist/cli/index.js +41 -41
- package/dist/cli/{knowledge-escalator-eta167xh.js → knowledge-escalator-2d7g3hs0.js} +12 -12
- package/dist/cli/{knowledge-events-mz25jn9f.js → knowledge-events-hjeaevc9.js} +10 -10
- package/dist/cli/{knowledge-link-a5tvjqdt.js → knowledge-link-srnt95wh.js} +3 -3
- package/dist/cli/{knowledge-store-qd08dbws.js → knowledge-store-g9cb2m0v.js} +4 -4
- package/dist/cli/{knowledge-validator-jyrsgamq.js → knowledge-validator-dghf9pcj.js} +6 -6
- package/dist/cli/{mcp-4wgxc5ax.js → mcp-f5myvd7r.js} +1 -1
- package/dist/cli/{model-preflight-4p3x4vma.js → model-preflight-4w4wd6dj.js} +40 -40
- package/dist/cli/{pending-delegations-7hm6xgzw.js → pending-delegations-adm6gf3n.js} +10 -10
- package/dist/cli/{pr-subscriptions-2y3w5pyt.js → pr-subscriptions-n1hks854.js} +10 -10
- package/dist/cli/{pr-workflow-gate-y04z3z80.js → pr-workflow-gate-59cr6gve.js} +44 -40
- package/dist/cli/{runner-8qybgy4n.js → runner-b2e89cp1.js} +4 -4
- package/dist/cli/{scan-cursor-2hpc6mxt.js → scan-cursor-t26xmfhd.js} +5 -5
- package/dist/cli/{schema-33k1e2cv.js → schema-cr120ar5.js} +1 -1
- package/dist/cli/{scope-persistence-y769jep8.js → scope-persistence-mrnz8j43.js} +13 -13
- package/dist/cli/{server-199m00cz.js → server-mwk6zn83.js} +40 -40
- package/dist/cli/{skill-generator-b9by3739.js → skill-generator-svs4k0g8.js} +14 -14
- package/dist/cli/{snapshot-coordination-init-wyyn8ftk.js → snapshot-coordination-init-xzrahhsb.js} +40 -40
- package/dist/cli/{speckit-checkoff-y2ywmh9k.js → speckit-checkoff-g2qrb1tn.js} +4 -4
- package/dist/cli/{workspace-snapshot-vfpnxjsp.js → workspace-snapshot-p69t9zn7.js} +3 -3
- package/dist/cli/{worktree-collision-ownership-hg0yrc5b.js → worktree-collision-ownership-d145wmpg.js} +11 -11
- package/dist/cli/{worktree-isolation-epbn1xgh.js → worktree-isolation-pt1rws6p.js} +40 -40
- package/dist/commands/registry.d.ts +1 -1
- package/dist/hooks/injection-policy.d.ts +94 -0
- package/dist/hooks/pr-workflow-gate.d.ts +44 -5
- package/dist/host/v2/types.d.ts +254 -11
- package/dist/index.js +492 -491
- package/dist/pr-review/finding-policy.d.ts +1 -1
- package/dist/pr-review/verdict-settlement.d.ts +182 -0
- package/dist/services/context-budget-service.d.ts +8 -1
- package/dist/tools/complete-pr-workflow.d.ts +13 -0
- package/dist/tools/write-pr-review-artifact.d.ts +1 -1
- package/package.json +1 -1
- package/dist/cli/curator-llm-factory-6y7wrbvk.js +0 -82
- package/dist/cli/guardrail-explain-b3y98j5b.js +0 -83
package/dist/host/v2/types.d.ts
CHANGED
|
@@ -1,17 +1,29 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Vendored structural types for the OpenCode 2 plugin API.
|
|
3
3
|
*
|
|
4
|
-
* Provenance: distilled from `@opencode/plugin@2.0.
|
|
5
|
-
* `dist/promise/{plugin,registration,tool,session,command,agent,event,storage,app,options}.d.ts`
|
|
6
|
-
* and `@opencode/schema@2.0.
|
|
7
|
-
* `@opencode/
|
|
4
|
+
* Provenance: distilled from `@opencode/plugin@2.0.26`
|
|
5
|
+
* `dist/promise/{plugin,registration,tool,session,worktree,command,agent,event,storage,app,options}.d.ts`
|
|
6
|
+
* and `@opencode/schema@2.0.26` `dist/{tool,agent,location}.d.ts`,
|
|
7
|
+
* `@opencode/client@2.0.26` `dist/promise/generated/{client,types}.d.ts`,
|
|
8
|
+
* `@opencode/ai` `dist/schema/messages.d.ts` (fetched 2026-10-09, issues #3004 / #3169).
|
|
8
9
|
* Structural only — deliberately no runtime dependency on `@opencode/plugin`.
|
|
9
10
|
*
|
|
10
|
-
*
|
|
11
|
+
* Flattening note: the client's Effect-generated input types express optional fields as
|
|
12
|
+
* `{ field: Body["field"] }` records; they are vendored here as plain optional fields of the
|
|
13
|
+
* same types (e.g. `SessionCreateInput` is all-optional in the published form).
|
|
14
|
+
*
|
|
15
|
+
* 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 (now 2.0.26) and the live-host smoke. See docs/host/v2-hook-inventory.md for the full v1-to-v2 map.
|
|
16
|
+
*
|
|
17
|
+
* Host-tolerance contract for the session/worktree method surface (issue #3169 Phase 1):
|
|
18
|
+
* the members below are REQUIRED to mirror the published `SessionDomain`/`WorktreeDomain`,
|
|
19
|
+
* but nothing in Phase 1 calls them. Phase 2 call sites MUST feature-detect
|
|
20
|
+
* (`typeof ctx.session.create === 'function'`) and degrade — requiredness is type-level
|
|
21
|
+
* only and a 2.0.2x host lacking a member must never crash the adapter.
|
|
11
22
|
*
|
|
12
23
|
* Only the surfaces this adapter consumes are typed. Unknown fields are
|
|
13
24
|
* intentionally left off; the adapter never relies on their absence.
|
|
14
|
-
* Upstream: @opencode/plugin@2.0.
|
|
25
|
+
* Upstream: @opencode/plugin@2.0.26, @opencode/schema@2.0.26 and
|
|
26
|
+
* @opencode/client@2.0.26 (MIT, sst/opencode).
|
|
15
27
|
*/
|
|
16
28
|
/** v2 `App` — host identity (dist/app.d.ts). */
|
|
17
29
|
export interface V2App {
|
|
@@ -157,15 +169,244 @@ export interface V2SessionPromptEvent {
|
|
|
157
169
|
};
|
|
158
170
|
readonly delivery?: string;
|
|
159
171
|
}
|
|
160
|
-
/**
|
|
172
|
+
/**
|
|
173
|
+
* v2 session-call input types (`@opencode/client@2.0.26` generated types, flattened —
|
|
174
|
+
* see the module header's flattening note). Only the fields with published evidence
|
|
175
|
+
* are named; the index signature keeps them structural, not exhaustive.
|
|
176
|
+
*/
|
|
177
|
+
/** `Model.Ref` (schema/model.d.ts). */
|
|
178
|
+
export interface V2ModelRef {
|
|
179
|
+
readonly id: string;
|
|
180
|
+
readonly providerID: string;
|
|
181
|
+
readonly variant?: string;
|
|
182
|
+
}
|
|
183
|
+
/** Session permission rule (schema/permission.d.ts shape on create/switch inputs). */
|
|
184
|
+
export interface V2SessionPermission {
|
|
185
|
+
readonly action: string;
|
|
186
|
+
readonly resource: string;
|
|
187
|
+
readonly effect: 'allow' | 'deny' | 'ask';
|
|
188
|
+
}
|
|
189
|
+
/** `SessionCreateInput` — all-optional in the published (Effect-generated) form. */
|
|
190
|
+
export interface V2SessionCreateInput {
|
|
191
|
+
readonly id?: string | null;
|
|
192
|
+
readonly parentID?: string | null;
|
|
193
|
+
readonly title?: string | null;
|
|
194
|
+
readonly agent?: string | null;
|
|
195
|
+
readonly model?: V2ModelRef | null;
|
|
196
|
+
readonly location?: {
|
|
197
|
+
readonly directory: string;
|
|
198
|
+
} | null;
|
|
199
|
+
readonly metadata?: Readonly<Record<string, unknown>> | null;
|
|
200
|
+
readonly permissions?: ReadonlyArray<V2SessionPermission> | null;
|
|
201
|
+
}
|
|
202
|
+
/**
|
|
203
|
+
* `SessionPromptInput` (`@opencode/client@2.0.26` generated, flattened):
|
|
204
|
+
* `sessionID` and `text` are required; `command`/`args` are NOT members of
|
|
205
|
+
* this input (the command shape is `name` + `text` on `SessionCommandInput` —
|
|
206
|
+
* the earlier fabricated members were removed in the PR-review feedback pass).
|
|
207
|
+
* Attachment members are abbreviated structural shapes.
|
|
208
|
+
*/
|
|
209
|
+
export interface V2SessionPromptCallInput {
|
|
210
|
+
readonly sessionID: string;
|
|
211
|
+
readonly text: string;
|
|
212
|
+
readonly id?: string | null;
|
|
213
|
+
readonly files?: ReadonlyArray<{
|
|
214
|
+
readonly uri: string;
|
|
215
|
+
readonly name?: string;
|
|
216
|
+
readonly description?: string;
|
|
217
|
+
}>;
|
|
218
|
+
readonly agents?: ReadonlyArray<{
|
|
219
|
+
readonly name: string;
|
|
220
|
+
}>;
|
|
221
|
+
readonly skills?: ReadonlyArray<{
|
|
222
|
+
readonly id: string;
|
|
223
|
+
}>;
|
|
224
|
+
readonly metadata?: Readonly<Record<string, unknown>>;
|
|
225
|
+
readonly delivery?: 'steer' | 'queue' | null;
|
|
226
|
+
readonly resume?: boolean | null;
|
|
227
|
+
[key: string]: unknown;
|
|
228
|
+
}
|
|
229
|
+
/** `SessionSwitchAgentInput`. */
|
|
230
|
+
export interface V2SessionSwitchAgentInput {
|
|
231
|
+
readonly sessionID: string;
|
|
232
|
+
readonly agent: string;
|
|
233
|
+
}
|
|
234
|
+
/** `SessionSwitchModelInput`. */
|
|
235
|
+
export interface V2SessionSwitchModelInput {
|
|
236
|
+
readonly sessionID: string;
|
|
237
|
+
readonly model: V2ModelRef;
|
|
238
|
+
}
|
|
239
|
+
/** `SessionInterruptInput`. */
|
|
240
|
+
export interface V2SessionInterruptInput {
|
|
241
|
+
readonly sessionID: string;
|
|
242
|
+
readonly resume?: boolean;
|
|
243
|
+
}
|
|
244
|
+
/** `SessionInfo` — fields with published evidence; structural, not exhaustive. */
|
|
245
|
+
export interface V2SessionInfo {
|
|
246
|
+
readonly id: string;
|
|
247
|
+
readonly parentID?: string;
|
|
248
|
+
readonly projectID: string;
|
|
249
|
+
readonly agent?: string;
|
|
250
|
+
readonly model?: V2ModelRef;
|
|
251
|
+
readonly title?: string;
|
|
252
|
+
readonly location: {
|
|
253
|
+
readonly directory: string;
|
|
254
|
+
[key: string]: unknown;
|
|
255
|
+
};
|
|
256
|
+
readonly time?: {
|
|
257
|
+
readonly created: number;
|
|
258
|
+
readonly updated: number;
|
|
259
|
+
readonly idle?: number;
|
|
260
|
+
};
|
|
261
|
+
readonly outcome?: 'succeeded' | 'failed' | 'interrupted';
|
|
262
|
+
[key: string]: unknown;
|
|
263
|
+
}
|
|
264
|
+
/** `SessionMessageInfo` union member (abbreviated; consumers read type + text). */
|
|
265
|
+
export interface V2SessionMessageInfo {
|
|
266
|
+
readonly type?: string;
|
|
267
|
+
[key: string]: unknown;
|
|
268
|
+
}
|
|
269
|
+
/**
|
|
270
|
+
* v2 `SessionDomain` (dist/promise/session.d.ts 2.0.26): `Pick<SessionApi, "create" | "get" |
|
|
271
|
+
* "remove" | "switchAgent" | "switchModel" | "prompt" | "generate" | "command" | "compact" |
|
|
272
|
+
* "synthetic" | "interrupt" | "update" | "move" | "wait" | "context"> & { hook }`.
|
|
273
|
+
*
|
|
274
|
+
* `hook` names stay the 2.0.20-era three this adapter registers (context/compaction/prompt;
|
|
275
|
+
* the published SessionHooks map has grown, but the adapter only registers these).
|
|
276
|
+
*/
|
|
161
277
|
export interface V2SessionDomain {
|
|
162
278
|
readonly hook: (name: 'context' | 'compaction' | 'prompt', callback: (event: never) => Promise<void> | void) => Promise<V2Registration>;
|
|
163
|
-
readonly
|
|
279
|
+
readonly create: (input?: V2SessionCreateInput) => Promise<V2SessionInfo>;
|
|
280
|
+
readonly get: (input: {
|
|
281
|
+
readonly sessionID: string;
|
|
282
|
+
}) => Promise<V2SessionInfo>;
|
|
283
|
+
readonly remove: (input: {
|
|
284
|
+
readonly sessionID: string;
|
|
285
|
+
}) => Promise<void>;
|
|
286
|
+
readonly switchAgent: (input: V2SessionSwitchAgentInput) => Promise<void>;
|
|
287
|
+
readonly switchModel: (input: V2SessionSwitchModelInput) => Promise<void>;
|
|
288
|
+
/** Asynchronous: returns an inbox entry; pair with `wait` (issue #3169 Phase 2). */
|
|
289
|
+
readonly prompt: (input: V2SessionPromptCallInput) => Promise<unknown>;
|
|
290
|
+
readonly generate: (input: {
|
|
291
|
+
readonly sessionID: string;
|
|
292
|
+
[key: string]: unknown;
|
|
293
|
+
}) => Promise<{
|
|
164
294
|
text: string;
|
|
165
|
-
}
|
|
166
|
-
|
|
167
|
-
|
|
295
|
+
}>;
|
|
296
|
+
readonly command: (input: {
|
|
297
|
+
readonly sessionID: string;
|
|
298
|
+
[key: string]: unknown;
|
|
299
|
+
}) => Promise<void>;
|
|
300
|
+
readonly compact: (input: {
|
|
301
|
+
readonly sessionID: string;
|
|
302
|
+
[key: string]: unknown;
|
|
303
|
+
}) => Promise<unknown>;
|
|
304
|
+
readonly synthetic: (input: {
|
|
305
|
+
readonly sessionID: string;
|
|
306
|
+
[key: string]: unknown;
|
|
168
307
|
}) => Promise<unknown>;
|
|
308
|
+
readonly interrupt: (input: V2SessionInterruptInput) => Promise<unknown>;
|
|
309
|
+
readonly update: (input: {
|
|
310
|
+
readonly sessionID: string;
|
|
311
|
+
[key: string]: unknown;
|
|
312
|
+
}) => Promise<void>;
|
|
313
|
+
readonly move: (input: {
|
|
314
|
+
readonly sessionID: string;
|
|
315
|
+
[key: string]: unknown;
|
|
316
|
+
}) => Promise<void>;
|
|
317
|
+
readonly wait: (input: {
|
|
318
|
+
readonly sessionID: string;
|
|
319
|
+
}) => Promise<void>;
|
|
320
|
+
readonly context: (input: {
|
|
321
|
+
readonly sessionID: string;
|
|
322
|
+
}) => Promise<V2SessionMessageInfo[]>;
|
|
323
|
+
}
|
|
324
|
+
/**
|
|
325
|
+
* v2 worktree types (`@opencode/plugin@2.0.26` + `@opencode/client@2.0.26`).
|
|
326
|
+
* The host publishes TWO distinct flavors — the client `WorktreeApi` inputs
|
|
327
|
+
* (project-id keyed) and the plugin `WorktreeDefinition` callback inputs
|
|
328
|
+
* (source-directory keyed) — and they must not be merged (PR-review feedback
|
|
329
|
+
* FB-003): a caller against either flavor would compile and then fail
|
|
330
|
+
* host-side at runtime.
|
|
331
|
+
*/
|
|
332
|
+
/** Client `WorktreeListInput` / `WorktreeRefreshInput` (project-id keyed). */
|
|
333
|
+
export interface V2WorktreeProjectInput {
|
|
334
|
+
readonly projectID: string;
|
|
335
|
+
}
|
|
336
|
+
/** Client `WorktreeCreateInput`. */
|
|
337
|
+
export interface V2WorktreeCreateInput {
|
|
338
|
+
readonly projectID: string;
|
|
339
|
+
readonly from?: string;
|
|
340
|
+
readonly branch?: string;
|
|
341
|
+
readonly directory?: string;
|
|
342
|
+
readonly name?: string;
|
|
343
|
+
[key: string]: unknown;
|
|
344
|
+
}
|
|
345
|
+
/** Client `WorktreeRemoveInput`. */
|
|
346
|
+
export interface V2WorktreeRemoveInput {
|
|
347
|
+
readonly projectID: string;
|
|
348
|
+
readonly directory: string;
|
|
349
|
+
readonly force: boolean;
|
|
350
|
+
}
|
|
351
|
+
/** Client `WorktreeInfo` (create result; `directory` is the only published member). */
|
|
352
|
+
export interface V2WorktreeInfo {
|
|
353
|
+
readonly directory: string;
|
|
354
|
+
[key: string]: unknown;
|
|
355
|
+
}
|
|
356
|
+
/** Plugin `WorktreeCreateInput` (the `../worktree.js` flavor — distinct from the client's). */
|
|
357
|
+
export interface V2PluginWorktreeCreateInput {
|
|
358
|
+
readonly sourceDirectory: string;
|
|
359
|
+
readonly directory: string;
|
|
360
|
+
readonly branch?: string;
|
|
361
|
+
[key: string]: unknown;
|
|
362
|
+
}
|
|
363
|
+
/** Plugin `WorktreeRemoveInput`. */
|
|
364
|
+
export interface V2PluginWorktreeRemoveInput {
|
|
365
|
+
readonly directory: string;
|
|
366
|
+
readonly force: boolean;
|
|
367
|
+
}
|
|
368
|
+
/** Plugin `WorktreeResult` (create return). */
|
|
369
|
+
export interface V2WorktreeResult {
|
|
370
|
+
readonly directory: string;
|
|
371
|
+
[key: string]: unknown;
|
|
372
|
+
}
|
|
373
|
+
/**
|
|
374
|
+
* Plugin `WorktreeEntry` (list item). Only `directory` is published-verified
|
|
375
|
+
* here; the structural index keeps the remaining fields without inventing shapes.
|
|
376
|
+
*/
|
|
377
|
+
export interface V2WorktreeEntry extends V2WorktreeResult {
|
|
378
|
+
}
|
|
379
|
+
/** Plugin-side `WorktreeDefinition` (registers an implementation via transform). */
|
|
380
|
+
export interface V2WorktreeDefinition {
|
|
381
|
+
readonly id: string;
|
|
382
|
+
readonly create: (input: V2PluginWorktreeCreateInput, context: {
|
|
383
|
+
readonly signal: AbortSignal;
|
|
384
|
+
}) => Promise<V2WorktreeResult>;
|
|
385
|
+
readonly remove: (input: V2PluginWorktreeRemoveInput, context: {
|
|
386
|
+
readonly signal: AbortSignal;
|
|
387
|
+
}) => Promise<void>;
|
|
388
|
+
readonly list: (sourceDirectory: string, context: {
|
|
389
|
+
readonly signal: AbortSignal;
|
|
390
|
+
}) => Promise<readonly V2WorktreeEntry[]>;
|
|
391
|
+
}
|
|
392
|
+
/** v2 `WorktreeEditor` (dist/promise/worktree.d.ts). */
|
|
393
|
+
export interface V2WorktreeEditor {
|
|
394
|
+
/** Registers an implementation and selects it as the default. */
|
|
395
|
+
add(definition: V2WorktreeDefinition): void;
|
|
396
|
+
}
|
|
397
|
+
/**
|
|
398
|
+
* v2 `WorktreeDomain` (dist/promise/worktree.d.ts 2.0.26): the client
|
|
399
|
+
* `WorktreeApi` (`list`/`create`/`remove`/`refresh`) plus `transform` and
|
|
400
|
+
* `reload`. Consumed by no Phase 1 code path; typed so Phase 2+ (issue #3169)
|
|
401
|
+
* sees the surface with the published requiredness intact.
|
|
402
|
+
*/
|
|
403
|
+
export interface V2WorktreeDomain {
|
|
404
|
+
readonly list: (input: V2WorktreeProjectInput) => Promise<readonly V2WorktreeInfo[]>;
|
|
405
|
+
readonly create: (input: V2WorktreeCreateInput) => Promise<V2WorktreeInfo>;
|
|
406
|
+
readonly remove: (input: V2WorktreeRemoveInput) => Promise<void>;
|
|
407
|
+
readonly refresh: (input: V2WorktreeProjectInput) => Promise<void>;
|
|
408
|
+
readonly reload: () => Promise<void>;
|
|
409
|
+
readonly transform: (callback: (editor: V2WorktreeEditor) => void) => Promise<V2Registration>;
|
|
169
410
|
}
|
|
170
411
|
/** v2 `CommandDefinition` / `CommandEditor` (dist/promise/command.d.ts). */
|
|
171
412
|
export interface V2CommandInvocation {
|
|
@@ -253,6 +494,8 @@ export interface V2PluginContext {
|
|
|
253
494
|
readonly session: V2SessionDomain;
|
|
254
495
|
readonly event: V2EventDomain;
|
|
255
496
|
readonly permission?: V2PermissionDomain;
|
|
497
|
+
/** Present on 2.0.26 hosts; no Phase 1 code path consumes it (issue #3169). */
|
|
498
|
+
readonly worktree?: V2WorktreeDomain;
|
|
256
499
|
readonly [key: string]: unknown;
|
|
257
500
|
}
|
|
258
501
|
/** v2 `Cleanup` — the return of `setup`. */
|