@inupedia/spotlight-vue 0.5.19 → 0.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- 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 -2
- package/dist/config.d.ts.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +93 -91
- package/dist/plugin.d.ts +3 -1
- package/dist/plugin.d.ts.map +1 -1
- package/dist/plugin.js +67 -30
- package/dist/remote/runPipeline.d.ts +12 -1
- package/dist/remote/runPipeline.d.ts.map +1 -1
- package/dist/remote/runPipeline.js +215 -410
- package/dist/skills/skillFrontmatterParse.d.ts.map +1 -1
- package/dist/skills/skillFrontmatterParse.js +179 -129
- package/dist/store/spotlightStore.js +33 -45
- package/package.json +3 -3
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"skillFrontmatterParse.d.ts","sourceRoot":"","sources":["../../src/skills/skillFrontmatterParse.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAEV,cAAc,EAEf,MAAM,8BAA8B,CAAC;
|
|
1
|
+
{"version":3,"file":"skillFrontmatterParse.d.ts","sourceRoot":"","sources":["../../src/skills/skillFrontmatterParse.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAEV,cAAc,EAEf,MAAM,8BAA8B,CAAC;AAyRtC,wBAAgB,iCAAiC,CAC/C,QAAQ,EAAE,MAAM,EAChB,UAAU,EAAE,MAAM,GACjB,cAAc,CA8EhB"}
|
|
@@ -1,116 +1,116 @@
|
|
|
1
|
-
import { parse as
|
|
2
|
-
function
|
|
3
|
-
return typeof
|
|
1
|
+
import { parse as O } from "yaml";
|
|
2
|
+
function f(o) {
|
|
3
|
+
return typeof o == "object" && o !== null && !Array.isArray(o);
|
|
4
4
|
}
|
|
5
|
-
function
|
|
6
|
-
const
|
|
5
|
+
function P(o) {
|
|
6
|
+
const n = o.replace(/\r\n/g, `
|
|
7
7
|
`).trim();
|
|
8
|
-
if (!
|
|
8
|
+
if (!n.startsWith(`---
|
|
9
9
|
`))
|
|
10
|
-
return { frontmatter: "", body:
|
|
11
|
-
const t =
|
|
10
|
+
return { frontmatter: "", body: n };
|
|
11
|
+
const t = n.indexOf(`
|
|
12
12
|
---
|
|
13
13
|
`, 4);
|
|
14
|
-
return t === -1 ? { frontmatter: "", body:
|
|
15
|
-
frontmatter:
|
|
16
|
-
body:
|
|
14
|
+
return t === -1 ? { frontmatter: "", body: n } : {
|
|
15
|
+
frontmatter: n.slice(4, t).trim(),
|
|
16
|
+
body: n.slice(t + 5).trim()
|
|
17
17
|
};
|
|
18
18
|
}
|
|
19
|
-
function M(
|
|
20
|
-
const
|
|
21
|
-
if (!
|
|
19
|
+
function M(o) {
|
|
20
|
+
const n = o.trim();
|
|
21
|
+
if (!n) return {};
|
|
22
22
|
try {
|
|
23
|
-
const
|
|
24
|
-
if (
|
|
23
|
+
const e = O(n);
|
|
24
|
+
if (f(e)) return e;
|
|
25
25
|
} catch {
|
|
26
26
|
}
|
|
27
27
|
const t = {};
|
|
28
|
-
for (const
|
|
28
|
+
for (const e of o.split(`
|
|
29
29
|
`)) {
|
|
30
|
-
const r =
|
|
30
|
+
const r = e.trim();
|
|
31
31
|
if (!r || r.startsWith("#")) continue;
|
|
32
32
|
const c = r.indexOf(":");
|
|
33
33
|
if (c <= 0) continue;
|
|
34
|
-
const
|
|
35
|
-
t[
|
|
34
|
+
const a = r.slice(0, c).trim(), i = r.slice(c + 1).trim();
|
|
35
|
+
t[a] = i;
|
|
36
36
|
}
|
|
37
37
|
return t;
|
|
38
38
|
}
|
|
39
|
-
function
|
|
40
|
-
const { frontmatter:
|
|
41
|
-
return { data: M(
|
|
39
|
+
function H(o) {
|
|
40
|
+
const { frontmatter: n, body: t } = P(o);
|
|
41
|
+
return { data: M(n), body: t };
|
|
42
42
|
}
|
|
43
|
-
function
|
|
44
|
-
return
|
|
43
|
+
function p(o) {
|
|
44
|
+
return o.startsWith('"') && o.endsWith('"') || o.startsWith("'") && o.endsWith("'") ? o.slice(1, -1).trim() : o;
|
|
45
45
|
}
|
|
46
|
-
function s(
|
|
47
|
-
for (const t of
|
|
48
|
-
const
|
|
49
|
-
if (typeof
|
|
50
|
-
const r =
|
|
46
|
+
function s(o, ...n) {
|
|
47
|
+
for (const t of n) {
|
|
48
|
+
const e = o[t];
|
|
49
|
+
if (typeof e == "string") {
|
|
50
|
+
const r = p(e.trim());
|
|
51
51
|
if (r) return r;
|
|
52
52
|
}
|
|
53
|
-
if (typeof
|
|
53
|
+
if (typeof e == "number" && Number.isFinite(e)) return String(e);
|
|
54
54
|
}
|
|
55
55
|
}
|
|
56
|
-
function
|
|
57
|
-
if (
|
|
58
|
-
if (Array.isArray(
|
|
59
|
-
const
|
|
60
|
-
return
|
|
56
|
+
function $(o) {
|
|
57
|
+
if (o != null) {
|
|
58
|
+
if (Array.isArray(o)) {
|
|
59
|
+
const n = o.filter((t) => typeof t == "string").map((t) => p(t.trim())).filter(Boolean);
|
|
60
|
+
return n.length ? n : void 0;
|
|
61
61
|
}
|
|
62
|
-
if (typeof
|
|
63
|
-
const
|
|
64
|
-
if (!
|
|
65
|
-
const t =
|
|
62
|
+
if (typeof o == "string") {
|
|
63
|
+
const n = o.replace(/^\[/, "").replace(/\]$/, "").trim();
|
|
64
|
+
if (!n) return;
|
|
65
|
+
const t = n.split(",").map((e) => p(e.trim())).filter(Boolean);
|
|
66
66
|
return t.length ? t : void 0;
|
|
67
67
|
}
|
|
68
68
|
}
|
|
69
69
|
}
|
|
70
|
-
function
|
|
71
|
-
for (const t of
|
|
72
|
-
const
|
|
73
|
-
if (
|
|
70
|
+
function l(o, ...n) {
|
|
71
|
+
for (const t of n) {
|
|
72
|
+
const e = $(o[t]);
|
|
73
|
+
if (e?.length) return e;
|
|
74
74
|
}
|
|
75
75
|
}
|
|
76
|
-
function
|
|
77
|
-
const
|
|
78
|
-
if (!
|
|
79
|
-
const t =
|
|
80
|
-
const r =
|
|
76
|
+
function j(o) {
|
|
77
|
+
const n = l(o, "tool-examples", "toolExamples");
|
|
78
|
+
if (!n) return;
|
|
79
|
+
const t = n.flatMap((e) => {
|
|
80
|
+
const r = e.lastIndexOf("=>");
|
|
81
81
|
if (r <= 0) return [];
|
|
82
|
-
const c =
|
|
83
|
-
return c &&
|
|
82
|
+
const c = e.slice(0, r).trim(), a = e.slice(r + 2).trim();
|
|
83
|
+
return c && a ? [{ example: c, toolName: a }] : [];
|
|
84
84
|
});
|
|
85
85
|
return t.length ? t : void 0;
|
|
86
86
|
}
|
|
87
|
-
function
|
|
88
|
-
for (const t of
|
|
89
|
-
const
|
|
90
|
-
if (typeof
|
|
91
|
-
if (typeof
|
|
92
|
-
const r =
|
|
87
|
+
function u(o, ...n) {
|
|
88
|
+
for (const t of n) {
|
|
89
|
+
const e = o[t];
|
|
90
|
+
if (typeof e == "boolean") return e;
|
|
91
|
+
if (typeof e == "string") {
|
|
92
|
+
const r = e.trim().toLowerCase();
|
|
93
93
|
if (r === "true" || r === "yes") return !0;
|
|
94
94
|
if (r === "false" || r === "no") return !1;
|
|
95
95
|
}
|
|
96
96
|
}
|
|
97
97
|
}
|
|
98
|
-
const
|
|
98
|
+
const R = /* @__PURE__ */ new Set([
|
|
99
99
|
"direct_answer",
|
|
100
100
|
"tool_answer",
|
|
101
101
|
"clarify"
|
|
102
102
|
]);
|
|
103
|
-
function
|
|
104
|
-
const
|
|
105
|
-
|
|
103
|
+
function U(o) {
|
|
104
|
+
const n = s(
|
|
105
|
+
o,
|
|
106
106
|
"spotlight-response-strategy",
|
|
107
107
|
"response-strategy",
|
|
108
108
|
"responseStrategy"
|
|
109
109
|
);
|
|
110
|
-
if (
|
|
111
|
-
return
|
|
110
|
+
if (n)
|
|
111
|
+
return R.has(n) ? n : void 0;
|
|
112
112
|
}
|
|
113
|
-
const
|
|
113
|
+
const z = /* @__PURE__ */ new Set([
|
|
114
114
|
"video_channel",
|
|
115
115
|
"bim_model",
|
|
116
116
|
"device",
|
|
@@ -118,98 +118,148 @@ const R = /* @__PURE__ */ new Set([
|
|
|
118
118
|
"panel",
|
|
119
119
|
"scene_target"
|
|
120
120
|
]);
|
|
121
|
-
function
|
|
122
|
-
const
|
|
123
|
-
|
|
121
|
+
function K(o) {
|
|
122
|
+
const n = l(
|
|
123
|
+
o,
|
|
124
124
|
"spotlight-asset-types",
|
|
125
125
|
"asset-types",
|
|
126
126
|
"assetTypes"
|
|
127
127
|
);
|
|
128
|
-
if (!
|
|
129
|
-
const t =
|
|
130
|
-
(
|
|
128
|
+
if (!n) return;
|
|
129
|
+
const t = n.filter(
|
|
130
|
+
(e) => z.has(e)
|
|
131
131
|
);
|
|
132
132
|
return t.length ? Array.from(new Set(t)) : void 0;
|
|
133
133
|
}
|
|
134
|
-
function
|
|
135
|
-
const
|
|
136
|
-
if (!
|
|
137
|
-
const t =
|
|
134
|
+
function V(o) {
|
|
135
|
+
const n = s(o, "context", "execution-context", "executionContext");
|
|
136
|
+
if (!n) return;
|
|
137
|
+
const t = n.toLowerCase();
|
|
138
138
|
if (t === "fork") return "fork";
|
|
139
139
|
if (t === "inline") return "inline";
|
|
140
140
|
}
|
|
141
|
-
function
|
|
142
|
-
const
|
|
143
|
-
if (
|
|
141
|
+
function Y(o) {
|
|
142
|
+
const n = o.hooks;
|
|
143
|
+
if (f(n)) return n;
|
|
144
|
+
}
|
|
145
|
+
function G(o) {
|
|
146
|
+
const n = o.dependencies;
|
|
147
|
+
if (!f(n) || !Array.isArray(n.tools)) return;
|
|
148
|
+
const t = [];
|
|
149
|
+
for (const e of n.tools) {
|
|
150
|
+
if (typeof e == "string" && e.trim()) {
|
|
151
|
+
t.push(e.trim());
|
|
152
|
+
continue;
|
|
153
|
+
}
|
|
154
|
+
if (!f(e)) continue;
|
|
155
|
+
const r = s(e, "value", "name");
|
|
156
|
+
r && t.push({
|
|
157
|
+
type: s(e, "type") ?? "browser",
|
|
158
|
+
value: r,
|
|
159
|
+
description: s(e, "description"),
|
|
160
|
+
transport: s(e, "transport"),
|
|
161
|
+
url: s(e, "url")
|
|
162
|
+
});
|
|
163
|
+
}
|
|
164
|
+
return t.length ? { tools: t } : void 0;
|
|
165
|
+
}
|
|
166
|
+
function Q(o) {
|
|
167
|
+
const n = o.policy;
|
|
168
|
+
if (!f(n)) return;
|
|
169
|
+
const t = u(
|
|
170
|
+
n,
|
|
171
|
+
"allow_implicit_invocation",
|
|
172
|
+
"allowImplicitInvocation"
|
|
173
|
+
);
|
|
174
|
+
return t === void 0 ? void 0 : { allowImplicitInvocation: t };
|
|
175
|
+
}
|
|
176
|
+
function q(o) {
|
|
177
|
+
const n = o.interface;
|
|
178
|
+
if (!f(n)) return;
|
|
179
|
+
const t = {
|
|
180
|
+
displayName: s(n, "display_name", "displayName"),
|
|
181
|
+
shortDescription: s(n, "short_description", "shortDescription"),
|
|
182
|
+
iconSmall: s(n, "icon_small", "iconSmall"),
|
|
183
|
+
iconLarge: s(n, "icon_large", "iconLarge"),
|
|
184
|
+
brandColor: s(n, "brand_color", "brandColor"),
|
|
185
|
+
defaultPrompt: s(n, "default_prompt", "defaultPrompt")
|
|
186
|
+
};
|
|
187
|
+
return Object.values(t).some(Boolean) ? t : void 0;
|
|
144
188
|
}
|
|
145
|
-
function
|
|
146
|
-
const
|
|
147
|
-
if (t && /^SKILL\.md$/iu.test(t) &&
|
|
148
|
-
return
|
|
189
|
+
function J(o) {
|
|
190
|
+
const n = o.replace(/\\/g, "/").split("/").filter(Boolean), t = n[n.length - 1];
|
|
191
|
+
if (t && /^SKILL\.md$/iu.test(t) && n.length >= 2)
|
|
192
|
+
return n[n.length - 2];
|
|
149
193
|
if (t?.toLowerCase().endsWith(".skill.md"))
|
|
150
194
|
return t.replace(/\.SKILL\.md$/iu, "");
|
|
151
195
|
}
|
|
152
|
-
function
|
|
153
|
-
return
|
|
196
|
+
function X(o) {
|
|
197
|
+
return o.split(`
|
|
154
198
|
`).map((t) => t.trim()).find((t) => t && !t.startsWith("#")) ?? "未提供技能描述";
|
|
155
199
|
}
|
|
156
|
-
function
|
|
157
|
-
const { data: t, body:
|
|
200
|
+
function tt(o, n) {
|
|
201
|
+
const { data: t, body: e } = H(o), r = s(t, "name"), c = s(t, "id") ?? J(n);
|
|
158
202
|
if (!c)
|
|
159
|
-
throw new Error(`技能文件缺少 id 且无法从路径推断:${
|
|
160
|
-
const
|
|
203
|
+
throw new Error(`技能文件缺少 id 且无法从路径推断:${n}`);
|
|
204
|
+
const a = s(t, "description") ?? X(e), i = {
|
|
161
205
|
name: c,
|
|
162
|
-
description:
|
|
163
|
-
},
|
|
164
|
-
|
|
165
|
-
const
|
|
166
|
-
|
|
167
|
-
const
|
|
168
|
-
|
|
169
|
-
const
|
|
170
|
-
|
|
171
|
-
const
|
|
206
|
+
description: a
|
|
207
|
+
}, d = e.trim();
|
|
208
|
+
d && (i.skillInstructionBody = d), r && (i.displayName = r);
|
|
209
|
+
const m = s(t, "when_to_use", "whenToUse");
|
|
210
|
+
m && (i.whenToUse = m);
|
|
211
|
+
const y = l(t, "allowed-tools", "allowedTools");
|
|
212
|
+
y && (i.allowedTools = y);
|
|
213
|
+
const g = G(t);
|
|
214
|
+
g && (i.dependencies = g);
|
|
215
|
+
const h = Q(t);
|
|
216
|
+
h && (i.policy = h);
|
|
217
|
+
const v = q(t);
|
|
218
|
+
v && (i.interface = v);
|
|
219
|
+
const k = s(t, "argument-hint", "argumentHint");
|
|
220
|
+
k && (i.argumentHint = k);
|
|
221
|
+
const w = l(
|
|
172
222
|
t,
|
|
173
223
|
"arguments",
|
|
174
224
|
"argument-names",
|
|
175
225
|
"argumentNames"
|
|
176
226
|
);
|
|
177
|
-
|
|
178
|
-
const
|
|
179
|
-
|
|
180
|
-
const
|
|
181
|
-
|
|
182
|
-
const
|
|
183
|
-
|
|
184
|
-
const
|
|
185
|
-
|
|
186
|
-
const
|
|
187
|
-
|
|
188
|
-
const
|
|
189
|
-
|
|
190
|
-
const
|
|
191
|
-
|
|
192
|
-
const
|
|
227
|
+
w && (i.argNames = w);
|
|
228
|
+
const x = l(t, "keywords");
|
|
229
|
+
x && (i.keywords = x);
|
|
230
|
+
const b = U(t);
|
|
231
|
+
b && (i.responseStrategy = b);
|
|
232
|
+
const S = K(t);
|
|
233
|
+
S && (i.assetTypes = S);
|
|
234
|
+
const I = l(t, "capability-examples", "capabilityExamples");
|
|
235
|
+
I && (i.capabilityExamples = I);
|
|
236
|
+
const _ = j(t);
|
|
237
|
+
_ && (i.toolExamples = _);
|
|
238
|
+
const E = s(t, "version");
|
|
239
|
+
E && (i.version = E);
|
|
240
|
+
const T = s(t, "model");
|
|
241
|
+
T && (i.model = T);
|
|
242
|
+
const L = u(
|
|
193
243
|
t,
|
|
194
244
|
"disable-model-invocation",
|
|
195
245
|
"disableModelInvocation"
|
|
196
246
|
);
|
|
197
|
-
|
|
198
|
-
const
|
|
199
|
-
|
|
200
|
-
const
|
|
201
|
-
|
|
202
|
-
const
|
|
203
|
-
|
|
204
|
-
const
|
|
205
|
-
|
|
206
|
-
const
|
|
207
|
-
|
|
208
|
-
const
|
|
209
|
-
|
|
210
|
-
const
|
|
211
|
-
return
|
|
247
|
+
L !== void 0 && (i.disableModelInvocation = L);
|
|
248
|
+
const A = u(t, "user-invocable", "userInvocable");
|
|
249
|
+
A !== void 0 && (i.userInvocable = A);
|
|
250
|
+
const N = l(t, "paths");
|
|
251
|
+
N && (i.paths = N);
|
|
252
|
+
const C = V(t);
|
|
253
|
+
C && (i.executionContext = C);
|
|
254
|
+
const W = s(t, "agent");
|
|
255
|
+
W && (i.agent = W);
|
|
256
|
+
const B = s(t, "effort") ?? (typeof t.effort == "number" && Number.isFinite(t.effort) ? String(t.effort) : void 0);
|
|
257
|
+
B && (i.effort = B);
|
|
258
|
+
const D = Y(t);
|
|
259
|
+
D && (i.hooks = D);
|
|
260
|
+
const F = s(t, "shell");
|
|
261
|
+
return F && (i.shell = F), i;
|
|
212
262
|
}
|
|
213
263
|
export {
|
|
214
|
-
|
|
264
|
+
tt as parseSpotlightSkillMarkdownFields
|
|
215
265
|
};
|
|
@@ -1,23 +1,22 @@
|
|
|
1
|
-
import { defineStore as
|
|
2
|
-
import { getSpotlightConfig as
|
|
1
|
+
import { defineStore as g } from "pinia";
|
|
2
|
+
import { getSpotlightConfig as S } from "../plugin.js";
|
|
3
3
|
import { runRemoteSpotlightPipeline as y, warmupSpotlightRemoteContext as a, cancelRemoteSpotlightRunForSignal as T } from "../remote/runPipeline.js";
|
|
4
4
|
import { ensureSpotlightMeta as E } from "../remote/meta.js";
|
|
5
|
-
import { devWarn as
|
|
5
|
+
import { devWarn as P } from "../utils/devConsole.js";
|
|
6
6
|
import { useAgentSessionStore as p } from "../session/agentSession.js";
|
|
7
|
-
import { useSpotlightRuntimeStore as
|
|
8
|
-
import { applyPipelineError as
|
|
9
|
-
import { SPOTLIGHT_PIPELINE_STEP_LABELS as
|
|
10
|
-
import { setStepState as
|
|
11
|
-
import { typewriterAppendToStepContent as
|
|
12
|
-
import { addRecentQuestionToList as Q, persistRecentQuestions as
|
|
13
|
-
import { getSuggestedQuestions as
|
|
14
|
-
import { buildSpotlightStoreSink as
|
|
15
|
-
import { INVESTMENT_SUB_INTENT_LABELS as te, InvestmentSubIntent as ie, PROGRESS_SUB_INTENT_LABELS as se, ProgressSubIntent as ne, QUALITY_SUB_INTENT_LABELS as re, QualitySubIntent as oe, SAFETY_SUB_INTENT_LABELS as le, SPOTLIGHT_INTENT_LABELS as ue, SUB_INTENT_CONFIG as ae, SafetySubIntent as pe, SpotlightIntent as he } from "./types.js";
|
|
7
|
+
import { useSpotlightRuntimeStore as x } from "./runtimeStore.js";
|
|
8
|
+
import { applyPipelineError as R } from "./pipeline/errors.js";
|
|
9
|
+
import { SPOTLIGHT_PIPELINE_STEP_LABELS as b, SPOTLIGHT_PIPELINE_STEP_IDS as I } from "./pipeline/constants.js";
|
|
10
|
+
import { setStepState as _ } from "./pipeline/steps.js";
|
|
11
|
+
import { typewriterAppendToStepContent as v, typewriterToStepContent as A } from "./pipeline/typing.js";
|
|
12
|
+
import { addRecentQuestionToList as Q, persistRecentQuestions as C, loadRecentQuestions as w } from "./recent.js";
|
|
13
|
+
import { getSuggestedQuestions as k } from "./capabilities.js";
|
|
14
|
+
import { buildSpotlightStoreSink as M } from "./storeSink.js";
|
|
16
15
|
const m = "spotlight-telemetry-snapshots", l = 20;
|
|
17
16
|
function h(e) {
|
|
18
17
|
return e instanceof DOMException && e.name === "AbortError" ? !0 : e instanceof Error && e.name === "AbortError";
|
|
19
18
|
}
|
|
20
|
-
function
|
|
19
|
+
function L() {
|
|
21
20
|
try {
|
|
22
21
|
const e = localStorage.getItem(m), i = e ? JSON.parse(e) : [];
|
|
23
22
|
return Array.isArray(i) ? i.slice(0, l) : [];
|
|
@@ -37,7 +36,7 @@ function c(e) {
|
|
|
37
36
|
function o(e) {
|
|
38
37
|
return e.type === "step_sync" || e.type === "step_status" || e.type === "step_content" || e.type === "step_artifact";
|
|
39
38
|
}
|
|
40
|
-
function
|
|
39
|
+
function D(e) {
|
|
41
40
|
return e.failureClass === "tool" ? e.budgetUsage.failedToolCalls > 0 ? "tool_runtime" : "tool_failure_unrecoverable" : e.failureClass === "runtime" ? "runtime_error" : e.failureClass === "cancel" ? "cancelled" : e.stopReason === "max_turns_exhausted" ? "max_turns_exhausted" : e.stopReason === "tool_failure_unrecoverable" ? "tool_failure_unrecoverable" : "completed";
|
|
42
41
|
}
|
|
43
42
|
function d(e) {
|
|
@@ -61,7 +60,7 @@ function d(e) {
|
|
|
61
60
|
(t, n) => n[0].at - t[0].at
|
|
62
61
|
);
|
|
63
62
|
}
|
|
64
|
-
function
|
|
63
|
+
function f(e, i) {
|
|
65
64
|
const s = [...e].reverse().find(
|
|
66
65
|
(n) => n.type === "turn_completed" && n.turnId === i
|
|
67
66
|
);
|
|
@@ -73,21 +72,21 @@ function S(e, i) {
|
|
|
73
72
|
turnId: s.turnId,
|
|
74
73
|
stopReason: s.stopReason,
|
|
75
74
|
failureClass: s.failureClass,
|
|
76
|
-
category:
|
|
75
|
+
category: D(s),
|
|
77
76
|
elapsedMs: s.elapsedMs,
|
|
78
77
|
toolErrors: t
|
|
79
78
|
};
|
|
80
79
|
}
|
|
81
|
-
function
|
|
80
|
+
function N(e) {
|
|
82
81
|
const i = [...e].reverse().find(
|
|
83
82
|
(s) => s.type === "turn_completed"
|
|
84
83
|
);
|
|
85
|
-
return i ?
|
|
84
|
+
return i ? f(e, i.turnId) : null;
|
|
86
85
|
}
|
|
87
86
|
function O(e, i) {
|
|
88
87
|
return d(e).find((s) => s[0]?.turnId === i) ?? [];
|
|
89
88
|
}
|
|
90
|
-
const Z =
|
|
89
|
+
const Z = g("spotlight", {
|
|
91
90
|
state: () => ({
|
|
92
91
|
visible: !1,
|
|
93
92
|
prompt: "",
|
|
@@ -107,7 +106,7 @@ const Z = f("spotlight", {
|
|
|
107
106
|
lastMemoryReplay: null,
|
|
108
107
|
lastMemoryDecision: null,
|
|
109
108
|
lastSubmittedQuestion: "",
|
|
110
|
-
telemetrySnapshots:
|
|
109
|
+
telemetrySnapshots: L()
|
|
111
110
|
}),
|
|
112
111
|
getters: {
|
|
113
112
|
uiExecutionEvents(e) {
|
|
@@ -125,7 +124,7 @@ const Z = f("spotlight", {
|
|
|
125
124
|
return this.turnTimelines[0] ?? [];
|
|
126
125
|
},
|
|
127
126
|
latestFailureSummary(e) {
|
|
128
|
-
return
|
|
127
|
+
return N(e.executionEvents);
|
|
129
128
|
},
|
|
130
129
|
latestTelemetrySnapshot(e) {
|
|
131
130
|
return e.telemetrySnapshots[0] ?? null;
|
|
@@ -139,7 +138,7 @@ const Z = f("spotlight", {
|
|
|
139
138
|
turnId: e,
|
|
140
139
|
recordedAt: Date.now(),
|
|
141
140
|
timeline: i,
|
|
142
|
-
failureSummary:
|
|
141
|
+
failureSummary: f(
|
|
143
142
|
this.executionEvents,
|
|
144
143
|
e
|
|
145
144
|
)
|
|
@@ -167,13 +166,13 @@ const Z = f("spotlight", {
|
|
|
167
166
|
this.pipelineAbortController && (T(this.pipelineAbortController.signal), this.pipelineAbortController.abort(), this.pipelineAbortController = null), this.loading && (this.loading = !1), this.pipelinePhase === "running" && (this.pipelinePhase = "cancelled");
|
|
168
167
|
},
|
|
169
168
|
setStep(e, i, s) {
|
|
170
|
-
|
|
169
|
+
_(this.agentSteps, e, i, s);
|
|
171
170
|
},
|
|
172
171
|
recordExecutionEvent(e) {
|
|
173
172
|
this.executionEvents.push(e), this.executionEvents.length > 500 && this.executionEvents.splice(0, this.executionEvents.length - 500), e.type === "turn_completed" && this.persistTurnTelemetrySnapshot(e.turnId);
|
|
174
173
|
},
|
|
175
174
|
async typewriterToStep(e, i, s = 24, t) {
|
|
176
|
-
return
|
|
175
|
+
return A(
|
|
177
176
|
this.agentSteps,
|
|
178
177
|
e,
|
|
179
178
|
i,
|
|
@@ -182,7 +181,7 @@ const Z = f("spotlight", {
|
|
|
182
181
|
);
|
|
183
182
|
},
|
|
184
183
|
async typewriterAppendToStep(e, i, s = 24, t) {
|
|
185
|
-
return
|
|
184
|
+
return v(
|
|
186
185
|
this.agentSteps,
|
|
187
186
|
e,
|
|
188
187
|
i,
|
|
@@ -201,22 +200,22 @@ const Z = f("spotlight", {
|
|
|
201
200
|
this.loadRecentQuestions(), this.refreshSuggestedQuestions(), a(), this.selectedIndex = -1, this.prompt = "", this.error = "";
|
|
202
201
|
},
|
|
203
202
|
loadRecentQuestions() {
|
|
204
|
-
this.recentQuestions =
|
|
203
|
+
this.recentQuestions = w();
|
|
205
204
|
},
|
|
206
205
|
addRecentQuestion(e) {
|
|
207
206
|
this.recentQuestions = Q(
|
|
208
207
|
this.recentQuestions,
|
|
209
208
|
e
|
|
210
|
-
),
|
|
209
|
+
), C(this.recentQuestions);
|
|
211
210
|
},
|
|
212
211
|
async refreshSuggestedQuestions() {
|
|
213
212
|
await E();
|
|
214
|
-
const e =
|
|
213
|
+
const e = S(), i = e.getUiContext?.() ?? {}, s = x(), t = {
|
|
215
214
|
sceneLevel: i.sceneLevel ?? null,
|
|
216
215
|
smallTab: i.smallTab ?? null,
|
|
217
216
|
activeTarget: s.activeTarget
|
|
218
217
|
};
|
|
219
|
-
this.suggestedQuestions = e.getSuggestedQuestions?.(t) ??
|
|
218
|
+
this.suggestedQuestions = e.getSuggestedQuestions?.(t) ?? k(t);
|
|
220
219
|
},
|
|
221
220
|
getSelectionQuestions() {
|
|
222
221
|
return [...this.suggestedQuestions, ...this.recentQuestions];
|
|
@@ -252,7 +251,7 @@ const Z = f("spotlight", {
|
|
|
252
251
|
/** 供 pipeline handlers 使用,不直接依赖 pinia 的 api 封装 */
|
|
253
252
|
buildHandlerApi(e, i) {
|
|
254
253
|
const s = () => this.isPipelineRunActive(e);
|
|
255
|
-
return
|
|
254
|
+
return M({
|
|
256
255
|
signal: i,
|
|
257
256
|
isCurrentRun: s,
|
|
258
257
|
getSteps: () => this.agentSteps,
|
|
@@ -320,7 +319,7 @@ const Z = f("spotlight", {
|
|
|
320
319
|
this.pipelinePhase = "cancelled";
|
|
321
320
|
return;
|
|
322
321
|
}
|
|
323
|
-
throw
|
|
322
|
+
throw P("Spotlight", "远程流水线异常(将向上抛出)", r), r;
|
|
324
323
|
}
|
|
325
324
|
} catch (n) {
|
|
326
325
|
if (!this.isPipelineRunActive(i)) return;
|
|
@@ -331,12 +330,12 @@ const Z = f("spotlight", {
|
|
|
331
330
|
const r = n instanceof Error ? n.message : "解析失败";
|
|
332
331
|
this.agentSteps.length === 0 && (this.agentSteps = [
|
|
333
332
|
{
|
|
334
|
-
id:
|
|
335
|
-
label:
|
|
333
|
+
id: I.understand,
|
|
334
|
+
label: b.understand,
|
|
336
335
|
status: "error",
|
|
337
336
|
content: r
|
|
338
337
|
}
|
|
339
|
-
]),
|
|
338
|
+
]), R(this.buildHandlerApi(i, s.signal), r), this.pipelinePhase = "error";
|
|
340
339
|
} finally {
|
|
341
340
|
const n = this.pipelinePhase;
|
|
342
341
|
(this.isPipelineRunActive(i) || n === "done") && (this.loading = !1, this.pipelineAbortController = null, n === "running" && (this.pipelinePhase = "done"));
|
|
@@ -357,16 +356,5 @@ const Z = f("spotlight", {
|
|
|
357
356
|
}
|
|
358
357
|
});
|
|
359
358
|
export {
|
|
360
|
-
te as INVESTMENT_SUB_INTENT_LABELS,
|
|
361
|
-
ie as InvestmentSubIntent,
|
|
362
|
-
se as PROGRESS_SUB_INTENT_LABELS,
|
|
363
|
-
ne as ProgressSubIntent,
|
|
364
|
-
re as QUALITY_SUB_INTENT_LABELS,
|
|
365
|
-
oe as QualitySubIntent,
|
|
366
|
-
le as SAFETY_SUB_INTENT_LABELS,
|
|
367
|
-
ue as SPOTLIGHT_INTENT_LABELS,
|
|
368
|
-
ae as SUB_INTENT_CONFIG,
|
|
369
|
-
pe as SafetySubIntent,
|
|
370
|
-
he as SpotlightIntent,
|
|
371
359
|
Z as useSpotlightStore
|
|
372
360
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@inupedia/spotlight-vue",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.7.0",
|
|
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-client": "0.7.0",
|
|
95
|
+
"@inupedia/spotlight-protocol": "0.7.0"
|
|
96
96
|
},
|
|
97
97
|
"peerDependencies": {
|
|
98
98
|
"@inspira-ui/plugins": "^0.0.2",
|