@blinq_ai/widget 0.1.1 → 0.1.2

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.
@@ -13403,6 +13403,12 @@ var BlinqWidgetRuntime = (() => {
13403
13403
  }
13404
13404
 
13405
13405
  // src/page-tools.ts
13406
+ var DEFAULT_ACTION_POLICY = {
13407
+ actions_enabled: true,
13408
+ action_mode: "execute_with_confirmation",
13409
+ pointer_overlay_enabled: true
13410
+ };
13411
+ var GUIDANCE_SAFE_TOOL_NAMES = /* @__PURE__ */ new Set(["blinq.scroll_to_element"]);
13406
13412
  function isBrowser2() {
13407
13413
  return typeof window !== "undefined" && typeof document !== "undefined";
13408
13414
  }
@@ -13499,6 +13505,12 @@ var BlinqWidgetRuntime = (() => {
13499
13505
  }
13500
13506
  return target;
13501
13507
  }
13508
+ function shouldRequestConfirmation(toolName, readOnly) {
13509
+ if (readOnly) {
13510
+ return false;
13511
+ }
13512
+ return !GUIDANCE_SAFE_TOOL_NAMES.has(toolName);
13513
+ }
13502
13514
  function isDuplicateNativeToolError(error) {
13503
13515
  if (!(error instanceof Error)) {
13504
13516
  return false;
@@ -13660,6 +13672,15 @@ var BlinqWidgetRuntime = (() => {
13660
13672
  }
13661
13673
  return null;
13662
13674
  }
13675
+ function selectorFromArguments(argumentsPayload) {
13676
+ for (const key of ["selector", "field_selector", "submit_selector", "form_selector"]) {
13677
+ const value = argumentsPayload[key];
13678
+ if (typeof value === "string" && value.trim()) {
13679
+ return value.trim();
13680
+ }
13681
+ }
13682
+ return null;
13683
+ }
13663
13684
  function detectNativeWebMcpSupport() {
13664
13685
  if (!isBrowser2() || !window.isSecureContext) {
13665
13686
  return false;
@@ -13675,10 +13696,17 @@ var BlinqWidgetRuntime = (() => {
13675
13696
  nativeToolsActive = false;
13676
13697
  highlightLayer = null;
13677
13698
  highlightTimer = null;
13699
+ actionPolicy = { ...DEFAULT_ACTION_POLICY };
13678
13700
  constructor(confirmationHandler) {
13679
13701
  this.confirmationHandler = confirmationHandler;
13680
13702
  this.refreshToolCatalog();
13681
13703
  }
13704
+ setActionPolicy(nextPolicy) {
13705
+ this.actionPolicy = {
13706
+ ...DEFAULT_ACTION_POLICY,
13707
+ ...nextPolicy
13708
+ };
13709
+ }
13682
13710
  buildBaseTools() {
13683
13711
  const tools = /* @__PURE__ */ new Map();
13684
13712
  tools.set("blinq.read_visible_page_context", {
@@ -13852,7 +13880,7 @@ var BlinqWidgetRuntime = (() => {
13852
13880
  }
13853
13881
  getToolCapabilities() {
13854
13882
  this.refreshToolCatalog();
13855
- return Array.from(this.tools.values()).map((tool) => tool.capability);
13883
+ return Array.from(this.tools.values()).filter((tool) => this.isToolAllowed(tool)).map((tool) => tool.capability);
13856
13884
  }
13857
13885
  clearHighlights() {
13858
13886
  if (this.highlightTimer !== null) {
@@ -13878,13 +13906,52 @@ var BlinqWidgetRuntime = (() => {
13878
13906
  this.highlightLayer = layer;
13879
13907
  return layer;
13880
13908
  }
13909
+ ensureHighlightStyle() {
13910
+ if (document.getElementById("blinq-highlight-style")) {
13911
+ return;
13912
+ }
13913
+ const style = document.createElement("style");
13914
+ style.id = "blinq-highlight-style";
13915
+ style.textContent = `
13916
+ @keyframes blinq-highlight-pulse {
13917
+ 0%, 100% { opacity: 0.55; transform: scale(1); }
13918
+ 50% { opacity: 1; transform: scale(1.02); }
13919
+ }
13920
+
13921
+ @keyframes blinq-highlight-ripple {
13922
+ 0% { opacity: 0.36; transform: translate(-50%, -50%) scale(0.8); }
13923
+ 100% { opacity: 0; transform: translate(-50%, -50%) scale(1.7); }
13924
+ }
13925
+
13926
+ @keyframes blinq-pointer-bob {
13927
+ 0%, 100% { transform: translate3d(0, 0, 0) scale(1); }
13928
+ 50% { transform: translate3d(0, -2px, 0) scale(1.03); }
13929
+ }
13930
+ `;
13931
+ document.head.appendChild(style);
13932
+ }
13881
13933
  highlightTargets(targets, options) {
13882
13934
  if (!isBrowser2() || targets.length === 0) {
13883
13935
  return false;
13884
13936
  }
13885
13937
  this.clearHighlights();
13886
13938
  const layer = this.ensureHighlightLayer();
13939
+ this.ensureHighlightStyle();
13887
13940
  let highlightedCount = 0;
13941
+ let primaryRect = null;
13942
+ const backdrop = document.createElement("div");
13943
+ Object.assign(backdrop.style, {
13944
+ position: "fixed",
13945
+ inset: "0",
13946
+ background: "rgba(15, 23, 42, 0.08)",
13947
+ backdropFilter: "blur(1.5px)",
13948
+ opacity: "0",
13949
+ transition: "opacity 180ms ease"
13950
+ });
13951
+ layer.appendChild(backdrop);
13952
+ window.requestAnimationFrame(() => {
13953
+ backdrop.style.opacity = "1";
13954
+ });
13888
13955
  for (const target of targets) {
13889
13956
  if (!target.selector) {
13890
13957
  continue;
@@ -13898,21 +13965,30 @@ var BlinqWidgetRuntime = (() => {
13898
13965
  if (!element) {
13899
13966
  continue;
13900
13967
  }
13968
+ if (!primaryRect) {
13969
+ element.scrollIntoView({
13970
+ block: "center",
13971
+ inline: "nearest"
13972
+ });
13973
+ }
13901
13974
  const rect = element.getBoundingClientRect();
13902
13975
  if (rect.width <= 0 || rect.height <= 0) {
13903
13976
  continue;
13904
13977
  }
13978
+ if (!primaryRect) {
13979
+ primaryRect = rect;
13980
+ }
13905
13981
  const frame = document.createElement("div");
13906
13982
  Object.assign(frame.style, {
13907
13983
  position: "fixed",
13908
- left: `${Math.max(rect.left - 6, 4)}px`,
13909
- top: `${Math.max(rect.top - 6, 4)}px`,
13910
- width: `${Math.max(rect.width + 12, 18)}px`,
13911
- height: `${Math.max(rect.height + 12, 18)}px`,
13912
- border: "2px solid rgba(17, 17, 17, 0.92)",
13913
- borderRadius: "16px",
13914
- background: "rgba(17, 17, 17, 0.05)",
13915
- boxShadow: "0 0 0 1px rgba(255, 255, 255, 0.85), 0 18px 38px rgba(17, 17, 17, 0.14)",
13984
+ left: `${Math.max(rect.left - 8, 4)}px`,
13985
+ top: `${Math.max(rect.top - 8, 4)}px`,
13986
+ width: `${Math.max(rect.width + 16, 24)}px`,
13987
+ height: `${Math.max(rect.height + 16, 24)}px`,
13988
+ border: "3px solid rgba(17, 17, 17, 0.94)",
13989
+ borderRadius: "18px",
13990
+ background: "rgba(255, 255, 255, 0.16)",
13991
+ boxShadow: "0 0 0 1px rgba(255, 255, 255, 0.9), 0 24px 48px rgba(15, 23, 42, 0.18)",
13916
13992
  opacity: "0",
13917
13993
  transform: "scale(0.985)",
13918
13994
  transition: "opacity 180ms ease, transform 180ms ease"
@@ -13920,9 +13996,9 @@ var BlinqWidgetRuntime = (() => {
13920
13996
  const glow = document.createElement("div");
13921
13997
  Object.assign(glow.style, {
13922
13998
  position: "absolute",
13923
- inset: "-8px",
13924
- borderRadius: "20px",
13925
- border: "1px solid rgba(17, 17, 17, 0.14)",
13999
+ inset: "-10px",
14000
+ borderRadius: "22px",
14001
+ border: "1px solid rgba(37, 99, 235, 0.22)",
13926
14002
  animation: "blinq-highlight-pulse 1.2s ease-in-out infinite"
13927
14003
  });
13928
14004
  frame.appendChild(glow);
@@ -13931,15 +14007,15 @@ var BlinqWidgetRuntime = (() => {
13931
14007
  badge.textContent = target.label;
13932
14008
  Object.assign(badge.style, {
13933
14009
  position: "absolute",
13934
- top: "-14px",
14010
+ top: "-16px",
13935
14011
  left: "10px",
13936
- maxWidth: "min(220px, 70vw)",
13937
- padding: "4px 10px",
14012
+ maxWidth: "min(260px, 70vw)",
14013
+ padding: "6px 12px",
13938
14014
  borderRadius: "999px",
13939
14015
  background: "#111111",
13940
14016
  color: "#ffffff",
13941
14017
  fontFamily: '"Inter", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif',
13942
- fontSize: "11px",
14018
+ fontSize: "12px",
13943
14019
  fontWeight: "600",
13944
14020
  lineHeight: "1.3",
13945
14021
  whiteSpace: "nowrap",
@@ -13956,16 +14032,57 @@ var BlinqWidgetRuntime = (() => {
13956
14032
  });
13957
14033
  highlightedCount += 1;
13958
14034
  }
13959
- if (!document.getElementById("blinq-highlight-style")) {
13960
- const style = document.createElement("style");
13961
- style.id = "blinq-highlight-style";
13962
- style.textContent = `
13963
- @keyframes blinq-highlight-pulse {
13964
- 0%, 100% { opacity: 0.55; transform: scale(1); }
13965
- 50% { opacity: 1; transform: scale(1.02); }
13966
- }
14035
+ if (this.actionPolicy.pointer_overlay_enabled && primaryRect) {
14036
+ const pointer = document.createElement("div");
14037
+ pointer.setAttribute("data-blinq-pointer", options?.interaction ?? "explain");
14038
+ pointer.innerHTML = `
14039
+ <div style="position:absolute;inset:0;border-radius:999px;background:rgba(255,255,255,0.92);box-shadow:0 14px 28px rgba(15,23,42,0.18);"></div>
14040
+ <svg viewBox="0 0 40 40" width="40" height="40" fill="none" aria-hidden="true" style="position:relative;z-index:1;">
14041
+ <path d="M8 5L28 22H18.4L23.2 34.8L17.8 36.8L13 24H6.6L8 5Z" fill="#111111"/>
14042
+ <path d="M8 5L28 22H18.4L23.2 34.8L17.8 36.8L13 24H6.6L8 5Z" stroke="#ffffff" stroke-width="1.4" stroke-linejoin="round"/>
14043
+ </svg>
13967
14044
  `;
13968
- document.head.appendChild(style);
14045
+ Object.assign(pointer.style, {
14046
+ position: "fixed",
14047
+ left: `${Math.max(primaryRect.left - 72, 12)}px`,
14048
+ top: `${Math.max(primaryRect.bottom + 44, 12)}px`,
14049
+ width: "40px",
14050
+ height: "40px",
14051
+ zIndex: "2147483647",
14052
+ opacity: "0",
14053
+ transform: "translate3d(0, 0, 0) scale(0.92)",
14054
+ transition: "left 380ms cubic-bezier(.22,1,.36,1), top 380ms cubic-bezier(.22,1,.36,1), opacity 180ms ease, transform 380ms cubic-bezier(.22,1,.36,1)",
14055
+ filter: "drop-shadow(0 16px 28px rgba(15, 23, 42, 0.2))",
14056
+ animation: "blinq-pointer-bob 1.1s ease-in-out infinite"
14057
+ });
14058
+ layer.appendChild(pointer);
14059
+ const pointerTargetLeft = Math.max(primaryRect.left + 14, 8);
14060
+ const pointerTargetTop = Math.max(primaryRect.top + 14, 8);
14061
+ window.requestAnimationFrame(() => {
14062
+ pointer.style.opacity = "1";
14063
+ pointer.style.left = `${pointerTargetLeft}px`;
14064
+ pointer.style.top = `${pointerTargetTop}px`;
14065
+ pointer.style.transform = "translate3d(0, 0, 0) scale(1)";
14066
+ });
14067
+ if (options?.interaction === "execute") {
14068
+ const ripple = document.createElement("div");
14069
+ Object.assign(ripple.style, {
14070
+ position: "fixed",
14071
+ left: `${primaryRect.left + Math.min(primaryRect.width, 32) / 2}px`,
14072
+ top: `${primaryRect.top + Math.min(primaryRect.height, 32) / 2}px`,
14073
+ width: "34px",
14074
+ height: "34px",
14075
+ borderRadius: "999px",
14076
+ border: "3px solid rgba(17, 17, 17, 0.58)",
14077
+ background: "rgba(17, 17, 17, 0.12)",
14078
+ pointerEvents: "none",
14079
+ opacity: "0",
14080
+ transform: "translate(-50%, -50%) scale(0.8)",
14081
+ animation: "blinq-highlight-ripple 560ms ease-out 1 forwards",
14082
+ animationDelay: "320ms"
14083
+ });
14084
+ layer.appendChild(ripple);
14085
+ }
13969
14086
  }
13970
14087
  if (highlightedCount === 0) {
13971
14088
  this.clearHighlights();
@@ -13976,8 +14093,38 @@ var BlinqWidgetRuntime = (() => {
13976
14093
  }, options?.durationMs ?? 2200);
13977
14094
  return true;
13978
14095
  }
14096
+ isToolAllowed(tool) {
14097
+ if (tool.capability.read_only) {
14098
+ return true;
14099
+ }
14100
+ if (GUIDANCE_SAFE_TOOL_NAMES.has(tool.capability.name)) {
14101
+ return this.actionPolicy.actions_enabled;
14102
+ }
14103
+ return this.actionPolicy.actions_enabled && this.actionPolicy.action_mode === "execute_with_confirmation";
14104
+ }
14105
+ async previewToolRequest(request, options) {
14106
+ const selector = selectorFromArguments(request.arguments);
14107
+ if (!selector) {
14108
+ return false;
14109
+ }
14110
+ const label = (request.target_summary || request.display_name || "").trim() || void 0;
14111
+ const highlighted = this.highlightTargets(
14112
+ [{ selector, label }],
14113
+ {
14114
+ durationMs: options?.durationMs ?? (options?.interaction === "execute" ? 1600 : 2200),
14115
+ interaction: options?.interaction ?? "explain"
14116
+ }
14117
+ );
14118
+ if (!highlighted) {
14119
+ return false;
14120
+ }
14121
+ await new Promise(
14122
+ (resolve) => window.setTimeout(resolve, options?.interaction === "execute" ? 520 : 240)
14123
+ );
14124
+ return true;
14125
+ }
13979
14126
  canExecuteWriteTools() {
13980
- return isBrowser2();
14127
+ return isBrowser2() && this.actionPolicy.actions_enabled && this.actionPolicy.action_mode === "execute_with_confirmation";
13981
14128
  }
13982
14129
  async executeTool(request) {
13983
14130
  let tool = this.tools.get(request.tool_name);
@@ -13993,7 +14140,22 @@ var BlinqWidgetRuntime = (() => {
13993
14140
  }
13994
14141
  const displayName = request.display_name ?? tool.capability.name;
13995
14142
  const targetSummary = request.target_summary ?? tool.describeTarget?.(request.arguments) ?? tool.capability.description;
13996
- const requiresConfirmation = request.requires_confirmation ?? !tool.capability.read_only;
14143
+ const requiresConfirmation = request.requires_confirmation ?? shouldRequestConfirmation(request.tool_name, tool.capability.read_only);
14144
+ if (request.tool_name !== "blinq.highlight_element") {
14145
+ await this.previewToolRequest(request, {
14146
+ interaction: tool.capability.read_only ? "explain" : "execute"
14147
+ });
14148
+ }
14149
+ if (!tool.capability.read_only && !this.isToolAllowed(tool)) {
14150
+ return {
14151
+ status: "success",
14152
+ result: {
14153
+ success: true,
14154
+ guided: true,
14155
+ preview_only: true
14156
+ }
14157
+ };
14158
+ }
13997
14159
  if (!tool.capability.read_only && requiresConfirmation) {
13998
14160
  const confirmed = await this.confirmationHandler({
13999
14161
  displayName,
@@ -14035,6 +14197,9 @@ var BlinqWidgetRuntime = (() => {
14035
14197
  this.refreshToolCatalog();
14036
14198
  this.unregisterNativeTools();
14037
14199
  for (const [toolName, tool] of this.tools) {
14200
+ if (!this.isToolAllowed(tool)) {
14201
+ continue;
14202
+ }
14038
14203
  const controller = new AbortController();
14039
14204
  try {
14040
14205
  modelContext.registerTool(
@@ -14078,8 +14243,123 @@ var BlinqWidgetRuntime = (() => {
14078
14243
  // src/embed-shell.tsx
14079
14244
  var React9 = __toESM(require_react(), 1);
14080
14245
 
14246
+ // ../node_modules/lucide-react/dist/esm/createLucideIcon.js
14247
+ var import_react3 = __toESM(require_react());
14248
+
14249
+ // ../node_modules/lucide-react/dist/esm/shared/src/utils/mergeClasses.js
14250
+ var mergeClasses = (...classes) => classes.filter((className, index, array) => {
14251
+ return Boolean(className) && className.trim() !== "" && array.indexOf(className) === index;
14252
+ }).join(" ").trim();
14253
+
14254
+ // ../node_modules/lucide-react/dist/esm/shared/src/utils/toKebabCase.js
14255
+ var toKebabCase = (string) => string.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase();
14256
+
14257
+ // ../node_modules/lucide-react/dist/esm/shared/src/utils/toCamelCase.js
14258
+ var toCamelCase = (string) => string.replace(
14259
+ /^([A-Z])|[\s-_]+(\w)/g,
14260
+ (match, p1, p2) => p2 ? p2.toUpperCase() : p1.toLowerCase()
14261
+ );
14262
+
14263
+ // ../node_modules/lucide-react/dist/esm/shared/src/utils/toPascalCase.js
14264
+ var toPascalCase = (string) => {
14265
+ const camelCase = toCamelCase(string);
14266
+ return camelCase.charAt(0).toUpperCase() + camelCase.slice(1);
14267
+ };
14268
+
14269
+ // ../node_modules/lucide-react/dist/esm/Icon.js
14270
+ var import_react2 = __toESM(require_react());
14271
+
14272
+ // ../node_modules/lucide-react/dist/esm/defaultAttributes.js
14273
+ var defaultAttributes = {
14274
+ xmlns: "http://www.w3.org/2000/svg",
14275
+ width: 24,
14276
+ height: 24,
14277
+ viewBox: "0 0 24 24",
14278
+ fill: "none",
14279
+ stroke: "currentColor",
14280
+ strokeWidth: 2,
14281
+ strokeLinecap: "round",
14282
+ strokeLinejoin: "round"
14283
+ };
14284
+
14285
+ // ../node_modules/lucide-react/dist/esm/shared/src/utils/hasA11yProp.js
14286
+ var hasA11yProp = (props) => {
14287
+ for (const prop in props) {
14288
+ if (prop.startsWith("aria-") || prop === "role" || prop === "title") {
14289
+ return true;
14290
+ }
14291
+ }
14292
+ return false;
14293
+ };
14294
+
14295
+ // ../node_modules/lucide-react/dist/esm/context.js
14296
+ var import_react = __toESM(require_react());
14297
+ var LucideContext = (0, import_react.createContext)({});
14298
+ var useLucideContext = () => (0, import_react.useContext)(LucideContext);
14299
+
14300
+ // ../node_modules/lucide-react/dist/esm/Icon.js
14301
+ var Icon = (0, import_react2.forwardRef)(
14302
+ ({ color, size, strokeWidth, absoluteStrokeWidth, className = "", children, iconNode, ...rest }, ref) => {
14303
+ const {
14304
+ size: contextSize = 24,
14305
+ strokeWidth: contextStrokeWidth = 2,
14306
+ absoluteStrokeWidth: contextAbsoluteStrokeWidth = false,
14307
+ color: contextColor = "currentColor",
14308
+ className: contextClass = ""
14309
+ } = useLucideContext() ?? {};
14310
+ const calculatedStrokeWidth = absoluteStrokeWidth ?? contextAbsoluteStrokeWidth ? Number(strokeWidth ?? contextStrokeWidth) * 24 / Number(size ?? contextSize) : strokeWidth ?? contextStrokeWidth;
14311
+ return (0, import_react2.createElement)(
14312
+ "svg",
14313
+ {
14314
+ ref,
14315
+ ...defaultAttributes,
14316
+ width: size ?? contextSize ?? defaultAttributes.width,
14317
+ height: size ?? contextSize ?? defaultAttributes.height,
14318
+ stroke: color ?? contextColor,
14319
+ strokeWidth: calculatedStrokeWidth,
14320
+ className: mergeClasses("lucide", contextClass, className),
14321
+ ...!children && !hasA11yProp(rest) && { "aria-hidden": "true" },
14322
+ ...rest
14323
+ },
14324
+ [
14325
+ ...iconNode.map(([tag, attrs]) => (0, import_react2.createElement)(tag, attrs)),
14326
+ ...Array.isArray(children) ? children : [children]
14327
+ ]
14328
+ );
14329
+ }
14330
+ );
14331
+
14332
+ // ../node_modules/lucide-react/dist/esm/createLucideIcon.js
14333
+ var createLucideIcon = (iconName, iconNode) => {
14334
+ const Component = (0, import_react3.forwardRef)(
14335
+ ({ className, ...props }, ref) => (0, import_react3.createElement)(Icon, {
14336
+ ref,
14337
+ iconNode,
14338
+ className: mergeClasses(
14339
+ `lucide-${toKebabCase(toPascalCase(iconName))}`,
14340
+ `lucide-${iconName}`,
14341
+ className
14342
+ ),
14343
+ ...props
14344
+ })
14345
+ );
14346
+ Component.displayName = toPascalCase(iconName);
14347
+ return Component;
14348
+ };
14349
+
14350
+ // ../node_modules/lucide-react/dist/esm/icons/bot.js
14351
+ var __iconNode = [
14352
+ ["path", { d: "M12 8V4H8", key: "hb8ula" }],
14353
+ ["rect", { width: "16", height: "12", x: "4", y: "8", rx: "2", key: "enze0r" }],
14354
+ ["path", { d: "M2 14h2", key: "vft8re" }],
14355
+ ["path", { d: "M20 14h2", key: "4cs60a" }],
14356
+ ["path", { d: "M15 13v2", key: "1xurst" }],
14357
+ ["path", { d: "M9 13v2", key: "rq6x2g" }]
14358
+ ];
14359
+ var Bot = createLucideIcon("bot", __iconNode);
14360
+
14081
14361
  // ../node_modules/@assistant-ui/tap/dist/react/use-resource.js
14082
- var import_react = __toESM(require_react(), 1);
14362
+ var import_react4 = __toESM(require_react(), 1);
14083
14363
 
14084
14364
  // ../node_modules/@assistant-ui/tap/dist/core/helpers/commit.js
14085
14365
  function commitAllEffects(renderResult) {
@@ -14276,32 +14556,32 @@ var BlinqWidgetRuntime = (() => {
14276
14556
  var useDevStrictMode = () => {
14277
14557
  if (!isDevelopment)
14278
14558
  return null;
14279
- const count = (0, import_react.useRef)(0);
14559
+ const count = (0, import_react4.useRef)(0);
14280
14560
  const isFirstRender = count.current === 0;
14281
- (0, import_react.useState)(() => count.current++);
14561
+ (0, import_react4.useState)(() => count.current++);
14282
14562
  if (count.current !== 2)
14283
14563
  return null;
14284
14564
  return isFirstRender ? "child" : "root";
14285
14565
  };
14286
14566
  function useResource(element) {
14287
- const root = (0, import_react.useMemo)(() => {
14567
+ const root = (0, import_react4.useMemo)(() => {
14288
14568
  return createResourceFiberRoot((cb) => dispatch(cb));
14289
14569
  }, []);
14290
- const [version2, dispatch] = (0, import_react.useReducer)((v, cb) => {
14570
+ const [version2, dispatch] = (0, import_react4.useReducer)((v, cb) => {
14291
14571
  setRootVersion(root, v);
14292
14572
  return v + (cb() ? 1 : 0);
14293
14573
  }, 0);
14294
14574
  setRootVersion(root, version2);
14295
14575
  const devStrictMode = useDevStrictMode();
14296
- const fiber = (0, import_react.useMemo)(() => {
14576
+ const fiber = (0, import_react4.useMemo)(() => {
14297
14577
  void element.key;
14298
14578
  return createResourceFiber(element.type, root, void 0, devStrictMode);
14299
14579
  }, [element.type, element.key, root, devStrictMode]);
14300
14580
  const result = renderResourceFiber(fiber, element.props);
14301
- (0, import_react.useLayoutEffect)(() => {
14581
+ (0, import_react4.useLayoutEffect)(() => {
14302
14582
  return () => unmountResourceFiber(fiber);
14303
14583
  }, [fiber]);
14304
- (0, import_react.useLayoutEffect)(() => {
14584
+ (0, import_react4.useLayoutEffect)(() => {
14305
14585
  commitRoot(root);
14306
14586
  commitResourceFiber(fiber, result);
14307
14587
  });
@@ -14822,7 +15102,7 @@ var BlinqWidgetRuntime = (() => {
14822
15102
 
14823
15103
  // ../node_modules/@assistant-ui/store/dist/utils/react-assistant-context.js
14824
15104
  var import_jsx_runtime = __toESM(require_jsx_runtime(), 1);
14825
- var import_react2 = __toESM(require_react(), 1);
15105
+ var import_react5 = __toESM(require_react(), 1);
14826
15106
 
14827
15107
  // ../node_modules/@assistant-ui/store/dist/utils/tap-client-stack-context.js
14828
15108
  var SYMBOL_CLIENT_INDEX = /* @__PURE__ */ Symbol("assistant-ui.store.clientIndex");
@@ -15056,9 +15336,9 @@ var BlinqWidgetRuntime = (() => {
15056
15336
  return createErrorClientField(`The current scope does not have a "${String(prop)}" property.`);
15057
15337
  }
15058
15338
  });
15059
- var AssistantContext = (0, import_react2.createContext)(DefaultAssistantClient);
15339
+ var AssistantContext = (0, import_react5.createContext)(DefaultAssistantClient);
15060
15340
  var useAssistantContextValue = () => {
15061
- return (0, import_react2.useContext)(AssistantContext);
15341
+ return (0, import_react5.useContext)(AssistantContext);
15062
15342
  };
15063
15343
  var AuiProvider = ({ value, children }) => {
15064
15344
  return (0, import_jsx_runtime.jsx)(AssistantContext.Provider, { value, children });
@@ -15404,37 +15684,37 @@ var BlinqWidgetRuntime = (() => {
15404
15684
  }
15405
15685
 
15406
15686
  // ../node_modules/@assistant-ui/store/dist/useAuiState.js
15407
- var import_react4 = __toESM(require_react(), 1);
15687
+ var import_react7 = __toESM(require_react(), 1);
15408
15688
  var useAuiState = (selector) => {
15409
15689
  const aui = useAui();
15410
15690
  const proxiedState = getProxiedAssistantState(aui);
15411
- const slice = (0, import_react4.useSyncExternalStore)(aui.subscribe, () => selector(proxiedState), () => selector(proxiedState));
15691
+ const slice = (0, import_react7.useSyncExternalStore)(aui.subscribe, () => selector(proxiedState), () => selector(proxiedState));
15412
15692
  if (slice === proxiedState) {
15413
15693
  throw new Error("You tried to return the entire AssistantState. This is not supported due to technical limitations.");
15414
15694
  }
15415
- (0, import_react4.useDebugValue)(slice);
15695
+ (0, import_react7.useDebugValue)(slice);
15416
15696
  return slice;
15417
15697
  };
15418
15698
 
15419
15699
  // ../node_modules/@assistant-ui/store/dist/useAuiEvent.js
15420
- var import_react6 = __toESM(require_react(), 1);
15700
+ var import_react9 = __toESM(require_react(), 1);
15421
15701
 
15422
15702
  // ../node_modules/use-effect-event/dist/index.js
15423
- var import_react5 = __toESM(require_react(), 1);
15424
- var context = import_react5.default.createContext(true);
15703
+ var import_react8 = __toESM(require_react(), 1);
15704
+ var context = import_react8.default.createContext(true);
15425
15705
  function forbiddenInRender() {
15426
15706
  throw new Error("A function wrapped in useEffectEvent can't be called during rendering.");
15427
15707
  }
15428
- var isInvalidExecutionContextForEventFunction = "use" in import_react5.default ? () => {
15708
+ var isInvalidExecutionContextForEventFunction = "use" in import_react8.default ? () => {
15429
15709
  try {
15430
- return import_react5.default.use(context);
15710
+ return import_react8.default.use(context);
15431
15711
  } catch {
15432
15712
  return false;
15433
15713
  }
15434
15714
  } : () => false;
15435
15715
  function useEffectEvent(fn) {
15436
- const ref = import_react5.default.useRef(forbiddenInRender);
15437
- return import_react5.default.useInsertionEffect(() => {
15716
+ const ref = import_react8.default.useRef(forbiddenInRender);
15717
+ return import_react8.default.useInsertionEffect(() => {
15438
15718
  ref.current = fn;
15439
15719
  }, [fn]), (...args) => {
15440
15720
  isInvalidExecutionContextForEventFunction() && forbiddenInRender();
@@ -15448,14 +15728,14 @@ var BlinqWidgetRuntime = (() => {
15448
15728
  const aui = useAui();
15449
15729
  const callbackRef = useEffectEvent(callback);
15450
15730
  const { scope, event } = normalizeEventSelector(selector);
15451
- (0, import_react6.useEffect)(() => aui.on({ scope, event }, callbackRef), [aui, scope, event, callbackRef]);
15731
+ (0, import_react9.useEffect)(() => aui.on({ scope, event }, callbackRef), [aui, scope, event, callbackRef]);
15452
15732
  };
15453
15733
 
15454
15734
  // ../node_modules/@assistant-ui/store/dist/RenderChildrenWithAccessor.js
15455
- var import_react7 = __toESM(require_react(), 1);
15735
+ var import_react10 = __toESM(require_react(), 1);
15456
15736
  var useGetItemAccessor = (getItemState) => {
15457
15737
  const aui = useAui();
15458
- const cacheRef = (0, import_react7.useRef)(void 0);
15738
+ const cacheRef = (0, import_react10.useRef)(void 0);
15459
15739
  useAuiState(() => {
15460
15740
  if (cacheRef.current === void 0) {
15461
15741
  cacheRef.current = getItemState(aui);
@@ -15479,7 +15759,7 @@ var BlinqWidgetRuntime = (() => {
15479
15759
  const resultProps = typeof el?.props === "object" && el.props != null && Object.entries(el.props).length === 0 ? EMPTY_OBJECT : el?.props;
15480
15760
  return (
15481
15761
  // biome-ignore lint/correctness/useExhaustiveDependencies: optimization
15482
- (0, import_react7.useMemo)(() => el, [resultType, resultKey, resultProps]) ?? node
15762
+ (0, import_react10.useMemo)(() => el, [resultType, resultKey, resultProps]) ?? node
15483
15763
  );
15484
15764
  };
15485
15765
 
@@ -15549,15 +15829,15 @@ var BlinqWidgetRuntime = (() => {
15549
15829
  var createStore = ((createState) => createState ? createStoreImpl(createState) : createStoreImpl);
15550
15830
 
15551
15831
  // ../node_modules/zustand/esm/react.mjs
15552
- var import_react8 = __toESM(require_react(), 1);
15832
+ var import_react11 = __toESM(require_react(), 1);
15553
15833
  var identity = (arg) => arg;
15554
15834
  function useStore(api, selector = identity) {
15555
- const slice = import_react8.default.useSyncExternalStore(
15835
+ const slice = import_react11.default.useSyncExternalStore(
15556
15836
  api.subscribe,
15557
- import_react8.default.useCallback(() => selector(api.getState()), [api, selector]),
15558
- import_react8.default.useCallback(() => selector(api.getInitialState()), [api, selector])
15837
+ import_react11.default.useCallback(() => selector(api.getState()), [api, selector]),
15838
+ import_react11.default.useCallback(() => selector(api.getInitialState()), [api, selector])
15559
15839
  );
15560
- import_react8.default.useDebugValue(slice);
15840
+ import_react11.default.useDebugValue(slice);
15561
15841
  return slice;
15562
15842
  }
15563
15843
  var createImpl = (createState) => {
@@ -17507,7 +17787,7 @@ ${config.system}`;
17507
17787
  this.setAttachments([]);
17508
17788
  await task;
17509
17789
  }
17510
- async send() {
17790
+ async send(options) {
17511
17791
  if (this.isEmpty)
17512
17792
  return;
17513
17793
  if (this._dictationSession) {
@@ -17535,7 +17815,7 @@ ${config.system}`;
17535
17815
  runConfig: this.runConfig,
17536
17816
  metadata: { custom: { ...quote ? { quote } : {} } }
17537
17817
  };
17538
- this.handleSend(message);
17818
+ this.handleSend(message, options);
17539
17819
  this._notifyEventSubscribers("send");
17540
17820
  }
17541
17821
  cancel() {
@@ -17788,11 +18068,12 @@ ${config.system}`;
17788
18068
  }
17789
18069
  });
17790
18070
  }
17791
- async handleSend(message) {
18071
+ async handleSend(message, options) {
17792
18072
  this.runtime.append({
17793
18073
  ...message,
17794
18074
  parentId: this.runtime.messages.at(-1)?.id ?? null,
17795
- sourceId: null
18075
+ sourceId: null,
18076
+ startRun: options?.startRun
17796
18077
  });
17797
18078
  }
17798
18079
  async handleCancel() {
@@ -17830,14 +18111,21 @@ ${config.system}`;
17830
18111
  this._nonTextParts = message.content.filter((part) => part.type !== "text");
17831
18112
  this.setRunConfig({ ...runtime.composer.runConfig });
17832
18113
  }
17833
- async handleSend(message) {
18114
+ get parentId() {
18115
+ return this._parentId;
18116
+ }
18117
+ get sourceId() {
18118
+ return this._sourceId;
18119
+ }
18120
+ async handleSend(message, options) {
17834
18121
  const text = getThreadMessageText(message);
17835
- if (text !== this._previousText) {
18122
+ if (text !== this._previousText || options?.startRun) {
17836
18123
  this.runtime.append({
17837
18124
  ...message,
17838
18125
  content: [...message.content, ...this._nonTextParts],
17839
18126
  parentId: this._parentId,
17840
- sourceId: this._sourceId
18127
+ sourceId: this._sourceId,
18128
+ startRun: options?.startRun
17841
18129
  });
17842
18130
  }
17843
18131
  this.handleCancel();
@@ -18390,6 +18678,8 @@ ${config.system}`;
18390
18678
  attachmentAccept: runtime?.attachmentAccept ?? "",
18391
18679
  dictation: runtime?.dictation,
18392
18680
  quote: runtime?.quote,
18681
+ parentId: runtime?.parentId ?? null,
18682
+ sourceId: runtime?.sourceId ?? null,
18393
18683
  value: runtime?.text ?? ""
18394
18684
  });
18395
18685
  };
@@ -18448,11 +18738,11 @@ ${config.system}`;
18448
18738
  throw new Error("Composer is not available");
18449
18739
  return core.clearAttachments();
18450
18740
  }
18451
- send() {
18741
+ send(options) {
18452
18742
  const core = this._core.getState();
18453
18743
  if (!core)
18454
18744
  throw new Error("Composer is not available");
18455
- core.send();
18745
+ core.send(options);
18456
18746
  }
18457
18747
  cancel() {
18458
18748
  const core = this._core.getState();
@@ -19308,14 +19598,14 @@ ${config.system}`;
19308
19598
 
19309
19599
  // ../node_modules/@assistant-ui/core/dist/react/runtimes/RuntimeAdapterProvider.js
19310
19600
  var import_jsx_runtime8 = __toESM(require_jsx_runtime(), 1);
19311
- var import_react9 = __toESM(require_react(), 1);
19312
- var RuntimeAdaptersContext = (0, import_react9.createContext)(null);
19601
+ var import_react12 = __toESM(require_react(), 1);
19602
+ var RuntimeAdaptersContext = (0, import_react12.createContext)(null);
19313
19603
  var useRuntimeAdapters = () => {
19314
- return (0, import_react9.useContext)(RuntimeAdaptersContext);
19604
+ return (0, import_react12.useContext)(RuntimeAdaptersContext);
19315
19605
  };
19316
19606
 
19317
19607
  // ../node_modules/@assistant-ui/core/dist/react/runtimes/useExternalStoreRuntime.js
19318
- var import_react10 = __toESM(require_react(), 1);
19608
+ var import_react13 = __toESM(require_react(), 1);
19319
19609
 
19320
19610
  // ../node_modules/@assistant-ui/core/dist/runtimes/external-store/external-store-thread-list-runtime-core.js
19321
19611
  var EMPTY_ARRAY3 = Object.freeze([]);
@@ -19768,26 +20058,26 @@ ${config.system}`;
19768
20058
 
19769
20059
  // ../node_modules/@assistant-ui/core/dist/react/runtimes/useExternalStoreRuntime.js
19770
20060
  var useExternalStoreRuntime = (store) => {
19771
- const [runtime] = (0, import_react10.useState)(() => new ExternalStoreRuntimeCore(store));
19772
- (0, import_react10.useEffect)(() => {
20061
+ const [runtime] = (0, import_react13.useState)(() => new ExternalStoreRuntimeCore(store));
20062
+ (0, import_react13.useEffect)(() => {
19773
20063
  runtime.setAdapter(store);
19774
20064
  });
19775
20065
  const { modelContext } = useRuntimeAdapters() ?? {};
19776
- (0, import_react10.useEffect)(() => {
20066
+ (0, import_react13.useEffect)(() => {
19777
20067
  if (!modelContext)
19778
20068
  return void 0;
19779
20069
  return runtime.registerModelContextProvider(modelContext);
19780
20070
  }, [modelContext, runtime]);
19781
- return (0, import_react10.useMemo)(() => new AssistantRuntimeImpl(runtime), [runtime]);
20071
+ return (0, import_react13.useMemo)(() => new AssistantRuntimeImpl(runtime), [runtime]);
19782
20072
  };
19783
20073
 
19784
20074
  // ../node_modules/@assistant-ui/core/dist/react/AssistantProvider.js
19785
20075
  var import_jsx_runtime9 = __toESM(require_jsx_runtime(), 1);
19786
- var import_react11 = __toESM(require_react(), 1);
20076
+ var import_react14 = __toESM(require_react(), 1);
19787
20077
  var getRenderComponent = (runtime) => {
19788
20078
  return runtime._core?.RenderComponent;
19789
20079
  };
19790
- var AssistantProviderBase = (0, import_react11.memo)(({ runtime, aui: parent = null, children }) => {
20080
+ var AssistantProviderBase = (0, import_react14.memo)(({ runtime, aui: parent = null, children }) => {
19791
20081
  const aui = useAui({ threads: RuntimeAdapter(runtime) }, { parent });
19792
20082
  const RenderComponent = getRenderComponent(runtime);
19793
20083
  return (0, import_jsx_runtime9.jsxs)(AuiProvider, { value: aui, children: [RenderComponent && (0, import_jsx_runtime9.jsx)(RenderComponent, {}), children] });
@@ -19795,7 +20085,7 @@ ${config.system}`;
19795
20085
 
19796
20086
  // ../node_modules/@assistant-ui/core/dist/react/primitives/thread/ThreadMessages.js
19797
20087
  var import_jsx_runtime10 = __toESM(require_jsx_runtime(), 1);
19798
- var import_react12 = __toESM(require_react(), 1);
20088
+ var import_react15 = __toESM(require_react(), 1);
19799
20089
  var isComponentsSame = (prev, next) => {
19800
20090
  return prev.Message === next.Message && prev.EditComposer === next.EditComposer && prev.UserEditComposer === next.UserEditComposer && prev.AssistantEditComposer === next.AssistantEditComposer && prev.SystemEditComposer === next.SystemEditComposer && prev.UserMessage === next.UserMessage && prev.AssistantMessage === next.AssistantMessage && prev.SystemMessage === next.SystemMessage;
19801
20091
  };
@@ -19831,13 +20121,13 @@ ${config.system}`;
19831
20121
  const Component = getComponent(components, role, isEditing);
19832
20122
  return (0, import_jsx_runtime10.jsx)(Component, {});
19833
20123
  };
19834
- var ThreadPrimitiveMessageByIndex = (0, import_react12.memo)(({ index, components }) => {
20124
+ var ThreadPrimitiveMessageByIndex = (0, import_react15.memo)(({ index, components }) => {
19835
20125
  return (0, import_jsx_runtime10.jsx)(MessageByIndexProvider, { index, children: (0, import_jsx_runtime10.jsx)(ThreadMessageComponent, { components }) });
19836
20126
  }, (prev, next) => prev.index === next.index && isComponentsSame(prev.components, next.components));
19837
20127
  ThreadPrimitiveMessageByIndex.displayName = "ThreadPrimitive.MessageByIndex";
19838
20128
  var ThreadPrimitiveMessagesInner = ({ children }) => {
19839
20129
  const messagesLength = useAuiState((s) => s.thread.messages.length);
19840
- return (0, import_react12.useMemo)(() => {
20130
+ return (0, import_react15.useMemo)(() => {
19841
20131
  if (messagesLength === 0)
19842
20132
  return null;
19843
20133
  return Array.from({ length: messagesLength }, (_, index) => (0, import_jsx_runtime10.jsx)(MessageByIndexProvider, { index, children: (0, import_jsx_runtime10.jsx)(RenderChildrenWithAccessor, { getItemState: (aui) => aui.thread().message({ index }).getState(), children: (getItem) => children({
@@ -19854,7 +20144,7 @@ ${config.system}`;
19854
20144
  return (0, import_jsx_runtime10.jsx)(ThreadPrimitiveMessagesInner, { children });
19855
20145
  };
19856
20146
  ThreadPrimitiveMessagesImpl.displayName = "ThreadPrimitive.Messages";
19857
- var ThreadPrimitiveMessages = (0, import_react12.memo)(ThreadPrimitiveMessagesImpl, (prev, next) => {
20147
+ var ThreadPrimitiveMessages = (0, import_react15.memo)(ThreadPrimitiveMessagesImpl, (prev, next) => {
19858
20148
  if (prev.children || next.children) {
19859
20149
  return prev.children === next.children;
19860
20150
  }
@@ -19863,7 +20153,7 @@ ${config.system}`;
19863
20153
 
19864
20154
  // ../node_modules/@assistant-ui/core/dist/react/primitives/message/MessageParts.js
19865
20155
  var import_jsx_runtime11 = __toESM(require_jsx_runtime(), 1);
19866
- var import_react14 = __toESM(require_react(), 1);
20156
+ var import_react17 = __toESM(require_react(), 1);
19867
20157
 
19868
20158
  // ../node_modules/@assistant-ui/core/dist/react/utils/getMessageQuote.js
19869
20159
  var getMessageQuote = (state) => {
@@ -19929,9 +20219,9 @@ ${config.system}`;
19929
20219
  }
19930
20220
 
19931
20221
  // ../node_modules/zustand/esm/react/shallow.mjs
19932
- var import_react13 = __toESM(require_react(), 1);
20222
+ var import_react16 = __toESM(require_react(), 1);
19933
20223
  function useShallow(selector) {
19934
- const prev = import_react13.default.useRef(void 0);
20224
+ const prev = import_react16.default.useRef(void 0);
19935
20225
  return (state) => {
19936
20226
  const next = selector(state);
19937
20227
  return shallow(prev.current, next) ? prev.current : prev.current = next;
@@ -20006,7 +20296,7 @@ ${config.system}`;
20006
20296
  };
20007
20297
  var useMessagePartsGroups = (useChainOfThought) => {
20008
20298
  const messageTypes = useAuiState(useShallow((s) => s.message.parts.map((c) => c.type)));
20009
- return (0, import_react14.useMemo)(() => {
20299
+ return (0, import_react17.useMemo)(() => {
20010
20300
  if (messageTypes.length === 0) {
20011
20301
  return [];
20012
20302
  }
@@ -20081,7 +20371,7 @@ ${config.system}`;
20081
20371
  return null;
20082
20372
  }
20083
20373
  };
20084
- var MessagePrimitivePartByIndex = (0, import_react14.memo)(({ index, components }) => {
20374
+ var MessagePrimitivePartByIndex = (0, import_react17.memo)(({ index, components }) => {
20085
20375
  return (0, import_jsx_runtime11.jsx)(PartByIndexProvider, { index, children: (0, import_jsx_runtime11.jsx)(MessagePartComponent, { components }) });
20086
20376
  }, (prev, next) => prev.index === next.index && prev.components?.Text === next.components?.Text && prev.components?.Reasoning === next.components?.Reasoning && prev.components?.Source === next.components?.Source && prev.components?.Image === next.components?.Image && prev.components?.File === next.components?.File && prev.components?.Unstable_Audio === next.components?.Unstable_Audio && prev.components?.tools === next.components?.tools && prev.components?.data === next.components?.data && prev.components?.ToolGroup === next.components?.ToolGroup && prev.components?.ReasoningGroup === next.components?.ReasoningGroup);
20087
20377
  MessagePrimitivePartByIndex.displayName = "MessagePrimitive.PartByIndex";
@@ -20099,7 +20389,7 @@ ${config.system}`;
20099
20389
  return null;
20100
20390
  return (0, import_jsx_runtime11.jsx)(EmptyPartFallback, { status, component: components?.Text ?? defaultComponents.Text });
20101
20391
  };
20102
- var EmptyParts = (0, import_react14.memo)(EmptyPartsImpl, (prev, next) => prev.components?.Empty === next.components?.Empty && prev.components?.Text === next.components?.Text);
20392
+ var EmptyParts = (0, import_react17.memo)(EmptyPartsImpl, (prev, next) => prev.components?.Empty === next.components?.Empty && prev.components?.Text === next.components?.Text);
20103
20393
  var ConditionalEmptyImpl = ({ components, enabled }) => {
20104
20394
  const shouldShowEmpty = useAuiState((s) => {
20105
20395
  if (!enabled)
@@ -20113,14 +20403,14 @@ ${config.system}`;
20113
20403
  return null;
20114
20404
  return (0, import_jsx_runtime11.jsx)(EmptyParts, { components });
20115
20405
  };
20116
- var ConditionalEmpty = (0, import_react14.memo)(ConditionalEmptyImpl, (prev, next) => prev.enabled === next.enabled && prev.components?.Empty === next.components?.Empty && prev.components?.Text === next.components?.Text);
20406
+ var ConditionalEmpty = (0, import_react17.memo)(ConditionalEmptyImpl, (prev, next) => prev.enabled === next.enabled && prev.components?.Empty === next.components?.Empty && prev.components?.Text === next.components?.Text);
20117
20407
  var QuoteRendererImpl = ({ Quote }) => {
20118
20408
  const quoteInfo = useAuiState(getMessageQuote);
20119
20409
  if (!quoteInfo)
20120
20410
  return null;
20121
20411
  return (0, import_jsx_runtime11.jsx)(Quote, { text: quoteInfo.text, messageId: quoteInfo.messageId });
20122
20412
  };
20123
- var QuoteRenderer = (0, import_react14.memo)(QuoteRendererImpl);
20413
+ var QuoteRenderer = (0, import_react17.memo)(QuoteRendererImpl);
20124
20414
  var RegisteredToolUI = () => {
20125
20415
  const aui = useAui();
20126
20416
  const part = useAuiState((s) => s.part);
@@ -20161,7 +20451,7 @@ ${config.system}`;
20161
20451
  var MessagePrimitivePartsInner = ({ children }) => {
20162
20452
  const aui = useAui();
20163
20453
  const contentLength = useAuiState((s) => s.message.parts.length);
20164
- return (0, import_react14.useMemo)(() => Array.from({ length: contentLength }, (_, index) => (0, import_jsx_runtime11.jsx)(PartByIndexProvider, { index, children: (0, import_jsx_runtime11.jsx)(RenderChildrenWithAccessor, { getItemState: (aui2) => aui2.message().part({ index }).getState(), children: (getItem) => {
20454
+ return (0, import_react17.useMemo)(() => Array.from({ length: contentLength }, (_, index) => (0, import_jsx_runtime11.jsx)(PartByIndexProvider, { index, children: (0, import_jsx_runtime11.jsx)(RenderChildrenWithAccessor, { getItemState: (aui2) => aui2.message().part({ index }).getState(), children: (getItem) => {
20165
20455
  const result = children({
20166
20456
  get part() {
20167
20457
  const state = getItem();
@@ -20203,7 +20493,7 @@ ${config.system}`;
20203
20493
  const contentLength = useAuiState((s) => s.message.parts.length);
20204
20494
  const useChainOfThought = !!components?.ChainOfThought;
20205
20495
  const messageRanges = useMessagePartsGroups(useChainOfThought);
20206
- const partsElements = (0, import_react14.useMemo)(() => {
20496
+ const partsElements = (0, import_react17.useMemo)(() => {
20207
20497
  if (contentLength === 0) {
20208
20498
  return (0, import_jsx_runtime11.jsx)(EmptyParts, { components });
20209
20499
  }
@@ -20229,19 +20519,19 @@ ${config.system}`;
20229
20519
 
20230
20520
  // ../node_modules/@assistant-ui/core/dist/react/primitives/message/MessageQuote.js
20231
20521
  var import_jsx_runtime12 = __toESM(require_jsx_runtime(), 1);
20232
- var import_react15 = __toESM(require_react(), 1);
20522
+ var import_react18 = __toESM(require_react(), 1);
20233
20523
  var MessagePrimitiveQuoteImpl = ({ children }) => {
20234
20524
  const quoteInfo = useAuiState(getMessageQuote);
20235
20525
  if (!quoteInfo)
20236
20526
  return null;
20237
20527
  return (0, import_jsx_runtime12.jsx)(import_jsx_runtime12.Fragment, { children: children(quoteInfo) });
20238
20528
  };
20239
- var MessagePrimitiveQuote = (0, import_react15.memo)(MessagePrimitiveQuoteImpl);
20529
+ var MessagePrimitiveQuote = (0, import_react18.memo)(MessagePrimitiveQuoteImpl);
20240
20530
  MessagePrimitiveQuote.displayName = "MessagePrimitive.Quote";
20241
20531
 
20242
20532
  // ../node_modules/@assistant-ui/core/dist/react/primitives/message/MessageAttachments.js
20243
20533
  var import_jsx_runtime13 = __toESM(require_jsx_runtime(), 1);
20244
- var import_react16 = __toESM(require_react(), 1);
20534
+ var import_react19 = __toESM(require_react(), 1);
20245
20535
  var getComponent2 = (components, attachment) => {
20246
20536
  const type = attachment.type;
20247
20537
  switch (type) {
@@ -20264,7 +20554,7 @@ ${config.system}`;
20264
20554
  return null;
20265
20555
  return (0, import_jsx_runtime13.jsx)(Component, {});
20266
20556
  };
20267
- var MessagePrimitiveAttachmentByIndex = (0, import_react16.memo)(({ index, components }) => {
20557
+ var MessagePrimitiveAttachmentByIndex = (0, import_react19.memo)(({ index, components }) => {
20268
20558
  return (0, import_jsx_runtime13.jsx)(MessageAttachmentByIndexProvider, { index, children: (0, import_jsx_runtime13.jsx)(AttachmentComponent, { components }) });
20269
20559
  }, (prev, next) => prev.index === next.index && prev.components?.Image === next.components?.Image && prev.components?.Document === next.components?.Document && prev.components?.File === next.components?.File && prev.components?.Attachment === next.components?.Attachment);
20270
20560
  MessagePrimitiveAttachmentByIndex.displayName = "MessagePrimitive.AttachmentByIndex";
@@ -20274,7 +20564,7 @@ ${config.system}`;
20274
20564
  return 0;
20275
20565
  return s.message.attachments.length;
20276
20566
  });
20277
- return (0, import_react16.useMemo)(() => Array.from({ length: attachmentsCount }, (_, index) => (0, import_jsx_runtime13.jsx)(MessageAttachmentByIndexProvider, { index, children: (0, import_jsx_runtime13.jsx)(RenderChildrenWithAccessor, { getItemState: (aui) => aui.message().attachment({ index }).getState(), children: (getItem) => children({
20567
+ return (0, import_react19.useMemo)(() => Array.from({ length: attachmentsCount }, (_, index) => (0, import_jsx_runtime13.jsx)(MessageAttachmentByIndexProvider, { index, children: (0, import_jsx_runtime13.jsx)(RenderChildrenWithAccessor, { getItemState: (aui) => aui.message().attachment({ index }).getState(), children: (getItem) => children({
20278
20568
  get attachment() {
20279
20569
  return getItem();
20280
20570
  }
@@ -20295,18 +20585,18 @@ ${config.system}`;
20295
20585
 
20296
20586
  // ../node_modules/@assistant-ui/core/dist/react/primitives/thread/ThreadSuggestions.js
20297
20587
  var import_jsx_runtime14 = __toESM(require_jsx_runtime(), 1);
20298
- var import_react17 = __toESM(require_react(), 1);
20588
+ var import_react20 = __toESM(require_react(), 1);
20299
20589
  var SuggestionComponent = ({ components }) => {
20300
20590
  const Component = components.Suggestion;
20301
20591
  return (0, import_jsx_runtime14.jsx)(Component, {});
20302
20592
  };
20303
- var ThreadPrimitiveSuggestionByIndex = (0, import_react17.memo)(({ index, components }) => {
20593
+ var ThreadPrimitiveSuggestionByIndex = (0, import_react20.memo)(({ index, components }) => {
20304
20594
  return (0, import_jsx_runtime14.jsx)(SuggestionByIndexProvider, { index, children: (0, import_jsx_runtime14.jsx)(SuggestionComponent, { components }) });
20305
20595
  }, (prev, next) => prev.index === next.index && prev.components.Suggestion === next.components.Suggestion);
20306
20596
  ThreadPrimitiveSuggestionByIndex.displayName = "ThreadPrimitive.SuggestionByIndex";
20307
20597
  var ThreadPrimitiveSuggestionsInner = ({ children }) => {
20308
20598
  const suggestionsLength = useAuiState((s) => s.suggestions.suggestions.length);
20309
- return (0, import_react17.useMemo)(() => {
20599
+ return (0, import_react20.useMemo)(() => {
20310
20600
  if (suggestionsLength === 0)
20311
20601
  return null;
20312
20602
  return Array.from({ length: suggestionsLength }, (_, index) => (0, import_jsx_runtime14.jsx)(SuggestionByIndexProvider, { index, children: (0, import_jsx_runtime14.jsx)(RenderChildrenWithAccessor, { getItemState: (aui) => aui.suggestions().suggestion({ index }).getState(), children: (getItem) => children({
@@ -20323,7 +20613,7 @@ ${config.system}`;
20323
20613
  return (0, import_jsx_runtime14.jsx)(ThreadPrimitiveSuggestionsInner, { children });
20324
20614
  };
20325
20615
  ThreadPrimitiveSuggestionsImpl.displayName = "ThreadPrimitive.Suggestions";
20326
- var ThreadPrimitiveSuggestions = (0, import_react17.memo)(ThreadPrimitiveSuggestionsImpl, (prev, next) => {
20616
+ var ThreadPrimitiveSuggestions = (0, import_react20.memo)(ThreadPrimitiveSuggestionsImpl, (prev, next) => {
20327
20617
  if (prev.children || next.children) {
20328
20618
  return prev.children === next.children;
20329
20619
  }
@@ -20331,12 +20621,12 @@ ${config.system}`;
20331
20621
  });
20332
20622
 
20333
20623
  // ../node_modules/@assistant-ui/core/dist/react/primitive-hooks/useSuggestionTrigger.js
20334
- var import_react18 = __toESM(require_react(), 1);
20624
+ var import_react21 = __toESM(require_react(), 1);
20335
20625
  var useSuggestionTrigger = ({ prompt, send, clearComposer = true }) => {
20336
20626
  const aui = useAui();
20337
20627
  const disabled = useAuiState((s) => s.thread.isDisabled);
20338
20628
  const resolvedSend = send ?? false;
20339
- const trigger = (0, import_react18.useCallback)(() => {
20629
+ const trigger = (0, import_react21.useCallback)(() => {
20340
20630
  const isRunning = aui.thread().getState().isRunning;
20341
20631
  if (resolvedSend && !isRunning) {
20342
20632
  aui.thread().append({
@@ -20365,11 +20655,11 @@ ${config.system}`;
20365
20655
 
20366
20656
  // ../node_modules/@assistant-ui/react/dist/legacy-runtime/AssistantRuntimeProvider.js
20367
20657
  var import_jsx_runtime16 = __toESM(require_jsx_runtime(), 1);
20368
- var import_react23 = __toESM(require_react(), 1);
20658
+ var import_react26 = __toESM(require_react(), 1);
20369
20659
 
20370
20660
  // ../node_modules/@assistant-ui/react/dist/context/providers/ThreadViewportProvider.js
20371
20661
  var import_jsx_runtime15 = __toESM(require_jsx_runtime(), 1);
20372
- var import_react22 = __toESM(require_react(), 1);
20662
+ var import_react25 = __toESM(require_react(), 1);
20373
20663
 
20374
20664
  // ../node_modules/@assistant-ui/react/dist/context/stores/ThreadViewport.js
20375
20665
  var createSizeRegistry = (onChange) => {
@@ -20453,13 +20743,13 @@ ${config.system}`;
20453
20743
  };
20454
20744
 
20455
20745
  // ../node_modules/@assistant-ui/react/dist/context/react/ThreadViewportContext.js
20456
- var import_react21 = __toESM(require_react(), 1);
20746
+ var import_react24 = __toESM(require_react(), 1);
20457
20747
 
20458
20748
  // ../node_modules/@assistant-ui/react/dist/context/react/utils/createContextHook.js
20459
- var import_react20 = __toESM(require_react(), 1);
20749
+ var import_react23 = __toESM(require_react(), 1);
20460
20750
  function createContextHook(context2, providerName) {
20461
20751
  function useContextHook(options) {
20462
- const contextValue2 = (0, import_react20.useContext)(context2);
20752
+ const contextValue2 = (0, import_react23.useContext)(context2);
20463
20753
  if (!options?.optional && !contextValue2) {
20464
20754
  throw new Error(`This component must be used within ${providerName}.`);
20465
20755
  }
@@ -20499,7 +20789,7 @@ ${config.system}`;
20499
20789
  }
20500
20790
 
20501
20791
  // ../node_modules/@assistant-ui/react/dist/context/react/ThreadViewportContext.js
20502
- var ThreadViewportContext = (0, import_react21.createContext)(null);
20792
+ var ThreadViewportContext = (0, import_react24.createContext)(null);
20503
20793
  var useThreadViewportContext = createContextHook(ThreadViewportContext, "ThreadPrimitive.Viewport");
20504
20794
  var { useThreadViewport, useThreadViewportStore } = createContextStoreHook(useThreadViewportContext, "useThreadViewport");
20505
20795
 
@@ -20511,13 +20801,13 @@ ${config.system}`;
20511
20801
  // ../node_modules/@assistant-ui/react/dist/context/providers/ThreadViewportProvider.js
20512
20802
  var useThreadViewportStoreValue = (options) => {
20513
20803
  const outerViewport = useThreadViewportStore({ optional: true });
20514
- const [store] = (0, import_react22.useState)(() => makeThreadViewportStore(options));
20515
- (0, import_react22.useEffect)(() => {
20804
+ const [store] = (0, import_react25.useState)(() => makeThreadViewportStore(options));
20805
+ (0, import_react25.useEffect)(() => {
20516
20806
  return outerViewport?.getState().onScrollToBottom(() => {
20517
20807
  store.getState().scrollToBottom();
20518
20808
  });
20519
20809
  }, [outerViewport, store]);
20520
- (0, import_react22.useEffect)(() => {
20810
+ (0, import_react25.useEffect)(() => {
20521
20811
  if (!outerViewport)
20522
20812
  return;
20523
20813
  return store.subscribe((state) => {
@@ -20526,7 +20816,7 @@ ${config.system}`;
20526
20816
  }
20527
20817
  });
20528
20818
  }, [store, outerViewport]);
20529
- (0, import_react22.useEffect)(() => {
20819
+ (0, import_react25.useEffect)(() => {
20530
20820
  const nextState = {
20531
20821
  turnAnchor: options.turnAnchor ?? "bottom"
20532
20822
  };
@@ -20539,7 +20829,7 @@ ${config.system}`;
20539
20829
  };
20540
20830
  var ThreadPrimitiveViewportProvider = ({ children, options = {} }) => {
20541
20831
  const useThreadViewport2 = useThreadViewportStoreValue(options);
20542
- const [context2] = (0, import_react22.useState)(() => {
20832
+ const [context2] = (0, import_react25.useState)(() => {
20543
20833
  return {
20544
20834
  useThreadViewport: useThreadViewport2
20545
20835
  };
@@ -20626,7 +20916,7 @@ ${config.system}`;
20626
20916
  // ../node_modules/@assistant-ui/react/dist/legacy-runtime/AssistantRuntimeProvider.js
20627
20917
  var DevToolsRegistration = () => {
20628
20918
  const aui = useAui();
20629
- (0, import_react23.useEffect)(() => {
20919
+ (0, import_react26.useEffect)(() => {
20630
20920
  if (typeof process === "undefined" || true)
20631
20921
  return;
20632
20922
  return DevToolsProviderApi.register(aui);
@@ -20636,10 +20926,10 @@ ${config.system}`;
20636
20926
  var AssistantRuntimeProviderImpl = ({ children, aui, runtime }) => {
20637
20927
  return (0, import_jsx_runtime16.jsxs)(AssistantProviderBase, { runtime, aui: aui ?? null, children: [(0, import_jsx_runtime16.jsx)(DevToolsRegistration, {}), (0, import_jsx_runtime16.jsx)(ThreadPrimitiveViewportProvider, { children })] });
20638
20928
  };
20639
- var AssistantRuntimeProvider = (0, import_react23.memo)(AssistantRuntimeProviderImpl);
20929
+ var AssistantRuntimeProvider = (0, import_react26.memo)(AssistantRuntimeProviderImpl);
20640
20930
 
20641
20931
  // ../node_modules/@assistant-ui/react/dist/context/react/utils/useRuntimeState.js
20642
- var import_react27 = __toESM(require_react(), 1);
20932
+ var import_react30 = __toESM(require_react(), 1);
20643
20933
 
20644
20934
  // ../node_modules/@assistant-ui/react/dist/context/react/utils/ensureBinding.js
20645
20935
  var ensureBinding = (r) => {
@@ -20656,8 +20946,8 @@ ${config.system}`;
20656
20946
  // ../node_modules/@assistant-ui/react/dist/context/react/utils/useRuntimeState.js
20657
20947
  function useRuntimeStateInternal(runtime, selector = identity2) {
20658
20948
  ensureBinding(runtime);
20659
- const slice = (0, import_react27.useSyncExternalStore)(runtime.subscribe, () => selector(runtime.getState()), () => selector(runtime.getState()));
20660
- (0, import_react27.useDebugValue)(slice);
20949
+ const slice = (0, import_react30.useSyncExternalStore)(runtime.subscribe, () => selector(runtime.getState()), () => selector(runtime.getState()));
20950
+ (0, import_react30.useDebugValue)(slice);
20661
20951
  return slice;
20662
20952
  }
20663
20953
  var identity2 = (arg) => arg;
@@ -20733,7 +21023,7 @@ ${config.system}`;
20733
21023
 
20734
21024
  // ../node_modules/@assistant-ui/react/dist/utils/Primitive.js
20735
21025
  var import_jsx_runtime19 = __toESM(require_jsx_runtime(), 1);
20736
- var import_react28 = __toESM(require_react(), 1);
21026
+ var import_react31 = __toESM(require_react(), 1);
20737
21027
 
20738
21028
  // ../node_modules/@radix-ui/react-primitive/dist/index.mjs
20739
21029
  var React6 = __toESM(require_react(), 1);
@@ -20896,10 +21186,10 @@ ${config.system}`;
20896
21186
  ];
20897
21187
  function createPrimitive(node) {
20898
21188
  const RadixComp = Primitive[node];
20899
- const Component = (0, import_react28.forwardRef)(({ render, asChild, children, ...props }, ref) => {
20900
- if (render && (0, import_react28.isValidElement)(render)) {
21189
+ const Component = (0, import_react31.forwardRef)(({ render, asChild, children, ...props }, ref) => {
21190
+ if (render && (0, import_react31.isValidElement)(render)) {
20901
21191
  const renderChildren = children !== void 0 ? children : render.props.children;
20902
- return (0, import_jsx_runtime19.jsx)(RadixComp, { asChild: true, ...props, ref, children: (0, import_react28.cloneElement)(render, void 0, renderChildren) });
21192
+ return (0, import_jsx_runtime19.jsx)(RadixComp, { asChild: true, ...props, ref, children: (0, import_react31.cloneElement)(render, void 0, renderChildren) });
20903
21193
  }
20904
21194
  return (0, import_jsx_runtime19.jsx)(RadixComp, { asChild, ...props, ref, children });
20905
21195
  });
@@ -20924,9 +21214,9 @@ ${config.system}`;
20924
21214
 
20925
21215
  // ../node_modules/@assistant-ui/react/dist/utils/createActionButton.js
20926
21216
  var import_jsx_runtime20 = __toESM(require_jsx_runtime(), 1);
20927
- var import_react29 = __toESM(require_react(), 1);
21217
+ var import_react32 = __toESM(require_react(), 1);
20928
21218
  var createActionButton = (displayName, useActionButton, forwardProps = []) => {
20929
- const ActionButton = (0, import_react29.forwardRef)((props, forwardedRef) => {
21219
+ const ActionButton = (0, import_react32.forwardRef)((props, forwardedRef) => {
20930
21220
  const forwardedProps = {};
20931
21221
  const primitiveProps = {};
20932
21222
  Object.keys(props).forEach((key) => {
@@ -21102,18 +21392,18 @@ ${config.system}`;
21102
21392
  MessagePrimitiveIf.displayName = "MessagePrimitive.If";
21103
21393
 
21104
21394
  // ../node_modules/@assistant-ui/react/dist/utils/hooks/useOnScrollToBottom.js
21105
- var import_react30 = __toESM(require_react(), 1);
21395
+ var import_react33 = __toESM(require_react(), 1);
21106
21396
  var useOnScrollToBottom = (callback) => {
21107
21397
  const callbackRef = useCallbackRef(callback);
21108
21398
  const onScrollToBottom = useThreadViewport((vp) => vp.onScrollToBottom);
21109
- (0, import_react30.useEffect)(() => {
21399
+ (0, import_react33.useEffect)(() => {
21110
21400
  return onScrollToBottom(callbackRef);
21111
21401
  }, [onScrollToBottom, callbackRef]);
21112
21402
  };
21113
21403
 
21114
21404
  // ../node_modules/@assistant-ui/react/dist/primitives/messagePart/MessagePartText.js
21115
21405
  var import_jsx_runtime23 = __toESM(require_jsx_runtime(), 1);
21116
- var import_react33 = __toESM(require_react(), 1);
21406
+ var import_react36 = __toESM(require_react(), 1);
21117
21407
 
21118
21408
  // ../node_modules/@assistant-ui/react/dist/primitives/messagePart/useMessagePartText.js
21119
21409
  var useMessagePartText = () => {
@@ -21126,14 +21416,14 @@ ${config.system}`;
21126
21416
  };
21127
21417
 
21128
21418
  // ../node_modules/@assistant-ui/react/dist/utils/smooth/useSmooth.js
21129
- var import_react32 = __toESM(require_react(), 1);
21419
+ var import_react35 = __toESM(require_react(), 1);
21130
21420
 
21131
21421
  // ../node_modules/@assistant-ui/react/dist/utils/smooth/SmoothContext.js
21132
21422
  var import_jsx_runtime22 = __toESM(require_jsx_runtime(), 1);
21133
- var import_react31 = __toESM(require_react(), 1);
21134
- var SmoothContext = (0, import_react31.createContext)(null);
21423
+ var import_react34 = __toESM(require_react(), 1);
21424
+ var SmoothContext = (0, import_react34.createContext)(null);
21135
21425
  function useSmoothContext(options) {
21136
- const context2 = (0, import_react31.useContext)(SmoothContext);
21426
+ const context2 = (0, import_react34.useContext)(SmoothContext);
21137
21427
  if (!options?.optional && !context2)
21138
21428
  throw new Error("This component must be used within a SmoothContextProvider.");
21139
21429
  return context2;
@@ -21192,8 +21482,8 @@ ${config.system}`;
21192
21482
  var useSmooth = (state, smooth = false) => {
21193
21483
  const { text } = state;
21194
21484
  const id = useAuiState((s) => s.message.id);
21195
- const idRef = (0, import_react32.useRef)(id);
21196
- const [displayedText, setDisplayedText] = (0, import_react32.useState)(state.status.type === "running" ? "" : text);
21485
+ const idRef = (0, import_react35.useRef)(id);
21486
+ const [displayedText, setDisplayedText] = (0, import_react35.useState)(state.status.type === "running" ? "" : text);
21197
21487
  const smoothStatusStore = useSmoothStatusStore({ optional: true });
21198
21488
  const setText = useCallbackRef((text2) => {
21199
21489
  setDisplayedText(text2);
@@ -21202,14 +21492,14 @@ ${config.system}`;
21202
21492
  writableStore(smoothStatusStore).setState(target, true);
21203
21493
  }
21204
21494
  });
21205
- (0, import_react32.useEffect)(() => {
21495
+ (0, import_react35.useEffect)(() => {
21206
21496
  if (smoothStatusStore) {
21207
21497
  const target = smooth && (displayedText !== text || state.status.type === "running") ? SMOOTH_STATUS : state.status;
21208
21498
  writableStore(smoothStatusStore).setState(target, true);
21209
21499
  }
21210
21500
  }, [smoothStatusStore, smooth, text, displayedText, state.status]);
21211
- const [animatorRef] = (0, import_react32.useState)(new TextStreamAnimator(displayedText, setText));
21212
- (0, import_react32.useEffect)(() => {
21501
+ const [animatorRef] = (0, import_react35.useState)(new TextStreamAnimator(displayedText, setText));
21502
+ (0, import_react35.useEffect)(() => {
21213
21503
  if (!smooth) {
21214
21504
  animatorRef.stop();
21215
21505
  return;
@@ -21232,12 +21522,12 @@ ${config.system}`;
21232
21522
  animatorRef.targetText = text;
21233
21523
  animatorRef.start();
21234
21524
  }, [setText, animatorRef, id, smooth, text, state.status.type]);
21235
- (0, import_react32.useEffect)(() => {
21525
+ (0, import_react35.useEffect)(() => {
21236
21526
  return () => {
21237
21527
  animatorRef.stop();
21238
21528
  };
21239
21529
  }, [animatorRef]);
21240
- return (0, import_react32.useMemo)(() => smooth ? {
21530
+ return (0, import_react35.useMemo)(() => smooth ? {
21241
21531
  type: "text",
21242
21532
  text: displayedText,
21243
21533
  status: text === displayedText ? state.status : SMOOTH_STATUS
@@ -21245,7 +21535,7 @@ ${config.system}`;
21245
21535
  };
21246
21536
 
21247
21537
  // ../node_modules/@assistant-ui/react/dist/primitives/messagePart/MessagePartText.js
21248
- var MessagePartPrimitiveText = (0, import_react33.forwardRef)(({ smooth = true, component: Component = "span", ...rest }, forwardedRef) => {
21538
+ var MessagePartPrimitiveText = (0, import_react36.forwardRef)(({ smooth = true, component: Component = "span", ...rest }, forwardedRef) => {
21249
21539
  const { text, status } = useSmooth(useMessagePartText(), smooth);
21250
21540
  return (0, import_jsx_runtime23.jsx)(Component, { "data-status": status.type, ...rest, ref: forwardedRef, children: text });
21251
21541
  });
@@ -21253,7 +21543,7 @@ ${config.system}`;
21253
21543
 
21254
21544
  // ../node_modules/@assistant-ui/react/dist/primitives/messagePart/MessagePartImage.js
21255
21545
  var import_jsx_runtime24 = __toESM(require_jsx_runtime(), 1);
21256
- var import_react34 = __toESM(require_react(), 1);
21546
+ var import_react37 = __toESM(require_react(), 1);
21257
21547
 
21258
21548
  // ../node_modules/@assistant-ui/react/dist/primitives/messagePart/useMessagePartImage.js
21259
21549
  var useMessagePartImage = () => {
@@ -21266,7 +21556,7 @@ ${config.system}`;
21266
21556
  };
21267
21557
 
21268
21558
  // ../node_modules/@assistant-ui/react/dist/primitives/messagePart/MessagePartImage.js
21269
- var MessagePartPrimitiveImage = (0, import_react34.forwardRef)((props, forwardedRef) => {
21559
+ var MessagePartPrimitiveImage = (0, import_react37.forwardRef)((props, forwardedRef) => {
21270
21560
  const { image } = useMessagePartImage();
21271
21561
  return (0, import_jsx_runtime24.jsx)(Primitive2.img, { src: image, ...props, ref: forwardedRef });
21272
21562
  });
@@ -21297,13 +21587,13 @@ ${config.system}`;
21297
21587
 
21298
21588
  // ../node_modules/@assistant-ui/react/dist/primitives/message/MessageRoot.js
21299
21589
  var import_jsx_runtime26 = __toESM(require_jsx_runtime(), 1);
21300
- var import_react38 = __toESM(require_react(), 1);
21590
+ var import_react41 = __toESM(require_react(), 1);
21301
21591
 
21302
21592
  // ../node_modules/@assistant-ui/react/dist/utils/hooks/useManagedRef.js
21303
- var import_react35 = __toESM(require_react(), 1);
21593
+ var import_react38 = __toESM(require_react(), 1);
21304
21594
  var useManagedRef = (callback) => {
21305
- const cleanupRef = (0, import_react35.useRef)(void 0);
21306
- const ref = (0, import_react35.useCallback)((el) => {
21595
+ const cleanupRef = (0, import_react38.useRef)(void 0);
21596
+ const ref = (0, import_react38.useCallback)((el) => {
21307
21597
  if (cleanupRef.current) {
21308
21598
  cleanupRef.current();
21309
21599
  }
@@ -21315,9 +21605,9 @@ ${config.system}`;
21315
21605
  };
21316
21606
 
21317
21607
  // ../node_modules/@assistant-ui/react/dist/utils/hooks/useSizeHandle.js
21318
- var import_react36 = __toESM(require_react(), 1);
21608
+ var import_react39 = __toESM(require_react(), 1);
21319
21609
  var useSizeHandle = (register, getHeight) => {
21320
- const callbackRef = (0, import_react36.useCallback)((el) => {
21610
+ const callbackRef = (0, import_react39.useCallback)((el) => {
21321
21611
  if (!register)
21322
21612
  return;
21323
21613
  const sizeHandle = register();
@@ -21338,8 +21628,8 @@ ${config.system}`;
21338
21628
 
21339
21629
  // ../node_modules/@assistant-ui/react/dist/primitives/thread/ThreadViewportSlack.js
21340
21630
  var import_jsx_runtime25 = __toESM(require_jsx_runtime(), 1);
21341
- var import_react37 = __toESM(require_react(), 1);
21342
- var SlackNestingContext = (0, import_react37.createContext)(false);
21631
+ var import_react40 = __toESM(require_react(), 1);
21632
+ var SlackNestingContext = (0, import_react40.createContext)(false);
21343
21633
  var parseCssLength = (value, element) => {
21344
21634
  const match = value.match(/^([\d.]+)(em|px|rem)$/);
21345
21635
  if (!match)
@@ -21364,8 +21654,8 @@ ${config.system}`;
21364
21654
  (s) => s.message.isLast && s.message.role === "assistant" && s.message.index >= 1 && s.thread.messages.at(s.message.index - 1)?.role === "user"
21365
21655
  );
21366
21656
  const threadViewportStore = useThreadViewportStore({ optional: true });
21367
- const isNested = (0, import_react37.useContext)(SlackNestingContext);
21368
- const callback = (0, import_react37.useCallback)((el) => {
21657
+ const isNested = (0, import_react40.useContext)(SlackNestingContext);
21658
+ const callback = (0, import_react40.useCallback)((el) => {
21369
21659
  if (!threadViewportStore || isNested)
21370
21660
  return;
21371
21661
  const updateMinHeight = () => {
@@ -21403,7 +21693,7 @@ ${config.system}`;
21403
21693
  var useIsHoveringRef = () => {
21404
21694
  const aui = useAui();
21405
21695
  const message = useAuiState(() => aui.message());
21406
- const callbackRef = (0, import_react38.useCallback)((el) => {
21696
+ const callbackRef = (0, import_react41.useCallback)((el) => {
21407
21697
  const handleMouseEnter = () => {
21408
21698
  message.setIsHovering(true);
21409
21699
  };
@@ -21427,15 +21717,15 @@ ${config.system}`;
21427
21717
  const turnAnchor = useThreadViewport((s) => s.turnAnchor);
21428
21718
  const registerUserHeight = useThreadViewport((s) => s.registerUserMessageHeight);
21429
21719
  const shouldRegisterAsInset = useAuiState((s) => turnAnchor === "top" && s.message.role === "user" && s.message.index === s.thread.messages.length - 2 && s.thread.messages.at(-1)?.role === "assistant");
21430
- const getHeight = (0, import_react38.useCallback)((el) => el.offsetHeight, []);
21720
+ const getHeight = (0, import_react41.useCallback)((el) => el.offsetHeight, []);
21431
21721
  return useSizeHandle(shouldRegisterAsInset ? registerUserHeight : null, getHeight);
21432
21722
  };
21433
- var MessagePrimitiveRoot = (0, import_react38.forwardRef)((props, forwardRef13) => {
21723
+ var MessagePrimitiveRoot = (0, import_react41.forwardRef)(({ fillClampThreshold, fillClampOffset, ...props }, forwardRef15) => {
21434
21724
  const isHoveringRef = useIsHoveringRef();
21435
21725
  const anchorUserMessageRef = useMessageViewportRef();
21436
- const ref = useComposedRefs(forwardRef13, isHoveringRef, anchorUserMessageRef);
21726
+ const ref = useComposedRefs(forwardRef15, isHoveringRef, anchorUserMessageRef);
21437
21727
  const messageId = useAuiState((s) => s.message.id);
21438
- return (0, import_jsx_runtime26.jsx)(ThreadPrimitiveViewportSlack, { children: (0, import_jsx_runtime26.jsx)(Primitive2.div, { ...props, ref, "data-message-id": messageId }) });
21728
+ return (0, import_jsx_runtime26.jsx)(ThreadPrimitiveViewportSlack, { fillClampThreshold, fillClampOffset, children: (0, import_jsx_runtime26.jsx)(Primitive2.div, { ...props, ref, "data-message-id": messageId }) });
21439
21729
  });
21440
21730
  MessagePrimitiveRoot.displayName = "MessagePrimitive.Root";
21441
21731
 
@@ -21480,7 +21770,7 @@ ${config.system}`;
21480
21770
 
21481
21771
  // ../node_modules/@assistant-ui/react/dist/primitives/message/MessagePartsGrouped.js
21482
21772
  var import_jsx_runtime28 = __toESM(require_jsx_runtime(), 1);
21483
- var import_react42 = __toESM(require_react(), 1);
21773
+ var import_react45 = __toESM(require_react(), 1);
21484
21774
  var groupMessagePartsByParentId = (parts) => {
21485
21775
  const groupMap = /* @__PURE__ */ new Map();
21486
21776
  for (let i = 0; i < parts.length; i++) {
@@ -21500,7 +21790,7 @@ ${config.system}`;
21500
21790
  };
21501
21791
  var useMessagePartsGrouped = (groupingFunction) => {
21502
21792
  const parts = useAuiState((s) => s.message.parts);
21503
- return (0, import_react42.useMemo)(() => {
21793
+ return (0, import_react45.useMemo)(() => {
21504
21794
  if (parts.length === 0) {
21505
21795
  return [];
21506
21796
  }
@@ -21577,7 +21867,7 @@ ${config.system}`;
21577
21867
  var MessagePartImpl = ({ partIndex, components }) => {
21578
21868
  return (0, import_jsx_runtime28.jsx)(PartByIndexProvider, { index: partIndex, children: (0, import_jsx_runtime28.jsx)(MessagePartComponent2, { components }) });
21579
21869
  };
21580
- var MessagePart = (0, import_react42.memo)(MessagePartImpl, (prev, next) => prev.partIndex === next.partIndex && prev.components?.Text === next.components?.Text && prev.components?.Reasoning === next.components?.Reasoning && prev.components?.Source === next.components?.Source && prev.components?.Image === next.components?.Image && prev.components?.File === next.components?.File && prev.components?.Unstable_Audio === next.components?.Unstable_Audio && prev.components?.tools === next.components?.tools && prev.components?.data === next.components?.data && prev.components?.Group === next.components?.Group);
21870
+ var MessagePart = (0, import_react45.memo)(MessagePartImpl, (prev, next) => prev.partIndex === next.partIndex && prev.components?.Text === next.components?.Text && prev.components?.Reasoning === next.components?.Reasoning && prev.components?.Source === next.components?.Source && prev.components?.Image === next.components?.Image && prev.components?.File === next.components?.File && prev.components?.Unstable_Audio === next.components?.Unstable_Audio && prev.components?.tools === next.components?.tools && prev.components?.data === next.components?.data && prev.components?.Group === next.components?.Group);
21581
21871
  var EmptyPartFallback2 = ({ status, component: Component }) => {
21582
21872
  return (0, import_jsx_runtime28.jsx)(TextMessagePartProvider, { text: "", isRunning: status.type === "running", children: (0, import_jsx_runtime28.jsx)(Component, { type: "text", text: "", status }) });
21583
21873
  };
@@ -21590,11 +21880,11 @@ ${config.system}`;
21590
21880
  return (0, import_jsx_runtime28.jsx)(components.Empty, { status });
21591
21881
  return (0, import_jsx_runtime28.jsx)(EmptyPartFallback2, { status, component: components?.Text ?? defaultComponents2.Text });
21592
21882
  };
21593
- var EmptyParts2 = (0, import_react42.memo)(EmptyPartsImpl2, (prev, next) => prev.components?.Empty === next.components?.Empty && prev.components?.Text === next.components?.Text);
21883
+ var EmptyParts2 = (0, import_react45.memo)(EmptyPartsImpl2, (prev, next) => prev.components?.Empty === next.components?.Empty && prev.components?.Text === next.components?.Text);
21594
21884
  var MessagePrimitiveUnstable_PartsGrouped = ({ groupingFunction, components }) => {
21595
21885
  const contentLength = useAuiState((s) => s.message.parts.length);
21596
21886
  const messageGroups = useMessagePartsGrouped(groupingFunction);
21597
- const partsElements = (0, import_react42.useMemo)(() => {
21887
+ const partsElements = (0, import_react45.useMemo)(() => {
21598
21888
  if (contentLength === 0) {
21599
21889
  return (0, import_jsx_runtime28.jsx)(EmptyParts2, { components });
21600
21890
  }
@@ -21631,8 +21921,8 @@ ${config.system}`;
21631
21921
 
21632
21922
  // ../node_modules/@assistant-ui/react/dist/primitives/thread/ThreadRoot.js
21633
21923
  var import_jsx_runtime29 = __toESM(require_jsx_runtime(), 1);
21634
- var import_react44 = __toESM(require_react(), 1);
21635
- var ThreadPrimitiveRoot = (0, import_react44.forwardRef)((props, ref) => {
21924
+ var import_react47 = __toESM(require_react(), 1);
21925
+ var ThreadPrimitiveRoot = (0, import_react47.forwardRef)((props, ref) => {
21636
21926
  return (0, import_jsx_runtime29.jsx)(Primitive2.div, { ...props, ref });
21637
21927
  });
21638
21928
  ThreadPrimitiveRoot.displayName = "ThreadPrimitive.Root";
@@ -21670,16 +21960,16 @@ ${config.system}`;
21670
21960
 
21671
21961
  // ../node_modules/@assistant-ui/react/dist/primitives/thread/ThreadViewport.js
21672
21962
  var import_jsx_runtime30 = __toESM(require_jsx_runtime(), 1);
21673
- var import_react47 = __toESM(require_react(), 1);
21963
+ var import_react50 = __toESM(require_react(), 1);
21674
21964
 
21675
21965
  // ../node_modules/@assistant-ui/react/dist/primitives/thread/useThreadViewportAutoScroll.js
21676
- var import_react46 = __toESM(require_react(), 1);
21966
+ var import_react49 = __toESM(require_react(), 1);
21677
21967
 
21678
21968
  // ../node_modules/@assistant-ui/react/dist/utils/hooks/useOnResizeContent.js
21679
- var import_react45 = __toESM(require_react(), 1);
21969
+ var import_react48 = __toESM(require_react(), 1);
21680
21970
  var useOnResizeContent = (callback) => {
21681
21971
  const callbackRef = useCallbackRef(callback);
21682
- const refCallback = (0, import_react45.useCallback)((el) => {
21972
+ const refCallback = (0, import_react48.useCallback)((el) => {
21683
21973
  const resizeObserver = new ResizeObserver(() => {
21684
21974
  callbackRef();
21685
21975
  });
@@ -21706,14 +21996,14 @@ ${config.system}`;
21706
21996
 
21707
21997
  // ../node_modules/@assistant-ui/react/dist/primitives/thread/useThreadViewportAutoScroll.js
21708
21998
  var useThreadViewportAutoScroll = ({ autoScroll, scrollToBottomOnRunStart = true, scrollToBottomOnInitialize = true, scrollToBottomOnThreadSwitch = true }) => {
21709
- const divRef = (0, import_react46.useRef)(null);
21999
+ const divRef = (0, import_react49.useRef)(null);
21710
22000
  const threadViewportStore = useThreadViewportStore();
21711
22001
  if (autoScroll === void 0) {
21712
22002
  autoScroll = threadViewportStore.getState().turnAnchor !== "top";
21713
22003
  }
21714
- const lastScrollTop = (0, import_react46.useRef)(0);
21715
- const scrollingToBottomBehaviorRef = (0, import_react46.useRef)(null);
21716
- const scrollToBottom = (0, import_react46.useCallback)((behavior) => {
22004
+ const lastScrollTop = (0, import_react49.useRef)(0);
22005
+ const scrollingToBottomBehaviorRef = (0, import_react49.useRef)(null);
22006
+ const scrollToBottom = (0, import_react49.useCallback)((behavior) => {
21717
22007
  const div = divRef.current;
21718
22008
  if (!div)
21719
22009
  return;
@@ -21789,10 +22079,10 @@ ${config.system}`;
21789
22079
  // ../node_modules/@assistant-ui/react/dist/primitives/thread/ThreadViewport.js
21790
22080
  var useViewportSizeRef = () => {
21791
22081
  const register = useThreadViewport((s) => s.registerViewport);
21792
- const getHeight = (0, import_react47.useCallback)((el) => el.clientHeight, []);
22082
+ const getHeight = (0, import_react50.useCallback)((el) => el.clientHeight, []);
21793
22083
  return useSizeHandle(register, getHeight);
21794
22084
  };
21795
- var ThreadPrimitiveViewportScrollable = (0, import_react47.forwardRef)(({ autoScroll, scrollToBottomOnRunStart, scrollToBottomOnInitialize, scrollToBottomOnThreadSwitch, children, ...rest }, forwardedRef) => {
22085
+ var ThreadPrimitiveViewportScrollable = (0, import_react50.forwardRef)(({ autoScroll, scrollToBottomOnRunStart, scrollToBottomOnInitialize, scrollToBottomOnThreadSwitch, children, ...rest }, forwardedRef) => {
21796
22086
  const autoScrollRef = useThreadViewportAutoScroll({
21797
22087
  autoScroll,
21798
22088
  scrollToBottomOnRunStart,
@@ -21804,17 +22094,17 @@ ${config.system}`;
21804
22094
  return (0, import_jsx_runtime30.jsx)(Primitive2.div, { ...rest, ref, children });
21805
22095
  });
21806
22096
  ThreadPrimitiveViewportScrollable.displayName = "ThreadPrimitive.ViewportScrollable";
21807
- var ThreadPrimitiveViewport = (0, import_react47.forwardRef)(({ turnAnchor, ...props }, ref) => {
22097
+ var ThreadPrimitiveViewport = (0, import_react50.forwardRef)(({ turnAnchor, ...props }, ref) => {
21808
22098
  return (0, import_jsx_runtime30.jsx)(ThreadPrimitiveViewportProvider, { options: { turnAnchor }, children: (0, import_jsx_runtime30.jsx)(ThreadPrimitiveViewportScrollable, { ...props, ref }) });
21809
22099
  });
21810
22100
  ThreadPrimitiveViewport.displayName = "ThreadPrimitive.Viewport";
21811
22101
 
21812
22102
  // ../node_modules/@assistant-ui/react/dist/primitives/thread/ThreadViewportFooter.js
21813
22103
  var import_jsx_runtime31 = __toESM(require_jsx_runtime(), 1);
21814
- var import_react48 = __toESM(require_react(), 1);
21815
- var ThreadPrimitiveViewportFooter = (0, import_react48.forwardRef)((props, forwardedRef) => {
22104
+ var import_react51 = __toESM(require_react(), 1);
22105
+ var ThreadPrimitiveViewportFooter = (0, import_react51.forwardRef)((props, forwardedRef) => {
21816
22106
  const register = useThreadViewport((s) => s.registerContentInset);
21817
- const getHeight = (0, import_react48.useCallback)((el) => {
22107
+ const getHeight = (0, import_react51.useCallback)((el) => {
21818
22108
  const marginTop = parseFloat(getComputedStyle(el).marginTop) || 0;
21819
22109
  return el.offsetHeight + marginTop;
21820
22110
  }, []);
@@ -21825,11 +22115,11 @@ ${config.system}`;
21825
22115
  ThreadPrimitiveViewportFooter.displayName = "ThreadPrimitive.ViewportFooter";
21826
22116
 
21827
22117
  // ../node_modules/@assistant-ui/react/dist/primitives/thread/ThreadScrollToBottom.js
21828
- var import_react50 = __toESM(require_react(), 1);
22118
+ var import_react53 = __toESM(require_react(), 1);
21829
22119
  var useThreadScrollToBottom = ({ behavior } = {}) => {
21830
22120
  const isAtBottom = useThreadViewport((s) => s.isAtBottom);
21831
22121
  const threadViewportStore = useThreadViewportStore();
21832
- const handleScrollToBottom = (0, import_react50.useCallback)(() => {
22122
+ const handleScrollToBottom = (0, import_react53.useCallback)(() => {
21833
22123
  threadViewportStore.getState().scrollToBottom({ behavior });
21834
22124
  }, [threadViewportStore, behavior]);
21835
22125
  if (isAtBottom)
@@ -21908,87 +22198,44 @@ ${config.system}`;
21908
22198
  return /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("div", { className: cn(badgeClassName(variant), className), ...props });
21909
22199
  }
21910
22200
  function LauncherIcon() {
21911
- return /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)(
21912
- "svg",
21913
- {
21914
- viewBox: "0 0 24 24",
21915
- width: "18",
21916
- height: "18",
21917
- fill: "none",
21918
- "aria-hidden": "true",
21919
- className: "blinq-launcher-agent",
21920
- children: [
21921
- /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("circle", { className: "blinq-agent-orbit", cx: "12", cy: "12", r: "9" }),
21922
- /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("circle", { className: "blinq-agent-spark", cx: "18.6", cy: "8.2", r: "1.2" }),
21923
- /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
21924
- "path",
21925
- {
21926
- className: "blinq-agent-antenna",
21927
- d: "M12 4.8V6.8",
21928
- stroke: "currentColor",
21929
- strokeWidth: "1.6",
21930
- strokeLinecap: "round"
21931
- }
21932
- ),
21933
- /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("circle", { className: "blinq-agent-antenna-dot", cx: "12", cy: "4.1", r: "1.1", fill: "currentColor" }),
21934
- /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
21935
- "rect",
21936
- {
21937
- className: "blinq-agent-head",
21938
- x: "7",
21939
- y: "7.4",
21940
- width: "10",
21941
- height: "9.2",
21942
- rx: "3.2",
21943
- fill: "currentColor"
21944
- }
21945
- ),
21946
- /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("circle", { className: "blinq-agent-eye", cx: "10.2", cy: "11.3", r: "0.9", fill: "#111111" }),
21947
- /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("circle", { className: "blinq-agent-eye", cx: "13.8", cy: "11.3", r: "0.9", fill: "#111111" }),
21948
- /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
21949
- "path",
21950
- {
21951
- className: "blinq-agent-mouth",
21952
- d: "M10 14.2c.7.55 1.38.82 2 .82s1.3-.27 2-.82",
21953
- stroke: "#111111",
21954
- strokeWidth: "1.3",
21955
- strokeLinecap: "round"
21956
- }
21957
- ),
21958
- /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
21959
- "path",
21960
- {
21961
- className: "blinq-agent-neck",
21962
- d: "M10.2 17.1h3.6",
21963
- stroke: "currentColor",
21964
- strokeWidth: "1.4",
21965
- strokeLinecap: "round"
21966
- }
21967
- )
21968
- ]
21969
- }
21970
- );
22201
+ return /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(Bot, { "aria-hidden": "true", className: "blinq-launcher-icon", size: 30, strokeWidth: 1.7 });
22202
+ }
22203
+ function AssistantAvatar({
22204
+ avatarUrl,
22205
+ assistantName
22206
+ }) {
22207
+ return /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)("div", { className: "blinq-avatar", "aria-hidden": "true", children: [
22208
+ avatarUrl ? /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("img", { src: avatarUrl, alt: "", className: "blinq-avatar-image" }) : /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(Bot, { className: "blinq-avatar-icon", size: 24, strokeWidth: 1.8 }),
22209
+ /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("span", { className: "blinq-avatar-status" }),
22210
+ /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("span", { className: "blinq-avatar-label", children: assistantName.slice(0, 1) })
22211
+ ] });
21971
22212
  }
21972
22213
  function CollapseIcon() {
21973
22214
  return /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("svg", { viewBox: "0 0 24 24", width: "16", height: "16", fill: "none", "aria-hidden": "true", children: /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("path", { d: "M6 12h12", stroke: "currentColor", strokeWidth: "1.8", strokeLinecap: "round" }) });
21974
22215
  }
21975
22216
  function MicrophoneIcon({ listening }) {
21976
22217
  if (listening) {
21977
- return /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("svg", { viewBox: "0 0 24 24", width: "16", height: "16", fill: "none", "aria-hidden": "true", children: /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("rect", { x: "7", y: "7", width: "10", height: "10", rx: "2.5", fill: "currentColor" }) });
22218
+ return /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)("svg", { viewBox: "0 0 24 24", width: "16", height: "16", fill: "none", "aria-hidden": "true", children: [
22219
+ /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("circle", { cx: "12", cy: "12", r: "8.25", stroke: "currentColor", strokeWidth: "1.65" }),
22220
+ /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("rect", { x: "9.1", y: "9.1", width: "5.8", height: "5.8", rx: "1.6", fill: "currentColor" })
22221
+ ] });
21978
22222
  }
21979
22223
  return /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)("svg", { viewBox: "0 0 24 24", width: "16", height: "16", fill: "none", "aria-hidden": "true", children: [
21980
22224
  /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
21981
22225
  "path",
21982
22226
  {
21983
- d: "M12 3.75a2.75 2.75 0 0 1 2.75 2.75v5.25a2.75 2.75 0 1 1-5.5 0V6.5A2.75 2.75 0 0 1 12 3.75Z",
21984
- fill: "currentColor"
22227
+ d: "M12 4.35a3.05 3.05 0 0 1 3.05 3.05v4.7a3.05 3.05 0 1 1-6.1 0V7.4A3.05 3.05 0 0 1 12 4.35Z",
22228
+ stroke: "currentColor",
22229
+ strokeWidth: "1.7"
21985
22230
  }
21986
22231
  ),
21987
22232
  /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
21988
22233
  "path",
21989
22234
  {
21990
- d: "M7.5 10.5a.75.75 0 0 1 .75.75a3.75 3.75 0 1 0 7.5 0a.75.75 0 0 1 1.5 0A5.25 5.25 0 0 1 12.75 16.4V18.5H15a.75.75 0 0 1 0 1.5H9a.75.75 0 0 1 0-1.5h2.25v-2.1A5.25 5.25 0 0 1 6.75 11.25a.75.75 0 0 1 .75-.75Z",
21991
- fill: "currentColor"
22235
+ d: "M7.95 11.35a4.05 4.05 0 1 0 8.1 0M12 16.45v3.2M9.2 19.65h5.6",
22236
+ stroke: "currentColor",
22237
+ strokeWidth: "1.7",
22238
+ strokeLinecap: "round"
21992
22239
  }
21993
22240
  )
21994
22241
  ] });
@@ -21997,7 +22244,7 @@ ${config.system}`;
21997
22244
  return /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("svg", { viewBox: "0 0 24 24", width: "16", height: "16", fill: "none", "aria-hidden": "true", children: /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
21998
22245
  "path",
21999
22246
  {
22000
- d: "M5.5 12h11M12.5 5l6.5 7-6.5 7",
22247
+ d: "M5.5 18.5 18.5 5.5M8.25 5.5h10.25v10.25",
22001
22248
  stroke: "currentColor",
22002
22249
  strokeWidth: "1.8",
22003
22250
  strokeLinecap: "round",
@@ -22159,7 +22406,7 @@ ${config.system}`;
22159
22406
  const waveform = samples.length > 0 ? samples : [0.18];
22160
22407
  return /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)("div", { className: "blinq-recording-input", role: "status", "aria-live": "polite", children: [
22161
22408
  /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("div", { className: "blinq-recording-time", children: formatRecordingDuration(durationMs) }),
22162
- /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("div", { className: "blinq-recording-waveform", "aria-hidden": "true", children: waveform.map((sample, index) => {
22409
+ /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("div", { className: "blinq-recording-wave-shell", children: /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("div", { className: "blinq-recording-waveform", "aria-hidden": "true", children: waveform.map((sample, index) => {
22163
22410
  const scale = Math.max(0.16, Math.min(1, sample));
22164
22411
  return /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
22165
22412
  "span",
@@ -22169,9 +22416,21 @@ ${config.system}`;
22169
22416
  },
22170
22417
  `voice-wave-${index}`
22171
22418
  );
22172
- }) })
22419
+ }) }) })
22173
22420
  ] });
22174
22421
  }
22422
+ function planStepStatusLabel(step, isCurrent) {
22423
+ if (step.status === "completed") {
22424
+ return "\u0413\u043E\u0442\u043E\u0432\u043E";
22425
+ }
22426
+ if (step.status === "failed") {
22427
+ return "\u041E\u0448\u0438\u0431\u043A\u0430";
22428
+ }
22429
+ if (step.status === "cancelled") {
22430
+ return "\u041E\u0442\u043C\u0435\u043D\u0435\u043D\u043E";
22431
+ }
22432
+ return isCurrent ? "\u0421\u0435\u0439\u0447\u0430\u0441" : "\u0414\u0430\u043B\u0435\u0435";
22433
+ }
22175
22434
  function ActionCard({
22176
22435
  item,
22177
22436
  accentColor,
@@ -22201,9 +22460,6 @@ ${config.system}`;
22201
22460
  {
22202
22461
  type: "button",
22203
22462
  onClick: onApprove,
22204
- style: {
22205
- background: accentColor
22206
- },
22207
22463
  children: "\u0412\u044B\u043F\u043E\u043B\u043D\u0438\u0442\u044C"
22208
22464
  }
22209
22465
  )
@@ -22219,17 +22475,17 @@ ${config.system}`;
22219
22475
  onDecline
22220
22476
  }) {
22221
22477
  return /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)(Card, { className: "blinq-action-card blinq-plan-card", children: [
22222
- /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(CardHeader, { children: /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)("div", { className: "flex items-center justify-between gap-3", children: [
22478
+ /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(CardHeader, { children: /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)("div", { className: "blinq-plan-header", children: [
22223
22479
  /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)("div", { children: [
22224
22480
  /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(CardTitle, { children: "\u041F\u043B\u0430\u043D" }),
22225
22481
  /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(CardDescription, { children: item.goal })
22226
22482
  ] }),
22227
22483
  /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(Badge, { variant: item.status === "completed" ? "default" : item.status === "failed" ? "outline" : "soft", children: item.status === "completed" ? "\u0413\u043E\u0442\u043E\u0432\u043E" : item.status === "failed" ? "\u041E\u0448\u0438\u0431\u043A\u0430" : item.status === "awaiting_navigation" ? "\u041F\u0435\u0440\u0435\u0445\u043E\u0434" : "\u0412 \u0440\u0430\u0431\u043E\u0442\u0435" })
22228
22484
  ] }) }),
22229
- /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)(CardContent, { className: "space-y-3", children: [
22485
+ /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)(CardContent, { className: "blinq-plan-content", children: [
22230
22486
  item.progressLabel ? /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("div", { className: "blinq-action-state", children: item.progressLabel }) : null,
22231
22487
  item.statusReason ? /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("div", { className: "blinq-card-description", children: item.statusReason }) : null,
22232
- /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("div", { className: "space-y-2", children: item.steps.map((step, index) => /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)(
22488
+ /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("div", { className: "blinq-plan-steps", children: item.steps.map((step, index) => /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)(
22233
22489
  "div",
22234
22490
  {
22235
22491
  className: "blinq-plan-step",
@@ -22238,7 +22494,10 @@ ${config.system}`;
22238
22494
  children: [
22239
22495
  /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("span", { className: "blinq-plan-step-index", children: index + 1 }),
22240
22496
  /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)("div", { className: "blinq-plan-step-copy", children: [
22241
- /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("div", { children: step.title }),
22497
+ /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)("div", { className: "blinq-plan-step-title-row", children: [
22498
+ /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("div", { className: "blinq-plan-step-title", children: step.title }),
22499
+ /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("span", { className: "blinq-plan-step-status-pill", children: planStepStatusLabel(step, index === item.currentStepIndex) })
22500
+ ] }),
22242
22501
  /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("div", { className: "blinq-plan-step-meta", children: step.status === "completed" ? "\u0412\u044B\u043F\u043E\u043B\u043D\u0435\u043D\u043E" : step.status === "failed" ? "\u041E\u0448\u0438\u0431\u043A\u0430" : step.status === "cancelled" ? "\u041E\u0442\u043C\u0435\u043D\u0435\u043D\u043E" : index === item.currentStepIndex ? "\u0422\u0435\u043A\u0443\u0449\u0438\u0439 \u0448\u0430\u0433" : "\u041E\u0436\u0438\u0434\u0430\u0435\u0442" })
22243
22502
  ] })
22244
22503
  ]
@@ -22252,6 +22511,53 @@ ${config.system}`;
22252
22511
  ] })
22253
22512
  ] });
22254
22513
  }
22514
+ function GuideCard({
22515
+ guide,
22516
+ onStartGuide,
22517
+ onAdvanceGuide,
22518
+ onDismissGuide,
22519
+ onCompleteGuide,
22520
+ onRunGuideStep
22521
+ }) {
22522
+ const currentStep = guide.steps[Math.min(guide.currentStepIndex, Math.max(guide.steps.length - 1, 0))] ?? null;
22523
+ const isStarted = guide.state === "started";
22524
+ const isCompleted = guide.state === "completed";
22525
+ return /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)(Card, { className: "blinq-guide-card", children: [
22526
+ /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(CardHeader, { children: /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)("div", { className: "blinq-plan-header", children: [
22527
+ /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)("div", { children: [
22528
+ /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(CardTitle, { children: "Guide \u043D\u0430 \u0441\u0442\u0440\u0430\u043D\u0438\u0446\u0435" }),
22529
+ /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(CardDescription, { children: guide.summary || "\u041F\u043E\u0448\u0430\u0433\u043E\u0432\u0430\u044F \u043F\u043E\u043C\u043E\u0449\u044C \u043F\u043E \u0442\u0435\u043A\u0443\u0449\u0435\u043C\u0443 \u0438\u043D\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u0443." })
22530
+ ] }),
22531
+ /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(Badge, { variant: guide.source === "live" ? "soft" : "accent", children: guide.source === "live" ? "Live" : "Published" })
22532
+ ] }) }),
22533
+ /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(CardContent, { className: "blinq-guide-content", children: !isStarted ? /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)(import_jsx_runtime32.Fragment, { children: [
22534
+ /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("div", { className: "blinq-card-description", children: "\u0410\u0441\u0441\u0438\u0441\u0442\u0435\u043D\u0442 \u0443\u0436\u0435 \u043F\u043E\u0434\u0433\u043E\u0442\u043E\u0432\u0438\u043B guide \u0434\u043B\u044F \u044D\u0442\u043E\u0439 \u0441\u0442\u0440\u0430\u043D\u0438\u0446\u044B \u0438 \u043C\u043E\u0436\u0435\u0442 \u043F\u0440\u043E\u0432\u0435\u0441\u0442\u0438 \u043F\u043E\u043B\u044C\u0437\u043E\u0432\u0430\u0442\u0435\u043B\u044F \u043F\u043E \u0448\u0430\u0433\u0430\u043C." }),
22535
+ /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)("div", { className: "blinq-actions", children: [
22536
+ /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(Button, { type: "button", variant: "outline", onClick: onDismissGuide, children: "\u0421\u043A\u0440\u044B\u0442\u044C" }),
22537
+ /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(Button, { type: "button", onClick: onStartGuide, children: "\u041D\u0430\u0447\u0430\u0442\u044C guide" })
22538
+ ] })
22539
+ ] }) : currentStep && !isCompleted ? /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)(import_jsx_runtime32.Fragment, { children: [
22540
+ /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)("div", { className: "blinq-guide-step-shell", children: [
22541
+ /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)("div", { className: "blinq-guide-step-meta", children: [
22542
+ "\u0428\u0430\u0433 ",
22543
+ Math.min(guide.currentStepIndex + 1, guide.totalSteps),
22544
+ " \u0438\u0437 ",
22545
+ guide.totalSteps
22546
+ ] }),
22547
+ /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("div", { className: "blinq-guide-step-title", children: currentStep.title }),
22548
+ /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("div", { className: "blinq-guide-step-copy", children: currentStep.body })
22549
+ ] }),
22550
+ /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)("div", { className: "blinq-actions", children: [
22551
+ /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(Button, { type: "button", variant: "outline", onClick: onDismissGuide, children: "\u0421\u043A\u0440\u044B\u0442\u044C" }),
22552
+ /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(Button, { type: "button", variant: "outline", onClick: onRunGuideStep, children: currentStep.actionKind ? "\u041F\u043E\u043A\u0430\u0437\u0430\u0442\u044C / \u0432\u044B\u043F\u043E\u043B\u043D\u0438\u0442\u044C \u0448\u0430\u0433" : "\u041F\u043E\u043A\u0430\u0437\u0430\u0442\u044C \u043D\u0430 \u0441\u0442\u0440\u0430\u043D\u0438\u0446\u0435" }),
22553
+ guide.currentStepIndex + 1 >= guide.totalSteps ? /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(Button, { type: "button", onClick: onCompleteGuide, children: "\u0417\u0430\u0432\u0435\u0440\u0448\u0438\u0442\u044C" }) : /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(Button, { type: "button", onClick: onAdvanceGuide, children: "\u0414\u0430\u043B\u044C\u0448\u0435" })
22554
+ ] })
22555
+ ] }) : /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)(import_jsx_runtime32.Fragment, { children: [
22556
+ /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("div", { className: "blinq-card-description", children: "Guide \u0437\u0430\u0432\u0435\u0440\u0448\u0451\u043D. \u041C\u043E\u0436\u043D\u043E \u043F\u0440\u043E\u0434\u043E\u043B\u0436\u0438\u0442\u044C \u0440\u0430\u0431\u043E\u0442\u0443 \u043D\u0430 \u0441\u0442\u0440\u0430\u043D\u0438\u0446\u0435 \u0441\u0430\u043C\u043E\u0441\u0442\u043E\u044F\u0442\u0435\u043B\u044C\u043D\u043E." }),
22557
+ /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("div", { className: "blinq-actions", children: /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(Button, { type: "button", onClick: onDismissGuide, children: "\u0417\u0430\u043A\u0440\u044B\u0442\u044C" }) })
22558
+ ] }) })
22559
+ ] });
22560
+ }
22255
22561
  function AssistantConversationThread({
22256
22562
  items,
22257
22563
  showThinkingIndicator,
@@ -22328,34 +22634,52 @@ ${config.system}`;
22328
22634
  onApproveAction,
22329
22635
  onDeclineAction,
22330
22636
  onApprovePlan,
22331
- onDeclinePlan
22637
+ onDeclinePlan,
22638
+ onStartGuide,
22639
+ onAdvanceGuide,
22640
+ onDismissGuide,
22641
+ onCompleteGuide,
22642
+ onRunGuideStep
22332
22643
  }) {
22333
22644
  return /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)(
22334
22645
  "div",
22335
22646
  {
22336
22647
  className: "blinq-shell",
22337
22648
  "data-side": state.side,
22649
+ "data-theme": state.themeVariant,
22338
22650
  style: { ["--blinq-accent"]: state.accentColor },
22339
22651
  children: [
22340
22652
  !state.minimized ? /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)("div", { className: "blinq-panel", children: [
22341
- /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)("div", { className: "blinq-header", children: [
22342
- /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)("div", { className: "blinq-header-row", children: [
22343
- /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("div", { className: "blinq-header-copy", children: /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("div", { className: "blinq-heading", children: state.assistantName }) }),
22344
- /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
22345
- Button,
22346
- {
22347
- type: "button",
22348
- size: "icon-sm",
22349
- variant: "ghost",
22350
- "aria-label": "\u0421\u0432\u0435\u0440\u043D\u0443\u0442\u044C \u0432\u0438\u0434\u0436\u0435\u0442",
22351
- title: "\u0421\u0432\u0435\u0440\u043D\u0443\u0442\u044C \u0432\u0438\u0434\u0436\u0435\u0442",
22352
- onClick: onCollapse,
22353
- children: /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(CollapseIcon, {})
22354
- }
22355
- )
22653
+ /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("div", { className: "blinq-header", children: /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)("div", { className: "blinq-header-row", children: [
22654
+ /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(AssistantAvatar, { avatarUrl: state.avatarUrl, assistantName: state.assistantName }),
22655
+ /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)("div", { className: "blinq-header-copy", children: [
22656
+ /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("div", { className: "blinq-heading", children: state.assistantName }),
22657
+ state.statusText ? /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("div", { className: "blinq-status-line", children: state.statusText }) : null
22356
22658
  ] }),
22357
- state.statusText ? /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("div", { className: "blinq-status-line", children: state.statusText }) : null
22358
- ] }),
22659
+ /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
22660
+ Button,
22661
+ {
22662
+ type: "button",
22663
+ size: "icon-sm",
22664
+ variant: "ghost",
22665
+ "aria-label": "\u0421\u0432\u0435\u0440\u043D\u0443\u0442\u044C \u0432\u0438\u0434\u0436\u0435\u0442",
22666
+ title: "\u0421\u0432\u0435\u0440\u043D\u0443\u0442\u044C \u0432\u0438\u0434\u0436\u0435\u0442",
22667
+ onClick: onCollapse,
22668
+ children: /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(CollapseIcon, {})
22669
+ }
22670
+ )
22671
+ ] }) }),
22672
+ state.guide ? /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
22673
+ GuideCard,
22674
+ {
22675
+ guide: state.guide,
22676
+ onStartGuide,
22677
+ onAdvanceGuide,
22678
+ onDismissGuide,
22679
+ onCompleteGuide,
22680
+ onRunGuideStep
22681
+ }
22682
+ ) : null,
22359
22683
  /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
22360
22684
  AssistantConversationThread,
22361
22685
  {
@@ -22401,7 +22725,7 @@ ${config.system}`;
22401
22725
  Input,
22402
22726
  {
22403
22727
  value: state.inputValue,
22404
- placeholder: "\u041D\u0430\u043F\u0440\u0438\u043C\u0435\u0440: \u043D\u0430\u0439\u0434\u0438 \u043D\u0443\u0436\u043D\u0443\u044E \u043A\u043D\u043E\u043F\u043A\u0443 \u0438\u043B\u0438 \u0437\u0430\u043F\u043E\u043B\u043D\u0438 \u0444\u043E\u0440\u043C\u0443",
22728
+ placeholder: "Type a message...",
22405
22729
  onChange: (event) => onInputChange(event.currentTarget.value),
22406
22730
  disabled: state.isSending
22407
22731
  }
@@ -22420,7 +22744,8 @@ ${config.system}`;
22420
22744
  )
22421
22745
  ] }) })
22422
22746
  }
22423
- )
22747
+ ),
22748
+ /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("div", { className: "blinq-powered", children: "POWERED BY BLINQ" })
22424
22749
  ] }) : null,
22425
22750
  state.minimized ? /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
22426
22751
  Button,
@@ -22431,7 +22756,7 @@ ${config.system}`;
22431
22756
  "aria-label": `\u041E\u0442\u043A\u0440\u044B\u0442\u044C ${state.assistantName}`,
22432
22757
  title: `\u041E\u0442\u043A\u0440\u044B\u0442\u044C ${state.assistantName}`,
22433
22758
  onClick: onOpen,
22434
- children: /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("span", { className: "blinq-launcher-badge", children: /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(LauncherIcon, {}) })
22759
+ children: /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(LauncherIcon, {})
22435
22760
  }
22436
22761
  ) : null
22437
22762
  ]
@@ -22841,6 +23166,41 @@ ${config.system}`;
22841
23166
  var MAX_STORED_HISTORY = 30;
22842
23167
  var MAX_HISTORY_FOR_REQUEST = 12;
22843
23168
  var DEFAULT_GREETING = "Blinq \u043F\u043E\u0434\u043A\u043B\u044E\u0447\u0435\u043D. \u0421\u043F\u0440\u043E\u0441\u0438\u0442\u0435 \u043F\u0440\u043E \u0442\u0435\u043A\u0443\u0449\u0443\u044E \u0441\u0442\u0440\u0430\u043D\u0438\u0446\u0443, \u043D\u0430\u0441\u0442\u0440\u043E\u0439\u043A\u0443 \u043F\u043B\u0430\u0442\u0444\u043E\u0440\u043C\u044B \u0438\u043B\u0438 \u0441\u043B\u0435\u0434\u0443\u044E\u0449\u0438\u0439 \u0448\u0430\u0433.";
23169
+ var PLAN_APPROVE_TEXTS = /* @__PURE__ */ new Set([
23170
+ "\u0434\u0430",
23171
+ "\u0430\u0433\u0430",
23172
+ "\u043E\u043A",
23173
+ "okay",
23174
+ "\u043E\u043A\u0435\u0439",
23175
+ "\u0445\u043E\u0440\u043E\u0448\u043E",
23176
+ "\u043B\u0430\u0434\u043D\u043E",
23177
+ "\u0434\u0435\u043B\u0430\u0439",
23178
+ "\u0441\u0434\u0435\u043B\u0430\u0439",
23179
+ "\u043F\u043E\u0434\u0442\u0432\u0435\u0440\u0436\u0434\u0430\u044E",
23180
+ "yes",
23181
+ "ok",
23182
+ "sure",
23183
+ "go ahead",
23184
+ "approve",
23185
+ "\u0438\u04D9",
23186
+ "\u0438\u044F",
23187
+ "\u0438\u0441\u0442\u0435",
23188
+ "\u0436\u0430\u0440\u0430\u0439\u0434\u044B",
23189
+ "\u043C\u0430\u049B\u04B1\u043B"
23190
+ ]);
23191
+ var PLAN_DECLINE_TEXTS = /* @__PURE__ */ new Set([
23192
+ "\u043D\u0435\u0442",
23193
+ "\u043D\u0435 \u043D\u0430\u0434\u043E",
23194
+ "\u043D\u0435 \u043D\u0443\u0436\u043D\u043E",
23195
+ "\u043E\u0442\u043C\u0435\u043D\u0430",
23196
+ "\u043E\u0442\u043C\u0435\u043D\u0438",
23197
+ "cancel",
23198
+ "no",
23199
+ "stop",
23200
+ "\u0436\u043E\u049B",
23201
+ "\u0442\u043E\u049B\u0442\u0430",
23202
+ "\u043A\u0435\u0440\u0435\u043A \u0435\u043C\u0435\u0441"
23203
+ ]);
22844
23204
  function isBrowser3() {
22845
23205
  return typeof window !== "undefined" && typeof document !== "undefined";
22846
23206
  }
@@ -22874,9 +23234,9 @@ ${config.system}`;
22874
23234
  }
22875
23235
  function runtimeMessage(mode) {
22876
23236
  if (mode === "read-only-fallback") {
22877
- return "\u0413\u043E\u0442\u043E\u0432 \u043E\u0431\u044A\u044F\u0441\u043D\u0438\u0442\u044C \u0442\u0435\u043A\u0443\u0449\u0443\u044E \u0441\u0442\u0440\u0430\u043D\u0438\u0446\u0443 \u0438 \u043F\u043E\u0434\u0441\u043A\u0430\u0437\u0430\u0442\u044C \u0441\u043B\u0435\u0434\u0443\u044E\u0449\u0438\u0439 \u0448\u0430\u0433.";
23237
+ return "\u0414\u0435\u0439\u0441\u0442\u0432\u0438\u044F \u043D\u0430 \u0441\u0442\u0440\u0430\u043D\u0438\u0446\u0435 \u043D\u0435\u0434\u043E\u0441\u0442\u0443\u043F\u043D\u044B. \u042F \u043C\u043E\u0433\u0443 \u043E\u0431\u044A\u044F\u0441\u043D\u044F\u0442\u044C \u0438\u043D\u0442\u0435\u0440\u0444\u0435\u0439\u0441 \u0438 \u043E\u0442\u0432\u0435\u0447\u0430\u0442\u044C \u043F\u043E \u0431\u0430\u0437\u0435 \u0437\u043D\u0430\u043D\u0438\u0439.";
22878
23238
  }
22879
- return "\u0413\u043E\u0442\u043E\u0432 \u043F\u043E\u043C\u043E\u0447\u044C \u0441 \u043E\u043D\u0431\u043E\u0440\u0434\u0438\u043D\u0433\u043E\u043C \u0438 \u0432\u043E\u043F\u0440\u043E\u0441\u0430\u043C\u0438 \u043F\u043E \u043F\u043B\u0430\u0442\u0444\u043E\u0440\u043C\u0435.";
23239
+ return "\u0413\u043E\u0442\u043E\u0432 \u043F\u043E\u043C\u043E\u0433\u0430\u0442\u044C \u0441 \u0438\u043D\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u043E\u043C, \u0437\u043D\u0430\u043D\u0438\u044F\u043C\u0438 \u0438 \u0441\u043B\u0435\u0434\u0443\u044E\u0449\u0438\u043C\u0438 \u0448\u0430\u0433\u0430\u043C\u0438.";
22880
23240
  }
22881
23241
  function normalizedRouteFromUrl(value) {
22882
23242
  try {
@@ -22953,7 +23313,7 @@ ${config.system}`;
22953
23313
  minimized = false;
22954
23314
  isSending = false;
22955
23315
  inputValue = "";
22956
- statusText = "\u041F\u0440\u043E\u0432\u0435\u0440\u044F\u0435\u043C \u0434\u043E\u0441\u0442\u0443\u043F\u043D\u044B\u0435 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044F \u0441\u0442\u0440\u0430\u043D\u0438\u0446\u044B.";
23316
+ statusText = "";
22957
23317
  voiceSupported = false;
22958
23318
  voiceListening = false;
22959
23319
  voiceWaveform = [];
@@ -22963,6 +23323,7 @@ ${config.system}`;
22963
23323
  confirmResolve = null;
22964
23324
  confirmItemId = null;
22965
23325
  activeRun = null;
23326
+ activeGuide = null;
22966
23327
  pendingAssistantIndicator = false;
22967
23328
  executedToolCounts = /* @__PURE__ */ new Map();
22968
23329
  lastAutoResumeKey = null;
@@ -22992,12 +23353,34 @@ ${config.system}`;
22992
23353
  },
22993
23354
  onDeclinePlan: () => {
22994
23355
  void this.respondToPlan(false);
23356
+ },
23357
+ onStartGuide: () => {
23358
+ void this.startGuide();
23359
+ },
23360
+ onAdvanceGuide: () => {
23361
+ void this.advanceGuide();
23362
+ },
23363
+ onDismissGuide: () => {
23364
+ void this.dismissGuide();
23365
+ },
23366
+ onCompleteGuide: () => {
23367
+ void this.completeGuide();
23368
+ },
23369
+ onRunGuideStep: () => {
23370
+ void this.runGuideStep();
22995
23371
  }
22996
23372
  };
22997
23373
  constructor(options) {
22998
23374
  this.options = options;
22999
23375
  this.apiBaseUrl = options.apiBaseUrl ?? DEFAULT_API_BASE_URL;
23000
23376
  }
23377
+ currentActionPolicy() {
23378
+ return this.runtimeStatus?.action_policy ?? {
23379
+ actions_enabled: this.widgetConfig?.actions_enabled ?? true,
23380
+ action_mode: this.widgetConfig?.action_mode ?? "execute_with_confirmation",
23381
+ pointer_overlay_enabled: this.widgetConfig?.pointer_overlay_enabled ?? true
23382
+ };
23383
+ }
23001
23384
  async init() {
23002
23385
  await this.startSession();
23003
23386
  if (isBrowser3()) {
@@ -23007,8 +23390,10 @@ ${config.system}`;
23007
23390
  this.render();
23008
23391
  this.setupVoiceInput();
23009
23392
  this.registry = new PageToolRegistry(this.confirmToolExecution.bind(this));
23393
+ this.registry.setActionPolicy(this.currentActionPolicy());
23010
23394
  const nativeRegistered = await this.registry.registerNativeTools();
23011
23395
  this.syncRuntimeStatus(nativeRegistered);
23396
+ this.syncGuideHighlight();
23012
23397
  if (this.shouldAutoResumeActiveRun()) {
23013
23398
  window.setTimeout(() => {
23014
23399
  void this.continueActiveRun();
@@ -23033,18 +23418,21 @@ ${config.system}`;
23033
23418
  currentState() {
23034
23419
  return {
23035
23420
  minimized: this.minimized,
23036
- assistantName: this.widgetConfig?.ai_persona_name ?? "Blinq \u0410\u0441\u0441\u0438\u0441\u0442\u0435\u043D\u0442",
23421
+ assistantName: this.widgetConfig?.name ?? "Blinq \u0410\u0441\u0441\u0438\u0441\u0442\u0435\u043D\u0442",
23422
+ avatarUrl: this.widgetConfig?.avatar_url ?? null,
23037
23423
  runtimeLabel: "webmcp://embedded",
23038
23424
  statusText: this.statusText,
23039
23425
  showThinkingIndicator: this.pendingAssistantIndicator,
23040
23426
  inputValue: this.inputValue,
23041
- accentColor: "#111111",
23427
+ accentColor: this.widgetConfig?.theme_color ?? "#111111",
23428
+ themeVariant: "light",
23042
23429
  side: this.widgetConfig?.position === "bottom-left" ? "left" : "right",
23043
23430
  isSending: this.isSending,
23044
23431
  voiceSupported: this.voiceSupported,
23045
23432
  voiceListening: this.voiceListening,
23046
23433
  voiceWaveform: this.voiceWaveform,
23047
23434
  voiceDurationMs: this.voiceDurationMs,
23435
+ guide: this.activeGuide,
23048
23436
  items: this.items
23049
23437
  };
23050
23438
  }
@@ -23087,6 +23475,7 @@ ${config.system}`;
23087
23475
  this.sessionToken = payload.session_token;
23088
23476
  this.widgetConfig = payload.widget_config;
23089
23477
  this.activeRun = payload.active_run ?? null;
23478
+ this.activeGuide = this.normalizeGuidePayload(payload.active_guide ?? payload.guide_offer ?? null);
23090
23479
  this.runtimeStatus = {
23091
23480
  ...payload.runtime,
23092
23481
  message: runtimeMessage(payload.runtime.mode)
@@ -23330,6 +23719,62 @@ ${config.system}`;
23330
23719
  this.upsertPlanItem(this.activeRun);
23331
23720
  }
23332
23721
  }
23722
+ normalizeGuideStep(step) {
23723
+ return {
23724
+ id: step.id,
23725
+ position: step.position,
23726
+ title: step.title,
23727
+ body: step.body,
23728
+ targetSelector: step.target_selector ?? null,
23729
+ targetLabel: step.target_label ?? null,
23730
+ actionKind: step.action_kind ?? null,
23731
+ actionPayload: step.action_payload ?? null,
23732
+ expectedRoute: step.expected_route ?? null,
23733
+ completionMode: step.completion_mode
23734
+ };
23735
+ }
23736
+ normalizeGuidePayload(payload) {
23737
+ if (!payload) {
23738
+ return null;
23739
+ }
23740
+ const guide = payload.guide;
23741
+ return {
23742
+ id: guide.id,
23743
+ state: payload.state,
23744
+ source: guide.source,
23745
+ route: guide.route,
23746
+ summary: guide.summary ?? null,
23747
+ currentStepIndex: payload.state === "started" ? Math.min(payload.current_step_index, Math.max(guide.steps.length - 1, 0)) : payload.state === "completed" ? guide.steps.length : 0,
23748
+ totalSteps: guide.steps.length,
23749
+ steps: guide.steps.map((step) => this.normalizeGuideStep(step))
23750
+ };
23751
+ }
23752
+ setGuideState(payload, options) {
23753
+ const normalized = this.normalizeGuidePayload(payload);
23754
+ if (options?.clearIfFinished !== false && normalized && (normalized.state === "dismissed" || normalized.state === "completed")) {
23755
+ this.activeGuide = null;
23756
+ } else {
23757
+ this.activeGuide = normalized;
23758
+ }
23759
+ this.renderReactApp();
23760
+ this.syncGuideHighlight();
23761
+ }
23762
+ currentGuideStep() {
23763
+ if (!this.activeGuide || this.activeGuide.state !== "started") {
23764
+ return null;
23765
+ }
23766
+ return this.activeGuide.steps[Math.min(this.activeGuide.currentStepIndex, Math.max(this.activeGuide.steps.length - 1, 0))] ?? null;
23767
+ }
23768
+ syncGuideHighlight() {
23769
+ const step = this.currentGuideStep();
23770
+ if (!step?.targetSelector || !this.registry) {
23771
+ return;
23772
+ }
23773
+ this.registry.highlightTargets(
23774
+ [{ selector: step.targetSelector, label: step.targetLabel || step.title }],
23775
+ { interaction: step.actionKind ? "execute" : "explain", durationMs: 2100 }
23776
+ );
23777
+ }
23333
23778
  updateActionState(id, state) {
23334
23779
  this.items = this.items.map(
23335
23780
  (item) => item.type === "action" && item.id === id ? { ...item, state } : item
@@ -23343,8 +23788,24 @@ ${config.system}`;
23343
23788
  const existingPlanItem = this.items.find(
23344
23789
  (item) => item.type === "plan" && item.id === this.planItemId(run.id)
23345
23790
  );
23346
- if (this.activeRun?.id && this.activeRun.id !== run.id) {
23791
+ const isNewActiveRun = Boolean(this.activeRun?.id && this.activeRun.id !== run.id);
23792
+ if (isNewActiveRun) {
23347
23793
  this.executedToolCounts.clear();
23794
+ this.items = this.items.map((item) => {
23795
+ if (item.type !== "plan" || item.id === this.planItemId(run.id)) {
23796
+ return item;
23797
+ }
23798
+ if (item.status === "completed" || item.status === "failed" || item.status === "abandoned") {
23799
+ return item;
23800
+ }
23801
+ return {
23802
+ ...item,
23803
+ status: "abandoned",
23804
+ approvalState: "declined",
23805
+ progressLabel: item.progressLabel ?? "\u041F\u043B\u0430\u043D \u0437\u0430\u043C\u0435\u043D\u0451\u043D \u043D\u043E\u0432\u044B\u043C \u0437\u0430\u043F\u0440\u043E\u0441\u043E\u043C.",
23806
+ statusReason: item.statusReason ?? "\u041F\u043B\u0430\u043D \u0437\u0430\u043C\u0435\u043D\u0451\u043D \u043D\u043E\u0432\u044B\u043C \u0437\u0430\u043F\u0440\u043E\u0441\u043E\u043C."
23807
+ };
23808
+ });
23348
23809
  }
23349
23810
  this.activeRun = {
23350
23811
  ...run,
@@ -23428,7 +23889,7 @@ ${config.system}`;
23428
23889
  if (!this.runtimeStatus) {
23429
23890
  return;
23430
23891
  }
23431
- const mode = nativeRegistered ? "native-webmcp-active" : this.registry?.canExecuteWriteTools() ? "blinq-page-tools-active" : "read-only-fallback";
23892
+ const mode = nativeRegistered ? "native-webmcp-active" : this.registry ? "blinq-page-tools-active" : "read-only-fallback";
23432
23893
  this.runtimeStatus = {
23433
23894
  ...this.runtimeStatus,
23434
23895
  mode,
@@ -23442,23 +23903,141 @@ ${config.system}`;
23442
23903
  this.statusText = text;
23443
23904
  this.renderReactApp();
23444
23905
  }
23445
- appendMessage(text, role, options) {
23446
- const id = createConversationId("message");
23447
- this.items = [
23448
- ...this.items,
23449
- {
23450
- id,
23451
- type: "message",
23452
- role,
23453
- text,
23454
- status: options?.status ?? "done"
23455
- }
23456
- ];
23457
- this.renderReactApp();
23458
- if (options?.persist !== false) {
23459
- this.rememberMessage({ role, text });
23906
+ async guideRequest(path, body) {
23907
+ if (!this.sessionToken) {
23908
+ throw new Error("\u0421\u0435\u0441\u0441\u0438\u044F \u0432\u0438\u0434\u0436\u0435\u0442\u0430 \u0435\u0449\u0451 \u043D\u0435 \u0438\u043D\u0438\u0446\u0438\u0430\u043B\u0438\u0437\u0438\u0440\u043E\u0432\u0430\u043D\u0430");
23460
23909
  }
23461
- return id;
23910
+ const response = await fetch(`${this.apiBaseUrl}${path}`, {
23911
+ method: "POST",
23912
+ headers: {
23913
+ "Content-Type": "application/json",
23914
+ Authorization: `Bearer ${this.sessionToken}`
23915
+ },
23916
+ body: JSON.stringify(body)
23917
+ });
23918
+ if (!response.ok) {
23919
+ const payload = await response.json().catch(() => ({}));
23920
+ throw new Error(payload.detail ?? "\u041D\u0435 \u0443\u0434\u0430\u043B\u043E\u0441\u044C \u043E\u0431\u043D\u043E\u0432\u0438\u0442\u044C \u0441\u043E\u0441\u0442\u043E\u044F\u043D\u0438\u0435 guide");
23921
+ }
23922
+ return await response.json();
23923
+ }
23924
+ async startGuide() {
23925
+ if (!this.sessionId || !this.activeGuide) {
23926
+ return;
23927
+ }
23928
+ const payload = await this.guideRequest("/pub/guide/start", {
23929
+ session_id: this.sessionId,
23930
+ guide_id: this.activeGuide.source === "published" ? this.activeGuide.id : null
23931
+ });
23932
+ this.setGuideState(payload, { clearIfFinished: false });
23933
+ this.setStatus("Guide \u0437\u0430\u043F\u0443\u0449\u0435\u043D.");
23934
+ }
23935
+ async advanceGuide() {
23936
+ if (!this.sessionId) {
23937
+ return;
23938
+ }
23939
+ const payload = await this.guideRequest("/pub/guide/advance", {
23940
+ session_id: this.sessionId
23941
+ });
23942
+ this.setGuideState(payload);
23943
+ this.setStatus(payload.state === "completed" ? "Guide \u0437\u0430\u0432\u0435\u0440\u0448\u0451\u043D." : "\u041F\u0435\u0440\u0435\u0445\u043E\u0434\u0438\u043C \u043A \u0441\u043B\u0435\u0434\u0443\u044E\u0449\u0435\u043C\u0443 \u0448\u0430\u0433\u0443.");
23944
+ }
23945
+ async dismissGuide() {
23946
+ if (!this.sessionId) {
23947
+ return;
23948
+ }
23949
+ const payload = await this.guideRequest("/pub/guide/dismiss", {
23950
+ session_id: this.sessionId
23951
+ });
23952
+ this.setGuideState(payload);
23953
+ this.setStatus("Guide \u0441\u043A\u0440\u044B\u0442.");
23954
+ }
23955
+ async completeGuide() {
23956
+ if (!this.sessionId) {
23957
+ return;
23958
+ }
23959
+ const payload = await this.guideRequest("/pub/guide/complete", {
23960
+ session_id: this.sessionId
23961
+ });
23962
+ this.setGuideState(payload);
23963
+ this.setStatus("Guide \u0437\u0430\u0432\u0435\u0440\u0448\u0451\u043D.");
23964
+ }
23965
+ async runGuideStep() {
23966
+ const step = this.currentGuideStep();
23967
+ if (!step || !this.registry) {
23968
+ return;
23969
+ }
23970
+ if (step.actionKind && step.actionPayload && this.currentActionPolicy().actions_enabled && this.currentActionPolicy().action_mode === "execute_with_confirmation") {
23971
+ const outcome = await this.registry.executeTool({
23972
+ tool_name: step.actionKind,
23973
+ display_name: step.title,
23974
+ target_summary: step.targetLabel || step.body,
23975
+ arguments: step.actionPayload
23976
+ });
23977
+ if (outcome.status === "success") {
23978
+ this.setStatus("\u0428\u0430\u0433 \u0432\u044B\u043F\u043E\u043B\u043D\u0435\u043D \u043D\u0430 \u0441\u0442\u0440\u0430\u043D\u0438\u0446\u0435.");
23979
+ const deferredNavigationHref = outcome.result && typeof outcome.result.href === "string" && outcome.result.deferred_navigation ? outcome.result.href : null;
23980
+ await this.advanceGuide();
23981
+ if (deferredNavigationHref) {
23982
+ window.location.assign(deferredNavigationHref);
23983
+ }
23984
+ } else if (outcome.status === "cancelled") {
23985
+ this.setStatus("\u0412\u044B\u043F\u043E\u043B\u043D\u0435\u043D\u0438\u0435 \u0448\u0430\u0433\u0430 \u043E\u0442\u043C\u0435\u043D\u0435\u043D\u043E.");
23986
+ } else {
23987
+ await this.healGuideStep();
23988
+ }
23989
+ return;
23990
+ }
23991
+ if (step.targetSelector) {
23992
+ const highlighted = this.registry.highlightTargets(
23993
+ [{ selector: step.targetSelector, label: step.targetLabel || step.title }],
23994
+ { interaction: "explain", durationMs: 2200 }
23995
+ );
23996
+ if (highlighted) {
23997
+ this.setStatus("\u041F\u043E\u043A\u0430\u0437\u0430\u043B, \u043A\u0443\u0434\u0430 \u043D\u0430\u0436\u0430\u0442\u044C \u043D\u0430 \u0441\u0442\u0440\u0430\u043D\u0438\u0446\u0435.");
23998
+ } else {
23999
+ await this.healGuideStep();
24000
+ }
24001
+ }
24002
+ }
24003
+ async healGuideStep() {
24004
+ if (!this.sessionId || !this.activeGuide || !this.registry) {
24005
+ return;
24006
+ }
24007
+ this.setStatus("\u041A\u0430\u0436\u0435\u0442\u0441\u044F \u044D\u043B\u0435\u043C\u0435\u043D\u0442 \u043F\u0435\u0440\u0435\u0435\u0445\u0430\u043B. \u0418\u0449\u0443 \u043D\u043E\u0432\u044B\u0435 \u0441\u043F\u043E\u0441\u043E\u0431\u044B \u0441 \u043F\u043E\u043C\u043E\u0449\u044C\u044E \u0418\u0418...");
24008
+ const pageContext = this.registry.collectPageContext();
24009
+ try {
24010
+ const payload = await this.guideRequest("/pub/guide/heal", {
24011
+ session_id: this.sessionId,
24012
+ step_index: this.activeGuide.currentStepIndex,
24013
+ page_context: pageContext
24014
+ });
24015
+ this.setGuideState(payload, { clearIfFinished: false });
24016
+ this.setStatus("\u0421\u0446\u0435\u043D\u0430\u0440\u0438\u0439 \u043F\u0435\u0440\u0435\u0441\u0442\u0440\u043E\u0435\u043D. \u041F\u0440\u043E\u0434\u043E\u043B\u0436\u0430\u044E...");
24017
+ window.setTimeout(() => {
24018
+ void this.runGuideStep();
24019
+ }, 1500);
24020
+ } catch (e) {
24021
+ this.setStatus("\u041D\u0435 \u0443\u0434\u0430\u043B\u043E\u0441\u044C \u043F\u0435\u0440\u0435\u0441\u0442\u0440\u043E\u0438\u0442\u044C \u0448\u0430\u0433.");
24022
+ }
24023
+ }
24024
+ appendMessage(text, role, options) {
24025
+ const id = createConversationId("message");
24026
+ this.items = [
24027
+ ...this.items,
24028
+ {
24029
+ id,
24030
+ type: "message",
24031
+ role,
24032
+ text,
24033
+ status: options?.status ?? "done"
24034
+ }
24035
+ ];
24036
+ this.renderReactApp();
24037
+ if (options?.persist !== false) {
24038
+ this.rememberMessage({ role, text });
24039
+ }
24040
+ return id;
23462
24041
  }
23463
24042
  updateMessage(id, text, status) {
23464
24043
  this.items = this.items.map(
@@ -23502,6 +24081,19 @@ ${config.system}`;
23502
24081
  currentRoute() {
23503
24082
  return normalizedRouteFromUrl(window.location.href);
23504
24083
  }
24084
+ normalizedUserPlanDecision(message) {
24085
+ const normalized = message.trim().toLowerCase();
24086
+ if (!normalized || !this.activeRun?.requires_approval) {
24087
+ return null;
24088
+ }
24089
+ if (PLAN_APPROVE_TEXTS.has(normalized)) {
24090
+ return true;
24091
+ }
24092
+ if (PLAN_DECLINE_TEXTS.has(normalized)) {
24093
+ return false;
24094
+ }
24095
+ return null;
24096
+ }
23505
24097
  shouldAutoResumeActiveRun() {
23506
24098
  if (!this.activeRun || this.activeRun.status !== "awaiting_navigation") {
23507
24099
  return false;
@@ -23600,7 +24192,13 @@ ${config.system}`;
23600
24192
  }
23601
24193
  if (event === "highlight") {
23602
24194
  const highlight = JSON.parse(data);
23603
- this.registry?.highlightTargets(highlight.targets ?? []);
24195
+ this.registry?.highlightTargets(highlight.targets ?? [], { interaction: "explain" });
24196
+ }
24197
+ if (event === "guide") {
24198
+ this.hideThinkingIndicator();
24199
+ this.setGuideState(JSON.parse(data), {
24200
+ clearIfFinished: false
24201
+ });
23604
24202
  }
23605
24203
  if (event === "delta" && payload.text) {
23606
24204
  const normalizedChunk = normalizeAssistantStreamChunk(finalText, payload.text);
@@ -23682,6 +24280,18 @@ ${config.system}`;
23682
24280
  let responseMessageId = null;
23683
24281
  try {
23684
24282
  this.appendMessage(message, "user");
24283
+ const directPlanDecision = this.normalizedUserPlanDecision(message);
24284
+ if (directPlanDecision !== null) {
24285
+ const finalText2 = await this.respondToPlan(directPlanDecision, {
24286
+ appendAssistantMessage: false,
24287
+ manageSendingState: false
24288
+ });
24289
+ if (finalText2.trim()) {
24290
+ this.finalizeAssistantMessage(finalText2, { persist: false });
24291
+ this.rememberMessage({ role: "assistant", text: finalText2 });
24292
+ }
24293
+ return finalText2;
24294
+ }
23685
24295
  const finalText = await this.streamChatStep(
23686
24296
  "/pub/chat",
23687
24297
  {
@@ -23742,16 +24352,19 @@ ${config.system}`;
23742
24352
  this.renderReactApp();
23743
24353
  }
23744
24354
  }
23745
- async respondToPlan(approved) {
24355
+ async respondToPlan(approved, options) {
23746
24356
  if (!this.sessionId || !this.sessionToken || !this.activeRun) {
23747
- return;
24357
+ return "";
23748
24358
  }
23749
- if (this.isSending) {
23750
- return;
24359
+ const manageSendingState = options?.manageSendingState ?? true;
24360
+ if (manageSendingState && this.isSending) {
24361
+ return "";
24362
+ }
24363
+ if (manageSendingState) {
24364
+ this.isSending = true;
24365
+ this.showThinkingIndicator();
24366
+ this.renderReactApp();
23751
24367
  }
23752
- this.isSending = true;
23753
- this.showThinkingIndicator();
23754
- this.renderReactApp();
23755
24368
  try {
23756
24369
  const finalText = await this.streamChatStep(
23757
24370
  "/pub/plan/approve",
@@ -23763,14 +24376,17 @@ ${config.system}`;
23763
24376
  },
23764
24377
  null
23765
24378
  );
23766
- if (finalText.trim()) {
24379
+ if (options?.appendAssistantMessage !== false && finalText.trim()) {
23767
24380
  this.finalizeAssistantMessage(finalText, { persist: false });
23768
24381
  this.rememberMessage({ role: "assistant", text: finalText });
23769
24382
  }
24383
+ return finalText;
23770
24384
  } finally {
23771
- this.hideThinkingIndicator();
23772
- this.isSending = false;
23773
- this.renderReactApp();
24385
+ if (manageSendingState) {
24386
+ this.hideThinkingIndicator();
24387
+ this.isSending = false;
24388
+ this.renderReactApp();
24389
+ }
23774
24390
  }
23775
24391
  }
23776
24392
  async endSession() {
@@ -23824,27 +24440,41 @@ ${config.system}`;
23824
24440
  display: flex;
23825
24441
  flex-direction: column;
23826
24442
  gap: 12px;
23827
- width: 420px;
24443
+ width: 432px;
23828
24444
  max-width: calc(100vw - 24px);
23829
- font-family:
23830
- "Inter", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont,
23831
- "Segoe UI", sans-serif;
23832
24445
  pointer-events: none;
24446
+ font-family:
24447
+ "SF Pro Display",
24448
+ "SF Pro Text",
24449
+ "Inter",
24450
+ ui-sans-serif,
24451
+ system-ui,
24452
+ -apple-system,
24453
+ BlinkMacSystemFont,
24454
+ "Segoe UI",
24455
+ sans-serif;
23833
24456
  --blinq-accent: #111111;
23834
- --blinq-background: #ffffff;
23835
- --blinq-panel: rgba(255, 255, 255, 0.98);
23836
- --blinq-panel-soft: #fafafa;
23837
- --blinq-surface: #ffffff;
23838
- --blinq-surface-soft: #f5f5f5;
23839
- --blinq-surface-muted: #ededed;
23840
- --blinq-border: rgba(17, 17, 17, 0.08);
23841
- --blinq-border-strong: rgba(17, 17, 17, 0.18);
23842
- --blinq-text: #111111;
23843
- --blinq-text-soft: #262626;
23844
- --blinq-text-muted: #737373;
23845
- --blinq-user-bubble: #111111;
23846
- --blinq-user-text: #ffffff;
23847
- --blinq-shadow: 0 24px 60px rgba(17, 17, 17, 0.12);
24457
+ --blinq-text: rgba(18, 18, 20, 0.96);
24458
+ --blinq-text-soft: rgba(32, 34, 38, 0.82);
24459
+ --blinq-text-muted: rgba(56, 60, 66, 0.58);
24460
+ --blinq-glass-fill: linear-gradient(180deg, rgba(255, 255, 255, 0.78), rgba(240, 243, 248, 0.52));
24461
+ --blinq-glass-fill-strong: linear-gradient(180deg, rgba(255, 255, 255, 0.88), rgba(245, 247, 250, 0.62));
24462
+ --blinq-glass-fill-dense: linear-gradient(180deg, rgba(249, 250, 252, 0.92), rgba(231, 235, 241, 0.66));
24463
+ --blinq-glass-stroke: rgba(255, 255, 255, 0.68);
24464
+ --blinq-glass-stroke-soft: rgba(255, 255, 255, 0.5);
24465
+ --blinq-glass-edge: rgba(100, 109, 123, 0.14);
24466
+ --blinq-shadow:
24467
+ 0 28px 80px rgba(155, 164, 180, 0.22),
24468
+ 0 10px 30px rgba(174, 182, 193, 0.18);
24469
+ --blinq-shadow-soft:
24470
+ 0 14px 40px rgba(170, 177, 189, 0.18),
24471
+ 0 4px 14px rgba(202, 208, 216, 0.18);
24472
+ --blinq-inner-highlight: inset 0 1px 0 rgba(255, 255, 255, 0.92);
24473
+ --blinq-blur: blur(28px) saturate(170%);
24474
+ --blinq-radius-panel: 32px;
24475
+ --blinq-radius-pill: 999px;
24476
+ --blinq-radius-bubble: 28px;
24477
+ --blinq-radius-card: 30px;
23848
24478
  }
23849
24479
 
23850
24480
  .blinq-shell[data-side="left"] {
@@ -23862,463 +24492,240 @@ ${config.system}`;
23862
24492
  pointer-events: auto;
23863
24493
  }
23864
24494
 
23865
- .blinq-launcher {
23866
- display: inline-flex;
23867
- align-items: center;
23868
- justify-content: center;
23869
- gap: 12px;
23870
- min-height: 58px;
23871
- padding: 0 18px;
23872
- border: 1px solid var(--blinq-border);
23873
- border-radius: 20px;
23874
- background: #ffffff;
23875
- color: var(--blinq-text);
23876
- box-shadow: 0 18px 40px rgba(17, 17, 17, 0.12);
23877
- backdrop-filter: blur(18px);
23878
- -webkit-backdrop-filter: blur(18px);
23879
- transition:
23880
- transform 180ms ease,
23881
- box-shadow 180ms ease,
23882
- border-color 180ms ease;
23883
- }
23884
-
23885
- .blinq-launcher:hover {
23886
- transform: translateY(-2px);
23887
- border-color: rgba(17, 17, 17, 0.16);
23888
- box-shadow: 0 22px 46px rgba(17, 17, 17, 0.16);
23889
- }
23890
-
23891
- .blinq-launcher-badge {
23892
- display: grid;
23893
- place-items: center;
23894
- width: 34px;
23895
- height: 34px;
23896
- border-radius: 12px;
23897
- background: #111111;
23898
- color: #ffffff;
23899
- transition:
23900
- transform 180ms ease,
23901
- box-shadow 180ms ease;
23902
- }
23903
-
23904
- .blinq-launcher:hover .blinq-launcher-badge {
23905
- transform: scale(1.06);
23906
- box-shadow: 0 10px 24px rgba(17, 17, 17, 0.22);
23907
- }
23908
-
23909
- .blinq-launcher-icon-only {
23910
- width: 58px;
23911
- min-width: 58px;
23912
- padding: 0;
23913
- border-radius: 18px;
23914
- }
23915
-
23916
- .blinq-launcher-agent {
23917
- overflow: visible;
24495
+ .blinq-shell {
24496
+ width: 520px;
23918
24497
  }
23919
24498
 
23920
- .blinq-agent-orbit {
23921
- stroke: rgba(255, 255, 255, 0.42);
23922
- stroke-width: 1.3;
23923
- stroke-dasharray: 2.6 2.6;
23924
- transform-origin: center;
23925
- transition: opacity 180ms ease;
24499
+ .blinq-panel {
24500
+ position: relative;
24501
+ width: 100%;
24502
+ max-width: 432px;
24503
+ overflow: hidden;
24504
+ border-radius: var(--blinq-radius-panel);
24505
+ border: 1px solid var(--blinq-glass-stroke);
24506
+ background: var(--blinq-glass-fill);
24507
+ box-shadow: var(--blinq-shadow);
24508
+ backdrop-filter: var(--blinq-blur);
24509
+ -webkit-backdrop-filter: var(--blinq-blur);
23926
24510
  }
23927
24511
 
23928
- .blinq-agent-spark,
23929
- .blinq-agent-head,
23930
- .blinq-agent-antenna,
23931
- .blinq-agent-antenna-dot,
23932
- .blinq-agent-neck {
23933
- transform-origin: center;
24512
+ .blinq-panel::before,
24513
+ .blinq-launcher::before {
24514
+ content: "";
24515
+ position: absolute;
24516
+ inset: 0;
24517
+ pointer-events: none;
24518
+ border-radius: inherit;
24519
+ box-shadow: var(--blinq-inner-highlight);
23934
24520
  }
23935
24521
 
23936
- .blinq-launcher:hover .blinq-agent-orbit {
23937
- animation: blinq-agent-spin 2.2s linear infinite;
24522
+ .blinq-launcher::after {
24523
+ content: "";
24524
+ position: absolute;
24525
+ inset: 1px;
24526
+ pointer-events: none;
24527
+ border-radius: inherit;
24528
+ background:
24529
+ radial-gradient(circle at 28% 22%, rgba(255, 255, 255, 0.82), transparent 32%),
24530
+ linear-gradient(135deg, rgba(255, 255, 255, 0.46), transparent 55%);
24531
+ opacity: 0.88;
24532
+ transition:
24533
+ opacity 180ms ease;
23938
24534
  }
23939
24535
 
23940
- .blinq-launcher:hover .blinq-agent-spark {
23941
- animation: blinq-agent-spark 1.1s ease-in-out infinite;
24536
+ .blinq-panel::after {
24537
+ content: "";
24538
+ position: absolute;
24539
+ inset: 0;
24540
+ pointer-events: none;
24541
+ border-radius: inherit;
24542
+ background:
24543
+ radial-gradient(circle at top left, rgba(255, 255, 255, 0.72), transparent 34%),
24544
+ radial-gradient(circle at bottom center, rgba(255, 255, 255, 0.26), transparent 38%);
24545
+ opacity: 0.95;
23942
24546
  }
23943
24547
 
23944
- .blinq-launcher:hover .blinq-agent-head,
23945
- .blinq-launcher:hover .blinq-agent-neck,
23946
- .blinq-launcher:hover .blinq-agent-antenna,
23947
- .blinq-launcher:hover .blinq-agent-antenna-dot {
23948
- animation: blinq-agent-bob 1.35s ease-in-out infinite;
24548
+ .blinq-header,
24549
+ .blinq-thread,
24550
+ .blinq-composer {
24551
+ position: relative;
24552
+ z-index: 1;
23949
24553
  }
23950
24554
 
23951
- .blinq-launcher-copy {
24555
+ .blinq-header {
23952
24556
  display: flex;
23953
24557
  flex-direction: column;
23954
- align-items: flex-start;
23955
- line-height: 1.1;
23956
- }
23957
-
23958
- .blinq-launcher-label {
23959
- font-size: 11px;
23960
- font-weight: 700;
23961
- letter-spacing: 0.08em;
23962
- text-transform: uppercase;
23963
- color: var(--blinq-text-muted);
23964
- }
23965
-
23966
- .blinq-launcher-title {
23967
- margin-top: 3px;
23968
- font-size: 14px;
23969
- font-weight: 600;
23970
- color: var(--blinq-text);
23971
- }
23972
-
23973
- .blinq-panel {
23974
- width: 100%;
23975
- max-width: 420px;
23976
- border: 1px solid var(--blinq-border);
23977
- border-radius: 28px;
23978
- overflow: hidden;
23979
- background: #ffffff;
23980
- box-shadow: var(--blinq-shadow);
23981
- backdrop-filter: blur(24px);
23982
- -webkit-backdrop-filter: blur(24px);
23983
- }
23984
-
23985
- .blinq-header {
23986
- padding: 16px;
23987
- border-bottom: 1px solid var(--blinq-border);
23988
- background: #ffffff;
23989
- }
23990
-
23991
- .blinq-status-line {
23992
- margin-top: 10px;
23993
- font-size: 12px;
23994
- line-height: 1.45;
23995
- color: var(--blinq-text-muted);
24558
+ gap: 12px;
24559
+ padding: 18px 18px 10px;
23996
24560
  }
23997
24561
 
23998
24562
  .blinq-header-row {
23999
24563
  display: flex;
24000
- align-items: center;
24564
+ align-items: flex-start;
24001
24565
  justify-content: space-between;
24002
24566
  gap: 12px;
24003
24567
  }
24004
24568
 
24005
24569
  .blinq-header-copy {
24006
- min-width: 0;
24007
- flex: 1;
24008
- }
24009
-
24010
- .blinq-header-badges {
24011
24570
  display: flex;
24012
- flex-wrap: wrap;
24571
+ flex-direction: column;
24013
24572
  gap: 8px;
24014
- }
24015
-
24016
- .blinq-heading-row {
24017
- margin-top: 14px;
24018
- display: flex;
24019
- align-items: flex-start;
24020
- justify-content: space-between;
24021
- gap: 12px;
24573
+ min-width: 0;
24574
+ flex: 1;
24022
24575
  }
24023
24576
 
24024
24577
  .blinq-heading {
24025
- font-size: 16px;
24026
- font-weight: 700;
24027
- letter-spacing: -0.02em;
24578
+ font-size: 17px;
24579
+ line-height: 1.15;
24580
+ font-weight: 600;
24581
+ letter-spacing: -0.03em;
24028
24582
  color: var(--blinq-text);
24029
24583
  }
24030
24584
 
24031
- .blinq-subheading {
24032
- margin-top: 6px;
24033
- max-width: 320px;
24034
- font-size: 13px;
24035
- line-height: 1.45;
24036
- color: var(--blinq-text-muted);
24037
- }
24038
-
24039
- .blinq-statusbar {
24040
- margin-top: 14px;
24041
- display: flex;
24042
- align-items: center;
24043
- justify-content: space-between;
24044
- gap: 10px;
24045
- flex-wrap: wrap;
24046
- }
24047
-
24048
- .blinq-status {
24585
+ .blinq-status-line {
24049
24586
  display: inline-flex;
24050
24587
  align-items: center;
24051
- min-height: 34px;
24588
+ gap: 8px;
24589
+ max-width: fit-content;
24590
+ min-height: 32px;
24052
24591
  padding: 0 12px;
24053
- border-radius: 999px;
24054
- border: 1px solid var(--blinq-border);
24055
- background: #f8f8f8;
24592
+ border-radius: var(--blinq-radius-pill);
24593
+ border: 1px solid var(--blinq-glass-stroke-soft);
24594
+ background: linear-gradient(180deg, rgba(255, 255, 255, 0.72), rgba(242, 244, 248, 0.46));
24056
24595
  color: var(--blinq-text-soft);
24057
24596
  font-size: 12px;
24058
- line-height: 1.45;
24597
+ line-height: 1.35;
24598
+ box-shadow: var(--blinq-shadow-soft);
24599
+ backdrop-filter: blur(22px) saturate(170%);
24600
+ -webkit-backdrop-filter: blur(22px) saturate(170%);
24601
+ }
24602
+
24603
+ .blinq-status-line::before {
24604
+ content: "";
24605
+ width: 7px;
24606
+ height: 7px;
24607
+ border-radius: 999px;
24608
+ background: rgba(17, 17, 17, 0.74);
24609
+ box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.34);
24610
+ flex: none;
24059
24611
  }
24060
24612
 
24061
- .blinq-runtime-chip {
24613
+ .blinq-launcher {
24614
+ position: relative;
24062
24615
  display: inline-flex;
24063
24616
  align-items: center;
24064
- min-height: 34px;
24065
- padding: 0 12px;
24617
+ justify-content: center;
24618
+ width: 76px;
24619
+ min-width: 76px;
24620
+ height: 76px;
24621
+ padding: 0;
24066
24622
  border-radius: 999px;
24067
- background: #111111;
24068
- border: 1px solid #111111;
24069
- color: #ffffff;
24070
- font-size: 12px;
24071
- font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
24623
+ border: 1px solid var(--blinq-glass-stroke);
24624
+ background: var(--blinq-glass-fill-strong);
24625
+ box-shadow: var(--blinq-shadow-soft);
24626
+ backdrop-filter: blur(26px) saturate(175%);
24627
+ -webkit-backdrop-filter: blur(26px) saturate(175%);
24628
+ color: var(--blinq-text);
24629
+ isolation: isolate;
24072
24630
  }
24073
24631
 
24074
- .blinq-workspace {
24075
- display: grid;
24076
- grid-template-columns: 112px minmax(0, 1fr);
24077
- min-height: 430px;
24632
+ .blinq-launcher:hover {
24633
+ border-color: var(--blinq-glass-stroke);
24634
+ box-shadow: var(--blinq-shadow-soft);
24078
24635
  }
24079
24636
 
24080
- .blinq-sidebar {
24081
- display: flex;
24082
- flex-direction: column;
24083
- gap: 14px;
24084
- padding: 16px;
24085
- border-right: 1px solid var(--blinq-border);
24086
- background: #fafafa;
24637
+ .blinq-launcher-icon-only {
24638
+ border-radius: 999px;
24087
24639
  }
24088
24640
 
24089
- .blinq-sidebar-group {
24090
- display: flex;
24091
- flex-direction: column;
24092
- gap: 8px;
24641
+ .blinq-launcher-icon {
24642
+ position: relative;
24643
+ z-index: 1;
24644
+ width: 30px;
24645
+ height: 30px;
24646
+ color: rgba(17, 17, 17, 0.96);
24647
+ opacity: 1;
24648
+ filter:
24649
+ drop-shadow(0 1px 0 rgba(255, 255, 255, 0.66))
24650
+ drop-shadow(0 2px 6px rgba(17, 17, 17, 0.08));
24093
24651
  }
24094
24652
 
24095
- .blinq-tab-trigger {
24096
- display: flex;
24097
- align-items: center;
24098
- gap: 10px;
24653
+ .blinq-thread {
24654
+ min-height: 0;
24655
+ }
24656
+
24657
+ .blinq-thread-viewport {
24099
24658
  width: 100%;
24100
- min-height: 56px;
24101
- padding: 10px;
24102
- border: 1px solid transparent;
24103
- border-radius: 18px;
24104
- background: transparent;
24105
- color: var(--blinq-text-soft);
24106
- cursor: pointer;
24107
- transition:
24108
- background 120ms ease,
24109
- border-color 120ms ease,
24110
- color 120ms ease,
24111
- transform 120ms ease;
24112
24659
  }
24113
24660
 
24114
- .blinq-tab-trigger:hover {
24115
- background: rgba(255,255,255,0.9);
24116
- border-color: var(--blinq-border);
24661
+ .blinq-scroll {
24662
+ display: flex;
24663
+ flex-direction: column;
24664
+ gap: 12px;
24665
+ min-height: 0;
24666
+ max-height: 432px;
24667
+ padding: 6px 18px 14px;
24668
+ overflow-y: auto;
24117
24669
  }
24118
24670
 
24119
- .blinq-tab-trigger-active {
24120
- background: #ffffff;
24121
- border-color: rgba(17, 17, 17, 0.16);
24122
- box-shadow: 0 10px 24px rgba(17, 17, 17, 0.08);
24123
- color: var(--blinq-text);
24671
+ .blinq-scroll::-webkit-scrollbar {
24672
+ width: 8px;
24124
24673
  }
24125
24674
 
24126
- .blinq-tab-icon {
24127
- display: grid;
24128
- place-items: center;
24129
- width: 32px;
24130
- height: 32px;
24131
- border-radius: 12px;
24132
- background: rgba(15, 23, 42, 0.04);
24133
- color: currentColor;
24134
- flex: 0 0 auto;
24135
- }
24136
-
24137
- .blinq-tab-copy {
24138
- display: flex;
24139
- flex-direction: column;
24140
- min-width: 0;
24141
- align-items: flex-start;
24142
- text-align: left;
24143
- }
24144
-
24145
- .blinq-tab-label {
24146
- font-size: 13px;
24147
- font-weight: 600;
24148
- }
24149
-
24150
- .blinq-tab-caption {
24151
- margin-top: 2px;
24152
- font-size: 11px;
24153
- color: var(--blinq-text-muted);
24154
- }
24155
-
24156
- .blinq-tab-count {
24157
- margin-left: auto;
24158
- min-width: 22px;
24159
- height: 22px;
24160
- padding: 0 6px;
24161
- display: inline-flex;
24162
- align-items: center;
24163
- justify-content: center;
24164
- border-radius: 999px;
24165
- background: rgba(15, 23, 42, 0.06);
24166
- color: var(--blinq-text-soft);
24167
- font-size: 11px;
24168
- font-weight: 700;
24169
- }
24170
-
24171
- .blinq-separator {
24172
- height: 1px;
24173
- background: var(--blinq-border);
24174
- }
24175
-
24176
- .blinq-sidebar-card {
24177
- gap: 12px;
24178
- border-radius: 18px;
24179
- background: rgba(255,255,255,0.94);
24180
- box-shadow: 0 12px 30px rgba(15, 23, 42, 0.06);
24181
- }
24182
-
24183
- .blinq-sidebar-card-header {
24184
- padding: 14px 14px 0;
24185
- }
24186
-
24187
- .blinq-sidebar-card-content {
24188
- padding: 0 14px 14px;
24189
- display: flex;
24190
- flex-direction: column;
24191
- gap: 10px;
24192
- }
24193
-
24194
- .blinq-stat-line {
24195
- display: flex;
24196
- align-items: center;
24197
- justify-content: space-between;
24198
- gap: 8px;
24199
- font-size: 12px;
24200
- color: var(--blinq-text-muted);
24201
- }
24202
-
24203
- .blinq-stat-line strong {
24204
- color: var(--blinq-text);
24205
- font-size: 12px;
24206
- }
24207
-
24208
- .blinq-main {
24209
- display: flex;
24210
- flex-direction: column;
24211
- min-width: 0;
24212
- background: transparent;
24213
- }
24214
-
24215
- .blinq-main-toolbar {
24216
- padding: 16px 18px 12px;
24217
- display: flex;
24218
- flex-direction: column;
24219
- gap: 10px;
24220
- }
24221
-
24222
- .blinq-toolbar-label {
24223
- font-size: 11px;
24224
- font-weight: 700;
24225
- letter-spacing: 0.08em;
24226
- text-transform: uppercase;
24227
- color: var(--blinq-text-muted);
24228
- }
24229
-
24230
- .blinq-prompt-row {
24231
- display: flex;
24232
- gap: 8px;
24233
- flex-wrap: wrap;
24234
- }
24235
-
24236
- .blinq-prompt-chip {
24237
- padding: 8px 12px;
24238
- border-radius: 999px;
24239
- border: 1px solid var(--blinq-border);
24240
- background: rgba(255,255,255,0.95);
24241
- color: var(--blinq-text-soft);
24242
- font-size: 12px;
24243
- font-weight: 600;
24244
- cursor: pointer;
24245
- transition:
24246
- background 120ms ease,
24247
- border-color 120ms ease,
24248
- color 120ms ease,
24249
- transform 120ms ease;
24250
- }
24251
-
24252
- .blinq-prompt-chip:hover {
24253
- border-color: rgba(17, 17, 17, 0.16);
24254
- color: #111111;
24255
- background: #f7f7f7;
24256
- }
24257
-
24258
- .blinq-scroll {
24259
- display: flex;
24260
- flex-direction: column;
24261
- gap: 12px;
24262
- min-height: 0;
24263
- height: 100%;
24264
- max-height: 420px;
24265
- padding: 16px;
24266
- overflow-y: auto;
24267
- }
24268
-
24269
- .blinq-thread {
24270
- min-height: 0;
24271
- }
24272
-
24273
- .blinq-thread-viewport {
24274
- width: 100%;
24275
- }
24276
-
24277
- .blinq-scroll-actions,
24278
- .blinq-scroll-context {
24279
- padding-top: 18px;
24280
- }
24281
-
24282
- .blinq-scroll::-webkit-scrollbar {
24283
- width: 8px;
24284
- }
24285
-
24286
- .blinq-scroll::-webkit-scrollbar-thumb {
24287
- background: rgba(148, 163, 184, 0.25);
24288
- border-radius: 999px;
24675
+ .blinq-scroll::-webkit-scrollbar-thumb {
24676
+ background: rgba(144, 151, 162, 0.22);
24677
+ border-radius: 999px;
24289
24678
  }
24290
24679
 
24291
24680
  .blinq-message {
24681
+ position: relative;
24292
24682
  max-width: 88%;
24293
- border-radius: 20px;
24294
- padding: 13px 14px;
24683
+ padding: 14px 16px;
24684
+ border-radius: var(--blinq-radius-bubble);
24685
+ border: 1px solid var(--blinq-glass-stroke-soft);
24686
+ background: var(--blinq-glass-fill-strong);
24687
+ color: var(--blinq-text);
24295
24688
  font-size: 14px;
24296
24689
  line-height: 1.55;
24297
24690
  white-space: pre-wrap;
24298
- border: 1px solid var(--blinq-border);
24299
- box-shadow: 0 12px 30px rgba(15, 23, 42, 0.05);
24691
+ box-shadow: var(--blinq-shadow-soft);
24692
+ backdrop-filter: blur(24px) saturate(170%);
24693
+ -webkit-backdrop-filter: blur(24px) saturate(170%);
24694
+ }
24695
+
24696
+ .blinq-message::before {
24697
+ content: "";
24698
+ position: absolute;
24699
+ inset: 0;
24700
+ border-radius: inherit;
24701
+ pointer-events: none;
24702
+ box-shadow: var(--blinq-inner-highlight);
24300
24703
  }
24301
24704
 
24302
24705
  .blinq-message[data-role="assistant"] {
24303
24706
  align-self: flex-start;
24304
- background: rgba(255,255,255,0.98);
24305
- color: var(--blinq-text);
24707
+ background: linear-gradient(180deg, rgba(255, 255, 255, 0.86), rgba(241, 244, 249, 0.58));
24708
+ }
24709
+
24710
+ .blinq-message[data-role="user"] {
24711
+ align-self: flex-end;
24712
+ background: linear-gradient(180deg, rgba(249, 250, 252, 0.94), rgba(227, 232, 238, 0.66));
24713
+ border-color: rgba(255, 255, 255, 0.74);
24306
24714
  }
24307
24715
 
24308
24716
  .blinq-message[data-kind="artifact"] {
24309
- max-width: 100%;
24310
24717
  width: 100%;
24718
+ max-width: 100%;
24311
24719
  padding: 0;
24312
24720
  border: 0;
24313
24721
  background: transparent;
24314
24722
  box-shadow: none;
24723
+ backdrop-filter: none;
24724
+ -webkit-backdrop-filter: none;
24315
24725
  }
24316
24726
 
24317
- .blinq-message[data-role="user"] {
24318
- align-self: flex-end;
24319
- background: var(--blinq-user-bubble);
24320
- border-color: rgba(17, 17, 17, 0.22);
24321
- color: var(--blinq-user-text);
24727
+ .blinq-message[data-kind="artifact"]::before {
24728
+ display: none;
24322
24729
  }
24323
24730
 
24324
24731
  .blinq-message-copy {
@@ -24326,28 +24733,21 @@ ${config.system}`;
24326
24733
  }
24327
24734
 
24328
24735
  .blinq-message-copy-reveal {
24329
- animation: blinq-blur-in 220ms cubic-bezier(0.16, 1, 0.3, 1);
24330
- will-change: opacity, transform, filter;
24736
+ animation: blinq-copy-reveal 240ms cubic-bezier(0.16, 1, 0.3, 1);
24737
+ will-change: opacity, transform;
24331
24738
  }
24332
24739
 
24333
24740
  .blinq-thinking-card {
24334
- align-self: flex-start;
24335
- background: rgba(255,255,255,0.98);
24336
- color: var(--blinq-text);
24741
+ max-width: fit-content;
24742
+ padding-right: 18px;
24337
24743
  }
24338
24744
 
24339
24745
  .blinq-thinking {
24340
24746
  display: inline-flex;
24341
24747
  align-items: center;
24342
24748
  gap: 10px;
24343
- min-height: 20px;
24749
+ color: var(--blinq-text-soft);
24344
24750
  font-size: 13px;
24345
- color: var(--blinq-text-muted);
24346
- opacity: 1;
24347
- transform: translateY(0);
24348
- transition:
24349
- opacity 180ms ease,
24350
- transform 180ms ease;
24351
24751
  }
24352
24752
 
24353
24753
  .blinq-thinking-dots {
@@ -24360,45 +24760,49 @@ ${config.system}`;
24360
24760
  width: 6px;
24361
24761
  height: 6px;
24362
24762
  border-radius: 999px;
24363
- background: #111111;
24364
- animation: blinq-thinking-pulse 1.1s ease-in-out infinite;
24763
+ background: rgba(17, 17, 17, 0.74);
24764
+ animation: blinq-thinking-pulse 1.2s ease-in-out infinite;
24365
24765
  }
24366
24766
 
24367
24767
  .blinq-thinking-dots > span:nth-child(2) {
24368
- animation-delay: 120ms;
24768
+ animation-delay: 100ms;
24369
24769
  }
24370
24770
 
24371
24771
  .blinq-thinking-dots > span:nth-child(3) {
24372
- animation-delay: 240ms;
24772
+ animation-delay: 200ms;
24373
24773
  }
24374
24774
 
24375
24775
  .blinq-card {
24376
24776
  display: flex;
24377
24777
  flex-direction: column;
24378
- gap: 14px;
24379
- border: 1px solid var(--blinq-border);
24380
- border-radius: 20px;
24381
- background: var(--blinq-surface);
24778
+ gap: 12px;
24779
+ border-radius: var(--blinq-radius-card);
24780
+ border: 1px solid var(--blinq-glass-stroke-soft);
24781
+ background: linear-gradient(180deg, rgba(255, 255, 255, 0.78), rgba(240, 243, 248, 0.52));
24382
24782
  color: var(--blinq-text);
24383
- box-shadow: 0 16px 36px rgba(15, 23, 42, 0.06);
24783
+ box-shadow: var(--blinq-shadow-soft);
24784
+ backdrop-filter: blur(26px) saturate(170%);
24785
+ -webkit-backdrop-filter: blur(26px) saturate(170%);
24384
24786
  }
24385
24787
 
24386
24788
  .blinq-card-header {
24387
24789
  display: flex;
24388
24790
  flex-direction: column;
24389
- gap: 7px;
24791
+ gap: 8px;
24390
24792
  padding: 16px 16px 0;
24391
24793
  }
24392
24794
 
24393
24795
  .blinq-card-title {
24394
24796
  font-size: 15px;
24395
- font-weight: 700;
24797
+ line-height: 1.2;
24798
+ font-weight: 600;
24799
+ letter-spacing: -0.02em;
24396
24800
  color: var(--blinq-text);
24397
24801
  }
24398
24802
 
24399
24803
  .blinq-card-description {
24400
24804
  font-size: 13px;
24401
- line-height: 1.5;
24805
+ line-height: 1.45;
24402
24806
  color: var(--blinq-text-muted);
24403
24807
  }
24404
24808
 
@@ -24406,37 +24810,84 @@ ${config.system}`;
24406
24810
  padding: 0 16px 16px;
24407
24811
  }
24408
24812
 
24409
- .blinq-action-card {
24813
+ .blinq-action-card,
24814
+ .blinq-plan-card,
24815
+ .blinq-guide-card {
24410
24816
  align-self: stretch;
24411
- gap: 0;
24412
24817
  }
24413
24818
 
24414
- .blinq-plan-card {
24415
- border-color: var(--blinq-border-strong);
24819
+ .blinq-guide-content {
24820
+ display: flex;
24821
+ flex-direction: column;
24822
+ gap: 12px;
24823
+ }
24824
+
24825
+ .blinq-guide-step-shell {
24826
+ display: flex;
24827
+ flex-direction: column;
24828
+ gap: 8px;
24829
+ padding: 14px;
24830
+ border-radius: 22px;
24831
+ border: 1px solid rgba(255, 255, 255, 0.64);
24832
+ background:
24833
+ radial-gradient(circle at top left, rgba(255, 255, 255, 0.8), transparent 42%),
24834
+ linear-gradient(180deg, rgba(255, 255, 255, 0.82), rgba(242, 245, 249, 0.56));
24835
+ box-shadow:
24836
+ inset 0 1px 0 rgba(255, 255, 255, 0.94),
24837
+ 0 10px 22px rgba(183, 191, 201, 0.13);
24838
+ }
24839
+
24840
+ .blinq-guide-step-meta {
24841
+ font-size: 11px;
24842
+ font-weight: 600;
24843
+ letter-spacing: 0.08em;
24844
+ text-transform: uppercase;
24845
+ color: var(--blinq-text-soft);
24846
+ }
24847
+
24848
+ .blinq-guide-step-title {
24849
+ font-size: 14px;
24850
+ line-height: 1.35;
24851
+ font-weight: 600;
24852
+ color: var(--blinq-text);
24853
+ }
24854
+
24855
+ .blinq-guide-step-copy {
24856
+ font-size: 13px;
24857
+ line-height: 1.5;
24858
+ color: var(--blinq-text-muted);
24416
24859
  }
24417
24860
 
24418
24861
  .blinq-plan-step {
24419
24862
  display: flex;
24420
24863
  align-items: flex-start;
24421
- gap: 10px;
24422
- padding: 10px 0;
24423
- border-top: 1px solid rgba(17, 17, 17, 0.06);
24864
+ gap: 12px;
24865
+ padding: 12px 13px;
24866
+ margin-top: 10px;
24867
+ border-radius: 24px;
24868
+ border: 1px solid rgba(255, 255, 255, 0.62);
24869
+ background:
24870
+ radial-gradient(circle at top left, rgba(255, 255, 255, 0.72), transparent 38%),
24871
+ linear-gradient(180deg, rgba(255, 255, 255, 0.76), rgba(238, 242, 247, 0.54));
24872
+ box-shadow:
24873
+ inset 0 1px 0 rgba(255, 255, 255, 0.94),
24874
+ 0 8px 20px rgba(189, 196, 206, 0.12);
24424
24875
  }
24425
24876
 
24426
24877
  .blinq-plan-step:first-child {
24427
- border-top: 0;
24428
- padding-top: 0;
24878
+ margin-top: 0;
24429
24879
  }
24430
24880
 
24431
24881
  .blinq-plan-step-index {
24432
24882
  display: inline-flex;
24433
24883
  align-items: center;
24434
24884
  justify-content: center;
24435
- width: 22px;
24436
- height: 22px;
24885
+ width: 26px;
24886
+ height: 26px;
24437
24887
  border-radius: 999px;
24438
- background: #111111;
24439
- color: #ffffff;
24888
+ border: 1px solid rgba(255, 255, 255, 0.7);
24889
+ background: linear-gradient(180deg, rgba(255, 255, 255, 0.86), rgba(240, 243, 247, 0.62));
24890
+ color: rgba(17, 17, 17, 0.82);
24440
24891
  font-size: 11px;
24441
24892
  font-weight: 700;
24442
24893
  flex: none;
@@ -24446,9 +24897,62 @@ ${config.system}`;
24446
24897
  min-width: 0;
24447
24898
  display: flex;
24448
24899
  flex-direction: column;
24449
- gap: 3px;
24450
- font-size: 13px;
24900
+ gap: 6px;
24451
24901
  color: var(--blinq-text);
24902
+ font-size: 13px;
24903
+ flex: 1;
24904
+ }
24905
+
24906
+ .blinq-plan-header {
24907
+ display: flex;
24908
+ align-items: flex-start;
24909
+ justify-content: space-between;
24910
+ gap: 12px;
24911
+ }
24912
+
24913
+ .blinq-plan-content {
24914
+ display: flex;
24915
+ flex-direction: column;
24916
+ gap: 12px;
24917
+ }
24918
+
24919
+ .blinq-plan-steps {
24920
+ display: flex;
24921
+ flex-direction: column;
24922
+ gap: 0;
24923
+ }
24924
+
24925
+ .blinq-plan-step-title-row {
24926
+ display: flex;
24927
+ align-items: flex-start;
24928
+ justify-content: space-between;
24929
+ gap: 10px;
24930
+ }
24931
+
24932
+ .blinq-plan-step-title {
24933
+ min-width: 0;
24934
+ font-size: 13px;
24935
+ line-height: 1.4;
24936
+ font-weight: 600;
24937
+ letter-spacing: -0.01em;
24938
+ }
24939
+
24940
+ .blinq-plan-step-status-pill {
24941
+ display: inline-flex;
24942
+ align-items: center;
24943
+ justify-content: center;
24944
+ min-height: 24px;
24945
+ padding: 0 10px;
24946
+ border-radius: 999px;
24947
+ border: 1px solid rgba(255, 255, 255, 0.58);
24948
+ background: rgba(255, 255, 255, 0.58);
24949
+ box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.88);
24950
+ color: var(--blinq-text-soft);
24951
+ font-size: 11px;
24952
+ font-weight: 600;
24953
+ line-height: 1;
24954
+ letter-spacing: 0.01em;
24955
+ white-space: nowrap;
24452
24956
  }
24453
24957
 
24454
24958
  .blinq-plan-step-meta {
@@ -24456,17 +24960,36 @@ ${config.system}`;
24456
24960
  color: var(--blinq-text-muted);
24457
24961
  }
24458
24962
 
24963
+ .blinq-plan-step[data-current="true"] {
24964
+ background:
24965
+ radial-gradient(circle at top left, rgba(255, 255, 255, 0.82), transparent 40%),
24966
+ linear-gradient(180deg, rgba(255, 255, 255, 0.88), rgba(243, 246, 250, 0.64));
24967
+ border-color: rgba(255, 255, 255, 0.74);
24968
+ box-shadow:
24969
+ inset 0 1px 0 rgba(255, 255, 255, 0.96),
24970
+ 0 12px 26px rgba(183, 191, 201, 0.15);
24971
+ }
24972
+
24459
24973
  .blinq-plan-step[data-current="true"] .blinq-plan-step-index {
24460
- box-shadow: 0 0 0 4px rgba(17, 17, 17, 0.08);
24974
+ box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.48);
24975
+ }
24976
+
24977
+ .blinq-plan-step[data-current="true"] .blinq-plan-step-status-pill {
24978
+ background: linear-gradient(180deg, rgba(255, 255, 255, 0.82), rgba(240, 243, 247, 0.66));
24979
+ color: var(--blinq-text);
24461
24980
  }
24462
24981
 
24463
24982
  .blinq-plan-step[data-status="completed"] .blinq-plan-step-index {
24464
- background: #111111;
24983
+ background: rgba(227, 232, 237, 0.88);
24465
24984
  }
24466
24985
 
24467
- .blinq-plan-step[data-status="failed"] .blinq-plan-step-index,
24468
- .blinq-plan-step[data-status="cancelled"] .blinq-plan-step-index {
24469
- background: #525252;
24986
+ .blinq-plan-step[data-status="completed"] .blinq-plan-step-status-pill {
24987
+ background: rgba(244, 246, 249, 0.78);
24988
+ }
24989
+
24990
+ .blinq-plan-step[data-status="failed"],
24991
+ .blinq-plan-step[data-status="cancelled"] {
24992
+ opacity: 0.72;
24470
24993
  }
24471
24994
 
24472
24995
  .blinq-action-meta-row {
@@ -24482,11 +25005,18 @@ ${config.system}`;
24482
25005
  }
24483
25006
 
24484
25007
  .blinq-action-details > summary {
24485
- cursor: pointer;
25008
+ display: inline-flex;
25009
+ align-items: center;
25010
+ min-height: 34px;
25011
+ padding: 0 12px;
25012
+ border-radius: 999px;
25013
+ border: 1px solid rgba(255, 255, 255, 0.56);
25014
+ background: rgba(255, 255, 255, 0.46);
25015
+ color: var(--blinq-text-soft);
24486
25016
  font-size: 12px;
24487
25017
  font-weight: 600;
24488
- color: #111111;
24489
25018
  list-style: none;
25019
+ cursor: pointer;
24490
25020
  }
24491
25021
 
24492
25022
  .blinq-action-details > summary::-webkit-details-marker {
@@ -24495,29 +25025,26 @@ ${config.system}`;
24495
25025
 
24496
25026
  .blinq-code {
24497
25027
  margin-top: 10px;
24498
- padding: 10px 12px;
24499
- border-radius: 14px;
24500
- background: var(--blinq-surface-soft);
24501
- border: 1px solid var(--blinq-border);
25028
+ padding: 12px 14px;
25029
+ border-radius: 20px;
25030
+ border: 1px solid rgba(255, 255, 255, 0.56);
25031
+ background: rgba(255, 255, 255, 0.52);
25032
+ color: var(--blinq-text-soft);
24502
25033
  font-size: 12px;
24503
- line-height: 1.45;
25034
+ line-height: 1.5;
24504
25035
  white-space: pre-wrap;
24505
- color: var(--blinq-text-soft);
24506
25036
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
24507
25037
  }
24508
25038
 
24509
- .blinq-code-compact {
24510
- margin-top: 12px;
24511
- }
24512
-
24513
25039
  .blinq-action-state {
24514
25040
  margin-top: 12px;
24515
25041
  font-size: 12px;
25042
+ line-height: 1.4;
24516
25043
  color: var(--blinq-text-muted);
24517
25044
  }
24518
25045
 
24519
25046
  .blinq-action-state[data-state="approved"] {
24520
- color: #111111;
25047
+ color: var(--blinq-text-soft);
24521
25048
  }
24522
25049
 
24523
25050
  .blinq-action-state[data-state="declined"] {
@@ -24534,282 +25061,495 @@ ${config.system}`;
24534
25061
  flex: 1;
24535
25062
  }
24536
25063
 
24537
- .blinq-context-grid {
24538
- display: grid;
24539
- grid-template-columns: repeat(2, minmax(0, 1fr));
24540
- gap: 12px;
25064
+ .blinq-badge-pill {
25065
+ display: inline-flex;
25066
+ align-items: center;
25067
+ justify-content: center;
25068
+ min-height: 30px;
25069
+ padding: 0 12px;
25070
+ border-radius: 999px;
25071
+ border: 1px solid rgba(255, 255, 255, 0.54);
25072
+ background: rgba(255, 255, 255, 0.46);
25073
+ font-size: 11px;
25074
+ font-weight: 600;
25075
+ letter-spacing: 0.02em;
25076
+ color: var(--blinq-text-soft);
25077
+ box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.82);
25078
+ }
25079
+
25080
+ .blinq-badge-pill-default {
25081
+ background: rgba(255, 255, 255, 0.5);
25082
+ }
25083
+
25084
+ .blinq-badge-pill-outline {
25085
+ background: rgba(247, 248, 250, 0.34);
25086
+ color: var(--blinq-text-muted);
25087
+ }
25088
+
25089
+ .blinq-badge-pill-soft {
25090
+ background: rgba(255, 255, 255, 0.68);
25091
+ color: var(--blinq-text-soft);
25092
+ }
25093
+
25094
+ .blinq-badge-pill-accent {
25095
+ background: rgba(243, 245, 249, 0.84);
25096
+ color: var(--blinq-text);
25097
+ }
25098
+
25099
+ .blinq-composer {
25100
+ padding: 8px 18px 18px;
24541
25101
  }
24542
25102
 
24543
- .blinq-context-card {
24544
- min-height: 150px;
25103
+ .blinq-composer-controls {
25104
+ display: flex;
24545
25105
  }
24546
25106
 
24547
- .blinq-context-card-wide {
24548
- grid-column: 1 / -1;
25107
+ .blinq-input-shell {
25108
+ position: relative;
25109
+ width: 100%;
24549
25110
  }
24550
25111
 
24551
- .blinq-context-copy {
25112
+ .blinq-input,
25113
+ .blinq-recording-input {
25114
+ width: 100%;
25115
+ min-width: 0;
25116
+ height: 58px;
25117
+ padding: 0 54px 0 54px;
25118
+ border-radius: 999px;
25119
+ border: 1px solid var(--blinq-glass-stroke);
25120
+ background: linear-gradient(180deg, rgba(255, 255, 255, 0.82), rgba(239, 242, 247, 0.54));
25121
+ color: var(--blinq-text);
25122
+ box-shadow:
25123
+ var(--blinq-inner-highlight),
25124
+ 0 10px 26px rgba(183, 189, 198, 0.16);
24552
25125
  font-size: 13px;
24553
- line-height: 1.5;
25126
+ outline: none;
25127
+ backdrop-filter: blur(22px) saturate(170%);
25128
+ -webkit-backdrop-filter: blur(22px) saturate(170%);
25129
+ }
25130
+
25131
+ .blinq-input::placeholder {
25132
+ color: var(--blinq-text-muted);
25133
+ }
25134
+
25135
+ .blinq-recording-input {
25136
+ display: flex;
25137
+ align-items: center;
25138
+ gap: 12px;
25139
+ }
25140
+
25141
+ .blinq-recording-time {
25142
+ flex: none;
25143
+ min-width: 42px;
25144
+ font-size: 12px;
25145
+ font-weight: 600;
25146
+ letter-spacing: 0.04em;
24554
25147
  color: var(--blinq-text-soft);
25148
+ font-variant-numeric: tabular-nums;
24555
25149
  }
24556
25150
 
24557
- .blinq-empty-card {
24558
- min-height: 180px;
24559
- justify-content: center;
25151
+ .blinq-recording-wave-shell {
25152
+ position: relative;
25153
+ display: flex;
25154
+ align-items: center;
25155
+ flex: 1 1 auto;
25156
+ min-width: 0;
25157
+ height: 30px;
25158
+ padding: 0 10px;
25159
+ border-radius: 999px;
25160
+ border: 1px solid rgba(255, 255, 255, 0.54);
25161
+ background:
25162
+ linear-gradient(180deg, rgba(255, 255, 255, 0.54), rgba(242, 245, 248, 0.34));
25163
+ box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.84);
25164
+ overflow: hidden;
24560
25165
  }
24561
25166
 
24562
- .blinq-badge-pill {
25167
+ .blinq-recording-wave-shell::before {
25168
+ content: "";
25169
+ position: absolute;
25170
+ left: 10px;
25171
+ right: 10px;
25172
+ top: 50%;
25173
+ height: 1px;
25174
+ border-radius: 999px;
25175
+ background: linear-gradient(90deg, transparent, rgba(17, 17, 17, 0.12), transparent);
25176
+ transform: translateY(-50%);
25177
+ pointer-events: none;
25178
+ }
25179
+
25180
+ .blinq-recording-waveform {
25181
+ position: relative;
25182
+ display: flex;
25183
+ align-items: center;
25184
+ gap: 4px;
25185
+ flex: 1;
25186
+ min-width: 0;
25187
+ height: 100%;
25188
+ overflow: hidden;
25189
+ }
25190
+
25191
+ .blinq-recording-waveform-bar {
25192
+ width: 4px;
25193
+ min-width: 4px;
25194
+ height: 62%;
25195
+ border-radius: 999px;
25196
+ background: linear-gradient(180deg, rgba(17, 17, 17, 0.14), rgba(17, 17, 17, 0.36));
25197
+ transform-origin: center;
25198
+ transition:
25199
+ transform 120ms ease,
25200
+ opacity 160ms ease;
25201
+ opacity: 0.92;
25202
+ box-shadow:
25203
+ 0 0 0 1px rgba(255, 255, 255, 0.26),
25204
+ 0 2px 8px rgba(17, 17, 17, 0.08);
25205
+ }
25206
+
25207
+ .blinq-button {
24563
25208
  display: inline-flex;
24564
25209
  align-items: center;
24565
25210
  justify-content: center;
24566
- min-height: 28px;
24567
- padding: 0 10px;
25211
+ gap: 8px;
25212
+ border: 1px solid transparent;
24568
25213
  border-radius: 999px;
24569
- font-size: 11px;
24570
- font-weight: 700;
24571
- letter-spacing: 0.06em;
24572
- text-transform: uppercase;
25214
+ color: var(--blinq-text);
25215
+ font-size: 14px;
25216
+ font-weight: 600;
25217
+ background: linear-gradient(180deg, rgba(255, 255, 255, 0.72), rgba(236, 239, 244, 0.5));
25218
+ box-shadow: var(--blinq-shadow-soft);
25219
+ backdrop-filter: blur(20px) saturate(170%);
25220
+ -webkit-backdrop-filter: blur(20px) saturate(170%);
25221
+ transition:
25222
+ transform 160ms ease,
25223
+ box-shadow 180ms ease,
25224
+ border-color 180ms ease,
25225
+ background 180ms ease,
25226
+ opacity 120ms ease;
25227
+ cursor: pointer;
25228
+ outline: none;
24573
25229
  }
24574
25230
 
24575
- .blinq-badge-pill-default {
24576
- background: rgba(15, 23, 42, 0.05);
25231
+ .blinq-button:hover:not(:disabled) {
25232
+ transform: translateY(-1px);
25233
+ border-color: rgba(255, 255, 255, 0.82);
25234
+ box-shadow:
25235
+ 0 14px 28px rgba(175, 181, 191, 0.22),
25236
+ 0 4px 10px rgba(189, 195, 204, 0.16);
25237
+ }
25238
+
25239
+ .blinq-input-mic:hover:not(:disabled),
25240
+ .blinq-input-send:hover:not(:disabled) {
25241
+ transform: translateY(-50%);
25242
+ border-color: rgba(255, 255, 255, 0.82);
25243
+ box-shadow:
25244
+ 0 14px 28px rgba(175, 181, 191, 0.16),
25245
+ 0 4px 10px rgba(189, 195, 204, 0.12);
25246
+ }
25247
+
25248
+ .blinq-button:disabled {
25249
+ opacity: 0.52;
25250
+ cursor: not-allowed;
25251
+ }
25252
+
25253
+ .blinq-button:focus-visible,
25254
+ .blinq-input:focus-visible {
25255
+ box-shadow:
25256
+ 0 0 0 3px rgba(255, 255, 255, 0.68),
25257
+ 0 0 0 6px rgba(17, 17, 17, 0.08);
25258
+ }
25259
+
25260
+ .blinq-button-default {
25261
+ border-color: rgba(255, 255, 255, 0.74);
25262
+ background: linear-gradient(180deg, rgba(255, 255, 255, 0.84), rgba(237, 241, 247, 0.66));
25263
+ color: var(--blinq-text);
25264
+ }
25265
+
25266
+ .blinq-button-outline,
25267
+ .blinq-button-ghost {
25268
+ border-color: rgba(255, 255, 255, 0.58);
25269
+ background: rgba(255, 255, 255, 0.42);
24577
25270
  color: var(--blinq-text-soft);
24578
25271
  }
24579
25272
 
24580
- .blinq-badge-pill-outline {
24581
- border: 1px solid var(--blinq-border);
24582
- color: var(--blinq-text-muted);
24583
- background: rgba(255,255,255,0.84);
25273
+ .blinq-button-destructive {
25274
+ border-color: rgba(255, 255, 255, 0.58);
25275
+ background: linear-gradient(180deg, rgba(248, 249, 251, 0.7), rgba(230, 233, 239, 0.54));
25276
+ color: var(--blinq-text);
24584
25277
  }
24585
25278
 
24586
- .blinq-badge-pill-soft {
24587
- background: #f5f5f5;
24588
- color: #111111;
25279
+ .blinq-button-md {
25280
+ height: 44px;
25281
+ padding: 0 16px;
24589
25282
  }
24590
25283
 
24591
- .blinq-badge-pill-accent {
24592
- background: #111111;
24593
- color: #ffffff;
25284
+ .blinq-button-sm {
25285
+ height: 38px;
25286
+ padding: 0 13px;
25287
+ font-size: 13px;
24594
25288
  }
24595
25289
 
24596
- .blinq-composer {
25290
+ .blinq-button-icon {
25291
+ width: 48px;
25292
+ height: 48px;
25293
+ padding: 0;
25294
+ }
25295
+
25296
+ .blinq-button-icon-sm {
25297
+ width: 38px;
25298
+ height: 38px;
25299
+ padding: 0;
25300
+ }
25301
+
25302
+ .blinq-input-mic,
25303
+ .blinq-input-send {
25304
+ position: absolute;
25305
+ top: 50%;
25306
+ z-index: 2;
25307
+ width: 42px;
25308
+ height: 42px;
25309
+ min-width: 42px;
25310
+ transform: translateY(-50%);
25311
+ }
25312
+
25313
+ .blinq-input-mic {
25314
+ left: 8px;
25315
+ }
25316
+
25317
+ .blinq-input-send {
25318
+ right: 8px;
25319
+ }
25320
+
25321
+ .blinq-panel {
24597
25322
  display: flex;
24598
25323
  flex-direction: column;
24599
- gap: 10px;
24600
- padding: 0 16px 16px;
24601
- border-top: 1px solid var(--blinq-border);
25324
+ height: min(720px, calc(100vh - 64px));
25325
+ max-width: 520px;
25326
+ border: 1px solid rgba(226, 232, 240, 0.96);
25327
+ border-radius: 30px;
24602
25328
  background: #ffffff;
25329
+ box-shadow:
25330
+ 0 28px 80px rgba(15, 23, 42, 0.14),
25331
+ 0 10px 28px rgba(15, 23, 42, 0.08);
25332
+ backdrop-filter: none;
25333
+ -webkit-backdrop-filter: none;
25334
+ }
25335
+
25336
+ .blinq-panel::before,
25337
+ .blinq-panel::after,
25338
+ .blinq-message::before,
25339
+ .blinq-status-line::before {
25340
+ display: none;
25341
+ }
25342
+
25343
+ .blinq-header {
25344
+ flex: none;
25345
+ gap: 0;
25346
+ padding: 22px 24px 18px;
25347
+ border-bottom: 1px solid rgba(226, 232, 240, 0.86);
25348
+ background: #ffffff;
25349
+ }
25350
+
25351
+ .blinq-header-row {
25352
+ align-items: center;
25353
+ gap: 14px;
24603
25354
  }
24604
25355
 
24605
- .blinq-composer-copy {
24606
- display: flex;
24607
- flex-direction: column;
24608
- gap: 4px;
25356
+ .blinq-header-copy {
25357
+ gap: 5px;
24609
25358
  }
24610
25359
 
24611
- .blinq-composer-title {
24612
- font-size: 12px;
25360
+ .blinq-heading {
25361
+ font-size: 22px;
25362
+ line-height: 1.05;
24613
25363
  font-weight: 700;
24614
- letter-spacing: 0.08em;
24615
- text-transform: uppercase;
24616
- color: var(--blinq-text-muted);
25364
+ letter-spacing: -0.04em;
25365
+ color: #111827;
24617
25366
  }
24618
25367
 
24619
- .blinq-composer-hint {
25368
+ .blinq-status-line {
25369
+ display: block;
25370
+ max-width: 100%;
25371
+ min-height: 0;
25372
+ padding: 0;
25373
+ border: 0;
25374
+ background: transparent;
25375
+ box-shadow: none;
25376
+ color: #6b7280;
24620
25377
  font-size: 13px;
24621
- line-height: 1.45;
24622
- color: var(--blinq-text-muted);
24623
- }
24624
-
24625
- .blinq-composer-controls {
24626
- display: flex;
24627
- padding-top: 14px;
25378
+ line-height: 1.35;
25379
+ backdrop-filter: none;
25380
+ -webkit-backdrop-filter: none;
24628
25381
  }
24629
25382
 
24630
- .blinq-button {
25383
+ .blinq-avatar {
25384
+ position: relative;
24631
25385
  display: inline-flex;
24632
25386
  align-items: center;
24633
25387
  justify-content: center;
24634
- gap: 8px;
24635
- border-radius: 14px;
24636
- border: 1px solid transparent;
24637
- font-size: 14px;
24638
- font-weight: 600;
24639
- transition:
24640
- background 120ms ease,
24641
- border-color 120ms ease,
24642
- color 120ms ease,
24643
- opacity 120ms ease,
24644
- transform 120ms ease;
24645
- cursor: pointer;
24646
- outline: none;
25388
+ width: 64px;
25389
+ min-width: 64px;
25390
+ height: 64px;
25391
+ overflow: visible;
25392
+ border: 1px solid rgba(226, 232, 240, 0.95);
25393
+ border-radius: 999px;
25394
+ background:
25395
+ radial-gradient(circle at 30% 20%, rgba(255, 255, 255, 0.98), rgba(248, 250, 252, 0.86)),
25396
+ #ffffff;
25397
+ box-shadow:
25398
+ 0 14px 26px rgba(15, 23, 42, 0.08),
25399
+ inset 0 1px 0 rgba(255, 255, 255, 0.9);
25400
+ color: #111827;
25401
+ flex: none;
24647
25402
  }
24648
25403
 
24649
- .blinq-button:disabled {
24650
- opacity: 0.55;
24651
- cursor: not-allowed;
25404
+ .blinq-avatar-image {
25405
+ width: 100%;
25406
+ height: 100%;
25407
+ border-radius: inherit;
25408
+ object-fit: cover;
24652
25409
  }
24653
25410
 
24654
- .blinq-button:focus-visible,
24655
- .blinq-input:focus-visible,
24656
- .blinq-tab-trigger:focus-visible,
24657
- .blinq-prompt-chip:focus-visible {
24658
- box-shadow: 0 0 0 3px rgba(17, 17, 17, 0.12);
24659
- outline: none;
25411
+ .blinq-avatar-icon {
25412
+ color: #111827;
24660
25413
  }
24661
25414
 
24662
- .blinq-button-default {
24663
- background: #111111;
24664
- color: white;
24665
- box-shadow: 0 12px 24px rgba(17, 17, 17, 0.16);
25415
+ .blinq-avatar-status {
25416
+ position: absolute;
25417
+ right: 5px;
25418
+ bottom: 6px;
25419
+ width: 11px;
25420
+ height: 11px;
25421
+ border: 2px solid #ffffff;
25422
+ border-radius: 999px;
25423
+ background: #21d262;
25424
+ box-shadow: 0 0 0 1px rgba(15, 23, 42, 0.04);
24666
25425
  }
24667
25426
 
24668
- .blinq-button-default:hover:not(:disabled) {
24669
- filter: brightness(1.04);
25427
+ .blinq-avatar-label {
25428
+ display: none;
24670
25429
  }
24671
25430
 
24672
- .blinq-button-outline {
24673
- border-color: var(--blinq-border-strong);
25431
+ .blinq-thread {
25432
+ display: flex;
25433
+ flex: 1 1 auto;
25434
+ min-height: 0;
24674
25435
  background: #ffffff;
24675
- color: var(--blinq-text);
24676
- }
24677
-
24678
- .blinq-button-outline:hover:not(:disabled),
24679
- .blinq-button-ghost:hover:not(:disabled) {
24680
- background: var(--blinq-surface-soft);
24681
- }
24682
-
24683
- .blinq-button-ghost {
24684
- border-color: var(--blinq-border);
24685
- background: rgba(255,255,255,0.76);
24686
- color: var(--blinq-text-soft);
24687
25436
  }
24688
25437
 
24689
- .blinq-button-destructive {
24690
- background: #111111;
24691
- border-color: #111111;
24692
- color: #ffffff;
25438
+ .blinq-thread-viewport {
25439
+ flex: 1 1 auto;
25440
+ height: 100%;
24693
25441
  }
24694
25442
 
24695
- .blinq-button-md {
24696
- height: 44px;
24697
- padding: 0 16px;
25443
+ .blinq-scroll {
25444
+ flex: 1 1 auto;
25445
+ gap: 12px;
25446
+ max-height: none;
25447
+ min-height: 0;
25448
+ padding: 30px 24px 20px;
25449
+ background: #ffffff;
24698
25450
  }
24699
25451
 
24700
- .blinq-button-sm {
24701
- height: 36px;
24702
- padding: 0 12px;
24703
- font-size: 13px;
25452
+ .blinq-message {
25453
+ max-width: 82%;
25454
+ padding: 10px 15px;
25455
+ border: 1px solid rgba(226, 232, 240, 0.96);
25456
+ border-radius: 18px;
25457
+ background: #ffffff;
25458
+ box-shadow: none;
25459
+ color: #111827;
25460
+ font-size: 15px;
25461
+ line-height: 1.48;
25462
+ backdrop-filter: none;
25463
+ -webkit-backdrop-filter: none;
24704
25464
  }
24705
25465
 
24706
- .blinq-button-icon {
24707
- width: 44px;
24708
- height: 44px;
24709
- padding: 0;
25466
+ .blinq-message[data-role="assistant"] {
25467
+ background: #ffffff;
24710
25468
  }
24711
25469
 
24712
- .blinq-button-icon-sm {
24713
- width: 36px;
24714
- height: 36px;
24715
- padding: 0;
24716
- border-radius: 12px;
25470
+ .blinq-message[data-role="user"] {
25471
+ border-color: rgba(209, 213, 219, 0.96);
25472
+ background: #f8fafc;
24717
25473
  }
24718
25474
 
24719
- .blinq-input {
24720
- width: 100%;
24721
- min-width: 0;
24722
- height: 52px;
24723
- border-radius: 18px;
24724
- border: 1px solid var(--blinq-border-strong);
24725
- padding: 0 48px 0 44px;
25475
+ .blinq-card,
25476
+ .blinq-guide-step-shell,
25477
+ .blinq-plan-step {
25478
+ border-color: rgba(226, 232, 240, 0.92);
24726
25479
  background: #ffffff;
24727
- color: var(--blinq-text);
24728
- outline: none;
24729
- box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
25480
+ box-shadow: none;
25481
+ backdrop-filter: none;
25482
+ -webkit-backdrop-filter: none;
24730
25483
  }
24731
25484
 
24732
- .blinq-input-shell {
24733
- position: relative;
24734
- width: 100%;
25485
+ .blinq-composer {
25486
+ flex: none;
25487
+ padding: 18px 24px 8px;
25488
+ border-top: 1px solid rgba(226, 232, 240, 0.86);
25489
+ background: #ffffff;
24735
25490
  }
24736
25491
 
25492
+ .blinq-input,
24737
25493
  .blinq-recording-input {
24738
- display: flex;
24739
- align-items: center;
24740
- gap: 12px;
24741
- width: 100%;
24742
- min-width: 0;
24743
- height: 52px;
24744
- padding: 0 48px 0 44px;
24745
- border-radius: 18px;
24746
- border: 1px solid var(--blinq-border-strong);
25494
+ height: 56px;
25495
+ padding: 0 60px 0 54px;
25496
+ border: 1px solid rgba(209, 213, 219, 0.92);
25497
+ border-radius: 999px;
24747
25498
  background: #ffffff;
24748
- color: var(--blinq-text);
24749
- box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
24750
- }
24751
-
24752
- .blinq-recording-time {
24753
- flex: 0 0 auto;
24754
- min-width: 42px;
24755
- font-size: 12px;
24756
- font-weight: 700;
24757
- letter-spacing: 0.04em;
24758
- color: var(--blinq-text-soft);
24759
- font-variant-numeric: tabular-nums;
24760
- }
24761
-
24762
- .blinq-recording-waveform {
24763
- display: flex;
24764
- align-items: flex-end;
24765
- gap: 3px;
24766
- flex: 1 1 auto;
24767
- min-width: 0;
24768
- height: 24px;
24769
- overflow: hidden;
25499
+ box-shadow: none;
25500
+ color: #111827;
25501
+ font-size: 15px;
25502
+ backdrop-filter: none;
25503
+ -webkit-backdrop-filter: none;
24770
25504
  }
24771
25505
 
24772
- .blinq-recording-waveform-bar {
24773
- width: 3px;
24774
- min-width: 3px;
24775
- height: 100%;
24776
- border-radius: 999px;
24777
- background: rgba(17, 17, 17, 0.22);
24778
- transform-origin: center bottom;
24779
- transition:
24780
- transform 110ms ease,
24781
- background 110ms ease;
25506
+ .blinq-input::placeholder {
25507
+ color: #9ca3af;
24782
25508
  }
24783
25509
 
24784
25510
  .blinq-input-mic {
24785
- position: absolute;
24786
- left: 8px;
24787
- top: 50%;
24788
- transform: translateY(-50%);
24789
- z-index: 2;
25511
+ left: 7px;
25512
+ width: 42px;
25513
+ min-width: 42px;
25514
+ height: 42px;
25515
+ border: 0;
25516
+ background: transparent;
25517
+ box-shadow: none;
25518
+ color: #6b7280;
24790
25519
  }
24791
25520
 
24792
25521
  .blinq-input-send {
24793
- position: absolute;
24794
- right: 8px;
24795
- top: 50%;
25522
+ right: 7px;
25523
+ width: 42px;
25524
+ min-width: 42px;
25525
+ height: 42px;
25526
+ border: 0;
25527
+ background: #6b6f76;
25528
+ box-shadow: none;
25529
+ color: #ffffff;
25530
+ }
25531
+
25532
+ .blinq-input-send:hover:not(:disabled) {
24796
25533
  transform: translateY(-50%);
24797
- z-index: 2;
24798
- width: 36px;
24799
- height: 36px;
24800
- min-width: 36px;
24801
- border-radius: 12px;
25534
+ background: #4b5563;
25535
+ box-shadow: none;
24802
25536
  }
24803
25537
 
24804
- .blinq-text-animate {
24805
- display: block;
25538
+ .blinq-button-ghost {
25539
+ border-color: transparent;
25540
+ background: transparent;
25541
+ box-shadow: none;
24806
25542
  }
24807
25543
 
24808
- .blinq-text-animate-blur-in .blinq-text-segment {
24809
- display: inline-block;
24810
- opacity: 0;
24811
- filter: blur(8px);
24812
- animation: blinq-blur-in 420ms cubic-bezier(0.16, 1, 0.3, 1) forwards;
25544
+ .blinq-powered {
25545
+ flex: none;
25546
+ padding: 0 24px 18px;
25547
+ color: #c0c4ca;
25548
+ font-size: 10px;
25549
+ font-weight: 800;
25550
+ letter-spacing: 0.16em;
25551
+ line-height: 1;
25552
+ text-align: center;
24813
25553
  }
24814
25554
 
24815
25555
  @keyframes blinq-thinking-pulse {
@@ -24820,65 +25560,59 @@ ${config.system}`;
24820
25560
 
24821
25561
  50% {
24822
25562
  opacity: 1;
24823
- transform: translateY(-2px);
25563
+ transform: translateY(-1.5px);
24824
25564
  }
24825
25565
  }
24826
25566
 
24827
- @keyframes blinq-agent-spin {
24828
- from {
24829
- transform: rotate(0deg);
25567
+ @keyframes blinq-copy-reveal {
25568
+ 0% {
25569
+ opacity: 0;
25570
+ transform: translateY(3px);
24830
25571
  }
24831
25572
 
24832
- to {
24833
- transform: rotate(360deg);
25573
+ 100% {
25574
+ opacity: 1;
25575
+ transform: translateY(0);
24834
25576
  }
24835
25577
  }
24836
25578
 
24837
- @keyframes blinq-agent-bob {
24838
- 0%, 100% {
24839
- transform: translateY(0);
25579
+ @keyframes blinq-orbit-drift {
25580
+ from {
25581
+ transform: rotate(0deg);
24840
25582
  }
24841
25583
 
24842
- 50% {
24843
- transform: translateY(-0.8px);
25584
+ to {
25585
+ transform: rotate(360deg);
24844
25586
  }
24845
25587
  }
24846
25588
 
24847
- @keyframes blinq-agent-spark {
25589
+ @keyframes blinq-orbit-pulse {
24848
25590
  0%, 100% {
24849
25591
  transform: scale(1);
24850
- opacity: 0.72;
25592
+ opacity: 0.9;
24851
25593
  }
24852
25594
 
24853
25595
  50% {
24854
- transform: scale(1.25);
25596
+ transform: scale(1.16);
24855
25597
  opacity: 1;
24856
25598
  }
24857
25599
  }
24858
25600
 
24859
- @keyframes blinq-blur-in {
24860
- 0% {
24861
- opacity: 0;
24862
- filter: blur(8px);
24863
- transform: translateY(4px);
25601
+ @keyframes blinq-core-breathe {
25602
+ 0%, 100% {
25603
+ transform: scale(1);
24864
25604
  }
24865
25605
 
24866
- 100% {
24867
- opacity: 1;
24868
- filter: blur(0);
24869
- transform: translateY(0);
25606
+ 50% {
25607
+ transform: scale(1.04);
24870
25608
  }
24871
25609
  }
24872
25610
 
24873
- .blinq-input::placeholder {
24874
- color: var(--blinq-text-muted);
24875
- }
24876
-
24877
25611
  @media (max-width: 720px) {
24878
25612
  .blinq-shell {
24879
- bottom: 12px;
24880
- left: 12px;
24881
25613
  right: 12px;
25614
+ left: 12px;
25615
+ bottom: 12px;
24882
25616
  width: auto;
24883
25617
  max-width: none;
24884
25618
  align-items: stretch;
@@ -24886,43 +25620,212 @@ ${config.system}`;
24886
25620
 
24887
25621
  .blinq-shell[data-side="left"],
24888
25622
  .blinq-shell[data-side="right"] {
24889
- left: 12px;
24890
25623
  right: 12px;
25624
+ left: 12px;
24891
25625
  align-items: stretch;
24892
25626
  }
24893
25627
 
24894
25628
  .blinq-panel,
24895
25629
  .blinq-launcher {
24896
- max-width: none;
24897
25630
  width: 100%;
25631
+ max-width: none;
24898
25632
  }
24899
25633
 
24900
- .blinq-workspace {
24901
- grid-template-columns: 1fr;
25634
+ .blinq-launcher {
25635
+ width: 76px;
25636
+ min-width: 76px;
25637
+ height: 76px;
25638
+ align-self: flex-end;
24902
25639
  }
24903
25640
 
24904
- .blinq-sidebar {
24905
- border-right: none;
24906
- border-bottom: 1px solid var(--blinq-border);
25641
+ .blinq-message {
25642
+ max-width: 92%;
24907
25643
  }
24908
25644
 
24909
- .blinq-sidebar-group {
24910
- flex-direction: row;
24911
- overflow-x: auto;
25645
+ .blinq-actions {
25646
+ flex-direction: column;
24912
25647
  }
24913
25648
 
24914
- .blinq-tab-trigger {
24915
- min-width: 116px;
25649
+ .blinq-input,
25650
+ .blinq-recording-input {
25651
+ height: 56px;
24916
25652
  }
24917
25653
 
24918
- .blinq-context-grid {
24919
- grid-template-columns: 1fr;
25654
+ .blinq-panel {
25655
+ height: min(700px, calc(100vh - 24px));
24920
25656
  }
24921
25657
  }
24922
25658
  `;
24923
25659
 
24924
25660
  // src/browser.ts
24925
25661
  var EMBED_TAG_NAME = "blinq-widget";
25662
+ var TRAINER_PARAM = "blinqTrainer";
25663
+ function isTrainerMode() {
25664
+ if (typeof window === "undefined") {
25665
+ return false;
25666
+ }
25667
+ return new URLSearchParams(window.location.search).get(TRAINER_PARAM) === "1";
25668
+ }
25669
+ function trainerParentOrigin() {
25670
+ if (typeof window === "undefined") {
25671
+ return "*";
25672
+ }
25673
+ if (!document.referrer) {
25674
+ return window.location.origin;
25675
+ }
25676
+ try {
25677
+ return new URL(document.referrer).origin;
25678
+ } catch {
25679
+ return window.location.origin;
25680
+ }
25681
+ }
25682
+ function isLikelyAuthRoute(pathname) {
25683
+ const normalized = pathname.toLowerCase();
25684
+ return normalized.includes("/login") || normalized.includes("/signin") || normalized.includes("/sign-in") || normalized.includes("/signup") || normalized.includes("/sign-up") || normalized.includes("/auth");
25685
+ }
25686
+ function postTrainerEvent(eventType, payload) {
25687
+ if (typeof window === "undefined" || window.parent === window) {
25688
+ return;
25689
+ }
25690
+ window.parent.postMessage(
25691
+ {
25692
+ source: "blinq-trainer",
25693
+ kind: "event",
25694
+ event_type: eventType,
25695
+ payload
25696
+ },
25697
+ trainerParentOrigin()
25698
+ );
25699
+ }
25700
+ function defineGenericTrainerBridge() {
25701
+ if (typeof window === "undefined" || window.parent === window || !isTrainerMode() || window.__blinqTrainerBridgeInstalled) {
25702
+ return;
25703
+ }
25704
+ window.__blinqTrainerBridgeInstalled = true;
25705
+ let cancelled = false;
25706
+ const registry = new PageToolRegistry(async () => false);
25707
+ registry.setActionPolicy({
25708
+ actions_enabled: true,
25709
+ action_mode: "execute_with_confirmation",
25710
+ pointer_overlay_enabled: true
25711
+ });
25712
+ let nativeRegistered = false;
25713
+ const parentOrigin = trainerParentOrigin();
25714
+ const sendReady = async () => {
25715
+ nativeRegistered = await registry.registerNativeTools().catch(() => false);
25716
+ postTrainerEvent("runner_ready", {
25717
+ url: window.location.href,
25718
+ secure_context: window.isSecureContext,
25719
+ native_webmcp_supported: detectNativeWebMcpSupport(),
25720
+ native_webmcp_registered: nativeRegistered,
25721
+ runtime_mode: nativeRegistered ? "native-webmcp-active" : "read-only-fallback"
25722
+ });
25723
+ };
25724
+ const handleCommand = (event) => {
25725
+ if (event.origin !== parentOrigin) {
25726
+ return;
25727
+ }
25728
+ const data = event.data;
25729
+ if (data?.source !== "blinq-suggestions" || data?.type !== "command" || !data.name) {
25730
+ return;
25731
+ }
25732
+ if (data.name === "collect_context") {
25733
+ postTrainerEvent("page_context", {
25734
+ url: window.location.href,
25735
+ authenticated: !isLikelyAuthRoute(window.location.pathname),
25736
+ secure_context: window.isSecureContext,
25737
+ native_webmcp_supported: detectNativeWebMcpSupport(),
25738
+ native_webmcp_registered: nativeRegistered,
25739
+ page_context: collectNormalizedPageContext()
25740
+ });
25741
+ return;
25742
+ }
25743
+ if (data.name === "execute_tool") {
25744
+ const toolName = typeof data.payload?.tool_name === "string" ? data.payload.tool_name : "";
25745
+ const displayName = typeof data.payload?.display_name === "string" ? data.payload.display_name : void 0;
25746
+ const targetSummary = typeof data.payload?.target_summary === "string" ? data.payload.target_summary : void 0;
25747
+ const requiresConfirmation = Boolean(data.payload?.requires_confirmation);
25748
+ const argumentsPayload = data.payload?.arguments && typeof data.payload.arguments === "object" && !Array.isArray(data.payload.arguments) ? data.payload.arguments : {};
25749
+ if (!toolName) {
25750
+ postTrainerEvent("tool_result", {
25751
+ status: "error",
25752
+ error: "\u041D\u0435 \u043F\u0435\u0440\u0435\u0434\u0430\u043D tool_name \u0434\u043B\u044F \u0442\u0440\u0435\u043D\u0438\u0440\u043E\u0432\u043A\u0438.",
25753
+ current_url: window.location.href
25754
+ });
25755
+ return;
25756
+ }
25757
+ void (async () => {
25758
+ const outcome = await registry.executeTool({
25759
+ tool_name: toolName,
25760
+ display_name: displayName,
25761
+ target_summary: targetSummary,
25762
+ requires_confirmation: requiresConfirmation,
25763
+ arguments: argumentsPayload
25764
+ });
25765
+ const result = outcome.status === "success" && outcome.result && typeof outcome.result === "object" ? outcome.result : null;
25766
+ postTrainerEvent("tool_result", {
25767
+ status: outcome.status,
25768
+ result,
25769
+ error: outcome.error,
25770
+ current_url: window.location.href,
25771
+ page_context: result && typeof result === "object" && result.deferred_navigation ? null : collectNormalizedPageContext()
25772
+ });
25773
+ if (outcome.status === "success" && result && typeof result === "object" && result.deferred_navigation && typeof result.href === "string" && result.href.trim()) {
25774
+ window.setTimeout(() => {
25775
+ window.location.href = result.href;
25776
+ }, 40);
25777
+ }
25778
+ })();
25779
+ return;
25780
+ }
25781
+ if (data.name !== "preview_targets") {
25782
+ return;
25783
+ }
25784
+ const rawTargets = Array.isArray(data.payload?.targets) ? data.payload.targets : [];
25785
+ const targets = [];
25786
+ for (const target of rawTargets) {
25787
+ if (!target || typeof target !== "object") {
25788
+ continue;
25789
+ }
25790
+ const selector = typeof target.selector === "string" ? target.selector.trim() : "";
25791
+ const label = typeof target.label === "string" ? target.label.trim() : void 0;
25792
+ if (!selector) {
25793
+ continue;
25794
+ }
25795
+ targets.push({ selector, label: label || void 0 });
25796
+ }
25797
+ void (async () => {
25798
+ for (const target of targets) {
25799
+ if (cancelled) {
25800
+ return;
25801
+ }
25802
+ registry.highlightTargets([target], {
25803
+ interaction: "explain",
25804
+ durationMs: 1500
25805
+ });
25806
+ await new Promise((resolve) => window.setTimeout(resolve, 1120));
25807
+ }
25808
+ if (cancelled) {
25809
+ return;
25810
+ }
25811
+ postTrainerEvent("preview_complete", {
25812
+ url: window.location.href
25813
+ });
25814
+ })();
25815
+ };
25816
+ sendReady();
25817
+ window.setTimeout(() => void sendReady(), 180);
25818
+ window.setTimeout(() => void sendReady(), 560);
25819
+ window.addEventListener("message", handleCommand);
25820
+ window.addEventListener(
25821
+ "beforeunload",
25822
+ () => {
25823
+ cancelled = true;
25824
+ registry.destroy();
25825
+ },
25826
+ { once: true }
25827
+ );
25828
+ }
24926
25829
  function shadowRootStyles() {
24927
25830
  return EMBED_WIDGET_STYLES;
24928
25831
  }
@@ -24934,6 +25837,10 @@ ${config.system}`;
24934
25837
  if (this.widget || this.widgetPromise) {
24935
25838
  return;
24936
25839
  }
25840
+ if (isTrainerMode()) {
25841
+ this.style.display = "none";
25842
+ return;
25843
+ }
24937
25844
  const publicToken = this.getAttribute("public-token")?.trim();
24938
25845
  if (!publicToken) {
24939
25846
  console.error("Blinq widget: missing required public-token attribute.");
@@ -24981,6 +25888,7 @@ ${config.system}`;
24981
25888
  }
24982
25889
  if (typeof window !== "undefined") {
24983
25890
  defineBlinqWidgetElement();
25891
+ defineGenericTrainerBridge();
24984
25892
  window.BlinqWidget = {
24985
25893
  init,
24986
25894
  initFromConfig
@@ -25044,5 +25952,23 @@ react/cjs/react-jsx-runtime.production.js:
25044
25952
  * This source code is licensed under the MIT license found in the
25045
25953
  * LICENSE file in the root directory of this source tree.
25046
25954
  *)
25955
+
25956
+ lucide-react/dist/esm/shared/src/utils/mergeClasses.js:
25957
+ lucide-react/dist/esm/shared/src/utils/toKebabCase.js:
25958
+ lucide-react/dist/esm/shared/src/utils/toCamelCase.js:
25959
+ lucide-react/dist/esm/shared/src/utils/toPascalCase.js:
25960
+ lucide-react/dist/esm/defaultAttributes.js:
25961
+ lucide-react/dist/esm/shared/src/utils/hasA11yProp.js:
25962
+ lucide-react/dist/esm/context.js:
25963
+ lucide-react/dist/esm/Icon.js:
25964
+ lucide-react/dist/esm/createLucideIcon.js:
25965
+ lucide-react/dist/esm/icons/bot.js:
25966
+ lucide-react/dist/esm/lucide-react.js:
25967
+ (**
25968
+ * @license lucide-react v1.8.0 - ISC
25969
+ *
25970
+ * This source code is licensed under the ISC license.
25971
+ * See the LICENSE file in the root directory of this source tree.
25972
+ *)
25047
25973
  */
25048
25974
  //# sourceMappingURL=blinq-widget.iife.global.js.map