@inupedia/spotlight-vue 0.9.0 → 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.
Files changed (32) hide show
  1. package/dist/assets/spotlight-vue.css +1 -1
  2. package/dist/avatar/speech/spotlightSpeech.d.ts.map +1 -1
  3. package/dist/avatar/speech/spotlightSpeech.js +20 -31
  4. package/dist/avatar/voice/micAccess.d.ts +4 -0
  5. package/dist/avatar/voice/micAccess.d.ts.map +1 -0
  6. package/dist/avatar/voice/micAccess.js +26 -0
  7. package/dist/avatar/voice/phonePairing.d.ts +14 -0
  8. package/dist/avatar/voice/phonePairing.d.ts.map +1 -0
  9. package/dist/avatar/voice/phonePairing.js +30 -0
  10. package/dist/avatar/voice/usePhoneVoicePairing.d.ts +17 -0
  11. package/dist/avatar/voice/usePhoneVoicePairing.d.ts.map +1 -0
  12. package/dist/avatar/voice/usePhoneVoicePairing.js +88 -0
  13. package/dist/components/Live2dPanel.vue.d.ts +20 -0
  14. package/dist/components/Live2dPanel.vue.d.ts.map +1 -1
  15. package/dist/components/Live2dPanel.vue.js +1 -1
  16. package/dist/components/Live2dPanel2.vue.js +167 -62
  17. package/dist/components/SpotlightCommandPanel.vue.d.ts.map +1 -1
  18. package/dist/components/SpotlightCommandPanel.vue.js +1 -1
  19. package/dist/components/SpotlightCommandPanel2.vue.js +337 -191
  20. package/dist/components/SpotlightShell.vue.d.ts.map +1 -1
  21. package/dist/components/SpotlightShell.vue.js +2 -2
  22. package/dist/components/SpotlightShell2.vue.js +268 -255
  23. package/dist/node_modules/.pnpm/uqr@0.1.3/node_modules/uqr/dist/index.js +504 -0
  24. package/dist/remote/runPipeline.d.ts.map +1 -1
  25. package/dist/remote/runPipeline.js +103 -97
  26. package/dist/store/index.d.ts +1 -0
  27. package/dist/store/index.d.ts.map +1 -1
  28. package/dist/store/index.js +15 -13
  29. package/dist/store/modelStore.d.ts +16 -0
  30. package/dist/store/modelStore.d.ts.map +1 -0
  31. package/dist/store/modelStore.js +63 -0
  32. package/package.json +5 -3
@@ -1,38 +1,39 @@
1
1
  import { useAgentSessionStore as g } from "../session/agentSession.js";
2
2
  import { useSpotlightMemoryPreferenceStore as N } from "../store/memoryPreferenceStore.js";
3
- import { useSpotlightRuntimeStore as C } from "../store/runtimeStore.js";
4
- import { SPOTLIGHT_PIPELINE_STEP_IDS as a } from "../store/pipeline/constants.js";
5
- import { toolLaneStepId as h, resolveToolLane as P, toolLaneStepLabel as b } from "../store/pipeline/toolLane.js";
3
+ import { useSpotlightModelStore as C } from "../store/modelStore.js";
4
+ import { useSpotlightRuntimeStore as P } from "../store/runtimeStore.js";
5
+ import { SPOTLIGHT_PIPELINE_STEP_IDS as l } from "../store/pipeline/constants.js";
6
+ import { toolLaneStepId as h, resolveToolLane as E, toolLaneStepLabel as b } from "../store/pipeline/toolLane.js";
6
7
  import { getSpotlightAppClient as k, getSpotlightConfig as S } from "../plugin.js";
7
- import { executeRemoteHostTool as E, ensureHostToolsManifest as _ } from "./hostToolRunner.js";
8
+ import { executeRemoteHostTool as M, ensureHostToolsManifest as _ } from "./hostToolRunner.js";
8
9
  import { getSpotlightProjectId as A } from "./httpConfig.js";
9
10
  import { ensureSpotlightMeta as L } from "./meta.js";
10
11
  const R = /* @__PURE__ */ new WeakMap();
