@lmzhen/dsh-evolution-core 0.7.0 → 0.9.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/lib/index.js +247 -72
- package/lib/types/constants.d.ts +11 -1
- package/lib/types/errors.d.ts +49 -0
- package/lib/types/index.d.ts +5 -2
- package/lib/types/params.d.ts +31 -7
- package/lib/types/skill-reads.d.ts +47 -0
- package/package.json +1 -1
package/lib/index.js
CHANGED
|
@@ -374,7 +374,7 @@ function describeReferenceRewrite(plan) {
|
|
|
374
374
|
*/
|
|
375
375
|
/**
|
|
376
376
|
* Required argument names per `skill_manage` action — the SINGLE SOURCE read
|
|
377
|
-
* by the tool's argument gate (tool-skill-manage
|
|
377
|
+
* by the tool's argument gate (tool-skill-manage write-gates.ts) and the plan
|
|
378
378
|
* validator (evolution-plan-validator), so the two can never drift.
|
|
379
379
|
* OPT-05 (2026-09): the plan validator used to accept a `write_file`/
|
|
380
380
|
* `remove_file` op without `file_path` while the executor required it — the
|
|
@@ -512,6 +512,16 @@ const EVOLUTION_WRITE_TOOLS = ["memory", "skill_manage"];
|
|
|
512
512
|
* 0.3.16 (T-4): moved here from skill-store.ts so drift-signals (pure, no IO)
|
|
513
513
|
* can reference it without importing the skill-store module. */
|
|
514
514
|
const AUTHORING_DESCRIPTION_BAR = 60;
|
|
515
|
+
/** The PLATFORM's default cap on the description a skill catalog shows —
|
|
516
|
+
* `catalogDescriptionMaxLength` on the platform's `tool-skill` row (default 500).
|
|
517
|
+
*
|
|
518
|
+
* Recorded here because it is the third number in the description-length relationship, and the one
|
|
519
|
+
* that is easiest to misread as a family rule: the family's own host/all rows SET that field to
|
|
520
|
+
* `AUTHORING_DESCRIPTION_BAR` (60), so what a family deployment truncates at is the ROW's value —
|
|
521
|
+
* this default only governs compositions that do not override it. It is NOT a refusal threshold:
|
|
522
|
+
* the only refusal is `MAX_DESCRIPTION_LENGTH` / the row's `maxDescriptionLength`, and the catalog
|
|
523
|
+
* cut is a view, not a validation. See tool-skill-manage/README.md for the three-number table. */
|
|
524
|
+
const PLATFORM_CATALOG_DESCRIPTION_DEFAULT = 500;
|
|
515
525
|
/** The split hint both size refusals share (0.5.0 V1). The same sentence used to
|
|
516
526
|
* be copied into validateFrontmatter AND the patch path, and neither copy named
|
|
517
527
|
* where the content should go — the upstream cap message names the destination
|
|
@@ -2965,6 +2975,56 @@ function allowRowCollisions(env = process.env) {
|
|
|
2965
2975
|
return env.DSH_EVOLUTION_ALLOW_ROW_COLLISIONS === ALLOW_ROW_COLLISIONS;
|
|
2966
2976
|
}
|
|
2967
2977
|
//#endregion
|
|
2978
|
+
//#region lib/types/errors.js
|
|
2979
|
+
/**
|
|
2980
|
+
* THE error-code table: E-301…E-318 with the exact text each one emits (E-317 and E-318 are the
|
|
2981
|
+
* write-admission gates' own refusals).
|
|
2982
|
+
*
|
|
2983
|
+
* The codes used to be spelled out at 33 call sites across two packages, so one
|
|
2984
|
+
* code's wording could drift between the branches that answer it and nothing could
|
|
2985
|
+
* see the drift. Keys name the SCENARIO rather than the code, because a code
|
|
2986
|
+
* legitimately carries more than one text (E-301 answers pending / approve / reject
|
|
2987
|
+
* with different guidance); the code still leads every string, so model- and
|
|
2988
|
+
* user-facing output is unchanged. Interpolations are written `%aN%` and filled by
|
|
2989
|
+
* `errorText` from the values the call site used to interpolate inline.
|
|
2990
|
+
* @module @lmzhen/dsh-evolution-core
|
|
2991
|
+
*/
|
|
2992
|
+
const EVOLUTION_ERRORS = Object.freeze({
|
|
2993
|
+
"e-305-this-invocation-carries-no": "E-305: this invocation carries no agent — `%a1%` needs a session-backed call (run it from a session in the GUI or the CLI).",
|
|
2994
|
+
"e-306-this-deployment-stages-foreground": "E-306: this deployment stages foreground writes, but `/evolution %a1%` is not replayable through the skill runner — there is nothing to stage. Run it from a session whose approval policy is 'never', or set `stageForeground: false` on the evolution-approval row, then repeat the command.",
|
|
2995
|
+
"e-301-approval-service-not-mounted": "E-301: approval service not mounted — pending writes cannot be listed or replayed. Next: the evolution-approval row ships with evolution-host/evolution-all — run /evolution doctor to see which services are mounted.",
|
|
2996
|
+
"e-301-approval-service-not-mounted-2": "E-301: approval service not mounted. Next: the evolution-approval row ships with evolution-host/evolution-all — run /evolution doctor to see which services are mounted.",
|
|
2997
|
+
"e-304-the-mounted-approval-service": "E-304: the mounted approval service predates the release capability — reject the record instead.",
|
|
2998
|
+
"e-302-curator-service-not-mounted": "E-302: curator service not mounted. Next: mount the evolution-curator row (evolution-host/evolution-all) and run /evolution doctor.",
|
|
2999
|
+
"e-305-the-invocation-agent-exposes": "E-305: the invocation agent exposes neither `followup` nor `inject` — this learn request has no delivery channel.",
|
|
3000
|
+
"e-306-this-deployment-stages-foreground-2": "E-306: this deployment stages foreground writes, but this invocation carries no agent session — `/evolution restructure` would stage a record with no session attribution. Run it from a session in the GUI or the CLI, or set `stageForeground: false` on the evolution-approval row, then repeat the command.",
|
|
3001
|
+
"e-303-replay-service-not-mounted": "E-303: replay service not mounted. Next: mount the evolution-replay row (evolution-host/evolution-all) and run /evolution doctor.",
|
|
3002
|
+
"e-307-the-settings-service-could": "E-307: the settings service could not report its sections (%a1%). /evolution params needs the user layer to tell an override from a deployment value; run /evolution doctor to see which services are mounted.",
|
|
3003
|
+
"e-308-unknown-parameter-group-group": "E-308: unknown parameter group \"%a1%\" — known groups: %a2%.",
|
|
3004
|
+
"e-311-no-settings-service-is": "E-311: no settings service is mounted, so there is no user layer to write. Mount the settings row (packages/settings/settings-file) and retry; this command never edits cordis.yml — a deployment value belongs to the deployment. /evolution doctor lists the mounted services.",
|
|
3005
|
+
"e-312-error-instanceof-Error-error": "E-312: %a1% — /evolution params lists the canonical ids.",
|
|
3006
|
+
"e-313-unknown-parameter-id-evolution": "E-313: unknown parameter \"%a1%\" — /evolution params lists every registered id with its tier and user layer.",
|
|
3007
|
+
"e-314-id-is-a-deployment": "E-314: \"%a1%\" is a deployment parameter (tier %a2%, owner %a3%) — it is written in cordis.yml on its plugin or policy row, not from a session. /evolution params shows who may write each row.",
|
|
3008
|
+
"e-315-id-has-no-user": "E-315: \"%a1%\" has no user layer — owner %a2% publishes no settings namespace, so the value stays with the deployment.",
|
|
3009
|
+
"e-307-the-settings-service-could-2": "E-307: the settings service could not report its sections (%a1%). /evolution policy set needs the current revision to write safely; run /evolution doctor to see which services are mounted.",
|
|
3010
|
+
"e-316-namespace-namespace-is-not": "E-316: namespace \"%a1%\" is not registered — owner %a2% is not mounted in this composition, so its parameters cannot be written from here. /evolution params marks those rows 'unregistered'.",
|
|
3011
|
+
"e-309-revision-conflict-you-sent": "E-309: revision conflict — you sent %a1%, the document stands at %a2%. Re-read with /evolution params --json and retry.",
|
|
3012
|
+
"e-309-revision-conflict-message-Re": "E-309: revision conflict — %a1%. Re-read with /evolution params --json and retry.",
|
|
3013
|
+
"e-310-the-settings-service-refused": "E-310: the settings service refused the write: %a1% — the owning plugin's rule stands (a cross-field pair, or a cap that may only be tightened). /evolution params shows the current value.",
|
|
3014
|
+
"e-305-this-invocation-carries-no-2": "E-305: this invocation carries no agent — `%a1%` needs a session-backed call (run it from a session in the GUI or the CLI).",
|
|
3015
|
+
"e-317-skill-write-not-confirmed": "E-317: skill \"%a1%\" was not %a2% — the confirmation prompt was declined or dismissed, so nothing was written. The prompt appears on every create and bare delete; repeat the call only if the operator asks for it.",
|
|
3016
|
+
"e-318-skill-write-without-a-read": "E-318: skill \"%a1%\" was not read in this session, so this write is refused. Read it with the `skill` tool first (a read that failed does not count), then repeat the write."
|
|
3017
|
+
});
|
|
3018
|
+
/**
|
|
3019
|
+
* Render one table entry, substituting its interpolation slots.
|
|
3020
|
+
* @param id - the scenario key.
|
|
3021
|
+
* @param args - values for the entry's `%aN%` slots.
|
|
3022
|
+
* @returns the message text the call site used to spell out inline.
|
|
3023
|
+
*/
|
|
3024
|
+
function errorText(id, args = {}) {
|
|
3025
|
+
return EVOLUTION_ERRORS[id].replace(/%a(\d+)%/g, (_match, n) => String(args["a" + n] ?? ""));
|
|
3026
|
+
}
|
|
3027
|
+
//#endregion
|
|
2968
3028
|
//#region lib/types/learn-prompt.js
|
|
2969
3029
|
/**
|
|
2970
3030
|
* Open-ended `/evolution learn` prompt builder.
|
|
@@ -5852,6 +5912,89 @@ function foldTurn(session, fromSeq) {
|
|
|
5852
5912
|
return signal;
|
|
5853
5913
|
}
|
|
5854
5914
|
//#endregion
|
|
5915
|
+
//#region lib/types/skill-reads.js
|
|
5916
|
+
/**
|
|
5917
|
+
* The read-before-write RULE: which writes need a prior read, and which targets count as read.
|
|
5918
|
+
*
|
|
5919
|
+
* ONE rule for TWO enforcement points (design `dsh-evolution-write-gate-design.md` §4.2): the
|
|
5920
|
+
* tool path refuses an unread mutating write (E-318), and the plan path drops such an op from a
|
|
5921
|
+
* background review's plan. Before this module the rule lived in `evolution-review` only, so the
|
|
5922
|
+
* tool path could not see it at all.
|
|
5923
|
+
*
|
|
5924
|
+
* The READER is not here either: `tool-dispatch.collectReadSkillNames(events)` folds a session log
|
|
5925
|
+
* into the names read through a non-failed dispatch — the review's old session-shaped copy was a
|
|
5926
|
+
* line-for-line duplicate of it. What this module adds over it is the session-shaped ADAPTER
|
|
5927
|
+
* (`sessionReadSkillNames`), for the ONE caller that holds a session only STRUCTURALLY (the tool
|
|
5928
|
+
* path's gate, whose exec view may be a bare stub): it answers "which accessor, and what does an
|
|
5929
|
+
* unreadable session mean" — `undefined`, so the gate keeps its previous behavior instead of
|
|
5930
|
+
* refusing every write. The review path reads a real platform `Session` and calls the reader
|
|
5931
|
+
* directly; a fallback there would be dead code for an impossible case.
|
|
5932
|
+
*
|
|
5933
|
+
* v32 REV-06(a) is preserved by the dispatch normalizer: a skill counts as READ only when its read
|
|
5934
|
+
* did not fail, so a failed/timeout read cannot pass the gate and let a writer blind-overwrite
|
|
5935
|
+
* content the model never saw. Matching `tool/call` directly (the pre-v37 form) meant every PTC
|
|
5936
|
+
* session (`tool/ptc-dispatch*`) collected an EMPTY set, so every mutating op the model HAD read
|
|
5937
|
+
* was dropped — and nothing reported the loss.
|
|
5938
|
+
* @module @lmzhen/dsh-evolution-core
|
|
5939
|
+
*/
|
|
5940
|
+
/**
|
|
5941
|
+
* The skill names ONE session read, or `undefined` when its log is not readable.
|
|
5942
|
+
*
|
|
5943
|
+
* `undefined` is NOT an empty set: a caller that must decide (the tool path's read-before-write
|
|
5944
|
+
* gate) can then keep its previous behavior instead of refusing every write in a composition whose
|
|
5945
|
+
* session objects expose no log at all.
|
|
5946
|
+
* @param session - the session whose reads are wanted; `undefined` when the call carries none.
|
|
5947
|
+
* @returns the names read through a non-failed `skill` dispatch, or `undefined` when unreadable.
|
|
5948
|
+
*/
|
|
5949
|
+
function sessionReadSkillNames(session) {
|
|
5950
|
+
const events = session?.snapshotEvents?.();
|
|
5951
|
+
return events === void 0 ? void 0 : collectReadSkillNames(events);
|
|
5952
|
+
}
|
|
5953
|
+
/** Actions whose target must have been read first (create is authorship, so it is exempt). */
|
|
5954
|
+
const READ_REQUIRED_ACTIONS = Object.freeze([
|
|
5955
|
+
"edit",
|
|
5956
|
+
"update",
|
|
5957
|
+
"patch",
|
|
5958
|
+
"delete",
|
|
5959
|
+
"write_file",
|
|
5960
|
+
"remove_file",
|
|
5961
|
+
"restructure"
|
|
5962
|
+
]);
|
|
5963
|
+
/**
|
|
5964
|
+
* Does this one op write a skill the caller never read?
|
|
5965
|
+
*
|
|
5966
|
+
* V6-26 (0.3.37): the validator normalizes a missing action to `patch`, so a missing action is a
|
|
5967
|
+
* read-required write, never silently exempt.
|
|
5968
|
+
* @param op - one skill operation (from a tool call or a review plan).
|
|
5969
|
+
* @param readNames - names read this session, from {@link collectReadSkillNames}.
|
|
5970
|
+
* @returns true when the op is a read-required write to an unread target.
|
|
5971
|
+
*/
|
|
5972
|
+
function isUnreadWrite(op, readNames) {
|
|
5973
|
+
if (!op.name) return false;
|
|
5974
|
+
return READ_REQUIRED_ACTIONS.includes(op.action ?? "patch") && !readNames.has(op.name);
|
|
5975
|
+
}
|
|
5976
|
+
/**
|
|
5977
|
+
* Drop mutating ops whose target was not read this session, in place.
|
|
5978
|
+
*
|
|
5979
|
+
* Covers the same mutating surface Hermes guards (edit/patch/write_file/remove_file), so a
|
|
5980
|
+
* background review cannot blind-touch support files or edits of skills it never loaded.
|
|
5981
|
+
* @param ops - the plan's ops; dropped entries are removed in place.
|
|
5982
|
+
* @param readNames - names read this session.
|
|
5983
|
+
* @returns the count of dropped ops, so the plan event can report them as rejected.
|
|
5984
|
+
*/
|
|
5985
|
+
function filterUnreadSkillOps(ops, readNames) {
|
|
5986
|
+
let dropped = 0;
|
|
5987
|
+
for (let index = ops.length - 1; index >= 0; index -= 1) {
|
|
5988
|
+
const op = ops[index];
|
|
5989
|
+
if (!op) continue;
|
|
5990
|
+
if (isUnreadWrite(op, readNames)) {
|
|
5991
|
+
ops.splice(index, 1);
|
|
5992
|
+
dropped += 1;
|
|
5993
|
+
}
|
|
5994
|
+
}
|
|
5995
|
+
return dropped;
|
|
5996
|
+
}
|
|
5997
|
+
//#endregion
|
|
5855
5998
|
//#region lib/types/drift-signals.js
|
|
5856
5999
|
/**
|
|
5857
6000
|
* Library-level drift signals for the maintenance subagent (design 011).
|
|
@@ -8910,6 +9053,20 @@ function readParam(carrier, id) {
|
|
|
8910
9053
|
for (const alias of ALIASES_BY_CANONICAL[canonical] ?? []) if (record[alias] !== void 0) return record[alias];
|
|
8911
9054
|
}
|
|
8912
9055
|
/**
|
|
9056
|
+
* Chinese display name per group, one entry per line (the scripts read this block
|
|
9057
|
+
* by text, the same way they read PARAM_NAMESPACES). The raw group id is what
|
|
9058
|
+
* `--group` accepts and what the JSON face reports; this only names it on screen.
|
|
9059
|
+
*/
|
|
9060
|
+
const PARAM_GROUP_LABELS = Object.freeze({
|
|
9061
|
+
library: "技能库",
|
|
9062
|
+
"write-caps": "写入上限",
|
|
9063
|
+
review: "会话回顾",
|
|
9064
|
+
memory: "记忆",
|
|
9065
|
+
curator: "技能整理",
|
|
9066
|
+
deployment: "安装配置",
|
|
9067
|
+
internal: "内部"
|
|
9068
|
+
});
|
|
9069
|
+
/**
|
|
8913
9070
|
* The parameter registry. G1/S1.1 seeds it with the review group (G-C); the
|
|
8914
9071
|
* remaining groups land in S2.1. E3 = behaviour preference the user may change
|
|
8915
9072
|
* (live); E2 = resource or identity knob that stays with the deployment.
|
|
@@ -8923,9 +9080,9 @@ const PARAM_EXPOSURE = Object.freeze([
|
|
|
8923
9080
|
owner: "evolution-review",
|
|
8924
9081
|
applies: "live",
|
|
8925
9082
|
docAnchor: "PARAMETERS.md#review",
|
|
8926
|
-
summary: "
|
|
8927
|
-
label: "
|
|
8928
|
-
hint: "
|
|
9083
|
+
summary: "Tool calls between skill-review injections: a turn advances by its tool-call count (a turn with none counts as one), or by 1 when the turn itself used a skill.",
|
|
9084
|
+
label: "技能检查间隔",
|
|
9085
|
+
hint: "每累计多少次工具调用检查一次技能:一轮按该轮工具调用数累加(一轮没有工具调用也算 1 次),本轮本身用到技能则只算 1 次。",
|
|
8929
9086
|
control: "number",
|
|
8930
9087
|
unit: "次",
|
|
8931
9088
|
values: ""
|
|
@@ -8938,9 +9095,9 @@ const PARAM_EXPOSURE = Object.freeze([
|
|
|
8938
9095
|
owner: "evolution-review",
|
|
8939
9096
|
applies: "live",
|
|
8940
9097
|
docAnchor: "PARAMETERS.md#review",
|
|
8941
|
-
summary: "
|
|
8942
|
-
label: "
|
|
8943
|
-
hint: "
|
|
9098
|
+
summary: "Tool calls between memory-review injections: a turn advances by its tool-call count (a turn with none counts as one), or by 1 when the turn itself touched memory.",
|
|
9099
|
+
label: "记忆检查间隔",
|
|
9100
|
+
hint: "每累计多少次工具调用检查一次记忆:一轮按该轮工具调用数累加(一轮没有工具调用也算 1 次),本轮本身用到记忆则只算 1 次。",
|
|
8944
9101
|
control: "number",
|
|
8945
9102
|
unit: "次",
|
|
8946
9103
|
values: ""
|
|
@@ -8954,11 +9111,12 @@ const PARAM_EXPOSURE = Object.freeze([
|
|
|
8954
9111
|
applies: "live",
|
|
8955
9112
|
docAnchor: "PARAMETERS.md#review",
|
|
8956
9113
|
summary: "Which channel may inject a skill review (cadence, completion, both).",
|
|
8957
|
-
label: "
|
|
8958
|
-
hint: "
|
|
9114
|
+
label: "技能检查时机",
|
|
9115
|
+
hint: "什么时候检查技能:按间隔/按任务完成/两者。",
|
|
8959
9116
|
control: "select",
|
|
8960
9117
|
unit: "",
|
|
8961
|
-
values: "cadence|completion|both"
|
|
9118
|
+
values: "cadence|completion|both",
|
|
9119
|
+
valueLabels: "按间隔|按任务完成|两者"
|
|
8962
9120
|
},
|
|
8963
9121
|
{
|
|
8964
9122
|
id: "skillReviewCompletionMinToolCalls",
|
|
@@ -8969,8 +9127,8 @@ const PARAM_EXPOSURE = Object.freeze([
|
|
|
8969
9127
|
applies: "live",
|
|
8970
9128
|
docAnchor: "PARAMETERS.md#review",
|
|
8971
9129
|
summary: "Tool calls a task needs before the completion channel injects.",
|
|
8972
|
-
label: "
|
|
8973
|
-
hint: "
|
|
9130
|
+
label: "完成时的最少工具调用",
|
|
9131
|
+
hint: "选「按任务完成」时,任务至少用了几次工具才检查。",
|
|
8974
9132
|
control: "number",
|
|
8975
9133
|
unit: "次",
|
|
8976
9134
|
values: ""
|
|
@@ -8984,8 +9142,8 @@ const PARAM_EXPOSURE = Object.freeze([
|
|
|
8984
9142
|
applies: "live",
|
|
8985
9143
|
docAnchor: "PARAMETERS.md#review",
|
|
8986
9144
|
summary: "Master switch for the review plugin.",
|
|
8987
|
-
label: "
|
|
8988
|
-
hint: "
|
|
9145
|
+
label: "启用自动检查",
|
|
9146
|
+
hint: "关闭后不再自动回顾会话。",
|
|
8989
9147
|
control: "switch",
|
|
8990
9148
|
unit: "",
|
|
8991
9149
|
values: ""
|
|
@@ -8999,11 +9157,12 @@ const PARAM_EXPOSURE = Object.freeze([
|
|
|
8999
9157
|
applies: "live",
|
|
9000
9158
|
docAnchor: "PARAMETERS.md#review",
|
|
9001
9159
|
summary: "Run the review in the parent session (inject) or on a subagent.",
|
|
9002
|
-
label: "
|
|
9003
|
-
hint: "
|
|
9160
|
+
label: "运行位置",
|
|
9161
|
+
hint: "在哪里运行检查:在当前会话里/交给子代理。",
|
|
9004
9162
|
control: "select",
|
|
9005
9163
|
unit: "",
|
|
9006
|
-
values: "subagent|inject"
|
|
9164
|
+
values: "subagent|inject",
|
|
9165
|
+
valueLabels: "交给子代理|在当前会话里"
|
|
9007
9166
|
},
|
|
9008
9167
|
{
|
|
9009
9168
|
id: "reviewWakeInject",
|
|
@@ -9014,8 +9173,8 @@ const PARAM_EXPOSURE = Object.freeze([
|
|
|
9014
9173
|
applies: "live",
|
|
9015
9174
|
docAnchor: "PARAMETERS.md#review",
|
|
9016
9175
|
summary: "Deliver the deferred review as a waking follow-up message.",
|
|
9017
|
-
label: "
|
|
9018
|
-
hint: "
|
|
9176
|
+
label: "延后结果发提醒",
|
|
9177
|
+
hint: "会话空闲时,把延后的检查结果作为一条提醒发给你。",
|
|
9019
9178
|
control: "switch",
|
|
9020
9179
|
unit: "",
|
|
9021
9180
|
values: ""
|
|
@@ -9089,8 +9248,8 @@ const PARAM_EXPOSURE = Object.freeze([
|
|
|
9089
9248
|
applies: "live",
|
|
9090
9249
|
docAnchor: "PARAMETERS.md#write-caps",
|
|
9091
9250
|
summary: "Character cap on a SKILL.md body (tighten-only).",
|
|
9092
|
-
label: "
|
|
9093
|
-
hint: "
|
|
9251
|
+
label: "技能文件正文上限",
|
|
9252
|
+
hint: "技能 Markdown 正文最多多少字符(只能调小)。",
|
|
9094
9253
|
control: "number",
|
|
9095
9254
|
unit: "字符",
|
|
9096
9255
|
values: ""
|
|
@@ -9104,8 +9263,8 @@ const PARAM_EXPOSURE = Object.freeze([
|
|
|
9104
9263
|
applies: "live",
|
|
9105
9264
|
docAnchor: "PARAMETERS.md#write-caps",
|
|
9106
9265
|
summary: "Byte cap on one support file (tighten-only).",
|
|
9107
|
-
label: "
|
|
9108
|
-
hint: "
|
|
9266
|
+
label: "附带文件大小上限",
|
|
9267
|
+
hint: "技能附带文件单个最大多少字节(只能调小)。",
|
|
9109
9268
|
control: "number",
|
|
9110
9269
|
unit: "字节",
|
|
9111
9270
|
values: ""
|
|
@@ -9119,8 +9278,8 @@ const PARAM_EXPOSURE = Object.freeze([
|
|
|
9119
9278
|
applies: "live",
|
|
9120
9279
|
docAnchor: "PARAMETERS.md#write-caps",
|
|
9121
9280
|
summary: "Character cap on a skill name (tighten-only).",
|
|
9122
|
-
label: "
|
|
9123
|
-
hint: "
|
|
9281
|
+
label: "技能名长度上限",
|
|
9282
|
+
hint: "技能名最多多少字符(只能调小)。",
|
|
9124
9283
|
control: "number",
|
|
9125
9284
|
unit: "字符",
|
|
9126
9285
|
values: ""
|
|
@@ -9134,8 +9293,8 @@ const PARAM_EXPOSURE = Object.freeze([
|
|
|
9134
9293
|
applies: "live",
|
|
9135
9294
|
docAnchor: "PARAMETERS.md#write-caps",
|
|
9136
9295
|
summary: "Character cap on a skill description (tighten-only).",
|
|
9137
|
-
label: "
|
|
9138
|
-
hint: "
|
|
9296
|
+
label: "技能描述长度上限",
|
|
9297
|
+
hint: "技能描述最多多少字符(只能调小)。",
|
|
9139
9298
|
control: "number",
|
|
9140
9299
|
unit: "字符",
|
|
9141
9300
|
values: ""
|
|
@@ -9149,8 +9308,8 @@ const PARAM_EXPOSURE = Object.freeze([
|
|
|
9149
9308
|
applies: "live",
|
|
9150
9309
|
docAnchor: "PARAMETERS.md#write-caps",
|
|
9151
9310
|
summary: "Refuse a description over the authoring bar instead of advising.",
|
|
9152
|
-
label: "
|
|
9153
|
-
hint: "
|
|
9311
|
+
label: "描述不合规即拒绝",
|
|
9312
|
+
hint: "描述不符合要求时直接拒绝写入(默认只提醒)。",
|
|
9154
9313
|
control: "switch",
|
|
9155
9314
|
unit: "",
|
|
9156
9315
|
values: ""
|
|
@@ -9164,8 +9323,8 @@ const PARAM_EXPOSURE = Object.freeze([
|
|
|
9164
9323
|
applies: "live",
|
|
9165
9324
|
docAnchor: "PARAMETERS.md#write-caps",
|
|
9166
9325
|
summary: "Refuse writes whose catalog entry resolves outside the family.",
|
|
9167
|
-
label: "
|
|
9168
|
-
hint: "
|
|
9326
|
+
label: "引用外部内容即拒绝",
|
|
9327
|
+
hint: "技能引用了本插件之外的文件时拒绝写入。",
|
|
9169
9328
|
control: "switch",
|
|
9170
9329
|
unit: "",
|
|
9171
9330
|
values: ""
|
|
@@ -9179,11 +9338,12 @@ const PARAM_EXPOSURE = Object.freeze([
|
|
|
9179
9338
|
applies: "live",
|
|
9180
9339
|
docAnchor: "PARAMETERS.md#write-caps",
|
|
9181
9340
|
summary: "Refuse a move that would leave a dangling reference, or verify it.",
|
|
9182
|
-
label: "
|
|
9183
|
-
hint: "
|
|
9341
|
+
label: "引用检查方式",
|
|
9342
|
+
hint: "移动或合并技能时怎么处理引用:先检查/直接拒绝。",
|
|
9184
9343
|
control: "select",
|
|
9185
9344
|
unit: "",
|
|
9186
|
-
values: "verify|refuse"
|
|
9345
|
+
values: "verify|refuse",
|
|
9346
|
+
valueLabels: "先检查|直接拒绝"
|
|
9187
9347
|
},
|
|
9188
9348
|
{
|
|
9189
9349
|
id: "referenceRewrite",
|
|
@@ -9214,11 +9374,12 @@ const PARAM_EXPOSURE = Object.freeze([
|
|
|
9214
9374
|
applies: "live",
|
|
9215
9375
|
docAnchor: "PARAMETERS.md#write-caps",
|
|
9216
9376
|
summary: "Warn about an oversize support file, or refuse the write.",
|
|
9217
|
-
label: "
|
|
9218
|
-
hint: "
|
|
9377
|
+
label: "附带文件超限时",
|
|
9378
|
+
hint: "附带文件超出上限时:只提醒/拒绝写入。",
|
|
9219
9379
|
control: "select",
|
|
9220
9380
|
unit: "",
|
|
9221
|
-
values: "report|enforce"
|
|
9381
|
+
values: "report|enforce",
|
|
9382
|
+
valueLabels: "只提醒|拒绝写入"
|
|
9222
9383
|
},
|
|
9223
9384
|
{
|
|
9224
9385
|
id: "memoryChars",
|
|
@@ -9229,8 +9390,8 @@ const PARAM_EXPOSURE = Object.freeze([
|
|
|
9229
9390
|
applies: "live",
|
|
9230
9391
|
docAnchor: "PARAMETERS.md#memory",
|
|
9231
9392
|
summary: "Character budget the memory store enforces for MEMORY.md.",
|
|
9232
|
-
label: "
|
|
9233
|
-
hint: "
|
|
9393
|
+
label: "记忆库上限",
|
|
9394
|
+
hint: "长期记忆文件(MEMORY.md)最多多少字符。",
|
|
9234
9395
|
control: "number",
|
|
9235
9396
|
unit: "字符",
|
|
9236
9397
|
values: ""
|
|
@@ -9244,8 +9405,8 @@ const PARAM_EXPOSURE = Object.freeze([
|
|
|
9244
9405
|
applies: "live",
|
|
9245
9406
|
docAnchor: "PARAMETERS.md#memory",
|
|
9246
9407
|
summary: "Character budget the memory store enforces for USER.md.",
|
|
9247
|
-
label: "
|
|
9248
|
-
hint: "
|
|
9408
|
+
label: "用户画像上限",
|
|
9409
|
+
hint: "用户画像文件(USER.md)最多多少字符。",
|
|
9249
9410
|
control: "number",
|
|
9250
9411
|
unit: "字符",
|
|
9251
9412
|
values: ""
|
|
@@ -9269,8 +9430,8 @@ const PARAM_EXPOSURE = Object.freeze([
|
|
|
9269
9430
|
applies: "live",
|
|
9270
9431
|
docAnchor: "PARAMETERS.md#memory",
|
|
9271
9432
|
summary: "Characters of one memory entry shown in a tool result preview.",
|
|
9272
|
-
label: "
|
|
9273
|
-
hint: "
|
|
9433
|
+
label: "记忆预览长度",
|
|
9434
|
+
hint: "列表里每条记忆最多显示多少字符。",
|
|
9274
9435
|
control: "number",
|
|
9275
9436
|
unit: "字符",
|
|
9276
9437
|
values: ""
|
|
@@ -9284,8 +9445,8 @@ const PARAM_EXPOSURE = Object.freeze([
|
|
|
9284
9445
|
applies: "live",
|
|
9285
9446
|
docAnchor: "PARAMETERS.md#memory",
|
|
9286
9447
|
summary: "Prefix stored memory entries with their date heading.",
|
|
9287
|
-
label: "
|
|
9288
|
-
hint: "
|
|
9448
|
+
label: "记忆条目加日期",
|
|
9449
|
+
hint: "写入时在条目开头加上日期。",
|
|
9289
9450
|
control: "switch",
|
|
9290
9451
|
unit: "",
|
|
9291
9452
|
values: ""
|
|
@@ -9299,8 +9460,8 @@ const PARAM_EXPOSURE = Object.freeze([
|
|
|
9299
9460
|
applies: "live",
|
|
9300
9461
|
docAnchor: "PARAMETERS.md#memory",
|
|
9301
9462
|
summary: "Consolidation failures one turn tolerates before the tool gives up.",
|
|
9302
|
-
label: "
|
|
9303
|
-
hint: "
|
|
9463
|
+
label: "合并失败重试",
|
|
9464
|
+
hint: "合并记忆连续失败多少次后停止。",
|
|
9304
9465
|
control: "number",
|
|
9305
9466
|
unit: "次",
|
|
9306
9467
|
values: ""
|
|
@@ -9314,8 +9475,8 @@ const PARAM_EXPOSURE = Object.freeze([
|
|
|
9314
9475
|
applies: "live",
|
|
9315
9476
|
docAnchor: "PARAMETERS.md#curator",
|
|
9316
9477
|
summary: "Minimum hours between deterministic curation passes.",
|
|
9317
|
-
label: "
|
|
9318
|
-
hint: "
|
|
9478
|
+
label: "自动整理间隔",
|
|
9479
|
+
hint: "两次自动整理之间至少间隔多少小时。",
|
|
9319
9480
|
control: "number",
|
|
9320
9481
|
unit: "小时",
|
|
9321
9482
|
values: ""
|
|
@@ -9329,8 +9490,8 @@ const PARAM_EXPOSURE = Object.freeze([
|
|
|
9329
9490
|
applies: "live",
|
|
9330
9491
|
docAnchor: "PARAMETERS.md#curator",
|
|
9331
9492
|
summary: "Inactive days before a skill counts as stale.",
|
|
9332
|
-
label: "
|
|
9333
|
-
hint: "
|
|
9493
|
+
label: "多久没用算过时",
|
|
9494
|
+
hint: "技能连续多少天没被用到就算过时。",
|
|
9334
9495
|
control: "number",
|
|
9335
9496
|
unit: "天",
|
|
9336
9497
|
values: ""
|
|
@@ -9344,8 +9505,8 @@ const PARAM_EXPOSURE = Object.freeze([
|
|
|
9344
9505
|
applies: "live",
|
|
9345
9506
|
docAnchor: "PARAMETERS.md#curator",
|
|
9346
9507
|
summary: "Inactive days before a stale skill is archived (must be >= staleAfterDays).",
|
|
9347
|
-
label: "
|
|
9348
|
-
hint: "
|
|
9508
|
+
label: "过时后归档",
|
|
9509
|
+
hint: "过时技能再过多少天移入归档(不能小于上一项)。",
|
|
9349
9510
|
control: "number",
|
|
9350
9511
|
unit: "天",
|
|
9351
9512
|
values: ""
|
|
@@ -9359,8 +9520,8 @@ const PARAM_EXPOSURE = Object.freeze([
|
|
|
9359
9520
|
applies: "live",
|
|
9360
9521
|
docAnchor: "PARAMETERS.md#curator",
|
|
9361
9522
|
summary: "Age at which a low quality score starts warning.",
|
|
9362
|
-
label: "
|
|
9363
|
-
hint: "
|
|
9523
|
+
label: "质量偏低提醒",
|
|
9524
|
+
hint: "质量评分偏低时,从多少天开始提醒。",
|
|
9364
9525
|
control: "number",
|
|
9365
9526
|
unit: "天",
|
|
9366
9527
|
values: ""
|
|
@@ -9374,8 +9535,8 @@ const PARAM_EXPOSURE = Object.freeze([
|
|
|
9374
9535
|
applies: "live",
|
|
9375
9536
|
docAnchor: "PARAMETERS.md#curator",
|
|
9376
9537
|
summary: "Idle hours required before an automatic curation pass runs.",
|
|
9377
|
-
label: "
|
|
9378
|
-
hint: "
|
|
9538
|
+
label: "最少空闲时长",
|
|
9539
|
+
hint: "你至少多少小时没用,才运行自动整理。",
|
|
9379
9540
|
control: "number",
|
|
9380
9541
|
unit: "小时",
|
|
9381
9542
|
values: ""
|
|
@@ -9389,8 +9550,8 @@ const PARAM_EXPOSURE = Object.freeze([
|
|
|
9389
9550
|
applies: "live",
|
|
9390
9551
|
docAnchor: "PARAMETERS.md#curator",
|
|
9391
9552
|
summary: "Let the idle gate open when the activity probe is unavailable.",
|
|
9392
|
-
label: "
|
|
9393
|
-
hint: "
|
|
9553
|
+
label: "检测不到活动也运行",
|
|
9554
|
+
hint: "无法判断你是否空闲时,仍然运行自动整理。",
|
|
9394
9555
|
control: "switch",
|
|
9395
9556
|
unit: "",
|
|
9396
9557
|
values: ""
|
|
@@ -9404,8 +9565,8 @@ const PARAM_EXPOSURE = Object.freeze([
|
|
|
9404
9565
|
applies: "live",
|
|
9405
9566
|
docAnchor: "PARAMETERS.md#curator",
|
|
9406
9567
|
summary: "Enable the LLM nomination pass on top of the deterministic lifecycle.",
|
|
9407
|
-
label: "
|
|
9408
|
-
hint: "
|
|
9568
|
+
label: "用模型挑选",
|
|
9569
|
+
hint: "在固定规则之外,再用模型挑一遍候选项。",
|
|
9409
9570
|
control: "switch",
|
|
9410
9571
|
unit: "",
|
|
9411
9572
|
values: ""
|
|
@@ -9419,8 +9580,8 @@ const PARAM_EXPOSURE = Object.freeze([
|
|
|
9419
9580
|
applies: "live",
|
|
9420
9581
|
docAnchor: "PARAMETERS.md#curator",
|
|
9421
9582
|
summary: "Token budget of the curator LLM review.",
|
|
9422
|
-
label: "
|
|
9423
|
-
hint: "
|
|
9583
|
+
label: "模型处理上限",
|
|
9584
|
+
hint: "每次用模型挑选时最多消耗多少 token。",
|
|
9424
9585
|
control: "number",
|
|
9425
9586
|
unit: "token",
|
|
9426
9587
|
values: ""
|
|
@@ -9434,8 +9595,8 @@ const PARAM_EXPOSURE = Object.freeze([
|
|
|
9434
9595
|
applies: "live",
|
|
9435
9596
|
docAnchor: "PARAMETERS.md#curator",
|
|
9436
9597
|
summary: "Wall-clock bound of the curator LLM review.",
|
|
9437
|
-
label: "
|
|
9438
|
-
hint: "
|
|
9598
|
+
label: "模型处理超时",
|
|
9599
|
+
hint: "一次模型挑选最长允许运行多久。",
|
|
9439
9600
|
control: "number",
|
|
9440
9601
|
unit: "毫秒",
|
|
9441
9602
|
values: ""
|
|
@@ -9449,8 +9610,8 @@ const PARAM_EXPOSURE = Object.freeze([
|
|
|
9449
9610
|
applies: "live",
|
|
9450
9611
|
docAnchor: "PARAMETERS.md#curator",
|
|
9451
9612
|
summary: "Body character line the health view judges against.",
|
|
9452
|
-
label: "
|
|
9453
|
-
hint: "
|
|
9613
|
+
label: "正文长度参考值",
|
|
9614
|
+
hint: "技能正文超过多少字符算偏长(只用于健康提示)。",
|
|
9454
9615
|
control: "number",
|
|
9455
9616
|
unit: "字符",
|
|
9456
9617
|
values: ""
|
|
@@ -9464,8 +9625,8 @@ const PARAM_EXPOSURE = Object.freeze([
|
|
|
9464
9625
|
applies: "live",
|
|
9465
9626
|
docAnchor: "PARAMETERS.md#curator",
|
|
9466
9627
|
summary: "Stamp density per KB that flags log-like content in a body.",
|
|
9467
|
-
label: "
|
|
9468
|
-
hint: "每 KB
|
|
9628
|
+
label: "日志化判定阈值",
|
|
9629
|
+
hint: "每 KB 出现多少个时间标记,就判为「像日志」。",
|
|
9469
9630
|
control: "number",
|
|
9470
9631
|
unit: "处/KB",
|
|
9471
9632
|
values: ""
|
|
@@ -9479,8 +9640,8 @@ const PARAM_EXPOSURE = Object.freeze([
|
|
|
9479
9640
|
applies: "live",
|
|
9480
9641
|
docAnchor: "PARAMETERS.md#curator",
|
|
9481
9642
|
summary: "Patches without a read that flag a write-ghost skill.",
|
|
9482
|
-
label: "
|
|
9483
|
-
hint: "
|
|
9643
|
+
label: "只写不读判定次数",
|
|
9644
|
+
hint: "连续多少次改动都没有被读取,就判为「只写不读」。",
|
|
9484
9645
|
control: "number",
|
|
9485
9646
|
unit: "处",
|
|
9486
9647
|
values: ""
|
|
@@ -10041,6 +10202,20 @@ const PARAM_NAMESPACES = Object.freeze({
|
|
|
10041
10202
|
"tool-skill-manage": "evolution-skills"
|
|
10042
10203
|
});
|
|
10043
10204
|
/**
|
|
10205
|
+
* The settings namespace one owner package registers. The registry's map is the only
|
|
10206
|
+
* place a namespace is spelled: a package without an entry has no user layer, so a
|
|
10207
|
+
* missing entry must fail loud here instead of letting a package fall back to a
|
|
10208
|
+
* private constant that the registry never sees.
|
|
10209
|
+
* @param owner - owner package directory name (the map's key).
|
|
10210
|
+
* @returns the namespace that owner registers.
|
|
10211
|
+
* @throws when the owner has no entry in {@link PARAM_NAMESPACES}.
|
|
10212
|
+
*/
|
|
10213
|
+
function paramNamespace(owner) {
|
|
10214
|
+
const namespace = PARAM_NAMESPACES[owner];
|
|
10215
|
+
if (namespace === void 0) throw new Error("no settings namespace registered for owner `" + owner + "` (add it to PARAM_NAMESPACES)");
|
|
10216
|
+
return namespace;
|
|
10217
|
+
}
|
|
10218
|
+
/**
|
|
10044
10219
|
* G3: expose one parameter section to the user layer.
|
|
10045
10220
|
*
|
|
10046
10221
|
* Precedence stays 'user > deployment > default': the caller keeps reading its
|
|
@@ -10239,4 +10414,4 @@ function sessionAudited(ctx, sessionId, sessionScoped) {
|
|
|
10239
10414
|
return false;
|
|
10240
10415
|
}
|
|
10241
10416
|
//#endregion
|
|
10242
|
-
export { ALIVE_LOCK_TAKEOVER_MS, AUTHORING_DESCRIPTION_BAR, AUTHORING_SPLIT_LINE_CHARS, CITATION_SUPPORT_DIRS, COMBINED_REVIEW_PLAN_PROMPT, COMBINED_REVIEW_PROMPT, COMPLETION_SKILL_REVIEW_PROMPT, CONTENT_SPLIT_HINT, COST_ASCII_TOKEN_HIGH, COST_ASCII_TOKEN_LOW, COST_CJK_TOKEN_HIGH, COST_CJK_TOKEN_LOW, CURATOR_DRY_RUN_BANNER, CURATOR_PROMPT, DEAD_LOCK_TAKEOVER_MS, DEDUP_MAX_PAIR_COMPARISONS, DEFAULT_ARCHIVE_AFTER_DAYS, DEFAULT_ARCHIVE_RETENTION_POLICY, DEFAULT_CITATION_POLICY, DEFAULT_CITATION_REF_BUDGET, DEFAULT_CONSOLIDATION_FAILURES, DEFAULT_CURATOR_BOOT_GRACE_SECONDS, DEFAULT_CURATOR_INTERVAL_HOURS, DEFAULT_CURATOR_MODEL, DEFAULT_CURATOR_REVIEW_MAX_TOKENS, DEFAULT_HEALTH_THRESHOLDS, DEFAULT_MAX_OPS_PER_PLAN, DEFAULT_MEMORY_CHAR_LIMIT, DEFAULT_MEMORY_REVIEW_MODEL, DEFAULT_MIN_IDLE_HOURS, DEFAULT_MUTATION_CAP, DEFAULT_REFERENCE_REWRITE_POLICY, DEFAULT_REVIEW_CONTEXT_MESSAGES, DEFAULT_REVIEW_MEMORY_INTERVAL, DEFAULT_REVIEW_MESSAGE_CHARS, DEFAULT_REVIEW_SKILL_INTERVAL, DEFAULT_REVIEW_TIMEOUT_MS, DEFAULT_SKILL_CONTENT_CHARS, DEFAULT_SKILL_LIMITS, DEFAULT_SKILL_REVIEW_COMPLETION_MIN_TOOL_CALLS, DEFAULT_SKILL_REVIEW_MODEL, DEFAULT_SKILL_REVIEW_TRIGGER, DEFAULT_STALE_AFTER_DAYS, DEFAULT_SUBSTANTIVE_MIN_AGENT_CHARS, DEFAULT_SUBSTANTIVE_MIN_TOOL_CALLS, DEFAULT_SUBSTANTIVE_MIN_USER_CHARS, DEFAULT_SUPPORT_FILE_CHAR_POLICY, DEFAULT_SUPPORT_READ_TOOL_NAMES, DEFAULT_THREAT_MAX_SCAN_CHARS, DEFAULT_USER_CHAR_LIMIT, DISPATCH_EVENT_TYPES, DRIFT_MAX_LINE_CHARS, DRIFT_SIGNALS_VERSION, DRIFT_SIGNAL_NOUNS, DSH_AUTHORING_STANDARDS, EMPTY_LOCK_TAKEOVER_MS, ENTRY_DELIMITER, EVENT_ARCHIVE_PREFIX, EVENT_LOG_RETAIN_ARCHIVES, EVENT_LOG_ROTATE_AT, EVENT_LOG_VERSION, EVOLUTION_WRITE_TOOLS, EvolutionGateSet, FAMILY_SESSION_TOOL_NAMES, FORBIDDEN_CONTROL_KEYS, HEALTH_STAMP_RE, HOOK_LINE_RE, INSTANCE_KEYS, KEEP_LINE_RE, LOCK_BODY_RE, LOCK_SUFFIX, LOCK_TEAR_TAKEOVER_MS, LOW_QUALITY_THRESHOLD, LostWriteLock, MAINTAIN_OUTPUT_INSTRUCTION, MAINTAIN_PROMPT, MAX_DESCRIPTION_LENGTH, MAX_RESTRUCTURE_MOVES, MAX_SKILL_CONTENT_CHARS, MAX_SKILL_FILE_BYTES, MAX_SKILL_NAME_LENGTH, MAX_SUPPORT_READ_PATHS, MAX_TIMER_DELAY_MS, MEMORY_GUIDANCE_SECTION_ORDER, MEMORY_REVIEW_PROMPT, MIN_STAMP_BODY_CHARS, MUTATIONS_FILE_VERSION, MemoryStore, NATIVE_CALL_EVENT, NATIVE_RESULT_EVENT, PARAM_ALIASES, PARAM_EXPOSURE, PARAM_NAMESPACES, PATTERN_OVERLAP, PLATFORM_ESTIMATE_CHARS_PER_TOKEN, POLICY_STAGE_DEFAULTS, PROMPT_BUNDLE, PROMPT_BUNDLE_ID, PROMPT_BUNDLE_VERSION, PROTECTED_BUILTIN_SKILLS, PTC_DISPATCH_EVENT, PTC_DISPATCH_START_EVENT, QUALITY_WEIGHTS, RESTRUCTURE_TARGET_RE, SKILLS_GUIDANCE, SKILLS_GUIDANCE_SECTION_ORDER, SKILL_ACTION_REQUIRED_FIELDS, SKILL_NAME_RE, SKILL_REVIEW_PLAN_PROMPT, SKILL_REVIEW_PROMPT, SNAPSHOT_EXTRA_NAME_RE, SUPPORT_DIRS, SUPPRESSED_FILE_VERSION, SkillLibrary, THREAT_EXEMPTION_HINT, TOKEN_ASCII_WEIGHT, TOKEN_CJK_WEIGHT, ToolDispatchNormalizer, ToolDispatchPayloadError, UPSTREAM_LIMIT_CHARS_PER_TOKEN, advanceReview, allowRowCollisions, appendEvolutionEvent, applyCuratorLifecycleFields, applyCuratorMetaFields, applyReferenceRewrite, assertDispatchPayload, assertSkillsRootAliasRetired, assessStructureHealth, authoringFeedback, bodyCost, buildCuratorRunReport, buildLearnPrompt, bumpPatch, bumpSupportRead, bumpUse, bumpView, callingScope, canonicalWriteId, claimInstance, clampedNumber, clearReviewChannel, collectReadSkillNames, composePresetComposition, computeDedupGroups, computeDriftSignals, computeLifecycleTransitions, computePrefixClusters, computeQualityScores, computeScopeView, contentHash, countDispatches, createGateSet, daysSinceIso, decideTakeover, describeReferenceRewrite, duplicateHeadings, emptyRecord, evaluateThreat, eventsFile, evolutionEventPayloadIssue, evolutionHome, evolutionIoAdapter, evolutionRoot, findDriftSignal, foldCuratorFields, foldToolDispatches, foldTurn, frontmatterBlock, frontmatterCatalogInvalid, getRecord, idleDays, installParamSection, instanceClaimKey, instanceClaimedWriteSites, instanceHolder, isAbsent, isCommittedWarning, isDeprecatedParamId, isFileShapedPath, isMissingPath, isPresent, isProcessAlive, isProgramToolName, isReviewChannelSession, isSkillReadToolName, isSkillToolName, isUnknown, latestActivityAt, lifecycleCandidate, listEventArchives, loadMutations, loadRowOverrides, loadSuppressedNames, loadUsage, makeSerialQueue, mapProbe, markAgentCreated, markReviewChannel, markerEntryName, memoryRoot, missingSupportPointers, mutateUsage, mutationsFile, narrowNameMatches, neutralizePromptVariables, newSkillLibrary, nodeEvolutionIo, normalizeFrontmatter, normalizeUsageRecord, observeEvent, overlongLines, paramSectionOverrides, parseCuratorNominations, parseEvolutionEvents, parseFrontmatter, parseLockBody, pendingSelfCleanup, persistedWriteSite, persistedWriteSites, planReferenceRewrite, planRehoming, policyStageLimits, probeAbsent, probeList, probeMtime, probePresent, probeReason, probeUnknown, readDispatchSignal, readEvolutionEvents, readEvolutionTimeline, readNumberParam, readParam, recordMutation, redactSecrets, relatedSkillNames, releaseInstance, renameWithRetry, renderCuratorReportMarkdown, resolveCitations, resolveExecOrigins, resolveOrigins, resolveParamId, resolveRootConfig, resolveSkillsRoot, retainEventArchives, retirementReport, reviewPrompt, saveSuppressedNames, saveUsage, scanBodyHooks, scanContentThreats, scanMemoryThreats, scanThreats, scopedProbeReport, sessionAudited, sessionSeesFamilyTools, skillReadNameOf, skillsRoot, supportFileReadOf, suppressedFile, sweepReviewChannelSessions, tokenLineFor, transactIo, transactTaskGuard, unhookedSupportPointers, updateSuppressedNames, usageFile, usageObserved, validateFrontmatter, validateRestructureTarget, valueOr, verifyPromptBundle, writeDurableTmp, yamlPlainScalarNeedsQuotes };
|
|
10417
|
+
export { ALIVE_LOCK_TAKEOVER_MS, AUTHORING_DESCRIPTION_BAR, AUTHORING_SPLIT_LINE_CHARS, CITATION_SUPPORT_DIRS, COMBINED_REVIEW_PLAN_PROMPT, COMBINED_REVIEW_PROMPT, COMPLETION_SKILL_REVIEW_PROMPT, CONTENT_SPLIT_HINT, COST_ASCII_TOKEN_HIGH, COST_ASCII_TOKEN_LOW, COST_CJK_TOKEN_HIGH, COST_CJK_TOKEN_LOW, CURATOR_DRY_RUN_BANNER, CURATOR_PROMPT, DEAD_LOCK_TAKEOVER_MS, DEDUP_MAX_PAIR_COMPARISONS, DEFAULT_ARCHIVE_AFTER_DAYS, DEFAULT_ARCHIVE_RETENTION_POLICY, DEFAULT_CITATION_POLICY, DEFAULT_CITATION_REF_BUDGET, DEFAULT_CONSOLIDATION_FAILURES, DEFAULT_CURATOR_BOOT_GRACE_SECONDS, DEFAULT_CURATOR_INTERVAL_HOURS, DEFAULT_CURATOR_MODEL, DEFAULT_CURATOR_REVIEW_MAX_TOKENS, DEFAULT_HEALTH_THRESHOLDS, DEFAULT_MAX_OPS_PER_PLAN, DEFAULT_MEMORY_CHAR_LIMIT, DEFAULT_MEMORY_REVIEW_MODEL, DEFAULT_MIN_IDLE_HOURS, DEFAULT_MUTATION_CAP, DEFAULT_REFERENCE_REWRITE_POLICY, DEFAULT_REVIEW_CONTEXT_MESSAGES, DEFAULT_REVIEW_MEMORY_INTERVAL, DEFAULT_REVIEW_MESSAGE_CHARS, DEFAULT_REVIEW_SKILL_INTERVAL, DEFAULT_REVIEW_TIMEOUT_MS, DEFAULT_SKILL_CONTENT_CHARS, DEFAULT_SKILL_LIMITS, DEFAULT_SKILL_REVIEW_COMPLETION_MIN_TOOL_CALLS, DEFAULT_SKILL_REVIEW_MODEL, DEFAULT_SKILL_REVIEW_TRIGGER, DEFAULT_STALE_AFTER_DAYS, DEFAULT_SUBSTANTIVE_MIN_AGENT_CHARS, DEFAULT_SUBSTANTIVE_MIN_TOOL_CALLS, DEFAULT_SUBSTANTIVE_MIN_USER_CHARS, DEFAULT_SUPPORT_FILE_CHAR_POLICY, DEFAULT_SUPPORT_READ_TOOL_NAMES, DEFAULT_THREAT_MAX_SCAN_CHARS, DEFAULT_USER_CHAR_LIMIT, DISPATCH_EVENT_TYPES, DRIFT_MAX_LINE_CHARS, DRIFT_SIGNALS_VERSION, DRIFT_SIGNAL_NOUNS, DSH_AUTHORING_STANDARDS, EMPTY_LOCK_TAKEOVER_MS, ENTRY_DELIMITER, EVENT_ARCHIVE_PREFIX, EVENT_LOG_RETAIN_ARCHIVES, EVENT_LOG_ROTATE_AT, EVENT_LOG_VERSION, EVOLUTION_ERRORS, EVOLUTION_WRITE_TOOLS, EvolutionGateSet, FAMILY_SESSION_TOOL_NAMES, FORBIDDEN_CONTROL_KEYS, HEALTH_STAMP_RE, HOOK_LINE_RE, INSTANCE_KEYS, KEEP_LINE_RE, LOCK_BODY_RE, LOCK_SUFFIX, LOCK_TEAR_TAKEOVER_MS, LOW_QUALITY_THRESHOLD, LostWriteLock, MAINTAIN_OUTPUT_INSTRUCTION, MAINTAIN_PROMPT, MAX_DESCRIPTION_LENGTH, MAX_RESTRUCTURE_MOVES, MAX_SKILL_CONTENT_CHARS, MAX_SKILL_FILE_BYTES, MAX_SKILL_NAME_LENGTH, MAX_SUPPORT_READ_PATHS, MAX_TIMER_DELAY_MS, MEMORY_GUIDANCE_SECTION_ORDER, MEMORY_REVIEW_PROMPT, MIN_STAMP_BODY_CHARS, MUTATIONS_FILE_VERSION, MemoryStore, NATIVE_CALL_EVENT, NATIVE_RESULT_EVENT, PARAM_ALIASES, PARAM_EXPOSURE, PARAM_GROUP_LABELS, PARAM_NAMESPACES, PATTERN_OVERLAP, PLATFORM_CATALOG_DESCRIPTION_DEFAULT, PLATFORM_ESTIMATE_CHARS_PER_TOKEN, POLICY_STAGE_DEFAULTS, PROMPT_BUNDLE, PROMPT_BUNDLE_ID, PROMPT_BUNDLE_VERSION, PROTECTED_BUILTIN_SKILLS, PTC_DISPATCH_EVENT, PTC_DISPATCH_START_EVENT, QUALITY_WEIGHTS, READ_REQUIRED_ACTIONS, RESTRUCTURE_TARGET_RE, SKILLS_GUIDANCE, SKILLS_GUIDANCE_SECTION_ORDER, SKILL_ACTION_REQUIRED_FIELDS, SKILL_NAME_RE, SKILL_REVIEW_PLAN_PROMPT, SKILL_REVIEW_PROMPT, SNAPSHOT_EXTRA_NAME_RE, SUPPORT_DIRS, SUPPRESSED_FILE_VERSION, SkillLibrary, THREAT_EXEMPTION_HINT, TOKEN_ASCII_WEIGHT, TOKEN_CJK_WEIGHT, ToolDispatchNormalizer, ToolDispatchPayloadError, UPSTREAM_LIMIT_CHARS_PER_TOKEN, advanceReview, allowRowCollisions, appendEvolutionEvent, applyCuratorLifecycleFields, applyCuratorMetaFields, applyReferenceRewrite, assertDispatchPayload, assertSkillsRootAliasRetired, assessStructureHealth, authoringFeedback, bodyCost, buildCuratorRunReport, buildLearnPrompt, bumpPatch, bumpSupportRead, bumpUse, bumpView, callingScope, canonicalWriteId, claimInstance, clampedNumber, clearReviewChannel, collectReadSkillNames, composePresetComposition, computeDedupGroups, computeDriftSignals, computeLifecycleTransitions, computePrefixClusters, computeQualityScores, computeScopeView, contentHash, countDispatches, createGateSet, daysSinceIso, decideTakeover, describeReferenceRewrite, duplicateHeadings, emptyRecord, errorText, evaluateThreat, eventsFile, evolutionEventPayloadIssue, evolutionHome, evolutionIoAdapter, evolutionRoot, filterUnreadSkillOps, findDriftSignal, foldCuratorFields, foldToolDispatches, foldTurn, frontmatterBlock, frontmatterCatalogInvalid, getRecord, idleDays, installParamSection, instanceClaimKey, instanceClaimedWriteSites, instanceHolder, isAbsent, isCommittedWarning, isDeprecatedParamId, isFileShapedPath, isMissingPath, isPresent, isProcessAlive, isProgramToolName, isReviewChannelSession, isSkillReadToolName, isSkillToolName, isUnknown, isUnreadWrite, latestActivityAt, lifecycleCandidate, listEventArchives, loadMutations, loadRowOverrides, loadSuppressedNames, loadUsage, makeSerialQueue, mapProbe, markAgentCreated, markReviewChannel, markerEntryName, memoryRoot, missingSupportPointers, mutateUsage, mutationsFile, narrowNameMatches, neutralizePromptVariables, newSkillLibrary, nodeEvolutionIo, normalizeFrontmatter, normalizeUsageRecord, observeEvent, overlongLines, paramNamespace, paramSectionOverrides, parseCuratorNominations, parseEvolutionEvents, parseFrontmatter, parseLockBody, pendingSelfCleanup, persistedWriteSite, persistedWriteSites, planReferenceRewrite, planRehoming, policyStageLimits, probeAbsent, probeList, probeMtime, probePresent, probeReason, probeUnknown, readDispatchSignal, readEvolutionEvents, readEvolutionTimeline, readNumberParam, readParam, recordMutation, redactSecrets, relatedSkillNames, releaseInstance, renameWithRetry, renderCuratorReportMarkdown, resolveCitations, resolveExecOrigins, resolveOrigins, resolveParamId, resolveRootConfig, resolveSkillsRoot, retainEventArchives, retirementReport, reviewPrompt, saveSuppressedNames, saveUsage, scanBodyHooks, scanContentThreats, scanMemoryThreats, scanThreats, scopedProbeReport, sessionAudited, sessionReadSkillNames, sessionSeesFamilyTools, skillReadNameOf, skillsRoot, supportFileReadOf, suppressedFile, sweepReviewChannelSessions, tokenLineFor, transactIo, transactTaskGuard, unhookedSupportPointers, updateSuppressedNames, usageFile, usageObserved, validateFrontmatter, validateRestructureTarget, valueOr, verifyPromptBundle, writeDurableTmp, yamlPlainScalarNeedsQuotes };
|
package/lib/types/constants.d.ts
CHANGED
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
*/
|
|
22
22
|
/**
|
|
23
23
|
* Required argument names per `skill_manage` action — the SINGLE SOURCE read
|
|
24
|
-
* by the tool's argument gate (tool-skill-manage
|
|
24
|
+
* by the tool's argument gate (tool-skill-manage write-gates.ts) and the plan
|
|
25
25
|
* validator (evolution-plan-validator), so the two can never drift.
|
|
26
26
|
* OPT-05 (2026-09): the plan validator used to accept a `write_file`/
|
|
27
27
|
* `remove_file` op without `file_path` while the executor required it — the
|
|
@@ -128,6 +128,16 @@ export declare const EVOLUTION_WRITE_TOOLS: readonly ["memory", "skill_manage"];
|
|
|
128
128
|
* 0.3.16 (T-4): moved here from skill-store.ts so drift-signals (pure, no IO)
|
|
129
129
|
* can reference it without importing the skill-store module. */
|
|
130
130
|
export declare const AUTHORING_DESCRIPTION_BAR = 60;
|
|
131
|
+
/** The PLATFORM's default cap on the description a skill catalog shows —
|
|
132
|
+
* `catalogDescriptionMaxLength` on the platform's `tool-skill` row (default 500).
|
|
133
|
+
*
|
|
134
|
+
* Recorded here because it is the third number in the description-length relationship, and the one
|
|
135
|
+
* that is easiest to misread as a family rule: the family's own host/all rows SET that field to
|
|
136
|
+
* `AUTHORING_DESCRIPTION_BAR` (60), so what a family deployment truncates at is the ROW's value —
|
|
137
|
+
* this default only governs compositions that do not override it. It is NOT a refusal threshold:
|
|
138
|
+
* the only refusal is `MAX_DESCRIPTION_LENGTH` / the row's `maxDescriptionLength`, and the catalog
|
|
139
|
+
* cut is a view, not a validation. See tool-skill-manage/README.md for the three-number table. */
|
|
140
|
+
export declare const PLATFORM_CATALOG_DESCRIPTION_DEFAULT = 500;
|
|
131
141
|
/** The split hint both size refusals share (0.5.0 V1). The same sentence used to
|
|
132
142
|
* be copied into validateFrontmatter AND the patch path, and neither copy named
|
|
133
143
|
* where the content should go — the upstream cap message names the destination
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* THE error-code table: E-301…E-318 with the exact text each one emits (E-317 and E-318 are the
|
|
3
|
+
* write-admission gates' own refusals).
|
|
4
|
+
*
|
|
5
|
+
* The codes used to be spelled out at 33 call sites across two packages, so one
|
|
6
|
+
* code's wording could drift between the branches that answer it and nothing could
|
|
7
|
+
* see the drift. Keys name the SCENARIO rather than the code, because a code
|
|
8
|
+
* legitimately carries more than one text (E-301 answers pending / approve / reject
|
|
9
|
+
* with different guidance); the code still leads every string, so model- and
|
|
10
|
+
* user-facing output is unchanged. Interpolations are written `%aN%` and filled by
|
|
11
|
+
* `errorText` from the values the call site used to interpolate inline.
|
|
12
|
+
* @module @lmzhen/dsh-evolution-core
|
|
13
|
+
*/
|
|
14
|
+
export declare const EVOLUTION_ERRORS: Readonly<{
|
|
15
|
+
readonly 'e-305-this-invocation-carries-no': "E-305: this invocation carries no agent — `%a1%` needs a session-backed call (run it from a session in the GUI or the CLI).";
|
|
16
|
+
readonly 'e-306-this-deployment-stages-foreground': "E-306: this deployment stages foreground writes, but `/evolution %a1%` is not replayable through the skill runner — there is nothing to stage. Run it from a session whose approval policy is 'never', or set `stageForeground: false` on the evolution-approval row, then repeat the command.";
|
|
17
|
+
readonly 'e-301-approval-service-not-mounted': "E-301: approval service not mounted — pending writes cannot be listed or replayed. Next: the evolution-approval row ships with evolution-host/evolution-all — run /evolution doctor to see which services are mounted.";
|
|
18
|
+
readonly 'e-301-approval-service-not-mounted-2': "E-301: approval service not mounted. Next: the evolution-approval row ships with evolution-host/evolution-all — run /evolution doctor to see which services are mounted.";
|
|
19
|
+
readonly 'e-304-the-mounted-approval-service': "E-304: the mounted approval service predates the release capability — reject the record instead.";
|
|
20
|
+
readonly 'e-302-curator-service-not-mounted': "E-302: curator service not mounted. Next: mount the evolution-curator row (evolution-host/evolution-all) and run /evolution doctor.";
|
|
21
|
+
readonly 'e-305-the-invocation-agent-exposes': "E-305: the invocation agent exposes neither `followup` nor `inject` — this learn request has no delivery channel.";
|
|
22
|
+
readonly 'e-306-this-deployment-stages-foreground-2': "E-306: this deployment stages foreground writes, but this invocation carries no agent session — `/evolution restructure` would stage a record with no session attribution. Run it from a session in the GUI or the CLI, or set `stageForeground: false` on the evolution-approval row, then repeat the command.";
|
|
23
|
+
readonly 'e-303-replay-service-not-mounted': "E-303: replay service not mounted. Next: mount the evolution-replay row (evolution-host/evolution-all) and run /evolution doctor.";
|
|
24
|
+
readonly 'e-307-the-settings-service-could': "E-307: the settings service could not report its sections (%a1%). /evolution params needs the user layer to tell an override from a deployment value; run /evolution doctor to see which services are mounted.";
|
|
25
|
+
readonly 'e-308-unknown-parameter-group-group': "E-308: unknown parameter group \"%a1%\" — known groups: %a2%.";
|
|
26
|
+
readonly 'e-311-no-settings-service-is': "E-311: no settings service is mounted, so there is no user layer to write. Mount the settings row (packages/settings/settings-file) and retry; this command never edits cordis.yml — a deployment value belongs to the deployment. /evolution doctor lists the mounted services.";
|
|
27
|
+
readonly 'e-312-error-instanceof-Error-error': "E-312: %a1% — /evolution params lists the canonical ids.";
|
|
28
|
+
readonly 'e-313-unknown-parameter-id-evolution': "E-313: unknown parameter \"%a1%\" — /evolution params lists every registered id with its tier and user layer.";
|
|
29
|
+
readonly 'e-314-id-is-a-deployment': "E-314: \"%a1%\" is a deployment parameter (tier %a2%, owner %a3%) — it is written in cordis.yml on its plugin or policy row, not from a session. /evolution params shows who may write each row.";
|
|
30
|
+
readonly 'e-315-id-has-no-user': "E-315: \"%a1%\" has no user layer — owner %a2% publishes no settings namespace, so the value stays with the deployment.";
|
|
31
|
+
readonly 'e-307-the-settings-service-could-2': "E-307: the settings service could not report its sections (%a1%). /evolution policy set needs the current revision to write safely; run /evolution doctor to see which services are mounted.";
|
|
32
|
+
readonly 'e-316-namespace-namespace-is-not': "E-316: namespace \"%a1%\" is not registered — owner %a2% is not mounted in this composition, so its parameters cannot be written from here. /evolution params marks those rows 'unregistered'.";
|
|
33
|
+
readonly 'e-309-revision-conflict-you-sent': "E-309: revision conflict — you sent %a1%, the document stands at %a2%. Re-read with /evolution params --json and retry.";
|
|
34
|
+
readonly 'e-309-revision-conflict-message-Re': "E-309: revision conflict — %a1%. Re-read with /evolution params --json and retry.";
|
|
35
|
+
readonly 'e-310-the-settings-service-refused': "E-310: the settings service refused the write: %a1% — the owning plugin's rule stands (a cross-field pair, or a cap that may only be tightened). /evolution params shows the current value.";
|
|
36
|
+
readonly 'e-305-this-invocation-carries-no-2': "E-305: this invocation carries no agent — `%a1%` needs a session-backed call (run it from a session in the GUI or the CLI).";
|
|
37
|
+
readonly 'e-317-skill-write-not-confirmed': "E-317: skill \"%a1%\" was not %a2% — the confirmation prompt was declined or dismissed, so nothing was written. The prompt appears on every create and bare delete; repeat the call only if the operator asks for it.";
|
|
38
|
+
readonly 'e-318-skill-write-without-a-read': "E-318: skill \"%a1%\" was not read in this session, so this write is refused. Read it with the `skill` tool first (a read that failed does not count), then repeat the write.";
|
|
39
|
+
}>;
|
|
40
|
+
/** One table key. */
|
|
41
|
+
export type EvolutionErrorId = keyof typeof EVOLUTION_ERRORS;
|
|
42
|
+
/**
|
|
43
|
+
* Render one table entry, substituting its interpolation slots.
|
|
44
|
+
* @param id - the scenario key.
|
|
45
|
+
* @param args - values for the entry's `%aN%` slots.
|
|
46
|
+
* @returns the message text the call site used to spell out inline.
|
|
47
|
+
*/
|
|
48
|
+
export declare function errorText(id: EvolutionErrorId, args?: Record<string, string | number>): string;
|
|
49
|
+
//# sourceMappingURL=errors.d.ts.map
|
package/lib/types/index.d.ts
CHANGED
|
@@ -14,13 +14,14 @@
|
|
|
14
14
|
*
|
|
15
15
|
* - **Cross-cutting basics** — `state-store.ts` (env roots — the single
|
|
16
16
|
* source of DSH-home semantics), `serial.ts`, `numeric.ts`, `constants.ts`,
|
|
17
|
-
* `mutations.ts`, `events.ts`, `gates.ts
|
|
17
|
+
* `mutations.ts`, `events.ts`, `gates.ts`, `errors.ts` (the error-code table).
|
|
18
18
|
* - **Security primitives** — `threats.ts` (content threat scanner),
|
|
19
19
|
* `redact.ts` (credential masking at model boundaries). Consumers:
|
|
20
20
|
* evolution-policy/threat, both stores, review, maintenance.
|
|
21
21
|
* - **Core domain stores/logic** — `skill-store.ts` (skill tree engine +
|
|
22
22
|
* IO-seam consumer), `memory-store.ts`, `usage.ts`, `curator.ts`,
|
|
23
|
-
* `quality.ts`, `signals.ts`, `
|
|
23
|
+
* `quality.ts`, `signals.ts`, `skill-reads.ts` (the read-before-write rule, shared by the
|
|
24
|
+
* tool path and the review's plan path), `drift-signals.ts`, `skill-health.ts`,
|
|
24
25
|
* `preset-composition.ts`, `prompts.ts`, `learn-prompt.ts`,
|
|
25
26
|
* `evolution-events.ts`, `io.ts` (the ctx.evolutionIo seam itself).
|
|
26
27
|
* @module @lmzhen/dsh-evolution-core
|
|
@@ -33,6 +34,7 @@ export * from './evolution-events.ts';
|
|
|
33
34
|
export * from './gates.ts';
|
|
34
35
|
export * from './events.ts';
|
|
35
36
|
export * from './env.ts';
|
|
37
|
+
export * from './errors.ts';
|
|
36
38
|
export * from './io.ts';
|
|
37
39
|
export * from './learn-prompt.ts';
|
|
38
40
|
export * from './memory-store.ts';
|
|
@@ -49,6 +51,7 @@ export * from './write-inventory.ts';
|
|
|
49
51
|
export * from './scope.ts';
|
|
50
52
|
export * from './skill-health.ts';
|
|
51
53
|
export * from './signals.ts';
|
|
54
|
+
export * from './skill-reads.ts';
|
|
52
55
|
export * from './drift-signals.ts';
|
|
53
56
|
export * from './skill-store.ts';
|
|
54
57
|
export * from './state-store.ts';
|
package/lib/types/params.d.ts
CHANGED
|
@@ -43,6 +43,12 @@ export declare function canonicalWriteId(id: string): string;
|
|
|
43
43
|
export declare function readParam(carrier: object | undefined, id: string): unknown;
|
|
44
44
|
/** Exposure group (design §7.2): the unit a developer changes together. */
|
|
45
45
|
export type ParamGroup = 'library' | 'write-caps' | 'review' | 'memory' | 'curator' | 'deployment' | 'internal';
|
|
46
|
+
/**
|
|
47
|
+
* Chinese display name per group, one entry per line (the scripts read this block
|
|
48
|
+
* by text, the same way they read PARAM_NAMESPACES). The raw group id is what
|
|
49
|
+
* `--group` accepts and what the JSON face reports; this only names it on screen.
|
|
50
|
+
*/
|
|
51
|
+
export declare const PARAM_GROUP_LABELS: Readonly<Record<ParamGroup, string>>;
|
|
46
52
|
/** Exposure tier (design §7.1): the interface combination a parameter gets. */
|
|
47
53
|
export type ParamTier = 'E0' | 'E1' | 'E2' | 'E3' | 'E4';
|
|
48
54
|
/** Where the authoritative value lives. */
|
|
@@ -61,14 +67,17 @@ export type ParamAuthority = 'code' | 'cordis' | 'install';
|
|
|
61
67
|
* writable through the user layer (a cordis.yml change still follows the
|
|
62
68
|
* deployment's patch-reload policy).
|
|
63
69
|
*
|
|
64
|
-
* UI METADATA (0.7.0): every E3 row carries the
|
|
70
|
+
* UI METADATA (0.7.0): every E3 row carries the tail
|
|
65
71
|
* `label, hint, control, unit, values` — in that order, directly after
|
|
66
|
-
* `summary`, still one entry per line
|
|
67
|
-
*
|
|
68
|
-
*
|
|
69
|
-
*
|
|
70
|
-
*
|
|
71
|
-
* requires a non-empty
|
|
72
|
+
* `summary`, still one entry per line — plus an OPTIONAL trailing
|
|
73
|
+
* `valueLabels` (0.9.0). E3 is the only tier the settings cards render, so the
|
|
74
|
+
* card's Chinese name, help text, control kind, unit suffix and value domain
|
|
75
|
+
* come from THIS registry and nowhere else; the browser half is generated from
|
|
76
|
+
* this text (`gen-param-client-view.mjs`). Non-E3 rows must NOT carry the tail
|
|
77
|
+
* (there is no UI surface for them); `control: 'select'` requires a non-empty
|
|
78
|
+
* pipe-joined `values`, and `valueLabels` — allowed on select rows only — names
|
|
79
|
+
* those values for display, one label per value, in the same order. The stored
|
|
80
|
+
* value is never translated: only what the control shows.
|
|
72
81
|
*/
|
|
73
82
|
export interface ParamExposure {
|
|
74
83
|
id: string;
|
|
@@ -89,6 +98,11 @@ export interface ParamExposure {
|
|
|
89
98
|
unit?: string;
|
|
90
99
|
/** Pipe-joined allowed values; non-empty exactly when control is 'select'. */
|
|
91
100
|
values?: string;
|
|
101
|
+
/**
|
|
102
|
+
* Pipe-joined display names for `values`, same order and count (optional).
|
|
103
|
+
* The stored value stays the raw one; this only names it on the card.
|
|
104
|
+
*/
|
|
105
|
+
valueLabels?: string;
|
|
92
106
|
}
|
|
93
107
|
/**
|
|
94
108
|
* The parameter registry. G1/S1.1 seeds it with the review group (G-C); the
|
|
@@ -104,6 +118,16 @@ export declare const PARAM_EXPOSURE: readonly ParamExposure[];
|
|
|
104
118
|
* tool-memory, each owning its own section. A package without an entry has no
|
|
105
119
|
* user layer (its knobs stay deployment-only). */
|
|
106
120
|
export declare const PARAM_NAMESPACES: Readonly<Record<string, string>>;
|
|
121
|
+
/**
|
|
122
|
+
* The settings namespace one owner package registers. The registry's map is the only
|
|
123
|
+
* place a namespace is spelled: a package without an entry has no user layer, so a
|
|
124
|
+
* missing entry must fail loud here instead of letting a package fall back to a
|
|
125
|
+
* private constant that the registry never sees.
|
|
126
|
+
* @param owner - owner package directory name (the map's key).
|
|
127
|
+
* @returns the namespace that owner registers.
|
|
128
|
+
* @throws when the owner has no entry in {@link PARAM_NAMESPACES}.
|
|
129
|
+
*/
|
|
130
|
+
export declare function paramNamespace(owner: string): string;
|
|
107
131
|
/** Structural view of one registered settings scope (platform Service Definition).
|
|
108
132
|
* Declared locally so this module keeps its zero-import, zero-dependency shape. */
|
|
109
133
|
interface SettingsScopeLike {
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
/** The session-log accessor the platform exposes (0.1.5 on; `session.events` before it). */
|
|
2
|
+
export interface EvolutionSessionLogView {
|
|
3
|
+
/** @returns the session's events, oldest first. */
|
|
4
|
+
snapshotEvents?: () => Iterable<{
|
|
5
|
+
type: string;
|
|
6
|
+
data?: unknown;
|
|
7
|
+
}>;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* The skill names ONE session read, or `undefined` when its log is not readable.
|
|
11
|
+
*
|
|
12
|
+
* `undefined` is NOT an empty set: a caller that must decide (the tool path's read-before-write
|
|
13
|
+
* gate) can then keep its previous behavior instead of refusing every write in a composition whose
|
|
14
|
+
* session objects expose no log at all.
|
|
15
|
+
* @param session - the session whose reads are wanted; `undefined` when the call carries none.
|
|
16
|
+
* @returns the names read through a non-failed `skill` dispatch, or `undefined` when unreadable.
|
|
17
|
+
*/
|
|
18
|
+
export declare function sessionReadSkillNames(session: EvolutionSessionLogView | undefined): ReadonlySet<string> | undefined;
|
|
19
|
+
/** Actions whose target must have been read first (create is authorship, so it is exempt). */
|
|
20
|
+
export declare const READ_REQUIRED_ACTIONS: readonly string[];
|
|
21
|
+
/**
|
|
22
|
+
* Does this one op write a skill the caller never read?
|
|
23
|
+
*
|
|
24
|
+
* V6-26 (0.3.37): the validator normalizes a missing action to `patch`, so a missing action is a
|
|
25
|
+
* read-required write, never silently exempt.
|
|
26
|
+
* @param op - one skill operation (from a tool call or a review plan).
|
|
27
|
+
* @param readNames - names read this session, from {@link collectReadSkillNames}.
|
|
28
|
+
* @returns true when the op is a read-required write to an unread target.
|
|
29
|
+
*/
|
|
30
|
+
export declare function isUnreadWrite(op: {
|
|
31
|
+
action?: string;
|
|
32
|
+
name?: string;
|
|
33
|
+
}, readNames: ReadonlySet<string>): boolean;
|
|
34
|
+
/**
|
|
35
|
+
* Drop mutating ops whose target was not read this session, in place.
|
|
36
|
+
*
|
|
37
|
+
* Covers the same mutating surface Hermes guards (edit/patch/write_file/remove_file), so a
|
|
38
|
+
* background review cannot blind-touch support files or edits of skills it never loaded.
|
|
39
|
+
* @param ops - the plan's ops; dropped entries are removed in place.
|
|
40
|
+
* @param readNames - names read this session.
|
|
41
|
+
* @returns the count of dropped ops, so the plan event can report them as rejected.
|
|
42
|
+
*/
|
|
43
|
+
export declare function filterUnreadSkillOps(ops: Array<{
|
|
44
|
+
action?: string;
|
|
45
|
+
name?: string;
|
|
46
|
+
}>, readNames: ReadonlySet<string>): number;
|
|
47
|
+
//# sourceMappingURL=skill-reads.d.ts.map
|
package/package.json
CHANGED