@tangle-network/agent-app 4.0.31 → 4.0.33

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.
@@ -0,0 +1,17 @@
1
+ /**
2
+ * Send a Platform request through a busy writer. Platform answers 503 `PLATFORM_BUSY` with `Retry-After` when its
3
+ * one SQLite writer is backed up past about 1 s (agent-container #19577, #19603, #19614): a service key write such as
4
+ * `POST /v1/keys/delegate` is refused before it queues, and a write that met a locked writer is rolled back. That
5
+ * answer carries no verdict, so the same request is sent again after Retry-After × (1 + U[0, 1)), spread so a shed
6
+ * burst does not come back in lockstep, while the deadline leaves the next attempt room. Any other answer, or a fetch
7
+ * that throws, is returned at once. The Sandbox Worker's Platform client waits the same way inside its 8 s delegation
8
+ * budget (agent-container `products/sandbox/api/src/lib/platform-client-errors.ts`).
9
+ */
10
+ /** A caller's own end for the wait, when it comes before the 8 s budget, and a signal that stops it early. */
11
+ export interface PlatformBusyWait {
12
+ deadline?: number;
13
+ signal?: AbortSignal;
14
+ }
15
+ /** Wait `ms`, or less when `signal` aborts first; answers whether the wait ran its course. */
16
+ export declare function sleepUnlessAborted(ms: number, signal?: AbortSignal): Promise<boolean>;
17
+ export declare function sendThroughPlatformBusy(send: (signal: AbortSignal) => Promise<Response>, wait?: PlatformBusyWait): Promise<Response>;
@@ -2,7 +2,7 @@ import "../chunk-IMSNXL2S.js";
2
2
  import {
3
3
  NATIVE_COMPLETION_RECEIPT_MAX_BYTES,
4
4
  observeNativeCompletion
5
- } from "../chunk-UFR4BXCC.js";
5
+ } from "../chunk-GOKFD7ZZ.js";
6
6
  import {
7
7
  createFieldCrypto
8
8
  } from "../chunk-AWIQQEFP.js";
@@ -12,7 +12,7 @@ import {
12
12
  import "../chunk-VGS2NXLB.js";
13
13
  import {
14
14
  createAssistantDraftWriter
15
- } from "../chunk-O6MFZVNS.js";
15
+ } from "../chunk-NAMSFODC.js";
16
16
  import "../chunk-QUV5M7SZ.js";
17
17
  import {
18
18
  assistantRowIdForTurn
@@ -121,9 +121,9 @@ export declare function createPublicConsultation(options: PublicConsultationOpti
121
121
  executionBudget?: ChatTurnExecutionLimits;
122
122
  maxOutputTokens?: number;
123
123
  }) => Promise<{
124
- start?: undefined;
125
124
  status: 'unsupported';
126
125
  reason: string;
126
+ start?: undefined;
127
127
  } | {
128
128
  reason?: undefined;
129
129
  status: 'prepared';
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  createChatTurnRoutes,
3
3
  streamChatRouteAsSandboxEvents
4
- } from "../chunk-DSFMSRWT.js";
4
+ } from "../chunk-HVQPVTKJ.js";
5
5
  import "../chunk-SBHFMDR7.js";
6
6
  import "../chunk-H6BRJU5M.js";
7
7
  import "../chunk-4DBHC63F.js";
@@ -11,7 +11,7 @@ import "../chunk-M4QITAQV.js";
11
11
  import "../chunk-G3W3EIP4.js";
12
12
  import "../chunk-F4TUZYMX.js";
13
13
  import "../chunk-MH74DY2I.js";
14
- import "../chunk-O6MFZVNS.js";
14
+ import "../chunk-NAMSFODC.js";
15
15
  import "../chunk-QUV5M7SZ.js";
16
16
  import "../chunk-QM5TPZQY.js";
17
17
  import "../chunk-WGT32NQ4.js";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tangle-network/agent-app",
3
- "version": "4.0.31",
3
+ "version": "4.0.33",
4
4
  "packageManager": "pnpm@11.28.8",
5
5
  "description": "Build agent applications with typed chat, tools, sandboxes, integrations, billing, and evaluation.",
6
6
  "keywords": [