11
- function y(e, n, s) {
12
- const t = e.getSteps().find((i) => i.id === n);
12
+ function f(e, o, s) {
13
+ const t = e.getSteps().find((i) => i.id === o);
13
14
  if (t) return t;
14
- const o = { id: n, label: s, status: "pending" };
15
- return e.setSteps([...e.getSteps(), o]), o;
15
+ const n = { id: o, label: s, status: "pending" };
16
+ return e.setSteps([...e.getSteps(), n]), n;
16
17
  }
17
- function M() {
18
+ function q() {
18
19
  return new Promise((e) => {
19
20
  requestAnimationFrame(() => e());
20
21
  });
21
22
  }
22
- function q(e) {
23
+ function O(e) {
23
24
  return Array.isArray(e) ? e.flatMap((s, t) => {
24
25
  if (!s || typeof s != "object") return [];
25
- const o = s, i = typeof o.content == "string" ? o.content.trim() : "";
26
+ const n = s, i = typeof n.content == "string" ? n.content.trim() : "";
26
27
  if (!i) return [];
27
- const c = typeof o.title == "string" && o.title.trim() || typeof o.url == "string" && o.url.trim() || `资料 ${t + 1}`, u = typeof o.url == "string" ? o.url.trim() : "";
28
- return [[c, u && u !== c ? u : "", i].filter(Boolean).join(`
28
+ const a = typeof n.title == "string" && n.title.trim() || typeof n.url == "string" && n.url.trim() || `资料 ${t + 1}`, c = typeof n.url == "string" ? n.url.trim() : "";
29
+ return [[a, c && c !== a ? c : "", i].filter(Boolean).join(`
29
30
  `)];
30
31
  }).join(`
31
32
 
32
33
  `) : "";
33
34
  }
34
- function O(e, n) {
35
- const s = n.success ? "前端操作已执行。" : n.error || "前端操作执行失败。";
35
+ function j(e, o) {
36
+ const s = o.success ? "前端操作已执行。" : o.error || "前端操作执行失败。";
36
37
  return {
37
38
  id: e.id,
38
39
  name: e.name,
@@ -40,46 +41,46 @@ function O(e, n) {
40
41
  argsText: JSON.stringify(e.input ?? {}, null, 2),
41
42
  resultText: s,
42
43
  summary: s,
43
- errorCode: n.errorCode,
44
- trace: n.trace,
45
- status: n.success ? "done" : "error"
44
+ errorCode: o.errorCode,
45
+ trace: o.trace,
46
+ status: o.success ? "done" : "error"
46
47
  };
47
48
  }
48
- function j(e, n) {
49
- return P(e, n?.sideEffectByName?.get(e));
49
+ function H(e, o) {
50
+ return E(e, o?.sideEffectByName?.get(e));
50
51
  }
51
- function p(e, n, s) {
52
- const t = e.getSteps().find((o) => o.id === n);
53
- !t || t.status === "done" || t.status === "error" || e.setStep(n, "done", t.content ?? s);
52
+ function p(e, o, s) {
53
+ const t = e.getSteps().find((n) => n.id === o);
54
+ !t || t.status === "done" || t.status === "error" || e.setStep(o, "done", t.content ?? s);
54
55
  }
55
- function H(e, n) {
56
- p(e, a.understand);
57
- const s = h(n), t = b(n);
58
- y(e, s, t);
59
- const o = e.getSteps().find((i) => i.id === s);
60
- !o || o.status === "active" || o.status === "done" || e.setStep(s, "active", o.content);
56
+ function B(e, o) {
57
+ p(e, l.understand);
58
+ const s = h(o), t = b(o);
59
+ f(e, s, t);
60
+ const n = e.getSteps().find((i) => i.id === s);
61
+ !n || n.status === "active" || n.status === "done" || e.setStep(s, "active", n.content);
61
62
  }
62
- function I(e, n, s) {
63
- const t = j(n, s);
64
- return H(e, t), h(t);
63
+ function I(e, o, s) {
64
+ const t = H(o, s);
65
+ return B(e, t), h(t);
65
66
  }
66
- function B(e, n, s, t) {
67
- const o = I(e, n.name, t);
68
- e.appendToolCallsToStep(o, [O(n, s)]);
67
+ function D(e, o, s, t) {
68
+ const n = I(e, o.name, t);
69
+ e.appendToolCallsToStep(n, [j(o, s)]);
69
70
  }
70
- function T(e, n, s, t, o) {
71
- y(e, n, s), e.setStep(n, t, o);
71
+ function T(e, o, s, t, n) {
72
+ f(e, o, s), e.setStep(o, t, n);
72
73
  }
73
- function D(e) {
74
- const n = e.status === "completed" ? "done" : e.status === "failed" ? "error" : "running";
74
+ function F(e) {
75
+ const o = e.status === "completed" ? "done" : e.status === "failed" ? "error" : "running";
75
76
  return e.type === "knowledge_search" ? {
76
77
  id: e.id,
77
78
  name: e.tool,
78
79
  displayName: e.displayName,
79
80
  argsText: JSON.stringify({ query: e.query }, null, 2),
80
- resultText: q(e.result),
81
+ resultText: O(e.result),
81
82
  summary: e.summary,
82
- status: n
83
+ status: o
83
84
  } : {
84
85
  id: e.id,
85
86
  name: e.tool,
@@ -89,64 +90,64 @@ function D(e) {
89
90
  summary: e.summary ?? e.error?.message,
90
91
  errorCode: e.error?.code,
91
92
  trace: e.trace,
92
- status: n
93
+ status: o
93
94
  };
94
95
  }
95
- async function F(e, n, s) {
96
- if (n.type !== "ping") {
97
- if (n.type === "turn.started") {
96
+ async function $(e, o, s) {
97
+ if (o.type !== "ping") {
98
+ if (o.type === "turn.started") {
98
99
  T(
99
100
  e,
100
- a.understand,
101
+ l.understand,
101
102
  "理解问题",
102
103
  "active",
103
104
  "正在理解您的问题。"
104
105
  );
105
106
  return;
106
107
  }
107
- if (n.type === "item.started" || n.type === "item.updated" || n.type === "item.completed") {
108
- const t = n.item;
108
+ if (o.type === "item.started" || o.type === "item.updated" || o.type === "item.completed") {
109
+ const t = o.item;
109
110
  if (t.type === "reasoning") {
110
111
  if (t.category === "voice")
111
112
  return;
112
113
  if (t.category === "routing" || t.category === "memory")
113
114
  T(
114
115
  e,
115
- a.understand,
116
+ l.understand,
116
117
  "理解问题",
117
- n.type === "item.completed" ? "done" : "active",
118
+ o.type === "item.completed" ? "done" : "active",
118
119
  t.summary
119
120
  );
120
121
  else {
121
- const o = /页面|操作|执行/u.test(t.summary), i = o ? a.act : a.gather;
122
- y(e, i, o ? "操作页面" : "获取信息"), e.setStep(
122
+ const n = /页面|操作|执行/u.test(t.summary), i = n ? l.act : l.gather;
123
+ f(e, i, n ? "操作页面" : "获取信息"), e.setStep(
123
124
  i,
124
- n.type === "item.completed" ? "done" : "active",
125
+ o.type === "item.completed" ? "done" : "active",
125
126
  t.summary
126
127
  );
127
128
  }
128
129
  return;
129
130
  }
130
131
  if (t.type === "skill_use") {
131
- const o = "skills", i = y(e, o, "使用 Skill"), c = `- ${t.displayName}${t.skill === t.displayName ? "" : `(${t.skill})`}`, u = i.content?.includes(c) ? i.content : [i.content, c].filter(Boolean).join(`
132
+ const n = "skills", i = f(e, n, "使用 Skill"), a = `- ${t.displayName}${t.skill === t.displayName ? "" : `(${t.skill})`}`, c = i.content?.includes(a) ? i.content : [i.content, a].filter(Boolean).join(`
132
133
  `);
133
- e.setStep(o, t.status === "failed" ? "error" : "done", u), g().setInvokedSkills([
134
+ e.setStep(n, t.status === "failed" ? "error" : "done", c), g().setInvokedSkills([
134
135
  ...g().invokedSkills.filter(
135
136
  (d) => d.skillName !== t.skill
136
137
  ),
137
- { skillName: t.skill, invokedAt: n.at }
138
+ { skillName: t.skill, invokedAt: o.at }
138
139
  ]);
139
140
  return;
140
141
  }
141
142
  if (t.type === "tool_call" || t.type === "knowledge_search") {
142
- const o = (t.type === "tool_call", t.tool), i = I(e, o, s);
143
- e.appendToolCallsToStep(i, [D(t)]), (t.status === "completed" || t.status === "failed") && p(e, i);
143
+ const n = (t.type === "tool_call", t.tool), i = I(e, n, s);
144
+ e.appendToolCallsToStep(i, [F(t)]), (t.status === "completed" || t.status === "failed") && p(e, i);
144
145
  return;
145
146
  }
146
147
  if (t.type === "memory") {
147
148
  T(
148
149
  e,
149
- a.understand,
150
+ l.understand,
150
151
  "理解问题",
151
152
  t.action === "reuse" ? "done" : "active",
152
153
  t.summary
@@ -154,7 +155,7 @@ async function F(e, n, s) {
154
155
  return;
155
156
  }
156
157
  if (t.type === "agent_message") {
157
- p(e, a.understand), p(e, a.gather), p(e, a.act), y(e, a.answer, "回答"), e.setStep(a.answer, "done", t.text.trim());
158
+ p(e, l.understand), p(e, l.gather), p(e, l.act), f(e, l.answer, "回答"), e.setStep(l.answer, "done", t.text.trim());
158
159
  return;
159
160
  }
160
161
  if (t.type === "voice_sentence")
@@ -162,17 +163,21 @@ async function F(e, n, s) {
162
163
  t.type === "error" && e.setError(t.message);
163
164
  return;
164
165
  }
165
- n.type === "turn.failed" && e.setError(n.error.message);
166
+ o.type === "turn.failed" && e.setError(o.error.message);
166
167
  }
167
168
  }
168
- async function ee(e) {
169
+ async function oe(e) {
169
170
  await Promise.allSettled([
170
171
  k().initialize(e),
171
172
  L(e)
172
173
  ]);
173
174
  }
174
- async function J(e, n, s) {
175
- const t = g(), o = C(), i = N();
175
+ async function J(e, o, s) {
176
+ const t = g(), n = P(), i = N(), a = C();
177
+ if (await a.loadModels(), !a.selectedModel)
178
+ throw new Error(
179
+ a.error ? `无法加载可用模型列表:${a.error}` : "当前没有可用模型,请先刷新模型列表。"
180
+ );
176
181
  return {
177
182
  hostManifest: await _(),
178
183
  payload: {
@@ -181,6 +186,7 @@ async function J(e, n, s) {
181
186
  interactionMode: s?.interactionMode ?? "text",
182
187
  memorySubjectId: S().getMemorySubjectId?.() ?? void 0,
183
188
  memoryRefreshRequested: s?.forceMemoryRefresh === !0,
189
+ model: a.selectedModel || void 0,
184
190
  uiContext: S().getUiContext?.() ?? {},
185
191
  sessionState: {
186
192
  sessionId: t.sessionId,
@@ -198,55 +204,55 @@ async function J(e, n, s) {
198
204
  memoryWriteEnabled: !0
199
205
  },
200
206
  runtimeState: {
201
- activeDomain: o.activeDomain,
202
- activeTarget: o.activeTarget,
203
- activeAction: o.activeAction,
204
- resumableAction: o.resumableAction,
205
- lastResolvedTarget: o.lastResolvedTarget
207
+ activeDomain: n.activeDomain,
208
+ activeTarget: n.activeTarget,
209
+ activeAction: n.activeAction,
210
+ resumableAction: n.resumableAction,
211
+ lastResolvedTarget: n.lastResolvedTarget
206
212
  }
207
213
  }
208
214
  };
209
215
  }
210
- async function te(e, n, s) {
211
- const t = n.getSignal(), { payload: o, hostManifest: i } = await J(
216
+ async function ne(e, o, s) {
217
+ const t = o.getSignal(), { payload: n, hostManifest: i } = await J(
212
218
  e,
213
219
  t,
214
220
  s
215
- ), c = new Set(i.tools.map((r) => r.name)), u = {
221
+ ), a = new Set(i.tools.map((r) => r.name)), c = {
216
222
  sideEffectByName: new Map(
217
223
  i.tools.map((r) => [r.name, r.sideEffect])
218
224
  )
219
- }, d = k(), w = g(), x = await d.startThread(w.sessionId, t), f = await d.startTurn(x.id, o, t);
220
- t && (R.set(t, f.id), t.addEventListener(
225
+ }, d = k(), w = g(), x = await d.startThread(w.sessionId, t), y = await d.startTurn(x.id, n, t);
226
+ t && (R.set(t, y.id), t.addEventListener(
221
227
  "abort",
222
228
  () => {
223
- d.cancelTurn(f.id);
229
+ d.cancelTurn(y.id);
224
230
  },
225
231
  { once: !0 }
226
232
  ));
227
- for await (const r of d.streamTurn(f.id, t)) {
233
+ for await (const r of d.streamTurn(y.id, t)) {
228
234
  if ((r.type === "item.started" || r.type === "item.updated" || r.type === "item.completed") && r.item.type === "voice_sentence" && s?.onVoiceSentence?.({
229
235
  index: r.item.index,
230
236
  text: r.item.text,
231
237
  generation: r.item.generation
232
- }), await F(n, r, u), (r.type === "item.started" || r.type === "item.updated") && r.item.type === "tool_call" && r.item.status === "waiting_for_client" && r.item.clientRequest) {
233
- const l = {
238
+ }), await $(o, r, c), (r.type === "item.started" || r.type === "item.updated") && r.item.type === "tool_call" && r.item.status === "waiting_for_client" && r.item.clientRequest) {
239
+ const u = {
234
240
  id: r.item.id,
235
241
  name: r.item.tool,
236
242
  input: r.item.arguments,
237
243
  displayName: r.item.displayName
238
244
  }, m = !(r.item.clientRequest.approvalRequired === !0) || !!await S().approveTool?.({
239
- name: l.name,
240
- displayName: l.displayName,
241
- input: l.input,
245
+ name: u.name,
246
+ displayName: u.displayName,
247
+ input: u.input,
242
248
  reason: r.item.clientRequest.approvalReason
243
- }) ? await E(l, n, { allowedHostNames: c }) : {
249
+ }) ? await M(u, o, { allowedHostNames: a }) : {
244
250
  success: !1,
245
251
  error: "Tool execution was not approved",
246
252
  errorCode: "TOOL_APPROVAL_REQUIRED",
247
253
  trace: []
248
254
  };
249
- B(n, l, m, u), await d.submitToolResult(f.id, {
255
+ D(o, u, m, c), await d.submitToolResult(y.id, {
250
256
  correlationId: r.item.clientRequest.correlationId,
251
257
  success: m.success,
252
258
  output: m.data,
@@ -257,33 +263,33 @@ async function te(e, n, s) {
257
263
  }, t);
258
264
  continue;
259
265
  }
260
- if (await M(), r.type === "turn.failed")
266
+ if (await q(), r.type === "turn.failed")
261
267
  throw new Error(r.error.message);
262
268
  if (r.type === "turn.completed") {
263
- const l = r.metadata ?? {}, v = l.sessionPatch;
269
+ const u = r.metadata ?? {}, v = u.sessionPatch;
264
270
  return v && w.applySessionPatch(v), {
265
271
  command: null,
266
- memoryReplay: l.memoryReplay ?? null,
267
- memoryDecision: l.memoryDecision ?? null,
272
+ memoryReplay: u.memoryReplay ?? null,
273
+ memoryDecision: u.memoryDecision ?? null,
268
274
  assistantReply: r.finalResponse
269
275
  };
270
276
  }
271
277
  }
272
278
  return { command: null };
273
279
  }
274
- async function $(e) {
280
+ async function z(e) {
275
281
  await k().cancelTurn(e);
276
282
  }
277
- function ne(e) {
283
+ function re(e) {
278
284
  if (!e) return;
279
- const n = R.get(e);
280
- n && (R.delete(e), $(n));
285
+ const o = R.get(e);
286
+ o && (R.delete(e), z(o));
281
287
  }
282
288
  export {
283
- F as applyLifecycleEvent,
284
- $ as cancelRemoteSpotlightRun,
285
- ne as cancelRemoteSpotlightRunForSignal,
286
- te as runRemoteSpotlightPipeline,
287
- B as settleHostToolCall,
288
- ee as warmupSpotlightRemoteContext
289
+ $ as applyLifecycleEvent,
290
+ z as cancelRemoteSpotlightRun,
291
+ re as cancelRemoteSpotlightRunForSignal,
292
+ ne as runRemoteSpotlightPipeline,
293
+ D as settleHostToolCall,
294
+ oe as warmupSpotlightRemoteContext
289
295
  };
@@ -1,6 +1,7 @@
1
1
  export { useSpotlightStore, SpotlightIntent, SPOTLIGHT_INTENT_LABELS, ProgressSubIntent, PROGRESS_SUB_INTENT_LABELS, InvestmentSubIntent, INVESTMENT_SUB_INTENT_LABELS, QualitySubIntent, QUALITY_SUB_INTENT_LABELS, SafetySubIntent, SAFETY_SUB_INTENT_LABELS, SUB_INTENT_CONFIG, type AgentStep, type IntentWithReason, type SubIntentConfig, type SpotlightSkillPermissionRequest, } from "./spotlightStore.js";
2
2
  export { SpotlightCommandDomain, SpotlightCommandScope, type SpotlightCommand, type SpotlightCommandAction, type SpotlightCommandTarget, type SpotlightVideoChannelId, } from "./types.js";
3
3
  export { useSpotlightRuntimeStore } from "./runtimeStore.js";
4
+ export { useSpotlightModelStore } from "./modelStore.js";
4
5
  export { useAgentSessionStore } from "../session/agentSession.js";
5
6
  export { useSpotlightMemoryPreferenceStore, readSpotlightMemoryEnabled, } from "./memoryPreferenceStore.js";
6
7
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/store/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,iBAAiB,EACjB,eAAe,EACf,uBAAuB,EACvB,iBAAiB,EACjB,0BAA0B,EAC1B,mBAAmB,EACnB,4BAA4B,EAC5B,gBAAgB,EAChB,yBAAyB,EACzB,eAAe,EACf,wBAAwB,EACxB,iBAAiB,EACjB,KAAK,SAAS,EACd,KAAK,gBAAgB,EACrB,KAAK,eAAe,EACpB,KAAK,+BAA+B,GACrC,MAAM,qBAAqB,CAAC;AAE7B,OAAO,EACL,sBAAsB,EACtB,qBAAqB,EACrB,KAAK,gBAAgB,EACrB,KAAK,sBAAsB,EAC3B,KAAK,sBAAsB,EAC3B,KAAK,uBAAuB,GAC7B,MAAM,YAAY,CAAC;AAEpB,OAAO,EAAE,wBAAwB,EAAE,MAAM,mBAAmB,CAAC;AAC7D,OAAO,EAAE,oBAAoB,EAAE,MAAM,4BAA4B,CAAC;AAClE,OAAO,EACL,iCAAiC,EACjC,0BAA0B,GAC3B,MAAM,4BAA4B,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/store/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,iBAAiB,EACjB,eAAe,EACf,uBAAuB,EACvB,iBAAiB,EACjB,0BAA0B,EAC1B,mBAAmB,EACnB,4BAA4B,EAC5B,gBAAgB,EAChB,yBAAyB,EACzB,eAAe,EACf,wBAAwB,EACxB,iBAAiB,EACjB,KAAK,SAAS,EACd,KAAK,gBAAgB,EACrB,KAAK,eAAe,EACpB,KAAK,+BAA+B,GACrC,MAAM,qBAAqB,CAAC;AAE7B,OAAO,EACL,sBAAsB,EACtB,qBAAqB,EACrB,KAAK,gBAAgB,EACrB,KAAK,sBAAsB,EAC3B,KAAK,sBAAsB,EAC3B,KAAK,uBAAuB,GAC7B,MAAM,YAAY,CAAC;AAEpB,OAAO,EAAE,wBAAwB,EAAE,MAAM,mBAAmB,CAAC;AAC7D,OAAO,EAAE,sBAAsB,EAAE,MAAM,iBAAiB,CAAC;AACzD,OAAO,EAAE,oBAAoB,EAAE,MAAM,4BAA4B,CAAC;AAClE,OAAO,EACL,iCAAiC,EACjC,0BAA0B,GAC3B,MAAM,4BAA4B,CAAC"}
@@ -1,8 +1,9 @@
1
1
  import { useSpotlightStore as S } from "./spotlightStore.js";
2
- import { INVESTMENT_SUB_INTENT_LABELS as r, InvestmentSubIntent as n, PROGRESS_SUB_INTENT_LABELS as T, ProgressSubIntent as E, QUALITY_SUB_INTENT_LABELS as I, QualitySubIntent as _, SAFETY_SUB_INTENT_LABELS as N, SPOTLIGHT_INTENT_LABELS as m, SUB_INTENT_CONFIG as p, SafetySubIntent as L, SpotlightCommandDomain as i, SpotlightCommandScope as u, SpotlightIntent as B } from "./types.js";
3
- import { useSpotlightRuntimeStore as l } from "./runtimeStore.js";
2
+ import { INVESTMENT_SUB_INTENT_LABELS as r, InvestmentSubIntent as n, PROGRESS_SUB_INTENT_LABELS as T, ProgressSubIntent as E, QUALITY_SUB_INTENT_LABELS as I, QualitySubIntent as _, SAFETY_SUB_INTENT_LABELS as m, SPOTLIGHT_INTENT_LABELS as p, SUB_INTENT_CONFIG as N, SafetySubIntent as i, SpotlightCommandDomain as L, SpotlightCommandScope as l, SpotlightIntent as u } from "./types.js";
3
+ import { useSpotlightRuntimeStore as s } from "./runtimeStore.js";
4
+ import { useSpotlightModelStore as f } from "./modelStore.js";
4
5
  import { useAgentSessionStore as A } from "../session/agentSession.js";
5
- import { readSpotlightMemoryEnabled as f, useSpotlightMemoryPreferenceStore as h } from "./memoryPreferenceStore.js";
6
+ import { readSpotlightMemoryEnabled as x, useSpotlightMemoryPreferenceStore as U } from "./memoryPreferenceStore.js";
6
7
  export {
7
8
  r as INVESTMENT_SUB_INTENT_LABELS,
8
9
  n as InvestmentSubIntent,
@@ -10,16 +11,17 @@ export {
10
11
  E as ProgressSubIntent,
11
12
  I as QUALITY_SUB_INTENT_LABELS,
12
13
  _ as QualitySubIntent,
13
- N as SAFETY_SUB_INTENT_LABELS,
14
- m as SPOTLIGHT_INTENT_LABELS,
15
- p as SUB_INTENT_CONFIG,
16
- L as SafetySubIntent,
17
- i as SpotlightCommandDomain,
18
- u as SpotlightCommandScope,
19
- B as SpotlightIntent,
20
- f as readSpotlightMemoryEnabled,
14
+ m as SAFETY_SUB_INTENT_LABELS,
15
+ p as SPOTLIGHT_INTENT_LABELS,
16
+ N as SUB_INTENT_CONFIG,
17
+ i as SafetySubIntent,
18
+ L as SpotlightCommandDomain,
19
+ l as SpotlightCommandScope,
20
+ u as SpotlightIntent,
21
+ x as readSpotlightMemoryEnabled,
21
22
  A as useAgentSessionStore,
22
- h as useSpotlightMemoryPreferenceStore,
23
- l as useSpotlightRuntimeStore,
23
+ U as useSpotlightMemoryPreferenceStore,
24
+ f as useSpotlightModelStore,
25
+ s as useSpotlightRuntimeStore,
24
26
  S as useSpotlightStore
25
27
  };
@@ -0,0 +1,16 @@
1
+ export type SpotlightModel = {
2
+ id: string;
3
+ ownedBy?: string;
4
+ };
5
+ export declare const useSpotlightModelStore: import("pinia").StoreDefinition<"spotlight-model", {
6
+ models: SpotlightModel[];
7
+ selectedModel: string;
8
+ modelsLoaded: boolean;
9
+ loading: boolean;
10
+ error: string;
11
+ }, {}, {
12
+ loadModels(force?: boolean): Promise<void>;
13
+ selectModel(modelId: string): void;
14
+ persistSelection(): void;
15
+ }>;
16
+ //# sourceMappingURL=modelStore.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"modelStore.d.ts","sourceRoot":"","sources":["../../src/store/modelStore.ts"],"names":[],"mappings":"AAKA,MAAM,MAAM,cAAc,GAAG;IAAE,EAAE,EAAE,MAAM,CAAC;IAAC,OAAO,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC;AAgB9D,eAAO,MAAM,sBAAsB;YAEjB,cAAc,EAAE;;;;;;;yBA+CT,MAAM;;EAe7B,CAAC"}
@@ -0,0 +1,63 @@
1
+ import { defineStore as n } from "pinia";
2
+ import { getSpotlightConfig as c } from "../plugin.js";
3
+ import { appendSpotlightProjectQuery as m } from "../remote/httpConfig.js";
4
+ import { getSpotlightJson as h } from "../remote/serverJson.js";
5
+ let s = null;
6
+ function a() {
7
+ return `spotlight:model:${c().projectId}`;
8
+ }
9
+ function d() {
10
+ try {
11
+ return globalThis.localStorage?.getItem(a()) ?? "";
12
+ } catch {
13
+ return "";
14
+ }
15
+ }
16
+ const y = n("spotlight-model", {
17
+ state: () => ({
18
+ models: [],
19
+ selectedModel: d(),
20
+ modelsLoaded: !1,
21
+ loading: !1,
22
+ error: ""
23
+ }),
24
+ actions: {
25
+ async loadModels(l = !1) {
26
+ if (s) return s;
27
+ if (this.modelsLoaded && !l) return;
28
+ this.loading = !0, this.error = "";
29
+ const o = (async () => {
30
+ try {
31
+ const e = await h(m("/v1/meta/models")), r = Array.isArray(e.models) ? e.models.filter(
32
+ (t) => t && typeof t.id == "string" && t.id.trim()
33
+ ) : [];
34
+ this.models = r;
35
+ const i = this.selectedModel || d();
36
+ this.selectedModel = r.some((t) => t.id === i) ? i : r.some((t) => t.id === e.defaultModel) ? e.defaultModel : r[0]?.id ?? "", this.modelsLoaded = !0, this.persistSelection();
37
+ } catch (e) {
38
+ this.error = e instanceof Error ? e.message : String(e);
39
+ } finally {
40
+ this.loading = !1;
41
+ }
42
+ })();
43
+ s = o;
44
+ try {
45
+ await o;
46
+ } finally {
47
+ s === o && (s = null);
48
+ }
49
+ },
50
+ selectModel(l) {
51
+ this.models.some((o) => o.id === l) && (this.selectedModel = l, this.persistSelection());
52
+ },
53
+ persistSelection() {
54
+ try {
55
+ this.selectedModel && globalThis.localStorage?.setItem(a(), this.selectedModel);
56
+ } catch {
57
+ }
58
+ }
59
+ }
60
+ });
61
+ export {
62
+ y as useSpotlightModelStore
63
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@inupedia/spotlight-vue",
3
- "version": "0.9.0",
3
+ "version": "0.9.2",
4
4
  "description": "Thin Vue runtime for Inupedia Spotlight Client Tools",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -89,10 +89,12 @@
89
89
  "dist"
90
90
  ],
91
91
  "dependencies": {
92
+ "lucide-vue-next": "^0.543.0",
92
93
  "prettier": "^3.8.1",
94
+ "uqr": "^0.1.3",
93
95
  "yaml": "^2.8.4",
94
- "@inupedia/spotlight-protocol": "0.9.0",
95
- "@inupedia/spotlight-client": "0.9.0"
96
+ "@inupedia/spotlight-protocol": "0.9.2",
97
+ "@inupedia/spotlight-client": "0.9.2"
96
98
  },
97
99
  "peerDependencies": {
98
100
  "@inspira-ui/plugins": "^0.0.2",