opencode-swarm 7.93.1 → 7.94.1

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.
Files changed (33) hide show
  1. package/.opencode/skills/plan/SKILL.md +2 -2
  2. package/dist/agents/council-prompts.d.ts +3 -3
  3. package/dist/agents/critic.d.ts +6 -6
  4. package/dist/agents/explorer.d.ts +2 -2
  5. package/dist/agents/read-only-lane-guidance.d.ts +1 -0
  6. package/dist/cli/{config-doctor-fkwyrtpq.js → config-doctor-ecmx9scq.js} +2 -2
  7. package/dist/cli/{explorer-4ttwy7jd.js → explorer-jc46negv.js} +1 -1
  8. package/dist/cli/{guardrail-explain-bjsc2ydm.js → guardrail-explain-we8mhb6y.js} +8 -8
  9. package/dist/cli/{guardrail-log-x3w800x5.js → guardrail-log-0q6pvbpx.js} +3 -3
  10. package/dist/cli/{index-1x2608ga.js → index-2a6ppa65.js} +14 -2
  11. package/dist/cli/{index-xsbtbffr.js → index-79dcqsg9.js} +4 -0
  12. package/dist/cli/{index-mv27v975.js → index-a59fjg9v.js} +1141 -15
  13. package/dist/cli/{index-ne4g3mk1.js → index-dgjsa6hy.js} +1 -1
  14. package/dist/cli/{index-5hrexm02.js → index-fjxjb66n.js} +166 -5
  15. package/dist/cli/{index-w7gkpmq8.js → index-hb10a2g8.js} +35 -2
  16. package/dist/cli/{index-dy6zs70b.js → index-jv0bz96v.js} +9 -9
  17. package/dist/cli/{index-9j1xvd8m.js → index-q8qx8p47.js} +2 -2
  18. package/dist/cli/{index-yykcmn6m.js → index-tx5czwpd.js} +1 -1
  19. package/dist/cli/{index-2jpbaedv.js → index-vqg905es.js} +1 -1
  20. package/dist/cli/index.js +7 -7
  21. package/dist/cli/{knowledge-store-eqans52j.js → knowledge-store-pa58msy5.js} +3 -1
  22. package/dist/cli/{schema-1kndsf0c.js → schema-jy18ftky.js} +1 -1
  23. package/dist/cli/{skill-generator-d0jzw6n2.js → skill-generator-3tkwcg4x.js} +12 -2
  24. package/dist/hooks/curator.d.ts +8 -3
  25. package/dist/hooks/knowledge-events.d.ts +12 -1
  26. package/dist/hooks/knowledge-store.d.ts +2 -0
  27. package/dist/index.js +1114 -621
  28. package/dist/services/skill-generator.d.ts +46 -0
  29. package/dist/tools/index.d.ts +1 -0
  30. package/dist/tools/manifest.d.ts +1 -0
  31. package/dist/tools/stale-reconciliation.d.ts +23 -0
  32. package/dist/tools/tool-metadata.d.ts +7 -2
  33. package/package.json +1 -1
@@ -133,6 +133,15 @@ export declare function activateProposal(directory: string, slug: string, force?
133
133
  stampedIds?: string[];
134
134
  evaluation?: SkillEvaluationResult;
135
135
  }>;
