@astralform/js 4.8.0 → 4.9.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.cts CHANGED
@@ -297,6 +297,7 @@ interface WireMessageStop extends WireEnvelope {
297
297
  input_tokens?: number;
298
298
  output_tokens?: number;
299
299
  cached_tokens?: number;
300
+ cache_creation_tokens?: number;
300
301
  };
301
302
  ttfb_ms?: number | null;
302
303
  total_ms: number;
@@ -344,6 +345,8 @@ interface TurnUsage {
344
345
  inputTokens: number;
345
346
  outputTokens: number;
346
347
  cachedTokens: number;
348
+ /** Tokens written to the model's prompt cache (wire: `cache_creation_tokens`). */
349
+ cacheCreationTokens: number;
347
350
  }
348
351
  type BlockDeltaPayload = {
349
352
  channel: "text";
@@ -629,6 +632,8 @@ interface TeamAgentSummary {
629
632
  teamId: string;
630
633
  createdAt: string;
631
634
  updatedAt: string;
635
+ /** Agent avatar URL, when the team has set one (wire: `avatar_url`). */
636
+ avatarUrl?: string | null;
632
637
  }
633
638
  interface SkillInfo {
634
639
  name: string;
@@ -700,6 +705,7 @@ interface ChatStreamRequest {
700
705
  agent_name?: string;
701
706
  plan_mode?: boolean;
702
707
  image_mode?: boolean;
708
+ video_mode?: boolean;
703
709
  /**
704
710
  * Start a durable long-horizon goal for this run (goal mode). The backend mints
705
711
  * an agent_goal from this text and drives the run under a budget until the
@@ -805,6 +811,22 @@ interface SendOptions$1 extends ModelChoiceOptions {
805
811
  * The `image_mode` field itself is accepted from Astralform ≥ 0.59.0.
806
812
  */
807
813
  imageMode?: boolean;
814
+ /**
815
+ * Put this turn in video mode, attaching the video-generation tool.
816
+ *
817
+ * Off by default and per-message, for a sharper reason than images: a clip
818
+ * occupies one shared GPU for minutes, during which image generation on the
819
+ * same host cannot run at all. The tool is not attached unless this is set.
820
+ *
821
+ * Mutually exclusive with `imageMode` at the composer level — which is why a
822
+ * video turn also gets the image tool server-side: the user cannot select
823
+ * both, so the agent must be able to produce its own first frame.
824
+ *
825
+ * `generate_video` animates an EXISTING image; it cannot start from text, and
826
+ * the clip is silent. Gate the affordance on `AgentStatus.capabilities`
827
+ * (`video`), the same way image mode does.
828
+ */
829
+ videoMode?: boolean;
808
830
  /**
809
831
  * Start a durable long-horizon goal for this run (goal mode). The text becomes
810
832
  * the goal's objective; the backend keeps the agent working under a budget until
@@ -1334,6 +1356,13 @@ interface SendOptions extends ModelChoiceOptions {
1334
1356
  * provider. Gate the affordance on `AgentStatus.capabilities`.
1335
1357
  */
1336
1358
  imageMode?: boolean;
1359
+ /**
1360
+ * Attach the video-generation tool to this turn. Mutually exclusive with
1361
+ * `imageMode` at the composer level. See `SendOptions.videoMode` in types.ts
1362
+ * for the full rule — a clip animates an existing image, is silent, and holds
1363
+ * one shared GPU for minutes, so it is per-message and off by default.
1364
+ */
1365
+ videoMode?: boolean;
1337
1366
  /**
1338
1367
  * Start a durable long-horizon goal for this run (goal mode) — the text is the
1339
1368
  * goal objective the backend drives to completion. Omit for a normal turn.
package/dist/index.d.ts CHANGED
@@ -297,6 +297,7 @@ interface WireMessageStop extends WireEnvelope {
297
297
  input_tokens?: number;
298
298
  output_tokens?: number;
299
299
  cached_tokens?: number;
300
+ cache_creation_tokens?: number;
300
301
  };
301
302
  ttfb_ms?: number | null;
302
303
  total_ms: number;
@@ -344,6 +345,8 @@ interface TurnUsage {
344
345
  inputTokens: number;
345
346
  outputTokens: number;
346
347
  cachedTokens: number;
348
+ /** Tokens written to the model's prompt cache (wire: `cache_creation_tokens`). */
349
+ cacheCreationTokens: number;
347
350
  }
348
351
  type BlockDeltaPayload = {
349
352
  channel: "text";
@@ -629,6 +632,8 @@ interface TeamAgentSummary {
629
632
  teamId: string;
630
633
  createdAt: string;
631
634
  updatedAt: string;
635
+ /** Agent avatar URL, when the team has set one (wire: `avatar_url`). */
636
+ avatarUrl?: string | null;
632
637
  }
633
638
  interface SkillInfo {
634
639
  name: string;
@@ -700,6 +705,7 @@ interface ChatStreamRequest {
700
705
  agent_name?: string;
701
706
  plan_mode?: boolean;
702
707
  image_mode?: boolean;
708
+ video_mode?: boolean;
703
709
  /**
704
710
  * Start a durable long-horizon goal for this run (goal mode). The backend mints
705
711
  * an agent_goal from this text and drives the run under a budget until the
@@ -805,6 +811,22 @@ interface SendOptions$1 extends ModelChoiceOptions {
805
811
  * The `image_mode` field itself is accepted from Astralform ≥ 0.59.0.
806
812
  */
807
813
  imageMode?: boolean;
814
+ /**
815
+ * Put this turn in video mode, attaching the video-generation tool.
816
+ *
817
+ * Off by default and per-message, for a sharper reason than images: a clip
818
+ * occupies one shared GPU for minutes, during which image generation on the
819
+ * same host cannot run at all. The tool is not attached unless this is set.
820
+ *
821
+ * Mutually exclusive with `imageMode` at the composer level — which is why a
822
+ * video turn also gets the image tool server-side: the user cannot select
823
+ * both, so the agent must be able to produce its own first frame.
824
+ *
825
+ * `generate_video` animates an EXISTING image; it cannot start from text, and
826
+ * the clip is silent. Gate the affordance on `AgentStatus.capabilities`
827
+ * (`video`), the same way image mode does.
828
+ */
829
+ videoMode?: boolean;
808
830
  /**
809
831
  * Start a durable long-horizon goal for this run (goal mode). The text becomes
810
832
  * the goal's objective; the backend keeps the agent working under a budget until
@@ -1334,6 +1356,13 @@ interface SendOptions extends ModelChoiceOptions {
1334
1356
  * provider. Gate the affordance on `AgentStatus.capabilities`.
1335
1357
  */
1336
1358
  imageMode?: boolean;
1359
+ /**
1360
+ * Attach the video-generation tool to this turn. Mutually exclusive with
1361
+ * `imageMode` at the composer level. See `SendOptions.videoMode` in types.ts
1362
+ * for the full rule — a clip animates an existing image, is silent, and holds
1363
+ * one shared GPU for minutes, so it is per-message and off by default.
1364
+ */
1365
+ videoMode?: boolean;
1337
1366
  /**
1338
1367
  * Start a durable long-horizon goal for this run (goal mode) — the text is the
1339
1368
  * goal objective the backend drives to completion. Omit for a normal turn.
package/dist/index.js CHANGED
@@ -737,7 +737,8 @@ var AstralformClient = class {
737
737
  name: a.name,
738
738
  teamId: a.team_id,
739
739
  createdAt: a.created_at,
740
- updatedAt: a.updated_at
740
+ updatedAt: a.updated_at,
741
+ avatarUrl: a.avatar_url ?? null
741
742
  }));
742
743
  }
743
744
  // --- Jobs API ---
@@ -1019,6 +1020,19 @@ function translateAgentIdentity(raw) {
1019
1020
  description: raw.description ?? null
1020
1021
  };
1021
1022
  }
1023
+ function translateTodoItem(raw) {
1024
+ return {
1025
+ id: raw.id ?? 0,
1026
+ subject: raw.subject ?? "",
1027
+ status: raw.status ?? "pending",
1028
+ description: raw.description ?? null,
1029
+ activeForm: raw.active_form ?? null,
1030
+ owner: raw.owner ?? null,
1031
+ blockedBy: raw.blocked_by ?? null,
1032
+ blocks: raw.blocks ?? null,
1033
+ priority: raw.priority ?? null
1034
+ };
1035
+ }
1022
1036
  function translateCustomEvent(name, data) {
1023
1037
  switch (name) {
1024
1038
  case "user_message":
@@ -1035,7 +1049,9 @@ function translateCustomEvent(name, data) {
1035
1049
  case "todo_update":
1036
1050
  return {
1037
1051
  type: "todo_update",
1038
- todos: data.todos ?? []
1052
+ todos: (data.todos ?? []).map(
1053
+ (t) => translateTodoItem(t)
1054
+ )
1039
1055
  };
1040
1056
  case "plan_update":
1041
1057
  return {
@@ -1228,7 +1244,8 @@ function translateWireEvent(wire) {
1228
1244
  usage: {
1229
1245
  inputTokens: wire.usage.input_tokens ?? 0,
1230
1246
  outputTokens: wire.usage.output_tokens ?? 0,
1231
- cachedTokens: wire.usage.cached_tokens ?? 0
1247
+ cachedTokens: wire.usage.cached_tokens ?? 0,
1248
+ cacheCreationTokens: wire.usage.cache_creation_tokens ?? 0
1232
1249
  },
1233
1250
  ttfbMs: wire.ttfb_ms,
1234
1251
  totalMs: wire.total_ms,
@@ -1436,6 +1453,7 @@ var ChatSession = class {
1436
1453
  agent_name: options?.agentName,
1437
1454
  plan_mode: options?.planMode,
1438
1455
  image_mode: options?.imageMode,
1456
+ video_mode: options?.videoMode,
1439
1457
  goal: options?.goal,
1440
1458
  // Per-request model choice (client-side model selection).
1441
1459
  provider: options?.provider,
@@ -2143,6 +2161,7 @@ var StreamManager = class {
2143
2161
  uploadIds: options?.uploadIds,
2144
2162
  planMode: options?.planMode,
2145
2163
  imageMode: options?.imageMode,
2164
+ videoMode: options?.videoMode,
2146
2165
  goal: options?.goal,
2147
2166
  provider: options?.provider,
2148
2167
  model: options?.model,