opencode-swarm 7.68.1 → 7.69.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.
@@ -45,6 +45,7 @@ export declare function clusterEntries(entries: KnowledgeEntryBase[]): Knowledge
45
45
  export interface SkillFrontmatterOverrides {
46
46
  version?: number;
47
47
  skillOrigin?: 'generated' | 'promoted_external';
48
+ skillType?: 'directive' | 'workflow';
48
49
  }
49
50
  export declare function renderSkillMarkdown(cluster: KnowledgeCluster, mode?: GenerateMode, generatedAt?: string, overrides?: SkillFrontmatterOverrides): string;
50
51
  export type GenerateMode = 'draft' | 'active';
@@ -92,6 +93,7 @@ export declare function parseDraftFrontmatter(content: string): {
92
93
  sourceKnowledgeIds: string[];
93
94
  version?: number;
94
95
  skillOrigin?: string;
96
+ skillType?: 'directive' | 'workflow';
95
97
  } | null;
96
98
  export declare function activateProposal(directory: string, slug: string, force?: boolean): Promise<{
97
99
  activated: boolean;
@@ -111,6 +113,17 @@ export declare function listSkills(directory: string): Promise<{
111
113
  path: string;
112
114
  }>;
113
115
  }>;
116
+ export interface AutoApplyResult {
117
+ approved: string[];
118
+ rejected: string[];
119
+ skipped: string[];
120
+ }
121
+ /**
122
+ * In full-auto mode, send pending proposals to a critic LLM for APPROVE/REJECT
123
+ * and activate approved ones. Skips proposals whose slug already exists as an
124
+ * active skill, and caps each run to AUTO_APPLY_BATCH_LIMIT activations.
125
+ */
126
+ export declare function autoApplyProposals(directory: string, llmDelegate: (systemPrompt: string, userPrompt: string, signal?: AbortSignal) => Promise<string>): Promise<AutoApplyResult>;
114
127
  export declare function inspectSkill(directory: string, slug: string, prefer?: 'auto' | 'proposal' | 'active'): Promise<{
115
128
  found: boolean;
116
129
  path?: string;
@@ -145,6 +158,7 @@ export declare const _internals: {
145
158
  parseDraftFrontmatter: typeof parseDraftFrontmatter;
146
159
  retireSkill: typeof retireSkill;
147
160
  regenerateSkill: typeof regenerateSkill;
161
+ autoApplyProposals: typeof autoApplyProposals;
148
162
  unlinkSync: typeof unlinkSync;
149
163
  };
150
164
  export {};
@@ -18,6 +18,7 @@
18
18
  */
19
19
  import type { SwarmKnowledgeEntry } from '../hooks/knowledge-types.js';
20
20
  import { type SkillImproverLLMDelegate } from '../hooks/skill-improver-llm-factory.js';
21
+ import { type AutoApplyResult } from './skill-generator.js';
21
22
  import { type QuotaWindow } from './skill-improver-quota.js';
22
23
  export interface SkillImproverConfigInput {
23
24
  enabled: boolean;
@@ -73,6 +74,13 @@ export interface SkillImproveResult {
73
74
  motifs: number;
74
75
  proposalsWritten: number;
75
76
  };
77
+ /** #1234 Part 4: success workflow-motif proposals written this run. */
78
+ successMotifs?: {
79
+ motifs: number;
80
+ proposalsWritten: number;
81
+ };
82
+ /** #1234 Part 3D: critic-gated auto-apply of proposals in full-auto mode. */
83
+ autoApply?: AutoApplyResult;
76
84
  }
77
85
  interface InventorySnapshot {
78
86
  knowledge: {
@@ -57,6 +57,12 @@ export interface StatusData {
57
57
  specStaleCurrentHash?: string | null;
58
58
  /** Directives auto-escalated in the last 7 days (Change 3). */
59
59
  recentEscalations?: RecentEscalation[];
60
+ /** #1234 Part 3: pending skill/motif proposals in .swarm/skills/proposals/ */
61
+ pendingProposals?: number;
62
+ /** #1234 Part 3: entries in the unactionable-knowledge queue */
63
+ unactionableQueueDepth?: number;
64
+ /** #1234 Part 3: pending insight candidates awaiting phase boundary consumption */
65
+ insightCandidatesPending?: number;
60
66
  }
61
67
  /**
62
68
  * Get status data from the swarm directory.
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * Macro-reflector trajectory clustering (Swarm Learning System, Change 6 /
3
- * Task 5.3).
3
+ * Task 5.3, extended by #1234 Part 4).
4
4
  *
5
5
  * On the skill-improver's scheduled (quota-gated) cadence, scan the last N task
6
6
  * trajectories (`.swarm/evidence/<taskId>/trajectory.jsonl`), cluster repeated
@@ -9,6 +9,10 @@
9
9
  * provenance: a draft SKILL.md body, the cluster of source task ids (and any
10
10
  * source knowledge ids), a verification predicate, and `applies_to_agents`.
11
11
  *
12
+ * #1234 Part 4: also mines SUCCESS motifs — recurring multi-step tool sequences
13
+ * that completed successfully across multiple tasks — and emits them as
14
+ * `workflow`-type skill proposals tagged `skill_type: workflow`.
15
+ *
12
16
  * Read-only over the knowledge store; writes only proposal markdown (never
13
17
  * active skills). Fail-open.
14
18
  */
@@ -47,3 +51,31 @@ export declare function writeMotifProposals(directory: string, opts?: {
47
51
  minTasks?: number;
48
52
  maxProposals?: number;
49
53
  }): Promise<MotifProposalResult>;
54
+ /** Minimum number of steps in a trajectory for it to qualify as a workflow. */
55
+ export declare const SUCCESS_SEQUENCE_MIN_STEPS = 3;
56
+ export interface SuccessMotif {
57
+ signature: string;
58
+ sequence: Array<{
59
+ tool: string;
60
+ action: string;
61
+ }>;
62
+ agent: string;
63
+ taskIds: string[];
64
+ gatesPassed: string[];
65
+ }
66
+ export interface SuccessMotifProposalResult {
67
+ motifs: number;
68
+ proposalsWritten: string[];
69
+ }
70
+ export declare function gatherSuccessMotifs(directory: string, opts?: {
71
+ window?: number;
72
+ minTasks?: number;
73
+ minSteps?: number;
74
+ }): Promise<SuccessMotif[]>;
75
+ export declare function buildWorkflowProposal(motif: SuccessMotif): string;
76
+ export declare function writeSuccessMotifProposals(directory: string, opts?: {
77
+ window?: number;
78
+ minTasks?: number;
79
+ minSteps?: number;
80
+ maxProposals?: number;
81
+ }): Promise<SuccessMotifProposalResult>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "opencode-swarm",
3
- "version": "7.68.1",
3
+ "version": "7.69.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",