@lmzhen/dsh-evolution-core 0.39.1 → 0.40.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 (44) hide show
  1. package/lib/index.js +3611 -3274
  2. package/lib/platform/index.js +2 -2
  3. package/lib/{platform-Be-_wSVz.js → platform-CFp373_0.js} +3 -1
  4. package/lib/runtime/plugin.js +1 -1
  5. package/lib/types/events.d.ts +1 -1
  6. package/lib/types/evolution-events.d.ts +3 -1
  7. package/lib/types/evolution-events.js +65 -59
  8. package/lib/types/home-fence.d.ts +24 -0
  9. package/lib/types/home-fence.js +62 -0
  10. package/lib/types/home-owner.d.ts +4 -0
  11. package/lib/types/home-owner.js +37 -0
  12. package/lib/types/index.d.ts +4 -0
  13. package/lib/types/index.js +4 -0
  14. package/lib/types/lease-store.d.ts +55 -0
  15. package/lib/types/lease-store.js +116 -0
  16. package/lib/types/memory-store.d.ts +6 -0
  17. package/lib/types/memory-store.js +16 -8
  18. package/lib/types/mutation-authority.d.ts +59 -0
  19. package/lib/types/mutation-authority.js +126 -0
  20. package/lib/types/mutation-storage-adapter.js +7 -3
  21. package/lib/types/mutation-unit.d.ts +13 -0
  22. package/lib/types/mutation-unit.js +7 -2
  23. package/lib/types/mutations.d.ts +3 -1
  24. package/lib/types/mutations.js +40 -34
  25. package/lib/types/platform/index.d.ts +5 -2
  26. package/lib/types/platform/index.js +2 -0
  27. package/lib/types/platform-services.js +1 -0
  28. package/lib/types/prompts.d.ts +13 -19
  29. package/lib/types/prompts.js +59 -157
  30. package/lib/types/proposal-report.d.ts +1 -0
  31. package/lib/types/proposal-report.js +12 -0
  32. package/lib/types/run-registry.d.ts +4 -0
  33. package/lib/types/run-registry.js +10 -3
  34. package/lib/types/skill-history.d.ts +4 -1
  35. package/lib/types/skill-history.js +24 -29
  36. package/lib/types/skill-store.d.ts +11 -3
  37. package/lib/types/skill-store.js +26 -12
  38. package/lib/types/unit-storage.d.ts +2 -0
  39. package/lib/types/unit-transaction.d.ts +6 -1
  40. package/lib/types/unit-transaction.js +20 -6
  41. package/lib/types/usage.d.ts +4 -0
  42. package/lib/types/usage.js +84 -78
  43. package/package.json +2 -2
  44. package/persisted-write-inventory.json +9 -0
