opencode-swarm 7.28.2 → 7.29.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.
@@ -90,6 +90,18 @@ export declare function gateKnowledgeApplication(args: {
90
90
  recentArchitectText: string;
91
91
  config: KnowledgeApplicationConfig;
92
92
  }): GateResult;
93
+ /**
94
+ * Filter knowledge entries by minimum confidence threshold.
95
+ * Used by the knowledge reinjection hook to surface high-confidence
96
+ * knowledge after context compression events.
97
+ *
98
+ * @param entries - Array of knowledge entries (swarm or hive)
99
+ * @param threshold - Minimum confidence score (default 0.8)
100
+ * @returns Filtered entries with confidence >= threshold
101
+ */
102
+ export declare function filterHighConfidenceKnowledge<T extends {
103
+ confidence: number;
104
+ }>(entries: T[], threshold?: number): T[];
93
105
  export declare const _internals: {
94
106
  parseAcknowledgments: typeof parseAcknowledgments;
95
107
  recordKnowledgeShown: typeof recordKnowledgeShown;
@@ -20,6 +20,12 @@ import * as fs from 'node:fs';
20
20
  import type { MessageWithParts } from './knowledge-types.js';
21
21
  import { computeSkillRelevanceScore, formatSkillIndexWithContext } from './skill-scoring.js';
22
22
  import { appendSkillUsageEntry, readSkillUsageEntries, readSkillUsageEntriesTail } from './skill-usage-log.js';
23
+ /**
24
+ * Load routing skills from .opencode/skill-routing.yaml for a target agent.
25
+ * Returns array of skill paths that are explicitly routed for the agent.
26
+ * Best-effort: returns empty array on any error or if file doesn't exist.
27
+ */
28
+ export declare function loadRoutingSkills(directory: string, targetAgent: string): string[];
23
29
  /** Agents that should receive skill context in delegations. */
24
30
  export declare const SKILL_CAPABLE_AGENTS: Set<string>;
25
31
  /**
@@ -58,11 +64,12 @@ export declare const _internals: {
58
64
  appendSkillUsageEntry: typeof appendSkillUsageEntry;
59
65
  readSkillUsageEntries: typeof readSkillUsageEntries;
60
66
  readSkillUsageEntriesTail: typeof readSkillUsageEntriesTail;
61
- extractSkillsFieldFromPrompt: typeof extractSkillsFieldFromPrompt;
62
67
  parseSkillPaths: typeof parseSkillPaths;
63
68
  extractTaskIdFromPrompt: typeof extractTaskIdFromPrompt;
69
+ extractSkillsFieldFromPrompt: typeof extractSkillsFieldFromPrompt;
64
70
  computeSkillRelevanceScore: typeof computeSkillRelevanceScore;
65
71
  formatSkillIndexWithContext: typeof formatSkillIndexWithContext;
72
+ loadRoutingSkills: typeof loadRoutingSkills;
66
73
  };
67
74
  /**
68
75
  * Scans project for available skill SKILL.md files.
@@ -117,13 +124,18 @@ export declare function extractTaskIdFromPrompt(prompt: string): string;
117
124
  * the architect delegates to a skill-capable agent with a non-empty, non-"none"
118
125
  * SKILLS field.
119
126
  *
120
- * @returns { blocked: false, reason: null } when no action needed.
121
- * { blocked: false, reason: "warning message" } when warning only (enforce=false).
122
- * { blocked: true, reason: "blocked: ..." } when blocking (enforce=true).
127
+ * @returns { blocked: boolean; reason: string | null; recommendedSkills?: Array<{ skillPath: string; score: number; usageCount: number }> }
128
+ * When scoring has computed results, includes `recommendedSkills` with ranked skill recommendations.
129
+ * When scoring was skipped or errored, `recommendedSkills` is undefined.
123
130
  */
124
131
  export declare function skillPropagationGateBefore(directory: string, input: SkillGateInput, config: SkillPropagationConfig): Promise<{
125
132
  blocked: boolean;
126
133
  reason: string | null;
134
+ recommendedSkills?: Array<{
135
+ skillPath: string;
136
+ score: number;
137
+ usageCount: number;
138
+ }>;
127
139
  }>;
128
140
  /**
129
141
  * Chat messages transform hook. Scans reviewer output for SKILL_COMPLIANCE