@inupedia/spotlight-vue 0.7.0 → 0.7.1

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.
@@ -8,8 +8,8 @@ interface BorderBeamProps {
8
8
  delay?: number;
9
9
  }
10
10
  declare const __VLS_export: import("vue").DefineComponent<BorderBeamProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<BorderBeamProps> & Readonly<{}>, {
11
- anchor: number;
12
11
  size: number;
12
+ anchor: number;
13
13
  duration: number;
14
14
  borderWidth: number;
15
15
  colorFrom: string;
@@ -1 +1 @@
1
- {"version":3,"file":"OfficialBorderBeam.vue.d.ts","sourceRoot":"","sources":["../../src/components/OfficialBorderBeam.vue"],"names":[],"mappings":"AA2FA,UAAU,eAAe;IACvB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AA8DD,QAAA,MAAM,YAAY;YAlEP,MAAM;UAHR,MAAM;cACF,MAAM;iBACH,MAAM;eAER,MAAM;aACR,MAAM;WACR,MAAM;6EAkEd,CAAC;wBACkB,OAAO,YAAY;AAAxC,wBAAyC"}
1
+ {"version":3,"file":"OfficialBorderBeam.vue.d.ts","sourceRoot":"","sources":["../../src/components/OfficialBorderBeam.vue"],"names":[],"mappings":"AA2FA,UAAU,eAAe;IACvB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AA8DD,QAAA,MAAM,YAAY;UArET,MAAM;YAGJ,MAAM;cAFJ,MAAM;iBACH,MAAM;eAER,MAAM;aACR,MAAM;WACR,MAAM;6EAkEd,CAAC;wBACkB,OAAO,YAAY;AAAxC,wBAAyC"}
package/dist/config.d.ts CHANGED
@@ -23,6 +23,13 @@ export type SpotlightConfig = SpotlightClientConfig & {
23
23
  getUiContext?: () => AgentUiContext;
24
24
  /** Stable authenticated subject id. Omit to disable cross-session memory. */
25
25
  getMemorySubjectId?: () => string | null | undefined;
26
+ /** Required for high-risk or external-state Tools unless pre-approved by Turn policy. */
27
+ approveTool?: (request: {
28
+ name: string;
29
+ displayName: string;
30
+ input: Record<string, unknown>;
31
+ reason?: string;
32
+ }) => boolean | Promise<boolean>;
26
33
  /** Optional UI-only quick actions. */
27
34
  quickPanelActions?: SpotlightQuickPanelActions;
28
35
  /** Override suggested question chips (defaults use server ui-prompts). */
@@ -1 +1 @@
1
- {"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,cAAc,EACd,uBAAuB,EACvB,mCAAmC,EACnC,cAAc,EACf,MAAM,8BAA8B,CAAC;AACtC,OAAO,KAAK,EAAE,UAAU,EAAE,qBAAqB,EAAE,MAAM,4BAA4B,CAAC;AACpF,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AAC3D,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AAExD,MAAM,MAAM,eAAe,GAAG,qBAAqB,GAAG;IACpD,wDAAwD;IACxD,KAAK,EAAE,UAAU,EAAE,GAAG,CAAC,MAAM,UAAU,EAAE,CAAC,CAAC;IAC3C,gFAAgF;IAChF,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,uEAAuE;IACvE,MAAM,CAAC,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,IAAI;CAiDrE,CAAC;AAEF,OAAO,EACL,qBAAqB,EACrB,oBAAoB,EACpB,KAAK,eAAe,EACpB,KAAK,yBAAyB,EAC9B,KAAK,qBAAqB,GAC3B,CAAC"}
package/dist/plugin.js CHANGED
@@ -1,87 +1,78 @@
1
- import { createSpotlightHttp as c, createClientToolRegistry as g, createSpotlightAppClient as d, createClientToolManifest as h } from "@inupedia/spotlight-client";
2
- import { defineSpotlightConfig as S, SPOTLIGHT_CONFIG_KEY as m } from "./config.js";
3
- import { mountSpotlightShell as I, unmountSpotlightShellForTests as T } from "./mountShell.js";
4
- import { spotlightSkillToolNames as v } from "@inupedia/spotlight-protocol";
5
- const C = /* @__PURE__ */ Symbol("spotlight-http"), y = /* @__PURE__ */ Symbol("spotlight-client-tools"), b = /* @__PURE__ */ Symbol("spotlight-app-client");
6
- let a = null, n = null, r = null, s = null;
1
+ import { createSpotlightHttp as g, createClientToolRegistry as c, createSpotlightAppClient as u, createClientToolManifest as h } from "@inupedia/spotlight-client";
2
+ import { defineSpotlightConfig as d, SPOTLIGHT_CONFIG_KEY as S } from "./config.js";
3
+ import { mountSpotlightShell as T, unmountSpotlightShellForTests as m } from "./mountShell.js";
4
+ const C = /* @__PURE__ */ Symbol("spotlight-http"), I = /* @__PURE__ */ Symbol("spotlight-client-tools"), v = /* @__PURE__ */ Symbol("spotlight-app-client");
5
+ let p = null, i = null, n = null, r = null;
7
6
  function f() {
8
- if (!a)
7
+ if (!p)
9
8
  throw new Error(
10
9
  "Spotlight is not installed. Call app.use(SpotlightVue, { config }) in main.ts"
11
10
  );
12
- return a;
11
+ return p;
13
12
  }
14
- function H() {
13
+ function P() {
14
+ if (!i) {
15
+ const o = f();
16
+ i = g(o);
17
+ }
18
+ return i;
19
+ }
20
+ function A() {
15
21
  if (!n) {
16
- const l = f();
22
+ const o = f(), l = typeof o.tools == "function" ? o.tools() : o.tools;
17
23
  n = c(l);
18
24
  }
19
25
  return n;
20
26
  }
21
- function L() {
22
- if (!r) {
23
- const l = f(), o = typeof l.tools == "function" ? l.tools() : l.tools;
24
- r = g(o);
25
- }
26
- return r;
27
- }
28
- function N() {
29
- if (!s)
27
+ function H() {
28
+ if (!r)
30
29
  throw new Error(
31
30
  "Spotlight App Client is not initialized. Call app.use(SpotlightVue, { config })"
32
31
  );
33
- return s;
32
+ return r;
34
33
  }
35
- function O() {
36
- T(), a = null, n = null, r = null, s = null;
34
+ function k() {
35
+ m(), p = null, i = null, n = null, r = null;
37
36
  }
38
- const K = {
39
- install(l, o) {
40
- const i = l, t = S(
41
- "config" in o && o.config ? o.config : o
42
- ), p = typeof t.tools == "function" ? t.tools() : t.tools;
43
- if (!Array.isArray(p) || p.length === 0)
37
+ const L = {
38
+ install(o, l) {
39
+ const e = o, t = d(
40
+ "config" in l && l.config ? l.config : l
41
+ ), s = typeof t.tools == "function" ? t.tools() : t.tools;
42
+ if (!Array.isArray(s) || s.length === 0)
44
43
  throw new Error(
45
44
  "Spotlight config: at least one client tool is required after tools() resolves"
46
45
  );
47
- a = t, n = c(t), r = g(p);
48
- const u = t.frontendBuildId?.trim() || "development";
49
- s = d({
46
+ p = t, i = g(t), n = c(s);
47
+ const a = t.frontendBuildId?.trim() || "development";
48
+ r = u({
50
49
  serverUrl: t.serverUrl,
51
50
  apiKey: t.apiKey,
52
51
  projectId: t.projectId,
53
52
  clientInfo: {
54
53
  name: "spotlight-vue",
55
54
  title: "Spotlight Vue",
56
- version: "0.7.0"
55
+ version: "0.7.1"
57
56
  },
58
57
  toolManifest: () => h({
59
58
  projectId: t.projectId,
60
- frontendBuildId: u,
61
- tools: p
59
+ frontendBuildId: a,
60
+ tools: s
62
61
  }),
63
- skills: () => (t.getSkillsForRun?.() ?? (typeof t.skills == "function" ? t.skills() : t.skills) ?? []).map((e) => ({
64
- name: e.name,
65
- displayName: e.interface?.displayName ?? e.displayName,
66
- description: e.description,
67
- version: e.version,
68
- allowImplicitInvocation: e.policy?.allowImplicitInvocation ?? e.disableModelInvocation !== !0,
69
- userInvocable: e.userInvocable,
70
- dependencies: { tools: v(e) }
71
- }))
72
- }), i.provide(m, t), i.provide(C, n), i.provide(y, r), i.provide(b, s), i.config.globalProperties.$spotlightEnabled = o.enabled !== !1, i.config.globalProperties.$spotlightAvatarEnabled = o.avatarEnabled === !0, I(i, o);
62
+ skills: () => t.getSkillsForRun?.() ?? (typeof t.skills == "function" ? t.skills() : t.skills) ?? []
63
+ }), e.provide(S, t), e.provide(C, i), e.provide(I, n), e.provide(v, r), e.config.globalProperties.$spotlightEnabled = l.enabled !== !1, e.config.globalProperties.$spotlightAvatarEnabled = l.avatarEnabled === !0, T(e, l);
73
64
  }
74
65
  };
75
66
  export {
76
- b as SPOTLIGHT_APP_CLIENT_KEY,
77
- y as SPOTLIGHT_CLIENT_TOOLS_KEY,
78
- m as SPOTLIGHT_CONFIG_KEY,
67
+ v as SPOTLIGHT_APP_CLIENT_KEY,
68
+ I as SPOTLIGHT_CLIENT_TOOLS_KEY,
69
+ S as SPOTLIGHT_CONFIG_KEY,
79
70
  C as SPOTLIGHT_HTTP_KEY,
80
- K as SpotlightVue,
81
- S as defineSpotlightConfig,
82
- N as getSpotlightAppClient,
83
- L as getSpotlightClientTools,
71
+ L as SpotlightVue,
72
+ d as defineSpotlightConfig,
73
+ H as getSpotlightAppClient,
74
+ A as getSpotlightClientTools,
84
75
  f as getSpotlightConfig,
85
- H as getSpotlightHttp,
86
- O as resetSpotlightRuntimeForTests
76
+ P as getSpotlightHttp,
77
+ k as resetSpotlightRuntimeForTests
87
78
  };
@@ -1 +1 @@
1
- {"version":3,"file":"runPipeline.d.ts","sourceRoot":"","sources":["../../src/remote/runPipeline.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,cAAc,EACd,uBAAuB,EACvB,kBAAkB,EAClB,mBAAmB,EACnB,kBAAkB,EAGlB,gBAAgB,EACjB,MAAM,8BAA8B,CAAC;AAetC,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,4BAA4B,CAAC;AAE7D,O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C,EACpB,MAAM,EAAE,OAAO,CAAC,UAAU,CAAC,OAAO,qBAAqB,CAAC,CAAC,EACzD,MAAM,CAAC,EAAE,cAAc,QAIxB;AAeD,wBAAgB,iBAAiB,CAAC,IAAI,CAAC,EAAE,UAAU,GAAG,MAAM,CAE3D;AAaD,wBAAgB,wBAAwB,CACtC,GAAG,EAAE,UAAU,EACf,KAAK,EAAE,OAAO,CAAC,uBAAuB,EAAE;IAAE,IAAI,EAAE,iBAAiB,CAAA;CAAE,CAAC,QA+DrE;AAED,wBAAsB,gBAAgB,CACpC,GAAG,EAAE,UAAU,EACf,KAAK,EAAE,cAAc,EACrB,MAAM,CAAC,EAAE,cAAc,iBAoLxB;AAsCD,yFAAyF;AACzF,wBAAsB,mBAAmB,CACvC,GAAG,EAAE,UAAU,EACf,KAAK,EAAE,kBAAkB,EACzB,MAAM,CAAC,EAAE,cAAc,GACtB,OAAO,CAAC,IAAI,CAAC,CAwFf;AAmFD,wBAAsB,4BAA4B,CAChD,MAAM,CAAC,EAAE,WAAW,GACnB,OAAO,CAAC,IAAI,CAAC,CAKf;AA6CD,wBAAsB,0BAA0B,CAC9C,YAAY,EAAE,MAAM,EACpB,GAAG,EAAE,UAAU,EACf,OAAO,CAAC,EAAE;IAAE,kBAAkB,CAAC,EAAE,OAAO,CAAA;CAAE,GACzC,OAAO,CAAC,2BAA2B,CAAC,CA0FtC;AAOD,wBAAsB,wBAAwB,CAAC,KAAK,EAAE,MAAM,iBAE3D;AAED,wBAAgB,iCAAiC,CAAC,MAAM,CAAC,EAAE,WAAW,QAMrE"}
@@ -1,105 +1,103 @@
1
- import { serializeSkillsForRemote as C } from "@inupedia/spotlight-client";
2
1
  import { useAgentSessionStore as g } from "../session/agentSession.js";
3
- import { useSpotlightMemoryPreferenceStore as N } from "../store/memoryPreferenceStore.js";
2
+ import { useSpotlightMemoryPreferenceStore as C } from "../store/memoryPreferenceStore.js";
4
3
  import { useSpotlightRuntimeStore as P } from "../store/runtimeStore.js";
5
- import { SPOTLIGHT_PIPELINE_STEP_IDS as l } from "../store/pipeline/constants.js";
6
- import { toolLaneStepId as R, resolveToolLane as b, toolLaneStepLabel as x } from "../store/pipeline/toolLane.js";
7
- import { getSpotlightAppClient as v, getSpotlightConfig as T } from "../plugin.js";
8
- import { getSkillsPoolForRun as E } from "../skills/index.js";
9
- import { executeRemoteHostTool as A, ensureHostToolsManifest as M } from "./hostToolRunner.js";
4
+ import { SPOTLIGHT_PIPELINE_STEP_IDS as i } from "../store/pipeline/constants.js";
5
+ import { toolLaneStepId as h, resolveToolLane as b, toolLaneStepLabel as x } from "../store/pipeline/toolLane.js";
6
+ import { getSpotlightAppClient as k, getSpotlightConfig as S } from "../plugin.js";
7
+ import { executeRemoteHostTool as E, ensureHostToolsManifest as A } from "./hostToolRunner.js";
10
8
  import { getSpotlightProjectId as _ } from "./httpConfig.js";
11
9
  import { ensureSpotlightMeta as L } from "./meta.js";
12
- const k = /* @__PURE__ */ new WeakMap();
13
- function f(t, o, s) {
14
- const e = t.getSteps().find((r) => r.id === o);
15
- if (e) return e;
16
- const n = { id: o, label: s, status: "pending" };
17
- return t.setSteps([...t.getSteps(), n]), n;
10
+ const R = /* @__PURE__ */ new WeakMap();
11
+ function f(e, o, r) {
12
+ const t = e.getSteps().find((a) => a.id === o);
13
+ if (t) return t;
14
+ const n = { id: o, label: r, status: "pending" };
15
+ return e.setSteps([...e.getSteps(), n]), n;
18
16
  }
19
- function j() {
20
- return new Promise((t) => {
21
- requestAnimationFrame(() => t());
17
+ function q() {
18
+ return new Promise((e) => {
19
+ requestAnimationFrame(() => e());
22
20
  });
23
21
  }
24
- function D(t) {
25
- return Array.isArray(t) ? t.flatMap((s, e) => {
26
- if (!s || typeof s != "object") return [];
27
- const n = s, r = typeof n.content == "string" ? n.content.trim() : "";
28
- if (!r) return [];
29
- const a = typeof n.title == "string" && n.title.trim() || typeof n.url == "string" && n.url.trim() || `资料 ${e + 1}`, u = typeof n.url == "string" ? n.url.trim() : "";
30
- return [[a, u && u !== a ? u : "", r].filter(Boolean).join(`
22
+ function M(e) {
23
+ return Array.isArray(e) ? e.flatMap((r, t) => {
24
+ if (!r || typeof r != "object") return [];
25
+ const n = r, a = typeof n.content == "string" ? n.content.trim() : "";
26
+ if (!a) return [];
27
+ const c = typeof n.title == "string" && n.title.trim() || typeof n.url == "string" && n.url.trim() || `资料 ${t + 1}`, u = typeof n.url == "string" ? n.url.trim() : "";
28
+ return [[c, u && u !== c ? u : "", a].filter(Boolean).join(`
31
29
  `)];
32
30
  }).join(`
33
31
 
34
32
  `) : "";
35
33
  }
36
- function H(t, o) {
37
- const s = o.success ? "前端操作已执行。" : o.error || "前端操作执行失败。";
34
+ function O(e, o) {
35
+ const r = o.success ? "前端操作已执行。" : o.error || "前端操作执行失败。";
38
36
  return {
39
- id: t.id,
40
- name: t.name,
41
- displayName: t.displayName,
42
- argsText: JSON.stringify(t.input ?? {}, null, 2),
43
- resultText: s,
44
- summary: s,
37
+ id: e.id,
38
+ name: e.name,
39
+ displayName: e.displayName,
40
+ argsText: JSON.stringify(e.input ?? {}, null, 2),
41
+ resultText: r,
42
+ summary: r,
45
43
  errorCode: o.errorCode,
46
44
  trace: o.trace,
47
45
  status: o.success ? "done" : "error"
48
46
  };
49
47
  }
50
- function B(t, o) {
51
- return b(t, o?.sideEffectByName?.get(t));
48
+ function j(e, o) {
49
+ return b(e, o?.sideEffectByName?.get(e));
52
50
  }
53
- function p(t, o, s) {
54
- const e = t.getSteps().find((n) => n.id === o);
55
- !e || e.status === "done" || e.status === "error" || t.setStep(o, "done", e.content ?? s);
51
+ function p(e, o, r) {
52
+ const t = e.getSteps().find((n) => n.id === o);
53
+ !t || t.status === "done" || t.status === "error" || e.setStep(o, "done", t.content ?? r);
56
54
  }
57
- function F(t, o) {
58
- p(t, l.understand);
59
- const s = R(o), e = x(o);
60
- f(t, s, e);
61
- const n = t.getSteps().find((r) => r.id === s);
62
- !n || n.status === "active" || n.status === "done" || t.setStep(s, "active", n.content);
55
+ function H(e, o) {
56
+ p(e, i.understand);
57
+ const r = h(o), t = x(o);
58
+ f(e, r, t);
59
+ const n = e.getSteps().find((a) => a.id === r);
60
+ !n || n.status === "active" || n.status === "done" || e.setStep(r, "active", n.content);
63
61
  }
64
- function h(t, o, s) {
65
- const e = B(o, s);
66
- return F(t, e), R(e);
62
+ function I(e, o, r) {
63
+ const t = j(o, r);
64
+ return H(e, t), h(t);
67
65
  }
68
- function q(t, o, s, e) {
69
- const n = h(t, o.name, e);
70
- t.appendToolCallsToStep(n, [H(o, s)]);
66
+ function B(e, o, r, t) {
67
+ const n = I(e, o.name, t);
68
+ e.appendToolCallsToStep(n, [O(o, r)]);
71
69
  }
72
- function S(t, o, s, e, n) {
73
- f(t, o, s), t.setStep(o, e, n);
70
+ function v(e, o, r, t, n) {
71
+ f(e, o, r), e.setStep(o, t, n);
74
72
  }
75
- function O(t) {
76
- const o = t.status === "completed" ? "done" : t.status === "failed" ? "error" : "running";
77
- return t.type === "knowledge_search" ? {
78
- id: t.id,
79
- name: t.tool,
80
- displayName: t.displayName,
81
- argsText: JSON.stringify({ query: t.query }, null, 2),
82
- resultText: D(t.result),
83
- summary: t.summary,
73
+ function D(e) {
74
+ const o = e.status === "completed" ? "done" : e.status === "failed" ? "error" : "running";
75
+ return e.type === "knowledge_search" ? {
76
+ id: e.id,
77
+ name: e.tool,
78
+ displayName: e.displayName,
79
+ argsText: JSON.stringify({ query: e.query }, null, 2),
80
+ resultText: M(e.result),
81
+ summary: e.summary,
84
82
  status: o
85
83
  } : {
86
- id: t.id,
87
- name: t.tool,
88
- displayName: t.displayName,
89
- argsText: JSON.stringify(t.arguments ?? {}, null, 2),
90
- resultText: t.result === void 0 ? void 0 : typeof t.result == "string" ? t.result : JSON.stringify(t.result, null, 2),
91
- summary: t.summary ?? t.error?.message,
92
- errorCode: t.error?.code,
93
- trace: t.trace,
84
+ id: e.id,
85
+ name: e.tool,
86
+ displayName: e.displayName,
87
+ argsText: JSON.stringify(e.arguments ?? {}, null, 2),
88
+ resultText: e.result === void 0 ? void 0 : typeof e.result == "string" ? e.result : JSON.stringify(e.result, null, 2),
89
+ summary: e.summary ?? e.error?.message,
90
+ errorCode: e.error?.code,
91
+ trace: e.trace,
94
92
  status: o
95
93
  };
96
94
  }
97
- async function z(t, o, s) {
95
+ async function F(e, o, r) {
98
96
  if (o.type !== "ping") {
99
97
  if (o.type === "turn.started") {
100
- S(
101
- t,
102
- l.understand,
98
+ v(
99
+ e,
100
+ i.understand,
103
101
  "理解问题",
104
102
  "active",
105
103
  "正在理解您的问题。"
@@ -107,91 +105,91 @@ async function z(t, o, s) {
107
105
  return;
108
106
  }
109
107
  if (o.type === "item.started" || o.type === "item.updated" || o.type === "item.completed") {
110
- const e = o.item;
111
- if (e.type === "reasoning") {
112
- if (e.category === "routing" || e.category === "memory")
113
- S(
114
- t,
115
- l.understand,
108
+ const t = o.item;
109
+ if (t.type === "reasoning") {
110
+ if (t.category === "routing" || t.category === "memory")
111
+ v(
112
+ e,
113
+ i.understand,
116
114
  "理解问题",
117
115
  o.type === "item.completed" ? "done" : "active",
118
- e.summary
116
+ t.summary
119
117
  );
120
118
  else {
121
- const n = /页面|操作|执行/u.test(e.summary), r = n ? l.act : l.gather;
122
- f(t, r, n ? "操作页面" : "获取信息"), t.setStep(
123
- r,
119
+ const n = /页面|操作|执行/u.test(t.summary), a = n ? i.act : i.gather;
120
+ f(e, a, n ? "操作页面" : "获取信息"), e.setStep(
121
+ a,
124
122
  o.type === "item.completed" ? "done" : "active",
125
- e.summary
123
+ t.summary
126
124
  );
127
125
  }
128
126
  return;
129
127
  }
130
- if (e.type === "skill_use") {
131
- const n = "skills", r = f(t, n, "使用 Skill"), a = `- ${e.displayName}${e.skill === e.displayName ? "" : `(${e.skill})`}`, u = r.content?.includes(a) ? r.content : [r.content, a].filter(Boolean).join(`
128
+ if (t.type === "skill_use") {
129
+ const n = "skills", a = f(e, n, "使用 Skill"), c = `- ${t.displayName}${t.skill === t.displayName ? "" : `(${t.skill})`}`, u = a.content?.includes(c) ? a.content : [a.content, c].filter(Boolean).join(`
132
130
  `);
133
- t.setStep(n, e.status === "failed" ? "error" : "done", u), g().setInvokedSkills([
131
+ e.setStep(n, t.status === "failed" ? "error" : "done", u), g().setInvokedSkills([
134
132
  ...g().invokedSkills.filter(
135
- (m) => m.skillName !== e.skill
133
+ (d) => d.skillName !== t.skill
136
134
  ),
137
- { skillName: e.skill, invokedAt: o.at }
135
+ { skillName: t.skill, invokedAt: o.at }
138
136
  ]);
139
137
  return;
140
138
  }
141
- if (e.type === "tool_call" || e.type === "knowledge_search") {
142
- const n = (e.type === "tool_call", e.tool), r = h(t, n, s);
143
- t.appendToolCallsToStep(r, [O(e)]), (e.status === "completed" || e.status === "failed") && p(t, r);
139
+ if (t.type === "tool_call" || t.type === "knowledge_search") {
140
+ const n = (t.type === "tool_call", t.tool), a = I(e, n, r);
141
+ e.appendToolCallsToStep(a, [D(t)]), (t.status === "completed" || t.status === "failed") && p(e, a);
144
142
  return;
145
143
  }
146
- if (e.type === "memory") {
147
- S(
148
- t,
149
- l.understand,
144
+ if (t.type === "memory") {
145
+ v(
146
+ e,
147
+ i.understand,
150
148
  "理解问题",
151
- e.action === "reuse" ? "done" : "active",
152
- e.summary
149
+ t.action === "reuse" ? "done" : "active",
150
+ t.summary
153
151
  );
154
152
  return;
155
153
  }
156
- if (e.type === "agent_message") {
157
- p(t, l.understand), p(t, l.gather), p(t, l.act), f(t, l.answer, "回答"), t.setStep(l.answer, "done", e.text.trim());
154
+ if (t.type === "agent_message") {
155
+ p(e, i.understand), p(e, i.gather), p(e, i.act), f(e, i.answer, "回答"), e.setStep(i.answer, "done", t.text.trim());
158
156
  return;
159
157
  }
160
- e.type === "error" && t.setError(e.message);
158
+ t.type === "error" && e.setError(t.message);
161
159
  return;
162
160
  }
163
- o.type === "turn.failed" && t.setError(o.error.message);
161
+ o.type === "turn.failed" && e.setError(o.error.message);
164
162
  }
165
163
  }
166
- async function ot(t) {
164
+ async function ee(e) {
167
165
  await Promise.allSettled([
168
- v().initialize(t),
169
- L(t)
166
+ k().initialize(e),
167
+ L(e)
170
168
  ]);
171
169
  }
172
- async function J(t, o, s) {
173
- const e = g(), n = P(), r = N(), a = await M();
170
+ async function J(e, o, r) {
171
+ const t = g(), n = P(), a = C();
174
172
  return {
175
- hostManifest: a,
173
+ hostManifest: await A(),
176
174
  payload: {
177
175
  projectId: _(),
178
- input: t,
179
- memorySubjectId: T().getMemorySubjectId?.() ?? void 0,
180
- memoryRefreshRequested: s?.forceMemoryRefresh === !0,
181
- uiContext: T().getUiContext?.() ?? {},
176
+ input: e,
177
+ memorySubjectId: S().getMemorySubjectId?.() ?? void 0,
178
+ memoryRefreshRequested: r?.forceMemoryRefresh === !0,
179
+ uiContext: S().getUiContext?.() ?? {},
182
180
  sessionState: {
183
- sessionId: e.sessionId,
184
- activeTaskId: e.activeTaskId,
185
- activeTopic: e.activeTopic,
186
- pendingTask: e.pendingTask,
187
- conversationSummary: e.conversationSummary,
188
- summarizedTurnCount: e.summarizedTurnCount,
189
- conversationHistory: e.conversationHistory,
190
- lastAssistantReply: e.getLastAssistantContent(),
191
- invokedSkills: e.invokedSkills,
192
- skillPermissionGrants: e.skillPermissionGrants,
193
- memoryEnabled: r.enabled,
194
- memoryReadEnabled: r.enabled,
181
+ sessionId: t.sessionId,
182
+ activeTaskId: t.activeTaskId,
183
+ activeTopic: t.activeTopic,
184
+ pendingTask: t.pendingTask,
185
+ conversationSummary: t.conversationSummary,
186
+ summarizedTurnCount: t.summarizedTurnCount,
187
+ conversationHistory: t.conversationHistory,
188
+ lastAssistantReply: t.getLastAssistantContent(),
189
+ invokedSkills: t.invokedSkills,
190
+ skillPermissionGrants: t.skillPermissionGrants,
191
+ memoryEnabled: a.enabled,
192
+ memoryReadEnabled: a.enabled,
195
193
  memoryWriteEnabled: !0
196
194
  },
197
195
  runtimeState: {
@@ -200,80 +198,83 @@ async function J(t, o, s) {
200
198
  activeAction: n.activeAction,
201
199
  resumableAction: n.resumableAction,
202
200
  lastResolvedTarget: n.lastResolvedTarget
203
- },
204
- clientToolsManifestVersion: a.manifestDigest,
205
- clientToolManifest: a,
206
- skills: C(E()),
207
- frontendBuildId: a.frontendBuildId,
208
- manifestDigest: a.manifestDigest
201
+ }
209
202
  }
210
203
  };
211
204
  }
212
- async function nt(t, o, s) {
213
- const e = o.getSignal(), { payload: n, hostManifest: r } = await J(
214
- t,
205
+ async function te(e, o, r) {
206
+ const t = o.getSignal(), { payload: n, hostManifest: a } = await J(
215
207
  e,
216
- s
217
- ), a = new Set(r.tools.map((i) => i.name)), u = {
208
+ t,
209
+ r
210
+ ), c = new Set(a.tools.map((s) => s.name)), u = {
218
211
  sideEffectByName: new Map(
219
- r.tools.map((i) => [i.name, i.sideEffect])
212
+ a.tools.map((s) => [s.name, s.sideEffect])
220
213
  )
221
- }, m = v(), I = g(), w = await m.startThread(I.sessionId, e), y = await m.startTurn(w.id, n, e);
222
- e && (k.set(e, y.id), e.addEventListener(
214
+ }, d = k(), w = g(), N = await d.startThread(w.sessionId, t), y = await d.startTurn(N.id, n, t);
215
+ t && (R.set(t, y.id), t.addEventListener(
223
216
  "abort",
224
217
  () => {
225
- m.cancelTurn(y.id);
218
+ d.cancelTurn(y.id);
226
219
  },
227
220
  { once: !0 }
228
221
  ));
229
- for await (const i of m.streamTurn(y.id, e)) {
230
- if (await z(o, i, u), (i.type === "item.started" || i.type === "item.updated") && i.item.type === "tool_call" && i.item.status === "waiting_for_client" && i.item.clientRequest) {
231
- const d = {
232
- id: i.item.id,
233
- name: i.item.tool,
234
- input: i.item.arguments,
235
- displayName: i.item.displayName
236
- }, c = await A(d, o, {
237
- allowedHostNames: a
238
- });
239
- q(o, d, c, u), await m.submitToolResult(y.id, {
240
- correlationId: i.item.clientRequest.correlationId,
241
- success: c.success,
242
- output: c.data,
243
- error: c.error,
244
- errorCode: c.errorCode,
245
- trace: c.trace,
246
- uiContext: T().getUiContext?.() ?? void 0
247
- }, e);
222
+ for await (const s of d.streamTurn(y.id, t)) {
223
+ if (await F(o, s, u), (s.type === "item.started" || s.type === "item.updated") && s.item.type === "tool_call" && s.item.status === "waiting_for_client" && s.item.clientRequest) {
224
+ const l = {
225
+ id: s.item.id,
226
+ name: s.item.tool,
227
+ input: s.item.arguments,
228
+ displayName: s.item.displayName
229
+ }, m = !(s.item.clientRequest.approvalRequired === !0) || !!await S().approveTool?.({
230
+ name: l.name,
231
+ displayName: l.displayName,
232
+ input: l.input,
233
+ reason: s.item.clientRequest.approvalReason
234
+ }) ? await E(l, o, { allowedHostNames: c }) : {
235
+ success: !1,
236
+ error: "Tool execution was not approved",
237
+ errorCode: "TOOL_APPROVAL_REQUIRED",
238
+ trace: []
239
+ };
240
+ B(o, l, m, u), await d.submitToolResult(y.id, {
241
+ correlationId: s.item.clientRequest.correlationId,
242
+ success: m.success,
243
+ output: m.data,
244
+ error: m.error,
245
+ errorCode: m.errorCode,
246
+ trace: m.trace,
247
+ uiContext: S().getUiContext?.() ?? void 0
248
+ }, t);
248
249
  continue;
249
250
  }
250
- if (await j(), i.type === "turn.failed")
251
- throw new Error(i.error.message);
252
- if (i.type === "turn.completed") {
253
- const d = i.metadata ?? {}, c = d.sessionPatch;
254
- return c && I.applySessionPatch(c), {
251
+ if (await q(), s.type === "turn.failed")
252
+ throw new Error(s.error.message);
253
+ if (s.type === "turn.completed") {
254
+ const l = s.metadata ?? {}, T = l.sessionPatch;
255
+ return T && w.applySessionPatch(T), {
255
256
  command: null,
256
- memoryReplay: d.memoryReplay ?? null,
257
- memoryDecision: d.memoryDecision ?? null,
258
- assistantReply: i.finalResponse
257
+ memoryReplay: l.memoryReplay ?? null,
258
+ memoryDecision: l.memoryDecision ?? null,
259
+ assistantReply: s.finalResponse
259
260
  };
260
261
  }
261
262
  }
262
263
  return { command: null };
263
264
  }
264
- async function $(t) {
265
- await v().cancelTurn(t);
265
+ async function $(e) {
266
+ await k().cancelTurn(e);
266
267
  }
267
- function st(t) {
268
- if (!t) return;
269
- const o = k.get(t);
270
- o && (k.delete(t), $(o));
268
+ function oe(e) {
269
+ if (!e) return;
270
+ const o = R.get(e);
271
+ o && (R.delete(e), $(o));
271
272
  }
272
273
  export {
273
- z as applyLifecycleEvent,
274
+ F as applyLifecycleEvent,
274
275
  $ as cancelRemoteSpotlightRun,
275
- st as cancelRemoteSpotlightRunForSignal,
276
- nt as runRemoteSpotlightPipeline,
277
- q as settleHostToolCall,
278
- ot as warmupSpotlightRemoteContext
276
+ oe as cancelRemoteSpotlightRunForSignal,
277
+ te as runRemoteSpotlightPipeline,
278
+ B as settleHostToolCall,
279
+ ee as warmupSpotlightRemoteContext
279
280
  };
@@ -1 +1 @@
1
- {"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../../src/store/pipeline/errors.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAC1C,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC;AAE5D,wBAAgB,kBAAkB,CAChC,GAAG,EAAE,IAAI,CAAC,UAAU,EAAE,UAAU,GAAG,SAAS,GAAG,UAAU,CAAC,EAC1D,GAAG,EAAE,MAAM,GACV,IAAI,CAQN;AAED,wBAAgB,iBAAiB,CAC/B,MAAM,EAAE,IAAI,CAAC,UAAU,EAAE,WAAW,GAAG,OAAO,GAAG,OAAO,CAAC,GACxD,MAAM,CAuCR"}
1
+ {"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../../src/store/pipeline/errors.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAC1C,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC;AAE5D,wBAAgB,kBAAkB,CAChC,GAAG,EAAE,IAAI,CAAC,UAAU,EAAE,UAAU,GAAG,SAAS,GAAG,UAAU,CAAC,EAC1D,GAAG,EAAE,MAAM,GACV,IAAI,CAQN;AAED,wBAAgB,iBAAiB,CAC/B,MAAM,EAAE,IAAI,CAAC,UAAU,EAAE,WAAW,GAAG,OAAO,GAAG,OAAO,CAAC,GACxD,MAAM,CAwCR"}
@@ -1,8 +1,8 @@
1
- import { SPOTLIGHT_PIPELINE_STEP_IDS as p } from "./constants.js";
2
- import { findActiveStep as O } from "./steps.js";
1
+ import { SPOTLIGHT_PIPELINE_STEP_IDS as a } from "./constants.js";
2
+ import { findActiveStep as _ } from "./steps.js";
3
3
  function $(e, r) {
4
- const o = O(e.getSteps());
5
- o ? e.setStep(o.id, "error", r) : e.setStep(p.understand, "error", r), e.setError(r);
4
+ const o = _(e.getSteps());
5
+ o ? e.setStep(o.id, "error", r) : e.setStep(a.understand, "error", r), e.setError(r);
6
6
  }
7
7
  function d(e) {
8
8
  const r = {
@@ -11,17 +11,18 @@ function d(e) {
11
11
  CIRCULAR_DEPENDENCY: "工具依赖配置存在循环",
12
12
  PREREQUISITE_FAILED: "前置步骤执行失败",
13
13
  PRECONDITION_FAILED: "当前页面状态不满足执行条件",
14
+ TOOL_APPROVAL_REQUIRED: "该操作需要用户明确批准",
14
15
  TOOL_RUN_FAILED: "工具执行时发生运行错误",
15
16
  TOOL_TIMEOUT: "工具执行超时"
16
17
  }, o = e.errorCode ? r[e.errorCode] : "工具执行失败", c = e.error?.trim() || "未知错误", n = e.trace ?? [], t = n.at(-1), i = n.filter(
17
18
  (l) => l.type === "retry_scheduled"
18
- ).length, E = n.some(
19
+ ).length, O = n.some(
19
20
  (l) => l.type === "rollback_applied"
20
- ), s = t ? t.detail ? `${t.type}:${t.tool}:${t.detail}` : `${t.type}:${t.tool}` : null, T = [
21
+ ), E = t ? t.detail ? `${t.type}:${t.tool}:${t.detail}` : `${t.type}:${t.tool}` : null, T = [
21
22
  i > 0 ? `系统已自动重试 ${i} 次` : null,
22
- E ? "已执行回滚清理" : null
23
- ].filter(Boolean).join(","), a = T ? `。恢复动作:${T}` : "";
24
- return s ? `${o}:${c}${a}。定位线索:${s}` : `${o}:${c}${a}`;
23
+ O ? "已执行回滚清理" : null
24
+ ].filter(Boolean).join(","), s = T ? `。恢复动作:${T}` : "";
25
+ return E ? `${o}:${c}${s}。定位线索:${E}` : `${o}:${c}${s}`;
25
26
  }
26
27
  export {
27
28
  $ as applyPipelineError,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@inupedia/spotlight-vue",
3
- "version": "0.7.0",
3
+ "version": "0.7.1",
4
4
  "description": "Thin Vue runtime for Inupedia Spotlight Client Tools",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -91,8 +91,8 @@
91
91
  "dependencies": {
92
92
  "prettier": "^3.8.1",
93
93
  "yaml": "^2.8.4",
94
- "@inupedia/spotlight-client": "0.7.0",
95
- "@inupedia/spotlight-protocol": "0.7.0"
94
+ "@inupedia/spotlight-client": "0.7.1",
95
+ "@inupedia/spotlight-protocol": "0.7.1"
96
96
  },
97
97
  "peerDependencies": {
98
98
  "@inspira-ui/plugins": "^0.0.2",