opencode-swarm 7.79.4 → 7.79.5
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.
- package/dist/cli/index.js +1759 -1049
- package/dist/commands/learning.d.ts +4 -0
- package/dist/hooks/curator-types.d.ts +8 -3
- package/dist/hooks/curator.d.ts +20 -3
- package/dist/hooks/knowledge-curator.d.ts +2 -0
- package/dist/hooks/trajectory-logger.d.ts +6 -0
- package/dist/hooks/trajectory-step-state.d.ts +11 -0
- package/dist/index.js +3107 -2799
- package/dist/prm/escalation.d.ts +3 -3
- package/dist/prm/index.d.ts +14 -1
- package/dist/prm/replay.d.ts +32 -0
- package/dist/prm/trajectory-store.d.ts +3 -0
- package/dist/services/learning-metrics.d.ts +4 -2
- package/package.json +1 -1
|
@@ -9,13 +9,13 @@ export interface CuratorSummary {
|
|
|
9
9
|
session_id: string;
|
|
10
10
|
last_updated: string;
|
|
11
11
|
last_phase_covered: number;
|
|
12
|
-
/** Running digest
|
|
12
|
+
/** Running digest rebuilt from the capped phase_digests projection */
|
|
13
13
|
digest: string;
|
|
14
|
-
/** Phase-level digests for lookup */
|
|
14
|
+
/** Phase-level digests for lookup, capped to the most recent phases */
|
|
15
15
|
phase_digests: PhaseDigestEntry[];
|
|
16
16
|
/** Accumulated compliance observations */
|
|
17
17
|
compliance_observations: ComplianceObservation[];
|
|
18
|
-
/**
|
|
18
|
+
/** Accumulated knowledge update recommendations from curator runs */
|
|
19
19
|
knowledge_recommendations: KnowledgeRecommendation[];
|
|
20
20
|
}
|
|
21
21
|
export interface PhaseDigestEntry {
|
|
@@ -100,12 +100,17 @@ export interface CuratorConfig {
|
|
|
100
100
|
enabled: boolean;
|
|
101
101
|
init_enabled: boolean;
|
|
102
102
|
phase_enabled: boolean;
|
|
103
|
+
postmortem_enabled?: boolean;
|
|
103
104
|
max_summary_tokens: number;
|
|
104
105
|
min_knowledge_confidence: number;
|
|
105
106
|
compliance_report: boolean;
|
|
106
107
|
suppress_warnings: boolean;
|
|
107
108
|
drift_inject_max_chars: number;
|
|
108
109
|
llm_timeout_ms?: number;
|
|
110
|
+
skill_generation_enabled?: boolean;
|
|
111
|
+
skill_generation_mode?: 'draft' | 'active';
|
|
112
|
+
min_skill_confidence?: number;
|
|
113
|
+
min_skill_confirmations?: number;
|
|
109
114
|
}
|
|
110
115
|
export interface CuratorInitResult {
|
|
111
116
|
briefing: string;
|
package/dist/hooks/curator.d.ts
CHANGED
|
@@ -38,6 +38,7 @@ import { readSkillUsageEntries } from './skill-usage-log.js';
|
|
|
38
38
|
export type CuratorLLMDelegate = (systemPrompt: string, userInput: string, signal?: AbortSignal) => Promise<string>;
|
|
39
39
|
export declare const _internals: {
|
|
40
40
|
parseKnowledgeRecommendations: typeof parseKnowledgeRecommendations;
|
|
41
|
+
parseKnowledgeRecommendationsWithDiagnostics: typeof parseKnowledgeRecommendationsWithDiagnostics;
|
|
41
42
|
readCuratorSummary: typeof readCuratorSummary;
|
|
42
43
|
writeCuratorSummary: typeof writeCuratorSummary;
|
|
43
44
|
filterPhaseEvents: typeof filterPhaseEvents;
|
|
@@ -53,6 +54,11 @@ export declare const _internals: {
|
|
|
53
54
|
reviseSkill: typeof reviseSkill;
|
|
54
55
|
getSkillVersion: typeof getSkillVersion;
|
|
55
56
|
};
|
|
57
|
+
export interface RecommendationParseDiagnostic {
|
|
58
|
+
section: 'OBSERVATIONS' | 'KNOWLEDGE_UPDATES';
|
|
59
|
+
line: string;
|
|
60
|
+
reason: string;
|
|
61
|
+
}
|
|
56
62
|
/**
|
|
57
63
|
* Auto-retire generated skills whose violation rate exceeds 30% or
|
|
58
64
|
* whose source knowledge entries are all archived.
|
|
@@ -69,6 +75,10 @@ declare function autoRetireSkills(directory: string, curatorKnowledgePath: strin
|
|
|
69
75
|
* Action hints are extracted from parenthetical directives like "(suggests boost confidence, mark hive_eligible)"
|
|
70
76
|
*/
|
|
71
77
|
export declare function parseKnowledgeRecommendations(llmOutput: string): KnowledgeRecommendation[];
|
|
78
|
+
export declare function parseKnowledgeRecommendationsWithDiagnostics(llmOutput: string): {
|
|
79
|
+
recommendations: KnowledgeRecommendation[];
|
|
80
|
+
diagnostics: RecommendationParseDiagnostic[];
|
|
81
|
+
};
|
|
72
82
|
/**
|
|
73
83
|
* v2: Strict-JSON parser for the new curator output blocks.
|
|
74
84
|
*
|
|
@@ -82,12 +92,19 @@ export declare function parseKnowledgeRecommendations(llmOutput: string): Knowle
|
|
|
82
92
|
* [{ "slug": "...", "title": "...", ... }]
|
|
83
93
|
* ```
|
|
84
94
|
*
|
|
85
|
-
* Malformed JSON or unexpected types are
|
|
86
|
-
* skill writes happen when curator output is malformed.
|
|
95
|
+
* Malformed JSON or unexpected types are skipped with diagnostics: no knowledge
|
|
96
|
+
* or skill writes happen when curator output is malformed.
|
|
87
97
|
*/
|
|
98
|
+
export interface StructuredCuratorDiagnostic {
|
|
99
|
+
block: 'knowledge_application_findings' | 'skill_candidates';
|
|
100
|
+
reason: 'malformed_json' | 'expected_array' | 'invalid_finding' | 'invalid_skill_candidate';
|
|
101
|
+
index?: number;
|
|
102
|
+
detail?: string;
|
|
103
|
+
}
|
|
88
104
|
export declare function parseStructuredCuratorBlocks(llmOutput: string): {
|
|
89
105
|
findings: import('./curator-types.js').KnowledgeApplicationFinding[];
|
|
90
106
|
candidates: import('./curator-types.js').SkillCandidate[];
|
|
107
|
+
diagnostics: StructuredCuratorDiagnostic[];
|
|
91
108
|
};
|
|
92
109
|
/**
|
|
93
110
|
* Read curator summary from .swarm/curator-summary.json
|
|
@@ -156,7 +173,7 @@ export declare function runCuratorInit(directory: string, config: CuratorConfig,
|
|
|
156
173
|
* @param llmDelegate - Optional LLM delegate for enhanced analysis
|
|
157
174
|
* @returns CuratorPhaseResult with digest, compliance, and recommendations
|
|
158
175
|
*/
|
|
159
|
-
export declare function runCuratorPhase(directory: string, phase: number, agentsDispatched: string[], config: CuratorConfig,
|
|
176
|
+
export declare function runCuratorPhase(directory: string, phase: number, agentsDispatched: string[], config: CuratorConfig, knowledgeConfig: {
|
|
160
177
|
directory?: string;
|
|
161
178
|
}, llmDelegate?: CuratorLLMDelegate): Promise<CuratorPhaseResult>;
|
|
162
179
|
/**
|
|
@@ -15,6 +15,7 @@ declare const seenRetroSections: Map<string, {
|
|
|
15
15
|
declare function capSeenRetroSections(): void;
|
|
16
16
|
/** Record a seen-section hash and enforce the size cap in one step. */
|
|
17
17
|
declare function recordSeenRetroSection(key: string, value: string, timestamp: number): void;
|
|
18
|
+
declare function hashContent(content: string): string;
|
|
18
19
|
/**
|
|
19
20
|
* Check if the input is a write operation targeting an evidence file.
|
|
20
21
|
* Exported for testing purposes only.
|
|
@@ -107,6 +108,7 @@ export declare const _internals: {
|
|
|
107
108
|
createKnowledgeCuratorHook: typeof createKnowledgeCuratorHook;
|
|
108
109
|
seenRetroSections: typeof seenRetroSections;
|
|
109
110
|
recordSeenRetroSection: typeof recordSeenRetroSection;
|
|
111
|
+
hashContent: typeof hashContent;
|
|
110
112
|
capSeenRetroSections: typeof capSeenRetroSections;
|
|
111
113
|
MAX_TRACKED_RETRO_SECTIONS: number;
|
|
112
114
|
};
|
|
@@ -58,6 +58,12 @@ export declare function createTrajectoryLoggerHook(config: Partial<TrajectoryCon
|
|
|
58
58
|
* @param sessionId - Session identifier
|
|
59
59
|
*/
|
|
60
60
|
export declare function resetTrajectoryStep(sessionId: string): void;
|
|
61
|
+
/**
|
|
62
|
+
* Clears trajectory step counters for one session, or all sessions when omitted.
|
|
63
|
+
*
|
|
64
|
+
* @param sessionId - Optional session identifier
|
|
65
|
+
*/
|
|
66
|
+
export declare function clearTrajectoryStep(sessionId?: string): void;
|
|
61
67
|
/**
|
|
62
68
|
* Records the start time for a tool call (called from toolBefore).
|
|
63
69
|
* Stored in a module-level Map for correlation with toolAfter.
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Module-level trajectory step counters shared by runtime reset code and the
|
|
3
|
+
* trajectory logger without creating a state <-> hook import cycle.
|
|
4
|
+
*/
|
|
5
|
+
export declare function nextTrajectoryStep(sessionId: string): number;
|
|
6
|
+
export declare function resetTrajectoryStepCounter(sessionId: string): void;
|
|
7
|
+
export declare function clearTrajectoryStepCounters(sessionId?: string): void;
|
|
8
|
+
export declare const _test_exports: {
|
|
9
|
+
MAX_TRACKED_STEP_SESSIONS: number;
|
|
10
|
+
getTrackedStepSessionCount: () => number;
|
|
11
|
+
};
|