@@ -0,0 +1,59 @@
1
+ import type { MutationOwner } from '@lmzhen/dsh-evolution-contract';
2
+ import { HomeFence } from './home-fence.ts';
3
+ import { LeaseStore, type LeaseToken } from './lease-store.ts';
4
+ import type { EvolutionIoLike } from './io.ts';
5
+ import { type MutationLockPort, type MutationLimits, type MutationResult, type MutationSnapshotPort, type MutationUnitOptions, type MutationRequest } from './mutation-unit.ts';
6
+ export interface MutationAuthorityContext {
7
+ readonly owner: MutationOwner;
8
+ readonly runId: string;
9
+ readonly lease: LeaseToken;
10
+ readonly signal?: AbortSignal;
11
+ }
12
+ export type MutationAuthorityApplyOptions = Omit<MutationUnitOptions, 'io' | 'lock' | 'serial' | 'context'>;
13
+ export interface RecoveryReport {
14
+ readonly recovered: readonly MutationResult[];
15
+ readonly blocked: readonly {
16
+ readonly unitId: string;
17
+ readonly runId?: string;
18
+ }[];
19
+ }
20
+ export declare class MutationAuthorityError extends Error {
21
+ readonly code: 'lease-missing' | 'lease-mismatch' | 'fence-busy' | 'fence-io' | 'transact-failed';
22
+ constructor(code: MutationAuthorityError['code'], message: string);
23
+ }
24
+ export interface MutationAuthorityOptions {
25
+ readonly io: EvolutionIoLike;
26
+ readonly home: string;
27
+ readonly leases?: LeaseStore;
28
+ readonly fence?: HomeFence;
29
+ readonly waitMs?: number;
30
+ readonly now?: () => number;
31
+ }
32
+ /**
33
+ * Plugin-side write authority: one home fence + one active lease before any
34
+ * multi-file unit or single-file transaction. Domain code never takes a second
35
+ * lock; MutationUnit remains the only multi-file transaction engine.
36
+ */
37
+ export declare function mutationLockFrom(ctx: {
38
+ get?(name: string): unknown;
39
+ } | undefined): MutationLockPort | undefined;
40
+ export declare class MutationAuthority {
41
+ private readonly io;
42
+ private readonly leases;
43
+ private readonly fence;
44
+ /** Lease primitives for domain run/claim owners. */
45
+ get lease(): LeaseStore;
46
+ /** The one home fence domain unit engines must reuse instead of taking tree-lock themselves. */
47
+ get homeFence(): HomeFence;
48
+ /** Adapter for legacy MutationUnit call sites that accept a lock port. */
49
+ get mutationLock(): MutationLockPort;
50
+ constructor(options: MutationAuthorityOptions);
51
+ private assertLease;
52
+ apply(request: MutationRequest, context: MutationAuthorityContext, options: MutationAuthorityApplyOptions): Promise<MutationResult>;
53
+ transact(path: string, task: (current: string | null) => Promise<string | null> | string | null, context: MutationAuthorityContext): Promise<void>;
54
+ recover(options: {
55
+ readonly snapshots: MutationSnapshotPort;
56
+ readonly limits: MutationLimits;
57
+ }): Promise<RecoveryReport>;
58
+ }
59
+ //# sourceMappingURL=mutation-authority.d.ts.map
@@ -0,0 +1,126 @@
1
+ import { HomeFence, HomeFenceError } from "./home-fence.js";
2
+ import { LeaseStore } from "./lease-store.js";
3
+ import { MutationUnit, } from "./mutation-unit.js";
4
+ export class MutationAuthorityError extends Error {
5
+ code;
6
+ constructor(code, message) {
7
+ super(message);
8
+ this.name = 'MutationAuthorityError';
9
+ this.code = code;
10
+ }
11
+ }
12
+ const passiveLock = {
13
+ async acquire() {
14
+ return { async release() { } };
15
+ },
16
+ };
17
+ const identitySerial = async (task) => await task();
18
+ /**
19
+ * Plugin-side write authority: one home fence + one active lease before any
20
+ * multi-file unit or single-file transaction. Domain code never takes a second
21
+ * lock; MutationUnit remains the only multi-file transaction engine.
22
+ */
23
+ export function mutationLockFrom(ctx) {
24
+ if (ctx?.get === undefined)
25
+ return undefined;
26
+ const authority = ctx.get('evolutionMutationAuthority');
27
+ return authority?.mutationLock;
28
+ }
29
+ export class MutationAuthority {
30
+ io;
31
+ leases;
32
+ fence;
33
+ /** Lease primitives for domain run/claim owners. */
34
+ get lease() { return this.leases; }
35
+ /** The one home fence domain unit engines must reuse instead of taking tree-lock themselves. */
36
+ get homeFence() { return this.fence; }
37
+ /** Adapter for legacy MutationUnit call sites that accept a lock port. */
38
+ get mutationLock() {
39
+ return {
40
+ acquire: async () => {
41
+ const lease = await this.fence.acquire();
42
+ return { release: async () => { await lease.release(); } };
43
+ },
44
+ };
45
+ }
46
+ constructor(options) {
47
+ this.io = options.io;
48
+ this.leases = options.leases ?? new LeaseStore({ io: options.io, home: options.home, ...(options.now === undefined ? {} : { now: options.now }) });
49
+ this.fence = options.fence ?? new HomeFence({ io: options.io, home: options.home, ...(options.waitMs === undefined ? {} : { waitMs: options.waitMs }), ...(options.now === undefined ? {} : { now: options.now }) });
50
+ }
51
+ async assertLease(context) {
52
+ const current = await this.leases.active(context.runId);
53
+ if (current === null)
54
+ throw new MutationAuthorityError('lease-missing', 'mutation lease is not active for ' + context.runId);
55
+ if (current.id !== context.lease.id || current.epoch !== context.lease.epoch || current.owner !== context.owner) {
56
+ throw new MutationAuthorityError('lease-mismatch', 'mutation lease does not own ' + context.runId);
57
+ }
58
+ }
59
+ async apply(request, context, options) {
60
+ if (context.signal?.aborted === true)
61
+ throw new MutationAuthorityError('transact-failed', 'mutation aborted before apply');
62
+ await this.assertLease(context);
63
+ try {
64
+ return await this.fence.run(async () => {
65
+ await this.assertLease(context);
66
+ const unitContext = { owner: context.owner, runId: context.runId, leaseId: context.lease.id };
67
+ const unit = new MutationUnit({ io: this.io, lock: passiveLock, serial: identitySerial, context: unitContext, ...options });
68
+ return await unit.apply(request);
69
+ });
70
+ }
71
+ catch (error) {
72
+ if (error instanceof HomeFenceError) {
73
+ throw new MutationAuthorityError(error.reason === 'busy' ? 'fence-busy' : 'fence-io', error.message);
74
+ }
75
+ throw error;
76
+ }
77
+ }
78
+ async transact(path, task, context) {
79
+ await this.assertLease(context);
80
+ try {
81
+ return await this.fence.run(async () => {
82
+ await this.assertLease(context);
83
+ const body = async (current) => await task(current);
84
+ if (this.io.transact !== undefined)
85
+ await this.io.transact(path, body);
86
+ else {
87
+ const current = await this.io.readText(path);
88
+ const next = await body(current);
89
+ if (next === null)
90
+ await this.io.remove(path);
91
+ else if (next !== current)
92
+ await this.io.writeText(path, next);
93
+ }
94
+ return;
95
+ });
96
+ }
97
+ catch (error) {
98
+ if (error instanceof HomeFenceError) {
99
+ throw new MutationAuthorityError(error.reason === 'busy' ? 'fence-busy' : 'fence-io', error.message);
100
+ }
101
+ throw error;
102
+ }
103
+ }
104
+ async recover(options) {
105
+ return await this.fence.run(async () => {
106
+ const unit = new MutationUnit({ io: this.io, snapshots: options.snapshots, limits: options.limits, lock: passiveLock, serial: identitySerial });
107
+ const prepared = await options.snapshots.listPrepared?.() ?? [];
108
+ const recovered = [];
109
+ const blocked = [];
110
+ for (const snapshot of prepared) {
111
+ if (snapshot.runId === undefined) {
112
+ blocked.push({ unitId: snapshot.unitId });
113
+ continue;
114
+ }
115
+ const lease = await this.leases.active(snapshot.runId);
116
+ if (lease !== null) {
117
+ blocked.push({ unitId: snapshot.unitId, runId: snapshot.runId });
118
+ continue;
119
+ }
120
+ recovered.push(await unit.recover(snapshot.unitId));
121
+ }
122
+ return { recovered, blocked };
123
+ });
124
+ }
125
+ }
126
+ //# sourceMappingURL=mutation-authority.js.map
@@ -15,7 +15,7 @@ export function unitSnapshotPort(io, home) {
15
15
  schemaVersion: 1,
16
16
  unitId: snapshot.unitId,
17
17
  planDigest: contentHash(JSON.stringify(snapshot.ops)),
18
- runId: snapshot.unitId,
18
+ runId: snapshot.runId ?? snapshot.unitId,
19
19
  target: first?.target ?? '',
20
20
  targetExists: true,
21
21
  targetBefore: first?.before ?? null,
@@ -23,7 +23,8 @@ export function unitSnapshotPort(io, home) {
23
23
  supportBefore: [],
24
24
  supportAfter: [],
25
25
  sourceBefore: [],
26
- origin: 'foreground',
26
+ origin: snapshot.owner ?? 'foreground',
27
+ ...(snapshot.leaseId === undefined ? {} : { leaseId: snapshot.leaseId }),
27
28
  summary: 'tree-change ' + snapshot.unitId,
28
29
  createdAt: snapshot.createdAt,
29
30
  kind: 'tree-change',
@@ -48,6 +49,9 @@ export function unitSnapshotPort(io, home) {
48
49
  ops: snapshot.ops,
49
50
  ...(snapshot.cleanup === undefined ? {} : { cleanup: snapshot.cleanup }),
50
51
  createdAt: snapshot.createdAt,
52
+ ...(snapshot.origin === 'foreground' || snapshot.origin === 'background_review' ? { owner: snapshot.origin } : {}),
53
+ runId: snapshot.runId,
54
+ ...(snapshot.leaseId === undefined ? {} : { leaseId: snapshot.leaseId }),
51
55
  };
52
56
  },
53
57
  async listPrepared() {
@@ -73,7 +77,7 @@ export function unitSnapshotPort(io, home) {
73
77
  if (seen.has(snapshot.unitId))
74
78
  continue;
75
79
  seen.add(snapshot.unitId);
76
- out.push({ unitId: snapshot.unitId, state: 'prepared', ops: snapshot.ops, ...(snapshot.cleanup === undefined ? {} : { cleanup: snapshot.cleanup }), createdAt: snapshot.createdAt });
80
+ out.push({ unitId: snapshot.unitId, state: 'prepared', ops: snapshot.ops, ...(snapshot.cleanup === undefined ? {} : { cleanup: snapshot.cleanup }), createdAt: snapshot.createdAt, ...(snapshot.origin === 'foreground' || snapshot.origin === 'background_review' ? { owner: snapshot.origin } : {}), runId: snapshot.runId, ...(snapshot.leaseId === undefined ? {} : { leaseId: snapshot.leaseId }) });
77
81
  }
78
82
  }
79
83
  return out;
@@ -1,4 +1,5 @@
1
1
  import { type transactIo } from './io.ts';
2
+ import type { MutationOwner } from '@lmzhen/dsh-evolution-contract';
2
3
  export interface MutationRoot {
3
4
  name: string;
4
5
  protection: 'write' | 'delete' | 'none';
@@ -80,6 +81,15 @@ export interface MutationSnapshot {
80
81
  ops: readonly MutationSnapshotOp[];
81
82
  cleanup?: readonly string[];
82
83
  createdAt: number;
84
+ owner?: MutationOwner;
85
+ runId?: string;
86
+ leaseId?: string;
87
+ }
88
+ /** Identity attached to one MutationUnit's snapshot/journal writes. */
89
+ export interface MutationUnitContext {
90
+ readonly owner: MutationOwner;
91
+ readonly runId: string;
92
+ readonly leaseId: string;
83
93
  }
84
94
  export interface MutationSnapshotPort {
85
95
  write(snapshot: MutationSnapshot): Promise<void>;
@@ -105,6 +115,7 @@ export interface MutationUnitOptions {
105
115
  journal?: MutationJournalPort;
106
116
  snapshots?: MutationSnapshotPort;
107
117
  hooks?: MutationUnitHooks;
118
+ context?: MutationUnitContext;
108
119
  validateWrite?: (op: TreeChangeOp) => string | null;
109
120
  transact?: typeof transactIo;
110
121
  /** @deprecated the kernel always re-checks the baseline; kept for source compatibility. */
@@ -134,6 +145,7 @@ export declare class MutationUnit {
134
145
  private readonly journal;
135
146
  private readonly snapshots;
136
147
  private readonly hooks;
148
+ private readonly context;
137
149
  private readonly validateWrite;
138
150
  private readonly kernel;
139
151
  private readonly transactGuard;
@@ -145,6 +157,7 @@ export declare class MutationUnit {
145
157
  recoverPrepared(): Promise<MutationResult[]>;
146
158
  /** Converge a prepared unit left by a crash. Every path must be at its after-bytes; a drift refuses the whole recovery. */
147
159
  recover(unitId: string): Promise<MutationResult>;
160
+ private contextFields;
148
161
  undo(unitId: string): Promise<MutationResult>;
149
162
  private applyOp;
150
163
  private rollback;
@@ -101,6 +101,7 @@ export class MutationUnit {
101
101
  journal;
102
102
  snapshots;
103
103
  hooks;
104
+ context;
104
105
  validateWrite;
105
106
  kernel;
106
107
  transactGuard;
@@ -113,6 +114,7 @@ export class MutationUnit {
113
114
  this.journal = options.journal;
114
115
  this.snapshots = options.snapshots;
115
116
  this.hooks = options.hooks;
117
+ this.context = options.context;
116
118
  this.validateWrite = options.validateWrite;
117
119
  this.transactGuard = options.transactGuard !== false;
118
120
  this.now = options.now ?? Date.now;
@@ -183,7 +185,7 @@ export class MutationUnit {
183
185
  });
184
186
  const cleanup = request.cleanupPaths === undefined ? {} : { cleanup: request.cleanupPaths };
185
187
  if (this.snapshots !== undefined)
186
- await bestEffort(() => this.snapshots.write({ unitId, state: 'prepared', ops: eventOps, ...cleanup, createdAt: this.now() }));
188
+ await bestEffort(() => this.snapshots.write({ unitId, state: 'prepared', ops: eventOps, ...cleanup, createdAt: this.now(), ...this.contextFields() }));
187
189
  await bestEffort(async () => this.journal?.write({ unitId, phase: 'prepared', changed: [], target: validation.roots.find(root => root.name === primary)?.name ?? primary, roots: validation.roots.map(root => root.name) }));
188
190
  for (const op of validation.ops) {
189
191
  const snapshot = snapshots.find(entry => entry.target === op.target);
@@ -206,7 +208,7 @@ export class MutationUnit {
206
208
  // P2-1: the committed snapshot is the recovery authority. Write it BEFORE the journal's
207
209
  // committed phase so a crash in this window recovers as committed, never rolled back.
208
210
  if (this.snapshots !== undefined)
209
- await bestEffort(() => this.snapshots.write({ unitId, state: 'committed', ops: eventOps, ...cleanup, createdAt: this.now() }));
211
+ await bestEffort(() => this.snapshots.write({ unitId, state: 'committed', ops: eventOps, ...cleanup, createdAt: this.now(), ...this.contextFields() }));
210
212
  await bestEffort(async () => this.journal?.write({ unitId, phase: 'committed', changed, target: primary, roots: validation.roots.map(root => root.name) }));
211
213
  try {
212
214
  await this.hooks?.committed?.({ unitId, changed, ops: eventOps, roots: validation.roots.map(root => root.name) });
@@ -313,6 +315,9 @@ export class MutationUnit {
313
315
  }
314
316
  });
315
317
  }
318
+ contextFields() {
319
+ return this.context === undefined ? {} : { owner: this.context.owner, runId: this.context.runId, leaseId: this.context.leaseId };
320
+ }
316
321
  async undo(unitId) {
317
322
  const snapshot = await this.snapshots?.read(unitId);
318
323
  if (snapshot === undefined || snapshot === null) {
@@ -28,5 +28,7 @@ export declare function mutationsFile(root: string): string;
28
28
  export declare function contentHash(content: string): string;
29
29
  export declare function loadMutations(root: string, io?: EvolutionIoLike): Promise<MutationRecord[]>;
30
30
  /** Append one record, trim to `cap`, and write atomically (versioned shape). */
31
- export declare function recordMutation(root: string, io: EvolutionIoLike, record: MutationRecord, cap?: number): Promise<void>;
31
+ export declare function recordMutation(root: string, io: EvolutionIoLike, record: MutationRecord, cap?: number, fence?: {
32
+ run<T>(body: () => Promise<T>): Promise<T>;
33
+ }): Promise<void>;
32
34
  //# sourceMappingURL=mutations.d.ts.map
@@ -52,44 +52,50 @@ export async function loadMutations(root, io = nodeEvolutionIo()) {
52
52
  return parseMutationRecords(await io.readText(mutationsFile(root)));
53
53
  }
54
54
  /** Append one record, trim to `cap`, and write atomically (versioned shape). */
55
- export async function recordMutation(root, io, record, cap = DEFAULT_MUTATION_CAP) {
55
+ export async function recordMutation(root, io, record, cap = DEFAULT_MUTATION_CAP, fence) {
56
56
  // The read-append-write runs as one atomic transact (rc.50 P2-2): a second
57
57
  // process sharing DSH_HOME can no longer interleave its append between our
58
58
  // read and write and lose an audit record.
59
- await transactIo(io, mutationsFile(root), (current) => {
60
- // P3 (v3 audit): never overwrite a malformed audit file with a re-serialized empty.
61
- // P3 (v15): parse exactly ONCE — the malformed guard and the record
62
- // extraction used to JSON.parse the same bytes twice inside one transact
63
- // (the guard distinguishes malformed-JSON-preserve from
64
- // valid-but-shapeless-migrate, which is why the two checks are separate
65
- // even though the parse is shared).
66
- let parsed = [];
67
- if (current !== null) {
68
- try {
69
- parsed = JSON.parse(current);
59
+ const write = async () => {
60
+ await transactIo(io, mutationsFile(root), (current) => {
61
+ // P3 (v3 audit): never overwrite a malformed audit file with a re-serialized empty.
62
+ // P3 (v15): parse exactly ONCE — the malformed guard and the record
63
+ // extraction used to JSON.parse the same bytes twice inside one transact
64
+ // (the guard distinguishes malformed-JSON-preserve from
65
+ // valid-but-shapeless-migrate, which is why the two checks are separate
66
+ // even though the parse is shared).
67
+ let parsed = [];
68
+ if (current !== null) {
69
+ try {
70
+ parsed = JSON.parse(current);
71
+ }
72
+ catch {
73
+ // C-08: the drop is not silent — every append against the malformed
74
+ // file warns (the wording used to claim "warn once"; the guard has no
75
+ // once-guard and each dropped append is independently worth seeing).
76
+ // Still best-effort — no retry, and the mutation itself never fails
77
+ // on auditing.
78
+ console.warn(`mutation audit record dropped: ${mutationsFile(root)} is malformed and was not overwritten`);
79
+ return current;
80
+ }
70
81
  }
71
- catch {
72
- // C-08: the drop is not silent — every append against the malformed
73
- // file warns (the wording used to claim "warn once"; the guard has no
74
- // once-guard and each dropped append is independently worth seeing).
75
- // Still best-effort — no retry, and the mutation itself never fails
76
- // on auditing.
77
- console.warn(`mutation audit record dropped: ${mutationsFile(root)} is malformed and was not overwritten`);
78
- return current;
82
+ // A2-11 (v18): a newer on-disk version is never downgraded by this writer.
83
+ if (isRecord(parsed)) {
84
+ const version = parsed.version;
85
+ if (typeof version === 'number' && version > MUTATIONS_FILE_VERSION) {
86
+ console.warn(`mutation audit record dropped: ${mutationsFile(root)} declares version ${version} (newer than ${MUTATIONS_FILE_VERSION}); not overwritten`);
87
+ return current;
88
+ }
79
89
  }
80
- }
81
- // A2-11 (v18): a newer on-disk version is never downgraded by this writer.
82
- if (isRecord(parsed)) {
83
- const version = parsed.version;
84
- if (typeof version === 'number' && version > MUTATIONS_FILE_VERSION) {
85
- console.warn(`mutation audit record dropped: ${mutationsFile(root)} declares version ${version} (newer than ${MUTATIONS_FILE_VERSION}); not overwritten`);
86
- return current;
87
- }
88
- }
89
- const existing = recordsFromParsed(parsed);
90
- existing.push(record);
91
- const trimmed = existing.length > cap ? existing.slice(existing.length - cap) : existing;
92
- return JSON.stringify({ version: MUTATIONS_FILE_VERSION, records: trimmed }, null, 2);
93
- });
90
+ const existing = recordsFromParsed(parsed);
91
+ existing.push(record);
92
+ const trimmed = existing.length > cap ? existing.slice(existing.length - cap) : existing;
93
+ return JSON.stringify({ version: MUTATIONS_FILE_VERSION, records: trimmed }, null, 2);
94
+ });
95
+ };
96
+ if (fence !== undefined)
97
+ await fence.run(write);
98
+ else
99
+ await write();
94
100
  }
95
101
  //# sourceMappingURL=mutations.js.map
@@ -7,8 +7,11 @@
7
7
  export { defineTool } from '@deepseek-ai/dsh-tools';
8
8
  export type { ObjectJsonSchema, ToolDefinition, ToolGuard, ToolRestriction, } from '@deepseek-ai/dsh-tools';
9
9
  export type { CommandInvocation, CommandResult } from '@deepseek-ai/dsh-commands';
10
- export type { StreamChunk } from '@deepseek-ai/dsh-llm';
11
- export type { Session, SessionEvent } from '@deepseek-ai/dsh-session';
10
+ export { BlockAssembler, createToolResultMessage, createUserMessage } from '@deepseek-ai/dsh-llm';
11
+ export type { ContentBlock, ContextFormed, GenerateOptions, Message, RequestMessage, StreamChunk, ToolCallBlock, ToolCallId, ToolHistory, ToolSchema, } from '@deepseek-ai/dsh-llm';
12
+ export { SessionId } from '@deepseek-ai/dsh-session';
13
+ export type { EpochHeader, Session, SessionEvent } from '@deepseek-ai/dsh-session';
14
+ export type { Agent } from '@deepseek-ai/dsh-agent';
12
15
  export type { PromptContext, PromptSection } from '@deepseek-ai/dsh-system-prompt';
13
16
  export { presetsPort } from './presets.ts';
14
17
  export type { PresetDefinitionLike, PresetDocument, PresetsPort } from './presets.ts';
@@ -5,6 +5,8 @@
5
5
  * the platform-boundary gate keeps @deepseek-ai/dsh-* imports inside core/platform.
6
6
  */
7
7
  export { defineTool } from '@deepseek-ai/dsh-tools';
8
+ export { BlockAssembler, createToolResultMessage, createUserMessage } from '@deepseek-ai/dsh-llm';
9
+ export { SessionId } from '@deepseek-ai/dsh-session';
8
10
  export { presetsPort } from "./presets.js";
9
11
  export { projectionPort } from "./projections.js";
10
12
  export { EvolutionLlmError, llmPort, modelRoute } from "./llm.js";
@@ -23,6 +23,7 @@ export const PLATFORM_SERVICE_PROBES = Object.freeze([
23
23
  { service: 'evolutionCurator', feature: '/evolution curator subcommands, skill undo and history', side: 'host' },
24
24
  { service: 'evolutionIo', feature: 'every durable read and write (the IO seam)', side: 'host' },
25
25
  { service: 'evolutionMerge', feature: 'merge command delegation and the merge doctor fact', side: 'host' },
26
+ { service: 'evolutionMutationAuthority', feature: 'the family-wide mutation lease, fence and lock authority', side: 'host' },
26
27
  { service: 'hmr', feature: 'the preset install read-merge-write commit (the platform HMR lock serializes it)', side: 'host' },
27
28
  { service: 'evolutionMemoryBudget', feature: 'the memory-budget divergence section of this report', side: 'host' },
28
29
  { service: 'evolutionPlatform', feature: 'the single host edge object behind every family platform port', side: 'host' },