@escapeaihq/client-core 0.140.0 → 0.141.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/api.d.ts CHANGED
@@ -133,6 +133,28 @@ export interface IngestionJob {
133
133
  * cast read returns is final. See {@link castFramePipelinePending}.
134
134
  */
135
135
  castFramesAt?: string | null;
136
+ /**
137
+ * §Q PERS.108 — the entity-typing tail ran with the presence spine ON, so this
138
+ * job's cast-frame/identity chain was OWED a dispatch
139
+ * (`shared/models.py::IngestionJob.presenceSpineAtIngest`). Informational: read
140
+ * readiness from {@link castFrameChain}, never by re-deriving it from this.
141
+ */
142
+ presenceSpineAtIngest?: boolean;
143
+ /**
144
+ * §Q PERS.125 — the typing tail took its classifier-failure arm (typed
145
+ * nothing); a stalled chain on such a job needs its cast re-typed
146
+ * (`shared/models.py::IngestionJob.entityTypingFailed`).
147
+ */
148
+ entityTypingFailed?: boolean;
149
+ /**
150
+ * §Q PERS.130 — where the cast-frame/identity chain stands, answered by the
151
+ * SERVER at read time with the persona job's own rule (it depends on the
152
+ * deployment's presence-spine switch and the server's clock, neither of which
153
+ * a client can see). Present on `GET /api/v1/ingestion/jobs/{videoId}`
154
+ * ({@link ApiClient.getJob}); absent on list rows and from a backend that
155
+ * predates it. Read it through {@link castFrameChainSettled}.
156
+ */
157
+ castFrameChain?: CastFrameChainState | null;
136
158
  /** Episode sequence number within {@link seriesId}, when applicable. */
137
159
  episodeNumber?: number | null;
138
160
  /** Human-readable episode title within {@link seriesId}, when applicable. */
@@ -163,6 +185,23 @@ export interface IngestionJob {
163
185
  */
164
186
  visibility?: ResourceVisibility | null;
165
187
  }
188
+ /**
189
+ * §Q PERS.130 — the cast-frame/identity chain's state as the persona job reads
190
+ * it. Mirrors `shared/ingestion_jobs.py` `CastFrameChainState`:
191
+ * - `settled` — finished, or none will run: picks made now are final and a
192
+ * persona job reads the identity index without waiting;
193
+ * - `in_flight` — a persona job would wait for it, and its identity pass will
194
+ * re-read the cast;
195
+ * - `stalled` — it will not finish on its own; a persona job is refused until
196
+ * the chain is re-run (`POST /api/v1/ingestion/videos/{id}/cii-chain/rerun`).
197
+ */
198
+ export type CastFrameChainState = 'settled' | 'in_flight' | 'stalled';
199
+ /** Named constants for {@link CastFrameChainState}. */
200
+ export declare const CAST_FRAME_CHAIN_STATE: {
201
+ readonly SETTLED: "settled";
202
+ readonly IN_FLIGHT: "in_flight";
203
+ readonly STALLED: "stalled";
204
+ };
166
205
  /**
167
206
  * Named constants for the {@link IngestionJob.status} values. Mirrors the
168
207
  * backend `JobStatus` (`shared/models.py`). Use these instead of bare string
@@ -309,6 +348,24 @@ export declare function jobPipelineStages(job: IngestionJob): JobPipelineStage[]
309
348
  * build): it increments per-shot EARLY in graph sync.
310
349
  */
311
350
  export declare function castFramePipelinePending(job: IngestionJob): boolean;
351
+ /**
352
+ * §Q PERS.130 — is the video's cast ready for a person to make picks, by the
353
+ * persona job's OWN rule? True only when the server says the cast-frame/identity
354
+ * chain is `settled` ({@link IngestionJob.castFrameChain}, from
355
+ * {@link ApiClient.getJob}).
356
+ *
357
+ * Use this, not {@link castFramePipelinePending}, to decide when to open cast
358
+ * review: a chain that is still owed reruns the identity pass over the cast, and
359
+ * a persona job started meanwhile waits for it.
360
+ *
361
+ * Takes no clock: the state is computed by the server when the job is read, with
362
+ * the clock and the presence-spine switch the persona job uses; re-read the job
363
+ * to refresh it. `false` when the field is absent (a list row, or a backend
364
+ * older than it): the caller cannot know, so it must not open picks on it. A
365
+ * `stalled` chain is also `false`; check
366
+ * `job.castFrameChain === CAST_FRAME_CHAIN_STATE.STALLED` to offer the re-run.
367
+ */
368
+ export declare function castFrameChainSettled(job: IngestionJob): boolean;
312
369
  export interface ListJobsResponse {
313
370
  traceId: string;
314
371
  results: IngestionJob[];
@@ -2269,6 +2326,15 @@ export interface ShowcaseExperiencesResponse {
2269
2326
  traceId: string;
2270
2327
  experiences: ShowcaseExperienceCard[];
2271
2328
  }
2329
+ /**
2330
+ * Response from `GET /api/v1/showcase/experiences/{definitionId}` (§Q ADV.37) —
2331
+ * ONE published experience, the same card the registry lists. This is how a
2332
+ * viewer reads a definition they did not author.
2333
+ */
2334
+ export interface ShowcaseExperienceResponse {
2335
+ traceId: string;
2336
+ experience: ShowcaseExperienceCard;
2337
+ }
2272
2338
  /**
2273
2339
  * Definition lifecycle (adventure spec §4): DRAFT → PLAYABLE → BLESSED
2274
2340
  * (→ Showcase) → ARCHIVED (terminal). Mirrors
@@ -3171,12 +3237,30 @@ export type VoiceCloneStatus = 'cloned' | 'skipped_no_dialogue' | 'skipped_insuf
3171
3237
  * voice lineage; only that source persona re-clones it.
3172
3238
  */
3173
3239
  export type RecloneIneligibleReason = 'voice_lineage_copy';
3240
+ /**
3241
+ * §Q PERS.130 — which empty harvest a `skipped_no_dialogue` outcome was.
3242
+ * Mirrors `shared/persona_models.py` `VoiceCloneSkipCause`:
3243
+ * - `no_character` — the persona is bound to no character;
3244
+ * - `speech_unverified` — the speech-grounding gate refused: the character's
3245
+ * speech was not verified as theirs and no person confirmed it by listening;
3246
+ * - `speech_untimed` — their verified speech has no usable time span;
3247
+ * - `lines_unusable` — every line has an unusable time range;
3248
+ * - `lines_too_short` — every line is too short to sample;
3249
+ * - `lines_unreadable` — two reads of the video's lines disagree;
3250
+ * - `audio_unusable` — their lines were cut and no usable audio came out;
3251
+ * - `no_speech_matched` — no speech in the video is matched to anyone yet;
3252
+ * - `no_lines_matched` — others have matched lines, this character has none.
3253
+ */
3254
+ export type VoiceCloneSkipCause = 'no_character' | 'speech_unverified' | 'speech_untimed' | 'lines_unusable' | 'lines_too_short' | 'lines_unreadable' | 'audio_unusable' | 'no_speech_matched' | 'no_lines_matched';
3174
3255
  /** §Q DM.68 — the persona-level clone record (`PersonaConfig.voice_clone_outcome`). */
3175
3256
  export interface VoiceCloneOutcome {
3176
3257
  status: VoiceCloneStatus;
3177
3258
  /** Inworld's own refusal message for `refused`; the skip/crash sentence
3178
3259
  * otherwise. Absent for `cloned`. Capped server-side at 300 characters. */
3179
3260
  reason?: string | null;
3261
+ /** §Q PERS.130 — which empty harvest a `skipped_no_dialogue` was; absent on
3262
+ * every other status and on rows written before the field. */
3263
+ cause?: VoiceCloneSkipCause | null;
3180
3264
  }
3181
3265
  export interface PersonaConfig {
3182
3266
  persona_id: string;
@@ -8542,6 +8626,12 @@ export declare class ApiClient {
8542
8626
  * out — for a caller whose job output IS a whole roster (the workflow runner's
8543
8627
  * batch step). Omitted / false => the dedupe applies.
8544
8628
  *
8629
+ * Characters an approved story arc invents are cast members too: each is a
8630
+ * graph Entity with an `arcent-` id, `getCast` lists it, and the server builds
8631
+ * a persona for each one that has none by itself after the approval applies
8632
+ * (the cast-growth backfill). To build them on demand instead, pass their ids
8633
+ * in ``opts.entityIds``. There is no separate call for invented cast.
8634
+ *
8545
8635
  * @deprecated Facade delegation (§A9.2/A9.4) — implementation now lives on
8546
8636
  * {@link PersonasApi.generatePersonasForVideo} in `./domains/personas.ts`; prefer the
8547
8637
  * domain module directly in new client-core internal code. It is NOT
@@ -10708,6 +10798,15 @@ export declare class ApiClient {
10708
10798
  listShowcaseExperiences(options?: {
10709
10799
  signal?: AbortSignal;
10710
10800
  }): Promise<ShowcaseExperiencesResponse>;
10801
+ /**
10802
+ * Read ONE published (BLESSED) experience as a viewer (§Q ADV.37) —
10803
+ * `GET /api/v1/showcase/experiences/{definitionId}`. 404 when the definition
10804
+ * is not BLESSED. See {@link ShowcaseApi.getShowcaseExperience}.
10805
+ * Additive — never remove/rename.
10806
+ */
10807
+ getShowcaseExperience(definitionId: string, options?: {
10808
+ signal?: AbortSignal;
10809
+ }): Promise<ShowcaseExperienceResponse>;
10711
10810
  /**
10712
10811
  * §Q RUNTIME.3 — report a batch of external-runtime facts (zone reached,
10713
10812
  * object found, world predicate set, map area unlocked) into a running