136
+ export declare function findSkillsBySourceKnowledgeId(directory: string, sourceId: string): Promise<string[]>;
137
+ /**
138
+ * Scan for stale skills (those with a stale.marker) whose ALL sourceKnowledgeIds
139
+ * are in the archivedIds set. These skills should be retired rather than left stale.
140
+ *
141
+ * This handles the case where a multi-source skill was marked stale after one
142
+ * source was archived, but all sources are now archived.
143
+ */
144
+ export declare function findStaleSkillsBySourceKnowledgeId(directory: string, archivedIds: Set<string>): Promise<string[]>;
136
145
  export declare function listSkills(directory: string): Promise<{
137
146
  proposals: Array<{
138
147
  slug: string;
@@ -142,6 +151,10 @@ export declare function listSkills(directory: string): Promise<{
142
151
  slug: string;
143
152
  path: string;
144
153
  }>;
154
+ stale: Array<{
155
+ slug: string;
156
+ reason: string;
157
+ }>;
145
158
  }>;
146
159
  export interface AutoApplyResult {
147
160
  approved: string[];
@@ -159,6 +172,11 @@ export declare function inspectSkill(directory: string, slug: string, prefer?: '
159
172
  path?: string;
160
173
  content?: string;
161
174
  mode?: GenerateMode;
175
+ source_knowledge_status?: Array<{
176
+ id: string;
177
+ status: 'active' | 'archived' | 'deleted';
178
+ }>;
179
+ stale_reason?: string;
162
180
  }>;
163
181
  export declare function retireSkill(directory: string, slug: string, reason?: string): Promise<{
164
182
  retired: boolean;
@@ -166,6 +184,30 @@ export declare function retireSkill(directory: string, slug: string, reason?: st
166
184
  markerPath: string;
167
185
  reason?: string;
168
186
  }>;
187
+ /**
188
+ * Mark a skill as stale by writing a stale.marker file in its directory.
189
+ */
190
+ export declare function markSkillStale(skillDir: string, reason: string): Promise<void>;
191
+ /**
192
+ * Remove the stale.marker file from a skill directory.
193
+ * Succeeds silently if the marker does not exist.
194
+ */
195
+ export declare function clearSkillStale(skillDir: string): Promise<void>;
196
+ /**
197
+ * Determine whether to retire or mark stale a skill whose source knowledge ID was archived,
198
+ * then perform the action.
199
+ *
200
+ * Reads the skill's SKILL.md frontmatter to check all its sourceKnowledgeIds.
201
+ * If ALL source knowledge IDs are now archived/deleted → retireSkill
202
+ * Otherwise → markSkillStale
203
+ *
204
+ * Returns { action: 'retire' | 'stale', slug, skillDir }
205
+ */
206
+ export declare function retireOrMarkStale(directory: string, skillDir: string, archivedKnowledgeIds: Set<string>): Promise<{
207
+ action: 'retire' | 'stale';
208
+ slug: string;
209
+ skillDir: string;
210
+ }>;
169
211
  export declare function regenerateSkill(directory: string, slug: string, options?: {
170
212
  evaluate?: boolean;
171
213
  }): Promise<{
@@ -187,11 +229,15 @@ export declare const _internals: {
187
229
  generateSkills: typeof generateSkills;
188
230
  activateProposal: typeof activateProposal;
189
231
  listSkills: typeof listSkills;
232
+ findSkillsBySourceKnowledgeId: typeof findSkillsBySourceKnowledgeId;
233
+ findStaleSkillsBySourceKnowledgeId: typeof findStaleSkillsBySourceKnowledgeId;
190
234
  inspectSkill: typeof inspectSkill;
191
235
  stampSourceEntries: typeof stampSourceEntries;
192
236
  parseDraftFrontmatter: typeof parseDraftFrontmatter;
193
237
  retireSkill: typeof retireSkill;
238
+ retireOrMarkStale: typeof retireOrMarkStale;
194
239
  regenerateSkill: typeof regenerateSkill;
240
+ clearSkillStale: typeof clearSkillStale;
195
241
  autoApplyProposals: typeof autoApplyProposals;
196
242
  unlinkSync: typeof unlinkSync;
197
243
  };
@@ -66,6 +66,7 @@ export { skill_list } from './skill-list';
66
66
  export { skill_regenerate } from './skill-regenerate';
67
67
  export { skill_retire } from './skill-retire';
68
68
  export { spec_write } from './spec-write';
69
+ export { run_stale_reconciliation } from './stale-reconciliation';
69
70
  export { submit_phase_council_verdicts } from './submit-phase-council-verdicts';
70
71
  export { summarize_work } from './summarize-work';
71
72
  export { createSwarmCommandTool, swarm_command } from './swarm-command';
@@ -92,6 +92,7 @@ export declare const TOOL_MANIFEST: {
92
92
  skill_list: () => ToolDefinition;
93
93
  skill_apply: () => ToolDefinition;
94
94
  skill_inspect: () => ToolDefinition;
95
+ run_stale_reconciliation: () => ToolDefinition;
95
96
  skill_regenerate: () => ToolDefinition;
96
97
  skill_retire: () => ToolDefinition;
97
98
  skill_improve: () => ToolDefinition;
@@ -0,0 +1,23 @@
1
+ /**
2
+ * run_stale_reconciliation — Reconcile skills against the knowledge store.
3
+ * Marks skills stale when their source knowledge entries are archived or deleted.
4
+ */
5
+ import { existsSync } from 'node:fs';
6
+ import { readdir, readFile } from 'node:fs/promises';
7
+ import { getArchivedKnowledgeIds, readKnowledge, resolveHiveKnowledgePath, resolveSwarmKnowledgePath } from '../hooks/knowledge-store.js';
8
+ import { clearSkillStale, parseDraftFrontmatter, retireOrMarkStale } from '../services/skill-generator.js';
9
+ import { createSwarmTool } from './create-tool.js';
10
+ export declare const run_stale_reconciliation: ReturnType<typeof createSwarmTool>;
11
+ export declare const _internals: {
12
+ run_stale_reconciliation: typeof run_stale_reconciliation;
13
+ clearSkillStale: typeof clearSkillStale;
14
+ retireOrMarkStale: typeof retireOrMarkStale;
15
+ parseDraftFrontmatter: typeof parseDraftFrontmatter;
16
+ getArchivedKnowledgeIds: typeof getArchivedKnowledgeIds;
17
+ readKnowledge: typeof readKnowledge;
18
+ resolveSwarmKnowledgePath: typeof resolveSwarmKnowledgePath;
19
+ resolveHiveKnowledgePath: typeof resolveHiveKnowledgePath;
20
+ readdir: typeof readdir;
21
+ readFile: typeof readFile;
22
+ existsSync: typeof existsSync;
23
+ };
@@ -299,6 +299,10 @@ export declare const TOOL_METADATA: {
299
299
  description: string;
300
300
  agents: ("architect" | "skill_improver")[];
301
301
  };
302
+ run_stale_reconciliation: {
303
+ description: string;
304
+ agents: "architect"[];
305
+ };
302
306
  skill_regenerate: {
303
307
  description: string;
304
308
  agents: "architect"[];
@@ -435,7 +439,8 @@ export declare const TOOL_DESCRIPTIONS: Partial<Record<ToolName, string>>;
435
439
  /**
436
440
  * Default tool permissions per agent, inverted from each tool's `agents` list.
437
441
  * All agent names are initialized (agents with no tools keep an empty array, e.g.
438
- * the council members). Tools with `agents: []` (the memory tools) stay OUT of
439
- * this map and are applied only via MEMORY_AGENT_TOOL_MAP.
442
+ * the council members). Tools with `agents: []` stay OUT of this default map
443
+ * and are applied only via opt-in maps such as MEMORY_AGENT_TOOL_MAP or
444
+ * GENERAL_COUNCIL_AGENT_TOOL_MAP.
440
445
  */
441
446
  export declare const AGENT_TOOL_MAP: Record<AgentName, ToolName[]>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "opencode-swarm",
3
- "version": "7.93.1",
3
+ "version": "7.94.1",
4
4
  "description": "Architect-centric agentic swarm plugin for OpenCode - hub-and-spoke orchestration with SME consultation, code generation, and QA review",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",