@helpai/elements 0.51.12 → 0.51.14

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/index.d.ts CHANGED
@@ -40,7 +40,7 @@ interface ClientStorage {
40
40
  * populated {@link Strings} map. UI components then read `strings.send` as a
41
41
  * normal property access — no per-render lookup, no per-render allocation.
42
42
  */
43
- type StringKey = "launcherOpen" | "launcherLabel" | "panelTitle" | "composerPlaceholder" | "send" | "stop" | "attach" | "micStart" | "micStop" | "micUnsupported" | "expand" | "collapse" | "fullscreen" | "exitFullscreen" | "resizeHandle" | "scrollToBottom" | "close" | "moreActions" | "soundOn" | "soundOff" | "language" | "theme" | "themeAuto" | "themeLight" | "themeDark" | "textSize" | "textSizeSmall" | "textSizeNormal" | "textSizeLarge" | "history" | "historyTitle" | "historyEmpty" | "historyLoading" | "historyBack" | "historyContinue" | "conversationLoading" | "conversationClosed" | "startNewConversation" | "dateToday" | "dateYesterday" | "dateLastWeek" | "dateOlder" | "newConversation" | "dropZone" | "attachmentTooLarge" | "attachmentTooMany" | "attachmentMimeRejected" | "errorRetry" | "errorGeneric" | "errorRateLimited" | "loading" | "thinking" | "thoughts" | "usedTool" | "toolResult" | "sources" | "collapseSidebar" | "expandSidebar" | "formSubmit" | "formSkip" | "formSubmitted" | "formSkipped" | "formFillOut" | "formRequired" | "formInvalidEmail" | "formInvalidTel" | "formInvalidUrl" | "formInvalidNumber" | "formTooShort" | "formTooLong" | "formNumberTooSmall" | "formNumberTooLarge" | "formPatternMismatch" | "formChooseAtLeast" | "formChooseAtMost" | "formOther" | "formOtherPlaceholder" | "inputRequired" | "inputBadge" | "inputAnswered" | "inputSkipped" | "inputQuestion" | "inputResponse" | "inputYourAnswer" | "inputSubmit" | "inputSubmitHint" | "inputAnswerPlaceholder" | "inputSkip" | "confirmYes" | "confirmNo" | "inputConfirmHint" | "inputOptionalNote" | "inputOptionalNotePlaceholder" | "inputSubmitted" | "respFreeText" | "respSingleChoice" | "respMultiChoice" | "respConfirmation" | "approvalRequired" | "approve" | "reject" | "approved" | "rejected" | "approvalReason" | "approvalPrompt" | "approvalBody" | "approvalYourResponse" | "approvalEditHint" | "approvalSubmitting" | "edit" | "toolParameters" | "statusAwaiting" | "statusResponded" | "statusCompleted" | "statusDenied" | "statusError" | "statusRunning" | "statusSuperseded" | "stepNoLongerActive" | "tabHome" | "tabConversations" | "tabHelp" | "tabNews" | "modulesEmpty" | "moduleBack" | "contentLoading" | "homeGreeting" | "homeGreetingNamed" | "homeGreetingLead" | "homeSearchPlaceholder" | "homeContentTitle" | "homeStatus" | "helpTitle" | "helpSearchPlaceholder" | "helpEmpty" | "helpLoading" | "helpSearchEmpty" | "newsTitle" | "newsEmpty" | "newsLoading" | "newsBack" | "newsPublishedAt";
43
+ type StringKey = "launcherOpen" | "launcherLabel" | "panelTitle" | "composerPlaceholder" | "send" | "stop" | "attach" | "micStart" | "micStop" | "micUnsupported" | "expand" | "collapse" | "fullscreen" | "exitFullscreen" | "resizeHandle" | "scrollToBottom" | "close" | "moreActions" | "soundOn" | "soundOff" | "language" | "theme" | "themeAuto" | "themeLight" | "themeDark" | "textSize" | "textSizeSmall" | "textSizeNormal" | "textSizeLarge" | "history" | "historyTitle" | "historyEmpty" | "historyLoading" | "historyBack" | "historyContinue" | "conversationLoading" | "conversationClosed" | "startNewConversation" | "dateToday" | "dateYesterday" | "dateLastWeek" | "dateOlder" | "newConversation" | "dropZone" | "attachmentTooLarge" | "attachmentTooMany" | "attachmentMimeRejected" | "errorRetry" | "errorGeneric" | "errorRateLimited" | "loading" | "thinking" | "thoughts" | "usedTool" | "toolResult" | "sources" | "collapseSidebar" | "expandSidebar" | "formSubmit" | "formSkip" | "formSubmitted" | "formSkipped" | "formFillOut" | "formRequired" | "formInvalidEmail" | "formInvalidTel" | "formInvalidUrl" | "formInvalidNumber" | "formTooShort" | "formTooLong" | "formNumberTooSmall" | "formNumberTooLarge" | "formPatternMismatch" | "formChooseAtLeast" | "formChooseAtMost" | "formOther" | "formOtherPlaceholder" | "inputRequired" | "inputBadge" | "inputAnswered" | "inputSkipped" | "inputQuestion" | "inputResponse" | "inputYourAnswer" | "inputSubmit" | "inputSubmitHint" | "inputAnswerPlaceholder" | "inputSkip" | "confirmYes" | "confirmNo" | "inputConfirmHint" | "inputOptionalNote" | "inputOptionalNotePlaceholder" | "inputSubmitted" | "respFreeText" | "respSingleChoice" | "respMultiChoice" | "respConfirmation" | "approvalRequired" | "approve" | "reject" | "approved" | "rejected" | "approvalReason" | "approvalPrompt" | "approvalBody" | "approvalYourResponse" | "approvalEditHint" | "approvalSubmitting" | "edit" | "toolParameters" | "statusAwaiting" | "statusResponded" | "statusCompleted" | "statusDenied" | "statusError" | "statusRunning" | "statusSuperseded" | "tabHome" | "tabConversations" | "tabHelp" | "tabNews" | "modulesEmpty" | "moduleBack" | "contentLoading" | "homeGreeting" | "homeGreetingNamed" | "homeGreetingLead" | "homeSearchPlaceholder" | "homeContentTitle" | "homeStatus" | "helpTitle" | "helpSearchPlaceholder" | "helpEmpty" | "helpLoading" | "helpSearchEmpty" | "newsTitle" | "newsEmpty" | "newsLoading" | "newsBack" | "newsPublishedAt";
44
44
  /** A partial map for one locale — what overrides look like on the wire. */
45
45
  type LocaleStrings = Partial<Record<StringKey, string>>;
46
46
  /**
package/index.mjs CHANGED
@@ -29,7 +29,7 @@ var BRAND = {
29
29
  };
30
30
 
31
31
  // src/core/version.ts
32
- var ELEMENTS_VERSION = true ? "0.51.12" : "0.0.0-dev";
32
+ var ELEMENTS_VERSION = true ? "0.51.14" : "0.0.0-dev";
33
33
  var ELEMENTS_VERSION_PARAM = "_ev";
34
34
 
35
35
  // src/i18n/strings.ts
@@ -169,7 +169,6 @@ var STRINGS_EN = {
169
169
  approvalEditHint: "You can edit this response until this step continues.",
170
170
  approvalSubmitting: "Response submitted. Request in progress\u2026",
171
171
  edit: "Edit",
172
- stepNoLongerActive: "This request is no longer active.",
173
172
  toolParameters: "Parameters",
174
173
  statusAwaiting: "Awaiting Approval",
175
174
  statusResponded: "Responded",
@@ -315,7 +314,6 @@ var STRINGS_FR = {
315
314
  approvalEditHint: "Vous pouvez modifier votre r\xE9ponse jusqu'\xE0 la reprise de cette \xE9tape.",
316
315
  approvalSubmitting: "R\xE9ponse envoy\xE9e. Traitement en cours\u2026",
317
316
  edit: "Modifier",
318
- stepNoLongerActive: "Cette demande n'est plus active.",
319
317
  toolParameters: "Param\xE8tres",
320
318
  statusAwaiting: "En attente d'approbation",
321
319
  statusResponded: "R\xE9pondu",
@@ -461,7 +459,6 @@ var STRINGS_AR = {
461
459
  approvalEditHint: "\u064A\u0645\u0643\u0646\u0643 \u062A\u0639\u062F\u064A\u0644 \u0631\u062F\u0651\u0643 \u062D\u062A\u0649 \u062A\u0633\u062A\u0623\u0646\u0641 \u0647\u0630\u0647 \u0627\u0644\u062E\u0637\u0648\u0629.",
462
460
  approvalSubmitting: "\u062A\u0645 \u0625\u0631\u0633\u0627\u0644 \u0627\u0644\u0631\u062F. \u062C\u0627\u0631\u064D \u0627\u0644\u062A\u0646\u0641\u064A\u0630\u2026",
463
461
  edit: "\u062A\u0639\u062F\u064A\u0644",
464
- stepNoLongerActive: "\u0644\u0645 \u064A\u0639\u062F \u0647\u0630\u0627 \u0627\u0644\u0637\u0644\u0628 \u0646\u0634\u0637\u064B\u0627.",
465
462
  toolParameters: "\u0627\u0644\u0645\u0639\u0637\u064A\u0627\u062A",
466
463
  statusAwaiting: "\u0628\u0627\u0646\u062A\u0638\u0627\u0631 \u0627\u0644\u0645\u0648\u0627\u0641\u0642\u0629",
467
464
  statusResponded: "\u062A\u0645 \u0627\u0644\u0631\u062F",
@@ -607,7 +604,6 @@ var STRINGS_ES = {
607
604
  approvalEditHint: "Puedes cambiar tu respuesta hasta que este paso contin\xFAe.",
608
605
  approvalSubmitting: "Respuesta enviada. Procesando\u2026",
609
606
  edit: "Editar",
610
- stepNoLongerActive: "Esta solicitud ya no est\xE1 activa.",
611
607
  toolParameters: "Par\xE1metros",
612
608
  statusAwaiting: "Esperando aprobaci\xF3n",
613
609
  statusResponded: "Respondido",
@@ -5462,6 +5458,7 @@ function ToolApproval({ part, strings, active, onDecision, onEdit }) {
5462
5458
  const approved = approval.value?.approved;
5463
5459
  const { terminal, responded, decided } = toolDecisionState(state.value, approval.value);
5464
5460
  const editable = responded && active && !terminal;
5461
+ const superseded = !decided && !active;
5465
5462
  const id = part.toolCallId;
5466
5463
  return /* @__PURE__ */ jsxs12("div", { class: `${p14}-toolui-group`, "data-testid": decided ? TID.toolDecision : TID.toolApproval, children: [
5467
5464
  /* @__PURE__ */ jsxs12("details", { class: `${p14}-toolui ${p14}-toolui-collapsible`, children: [
@@ -5472,14 +5469,14 @@ function ToolApproval({ part, strings, active, onDecision, onEdit }) {
5472
5469
  state: state.value,
5473
5470
  approval: approval.value,
5474
5471
  strings,
5475
- superseded: !decided && !active
5472
+ superseded
5476
5473
  }
5477
5474
  ) }),
5478
5475
  /* @__PURE__ */ jsx15(ToolSection, { label: strings.toolParameters, value: input.value }),
5479
5476
  output.value !== void 0 ? /* @__PURE__ */ jsx15(ToolSection, { label: strings.toolResult, value: output.value }) : null,
5480
5477
  error.value ? /* @__PURE__ */ jsx15(ToolSection, { label: strings.statusError, value: error.value, error: true }) : null
5481
5478
  ] }),
5482
- /* @__PURE__ */ jsxs12("div", { class: `${p14}-toolui ${p14}-toolui-body`, children: [
5479
+ superseded ? null : /* @__PURE__ */ jsxs12("div", { class: `${p14}-toolui ${p14}-toolui-body`, children: [
5483
5480
  responded ? (
5484
5481
  // DECIDED — lead with the recorded response (no repeated prompt/body), so the card barely
5485
5482
  // changes height from the awaiting state and the Edit sits right under the edit hint.
@@ -5495,8 +5492,7 @@ function ToolApproval({ part, strings, active, onDecision, onEdit }) {
5495
5492
  // AWAITING — the prompt + what to do, then Reject / Approve.
5496
5493
  /* @__PURE__ */ jsxs12(Fragment3, { children: [
5497
5494
  /* @__PURE__ */ jsx15("p", { class: `${p14}-toolui-prompt`, children: strings.approvalPrompt.replace("{tool}", name) }),
5498
- /* @__PURE__ */ jsx15("p", { class: `${p14}-toolui-subtle`, children: strings.approvalBody }),
5499
- !active ? /* @__PURE__ */ jsx15("p", { class: `${p14}-toolui-subtle`, children: strings.stepNoLongerActive }) : null
5495
+ /* @__PURE__ */ jsx15("p", { class: `${p14}-toolui-subtle`, children: strings.approvalBody })
5500
5496
  ] })
5501
5497
  ),
5502
5498
  !decided && active ? /* @__PURE__ */ jsxs12("div", { class: `${p14}-toolui-actions`, children: [
@@ -5617,12 +5613,12 @@ function ToolAskInput({ part, strings, active, onSubmit, onDecision, onEdit }) {
5617
5613
  const stale = !active;
5618
5614
  return /* @__PURE__ */ jsxs13("div", { class: `${p15}-toolui${stale ? ` ${p15}-toolui-stale` : ""}`, "data-testid": TID.toolAskInput, children: [
5619
5615
  /* @__PURE__ */ jsxs13("div", { class: `${p15}-toolui-head`, children: [
5620
- /* @__PURE__ */ jsx16("span", { class: `${p15}-toolui-badge ${p15}-toolui-badge-accent`, children: strings.inputRequired }),
5616
+ stale ? /* @__PURE__ */ jsx16("span", { class: `${p15}-toolui-badge`, children: strings.statusSuperseded }) : /* @__PURE__ */ jsx16("span", { class: `${p15}-toolui-badge ${p15}-toolui-badge-accent`, children: strings.inputRequired }),
5621
5617
  /* @__PURE__ */ jsx16("span", { class: `${p15}-toolui-badge`, children: responseTypeLabel(req, strings) })
5622
5618
  ] }),
5623
5619
  req.description ? /* @__PURE__ */ jsx16("div", { class: `${p15}-toolui-desc`, children: req.description }) : null,
5624
5620
  /* @__PURE__ */ jsx16(Section, { label: strings.inputQuestion, text: req.question }),
5625
- stale ? /* @__PURE__ */ jsx16("p", { class: `${p15}-toolui-note`, children: strings.stepNoLongerActive }) : /* @__PURE__ */ jsx16(AskBody, { req, strings, resolve })
5621
+ stale ? null : /* @__PURE__ */ jsx16(AskBody, { req, strings, resolve })
5626
5622
  ] });
5627
5623
  }
5628
5624
  function AskBody({
package/package.json CHANGED
@@ -80,5 +80,5 @@
80
80
  ],
81
81
  "type": "module",
82
82
  "types": "./index.d.ts",
83
- "version": "0.51.12"
83
+ "version": "0.51.14"
84
84
  }
package/web-component.mjs CHANGED
@@ -165,7 +165,6 @@ var STRINGS_EN = {
165
165
  approvalEditHint: "You can edit this response until this step continues.",
166
166
  approvalSubmitting: "Response submitted. Request in progress\u2026",
167
167
  edit: "Edit",
168
- stepNoLongerActive: "This request is no longer active.",
169
168
  toolParameters: "Parameters",
170
169
  statusAwaiting: "Awaiting Approval",
171
170
  statusResponded: "Responded",
@@ -311,7 +310,6 @@ var STRINGS_FR = {
311
310
  approvalEditHint: "Vous pouvez modifier votre r\xE9ponse jusqu'\xE0 la reprise de cette \xE9tape.",
312
311
  approvalSubmitting: "R\xE9ponse envoy\xE9e. Traitement en cours\u2026",
313
312
  edit: "Modifier",
314
- stepNoLongerActive: "Cette demande n'est plus active.",
315
313
  toolParameters: "Param\xE8tres",
316
314
  statusAwaiting: "En attente d'approbation",
317
315
  statusResponded: "R\xE9pondu",
@@ -457,7 +455,6 @@ var STRINGS_AR = {
457
455
  approvalEditHint: "\u064A\u0645\u0643\u0646\u0643 \u062A\u0639\u062F\u064A\u0644 \u0631\u062F\u0651\u0643 \u062D\u062A\u0649 \u062A\u0633\u062A\u0623\u0646\u0641 \u0647\u0630\u0647 \u0627\u0644\u062E\u0637\u0648\u0629.",
458
456
  approvalSubmitting: "\u062A\u0645 \u0625\u0631\u0633\u0627\u0644 \u0627\u0644\u0631\u062F. \u062C\u0627\u0631\u064D \u0627\u0644\u062A\u0646\u0641\u064A\u0630\u2026",
459
457
  edit: "\u062A\u0639\u062F\u064A\u0644",
460
- stepNoLongerActive: "\u0644\u0645 \u064A\u0639\u062F \u0647\u0630\u0627 \u0627\u0644\u0637\u0644\u0628 \u0646\u0634\u0637\u064B\u0627.",
461
458
  toolParameters: "\u0627\u0644\u0645\u0639\u0637\u064A\u0627\u062A",
462
459
  statusAwaiting: "\u0628\u0627\u0646\u062A\u0638\u0627\u0631 \u0627\u0644\u0645\u0648\u0627\u0641\u0642\u0629",
463
460
  statusResponded: "\u062A\u0645 \u0627\u0644\u0631\u062F",
@@ -603,7 +600,6 @@ var STRINGS_ES = {
603
600
  approvalEditHint: "Puedes cambiar tu respuesta hasta que este paso contin\xFAe.",
604
601
  approvalSubmitting: "Respuesta enviada. Procesando\u2026",
605
602
  edit: "Editar",
606
- stepNoLongerActive: "Esta solicitud ya no est\xE1 activa.",
607
603
  toolParameters: "Par\xE1metros",
608
604
  statusAwaiting: "Esperando aprobaci\xF3n",
609
605
  statusResponded: "Respondido",
@@ -1798,7 +1794,7 @@ function createAuth(opts) {
1798
1794
  }
1799
1795
 
1800
1796
  // src/core/version.ts
1801
- var ELEMENTS_VERSION = true ? "0.51.12" : "0.0.0-dev";
1797
+ var ELEMENTS_VERSION = true ? "0.51.14" : "0.0.0-dev";
1802
1798
  var ELEMENTS_VERSION_PARAM = "_ev";
1803
1799
 
1804
1800
  // src/stream/types.ts
@@ -5421,6 +5417,7 @@ function ToolApproval({ part, strings, active, onDecision, onEdit }) {
5421
5417
  const approved = approval.value?.approved;
5422
5418
  const { terminal, responded, decided } = toolDecisionState(state.value, approval.value);
5423
5419
  const editable = responded && active && !terminal;
5420
+ const superseded = !decided && !active;
5424
5421
  const id = part.toolCallId;
5425
5422
  return /* @__PURE__ */ jsxs12("div", { class: `${p14}-toolui-group`, "data-testid": decided ? TID.toolDecision : TID.toolApproval, children: [
5426
5423
  /* @__PURE__ */ jsxs12("details", { class: `${p14}-toolui ${p14}-toolui-collapsible`, children: [
@@ -5431,14 +5428,14 @@ function ToolApproval({ part, strings, active, onDecision, onEdit }) {
5431
5428
  state: state.value,
5432
5429
  approval: approval.value,
5433
5430
  strings,
5434
- superseded: !decided && !active
5431
+ superseded
5435
5432
  }
5436
5433
  ) }),
5437
5434
  /* @__PURE__ */ jsx15(ToolSection, { label: strings.toolParameters, value: input.value }),
5438
5435
  output.value !== void 0 ? /* @__PURE__ */ jsx15(ToolSection, { label: strings.toolResult, value: output.value }) : null,
5439
5436
  error.value ? /* @__PURE__ */ jsx15(ToolSection, { label: strings.statusError, value: error.value, error: true }) : null
5440
5437
  ] }),
5441
- /* @__PURE__ */ jsxs12("div", { class: `${p14}-toolui ${p14}-toolui-body`, children: [
5438
+ superseded ? null : /* @__PURE__ */ jsxs12("div", { class: `${p14}-toolui ${p14}-toolui-body`, children: [
5442
5439
  responded ? (
5443
5440
  // DECIDED — lead with the recorded response (no repeated prompt/body), so the card barely
5444
5441
  // changes height from the awaiting state and the Edit sits right under the edit hint.
@@ -5454,8 +5451,7 @@ function ToolApproval({ part, strings, active, onDecision, onEdit }) {
5454
5451
  // AWAITING — the prompt + what to do, then Reject / Approve.
5455
5452
  /* @__PURE__ */ jsxs12(Fragment3, { children: [
5456
5453
  /* @__PURE__ */ jsx15("p", { class: `${p14}-toolui-prompt`, children: strings.approvalPrompt.replace("{tool}", name) }),
5457
- /* @__PURE__ */ jsx15("p", { class: `${p14}-toolui-subtle`, children: strings.approvalBody }),
5458
- !active ? /* @__PURE__ */ jsx15("p", { class: `${p14}-toolui-subtle`, children: strings.stepNoLongerActive }) : null
5454
+ /* @__PURE__ */ jsx15("p", { class: `${p14}-toolui-subtle`, children: strings.approvalBody })
5459
5455
  ] })
5460
5456
  ),
5461
5457
  !decided && active ? /* @__PURE__ */ jsxs12("div", { class: `${p14}-toolui-actions`, children: [
@@ -5576,12 +5572,12 @@ function ToolAskInput({ part, strings, active, onSubmit, onDecision, onEdit }) {
5576
5572
  const stale = !active;
5577
5573
  return /* @__PURE__ */ jsxs13("div", { class: `${p15}-toolui${stale ? ` ${p15}-toolui-stale` : ""}`, "data-testid": TID.toolAskInput, children: [
5578
5574
  /* @__PURE__ */ jsxs13("div", { class: `${p15}-toolui-head`, children: [
5579
- /* @__PURE__ */ jsx16("span", { class: `${p15}-toolui-badge ${p15}-toolui-badge-accent`, children: strings.inputRequired }),
5575
+ stale ? /* @__PURE__ */ jsx16("span", { class: `${p15}-toolui-badge`, children: strings.statusSuperseded }) : /* @__PURE__ */ jsx16("span", { class: `${p15}-toolui-badge ${p15}-toolui-badge-accent`, children: strings.inputRequired }),
5580
5576
  /* @__PURE__ */ jsx16("span", { class: `${p15}-toolui-badge`, children: responseTypeLabel(req, strings) })
5581
5577
  ] }),
5582
5578
  req.description ? /* @__PURE__ */ jsx16("div", { class: `${p15}-toolui-desc`, children: req.description }) : null,
5583
5579
  /* @__PURE__ */ jsx16(Section, { label: strings.inputQuestion, text: req.question }),
5584
- stale ? /* @__PURE__ */ jsx16("p", { class: `${p15}-toolui-note`, children: strings.stepNoLongerActive }) : /* @__PURE__ */ jsx16(AskBody, { req, strings, resolve })
5580
+ stale ? null : /* @__PURE__ */ jsx16(AskBody, { req, strings, resolve })
5585
5581
  ] });
5586
5582
  }
5587
5583
  function AskBody({