@vite-plugin-opencode-assistant/components 1.0.15 → 1.0.17

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.
@@ -33,38 +33,22 @@ var __spreadValues$1 = (a, b) => {
33
33
  }
34
34
  return a;
35
35
  };
36
- var __vue_sfc__$7 = /* @__PURE__ */ (0, vue.defineComponent)({
36
+ var __vue_sfc__$6 = /* @__PURE__ */ (0, vue.defineComponent)({
37
37
  __name: "Frame",
38
38
  setup(__props, { expose: __expose }) {
39
- __expose();
40
39
  const iframeRef = (0, vue.ref)(null);
41
- const { frameLoading, showEmptyState, showError, iframeSource: iframeSrc, emptyStateText, emptyStateActionText, handleEmptyAction, handleFrameLoaded, theme, resolvedTheme } = useOpenCodeWidgetContext();
42
- const iframeReady = (0, vue.ref)(false);
40
+ const { frameLoading, showEmptyState, showError, iframeSource: iframeSrc, emptyStateText, emptyStateActionText, handleEmptyAction, handleFrameLoaded } = useOpenCodeWidgetContext();
43
41
  function sendMessageToIframe(type, data) {
44
42
  var _a;
45
43
  if (!((_a = iframeRef.value) == null ? void 0 : _a.contentWindow)) return;
46
44
  iframeRef.value.contentWindow.postMessage(__spreadValues$1({ type }, data), "*");
47
45
  }
48
- function syncIframeTheme() {
49
- sendMessageToIframe("OPENCODE_SET_THEME", { theme: resolvedTheme.value });
50
- }
51
- function handleIframeMessage(event) {
52
- var _a;
53
- if (((_a = event.data) == null ? void 0 : _a.type) === "OPENCODE_READY") syncIframeTheme();
54
- }
55
- (0, vue.watch)([theme, resolvedTheme], () => {
56
- syncIframeTheme();
57
- });
58
46
  (0, vue.onMounted)(() => {
59
47
  if (iframeRef.value) iframeRef.value.addEventListener("load", () => {
60
- iframeReady.value = true;
61
48
  handleFrameLoaded();
62
49
  });
63
- window.addEventListener("message", handleIframeMessage);
64
- });
65
- (0, vue.onUnmounted)(() => {
66
- window.removeEventListener("message", handleIframeMessage);
67
50
  });
51
+ __expose({ sendMessageToIframe });
68
52
  const __returned__ = {
69
53
  iframeRef,
70
54
  frameLoading,
@@ -75,12 +59,7 @@ var __vue_sfc__$7 = /* @__PURE__ */ (0, vue.defineComponent)({
75
59
  emptyStateActionText,
76
60
  handleEmptyAction,
77
61
  handleFrameLoaded,
78
- theme,
79
- resolvedTheme,
80
- iframeReady,
81
- sendMessageToIframe,
82
- syncIframeTheme,
83
- handleIframeMessage
62
+ sendMessageToIframe
84
63
  };
85
64
  Object.defineProperty(__returned__, "__isScriptSetup", {
86
65
  enumerable: false,
@@ -89,11 +68,11 @@ var __vue_sfc__$7 = /* @__PURE__ */ (0, vue.defineComponent)({
89
68
  return __returned__;
90
69
  }
91
70
  });
92
- var _hoisted_1$7 = { class: "opencode-iframe-container" };
93
- var _hoisted_2$5 = { class: "opencode-empty-state-text" };
94
- var _hoisted_3$5 = ["src"];
95
- function __vue_render__$7(_ctx, _cache, $props, $setup, $data, $options) {
96
- return (0, vue.openBlock)(), (0, vue.createElementBlock)("div", _hoisted_1$7, [
71
+ var _hoisted_1$6 = { class: "opencode-iframe-container" };
72
+ var _hoisted_2$4 = { class: "opencode-empty-state-text" };
73
+ var _hoisted_3$4 = ["src"];
74
+ function __vue_render__$6(_ctx, _cache, $props, $setup, $data, $options) {
75
+ return (0, vue.openBlock)(), (0, vue.createElementBlock)("div", _hoisted_1$6, [
97
76
  (0, vue.createElementVNode)("div", { class: (0, vue.normalizeClass)(["opencode-empty-state-overlay", { visible: $setup.showEmptyState }]) }, [(0, vue.renderSlot)(_ctx.$slots, "empty-state", {}, () => [
98
77
  _cache[1] || (_cache[1] = (0, vue.createElementVNode)("div", { class: "opencode-empty-state-icon" }, [(0, vue.createElementVNode)("svg", {
99
78
  viewBox: "0 0 24 24",
@@ -108,7 +87,7 @@ function __vue_render__$7(_ctx, _cache, $props, $setup, $data, $options) {
108
87
  "stroke-linejoin": "round",
109
88
  d: "M8 12h.01M12 12h.01M16 12h.01M21 12c0 4.418-4.03 8-9 8a9.863 9.863 0 0 1-4.255-.949L3 20l1.395-3.72C3.512 15.042 3 13.574 3 12c0-4.418 4.03-8 9-8s9 3.582 9 8z"
110
89
  })])], -1)),
111
- (0, vue.createElementVNode)("div", _hoisted_2$5, (0, vue.toDisplayString)($setup.emptyStateText), 1),
90
+ (0, vue.createElementVNode)("div", _hoisted_2$4, (0, vue.toDisplayString)($setup.emptyStateText), 1),
112
91
  (0, vue.createElementVNode)("button", {
113
92
  class: "opencode-empty-state-btn",
114
93
  type: "button",
@@ -123,14 +102,14 @@ function __vue_render__$7(_ctx, _cache, $props, $setup, $data, $options) {
123
102
  src: $setup.iframeSrc,
124
103
  allow: "clipboard-write; clipboard-read",
125
104
  referrerpolicy: "origin"
126
- }, null, 8, _hoisted_3$5)])
105
+ }, null, 8, _hoisted_3$4)])
127
106
  ]);
128
107
  }
129
- __vue_sfc__$7.render = __vue_render__$7;
130
- var Frame_vue_default = __vue_sfc__$7;
108
+ __vue_sfc__$6.render = __vue_render__$6;
109
+ var Frame_vue_default = __vue_sfc__$6;
131
110
  //#endregion
132
111
  //#region es/open-code-widget/src/components/Header.vue.js
133
- var __vue_sfc__$6 = /* @__PURE__ */ (0, vue.defineComponent)({
112
+ var __vue_sfc__$5 = /* @__PURE__ */ (0, vue.defineComponent)({
134
113
  __name: "Header",
135
114
  setup(__props, { expose: __expose }) {
136
115
  __expose();
@@ -169,15 +148,15 @@ var __vue_sfc__$6 = /* @__PURE__ */ (0, vue.defineComponent)({
169
148
  return __returned__;
170
149
  }
171
150
  });
172
- var _hoisted_1$6 = { class: "opencode-chat-header" };
173
- var _hoisted_2$4 = { class: "opencode-chat-header-left" };
174
- var _hoisted_3$4 = [
151
+ var _hoisted_1$5 = { class: "opencode-chat-header" };
152
+ var _hoisted_2$3 = { class: "opencode-chat-header-left" };
153
+ var _hoisted_3$3 = [
175
154
  "title",
176
155
  "aria-label",
177
156
  "aria-expanded"
178
157
  ];
179
- var _hoisted_4$4 = ["aria-pressed", "disabled"];
180
- var _hoisted_5$4 = ["title", "aria-label"];
158
+ var _hoisted_4$3 = ["aria-pressed", "disabled"];
159
+ var _hoisted_5$3 = ["title", "aria-label"];
181
160
  var _hoisted_6$3 = {
182
161
  key: 0,
183
162
  viewBox: "0 0 24 24",
@@ -208,11 +187,11 @@ var _hoisted_8$2 = {
208
187
  "stroke-width": "2",
209
188
  "aria-hidden": "true"
210
189
  };
211
- var _hoisted_9$1 = { class: "opencode-chat-header-title" };
190
+ var _hoisted_9$2 = { class: "opencode-chat-header-title" };
212
191
  var _hoisted_10 = { class: "opencode-chat-header-actions" };
213
- function __vue_render__$6(_ctx, _cache, $props, $setup, $data, $options) {
214
- return (0, vue.openBlock)(), (0, vue.createElementBlock)("div", _hoisted_1$6, [
215
- (0, vue.createElementVNode)("div", _hoisted_2$4, [
192
+ function __vue_render__$5(_ctx, _cache, $props, $setup, $data, $options) {
193
+ return (0, vue.openBlock)(), (0, vue.createElementBlock)("div", _hoisted_1$5, [
194
+ (0, vue.createElementVNode)("div", _hoisted_2$3, [
216
195
  (0, vue.createElementVNode)("button", {
217
196
  class: (0, vue.normalizeClass)(["opencode-header-btn session-toggle", { active: !$setup.sessionListCollapsed }]),
218
197
  type: "button",
@@ -231,7 +210,7 @@ function __vue_render__$6(_ctx, _cache, $props, $setup, $data, $options) {
231
210
  }, [(0, vue.createElementVNode)("path", {
232
211
  d: "M4 6h16M4 12h16M4 18h16",
233
212
  "stroke-linecap": "round"
234
- })], -1))])], 10, _hoisted_3$4),
213
+ })], -1))])], 10, _hoisted_3$3),
235
214
  (0, vue.createElementVNode)("button", {
236
215
  class: (0, vue.normalizeClass)(["opencode-header-btn select-btn", { active: $setup.selectMode }]),
237
216
  type: "button",
@@ -251,16 +230,16 @@ function __vue_render__$6(_ctx, _cache, $props, $setup, $data, $options) {
251
230
  }), (0, vue.createElementVNode)("path", {
252
231
  fill: "currentColor",
253
232
  d: "M512 96a32 32 0 0 1 32 32v192a32 32 0 0 1-64 0V128a32 32 0 0 1 32-32m0 576a32 32 0 0 1 32 32v192a32 32 0 1 1-64 0V704a32 32 0 0 1 32-32M96 512a32 32 0 0 1 32-32h192a32 32 0 0 1 0 64H128a32 32 0 0 1-32-32m576 0a32 32 0 0 1 32-32h192a32 32 0 1 1 0 64H704a32 32 0 0 1-32-32"
254
- })], -1))])], 10, _hoisted_4$4),
233
+ })], -1))])], 10, _hoisted_4$3),
255
234
  (0, vue.createElementVNode)("button", {
256
235
  class: "opencode-header-btn theme-btn",
257
236
  type: "button",
258
237
  title: $setup.themeIconTitle,
259
238
  "aria-label": $setup.themeIconLabel,
260
239
  onClick: _cache[2] || (_cache[2] = (...args) => $setup.handleToggleTheme && $setup.handleToggleTheme(...args))
261
- }, [(0, vue.renderSlot)(_ctx.$slots, "theme-icon", {}, () => [$setup.theme === "light" ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("svg", _hoisted_6$3, [..._cache[6] || (_cache[6] = [(0, vue.createStaticVNode)("<circle cx=\"12\" cy=\"12\" r=\"5\"></circle><line x1=\"12\" y1=\"1\" x2=\"12\" y2=\"3\"></line><line x1=\"12\" y1=\"21\" x2=\"12\" y2=\"23\"></line><line x1=\"4.22\" y1=\"4.22\" x2=\"5.64\" y2=\"5.64\"></line><line x1=\"18.36\" y1=\"18.36\" x2=\"19.78\" y2=\"19.78\"></line><line x1=\"1\" y1=\"12\" x2=\"3\" y2=\"12\"></line><line x1=\"21\" y1=\"12\" x2=\"23\" y2=\"12\"></line><line x1=\"4.22\" y1=\"19.78\" x2=\"5.64\" y2=\"18.36\"></line><line x1=\"18.36\" y1=\"5.64\" x2=\"19.78\" y2=\"4.22\"></line>", 9)])])) : $setup.theme === "dark" ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("svg", _hoisted_7$2, [..._cache[7] || (_cache[7] = [(0, vue.createElementVNode)("path", { d: "M21 12.79A9 9 0 1 1 11.21 3 7 7 0 0 0 21 12.79z" }, null, -1)])])) : ((0, vue.openBlock)(), (0, vue.createElementBlock)("svg", _hoisted_8$2, [..._cache[8] || (_cache[8] = [(0, vue.createStaticVNode)("<rect x=\"2\" y=\"3\" width=\"20\" height=\"14\" rx=\"2\" ry=\"2\"></rect><line x1=\"8\" y1=\"21\" x2=\"16\" y2=\"21\"></line><line x1=\"12\" y1=\"17\" x2=\"12\" y2=\"21\"></line><circle cx=\"12\" cy=\"10\" r=\"3\"></circle><path d=\"M7 7l2 2M17 7l-2 2M7 13l2-2M17 13l-2-2\"></path>", 5)])]))])], 8, _hoisted_5$4)
240
+ }, [(0, vue.renderSlot)(_ctx.$slots, "theme-icon", {}, () => [$setup.theme === "light" ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("svg", _hoisted_6$3, [..._cache[6] || (_cache[6] = [(0, vue.createStaticVNode)("<circle cx=\"12\" cy=\"12\" r=\"5\"></circle><line x1=\"12\" y1=\"1\" x2=\"12\" y2=\"3\"></line><line x1=\"12\" y1=\"21\" x2=\"12\" y2=\"23\"></line><line x1=\"4.22\" y1=\"4.22\" x2=\"5.64\" y2=\"5.64\"></line><line x1=\"18.36\" y1=\"18.36\" x2=\"19.78\" y2=\"19.78\"></line><line x1=\"1\" y1=\"12\" x2=\"3\" y2=\"12\"></line><line x1=\"21\" y1=\"12\" x2=\"23\" y2=\"12\"></line><line x1=\"4.22\" y1=\"19.78\" x2=\"5.64\" y2=\"18.36\"></line><line x1=\"18.36\" y1=\"5.64\" x2=\"19.78\" y2=\"4.22\"></line>", 9)])])) : $setup.theme === "dark" ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("svg", _hoisted_7$2, [..._cache[7] || (_cache[7] = [(0, vue.createElementVNode)("path", { d: "M21 12.79A9 9 0 1 1 11.21 3 7 7 0 0 0 21 12.79z" }, null, -1)])])) : ((0, vue.openBlock)(), (0, vue.createElementBlock)("svg", _hoisted_8$2, [..._cache[8] || (_cache[8] = [(0, vue.createStaticVNode)("<rect x=\"2\" y=\"3\" width=\"20\" height=\"14\" rx=\"2\" ry=\"2\"></rect><line x1=\"8\" y1=\"21\" x2=\"16\" y2=\"21\"></line><line x1=\"12\" y1=\"17\" x2=\"12\" y2=\"21\"></line><circle cx=\"12\" cy=\"10\" r=\"3\"></circle><path d=\"M7 7l2 2M17 7l-2 2M7 13l2-2M17 13l-2-2\"></path>", 5)])]))])], 8, _hoisted_5$3)
262
241
  ]),
