@lmzhen/dsh-evolution-core 0.57.0 → 0.59.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.
Files changed (86) hide show
  1. package/README.md +4 -2
  2. package/lib/authority-plugin.js +1 -1
  3. package/lib/composition/index.js +2 -2
  4. package/lib/{composition-B-gKqiBY.js → composition-B_F4TYOD.js} +1 -1
  5. package/lib/{ensure-BLmEW0Ju.js → ensure-BpVDuDnA.js} +1 -1
  6. package/lib/http-routes.js +1 -1
  7. package/lib/index.js +12 -10
  8. package/lib/{mutation-authority-DQfpXs1O.js → mutation-authority-Du-ON0NY.js} +1 -1
  9. package/lib/policy.js +1 -1
  10. package/lib/restrictor.js +1 -2
  11. package/lib/result.js +2 -33
  12. package/lib/{review-context-70XYS11J.js → review-context-CW_kJAzn.js} +1 -1
  13. package/lib/runtime/plugin.js +72 -55
  14. package/lib/{session-projection-CbIKvDfJ.js → session-projection-DM15fsRp.js} +8 -16
  15. package/lib/skills.js +2 -2
  16. package/lib/subagent/index.js +1 -1
  17. package/lib/types/authority.d.ts +1 -1
  18. package/lib/types/authority.js +1 -1
  19. package/lib/types/composition/ensure.js +1 -1
  20. package/lib/types/events.d.ts +15 -1
  21. package/lib/types/http-routes.js +1 -1
  22. package/lib/types/opt-in.js +2 -2
  23. package/lib/types/params.js +1 -1
  24. package/lib/types/platform-line.generated.d.ts +4 -2
  25. package/lib/types/platform-line.generated.js +6 -2
  26. package/lib/types/policy.js +1 -1
  27. package/lib/types/prompts.js +1 -1
  28. package/lib/types/restrictor.js +2 -2
  29. package/lib/types/result.d.ts +3 -31
  30. package/lib/types/result.js +6 -24
  31. package/lib/types/runtime/coherence.js +1 -1
  32. package/lib/types/runtime/llm.d.ts +1 -1
  33. package/lib/types/runtime/llm.js +1 -1
  34. package/lib/types/runtime/minimal-preset.d.ts +17 -0
  35. package/lib/types/runtime/minimal-preset.js +81 -0
  36. package/lib/types/runtime/platform.d.ts +8 -58
  37. package/lib/types/runtime/platform.js +7 -61
  38. package/lib/types/runtime/plugin.js +3 -4
  39. package/lib/types/runtime/projections.d.ts +1 -1
  40. package/lib/types/scope.js +1 -1
  41. package/lib/types/session-projection.d.ts +1 -1
  42. package/lib/types/signals.d.ts +8 -2
  43. package/lib/types/signals.js +7 -18
  44. package/lib/types/skill-stats.d.ts +37 -0
  45. package/lib/types/subagent/run.d.ts +1 -1
  46. package/lib/types/subagent/types.d.ts +4 -4
  47. package/package.json +7 -32
  48. package/lib/connection-DAJy7Xjm.js +0 -28
  49. package/lib/platform/index.js +0 -5
  50. package/lib/platform-UL-djjz9.js +0 -244
  51. package/lib/presets-C8vuCuNA.js +0 -27
  52. package/lib/tools-BrUswg8v.js +0 -22
  53. package/lib/types/platform/agents.d.ts +0 -32
  54. package/lib/types/platform/agents.js +0 -26
  55. package/lib/types/platform/commands.d.ts +0 -14
  56. package/lib/types/platform/commands.js +0 -9
  57. package/lib/types/platform/connection.d.ts +0 -26
  58. package/lib/types/platform/connection.js +0 -27
  59. package/lib/types/platform/index.d.ts +0 -55
  60. package/lib/types/platform/index.js +0 -29
  61. package/lib/types/platform/llm.d.ts +0 -47
  62. package/lib/types/platform/llm.js +0 -76
  63. package/lib/types/platform/platformView.d.ts +0 -21
  64. package/lib/types/platform/platformView.js +0 -29
  65. package/lib/types/platform/presets.d.ts +0 -31
  66. package/lib/types/platform/presets.js +0 -31
  67. package/lib/types/platform/profileContext.d.ts +0 -16
  68. package/lib/types/platform/profileContext.js +0 -14
  69. package/lib/types/platform/projections.d.ts +0 -35
  70. package/lib/types/platform/projections.js +0 -34
  71. package/lib/types/platform/settings.d.ts +0 -22
  72. package/lib/types/platform/settings.js +0 -14
  73. package/lib/types/platform/skills.d.ts +0 -16
  74. package/lib/types/platform/skills.js +0 -9
  75. package/lib/types/platform/storageDomain.d.ts +0 -13
  76. package/lib/types/platform/storageDomain.js +0 -9
  77. package/lib/types/platform/subagents.d.ts +0 -25
  78. package/lib/types/platform/subagents.js +0 -17
  79. package/lib/types/platform/systemPrompt.d.ts +0 -16
  80. package/lib/types/platform/systemPrompt.js +0 -13
  81. package/lib/types/platform/tools.d.ts +0 -27
  82. package/lib/types/platform/tools.js +0 -23
  83. package/lib/types/platform/userQuestions.d.ts +0 -33
  84. package/lib/types/platform/userQuestions.js +0 -9
  85. package/lib/types/platform/workingDirectory.d.ts +0 -14
  86. package/lib/types/platform/workingDirectory.js +0 -9
package/README.md CHANGED
@@ -2,9 +2,11 @@
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
- The root entry is a library, not a user-facing command. The package also exposes `./composition`, `./subagent`, `./http-routes`, `./restrictor`, `./platform`, and `./runtime` subpaths.
5
+ The root entry is a library, not a user-facing command. The package also exposes `./composition`, `./subagent`, `./http-routes`, `./restrictor`, and `./runtime` subpaths.
6
6
 
7
- `./runtime` is a function plugin. It provides `evolutionProjections`, the single owner of the five host-only session units (`evolutionActivity`, `evolutionEvidence`, `evolutionReads`, `evolutionProjectionHistory`, `evolutionSignals`); readers ask that service and degrade to `undefined` when the platform registry is absent. It also provides `evolutionLlm`, the single route/purpose/transport owner for auxiliary model calls (curator, merge judge, domain generation). A granular composition that mounts feature rows without a family bundle must mount this row too.
7
+ The former `./platform` compatibility barrel is removed: feature packages import port types from `@lmzhen/dsh-evolution-platform-contract`, port functions from `@lmzhen/dsh-evolution-adapter/ports`, and host runtime helpers from `@lmzhen/dsh-evolution-adapter/values`. `./runtime` no longer mounts `evolutionPlatform`; the bundle's `evolution-adapter` row owns it and mounts before core/runtime.
8
+
9
+ `./runtime` is a function plugin. It provides `evolutionProjections`, the single owner of the five host-only session units (`evolutionActivity`, `evolutionEvidence`, `evolutionReads`, `evolutionProjectionHistory`, `evolutionSignals`); readers ask that service and degrade to `undefined` when the platform registry is absent. It also provides `evolutionLlm`, the single route/purpose/transport owner for auxiliary model calls (curator, merge judge, domain generation). A granular composition that mounts feature rows without a family bundle must mount this row too. The runtime also installs the minimal-preset guard: while the active preset is `minimal`, family model tools are hidden per agent scope and AUX review is skipped; UI/commands remain profile-level.
8
10
 
