@lmzhen/dsh-evolution-core 0.3.55 → 0.3.57
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/lib/index.js +83 -42
- package/lib/types/env.d.ts +18 -0
- package/lib/types/index.d.ts +1 -0
- package/lib/types/skill-store.d.ts +2 -0
- package/package.json +1 -1
package/lib/index.js
CHANGED
|
@@ -311,6 +311,10 @@ function nodeEvolutionIo(lockAttempts = 40) {
|
|
|
311
311
|
retryDelay: 100
|
|
312
312
|
}).catch(async () => {
|
|
313
313
|
const body = await readFile(lock, "utf8").catch(() => "");
|
|
314
|
+
if (pendingSelfCleanup.size >= 64) {
|
|
315
|
+
const oldest = pendingSelfCleanup.keys().next().value;
|
|
316
|
+
if (oldest !== void 0) pendingSelfCleanup.delete(oldest);
|
|
317
|
+
}
|
|
314
318
|
pendingSelfCleanup.set(lock, body);
|
|
315
319
|
});
|
|
316
320
|
}
|
|
@@ -428,7 +432,7 @@ function nodeEvolutionIo(lockAttempts = 40) {
|
|
|
428
432
|
},
|
|
429
433
|
async rename(path, destination) {
|
|
430
434
|
await mkdir(dirname(destination), { recursive: true });
|
|
431
|
-
await
|
|
435
|
+
await renameWithRetry(path, destination);
|
|
432
436
|
},
|
|
433
437
|
async copy(path, destination) {
|
|
434
438
|
await mkdir(dirname(destination), { recursive: true });
|
|
@@ -1207,8 +1211,8 @@ async function appendEvolutionEvent(io, path, event, rotateAt = EVENT_LOG_ROTATE
|
|
|
1207
1211
|
return current;
|
|
1208
1212
|
}
|
|
1209
1213
|
}
|
|
1210
|
-
const
|
|
1211
|
-
let maxSeq =
|
|
1214
|
+
const events = await rotateIfDue(io, path, v1EventRecords(parsedBody), rotateAt);
|
|
1215
|
+
let maxSeq = events.reduce((max, entry) => Math.max(max, entry.seq), 0);
|
|
1212
1216
|
if (maxSeq === 0) for (const name of await listEventArchives(io, path)) maxSeq = Math.max(maxSeq, Number.parseInt(name.slice(7, name.length - 5), 10));
|
|
1213
1217
|
const record = {
|
|
1214
1218
|
...event,
|
|
@@ -1218,7 +1222,7 @@ async function appendEvolutionEvent(io, path, event, rotateAt = EVENT_LOG_ROTATE
|
|
|
1218
1222
|
assigned = record.seq;
|
|
1219
1223
|
return JSON.stringify({
|
|
1220
1224
|
version: 1,
|
|
1221
|
-
events: [...
|
|
1225
|
+
events: [...events, record]
|
|
1222
1226
|
}, null, 2);
|
|
1223
1227
|
});
|
|
1224
1228
|
if (assigned === 0) throw new Error(`${refuseMessage || "evolution event log is malformed and was not touched"}: ${path}`);
|
|
@@ -1325,6 +1329,28 @@ async function readEvolutionTimeline(io, path) {
|
|
|
1325
1329
|
};
|
|
1326
1330
|
}
|
|
1327
1331
|
//#endregion
|
|
1332
|
+
//#region lib/types/env.js
|
|
1333
|
+
/**
|
|
1334
|
+
* Evolution environment-variable reading, single-source (WC, 0.3.56).
|
|
1335
|
+
*
|
|
1336
|
+
* Every `DSH_EVOLUTION_*` value the PLUGIN code reads goes through this module
|
|
1337
|
+
* so the trim/whitelist patterns (v10 P2-12/13) live in exactly one place and
|
|
1338
|
+
* the generated env reference can point at one behavior. Configuration-layer
|
|
1339
|
+
* reads inside patch YAML `!!js` expressions (session-query path/openAt) stay
|
|
1340
|
+
* in the profile config evaluation — they are NOT migrated (they are resolved
|
|
1341
|
+
* at cordis config time, not plugin time) but are documented in the README
|
|
1342
|
+
* env table.
|
|
1343
|
+
*/
|
|
1344
|
+
/** Plugin-side DSH_EVOLUTION_* keys (config-layer keys are documented separately). */
|
|
1345
|
+
const EVOLUTION_ENV_KEYS = ["DSH_EVOLUTION_ALLOW_ROW_COLLISIONS"];
|
|
1346
|
+
const ALLOW_ROW_COLLISIONS = "1";
|
|
1347
|
+
/** N-5 escape: `DSH_EVOLUTION_ALLOW_ROW_COLLISIONS=1` downgrades a delta-row
|
|
1348
|
+
* collision from fail-loud to warn+keep-both. Any other value (including an
|
|
1349
|
+
* EMPTY/whitespace string — a set-but-unset variable) keeps the fail-loud. */
|
|
1350
|
+
function allowRowCollisions(env = process.env) {
|
|
1351
|
+
return env.DSH_EVOLUTION_ALLOW_ROW_COLLISIONS === ALLOW_ROW_COLLISIONS;
|
|
1352
|
+
}
|
|
1353
|
+
//#endregion
|
|
1328
1354
|
//#region lib/types/prompts.js
|
|
1329
1355
|
/**
|
|
1330
1356
|
* Review and curation prompts adapted from Hermes Agent
|
|
@@ -2081,14 +2107,15 @@ function scanMemoryThreats(text, maxScanChars = 65536, options = NO_SCAN_OPTIONS
|
|
|
2081
2107
|
const { blocked, findings } = evaluateThreat(text, "strict", maxScanChars, options);
|
|
2082
2108
|
if (!blocked) return null;
|
|
2083
2109
|
const pattern = findings.find((f) => f.category !== "unicode_obfuscation");
|
|
2084
|
-
|
|
2085
|
-
return
|
|
2110
|
+
const exemptionHint = " A deployment that needs a specific label can exempt it via threatExemptLabels (see the README env/dial reference).";
|
|
2111
|
+
if (pattern) return `Blocked by security scan (${pattern.label}). Rephrase without instruction-like language.${exemptionHint}`;
|
|
2112
|
+
return `Blocked by security scan: invisible or potentially malicious Unicode detected.${exemptionHint}`;
|
|
2086
2113
|
}
|
|
2087
2114
|
/** User-facing block message for skill content writes. */
|
|
2088
2115
|
function scanContentThreats(text, maxScanChars = 65536, options = NO_SCAN_OPTIONS) {
|
|
2089
2116
|
const { blocked, findings } = evaluateThreat(text, "strict", maxScanChars, options);
|
|
2090
2117
|
if (!blocked) return null;
|
|
2091
|
-
return `Blocked by security scan (${findings[0]?.label ?? "unknown"}). This content appears to contain potentially malicious instructions.`;
|
|
2118
|
+
return `Blocked by security scan (${findings[0]?.label ?? "unknown"}). This content appears to contain potentially malicious instructions. Installations with a known-innocent label can exempt it via threatExemptLabels (README dial reference).`;
|
|
2092
2119
|
}
|
|
2093
2120
|
/**
|
|
2094
2121
|
* V10-03 (P2-18): suffix the SkillLibrary/MemoryStore write gates append to a
|
|
@@ -2736,7 +2763,7 @@ async function recordMutation(root, io, record, cap = 500) {
|
|
|
2736
2763
|
function composePresetComposition(standardComposition, deltaComposition) {
|
|
2737
2764
|
const standardIds = compositionRowIds(standardComposition);
|
|
2738
2765
|
const collisions = [...compositionRowIds(deltaComposition)].filter((id) => standardIds.has(id)).sort();
|
|
2739
|
-
if (collisions.length > 0 &&
|
|
2766
|
+
if (collisions.length > 0 && !allowRowCollisions()) throw new Error(`evolution preset composition: delta rows collide with runtime standard rows: ${collisions.join(", ")}`);
|
|
2740
2767
|
if (collisions.length > 0) console.warn(`evolution preset composition: warning — delta rows collide with standard rows (${collisions.join(", ")}); keeping both (DSH_EVOLUTION_ALLOW_ROW_COLLISIONS=1)`);
|
|
2741
2768
|
return injectCatalogDescriptionCap(`${standardComposition.replace(/\s+$/, "")}\n\n${deltaComposition.trim()}\n`);
|
|
2742
2769
|
}
|
|
@@ -3086,9 +3113,11 @@ function observeEvent(signal, event) {
|
|
|
3086
3113
|
return;
|
|
3087
3114
|
}
|
|
3088
3115
|
if (event.type === "tool/call") {
|
|
3116
|
+
const data = event.data;
|
|
3117
|
+
if (data === null || typeof data !== "object" || Array.isArray(data)) return;
|
|
3089
3118
|
signal.toolCalls += 1;
|
|
3090
|
-
|
|
3091
|
-
if (
|
|
3119
|
+
const name = data.name;
|
|
3120
|
+
if (name === "skill" || name === "skill_manage") signal.skillSignal = true;
|
|
3092
3121
|
}
|
|
3093
3122
|
}
|
|
3094
3123
|
/** Compute review cadence after `turn/end`. */
|
|
@@ -4122,6 +4151,9 @@ var SkillLibrary = class {
|
|
|
4122
4151
|
}
|
|
4123
4152
|
async create(name, content, origin = "foreground") {
|
|
4124
4153
|
const normalized = name.trim();
|
|
4154
|
+
return await this.serial(() => this.createCore(normalized, content, origin));
|
|
4155
|
+
}
|
|
4156
|
+
async createCore(normalized, content, origin) {
|
|
4125
4157
|
const bad = this.badName(normalized);
|
|
4126
4158
|
if (bad) return {
|
|
4127
4159
|
ok: false,
|
|
@@ -4859,9 +4891,10 @@ var SkillLibrary = class {
|
|
|
4859
4891
|
*/
|
|
4860
4892
|
async restoreFromArchive(rawName) {
|
|
4861
4893
|
const name = rawName.trim();
|
|
4862
|
-
|
|
4894
|
+
const bad = this.badName(name);
|
|
4895
|
+
if (bad) return {
|
|
4863
4896
|
ok: false,
|
|
4864
|
-
message:
|
|
4897
|
+
message: bad
|
|
4865
4898
|
};
|
|
4866
4899
|
if (await this.io.exists(join(this.dirOf(name), "SKILL.md"))) return {
|
|
4867
4900
|
ok: false,
|
|
@@ -4990,6 +5023,9 @@ var SkillLibrary = class {
|
|
|
4990
5023
|
}
|
|
4991
5024
|
async removeSupportFile(rawName, filePath, origin = "foreground") {
|
|
4992
5025
|
const name = rawName.trim();
|
|
5026
|
+
return await this.serial(() => this.removeSupportFileCore(name, filePath, origin));
|
|
5027
|
+
}
|
|
5028
|
+
async removeSupportFileCore(name, filePath, origin) {
|
|
4993
5029
|
const badName = this.badName(name);
|
|
4994
5030
|
if (badName) return {
|
|
4995
5031
|
ok: false,
|
|
@@ -5041,36 +5077,41 @@ var SkillLibrary = class {
|
|
|
5041
5077
|
const stamp = (/* @__PURE__ */ new Date()).toISOString().replace(/[:.]/g, "-");
|
|
5042
5078
|
let dest = join(backupRoot, `skills-${stamp}`);
|
|
5043
5079
|
while (await this.io.exists(dest)) dest = join(backupRoot, `skills-${stamp}-${Math.random().toString(36).slice(2, 8)}`);
|
|
5044
|
-
|
|
5045
|
-
|
|
5046
|
-
await
|
|
5047
|
-
|
|
5048
|
-
|
|
5049
|
-
|
|
5050
|
-
const
|
|
5051
|
-
|
|
5052
|
-
|
|
5053
|
-
|
|
5054
|
-
|
|
5055
|
-
|
|
5056
|
-
|
|
5057
|
-
await this.io.
|
|
5058
|
-
|
|
5080
|
+
try {
|
|
5081
|
+
const names = await listNames(this.root, this.io);
|
|
5082
|
+
await Promise.all(names.map(async (name) => {
|
|
5083
|
+
await this.io.copy(this.dirOf(name), join(dest, name));
|
|
5084
|
+
}));
|
|
5085
|
+
const sidecars = [];
|
|
5086
|
+
for (const sidecar of [usageFile(this.root), suppressedFile(this.root)]) if (await this.io.exists(sidecar)) {
|
|
5087
|
+
const name = basename(sidecar);
|
|
5088
|
+
await this.io.copy(sidecar, join(dest, name));
|
|
5089
|
+
sidecars.push(name);
|
|
5090
|
+
}
|
|
5091
|
+
const archiveRoot = join(this.root, ".archive");
|
|
5092
|
+
let hasArchive = false;
|
|
5093
|
+
if (await this.io.exists(archiveRoot)) {
|
|
5094
|
+
await this.io.copy(archiveRoot, join(dest, ".archive"));
|
|
5095
|
+
hasArchive = true;
|
|
5096
|
+
}
|
|
5097
|
+
const validExtras = extras.filter((extra) => SNAPSHOT_EXTRA_NAME_RE.test(extra.name));
|
|
5098
|
+
const extraNames = validExtras.map((extra) => extra.name);
|
|
5099
|
+
await Promise.all(validExtras.map(async (extra) => {
|
|
5100
|
+
await this.io.writeText(join(dest, "extras", extra.name), extra.content);
|
|
5101
|
+
}));
|
|
5102
|
+
await this.io.writeText(join(dest, "manifest.json"), JSON.stringify({
|
|
5103
|
+
reason,
|
|
5104
|
+
createdAt: (/* @__PURE__ */ new Date()).toISOString(),
|
|
5105
|
+
skills: names,
|
|
5106
|
+
sidecars,
|
|
5107
|
+
hasArchive,
|
|
5108
|
+
extras: extraNames
|
|
5109
|
+
}, null, 2));
|
|
5110
|
+
await this.retainSnapshots(5);
|
|
5111
|
+
} catch (error) {
|
|
5112
|
+
await this.io.remove(dest).catch(() => {});
|
|
5113
|
+
throw error;
|
|
5059
5114
|
}
|
|
5060
|
-
const validExtras = extras.filter((extra) => SNAPSHOT_EXTRA_NAME_RE.test(extra.name));
|
|
5061
|
-
const extraNames = validExtras.map((extra) => extra.name);
|
|
5062
|
-
await Promise.all(validExtras.map(async (extra) => {
|
|
5063
|
-
await this.io.writeText(join(dest, "extras", extra.name), extra.content);
|
|
5064
|
-
}));
|
|
5065
|
-
await this.io.writeText(join(dest, "manifest.json"), JSON.stringify({
|
|
5066
|
-
reason,
|
|
5067
|
-
createdAt: (/* @__PURE__ */ new Date()).toISOString(),
|
|
5068
|
-
skills: names,
|
|
5069
|
-
sidecars,
|
|
5070
|
-
hasArchive,
|
|
5071
|
-
extras: extraNames
|
|
5072
|
-
}, null, 2));
|
|
5073
|
-
await this.retainSnapshots(5);
|
|
5074
5115
|
return dest;
|
|
5075
5116
|
}
|
|
5076
5117
|
/** Read and normalize a snapshot manifest; null when the file is missing or unparsable. */
|
|
@@ -5214,4 +5255,4 @@ var SkillLibrary = class {
|
|
|
5214
5255
|
}
|
|
5215
5256
|
};
|
|
5216
5257
|
//#endregion
|
|
5217
|
-
export { AUTHORING_DESCRIPTION_BAR, COMBINED_REVIEW_PLAN_PROMPT, COMBINED_REVIEW_PROMPT, COMPLETION_SKILL_REVIEW_PROMPT, CURATOR_DRY_RUN_BANNER, CURATOR_PROMPT, DEFAULT_ARCHIVE_AFTER_DAYS, DEFAULT_CONSOLIDATION_FAILURES, DEFAULT_CURATOR_INTERVAL_HOURS, DEFAULT_HEALTH_THRESHOLDS, DEFAULT_MAX_OPS_PER_PLAN, DEFAULT_MEMORY_CHAR_LIMIT, DEFAULT_MIN_IDLE_HOURS, DEFAULT_MUTATION_CAP, DEFAULT_REVIEW_MEMORY_INTERVAL, DEFAULT_REVIEW_SKILL_INTERVAL, DEFAULT_SKILL_CONTENT_CHARS, DEFAULT_SKILL_LIMITS, DEFAULT_SKILL_REVIEW_COMPLETION_MIN_TOOL_CALLS, DEFAULT_SKILL_REVIEW_TRIGGER, DEFAULT_STALE_AFTER_DAYS, DEFAULT_SUBSTANTIVE_MIN_AGENT_CHARS, DEFAULT_SUBSTANTIVE_MIN_TOOL_CALLS, DEFAULT_SUBSTANTIVE_MIN_USER_CHARS, DEFAULT_USER_CHAR_LIMIT, DRIFT_MAX_LINE_CHARS, DRIFT_SIGNALS_VERSION, DRIFT_SIGNAL_NOUNS, DSH_AUTHORING_STANDARDS, ENTRY_DELIMITER, EVENT_ARCHIVE_PREFIX, EVENT_LOG_RETAIN_ARCHIVES, EVENT_LOG_ROTATE_AT, EVENT_LOG_VERSION, EVOLUTION_WRITE_TOOLS, EvolutionGateSet, FORBIDDEN_CONTROL_KEYS, HEALTH_STAMP_RE, LOW_QUALITY_THRESHOLD, MAINTAIN_OUTPUT_INSTRUCTION, MAINTAIN_PROMPT, MAX_DESCRIPTION_LENGTH, MAX_RESTRUCTURE_MOVES, MAX_SKILL_CONTENT_CHARS, MAX_SKILL_FILE_BYTES, MAX_SKILL_NAME_LENGTH, MEMORY_REVIEW_PROMPT, MIN_STAMP_BODY_CHARS, MUTATIONS_FILE_VERSION, MemoryStore, PATTERN_OVERLAP, PROMPT_BUNDLE, PROMPT_BUNDLE_ID, PROMPT_BUNDLE_VERSION, PROTECTED_BUILTIN_SKILLS, QUALITY_WEIGHTS, RESTRUCTURE_TARGET_RE, SKILLS_GUIDANCE, SKILL_NAME_RE, SKILL_REVIEW_PLAN_PROMPT, SKILL_REVIEW_PROMPT, SNAPSHOT_EXTRA_NAME_RE, SUPPORT_DIRS, SUPPRESSED_FILE_VERSION, SkillLibrary, THREAT_EXEMPT_HINT, advanceReview, appendEvolutionEvent, applyCuratorFields, applyCuratorLifecycleFields, applyCuratorMetaFields, assessStructureHealth, authoringFeedback, buildCuratorRunReport, buildLearnPrompt, bumpPatch, bumpUse, bumpView, clampedNumber, composePresetComposition, computeDedupGroups, computeDriftSignals, computeLifecycleTransitions, computePrefixClusters, computeQualityScores, computeScopeView, contentHash, createGateSet, duplicateHeadings, emptyRecord, evaluateThreat, eventsFile, evolutionHome, evolutionIoAdapter, evolutionRoot, findDriftSignal, foldCuratorFields, foldTurn, frontmatterBlock, frontmatterYamlUnsafeValues, getRecord, latestActivityAt, lifecycleCandidate, listEventArchives, loadMutations, loadSuppressedNames, loadUsage, makeSerialQueue, markAgentCreated, markerEntryName, memoryRoot, missingSupportPointers, mutateUsage, mutationsFile, narrowNameMatches, nodeEvolutionIo, normalizeFrontmatter, normalizeUsageRecord, observeEvent, overlongLines, parseCuratorNominations, parseEvolutionEvents, parseFrontmatter, pendingSelfCleanup, readEvolutionEvents, readEvolutionTimeline, recordMutation, redactSecrets, relatedSkillNames, renameWithRetry, renderCuratorReportMarkdown, resolveOrigins, resolveSkillsRoot, retainEventArchives, reviewPrompt, saveSuppressedNames, saveUsage, scanContentThreats, scanMemoryThreats, scanThreats, skillsRoot, suppressedFile, transactIo, updateSuppressedNames, usageFile, usageObserved, validateFrontmatter, verifyPromptBundle, writeDurableTmp, yamlPlainScalarNeedsQuotes };
|
|
5258
|
+
export { AUTHORING_DESCRIPTION_BAR, COMBINED_REVIEW_PLAN_PROMPT, COMBINED_REVIEW_PROMPT, COMPLETION_SKILL_REVIEW_PROMPT, CURATOR_DRY_RUN_BANNER, CURATOR_PROMPT, DEFAULT_ARCHIVE_AFTER_DAYS, DEFAULT_CONSOLIDATION_FAILURES, DEFAULT_CURATOR_INTERVAL_HOURS, DEFAULT_HEALTH_THRESHOLDS, DEFAULT_MAX_OPS_PER_PLAN, DEFAULT_MEMORY_CHAR_LIMIT, DEFAULT_MIN_IDLE_HOURS, DEFAULT_MUTATION_CAP, DEFAULT_REVIEW_MEMORY_INTERVAL, DEFAULT_REVIEW_SKILL_INTERVAL, DEFAULT_SKILL_CONTENT_CHARS, DEFAULT_SKILL_LIMITS, DEFAULT_SKILL_REVIEW_COMPLETION_MIN_TOOL_CALLS, DEFAULT_SKILL_REVIEW_TRIGGER, DEFAULT_STALE_AFTER_DAYS, DEFAULT_SUBSTANTIVE_MIN_AGENT_CHARS, DEFAULT_SUBSTANTIVE_MIN_TOOL_CALLS, DEFAULT_SUBSTANTIVE_MIN_USER_CHARS, DEFAULT_USER_CHAR_LIMIT, DRIFT_MAX_LINE_CHARS, DRIFT_SIGNALS_VERSION, DRIFT_SIGNAL_NOUNS, DSH_AUTHORING_STANDARDS, ENTRY_DELIMITER, EVENT_ARCHIVE_PREFIX, EVENT_LOG_RETAIN_ARCHIVES, EVENT_LOG_ROTATE_AT, EVENT_LOG_VERSION, EVOLUTION_ENV_KEYS, EVOLUTION_WRITE_TOOLS, EvolutionGateSet, FORBIDDEN_CONTROL_KEYS, HEALTH_STAMP_RE, LOW_QUALITY_THRESHOLD, MAINTAIN_OUTPUT_INSTRUCTION, MAINTAIN_PROMPT, MAX_DESCRIPTION_LENGTH, MAX_RESTRUCTURE_MOVES, MAX_SKILL_CONTENT_CHARS, MAX_SKILL_FILE_BYTES, MAX_SKILL_NAME_LENGTH, MEMORY_REVIEW_PROMPT, MIN_STAMP_BODY_CHARS, MUTATIONS_FILE_VERSION, MemoryStore, PATTERN_OVERLAP, PROMPT_BUNDLE, PROMPT_BUNDLE_ID, PROMPT_BUNDLE_VERSION, PROTECTED_BUILTIN_SKILLS, QUALITY_WEIGHTS, RESTRUCTURE_TARGET_RE, SKILLS_GUIDANCE, SKILL_NAME_RE, SKILL_REVIEW_PLAN_PROMPT, SKILL_REVIEW_PROMPT, SNAPSHOT_EXTRA_NAME_RE, SUPPORT_DIRS, SUPPRESSED_FILE_VERSION, SkillLibrary, THREAT_EXEMPT_HINT, advanceReview, allowRowCollisions, appendEvolutionEvent, applyCuratorFields, applyCuratorLifecycleFields, applyCuratorMetaFields, assessStructureHealth, authoringFeedback, buildCuratorRunReport, buildLearnPrompt, bumpPatch, bumpUse, bumpView, clampedNumber, composePresetComposition, computeDedupGroups, computeDriftSignals, computeLifecycleTransitions, computePrefixClusters, computeQualityScores, computeScopeView, contentHash, createGateSet, duplicateHeadings, emptyRecord, evaluateThreat, eventsFile, evolutionHome, evolutionIoAdapter, evolutionRoot, findDriftSignal, foldCuratorFields, foldTurn, frontmatterBlock, frontmatterYamlUnsafeValues, getRecord, latestActivityAt, lifecycleCandidate, listEventArchives, loadMutations, loadSuppressedNames, loadUsage, makeSerialQueue, markAgentCreated, markerEntryName, memoryRoot, missingSupportPointers, mutateUsage, mutationsFile, narrowNameMatches, nodeEvolutionIo, normalizeFrontmatter, normalizeUsageRecord, observeEvent, overlongLines, parseCuratorNominations, parseEvolutionEvents, parseFrontmatter, pendingSelfCleanup, readEvolutionEvents, readEvolutionTimeline, recordMutation, redactSecrets, relatedSkillNames, renameWithRetry, renderCuratorReportMarkdown, resolveOrigins, resolveSkillsRoot, retainEventArchives, reviewPrompt, saveSuppressedNames, saveUsage, scanContentThreats, scanMemoryThreats, scanThreats, skillsRoot, suppressedFile, transactIo, updateSuppressedNames, usageFile, usageObserved, validateFrontmatter, verifyPromptBundle, writeDurableTmp, yamlPlainScalarNeedsQuotes };
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Evolution environment-variable reading, single-source (WC, 0.3.56).
|
|
3
|
+
*
|
|
4
|
+
* Every `DSH_EVOLUTION_*` value the PLUGIN code reads goes through this module
|
|
5
|
+
* so the trim/whitelist patterns (v10 P2-12/13) live in exactly one place and
|
|
6
|
+
* the generated env reference can point at one behavior. Configuration-layer
|
|
7
|
+
* reads inside patch YAML `!!js` expressions (session-query path/openAt) stay
|
|
8
|
+
* in the profile config evaluation — they are NOT migrated (they are resolved
|
|
9
|
+
* at cordis config time, not plugin time) but are documented in the README
|
|
10
|
+
* env table.
|
|
11
|
+
*/
|
|
12
|
+
/** Plugin-side DSH_EVOLUTION_* keys (config-layer keys are documented separately). */
|
|
13
|
+
export declare const EVOLUTION_ENV_KEYS: readonly ["DSH_EVOLUTION_ALLOW_ROW_COLLISIONS"];
|
|
14
|
+
/** N-5 escape: `DSH_EVOLUTION_ALLOW_ROW_COLLISIONS=1` downgrades a delta-row
|
|
15
|
+
* collision from fail-loud to warn+keep-both. Any other value (including an
|
|
16
|
+
* EMPTY/whitespace string — a set-but-unset variable) keeps the fail-loud. */
|
|
17
|
+
export declare function allowRowCollisions(env?: NodeJS.ProcessEnv): boolean;
|
|
18
|
+
//# sourceMappingURL=env.d.ts.map
|
package/lib/types/index.d.ts
CHANGED
|
@@ -13,6 +13,7 @@ export * from './curator.ts';
|
|
|
13
13
|
export * from './evolution-events.ts';
|
|
14
14
|
export * from './gates.ts';
|
|
15
15
|
export * from './events.ts';
|
|
16
|
+
export * from './env.ts';
|
|
16
17
|
export * from './io.ts';
|
|
17
18
|
export * from './learn-prompt.ts';
|
|
18
19
|
export * from './memory-store.ts';
|
|
@@ -321,6 +321,7 @@ export declare class SkillLibrary {
|
|
|
321
321
|
*/
|
|
322
322
|
setPinned(name: string, pinned: boolean, origin?: WriteOrigin): Promise<SkillActionResult>;
|
|
323
323
|
create(name: string, content: string, origin?: WriteOrigin): Promise<SkillActionResult>;
|
|
324
|
+
private createCore;
|
|
324
325
|
update(rawName: string, content: string, origin?: WriteOrigin): Promise<SkillActionResult>;
|
|
325
326
|
private updateCore;
|
|
326
327
|
patch(rawName: string, oldString: string, newString: string, filePath?: string, replaceAll?: boolean, origin?: WriteOrigin): Promise<SkillActionResult>;
|
|
@@ -378,6 +379,7 @@ export declare class SkillLibrary {
|
|
|
378
379
|
writeSupportFile(rawName: string, filePath: string, content: string, origin?: WriteOrigin): Promise<SkillActionResult>;
|
|
379
380
|
private writeSupportFileCore;
|
|
380
381
|
removeSupportFile(rawName: string, filePath: string, origin?: WriteOrigin): Promise<SkillActionResult>;
|
|
382
|
+
private removeSupportFileCore;
|
|
381
383
|
/**
|
|
382
384
|
* Snapshot the recoverable skills state: active tree, usage/suppression
|
|
383
385
|
* sidecars, `.archive/` and caller-supplied extras. `extras` are opaque
|
package/package.json
CHANGED