@inupedia/spotlight-vue 0.1.7 → 0.1.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -2,39 +2,40 @@ import { SPOTLIGHT_CONFIG_KEY as e, defineSpotlightConfig as r } from "./config.
2
2
  import { resolveSpotlightConfig as n } from "./resolveConfig.js";
3
3
  import { defineSpotlightApp as S, readSpotlightEnv as l } from "./host/defineApp.js";
4
4
  import { defineSpotlightHost as m } from "./host/defineHost.js";
5
- import { normalizeSkillsOption as T } from "./host/normalizeSkills.js";
5
+ import { normalizeSkillsOption as a } from "./host/normalizeSkills.js";
6
6
  import { mergeSpotlightSkills as f } from "./host/mergeSkills.js";
7
- import { SPOTLIGHT_HOST_ADAPTER_KEY as u, SPOTLIGHT_HTTP_KEY as E, SpotlightVue as h, getSpotlightConfig as _, getSpotlightHostAdapter as I, getSpotlightHttp as d } from "./plugin.js";
7
+ import { SPOTLIGHT_HOST_ADAPTER_KEY as h, SPOTLIGHT_HTTP_KEY as u, SpotlightVue as E, getSpotlightConfig as _, getSpotlightHostAdapter as d, getSpotlightHttp as I } from "./plugin.js";
8
8
  import { useSpotlightStore as C } from "./store/spotlightStore.js";
