opencode-swarm 7.93.0 → 7.94.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.
- package/.opencode/skills/codebase-review-swarm/SKILL.md +1 -1
- package/.opencode/skills/deep-dive/SKILL.md +2 -2
- package/.opencode/skills/engineering-conventions/SKILL.md +40 -0
- package/.opencode/skills/execute/SKILL.md +14 -0
- package/.opencode/skills/running-tests/SKILL.md +9 -0
- package/.opencode/skills/swarm-pr-feedback/SKILL.md +7 -5
- package/.opencode/skills/swarm-pr-review/SKILL.md +31 -8
- package/dist/cli/{config-doctor-fkwyrtpq.js → config-doctor-ecmx9scq.js} +2 -2
- package/dist/cli/{guardrail-explain-656752j3.js → guardrail-explain-0xdn6krd.js} +7 -7
- package/dist/cli/{guardrail-log-x3w800x5.js → guardrail-log-0q6pvbpx.js} +3 -3
- package/dist/cli/{index-xsbtbffr.js → index-79dcqsg9.js} +4 -0
- package/dist/cli/{index-rh24fcmy.js → index-d3dngtfy.js} +8 -8
- package/dist/cli/{index-ne4g3mk1.js → index-dgjsa6hy.js} +1 -1
- package/dist/cli/{index-5hrexm02.js → index-fjxjb66n.js} +166 -5
- package/dist/cli/{index-mf31xkvd.js → index-ftf7fby8.js} +17 -13
- package/dist/cli/{index-w7gkpmq8.js → index-hb10a2g8.js} +35 -2
- package/dist/cli/{index-rbx55am1.js → index-mk0jc9aw.js} +2 -2
- package/dist/cli/{index-yykcmn6m.js → index-tx5czwpd.js} +1 -1
- package/dist/cli/{index-2jpbaedv.js → index-vqg905es.js} +1 -1
- package/dist/cli/index.js +6 -6
- package/dist/cli/{knowledge-store-eqans52j.js → knowledge-store-pa58msy5.js} +3 -1
- package/dist/cli/{schema-1kndsf0c.js → schema-jy18ftky.js} +1 -1
- package/dist/cli/{skill-generator-d0jzw6n2.js → skill-generator-3tkwcg4x.js} +12 -2
- package/dist/hooks/curator.d.ts +8 -3
- package/dist/hooks/knowledge-events.d.ts +12 -1
- package/dist/hooks/knowledge-store.d.ts +2 -0
- package/dist/index.js +855 -422
- package/dist/services/skill-generator.d.ts +46 -0
- package/dist/tools/index.d.ts +1 -0
- package/dist/tools/manifest.d.ts +1 -0
- package/dist/tools/stale-reconciliation.d.ts +23 -0
- package/dist/tools/tool-metadata.d.ts +4 -0
- package/package.json +1 -1
|
@@ -20,7 +20,7 @@ import {
|
|
|
20
20
|
validateActionability,
|
|
21
21
|
validateActionableFields,
|
|
22
22
|
validateLesson
|
|
23
|
-
} from "./index-
|
|
23
|
+
} from "./index-fjxjb66n.js";
|
|
24
24
|
import {
|
|
25
25
|
appendKnowledge,
|
|
26
26
|
appendRejectedLesson,
|
|
@@ -48,13 +48,13 @@ import {
|
|
|
48
48
|
transactFile,
|
|
49
49
|
transactKnowledge,
|
|
50
50
|
writeLinkPointer
|
|
51
|
-
} from "./index-
|
|
51
|
+
} from "./index-hb10a2g8.js";
|
|
52
52
|
import {
|
|
53
53
|
detectStraySwarmDirs,
|
|
54
54
|
readDoctorArtifact,
|
|
55
55
|
removeStraySwarmDir,
|
|
56
56
|
runConfigDoctor
|
|
57
|
-
} from "./index-
|
|
57
|
+
} from "./index-vqg905es.js";
|
|
58
58
|
import {
|
|
59
59
|
AGENT_TOOL_MAP,
|
|
60
60
|
ALL_SUBAGENT_NAMES,
|
|
@@ -67,7 +67,7 @@ import {
|
|
|
67
67
|
TOOL_NAME_SET,
|
|
68
68
|
resolveExternalSkillsConfig,
|
|
69
69
|
stripKnownSwarmPrefix
|
|
70
|
-
} from "./index-
|
|
70
|
+
} from "./index-79dcqsg9.js";
|
|
71
71
|
import {
|
|
72
72
|
MAX_TRANSIENT_RETRIES,
|
|
73
73
|
PlanSchema,
|
|
@@ -906,7 +906,7 @@ var init_executor = __esm(() => {
|
|
|
906
906
|
// package.json
|
|
907
907
|
var package_default = {
|
|
908
908
|
name: "opencode-swarm",
|
|
909
|
-
version: "7.
|
|
909
|
+
version: "7.94.0",
|
|
910
910
|
description: "Architect-centric agentic swarm plugin for OpenCode - hub-and-spoke orchestration with SME consultation, code generation, and QA review",
|
|
911
911
|
main: "dist/index.js",
|
|
912
912
|
types: "dist/index.d.ts",
|
|
@@ -6480,6 +6480,8 @@ function countWindowedReceipts(events, entryId, windowMs, nowMs) {
|
|
|
6480
6480
|
continue;
|
|
6481
6481
|
if (e.knowledge_id !== entryId)
|
|
6482
6482
|
continue;
|
|
6483
|
+
if (e.timestamp === undefined)
|
|
6484
|
+
continue;
|
|
6483
6485
|
const t = Date.parse(e.timestamp);
|
|
6484
6486
|
if (Number.isNaN(t) || t < cutoff)
|
|
6485
6487
|
continue;
|
|
@@ -6567,6 +6569,8 @@ async function computeLearningMetrics(directory, options) {
|
|
|
6567
6569
|
throwIfAborted(options?.signal);
|
|
6568
6570
|
if (!isReceiptType(e))
|
|
6569
6571
|
continue;
|
|
6572
|
+
if (e.timestamp === undefined)
|
|
6573
|
+
continue;
|
|
6570
6574
|
const t = Date.parse(e.timestamp);
|
|
6571
6575
|
if (Number.isNaN(t))
|
|
6572
6576
|
continue;
|
|
@@ -8537,7 +8541,7 @@ function discoverAvailableSkills(directory) {
|
|
|
8537
8541
|
if (entry.startsWith("."))
|
|
8538
8542
|
continue;
|
|
8539
8543
|
const skillDir = path19.join(rootPath, entry);
|
|
8540
|
-
if (_internals16.existsSync(path19.join(skillDir, "retired.marker")))
|
|
8544
|
+
if (_internals16.existsSync(path19.join(skillDir, "retired.marker")) || _internals16.existsSync(path19.join(skillDir, "stale.marker")))
|
|
8541
8545
|
continue;
|
|
8542
8546
|
const skillFile = path19.join(skillDir, "SKILL.md");
|
|
8543
8547
|
try {
|
|
@@ -8743,7 +8747,7 @@ async function skillPropagationGateBefore(directory, input, config) {
|
|
|
8743
8747
|
const existingPaths = new Set(scored.map((s) => s.skillPath));
|
|
8744
8748
|
for (const routingPath of routingPaths) {
|
|
8745
8749
|
const routedSkillDir = path19.dirname(path19.join(directory, routingPath));
|
|
8746
|
-
if (_internals16.existsSync(path19.join(routedSkillDir, "retired.marker")))
|
|
8750
|
+
if (_internals16.existsSync(path19.join(routedSkillDir, "retired.marker")) || _internals16.existsSync(path19.join(routedSkillDir, "stale.marker")))
|
|
8747
8751
|
continue;
|
|
8748
8752
|
if (!existingPaths.has(routingPath)) {
|
|
8749
8753
|
scored.push({
|
|
@@ -11944,7 +11948,7 @@ async function runFinalizeStage(ctx) {
|
|
|
11944
11948
|
}
|
|
11945
11949
|
}
|
|
11946
11950
|
try {
|
|
11947
|
-
const { CuratorConfigSchema: CCS } = await import("./schema-
|
|
11951
|
+
const { CuratorConfigSchema: CCS } = await import("./schema-jy18ftky.js");
|
|
11948
11952
|
const { config: pmLoadedConfig } = _internals20.loadPluginConfigWithMeta(ctx.directory);
|
|
11949
11953
|
const curatorCfg = CCS.parse(pmLoadedConfig.curator ?? {});
|
|
11950
11954
|
if (curatorCfg.enabled && curatorCfg.postmortem_enabled) {
|
|
@@ -15665,7 +15669,7 @@ async function handleDoctorCommand(directory, args) {
|
|
|
15665
15669
|
const result = runConfigDoctor(config, directory);
|
|
15666
15670
|
let output;
|
|
15667
15671
|
if (enableAutoFix && result.hasAutoFixableIssues) {
|
|
15668
|
-
const { runConfigDoctorWithFixes } = await import("./config-doctor-
|
|
15672
|
+
const { runConfigDoctorWithFixes } = await import("./config-doctor-ecmx9scq.js");
|
|
15669
15673
|
const fixResult = await runConfigDoctorWithFixes(directory, config, true);
|
|
15670
15674
|
output = formatDoctorMarkdown(fixResult.result);
|
|
15671
15675
|
} else {
|
|
@@ -30727,7 +30731,7 @@ function buildDetailedHelp(commandName, entry) {
|
|
|
30727
30731
|
async function handleHelpCommand(ctx) {
|
|
30728
30732
|
const targetCommand = ctx.args.join(" ");
|
|
30729
30733
|
if (!targetCommand) {
|
|
30730
|
-
const { buildHelpText } = await import("./index-
|
|
30734
|
+
const { buildHelpText } = await import("./index-d3dngtfy.js");
|
|
30731
30735
|
return buildHelpText();
|
|
30732
30736
|
}
|
|
30733
30737
|
const tokens = targetCommand.split(/\s+/);
|
|
@@ -30736,7 +30740,7 @@ async function handleHelpCommand(ctx) {
|
|
|
30736
30740
|
return _internals45.buildDetailedHelp(resolved.key, resolved.entry);
|
|
30737
30741
|
}
|
|
30738
30742
|
const similar = _internals45.findSimilarCommands(targetCommand);
|
|
30739
|
-
const { buildHelpText: fullHelp } = await import("./index-
|
|
30743
|
+
const { buildHelpText: fullHelp } = await import("./index-d3dngtfy.js");
|
|
30740
30744
|
if (similar.length > 0) {
|
|
30741
30745
|
return `Command '/swarm ${targetCommand}' not found.
|
|
30742
30746
|
|
|
@@ -30869,7 +30873,7 @@ var COMMAND_REGISTRY = {
|
|
|
30869
30873
|
},
|
|
30870
30874
|
"guardrail explain": {
|
|
30871
30875
|
handler: async (ctx) => {
|
|
30872
|
-
const { handleGuardrailExplain } = await import("./guardrail-explain-
|
|
30876
|
+
const { handleGuardrailExplain } = await import("./guardrail-explain-0xdn6krd.js");
|
|
30873
30877
|
return handleGuardrailExplain(ctx.directory, ctx.args);
|
|
30874
30878
|
},
|
|
30875
30879
|
description: "Dry-run: show what the guardrails would do to a command or write target (executes nothing)",
|
|
@@ -30879,7 +30883,7 @@ var COMMAND_REGISTRY = {
|
|
|
30879
30883
|
},
|
|
30880
30884
|
"guardrail-log": {
|
|
30881
30885
|
handler: async (ctx) => {
|
|
30882
|
-
const { handleGuardrailLog } = await import("./guardrail-log-
|
|
30886
|
+
const { handleGuardrailLog } = await import("./guardrail-log-0q6pvbpx.js");
|
|
30883
30887
|
return handleGuardrailLog(ctx.directory, ctx.args);
|
|
30884
30888
|
},
|
|
30885
30889
|
description: "Read the guardrail decision log (use --blocks-only for blocks)",
|
|
@@ -386,6 +386,38 @@ async function transactKnowledge(filePath, mutate) {
|
|
|
386
386
|
await atomicWriteFile(fp, content);
|
|
387
387
|
}, mutate);
|
|
388
388
|
}
|
|
389
|
+
async function getArchivedKnowledgeIds(directory) {
|
|
390
|
+
const archived = new Set;
|
|
391
|
+
const swarmPath = resolveSwarmKnowledgePath(directory);
|
|
392
|
+
try {
|
|
393
|
+
const content = await readFile(swarmPath, "utf-8");
|
|
394
|
+
const lines = content.split(`
|
|
395
|
+
`).filter((l) => l.trim());
|
|
396
|
+
for (const line of lines) {
|
|
397
|
+
try {
|
|
398
|
+
const entry = JSON.parse(line);
|
|
399
|
+
if (entry.status === "archived" || entry.status === "quarantined" || entry.status === "quarantined_unactionable") {
|
|
400
|
+
archived.add(entry.id);
|
|
401
|
+
}
|
|
402
|
+
} catch {}
|
|
403
|
+
}
|
|
404
|
+
} catch {}
|
|
405
|
+
const hivePath = resolveHiveKnowledgePath();
|
|
406
|
+
try {
|
|
407
|
+
const content = await readFile(hivePath, "utf-8");
|
|
408
|
+
const lines = content.split(`
|
|
409
|
+
`).filter((l) => l.trim());
|
|
410
|
+
for (const line of lines) {
|
|
411
|
+
try {
|
|
412
|
+
const entry = JSON.parse(line);
|
|
413
|
+
if (entry.status === "archived" || entry.status === "quarantined" || entry.status === "quarantined_unactionable") {
|
|
414
|
+
archived.add(entry.id);
|
|
415
|
+
}
|
|
416
|
+
} catch {}
|
|
417
|
+
}
|
|
418
|
+
} catch {}
|
|
419
|
+
return archived;
|
|
420
|
+
}
|
|
389
421
|
async function appendKnowledgeWithCapEnforcement(filePath, entry, maxEntries) {
|
|
390
422
|
return transactKnowledge(filePath, (entries) => {
|
|
391
423
|
const updated = [...entries, entry];
|
|
@@ -677,7 +709,8 @@ var _internals = {
|
|
|
677
709
|
computeOutcomeSignal,
|
|
678
710
|
selectKnowledgeCapSurvivors,
|
|
679
711
|
inferTags,
|
|
680
|
-
bumpKnowledgeConfidenceBatch
|
|
712
|
+
bumpKnowledgeConfidenceBatch,
|
|
713
|
+
getArchivedKnowledgeIds
|
|
681
714
|
};
|
|
682
715
|
|
|
683
|
-
export { resolveLinkDir, sanitizeLinkId, readLinkPointer, writeLinkPointer, removeLinkPointer, resolveKnowledgeStoreDir, isLinked, getPlatformConfigDir, resolveSwarmKnowledgePath, resolveSwarmRejectedPath, resolveSwarmRetractionsPath, resolveHiveKnowledgePath, resolveHiveRejectedPath, resolveHiveEventsPath, readKnowledge, normalizeEntry, readRejectedLessons, readRetractionRecords, appendRetractionRecord, appendKnowledge, rewriteKnowledge, transactFile, transactKnowledge, appendKnowledgeWithCapEnforcement, enforceKnowledgeCap, sweepAgedEntries, sweepStaleTodos, appendRejectedLesson, normalize, wordBigrams, jaccardBigram, findNearDuplicate, computeConfidence, OUTCOME_SIGNAL_SMOOTHING, computeOutcomeSignal, inferTags, bumpKnowledgeConfidenceBatch, _internals };
|
|
716
|
+
export { resolveLinkDir, sanitizeLinkId, readLinkPointer, writeLinkPointer, removeLinkPointer, resolveKnowledgeStoreDir, isLinked, getPlatformConfigDir, resolveSwarmKnowledgePath, resolveSwarmRejectedPath, resolveSwarmRetractionsPath, resolveHiveKnowledgePath, resolveHiveRejectedPath, resolveHiveEventsPath, readKnowledge, normalizeEntry, readRejectedLessons, readRetractionRecords, appendRetractionRecord, appendKnowledge, rewriteKnowledge, transactFile, transactKnowledge, getArchivedKnowledgeIds, appendKnowledgeWithCapEnforcement, enforceKnowledgeCap, sweepAgedEntries, sweepStaleTodos, appendRejectedLesson, normalize, wordBigrams, jaccardBigram, findNearDuplicate, computeConfidence, OUTCOME_SIGNAL_SMOOTHING, computeOutcomeSignal, inferTags, bumpKnowledgeConfidenceBatch, _internals };
|
|
@@ -12,14 +12,14 @@ import {
|
|
|
12
12
|
detectPosixWrites,
|
|
13
13
|
detectWindowsWrites,
|
|
14
14
|
resolveWriteTargets
|
|
15
|
-
} from "./index-
|
|
15
|
+
} from "./index-ftf7fby8.js";
|
|
16
16
|
import {
|
|
17
17
|
checkFileAuthority,
|
|
18
18
|
classifyFile,
|
|
19
19
|
isInDeclaredScope,
|
|
20
20
|
redactPath,
|
|
21
21
|
redactShellCommand
|
|
22
|
-
} from "./index-
|
|
22
|
+
} from "./index-dgjsa6hy.js";
|
|
23
23
|
|
|
24
24
|
// src/services/guardrail-explain-service.ts
|
|
25
25
|
import path from "path";
|
package/dist/cli/index.js
CHANGED
|
@@ -7,15 +7,15 @@ import {
|
|
|
7
7
|
getPluginLockFilePaths,
|
|
8
8
|
package_default,
|
|
9
9
|
resolveCommand
|
|
10
|
-
} from "./index-
|
|
11
|
-
import"./index-
|
|
10
|
+
} from "./index-ftf7fby8.js";
|
|
11
|
+
import"./index-dgjsa6hy.js";
|
|
12
12
|
import"./index-1x2608ga.js";
|
|
13
|
-
import"./index-
|
|
14
|
-
import"./index-
|
|
15
|
-
import"./index-
|
|
13
|
+
import"./index-fjxjb66n.js";
|
|
14
|
+
import"./index-hb10a2g8.js";
|
|
15
|
+
import"./index-vqg905es.js";
|
|
16
16
|
import {
|
|
17
17
|
DEFAULT_AGENT_CONFIGS
|
|
18
|
-
} from "./index-
|
|
18
|
+
} from "./index-79dcqsg9.js";
|
|
19
19
|
import"./index-y1z6yaq4.js";
|
|
20
20
|
import"./index-adz3nk9b.js";
|
|
21
21
|
import"./index-v4fcn4tr.js";
|
|
@@ -11,6 +11,7 @@ import {
|
|
|
11
11
|
computeOutcomeSignal,
|
|
12
12
|
enforceKnowledgeCap,
|
|
13
13
|
findNearDuplicate,
|
|
14
|
+
getArchivedKnowledgeIds,
|
|
14
15
|
getPlatformConfigDir,
|
|
15
16
|
inferTags,
|
|
16
17
|
jaccardBigram,
|
|
@@ -31,7 +32,7 @@ import {
|
|
|
31
32
|
transactFile,
|
|
32
33
|
transactKnowledge,
|
|
33
34
|
wordBigrams
|
|
34
|
-
} from "./index-
|
|
35
|
+
} from "./index-hb10a2g8.js";
|
|
35
36
|
import"./index-kv4dd5c5.js";
|
|
36
37
|
import"./index-jtqkh8jf.js";
|
|
37
38
|
import"./index-91qtsbce.js";
|
|
@@ -59,6 +60,7 @@ export {
|
|
|
59
60
|
jaccardBigram,
|
|
60
61
|
inferTags,
|
|
61
62
|
getPlatformConfigDir,
|
|
63
|
+
getArchivedKnowledgeIds,
|
|
62
64
|
findNearDuplicate,
|
|
63
65
|
enforceKnowledgeCap,
|
|
64
66
|
computeOutcomeSignal,
|
|
@@ -9,21 +9,26 @@ import {
|
|
|
9
9
|
activePath,
|
|
10
10
|
activeRepoRelativePath,
|
|
11
11
|
autoApplyProposals,
|
|
12
|
+
clearSkillStale,
|
|
12
13
|
clusterEntries,
|
|
14
|
+
findSkillsBySourceKnowledgeId,
|
|
15
|
+
findStaleSkillsBySourceKnowledgeId,
|
|
13
16
|
generateSkills,
|
|
14
17
|
inspectSkill,
|
|
15
18
|
isSkillMaturityEligible,
|
|
16
19
|
isValidSlug,
|
|
17
20
|
listSkills,
|
|
21
|
+
markSkillStale,
|
|
18
22
|
parseDraftFrontmatter,
|
|
19
23
|
proposalPath,
|
|
20
24
|
regenerateSkill,
|
|
21
25
|
renderSkillMarkdown,
|
|
26
|
+
retireOrMarkStale,
|
|
22
27
|
retireSkill,
|
|
23
28
|
sanitizeSlug,
|
|
24
29
|
selectCandidateEntries
|
|
25
|
-
} from "./index-
|
|
26
|
-
import"./index-
|
|
30
|
+
} from "./index-fjxjb66n.js";
|
|
31
|
+
import"./index-hb10a2g8.js";
|
|
27
32
|
import"./index-kv4dd5c5.js";
|
|
28
33
|
import"./index-jtqkh8jf.js";
|
|
29
34
|
import"./index-zgwm4ryv.js";
|
|
@@ -35,16 +40,21 @@ export {
|
|
|
35
40
|
selectCandidateEntries,
|
|
36
41
|
sanitizeSlug,
|
|
37
42
|
retireSkill,
|
|
43
|
+
retireOrMarkStale,
|
|
38
44
|
renderSkillMarkdown,
|
|
39
45
|
regenerateSkill,
|
|
40
46
|
proposalPath,
|
|
41
47
|
parseDraftFrontmatter,
|
|
48
|
+
markSkillStale,
|
|
42
49
|
listSkills,
|
|
43
50
|
isValidSlug,
|
|
44
51
|
isSkillMaturityEligible,
|
|
45
52
|
inspectSkill,
|
|
46
53
|
generateSkills,
|
|
54
|
+
findStaleSkillsBySourceKnowledgeId,
|
|
55
|
+
findSkillsBySourceKnowledgeId,
|
|
47
56
|
clusterEntries,
|
|
57
|
+
clearSkillStale,
|
|
48
58
|
autoApplyProposals,
|
|
49
59
|
activeRepoRelativePath,
|
|
50
60
|
activePath,
|
package/dist/hooks/curator.d.ts
CHANGED
|
@@ -24,10 +24,10 @@
|
|
|
24
24
|
* This dual dispatch means agent lists are incomplete — they capture factory-dispatched
|
|
25
25
|
* curators but omit hook-dispatched ones. This is by design for hook-internal operations.
|
|
26
26
|
*/
|
|
27
|
-
import { listSkills, parseDraftFrontmatter, retireSkill } from '../services/skill-generator.js';
|
|
27
|
+
import { listSkills, parseDraftFrontmatter, retireOrMarkStale, retireSkill } from '../services/skill-generator.js';
|
|
28
28
|
import { getSkillVersion, reviseSkill } from '../services/skill-reviser.js';
|
|
29
29
|
import type { ComplianceObservation, CuratorConfig, CuratorInitResult, CuratorPhaseResult, CuratorSummary, KnowledgeRecommendation } from './curator-types.js';
|
|
30
|
-
import { readKnowledge } from './knowledge-store.js';
|
|
30
|
+
import { getArchivedKnowledgeIds, readKnowledge } from './knowledge-store.js';
|
|
31
31
|
import type { KnowledgeConfig } from './knowledge-types.js';
|
|
32
32
|
import { readSkillUsageEntries } from './skill-usage-log.js';
|
|
33
33
|
/**
|
|
@@ -48,7 +48,9 @@ export declare const _internals: {
|
|
|
48
48
|
readSkillUsageEntries: typeof readSkillUsageEntries;
|
|
49
49
|
listSkills: typeof listSkills;
|
|
50
50
|
parseDraftFrontmatter: typeof parseDraftFrontmatter;
|
|
51
|
+
retireOrMarkStale: typeof retireOrMarkStale;
|
|
51
52
|
retireSkill: typeof retireSkill;
|
|
53
|
+
getArchivedKnowledgeIds: typeof getArchivedKnowledgeIds;
|
|
52
54
|
readFileAsync: (filePath: string, encoding: string) => Promise<string>;
|
|
53
55
|
readKnowledge: typeof readKnowledge;
|
|
54
56
|
reviseSkill: typeof reviseSkill;
|
|
@@ -63,10 +65,13 @@ export interface RecommendationParseDiagnostic {
|
|
|
63
65
|
* Auto-retire generated skills whose violation rate exceeds 30% or
|
|
64
66
|
* whose source knowledge entries are all archived.
|
|
65
67
|
*
|
|
68
|
+
* Also marks skills stale when some (but not all) source knowledge entries
|
|
69
|
+
* are archived.
|
|
70
|
+
*
|
|
66
71
|
* Non-blocking: errors are caught and logged but never propagated.
|
|
67
72
|
* Returns an array of observation strings to include in the phase digest.
|
|
68
73
|
*/
|
|
69
|
-
declare function autoRetireSkills(directory: string,
|
|
74
|
+
declare function autoRetireSkills(directory: string, _curatorKnowledgePath: string, excludeSlugs?: ReadonlySet<string>): Promise<string[]>;
|
|
70
75
|
/**
|
|
71
76
|
* Parse OBSERVATIONS section from curator LLM output.
|
|
72
77
|
* Expected format per line: "- entry <uuid> (<observable>): [text]"
|
|
@@ -132,7 +132,18 @@ export interface EscalationEvent {
|
|
|
132
132
|
reason: string;
|
|
133
133
|
enforcement_mode?: string;
|
|
134
134
|
}
|
|
135
|
-
|
|
135
|
+
/** A batch of skills were invalidated after a knowledge entry was archived/purged. */
|
|
136
|
+
export interface SkillStaleBatchEvent {
|
|
137
|
+
type: 'skill-stale-batch';
|
|
138
|
+
schema_version?: number;
|
|
139
|
+
event_id?: string;
|
|
140
|
+
timestamp?: string;
|
|
141
|
+
skillIds: string[];
|
|
142
|
+
archivedIds: string[];
|
|
143
|
+
retiredCount: number;
|
|
144
|
+
staleCount: number;
|
|
145
|
+
}
|
|
146
|
+
export type KnowledgeEvent = RetrievedEvent | ReceiptEvent | OutcomeEvent | ArchivedEvent | EscalationEvent | SkillStaleBatchEvent;
|
|
136
147
|
export type KnowledgeEventType = KnowledgeEvent['type'];
|
|
137
148
|
/**
|
|
138
149
|
* Event shape accepted by {@link appendKnowledgeEvent} / {@link recordKnowledgeEvent}.
|
|
@@ -26,6 +26,7 @@ export declare function appendKnowledge<T>(filePath: string, entry: T): Promise<
|
|
|
26
26
|
export declare function rewriteKnowledge<T>(filePath: string, entries: T[]): Promise<void>;
|
|
27
27
|
export declare function transactFile<T>(filePath: string, read: (filePath: string) => Promise<T>, write: (filePath: string, data: T) => Promise<void>, mutate: (data: T) => T | null): Promise<boolean>;
|
|
28
28
|
export declare function transactKnowledge<T>(filePath: string, mutate: (entries: T[]) => T[] | null): Promise<boolean>;
|
|
29
|
+
export declare function getArchivedKnowledgeIds(directory: string): Promise<Set<string>>;
|
|
29
30
|
export declare function appendKnowledgeWithCapEnforcement<T>(filePath: string, entry: T, maxEntries: number): Promise<boolean>;
|
|
30
31
|
export declare function enforceKnowledgeCap<T>(filePath: string, maxEntries: number): Promise<void>;
|
|
31
32
|
declare function selectKnowledgeCapSurvivors<T>(entries: T[], maxEntries: number): T[];
|
|
@@ -95,5 +96,6 @@ export declare const _internals: {
|
|
|
95
96
|
selectKnowledgeCapSurvivors: typeof selectKnowledgeCapSurvivors;
|
|
96
97
|
inferTags: typeof inferTags;
|
|
97
98
|
bumpKnowledgeConfidenceBatch: typeof bumpKnowledgeConfidenceBatch;
|
|
99
|
+
getArchivedKnowledgeIds: typeof getArchivedKnowledgeIds;
|
|
98
100
|
};
|
|
99
101
|
export {};
|