@noodleseed/assistant 1.19.0 → 1.20.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.
@@ -1,4 +1,4 @@
1
- import { A as AssistantPageContext, a as AssistantContext, C as CreateAssistantClientOptions, b as AssistantChatState, c as AssistantClient } from '../client-BQ30Fq-c.cjs';
1
+ import { A as AssistantPageContext, a as AssistantContext, C as CreateAssistantClientOptions, b as AssistantChatState, c as AssistantClient } from '../client-7o7n2nqw.cjs';
2
2
  import '../appearance-Cc-eqSbp.cjs';
3
3
  import 'ai';
4
4
 
@@ -1,4 +1,4 @@
1
- import { A as AssistantPageContext, a as AssistantContext, C as CreateAssistantClientOptions, b as AssistantChatState, c as AssistantClient } from '../client-B6pnBmF8.js';
1
+ import { A as AssistantPageContext, a as AssistantContext, C as CreateAssistantClientOptions, b as AssistantChatState, c as AssistantClient } from '../client-CysBQBdd.js';
2
2
  import '../appearance-Cc-eqSbp.js';
3
3
  import 'ai';
4
4
 
@@ -1,7 +1,7 @@
1
1
  "use client";
2
2
  import {
3
3
  createAssistantClient
4
- } from "../chunk-S373FCAI.js";
4
+ } from "../chunk-52XT7BLR.js";
5
5
  import "../chunk-3YYTUJPJ.js";
6
6
  import "../chunk-5FUTL2UF.js";
7
7
 
package/dist/react.cjs CHANGED
@@ -27312,11 +27312,16 @@ function toAssistantClientEvent(event) {
27312
27312
  return event;
27313
27313
  }
27314
27314
  break;
27315
- case "auth_requested":
27316
- if (hasString(value, "id") && hasString(value, "tool") && hasString(value, "continuation") && hasString(value, "expiresAt") && hasOptionalTurnId(value)) {
27317
- return event;
27315
+ case "auth_requested": {
27316
+ const signInTicket = typeof value.signInTicket === "string" ? value.signInTicket : typeof value.continuation === "string" ? value.continuation : void 0;
27317
+ if (hasString(value, "id") && hasString(value, "tool") && signInTicket !== void 0 && hasString(value, "expiresAt") && hasOptionalTurnId(value)) {
27318
+ return {
27319
+ event: "auth_requested",
27320
+ data: { ...value, signInTicket }
27321
+ };
27318
27322
  }
27319
27323
  break;
27324
+ }
27320
27325
  case "interaction_resolved":
27321
27326
  if (hasString(value, "id") && (value.action === void 0 || isInteractionAction(value.action)) && hasOptionalTurnId(value)) {
27322
27327
  return event;
@@ -31273,11 +31278,11 @@ var AssistantElementEventController = class {
31273
31278
  );
31274
31279
  return;
31275
31280
  }
31276
- if (name21 === "auth_requested" && typeof data.continuation === "string") {
31281
+ if (name21 === "auth_requested" && typeof data.signInTicket === "string") {
31277
31282
  this.#appendSignInRequest(
31278
31283
  String(data.id ?? ""),
31279
31284
  String(data.tool ?? "this"),
31280
- data.continuation,
31285
+ data.signInTicket,
31281
31286
  String(data.expiresAt ?? "")
31282
31287
  );
31283
31288
  return;
@@ -31370,15 +31375,15 @@ var AssistantElementEventController = class {
31370
31375
  /**
31371
31376
  * The host application owns the login. This renders the prompt and raises
31372
31377
  * `assistant-sign-in-requested`; the page signs the visitor in however it already does, then its
31373
- * backend spends the continuation. Nothing here talks to an identity provider.
31378
+ * backend spends the sign-in ticket. Nothing here talks to an identity provider.
31374
31379
  */
31375
- #appendSignInRequest(id, tool, continuation, expiresAt) {
31380
+ #appendSignInRequest(id, tool, signInTicket, expiresAt) {
31376
31381
  const messages = this.#host.messages();
31377
31382
  if (!messages) return;
31378
31383
  this.#proposalCards.get(id)?.remove();
31379
31384
  const card = createSignInCard({
31380
31385
  tool,
31381
- continuation,
31386
+ signInTicket,
31382
31387
  expiresAt,
31383
31388
  labels: {
31384
31389
  heading: "Sign in to continue",
@@ -31386,7 +31391,7 @@ var AssistantElementEventController = class {
31386
31391
  },
31387
31392
  onSignIn: () => this.#host.element.dispatchEvent(
31388
31393
  new CustomEvent("assistant-sign-in-requested", {
31389
- detail: { id, tool, continuation, expiresAt },
31394
+ detail: { id, tool, signInTicket, expiresAt },
31390
31395
  bubbles: true,
31391
31396
  composed: true
31392
31397
  })
@@ -31397,7 +31402,7 @@ var AssistantElementEventController = class {
31397
31402
  this.#host.revealLatest();
31398
31403
  this.#host.element.dispatchEvent(
31399
31404
  new CustomEvent("assistant-sign-in-required", {
31400
- detail: { id, tool, continuation, expiresAt }
31405
+ detail: { id, tool, signInTicket, expiresAt }
31401
31406
  })
31402
31407
  );
31403
31408
  }