@inupedia/spotlight-vue 0.1.1 → 0.1.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/_virtual/_plugin-vue_export-helper.js +0 -1
- package/dist/avatar/config.js +0 -1
- package/dist/avatar/speech/live2dAnswerSpeechPolicy.js +0 -1
- package/dist/avatar/speech/live2dBriefingSummarizer.js +0 -1
- package/dist/avatar/speech/live2dStreamSpeech.js +0 -1
- package/dist/avatar/speech/live2dTtsPlayback.js +0 -1
- package/dist/avatar/speech/llmUtils.js +0 -1
- package/dist/avatar/speech/spotlightSpeech.js +0 -1
- package/dist/avatar/spine/live2dApp.js +0 -1
- package/dist/avatar/spine/spineAvatar.js +0 -1
- package/dist/avatar/spine/spineLipSync.js +0 -1
- package/dist/components/InspiraCardSpotlight.js +0 -1
- package/dist/components/InspiraCardSpotlight.vue.js +0 -1
- package/dist/components/Live2dPanel.vue.js +0 -1
- package/dist/components/Live2dPanel2.vue.js +0 -1
- package/dist/components/OfficialBorderBeam.js +0 -1
- package/dist/components/OfficialBorderBeam.vue.js +0 -1
- package/dist/components/SpotlightCommandPanel.vue.js +0 -1
- package/dist/components/SpotlightCommandPanel2.vue.js +0 -1
- package/dist/components/SpotlightMarkdownPreview.vue.js +0 -1
- package/dist/components/SpotlightMarkdownPreview2.vue.js +0 -1
- package/dist/components/SpotlightRoot.vue.js +0 -1
- package/dist/components/SpotlightRoot2.vue.js +0 -1
- package/dist/components/SpotlightShell.vue.js +0 -1
- package/dist/components/SpotlightShell2.vue.js +0 -1
- package/dist/components/SpotlightThinking.vue.js +0 -1
- package/dist/components/SpotlightThinking2.vue.js +0 -1
- package/dist/components/index.d.ts +3 -0
- package/dist/components/index.d.ts.map +1 -0
- package/dist/components/index.js +6 -0
- package/dist/composables/useSpotlightCommandShortcuts.js +0 -1
- package/dist/composables/useSpotlightPanelUi.js +0 -1
- package/dist/config.js +0 -1
- package/dist/constants/toolNames.js +0 -1
- package/dist/host/defineApp.js +0 -1
- package/dist/host/defineHost.js +0 -1
- package/dist/host/mergeSkills.js +0 -1
- package/dist/host/normalizeSkills.js +0 -1
- package/dist/host/skillExecution.js +0 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +113 -117
- package/dist/markdown/index.d.ts +2 -0
- package/dist/markdown/index.d.ts.map +1 -0
- package/dist/markdown/index.js +6 -0
- package/dist/mountShell.js +0 -1
- package/dist/plugin.js +0 -1
- package/dist/remote/audio.js +0 -1
- package/dist/remote/hostToolRunner.js +3 -4
- package/dist/remote/httpConfig.js +0 -1
- package/dist/remote/index.js +0 -1
- package/dist/remote/meta.js +0 -1
- package/dist/remote/runPipeline.d.ts.map +1 -1
- package/dist/remote/runPipeline.js +46 -44
- package/dist/remote/serverJson.js +0 -1
- package/dist/resolveConfig.js +0 -1
- package/dist/session/agentSession.js +0 -1
- package/dist/skills/index.js +0 -1
- package/dist/skills/matching.js +0 -1
- package/dist/skills/parser.js +0 -1
- package/dist/skills/skillFrontmatterParse.js +0 -1
- package/dist/skills/skillListing.js +0 -1
- package/dist/skills/skillPaths.js +0 -1
- package/dist/store/capabilities.js +0 -1
- package/dist/store/constants.js +0 -1
- package/dist/store/index.d.ts +5 -0
- package/dist/store/index.d.ts.map +1 -0
- package/dist/store/index.js +22 -0
- package/dist/store/live2dOverlayStore.js +0 -1
- package/dist/store/live2dSpeechStore.js +0 -1
- package/dist/store/live2dVoiceChannelStore.js +0 -1
- package/dist/store/pipeline/api.js +0 -1
- package/dist/store/pipeline/constants.js +0 -1
- package/dist/store/pipeline/displayText.js +0 -1
- package/dist/store/pipeline/errors.js +0 -1
- package/dist/store/pipeline/spotlightMarkdown.d.ts.map +1 -1
- package/dist/store/pipeline/spotlightMarkdown.js +51 -46
- package/dist/store/pipeline/steps.js +0 -1
- package/dist/store/pipeline/toolDisplay.js +0 -1
- package/dist/store/pipeline/typing.js +0 -1
- package/dist/store/recent.js +0 -1
- package/dist/store/runtimeStore.js +0 -1
- package/dist/store/spotlightStore.js +14 -16
- package/dist/store/storeSink.js +0 -1
- package/dist/store/types.js +0 -1
- package/dist/testing/index.d.ts +3 -0
- package/dist/testing/index.d.ts.map +1 -0
- package/dist/testing/index.js +6 -0
- package/dist/utils/devConsole.js +0 -1
- package/dist/utils/requestTimeout.js +0 -1
- package/dist/workflow/createOperateDefinition.js +0 -1
- package/dist/workflow/index.d.ts +6 -0
- package/dist/workflow/index.d.ts.map +1 -0
- package/dist/workflow/index.js +20 -0
- package/dist/workflow/operate.js +0 -1
- package/dist/workflow/runHostTool.js +0 -1
- package/dist/workflow/sessionControl.js +0 -1
- package/dist/workflow/shared.js +0 -1
- package/package.json +72 -8
- package/dist/_virtual/_plugin-vue_export-helper.js.map +0 -1
- package/dist/avatar/config.js.map +0 -1
- package/dist/avatar/speech/live2dAnswerSpeechPolicy.js.map +0 -1
- package/dist/avatar/speech/live2dBriefingSummarizer.js.map +0 -1
- package/dist/avatar/speech/live2dStreamSpeech.js.map +0 -1
- package/dist/avatar/speech/live2dTtsPlayback.js.map +0 -1
- package/dist/avatar/speech/llmUtils.js.map +0 -1
- package/dist/avatar/speech/spotlightSpeech.js.map +0 -1
- package/dist/avatar/spine/live2dApp.js.map +0 -1
- package/dist/avatar/spine/spineAvatar.js.map +0 -1
- package/dist/avatar/spine/spineLipSync.js.map +0 -1
- package/dist/components/InspiraCardSpotlight.js.map +0 -1
- package/dist/components/InspiraCardSpotlight.vue.js.map +0 -1
- package/dist/components/Live2dPanel.vue.js.map +0 -1
- package/dist/components/Live2dPanel2.vue.js.map +0 -1
- package/dist/components/OfficialBorderBeam.js.map +0 -1
- package/dist/components/OfficialBorderBeam.vue.js.map +0 -1
- package/dist/components/SpotlightCommandPanel.vue.js.map +0 -1
- package/dist/components/SpotlightCommandPanel2.vue.js.map +0 -1
- package/dist/components/SpotlightMarkdownPreview.vue.js.map +0 -1
- package/dist/components/SpotlightMarkdownPreview2.vue.js.map +0 -1
- package/dist/components/SpotlightRoot.vue.js.map +0 -1
- package/dist/components/SpotlightRoot2.vue.js.map +0 -1
- package/dist/components/SpotlightShell.vue.js.map +0 -1
- package/dist/components/SpotlightShell2.vue.js.map +0 -1
- package/dist/components/SpotlightThinking.vue.js.map +0 -1
- package/dist/components/SpotlightThinking2.vue.js.map +0 -1
- package/dist/composables/useSpotlightCommandShortcuts.js.map +0 -1
- package/dist/composables/useSpotlightPanelUi.js.map +0 -1
- package/dist/config.js.map +0 -1
- package/dist/constants/toolNames.js.map +0 -1
- package/dist/host/defineApp.js.map +0 -1
- package/dist/host/defineHost.js.map +0 -1
- package/dist/host/mergeSkills.js.map +0 -1
- package/dist/host/normalizeSkills.js.map +0 -1
- package/dist/host/skillExecution.js.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/mountShell.js.map +0 -1
- package/dist/plugin.js.map +0 -1
- package/dist/remote/audio.js.map +0 -1
- package/dist/remote/hostToolRunner.js.map +0 -1
- package/dist/remote/httpConfig.js.map +0 -1
- package/dist/remote/index.js.map +0 -1
- package/dist/remote/meta.js.map +0 -1
- package/dist/remote/runPipeline.js.map +0 -1
- package/dist/remote/serverJson.js.map +0 -1
- package/dist/resolveConfig.js.map +0 -1
- package/dist/session/agentSession.js.map +0 -1
- package/dist/skills/index.js.map +0 -1
- package/dist/skills/matching.js.map +0 -1
- package/dist/skills/parser.js.map +0 -1
- package/dist/skills/skillFrontmatterParse.js.map +0 -1
- package/dist/skills/skillListing.js.map +0 -1
- package/dist/skills/skillPaths.js.map +0 -1
- package/dist/store/capabilities.js.map +0 -1
- package/dist/store/constants.js.map +0 -1
- package/dist/store/live2dOverlayStore.js.map +0 -1
- package/dist/store/live2dSpeechStore.js.map +0 -1
- package/dist/store/live2dVoiceChannelStore.js.map +0 -1
- package/dist/store/pipeline/api.js.map +0 -1
- package/dist/store/pipeline/constants.js.map +0 -1
- package/dist/store/pipeline/displayText.js.map +0 -1
- package/dist/store/pipeline/errors.js.map +0 -1
- package/dist/store/pipeline/spotlightMarkdown.js.map +0 -1
- package/dist/store/pipeline/steps.js.map +0 -1
- package/dist/store/pipeline/toolDisplay.js.map +0 -1
- package/dist/store/pipeline/typing.js.map +0 -1
- package/dist/store/recent.js.map +0 -1
- package/dist/store/runtimeStore.js.map +0 -1
- package/dist/store/spotlightStore.js.map +0 -1
- package/dist/store/storeSink.js.map +0 -1
- package/dist/store/types.js.map +0 -1
- package/dist/utils/devConsole.js.map +0 -1
- package/dist/utils/requestTimeout.js.map +0 -1
- package/dist/workflow/createOperateDefinition.js.map +0 -1
- package/dist/workflow/operate.js.map +0 -1
- package/dist/workflow/runHostTool.js.map +0 -1
- package/dist/workflow/sessionControl.js.map +0 -1
- package/dist/workflow/shared.js.map +0 -1
|
@@ -4,13 +4,13 @@ import { getSkillsPoolForRun as x } from "../skills/index.js";
|
|
|
4
4
|
import { useAgentSessionStore as w } from "../session/agentSession.js";
|
|
5
5
|
import { useSpotlightRuntimeStore as E } from "../store/runtimeStore.js";
|
|
6
6
|
import { SPOTLIGHT_PIPELINE_STEP_IDS as r } from "../store/pipeline/constants.js";
|
|
7
|
-
import { isLoopPlanningChunk as O, splitIntentStepContent as $, splitToolStepContent as
|
|
8
|
-
import {
|
|
9
|
-
import { executeRemoteHostTool as
|
|
10
|
-
import { getSpotlightServerBase as g, buildSpotlightJsonHeaders as m, getSpotlightProjectId as
|
|
11
|
-
import { ensureSpotlightMeta as
|
|
7
|
+
import { isLoopPlanningChunk as O, splitIntentStepContent as $, splitToolStepContent as H, composeToolStepContent as L } from "../store/pipeline/displayText.js";
|
|
8
|
+
import { getSpotlightHostAdapter as A, getSpotlightConfig as q } from "../plugin.js";
|
|
9
|
+
import { executeRemoteHostTool as F, ensureHostToolsManifest as I } from "./hostToolRunner.js";
|
|
10
|
+
import { getSpotlightServerBase as g, buildSpotlightJsonHeaders as m, getSpotlightProjectId as J } from "./httpConfig.js";
|
|
11
|
+
import { ensureSpotlightMeta as W } from "./meta.js";
|
|
12
12
|
const y = /* @__PURE__ */ new WeakMap();
|
|
13
|
-
function
|
|
13
|
+
function D(t) {
|
|
14
14
|
return t.type !== "host_action_request" && t.type !== "run_completed" && t.type !== "run_error" && t.type !== "ping";
|
|
15
15
|
}
|
|
16
16
|
function a(t, e, o) {
|
|
@@ -19,12 +19,12 @@ function a(t, e, o) {
|
|
|
19
19
|
const n = { id: e, label: o, status: "pending" };
|
|
20
20
|
return t.setSteps([...t.getSteps(), n]), n;
|
|
21
21
|
}
|
|
22
|
-
function
|
|
22
|
+
function M() {
|
|
23
23
|
return new Promise((t) => {
|
|
24
24
|
requestAnimationFrame(() => t());
|
|
25
25
|
});
|
|
26
26
|
}
|
|
27
|
-
function
|
|
27
|
+
function j(t) {
|
|
28
28
|
const e = t.summary?.trim();
|
|
29
29
|
if (e && e.length > 48 && !e.startsWith("{") && !e.startsWith("["))
|
|
30
30
|
return e;
|
|
@@ -36,8 +36,8 @@ function D(t) {
|
|
|
36
36
|
}
|
|
37
37
|
return e || "";
|
|
38
38
|
}
|
|
39
|
-
function
|
|
40
|
-
const e =
|
|
39
|
+
function U(t) {
|
|
40
|
+
const e = j(t.result);
|
|
41
41
|
return {
|
|
42
42
|
id: t.result.call.id,
|
|
43
43
|
name: t.result.call.name,
|
|
@@ -50,7 +50,7 @@ function j(t) {
|
|
|
50
50
|
status: t.result.success ? "done" : "error"
|
|
51
51
|
};
|
|
52
52
|
}
|
|
53
|
-
function
|
|
53
|
+
function z(t) {
|
|
54
54
|
return {
|
|
55
55
|
id: t.call.id,
|
|
56
56
|
name: t.call.name,
|
|
@@ -59,7 +59,7 @@ function U(t) {
|
|
|
59
59
|
status: "running"
|
|
60
60
|
};
|
|
61
61
|
}
|
|
62
|
-
function
|
|
62
|
+
function G(t, e) {
|
|
63
63
|
const o = e.success ? "前端操作已执行。" : e.error || "前端操作执行失败。";
|
|
64
64
|
return {
|
|
65
65
|
id: t.id,
|
|
@@ -73,20 +73,20 @@ function z(t, e) {
|
|
|
73
73
|
status: e.success ? "done" : "error"
|
|
74
74
|
};
|
|
75
75
|
}
|
|
76
|
-
function
|
|
76
|
+
function B(t) {
|
|
77
77
|
return t.startsWith("panel.") || t.startsWith("navigate.") || t.startsWith("session.");
|
|
78
78
|
}
|
|
79
|
-
function
|
|
80
|
-
if (!
|
|
79
|
+
function Q(t, e, o) {
|
|
80
|
+
if (!B(e.request.call.name)) return;
|
|
81
81
|
a(t, r.tool, "执行工具与回答");
|
|
82
|
-
const s =
|
|
82
|
+
const s = G(e.request.call, o);
|
|
83
83
|
t.appendToolCallsToStep(r.tool, [s]), t.setStep(
|
|
84
84
|
r.tool,
|
|
85
85
|
o.success ? "done" : "error",
|
|
86
86
|
s.resultText
|
|
87
87
|
);
|
|
88
88
|
}
|
|
89
|
-
async function
|
|
89
|
+
async function Y(t, e) {
|
|
90
90
|
if (e.type !== "ping") {
|
|
91
91
|
if (e.type === "step_sync")
|
|
92
92
|
t.setSteps(
|
|
@@ -118,10 +118,10 @@ async function Q(t, e) {
|
|
|
118
118
|
o,
|
|
119
119
|
t.getSteps().find((n) => n.id === o)?.status ?? "active",
|
|
120
120
|
s
|
|
121
|
-
) : (t.appendChunkToStep(o, s), await
|
|
121
|
+
) : (t.appendChunkToStep(o, s), await M());
|
|
122
122
|
} else if (e.type === "tool_start")
|
|
123
123
|
a(t, r.tool, "执行工具与回答"), t.appendToolCallsToStep(r.tool, [
|
|
124
|
-
|
|
124
|
+
z(e)
|
|
125
125
|
]);
|
|
126
126
|
else if (e.type === "tool_progress")
|
|
127
127
|
a(t, r.tool, "执行工具与回答"), t.appendToolCallsToStep(r.tool, [
|
|
@@ -136,7 +136,7 @@ async function Q(t, e) {
|
|
|
136
136
|
]);
|
|
137
137
|
else if (e.type === "tool_result")
|
|
138
138
|
a(t, r.tool, "执行工具与回答"), t.appendToolCallsToStep(r.tool, [
|
|
139
|
-
|
|
139
|
+
U(e)
|
|
140
140
|
]), e.result.attachments?.length && t.appendAttachmentsToStep(
|
|
141
141
|
r.tool,
|
|
142
142
|
e.result.attachments
|
|
@@ -165,17 +165,17 @@ async function Q(t, e) {
|
|
|
165
165
|
);
|
|
166
166
|
else if (e.type === "assistant_response") {
|
|
167
167
|
a(t, r.tool, "执行工具与回答");
|
|
168
|
-
const o = t.getSteps().find((n) => n.id === r.tool), { planning: s } =
|
|
168
|
+
const o = t.getSteps().find((n) => n.id === r.tool), { planning: s } = H(o?.content ?? "");
|
|
169
169
|
t.setStep(
|
|
170
170
|
r.tool,
|
|
171
171
|
"done",
|
|
172
|
-
|
|
172
|
+
L(s, e.content)
|
|
173
173
|
);
|
|
174
174
|
}
|
|
175
|
-
|
|
175
|
+
D(e) && t.appendExecutionEvent?.(e);
|
|
176
176
|
}
|
|
177
177
|
}
|
|
178
|
-
async function
|
|
178
|
+
async function K(t) {
|
|
179
179
|
await fetch(
|
|
180
180
|
`${g()}/v1/runs/${encodeURIComponent(t.runId)}/host-results`,
|
|
181
181
|
{
|
|
@@ -193,7 +193,7 @@ async function V(t) {
|
|
|
193
193
|
}
|
|
194
194
|
);
|
|
195
195
|
}
|
|
196
|
-
function
|
|
196
|
+
function V(t) {
|
|
197
197
|
const e = t.split(/\n\n/u), o = e.pop() ?? "";
|
|
198
198
|
return { events: e.flatMap((n) => {
|
|
199
199
|
const i = n.split(/\n/u).find((f) => f.startsWith("data: "));
|
|
@@ -205,21 +205,22 @@ function Y(t) {
|
|
|
205
205
|
}
|
|
206
206
|
}), rest: o };
|
|
207
207
|
}
|
|
208
|
-
async function
|
|
208
|
+
async function ut(t) {
|
|
209
209
|
await Promise.allSettled([
|
|
210
210
|
I(t),
|
|
211
|
-
|
|
211
|
+
W(t)
|
|
212
212
|
]);
|
|
213
213
|
}
|
|
214
|
-
async function
|
|
215
|
-
const o = w(), s = E(), n = await I(e);
|
|
214
|
+
async function X(t, e) {
|
|
215
|
+
const o = w(), s = E(), n = await I(e), i = A().getClientToolDescriptors();
|
|
216
216
|
return {
|
|
217
217
|
hostManifest: n,
|
|
218
|
+
localClientTools: i,
|
|
218
219
|
payload: {
|
|
219
|
-
projectId:
|
|
220
|
+
projectId: J(),
|
|
220
221
|
sessionId: o.sessionId,
|
|
221
222
|
userQuestion: t,
|
|
222
|
-
uiContext:
|
|
223
|
+
uiContext: q().getUiContext?.() ?? {},
|
|
223
224
|
sessionState: {
|
|
224
225
|
sessionId: o.sessionId,
|
|
225
226
|
activeTaskId: o.activeTaskId,
|
|
@@ -239,16 +240,18 @@ async function K(t, e) {
|
|
|
239
240
|
resumableAction: s.resumableAction,
|
|
240
241
|
lastResolvedTarget: s.lastResolvedTarget
|
|
241
242
|
},
|
|
242
|
-
|
|
243
|
+
// Prefer the host's actually registered tools so server allowlist matches
|
|
244
|
+
// what executeHostTool can run locally (avoids manifest-version skew).
|
|
245
|
+
clientTools: i,
|
|
243
246
|
skills: N(x())
|
|
244
247
|
}
|
|
245
248
|
};
|
|
246
249
|
}
|
|
247
|
-
async function
|
|
248
|
-
const o = g(), s = e.getSignal(), { payload: n,
|
|
250
|
+
async function ct(t, e) {
|
|
251
|
+
const o = g(), s = e.getSignal(), { payload: n, localClientTools: i } = await X(
|
|
249
252
|
t,
|
|
250
253
|
s
|
|
251
|
-
), f = new Set(i.
|
|
254
|
+
), f = new Set(i.map((u) => u.name)), c = await fetch(`${o}/v1/runs`, {
|
|
252
255
|
method: "POST",
|
|
253
256
|
headers: m(),
|
|
254
257
|
body: JSON.stringify(n),
|
|
@@ -284,15 +287,15 @@ async function ut(t, e) {
|
|
|
284
287
|
const { done: u, value: _ } = await h.read();
|
|
285
288
|
if (u) break;
|
|
286
289
|
S += P.decode(_, { stream: !0 });
|
|
287
|
-
const k =
|
|
290
|
+
const k = V(S);
|
|
288
291
|
S = k.rest;
|
|
289
292
|
for (const l of k.events) {
|
|
290
293
|
if (l.type === "host_action_request") {
|
|
291
|
-
const C = await
|
|
294
|
+
const C = await F(l.request.call, e, {
|
|
292
295
|
allowedHostNames: f,
|
|
293
296
|
hostEffect: l.request.hostEffect
|
|
294
297
|
});
|
|
295
|
-
|
|
298
|
+
Q(e, l, C), await K({
|
|
296
299
|
runId: d,
|
|
297
300
|
correlationId: l.request.correlationId,
|
|
298
301
|
result: C,
|
|
@@ -302,7 +305,7 @@ async function ut(t, e) {
|
|
|
302
305
|
}
|
|
303
306
|
if (l.type === "run_error")
|
|
304
307
|
throw new Error(l.error);
|
|
305
|
-
if (await
|
|
308
|
+
if (await Y(e, l), l.type === "run_completed")
|
|
306
309
|
return l.sessionPatch?.invokedSkills && w().setInvokedSkills(
|
|
307
310
|
l.sessionPatch.invokedSkills
|
|
308
311
|
), T = l, {
|
|
@@ -328,15 +331,14 @@ async function R(t) {
|
|
|
328
331
|
}
|
|
329
332
|
);
|
|
330
333
|
}
|
|
331
|
-
function
|
|
334
|
+
function dt(t) {
|
|
332
335
|
if (!t) return;
|
|
333
336
|
const e = y.get(t);
|
|
334
337
|
e && (y.delete(t), R(e));
|
|
335
338
|
}
|
|
336
339
|
export {
|
|
337
340
|
R as cancelRemoteSpotlightRun,
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
+
dt as cancelRemoteSpotlightRunForSignal,
|
|
342
|
+
ct as runRemoteSpotlightPipeline,
|
|
343
|
+
ut as warmupSpotlightRemoteContext
|
|
341
344
|
};
|
|
342
|
-
//# sourceMappingURL=runPipeline.js.map
|
package/dist/resolveConfig.js
CHANGED
package/dist/skills/index.js
CHANGED
package/dist/skills/matching.js
CHANGED
package/dist/skills/parser.js
CHANGED
package/dist/store/constants.js
CHANGED
|
@@ -0,0 +1,5 @@
|
|
|
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
|
+
export { SpotlightCommandDomain, SpotlightCommandScope, type SpotlightCommand, type SpotlightCommandAction, type SpotlightCommandTarget, type SpotlightVideoChannelId, } from "./types.js";
|
|
3
|
+
export { useSpotlightRuntimeStore } from "./runtimeStore.js";
|
|
4
|
+
export { useAgentSessionStore } from "../session/agentSession.js";
|
|
5
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +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"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { useSpotlightStore as e } from "./spotlightStore.js";
|
|
2
|
+
import { INVESTMENT_SUB_INTENT_LABELS as n, InvestmentSubIntent as T, PROGRESS_SUB_INTENT_LABELS as I, ProgressSubIntent as _, QUALITY_SUB_INTENT_LABELS as E, QualitySubIntent as N, SAFETY_SUB_INTENT_LABELS as r, SPOTLIGHT_INTENT_LABELS as L, SUB_INTENT_CONFIG as m, SafetySubIntent as p, SpotlightCommandDomain as B, SpotlightCommandScope as i, SpotlightIntent as u } from "./types.js";
|
|
3
|
+
import { useSpotlightRuntimeStore as A } from "./runtimeStore.js";
|
|
4
|
+
import { useAgentSessionStore as l } from "../session/agentSession.js";
|
|
5
|
+
export {
|
|
6
|
+
n as INVESTMENT_SUB_INTENT_LABELS,
|
|
7
|
+
T as InvestmentSubIntent,
|
|
8
|
+
I as PROGRESS_SUB_INTENT_LABELS,
|
|
9
|
+
_ as ProgressSubIntent,
|
|
10
|
+
E as QUALITY_SUB_INTENT_LABELS,
|
|
11
|
+
N as QualitySubIntent,
|
|
12
|
+
r as SAFETY_SUB_INTENT_LABELS,
|
|
13
|
+
L as SPOTLIGHT_INTENT_LABELS,
|
|
14
|
+
m as SUB_INTENT_CONFIG,
|
|
15
|
+
p as SafetySubIntent,
|
|
16
|
+
B as SpotlightCommandDomain,
|
|
17
|
+
i as SpotlightCommandScope,
|
|
18
|
+
u as SpotlightIntent,
|
|
19
|
+
l as useAgentSessionStore,
|
|
20
|
+
A as useSpotlightRuntimeStore,
|
|
21
|
+
e as useSpotlightStore
|
|
22
|
+
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"spotlightMarkdown.d.ts","sourceRoot":"","sources":["../../../src/store/pipeline/spotlightMarkdown.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"spotlightMarkdown.d.ts","sourceRoot":"","sources":["../../../src/store/pipeline/spotlightMarkdown.ts"],"names":[],"mappings":"AAeA,4CAA4C;AAC5C,wBAAgB,2BAA2B,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAsBhE;AA0ED,wBAAsB,gCAAgC,CACpD,IAAI,EAAE,MAAM,GACX,OAAO,CAAC,MAAM,CAAC,CAgBjB;AAED,gEAAgE;AAChE,wBAAgB,4BAA4B,IAAI,IAAI,CAEnD"}
|
|
@@ -1,86 +1,91 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
let u = null;
|
|
2
|
+
function l() {
|
|
3
|
+
return u ??= Promise.all([
|
|
4
|
+
import("prettier/standalone"),
|
|
5
|
+
import("prettier/plugins/markdown")
|
|
6
|
+
]).then(([r, e]) => ({ prettier: r, markdownPlugin: e })), u;
|
|
7
|
+
}
|
|
8
|
+
function f(r) {
|
|
9
|
+
if (!r.trim()) return r;
|
|
10
|
+
let e = r.replace(/\r\n/g, `
|
|
6
11
|
`);
|
|
7
|
-
return
|
|
12
|
+
return e = e.replace(/(#{1,6}\s+[^\n#|]+?)(#{1,6}\s)/g, `$1
|
|
8
13
|
|
|
9
|
-
$2`),
|
|
14
|
+
$2`), e = e.replace(/([\u4e00-\u9fa5)】>])(#{1,6})(?=\S)/g, `$1
|
|
10
15
|
|
|
11
|
-
$2`),
|
|
16
|
+
$2`), e = e.replace(/^(#{1,6})(\d+[.)、])/gm, "$1 $2"), e = e.replace(/^-(?![-])(\S)/gm, "- $1"), e = e.replace(
|
|
12
17
|
new RegExp("(?<=[\\d.km座处)%)kW#])-(?=[\\u4e00-\\u9fa5])", "g"),
|
|
13
18
|
`
|
|
14
19
|
- `
|
|
15
|
-
),
|
|
16
|
-
`).map((n) =>
|
|
17
|
-
`),
|
|
20
|
+
), e = e.split(`
|
|
21
|
+
`).map((n) => d(n)).join(`
|
|
22
|
+
`), e = m(e), e.replace(/\n{3,}/g, `
|
|
18
23
|
|
|
19
24
|
`).trim();
|
|
20
25
|
}
|
|
21
|
-
function
|
|
22
|
-
const
|
|
23
|
-
if (!
|
|
24
|
-
const n =
|
|
25
|
-
return !t || !i || !i.includes("|") && !i.startsWith("|") ?
|
|
26
|
+
function d(r) {
|
|
27
|
+
const e = r.trim();
|
|
28
|
+
if (!e.includes("|") || /^\|/.test(e) || /^\|[-\s|:]+\|/.test(e.replace(/\s/g, ""))) return r;
|
|
29
|
+
const n = e.indexOf("|"), t = e.slice(0, n).trimEnd(), i = e.slice(n).trimStart();
|
|
30
|
+
return !t || !i || !i.includes("|") && !i.startsWith("|") ? r : `${t}
|
|
26
31
|
|
|
27
32
|
${i}`;
|
|
28
33
|
}
|
|
29
|
-
function
|
|
30
|
-
const
|
|
34
|
+
function m(r) {
|
|
35
|
+
const e = r.split(`
|
|
31
36
|
`), n = [];
|
|
32
|
-
for (let t = 0; t <
|
|
33
|
-
const i =
|
|
34
|
-
if (!c(
|
|
37
|
+
for (let t = 0; t < e.length; t++) {
|
|
38
|
+
const i = e[t], p = i.trim();
|
|
39
|
+
if (!c(p)) {
|
|
35
40
|
n.push(i);
|
|
36
41
|
continue;
|
|
37
42
|
}
|
|
38
|
-
const
|
|
39
|
-
for (; t <
|
|
40
|
-
const
|
|
41
|
-
if (!
|
|
43
|
+
const s = [];
|
|
44
|
+
for (; t < e.length; ) {
|
|
45
|
+
const o = e[t].trim();
|
|
46
|
+
if (!o) {
|
|
42
47
|
t++;
|
|
43
48
|
continue;
|
|
44
49
|
}
|
|
45
|
-
if (!c(
|
|
46
|
-
|
|
50
|
+
if (!c(o)) break;
|
|
51
|
+
s.push(o), t++;
|
|
47
52
|
}
|
|
48
53
|
t--;
|
|
49
|
-
const a =
|
|
54
|
+
const a = g(s);
|
|
50
55
|
a.length && n.push(...a);
|
|
51
56
|
}
|
|
52
57
|
return n.join(`
|
|
53
58
|
`);
|
|
54
59
|
}
|
|
55
|
-
function c(
|
|
56
|
-
return
|
|
60
|
+
function c(r) {
|
|
61
|
+
return r ? /^\|.*\|$/.test(r) && /[|:-]/.test(r) ? !0 : /^[\s|:-]+$/.test(r) : !1;
|
|
57
62
|
}
|
|
58
|
-
function
|
|
59
|
-
if (!
|
|
60
|
-
if (!
|
|
63
|
+
function g(r) {
|
|
64
|
+
if (!r.length) return [];
|
|
65
|
+
if (!r.every(
|
|
61
66
|
(t) => /^[\s|:-]+$/.test(t.replace(/[^|:\-\s]/g, ""))
|
|
62
|
-
)) return
|
|
63
|
-
const n =
|
|
64
|
-
return /^\|[-:|]+\|$/.test(n) ? [n] :
|
|
67
|
+
)) return r;
|
|
68
|
+
const n = r.join("").replace(/\s+/g, "").replace(/\|+/g, "|").replace(/^\|/, "|").replace(/\|$/, "|");
|
|
69
|
+
return /^\|[-:|]+\|$/.test(n) ? [n] : r;
|
|
65
70
|
}
|
|
66
|
-
async function
|
|
67
|
-
const
|
|
68
|
-
if (!
|
|
71
|
+
async function h(r) {
|
|
72
|
+
const e = f(r);
|
|
73
|
+
if (!e) return "";
|
|
69
74
|
try {
|
|
70
|
-
|
|
75
|
+
const { prettier: n, markdownPlugin: t } = await l();
|
|
76
|
+
return (await n.format(e, {
|
|
71
77
|
parser: "markdown",
|
|
72
|
-
plugins: [
|
|
78
|
+
plugins: [t],
|
|
73
79
|
proseWrap: "preserve"
|
|
74
80
|
})).trim();
|
|
75
81
|
} catch {
|
|
76
|
-
return
|
|
82
|
+
return e;
|
|
77
83
|
}
|
|
78
84
|
}
|
|
79
|
-
function
|
|
85
|
+
function $() {
|
|
80
86
|
}
|
|
81
87
|
export {
|
|
82
|
-
|
|
83
|
-
|
|
88
|
+
h as formatSpotlightKnowledgeMarkdown,
|
|
89
|
+
$ as initSpotlightMarkdownPreview,
|
|
84
90
|
f as preprocessKnowledgeMarkdown
|
|
85
91
|
};
|
|
86
|
-
//# sourceMappingURL=spotlightMarkdown.js.map
|
package/dist/store/recent.js
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { defineStore as m } from "pinia";
|
|
2
2
|
import { getSpotlightConfig as S } from "../plugin.js";
|
|
3
3
|
import { runRemoteSpotlightPipeline as g, warmupSpotlightRemoteContext as u, cancelRemoteSpotlightRunForSignal as f } from "../remote/runPipeline.js";
|
|
4
|
-
import "@inupedia/spotlight-client";
|
|
5
4
|
import { ensureSpotlightMeta as T } from "../remote/meta.js";
|
|
6
5
|
import { devWarn as y } from "../utils/devConsole.js";
|
|
7
6
|
import { useAgentSessionStore as E } from "../session/agentSession.js";
|
|
@@ -13,7 +12,7 @@ import { typewriterAppendToStepContent as b, typewriterToStepContent as v } from
|
|
|
13
12
|
import { addRecentQuestionToList as R, persistRecentQuestions as Q, loadRecentQuestions as L } from "./recent.js";
|
|
14
13
|
import { getSuggestedQuestions as C } from "./capabilities.js";
|
|
15
14
|
import { buildSpotlightStoreSink as N } from "./storeSink.js";
|
|
16
|
-
import { INVESTMENT_SUB_INTENT_LABELS as
|
|
15
|
+
import { INVESTMENT_SUB_INTENT_LABELS as ee, InvestmentSubIntent as te, PROGRESS_SUB_INTENT_LABELS as ie, ProgressSubIntent as ne, QUALITY_SUB_INTENT_LABELS as se, QualitySubIntent as re, SAFETY_SUB_INTENT_LABELS as oe, SPOTLIGHT_INTENT_LABELS as le, SUB_INTENT_CONFIG as ue, SafetySubIntent as pe, SpotlightIntent as ae } from "./types.js";
|
|
17
16
|
const h = "spotlight-telemetry-snapshots", l = 20;
|
|
18
17
|
function p(e) {
|
|
19
18
|
return e instanceof DOMException && e.name === "AbortError" ? !0 : e instanceof Error && e.name === "AbortError";
|
|
@@ -88,7 +87,7 @@ function B(e) {
|
|
|
88
87
|
function O(e, i) {
|
|
89
88
|
return c(e).find((n) => n[0]?.turnId === i) ?? [];
|
|
90
89
|
}
|
|
91
|
-
const
|
|
90
|
+
const z = m("spotlight", {
|
|
92
91
|
state: () => ({
|
|
93
92
|
visible: !1,
|
|
94
93
|
prompt: "",
|
|
@@ -345,17 +344,16 @@ const Z = m("spotlight", {
|
|
|
345
344
|
}
|
|
346
345
|
});
|
|
347
346
|
export {
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
347
|
+
ee as INVESTMENT_SUB_INTENT_LABELS,
|
|
348
|
+
te as InvestmentSubIntent,
|
|
349
|
+
ie as PROGRESS_SUB_INTENT_LABELS,
|
|
350
|
+
ne as ProgressSubIntent,
|
|
351
|
+
se as QUALITY_SUB_INTENT_LABELS,
|
|
352
|
+
re as QualitySubIntent,
|
|
353
|
+
oe as SAFETY_SUB_INTENT_LABELS,
|
|
354
|
+
le as SPOTLIGHT_INTENT_LABELS,
|
|
355
|
+
ue as SUB_INTENT_CONFIG,
|
|
356
|
+
pe as SafetySubIntent,
|
|
357
|
+
ae as SpotlightIntent,
|
|
358
|
+
z as useSpotlightStore
|
|
360
359
|
};
|
|
361
|
-
//# sourceMappingURL=spotlightStore.js.map
|
package/dist/store/storeSink.js
CHANGED
package/dist/store/types.js
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/testing/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,6BAA6B,EAAE,MAAM,cAAc,CAAC;AAC7D,OAAO,EAAE,+BAA+B,EAAE,MAAM,mBAAmB,CAAC"}
|
package/dist/utils/devConsole.js
CHANGED