@inupedia/spotlight-vue 0.1.0 → 0.1.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 (179) hide show
  1. package/dist/_virtual/_plugin-vue_export-helper.js +0 -1
  2. package/dist/assets/spotlight-vue.css +1 -1
  3. package/dist/avatar/config.js +0 -1
  4. package/dist/avatar/speech/live2dAnswerSpeechPolicy.js +0 -1
  5. package/dist/avatar/speech/live2dBriefingSummarizer.js +0 -1
  6. package/dist/avatar/speech/live2dStreamSpeech.js +0 -1
  7. package/dist/avatar/speech/live2dTtsPlayback.js +0 -1
  8. package/dist/avatar/speech/llmUtils.js +0 -1
  9. package/dist/avatar/speech/spotlightSpeech.js +0 -1
  10. package/dist/avatar/spine/live2dApp.js +0 -1
  11. package/dist/avatar/spine/spineAvatar.js +0 -1
  12. package/dist/avatar/spine/spineLipSync.js +0 -1
  13. package/dist/components/InspiraCardSpotlight.js +5 -3
  14. package/dist/components/InspiraCardSpotlight.vue.d.ts.map +1 -1
  15. package/dist/components/InspiraCardSpotlight.vue.js +23 -19
  16. package/dist/components/Live2dPanel.vue.js +0 -1
  17. package/dist/components/Live2dPanel2.vue.js +0 -1
  18. package/dist/components/OfficialBorderBeam.js +0 -1
  19. package/dist/components/OfficialBorderBeam.vue.js +0 -1
  20. package/dist/components/SpotlightCommandPanel.vue.js +0 -1
  21. package/dist/components/SpotlightCommandPanel2.vue.js +7 -8
  22. package/dist/components/SpotlightMarkdownPreview.vue.js +0 -1
  23. package/dist/components/SpotlightMarkdownPreview2.vue.js +0 -1
  24. package/dist/components/SpotlightRoot.vue.js +0 -1
  25. package/dist/components/SpotlightRoot2.vue.js +0 -1
  26. package/dist/components/SpotlightShell.vue.js +0 -1
  27. package/dist/components/SpotlightShell2.vue.js +0 -1
  28. package/dist/components/SpotlightThinking.vue.js +0 -1
  29. package/dist/components/SpotlightThinking2.vue.js +0 -1
  30. package/dist/components/index.d.ts +3 -0
  31. package/dist/components/index.d.ts.map +1 -0
  32. package/dist/components/index.js +6 -0
  33. package/dist/composables/useSpotlightCommandShortcuts.js +0 -1
  34. package/dist/composables/useSpotlightPanelUi.js +0 -1
  35. package/dist/config.js +0 -1
  36. package/dist/constants/toolNames.js +0 -1
  37. package/dist/host/defineApp.js +0 -1
  38. package/dist/host/defineHost.js +0 -1
  39. package/dist/host/mergeSkills.js +0 -1
  40. package/dist/host/normalizeSkills.js +0 -1
  41. package/dist/host/skillExecution.js +0 -1
  42. package/dist/index.d.ts +2 -2
  43. package/dist/index.d.ts.map +1 -1
  44. package/dist/index.js +113 -117
  45. package/dist/markdown/index.d.ts +2 -0
  46. package/dist/markdown/index.d.ts.map +1 -0
  47. package/dist/markdown/index.js +6 -0
  48. package/dist/mountShell.js +0 -1
  49. package/dist/plugin.js +0 -1
  50. package/dist/remote/audio.js +0 -1
  51. package/dist/remote/hostToolRunner.js +3 -4
  52. package/dist/remote/httpConfig.js +0 -1
  53. package/dist/remote/index.js +0 -1
  54. package/dist/remote/meta.js +0 -1
  55. package/dist/remote/runPipeline.js +0 -1
  56. package/dist/remote/serverJson.js +0 -1
  57. package/dist/resolveConfig.js +0 -1
  58. package/dist/session/agentSession.js +0 -1
  59. package/dist/skills/index.js +0 -1
  60. package/dist/skills/matching.js +0 -1
  61. package/dist/skills/parser.js +0 -1
  62. package/dist/skills/skillFrontmatterParse.js +0 -1
  63. package/dist/skills/skillListing.js +0 -1
  64. package/dist/skills/skillPaths.js +0 -1
  65. package/dist/store/capabilities.js +0 -1
  66. package/dist/store/constants.js +0 -1
  67. package/dist/store/index.d.ts +5 -0
  68. package/dist/store/index.d.ts.map +1 -0
  69. package/dist/store/index.js +22 -0
  70. package/dist/store/live2dOverlayStore.js +0 -1
  71. package/dist/store/live2dSpeechStore.js +0 -1
  72. package/dist/store/live2dVoiceChannelStore.js +0 -1
  73. package/dist/store/pipeline/api.js +0 -1
  74. package/dist/store/pipeline/constants.js +0 -1
  75. package/dist/store/pipeline/displayText.js +0 -1
  76. package/dist/store/pipeline/errors.js +0 -1
  77. package/dist/store/pipeline/spotlightMarkdown.d.ts.map +1 -1
  78. package/dist/store/pipeline/spotlightMarkdown.js +51 -46
  79. package/dist/store/pipeline/steps.js +0 -1
  80. package/dist/store/pipeline/toolDisplay.js +0 -1
  81. package/dist/store/pipeline/typing.js +0 -1
  82. package/dist/store/recent.js +0 -1
  83. package/dist/store/runtimeStore.js +0 -1
  84. package/dist/store/spotlightStore.js +14 -16
  85. package/dist/store/storeSink.js +0 -1
  86. package/dist/store/types.js +0 -1
  87. package/dist/testing/index.d.ts +3 -0
  88. package/dist/testing/index.d.ts.map +1 -0
  89. package/dist/testing/index.js +6 -0
  90. package/dist/utils/devConsole.js +0 -1
  91. package/dist/utils/requestTimeout.js +0 -1
  92. package/dist/workflow/createOperateDefinition.js +0 -1
  93. package/dist/workflow/index.d.ts +6 -0
  94. package/dist/workflow/index.d.ts.map +1 -0
  95. package/dist/workflow/index.js +20 -0
  96. package/dist/workflow/operate.js +0 -1
  97. package/dist/workflow/runHostTool.js +0 -1
  98. package/dist/workflow/sessionControl.js +0 -1
  99. package/dist/workflow/shared.js +0 -1
  100. package/package.json +72 -8
  101. package/dist/_virtual/_plugin-vue_export-helper.js.map +0 -1
  102. package/dist/avatar/config.js.map +0 -1
  103. package/dist/avatar/speech/live2dAnswerSpeechPolicy.js.map +0 -1
  104. package/dist/avatar/speech/live2dBriefingSummarizer.js.map +0 -1
  105. package/dist/avatar/speech/live2dStreamSpeech.js.map +0 -1
  106. package/dist/avatar/speech/live2dTtsPlayback.js.map +0 -1
  107. package/dist/avatar/speech/llmUtils.js.map +0 -1
  108. package/dist/avatar/speech/spotlightSpeech.js.map +0 -1
  109. package/dist/avatar/spine/live2dApp.js.map +0 -1
  110. package/dist/avatar/spine/spineAvatar.js.map +0 -1
  111. package/dist/avatar/spine/spineLipSync.js.map +0 -1
  112. package/dist/components/InspiraCardSpotlight.js.map +0 -1
  113. package/dist/components/InspiraCardSpotlight.vue.js.map +0 -1
  114. package/dist/components/Live2dPanel.vue.js.map +0 -1
  115. package/dist/components/Live2dPanel2.vue.js.map +0 -1
  116. package/dist/components/OfficialBorderBeam.js.map +0 -1
  117. package/dist/components/OfficialBorderBeam.vue.js.map +0 -1
  118. package/dist/components/SpotlightCommandPanel.vue.js.map +0 -1
  119. package/dist/components/SpotlightCommandPanel2.vue.js.map +0 -1
  120. package/dist/components/SpotlightMarkdownPreview.vue.js.map +0 -1
  121. package/dist/components/SpotlightMarkdownPreview2.vue.js.map +0 -1
  122. package/dist/components/SpotlightRoot.vue.js.map +0 -1
  123. package/dist/components/SpotlightRoot2.vue.js.map +0 -1
  124. package/dist/components/SpotlightShell.vue.js.map +0 -1
  125. package/dist/components/SpotlightShell2.vue.js.map +0 -1
  126. package/dist/components/SpotlightThinking.vue.js.map +0 -1
  127. package/dist/components/SpotlightThinking2.vue.js.map +0 -1
  128. package/dist/composables/useSpotlightCommandShortcuts.js.map +0 -1
  129. package/dist/composables/useSpotlightPanelUi.js.map +0 -1
  130. package/dist/config.js.map +0 -1
  131. package/dist/constants/toolNames.js.map +0 -1
  132. package/dist/host/defineApp.js.map +0 -1
  133. package/dist/host/defineHost.js.map +0 -1
  134. package/dist/host/mergeSkills.js.map +0 -1
  135. package/dist/host/normalizeSkills.js.map +0 -1
  136. package/dist/host/skillExecution.js.map +0 -1
  137. package/dist/index.js.map +0 -1
  138. package/dist/mountShell.js.map +0 -1
  139. package/dist/plugin.js.map +0 -1
  140. package/dist/remote/audio.js.map +0 -1
  141. package/dist/remote/hostToolRunner.js.map +0 -1
  142. package/dist/remote/httpConfig.js.map +0 -1
  143. package/dist/remote/index.js.map +0 -1
  144. package/dist/remote/meta.js.map +0 -1
  145. package/dist/remote/runPipeline.js.map +0 -1
  146. package/dist/remote/serverJson.js.map +0 -1
  147. package/dist/resolveConfig.js.map +0 -1
  148. package/dist/session/agentSession.js.map +0 -1
  149. package/dist/skills/index.js.map +0 -1
  150. package/dist/skills/matching.js.map +0 -1
  151. package/dist/skills/parser.js.map +0 -1
  152. package/dist/skills/skillFrontmatterParse.js.map +0 -1
  153. package/dist/skills/skillListing.js.map +0 -1
  154. package/dist/skills/skillPaths.js.map +0 -1
  155. package/dist/store/capabilities.js.map +0 -1
  156. package/dist/store/constants.js.map +0 -1
  157. package/dist/store/live2dOverlayStore.js.map +0 -1
  158. package/dist/store/live2dSpeechStore.js.map +0 -1
  159. package/dist/store/live2dVoiceChannelStore.js.map +0 -1
  160. package/dist/store/pipeline/api.js.map +0 -1
  161. package/dist/store/pipeline/constants.js.map +0 -1
  162. package/dist/store/pipeline/displayText.js.map +0 -1
  163. package/dist/store/pipeline/errors.js.map +0 -1
  164. package/dist/store/pipeline/spotlightMarkdown.js.map +0 -1
  165. package/dist/store/pipeline/steps.js.map +0 -1
  166. package/dist/store/pipeline/toolDisplay.js.map +0 -1
  167. package/dist/store/pipeline/typing.js.map +0 -1
  168. package/dist/store/recent.js.map +0 -1
  169. package/dist/store/runtimeStore.js.map +0 -1
  170. package/dist/store/spotlightStore.js.map +0 -1
  171. package/dist/store/storeSink.js.map +0 -1
  172. package/dist/store/types.js.map +0 -1
  173. package/dist/utils/devConsole.js.map +0 -1
  174. package/dist/utils/requestTimeout.js.map +0 -1
  175. package/dist/workflow/createOperateDefinition.js.map +0 -1
  176. package/dist/workflow/operate.js.map +0 -1
  177. package/dist/workflow/runHostTool.js.map +0 -1
  178. package/dist/workflow/sessionControl.js.map +0 -1
  179. package/dist/workflow/shared.js.map +0 -1
