@lmzhen/dsh-evolution-core 0.32.5 → 0.32.6

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/README.md CHANGED
@@ -1,69 +1,55 @@
1
1
  # @lmzhen/dsh-evolution-core
2
2
 
3
- > 内部引擎,支撑记忆、技能、历史、恢复和审批。
3
+ Shared library for the evolution family: skill and memory stores, write kernels and mutation units, prompts, projections, event types, composition helpers, HTTP route helpers, history, recovery, and parameter definitions.
4
4
 
5
- ## 你会看到
5
+ The root entry is a library, not a user-facing command. The package also exposes `./composition`, `./subagent`, `./http-routes`, and `./restrictor` subpaths.
6
6
 
7
- 没有直接入口;用户看到的是记忆、技能、历史和撤销。
8
-
9
- ## 什么时候会用到
10
-
11
- 每次 Agent 写记忆/技能、看历史、恢复时。
12
-
13
- ## 默认 / 前提
14
-
15
- 随 all/host/分层安装自动工作。
16
-
17
- ## 边界
18
-
19
- 普通用户不需要知道其中的事务/状态机。
20
-
21
- ## 维护者参考(用户可跳过)
7
+ `./restrictor` is a function plugin for restricted presets. It requires a `presetId` and a non-empty `allow` or `deny` set, then applies `tools.restrict()` in matching child-agent scopes. It constrains inherited tools, not the preset mount scope itself.
22
8
 
23
9
  ## Events (the family's own, process-local)
24
10
 
25
- | 事件 | the `@mode` | 用途 |
11
+ | Event | the `@mode` | Purpose |
26
12
  |---|---|---|
27
- | `evolution/skill-mutated` | emit (one-way) | 技能树写入后失效目录缓存 |
28
- | `evolution/skills-refresh` | emit (one-way) | `/evolution skills refresh` 显式刷新 |
29
- | `evolution/review-scheduled` | emit (one-way) | 审查已安排 |
30
- | `evolution/review-completed` | emit (one-way) | branch 审查完成 |
31
- | `evolution/review-error` | emit (one-way) | 审查流水线失败 |
32
- | `evolution/plan-applied` | emit (one-way) | 计划执行结果 |
33
- | `evolution/memory-applied` | emit (one-way) | 记忆写入成功 |
34
- | `evolution/memory-provider-registered` | emit (one-way) | 记忆 provider 注册 |
13
+ | `evolution/skill-mutated` | emit (one-way) | Invalidate catalog state after a skill-tree write. |
14
+ | `evolution/skills-refresh` | emit (one-way) | Explicitly refresh the catalog after `/evolution skills refresh`. |
15
+ | `evolution/review-scheduled` | emit (one-way) | A review was scheduled. |
16
+ | `evolution/review-completed` | emit (one-way) | A branch review completed, including failure/timeout status when known. |
17
+ | `evolution/review-error` | emit (one-way) | The review pipeline failed. |
18
+ | `evolution/plan-applied` | emit (one-way) | A reviewed plan produced an execution result. |
19
+ | `evolution/memory-applied` | emit (one-way) | A memory write succeeded through the registry sink. |
20
+ | `evolution/memory-provider-registered` | emit (one-way) | A memory provider became available. |
35
21
 
36
- 预设 id:`evolution`、`evolution-ptc`、`evolution-cordis`、`evolution-minimal`、`evolution-reviewer-readonly`、`evolution-maintainer-readonly`。
22
+ Preset ids: `evolution`, `evolution-ptc`, `evolution-cordis`, `evolution-minimal`, `evolution-reviewer-readonly`, `evolution-maintainer-readonly`.
37
23
 
38
- ## 维护者参考:错误码表(用户可跳过)
24
+ ## Error codes
39
25
 
40
- (`E-301`–`E-326`):命令/服务不可用时的明确提示;具体文案在 `src/errors.ts`。
26
+ (`E-301`–`E-326`) identify unavailable services and command/settings failures. Exact message templates live in `src/errors.ts`.
41
27
 
42
- | 代码 | 含义 |
28
+ | Code | Meaning |
43
29
  |---|---|
44
- | `E-301` | 批准服务未挂载 |
45
- | `E-302` | 策展服务未挂载 |
46
- | `E-303` | 回放服务未挂载 |
47
- | `E-304` | 批准服务版本过旧 |
48
- | `E-305` | 调用无 agent/投递通道 |
49
- | `E-306` | 前台写入无法回放 |
50
- | `E-307` | 设置分区/修订不可读 |
51
- | `E-308` | 未知参数分组 |
52
- | `E-309` | 参数修订冲突 |
53
- | `E-310` | 设置服务拒绝写入 |
54
- | `E-311` | 无设置服务 |
55
- | `E-312` | 参数写入失败 |
56
- | `E-313` | 未知参数 id |
57
- | `E-314` | 部署参数不可从会话写 |
58
- | `E-315` | 参数无用户层 |
59
- | `E-316` | 命名空间未注册 |
60
- | `E-317` | 技能写入未确认 |
61
- | `E-318` | 技能未读先写 |
62
- | `E-319` | 确认超时取消 |
63
- | `E-320` | 无 profile home |
64
- | `E-321` | 无 evolution-io |
65
- | `E-322` | 参数跨字段约束 |
66
- | `E-323` | 子代理通道不可用 |
67
- | `E-324` | 受限 preset 不可用 |
68
- | `E-325` | Host 数据面不可用 |
69
- | `E-326` | 支撑文件未读先写 |
30
+ | `E-301` | Approval service is not mounted. |
31
+ | `E-302` | Curator service is not mounted. |
32
+ | `E-303` | Replay service is not mounted. |
33
+ | `E-304` | Approval service is too old. |
34
+ | `E-305` | Invocation has no agent or delivery channel. |
35
+ | `E-306` | Foreground write cannot be replayed. |
36
+ | `E-307` | Settings namespace or revision cannot be read. |
37
+ | `E-308` | Unknown parameter group. |
38
+ | `E-309` | Parameter revision conflict. |
39
+ | `E-310` | Settings service rejected the write. |
40
+ | `E-311` | Settings service is unavailable. |
41
+ | `E-312` | Parameter write failed. |
42
+ | `E-313` | Unknown parameter id. |
43
+ | `E-314` | Deployment parameter cannot be written from a session. |
44
+ | `E-315` | Parameter has no user layer. |
45
+ | `E-316` | Namespace is not registered. |
46
+ | `E-317` | Skill write was not confirmed. |
47
+ | `E-318` | Skill was not read before writing. |
48
+ | `E-319` | Confirmation timed out and cancelled the write. |
49
+ | `E-320` | Profile home is unavailable. |
50
+ | `E-321` | Evolution IO is unavailable. |
51
+ | `E-322` | Parameter cross-field constraint failed. |
52
+ | `E-323` | Subagent channel is unavailable. |
53
+ | `E-324` | Restricted preset is unavailable. |
54
+ | `E-325` | Host data plane is unavailable. |
55
+ | `E-326` | Support file was not read before writing. |
@@ -63,7 +63,8 @@ const HOST_ROUTES = {
63
63
  pending: "/api/dsh-evolution/approval/pending",
64
64
  preview: "/api/dsh-evolution/approval/preview",
65
65
  approve: "/api/dsh-evolution/approval/approve",
66
- reject: "/api/dsh-evolution/approval/reject"
66
+ reject: "/api/dsh-evolution/approval/reject",
67
+ release: "/api/dsh-evolution/approval/release"
67
68
  },
