opencode-swarm 7.132.2 → 7.134.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/README.md +4 -1
- package/dist/agents/agent-output-schema.d.ts +74 -0
- package/dist/agents/critic.d.ts +2 -1
- package/dist/agents/reviewer.d.ts +1 -1
- package/dist/background/completion-observer.d.ts +17 -5
- package/dist/background/pending-delegations.d.ts +315 -2
- package/dist/background/stage-b-gates.d.ts +2 -0
- package/dist/cli/{config-doctor-bp5spb79.js → config-doctor-t5r92674.js} +3 -3
- package/dist/cli/{core-wg3re04e.js → core-d6yd2jzv.js} +2 -2
- package/dist/cli/{curation-policy-7zp2m9gv.js → curation-policy-3smfn2a3.js} +7 -7
- package/dist/cli/{curator-drift-y1wm4atk.js → curator-drift-tsyyf4b4.js} +4 -4
- package/dist/cli/{curator-h067mrcc.js → curator-hva8f3nf.js} +31 -29
- package/dist/cli/{curator-llm-factory-605d08hf.js → curator-llm-factory-p3aqev12.js} +31 -29
- package/dist/cli/{dispatch-3mhgqj2x.js → dispatch-gxbeb2ps.js} +2 -2
- package/dist/cli/{evidence-summary-service-jfagmvrh.js → evidence-summary-service-mrzsjpg4.js} +12 -11
- package/dist/cli/{gate-evidence-cy2te3x8.js → gate-evidence-b5v1xvxp.js} +4 -4
- package/dist/cli/guardrail-explain-k8mcvk61.js +57 -0
- package/dist/cli/{guardrail-log-aa112fxv.js → guardrail-log-absma1rv.js} +5 -5
- package/dist/cli/{hive-promoter-nv0m5rzk.js → hive-promoter-jwd51gzk.js} +31 -29
- package/dist/cli/{index-g4mnf3p5.js → index-1j3682j8.js} +5 -5
- package/dist/cli/{index-6ccynjv3.js → index-2njes601.js} +8 -8
- package/dist/cli/{index-w9cb5zwh.js → index-2t1n9k7b.js} +4 -4
- package/dist/cli/{index-f6480ee6.js → index-3dtjhr26.js} +5259 -1759
- package/dist/cli/{index-2tn5h2zp.js → index-4p02dp92.js} +6 -6
- package/dist/cli/index-b4z7s917.js +80 -0
- package/dist/cli/{index-bvp2v7k1.js → index-b5ek2cge.js} +266 -19
- package/dist/cli/index-b8zgtz81.js +123 -0
- package/dist/cli/{index-3s9rfnqq.js → index-baawkm48.js} +12 -12
- package/dist/cli/{index-fgcmxjp7.js → index-c3e0ymrg.js} +1 -1
- package/dist/cli/{index-q27bajqb.js → index-cfkvc5q9.js} +3 -3
- package/dist/cli/{index-7mkpsw6g.js → index-dd7ttx8x.js} +1 -1
- package/dist/cli/{index-jgfcp9bh.js → index-dgxgvzab.js} +7 -7
- package/dist/cli/{index-8d3m0ge3.js → index-eedq2y40.js} +48 -34
- package/dist/cli/{index-630badhp.js → index-g87ty4wp.js} +149 -6
- package/dist/cli/{index-yvv1wt2h.js → index-hgh01f6h.js} +25 -3
- package/dist/cli/{index-9cf1yr67.js → index-j6ywarjp.js} +3 -3
- package/dist/cli/{index-mwkwyej1.js → index-jpkxjmfw.js} +5 -5
- package/dist/cli/{index-03zyn94g.js → index-k742ecbm.js} +178 -222
- package/dist/cli/{index-y5qp59rc.js → index-kapharv7.js} +10 -4
- package/dist/cli/{index-djwemsjn.js → index-m2s0gbzt.js} +2 -2
- package/dist/cli/{index-4ff0x4cg.js → index-p8hezdtz.js} +1 -1
- package/dist/cli/{index-k4tmx21m.js → index-rkyhv4p5.js} +2 -2
- package/dist/cli/{index-3x761jqv.js → index-wk1h5ec2.js} +1 -1
- package/dist/cli/{index-jj4earrh.js → index-xfejq1p9.js} +1 -1
- package/dist/cli/{index-rt5jgktq.js → index-y0kk3rtv.js} +2 -2
- package/dist/cli/index-y3v1404y.js +1625 -0
- package/dist/cli/index.js +35 -31
- package/dist/cli/{knowledge-escalator-j0nceas7.js → knowledge-escalator-mkdac2m7.js} +8 -8
- package/dist/cli/{knowledge-events-gpqc62jr.js → knowledge-events-jjc9qbe0.js} +6 -6
- package/dist/cli/{knowledge-link-4yd2z8ev.js → knowledge-link-nc4y2zkq.js} +5 -5
- package/dist/cli/{knowledge-store-ggxr3ww5.js → knowledge-store-9e0w1kxm.js} +6 -6
- package/dist/cli/{knowledge-validator-007smap6.js → knowledge-validator-h1nrn2pk.js} +9 -9
- package/dist/cli/pending-delegations-v9e40hfk.js +96 -0
- package/dist/cli/{pr-subscriptions-zqbmctwz.js → pr-subscriptions-ztq40hrt.js} +7 -7
- package/dist/cli/{scan-cursor-wz4bff7a.js → scan-cursor-mk3tq3sf.js} +7 -7
- package/dist/cli/{schema-023gwne7.js → schema-bjb0yzsq.js} +7 -3
- package/dist/cli/{scope-persistence-dm5bab50.js → scope-persistence-hz3zmmsv.js} +5 -5
- package/dist/cli/{skill-generator-rtsg1m7x.js → skill-generator-p1de0wkr.js} +10 -10
- package/dist/cli/worktree-collision-ownership-c4bdnjtx.js +221 -0
- package/dist/commands/command-dispatch.d.ts +7 -0
- package/dist/commands/index.d.ts +7 -0
- package/dist/commands/registry.d.ts +16 -0
- package/dist/commands/review.d.ts +21 -0
- package/dist/config/agent-names.d.ts +3 -3
- package/dist/config/evidence-schema.d.ts +47 -47
- package/dist/config/index.d.ts +2 -2
- package/dist/config/schema.d.ts +58 -6
- package/dist/consensus/contracts.d.ts +3 -3
- package/dist/evaluation/ephemeral-agent-dispatcher.d.ts +64 -0
- package/dist/evaluation/model-dispatcher.d.ts +11 -5
- package/dist/hooks/auto-review.d.ts +30 -65
- package/dist/hooks/delegation-gate/worktree-collision-ownership.d.ts +28 -0
- package/dist/hooks/delegation-gate/worktree-isolation.d.ts +63 -1
- package/dist/hooks/delegation-gate/worktree-merge-status.d.ts +14 -0
- package/dist/hooks/delegation-gate/worktree-ownership-tag.d.ts +19 -0
- package/dist/hooks/delegation-gate/worktree-provisioning-owner.d.ts +30 -0
- package/dist/hooks/delegation-gate.d.ts +15 -6
- package/dist/hooks/guardrails/tool-before.d.ts +8 -0
- package/dist/hooks/index.d.ts +1 -1
- package/dist/hooks/init-orphan-recovery.d.ts +17 -0
- package/dist/hooks/review-receipt-collector.d.ts +53 -10
- package/dist/hooks/review-receipt-scope.d.ts +74 -0
- package/dist/hooks/review-receipt.d.ts +104 -10
- package/dist/hooks/reviewer-scope-file-fingerprint.d.ts +21 -0
- package/dist/hooks/reviewer-scope-lifecycle.d.ts +19 -0
- package/dist/hooks/task-result-classifier.d.ts +6 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +583 -524
- package/dist/memory/schema.d.ts +1 -1
- package/dist/review/contracts.d.ts +29 -0
- package/dist/review/diff-source.d.ts +134 -0
- package/dist/review/engine.d.ts +60 -0
- package/dist/review/evidence.d.ts +88 -0
- package/dist/review/finding-validator.d.ts +77 -0
- package/dist/review/phase-runner.d.ts +37 -0
- package/dist/review/runtime.d.ts +32 -0
- package/dist/scope/scope-binding.d.ts +9 -0
- package/dist/services/config-doctor.d.ts +12 -0
- package/dist/session/snapshot-writer.d.ts +2 -0
- package/dist/state.d.ts +222 -1
- package/dist/tools/dispatch-lanes.d.ts +3 -1
- package/dist/tools/epic-record-divergence.d.ts +5 -5
- package/dist/tools/lean-turbo-review.d.ts +4 -1
- package/dist/tools/lean-turbo-run-phase.d.ts +3 -1
- package/dist/tools/phase-complete/gates/final-review-gate.d.ts +18 -0
- package/dist/tools/phase-complete/gates/index.d.ts +1 -0
- package/dist/tools/phase-complete/gates/types.d.ts +10 -0
- package/dist/tools/phase-complete.d.ts +13 -1
- package/dist/tools/plugin-registration.d.ts +3 -1
- package/dist/tools/swarm-command.d.ts +4 -1
- package/dist/tools/tool-metadata.d.ts +22 -22
- package/dist/turbo/lean/integration.d.ts +18 -2
- package/dist/turbo/lean/reviewer.d.ts +19 -3
- package/dist/turbo/lean/runner.d.ts +1 -1
- package/dist/worktree/merge.d.ts +47 -1
- package/package.json +1 -1
- package/dist/cli/guardrail-explain-s7vzm6z7.js +0 -55
- package/dist/cli/index-y2pfmd0z.js +0 -259
- package/dist/cli/pending-delegations-37t4xecr.js +0 -34
- package/dist/cli/{index-9f71ye47.js → index-13xxjfhn.js} +3 -3
- package/dist/cli/{index-s80bsjkj.js → index-2ghkk9ve.js} +6 -6
- package/dist/cli/{index-76kvm9z5.js → index-5nybajn9.js} +3 -3
|
@@ -68,9 +68,9 @@ export declare const ConsensusMineRequestSchema: z.ZodObject<{
|
|
|
68
68
|
declare const ConsensusProposedTargetSchema: z.ZodEnum<{
|
|
69
69
|
tooling: "tooling";
|
|
70
70
|
none: "none";
|
|
71
|
+
orchestration: "orchestration";
|
|
71
72
|
prompt: "prompt";
|
|
72
73
|
skill: "skill";
|
|
73
|
-
orchestration: "orchestration";
|
|
74
74
|
}>;
|
|
75
75
|
export type ConsensusProposedTarget = z.infer<typeof ConsensusProposedTargetSchema>;
|
|
76
76
|
/**
|
|
@@ -151,9 +151,9 @@ export declare const ConsensusAttributeV1Schema: z.ZodObject<{
|
|
|
151
151
|
proposedTarget: z.ZodEnum<{
|
|
152
152
|
tooling: "tooling";
|
|
153
153
|
none: "none";
|
|
154
|
+
orchestration: "orchestration";
|
|
154
155
|
prompt: "prompt";
|
|
155
156
|
skill: "skill";
|
|
156
|
-
orchestration: "orchestration";
|
|
157
157
|
}>;
|
|
158
158
|
}, z.core.$strict>;
|
|
159
159
|
/**
|
|
@@ -390,9 +390,9 @@ export declare const ConsensusReportV1Schema: z.ZodObject<{
|
|
|
390
390
|
proposedTarget: z.ZodEnum<{
|
|
391
391
|
tooling: "tooling";
|
|
392
392
|
none: "none";
|
|
393
|
+
orchestration: "orchestration";
|
|
393
394
|
prompt: "prompt";
|
|
394
395
|
skill: "skill";
|
|
395
|
-
orchestration: "orchestration";
|
|
396
396
|
}>;
|
|
397
397
|
}, z.core.$strict>>;
|
|
398
398
|
proposals: z.ZodArray<z.ZodObject<{
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import type { OpencodeClient } from '@opencode-ai/sdk';
|
|
2
|
+
import type { DelegationCostFields } from '../services/cost-accounting.js';
|
|
3
|
+
import { log } from '../utils/logger.js';
|
|
4
|
+
import type { ModelOverride } from '../utils/model-dispatch-fallback.js';
|
|
5
|
+
export declare const DEFAULT_EPHEMERAL_TIMEOUT_MS = 120000;
|
|
6
|
+
export declare const DEFAULT_EPHEMERAL_CLEANUP_TIMEOUT_MS = 500;
|
|
7
|
+
export declare const DEFAULT_EPHEMERAL_PROMPT_BYTE_LIMIT: number;
|
|
8
|
+
export declare const MAX_EPHEMERAL_PROMPT_BYTE_LIMIT: number;
|
|
9
|
+
export declare const DEFAULT_EPHEMERAL_RESPONSE_BYTE_LIMIT: number;
|
|
10
|
+
export type ReadOnlyToolDenials = Readonly<Record<string, false>>;
|
|
11
|
+
/**
|
|
12
|
+
* Fail-closed tool policy for isolated review/evaluation agents.
|
|
13
|
+
*
|
|
14
|
+
* OpenCode merges this request map with the selected agent's configured tools,
|
|
15
|
+
* so omitting a registered plugin tool leaves it enabled. Deny every canonical
|
|
16
|
+
* plugin tool (including deceptively mutable tools such as lint and recursive
|
|
17
|
+
* tools such as swarm_command) plus built-in mutation/dispatch escape hatches.
|
|
18
|
+
* Upstream read-only discovery tools remain available.
|
|
19
|
+
*/
|
|
20
|
+
export declare const DEFAULT_READ_ONLY_TOOLS: ReadOnlyToolDenials;
|
|
21
|
+
export type EphemeralAgentDispatchRequest = {
|
|
22
|
+
client: OpencodeClient;
|
|
23
|
+
directory: string;
|
|
24
|
+
parentSessionId?: string;
|
|
25
|
+
/** Already-resolved OpenCode agent name. Agent lookup belongs to the caller. */
|
|
26
|
+
agentName: string;
|
|
27
|
+
model?: ModelOverride;
|
|
28
|
+
/** Optional system prompt for this isolated session. */
|
|
29
|
+
system?: string;
|
|
30
|
+
prompt: string;
|
|
31
|
+
/** Explicit false-only tool map. The primitive never grants tools implicitly. */
|
|
32
|
+
readOnlyTools: ReadOnlyToolDenials;
|
|
33
|
+
title?: string;
|
|
34
|
+
timeoutMs: number;
|
|
35
|
+
cleanupTimeoutMs?: number;
|
|
36
|
+
promptByteLimit?: number;
|
|
37
|
+
responseByteLimit?: number;
|
|
38
|
+
abortSignal?: AbortSignal;
|
|
39
|
+
};
|
|
40
|
+
export type EphemeralAgentDispatchResult = {
|
|
41
|
+
status: 'completed' | 'timeout' | 'cancelled' | 'error';
|
|
42
|
+
agentName: string;
|
|
43
|
+
modelId?: string;
|
|
44
|
+
text: string;
|
|
45
|
+
error?: string;
|
|
46
|
+
durationMs: number;
|
|
47
|
+
promptBytes: number;
|
|
48
|
+
responseBytes: number;
|
|
49
|
+
costFields?: DelegationCostFields;
|
|
50
|
+
};
|
|
51
|
+
export declare function boundedDeleteEphemeralSession(client: OpencodeClient, sessionId: string, timeoutMs?: number): Promise<void>;
|
|
52
|
+
export declare const _internals: {
|
|
53
|
+
boundedDelete: typeof boundedDeleteEphemeralSession;
|
|
54
|
+
log: typeof log;
|
|
55
|
+
};
|
|
56
|
+
/**
|
|
57
|
+
* Dispatch one read-only agent in a fresh, parent-bound session.
|
|
58
|
+
*
|
|
59
|
+
* This is deliberately policy-free: callers resolve the agent and model, provide
|
|
60
|
+
* the replacement system prompt, and own retry/fallback policy. The primitive
|
|
61
|
+
* owns only bounded session creation/prompting, transcript caps, accounting, and
|
|
62
|
+
* awaited best-effort cleanup.
|
|
63
|
+
*/
|
|
64
|
+
export declare function dispatchEphemeralAgent(request: EphemeralAgentDispatchRequest): Promise<EphemeralAgentDispatchResult>;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { Agent, OpencodeClient } from '@opencode-ai/sdk';
|
|
2
|
-
import {
|
|
2
|
+
import type { DelegationCostFields } from '../services/cost-accounting.js';
|
|
3
|
+
import { _internals as ephemeralDispatcherInternals } from './ephemeral-agent-dispatcher.js';
|
|
3
4
|
export type EvaluationModelDispatchRequest = {
|
|
4
5
|
directory: string;
|
|
5
6
|
agentName: string;
|
|
@@ -18,13 +19,18 @@ export type EvaluationModelDispatchResult = {
|
|
|
18
19
|
text: string;
|
|
19
20
|
durationMs: number;
|
|
20
21
|
error?: string;
|
|
22
|
+
promptBytes?: number;
|
|
23
|
+
responseBytes?: number;
|
|
24
|
+
costFields?: DelegationCostFields;
|
|
21
25
|
};
|
|
22
26
|
export type EvaluationModelDispatcher = (request: EvaluationModelDispatchRequest) => Promise<EvaluationModelDispatchResult>;
|
|
23
27
|
export declare function resolveEvaluationAgentName(agents: readonly Pick<Agent, 'name'>[], logicalName: string, preferredSwarm?: string): string;
|
|
24
|
-
|
|
28
|
+
/**
|
|
29
|
+
* Compatibility proxy for the existing evaluation test seam. The shared
|
|
30
|
+
* primitive remains the single owner of cleanup and logging behavior.
|
|
31
|
+
*/
|
|
25
32
|
export declare const _internals: {
|
|
26
|
-
boundedDelete: typeof boundedDelete;
|
|
27
|
-
log: typeof log;
|
|
33
|
+
boundedDelete: typeof ephemeralDispatcherInternals.boundedDelete;
|
|
34
|
+
log: typeof ephemeralDispatcherInternals.log;
|
|
28
35
|
};
|
|
29
36
|
export declare function createEvaluationModelDispatcher(client: OpencodeClient): EvaluationModelDispatcher;
|
|
30
|
-
export {};
|
|
@@ -1,90 +1,55 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
2
|
+
* Automatic task-completion review hook.
|
|
3
3
|
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
* the same "second model reviews the work in a clean context" pattern used
|
|
9
|
-
* by Claude Code's auto-review and Codex's review model. The reviewer agent
|
|
10
|
-
* carries its own configured model (`agents.reviewer.model`), so the review
|
|
11
|
-
* model is independently configurable from the coder/architect models.
|
|
12
|
-
*
|
|
13
|
-
* The pass is ADVISORY and fully fail-open:
|
|
14
|
-
* - fire-and-forget from `tool.execute.after` (never blocks the tool)
|
|
15
|
-
* - verdicts are persisted as durable review receipts
|
|
16
|
-
* (`.swarm/review-receipts/`, scope-fingerprinted over the diff) and an
|
|
17
|
-
* `auto_review` event is appended to `.swarm/events.jsonl`
|
|
18
|
-
* - a REJECTED or unparseable verdict injects a `[AUTO-REVIEW]` advisory
|
|
19
|
-
* into the architect's next prompt; APPROVED stays silent
|
|
20
|
-
*
|
|
21
|
-
* Bounds (AGENTS.md invariants 3 and 8): the diff subprocess uses execFile
|
|
22
|
-
* with cwd/timeout/maxBuffer and ignored stdin; dispatches are guarded by a
|
|
23
|
-
* per-session in-flight set plus a 60s cooldown in a bounded FIFO map.
|
|
24
|
-
*
|
|
25
|
-
* #1896 / #1905: on a transient/quota dispatch error the reviewer fails over to
|
|
26
|
-
* a configured `fallback_models` entry via the shared `dispatchWithModelFallback`
|
|
27
|
-
* helper, instead of immediately writing a `verdict: 'error'` event (a quota
|
|
28
|
-
* blip previously dropped the review pass with no recovery). The SDK error
|
|
29
|
-
* envelope is preserved in the thrown message so the classifier sees the quota
|
|
30
|
-
* token on the dominant SDK error shape.
|
|
4
|
+
* Phase/plan review is owned by the phase_complete tool body so it can await a
|
|
5
|
+
* durable artifact before the evidence-only gate runs. This hook therefore owns
|
|
6
|
+
* only task-completion review, remains fire-and-forget, and delegates every
|
|
7
|
+
* model/diff/persistence decision to the shared review engine.
|
|
31
8
|
*/
|
|
32
9
|
import { type AutoReviewConfig } from '../config/schema.js';
|
|
33
|
-
import {
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
export type ExecutionDiffResult = {
|
|
37
|
-
status: 'ok';
|
|
38
|
-
diff: string;
|
|
39
|
-
} | {
|
|
40
|
-
status: 'clean';
|
|
41
|
-
} | {
|
|
42
|
-
status: 'error';
|
|
43
|
-
reason: string;
|
|
44
|
-
};
|
|
45
|
-
/**
|
|
46
|
-
* Collect the execution diff for review: `git diff HEAD` (tracked changes)
|
|
47
|
-
* plus a porcelain summary of untracked files. Distinguishes a clean working
|
|
48
|
-
* tree from collection failures (git missing, timeout, diff exceeding the
|
|
49
|
-
* 2× maxBuffer cap) so events report honestly. Output is truncated to
|
|
50
|
-
* `maxBytes`.
|
|
51
|
-
*/
|
|
52
|
-
declare function computeExecutionDiff(directory: string, maxBytes: number): Promise<ExecutionDiffResult>;
|
|
53
|
-
declare function dispatchReviewer(directory: string, prompt: string, agentName: string, timeoutMs: number, parentSessionId: string, model?: ModelOverride): Promise<string>;
|
|
10
|
+
import type { ReviewModelDispatcher } from '../review/contracts.js';
|
|
11
|
+
import { type ReviewEngineResult, runReviewEngine } from '../review/engine.js';
|
|
12
|
+
import { type ReviewAgentModelRegistry } from '../review/runtime.js';
|
|
54
13
|
export interface AutoReviewRunInput {
|
|
55
14
|
directory: string;
|
|
56
15
|
sessionID: string;
|
|
57
|
-
trigger: 'task_completion'
|
|
16
|
+
trigger: 'task_completion';
|
|
58
17
|
taskId?: string;
|
|
59
|
-
|
|
60
|
-
|
|
18
|
+
config: AutoReviewConfig;
|
|
19
|
+
dispatcher?: ReviewModelDispatcher;
|
|
20
|
+
generatedAgentNames?: Iterable<string>;
|
|
21
|
+
activeAgentName?: string;
|
|
22
|
+
agentModelRegistry?: ReviewAgentModelRegistry;
|
|
61
23
|
injectAdvisory: (sessionId: string, message: string) => void;
|
|
62
24
|
}
|
|
63
|
-
|
|
64
|
-
* Execute one auto-review pass: collect diff → dispatch reviewer over an
|
|
65
|
-
* ephemeral session → persist receipt + event → advisory on REJECTED or
|
|
66
|
-
* unparseable output. Fully fail-open; never throws.
|
|
67
|
-
*/
|
|
68
|
-
export declare function runAutoReview(input: AutoReviewRunInput): Promise<void>;
|
|
25
|
+
export declare function runAutoReview(input: AutoReviewRunInput): Promise<ReviewEngineResult | undefined>;
|
|
69
26
|
export interface AutoReviewHookOptions {
|
|
70
27
|
config: AutoReviewConfig;
|
|
71
28
|
directory: string;
|
|
29
|
+
dispatcher?: ReviewModelDispatcher;
|
|
30
|
+
generatedAgentNames?: Iterable<string>;
|
|
31
|
+
agentModelRegistry?: ReviewAgentModelRegistry;
|
|
32
|
+
getActiveAgentName?: (sessionID: string) => string | undefined;
|
|
72
33
|
injectAdvisory: (sessionId: string, message: string) => void;
|
|
73
34
|
}
|
|
35
|
+
export interface AutoReviewToolAfterContext {
|
|
36
|
+
/**
|
|
37
|
+
* Arguments recovered from the callID snapshot. The OpenCode SDK's
|
|
38
|
+
* `tool.execute.after` output does not carry the original tool arguments.
|
|
39
|
+
*/
|
|
40
|
+
args: Record<string, unknown> | null;
|
|
41
|
+
}
|
|
74
42
|
export declare function createAutoReviewHook(options: AutoReviewHookOptions): {
|
|
75
43
|
toolAfter: (input: {
|
|
76
44
|
tool: string;
|
|
77
45
|
sessionID: string;
|
|
78
46
|
callID?: string;
|
|
79
|
-
},
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
}) => Promise<void>;
|
|
47
|
+
}, context: AutoReviewToolAfterContext) => Promise<void>;
|
|
48
|
+
/** Instance-local test/lifecycle seam; never affects another plugin instance. */
|
|
49
|
+
resetTracking: () => void;
|
|
83
50
|
};
|
|
84
51
|
export declare const _internals: {
|
|
85
|
-
|
|
86
|
-
dispatchReviewer: typeof dispatchReviewer;
|
|
52
|
+
runReviewEngine: typeof runReviewEngine;
|
|
87
53
|
runAutoReview: typeof runAutoReview;
|
|
88
54
|
now: () => number;
|
|
89
55
|
};
|
|
90
|
-
export {};
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
export interface StandardWorktreeCollisionIdentity {
|
|
2
|
+
directory: string;
|
|
3
|
+
parentSessionId: string;
|
|
4
|
+
taskId: string;
|
|
5
|
+
branchName: string;
|
|
6
|
+
worktreePath: string;
|
|
7
|
+
}
|
|
8
|
+
export type StandardWorktreeCollisionOwnership = {
|
|
9
|
+
status: 'unowned';
|
|
10
|
+
} | {
|
|
11
|
+
status: 'protected';
|
|
12
|
+
ownerKind: 'primary' | 'fallback' | 'provisioning' | 'ownership-tag' | 'merge-status';
|
|
13
|
+
lifecycle: 'active' | 'preserved';
|
|
14
|
+
reason: string;
|
|
15
|
+
} | {
|
|
16
|
+
status: 'uncertain';
|
|
17
|
+
reason: string;
|
|
18
|
+
};
|
|
19
|
+
/**
|
|
20
|
+
* Strict restart-time ownership classification for one exact same-session
|
|
21
|
+
* collision. Scanner order is part of the safety contract:
|
|
22
|
+
*
|
|
23
|
+
* provisioning -> fallback -> primary -> ownership tag -> merge status
|
|
24
|
+
*
|
|
25
|
+
* Fallback precedes primary because promotion publishes primary before removing
|
|
26
|
+
* fallback; this ordering cannot observe ownership absent from both stores.
|
|
27
|
+
*/
|
|
28
|
+
export declare function inspectStandardWorktreeCollisionOwnership(identity: StandardWorktreeCollisionIdentity): Promise<StandardWorktreeCollisionOwnership>;
|
|
@@ -9,9 +9,12 @@
|
|
|
9
9
|
* The _internals seam allows test injection of worktree operations.
|
|
10
10
|
*/
|
|
11
11
|
import type { PluginConfig, WorktreeIsolationConfig } from '../../config';
|
|
12
|
+
import { tryAcquireLock } from '../../parallel/file-locks';
|
|
12
13
|
import { bunSpawn } from '../../utils/bun-compat';
|
|
13
14
|
import type { WorktreeHandle } from '../../worktree';
|
|
14
15
|
import { attemptMergeBackFromDirty, cleanupOrphanedBranches, postMergeCleanup, provisionWorktree, removeWorktree, startupOrphanRecovery } from '../../worktree';
|
|
16
|
+
import type { DirtyMergeOptions, MergeOperationProvenance } from '../../worktree/merge';
|
|
17
|
+
import { recordWorktreeProvisioningOwner, removeWorktreeProvisioningOwner } from './worktree-provisioning-owner';
|
|
15
18
|
/**
|
|
16
19
|
* FR-201: Per-lane runtime profile injected into spawned child processes.
|
|
17
20
|
*
|
|
@@ -62,6 +65,37 @@ export interface StandardWorktreeDispatch {
|
|
|
62
65
|
/** Configured worktree-dir override, so cleanup trusts the same base. */
|
|
63
66
|
worktree_dir?: string;
|
|
64
67
|
}
|
|
68
|
+
export interface StandardWorktreeSettlementOptions extends Pick<DirtyMergeOptions, 'operationId' | 'resume' | 'onBeforeMerge'> {
|
|
69
|
+
/**
|
|
70
|
+
* Awaited after Git reports success (including reconciled success) and before
|
|
71
|
+
* destructive worktree/branch cleanup. A rejection preserves the lane.
|
|
72
|
+
*/
|
|
73
|
+
onMerged?: (result: StandardWorktreeMergedSettlement) => Promise<void>;
|
|
74
|
+
}
|
|
75
|
+
export interface StandardWorktreeMergedSettlement {
|
|
76
|
+
outcome: 'merged';
|
|
77
|
+
strategy: string;
|
|
78
|
+
autoCommitted: boolean;
|
|
79
|
+
cleaned: boolean;
|
|
80
|
+
reconciled: boolean;
|
|
81
|
+
provenance?: MergeOperationProvenance;
|
|
82
|
+
}
|
|
83
|
+
export interface StandardWorktreePartialSettlement {
|
|
84
|
+
outcome: 'partial';
|
|
85
|
+
stage: string;
|
|
86
|
+
message: string;
|
|
87
|
+
autoCommitted: boolean;
|
|
88
|
+
cleaned: boolean;
|
|
89
|
+
conflictFiles?: string[];
|
|
90
|
+
provenance?: MergeOperationProvenance;
|
|
91
|
+
}
|
|
92
|
+
export interface StandardWorktreeFailedSettlement {
|
|
93
|
+
outcome: 'failed';
|
|
94
|
+
stage: string;
|
|
95
|
+
message: string;
|
|
96
|
+
provenance?: MergeOperationProvenance;
|
|
97
|
+
}
|
|
98
|
+
export type StandardWorktreeSettlementResult = StandardWorktreeMergedSettlement | StandardWorktreePartialSettlement | StandardWorktreeFailedSettlement;
|
|
65
99
|
export interface AwaitingMergeRecord {
|
|
66
100
|
callID: string;
|
|
67
101
|
parentSessionID: string;
|
|
@@ -130,6 +164,7 @@ export declare function preProvisionCollisionCheck(taskId: string, directory: st
|
|
|
130
164
|
existingBranch?: string;
|
|
131
165
|
ownerSessionId?: string;
|
|
132
166
|
worktreePath?: string;
|
|
167
|
+
uncertainty?: string;
|
|
133
168
|
}>;
|
|
134
169
|
/**
|
|
135
170
|
* FR-001b SC-005: Returns true when `branchName`'s embedded session ID matches
|
|
@@ -140,6 +175,13 @@ export declare function preProvisionCollisionCheck(taskId: string, directory: st
|
|
|
140
175
|
* patterns.
|
|
141
176
|
*/
|
|
142
177
|
export declare function isLaneOwnedByCurrentSession(branchName: string, expectedSessionId: string): boolean;
|
|
178
|
+
declare function inspectStandardWorktreeCollisionOwnership(identity: {
|
|
179
|
+
directory: string;
|
|
180
|
+
parentSessionId: string;
|
|
181
|
+
taskId: string;
|
|
182
|
+
branchName: string;
|
|
183
|
+
worktreePath: string;
|
|
184
|
+
}): Promise<import("./worktree-collision-ownership").StandardWorktreeCollisionOwnership>;
|
|
143
185
|
export declare function precreateStandardWorktreeSession(args: {
|
|
144
186
|
config: PluginConfig;
|
|
145
187
|
directory: string;
|
|
@@ -155,6 +197,19 @@ export declare function precreateStandardWorktreeSession(args: {
|
|
|
155
197
|
files: string[];
|
|
156
198
|
};
|
|
157
199
|
}): Promise<void>;
|
|
200
|
+
/**
|
|
201
|
+
* Create a durable ownership tag without touching an in-flight background
|
|
202
|
+
* coder's index or working tree. This is used only when both correlation
|
|
203
|
+
* stores fail after launch: committing dirty files at that point could race
|
|
204
|
+
* the still-running child, while a tag plus the durable merge-status record
|
|
205
|
+
* makes restart cleanup fail closed.
|
|
206
|
+
*/
|
|
207
|
+
export declare function preserveBackgroundWorktreeOwnershipForCallId(callID: string): Promise<{
|
|
208
|
+
outcome: 'preserved' | 'preserve-failed' | 'not-found';
|
|
209
|
+
tag?: string;
|
|
210
|
+
ref?: string;
|
|
211
|
+
error?: string;
|
|
212
|
+
}>;
|
|
158
213
|
/**
|
|
159
214
|
* FR-001c: Preserves dirty work in a worktree before cleanup on denial or cancellation.
|
|
160
215
|
*
|
|
@@ -223,7 +278,7 @@ export declare function finishStandardWorktreeDispatch(directory: string, dispat
|
|
|
223
278
|
* derived from dispatch.callID (for backward compatibility with test callers
|
|
224
279
|
* that pass StandardWorktreeDispatch objects directly).
|
|
225
280
|
*/
|
|
226
|
-
callID?: string): Promise<
|
|
281
|
+
callID?: string, settlement?: StandardWorktreeSettlementOptions): Promise<StandardWorktreeSettlementResult>;
|
|
227
282
|
/**
|
|
228
283
|
* FR-201: Read and parse a lane runtime profile from disk.
|
|
229
284
|
*
|
|
@@ -264,6 +319,11 @@ export declare const _internals: {
|
|
|
264
319
|
cleanupStandardWorktreeForCallId: typeof cleanupStandardWorktreeForCallId;
|
|
265
320
|
/** FR-001c: preserves dirty worktree state before cleanup on denial/cancellation. */
|
|
266
321
|
preserveDirtyWorktreeForCallId: typeof preserveDirtyWorktreeForCallId;
|
|
322
|
+
/** Background launch durability fallback: tag ownership without racing the child. */
|
|
323
|
+
preserveBackgroundWorktreeOwnershipForCallId: typeof preserveBackgroundWorktreeOwnershipForCallId;
|
|
324
|
+
tryAcquireWorktreeLifecycleLock: typeof tryAcquireLock;
|
|
325
|
+
recordWorktreeProvisioningOwner: typeof recordWorktreeProvisioningOwner;
|
|
326
|
+
removeWorktreeProvisioningOwner: typeof removeWorktreeProvisioningOwner;
|
|
267
327
|
/** FR-001b SC-004: path-based dirty worktree preservation for stale-lane fallback. */
|
|
268
328
|
preserveDirtyWorktreeAtPath: typeof preserveDirtyWorktreeAtPath;
|
|
269
329
|
/** FR-001a: abort entry point for in-flight dispatches. */
|
|
@@ -271,6 +331,8 @@ export declare const _internals: {
|
|
|
271
331
|
standardWorktreeByCallID: Map<string, StandardWorktreeDispatch>;
|
|
272
332
|
/** FR-001b SC-004: pre-provision collision check. */
|
|
273
333
|
preProvisionCollisionCheck: typeof preProvisionCollisionCheck;
|
|
334
|
+
/** Restart-safe durable owner classification for a colliding lane. */
|
|
335
|
+
inspectStandardWorktreeCollisionOwnership: typeof inspectStandardWorktreeCollisionOwnership;
|
|
274
336
|
/** FR-001b SC-005: lane ownership validation. */
|
|
275
337
|
isLaneOwnedByCurrentSession: typeof isLaneOwnedByCurrentSession;
|
|
276
338
|
/** FR-001b: bunSpawn — exposed for test injection so collision check can be mocked. */
|
|
@@ -43,6 +43,13 @@ export interface WorktreeMergeFailure {
|
|
|
43
43
|
/** Timestamp (Date.now()) when merge-back completed (success or failure). */
|
|
44
44
|
completedAt?: number;
|
|
45
45
|
}
|
|
46
|
+
export type WorktreeMergeRecoveryScanResult = {
|
|
47
|
+
status: 'ok';
|
|
48
|
+
failures: Array<[string, WorktreeMergeFailure]>;
|
|
49
|
+
} | {
|
|
50
|
+
status: 'uncertain';
|
|
51
|
+
reason: string;
|
|
52
|
+
};
|
|
46
53
|
declare function getDurableStatusPath(projectDir?: string): string;
|
|
47
54
|
/**
|
|
48
55
|
* Load the durable file into the in-memory map. The clear+repopulate is
|
|
@@ -52,6 +59,13 @@ declare function getDurableStatusPath(projectDir?: string): string;
|
|
|
52
59
|
*/
|
|
53
60
|
declare function loadDurableStatus(statusPath: string): void;
|
|
54
61
|
declare function saveDurableStatus(statusPath: string): void;
|
|
62
|
+
/**
|
|
63
|
+
* Strict recovery-only read of durable merge ownership. The normal registry
|
|
64
|
+
* stays fail-open for plugin loadability, while destructive orphan cleanup
|
|
65
|
+
* receives an explicit uncertainty result for read, parse, schema, or cap
|
|
66
|
+
* failures.
|
|
67
|
+
*/
|
|
68
|
+
export declare function scanWorktreeMergeFailuresForRecovery(projectDir: string): WorktreeMergeRecoveryScanResult;
|
|
55
69
|
/**
|
|
56
70
|
* Initialize the durable status path for this project and load existing
|
|
57
71
|
* status from disk. Called from `createDelegationGateHook` before any coder
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export interface BackgroundWorktreeOwnershipTag {
|
|
2
|
+
sessionId: string;
|
|
3
|
+
laneId: string;
|
|
4
|
+
callDigest: string;
|
|
5
|
+
ref: string;
|
|
6
|
+
}
|
|
7
|
+
export type BackgroundWorktreeOwnershipTagScan = {
|
|
8
|
+
status: 'ok';
|
|
9
|
+
owners: BackgroundWorktreeOwnershipTag[];
|
|
10
|
+
} | {
|
|
11
|
+
status: 'uncertain';
|
|
12
|
+
reason: string;
|
|
13
|
+
};
|
|
14
|
+
/**
|
|
15
|
+
* Strict, bounded ownership-tag scan shared by init recovery and restart
|
|
16
|
+
* collision classification. Any malformed or unreadable entry is uncertainty:
|
|
17
|
+
* destructive cleanup must never infer absence from incomplete ownership data.
|
|
18
|
+
*/
|
|
19
|
+
export declare function scanBackgroundWorktreeOwnershipTagsForRecovery(directory: string): Promise<BackgroundWorktreeOwnershipTagScan>;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
export declare const WORKTREE_LIFECYCLE_LOCK_FILE = ".swarm/locks/init-orphan-recovery.lock";
|
|
2
|
+
export interface WorktreeProvisioningOwner {
|
|
3
|
+
schemaVersion: 1 | 2;
|
|
4
|
+
callID: string;
|
|
5
|
+
parentSessionId: string;
|
|
6
|
+
worktreeSessionId: string;
|
|
7
|
+
/** Added in v2 so restart collision checks can identify the exact lane. */
|
|
8
|
+
taskId?: string;
|
|
9
|
+
createdAt: number;
|
|
10
|
+
}
|
|
11
|
+
export type WorktreeProvisioningOwnerScan = {
|
|
12
|
+
status: 'ok';
|
|
13
|
+
owners: WorktreeProvisioningOwner[];
|
|
14
|
+
} | {
|
|
15
|
+
status: 'uncertain';
|
|
16
|
+
reason: string;
|
|
17
|
+
};
|
|
18
|
+
/**
|
|
19
|
+
* Publish a provisional owner before a standard worktree can be created.
|
|
20
|
+
* Callers hold the shared orphan-recovery lifecycle lock during this atomic
|
|
21
|
+
* write, closing the gap between recovery's owner snapshot and provisioning.
|
|
22
|
+
*/
|
|
23
|
+
export declare function recordWorktreeProvisioningOwner(directory: string, input: Omit<WorktreeProvisioningOwner, 'schemaVersion' | 'createdAt'>): WorktreeProvisioningOwner;
|
|
24
|
+
/** Remove a provisional owner only after durable ownership or cleanup exists. */
|
|
25
|
+
export declare function removeWorktreeProvisioningOwner(directory: string, callID: string): boolean;
|
|
26
|
+
/**
|
|
27
|
+
* Strict recovery scan. Anything except ENOENT is uncertainty because omitting
|
|
28
|
+
* one marker could allow destructive cleanup to race a live worktree.
|
|
29
|
+
*/
|
|
30
|
+
export declare function scanWorktreeProvisioningOwnersForRecovery(directory: string): WorktreeProvisioningOwnerScan;
|
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
* Warns the architect when coder delegations are too large or batched.
|
|
5
5
|
* Uses experimental.chat.messages.transform to provide non-blocking guidance.
|
|
6
6
|
*/
|
|
7
|
+
import type { BackgroundDelegationRecord } from '../background/pending-delegations.js';
|
|
7
8
|
import type { PluginConfig } from '../config';
|
|
8
9
|
import { loadPlanJsonOnly } from '../plan/manager';
|
|
9
10
|
import type { AgentSessionState } from '../state';
|
|
@@ -47,11 +48,12 @@ export declare function clearPendingCoderScope(): void;
|
|
|
47
48
|
* `Task` with `background=true` (gated upstream by
|
|
48
49
|
* `OPENCODE_EXPERIMENTAL_BACKGROUND_SUBAGENTS=true`) returns a "running" placeholder
|
|
49
50
|
* immediately and completes later via synthetic parent injection. The delegation gate
|
|
50
|
-
* treats a `Task` result as completion, so
|
|
51
|
-
*
|
|
52
|
-
*
|
|
53
|
-
*
|
|
54
|
-
*
|
|
51
|
+
* treats a foreground `Task` result as completion, so the running placeholder must be
|
|
52
|
+
* tracked without terminal side effects. When the opt-in is enabled, trusted deferred
|
|
53
|
+
* completion ingestion performs exact parent correlation, workspace settlement, and
|
|
54
|
+
* role-appropriate state/evidence updates. With the opt-in disabled (the default while
|
|
55
|
+
* upstream remains experimental), background swarm delegations are fail-closed-blocked.
|
|
56
|
+
* We do NOT silently coerce `background` to false.
|
|
55
57
|
*/
|
|
56
58
|
export declare const SWARM_BACKGROUND_TASK_BLOCKED_MESSAGE: string;
|
|
57
59
|
/**
|
|
@@ -268,7 +270,7 @@ interface MessageWithParts {
|
|
|
268
270
|
* approval. Does not throw — returns `false` for any failure (fail-closed).
|
|
269
271
|
*/
|
|
270
272
|
export declare function isPlanCriticApproved(directory: string): Promise<boolean>;
|
|
271
|
-
declare function resolveDelegatedPlanTaskId(args: Record<string, unknown>, knownPlanTaskIds?: ReadonlySet<string>): string | null;
|
|
273
|
+
export declare function resolveDelegatedPlanTaskId(args: Record<string, unknown>, knownPlanTaskIds?: ReadonlySet<string>): string | null;
|
|
272
274
|
/**
|
|
273
275
|
* Builds a cause-specific diagnostic for `prepareCoderScope`'s SCOPE_NOT_DECLARED
|
|
274
276
|
* throw when `resolveDelegatedPlanTaskId` returns null. Re-runs extraction with
|
|
@@ -324,12 +326,18 @@ export declare const _internals: {
|
|
|
324
326
|
parsePerTaskVerdicts: typeof parsePerTaskVerdicts;
|
|
325
327
|
buildParallelExecutionGuidance: typeof buildParallelExecutionGuidance;
|
|
326
328
|
loadPlanJsonOnly: typeof loadPlanJsonOnly;
|
|
329
|
+
recordPendingDelegationForBackground: typeof import("../background/pending-delegations.js").recordPendingDelegation;
|
|
330
|
+
writeDelegationFallbackForBackground: typeof import("../background/pending-delegations.js").writeDelegationFallback;
|
|
331
|
+
reserveBackgroundCoderSlotForDispatch: typeof import("../background/pending-delegations.js").reserveBackgroundCoderSlot;
|
|
332
|
+
bindBackgroundCoderReservationForDispatch: typeof import("../background/pending-delegations.js").bindBackgroundCoderReservation;
|
|
333
|
+
releaseBackgroundCoderReservationForDispatch: typeof import("../background/pending-delegations.js").releaseBackgroundCoderReservation;
|
|
327
334
|
resetStandardWorktreeIsolationState: typeof resetStandardWorktreeIsolationState;
|
|
328
335
|
PLAN_CRITIC_TASK_SIGNALS: readonly ["critic-gate", "plan critic", "review plan", "review the plan", "plan.md", "approve the plan", "plan approval"];
|
|
329
336
|
provisionWorktree: typeof _wtiInternals.provisionWorktree;
|
|
330
337
|
removeWorktree: typeof _wtiInternals.removeWorktree;
|
|
331
338
|
attemptMergeBackFromDirty: typeof _wtiInternals.attemptMergeBackFromDirty;
|
|
332
339
|
postMergeCleanup: typeof _wtiInternals.postMergeCleanup;
|
|
340
|
+
preserveBackgroundWorktreeOwnershipForCallId: typeof _wtiInternals.preserveBackgroundWorktreeOwnershipForCallId;
|
|
333
341
|
};
|
|
334
342
|
/**
|
|
335
343
|
* Creates the experimental.chat.messages.transform hook for delegation gating.
|
|
@@ -358,4 +366,5 @@ export declare function createDelegationGateHook(config: PluginConfig, directory
|
|
|
358
366
|
childSessionID: string;
|
|
359
367
|
}) => Promise<void>;
|
|
360
368
|
sessionEnded: (sessionID: string, includeOwnedChildren?: boolean) => void;
|
|
369
|
+
backgroundCompletionClaimed: (record: BackgroundDelegationRecord) => void;
|
|
361
370
|
};
|
|
@@ -37,6 +37,14 @@ export interface ToolBeforeContext {
|
|
|
37
37
|
* trusted roots when exempting `git worktree remove --force` (issue #1708).
|
|
38
38
|
*/
|
|
39
39
|
worktreeBaseDirOverrides?: string[];
|
|
40
|
+
/** Hold exact child-write provenance until the matching after-hook succeeds. */
|
|
41
|
+
rememberReviewerScopeWrite?: (input: {
|
|
42
|
+
callID: string;
|
|
43
|
+
parentSessionID: string;
|
|
44
|
+
taskId: string;
|
|
45
|
+
coderCallID: string;
|
|
46
|
+
file: string;
|
|
47
|
+
}) => void;
|
|
40
48
|
}
|
|
41
49
|
/**
|
|
42
50
|
* Creates a toolBefore handler with the given shared context.
|
package/dist/hooks/index.d.ts
CHANGED
|
@@ -4,7 +4,7 @@ export { createCompactionCustomizerHook } from './compaction-customizer';
|
|
|
4
4
|
export { createContextBudgetHandler } from './context-budget';
|
|
5
5
|
export { createContextCapsuleInjectHook } from './context-capsule-inject';
|
|
6
6
|
export { createCuratorLLMDelegate } from './curator-llm-factory';
|
|
7
|
-
export { createDelegationGateHook } from './delegation-gate';
|
|
7
|
+
export { createDelegationGateHook, outputLooksLikeBackgroundRunning, } from './delegation-gate';
|
|
8
8
|
export { createDelegationSanitizerHook } from './delegation-sanitizer';
|
|
9
9
|
export { createDelegationTrackerHook } from './delegation-tracker';
|
|
10
10
|
export { extractCurrentPhase, extractCurrentPhaseFromPlan, extractCurrentTask, extractCurrentTaskFromPlan, extractDecisions, extractIncompleteTasks, extractIncompleteTasksFromPlan, extractPatterns, } from './extractors';
|
|
@@ -15,8 +15,19 @@
|
|
|
15
15
|
* reads the advisory file at session-start and pushes messages to pendingAdvisoryMessages.
|
|
16
16
|
*/
|
|
17
17
|
import * as fs from 'node:fs';
|
|
18
|
+
import { scanDelegationFallbacksForRecovery, scanDelegationsForRecovery } from '../background/pending-delegations.js';
|
|
18
19
|
import { isLocked, listActiveLocks, tryAcquireLock } from '../parallel/file-locks';
|
|
19
20
|
import { removeWorktree } from '../worktree/core';
|
|
21
|
+
import { scanWorktreeMergeFailuresForRecovery } from './delegation-gate/worktree-merge-status';
|
|
22
|
+
import { scanWorktreeProvisioningOwnersForRecovery } from './delegation-gate/worktree-provisioning-owner';
|
|
23
|
+
type OwnershipTagSessionScan = {
|
|
24
|
+
status: 'ok';
|
|
25
|
+
sessionIds: string[];
|
|
26
|
+
} | {
|
|
27
|
+
status: 'uncertain';
|
|
28
|
+
reason: string;
|
|
29
|
+
};
|
|
30
|
+
declare function listOwnershipTagSessionIds(directory: string): Promise<OwnershipTagSessionScan>;
|
|
20
31
|
/**
|
|
21
32
|
* Lock file path for the init orphan recovery advisory lock.
|
|
22
33
|
* advisory-only — signals that another process may be actively using the repo.
|
|
@@ -33,6 +44,11 @@ export declare const _internals: {
|
|
|
33
44
|
isLocked: typeof isLocked;
|
|
34
45
|
listActiveLocks: typeof listActiveLocks;
|
|
35
46
|
tryAcquireLock: typeof tryAcquireLock;
|
|
47
|
+
listOwnershipTagSessionIds: typeof listOwnershipTagSessionIds;
|
|
48
|
+
scanDelegationsForRecovery: typeof scanDelegationsForRecovery;
|
|
49
|
+
scanDelegationFallbacksForRecovery: typeof scanDelegationFallbacksForRecovery;
|
|
50
|
+
scanWorktreeMergeFailuresForRecovery: typeof scanWorktreeMergeFailuresForRecovery;
|
|
51
|
+
scanWorktreeProvisioningOwnersForRecovery: typeof scanWorktreeProvisioningOwnersForRecovery;
|
|
36
52
|
};
|
|
37
53
|
export interface InitOrphanRecoveryResult {
|
|
38
54
|
attempted: boolean;
|
|
@@ -63,3 +79,4 @@ export interface InitOrphanRecoveryResult {
|
|
|
63
79
|
* @returns Result object describing what was attempted and any warnings/diagnostics
|
|
64
80
|
*/
|
|
65
81
|
export declare function runInitOrphanRecovery(directory: string): Promise<InitOrphanRecoveryResult>;
|
|
82
|
+
export {};
|