@escapeaihq/client-core 0.42.0 → 0.49.1

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/src/index.ts CHANGED
@@ -28,15 +28,21 @@ export * from './websocket';
28
28
  export * from './api';
29
29
  export * from './castProjection';
30
30
  export * from './admin';
31
- export * from './reactor';
31
+ // Directory modules MUST re-export their barrel as `./<dir>/index` (not the bare
32
+ // `./<dir>`). Under strict-ESM resolvers (Nuxt/Rollup in the ../Web-App sibling),
33
+ // the published `dist/<dir>` has no `package.json` "main", so `from './<dir>.js'`
34
+ // (what a bare specifier compiles to) fails to resolve. The explicit `/index`
35
+ // makes tsc emit `./<dir>/index.js`, which resolves directly to the real file.
36
+ // See specs/technical-debt.md (client-core ESM barrel directory re-export bug).
37
+ export * from './reactor/index';
32
38
  export * from './timeFormat';
33
39
  export * from './toolSchemas';
34
- export * from './vision';
40
+ export * from './vision/index';
35
41
  export * from './graphSchema';
36
42
  // R8.1 — pure story-graph projections (deriveScenes/deriveCast + SceneView/
37
43
  // CharacterView). Grepped src/ for these names first per the collision warning
38
44
  // above: no existing export owns them. The web studio module re-exports these.
39
45
  export * from './storyGraph';
40
- export * from './adapters';
41
- export * from './conversation';
46
+ export * from './adapters/index';
47
+ export * from './conversation/index';
42
48
  export * from './platformAssistant';
package/src/websocket.ts CHANGED
@@ -186,6 +186,30 @@ export type ChatWsEvent =
186
186
  timestamp?: number;
187
187
  personaId: string;
188
188
  previousPersonaId?: string;
189
+ }
190
+ | {
191
+ /**
192
+ * Dashboard Spec A (§10A.5) — a DM-issued scene-control directive. Emitted
193
+ * by `ChatDispatcher.emit_dm_directive` (`shared/chat_dispatcher.py`,
194
+ * `ChatEventType.DM_DIRECTIVE` → wire `"dm_directive"`) at `MESSAGE_STOP`
195
+ * when the DM's completed turn carries a line-anchored `[SCENE:...]` tag;
196
+ * the tag is stripped from the streamed narration before this fires. Added
197
+ * as a union variant so exhaustive `switch` consumers get a typed arm
198
+ * (without it the `ConversationRuntime.applyFrame` default branch would
199
+ * stay the only path for this type). Shape mirrors {@link DmDirectiveEvent}
200
+ * in `api.ts` (the `directive` literals are inlined here to avoid a
201
+ * websocket↔api import cycle — `api.ts` already imports `Citation` from
202
+ * here). No existing consumer is wired (A-DM0 ships dark); the
203
+ * `applyFrame` default-drop stays safe for unhandled variants.
204
+ */
205
+ type: 'dm_directive';
206
+ timestamp?: number;
207
+ directive:
208
+ | 'enter_world'
209
+ | 'exit_world'
210
+ | 'seek_video'
211
+ | 'set_experience_source';
212
+ params: Record<string, unknown>;
189
213
  };
190
214
 
191
215
  /**