@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.
package/dist/index.cjs CHANGED
@@ -27309,11 +27309,16 @@ function toAssistantClientEvent(event) {
27309
27309
  return event;
27310
27310
  }
27311
27311
  break;
27312
- case "auth_requested":
27313
- if (hasString(value, "id") && hasString(value, "tool") && hasString(value, "continuation") && hasString(value, "expiresAt") && hasOptionalTurnId(value)) {
27314
- return event;
27312
+ case "auth_requested": {
27313
+ const signInTicket = typeof value.signInTicket === "string" ? value.signInTicket : typeof value.continuation === "string" ? value.continuation : void 0;
27314
+ if (hasString(value, "id") && hasString(value, "tool") && signInTicket !== void 0 && hasString(value, "expiresAt") && hasOptionalTurnId(value)) {
27315
+ return {
27316
+ event: "auth_requested",
27317
+ data: { ...value, signInTicket }
27318
+ };
27315
27319
  }
27316
27320
  break;
27321
+ }
27317
27322
  case "interaction_resolved":
27318
27323
  if (hasString(value, "id") && (value.action === void 0 || isInteractionAction(value.action)) && hasOptionalTurnId(value)) {
27319
27324
  return event;
@@ -31270,11 +31275,11 @@ var AssistantElementEventController = class {
31270
31275
  );
31271
31276
  return;
31272
31277
  }
31273
- if (name21 === "auth_requested" && typeof data.continuation === "string") {
31278
+ if (name21 === "auth_requested" && typeof data.signInTicket === "string") {
31274
31279
  this.#appendSignInRequest(
31275
31280
  String(data.id ?? ""),
31276
31281
  String(data.tool ?? "this"),
31277
- data.continuation,
31282
+ data.signInTicket,
31278
31283
  String(data.expiresAt ?? "")
31279
31284
  );
31280
31285
  return;
@@ -31367,15 +31372,15 @@ var AssistantElementEventController = class {
31367
31372
  /**
31368
31373
  * The host application owns the login. This renders the prompt and raises
31369
31374
  * `assistant-sign-in-requested`; the page signs the visitor in however it already does, then its
31370
- * backend spends the continuation. Nothing here talks to an identity provider.
31375
+ * backend spends the sign-in ticket. Nothing here talks to an identity provider.
31371
31376
  */
31372
- #appendSignInRequest(id, tool, continuation, expiresAt) {
31377
+ #appendSignInRequest(id, tool, signInTicket, expiresAt) {
31373
31378
  const messages = this.#host.messages();
31374
31379
  if (!messages) return;
31375
31380
  this.#proposalCards.get(id)?.remove();
31376
31381
  const card = createSignInCard({
31377
31382
  tool,
31378
- continuation,
31383
+ signInTicket,
31379
31384
  expiresAt,
31380
31385
  labels: {
31381
31386
  heading: "Sign in to continue",
@@ -31383,7 +31388,7 @@ var AssistantElementEventController = class {
31383
31388
  },
31384
31389
  onSignIn: () => this.#host.element.dispatchEvent(
31385
31390
  new CustomEvent("assistant-sign-in-requested", {
31386
- detail: { id, tool, continuation, expiresAt },
31391
+ detail: { id, tool, signInTicket, expiresAt },
31387
31392
  bubbles: true,
31388
31393
  composed: true
31389
31394
  })
@@ -31394,7 +31399,7 @@ var AssistantElementEventController = class {
31394
31399
  this.#host.revealLatest();
31395
31400
  this.#host.element.dispatchEvent(
31396
31401
  new CustomEvent("assistant-sign-in-required", {
31397
- detail: { id, tool, continuation, expiresAt }
31402
+ detail: { id, tool, signInTicket, expiresAt }
31398
31403
  })
31399
31404
  );
31400
31405
  }