@moxxy/core 0.26.0 → 0.28.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.
- package/dist/index.d.ts +4 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +4 -1
- package/dist/index.js.map +1 -1
- package/dist/plugins/host-options.d.ts +2 -0
- package/dist/plugins/host-options.d.ts.map +1 -1
- package/dist/plugins/host.d.ts +8 -0
- package/dist/plugins/host.d.ts.map +1 -1
- package/dist/plugins/host.js +14 -0
- package/dist/plugins/host.js.map +1 -1
- package/dist/plugins/registry-kinds.d.ts +1 -0
- package/dist/plugins/registry-kinds.d.ts.map +1 -1
- package/dist/plugins/registry-kinds.js +11 -0
- package/dist/plugins/registry-kinds.js.map +1 -1
- package/dist/registries/modes.d.ts +8 -0
- package/dist/registries/modes.d.ts.map +1 -1
- package/dist/registries/modes.js +11 -0
- package/dist/registries/modes.js.map +1 -1
- package/dist/registries/reflectors.d.ts +15 -0
- package/dist/registries/reflectors.d.ts.map +1 -0
- package/dist/registries/reflectors.js +16 -0
- package/dist/registries/reflectors.js.map +1 -0
- package/dist/run-turn.d.ts.map +1 -1
- package/dist/run-turn.js +5 -0
- package/dist/run-turn.js.map +1 -1
- package/dist/session-runtime.d.ts +4 -0
- package/dist/session-runtime.d.ts.map +1 -1
- package/dist/session.d.ts +9 -1
- package/dist/session.d.ts.map +1 -1
- package/dist/session.js +17 -0
- package/dist/session.js.map +1 -1
- package/dist/sessions/event-shape.d.ts +68 -0
- package/dist/sessions/event-shape.d.ts.map +1 -0
- package/dist/sessions/event-shape.js +171 -0
- package/dist/sessions/event-shape.js.map +1 -0
- package/dist/sessions/persistence.d.ts +7 -5
- package/dist/sessions/persistence.d.ts.map +1 -1
- package/dist/sessions/persistence.js +39 -13
- package/dist/sessions/persistence.js.map +1 -1
- package/dist/skill-usage.d.ts +62 -0
- package/dist/skill-usage.d.ts.map +1 -0
- package/dist/skill-usage.js +106 -0
- package/dist/skill-usage.js.map +1 -0
- package/dist/skills/synthesize.d.ts.map +1 -1
- package/dist/skills/synthesize.js +42 -0
- package/dist/skills/synthesize.js.map +1 -1
- package/dist/subagents/run-child.d.ts.map +1 -1
- package/dist/subagents/run-child.js +4 -0
- package/dist/subagents/run-child.js.map +1 -1
- package/package.json +4 -4
- package/src/index.ts +11 -0
- package/src/plugins/host-options.ts +2 -0
- package/src/plugins/host.ts +14 -0
- package/src/plugins/registry-kinds.test.ts +4 -0
- package/src/plugins/registry-kinds.ts +13 -0
- package/src/registries/modes.test.ts +27 -0
- package/src/registries/modes.ts +12 -0
- package/src/registries/reflectors.test.ts +50 -0
- package/src/registries/reflectors.ts +17 -0
- package/src/run-turn.ts +5 -0
- package/src/session-runtime.ts +4 -0
- package/src/session.ts +18 -0
- package/src/sessions/event-shape.test.ts +207 -0
- package/src/sessions/event-shape.ts +196 -0
- package/src/sessions/persistence.test.ts +132 -0
- package/src/sessions/persistence.ts +39 -13
- package/src/skill-usage.test.ts +102 -0
- package/src/skill-usage.ts +165 -0
- package/src/skills/synthesize.ts +42 -0
- package/src/subagents/run-child.ts +4 -0
package/dist/session.js
CHANGED
|
@@ -24,6 +24,7 @@ import { EmbedderRegistry } from './registries/embedders.js';
|
|
|
24
24
|
import { IsolatorRegistry } from './registries/isolators.js';
|
|
25
25
|
import { WorkflowExecutorRegistry } from './registries/workflow-executors.js';
|
|
26
26
|
import { EventStoreRegistry } from './registries/event-stores.js';
|
|
27
|
+
import { ReflectorRegistry } from './registries/reflectors.js';
|
|
27
28
|
import { ServiceRegistryImpl } from './registries/services.js';
|
|
28
29
|
import { jsonlEventStore } from './sessions/jsonl-event-store.js';
|
|
29
30
|
import { RequirementRegistry } from './requirements.js';
|
|
@@ -62,6 +63,12 @@ export class Session {
|
|
|
62
63
|
isolators;
|
|
63
64
|
workflowExecutors;
|
|
64
65
|
eventStores;
|
|
66
|
+
/**
|
|
67
|
+
* The learning-loop block: watches finished turns and proposes memory/skill
|
|
68
|
+
* improvements. NULLABLE — no core-seeded floor, so it stays empty until a
|
|
69
|
+
* reflector plugin (e.g. @moxxy/reflector-default) registers one.
|
|
70
|
+
*/
|
|
71
|
+
reflectors;
|
|
65
72
|
/** Inter-plugin service registry — plugins publish/consume services in onInit. */
|
|
66
73
|
services;
|
|
67
74
|
requirements;
|
|
@@ -112,6 +119,7 @@ export class Session {
|
|
|
112
119
|
workflows;
|
|
113
120
|
pluginsAdmin;
|
|
114
121
|
providerSetup;
|
|
122
|
+
configAdmin;
|
|
115
123
|
dispatcher;
|
|
116
124
|
pluginHost;
|
|
117
125
|
controller = new AbortController();
|
|
@@ -166,6 +174,8 @@ export class Session {
|
|
|
166
174
|
this.services.register('synthesizers', this.synthesizers);
|
|
167
175
|
this.services.register('skills', this.skills);
|
|
168
176
|
this.services.register('tunnelProviders', this.tunnelProviders);
|
|
177
|
+
// The memory plugin (discovery-loadable) resolves its lazy embedder here.
|
|
178
|
+
this.services.register('embedders', this.embedders);
|
|
169
179
|
// A stable accessor for the active provider's stored credentials. The
|
|
170
180
|
// resolver itself is installed late (by activateProvider, after plugins are
|
|
171
181
|
// built), so close over `this` and read it lazily at call time — lets
|
|
@@ -188,6 +198,12 @@ export class Session {
|
|
|
188
198
|
// Seed the built-in JSONL store as the protected floor — the storage backend
|
|
189
199
|
// behind the event log always exists and can be swapped but never removed.
|
|
190
200
|
this.eventStores.register(jsonlEventStore, { protected: true });
|
|
201
|
+
// Reflectors are nullable — no core floor is seeded, so reflection stays off
|
|
202
|
+
// until a reflector plugin registers one. Published on the service registry
|
|
203
|
+
// so a discovery-loaded driver (the reflector plugin's own hooks) can resolve
|
|
204
|
+
// the active reflector in onTurnEnd without importing @moxxy/core.
|
|
205
|
+
this.reflectors = new ReflectorRegistry();
|
|
206
|
+
this.services.register('reflectors', this.reflectors);
|
|
191
207
|
this.requirements = new RequirementRegistry({
|
|
192
208
|
tools: this.tools,
|
|
193
209
|
providers: this.providers,
|
|
@@ -231,6 +247,7 @@ export class Session {
|
|
|
231
247
|
isolators: this.isolators,
|
|
232
248
|
workflowExecutors: this.workflowExecutors,
|
|
233
249
|
eventStores: this.eventStores,
|
|
250
|
+
reflectors: this.reflectors,
|
|
234
251
|
requirements: this.requirements,
|
|
235
252
|
dispatcher: this.dispatcher,
|
|
236
253
|
loader: opts.pluginLoader,
|
package/dist/session.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"session.js","sourceRoot":"","sources":["../src/session.ts"],"names":[],"mappings":"AAUA,OAAO,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAC9D,OAAO,EAAE,OAAO,IAAI,WAAW,EAAE,MAAM,eAAe,CAAC;AAEvD,OAAO,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAC3C,OAAO,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAC;AAC5D,OAAO,EAAE,UAAU,EAAqB,MAAM,mBAAmB,CAAC;AAClE,OAAO,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAC;AAC7D,OAAO,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AACrD,OAAO,EAAE,qBAAqB,EAAE,MAAM,kCAAkC,CAAC;AACzE,OAAO,EAAE,oBAAoB,EAAE,MAAM,gCAAgC,CAAC;AACtE,OAAO,EAAE,mBAAmB,EAAE,MAAM,4BAA4B,CAAC;AACjE,OAAO,EAAE,sBAAsB,EAAE,MAAM,kCAAkC,CAAC;AAC1E,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AACxD,OAAO,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;AAC/D,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAC/D,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAC/D,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AACrD,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAC3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,EAAE,CAAC,cAAc,CAAC,IAAI,CAAC,CAAC;YAC/D,CAAC;YACD,OAAO,OAAO,CAAC,GAAG,CAAC,MAAM,EAAE,IAAI,EAAE,QAAQ,CAAC,CAAC;QAC7C,CAAC;KACF,CAAC,CAAC;AACL,CAAC"}
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Runtime shape guard for event-log lines — the read side of the EventStore
|
|
3
|
+
* trust boundary.
|
|
4
|
+
*
|
|
5
|
+
* The per-session JSONL is parsed back into `MoxxyEvent`s on every resume/
|
|
6
|
+
* attach (`restoreEvents`), every history page (`readEventPage`), and every
|
|
7
|
+
* index hydration (`matchingSessionStatsFromLog`). Corrupt-JSON lines were
|
|
8
|
+
* always skipped, but a structurally-valid-but-wrong-shape line used to be
|
|
9
|
+
* CAST straight to `MoxxyEvent` and then drive replay and state
|
|
10
|
+
* reconstruction — e.g. a `compaction` line missing `replacedRange`/`summary`
|
|
11
|
+
* throws inside `projectMessagesFromLog`'s unconditional
|
|
12
|
+
* `event.summary.trim()` / `event.replacedRange[0]` dereferences, mid-replay.
|
|
13
|
+
* This guard closes that gap: wrong-shape lines are skipped with the exact
|
|
14
|
+
* same semantics as corrupt lines (never throw, never truncate what follows).
|
|
15
|
+
*
|
|
16
|
+
* CALIBRATION — why this is a shallow structural check, not a full schema:
|
|
17
|
+
*
|
|
18
|
+
* `restoreEvents` REWRITES the repaired log after skipping bad lines, so a
|
|
19
|
+
* false positive here permanently deletes history. The guard therefore
|
|
20
|
+
* rejects only shapes that would actively corrupt replay, and tolerates
|
|
21
|
+
* benign drift:
|
|
22
|
+
*
|
|
23
|
+
* - Envelope: strict on the fields the replay machinery itself dereferences
|
|
24
|
+
* (`id`, `seq`, `ts`, `type` — mirrors dedupe by `id`, ingest/paging/
|
|
25
|
+
* re-sequencing key on numeric `seq`). Lenient-if-present on `sessionId` /
|
|
26
|
+
* `turnId` / `source`: the existing session-ownership path already
|
|
27
|
+
* tolerates and normalizes a missing `sessionId`
|
|
28
|
+
* (`eventBelongsToSession`), and none of these are dereferenced in a way
|
|
29
|
+
* that can throw.
|
|
30
|
+
* - Unknown `type` with a valid envelope is KEPT, not dropped: every
|
|
31
|
+
* downstream fold pattern-matches known types and ignores the rest (there
|
|
32
|
+
* is no exhaustive-switch throw), and the desktop floor mechanism makes
|
|
33
|
+
* "older core replaying a newer log" a designed scenario — dropping (and
|
|
34
|
+
* then rewriting away) a newer version's events on rollback would be
|
|
35
|
+
* silent history loss. This matches the pre-guard behavior for that class
|
|
36
|
+
* of line exactly.
|
|
37
|
+
* - Known `type`: the variant's required primitive fields are checked
|
|
38
|
+
* shallowly (`typeof` / `Array.isArray`), because the projection folds
|
|
39
|
+
* dereference them unconditionally. Enum-valued strings (`stopReason`,
|
|
40
|
+
* `decidedBy`, …) are checked as `string` only — a newer version adding an
|
|
41
|
+
* enum member must not get its events dropped by an older reader.
|
|
42
|
+
*
|
|
43
|
+
* LOCKSTEP — the spec map below is typed so it cannot drift from the union:
|
|
44
|
+
* it is exhaustive over `MoxxyEventType` (adding a variant fails the build
|
|
45
|
+
* until a spec is added) and each spec's keys must be required non-envelope
|
|
46
|
+
* keys of that exact variant (renaming/removing a field fails the build).
|
|
47
|
+
* Listing a field is optional per-variant, so a future required field can be
|
|
48
|
+
* deliberately left unchecked for back-compat (old logs won't have it) — omit
|
|
49
|
+
* with a comment when doing so.
|
|
50
|
+
*
|
|
51
|
+
* PERFORMANCE — this runs once per line while iterating whole logs on the
|
|
52
|
+
* replay hot path. It allocates nothing per call: a handful of `typeof`
|
|
53
|
+
* checks plus an indexed walk over a per-variant spec array precomputed at
|
|
54
|
+
* module load. (This is also why it is hand-rolled rather than zod: a parsed
|
|
55
|
+
* schema library allocates per-line result/issue objects and would
|
|
56
|
+
* deep-validate bulky payloads — attachments, tool outputs — that replay
|
|
57
|
+
* never dereferences structurally.)
|
|
58
|
+
*/
|
|
59
|
+
import type { MoxxyEvent } from '@moxxy/sdk';
|
|
60
|
+
/**
|
|
61
|
+
* True when `value` (a successfully-parsed JSONL line) is structurally safe to
|
|
62
|
+
* replay as a {@link MoxxyEvent}. See the module doc for what "safe" means —
|
|
63
|
+
* this is a calibrated floor (reject what corrupts replay, keep benign
|
|
64
|
+
* drift), not a proof of full conformance: an unknown newer event type with a
|
|
65
|
+
* valid envelope passes, exactly as it (unvalidated) did before this guard.
|
|
66
|
+
*/
|
|
67
|
+
export declare function isMoxxyEventShape(value: unknown): value is MoxxyEvent;
|
|
68
|
+
//# sourceMappingURL=event-shape.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"event-shape.d.ts","sourceRoot":"","sources":["../../src/sessions/event-shape.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAyDG;AAEH,OAAO,KAAK,EAAa,UAAU,EAAoC,MAAM,YAAY,CAAC;AA2G1F;;;;;;GAMG;AACH,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,UAAU,CAsBrE"}
|
|
@@ -0,0 +1,171 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Runtime shape guard for event-log lines — the read side of the EventStore
|
|
3
|
+
* trust boundary.
|
|
4
|
+
*
|
|
5
|
+
* The per-session JSONL is parsed back into `MoxxyEvent`s on every resume/
|
|
6
|
+
* attach (`restoreEvents`), every history page (`readEventPage`), and every
|
|
7
|
+
* index hydration (`matchingSessionStatsFromLog`). Corrupt-JSON lines were
|
|
8
|
+
* always skipped, but a structurally-valid-but-wrong-shape line used to be
|
|
9
|
+
* CAST straight to `MoxxyEvent` and then drive replay and state
|
|
10
|
+
* reconstruction — e.g. a `compaction` line missing `replacedRange`/`summary`
|
|
11
|
+
* throws inside `projectMessagesFromLog`'s unconditional
|
|
12
|
+
* `event.summary.trim()` / `event.replacedRange[0]` dereferences, mid-replay.
|
|
13
|
+
* This guard closes that gap: wrong-shape lines are skipped with the exact
|
|
14
|
+
* same semantics as corrupt lines (never throw, never truncate what follows).
|
|
15
|
+
*
|
|
16
|
+
* CALIBRATION — why this is a shallow structural check, not a full schema:
|
|
17
|
+
*
|
|
18
|
+
* `restoreEvents` REWRITES the repaired log after skipping bad lines, so a
|
|
19
|
+
* false positive here permanently deletes history. The guard therefore
|
|
20
|
+
* rejects only shapes that would actively corrupt replay, and tolerates
|
|
21
|
+
* benign drift:
|
|
22
|
+
*
|
|
23
|
+
* - Envelope: strict on the fields the replay machinery itself dereferences
|
|
24
|
+
* (`id`, `seq`, `ts`, `type` — mirrors dedupe by `id`, ingest/paging/
|
|
25
|
+
* re-sequencing key on numeric `seq`). Lenient-if-present on `sessionId` /
|
|
26
|
+
* `turnId` / `source`: the existing session-ownership path already
|
|
27
|
+
* tolerates and normalizes a missing `sessionId`
|
|
28
|
+
* (`eventBelongsToSession`), and none of these are dereferenced in a way
|
|
29
|
+
* that can throw.
|
|
30
|
+
* - Unknown `type` with a valid envelope is KEPT, not dropped: every
|
|
31
|
+
* downstream fold pattern-matches known types and ignores the rest (there
|
|
32
|
+
* is no exhaustive-switch throw), and the desktop floor mechanism makes
|
|
33
|
+
* "older core replaying a newer log" a designed scenario — dropping (and
|
|
34
|
+
* then rewriting away) a newer version's events on rollback would be
|
|
35
|
+
* silent history loss. This matches the pre-guard behavior for that class
|
|
36
|
+
* of line exactly.
|
|
37
|
+
* - Known `type`: the variant's required primitive fields are checked
|
|
38
|
+
* shallowly (`typeof` / `Array.isArray`), because the projection folds
|
|
39
|
+
* dereference them unconditionally. Enum-valued strings (`stopReason`,
|
|
40
|
+
* `decidedBy`, …) are checked as `string` only — a newer version adding an
|
|
41
|
+
* enum member must not get its events dropped by an older reader.
|
|
42
|
+
*
|
|
43
|
+
* LOCKSTEP — the spec map below is typed so it cannot drift from the union:
|
|
44
|
+
* it is exhaustive over `MoxxyEventType` (adding a variant fails the build
|
|
45
|
+
* until a spec is added) and each spec's keys must be required non-envelope
|
|
46
|
+
* keys of that exact variant (renaming/removing a field fails the build).
|
|
47
|
+
* Listing a field is optional per-variant, so a future required field can be
|
|
48
|
+
* deliberately left unchecked for back-compat (old logs won't have it) — omit
|
|
49
|
+
* with a comment when doing so.
|
|
50
|
+
*
|
|
51
|
+
* PERFORMANCE — this runs once per line while iterating whole logs on the
|
|
52
|
+
* replay hot path. It allocates nothing per call: a handful of `typeof`
|
|
53
|
+
* checks plus an indexed walk over a per-variant spec array precomputed at
|
|
54
|
+
* module load. (This is also why it is hand-rolled rather than zod: a parsed
|
|
55
|
+
* schema library allocates per-line result/issue objects and would
|
|
56
|
+
* deep-validate bulky payloads — attachments, tool outputs — that replay
|
|
57
|
+
* never dereferences structurally.)
|
|
58
|
+
*/
|
|
59
|
+
/** Exhaustive per-variant field specs — one entry per union member. */
|
|
60
|
+
const VARIANT_SPECS = {
|
|
61
|
+
user_prompt: { text: 'string' },
|
|
62
|
+
assistant_chunk: { delta: 'string' },
|
|
63
|
+
assistant_message: { content: 'string', stopReason: 'string' },
|
|
64
|
+
reasoning_chunk: { delta: 'string' },
|
|
65
|
+
reasoning_message: { content: 'string' },
|
|
66
|
+
tool_call_requested: { callId: 'string', name: 'string' },
|
|
67
|
+
tool_call_approved: { callId: 'string', decidedBy: 'string', mode: 'string' },
|
|
68
|
+
tool_call_denied: { callId: 'string', decidedBy: 'string', reason: 'string' },
|
|
69
|
+
tool_result: { callId: 'string', ok: 'boolean' },
|
|
70
|
+
skill_invoked: { skillId: 'string', name: 'string', reason: 'string' },
|
|
71
|
+
skill_created: {
|
|
72
|
+
skillId: 'string',
|
|
73
|
+
name: 'string',
|
|
74
|
+
path: 'string',
|
|
75
|
+
scope: 'string',
|
|
76
|
+
originatingPrompt: 'string',
|
|
77
|
+
},
|
|
78
|
+
plugin_registered: { pluginId: 'string', name: 'string', version: 'string', kind: 'array' },
|
|
79
|
+
plugin_unregistered: { pluginId: 'string', name: 'string', reason: 'string' },
|
|
80
|
+
mode_iteration: { strategy: 'string', iteration: 'number' },
|
|
81
|
+
compaction: {
|
|
82
|
+
compactor: 'string',
|
|
83
|
+
replacedRange: 'seqRange',
|
|
84
|
+
summary: 'string',
|
|
85
|
+
tokensSaved: 'number',
|
|
86
|
+
},
|
|
87
|
+
elision: {
|
|
88
|
+
elidedThrough: 'number',
|
|
89
|
+
stubbedRanges: 'array',
|
|
90
|
+
elideConversational: 'boolean',
|
|
91
|
+
conversationalRecallThreshold: 'number',
|
|
92
|
+
maxRecallBytes: 'number',
|
|
93
|
+
neverElideTools: 'array',
|
|
94
|
+
tokensSaved: 'number',
|
|
95
|
+
},
|
|
96
|
+
provider_request: { provider: 'string', model: 'string' },
|
|
97
|
+
provider_response: { provider: 'string', model: 'string' },
|
|
98
|
+
error: { kind: 'string', message: 'string' },
|
|
99
|
+
abort: { reason: 'string' },
|
|
100
|
+
plugin_event: { pluginId: 'string', subtype: 'string' },
|
|
101
|
+
};
|
|
102
|
+
/** Specs flattened to `[key, kind]` arrays ONCE at module load, so the per-line
|
|
103
|
+
* check walks a plain array by index — no per-call object/iterator work. */
|
|
104
|
+
const SPEC_ENTRIES = new Map(Object.entries(VARIANT_SPECS).map(([type, spec]) => [
|
|
105
|
+
type,
|
|
106
|
+
Object.entries(spec),
|
|
107
|
+
]));
|
|
108
|
+
function fieldOk(value, kind) {
|
|
109
|
+
switch (kind) {
|
|
110
|
+
case 'string':
|
|
111
|
+
return typeof value === 'string';
|
|
112
|
+
case 'number':
|
|
113
|
+
// JSON.parse CAN yield non-finite numbers (`1e999` → Infinity); a
|
|
114
|
+
// non-finite seq-adjacent number poisons every downstream comparison.
|
|
115
|
+
return typeof value === 'number' && Number.isFinite(value);
|
|
116
|
+
case 'boolean':
|
|
117
|
+
return typeof value === 'boolean';
|
|
118
|
+
case 'array':
|
|
119
|
+
return Array.isArray(value);
|
|
120
|
+
case 'seqRange':
|
|
121
|
+
// `[from, to]` seq bounds, compared against `event.seq` unconditionally
|
|
122
|
+
// by the projection fold — both must be real numbers.
|
|
123
|
+
return (Array.isArray(value) &&
|
|
124
|
+
value.length === 2 &&
|
|
125
|
+
typeof value[0] === 'number' &&
|
|
126
|
+
Number.isFinite(value[0]) &&
|
|
127
|
+
typeof value[1] === 'number' &&
|
|
128
|
+
Number.isFinite(value[1]));
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
/**
|
|
132
|
+
* True when `value` (a successfully-parsed JSONL line) is structurally safe to
|
|
133
|
+
* replay as a {@link MoxxyEvent}. See the module doc for what "safe" means —
|
|
134
|
+
* this is a calibrated floor (reject what corrupts replay, keep benign
|
|
135
|
+
* drift), not a proof of full conformance: an unknown newer event type with a
|
|
136
|
+
* valid envelope passes, exactly as it (unvalidated) did before this guard.
|
|
137
|
+
*/
|
|
138
|
+
export function isMoxxyEventShape(value) {
|
|
139
|
+
if (typeof value !== 'object' || value === null || Array.isArray(value))
|
|
140
|
+
return false;
|
|
141
|
+
const e = value;
|
|
142
|
+
// Envelope — strict: replay machinery dereferences these on every event.
|
|
143
|
+
if (typeof e.type !== 'string')
|
|
144
|
+
return false;
|
|
145
|
+
if (typeof e.id !== 'string')
|
|
146
|
+
return false;
|
|
147
|
+
if (typeof e.seq !== 'number' || !Number.isFinite(e.seq))
|
|
148
|
+
return false;
|
|
149
|
+
if (typeof e.ts !== 'number' || !Number.isFinite(e.ts))
|
|
150
|
+
return false;
|
|
151
|
+
// Envelope — lenient-if-present: absent on some legacy logs (sessionId is
|
|
152
|
+
// normalized by `eventForSession`), but a present-with-wrong-type value is
|
|
153
|
+
// junk, not drift.
|
|
154
|
+
if (e.sessionId != null && typeof e.sessionId !== 'string')
|
|
155
|
+
return false;
|
|
156
|
+
if (e.turnId != null && typeof e.turnId !== 'string')
|
|
157
|
+
return false;
|
|
158
|
+
if (e.source != null && typeof e.source !== 'string')
|
|
159
|
+
return false;
|
|
160
|
+
const fields = SPEC_ENTRIES.get(e.type);
|
|
161
|
+
// Unknown (newer) event type with a valid envelope: keep — see module doc.
|
|
162
|
+
if (!fields)
|
|
163
|
+
return true;
|
|
164
|
+
for (let i = 0; i < fields.length; i += 1) {
|
|
165
|
+
const entry = fields[i];
|
|
166
|
+
if (!fieldOk(e[entry[0]], entry[1]))
|
|
167
|
+
return false;
|
|
168
|
+
}
|
|
169
|
+
return true;
|
|
170
|
+
}
|
|
171
|
+
//# sourceMappingURL=event-shape.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"event-shape.js","sourceRoot":"","sources":["../../src/sessions/event-shape.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAyDG;AA8BH,uEAAuE;AACvE,MAAM,aAAa,GAA4D;IAC7E,WAAW,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;IAC/B,eAAe,EAAE,EAAE,KAAK,EAAE,QAAQ,EAAE;IACpC,iBAAiB,EAAE,EAAE,OAAO,EAAE,QAAQ,EAAE,UAAU,EAAE,QAAQ,EAAE;IAC9D,eAAe,EAAE,EAAE,KAAK,EAAE,QAAQ,EAAE;IACpC,iBAAiB,EAAE,EAAE,OAAO,EAAE,QAAQ,EAAE;IACxC,mBAAmB,EAAE,EAAE,MAAM,EAAE,QAAQ,EAAE,IAAI,EAAE,QAAQ,EAAE;IACzD,kBAAkB,EAAE,EAAE,MAAM,EAAE,QAAQ,EAAE,SAAS,EAAE,QAAQ,EAAE,IAAI,EAAE,QAAQ,EAAE;IAC7E,gBAAgB,EAAE,EAAE,MAAM,EAAE,QAAQ,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,EAAE,QAAQ,EAAE;IAC7E,WAAW,EAAE,EAAE,MAAM,EAAE,QAAQ,EAAE,EAAE,EAAE,SAAS,EAAE;IAChD,aAAa,EAAE,EAAE,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,EAAE,QAAQ,EAAE;IACtE,aAAa,EAAE;QACb,OAAO,EAAE,QAAQ;QACjB,IAAI,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vent, type SessionId } from '@moxxy/sdk';
|
|
|
19
19
|
import type { EventLogLike, EventPage, SessionMeta, SessionSource } from '@moxxy/sdk';
|
|
20
20
|
import { type Logger } from '../logger.js';
|
|
21
21
|
export type { EventLogLike, EventPage, SessionMeta, SessionSource } from '@moxxy/sdk';
|
|
22
|
+
export { SESSION_SOURCES } from '@moxxy/sdk';
|
|
22
23
|
/** Schema version of the per-session metadata file (`<id>.json`). Bump when the
|
|
23
24
|
* shape changes incompatibly; readers tolerate a missing/older version. */
|
|
24
25
|
export declare const SESSION_META_VERSION = 1;
|
|
@@ -171,10 +172,11 @@ export declare function readIndex(dir?: string): Promise<SessionMeta[]>;
|
|
|
171
172
|
* Restore a previously-persisted session's events. Returns the full
|
|
172
173
|
* event array suitable for passing into `new EventLog(events)`.
|
|
173
174
|
*
|
|
174
|
-
* Skips malformed lines
|
|
175
|
-
*
|
|
176
|
-
*
|
|
177
|
-
*
|
|
175
|
+
* Skips malformed lines — corrupt JSON and valid-JSON-but-wrong-shape
|
|
176
|
+
* alike (see {@link isMoxxyEventShape}); a single bad append shouldn't
|
|
177
|
+
* make the rest of the conversation unreadable — and then RE-SEQUENCES
|
|
178
|
+
* the survivors to contiguous `seq` 0..n-1, preserving order and ids.
|
|
179
|
+
* This matters twice over:
|
|
178
180
|
*
|
|
179
181
|
* - Mirror replay: `EventLog.ingest` accepts only `seq === length`, so
|
|
180
182
|
* a gap left by one corrupt middle line would silently truncate every
|
|
@@ -209,7 +211,7 @@ export declare function restoreEvents(sessionId: string, dir?: string, logger?:
|
|
|
209
211
|
* `prevCursor` is the `seq` of the page's oldest event, or `null` once the
|
|
210
212
|
* first persisted event is included (no older page remains).
|
|
211
213
|
*
|
|
212
|
-
* Corrupt lines are skipped (matching {@link restoreEvents}); unlike
|
|
214
|
+
* Corrupt and wrong-shape lines are skipped (matching {@link restoreEvents}); unlike
|
|
213
215
|
* `restoreEvents` this is a READ-ONLY reader — it never rewrites the file, so
|
|
214
216
|
* it preserves the JSONL exactly (no atomic-write / mutex needed: there is no
|
|
215
217
|
* mutation). Paging keys on each event's on-disk `seq`. Determinism holds for a
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"persistence.d.ts","sourceRoot":"","sources":["../../src/sessions/persistence.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAIH,OAAO,EAA2B,KAAK,UAAU,EAAE,KAAK,SAAS,EAAE,MAAM,YAAY,CAAC;AACtF,OAAO,KAAK,EAAE,YAAY,EAAE,SAAS,EAAE,WAAW,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAEtF,OAAO,EAAgB,KAAK,MAAM,EAAE,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"persistence.d.ts","sourceRoot":"","sources":["../../src/sessions/persistence.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAIH,OAAO,EAA2B,KAAK,UAAU,EAAE,KAAK,SAAS,EAAE,MAAM,YAAY,CAAC;AACtF,OAAO,KAAK,EAAE,YAAY,EAAE,SAAS,EAAE,WAAW,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAEtF,OAAO,EAAgB,KAAK,MAAM,EAAE,MAAM,cAAc,CAAC;AAOzD,YAAY,EAAE,YAAY,EAAE,SAAS,EAAE,WAAW,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AACtF,OAAO,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAE7C;4EAC4E;AAC5E,eAAO,MAAM,oBAAoB,IAAI,CAAC;AAKtC,MAAM,WAAW,sBAAsB;IACrC,QAAQ,CAAC,SAAS,EAAE,SAAS,CAAC;IAC9B,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB,kEAAkE;IAClE,QAAQ,CAAC,GAAG,CAAC,EAAE,MAAM,CAAC;IACtB,+EAA+E;IAC/E,QAAQ,CAAC,YAAY,CAAC,EAAE,MAAM,CAAC;IAC/B,0EAA0E;IAC1E,QAAQ,C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AAS,EAAE,MAAM,EACjB,KAAK,EAAE,MAAM,EACb,GAAG,SAAuB,GACzB,OAAO,CAAC,IAAI,CAAC,CAEf;AAED,oFAAoF;AACpF,wBAAsB,eAAe,CACnC,SAAS,EAAE,MAAM,EACjB,OAAO,EAAE,MAAM,GAAG,IAAI,EACtB,GAAG,SAAuB,GACzB,OAAO,CAAC,IAAI,CAAC,CAEf;AAED;;;;;;GAMG;AACH,wBAAsB,eAAe,CACnC,SAAS,EAAE,MAAM,EACjB,GAAG,EAAE,MAAM,EACX,MAAM,EAAE,aAAa,EACrB,GAAG,SAAuB,EAC1B,OAAO,GAAE,MAAM,GAAG,IAAW,GAC5B,OAAO,CAAC,IAAI,CAAC,CAuBf;AAgBD,MAAM,WAAW,uBAAuB;IACtC,QAAQ,CAAC,YAAY,CAAC,EAAE,OAAO,CAAC;CACjC;AAwED;;;;;GAKG;AACH,wBAAsB,gBAAgB,CACpC,GAAG,SAAuB,EAC1B,IAAI,GAAE,uBAA4B,GACjC,OAAO,CAAC,WAAW,EAAE,CAAC,CAKxB"}
|
|
@@ -20,6 +20,8 @@ import * as path from 'node:path';
|
|
|
20
20
|
import { createMutex } from '@moxxy/sdk';
|
|
21
21
|
import { moxxyPath, writeFileAtomic } from '@moxxy/sdk/server';
|
|
22
22
|
import { createLogger } from '../logger.js';
|
|
23
|
+
import { isMoxxyEventShape } from './event-shape.js';
|
|
24
|
+
export { SESSION_SOURCES } from '@moxxy/sdk';
|
|
23
25
|
/** Schema version of the per-session metadata file (`<id>.json`). Bump when the
|
|
24
26
|
* shape changes incompatibly; readers tolerate a missing/older version. */
|
|
25
27
|
export const SESSION_META_VERSION = 1;
|
|
@@ -465,7 +467,11 @@ async function matchingSessionStatsFromLog(sessionId, logPath) {
|
|
|
465
467
|
if (!line.trim())
|
|
466
468
|
continue;
|
|
467
469
|
try {
|
|
468
|
-
|
|
470
|
+
const parsed = JSON.parse(line);
|
|
471
|
+
// Wrong-shape lines are skipped exactly like corrupt ones: neither a
|
|
472
|
+
// corrupt nor a junk line should hide a later valid prompt.
|
|
473
|
+
if (isMoxxyEventShape(parsed))
|
|
474
|
+
events.push(parsed);
|
|
469
475
|
}
|
|
470
476
|
catch {
|
|
471
477
|
// A corrupt line should not hide a later valid prompt.
|
|
@@ -485,10 +491,11 @@ function providerHeaderFromEvent(event) {
|
|
|
485
491
|
* Restore a previously-persisted session's events. Returns the full
|
|
486
492
|
* event array suitable for passing into `new EventLog(events)`.
|
|
487
493
|
*
|
|
488
|
-
* Skips malformed lines
|
|
489
|
-
*
|
|
490
|
-
*
|
|
491
|
-
*
|
|
494
|
+
* Skips malformed lines — corrupt JSON and valid-JSON-but-wrong-shape
|
|
495
|
+
* alike (see {@link isMoxxyEventShape}); a single bad append shouldn't
|
|
496
|
+
* make the rest of the conversation unreadable — and then RE-SEQUENCES
|
|
497
|
+
* the survivors to contiguous `seq` 0..n-1, preserving order and ids.
|
|
498
|
+
* This matters twice over:
|
|
492
499
|
*
|
|
493
500
|
* - Mirror replay: `EventLog.ingest` accepts only `seq === length`, so
|
|
494
501
|
* a gap left by one corrupt middle line would silently truncate every
|
|
@@ -517,16 +524,26 @@ export async function restoreEvents(sessionId, dir = defaultSessionsDir(), logge
|
|
|
517
524
|
}
|
|
518
525
|
const events = [];
|
|
519
526
|
let corruptLines = 0;
|
|
527
|
+
let invalidShapeLines = 0;
|
|
520
528
|
let foreignEvents = 0;
|
|
521
529
|
let normalizedSessionIds = 0;
|
|
522
530
|
for (const line of raw.split('\n')) {
|
|
523
531
|
if (!line.trim())
|
|
524
532
|
continue;
|
|
525
533
|
try {
|
|
526
|
-
const
|
|
527
|
-
|
|
534
|
+
const parsed = JSON.parse(line);
|
|
535
|
+
// Valid JSON but not a replayable event shape (see isMoxxyEventShape):
|
|
536
|
+
// skipped with the exact same semantics as a corrupt line — counted,
|
|
537
|
+
// re-sequenced around, and repaired away by the rewrite below. Casting
|
|
538
|
+
// it through instead used to let a junk line drive replay (a compaction
|
|
539
|
+
// line without `replacedRange` throws mid-projection).
|
|
540
|
+
if (!isMoxxyEventShape(parsed)) {
|
|
541
|
+
invalidShapeLines += 1;
|
|
542
|
+
continue;
|
|
543
|
+
}
|
|
544
|
+
const ownedEvent = eventForSession(parsed, sessionId);
|
|
528
545
|
if (ownedEvent) {
|
|
529
|
-
if (ownedEvent !==
|
|
546
|
+
if (ownedEvent !== parsed)
|
|
530
547
|
normalizedSessionIds += 1;
|
|
531
548
|
events.push(ownedEvent);
|
|
532
549
|
}
|
|
@@ -547,7 +564,11 @@ export async function restoreEvents(sessionId, dir = defaultSessionsDir(), logge
|
|
|
547
564
|
resequenced += 1;
|
|
548
565
|
}
|
|
549
566
|
}
|
|
550
|
-
if (corruptLines > 0 ||
|
|
567
|
+
if (corruptLines > 0 ||
|
|
568
|
+
invalidShapeLines > 0 ||
|
|
569
|
+
resequenced > 0 ||
|
|
570
|
+
foreignEvents > 0 ||
|
|
571
|
+
normalizedSessionIds > 0) {
|
|
551
572
|
const message = foreignEvents > 0
|
|
552
573
|
? 'session log restored with foreign-session events removed — re-sequenced to keep full history replayable'
|
|
553
574
|
: 'session log restored with gaps — re-sequenced to keep full history replayable';
|
|
@@ -555,6 +576,7 @@ export async function restoreEvents(sessionId, dir = defaultSessionsDir(), logge
|
|
|
555
576
|
sessionId,
|
|
556
577
|
path: logPath,
|
|
557
578
|
corruptLines,
|
|
579
|
+
invalidShapeLines,
|
|
558
580
|
foreignEvents,
|
|
559
581
|
normalizedSessionIds,
|
|
560
582
|
resequencedEvents: resequenced,
|
|
@@ -631,7 +653,7 @@ export async function restoreEvents(sessionId, dir = defaultSessionsDir(), logge
|
|
|
631
653
|
* `prevCursor` is the `seq` of the page's oldest event, or `null` once the
|
|
632
654
|
* first persisted event is included (no older page remains).
|
|
633
655
|
*
|
|
634
|
-
* Corrupt lines are skipped (matching {@link restoreEvents}); unlike
|
|
656
|
+
* Corrupt and wrong-shape lines are skipped (matching {@link restoreEvents}); unlike
|
|
635
657
|
* `restoreEvents` this is a READ-ONLY reader — it never rewrites the file, so
|
|
636
658
|
* it preserves the JSONL exactly (no atomic-write / mutex needed: there is no
|
|
637
659
|
* mutation). Paging keys on each event's on-disk `seq`. Determinism holds for a
|
|
@@ -656,14 +678,18 @@ export async function readEventPage(sessionId, opts, dir = defaultSessionsDir())
|
|
|
656
678
|
// No log on disk yet → empty history, not an error.
|
|
657
679
|
return { events: [], prevCursor: null };
|
|
658
680
|
}
|
|
659
|
-
// Parse the JSONL, skipping corrupt lines (one bad append
|
|
660
|
-
// rest unreadable). Read-only: we never rewrite the file
|
|
681
|
+
// Parse the JSONL, skipping corrupt AND wrong-shape lines (one bad append
|
|
682
|
+
// must not make the rest unreadable). Read-only: we never rewrite the file
|
|
683
|
+
// here.
|
|
661
684
|
const all = [];
|
|
662
685
|
for (const line of raw.split('\n')) {
|
|
663
686
|
if (!line.trim())
|
|
664
687
|
continue;
|
|
665
688
|
try {
|
|
666
|
-
|
|
689
|
+
const parsed = JSON.parse(line);
|
|
690
|
+
// skip a valid-JSON-but-not-an-event line, same as restoreEvents
|
|
691
|
+
if (isMoxxyEventShape(parsed))
|
|
692
|
+
all.push(parsed);
|
|
667
693
|
}
|
|
668
694
|
catch {
|
|
669
695
|
// skip a malformed/half-written line, same as restoreEvents
|