9
- import { INVESTMENT_SUB_INTENT_LABELS as P, InvestmentSubIntent as c, PROGRESS_SUB_INTENT_LABELS as N, ProgressSubIntent as k, QUALITY_SUB_INTENT_LABELS as A, QualitySubIntent as w, SAFETY_SUB_INTENT_LABELS as R, SPOTLIGHT_INTENT_LABELS as B, SUB_INTENT_CONFIG as H, SafetySubIntent as b, SpotlightCommandDomain as M, SpotlightCommandScope as G, SpotlightIntent as F } from "./store/types.js";
10
- import { useSpotlightRuntimeStore as K } from "./store/runtimeStore.js";
11
- import { useAgentSessionStore as v } from "./session/agentSession.js";
12
- import { getSkillsPoolForRun as D, loadBundledSkillsFromGlob as z } from "./skills/index.js";
13
- import { cancelRemoteSpotlightRunForSignal as Q, runRemoteSpotlightPipeline as J, warmupSpotlightRemoteContext as V } from "./remote/runPipeline.js";
14
- import { ensureSpotlightMeta as q, getSpotlightUiPrompts as X } from "./remote/meta.js";
15
- import { extractTranscriptionText as $, normalizeSpeakText as tt, spotlightSynthesizeSpeech as ot, spotlightTranscribeAudio as et } from "./remote/audio.js";
16
- import { getSpotlightJson as pt, postSpotlightJson as nt } from "./remote/serverJson.js";
17
- import { TOOL_NAMES as St } from "./constants/toolNames.js";
18
- import { TOOL_STEP_ANSWER_DELIMITER as st, composeToolStepContent as mt, getIntentStepDisplayContent as gt, humanizeSpotlightStepContent as Tt, isLoopPlanningChunk as at, isToolExecutionStep as ft, sanitizeToolStepAnswerText as xt, splitIntentStepContent as ut, splitToolStepContent as Et } from "./store/pipeline/displayText.js";
19
- import { isInternalKnowledgeEvidenceTool as _t, isUserFacingKnowledgeTool as It, partitionToolCalls as dt } from "./store/pipeline/toolDisplay.js";
20
- import { SPOTLIGHT_PIPELINE_STEP_IDS as Ct, SPOTLIGHT_PIPELINE_STEP_LABELS as Ot } from "./store/pipeline/constants.js";
21
- import { formatSpotlightKnowledgeMarkdown as ct, initSpotlightMarkdownPreview as Nt, preprocessKnowledgeMarkdown as kt } from "./store/pipeline/spotlightMarkdown.js";
22
- import { formatToolFailure as wt } from "./store/pipeline/errors.js";
23
- import { getSuggestedQuestions as Bt } from "./store/capabilities.js";
24
- import { useSpotlightPanelUi as bt } from "./composables/useSpotlightPanelUi.js";
25
- import { useSpotlightCommandShortcuts as Gt } from "./composables/useSpotlightCommandShortcuts.js";
26
- import { isGenericHostExecutionReply as Ut } from "./avatar/speech/live2dAnswerSpeechPolicy.js";
27
- import { COMMON_WORKFLOW_STEPS as Wt, buildCommonSteps as vt, buildCommonWorkflowSteps as yt } from "./workflow/shared.js";
28
- import { runHostTool as zt } from "./workflow/runHostTool.js";
29
- import { buildOperateWorkflowSteps as Qt, createOperateExecutor as Jt, isOperateWorkflowContext as Vt } from "./workflow/operate.js";
30
- import { createOperateDefinition as qt } from "./workflow/createOperateDefinition.js";
31
- import { buildOperateCommandContext as Zt, buildRepeatLastAnswerContext as $t, buildSessionControlWorkflowSteps as to, createRunSessionHostTool as oo, createSessionControlExecutor as eo } from "./workflow/sessionControl.js";
32
- import { formatSkillsWithinBudget as po } from "./skills/skillListing.js";
33
- import { getBypassMatchedSkills as io, getModelInvokableSkills as So } from "./skills/matching.js";
34
- import { parseSpotlightSkillMarkdown as so } from "./skills/parser.js";
9
+ import { INVESTMENT_SUB_INTENT_LABELS as O, InvestmentSubIntent as c, PROGRESS_SUB_INTENT_LABELS as N, ProgressSubIntent as k, QUALITY_SUB_INTENT_LABELS as A, QualitySubIntent as w, SAFETY_SUB_INTENT_LABELS as R, SPOTLIGHT_INTENT_LABELS as b, SUB_INTENT_CONFIG as B, SafetySubIntent as H, SpotlightCommandDomain as M, SpotlightCommandScope as G, SpotlightIntent as F } from "./store/types.js";
10
+ import { useSpotlightRuntimeStore as y } from "./store/runtimeStore.js";
11
+ import { useAgentSessionStore as W } from "./session/agentSession.js";
12
+ import { readSpotlightMemoryEnabled as D, useSpotlightMemoryPreferenceStore as z } from "./store/memoryPreferenceStore.js";
13
+ import { getSkillsPoolForRun as Q, loadBundledSkillsFromGlob as J } from "./skills/index.js";
14
+ import { cancelRemoteSpotlightRunForSignal as j, runRemoteSpotlightPipeline as q, warmupSpotlightRemoteContext as X } from "./remote/runPipeline.js";
15
+ import { ensureSpotlightMeta as $, getSpotlightUiPrompts as tt } from "./remote/meta.js";
16
+ import { extractTranscriptionText as et, normalizeSpeakText as rt, spotlightSynthesizeSpeech as pt, spotlightTranscribeAudio as nt } from "./remote/audio.js";
17
+ import { getSpotlightJson as St, postSpotlightJson as lt } from "./remote/serverJson.js";
18
+ import { TOOL_NAMES as mt } from "./constants/toolNames.js";
19
+ import { TOOL_STEP_ANSWER_DELIMITER as at, composeToolStepContent as Tt, getIntentStepDisplayContent as ft, humanizeSpotlightStepContent as xt, isLoopPlanningChunk as ht, isToolExecutionStep as ut, sanitizeToolStepAnswerText as Et, splitIntentStepContent as _t, splitToolStepContent as dt } from "./store/pipeline/displayText.js";
20
+ import { isInternalKnowledgeEvidenceTool as Lt, isUserFacingKnowledgeTool as Ct, partitionToolCalls as Pt } from "./store/pipeline/toolDisplay.js";
21
+ import { SPOTLIGHT_PIPELINE_STEP_IDS as ct, SPOTLIGHT_PIPELINE_STEP_LABELS as Nt } from "./store/pipeline/constants.js";
22
+ import { formatSpotlightKnowledgeMarkdown as At, initSpotlightMarkdownPreview as wt, preprocessKnowledgeMarkdown as Rt } from "./store/pipeline/spotlightMarkdown.js";
23
+ import { formatToolFailure as Bt } from "./store/pipeline/errors.js";
24
+ import { getSuggestedQuestions as Mt } from "./store/capabilities.js";
25
+ import { useSpotlightPanelUi as Ft } from "./composables/useSpotlightPanelUi.js";
26
+ import { useSpotlightCommandShortcuts as yt } from "./composables/useSpotlightCommandShortcuts.js";
27
+ import { isGenericHostExecutionReply as Wt } from "./avatar/speech/live2dAnswerSpeechPolicy.js";
28
+ import { COMMON_WORKFLOW_STEPS as Dt, buildCommonSteps as zt, buildCommonWorkflowSteps as Yt } from "./workflow/shared.js";
29
+ import { runHostTool as Jt } from "./workflow/runHostTool.js";
30
+ import { buildOperateWorkflowSteps as jt, createOperateExecutor as qt, isOperateWorkflowContext as Xt } from "./workflow/operate.js";
31
+ import { createOperateDefinition as $t } from "./workflow/createOperateDefinition.js";
32
+ import { buildOperateCommandContext as oo, buildRepeatLastAnswerContext as eo, buildSessionControlWorkflowSteps as ro, createRunSessionHostTool as po, createSessionControlExecutor as no } from "./workflow/sessionControl.js";
33
+ import { formatSkillsWithinBudget as So } from "./skills/skillListing.js";
34
+ import { getBypassMatchedSkills as so, getModelInvokableSkills as mo } from "./skills/matching.js";
35
+ import { parseSpotlightSkillMarkdown as ao } from "./skills/parser.js";
35
36
  export {
36
- Wt as COMMON_WORKFLOW_STEPS,
37
- P as INVESTMENT_SUB_INTENT_LABELS,
37
+ Dt as COMMON_WORKFLOW_STEPS,
38
+ O as INVESTMENT_SUB_INTENT_LABELS,
38
39
  c as InvestmentSubIntent,
39
40
  N as PROGRESS_SUB_INTENT_LABELS,
40
41
  k as ProgressSubIntent,
@@ -42,78 +43,80 @@ export {
42
43
  w as QualitySubIntent,
43
44
  R as SAFETY_SUB_INTENT_LABELS,
44
45
  e as SPOTLIGHT_CONFIG_KEY,
45
- u as SPOTLIGHT_HOST_ADAPTER_KEY,
46
- E as SPOTLIGHT_HTTP_KEY,
47
- B as SPOTLIGHT_INTENT_LABELS,
48
- Ct as SPOTLIGHT_PIPELINE_STEP_IDS,
49
- Ot as SPOTLIGHT_PIPELINE_STEP_LABELS,
50
- H as SUB_INTENT_CONFIG,
51
- b as SafetySubIntent,
46
+ h as SPOTLIGHT_HOST_ADAPTER_KEY,
47
+ u as SPOTLIGHT_HTTP_KEY,
48
+ b as SPOTLIGHT_INTENT_LABELS,
49
+ ct as SPOTLIGHT_PIPELINE_STEP_IDS,
50
+ Nt as SPOTLIGHT_PIPELINE_STEP_LABELS,
51
+ B as SUB_INTENT_CONFIG,
52
+ H as SafetySubIntent,
52
53
  M as SpotlightCommandDomain,
53
54
  G as SpotlightCommandScope,
54
55
  F as SpotlightIntent,
55
- h as SpotlightVue,
56
- St as TOOL_NAMES,
57
- st as TOOL_STEP_ANSWER_DELIMITER,
58
- vt as buildCommonSteps,
59
- yt as buildCommonWorkflowSteps,
60
- Zt as buildOperateCommandContext,
61
- Qt as buildOperateWorkflowSteps,
62
- $t as buildRepeatLastAnswerContext,
63
- to as buildSessionControlWorkflowSteps,
64
- Q as cancelRemoteSpotlightRunForSignal,
65
- mt as composeToolStepContent,
66
- qt as createOperateDefinition,
67
- Jt as createOperateExecutor,
68
- oo as createRunSessionHostTool,
69
- eo as createSessionControlExecutor,
56
+ E as SpotlightVue,
57
+ mt as TOOL_NAMES,
58
+ at as TOOL_STEP_ANSWER_DELIMITER,
59
+ zt as buildCommonSteps,
60
+ Yt as buildCommonWorkflowSteps,
61
+ oo as buildOperateCommandContext,
62
+ jt as buildOperateWorkflowSteps,
63
+ eo as buildRepeatLastAnswerContext,
64
+ ro as buildSessionControlWorkflowSteps,
65
+ j as cancelRemoteSpotlightRunForSignal,
66
+ Tt as composeToolStepContent,
67
+ $t as createOperateDefinition,
68
+ qt as createOperateExecutor,
69
+ po as createRunSessionHostTool,
70
+ no as createSessionControlExecutor,
70
71
  S as defineSpotlightApp,
71
72
  r as defineSpotlightConfig,
72
73
  m as defineSpotlightHost,
73
- q as ensureSpotlightMeta,
74
- $ as extractTranscriptionText,
75
- po as formatSkillsWithinBudget,
76
- ct as formatSpotlightKnowledgeMarkdown,
77
- wt as formatToolFailure,
78
- io as getBypassMatchedSkills,
79
- gt as getIntentStepDisplayContent,
80
- So as getModelInvokableSkills,
81
- D as getSkillsPoolForRun,
74
+ $ as ensureSpotlightMeta,
75
+ et as extractTranscriptionText,
76
+ So as formatSkillsWithinBudget,
77
+ At as formatSpotlightKnowledgeMarkdown,
78
+ Bt as formatToolFailure,
79
+ so as getBypassMatchedSkills,
80
+ ft as getIntentStepDisplayContent,
81
+ mo as getModelInvokableSkills,
82
+ Q as getSkillsPoolForRun,
82
83
  _ as getSpotlightConfig,
83
- I as getSpotlightHostAdapter,
84
- d as getSpotlightHttp,
85
- pt as getSpotlightJson,
86
- X as getSpotlightUiPrompts,
87
- Bt as getSuggestedQuestions,
88
- Tt as humanizeSpotlightStepContent,
89
- Nt as initSpotlightMarkdownPreview,
90
- Ut as isGenericHostExecutionReply,
91
- _t as isInternalKnowledgeEvidenceTool,
92
- at as isLoopPlanningChunk,
93
- Vt as isOperateWorkflowContext,
94
- ft as isToolExecutionStep,
95
- It as isUserFacingKnowledgeTool,
96
- z as loadBundledSkillsFromGlob,
84
+ d as getSpotlightHostAdapter,
85
+ I as getSpotlightHttp,
86
+ St as getSpotlightJson,
87
+ tt as getSpotlightUiPrompts,
88
+ Mt as getSuggestedQuestions,
89
+ xt as humanizeSpotlightStepContent,
90
+ wt as initSpotlightMarkdownPreview,
91
+ Wt as isGenericHostExecutionReply,
92
+ Lt as isInternalKnowledgeEvidenceTool,
93
+ ht as isLoopPlanningChunk,
94
+ Xt as isOperateWorkflowContext,
95
+ ut as isToolExecutionStep,
96
+ Ct as isUserFacingKnowledgeTool,
97
+ J as loadBundledSkillsFromGlob,
97
98
  f as mergeSpotlightSkills,
98
- T as normalizeSkillsOption,
99
- tt as normalizeSpeakText,
100
- so as parseSpotlightSkillMarkdown,
101
- dt as partitionToolCalls,
102
- nt as postSpotlightJson,
103
- kt as preprocessKnowledgeMarkdown,
99
+ a as normalizeSkillsOption,
100
+ rt as normalizeSpeakText,
101
+ ao as parseSpotlightSkillMarkdown,
102
+ Pt as partitionToolCalls,
103
+ lt as postSpotlightJson,
104
+ Rt as preprocessKnowledgeMarkdown,
104
105
  l as readSpotlightEnv,
106
+ D as readSpotlightMemoryEnabled,
105
107
  n as resolveSpotlightConfig,
106
- zt as runHostTool,
107
- J as runRemoteSpotlightPipeline,
108
- xt as sanitizeToolStepAnswerText,
109
- ut as splitIntentStepContent,
110
- Et as splitToolStepContent,
111
- ot as spotlightSynthesizeSpeech,
112
- et as spotlightTranscribeAudio,
113
- v as useAgentSessionStore,
114
- Gt as useSpotlightCommandShortcuts,
115
- bt as useSpotlightPanelUi,
116
- K as useSpotlightRuntimeStore,
108
+ Jt as runHostTool,
109
+ q as runRemoteSpotlightPipeline,
110
+ Et as sanitizeToolStepAnswerText,
111
+ _t as splitIntentStepContent,
112
+ dt as splitToolStepContent,
113
+ pt as spotlightSynthesizeSpeech,
114
+ nt as spotlightTranscribeAudio,
115
+ W as useAgentSessionStore,
116
+ yt as useSpotlightCommandShortcuts,
117
+ z as useSpotlightMemoryPreferenceStore,
118
+ Ft as useSpotlightPanelUi,
119
+ y as useSpotlightRuntimeStore,
117
120
  C as useSpotlightStore,
118
- V as warmupSpotlightRemoteContext
121
+ X as warmupSpotlightRemoteContext
119
122
  };
@@ -1 +1 @@
1
- {"version":3,"file":"runPipeline.d.ts","sourceRoot":"","sources":["../../src/remote/runPipeline.ts"],"names":[],"mappings":"AAYA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,4BAA4B,CAAC;AAc7D,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,YAAY,CAAC;AA8a9D,wBAAsB,4BAA4B,CAChD,MAAM,CAAC,EAAE,WAAW,GACnB,OAAO,CAAC,IAAI,CAAC,CAKf;AAsCD,wBAAsB,0BAA0B,CAC9C,YAAY,EAAE,MAAM,EACpB,GAAG,EAAE,UAAU,GACd,OAAO,CAAC,2BAA2B,CAAC,CAgGtC;AAED,wBAAsB,wBAAwB,CAAC,KAAK,EAAE,MAAM,iBAQ3D;AAED,wBAAgB,iCAAiC,CAAC,MAAM,CAAC,EAAE,WAAW,QAMrE"}
1
+ {"version":3,"file":"runPipeline.d.ts","sourceRoot":"","sources":["../../src/remote/runPipeline.ts"],"names":[],"mappings":"AAaA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,4BAA4B,CAAC;AAc7D,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,YAAY,CAAC;AAub9D,wBAAsB,4BAA4B,CAChD,MAAM,CAAC,EAAE,WAAW,GACnB,OAAO,CAAC,IAAI,CAAC,CAKf;AAwCD,wBAAsB,0BAA0B,CAC9C,YAAY,EAAE,MAAM,EACpB,GAAG,EAAE,UAAU,GACd,OAAO,CAAC,2BAA2B,CAAC,CAgGtC;AAED,wBAAsB,wBAAwB,CAAC,KAAK,EAAE,MAAM,iBAQ3D;AAED,wBAAgB,iCAAiC,CAAC,MAAM,CAAC,EAAE,WAAW,QAMrE"}
@@ -1,29 +1,30 @@
1
1
  import { serializeSkillsForRemote as x } from "@inupedia/spotlight-client";
2
2
  import { getSkillsPoolForRun as E } from "../skills/index.js";
3
3
  import { useAgentSessionStore as R } from "../session/agentSession.js";
4
- import { useSpotlightRuntimeStore as A } from "../store/runtimeStore.js";
4
+ import { useSpotlightMemoryPreferenceStore as A } from "../store/memoryPreferenceStore.js";
5
+ import { useSpotlightRuntimeStore as L } from "../store/runtimeStore.js";
5
6
  import { SPOTLIGHT_PIPELINE_STEP_IDS as r } from "../store/pipeline/constants.js";
6
- import { isLoopPlanningChunk as L, splitIntentStepContent as $, splitToolStepContent as O, composeToolStepContent as H } from "../store/pipeline/displayText.js";
7
+ import { isLoopPlanningChunk as $, splitIntentStepContent as O, splitToolStepContent as H, composeToolStepContent as M } from "../store/pipeline/displayText.js";
7
8
  import { getSpotlightConfig as F } from "../plugin.js";
8
- import { executeRemoteHostTool as M, ensureHostToolsManifest as _ } from "./hostToolRunner.js";
9
- import { getSpotlightServerBase as h, buildSpotlightJsonHeaders as S, getSpotlightProjectId as q } from "./httpConfig.js";
10
- import { ensureSpotlightMeta as J } from "./meta.js";
9
+ import { executeRemoteHostTool as q, ensureHostToolsManifest as _ } from "./hostToolRunner.js";
10
+ import { getSpotlightServerBase as h, buildSpotlightJsonHeaders as y, getSpotlightProjectId as J } from "./httpConfig.js";
11
+ import { ensureSpotlightMeta as W } from "./meta.js";
11
12
  const g = /* @__PURE__ */ new WeakMap();
12
- function W(e) {
13
+ function D(e) {
13
14
  return e.type !== "host_action_request" && e.type !== "run_completed" && e.type !== "run_error" && e.type !== "ping";
14
15
  }
15
16
  function a(e, t, o) {
16
- const s = e.getSteps().find((l) => l.id === t);
17
+ const s = e.getSteps().find((n) => n.id === t);
17
18
  if (s) return s;
18
- const n = { id: t, label: o, status: "pending" };
19
- return e.setSteps([...e.getSteps(), n]), n;
19
+ const l = { id: t, label: o, status: "pending" };
20
+ return e.setSteps([...e.getSteps(), l]), l;
20
21
  }
21
- function D() {
22
+ function j() {
22
23
  return new Promise((e) => {
23
24
  requestAnimationFrame(() => e());
24
25
  });
25
26
  }
26
- function j(e) {
27
+ function U(e) {
27
28
  const t = e.summary?.trim();
28
29
  if (t && t.length > 48 && !t.startsWith("{") && !t.startsWith("["))
29
30
  return t;
@@ -35,8 +36,8 @@ function j(e) {
35
36
  }
36
37
  return t || "";
37
38
  }
38
- function U(e) {
39
- const t = j(e.result);
39
+ function z(e) {
40
+ const t = U(e.result);
40
41
  return {
41
42
  id: e.result.call.id,
42
43
  name: e.result.call.name,
@@ -49,7 +50,7 @@ function U(e) {
49
50
  status: e.result.success ? "done" : "error"
50
51
  };
51
52
  }
52
- function z(e) {
53
+ function G(e) {
53
54
  return {
54
55
  id: e.call.id,
55
56
  name: e.call.name,
@@ -58,7 +59,7 @@ function z(e) {
58
59
  status: "running"
59
60
  };
60
61
  }
61
- function G(e, t) {
62
+ function B(e, t) {
62
63
  const o = t.success ? "前端操作已执行。" : t.error || "前端操作执行失败。";
63
64
  return {
64
65
  id: e.id,
@@ -72,13 +73,13 @@ function G(e, t) {
72
73
  status: t.success ? "done" : "error"
73
74
  };
74
75
  }
75
- function B(e) {
76
+ function Q(e) {
76
77
  return e.startsWith("panel.") || e.startsWith("navigate.") || e.startsWith("session.");
77
78
  }
78
- function Q(e, t, o) {
79
- if (!B(t.request.call.name)) return;
79
+ function V(e, t, o) {
80
+ if (!Q(t.request.call.name)) return;
80
81
  a(e, r.tool, "执行工具与回答");
81
- const s = G(t.request.call, o);
82
+ const s = B(t.request.call, o);
82
83
  e.appendToolCallsToStep(r.tool, [s]), e.setStep(
83
84
  r.tool,
84
85
  o.success ? "done" : "error",
@@ -93,7 +94,7 @@ function p(e, t) {
93
94
  function w(e, t) {
94
95
  return t || (e === r.tool ? "执行工具与回答" : e);
95
96
  }
96
- async function V(e, t) {
97
+ async function Y(e, t) {
97
98
  if (t.type !== "ping") {
98
99
  if (t.type === "step_sync")
99
100
  e.setSteps(
@@ -108,25 +109,25 @@ async function V(e, t) {
108
109
  a(e, t.stepId, t.label ?? t.stepId), e.setStep(t.stepId, t.status, t.content);
109
110
  else if (t.type === "step_content") {
110
111
  let o = t.stepId, s = t.content;
111
- if (o === r.intent && L(s))
112
+ if (o === r.intent && $(s))
112
113
  o = r.tool;
113
114
  else if (o === r.intent && t.mode === "replace") {
114
- const { intent: n, misplacedPlanning: l } = $(s);
115
- s = n, l.trim() && (a(e, r.tool, "执行工具与回答"), e.appendChunkToStep(
115
+ const { intent: l, misplacedPlanning: n } = O(s);
116
+ s = l, n.trim() && (a(e, r.tool, "执行工具与回答"), e.appendChunkToStep(
116
117
  r.tool,
117
- l
118
+ n
118
119
  ));
119
120
  }
120
121
  a(e, o, w(o, t.label)), t.mode === "replace" ? e.setStep(
121
122
  o,
122
- e.getSteps().find((n) => n.id === o)?.status ?? "active",
123
+ e.getSteps().find((l) => l.id === o)?.status ?? "active",
123
124
  s
124
- ) : (p(e, o), e.appendChunkToStep(o, s), await D());
125
+ ) : (p(e, o), e.appendChunkToStep(o, s), await j());
125
126
  } else if (t.type === "step_artifact")
126
127
  a(e, t.stepId, w(t.stepId, t.label)), p(e, t.stepId), t.artifact === "tool_calls" && t.toolCalls?.length ? e.appendToolCallsToStep(t.stepId, t.toolCalls) : t.artifact === "attachments" && t.attachments?.length ? e.appendAttachmentsToStep(t.stepId, t.attachments) : t.artifact === "files" && t.files?.length ? e.appendFilesToStep(t.stepId, t.files) : t.artifact === "artifacts" && t.artifacts?.length ? e.appendArtifactsToStep(t.stepId, t.artifacts) : t.artifact === "chat_items" && t.chatItems?.length && e.appendChatItemsToStep(t.stepId, t.chatItems);
127
128
  else if (t.type === "tool_start")
128
129
  a(e, r.tool, "执行工具与回答"), p(e, r.tool), e.appendToolCallsToStep(r.tool, [
129
- z(t)
130
+ G(t)
130
131
  ]);
131
132
  else if (t.type === "tool_progress")
132
133
  a(e, r.tool, "执行工具与回答"), p(e, r.tool), e.appendToolCallsToStep(r.tool, [
@@ -141,7 +142,7 @@ async function V(e, t) {
141
142
  ]);
142
143
  else if (t.type === "tool_result")
143
144
  a(e, r.tool, "执行工具与回答"), p(e, r.tool), e.appendToolCallsToStep(r.tool, [
144
- U(t)
145
+ z(t)
145
146
  ]), t.result.attachments?.length && e.appendAttachmentsToStep(
146
147
  r.tool,
147
148
  t.result.attachments
@@ -176,24 +177,24 @@ async function V(e, t) {
176
177
  ));
177
178
  else if (t.type === "assistant_response") {
178
179
  a(e, r.tool, "执行工具与回答");
179
- const o = e.getSteps().find((u) => u.id === r.tool), { planning: s, answer: n } = O(o?.content ?? ""), l = t.content.trim(), c = n.trim();
180
- c && l && (c === l || l.startsWith(
180
+ const o = e.getSteps().find((u) => u.id === r.tool), { planning: s, answer: l } = H(o?.content ?? ""), n = t.content.trim(), c = l.trim();
181
+ c && n && (c === n || n.startsWith(
181
182
  c.slice(0, Math.min(c.length, 80))
182
183
  )) ? e.setStep(r.tool, "done") : e.setStep(
183
184
  r.tool,
184
185
  "done",
185
- H(s, l)
186
+ M(s, n)
186
187
  );
187
188
  }
188
- W(t) && e.appendExecutionEvent?.(t);
189
+ D(t) && e.appendExecutionEvent?.(t);
189
190
  }
190
191
  }
191
- async function Y(e) {
192
+ async function K(e) {
192
193
  await fetch(
193
194
  `${h()}/v1/runs/${encodeURIComponent(e.runId)}/host-results`,
194
195
  {
195
196
  method: "POST",
196
- headers: S(),
197
+ headers: y(),
197
198
  body: JSON.stringify({
198
199
  correlationId: e.correlationId,
199
200
  success: e.result.success,
@@ -206,30 +207,30 @@ async function Y(e) {
206
207
  }
207
208
  );
208
209
  }
209
- function K(e) {
210
+ function X(e) {
210
211
  const t = e.split(/\n\n/u), o = t.pop() ?? "";
211
- return { events: t.flatMap((n) => {
212
- const l = n.split(/\n/u).find((c) => c.startsWith("data: "));
213
- if (!l) return [];
212
+ return { events: t.flatMap((l) => {
213
+ const n = l.split(/\n/u).find((c) => c.startsWith("data: "));
214
+ if (!n) return [];
214
215
  try {
215
- return [JSON.parse(l.slice(6))];
216
+ return [JSON.parse(n.slice(6))];
216
217
  } catch {
217
218
  return [];
218
219
  }
219
220
  }), rest: o };
220
221
  }
221
- async function at(e) {
222
+ async function ut(e) {
222
223
  await Promise.allSettled([
223
224
  _(e),
224
- J(e)
225
+ W(e)
225
226
  ]);
226
227
  }
227
- async function X(e, t) {
228
- const o = R(), s = A(), n = await _(t);
228
+ async function Z(e, t) {
229
+ const o = R(), s = L(), l = A(), n = await _(t);
229
230
  return {
230
231
  hostManifest: n,
231
232
  payload: {
232
- projectId: q(),
233
+ projectId: J(),
233
234
  sessionId: o.sessionId,
234
235
  userQuestion: e,
235
236
  uiContext: F().getUiContext?.() ?? {},
@@ -243,7 +244,8 @@ async function X(e, t) {
243
244
  conversationHistory: o.conversationHistory,
244
245
  lastAssistantReply: o.getLastAssistantContent(),
245
246
  invokedSkills: o.invokedSkills,
246
- skillPermissionGrants: o.skillPermissionGrants
247
+ skillPermissionGrants: o.skillPermissionGrants,
248
+ memoryEnabled: l.memoryEnabled
247
249
  },
248
250
  runtimeState: {
249
251
  activeDomain: s.activeDomain,
@@ -257,14 +259,14 @@ async function X(e, t) {
257
259
  }
258
260
  };
259
261
  }
260
- async function ct(e, t) {
261
- const o = h(), s = t.getSignal(), { payload: n, hostManifest: l } = await X(
262
+ async function dt(e, t) {
263
+ const o = h(), s = t.getSignal(), { payload: l, hostManifest: n } = await Z(
262
264
  e,
263
265
  s
264
- ), c = new Set(l.tools.map((d) => d.name)), u = await fetch(`${o}/v1/runs`, {
266
+ ), c = new Set(n.tools.map((d) => d.name)), u = await fetch(`${o}/v1/runs`, {
265
267
  method: "POST",
266
- headers: S(),
267
- body: JSON.stringify(n),
268
+ headers: y(),
269
+ body: JSON.stringify(l),
268
270
  signal: s
269
271
  });
270
272
  if (!u.ok) {
@@ -284,28 +286,28 @@ async function ct(e, t) {
284
286
  const f = await fetch(
285
287
  `${o}/v1/runs/${encodeURIComponent(m)}/events`,
286
288
  {
287
- headers: S(),
289
+ headers: y(),
288
290
  signal: s
289
291
  }
290
292
  );
291
293
  if (!f.ok || !f.body)
292
294
  throw new Error(`Spotlight 后端事件流连接失败:${f.status}`);
293
295
  const T = f.body.getReader(), P = new TextDecoder();
294
- let y = "", k = null;
296
+ let S = "", k = null;
295
297
  try {
296
298
  for (; ; ) {
297
299
  const { done: d, value: N } = await T.read();
298
300
  if (d) break;
299
- y += P.decode(N, { stream: !0 });
300
- const C = K(y);
301
- y = C.rest;
301
+ S += P.decode(N, { stream: !0 });
302
+ const C = X(S);
303
+ S = C.rest;
302
304
  for (const i of C.events) {
303
305
  if (i.type === "host_action_request") {
304
- const I = await M(i.request.call, t, {
306
+ const I = await q(i.request.call, t, {
305
307
  allowedHostNames: c,
306
308
  hostEffect: i.request.hostEffect
307
309
  });
308
- Q(t, i, I), await Y({
310
+ V(t, i, I), await K({
309
311
  runId: m,
310
312
  correlationId: i.request.correlationId,
311
313
  result: I,
@@ -315,7 +317,7 @@ async function ct(e, t) {
315
317
  }
316
318
  if (i.type === "run_error")
317
319
  throw new Error(i.error);
318
- if (await V(t, i), i.type === "run_completed")
320
+ if (await Y(t, i), i.type === "run_completed")
319
321
  return i.sessionPatch?.invokedSkills && R().setInvokedSkills(
320
322
  i.sessionPatch.invokedSkills
321
323
  ), k = i, {
@@ -338,18 +340,18 @@ async function b(e) {
338
340
  `${h()}/v1/runs/${encodeURIComponent(e)}`,
339
341
  {
340
342
  method: "DELETE",
341
- headers: S()
343
+ headers: y()
342
344
  }
343
345
  );
344
346
  }
345
- function ut(e) {
347
+ function pt(e) {
346
348
  if (!e) return;
347
349
  const t = g.get(e);
348
350
  t && (g.delete(e), b(t));
349
351
  }
350
352
  export {
351
353
  b as cancelRemoteSpotlightRun,
352
- ut as cancelRemoteSpotlightRunForSignal,
353
- ct as runRemoteSpotlightPipeline,
354
- at as warmupSpotlightRemoteContext
354
+ pt as cancelRemoteSpotlightRunForSignal,
355
+ dt as runRemoteSpotlightPipeline,
356
+ ut as warmupSpotlightRemoteContext
355
357
  };
@@ -2,4 +2,5 @@ export { useSpotlightStore, SpotlightIntent, SPOTLIGHT_INTENT_LABELS, ProgressSu
2
2
  export { SpotlightCommandDomain, SpotlightCommandScope, type SpotlightCommand, type SpotlightCommandAction, type SpotlightCommandTarget, type SpotlightVideoChannelId, } from "./types.js";
3
3
  export { useSpotlightRuntimeStore } from "./runtimeStore.js";
4
4
  export { useAgentSessionStore } from "../session/agentSession.js";
5
+ export { useSpotlightMemoryPreferenceStore, readSpotlightMemoryEnabled, } from "./memoryPreferenceStore.js";
5
6
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/store/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,iBAAiB,EACjB,eAAe,EACf,uBAAuB,EACvB,iBAAiB,EACjB,0BAA0B,EAC1B,mBAAmB,EACnB,4BAA4B,EAC5B,gBAAgB,EAChB,yBAAyB,EACzB,eAAe,EACf,wBAAwB,EACxB,iBAAiB,EACjB,KAAK,SAAS,EACd,KAAK,gBAAgB,EACrB,KAAK,eAAe,EACpB,KAAK,+BAA+B,GACrC,MAAM,qBAAqB,CAAC;AAE7B,OAAO,EACL,sBAAsB,EACtB,qBAAqB,EACrB,KAAK,gBAAgB,EACrB,KAAK,sBAAsB,EAC3B,KAAK,sBAAsB,EAC3B,KAAK,uBAAuB,GAC7B,MAAM,YAAY,CAAC;AAEpB,OAAO,EAAE,wBAAwB,EAAE,MAAM,mBAAmB,CAAC;AAC7D,OAAO,EAAE,oBAAoB,EAAE,MAAM,4BAA4B,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/store/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,iBAAiB,EACjB,eAAe,EACf,uBAAuB,EACvB,iBAAiB,EACjB,0BAA0B,EAC1B,mBAAmB,EACnB,4BAA4B,EAC5B,gBAAgB,EAChB,yBAAyB,EACzB,eAAe,EACf,wBAAwB,EACxB,iBAAiB,EACjB,KAAK,SAAS,EACd,KAAK,gBAAgB,EACrB,KAAK,eAAe,EACpB,KAAK,+BAA+B,GACrC,MAAM,qBAAqB,CAAC;AAE7B,OAAO,EACL,sBAAsB,EACtB,qBAAqB,EACrB,KAAK,gBAAgB,EACrB,KAAK,sBAAsB,EAC3B,KAAK,sBAAsB,EAC3B,KAAK,uBAAuB,GAC7B,MAAM,YAAY,CAAC;AAEpB,OAAO,EAAE,wBAAwB,EAAE,MAAM,mBAAmB,CAAC;AAC7D,OAAO,EAAE,oBAAoB,EAAE,MAAM,4BAA4B,CAAC;AAClE,OAAO,EACL,iCAAiC,EACjC,0BAA0B,GAC3B,MAAM,4BAA4B,CAAC"}
@@ -1,22 +1,25 @@
1
- import { useSpotlightStore as e } from "./spotlightStore.js";
2
- import { INVESTMENT_SUB_INTENT_LABELS as n, InvestmentSubIntent as T, PROGRESS_SUB_INTENT_LABELS as I, ProgressSubIntent as _, QUALITY_SUB_INTENT_LABELS as E, QualitySubIntent as N, SAFETY_SUB_INTENT_LABELS as r, SPOTLIGHT_INTENT_LABELS as L, SUB_INTENT_CONFIG as m, SafetySubIntent as p, SpotlightCommandDomain as B, SpotlightCommandScope as i, SpotlightIntent as u } from "./types.js";
3
- import { useSpotlightRuntimeStore as A } from "./runtimeStore.js";
4
- import { useAgentSessionStore as l } from "../session/agentSession.js";
1
+ import { useSpotlightStore as S } from "./spotlightStore.js";
2
+ import { INVESTMENT_SUB_INTENT_LABELS as r, InvestmentSubIntent as n, PROGRESS_SUB_INTENT_LABELS as T, ProgressSubIntent as E, QUALITY_SUB_INTENT_LABELS as I, QualitySubIntent as _, SAFETY_SUB_INTENT_LABELS as N, SPOTLIGHT_INTENT_LABELS as m, SUB_INTENT_CONFIG as p, SafetySubIntent as L, SpotlightCommandDomain as i, SpotlightCommandScope as u, SpotlightIntent as B } from "./types.js";
3
+ import { useSpotlightRuntimeStore as l } from "./runtimeStore.js";
4
+ import { useAgentSessionStore as A } from "../session/agentSession.js";
5
+ import { readSpotlightMemoryEnabled as f, useSpotlightMemoryPreferenceStore as h } from "./memoryPreferenceStore.js";
5
6
  export {
6
- n as INVESTMENT_SUB_INTENT_LABELS,
7
- T as InvestmentSubIntent,
8
- I as PROGRESS_SUB_INTENT_LABELS,
9
- _ as ProgressSubIntent,
10
- E as QUALITY_SUB_INTENT_LABELS,
11
- N as QualitySubIntent,
12
- r as SAFETY_SUB_INTENT_LABELS,
13
- L as SPOTLIGHT_INTENT_LABELS,
14
- m as SUB_INTENT_CONFIG,
15
- p as SafetySubIntent,
16
- B as SpotlightCommandDomain,
17
- i as SpotlightCommandScope,
18
- u as SpotlightIntent,
19
- l as useAgentSessionStore,
20
- A as useSpotlightRuntimeStore,
21
- e as useSpotlightStore
7
+ r as INVESTMENT_SUB_INTENT_LABELS,
8
+ n as InvestmentSubIntent,
9
+ T as PROGRESS_SUB_INTENT_LABELS,
10
+ E as ProgressSubIntent,
11
+ I as QUALITY_SUB_INTENT_LABELS,
12
+ _ as QualitySubIntent,
13
+ N as SAFETY_SUB_INTENT_LABELS,
14
+ m as SPOTLIGHT_INTENT_LABELS,
15
+ p as SUB_INTENT_CONFIG,
16
+ L as SafetySubIntent,
17
+ i as SpotlightCommandDomain,
18
+ u as SpotlightCommandScope,
19
+ B as SpotlightIntent,
20
+ f as readSpotlightMemoryEnabled,
21
+ A as useAgentSessionStore,
22
+ h as useSpotlightMemoryPreferenceStore,
23
+ l as useSpotlightRuntimeStore,
24
+ S as useSpotlightStore
22
25
  };
@@ -0,0 +1,19 @@
1
+ /** 用户是否启用 Gate + Agent 文件记忆(持久化到 localStorage)。 */
2
+ export declare const useSpotlightMemoryPreferenceStore: import("pinia").StoreDefinition<"spotlightMemoryPreference", Pick<{
3
+ enabled: import("vue").Ref<boolean, boolean>;
4
+ memoryEnabled: import("vue").ComputedRef<boolean>;
5
+ setEnabled(value: boolean): void;
6
+ toggle(): void;
7
+ }, "enabled">, Pick<{
8
+ enabled: import("vue").Ref<boolean, boolean>;
9
+ memoryEnabled: import("vue").ComputedRef<boolean>;
10
+ setEnabled(value: boolean): void;
11
+ toggle(): void;
12
+ }, "memoryEnabled">, Pick<{
13
+ enabled: import("vue").Ref<boolean, boolean>;
14
+ memoryEnabled: import("vue").ComputedRef<boolean>;
15
+ setEnabled(value: boolean): void;
16
+ toggle(): void;
17
+ }, "toggle" | "setEnabled">>;
18
+ export declare function readSpotlightMemoryEnabled(): boolean;
19
+ //# sourceMappingURL=memoryPreferenceStore.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"memoryPreferenceStore.d.ts","sourceRoot":"","sources":["../../src/store/memoryPreferenceStore.ts"],"names":[],"mappings":"AAeA,mDAAmD;AACnD,eAAO,MAAM,iCAAiC;;;sBAoBtB,OAAO;;;;;sBAAP,OAAO;;;;;sBAAP,OAAO;;4BAQ9B,CAAC;AAEF,wBAAgB,0BAA0B,IAAI,OAAO,CAEpD"}