263
- (0, vue.createElementVNode)("span", _hoisted_9$1, (0, vue.toDisplayString)($setup.title), 1),
242
+ (0, vue.createElementVNode)("span", _hoisted_9$2, (0, vue.toDisplayString)($setup.title), 1),
264
243
  (0, vue.createElementVNode)("div", _hoisted_10, [(0, vue.createElementVNode)("button", {
265
244
  class: "opencode-header-btn close",
266
245
  type: "button",
@@ -278,11 +257,11 @@ function __vue_render__$6(_ctx, _cache, $props, $setup, $data, $options) {
278
257
  }, [(0, vue.createElementVNode)("path", { d: "M18 6L6 18M6 6l12 12" })], -1))])])])
279
258
  ]);
280
259
  }
281
- __vue_sfc__$6.render = __vue_render__$6;
282
- var Header_vue_default = __vue_sfc__$6;
260
+ __vue_sfc__$5.render = __vue_render__$5;
261
+ var Header_vue_default = __vue_sfc__$5;
283
262
  //#endregion
284
263
  //#region es/open-code-widget/src/components/SelectHint.vue.js
285
- var __vue_sfc__$5 = /* @__PURE__ */ (0, vue.defineComponent)({
264
+ var __vue_sfc__$4 = /* @__PURE__ */ (0, vue.defineComponent)({
286
265
  __name: "SelectHint",
287
266
  setup(__props, { expose: __expose }) {
288
267
  __expose();
@@ -298,72 +277,12 @@ var __vue_sfc__$5 = /* @__PURE__ */ (0, vue.defineComponent)({
298
277
  return __returned__;
299
278
  }
300
279
  });
301
- var _hoisted_1$5 = { class: "opencode-hint-shortcut" };
302
- function __vue_render__$5(_ctx, _cache, $props, $setup, $data, $options) {
303
- return (0, vue.openBlock)(), (0, vue.createElementBlock)("div", { class: (0, vue.normalizeClass)(["opencode-select-mode-hint", { visible: $setup.visible }]) }, [_cache[0] || (_cache[0] = (0, vue.createElementVNode)("span", null, "🎯 选择模式已开启 - 点击元素进行选择", -1)), (0, vue.createElementVNode)("span", _hoisted_1$5, (0, vue.toDisplayString)($setup.shortcutLabel), 1)], 2);
304
- }
305
- __vue_sfc__$5.render = __vue_render__$5;
306
- var SelectHint_vue_default = __vue_sfc__$5;
307
- //#endregion
308
- //#region es/open-code-widget/src/components/SelectedBubbles.vue.js
309
- var __vue_sfc__$4 = /* @__PURE__ */ (0, vue.defineComponent)({
310
- __name: "SelectedBubbles",
311
- setup(__props, { expose: __expose }) {
312
- __expose();
313
- const { bubbleVisible: visible, selectedElementItems: items, handleClickSelectedNode, handleRemoveSelectedNode } = useOpenCodeWidgetContext();
314
- const __returned__ = {
315
- visible,
316
- items,
317
- handleClickSelectedNode,
318
- handleRemoveSelectedNode
319
- };
320
- Object.defineProperty(__returned__, "__isScriptSetup", {
321
- enumerable: false,
322
- value: true
323
- });
324
- return __returned__;
325
- }
326
- });
327
- var _hoisted_1$4 = {
328
- key: 0,
329
- class: "opencode-bubble-empty"
330
- };
331
- var _hoisted_2$3 = ["onClick"];
332
- var _hoisted_3$3 = { class: "opencode-bubble-text" };
333
- var _hoisted_4$3 = {
334
- key: 0,
335
- class: "opencode-bubble-file"
336
- };
337
- var _hoisted_5$3 = ["aria-label", "onClick"];
280
+ var _hoisted_1$4 = { class: "opencode-hint-shortcut" };
338
281
  function __vue_render__$4(_ctx, _cache, $props, $setup, $data, $options) {
339
- return (0, vue.openBlock)(), (0, vue.createElementBlock)("div", {
340
- class: (0, vue.normalizeClass)(["opencode-selected-bubbles", { visible: $setup.visible }]),
341
- role: "list",
342
- "aria-label": "已选元素列表"
343
- }, [$setup.items.length === 0 ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("div", _hoisted_1$4, "暂无选中元素")) : ((0, vue.openBlock)(true), (0, vue.createElementBlock)(vue.Fragment, { key: 1 }, (0, vue.renderList)($setup.items, (item, index) => {
344
- return (0, vue.openBlock)(), (0, vue.createElementBlock)("div", {
345
- key: item.key,
346
- class: "opencode-selected-bubble",
347
- role: "listitem",
348
- onClick: ($event) => $setup.handleClickSelectedNode(item)
349
- }, [
350
- (0, vue.createElementVNode)("span", _hoisted_3$3, (0, vue.toDisplayString)(item.description), 1),
351
- item.bubbleFileText ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("span", _hoisted_4$3, (0, vue.toDisplayString)(item.bubbleFileText), 1)) : (0, vue.createCommentVNode)("v-if", true),
352
- (0, vue.createElementVNode)("button", {
353
- class: "opencode-bubble-remove",
354
- type: "button",
355
- "aria-label": `\u79FB\u9664\u5143\u7D20: ${item.description}`,
356
- onClick: (0, vue.withModifiers)(($event) => $setup.handleRemoveSelectedNode({
357
- item,
358
- index,
359
- source: "bubble"
360
- }), ["stop"])
361
- }, " × ", 8, _hoisted_5$3)
362
- ], 8, _hoisted_2$3);
363
- }), 128))], 2);
282
+ return (0, vue.openBlock)(), (0, vue.createElementBlock)("div", { class: (0, vue.normalizeClass)(["opencode-select-mode-hint", { visible: $setup.visible }]) }, [_cache[0] || (_cache[0] = (0, vue.createElementVNode)("span", null, "🎯 选择模式已开启 - 点击元素进行选择", -1)), (0, vue.createElementVNode)("span", _hoisted_1$4, (0, vue.toDisplayString)($setup.shortcutLabel), 1)], 2);
364
283
  }
365
284
  __vue_sfc__$4.render = __vue_render__$4;
366
- var SelectedBubbles_vue_default = __vue_sfc__$4;
285
+ var SelectHint_vue_default = __vue_sfc__$4;
367
286
  //#endregion
368
287
  //#region es/open-code-widget/src/components/SelectedNodes.vue.js
369
288
  var __vue_sfc__$3 = /* @__PURE__ */ (0, vue.defineComponent)({
@@ -492,7 +411,7 @@ var _hoisted_5$1 = ["aria-selected", "onClick"];
492
411
  var _hoisted_6$1 = { class: "opencode-session-header" };
493
412
  var _hoisted_7$1 = { class: "opencode-session-title" };
494
413
  var _hoisted_8$1 = ["aria-label", "onClick"];
495
- var _hoisted_9 = { class: "opencode-session-meta" };
414
+ var _hoisted_9$1 = { class: "opencode-session-meta" };
496
415
  function __vue_render__$2(_ctx, _cache, $props, $setup, $data, $options) {
497
416
  return (0, vue.openBlock)(), (0, vue.createElementBlock)("div", { class: (0, vue.normalizeClass)(["opencode-session-list", { collapsed: $setup.collapsed }]) }, [
498
417
  (0, vue.createCommentVNode)(" Header "),
@@ -521,7 +440,7 @@ function __vue_render__$2(_ctx, _cache, $props, $setup, $data, $options) {
521
440
  type: "button",
522
441
  "aria-label": `\u5220\u9664\u4F1A\u8BDD: ${item.title}`,
523
442
  onClick: (0, vue.withModifiers)(($event) => $setup.handleDeleteSession(item), ["stop"])
524
- }, " × ", 8, _hoisted_8$1)]), (0, vue.createElementVNode)("div", _hoisted_9, (0, vue.toDisplayString)(item.meta), 1)], 10, _hoisted_5$1);
443
+ }, " × ", 8, _hoisted_8$1)]), (0, vue.createElementVNode)("div", _hoisted_9$1, (0, vue.toDisplayString)(item.meta), 1)], 10, _hoisted_5$1);
525
444
  }), 128)) : ((0, vue.openBlock)(), (0, vue.createElementBlock)(vue.Fragment, { key: 2 }, [(0, vue.createCommentVNode)(" Empty State "), (0, vue.renderSlot)(_ctx.$slots, "empty")], 64))])], 2112))
