@astralbeam/sdk 0.15.1 → 0.16.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 +36 -28
- package/dist/api-DzeMhfHU.js +653 -0
- package/dist/api.d.ts +2 -2
- package/dist/api.js +2 -2
- package/dist/client.d.ts +22 -8
- package/dist/client.js +1 -1
- package/dist/constants-enyqxaJi.js +1 -0
- package/dist/{core-CQcf1z-y.js → core-D84VNYWJ.js} +947 -148
- package/dist/core.d.ts +2 -2
- package/dist/core.js +1 -1
- package/dist/index-CH3RVjha.d.ts +827 -0
- package/dist/{index-BlOXkzYq.d.ts → index-CM3pzsKR.d.ts} +109 -30
- package/dist/listings-dAoOEUGK.js +1 -0
- package/dist/react.d.ts +14 -6
- package/dist/react.js +22 -7
- package/dist/rolldown-runtime-Bh1tDfsg.js +1 -0
- package/dist/styles.generated-Ucyw8D9G.js +98 -0
- package/dist/widget-h5LX5aq8.js +11 -0
- package/package.json +3 -3
- package/dist/api-DUe8JSVU.d.ts +0 -372
- package/dist/api-UjE4fiRE.js +0 -323
- package/dist/constants-CgaMxV3q.js +0 -1
- package/dist/index-BVVgDSdq.d.ts +0 -1
- package/dist/listings-DwwJb5gg.js +0 -21
- package/dist/styles.generated-BzTr7xye.js +0 -60
- package/dist/widget-iQVURAPe.js +0 -26
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { F as CurrentUser } from "./index-CH3RVjha.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.64.0/node_modules/@tanstack/ai/dist/esm/interrupts.d.ts
|
|
121
121
|
interface InterruptCorrelation {
|
|
122
122
|
threadId: string;
|
|
123
123
|
interruptedRunId: string;
|
|
@@ -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.64.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.64.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
|
*/
|
|
@@ -2978,9 +2978,15 @@ interface ModelMessage<TContent extends string | null | Array<ContentPart> = str
|
|
|
2978
2978
|
name?: string;
|
|
2979
2979
|
toolCalls?: Array<ToolCall>;
|
|
2980
2980
|
toolCallId?: string;
|
|
2981
|
+
/**
|
|
2982
|
+
* Signed thinking to send back to the provider. `redacted: true` marks a
|
|
2983
|
+
* block the provider encrypted: `content` is empty and `signature` holds its
|
|
2984
|
+
* opaque data. See `ThinkingPart.signature` for the planned rename.
|
|
2985
|
+
*/
|
|
2981
2986
|
thinking?: Array<{
|
|
2982
2987
|
content: string;
|
|
2983
2988
|
signature?: string;
|
|
2989
|
+
redacted?: boolean;
|
|
2984
2990
|
}>;
|
|
2985
2991
|
/** Error reported by an AG-UI tool message. */
|
|
2986
2992
|
error?: string;
|
|
@@ -3061,7 +3067,20 @@ interface ThinkingPart$1 {
|
|
|
3061
3067
|
type: 'thinking';
|
|
3062
3068
|
content: string;
|
|
3063
3069
|
stepId?: string;
|
|
3070
|
+
/**
|
|
3071
|
+
* The provider's opaque reasoning artefact, sent back unchanged: an
|
|
3072
|
+
* Anthropic signature, Anthropic redacted data, or OpenAI encrypted content.
|
|
3073
|
+
* TODO(#1581): rename to `encryptedValue` to match AG-UI's `ReasoningMessage`.
|
|
3074
|
+
* Renaming breaks stored messages, so it needs a read shim for `signature`.
|
|
3075
|
+
*/
|
|
3064
3076
|
signature?: string;
|
|
3077
|
+
/**
|
|
3078
|
+
* The provider encrypted this thinking block (Anthropic `redacted_thinking`).
|
|
3079
|
+
* `content` is empty, and `signature` holds the opaque data that goes back
|
|
3080
|
+
* to the provider unchanged. On the AG-UI wire, the reasoning message id
|
|
3081
|
+
* starts with `redacted_thinking-` instead.
|
|
3082
|
+
*/
|
|
3083
|
+
redacted?: boolean;
|
|
3065
3084
|
}
|
|
3066
3085
|
/**
|
|
3067
3086
|
* Recursive `Partial` — every nested field becomes optional. Used as the
|
|
@@ -3605,7 +3624,7 @@ interface SubagentErrorEvent extends SubagentErrorEvent$1 {}
|
|
|
3605
3624
|
*/
|
|
3606
3625
|
type StreamChunk = AGUIEvent;
|
|
3607
3626
|
//#endregion
|
|
3608
|
-
//#region node_modules/.deno/@tanstack+ai@0.
|
|
3627
|
+
//#region node_modules/.deno/@tanstack+ai@0.64.0/node_modules/@tanstack/ai/dist/esm/interrupt-definition.d.ts
|
|
3609
3628
|
type PortableSchema = StandardJSONSchemaV1<any, any> | StandardSchemaV1$1<any, any>;
|
|
3610
3629
|
type InterruptInput<TPayloadSchema extends PortableSchema | undefined, TPayload = unknown> = {
|
|
3611
3630
|
key: string;
|
|
@@ -3647,7 +3666,7 @@ interface InterruptDefinition<TId extends string, TPayloadSchema extends Portabl
|
|
|
3647
3666
|
interrupt: InterruptRequestMethod<TId, TPayloadSchema, TResponseSchema, TPayload, TPayloadInput>;
|
|
3648
3667
|
}
|
|
3649
3668
|
//#endregion
|
|
3650
|
-
//#region node_modules/.deno/@tanstack+ai@0.
|
|
3669
|
+
//#region node_modules/.deno/@tanstack+ai@0.64.0/node_modules/@tanstack/ai/dist/esm/activities/chat/tools/tool-definition.d.ts
|
|
3651
3670
|
/**
|
|
3652
3671
|
* Type-level brand key for {@link ToolApprovalCapabilityMarker}. Only ever used
|
|
3653
3672
|
* in type positions, but it must stay exported: a `unique symbol` referenced by
|
|
@@ -3728,7 +3747,7 @@ type InferToolOutput<T> = T extends {
|
|
|
3728
3747
|
outputSchema?: infer TOutput;
|
|
3729
3748
|
} ? TOutput extends StandardJSONSchemaV1<any, any> ? InferSchemaType<TOutput> : TOutput extends StandardSchemaV1$1<any, any> ? InferSchemaType<TOutput> : TOutput extends JSONSchema ? unknown : InferSchemaType<TOutput> : unknown;
|
|
3730
3749
|
//#endregion
|
|
3731
|
-
//#region node_modules/.deno/@tanstack+ai@0.
|
|
3750
|
+
//#region node_modules/.deno/@tanstack+ai@0.64.0/node_modules/@tanstack/ai/dist/esm/activities/chat/stream/types.d.ts
|
|
3732
3751
|
/**
|
|
3733
3752
|
* Strategy for determining when to emit text updates
|
|
3734
3753
|
*/
|
|
@@ -3746,14 +3765,14 @@ interface ChunkStrategy {
|
|
|
3746
3765
|
reset?: () => void;
|
|
3747
3766
|
}
|
|
3748
3767
|
//#endregion
|
|
3749
|
-
//#region node_modules/.deno/@tanstack+ai@0.
|
|
3768
|
+
//#region node_modules/.deno/@tanstack+ai@0.64.0/node_modules/@tanstack/ai/dist/esm/byok/providers.d.ts
|
|
3750
3769
|
/**
|
|
3751
3770
|
* Provider ids are open slugs, not a closed catalog. `@tanstack/ai` does not
|
|
3752
3771
|
* list adapters. Any matching string is a valid id and becomes `x-byok-<id>`.
|
|
3753
3772
|
*/
|
|
3754
3773
|
type ProviderId = string;
|
|
3755
3774
|
//#endregion
|
|
3756
|
-
//#region node_modules/.deno/@tanstack+ai@0.
|
|
3775
|
+
//#region node_modules/.deno/@tanstack+ai@0.64.0/node_modules/@tanstack/ai/dist/esm/byok/define-provider.d.ts
|
|
3757
3776
|
/**
|
|
3758
3777
|
* A BYOK provider declared by an adapter. `id` is the `x-byok-<id>` slug and
|
|
3759
3778
|
* is required — `{ id?: string }` is not a {@link ByokProvider}.
|
|
@@ -3773,7 +3792,7 @@ interface ByokProvider<TId extends string = string> {
|
|
|
3773
3792
|
readonly with?: ReadonlyArray<ByokProvider>;
|
|
3774
3793
|
}
|
|
3775
3794
|
//#endregion
|
|
3776
|
-
//#region node_modules/.deno/@tanstack+ai-client@0.36.
|
|
3795
|
+
//#region node_modules/.deno/@tanstack+ai-client@0.36.1/node_modules/@tanstack/ai-client/dist/esm/byok/storage.d.ts
|
|
3777
3796
|
type Keyring = Partial<Record<ProviderId, string>>;
|
|
3778
3797
|
type KeyPreview = Partial<Record<ProviderId, string>>;
|
|
3779
3798
|
interface KeyringStorage {
|
|
@@ -3788,7 +3807,7 @@ interface KeyringStorage {
|
|
|
3788
3807
|
clear: () => void | Promise<void>;
|
|
3789
3808
|
}
|
|
3790
3809
|
//#endregion
|
|
3791
|
-
//#region node_modules/.deno/@tanstack+ai-client@0.36.
|
|
3810
|
+
//#region node_modules/.deno/@tanstack+ai-client@0.36.1/node_modules/@tanstack/ai-client/dist/esm/byok/client.d.ts
|
|
3792
3811
|
type KeyStatus = {
|
|
3793
3812
|
state: 'empty';
|
|
3794
3813
|
} | {
|
|
@@ -3843,7 +3862,7 @@ declare class ByokClient {
|
|
|
3843
3862
|
unlock(): Promise<void>;
|
|
3844
3863
|
}
|
|
3845
3864
|
//#endregion
|
|
3846
|
-
//#region node_modules/.deno/@tanstack+ai-client@0.36.
|
|
3865
|
+
//#region node_modules/.deno/@tanstack+ai-client@0.36.1/node_modules/@tanstack/ai-client/dist/esm/events.d.ts
|
|
3847
3866
|
interface ChatClientRunEventContext {
|
|
3848
3867
|
threadId: string;
|
|
3849
3868
|
runId: string;
|
|
@@ -3963,7 +3982,7 @@ declare abstract class ChatClientEventEmitter {
|
|
|
3963
3982
|
toolFixtureApplied(fixture: ChatClientToolFixtureAppliedEvent): void;
|
|
3964
3983
|
}
|
|
3965
3984
|
//#endregion
|
|
3966
|
-
//#region node_modules/.deno/@tanstack+ai-client@0.36.
|
|
3985
|
+
//#region node_modules/.deno/@tanstack+ai-client@0.36.1/node_modules/@tanstack/ai-client/dist/esm/devtools.d.ts
|
|
3967
3986
|
interface AIDevtoolsDisplayOptions {
|
|
3968
3987
|
name?: string;
|
|
3969
3988
|
}
|
|
@@ -4131,10 +4150,10 @@ declare class ChatDevtoolsBridge extends ClientDevtoolsBridge<AIDevtoolsChatSnap
|
|
|
4131
4150
|
private findClientTool;
|
|
4132
4151
|
}
|
|
4133
4152
|
//#endregion
|
|
4134
|
-
//#region node_modules/.deno/@tanstack+ai-client@0.36.
|
|
4153
|
+
//#region node_modules/.deno/@tanstack+ai-client@0.36.1/node_modules/@tanstack/ai-client/dist/esm/devtools-noop.d.ts
|
|
4135
4154
|
type ChatDevtoolsBridgeFactory = (options: ChatDevtoolsBridgeOptions) => ChatDevtoolsBridge;
|
|
4136
4155
|
//#endregion
|
|
4137
|
-
//#region node_modules/.deno/@tanstack+ai-client@0.36.
|
|
4156
|
+
//#region node_modules/.deno/@tanstack+ai-client@0.36.1/node_modules/@tanstack/ai-client/dist/esm/types.d.ts
|
|
4138
4157
|
interface ChatResumeState {
|
|
4139
4158
|
threadId: string;
|
|
4140
4159
|
runId: string;
|
|
@@ -4905,7 +4924,7 @@ interface ChatClientBaseOptions<TTools extends ReadonlyArray<AnyClientTool> = an
|
|
|
4905
4924
|
*/
|
|
4906
4925
|
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>;
|
|
4907
4926
|
//#endregion
|
|
4908
|
-
//#region node_modules/.deno/@tanstack+ai-client@0.36.
|
|
4927
|
+
//#region node_modules/.deno/@tanstack+ai-client@0.36.1/node_modules/@tanstack/ai-client/dist/esm/connection-adapters.d.ts
|
|
4909
4928
|
/**
|
|
4910
4929
|
* Per-send context provided by the chat client to the connection adapter.
|
|
4911
4930
|
* The adapter combines this with serialized messages to build a full
|
|
@@ -5068,7 +5087,7 @@ interface SubscribeConnectionAdapter {
|
|
|
5068
5087
|
*/
|
|
5069
5088
|
type ConnectionAdapter = ConnectConnectionAdapter | SubscribeConnectionAdapter;
|
|
5070
5089
|
//#endregion
|
|
5071
|
-
//#region node_modules/.deno/@tanstack+ai-client@0.36.
|
|
5090
|
+
//#region node_modules/.deno/@tanstack+ai-client@0.36.1/node_modules/@tanstack/ai-client/dist/esm/chat-client.d.ts
|
|
5072
5091
|
type ChatClientUpdateOptionsWithoutContext<TTools extends ReadonlyArray<AnyClientTool>, TInterrupts extends ReadonlyArray<InterruptDefinition<any, any, any, any>> = readonly []> = {
|
|
5073
5092
|
connection?: ConnectionAdapter;
|
|
5074
5093
|
fetcher?: ChatFetcher; /** @deprecated Use `forwardedProps` instead. */
|
|
@@ -5748,8 +5767,10 @@ interface AstralBeamChatAttachmentOptions {
|
|
|
5748
5767
|
type AstralBeamChatSlotRenderer = (container: HTMLElement) => (() => void) | void;
|
|
5749
5768
|
/** Host-rendered replacements for the widget's own chrome; each renders in the host page's style. */
|
|
5750
5769
|
interface AstralBeamChatSlots {
|
|
5751
|
-
/** Replaces the header's
|
|
5770
|
+
/** Replaces the header's title; `showHeader: false` still hides the row. */
|
|
5752
5771
|
header?: AstralBeamChatSlotRenderer | undefined;
|
|
5772
|
+
/** Extra controls at the end of the header, after the history and new chat buttons. */
|
|
5773
|
+
headerActions?: AstralBeamChatSlotRenderer | undefined;
|
|
5753
5774
|
/** Replaces the empty-transcript state (icon, headline, and subtitle). */
|
|
5754
5775
|
empty?: AstralBeamChatSlotRenderer | undefined;
|
|
5755
5776
|
/** Extra controls at the end of the composer's button row, next to send. */
|
|
@@ -5799,24 +5820,31 @@ interface AstralBeamChatTheme {
|
|
|
5799
5820
|
interface MountAstralBeamChatOptions {
|
|
5800
5821
|
/**
|
|
5801
5822
|
* Public ID of the organization-owned agent. Omit it to use the organization's default agent,
|
|
5802
|
-
* which the dashboard's agents page selects.
|
|
5803
|
-
* and
|
|
5823
|
+
* which the dashboard's agents page selects. Saved conversations keep their agent,
|
|
5824
|
+
* and an update applies to new threads.
|
|
5804
5825
|
*/
|
|
5805
5826
|
agentId?: string | undefined;
|
|
5827
|
+
/** Defaults to `"auto"`, restoring this tab's selection. Use `"new"` for a fresh chat, or a saved thread UUID. */
|
|
5828
|
+
threadId?: string | undefined;
|
|
5806
5829
|
/** Name shown in the widget's header. Default `"AstralBeam"`. */
|
|
5807
5830
|
title?: string | undefined;
|
|
5808
5831
|
/**
|
|
5809
|
-
* Shows the widget's header, which carries the title and the
|
|
5810
|
-
* and gives the transcript the full height. Default `true`.
|
|
5832
|
+
* Shows the widget's header, which carries the title and the chat history and new chat buttons.
|
|
5833
|
+
* `false` hides it and gives the transcript the full height. Default `true`.
|
|
5811
5834
|
*/
|
|
5812
5835
|
showHeader?: boolean | undefined;
|
|
5836
|
+
/**
|
|
5837
|
+
* Shows a bar under the header with the open conversation's title, once it has one, and a menu
|
|
5838
|
+
* to rename, delete, or copy it as Markdown. Default `false`.
|
|
5839
|
+
*/
|
|
5840
|
+
showConversationTitle?: boolean | undefined;
|
|
5813
5841
|
/** Headline shown on the empty transcript. Default `"Ask the assistant"`. */
|
|
5814
|
-
|
|
5842
|
+
emptyHeadline?: string | undefined;
|
|
5815
5843
|
/** Subtitle shown under the empty transcript's headline. Default describes the app's tools and widgets. */
|
|
5816
5844
|
emptyDescription?: string | undefined;
|
|
5817
5845
|
/**
|
|
5818
5846
|
* Base URL of the AstralBeam API; the widget calls `/v1/chat` and its subroutes under it. Read for
|
|
5819
|
-
* every request, so a change moves the next one. Default `"https://
|
|
5847
|
+
* every request, so a change moves the next one. Default `"https://astralbeam.ai/api"`, the
|
|
5820
5848
|
* hosted cloud; self-hosted deployments must set their own origin.
|
|
5821
5849
|
*/
|
|
5822
5850
|
apiUrl?: string | undefined;
|
|
@@ -6131,6 +6159,28 @@ type ChatAuthenticationState = {
|
|
|
6131
6159
|
error: Error;
|
|
6132
6160
|
};
|
|
6133
6161
|
//#endregion
|
|
6162
|
+
//#region src/core/threads.d.ts
|
|
6163
|
+
/** A saved conversation visible to the signed-in tenant user. */
|
|
6164
|
+
interface ChatThread {
|
|
6165
|
+
id: string;
|
|
6166
|
+
title: string | null;
|
|
6167
|
+
agentId: string | null;
|
|
6168
|
+
version: number;
|
|
6169
|
+
role: "viewer" | "member" | "manager";
|
|
6170
|
+
writerActive: boolean;
|
|
6171
|
+
hasMessages: boolean;
|
|
6172
|
+
updatedAt: string;
|
|
6173
|
+
}
|
|
6174
|
+
interface ChatPendingInteraction {
|
|
6175
|
+
sourceMessageId: string;
|
|
6176
|
+
sourcePartId: string;
|
|
6177
|
+
responseTargetId: string;
|
|
6178
|
+
toolCallId: string;
|
|
6179
|
+
targetTenantUserId: string | null;
|
|
6180
|
+
targetClientId: string | null;
|
|
6181
|
+
executionLocation: string;
|
|
6182
|
+
}
|
|
6183
|
+
//#endregion
|
|
6134
6184
|
//#region src/core/session.d.ts
|
|
6135
6185
|
/** A widget render the agent requested, handed to the host's `onRenderWidget`. */
|
|
6136
6186
|
interface WidgetRenderRequest {
|
|
@@ -6154,11 +6204,17 @@ interface ChatStreamCallbacks {
|
|
|
6154
6204
|
onFinish?: ((message: UIMessage) => void) | undefined;
|
|
6155
6205
|
onError?: ((error: Error) => void) | undefined;
|
|
6156
6206
|
}
|
|
6207
|
+
interface ChatSubmissionCallbacks {
|
|
6208
|
+
/** Identifies the conversation before its input is sent, including a newly created chat. */
|
|
6209
|
+
onThreadReady?: ((threadId: string) => void) | undefined;
|
|
6210
|
+
/** Called once after the server acknowledges input, before generation finishes. */
|
|
6211
|
+
onAccepted?: (() => void) | undefined;
|
|
6212
|
+
}
|
|
6157
6213
|
/**
|
|
6158
6214
|
* The transport and tool options of the drop-in widget, minus everything about its UI, plus this
|
|
6159
6215
|
* session's own rendering hooks. The shared options are documented on `MountAstralBeamChatOptions`.
|
|
6160
6216
|
*/
|
|
6161
|
-
interface AstralBeamChatCoreOptions extends Pick<MountAstralBeamChatOptions, "agentId" | "apiUrl" | "fetchAstralBeamToken" | "tools" | "debug"> {
|
|
6217
|
+
interface AstralBeamChatCoreOptions extends Pick<MountAstralBeamChatOptions, "agentId" | "apiUrl" | "fetchAstralBeamToken" | "tools" | "debug" | "threadId"> {
|
|
6162
6218
|
/** Widgets declared to the agent, without a `render`; `onRenderWidget` is asked to draw them. */
|
|
6163
6219
|
widgets?: Record<string, WidgetDeclaration> | undefined;
|
|
6164
6220
|
/** Draws an agent-requested widget however the host wants; may return a cleanup. */
|
|
@@ -6185,6 +6241,15 @@ interface AstralBeamChatState {
|
|
|
6185
6241
|
agentTools: readonly AgentToolInfo[];
|
|
6186
6242
|
sandboxStatus: SandboxStatus | undefined;
|
|
6187
6243
|
sandbox: SandboxActivity;
|
|
6244
|
+
thread: ChatThread | undefined;
|
|
6245
|
+
threadLoading: boolean;
|
|
6246
|
+
threadLoadFailed: boolean;
|
|
6247
|
+
messagesCursor: string | undefined;
|
|
6248
|
+
olderMessagesLoading: boolean;
|
|
6249
|
+
/** Retained until the server acknowledges the send, including after an uncertain network failure. */
|
|
6250
|
+
unsentMessage: string | MultimodalContent | undefined;
|
|
6251
|
+
activeToolCallIds: readonly string[];
|
|
6252
|
+
pendingInteractions: readonly ChatPendingInteraction[];
|
|
6188
6253
|
}
|
|
6189
6254
|
interface AstralBeamChatCore {
|
|
6190
6255
|
/** Start browser side effects after a React commit. Vanilla sessions start automatically. */
|
|
@@ -6197,18 +6262,32 @@ interface AstralBeamChatCore {
|
|
|
6197
6262
|
* the chat session. Only the keys given are replaced.
|
|
6198
6263
|
*/
|
|
6199
6264
|
updateOptions: (options: Partial<AstralBeamChatCoreOptions>) => void;
|
|
6200
|
-
/** Sends a message,
|
|
6201
|
-
sendMessage: (content: string | MultimodalContent) => Promise<void>;
|
|
6265
|
+
/** Sends a message, persisting it before generation begins. */
|
|
6266
|
+
sendMessage: (content: string | MultimodalContent, callbacks?: ChatSubmissionCallbacks) => Promise<void>;
|
|
6202
6267
|
/** Resolves a client tool call the host executed itself (a questionnaire, an approval). */
|
|
6203
6268
|
addToolResult: ChatClient["addToolResult"];
|
|
6204
6269
|
/** Stops the in-flight generation; the transcript keeps what already streamed. */
|
|
6205
6270
|
stop: () => void;
|
|
6206
6271
|
/** Mints a fresh chat auth token, ignoring the cached one; for a retry after a failure. */
|
|
6207
6272
|
retryAuthentication: () => void;
|
|
6208
|
-
/**
|
|
6273
|
+
/** Refreshes saved history and retries delivery of retained tool results. */
|
|
6209
6274
|
reload: () => Promise<void>;
|
|
6210
|
-
/**
|
|
6275
|
+
/** Starts an empty conversation and disposes widget renders, preserving any saved chat. */
|
|
6211
6276
|
reset: () => void;
|
|
6277
|
+
/** Searches all authorized conversation titles using server pagination. */
|
|
6278
|
+
searchThreads: (q?: string, cursor?: string, signal?: AbortSignal) => Promise<{
|
|
6279
|
+
items: ChatThread[];
|
|
6280
|
+
page_after: string | null;
|
|
6281
|
+
}>;
|
|
6282
|
+
/** Loads saved history before accepting another send. */
|
|
6283
|
+
openThread: (id: string) => Promise<void>;
|
|
6284
|
+
renameThread: (title: string) => Promise<boolean>;
|
|
6285
|
+
/** Deletes a listed conversation, the selected one by default; resolves whether it succeeded. */
|
|
6286
|
+
deleteThread: (thread?: ChatThread) => Promise<boolean>;
|
|
6287
|
+
refreshThread: () => Promise<void>;
|
|
6288
|
+
loadOlderMessages: () => Promise<void>;
|
|
6289
|
+
abandonToolCall: (toolCallId: string) => Promise<void>;
|
|
6290
|
+
getAttachment: (messageId: string, partId: string) => Promise<Blob>;
|
|
6212
6291
|
/** Tears the session down: the connection, authentication, and widget renders. */
|
|
6213
6292
|
dispose: () => void;
|
|
6214
6293
|
}
|
|
@@ -6275,4 +6354,4 @@ interface TypedToolDefinition<S extends ParametersSchema = JsonSchemaObject> {
|
|
|
6275
6354
|
/** Declares a host tool; a Standard Schema `parameters` types (and validates) `execute`'s input. */
|
|
6276
6355
|
declare function defineTool<const S extends ParametersSchema = JsonSchemaObject>(tool: TypedToolDefinition<S>): ToolDefinition;
|
|
6277
6356
|
//#endregion
|
|
6278
|
-
export {
|
|
6357
|
+
export { ChatAuthenticationState as A, AstralBeamChatTheme as B, AstralBeamChatState as C, createAstralBeamChat as D, WidgetRenderRequest as E, SandboxArtifact as F, StandardSchemaV1 as G, InferParameters as H, SandboxCommandRun as I, ToolDefinition as K, SandboxFileWrite as L, buildAgentTools as M, RenderWidgetInput as N, ChatPendingInteraction as O, SandboxActivity as P, SandboxStatus as R, AstralBeamChatCoreOptions as S, ChatSubmissionCallbacks as T, JsonSchemaObject as U, AstralBeamTokenSource as V, ParametersSchema as W, hasPendingToolRun as _, SANDBOX_PUBLISH_ARTIFACT_TOOL as a, AgentToolInfo as b, SANDBOX_STATUS_EVENT as c, describeSandboxCommandRun as d, isSandboxTool as f, sandboxRefusal as g, readSandboxFileWrite as h, SANDBOX_LIST_FILES_TOOL as i, WidgetDeclaration as j, ChatThread as k, SANDBOX_WRITE_FILE_TOOL as l, readSandboxCommandRun as m, ASK_QUESTIONNAIRE_TOOL as n, SANDBOX_READ_FILE_TOOL as o, readSandboxArtifact as p, RENDER_WIDGET_TOOL as r, SANDBOX_RUN_COMMAND_TOOL as s, defineTool as t, collectSandboxActivity as u, isSettledToolCall as v, ChatStreamCallbacks as w, AstralBeamChatCore as x, lastPartInProgress as y, AstralBeamChatColorScheme as z };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{n as e}from"./rolldown-runtime-Bh1tDfsg.js";import"./constants-enyqxaJi.js";import{$t as t,A as n,B as r,Br as i,C as a,E as o,F as s,H as c,Hr as l,I as u,It as d,Jt as f,Kn as p,L as m,M as h,N as g,O as ee,P as _,Qt as v,R as y,S as b,T as x,U as S,V as C,Vr as w,W as T,Yt as E,Zt as D,_ as O,_i as k,_n as A,b as te,c as ne,d as re,ei as ie,en as j,f as M,g as N,gi as P,h as ae,hi as oe,i as se,j as ce,k as le,l as ue,m as de,mi as fe,t as pe,u as F,y as me,yi as he,yn as I,z as ge,zr as L}from"./styles.generated-Ucyw8D9G.js";var R=e(he(),1);const _e=new Map([[`bold`,R.createElement(R.Fragment,null,R.createElement(`path`,{d:`M244,56v48a12,12,0,0,1-12,12H184a12,12,0,1,1,0-24H201.1l-19-17.38c-.13-.12-.26-.24-.38-.37A76,76,0,1,0,127,204h1a75.53,75.53,0,0,0,52.15-20.72,12,12,0,0,1,16.49,17.45A99.45,99.45,0,0,1,128,228h-1.37A100,100,0,1,1,198.51,57.06L220,76.72V56a12,12,0,0,1,24,0Z`}))],[`duotone`,R.createElement(R.Fragment,null,R.createElement(`path`,{d:`M216,128a88,88,0,1,1-88-88A88,88,0,0,1,216,128Z`,opacity:`0.2`}),R.createElement(`path`,{d:`M240,56v48a8,8,0,0,1-8,8H184a8,8,0,0,1,0-16H211.4L184.81,71.64l-.25-.24a80,80,0,1,0-1.67,114.78,8,8,0,0,1,11,11.63A95.44,95.44,0,0,1,128,224h-1.32A96,96,0,1,1,195.75,60L224,85.8V56a8,8,0,1,1,16,0Z`}))],[`fill`,R.createElement(R.Fragment,null,R.createElement(`path`,{d:`M240,56v48a8,8,0,0,1-8,8H184a8,8,0,0,1-5.66-13.66l17-17-10.55-9.65-.25-.24a80,80,0,1,0-1.67,114.78,8,8,0,1,1,11,11.63A95.44,95.44,0,0,1,128,224h-1.32A96,96,0,1,1,195.75,60l10.93,10L226.34,50.3A8,8,0,0,1,240,56Z`}))],[`light`,R.createElement(R.Fragment,null,R.createElement(`path`,{d:`M238,56v48a6,6,0,0,1-6,6H184a6,6,0,0,1,0-12h32.55l-30.38-27.8c-.06-.06-.12-.13-.19-.19a82,82,0,1,0-1.7,117.65,6,6,0,0,1,8.24,8.73A93.46,93.46,0,0,1,128,222h-1.28A94,94,0,1,1,194.37,61.4L226,90.35V56a6,6,0,1,1,12,0Z`}))],[`regular`,R.createElement(R.Fragment,null,R.createElement(`path`,{d:`M240,56v48a8,8,0,0,1-8,8H184a8,8,0,0,1,0-16H211.4L184.81,71.64l-.25-.24a80,80,0,1,0-1.67,114.78,8,8,0,0,1,11,11.63A95.44,95.44,0,0,1,128,224h-1.32A96,96,0,1,1,195.75,60L224,85.8V56a8,8,0,1,1,16,0Z`}))],[`thin`,R.createElement(R.Fragment,null,R.createElement(`path`,{d:`M236,56v48a4,4,0,0,1-4,4H184a4,4,0,0,1,0-8h37.7L187.53,68.69l-.13-.12a84,84,0,1,0-1.75,120.51,4,4,0,0,1,5.5,5.82A91.43,91.43,0,0,1,128,220h-1.26A92,92,0,1,1,193,62.84l35,32.05V56a4,4,0,1,1,8,0Z`}))]]),ve=new Map([[`bold`,R.createElement(R.Fragment,null,R.createElement(`path`,{d:`M228,128a12,12,0,0,1-12,12H69l51.52,51.51a12,12,0,0,1-17,17l-72-72a12,12,0,0,1,0-17l72-72a12,12,0,0,1,17,17L69,116H216A12,12,0,0,1,228,128Z`}))],[`duotone`,R.createElement(R.Fragment,null,R.createElement(`path`,{d:`M112,56V200L40,128Z`,opacity:`0.2`}),R.createElement(`path`,{d:`M216,120H120V56a8,8,0,0,0-13.66-5.66l-72,72a8,8,0,0,0,0,11.32l72,72A8,8,0,0,0,120,200V136h96a8,8,0,0,0,0-16ZM104,180.69,51.31,128,104,75.31Z`}))],[`fill`,R.createElement(R.Fragment,null,R.createElement(`path`,{d:`M224,128a8,8,0,0,1-8,8H120v64a8,8,0,0,1-13.66,5.66l-72-72a8,8,0,0,1,0-11.32l72-72A8,8,0,0,1,120,56v64h96A8,8,0,0,1,224,128Z`}))],[`light`,R.createElement(R.Fragment,null,R.createElement(`path`,{d:`M222,128a6,6,0,0,1-6,6H54.49l61.75,61.76a6,6,0,1,1-8.48,8.48l-72-72a6,6,0,0,1,0-8.48l72-72a6,6,0,0,1,8.48,8.48L54.49,122H216A6,6,0,0,1,222,128Z`}))],[`regular`,R.createElement(R.Fragment,null,R.createElement(`path`,{d:`M224,128a8,8,0,0,1-8,8H59.31l58.35,58.34a8,8,0,0,1-11.32,11.32l-72-72a8,8,0,0,1,0-11.32l72-72a8,8,0,0,1,11.32,11.32L59.31,120H216A8,8,0,0,1,224,128Z`}))],[`thin`,R.createElement(R.Fragment,null,R.createElement(`path`,{d:`M220,128a4,4,0,0,1-4,4H49.66l65.17,65.17a4,4,0,0,1-5.66,5.66l-72-72a4,4,0,0,1,0-5.66l72-72a4,4,0,0,1,5.66,5.66L49.66,124H216A4,4,0,0,1,220,128Z`}))]]),ye=new Map([[`bold`,R.createElement(R.Fragment,null,R.createElement(`path`,{d:`M240,204H228V96a20,20,0,0,0-20-20H172V32a20,20,0,0,0-28.45-18.12l-104,48.54A20.06,20.06,0,0,0,28,80.55V204H16a12,12,0,0,0,0,24H240a12,12,0,0,0,0-24ZM204,100V204H172V100ZM52,83.09,148,38.3V204H52ZM132,112v12a12,12,0,0,1-24,0V112a12,12,0,0,1,24,0Zm-40,0v12a12,12,0,0,1-24,0V112a12,12,0,0,1,24,0Zm0,52v12a12,12,0,0,1-24,0V164a12,12,0,0,1,24,0Zm40,0v12a12,12,0,0,1-24,0V164a12,12,0,0,1,24,0Z`}))],[`duotone`,R.createElement(R.Fragment,null,R.createElement(`path`,{d:`M136,32V216H40V85.35a8,8,0,0,1,3.56-6.66l80-53.33A8,8,0,0,1,136,32Z`,opacity:`0.2`}),R.createElement(`path`,{d:`M240,208H224V96a16,16,0,0,0-16-16H144V32a16,16,0,0,0-24.88-13.32L39.12,72A16,16,0,0,0,32,85.34V208H16a8,8,0,0,0,0,16H240a8,8,0,0,0,0-16ZM208,96V208H144V96ZM48,85.34,128,32V208H48ZM112,112v16a8,8,0,0,1-16,0V112a8,8,0,1,1,16,0Zm-32,0v16a8,8,0,0,1-16,0V112a8,8,0,1,1,16,0Zm0,56v16a8,8,0,0,1-16,0V168a8,8,0,0,1,16,0Zm32,0v16a8,8,0,0,1-16,0V168a8,8,0,0,1,16,0Z`}))],[`fill`,R.createElement(R.Fragment,null,R.createElement(`path`,{d:`M239.73,208H224V96a16,16,0,0,0-16-16H164a4,4,0,0,0-4,4V208H144V32.41a16.43,16.43,0,0,0-6.16-13,16,16,0,0,0-18.72-.69L39.12,72A16,16,0,0,0,32,85.34V208H16.27A8.18,8.18,0,0,0,8,215.47,8,8,0,0,0,16,224H240a8,8,0,0,0,8-8.53A8.18,8.18,0,0,0,239.73,208ZM76,184a8,8,0,0,1-8.53,8A8.18,8.18,0,0,1,60,183.72V168.27A8.19,8.19,0,0,1,67.47,160,8,8,0,0,1,76,168Zm0-56a8,8,0,0,1-8.53,8A8.19,8.19,0,0,1,60,127.72V112.27A8.19,8.19,0,0,1,67.47,104,8,8,0,0,1,76,112Zm40,56a8,8,0,0,1-8.53,8,8.18,8.18,0,0,1-7.47-8.26V168.27a8.19,8.19,0,0,1,7.47-8.26,8,8,0,0,1,8.53,8Zm0-56a8,8,0,0,1-8.53,8,8.19,8.19,0,0,1-7.47-8.26V112.27a8.19,8.19,0,0,1,7.47-8.26,8,8,0,0,1,8.53,8Z`}))],[`light`,R.createElement(R.Fragment,null,R.createElement(`path`,{d:`M240,210H222V96a14,14,0,0,0-14-14H142V32a14,14,0,0,0-21.77-11.64l-80,53.33A14,14,0,0,0,34,85.34V210H16a6,6,0,0,0,0,12H240a6,6,0,0,0,0-12ZM208,94a2,2,0,0,1,2,2V210H142V94ZM46,85.34a2,2,0,0,1,.89-1.66l80-53.34A2,2,0,0,1,130,32V210H46ZM110,112v16a6,6,0,0,1-12,0V112a6,6,0,0,1,12,0Zm-32,0v16a6,6,0,0,1-12,0V112a6,6,0,0,1,12,0Zm0,56v16a6,6,0,0,1-12,0V168a6,6,0,0,1,12,0Zm32,0v16a6,6,0,0,1-12,0V168a6,6,0,0,1,12,0Z`}))],[`regular`,R.createElement(R.Fragment,null,R.createElement(`path`,{d:`M240,208H224V96a16,16,0,0,0-16-16H144V32a16,16,0,0,0-24.88-13.32L39.12,72A16,16,0,0,0,32,85.34V208H16a8,8,0,0,0,0,16H240a8,8,0,0,0,0-16ZM208,96V208H144V96ZM48,85.34,128,32V208H48ZM112,112v16a8,8,0,0,1-16,0V112a8,8,0,1,1,16,0Zm-32,0v16a8,8,0,0,1-16,0V112a8,8,0,1,1,16,0Zm0,56v16a8,8,0,0,1-16,0V168a8,8,0,0,1,16,0Zm32,0v16a8,8,0,0,1-16,0V168a8,8,0,0,1,16,0Z`}))],[`thin`,R.createElement(R.Fragment,null,R.createElement(`path`,{d:`M240,212H220V96a12,12,0,0,0-12-12H140V32a12,12,0,0,0-18.66-10l-80,53.33a12,12,0,0,0-5.34,10V212H16a4,4,0,0,0,0,8H240a4,4,0,0,0,0-8ZM208,92a4,4,0,0,1,4,4V212H140V92ZM44,85.34A4,4,0,0,1,45.78,82l80-53.33A4,4,0,0,1,132,32V212H44ZM108,112v16a4,4,0,0,1-8,0V112a4,4,0,0,1,8,0Zm-32,0v16a4,4,0,0,1-8,0V112a4,4,0,0,1,8,0Zm0,56v16a4,4,0,0,1-8,0V168a4,4,0,0,1,8,0Zm32,0v16a4,4,0,0,1-8,0V168a4,4,0,0,1,8,0Z`}))]]),be=new Map([[`bold`,R.createElement(R.Fragment,null,R.createElement(`path`,{d:`M216,76H188V48a20,20,0,0,0-20-20H40A20,20,0,0,0,20,48V176a12,12,0,0,0,19.54,9.33l28.46-23V184a20,20,0,0,0,20,20h92.17l36.29,29.33A12,12,0,0,0,236,224V96A20,20,0,0,0,216,76ZM44,150.87V52H164v80H71.58A12,12,0,0,0,64,134.67Zm168,48-20-16.2a12,12,0,0,0-7.54-2.67H92V156h76a20,20,0,0,0,20-20V100h24Z`}))],[`duotone`,R.createElement(R.Fragment,null,R.createElement(`path`,{d:`M224,96V224l-39.58-32H88a8,8,0,0,1-8-8V144h88a8,8,0,0,0,8-8V88h40A8,8,0,0,1,224,96Z`,opacity:`0.2`}),R.createElement(`path`,{d:`M216,80H184V48a16,16,0,0,0-16-16H40A16,16,0,0,0,24,48V176a8,8,0,0,0,13,6.22L72,154V184a16,16,0,0,0,16,16h93.59L219,230.22a8,8,0,0,0,5,1.78,8,8,0,0,0,8-8V96A16,16,0,0,0,216,80ZM66.55,137.78,40,159.25V48H168v88H71.58A8,8,0,0,0,66.55,137.78ZM216,207.25l-26.55-21.47a8,8,0,0,0-5-1.78H88V152h80a16,16,0,0,0,16-16V96h32Z`}))],[`fill`,R.createElement(R.Fragment,null,R.createElement(`path`,{d:`M232,96a16,16,0,0,0-16-16H184V48a16,16,0,0,0-16-16H40A16,16,0,0,0,24,48V176a8,8,0,0,0,13,6.22L72,154V184a16,16,0,0,0,16,16h93.59L219,230.22a8,8,0,0,0,5,1.78,8,8,0,0,0,8-8Zm-42.55,89.78a8,8,0,0,0-5-1.78H88V152h80a16,16,0,0,0,16-16V96h32V207.25Z`}))],[`light`,R.createElement(R.Fragment,null,R.createElement(`path`,{d:`M216,82H182V48a14,14,0,0,0-14-14H40A14,14,0,0,0,26,48V176a6,6,0,0,0,3.42,5.41A5.86,5.86,0,0,0,32,182a6,6,0,0,0,3.77-1.33L73.71,150H74v34a14,14,0,0,0,14,14h94.29l37.94,30.67A6,6,0,0,0,224,230a5.86,5.86,0,0,0,2.58-.59A6,6,0,0,0,230,224V96A14,14,0,0,0,216,82ZM71.58,138a6,6,0,0,0-3.77,1.33L38,163.43V48a2,2,0,0,1,2-2H168a2,2,0,0,1,2,2v88a2,2,0,0,1-2,2ZM218,211.43l-29.81-24.1a6,6,0,0,0-3.77-1.33H88a2,2,0,0,1-2-2V150h82a14,14,0,0,0,14-14V94h34a2,2,0,0,1,2,2Z`}))],[`regular`,R.createElement(R.Fragment,null,R.createElement(`path`,{d:`M216,80H184V48a16,16,0,0,0-16-16H40A16,16,0,0,0,24,48V176a8,8,0,0,0,13,6.22L72,154V184a16,16,0,0,0,16,16h93.59L219,230.22a8,8,0,0,0,5,1.78,8,8,0,0,0,8-8V96A16,16,0,0,0,216,80ZM66.55,137.78,40,159.25V48H168v88H71.58A8,8,0,0,0,66.55,137.78ZM216,207.25l-26.55-21.47a8,8,0,0,0-5-1.78H88V152h80a16,16,0,0,0,16-16V96h32Z`}))],[`thin`,R.createElement(R.Fragment,null,R.createElement(`path`,{d:`M216,84H180V48a12,12,0,0,0-12-12H40A12,12,0,0,0,28,48V176a4,4,0,0,0,4,4,4,4,0,0,0,2.51-.89L73,148h3v36a12,12,0,0,0,12,12h95l38.49,31.11A4,4,0,0,0,224,228a4,4,0,0,0,4-4V96A12,12,0,0,0,216,84ZM71.58,140a4,4,0,0,0-2.51.89L36,167.62V48a4,4,0,0,1,4-4H168a4,4,0,0,1,4,4v88a4,4,0,0,1-4,4ZM220,215.62l-33.07-26.73a4,4,0,0,0-2.51-.89H88a4,4,0,0,1-4-4V148h84a12,12,0,0,0,12-12V92h36a4,4,0,0,1,4,4Z`}))]]),xe=new Map([[`bold`,R.createElement(R.Fragment,null,R.createElement(`path`,{d:`M125.18,156.94a64,64,0,1,0-82.36,0,100.23,100.23,0,0,0-39.49,32,12,12,0,0,0,19.35,14.2,76,76,0,0,1,122.64,0,12,12,0,0,0,19.36-14.2A100.33,100.33,0,0,0,125.18,156.94ZM44,108a40,40,0,1,1,40,40A40,40,0,0,1,44,108Zm206.1,97.67a12,12,0,0,1-16.78-2.57A76.31,76.31,0,0,0,172,172a12,12,0,0,1,0-24,40,40,0,1,0-10.3-78.67,12,12,0,1,1-6.16-23.19,64,64,0,0,1,57.64,110.8,100.23,100.23,0,0,1,39.49,32A12,12,0,0,1,250.1,205.67Z`}))],[`duotone`,R.createElement(R.Fragment,null,R.createElement(`path`,{d:`M136,108A52,52,0,1,1,84,56,52,52,0,0,1,136,108Z`,opacity:`0.2`}),R.createElement(`path`,{d:`M117.25,157.92a60,60,0,1,0-66.5,0A95.83,95.83,0,0,0,3.53,195.63a8,8,0,1,0,13.4,8.74,80,80,0,0,1,134.14,0,8,8,0,0,0,13.4-8.74A95.83,95.83,0,0,0,117.25,157.92ZM40,108a44,44,0,1,1,44,44A44.05,44.05,0,0,1,40,108Zm210.14,98.7a8,8,0,0,1-11.07-2.33A79.83,79.83,0,0,0,172,168a8,8,0,0,1,0-16,44,44,0,1,0-16.34-84.87,8,8,0,1,1-5.94-14.85,60,60,0,0,1,55.53,105.64,95.83,95.83,0,0,1,47.22,37.71A8,8,0,0,1,250.14,206.7Z`}))],[`fill`,R.createElement(R.Fragment,null,R.createElement(`path`,{d:`M164.47,195.63a8,8,0,0,1-6.7,12.37H10.23a8,8,0,0,1-6.7-12.37,95.83,95.83,0,0,1,47.22-37.71,60,60,0,1,1,66.5,0A95.83,95.83,0,0,1,164.47,195.63Zm87.91-.15a95.87,95.87,0,0,0-47.13-37.56A60,60,0,0,0,144.7,54.59a4,4,0,0,0-1.33,6A75.83,75.83,0,0,1,147,150.53a4,4,0,0,0,1.07,5.53,112.32,112.32,0,0,1,29.85,30.83,23.92,23.92,0,0,1,3.65,16.47,4,4,0,0,0,3.95,4.64h60.3a8,8,0,0,0,7.73-5.93A8.22,8.22,0,0,0,252.38,195.48Z`}))],[`light`,R.createElement(R.Fragment,null,R.createElement(`path`,{d:`M112.6,158.43a58,58,0,1,0-57.2,0A93.83,93.83,0,0,0,5.21,196.72a6,6,0,0,0,10.05,6.56,82,82,0,0,1,137.48,0,6,6,0,0,0,10-6.56A93.83,93.83,0,0,0,112.6,158.43ZM38,108a46,46,0,1,1,46,46A46.06,46.06,0,0,1,38,108Zm211,97a6,6,0,0,1-8.3-1.74A81.8,81.8,0,0,0,172,166a6,6,0,0,1,0-12,46,46,0,1,0-17.08-88.73,6,6,0,1,1-4.46-11.14,58,58,0,0,1,50.14,104.3,93.83,93.83,0,0,1,50.19,38.29A6,6,0,0,1,249,205Z`}))],[`regular`,R.createElement(R.Fragment,null,R.createElement(`path`,{d:`M117.25,157.92a60,60,0,1,0-66.5,0A95.83,95.83,0,0,0,3.53,195.63a8,8,0,1,0,13.4,8.74,80,80,0,0,1,134.14,0,8,8,0,0,0,13.4-8.74A95.83,95.83,0,0,0,117.25,157.92ZM40,108a44,44,0,1,1,44,44A44.05,44.05,0,0,1,40,108Zm210.14,98.7a8,8,0,0,1-11.07-2.33A79.83,79.83,0,0,0,172,168a8,8,0,0,1,0-16,44,44,0,1,0-16.34-84.87,8,8,0,1,1-5.94-14.85,60,60,0,0,1,55.53,105.64,95.83,95.83,0,0,1,47.22,37.71A8,8,0,0,1,250.14,206.7Z`}))],[`thin`,R.createElement(R.Fragment,null,R.createElement(`path`,{d:`M107.19,159a56,56,0,1,0-46.38,0A91.83,91.83,0,0,0,6.88,197.81a4,4,0,1,0,6.7,4.37,84,84,0,0,1,140.84,0,4,4,0,1,0,6.7-4.37A91.83,91.83,0,0,0,107.19,159ZM36,108a48,48,0,1,1,48,48A48.05,48.05,0,0,1,36,108Zm212,95.35a4,4,0,0,1-5.53-1.17A83.81,83.81,0,0,0,172,164a4,4,0,0,1,0-8,48,48,0,1,0-17.82-92.58,4,4,0,1,1-3-7.43,56,56,0,0,1,44,103,91.83,91.83,0,0,1,53.93,38.86A4,4,0,0,1,248,203.35Z`}))]]),Se=R.forwardRef((e,t)=>R.createElement(P,{ref:t,...e,weights:_e}));Se.displayName=`ArrowClockwiseIcon`;const Ce=R.forwardRef((e,t)=>R.createElement(P,{ref:t,...e,weights:ve}));Ce.displayName=`ArrowLeftIcon`;const we=R.forwardRef((e,t)=>R.createElement(P,{ref:t,...e,weights:ye}));we.displayName=`BuildingsIcon`;const Te=R.forwardRef((e,t)=>R.createElement(P,{ref:t,...e,weights:be}));Te.displayName=`ChatsIcon`;const Ee=R.forwardRef((e,t)=>R.createElement(P,{ref:t,...e,weights:xe}));Ee.displayName=`UsersIcon`;function z(e,t){return g(e,s,t)}function De(e,t){let n=ge(t),r=n.getQueryCache();return R.useSyncExternalStore(R.useCallback(e=>r.subscribe(u.batchCalls(e)),[r]),()=>n.isFetching(e),()=>n.isFetching(e))}var Oe=k();function ke(e,t){let n={options:e,onIdentityChange:t,abortController:new AbortController,auth:re({apiUrl:e.apiUrl,fetchAstralBeamToken:e.fetchAstralBeamToken})};return N(n.auth,()=>{let e=F(n.auth);e.status===`error`&&Ae(n,e.error)}),n}function Ae(e,t){try{e.options.onError?.(t instanceof Error?t:Error(String(t)))}catch{}}function je(e){e.abortController.abort(),M(e.auth)}function Me(e,t){return B(e,t,async t=>{let{tenantId:n,tenantExternalId:r}=e.options;return n===void 0?(await D({page_size:1,...r===void 0?{}:{"filter[external_id]":r}},t)).items[0]??null:f(n,t)})}function Ne(e,t,n){return B(e,n,e=>D(t,e))}function Pe(e,t,n){return B(e,n,async e=>{let{kind:n,tenantId:r,q:i,admin:a,size:o,cursor:s}=t,c={q:i,page_size:o,...s};if(n===`users`){if(!r)throw Error(`Select a tenant before listing its users.`);return j(r,{...c,...a===`all`?{}:{"filter[admin]":a}},e)}if(r){let t=await f(r,e);return{items:!i||[t.name??``,t.external_id].some(e=>e.toLocaleLowerCase().includes(i.toLocaleLowerCase()))?[t]:[],page_after:null,page_before:null}}return D(c,e)})}async function B(e,t,n){let r=AbortSignal.any([t,e.abortController.signal,e.auth.session.abortController.signal]);try{for(let t=0;t<2;t++){r.throwIfAborted(),O(e.auth,{apiUrl:e.options.apiUrl,fetchAstralBeamToken:e.options.fetchAstralBeamToken});let i=await de({...e.auth,retryUnauthorized:t===0});r.throwIfAborted();let a=F(e.auth);if(a.status!==`ready`)throw Error(`Authentication is not ready`);let o=a.currentUser.scope===`organization`,s=ue(a.currentUser,e.auth.session.cached.tenantAdmin);if(e.identity!==void 0&&e.identity!==s)throw e.onIdentityChange(),new DOMException(`Identity changed`,`AbortError`);if(e.identity=s,e.options.scope===`organization`&&!o)throw Error(`Organization mode requires an organization-management token.`);if((e.options.scope??`tenant`)===`tenant`&&o&&!e.options.tenantId&&e.options.tenantExternalId===void 0)throw Error(`tenantId or tenantExternalId is required for a tenant view using an organization token.`);try{let t=await n({apiUrl:e.auth.apiUrl,astralBeamToken:i,signal:r});return r.throwIfAborted(),t}catch(n){if(t||!I(n)||n.status!==401)throw n;await ae(e.auth,i)}}throw Error(`Authentication failed`)}catch(t){let n=F(e.auth);throw!(n.status===`error`&&n.error===t)&&!r.aborted&&!(t instanceof Error&&t.name===`AbortError`)&&Ae(e,t),t}}function Fe(e,n,r){return B(e,r,e=>t({q:n.q,page_size:n.size,...n.cursor,...n.tenantId?{"filter[tenant_id]":n.tenantId}:{}},e))}function Ie(e,t,n,r,i){return B(e,i,e=>v(t,n,{page_size:100,...r?{page_after:r}:{}},e))}function Le(e,t,n,r,i,a){return B(e,a,async e=>(await E(t,n,r,i,e)).blob())}var V=i();function Re({label:e,placeholder:t=`Search…`,value:i,onValueChange:s,itemLabel:c,loadPage:l,disabled:u=!1,showClear:d=!1,popup:f=!1,id:p,className:g=`min-w-0 flex-1`}){let v=(0,R.useRef)(null),y=(0,R.useRef)(null),[S,C]=(0,R.useState)(``),[w,T]=(0,R.useState)(!1),[E]=r(S.trim(),{wait:300}),D=(0,R.useContext)(m),[O]=(0,R.useState)(()=>new _),k=h({queryKey:[`search-dropdown`,(0,R.useId)(),E],enabled:w,initialPageParam:void 0,queryFn:({signal:e,pageParam:t})=>l(E,t,e),getNextPageParam:e=>e.page_after??void 0,retry:!1,gcTime:0},D??O),A=S.trim()!==E||k.isPending,{hasNextPage:ne,isFetching:re,isError:ie,fetchNextPage:j}=k;(0,R.useEffect)(()=>{let e=y.current;if(!w||!e||A||!ne||re||ie)return;let t=()=>{e.scrollHeight-e.scrollTop-e.clientHeight<48&&j({cancelRefetch:!1})};return t(),e.addEventListener(`scroll`,t),()=>e.removeEventListener(`scroll`,t)},[w,A,ne,re,ie,j,k.data]);let M=A?[]:k.data?.pages.flatMap(e=>e.items)??[],N=(0,V.jsx)(x,{id:f?void 0:p,"aria-label":f?t:e,placeholder:t,maxLength:255,disabled:u,showTrigger:!f,showClear:d,onFocus:e=>e.currentTarget.select()});return(0,V.jsx)(`div`,{ref:v,className:g,"data-slot":`search-dropdown`,children:(0,V.jsxs)(te,{items:i&&!M.some(e=>e.id===i.id)?[...M,i]:M,filteredItems:M,value:i,onValueChange:s,itemToStringLabel:c,itemToStringValue:e=>e.id,isItemEqualToValue:(e,t)=>e.id===t.id,disabled:u,onInputValueChange:(e,t)=>{C(t.reason===`input-change`?e:``)},onOpenChange:e=>{T(e),e||C(``)},children:[f?(0,V.jsx)(n,{id:p,"aria-label":e,render:(0,V.jsx)(L,{variant:`outline`,className:`w-full justify-between`}),children:(0,V.jsx)(`span`,{className:`truncate`,children:(0,V.jsx)(ce,{placeholder:e})})}):N,(0,V.jsxs)(b,{container:v,"aria-label":f?e:void 0,"aria-busy":A||k.isFetching?!0:void 0,children:[f&&N,(0,V.jsx)(le,{className:`text-center text-sm text-muted-foreground [&:not(:empty)]:py-2`,children:A||k.isFetchingNextPage?`Loading…`:null}),(0,V.jsx)(a,{children:!A&&!k.isError?`No matches.`:null}),(0,V.jsx)(ee,{ref:y,children:e=>(0,V.jsx)(o,{value:e,children:c(e)},e.id)}),!A&&k.isError&&(0,V.jsxs)(`div`,{className:`p-2 text-xs`,role:`alert`,children:[`Could not load options.`,(0,V.jsx)(L,{variant:`ghost`,size:`sm`,disabled:k.isFetching,onClick:()=>void(k.isFetchNextPageError?k.fetchNextPage():k.refetch()),children:`Retry`})]})]})]})})}function ze({className:e,size:t=`default`,...n}){return(0,V.jsxs)(`div`,{className:w(`group/native-select relative w-fit has-[select:disabled]:opacity-50`,e),"data-slot":`native-select-wrapper`,"data-size":t,children:[(0,V.jsx)(`select`,{"data-slot":`native-select`,"data-size":t,className:`h-8 w-full min-w-0 appearance-none rounded-lg border border-input bg-transparent py-1 pe-8 ps-2.5 text-sm transition-colors outline-none select-none selection:bg-primary selection:text-primary-foreground placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 disabled:pointer-events-none disabled:cursor-not-allowed aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 data-[size=sm]:h-7 data-[size=sm]:rounded-[min(var(--radius-md),10px)] data-[size=sm]:py-0.5 dark:bg-input/30 dark:hover:bg-input/50 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40`,...n}),(0,V.jsx)(oe,{className:`pointer-events-none absolute top-1/2 end-2.5 size-4 -translate-y-1/2 text-muted-foreground select-none`,"aria-hidden":`true`,"data-slot":`native-select-icon`})]})}function H({className:e,...t}){return(0,V.jsx)(`option`,{"data-slot":`native-select-option`,className:w(`bg-[Canvas] text-[CanvasText]`,e),...t})}function Be({className:e,...t}){return(0,V.jsx)(`div`,{"data-slot":`skeleton`,className:w(`animate-pulse rounded-md bg-muted`,e),...t})}const Ve=l(`group/alert relative grid w-full gap-0.5 rounded-lg border px-2.5 py-2 text-start text-sm has-data-[slot=alert-action]:relative has-data-[slot=alert-action]:pe-18 has-[>svg]:grid-cols-[auto_1fr] has-[>svg]:gap-x-2 *:[svg]:row-span-2 *:[svg]:translate-y-0.5 *:[svg]:text-current *:[svg:not([class*='size-'])]:size-4`,{variants:{variant:{default:`bg-card text-card-foreground`,destructive:`bg-card text-destructive *:data-[slot=alert-description]:text-destructive/90 *:[svg]:text-current`}},defaultVariants:{variant:`default`}});function He({className:e,variant:t,...n}){return(0,V.jsx)(`div`,{"data-slot":`alert`,role:`alert`,className:w(Ve({variant:t}),e),...n})}function Ue({className:e,...t}){return(0,V.jsx)(`div`,{"data-slot":`alert-title`,className:w(`font-medium group-has-[>svg]/alert:col-start-2 [&_a]:underline [&_a]:underline-offset-3 [&_a]:hover:text-foreground`,e),...t})}function We({className:e,...t}){return(0,V.jsx)(`div`,{"data-slot":`alert-description`,className:w(`text-sm text-balance text-muted-foreground md:text-pretty [&_a]:underline [&_a]:underline-offset-3 [&_a]:hover:text-foreground [&_p:not(:last-child)]:mb-4`,e),...t})}function Ge({session:e,thread:t,onClose:n,ErrorFeedback:r,LoadingFeedback:i}){let[a,o]=(0,R.useState)(null),s=h({queryKey:[`directory-history`,t.tenant_id,t.id],initialPageParam:void 0,queryFn:({pageParam:n,signal:r})=>Ie(e,t.tenant_id,t.id,n,r),getNextPageParam:e=>e.page_after??void 0}),c=(0,R.useCallback)(async(n,r)=>{try{return await Le(e,t.tenant_id,t.id,n,r,e.abortController.signal)}catch(e){throw I(e)&&[401,403,404].includes(e.status)&&o(e),e}},[e,t.tenant_id,t.id]),l=(0,R.useMemo)(()=>{let e=se(s.data?.pages.toReversed().flatMap(e=>e.messages)??[]);for(let t of e)for(let e of t.parts)e.type===`tool-call`&&(e.input=me(e.arguments),e.state??=`input-complete`);return e},[s.data]),u=a??s.error,f=I(u)&&[401,403,404].includes(u.status),p=s.data?.pages[0]?.thread??t;return(0,V.jsxs)(`section`,{"data-slot":`directory-transcript`,"aria-label":`Saved conversation`,className:`flex min-h-96 flex-col gap-4`,children:[(0,V.jsxs)(`header`,{className:`flex flex-wrap items-center gap-3`,children:[(0,V.jsxs)(L,{variant:`outline`,size:`sm`,onClick:n,children:[(0,V.jsx)(Ce,{"aria-hidden":!0}),`Back to conversations`]}),(0,V.jsxs)(`div`,{className:`min-w-0`,children:[(0,V.jsx)(`h3`,{className:`break-words font-semibold`,children:p.title||`Untitled conversation`}),(0,V.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`Saved conversation · Read only`})]})]}),u&&(0,V.jsx)(r,{error:u,retry:()=>{(a||!s.isFetchNextPageError?s.refetch():s.fetchNextPage()).then(e=>{e.isSuccess&&o(null)})}}),s.isPending?(0,V.jsx)(i,{}):s.data&&!f?(0,V.jsx)(`div`,{className:`h-[32rem] min-h-64 overflow-hidden rounded-lg border border-foreground/10 bg-background text-foreground [--card-spacing:--spacing(4)]`,children:(0,V.jsx)(d,{messages:l,apiUrl:e.options.apiUrl??`https://astralbeam.ai/api`,widgets:{},toolTitles:{},activeSlots:new Map,interactiveToolIds:new Set,readOnly:!0,getAttachment:c,hasOlder:s.hasNextPage&&!s.isError,loadingHistory:s.isFetching,loadingOlder:s.isFetchingNextPage,onLoadOlder:async()=>{await s.fetchNextPage({cancelRefetch:!1})},isBusy:s.isFetching,awaitingReply:!1,onQuestionnaireAnswers:()=>{}})}):null]})}function Ke(e){return qe(e)||typeof e==`function`||Je(e)}function qe(e){return typeof e==`function`&&(()=>{let t=Object.getPrototypeOf(e);return t.prototype&&t.prototype.isReactComponent})()}function Je(e){return typeof e==`object`&&typeof e.$$typeof==`symbol`&&[`react.memo`,`react.forward_ref`].includes(e.$$typeof.description)}function U(e,t){return e==null?null:Ke(e)?R.createElement(e,t):e}function Ye(e){if(`cell`in e&&e.cell){let t=e.cell,n=t.column.columnDef,r=t,i=n;return r.getIsAggregated?.()?U(i.aggregatedCell??n.cell,t.getContext()):r.getIsPlaceholder?.()?null:U(n.cell,t.getContext())}return`header`in e&&e.header?U(e.header.column.columnDef.header,e.header.getContext()):`footer`in e&&e.footer?U(e.footer.column.columnDef.footer,e.footer.getContext()):null}function Xe(e){let t=C(e.source,e.selector,{compare:c});return typeof e.children==`function`?e.children(t):e.children}function Ze(e){let t=e;return Object.defineProperty(e,"state",{get(){return e.get()}}),`set`in e&&(t.setState=e.set.bind(e)),t}function Qe(e){let{createAtom:t,batch:n}=e,r=t(0);return{createOptionsStore:!1,wrapExternalAtoms:!1,addSubscription:()=>{throw Error(`Feature not supported in current reactivity implementation`)},unmount:()=>{throw Error(`Feature not supported in current reactivity implementation`)},schedule:e.schedule??(e=>queueMicrotask(e)),batch:n,untrack:e=>e(),createReadonlyAtom:(e,n)=>{let i=n?.compare??Object.is,a=!1,o,s=()=>{let t=e();return(!a||!i(o,t))&&(o=t,a=!0),o},c=t(()=>(r.get(),s()),{compare:i});return{get:s,subscribe:c.subscribe.bind(c)}},createWritableAtom:(e,n)=>t(e,{compare:n?.compare}),commit:()=>{r.set(e=>e+1)}}}function $e(e,t=Object.is){let n=!1,r;return{get:e.get,markCommitted:e=>{r=e,n=!0},subscribe:i=>e.subscribe(e=>{(!n||!t(r,e))&&i(e)})}}function et(){return Qe({createAtom:T,batch:S})}function tt(e,t){return typeof e==`function`?e(t):e}function W(e){if(Array.isArray(e))return e.map(W);if(e&&typeof e==`object`){let t=Object.getPrototypeOf(e);if(t!==Object.prototype&&t!==null)return e;let n=t===null?G():{},r=Object.keys(e);for(let t=0;t<r.length;t++){let i=r[t];Object.defineProperty(n,i,{configurable:!0,enumerable:!0,value:W(e[i]),writable:!0})}return n}return e}function G(){return Object.create(null)}function K(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function nt(e){if(typeof e!=`object`||!e)return!1;if(Array.isArray(e))return!0;let t=Object.getPrototypeOf(e);return t===Object.prototype||t===null}function rt(e){return Reflect.ownKeys(e).filter(t=>Object.prototype.propertyIsEnumerable.call(e,t))}function it(e,t){return at(e,t,3)}function at(e,t,n){if(Object.is(e,t))return!0;if(n<=0||!nt(e)||!nt(t)||(Array.isArray(e)||Array.isArray(t))&&(!Array.isArray(e)||!Array.isArray(t)||e.length!==t.length))return!1;let r=rt(e),i=rt(t);if(r.length!==i.length)return!1;let a=e,o=t;for(let e=0;e<r.length;e++){let i=r[e];if(!Object.prototype.propertyIsEnumerable.call(t,i)||!at(a[i],o[i],n-1))return!1}return!0}function q(e,t,n,r=it){let i=`on${t.charAt(0).toUpperCase()}${t.slice(1)}Change`,a=e.options[i];a&&a(e=>{let t=tt(n,e);return r(e,t)?e:t})}function ot(e,t){let n=[],r=e=>{e.forEach(e=>{n.push(e);let i=t(e);i.length&&r(i)})};return r(e),n}const st=({fn:e,memoDeps:t,onAfterCompare:n,onAfterUpdate:r,onBeforeCompare:i,onBeforeUpdate:a})=>{let o=[],s;return c=>{i?.();let l=t?.(c),u=!l||l.length!==o?.length;if(!u&&l){for(let e=0;e<l.length;e++)if(l[e]!==o[e]){u=!0;break}}return n?.(u),u?(o=l,a?.(),s=e(...l??[]),r?.(s),s):s}};function ct(e){let t=!1;return()=>{if(!t){t=!0;return}e()}}function lt({feature:e,fnName:t,objectId:n,onAfterUpdate:r,table:i,...a}){let o=()=>{if(!r)return;let{schedule:e,untrack:t}=i._reactivity;e(()=>t(()=>r()))},s={onAfterUpdate:()=>{o()}};return st({...a,...s})}function ut(e,t=`_`){let[n,r]=e.split(t);return{fnKey:r,fnName:`${n}.${r}`,parentName:n}}function J(e,t,n){for(let[r,{fn:i,memoDeps:a}]of Object.entries(n)){let{fnKey:n,fnName:o}=ut(r);t[n]=a?lt({memoDeps:a,fn:i,fnName:o,table:t,feature:e}):i}}function Y(e,t,n,r){for(let[i,{fn:a,memoDeps:o}]of Object.entries(r)){let{fnKey:r,fnName:s}=ut(i);if(o){let i=`_memo_${r}`;t[r]=function(...t){if(!this[i]){let t=this;this[i]=lt({memoDeps:e=>o(t,e),fn:(...e)=>a(t,...e),fnName:s,objectId:t.id,table:n,feature:e})}return this[i](...t)}}else t[r]=function(...e){return a(this,...e)}}}function X(e,t,n,...r){return e[t]?.(...r)??n(e,...r)}function dt(e){return e.row.getValue(e.column.id)}function ft(e){return e.getValue()??e.table.options.renderFallbackValue}function pt(e){return{table:e.table,column:e.column,row:e.row,cell:e,getValue:()=>e.getValue(),renderValue:()=>e.renderValue()}}const mt={assignCellPrototype:(e,t)=>{Y(`coreCellsFeature`,e,t,{cell_getValue:{fn:e=>dt(e)},cell_renderValue:{fn:e=>ft(e)},cell_getContext:{fn:e=>pt(e),memoDeps:e=>[e]}})}};function ht(e){if(!e._headerPrototype){e._headerPrototype={table:e};let t=Object.values(e._features);for(let n=0;n<t.length;n++)t[n].assignHeaderPrototype?.(e._headerPrototype,e)}return e._headerPrototype}function gt(e,t,n){let r=ht(e),i=Object.create(r);i.colSpan=0,i.column=t,i.depth=n.depth,i.headerGroup=null,i.id=n.id??t.id,i.index=n.index,i.isPlaceholder=!!n.isPlaceholder,i.placeholderId=n.placeholderId,i.rowSpan=0,i.subHeaders=[];let a=e._headerInstanceInitFns;for(let e=0;e<a.length;e++)a[e](i);return i}function _t(){return{start:[],end:[]}}function Z(e){let t=e.table.atoms.columnVisibility?.get();if(!t)return!0;let n=e.columns;return n.length?n.some(e=>X(e,`getIsVisible`,Z)):(K(t,e.id)?t[e.id]:void 0)??!0}function vt(e){return e.getAllLeafColumns().filter(e=>X(e,`getIsVisible`,Z))}function yt(e,t=1){let n=t;for(let r=0;r<e.length;r++){let i=e[r];X(i,`getIsVisible`,Z)&&i.columns.length&&(n=Math.max(n,yt(i.columns,t+1)))}return n}function bt(e,t){return e?`${e}_${t}`:String(t)}function xt(e,t,n,r){let i=e??``;return t&&(i=i?`${i}_${t}`:String(t)),n&&(i=i?`${i}_${n}`:n),r&&(i=i?`${i}_${r}`:r),i}function St(e,t){let n=0;for(let r=0;r<e.length;r++)e[r].column===t&&n++;return n}function Ct(e,t,n,r,i,a){let o={depth:t,id:bt(r,t),headers:[]},s=[];for(let i=0;i<e.length;i++){if(!(i in e))continue;let a=e[i],c=s[s.length-1],l=a.column.depth===o.depth,u,d=!1;if(l&&a.column.parent?u=a.column.parent:(u=a.column,d=!0),c&&c.column===u)c.subHeaders.push(a);else{let e=gt(n,u,{id:xt(r,t,u.id,a.id),isPlaceholder:d,placeholderId:d?String(St(s,u)):void 0,depth:t,index:s.length});e.subHeaders.push(a),s.push(e)}o.headers.push(a),a.headerGroup=o}for(let e=0;e<a.length;e++)a[e](o);i.push(o),t>0&&Ct(s,t-1,n,r,i,a)}function wt(e){for(let t=0;t<e.length;t++){let n=e[t];if(!X(n.column,`getIsVisible`,Z))continue;let r=0;if(n.subHeaders.length){wt(n.subHeaders);for(let e=0;e<n.subHeaders.length;e++){let t=n.subHeaders[e];X(t.column,`getIsVisible`,Z)&&(r+=t.colSpan)}}else r=1;if(n.colSpan=r,n.isPlaceholder&&n.subHeaders.length===1&&n.subHeaders[0].column===n.column){let e=1,t=n.subHeaders[0];for(;t;)t.rowSpan=0,e++,t=t.subHeaders.length===1&&t.subHeaders[0].column===n.column?t.subHeaders[0]:void 0;n.rowSpan=e}else n.rowSpan=1}}function Tt(e,t,n,r){let i=yt(e),a=[],o=n._headerGroupInstanceInitFns,s=Array(t.length);for(let e=0;e<t.length;e++)e in t&&(s[e]=gt(n,t[e],{depth:i,index:e}));return Ct(s,i-1,n,r,a,o),a.reverse(),wt(a[0]?.headers??[]),a}function Et(e){if(!e._columnPrototype){e._columnPrototype={table:e};let t=Object.values(e._features);for(let n=0;n<t.length;n++)t[n].assignColumnPrototype?.(e._columnPrototype,e)}return e._columnPrototype}function Dt(e,t,n,r){let i={...e.getDefaultColumnDef(),...t},a=i.accessorKey,o=a===void 0?void 0:String(a),s=i.id??o?.replaceAll(`.`,`_`)??(typeof i.header==`string`?i.header:void 0),c;if(i.accessorFn)c=i.accessorFn;else if(a!==void 0)if(typeof a==`string`&&a.includes(`.`)){let e=a.split(`.`);c=t=>{let n=t;for(let t=0;t<e.length;t++){let r=e[t];n=n?.[r]}return n}}else c=e=>e[i.accessorKey];if(!s)throw Error();let l=Et(e),u=Object.create(l);u.accessorFn=c,u.columnDef=i,u.columns=[],u.depth=n,u.id=`${String(s)}`,u.parent=r;let d=e._columnInstanceInitFns;for(let e=0;e<d.length;e++)d[e](u);return u}function Ot(e){let t=e.atoms.columnOrder?.get();return n=>{let r=[];if(!t?.length)r=n;else{let e=new Map;for(let t=0;t<n.length;t++){let r=n[t];e.set(r.id,r)}for(let n=0;n<t.length;n++){let i=t[n],a=e.get(i);a&&(r.push(a),e.delete(i))}for(let t=0;t<n.length;t++){let i=n[t];e.has(i.id)&&r.push(i)}}return kt(e,r)}}function kt(e,t){let n=e.atoms.grouping?.get()??[],{groupedColumnMode:r}=e.options;if(!n.length||!r)return t;let i=t.filter(e=>!n.includes(e.id));if(r===`remove`)return i;let a=new Map;for(let e=0;e<t.length;e++){let n=t[e];a.set(n.id,n)}let o=[];for(let e=0;e<n.length;e++){let t=a.get(n[e]);t&&o.push(t)}return[...o,...i]}function At(e){return[e,...e.columns.flatMap(e=>e.getFlatColumns())]}function jt(e){if(e.columns.length){let t=e.columns.flatMap(e=>e.getLeafColumns());return X(e.table,`getOrderColumns`,Ot)(t)}return[e]}function Mt(e){return{header:e=>{let t=e.header.column.columnDef;return t.accessorKey?t.accessorKey:t.accessorFn?t.id:null},cell:e=>e.renderValue()?.toString?.()??null,...Object.values(e._features).reduce((e,t)=>Object.assign(e,t.getDefaultColumnDef?.()),{}),...e.options.defaultColumn}}function Nt(e,t,n,r=0){let i=Array(t.length);for(let a=0;a<t.length;a++){if(!(a in t))continue;let o=t[a],s=Dt(e,o,r,n),c=o;s.columns=c.columns?Nt(e,c.columns,s,r+1):[],i[a]=s}return i}function Pt(e){return Nt(e,e.options.columns)}function Ft(e){return e.getAllColumns().flatMap(e=>e.getFlatColumns())}function It(e){let t=G(),n=e.getAllFlatColumns();for(let e=0;e<n.length;e++){let r=n[e];t[r.id]=r}return t}function Lt(e){let t=e.getAllColumns().flatMap(e=>e.getLeafColumns());return X(e,`getOrderColumns`,Ot)(t)}function Rt(e){let t=G(),n=e.getAllLeafColumns();for(let e=0;e<n.length;e++){let r=n[e];t[r.id]=r}return t}function zt(e,t){return e.getAllFlatColumnsById()[t]}const Bt={assignColumnPrototype:(e,t)=>{Y(`coreColumnsFeature`,e,t,{column_getFlatColumns:{fn:e=>At(e),memoDeps:e=>[e.table.options.columns]},column_getLeafColumns:{fn:e=>jt(e),memoDeps:e=>[e.table.atoms.columnOrder?.get(),e.table.atoms.grouping?.get(),e.table.options.columns,e.table.options.groupedColumnMode]}})},constructTableAPIs:e=>{J(`coreColumnsFeature`,e,{table_getDefaultColumnDef:{fn:()=>Mt(e),memoDeps:()=>[e.options.defaultColumn]},table_getAllColumns:{fn:()=>Pt(e),memoDeps:()=>[e.options.columns]},table_getAllFlatColumns:{fn:()=>Ft(e),memoDeps:()=>[e.options.columns]},table_getAllFlatColumnsById:{fn:()=>It(e),memoDeps:()=>[e.options.columns]},table_getAllLeafColumns:{fn:()=>Lt(e),memoDeps:()=>[e.atoms.columnOrder?.get(),e.atoms.grouping?.get(),e.options.columns,e.options.groupedColumnMode]},table_getAllLeafColumnsById:{fn:()=>Rt(e),memoDeps:()=>[e.getAllLeafColumns()]},table_getColumn:{fn:t=>zt(e,t)}})}};function Vt(e,t){for(let n=0;n<e.subHeaders.length;n++)Vt(e.subHeaders[n],t);t.push(e)}function Ht(e){let t=[];return Vt(e,t),t}function Ut(e){return{column:e.column,header:e,table:e.column.table}}function Wt(e){let{start:t,end:n}=e.atoms.columnPinning?.get()??_t(),r=e.getAllColumns(),i=X(e,`getVisibleLeafColumns`,vt);if(!t.length&&!n.length)return Tt(r,i,e);let a=e.getAllLeafColumnsById(),o=[];for(let e=0;e<t.length;e++){let n=a[t[e]];n&&X(n,`getIsVisible`,Z)&&o.push(n)}let s=[];for(let e=0;e<n.length;e++){let t=a[n[e]];t&&X(t,`getIsVisible`,Z)&&s.push(t)}let c=i.filter(e=>!t.includes(e.id)&&!n.includes(e.id));return Tt(r,[...o,...c,...s],e)}function Gt(e){return[...e.getHeaderGroups()].reverse()}function Kt(e){let t=e.getHeaderGroups(),n=[];for(let e=0;e<t.length;e++){let r=t[e].headers;for(let e=0;e<r.length;e++)n.push(r[e])}return n}function qt(e){let t=e.getHeaderGroups()[0]?.headers??[],n=[];for(let e=0;e<t.length;e++){let r=t[e].getLeafHeaders();for(let e=0;e<r.length;e++)n.push(r[e])}return n}const Jt={assignHeaderPrototype:(e,t)=>{Y(`coreHeadersFeature`,e,t,{header_getLeafHeaders:{fn:e=>Ht(e),memoDeps:e=>[e.column.table.options.columns]},header_getContext:{fn:e=>Ut(e),memoDeps:e=>[e.column.table.options.columns]}})},constructTableAPIs:e=>{J(`coreHeadersFeature`,e,{table_getHeaderGroups:{fn:()=>Wt(e),memoDeps:()=>[e.options.columns,e.atoms.columnOrder?.get(),e.atoms.grouping?.get(),e.atoms.columnPinning?.get(),e.atoms.columnVisibility?.get(),e.options.groupedColumnMode]},table_getFooterGroups:{fn:()=>Gt(e),memoDeps:()=>[e.getHeaderGroups()]},table_getFlatHeaders:{fn:()=>Kt(e),memoDeps:()=>[e.getHeaderGroups()]},table_getLeafHeaders:{fn:()=>qt(e),memoDeps:()=>[e.getHeaderGroups()]}})}};function Yt(e){if(!e._rowPrototype){e._rowPrototype={table:e};let t=Object.values(e._features);for(let n=0;n<t.length;n++)t[n].assignRowPrototype?.(e._rowPrototype,e)}return e._rowPrototype}const Xt=(e,t,n,r,i,a,o)=>{let s=Yt(e),c=Object.create(s);c._displayIndexCache=-1,c._uniqueValuesCache=G(),c._valuesCache=G(),c.depth=i,c.id=t,c.index=r,c.original=n,c.parentId=o,c.subRows=a??[];let l=e._rowInstanceInitFns;for(let e=0;e<l.length;e++)l[e](c);return c};function Zt(){return[]}function Qt(e,t){q(e,`cellSelection`,t?Zt():W(e.initialState.cellSelection)??Zt())}function $t(e){e.atoms.cellSelection&&(e.options.autoResetAll??e.options.autoResetCellSelection??!0)&&e._reactivity.schedule(()=>Qt(e))}function en(e){e.atoms.expanded&&(e.options.autoResetAll??e.options.autoResetExpanded??!e.options.manualExpanding)&&e._reactivity.schedule(()=>tn(e))}function tn(e,t){let n=e.initialState.expanded;q(e,`expanded`,t?G():n===!0||Object.assign(G(),W(n??{})))}function nn(e){if(e.options.autoResetAll??e.options.autoResetPageIndex??!e.options.manualPagination){if((e.atoms.pagination?.get()?.pageIndex??0)===0)return;on(e,!0)}}function rn(e,t){q(e,`pagination`,t)}function an(e,t){rn(e,n=>{let r=tt(t,n.pageIndex),i=e.options.pageCount===void 0||e.options.pageCount===-1?2**53-1:e.options.pageCount-1;return r=Math.max(0,Math.min(r,i)),{...n,pageIndex:r}})}function on(e,t){an(e,t?0:e.initialState.pagination?.pageIndex??0)}function sn(e,t){q(e,`sorting`,t)}function cn(e,t){sn(e,t?[]:W(e.initialState.sorting??[]))}function ln(e){e.atoms.sorting&&(e.options.autoResetAll??e.options.autoResetSorting??!1)&&cn(e)}function un(){return e=>lt({feature:`coreRowModelsFeature`,table:e,fnName:`table.getCoreRowModel`,memoDeps:()=>[e.options.data],fn:()=>fn(e,e.options.data),onAfterUpdate:ct(()=>{en(e),nn(e),ln(e),$t(e)})})}function dn(e,t,n,r=0,i){let a=[];for(let o=0;o<n.length;o++){let s=n[o],c=Xt(e,e.getRowId(s,o,i),s,o,r,void 0,i?.id);t.flatRows.push(c),t.rowsById[c.id]=c,a.push(c),e.options.getSubRows&&(c.originalSubRows=e.options.getSubRows(s,o),c.originalSubRows?.length&&(c.subRows=dn(e,t,c.originalSubRows,r+1,c)))}return a}function fn(e,t){let n={rows:[],flatRows:[],rowsById:G()};return n.rows=dn(e,n,t),n}function pn(e){return e._rowModels.coreRowModel||(e._rowModels.coreRowModel=e.options.features.coreRowModel?.(e)??un()(e)),e._rowModels.coreRowModel()}function mn(e){return e.getCoreRowModel()}function hn(e){return e._rowModels.filteredRowModel||(e._rowModels.filteredRowModel=e.options.features.filteredRowModel?.(e)),e.options.manualFiltering||!e._rowModels.filteredRowModel?e.getPreFilteredRowModel():e._rowModels.filteredRowModel()}function gn(e){return e.getFilteredRowModel()}function _n(e){return e._rowModels.groupedRowModel||(e._rowModels.groupedRowModel=e.options.features.groupedRowModel?.(e)),e.options.manualGrouping||!e._rowModels.groupedRowModel?e.getPreGroupedRowModel():e._rowModels.groupedRowModel()}function vn(e){return e.getGroupedRowModel()}function yn(e){return e._rowModels.sortedRowModel||(e._rowModels.sortedRowModel=e.options.features.sortedRowModel?.(e)),e.options.manualSorting||!e._rowModels.sortedRowModel?e.getPreSortedRowModel():e._rowModels.sortedRowModel()}function bn(e){return e.getSortedRowModel()}function xn(e){return e._rowModels.expandedRowModel||(e._rowModels.expandedRowModel=e.options.features.expandedRowModel?.(e)),e.options.manualExpanding||!e._rowModels.expandedRowModel?e.getPreExpandedRowModel():e._rowModels.expandedRowModel()}function Sn(e){return e.getExpandedRowModel()}function Cn(e){return e._rowModels.paginatedRowModel||(e._rowModels.paginatedRowModel=e.options.features.paginatedRowModel?.(e)),e.options.manualPagination||!e._rowModels.paginatedRowModel?e.getPrePaginatedRowModel():e._rowModels.paginatedRowModel()}function wn(e){return e.getPaginatedRowModel()}const Tn={constructTableAPIs:e=>{J(`coreRowModelsFeature`,e,{table_getCoreRowModel:{fn:()=>pn(e)},table_getPreFilteredRowModel:{fn:()=>mn(e)},table_getFilteredRowModel:{fn:()=>hn(e)},table_getPreGroupedRowModel:{fn:()=>gn(e)},table_getGroupedRowModel:{fn:()=>_n(e)},table_getPreSortedRowModel:{fn:()=>vn(e)},table_getSortedRowModel:{fn:()=>yn(e)},table_getPreExpandedRowModel:{fn:()=>bn(e)},table_getExpandedRowModel:{fn:()=>xn(e)},table_getPrePaginatedRowModel:{fn:()=>Sn(e)},table_getPaginatedRowModel:{fn:()=>Cn(e)},table_getRowModel:{fn:()=>wn(e)}})}};function En(e){if(!e._cellPrototype){e._cellPrototype={table:e};let t=Object.values(e._features);for(let n=0;n<t.length;n++)t[n].assignCellPrototype?.(e._cellPrototype,e)}return e._cellPrototype}function Dn(e,t,n){let r=En(n),i=Object.create(r);i.column=e,i.id=`${t.id}_${e.id}`,i.row=t;let a=n._cellInstanceInitFns;for(let e=0;e<a.length;e++)a[e](i);return i}function On(e){let t=e.table.getRowsInDisplayOrder(),n=e._displayIndexCache;return t[n]===e?n:-1}function kn(e){let t=e.getPrePaginatedRowModel().rows;if(e.options.paginateExpandedRows===!1){let e=[],n=t=>{t._displayIndexCache=e.length,e.push(t),t.subRows.length&&t.getIsExpanded?.()&&t.subRows.forEach(n)};return t.forEach(n),e}for(let e=0;e<t.length;e++)t[e]._displayIndexCache=e;return t}function An(e,t){if(K(e._valuesCache,t))return e._valuesCache[t];let n=e.table.getColumn(t);if(n?.accessorFn)return e._valuesCache[t]=n.accessorFn(e.original,e.index),e._valuesCache[t]}function jn(e,t){if(K(e._uniqueValuesCache,t))return e._uniqueValuesCache[t];let n=e.table.getColumn(t);if(n?.accessorFn)return n.columnDef.getUniqueValues?(e._uniqueValuesCache[t]=n.columnDef.getUniqueValues(e.original,e.index),e._uniqueValuesCache[t]):(e._uniqueValuesCache[t]=[e.getValue(t)],e._uniqueValuesCache[t])}function Mn(e,t){return e.getValue(t)??e.table.options.renderFallbackValue}function Nn(e){return ot(e.subRows,e=>e.subRows)}function Pn(e){let t=e.getCoreRowModel().flatRows,n=0;for(let e=0;e<t.length;e++)n=Math.max(n,t[e].depth);return n}function Fn(e){if(e.parentId)return e.table.getCoreRowModel().rowsById[e.parentId]??e.table.getRow(e.parentId,!0)}function In(e){let t=[],n=e;for(;;){let e=n.getParentRow();if(!e)break;t.push(e),n=e}return t.reverse()}function Ln(e){let t=e.table.getAllLeafColumns(),n=e._cellsCache;n||=e._cellsCache=new WeakMap;let r=Array(t.length);for(let i=0;i<t.length;i++){let a=t[i],o=n.get(a);o||(o=Dn(a,e,e.table),n.set(a,o)),r[i]=o}return r}function Rn(e){let t=G(),n=e.getAllCells();for(let e=0;e<n.length;e++){let r=n[e];t[r.column.id]=r}return t}function zn(e,t,n,r){return t.options.getRowId?.(e,n,r)??(r?`${r.id}.${n}`:String(n))}function Bn(e,t,n){let r=(n?e.getPrePaginatedRowModel():e.getRowModel()).rowsById[t];if(!r&&(r=e.getCoreRowModel().rowsById[t],!r))throw Error();return r}const Vn={assignRowPrototype:(e,t)=>{Y(`coreRowsFeature`,e,t,{row_getDisplayIndex:{fn:e=>On(e)},row_getAllCellsByColumnId:{fn:e=>Rn(e),memoDeps:e=>[e.getAllCells()]},row_getAllCells:{fn:e=>Ln(e),memoDeps:e=>[e.table.getAllLeafColumns()]},row_getLeafRows:{fn:e=>Nn(e),memoDeps:e=>[e.subRows]},row_getParentRow:{fn:e=>Fn(e)},row_getParentRows:{fn:e=>In(e)},row_getUniqueValues:{fn:(e,t)=>jn(e,t)},row_getValue:{fn:(e,t)=>An(e,t)},row_renderValue:{fn:(e,t)=>Mn(e,t)}})},constructTableAPIs:e=>{J(`coreRowsFeature`,e,{table_getRowsInDisplayOrder:{fn:()=>kn(e),memoDeps:()=>[e.getPrePaginatedRowModel().rows,e.options.paginateExpandedRows,e.options.paginateExpandedRows===!1?e.atoms.expanded?.get():void 0]},table_getRowId:{fn:(t,n,r)=>zn(t,e,n,r)},table_getRow:{fn:(t,n)=>Bn(e,t,n)},table_getMaxSubRowDepth:{fn:()=>Pn(e),memoDeps:()=>[e.getCoreRowModel()]}})}};function Hn(e,t,n=(e,t)=>e===t){let r=t===void 0?e.options.state:t;e._reactivity.batch(()=>{if(r)for(let t in r){let i=e.baseAtoms[t];if(!i)continue;let a=r[t],o=a===void 0?e.initialState[t]:a;n(e._reactivity.untrack(()=>i.get()),o)||i.set(()=>o)}})}function Un(e,t,n=(e,t)=>e===t){e._reactivity.batch(()=>{Hn(e,t,n),e._reactivity.commit?.()})}function Wn(e){let t=W(e.initialState);e._reactivity.batch(()=>{let n=Object.keys(t);for(let r=0;r<n.length;r++){let i=n[r];e.baseAtoms[i].set(t[i])}});let n=Object.values(e._features);for(let t=0;t<n.length;t++)n[t].resetTableInstanceData?.(e)}function Gn(e,t){let{features:n,atoms:r,initialState:i}=e.options;if(!e.options.mergeOptions)return{...e.options,...t,features:n,atoms:r,initialState:i};let a=e.options.mergeOptions(e.options,t),o={...Object.getOwnPropertyDescriptors(a)};return Object.defineProperties(Object.create(Object.getPrototypeOf(a)),{...o,features:{value:n,enumerable:!0,configurable:!0,writable:!0},atoms:{value:r,enumerable:!0,configurable:!0,writable:!0},initialState:{value:i,enumerable:!0,configurable:!0,writable:!0}})}function Kn(e,t,n){let r=Gn(e,tt(t,e.options));e.optionsStore?e.optionsStore.set(()=>r):e.options=r,n?.syncExternalState!==!1&&Un(e,r.state??null)}const qn={coreCellsFeature:mt,coreColumnsFeature:Bt,coreHeadersFeature:Jt,coreRowModelsFeature:Tn,coreRowsFeature:Vn,coreTablesFeature:{constructTableAPIs:e=>{J(`coreTablesFeature`,e,{table_reset:{fn:()=>Wn(e)},table_setOptions:{fn:t=>Kn(e,t)}})}}};function Jn(e){return e}function Yn(e,t={}){return Object.values(e).forEach(e=>{t=e.getInitialState?.(t)??t}),W(t)}function Xn(e){let t=e.features.coreReactivityFeature,{aggregationFns:n,columnMeta:r,coreRowModel:i,expandedRowModel:a,facetedMinMaxValues:o,facetedRowModel:s,facetedUniqueValues:l,filterFns:u,filterMeta:d,filteredRowModel:f,groupedRowModel:p,paginatedRowModel:m,sortFns:h,sortedRowModel:g,tableMeta:ee,..._}=e.features,v={_cellInstanceInitFns:[],_columnInstanceInitFns:[],_features:{...qn,..._},_headerGroupInstanceInitFns:[],_headerInstanceInitFns:[],_reactivity:t,_rowInstanceInitFns:[],_rowModelFns:{aggregationFns:n,filterFns:u,sortFns:h},_rowModels:{},atoms:{},baseAtoms:{}},y=Object.values(v._features),b={...y.reduce((e,t)=>Object.assign(e,t.getDefaultTableOptions?.(v)),{}),...e};if(t.wrapExternalAtoms&&b.atoms)for(let[e,n]of Object.entries(b.atoms)){let r=n,i=t.createWritableAtom(r.get(),{debugName:`externalAtom/${e}`});b.atoms[e]=i;let a=!1,o=r.subscribe(e=>{a||i.set(e)}),s=i.subscribe(e=>{a=!0,r.set(e),a=!1});t.addSubscription(o),t.addSubscription(s)}t.createOptionsStore?(v.optionsStore=t.createWritableAtom(b,{debugName:`table/optionsStore`}),Object.defineProperty(v,"options",{configurable:!0,enumerable:!0,get(){return v.optionsStore.get()},set(e){v.optionsStore.set(()=>e)}})):v.options=b,v.initialState=Yn(v._features,v.options.initialState);let x=Object.keys(v.initialState);for(let e=0;e<x.length;e++){let n=x[e];v.baseAtoms[n]=t.createWritableAtom(v.initialState[n],{debugName:`table/baseAtoms/${n}`}),v.atoms[n]=t.createReadonlyAtom(()=>{let e=v.options,t=e.atoms?.[n],r=t?t.get():v.baseAtoms[n].get();if(t)return r;let i=e.state;if(i&&K(i,n)){let e=i[n];return e===void 0?v.initialState[n]:e}return r},{debugName:`table/atoms/${n}`})}Hn(v),v.store=Ze(t.createReadonlyAtom(()=>{let e={};for(let t=0;t<x.length;t++){let n=x[t];e[n]=v.atoms[n].get()}return e},{compare:c,debugName:`table/store`}));for(let e=0;e<y.length;e++){let t=y[e];t.initTableInstanceData?.(v),t.initCellInstanceData&&v._cellInstanceInitFns.push(t.initCellInstanceData.bind(t)),t.initColumnInstanceData&&v._columnInstanceInitFns.push(t.initColumnInstanceData.bind(t)),t.initHeaderGroupInstanceData&&v._headerGroupInstanceInitFns.push(t.initHeaderGroupInstanceData.bind(t)),t.initHeaderInstanceData&&v._headerInstanceInitFns.push(t.initHeaderInstanceData.bind(t)),t.initRowInstanceData&&v._rowInstanceInitFns.push(t.initRowInstanceData.bind(t)),t.constructTableAPIs?.(v)}return v}const Zn=typeof window>`u`?R.useEffect:R.useLayoutEffect;function Qn(e,t){let[{table:n,rootSource:r}]=(0,R.useState)(()=>{let t=Xn({...e,features:{coreReactivityFeature:et(),...e.features}});return t.Subscribe=(e=>Xe({...e,source:e.source??t.store})),t.FlexRender=Ye,{table:t,rootSource:$e(t.store,c)}}),i=n;Kn(i,t=>({...t,...e}),{syncExternalState:!1});let a=i.options.state,o=r.get(),s=C(r,t,{compare:c});return Zn(()=>{r.markCommitted(o),Un(i,a??null,c)}),(0,R.useMemo)(()=>({...n,options:e,state:s}),[n,e,s])}function $n({className:e,...t}){return(0,V.jsx)(`div`,{"data-slot":`table-container`,className:`relative w-full overflow-x-auto`,children:(0,V.jsx)(`table`,{"data-slot":`table`,className:w(`w-full caption-bottom text-sm`,e),...t})})}function er({className:e,...t}){return(0,V.jsx)(`thead`,{"data-slot":`table-header`,className:w(`[&_tr]:border-b`,e),...t})}function tr({className:e,...t}){return(0,V.jsx)(`tbody`,{"data-slot":`table-body`,className:w(`[&_tr:last-child]:border-0`,e),...t})}function nr({className:e,...t}){return(0,V.jsx)(`tr`,{"data-slot":`table-row`,className:w(`border-b transition-colors hover:bg-muted/50 has-aria-expanded:bg-muted/50 data-[state=selected]:bg-muted`,e),...t})}function rr({className:e,...t}){return(0,V.jsx)(`th`,{"data-slot":`table-head`,className:w(`h-10 px-2 text-start align-middle font-medium whitespace-nowrap text-foreground [&:has([role=checkbox])]:pe-0`,e),...t})}function ir({className:e,...t}){return(0,V.jsx)(`td`,{"data-slot":`table-cell`,className:w(`p-2 align-middle whitespace-nowrap [&:has([role=checkbox])]:pe-0`,e),...t})}const ar=l(`group/badge inline-flex h-5 w-fit shrink-0 items-center justify-center gap-1 overflow-hidden rounded-4xl border border-transparent px-2 py-0.5 text-xs font-medium whitespace-nowrap transition-all focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 has-data-[icon=inline-end]:pe-1.5 has-data-[icon=inline-start]:ps-1.5 aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 [&>svg]:pointer-events-none [&>svg]:size-3!`,{variants:{variant:{default:`bg-primary text-primary-foreground [a]:hover:bg-primary/80`,secondary:`bg-secondary text-secondary-foreground [a]:hover:bg-secondary/80`,destructive:`bg-destructive/10 text-destructive focus-visible:ring-destructive/20 dark:bg-destructive/20 dark:focus-visible:ring-destructive/40 [a]:hover:bg-destructive/20`,outline:`border-border text-foreground [a]:hover:bg-muted [a]:hover:text-muted-foreground`,ghost:`hover:bg-muted hover:text-muted-foreground dark:hover:bg-muted/50`,link:`text-primary underline-offset-4 hover:underline`}},defaultVariants:{variant:`default`}});function or({className:e,variant:t=`default`,render:n,...r}){return A({defaultTagName:`span`,props:ie({className:w(ar({variant:t}),e)},r),render:n,state:{slot:`badge`,variant:t}})}const sr=Jn({});function cr({rows:e,kind:t,options:n,filtered:r}){let{onTenantSelect:i,onTenantUserSelect:a,showAdmin:o}=n;return(0,V.jsx)(lr,{rows:e,columns:(0,R.useMemo)(()=>[{accessorKey:`external_id`,header:`ID`,cell:({row:e})=>(0,V.jsx)(`span`,{className:`line-clamp-3 break-all font-mono text-xs whitespace-normal`,children:e.original.external_id})},{id:`name`,header:t===`tenants`?`Tenant`:`User`,cell:({row:e})=>{let n=e.original,r=n.name||n.external_id;return(0,V.jsxs)(`div`,{className:`flex min-w-0 items-center gap-3 py-1`,children:[t===`users`&&(0,V.jsx)(`span`,{"data-slot":`directory-avatar`,"aria-hidden":!0,className:`flex size-8 shrink-0 items-center justify-center rounded-full bg-muted text-xs font-medium uppercase`,children:r.trim().split(/\s+/).slice(0,2).map(e=>Array.from(e)[0]).join(``)}),(0,V.jsx)(`span`,{className:`line-clamp-3 min-w-0 text-start whitespace-normal [overflow-wrap:anywhere]`,children:r})]})}},...t===`users`&&o?[{id:`admin`,header:`Stored admin`,cell:({row:e})=>(0,V.jsx)(or,{variant:`outline`,title:`Stored status does not grant or revoke signed JWT authority`,children:`admin`in e.original&&e.original.admin?`Admin`:`User`})}]:[],{accessorKey:`metadata`,header:`Metadata`,cell:({row:e})=>{let t=Object.entries(e.original.metadata);return t.length?(0,V.jsx)(`dl`,{className:`space-y-1 text-xs whitespace-normal`,children:t.map(([e,t])=>(0,V.jsxs)(`div`,{className:`flex gap-1`,children:[(0,V.jsxs)(`dt`,{className:`line-clamp-3 max-w-1/2 shrink-0 break-all text-muted-foreground`,children:[e,`:`]}),(0,V.jsx)(`dd`,{className:`line-clamp-6 min-w-0 [overflow-wrap:anywhere]`,children:typeof t==`string`?t:JSON.stringify(t)})]},e))}):(0,V.jsx)(`span`,{className:`text-muted-foreground`,children:`No metadata`})}},{accessorKey:`created_at`,header:`Created`,cell:({row:e})=>(0,V.jsx)(`time`,{dateTime:e.original.created_at,title:e.original.created_at,className:`whitespace-nowrap text-muted-foreground`,children:new Date(e.original.created_at).toLocaleDateString()})},...(t===`users`?a:i)?[{id:`actions`,header:``,cell:({row:e})=>{let t=e.original;return(0,V.jsx)(L,{variant:`ghost`,size:`sm`,onClick:()=>`tenant_id`in t?a?.(t):i?.(t),"aria-label":`Open ${t.name||t.external_id}`,title:`Open`,children:(0,V.jsx)(fe,{"aria-hidden":!0})})}}]:[]],[t,i,a,o]),emptyText:r?`No records match your filters.`:`No records yet.`})}function lr({rows:e,columns:t,emptyText:n,getRowId:r=e=>e.id}){let i=(0,R.useId)(),a=Qn({features:sr,data:e,columns:t,getRowId:r});return(0,V.jsxs)($n,{role:`table`,className:`block table-fixed @4xl/directory:table [&_th]:h-12 [&_th]:px-4 [&_td]:px-4 [&_td]:py-3`,children:[(0,V.jsx)(er,{role:`rowgroup`,className:`sr-only @4xl/directory:not-sr-only`,children:a.getHeaderGroups().map(e=>(0,V.jsx)(nr,{role:`row`,children:e.headers.map(e=>(0,V.jsx)(rr,{id:`${i}-${e.column.id}`,role:`columnheader`,scope:`col`,className:e.column.id===`actions`?`w-16`:void 0,children:(0,V.jsx)(a.FlexRender,{header:e})},e.id))},e.id))}),(0,V.jsxs)(tr,{role:`rowgroup`,className:`block @4xl/directory:table-row-group`,children:[a.getRowModel().rows.map(e=>(0,V.jsx)(nr,{role:`row`,className:`flex flex-col py-2 @4xl/directory:table-row @4xl/directory:py-0`,children:e.getAllCells().map(e=>(0,V.jsxs)(ir,{role:`cell`,headers:`${i}-${e.column.id}`,className:e.column.id===`name`||e.column.id===`title`?`order-first block min-w-0 font-medium whitespace-normal @4xl/directory:table-cell @4xl/directory:font-normal`:`block min-w-0 whitespace-normal @4xl/directory:table-cell`,children:[e.column.id!==`name`&&e.column.id!==`title`&&e.column.id!==`actions`&&(0,V.jsx)(`span`,{"aria-hidden":!0,className:`mb-1 block text-xs font-medium text-muted-foreground @4xl/directory:hidden`,children:e.column.columnDef.header}),(0,V.jsx)(a.FlexRender,{cell:e})]},e.id))},e.id)),!e.length&&(0,V.jsx)(nr,{role:`row`,className:`block @4xl/directory:table-row`,children:(0,V.jsx)(ir,{role:`cell`,colSpan:a.getAllLeafColumns().length,className:`block content-center h-32 text-center text-muted-foreground @4xl/directory:table-cell`,children:n})})]})]})}function ur({session:e,tenantId:t,q:n,size:r,ErrorFeedback:i,LoadingFeedback:a,Pagination:o}){let[s,c]=(0,R.useState)({}),[l,u]=(0,R.useState)(null),d=z({queryKey:[`threads`,t,n,r,s],queryFn:({signal:i})=>Fe(e,{tenantId:t,q:n,size:r,cursor:s},i)}),f=(0,R.useMemo)(()=>[{id:`participants`,header:`Participants`,cell:({row:e})=>(0,V.jsx)(`div`,{className:`min-w-0 max-w-64 space-y-2 @4xl/directory:min-w-40`,children:e.original.participants.length===0?`No participants`:e.original.participants.map(e=>(0,V.jsxs)(`div`,{children:[(0,V.jsx)(`div`,{className:`line-clamp-3 whitespace-normal [overflow-wrap:anywhere]`,title:e.name||e.external_id,children:e.name||e.external_id}),e.name&&(0,V.jsx)(`div`,{className:`line-clamp-3 break-all font-mono text-xs text-muted-foreground`,title:e.external_id,children:e.external_id})]},e.external_id))})},{id:`title`,header:`Conversation`,cell:({row:e})=>(0,V.jsx)(L,{variant:`link`,className:`h-auto min-w-0 max-w-full @4xl/directory:min-w-48 @4xl/directory:max-w-96 justify-start p-0 text-start whitespace-normal break-words`,onClick:()=>u(e.original),children:e.original.title||`Untitled conversation`})},{id:`activity`,header:`Last activity`,cell:({row:e})=>(0,V.jsx)(`time`,{className:`text-muted-foreground`,dateTime:e.original.updated_at,title:e.original.updated_at,children:new Date(e.original.updated_at).toLocaleString()})}],[]);return l?(0,V.jsx)(Ge,{session:e,thread:l,onClose:()=>u(null),ErrorFeedback:i,LoadingFeedback:a}):(0,V.jsxs)(`div`,{"data-slot":`directory-page`,"aria-busy":d.isFetching,className:`min-w-0 space-y-4`,children:[d.isError?(0,V.jsx)(i,{error:d.error,retry:()=>void d.refetch()}):d.isPending?(0,V.jsx)(a,{}):(0,V.jsx)(`div`,{"data-slot":`directory-table`,className:`overflow-hidden rounded-lg border border-foreground/10 bg-card text-card-foreground`,children:(0,V.jsx)(lr,{rows:d.data.items,columns:f,getRowId:e=>`${e.tenant_id}:${e.id}`,emptyText:n?`No conversations match your filters.`:`No conversations yet.`})}),(0,V.jsx)(`div`,{"data-slot":`directory-pagination`,children:(0,V.jsx)(o,{page:d.isError?void 0:d.data,busy:d.isFetching,onPage:c})})]})}const dr={tenants:{title:`Tenants`,searchLabel:`Search by name or external ID`,Icon:we,tenantPrompt:null,showAdminFilter:!1},users:{title:`Tenant users`,searchLabel:`Search by name or external ID`,Icon:Ee,tenantPrompt:`Select a tenant to view its users.`,showAdminFilter:!0},threads:{title:`Conversations`,Icon:Te,searchLabel:`Search conversations`,tenantPrompt:`Select a tenant to view its conversations.`,showAdminFilter:!1}};function fr({options:e,kind:t,session:n}){let i=dr[t],{Icon:a}=i,o=i.tenantPrompt!==null,s=ge(),c=De(),[l,u]=(0,R.useState)(null),[d,f]=(0,R.useState)(``),[m]=r(d.trim(),{wait:300}),[h,g]=(0,R.useState)(`all`),ee=e.showAdmin?h:`all`,[_,v]=(0,R.useState)(e.pageSize??20),[y,b]=(0,R.useState)(e.pageSize);y!==e.pageSize&&(b(e.pageSize),v(e.pageSize??20));let x=e.scope??`tenant`,S=e.tenantId!==void 0||e.tenantExternalId!==void 0,C=S||o&&x===`tenant`,w=z({queryKey:[`identity-tenant`,e.tenantId,e.tenantExternalId],enabled:C,queryFn:({signal:e})=>Me(n,e)}),T=C?w.data:l,E=T?.id,D=o&&x===`organization`&&!S,O=(o||C)&&!E,k=e.title??i.title;return(0,V.jsxs)(`section`,{"data-slot":`directory`,"aria-label":k,className:`@container/directory flex h-full min-w-0 flex-col gap-4 overflow-y-auto text-foreground`,children:[e.showHeader!==!1&&(0,V.jsxs)(`header`,{"data-slot":`directory-header`,className:`flex items-center gap-3`,children:[(0,V.jsx)(a,{size:22,"aria-hidden":!0}),(0,V.jsxs)(`div`,{className:`min-w-0 [overflow-wrap:anywhere]`,children:[(0,V.jsx)(`h2`,{className:`font-heading text-lg font-semibold`,children:k}),(0,V.jsxs)(`p`,{className:`text-sm text-muted-foreground`,children:[T?`${T.name||T.external_id} · ${T.external_id}`:x===`tenant`?`Current tenant`:`Current organization`,` `,`· Read-only directory`]})]})]}),D&&(0,V.jsx)(pr,{session:n,selected:l,onSelect:t=>{t?.id!==l?.id&&(u(t),e.onTenantChange?.(t))}}),(0,V.jsxs)(`div`,{"data-slot":`directory-toolbar`,className:`flex flex-wrap items-center gap-3`,children:[(0,V.jsx)(p,{type:`search`,disabled:O,"aria-label":i.searchLabel,placeholder:`${i.searchLabel}…`,value:d,maxLength:255,onChange:e=>f(e.target.value),className:`w-full min-w-0 max-w-full @lg/directory:w-72`}),i.showAdminFilter&&e.showAdmin&&(0,V.jsxs)(ze,{disabled:O,"aria-label":`Stored admin status`,value:h,onChange:e=>g(e.target.value),children:[(0,V.jsx)(H,{value:`all`,children:`All users`}),(0,V.jsx)(H,{value:`true`,children:`Admins`}),(0,V.jsx)(H,{value:`false`,children:`Non-admins`})]}),(0,V.jsxs)(`div`,{"data-slot":`directory-page-controls`,className:`ms-auto flex shrink-0 items-center gap-2`,children:[(0,V.jsx)(ze,{disabled:O,"aria-label":`Rows per page`,className:`min-w-32`,value:_,onChange:e=>v(Number(e.target.value)),children:[20,50,100].map(e=>(0,V.jsxs)(H,{value:e,children:[e,` per page`]},e))}),(0,V.jsx)(L,{variant:`outline`,size:`icon`,"aria-label":`Refresh directory`,title:`Refresh directory`,disabled:c>0,onClick:()=>void s.refetchQueries({type:`active`}),children:(0,V.jsx)(Se,{"aria-hidden":!0,className:c>0?`animate-spin motion-reduce:animate-none`:void 0})})]})]}),C&&w.isError?(0,V.jsx)(_r,{error:w.error,retry:()=>void w.refetch()}):C&&w.isPending?(0,V.jsx)(gr,{}):O?(0,V.jsx)(`div`,{"data-slot":`directory-empty`,className:`space-y-3 rounded-lg border border-foreground/10 bg-card p-8 text-center text-card-foreground`,children:(0,V.jsx)(`p`,{role:`status`,className:`text-muted-foreground`,children:D?i.tenantPrompt:`No persisted tenant found. Create the tenant, then refresh.`})}):t===`threads`?(0,V.jsx)(ur,{session:n,tenantId:E,q:m,size:_,ErrorFeedback:_r,LoadingFeedback:gr,Pagination:hr},JSON.stringify([E,m,_])):(0,V.jsx)(mr,{admin:ee,options:e,kind:t,session:n,tenantId:E,q:m,size:_},JSON.stringify([E,m,ee,_]))]})}function pr({session:e,selected:t,onSelect:n}){let r=(0,R.useId)();return(0,V.jsxs)(`div`,{"data-slot":`directory-tenant-picker`,className:`w-full min-w-0 space-y-1.5 [&_input]:min-w-0 [&_[data-slot=input-group-addon]]:me-0 @lg/directory:max-w-sm`,children:[(0,V.jsx)(`label`,{htmlFor:r,"data-slot":`directory-tenant-label`,className:`block text-sm font-medium`,children:`Tenant`}),(0,V.jsx)(Re,{id:r,label:`Tenant`,placeholder:`Search tenants…`,value:t,onValueChange:n,showClear:!0,itemLabel:e=>`${e.name||e.external_id} · ${e.external_id}`,loadPage:(t,n,r)=>Ne(e,{q:t,...n?{page_after:n}:{}},r)})]})}function mr({options:e,kind:t,session:n,tenantId:r,q:i,admin:a,size:o}){let[s,c]=(0,R.useState)({}),l=z({queryKey:[t,r,i,a,o,s],queryFn:({signal:e})=>Pe(n,{kind:t,tenantId:r,q:i,admin:a,size:o,cursor:s},e)});return(0,V.jsxs)(`div`,{"data-slot":`directory-page`,"aria-busy":l.isFetching,className:`min-w-0 space-y-4`,children:[l.isError?(0,V.jsx)(_r,{error:l.error,retry:()=>void l.refetch()}):l.isPending?(0,V.jsx)(gr,{}):(0,V.jsx)(`div`,{"data-slot":`directory-table`,className:`overflow-hidden rounded-lg border border-foreground/10 bg-card text-card-foreground`,children:(0,V.jsx)(cr,{rows:l.data.items,kind:t,options:e,filtered:!!i||a!==`all`},JSON.stringify(s))}),(0,V.jsx)(`div`,{"data-slot":`directory-pagination`,children:(0,V.jsx)(hr,{page:l.isError?void 0:l.data,busy:l.isFetching,onPage:c})})]})}function hr({page:e,busy:t,onPage:n}){return(0,V.jsxs)(`nav`,{"aria-label":`Directory pages`,className:`grid grid-cols-2 justify-end gap-2 @lg/directory:flex`,children:[(0,V.jsx)(L,{variant:`outline`,size:`sm`,disabled:t||!e?.page_before,onClick:()=>n({page_before:e.page_before}),children:`Previous`}),(0,V.jsx)(L,{variant:`outline`,size:`sm`,disabled:t||!e?.page_after,onClick:()=>n({page_after:e.page_after}),children:`Next`})]})}function gr(){return(0,V.jsx)(`div`,{role:`status`,"aria-label":`Loading directory`,className:`space-y-3 p-4`,children:[0,1,2].map(e=>(0,V.jsx)(Be,{className:`h-10 w-full`},e))})}function _r({error:e,retry:t}){let n=I(e)?e:void 0,r=n?.status,i={401:`Authentication required`,403:`Access denied`,404:`Tenant not found`,429:`Too many requests`},a=n?.headers.get(`retry-after`);return(0,V.jsxs)(He,{variant:`destructive`,children:[(0,V.jsx)(Ue,{children:i[r??0]??`Unable to load directory`}),(0,V.jsx)(We,{children:r===429?`Please retry after ${a??`a few`} seconds.`:e.message}),(0,V.jsx)(L,{variant:`outline`,size:`sm`,onClick:t,children:`Retry`})]})}function vr(e,t,n,r){let i=document.createElement(`style`);i.textContent=pe+(n.customCss??``),e.append(i);let a={root:(0,Oe.createRoot)(t),style:i,client:new _({defaultOptions:{queries:{retry:!1,refetchOnWindowFocus:!1,refetchOnReconnect:!1,gcTime:0}}}),options:n,kind:r,revision:0,session:ke(n,()=>$(a))};return Sr(a),Q(a),a}function Q(e){let t=F(e.session.auth);e.root.render((0,V.jsx)(y,{client:e.client,children:t.status===`error`?(0,V.jsxs)(`div`,{role:`alert`,className:`p-4 text-sm`,children:[(0,V.jsx)(`p`,{children:t.error.message}),(0,V.jsx)(`button`,{type:`button`,className:`underline`,onClick:()=>yr(e),children:`Retry authentication`})]}):(0,V.jsx)(fr,{options:e.options,kind:e.kind,session:e.session},e.revision)}))}function yr(e){F(e.session.auth).status===`error`?de({...e.session.auth,force:!0}).catch(()=>{}):e.client.invalidateQueries()}function $(e){e.unsubscribeAuthentication?.(),e.stopAuthentication?.(),je(e.session),e.client.clear(),e.session=ke(e.options,()=>$(e)),e.revision++,Sr(e),Q(e)}function br(e,t){let n=e.options;n.customCss!==t.customCss&&(e.style.textContent=pe+(t.customCss??``));let r=n.apiUrl!==t.apiUrl;if(e.options=t,r)return $(e);e.session.options=t,O(e.session.auth,{apiUrl:t.apiUrl,fetchAstralBeamToken:t.fetchAstralBeamToken}),(n.scope!==t.scope||n.tenantId!==t.tenantId||n.tenantExternalId!==t.tenantExternalId)&&(e.client.clear(),e.revision++),Q(e)}function xr(e){e.unsubscribeAuthentication?.(),e.stopAuthentication?.(),je(e.session),e.client.clear(),e.root.unmount(),e.style.remove()}function Sr(e){let t;e.unsubscribeAuthentication=N(e.session.auth,()=>{let n=F(e.session.auth);if(n.status===`error`)e.client.clear(),e.revision++;else if(n.status===`ready`){let r=ue(n.currentUser,e.session.auth.session.cached.tenantAdmin);t!==void 0&&t!==r&&(e.session.abortController.abort(),e.session.abortController=new AbortController,e.session.identity=void 0,e.client.clear(),e.revision++),t=r}Q(e)}),e.stopAuthentication=ne(e.session.auth)}export{xr as disposeListing,yr as refreshListing,vr as renderListing,$ as resetListing,br as updateListing};
|
package/dist/react.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { lt as TenantUserRecordEncoded, ot as TenantRecordEncoded } from "./index-CH3RVjha.js";
|
|
2
|
+
import { B as AstralBeamChatTheme$1, C as AstralBeamChatState, S as AstralBeamChatCoreOptions, V as AstralBeamTokenSource$1, x as AstralBeamChatCore, z as AstralBeamChatColorScheme$1 } from "./index-CM3pzsKR.js";
|
|
3
3
|
import { CSSProperties, ReactNode } from "react";
|
|
4
|
-
import { AstralBeamChatAttachmentOptions, AstralBeamChatColorScheme, AstralBeamChatTheme, AstralBeamTenantListHandle as AstralBeamTenantListHandle$1, AstralBeamTenantUserListHandle as AstralBeamTenantUserListHandle$1, AstralBeamTokenRequest, AstralBeamTokenSource, InferParameters, JsonSchemaObject, MountAstralBeamChatOptions, MountAstralBeamTenantListOptions, MountAstralBeamTenantUserListOptions, ParametersSchema, ToolDefinition, WidgetDefinition as WidgetDefinition$1, defineTool } from "@astralbeam/sdk/client";
|
|
4
|
+
import { AstralBeamChatAttachmentOptions, AstralBeamChatColorScheme, AstralBeamChatTheme, AstralBeamTenantListHandle as AstralBeamTenantListHandle$1, AstralBeamTenantUserListHandle as AstralBeamTenantUserListHandle$1, AstralBeamThreadListHandle as AstralBeamThreadListHandle$1, AstralBeamTokenRequest, AstralBeamTokenSource, InferParameters, JsonSchemaObject, MountAstralBeamChatOptions, MountAstralBeamTenantListOptions, MountAstralBeamTenantUserListOptions, MountAstralBeamThreadListOptions, ParametersSchema, ToolDefinition, WidgetDefinition as WidgetDefinition$1, defineTool } from "@astralbeam/sdk/client";
|
|
5
5
|
|
|
6
6
|
//#region src/react/listings.d.ts
|
|
7
7
|
type ContainerProps = {
|
|
@@ -12,6 +12,8 @@ type AstralBeamTenantListProps = MountAstralBeamTenantListOptions & ContainerPro
|
|
|
12
12
|
type AstralBeamTenantUserListProps = MountAstralBeamTenantUserListOptions & ContainerProps;
|
|
13
13
|
declare const AstralBeamTenantList: import("react").ForwardRefExoticComponent<MountAstralBeamTenantListOptions & ContainerProps & import("react").RefAttributes<AstralBeamTenantListHandle$1>>;
|
|
14
14
|
declare const AstralBeamTenantUserList: import("react").ForwardRefExoticComponent<MountAstralBeamTenantUserListOptions & ContainerProps & import("react").RefAttributes<AstralBeamTenantUserListHandle$1>>;
|
|
15
|
+
type AstralBeamThreadListProps = MountAstralBeamThreadListOptions & ContainerProps;
|
|
16
|
+
declare const AstralBeamThreadList: import("react").ForwardRefExoticComponent<MountAstralBeamThreadListOptions & ContainerProps & import("react").RefAttributes<AstralBeamThreadListHandle$1>>;
|
|
15
17
|
//#endregion
|
|
16
18
|
//#region src/core/listings.d.ts
|
|
17
19
|
interface AstralBeamListingCoreOptions {
|
|
@@ -48,6 +50,10 @@ interface MountAstralBeamTenantUserListOptions$1 extends AstralBeamListingOption
|
|
|
48
50
|
showAdmin?: boolean | undefined;
|
|
49
51
|
onTenantUserSelect?: ((user: TenantUserRecordEncoded) => void) | undefined;
|
|
50
52
|
}
|
|
53
|
+
interface MountAstralBeamThreadListOptions$1 extends AstralBeamListingOptions {
|
|
54
|
+
onTenantChange?: ((tenant: TenantRecordEncoded | null) => void) | undefined;
|
|
55
|
+
}
|
|
56
|
+
type AstralBeamThreadListHandle = AstralBeamListingHandle<MountAstralBeamThreadListOptions$1>;
|
|
51
57
|
interface AstralBeamListingHandle<T extends AstralBeamListingOptions = AstralBeamListingOptions> {
|
|
52
58
|
update(options: Partial<T>): void;
|
|
53
59
|
refresh(): void;
|
|
@@ -77,7 +83,7 @@ interface UseAstralBeamChatResult extends AstralBeamChatState {
|
|
|
77
83
|
stop: () => void;
|
|
78
84
|
reload: () => Promise<void>;
|
|
79
85
|
reset: () => void;
|
|
80
|
-
/**
|
|
86
|
+
/** Conversation management and the full headless session. */
|
|
81
87
|
core: AstralBeamChatCore;
|
|
82
88
|
}
|
|
83
89
|
/**
|
|
@@ -102,8 +108,10 @@ interface AstralBeamChatRef {
|
|
|
102
108
|
interface AstralBeamChatProps extends Omit<MountAstralBeamChatOptions, "widgets" | "slots"> {
|
|
103
109
|
/** Host-defined widgets the agent can render inline in the conversation, keyed by identifier. */
|
|
104
110
|
widgets?: Record<string, WidgetDefinition> | undefined;
|
|
105
|
-
/** Replaces the header's
|
|
111
|
+
/** Replaces the header's title with the host's own React content; `showHeader` still applies. */
|
|
106
112
|
header?: ReactNode;
|
|
113
|
+
/** Extra host controls at the end of the header, after the history and new chat buttons. */
|
|
114
|
+
headerActions?: ReactNode;
|
|
107
115
|
/** Replaces the empty-transcript state with the host's own React content. */
|
|
108
116
|
empty?: ReactNode;
|
|
109
117
|
/** Extra host controls at the end of the composer's button row, next to send. */
|
|
@@ -111,4 +119,4 @@ interface AstralBeamChatProps extends Omit<MountAstralBeamChatOptions, "widgets"
|
|
|
111
119
|
}
|
|
112
120
|
declare const AstralBeamChat: import("react").ForwardRefExoticComponent<AstralBeamChatProps & import("react").RefAttributes<AstralBeamChatRef>>;
|
|
113
121
|
//#endregion
|
|
114
|
-
export { AstralBeamChat, type AstralBeamChatAttachmentOptions, type AstralBeamChatColorScheme, type AstralBeamChatCore, type AstralBeamChatCoreOptions, AstralBeamChatProps, AstralBeamChatRef, type AstralBeamChatState, type AstralBeamChatTheme, AstralBeamTenantList, type AstralBeamTenantListHandle, type AstralBeamTenantListProps, AstralBeamTenantUserList, type AstralBeamTenantUserListHandle, type AstralBeamTenantUserListProps, type AstralBeamTokenRequest, type AstralBeamTokenSource, type InferParameters, type ParametersSchema, type ToolDefinition, TypedReactWidgetDefinition, UseAstralBeamChatResult, WidgetDefinition, defineTool, defineWidget, useAstralBeamChat };
|
|
122
|
+
export { AstralBeamChat, type AstralBeamChatAttachmentOptions, type AstralBeamChatColorScheme, type AstralBeamChatCore, type AstralBeamChatCoreOptions, AstralBeamChatProps, AstralBeamChatRef, type AstralBeamChatState, type AstralBeamChatTheme, AstralBeamTenantList, type AstralBeamTenantListHandle, type AstralBeamTenantListProps, AstralBeamTenantUserList, type AstralBeamTenantUserListHandle, type AstralBeamTenantUserListProps, AstralBeamThreadList, type AstralBeamThreadListHandle, type AstralBeamThreadListProps, type AstralBeamTokenRequest, type AstralBeamTokenSource, type InferParameters, type ParametersSchema, type ToolDefinition, TypedReactWidgetDefinition, UseAstralBeamChatResult, WidgetDefinition, defineTool, defineWidget, useAstralBeamChat };
|