opencode-swarm 7.147.0 → 7.148.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 +26 -11
- package/.opencode/skills/swarm-pr-review/references/findings-persistence-contract.md +39 -13
- package/dist/cli/{ast-diff-665tewz6.js → ast-diff-ekd9v10f.js} +2 -2
- package/dist/cli/{config-doctor-7a2z00qt.js → config-doctor-z2wam5wn.js} +2 -2
- package/dist/cli/{core-50jqqm4g.js → core-k7m76ce0.js} +2 -2
- package/dist/cli/{curation-policy-g353f457.js → curation-policy-kd8j8cne.js} +4 -4
- package/dist/cli/{curator-drift-r50x1rac.js → curator-drift-fv4rttf4.js} +2 -2
- package/dist/cli/{curator-3t7e3hf9.js → curator-jwpm52kg.js} +31 -31
- package/dist/cli/curator-llm-factory-4qt8b15s.js +64 -0
- package/dist/cli/{dispatch-ndxbsk98.js → dispatch-w0rzasz3.js} +2 -2
- package/dist/cli/{evidence-summary-service-8n16gxgm.js → evidence-summary-service-90z295j3.js} +11 -11
- package/dist/cli/{gate-evidence-496qt72z.js → gate-evidence-3q6q71fw.js} +6 -6
- package/dist/cli/guardrail-explain-44xt373y.js +65 -0
- package/dist/cli/{guardrail-log-dy9b5qtt.js → guardrail-log-kbp5jztb.js} +4 -4
- package/dist/cli/guardrail-reset-vpazhh8k.js +90 -0
- package/dist/cli/{hive-promoter-mspppqbp.js → hive-promoter-tdrkz9nh.js} +31 -31
- package/dist/cli/{index-tya6ytex.js → index-016708th.js} +2 -2
- package/dist/cli/{index-er61pycf.js → index-07zgs6y0.js} +6 -6
- package/dist/cli/{index-hw1yghpg.js → index-2y14mjfn.js} +3 -3
- package/dist/cli/{index-w8pgjr75.js → index-4cgee5vh.js} +1 -1
- package/dist/cli/{index-ms46zgwb.js → index-52gnz782.js} +4 -4
- package/dist/cli/{index-sh8xbyca.js → index-702zx3rk.js} +10 -4
- package/dist/cli/{index-k5ng170v.js → index-7ac5z627.js} +2 -2
- package/dist/cli/{index-8py21zn6.js → index-7hctrdk8.js} +1 -1
- package/dist/cli/{index-yq1fxahj.js → index-9pmmexsd.js} +1 -1
- package/dist/cli/{index-92r9z3yk.js → index-crpb0qke.js} +32583 -31080
- package/dist/cli/{index-rpy0bent.js → index-d3bdr78h.js} +2 -2
- package/dist/cli/{index-15twmgzf.js → index-dfvh1r8g.js} +33 -33
- package/dist/cli/{index-20ndbsmh.js → index-dmbaaz6d.js} +8 -5
- package/dist/cli/{index-mfmegbz2.js → index-ffevkn7k.js} +1 -1
- package/dist/cli/{index-e1pxav9g.js → index-fxvgaeq4.js} +1 -1
- package/dist/cli/{index-z9yhhk6q.js → index-g8wwj0sz.js} +1 -1
- package/dist/cli/{index-w4ybhzyg.js → index-gwrv6c56.js} +6 -6
- package/dist/cli/{index-hmssmyvh.js → index-h879g4r4.js} +1 -1
- package/dist/cli/{index-b67y7an8.js → index-jpa03jcc.js} +10 -2
- package/dist/cli/{index-6c17bqbj.js → index-k6h5yc1j.js} +5 -5
- package/dist/cli/{index-argd4rp4.js → index-n0fpefqx.js} +4 -4
- package/dist/cli/{index-bgefx261.js → index-n96wwf56.js} +4 -4
- package/dist/cli/{index-abtrcs16.js → index-nj6rmyeh.js} +1 -1
- package/dist/cli/{index-hcb25p12.js → index-p62we2ar.js} +2 -2
- package/dist/cli/{index-3p4wgm0d.js → index-pgvx3rkq.js} +1 -1
- package/dist/cli/index-q7sjgr1y.js +52 -0
- package/dist/cli/{index-f75qjtn5.js → index-qcm97jfh.js} +1 -1
- package/dist/cli/{index-mdwvn7qe.js → index-qwj7qjjp.js} +2 -2
- package/dist/cli/{index-zj6t9zgx.js → index-r3mvsbtq.js} +8 -1
- package/dist/cli/{index-ddpkwdcb.js → index-r9wnyq0v.js} +1 -1
- package/dist/cli/{index-yjvtk1w2.js → index-rcjq8dm4.js} +2 -2
- package/dist/cli/{index-a3fky5pd.js → index-sycndcwd.js} +1 -1
- package/dist/cli/{index-pna97bbk.js → index-x4rxh8j9.js} +3 -3
- package/dist/cli/{index-p3k155dv.js → index-y586zet4.js} +1 -1
- package/dist/cli/{index-at1m1k5k.js → index-ykjjqg79.js} +6 -6
- package/dist/cli/{index-tp5ytzzg.js → index-zwpttdgn.js} +1 -1
- package/dist/cli/index.js +31 -31
- package/dist/cli/{knowledge-escalator-7gw36zj8.js → knowledge-escalator-0qnm48g8.js} +11 -11
- package/dist/cli/{knowledge-events-r1xak0yw.js → knowledge-events-3zv81nzp.js} +9 -9
- package/dist/cli/{knowledge-link-jkx8xjxp.js → knowledge-link-w91bcyx2.js} +3 -3
- package/dist/cli/{knowledge-store-wzzke013.js → knowledge-store-njtx6wj1.js} +4 -4
- package/dist/cli/{knowledge-validator-mma2bbgp.js → knowledge-validator-7eqj5afv.js} +6 -6
- package/dist/cli/{pending-delegations-k2yqg1sj.js → pending-delegations-k4x00mqc.js} +3 -3
- package/dist/cli/{pr-subscriptions-js5v2xr6.js → pr-subscriptions-x2mqc3f1.js} +3 -3
- package/dist/cli/{runner-q7d22d1w.js → runner-gfzkp9nv.js} +5 -5
- package/dist/cli/{runtime-x10qb3z1.js → runtime-wjwbpp9j.js} +2 -2
- package/dist/cli/{scan-cursor-0vcx58aa.js → scan-cursor-a6dhyf55.js} +5 -5
- package/dist/cli/{schema-qr135rxc.js → schema-p0vn1zgh.js} +1 -1
- package/dist/cli/{scope-persistence-x7v9mb9k.js → scope-persistence-zs97zkt7.js} +7 -7
- package/dist/cli/{skill-generator-aee04dwa.js → skill-generator-5qg15q1j.js} +14 -13
- package/dist/cli/{workspace-snapshot-kznz5e13.js → workspace-snapshot-nq25j94x.js} +2 -2
- package/dist/cli/{worktree-collision-ownership-xj0bsg92.js → worktree-collision-ownership-q2gswg16.js} +4 -4
- package/dist/cli/{worktree-isolation-ar52a7xr.js → worktree-isolation-ndb5fwys.js} +31 -31
- package/dist/cli/{worktree-provisioning-owner-72cyddz5.js → worktree-provisioning-owner-cve95q4f.js} +3 -3
- package/dist/commands/guardrail-reset.d.ts +2 -0
- package/dist/commands/registry.d.ts +16 -3
- package/dist/config/schema.d.ts +2 -0
- package/dist/failures/action-circuit.d.ts +69 -0
- package/dist/failures/action-identity.d.ts +33 -0
- package/dist/failures/invocation-failure.d.ts +77 -0
- package/dist/full-auto/oversight.d.ts +21 -0
- package/dist/full-auto/policy.d.ts +22 -0
- package/dist/full-auto/recovery.d.ts +43 -0
- package/dist/full-auto/severe-result.d.ts +86 -0
- package/dist/full-auto/state.d.ts +18 -0
- package/dist/hooks/full-auto-intercept.d.ts +1 -1
- package/dist/hooks/gate-denial-tracker.d.ts +1 -1
- package/dist/hooks/guardrails/nontransient-circuit.d.ts +19 -5
- package/dist/hooks/pr-workflow-gate.d.ts +64 -3
- package/dist/index.js +2866 -2816
- package/dist/lang/symbol-visibility.d.ts +10 -7
- package/dist/learning/admission.d.ts +1 -1
- package/dist/models/model-override-state.d.ts +47 -0
- package/dist/models/task-model-routing.d.ts +71 -0
- package/dist/services/diagnose-service.d.ts +2 -2
- package/dist/tools/dispatch-lanes.d.ts +16 -1
- package/dist/tools/repo-graph/types.d.ts +6 -4
- package/dist/utils/model-dispatch-fallback.d.ts +31 -10
- package/dist/utils/timeout.d.ts +18 -4
- package/package.json +1 -1
- package/dist/cli/curator-llm-factory-7cm4494k.js +0 -64
- package/dist/cli/guardrail-explain-my9zj5pj.js +0 -65
- package/dist/cli/index-wx8zdh4a.js +0 -24
|
@@ -37,14 +37,17 @@ export interface SymbolVisibilityContext {
|
|
|
37
37
|
/**
|
|
38
38
|
* Tree-sitter node type of the nearest enclosing type container
|
|
39
39
|
* (`class_declaration`, `interface_declaration`, `enum_declaration`,
|
|
40
|
-
* `record_declaration`, `struct_declaration`, `object_declaration
|
|
41
|
-
*
|
|
40
|
+
* `record_declaration`, `struct_declaration`, `object_declaration`,
|
|
41
|
+
* and for cpp the class/struct/union specifiers), or `undefined` when the
|
|
42
|
+
* declaration has no enclosing type container.
|
|
42
43
|
*
|
|
43
|
-
*
|
|
44
|
-
* *kind* of container decides the implicit visibility
|
|
45
|
-
* carries no explicit modifier (an interface member is
|
|
46
|
-
* both Java and C#, a C# class member is implicitly
|
|
47
|
-
* member is implicitly package-private
|
|
44
|
+
* Populated for the JVM/.NET grammars (java/kotlin/csharp) and for
|
|
45
|
+
* cpp/swift, where the *kind* of container decides the implicit visibility
|
|
46
|
+
* of a member that carries no explicit modifier (an interface member is
|
|
47
|
+
* implicitly public in both Java and C#, a C# class member is implicitly
|
|
48
|
+
* private, a Java class member is implicitly package-private, a Swift
|
|
49
|
+
* member is implicitly internal, and a C++ member defaults by container
|
|
50
|
+
* kind — class private, struct/union public).
|
|
48
51
|
*/
|
|
49
52
|
parentContainerType?: string;
|
|
50
53
|
}
|
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
* - only genuinely cancellable work (the optional LLM screening call) is
|
|
20
20
|
* bounded, via a manual `AbortController` + `setTimeout` (see
|
|
21
21
|
* `timeoutSignal` below) + `isAbortError`. This deliberately does NOT use
|
|
22
|
-
*
|
|
22
|
+
* the host's built-in timeout signal: Bun on Windows
|
|
23
23
|
* has a native bug where that signal's `abort` event never fires when
|
|
24
24
|
* awaited by a plain JS Promise (oven-sh/bun#29546) — exactly the shape
|
|
25
25
|
* `screenCandidate`'s caller uses — which hung this file's own tests for
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
export interface ModelOverrideParts {
|
|
2
|
+
providerID: string;
|
|
3
|
+
modelID: string;
|
|
4
|
+
}
|
|
5
|
+
export interface ScopedModelOverrideKey {
|
|
6
|
+
sessionID: string;
|
|
7
|
+
invocationID: string;
|
|
8
|
+
role: string;
|
|
9
|
+
swarmID?: string;
|
|
10
|
+
}
|
|
11
|
+
export interface NormalizedModelChain {
|
|
12
|
+
readonly primary?: {
|
|
13
|
+
modelString: string;
|
|
14
|
+
override: ModelOverrideParts;
|
|
15
|
+
};
|
|
16
|
+
readonly fallbacks: readonly {
|
|
17
|
+
modelString: string;
|
|
18
|
+
override: ModelOverrideParts;
|
|
19
|
+
}[];
|
|
20
|
+
readonly signature: string;
|
|
21
|
+
readonly totalModels: number;
|
|
22
|
+
}
|
|
23
|
+
export interface ScopedModelSelection {
|
|
24
|
+
readonly generation: number;
|
|
25
|
+
readonly fallbackIndex: number;
|
|
26
|
+
readonly modelString?: string;
|
|
27
|
+
readonly model?: ModelOverrideParts;
|
|
28
|
+
readonly exhausted: boolean;
|
|
29
|
+
readonly totalModels: number;
|
|
30
|
+
}
|
|
31
|
+
export interface ScopedModelAdvanceResult {
|
|
32
|
+
readonly accepted: boolean;
|
|
33
|
+
readonly selection: ScopedModelSelection;
|
|
34
|
+
}
|
|
35
|
+
export interface ScopedModelSelectionSnapshotEntry {
|
|
36
|
+
readonly key: ScopedModelOverrideKey;
|
|
37
|
+
readonly generation: number;
|
|
38
|
+
readonly fallbackIndex: number;
|
|
39
|
+
readonly updatedAt: number;
|
|
40
|
+
}
|
|
41
|
+
export declare function normalizeModelChain(primaryModel: string | undefined, fallbackModels: Iterable<string | null | undefined>): NormalizedModelChain;
|
|
42
|
+
export declare function resolveScopedModelSelection(scope: ScopedModelOverrideKey, chain: NormalizedModelChain, now?: number): ScopedModelSelection;
|
|
43
|
+
export declare function advanceScopedModelSelection(scope: ScopedModelOverrideKey, chain: NormalizedModelChain, expectedGeneration: number, now?: number): ScopedModelAdvanceResult;
|
|
44
|
+
export declare function resetScopedModelSelection(scope: ScopedModelOverrideKey, expectedGeneration?: number): boolean;
|
|
45
|
+
export declare function clearScopedModelSelectionsForSession(sessionID: string): void;
|
|
46
|
+
export declare function getScopedModelSelectionSnapshot(): readonly ScopedModelSelectionSnapshotEntry[];
|
|
47
|
+
export declare function resetScopedModelSelectionStateForTests(): void;
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import { getScopedModelSelectionSnapshot, type ModelOverrideParts, type ScopedModelOverrideKey } from './model-override-state.js';
|
|
2
|
+
export interface PendingTaskModelRouteInput {
|
|
3
|
+
parentSessionID: string;
|
|
4
|
+
invocationID: string;
|
|
5
|
+
callID: string;
|
|
6
|
+
role: string;
|
|
7
|
+
actionDigest: string;
|
|
8
|
+
swarmID?: string;
|
|
9
|
+
}
|
|
10
|
+
export interface BindTaskModelRouteChildInput {
|
|
11
|
+
parentSessionID: string;
|
|
12
|
+
callID: string;
|
|
13
|
+
childSessionID: string;
|
|
14
|
+
}
|
|
15
|
+
export interface AdvanceTaskModelRouteInput {
|
|
16
|
+
childSessionID: string;
|
|
17
|
+
role: string;
|
|
18
|
+
actionDigest: string;
|
|
19
|
+
primaryModel?: string;
|
|
20
|
+
fallbackModels?: Iterable<string | null | undefined>;
|
|
21
|
+
expectedGeneration?: number;
|
|
22
|
+
now?: number;
|
|
23
|
+
}
|
|
24
|
+
export interface ResolveTaskChatModelOverrideInput {
|
|
25
|
+
childSessionID: string;
|
|
26
|
+
role: string;
|
|
27
|
+
primaryModel?: string;
|
|
28
|
+
fallbackModels?: Iterable<string | null | undefined>;
|
|
29
|
+
actionDigest?: string;
|
|
30
|
+
lookupParentSessionID?: (childSessionID: string) => Promise<string | undefined>;
|
|
31
|
+
now?: number;
|
|
32
|
+
}
|
|
33
|
+
export interface TaskChatModelOverrideResolution {
|
|
34
|
+
status: 'override' | 'primary' | 'exhausted' | 'missing' | 'ambiguous' | 'mismatch';
|
|
35
|
+
model?: ModelOverrideParts;
|
|
36
|
+
modelString?: string;
|
|
37
|
+
fallbackIndex?: number;
|
|
38
|
+
generation?: number;
|
|
39
|
+
scope?: ScopedModelOverrideKey;
|
|
40
|
+
route?: PendingTaskModelRouteSnapshotEntry;
|
|
41
|
+
}
|
|
42
|
+
export interface TaskModelRouteAdvanceResult {
|
|
43
|
+
accepted: boolean;
|
|
44
|
+
exhausted: boolean;
|
|
45
|
+
fallbackIndex: number;
|
|
46
|
+
generation: number;
|
|
47
|
+
scope: ScopedModelOverrideKey;
|
|
48
|
+
route?: PendingTaskModelRouteSnapshotEntry;
|
|
49
|
+
}
|
|
50
|
+
export interface PendingTaskModelRouteSnapshotEntry {
|
|
51
|
+
parentSessionID: string;
|
|
52
|
+
invocationID: string;
|
|
53
|
+
callID: string;
|
|
54
|
+
role: string;
|
|
55
|
+
actionDigest: string;
|
|
56
|
+
swarmID?: string;
|
|
57
|
+
childSessionID?: string;
|
|
58
|
+
updatedAt: number;
|
|
59
|
+
}
|
|
60
|
+
export declare function registerPendingTaskModelRoute(input: PendingTaskModelRouteInput, now?: number): PendingTaskModelRouteSnapshotEntry;
|
|
61
|
+
export declare function bindPendingTaskModelRouteChild(input: BindTaskModelRouteChildInput, now?: number): PendingTaskModelRouteSnapshotEntry | undefined;
|
|
62
|
+
export declare function advancePendingTaskModelRoute(input: AdvanceTaskModelRouteInput): TaskModelRouteAdvanceResult | undefined;
|
|
63
|
+
export declare function resolveTaskChatModelOverride(input: ResolveTaskChatModelOverrideInput): Promise<TaskChatModelOverrideResolution>;
|
|
64
|
+
export declare function clearPendingTaskModelRoutesForSession(sessionID: string): void;
|
|
65
|
+
export declare function getPendingTaskModelRouteSnapshot(): readonly PendingTaskModelRouteSnapshotEntry[];
|
|
66
|
+
export declare function getTaskModelRoutingStateSnapshot(): {
|
|
67
|
+
routes: readonly PendingTaskModelRouteSnapshotEntry[];
|
|
68
|
+
scopedSelections: ReturnType<typeof getScopedModelSelectionSnapshot>;
|
|
69
|
+
};
|
|
70
|
+
export declare function clearAllTaskModelRoutingState(): void;
|
|
71
|
+
export declare const resetTaskModelRoutingStateForTests: typeof clearAllTaskModelRoutingState;
|
|
@@ -35,7 +35,7 @@ export declare function resolveGrammarDir(thisDir: string): string;
|
|
|
35
35
|
* Get diagnose data from the swarm directory.
|
|
36
36
|
* Returns structured health checks for GUI, background flows, or commands.
|
|
37
37
|
*/
|
|
38
|
-
export declare function getDiagnoseData(directory: string): Promise<DiagnoseData>;
|
|
38
|
+
export declare function getDiagnoseData(directory: string, sessionID?: string): Promise<DiagnoseData>;
|
|
39
39
|
/**
|
|
40
40
|
* Format diagnose data as markdown for command output.
|
|
41
41
|
*/
|
|
@@ -44,4 +44,4 @@ export declare function formatDiagnoseMarkdown(diagnose: DiagnoseData): string;
|
|
|
44
44
|
* Handle diagnose command - delegates to service and formats output.
|
|
45
45
|
* Kept for backward compatibility - thin adapter.
|
|
46
46
|
*/
|
|
47
|
-
export declare function handleDiagnoseCommand(directory: string, _args: string[]): Promise<string>;
|
|
47
|
+
export declare function handleDiagnoseCommand(directory: string, _args: string[], sessionID?: string): Promise<string>;
|
|
@@ -2,7 +2,7 @@ import { z } from 'zod';
|
|
|
2
2
|
import { type BackgroundDelegationRecord, type BackgroundDelegationResult, type BackgroundDelegationWorkflowLaneRecovery } from '../background/pending-delegations.js';
|
|
3
3
|
import { resolveExactMergeBaseAsync, resolvePrWorkflowRevisionDigestAsync } from '../background/workspace-snapshot.js';
|
|
4
4
|
import { loadPluginConfig } from '../config/loader.js';
|
|
5
|
-
import { type PrReviewDepthTier, type PrReviewVerdictCollectionReceipt, validatePrWorkflowTransportRecovery } from '../hooks/pr-workflow-gate.js';
|
|
5
|
+
import { type PrReviewDepthTier, type PrReviewVerdictCollectionReceipt, type PrWorkflowPendingLaneLiveness, validatePrWorkflowTransportRecovery } from '../hooks/pr-workflow-gate.js';
|
|
6
6
|
import { buildLaneOrientationBlock } from '../hooks/repo-graph-injection.js';
|
|
7
7
|
import { createParallelDispatcher } from '../parallel/dispatcher/parallel-dispatcher.js';
|
|
8
8
|
import { createSwarmTool } from './create-tool.js';
|
|
@@ -194,6 +194,13 @@ export interface CollectLaneResultsResult {
|
|
|
194
194
|
consumed: number;
|
|
195
195
|
all_settled: boolean;
|
|
196
196
|
lane_results: DispatchLaneResult[];
|
|
197
|
+
/**
|
|
198
|
+
* Alert-only host liveness advisory for still-pending pr-review lanes past
|
|
199
|
+
* the pending-liveness threshold (issue #2280 Part B). Present only when at
|
|
200
|
+
* least one such lane exists; never affects `success`, counts, settlement,
|
|
201
|
+
* or any lane's state.
|
|
202
|
+
*/
|
|
203
|
+
pending_liveness?: PrWorkflowPendingLaneLiveness[];
|
|
197
204
|
errors?: string[];
|
|
198
205
|
}
|
|
199
206
|
export interface SessionOps {
|
|
@@ -217,6 +224,10 @@ export interface SessionOps {
|
|
|
217
224
|
};
|
|
218
225
|
body: {
|
|
219
226
|
agent: string;
|
|
227
|
+
model?: {
|
|
228
|
+
providerID: string;
|
|
229
|
+
modelID: string;
|
|
230
|
+
};
|
|
220
231
|
tools: ReadOnlyToolPermissions;
|
|
221
232
|
parts: Array<{
|
|
222
233
|
type: 'text';
|
|
@@ -242,6 +253,10 @@ export interface SessionOps {
|
|
|
242
253
|
};
|
|
243
254
|
body: {
|
|
244
255
|
agent: string;
|
|
256
|
+
model?: {
|
|
257
|
+
providerID: string;
|
|
258
|
+
modelID: string;
|
|
259
|
+
};
|
|
245
260
|
tools: ReadOnlyToolPermissions;
|
|
246
261
|
parts: Array<{
|
|
247
262
|
type: 'text';
|
|
@@ -19,7 +19,7 @@ export declare const REPO_GRAPH_FILENAME = "repo-graph.json";
|
|
|
19
19
|
*
|
|
20
20
|
* 1.2.0 adds per-node `exportRanges` (1-based inclusive line spans keyed by
|
|
21
21
|
* symbol name — exported symbols for every grammar, plus non-exported member
|
|
22
|
-
* defs for java/kotlin/csharp; see the field docs) and the top-level
|
|
22
|
+
* defs for java/kotlin/csharp/cpp/swift; see the field docs) and the top-level
|
|
23
23
|
* `symbolEdges` array (direct symbol-to-
|
|
24
24
|
* symbol reference edges). Both fields are optional, so 1.0.0 and 1.1.0 graphs
|
|
25
25
|
* still load without corruption. New queries may use these fields to provide
|
|
@@ -130,10 +130,12 @@ export interface GraphNode {
|
|
|
130
130
|
* Each span value uses `startLine` / `endLine` to match the codebase
|
|
131
131
|
* convention (see `ContextPackSpan` and `FileSymbolFacts`).
|
|
132
132
|
*
|
|
133
|
-
* SCOPE (
|
|
134
|
-
* non-exported member defs for java/kotlin/csharp. A
|
|
133
|
+
* SCOPE (issues #1529 and #1530): exported symbols for every grammar,
|
|
134
|
+
* PLUS non-exported member defs for java/kotlin/csharp/cpp/swift. A
|
|
135
|
+
* JVM/.NET or native-language member (or a Swift extension block) is
|
|
135
136
|
* deliberately never a file-level export, so without that widening
|
|
136
|
-
* `context_pack` could return no span at all for a Java method
|
|
137
|
+
* `context_pack` could return no span at all for a Java method or a
|
|
138
|
+
* private C++ helper.
|
|
137
139
|
* `exports` and `exportLines` stay exported-only in every language.
|
|
138
140
|
*
|
|
139
141
|
* Duplicate names resolve so this map cannot disagree with `exportLines`:
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { type ScopedModelOverrideKey } from '../models/model-override-state.js';
|
|
1
2
|
/**
|
|
2
3
|
* Issue #1896 (sub-issue 3): shared model-fallback dispatch helper.
|
|
3
4
|
*
|
|
@@ -10,14 +11,7 @@
|
|
|
10
11
|
* All those stages dispatch via `client.session.prompt({ body: { agent, model }})`,
|
|
11
12
|
* which accepts a per-call `model: {providerID, modelID}` override. This helper
|
|
12
13
|
* wraps such a dispatch with (a) bounded, per-model transient retry and (b)
|
|
13
|
-
* model-fallback advance — kept INDEPENDENT per AGENTS.md invariant #9.
|
|
14
|
-
* fallback index is owned LOCALLY here: every stage dispatches into an ephemeral
|
|
15
|
-
* child session, so the only reachable `session.model_fallback_index` belongs to
|
|
16
|
-
* the parent orchestrator (a different agent) and must not be reused.
|
|
17
|
-
*
|
|
18
|
-
* The helper does NOT import `src/agents/index.ts` (avoids a heavy import cycle);
|
|
19
|
-
* the caller injects a `resolveFallback(index)` closure that wraps
|
|
20
|
-
* `resolveFallbackModel(baseRole, index, getSwarmAgents(swarmId))`.
|
|
14
|
+
* model-fallback advance — kept INDEPENDENT per AGENTS.md invariant #9.
|
|
21
15
|
*/
|
|
22
16
|
/** Per-call model override shape accepted by `client.session.prompt` body. */
|
|
23
17
|
export interface ModelOverride {
|
|
@@ -41,19 +35,29 @@ export interface ModelFallbackResult<T> {
|
|
|
41
35
|
}
|
|
42
36
|
export interface DispatchWithModelFallbackOptions<T> {
|
|
43
37
|
/** Dispatch using `model` (undefined = the agent's registered/primary model). */
|
|
44
|
-
dispatch: (model: ModelOverride | undefined
|
|
38
|
+
dispatch: (model: ModelOverride | undefined, context: {
|
|
39
|
+
attemptNumber: number;
|
|
40
|
+
fallbackIndex: number;
|
|
41
|
+
modelString?: string;
|
|
42
|
+
remainingMs?: number;
|
|
43
|
+
generation?: number;
|
|
44
|
+
}) => Promise<T>;
|
|
45
45
|
/**
|
|
46
46
|
* Resolve the 1-based fallback model as a `provider/model` string, or null
|
|
47
47
|
* when the fallback chain is exhausted. Typically wraps
|
|
48
48
|
* `resolveFallbackModel(baseRole, index, getSwarmAgents(swarmId))`.
|
|
49
49
|
*/
|
|
50
|
-
resolveFallback
|
|
50
|
+
resolveFallback?: (fallbackIndex: number) => string | null;
|
|
51
51
|
/** Classify a dispatch error: 'transient' → retry/failover; 'permanent' → throw immediately. */
|
|
52
52
|
classify: (error: unknown) => 'transient' | 'permanent';
|
|
53
53
|
/** Bounded transient retries on the SAME model before advancing (invariant #9 — independent of fallback). Default 1. */
|
|
54
54
|
maxTransientRetriesPerModel?: number;
|
|
55
55
|
/** Backoff before a same-model retry (NOT before a fallback advance). Default 2**(n-1)*1000 ms. */
|
|
56
56
|
backoffMs?: (retryAttempt: number) => number;
|
|
57
|
+
/** Absolute wall-clock deadline in Unix ms shared across dispatch, retry, and backoff. */
|
|
58
|
+
deadlineAtMs?: number;
|
|
59
|
+
/** Hard cap across all attempts, independent of retry/fallback structure. */
|
|
60
|
+
maxAttempts?: number;
|
|
57
61
|
/** Notified when advancing to a fallback model (for advisory/telemetry). */
|
|
58
62
|
onFallback?: (info: {
|
|
59
63
|
toModel: string;
|
|
@@ -61,7 +65,24 @@ export interface DispatchWithModelFallbackOptions<T> {
|
|
|
61
65
|
}) => void;
|
|
62
66
|
/** DI for tests (avoid real waits). */
|
|
63
67
|
sleep?: (ms: number) => Promise<void>;
|
|
68
|
+
/** Clock injection for deadline tests. */
|
|
69
|
+
now?: () => number;
|
|
70
|
+
/**
|
|
71
|
+
* Optional scoped override contract for direct role-bound dispatch paths.
|
|
72
|
+
* When supplied together with a primary model and fallback chain, model
|
|
73
|
+
* selection is keyed by session/invocation/swarm/role and reset on success.
|
|
74
|
+
*/
|
|
75
|
+
scope?: ScopedModelOverrideKey;
|
|
76
|
+
primaryModel?: string;
|
|
77
|
+
fallbackModels?: Iterable<string | null | undefined>;
|
|
78
|
+
}
|
|
79
|
+
export declare class ModelDispatchTimeoutError extends Error {
|
|
80
|
+
constructor(message?: string);
|
|
64
81
|
}
|
|
82
|
+
export declare const _internals: {
|
|
83
|
+
setTimeout: typeof setTimeout;
|
|
84
|
+
clearTimeout: typeof clearTimeout;
|
|
85
|
+
};
|
|
65
86
|
/**
|
|
66
87
|
* Try the primary model, then each configured fallback, retrying transient
|
|
67
88
|
* failures a bounded number of times per model. A permanent failure throws
|
package/dist/utils/timeout.d.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Timeout primitives used by the plugin init path.
|
|
3
3
|
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
4
|
+
* Every Promise.race clears its timer in `finally`, so completed operations do
|
|
5
|
+
* not leak a process handle. A timer that is itself required to settle an
|
|
6
|
+
* awaited promise remains ref'ed: Bun can strand that caller when its only
|
|
7
|
+
* settlement handle is unref'ed.
|
|
8
8
|
*/
|
|
9
9
|
/**
|
|
10
10
|
* Race a promise against a timeout. The timer is cleared in `finally` so the
|
|
@@ -17,6 +17,20 @@
|
|
|
17
17
|
* @param timeoutError Error thrown when the deadline elapses.
|
|
18
18
|
*/
|
|
19
19
|
export declare function withTimeout<T>(promise: Promise<T>, ms: number, timeoutError: Error): Promise<T>;
|
|
20
|
+
/**
|
|
21
|
+
* Race a cancellable operation against a timeout while also supplying an
|
|
22
|
+
* `AbortSignal` that is tripped when the deadline elapses.
|
|
23
|
+
*
|
|
24
|
+
* This is the shared helper for cross-platform request/LLM timeouts: callers
|
|
25
|
+
* get a real abort signal for cooperative cancellation, but the outer race
|
|
26
|
+
* still returns if the callee ignores that signal.
|
|
27
|
+
*/
|
|
28
|
+
export declare function withTimeoutSignal<T>(operation: (signal: AbortSignal) => Promise<T>, ms: number, timeoutError: Error): Promise<T>;
|
|
29
|
+
/** Dependency-injection seam for deterministic timer-cleanup tests. */
|
|
30
|
+
export declare const _internals: {
|
|
31
|
+
setTimeout: typeof setTimeout;
|
|
32
|
+
clearTimeout: typeof clearTimeout;
|
|
33
|
+
};
|
|
20
34
|
/**
|
|
21
35
|
* Yield to the macrotask queue. Works under both Node and Bun runtimes,
|
|
22
36
|
* unlike `setImmediate` which is Node-only. The timer intentionally remains
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "opencode-swarm",
|
|
3
|
-
"version": "7.
|
|
3
|
+
"version": "7.148.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",
|
|
@@ -1,64 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
import {
|
|
3
|
-
createCuratorLLMDelegate
|
|
4
|
-
} from "./index-92r9z3yk.js";
|
|
5
|
-
import"./index-hcb25p12.js";
|
|
6
|
-
import"./index-b67y7an8.js";
|
|
7
|
-
import"./index-yq1fxahj.js";
|
|
8
|
-
import"./index-at1m1k5k.js";
|
|
9
|
-
import"./index-p3k155dv.js";
|
|
10
|
-
import"./index-134d35c1.js";
|
|
11
|
-
import"./index-abtrcs16.js";
|
|
12
|
-
import"./index-y8552snf.js";
|
|
13
|
-
import"./index-6c17bqbj.js";
|
|
14
|
-
import"./index-tya6ytex.js";
|
|
15
|
-
import"./index-70ha9e09.js";
|
|
16
|
-
import"./index-c8s9a3zh.js";
|
|
17
|
-
import"./index-9ss2m4rs.js";
|
|
18
|
-
import"./index-z9yhhk6q.js";
|
|
19
|
-
import"./index-3p4wgm0d.js";
|
|
20
|
-
import"./index-20ndbsmh.js";
|
|
21
|
-
import"./index-bgefx261.js";
|
|
22
|
-
import"./index-tp5ytzzg.js";
|
|
23
|
-
import"./index-rtry5xyf.js";
|
|
24
|
-
import"./index-zsrtt42s.js";
|
|
25
|
-
import"./index-rpy0bent.js";
|
|
26
|
-
import"./index-e1pxav9g.js";
|
|
27
|
-
import"./index-argd4rp4.js";
|
|
28
|
-
import"./index-k5ng170v.js";
|
|
29
|
-
import"./index-ms46zgwb.js";
|
|
30
|
-
import"./index-hmssmyvh.js";
|
|
31
|
-
import"./index-556ja8an.js";
|
|
32
|
-
import"./index-b43rt5ph.js";
|
|
33
|
-
import"./index-wx8zdh4a.js";
|
|
34
|
-
import"./index-3g0xk6tk.js";
|
|
35
|
-
import"./index-85gkedsf.js";
|
|
36
|
-
import"./index-er61pycf.js";
|
|
37
|
-
import"./index-w4ybhzyg.js";
|
|
38
|
-
import"./index-yjvtk1w2.js";
|
|
39
|
-
import"./index-gprxjmm7.js";
|
|
40
|
-
import"./index-n832052r.js";
|
|
41
|
-
import"./index-mfmegbz2.js";
|
|
42
|
-
import"./index-sh8xbyca.js";
|
|
43
|
-
import"./index-cpg98bh1.js";
|
|
44
|
-
import"./index-9e6fdz2h.js";
|
|
45
|
-
import"./index-4rhhvd1a.js";
|
|
46
|
-
import"./index-w8pgjr75.js";
|
|
47
|
-
import"./index-z6xqpmqg.js";
|
|
48
|
-
import"./index-zj6t9zgx.js";
|
|
49
|
-
import"./index-zjygnfay.js";
|
|
50
|
-
import"./index-ae75rja9.js";
|
|
51
|
-
import"./index-f75qjtn5.js";
|
|
52
|
-
import"./index-8py21zn6.js";
|
|
53
|
-
import"./index-bk5tah7q.js";
|
|
54
|
-
import"./index-hw1yghpg.js";
|
|
55
|
-
import"./index-6q35swn2.js";
|
|
56
|
-
import"./index-q81s0m8k.js";
|
|
57
|
-
import"./index-7g4c7s5r.js";
|
|
58
|
-
import"./index-bpmtbmy9.js";
|
|
59
|
-
import"./index-ed5ykebp.js";
|
|
60
|
-
import"./index-zgwm4ryv.js";
|
|
61
|
-
import"./index-a76rekgs.js";
|
|
62
|
-
export {
|
|
63
|
-
createCuratorLLMDelegate
|
|
64
|
-
};
|
|
@@ -1,65 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
import {
|
|
3
|
-
handleGuardrailExplain
|
|
4
|
-
} from "./index-mdwvn7qe.js";
|
|
5
|
-
import"./index-92r9z3yk.js";
|
|
6
|
-
import"./index-hcb25p12.js";
|
|
7
|
-
import"./index-b67y7an8.js";
|
|
8
|
-
import"./index-yq1fxahj.js";
|
|
9
|
-
import"./index-at1m1k5k.js";
|
|
10
|
-
import"./index-p3k155dv.js";
|
|
11
|
-
import"./index-134d35c1.js";
|
|
12
|
-
import"./index-abtrcs16.js";
|
|
13
|
-
import"./index-y8552snf.js";
|
|
14
|
-
import"./index-6c17bqbj.js";
|
|
15
|
-
import"./index-tya6ytex.js";
|
|
16
|
-
import"./index-70ha9e09.js";
|
|
17
|
-
import"./index-c8s9a3zh.js";
|
|
18
|
-
import"./index-9ss2m4rs.js";
|
|
19
|
-
import"./index-z9yhhk6q.js";
|
|
20
|
-
import"./index-3p4wgm0d.js";
|
|
21
|
-
import"./index-20ndbsmh.js";
|
|
22
|
-
import"./index-bgefx261.js";
|
|
23
|
-
import"./index-tp5ytzzg.js";
|
|
24
|
-
import"./index-rtry5xyf.js";
|
|
25
|
-
import"./index-zsrtt42s.js";
|
|
26
|
-
import"./index-rpy0bent.js";
|
|
27
|
-
import"./index-e1pxav9g.js";
|
|
28
|
-
import"./index-argd4rp4.js";
|
|
29
|
-
import"./index-k5ng170v.js";
|
|
30
|
-
import"./index-ms46zgwb.js";
|
|
31
|
-
import"./index-hmssmyvh.js";
|
|
32
|
-
import"./index-556ja8an.js";
|
|
33
|
-
import"./index-b43rt5ph.js";
|
|
34
|
-
import"./index-wx8zdh4a.js";
|
|
35
|
-
import"./index-3g0xk6tk.js";
|
|
36
|
-
import"./index-85gkedsf.js";
|
|
37
|
-
import"./index-er61pycf.js";
|
|
38
|
-
import"./index-w4ybhzyg.js";
|
|
39
|
-
import"./index-yjvtk1w2.js";
|
|
40
|
-
import"./index-gprxjmm7.js";
|
|
41
|
-
import"./index-n832052r.js";
|
|
42
|
-
import"./index-mfmegbz2.js";
|
|
43
|
-
import"./index-sh8xbyca.js";
|
|
44
|
-
import"./index-cpg98bh1.js";
|
|
45
|
-
import"./index-9e6fdz2h.js";
|
|
46
|
-
import"./index-4rhhvd1a.js";
|
|
47
|
-
import"./index-w8pgjr75.js";
|
|
48
|
-
import"./index-z6xqpmqg.js";
|
|
49
|
-
import"./index-zj6t9zgx.js";
|
|
50
|
-
import"./index-zjygnfay.js";
|
|
51
|
-
import"./index-ae75rja9.js";
|
|
52
|
-
import"./index-f75qjtn5.js";
|
|
53
|
-
import"./index-8py21zn6.js";
|
|
54
|
-
import"./index-bk5tah7q.js";
|
|
55
|
-
import"./index-hw1yghpg.js";
|
|
56
|
-
import"./index-6q35swn2.js";
|
|
57
|
-
import"./index-q81s0m8k.js";
|
|
58
|
-
import"./index-7g4c7s5r.js";
|
|
59
|
-
import"./index-bpmtbmy9.js";
|
|
60
|
-
import"./index-ed5ykebp.js";
|
|
61
|
-
import"./index-zgwm4ryv.js";
|
|
62
|
-
import"./index-a76rekgs.js";
|
|
63
|
-
export {
|
|
64
|
-
handleGuardrailExplain
|
|
65
|
-
};
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
// src/utils/timeout.ts
|
|
3
|
-
async function withTimeout(promise, ms, timeoutError) {
|
|
4
|
-
let timer;
|
|
5
|
-
const timeoutPromise = new Promise((_, reject) => {
|
|
6
|
-
timer = setTimeout(() => reject(timeoutError), ms);
|
|
7
|
-
if (typeof timer.unref === "function") {
|
|
8
|
-
timer.unref();
|
|
9
|
-
}
|
|
10
|
-
});
|
|
11
|
-
try {
|
|
12
|
-
return await Promise.race([promise, timeoutPromise]);
|
|
13
|
-
} finally {
|
|
14
|
-
if (timer !== undefined)
|
|
15
|
-
clearTimeout(timer);
|
|
16
|
-
}
|
|
17
|
-
}
|
|
18
|
-
function yieldToEventLoop() {
|
|
19
|
-
return new Promise((resolve) => {
|
|
20
|
-
setTimeout(resolve, 0);
|
|
21
|
-
});
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
export { withTimeout, yieldToEventLoop };
|