@tangle-network/agent-app 0.63.5 → 0.63.7

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.
Files changed (41) hide show
  1. package/dist/assistant/index.js +1 -1
  2. package/dist/chat-routes/default-backend.d.ts +46 -0
  3. package/dist/chat-routes/dispatch-first.d.ts +3 -2
  4. package/dist/chat-routes/index.d.ts +1 -0
  5. package/dist/chat-routes/index.js +13 -345
  6. package/dist/chat-routes/index.js.map +1 -1
  7. package/dist/chat-routes/route-prewarm.d.ts +2 -0
  8. package/dist/chat-routes/route-storage.d.ts +13 -4
  9. package/dist/chat-routes/sandbox-model-source.d.ts +1 -0
  10. package/dist/chat-routes/turn-ownership.d.ts +2 -1
  11. package/dist/chat-routes/turn-route-contracts.d.ts +21 -5
  12. package/dist/{chunk-XYSKMHWG.js → chunk-42QCR4CV.js} +548 -15
  13. package/dist/chunk-42QCR4CV.js.map +1 -0
  14. package/dist/{chunk-JRTWTADT.js → chunk-E3AOUTIR.js} +5 -2
  15. package/dist/chunk-E3AOUTIR.js.map +1 -0
  16. package/dist/{chunk-IDG2XR5O.js → chunk-EKXG4JSN.js} +2 -2
  17. package/dist/chunk-EKXG4JSN.js.map +1 -0
  18. package/dist/{chunk-4CALWPN5.js → chunk-L6BS2XTE.js} +20 -16
  19. package/dist/chunk-L6BS2XTE.js.map +1 -0
  20. package/dist/{chunk-YCMVNXAX.js → chunk-NUWSPR5O.js} +2 -2
  21. package/dist/{chunk-OCR36QGZ.js → chunk-UVMKP5IK.js} +65 -28
  22. package/dist/chunk-UVMKP5IK.js.map +1 -0
  23. package/dist/public-consultation/index.js +3 -3
  24. package/dist/runtime/index.js +2 -2
  25. package/dist/runtime/router-turn.d.ts +2 -2
  26. package/dist/runtime/router-turn.js +1 -1
  27. package/dist/sandbox/index.js +1 -1
  28. package/dist/sandbox/prompt-events.d.ts +1 -1
  29. package/dist/sandbox/sandbox-run-error.d.ts +8 -0
  30. package/dist/sandbox/sandbox-run-tool.d.ts +5 -9
  31. package/dist/signoff/cli.js +1 -1
  32. package/dist/signoff/index.js +1 -1
  33. package/dist/web-react/durable-plan-flow.d.ts +10 -0
  34. package/dist/web-react/index.js +1 -1
  35. package/package.json +1 -1
  36. package/dist/chunk-4CALWPN5.js.map +0 -1
  37. package/dist/chunk-IDG2XR5O.js.map +0 -1
  38. package/dist/chunk-JRTWTADT.js.map +0 -1
  39. package/dist/chunk-OCR36QGZ.js.map +0 -1
  40. package/dist/chunk-XYSKMHWG.js.map +0 -1
  41. /package/dist/{chunk-YCMVNXAX.js.map → chunk-NUWSPR5O.js.map} +0 -0
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  createChatTurnRoutes,
3
3
  streamChatRouteAsSandboxEvents
4
- } from "../chunk-XYSKMHWG.js";
4
+ } from "../chunk-42QCR4CV.js";
5
5
  import "../chunk-KH4QSBNI.js";
6
6
  import "../chunk-CQGEGPY7.js";
7
7
  import "../chunk-RN4WPTBH.js";
@@ -9,7 +9,7 @@ import "../chunk-WP2GYFZ4.js";
9
9
  import "../chunk-4DBHC63F.js";
10
10
  import "../chunk-MH74DY2I.js";
11
11
  import "../chunk-MM6RLOXF.js";
12
- import "../chunk-OCR36QGZ.js";
12
+ import "../chunk-UVMKP5IK.js";
13
13
  import "../chunk-F4TUZYMX.js";
14
14
  import "../chunk-N6URQ6DM.js";
15
15
  import "../chunk-Z4RD5UF7.js";
@@ -33,7 +33,7 @@ import "../chunk-S5SRJJQG.js";
33
33
  import "../chunk-FCYHDENJ.js";
34
34
  import "../chunk-UGWQLQDS.js";
35
35
  import "../chunk-HRBF4B5L.js";
36
- import "../chunk-IDG2XR5O.js";
36
+ import "../chunk-EKXG4JSN.js";
37
37
  import "../chunk-D6UJEOZQ.js";
38
38
  import "../chunk-AVBNS64P.js";
39
39
  import "../chunk-AMUXRAUO.js";
