@alisio/sdk 0.1.0-alpha.18 → 0.1.0-alpha.19

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 (2) hide show
  1. package/dist/index.d.ts +43 -0
  2. package/package.json +1 -1
package/dist/index.d.ts CHANGED
@@ -524,6 +524,28 @@ export interface RunEvent {
524
524
  /** Embedder-supplied correlation id (for example an HTTP `X-Request-Id`), when given. */
525
525
  correlationId?: string;
526
526
  }
527
+ /** What a `run_failed` event with `code: "timeout"` says about the limit that stopped the run. */
528
+ export interface RunTimeoutInfo {
529
+ /** `run`: the whole-run limit (`limits.timeoutMs`); `first_token`: a silent request (`limits.firstTokenTimeoutMs`). */
530
+ kind: "run" | "first_token";
531
+ /** The limit that was reached, in milliseconds. */
532
+ ms: number;
533
+ /** Model the run was using, when known. */
534
+ model?: string;
535
+ /** Short provider label (the host of an OpenAI-compatible endpoint), when known. */
536
+ provider?: string;
537
+ /** What the run was doing: waiting for the first token of a request, streaming, or running a tool. */
538
+ stage: "waiting_model" | "streaming" | "tool" | "other";
539
+ /** The tool that was running when `stage` is `tool`. */
540
+ tool?: string;
541
+ /** Nothing had been produced yet: the very first model request of the run got no answer. */
542
+ firstRequest?: boolean;
543
+ /**
544
+ * `first_token` only: how many times the same request was sent (the first try plus the silent
545
+ * retries of `limits.firstTokenRetries`); `1` when retrying is disabled.
546
+ */
547
+ attempts?: number;
548
+ }
527
549
  /**
528
550
  * Payload of each event type the core emits today, keyed by `RunEvent.type`. Additive: new
529
551
  * types and new optional fields may appear; existing fields keep their meaning.
@@ -609,12 +631,31 @@ export interface RunEventDataMap {
609
631
  turn: number;
610
632
  maxOutputTokens: number;
611
633
  };
634
+ /**
635
+ * A model request stayed completely silent for `limits.firstTokenTimeoutMs` and the same
636
+ * request is sent again (no new turn, nothing appended to the session). `attempt` is the
637
+ * retry about to start (1-based), `of` the retries allowed (`limits.firstTokenRetries`) and
638
+ * `afterMs` how long the aborted request had been silent.
639
+ */
640
+ request_retry: {
641
+ attempt: number;
642
+ of: number;
643
+ reason: "first_token_timeout";
644
+ afterMs: number;
645
+ };
612
646
  run_turns_exceeded: {
613
647
  turns: number;
614
648
  maxTurns: number;
615
649
  };
650
+ /**
651
+ * The run failed. `error` is always a human-readable message. `code: "timeout"` (with `timeout`)
652
+ * marks a run stopped by a time limit instead of a provider or tool error; both fields are
653
+ * additive and absent for every other failure.
654
+ */
616
655
  run_failed: {
617
656
  error: string;
657
+ code?: "timeout";
658
+ timeout?: RunTimeoutInfo;
618
659
  };
619
660
  run_cancelled: {
620
661
  error: string;
@@ -1192,6 +1233,8 @@ export interface SessionDetailWire {
1192
1233
  export interface InflightState {
1193
1234
  runId: string;
1194
1235
  status: "queued" | "running";
1236
+ /** Epoch milliseconds when the run started executing; lets a reloaded client show elapsed time. */
1237
+ startedAt?: number;
1195
1238
  /** Assistant text streamed since the last `turn_completed`. */
1196
1239
  text: string;
1197
1240
  /** Reasoning streamed since the last `turn_completed` (never persisted). */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@alisio/sdk",
3
- "version": "0.1.0-alpha.18",
3
+ "version": "0.1.0-alpha.19",
4
4
  "description": "Typed plugin SDK for Alisio: the stable contract for tools, commands, context, compaction and session hooks, model completions and storage. Types only plus tiny helpers; zero runtime dependencies.",
5
5
  "author": "Gustavo Gutiérrez",
6
6
  "license": "MIT",