@astralbeam/sdk 0.16.0 → 0.17.0
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.
- package/README.md +4 -4
- package/dist/{api-DzeMhfHU.js → api-BaIPbj-Q.js} +66 -10
- package/dist/api.d.ts +2 -2
- package/dist/api.js +2 -2
- package/dist/client.js +1 -1
- package/dist/{core-D84VNYWJ.js → core-DeMY6_wQ.js} +1377 -103
- package/dist/core.d.ts +2 -2
- package/dist/core.js +1 -1
- package/dist/{index-CH3RVjha.d.ts → index-CfGnT6Od.d.ts} +129 -18
- package/dist/{index-CM3pzsKR.d.ts → index-NT05_Yw_.d.ts} +155 -58
- package/dist/listings-BH_hPkxx.js +1 -0
- package/dist/react.d.ts +2 -2
- package/dist/react.js +2 -2
- package/dist/rolldown-runtime-QTnfLwEv.js +1 -0
- package/dist/server.d.ts +6 -0
- package/dist/server.js +6 -2
- package/dist/styles.generated-D8sDOLu3.js +98 -0
- package/dist/widget-BdiuWvPf.js +24 -0
- package/package.json +6 -6
- package/dist/listings-dAoOEUGK.js +0 -1
- package/dist/rolldown-runtime-Bh1tDfsg.js +0 -1
- package/dist/styles.generated-Ucyw8D9G.js +0 -98
- package/dist/widget-h5LX5aq8.js +0 -11
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { H as CurrentUser, kt as UploadedChatFile } from "./index-CfGnT6Od.js";
|
|
2
2
|
|
|
3
3
|
//#region node_modules/.deno/@standard-schema+spec@1.1.0/node_modules/@standard-schema/spec/dist/index.d.ts
|
|
4
4
|
/** The Standard Typed interface. This is a base type extended by other specs. */
|
|
@@ -117,7 +117,7 @@ declare namespace StandardJSONSchemaV1 {
|
|
|
117
117
|
type InferOutput<Schema extends StandardTypedV1> = StandardTypedV1.InferOutput<Schema>;
|
|
118
118
|
}
|
|
119
119
|
//#endregion
|
|
120
|
-
//#region node_modules/.deno/@tanstack+ai@0.
|
|
120
|
+
//#region node_modules/.deno/@tanstack+ai@0.68.0/node_modules/@tanstack/ai/dist/esm/interrupts.d.ts
|
|
121
121
|
interface InterruptCorrelation {
|
|
122
122
|
threadId: string;
|
|
123
123
|
interruptedRunId: string;
|
|
@@ -198,7 +198,7 @@ declare global {
|
|
|
198
198
|
var __TANSTACK_EVENT_TARGET__: EventTarget | null;
|
|
199
199
|
}
|
|
200
200
|
//#endregion
|
|
201
|
-
//#region node_modules/.deno/@tanstack+ai-event-client@0.13.
|
|
201
|
+
//#region node_modules/.deno/@tanstack+ai-event-client@0.13.1/node_modules/@tanstack/ai-event-client/dist/esm/envelope.d.ts
|
|
202
202
|
type AIDevtoolsEventSource = 'client' | 'server' | 'devtools';
|
|
203
203
|
type AIDevtoolsEventVisibility = 'user-visible' | 'client-state' | 'server-internal' | 'devtools-action';
|
|
204
204
|
interface AIDevtoolsEventEnvelope {
|
|
@@ -224,7 +224,7 @@ declare global {
|
|
|
224
224
|
var __TANSTACK_AI_DEVTOOLS_RUNTIME_ID__: string | undefined;
|
|
225
225
|
}
|
|
226
226
|
//#endregion
|
|
227
|
-
//#region node_modules/.deno/@tanstack+ai-event-client@0.13.
|
|
227
|
+
//#region node_modules/.deno/@tanstack+ai-event-client@0.13.1/node_modules/@tanstack/ai-event-client/dist/esm/index.d.ts
|
|
228
228
|
/**
|
|
229
229
|
* Detailed breakdown of prompt/input token usage.
|
|
230
230
|
* Fields are populated based on provider support.
|
|
@@ -2838,11 +2838,11 @@ type SubagentInfo = {
|
|
|
2838
2838
|
* pick one.
|
|
2839
2839
|
*/
|
|
2840
2840
|
//#endregion
|
|
2841
|
-
//#region node_modules/.deno/@tanstack+ai@0.
|
|
2841
|
+
//#region node_modules/.deno/@tanstack+ai@0.68.0/node_modules/@tanstack/ai/dist/esm/utilities/ag-ui-usage.d.ts
|
|
2842
2842
|
/** TokenUsage fields that have no AG-UI `usage[]` equivalent. */
|
|
2843
2843
|
type TokenUsageLeftover = Omit<TokenUsage$1, 'promptTokens' | 'completionTokens' | 'totalTokens'>;
|
|
2844
2844
|
//#endregion
|
|
2845
|
-
//#region node_modules/.deno/@tanstack+ai@0.
|
|
2845
|
+
//#region node_modules/.deno/@tanstack+ai@0.68.0/node_modules/@tanstack/ai/dist/esm/types.d.ts
|
|
2846
2846
|
/**
|
|
2847
2847
|
* Tool call states - track the lifecycle of a tool call
|
|
2848
2848
|
*/
|
|
@@ -3082,6 +3082,14 @@ interface ThinkingPart$1 {
|
|
|
3082
3082
|
*/
|
|
3083
3083
|
redacted?: boolean;
|
|
3084
3084
|
}
|
|
3085
|
+
/**
|
|
3086
|
+
* Frontend-only AG-UI activity. Never converted into ModelMessage input.
|
|
3087
|
+
* Mirrors {@link https://docs.ag-ui.com/concepts/messages | ActivityMessage}:
|
|
3088
|
+
* `activityType` selects a renderer; `content` is the structured payload.
|
|
3089
|
+
*/
|
|
3090
|
+
interface ActivityPart extends Pick<ActivityMessage, 'activityType' | 'content' | 'subagentRunId'> {
|
|
3091
|
+
type: 'activity';
|
|
3092
|
+
}
|
|
3085
3093
|
/**
|
|
3086
3094
|
* Recursive `Partial` — every nested field becomes optional. Used as the
|
|
3087
3095
|
* `partial` type on a streaming structured-output part since the progressive
|
|
@@ -3096,14 +3104,21 @@ type DeepPartial<T> = T extends ReadonlyArray<infer U> ? Array<DeepPartial<U>> :
|
|
|
3096
3104
|
* consumers can thread `useChat({ outputSchema })`'s schema all the way down
|
|
3097
3105
|
* to `messages[i].parts[j].data`. Defaults to `unknown` so untyped consumers
|
|
3098
3106
|
* (e.g. internal codepaths that don't know about TSchema) keep working.
|
|
3099
|
-
|
|
3100
|
-
|
|
3107
|
+
*
|
|
3108
|
+
* Discriminated on `status`: checking `status === 'complete'` narrows `data`
|
|
3109
|
+
* to `TData`.
|
|
3110
|
+
*/
|
|
3111
|
+
type StructuredOutputPart<TData = unknown> = (StructuredOutputPartBase<TData> & {
|
|
3112
|
+
status: 'streaming' | 'error'; /** Not set until `status === 'complete'`. */
|
|
3113
|
+
data?: undefined;
|
|
3114
|
+
}) | (StructuredOutputPartBase<TData> & {
|
|
3115
|
+
status: 'complete'; /** Validated final object. */
|
|
3116
|
+
data: TData;
|
|
3117
|
+
});
|
|
3118
|
+
interface StructuredOutputPartBase<TData> {
|
|
3101
3119
|
type: 'structured-output';
|
|
3102
|
-
status: 'streaming' | 'complete' | 'error';
|
|
3103
3120
|
/** Progressive parse of `raw` via parsePartialJSON — populated while streaming and after complete. */
|
|
3104
3121
|
partial?: DeepPartial<TData>;
|
|
3105
|
-
/** Validated final object — only set when `status === 'complete'`. */
|
|
3106
|
-
data?: TData;
|
|
3107
3122
|
/** Accumulating JSON buffer. Source of truth for wire round-trip. */
|
|
3108
3123
|
raw: string;
|
|
3109
3124
|
/** Optional chain-of-thought surfaced by reasoning models alongside the structured output. */
|
|
@@ -3154,7 +3169,7 @@ interface UIResourcePart {
|
|
|
3154
3169
|
* Currently always `undefined` — nothing populates this field yet. */
|
|
3155
3170
|
meta?: Record<string, unknown>;
|
|
3156
3171
|
}
|
|
3157
|
-
type MessagePart$1<TData = unknown> = TextPart$1 | ImagePart | AudioPart | VideoPart | DocumentPart | ToolCallPart$2 | ToolResultPart$1 | ThinkingPart$1 | StructuredOutputPart<TData> | UIResourcePart | SubagentPart$1;
|
|
3172
|
+
type MessagePart$1<TData = unknown> = TextPart$1 | ImagePart | AudioPart | VideoPart | DocumentPart | ToolCallPart$2 | ToolResultPart$1 | ThinkingPart$1 | ActivityPart | StructuredOutputPart<TData> | UIResourcePart | SubagentPart$1;
|
|
3158
3173
|
/**
|
|
3159
3174
|
* Shape of `metadata.tanstack` on run events.
|
|
3160
3175
|
*/
|
|
@@ -3168,6 +3183,8 @@ interface TanStackRunMetadata {
|
|
|
3168
3183
|
runId?: string;
|
|
3169
3184
|
sessionId?: string;
|
|
3170
3185
|
index?: number;
|
|
3186
|
+
/** On a `RUN_ERROR`. See `RunErrorEvent.retryAfterMs`. */
|
|
3187
|
+
retryAfterMs?: number;
|
|
3171
3188
|
state?: ToolOutputState;
|
|
3172
3189
|
/** Parsed `TOOL_CALL_END` input. Spec `TOOL_CALL_END` has no top-level `input`. */
|
|
3173
3190
|
input?: unknown;
|
|
@@ -3181,7 +3198,7 @@ interface TanStackRunMetadata {
|
|
|
3181
3198
|
*/
|
|
3182
3199
|
interface UIMessage$1<TData = unknown> {
|
|
3183
3200
|
id: string;
|
|
3184
|
-
role: 'system' | 'user' | 'assistant';
|
|
3201
|
+
role: 'system' | 'user' | 'assistant' | 'activity';
|
|
3185
3202
|
parts: Array<MessagePart$1<TData>>;
|
|
3186
3203
|
createdAt?: Date;
|
|
3187
3204
|
/** Optional AG-UI sender name. Converters preserve it across wire and persist. */
|
|
@@ -3443,6 +3460,12 @@ interface RunErrorEvent extends Pick<RunErrorEvent$1, 'message' | 'code' | 'time
|
|
|
3443
3460
|
message: string;
|
|
3444
3461
|
code?: string;
|
|
3445
3462
|
};
|
|
3463
|
+
/**
|
|
3464
|
+
* How long the provider asks you to wait before a retry, in milliseconds.
|
|
3465
|
+
* Adapters read it from the `retry-after-ms` or `retry-after` header.
|
|
3466
|
+
* `chat()` moves it to `metadata.tanstack.retryAfterMs`.
|
|
3467
|
+
*/
|
|
3468
|
+
retryAfterMs?: number;
|
|
3446
3469
|
metadata?: {
|
|
3447
3470
|
tanstack?: TanStackRunMetadata;
|
|
3448
3471
|
} & Record<string, any>;
|
|
@@ -3582,10 +3605,24 @@ interface ReasoningEndEvent extends ReasoningEndEvent$1 {}
|
|
|
3582
3605
|
* @ag-ui/core provides: `subtype`, `entityId`, `encryptedValue`
|
|
3583
3606
|
*/
|
|
3584
3607
|
interface ReasoningEncryptedValueEvent extends ReasoningEncryptedValueEvent$1 {}
|
|
3585
|
-
/**
|
|
3586
|
-
|
|
3587
|
-
|
|
3588
|
-
|
|
3608
|
+
/**
|
|
3609
|
+
* Full activity state for an `ActivityMessage`.
|
|
3610
|
+
*
|
|
3611
|
+
* @ag-ui/core provides: `messageId`, `activityType`, `content`, `replace?`,
|
|
3612
|
+
* `metadata?`, `subagentRunId?`. When `replace` is omitted it means `true`.
|
|
3613
|
+
*/
|
|
3614
|
+
interface ActivitySnapshotEvent extends Omit<ActivitySnapshotEvent$1, 'type'> {
|
|
3615
|
+
type: 'ACTIVITY_SNAPSHOT';
|
|
3616
|
+
}
|
|
3617
|
+
/**
|
|
3618
|
+
* RFC 6902 JSON Patch against an existing activity's `content`.
|
|
3619
|
+
*
|
|
3620
|
+
* @ag-ui/core provides: `messageId`, `activityType`, `patch`, `metadata?`,
|
|
3621
|
+
* `subagentRunId?`
|
|
3622
|
+
*/
|
|
3623
|
+
interface ActivityDeltaEvent extends Omit<ActivityDeltaEvent$1, 'type'> {
|
|
3624
|
+
type: 'ACTIVITY_DELTA';
|
|
3625
|
+
}
|
|
3589
3626
|
/** AG-UI 1.0 RawEvent shape. */
|
|
3590
3627
|
interface RawEvent extends RawEvent$1 {}
|
|
3591
3628
|
/** AG-UI 1.0 TextMessageChunkEvent shape. */
|
|
@@ -3624,7 +3661,7 @@ interface SubagentErrorEvent extends SubagentErrorEvent$1 {}
|
|
|
3624
3661
|
*/
|
|
3625
3662
|
type StreamChunk = AGUIEvent;
|
|
3626
3663
|
//#endregion
|
|
3627
|
-
//#region node_modules/.deno/@tanstack+ai@0.
|
|
3664
|
+
//#region node_modules/.deno/@tanstack+ai@0.68.0/node_modules/@tanstack/ai/dist/esm/interrupt-definition.d.ts
|
|
3628
3665
|
type PortableSchema = StandardJSONSchemaV1<any, any> | StandardSchemaV1$1<any, any>;
|
|
3629
3666
|
type InterruptInput<TPayloadSchema extends PortableSchema | undefined, TPayload = unknown> = {
|
|
3630
3667
|
key: string;
|
|
@@ -3666,7 +3703,7 @@ interface InterruptDefinition<TId extends string, TPayloadSchema extends Portabl
|
|
|
3666
3703
|
interrupt: InterruptRequestMethod<TId, TPayloadSchema, TResponseSchema, TPayload, TPayloadInput>;
|
|
3667
3704
|
}
|
|
3668
3705
|
//#endregion
|
|
3669
|
-
//#region node_modules/.deno/@tanstack+ai@0.
|
|
3706
|
+
//#region node_modules/.deno/@tanstack+ai@0.68.0/node_modules/@tanstack/ai/dist/esm/activities/chat/tools/tool-definition.d.ts
|
|
3670
3707
|
/**
|
|
3671
3708
|
* Type-level brand key for {@link ToolApprovalCapabilityMarker}. Only ever used
|
|
3672
3709
|
* in type positions, but it must stay exported: a `unique symbol` referenced by
|
|
@@ -3747,52 +3784,52 @@ type InferToolOutput<T> = T extends {
|
|
|
3747
3784
|
outputSchema?: infer TOutput;
|
|
3748
3785
|
} ? TOutput extends StandardJSONSchemaV1<any, any> ? InferSchemaType<TOutput> : TOutput extends StandardSchemaV1$1<any, any> ? InferSchemaType<TOutput> : TOutput extends JSONSchema ? unknown : InferSchemaType<TOutput> : unknown;
|
|
3749
3786
|
//#endregion
|
|
3750
|
-
//#region node_modules/.deno/@tanstack+ai@0.
|
|
3787
|
+
//#region node_modules/.deno/@tanstack+ai@0.68.0/node_modules/@tanstack/ai/dist/esm/byok/define-provider.d.ts
|
|
3751
3788
|
/**
|
|
3752
|
-
*
|
|
3789
|
+
* A BYOK provider declared by an adapter. `id` is the `x-byok-<id>` slug and
|
|
3790
|
+
* is required — `{ id?: string }` is not a {@link ByokProvider}.
|
|
3753
3791
|
*/
|
|
3754
|
-
interface
|
|
3792
|
+
interface ByokProvider<TId extends string = string> {
|
|
3793
|
+
readonly id: TId;
|
|
3794
|
+
readonly label: string;
|
|
3755
3795
|
/**
|
|
3756
|
-
*
|
|
3757
|
-
*
|
|
3758
|
-
* @param accumulated - All text accumulated so far
|
|
3759
|
-
* @returns true if an update should be emitted now
|
|
3796
|
+
* Env var names the relay may read. Names only — never put `process.env`
|
|
3797
|
+
* values here. This object is imported on the client.
|
|
3760
3798
|
*/
|
|
3761
|
-
|
|
3799
|
+
readonly env?: ReadonlyArray<string>;
|
|
3762
3800
|
/**
|
|
3763
|
-
*
|
|
3801
|
+
* Other descriptors this credential needs. A send for this provider also
|
|
3802
|
+
* carries their headers and prompts for each one that is missing.
|
|
3764
3803
|
*/
|
|
3765
|
-
|
|
3804
|
+
readonly with?: ReadonlyArray<ByokProvider>;
|
|
3766
3805
|
}
|
|
3767
3806
|
//#endregion
|
|
3768
|
-
//#region node_modules/.deno/@tanstack+ai@0.
|
|
3807
|
+
//#region node_modules/.deno/@tanstack+ai@0.68.0/node_modules/@tanstack/ai/dist/esm/byok/providers.d.ts
|
|
3769
3808
|
/**
|
|
3770
3809
|
* Provider ids are open slugs, not a closed catalog. `@tanstack/ai` does not
|
|
3771
3810
|
* list adapters. Any matching string is a valid id and becomes `x-byok-<id>`.
|
|
3772
3811
|
*/
|
|
3773
3812
|
type ProviderId = string;
|
|
3774
3813
|
//#endregion
|
|
3775
|
-
//#region node_modules/.deno/@tanstack+ai@0.
|
|
3814
|
+
//#region node_modules/.deno/@tanstack+ai@0.68.0/node_modules/@tanstack/ai/dist/esm/activities/chat/stream/types.d.ts
|
|
3776
3815
|
/**
|
|
3777
|
-
*
|
|
3778
|
-
* is required — `{ id?: string }` is not a {@link ByokProvider}.
|
|
3816
|
+
* Strategy for determining when to emit text updates
|
|
3779
3817
|
*/
|
|
3780
|
-
interface
|
|
3781
|
-
readonly id: TId;
|
|
3782
|
-
readonly label: string;
|
|
3818
|
+
interface ChunkStrategy {
|
|
3783
3819
|
/**
|
|
3784
|
-
*
|
|
3785
|
-
*
|
|
3820
|
+
* Called for each text chunk received
|
|
3821
|
+
* @param chunk - The new chunk of text (delta)
|
|
3822
|
+
* @param accumulated - All text accumulated so far
|
|
3823
|
+
* @returns true if an update should be emitted now
|
|
3786
3824
|
*/
|
|
3787
|
-
|
|
3825
|
+
shouldEmit: (chunk: string, accumulated: string) => boolean;
|
|
3788
3826
|
/**
|
|
3789
|
-
*
|
|
3790
|
-
* carries their headers and prompts for each one that is missing.
|
|
3827
|
+
* Optional: Reset strategy state (called when streaming starts)
|
|
3791
3828
|
*/
|
|
3792
|
-
|
|
3829
|
+
reset?: () => void;
|
|
3793
3830
|
}
|
|
3794
3831
|
//#endregion
|
|
3795
|
-
//#region node_modules/.deno/@tanstack+ai-client@0.
|
|
3832
|
+
//#region node_modules/.deno/@tanstack+ai-client@0.39.2/node_modules/@tanstack/ai-client/dist/esm/byok/storage.d.ts
|
|
3796
3833
|
type Keyring = Partial<Record<ProviderId, string>>;
|
|
3797
3834
|
type KeyPreview = Partial<Record<ProviderId, string>>;
|
|
3798
3835
|
interface KeyringStorage {
|
|
@@ -3807,7 +3844,7 @@ interface KeyringStorage {
|
|
|
3807
3844
|
clear: () => void | Promise<void>;
|
|
3808
3845
|
}
|
|
3809
3846
|
//#endregion
|
|
3810
|
-
//#region node_modules/.deno/@tanstack+ai-client@0.
|
|
3847
|
+
//#region node_modules/.deno/@tanstack+ai-client@0.39.2/node_modules/@tanstack/ai-client/dist/esm/byok/client.d.ts
|
|
3811
3848
|
type KeyStatus = {
|
|
3812
3849
|
state: 'empty';
|
|
3813
3850
|
} | {
|
|
@@ -3862,7 +3899,7 @@ declare class ByokClient {
|
|
|
3862
3899
|
unlock(): Promise<void>;
|
|
3863
3900
|
}
|
|
3864
3901
|
//#endregion
|
|
3865
|
-
//#region node_modules/.deno/@tanstack+ai-client@0.
|
|
3902
|
+
//#region node_modules/.deno/@tanstack+ai-client@0.39.2/node_modules/@tanstack/ai-client/dist/esm/events.d.ts
|
|
3866
3903
|
interface ChatClientRunEventContext {
|
|
3867
3904
|
threadId: string;
|
|
3868
3905
|
runId: string;
|
|
@@ -3882,7 +3919,7 @@ interface ChatClientToolFixtureAppliedEvent {
|
|
|
3882
3919
|
execute?: boolean;
|
|
3883
3920
|
message?: {
|
|
3884
3921
|
id: string;
|
|
3885
|
-
role: '
|
|
3922
|
+
role: UIMessage['role'];
|
|
3886
3923
|
parts: Array<unknown>;
|
|
3887
3924
|
createdAt?: number | string;
|
|
3888
3925
|
};
|
|
@@ -3982,7 +4019,7 @@ declare abstract class ChatClientEventEmitter {
|
|
|
3982
4019
|
toolFixtureApplied(fixture: ChatClientToolFixtureAppliedEvent): void;
|
|
3983
4020
|
}
|
|
3984
4021
|
//#endregion
|
|
3985
|
-
//#region node_modules/.deno/@tanstack+ai-client@0.
|
|
4022
|
+
//#region node_modules/.deno/@tanstack+ai-client@0.39.2/node_modules/@tanstack/ai-client/dist/esm/devtools.d.ts
|
|
3986
4023
|
interface AIDevtoolsDisplayOptions {
|
|
3987
4024
|
name?: string;
|
|
3988
4025
|
}
|
|
@@ -4150,10 +4187,10 @@ declare class ChatDevtoolsBridge extends ClientDevtoolsBridge<AIDevtoolsChatSnap
|
|
|
4150
4187
|
private findClientTool;
|
|
4151
4188
|
}
|
|
4152
4189
|
//#endregion
|
|
4153
|
-
//#region node_modules/.deno/@tanstack+ai-client@0.
|
|
4190
|
+
//#region node_modules/.deno/@tanstack+ai-client@0.39.2/node_modules/@tanstack/ai-client/dist/esm/devtools-noop.d.ts
|
|
4154
4191
|
type ChatDevtoolsBridgeFactory = (options: ChatDevtoolsBridgeOptions) => ChatDevtoolsBridge;
|
|
4155
4192
|
//#endregion
|
|
4156
|
-
//#region node_modules/.deno/@tanstack+ai-client@0.
|
|
4193
|
+
//#region node_modules/.deno/@tanstack+ai-client@0.39.2/node_modules/@tanstack/ai-client/dist/esm/types.d.ts
|
|
4157
4194
|
interface ChatResumeState {
|
|
4158
4195
|
threadId: string;
|
|
4159
4196
|
runId: string;
|
|
@@ -4625,7 +4662,7 @@ type SubagentPartOf<TAgents extends ReadonlyArray<SubagentClientAgent> | undefin
|
|
|
4625
4662
|
};
|
|
4626
4663
|
type MessagePart<TTools extends ReadonlyArray<{
|
|
4627
4664
|
name: string;
|
|
4628
|
-
}> = any, TData = unknown, TSubagents extends ReadonlyArray<SubagentClientAgent> | undefined = undefined> = TextPart | ImagePart | AudioPart | VideoPart | DocumentPart | ToolCallPart$1<TTools> | ToolResultPart | ThinkingPart | StructuredOutputPart<TData> | UIResourcePart | SubagentPartOf<TSubagents>;
|
|
4665
|
+
}> = any, TData = unknown, TSubagents extends ReadonlyArray<SubagentClientAgent> | undefined = undefined> = TextPart | ImagePart | AudioPart | VideoPart | DocumentPart | ToolCallPart$1<TTools> | ToolResultPart | ThinkingPart | ActivityPart | StructuredOutputPart<TData> | UIResourcePart | SubagentPartOf<TSubagents>;
|
|
4629
4666
|
/**
|
|
4630
4667
|
* UIMessage - Domain-specific message format optimized for building chat UIs
|
|
4631
4668
|
* Contains parts that can be text, tool calls, or tool results.
|
|
@@ -4642,7 +4679,7 @@ interface UIMessage<TTools extends ReadonlyArray<{
|
|
|
4642
4679
|
name: string;
|
|
4643
4680
|
}> = any, TData = unknown, TSubagents extends ReadonlyArray<SubagentClientAgent> | undefined = undefined> {
|
|
4644
4681
|
id: string;
|
|
4645
|
-
role: 'system' | 'user' | 'assistant';
|
|
4682
|
+
role: 'system' | 'user' | 'assistant' | 'activity';
|
|
4646
4683
|
name?: string;
|
|
4647
4684
|
parts: Array<MessagePart<TTools, TData, TSubagents>>;
|
|
4648
4685
|
createdAt?: Date;
|
|
@@ -4843,6 +4880,12 @@ interface ChatClientBaseOptions<TTools extends ReadonlyArray<AnyClientTool> = an
|
|
|
4843
4880
|
* activity visible to all subscribers (e.g. across tabs/devices).
|
|
4844
4881
|
*/
|
|
4845
4882
|
onSessionGeneratingChange?: (isGenerating: boolean) => void;
|
|
4883
|
+
/**
|
|
4884
|
+
* Callback when the client starts or stops rebuilding the chat from
|
|
4885
|
+
* persistence (the server hydrate, or an async storage adapter). It turns
|
|
4886
|
+
* false once the transcript is applied and any in-flight run is re-joined.
|
|
4887
|
+
*/
|
|
4888
|
+
onHydratingChange?: (isHydrating: boolean) => void;
|
|
4846
4889
|
/**
|
|
4847
4890
|
* Policy for messages sent while the client is busy (streaming, claiming
|
|
4848
4891
|
* a send, or draining the queue). Accepts a `WhenBusy` string, a
|
|
@@ -4924,7 +4967,7 @@ interface ChatClientBaseOptions<TTools extends ReadonlyArray<AnyClientTool> = an
|
|
|
4924
4967
|
*/
|
|
4925
4968
|
type ChatClientOptions<TTools extends ReadonlyArray<AnyClientTool> = any, TContext = InferredClientContext<TTools>, TInterrupts extends ReadonlyArray<InterruptDefinition<any, any, any, any>> = readonly []> = DistributedOmit<ChatClientBaseOptions<TTools, TContext, TInterrupts>, 'context'> & ClientContextOptionFromTools<TTools, TContext> & ChatTransport & ChatPersistenceOptions<TTools>;
|
|
4926
4969
|
//#endregion
|
|
4927
|
-
//#region node_modules/.deno/@tanstack+ai-client@0.
|
|
4970
|
+
//#region node_modules/.deno/@tanstack+ai-client@0.39.2/node_modules/@tanstack/ai-client/dist/esm/connection-adapters.d.ts
|
|
4928
4971
|
/**
|
|
4929
4972
|
* Per-send context provided by the chat client to the connection adapter.
|
|
4930
4973
|
* The adapter combines this with serialized messages to build a full
|
|
@@ -5087,7 +5130,7 @@ interface SubscribeConnectionAdapter {
|
|
|
5087
5130
|
*/
|
|
5088
5131
|
type ConnectionAdapter = ConnectConnectionAdapter | SubscribeConnectionAdapter;
|
|
5089
5132
|
//#endregion
|
|
5090
|
-
//#region node_modules/.deno/@tanstack+ai-client@0.
|
|
5133
|
+
//#region node_modules/.deno/@tanstack+ai-client@0.39.2/node_modules/@tanstack/ai-client/dist/esm/chat-client.d.ts
|
|
5091
5134
|
type ChatClientUpdateOptionsWithoutContext<TTools extends ReadonlyArray<AnyClientTool>, TInterrupts extends ReadonlyArray<InterruptDefinition<any, any, any, any>> = readonly []> = {
|
|
5092
5135
|
connection?: ConnectionAdapter;
|
|
5093
5136
|
fetcher?: ChatFetcher; /** @deprecated Use `forwardedProps` instead. */
|
|
@@ -5105,6 +5148,7 @@ type ChatClientUpdateOptionsWithoutContext<TTools extends ReadonlyArray<AnyClien
|
|
|
5105
5148
|
onSubscriptionChange?: (isSubscribed: boolean) => void;
|
|
5106
5149
|
onConnectionStatusChange?: (status: ConnectionStatus) => void;
|
|
5107
5150
|
onSessionGeneratingChange?: (isGenerating: boolean) => void;
|
|
5151
|
+
onHydratingChange?: (isHydrating: boolean) => void;
|
|
5108
5152
|
onQueueChange?: (queue: Array<QueuedMessage>) => void;
|
|
5109
5153
|
onResumeStateChange?: (resumeState: ChatResumeState | null, pendingInterrupts: BoundInterrupts<TTools, TInterrupts>) => void;
|
|
5110
5154
|
/**
|
|
@@ -5199,6 +5243,7 @@ declare class ChatClient<TTools extends ReadonlyArray<AnyClientTool> = any, TCon
|
|
|
5199
5243
|
private currentMessageId;
|
|
5200
5244
|
private readonly postStreamActions;
|
|
5201
5245
|
private readonly pendingToolExecutions;
|
|
5246
|
+
private handingOverPendingToolCalls;
|
|
5202
5247
|
private activeClientTools;
|
|
5203
5248
|
private activeContext;
|
|
5204
5249
|
private continuationPending;
|
|
@@ -5224,6 +5269,12 @@ declare class ChatClient<TTools extends ReadonlyArray<AnyClientTool> = any, TCon
|
|
|
5224
5269
|
private hydrationError;
|
|
5225
5270
|
/** Whether a view is currently watching. See `attach` / `detach`. */
|
|
5226
5271
|
private tailing;
|
|
5272
|
+
/** `historyGeneration` of the mount hydration GET still in flight, if any. */
|
|
5273
|
+
private hydrationInFlight;
|
|
5274
|
+
/** An async storage adapter is still reading the persisted transcript. */
|
|
5275
|
+
private storeHydrating;
|
|
5276
|
+
/** See {@link getIsHydrating}. */
|
|
5277
|
+
private isHydrating;
|
|
5227
5278
|
/** Constructor inputs `attach()` needs on every re-attach, not just the first. */
|
|
5228
5279
|
private readonly rejoinRunId;
|
|
5229
5280
|
private readonly cachesMessages;
|
|
@@ -5363,9 +5414,16 @@ declare class ChatClient<TTools extends ReadonlyArray<AnyClientTool> = any, TCon
|
|
|
5363
5414
|
private interruptGeneration;
|
|
5364
5415
|
private generateUniqueId;
|
|
5365
5416
|
private setIsLoading;
|
|
5417
|
+
/**
|
|
5418
|
+
* A send or a clear now owns the transcript. A load that is still pending can
|
|
5419
|
+
* no longer paint it (the generation guards drop its result), so it no longer
|
|
5420
|
+
* counts as hydrating.
|
|
5421
|
+
*/
|
|
5422
|
+
private supersedeHydration;
|
|
5366
5423
|
private setStatus;
|
|
5367
5424
|
private setIsSubscribed;
|
|
5368
5425
|
private setConnectionStatus;
|
|
5426
|
+
private syncIsHydrating;
|
|
5369
5427
|
private setSessionGenerating;
|
|
5370
5428
|
private notifyResumeStateChange;
|
|
5371
5429
|
/**
|
|
@@ -5662,6 +5720,13 @@ declare class ChatClient<TTools extends ReadonlyArray<AnyClientTool> = any, TCon
|
|
|
5662
5720
|
* activity visible to all subscribers (e.g. across tabs/devices).
|
|
5663
5721
|
*/
|
|
5664
5722
|
getSessionGenerating(): boolean;
|
|
5723
|
+
/**
|
|
5724
|
+
* Whether the client is rebuilding the chat from persistence: the server
|
|
5725
|
+
* hydrate (`persistence: true`) or an async storage adapter. Turns false once
|
|
5726
|
+
* the transcript is applied and any in-flight run is re-joined (from then on
|
|
5727
|
+
* `isLoading` covers the stream), or when the load fails.
|
|
5728
|
+
*/
|
|
5729
|
+
getIsHydrating(): boolean;
|
|
5665
5730
|
/**
|
|
5666
5731
|
* Get current error
|
|
5667
5732
|
*/
|
|
@@ -5944,15 +6009,14 @@ interface SandboxCommandRun {
|
|
|
5944
6009
|
truncated: boolean;
|
|
5945
6010
|
finished: boolean;
|
|
5946
6011
|
}
|
|
5947
|
-
/** One file the agent published for the user, with
|
|
6012
|
+
/** One file the agent published for the user, with its durable stored reference. */
|
|
5948
6013
|
interface SandboxArtifact {
|
|
5949
6014
|
toolCallId: string;
|
|
5950
6015
|
path: string;
|
|
5951
6016
|
label: string;
|
|
5952
6017
|
mimeType: string | undefined;
|
|
5953
6018
|
size: number | undefined;
|
|
5954
|
-
|
|
5955
|
-
ticket: string | undefined;
|
|
6019
|
+
fileId: string | undefined;
|
|
5956
6020
|
published: boolean;
|
|
5957
6021
|
}
|
|
5958
6022
|
/** Everything the sandbox did in this conversation, derived from the transcript. */
|
|
@@ -6240,6 +6304,11 @@ interface AstralBeamChatState {
|
|
|
6240
6304
|
/** The tool set currently declared to the agent, in declaration order. */
|
|
6241
6305
|
agentTools: readonly AgentToolInfo[];
|
|
6242
6306
|
sandboxStatus: SandboxStatus | undefined;
|
|
6307
|
+
/** The usage limit that ended the last run, by display name, until another run starts. */
|
|
6308
|
+
usageLimitReached: {
|
|
6309
|
+
name: string;
|
|
6310
|
+
resetsAt: string;
|
|
6311
|
+
} | undefined;
|
|
6243
6312
|
sandbox: SandboxActivity;
|
|
6244
6313
|
thread: ChatThread | undefined;
|
|
6245
6314
|
threadLoading: boolean;
|
|
@@ -6287,6 +6356,12 @@ interface AstralBeamChatCore {
|
|
|
6287
6356
|
refreshThread: () => Promise<void>;
|
|
6288
6357
|
loadOlderMessages: () => Promise<void>;
|
|
6289
6358
|
abandonToolCall: (toolCallId: string) => Promise<void>;
|
|
6359
|
+
uploadAttachment: (file: {
|
|
6360
|
+
data: string | Promise<string>;
|
|
6361
|
+
filename: string;
|
|
6362
|
+
mimeType: string;
|
|
6363
|
+
}) => Promise<UploadedChatFile>;
|
|
6364
|
+
getFile: (fileId: string) => Promise<Blob>;
|
|
6290
6365
|
getAttachment: (messageId: string, partId: string) => Promise<Blob>;
|
|
6291
6366
|
/** Tears the session down: the connection, authentication, and widget renders. */
|
|
6292
6367
|
dispose: () => void;
|
|
@@ -6321,7 +6396,7 @@ declare function isSandboxTool(name: string): boolean;
|
|
|
6321
6396
|
declare function sandboxRefusal(part: ToolCallPart): string | undefined;
|
|
6322
6397
|
/** A `sandbox_write_file` call, readable while its content is still streaming in. */
|
|
6323
6398
|
declare function readSandboxFileWrite(part: ToolCallPart): SandboxFileWrite | undefined;
|
|
6324
|
-
/** A `sandbox_publish_artifact` call whose output carries
|
|
6399
|
+
/** A `sandbox_publish_artifact` call whose output carries a durable file reference. */
|
|
6325
6400
|
declare function readSandboxArtifact(part: ToolCallPart): SandboxArtifact | undefined;
|
|
6326
6401
|
/** A `sandbox_run_command` call. `stdout` holds combined output on providers with no stderr. */
|
|
6327
6402
|
declare function readSandboxCommandRun(part: ToolCallPart): SandboxCommandRun | undefined;
|
|
@@ -6354,4 +6429,26 @@ interface TypedToolDefinition<S extends ParametersSchema = JsonSchemaObject> {
|
|
|
6354
6429
|
/** Declares a host tool; a Standard Schema `parameters` types (and validates) `execute`'s input. */
|
|
6355
6430
|
declare function defineTool<const S extends ParametersSchema = JsonSchemaObject>(tool: TypedToolDefinition<S>): ToolDefinition;
|
|
6356
6431
|
//#endregion
|
|
6357
|
-
|
|
6432
|
+
//#region src/core/web.d.ts
|
|
6433
|
+
interface WebSource {
|
|
6434
|
+
url: string;
|
|
6435
|
+
title: string;
|
|
6436
|
+
excerpt?: string;
|
|
6437
|
+
}
|
|
6438
|
+
interface WebCitation extends WebSource {
|
|
6439
|
+
/** UTF-16 offsets into the text part. The link follows endIndex. */
|
|
6440
|
+
startIndex: number;
|
|
6441
|
+
endIndex: number;
|
|
6442
|
+
/** Response-wide citation number. */
|
|
6443
|
+
number: number;
|
|
6444
|
+
}
|
|
6445
|
+
interface WebEvidence {
|
|
6446
|
+
sources: WebSource[];
|
|
6447
|
+
citations: WebCitation[];
|
|
6448
|
+
}
|
|
6449
|
+
interface WebPartMetadata {
|
|
6450
|
+
providerExecuted?: boolean;
|
|
6451
|
+
web?: WebEvidence;
|
|
6452
|
+
}
|
|
6453
|
+
//#endregion
|
|
6454
|
+
export { WidgetRenderRequest as A, SandboxCommandRun as B, lastPartInProgress as C, AstralBeamChatState as D, AstralBeamChatCoreOptions as E, WidgetDeclaration as F, AstralBeamTokenSource as G, SandboxStatus as H, buildAgentTools as I, ParametersSchema as J, InferParameters as K, RenderWidgetInput as L, ChatPendingInteraction as M, ChatThread as N, ChatStreamCallbacks as O, ChatAuthenticationState as P, SandboxActivity as R, isSettledToolCall as S, AstralBeamChatCore as T, AstralBeamChatColorScheme as U, SandboxFileWrite as V, AstralBeamChatTheme as W, ToolDefinition as X, StandardSchemaV1 as Y, readSandboxArtifact as _, defineTool as a, sandboxRefusal as b, SANDBOX_LIST_FILES_TOOL as c, SANDBOX_RUN_COMMAND_TOOL as d, SANDBOX_STATUS_EVENT as f, isSandboxTool as g, describeSandboxCommandRun as h, WebSource as i, createAstralBeamChat as j, ChatSubmissionCallbacks as k, SANDBOX_PUBLISH_ARTIFACT_TOOL as l, collectSandboxActivity as m, WebEvidence as n, ASK_QUESTIONNAIRE_TOOL as o, SANDBOX_WRITE_FILE_TOOL as p, JsonSchemaObject as q, WebPartMetadata as r, RENDER_WIDGET_TOOL as s, WebCitation as t, SANDBOX_READ_FILE_TOOL as u, readSandboxCommandRun as v, AgentToolInfo as w, hasPendingToolRun as x, readSandboxFileWrite as y, SandboxArtifact as z };
|