@inupedia/spotlight-vue 0.7.0 → 0.7.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.
- package/dist/components/OfficialBorderBeam.vue.d.ts +1 -1
- package/dist/components/OfficialBorderBeam.vue.d.ts.map +1 -1
- package/dist/config.d.ts +7 -0
- package/dist/config.d.ts.map +1 -1
- package/dist/plugin.d.ts.map +1 -1
- package/dist/plugin.js +44 -53
- package/dist/remote/runPipeline.d.ts.map +1 -1
- package/dist/remote/runPipeline.js +176 -175
- package/dist/store/pipeline/errors.d.ts.map +1 -1
- package/dist/store/pipeline/errors.js +10 -9
- package/package.json +3 -3
|
@@ -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;
|
|
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). */
|
package/dist/config.d.ts.map
CHANGED
|
@@ -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,O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CAAC;AAErB,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,oBAAoB,CAAC;
|
|
1
|
+
{"version":3,"file":"plugin.d.ts","sourceRoot":"","sources":["../src/plugin.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAO,YAAY,EAAE,MAAM,KAAK,CAAC;AAC7C,OAAO,EAEL,wBAAwB,EAIxB,KAAK,kBAAkB,EACvB,KAAK,aAAa,EACnB,MAAM,4BAA4B,CAAC;AACpC,OAAO,EACL,qBAAqB,EACrB,oBAAoB,EACpB,KAAK,eAAe,EACpB,KAAK,yBAAyB,EAC/B,MAAM,aAAa,CAAC;AAErB,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,oBAAoB,CAAC;AAEhE,eAAO,MAAM,kBAAkB,EAAE,YAAY,CAAC,aAAa,CACjC,CAAC;AAC3B,MAAM,MAAM,2BAA2B,GAAG,UAAU,CAAC,OAAO,wBAAwB,CAAC,CAAC;AACtF,eAAO,MAAM,0BAA0B,EAAE,YAAY,CAAC,2BAA2B,CAC/C,CAAC;AACnC,eAAO,MAAM,wBAAwB,EAAE,YAAY,CAAC,kBAAkB,CACtC,CAAC;AAOjC,wBAAgB,kBAAkB,IAAI,eAAe,CAOpD;AAED,wBAAgB,gBAAgB,IAAI,aAAa,CAMhD;AAED,wBAAgB,uBAAuB,IAAI,2BAA2B,CAOrE;AAED,wBAAgB,qBAAqB,IAAI,kBAAkB,CAO1D;AAED,sCAAsC;AACtC,wBAAgB,6BAA6B,IAAI,IAAI,CAMpD;AAED,eAAO,MAAM,YAAY;sBACL,OAAO,WAAW,yBAAyB,GAAG,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
|
|
2
|
-
import { defineSpotlightConfig as
|
|
3
|
-
import { mountSpotlightShell as
|
|
4
|
-
|
|
5
|
-
|
|
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 (!
|
|
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
|
|
11
|
+
return p;
|
|
13
12
|
}
|
|
14
|
-
function
|
|
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
|
|
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
|
|
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
|
|
32
|
+
return r;
|
|
34
33
|
}
|
|
35
|
-
function
|
|
36
|
-
|
|
34
|
+
function k() {
|
|
35
|
+
m(), p = null, i = null, n = null, r = null;
|
|
37
36
|
}
|
|
38
|
-
const
|
|
39
|
-
install(
|
|
40
|
-
const
|
|
41
|
-
"config" in
|
|
42
|
-
),
|
|
43
|
-
if (!Array.isArray(
|
|
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
|
-
|
|
48
|
-
const
|
|
49
|
-
|
|
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.
|
|
55
|
+
version: "0.7.1"
|
|
57
56
|
},
|
|
58
57
|
toolManifest: () => h({
|
|
59
58
|
projectId: t.projectId,
|
|
60
|
-
frontendBuildId:
|
|
61
|
-
tools:
|
|
59
|
+
frontendBuildId: a,
|
|
60
|
+
tools: s
|
|
62
61
|
}),
|
|
63
|
-
skills: () =>
|
|
64
|
-
|
|
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
|
-
|
|
77
|
-
|
|
78
|
-
|
|
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
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
71
|
+
L as SpotlightVue,
|
|
72
|
+
d as defineSpotlightConfig,
|
|
73
|
+
H as getSpotlightAppClient,
|
|
74
|
+
A as getSpotlightClientTools,
|
|
84
75
|
f as getSpotlightConfig,
|
|
85
|
-
|
|
86
|
-
|
|
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;
|
|
1
|
+
{"version":3,"file":"runPipeline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AAK,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
|
|
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
|
|
6
|
-
import { toolLaneStepId as
|
|
7
|
-
import { getSpotlightAppClient as
|
|
8
|
-
import {
|
|
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
|
|
13
|
-
function f(
|
|
14
|
-
const
|
|
15
|
-
if (
|
|
16
|
-
const n = { id: o, label:
|
|
17
|
-
return
|
|
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
|
|
20
|
-
return new Promise((
|
|
21
|
-
requestAnimationFrame(() =>
|
|
17
|
+
function q() {
|
|
18
|
+
return new Promise((e) => {
|
|
19
|
+
requestAnimationFrame(() => e());
|
|
22
20
|
});
|
|
23
21
|
}
|
|
24
|
-
function
|
|
25
|
-
return Array.isArray(
|
|
26
|
-
if (!
|
|
27
|
-
const n =
|
|
28
|
-
if (!
|
|
29
|
-
const
|
|
30
|
-
return [[
|
|
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
|
|
37
|
-
const
|
|
34
|
+
function O(e, o) {
|
|
35
|
+
const r = o.success ? "前端操作已执行。" : o.error || "前端操作执行失败。";
|
|
38
36
|
return {
|
|
39
|
-
id:
|
|
40
|
-
name:
|
|
41
|
-
displayName:
|
|
42
|
-
argsText: JSON.stringify(
|
|
43
|
-
resultText:
|
|
44
|
-
summary:
|
|
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
|
|
51
|
-
return b(
|
|
48
|
+
function j(e, o) {
|
|
49
|
+
return b(e, o?.sideEffectByName?.get(e));
|
|
52
50
|
}
|
|
53
|
-
function p(
|
|
54
|
-
const
|
|
55
|
-
!
|
|
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
|
|
58
|
-
p(
|
|
59
|
-
const
|
|
60
|
-
f(
|
|
61
|
-
const n =
|
|
62
|
-
!n || n.status === "active" || n.status === "done" ||
|
|
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
|
|
65
|
-
const
|
|
66
|
-
return
|
|
62
|
+
function I(e, o, r) {
|
|
63
|
+
const t = j(o, r);
|
|
64
|
+
return H(e, t), h(t);
|
|
67
65
|
}
|
|
68
|
-
function
|
|
69
|
-
const n =
|
|
70
|
-
|
|
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
|
|
73
|
-
f(
|
|
70
|
+
function v(e, o, r, t, n) {
|
|
71
|
+
f(e, o, r), e.setStep(o, t, n);
|
|
74
72
|
}
|
|
75
|
-
function
|
|
76
|
-
const o =
|
|
77
|
-
return
|
|
78
|
-
id:
|
|
79
|
-
name:
|
|
80
|
-
displayName:
|
|
81
|
-
argsText: JSON.stringify({ query:
|
|
82
|
-
resultText:
|
|
83
|
-
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:
|
|
87
|
-
name:
|
|
88
|
-
displayName:
|
|
89
|
-
argsText: JSON.stringify(
|
|
90
|
-
resultText:
|
|
91
|
-
summary:
|
|
92
|
-
errorCode:
|
|
93
|
-
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
|
|
95
|
+
async function F(e, o, r) {
|
|
98
96
|
if (o.type !== "ping") {
|
|
99
97
|
if (o.type === "turn.started") {
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
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
|
|
111
|
-
if (
|
|
112
|
-
if (
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
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
|
-
|
|
116
|
+
t.summary
|
|
119
117
|
);
|
|
120
118
|
else {
|
|
121
|
-
const n = /页面|操作|执行/u.test(
|
|
122
|
-
f(
|
|
123
|
-
|
|
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
|
-
|
|
123
|
+
t.summary
|
|
126
124
|
);
|
|
127
125
|
}
|
|
128
126
|
return;
|
|
129
127
|
}
|
|
130
|
-
if (
|
|
131
|
-
const n = "skills",
|
|
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
|
-
|
|
131
|
+
e.setStep(n, t.status === "failed" ? "error" : "done", u), g().setInvokedSkills([
|
|
134
132
|
...g().invokedSkills.filter(
|
|
135
|
-
(
|
|
133
|
+
(d) => d.skillName !== t.skill
|
|
136
134
|
),
|
|
137
|
-
{ skillName:
|
|
135
|
+
{ skillName: t.skill, invokedAt: o.at }
|
|
138
136
|
]);
|
|
139
137
|
return;
|
|
140
138
|
}
|
|
141
|
-
if (
|
|
142
|
-
const n = (
|
|
143
|
-
|
|
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 (
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
144
|
+
if (t.type === "memory") {
|
|
145
|
+
v(
|
|
146
|
+
e,
|
|
147
|
+
i.understand,
|
|
150
148
|
"理解问题",
|
|
151
|
-
|
|
152
|
-
|
|
149
|
+
t.action === "reuse" ? "done" : "active",
|
|
150
|
+
t.summary
|
|
153
151
|
);
|
|
154
152
|
return;
|
|
155
153
|
}
|
|
156
|
-
if (
|
|
157
|
-
p(
|
|
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
|
-
|
|
158
|
+
t.type === "error" && e.setError(t.message);
|
|
161
159
|
return;
|
|
162
160
|
}
|
|
163
|
-
o.type === "turn.failed" &&
|
|
161
|
+
o.type === "turn.failed" && e.setError(o.error.message);
|
|
164
162
|
}
|
|
165
163
|
}
|
|
166
|
-
async function
|
|
164
|
+
async function ee(e) {
|
|
167
165
|
await Promise.allSettled([
|
|
168
|
-
|
|
169
|
-
L(
|
|
166
|
+
k().initialize(e),
|
|
167
|
+
L(e)
|
|
170
168
|
]);
|
|
171
169
|
}
|
|
172
|
-
async function J(
|
|
173
|
-
const
|
|
170
|
+
async function J(e, o, r) {
|
|
171
|
+
const t = g(), n = P(), a = C();
|
|
174
172
|
return {
|
|
175
|
-
hostManifest:
|
|
173
|
+
hostManifest: await A(),
|
|
176
174
|
payload: {
|
|
177
175
|
projectId: _(),
|
|
178
|
-
input:
|
|
179
|
-
memorySubjectId:
|
|
180
|
-
memoryRefreshRequested:
|
|
181
|
-
uiContext:
|
|
176
|
+
input: e,
|
|
177
|
+
memorySubjectId: S().getMemorySubjectId?.() ?? void 0,
|
|
178
|
+
memoryRefreshRequested: r?.forceMemoryRefresh === !0,
|
|
179
|
+
uiContext: S().getUiContext?.() ?? {},
|
|
182
180
|
sessionState: {
|
|
183
|
-
sessionId:
|
|
184
|
-
activeTaskId:
|
|
185
|
-
activeTopic:
|
|
186
|
-
pendingTask:
|
|
187
|
-
conversationSummary:
|
|
188
|
-
summarizedTurnCount:
|
|
189
|
-
conversationHistory:
|
|
190
|
-
lastAssistantReply:
|
|
191
|
-
invokedSkills:
|
|
192
|
-
skillPermissionGrants:
|
|
193
|
-
memoryEnabled:
|
|
194
|
-
memoryReadEnabled:
|
|
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
|
|
213
|
-
const
|
|
214
|
-
t,
|
|
205
|
+
async function te(e, o, r) {
|
|
206
|
+
const t = o.getSignal(), { payload: n, hostManifest: a } = await J(
|
|
215
207
|
e,
|
|
216
|
-
|
|
217
|
-
|
|
208
|
+
t,
|
|
209
|
+
r
|
|
210
|
+
), c = new Set(a.tools.map((s) => s.name)), u = {
|
|
218
211
|
sideEffectByName: new Map(
|
|
219
|
-
|
|
212
|
+
a.tools.map((s) => [s.name, s.sideEffect])
|
|
220
213
|
)
|
|
221
|
-
},
|
|
222
|
-
|
|
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
|
-
|
|
218
|
+
d.cancelTurn(y.id);
|
|
226
219
|
},
|
|
227
220
|
{ once: !0 }
|
|
228
221
|
));
|
|
229
|
-
for await (const
|
|
230
|
-
if (await
|
|
231
|
-
const
|
|
232
|
-
id:
|
|
233
|
-
name:
|
|
234
|
-
input:
|
|
235
|
-
displayName:
|
|
236
|
-
},
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
error:
|
|
244
|
-
errorCode:
|
|
245
|
-
trace:
|
|
246
|
-
|
|
247
|
-
|
|
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
|
|
251
|
-
throw new Error(
|
|
252
|
-
if (
|
|
253
|
-
const
|
|
254
|
-
return
|
|
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:
|
|
257
|
-
memoryDecision:
|
|
258
|
-
assistantReply:
|
|
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 $(
|
|
265
|
-
await
|
|
265
|
+
async function $(e) {
|
|
266
|
+
await k().cancelTurn(e);
|
|
266
267
|
}
|
|
267
|
-
function
|
|
268
|
-
if (!
|
|
269
|
-
const o =
|
|
270
|
-
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
|
-
|
|
274
|
+
F as applyLifecycleEvent,
|
|
274
275
|
$ as cancelRemoteSpotlightRun,
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
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,
|
|
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
|
|
2
|
-
import { findActiveStep as
|
|
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 =
|
|
5
|
-
o ? e.setStep(o.id, "error", r) : e.setStep(
|
|
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,
|
|
19
|
+
).length, O = n.some(
|
|
19
20
|
(l) => l.type === "rollback_applied"
|
|
20
|
-
),
|
|
21
|
+
), E = t ? t.detail ? `${t.type}:${t.tool}:${t.detail}` : `${t.type}:${t.tool}` : null, T = [
|
|
21
22
|
i > 0 ? `系统已自动重试 ${i} 次` : null,
|
|
22
|
-
|
|
23
|
-
].filter(Boolean).join(","),
|
|
24
|
-
return
|
|
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.
|
|
3
|
+
"version": "0.7.2",
|
|
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-
|
|
95
|
-
"@inupedia/spotlight-
|
|
94
|
+
"@inupedia/spotlight-protocol": "0.7.2",
|
|
95
|
+
"@inupedia/spotlight-client": "0.7.2"
|
|
96
96
|
},
|
|
97
97
|
"peerDependencies": {
|
|
98
98
|
"@inspira-ui/plugins": "^0.0.2",
|