@lmzhen/dsh-evolution-core 0.37.1 → 0.39.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 (54) hide show
  1. package/README.md +4 -2
  2. package/lib/composition/index.js +2 -2
  3. package/lib/{composition-DckDtQTR.js → composition-dy0gJWDd.js} +1 -1
  4. package/lib/{ensure-CLF9YeBD.js → ensure-B4fjEI0w.js} +3 -10
  5. package/lib/index.js +67 -1302
  6. package/lib/platform/index.js +4 -0
  7. package/lib/platform-Be-_wSVz.js +113 -0
  8. package/lib/presets-C8vuCuNA.js +27 -0
  9. package/lib/restrictor.js +7 -7
  10. package/lib/runtime/plugin.js +197 -0
  11. package/lib/session-projection-CXUNPkq9.js +1250 -0
  12. package/lib/subagent/index.js +1 -1
  13. package/lib/tools-DzcNFex2.js +20 -0
  14. package/lib/types/composition/ensure.js +3 -13
  15. package/lib/types/events.d.ts +1 -1
  16. package/lib/types/index.d.ts +1 -0
  17. package/lib/types/index.js +1 -0
  18. package/lib/types/opt-in.d.ts +1 -1
  19. package/lib/types/opt-in.js +1 -1
  20. package/lib/types/params.js +2 -2
  21. package/lib/types/platform/index.d.ts +21 -0
  22. package/lib/types/platform/index.js +12 -0
  23. package/lib/types/platform/llm.d.ts +46 -0
  24. package/lib/types/platform/llm.js +75 -0
  25. package/lib/types/platform/presets.d.ts +31 -0
  26. package/lib/types/platform/presets.js +31 -0
  27. package/lib/types/platform/projections.d.ts +30 -0
  28. package/lib/types/platform/projections.js +31 -0
  29. package/lib/types/platform/tools.d.ts +23 -0
  30. package/lib/types/platform/tools.js +21 -0
  31. package/lib/types/platform-line.generated.d.ts +6 -6
  32. package/lib/types/platform-line.generated.js +6 -6
  33. package/lib/types/platform-services.d.ts +1 -1
  34. package/lib/types/platform-services.js +4 -1
  35. package/lib/types/restrictor.js +7 -9
  36. package/lib/types/review-context.d.ts +20 -0
  37. package/lib/types/review-context.js +28 -0
  38. package/lib/types/runtime/llm.d.ts +34 -0
  39. package/lib/types/runtime/llm.js +71 -0
  40. package/lib/types/runtime/platform.d.ts +35 -0
  41. package/lib/types/runtime/platform.js +38 -0
  42. package/lib/types/runtime/plugin.d.ts +10 -0
  43. package/lib/types/runtime/plugin.js +11 -0
  44. package/lib/types/runtime/projections.d.ts +29 -0
  45. package/lib/types/runtime/projections.js +62 -0
  46. package/lib/types/scope.d.ts +1 -1
  47. package/lib/types/session-projection.d.ts +26 -53
  48. package/lib/types/session-projection.js +22 -58
  49. package/lib/types/skill-reads.js +3 -3
  50. package/lib/types/skill-store.js +3 -0
  51. package/lib/types/subagent/types.d.ts +1 -1
  52. package/lib/types/tool-dispatch.d.ts +2 -2
  53. package/lib/types/tool-dispatch.js +3 -3
  54. package/package.json +30 -16
package/README.md CHANGED
@@ -2,7 +2,9 @@
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`, and `./restrictor` subpaths.
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.
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.
6
8
 
7
9
  `./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.
8
10
 
@@ -13,7 +15,7 @@ The root entry is a library, not a user-facing command. The package also exposes
13
15
  | `evolution/skill-mutated` | emit (one-way) | Invalidate catalog state after a skill-tree write. |
14
16
  | `evolution/skills-refresh` | emit (one-way) | Explicitly refresh the catalog after `/evolution skills refresh`. |
15
17
  | `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. |
18
+ | `evolution/review-completed` | emit (one-way) | An auxiliary review completed, including failure/timeout status when known. |
17
19
  | `evolution/review-error` | emit (one-way) | The review pipeline failed. |
18
20
  | `evolution/plan-applied` | emit (one-way) | A reviewed plan produced an execution result. |
19
21
  | `evolution/memory-applied` | emit (one-way) | A memory write succeeded through the registry sink. |
@@ -1,3 +1,3 @@
1
- import { a as entryListSchema, c as MAINTAINER_PRESET_ID, d as RESTRICTED_TOOLS_ROW_ID, f as RESTRICTOR_MODULE, h as restrictedPresetId, i as composeRestrictedPresetDefinition, l as RESTRICTED_PRESET_DELIVERY, 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-CLF9YeBD.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-DckDtQTR.js";
1
+ import { a as entryListSchema, c as MAINTAINER_PRESET_ID, d as RESTRICTED_TOOLS_ROW_ID, f as RESTRICTOR_MODULE, h as restrictedPresetId, i as composeRestrictedPresetDefinition, l as RESTRICTED_PRESET_DELIVERY, 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-B4fjEI0w.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-dy0gJWDd.js";
3
3
  export { AGENT_PRESET_PACKAGE, AGENT_PRESET_ROOT_HINT, EMPTY_PATCH_SEED, EVOLUTION_PRESET_IDS, MAINTAINER_PRESET_ID, RESTRICTED_PRESET_DELIVERY, 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-CLF9YeBD.js";
1
+ import { _ as scopedPackageName } from "./ensure-B4fjEI0w.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,4 +1,5 @@
1
1
  import { n as errorText } from "./errors-DUcEoTLR.js";
2
+ import { t as presetsPort } from "./presets-C8vuCuNA.js";
2
3
  import { dirname, join } from "node:path";
3
4
  import { existsSync, readFileSync } from "node:fs";
4
5
  import { fileURLToPath } from "node:url";
@@ -129,18 +130,10 @@ function slotFor(ctx, kind) {
129
130
  }
130
131
  return slot;
131
132
  }
132
- function registryOf(ctx) {
133
- const candidate = ctx.get("agentPresets");
134
- if (candidate === void 0) return void 0;
135
- if (typeof candidate.readDocument !== "function" || typeof candidate.register !== "function") return void 0;
136
- return candidate;
137
- }
138
133
  function installReleaseEffect(ctx, slot) {
139
134
  if (slot.effectInstalled === true) return;
140
- const effect = ctx.effect;
141
- if (effect === void 0) return;
142
135
  slot.effectInstalled = true;
143
- effect.call(ctx, () => () => {
136
+ ctx.effect(() => () => {
144
137
  releaseRestrictedPreset(ctx, void 0, slot);
145
138
  }, "evolution-restricted-preset");
146
139
  }
@@ -169,7 +162,7 @@ async function ensureRestrictedPreset(ctx, req) {
169
162
  };
170
163
  return slot.state;
171
164
  }
172
- const registry = registryOf(ctx);
165
+ const registry = presetsPort(ctx);
173
166
  if (registry === void 0) {
174
167
  slot.state = {
175
168
  kind: "failed",