dsh-plugin-guide 0.3.2 → 0.3.3
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.es.md +1 -1
- package/README.hi.md +1 -1
- package/README.md +1 -1
- package/README.pt.md +1 -1
- package/README.zh.md +1 -1
- package/dist/dsh-plugin-dev.js +3 -3
- package/guide/plugin-dev-guide.md +1 -1
- package/guide/quick-reference.es.md +1 -1
- package/guide/quick-reference.md +1 -1
- package/guide/quick-reference.pt.md +1 -1
- package/guide/quick-reference.zh-CN.md +1 -1
- package/package.json +3 -3
- package/references/official-docs/AGENTS.md +1 -1
- package/references/official-docs/SNAPSHOT.md +3 -3
- package/references/official-docs/docs/architecture.i18n.yaml +2 -2
- package/references/official-docs/docs/architecture.md +2 -1
- package/references/official-docs/docs/architecture.zh.md +2 -1
- package/references/official-docs/docs/capability-seams.i18n.yaml +2 -2
- package/references/official-docs/docs/capability-seams.md +3 -1
- package/references/official-docs/docs/capability-seams.zh.md +3 -1
- package/references/official-docs/docs/config-catalog.i18n.yaml +2 -2
- package/references/official-docs/docs/config-catalog.md +96 -54
- package/references/official-docs/docs/config-catalog.zh.md +93 -51
- package/references/official-docs/docs/cookbook/adding-a-package.i18n.yaml +2 -2
- package/references/official-docs/docs/cookbook/adding-a-package.md +1 -1
- package/references/official-docs/docs/cookbook/adding-a-package.zh.md +1 -1
- package/references/official-docs/docs/event-producer-consumer.i18n.yaml +2 -2
- package/references/official-docs/docs/event-producer-consumer.md +17 -17
- package/references/official-docs/docs/event-producer-consumer.zh.md +17 -17
- package/references/official-docs/docs/module-graph.i18n.yaml +2 -2
- package/references/official-docs/docs/module-graph.md +193 -361
- package/references/official-docs/docs/module-graph.zh.md +193 -361
- package/references/official-docs/docs/persistence-catalog.i18n.yaml +2 -2
- package/references/official-docs/docs/persistence-catalog.md +41 -41
- package/references/official-docs/docs/persistence-catalog.zh.md +40 -40
- package/references/official-docs/docs/subsystems/agent-team.i18n.yaml +2 -2
- package/references/official-docs/docs/subsystems/agent-team.md +4 -3
- package/references/official-docs/docs/subsystems/agent-team.zh.md +4 -3
- package/references/official-docs/docs/subsystems/code-runtime.i18n.yaml +2 -2
- package/references/official-docs/docs/subsystems/code-runtime.md +7 -3
- package/references/official-docs/docs/subsystems/code-runtime.zh.md +7 -3
- package/references/official-docs/docs/subsystems/commands.i18n.yaml +2 -2
- package/references/official-docs/docs/subsystems/commands.md +1 -1
- package/references/official-docs/docs/subsystems/commands.zh.md +1 -1
- package/references/official-docs/docs/subsystems/compaction.i18n.yaml +2 -2
- package/references/official-docs/docs/subsystems/compaction.md +9 -9
- package/references/official-docs/docs/subsystems/compaction.zh.md +9 -9
- package/references/official-docs/docs/subsystems/core.i18n.yaml +2 -2
- package/references/official-docs/docs/subsystems/core.md +4 -3
- package/references/official-docs/docs/subsystems/core.zh.md +4 -3
- package/references/official-docs/docs/subsystems/feedback.i18n.yaml +2 -2
- package/references/official-docs/docs/subsystems/feedback.md +2 -2
- package/references/official-docs/docs/subsystems/feedback.zh.md +2 -2
- package/references/official-docs/docs/subsystems/persistence.i18n.yaml +2 -2
- package/references/official-docs/docs/subsystems/persistence.md +179 -187
- package/references/official-docs/docs/subsystems/persistence.zh.md +179 -187
- package/references/official-docs/docs/subsystems/schedule.i18n.yaml +2 -2
- package/references/official-docs/docs/subsystems/schedule.md +1 -1
- package/references/official-docs/docs/subsystems/schedule.zh.md +1 -1
- package/references/official-docs/docs/subsystems/session-projection.i18n.yaml +2 -2
- package/references/official-docs/docs/subsystems/session-projection.md +21 -17
- package/references/official-docs/docs/subsystems/session-projection.zh.md +21 -17
- package/references/official-docs/docs/subsystems/session-query.i18n.yaml +2 -2
- package/references/official-docs/docs/subsystems/session-query.md +19 -13
- package/references/official-docs/docs/subsystems/session-query.zh.md +19 -13
- package/references/official-docs/docs/subsystems/session-title.i18n.yaml +2 -2
- package/references/official-docs/docs/subsystems/session-title.md +5 -5
- package/references/official-docs/docs/subsystems/session-title.zh.md +5 -5
- package/references/official-docs/docs/subsystems/session.i18n.yaml +2 -2
- package/references/official-docs/docs/subsystems/session.md +94 -34
- package/references/official-docs/docs/subsystems/session.zh.md +94 -34
- package/references/official-docs/docs/subsystems/slots.i18n.yaml +2 -2
- package/references/official-docs/docs/subsystems/slots.md +1 -0
- package/references/official-docs/docs/subsystems/slots.zh.md +1 -0
- package/references/official-docs/docs/subsystems/storage.i18n.yaml +2 -2
- package/references/official-docs/docs/subsystems/storage.md +28 -5
- package/references/official-docs/docs/subsystems/storage.zh.md +28 -5
- package/references/official-docs/docs/subsystems/subagent.i18n.yaml +2 -2
- package/references/official-docs/docs/subsystems/subagent.md +32 -88
- package/references/official-docs/docs/subsystems/subagent.zh.md +31 -87
- package/references/official-docs/docs/subsystems/token-meter.i18n.yaml +2 -2
- package/references/official-docs/docs/subsystems/token-meter.md +2 -2
- package/references/official-docs/docs/subsystems/token-meter.zh.md +2 -2
- package/references/official-docs/docs/tool-catalog.i18n.yaml +2 -2
- package/references/official-docs/docs/tool-catalog.md +9 -63
- package/references/official-docs/docs/tool-catalog.zh.md +8 -62
- package/references/official-docs/docs/web-styling.i18n.yaml +2 -2
- package/references/official-docs/docs/web-styling.md +3 -0
- package/references/official-docs/docs/web-styling.zh.md +3 -0
- package/references/official-docs/packages/AGENTS.md +2 -2
- package/templates/js/README.es.md +1 -1
- package/templates/js/README.hi.md +1 -1
- package/templates/js/README.md +1 -1
- package/templates/js/README.pt.md +1 -1
- package/templates/js/README.zh.md +1 -1
- package/templates/ts/README.es.md +1 -1
- package/templates/ts/README.hi.md +1 -1
- package/templates/ts/README.md +1 -1
- package/templates/ts/README.pt.md +1 -1
- package/templates/ts/README.zh.md +1 -1
|
@@ -30,9 +30,10 @@ interface ProjectionDefinition<
|
|
|
30
30
|
/**
|
|
31
31
|
* State for the empty log and its immutable Session metadata.
|
|
32
32
|
* @param header - immutable metadata for the Session being projected.
|
|
33
|
+
* @param inheritedEventCount - exact fork-inherited prefix length.
|
|
33
34
|
* @returns the initial state.
|
|
34
35
|
*/
|
|
35
|
-
init(header: SessionHeader): NoInfer<S>
|
|
36
|
+
init(header: SessionHeader, inheritedEventCount: SessionLogOffset): NoInfer<S>
|
|
36
37
|
/**
|
|
37
38
|
* Pure transition: previous state + one committed event → next state. A
|
|
38
39
|
* unit uninterested in an event MUST return the same state reference — an
|
|
@@ -78,7 +79,7 @@ The whole-value event rule is load-bearing: a state-carrying log event carries t
|
|
|
78
79
|
*/
|
|
79
80
|
interface ProjectionSnapshot {
|
|
80
81
|
/** Seq of the last event the values reflect; -1 for an empty log. */
|
|
81
|
-
asOfSeq:
|
|
82
|
+
asOfSeq: SessionSeqCursor
|
|
82
83
|
/** Whole current client value per registered key. */
|
|
83
84
|
values: Partial<SessionProjectionMap>
|
|
84
85
|
}
|
|
@@ -94,7 +95,7 @@ type ProjectionChangeListener = (
|
|
|
94
95
|
session: Session,
|
|
95
96
|
key: Extract<keyof SessionProjectionMap, string>,
|
|
96
97
|
value: unknown,
|
|
97
|
-
seq:
|
|
98
|
+
seq: SessionSeq,
|
|
98
99
|
) => void
|
|
99
100
|
```
|
|
100
101
|
|
|
@@ -128,11 +129,13 @@ The persisted projection cache service. Opens the `session_projcache` domain at
|
|
|
128
129
|
* paths (the history tail baseline) supersede these values whenever a
|
|
129
130
|
* session is actually opened.
|
|
130
131
|
* @param meta - the listed session's header (identity witness; no log read).
|
|
132
|
+
* @param inheritedEventCount - exact inherited prefix length that completes
|
|
133
|
+
* the checkpoint identity.
|
|
131
134
|
* @param keys - optional projection keys required by the caller's audience.
|
|
132
135
|
* @returns the cut (`asOfSeq` = lowest served-row watermark), or
|
|
133
136
|
* `undefined` when no usable row exists for this lifecycle.
|
|
134
137
|
*/
|
|
135
|
-
cachedSnapshot( meta: SessionHeader, keys?: readonly Extract<keyof SessionProjectionMap, string>[], ): ProjectionSnapshot | undefined
|
|
138
|
+
cachedSnapshot( meta: SessionHeader, inheritedEventCount: SessionLogOffset, keys?: readonly Extract<keyof SessionProjectionMap, string>[], ): ProjectionSnapshot | undefined
|
|
136
139
|
|
|
137
140
|
/**
|
|
138
141
|
* Hydrate projection cells for an already-prepared Session without another
|
|
@@ -140,11 +143,10 @@ cachedSnapshot( meta: SessionHeader, keys?: readonly Extract<keyof SessionProjec
|
|
|
140
143
|
* advances every unit to the observation cut. No checkpoint is written
|
|
141
144
|
* because the logical observation may contain recovery events not yet durable.
|
|
142
145
|
* @param session - exact unpublished Session retained by persistence.
|
|
143
|
-
* @param meta - observed lifecycle header.
|
|
144
146
|
* @param events - exact logical event prefix represented by the observation.
|
|
145
147
|
* @returns all projection values at the event cut.
|
|
146
148
|
*/
|
|
147
|
-
hydratePrepared( session: Session,
|
|
149
|
+
hydratePrepared( session: Session, events: readonly SessionEvent[], ): ProjectionSnapshot
|
|
148
150
|
|
|
149
151
|
/**
|
|
150
152
|
* Durably checkpoint one live session NOW (all mandatory points call
|
|
@@ -166,13 +168,14 @@ async write(session: Session): Promise<void>
|
|
|
166
168
|
* The caller supplies the complete log in seq order: this service never
|
|
167
169
|
* consults the persistence layer.
|
|
168
170
|
* @param meta - the stored session header (identity witness).
|
|
171
|
+
* @param inheritedEventCount - exact inherited prefix length for projection initialization and identity.
|
|
169
172
|
* @param events - the session's complete log, in seq order.
|
|
170
173
|
* @returns the projection cut at the log end.
|
|
171
174
|
*/
|
|
172
|
-
coldSnapshot(meta: SessionHeader, events: readonly SessionEvent[]): ProjectionSnapshot
|
|
175
|
+
coldSnapshot( meta: SessionHeader, inheritedEventCount: SessionLogOffset, events: readonly SessionEvent[], ): ProjectionSnapshot
|
|
173
176
|
```
|
|
174
177
|
|
|
175
|
-
Types: [Session](session.md) · [SessionEvent](session.md) · [SessionHeader](persistence.md)
|
|
178
|
+
Types: [Session](session.md) · [SessionEvent](session.md) · [SessionHeader](persistence.md) · [SessionLogOffset](session.md)
|
|
176
179
|
|
|
177
180
|
Source: [`packages/session/session-projection-cache/src/index.ts`](../../packages/session/session-projection-cache/src/index.ts)
|
|
178
181
|
|
|
@@ -268,11 +271,11 @@ checkpoint(session: Session): ProjectionCheckpoint
|
|
|
268
271
|
* yields an end below every watermark and the restore rejects for a full
|
|
269
272
|
* re-read.
|
|
270
273
|
* @param checkpoint - persisted rows for one session (possibly stale or empty).
|
|
271
|
-
* @returns the
|
|
272
|
-
* when no unit is registered (no read needed —
|
|
273
|
-
* serve empty values regardless).
|
|
274
|
+
* @returns the offset for the stored-log suffix read (`SessionHandle.read`),
|
|
275
|
+
* or `undefined` when no unit is registered (no read needed —
|
|
276
|
+
* {@link restore} would serve empty values regardless).
|
|
274
277
|
*/
|
|
275
|
-
restoreFloor(checkpoint: ProjectionCheckpoint):
|
|
278
|
+
restoreFloor(checkpoint: ProjectionCheckpoint): SessionLogOffset | undefined
|
|
276
279
|
|
|
277
280
|
/**
|
|
278
281
|
* View a checkpoint's rows without any log read: for every registered
|
|
@@ -291,8 +294,8 @@ viewCheckpoint( checkpoint: ProjectionCheckpoint, keys?: readonly Extract<keyof
|
|
|
291
294
|
* Cold read: fold every persisted unit over a stored log suffix, seeding
|
|
292
295
|
* each from its checkpoint row when usable — the one read recipe (cached
|
|
293
296
|
* state + forward tail replay + `view`) applied without a live `Session`.
|
|
294
|
-
* Call with the events
|
|
295
|
-
* `
|
|
297
|
+
* Call with the stored events at or past `restoreFloor(checkpoint)` (a
|
|
298
|
+
* `SessionHandle.read` slice) and that same floor as
|
|
296
299
|
* `baseSeq`; the floor's one-below anchor makes the supplied end honest,
|
|
297
300
|
* so a shrunk log is detected here. A row is usable iff its
|
|
298
301
|
* `ver` matches the live unit's `stateVersion`, it does not predate `baseSeq`
|
|
@@ -306,11 +309,12 @@ viewCheckpoint( checkpoint: ProjectionCheckpoint, keys?: readonly Extract<keyof
|
|
|
306
309
|
* @param events - the stored events with `seq >= baseSeq`, in seq order.
|
|
307
310
|
* @param baseSeq - the seq `events` starts at (its first event's seq when non-empty).
|
|
308
311
|
* @param header - immutable metadata for the Session being restored.
|
|
312
|
+
* @param inheritedEventCount - exact fork-inherited prefix length supplied to unit initialization.
|
|
309
313
|
* @returns the snapshot cut at the supplied log end (`asOfSeq` is the last
|
|
310
314
|
* supplied event's seq, `baseSeq - 1` for an empty tail) plus the
|
|
311
315
|
* refreshed checkpoint rows at that cut, ready for a durable write-back.
|
|
312
316
|
*/
|
|
313
|
-
restore( checkpoint: ProjectionCheckpoint, events: readonly SessionEvent[], baseSeq:
|
|
317
|
+
restore( checkpoint: ProjectionCheckpoint, events: readonly SessionEvent[], baseSeq: SessionLogOffset, header: SessionHeader, inheritedEventCount: SessionLogOffset, ): { snapshot: ProjectionSnapshot; checkpoint: ProjectionCheckpoint }
|
|
314
318
|
|
|
315
319
|
/**
|
|
316
320
|
* Restore an exact cut and install its states on the supplied prepared Session.
|
|
@@ -322,10 +326,10 @@ restore( checkpoint: ProjectionCheckpoint, events: readonly SessionEvent[], base
|
|
|
322
326
|
* @param baseSeq - first supplied event sequence.
|
|
323
327
|
* @returns all projection values at the supplied cut.
|
|
324
328
|
*/
|
|
325
|
-
hydrate( session: Session, checkpoint: ProjectionCheckpoint, events: readonly SessionEvent[], baseSeq:
|
|
329
|
+
hydrate( session: Session, checkpoint: ProjectionCheckpoint, events: readonly SessionEvent[], baseSeq: SessionLogOffset, ): ProjectionSnapshot
|
|
326
330
|
```
|
|
327
331
|
|
|
328
|
-
Types: [Session](session.md) · [SessionEvent](session.md) · [SessionHeader](persistence.md)
|
|
332
|
+
Types: [Session](session.md) · [SessionEvent](session.md) · [SessionHeader](persistence.md) · [SessionLogOffset](session.md)
|
|
329
333
|
|
|
330
334
|
Source: [`packages/session/session-projection/src/index.ts`](../../packages/session/session-projection/src/index.ts)
|
|
331
335
|
<!-- END GENERATED cordis-surface -->
|
|
@@ -30,9 +30,10 @@ interface ProjectionDefinition<
|
|
|
30
30
|
/**
|
|
31
31
|
* State for the empty log and its immutable Session metadata.
|
|
32
32
|
* @param header - immutable metadata for the Session being projected.
|
|
33
|
+
* @param inheritedEventCount - exact fork-inherited prefix length.
|
|
33
34
|
* @returns the initial state.
|
|
34
35
|
*/
|
|
35
|
-
init(header: SessionHeader): NoInfer<S>
|
|
36
|
+
init(header: SessionHeader, inheritedEventCount: SessionLogOffset): NoInfer<S>
|
|
36
37
|
/**
|
|
37
38
|
* Pure transition: previous state + one committed event → next state. A
|
|
38
39
|
* unit uninterested in an event MUST return the same state reference — an
|
|
@@ -78,7 +79,7 @@ interface ProjectionDefinition<
|
|
|
78
79
|
*/
|
|
79
80
|
interface ProjectionSnapshot {
|
|
80
81
|
/** Seq of the last event the values reflect; -1 for an empty log. */
|
|
81
|
-
asOfSeq:
|
|
82
|
+
asOfSeq: SessionSeqCursor
|
|
82
83
|
/** Whole current client value per registered key. */
|
|
83
84
|
values: Partial<SessionProjectionMap>
|
|
84
85
|
}
|
|
@@ -94,7 +95,7 @@ type ProjectionChangeListener = (
|
|
|
94
95
|
session: Session,
|
|
95
96
|
key: Extract<keyof SessionProjectionMap, string>,
|
|
96
97
|
value: unknown,
|
|
97
|
-
seq:
|
|
98
|
+
seq: SessionSeq,
|
|
98
99
|
) => void
|
|
99
100
|
```
|
|
100
101
|
|
|
@@ -128,11 +129,13 @@ The persisted projection cache service. Opens the `session_projcache` domain at
|
|
|
128
129
|
* paths (the history tail baseline) supersede these values whenever a
|
|
129
130
|
* session is actually opened.
|
|
130
131
|
* @param meta - the listed session's header (identity witness; no log read).
|
|
132
|
+
* @param inheritedEventCount - exact inherited prefix length that completes
|
|
133
|
+
* the checkpoint identity.
|
|
131
134
|
* @param keys - optional projection keys required by the caller's audience.
|
|
132
135
|
* @returns the cut (`asOfSeq` = lowest served-row watermark), or
|
|
133
136
|
* `undefined` when no usable row exists for this lifecycle.
|
|
134
137
|
*/
|
|
135
|
-
cachedSnapshot( meta: SessionHeader, keys?: readonly Extract<keyof SessionProjectionMap, string>[], ): ProjectionSnapshot | undefined
|
|
138
|
+
cachedSnapshot( meta: SessionHeader, inheritedEventCount: SessionLogOffset, keys?: readonly Extract<keyof SessionProjectionMap, string>[], ): ProjectionSnapshot | undefined
|
|
136
139
|
|
|
137
140
|
/**
|
|
138
141
|
* Hydrate projection cells for an already-prepared Session without another
|
|
@@ -140,11 +143,10 @@ cachedSnapshot( meta: SessionHeader, keys?: readonly Extract<keyof SessionProjec
|
|
|
140
143
|
* advances every unit to the observation cut. No checkpoint is written
|
|
141
144
|
* because the logical observation may contain recovery events not yet durable.
|
|
142
145
|
* @param session - exact unpublished Session retained by persistence.
|
|
143
|
-
* @param meta - observed lifecycle header.
|
|
144
146
|
* @param events - exact logical event prefix represented by the observation.
|
|
145
147
|
* @returns all projection values at the event cut.
|
|
146
148
|
*/
|
|
147
|
-
hydratePrepared( session: Session,
|
|
149
|
+
hydratePrepared( session: Session, events: readonly SessionEvent[], ): ProjectionSnapshot
|
|
148
150
|
|
|
149
151
|
/**
|
|
150
152
|
* Durably checkpoint one live session NOW (all mandatory points call
|
|
@@ -166,13 +168,14 @@ async write(session: Session): Promise<void>
|
|
|
166
168
|
* The caller supplies the complete log in seq order: this service never
|
|
167
169
|
* consults the persistence layer.
|
|
168
170
|
* @param meta - the stored session header (identity witness).
|
|
171
|
+
* @param inheritedEventCount - exact inherited prefix length for projection initialization and identity.
|
|
169
172
|
* @param events - the session's complete log, in seq order.
|
|
170
173
|
* @returns the projection cut at the log end.
|
|
171
174
|
*/
|
|
172
|
-
coldSnapshot(meta: SessionHeader, events: readonly SessionEvent[]): ProjectionSnapshot
|
|
175
|
+
coldSnapshot( meta: SessionHeader, inheritedEventCount: SessionLogOffset, events: readonly SessionEvent[], ): ProjectionSnapshot
|
|
173
176
|
```
|
|
174
177
|
|
|
175
|
-
Types: [Session](session.zh.md) · [SessionEvent](session.zh.md) · [SessionHeader](persistence.zh.md)
|
|
178
|
+
Types: [Session](session.zh.md) · [SessionEvent](session.zh.md) · [SessionHeader](persistence.zh.md) · [SessionLogOffset](session.zh.md)
|
|
176
179
|
|
|
177
180
|
Source: [`packages/session/session-projection-cache/src/index.ts`](../../packages/session/session-projection-cache/src/index.ts)
|
|
178
181
|
|
|
@@ -268,11 +271,11 @@ checkpoint(session: Session): ProjectionCheckpoint
|
|
|
268
271
|
* yields an end below every watermark and the restore rejects for a full
|
|
269
272
|
* re-read.
|
|
270
273
|
* @param checkpoint - persisted rows for one session (possibly stale or empty).
|
|
271
|
-
* @returns the
|
|
272
|
-
* when no unit is registered (no read needed —
|
|
273
|
-
* serve empty values regardless).
|
|
274
|
+
* @returns the offset for the stored-log suffix read (`SessionHandle.read`),
|
|
275
|
+
* or `undefined` when no unit is registered (no read needed —
|
|
276
|
+
* {@link restore} would serve empty values regardless).
|
|
274
277
|
*/
|
|
275
|
-
restoreFloor(checkpoint: ProjectionCheckpoint):
|
|
278
|
+
restoreFloor(checkpoint: ProjectionCheckpoint): SessionLogOffset | undefined
|
|
276
279
|
|
|
277
280
|
/**
|
|
278
281
|
* View a checkpoint's rows without any log read: for every registered
|
|
@@ -291,8 +294,8 @@ viewCheckpoint( checkpoint: ProjectionCheckpoint, keys?: readonly Extract<keyof
|
|
|
291
294
|
* Cold read: fold every persisted unit over a stored log suffix, seeding
|
|
292
295
|
* each from its checkpoint row when usable — the one read recipe (cached
|
|
293
296
|
* state + forward tail replay + `view`) applied without a live `Session`.
|
|
294
|
-
* Call with the events
|
|
295
|
-
* `
|
|
297
|
+
* Call with the stored events at or past `restoreFloor(checkpoint)` (a
|
|
298
|
+
* `SessionHandle.read` slice) and that same floor as
|
|
296
299
|
* `baseSeq`; the floor's one-below anchor makes the supplied end honest,
|
|
297
300
|
* so a shrunk log is detected here. A row is usable iff its
|
|
298
301
|
* `ver` matches the live unit's `stateVersion`, it does not predate `baseSeq`
|
|
@@ -306,11 +309,12 @@ viewCheckpoint( checkpoint: ProjectionCheckpoint, keys?: readonly Extract<keyof
|
|
|
306
309
|
* @param events - the stored events with `seq >= baseSeq`, in seq order.
|
|
307
310
|
* @param baseSeq - the seq `events` starts at (its first event's seq when non-empty).
|
|
308
311
|
* @param header - immutable metadata for the Session being restored.
|
|
312
|
+
* @param inheritedEventCount - exact fork-inherited prefix length supplied to unit initialization.
|
|
309
313
|
* @returns the snapshot cut at the supplied log end (`asOfSeq` is the last
|
|
310
314
|
* supplied event's seq, `baseSeq - 1` for an empty tail) plus the
|
|
311
315
|
* refreshed checkpoint rows at that cut, ready for a durable write-back.
|
|
312
316
|
*/
|
|
313
|
-
restore( checkpoint: ProjectionCheckpoint, events: readonly SessionEvent[], baseSeq:
|
|
317
|
+
restore( checkpoint: ProjectionCheckpoint, events: readonly SessionEvent[], baseSeq: SessionLogOffset, header: SessionHeader, inheritedEventCount: SessionLogOffset, ): { snapshot: ProjectionSnapshot; checkpoint: ProjectionCheckpoint }
|
|
314
318
|
|
|
315
319
|
/**
|
|
316
320
|
* Restore an exact cut and install its states on the supplied prepared Session.
|
|
@@ -322,10 +326,10 @@ restore( checkpoint: ProjectionCheckpoint, events: readonly SessionEvent[], base
|
|
|
322
326
|
* @param baseSeq - first supplied event sequence.
|
|
323
327
|
* @returns all projection values at the supplied cut.
|
|
324
328
|
*/
|
|
325
|
-
hydrate( session: Session, checkpoint: ProjectionCheckpoint, events: readonly SessionEvent[], baseSeq:
|
|
329
|
+
hydrate( session: Session, checkpoint: ProjectionCheckpoint, events: readonly SessionEvent[], baseSeq: SessionLogOffset, ): ProjectionSnapshot
|
|
326
330
|
```
|
|
327
331
|
|
|
328
|
-
Types: [Session](session.zh.md) · [SessionEvent](session.zh.md) · [SessionHeader](persistence.zh.md)
|
|
332
|
+
Types: [Session](session.zh.md) · [SessionEvent](session.zh.md) · [SessionHeader](persistence.zh.md) · [SessionLogOffset](session.zh.md)
|
|
329
333
|
|
|
330
334
|
Source: [`packages/session/session-projection/src/index.ts`](../../packages/session/session-projection/src/index.ts)
|
|
331
335
|
<!-- END GENERATED cordis-surface -->
|
|
@@ -2,5 +2,5 @@
|
|
|
2
2
|
# side as of the last confirmed-consistent state. Both languages carry equal authority;
|
|
3
3
|
# after editing either side, bring the other along and re-record with:
|
|
4
4
|
# pnpm run verify-translation-pairing --write docs/subsystems/session-query.md
|
|
5
|
-
session-query.md:
|
|
6
|
-
session-query.zh.md:
|
|
5
|
+
session-query.md: 1cf3dff325db76485a0afca4ca1a882a4ff175b8
|
|
6
|
+
session-query.zh.md: 2b8504dfb9ec8ee25d925135dbc99fa7beaede98
|
|
@@ -22,7 +22,7 @@ interface SessionRecord {
|
|
|
22
22
|
header: SessionHeader
|
|
23
23
|
/** Whether the id currently exists in `ctx.sessions`. */
|
|
24
24
|
live: boolean
|
|
25
|
-
/** Whether the active persistence backend currently
|
|
25
|
+
/** Whether the active persistence backend currently lists the id, including a created-but-unmaterialized session it already observes. */
|
|
26
26
|
persisted: boolean
|
|
27
27
|
}
|
|
28
28
|
```
|
|
@@ -34,7 +34,9 @@ interface SessionRecord {
|
|
|
34
34
|
interface SessionLogSnapshot {
|
|
35
35
|
/** Cloned session header selected from the same observation as `events`. */
|
|
36
36
|
session: SessionHeader
|
|
37
|
-
/**
|
|
37
|
+
/** Exact number of fork-inherited events in the observed log. */
|
|
38
|
+
inheritedEventCount: SessionLogOffset
|
|
39
|
+
/** Cloned contiguous raw events after in-memory interrupted-turn balancing and replay validation. */
|
|
38
40
|
events: SessionEvent[]
|
|
39
41
|
}
|
|
40
42
|
```
|
|
@@ -44,8 +46,10 @@ interface SessionLogSnapshot {
|
|
|
44
46
|
interface SessionSurfaceSnapshot {
|
|
45
47
|
/** Cloned session header selected from the same corpus observation as `events`. */
|
|
46
48
|
session: SessionHeader
|
|
49
|
+
/** Exact number of fork-inherited events in the observed log. */
|
|
50
|
+
inheritedEventCount: SessionLogOffset
|
|
47
51
|
/** Highest raw-log seq included in the observation, or `null` for an empty log. */
|
|
48
|
-
capturedThroughSeq:
|
|
52
|
+
capturedThroughSeq: OptionalSessionSeq
|
|
49
53
|
/** Cloned current surface events in model-history order. */
|
|
50
54
|
events: SurfaceEvent[]
|
|
51
55
|
}
|
|
@@ -90,7 +94,7 @@ interface SessionEventRecord {
|
|
|
90
94
|
/** Session that owns the event. */
|
|
91
95
|
sessionId: SessionId
|
|
92
96
|
/** Monotonic event seq within the session. */
|
|
93
|
-
seq:
|
|
97
|
+
seq: SessionSeq
|
|
94
98
|
/** Discriminant of the session event. */
|
|
95
99
|
type: SessionEventType
|
|
96
100
|
/** Event timestamp in Unix epoch milliseconds. */
|
|
@@ -266,7 +270,7 @@ interface SessionEventReadRequest {
|
|
|
266
270
|
/** Session that owns the target event. */
|
|
267
271
|
sessionId: SessionId
|
|
268
272
|
/** Target event seq. */
|
|
269
|
-
seq:
|
|
273
|
+
seq: SessionSeq
|
|
270
274
|
/** Number of preceding raw events to include. */
|
|
271
275
|
before?: number
|
|
272
276
|
/** Number of following raw events to include. */
|
|
@@ -279,14 +283,16 @@ interface SessionEventReadRequest {
|
|
|
279
283
|
interface SessionEventWindow {
|
|
280
284
|
/** Cloned header for the live-preferred source read. */
|
|
281
285
|
session: SessionHeader
|
|
286
|
+
/** Exact number of fork-inherited events in the observed log. */
|
|
287
|
+
inheritedEventCount: SessionLogOffset
|
|
282
288
|
/** Full cloned target event. */
|
|
283
289
|
target: SessionEvent
|
|
284
290
|
/** Full cloned events from `startSeq` through `endSeq`. */
|
|
285
291
|
events: SessionEvent[]
|
|
286
292
|
/** First seq included in `events`. */
|
|
287
|
-
startSeq:
|
|
293
|
+
startSeq: SessionSeq
|
|
288
294
|
/** Last seq included in `events`. */
|
|
289
|
-
endSeq:
|
|
295
|
+
endSeq: SessionSeq
|
|
290
296
|
}
|
|
291
297
|
```
|
|
292
298
|
|
|
@@ -300,7 +306,7 @@ interface SessionEventTraceRequest {
|
|
|
300
306
|
/** Session that owns the target event. */
|
|
301
307
|
sessionId: SessionId
|
|
302
308
|
/** Target event seq. */
|
|
303
|
-
seq:
|
|
309
|
+
seq: SessionSeq
|
|
304
310
|
}
|
|
305
311
|
```
|
|
306
312
|
|
|
@@ -310,15 +316,15 @@ interface SessionEventTrace {
|
|
|
310
316
|
/** Lightweight target record. */
|
|
311
317
|
target: SessionEventRecord
|
|
312
318
|
/** Immediate positional replacement event, when the target was shadowed. */
|
|
313
|
-
replacedBy?:
|
|
319
|
+
replacedBy?: SessionSeq
|
|
314
320
|
/** Positional replacers from the immediate replacement to the final replacement. */
|
|
315
|
-
replacementChain:
|
|
321
|
+
replacementChain: SessionSeq[]
|
|
316
322
|
/** Surface nodes directly removed when the target itself performed a replacement. */
|
|
317
|
-
replacedEventSeqs:
|
|
323
|
+
replacedEventSeqs: SessionSeq[]
|
|
318
324
|
/** Earlier events cited directly as sources, in their recorded order. */
|
|
319
|
-
sourceEventSeqs:
|
|
325
|
+
sourceEventSeqs: SessionSeq[]
|
|
320
326
|
/** Later events that directly cite the target as a source, in log order. */
|
|
321
|
-
derivedEventSeqs:
|
|
327
|
+
derivedEventSeqs: SessionSeq[]
|
|
322
328
|
}
|
|
323
329
|
```
|
|
324
330
|
|
|
@@ -22,7 +22,7 @@ interface SessionRecord {
|
|
|
22
22
|
header: SessionHeader
|
|
23
23
|
/** Whether the id currently exists in `ctx.sessions`. */
|
|
24
24
|
live: boolean
|
|
25
|
-
/** Whether the active persistence backend currently
|
|
25
|
+
/** Whether the active persistence backend currently lists the id, including a created-but-unmaterialized session it already observes. */
|
|
26
26
|
persisted: boolean
|
|
27
27
|
}
|
|
28
28
|
```
|
|
@@ -34,7 +34,9 @@ interface SessionRecord {
|
|
|
34
34
|
interface SessionLogSnapshot {
|
|
35
35
|
/** Cloned session header selected from the same observation as `events`. */
|
|
36
36
|
session: SessionHeader
|
|
37
|
-
/**
|
|
37
|
+
/** Exact number of fork-inherited events in the observed log. */
|
|
38
|
+
inheritedEventCount: SessionLogOffset
|
|
39
|
+
/** Cloned contiguous raw events after in-memory interrupted-turn balancing and replay validation. */
|
|
38
40
|
events: SessionEvent[]
|
|
39
41
|
}
|
|
40
42
|
```
|
|
@@ -44,8 +46,10 @@ interface SessionLogSnapshot {
|
|
|
44
46
|
interface SessionSurfaceSnapshot {
|
|
45
47
|
/** Cloned session header selected from the same corpus observation as `events`. */
|
|
46
48
|
session: SessionHeader
|
|
49
|
+
/** Exact number of fork-inherited events in the observed log. */
|
|
50
|
+
inheritedEventCount: SessionLogOffset
|
|
47
51
|
/** Highest raw-log seq included in the observation, or `null` for an empty log. */
|
|
48
|
-
capturedThroughSeq:
|
|
52
|
+
capturedThroughSeq: OptionalSessionSeq
|
|
49
53
|
/** Cloned current surface events in model-history order. */
|
|
50
54
|
events: SurfaceEvent[]
|
|
51
55
|
}
|
|
@@ -90,7 +94,7 @@ interface SessionEventRecord {
|
|
|
90
94
|
/** Session that owns the event. */
|
|
91
95
|
sessionId: SessionId
|
|
92
96
|
/** Monotonic event seq within the session. */
|
|
93
|
-
seq:
|
|
97
|
+
seq: SessionSeq
|
|
94
98
|
/** Discriminant of the session event. */
|
|
95
99
|
type: SessionEventType
|
|
96
100
|
/** Event timestamp in Unix epoch milliseconds. */
|
|
@@ -266,7 +270,7 @@ interface SessionEventReadRequest {
|
|
|
266
270
|
/** Session that owns the target event. */
|
|
267
271
|
sessionId: SessionId
|
|
268
272
|
/** Target event seq. */
|
|
269
|
-
seq:
|
|
273
|
+
seq: SessionSeq
|
|
270
274
|
/** Number of preceding raw events to include. */
|
|
271
275
|
before?: number
|
|
272
276
|
/** Number of following raw events to include. */
|
|
@@ -279,14 +283,16 @@ interface SessionEventReadRequest {
|
|
|
279
283
|
interface SessionEventWindow {
|
|
280
284
|
/** Cloned header for the live-preferred source read. */
|
|
281
285
|
session: SessionHeader
|
|
286
|
+
/** Exact number of fork-inherited events in the observed log. */
|
|
287
|
+
inheritedEventCount: SessionLogOffset
|
|
282
288
|
/** Full cloned target event. */
|
|
283
289
|
target: SessionEvent
|
|
284
290
|
/** Full cloned events from `startSeq` through `endSeq`. */
|
|
285
291
|
events: SessionEvent[]
|
|
286
292
|
/** First seq included in `events`. */
|
|
287
|
-
startSeq:
|
|
293
|
+
startSeq: SessionSeq
|
|
288
294
|
/** Last seq included in `events`. */
|
|
289
|
-
endSeq:
|
|
295
|
+
endSeq: SessionSeq
|
|
290
296
|
}
|
|
291
297
|
```
|
|
292
298
|
|
|
@@ -300,7 +306,7 @@ interface SessionEventTraceRequest {
|
|
|
300
306
|
/** Session that owns the target event. */
|
|
301
307
|
sessionId: SessionId
|
|
302
308
|
/** Target event seq. */
|
|
303
|
-
seq:
|
|
309
|
+
seq: SessionSeq
|
|
304
310
|
}
|
|
305
311
|
```
|
|
306
312
|
|
|
@@ -310,15 +316,15 @@ interface SessionEventTrace {
|
|
|
310
316
|
/** Lightweight target record. */
|
|
311
317
|
target: SessionEventRecord
|
|
312
318
|
/** Immediate positional replacement event, when the target was shadowed. */
|
|
313
|
-
replacedBy?:
|
|
319
|
+
replacedBy?: SessionSeq
|
|
314
320
|
/** Positional replacers from the immediate replacement to the final replacement. */
|
|
315
|
-
replacementChain:
|
|
321
|
+
replacementChain: SessionSeq[]
|
|
316
322
|
/** Surface nodes directly removed when the target itself performed a replacement. */
|
|
317
|
-
replacedEventSeqs:
|
|
323
|
+
replacedEventSeqs: SessionSeq[]
|
|
318
324
|
/** Earlier events cited directly as sources, in their recorded order. */
|
|
319
|
-
sourceEventSeqs:
|
|
325
|
+
sourceEventSeqs: SessionSeq[]
|
|
320
326
|
/** Later events that directly cite the target as a source, in log order. */
|
|
321
|
-
derivedEventSeqs:
|
|
327
|
+
derivedEventSeqs: SessionSeq[]
|
|
322
328
|
}
|
|
323
329
|
```
|
|
324
330
|
|
|
@@ -2,5 +2,5 @@
|
|
|
2
2
|
# side as of the last confirmed-consistent state. Both languages carry equal authority;
|
|
3
3
|
# after editing either side, bring the other along and re-record with:
|
|
4
4
|
# pnpm run verify-translation-pairing --write docs/subsystems/session-title.md
|
|
5
|
-
session-title.md:
|
|
6
|
-
session-title.zh.md:
|
|
5
|
+
session-title.md: 20ed32b4a08127e7193433673d22f0dea3a90c46
|
|
6
|
+
session-title.zh.md: c01d5d4bf177169069bbe0a39ef533ada0f7c36a
|
|
@@ -46,7 +46,7 @@ interface SessionTitleEventData {
|
|
|
46
46
|
/** Normalized non-empty title text. */
|
|
47
47
|
readonly title: string
|
|
48
48
|
/** Exact human `user/message` seqs used to derive this title; empty for an explicit user rename. */
|
|
49
|
-
readonly messageSeqs:
|
|
49
|
+
readonly messageSeqs: SessionSeq[]
|
|
50
50
|
/** Whether the built-in fallback, a registered provider, or the user supplied the title. */
|
|
51
51
|
readonly source: SessionTitleSource
|
|
52
52
|
}
|
|
@@ -56,7 +56,7 @@ interface SessionTitleEventData {
|
|
|
56
56
|
/** Latest folded title plus the title event's durable envelope facts. */
|
|
57
57
|
interface SessionTitleSnapshot extends SessionTitleEventData {
|
|
58
58
|
/** Seq of the latest `session/title` event. */
|
|
59
|
-
readonly eventSeq:
|
|
59
|
+
readonly eventSeq: SessionSeq
|
|
60
60
|
/** Timestamp of the latest `session/title` event. */
|
|
61
61
|
readonly updatedAt: number
|
|
62
62
|
}
|
|
@@ -72,7 +72,7 @@ interface SessionTitleLlmRequestEventData {
|
|
|
72
72
|
/** Registered title-provider identity responsible for the request. */
|
|
73
73
|
readonly titleProvider: SessionTitleProviderId
|
|
74
74
|
/** Exact human `user/message` seqs represented in `messages`. */
|
|
75
|
-
readonly messageSeqs:
|
|
75
|
+
readonly messageSeqs: SessionSeq[]
|
|
76
76
|
/** Exact auxiliary LLM route. */
|
|
77
77
|
readonly route: SessionTitleModelProvenance
|
|
78
78
|
/** Exact auxiliary system prompt. */
|
|
@@ -92,7 +92,7 @@ The service snapshots eligible messages through one revision. A provider returns
|
|
|
92
92
|
/** One eligible human text message exposed to title providers. */
|
|
93
93
|
interface SessionTitleUserMessage {
|
|
94
94
|
/** Source `user/message` event seq. */
|
|
95
|
-
readonly seq:
|
|
95
|
+
readonly seq: SessionSeq
|
|
96
96
|
/** Exact concatenated text-block content. */
|
|
97
97
|
readonly text: string
|
|
98
98
|
}
|
|
@@ -123,7 +123,7 @@ interface SessionTitleProviderResult {
|
|
|
123
123
|
/** Proposed title text. */
|
|
124
124
|
readonly title: string
|
|
125
125
|
/** Exact seqs from `request.messages` used by this result. */
|
|
126
|
-
readonly messageSeqs: readonly
|
|
126
|
+
readonly messageSeqs: readonly SessionSeq[]
|
|
127
127
|
/** Auxiliary LLM route, when generation used a model. */
|
|
128
128
|
readonly model?: SessionTitleModelProvenance
|
|
129
129
|
}
|
|
@@ -46,7 +46,7 @@ interface SessionTitleEventData {
|
|
|
46
46
|
/** Normalized non-empty title text. */
|
|
47
47
|
readonly title: string
|
|
48
48
|
/** Exact human `user/message` seqs used to derive this title; empty for an explicit user rename. */
|
|
49
|
-
readonly messageSeqs:
|
|
49
|
+
readonly messageSeqs: SessionSeq[]
|
|
50
50
|
/** Whether the built-in fallback, a registered provider, or the user supplied the title. */
|
|
51
51
|
readonly source: SessionTitleSource
|
|
52
52
|
}
|
|
@@ -56,7 +56,7 @@ interface SessionTitleEventData {
|
|
|
56
56
|
/** Latest folded title plus the title event's durable envelope facts. */
|
|
57
57
|
interface SessionTitleSnapshot extends SessionTitleEventData {
|
|
58
58
|
/** Seq of the latest `session/title` event. */
|
|
59
|
-
readonly eventSeq:
|
|
59
|
+
readonly eventSeq: SessionSeq
|
|
60
60
|
/** Timestamp of the latest `session/title` event. */
|
|
61
61
|
readonly updatedAt: number
|
|
62
62
|
}
|
|
@@ -72,7 +72,7 @@ interface SessionTitleLlmRequestEventData {
|
|
|
72
72
|
/** Registered title-provider identity responsible for the request. */
|
|
73
73
|
readonly titleProvider: SessionTitleProviderId
|
|
74
74
|
/** Exact human `user/message` seqs represented in `messages`. */
|
|
75
|
-
readonly messageSeqs:
|
|
75
|
+
readonly messageSeqs: SessionSeq[]
|
|
76
76
|
/** Exact auxiliary LLM route. */
|
|
77
77
|
readonly route: SessionTitleModelProvenance
|
|
78
78
|
/** Exact auxiliary system prompt. */
|
|
@@ -92,7 +92,7 @@ interface SessionTitleLlmRequestEventData {
|
|
|
92
92
|
/** One eligible human text message exposed to title providers. */
|
|
93
93
|
interface SessionTitleUserMessage {
|
|
94
94
|
/** Source `user/message` event seq. */
|
|
95
|
-
readonly seq:
|
|
95
|
+
readonly seq: SessionSeq
|
|
96
96
|
/** Exact concatenated text-block content. */
|
|
97
97
|
readonly text: string
|
|
98
98
|
}
|
|
@@ -123,7 +123,7 @@ interface SessionTitleProviderResult {
|
|
|
123
123
|
/** Proposed title text. */
|
|
124
124
|
readonly title: string
|
|
125
125
|
/** Exact seqs from `request.messages` used by this result. */
|
|
126
|
-
readonly messageSeqs: readonly
|
|
126
|
+
readonly messageSeqs: readonly SessionSeq[]
|
|
127
127
|
/** Auxiliary LLM route, when generation used a model. */
|
|
128
128
|
readonly model?: SessionTitleModelProvenance
|
|
129
129
|
}
|
|
@@ -2,5 +2,5 @@
|
|
|
2
2
|
# side as of the last confirmed-consistent state. Both languages carry equal authority;
|
|
3
3
|
# after editing either side, bring the other along and re-record with:
|
|
4
4
|
# pnpm run verify-translation-pairing --write docs/subsystems/session.md
|
|
5
|
-
session.md:
|
|
6
|
-
session.zh.md:
|
|
5
|
+
session.md: 48a80ccb92af774db2f5bedea8e2e00043932d31
|
|
6
|
+
session.zh.md: df5cfd631a15bfe015c766842956cc0c344c2ccd
|