@astralform/js 7.0.0 → 7.1.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/dist/index.d.cts CHANGED
@@ -914,6 +914,19 @@ interface ModelOption {
914
914
  * drive.
915
915
  */
916
916
  thinkingControl?: ThinkingDescriptor;
917
+ /** the provider's brand mark (picker tiles); null until the backend rollout / for icon-less providers */
918
+ iconUrl?: string | null;
919
+ /** when the CALLER last ran this model (picker "Recent" ordering); null for a never-used model */
920
+ lastUsedAt?: string | null;
921
+ /** how many times the caller has run this model; null alongside lastUsedAt */
922
+ useCount?: number | null;
923
+ /**
924
+ * The model's context window in tokens, as the serving provider reports it
925
+ * — which is not always the model's headline number (a provider may serve
926
+ * a smaller window than the model supports). Null when the backend does not
927
+ * state one.
928
+ */
929
+ contextWindow?: number | null;
917
930
  }
918
931
  interface ConversationAsset {
919
932
  id: string;
@@ -1316,7 +1329,7 @@ declare class ChatSession {
1316
1329
  * whether an ended stream means "turn done" vs "dropped, reconnect".
1317
1330
  *
1318
1331
  * ``onStall`` aborts the per-attempt connection: if no event arrives within
1319
- * SSE_STALL_TIMEOUT_MS (backend keepalives land every 15s), the stream is a
1332
+ * SSE_STALL_TIMEOUT_MS (backend keepalives land every 15-45s), the stream is a
1320
1333
  * zombie — ``reader.read()`` will never settle — so we kill the fetch and
1321
1334
  * throw a ConnectionError, feeding the caller's reconnect-from-lastSeq loop.
1322
1335
  */
package/dist/index.d.ts CHANGED
@@ -914,6 +914,19 @@ interface ModelOption {
914
914
  * drive.
915
915
  */
916
916
  thinkingControl?: ThinkingDescriptor;
917
+ /** the provider's brand mark (picker tiles); null until the backend rollout / for icon-less providers */
918
+ iconUrl?: string | null;
919
+ /** when the CALLER last ran this model (picker "Recent" ordering); null for a never-used model */
920
+ lastUsedAt?: string | null;
921
+ /** how many times the caller has run this model; null alongside lastUsedAt */
922
+ useCount?: number | null;
923
+ /**
924
+ * The model's context window in tokens, as the serving provider reports it
925
+ * — which is not always the model's headline number (a provider may serve
926
+ * a smaller window than the model supports). Null when the backend does not
927
+ * state one.
928
+ */
929
+ contextWindow?: number | null;
917
930
  }
918
931
  interface ConversationAsset {
919
932
  id: string;
@@ -1316,7 +1329,7 @@ declare class ChatSession {
1316
1329
  * whether an ended stream means "turn done" vs "dropped, reconnect".
1317
1330
  *
1318
1331
  * ``onStall`` aborts the per-attempt connection: if no event arrives within
1319
- * SSE_STALL_TIMEOUT_MS (backend keepalives land every 15s), the stream is a
1332
+ * SSE_STALL_TIMEOUT_MS (backend keepalives land every 15-45s), the stream is a
1320
1333
  * zombie — ``reader.read()`` will never settle — so we kill the fetch and
1321
1334
  * throw a ConnectionError, feeding the caller's reconnect-from-lastSeq loop.
1322
1335
  */
package/dist/index.js CHANGED
@@ -578,7 +578,16 @@ var AstralformClient = class {
578
578
  */
579
579
  async getModels() {
580
580
  const raw = await this.get("/v1/models");
581
- return raw.map((m) => camelizeKeys(m));
581
+ return raw.map((m) => {
582
+ const option = camelizeKeys(m);
583
+ return {
584
+ ...option,
585
+ iconUrl: option.iconUrl ?? null,
586
+ lastUsedAt: option.lastUsedAt ?? null,
587
+ useCount: option.useCount ?? null,
588
+ contextWindow: option.contextWindow ?? null
589
+ };
590
+ });
582
591
  }
583
592
  async getSkills() {
584
593
  const raw = await this.get("/v1/skills");
@@ -1254,7 +1263,7 @@ function translateWireEvent(wire) {
1254
1263
 
1255
1264
  // src/session.ts
1256
1265
  var SSE_MAX_RECONNECTS = 6;
1257
- var SSE_STALL_TIMEOUT_MS = 45e3;
1266
+ var SSE_STALL_TIMEOUT_MS = 135e3;
1258
1267
  var TOOL_RESULT_MAX_RETRIES = 3;
1259
1268
  var CONVERSATION_PAGE_SIZE = 50;
1260
1269
  function sseReconnectDelayMs(attempt) {
@@ -1665,7 +1674,7 @@ var ChatSession = class {
1665
1674
  * whether an ended stream means "turn done" vs "dropped, reconnect".
1666
1675
  *
1667
1676
  * ``onStall`` aborts the per-attempt connection: if no event arrives within
1668
- * SSE_STALL_TIMEOUT_MS (backend keepalives land every 15s), the stream is a
1677
+ * SSE_STALL_TIMEOUT_MS (backend keepalives land every 15-45s), the stream is a
1669
1678
  * zombie — ``reader.read()`` will never settle — so we kill the fetch and
1670
1679
  * throw a ConnectionError, feeding the caller's reconnect-from-lastSeq loop.
1671
1680
  */