@tangle-network/agent-app 4.0.30 → 4.0.32

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>;
@@ -46,7 +46,7 @@ import "../chunk-S5SRJJQG.js";
46
46
  import "../chunk-R32MULDK.js";
47
47
  import {
48
48
  createTurnTrace
49
- } from "../chunk-H7NMUXNZ.js";
49
+ } from "../chunk-JLKH2VYF.js";
50
50
  import {
51
51
  sha256Hex
52
52
  } from "../chunk-HY57QRRW.js";
@@ -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,14 +1,14 @@
1
1
  import {
2
2
  createChatTurnRoutes,
3
3
  streamChatRouteAsSandboxEvents
4
- } from "../chunk-GHBQUZYG.js";
4
+ } from "../chunk-DSFMSRWT.js";
5
5
  import "../chunk-SBHFMDR7.js";
6
6
  import "../chunk-H6BRJU5M.js";
7
7
  import "../chunk-4DBHC63F.js";
8
8
  import "../chunk-RN4WPTBH.js";
9
9
  import "../chunk-MM6RLOXF.js";
10
10
  import "../chunk-M4QITAQV.js";
11
- import "../chunk-7TZX2KSH.js";
11
+ import "../chunk-G3W3EIP4.js";
12
12
  import "../chunk-F4TUZYMX.js";
13
13
  import "../chunk-MH74DY2I.js";
14
14
  import "../chunk-O6MFZVNS.js";
@@ -36,9 +36,9 @@ import "../chunk-S5SRJJQG.js";
36
36
  import "../chunk-GD4ONMKJ.js";
37
37
  import "../chunk-UGWQLQDS.js";
38
38
  import "../chunk-R32MULDK.js";
39
- import "../chunk-LSUJ2RIC.js";
39
+ import "../chunk-AG5Q273U.js";
40
40
  import "../chunk-D6UJEOZQ.js";
41
- import "../chunk-H7NMUXNZ.js";
41
+ import "../chunk-JLKH2VYF.js";
42
42
  import "../chunk-KSLTD4FI.js";
43
43
  import "../chunk-5VE4IDSU.js";
44
44
  import "../chunk-67CSI5PU.js";
@@ -2,7 +2,7 @@ import {
2
2
  ProtectedModelSettlementError,
3
3
  createRouterProtectedModelPort,
4
4
  runProtectedRouterTurn
5
- } from "../chunk-RK2VCJQW.js";
5
+ } from "../chunk-5L3X42ES.js";
6
6
  import {
7
7
  DURABLE_HOP_BUDGET_MS,
8
8
  asksForLanguage,
@@ -27,7 +27,7 @@ import {
27
27
  turnKnowledgeInstructions,
28
28
  workspaceKnowledgeForTurn,
29
29
  workspaceTurnCheckpoints
30
- } from "../chunk-LSUJ2RIC.js";
30
+ } from "../chunk-AG5Q273U.js";
31
31
  import {
32
32
  DEFAULT_TANGLE_BILLING_ENFORCEMENT_ENV_VAR,
33
33
  DEFAULT_TANGLE_ROUTER_BASE_URL,
@@ -43,7 +43,7 @@ import {
43
43
  tangleExecutionKeyHttpError,
44
44
  trimOrNull
45
45
  } from "../chunk-D6UJEOZQ.js";
46
- import "../chunk-H7NMUXNZ.js";
46
+ import "../chunk-JLKH2VYF.js";
47
47
  import {
48
48
  MAX_RECOMMENDED_MODELS,
49
49
  __resetCatalogCache,
@@ -14,9 +14,9 @@ import {
14
14
  turnKnowledgeInstructions,
15
15
  workspaceKnowledgeForTurn,
16
16
  workspaceTurnCheckpoints
17
- } from "../chunk-LSUJ2RIC.js";
17
+ } from "../chunk-AG5Q273U.js";
18
18
  import "../chunk-D6UJEOZQ.js";
19
- import "../chunk-H7NMUXNZ.js";
19
+ import "../chunk-JLKH2VYF.js";
20
20
  import "../chunk-KSLTD4FI.js";
21
21
  export {
22
22
  DURABLE_HOP_BUDGET_MS,
@@ -114,7 +114,7 @@ import {
114
114
  warmKey,
115
115
  warmReceiptId,
116
116
  warmWeekdayOf
117
- } from "../chunk-7TZX2KSH.js";
117
+ } from "../chunk-G3W3EIP4.js";
118
118
  import {
119
119
  createWarmCache
120
120
  } from "../chunk-F4TUZYMX.js";
@@ -177,7 +177,7 @@ import "../chunk-GD4ONMKJ.js";
177
177
  import "../chunk-UGWQLQDS.js";
178
178
  import "../chunk-R32MULDK.js";
179
179
  import "../chunk-D6UJEOZQ.js";
180
- import "../chunk-H7NMUXNZ.js";
180
+ import "../chunk-JLKH2VYF.js";
181
181
  import {
182
182
  splitDeferredProfileFiles,
183
183
  writeProfileFilesToBox
@@ -18,7 +18,7 @@ import {
18
18
  summarizeTurnSpans,
19
19
  tracedModelFetch,
20
20
  turnTraceId
21
- } from "../chunk-H7NMUXNZ.js";
21
+ } from "../chunk-JLKH2VYF.js";
22
22
  export {
23
23
  TURN_SPAN_KINDS,
24
24
  buildTurnTraceOtelSpans,
@@ -102,7 +102,8 @@ export interface TurnTrace {
102
102
  /** Name the turn's execution id once it is known. Spans recorded earlier keep their times. */
103
103
  bind(executionId: string): void;
104
104
  start(name: string, kind: TurnSpanKind, attrs?: TurnSpanAttrs, parent?: TurnSpan): TurnSpan;
105
- record(name: string, kind: TurnSpanKind, startMs: number, endMs: number, attrs?: TurnSpanAttrs, parent?: TurnSpan): TurnSpan;
105
+ /** A span whose times are already known; `error` marks it failed, as `end` does for an open one. */
106
+ record(name: string, kind: TurnSpanKind, startMs: number, endMs: number, attrs?: TurnSpanAttrs, parent?: TurnSpan, error?: unknown): TurnSpan;
106
107
  /** Run `work` inside a span; the span ends when it settles, failed if it throws. */
107
108
  measure<T>(name: string, kind: TurnSpanKind, work: (span: TurnSpan) => Promise<T> | T, attrs?: TurnSpanAttrs, parent?: TurnSpan): Promise<T>;
108
109
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tangle-network/agent-app",
3
- "version": "4.0.30",
3
+ "version": "4.0.32",
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": [