opencode-swarm 7.139.2 → 7.139.4
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/phase-wrap/SKILL.md +2 -2
- package/README.md +2 -2
- package/dist/background/stage-b-gates.d.ts +5 -1
- package/dist/background/task-envelope.d.ts +4 -4
- package/dist/cli/{config-doctor-hrb61yqe.js → config-doctor-whxr386t.js} +6 -6
- package/dist/cli/{core-g2dfh9fq.js → core-aj5g7an6.js} +5 -5
- package/dist/cli/{curation-policy-4tp0mbcb.js → curation-policy-anym2y3v.js} +8 -8
- package/dist/cli/{curator-drift-vfh07mqy.js → curator-drift-49p3jnte.js} +7 -7
- package/dist/cli/{curator-vpcs1p1v.js → curator-e8cvb55d.js} +41 -41
- package/dist/cli/curator-llm-factory-h9xbpgmw.js +61 -0
- package/dist/cli/{dispatch-b1fge4xk.js → dispatch-2s23fbcs.js} +4 -4
- package/dist/cli/{evidence-summary-service-kzxr71yd.js → evidence-summary-service-g82bsjqa.js} +16 -16
- package/dist/cli/{gate-evidence-z2b1ymnw.js → gate-evidence-72cgrvs2.js} +6 -5
- package/dist/cli/guardrail-explain-0be7msvq.js +62 -0
- package/dist/cli/{guardrail-log-2ftew0p3.js → guardrail-log-9mm5443g.js} +9 -9
- package/dist/cli/{hive-promoter-mpf0cfkk.js → hive-promoter-nnzs5x1r.js} +41 -41
- package/dist/cli/{index-w71cq27a.js → index-0e95eck5.js} +5 -5
- package/dist/cli/{index-5zyk8qgv.js → index-0xkjhgrf.js} +5 -5
- package/dist/cli/{index-q7ezzgwq.js → index-1kyex7z2.js} +1 -1
- package/dist/cli/{index-668dpw5e.js → index-33skgk1a.js} +1 -1
- package/dist/cli/{index-vm4xw9z3.js → index-41hkt36g.js} +2 -2
- package/dist/cli/{index-y111zefa.js → index-4nt52yr9.js} +80 -31
- package/dist/cli/{index-3jcyn8g6.js → index-4wjk296r.js} +1 -1
- package/dist/cli/{index-3radty3f.js → index-5azdnaty.js} +2 -2
- package/dist/cli/{index-8p9pasnp.js → index-5s23pfsy.js} +8 -8
- package/dist/cli/{index-5w7ekpy3.js → index-5z2xps64.js} +2 -2
- package/dist/cli/{index-0wp67gqj.js → index-6nzmp937.js} +61 -111
- package/dist/cli/{index-gvhvz176.js → index-6r522srn.js} +2 -2
- package/dist/cli/{index-4xbyy6aw.js → index-6rxgb5r9.js} +10 -6
- package/dist/cli/{index-cyw81ngh.js → index-6vh6vrnk.js} +10 -10
- package/dist/cli/{index-a12906mj.js → index-6z0a940s.js} +8 -8
- package/dist/cli/{index-wsdnttf4.js → index-74hpm6sh.js} +1 -1
- package/dist/cli/{index-6w1re1qn.js → index-9cdj4020.js} +6 -6
- package/dist/cli/{index-y47dwge1.js → index-e1k9vpqn.js} +5 -5
- package/dist/cli/{index-y64jv2pe.js → index-ejbcpbzp.js} +7 -7
- package/dist/cli/{index-6c5f309q.js → index-gfmrw2f5.js} +2 -2
- package/dist/cli/{index-prmb5qfp.js → index-j77frjq8.js} +7 -7
- package/dist/cli/{index-ffpmqx30.js → index-jnfyxeap.js} +4 -4
- package/dist/cli/{index-e9tx99ds.js → index-k41dn8me.js} +3 -3
- package/dist/cli/{index-x9q4bbhd.js → index-k46me75h.js} +4 -4
- package/dist/cli/{index-s608d3hw.js → index-nrx08gcr.js} +6 -2
- package/dist/cli/{index-ktagrqxw.js → index-pg84msyc.js} +7 -7
- package/dist/cli/{index-a5eba0t8.js → index-rsrx77fg.js} +6 -6
- package/dist/cli/index-s0qc4gj6.js +298 -0
- package/dist/cli/{index-q11t5erh.js → index-s58vghgj.js} +7 -7
- package/dist/cli/{index-se8xc78k.js → index-sa15nfgg.js} +45 -45
- package/dist/cli/{index-wrt6m5ze.js → index-sd657fkp.js} +291 -75
- package/dist/cli/{index-yr6x707c.js → index-vfsqpcz6.js} +16 -16
- package/dist/cli/{index-a7nh382r.js → index-vyqd1hzm.js} +20593 -19882
- package/dist/cli/{index-8gftfvpp.js → index-xb1zq933.js} +1 -1
- package/dist/cli/{index-3eddtgxt.js → index-xmhhhjjw.js} +39 -4
- package/dist/cli/index.js +43 -43
- package/dist/cli/{knowledge-escalator-n9pmx4qr.js → knowledge-escalator-a6z30y9p.js} +10 -10
- package/dist/cli/{knowledge-events-raevm18w.js → knowledge-events-deq0ds8e.js} +7 -7
- package/dist/cli/{knowledge-link-3tq8w6gs.js → knowledge-link-bmbatt8s.js} +6 -6
- package/dist/cli/{knowledge-store-bcfqz8fr.js → knowledge-store-vdr19mnq.js} +8 -8
- package/dist/cli/{knowledge-validator-jxqj96cx.js → knowledge-validator-5hgacnrf.js} +11 -11
- package/dist/cli/{pending-delegations-tmyf18p4.js → pending-delegations-7ayryxbg.js} +8 -8
- package/dist/cli/{pr-subscriptions-hhx6yk24.js → pr-subscriptions-w5y08ebc.js} +8 -8
- package/dist/cli/{runner-w30gazew.js → runner-h7vmgkth.js} +7 -6
- package/dist/cli/{scan-cursor-ah5swtyh.js → scan-cursor-d6qcg9hr.js} +9 -9
- package/dist/cli/{schema-f7jgrtxj.js → schema-y1zekrag.js} +3 -3
- package/dist/cli/{scope-persistence-3f0d4fwv.js → scope-persistence-tj6qway9.js} +7 -7
- package/dist/cli/{skill-generator-hp7as46c.js → skill-generator-bw8xhzzn.js} +13 -13
- package/dist/cli/{task-envelope-qn0qtnh0.js → task-envelope-jp2fdsvn.js} +11 -8
- package/dist/cli/{telemetry-4tgrfhaz.js → telemetry-62cn5t24.js} +1 -1
- package/dist/cli/{workspace-snapshot-h5rzw37b.js → workspace-snapshot-w3tg4ne5.js} +2 -2
- package/dist/cli/{worktree-collision-ownership-vexb0b6r.js → worktree-collision-ownership-hs5c2qzp.js} +9 -9
- package/dist/commands/approve-plan-critic.d.ts +2 -2
- package/dist/commands/registry.d.ts +1 -1
- package/dist/config/agent-model.d.ts +35 -0
- package/dist/db/qa-gate-profile.d.ts +11 -3
- package/dist/evidence/manager.d.ts +5 -2
- package/dist/evidence/phase-participation.d.ts +44 -0
- package/dist/hooks/compaction-customizer.d.ts +30 -2
- package/dist/hooks/context-budget.d.ts +1 -1
- package/dist/hooks/delegation-gate.d.ts +3 -3
- package/dist/hooks/guardrails/index.d.ts +5 -1
- package/dist/hooks/guardrails/messages-transform.d.ts +2 -0
- package/dist/hooks/guardrails/pre-check-result.d.ts +20 -0
- package/dist/index.js +616 -609
- package/dist/prm/escalation.d.ts +34 -0
- package/dist/prm/index.d.ts +6 -2
- package/dist/prm/pattern-detector.d.ts +22 -1
- package/dist/prm/types.d.ts +12 -2
- package/dist/sast/semgrep.d.ts +15 -32
- package/dist/services/compaction-service.d.ts +3 -1
- package/dist/session/snapshot-writer.d.ts +1 -0
- package/dist/state.d.ts +119 -19
- package/dist/summaries/schema.d.ts +2 -2
- package/dist/tools/context-status.d.ts +4 -1
- package/dist/tools/convene-council.d.ts +1 -1
- package/dist/tools/lint.d.ts +48 -22
- package/dist/tools/pre-check-batch.d.ts +41 -13
- package/dist/tools/quality-budget.d.ts +3 -2
- package/dist/tools/resolve-working-directory.d.ts +4 -4
- package/dist/tools/sast-baseline.d.ts +1 -0
- package/dist/tools/sast-scan.d.ts +4 -1
- package/dist/tools/secretscan.d.ts +2 -2
- package/dist/tools/set-qa-gates.d.ts +5 -4
- package/dist/tools/submit-phase-council-verdicts.d.ts +1 -1
- package/dist/tools/write-final-council-evidence.d.ts +1 -1
- package/dist/utils/bun-compat.d.ts +20 -0
- package/dist/utils/external-tool-runner.d.ts +10 -0
- package/dist/utils/project-boundary.d.ts +34 -0
- package/package.json +1 -1
- package/dist/cli/curator-llm-factory-hvw13hmr.js +0 -61
- package/dist/cli/guardrail-explain-k62h3c92.js +0 -62
- package/dist/cli/index-5j6chvj8.js +0 -159
- package/dist/cli/{index-z6xqpmqg.js → index-ee3x66a5.js} +3 -3
|
@@ -3,26 +3,26 @@ import {
|
|
|
3
3
|
WORKTREE_PROVISIONING_OWNER_LEASE_MS,
|
|
4
4
|
removeWorktreeProvisioningOwner,
|
|
5
5
|
scanWorktreeProvisioningOwnersForRecovery
|
|
6
|
-
} from "./index-
|
|
6
|
+
} from "./index-1kyex7z2.js";
|
|
7
7
|
import {
|
|
8
8
|
scanWorktreeMergeFailuresForRecovery
|
|
9
9
|
} from "./index-b8zgtz81.js";
|
|
10
10
|
import {
|
|
11
11
|
scanDelegationFallbacksForRecovery,
|
|
12
12
|
scanDelegationsForRecovery
|
|
13
|
-
} from "./index-
|
|
14
|
-
import"./index-
|
|
13
|
+
} from "./index-j77frjq8.js";
|
|
14
|
+
import"./index-k46me75h.js";
|
|
15
|
+
import"./index-ee3x66a5.js";
|
|
15
16
|
import"./index-ed5ykebp.js";
|
|
16
|
-
import"./index-
|
|
17
|
+
import"./index-s0qc4gj6.js";
|
|
17
18
|
import"./index-7g4c7s5r.js";
|
|
18
|
-
import"./index-a5eba0t8.js";
|
|
19
|
-
import"./index-bpmtbmy9.js";
|
|
20
|
-
import"./index-z6xqpmqg.js";
|
|
21
|
-
import"./index-zjygnfay.js";
|
|
22
19
|
import {
|
|
23
20
|
bunSpawn
|
|
24
|
-
} from "./index-
|
|
21
|
+
} from "./index-4nt52yr9.js";
|
|
25
22
|
import"./index-zgwm4ryv.js";
|
|
23
|
+
import"./index-zjygnfay.js";
|
|
24
|
+
import"./index-rsrx77fg.js";
|
|
25
|
+
import"./index-bpmtbmy9.js";
|
|
26
26
|
import"./index-a76rekgs.js";
|
|
27
27
|
|
|
28
28
|
// src/hooks/delegation-gate/worktree-collision-ownership.ts
|
|
@@ -5,8 +5,8 @@
|
|
|
5
5
|
* gate (issue #2012). When the critic returns APPROVED but the mechanical
|
|
6
6
|
* snapshot recorder fails to persist it (verdict-format mismatch, dispatch-
|
|
7
7
|
* signal miss, or a plan.json read race), the gate permanently blocks ALL
|
|
8
|
-
* coder delegations
|
|
9
|
-
*
|
|
8
|
+
* coder delegations when the effective `critic_pre_plan` gate is enabled. This
|
|
9
|
+
* records a manual `plan_critic_gate` approval snapshot so the
|
|
10
10
|
* gate unblocks, with a distinct `method: 'manual_override'` audit marker.
|
|
11
11
|
*
|
|
12
12
|
* The command is `toolPolicy: 'restricted'` — the agent cannot run it via
|
|
@@ -627,7 +627,7 @@ export declare const COMMAND_REGISTRY: {
|
|
|
627
627
|
readonly handler: (ctx: CommandContext) => Promise<string>;
|
|
628
628
|
readonly description: "Record a MANUAL plan-critic approval to unblock the critic_pre_plan execution gate [reason...]";
|
|
629
629
|
readonly args: "[reason...]";
|
|
630
|
-
readonly details: "Human-only escape hatch for the ratchet-tighter critic_pre_plan execution gate (issue #2012). When the critic already returned APPROVED but the mechanical snapshot recorder failed to persist it (verdict-format mismatch, dispatch-signal miss, or a plan.json read race),
|
|
630
|
+
readonly details: "Human-only escape hatch for the ratchet-tighter critic_pre_plan execution gate (issue #2012). When the critic already returned APPROVED but the mechanical snapshot recorder failed to persist it (verdict-format mismatch, dispatch-signal miss, or a plan.json read race), an enabled critic_pre_plan gate blocks coder delegation. Running this records a manual plan_critic_gate approval snapshot so the gate unblocks, with a distinct method: \"manual_override\" audit marker. The agent itself cannot run this command; it must call the approve_plan_critic tool (or ask you to run this command). Both paths funnel into the same forceRecordPlanCriticApproval hook, which requires an active architect session. An audit event is appended to .swarm/events.jsonl. Prefer re-running MODE: CRITIC-GATE first; use this only as an escape hatch when a legitimate APPROVED was lost.";
|
|
631
631
|
readonly category: "utility";
|
|
632
632
|
readonly toolPolicy: "restricted";
|
|
633
633
|
};
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import type { PluginConfig } from './schema';
|
|
2
|
+
export interface ParsedAgentModel {
|
|
3
|
+
modelID: string;
|
|
4
|
+
providerID?: string;
|
|
5
|
+
}
|
|
6
|
+
type RegisteredAgentModel = {
|
|
7
|
+
model?: unknown;
|
|
8
|
+
mode?: unknown;
|
|
9
|
+
};
|
|
10
|
+
/** Split a supported legacy `provider/model/variant` value like registration does. */
|
|
11
|
+
export declare function splitEmbeddedAgentVariant(model: string): {
|
|
12
|
+
model: string;
|
|
13
|
+
variant?: string;
|
|
14
|
+
};
|
|
15
|
+
/**
|
|
16
|
+
* Return only an explicit, nonblank model for an exact generated agent target.
|
|
17
|
+
* Unknown swarm prefixes and agent names fail closed instead of borrowing a
|
|
18
|
+
* similarly named role from another swarm.
|
|
19
|
+
*/
|
|
20
|
+
export declare function resolveConfiguredAgentModel(config: PluginConfig, exactAgentName: string): string | undefined;
|
|
21
|
+
/** Resolve the registered model for an exact generated agent target. */
|
|
22
|
+
export declare function resolveRegisteredAgentModel(config: PluginConfig, exactAgentName: string): string | undefined;
|
|
23
|
+
/**
|
|
24
|
+
* Resolve the model that an exact generated agent will actually receive.
|
|
25
|
+
*
|
|
26
|
+
* Primary agents intentionally omit their registered model so OpenCode's UI
|
|
27
|
+
* controls selection; their live assistant metadata remains authoritative.
|
|
28
|
+
* Subagents use a runtime-mutated explicit model (including guardrail fallback)
|
|
29
|
+
* before the factory-resolved registered model, which also preserves inherited
|
|
30
|
+
* role defaults such as curator -> explorer.
|
|
31
|
+
*/
|
|
32
|
+
export declare function resolveRuntimeAgentModel(config: PluginConfig, registeredAgents: Record<string, RegisteredAgentModel>, exactAgentName: string): string | undefined;
|
|
33
|
+
/** Parse model-only or provider/model config values without partial fallback. */
|
|
34
|
+
export declare function parseAgentModel(model: string): ParsedAgentModel | undefined;
|
|
35
|
+
export {};
|
|
@@ -19,6 +19,7 @@ export declare const _internals: {
|
|
|
19
19
|
getEffectiveGates: typeof getEffectiveGates;
|
|
20
20
|
computeProfileHash: typeof computeProfileHash;
|
|
21
21
|
hasAnyProfileWithEnabledGate: typeof hasAnyProfileWithEnabledGate;
|
|
22
|
+
afterSetGatesRead: (profile: QaGateProfile) => void;
|
|
22
23
|
};
|
|
23
24
|
/**
|
|
24
25
|
* QA gate flags. All eleven gates are tracked explicitly.
|
|
@@ -74,9 +75,15 @@ export declare function getProfile(directory: string, planId: string): QaGatePro
|
|
|
74
75
|
export declare function hasAnyProfileWithEnabledGate(directory: string, gate: keyof QaGates): boolean;
|
|
75
76
|
/**
|
|
76
77
|
* Return the existing profile for `planId`, or create a new one seeded with
|
|
77
|
-
* `DEFAULT_QA_GATES`
|
|
78
|
+
* `DEFAULT_QA_GATES` plus the caller's initial gate selection if none exists.
|
|
79
|
+
*
|
|
80
|
+
* `initialGates` is applied only by the winning INSERT. A caller that loses a
|
|
81
|
+
* UNIQUE-index race receives the winner's profile unchanged and must still run
|
|
82
|
+
* `setGates` to apply the normal ratchet rules. This lets the first architect
|
|
83
|
+
* selection turn default-on gates off without giving a later/concurrent caller
|
|
84
|
+
* a way to loosen an already-persisted `true` gate.
|
|
78
85
|
*/
|
|
79
|
-
export declare function getOrCreateProfile(directory: string, planId: string, projectType?: string): QaGateProfile;
|
|
86
|
+
export declare function getOrCreateProfile(directory: string, planId: string, projectType?: string, initialGates?: Partial<QaGates>): QaGateProfile;
|
|
80
87
|
/**
|
|
81
88
|
* Update gates for `planId`. Gates can only be ratcheted tighter —
|
|
82
89
|
* attempting to disable a currently-enabled gate throws. Throws if the
|
|
@@ -112,7 +119,8 @@ export declare function computeProfileHash(profile: QaGateProfile): string;
|
|
|
112
119
|
* - council_mode — src/state.ts isCouncilGateActive + src/hooks/delegation-gate.ts
|
|
113
120
|
* (replaces per-task Stage B with full 5-member council via submit_council_verdicts).
|
|
114
121
|
* - sme_enabled — consumed during MODE: BRAINSTORM/SPECIFY architect dialogue.
|
|
115
|
-
* - critic_pre_plan —
|
|
122
|
+
* - critic_pre_plan — src/hooks/delegation-gate.ts (blocks coder delegation
|
|
123
|
+
* until plan-critic approval when the effective gate is enabled).
|
|
116
124
|
* - sast_enabled — consumed inside pre_check_batch tool.
|
|
117
125
|
* - hallucination_guard — src/tools/phase-complete.ts Gate 3 (blocks phase_complete
|
|
118
126
|
* until .swarm/evidence/{phase}/hallucination-guard.json has APPROVED verdict).
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { realpathSync, statSync } from 'node:fs';
|
|
1
2
|
import { type BuildEvidence, type Evidence, type EvidenceBundle, type PlaceholderEvidence, type QualityBudgetEvidence, type SastEvidence, type SbomEvidence, type SecretscanEvidence, type SyntaxEvidence } from '../config/evidence-schema';
|
|
2
3
|
import { type EvaluationRetentionResult } from '../evaluation/retention.js';
|
|
3
4
|
import { type DocumentsRetentionResult, pruneEvidenceDocuments } from './documents-retention.js';
|
|
@@ -66,7 +67,7 @@ export declare function isQualityBudgetEvidence(evidence: Evidence): evidence is
|
|
|
66
67
|
export declare function isSecretscanEvidence(evidence: Evidence): evidence is SecretscanEvidence;
|
|
67
68
|
import { sanitizeTaskId as _sanitizeTaskId } from '../validation/task-id';
|
|
68
69
|
export declare const sanitizeTaskId: typeof _sanitizeTaskId;
|
|
69
|
-
/** Maximum depth to walk up the directory tree before
|
|
70
|
+
/** Maximum depth to walk up the directory tree before failing closed. */
|
|
70
71
|
export declare const MAX_DEPTH = 20;
|
|
71
72
|
/** File/directory names that indicate a real project root. */
|
|
72
73
|
export declare const PROJECT_INDICATORS: readonly ["package.json", ".git", ".opencode", "Cargo.toml", "go.mod", "pyproject.toml", "Gemfile", "composer.json", "pom.xml", "build.gradle", "CMakeLists.txt"];
|
|
@@ -85,7 +86,7 @@ export declare function validateProjectRoot(directory: string): void;
|
|
|
85
86
|
* Performs atomic write via temp file + rename.
|
|
86
87
|
* @throws Error if task ID is invalid or size limit would be exceeded
|
|
87
88
|
*/
|
|
88
|
-
export declare function saveEvidence(directory: string, taskId: string, evidence: Evidence): Promise<EvidenceBundle>;
|
|
89
|
+
export declare function saveEvidence(directory: string, taskId: string, evidence: Evidence, abortSignal?: AbortSignal): Promise<EvidenceBundle>;
|
|
89
90
|
/**
|
|
90
91
|
* Transform a flat retrospective object into a valid EvidenceBundle.
|
|
91
92
|
*/
|
|
@@ -172,6 +173,8 @@ export declare const _internals: {
|
|
|
172
173
|
saveEvidence: typeof saveEvidence;
|
|
173
174
|
deleteEvidence: typeof deleteEvidence;
|
|
174
175
|
pruneEvidenceDocuments: typeof pruneEvidenceDocuments;
|
|
176
|
+
realpathSync: typeof realpathSync;
|
|
177
|
+
statSync: typeof statSync;
|
|
175
178
|
now: () => Date;
|
|
176
179
|
};
|
|
177
180
|
export {};
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Durable, phase-bound proof that a required swarm role completed successfully.
|
|
3
|
+
*
|
|
4
|
+
* Foreground Task calls are correlated in memory only until their terminal
|
|
5
|
+
* tool.execute.after event. Background calls promote the same reservation to
|
|
6
|
+
* this store's durable pending list and are completed only by the trusted
|
|
7
|
+
* background completion observer.
|
|
8
|
+
*/
|
|
9
|
+
import type { BackgroundDelegationRecord } from '../background/pending-delegations.js';
|
|
10
|
+
import { type Plan } from '../config/plan-schema.js';
|
|
11
|
+
export declare const PHASE_PARTICIPATION_FILE = "evidence/phase-participation.json";
|
|
12
|
+
export declare const PHASE_PARTICIPATION_QUARANTINE_DIR = "evidence/phase-participation-quarantine";
|
|
13
|
+
export declare const MAX_PHASE_PARTICIPATION_BYTES: number;
|
|
14
|
+
export declare const MAX_PHASE_PARTICIPATION_PENDING = 128;
|
|
15
|
+
export declare const MAX_PHASE_PARTICIPATION_RECEIPTS = 128;
|
|
16
|
+
export declare const MAX_PHASE_PARTICIPATION_QUARANTINE_FILES = 16;
|
|
17
|
+
export declare const MAX_PHASE_PARTICIPATION_QUARANTINE_BYTES: number;
|
|
18
|
+
export declare const MAX_PHASE_PARTICIPATION_QUARANTINE_DIRECTORY_ENTRIES = 64;
|
|
19
|
+
export interface ParticipationReadResult {
|
|
20
|
+
status: 'missing' | 'valid' | 'corrupt' | 'unreadable' | 'oversized';
|
|
21
|
+
found: boolean;
|
|
22
|
+
}
|
|
23
|
+
export declare function reserveApprovedPhaseParticipation(input: {
|
|
24
|
+
directory: string;
|
|
25
|
+
tool: string;
|
|
26
|
+
parentSessionId: string;
|
|
27
|
+
callId: string;
|
|
28
|
+
args: Record<string, unknown>;
|
|
29
|
+
policy: unknown;
|
|
30
|
+
}): Promise<void>;
|
|
31
|
+
export declare function observePhaseParticipationToolResult(input: {
|
|
32
|
+
directory: string;
|
|
33
|
+
tool: string;
|
|
34
|
+
parentSessionId: string;
|
|
35
|
+
callId: string;
|
|
36
|
+
output: unknown;
|
|
37
|
+
}): Promise<void>;
|
|
38
|
+
export declare function completeBackgroundPhaseParticipation(input: {
|
|
39
|
+
directory: string;
|
|
40
|
+
record: BackgroundDelegationRecord;
|
|
41
|
+
resultText: string;
|
|
42
|
+
}): Promise<boolean>;
|
|
43
|
+
export declare function readPhaseParticipation(directory: string, plan: Plan, phase: number, role: string): ParticipationReadResult;
|
|
44
|
+
export declare function resetPhaseParticipationForTests(): void;
|
|
@@ -1,11 +1,39 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Compaction Customizer Hook
|
|
3
3
|
*
|
|
4
|
-
* Enhances session compaction by injecting
|
|
5
|
-
* Adds current phase information and key decisions to the compaction context.
|
|
4
|
+
* Enhances session compaction by injecting bounded, summary-only swarm facts.
|
|
6
5
|
*/
|
|
6
|
+
import * as fs from 'node:fs';
|
|
7
7
|
import type { PluginConfig } from '../config';
|
|
8
|
+
interface CompactionFact {
|
|
9
|
+
label: string;
|
|
10
|
+
value: string;
|
|
11
|
+
}
|
|
12
|
+
declare function countStoredOutputs(directory: string): Promise<{
|
|
13
|
+
count: number;
|
|
14
|
+
truncated: boolean;
|
|
15
|
+
} | null>;
|
|
16
|
+
/**
|
|
17
|
+
* Build one bounded block so the host never receives a partially-delimited set
|
|
18
|
+
* of plugin facts. The caller appends this block atomically to output.context.
|
|
19
|
+
*/
|
|
20
|
+
declare function buildCompactionFactsBlock(facts: CompactionFact[]): string;
|
|
8
21
|
/**
|
|
9
22
|
* Creates the experimental.session.compacting hook for compaction customization.
|
|
10
23
|
*/
|
|
11
24
|
export declare function createCompactionCustomizerHook(config: PluginConfig, directory: string): Record<string, unknown>;
|
|
25
|
+
export declare const _test_exports: {
|
|
26
|
+
buildCompactionFactsBlock: typeof buildCompactionFactsBlock;
|
|
27
|
+
compactionFs: {
|
|
28
|
+
lstat: typeof fs.promises.lstat;
|
|
29
|
+
realpath: typeof fs.promises.realpath;
|
|
30
|
+
opendir: typeof fs.promises.opendir;
|
|
31
|
+
};
|
|
32
|
+
countStoredOutputs: typeof countStoredOutputs;
|
|
33
|
+
MAX_COMPACTION_FACT_CHARS: number;
|
|
34
|
+
MAX_COMPACTION_CONTEXT_CHARS: number;
|
|
35
|
+
MAX_STORED_OUTPUTS_TO_COUNT: number;
|
|
36
|
+
COMPACTION_FACTS_OPEN: string;
|
|
37
|
+
COMPACTION_FACTS_CLOSE: string;
|
|
38
|
+
};
|
|
39
|
+
export {};
|
|
@@ -36,7 +36,7 @@ interface MessageWithParts {
|
|
|
36
36
|
* Injects warnings when context usage exceeds configured thresholds.
|
|
37
37
|
* Only operates on messages for the architect agent.
|
|
38
38
|
*/
|
|
39
|
-
export declare function createContextBudgetHandler(config: PluginConfig): (_input: Record<string, never>, _output: {
|
|
39
|
+
export declare function createContextBudgetHandler(config: PluginConfig, resolveAgentModel?: (agentName: string) => string | undefined): (_input: Record<string, never>, _output: {
|
|
40
40
|
messages?: MessageWithParts[];
|
|
41
41
|
}) => Promise<void>;
|
|
42
42
|
export {};
|
|
@@ -288,9 +288,9 @@ export declare function isPlanCriticApproved(directory: string): Promise<boolean
|
|
|
288
288
|
* When the critic returns APPROVED but the mechanical snapshot recorder
|
|
289
289
|
* ({@link recordPlanCriticApprovalSnapshotIfApplicable}) fails to persist it
|
|
290
290
|
* (verdict-format mismatch, dispatch-signal miss, or a plan.json read race),
|
|
291
|
-
* the gate
|
|
292
|
-
*
|
|
293
|
-
*
|
|
291
|
+
* the gate blocks coder delegations when the effective `critic_pre_plan`
|
|
292
|
+
* policy is enabled. This records a manual `plan_critic_gate` approval snapshot
|
|
293
|
+
* so the gate unblocks, with a
|
|
294
294
|
* distinct `method: 'manual_override'` audit marker so a human or downstream
|
|
295
295
|
* review can distinguish a manual approval from a mechanical critic approval.
|
|
296
296
|
*
|
|
@@ -21,6 +21,10 @@ export declare const _internals: {
|
|
|
21
21
|
dcCheckJunctionCreation: typeof dcCheckJunctionCreation;
|
|
22
22
|
extractErrorSignal: typeof extractErrorSignal;
|
|
23
23
|
getSandboxExecutor: typeof getExecutor;
|
|
24
|
+
/** Test-only compatibility for legacy direct-after hook tests. */
|
|
25
|
+
allowUncorrelatedGateReceipts: boolean;
|
|
26
|
+
MAX_PENDING_GATE_RECEIPTS_PER_SESSION: number;
|
|
27
|
+
MAX_PENDING_GATE_RECEIPT_SESSIONS: number;
|
|
24
28
|
/**
|
|
25
29
|
* Test/inspection seams for the no-op detector's bounded session state
|
|
26
30
|
* (invariant 8). Production code does not call these; they exist so the
|
|
@@ -82,7 +86,7 @@ export { redactShellCommand } from './helpers';
|
|
|
82
86
|
* @param config Guardrails configuration (optional)
|
|
83
87
|
* @returns Tool before/after hooks and messages transform hook
|
|
84
88
|
*/
|
|
85
|
-
export declare function createGuardrailsHooks(directory: string, directoryOrConfig?: string | GuardrailsConfig, config?: GuardrailsConfig, authorityConfig?: AuthorityConfig, worktreeBaseDirOverrides?: string[]): {
|
|
89
|
+
export declare function createGuardrailsHooks(directory: string, directoryOrConfig?: string | GuardrailsConfig, config?: GuardrailsConfig, authorityConfig?: AuthorityConfig, worktreeBaseDirOverrides?: string[], resolveAgentModel?: (agentName: string) => string | undefined): {
|
|
86
90
|
toolBefore: (input: {
|
|
87
91
|
tool: string;
|
|
88
92
|
sessionID: string;
|
|
@@ -33,6 +33,8 @@ export interface MessagesTransformContext {
|
|
|
33
33
|
* explanation for the silence.
|
|
34
34
|
*/
|
|
35
35
|
lastCountedAssistantMsgId: Map<string, string>;
|
|
36
|
+
/** Resolve an explicit model for the exact incoming agent, when available. */
|
|
37
|
+
resolveAgentModel?: (agentName: string) => string | undefined;
|
|
36
38
|
}
|
|
37
39
|
type ChatMessageLike = {
|
|
38
40
|
/**
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
export type PreCheckVerdict = {
|
|
2
|
+
kind: 'pass';
|
|
3
|
+
} | {
|
|
4
|
+
kind: 'fail';
|
|
5
|
+
code: 'PRE_CHECK_FAILED' | 'PRE_CHECK_INPUT_INVALID';
|
|
6
|
+
} | {
|
|
7
|
+
kind: 'skip';
|
|
8
|
+
} | {
|
|
9
|
+
kind: 'invalid';
|
|
10
|
+
code: 'PRE_CHECK_RESULT_INVALID';
|
|
11
|
+
};
|
|
12
|
+
/**
|
|
13
|
+
* Decode the public pre_check_batch result without treating nested text as
|
|
14
|
+
* control data. Unknown, oversized, truncated, or contradictory shapes are
|
|
15
|
+
* non-passing and receive one bounded diagnostic code.
|
|
16
|
+
*/
|
|
17
|
+
export declare function decodePreCheckResult(output: unknown): PreCheckVerdict;
|
|
18
|
+
export declare const _internals: {
|
|
19
|
+
MAX_PRE_CHECK_RESULT_BYTES: number;
|
|
20
|
+
};
|