@noodleseed/assistant 1.15.0 → 1.16.1
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/dist/{chunk-SUHNNWKP.js → chunk-MZNENVFY.js} +76 -3
- package/dist/chunk-MZNENVFY.js.map +1 -0
- package/dist/{chunk-RRJIK473.js → chunk-RIKRQFKS.js} +10 -1
- package/dist/{chunk-RRJIK473.js.map → chunk-RIKRQFKS.js.map} +1 -1
- package/dist/{client-MnLfiyo2.d.ts → client-B6pnBmF8.d.ts} +14 -1
- package/dist/{client-B_l59rWg.d.cts → client-BQ30Fq-c.d.cts} +14 -1
- package/dist/client.cjs +9 -0
- package/dist/client.cjs.map +1 -1
- package/dist/client.d.cts +1 -1
- package/dist/client.d.ts +1 -1
- package/dist/client.js +1 -1
- package/dist/embed.global.js +32 -32
- package/dist/index.cjs +83 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +2 -2
- package/dist/react/client.cjs +9 -0
- package/dist/react/client.cjs.map +1 -1
- package/dist/react/client.d.cts +1 -1
- package/dist/react/client.d.ts +1 -1
- package/dist/react/client.js +1 -1
- package/dist/react.cjs +83 -1
- package/dist/react.cjs.map +1 -1
- package/dist/react.d.cts +1 -1
- package/dist/react.d.ts +1 -1
- package/dist/react.js +2 -2
- package/package.json +1 -1
- package/dist/chunk-SUHNNWKP.js.map +0 -1
|
@@ -57,6 +57,17 @@ interface AssistantToolProposedDetail extends TurnDetail {
|
|
|
57
57
|
/** Optional only for compatibility with assistant services published before named-event pinning. */
|
|
58
58
|
readonly requiresConfirmation?: true;
|
|
59
59
|
}
|
|
60
|
+
/**
|
|
61
|
+
* A capability the visitor must sign in to reach (ADR 0201, 5.6b). `continuation` is the value the host
|
|
62
|
+
* page hands to its **own** backend, which spends it with its own client credentials; on its own it names
|
|
63
|
+
* a conversation and nothing more.
|
|
64
|
+
*/
|
|
65
|
+
interface AssistantAuthRequestedDetail extends TurnDetail {
|
|
66
|
+
readonly id: string;
|
|
67
|
+
readonly tool: string;
|
|
68
|
+
readonly continuation: string;
|
|
69
|
+
readonly expiresAt: string;
|
|
70
|
+
}
|
|
60
71
|
interface AssistantInputRequestedDetail extends TurnDetail {
|
|
61
72
|
readonly id: string;
|
|
62
73
|
readonly message: string;
|
|
@@ -98,6 +109,7 @@ type AssistantContentEvent = NamedEvent<'content', AssistantContentDetail>;
|
|
|
98
109
|
type AssistantToolStartedEvent = NamedEvent<'tool_started', AssistantToolStartedDetail>;
|
|
99
110
|
type AssistantToolProposedEvent = NamedEvent<'tool_proposed', AssistantToolProposedDetail>;
|
|
100
111
|
type AssistantInputRequestedEvent = NamedEvent<'input_requested', AssistantInputRequestedDetail>;
|
|
112
|
+
type AssistantAuthRequestedEvent = NamedEvent<'auth_requested', AssistantAuthRequestedDetail>;
|
|
101
113
|
type AssistantInteractionResolvedEvent = NamedEvent<'interaction_resolved', AssistantInteractionResolvedDetail>;
|
|
102
114
|
type AssistantToolCompletedEvent = NamedEvent<'tool_completed', AssistantToolCompletedDetail>;
|
|
103
115
|
type AssistantViewAvailableEvent = NamedEvent<'view_available', AssistantViewAvailableDetail>;
|
|
@@ -134,7 +146,7 @@ interface AssistantUnrecognizedEvent {
|
|
|
134
146
|
};
|
|
135
147
|
}
|
|
136
148
|
/** Closed event union for the DOM-free client; unknown future SSE names remain observable safely. */
|
|
137
|
-
type AssistantClientEvent = AssistantContentEvent | AssistantToolStartedEvent | AssistantToolProposedEvent | AssistantInputRequestedEvent | AssistantInteractionResolvedEvent | AssistantToolCompletedEvent | AssistantViewAvailableEvent | AssistantErrorEvent | AssistantDoneEvent | NamedEvent<'interaction_proposed', AssistantLegacyInteractionProposedDetail> | AssistantClientLifecycleEvent | AssistantUnrecognizedEvent;
|
|
149
|
+
type AssistantClientEvent = AssistantContentEvent | AssistantToolStartedEvent | AssistantToolProposedEvent | AssistantInputRequestedEvent | AssistantAuthRequestedEvent | AssistantInteractionResolvedEvent | AssistantToolCompletedEvent | AssistantViewAvailableEvent | AssistantErrorEvent | AssistantDoneEvent | NamedEvent<'interaction_proposed', AssistantLegacyInteractionProposedDetail> | AssistantClientLifecycleEvent | AssistantUnrecognizedEvent;
|
|
138
150
|
|
|
139
151
|
type AssistantInteractionStatus = 'pending' | 'submitting' | 'accepted' | 'declined' | 'cancelled';
|
|
140
152
|
interface AssistantConfirmationData {
|
|
@@ -238,6 +250,7 @@ interface AssistantClient<TPageContext extends AssistantPageContext = AssistantC
|
|
|
238
250
|
/** Read a detached snapshot suitable for a framework-owned renderer. */
|
|
239
251
|
getChatState(): AssistantChatState;
|
|
240
252
|
connect(): Promise<void>;
|
|
253
|
+
hasSession(): boolean;
|
|
241
254
|
sendMessage(message: string): Promise<void>;
|
|
242
255
|
respond(id: string, response: AssistantInteractionResponse): Promise<void>;
|
|
243
256
|
updateContext(context: AssistantContext): void;
|
|
@@ -57,6 +57,17 @@ interface AssistantToolProposedDetail extends TurnDetail {
|
|
|
57
57
|
/** Optional only for compatibility with assistant services published before named-event pinning. */
|
|
58
58
|
readonly requiresConfirmation?: true;
|
|
59
59
|
}
|
|
60
|
+
/**
|
|
61
|
+
* A capability the visitor must sign in to reach (ADR 0201, 5.6b). `continuation` is the value the host
|
|
62
|
+
* page hands to its **own** backend, which spends it with its own client credentials; on its own it names
|
|
63
|
+
* a conversation and nothing more.
|
|
64
|
+
*/
|
|
65
|
+
interface AssistantAuthRequestedDetail extends TurnDetail {
|
|
66
|
+
readonly id: string;
|
|
67
|
+
readonly tool: string;
|
|
68
|
+
readonly continuation: string;
|
|
69
|
+
readonly expiresAt: string;
|
|
70
|
+
}
|
|
60
71
|
interface AssistantInputRequestedDetail extends TurnDetail {
|
|
61
72
|
readonly id: string;
|
|
62
73
|
readonly message: string;
|
|
@@ -98,6 +109,7 @@ type AssistantContentEvent = NamedEvent<'content', AssistantContentDetail>;
|
|
|
98
109
|
type AssistantToolStartedEvent = NamedEvent<'tool_started', AssistantToolStartedDetail>;
|
|
99
110
|
type AssistantToolProposedEvent = NamedEvent<'tool_proposed', AssistantToolProposedDetail>;
|
|
100
111
|
type AssistantInputRequestedEvent = NamedEvent<'input_requested', AssistantInputRequestedDetail>;
|
|
112
|
+
type AssistantAuthRequestedEvent = NamedEvent<'auth_requested', AssistantAuthRequestedDetail>;
|
|
101
113
|
type AssistantInteractionResolvedEvent = NamedEvent<'interaction_resolved', AssistantInteractionResolvedDetail>;
|
|
102
114
|
type AssistantToolCompletedEvent = NamedEvent<'tool_completed', AssistantToolCompletedDetail>;
|
|
103
115
|
type AssistantViewAvailableEvent = NamedEvent<'view_available', AssistantViewAvailableDetail>;
|
|
@@ -134,7 +146,7 @@ interface AssistantUnrecognizedEvent {
|
|
|
134
146
|
};
|
|
135
147
|
}
|
|
136
148
|
/** Closed event union for the DOM-free client; unknown future SSE names remain observable safely. */
|
|
137
|
-
type AssistantClientEvent = AssistantContentEvent | AssistantToolStartedEvent | AssistantToolProposedEvent | AssistantInputRequestedEvent | AssistantInteractionResolvedEvent | AssistantToolCompletedEvent | AssistantViewAvailableEvent | AssistantErrorEvent | AssistantDoneEvent | NamedEvent<'interaction_proposed', AssistantLegacyInteractionProposedDetail> | AssistantClientLifecycleEvent | AssistantUnrecognizedEvent;
|
|
149
|
+
type AssistantClientEvent = AssistantContentEvent | AssistantToolStartedEvent | AssistantToolProposedEvent | AssistantInputRequestedEvent | AssistantAuthRequestedEvent | AssistantInteractionResolvedEvent | AssistantToolCompletedEvent | AssistantViewAvailableEvent | AssistantErrorEvent | AssistantDoneEvent | NamedEvent<'interaction_proposed', AssistantLegacyInteractionProposedDetail> | AssistantClientLifecycleEvent | AssistantUnrecognizedEvent;
|
|
138
150
|
|
|
139
151
|
type AssistantInteractionStatus = 'pending' | 'submitting' | 'accepted' | 'declined' | 'cancelled';
|
|
140
152
|
interface AssistantConfirmationData {
|
|
@@ -238,6 +250,7 @@ interface AssistantClient<TPageContext extends AssistantPageContext = AssistantC
|
|
|
238
250
|
/** Read a detached snapshot suitable for a framework-owned renderer. */
|
|
239
251
|
getChatState(): AssistantChatState;
|
|
240
252
|
connect(): Promise<void>;
|
|
253
|
+
hasSession(): boolean;
|
|
241
254
|
sendMessage(message: string): Promise<void>;
|
|
242
255
|
respond(id: string, response: AssistantInteractionResponse): Promise<void>;
|
|
243
256
|
updateContext(context: AssistantContext): void;
|
package/dist/client.cjs
CHANGED
|
@@ -22918,6 +22918,11 @@ function toAssistantClientEvent(event) {
|
|
|
22918
22918
|
return event;
|
|
22919
22919
|
}
|
|
22920
22920
|
break;
|
|
22921
|
+
case "auth_requested":
|
|
22922
|
+
if (hasString(value, "id") && hasString(value, "tool") && hasString(value, "continuation") && hasString(value, "expiresAt") && hasOptionalTurnId(value)) {
|
|
22923
|
+
return event;
|
|
22924
|
+
}
|
|
22925
|
+
break;
|
|
22921
22926
|
case "interaction_resolved":
|
|
22922
22927
|
if (hasString(value, "id") && (value.action === void 0 || isInteractionAction(value.action)) && hasOptionalTurnId(value)) {
|
|
22923
22928
|
return event;
|
|
@@ -23295,6 +23300,10 @@ var DefaultAssistantClient = class {
|
|
|
23295
23300
|
getChatState() {
|
|
23296
23301
|
return this.#chat.getState();
|
|
23297
23302
|
}
|
|
23303
|
+
/** Whether a session already exists, so a caller can avoid re-entering its loading state. */
|
|
23304
|
+
hasSession() {
|
|
23305
|
+
return this.#session !== void 0;
|
|
23306
|
+
}
|
|
23298
23307
|
async connect() {
|
|
23299
23308
|
if (this.#session) return;
|
|
23300
23309
|
await this.#singleFlight(async (signal) => {
|