@@ -1 +0,0 @@
1
- {"version":3,"file":"SpotlightShell2.vue.js","sources":["../../src/components/SpotlightShell.vue"],"sourcesContent":["<template>\n <SpotlightRoot\n :deck-kicker=\"deckKicker\"\n :voice-hold-active=\"voiceHoldActive\"\n :speech-pending=\"speechPending\"\n :voice-key-label=\"VOICE_INPUT_KEY_LABEL\"\n :show-thinking=\"showSpotlightThinkingBar\"\n :thinking-centered=\"thinkingBarCentered\"\n :on-escape=\"onSpotlightEscape\"\n :on-keydown=\"onSpotlightKeydown\"\n :on-keyup=\"onSpotlightKeyup\"\n @visible-change=\"onPanelVisibleChange\"\n />\n <Live2dPanel v-if=\"avatarEnabled && live2dVisible\" />\n</template>\n\n<script setup lang=\"ts\">\nimport { computed, nextTick, onUnmounted, ref, watch } from \"vue\";\nimport {\n buildFastLive2dBriefing,\n summarizeLive2dBriefing,\n type Live2dBriefingSentence,\n} from \"../avatar/speech/live2dBriefingSummarizer.js\";\nimport { isGenericHostExecutionReply } from \"../avatar/speech/live2dAnswerSpeechPolicy.js\";\nimport { LIVE2D_ANSWER_STEP_ID } from \"../avatar/speech/live2dStreamSpeech.js\";\nimport { waitForAudioNaturalEnd } from \"../avatar/speech/live2dTtsPlayback.js\";\nimport type { WavEnvelope } from \"../avatar/spine/live2dApp.js\";\nimport {\n hasSpotlightSpeechConfig,\n SpotlightSpeechService,\n} from \"../avatar/speech/spotlightSpeech.js\";\nimport { storeToRefs } from \"pinia\";\nimport { useSpotlightStore } from \"../store/spotlightStore.js\";\nimport { useSpotlightAvatarConfig } from \"../avatar/config.js\";\nimport SpotlightRoot from \"./SpotlightRoot.vue\";\nimport Live2dPanel from \"./Live2dPanel.vue\";\nimport { useLive2dOverlayStore } from \"../store/live2dOverlayStore.js\";\nimport { useLive2dSpeechStore } from \"../store/live2dSpeechStore.js\";\nimport { useLive2dVoiceChannelStore } from \"../store/live2dVoiceChannelStore.js\";\nimport { devWarn } from \"../utils/devConsole.js\";\n\nconst props = withDefaults(\n defineProps<{ avatarEnabled?: boolean }>(),\n { avatarEnabled: false },\n);\n\nconst avatarConfig = useSpotlightAvatarConfig();\nconst deckKicker = computed(\n () => avatarConfig.deckKicker?.trim() || \"SPOTLIGHT\",\n);\nconst greetingText = computed(\n () => avatarConfig.greetingText?.trim() || \"您好,我是 Spotlight 助手\",\n);\n\nconst store = useSpotlightStore();\nconst live2dOverlay = useLive2dOverlayStore();\nconst { visible: live2dVisible } = storeToRefs(live2dOverlay);\nconst live2dSpeech = useLive2dSpeechStore();\nconst live2dVoiceChannel = useLive2dVoiceChannelStore();\nconst speechService = new SpotlightSpeechService();\n\nconst VOICE_INPUT_KEY_CODE = \"Backquote\";\nconst VOICE_INPUT_KEY_LABEL = \"`\";\nconst voiceHoldTimer = ref<number | null>(null);\nconst voiceHoldActive = ref(false);\nconst speechPending = ref(false);\nconst speechAbortController = ref<AbortController | null>(null);\nconst ttsAudio = ref<HTMLAudioElement | null>(null);\nconst ttsAudioUrl = ref<string | null>(null);\nconst ttsAbortController = ref<AbortController | null>(null);\nconst activeSpeechToken = ref(0);\nconst lastSpokenPipelineRunId = ref(0);\nconst live2dHoldThinkingUntilSpeech = ref(false);\nconst live2dBriefingKeepLastMs = computed(() =>\n Math.max(\n 0,\n avatarConfig.briefingKeepLastMs ??\n (Number(import.meta.env.VITE_LIVE2D_BRIEFING_KEEP_LAST_MS ?? 0) || 0),\n ),\n);\nlet live2dGreetingAbort: AbortController | null = null;\nconst sttFromLive2dVoiceChannel = ref(false);\n\nconst showSpotlightThinkingBar = computed(() => {\n if (!store.showThinkingBar) return false;\n if (!props.avatarEnabled || !live2dVisible.value) return true;\n if (\n store.pipelinePhase === \"running\" ||\n live2dHoldThinkingUntilSpeech.value\n ) {\n return true;\n }\n return store.pipelinePhase === \"done\";\n});\n\nconst thinkingBarCentered = computed(() => {\n const isKnowledgeQa =\n store.agentSteps.length === 1 && store.agentSteps[0]?.label === \"知识问答\";\n return (\n store.pipelinePhase === \"running\" ||\n isKnowledgeQa ||\n live2dHoldThinkingUntilSpeech.value\n );\n});\n\nfunction dismissLive2dThinkingForSpeech(): void {\n live2dHoldThinkingUntilSpeech.value = false;\n if (live2dVisible.value) {\n store.showThinkingBar = false;\n }\n}\n\nfunction clearVoiceHoldTimer() {\n if (voiceHoldTimer.value != null) {\n window.clearTimeout(voiceHoldTimer.value);\n voiceHoldTimer.value = null;\n }\n}\n\nfunction cancelSpeechSession() {\n clearVoiceHoldTimer();\n if (speechAbortController.value) {\n speechAbortController.value.abort();\n speechAbortController.value = null;\n }\n speechPending.value = false;\n voiceHoldActive.value = false;\n sttFromLive2dVoiceChannel.value = false;\n live2dVoiceChannel.reset();\n speechService.cancel();\n}\n\nfunction stopTtsPlayback() {\n if (live2dGreetingAbort) {\n live2dGreetingAbort.abort();\n live2dGreetingAbort = null;\n }\n if (ttsAbortController.value) {\n ttsAbortController.value.abort();\n ttsAbortController.value = null;\n }\n releaseCurrentTtsAudio();\n live2dSpeech.reset();\n void import(\"../avatar/spine/live2dApp.js\").then((live2d) =>\n live2d.stopLive2dLipSync(),\n );\n}\n\nfunction wait(ms: number, signal?: AbortSignal): Promise<void> {\n if (ms <= 0) return Promise.resolve();\n return new Promise((resolve, reject) => {\n const timer = window.setTimeout(() => {\n signal?.removeEventListener(\"abort\", onAbort);\n resolve();\n }, ms);\n const onAbort = () => {\n window.clearTimeout(timer);\n reject(new DOMException(\"Aborted\", \"AbortError\"));\n };\n if (signal?.aborted) {\n onAbort();\n return;\n }\n signal?.addEventListener(\"abort\", onAbort, { once: true });\n });\n}\n\nasync function playLive2dGreetingWhenOpened(): Promise<void> {\n if (!live2dVisible.value || store.pipelinePhase === \"running\") return;\n\n stopTtsPlayback();\n activeSpeechToken.value += 1;\n const speechToken = activeSpeechToken.value;\n const controller = new AbortController();\n live2dGreetingAbort = controller;\n\n if (!hasSpotlightSpeechConfig()) {\n live2dGreetingAbort = null;\n await nextTick();\n const live2d = await import(\"../avatar/spine/live2dApp.js\");\n live2d.playLive2dHello();\n live2dSpeech.start(greetingText.value, { instant: true });\n live2dSpeech.reset();\n return;\n }\n\n const synthesizePromise = speechService.synthesize(\n greetingText.value,\n controller.signal,\n );\n\n await nextTick();\n await new Promise<void>((resolve) => {\n requestAnimationFrame(() => resolve());\n });\n if (!isLive2dTtsSessionActive(controller, speechToken)) return;\n\n try {\n const { blob } = await synthesizePromise;\n if (!isLive2dTtsSessionActive(controller, speechToken)) return;\n await playLive2dTtsBlob(\n greetingText.value,\n blob,\n controller,\n speechToken,\n { instantText: true, playHelloWithSpeech: true },\n );\n } catch (err) {\n if (controller.signal.aborted) return;\n const message =\n err instanceof Error ? err.message : \"数字人招呼语音失败,请稍后重试。\";\n devWarn(\"[live2d-greeting]\", message);\n if (isLive2dTtsSessionActive(controller, speechToken)) {\n const live2d = await import(\"../avatar/spine/live2dApp.js\");\n live2d.playLive2dHello();\n live2dSpeech.start(greetingText.value, { instant: true });\n live2dSpeech.reset();\n }\n } finally {\n if (live2dGreetingAbort === controller) {\n live2dGreetingAbort = null;\n }\n }\n}\n\nfunction releaseCurrentTtsAudio() {\n if (ttsAudio.value) {\n ttsAudio.value.pause();\n ttsAudio.value.src = \"\";\n ttsAudio.value = null;\n }\n if (ttsAudioUrl.value) {\n URL.revokeObjectURL(ttsAudioUrl.value);\n ttsAudioUrl.value = null;\n }\n}\n\nfunction getAnswerStepSpeechText(): string {\n const step =\n store.agentSteps.find((item) => item.id === LIVE2D_ANSWER_STEP_ID) ??\n store.agentSteps.find((item) => item.label === \"执行工具与回答\") ??\n store.agentSteps.find((item) => item.label === \"知识问答\");\n return step?.content ?? \"\";\n}\n\nasync function speakAnswerStepWithLive2d(): Promise<void> {\n const text = getAnswerStepSpeechText().trim();\n if (!text || !live2dVisible.value || isGenericHostExecutionReply(text)) {\n live2dHoldThinkingUntilSpeech.value = false;\n return;\n }\n\n stopTtsPlayback();\n const speechToken = activeSpeechToken.value;\n const controller = new AbortController();\n ttsAbortController.value = controller;\n\n try {\n const fastPlan = buildFastLive2dBriefing(text);\n let activeSentences = fastPlan.sentences;\n if (!activeSentences.length) {\n live2dHoldThinkingUntilSpeech.value = false;\n return;\n }\n\n let refinedPlanSentences: Live2dBriefingSentence[] | null = null;\n let refinedApplied = false;\n const refinedTask = summarizeLive2dBriefing(text, controller.signal)\n .then((plan) => {\n if (plan.sentences.length > 0) {\n refinedPlanSentences = plan.sentences;\n }\n })\n .catch(() => {});\n\n let prefetchIndex = -1;\n let prefetchTask: Promise<Blob> | null = null;\n const schedulePrefetch = (index: number) => {\n if (index < 0 || index >= activeSentences.length) return;\n if (prefetchIndex === index && prefetchTask) return;\n prefetchIndex = index;\n prefetchTask = speechService\n .synthesize(activeSentences[index]!.text, controller.signal)\n .then((result) => result.blob);\n };\n\n let spokenIndex = 0;\n while (spokenIndex < activeSentences.length) {\n if (!isLive2dTtsSessionActive(controller, speechToken)) return;\n\n if (!refinedApplied && refinedPlanSentences) {\n activeSentences = refinedPlanSentences;\n refinedApplied = true;\n prefetchIndex = -1;\n prefetchTask = null;\n if (spokenIndex >= activeSentences.length) break;\n }\n\n const sentence = activeSentences[spokenIndex]!;\n schedulePrefetch(spokenIndex);\n const blob =\n prefetchIndex === spokenIndex && prefetchTask\n ? await prefetchTask\n : (await speechService.synthesize(sentence.text, controller.signal))\n .blob;\n if (!isLive2dTtsSessionActive(controller, speechToken)) return;\n schedulePrefetch(spokenIndex + 1);\n\n if (spokenIndex === 0) {\n dismissLive2dThinkingForSpeech();\n }\n\n await playLive2dTtsBlob(sentence.text, blob, controller, speechToken, {\n instantText: true,\n hasFollowingClip: spokenIndex + 1 < activeSentences.length,\n });\n\n const pauseMs = sentence.pauseMs ?? 0;\n if (pauseMs > 0 && isLive2dTtsSessionActive(controller, speechToken)) {\n try {\n await wait(pauseMs, controller.signal);\n } catch {\n return;\n }\n }\n\n spokenIndex += 1;\n }\n await refinedTask;\n } catch (err) {\n if (controller.signal.aborted) return;\n stopTtsPlayback();\n const message =\n err instanceof Error ? err.message : \"数字人语音播放失败,请稍后重试。\";\n store.error = message;\n } finally {\n live2dHoldThinkingUntilSpeech.value = false;\n releaseCurrentTtsAudio();\n const live2d = await import(\"../avatar/spine/live2dApp.js\");\n live2d.stopLive2dLipSync();\n if (isLive2dTtsSessionActive(controller, speechToken)) {\n if (live2dBriefingKeepLastMs.value > 0) {\n try {\n await wait(live2dBriefingKeepLastMs.value, controller.signal);\n } catch {\n // ignore abort\n }\n }\n if (isLive2dTtsSessionActive(controller, speechToken)) {\n live2dSpeech.reset();\n }\n }\n if (ttsAbortController.value === controller) {\n ttsAbortController.value = null;\n }\n }\n}\n\nfunction isLive2dTtsSessionActive(\n controller: AbortController,\n speechToken: number,\n): boolean {\n return !controller.signal.aborted && activeSpeechToken.value === speechToken;\n}\n\nasync function playLive2dTtsBlob(\n text: string,\n blob: Blob,\n controller: AbortController,\n speechToken: number,\n options?: {\n instantText?: boolean;\n hasFollowingClip?: boolean;\n lipSyncEnvelope?: WavEnvelope;\n playHelloWithSpeech?: boolean;\n },\n): Promise<void> {\n if (!isLive2dTtsSessionActive(controller, speechToken)) return;\n\n const hasFollowingClip = options?.hasFollowingClip ?? false;\n releaseCurrentTtsAudio();\n const audioUrl = URL.createObjectURL(blob);\n ttsAudioUrl.value = audioUrl;\n const audio = new Audio(audioUrl);\n audio.volume = 1;\n ttsAudio.value = audio;\n\n const live2d = await import(\"../avatar/spine/live2dApp.js\");\n const { buildWavEnvelopeFromBlob } = await import(\"../avatar/spine/spineLipSync.js\");\n const envelope =\n options?.lipSyncEnvelope ?? (await buildWavEnvelopeFromBlob(blob));\n\n if (!isLive2dTtsSessionActive(controller, speechToken)) return;\n\n if (options?.playHelloWithSpeech) {\n live2d.playLive2dHello();\n }\n\n live2d.bindLive2dLipSyncToAudio(audio, envelope);\n live2dSpeech.start(text, { instant: options?.instantText ?? true });\n try {\n await audio.play();\n } catch (err) {\n live2d.stopLive2dLipSync();\n releaseCurrentTtsAudio();\n throw err;\n }\n\n await waitForAudioNaturalEnd(audio, controller.signal);\n\n live2d.stopLive2dLipSync();\n releaseCurrentTtsAudio();\n if (!isLive2dTtsSessionActive(controller, speechToken)) return;\n\n if (hasFollowingClip) {\n live2dSpeech.finish();\n return;\n }\n\n live2dSpeech.reset();\n}\n\nfunction canLive2dHiddenVoiceStt(): boolean {\n if (!props.avatarEnabled) return false;\n return (\n live2dVisible.value &&\n !store.visible &&\n !store.loading &&\n !speechPending.value\n );\n}\n\nasync function stopSpeechAndFillPrompt() {\n if (speechPending.value) return;\n const submitAfterTranscribe = sttFromLive2dVoiceChannel.value;\n voiceHoldActive.value = false;\n if (submitAfterTranscribe) {\n live2dVoiceChannel.setTranscribing(true);\n }\n speechPending.value = true;\n const controller = new AbortController();\n speechAbortController.value = controller;\n try {\n const { text } = await speechService.stopAndTranscribe(controller.signal);\n const trimmed = text.trim();\n if (submitAfterTranscribe) {\n sttFromLive2dVoiceChannel.value = false;\n if (!trimmed) return;\n store.prompt = trimmed;\n await store.submit();\n return;\n }\n const current = store.prompt.trim();\n store.prompt = current ? `${current} ${text}` : text;\n } catch (err) {\n if (controller.signal.aborted) return;\n const message =\n err instanceof Error ? err.message : \"语音识别失败,请重试。\";\n store.error = message;\n } finally {\n speechAbortController.value = null;\n speechPending.value = false;\n voiceHoldActive.value = false;\n sttFromLive2dVoiceChannel.value = false;\n live2dVoiceChannel.reset();\n }\n}\n\nfunction onVoiceHoldKeydown(event: KeyboardEvent) {\n if (event.repeat) return;\n if (event.metaKey || event.ctrlKey || event.altKey || event.shiftKey) return;\n\n const hiddenThinkingStt = canLive2dHiddenVoiceStt();\n if (!store.visible && !hiddenThinkingStt) return;\n if (store.visible && store.loading) return;\n\n event.preventDefault();\n if (voiceHoldTimer.value != null || voiceHoldActive.value) return;\n voiceHoldTimer.value = window.setTimeout(async () => {\n voiceHoldTimer.value = null;\n const useHiddenPath = canLive2dHiddenVoiceStt();\n if (!store.visible && !useHiddenPath) return;\n if (store.visible && store.loading) return;\n try {\n await speechService.startRecording();\n voiceHoldActive.value = true;\n sttFromLive2dVoiceChannel.value = useHiddenPath;\n if (useHiddenPath) {\n live2dVoiceChannel.setRecording(true);\n } else {\n live2dVoiceChannel.reset();\n }\n store.error = \"\";\n } catch (err) {\n const message = err instanceof Error ? err.message : \"无法启动语音录制。\";\n store.error = message;\n voiceHoldActive.value = false;\n sttFromLive2dVoiceChannel.value = false;\n live2dVoiceChannel.reset();\n }\n }, 450);\n}\n\nfunction onSpotlightKeyup(event: KeyboardEvent) {\n if (event.code !== VOICE_INPUT_KEY_CODE) return;\n if (!store.visible && !voiceHoldActive.value) return;\n event.preventDefault();\n const hadLongPress = voiceHoldActive.value;\n clearVoiceHoldTimer();\n if (hadLongPress) {\n void stopSpeechAndFillPrompt();\n }\n}\n\nfunction onSpotlightKeydown(event: KeyboardEvent) {\n if (event.code === VOICE_INPUT_KEY_CODE) {\n onVoiceHoldKeydown(event);\n return;\n }\n\n const key = event.key.toLowerCase();\n const isMeta = event.metaKey || event.ctrlKey;\n if (!props.avatarEnabled) return;\n if (isMeta && key === \"l\") {\n event.preventDefault();\n live2dOverlay.toggle();\n }\n}\n\nfunction onSpotlightEscape() {\n live2dHoldThinkingUntilSpeech.value = false;\n activeSpeechToken.value += 1;\n stopTtsPlayback();\n live2dSpeech.reset();\n if (store.showThinkingBar) {\n store.closeThinking();\n } else if (store.visible) {\n store.close();\n }\n}\n\nfunction onPanelVisibleChange(visible: boolean) {\n if (!visible) {\n cancelSpeechSession();\n if (live2dVisible.value) {\n store.prepareLive2dVoiceChannel();\n }\n return;\n }\n}\n\nwatch(live2dVisible, (on) => {\n if (!props.avatarEnabled) return;\n if (!on) {\n live2dHoldThinkingUntilSpeech.value = false;\n cancelSpeechSession();\n stopTtsPlayback();\n live2dSpeech.reset();\n live2dVoiceChannel.reset();\n return;\n }\n if (!store.visible) {\n store.prepareLive2dVoiceChannel();\n }\n void playLive2dGreetingWhenOpened();\n});\n\nwatch(\n () =>\n [store.pipelinePhase, store.pipelineRunId, live2dVisible.value] as const,\n ([phase, runId, live2dOn]) => {\n if (!props.avatarEnabled) return;\n if (phase === \"running\") {\n live2dHoldThinkingUntilSpeech.value = false;\n stopTtsPlayback();\n return;\n }\n if (phase !== \"done\") {\n if (phase === \"error\" || phase === \"cancelled\") {\n live2dHoldThinkingUntilSpeech.value = false;\n stopTtsPlayback();\n }\n return;\n }\n if (!live2dOn) return;\n if (runId <= lastSpokenPipelineRunId.value) return;\n lastSpokenPipelineRunId.value = runId;\n void nextTick(() => {\n const text = getAnswerStepSpeechText().trim();\n if (\n !text ||\n isGenericHostExecutionReply(text) ||\n !hasSpotlightSpeechConfig()\n ) {\n live2dHoldThinkingUntilSpeech.value = false;\n return;\n }\n live2dHoldThinkingUntilSpeech.value = true;\n activeSpeechToken.value += 1;\n void speakAnswerStepWithLive2d();\n });\n },\n);\n\nonUnmounted(() => {\n cancelSpeechSession();\n stopTtsPlayback();\n live2dSpeech.reset();\n live2dVoiceChannel.reset();\n});\n</script>\n"],"names":["VOICE_INPUT_KEY_CODE","VOICE_INPUT_KEY_LABEL","props","__props","avatarConfig","useSpotlightAvatarConfig","deckKicker","computed","greetingText","store","useSpotlightStore","live2dOverlay","useLive2dOverlayStore","live2dVisible","storeToRefs","live2dSpeech","useLive2dSpeechStore","live2dVoiceChannel","useLive2dVoiceChannelStore","speechService","SpotlightSpeechService","voiceHoldTimer","ref","voiceHoldActive","speechPending","speechAbortController","ttsAudio","ttsAudioUrl","ttsAbortController","activeSpeechToken","lastSpokenPipelineRunId","live2dHoldThinkingUntilSpeech","live2dBriefingKeepLastMs","live2dGreetingAbort","sttFromLive2dVoiceChannel","showSpotlightThinkingBar","thinkingBarCentered","isKnowledgeQa","dismissLive2dThinkingForSpeech","clearVoiceHoldTimer","cancelSpeechSession","stopTtsPlayback","releaseCurrentTtsAudio","live2d","wait","ms","signal","resolve","reject","timer","onAbort","playLive2dGreetingWhenOpened","speechToken","controller","hasSpotlightSpeechConfig","nextTick","synthesizePromise","isLive2dTtsSessionActive","blob","playLive2dTtsBlob","err","message","devWarn","getAnswerStepSpeechText","item","LIVE2D_ANSWER_STEP_ID","speakAnswerStepWithLive2d","text","isGenericHostExecutionReply","activeSentences","buildFastLive2dBriefing","refinedPlanSentences","refinedApplied","refinedTask","summarizeLive2dBriefing","plan","prefetchIndex","prefetchTask","schedulePrefetch","index","result","spokenIndex","sentence","pauseMs","options","hasFollowingClip","audioUrl","audio","buildWavEnvelopeFromBlob","envelope","waitForAudioNaturalEnd","canLive2dHiddenVoiceStt","stopSpeechAndFillPrompt","submitAfterTranscribe","trimmed","current","onVoiceHoldKeydown","event","hiddenThinkingStt","useHiddenPath","onSpotlightKeyup","hadLongPress","onSpotlightKeydown","key","isMeta","onSpotlightEscape","onPanelVisibleChange","visible","watch","on","phase","runId","live2dOn","onUnmounted","_createVNode","SpotlightRoot","_unref","_createBlock","Live2dPanel"],"mappings":";;;;;;;;;;;;;;;AA6DA,MAAMA,KAAuB,aACvBC,KAAwB;;;;;;AArB9B,UAAMC,IAAQC,GAKRC,IAAeC,GAAA,GACfC,KAAaC;AAAA,MACjB,MAAMH,EAAa,YAAY,UAAU;AAAA,IAAA,GAErCI,IAAeD;AAAA,MACnB,MAAMH,EAAa,cAAc,UAAU;AAAA,IAAA,GAGvCK,IAAQC,GAAA,GACRC,IAAgBC,GAAA,GAChB,EAAE,SAASC,MAAkBC,GAAYH,CAAa,GACtDI,IAAeC,GAAA,GACfC,IAAqBC,GAAA,GACrBC,IAAgB,IAAIC,GAAA,GAIpBC,IAAiBC,EAAmB,IAAI,GACxCC,IAAkBD,EAAI,EAAK,GAC3BE,IAAgBF,EAAI,EAAK,GACzBG,IAAwBH,EAA4B,IAAI,GACxDI,IAAWJ,EAA6B,IAAI,GAC5CK,IAAcL,EAAmB,IAAI,GACrCM,IAAqBN,EAA4B,IAAI,GACrDO,IAAoBP,EAAI,CAAC,GACzBQ,IAA0BR,EAAI,CAAC,GAC/BS,IAAgCT,EAAI,EAAK,GACzCU,IAA2BzB;AAAA,MAAS,MACxC,KAAK;AAAA,QACH;AAAA,QACAH,EAAa,sBACwD;AAAA,MAAA;AAAA,IACvE;AAEF,QAAI6B,IAA8C;AAClD,UAAMC,IAA4BZ,EAAI,EAAK,GAErCa,KAA2B5B,EAAS,MACnCE,EAAM,kBACP,CAACP,EAAM,iBAAiB,CAACW,EAAc,SAEzCJ,EAAM,kBAAkB,aACxBsB,EAA8B,QAEvB,KAEFtB,EAAM,kBAAkB,SARI,EASpC,GAEK2B,KAAsB7B,EAAS,MAAM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,GAAA;AAAA,UACP,CAAC;AAAA;AAAA,MACH;AAAA,IAAA,GAGF+C,GAAY,MAAM;AAChB,MAAAzE,EAAA,GACAC,EAAA,GACA1B,EAAa,MAAA,GACbE,EAAmB,MAAA;AAAA,IACrB,CAAC;MAhmBCiG,GAWEC,IAAA;AAAA,QAVC,eAAa7G,GAAA;AAAA,QACb,qBAAmBiB,EAAA;AAAA,QACnB,kBAAgBC,EAAA;AAAA,QAChB,mBAAiBvB;AAAA,QACjB,iBAAekC,GAAA;AAAA,QACf,qBAAmBC,GAAA;AAAA,QACnB,aAAWqE;AAAA,QACX,cAAYH;AAAA,QACZ,YAAUF;AAAA,QACV,iBAAgBM;AAAA,MAAA;MAEAvG,EAAA,iBAAiBiH,GAAAvG,CAAA,UAApCwG,GAAqDC,IAAA,EAAA,KAAA,EAAA,CAAA;;;;"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"SpotlightThinking.vue.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"SpotlightThinking2.vue.js","sources":["../../src/components/SpotlightThinking.vue"],"sourcesContent":["<template>\n <div\n class=\"thinking-bar\"\n :class=\"[\n { 'thinking-bar--embedded': embedded },\n { 'thinking-bar--open': isOpen },\n { 'thinking-bar--centered': centered },\n { 'thinking-bar--corner': !centered && !embedded },\n ]\"\n >\n <div class=\"thinking-bar-grid\" aria-hidden=\"true\" />\n <div class=\"thinking-bar-header\">\n <div class=\"thinking-bar-title-stack\">\n <span class=\"thinking-bar-kicker\">HYDRO PROCESS</span>\n <span class=\"thinking-bar-title\">{{ titleText }}</span>\n </div>\n <div class=\"thinking-bar-metrics\" aria-label=\"执行状态概览\">\n <span class=\"thinking-bar-metric\">\n <strong>{{ steps.length }}</strong>\n <em>阶段</em>\n </span>\n <span class=\"thinking-bar-metric\">\n <strong>{{ activeStepCount }}</strong>\n <em>运行</em>\n </span>\n <span class=\"thinking-bar-metric\">\n <strong>{{ doneStepCount }}</strong>\n <em>完成</em>\n </span>\n </div>\n <button\n type=\"button\"\n class=\"thinking-bar-close\"\n aria-label=\"关闭\"\n @click=\"$emit('close')\"\n >\n ×\n </button>\n </div>\n <div ref=\"stepsContainerRef\" class=\"thinking-bar-steps\">\n <div\n v-for=\"step in steps\"\n :key=\"step.id\"\n class=\"thinking-bar-step\"\n :class=\"[step.status]\"\n >\n <OfficialBorderBeam\n v-if=\"step.status === 'active'\"\n class=\"thinking-bar-step-beam\"\n :size=\"88\"\n :duration=\"6\"\n :border-width=\"1.5\"\n color-from=\"#c9a25d\"\n color-to=\"#5d8f9b\"\n />\n <div class=\"thinking-bar-step-inner\">\n <span class=\"thinking-bar-step-icon\">{{\n stepIcon(step.status)\n }}</span>\n <div class=\"thinking-bar-step-column\">\n <span class=\"thinking-bar-step-label\">{{ step.label }}</span>\n <div\n :ref=\"(el) => setStepBodyRef(step.id, el)\"\n class=\"thinking-bar-step-body\"\n @scroll.passive=\"handleStepBodyScroll(step.id, $event)\"\n >\n <template v-if=\"isToolExecutionStep(step.id)\">\n <div class=\"thinking-bar-tool-step-flow\">\n <details\n v-if=\"hasExecutionDetails(step)\"\n class=\"thinking-bar-execution-details\"\n >\n <summary class=\"thinking-bar-execution-details-summary\">\n <span class=\"thinking-bar-execution-details-title\"\n >调用工具</span\n >\n <span class=\"thinking-bar-execution-details-meta\">{{\n executionDetailsMeta(step)\n }}</span>\n <span class=\"thinking-bar-execution-details-caret\"\n >▾</span\n >\n </summary>\n <div class=\"thinking-bar-execution-details-body\">\n <pre\n v-if=\"getToolStepPlanning(step)\"\n class=\"thinking-bar-execution-planning\"\n >{{ getToolStepPlanning(step) }}</pre\n >\n <details\n v-for=\"toolCall in getStepToolCalls(step)\"\n :key=\"toolCall.id\"\n class=\"thinking-bar-tool-call\"\n :open=\"isToolCallOpen(toolCall)\"\n >\n <summary class=\"thinking-bar-tool-call-head\">\n <div class=\"thinking-bar-tool-call-head-main\">\n <span class=\"thinking-bar-tool-call-name\">\n {{ getToolTitle(toolCall) }}\n </span>\n <span\n v-if=\"toolCall.name !== getToolTitle(toolCall)\"\n class=\"thinking-bar-tool-call-id\"\n >\n {{ toolCall.name }}\n </span>\n </div>\n <div class=\"thinking-bar-tool-call-head-side\">\n <span\n class=\"thinking-bar-tool-call-status\"\n :class=\"`is-${toolCall.status}`\"\n >\n {{ toolStatusLabel(toolCall.status) }}\n </span>\n <span class=\"thinking-bar-tool-call-caret\">▾</span>\n </div>\n </summary>\n <div class=\"thinking-bar-tool-call-body\">\n <div\n v-if=\"toolCall.argsText?.trim()\"\n class=\"thinking-bar-tool-call-block\"\n >\n <div class=\"thinking-bar-tool-call-block-title\">\n 请求参数\n </div>\n <pre class=\"thinking-bar-tool-call-pre\">{{\n toolCall.argsText\n }}</pre>\n </div>\n <div\n v-if=\"toolCall.summary?.trim()\"\n class=\"thinking-bar-tool-call-block thinking-bar-tool-call-block--result\"\n >\n <div class=\"thinking-bar-tool-call-block-title\">\n 执行摘要\n </div>\n <pre class=\"thinking-bar-tool-call-pre\">{{\n toolCall.summary\n }}</pre>\n </div>\n <div\n v-if=\"hasStructuredToolResult(toolCall)\"\n class=\"thinking-bar-tool-call-block thinking-bar-tool-call-block--result\"\n >\n <div class=\"thinking-bar-tool-call-block-title\">\n 接口结果\n </div>\n <div\n v-if=\"getToolResultImage(toolCall)\"\n class=\"thinking-bar-tool-result-image-shell\"\n >\n <img\n class=\"thinking-bar-tool-result-image\"\n :src=\"getToolResultImage(toolCall) || ''\"\n :alt=\"toolCall.name\"\n />\n </div>\n <iframe\n v-else-if=\"getToolResultHtml(toolCall)\"\n class=\"thinking-bar-tool-result-html\"\n :srcdoc=\"getToolResultHtml(toolCall) || ''\"\n :title=\"toolCall.name\"\n sandbox=\"\"\n />\n <div\n v-else-if=\"getToolResultTable(toolCall)\"\n class=\"thinking-bar-tool-result-table-wrap\"\n >\n <table class=\"thinking-bar-tool-result-table\">\n <thead>\n <tr>\n <th\n v-for=\"column in getToolResultTable(\n toolCall,\n )?.columns\"\n :key=\"column\"\n >\n {{ column }}\n </th>\n </tr>\n </thead>\n <tbody>\n <tr\n v-for=\"(\n row, rowIndex\n ) in getToolResultTable(toolCall)?.rows\"\n :key=\"`${toolCall.id}-${rowIndex}`\"\n >\n <td\n v-for=\"column in getToolResultTable(\n toolCall,\n )?.columns\"\n :key=\"`${toolCall.id}-${rowIndex}-${column}`\"\n >\n {{ formatTableCell(row[column]) }}\n </td>\n </tr>\n </tbody>\n </table>\n </div>\n <pre\n v-else-if=\"getToolResultDisplay(toolCall)\"\n class=\"thinking-bar-tool-call-pre\"\n >{{ getToolResultDisplay(toolCall) }}</pre\n >\n </div>\n <div\n v-if=\"formatToolTrace(toolCall.trace)\"\n class=\"thinking-bar-tool-call-block\"\n >\n <div class=\"thinking-bar-tool-call-block-title\">\n 执行轨迹\n </div>\n <pre class=\"thinking-bar-tool-call-pre\">{{\n formatToolTrace(toolCall.trace)\n }}</pre>\n </div>\n <div\n v-if=\"toolCall.errorCode\"\n class=\"thinking-bar-tool-call-block thinking-bar-tool-call-block--error\"\n >\n <div class=\"thinking-bar-tool-call-block-title\">\n 错误码\n </div>\n <pre class=\"thinking-bar-tool-call-pre\">{{\n toolCall.errorCode\n }}</pre>\n </div>\n <div\n v-if=\"\n isKnowledgeAnswerTool(toolCall) &&\n getNestedKnowledgeToolCalls(step).length > 0\n \"\n class=\"thinking-bar-nested-tools\"\n >\n <div class=\"thinking-bar-nested-tools-label\">\n 知识库内部步骤\n </div>\n <details\n v-for=\"nested in getNestedKnowledgeToolCalls(\n step,\n )\"\n :key=\"nested.id\"\n class=\"thinking-bar-tool-call thinking-bar-tool-call--nested\"\n >\n <summary class=\"thinking-bar-tool-call-head\">\n <div class=\"thinking-bar-tool-call-head-main\">\n <span class=\"thinking-bar-tool-call-name\">{{\n getToolTitle(nested)\n }}</span>\n </div>\n <div class=\"thinking-bar-tool-call-head-side\">\n <span\n class=\"thinking-bar-tool-call-status\"\n :class=\"`is-${nested.status}`\"\n >\n {{ toolStatusLabel(nested.status) }}\n </span>\n <span class=\"thinking-bar-tool-call-caret\"\n >▾</span\n >\n </div>\n </summary>\n <div class=\"thinking-bar-tool-call-body\">\n <div\n v-if=\"nested.argsText?.trim()\"\n class=\"thinking-bar-tool-call-block\"\n >\n <div\n class=\"thinking-bar-tool-call-block-title\"\n >\n 请求参数\n </div>\n <pre class=\"thinking-bar-tool-call-pre\">{{\n nested.argsText\n }}</pre>\n </div>\n <div\n v-if=\"getToolResultDisplay(nested)\"\n class=\"thinking-bar-tool-call-block\"\n >\n <div\n class=\"thinking-bar-tool-call-block-title\"\n >\n 接口结果\n </div>\n <pre class=\"thinking-bar-tool-call-pre\">{{\n getToolResultDisplay(nested)\n }}</pre>\n </div>\n </div>\n </details>\n </div>\n </div>\n </details>\n </div>\n </details>\n <section\n v-if=\"getToolStepAnswer(step)\"\n class=\"thinking-bar-step-answer-section\"\n >\n <div class=\"thinking-bar-step-section-label\">回答</div>\n <div\n class=\"thinking-bar-step-text thinking-bar-step-markdown thinking-bar-step-answer\"\n >\n <SpotlightMarkdownPreview\n :model-value=\"getToolStepAnswer(step)\"\n format-knowledge\n />\n </div>\n </section>\n </div>\n </template>\n <template v-else>\n <div\n v-if=\"step.chatItems && step.chatItems.length > 0\"\n class=\"thinking-bar-chat-items\"\n >\n <div\n v-for=\"item in step.chatItems\"\n :key=\"item.id\"\n class=\"thinking-bar-chat-item\"\n >\n <div\n v-if=\"item.type === 'text' && item.text.trim()\"\n class=\"thinking-bar-step-text thinking-bar-step-markdown\"\n >\n <MdPreview\n :model-value=\"humanizeSpotlightStepContent(item.text)\"\n theme=\"dark\"\n preview-theme=\"github\"\n code-theme=\"github\"\n class=\"thinking-bar-md-preview\"\n />\n </div>\n <details\n v-else-if=\"item.type === 'tool'\"\n class=\"thinking-bar-tool-call\"\n :open=\"isToolCallOpen(item.toolCall)\"\n >\n <summary class=\"thinking-bar-tool-call-head\">\n <div class=\"thinking-bar-tool-call-head-main\">\n <span class=\"thinking-bar-tool-call-name\">\n {{ getToolTitle(item.toolCall) }}\n </span>\n </div>\n <div class=\"thinking-bar-tool-call-head-side\">\n <span\n class=\"thinking-bar-tool-call-status\"\n :class=\"`is-${item.toolCall.status}`\"\n >\n {{\n item.toolCall.status === \"done\"\n ? \"已完成\"\n : item.toolCall.status === \"error\"\n ? \"失败\"\n : item.toolCall.status === \"running\"\n ? \"执行中\"\n : \"待执行\"\n }}\n </span>\n <span class=\"thinking-bar-tool-call-caret\">▾</span>\n </div>\n </summary>\n <div class=\"thinking-bar-tool-call-body\">\n <div\n v-if=\"hasStructuredToolResult(item.toolCall)\"\n class=\"thinking-bar-tool-call-block thinking-bar-tool-call-block--result\"\n >\n <div class=\"thinking-bar-tool-call-block-title\">\n 结果\n </div>\n <div\n v-if=\"getToolResultImage(item.toolCall)\"\n class=\"thinking-bar-tool-result-image-shell\"\n >\n <img\n class=\"thinking-bar-tool-result-image\"\n :src=\"getToolResultImage(item.toolCall) || ''\"\n :alt=\"item.toolCall.name\"\n />\n </div>\n <iframe\n v-else-if=\"getToolResultHtml(item.toolCall)\"\n class=\"thinking-bar-tool-result-html\"\n :srcdoc=\"getToolResultHtml(item.toolCall) || ''\"\n :title=\"item.toolCall.name\"\n sandbox=\"\"\n />\n <div\n v-else-if=\"getToolResultTable(item.toolCall)\"\n class=\"thinking-bar-tool-result-table-wrap\"\n >\n <table class=\"thinking-bar-tool-result-table\">\n <thead>\n <tr>\n <th\n v-for=\"column in getToolResultTable(\n item.toolCall,\n )?.columns\"\n :key=\"column\"\n >\n {{ column }}\n </th>\n </tr>\n </thead>\n <tbody>\n <tr\n v-for=\"(row, rowIndex) in getToolResultTable(\n item.toolCall,\n )?.rows\"\n :key=\"`${item.toolCall.id}-${rowIndex}`\"\n >\n <td\n v-for=\"column in getToolResultTable(\n item.toolCall,\n )?.columns\"\n :key=\"`${item.toolCall.id}-${rowIndex}-${column}`\"\n >\n {{ formatTableCell(row[column]) }}\n </td>\n </tr>\n </tbody>\n </table>\n </div>\n <pre\n v-else-if=\"getToolResultDisplay(item.toolCall)\"\n class=\"thinking-bar-tool-call-pre\"\n >{{ getToolResultDisplay(item.toolCall) }}</pre\n >\n </div>\n </div>\n </details>\n </div>\n </div>\n <div\n v-else-if=\"step.content\"\n class=\"thinking-bar-step-text thinking-bar-step-markdown\"\n >\n <MdPreview\n :model-value=\"\n getIntentStepDisplayContent(step.content ?? '')\n \"\n theme=\"dark\"\n preview-theme=\"github\"\n code-theme=\"github\"\n class=\"thinking-bar-md-preview\"\n />\n </div>\n </template>\n <div\n v-if=\"step.attachments && step.attachments.length > 0\"\n class=\"thinking-bar-attachments\"\n >\n <a\n v-for=\"attachment in step.attachments\"\n :key=\"attachment.id\"\n class=\"thinking-bar-attachment\"\n :href=\"attachment.url\"\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n >\n <img\n v-if=\"attachment.type === 'image'\"\n class=\"thinking-bar-attachment-image\"\n :src=\"attachment.url\"\n :alt=\"attachment.name || '图表预览'\"\n />\n <div class=\"thinking-bar-attachment-meta\">\n <span class=\"thinking-bar-attachment-name\">\n {{ attachment.name || attachment.url }}\n </span>\n <span class=\"thinking-bar-attachment-type\">\n {{\n attachment.type === \"image\"\n ? \"图片预览\"\n : attachment.type === \"html\"\n ? \"打开图表\"\n : \"打开文件\"\n }}\n </span>\n </div>\n </a>\n </div>\n <div\n v-if=\"step.files && step.files.length > 0\"\n class=\"thinking-bar-workspace\"\n >\n <div class=\"thinking-bar-workspace-title\">状态工作台</div>\n <div class=\"thinking-bar-workspace-shell\">\n <div class=\"thinking-bar-file-tree-pane\">\n <div class=\"thinking-bar-file-tree-head\">文件系统</div>\n <div class=\"thinking-bar-file-tree-body\">\n <template\n v-for=\"node in getVisibleFileTree(step.id, step.files)\"\n :key=\"`${step.id}:${node.path}`\"\n >\n <div\n v-if=\"node.type === 'directory'\"\n class=\"thinking-bar-tree-node\"\n >\n <button\n type=\"button\"\n class=\"thinking-bar-tree-row thinking-bar-tree-row--directory\"\n :style=\"{\n paddingLeft: `${node.depth * 14 + 10}px`,\n }\"\n @click=\"toggleDirectory(step.id, node.path)\"\n >\n <span class=\"thinking-bar-tree-caret\">\n {{\n isDirectoryExpanded(step.id, node.path)\n ? \"▾\"\n : \"▸\"\n }}\n </span>\n <span class=\"thinking-bar-tree-icon\">📁</span>\n <span class=\"thinking-bar-tree-label\">{{\n node.name\n }}</span>\n </button>\n </div>\n <button\n v-else\n type=\"button\"\n class=\"thinking-bar-tree-row thinking-bar-tree-row--file\"\n :class=\"{\n active: getSelectedFile(step)?.id === node.file?.id,\n }\"\n :style=\"{ paddingLeft: `${node.depth * 14 + 26}px` }\"\n @click=\"selectTreeFile(step.id, node.file)\"\n >\n <span class=\"thinking-bar-tree-icon\">\n {{ getFileIcon(node.file?.path || \"\") }}\n </span>\n <span class=\"thinking-bar-tree-label\">{{\n node.name\n }}</span>\n </button>\n </template>\n </div>\n </div>\n <div class=\"thinking-bar-file-preview\">\n <template v-if=\"getSelectedFile(step)\">\n <div class=\"thinking-bar-file-preview-head\">\n <div class=\"thinking-bar-file-preview-title\">\n <span class=\"thinking-bar-tree-icon\">\n {{ getFileIcon(getSelectedFile(step)?.path || \"\") }}\n </span>\n <span>{{ getSelectedFile(step)?.path }}</span>\n </div>\n <span\n v-if=\"isHtmlFile(getSelectedFile(step)?.path || '')\"\n class=\"thinking-bar-preview-chip\"\n >\n HTML 预览\n </span>\n </div>\n <div\n v-if=\"isImageFile(getSelectedFile(step)?.path || '')\"\n class=\"thinking-bar-image-shell\"\n >\n <img\n v-if=\"getFileDataUrl(getSelectedFile(step))\"\n class=\"thinking-bar-image-preview\"\n :src=\"getFileDataUrl(getSelectedFile(step)) || ''\"\n :alt=\"getSelectedFile(step)?.name || '图片预览'\"\n />\n <div v-else class=\"thinking-bar-empty-preview\">\n 当前图片文件没有可直接渲染的内容。\n </div>\n </div>\n <iframe\n v-else-if=\"\n isHtmlFile(getSelectedFile(step)?.path || '')\n \"\n class=\"thinking-bar-html-preview\"\n :srcdoc=\"getFileContent(getSelectedFile(step))\"\n :title=\"getSelectedFile(step)?.path\"\n sandbox=\"\"\n />\n <pre v-else class=\"thinking-bar-file-preview-body\">{{\n getFileContent(getSelectedFile(step))\n }}</pre>\n </template>\n <div v-else class=\"thinking-bar-empty-preview\">\n 还没选中文件,左边点一个看看。\n </div>\n </div>\n </div>\n </div>\n </div>\n </div>\n </div>\n </div>\n </div>\n </div>\n</template>\n\n<script setup lang=\"ts\">\nimport {\n computed,\n nextTick,\n onBeforeUnmount,\n onMounted,\n ref,\n watch,\n} from \"vue\";\nimport { MdPreview } from \"md-editor-v3\";\nimport \"md-editor-v3/lib/preview.css\";\nimport SpotlightMarkdownPreview from \"./SpotlightMarkdownPreview.vue\";\nimport type { ToolTraceEvent } from \"@inupedia/spotlight-protocol\";\nimport {\n getIntentStepDisplayContent,\n humanizeSpotlightStepContent,\n isToolExecutionStep,\n sanitizeToolStepAnswerText,\n splitToolStepContent,\n} from \"../store/pipeline/displayText.js\";\nimport { partitionToolCalls } from \"../store/pipeline/toolDisplay.js\";\nimport { TOOL_NAMES } from \"../constants/toolNames.js\";\nimport OfficialBorderBeam from \"./OfficialBorderBeam.vue\";\n\ninterface StepAttachment {\n id: string;\n type: \"image\" | \"file\" | \"html\";\n name?: string;\n url: string;\n mimeType?: string;\n}\n\ninterface StepFile {\n id: string;\n path: string;\n name: string;\n content?: string[];\n createdAt?: string;\n modifiedAt?: string;\n}\n\ninterface StepToolCall {\n id: string;\n name: string;\n displayName?: string;\n argsText?: string;\n resultText?: string;\n summary?: string;\n errorCode?: string;\n trace?: ToolTraceEvent[];\n status: \"pending\" | \"running\" | \"done\" | \"error\";\n}\n\ninterface TableData {\n columns: string[];\n rows: Array<Record<string, unknown>>;\n}\n\ntype StepChatItem =\n | {\n id: string;\n type: \"text\";\n text: string;\n }\n | {\n id: string;\n type: \"tool\";\n toolCall: StepToolCall;\n };\n\ninterface FileTreeNode {\n type: \"directory\" | \"file\";\n path: string;\n name: string;\n depth: number;\n file: StepFile | null;\n}\n\nconst isOpen = ref(false);\nconst stepsContainerRef = ref<HTMLElement | null>(null);\n/** 各阶段独立:仅当为 false 时跳过自动滚到底(用户在该阶段内上滑过) */\nconst stepStickToBottom = ref<Record<string, boolean>>({});\nconst stepBodyEls = new Map<string, HTMLElement>();\nlet scrollTimer: number | null = null;\nlet bodyResizeObserver: ResizeObserver | null = null;\n\nfunction scheduleScrollAfterLayout(force: boolean) {\n void scrollToBottom(force);\n requestAnimationFrame(() => {\n void scrollToBottom(force);\n });\n}\n\nfunction setStepBodyRef(stepId: string, el: unknown) {\n const prev = stepBodyEls.get(stepId);\n if (prev && bodyResizeObserver) {\n bodyResizeObserver.unobserve(prev);\n }\n const html = el instanceof HTMLElement ? el : null;\n if (html) {\n stepBodyEls.set(stepId, html);\n bodyResizeObserver?.observe(html);\n } else {\n stepBodyEls.delete(stepId);\n }\n}\n\nfunction isStepBodyNearBottom(el: HTMLElement): boolean {\n return el.scrollHeight - el.scrollTop - el.clientHeight <= 96;\n}\n\nfunction handleStepBodyScroll(stepId: string, event: Event) {\n const el = event.target as HTMLElement;\n if (scrollTimer != null) {\n window.clearTimeout(scrollTimer);\n }\n stepStickToBottom.value = {\n ...stepStickToBottom.value,\n [stepId]: isStepBodyNearBottom(el),\n };\n scrollTimer = window.setTimeout(() => {\n stepStickToBottom.value = {\n ...stepStickToBottom.value,\n [stepId]: isStepBodyNearBottom(el),\n };\n }, 120);\n}\n\nfunction scrollTargetStepIds(): string[] {\n const active = props.steps.find((s) => s.status === \"active\");\n if (active) return [active.id];\n const last = props.steps[props.steps.length - 1];\n return last ? [last.id] : [];\n}\n\nfunction shouldFollowStepBody(stepId: string, force: boolean): boolean {\n if (force) return true;\n return stepStickToBottom.value[stepId] !== false;\n}\n\nonMounted(() => {\n if (typeof ResizeObserver !== \"undefined\") {\n bodyResizeObserver = new ResizeObserver(() => {\n void scrollToBottom();\n });\n void nextTick(() => {\n stepBodyEls.forEach((el) => {\n bodyResizeObserver?.observe(el);\n });\n });\n }\n requestAnimationFrame(() => {\n isOpen.value = true;\n });\n requestAnimationFrame(() => {\n scheduleScrollAfterLayout(true);\n });\n});\n\nonBeforeUnmount(() => {\n if (scrollTimer != null) {\n window.clearTimeout(scrollTimer);\n }\n bodyResizeObserver?.disconnect();\n bodyResizeObserver = null;\n stepBodyEls.clear();\n});\n\nconst props = defineProps<{\n steps: Array<{\n id: string;\n label: string;\n status: \"pending\" | \"active\" | \"done\" | \"error\";\n content?: string;\n attachments?: StepAttachment[];\n files?: StepFile[];\n toolCalls?: StepToolCall[];\n chatItems?: StepChatItem[];\n }>;\n embedded?: boolean;\n centered?: boolean;\n}>();\n\ndefineEmits<{\n close: [];\n}>();\n\nconst titleText = computed(() => {\n const allEnded =\n props.steps.length > 0 &&\n props.steps.every((s) => s.status === \"done\" || s.status === \"error\");\n return allEnded ? \"执行完成\" : \"思考中\";\n});\n\nconst isThinkingActive = computed(() =>\n props.steps.some(\n (step) =>\n step.status === \"active\" ||\n step.status === \"pending\" ||\n step.toolCalls?.some(\n (toolCall) =>\n toolCall.status === \"pending\" || toolCall.status === \"running\",\n ),\n ),\n);\nconst activeStepCount = computed(\n () => props.steps.filter((step) => step.status === \"active\").length,\n);\nconst doneStepCount = computed(\n () => props.steps.filter((step) => step.status === \"done\").length,\n);\n\nfunction stepIcon(status: string): string {\n switch (status) {\n case \"active\":\n return \"⋯\";\n case \"done\":\n return \"✓\";\n case \"error\":\n return \"✕\";\n default:\n return \"·\";\n }\n}\n\nfunction getToolId(toolCall: StepToolCall): string {\n return toolCall.name.trim().toLowerCase();\n}\n\nfunction getToolTitle(toolCall: StepToolCall): string {\n return toolCall.displayName?.trim() || toolCall.name;\n}\n\ntype PipelineStep = (typeof props.steps)[number];\n\nfunction getToolStepPlanning(step: PipelineStep): string {\n return splitToolStepContent(step.content ?? \"\").planning;\n}\n\nfunction getToolStepAnswer(step: PipelineStep): string {\n const { planning } = splitToolStepContent(step.content ?? \"\");\n const cleaned = stripInternalEvidenceAnswer(\n sanitizeToolStepAnswerText(step.content ?? \"\"),\n );\n if (cleaned.trim()) return cleaned;\n\n if (planning.trim()) return \"\";\n return stripInternalEvidenceAnswer(\n sanitizeToolStepAnswerText(step.content ?? \"\"),\n );\n}\n\nfunction stripInternalEvidenceAnswer(text: string): string {\n const trimmed = text.trim();\n if (!trimmed) return \"\";\n if (\n trimmed.startsWith(\"联网检索证据:\") ||\n trimmed.includes(\"Tavily answer:\")\n ) {\n return \"\";\n }\n return trimmed;\n}\n\nfunction collectRawToolCalls(step: PipelineStep): StepToolCall[] {\n if (step.toolCalls?.length) return step.toolCalls;\n return (step.chatItems ?? [])\n .filter(\n (item): item is Extract<StepChatItem, { type: \"tool\" }> =>\n item.type === \"tool\",\n )\n .map((item) => item.toolCall);\n}\n\nfunction getStepToolCalls(step: PipelineStep): StepToolCall[] {\n return partitionToolCalls(collectRawToolCalls(step)).visible;\n}\n\nfunction getNestedKnowledgeToolCalls(step: PipelineStep): StepToolCall[] {\n return partitionToolCalls(collectRawToolCalls(step)).nestedKnowledge;\n}\n\nfunction isKnowledgeAnswerTool(toolCall: StepToolCall): boolean {\n return normalizeToolName(toolCall.name) === TOOL_NAMES.knowledge.answer;\n}\n\nfunction normalizeToolName(name: string): string {\n return name.trim().toLowerCase();\n}\n\nfunction hasExecutionDetails(step: PipelineStep): boolean {\n return Boolean(\n getToolStepPlanning(step).trim() || getStepToolCalls(step).length > 0,\n );\n}\n\nfunction executionDetailsMeta(step: PipelineStep): string {\n const toolCount = getStepToolCalls(step).length;\n if (toolCount > 0) return `${toolCount} 个工具调用`;\n return \"规划记录\";\n}\n\nfunction toolStatusLabel(status: StepToolCall[\"status\"]): string {\n switch (status) {\n case \"done\":\n return \"已完成\";\n case \"error\":\n return \"失败\";\n case \"running\":\n return \"执行中\";\n default:\n return \"待执行\";\n }\n}\n\nfunction formatToolTrace(trace?: ToolTraceEvent[]): string {\n if (!trace?.length) return \"\";\n return trace\n .map(\n (event) =>\n `[${event.phase}/${event.type}] ${event.tool}${event.detail ? ` · ${event.detail}` : \"\"}`,\n )\n .join(\"\\n\");\n}\n\nfunction isToolCallOpen(toolCall: StepToolCall): boolean {\n return toolCall.status === \"running\" || toolCall.status === \"pending\";\n}\n\nfunction parseStructuredText(value?: string): unknown {\n if (!value) return null;\n try {\n return JSON.parse(value);\n } catch {\n return null;\n }\n}\n\nfunction getToolResultDisplay(toolCall: StepToolCall): string {\n const toolId = getToolId(toolCall);\n const raw = toolCall.resultText?.trim() || \"\";\n if (!raw) return \"\";\n\n if (toolId === \"list_kbs\") {\n const parsed = parseStructuredText(raw);\n if (Array.isArray(parsed)) {\n if (parsed.length === 0) return \"当前没有可访问的知识库\";\n return raw;\n }\n return raw;\n }\n\n if (toolId === \"list_directory\" || toolId === \"ls\") {\n const parsed = parseStructuredText(raw);\n if (Array.isArray(parsed) && parsed.length === 0) {\n return \"\";\n }\n return raw;\n }\n\n return raw;\n}\n\nfunction getParsedToolResult(toolCall: StepToolCall): unknown {\n const raw = toolCall.resultText?.trim() || \"\";\n if (!raw) return null;\n return parseStructuredText(raw) ?? raw;\n}\n\nfunction isPlainObject(value: unknown): value is Record<string, unknown> {\n return typeof value === \"object\" && value !== null && !Array.isArray(value);\n}\n\nfunction looksLikeInlineHtml(value: string): boolean {\n return /<(table|html|body|svg|div|span|img|p|iframe)[\\s>]/i.test(value);\n}\n\nfunction getToolResultImage(toolCall: StepToolCall): string | null {\n const parsed = getParsedToolResult(toolCall);\n if (typeof parsed === \"string\") {\n const trimmed = parsed.trim();\n if (/^data:image\\//i.test(trimmed)) return trimmed;\n if (/\\.(png|jpe?g|gif|webp|svg)(\\?.*)?$/i.test(trimmed)) return trimmed;\n return null;\n }\n\n if (isPlainObject(parsed)) {\n const candidate = [parsed.url, parsed.uri, parsed.path].find(\n (value) => typeof value === \"string\" && /^data:image\\//i.test(value),\n );\n return typeof candidate === \"string\" ? candidate : null;\n }\n\n return null;\n}\n\nfunction getToolResultHtml(toolCall: StepToolCall): string | null {\n const parsed = getParsedToolResult(toolCall);\n if (typeof parsed === \"string\" && looksLikeInlineHtml(parsed.trim())) {\n return parsed;\n }\n if (isPlainObject(parsed)) {\n const candidate = [parsed.html, parsed.content, parsed.markup].find(\n (value) => typeof value === \"string\" && looksLikeInlineHtml(value),\n );\n return typeof candidate === \"string\" ? candidate : null;\n }\n return null;\n}\n\nfunction normalizeRows(value: unknown): Array<Record<string, unknown>> | null {\n if (!Array.isArray(value) || value.length === 0) return null;\n if (!value.every((item) => isPlainObject(item))) return null;\n return value as Array<Record<string, unknown>>;\n}\n\nfunction getToolResultTable(toolCall: StepToolCall): TableData | null {\n const parsed = getParsedToolResult(toolCall);\n if (\n Array.isArray(parsed) &&\n parsed.length > 0 &&\n parsed.every((item) => typeof item === \"string\")\n ) {\n return {\n columns: [\"value\"],\n rows: (parsed as string[]).map((value) => ({ value })),\n };\n }\n\n const directRows = normalizeRows(parsed);\n if (directRows) {\n const columns = [...new Set(directRows.flatMap((row) => Object.keys(row)))];\n return columns.length > 0 ? { columns, rows: directRows } : null;\n }\n\n if (!isPlainObject(parsed)) return null;\n\n if (\n Array.isArray(parsed.columns) &&\n Array.isArray(parsed.rows) &&\n parsed.columns.every((column) => typeof column === \"string\")\n ) {\n const columns = parsed.columns as string[];\n const rows = (parsed.rows as unknown[]).map((row) =>\n isPlainObject(row)\n ? row\n : Array.isArray(row)\n ? Object.fromEntries(\n columns.map((column, index) => [column, row[index]]),\n )\n : { value: row },\n );\n return columns.length > 0 ? { columns, rows } : null;\n }\n\n if (Array.isArray(parsed.data)) {\n const nestedRows = normalizeRows(parsed.data);\n if (nestedRows) {\n const columns = [\n ...new Set(nestedRows.flatMap((row) => Object.keys(row))),\n ];\n return columns.length > 0 ? { columns, rows: nestedRows } : null;\n }\n }\n\n return null;\n}\n\nfunction hasStructuredToolResult(toolCall: StepToolCall): boolean {\n const display = getToolResultDisplay(toolCall);\n const summary = toolCall.summary?.trim();\n if (display && summary && display.trim() === summary) return false;\n return Boolean(\n getToolResultImage(toolCall) ||\n getToolResultHtml(toolCall) ||\n getToolResultTable(toolCall) ||\n display,\n );\n}\n\nfunction formatTableCell(value: unknown): string {\n if (value == null) return \"-\";\n if (typeof value === \"string\") return value;\n if (typeof value === \"number\" || typeof value === \"boolean\") {\n return String(value);\n }\n try {\n return JSON.stringify(value);\n } catch {\n return String(value);\n }\n}\n\nasync function scrollToBottom(force = false) {\n await nextTick();\n const stepsContainer = stepsContainerRef.value;\n if (stepsContainer) {\n stepsContainer.scrollTo({\n top: stepsContainer.scrollHeight,\n behavior: force ? \"auto\" : \"smooth\",\n });\n }\n const ids = scrollTargetStepIds();\n for (const id of ids) {\n const el = stepBodyEls.get(id);\n if (!el || !shouldFollowStepBody(id, force)) continue;\n el.scrollTo({\n top: el.scrollHeight,\n behavior: force ? \"auto\" : \"smooth\",\n });\n }\n\n window.setTimeout(() => {\n const retryContainer = stepsContainerRef.value;\n if (retryContainer) {\n retryContainer.scrollTo({\n top: retryContainer.scrollHeight,\n behavior: \"auto\",\n });\n }\n for (const id of ids) {\n const el = stepBodyEls.get(id);\n if (!el || !shouldFollowStepBody(id, force)) continue;\n el.scrollTo({\n top: el.scrollHeight,\n behavior: \"auto\",\n });\n }\n }, 120);\n}\n\nwatch(\n () => props.steps,\n () => {\n if (isThinkingActive.value) {\n const active = props.steps.find((s) => s.status === \"active\");\n // When a new active step appears, default it to follow-bottom.\n // If user manually scrolls up, handleStepBodyScroll will flip it to false.\n if (active && !(active.id in stepStickToBottom.value)) {\n stepStickToBottom.value = {\n ...stepStickToBottom.value,\n [active.id]: true,\n };\n }\n scheduleScrollAfterLayout(false);\n return;\n }\n scheduleScrollAfterLayout(false);\n },\n { deep: true },\n);\n\nconst selectedFileByStep = ref<Record<string, string>>({});\nconst expandedDirectoriesByStep = ref<Record<string, string[]>>({});\n\nwatch(\n () => props.steps,\n (steps) => {\n const next = { ...selectedFileByStep.value };\n const nextExpanded = { ...expandedDirectoriesByStep.value };\n for (const step of steps) {\n if (step.files?.length && !next[step.id]) {\n next[step.id] = step.files[0].id;\n }\n if (!step.files?.length && next[step.id]) {\n delete next[step.id];\n }\n if (step.files?.length) {\n const expanded = new Set(nextExpanded[step.id] || []);\n for (const file of step.files) {\n collectDirectoryPaths(file.path).forEach((path) =>\n expanded.add(path),\n );\n }\n nextExpanded[step.id] = [...expanded];\n }\n if (!step.files?.length && nextExpanded[step.id]) {\n delete nextExpanded[step.id];\n }\n }\n selectedFileByStep.value = next;\n expandedDirectoriesByStep.value = nextExpanded;\n },\n { deep: true, immediate: true },\n);\n\nfunction selectFile(stepId: string, fileId: string) {\n selectedFileByStep.value = {\n ...selectedFileByStep.value,\n [stepId]: fileId,\n };\n}\n\nfunction selectTreeFile(stepId: string, file: StepFile | null | undefined) {\n if (!file) return;\n selectFile(stepId, file.id);\n}\n\nfunction getSelectedFile(step: (typeof props.steps)[number]) {\n const selectedId = selectedFileByStep.value[step.id];\n return (\n step.files?.find((file) => file.id === selectedId) ??\n step.files?.[0] ??\n null\n );\n}\n\nfunction collectDirectoryPaths(path: string): string[] {\n const normalized = path.split(\"/\").filter(Boolean);\n const directories: string[] = [];\n let current = \"\";\n normalized.slice(0, -1).forEach((segment) => {\n current += `/${segment}`;\n directories.push(current);\n });\n return directories;\n}\n\nfunction isDirectoryExpanded(stepId: string, path: string): boolean {\n return (expandedDirectoriesByStep.value[stepId] || []).includes(path);\n}\n\nfunction toggleDirectory(stepId: string, path: string) {\n const current = new Set(expandedDirectoriesByStep.value[stepId] || []);\n if (current.has(path)) current.delete(path);\n else current.add(path);\n expandedDirectoriesByStep.value = {\n ...expandedDirectoriesByStep.value,\n [stepId]: [...current],\n };\n}\n\nfunction getVisibleFileTree(stepId: string, files: StepFile[]): FileTreeNode[] {\n const directories = new Map<\n string,\n {\n path: string;\n name: string;\n depth: number;\n directoryChildren: string[];\n files: StepFile[];\n }\n >();\n\n const ensureDirectory = (path: string, name: string, depth: number) => {\n if (!directories.has(path)) {\n directories.set(path, {\n path,\n name,\n depth,\n directoryChildren: [],\n files: [],\n });\n }\n return directories.get(path)!;\n };\n\n const root = ensureDirectory(\"\", \"root\", -1);\n\n for (const file of files) {\n const normalized = file.path.split(\"/\").filter(Boolean);\n let currentPath = \"\";\n let parent = root;\n\n normalized.slice(0, -1).forEach((segment, index) => {\n currentPath += `/${segment}`;\n const directory = ensureDirectory(currentPath, segment, index);\n if (!parent.directoryChildren.includes(currentPath)) {\n parent.directoryChildren.push(currentPath);\n }\n parent = directory;\n });\n\n parent.files.push(file);\n }\n\n const nodes: FileTreeNode[] = [];\n const walk = (directoryPath: string) => {\n const current = directories.get(directoryPath);\n if (!current) return;\n\n const sortedDirectories = [...current.directoryChildren].sort((a, b) =>\n a.localeCompare(b, \"zh-CN\"),\n );\n for (const childPath of sortedDirectories) {\n const child = directories.get(childPath);\n if (!child) continue;\n nodes.push({\n type: \"directory\",\n path: child.path,\n name: child.name,\n depth: child.depth,\n file: null,\n });\n if (isDirectoryExpanded(stepId, child.path)) {\n walk(child.path);\n }\n }\n\n const sortedFiles = [...current.files].sort((a, b) =>\n a.path.localeCompare(b.path, \"zh-CN\"),\n );\n sortedFiles.forEach((file) => {\n const depth = Math.max(\n file.path.split(\"/\").filter(Boolean).length - 1,\n 0,\n );\n nodes.push({\n type: \"file\",\n path: file.path,\n name: file.name,\n depth,\n file,\n });\n });\n };\n\n walk(\"\");\n return nodes;\n}\n\nfunction getFileContent(file: StepFile | null): string {\n return (file?.content || []).join(\"\\n\").trim();\n}\n\nfunction isImageFile(path: string): boolean {\n return /\\.(png|jpe?g|gif|webp|svg)$/i.test(path);\n}\n\nfunction isHtmlFile(path: string): boolean {\n return /\\.(html?)$/i.test(path);\n}\n\nfunction getFileDataUrl(file: StepFile | null): string {\n const content = getFileContent(file);\n if (/^data:image\\//i.test(content)) {\n return content;\n }\n return \"\";\n}\n\nfunction getFileIcon(path: string): string {\n if (isImageFile(path)) return \"🖼\";\n if (isHtmlFile(path)) return \"🌐\";\n if (/\\.md$/i.test(path)) return \"📝\";\n if (/\\.(csv|xlsx?)$/i.test(path)) return \"📊\";\n if (/\\.(json|ya?ml|xml)$/i.test(path)) return \"🧩\";\n return \"📄\";\n}\n</script>\n\n<style scoped>\n.thinking-bar {\n position: fixed;\n width: min(720px, calc(100vw - 48px));\n max-height: min(78vh, 820px);\n display: flex;\n flex-direction: column;\n min-height: 0;\n background: linear-gradient(180deg, #1e293b 0%, #0f172a 100%);\n border-radius: 22px;\n box-shadow:\n 0 24px 80px rgba(2, 6, 23, 0.48),\n 0 0 0 1px rgba(148, 163, 184, 0.18);\n color: #e2e8f0;\n z-index: 10000;\n overflow: hidden;\n opacity: 0;\n backdrop-filter: blur(14px);\n transition:\n opacity 0.28s ease,\n transform 0.28s ease,\n inset 0.28s ease,\n width 0.28s ease,\n max-height 0.28s ease,\n border-radius 0.28s ease;\n}\n\n.thinking-bar--open {\n opacity: 1;\n}\n\n.thinking-bar--embedded {\n position: relative;\n right: auto;\n bottom: auto;\n width: 100%;\n max-height: 100%;\n}\n\n.thinking-bar--centered {\n left: 50%;\n top: 50%;\n transform: translate(-50%, -50%) scale(0.96);\n transform-origin: center;\n}\n\n.thinking-bar--centered.thinking-bar--open {\n transform: translate(-50%, -50%) scale(1);\n}\n\n.thinking-bar--corner {\n right: 24px;\n bottom: 24px;\n width: min(440px, calc(100vw - 28px));\n max-height: min(76vh, calc(100vh - 36px));\n border-radius: 16px;\n transform: scale(0.96);\n transform-origin: right bottom;\n}\n\n.thinking-bar--corner.thinking-bar--open {\n transform: scale(1);\n}\n\n.thinking-bar-header {\n display: flex;\n align-items: center;\n justify-content: space-between;\n padding: 18px 22px 16px;\n border-bottom: 1px solid rgba(148, 163, 184, 0.2);\n flex-shrink: 0;\n}\n\n.thinking-bar-title {\n font-size: 18px;\n font-weight: 700;\n color: #dbeafe;\n letter-spacing: 0.02em;\n min-width: 0;\n line-height: 1.35;\n}\n\n.thinking-bar-close {\n width: 28px;\n height: 28px;\n display: flex;\n align-items: center;\n justify-content: center;\n padding: 0;\n border: none;\n border-radius: 8px;\n background: transparent;\n color: #94a3b8;\n font-size: 20px;\n line-height: 1;\n cursor: pointer;\n transition:\n background 0.15s,\n color 0.15s;\n}\n\n.thinking-bar-close:hover {\n background: rgba(148, 163, 184, 0.2);\n color: #e2e8f0;\n}\n\n.thinking-bar-steps {\n padding: 18px 22px 22px;\n flex: 1;\n min-height: 0;\n overflow-x: hidden;\n overflow-y: auto;\n display: flex;\n flex-direction: column;\n gap: 10px;\n}\n\n.thinking-bar-step {\n --thinking-step-border-color: rgba(148, 163, 184, 0.1);\n --thinking-step-glow-color: rgba(148, 163, 184, 0.16);\n display: flex;\n flex-direction: column;\n position: relative;\n /* Let each step size to content; long tool details scroll internally. */\n flex: 0 0 auto;\n min-height: 0;\n min-width: 0;\n box-sizing: border-box;\n font-size: 15px;\n padding: 10px 12px;\n border-radius: 14px;\n background: rgba(15, 23, 42, 0.42);\n border: 1px solid var(--thinking-step-border-color);\n box-shadow:\n inset 0 0 0 1px rgba(255, 255, 255, 0.02),\n 0 0 0 1px rgba(2, 6, 23, 0.16);\n overflow: hidden;\n isolation: isolate;\n transition:\n border-color 0.22s ease,\n box-shadow 0.22s ease,\n background 0.22s ease;\n}\n\n.thinking-bar-step-inner {\n flex: 1;\n min-height: 0;\n display: flex;\n flex-direction: row;\n align-items: stretch;\n gap: 10px;\n min-width: 0;\n}\n\n.thinking-bar-step-column {\n flex: 1;\n min-width: 0;\n min-height: 0;\n display: flex;\n flex-direction: column;\n gap: 6px;\n position: relative;\n z-index: 1;\n}\n\n.thinking-bar-step-body {\n flex: 1;\n min-height: 0;\n max-height: min(36vh, 340px);\n overflow-x: hidden;\n overflow-y: auto;\n overscroll-behavior: contain;\n -webkit-overflow-scrolling: touch;\n}\n\n/* 隐藏滚动条且不占用布局宽度(仍可滚轮/触控滑动) */\n.thinking-bar-steps,\n.thinking-bar-step-body,\n.thinking-bar-tool-call-block,\n.thinking-bar-tool-result-table-wrap,\n.thinking-bar-file-tree-body,\n.thinking-bar-file-preview-body {\n -ms-overflow-style: none;\n scrollbar-width: none;\n}\n\n.thinking-bar-steps::-webkit-scrollbar,\n.thinking-bar-step-body::-webkit-scrollbar,\n.thinking-bar-tool-call-block::-webkit-scrollbar,\n.thinking-bar-tool-result-table-wrap::-webkit-scrollbar,\n.thinking-bar-file-tree-body::-webkit-scrollbar,\n.thinking-bar-file-preview-body::-webkit-scrollbar {\n display: none;\n width: 0;\n height: 0;\n}\n\n.thinking-bar-step-beam {\n z-index: 0;\n}\n\n.thinking-bar-step::before {\n content: \"\";\n position: absolute;\n inset: 0;\n border-radius: inherit;\n padding: 1px;\n background: linear-gradient(\n 180deg,\n rgba(255, 255, 255, 0.04),\n rgba(255, 255, 255, 0.01)\n );\n pointer-events: none;\n -webkit-mask:\n linear-gradient(#fff 0 0) content-box,\n linear-gradient(#fff 0 0);\n -webkit-mask-composite: xor;\n mask:\n linear-gradient(#fff 0 0) content-box,\n linear-gradient(#fff 0 0);\n mask-composite: exclude;\n}\n\n.thinking-bar-step.done {\n --thinking-step-border-color: rgba(59, 130, 246, 0.82);\n --thinking-step-glow-color: rgba(59, 130, 246, 0.24);\n background: linear-gradient(\n 180deg,\n rgba(15, 23, 42, 0.58) 0%,\n rgba(10, 20, 38, 0.48) 100%\n );\n box-shadow:\n inset 0 0 0 1px rgba(96, 165, 250, 0.06),\n 0 0 0 1px rgba(59, 130, 246, 0.12),\n 0 10px 24px -20px var(--thinking-step-glow-color);\n}\n\n.thinking-bar-step.active {\n --thinking-step-border-color: rgba(255, 170, 64, 0.78);\n --thinking-step-glow-color: rgba(156, 64, 255, 0.2);\n background: linear-gradient(\n 180deg,\n rgba(24, 18, 38, 0.82) 0%,\n rgba(17, 11, 32, 0.72) 100%\n );\n box-shadow:\n inset 0 0 0 1px rgba(255, 170, 64, 0.08),\n 0 0 0 1px rgba(255, 170, 64, 0.14),\n 0 12px 28px -20px var(--thinking-step-glow-color),\n 0 0 24px -14px rgba(156, 64, 255, 0.22);\n}\n\n.thinking-bar-step.active::before {\n background: linear-gradient(\n 180deg,\n rgba(255, 170, 64, 0.12),\n rgba(156, 64, 255, 0.04)\n );\n}\n\n.thinking-bar-step.error {\n --thinking-step-border-color: rgba(248, 113, 113, 0.72);\n --thinking-step-glow-color: rgba(248, 113, 113, 0.22);\n box-shadow:\n inset 0 0 0 1px rgba(248, 113, 113, 0.05),\n 0 0 0 1px rgba(248, 113, 113, 0.12),\n 0 10px 24px -20px var(--thinking-step-glow-color);\n}\n\n.thinking-bar-step-icon {\n flex-shrink: 0;\n align-self: flex-start;\n width: 22px;\n text-align: center;\n font-size: 15px;\n color: #64748b;\n position: relative;\n z-index: 1;\n margin-top: 2px;\n}\n\n.thinking-bar-step.active .thinking-bar-step-icon {\n color: #ffb347;\n text-shadow: 0 0 12px rgba(255, 170, 64, 0.35);\n animation: thinking-pulse 1.1s ease-in-out infinite;\n}\n\n.thinking-bar-step.done .thinking-bar-step-icon {\n color: #60a5fa;\n}\n\n.thinking-bar-step.error .thinking-bar-step-icon {\n color: #f87171;\n}\n\n.thinking-bar-step-label {\n flex-shrink: 0;\n color: #e2e8f0;\n font-size: 15px;\n font-weight: 600;\n line-height: 1.45;\n overflow: visible;\n}\n\n.thinking-bar-step-text {\n margin: 0;\n color: #94a3b8;\n font-size: 14px;\n line-height: 1.65;\n white-space: pre-wrap;\n word-break: break-word;\n}\n\n.thinking-bar-step-markdown {\n white-space: normal;\n}\n\n.thinking-bar-md-preview {\n --md-theme-bg-color: transparent;\n --md-color: #94a3b8;\n --md-bk-color: transparent;\n --md-border-color: rgba(148, 163, 184, 0.14);\n --md-code-bg-color: rgba(15, 23, 42, 0.76);\n --md-code-color: #c4b5fd;\n --md-table-even-color: rgba(2, 6, 23, 0.52);\n --md-table-odd-color: rgba(2, 6, 23, 0.42);\n --md-table-header-bg-color: rgba(15, 23, 42, 0.96);\n --md-scrollbar-bg-color: rgba(148, 163, 184, 0.12);\n --md-scrollbar-thumb-color: rgba(148, 163, 184, 0.36);\n}\n\n.thinking-bar-step-markdown :deep(.md-editor-preview-wrapper) {\n padding: 0;\n}\n\n.thinking-bar-step-markdown :deep(.md-editor-preview) {\n color: #94a3b8;\n font-size: 14px;\n line-height: 1.6;\n}\n\n.thinking-bar-step-answer :deep(.md-editor-preview h1),\n.thinking-bar-step-answer :deep(.md-editor-preview h2),\n.thinking-bar-step-answer :deep(.md-editor-preview h3),\n.thinking-bar-step-answer :deep(.md-editor-preview h4),\n.thinking-bar-step-answer :deep(.md-editor-preview h5),\n.thinking-bar-step-answer :deep(.md-editor-preview h6) {\n margin: 8px 0 4px;\n color: #e2e8f0;\n font-size: 14px;\n font-weight: 600;\n line-height: 1.55;\n}\n\n.thinking-bar-step-answer :deep(.md-editor-preview p),\n.thinking-bar-step-answer :deep(.md-editor-preview ul),\n.thinking-bar-step-answer :deep(.md-editor-preview ol),\n.thinking-bar-step-answer :deep(.md-editor-preview li),\n.thinking-bar-step-answer :deep(.md-editor-preview table),\n.thinking-bar-step-answer :deep(.md-editor-preview th),\n.thinking-bar-step-answer :deep(.md-editor-preview td) {\n font-size: 14px;\n}\n\n.thinking-bar--corner .thinking-bar-step-answer :deep(.md-editor-preview h1),\n.thinking-bar--corner .thinking-bar-step-answer :deep(.md-editor-preview h2),\n.thinking-bar--corner .thinking-bar-step-answer :deep(.md-editor-preview h3),\n.thinking-bar--corner .thinking-bar-step-answer :deep(.md-editor-preview h4),\n.thinking-bar--corner .thinking-bar-step-answer :deep(.md-editor-preview h5),\n.thinking-bar--corner .thinking-bar-step-answer :deep(.md-editor-preview h6),\n.thinking-bar--corner .thinking-bar-step-answer :deep(.md-editor-preview p),\n.thinking-bar--corner .thinking-bar-step-answer :deep(.md-editor-preview ul),\n.thinking-bar--corner .thinking-bar-step-answer :deep(.md-editor-preview ol),\n.thinking-bar--corner .thinking-bar-step-answer :deep(.md-editor-preview li),\n.thinking-bar--corner .thinking-bar-step-answer :deep(.md-editor-preview table),\n.thinking-bar--corner .thinking-bar-step-answer :deep(.md-editor-preview th),\n.thinking-bar--corner .thinking-bar-step-answer :deep(.md-editor-preview td) {\n font-size: 13px;\n line-height: 1.55;\n}\n\n.thinking-bar-step-markdown :deep(.md-editor-preview h1),\n.thinking-bar-step-markdown :deep(.md-editor-preview h2),\n.thinking-bar-step-markdown :deep(.md-editor-preview h3),\n.thinking-bar-step-markdown :deep(.md-editor-preview h4),\n.thinking-bar-step-markdown :deep(.md-editor-preview h5),\n.thinking-bar-step-markdown :deep(.md-editor-preview h6) {\n margin: 8px 0 4px;\n color: #e2e8f0;\n}\n\n.thinking-bar-step-markdown :deep(.md-editor-preview p),\n.thinking-bar-step-markdown :deep(.md-editor-preview ul),\n.thinking-bar-step-markdown :deep(.md-editor-preview ol),\n.thinking-bar-step-markdown :deep(.md-editor-preview hr),\n.thinking-bar-step-markdown :deep(.md-editor-preview table) {\n margin: 4px 0;\n}\n\n.thinking-bar-step-markdown :deep(.md-editor-preview strong) {\n color: #f8fafc;\n}\n\n.thinking-bar-step-markdown :deep(.md-editor-preview code) {\n font-size: 12px;\n}\n\n.thinking-bar-step-markdown :deep(.md-editor-preview table) {\n display: block;\n overflow: auto;\n border-radius: 12px;\n -ms-overflow-style: none;\n scrollbar-width: none;\n}\n\n.thinking-bar-step-markdown :deep(.md-editor-preview table)::-webkit-scrollbar {\n display: none;\n width: 0;\n height: 0;\n}\n\n.thinking-bar-step-markdown :deep(.md-editor-preview thead th) {\n position: sticky;\n top: 0;\n z-index: 1;\n}\n\n.thinking-bar-chat-items {\n display: flex;\n flex-direction: column;\n gap: 6px;\n margin-top: 4px;\n}\n\n.thinking-bar-chat-item {\n min-width: 0;\n}\n\n.thinking-bar-tool-call {\n border: 1px solid rgba(114, 169, 176, 0.16);\n border-radius: 6px;\n background: rgba(2, 6, 23, 0.52);\n overflow: hidden;\n}\n\n.thinking-bar-tool-call-head {\n display: flex;\n align-items: flex-start;\n justify-content: space-between;\n gap: 12px;\n padding: 12px;\n cursor: pointer;\n list-style: none;\n}\n\n.thinking-bar-tool-call-head::-webkit-details-marker {\n display: none;\n}\n\n.thinking-bar-tool-call-head-main,\n.thinking-bar-tool-call-head-side {\n display: flex;\n align-items: flex-start;\n gap: 10px;\n min-width: 0;\n}\n\n.thinking-bar-tool-call-head-main {\n flex: 1;\n display: flex;\n flex-direction: column;\n gap: 0;\n min-width: 0;\n}\n\n.thinking-bar-tool-call-head-side {\n flex-shrink: 0;\n}\n\n.thinking-bar-tool-call-caret {\n color: #94a3b8;\n font-size: 12px;\n transition: transform 0.18s ease;\n}\n\n.thinking-bar-tool-call[open] .thinking-bar-tool-call-caret {\n transform: rotate(180deg);\n}\n\n.thinking-bar-tool-call-body {\n padding: 12px;\n display: grid;\n gap: var(--thinking-detail-gap);\n min-width: 0;\n max-height: min(42vh, 420px);\n overflow-y: auto;\n border-top: 1px solid rgba(114, 169, 176, 0.12);\n}\n\n.thinking-bar-tool-call-name {\n color: #e2e8f0;\n font-size: 14px;\n font-weight: 600;\n overflow-wrap: anywhere;\n word-break: break-word;\n}\n\n.thinking-bar-tool-call-status {\n flex-shrink: 0;\n padding: 3px 9px;\n border-radius: 999px;\n background: rgba(148, 163, 184, 0.16);\n color: #cbd5e1;\n font-size: 11px;\n font-weight: 600;\n}\n\n.thinking-bar-tool-call-status.is-running {\n background: rgba(56, 189, 248, 0.16);\n color: #7dd3fc;\n}\n\n.thinking-bar-tool-call-status.is-done {\n background: rgba(52, 211, 153, 0.16);\n color: #6ee7b7;\n}\n\n.thinking-bar-tool-call-status.is-error {\n background: rgba(248, 113, 113, 0.16);\n color: #fca5a5;\n}\n\n.thinking-bar-tool-call-block {\n margin: 0;\n border-radius: 6px;\n border: 1px solid rgba(114, 169, 176, 0.1);\n background: rgba(15, 23, 42, 0.78);\n padding: 12px;\n min-width: 0;\n max-width: 100%;\n display: flex;\n flex-direction: column;\n gap: 8px;\n overflow: auto;\n color: #cbd5e1;\n font-size: 12px;\n line-height: 1.6;\n max-height: min(30vh, 300px);\n}\n\n.thinking-bar-tool-call-block + .thinking-bar-tool-call-block {\n margin-top: 0;\n}\n\n.thinking-bar-tool-call-block-title {\n margin: 0;\n color: #7dd3fc;\n font-size: 11px;\n font-weight: 700;\n letter-spacing: 0.03em;\n}\n\n.thinking-bar-tool-call-pre {\n margin: 0;\n color: #cbd5e1;\n font-size: 12px;\n line-height: 1.6;\n white-space: pre-wrap;\n overflow-wrap: anywhere;\n word-break: break-word;\n}\n\n.thinking-bar-tool-trace-list {\n margin: 0;\n padding-left: 18px;\n display: flex;\n flex-direction: column;\n gap: 6px;\n}\n\n.thinking-bar-tool-trace-item {\n color: #cbd5e1;\n line-height: 1.45;\n overflow-wrap: anywhere;\n word-break: break-word;\n}\n\n.thinking-bar-tool-result-image-shell {\n padding: 8px;\n border-radius: 10px;\n background: rgba(2, 6, 23, 0.6);\n}\n\n.thinking-bar-tool-result-image {\n display: block;\n width: 100%;\n max-height: 320px;\n object-fit: contain;\n border-radius: 10px;\n}\n\n.thinking-bar-tool-result-html {\n width: 100%;\n min-height: min(200px, 22vh);\n border: none;\n border-radius: 10px;\n background: #fff;\n}\n\n.thinking-bar-tool-result-table-wrap {\n overflow: auto;\n border-radius: 10px;\n border: 1px solid rgba(148, 163, 184, 0.12);\n}\n\n.thinking-bar-tool-result-table {\n width: 100%;\n border-collapse: collapse;\n font-size: 12px;\n line-height: 1.5;\n}\n\n.thinking-bar-tool-result-table th,\n.thinking-bar-tool-result-table td {\n padding: 8px 10px;\n text-align: left;\n vertical-align: top;\n border-bottom: 1px solid rgba(148, 163, 184, 0.12);\n white-space: pre-wrap;\n word-break: break-word;\n}\n\n.thinking-bar-tool-result-table th {\n position: sticky;\n top: 0;\n background: rgba(15, 23, 42, 0.96);\n color: #e2e8f0;\n font-weight: 700;\n}\n\n.thinking-bar-tool-result-table td {\n color: #cbd5e1;\n background: rgba(2, 6, 23, 0.48);\n}\n\n.thinking-bar-attachments {\n display: flex;\n flex-direction: column;\n gap: 10px;\n margin-top: 6px;\n}\n\n.thinking-bar-attachment {\n display: flex;\n flex-direction: column;\n gap: 10px;\n padding: 10px;\n border-radius: 12px;\n border: 1px solid rgba(56, 189, 248, 0.2);\n background: rgba(15, 23, 42, 0.68);\n color: inherit;\n text-decoration: none;\n}\n\n.thinking-bar-attachment:hover {\n border-color: rgba(56, 189, 248, 0.42);\n}\n\n.thinking-bar-attachment-image {\n width: 100%;\n max-height: 240px;\n object-fit: contain;\n border-radius: 10px;\n background: rgba(2, 6, 23, 0.72);\n}\n\n.thinking-bar-attachment-meta {\n display: flex;\n align-items: center;\n justify-content: space-between;\n gap: 12px;\n}\n\n.thinking-bar-attachment-name {\n color: #e2e8f0;\n font-size: 13px;\n font-weight: 600;\n word-break: break-word;\n}\n\n.thinking-bar-attachment-type {\n color: #38bdf8;\n font-size: 12px;\n flex-shrink: 0;\n}\n\n.thinking-bar-workspace {\n display: flex;\n flex-direction: column;\n gap: 10px;\n margin-top: 8px;\n}\n\n.thinking-bar-workspace-title {\n color: #cbd5e1;\n font-size: 13px;\n font-weight: 700;\n}\n\n.thinking-bar-workspace-shell {\n display: grid;\n grid-template-columns: minmax(210px, 240px) minmax(0, 1fr);\n gap: 10px;\n min-height: 0;\n}\n\n.thinking-bar-file-tree-pane {\n border: 1px solid rgba(148, 163, 184, 0.16);\n border-radius: 14px;\n background: rgba(2, 6, 23, 0.46);\n overflow: hidden;\n}\n\n.thinking-bar-file-tree-head {\n padding: 10px 12px;\n border-bottom: 1px solid rgba(148, 163, 184, 0.12);\n color: #cbd5e1;\n font-size: 12px;\n font-weight: 700;\n}\n\n.thinking-bar-file-tree-body {\n max-height: min(200px, 100%);\n overflow: auto;\n padding: 8px 0;\n}\n\n.thinking-bar-tree-node {\n display: block;\n}\n\n.thinking-bar-tree-row {\n width: 100%;\n min-height: 34px;\n display: flex;\n align-items: center;\n gap: 6px;\n border: none;\n background: transparent;\n color: #cbd5e1;\n text-align: left;\n cursor: pointer;\n}\n\n.thinking-bar-tree-row:hover {\n background: rgba(30, 41, 59, 0.72);\n}\n\n.thinking-bar-tree-row--file.active {\n background: rgba(14, 116, 144, 0.22);\n color: #e0f2fe;\n}\n\n.thinking-bar-tree-row--directory {\n color: #dbeafe;\n}\n\n.thinking-bar-tree-caret {\n width: 12px;\n color: #94a3b8;\n font-size: 11px;\n flex-shrink: 0;\n}\n\n.thinking-bar-tree-icon {\n width: 18px;\n text-align: center;\n flex-shrink: 0;\n}\n\n.thinking-bar-tree-label {\n min-width: 0;\n font-size: 12px;\n line-height: 1.5;\n word-break: break-word;\n}\n\n.thinking-bar-file-preview {\n min-width: 0;\n border: 1px solid rgba(148, 163, 184, 0.16);\n border-radius: 14px;\n background: rgba(2, 6, 23, 0.58);\n overflow: hidden;\n min-height: 0;\n display: flex;\n flex-direction: column;\n}\n\n.thinking-bar-file-preview-head {\n padding: 10px 12px;\n border-bottom: 1px solid rgba(148, 163, 184, 0.12);\n color: #cbd5e1;\n font-size: 12px;\n font-weight: 600;\n word-break: break-word;\n display: flex;\n align-items: center;\n justify-content: space-between;\n gap: 12px;\n}\n\n.thinking-bar-file-preview-title {\n min-width: 0;\n display: flex;\n align-items: center;\n gap: 8px;\n}\n\n.thinking-bar-preview-chip {\n padding: 2px 8px;\n border-radius: 999px;\n background: rgba(56, 189, 248, 0.16);\n color: #7dd3fc;\n font-size: 11px;\n font-weight: 700;\n flex-shrink: 0;\n}\n\n.thinking-bar-file-preview-body {\n margin: 0;\n padding: 12px;\n flex: 1;\n overflow: auto;\n color: #cbd5e1;\n font-size: 12px;\n line-height: 1.65;\n white-space: pre-wrap;\n word-break: break-word;\n}\n\n.thinking-bar-image-shell {\n flex: 1;\n display: flex;\n align-items: center;\n justify-content: center;\n padding: 12px;\n background: rgba(2, 6, 23, 0.72);\n}\n\n.thinking-bar-image-preview {\n max-width: 100%;\n max-height: 320px;\n object-fit: contain;\n border-radius: 12px;\n}\n\n.thinking-bar-html-preview {\n flex: 1;\n min-height: min(200px, 28vh);\n border: none;\n background: #fff;\n}\n\n.thinking-bar-empty-preview {\n padding: 18px;\n color: #94a3b8;\n font-size: 13px;\n line-height: 1.7;\n}\n\n.thinking-bar-step.pending .thinking-bar-step-label {\n color: #64748b;\n}\n\n.thinking-bar--corner .thinking-bar-header {\n padding: 14px 16px 12px;\n}\n\n.thinking-bar--corner .thinking-bar-title {\n font-size: 16px;\n}\n\n.thinking-bar--corner .thinking-bar-steps {\n padding: 12px 14px 14px;\n flex: 1;\n min-height: 0;\n gap: 8px;\n}\n\n.thinking-bar--corner .thinking-bar-step {\n padding: 10px 12px;\n}\n\n.thinking-bar--corner .thinking-bar-step-inner {\n gap: 8px;\n}\n\n.thinking-bar--corner .thinking-bar-step-icon {\n width: 18px;\n font-size: 14px;\n}\n\n.thinking-bar--corner .thinking-bar-step-label {\n font-size: 14px;\n line-height: 1.4;\n word-break: break-word;\n}\n\n.thinking-bar--corner .thinking-bar-step-text,\n.thinking-bar--corner .thinking-bar-step-markdown :deep(.md-editor-preview) {\n font-size: 13px;\n line-height: 1.55;\n overflow-wrap: anywhere;\n}\n\n.thinking-bar--corner .thinking-bar-tool-call-body {\n max-height: min(38vh, 300px);\n overflow-y: auto;\n}\n\n.thinking-bar--corner .thinking-bar-tool-call-block {\n max-height: min(24vh, 180px);\n overflow: auto;\n}\n\n.thinking-bar {\n width: min(980px, calc(100vw - 56px));\n border-radius: 8px;\n border: 1px solid rgba(96, 142, 154, 0.3);\n background:\n radial-gradient(\n circle at 18% 0%,\n rgba(45, 111, 132, 0.16),\n transparent 30%\n ),\n linear-gradient(135deg, rgba(8, 30, 45, 0.96), rgba(3, 15, 28, 0.94));\n box-shadow:\n 0 30px 90px rgba(0, 0, 0, 0.5),\n 0 0 0 1px rgba(255, 255, 255, 0.035);\n isolation: isolate;\n}\n\n.thinking-bar-grid {\n position: absolute;\n inset: 0;\n z-index: 0;\n pointer-events: none;\n background-image:\n repeating-linear-gradient(\n 175deg,\n transparent 0,\n transparent 34px,\n rgba(96, 165, 168, 0.04) 35px,\n transparent 38px\n ),\n linear-gradient(rgba(125, 157, 169, 0.03) 1px, transparent 1px),\n linear-gradient(90deg, rgba(125, 157, 169, 0.03) 1px, transparent 1px);\n background-size: 48px 48px;\n mask-image: linear-gradient(180deg, black 0, transparent 82%);\n}\n\n.thinking-bar-header,\n.thinking-bar-steps {\n position: relative;\n z-index: 1;\n}\n\n.thinking-bar-header {\n padding: 18px 20px;\n border-bottom-color: rgba(96, 142, 154, 0.24);\n background: linear-gradient(\n 90deg,\n rgba(13, 48, 64, 0.42),\n rgba(4, 18, 31, 0)\n );\n}\n\n.thinking-bar-title-stack {\n display: grid;\n gap: 3px;\n min-width: 0;\n}\n\n.thinking-bar-kicker {\n color: #9bb8c2;\n font-size: 10px;\n font-weight: 800;\n letter-spacing: 0.18em;\n}\n\n.thinking-bar-title {\n color: #edf7f8;\n font-size: 20px;\n letter-spacing: 0;\n}\n\n.thinking-bar-metrics {\n display: flex;\n align-items: center;\n gap: 8px;\n margin-left: auto;\n}\n\n.thinking-bar-metric {\n display: grid;\n min-width: 58px;\n padding: 7px 9px;\n border: 1px solid rgba(114, 169, 176, 0.2);\n border-radius: 4px;\n background: rgba(5, 22, 36, 0.64);\n text-align: center;\n}\n\n.thinking-bar-metric strong {\n color: #e8f3f4;\n font-size: 15px;\n line-height: 1.1;\n}\n\n.thinking-bar-metric em {\n color: rgba(190, 214, 218, 0.62);\n font-size: 10px;\n font-style: normal;\n line-height: 1.2;\n}\n\n.thinking-bar-close {\n flex-shrink: 0;\n margin-left: 8px;\n border-radius: 4px;\n border: 1px solid rgba(114, 169, 176, 0.18);\n background: rgba(15, 23, 42, 0.52);\n}\n\n.thinking-bar-close:hover {\n background: rgba(74, 124, 142, 0.18);\n color: #edf7f8;\n}\n\n.thinking-bar-steps {\n gap: 12px;\n padding: 18px 20px 20px;\n}\n\n.thinking-bar-steps::before {\n content: \"\";\n position: sticky;\n top: 0;\n display: block;\n height: 1px;\n margin: -2px 0 2px;\n background: linear-gradient(\n 90deg,\n rgba(112, 172, 150, 0),\n rgba(112, 172, 150, 0.32),\n rgba(201, 162, 93, 0.22),\n rgba(112, 172, 150, 0)\n );\n z-index: 2;\n}\n\n.thinking-bar-step {\n border-radius: 6px;\n background:\n linear-gradient(90deg, rgba(13, 48, 64, 0.24), rgba(4, 18, 31, 0.56)),\n rgba(2, 6, 23, 0.58);\n border-color: rgba(114, 169, 176, 0.14);\n}\n\n.thinking-bar-step::before {\n background:\n linear-gradient(180deg, rgba(160, 190, 196, 0.045), transparent),\n repeating-linear-gradient(\n 90deg,\n transparent 0,\n transparent 18px,\n rgba(112, 172, 150, 0.035) 19px,\n transparent 22px\n );\n}\n\n.thinking-bar-step::after {\n content: \"\";\n position: absolute;\n left: 0;\n top: 10px;\n bottom: 10px;\n width: 3px;\n border-radius: 0 999px 999px 0;\n background: rgba(100, 116, 139, 0.55);\n}\n\n.thinking-bar-step.active::after {\n background: #c9a25d;\n box-shadow: none;\n}\n\n.thinking-bar-step.done::after {\n background: #70ac96;\n box-shadow: none;\n}\n\n.thinking-bar-step.error::after {\n background: #d08b8b;\n box-shadow: none;\n}\n\n.thinking-bar-step.active {\n --thinking-step-border-color: rgba(201, 162, 93, 0.38);\n --thinking-step-glow-color: transparent;\n border-color: rgba(201, 162, 93, 0.34);\n background:\n linear-gradient(90deg, rgba(92, 73, 39, 0.24), rgba(13, 48, 64, 0.18)),\n rgba(2, 6, 23, 0.62);\n box-shadow:\n inset 0 0 0 1px rgba(201, 162, 93, 0.06),\n 0 0 0 1px rgba(201, 162, 93, 0.08);\n}\n\n.thinking-bar-step.done {\n --thinking-step-border-color: rgba(112, 172, 150, 0.34);\n --thinking-step-glow-color: transparent;\n border-color: rgba(112, 172, 150, 0.28);\n background:\n linear-gradient(90deg, rgba(29, 71, 61, 0.2), rgba(13, 48, 64, 0.18)),\n rgba(2, 6, 23, 0.58);\n box-shadow:\n inset 0 0 0 1px rgba(112, 172, 150, 0.05),\n 0 0 0 1px rgba(112, 172, 150, 0.08);\n}\n\n.thinking-bar-step.error {\n --thinking-step-border-color: rgba(208, 139, 139, 0.34);\n --thinking-step-glow-color: transparent;\n border-color: rgba(208, 139, 139, 0.3);\n box-shadow:\n inset 0 0 0 1px rgba(208, 139, 139, 0.05),\n 0 0 0 1px rgba(208, 139, 139, 0.08);\n}\n\n.thinking-bar-step.active::before {\n background: linear-gradient(180deg, rgba(201, 162, 93, 0.08), transparent);\n}\n\n.thinking-bar-step-label,\n.thinking-bar-tool-call-name,\n.thinking-bar-workspace-title {\n color: #edf7f8;\n}\n\n.thinking-bar-step-body {\n max-height: min(46vh, 430px);\n}\n\n.thinking-bar-tool-call,\n.thinking-bar-attachment,\n.thinking-bar-file-tree-pane,\n.thinking-bar-file-preview {\n border-radius: 6px;\n border-color: rgba(114, 169, 176, 0.16);\n background: rgba(4, 18, 31, 0.66);\n}\n\n.thinking-bar-tool-call-head,\n.thinking-bar-file-tree-head,\n.thinking-bar-file-preview-head {\n background: rgba(13, 48, 64, 0.24);\n}\n\n.thinking-bar-tool-call-status {\n border-radius: 4px;\n border: 1px solid rgba(114, 169, 176, 0.14);\n}\n\n.thinking-bar-tool-call-block,\n.thinking-bar-file-preview-body {\n border: 1px solid rgba(114, 169, 176, 0.1);\n background: rgba(2, 13, 24, 0.72);\n}\n\n.thinking-bar-tool-result-table th {\n background: rgba(13, 48, 64, 0.96);\n}\n\n.thinking-bar-step.active .thinking-bar-step-icon {\n color: #c9a25d;\n text-shadow: none;\n animation: none;\n}\n\n.thinking-bar-step.done .thinking-bar-step-icon {\n color: #70ac96;\n}\n\n.thinking-bar-step.error .thinking-bar-step-icon {\n color: #d08b8b;\n}\n\n.thinking-bar-tool-call-status.is-running {\n background: rgba(201, 162, 93, 0.14);\n color: #c9a25d;\n}\n\n.thinking-bar-tool-call-status.is-done {\n background: rgba(112, 172, 150, 0.14);\n color: #8fc6b2;\n}\n\n.thinking-bar-tool-call-status.is-error {\n background: rgba(208, 139, 139, 0.14);\n color: #d08b8b;\n}\n\n.thinking-bar-attachment-type,\n.thinking-bar-preview-chip,\n.thinking-bar-tool-call-block-title {\n color: #b9ccd1;\n}\n\n.thinking-bar-preview-chip {\n background: rgba(74, 124, 142, 0.18);\n}\n\n.thinking-bar--corner {\n width: min(520px, calc(100vw - 28px));\n}\n\n.thinking-bar--corner .thinking-bar-metrics {\n display: none;\n}\n\n@media (max-width: 768px) {\n .thinking-bar--centered {\n width: calc(100vw - 24px);\n max-height: 72vh;\n }\n\n .thinking-bar--corner {\n right: 12px;\n bottom: 12px;\n width: min(360px, calc(100vw - 24px));\n max-height: min(72vh, calc(100vh - 24px));\n }\n\n .thinking-bar-header {\n padding: 16px 16px 14px;\n }\n\n .thinking-bar-steps {\n padding: 14px 16px 16px;\n }\n\n .thinking-bar-workspace-shell {\n grid-template-columns: 1fr;\n }\n\n .thinking-bar-header {\n align-items: flex-start;\n gap: 10px;\n }\n\n .thinking-bar-metrics {\n display: none;\n }\n}\n\n.thinking-bar-step-answer {\n margin: 0;\n}\n\n.thinking-bar-tool-step-flow {\n --thinking-detail-gap: 12px;\n display: flex;\n flex-direction: column;\n gap: var(--thinking-detail-gap);\n}\n\n.thinking-bar-step-answer-section {\n display: flex;\n flex-direction: column;\n gap: 8px;\n}\n\n.thinking-bar-step-section-label {\n color: #dbeafe;\n font-size: 13px;\n font-weight: 700;\n line-height: 1.4;\n}\n\n.thinking-bar-execution-details {\n margin: 0;\n border: 1px solid rgba(114, 169, 176, 0.18);\n border-radius: 6px;\n background: rgba(4, 18, 31, 0.52);\n overflow: hidden;\n}\n\n.thinking-bar-execution-details-summary {\n display: flex;\n align-items: center;\n gap: 10px;\n padding: 10px 12px;\n cursor: pointer;\n list-style: none;\n user-select: none;\n background: rgba(13, 48, 64, 0.28);\n}\n\n.thinking-bar-execution-details-summary::-webkit-details-marker {\n display: none;\n}\n\n.thinking-bar-execution-details-title {\n color: #dbeafe;\n font-size: 13px;\n font-weight: 700;\n}\n\n.thinking-bar-execution-details-meta {\n margin-left: auto;\n padding: 2px 8px;\n border-radius: 999px;\n border: 1px solid rgba(114, 169, 176, 0.16);\n background: rgba(2, 13, 24, 0.72);\n color: #9bb8c2;\n font-size: 11px;\n font-weight: 600;\n}\n\n.thinking-bar-execution-details-caret {\n color: #94a3b8;\n font-size: 12px;\n transition: transform 0.18s ease;\n}\n\n.thinking-bar-execution-details[open] .thinking-bar-execution-details-caret {\n transform: rotate(180deg);\n}\n\n.thinking-bar-execution-details-body {\n display: grid;\n gap: var(--thinking-detail-gap, 12px);\n padding: 12px;\n border-top: 1px solid rgba(114, 169, 176, 0.12);\n}\n\n.thinking-bar-execution-planning {\n margin: 0;\n padding: 10px 12px;\n border-radius: 6px;\n border: 1px solid rgba(114, 169, 176, 0.1);\n background: rgba(2, 13, 24, 0.72);\n color: #b9ccd1;\n font-size: 12px;\n line-height: 1.6;\n white-space: pre-wrap;\n overflow-wrap: anywhere;\n}\n\n.thinking-bar-tool-call-id {\n display: block;\n margin-top: 6px;\n color: #64748b;\n font-size: 11px;\n font-weight: 500;\n line-height: 1.45;\n overflow-wrap: anywhere;\n}\n\n.thinking-bar-tool-call-block--error {\n border-color: rgba(208, 139, 139, 0.24);\n}\n\n.thinking-bar-tool-call-block--error .thinking-bar-tool-call-block-title {\n color: #d08b8b;\n}\n\n.thinking-bar-nested-tools {\n display: grid;\n gap: var(--thinking-detail-gap, 12px);\n padding-top: 4px;\n}\n\n.thinking-bar-nested-tools-label {\n color: #9bb8c2;\n font-size: 11px;\n font-weight: 700;\n letter-spacing: 0.04em;\n}\n\n.thinking-bar-tool-call--nested {\n border-style: dashed;\n background: rgba(2, 13, 24, 0.42);\n}\n\n@keyframes thinking-pulse {\n 50% {\n opacity: 0.6;\n }\n}\n</style>\n"],"names":["isOpen","ref","stepsContainerRef","stepStickToBottom","stepBodyEls","scrollTimer","bodyResizeObserver","scheduleScrollAfterLayout","force","scrollToBottom","setStepBodyRef","stepId","el","prev","html","isStepBodyNearBottom","handleStepBodyScroll","event","scrollTargetStepIds","active","props","s","last","shouldFollowStepBody","onMounted","nextTick","onBeforeUnmount","__props","titleText","computed","isThinkingActive","step","toolCall","activeStepCount","doneStepCount","stepIcon","status","getToolId","getToolTitle","getToolStepPlanning","splitToolStepContent","getToolStepAnswer","planning","cleaned","stripInternalEvidenceAnswer","sanitizeToolStepAnswerText","text","trimmed","collectRawToolCalls","item","getStepToolCalls","partitionToolCalls","getNestedKnowledgeToolCalls","isKnowledgeAnswerTool","normalizeToolName","TOOL_NAMES","name","hasExecutionDetails","executionDetailsMeta","toolCount","toolStatusLabel","formatToolTrace","trace","isToolCallOpen","parseStructuredText","value","getToolResultDisplay","toolId","raw","parsed","getParsedToolResult","isPlainObject","looksLikeInlineHtml","getToolResultImage","candidate","getToolResultHtml","normalizeRows","getToolResultTable","directRows","columns","row","column","rows","index","nestedRows","hasStructuredToolResult","display","summary","formatTableCell","stepsContainer","ids","id","retryContainer","watch","selectedFileByStep","expandedDirectoriesByStep","steps","next","nextExpanded","expanded","file","collectDirectoryPaths","path","selectFile","fileId","selectTreeFile","getSelectedFile","selectedId","normalized","directories","current","segment","isDirectoryExpanded","toggleDirectory","getVisibleFileTree","files","ensureDirectory","depth","root","currentPath","parent","directory","nodes","walk","directoryPath","sortedDirectories","a","b","childPath","child","getFileContent","isImageFile","isHtmlFile","getFileDataUrl","content","getFileIcon","_createElementBlock","_createElementVNode","_hoisted_1","_hoisted_2","_cache","_hoisted_3","_toDisplayString","_hoisted_4","_hoisted_5","_hoisted_6","_hoisted_7","$emit","_Fragment","_renderList","_normalizeClass","_createBlock","OfficialBorderBeam","_hoisted_8","_hoisted_9","_hoisted_10","_hoisted_11","$event","_unref","isToolExecutionStep","_openBlock","_hoisted_13","_hoisted_14","_hoisted_15","_hoisted_16","_hoisted_17","_hoisted_18","_hoisted_20","_hoisted_21","_hoisted_22","_hoisted_23","_hoisted_24","_hoisted_25","_hoisted_26","_hoisted_27","_hoisted_28","_hoisted_29","_hoisted_30","_hoisted_31","_hoisted_34","_hoisted_35","rowIndex","_hoisted_36","_hoisted_37","_hoisted_38","_hoisted_39","_hoisted_40","_hoisted_41","nested","_hoisted_42","_hoisted_43","_hoisted_44","_hoisted_45","_hoisted_46","_hoisted_47","_hoisted_48","_hoisted_49","_hoisted_50","_hoisted_51","_hoisted_52","_createVNode","SpotlightMarkdownPreview","_hoisted_53","_hoisted_54","MdPreview","humanizeSpotlightStepContent","_hoisted_56","_hoisted_57","_hoisted_58","_hoisted_59","_hoisted_60","_hoisted_61","_hoisted_62","_hoisted_65","_hoisted_66","_hoisted_67","_hoisted_68","getIntentStepDisplayContent","_hoisted_69","attachment","_hoisted_72","_hoisted_73","_hoisted_74","_hoisted_75","_hoisted_76","_hoisted_77","_hoisted_78","node","_hoisted_79","_normalizeStyle","_hoisted_81","_hoisted_82","_hoisted_84","_hoisted_85","_hoisted_86","_hoisted_87","_hoisted_88","_hoisted_89","_hoisted_90","_hoisted_91","_hoisted_93","_hoisted_95","_hoisted_96"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAqqBA,UAAMA,IAASC,EAAI,EAAK,GAClBC,IAAoBD,EAAwB,IAAI,GAEhDE,IAAoBF,EAA6B,EAAE,GACnDG,wBAAkB,IAAA;AACxB,QAAIC,IAA6B,MAC7BC,IAA4C;AAEhD,aAASC,EAA0BC,GAAgB;AACjD,MAAKC,EAAeD,CAAK,GACzB,sBAAsB,MAAM;AAC1B,QAAKC,EAAeD,CAAK;AAAA,MAC3B,CAAC;AAAA,IACH;AAEA,aAASE,GAAeC,GAAgBC,GAAa;AACnD,YAAMC,IAAOT,EAAY,IAAIO,CAAM;AACnC,MAAIE,KAAQP,KACVA,EAAmB,UAAUO,CAAI;AAEnC,YAAMC,IAAOF,aAAc,cAAcA,IAAK;AAC9C,MAAIE,KACFV,EAAY,IAAIO,GAAQG,CAAI,GAC5BR,GAAoB,QAAQQ,CAAI,KAEhCV,EAAY,OAAOO,CA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sources":["../../src/composables/useSpotlightCommandShortcuts.ts"],"sourcesContent":["import { onMounted, onUnmounted, type Ref } from \"vue\";\n\nexport type SpotlightCommandShortcutsOptions = {\n visible: Ref<boolean>;\n showThinkingBar: Ref<boolean>;\n open: () => void;\n close: () => void;\n closeThinking: () => void;\n onEscape?: () => void;\n onKeydown?: (event: KeyboardEvent) => void;\n onKeyup?: (event: KeyboardEvent) => void;\n};\n\nexport function useSpotlightCommandShortcuts(\n options: SpotlightCommandShortcutsOptions,\n) {\n function handleKeydown(event: KeyboardEvent) {\n options.onKeydown?.(event);\n if (event.defaultPrevented) return;\n\n const key = event.key.toLowerCase();\n const isMeta = event.metaKey || event.ctrlKey;\n\n if (isMeta && key === \"k\") {\n event.preventDefault();\n if (options.visible.value) {\n options.close();\n } else {\n options.open();\n }\n return;\n }\n\n if (key === \"escape\") {\n event.preventDefault();\n if (options.onEscape) {\n options.onEscape();\n return;\n }\n if (options.showThinkingBar.value) {\n options.closeThinking();\n } else if (options.visible.value) {\n options.close();\n }\n }\n }\n\n function handleKeyup(event: KeyboardEvent) {\n options.onKeyup?.(event);\n }\n\n onMounted(() => {\n window.addEventListener(\"keydown\", handleKeydown, true);\n window.addEventListener(\"keyup\", handleKeyup, true);\n });\n\n onUnmounted(() => {\n window.removeEventListener(\"keydown\", handleKeydown, true);\n window.removeEventListener(\"keyup\", handleKeyup, true);\n });\n}\n"],"names":["useSpotlightCommandShortcuts","options","handleKeydown","event","key","handleKeyup","onMounted","onUnmounted"],"mappings":";AAaO,SAASA,EACdC,GACA;AACA,WAASC,EAAcC,GAAsB;AAE3C,QADAF,EAAQ,YAAYE,CAAK,GACrBA,EAAM,iBAAkB;AAE5B,UAAMC,IAAMD,EAAM,IAAI,YAAA;AAGtB,SAFeA,EAAM,WAAWA,EAAM,YAExBC,MAAQ,KAAK;AACzB,MAAAD,EAAM,eAAA,GACFF,EAAQ,QAAQ,QAClBA,EAAQ,MAAA,IAERA,EAAQ,KAAA;AAEV;AAAA,IACF;AAEA,QAAIG,MAAQ,UAAU;AAEpB,UADAD,EAAM,eAAA,GACFF,EAAQ,UAAU;AACpB,QAAAA,EAAQ,SAAA;AACR;AAAA,MACF;AACA,MAAIA,EAAQ,gBAAgB,QAC1BA,EAAQ,cAAA,IACCA,EAAQ,QAAQ,SACzBA,EAAQ,MAAA;AAAA,IAEZ;AAAA,EACF;AAEA,WAASI,EAAYF,GAAsB;AACzC,IAAAF,EAAQ,UAAUE,CAAK;AAAA,EACzB;AAEA,EAAAG,EAAU,MAAM;AACd,WAAO,iBAAiB,WAAWJ,GAAe,EAAI,GACtD,OAAO,iBAAiB,SAASG,GAAa,EAAI;AAAA,EACpD,CAAC,GAEDE,EAAY,MAAM;AAChB,WAAO,oBAAoB,WAAWL,GAAe,EAAI,GACzD,OAAO,oBAAoB,SAASG,GAAa,EAAI;AAAA,EACvD,CAAC;AACH;"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"useSpotlightPanelUi.js","sources":["../../src/composables/useSpotlightPanelUi.ts"],"sourcesContent":["import { computed, type Ref } from \"vue\";\n\nexport type SpotlightPanelUiState = \"idle\" | \"running\" | \"done\" | \"error\";\n\nexport type UseSpotlightPanelUiOptions = {\n pipelinePhase: Ref<string>;\n loading: Ref<boolean>;\n voiceHoldActive?: Ref<boolean>;\n speechPending?: Ref<boolean>;\n voiceKeyLabel?: string;\n};\n\nexport function useSpotlightPanelUi(options: UseSpotlightPanelUiOptions) {\n const voiceKeyLabel = options.voiceKeyLabel ?? \"`\";\n\n const uiState = computed<SpotlightPanelUiState>(() => {\n if (options.pipelinePhase.value === \"error\") return \"error\";\n if (options.loading.value || options.pipelinePhase.value === \"running\") {\n return \"running\";\n }\n if (options.pipelinePhase.value === \"done\") return \"done\";\n return \"idle\";\n });\n\n const placeholder = computed(() => {\n if (options.voiceHoldActive?.value) {\n return `正在录音,松开 ${voiceKeyLabel} 结束并转写…`;\n }\n if (options.speechPending?.value) {\n return \"语音识别中,请稍候…\";\n }\n if (uiState.value === \"running\") {\n return \"Agent 正在分析场景、路由工具和上下文…\";\n }\n if (uiState.value === \"done\") {\n return \"继续追问,或者换个角度继续盘它…\";\n }\n if (uiState.value === \"error\") {\n return \"刚才那轮跑岔了,换个问法再试试…\";\n }\n return \"输入问题或从下方选择历史…\";\n });\n\n const badgeLabel = computed(() => {\n if (options.voiceHoldActive?.value) return \"语音录制中\";\n if (options.speechPending?.value) return \"语音识别中\";\n if (uiState.value === \"running\") return \"Agent 执行中\";\n if (uiState.value === \"done\") return \"已完成\";\n if (uiState.value === \"error\") return \"执行异常\";\n return \"等待提问\";\n });\n\n return { uiState, placeholder, badgeLabel };\n}\n"],"names":["useSpotlightPanelUi","options","voiceKeyLabel","uiState","computed","placeholder","badgeLabel"],"mappings":";AAYO,SAASA,EAAoBC,GAAqC;AACvE,QAAMC,IAAgBD,EAAQ,iBAAiB,KAEzCE,IAAUC,EAAgC,MAC1CH,EAAQ,cAAc,UAAU,UAAgB,UAChDA,EAAQ,QAAQ,SAASA,EAAQ,cAAc,UAAU,YACpD,YAELA,EAAQ,cAAc,UAAU,SAAe,SAC5C,MACR,GAEKI,IAAcD,EAAS,MACvBH,EAAQ,iBAAiB,QACpB,WAAWC,CAAa,YAE7BD,EAAQ,eAAe,QAClB,eAELE,EAAQ,UAAU,YACb,2BAELA,EAAQ,UAAU,SACb,qBAELA,EAAQ,UAAU,UACb,qBAEF,eACR,GAEKG,IAAaF,EAAS,MACtBH,EAAQ,iBAAiB,QAAc,UACvCA,EAAQ,eAAe,QAAc,UACrCE,EAAQ,UAAU,YAAkB,cACpCA,EAAQ,UAAU,SAAe,QACjCA,EAAQ,UAAU,UAAgB,SAC/B,MACR;AAED,SAAO,EAAE,SAAAA,GAAS,aAAAE,GAAa,YAAAC,EAAA;AACjC;"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"config.js","sources":["../src/config.ts"],"sourcesContent":["import type {\n AgentUiContext,\n SpotlightCommandCatalog,\n SpotlightCommandCatalogVideoChannel,\n SpotlightSkill,\n} from \"@inupedia/spotlight-protocol\";\nimport type {\n SessionHostToolHandler,\n SpotlightClientConfig,\n SpotlightHostTool,\n} from \"@inupedia/spotlight-client\";\nimport type { RemoteHostToolCall } from \"@inupedia/spotlight-protocol\";\nimport type { HandlerApi } from \"./store/pipeline/types.js\";\nimport type { SpotlightUiPrompts } from \"./remote/meta.js\";\nimport type { ToolResult } from \"./types/toolResult.js\";\nimport type { SpotlightConfigInput } from \"./resolveConfig.js\";\nimport { resolveSpotlightConfig } from \"./resolveConfig.js\";\n\nexport type { SpotlightConfigInput } from \"./resolveConfig.js\";\n\nexport type SpotlightHostServicesRegistration = Partial<\n Pick<\n SpotlightConfig,\n | \"tools\"\n | \"getUiContext\"\n | \"catalogOverlay\"\n | \"videoChannels\"\n | \"onVideoChannelsLoaded\"\n | \"uiPromptsFallback\"\n | \"runSessionHostTool\"\n | \"runHostTool\"\n | \"quickPanelActions\"\n | \"getSuggestedQuestions\"\n >\n>;\n\nexport type SpotlightConfig = SpotlightClientConfig & {\n /** Host-side tools the server may invoke via SSE bridge. */\n tools: SpotlightHostTool[] | (() => SpotlightHostTool[]);\n /** Skills sent on each create-run (metadata only; bodies loaded server-side). */\n skills?: SpotlightSkill[] | (() => SpotlightSkill[]);\n /** Preferred: host resolves bundled + inline skills per run. */\n getSkillsForRun?: () => SpotlightSkill[];\n /** Optional dynamic catalog overlay (e.g. live video channels). */\n catalogOverlay?: () => SpotlightCommandCatalog | null | undefined;\n /** Optional static video channel metadata for catalog merge / meta fallback. */\n videoChannels?: SpotlightCommandCatalogVideoChannel[];\n /** Called when video channel meta is loaded from server or fallback. */\n onVideoChannelsLoaded?: (\n channels: SpotlightCommandCatalogVideoChannel[],\n ) => void;\n /** Bundled ui-prompts when server meta is unavailable. */\n uiPromptsFallback?: SpotlightUiPrompts;\n /** Per-run UI context reported to server. */\n getUiContext?: () => AgentUiContext;\n /** Host handler for session.* tools (e.g. repeatLastAnswer). */\n runSessionHostTool?: (\n call: RemoteHostToolCall,\n api: HandlerApi,\n ) => Promise<Awaited<ReturnType<SessionHostToolHandler>>>;\n /** Host-side tool runner for domain workflows (e.g. operate). */\n runHostTool?: (\n name: string,\n input: Record<string, unknown>,\n ) => Promise<ToolResult<unknown>>;\n /** Optional legacy quick actions wired into handler API. */\n quickPanelActions?: SpotlightQuickPanelActions;\n /** Override suggested question chips (defaults use server ui-prompts). */\n getSuggestedQuestions?: (params: {\n sceneLevel: number | null | undefined;\n smallTab?: string | null;\n activeTarget?: string | null;\n }) => string[];\n /** Host operate domain executor (usually from defineSpotlightHost). */\n executeOperateWorkflow?: (\n ctx: import(\"./store/pipeline/types.js\").SpotlightContext,\n api: HandlerApi,\n ) => Promise<void>;\n};\n\nexport type SpotlightQuickPanelActions = {\n triggerProgressAction?: () => Promise<ToolResult<void>>;\n triggerSimulationProgressAction?: () => Promise<ToolResult<void>>;\n};\n\n/** Validate and normalize host config (supports `services` / `skills` registration). */\nexport function defineSpotlightConfig(\n input: SpotlightConfigInput | SpotlightConfig,\n): SpotlightConfig {\n const config =\n \"host\" in input ||\n \"services\" in input ||\n \"skills\" in input\n ? resolveSpotlightConfig(input as SpotlightConfigInput)\n : (input as SpotlightConfig);\n if (!config.projectId?.trim()) {\n throw new Error(\"Spotlight config: projectId is required\");\n }\n if (!config.serverUrl?.trim()) {\n throw new Error(\"Spotlight config: serverUrl is required\");\n }\n if (!config.tools) {\n throw new Error(\"Spotlight config: tools are required (via services or tools)\");\n }\n if (typeof config.tools !== \"function\") {\n const tools = config.tools;\n if (!Array.isArray(tools) || tools.length === 0) {\n throw new Error(\"Spotlight config: at least one host tool is required\");\n }\n }\n return config;\n}\n\nexport const SPOTLIGHT_CONFIG_KEY = Symbol(\"spotlight-config\");\n\nimport type { SpotlightAvatarConfig } from \"./avatar/config.js\";\n\nexport type SpotlightVuePluginOptions = {\n config: SpotlightConfigInput | SpotlightConfig;\n /** Mount command panel + thinking UI (default: true). */\n enabled?: boolean;\n /** Enable digital-human overlay, ⌘/Ctrl+L, and answer TTS (default: false). */\n avatarEnabled?: boolean;\n /** Avatar copy + Spine asset paths (when avatarEnabled). */\n avatar?: SpotlightAvatarConfig;\n};\n"],"names":["defineSpotlightConfig","input","config","resolveSpotlightConfig","tools","SPOTLIGHT_CONFIG_KEY"],"mappings":";AAsFO,SAASA,EACdC,GACiB;AACjB,QAAMC,IACJ,UAAUD,KACV,cAAcA,KACd,YAAYA,IACRE,EAAuBF,CAA6B,IACnDA;AACP,MAAI,CAACC,EAAO,WAAW;AACrB,UAAM,IAAI,MAAM,yCAAyC;AAE3D,MAAI,CAACA,EAAO,WAAW;AACrB,UAAM,IAAI,MAAM,yCAAyC;AAE3D,MAAI,CAACA,EAAO;AACV,UAAM,IAAI,MAAM,8DAA8D;AAEhF,MAAI,OAAOA,EAAO,SAAU,YAAY;AACtC,UAAME,IAAQF,EAAO;AACrB,QAAI,CAAC,MAAM,QAAQE,CAAK,KAAKA,EAAM,WAAW;AAC5C,YAAM,IAAI,MAAM,sDAAsD;AAAA,EAE1E;AACA,SAAOF;AACT;AAEO,MAAMG,2BAA8B,kBAAkB;"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"toolNames.js","sources":["../../src/constants/toolNames.ts"],"sourcesContent":["export const TOOL_NAMES = {\n skill: {\n invoke: \"skill.invoke\",\n },\n knowledge: {\n answer: \"knowledge.answer\",\n },\n session: {\n repeatLastAnswer: \"session.repeatLastAnswer\",\n },\n} as const;\n"],"names":["TOOL_NAMES"],"mappings":"AAAO,MAAMA,IAAa;AAAA,EACxB,OAAO;AAAA,IACL,QAAQ;AAAA,EAAA;AAAA,EAEV,WAAW;AAAA,IACT,QAAQ;AAAA,EAAA;AAAA,EAEV,SAAS;AAAA,IACP,kBAAkB;AAAA,EAAA;AAEtB;"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"defineApp.js","sources":["../../src/host/defineApp.ts"],"sourcesContent":["import { defineSpotlightConfig, type SpotlightConfig } from \"../config.js\";\nimport { defineSpotlightHost, type DefineSpotlightHostOptions } from \"./defineHost.js\";\n\nexport type SpotlightEnvDefaults = {\n serverUrl?: string;\n projectId?: string;\n};\n\n/** Read standard Vite env vars for Spotlight server connection. */\nexport function readSpotlightEnv(\n env: Record<string, string | undefined>,\n defaults: SpotlightEnvDefaults = {},\n): Pick<DefineSpotlightAppOptions, \"serverUrl\" | \"projectId\" | \"apiKey\"> {\n return {\n serverUrl: String(\n env.VITE_SPOTLIGHT_SERVER_URL ?? defaults.serverUrl ?? \"/spotlight-api\",\n ),\n apiKey: String(env.VITE_SPOTLIGHT_API_KEY ?? \"\").trim() || undefined,\n projectId: String(\n env.VITE_SPOTLIGHT_PROJECT_ID ?? defaults.projectId ?? \"\",\n ).trim(),\n };\n}\n\nexport type DefineSpotlightAppOptions = DefineSpotlightHostOptions & {\n serverUrl: string;\n projectId: string;\n apiKey?: string;\n};\n\n/** Single entry: server config + host registration in one call. */\nexport function defineSpotlightApp(\n options: DefineSpotlightAppOptions,\n): SpotlightConfig {\n const { serverUrl, projectId, apiKey, ...hostOptions } = options;\n return defineSpotlightConfig({\n serverUrl,\n projectId,\n apiKey,\n host: defineSpotlightHost(hostOptions),\n });\n}\n"],"names":["readSpotlightEnv","env","defaults","defineSpotlightApp","options","serverUrl","projectId","apiKey","hostOptions","defineSpotlightConfig","defineSpotlightHost"],"mappings":";;AASO,SAASA,EACdC,GACAC,IAAiC,IACsC;AACvE,SAAO;AAAA,IACL,WAAW;AAAA,MACTD,EAAI,6BAA6BC,EAAS,aAAa;AAAA,IAAA;AAAA,IAEzD,QAAQ,OAAOD,EAAI,0BAA0B,EAAE,EAAE,UAAU;AAAA,IAC3D,WAAW;AAAA,MACTA,EAAI,6BAA6BC,EAAS,aAAa;AAAA,IAAA,EACvD,KAAA;AAAA,EAAK;AAEX;AASO,SAASC,EACdC,GACiB;AACjB,QAAM,EAAE,WAAAC,GAAW,WAAAC,GAAW,QAAAC,GAAQ,GAAGC,MAAgBJ;AACzD,SAAOK,EAAsB;AAAA,IAC3B,WAAAJ;AAAA,IACA,WAAAC;AAAA,IACA,QAAAC;AAAA,IACA,MAAMG,EAAoBF,CAAW;AAAA,EAAA,CACtC;AACH;"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"defineHost.js","sources":["../../src/host/defineHost.ts"],"sourcesContent":["import { defineToolsFromAgentRegistry } from \"@inupedia/spotlight-client\";\nimport type { AgentRegistryBridgeDeps } from \"@inupedia/spotlight-client\";\nimport type {\n AgentUiContext,\n SpotlightCommandCatalog,\n SpotlightCommandCatalogVideoChannel,\n SpotlightSkill,\n} from \"@inupedia/spotlight-protocol\";\nimport type { RemoteHostToolCall } from \"@inupedia/spotlight-protocol\";\nimport type { SessionHostToolHandler } from \"@inupedia/spotlight-client\";\nimport type { SpotlightHostRegistration } from \"../resolveConfig.js\";\nimport type { SpotlightQuickPanelActions } from \"../config.js\";\nimport type { SpotlightUiPrompts } from \"../remote/meta.js\";\nimport type { HandlerApi } from \"../store/pipeline/types.js\";\nimport type { ToolResult } from \"../types/toolResult.js\";\nimport {\n wireSkillExecution,\n type SpotlightSkillExecutionOptions,\n} from \"./skillExecution.js\";\nimport { loadBundledSkillsFromGlob } from \"../skills/index.js\";\nimport {\n createOperateExecutor,\n type OperateWorkflowDefinition,\n} from \"../workflow/operate.js\";\nimport {\n createRunSessionHostTool,\n createSessionControlExecutor,\n type SessionControlHooksFactory,\n type SessionControlWorkflowHooks,\n} from \"../workflow/sessionControl.js\";\nimport { mergeSpotlightSkills } from \"./mergeSkills.js\";\nimport {\n normalizeSkillsOption,\n type SpotlightHostSkillsOption,\n} from \"./normalizeSkills.js\";\n\nexport type SpotlightHostSkillsInput = {\n /**\n * Vite glob map of SKILL.md raw markdown under `.inupedia/skills/`.\n * Use import.meta.glob with eager + ?raw at module top level.\n */\n bundled?: Record<string, string>;\n /** Inline skills from `registerSpotlightSkill` or a custom list. */\n inline?: SpotlightSkill[] | (() => SpotlightSkill[]);\n};\n\nexport type DefineSpotlightHostOptions = AgentRegistryBridgeDeps & {\n /** Vite glob map, or `{ bundled, inline }`. Pass glob Record directly as shorthand. */\n skills?: SpotlightHostSkillsOption;\n /** Host extensions for session continue/stop. Pass factory to receive operate executor. */\n sessionControl?:\n | SessionControlWorkflowHooks\n | SessionControlHooksFactory;\n /** Domain operate workflow definition (tunnel patrol, panels, etc.). */\n operate?: OperateWorkflowDefinition;\n getUiContext?: () => AgentUiContext;\n catalogOverlay?: () => SpotlightCommandCatalog | null | undefined;\n videoChannels?: SpotlightCommandCatalogVideoChannel[];\n onVideoChannelsLoaded?: (\n channels: SpotlightCommandCatalogVideoChannel[],\n ) => void;\n uiPromptsFallback?: SpotlightUiPrompts;\n quickPanelActions?: SpotlightQuickPanelActions;\n getSuggestedQuestions?: SpotlightHostRegistration[\"getSuggestedQuestions\"];\n /** 宿主 skill 脚本执行(注册 skill.runScript;浏览器需自建 runScript) */\n skillExecution?: SpotlightSkillExecutionOptions;\n};\n\nexport type SpotlightHostFactory = () => SpotlightHostRegistration;\n\nfunction resolveInlineSkills(\n inline: SpotlightHostSkillsInput[\"inline\"],\n): SpotlightSkill[] {\n if (!inline) return [];\n return typeof inline === \"function\" ? inline() : inline;\n}\n\nfunction resolveSkillsPool(skills?: SpotlightHostSkillsInput): SpotlightSkill[] {\n if (!skills) return [];\n const inline = resolveInlineSkills(skills.inline);\n const bundled = skills.bundled\n ? loadBundledSkillsFromGlob(skills.bundled)\n : [];\n return mergeSpotlightSkills(inline, bundled);\n}\n\n/**\n * One-call host registration: agent registry → tools bridge, skills merge, optional workflows.\n *\n * @example\n * ```ts\n * import '@/service/agent/tools';\n *\n * export default defineSpotlightHost({\n * listTools,\n * getToolExecutionTarget,\n * runTool,\n * skills: { bundled: skillModules, inline: listSpotlightSkills },\n * sessionControl: mySessionHooks,\n * getUiContext: () => getAgentUiContext(),\n * });\n * ```\n */\nexport function defineSpotlightHost(\n options: DefineSpotlightHostOptions,\n): SpotlightHostFactory {\n const { tools, runHostTool } = defineToolsFromAgentRegistry({\n listTools: options.listTools,\n getToolExecutionTarget: options.getToolExecutionTarget,\n runTool: options.runTool,\n });\n\n const executeOperate = options.operate\n ? createOperateExecutor(options.operate)\n : undefined;\n\n let runSessionHostTool:\n | ((\n call: RemoteHostToolCall,\n api: HandlerApi,\n ) => Promise<Awaited<ReturnType<SessionHostToolHandler>>>)\n | undefined;\n\n if (options.sessionControl) {\n const sessionHooks =\n typeof options.sessionControl === \"function\"\n ? options.operate && executeOperate\n ? options.sessionControl(executeOperate)\n : (() => {\n throw new Error(\n \"Spotlight host: sessionControl factory requires `operate` definition\",\n );\n })()\n : options.sessionControl;\n runSessionHostTool = createRunSessionHostTool(\n createSessionControlExecutor(sessionHooks),\n );\n }\n\n const skillsInput = normalizeSkillsOption(options.skills);\n\n if (options.skillExecution && skillsInput) {\n wireSkillExecution(options.skillExecution, () =>\n resolveSkillsPool(skillsInput),\n );\n }\n\n return () => ({\n tools,\n runHostTool: runHostTool as (\n name: string,\n input: Record<string, unknown>,\n ) => Promise<ToolResult<unknown>>,\n runSessionHostTool,\n executeOperateWorkflow: executeOperate,\n skills: skillsInput ? () => resolveSkillsPool(skillsInput) : undefined,\n getUiContext: options.getUiContext,\n catalogOverlay: options.catalogOverlay,\n videoChannels: options.videoChannels,\n onVideoChannelsLoaded: options.onVideoChannelsLoaded,\n uiPromptsFallback: options.uiPromptsFallback,\n quickPanelActions: options.quickPanelActions,\n getSuggestedQuestions: options.getSuggestedQuestions,\n });\n}\n"],"names":["resolveInlineSkills","inline","resolveSkillsPool","skills","bundled","loadBundledSkillsFromGlob","mergeSpotlightSkills","defineSpotlightHost","options","tools","runHostTool","defineToolsFromAgentRegistry","executeOperate","createOperateExecutor","runSessionHostTool","sessionHooks","createRunSessionHostTool","createSessionControlExecutor","skillsInput","normalizeSkillsOption","wireSkillExecution"],"mappings":";;;;;;;AAsEA,SAASA,EACPC,GACkB;AAClB,SAAKA,IACE,OAAOA,KAAW,aAAaA,EAAA,IAAWA,IAD7B,CAAA;AAEtB;AAEA,SAASC,EAAk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AQ;AAAA,EAAA;AAEnC;"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"mergeSkills.js","sources":["../../src/host/mergeSkills.ts"],"sourcesContent":["import type { SpotlightSkill } from \"@inupedia/spotlight-protocol\";\n\n/** Merge bundled (.inupedia) and inline registry skills; inline wins on name conflict. */\nexport function mergeSpotlightSkills(\n inlineSkills: SpotlightSkill[],\n bundledSkills: SpotlightSkill[],\n): SpotlightSkill[] {\n const merged = new Map<string, SpotlightSkill>();\n for (const skill of bundledSkills) merged.set(skill.name, skill);\n for (const skill of inlineSkills) merged.set(skill.name, skill);\n return Array.from(merged.values()).sort((a, b) =>\n a.name.localeCompare(b.name),\n );\n}\n"],"names":["mergeSpotlightSkills","inlineSkills","bundledSkills","merged","skill","a","b"],"mappings":"AAGO,SAASA,EACdC,GACAC,GACkB;AAClB,QAAMC,wBAAa,IAAA;AACnB,aAAWC,KAASF,EAAe,CAAAC,EAAO,IAAIC,EAAM,MAAMA,CAAK;AAC/D,aAAWA,KAASH,EAAc,CAAAE,EAAO,IAAIC,EAAM,MAAMA,CAAK;AAC9D,SAAO,MAAM,KAAKD,EAAO,OAAA,CAAQ,EAAE;AAAA,IAAK,CAACE,GAAGC,MAC1CD,EAAE,KAAK,cAAcC,EAAE,IAAI;AAAA,EAAA;AAE/B;"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"normalizeSkills.js","sources":["../../src/host/normalizeSkills.ts"],"sourcesContent":["import type { SpotlightHostSkillsInput } from \"./defineHost.js\";\n\nexport type SpotlightHostSkillsOption =\n | SpotlightHostSkillsInput\n | Record<string, string>;\n\nfunction isStructuredSkillsInput(\n value: SpotlightHostSkillsOption,\n): value is SpotlightHostSkillsInput {\n return \"bundled\" in value || \"inline\" in value;\n}\n\nexport function normalizeSkillsOption(\n skills?: SpotlightHostSkillsOption,\n): SpotlightHostSkillsInput | undefined {\n if (!skills) return undefined;\n if (isStructuredSkillsInput(skills)) return skills;\n return { bundled: skills };\n}\n"],"names":["isStructuredSkillsInput","value","normalizeSkillsOption","skills"],"mappings":"AAMA,SAASA,EACPC,GACmC;AACnC,SAAO,aAAaA,KAAS,YAAYA;AAC3C;AAEO,SAASC,EACdC,GACsC;AACtC,MAAKA;AACL,WAAIH,EAAwBG,CAAM,IAAUA,IACrC,EAAE,SAASA,EAAA;AACpB;"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"skillExecution.js","sources":["../../src/host/skillExecution.ts"],"sourcesContent":["import type { SpotlightSkill } from \"@inupedia/spotlight-protocol\";\nimport {\n registerSkillScriptTool,\n type SkillScriptRunner,\n} from \"@inupedia/spotlight-client\";\nimport { resolveSkillRoot } from \"../skills/skillPaths.js\";\n\nexport type SpotlightSkillExecutionOptions = {\n projectDir: string;\n runScript: SkillScriptRunner;\n};\n\nlet skillScriptToolRegistered = false;\n\n/** Register skill.runScript host tool once per app. */\nexport function wireSkillExecution(\n options: SpotlightSkillExecutionOptions,\n getSkills: () => SpotlightSkill[],\n): void {\n if (skillScriptToolRegistered) return;\n skillScriptToolRegistered = true;\n registerSkillScriptTool({\n projectDir: options.projectDir,\n runScript: options.runScript,\n getSkillRoot: (skillName) =>\n resolveSkillRoot(skillName, getSkills(), options.projectDir),\n });\n}\n"],"names":["skillScriptToolRegistered","wireSkillExecution","options","getSkills","registerSkillScriptTool","skillName","resolveSkillRoot"],"mappings":";;AAYA,IAAIA,IAA4B;AAGzB,SAASC,EACdC,GACAC,GACM;AACN,EAAIH,MACJA,IAA4B,IAC5BI,EAAwB;AAAA,IACtB,YAAYF,EAAQ;AAAA,IACpB,WAAWA,EAAQ;AAAA,IACnB,cAAc,CAACG,MACbC,EAAiBD,GAAWF,EAAA,GAAaD,EAAQ,UAAU;AAAA,EAAA,CAC9D;AACH;"}
package/dist/index.js.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"mountShell.js","sources":["../src/mountShell.ts"],"sourcesContent":["import { createVNode, render, type App } from \"vue\";\nimport {\n SPOTLIGHT_AVATAR_CONFIG_KEY,\n type SpotlightAvatarConfig,\n} from \"./avatar/config.js\";\nimport type { SpotlightVuePluginOptions } from \"./config.js\";\n\nlet shellContainer: HTMLElement | null = null;\n\nexport async function mountSpotlightShell(\n app: App,\n options: SpotlightVuePluginOptions,\n): Promise<void> {\n if (options.enabled === false) return;\n\n const avatarConfig: SpotlightAvatarConfig = {\n ...(options.avatar ?? {}),\n };\n app.provide(SPOTLIGHT_AVATAR_CONFIG_KEY, avatarConfig);\n\n const { default: SpotlightShell } = await import(\n \"./components/SpotlightShell.vue\"\n );\n\n shellContainer = document.createElement(\"div\");\n shellContainer.id = \"inupedia-spotlight-root\";\n document.body.appendChild(shellContainer);\n\n const vnode = createVNode(SpotlightShell, {\n avatarEnabled: options.avatarEnabled === true,\n });\n vnode.appContext = app._context;\n render(vnode, shellContainer);\n}\n\nexport function unmountSpotlightShellForTests(): void {\n if (!shellContainer) return;\n render(null, shellContainer);\n shellContainer.remove();\n shellContainer = null;\n}\n"],"names":["shellContainer","mountSpotlightShell","app","options","avatarConfig","SPOTLIGHT_AVATAR_CONFIG_KEY","SpotlightShell","vnode","createVNode","render","unmountSpotlightShellForTests"],"mappings":";;AAOA,IAAIA,IAAqC;AAEzC,eAAsBC,EACpBC,GACAC,GACe;AACf,MAAIA,EAAQ,YAAY,GAAO;AAE/B,QAAMC,IAAsC;AAAA,IAC1C,GAAID,EAAQ,UAAU,CAAA;AAAA,EAAC;AAEzB,EAAAD,EAAI,QAAQG,GAA6BD,CAAY;AAErD,QAAM,EAAE,SAASE,MAAmB,MAAM,OACxC,oCACF;AAEA,EAAAN,IAAiB,SAAS,cAAc,KAAK,GAC7CA,EAAe,KAAK,2BACpB,SAAS,KAAK,YAAYA,CAAc;AAExC,QAAMO,IAAQC,EAAYF,GAAgB;AAAA,IACxC,eAAeH,EAAQ,kBAAkB;AAAA,EAAA,CAC1C;AACD,EAAAI,EAAM,aAAaL,EAAI,UACvBO,EAAOF,GAAOP,CAAc;AAC9B;AAEO,SAASU,IAAsC;AACpD,EAAKV,MACLS,EAAO,MAAMT,CAAc,GAC3BA,EAAe,OAAA,GACfA,IAAiB;AACnB;"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"plugin.js","sources":["../src/plugin.ts"],"sourcesContent":["import type { App, InjectionKey } from \"vue\";\nimport {\n createSpotlightHostAdapter,\n createSpotlightHttp,\n type SpotlightHostAdapter,\n type SpotlightHttp,\n} from \"@inupedia/spotlight-client\";\nimport {\n defineSpotlightConfig,\n SPOTLIGHT_CONFIG_KEY,\n type SpotlightConfig,\n type SpotlightVuePluginOptions,\n} from \"./config.js\";\nimport { mountSpotlightShell, unmountSpotlightShellForTests } from \"./mountShell.js\";\nimport type { SpotlightAvatarConfig } from \"./avatar/config.js\";\n\nexport const SPOTLIGHT_HTTP_KEY: InjectionKey<SpotlightHttp> =\n Symbol(\"spotlight-http\");\nexport const SPOTLIGHT_HOST_ADAPTER_KEY: InjectionKey<SpotlightHostAdapter> =\n Symbol(\"spotlight-host-adapter\");\n\nlet installedConfig: SpotlightConfig | null = null;\nlet installedHttp: SpotlightHttp | null = null;\nlet installedAdapter: SpotlightHostAdapter | null = null;\n\nexport function getSpotlightConfig(): SpotlightConfig {\n if (!installedConfig) {\n throw new Error(\n \"Spotlight is not installed. Call app.use(SpotlightVue, { config }) in main.ts\",\n );\n }\n return installedConfig;\n}\n\nexport function getSpotlightHttp(): SpotlightHttp {\n if (!installedHttp) {\n const config = getSpotlightConfig();\n installedHttp = createSpotlightHttp(config);\n }\n return installedHttp;\n}\n\nexport function getSpotlightHostAdapter(): SpotlightHostAdapter {\n if (!installedAdapter) {\n const config = getSpotlightConfig();\n installedAdapter = createSpotlightHostAdapter({ tools: config.tools });\n }\n return installedAdapter;\n}\n\n/** Reset singletons (tests / HMR). */\nexport function resetSpotlightRuntimeForTests(): void {\n unmountSpotlightShellForTests();\n installedConfig = null;\n installedHttp = null;\n installedAdapter = null;\n}\n\nexport const SpotlightVue = {\n install(app: App, options: SpotlightVuePluginOptions): void {\n const config = defineSpotlightConfig(options.config);\n const resolvedTools =\n typeof config.tools === \"function\" ? config.tools() : config.tools;\n if (!Array.isArray(resolvedTools) || resolvedTools.length === 0) {\n throw new Error(\n \"Spotlight config: at least one host tool is required after tools() resolves\",\n );\n }\n installedConfig = config;\n installedHttp = createSpotlightHttp(config);\n installedAdapter = createSpotlightHostAdapter({ tools: config.tools });\n\n app.provide(SPOTLIGHT_CONFIG_KEY, config);\n app.provide(SPOTLIGHT_HTTP_KEY, installedHttp);\n app.provide(SPOTLIGHT_HOST_ADAPTER_KEY, installedAdapter);\n\n app.config.globalProperties.$spotlightEnabled = options.enabled !== false;\n app.config.globalProperties.$spotlightAvatarEnabled =\n options.avatarEnabled === true;\n\n mountSpotlightShell(app, options);\n },\n};\n\nexport {\n defineSpotlightConfig,\n SPOTLIGHT_CONFIG_KEY,\n type SpotlightConfig,\n type SpotlightVuePluginOptions,\n type SpotlightAvatarConfig,\n};\n"],"names":["SPOTLIGHT_HTTP_KEY","SPOTLIGHT_HOST_ADAPTER_KEY","installedConfig","installedHttp","installedAdapter","getSpotlightConfig","getSpotlightHttp","config","createSpotlightHttp","getSpotlightHostAdapter","createSpotlightHostAdapter","resetSpotlightRuntimeForTests","unmountSpotlightShellForTests","SpotlightVue","app","options","defineSpotlightConfig","resolvedTools","SPOTLIGHT_CONFIG_KEY","mountSpotlightShell"],"mappings":";;;AAgBO,MAAMA,2BACJ,gBAAgB,GACZC,2BACJ,wBAAwB;AAEjC,IAAIC,IAA0C,MAC1CC,IAAsC,MACtCC,IAAgD;AAE7C,SAASC,IAAsC;AACpD,MAAI,CAACH;AACH,UAAM,IAAI;AAAA,MACR;AAAA,IAAA;AAGJ,SAAOA;AACT;AAEO,SAASI,IAAkC;AAChD,MAAI,CAACH,GAAe;AAClB,UAAMI,IAASF,EAAA;AACf,IAAAF,IAAgBK,EAAoBD,CAAM;AAAA,EAC5C;AACA,SAAOJ;AACT;AAEO,SAASM,IAAgD;AAC9D,MAAI,CAACL,GAAkB;AACrB,UAAMG,IAASF,EAAA;AACf,IAAAD,IAAmBM,EAA2B,EAAE,OAAOH,EAAO,OAAO;AAAA,EACvE;AACA,SAAOH;AACT;AAGO,SAASO,IAAsC;AACpD,EAAAC,EAAA,GACAV,IAAkB,MAClBC,IAAgB,MAChBC,IAAmB;AACrB;AAEO,MAAMS,IAAe;AAAA,EAC1B,QAAQC,GAAUC,GAA0C;AAC1D,UAAMR,IAASS,EAAsBD,EAAQ,MAAM,GAC7CE,IACJ,OAAOV,EAAO,SAAU,aAAaA,EAAO,UAAUA,EAAO;AAC/D,QAAI,CAAC,MAAM,QAAQU,CAAa,KAAKA,EAAc,WAAW;AAC5D,YAAM,IAAI;AAAA,QACR;AAAA,MAAA;AAGJ,IAAAf,IAAkBK,GAClBJ,IAAgBK,EAAoBD,CAAM,GAC1CH,IAAmBM,EAA2B,EAAE,OAAOH,EAAO,OAAO,GAErEO,EAAI,QAAQI,GAAsBX,CAAM,GACxCO,EAAI,QAAQd,GAAoBG,CAAa,GAC7CW,EAAI,QAAQb,GAA4BG,CAAgB,GAExDU,EAAI,OAAO,iBAAiB,oBAAoBC,EAAQ,YAAY,IACpED,EAAI,OAAO,iBAAiB,0BAC1BC,EAAQ,kBAAkB,IAE5BI,EAAoBL,GAAKC,CAAO;AAAA,EAClC;AACF;"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"audio.js","sources":["../../src/remote/audio.ts"],"sourcesContent":["import { withRequestTimeout } from \"../utils/requestTimeout.js\";\nimport {\n buildSpotlightJsonHeaders,\n getSpotlightServerBase,\n} from \"./httpConfig.js\";\nimport { postSpotlightJson } from \"./serverJson.js\";\n\nconst STT_REQUEST_TIMEOUT_MS = 30_000;\nconst TTS_REQUEST_TIMEOUT_MS = 45_000;\n\nexport function normalizeSpeakText(input: string): string {\n return input\n .replace(/```[\\s\\S]*?```/g, \" \")\n .replace(/`([^`]+)`/g, \"$1\")\n .replace(/\\[(.*?)\\]\\((.*?)\\)/g, \"$1\")\n .replace(/[#>*_-]+/g, \" \")\n .replace(/\\s+/g, \" \")\n .trim()\n .slice(0, 3000);\n}\n\nexport function extractTranscriptionText(payload: unknown): string {\n if (typeof payload === \"string\") return payload.trim();\n if (!payload || typeof payload !== \"object\") return \"\";\n const text = (payload as { text?: unknown }).text;\n if (typeof text === \"string\") return text.trim();\n return \"\";\n}\n\nexport type SpotlightTranscriptionPayload = {\n file: string;\n mimeType: string;\n filename: string;\n};\n\nexport async function spotlightTranscribeAudio(\n payload: SpotlightTranscriptionPayload,\n signal?: AbortSignal,\n): Promise<unknown> {\n const request = withRequestTimeout(STT_REQUEST_TIMEOUT_MS, signal);\n try {\n return await postSpotlightJson<unknown>(\n \"/v1/audio/transcriptions\",\n payload,\n request.signal,\n );\n } finally {\n request.cleanup();\n }\n}\n\nexport async function spotlightSynthesizeSpeech(\n text: string,\n signal?: AbortSignal,\n): Promise<{ blob: Blob; spokenText: string }> {\n const spokenText = normalizeSpeakText(text);\n if (!spokenText) {\n throw new Error(\"TTS 输入为空。\");\n }\n\n const request = withRequestTimeout(TTS_REQUEST_TIMEOUT_MS, signal);\n try {\n const base = getSpotlightServerBase();\n const response = await fetch(`${base}/v1/audio/speech`, {\n method: \"POST\",\n headers: buildSpotlightJsonHeaders(),\n body: JSON.stringify({ input: spokenText }),\n signal: request.signal,\n });\n\n if (!response.ok) {\n const detail = await response.text().catch(() => \"\");\n throw new Error(detail || `HTTP ${response.status}`);\n }\n\n const blob = await response.blob();\n if (blob.size <= 0) {\n throw new Error(\"TTS 返回空音频。\");\n }\n return { blob, spokenText };\n } finally {\n request.cleanup();\n }\n}\n"],"names":["STT_REQUEST_TIMEOUT_MS","TTS_REQUEST_TIMEOUT_MS","normalizeSpeakText","input","extractTranscriptionText","payload","text","spotlightTranscribeAudio","signal","request","withRequestTimeout","postSpotlightJson","spotlightSynthesizeSpeech","spokenText","base","getSpotlightServerBase","response","buildSpotlightJsonHeaders","detail","blob"],"mappings":";;;AAOA,MAAMA,IAAyB,KACzBC,IAAyB;AAExB,SAASC,EAAmBC,GAAuB;AACxD,SAAOA,EACJ,QAAQ,mBAAmB,GAAG,EAC9B,QAAQ,cAAc,IAAI,EAC1B,QAAQ,uBAAuB,IAAI,EACnC,QAAQ,aAAa,GAAG,EACxB,QAAQ,QAAQ,GAAG,EACnB,KAAA,EACA,MAAM,GAAG,GAAI;AAClB;AAEO,SAASC,EAAyBC,GAA0B;AACjE,MAAI,OAAOA,KAAY,SAAU,QAAOA,EAAQ,KAAA;AAChD,MAAI,CAACA,KAAW,OAAOA,KAAY,SAAU,QAAO;AACpD,QAAMC,IAAQD,EAA+B;AAC7C,SAAI,OAAOC,KAAS,WAAiBA,EAAK,KAAA,IACnC;AACT;AAQA,eAAsBC,EACpBF,GACAG,GACkB;AAClB,QAAMC,IAAUC,EAAmBV,GAAwBQ,CAAM;AACjE,MAAI;AACF,WAAO,MAAMG;AAAA,MACX;AAAA,MACAN;AAAA,MACAI,EAAQ;AAAA,IAAA;AAAA,EAEZ,UAAA;AACE,IAAAA,EAAQ,QAAA;AAAA,EACV;AACF;AAEA,eAAsBG,EACpBN,GACAE,GAC6C;AAC7C,QAAMK,IAAaX,EAAmBI,CAAI;AAC1C,MAAI,CAACO;AACH,UAAM,IAAI,MAAM,WAAW;AAG7B,QAAMJ,IAAUC,EAAmBT,GAAwBO,CAAM;AACjE,MAAI;AACF,UAAMM,IAAOC,EAAA,GACPC,IAAW,MAAM,MAAM,GAAGF,CAAI,oBAAoB;AAAA,MACtD,QAAQ;AAAA,MACR,SAASG,EAAA;AAAA,MACT,MAAM,KAAK,UAAU,EAAE,OAAOJ,GAAY;AAAA,MAC1C,QAAQJ,EAAQ;AAAA,IAAA,CACjB;AAED,QAAI,CAACO,EAAS,IAAI;AAChB,YAAME,IAAS,MAAMF,EAAS,OAAO,MAAM,MAAM,EAAE;AACnD,YAAM,IAAI,MAAME,KAAU,QAAQF,EAAS,MAAM,EAAE;AAAA,IACrD;AAEA,UAAMG,IAAO,MAAMH,EAAS,KAAA;AAC5B,QAAIG,EAAK,QAAQ;AACf,YAAM,IAAI,MAAM,YAAY;AAE9B,WAAO,EAAE,MAAAA,GAAM,YAAAN,EAAA;AAAA,EACjB,UAAA;AACE,IAAAJ,EAAQ,QAAA;AAAA,EACV;AACF;"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"hostToolRunner.js","sources":["../../src/remote/hostToolRunner.ts"],"sourcesContent":["import {\n fetchHostToolsManifest,\n type SessionHostToolHandler,\n} from \"@inupedia/spotlight-client\";\nimport type {\n HostToolEffect,\n HostToolExecutionResult,\n RemoteHostToolCall,\n} from \"@inupedia/spotlight-protocol\";\nimport { getSpotlightConfig, getSpotlightHostAdapter } from \"../plugin.js\";\nimport { getSpotlightHttp } from \"../plugin.js\";\nimport type { HandlerApi } from \"../store/pipeline/types.js\";\nimport type { ToolResult } from \"../types/toolResult.js\";\n\nexport type RemoteToolCall = RemoteHostToolCall;\n\nexport async function ensureHostToolsManifest(signal?: AbortSignal) {\n return fetchHostToolsManifest(getSpotlightHttp(), signal);\n}\n\nexport async function executeRemoteHostTool(\n call: RemoteToolCall,\n api: HandlerApi,\n options: { allowedHostNames: Set<string>; hostEffect?: HostToolEffect },\n): Promise<ToolResult<unknown>> {\n const adapter = getSpotlightHostAdapter();\n const config = getSpotlightConfig();\n const sessionToolHandler: SessionHostToolHandler | undefined =\n config.runSessionHostTool\n ? async (sessionCall, _ctx) =>\n config.runSessionHostTool!(sessionCall, api)\n : undefined;\n\n const result = await adapter.executeHostTool(call, {\n allowedHostNames: options.allowedHostNames,\n hostEffect: options.hostEffect,\n sessionToolHandler,\n });\n\n return {\n success: result.success,\n data: result.data,\n error: result.error,\n errorCode: result.errorCode,\n trace: result.trace,\n executionTarget: \"host\",\n };\n}\n\nexport type { HostToolExecutionResult };\n"],"names":["ensureHostToolsManifest","signal","fetchHostToolsManifest","getSpotlightHttp","executeRemoteHostTool","call","api","options","adapter","getSpotlightHostAdapter","config","getSpotlightConfig","sessionToolHandler","sessionCall","_ctx","result"],"mappings":";;AAgBA,eAAsBA,EAAwBC,GAAsB;AAClE,SAAOC,EAAuBC,EAAA,GAAoBF,CAAM;AAC1D;AAEA,eAAsBG,EACpBC,GACAC,GACAC,GAC8B;AAC9B,QAAMC,IAAUC,EAAA,GACVC,IAASC,EAAA,GACTC,IACJF,EAAO,qBACH,OAAOG,GAAaC,MAClBJ,EAAO,mBAAoBG,GAAaP,CAAG,IAC7C,QAEAS,IAAS,MAAMP,EAAQ,gBAAgBH,GAAM;AAAA,IACjD,kBAAkBE,EAAQ;AAAA,IAC1B,YAAYA,EAAQ;AAAA,IACpB,oBAAAK;AAAA,EAAA,CACD;AAED,SAAO;AAAA,IACL,SAASG,EAAO;AAAA,IAChB,MAAMA,EAAO;AAAA,IACb,OAAOA,EAAO;AAAA,IACd,WAAWA,EAAO;AAAA,IAClB,OAAOA,EAAO;AAAA,IACd,iBAAiB;AAAA,EAAA;AAErB;"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"httpConfig.js","sources":["../../src/remote/httpConfig.ts"],"sourcesContent":["import { getSpotlightConfig, getSpotlightHttp } from \"../plugin.js\";\n\nexport function getSpotlightServerBase(): string {\n return getSpotlightHttp().getBase();\n}\n\nexport function buildSpotlightJsonHeaders(): Record<string, string> {\n return getSpotlightHttp().jsonHeaders();\n}\n\nexport function getSpotlightProjectId(): string {\n return getSpotlightConfig().projectId;\n}\n\nexport function appendSpotlightProjectQuery(path: string): string {\n return getSpotlightHttp().appendProjectQuery(path);\n}\n"],"names":["getSpotlightServerBase","getSpotlightHttp","buildSpotlightJsonHeaders","getSpotlightProjectId","getSpotlightConfig","appendSpotlightProjectQuery","path"],"mappings":";AAEO,SAASA,IAAiC;AAC/C,SAAOC,EAAA,EAAmB,QAAA;AAC5B;AAEO,SAASC,IAAoD;AAClE,SAAOD,EAAA,EAAmB,YAAA;AAC5B;AAEO,SAASE,IAAgC;AAC9C,SAAOC,IAAqB;AAC9B;AAEO,SAASC,EAA4BC,GAAsB;AAChE,SAAOL,EAAA,EAAmB,mBAAmBK,CAAI;AACnD;"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"meta.js","sources":["../../src/remote/meta.ts"],"sourcesContent":["import type { SpotlightCommandCatalogVideoChannel } from \"@inupedia/spotlight-protocol\";\nimport { getSpotlightConfig } from \"../plugin.js\";\nimport { appendSpotlightProjectQuery } from \"./httpConfig.js\";\nimport { getSpotlightJson } from \"./serverJson.js\";\n\nexport type SpotlightUiPrompts = {\n capabilityHelpPatterns: string[];\n capabilityHelpFooter?: string;\n suggestionChips: Record<string, string[]>;\n};\n\nexport type SpotlightVideoChannelMeta = SpotlightCommandCatalogVideoChannel;\n\nlet uiPromptsCache: SpotlightUiPrompts | null = null;\nlet metaInflight: Promise<void> | null = null;\n\nconst DEFAULT_UI_PROMPTS: SpotlightUiPrompts = {\n capabilityHelpPatterns: [],\n suggestionChips: {\n default: [\"你能做什么\"],\n },\n};\n\nfunction asUiPrompts(raw: unknown): SpotlightUiPrompts {\n const parsed = raw as SpotlightUiPrompts;\n if (\n parsed &&\n Array.isArray(parsed.capabilityHelpPatterns) &&\n parsed.suggestionChips &&\n typeof parsed.suggestionChips === \"object\"\n ) {\n return parsed;\n }\n return getSpotlightConfig().uiPromptsFallback ?? DEFAULT_UI_PROMPTS;\n}\n\nfunction asVideoChannels(raw: unknown): SpotlightVideoChannelMeta[] {\n if (!Array.isArray(raw)) {\n return getSpotlightConfig().videoChannels ?? [];\n }\n return raw.filter(\n (item): item is SpotlightVideoChannelMeta =>\n Boolean(item) &&\n typeof item === \"object\" &&\n typeof (item as SpotlightVideoChannelMeta).id === \"string\" &&\n typeof (item as SpotlightVideoChannelMeta).label === \"string\" &&\n Array.isArray((item as SpotlightVideoChannelMeta).aliases),\n );\n}\n\n/** Fetch ui-prompts and video-channels; falls back to config when server is unavailable. */\nexport async function ensureSpotlightMeta(signal?: AbortSignal): Promise<void> {\n if (uiPromptsCache) return;\n if (metaInflight) {\n await metaInflight;\n return;\n }\n metaInflight = (async () => {\n const config = getSpotlightConfig();\n try {\n const [uiPayload, videoPayload] = await Promise.all([\n getSpotlightJson<{ prompts: unknown }>(\n appendSpotlightProjectQuery(\"/v1/meta/ui-prompts\"),\n signal,\n ),\n getSpotlightJson<{ channels: unknown }>(\n appendSpotlightProjectQuery(\"/v1/meta/video-channels\"),\n signal,\n ),\n ]);\n uiPromptsCache = asUiPrompts(uiPayload.prompts);\n config.onVideoChannelsLoaded?.(asVideoChannels(videoPayload.channels));\n } catch {\n uiPromptsCache = config.uiPromptsFallback ?? DEFAULT_UI_PROMPTS;\n if (config.videoChannels?.length) {\n config.onVideoChannelsLoaded?.(config.videoChannels);\n }\n } finally {\n metaInflight = null;\n }\n })();\n await metaInflight;\n}\n\nexport function getSpotlightUiPrompts(): SpotlightUiPrompts {\n return (\n uiPromptsCache ??\n getSpotlightConfig().uiPromptsFallback ??\n DEFAULT_UI_PROMPTS\n );\n}\n\nexport function resetSpotlightMetaCacheForTests(): void {\n uiPromptsCache = null;\n metaInflight = null;\n}\n"],"names":["uiPromptsCache","metaInflight","DEFAULT_UI_PROMPTS","asUiPrompts","raw","parsed","getSpotlightConfig","asVideoChannels","item","ensureSpotlightMeta","signal","config","uiPayload","videoPayload","getSpotlightJson","appendSpotlightProjectQuery","getSpotlightUiPrompts","resetSpotlightMetaCacheForTests"],"mappings":";;;AAaA,IAAIA,IAA4C,MAC5CC,IAAqC;AAEzC,MAAMC,IAAyC;AAAA,EAC7C,wBAAwB,CAAA;AAAA,EACxB,iBAAiB;AAAA,IACf,SAAS,CAAC,OAAO;AAAA,EAAA;AAErB;AAEA,SAASC,EAAYC,GAAkC;AACrD,QAAMC,IAASD;AACf,SACEC,KACA,MAAM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