@tangle-network/agent-app 0.60.199 → 0.60.200

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.
@@ -6,6 +6,7 @@ import { type Harness } from '../harness/index';
6
6
  import { type TangleExecutionEnvironment } from '../runtime/model';
7
7
  import { type Outcome } from './outcome';
8
8
  import type { TurnSpan, TurnTrace } from '../turn-trace/recorder';
9
+ export { traceSandboxPromptEvents, type TraceSandboxPromptOptions } from './prompt-trace';
9
10
  import { type ProfileFingerprint } from '../profile/fingerprint';
10
11
  import { type ComposeProfileBudget } from '../profile/budget';
11
12
  import { resolveModel, resolveModelSelection, backendModelFields, requireTransportableModel, SandboxModelResolutionError, type ProviderResolutionConfig, type ResolvedModel, type ModelSelection, type ModelSelectionFailure, type ModelSelectionError, type ModelSelectionSource } from './model';
@@ -93,11 +93,12 @@ import {
93
93
  syncSandboxMemberAdd,
94
94
  syncSandboxMemberRemove,
95
95
  syncSandboxMemberRole,
96
+ traceSandboxPromptEvents,
96
97
  utcDay,
97
98
  warmBinOf,
98
99
  warmWeekdayOf,
99
100
  writeProfileFilesToBox
100
- } from "../chunk-RJJRRR5Z.js";
101
+ } from "../chunk-ZHJ2TDWA.js";
101
102
  import {
102
103
  EGRESS_PROXY_RECOVERY_PHASE,
103
104
  EGRESS_PROXY_RECOVERY_REQUIRED,
@@ -275,6 +276,7 @@ export {
275
276
  syncSandboxMemberAdd,
276
277
  syncSandboxMemberRemove,
277
278
  syncSandboxMemberRole,
279
+ traceSandboxPromptEvents,
278
280
  utcDay,
279
281
  warmBinOf,
280
282
  warmWeekdayOf,
@@ -11,10 +11,16 @@
11
11
  * SDK, the API, the orchestrator and the host, both ways) is `sandbox.transit`.
12
12
  */
13
13
  import type { TurnSpan, TurnSpanAttrs, TurnTrace } from '../turn-trace/recorder';
14
- export interface PromptTrace {
15
- /** Read one raw sandbox event. Never throws. */
16
- observe(event: unknown): void;
17
- /** End the stream's spans. `error` marks the prompt failed. */
18
- end(error?: unknown): void;
14
+ export interface TraceSandboxPromptOptions {
15
+ trace: TurnTrace;
16
+ /** The span the prompt hangs from. Default: the trace's root. */
17
+ parent?: TurnSpan;
18
+ /** Attributes for the `sandbox.prompt` span: the sandbox id, the model, the harness. */
19
+ meta?: TurnSpanAttrs;
19
20
  }
20
- export declare function createPromptTrace(trace: TurnTrace, parent: TurnSpan | undefined, meta: TurnSpanAttrs): PromptTrace;
21
+ /**
22
+ * Pass a sandbox prompt stream through unchanged while recording it in the turn's trace (see {@link createPromptTrace}).
23
+ * `streamSandboxPrompt` does this itself when given a `trace`; a product that calls `box.streamPrompt` directly wraps
24
+ * its stream here, and sends `trace.traceId` as the prompt's `traceId` so the Sandbox API records join the turn.
25
+ */
26
+ export declare function traceSandboxPromptEvents(events: AsyncIterable<unknown>, options: TraceSandboxPromptOptions): AsyncGenerator<unknown>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tangle-network/agent-app",
3
- "version": "0.60.199",
3
+ "version": "0.60.200",
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": [