9
11
  `./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.
10
12
 
@@ -1,4 +1,4 @@
1
- import { t as MutationAuthority } from "./mutation-authority-DQfpXs1O.js";
1
+ import { t as MutationAuthority } from "./mutation-authority-Du-ON0NY.js";
2
2
  import { t as evolutionHome } from "./state-store-Jpa-iYIZ.js";
3
3
  //#region lib/types/authority-plugin.js
4
4
  const name = "evolution-authority";
@@ -1,3 +1,3 @@
1
- import { a as entryListSchema, c as GOVERNANCE_PRESET_ID, d as RESTRICTED_TOOLS_ROW_ID, f as RESTRICTOR_MODULE, h as restrictedPresetId, i as composeRestrictedPresetDefinition, l as MAINTAINER_PRESET_ID, m as normalizeAllow, n as ensureRestrictedPreset, o as parsePresetRows, p as REVIEWER_PRESET_ID, r as restrictedPresetState, s as EVOLUTION_PRESET_IDS, t as disposeRestrictedPreset, u as RESTRICTED_PRESET_DISPLAY } from "../ensure-BLmEW0Ju.js";
2
- import { C as trimTrailingBlankLines, S as rowSiblingEnd, _ as presetRowId, a as composePresetComposition, b as resolveBasePresetPatch, c as composePresetRow, d as listDirectories, f as loadRowOverrides, g as presetRowBody, h as presetRowBlock, i as basePresetPlugins, l as compositionRowIds, m as presetPatchText, n as AGENT_PRESET_ROOT_HINT, o as composePresetEntry, p as mergePresetRow, r as EMPTY_PATCH_SEED, s as composePresetInsert, t as AGENT_PRESET_PACKAGE, u as denseBlockSequence, v as probeDesktopScope, x as rowBlockSpan, y as removePresetRow } from "../composition-B-gKqiBY.js";
1
+ import { a as entryListSchema, c as GOVERNANCE_PRESET_ID, d as RESTRICTED_TOOLS_ROW_ID, f as RESTRICTOR_MODULE, h as restrictedPresetId, i as composeRestrictedPresetDefinition, l as MAINTAINER_PRESET_ID, m as normalizeAllow, n as ensureRestrictedPreset, o as parsePresetRows, p as REVIEWER_PRESET_ID, r as restrictedPresetState, s as EVOLUTION_PRESET_IDS, t as disposeRestrictedPreset, u as RESTRICTED_PRESET_DISPLAY } from "../ensure-BpVDuDnA.js";
2
+ import { C as trimTrailingBlankLines, S as rowSiblingEnd, _ as presetRowId, a as composePresetComposition, b as resolveBasePresetPatch, c as composePresetRow, d as listDirectories, f as loadRowOverrides, g as presetRowBody, h as presetRowBlock, i as basePresetPlugins, l as compositionRowIds, m as presetPatchText, n as AGENT_PRESET_ROOT_HINT, o as composePresetEntry, p as mergePresetRow, r as EMPTY_PATCH_SEED, s as composePresetInsert, t as AGENT_PRESET_PACKAGE, u as denseBlockSequence, v as probeDesktopScope, x as rowBlockSpan, y as removePresetRow } from "../composition-B_F4TYOD.js";
3
3
  export { AGENT_PRESET_PACKAGE, AGENT_PRESET_ROOT_HINT, EMPTY_PATCH_SEED, EVOLUTION_PRESET_IDS, GOVERNANCE_PRESET_ID, MAINTAINER_PRESET_ID, RESTRICTED_PRESET_DISPLAY, RESTRICTED_TOOLS_ROW_ID, RESTRICTOR_MODULE, REVIEWER_PRESET_ID, basePresetPlugins, composePresetComposition, composePresetEntry, composePresetInsert, composePresetRow, composeRestrictedPresetDefinition, compositionRowIds, denseBlockSequence, disposeRestrictedPreset, ensureRestrictedPreset, entryListSchema, listDirectories, loadRowOverrides, mergePresetRow, normalizeAllow, parsePresetRows, presetPatchText, presetRowBlock, presetRowBody, presetRowId, probeDesktopScope, removePresetRow, resolveBasePresetPatch, restrictedPresetId, restrictedPresetState, rowBlockSpan, rowSiblingEnd, trimTrailingBlankLines };
@@ -1,4 +1,4 @@
1
- import { _ as scopedPackageName } from "./ensure-BLmEW0Ju.js";
1
+ import { _ as scopedPackageName } from "./ensure-BpVDuDnA.js";
2
2
  import { dirname, join } from "node:path";
3
3
  import { existsSync, readFileSync, readdirSync } from "node:fs";
4
4
  import { fileURLToPath } from "node:url";
@@ -1,8 +1,8 @@
1
1
  import { n as errorText } from "./errors-BxzLTVbS.js";
2
- import { t as presetsPort } from "./presets-C8vuCuNA.js";
3
2
  import { dirname, join } from "node:path";
4
3
  import { existsSync, readFileSync } from "node:fs";
5
4
  import { fileURLToPath } from "node:url";
5
+ import { presetsPort } from "@lmzhen/dsh-evolution-adapter/ports";
6
6
  import * as yaml from "js-yaml";
7
7
  //#region lib/types/package-identity.js
8
8
  /**
@@ -1,5 +1,5 @@
1
1
  import { n as isRecord } from "./guards-3f02mnf2.js";
2
- import { t as connectionPort } from "./connection-DAJy7Xjm.js";
2
+ import { connectionPort } from "@lmzhen/dsh-evolution-adapter/ports";
3
3
  //#region lib/types/http-routes.js
4
4
  /**
5
5
  * The Host data-plane contract + Fetch-shaped helpers every family route surface shares (W1/W6).
package/lib/index.js CHANGED
@@ -1,11 +1,11 @@
1
1
  import { S as reportTime, _ as probeMtime, a as isProcessAlive, b as probeText, c as transactIo, d as isAbsent, f as isMissingPath, g as probeList, h as probeAbsent, i as isCommittedWarning, l as writeDurableTmp, m as isUnknown, n as atomicWriteFiles, o as nodeEvolutionIo, p as isPresent, r as evolutionIoAdapter, s as renameWithRetry, t as TransactionNotInvokedError, u as declaredReportStamp, v as probePresent, x as probeUnknown, y as probeReason } from "./io-GxghO3Ip.js";
2
- import { a as leaseFile, c as AuthorityBusyError, d as HomeAuthority, f as authorityHolder, i as LeaseStore, l as AuthorityOrderError, n as mutationLockFrom, o as HomeFence, p as leaseAsTreeLock, r as DEFAULT_LEASE_TTL_MS, s as HomeFenceError, t as MutationAuthority, u as AuthorityReentryError } from "./mutation-authority-DQfpXs1O.js";
2
+ import { a as leaseFile, c as AuthorityBusyError, d as HomeAuthority, f as authorityHolder, i as LeaseStore, l as AuthorityOrderError, n as mutationLockFrom, o as HomeFence, p as leaseAsTreeLock, r as DEFAULT_LEASE_TTL_MS, s as HomeFenceError, t as MutationAuthority, u as AuthorityReentryError } from "./mutation-authority-Du-ON0NY.js";
3
3
  import { a as isFileShapedPath, i as KEEP_LINE_RE, n as DEFAULT_CITATION_REF_BUDGET, o as resolveCitations, r as HOOK_LINE_RE, s as scanBodyHooks, t as CITATION_SUPPORT_DIRS } from "./citations-CZKTUGQF.js";
4
4
  import { $ as SUPPORT_SPRAWL_FILES, A as DEFAULT_SUBSTANTIVE_MIN_AGENT_CHARS, B as MAX_SKILL_CONTENT_CHARS, C as DEFAULT_REVIEW_TIMEOUT_MS, D as DEFAULT_SKILL_VERSION_KEEP, E as DEFAULT_SKILL_REVIEW_TRIGGER, F as DEFAULT_USER_TOKENS, G as MEMORY_GUIDANCE_SECTION_ORDER, H as MAX_SKILL_NAME_LENGTH, I as ENTRY_DELIMITER, J as REVIEW_TEXT_PREVIEW_GRAPHEMES, K as MERGE_BODY_PREVIEW_BYTES, L as EVOLUTION_WRITE_TOOLS, M as DEFAULT_SUBSTANTIVE_MIN_USER_CHARS, N as DEFAULT_THREAT_MAX_SCAN_CHARS, O as DEFAULT_SOFT_BODY_TOKENS, P as DEFAULT_USER_CHAR_LIMIT, Q as SUPPORT_DIRS, R as FORBIDDEN_CONTROL_KEYS, S as DEFAULT_REVIEW_SKILL_INTERVAL, T as DEFAULT_SKILL_REVIEW_COMPLETION_MIN_TOOL_CALLS, U as MAX_TIMER_DELAY_MS, V as MAX_SKILL_FILE_BYTES, W as MEMORY_ENTRY_PREVIEW_GRAPHEMES, X as SKILL_ACTION_REQUIRED_FIELDS, Y as SKILLS_GUIDANCE_SECTION_ORDER, Z as SKILL_NAME_RE, _ as DEFAULT_MEMORY_CHAR_LIMIT, a as DEFAULT_SUPPORT_FILE_CHAR_POLICY, b as DEFAULT_PROBE_TIMEOUT_MS, c as AUTHORING_DESCRIPTION_BAR, d as DEFAULT_ARCHIVE_AFTER_DAYS, et as TEXT_DIFF_MAX_GRAPHEMES, f as DEFAULT_CONSOLIDATION_FAILURES, g as DEFAULT_CURATOR_REVIEW_MAX_TOKENS, h as DEFAULT_CURATOR_MODEL, i as DEFAULT_SKILL_LIMITS, j as DEFAULT_SUBSTANTIVE_MIN_TOOL_CALLS, k as DEFAULT_STALE_AFTER_DAYS, l as AUTHORING_SPLIT_LINE_CHARS, m as DEFAULT_CURATOR_INTERVAL_HOURS, n as DEFAULT_CITATION_POLICY, nt as VERSION_BODY_PREVIEW_GRAPHEMES, o as POLICY_STAGE_DEFAULTS, p as DEFAULT_CURATOR_BOOT_GRACE_SECONDS, q as PROTECTED_BUILTIN_SKILLS, r as DEFAULT_REFERENCE_REWRITE_POLICY, s as policyStageLimits, t as DEFAULT_ARCHIVE_RETENTION_POLICY, tt as UPSTREAM_LIMIT_CHARS_PER_TOKEN, u as CONTENT_SPLIT_HINT, v as DEFAULT_MEMORY_TOKENS, w as DEFAULT_SKILL_CONTENT_CHARS, x as DEFAULT_REVIEW_MEMORY_INTERVAL, y as DEFAULT_MIN_IDLE_HOURS, z as MAX_DESCRIPTION_LENGTH } from "./limits-CO4JGSJL.js";
5
- import { _ as scopedPackageName, d as RESTRICTED_TOOLS_ROW_ID, f as RESTRICTOR_MODULE, g as scopeOfNearestManifest, l as MAINTAINER_PRESET_ID, p as REVIEWER_PRESET_ID, s as EVOLUTION_PRESET_IDS, u as RESTRICTED_PRESET_DISPLAY } from "./ensure-BLmEW0Ju.js";
6
- import { A as retainEventArchives, C as appendEvolutionEvent, D as parseEvolutionEvents, E as listEventArchives, G as DEFAULT_WRITE_CONFIRM_MODE, H as isUnreadWrite, I as softBodyTokenBudget, K as DEFAULT_WRITE_CONFIRM_TIMEOUT_SECONDS, L as RULES, O as readEvolutionEvents, P as assessStructureHealth, S as EVENT_LOG_VERSION, T as evolutionEventPayloadIssue, _ as fuzzyPatch, a as isReviewChannelSession, b as EVENT_LOG_RETAIN_ARCHIVES, c as PATTERN_OVERLAP, d as scanContentThreats, f as scanMemoryThreats, g as FUZZY_MAX_WORK, h as FUZZY_MAX_PATTERN_CHARS, i as clearReviewChannel, j as DEFAULT_HEALTH_THRESHOLDS, k as readEvolutionTimeline, l as THREAT_EXEMPTION_HINT, m as makeSerialQueue, n as recordReviewRead, o as markReviewChannel, p as scanThreats, q as authorityFrom, r as withReviewContext, s as sweepReviewChannelSessions, t as currentReviewContext, u as evaluateThreat, v as trimPatternBoundaries, w as eventsFile, x as EVENT_LOG_ROTATE_AT, y as EVENT_ARCHIVE_PREFIX, z as lintSkill } from "./review-context-70XYS11J.js";
5
+ import { _ as scopedPackageName, d as RESTRICTED_TOOLS_ROW_ID, f as RESTRICTOR_MODULE, g as scopeOfNearestManifest, l as MAINTAINER_PRESET_ID, p as REVIEWER_PRESET_ID, s as EVOLUTION_PRESET_IDS, u as RESTRICTED_PRESET_DISPLAY } from "./ensure-BpVDuDnA.js";
6
+ import { A as retainEventArchives, C as appendEvolutionEvent, D as parseEvolutionEvents, E as listEventArchives, G as DEFAULT_WRITE_CONFIRM_MODE, H as isUnreadWrite, I as softBodyTokenBudget, K as DEFAULT_WRITE_CONFIRM_TIMEOUT_SECONDS, L as RULES, O as readEvolutionEvents, P as assessStructureHealth, S as EVENT_LOG_VERSION, T as evolutionEventPayloadIssue, _ as fuzzyPatch, a as isReviewChannelSession, b as EVENT_LOG_RETAIN_ARCHIVES, c as PATTERN_OVERLAP, d as scanContentThreats, f as scanMemoryThreats, g as FUZZY_MAX_WORK, h as FUZZY_MAX_PATTERN_CHARS, i as clearReviewChannel, j as DEFAULT_HEALTH_THRESHOLDS, k as readEvolutionTimeline, l as THREAT_EXEMPTION_HINT, m as makeSerialQueue, n as recordReviewRead, o as markReviewChannel, p as scanThreats, q as authorityFrom, r as withReviewContext, s as sweepReviewChannelSessions, t as currentReviewContext, u as evaluateThreat, v as trimPatternBoundaries, w as eventsFile, x as EVENT_LOG_ROTATE_AT, y as EVENT_ARCHIVE_PREFIX, z as lintSkill } from "./review-context-CW_kJAzn.js";
7
7
  import { i as HOST_LOCALES, n as errorText, r as errorTextIn, t as EVOLUTION_ERRORS } from "./errors-BxzLTVbS.js";
8
- import { A as dispatchKeyOf, C as PTC_DISPATCH_EVENT, D as assertDispatchPayload, E as ToolDispatchPayloadError, F as isSkillToolName, I as readDispatchSignal, L as skillReadNameOf, M as dispatchStepOf, N as foldToolDispatches, O as collectReadSkillNames, P as isSkillReadToolName, R as supportFileReadFromPath, S as NATIVE_RESULT_EVENT, T as ToolDispatchNormalizer, _ as isBookkeepingFrame, a as evolutionSignalsProjection, b as MODEL_SESSION_EVENT_TYPES, c as sessionLastEventTime, d as advanceReview, f as foldTurnEvent, g as evidenceKindIndex, h as observeEvent, i as evolutionReadsProjection, j as dispatchPathOf, k as collectReadSupportFiles, l as sessionReadNames, m as initialTurnFold, n as evolutionEvidenceProjection, o as isProjectableSession, p as foldTurnEvents, r as evolutionProjectionHistoryProjection, s as sessionEvidenceIndex, t as evolutionActivityProjection, u as sessionTurnSignals, v as DEFAULT_SUPPORT_READ_TOOL_NAMES, w as PTC_DISPATCH_START_EVENT, x as NATIVE_CALL_EVENT, y as DISPATCH_EVENT_TYPES, z as supportFileReadOf } from "./session-projection-CbIKvDfJ.js";
8
+ import { A as dispatchKeyOf, C as PTC_DISPATCH_EVENT, D as assertDispatchPayload, E as ToolDispatchPayloadError, F as isSkillToolName, I as readDispatchSignal, L as skillReadNameOf, M as dispatchStepOf, N as foldToolDispatches, O as collectReadSkillNames, P as isSkillReadToolName, R as supportFileReadFromPath, S as NATIVE_RESULT_EVENT, T as ToolDispatchNormalizer, _ as isBookkeepingFrame, a as evolutionSignalsProjection, b as MODEL_SESSION_EVENT_TYPES, c as sessionLastEventTime, d as advanceReview, f as foldTurnEvent, g as evidenceKindIndex, h as observeEvent, i as evolutionReadsProjection, j as dispatchPathOf, k as collectReadSupportFiles, l as sessionReadNames, m as initialTurnFold, n as evolutionEvidenceProjection, o as isProjectableSession, p as foldTurnEvents, r as evolutionProjectionHistoryProjection, s as sessionEvidenceIndex, t as evolutionActivityProjection, u as sessionTurnSignals, v as DEFAULT_SUPPORT_READ_TOOL_NAMES, w as PTC_DISPATCH_START_EVENT, x as NATIVE_CALL_EVENT, y as DISPATCH_EVENT_TYPES, z as supportFileReadOf } from "./session-projection-DM15fsRp.js";
9
9
  import { a as measureUnit, i as measureText, n as conservativeTokenEstimator, o as truncateGraphemes, r as graphemeCount, s as utf8ByteLength, t as codePointCount } from "./text-metrics-CyJhxWBs.js";
10
10
  import { A as h2Sections, C as saveUsage, D as usageObserved, E as usageFile, F as describeReferenceRewrite, I as planReferenceRewrite, L as planRehoming, M as externalRefs, N as supportRefs, O as selectSections, P as applyReferenceRewrite, S as saveSuppressedNames, T as updateSuppressedNames, _ as loadUsage, a as applyCuratorMetaFields, b as normalizeUsageRecord, c as bumpUse, d as emptyRecord, f as foldCuratorFields, g as loadSuppressedNames, h as latestActivityAt, i as applyCuratorLifecycleFields, j as readingStats, k as displayBodyOf, l as bumpView, m as idleDays, n as SUPPRESSED_FILE_VERSION, o as bumpPatch, p as getRecord, r as VIEW_WINDOW_DAYS, s as bumpSupportRead, t as MAX_SUPPORT_READ_PATHS, u as daysSinceIso, v as markAgentCreated, w as suppressedFile, x as recentViewCount, y as mutateUsage } from "./usage-DrczLTP4.js";
11
11
  import { n as isRecord, t as asRecord } from "./guards-3f02mnf2.js";
@@ -14,16 +14,16 @@ import { T as ownerCandidatesFromSummaries, _ as readProposalReport, a as SUMMAR
14
14
  import { n as evolutionRoot, t as evolutionHome } from "./state-store-Jpa-iYIZ.js";
15
15
  import "./skill-history-YX84wO20.js";
16
16
  import { HOST_ROUTES, MAX_REQUEST_BODY_BYTES, hostSurface, json, methodNotAllowed, readJsonObject, registerHostRoutes } from "./http-routes.js";
17
- import { w as allowRowCollisions } from "./composition-B-gKqiBY.js";
17
+ import { w as allowRowCollisions } from "./composition-B_F4TYOD.js";
18
18
  import { t as clampedNumber } from "./numeric-Dc53KQoe.js";
19
- import { u as scopeOf, y as settingsPort } from "./platform-UL-djjz9.js";
20
- import { n as toolsPort } from "./tools-BrUswg8v.js";
21
19
  import { abortLink, createSubagentChannel as createSubagentKernel, createSubagentRun, probeChannelState, textOfValue, waitForSubagentEnd } from "./subagent/index.js";
22
20
  import { basename, join } from "node:path";
21
+ import { scopeOf } from "@lmzhen/dsh-evolution-adapter/values";
23
22
  import { readFileSync } from "node:fs";
24
23
  import { createHash, randomUUID } from "node:crypto";
25
24
  import { fileURLToPath } from "node:url";
26
25
  import { parse } from "yaml";
26
+ import { settingsPort, toolsPort } from "@lmzhen/dsh-evolution-adapter/ports";
27
27
  //#region lib/types/tree-write.js
28
28
  /**
29
29
  * G1/1.5 (S7-09): the TYPED critical section around a tree write.
@@ -2129,7 +2129,7 @@ const SKILLS_GUIDANCE = `Skills guidance:
2129
2129
  • After a complex task (5+ tool calls), a tricky fix, or a non-trivial workflow, decide whether an existing owner should be updated or a new class-level skill is needed; search the library before creating.
