@tangle-network/agent-app 0.52.15 → 0.52.17

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.
@@ -30,6 +30,7 @@ import type { WorkProductPersistedPart } from '../work-product/types';
30
30
  export * from './chat-stream';
31
31
  export * from './chat-interactions';
32
32
  export * from './chat-composer';
33
+ export { getChatFundingRecovery, type ChatFundingFailure, type ChatFundingRecovery } from './turn-funding-recovery';
33
34
  export { RouteChunkBoundary, type RouteChunkBoundaryProps } from './lazy-load-boundary';
34
35
  export * from './agent-profile-editor';
35
36
  export * from './agent-profile-viewer';
@@ -64,6 +64,7 @@ import {
64
64
  formatRecordGridValue,
65
65
  formatSparklineValue,
66
66
  formatTokensPerSecond,
67
+ getChatFundingRecovery,
67
68
  hasSecretField,
68
69
  hydrateChatInteractions,
69
70
  insightDelta,
@@ -130,7 +131,7 @@ import {
130
131
  withoutRecordGridCreated,
131
132
  withoutRecordGridRemoved,
132
133
  withoutRecordGridUpdate
133
- } from "../chunk-IK7JCJQF.js";
134
+ } from "../chunk-JHHNODBT.js";
134
135
  import {
135
136
  SessionHistoryPanel,
136
137
  formatSessionTimestamp,
@@ -376,6 +377,7 @@ export {
376
377
  formatSessionTimestamp,
377
378
  formatSparklineValue,
378
379
  formatTokensPerSecond,
380
+ getChatFundingRecovery,
379
381
  hasSecretField,
380
382
  hydrateChatInteractions,
381
383
  insightDelta,
@@ -0,0 +1,20 @@
1
+ export interface ChatFundingFailure {
2
+ code?: string;
3
+ message?: string;
4
+ }
5
+ /** Presentation only. The host supplies its authenticated billing destination. */
6
+ export interface ChatFundingRecovery {
7
+ reason: 'insufficient_credits' | 'paid_access_required';
8
+ title: string;
9
+ message: string;
10
+ actionLabel: string;
11
+ /** Retrying the same request cannot repair a funding prerequisite. */
12
+ retryable: false;
13
+ }
14
+ /**
15
+ * Recognize a paid-access refusal across HTTP and SDK-wrapped chat failures.
16
+ * Structured codes take precedence; the message fallback covers older sandbox
17
+ * transports that preserve the provider's words but replace its error code.
18
+ * This does not infer funding from a generic HTTP status or authorize a run.
19
+ */
20
+ export declare function getChatFundingRecovery(failure: ChatFundingFailure | string | null | undefined): ChatFundingRecovery | null;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tangle-network/agent-app",
3
- "version": "0.52.15",
3
+ "version": "0.52.17",
4
4
  "packageManager": "pnpm@11.24.0",
5
5
  "description": "Build agent applications with typed chat, tools, sandboxes, integrations, billing, and evaluation.",
6
6
  "keywords": [
@@ -609,7 +609,7 @@
609
609
  "@tangle-network/brand": "1.10.0",
610
610
  "@tangle-network/hub-sdk": "0.24.0",
611
611
  "@tangle-network/sandbox": "0.60.10",
612
- "@tangle-network/sandbox-ui": "0.121.0",
612
+ "@tangle-network/sandbox-ui": "0.122.0",
613
613
  "@tangle-network/ui": "11.15.2",
614
614
  "@testing-library/dom": "^10.4.1",
615
615
  "@testing-library/react": "^16.3.3",
@@ -681,7 +681,7 @@
681
681
  "@tangle-network/brand": ">=1.6.0",
682
682
  "@tangle-network/hub-sdk": ">=0.19.3 <0.21.0 || >=0.21.0 <0.22.0 || >=0.22.1 <0.25.0",
683
683
  "@tangle-network/sandbox": ">=0.45.0 <0.48.0 || ^0.49.0 || ^0.50.0 || ^0.51.0 || ^0.52.0 || ^0.53.0 || ^0.54.0 || ^0.55.0 || >=0.58.1 <0.60.0 || >=0.60.3 <0.61.0",
684
- "@tangle-network/sandbox-ui": ">=0.117.0 <0.118.0 || >=0.119.0 <0.122.0",
684
+ "@tangle-network/sandbox-ui": ">=0.117.0 <0.118.0 || >=0.119.0 <0.123.0",
685
685
  "@tangle-network/ui": ">=11.11.3 <12.0.0",
686
686
  "@tiptap/core": ">=3.28.0 <4.0.0",
687
687
  "@tiptap/extension-mention": ">=3.28.0 <4.0.0",