opencode-swarm 7.42.0 → 7.43.0

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.
@@ -12,6 +12,7 @@
12
12
  * - generated files always carry an explicit "<!-- generated -->" header
13
13
  * - file writes are atomic (write to .tmp, rename)
14
14
  */
15
+ import { unlinkSync } from 'node:fs';
15
16
  import type { KnowledgeEntryBase } from '../hooks/knowledge-types.js';
16
17
  export declare function sanitizeSlug(input: string): string;
17
18
  export declare function isValidSlug(slug: string): boolean;
@@ -35,6 +36,11 @@ export interface KnowledgeCluster {
35
36
  avgConfidence: number;
36
37
  }
37
38
  export declare function selectCandidateEntries(directory: string, opts: CandidateSelectionOptions): Promise<KnowledgeEntryBase[]>;
39
+ /**
40
+ * Compute Jaccard similarity between two tag sets.
41
+ * Returns 0 when both sets are empty (avoids division by zero).
42
+ */
43
+ declare function jaccardSimilarity(setA: string[], setB: string[]): number;
38
44
  export declare function clusterEntries(entries: KnowledgeEntryBase[]): KnowledgeCluster[];
39
45
  export declare function renderSkillMarkdown(cluster: KnowledgeCluster, mode?: GenerateMode): string;
40
46
  export type GenerateMode = 'draft' | 'active';
@@ -104,11 +110,25 @@ export declare function inspectSkill(directory: string, slug: string, prefer?: '
104
110
  content?: string;
105
111
  mode?: GenerateMode;
106
112
  }>;