2130
2130
  • When using a skill and finding it outdated, incomplete, or wrong, patch it immediately with skill_manage (action='patch') — don't wait to be asked. Skills that aren't maintained become liabilities.`;
2131
2131
  function reviewPrompt(kind, surface = "inject") {
2132
- if (surface === "aux") return kind === "memory" ? INJECT_MEMORY_REVIEW_PROMPT : INJECT_COMBINED_REVIEW_PROMPT;
2132
+ if (surface === "aux") return kind === "memory" ? INJECT_MEMORY_REVIEW_PROMPT : INJECT_SKILL_REVIEW_PROMPT;
2133
2133
  if (kind === "memory") return INJECT_MEMORY_REVIEW_PROMPT;
2134
2134
  if (kind === "skill") return INJECT_SKILL_REVIEW_PROMPT;
2135
2135
  return INJECT_COMBINED_REVIEW_PROMPT;
@@ -5533,9 +5533,11 @@ const DIAGNOSTICS_RUNTIME_KEYS = [
5533
5533
  const PLATFORM_LINE = {
5534
5534
  version: "0.2.2-rc.5",
5535
5535
  floor: "0.2.2-rc.5",
5536
+ cohort: ["0.2.2-rc.5"],
5537
+ contract: 1,
5536
5538
  previousAnchor: "0.2.1-rc.2",
5537
- peersRange: "^0.2.2-rc.5",
5538
- enginesRange: ">=0.2.2-rc.5 <0.2.3-0",
5539
+ peersRange: "0.2.2-rc.5",
5540
+ enginesRange: "0.2.2-rc.5",
5539
5541
  upstreamRef: "dsh-v0.2.2-rc.5"
5540
5542
  };
5541
5543
  //#endregion
@@ -2,7 +2,7 @@ import { a as isProcessAlive, c as transactIo } from "./io-GxghO3Ip.js";
2
2
  import { AsyncLocalStorage } from "node:async_hooks";
3
3
  import { mkdir, readFile, rm } from "node:fs/promises";
4
4
  import { dirname, join } from "node:path";
5
- import { withFileLock } from "@deepseek-ai/dsh-atomic-write";
5
+ import { withFileLock } from "@lmzhen/dsh-evolution-adapter/values";
6
6
  import { randomUUID } from "node:crypto";
7
7
  //#region lib/types/authority.js
8
8
  /**
package/lib/policy.js CHANGED
@@ -1,7 +1,7 @@
1
1
  import { L as EVOLUTION_WRITE_TOOLS, P as DEFAULT_USER_CHAR_LIMIT, R as FORBIDDEN_CONTROL_KEYS, _ as DEFAULT_MEMORY_CHAR_LIMIT, a as DEFAULT_SUPPORT_FILE_CHAR_POLICY, h as DEFAULT_CURATOR_MODEL, n as DEFAULT_CITATION_POLICY, o as POLICY_STAGE_DEFAULTS, q as PROTECTED_BUILTIN_SKILLS, r as DEFAULT_REFERENCE_REWRITE_POLICY, t as DEFAULT_ARCHIVE_RETENTION_POLICY, w as DEFAULT_SKILL_CONTENT_CHARS } from "./limits-CO4JGSJL.js";
2
2
  import { t as asRecord } from "./guards-3f02mnf2.js";
3
3
  import { t as clampedNumber } from "./numeric-Dc53KQoe.js";
4
- import { n as toolsPort } from "./tools-BrUswg8v.js";
4
+ import { toolsPort } from "@lmzhen/dsh-evolution-adapter/ports";
5
5
  import { Service } from "@deepseek-ai/cordis";
6
6
  import z from "@deepseek-ai/schemastery";
7
7
  //#region lib/types/policy.js
package/lib/restrictor.js CHANGED
@@ -1,6 +1,5 @@
1
1
  import { n as errorText } from "./errors-BxzLTVbS.js";
2
- import { t as presetsPort } from "./presets-C8vuCuNA.js";
3
- import { n as toolsPort } from "./tools-BrUswg8v.js";
2
+ import { presetsPort, toolsPort } from "@lmzhen/dsh-evolution-adapter/ports";
4
3
  //#region lib/types/restrictor.js
5
4
  const name = "evolution-restrictor";
6
5
  const inject = ["agentPresets"];
package/lib/result.js CHANGED
@@ -1,33 +1,2 @@
1
- //#region lib/types/result.js
2
- function ok(value) {
3
- return {
4
- ok: true,
5
- value
6
- };
7
- }
8
- function err(error) {
9
- return {
10
- ok: false,
11
- error
12
- };
13
- }
14
- function isOk(result) {
15
- return result.ok;
16
- }
17
- function isErr(result) {
18
- return !result.ok;
19
- }
20
- /** The value, or the supplied fallback when the result is an error. */
21
- function unwrapOr(result, fallback) {
22
- return result.ok ? result.value : fallback;
23
- }
24
- /** Coerce a caught value into the family error shape. */
25
- function familyError(code, cause) {
26
- return {
27
- code,
28
- message: cause instanceof Error ? cause.message : String(cause),
29
- ...cause === void 0 ? {} : { cause }
30
- };
31
- }
32
- //#endregion
33
- export { err, familyError, isErr, isOk, ok, unwrapOr };
1
+ export * from "@lmzhen/dsh-evolution-platform-contract/result";
2
+ export {};
@@ -1,6 +1,6 @@
1
1
  import { c as transactIo } from "./io-GxghO3Ip.js";
2
2
  import { N as DEFAULT_THREAT_MAX_SCAN_CHARS, O as DEFAULT_SOFT_BODY_TOKENS, tt as UPSTREAM_LIMIT_CHARS_PER_TOKEN } from "./limits-CO4JGSJL.js";
3
- import { O as collectReadSkillNames, R as supportFileReadFromPath, k as collectReadSupportFiles, l as sessionReadNames, o as isProjectableSession, v as DEFAULT_SUPPORT_READ_TOOL_NAMES } from "./session-projection-CbIKvDfJ.js";
3
+ import { O as collectReadSkillNames, R as supportFileReadFromPath, k as collectReadSupportFiles, l as sessionReadNames, o as isProjectableSession, v as DEFAULT_SUPPORT_READ_TOOL_NAMES } from "./session-projection-DM15fsRp.js";
4
4
  import { a as measureUnit, i as measureText } from "./text-metrics-CyJhxWBs.js";
5
5
  import { t as clampedNumber } from "./numeric-Dc53KQoe.js";
6
6
  import { AsyncLocalStorage } from "node:async_hooks";
@@ -1,10 +1,7 @@
1
- import { a as evolutionSignalsProjection, i as evolutionReadsProjection, n as evolutionEvidenceProjection, r as evolutionProjectionHistoryProjection, t as evolutionActivityProjection } from "../session-projection-CbIKvDfJ.js";
2
- import { t as connectionPort } from "../connection-DAJy7Xjm.js";
3
- import { C as configEditorPort, D as commandsPort, E as profileContextPort, S as workingDirectoryPort, T as pluginManagerPort, _ as agentsPort, b as storageDomainPort, d as EvolutionLlmError, f as llmPort, g as subagentsPort, h as userQuestionsPort, m as projectionPort, p as modelRoute, v as systemPromptPort, w as pluginInventoryPort, x as skillsPort, y as settingsPort } from "../platform-UL-djjz9.js";
4
- import { t as presetsPort } from "../presets-C8vuCuNA.js";
5
- import { n as toolsPort } from "../tools-BrUswg8v.js";
1
+ import { a as evolutionSignalsProjection, i as evolutionReadsProjection, n as evolutionEvidenceProjection, r as evolutionProjectionHistoryProjection, t as evolutionActivityProjection } from "../session-projection-DM15fsRp.js";
6
2
  import { join } from "node:path";
7
3
  import { existsSync, readFileSync } from "node:fs";
4
+ import { EvolutionLlmError, modelRoute, profileContextPort } from "@lmzhen/dsh-evolution-adapter/ports";
8
5
  import { Service } from "@deepseek-ai/cordis";
9
6
  //#region lib/types/runtime/coherence.js
10
7
  /**
@@ -159,55 +156,6 @@ var EvolutionLlm = class extends Service {
159
156
  }
160
157
  };
161
158
  //#endregion
162
- //#region lib/types/runtime/platform.js
163
- /**
164
- * The family's host capability service: one place that resolves the platform
165
- * ports and reports which halves are available. Feature code reads ports from
166
- * this service; the port modules remain the only @deepseek-ai/dsh-* importers.
167
- *
168
- * The table is resolved on every read. A missing optional service is not a
169
- * permanent capability loss: it may mount after this service initializes, and
170
- * the next read must see it.
171
- */
172
- /** Domain service owning the host port table. */
173
- var EvolutionPlatform = class extends Service {
174
- static inject = [];
175
- constructor(ctx) {
176
- super(ctx, "evolutionPlatform");
177
- }
178
- /**
179
- * Resolve the host ports now. Consumers read this one table; they never fall
180
- * back to a direct platform import (the second resolution D7 removed).
181
- * Deliberately uncached: `ctx.get` is the capability lifecycle.
182
- */
183
- get ports() {
184
- return {
185
- agents: agentsPort(this.ctx),
186
- connection: connectionPort(this.ctx),
187
- settings: settingsPort(this.ctx),
188
- storageDomain: storageDomainPort(this.ctx),
189
- workingDirectory: workingDirectoryPort(this.ctx),
190
- pluginManager: pluginManagerPort(this.ctx),
191
- pluginInventory: pluginInventoryPort(this.ctx),
192
- configEditor: configEditorPort(this.ctx),
193
- profileContext: profileContextPort(this.ctx),
194
- skills: skillsPort(this.ctx),
195
- commands: commandsPort(this.ctx),
196
- systemPrompt: systemPromptPort(this.ctx),
197
- subagents: subagentsPort(this.ctx),
198
- userQuestions: userQuestionsPort(this.ctx),
199
- projections: projectionPort(this.ctx),
200
- llm: llmPort(this.ctx),
201
- tools: toolsPort(this.ctx),
202
- presets: presetsPort(this.ctx)
203
- };
204
- }
205
- /** Whether an exact live root agent is available for this id. */
206
- isRootAgent(agent) {
207
- return this.ports.agents?.isRoot(agent) === true;
208
- }
209
- };
210
- //#endregion
211
159
  //#region lib/types/runtime/projections.js
212
160
  /**
213
161
  * The family's projection runtime: register the five host-only units and expose
@@ -313,13 +261,82 @@ var EvolutionProjections = class extends Service {
313
261
  }
314
262
  };
315
263
  //#endregion
264
+ //#region lib/types/runtime/minimal-preset.js
265
+ /** Family tools that must never be model-visible in the minimal preset. */
266
+ const MINIMAL_PRESET_DENY_TOOLS = [
267
+ "memory",
268
+ "skill_manage",
269
+ "skill_search",
270
+ "skill",
271
+ "maintenance_probe",
272
+ "merge_stage"
273
+ ];
274
+ function activePreset(ctx, agent) {
275
+ const projected = ctx.get("sessionProjections")?.snapshot?.(agent.session, ["agentPreset"])?.values?.agentPreset;
276
+ if (typeof projected === "string") return projected;
277
+ const headerPreset = agent.session?.header?.agentPreset;
278
+ return typeof headerPreset === "string" ? headerPreset : void 0;
279
+ }
280
+ /** Install the per-agent minimal-preset guard. */
281
+ function installMinimalPresetGuard(ctx) {
282
+ const disposers = /* @__PURE__ */ new Map();
283
+ const sync = (agent) => {
284
+ const key = agent.id;
285
+ if (activePreset(ctx, agent) !== "minimal") {
286
+ disposers.get(key)?.();
287
+ disposers.delete(key);
288
+ return;
289
+ }
290
+ if (disposers.has(key)) return;
291
+ const tools = agent.ctx?.tools;
292
+ if (tools?.restrict === void 0) return;
293
+ const known = MINIMAL_PRESET_DENY_TOOLS.filter((name) => {
294
+ try {
295
+ return tools.get?.(name, agent) !== void 0;
296
+ } catch {
297
+ return false;
298
+ }
299
+ });
300
+ if (known.length === 0) return;
301
+ try {
302
+ disposers.set(key, tools.restrict({ deny: known }));
303
+ } catch (error) {
304
+ ctx.logger.warn("dsh-evolution-core: minimal preset tool restriction failed: " + (error instanceof Error ? error.message : String(error)));
305
+ }
306
+ };
307
+ ctx.inject(["agents"], (child) => {
308
+ const events = child;
309
+ const created = events.on("agent/created", (payload) => {
310
+ const agent = payload?.agent;
311
+ if (agent !== void 0) sync(agent);
312
+ });
313
+ const selected = events.on("agent-preset/selected", (sessionId) => {
314
+ const agent = events.agents?.get(sessionId);
315
+ if (agent !== void 0) sync(agent);
316
+ });
317
+ const disposed = events.on("agent/disposed", (payload) => {
318
+ const agent = payload?.agent;
319
+ if (agent === void 0) return;
320
+ disposers.get(agent.id)?.();
321
+ disposers.delete(agent.id);
322
+ });
323
+ child.effect(() => () => {
324
+ created();
325
+ selected();
326
+ disposed();
327
+ for (const dispose of disposers.values()) dispose();
328
+ disposers.clear();
329
+ });
330
+ });
331
+ }
332
+ //#endregion
316
333
  //#region lib/types/runtime/plugin.js
317
334
  const name = "evolution-core-runtime";
318
335
  /** @param ctx - the composition context that owns the runtime services. */
319
336
  async function apply(ctx) {
320
- await ctx.plugin(EvolutionPlatform);
321
337
  await ctx.plugin(EvolutionProjections);
322
338
  await ctx.plugin(EvolutionLlm);
339
+ installMinimalPresetGuard(ctx);
323
340
  warnIfFamilyMixed(ctx);
324
341
  }
325
342
  //#endregion
@@ -676,23 +676,15 @@ function advanceReview(state, turn, signal, config) {
676
676
  state.turnsSinceSkill += signal.skillSignal ? 1 : Math.max(1, signal.toolCalls);
677
677
  const memoryDue = state.turnsSinceMemory >= config.memoryInterval;
678
678
  const skillDue = state.turnsSinceSkill >= config.skillInterval;
679
- const zero = () => {
680
- state.turnsSinceMemory = 0;
681
- state.turnsSinceSkill = 0;
682
- };
683
- if (memoryDue && skillDue) {
684
- if (config.resetOnFire !== false) zero();
685
- return "combined";
686
- }
687
- if (memoryDue) {
688
- if (config.resetOnFire !== false) state.turnsSinceMemory = 0;
689
- return "memory";
690
- }
691
- if (skillDue) {
692
- if (config.resetOnFire !== false) state.turnsSinceSkill = 0;
693
- return "skill";
679
+ if (!memoryDue && !skillDue) return null;
680
+ if (config.resetOnFire !== false) {
681
+ if (memoryDue) state.turnsSinceMemory = 0;
682
+ if (skillDue) state.turnsSinceSkill = 0;
694
683
  }
695
- return null;
684
+ return {
685
+ memory: memoryDue,
686
+ skill: skillDue
687
+ };
696
688
  }
697
689
  /**
698
690
  * Fold a log slice into one turn window, purely.
package/lib/skills.js CHANGED
@@ -1,8 +1,8 @@
1
1
  import { _ as probeMtime, b as probeText, c as transactIo, d as isAbsent, g as probeList, h as probeAbsent, i as isCommittedWarning, m as isUnknown, o as nodeEvolutionIo, p as isPresent, t as TransactionNotInvokedError, v as probePresent, x as probeUnknown, y as probeReason } from "./io-GxghO3Ip.js";
2
- import { n as mutationLockFrom } from "./mutation-authority-DQfpXs1O.js";
2
+ import { n as mutationLockFrom } from "./mutation-authority-Du-ON0NY.js";
3
3
  import { o as resolveCitations } from "./citations-CZKTUGQF.js";
4
4
  import { Q as SUPPORT_DIRS, Z as SKILL_NAME_RE, a as DEFAULT_SUPPORT_FILE_CHAR_POLICY, i as DEFAULT_SKILL_LIMITS, n as DEFAULT_CITATION_POLICY, o as POLICY_STAGE_DEFAULTS, q as PROTECTED_BUILTIN_SKILLS, r as DEFAULT_REFERENCE_REWRITE_POLICY, s as policyStageLimits, t as DEFAULT_ARCHIVE_RETENTION_POLICY, u as CONTENT_SPLIT_HINT } from "./limits-CO4JGSJL.js";
5
- import { B as READ_REQUIRED_ACTIONS, C as appendEvolutionEvent, F as lintBody, H as isUnreadWrite, I as softBodyTokenBudget, L as RULES, M as HEALTH_STAMP_RE, N as MIN_STAMP_BODY_CHARS, P as assessStructureHealth, R as diffFindings, U as sessionReadSkillNames, V as filterUnreadSkillOps, W as sessionReadSupportFiles, _ as fuzzyPatch, a as isReviewChannelSession, d as scanContentThreats, j as DEFAULT_HEALTH_THRESHOLDS, m as makeSerialQueue, q as authorityFrom, t as currentReviewContext, v as trimPatternBoundaries, w as eventsFile, z as lintSkill } from "./review-context-70XYS11J.js";
5
+ import { B as READ_REQUIRED_ACTIONS, C as appendEvolutionEvent, F as lintBody, H as isUnreadWrite, I as softBodyTokenBudget, L as RULES, M as HEALTH_STAMP_RE, N as MIN_STAMP_BODY_CHARS, P as assessStructureHealth, R as diffFindings, U as sessionReadSkillNames, V as filterUnreadSkillOps, W as sessionReadSupportFiles, _ as fuzzyPatch, a as isReviewChannelSession, d as scanContentThreats, j as DEFAULT_HEALTH_THRESHOLDS, m as makeSerialQueue, q as authorityFrom, t as currentReviewContext, v as trimPatternBoundaries, w as eventsFile, z as lintSkill } from "./review-context-CW_kJAzn.js";
6
6
  import { a as measureUnit } from "./text-metrics-CyJhxWBs.js";
7
7
  import { E as usageFile, F as describeReferenceRewrite, I as planReferenceRewrite, L as planRehoming, N as supportRefs, O as selectSections, P as applyReferenceRewrite, _ as loadUsage, p as getRecord, w as suppressedFile, y as mutateUsage } from "./usage-DrczLTP4.js";
8
8
  import { _ as validateFrontmatter, c as ensureSkillFrontmatter, d as frontmatterCatalogInvalid, f as normalizeFrontmatter, g as skillMdOnDisk, h as shrinksOverLimit, i as loadMutations, l as exceedsContentLimit, m as relatedSkillNames, o as recordMutation, p as parseFrontmatter, r as contentHash, s as authoringFeedback, u as frontmatterBlock, v as yamlPlainScalarNeedsQuotes } from "./mutations-mvTnWkua.js";
@@ -1,4 +1,4 @@
1
- import { h as restrictedPresetId, n as ensureRestrictedPreset, r as restrictedPresetState } from "../ensure-BLmEW0Ju.js";
1
+ import { h as restrictedPresetId, n as ensureRestrictedPreset, r as restrictedPresetState } from "../ensure-BpVDuDnA.js";
2
2
  //#region lib/types/subagent/readiness.js
3
3
  /** Pure derivation (no side effects): the doctor reads this, the channel re-probes on every run. */
4
4
  function probeChannelState(ctx, kind) {
@@ -1,4 +1,4 @@
1
- import { withFileLock as platformFileLock } from '@deepseek-ai/dsh-atomic-write';
1
+ import { withFileLock as platformFileLock } from '@lmzhen/dsh-evolution-adapter/values';
2
2
  /** The lock handle a serialized body receives; `release` is a no-op when a scope owns it. */
3
3
  export interface TreeLock {
4
4
  readonly token: string;
@@ -19,7 +19,7 @@
19
19
  import { AsyncLocalStorage } from 'node:async_hooks';
20
20
  import { mkdir, readFile, rm } from 'node:fs/promises';
21
21
  import { dirname, join } from 'node:path';
22
- import { withFileLock as platformFileLock } from '@deepseek-ai/dsh-atomic-write';
22
+ import { withFileLock as platformFileLock } from '@lmzhen/dsh-evolution-adapter/values';
23
23
  import { isProcessAlive } from "./io.js";
24
24
  /** Who holds the home lock right now, for doctor rows; `undefined` means free or unreadable. */
25
25
  export async function authorityHolder(home) {
@@ -1,4 +1,4 @@
1
- import { presetsPort } from "../platform/presets.js";
1
+ import { presetsPort } from '@lmzhen/dsh-evolution-adapter/ports';
2
2
  import { normalizeAllow } from "./preset-ids.js";
3
3
  import { composeRestrictedPresetDefinition, } from "./restricted-preset.js";
4
4
  const SLOTS = new WeakMap();
@@ -46,10 +46,15 @@ export interface EvolutionReviewAction {
46
46
  export interface EvolutionReviewCompletedEvent {
47
47
  readonly version: 1;
48
48
  readonly reviewId: string;
49
+ readonly taskId?: string | undefined;
49
50
  readonly sessionId: string;
50
51
  readonly branchSessionId?: string | undefined;
51
52
  readonly kind: ReviewKind;
52
- readonly status: 'completed' | 'failed' | 'timeout' | 'aborted';
53
+ readonly status: 'completed' | 'partial' | 'failed' | 'timeout' | 'aborted';
54
+ /** Tool transport used by an auxiliary review; absent for foreground inject. */
55
+ readonly toolMode?: 'native' | 'ptc' | undefined;
56
+ /** Session preset id carried by the parent header, when one exists. */
57
+ readonly preset?: string | undefined;
53
58
  readonly trigger: {
54
59
  readonly reason: string;
55
60
  readonly toolCalls: number;
@@ -61,6 +66,15 @@ export interface EvolutionReviewCompletedEvent {
61
66
  /** Model requests actually spent, and tool calls issued inside them. */
62
67
  readonly requests?: number | undefined;
63
68
  readonly toolCalls?: number | undefined;
69
+ readonly waitCount?: number | undefined;
70
+ readonly hitRoundLimit?: boolean | undefined;
71
+ readonly report?: {
72
+ readonly summary: string;
73
+ readonly memoryChanged: boolean;
74
+ readonly skillsChanged: readonly string[];
75
+ readonly unresolved: readonly string[];
76
+ } | undefined;
77
+ readonly partialReason?: string | undefined;
64
78
  readonly usage?: {
65
79
  readonly inputTokens: number;
66
80
  readonly outputTokens: number;
@@ -11,7 +11,7 @@
11
11
  * @module @lmzhen/dsh-evolution-core/http-routes
12
12
  */
13
13
  import { isRecord } from "./guards.js";
14
- import { connectionPort } from "./platform/connection.js";
14
+ import { connectionPort } from '@lmzhen/dsh-evolution-adapter/ports';
15
15
  /** Largest request body a family route accepts; a bigger one reads as "no body" (400 from the handler). */
16
16
  export const MAX_REQUEST_BODY_BYTES = 64 * 1024;
17
17
  /**
@@ -1,5 +1,5 @@
1
- import { toolsPort } from "./platform/tools.js";
2
- import { scopeOf } from "./platform/index.js";
1
+ import { toolsPort } from '@lmzhen/dsh-evolution-adapter/ports';
2
+ import { scopeOf } from '@lmzhen/dsh-evolution-adapter/values';
3
3
  /**
4
4
  * Tool names only a session that mounted the family's MODEL rows can see.
5
5
  *
@@ -12,7 +12,7 @@
12
12
  * Writing is canonical-only (a deprecated name is not a live row field in 0.48).
13
13
  * @module
14
14
  */
15
- import { settingsPort } from "./platform/settings.js";
15
+ import { settingsPort } from '@lmzhen/dsh-evolution-adapter/ports';
16
16
  /** Deprecated alias (plugin-row name) -> canonical id (policy/snapshot name).
17
17
  * Retained for the one-time legacy-document migration and the doctor's old-key report;
18
18
  * live readers use the canonical id only. */
@@ -2,9 +2,11 @@
2
2
  export declare const PLATFORM_LINE: {
3
3
  readonly version: "0.2.2-rc.5";
4
4
  readonly floor: "0.2.2-rc.5";
5
+ readonly cohort: readonly ["0.2.2-rc.5"];
6
+ readonly contract: 1;
5
7
  readonly previousAnchor: "0.2.1-rc.2";
6
- readonly peersRange: "^0.2.2-rc.5";
7
- readonly enginesRange: ">=0.2.2-rc.5 <0.2.3-0";
8
+ readonly peersRange: "0.2.2-rc.5";
9
+ readonly enginesRange: "0.2.2-rc.5";
8
10
  readonly upstreamRef: "dsh-v0.2.2-rc.5";
9
11
  };
10
12
  //# sourceMappingURL=platform-line.generated.d.ts.map
@@ -4,9 +4,13 @@
4
4
  export const PLATFORM_LINE = {
5
5
  version: '0.2.2-rc.5',
6
6
  floor: '0.2.2-rc.5',
7
+ cohort: [
8
+ '0.2.2-rc.5',
9
+ ],
10
+ contract: 1,
7
11
  previousAnchor: '0.2.1-rc.2',
8
- peersRange: '^0.2.2-rc.5',
9
- enginesRange: '>=0.2.2-rc.5 <0.2.3-0',
12
+ peersRange: '0.2.2-rc.5',
13
+ enginesRange: '0.2.2-rc.5',
10
14
  upstreamRef: 'dsh-v0.2.2-rc.5',
11
15
  };
12
16
  //# sourceMappingURL=platform-line.generated.js.map
@@ -5,7 +5,7 @@
5
5
  */
6
6
  import { asRecord } from "./guards.js";
7
7
  import { Service } from '@deepseek-ai/cordis';
8
- import { toolsPort } from "./platform/tools.js";
8
+ import { toolsPort } from '@lmzhen/dsh-evolution-adapter/ports';
9
9
  import z from '@deepseek-ai/schemastery';
10
10
  import { DEFAULT_REVIEW_MEMORY_INTERVAL, DEFAULT_REVIEW_SKILL_INTERVAL, DEFAULT_SUBSTANTIVE_MIN_TOOL_CALLS, DEFAULT_SUBSTANTIVE_MIN_USER_CHARS, FORBIDDEN_CONTROL_KEYS, PROTECTED_BUILTIN_SKILLS, DEFAULT_SUBSTANTIVE_MIN_AGENT_CHARS, DEFAULT_CURATOR_INTERVAL_HOURS, DEFAULT_STALE_AFTER_DAYS, EVOLUTION_WRITE_TOOLS, DEFAULT_ARCHIVE_AFTER_DAYS, DEFAULT_MEMORY_CHAR_LIMIT, DEFAULT_USER_CHAR_LIMIT, DEFAULT_SKILL_CONTENT_CHARS, DEFAULT_CURATOR_MODEL, } from "./constants.js";
11
11
  import { DEFAULT_CITATION_POLICY, DEFAULT_REFERENCE_REWRITE_POLICY, DEFAULT_ARCHIVE_RETENTION_POLICY, DEFAULT_SUPPORT_FILE_CHAR_POLICY, POLICY_STAGE_DEFAULTS, } from "./limits.js";
@@ -261,7 +261,7 @@ export const SKILLS_GUIDANCE = `Skills guidance:
261
261
  • When using a skill and finding it outdated, incomplete, or wrong, patch it immediately with skill_manage (action='patch') — don't wait to be asked. Skills that aren't maintained become liabilities.`;
262
262
  export function reviewPrompt(kind, surface = 'inject') {
263
263
  if (surface === 'aux')
264
- return kind === 'memory' ? INJECT_MEMORY_REVIEW_PROMPT : INJECT_COMBINED_REVIEW_PROMPT;
264
+ return kind === 'memory' ? INJECT_MEMORY_REVIEW_PROMPT : INJECT_SKILL_REVIEW_PROMPT;
265
265
  if (kind === 'memory')
266
266
  return INJECT_MEMORY_REVIEW_PROMPT;
267
267
  if (kind === 'skill')
@@ -1,5 +1,5 @@
1
- import { presetsPort } from "./platform/presets.js";
2
- import { toolsPort } from "./platform/tools.js";
1
+ import { presetsPort } from '@lmzhen/dsh-evolution-adapter/ports';
2
+ import { toolsPort } from '@lmzhen/dsh-evolution-adapter/ports';
3
3
  import { errorText } from "./errors.js";
4
4
  export const name = 'evolution-restrictor';
5
5
  export const inject = ['agentPresets'];
@@ -1,35 +1,7 @@
1
1
  /**
2
- * The family's Result/error vocabulary for new boundaries.
2
+ * Compatibility re-export of the family Result vocabulary.
3
3
  *
4
- * Existing surfaces keep their structured `{ ok, message }` policy; this module
5
- * is the typed seam for code that wants an explicit success/failure value
6
- * without throwing through a domain boundary.
4
+ * @module @lmzhen/dsh-evolution-core/result
7
5
  */
8
- export type FamilyErrorCode = 'E-301' | 'E-302' | 'E-303' | 'E-304' | 'E-305' | 'E-306' | 'E-307' | 'E-308' | 'E-309' | 'E-310' | 'E-311' | 'E-312' | 'E-313' | 'E-314' | 'E-315' | 'E-316' | 'E-317' | 'E-318' | 'E-319' | 'E-320' | 'E-321' | 'E-322' | 'E-323' | 'E-324' | 'E-325' | 'E-326';
9
- export interface FamilyError {
10
- readonly code: FamilyErrorCode;
11
- readonly message: string;
12
- readonly cause?: unknown;
13
- }
14
- export type Result<T, E = FamilyError> = {
15
- readonly ok: true;
16
- readonly value: T;
17
- } | {
18
- readonly ok: false;
19
- readonly error: E;
20
- };
21
- export declare function ok<T>(value: T): Result<T, never>;
22
- export declare function err<E>(error: E): Result<never, E>;
23
- export declare function isOk<T, E>(result: Result<T, E>): result is {
24
- readonly ok: true;
25
- readonly value: T;
26
- };
27
- export declare function isErr<T, E>(result: Result<T, E>): result is {
28
- readonly ok: false;
29
- readonly error: E;
30
- };
31
- /** The value, or the supplied fallback when the result is an error. */
32
- export declare function unwrapOr<T, E>(result: Result<T, E>, fallback: T): T;
33
- /** Coerce a caught value into the family error shape. */
34
- export declare function familyError(code: FamilyErrorCode, cause: unknown): FamilyError;
6
+ export * from '@lmzhen/dsh-evolution-platform-contract/result';
35
7
  //# sourceMappingURL=result.d.ts.map