@inupedia/spotlight-vue 0.9.1 → 0.9.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.
@@ -1,32 +1,50 @@
1
- import { defineComponent as N, ref as I, toRef as P, openBlock as l, createElementBlock as n, withModifiers as m, unref as e, createElementVNode as s, normalizeClass as p, createBlock as T, createCommentVNode as g, toDisplayString as d, createVNode as S, withCtx as z, withDirectives as D, withKeys as v, vModelText as V, Fragment as C, renderList as x, nextTick as w } from "vue";
2
- import { storeToRefs as O } from "pinia";
3
- import { useSpotlightStore as F } from "../store/spotlightStore.js";
4
- import { useSpotlightMemoryPreferenceStore as U } from "../store/memoryPreferenceStore.js";
5
- import { getSpotlightMemoryPreferenceCopy as E, SPOTLIGHT_MEMORY_PREFERENCE_LABEL as G } from "../store/memoryPreferenceCopy.js";
6
- import { useSpotlightPanelUi as W } from "../composables/useSpotlightPanelUi.js";
7
- import Y from "./InspiraCardSpotlight.js";
8
- import L from "./OfficialBorderBeam.js";
9
- const _ = { class: "spotlight-command-deck" }, j = { class: "spotlight-command-deck-meta" }, q = {
1
+ import { defineComponent as j, ref as v, computed as J, onMounted as X, toRef as B, openBlock as i, createElementBlock as n, Fragment as y, createElementVNode as t, withModifiers as f, unref as e, normalizeClass as g, createBlock as H, createCommentVNode as u, toDisplayString as r, createVNode as w, withCtx as Z, withDirectives as K, withKeys as x, vModelText as A, renderList as R, Teleport as ee, nextTick as P } from "vue";
2
+ import { Settings2 as te } from "lucide-vue-next";
3
+ import { storeToRefs as oe } from "pinia";
4
+ import { useSpotlightStore as se } from "../store/spotlightStore.js";
5
+ import { useSpotlightMemoryPreferenceStore as le } from "../store/memoryPreferenceStore.js";
6
+ import { useSpotlightModelStore as ie } from "../store/modelStore.js";
7
+ import { getSpotlightMemoryPreferenceCopy as I, SPOTLIGHT_MEMORY_PREFERENCE_LABEL as ne } from "../store/memoryPreferenceCopy.js";
8
+ import { useSpotlightPanelUi as de } from "../composables/useSpotlightPanelUi.js";
9
+ import ae from "./InspiraCardSpotlight.js";
10
+ import N from "./OfficialBorderBeam.js";
11
+ const re = ["inert"], ce = ["aria-modal"], pe = { class: "spotlight-command-deck" }, ge = { class: "spotlight-command-deck-meta" }, ue = {
10
12
  key: 0,
11
13
  class: "spotlight-command-deck-kicker"
12
- }, J = { class: "spotlight-command-deck-status" }, X = ["aria-checked", "aria-label", "title"], Z = { class: "spotlight-memory-label" }, ee = {
14
+ }, me = { class: "spotlight-command-deck-status" }, he = { class: "spotlight-command-deck-actions" }, ve = ["aria-checked", "aria-label", "title"], fe = { class: "spotlight-memory-label" }, be = ["aria-expanded", "aria-label", "title"], ke = {
13
15
  key: 1,
14
16
  class: "spotlight-permission-banner",
15
17
  role: "alertdialog",
16
18
  "aria-label": "Skill 权限确认"
17
- }, te = { class: "spotlight-permission-banner-body" }, se = { class: "spotlight-permission-banner-actions" }, ie = { class: "spotlight-voice-text" }, oe = ["placeholder"], le = {
19
+ }, ye = { class: "spotlight-permission-banner-body" }, Pe = { class: "spotlight-permission-banner-actions" }, Se = { class: "spotlight-voice-text" }, Ce = ["placeholder"], _e = {
18
20
  key: 2,
19
21
  class: "spotlight-list-shell"
20
- }, ne = {
22
+ }, Me = {
21
23
  class: "spotlight-list",
22
24
  role: "listbox"
23
- }, ae = ["aria-selected", "onClick"], re = { class: "spotlight-item-label" }, de = {
25
+ }, we = ["aria-selected", "onClick"], xe = { class: "spotlight-item-label" }, Re = {
24
26
  key: 0,
25
27
  class: "spotlight-list-divider"
26
- }, ce = ["aria-selected", "onClick"], pe = { class: "spotlight-item-label" }, ge = {
28
+ }, Le = ["aria-selected", "onClick"], $e = { class: "spotlight-item-label" }, Ee = {
27
29
  key: 1,
28
30
  class: "spotlight-item spotlight-item--empty"
29
- }, Pe = /* @__PURE__ */ N({
31
+ }, Qe = { class: "spotlight-model-dialog-content" }, Te = { class: "spotlight-model-search" }, Be = {
32
+ class: "spotlight-model-dialog-status",
33
+ "aria-live": "polite"
34
+ }, He = { key: 0 }, Ke = {
35
+ key: 1,
36
+ class: "is-error"
37
+ }, Ae = { key: 2 }, Ie = { key: 3 }, Ne = ["disabled"], De = {
38
+ class: "spotlight-model-results",
39
+ "aria-label": "可用模型"
40
+ }, ze = ["aria-pressed", "onClick"], Oe = { class: "spotlight-model-option-copy" }, Ve = { class: "spotlight-model-option-name" }, Fe = { class: "spotlight-model-option-provider" }, Ue = {
41
+ key: 0,
42
+ class: "spotlight-model-option-check",
43
+ "aria-hidden": "true"
44
+ }, Ge = {
45
+ key: 0,
46
+ class: "spotlight-model-empty"
47
+ }, st = /* @__PURE__ */ j({
30
48
  __name: "SpotlightCommandPanel",
31
49
  props: {
32
50
  deckKicker: { default: "" },
@@ -34,192 +52,320 @@ const _ = { class: "spotlight-command-deck" }, j = { class: "spotlight-command-d
34
52
  speechPending: { type: Boolean, default: !1 },
35
53
  voiceKeyLabel: { default: "`" }
36
54
  },
37
- setup(a, { expose: Q }) {
38
- const u = a, t = F(), c = U(), { loading: R, pipelinePhase: $, lastMemoryReplay: K, lastMemoryDecision: A } = O(t), h = I(null), { uiState: b, placeholder: B, badgeLabel: k } = W({
39
- pipelinePhase: $,
40
- loading: R,
41
- memoryReplay: K,
42
- memoryDecision: A,
43
- voiceHoldActive: P(u, "voiceHoldActive"),
44
- speechPending: P(u, "speechPending"),
45
- voiceKeyLabel: u.voiceKeyLabel
55
+ setup(c, { expose: D }) {
56
+ const S = c, s = se(), m = le(), d = ie(), { loading: z, pipelinePhase: O, lastMemoryReplay: V, lastMemoryDecision: F } = oe(s), C = v(null), h = v(!1), k = v(""), _ = v(null), L = v(null), $ = v(null), M = J(() => {
57
+ const a = k.value.trim().toLocaleLowerCase();
58
+ return a ? d.models.filter(
59
+ (o) => o.id.toLocaleLowerCase().includes(a)
60
+ ) : d.models;
46
61
  });
47
- function f(y) {
48
- t.fillPromptWithRecent(y), w(() => h.value?.focus());
62
+ X(() => {
63
+ d.loadModels();
64
+ });
65
+ function U() {
66
+ const a = _.value;
67
+ !a || a.open || (h.value = !0, k.value = "", a.showModal(), P(() => L.value?.focus()));
68
+ }
69
+ function b() {
70
+ const a = _.value;
71
+ a?.open && a.close(), h.value = !1, P(() => $.value?.focus());
49
72
  }
50
- function H() {
51
- w(() => h.value?.focus());
73
+ function G(a) {
74
+ d.selectModel(a), b();
52
75
  }
53
- return Q({ focusInput: H }), (y, i) => (l(), n("div", {
54
- class: "spotlight-backdrop",
55
- onClick: i[7] || (i[7] = m(
56
- //@ts-ignore
57
- (...o) => e(t).close && e(t).close(...o),
58
- ["self"]
59
- ))
60
- }, [
61
- s("div", {
62
- class: p(["spotlight-panel", { "is-memory-on": e(c).enabled }]),
63
- role: "dialog",
64
- "aria-modal": "true",
65
- "aria-label": "指令面板"
76
+ const { uiState: E, placeholder: q, badgeLabel: Q } = de({
77
+ pipelinePhase: O,
78
+ loading: z,
79
+ memoryReplay: V,
80
+ memoryDecision: F,
81
+ voiceHoldActive: B(S, "voiceHoldActive"),
82
+ speechPending: B(S, "speechPending"),
83
+ voiceKeyLabel: S.voiceKeyLabel
84
+ });
85
+ function T(a) {
86
+ s.fillPromptWithRecent(a), P(() => C.value?.focus());
87
+ }
88
+ function W() {
89
+ P(() => C.value?.focus());
90
+ }
91
+ return D({ focusInput: W }), (a, o) => (i(), n(y, null, [
92
+ t("div", {
93
+ class: "spotlight-backdrop",
94
+ inert: h.value,
95
+ onClick: o[7] || (o[7] = f(
96
+ //@ts-ignore
97
+ (...l) => e(s).close && e(s).close(...l),
98
+ ["self"]
99
+ ))
66
100
  }, [
67
- e(c).enabled ? (l(), T(L, {
68
- key: 0,
69
- class: "spotlight-panel-beam",
70
- size: 120,
71
- duration: 22,
72
- "border-width": 1.5,
73
- "color-from": "#5eead4",
74
- "color-to": "#38bdf8"
75
- })) : g("", !0),
76
- s("div", _, [
77
- s("div", j, [
78
- a.deckKicker ? (l(), n("span", q, d(a.deckKicker), 1)) : g("", !0),
79
- s("span", J, d(e(k)), 1)
80
- ]),
81
- s("button", {
82
- type: "button",
83
- class: "spotlight-memory-dot-btn",
84
- role: "switch",
85
- "aria-checked": e(c).enabled,
86
- "aria-label": e(E)(e(c).enabled).ariaLabel,
87
- title: e(E)(e(c).enabled).title,
88
- onClick: i[0] || (i[0] = (o) => e(c).toggle())
89
- }, [
90
- s("span", Z, d(e(G)), 1),
91
- s("span", {
92
- class: p(["spotlight-memory-dot", { "is-on": e(c).enabled }])
93
- }, null, 2)
94
- ], 8, X)
95
- ]),
96
- e(t).pendingSkillPermission ? (l(), n("div", ee, [
97
- s("div", te, [
98
- s("strong", null, d(e(t).pendingSkillPermission.displayName ?? e(t).pendingSkillPermission.skillName), 1),
99
- s("span", null, d(e(t).pendingSkillPermission.reason), 1)
101
+ t("div", {
102
+ class: g(["spotlight-panel", { "is-memory-on": e(m).enabled }]),
103
+ role: "dialog",
104
+ "aria-modal": h.value ? "false" : "true",
105
+ "aria-label": "指令面板"
106
+ }, [
107
+ e(m).enabled ? (i(), H(N, {
108
+ key: 0,
109
+ class: "spotlight-panel-beam",
110
+ size: 120,
111
+ duration: 22,
112
+ "border-width": 1.5,
113
+ "color-from": "#5eead4",
114
+ "color-to": "#38bdf8"
115
+ })) : u("", !0),
116
+ t("div", pe, [
117
+ t("div", ge, [
118
+ c.deckKicker ? (i(), n("span", ue, r(c.deckKicker), 1)) : u("", !0),
119
+ t("span", me, r(e(Q)), 1)
120
+ ]),
121
+ t("div", he, [
122
+ t("button", {
123
+ type: "button",
124
+ class: "spotlight-memory-dot-btn",
125
+ role: "switch",
126
+ "aria-checked": e(m).enabled,
127
+ "aria-label": e(I)(e(m).enabled).ariaLabel,
128
+ title: e(I)(e(m).enabled).title,
129
+ onClick: o[0] || (o[0] = (l) => e(m).toggle())
130
+ }, [
131
+ t("span", fe, r(e(ne)), 1),
132
+ t("span", {
133
+ class: g(["spotlight-memory-dot", { "is-on": e(m).enabled }])
134
+ }, null, 2)
135
+ ], 8, ve),
136
+ t("button", {
137
+ ref_key: "modelTriggerRef",
138
+ ref: $,
139
+ type: "button",
140
+ class: "spotlight-model-settings",
141
+ "aria-haspopup": "dialog",
142
+ "aria-expanded": h.value,
143
+ "aria-controls": "spotlight-model-dialog",
144
+ "aria-label": e(d).selectedModel ? `模型设置,当前 ${e(d).selectedModel}` : "模型设置",
145
+ title: e(d).error || "模型设置",
146
+ onClick: U
147
+ }, [
148
+ w(e(te), {
149
+ size: 17,
150
+ "stroke-width": 1.8,
151
+ "aria-hidden": "true"
152
+ })
153
+ ], 8, be)
154
+ ])
100
155
  ]),
101
- s("div", se, [
102
- s("button", {
103
- type: "button",
104
- class: "spotlight-permission-btn is-approve",
105
- onClick: i[1] || (i[1] = (o) => e(t).approvePendingSkillPermission())
106
- }, " 允许 "),
107
- s("button", {
108
- type: "button",
109
- class: "spotlight-permission-btn is-dismiss",
110
- onClick: i[2] || (i[2] = (o) => e(t).clearPendingSkillPermission())
111
- }, " 取消 ")
112
- ])
113
- ])) : g("", !0),
114
- S(Y, {
115
- class: "spotlight-input-shell",
116
- "gradient-size": 260,
117
- "gradient-color": "rgba(45, 212, 191, 0.14)",
118
- "gradient-opacity": 1
119
- }, {
120
- default: z(() => [
121
- a.voiceHoldActive || a.speechPending ? (l(), n("div", {
122
- key: 0,
123
- class: p(["spotlight-voice-shell", {
124
- "is-recording": a.voiceHoldActive,
125
- "is-transcribing": a.speechPending
126
- }])
127
- }, [
128
- S(L, {
129
- class: "spotlight-voice-beam",
130
- size: 86,
131
- duration: 6,
132
- "border-width": 1.5,
133
- "color-from": "#c9a25d",
134
- "color-to": "#5d8f9b"
135
- }),
136
- i[8] || (i[8] = s("div", {
137
- class: "spotlight-voice-mic",
138
- "aria-hidden": "true"
156
+ e(s).pendingSkillPermission ? (i(), n("div", ke, [
157
+ t("div", ye, [
158
+ t("strong", null, r(e(s).pendingSkillPermission.displayName ?? e(s).pendingSkillPermission.skillName), 1),
159
+ t("span", null, r(e(s).pendingSkillPermission.reason), 1)
160
+ ]),
161
+ t("div", Pe, [
162
+ t("button", {
163
+ type: "button",
164
+ class: "spotlight-permission-btn is-approve",
165
+ onClick: o[1] || (o[1] = (l) => e(s).approvePendingSkillPermission())
166
+ }, " 允许 "),
167
+ t("button", {
168
+ type: "button",
169
+ class: "spotlight-permission-btn is-dismiss",
170
+ onClick: o[2] || (o[2] = (l) => e(s).clearPendingSkillPermission())
171
+ }, " 取消 ")
172
+ ])
173
+ ])) : u("", !0),
174
+ w(ae, {
175
+ class: "spotlight-input-shell",
176
+ "gradient-size": 260,
177
+ "gradient-color": "rgba(45, 212, 191, 0.14)",
178
+ "gradient-opacity": 1
179
+ }, {
180
+ default: Z(() => [
181
+ c.voiceHoldActive || c.speechPending ? (i(), n("div", {
182
+ key: 0,
183
+ class: g(["spotlight-voice-shell", {
184
+ "is-recording": c.voiceHoldActive,
185
+ "is-transcribing": c.speechPending
186
+ }])
187
+ }, [
188
+ w(N, {
189
+ class: "spotlight-voice-beam",
190
+ size: 86,
191
+ duration: 6,
192
+ "border-width": 1.5,
193
+ "color-from": "#c9a25d",
194
+ "color-to": "#5d8f9b"
195
+ }),
196
+ o[11] || (o[11] = t("div", {
197
+ class: "spotlight-voice-mic",
198
+ "aria-hidden": "true"
199
+ }, [
200
+ t("span", { class: "spotlight-voice-mic-icon" }, [
201
+ t("span", { class: "spotlight-voice-mic-body" }),
202
+ t("span", { class: "spotlight-voice-mic-stem" })
203
+ ])
204
+ ], -1)),
205
+ t("div", Se, r(c.voiceHoldActive ? `正在录音,松开 ${c.voiceKeyLabel} 结束` : "语音识别中,请稍候…"), 1)
206
+ ], 2)) : (i(), n("div", {
207
+ key: 1,
208
+ class: g(["spotlight-input-wrap", `is-${e(E)}`])
139
209
  }, [
140
- s("span", { class: "spotlight-voice-mic-icon" }, [
141
- s("span", { class: "spotlight-voice-mic-body" }),
142
- s("span", { class: "spotlight-voice-mic-stem" })
143
- ])
210
+ K(t("input", {
211
+ ref_key: "inputRef",
212
+ ref: C,
213
+ "onUpdate:modelValue": o[3] || (o[3] = (l) => e(s).prompt = l),
214
+ class: "spotlight-input",
215
+ type: "text",
216
+ placeholder: e(q),
217
+ onKeydown: [
218
+ o[4] || (o[4] = x(f(
219
+ //@ts-ignore
220
+ (...l) => e(s).handleEnter && e(s).handleEnter(...l),
221
+ ["prevent"]
222
+ ), ["enter"])),
223
+ o[5] || (o[5] = x(f(
224
+ //@ts-ignore
225
+ (...l) => e(s).selectNext && e(s).selectNext(...l),
226
+ ["prevent"]
227
+ ), ["down"])),
228
+ o[6] || (o[6] = x(f(
229
+ //@ts-ignore
230
+ (...l) => e(s).selectPrev && e(s).selectPrev(...l),
231
+ ["prevent"]
232
+ ), ["up"]))
233
+ ]
234
+ }, null, 40, Ce), [
235
+ [A, e(s).prompt]
236
+ ]),
237
+ t("div", {
238
+ class: g(["spotlight-agent-badge", `is-${e(E)}`])
239
+ }, [
240
+ o[12] || (o[12] = t("span", { class: "spotlight-agent-badge-dot" }, null, -1)),
241
+ t("span", null, r(e(Q)), 1)
242
+ ], 2)
243
+ ], 2))
244
+ ]),
245
+ _: 1
246
+ }),
247
+ !e(s).prompt.trim() && !e(s).loading && !c.voiceHoldActive && !c.speechPending ? (i(), n("div", _e, [
248
+ t("ul", Me, [
249
+ (i(!0), n(y, null, R(e(s).suggestedQuestions, (l, p) => (i(), n("li", {
250
+ key: `suggested-${p}`,
251
+ class: g(["spotlight-item", { "is-selected": e(s).selectedIndex === p }]),
252
+ role: "option",
253
+ "aria-selected": e(s).selectedIndex === p,
254
+ onClick: (Y) => T(p)
255
+ }, [
256
+ t("span", xe, r(l), 1),
257
+ o[13] || (o[13] = t("span", { class: "spotlight-item-hint" }, "推荐", -1))
258
+ ], 10, we))), 128)),
259
+ e(s).suggestedQuestions.length > 0 && e(s).recentQuestions.length > 0 ? (i(), n("li", Re, [...o[14] || (o[14] = [
260
+ t("span", null, "历史问题", -1)
261
+ ])])) : u("", !0),
262
+ (i(!0), n(y, null, R(e(s).recentQuestions, (l, p) => (i(), n("li", {
263
+ key: `recent-${p}`,
264
+ class: g(["spotlight-item", {
265
+ "is-selected": e(s).selectedIndex === p + e(s).suggestedQuestions.length
266
+ }]),
267
+ role: "option",
268
+ "aria-selected": e(s).selectedIndex === p + e(s).suggestedQuestions.length,
269
+ onClick: (Y) => T(p + e(s).suggestedQuestions.length)
270
+ }, [
271
+ t("span", $e, r(l), 1),
272
+ o[15] || (o[15] = t("span", { class: "spotlight-item-hint" }, "历史", -1))
273
+ ], 10, Le))), 128)),
274
+ e(s).suggestedQuestions.length === 0 && e(s).recentQuestions.length === 0 ? (i(), n("li", Ee, [...o[16] || (o[16] = [
275
+ t("span", { class: "spotlight-item-label" }, "暂无推荐问法", -1)
276
+ ])])) : u("", !0)
277
+ ])
278
+ ])) : u("", !0)
279
+ ], 10, ce)
280
+ ], 8, re),
281
+ (i(), H(ee, { to: "body" }, [
282
+ t("dialog", {
283
+ id: "spotlight-model-dialog",
284
+ ref_key: "modelDialogRef",
285
+ ref: _,
286
+ class: "spotlight-model-dialog",
287
+ "aria-labelledby": "spotlight-model-title",
288
+ "aria-describedby": "spotlight-model-description",
289
+ onCancel: f(b, ["prevent"]),
290
+ onClick: f(b, ["self"]),
291
+ onClose: o[10] || (o[10] = (l) => h.value = !1)
292
+ }, [
293
+ t("section", Qe, [
294
+ t("header", { class: "spotlight-model-dialog-header" }, [
295
+ o[18] || (o[18] = t("div", { class: "spotlight-model-dialog-heading" }, [
296
+ t("span", { class: "spotlight-model-dialog-eyebrow" }, "SPOTLIGHT 设置"),
297
+ t("h2", { id: "spotlight-model-title" }, "选择模型"),
298
+ t("p", { id: "spotlight-model-description" }, " 选择后将用于接下来的 Spotlight 请求。 ")
144
299
  ], -1)),
145
- s("div", ie, d(a.voiceHoldActive ? `正在录音,松开 ${a.voiceKeyLabel} 结束` : "语音识别中,请稍候…"), 1)
146
- ], 2)) : (l(), n("div", {
147
- key: 1,
148
- class: p(["spotlight-input-wrap", `is-${e(b)}`])
149
- }, [
150
- D(s("input", {
151
- ref_key: "inputRef",
152
- ref: h,
153
- "onUpdate:modelValue": i[3] || (i[3] = (o) => e(t).prompt = o),
154
- class: "spotlight-input",
155
- type: "text",
156
- placeholder: e(B),
157
- onKeydown: [
158
- i[4] || (i[4] = v(m(
159
- //@ts-ignore
160
- (...o) => e(t).handleEnter && e(t).handleEnter(...o),
161
- ["prevent"]
162
- ), ["enter"])),
163
- i[5] || (i[5] = v(m(
164
- //@ts-ignore
165
- (...o) => e(t).selectNext && e(t).selectNext(...o),
166
- ["prevent"]
167
- ), ["down"])),
168
- i[6] || (i[6] = v(m(
169
- //@ts-ignore
170
- (...o) => e(t).selectPrev && e(t).selectPrev(...o),
171
- ["prevent"]
172
- ), ["up"]))
173
- ]
174
- }, null, 40, oe), [
175
- [V, e(t).prompt]
176
- ]),
177
- s("div", {
178
- class: p(["spotlight-agent-badge", `is-${e(b)}`])
300
+ t("button", {
301
+ type: "button",
302
+ class: "spotlight-model-dialog-close",
303
+ "aria-label": "关闭模型选择",
304
+ onClick: b
305
+ }, [...o[17] || (o[17] = [
306
+ t("span", { "aria-hidden": "true" }, "×", -1)
307
+ ])])
308
+ ]),
309
+ t("label", Te, [
310
+ o[19] || (o[19] = t("span", {
311
+ class: "spotlight-model-search-icon",
312
+ "aria-hidden": "true"
313
+ }, "⌕", -1)),
314
+ o[20] || (o[20] = t("span", { class: "spotlight-sr-only" }, "搜索模型", -1)),
315
+ K(t("input", {
316
+ id: "spotlight-model-search",
317
+ ref_key: "modelSearchRef",
318
+ ref: L,
319
+ "onUpdate:modelValue": o[8] || (o[8] = (l) => k.value = l),
320
+ type: "search",
321
+ autocomplete: "off",
322
+ placeholder: "搜索模型名称"
323
+ }, null, 512), [
324
+ [A, k.value]
325
+ ])
326
+ ]),
327
+ t("div", Be, [
328
+ e(d).loading ? (i(), n("span", He, "正在同步模型列表…")) : e(d).error ? (i(), n("span", Ke, r(e(d).error), 1)) : M.value.length ? (i(), n("span", Ae, r(M.value.length) + " 个可用模型 ", 1)) : (i(), n("span", Ie, "没有找到匹配的模型")),
329
+ t("button", {
330
+ type: "button",
331
+ class: "spotlight-model-refresh",
332
+ disabled: e(d).loading,
333
+ onClick: o[9] || (o[9] = (l) => e(d).loadModels(!0))
334
+ }, r(e(d).loading ? "同步中…" : "刷新列表"), 9, Ne)
335
+ ]),
336
+ t("div", De, [
337
+ (i(!0), n(y, null, R(M.value, (l) => (i(), n("button", {
338
+ key: l.id,
339
+ type: "button",
340
+ class: g(["spotlight-model-option", { "is-selected": l.id === e(d).selectedModel }]),
341
+ "aria-pressed": l.id === e(d).selectedModel,
342
+ onClick: (p) => G(l.id)
179
343
  }, [
180
- i[9] || (i[9] = s("span", { class: "spotlight-agent-badge-dot" }, null, -1)),
181
- s("span", null, d(e(k)), 1)
182
- ], 2)
183
- ], 2))
184
- ]),
185
- _: 1
186
- }),
187
- !e(t).prompt.trim() && !e(t).loading && !a.voiceHoldActive && !a.speechPending ? (l(), n("div", le, [
188
- s("ul", ne, [
189
- (l(!0), n(C, null, x(e(t).suggestedQuestions, (o, r) => (l(), n("li", {
190
- key: `suggested-${r}`,
191
- class: p(["spotlight-item", { "is-selected": e(t).selectedIndex === r }]),
192
- role: "option",
193
- "aria-selected": e(t).selectedIndex === r,
194
- onClick: (M) => f(r)
195
- }, [
196
- s("span", re, d(o), 1),
197
- i[10] || (i[10] = s("span", { class: "spotlight-item-hint" }, "推荐", -1))
198
- ], 10, ae))), 128)),
199
- e(t).suggestedQuestions.length > 0 && e(t).recentQuestions.length > 0 ? (l(), n("li", de, [...i[11] || (i[11] = [
200
- s("span", null, "历史问题", -1)
201
- ])])) : g("", !0),
202
- (l(!0), n(C, null, x(e(t).recentQuestions, (o, r) => (l(), n("li", {
203
- key: `recent-${r}`,
204
- class: p(["spotlight-item", {
205
- "is-selected": e(t).selectedIndex === r + e(t).suggestedQuestions.length
206
- }]),
207
- role: "option",
208
- "aria-selected": e(t).selectedIndex === r + e(t).suggestedQuestions.length,
209
- onClick: (M) => f(r + e(t).suggestedQuestions.length)
210
- }, [
211
- s("span", pe, d(o), 1),
212
- i[12] || (i[12] = s("span", { class: "spotlight-item-hint" }, "历史", -1))
213
- ], 10, ce))), 128)),
214
- e(t).suggestedQuestions.length === 0 && e(t).recentQuestions.length === 0 ? (l(), n("li", ge, [...i[13] || (i[13] = [
215
- s("span", { class: "spotlight-item-label" }, "暂无推荐问法", -1)
216
- ])])) : g("", !0)
344
+ t("span", Oe, [
345
+ t("span", Ve, r(l.id), 1),
346
+ t("span", Fe, r(l.ownedBy || "SiliconFlow"), 1)
347
+ ]),
348
+ l.id === e(d).selectedModel ? (i(), n("span", Ue, " ✓ ")) : u("", !0)
349
+ ], 10, ze))), 128)),
350
+ !e(d).loading && e(d).models.length === 0 ? (i(), n("div", Ge, [...o[21] || (o[21] = [
351
+ t("strong", null, "暂时无法获取模型", -1),
352
+ t("span", null, "请检查 Spotlight Server 与模型服务商连接后重试。", -1)
353
+ ])])) : u("", !0)
354
+ ]),
355
+ t("footer", { class: "spotlight-model-dialog-footer" }, [
356
+ o[22] || (o[22] = t("span", null, "当前选择会保存在此项目的浏览器中。", -1)),
357
+ t("button", {
358
+ type: "button",
359
+ class: "spotlight-model-done",
360
+ onClick: b
361
+ }, " 完成 ")
362
+ ])
217
363
  ])
218
- ])) : g("", !0)
219
- ], 2)
220
- ]));
364
+ ], 544)
365
+ ]))
366
+ ], 64));
221
367
  }
222
368
  });
223
369
  export {
224
- Pe as default
370
+ st as default
225
371
  };
@@ -1 +1 @@
1
- {"version":3,"file":"runPipeline.d.ts","sourceRoot":"","sources":["../../src/remote/runPipeline.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,cAAc,EACd,uBAAuB,EACvB,kBAAkB,EAClB,mBAAmB,EACnB,kBAAkB,EAGlB,gBAAgB,EACjB,MAAM,8BAA8B,CAAC;AActC,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,4BAA4B,CAAC;AAE7D,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,2BAA2B,CAAC;AAE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