526
445
  ], 2);
527
446
  }
@@ -533,11 +452,12 @@ var __vue_sfc__$1 = /* @__PURE__ */ (0, vue.defineComponent)({
533
452
  __name: "Trigger",
534
453
  setup(__props, { expose: __expose }) {
535
454
  __expose();
536
- const { buttonActive: active, open, hotkeyLabel, handleToggle } = useOpenCodeWidgetContext();
455
+ const { buttonActive: active, open, hotkeyLabel, thinking, handleToggle } = useOpenCodeWidgetContext();
537
456
  const __returned__ = {
538
457
  active,
539
458
  open,
540
459
  hotkeyLabel,
460
+ thinking,
541
461
  handleToggle
542
462
  };
543
463
  Object.defineProperty(__returned__, "__isScriptSetup", {
@@ -550,7 +470,10 @@ var __vue_sfc__$1 = /* @__PURE__ */ (0, vue.defineComponent)({
550
470
  var _hoisted_1$1 = ["aria-expanded", "title"];
551
471
  function __vue_render__$1(_ctx, _cache, $props, $setup, $data, $options) {
552
472
  return (0, vue.openBlock)(), (0, vue.createElementBlock)("button", {
553
- class: (0, vue.normalizeClass)(["opencode-button", { active: $setup.active }]),
473
+ class: (0, vue.normalizeClass)(["opencode-button", {
474
+ active: $setup.active,
475
+ thinking: $setup.thinking
476
+ }]),
554
477
  type: "button",
555
478
  "aria-expanded": $setup.open,
556
479
  "aria-label": "打开 AI 助手",
@@ -1169,6 +1092,11 @@ var __vue_sfc__ = /* @__PURE__ */ (0, vue.defineComponent)(__spreadProps(__sprea
1169
1092
  type: Boolean,
1170
1093
  required: false,
1171
1094
  default: true
1095
+ },
1096
+ thinking: {
1097
+ type: Boolean,
1098
+ required: false,
1099
+ default: false
1172
1100
  }
1173
1101
  },
1174
1102
  emits: [
@@ -1178,6 +1106,7 @@ var __vue_sfc__ = /* @__PURE__ */ (0, vue.defineComponent)(__spreadProps(__sprea
1178
1106
  "update:currentSessionId",
1179
1107
  "update:selectedElements",
1180
1108
  "update:theme",
1109
+ "update:thinking",
1181
1110
  "toggle",
1182
1111
  "close",
1183
1112
  "toggle-session-list",
@@ -1190,7 +1119,8 @@ var __vue_sfc__ = /* @__PURE__ */ (0, vue.defineComponent)(__spreadProps(__sprea
1190
1119
  "remove-selected-node",
1191
1120
  "clear-selected-nodes",
1192
1121
  "empty-action",
1193
- "frame-loaded"
1122
+ "frame-loaded",
1123
+ "thinking-change"
1194
1124
  ],
1195
1125
  setup(__props, { expose: __expose, emit: __emit }) {
1196
1126
  const props = __props;
@@ -1198,10 +1128,13 @@ var __vue_sfc__ = /* @__PURE__ */ (0, vue.defineComponent)(__spreadProps(__sprea
1198
1128
  const slots = (0, vue.useSlots)();
1199
1129
  const notificationMessage = (0, vue.ref)("");
1200
1130
  const notificationVisible = (0, vue.ref)(false);
1131
+ const notificationMode = (0, vue.ref)("widget");
1201
1132
  let notificationTimer = null;
1202
- const showNotification = (message, duration = 3e3) => {
1133
+ const showNotification = (message, options) => {
1134
+ const { duration = 3e3, mode = "widget" } = options || {};
1203
1135
  notificationMessage.value = message;
1204
1136
  notificationVisible.value = true;
1137
+ notificationMode.value = mode;
1205
1138
  if (notificationTimer) clearTimeout(notificationTimer);
1206
1139
  notificationTimer = setTimeout(() => {
1207
1140
  notificationVisible.value = false;
@@ -1225,12 +1158,18 @@ var __vue_sfc__ = /* @__PURE__ */ (0, vue.defineComponent)(__spreadProps(__sprea
1225
1158
  dialogVisible.value = false;
1226
1159
  if (dialogResolve) dialogResolve(false);
1227
1160
  };
1161
+ const frameRef = (0, vue.ref)(null);
1162
+ const sendMessageToIframe = (type, data) => {
1163
+ var _a;
1164
+ (_a = frameRef.value) == null || _a.sendMessageToIframe(type, data);
1165
+ };
1228
1166
  const handleFrameLoaded = () => {
1229
1167
  emit("frame-loaded");
1230
1168
  };
1231
1169
  __expose({
1232
1170
  showNotification,
1233
- showConfirmDialog
1171
+ showConfirmDialog,
1172
+ sendMessageToIframe
1234
1173
  });
1235
1174
  const localSessionListCollapsed = (0, vue.ref)(props.sessionListCollapsed);
1236
1175
  (0, vue.watch)(() => props.sessionListCollapsed, (val) => {
@@ -1327,6 +1266,7 @@ var __vue_sfc__ = /* @__PURE__ */ (0, vue.defineComponent)(__spreadProps(__sprea
1327
1266
  emptyStateActionText: (0, vue.toRef)(props, "emptyStateActionText"),
1328
1267
  showClearAll: (0, vue.toRef)(props, "showClearAll"),
1329
1268
  open: (0, vue.toRef)(props, "open"),
1269
+ thinking: (0, vue.toRef)(props, "thinking"),
1330
1270
  iframeSource,
1331
1271
  buttonActive,
1332
1272
  sessionListTitle,
@@ -1354,6 +1294,7 @@ var __vue_sfc__ = /* @__PURE__ */ (0, vue.defineComponent)(__spreadProps(__sprea
1354
1294
  slots,
1355
1295
  notificationMessage,
1356
1296
  notificationVisible,
1297
+ notificationMode,
1357
1298
  get notificationTimer() {
1358
1299
  return notificationTimer;
1359
1300
  },
@@ -1372,6 +1313,8 @@ var __vue_sfc__ = /* @__PURE__ */ (0, vue.defineComponent)(__spreadProps(__sprea
1372
1313
  showConfirmDialog,
1373
1314
  handleDialogConfirm,
1374
1315
  handleDialogCancel,
1316
+ frameRef,
1317
+ sendMessageToIframe,
1375
1318
  handleFrameLoaded,
1376
1319
  localSessionListCollapsed,
1377
1320
  buttonActive,
@@ -1403,7 +1346,6 @@ var __vue_sfc__ = /* @__PURE__ */ (0, vue.defineComponent)(__spreadProps(__sprea
1403
1346
  Frame: Frame_vue_default,
1404
1347
  Header: Header_vue_default,
1405
1348
  SelectHint: SelectHint_vue_default,
1406
- SelectedBubbles: SelectedBubbles_vue_default,
1407
1349
  SelectedNodes: SelectedNodes_vue_default,
1408
1350
  SessionList: SessionList_vue_default,
1409
1351
  Trigger: Trigger_vue_default
@@ -1424,7 +1366,7 @@ var _hoisted_2 = { class: "opencode-chat-content" };
1424
1366
  var _hoisted_3 = { class: "opencode-tooltip-tag" };
1425
1367
  var _hoisted_4 = { class: "opencode-tooltip-file" };
1426
1368
  var _hoisted_5 = {
1427
- key: 1,
1369
+ key: 0,
1428
1370
  class: "opencode-dialog-overlay"
1429
1371
  };
1430
1372
  var _hoisted_6 = {
@@ -1434,6 +1376,11 @@ var _hoisted_6 = {
1434
1376
  };
1435
1377
  var _hoisted_7 = { class: "opencode-dialog-content" };
1436
1378
  var _hoisted_8 = { class: "opencode-dialog-message" };
1379
+ var _hoisted_9 = {
1380
+ key: 0,
1381
+ class: "opencode-page-notification",
1382
+ role: "alert"
1383
+ };
1437
1384
  function __vue_render__(_ctx, _cache, $props, $setup, $data, $options) {
1438
1385
  return (0, vue.openBlock)(), (0, vue.createElementBlock)("div", { class: (0, vue.normalizeClass)($setup.containerClasses) }, [
1439
1386
  (0, vue.createVNode)($setup["Trigger"], null, (0, vue.createSlots)({ _: 2 }, [$setup.slots["button-icon"] ? {
@@ -1441,7 +1388,7 @@ function __vue_render__(_ctx, _cache, $props, $setup, $data, $options) {
1441
1388
  fn: (0, vue.withCtx)(() => [(0, vue.renderSlot)(_ctx.$slots, "button-icon")]),
1442
1389
  key: "0"
1443
1390
  } : void 0]), 1024),
1444
- $setup.bubbleVisible ? ((0, vue.openBlock)(), (0, vue.createBlock)($setup["SelectedBubbles"], { key: 0 })) : (0, vue.createCommentVNode)("v-if", true),
1391
+ (0, vue.createCommentVNode)(" <SelectedBubbles v-if=\"bubbleVisible\" /> "),
1445
1392
  (0, vue.withDirectives)((0, vue.createElementVNode)("div", { class: (0, vue.normalizeClass)(["opencode-chat", { open: $props.open }]) }, [
1446
1393
  (0, vue.createVNode)($setup["Header"], null, (0, vue.createSlots)({ _: 2 }, [
1447
1394
  $setup.slots["session-toggle-icon"] ? {
@@ -1461,13 +1408,13 @@ function __vue_render__(_ctx, _cache, $props, $setup, $data, $options) {
1461
1408
  } : void 0
1462
1409
  ]), 1024),
1463
1410
  (0, vue.createCommentVNode)(" Notification "),
1464
- $setup.notificationVisible ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("div", _hoisted_1, (0, vue.toDisplayString)($setup.notificationMessage), 1)) : (0, vue.createCommentVNode)("v-if", true),
1411
+ $setup.notificationVisible && $setup.notificationMode === "widget" ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("div", _hoisted_1, (0, vue.toDisplayString)($setup.notificationMessage), 1)) : (0, vue.createCommentVNode)("v-if", true),
1465
1412
  (0, vue.createElementVNode)("div", _hoisted_2, [
1466
1413
  (0, vue.createVNode)($setup["SessionList"], null, {
1467
1414
  empty: (0, vue.withCtx)(() => [(0, vue.renderSlot)(_ctx.$slots, "sessions-empty", {}, () => [_cache[0] || (_cache[0] = (0, vue.createElementVNode)("div", { class: "opencode-session-empty" }, "暂无会话", -1))])]),
1468
1415
  _: 3
1469
1416
  }),
1470
- (0, vue.createVNode)($setup["Frame"], null, (0, vue.createSlots)({ _: 2 }, [
1417
+ (0, vue.createVNode)($setup["Frame"], { ref: "frameRef" }, (0, vue.createSlots)({ _: 2 }, [
1471
1418
  $setup.slots["empty-state"] ? {
1472
1419
  name: "empty-state",
1473
1420
  fn: (0, vue.withCtx)(() => [(0, vue.renderSlot)(_ctx.$slots, "empty-state")]),
@@ -1488,7 +1435,7 @@ function __vue_render__(_ctx, _cache, $props, $setup, $data, $options) {
1488
1435
  fn: (0, vue.withCtx)(() => [(0, vue.renderSlot)(_ctx.$slots, "content")]),
1489
1436
  key: "3"
1490
1437
  } : void 0
1491
- ]), 1024),
1438
+ ]), 1536),
1492
1439
  (0, vue.createVNode)($setup["SelectedNodes"])
1493
1440
  ])
1494
1441
  ], 2), [[vue.vShow, !$props.selectMode]]),
@@ -1510,7 +1457,9 @@ function __vue_render__(_ctx, _cache, $props, $setup, $data, $options) {
1510
1457
  }, "取消"), (0, vue.createElementVNode)("button", {
1511
1458
  class: "opencode-dialog-btn confirm",
1512
1459
  onClick: $setup.handleDialogConfirm
1513
- }, "确认")])])])) : (0, vue.createCommentVNode)("v-if", true)
1460
+ }, "确认")])])])) : (0, vue.createCommentVNode)("v-if", true),
1461
+ (0, vue.createCommentVNode)(" Page-level Notification "),
1462
+ ((0, vue.openBlock)(), (0, vue.createBlock)(vue.Teleport, { to: "body" }, [$setup.notificationVisible && $setup.notificationMode === "page" ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("div", _hoisted_9, (0, vue.toDisplayString)($setup.notificationMessage), 1)) : (0, vue.createCommentVNode)("v-if", true)]))
1514
1463
  ], 2);
1515
1464
  }
1516
1465
  __vue_sfc__.render = __vue_render__;
@@ -1519,7 +1468,7 @@ __vue_sfc__.render = __vue_render__;
1519
1468
  var open_code_widget_default = __vue_sfc__;
1520
1469
  //#endregion
1521
1470
  //#region es/index.js
1522
- var version = "1.0.15";
1471
+ var version = "1.0.17";
1523
1472
  function install(app, options) {
1524
1473
  [open_code_widget_default].forEach((item) => {
1525
1474
  if (item.install) app.use(item, options);