@noodleseed/assistant 1.16.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-7L52WJ2E.js → chunk-MZNENVFY.js} +11 -3
- package/dist/{chunk-7L52WJ2E.js.map → chunk-MZNENVFY.js.map} +1 -1
- package/dist/{chunk-NPV64PUX.js → chunk-RIKRQFKS.js} +5 -1
- package/dist/{chunk-NPV64PUX.js.map → chunk-RIKRQFKS.js.map} +1 -1
- package/dist/{client-Ii_xTV09.d.ts → client-B6pnBmF8.d.ts} +1 -0
- package/dist/{client-401BAJqk.d.cts → client-BQ30Fq-c.d.cts} +1 -0
- package/dist/client.cjs +4 -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 +2 -2
- package/dist/index.cjs +13 -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 +4 -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 +13 -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/react/client.d.cts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { A as AssistantPageContext, a as AssistantContext, C as CreateAssistantClientOptions, b as AssistantChatState, c as AssistantClient } from '../client-
|
|
1
|
+
import { A as AssistantPageContext, a as AssistantContext, C as CreateAssistantClientOptions, b as AssistantChatState, c as AssistantClient } from '../client-BQ30Fq-c.cjs';
|
|
2
2
|
import '../appearance-Cc-eqSbp.cjs';
|
|
3
3
|
import 'ai';
|
|
4
4
|
|
package/dist/react/client.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { A as AssistantPageContext, a as AssistantContext, C as CreateAssistantClientOptions, b as AssistantChatState, c as AssistantClient } from '../client-
|
|
1
|
+
import { A as AssistantPageContext, a as AssistantContext, C as CreateAssistantClientOptions, b as AssistantChatState, c as AssistantClient } from '../client-B6pnBmF8.js';
|
|
2
2
|
import '../appearance-Cc-eqSbp.js';
|
|
3
3
|
import 'ai';
|
|
4
4
|
|
package/dist/react/client.js
CHANGED
package/dist/react.cjs
CHANGED
|
@@ -27480,6 +27480,10 @@ var DefaultAssistantClient = class {
|
|
|
27480
27480
|
getChatState() {
|
|
27481
27481
|
return this.#chat.getState();
|
|
27482
27482
|
}
|
|
27483
|
+
/** Whether a session already exists, so a caller can avoid re-entering its loading state. */
|
|
27484
|
+
hasSession() {
|
|
27485
|
+
return this.#session !== void 0;
|
|
27486
|
+
}
|
|
27483
27487
|
async connect() {
|
|
27484
27488
|
if (this.#session) return;
|
|
27485
27489
|
await this.#singleFlight(async (signal) => {
|
|
@@ -32179,7 +32183,13 @@ var NoodleAssistantElement = class extends HTMLElementBase {
|
|
|
32179
32183
|
if (this.#appearance.behavior.startOpen) this.#applyStartOpenPolicy();
|
|
32180
32184
|
this.#render();
|
|
32181
32185
|
this.dispatchEvent(new CustomEvent("assistant-ready"));
|
|
32182
|
-
this
|
|
32186
|
+
if (this.hasAttribute("start-open")) {
|
|
32187
|
+
this.setAttribute("open", "");
|
|
32188
|
+
this.#startOpenApplied = true;
|
|
32189
|
+
this.#primeSession();
|
|
32190
|
+
} else if (!this.embedId) {
|
|
32191
|
+
this.#primeSession();
|
|
32192
|
+
}
|
|
32183
32193
|
}
|
|
32184
32194
|
disconnectedCallback() {
|
|
32185
32195
|
this.#conversationGeneration += 1;
|
|
@@ -32201,6 +32211,7 @@ var NoodleAssistantElement = class extends HTMLElementBase {
|
|
|
32201
32211
|
}
|
|
32202
32212
|
open() {
|
|
32203
32213
|
this.setAttribute("open", "");
|
|
32214
|
+
this.#primeSession();
|
|
32204
32215
|
this.dispatchEvent(new CustomEvent("assistant-open"));
|
|
32205
32216
|
}
|
|
32206
32217
|
close() {
|
|
@@ -32368,6 +32379,7 @@ var NoodleAssistantElement = class extends HTMLElementBase {
|
|
|
32368
32379
|
}
|
|
32369
32380
|
#primeSession() {
|
|
32370
32381
|
if (!this.sessionEndpoint && !this.embedId) return;
|
|
32382
|
+
if (this.#sessionBootstrap || this.#client?.hasSession()) return;
|
|
32371
32383
|
const client = this.#ensureClient();
|
|
32372
32384
|
const generation = this.#conversationGeneration;
|
|
32373
32385
|
this.#setSessionState("loading");
|