@anuma/sdk 10.6.1 → 10.7.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.
@@ -25350,7 +25350,13 @@ Executing tool: ${toolInfo}
25350
25350
  if (onError) onError(errorObj);
25351
25351
  await fireRunError({ error: errorMsg, stage: "model", errorObject: errorObj });
25352
25352
  const statusCode = err instanceof Error && "statusCode" in err ? err.statusCode : void 0;
25353
- return { data: null, error: errorMsg, statusCode };
25353
+ const connectionLost = !(err instanceof ProviderStreamError) && !(err instanceof SseError);
25354
+ return {
25355
+ data: null,
25356
+ error: errorMsg,
25357
+ statusCode,
25358
+ ...connectionLost ? { connectionLost: true } : {}
25359
+ };
25354
25360
  } finally {
25355
25361
  cleanupSignalLink();
25356
25362
  }
@@ -2276,6 +2276,8 @@ type RunToolLoopResult = {
2276
2276
  detached?: true;
2277
2277
  /** Non-null only when `resumable` was true AND an inference id was captured before detach. */
2278
2278
  resume?: StreamResumeHandle | null;
2279
+ /** True when the connection failed rather than the generation: the portal may still be generating. */
2280
+ connectionLost?: true;
2279
2281
  /**
2280
2282
  * Terminal state of the final model response, when the failure is one the
2281
2283
  * loop diagnosed FROM that response — today, the truncated-to-nothing
@@ -2276,6 +2276,8 @@ type RunToolLoopResult = {
2276
2276
  detached?: true;
2277
2277
  /** Non-null only when `resumable` was true AND an inference id was captured before detach. */
2278
2278
  resume?: StreamResumeHandle | null;
2279
+ /** True when the connection failed rather than the generation: the portal may still be generating. */
2280
+ connectionLost?: true;
2279
2281
  /**
2280
2282
  * Terminal state of the final model response, when the failure is one the
2281
2283
  * loop diagnosed FROM that response — today, the truncated-to-nothing
@@ -23619,7 +23619,13 @@ Executing tool: ${toolInfo}
23619
23619
  if (onError) onError(errorObj);
23620
23620
  await fireRunError({ error: errorMsg, stage: "model", errorObject: errorObj });
23621
23621
  const statusCode = err instanceof Error && "statusCode" in err ? err.statusCode : void 0;
23622
- return { data: null, error: errorMsg, statusCode };
23622
+ const connectionLost = !(err instanceof ProviderStreamError) && !(err instanceof SseError);
23623
+ return {
23624
+ data: null,
23625
+ error: errorMsg,
23626
+ statusCode,
23627
+ ...connectionLost ? { connectionLost: true } : {}
23628
+ };
23623
23629
  } finally {
23624
23630
  cleanupSignalLink();
23625
23631
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@anuma/sdk",
3
- "version": "10.6.1",
3
+ "version": "10.7.0",
4
4
  "description": "",
5
5
  "main": "./dist/index.cjs",
6
6
  "module": "./dist/index.mjs",