@inupedia/spotlight-vue 0.1.0
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 +10 -0
- package/dist/_virtual/_plugin-vue_export-helper.js.map +1 -0
- package/dist/assets/spotlight-vue.css +1 -0
- package/dist/avatar/config.d.ts +16 -0
- package/dist/avatar/config.d.ts.map +1 -0
- package/dist/avatar/config.js +22 -0
- package/dist/avatar/config.js.map +1 -0
- package/dist/avatar/speech/live2dAnswerSpeechPolicy.d.ts +3 -0
- package/dist/avatar/speech/live2dAnswerSpeechPolicy.d.ts.map +1 -0
- package/dist/avatar/speech/live2dAnswerSpeechPolicy.js +16 -0
- package/dist/avatar/speech/live2dAnswerSpeechPolicy.js.map +1 -0
- package/dist/avatar/speech/live2dBriefingSummarizer.d.ts +11 -0
- package/dist/avatar/speech/live2dBriefingSummarizer.d.ts.map +1 -0
- package/dist/avatar/speech/live2dBriefingSummarizer.js +92 -0
- package/dist/avatar/speech/live2dBriefingSummarizer.js.map +1 -0
- package/dist/avatar/speech/live2dStreamSpeech.d.ts +14 -0
- package/dist/avatar/speech/live2dStreamSpeech.d.ts.map +1 -0
- package/dist/avatar/speech/live2dStreamSpeech.js +5 -0
- package/dist/avatar/speech/live2dStreamSpeech.js.map +1 -0
- package/dist/avatar/speech/live2dTtsPipeline.d.ts +34 -0
- package/dist/avatar/speech/live2dTtsPipeline.d.ts.map +1 -0
- package/dist/avatar/speech/live2dTtsPlayback.d.ts +3 -0
- package/dist/avatar/speech/live2dTtsPlayback.d.ts.map +1 -0
- package/dist/avatar/speech/live2dTtsPlayback.js +24 -0
- package/dist/avatar/speech/live2dTtsPlayback.js.map +1 -0
- package/dist/avatar/speech/llmUtils.d.ts +3 -0
- package/dist/avatar/speech/llmUtils.d.ts.map +1 -0
- package/dist/avatar/speech/llmUtils.js +19 -0
- package/dist/avatar/speech/llmUtils.js.map +1 -0
- package/dist/avatar/speech/spotlightSpeech.d.ts +24 -0
- package/dist/avatar/speech/spotlightSpeech.d.ts.map +1 -0
- package/dist/avatar/speech/spotlightSpeech.js +94 -0
- package/dist/avatar/speech/spotlightSpeech.js.map +1 -0
- package/dist/avatar/spine/live2dApp.d.ts +11 -0
- package/dist/avatar/spine/live2dApp.d.ts.map +1 -0
- package/dist/avatar/spine/live2dApp.js +28 -0
- package/dist/avatar/spine/live2dApp.js.map +1 -0
- package/dist/avatar/spine/spineAvatar.d.ts +14 -0
- package/dist/avatar/spine/spineAvatar.d.ts.map +1 -0
- package/dist/avatar/spine/spineAvatar.js +101 -0
- package/dist/avatar/spine/spineAvatar.js.map +1 -0
- package/dist/avatar/spine/spineLipSync.d.ts +13 -0
- package/dist/avatar/spine/spineLipSync.d.ts.map +1 -0
- package/dist/avatar/spine/spineLipSync.js +48 -0
- package/dist/avatar/spine/spineLipSync.js.map +1 -0
- package/dist/components/InspiraCardSpotlight.js +5 -0
- package/dist/components/InspiraCardSpotlight.js.map +1 -0
- package/dist/components/InspiraCardSpotlight.vue.d.ts +28 -0
- package/dist/components/InspiraCardSpotlight.vue.d.ts.map +1 -0
- package/dist/components/InspiraCardSpotlight.vue.js +53 -0
- package/dist/components/InspiraCardSpotlight.vue.js.map +1 -0
- package/dist/components/Live2dPanel.vue.d.ts +4 -0
- package/dist/components/Live2dPanel.vue.d.ts.map +1 -0
- package/dist/components/Live2dPanel.vue.js +8 -0
- package/dist/components/Live2dPanel.vue.js.map +1 -0
- package/dist/components/Live2dPanel2.vue.js +67 -0
- package/dist/components/Live2dPanel2.vue.js.map +1 -0
- package/dist/components/OfficialBorderBeam.js +8 -0
- package/dist/components/OfficialBorderBeam.js.map +1 -0
- package/dist/components/OfficialBorderBeam.vue.d.ts +21 -0
- package/dist/components/OfficialBorderBeam.vue.d.ts.map +1 -0
- package/dist/components/OfficialBorderBeam.vue.js +30 -0
- package/dist/components/OfficialBorderBeam.vue.js.map +1 -0
- package/dist/components/SpotlightCommandPanel.vue.d.ts +18 -0
- package/dist/components/SpotlightCommandPanel.vue.d.ts.map +1 -0
- package/dist/components/SpotlightCommandPanel.vue.js +8 -0
- package/dist/components/SpotlightCommandPanel.vue.js.map +1 -0
- package/dist/components/SpotlightCommandPanel2.vue.js +217 -0
- package/dist/components/SpotlightCommandPanel2.vue.js.map +1 -0
- package/dist/components/SpotlightMarkdownPreview.vue.d.ts +12 -0
- package/dist/components/SpotlightMarkdownPreview.vue.d.ts.map +1 -0
- package/dist/components/SpotlightMarkdownPreview.vue.js +39 -0
- package/dist/components/SpotlightMarkdownPreview.vue.js.map +1 -0
- package/dist/components/SpotlightMarkdownPreview2.vue.js +5 -0
- package/dist/components/SpotlightMarkdownPreview2.vue.js.map +1 -0
- package/dist/components/SpotlightRoot.vue.d.ts +26 -0
- package/dist/components/SpotlightRoot.vue.d.ts.map +1 -0
- package/dist/components/SpotlightRoot.vue.js +58 -0
- package/dist/components/SpotlightRoot.vue.js.map +1 -0
- package/dist/components/SpotlightRoot2.vue.js +5 -0
- package/dist/components/SpotlightRoot2.vue.js.map +1 -0
- package/dist/components/SpotlightShell.vue.d.ts +9 -0
- package/dist/components/SpotlightShell.vue.d.ts.map +1 -0
- package/dist/components/SpotlightShell.vue.js +5 -0
- package/dist/components/SpotlightShell.vue.js.map +1 -0
- package/dist/components/SpotlightShell2.vue.js +312 -0
- package/dist/components/SpotlightShell2.vue.js.map +1 -0
- package/dist/components/SpotlightThinking.vue.d.ts +59 -0
- package/dist/components/SpotlightThinking.vue.d.ts.map +1 -0
- package/dist/components/SpotlightThinking.vue.js +8 -0
- package/dist/components/SpotlightThinking.vue.js.map +1 -0
- package/dist/components/SpotlightThinking2.vue.js +893 -0
- package/dist/components/SpotlightThinking2.vue.js.map +1 -0
- package/dist/composables/useSpotlightCommandShortcuts.d.ts +13 -0
- package/dist/composables/useSpotlightCommandShortcuts.d.ts.map +1 -0
- package/dist/composables/useSpotlightCommandShortcuts.js +30 -0
- package/dist/composables/useSpotlightCommandShortcuts.js.map +1 -0
- package/dist/composables/useSpotlightPanelUi.d.ts +15 -0
- package/dist/composables/useSpotlightPanelUi.d.ts.map +1 -0
- package/dist/composables/useSpotlightPanelUi.js +9 -0
- package/dist/composables/useSpotlightPanelUi.js.map +1 -0
- package/dist/config.d.ts +59 -0
- package/dist/config.d.ts.map +1 -0
- package/dist/config.js +22 -0
- package/dist/config.js.map +1 -0
- package/dist/constants/toolNames.d.ts +12 -0
- package/dist/constants/toolNames.d.ts.map +1 -0
- package/dist/constants/toolNames.js +15 -0
- package/dist/constants/toolNames.js.map +1 -0
- package/dist/host/defineApp.d.ts +16 -0
- package/dist/host/defineApp.d.ts.map +1 -0
- package/dist/host/defineApp.js +27 -0
- package/dist/host/defineApp.js.map +1 -0
- package/dist/host/defineHost.d.ts +55 -0
- package/dist/host/defineHost.d.ts.map +1 -0
- package/dist/host/defineHost.js +55 -0
- package/dist/host/defineHost.js.map +1 -0
- package/dist/host/mergeSkills.d.ts +4 -0
- package/dist/host/mergeSkills.d.ts.map +1 -0
- package/dist/host/mergeSkills.js +12 -0
- package/dist/host/mergeSkills.js.map +1 -0
- package/dist/host/normalizeSkills.d.ts +4 -0
- package/dist/host/normalizeSkills.d.ts.map +1 -0
- package/dist/host/normalizeSkills.js +11 -0
- package/dist/host/normalizeSkills.js.map +1 -0
- package/dist/host/skillExecution.d.ts +9 -0
- package/dist/host/skillExecution.d.ts.map +1 -0
- package/dist/host/skillExecution.js +14 -0
- package/dist/host/skillExecution.js.map +1 -0
- package/dist/index.d.ts +37 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +123 -0
- package/dist/index.js.map +1 -0
- package/dist/mountShell.d.ts +5 -0
- package/dist/mountShell.d.ts.map +1 -0
- package/dist/mountShell.js +24 -0
- package/dist/mountShell.js.map +1 -0
- package/dist/plugin.d.ts +16 -0
- package/dist/plugin.d.ts.map +1 -0
- package/dist/plugin.js +51 -0
- package/dist/plugin.js.map +1 -0
- package/dist/remote/audio.d.ts +13 -0
- package/dist/remote/audio.d.ts.map +1 -0
- package/dist/remote/audio.js +56 -0
- package/dist/remote/audio.js.map +1 -0
- package/dist/remote/hostToolRunner.d.ts +11 -0
- package/dist/remote/hostToolRunner.d.ts.map +1 -0
- package/dist/remote/hostToolRunner.js +25 -0
- package/dist/remote/hostToolRunner.js.map +1 -0
- package/dist/remote/httpConfig.d.ts +5 -0
- package/dist/remote/httpConfig.d.ts.map +1 -0
- package/dist/remote/httpConfig.js +20 -0
- package/dist/remote/httpConfig.js.map +1 -0
- package/dist/remote/index.d.ts +8 -0
- package/dist/remote/index.d.ts.map +1 -0
- package/dist/remote/index.js +27 -0
- package/dist/remote/index.js.map +1 -0
- package/dist/remote/meta.d.ts +12 -0
- package/dist/remote/meta.d.ts.map +1 -0
- package/dist/remote/meta.js +59 -0
- package/dist/remote/meta.js.map +1 -0
- package/dist/remote/runPipeline.d.ts +7 -0
- package/dist/remote/runPipeline.d.ts.map +1 -0
- package/dist/remote/runPipeline.js +342 -0
- package/dist/remote/runPipeline.js.map +1 -0
- package/dist/remote/serverJson.d.ts +3 -0
- package/dist/remote/serverJson.d.ts.map +1 -0
- package/dist/remote/serverJson.js +12 -0
- package/dist/remote/serverJson.js.map +1 -0
- package/dist/remote/types.d.ts +6 -0
- package/dist/remote/types.d.ts.map +1 -0
- package/dist/resolveConfig.d.ts +21 -0
- package/dist/resolveConfig.d.ts.map +1 -0
- package/dist/resolveConfig.js +14 -0
- package/dist/resolveConfig.js.map +1 -0
- package/dist/session/agentSession.d.ts +46 -0
- package/dist/session/agentSession.d.ts.map +1 -0
- package/dist/session/agentSession.js +150 -0
- package/dist/session/agentSession.js.map +1 -0
- package/dist/skills/index.d.ts +9 -0
- package/dist/skills/index.d.ts.map +1 -0
- package/dist/skills/index.js +23 -0
- package/dist/skills/index.js.map +1 -0
- package/dist/skills/matching.d.ts +11 -0
- package/dist/skills/matching.d.ts.map +1 -0
- package/dist/skills/matching.js +33 -0
- package/dist/skills/matching.js.map +1 -0
- package/dist/skills/parser.d.ts +3 -0
- package/dist/skills/parser.d.ts.map +1 -0
- package/dist/skills/parser.js +17 -0
- package/dist/skills/parser.js.map +1 -0
- package/dist/skills/skillFrontmatterParse.d.ts +3 -0
- package/dist/skills/skillFrontmatterParse.d.ts.map +1 -0
- package/dist/skills/skillFrontmatterParse.js +203 -0
- package/dist/skills/skillFrontmatterParse.js.map +1 -0
- package/dist/skills/skillListing.d.ts +9 -0
- package/dist/skills/skillListing.d.ts.map +1 -0
- package/dist/skills/skillListing.js +45 -0
- package/dist/skills/skillListing.js.map +1 -0
- package/dist/skills/skillPaths.d.ts +4 -0
- package/dist/skills/skillPaths.d.ts.map +1 -0
- package/dist/skills/skillPaths.js +22 -0
- package/dist/skills/skillPaths.js.map +1 -0
- package/dist/store/capabilities.d.ts +7 -0
- package/dist/store/capabilities.d.ts.map +1 -0
- package/dist/store/capabilities.js +12 -0
- package/dist/store/capabilities.js.map +1 -0
- package/dist/store/constants.d.ts +8 -0
- package/dist/store/constants.d.ts.map +1 -0
- package/dist/store/constants.js +6 -0
- package/dist/store/constants.js.map +1 -0
- package/dist/store/live2dOverlayStore.d.ts +20 -0
- package/dist/store/live2dOverlayStore.d.ts.map +1 -0
- package/dist/store/live2dOverlayStore.js +19 -0
- package/dist/store/live2dOverlayStore.js.map +1 -0
- package/dist/store/live2dSpeechStore.d.ts +29 -0
- package/dist/store/live2dSpeechStore.d.ts.map +1 -0
- package/dist/store/live2dSpeechStore.js +19 -0
- package/dist/store/live2dSpeechStore.js.map +1 -0
- package/dist/store/live2dVoiceChannelStore.d.ts +21 -0
- package/dist/store/live2dVoiceChannelStore.d.ts.map +1 -0
- package/dist/store/live2dVoiceChannelStore.js +22 -0
- package/dist/store/live2dVoiceChannelStore.js.map +1 -0
- package/dist/store/pipeline/api.d.ts +5 -0
- package/dist/store/pipeline/api.d.ts.map +1 -0
- package/dist/store/pipeline/api.js +86 -0
- package/dist/store/pipeline/api.js.map +1 -0
- package/dist/store/pipeline/constants.d.ts +18 -0
- package/dist/store/pipeline/constants.d.ts.map +1 -0
- package/dist/store/pipeline/constants.js +17 -0
- package/dist/store/pipeline/constants.js.map +1 -0
- package/dist/store/pipeline/displayText.d.ts +32 -0
- package/dist/store/pipeline/displayText.d.ts.map +1 -0
- package/dist/store/pipeline/displayText.js +93 -0
- package/dist/store/pipeline/displayText.js.map +1 -0
- package/dist/store/pipeline/errors.d.ts +5 -0
- package/dist/store/pipeline/errors.d.ts.map +1 -0
- package/dist/store/pipeline/errors.js +30 -0
- package/dist/store/pipeline/errors.js.map +1 -0
- package/dist/store/pipeline/spotlightMarkdown.d.ts +6 -0
- package/dist/store/pipeline/spotlightMarkdown.d.ts.map +1 -0
- package/dist/store/pipeline/spotlightMarkdown.js +86 -0
- package/dist/store/pipeline/spotlightMarkdown.js.map +1 -0
- package/dist/store/pipeline/steps.d.ts +11 -0
- package/dist/store/pipeline/steps.d.ts.map +1 -0
- package/dist/store/pipeline/steps.js +102 -0
- package/dist/store/pipeline/steps.js.map +1 -0
- package/dist/store/pipeline/toolDisplay.d.ts +14 -0
- package/dist/store/pipeline/toolDisplay.d.ts.map +1 -0
- package/dist/store/pipeline/toolDisplay.js +65 -0
- package/dist/store/pipeline/toolDisplay.js.map +1 -0
- package/dist/store/pipeline/types.d.ts +53 -0
- package/dist/store/pipeline/types.d.ts.map +1 -0
- package/dist/store/pipeline/typing.d.ts +4 -0
- package/dist/store/pipeline/typing.d.ts.map +1 -0
- package/dist/store/pipeline/typing.js +32 -0
- package/dist/store/pipeline/typing.js.map +1 -0
- package/dist/store/recent.d.ts +4 -0
- package/dist/store/recent.d.ts.map +1 -0
- package/dist/store/recent.js +27 -0
- package/dist/store/recent.js.map +1 -0
- package/dist/store/runtime/types.d.ts +140 -0
- package/dist/store/runtime/types.d.ts.map +1 -0
- package/dist/store/runtimeStore.d.ts +18 -0
- package/dist/store/runtimeStore.d.ts.map +1 -0
- package/dist/store/runtimeStore.js +25 -0
- package/dist/store/runtimeStore.js.map +1 -0
- package/dist/store/spotlightStore.d.ts +2787 -0
- package/dist/store/spotlightStore.d.ts.map +1 -0
- package/dist/store/spotlightStore.js +361 -0
- package/dist/store/spotlightStore.js.map +1 -0
- package/dist/store/storeSink.d.ts +16 -0
- package/dist/store/storeSink.d.ts.map +1 -0
- package/dist/store/storeSink.js +127 -0
- package/dist/store/storeSink.js.map +1 -0
- package/dist/store/types.d.ts +199 -0
- package/dist/store/types.d.ts.map +1 -0
- package/dist/store/types.js +87 -0
- package/dist/store/types.js.map +1 -0
- package/dist/types/session.d.ts +5 -0
- package/dist/types/session.d.ts.map +1 -0
- package/dist/types/toolResult.d.ts +11 -0
- package/dist/types/toolResult.d.ts.map +1 -0
- package/dist/utils/devConsole.d.ts +2 -0
- package/dist/utils/devConsole.d.ts.map +1 -0
- package/dist/utils/devConsole.js +6 -0
- package/dist/utils/devConsole.js.map +1 -0
- package/dist/utils/requestTimeout.d.ts +5 -0
- package/dist/utils/requestTimeout.d.ts.map +1 -0
- package/dist/utils/requestTimeout.js +12 -0
- package/dist/utils/requestTimeout.js.map +1 -0
- package/dist/workflow/createOperateDefinition.d.ts +22 -0
- package/dist/workflow/createOperateDefinition.d.ts.map +1 -0
- package/dist/workflow/createOperateDefinition.js +32 -0
- package/dist/workflow/createOperateDefinition.js.map +1 -0
- package/dist/workflow/operate.d.ts +23 -0
- package/dist/workflow/operate.d.ts.map +1 -0
- package/dist/workflow/operate.js +96 -0
- package/dist/workflow/operate.js.map +1 -0
- package/dist/workflow/runHostTool.d.ts +4 -0
- package/dist/workflow/runHostTool.d.ts.map +1 -0
- package/dist/workflow/runHostTool.js +13 -0
- package/dist/workflow/runHostTool.js.map +1 -0
- package/dist/workflow/sessionControl.d.ts +30 -0
- package/dist/workflow/sessionControl.d.ts.map +1 -0
- package/dist/workflow/sessionControl.js +113 -0
- package/dist/workflow/sessionControl.js.map +1 -0
- package/dist/workflow/shared.d.ts +6 -0
- package/dist/workflow/shared.d.ts.map +1 -0
- package/dist/workflow/shared.js +15 -0
- package/dist/workflow/shared.js.map +1 -0
- package/package.json +78 -0
|
@@ -0,0 +1,203 @@
|
|
|
1
|
+
import { parse as W } from "yaml";
|
|
2
|
+
function N(n) {
|
|
3
|
+
return typeof n == "object" && n !== null && !Array.isArray(n);
|
|
4
|
+
}
|
|
5
|
+
function C(n) {
|
|
6
|
+
const e = n.replace(/\r\n/g, `
|
|
7
|
+
`).trim();
|
|
8
|
+
if (!e.startsWith(`---
|
|
9
|
+
`))
|
|
10
|
+
return { frontmatter: "", body: e };
|
|
11
|
+
const t = e.indexOf(`
|
|
12
|
+
---
|
|
13
|
+
`, 4);
|
|
14
|
+
return t === -1 ? { frontmatter: "", body: e } : {
|
|
15
|
+
frontmatter: e.slice(4, t).trim(),
|
|
16
|
+
body: e.slice(t + 5).trim()
|
|
17
|
+
};
|
|
18
|
+
}
|
|
19
|
+
function F(n) {
|
|
20
|
+
const e = n.trim();
|
|
21
|
+
if (!e) return {};
|
|
22
|
+
try {
|
|
23
|
+
const o = W(e);
|
|
24
|
+
if (N(o)) return o;
|
|
25
|
+
} catch {
|
|
26
|
+
}
|
|
27
|
+
const t = {};
|
|
28
|
+
for (const o of n.split(`
|
|
29
|
+
`)) {
|
|
30
|
+
const r = o.trim();
|
|
31
|
+
if (!r || r.startsWith("#")) continue;
|
|
32
|
+
const c = r.indexOf(":");
|
|
33
|
+
if (c <= 0) continue;
|
|
34
|
+
const f = r.slice(0, c).trim(), i = r.slice(c + 1).trim();
|
|
35
|
+
t[f] = i;
|
|
36
|
+
}
|
|
37
|
+
return t;
|
|
38
|
+
}
|
|
39
|
+
function B(n) {
|
|
40
|
+
const { frontmatter: e, body: t } = C(n);
|
|
41
|
+
return { data: F(e), body: t };
|
|
42
|
+
}
|
|
43
|
+
function l(n) {
|
|
44
|
+
return n.startsWith('"') && n.endsWith('"') || n.startsWith("'") && n.endsWith("'") ? n.slice(1, -1).trim() : n;
|
|
45
|
+
}
|
|
46
|
+
function s(n, ...e) {
|
|
47
|
+
for (const t of e) {
|
|
48
|
+
const o = n[t];
|
|
49
|
+
if (typeof o == "string") {
|
|
50
|
+
const r = l(o.trim());
|
|
51
|
+
if (r) return r;
|
|
52
|
+
}
|
|
53
|
+
if (typeof o == "number" && Number.isFinite(o)) return String(o);
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
function D(n) {
|
|
57
|
+
if (n != null) {
|
|
58
|
+
if (Array.isArray(n)) {
|
|
59
|
+
const e = n.filter((t) => typeof t == "string").map((t) => l(t.trim())).filter(Boolean);
|
|
60
|
+
return e.length ? e : void 0;
|
|
61
|
+
}
|
|
62
|
+
if (typeof n == "string") {
|
|
63
|
+
const e = n.replace(/^\[/, "").replace(/\]$/, "").trim();
|
|
64
|
+
if (!e) return;
|
|
65
|
+
const t = e.split(",").map((o) => l(o.trim())).filter(Boolean);
|
|
66
|
+
return t.length ? t : void 0;
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
function a(n, ...e) {
|
|
71
|
+
for (const t of e) {
|
|
72
|
+
const o = D(n[t]);
|
|
73
|
+
if (o?.length) return o;
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
function A(n, ...e) {
|
|
77
|
+
for (const t of e) {
|
|
78
|
+
const o = n[t];
|
|
79
|
+
if (typeof o == "boolean") return o;
|
|
80
|
+
if (typeof o == "string") {
|
|
81
|
+
const r = o.trim().toLowerCase();
|
|
82
|
+
if (r === "true" || r === "yes") return !0;
|
|
83
|
+
if (r === "false" || r === "no") return !1;
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
const H = /* @__PURE__ */ new Set([
|
|
88
|
+
"direct_answer",
|
|
89
|
+
"tool_answer",
|
|
90
|
+
"clarify"
|
|
91
|
+
]);
|
|
92
|
+
function M(n) {
|
|
93
|
+
const e = s(
|
|
94
|
+
n,
|
|
95
|
+
"spotlight-response-strategy",
|
|
96
|
+
"response-strategy",
|
|
97
|
+
"responseStrategy"
|
|
98
|
+
);
|
|
99
|
+
if (e)
|
|
100
|
+
return H.has(e) ? e : void 0;
|
|
101
|
+
}
|
|
102
|
+
const O = /* @__PURE__ */ new Set([
|
|
103
|
+
"video_channel",
|
|
104
|
+
"bim_model",
|
|
105
|
+
"device",
|
|
106
|
+
"sensor",
|
|
107
|
+
"panel",
|
|
108
|
+
"scene_target"
|
|
109
|
+
]);
|
|
110
|
+
function $(n) {
|
|
111
|
+
const e = a(
|
|
112
|
+
n,
|
|
113
|
+
"spotlight-asset-types",
|
|
114
|
+
"asset-types",
|
|
115
|
+
"assetTypes"
|
|
116
|
+
);
|
|
117
|
+
if (!e) return;
|
|
118
|
+
const t = e.filter(
|
|
119
|
+
(o) => O.has(o)
|
|
120
|
+
);
|
|
121
|
+
return t.length ? Array.from(new Set(t)) : void 0;
|
|
122
|
+
}
|
|
123
|
+
function P(n) {
|
|
124
|
+
const e = s(n, "context", "execution-context", "executionContext");
|
|
125
|
+
if (!e) return;
|
|
126
|
+
const t = e.toLowerCase();
|
|
127
|
+
if (t === "fork") return "fork";
|
|
128
|
+
if (t === "inline") return "inline";
|
|
129
|
+
}
|
|
130
|
+
function R(n) {
|
|
131
|
+
const e = n.hooks;
|
|
132
|
+
if (N(e)) return e;
|
|
133
|
+
}
|
|
134
|
+
function U(n) {
|
|
135
|
+
const e = n.replace(/\\/g, "/").split("/").filter(Boolean), t = e[e.length - 1];
|
|
136
|
+
if (t && /^SKILL\.md$/iu.test(t) && e.length >= 2)
|
|
137
|
+
return e[e.length - 2];
|
|
138
|
+
if (t?.toLowerCase().endsWith(".skill.md"))
|
|
139
|
+
return t.replace(/\.SKILL\.md$/iu, "");
|
|
140
|
+
}
|
|
141
|
+
function j(n) {
|
|
142
|
+
return n.split(`
|
|
143
|
+
`).map((t) => t.trim()).find((t) => t && !t.startsWith("#")) ?? "未提供技能描述";
|
|
144
|
+
}
|
|
145
|
+
function K(n, e) {
|
|
146
|
+
const { data: t, body: o } = B(n), r = s(t, "name"), c = s(t, "id") ?? U(e);
|
|
147
|
+
if (!c)
|
|
148
|
+
throw new Error(`技能文件缺少 id 且无法从路径推断:${e}`);
|
|
149
|
+
const f = s(t, "description") ?? j(o), i = {
|
|
150
|
+
name: c,
|
|
151
|
+
description: f
|
|
152
|
+
};
|
|
153
|
+
r && (i.displayName = r);
|
|
154
|
+
const u = s(t, "when_to_use", "whenToUse");
|
|
155
|
+
u && (i.whenToUse = u);
|
|
156
|
+
const d = a(t, "allowed-tools", "allowedTools");
|
|
157
|
+
d && (i.allowedTools = d);
|
|
158
|
+
const p = s(t, "argument-hint", "argumentHint");
|
|
159
|
+
p && (i.argumentHint = p);
|
|
160
|
+
const m = a(
|
|
161
|
+
t,
|
|
162
|
+
"arguments",
|
|
163
|
+
"argument-names",
|
|
164
|
+
"argumentNames"
|
|
165
|
+
);
|
|
166
|
+
m && (i.argNames = m);
|
|
167
|
+
const y = a(t, "keywords");
|
|
168
|
+
y && (i.keywords = y);
|
|
169
|
+
const g = M(t);
|
|
170
|
+
g && (i.responseStrategy = g);
|
|
171
|
+
const h = $(t);
|
|
172
|
+
h && (i.assetTypes = h);
|
|
173
|
+
const k = a(t, "capability-examples", "capabilityExamples");
|
|
174
|
+
k && (i.capabilityExamples = k);
|
|
175
|
+
const S = s(t, "version");
|
|
176
|
+
S && (i.version = S);
|
|
177
|
+
const v = s(t, "model");
|
|
178
|
+
v && (i.model = v);
|
|
179
|
+
const w = A(
|
|
180
|
+
t,
|
|
181
|
+
"disable-model-invocation",
|
|
182
|
+
"disableModelInvocation"
|
|
183
|
+
);
|
|
184
|
+
w !== void 0 && (i.disableModelInvocation = w);
|
|
185
|
+
const b = A(t, "user-invocable", "userInvocable");
|
|
186
|
+
b !== void 0 && (i.userInvocable = b);
|
|
187
|
+
const x = a(t, "paths");
|
|
188
|
+
x && (i.paths = x);
|
|
189
|
+
const T = P(t);
|
|
190
|
+
T && (i.executionContext = T);
|
|
191
|
+
const E = s(t, "agent");
|
|
192
|
+
E && (i.agent = E);
|
|
193
|
+
const I = s(t, "effort") ?? (typeof t.effort == "number" && Number.isFinite(t.effort) ? String(t.effort) : void 0);
|
|
194
|
+
I && (i.effort = I);
|
|
195
|
+
const L = R(t);
|
|
196
|
+
L && (i.hooks = L);
|
|
197
|
+
const _ = s(t, "shell");
|
|
198
|
+
return _ && (i.shell = _), i;
|
|
199
|
+
}
|
|
200
|
+
export {
|
|
201
|
+
K as parseSpotlightSkillMarkdownFields
|
|
202
|
+
};
|
|
203
|
+
//# sourceMappingURL=skillFrontmatterParse.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"skillFrontmatterParse.js","sources":["../../src/skills/skillFrontmatterParse.ts"],"sourcesContent":["import { parse as parseYaml } from \"yaml\";\nimport type {\n AssetType,\n SpotlightSkill,\n SpotlightSkillResponseStrategy,\n} from \"@inupedia/spotlight-protocol\";\n\nfunction isPlainObject(v: unknown): v is Record<string, unknown> {\n return typeof v === \"object\" && v !== null && !Array.isArray(v);\n}\n\nfunction splitYamlFrontmatterBlocks(markdown: string): {\n frontmatter: string;\n body: string;\n} {\n const normalized = markdown.replace(/\\r\\n/g, \"\\n\").trim();\n if (!normalized.startsWith(\"---\\n\")) {\n return { frontmatter: \"\", body: normalized };\n }\n const end = normalized.indexOf(\"\\n---\\n\", 4);\n if (end === -1) {\n return { frontmatter: \"\", body: normalized };\n }\n return {\n frontmatter: normalized.slice(4, end).trim(),\n body: normalized.slice(end + 5).trim(),\n };\n}\n\nfunction parseSkillFrontmatterData(rawBlock: string): Record<string, unknown> {\n const trimmed = rawBlock.trim();\n if (!trimmed) return {};\n try {\n const parsed = parseYaml(trimmed);\n if (isPlainObject(parsed)) return parsed;\n } catch {\n /* fall through */\n }\n const out: Record<string, unknown> = {};\n for (const line of rawBlock.split(\"\\n\")) {\n const t = line.trim();\n if (!t || t.startsWith(\"#\")) continue;\n const idx = t.indexOf(\":\");\n if (idx <= 0) continue;\n const key = t.slice(0, idx).trim();\n const value = t.slice(idx + 1).trim();\n out[key] = value;\n }\n return out;\n}\n\nfunction splitSkillMarkdown(markdown: string): {\n data: Record<string, unknown>;\n body: string;\n} {\n const { frontmatter, body } = splitYamlFrontmatterBlocks(markdown);\n return { data: parseSkillFrontmatterData(frontmatter), body };\n}\n\nfunction stripQuotes(value: string): string {\n if (\n (value.startsWith('\"') && value.endsWith('\"')) ||\n (value.startsWith(\"'\") && value.endsWith(\"'\"))\n ) {\n return value.slice(1, -1).trim();\n }\n return value;\n}\n\nfunction pickStr(\n data: Record<string, unknown>,\n ...keys: string[]\n): string | undefined {\n for (const key of keys) {\n const v = data[key];\n if (typeof v === \"string\") {\n const s = stripQuotes(v.trim());\n if (s) return s;\n }\n if (typeof v === \"number\" && Number.isFinite(v)) return String(v);\n }\n return undefined;\n}\n\nfunction coerceStringList(value: unknown): string[] | undefined {\n if (value == null) return undefined;\n if (Array.isArray(value)) {\n const out = value\n .filter((item): item is string => typeof item === \"string\")\n .map((item) => stripQuotes(item.trim()))\n .filter(Boolean);\n return out.length ? out : undefined;\n }\n if (typeof value === \"string\") {\n const normalized = value.replace(/^\\[/, \"\").replace(/\\]$/, \"\").trim();\n if (!normalized) return undefined;\n const items = normalized\n .split(\",\")\n .map((item) => stripQuotes(item.trim()))\n .filter(Boolean);\n return items.length ? items : undefined;\n }\n return undefined;\n}\n\nfunction pickStrList(\n data: Record<string, unknown>,\n ...keys: string[]\n): string[] | undefined {\n for (const key of keys) {\n const got = coerceStringList(data[key]);\n if (got?.length) return got;\n }\n return undefined;\n}\n\nfunction pickBool(\n data: Record<string, unknown>,\n ...keys: string[]\n): boolean | undefined {\n for (const key of keys) {\n const v = data[key];\n if (typeof v === \"boolean\") return v;\n if (typeof v === \"string\") {\n const l = v.trim().toLowerCase();\n if (l === \"true\" || l === \"yes\") return true;\n if (l === \"false\" || l === \"no\") return false;\n }\n }\n return undefined;\n}\n\nconst VALID_RESPONSE_STRATEGIES = new Set<SpotlightSkillResponseStrategy>([\n \"direct_answer\",\n \"tool_answer\",\n \"clarify\",\n]);\n\nfunction pickResponseStrategy(\n data: Record<string, unknown>,\n): SpotlightSkillResponseStrategy | undefined {\n const raw = pickStr(\n data,\n \"spotlight-response-strategy\",\n \"response-strategy\",\n \"responseStrategy\",\n );\n if (!raw) return undefined;\n return VALID_RESPONSE_STRATEGIES.has(raw as SpotlightSkillResponseStrategy)\n ? (raw as SpotlightSkillResponseStrategy)\n : undefined;\n}\n\nconst VALID_ASSET_TYPES = new Set<AssetType>([\n \"video_channel\",\n \"bim_model\",\n \"device\",\n \"sensor\",\n \"panel\",\n \"scene_target\",\n]);\n\nfunction pickAssetTypes(\n data: Record<string, unknown>,\n): AssetType[] | undefined {\n const raw = pickStrList(\n data,\n \"spotlight-asset-types\",\n \"asset-types\",\n \"assetTypes\",\n );\n if (!raw) return undefined;\n const valid = raw.filter((item): item is AssetType =>\n VALID_ASSET_TYPES.has(item as AssetType),\n );\n return valid.length ? Array.from(new Set(valid)) : undefined;\n}\n\nfunction pickExecutionContext(\n data: Record<string, unknown>,\n): \"inline\" | \"fork\" | undefined {\n const ctx = pickStr(data, \"context\", \"execution-context\", \"executionContext\");\n if (!ctx) return undefined;\n const l = ctx.toLowerCase();\n if (l === \"fork\") return \"fork\";\n if (l === \"inline\") return \"inline\";\n return undefined;\n}\n\nfunction pickHooks(\n data: Record<string, unknown>,\n): Record<string, unknown> | undefined {\n const v = data.hooks;\n if (isPlainObject(v)) return v;\n return undefined;\n}\n\nfunction inferSkillIdFromSkillPath(sourcePath: string): string | undefined {\n const parts = sourcePath.replace(/\\\\/g, \"/\").split(\"/\").filter(Boolean);\n const last = parts[parts.length - 1];\n if (last && /^SKILL\\.md$/iu.test(last) && parts.length >= 2) {\n return parts[parts.length - 2];\n }\n if (last?.toLowerCase().endsWith(\".skill.md\")) {\n return last.replace(/\\.SKILL\\.md$/iu, \"\");\n }\n return undefined;\n}\n\nfunction extractFallbackDescription(body: string): string {\n const line = body\n .split(\"\\n\")\n .map((item) => item.trim())\n .find((item) => item && !item.startsWith(\"#\"));\n return line ?? \"未提供技能描述\";\n}\n\nexport function parseSpotlightSkillMarkdownFields(\n markdown: string,\n sourcePath: string,\n): SpotlightSkill {\n const { data, body } = splitSkillMarkdown(markdown);\n const displayName = pickStr(data, \"name\");\n const skillId = pickStr(data, \"id\") ?? inferSkillIdFromSkillPath(sourcePath);\n if (!skillId) {\n throw new Error(`技能文件缺少 id 且无法从路径推断:${sourcePath}`);\n }\n\n const description =\n pickStr(data, \"description\") ?? extractFallbackDescription(body);\n\n const skill: SpotlightSkill = {\n name: skillId,\n description,\n };\n if (displayName) skill.displayName = displayName;\n const whenToUse = pickStr(data, \"when_to_use\", \"whenToUse\");\n if (whenToUse) skill.whenToUse = whenToUse;\n const allowed = pickStrList(data, \"allowed-tools\", \"allowedTools\");\n if (allowed) skill.allowedTools = allowed;\n const argumentHint = pickStr(data, \"argument-hint\", \"argumentHint\");\n if (argumentHint) skill.argumentHint = argumentHint;\n const argNames = pickStrList(\n data,\n \"arguments\",\n \"argument-names\",\n \"argumentNames\",\n );\n if (argNames) skill.argNames = argNames;\n const keywords = pickStrList(data, \"keywords\");\n if (keywords) skill.keywords = keywords;\n const rs = pickResponseStrategy(data);\n if (rs) skill.responseStrategy = rs;\n const assetTypes = pickAssetTypes(data);\n if (assetTypes) skill.assetTypes = assetTypes;\n const capEx = pickStrList(data, \"capability-examples\", \"capabilityExamples\");\n if (capEx) skill.capabilityExamples = capEx;\n\n const version = pickStr(data, \"version\");\n if (version) skill.version = version;\n const model = pickStr(data, \"model\");\n if (model) skill.model = model;\n const dmi = pickBool(\n data,\n \"disable-model-invocation\",\n \"disableModelInvocation\",\n );\n if (dmi !== undefined) skill.disableModelInvocation = dmi;\n const ui = pickBool(data, \"user-invocable\", \"userInvocable\");\n if (ui !== undefined) skill.userInvocable = ui;\n const paths = pickStrList(data, \"paths\");\n if (paths) skill.paths = paths;\n const execCtx = pickExecutionContext(data);\n if (execCtx) skill.executionContext = execCtx;\n const agent = pickStr(data, \"agent\");\n if (agent) skill.agent = agent;\n const effort =\n pickStr(data, \"effort\") ??\n (typeof data.effort === \"number\" && Number.isFinite(data.effort)\n ? String(data.effort)\n : undefined);\n if (effort) skill.effort = effort;\n const hooks = pickHooks(data);\n if (hooks) skill.hooks = hooks;\n const shell = pickStr(data, \"shell\");\n if (shell) skill.shell = shell;\n\n return skill;\n}\n"],"names":["isPlainObject","v","splitYamlFrontmatterBlocks","markdown","normalized","end","parseSkillFrontmatterData","rawBlock","trimmed","parsed","parseYaml","out","line","t","idx","key","value","splitSkillMarkdown","frontmatter","body","stripQuotes","pickStr","data","keys","s","coerceStringList","item","items","pickStrList","got","pickBool","l","VALID_RESPONSE_STRATEGIES","pickResponseStrategy","raw","VALID_ASSET_TYPES","pickAssetTypes","valid","pickExecutionContext","ctx","pickHooks","inferSkillIdFromSkillPath","sourcePath","parts","last","extractFallbackDescription","parseSpotlightSkillMarkdownFields","displayName","skillId","description","skill","whenToUse","allowed","argumentHint","argNames","keywords","rs","assetTypes","capEx","version","model","dmi","ui","paths","execCtx","agent","effort","hooks","shell"],"mappings":";AAOA,SAASA,EAAcC,GAA0C;AAC/D,SAAO,OAAOA,KAAM,YAAYA,MAAM,QAAQ,CAAC,MAAM,QAAQA,CAAC;AAChE;AAEA,SAASC,EAA2BC,GAGlC;AACA,QAAMC,IAAaD,EAAS,QAAQ,SAAS;AAAA,CAAI,EAAE,KAAA;AACnD,MAAI,CAACC,EAAW,WAAW;AAAA,CAAO;AAChC,WAAO,EAAE,aAAa,IAAI,MAAMA,EAAA;AAElC,QAAMC,IAAMD,EAAW,QAAQ;AAAA;AAAA,GAAW,CAAC;AAC3C,SAAIC,MAAQ,KACH,EAAE,aAAa,IAAI,MAAMD,EAAA,IAE3B;AAAA,IACL,aAAaA,EAAW,MAAM,GAAGC,CAAG,EAAE,KAAA;AAAA,IACtC,MAAMD,EAAW,MAAMC,IAAM,CAAC,EAAE,KAAA;AAAA,EAAK;AAEzC;AAEA,SAASC,EAA0BC,GAA2C;AAC5E,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Aa,QAAQA;AACzB,QAAMC,IAAM/B;AAAA,IACVR;AAAA,IACA;AAAA,IACA;AAAA,EAAA;AAEF,EAAIuC,MAAQ,WAAWX,EAAM,yBAAyBW;AACtD,QAAMC,IAAKhC,EAASR,GAAM,kBAAkB,eAAe;AAC3D,EAAIwC,MAAO,WAAWZ,EAAM,gBAAgBY;AAC5C,QAAMC,IAAQnC,EAAYN,GAAM,OAAO;AACvC,EAAIyC,QAAa,QAAQA;AACzB,QAAMC,IAAU1B,EAAqBhB,CAAI;AACzC,EAAI0C,QAAe,mBAAmBA;AACtC,QAAMC,IAAQ5C,EAAQC,GAAM,OAAO;AACnC,EAAI2C,QAAa,QAAQA;AACzB,QAAMC,IACJ7C,EAAQC,GAAM,QAAQ,MACrB,OAAOA,EAAK,UAAW,YAAY,OAAO,SAASA,EAAK,MAAM,IAC3D,OAAOA,EAAK,MAAM,IAClB;AACN,EAAI4C,QAAc,SAASA;AAC3B,QAAMC,IAAQ3B,EAAUlB,CAAI;AAC5B,EAAI6C,QAAa,QAAQA;AACzB,QAAMC,IAAQ/C,EAAQC,GAAM,OAAO;AACnC,SAAI8C,QAAa,QAAQA,IAElBlB;AACT;"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { SpotlightSkill } from "@inupedia/spotlight-protocol";
|
|
2
|
+
export declare const SKILL_BUDGET_CONTEXT_PERCENT = 0.01;
|
|
3
|
+
export declare const CHARS_PER_TOKEN = 4;
|
|
4
|
+
export declare const DEFAULT_CHAR_BUDGET = 8000;
|
|
5
|
+
export declare const MAX_LISTING_DESC_CHARS = 250;
|
|
6
|
+
export declare function getSkillListingCharBudget(contextWindowTokens?: number): number;
|
|
7
|
+
/** 预算内 skill 名录(对齐 Inupedia Agent Skills skill_listing / 服务端 skillListing.ts)。 */
|
|
8
|
+
export declare function formatSkillsWithinBudget(skills: SpotlightSkill[], contextWindowTokens?: number): string;
|
|
9
|
+
//# sourceMappingURL=skillListing.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"skillListing.d.ts","sourceRoot":"","sources":["../../src/skills/skillListing.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AAEnE,eAAO,MAAM,4BAA4B,OAAO,CAAC;AACjD,eAAO,MAAM,eAAe,IAAI,CAAC;AACjC,eAAO,MAAM,mBAAmB,OAAQ,CAAC;AACzC,eAAO,MAAM,sBAAsB,MAAM,CAAC;AAE1C,wBAAgB,yBAAyB,CACvC,mBAAmB,CAAC,EAAE,MAAM,GAC3B,MAAM,CAWR;AAgBD,kFAAkF;AAClF,wBAAgB,wBAAwB,CACtC,MAAM,EAAE,cAAc,EAAE,EACxB,mBAAmB,CAAC,EAAE,MAAM,GAC3B,MAAM,CAqCR"}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
const S = 0.01, f = 4, C = 8e3, B = 250;
|
|
2
|
+
function E(t) {
|
|
3
|
+
return Number.isFinite(NaN), t && t > 0 ? Math.floor(
|
|
4
|
+
t * 4 * 0.01
|
|
5
|
+
) : 8e3;
|
|
6
|
+
}
|
|
7
|
+
function h(t) {
|
|
8
|
+
const n = (t.whenToUse ? `${t.description} - ${t.whenToUse}` : t.description).trim();
|
|
9
|
+
return n.length <= 250 ? n : `${n.slice(0, 249)}…`;
|
|
10
|
+
}
|
|
11
|
+
function m(t) {
|
|
12
|
+
const i = t.displayName ?? t.name;
|
|
13
|
+
return `- ${t.name}(${i}):${h(t)}`;
|
|
14
|
+
}
|
|
15
|
+
function L(t, i) {
|
|
16
|
+
if (t.length === 0) return "";
|
|
17
|
+
const n = E(i), c = t.map((e) => ({
|
|
18
|
+
skill: e,
|
|
19
|
+
line: m(e)
|
|
20
|
+
}));
|
|
21
|
+
if (c.reduce((e, r) => e + r.line.length, 0) + Math.max(0, c.length - 1) <= n)
|
|
22
|
+
return c.map((e) => e.line).join(`
|
|
23
|
+
`);
|
|
24
|
+
const a = 20, o = [...t];
|
|
25
|
+
let g = n;
|
|
26
|
+
const s = [];
|
|
27
|
+
for (; o.length > 0; ) {
|
|
28
|
+
const e = Math.max(
|
|
29
|
+
a,
|
|
30
|
+
Math.floor(g / o.length)
|
|
31
|
+
), r = o.shift(), l = `- ${r.name}(${r.displayName ?? r.name}):`, _ = Math.max(a, e - l.length), u = h(r), d = u.length > _ ? `${u.slice(0, _ - 1)}…` : u;
|
|
32
|
+
s.push(`${l}${d}`), g -= s.at(-1).length + 1;
|
|
33
|
+
}
|
|
34
|
+
return s.join(`
|
|
35
|
+
`);
|
|
36
|
+
}
|
|
37
|
+
export {
|
|
38
|
+
f as CHARS_PER_TOKEN,
|
|
39
|
+
C as DEFAULT_CHAR_BUDGET,
|
|
40
|
+
B as MAX_LISTING_DESC_CHARS,
|
|
41
|
+
S as SKILL_BUDGET_CONTEXT_PERCENT,
|
|
42
|
+
L as formatSkillsWithinBudget,
|
|
43
|
+
E as getSkillListingCharBudget
|
|
44
|
+
};
|
|
45
|
+
//# sourceMappingURL=skillListing.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"skillListing.js","sources":["../../src/skills/skillListing.ts"],"sourcesContent":["import type { SpotlightSkill } from \"@inupedia/spotlight-protocol\";\n\nexport const SKILL_BUDGET_CONTEXT_PERCENT = 0.01;\nexport const CHARS_PER_TOKEN = 4;\nexport const DEFAULT_CHAR_BUDGET = 8_000;\nexport const MAX_LISTING_DESC_CHARS = 250;\n\nexport function getSkillListingCharBudget(\n contextWindowTokens?: number,\n): number {\n const envBudget = Number(\n import.meta.env.VITE_SPOTLIGHT_SKILL_LISTING_CHAR_BUDGET,\n );\n if (Number.isFinite(envBudget) && envBudget > 0) return envBudget;\n if (contextWindowTokens && contextWindowTokens > 0) {\n return Math.floor(\n contextWindowTokens * CHARS_PER_TOKEN * SKILL_BUDGET_CONTEXT_PERCENT,\n );\n }\n return DEFAULT_CHAR_BUDGET;\n}\n\nfunction getSkillListingDescription(skill: SpotlightSkill): string {\n const desc = skill.whenToUse\n ? `${skill.description} - ${skill.whenToUse}`\n : skill.description;\n const trimmed = desc.trim();\n if (trimmed.length <= MAX_LISTING_DESC_CHARS) return trimmed;\n return `${trimmed.slice(0, MAX_LISTING_DESC_CHARS - 1)}…`;\n}\n\nfunction formatSkillListingEntry(skill: SpotlightSkill): string {\n const label = skill.displayName ?? skill.name;\n return `- ${skill.name}(${label}):${getSkillListingDescription(skill)}`;\n}\n\n/** 预算内 skill 名录(对齐 Inupedia Agent Skills skill_listing / 服务端 skillListing.ts)。 */\nexport function formatSkillsWithinBudget(\n skills: SpotlightSkill[],\n contextWindowTokens?: number,\n): string {\n if (skills.length === 0) return \"\";\n\n const budget = getSkillListingCharBudget(contextWindowTokens);\n const entries = skills.map((skill) => ({\n skill,\n line: formatSkillListingEntry(skill),\n }));\n const fullTotal =\n entries.reduce((sum, entry) => sum + entry.line.length, 0) +\n Math.max(0, entries.length - 1);\n\n if (fullTotal <= budget) {\n return entries.map((entry) => entry.line).join(\"\\n\");\n }\n\n const minDescLength = 20;\n const rest = [...skills];\n let currentBudget = budget;\n const lines: string[] = [];\n\n while (rest.length > 0) {\n const perSkillBudget = Math.max(\n minDescLength,\n Math.floor(currentBudget / rest.length),\n );\n const skill = rest.shift()!;\n const base = `- ${skill.name}(${skill.displayName ?? skill.name}):`;\n const descBudget = Math.max(minDescLength, perSkillBudget - base.length);\n const desc = getSkillListingDescription(skill);\n const truncated =\n desc.length > descBudget ? `${desc.slice(0, descBudget - 1)}…` : desc;\n lines.push(`${base}${truncated}`);\n currentBudget -= lines.at(-1)!.length + 1;\n }\n\n return lines.join(\"\\n\");\n}\n"],"names":["SKILL_BUDGET_CONTEXT_PERCENT","CHARS_PER_TOKEN","DEFAULT_CHAR_BUDGET","MAX_LISTING_DESC_CHARS","getSkillListingCharBudget","contextWindowTokens","getSkillListingDescription","skill","trimmed","formatSkillListingEntry","label","formatSkillsWithinBudget","skills","budget","entries","sum","entry","minDescLength","rest","currentBudget","lines","per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AAA,IAAA,GAElCX,IAAQW,EAAK,MAAA,GACbI,IAAO,KAAKf,EAAM,IAAI,IAAIA,EAAM,eAAeA,EAAM,IAAI,MACzDgB,IAAa,KAAK,IAAIN,GAAeI,IAAiBC,EAAK,MAAM,GACjEE,IAAOlB,EAA2BC,CAAK,GACvCkB,IACJD,EAAK,SAASD,IAAa,GAAGC,EAAK,MAAM,GAAGD,IAAa,CAAC,CAAC,MAAMC;AACnE,IAAAJ,EAAM,KAAK,GAAGE,CAAI,GAAGG,CAAS,EAAE,GAChCN,KAAiBC,EAAM,GAAG,EAAE,EAAG,SAAS;AAAA,EAC1C;AAEA,SAAOA,EAAM,KAAK;AAAA,CAAI;AACxB;"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { SpotlightSkill } from "@inupedia/spotlight-protocol";
|
|
2
|
+
export declare function inferSkillRootFromSourcePath(sourcePath: string): string | undefined;
|
|
3
|
+
export declare function resolveSkillRoot(skillName: string, skills: SpotlightSkill[], projectDir: string): string | undefined;
|
|
4
|
+
//# sourceMappingURL=skillPaths.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"skillPaths.d.ts","sourceRoot":"","sources":["../../src/skills/skillPaths.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AAEnE,wBAAgB,4BAA4B,CAC1C,UAAU,EAAE,MAAM,GACjB,MAAM,GAAG,SAAS,CAMpB;AAED,wBAAgB,gBAAgB,CAC9B,SAAS,EAAE,MAAM,EACjB,MAAM,EAAE,cAAc,EAAE,EACxB,UAAU,EAAE,MAAM,GACjB,MAAM,GAAG,SAAS,CAiBpB"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
function l(r) {
|
|
2
|
+
const o = r.replace(/\\/g, "/");
|
|
3
|
+
if (o.endsWith("/SKILL.md"))
|
|
4
|
+
return o.slice(0, -9);
|
|
5
|
+
}
|
|
6
|
+
function n(r, o, i) {
|
|
7
|
+
const t = o.find((e) => e.name === r);
|
|
8
|
+
if (t) {
|
|
9
|
+
if (t.skillRoot)
|
|
10
|
+
return t.skillRoot.startsWith("/") ? t.skillRoot : `${i.replace(/\/$/, "")}/${t.skillRoot.replace(/^\.\//, "")}`;
|
|
11
|
+
if (t.sourcePath) {
|
|
12
|
+
const e = l(t.sourcePath);
|
|
13
|
+
if (e)
|
|
14
|
+
return e.startsWith("/") ? e : `${i.replace(/\/$/, "")}/${e.replace(/^\.\//, "")}`;
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
export {
|
|
19
|
+
l as inferSkillRootFromSourcePath,
|
|
20
|
+
n as resolveSkillRoot
|
|
21
|
+
};
|
|
22
|
+
//# sourceMappingURL=skillPaths.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"skillPaths.js","sources":["../../src/skills/skillPaths.ts"],"sourcesContent":["import type { SpotlightSkill } from \"@inupedia/spotlight-protocol\";\n\nexport function inferSkillRootFromSourcePath(\n sourcePath: string,\n): string | undefined {\n const norm = sourcePath.replace(/\\\\/g, \"/\");\n if (norm.endsWith(\"/SKILL.md\")) {\n return norm.slice(0, -\"/SKILL.md\".length);\n }\n return undefined;\n}\n\nexport function resolveSkillRoot(\n skillName: string,\n skills: SpotlightSkill[],\n projectDir: string,\n): string | undefined {\n const skill = skills.find((item) => item.name === skillName);\n if (!skill) return undefined;\n if (skill.skillRoot) {\n return skill.skillRoot.startsWith(\"/\")\n ? skill.skillRoot\n : `${projectDir.replace(/\\/$/, \"\")}/${skill.skillRoot.replace(/^\\.\\//, \"\")}`;\n }\n if (skill.sourcePath) {\n const relative = inferSkillRootFromSourcePath(skill.sourcePath);\n if (relative) {\n return relative.startsWith(\"/\")\n ? relative\n : `${projectDir.replace(/\\/$/, \"\")}/${relative.replace(/^\\.\\//, \"\")}`;\n }\n }\n return undefined;\n}\n"],"names":["inferSkillRootFromSourcePath","sourcePath","norm","resolveSkillRoot","skillName","skills","projectDir","skill","item","relative"],"mappings":"AAEO,SAASA,EACdC,GACoB;AACpB,QAAMC,IAAOD,EAAW,QAAQ,OAAO,GAAG;AAC1C,MAAIC,EAAK,SAAS,WAAW;AAC3B,WAAOA,EAAK,MAAM,GAAG,EAAmB;AAG5C;AAEO,SAASC,EACdC,GACAC,GACAC,GACoB;AACpB,QAAMC,IAAQF,EAAO,KAAK,CAACG,MAASA,EAAK,SAASJ,CAAS;AAC3D,MAAKG,GACL;AAAA,QAAIA,EAAM;AACR,aAAOA,EAAM,UAAU,WAAW,GAAG,IACjCA,EAAM,YACN,GAAGD,EAAW,QAAQ,OAAO,EAAE,CAAC,IAAIC,EAAM,UAAU,QAAQ,SAAS,EAAE,CAAC;AAE9E,QAAIA,EAAM,YAAY;AACpB,YAAME,IAAWT,EAA6BO,EAAM,UAAU;AAC9D,UAAIE;AACF,eAAOA,EAAS,WAAW,GAAG,IAC1BA,IACA,GAAGH,EAAW,QAAQ,OAAO,EAAE,CAAC,IAAIG,EAAS,QAAQ,SAAS,EAAE,CAAC;AAAA,IAEzE;AAAA;AAEF;"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/** UI suggestion chips from spotlight-server `/v1/meta/ui-prompts`. */
|
|
2
|
+
export declare function getSuggestedQuestions(params: {
|
|
3
|
+
sceneLevel: number | null | undefined;
|
|
4
|
+
smallTab?: string | null;
|
|
5
|
+
activeTarget?: string | null;
|
|
6
|
+
}): string[];
|
|
7
|
+
//# sourceMappingURL=capabilities.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"capabilities.d.ts","sourceRoot":"","sources":["../../src/store/capabilities.ts"],"names":[],"mappings":"AAuBA,uEAAuE;AACvE,wBAAgB,qBAAqB,CAAC,MAAM,EAAE;IAC5C,UAAU,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,CAAC;IACtC,QAAQ,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,YAAY,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CAC9B,GAAG,MAAM,EAAE,CAEX"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { getSpotlightUiPrompts as l } from "../remote/meta.js";
|
|
2
|
+
function n(e) {
|
|
3
|
+
const t = l().suggestionChips;
|
|
4
|
+
return e.activeTarget && t[`activeTarget:${e.activeTarget}`]?.length ? [...t[`activeTarget:${e.activeTarget}`]] : e.smallTab && t[`smallTab:${e.smallTab}`]?.length ? [...t[`smallTab:${e.smallTab}`]] : e.sceneLevel != null && t[`sceneLevel:${e.sceneLevel}`]?.length ? [...t[`sceneLevel:${e.sceneLevel}`]] : t.default?.length ? [...t.default] : ["你能做什么"];
|
|
5
|
+
}
|
|
6
|
+
function g(e) {
|
|
7
|
+
return n(e);
|
|
8
|
+
}
|
|
9
|
+
export {
|
|
10
|
+
g as getSuggestedQuestions
|
|
11
|
+
};
|
|
12
|
+
//# sourceMappingURL=capabilities.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"capabilities.js","sources":["../../src/store/capabilities.ts"],"sourcesContent":["import { getSpotlightUiPrompts } from \"../remote/meta.js\";\n\nfunction pickSuggestionChips(params: {\n sceneLevel: number | null | undefined;\n smallTab?: string | null;\n activeTarget?: string | null;\n}): string[] {\n const chips = getSpotlightUiPrompts().suggestionChips;\n if (\n params.activeTarget &&\n chips[`activeTarget:${params.activeTarget}`]?.length\n ) {\n return [...chips[`activeTarget:${params.activeTarget}`]!];\n }\n if (params.smallTab && chips[`smallTab:${params.smallTab}`]?.length) {\n return [...chips[`smallTab:${params.smallTab}`]!];\n }\n if (params.sceneLevel != null && chips[`sceneLevel:${params.sceneLevel}`]?.length) {\n return [...chips[`sceneLevel:${params.sceneLevel}`]!];\n }\n return chips.default?.length ? [...chips.default] : [\"你能做什么\"];\n}\n\n/** UI suggestion chips from spotlight-server `/v1/meta/ui-prompts`. */\nexport function getSuggestedQuestions(params: {\n sceneLevel: number | null | undefined;\n smallTab?: string | null;\n activeTarget?: string | null;\n}): string[] {\n return pickSuggestionChips(params);\n}\n"],"names":["pickSuggestionChips","params","chips","getSpotlightUiPrompts","getSuggestedQuestions"],"mappings":";AAEA,SAASA,EAAoBC,GAIhB;AACX,QAAMC,IAAQC,IAAwB;AACtC,SACEF,EAAO,gBACPC,EAAM,gBAAgBD,EAAO,YAAY,EAAE,GAAG,SAEvC,CAAC,GAAGC,EAAM,gBAAgBD,EAAO,YAAY,EAAE,CAAE,IAEtDA,EAAO,YAAYC,EAAM,YAAYD,EAAO,QAAQ,EAAE,GAAG,SACpD,CAAC,GAAGC,EAAM,YAAYD,EAAO,QAAQ,EAAE,CAAE,IAE9CA,EAAO,cAAc,QAAQC,EAAM,cAAcD,EAAO,UAAU,EAAE,GAAG,SAClE,CAAC,GAAGC,EAAM,cAAcD,EAAO,UAAU,EAAE,CAAE,IAE/CC,EAAM,SAAS,SAAS,CAAC,GAAGA,EAAM,OAAO,IAAI,CAAC,OAAO;AAC9D;AAGO,SAASE,EAAsBH,GAIzB;AACX,SAAOD,EAAoBC,CAAM;AACnC;"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Spotlight 常量
|
|
3
|
+
*/
|
|
4
|
+
export declare const SPOTLIGHT_RECENT_KEY = "spotlight-recent-questions";
|
|
5
|
+
export declare const RECENT_QUESTIONS_MAX = 10;
|
|
6
|
+
/** progress 意图下「数据分析」步骤的占位文案(后续替换为 LLM 基于真实数据的报告) */
|
|
7
|
+
export declare const PROGRESS_ANALYSIS_PLACEHOLDER = "\u901A\u8FC7\u4EBA\u5DE5\u586B\u62A5\u6570\u636E\uFF0C\u7CFB\u7EDF\u8BFB\u53D6\u5E76\u6C47\u603B\u4E86\u5404\u65BD\u5DE5\u73ED\u7EC4\u63D0\u4EA4\u7684\u6BCF\u65E5\u6398\u8FDB\u8BB0\u5F55\uFF0C\u5F97\u51FA\u5F53\u524D\u7D2F\u8BA1\u8FDB\u5C3A\u4E3A [\u586B\u5199\u6570\u503C] \u7C73\uFF0C\u4ECA\u65E5\u6398\u8FDB [\u586B\u5199\u6570\u503C]\u7C73\u3002\n\u540C\u65F6\uFF0C\u7CFB\u7EDF\u57FA\u4E8E\u7B97\u6CD5\u6A21\u578B\u5BF9\u591A\u6E90\u6570\u636E\u8FDB\u884C\u667A\u80FD\u5206\u6790\uFF1A\u901A\u8FC7\u63D0\u53D6\u65BD\u5DE5\u4EBA\u5458\u5B9A\u4F4D\u5386\u53F2\u4E2D\u8DDD\u79BB\u6D1E\u53E3\u6700\u8FDC\u7684\u8FDB\u6DF1\u4F4D\u7F6E\uFF0C\u7ED3\u5408\u540C\u671F\u8FD0\u6E23\u8F66\u8FD0\u8F93\u9891\u6B21\u4E0E\u8F7D\u91CD\u53CD\u7B97\u7684\u5F00\u6316\u65B9\u91CF\uFF0C\u5E76\u4F9D\u636E\u8BE5\u638C\u5B50\u9762\u7684\u8BBE\u8BA1\u65AD\u9762\u9762\u79EF\u8FDB\u884C\u6298\u7B97\uFF0C\u6A21\u578B\u8BA1\u7B97\u51FA\u5F53\u524D\u96A7\u6D1E\u8FDB\u5EA6\u7EA6\u4E3A [\u586B\u5199\u6570\u503C] \u7C73\u3002\n\u4E24\u79CD\u65B9\u6CD5\u6240\u5F97\u8FDB\u5EA6\u6570\u636E\u5DF2\u8FDB\u884C\u4EA4\u53C9\u9A8C\u8BC1\u4E0E\u5BF9\u6BD4\uFF0C\u4E3A\u8FDB\u5EA6\u7BA1\u7406\u63D0\u4F9B\u53CC\u91CD\u53C2\u8003\u3002";
|
|
8
|
+
//# sourceMappingURL=constants.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../src/store/constants.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,eAAO,MAAM,oBAAoB,+BAA+B,CAAC;AACjE,eAAO,MAAM,oBAAoB,KAAK,CAAC;AAEvC,qDAAqD;AACrD,eAAO,MAAM,6BAA6B,wrCAER,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constants.js","sources":["../../src/store/constants.ts"],"sourcesContent":["/**\n * Spotlight 常量\n */\n\nexport const SPOTLIGHT_RECENT_KEY = \"spotlight-recent-questions\";\nexport const RECENT_QUESTIONS_MAX = 10;\n\n/** progress 意图下「数据分析」步骤的占位文案(后续替换为 LLM 基于真实数据的报告) */\nexport const PROGRESS_ANALYSIS_PLACEHOLDER = `通过人工填报数据,系统读取并汇总了各施工班组提交的每日掘进记录,得出当前累计进尺为 [填写数值] 米,今日掘进 [填写数值]米。\n同时,系统基于算法模型对多源数据进行智能分析:通过提取施工人员定位历史中距离洞口最远的进深位置,结合同期运渣车运输频次与载重反算的开挖方量,并依据该掌子面的设计断面面积进行折算,模型计算出当前隧洞进度约为 [填写数值] 米。\n两种方法所得进度数据已进行交叉验证与对比,为进度管理提供双重参考。`;\n"],"names":["SPOTLIGHT_RECENT_KEY","RECENT_QUESTIONS_MAX"],"mappings":"AAIO,MAAMA,IAAuB,8BACvBC,IAAuB;"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Live2D 浮层:默认隐藏,按 ⌘/Ctrl+L 显示/隐藏人物。
|
|
3
|
+
*/
|
|
4
|
+
export declare const useLive2dOverlayStore: import("pinia").StoreDefinition<"live2dOverlay", Pick<{
|
|
5
|
+
visible: import("vue").Ref<boolean, boolean>;
|
|
6
|
+
toggle: () => void;
|
|
7
|
+
show: () => void;
|
|
8
|
+
hide: () => void;
|
|
9
|
+
}, "visible">, Pick<{
|
|
10
|
+
visible: import("vue").Ref<boolean, boolean>;
|
|
11
|
+
toggle: () => void;
|
|
12
|
+
show: () => void;
|
|
13
|
+
hide: () => void;
|
|
14
|
+
}, never>, Pick<{
|
|
15
|
+
visible: import("vue").Ref<boolean, boolean>;
|
|
16
|
+
toggle: () => void;
|
|
17
|
+
show: () => void;
|
|
18
|
+
hide: () => void;
|
|
19
|
+
}, "toggle" | "show" | "hide">>;
|
|
20
|
+
//# sourceMappingURL=live2dOverlayStore.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"live2dOverlayStore.d.ts","sourceRoot":"","sources":["../../src/store/live2dOverlayStore.ts"],"names":[],"mappings":"AAGA;;GAEG;AACH,eAAO,MAAM,qBAAqB;;;;;;;;;;;;;;;+BAgBhC,CAAC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { defineStore as i } from "pinia";
|
|
2
|
+
import { ref as l } from "vue";
|
|
3
|
+
const f = i("live2dOverlay", () => {
|
|
4
|
+
const e = l(!1);
|
|
5
|
+
function o() {
|
|
6
|
+
e.value = !e.value;
|
|
7
|
+
}
|
|
8
|
+
function r() {
|
|
9
|
+
e.value = !0;
|
|
10
|
+
}
|
|
11
|
+
function t() {
|
|
12
|
+
e.value = !1;
|
|
13
|
+
}
|
|
14
|
+
return { visible: e, toggle: o, show: r, hide: t };
|
|
15
|
+
});
|
|
16
|
+
export {
|
|
17
|
+
f as useLive2dOverlayStore
|
|
18
|
+
};
|
|
19
|
+
//# sourceMappingURL=live2dOverlayStore.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"live2dOverlayStore.js","sources":["../../src/store/live2dOverlayStore.ts"],"sourcesContent":["import { defineStore } from \"pinia\";\nimport { ref } from \"vue\";\n\n/**\n * Live2D 浮层:默认隐藏,按 ⌘/Ctrl+L 显示/隐藏人物。\n */\nexport const useLive2dOverlayStore = defineStore(\"live2dOverlay\", () => {\n const visible = ref(false);\n\n function toggle() {\n visible.value = !visible.value;\n }\n\n function show() {\n visible.value = true;\n }\n\n function hide() {\n visible.value = false;\n }\n\n return { visible, toggle, show, hide };\n});\n"],"names":["useLive2dOverlayStore","defineStore","visible","ref","toggle","show","hide"],"mappings":";;AAMO,MAAMA,IAAwBC,EAAY,iBAAiB,MAAM;AACtE,QAAMC,IAAUC,EAAI,EAAK;AAEzB,WAASC,IAAS;AAChB,IAAAF,EAAQ,QAAQ,CAACA,EAAQ;AAAA,EAC3B;AAEA,WAASG,IAAO;AACd,IAAAH,EAAQ,QAAQ;AAAA,EAClB;AAEA,WAASI,IAAO;AACd,IAAAJ,EAAQ,QAAQ;AAAA,EAClB;AAEA,SAAO,EAAE,SAAAA,GAAS,QAAAE,GAAQ,MAAAC,GAAM,MAAAC,EAAA;AAClC,CAAC;"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
export declare const useLive2dSpeechStore: import("pinia").StoreDefinition<"live2dSpeech", Pick<{
|
|
2
|
+
message: import("vue").Ref<string, string>;
|
|
3
|
+
speaking: import("vue").Ref<boolean, boolean>;
|
|
4
|
+
revealInstant: import("vue").Ref<boolean, boolean>;
|
|
5
|
+
start: (messageText: string, options?: {
|
|
6
|
+
instant?: boolean;
|
|
7
|
+
}) => void;
|
|
8
|
+
finish: () => void;
|
|
9
|
+
reset: () => void;
|
|
10
|
+
}, "message" | "speaking" | "revealInstant">, Pick<{
|
|
11
|
+
message: import("vue").Ref<string, string>;
|
|
12
|
+
speaking: import("vue").Ref<boolean, boolean>;
|
|
13
|
+
revealInstant: import("vue").Ref<boolean, boolean>;
|
|
14
|
+
start: (messageText: string, options?: {
|
|
15
|
+
instant?: boolean;
|
|
16
|
+
}) => void;
|
|
17
|
+
finish: () => void;
|
|
18
|
+
reset: () => void;
|
|
19
|
+
}, never>, Pick<{
|
|
20
|
+
message: import("vue").Ref<string, string>;
|
|
21
|
+
speaking: import("vue").Ref<boolean, boolean>;
|
|
22
|
+
revealInstant: import("vue").Ref<boolean, boolean>;
|
|
23
|
+
start: (messageText: string, options?: {
|
|
24
|
+
instant?: boolean;
|
|
25
|
+
}) => void;
|
|
26
|
+
finish: () => void;
|
|
27
|
+
reset: () => void;
|
|
28
|
+
}, "reset" | "start" | "finish">>;
|
|
29
|
+
//# sourceMappingURL=live2dSpeechStore.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"live2dSpeechStore.d.ts","sourceRoot":"","sources":["../../src/store/live2dSpeechStore.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,oBAAoB;;;;yBAMH,MAAM,YAAY;QAAE,OAAO,CAAC,EAAE,OAAO,CAAA;KAAE;;;;;;;yBAAvC,MAAM,YAAY;QAAE,OAAO,CAAC,EAAE,OAAO,CAAA;KAAE;;;;;;;yBAAvC,MAAM,YAAY;QAAE,OAAO,CAAC,EAAE,OAAO,CAAA;KAAE;;;iCAiBnE,CAAC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { defineStore as i } from "pinia";
|
|
2
|
+
import { ref as s } from "vue";
|
|
3
|
+
const c = i("live2dSpeech", () => {
|
|
4
|
+
const t = s(""), e = s(!1), a = s(!1);
|
|
5
|
+
function n(f, o) {
|
|
6
|
+
t.value = f.trim(), a.value = o?.instant ?? !1, e.value = !0;
|
|
7
|
+
}
|
|
8
|
+
function l() {
|
|
9
|
+
e.value = !1;
|
|
10
|
+
}
|
|
11
|
+
function r() {
|
|
12
|
+
t.value = "", e.value = !1, a.value = !1;
|
|
13
|
+
}
|
|
14
|
+
return { message: t, speaking: e, revealInstant: a, start: n, finish: l, reset: r };
|
|
15
|
+
});
|
|
16
|
+
export {
|
|
17
|
+
c as useLive2dSpeechStore
|
|
18
|
+
};
|
|
19
|
+
//# sourceMappingURL=live2dSpeechStore.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"live2dSpeechStore.js","sources":["../../src/store/live2dSpeechStore.ts"],"sourcesContent":["import { defineStore } from \"pinia\";\nimport { ref } from \"vue\";\n\nexport const useLive2dSpeechStore = defineStore(\"live2dSpeech\", () => {\n const message = ref(\"\");\n const speaking = ref(false);\n /** 为 true 时气泡一次性显示全文(与 TTS 播放对齐,避免打字机滞后于语音) */\n const revealInstant = ref(false);\n\n function start(messageText: string, options?: { instant?: boolean }) {\n message.value = messageText.trim();\n revealInstant.value = options?.instant ?? false;\n speaking.value = true;\n }\n\n function finish() {\n speaking.value = false;\n }\n\n function reset() {\n message.value = \"\";\n speaking.value = false;\n revealInstant.value = false;\n }\n\n return { message, speaking, revealInstant, start, finish, reset };\n});\n"],"names":["useLive2dSpeechStore","defineStore","message","ref","speaking","revealInstant","start","messageText","options","finish","reset"],"mappings":";;AAGO,MAAMA,IAAuBC,EAAY,gBAAgB,MAAM;AACpE,QAAMC,IAAUC,EAAI,EAAE,GAChBC,IAAWD,EAAI,EAAK,GAEpBE,IAAgBF,EAAI,EAAK;AAE/B,WAASG,EAAMC,GAAqBC,GAAiC;AACnE,IAAAN,EAAQ,QAAQK,EAAY,KAAA,GAC5BF,EAAc,QAAQG,GAAS,WAAW,IAC1CJ,EAAS,QAAQ;AAAA,EACnB;AAEA,WAASK,IAAS;AAChB,IAAAL,EAAS,QAAQ;AAAA,EACnB;AAEA,WAASM,IAAQ;AACf,IAAAR,EAAQ,QAAQ,IAChBE,EAAS,QAAQ,IACjBC,EAAc,QAAQ;AAAA,EACxB;AAEA,SAAO,EAAE,SAAAH,GAAS,UAAAE,GAAU,eAAAC,GAAe,OAAAC,GAAO,QAAAG,GAAQ,OAAAC,EAAA;AAC5D,CAAC;"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/** 数字人浮层下的语音通道 UI(与 GlobalSpotlight 长按 ` 键同步) */
|
|
2
|
+
export declare const useLive2dVoiceChannelStore: import("pinia").StoreDefinition<"live2dVoiceChannel", Pick<{
|
|
3
|
+
recording: import("vue").Ref<boolean, boolean>;
|
|
4
|
+
transcribing: import("vue").Ref<boolean, boolean>;
|
|
5
|
+
setRecording: (on: boolean) => void;
|
|
6
|
+
setTranscribing: (on: boolean) => void;
|
|
7
|
+
reset: () => void;
|
|
8
|
+
}, "recording" | "transcribing">, Pick<{
|
|
9
|
+
recording: import("vue").Ref<boolean, boolean>;
|
|
10
|
+
transcribing: import("vue").Ref<boolean, boolean>;
|
|
11
|
+
setRecording: (on: boolean) => void;
|
|
12
|
+
setTranscribing: (on: boolean) => void;
|
|
13
|
+
reset: () => void;
|
|
14
|
+
}, never>, Pick<{
|
|
15
|
+
recording: import("vue").Ref<boolean, boolean>;
|
|
16
|
+
transcribing: import("vue").Ref<boolean, boolean>;
|
|
17
|
+
setRecording: (on: boolean) => void;
|
|
18
|
+
setTranscribing: (on: boolean) => void;
|
|
19
|
+
reset: () => void;
|
|
20
|
+
}, "reset" | "setRecording" | "setTranscribing">>;
|
|
21
|
+
//# sourceMappingURL=live2dVoiceChannelStore.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"live2dVoiceChannelStore.d.ts","sourceRoot":"","sources":["../../src/store/live2dVoiceChannelStore.ts"],"names":[],"mappings":"AAGA,iDAAiD;AACjD,eAAO,MAAM,0BAA0B;;;uBAMT,OAAO;0BAKJ,OAAO;;;;;uBALV,OAAO;0BAKJ,OAAO;;;;;uBALV,OAAO;0BAKJ,OAAO;;iDAYvC,CAAC"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { defineStore as l } from "pinia";
|
|
2
|
+
import { ref as r } from "vue";
|
|
3
|
+
const c = l(
|
|
4
|
+
"live2dVoiceChannel",
|
|
5
|
+
() => {
|
|
6
|
+
const n = r(!1), i = r(!1);
|
|
7
|
+
function a(e) {
|
|
8
|
+
n.value = e, e && (i.value = !1);
|
|
9
|
+
}
|
|
10
|
+
function t(e) {
|
|
11
|
+
i.value = e, e && (n.value = !1);
|
|
12
|
+
}
|
|
13
|
+
function f() {
|
|
14
|
+
n.value = !1, i.value = !1;
|
|
15
|
+
}
|
|
16
|
+
return { recording: n, transcribing: i, setRecording: a, setTranscribing: t, reset: f };
|
|
17
|
+
}
|
|
18
|
+
);
|
|
19
|
+
export {
|
|
20
|
+
c as useLive2dVoiceChannelStore
|
|
21
|
+
};
|
|
22
|
+
//# sourceMappingURL=live2dVoiceChannelStore.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"live2dVoiceChannelStore.js","sources":["../../src/store/live2dVoiceChannelStore.ts"],"sourcesContent":["import { defineStore } from \"pinia\";\nimport { ref } from \"vue\";\n\n/** 数字人浮层下的语音通道 UI(与 GlobalSpotlight 长按 ` 键同步) */\nexport const useLive2dVoiceChannelStore = defineStore(\n \"live2dVoiceChannel\",\n () => {\n const recording = ref(false);\n const transcribing = ref(false);\n\n function setRecording(on: boolean) {\n recording.value = on;\n if (on) transcribing.value = false;\n }\n\n function setTranscribing(on: boolean) {\n transcribing.value = on;\n if (on) recording.value = false;\n }\n\n function reset() {\n recording.value = false;\n transcribing.value = false;\n }\n\n return { recording, transcribing, setRecording, setTranscribing, reset };\n },\n);\n"],"names":["useLive2dVoiceChannelStore","defineStore","recording","ref","transcribing","setRecording","on","setTranscribing","reset"],"mappings":";;AAIO,MAAMA,IAA6BC;AAAA,EACxC;AAAA,EACA,MAAM;AACJ,UAAMC,IAAYC,EAAI,EAAK,GACrBC,IAAeD,EAAI,EAAK;AAE9B,aAASE,EAAaC,GAAa;AACjC,MAAAJ,EAAU,QAAQI,GACdA,QAAiB,QAAQ;AAAA,IAC/B;AAEA,aAASC,EAAgBD,GAAa;AACpC,MAAAF,EAAa,QAAQE,GACjBA,QAAc,QAAQ;AAAA,IAC5B;AAEA,aAASE,IAAQ;AACf,MAAAN,EAAU,QAAQ,IAClBE,EAAa,QAAQ;AAAA,IACvB;AAEA,WAAO,EAAE,WAAAF,GAAW,cAAAE,GAAc,cAAAC,GAAc,iBAAAE,GAAiB,OAAAC,EAAA;AAAA,EACnE;AACF;"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { HandlerApi } from "./types.js";
|
|
2
|
+
type SpotlightHandlerApiBindings = Pick<HandlerApi, "getSteps" | "getSignal" | "setSteps" | "setStep" | "typewriterToStep" | "typewriterAppendToStep" | "setError" | "setResult" | "appendAttachmentsToStep" | "appendChatItemsToStep" | "appendFilesToStep" | "appendToolCallsToStep" | "appendExecutionEvent">;
|
|
3
|
+
export declare function buildSpotlightHandlerApi(bindings: SpotlightHandlerApiBindings): HandlerApi;
|
|
4
|
+
export {};
|
|
5
|
+
//# sourceMappingURL=api.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"api.d.ts","sourceRoot":"","sources":["../../../src/store/pipeline/api.ts"],"names":[],"mappings":"AAkBA,OAAO,KAAK,EAAE,UAAU,EAA2B,MAAM,YAAY,CAAC;AAmCtE,KAAK,2BAA2B,GAAG,IAAI,CACrC,UAAU,EACR,UAAU,GACV,WAAW,GACX,UAAU,GACV,SAAS,GACT,kBAAkB,GAClB,wBAAwB,GACxB,UAAU,GACV,WAAW,GACX,yBAAyB,GACzB,uBAAuB,GACvB,mBAAmB,GACnB,uBAAuB,GACvB,sBAAsB,CACzB,CAAC;AAmGF,wBAAgB,wBAAwB,CACtC,QAAQ,EAAE,2BAA2B,GACpC,UAAU,CAKZ"}
|