68
69
  skillHistory: {
69
70
  skills: "/api/dsh-evolution/skill-history/skills",
@@ -82,7 +83,11 @@ const HOST_ROUTES = {
82
83
  body: "/api/dsh-evolution/merge/body",
83
84
  history: "/api/dsh-evolution/merge/history"
84
85
  },
85
- diagnostics: { view: "/api/dsh-evolution/diagnostics" }
86
+ diagnostics: { view: "/api/dsh-evolution/diagnostics" },
87
+ settings: {
88
+ describe: "/api/dsh-evolution/settings/describe",
89
+ mutate: "/api/dsh-evolution/settings/mutate"
90
+ }
86
91
  };
87
92
  function hostSurface(ctx) {
88
93
  const connection = ctx.get("connection");
@@ -96,40 +101,111 @@ function hostSurface(ctx) {
96
101
  allowsRemoteAuthorities: connection.allowsRemoteAuthorities === true
97
102
  };
98
103
  }
99
- /**
100
- * Register the family host surface on the platform's exact-route carrier.
101
- *
102
- * The platform owns admission (Host/Origin hygiene + browserAuth + exact-route owner peer) and the
103
- * disposer is bound to the CALLING fiber, not the connection service: the connection service can
104
- * outlive a reloaded family fiber, so the family must release its own registrations on dispose.
105
- * Routes carry the audit snapshot taken at registration time (deployment-level facts only — the
106
- * exact-route handler receives a Request, not the peer identity).
107
- */
104
+ function isLoopback(address) {
105
+ const value = address ?? "";
106
+ return value === "127.0.0.1" || value === "::1" || value === "::ffff:127.0.0.1";
107
+ }
108
+ function sameOrigin(origin, host) {
109
+ if (origin === void 0) return true;
110
+ try {
111
+ const parsed = new URL(origin);
112
+ return isLoopback(parsed.hostname) && host !== void 0 && parsed.host === host;
113
+ } catch {
114
+ return false;
115
+ }
116
+ }
117
+ function nodeRoute(route) {
118
+ return {
119
+ kind: "exact",
120
+ path: route.path,
121
+ handler: async (req, res) => {
122
+ if (!isLoopback(req.socket.remoteAddress)) {
123
+ res.statusCode = 403;
124
+ res.end("forbidden");
125
+ return;
126
+ }
127
+ if (!sameOrigin(req.headers.origin, req.headers.host)) {
128
+ res.statusCode = 403;
129
+ res.end("forbidden");
130
+ return;
131
+ }
132
+ const fetchSite = req.headers["sec-fetch-site"];
133
+ if (fetchSite !== void 0 && fetchSite !== "same-origin" && fetchSite !== "none") {
134
+ res.statusCode = 403;
135
+ res.end("forbidden");
136
+ return;
137
+ }
138
+ const method = req.method ?? "GET";
139
+ if (method !== "GET" && method !== "HEAD" && !(req.headers["content-type"] ?? "").toLowerCase().startsWith("application/json")) {
140
+ res.statusCode = 415;
141
+ res.end("json required");
142
+ return;
143
+ }
144
+ try {
145
+ const chunks = [];
146
+ for await (const chunk of req) chunks.push(Buffer.isBuffer(chunk) ? chunk : Buffer.from(chunk));
147
+ const headers = new Headers();
148
+ for (const [key, value] of Object.entries(req.headers)) {
149
+ if (value === void 0) continue;
150
+ headers.set(key, Array.isArray(value) ? value.join(",") : value);
151
+ }
152
+ const request = new Request(new URL(req.url ?? "/", "http://127.0.0.1"), {
153
+ method,
154
+ headers,
155
+ ...method === "GET" || method === "HEAD" || chunks.length === 0 ? {} : { body: Buffer.concat(chunks) }
156
+ });
157
+ const response = await route.fetch(request);
158
+ res.statusCode = response.status;
159
+ response.headers.forEach((value, key) => {
160
+ try {
161
+ res.setHeader(key, value);
162
+ } catch {}
163
+ });
164
+ res.end(Buffer.from(await response.arrayBuffer()));
165
+ } catch (error) {
166
+ res.statusCode = 500;
167
+ res.end(error instanceof Error ? error.message : String(error));
168
+ }
169
+ }
170
+ };
171
+ }
108
172
  function registerHostRoutes(owner, build) {
109
173
  const injecting = owner;
110
174
  if (typeof injecting.inject !== "function") throw new Error("host routes require a context that owns inject()");
111
175
  injecting.inject(["connection"], (scope) => {
112
176
  const connection = scope.connection;
113
- if (connection === void 0 || connection.fetch === void 0 || typeof connection.fetch.register !== "function") throw new Error("connection service is mounted without fetch.register()");
114
- const register = connection.fetch.register.bind(connection.fetch);
115
177
  const routes = build({
116
178
  channel: "connection.fetch",
117
179
  principal: "owner",
118
- deploymentAllowsRemote: connection.allowsRemoteAuthorities === true
180
+ deploymentAllowsRemote: connection?.allowsRemoteAuthorities === true
119
181
  });
120
182
  for (const route of routes) if (!route.path.startsWith("/api/dsh-evolution/")) throw new Error("host route path must carry the /api/dsh-evolution/ prefix: " + route.path);
121
183
  const effect = scope.effect;
122
184
  if (typeof effect !== "function") throw new Error("connection scope has no effect() to own the registration");
185
+ if (connection?.fetch !== void 0 && typeof connection.fetch.register === "function") {
186
+ const register = connection.fetch.register.bind(connection.fetch);
187
+ effect.call(scope, () => {
188
+ const disposers = [];
189
+ try {
190
+ for (const route of routes) disposers.push(register(route));
191
+ } catch (error) {
192
+ for (const dispose of disposers) try {
193
+ dispose();
194
+ } catch {}
195
+ throw error;
196
+ }
197
+ return () => {
198
+ for (const dispose of disposers) try {
199
+ dispose();
200
+ } catch {}
201
+ };
202
+ }, "evolution-host-routes");
203
+ return;
204
+ }
205
+ const web = scope.get?.("webServer") ?? owner.get?.("webServer");
206
+ if (web === void 0 || typeof web.register !== "function") throw new Error("connection service has no fetch.register(), and webServer is not mounted for the loopback host-route bridge");
123
207
  effect.call(scope, () => {
124
- const disposers = [];
125
- try {
126
- for (const route of routes) disposers.push(register(route));
127
- } catch (error) {
128
- for (const dispose of disposers) try {
129
- dispose();
130
- } catch {}
131
- throw error;
132
- }
208
+ const disposers = routes.map((route) => web.register(nodeRoute(route)));
133
209
  return () => {
134
210
  for (const dispose of disposers) try {
135
211
  dispose();
@@ -1,2 +1,2 @@
1
- import { a as methodNotAllowed, i as json, n as MAX_REQUEST_BODY_BYTES, o as readJsonObject, r as hostSurface, s as registerHostRoutes, t as HOST_ROUTES } from "./http-routes-D1Ty6nnh.js";
1
+ import { a as methodNotAllowed, i as json, n as MAX_REQUEST_BODY_BYTES, o as readJsonObject, r as hostSurface, s as registerHostRoutes, t as HOST_ROUTES } from "./http-routes-_anZVlPf.js";
2
2
  export { HOST_ROUTES, MAX_REQUEST_BODY_BYTES, hostSurface, json, methodNotAllowed, readJsonObject, registerHostRoutes };
package/lib/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import { _ as scopedPackageName, c as MAINTAINER_PRESET_ID, d as RESTRICTED_TOOLS_ROW_ID, f as RESTRICTOR_MODULE, g as scopeOfNearestManifest, p as REVIEWER_PRESET_ID, s as EVOLUTION_PRESET_IDS, u as RESTRICTED_PRESET_DISPLAY } from "./ensure-C2tUoF5U.js";
2
- import { a as methodNotAllowed, c as asRecord, i as json, l as isRecord, n as MAX_REQUEST_BODY_BYTES, o as readJsonObject, r as hostSurface, s as registerHostRoutes, t as HOST_ROUTES } from "./http-routes-D1Ty6nnh.js";
2
+ import { a as methodNotAllowed, c as asRecord, i as json, l as isRecord, n as MAX_REQUEST_BODY_BYTES, o as readJsonObject, r as hostSurface, s as registerHostRoutes, t as HOST_ROUTES } from "./http-routes-_anZVlPf.js";
3
3
  import { w as allowRowCollisions } from "./composition-3QFfEe56.js";
4
4
  import { n as errorText, t as EVOLUTION_ERRORS } from "./errors-DRZ9A187.js";
5
5
  import { createSubagentChannel, probeChannelState, subagentChannelState } from "./subagent/index.js";
@@ -9117,11 +9117,6 @@ const PLATFORM_SERVICE_PROBES = Object.freeze([
9117
9117
  feature: "the params view inherited-vs-override column",
9118
9118
  side: "host"
9119
9119
  },
9120
- {
9121
- service: "configForms",
9122
- feature: "the settings card seat (its section renders read-only without it)",
9123
- side: "client"
9124
- },
9125
9120
  {
9126
9121
  service: "evolutionApproval",
9127
9122
  feature: "pending writes: list, approve and reject from the command surface",
@@ -18017,6 +18012,33 @@ const PARAM_EXPOSURE = Object.freeze([
18017
18012
  why: "internal"
18018
18013
  }
18019
18014
  ]);
18015
+ /**
18016
+ * Register one family row's user layer on the platform settings service.
18017
+ *
18018
+ * The 0.2.x platform no longer turns a plugin Config into a settings section implicitly:
18019
+ * every row that exposes a card must call `settings.register` with its Loader entry id.
18020
+ * The owner argument is the row id, which is also the namespace the generated card binds.
18021
+ * @param ctx - host plugin context.
18022
+ * @param owner - Loader entry id / settings namespace.
18023
+ * @param schema - the row's Config schema (schemastery).
18024
+ */
18025
+ function registerOwnerSettings(ctx, owner, schema) {
18026
+ const register = (scope) => {
18027
+ const settings = scope.settings;
18028
+ if (typeof settings?.register !== "function") return;
18029
+ try {
18030
+ settings.register(owner, schema);
18031
+ } catch (error) {
18032
+ ctx.logger?.warn?.(`evolution settings: register(${owner}) failed: ${error instanceof Error ? error.message : String(error)}`);
18033
+ }
18034
+ };
18035
+ const direct = ctx.get?.("settings");
18036
+ if (direct !== void 0) {
18037
+ register({ settings: direct });
18038
+ return;
18039
+ }
18040
+ ctx.inject?.(["settings"], register);
18041
+ }
18020
18042
  /** The settings namespace each OWNER PACKAGE registers (design §7.2).
18021
18043
  *
18022
18044
  * Keyed by owner rather than by group because a namespace has exactly one
@@ -18609,4 +18631,4 @@ function isIgnorableEvent(event) {
18609
18631
  return classifySessionEvent(event) !== "model";
18610
18632
  }
18611
18633
  //#endregion
18612
- export { AUTHORING_DESCRIPTION_BAR, AUTHORING_SPLIT_LINE_CHARS, BASELINE_ACTION, 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, DEDUP_MAX_PAIR_COMPARISONS, DEDUP_SIMILARITY_THRESHOLD, DEFAULT_ADMISSION, 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_MEMORY_CHAR_LIMIT, DEFAULT_MIN_IDLE_HOURS, DEFAULT_MUTATION_CAP, DEFAULT_PROBE_TIMEOUT_MS, 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_RUN_RECORDS, DEFAULT_SKILL_CONTENT_CHARS, DEFAULT_SKILL_LIMITS, DEFAULT_SKILL_REVIEW_COMPLETION_MIN_TOOL_CALLS, DEFAULT_SKILL_REVIEW_TRIGGER, DEFAULT_SKILL_VERSION_KEEP, 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, DEFAULT_WRITE_CONFIRM_MODE, DEFAULT_WRITE_CONFIRM_TIMEOUT_SECONDS, DIAGNOSTICS_FACT_KEYS, DIAGNOSTICS_RUNTIME_KEYS, DIAGNOSTICS_VIEW_SCHEMA_VERSION, DISPATCH_EVENT_TYPES, 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_ERRORS, EVOLUTION_PRESET_IDS, EVOLUTION_WRITE_TOOLS, EXTRACT_PROMPT_HASH, EXTRACT_PROMPT_V1, EXTRACT_PROMPT_VERSION, EvolutionGateSet, FAMILY_SESSION_TOOL_NAMES, FORBIDDEN_CONTROL_KEYS, FUZZY_MAX_PATTERN_CHARS, FUZZY_MAX_WORK, HEALTH_STAMP_RE, HISTORY_DIR, HISTORY_INDEX_VERSION, HOOK_LINE_RE, HOST_ROUTES, INSTANCE_KEYS, KEEP_LINE_RE, LONG_RUNS, LOW_QUALITY_THRESHOLD, MAINTAINER_PRESET_ID, MAINTAIN_OUTPUT_INSTRUCTION, MAINTAIN_PROMPT, MAX_DESCRIPTION_LENGTH, MAX_REQUEST_BODY_BYTES, 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, MODEL_SESSION_EVENT_TYPES as MODEL_SESSION_EVENTS, MODEL_SESSION_EVENT_TYPES, MUTATIONS_FILE_VERSION, MemoryStore, MutationUnit, NAMESPACE_MIGRATIONS, 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, PLATFORM_LINE, PLATFORM_SERVICE_PROBES, 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, RESTRICTED_PRESET_DISPLAY, RESTRICTED_TOOLS_ROW_ID, RESTRICTOR_MODULE, RESTRUCTURE_TARGET_RE, RETENTION_FEEDBACK_KEEP_RATIO, RETENTION_FEEDBACK_MIN_CHARS, REVIEWER_PRESET_ID, RULES, RUNS_SCHEMA_VERSION, SKILLS_GUIDANCE, SKILLS_GUIDANCE_SECTION_ORDER, SKILL_ACTION_REQUIRED_FIELDS, SKILL_NAME_RE, SKILL_REVIEW_PLAN_PROMPT, SKILL_REVIEW_PROMPT, SNAPSHOT_EXTRA_NAME_RE, STORE_LEDGER, SUMMARY_DUPLICATE_HINT_THRESHOLD, SUPPORT_DIRS, SUPPORT_SPRAWL_FILES, SUPPRESSED_FILE_VERSION, SkillLibrary, SkillModel, TEXT_DIFF_MAX_CHARS, TEXT_DIFF_MAX_LINES, THREAT_EXEMPTION_HINT, TOKEN_ASCII_WEIGHT, TOKEN_CJK_WEIGHT, ToolDispatchNormalizer, ToolDispatchPayloadError, UNIT_JOURNAL_PHASES, UNIT_JOURNAL_SCHEMA_VERSION, UNIT_STORAGE_SCHEMA_VERSION, UNTRUSTED_LINE_BREAK, UNTRUSTED_LINE_MARK, UPSTREAM_LIMIT_CHARS_PER_TOKEN, UnitTransactions, VERSION_SUMMARY_MAX_CHARS, WriteKernel, absentHostServices, acquireTreeWriteLock, admissionVerdict, advanceReview, affinity, ageCopyKey, allowRowCollisions, anchorVerdict, appendEvolutionEvent, applyCuratorLifecycleFields, applyCuratorMetaFields, applyNamespaceMigration, applyReferenceRewrite, asRecord, assertDispatchPayload, assertSkillsRootAliasRetired, assertUnitJournalTransition, assessStructureHealth, atomicWriteFiles, authoringFeedback, authorityFrom, backupsReachability, blobPath, bodyCost, buildCuratorRunReport, buildExtractPlanFromLibrary, buildHealthBaseline, buildLearnPrompt, bumpPatch, bumpSupportRead, bumpUse, bumpView, callingScope, candidateSkills, canonicalWriteId, claimInstance, clampOnce, clampedNumber, classifyNamespaceMigration, classifySessionEvent, clearReviewChannel, collectReadSkillNames, collectReadSupportFiles, computeDedupGroups, computeDriftSignals, computeLifecycleTransitions, computePrefixClusters, computeQualityScores, computeScopeView, contentHash, contentRetentionFeedback, countDispatches, countReferenceFiles, createGateSet, createSubagentChannel, daysSinceIso, declaredReportStamp, describeReferenceRewrite, diffFindings, dispatchKeyOf, dispatchPathOf, dispatchStepOf, displayBodyOf, duplicateHeadings, elapsedSince, emptyRecord, ensureSkillFrontmatter, entryTarget, errorText, evaluateThreat, eventsFile, evidenceKindIndex, evolutionActivityProjection, evolutionEventPayloadIssue, evolutionEvidenceProjection, evolutionHome, evolutionIoAdapter, evolutionProjectionHistoryProjection, evolutionReadsProjection, evolutionRoot, evolutionSignalsProjection, executeUnitUndo, externalRefs, fileMutationLock, filterUnreadSkillOps, findDriftSignal, findOwnerCandidate, foldCuratorFields, foldToolDispatches, foldTurnEvent, foldTurnEvents, foldUntrustedLines, frontmatterBlock, frontmatterCatalogInvalid, fuzzyPatch, getRecord, h2Sections, historyIndexFile, historyReachability, historyRoot, hostSurface, identity, idleDays, initialTurnFold, installEvolutionProjections, instanceClaimKey, instanceClaimedWriteSites, instanceHolder, isAbsent, isBookkeepingFrame, isCommittedWarning, isDeprecatedParamId, isFileShapedPath, isIgnorableEvent, isLandmark, isMissingPath, isPresent, isProcessAlive, isProgramToolName, isProjectableSession, isRecord, isReviewChannelSession, isSkillReadToolName, isSkillToolName, isUnknown, isUnreadWrite, json, landmarkVerdict, latestActivityAt, latestVersionAt, lifecycleCandidate, lintBody, lintSkill, listEventArchives, liveBool, liveEnum, liveNumber, liveString, loadMutations, loadSuppressedNames, loadUsage, loadVersionContent, loadVersions, makeSerialQueue, mapProbe, markAgentCreated, markReviewChannel, markerEntryName, memoryRoot, methodNotAllowed, missingSupportPointers, mutateUsage, mutationsFile, narrowNameMatches, nearDuplicateSummaries, newRunRegistry, newSkillLibrary, nextHistoryIndex, nodeEvolutionIo, normalizeFrontmatter, normalizeUsageRecord, normalizeVersionSummary, observeEvent, orderVersions, overlongLines, ownerCandidatesFromSummaries, ownerDecisionText, paramNamespace, paramRowId, paramSettingsId, parseCuratorNominations, parseEvolutionEvents, parseFrontmatter, parseHistoryIndex, partitionVersions, payloadText, persistedWriteSite, persistedWriteSites, pickWithPolicy, planExtract, planNamespaceMigration, planReferenceRewrite, planRehoming, planUnitUndoAcross, policyStageLimits, probeAbsent, probeChannelState, probeList, probeMtime, probePresent, probeReason, probeText, probeUnknown, projectExtractBodies, projectionText, proposalFromPlan, proposalReportDir, proposalReportName, protectedSkillNamesOf, pruneTreeChangeUnits, readDispatchSignal, readEvolutionEvents, readEvolutionTimeline, readExternalSupport, readHistoryIndex, readJsonObject, readNumberParam, readParam, readProposalReports, readTreeLock, readUnitEvidence, readUnitIndex, readUnitJournal, readUnitReceipt, readUnitSnapshot, readingStats, recordMutation, recordVersions, redactSecrets, referencedBlobs, registerHostRoutes, relatedSkillNames, releaseInstance, renameWithRetry, renderCuratorReportMarkdown, renderLongRunTable, reportTime, reportsReachability, reportsSweepLockTarget, resolveCitations, resolveExecOrigins, resolveOrigins, resolveParamId, resolveRootConfig, resolveSkillsRoot, resolveUnitMembers, resolveUnitMembersFromIndexes, restructureCandidates, retainEventArchives, retirementReport, reviewPrompt, revisionAnchor, revisionAnchorOf, revisionFingerprint, revisionSupportDigest, runWriteGates, runsFile, saveSuppressedNames, saveUsage, scanBodyHooks, scanContentThreats, scanMemoryThreats, scanThreats, scopeOfNearestManifest, scopedPackageName, scopedProbeReport, selectSections, sessionAudited, sessionEvidenceIndex, sessionLastEventTime, sessionReadNames, sessionReadSkillNames, sessionReadSupportFiles, sessionSeesFamilyTools, sessionTurnSignals, skillLibraryUnitBackend, skillReadNameOf, skillRowCells, skillStateKey, skillWriteGateContext, skillsRoot, staleRouteStubs, subagentChannelState, supportFileReadFromPath, supportFileReadOf, supportRefs, suppressedFile, sweepReports, sweepReviewChannelSessions, textDiffFacts, tokenLineFor, transactIo, transactTaskGuard, treeLockFile, trimPatternBoundaries, unhookedSupportPointers, unitEvidenceDigest, unitEvidencePath, unitIndexPath, unitJournalPath, unitJournalPhaseRank, unitJournalPort, unitMembersAreComplete, unitReceiptPath, unitSnapshotPath, unitSnapshotPort, unitSnapshotsDir, unitStorageKey, unwrapLive, updateSuppressedNames, upsertUnitIndex, usageFile, usageObserved, userSetKeys, validateFrontmatter, validateMutationRequest, validateRestructureTarget, validateSupportPath, valueOr, verifyPromptBundle, versionActionKind, versionRowCells, versionSummaryPrompt, versionTarget, vocabulary, withTreeWrite, withTreeWriteLock, writeDurableTmp, writePathSymbols, writeProposalReport, writeUnitEvidence, writeUnitJournal, writeUnitReceipt, writeUnitSnapshot, yamlPlainScalarNeedsQuotes };
18634
+ export { AUTHORING_DESCRIPTION_BAR, AUTHORING_SPLIT_LINE_CHARS, BASELINE_ACTION, 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, DEDUP_MAX_PAIR_COMPARISONS, DEDUP_SIMILARITY_THRESHOLD, DEFAULT_ADMISSION, 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_MEMORY_CHAR_LIMIT, DEFAULT_MIN_IDLE_HOURS, DEFAULT_MUTATION_CAP, DEFAULT_PROBE_TIMEOUT_MS, 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_RUN_RECORDS, DEFAULT_SKILL_CONTENT_CHARS, DEFAULT_SKILL_LIMITS, DEFAULT_SKILL_REVIEW_COMPLETION_MIN_TOOL_CALLS, DEFAULT_SKILL_REVIEW_TRIGGER, DEFAULT_SKILL_VERSION_KEEP, 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, DEFAULT_WRITE_CONFIRM_MODE, DEFAULT_WRITE_CONFIRM_TIMEOUT_SECONDS, DIAGNOSTICS_FACT_KEYS, DIAGNOSTICS_RUNTIME_KEYS, DIAGNOSTICS_VIEW_SCHEMA_VERSION, DISPATCH_EVENT_TYPES, 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_ERRORS, EVOLUTION_PRESET_IDS, EVOLUTION_WRITE_TOOLS, EXTRACT_PROMPT_HASH, EXTRACT_PROMPT_V1, EXTRACT_PROMPT_VERSION, EvolutionGateSet, FAMILY_SESSION_TOOL_NAMES, FORBIDDEN_CONTROL_KEYS, FUZZY_MAX_PATTERN_CHARS, FUZZY_MAX_WORK, HEALTH_STAMP_RE, HISTORY_DIR, HISTORY_INDEX_VERSION, HOOK_LINE_RE, HOST_ROUTES, INSTANCE_KEYS, KEEP_LINE_RE, LONG_RUNS, LOW_QUALITY_THRESHOLD, MAINTAINER_PRESET_ID, MAINTAIN_OUTPUT_INSTRUCTION, MAINTAIN_PROMPT, MAX_DESCRIPTION_LENGTH, MAX_REQUEST_BODY_BYTES, 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, MODEL_SESSION_EVENT_TYPES as MODEL_SESSION_EVENTS, MODEL_SESSION_EVENT_TYPES, MUTATIONS_FILE_VERSION, MemoryStore, MutationUnit, NAMESPACE_MIGRATIONS, 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, PLATFORM_LINE, PLATFORM_SERVICE_PROBES, 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, RESTRICTED_PRESET_DISPLAY, RESTRICTED_TOOLS_ROW_ID, RESTRICTOR_MODULE, RESTRUCTURE_TARGET_RE, RETENTION_FEEDBACK_KEEP_RATIO, RETENTION_FEEDBACK_MIN_CHARS, REVIEWER_PRESET_ID, RULES, RUNS_SCHEMA_VERSION, SKILLS_GUIDANCE, SKILLS_GUIDANCE_SECTION_ORDER, SKILL_ACTION_REQUIRED_FIELDS, SKILL_NAME_RE, SKILL_REVIEW_PLAN_PROMPT, SKILL_REVIEW_PROMPT, SNAPSHOT_EXTRA_NAME_RE, STORE_LEDGER, SUMMARY_DUPLICATE_HINT_THRESHOLD, SUPPORT_DIRS, SUPPORT_SPRAWL_FILES, SUPPRESSED_FILE_VERSION, SkillLibrary, SkillModel, TEXT_DIFF_MAX_CHARS, TEXT_DIFF_MAX_LINES, THREAT_EXEMPTION_HINT, TOKEN_ASCII_WEIGHT, TOKEN_CJK_WEIGHT, ToolDispatchNormalizer, ToolDispatchPayloadError, UNIT_JOURNAL_PHASES, UNIT_JOURNAL_SCHEMA_VERSION, UNIT_STORAGE_SCHEMA_VERSION, UNTRUSTED_LINE_BREAK, UNTRUSTED_LINE_MARK, UPSTREAM_LIMIT_CHARS_PER_TOKEN, UnitTransactions, VERSION_SUMMARY_MAX_CHARS, WriteKernel, absentHostServices, acquireTreeWriteLock, admissionVerdict, advanceReview, affinity, ageCopyKey, allowRowCollisions, anchorVerdict, appendEvolutionEvent, applyCuratorLifecycleFields, applyCuratorMetaFields, applyNamespaceMigration, applyReferenceRewrite, asRecord, assertDispatchPayload, assertSkillsRootAliasRetired, assertUnitJournalTransition, assessStructureHealth, atomicWriteFiles, authoringFeedback, authorityFrom, backupsReachability, blobPath, bodyCost, buildCuratorRunReport, buildExtractPlanFromLibrary, buildHealthBaseline, buildLearnPrompt, bumpPatch, bumpSupportRead, bumpUse, bumpView, callingScope, candidateSkills, canonicalWriteId, claimInstance, clampOnce, clampedNumber, classifyNamespaceMigration, classifySessionEvent, clearReviewChannel, collectReadSkillNames, collectReadSupportFiles, computeDedupGroups, computeDriftSignals, computeLifecycleTransitions, computePrefixClusters, computeQualityScores, computeScopeView, contentHash, contentRetentionFeedback, countDispatches, countReferenceFiles, createGateSet, createSubagentChannel, daysSinceIso, declaredReportStamp, describeReferenceRewrite, diffFindings, dispatchKeyOf, dispatchPathOf, dispatchStepOf, displayBodyOf, duplicateHeadings, elapsedSince, emptyRecord, ensureSkillFrontmatter, entryTarget, errorText, evaluateThreat, eventsFile, evidenceKindIndex, evolutionActivityProjection, evolutionEventPayloadIssue, evolutionEvidenceProjection, evolutionHome, evolutionIoAdapter, evolutionProjectionHistoryProjection, evolutionReadsProjection, evolutionRoot, evolutionSignalsProjection, executeUnitUndo, externalRefs, fileMutationLock, filterUnreadSkillOps, findDriftSignal, findOwnerCandidate, foldCuratorFields, foldToolDispatches, foldTurnEvent, foldTurnEvents, foldUntrustedLines, frontmatterBlock, frontmatterCatalogInvalid, fuzzyPatch, getRecord, h2Sections, historyIndexFile, historyReachability, historyRoot, hostSurface, identity, idleDays, initialTurnFold, installEvolutionProjections, instanceClaimKey, instanceClaimedWriteSites, instanceHolder, isAbsent, isBookkeepingFrame, isCommittedWarning, isDeprecatedParamId, isFileShapedPath, isIgnorableEvent, isLandmark, isMissingPath, isPresent, isProcessAlive, isProgramToolName, isProjectableSession, isRecord, isReviewChannelSession, isSkillReadToolName, isSkillToolName, isUnknown, isUnreadWrite, json, landmarkVerdict, latestActivityAt, latestVersionAt, lifecycleCandidate, lintBody, lintSkill, listEventArchives, liveBool, liveEnum, liveNumber, liveString, loadMutations, loadSuppressedNames, loadUsage, loadVersionContent, loadVersions, makeSerialQueue, mapProbe, markAgentCreated, markReviewChannel, markerEntryName, memoryRoot, methodNotAllowed, missingSupportPointers, mutateUsage, mutationsFile, narrowNameMatches, nearDuplicateSummaries, newRunRegistry, newSkillLibrary, nextHistoryIndex, nodeEvolutionIo, normalizeFrontmatter, normalizeUsageRecord, normalizeVersionSummary, observeEvent, orderVersions, overlongLines, ownerCandidatesFromSummaries, ownerDecisionText, paramNamespace, paramRowId, paramSettingsId, parseCuratorNominations, parseEvolutionEvents, parseFrontmatter, parseHistoryIndex, partitionVersions, payloadText, persistedWriteSite, persistedWriteSites, pickWithPolicy, planExtract, planNamespaceMigration, planReferenceRewrite, planRehoming, planUnitUndoAcross, policyStageLimits, probeAbsent, probeChannelState, probeList, probeMtime, probePresent, probeReason, probeText, probeUnknown, projectExtractBodies, projectionText, proposalFromPlan, proposalReportDir, proposalReportName, protectedSkillNamesOf, pruneTreeChangeUnits, readDispatchSignal, readEvolutionEvents, readEvolutionTimeline, readExternalSupport, readHistoryIndex, readJsonObject, readNumberParam, readParam, readProposalReports, readTreeLock, readUnitEvidence, readUnitIndex, readUnitJournal, readUnitReceipt, readUnitSnapshot, readingStats, recordMutation, recordVersions, redactSecrets, referencedBlobs, registerHostRoutes, registerOwnerSettings, relatedSkillNames, releaseInstance, renameWithRetry, renderCuratorReportMarkdown, renderLongRunTable, reportTime, reportsReachability, reportsSweepLockTarget, resolveCitations, resolveExecOrigins, resolveOrigins, resolveParamId, resolveRootConfig, resolveSkillsRoot, resolveUnitMembers, resolveUnitMembersFromIndexes, restructureCandidates, retainEventArchives, retirementReport, reviewPrompt, revisionAnchor, revisionAnchorOf, revisionFingerprint, revisionSupportDigest, runWriteGates, runsFile, saveSuppressedNames, saveUsage, scanBodyHooks, scanContentThreats, scanMemoryThreats, scanThreats, scopeOfNearestManifest, scopedPackageName, scopedProbeReport, selectSections, sessionAudited, sessionEvidenceIndex, sessionLastEventTime, sessionReadNames, sessionReadSkillNames, sessionReadSupportFiles, sessionSeesFamilyTools, sessionTurnSignals, skillLibraryUnitBackend, skillReadNameOf, skillRowCells, skillStateKey, skillWriteGateContext, skillsRoot, staleRouteStubs, subagentChannelState, supportFileReadFromPath, supportFileReadOf, supportRefs, suppressedFile, sweepReports, sweepReviewChannelSessions, textDiffFacts, tokenLineFor, transactIo, transactTaskGuard, treeLockFile, trimPatternBoundaries, unhookedSupportPointers, unitEvidenceDigest, unitEvidencePath, unitIndexPath, unitJournalPath, unitJournalPhaseRank, unitJournalPort, unitMembersAreComplete, unitReceiptPath, unitSnapshotPath, unitSnapshotPort, unitSnapshotsDir, unitStorageKey, unwrapLive, updateSuppressedNames, upsertUnitIndex, usageFile, usageObserved, userSetKeys, validateFrontmatter, validateMutationRequest, validateRestructureTarget, validateSupportPath, valueOr, verifyPromptBundle, versionActionKind, versionRowCells, versionSummaryPrompt, versionTarget, vocabulary, withTreeWrite, withTreeWriteLock, writeDurableTmp, writePathSymbols, writeProposalReport, writeUnitEvidence, writeUnitJournal, writeUnitReceipt, writeUnitSnapshot, yamlPlainScalarNeedsQuotes };
@@ -41,6 +41,7 @@ export declare const HOST_ROUTES: {
41
41
  readonly preview: "/api/dsh-evolution/approval/preview";
42
42
  readonly approve: "/api/dsh-evolution/approval/approve";
43
43
  readonly reject: "/api/dsh-evolution/approval/reject";
44
+ readonly release: "/api/dsh-evolution/approval/release";
44
45
  };
45
46
  readonly skillHistory: {
46
47
  readonly skills: "/api/dsh-evolution/skill-history/skills";
@@ -64,6 +65,10 @@ export declare const HOST_ROUTES: {
64
65
  readonly diagnostics: {
65
66
  readonly view: "/api/dsh-evolution/diagnostics";
66
67
  };
68
+ readonly settings: {
69
+ readonly describe: "/api/dsh-evolution/settings/describe";
70
+ readonly mutate: "/api/dsh-evolution/settings/mutate";
71
+ };
67
72
  };
68
73
  export type HostSurface = {
69
74
  readonly available: true;
@@ -74,15 +79,6 @@ export type HostSurface = {
74
79
  readonly reason: 'connection-missing' | 'service-absent';
75
80
  };
76
81
  export declare function hostSurface(ctx: Context): HostSurface;
77
- /**
78
- * Register the family host surface on the platform's exact-route carrier.
79
- *
80
- * The platform owns admission (Host/Origin hygiene + browserAuth + exact-route owner peer) and the
81
- * disposer is bound to the CALLING fiber, not the connection service: the connection service can
82
- * outlive a reloaded family fiber, so the family must release its own registrations on dispose.
83
- * Routes carry the audit snapshot taken at registration time (deployment-level facts only — the
84
- * exact-route handler receives a Request, not the peer identity).
85
- */
86
82
  export declare function registerHostRoutes(owner: Context, build: (audit: DecisionAudit) => readonly ConnectionFetchRouteLike[]): void;
87
83
  export declare function json(status: number, body: unknown): Response;
88
84
  export declare function methodNotAllowed(allowed: readonly HttpMethod[]): Response;
@@ -38,6 +38,7 @@ export const HOST_ROUTES = {
38
38
  preview: '/api/dsh-evolution/approval/preview',
39
39
  approve: '/api/dsh-evolution/approval/approve',
40
40
  reject: '/api/dsh-evolution/approval/reject',
41
+ release: '/api/dsh-evolution/approval/release',
41
42
  },
42
43
  skillHistory: {
43
44
  skills: '/api/dsh-evolution/skill-history/skills',
@@ -61,6 +62,10 @@ export const HOST_ROUTES = {
61
62
  diagnostics: {
62
63
  view: '/api/dsh-evolution/diagnostics',
63
64
  },
65
+ settings: {
66
+ describe: '/api/dsh-evolution/settings/describe',
67
+ mutate: '/api/dsh-evolution/settings/mutate',
68
+ },
64
69
  };
65
70
  export function hostSurface(ctx) {
66
71
  const connection = ctx.get('connection');
@@ -69,29 +74,88 @@ export function hostSurface(ctx) {
69
74
  const allows = connection.allowsRemoteAuthorities === true;
70
75
  return { available: true, allowsRemoteAuthorities: allows };
71
76
  }
72
- /**
73
- * Register the family host surface on the platform's exact-route carrier.
74
- *
75
- * The platform owns admission (Host/Origin hygiene + browserAuth + exact-route owner peer) and the
76
- * disposer is bound to the CALLING fiber, not the connection service: the connection service can
77
- * outlive a reloaded family fiber, so the family must release its own registrations on dispose.
78
- * Routes carry the audit snapshot taken at registration time (deployment-level facts only — the
79
- * exact-route handler receives a Request, not the peer identity).
80
- */
77
+ function isLoopback(address) {
78
+ const value = address ?? '';
79
+ return value === '127.0.0.1' || value === '::1' || value === '::ffff:127.0.0.1';
80
+ }
81
+ function sameOrigin(origin, host) {
82
+ if (origin === undefined)
83
+ return true;
84
+ try {
85
+ const parsed = new URL(origin);
86
+ return isLoopback(parsed.hostname) && host !== undefined && parsed.host === host;
87
+ }
88
+ catch {
89
+ return false;
90
+ }
91
+ }
92
+ function nodeRoute(route) {
93
+ return {
94
+ kind: 'exact',
95
+ path: route.path,
96
+ handler: async (req, res) => {
97
+ if (!isLoopback(req.socket.remoteAddress)) {
98
+ res.statusCode = 403;
99
+ res.end('forbidden');
100
+ return;
101
+ }
102
+ if (!sameOrigin(req.headers.origin, req.headers.host)) {
103
+ res.statusCode = 403;
104
+ res.end('forbidden');
105
+ return;
106
+ }
107
+ const fetchSite = req.headers['sec-fetch-site'];
108
+ if (fetchSite !== undefined && fetchSite !== 'same-origin' && fetchSite !== 'none') {
109
+ res.statusCode = 403;
110
+ res.end('forbidden');
111
+ return;
112
+ }
113
+ const method = req.method ?? 'GET';
114
+ if (method !== 'GET' && method !== 'HEAD' && !(req.headers['content-type'] ?? '').toLowerCase().startsWith('application/json')) {
115
+ res.statusCode = 415;
116
+ res.end('json required');
117
+ return;
118
+ }
119
+ try {
120
+ const chunks = [];
121
+ for await (const chunk of req)
122
+ chunks.push(Buffer.isBuffer(chunk) ? chunk : Buffer.from(chunk));
123
+ const headers = new Headers();
124
+ for (const [key, value] of Object.entries(req.headers)) {
125
+ if (value === undefined)
126
+ continue;
127
+ headers.set(key, Array.isArray(value) ? value.join(',') : value);
128
+ }
129
+ const request = new Request(new URL(req.url ?? '/', 'http://127.0.0.1'), {
130
+ method,
131
+ headers,
132
+ ...(method === 'GET' || method === 'HEAD' || chunks.length === 0 ? {} : { body: Buffer.concat(chunks) }),
133
+ });
134
+ const response = await route.fetch(request);
135
+ res.statusCode = response.status;
136
+ response.headers.forEach((value, key) => { try {
137
+ res.setHeader(key, value);
138
+ }
139
+ catch { /* ignore forbidden node header */ } });
140
+ res.end(Buffer.from(await response.arrayBuffer()));
141
+ }
142
+ catch (error) {
143
+ res.statusCode = 500;
144
+ res.end(error instanceof Error ? error.message : String(error));
145
+ }
146
+ },
147
+ };
148
+ }
81
149
  export function registerHostRoutes(owner, build) {
82
150
  const injecting = owner;
83
151
  if (typeof injecting.inject !== 'function')
84
152
  throw new Error('host routes require a context that owns inject()');
85
153
  injecting.inject(['connection'], (scope) => {
86
154
  const connection = scope.connection;
87
- if (connection === undefined || connection.fetch === undefined || typeof connection.fetch.register !== 'function') {
88
- throw new Error('connection service is mounted without fetch.register()');
89
- }
90
- const register = connection.fetch.register.bind(connection.fetch);
91
155
  const audit = {
92
156
  channel: 'connection.fetch',
93
157
  principal: 'owner',
94
- deploymentAllowsRemote: connection.allowsRemoteAuthorities === true,
158
+ deploymentAllowsRemote: connection?.allowsRemoteAuthorities === true,
95
159
  };
96
160
  const routes = build(audit);
97
161
  for (const route of routes) {
@@ -102,29 +166,50 @@ export function registerHostRoutes(owner, build) {
102
166
  const effect = scope.effect;
103
167
  if (typeof effect !== 'function')
104
168
  throw new Error('connection scope has no effect() to own the registration');
105
- effect.call(scope, () => {
106
- const disposers = [];
107
- try {
108
- for (const route of routes)
109
- disposers.push(register(route));
110
- }
111
- catch (error) {
112
- for (const dispose of disposers) {
113
- try {
114
- void dispose();
169
+ if (connection?.fetch !== undefined && typeof connection.fetch.register === 'function') {
170
+ const register = connection.fetch.register.bind(connection.fetch);
171
+ effect.call(scope, () => {
172
+ const disposers = [];
173
+ try {
174
+ for (const route of routes)
175
+ disposers.push(register(route));
176
+ }
177
+ catch (error) {
178
+ for (const dispose of disposers) {
179
+ try {
180
+ void dispose();
181
+ }
182
+ catch { /* best-effort rollback */ }
115
183
  }
116
- catch { /* best-effort rollback */ }
184
+ throw error;
117
185
  }
118
- throw error;
119
- }
120
- return () => {
121
- for (const dispose of disposers) {
122
- try {
123
- void dispose();
186
+ return () => {
187
+ for (const dispose of disposers) {
188
+ try {
189
+ void dispose();
190
+ }
191
+ catch { /* a failed disposer must not mask the others */ }
124
192
  }
125
- catch { /* a failed disposer must not mask the others */ }
193
+ };
194
+ }, 'evolution-host-routes');
195
+ return;
196
+ }
197
+ // Platform 0.2.x moved Host data-plane registration to connection.rpc. The family
198
+ // HTTP contract stays exact paths; a loopback-only webserver bridge preserves it
199
+ // without exposing these routes to remote authorities.
200
+ const web = (scope.get?.('webServer')
201
+ ?? owner.get?.('webServer'));
202
+ if (web === undefined || typeof web.register !== 'function') {
203
+ throw new Error('connection service has no fetch.register(), and webServer is not mounted for the loopback host-route bridge');
204
+ }
205
+ effect.call(scope, () => {
206
+ const disposers = routes.map(route => web.register(nodeRoute(route)));
207
+ return () => { for (const dispose of disposers) {
208
+ try {
209
+ dispose();
126
210
  }
127
- };
211
+ catch { /* best-effort */ }
212
+ } };
128
213
  }, 'evolution-host-routes');
129
214
  });
130
215
  }
@@ -138,6 +138,19 @@ export interface ParamExposure {
138
138
  * (live); E2 = resource or identity knob that stays with the deployment.
139
139
  */
140
140
  export declare const PARAM_EXPOSURE: readonly ParamExposure[];
141
+ /**
142
+ * Register one family row's user layer on the platform settings service.
143
+ *
144
+ * The 0.2.x platform no longer turns a plugin Config into a settings section implicitly:
145
+ * every row that exposes a card must call `settings.register` with its Loader entry id.
146
+ * The owner argument is the row id, which is also the namespace the generated card binds.
147
+ * @param ctx - host plugin context.
148
+ * @param owner - Loader entry id / settings namespace.
149
+ * @param schema - the row's Config schema (schemastery).
150
+ */
151
+ export declare function registerOwnerSettings(ctx: {
152
+ inject?: (names: readonly string[], callback: (scope: unknown) => void) => unknown;
153
+ }, owner: string, schema: unknown): void;
141
154
  /** The settings namespace each OWNER PACKAGE registers (design §7.2).
142
155
  *
143
156
  * Keyed by owner rather than by group because a namespace has exactly one
@@ -207,6 +207,36 @@ export const PARAM_EXPOSURE = Object.freeze([
207
207
  { id: 'mergeRunTimeoutMinutes', group: 'merge', tier: 'E3', authority: 'cordis', owner: 'evolution-merge', applies: 'live', docAnchor: 'PARAMETERS.md#merge', summary: 'Wall-clock budget of one merge run; 0 means no limit.', label: '单次运行上限', hint: '一次合并运行最多持续多少分钟;0 表示不设上限。', control: 'number', unit: '分钟', values: '', card: 'evolution-merge' },
208
208
  { id: 'mergePairTimeoutMinutes', group: 'merge', tier: 'E2', authority: 'cordis', owner: 'evolution-merge', applies: 'none', docAnchor: 'PARAMETERS.md#merge', summary: 'Wall-clock budget of one pair round (a stuck child guard).', why: 'internal' },
209
209
  ]);
210
+ /**
211
+ * Register one family row's user layer on the platform settings service.
212
+ *
213
+ * The 0.2.x platform no longer turns a plugin Config into a settings section implicitly:
214
+ * every row that exposes a card must call `settings.register` with its Loader entry id.
215
+ * The owner argument is the row id, which is also the namespace the generated card binds.
216
+ * @param ctx - host plugin context.
217
+ * @param owner - Loader entry id / settings namespace.
218
+ * @param schema - the row's Config schema (schemastery).
219
+ */
220
+ export function registerOwnerSettings(ctx, owner, schema) {
221
+ const register = (scope) => {
222
+ const settings = scope.settings;
223
+ if (typeof settings?.register !== 'function')
224
+ return;
225
+ try {
226
+ settings.register(owner, schema);
227
+ }
228
+ catch (error) {
229
+ const logger = ctx.logger;
230
+ logger?.warn?.(`evolution settings: register(${owner}) failed: ${error instanceof Error ? error.message : String(error)}`);
231
+ }
232
+ };
233
+ const direct = ctx.get?.('settings');
234
+ if (direct !== undefined) {
235
+ register({ settings: direct });
236
+ return;
237
+ }
238
+ ctx.inject?.(['settings'], register);
239
+ }
210
240
  /** The settings namespace each OWNER PACKAGE registers (design §7.2).
211
241
  *
212
242
  * Keyed by owner rather than by group because a namespace has exactly one
@@ -19,7 +19,6 @@ export const PLATFORM_SERVICE_PROBES = Object.freeze([
19
19
  { service: 'approval', feature: 'the platform approval policy the approval row shadows', side: 'host' },
20
20
  { service: 'commands', feature: 'the /skill-domain confirmation command surface', side: 'host' },
21
21
  { service: 'configEditor', feature: 'the params view inherited-vs-override column', side: 'host' },
22
- { service: 'configForms', feature: 'the settings card seat (its section renders read-only without it)', side: 'client' },
23
22
  { service: 'evolutionApproval', feature: 'pending writes: list, approve and reject from the command surface', side: 'host' },
24
23
  { service: 'evolutionCurator', feature: '/evolution curator subcommands, skill undo and history', side: 'host' },
25
24
  { service: 'evolutionIo', feature: 'every durable read and write (the IO seam)', side: 'host' },
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@lmzhen/dsh-evolution-core",
3
3
  "description": "Shared stores, prompts, signals and lifecycle logic for the dsh-evolution plugin family (community build)",
4
- "version": "0.32.5",
4
+ "version": "0.32.6",
5
5
  "publishConfig": {
6
6
  "access": "public"
7
7
  },
@@ -49,7 +49,7 @@
49
49
  "yaml": "^2.4.2",
50
50
  "zod": "^4.4.3",
51
51
  "js-yaml": "^4.1.0",
52
- "@lmzhen/dsh-evolution-contract": "^0.32.5"
52
+ "@lmzhen/dsh-evolution-contract": "^0.32.6"
53
53
  },
54
54
  "peerDependencies": {
55
55
  "@deepseek-ai/cordis": "^4.0.5",