@@ -2,7 +2,7 @@ import {
2
2
  ProtectedModelSettlementError,
3
3
  createRouterProtectedModelPort,
4
4
  runProtectedRouterTurn
5
- } from "../chunk-YCMVNXAX.js";
5
+ } from "../chunk-NUWSPR5O.js";
6
6
  import {
7
7
  DURABLE_HOP_BUDGET_MS,
8
8
  asksForLanguage,
@@ -26,7 +26,7 @@ import {
26
26
  turnKnowledgeInstructions,
27
27
  workspaceKnowledgeForTurn,
28
28
  workspaceTurnCheckpoints
29
- } from "../chunk-IDG2XR5O.js";
29
+ } from "../chunk-EKXG4JSN.js";
30
30
  import {
31
31
  DEFAULT_TANGLE_BILLING_ENFORCEMENT_ENV_VAR,
32
32
  DEFAULT_TANGLE_ROUTER_BASE_URL,
@@ -269,8 +269,8 @@ export interface RouterTurnOptions {
269
269
  /** At most this many tool calls run. The next one is refused before it runs and the turn ends
270
270
  * with `turn_tool_limit`. */
271
271
  maxToolCalls?: number;
272
- /** Replace the text the model reads for one tool result. `toolName` is the app's name. */
273
- renderToolResult?: (toolName: string, outcome: RouterTurnToolOutcome) => string;
272
+ /** Replace a domain-specific tool result; return undefined to use the shared serialization and limit. */
273
+ renderToolResult?: (toolName: string, outcome: RouterTurnToolOutcome) => string | undefined;
274
274
  /**
275
275
  * Place the turn before any model call, using `model` as the executed model rather than
276
276
  * the optional `requestedModel` hint. A turn placed in the sandbox returns at once
@@ -13,7 +13,7 @@ import {
13
13
  turnKnowledgeInstructions,
14
14
  workspaceKnowledgeForTurn,
15
15
  workspaceTurnCheckpoints
16
- } from "../chunk-IDG2XR5O.js";
16
+ } from "../chunk-EKXG4JSN.js";
17
17
  import "../chunk-D6UJEOZQ.js";
18
18
  import "../chunk-AVBNS64P.js";
19
19
  import "../chunk-AMUXRAUO.js";
@@ -101,7 +101,7 @@ import {
101
101
  warmKey,
102
102
  warmReceiptId,
103
103
  warmWeekdayOf
104
- } from "../chunk-OCR36QGZ.js";
104
+ } from "../chunk-UVMKP5IK.js";
105
105
  import {
106
106
  createWarmCache
107
107
  } from "../chunk-F4TUZYMX.js";
@@ -65,7 +65,7 @@ export type SandboxStepTransition = {
65
65
  };
66
66
  /** Resolve the severed stream event to a corresponding sandbox step transition or null */
67
67
  export declare function classifySeveredStream(event: unknown): SandboxStepTransition | null;
68
- /** Determine if an event is a terminal prompt event with type 'result' or 'done */
68
+ /** A backend result or terminal event, excluding SDK cleanup after observation loss. */
69
69
  export declare function isTerminalPromptEvent(event: unknown): boolean;
70
70
  /** Resolve the interactive question text from a structured event or return null if none found */
71
71
  export declare function detectInteractiveQuestion(event: unknown): string | null;
@@ -0,0 +1,8 @@
1
+ /** Typed computer-task outcomes shared by prompt observation and the Router tool. */
2
+ export type SandboxRunFailureCode = 'sandbox_unavailable' | 'sandbox_failed' | 'sandbox_unconfirmed' | 'sandbox_empty' | 'invalid_arguments';
3
+ export declare class SandboxRunError extends Error {
4
+ readonly code: SandboxRunFailureCode;
5
+ constructor(code: SandboxRunFailureCode, message: string, options?: {
6
+ cause?: unknown;
7
+ });
8
+ }
@@ -21,14 +21,8 @@
21
21
  import type { SandboxInstance } from '@tangle-network/sandbox';
22
22
  import type { TurnSpan, TurnTrace } from '../turn-trace/recorder';
23
23
  import { type SandboxRuntimeConfig, type StreamSandboxPromptOptions } from './index';
24
- export type SandboxRunFailureCode = 'sandbox_unavailable' | 'sandbox_failed' | 'sandbox_empty' | 'invalid_arguments';
25
- /** A typed `sandbox_run` failure. `code` and `message` are what the model reads. */
26
- export declare class SandboxRunError extends Error {
27
- readonly code: SandboxRunFailureCode;
28
- constructor(code: SandboxRunFailureCode, message: string, options?: {
29
- cause?: unknown;
30
- });
31
- }
24
+ import { SandboxRunError } from './sandbox-run-error';
25
+ export { SandboxRunError, type SandboxRunFailureCode } from './sandbox-run-error';
32
26
  /** The engine's per-call tool context (`RouterTurnToolContext`), kept structural so this module does not import the engine. */
33
27
  export interface SandboxToolContext {
34
28
  /** The Router engine's call identity; never derived from task text. */
@@ -90,6 +84,8 @@ export interface SandboxRunTool {
90
84
  }>;
91
85
  }
92
86
  export declare const SANDBOX_RUN_DESCRIPTION: string;
93
- /** The default `runTask`: the shell's own `runSandboxPrompt`, unattended (questions refused). */
87
+ /** The shell's unattended runner. A supplied execution/turn id seeds child
88
+ * identity with the actual tool callId: different calls stay separate and a
89
+ * retry of that exact call stays idempotent. Without callId, use a fresh child. */
94
90
  export declare function sandboxPromptRunner(shell: SandboxRuntimeConfig, prompt?: Omit<StreamSandboxPromptOptions, 'signal' | 'history'>): SandboxRunToolOptions['runTask'];
95
91
  export declare function createSandboxRunTool(options: SandboxRunToolOptions): SandboxRunTool;
@@ -10,7 +10,7 @@ import {
10
10
  runSignoff,
11
11
  runSurfaceLadderCli,
12
12
  runWorkspaceSurfaceCli
13
- } from "../chunk-JRTWTADT.js";
13
+ } from "../chunk-E3AOUTIR.js";
14
14
  import "../chunk-LRYY3OX7.js";
15
15
  import {
16
16
  invokedAsScript
@@ -42,7 +42,7 @@ import {
42
42
  runWorkspaceSurfaceCli,
43
43
  summarizeSurfacePage,
44
44
  surfaceDeltaL
45
- } from "../chunk-JRTWTADT.js";
45
+ } from "../chunk-E3AOUTIR.js";
46
46
  import "../chunk-LRYY3OX7.js";
47
47
  export {
48
48
  HEADER_TOP_TOLERANCE_PX,
@@ -33,6 +33,8 @@ export interface DurablePlanCurrentInput {
33
33
  }
34
34
  /** Define methods to obtain and decide durable plan decisions asynchronously */
35
35
  export interface DurablePlanDecisionClient {
36
+ /** Stable transport context, independent of the client object's identity. */
37
+ readonly scopeKey?: string;
36
38
  current: (input: DurablePlanCurrentInput) => Promise<DurablePlanDecisionResult>;
37
39
  decide: (input: DurablePlanDecisionInput) => Promise<DurablePlanDecisionResult>;
38
40
  }
@@ -46,6 +48,9 @@ export declare class DurablePlanClientError extends Error {
46
48
  /** Define configuration options for creating a durable plan decision client */
47
49
  export interface DurablePlanDecisionClientOptions {
48
50
  url: string | ((input: DurablePlanCurrentInput | DurablePlanDecisionInput) => string);
51
+ /** Non-secret endpoint/workspace/authentication identity. Defaults to a
52
+ * string URL; function URLs and authentication changes need an explicit key. */
53
+ scopeKey?: string;
49
54
  body?: Record<string, unknown> | ((input: DurablePlanDecisionInput) => Record<string, unknown>);
50
55
  fetchImpl?: typeof fetch;
51
56
  }
@@ -57,6 +62,11 @@ export declare function createDurablePlanDecisionClient(options: DurablePlanDeci
57
62
  export interface UseDurablePlanFlowOptions {
58
63
  plan: ChatPlan;
59
64
  client: DurablePlanDecisionClient;
65
+ /** Stable, non-secret identity of the endpoint/workspace/authentication
66
+ * context. Change it when that context changes even if the plan does not.
67
+ * Defaults to client.scopeKey. Incidental client object recreation does not
68
+ * change request lifetime. */
69
+ scopeKey?: string;
60
70
  /** Must be idempotent by receipt.receiptId. */
61
71
  attachFollowUp?: (receipt: DurablePlanFollowUpReceipt, plan: ChatPlan, decision: DurablePlanDecision) => Promise<void> | void;
62
72
  /** Restore an already-decided plan and bound failed follow-up attachment attempts. */
@@ -143,7 +143,7 @@ import {
143
143
  withoutRecordGridCreated,
144
144
  withoutRecordGridRemoved,
145
145
  withoutRecordGridUpdate
146
- } from "../chunk-4CALWPN5.js";
146
+ } from "../chunk-L6BS2XTE.js";
147
147
  import {
148
148
  MENTION_PILL_CLASS
149
149
  } from "../chunk-3HUFJ5LO.js";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tangle-network/agent-app",
3
- "version": "0.63.5",
3
+ "version": "0.63.7",
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": [