@noodleseed/assistant 1.6.0 → 1.8.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 +78 -20
- package/dist/{chunk-UXPKSCID.js → chunk-3YYTUJPJ.js} +2 -2
- package/dist/{chunk-NSBPE2FW.js → chunk-5FUTL2UF.js} +6 -1
- package/dist/chunk-BLMJHF7U.js +544 -0
- package/dist/chunk-BLMJHF7U.js.map +1 -0
- package/dist/{chunk-ZKXOX67J.js → chunk-JMBUJSFP.js} +233 -87
- package/dist/chunk-JMBUJSFP.js.map +1 -0
- package/dist/chunk-RYQBXTLR.js +9089 -0
- package/dist/chunk-RYQBXTLR.js.map +1 -0
- package/dist/{client-9kup0-ws.d.cts → client-BxoNZkWp.d.cts} +50 -1
- package/dist/{client-BRjZMXlk.d.ts → client-ERQCAH_0.d.ts} +50 -1
- package/dist/client.cjs +22983 -94
- package/dist/client.cjs.map +1 -1
- package/dist/client.d.cts +2 -1
- package/dist/client.d.ts +2 -1
- package/dist/client.js +3 -2
- package/dist/index.cjs +10706 -2177
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +3 -2
- package/dist/index.d.ts +3 -2
- package/dist/index.js +4 -4
- package/dist/react/client.cjs +23688 -0
- package/dist/react/client.cjs.map +1 -0
- package/dist/react/client.d.cts +24 -0
- package/dist/react/client.d.ts +24 -0
- package/dist/react/client.js +76 -0
- package/dist/react/client.js.map +1 -0
- package/dist/react.cjs +10706 -2176
- package/dist/react.cjs.map +1 -1
- package/dist/react.d.cts +2 -1
- package/dist/react.d.ts +2 -1
- package/dist/react.js +7 -6
- package/dist/react.js.map +1 -1
- package/dist/server.cjs.map +1 -1
- package/dist/server.d.cts +3 -0
- package/dist/server.d.ts +3 -0
- package/dist/server.js +1 -1
- package/dist/server.js.map +1 -1
- package/dist/token-Y6KCR3JT.js +70 -0
- package/dist/token-Y6KCR3JT.js.map +1 -0
- package/dist/token-util-XFYMRPAB.js +6 -0
- package/dist/{v4-2UXPDMWJ.js → v4-KBRL3YLO.js} +3 -3
- package/dist/v4-KBRL3YLO.js.map +1 -0
- package/package.json +14 -3
- package/dist/chunk-GTYYQNGT.js +0 -708
- package/dist/chunk-GTYYQNGT.js.map +0 -1
- package/dist/chunk-ZKXOX67J.js.map +0 -1
- /package/dist/{chunk-UXPKSCID.js.map → chunk-3YYTUJPJ.js.map} +0 -0
- /package/dist/{chunk-NSBPE2FW.js.map → chunk-5FUTL2UF.js.map} +0 -0
- /package/dist/{v4-2UXPDMWJ.js.map → token-util-XFYMRPAB.js.map} +0 -0
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { a as AssistantConfiguration } from './appearance-DowzFJjh.cjs';
|
|
2
|
+
import { ChatStatus, UIMessage } from 'ai';
|
|
2
3
|
|
|
3
4
|
type AssistantJsonValue = string | number | boolean | null | readonly AssistantJsonValue[] | {
|
|
4
5
|
readonly [key: string]: AssistantJsonValue;
|
|
@@ -122,6 +123,43 @@ interface AssistantUnrecognizedEvent {
|
|
|
122
123
|
/** Closed event union for the DOM-free client; unknown future SSE names remain observable safely. */
|
|
123
124
|
type AssistantClientEvent = AssistantContentEvent | AssistantToolProposedEvent | AssistantInputRequestedEvent | AssistantInteractionResolvedEvent | AssistantToolCompletedEvent | AssistantViewAvailableEvent | AssistantErrorEvent | AssistantDoneEvent | NamedEvent<'interaction_proposed', AssistantLegacyInteractionProposedDetail> | AssistantClientLifecycleEvent | AssistantUnrecognizedEvent;
|
|
124
125
|
|
|
126
|
+
type AssistantInteractionStatus = 'pending' | 'submitting' | 'accepted' | 'declined' | 'cancelled';
|
|
127
|
+
interface AssistantConfirmationData {
|
|
128
|
+
readonly id: string;
|
|
129
|
+
readonly tool?: string;
|
|
130
|
+
readonly title?: string;
|
|
131
|
+
readonly description?: string;
|
|
132
|
+
readonly arguments?: AssistantJsonValue;
|
|
133
|
+
readonly reviewSchema?: Readonly<Record<string, unknown>>;
|
|
134
|
+
readonly expiresAt?: string;
|
|
135
|
+
readonly requiresConfirmation?: true;
|
|
136
|
+
readonly turnId?: string;
|
|
137
|
+
readonly status: AssistantInteractionStatus;
|
|
138
|
+
}
|
|
139
|
+
type AssistantInputRequestData = AssistantInputRequestedDetail & {
|
|
140
|
+
readonly status: AssistantInteractionStatus;
|
|
141
|
+
};
|
|
142
|
+
type AssistantToolResultData = AssistantToolCompletedDetail;
|
|
143
|
+
type AssistantViewData = AssistantViewAvailableDetail;
|
|
144
|
+
type AssistantUIDataTypes = {
|
|
145
|
+
readonly confirmation: AssistantConfirmationData;
|
|
146
|
+
readonly 'input-request': AssistantInputRequestData;
|
|
147
|
+
readonly 'tool-result': AssistantToolResultData;
|
|
148
|
+
readonly view: AssistantViewData;
|
|
149
|
+
};
|
|
150
|
+
/** AI SDK UI message shape used by the DOM-free client and customer-owned renderers. */
|
|
151
|
+
type AssistantUIMessage = UIMessage<undefined, AssistantUIDataTypes>;
|
|
152
|
+
interface AssistantChatError {
|
|
153
|
+
readonly name: string;
|
|
154
|
+
readonly message: string;
|
|
155
|
+
readonly detail?: AssistantErrorDetail;
|
|
156
|
+
}
|
|
157
|
+
interface AssistantChatState {
|
|
158
|
+
readonly status: ChatStatus;
|
|
159
|
+
readonly messages: readonly AssistantUIMessage[];
|
|
160
|
+
readonly error?: AssistantChatError;
|
|
161
|
+
}
|
|
162
|
+
|
|
125
163
|
type AssistantContextValue = string | number | boolean | null;
|
|
126
164
|
type AssistantContext = Readonly<Record<string, AssistantContextValue>>;
|
|
127
165
|
interface AssistantClientContext {
|
|
@@ -143,6 +181,8 @@ interface AssistantSessionResponse {
|
|
|
143
181
|
readonly toolConfirmations: string;
|
|
144
182
|
readonly interactions?: string;
|
|
145
183
|
readonly apps?: string;
|
|
184
|
+
/** Additive hosted sandbox document for widget frames; absent on older services. */
|
|
185
|
+
readonly sandbox?: string;
|
|
146
186
|
};
|
|
147
187
|
readonly configuration?: AssistantConfiguration;
|
|
148
188
|
}
|
|
@@ -161,6 +201,10 @@ interface CreateAssistantClientOptions<TPageContext extends AssistantPageContext
|
|
|
161
201
|
}
|
|
162
202
|
interface AssistantClient<TPageContext extends AssistantPageContext = AssistantContext> {
|
|
163
203
|
subscribe(listener: (event: AssistantClientEvent) => void): () => void;
|
|
204
|
+
/** Subscribe to detached AI SDK UIMessage state; the listener receives the current state immediately. */
|
|
205
|
+
subscribeChat(listener: (state: AssistantChatState) => void): () => void;
|
|
206
|
+
/** Read a detached snapshot suitable for a framework-owned renderer. */
|
|
207
|
+
getChatState(): AssistantChatState;
|
|
164
208
|
connect(): Promise<void>;
|
|
165
209
|
sendMessage(message: string): Promise<void>;
|
|
166
210
|
respond(id: string, response: AssistantInteractionResponse): Promise<void>;
|
|
@@ -168,6 +212,11 @@ interface AssistantClient<TPageContext extends AssistantPageContext = AssistantC
|
|
|
168
212
|
updatePageContext(context: TPageContext): void;
|
|
169
213
|
updateModelContext(update: AssistantModelContextUpdate): void;
|
|
170
214
|
requestApp(method: string, params: Readonly<Record<string, unknown>>): Promise<unknown>;
|
|
215
|
+
/**
|
|
216
|
+
* Hosted sandbox document URL for widget frames, when the active session advertises one.
|
|
217
|
+
* Optional so existing external implementations of this interface stay valid.
|
|
218
|
+
*/
|
|
219
|
+
appSandboxUrl?(): string | undefined;
|
|
171
220
|
resetSession(): void;
|
|
172
221
|
abort(): void;
|
|
173
222
|
}
|
|
@@ -177,4 +226,4 @@ declare class AssistantClientError extends Error {
|
|
|
177
226
|
}
|
|
178
227
|
declare function createAssistantClient<TPageContext extends AssistantPageContext = AssistantContext>(options: CreateAssistantClientOptions<TPageContext>): AssistantClient<TPageContext>;
|
|
179
228
|
|
|
180
|
-
export { type AssistantPageContext as A, type
|
|
229
|
+
export { type AssistantPageContext as A, type AssistantInteractionStatus as B, type CreateAssistantClientOptions as C, type AssistantJsonValue as D, type AssistantSessionResponse as E, type AssistantToolCompletedDetail as F, type AssistantToolCompletedEvent as G, type AssistantToolProposedDetail as H, type AssistantToolProposedEvent as I, type AssistantToolResultData as J, type AssistantUIDataTypes as K, type AssistantUIMessage as L, type AssistantUnrecognizedEvent as M, type AssistantViewData as N, createAssistantClient as O, type AssistantContext as a, type AssistantChatState as b, type AssistantClient as c, type AssistantModelContextUpdate as d, type AssistantClientEvent as e, type AssistantErrorDetail as f, type AssistantViewAvailableDetail as g, type AssistantInteractionResponse as h, type AssistantEvent as i, type AssistantViewAvailableEvent as j, type AssistantChatError as k, type AssistantClientContext as l, AssistantClientError as m, type AssistantClientLifecycleEvent as n, type AssistantConfirmationData as o, type AssistantContentDetail as p, type AssistantContentEvent as q, type AssistantContextValue as r, type AssistantDoneEvent as s, type AssistantErrorEvent as t, type AssistantErrorEventDetail as u, type AssistantInputRequestData as v, type AssistantInputRequestedDetail as w, type AssistantInputRequestedEvent as x, type AssistantInteractionResolvedDetail as y, type AssistantInteractionResolvedEvent as z };
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { a as AssistantConfiguration } from './appearance-DowzFJjh.js';
|
|
2
|
+
import { ChatStatus, UIMessage } from 'ai';
|
|
2
3
|
|
|
3
4
|
type AssistantJsonValue = string | number | boolean | null | readonly AssistantJsonValue[] | {
|
|
4
5
|
readonly [key: string]: AssistantJsonValue;
|
|
@@ -122,6 +123,43 @@ interface AssistantUnrecognizedEvent {
|
|
|
122
123
|
/** Closed event union for the DOM-free client; unknown future SSE names remain observable safely. */
|
|
123
124
|
type AssistantClientEvent = AssistantContentEvent | AssistantToolProposedEvent | AssistantInputRequestedEvent | AssistantInteractionResolvedEvent | AssistantToolCompletedEvent | AssistantViewAvailableEvent | AssistantErrorEvent | AssistantDoneEvent | NamedEvent<'interaction_proposed', AssistantLegacyInteractionProposedDetail> | AssistantClientLifecycleEvent | AssistantUnrecognizedEvent;
|
|
124
125
|
|
|
126
|
+
type AssistantInteractionStatus = 'pending' | 'submitting' | 'accepted' | 'declined' | 'cancelled';
|
|
127
|
+
interface AssistantConfirmationData {
|
|
128
|
+
readonly id: string;
|
|
129
|
+
readonly tool?: string;
|
|
130
|
+
readonly title?: string;
|
|
131
|
+
readonly description?: string;
|
|
132
|
+
readonly arguments?: AssistantJsonValue;
|
|
133
|
+
readonly reviewSchema?: Readonly<Record<string, unknown>>;
|
|
134
|
+
readonly expiresAt?: string;
|
|
135
|
+
readonly requiresConfirmation?: true;
|
|
136
|
+
readonly turnId?: string;
|
|
137
|
+
readonly status: AssistantInteractionStatus;
|
|
138
|
+
}
|
|
139
|
+
type AssistantInputRequestData = AssistantInputRequestedDetail & {
|
|
140
|
+
readonly status: AssistantInteractionStatus;
|
|
141
|
+
};
|
|
142
|
+
type AssistantToolResultData = AssistantToolCompletedDetail;
|
|
143
|
+
type AssistantViewData = AssistantViewAvailableDetail;
|
|
144
|
+
type AssistantUIDataTypes = {
|
|
145
|
+
readonly confirmation: AssistantConfirmationData;
|
|
146
|
+
readonly 'input-request': AssistantInputRequestData;
|
|
147
|
+
readonly 'tool-result': AssistantToolResultData;
|
|
148
|
+
readonly view: AssistantViewData;
|
|
149
|
+
};
|
|
150
|
+
/** AI SDK UI message shape used by the DOM-free client and customer-owned renderers. */
|
|
151
|
+
type AssistantUIMessage = UIMessage<undefined, AssistantUIDataTypes>;
|
|
152
|
+
interface AssistantChatError {
|
|
153
|
+
readonly name: string;
|
|
154
|
+
readonly message: string;
|
|
155
|
+
readonly detail?: AssistantErrorDetail;
|
|
156
|
+
}
|
|
157
|
+
interface AssistantChatState {
|
|
158
|
+
readonly status: ChatStatus;
|
|
159
|
+
readonly messages: readonly AssistantUIMessage[];
|
|
160
|
+
readonly error?: AssistantChatError;
|
|
161
|
+
}
|
|
162
|
+
|
|
125
163
|
type AssistantContextValue = string | number | boolean | null;
|
|
126
164
|
type AssistantContext = Readonly<Record<string, AssistantContextValue>>;
|
|
127
165
|
interface AssistantClientContext {
|
|
@@ -143,6 +181,8 @@ interface AssistantSessionResponse {
|
|
|
143
181
|
readonly toolConfirmations: string;
|
|
144
182
|
readonly interactions?: string;
|
|
145
183
|
readonly apps?: string;
|
|
184
|
+
/** Additive hosted sandbox document for widget frames; absent on older services. */
|
|
185
|
+
readonly sandbox?: string;
|
|
146
186
|
};
|
|
147
187
|
readonly configuration?: AssistantConfiguration;
|
|
148
188
|
}
|
|
@@ -161,6 +201,10 @@ interface CreateAssistantClientOptions<TPageContext extends AssistantPageContext
|
|
|
161
201
|
}
|
|
162
202
|
interface AssistantClient<TPageContext extends AssistantPageContext = AssistantContext> {
|
|
163
203
|
subscribe(listener: (event: AssistantClientEvent) => void): () => void;
|
|
204
|
+
/** Subscribe to detached AI SDK UIMessage state; the listener receives the current state immediately. */
|
|
205
|
+
subscribeChat(listener: (state: AssistantChatState) => void): () => void;
|
|
206
|
+
/** Read a detached snapshot suitable for a framework-owned renderer. */
|
|
207
|
+
getChatState(): AssistantChatState;
|
|
164
208
|
connect(): Promise<void>;
|
|
165
209
|
sendMessage(message: string): Promise<void>;
|
|
166
210
|
respond(id: string, response: AssistantInteractionResponse): Promise<void>;
|
|
@@ -168,6 +212,11 @@ interface AssistantClient<TPageContext extends AssistantPageContext = AssistantC
|
|
|
168
212
|
updatePageContext(context: TPageContext): void;
|
|
169
213
|
updateModelContext(update: AssistantModelContextUpdate): void;
|
|
170
214
|
requestApp(method: string, params: Readonly<Record<string, unknown>>): Promise<unknown>;
|
|
215
|
+
/**
|
|
216
|
+
* Hosted sandbox document URL for widget frames, when the active session advertises one.
|
|
217
|
+
* Optional so existing external implementations of this interface stay valid.
|
|
218
|
+
*/
|
|
219
|
+
appSandboxUrl?(): string | undefined;
|
|
171
220
|
resetSession(): void;
|
|
172
221
|
abort(): void;
|
|
173
222
|
}
|
|
@@ -177,4 +226,4 @@ declare class AssistantClientError extends Error {
|
|
|
177
226
|
}
|
|
178
227
|
declare function createAssistantClient<TPageContext extends AssistantPageContext = AssistantContext>(options: CreateAssistantClientOptions<TPageContext>): AssistantClient<TPageContext>;
|
|
179
228
|
|
|
180
|
-
export { type AssistantPageContext as A, type
|
|
229
|
+
export { type AssistantPageContext as A, type AssistantInteractionStatus as B, type CreateAssistantClientOptions as C, type AssistantJsonValue as D, type AssistantSessionResponse as E, type AssistantToolCompletedDetail as F, type AssistantToolCompletedEvent as G, type AssistantToolProposedDetail as H, type AssistantToolProposedEvent as I, type AssistantToolResultData as J, type AssistantUIDataTypes as K, type AssistantUIMessage as L, type AssistantUnrecognizedEvent as M, type AssistantViewData as N, createAssistantClient as O, type AssistantContext as a, type AssistantChatState as b, type AssistantClient as c, type AssistantModelContextUpdate as d, type AssistantClientEvent as e, type AssistantErrorDetail as f, type AssistantViewAvailableDetail as g, type AssistantInteractionResponse as h, type AssistantEvent as i, type AssistantViewAvailableEvent as j, type AssistantChatError as k, type AssistantClientContext as l, AssistantClientError as m, type AssistantClientLifecycleEvent as n, type AssistantConfirmationData as o, type AssistantContentDetail as p, type AssistantContentEvent as q, type AssistantContextValue as r, type AssistantDoneEvent as s, type AssistantErrorEvent as t, type AssistantErrorEventDetail as u, type AssistantInputRequestData as v, type AssistantInputRequestedDetail as w, type AssistantInputRequestedEvent as x, type AssistantInteractionResolvedDetail as y, type AssistantInteractionResolvedEvent as z };
|