opencode-swarm 7.114.3 → 7.114.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/dist/cli/{curator-68rn0ss8.js → curator-15zwszy5.js} +1 -1
- package/dist/cli/{curator-llm-factory-fpzm8j0g.js → curator-llm-factory-5ewe7qy1.js} +1 -1
- package/dist/cli/{guardrail-explain-k3bb68q5.js → guardrail-explain-3156qxy0.js} +2 -2
- package/dist/cli/{hive-promoter-h3jcrdh0.js → hive-promoter-g2tkarz8.js} +1 -1
- package/dist/cli/{index-by2gt09c.js → index-1gcw6azm.js} +2 -2
- package/dist/cli/{index-hnv7rrf9.js → index-g59h53s6.js} +1 -1
- package/dist/cli/{index-e8zaze89.js → index-hg82gptk.js} +9 -9
- package/dist/cli/index.js +1 -1
- package/dist/hooks/skill-injection.d.ts +80 -0
- package/dist/index.js +68 -68
- package/package.json +1 -1
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
// @bun
|
|
2
2
|
import {
|
|
3
3
|
handleGuardrailExplain
|
|
4
|
-
} from "./index-
|
|
5
|
-
import"./index-
|
|
4
|
+
} from "./index-g59h53s6.js";
|
|
5
|
+
import"./index-hg82gptk.js";
|
|
6
6
|
import"./index-g6va6n3t.js";
|
|
7
7
|
import"./index-c8s9a3zh.js";
|
|
8
8
|
import"./index-2148358e.js";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// @bun
|
|
2
2
|
import {
|
|
3
3
|
handleGuardrailExplain
|
|
4
|
-
} from "./index-
|
|
4
|
+
} from "./index-g59h53s6.js";
|
|
5
5
|
import {
|
|
6
6
|
handleGuardrailLog
|
|
7
7
|
} from "./index-xbe1wtme.js";
|
|
@@ -81,7 +81,7 @@ import {
|
|
|
81
81
|
handleWriteRetroCommand,
|
|
82
82
|
normalizeSwarmCommandInput,
|
|
83
83
|
resolveCommand
|
|
84
|
-
} from "./index-
|
|
84
|
+
} from "./index-hg82gptk.js";
|
|
85
85
|
import"./index-g6va6n3t.js";
|
|
86
86
|
import"./index-c8s9a3zh.js";
|
|
87
87
|
import"./index-2148358e.js";
|
|
@@ -10432,11 +10432,11 @@ var _internals12 = {
|
|
|
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-15zwszy5.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-g2tkarz8.js");
|
|
10440
10440
|
return checkHivePromotions(entries, knowledgeConfig);
|
|
10441
10441
|
},
|
|
10442
10442
|
applyProposalTriage: async (directory, triage) => {
|
|
@@ -17597,8 +17597,8 @@ var _internals24 = {
|
|
|
17597
17597
|
loadCuratorDeps: async () => {
|
|
17598
17598
|
const [{ CuratorConfigSchema }, curator, { createCuratorLLMDelegate: createCuratorLLMDelegate2 }] = await Promise.all([
|
|
17599
17599
|
import("./schema-e5kd993s.js"),
|
|
17600
|
-
import("./curator-
|
|
17601
|
-
import("./curator-llm-factory-
|
|
17600
|
+
import("./curator-15zwszy5.js"),
|
|
17601
|
+
import("./curator-llm-factory-5ewe7qy1.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.4",
|
|
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",
|
|
@@ -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-1gcw6azm.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-1gcw6azm.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-3156qxy0.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-3156qxy0.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)",
|
package/dist/cli/index.js
CHANGED
|
@@ -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 };
|