opencode-swarm 7.114.3 → 7.114.5
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/execute/SKILL.md +12 -14
- package/.opencode/skills/swarm-pr-review/SKILL.md +136 -78
- package/README.md +2 -1
- package/dist/agents/explorer.d.ts +1 -1
- package/dist/background/candidate-parser.d.ts +30 -0
- package/dist/background/candidate-sidecar-store.d.ts +4 -3
- package/dist/cli/{config-doctor-xbdfrbwt.js → config-doctor-jy3mdh9t.js} +2 -2
- package/dist/cli/{curator-68rn0ss8.js → curator-2cnthj9n.js} +5 -5
- package/dist/cli/{curator-llm-factory-fpzm8j0g.js → curator-llm-factory-asqhpq08.js} +5 -5
- package/dist/cli/{explorer-t5srbq64.js → explorer-jp0nen03.js} +1 -1
- package/dist/cli/{guardrail-explain-k3bb68q5.js → guardrail-explain-xt6skemq.js} +6 -6
- package/dist/cli/{guardrail-log-qfc2j0tb.js → guardrail-log-84wnx273.js} +3 -3
- package/dist/cli/{hive-promoter-h3jcrdh0.js → hive-promoter-n9qt3sth.js} +5 -5
- package/dist/cli/{index-xbe1wtme.js → index-7jmrbp68.js} +1 -1
- package/dist/cli/{index-2148358e.js → index-9bsmzfk3.js} +1 -1
- package/dist/cli/{index-147ja18h.js → index-a45jq4b7.js} +4 -0
- package/dist/cli/{index-e8zaze89.js → index-fc35yaah.js} +18 -18
- package/dist/cli/{index-by2gt09c.js → index-s0h4kf1t.js} +7 -7
- package/dist/cli/{index-hnv7rrf9.js → index-s8se9nt5.js} +2 -2
- package/dist/cli/{index-jt58s751.js → index-vxv732ex.js} +8 -4
- package/dist/cli/{index-g6va6n3t.js → index-yfedche9.js} +1 -1
- package/dist/cli/index.js +5 -5
- package/dist/cli/{schema-e5kd993s.js → schema-aymfdrsb.js} +1 -1
- package/dist/hooks/skill-injection.d.ts +80 -0
- package/dist/index.js +85 -77
- package/dist/tools/index.d.ts +1 -0
- package/dist/tools/manifest.d.ts +1 -0
- package/dist/tools/tool-metadata.d.ts +4 -0
- package/dist/tools/write-pr-review-trigger-eval.d.ts +74 -0
- package/package.json +1 -1
|
@@ -27,6 +27,11 @@ declare const ParseFlagsSchema: z.ZodObject<{
|
|
|
27
27
|
degraded: z.ZodBoolean;
|
|
28
28
|
row_format_version: z.ZodNumber;
|
|
29
29
|
producer: z.ZodOptional<z.ZodString>;
|
|
30
|
+
expected_family: z.ZodOptional<z.ZodEnum<{
|
|
31
|
+
micro_lane: "micro_lane";
|
|
32
|
+
base_explorer: "base_explorer";
|
|
33
|
+
}>>;
|
|
34
|
+
expected_micro_lane: z.ZodOptional<z.ZodString>;
|
|
30
35
|
}, z.core.$strict>;
|
|
31
36
|
export type ArtifactInput = z.infer<typeof ArtifactInputSchema>;
|
|
32
37
|
export type ParseFlags = z.infer<typeof ParseFlagsSchema>;
|
|
@@ -66,6 +71,28 @@ export interface CandidateRecord {
|
|
|
66
71
|
invariant_violated: string | null;
|
|
67
72
|
confidence: string | null;
|
|
68
73
|
}
|
|
74
|
+
/** A machine-readable attestation that a complete micro-lane found no candidates. */
|
|
75
|
+
export interface CleanAttestationRecord {
|
|
76
|
+
record_type: 'clean_attestation';
|
|
77
|
+
row_format_family: 'micro_lane';
|
|
78
|
+
row_format_version: number;
|
|
79
|
+
record_version: {
|
|
80
|
+
major: number;
|
|
81
|
+
minor: number;
|
|
82
|
+
};
|
|
83
|
+
source_output_ref: string;
|
|
84
|
+
source_batch_id: string;
|
|
85
|
+
source_lane_id: string;
|
|
86
|
+
source_agent: string;
|
|
87
|
+
source_digest: string;
|
|
88
|
+
extracted_from_partial_source: false;
|
|
89
|
+
sessionId?: string;
|
|
90
|
+
parentSessionId?: string;
|
|
91
|
+
producer?: string;
|
|
92
|
+
micro_lane: string;
|
|
93
|
+
coverage_scope: string;
|
|
94
|
+
evidence: string;
|
|
95
|
+
}
|
|
69
96
|
/**
|
|
70
97
|
* One invocation-envelope record per parseCandidates call.
|
|
71
98
|
* Part of the return value but not persisted to a sidecar in this phase.
|
|
@@ -90,6 +117,7 @@ export interface InvocationEnvelope {
|
|
|
90
117
|
candidate_count: number;
|
|
91
118
|
parse_errors: number;
|
|
92
119
|
malformed_rows: number;
|
|
120
|
+
clean_attestation_count: number;
|
|
93
121
|
}
|
|
94
122
|
/**
|
|
95
123
|
* Detail record for a required-field violation inside a data row.
|
|
@@ -119,6 +147,7 @@ export interface DiagnosticsSummary {
|
|
|
119
147
|
degraded_source_count: number;
|
|
120
148
|
incomplete_source_count: number;
|
|
121
149
|
format_families_detected: string[];
|
|
150
|
+
clean_attestation_count: number;
|
|
122
151
|
format_mismatch_hint?: string;
|
|
123
152
|
}
|
|
124
153
|
/**
|
|
@@ -128,6 +157,7 @@ export interface ParseResult {
|
|
|
128
157
|
error?: string;
|
|
129
158
|
error_code?: string;
|
|
130
159
|
candidates: CandidateRecord[];
|
|
160
|
+
clean_attestation?: CleanAttestationRecord;
|
|
131
161
|
invocation_envelope: InvocationEnvelope;
|
|
132
162
|
diagnostics: DiagnosticsSummary;
|
|
133
163
|
}
|
|
@@ -30,8 +30,8 @@ export interface SidecarStoreOptions {
|
|
|
30
30
|
*/
|
|
31
31
|
export declare function sanitizeString(value: string): string;
|
|
32
32
|
/**
|
|
33
|
-
* Append an invocation envelope
|
|
34
|
-
* to the sidecar JSONL file for the given batch.
|
|
33
|
+
* Append an invocation envelope, an optional CLEAN attestation, and zero or
|
|
34
|
+
* more candidate records to the sidecar JSONL file for the given batch.
|
|
35
35
|
*
|
|
36
36
|
* The envelope is always the first record in the append batch (SC-015).
|
|
37
37
|
* Cross-skill coexistence is enabled via the `producer` field on the
|
|
@@ -51,6 +51,7 @@ export declare function sanitizeString(value: string): string;
|
|
|
51
51
|
* @param batchId The batch identifier (used to derive batchDigest when not provided).
|
|
52
52
|
* @param envelope The invocation envelope record (validated before write).
|
|
53
53
|
* @param candidates Candidate records to append after the envelope (validated before write).
|
|
54
|
+
* @param cleanAttestation Optional CLEAN attestation written after the envelope.
|
|
54
55
|
* @throws If schema validation fails, lock acquisition fails, or the filesystem write fails.
|
|
55
56
|
*/
|
|
56
|
-
export declare function appendToSidecar(options: SidecarStoreOptions, batchId: string, envelope: unknown, candidates: unknown[]): void;
|
|
57
|
+
export declare function appendToSidecar(options: SidecarStoreOptions, batchId: string, envelope: unknown, candidates: unknown[], cleanAttestation?: unknown): void;
|
|
@@ -12,8 +12,8 @@ import {
|
|
|
12
12
|
shouldRunOnStartup,
|
|
13
13
|
writeBackupArtifact,
|
|
14
14
|
writeDoctorArtifact
|
|
15
|
-
} from "./index-
|
|
16
|
-
import"./index-
|
|
15
|
+
} from "./index-9bsmzfk3.js";
|
|
16
|
+
import"./index-a45jq4b7.js";
|
|
17
17
|
import"./index-bfwt3abw.js";
|
|
18
18
|
import"./index-5e4e2hvv.js";
|
|
19
19
|
import"./index-p0arc26j.js";
|
|
@@ -14,11 +14,11 @@ import {
|
|
|
14
14
|
runCuratorInit,
|
|
15
15
|
runCuratorPhase,
|
|
16
16
|
writeCuratorSummary
|
|
17
|
-
} from "./index-
|
|
18
|
-
import"./index-
|
|
17
|
+
} from "./index-fc35yaah.js";
|
|
18
|
+
import"./index-yfedche9.js";
|
|
19
19
|
import"./index-c8s9a3zh.js";
|
|
20
|
-
import"./index-
|
|
21
|
-
import"./index-
|
|
20
|
+
import"./index-9bsmzfk3.js";
|
|
21
|
+
import"./index-a45jq4b7.js";
|
|
22
22
|
import"./index-f6y341yk.js";
|
|
23
23
|
import"./index-scww5b77.js";
|
|
24
24
|
import"./index-ga4ta3cr.js";
|
|
@@ -30,7 +30,7 @@ import"./index-qzqx2qky.js";
|
|
|
30
30
|
import"./index-0q7rrh59.js";
|
|
31
31
|
import"./index-bfwt3abw.js";
|
|
32
32
|
import"./index-g40r5d08.js";
|
|
33
|
-
import"./index-
|
|
33
|
+
import"./index-vxv732ex.js";
|
|
34
34
|
import"./index-8fwhhayc.js";
|
|
35
35
|
import"./index-q1exe2b3.js";
|
|
36
36
|
import"./index-n6fa2hhk.js";
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
// @bun
|
|
2
2
|
import {
|
|
3
3
|
createCuratorLLMDelegate
|
|
4
|
-
} from "./index-
|
|
5
|
-
import"./index-
|
|
4
|
+
} from "./index-fc35yaah.js";
|
|
5
|
+
import"./index-yfedche9.js";
|
|
6
6
|
import"./index-c8s9a3zh.js";
|
|
7
|
-
import"./index-
|
|
8
|
-
import"./index-
|
|
7
|
+
import"./index-9bsmzfk3.js";
|
|
8
|
+
import"./index-a45jq4b7.js";
|
|
9
9
|
import"./index-f6y341yk.js";
|
|
10
10
|
import"./index-scww5b77.js";
|
|
11
11
|
import"./index-ga4ta3cr.js";
|
|
@@ -17,7 +17,7 @@ import"./index-qzqx2qky.js";
|
|
|
17
17
|
import"./index-0q7rrh59.js";
|
|
18
18
|
import"./index-bfwt3abw.js";
|
|
19
19
|
import"./index-g40r5d08.js";
|
|
20
|
-
import"./index-
|
|
20
|
+
import"./index-vxv732ex.js";
|
|
21
21
|
import"./index-8fwhhayc.js";
|
|
22
22
|
import"./index-q1exe2b3.js";
|
|
23
23
|
import"./index-n6fa2hhk.js";
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
// @bun
|
|
2
2
|
import {
|
|
3
3
|
handleGuardrailExplain
|
|
4
|
-
} from "./index-
|
|
5
|
-
import"./index-
|
|
6
|
-
import"./index-
|
|
4
|
+
} from "./index-s8se9nt5.js";
|
|
5
|
+
import"./index-fc35yaah.js";
|
|
6
|
+
import"./index-yfedche9.js";
|
|
7
7
|
import"./index-c8s9a3zh.js";
|
|
8
|
-
import"./index-
|
|
9
|
-
import"./index-
|
|
8
|
+
import"./index-9bsmzfk3.js";
|
|
9
|
+
import"./index-a45jq4b7.js";
|
|
10
10
|
import"./index-f6y341yk.js";
|
|
11
11
|
import"./index-scww5b77.js";
|
|
12
12
|
import"./index-ga4ta3cr.js";
|
|
@@ -18,7 +18,7 @@ import"./index-qzqx2qky.js";
|
|
|
18
18
|
import"./index-0q7rrh59.js";
|
|
19
19
|
import"./index-bfwt3abw.js";
|
|
20
20
|
import"./index-g40r5d08.js";
|
|
21
|
-
import"./index-
|
|
21
|
+
import"./index-vxv732ex.js";
|
|
22
22
|
import"./index-8fwhhayc.js";
|
|
23
23
|
import"./index-q1exe2b3.js";
|
|
24
24
|
import"./index-n6fa2hhk.js";
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
// @bun
|
|
2
2
|
import {
|
|
3
3
|
handleGuardrailLog
|
|
4
|
-
} from "./index-
|
|
5
|
-
import"./index-
|
|
6
|
-
import"./index-
|
|
4
|
+
} from "./index-7jmrbp68.js";
|
|
5
|
+
import"./index-yfedche9.js";
|
|
6
|
+
import"./index-a45jq4b7.js";
|
|
7
7
|
import"./index-bfwt3abw.js";
|
|
8
8
|
import"./index-5e4e2hvv.js";
|
|
9
9
|
import"./index-p0arc26j.js";
|
|
@@ -6,11 +6,11 @@ import {
|
|
|
6
6
|
isHiveEligible,
|
|
7
7
|
promoteFromSwarm,
|
|
8
8
|
promoteToHive
|
|
9
|
-
} from "./index-
|
|
10
|
-
import"./index-
|
|
9
|
+
} from "./index-fc35yaah.js";
|
|
10
|
+
import"./index-yfedche9.js";
|
|
11
11
|
import"./index-c8s9a3zh.js";
|
|
12
|
-
import"./index-
|
|
13
|
-
import"./index-
|
|
12
|
+
import"./index-9bsmzfk3.js";
|
|
13
|
+
import"./index-a45jq4b7.js";
|
|
14
14
|
import"./index-f6y341yk.js";
|
|
15
15
|
import"./index-scww5b77.js";
|
|
16
16
|
import"./index-ga4ta3cr.js";
|
|
@@ -22,7 +22,7 @@ import"./index-qzqx2qky.js";
|
|
|
22
22
|
import"./index-0q7rrh59.js";
|
|
23
23
|
import"./index-bfwt3abw.js";
|
|
24
24
|
import"./index-g40r5d08.js";
|
|
25
|
-
import"./index-
|
|
25
|
+
import"./index-vxv732ex.js";
|
|
26
26
|
import"./index-8fwhhayc.js";
|
|
27
27
|
import"./index-q1exe2b3.js";
|
|
28
28
|
import"./index-n6fa2hhk.js";
|
|
@@ -191,6 +191,10 @@ var TOOL_METADATA = {
|
|
|
191
191
|
description: "Parse [CANDIDATE] rows from a dispatch_lanes or collect_lane_results artifact (by output_ref), produce structured records with provenance, optionally persist to a per-batch sidecar JSONL. Pure-parser variant exists as internal module.",
|
|
192
192
|
agents: ["architect"]
|
|
193
193
|
},
|
|
194
|
+
write_pr_review_trigger_eval: {
|
|
195
|
+
description: "persist the complete PR-review trigger evaluation with exact-set validation and dispatch provenance",
|
|
196
|
+
agents: ["architect"]
|
|
197
|
+
},
|
|
194
198
|
test_runner: {
|
|
195
199
|
description: "auto-detect and run tests",
|
|
196
200
|
agents: ["architect", "reviewer", "test_engineer"]
|
|
@@ -7,7 +7,7 @@ import {
|
|
|
7
7
|
readDoctorArtifact,
|
|
8
8
|
removeStraySwarmDir,
|
|
9
9
|
runConfigDoctor
|
|
10
|
-
} from "./index-
|
|
10
|
+
} from "./index-9bsmzfk3.js";
|
|
11
11
|
import {
|
|
12
12
|
AGENT_TOOL_MAP,
|
|
13
13
|
ALL_SUBAGENT_NAMES,
|
|
@@ -23,7 +23,7 @@ import {
|
|
|
23
23
|
getCanonicalAgentRole,
|
|
24
24
|
resolveExternalSkillsConfig,
|
|
25
25
|
stripKnownSwarmPrefix
|
|
26
|
-
} from "./index-
|
|
26
|
+
} from "./index-a45jq4b7.js";
|
|
27
27
|
import {
|
|
28
28
|
MAX_TRANSIENT_RETRIES,
|
|
29
29
|
PlanSchema,
|
|
@@ -175,7 +175,7 @@ import {
|
|
|
175
175
|
CURATOR_INIT_PROMPT,
|
|
176
176
|
CURATOR_PHASE_PROMPT,
|
|
177
177
|
READ_ONLY_LANE_GUIDANCE
|
|
178
|
-
} from "./index-
|
|
178
|
+
} from "./index-vxv732ex.js";
|
|
179
179
|
import {
|
|
180
180
|
SandboxCapabilityProbe,
|
|
181
181
|
init_capability_probe
|
|
@@ -10298,7 +10298,7 @@ async function runCuratorPostMortem(directory, options = {}) {
|
|
|
10298
10298
|
let actionResult;
|
|
10299
10299
|
if (options.llmDelegate) {
|
|
10300
10300
|
try {
|
|
10301
|
-
const { CURATOR_POSTMORTEM_PROMPT } = await import("./explorer-
|
|
10301
|
+
const { CURATOR_POSTMORTEM_PROMPT } = await import("./explorer-jp0nen03.js");
|
|
10302
10302
|
const userInput = assembleLLMInput(effectivePlanId, scope, options.sessionID, planSummary, knowledgeSummary, curatorDigest, proposals, unactionable, retrospectives, driftReports);
|
|
10303
10303
|
const ac = new AbortController;
|
|
10304
10304
|
const timer = setTimeout(() => ac.abort(), options.llmTimeoutMs ?? 300000);
|
|
@@ -10428,15 +10428,15 @@ var _internals12 = {
|
|
|
10428
10428
|
verifyPostMortemKnowledgeActions,
|
|
10429
10429
|
repairPostMortemActions,
|
|
10430
10430
|
loadDefaultKnowledgeConfig: async () => {
|
|
10431
|
-
const { KnowledgeConfigSchema: KnowledgeConfigSchema2 } = await import("./schema-
|
|
10431
|
+
const { KnowledgeConfigSchema: KnowledgeConfigSchema2 } = await import("./schema-aymfdrsb.js");
|
|
10432
10432
|
return KnowledgeConfigSchema2.parse({});
|
|
10433
10433
|
},
|
|
10434
10434
|
applyCuratorKnowledgeUpdates: async (directory, recommendations, knowledgeConfig) => {
|
|
10435
|
-
const { applyCuratorKnowledgeUpdates: applyCuratorKnowledgeUpdates2 } = await import("./curator-
|
|
10435
|
+
const { applyCuratorKnowledgeUpdates: applyCuratorKnowledgeUpdates2 } = await import("./curator-2cnthj9n.js");
|
|
10436
10436
|
return applyCuratorKnowledgeUpdates2(directory, recommendations, knowledgeConfig);
|
|
10437
10437
|
},
|
|
10438
10438
|
checkHivePromotions: async (entries, knowledgeConfig) => {
|
|
10439
|
-
const { checkHivePromotions } = await import("./hive-promoter-
|
|
10439
|
+
const { checkHivePromotions } = await import("./hive-promoter-n9qt3sth.js");
|
|
10440
10440
|
return checkHivePromotions(entries, knowledgeConfig);
|
|
10441
10441
|
},
|
|
10442
10442
|
applyProposalTriage: async (directory, triage) => {
|
|
@@ -15482,7 +15482,7 @@ async function runFinalizeStage(ctx) {
|
|
|
15482
15482
|
}
|
|
15483
15483
|
}
|
|
15484
15484
|
try {
|
|
15485
|
-
const { CuratorConfigSchema: CCS } = await import("./schema-
|
|
15485
|
+
const { CuratorConfigSchema: CCS } = await import("./schema-aymfdrsb.js");
|
|
15486
15486
|
const { config: pmLoadedConfig } = _internals20.loadPluginConfigWithMeta(ctx.directory);
|
|
15487
15487
|
const curatorCfg = CCS.parse(pmLoadedConfig.curator ?? {});
|
|
15488
15488
|
if (curatorCfg.enabled && curatorCfg.postmortem_enabled) {
|
|
@@ -17596,9 +17596,9 @@ var _internals24 = {
|
|
|
17596
17596
|
readSwarmFileAsync,
|
|
17597
17597
|
loadCuratorDeps: async () => {
|
|
17598
17598
|
const [{ CuratorConfigSchema }, curator, { createCuratorLLMDelegate: createCuratorLLMDelegate2 }] = await Promise.all([
|
|
17599
|
-
import("./schema-
|
|
17600
|
-
import("./curator-
|
|
17601
|
-
import("./curator-llm-factory-
|
|
17599
|
+
import("./schema-aymfdrsb.js"),
|
|
17600
|
+
import("./curator-2cnthj9n.js"),
|
|
17601
|
+
import("./curator-llm-factory-asqhpq08.js")
|
|
17602
17602
|
]);
|
|
17603
17603
|
return { CuratorConfigSchema, curator, createCuratorLLMDelegate: createCuratorLLMDelegate2 };
|
|
17604
17604
|
}
|
|
@@ -18094,7 +18094,7 @@ import { fileURLToPath } from "url";
|
|
|
18094
18094
|
// package.json
|
|
18095
18095
|
var package_default = {
|
|
18096
18096
|
name: "opencode-swarm",
|
|
18097
|
-
version: "7.114.
|
|
18097
|
+
version: "7.114.5",
|
|
18098
18098
|
description: "Architect-centric agentic swarm plugin for OpenCode - hub-and-spoke orchestration with SME consultation, code generation, and QA review",
|
|
18099
18099
|
main: "dist/index.js",
|
|
18100
18100
|
types: "dist/index.d.ts",
|
|
@@ -19563,7 +19563,7 @@ async function handleDoctorCommand(directory, args) {
|
|
|
19563
19563
|
const result = runConfigDoctor(config, directory);
|
|
19564
19564
|
let output;
|
|
19565
19565
|
if (enableAutoFix && result.hasAutoFixableIssues) {
|
|
19566
|
-
const { runConfigDoctorWithFixes } = await import("./config-doctor-
|
|
19566
|
+
const { runConfigDoctorWithFixes } = await import("./config-doctor-jy3mdh9t.js");
|
|
19567
19567
|
const fixResult = await runConfigDoctorWithFixes(directory, config, true);
|
|
19568
19568
|
output = formatDoctorMarkdown(fixResult.result);
|
|
19569
19569
|
} else {
|
|
@@ -32984,7 +32984,7 @@ function buildDetailedHelp(commandName, entry) {
|
|
|
32984
32984
|
async function handleHelpCommand(ctx) {
|
|
32985
32985
|
const targetCommand = ctx.args.join(" ");
|
|
32986
32986
|
if (!targetCommand) {
|
|
32987
|
-
const { buildHelpText } = await import("./index-
|
|
32987
|
+
const { buildHelpText } = await import("./index-s0h4kf1t.js");
|
|
32988
32988
|
return buildHelpText();
|
|
32989
32989
|
}
|
|
32990
32990
|
const tokens = targetCommand.split(/\s+/);
|
|
@@ -32993,7 +32993,7 @@ async function handleHelpCommand(ctx) {
|
|
|
32993
32993
|
return _internals49.buildDetailedHelp(resolved.key, resolved.entry);
|
|
32994
32994
|
}
|
|
32995
32995
|
const similar = _internals49.findSimilarCommands(targetCommand);
|
|
32996
|
-
const { buildHelpText: fullHelp } = await import("./index-
|
|
32996
|
+
const { buildHelpText: fullHelp } = await import("./index-s0h4kf1t.js");
|
|
32997
32997
|
if (similar.length > 0) {
|
|
32998
32998
|
return `Command '/swarm ${targetCommand}' not found.
|
|
32999
32999
|
|
|
@@ -33126,7 +33126,7 @@ var COMMAND_REGISTRY = {
|
|
|
33126
33126
|
},
|
|
33127
33127
|
"guardrail explain": {
|
|
33128
33128
|
handler: async (ctx) => {
|
|
33129
|
-
const { handleGuardrailExplain } = await import("./guardrail-explain-
|
|
33129
|
+
const { handleGuardrailExplain } = await import("./guardrail-explain-xt6skemq.js");
|
|
33130
33130
|
return handleGuardrailExplain(ctx.directory, ctx.args);
|
|
33131
33131
|
},
|
|
33132
33132
|
description: "Dry-run: show what the guardrails would do to a command or write target (executes nothing)",
|
|
@@ -33136,7 +33136,7 @@ var COMMAND_REGISTRY = {
|
|
|
33136
33136
|
},
|
|
33137
33137
|
"guardrail-explain": {
|
|
33138
33138
|
handler: async (ctx) => {
|
|
33139
|
-
const { handleGuardrailExplain } = await import("./guardrail-explain-
|
|
33139
|
+
const { handleGuardrailExplain } = await import("./guardrail-explain-xt6skemq.js");
|
|
33140
33140
|
return handleGuardrailExplain(ctx.directory, ctx.args);
|
|
33141
33141
|
},
|
|
33142
33142
|
description: "Dry-run: show what the guardrails would do to a command or write target (executes nothing)",
|
|
@@ -33146,7 +33146,7 @@ var COMMAND_REGISTRY = {
|
|
|
33146
33146
|
},
|
|
33147
33147
|
"guardrail-log": {
|
|
33148
33148
|
handler: async (ctx) => {
|
|
33149
|
-
const { handleGuardrailLog } = await import("./guardrail-log-
|
|
33149
|
+
const { handleGuardrailLog } = await import("./guardrail-log-84wnx273.js");
|
|
33150
33150
|
return handleGuardrailLog(ctx.directory, ctx.args);
|
|
33151
33151
|
},
|
|
33152
33152
|
description: "Read the guardrail decision log (use --blocks-only for blocks)",
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
// @bun
|
|
2
2
|
import {
|
|
3
3
|
handleGuardrailExplain
|
|
4
|
-
} from "./index-
|
|
4
|
+
} from "./index-s8se9nt5.js";
|
|
5
5
|
import {
|
|
6
6
|
handleGuardrailLog
|
|
7
|
-
} from "./index-
|
|
7
|
+
} from "./index-7jmrbp68.js";
|
|
8
8
|
import {
|
|
9
9
|
COMMAND_REGISTRY,
|
|
10
10
|
SWARM_COMMAND_TOOL_ALLOWLIST,
|
|
@@ -81,15 +81,15 @@ import {
|
|
|
81
81
|
handleWriteRetroCommand,
|
|
82
82
|
normalizeSwarmCommandInput,
|
|
83
83
|
resolveCommand
|
|
84
|
-
} from "./index-
|
|
85
|
-
import"./index-
|
|
84
|
+
} from "./index-fc35yaah.js";
|
|
85
|
+
import"./index-yfedche9.js";
|
|
86
86
|
import"./index-c8s9a3zh.js";
|
|
87
|
-
import"./index-
|
|
87
|
+
import"./index-9bsmzfk3.js";
|
|
88
88
|
import {
|
|
89
89
|
AGENT_TOOL_MAP,
|
|
90
90
|
ORCHESTRATOR_NAME,
|
|
91
91
|
stripKnownSwarmPrefix
|
|
92
|
-
} from "./index-
|
|
92
|
+
} from "./index-a45jq4b7.js";
|
|
93
93
|
import"./index-f6y341yk.js";
|
|
94
94
|
import"./index-scww5b77.js";
|
|
95
95
|
import"./index-ga4ta3cr.js";
|
|
@@ -101,7 +101,7 @@ import"./index-qzqx2qky.js";
|
|
|
101
101
|
import"./index-0q7rrh59.js";
|
|
102
102
|
import"./index-bfwt3abw.js";
|
|
103
103
|
import"./index-g40r5d08.js";
|
|
104
|
-
import"./index-
|
|
104
|
+
import"./index-vxv732ex.js";
|
|
105
105
|
import"./index-8fwhhayc.js";
|
|
106
106
|
import"./index-q1exe2b3.js";
|
|
107
107
|
import"./index-n6fa2hhk.js";
|
|
@@ -12,14 +12,14 @@ import {
|
|
|
12
12
|
detectPosixWrites,
|
|
13
13
|
detectWindowsWrites,
|
|
14
14
|
resolveWriteTargets
|
|
15
|
-
} from "./index-
|
|
15
|
+
} from "./index-fc35yaah.js";
|
|
16
16
|
import {
|
|
17
17
|
checkFileAuthority,
|
|
18
18
|
classifyFile,
|
|
19
19
|
isInDeclaredScope,
|
|
20
20
|
redactPath,
|
|
21
21
|
redactShellCommand
|
|
22
|
-
} from "./index-
|
|
22
|
+
} from "./index-yfedche9.js";
|
|
23
23
|
|
|
24
24
|
// src/services/guardrail-explain-service.ts
|
|
25
25
|
import path from "path";
|
|
@@ -126,7 +126,8 @@ src/tools/declare-scope.ts \u2014 function has 12 parameters, consider splitting
|
|
|
126
126
|
Activates when your prompt contains "[CANDIDATE]" anywhere in its text.
|
|
127
127
|
|
|
128
128
|
When active, replace the default OUTPUT FORMAT above with structured pipe-delimited
|
|
129
|
-
candidate rows. Emit exactly one
|
|
129
|
+
candidate rows. Emit the marker-bearing header, then exactly one unprefixed data
|
|
130
|
+
row per finding:
|
|
130
131
|
|
|
131
132
|
[CANDIDATE] | candidate_id | lane | severity | category | file:line | claim | evidence_summary | impact_context | confidence
|
|
132
133
|
|
|
@@ -141,11 +142,14 @@ Field rules:
|
|
|
141
142
|
- impact_context: who or what is affected downstream
|
|
142
143
|
- confidence: LOW | MEDIUM | HIGH
|
|
143
144
|
|
|
144
|
-
Emit a header row first, then one
|
|
145
|
+
Emit a header row first, then one unprefixed data row per finding. Use pipe (|) to
|
|
145
146
|
separate fields; escape literal pipe characters inside field values as \\|.
|
|
146
147
|
|
|
147
|
-
If
|
|
148
|
-
|
|
148
|
+
If a standard explorer finds zero issues, emit the header row with no data rows.
|
|
149
|
+
If a micro-lane finds zero issues, emit the header followed by exactly:
|
|
150
|
+
[CLEAN] | micro_lane | coverage_scope | evidence
|
|
151
|
+
Fill every CLEAN field with the assigned micro-lane, checks completed, and the
|
|
152
|
+
negative evidence. Do NOT fall back to the default PROJECT/STRUCTURE format.
|
|
149
153
|
|
|
150
154
|
For micro-lane dispatches, use the micro-lane variant:
|
|
151
155
|
[CANDIDATE] | candidate_id | micro_lane | severity | category | file:line | claim | invariant_violated | evidence_summary | confidence
|
package/dist/cli/index.js
CHANGED
|
@@ -7,13 +7,13 @@ import {
|
|
|
7
7
|
getPluginLockFilePaths,
|
|
8
8
|
package_default,
|
|
9
9
|
resolveCommand
|
|
10
|
-
} from "./index-
|
|
11
|
-
import"./index-
|
|
10
|
+
} from "./index-fc35yaah.js";
|
|
11
|
+
import"./index-yfedche9.js";
|
|
12
12
|
import"./index-c8s9a3zh.js";
|
|
13
|
-
import"./index-
|
|
13
|
+
import"./index-9bsmzfk3.js";
|
|
14
14
|
import {
|
|
15
15
|
DEFAULT_AGENT_CONFIGS
|
|
16
|
-
} from "./index-
|
|
16
|
+
} from "./index-a45jq4b7.js";
|
|
17
17
|
import"./index-f6y341yk.js";
|
|
18
18
|
import"./index-scww5b77.js";
|
|
19
19
|
import"./index-ga4ta3cr.js";
|
|
@@ -25,7 +25,7 @@ import"./index-qzqx2qky.js";
|
|
|
25
25
|
import"./index-0q7rrh59.js";
|
|
26
26
|
import"./index-bfwt3abw.js";
|
|
27
27
|
import"./index-g40r5d08.js";
|
|
28
|
-
import"./index-
|
|
28
|
+
import"./index-vxv732ex.js";
|
|
29
29
|
import"./index-8fwhhayc.js";
|
|
30
30
|
import"./index-q1exe2b3.js";
|
|
31
31
|
import"./index-n6fa2hhk.js";
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Skill auto-injection for subagent delegations.
|
|
3
|
+
*
|
|
4
|
+
* Extracted from the `tool.execute.before` hook in `src/index.ts` (issue #1770)
|
|
5
|
+
* so the injection + usage-recording path is exercised by tests against the
|
|
6
|
+
* REAL implementation rather than a parallel re-implementation.
|
|
7
|
+
*
|
|
8
|
+
* Two correctness fixes over the pre-extraction inline block:
|
|
9
|
+
*
|
|
10
|
+
* 1. Attribution — usage entries are now recorded with the **target subagent**
|
|
11
|
+
* as `agentName` and a real taskID (via `extractTaskIdFromPrompt`,
|
|
12
|
+
* falling back to the literal `'auto-injected'` when the prompt carries no
|
|
13
|
+
* task marker). Previously the inline block recorded the **architect**
|
|
14
|
+
* with the synthetic `taskID: 'injection'`, which (a) was inconsistent with
|
|
15
|
+
* the three other recording sites in `skill-propagation-gate.ts`, (b) broke
|
|
16
|
+
* the SKILL_COMPLIANCE round-trip join except by coincidence, and (c)
|
|
17
|
+
* inflated frequency / taskID-diversity scoring. The fallback is
|
|
18
|
+
* `'auto-injected'` rather than `'unknown'` so the compliance resolver's
|
|
19
|
+
* `resolvedTaskID !== 'unknown'` guard at `skill-propagation-gate.ts:1302`
|
|
20
|
+
* continues to fire and populate fallback skill paths.
|
|
21
|
+
*
|
|
22
|
+
* 2. Observability — a `skill_injection_decision` event is emitted to
|
|
23
|
+
* `.swarm/events.jsonl` for BOTH the qualified-injection and the
|
|
24
|
+
* `SKILLS: none` branches. Previously only the qualified branch produced a
|
|
25
|
+
* `console.warn`, and the `SKILLS: none` branch produced no durable signal,
|
|
26
|
+
* so a project whose skills all scored below the 0.5 threshold appeared
|
|
27
|
+
* indistinguishable from "the gate never ran." Usage entries are NOT written
|
|
28
|
+
* for the `SKILLS: none` branch: recording a phantom skillPath would corrupt
|
|
29
|
+
* per-skill scoring, and the absence of `skill-usage.jsonl` when no skill is
|
|
30
|
+
* injected is the correct semantic (there is no usage to record).
|
|
31
|
+
*/
|
|
32
|
+
import { extractSkillsFieldFromPrompt } from './skill-propagation-gate.js';
|
|
33
|
+
/** A recommended skill as returned by `skillPropagationGateBefore`. */
|
|
34
|
+
export interface RecommendedSkill {
|
|
35
|
+
skillPath: string;
|
|
36
|
+
score: number;
|
|
37
|
+
usageCount: number;
|
|
38
|
+
}
|
|
39
|
+
/** Options controlling console verbosity (mirrors the plugin `quiet` flag). */
|
|
40
|
+
export interface SkillInjectionOptions {
|
|
41
|
+
/** When true, suppresses console.warn output (does not affect event emission). */
|
|
42
|
+
quiet?: boolean;
|
|
43
|
+
}
|
|
44
|
+
/** Result of an injection attempt. */
|
|
45
|
+
export interface SkillInjectionResult {
|
|
46
|
+
/** `true` if a `SKILLS:` (or `SKILLS_USED_BY_CODER:`) line was added to the prompt. */
|
|
47
|
+
injected: boolean;
|
|
48
|
+
/** The skills that were actually injected (empty for the `SKILLS: none` and skip paths). */
|
|
49
|
+
injectedSkills: Array<{
|
|
50
|
+
skillPath: string;
|
|
51
|
+
score: number;
|
|
52
|
+
}>;
|
|
53
|
+
}
|
|
54
|
+
/** Relevance-score threshold a recommended skill must meet to be injected. */
|
|
55
|
+
export declare const SKILL_INJECTION_THRESHOLD = 0.5;
|
|
56
|
+
/** Maximum number of skills injected into a single delegation prompt. */
|
|
57
|
+
export declare const SKILL_INJECTION_TOP_N = 5;
|
|
58
|
+
/**
|
|
59
|
+
* Auto-inject a `SKILLS:` field into a delegation prompt when one is missing.
|
|
60
|
+
*
|
|
61
|
+
* Mutates `args.prompt` in place (preserving the pre-extraction hook contract)
|
|
62
|
+
* and records one usage entry per injected skill to `.swarm/skill-usage.jsonl`.
|
|
63
|
+
* Best-effort: recording/event failures are swallowed and never throw.
|
|
64
|
+
*
|
|
65
|
+
* @param directory - Project root (`.swarm/` is created here).
|
|
66
|
+
* @param args - The Task tool args; `args.prompt` is mutated.
|
|
67
|
+
* @param recommendedSkills - From `skillPropagationGateBefore`. `undefined` / empty skips injection.
|
|
68
|
+
* @param targetAgent - The subagent being delegated to (parsed via `parseDelegationArgs`).
|
|
69
|
+
* Used as the usage-entry `agentName` so the entry joins correctly
|
|
70
|
+
* with later reviewer compliance verdicts.
|
|
71
|
+
* @param sessionID - The orchestrating session id.
|
|
72
|
+
* @param options - `{ quiet }` verbosity flag.
|
|
73
|
+
* @returns `{ injected, injectedSkills }`.
|
|
74
|
+
*/
|
|
75
|
+
export declare function injectSkillsIntoDelegation(directory: string, args: Record<string, unknown>, recommendedSkills: ReadonlyArray<RecommendedSkill> | undefined, targetAgent: string, sessionID: string, options?: SkillInjectionOptions): SkillInjectionResult;
|
|
76
|
+
/**
|
|
77
|
+
* Extract the SKILLS field from a prompt. Re-exported for tests that need to
|
|
78
|
+
* inspect the post-injection prompt without re-parsing manually.
|
|
79
|
+
*/
|
|
80
|
+
export { extractSkillsFieldFromPrompt };
|