113
+ export declare function retireSkill(directory: string, slug: string, reason?: string): Promise<{
114
+ retired: boolean;
115
+ path: string;
116
+ markerPath: string;
117
+ reason?: string;
118
+ }>;
119
+ export declare function regenerateSkill(directory: string, slug: string): Promise<{
120
+ regenerated: boolean;
121
+ path: string;
122
+ entryCount: number;
123
+ reason?: string;
124
+ retired?: boolean;
125
+ }>;
107
126
  export declare const _internals: {
108
127
  sanitizeSlug: typeof sanitizeSlug;
109
128
  isValidSlug: typeof isValidSlug;
110
129
  selectCandidateEntries: typeof selectCandidateEntries;
111
130
  clusterEntries: typeof clusterEntries;
131
+ jaccardSimilarity: typeof jaccardSimilarity;
112
132
  renderSkillMarkdown: typeof renderSkillMarkdown;
113
133
  generateSkills: typeof generateSkills;
114
134
  activateProposal: typeof activateProposal;
@@ -116,5 +136,8 @@ export declare const _internals: {
116
136
  inspectSkill: typeof inspectSkill;
117
137
  stampSourceEntries: typeof stampSourceEntries;
118
138
  parseDraftFrontmatter: typeof parseDraftFrontmatter;
139
+ retireSkill: typeof retireSkill;
140
+ regenerateSkill: typeof regenerateSkill;
141
+ unlinkSync: typeof unlinkSync;
119
142
  };
120
143
  export {};
@@ -48,6 +48,8 @@ export { skill_generate } from './skill-generate';
48
48
  export { skill_improve } from './skill-improve';
49
49
  export { skill_inspect } from './skill-inspect';
50
50
  export { skill_list } from './skill-list';
51
+ export { skill_regenerate } from './skill-regenerate';
52
+ export { skill_retire } from './skill-retire';
51
53
  export { spec_write } from './spec-write';
52
54
  export { submit_phase_council_verdicts } from './submit-phase-council-verdicts';
53
55
  export { summarize_work } from './summarize-work';
@@ -0,0 +1,14 @@
1
+ /**
2
+ * skill_regenerate — Regenerate an active skill by re-clustering its source
3
+ * knowledge entries and updating the SKILL.md in place.
4
+ *
5
+ * Reads the existing SKILL.md frontmatter to identify source knowledge IDs,
6
+ * resolves current entries from knowledge stores, re-clusters them, and writes
7
+ * an updated SKILL.md. If source IDs yield no matches, falls back to
8
+ * re-clustering from scratch using the slug as a keyword hint.
9
+ */
10
+ import { createSwarmTool } from './create-tool.js';
11
+ export declare const skill_regenerate: ReturnType<typeof createSwarmTool>;
12
+ export declare const _internals: {
13
+ skill_regenerate: typeof skill_regenerate;
14
+ };
@@ -0,0 +1,12 @@
1
+ /**
2
+ * skill_retire — Retire a generated skill by adding a retired.marker file.
3
+ *
4
+ * Retired skills are excluded from discovery, scoring, and agent injection.
5
+ * The marker file approach preserves reversibility (unretire = delete marker).
6
+ * The SKILL.md is NOT deleted on retirement.
7
+ */
8
+ import { createSwarmTool } from './create-tool.js';
9
+ export declare const skill_retire: ReturnType<typeof createSwarmTool>;
10
+ export declare const _internals: {
11
+ skill_retire: typeof skill_retire;
12
+ };
@@ -3,7 +3,7 @@
3
3
  * Used for constants and agent setup references.
4
4
  */
5
5
  /** Union type of all valid tool names */
6
- export type ToolName = 'diff' | 'diff_summary' | 'syntax_check' | 'placeholder_scan' | 'imports' | 'lint' | 'secretscan' | 'sast_scan' | 'build_check' | 'pre_check_batch' | 'quality_budget' | 'symbols' | 'complexity_hotspots' | 'schema_drift' | 'todo_extract' | 'evidence_check' | 'check_gate_status' | 'completion_verify' | 'submit_council_verdicts' | 'submit_phase_council_verdicts' | 'declare_council_criteria' | 'sbom_generate' | 'checkpoint' | 'pkg_audit' | 'test_runner' | 'test_impact' | 'mutation_test' | 'generate_mutants' | 'detect_domains' | 'gitingest' | 'retrieve_summary' | 'extract_code_blocks' | 'phase_complete' | 'save_plan' | 'update_task_status' | 'lint_spec' | 'write_retro' | 'write_drift_evidence' | 'write_hallucination_evidence' | 'write_mutation_evidence' | 'declare_scope' | 'knowledge_query' | 'doc_scan' | 'doc_extract' | 'curator_analyze' | 'knowledge_add' | 'knowledge_recall' | 'knowledge_remove' | 'co_change_analyzer' | 'search' | 'batch_symbols' | 'suggest_patch' | 'req_coverage' | 'get_approved_plan' | 'repo_map' | 'get_qa_gate_profile' | 'set_qa_gates' | 'web_search' | 'convene_general_council' | 'write_final_council_evidence' | 'skill_generate' | 'skill_list' | 'skill_apply' | 'skill_inspect' | 'skill_improve' | 'spec_write' | 'knowledge_ack' | 'swarm_memory_recall' | 'swarm_memory_propose' | 'swarm_command' | 'summarize_work' | 'write_architecture_supervisor_evidence' | 'lean_turbo_plan_lanes' | 'lean_turbo_acquire_locks' | 'lean_turbo_runner_status' | 'lean_turbo_review' | 'lean_turbo_run_phase' | 'lean_turbo_status';
6
+ export type ToolName = 'diff' | 'diff_summary' | 'syntax_check' | 'placeholder_scan' | 'imports' | 'lint' | 'secretscan' | 'sast_scan' | 'build_check' | 'pre_check_batch' | 'quality_budget' | 'symbols' | 'complexity_hotspots' | 'schema_drift' | 'todo_extract' | 'evidence_check' | 'check_gate_status' | 'completion_verify' | 'submit_council_verdicts' | 'submit_phase_council_verdicts' | 'declare_council_criteria' | 'sbom_generate' | 'checkpoint' | 'pkg_audit' | 'test_runner' | 'test_impact' | 'mutation_test' | 'generate_mutants' | 'detect_domains' | 'gitingest' | 'retrieve_summary' | 'extract_code_blocks' | 'phase_complete' | 'save_plan' | 'update_task_status' | 'lint_spec' | 'write_retro' | 'write_drift_evidence' | 'write_hallucination_evidence' | 'write_mutation_evidence' | 'declare_scope' | 'knowledge_query' | 'doc_scan' | 'doc_extract' | 'curator_analyze' | 'knowledge_add' | 'knowledge_recall' | 'knowledge_remove' | 'co_change_analyzer' | 'search' | 'batch_symbols' | 'suggest_patch' | 'req_coverage' | 'get_approved_plan' | 'repo_map' | 'get_qa_gate_profile' | 'set_qa_gates' | 'web_search' | 'convene_general_council' | 'write_final_council_evidence' | 'skill_generate' | 'skill_list' | 'skill_apply' | 'skill_inspect' | 'skill_regenerate' | 'skill_retire' | 'skill_improve' | 'spec_write' | 'knowledge_ack' | 'swarm_memory_recall' | 'swarm_memory_propose' | 'swarm_command' | 'summarize_work' | 'write_architecture_supervisor_evidence' | 'lean_turbo_plan_lanes' | 'lean_turbo_acquire_locks' | 'lean_turbo_runner_status' | 'lean_turbo_review' | 'lean_turbo_run_phase' | 'lean_turbo_status';
7
7
  /** Readonly array of all tool names */
8
8
  export declare const TOOL_NAMES: readonly ToolName[];
9
9
  /** Set for O(1) tool name validation */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "opencode-swarm",
3
- "version": "7.42.0",
3
+ "version": "7.43.0",
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",