opencode-swarm 7.76.1 → 7.77.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.
@@ -0,0 +1,6 @@
1
+ export declare function handleConsolidateCommand(directory: string, args: string[], options?: {
2
+ sessionID?: string;
3
+ }): Promise<string>;
4
+ export declare const _internals: {
5
+ handleConsolidateCommand: typeof handleConsolidateCommand;
6
+ };
@@ -15,6 +15,7 @@ export type { CommandName } from './command-names.js';
15
15
  export { COMMAND_NAME_SET, COMMAND_NAMES } from './command-names.js';
16
16
  export { handleConcurrencyCommand } from './concurrency';
17
17
  export { handleConfigCommand } from './config';
18
+ export { handleConsolidateCommand } from './consolidate';
18
19
  export { handleCouncilCommand } from './council';
19
20
  export { handleCurateCommand } from './curate';
20
21
  export { handleDarkMatterCommand } from './dark-matter';
@@ -117,6 +117,13 @@ export declare const COMMAND_REGISTRY: {
117
117
  readonly description: "Run tool registration coherence check";
118
118
  readonly category: "diagnostics";
119
119
  };
120
+ readonly 'doctor-tools': {
121
+ readonly handler: (ctx: CommandContext) => Promise<string>;
122
+ readonly description: "Run tool registration coherence check";
123
+ readonly category: "diagnostics";
124
+ readonly aliasOf: "doctor tools";
125
+ readonly deprecated: true;
126
+ };
120
127
  readonly diagnose: {
121
128
  readonly handler: (ctx: CommandContext) => Promise<string>;
122
129
  readonly description: "Run health check on swarm state";
@@ -242,6 +249,13 @@ export declare const COMMAND_REGISTRY: {
242
249
  readonly args: "";
243
250
  readonly category: "utility";
244
251
  };
252
+ readonly consolidate: {
253
+ readonly handler: (ctx: CommandContext) => Promise<string>;
254
+ readonly description: "Run quota-bounded skill-improver consolidation and stage skill proposals";
255
+ readonly details: "Runs the same consolidation pass used by scheduled skill_improver trigger points: queue hardening, skill-improver proposal writing, and optional draft-skill generation. It never auto-activates skills. Use --respect-interval to obey the configured cadence instead of forcing a run.";
256
+ readonly args: "--force, --respect-interval, --evaluate";
257
+ readonly category: "utility";
258
+ };
245
259
  readonly 'dark-matter': {
246
260
  readonly handler: (ctx: CommandContext) => Promise<string>;
247
261
  readonly description: "Detect hidden file couplings via co-change NPMI analysis";
@@ -7,18 +7,24 @@ interface BundledSkillFile {
7
7
  relativePath: string;
8
8
  }
9
9
  declare function getSyncCacheKey(projectDirectory: string, packageRoot: string): string;
10
- declare function collectBundledSkillFilesBounded(sourceDir: string, state: CopyState, relativeDir?: string): BundledSkillFile[];
10
+ declare function collectBundledSkillFilesBoundedAsync(sourceDir: string, state: CopyState, relativeDir?: string): Promise<BundledSkillFile[]>;
11
11
  /**
12
12
  * Materialize missing built-in mode skills into the target project so architect
13
13
  * MODE dispatch can load SKILL.md files in repositories that do not already
14
14
  * vendor the latest opencode-swarm skill tree.
15
15
  *
16
+ * Async, bounded, and fail-open: safe to `await withTimeout(...)` on the
17
+ * plugin-init path (AGENTS.md Invariant 1). Runs at plugin init so the
18
+ * architect's very first auto-entered mode (e.g. SPECIFY on a fresh project) can
19
+ * load its SKILL.md without a manual `/swarm` command or session restart; the
20
+ * command path calls it again as a backstop for pre-existing projects.
21
+ *
16
22
  * This is intentionally missing-only and fail-open: custom project skills are
17
23
  * never overwritten, and any filesystem error leaves command execution fail-open.
18
24
  */
19
- export declare function syncBundledProjectSkillsIfMissing(projectDirectory: string, packageRoot: string, quiet?: boolean): void;
25
+ export declare function syncBundledProjectSkillsIfMissingAsync(projectDirectory: string, packageRoot: string, quiet?: boolean): Promise<void>;
20
26
  export declare const _test_exports: {
21
- collectBundledSkillFilesBounded: typeof collectBundledSkillFilesBounded;
27
+ collectBundledSkillFilesBoundedAsync: typeof collectBundledSkillFilesBoundedAsync;
22
28
  getSyncCacheKey: typeof getSyncCacheKey;
23
29
  resetBundledProjectSkillSyncCache: () => void;
24
30
  };
@@ -702,6 +702,8 @@ export declare const SkillImproverConfigSchema: z.ZodObject<{
702
702
  manual: "manual";
703
703
  scheduled: "scheduled";
704
704
  }>>;
705
+ consolidation_interval_hours: z.ZodDefault<z.ZodNumber>;
706
+ consolidation_max_calls_per_run: z.ZodDefault<z.ZodNumber>;
705
707
  targets: z.ZodDefault<z.ZodArray<z.ZodEnum<{
706
708
  skills: "skills";
707
709
  spec: "spec";
@@ -1691,6 +1693,8 @@ export declare const PluginConfigSchema: z.ZodObject<{
1691
1693
  manual: "manual";
1692
1694
  scheduled: "scheduled";
1693
1695
  }>>;
1696
+ consolidation_interval_hours: z.ZodDefault<z.ZodNumber>;
1697
+ consolidation_max_calls_per_run: z.ZodDefault<z.ZodNumber>;
1694
1698
  targets: z.ZodDefault<z.ZodArray<z.ZodEnum<{
1695
1699
  skills: "skills";
1696
1700
  spec: "spec";
@@ -18,7 +18,7 @@
18
18
  */
19
19
  import * as fs from 'node:fs';
20
20
  import type { MessageWithParts } from './knowledge-types.js';
21
- import { computeSkillRelevanceScore, formatSkillIndexWithContext } from './skill-scoring.js';
21
+ import { computeSkillRelevanceScore, formatSkillIndexWithContext, readSkillMetadata } from './skill-scoring.js';
22
22
  import { appendSkillUsageEntry, readSkillUsageEntries, readSkillUsageEntriesTail } from './skill-usage-log.js';
23
23
  /**
24
24
  * Load routing skills from .opencode/skill-routing.yaml for a target agent.
@@ -66,6 +66,7 @@ export declare const _internals: {
66
66
  extractTaskIdFromPrompt: typeof extractTaskIdFromPrompt;
67
67
  extractSkillsFieldFromPrompt: typeof extractSkillsFieldFromPrompt;
68
68
  computeSkillRelevanceScore: typeof computeSkillRelevanceScore;
69
+ readSkillMetadata: typeof readSkillMetadata;
69
70
  formatSkillIndexWithContext: typeof formatSkillIndexWithContext;
70
71
  loadRoutingSkills: typeof loadRoutingSkills;
71
72
  };
@@ -43,6 +43,8 @@ export interface SkillMetadata {
43
43
  description: string;
44
44
  /** Skill type from frontmatter (directive or workflow). */
45
45
  skillType?: 'directive' | 'workflow';
46
+ /** Literal trigger phrases from frontmatter. */
47
+ triggers?: string[];
46
48
  }
47
49
  export declare const _internals: {
48
50
  computeSkillRelevanceScore: typeof computeSkillRelevanceScore;
@@ -54,6 +56,7 @@ export declare const _internals: {
54
56
  extractSkillName: typeof extractSkillName;
55
57
  computeRecencyScore: typeof computeRecencyScore;
56
58
  computeContextMatchScore: typeof computeContextMatchScore;
59
+ computeTriggerMatchBoost: typeof computeTriggerMatchBoost;
57
60
  };
58
61
  /**
59
62
  * Extracts a human-readable skill name from its file path.
@@ -89,6 +92,7 @@ declare function computeRecencyScore(lastUsedTimestamp: string): number;
89
92
  * @returns Context match score in [0, 1].
90
93
  */
91
94
  declare function computeContextMatchScore(taskDescription: string, skillPath: string, metadata?: SkillMetadata): number;
95
+ declare function computeTriggerMatchBoost(taskDescription: string, triggers?: string[]): number;
92
96
  /**
93
97
  * Compute a composite relevance score for a skill based on its usage history
94
98
  * and keyword overlap with the task description.