opencode-swarm 7.114.2 → 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-2g6v327b.js → curator-15zwszy5.js} +1 -1
- package/dist/cli/{curator-llm-factory-31e6dsqe.js → curator-llm-factory-5ewe7qy1.js} +1 -1
- package/dist/cli/{guardrail-explain-ygvp1aj9.js → guardrail-explain-3156qxy0.js} +2 -2
- package/dist/cli/{hive-promoter-bxngckjh.js → hive-promoter-g2tkarz8.js} +1 -1
- package/dist/cli/{index-fdwtf08h.js → index-1gcw6azm.js} +2 -2
- package/dist/cli/{index-tnm0e2vb.js → index-g59h53s6.js} +1 -1
- package/dist/cli/{index-64168f15.js → index-hg82gptk.js} +28 -12
- package/dist/cli/index.js +1 -1
- package/dist/hooks/skill-injection.d.ts +80 -0
- package/dist/index.js +71 -71
- 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) => {
|
|
@@ -15177,7 +15177,9 @@ var ARCHIVE_ARTIFACTS = [
|
|
|
15177
15177
|
"swarm.db-wal",
|
|
15178
15178
|
"close-summary.md",
|
|
15179
15179
|
"session-reflection.md",
|
|
15180
|
-
"spec.md"
|
|
15180
|
+
"spec.md",
|
|
15181
|
+
"spec-staleness.json",
|
|
15182
|
+
"spec-snapshot.md"
|
|
15181
15183
|
];
|
|
15182
15184
|
var ACTIVE_STATE_TO_CLEAN = [
|
|
15183
15185
|
"plan.json",
|
|
@@ -15194,11 +15196,19 @@ var ACTIVE_STATE_TO_CLEAN = [
|
|
|
15194
15196
|
"dark-matter.md",
|
|
15195
15197
|
"telemetry.jsonl",
|
|
15196
15198
|
"session-reflection.md",
|
|
15199
|
+
"spec.md",
|
|
15200
|
+
"spec-staleness.json",
|
|
15201
|
+
"spec-snapshot.md",
|
|
15197
15202
|
"swarm.db",
|
|
15198
15203
|
"swarm.db-shm",
|
|
15199
15204
|
"swarm.db-wal"
|
|
15200
15205
|
];
|
|
15201
|
-
var TERMINAL_STATE_FILES = [
|
|
15206
|
+
var TERMINAL_STATE_FILES = [
|
|
15207
|
+
"plan.json",
|
|
15208
|
+
"plan-ledger.jsonl",
|
|
15209
|
+
"spec-staleness.json",
|
|
15210
|
+
"spec-snapshot.md"
|
|
15211
|
+
];
|
|
15202
15212
|
var KNOWLEDGE_FAMILY_ARTIFACTS = new Set([
|
|
15203
15213
|
"knowledge.jsonl",
|
|
15204
15214
|
"knowledge-rejected.jsonl"
|
|
@@ -15713,7 +15723,9 @@ async function runCleanStage(ctx) {
|
|
|
15713
15723
|
ctx.warnings.push(reason ? `${artifact} was not archived (${reason}); removing it anyway to prevent CLOSED-plan resurrection next session \u2014 no archive copy retained.` : `${artifact} was not archived; removing it anyway to prevent CLOSED-plan resurrection next session \u2014 no archive copy retained.`);
|
|
15714
15724
|
continue;
|
|
15715
15725
|
}
|
|
15716
|
-
|
|
15726
|
+
if (reason) {
|
|
15727
|
+
ctx.warnings.push(`Preserved ${artifact} because it was not successfully archived: ${reason}.`);
|
|
15728
|
+
}
|
|
15717
15729
|
continue;
|
|
15718
15730
|
}
|
|
15719
15731
|
const filePath = path29.join(ctx.swarmDir, artifact);
|
|
@@ -17585,8 +17597,8 @@ var _internals24 = {
|
|
|
17585
17597
|
loadCuratorDeps: async () => {
|
|
17586
17598
|
const [{ CuratorConfigSchema }, curator, { createCuratorLLMDelegate: createCuratorLLMDelegate2 }] = await Promise.all([
|
|
17587
17599
|
import("./schema-e5kd993s.js"),
|
|
17588
|
-
import("./curator-
|
|
17589
|
-
import("./curator-llm-factory-
|
|
17600
|
+
import("./curator-15zwszy5.js"),
|
|
17601
|
+
import("./curator-llm-factory-5ewe7qy1.js")
|
|
17590
17602
|
]);
|
|
17591
17603
|
return { CuratorConfigSchema, curator, createCuratorLLMDelegate: createCuratorLLMDelegate2 };
|
|
17592
17604
|
}
|
|
@@ -18082,7 +18094,7 @@ import { fileURLToPath } from "url";
|
|
|
18082
18094
|
// package.json
|
|
18083
18095
|
var package_default = {
|
|
18084
18096
|
name: "opencode-swarm",
|
|
18085
|
-
version: "7.114.
|
|
18097
|
+
version: "7.114.4",
|
|
18086
18098
|
description: "Architect-centric agentic swarm plugin for OpenCode - hub-and-spoke orchestration with SME consultation, code generation, and QA review",
|
|
18087
18099
|
main: "dist/index.js",
|
|
18088
18100
|
types: "dist/index.d.ts",
|
|
@@ -30322,7 +30334,11 @@ async function handleResetCommand(directory, args) {
|
|
|
30322
30334
|
const filesToReset = [
|
|
30323
30335
|
"plan.md",
|
|
30324
30336
|
"plan.json",
|
|
30337
|
+
"plan-ledger.jsonl",
|
|
30325
30338
|
"context.md",
|
|
30339
|
+
"spec.md",
|
|
30340
|
+
"spec-staleness.json",
|
|
30341
|
+
"spec-snapshot.md",
|
|
30326
30342
|
"SWARM_PLAN.md",
|
|
30327
30343
|
"SWARM_PLAN.json",
|
|
30328
30344
|
"plan-export/SWARM_PLAN.md",
|
|
@@ -32968,7 +32984,7 @@ function buildDetailedHelp(commandName, entry) {
|
|
|
32968
32984
|
async function handleHelpCommand(ctx) {
|
|
32969
32985
|
const targetCommand = ctx.args.join(" ");
|
|
32970
32986
|
if (!targetCommand) {
|
|
32971
|
-
const { buildHelpText } = await import("./index-
|
|
32987
|
+
const { buildHelpText } = await import("./index-1gcw6azm.js");
|
|
32972
32988
|
return buildHelpText();
|
|
32973
32989
|
}
|
|
32974
32990
|
const tokens = targetCommand.split(/\s+/);
|
|
@@ -32977,7 +32993,7 @@ async function handleHelpCommand(ctx) {
|
|
|
32977
32993
|
return _internals49.buildDetailedHelp(resolved.key, resolved.entry);
|
|
32978
32994
|
}
|
|
32979
32995
|
const similar = _internals49.findSimilarCommands(targetCommand);
|
|
32980
|
-
const { buildHelpText: fullHelp } = await import("./index-
|
|
32996
|
+
const { buildHelpText: fullHelp } = await import("./index-1gcw6azm.js");
|
|
32981
32997
|
if (similar.length > 0) {
|
|
32982
32998
|
return `Command '/swarm ${targetCommand}' not found.
|
|
32983
32999
|
|
|
@@ -33110,7 +33126,7 @@ var COMMAND_REGISTRY = {
|
|
|
33110
33126
|
},
|
|
33111
33127
|
"guardrail explain": {
|
|
33112
33128
|
handler: async (ctx) => {
|
|
33113
|
-
const { handleGuardrailExplain } = await import("./guardrail-explain-
|
|
33129
|
+
const { handleGuardrailExplain } = await import("./guardrail-explain-3156qxy0.js");
|
|
33114
33130
|
return handleGuardrailExplain(ctx.directory, ctx.args);
|
|
33115
33131
|
},
|
|
33116
33132
|
description: "Dry-run: show what the guardrails would do to a command or write target (executes nothing)",
|
|
@@ -33120,7 +33136,7 @@ var COMMAND_REGISTRY = {
|
|
|
33120
33136
|
},
|
|
33121
33137
|
"guardrail-explain": {
|
|
33122
33138
|
handler: async (ctx) => {
|
|
33123
|
-
const { handleGuardrailExplain } = await import("./guardrail-explain-
|
|
33139
|
+
const { handleGuardrailExplain } = await import("./guardrail-explain-3156qxy0.js");
|
|
33124
33140
|
return handleGuardrailExplain(ctx.directory, ctx.args);
|
|
33125
33141
|
},
|
|
33126
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 };
|