@inupedia/spotlight-vue 0.5.15 → 0.5.17

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.
@@ -1,5 +1,10 @@
1
1
  import type { AgentStep } from "../types";
2
2
  export declare const SPOTLIGHT_PIPELINE_STEP_IDS: {
3
+ readonly understand: "understand";
4
+ readonly gather: "gather";
5
+ readonly act: "act";
6
+ readonly answer: "answer";
7
+ /** @deprecated 0.5.17 thinking-bar IA; kept for old event ids */
3
8
  readonly breakdown: "1";
4
9
  readonly intent: "2";
5
10
  readonly tool: "3";
@@ -7,11 +12,15 @@ export declare const SPOTLIGHT_PIPELINE_STEP_IDS: {
7
12
  readonly agent: "langgraph-agent";
8
13
  };
9
14
  export declare const SPOTLIGHT_PIPELINE_STEP_LABELS: {
10
- readonly breakdown: "拆解问题";
11
- readonly intent: "分析意图";
12
- readonly tool: "使用工具";
15
+ readonly understand: "理解问题";
16
+ readonly gather: "获取信息";
17
+ readonly act: "操作页面";
18
+ readonly answer: "回答";
19
+ readonly breakdown: "理解问题";
20
+ readonly intent: "理解问题";
21
+ readonly tool: "获取信息";
13
22
  readonly analysis: "数据分析";
14
- readonly qa: "知识问答";
23
+ readonly qa: "回答";
15
24
  };
16
25
  export declare function createBreakdownActiveStep(): AgentStep;
17
26
  export declare function createIntentActiveStep(): AgentStep;
@@ -1 +1 @@
1
- {"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../src/store/pipeline/constants.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AAE1C,eAAO,MAAM,2BAA2B;;;;;;CAM9B,CAAC;AAEX,eAAO,MAAM,8BAA8B;;;;;;CAMjC,CAAC;AAEX,wBAAgB,yBAAyB,IAAI,SAAS,CAMrD;AAED,wBAAgB,sBAAsB,IAAI,SAAS,CAMlD;AAED,wBAAgB,kBAAkB,IAAI,SAAS,CAM9C"}
1
+ {"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../src/store/pipeline/constants.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AAE1C,eAAO,MAAM,2BAA2B;;;;;IAKtC,iEAAiE;;;;;;CAMzD,CAAC;AAEX,eAAO,MAAM,8BAA8B;;;;;;;;;;CAUjC,CAAC;AAEX,wBAAgB,yBAAyB,IAAI,SAAS,CAMrD;AAED,wBAAgB,sBAAsB,IAAI,SAAS,CAMlD;AAED,wBAAgB,kBAAkB,IAAI,SAAS,CAM9C"}
@@ -1,17 +1,26 @@
1
- const n = {
1
+ const a = {
2
+ understand: "understand",
3
+ gather: "gather",
4
+ act: "act",
5
+ answer: "answer",
6
+ /** @deprecated 0.5.17 thinking-bar IA; kept for old event ids */
2
7
  breakdown: "1",
3
8
  intent: "2",
4
9
  tool: "3",
5
10
  analysis: "4",
6
11
  agent: "langgraph-agent"
7
- }, a = {
8
- breakdown: "拆解问题",
9
- intent: "分析意图",
10
- tool: "使用工具",
12
+ }, n = {
13
+ understand: "理解问题",
14
+ gather: "获取信息",
15
+ act: "操作页面",
16
+ answer: "回答",
17
+ breakdown: "理解问题",
18
+ intent: "理解问题",
19
+ tool: "获取信息",
11
20
  analysis: "数据分析",
12
- qa: "知识问答"
21
+ qa: "回答"
13
22
  };
14
23
  export {
15
- n as SPOTLIGHT_PIPELINE_STEP_IDS,
16
- a as SPOTLIGHT_PIPELINE_STEP_LABELS
24
+ a as SPOTLIGHT_PIPELINE_STEP_IDS,
25
+ n as SPOTLIGHT_PIPELINE_STEP_LABELS
17
26
  };
@@ -15,6 +15,7 @@ export declare function composeToolStepContent(planning: string, answer: string)
15
15
  */
16
16
  export declare function sanitizeToolStepAnswerText(content: string): string;
17
17
  export declare function isToolExecutionStep(stepId: string): boolean;
18
+ export declare function isAnswerStep(stepId: string): boolean;
18
19
  /** 判断是否为 query loop 写入的规划摘要块(「第 N 轮:…」)。 */
19
20
  export declare function isLoopPlanningChunk(chunk: string): boolean;
20
21
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"displayText.d.ts","sourceRoot":"","sources":["../../../src/store/pipeline/displayText.ts"],"names":[],"mappings":"AAYA,kEAAkE;AAClE,eAAO,MAAM,0BAA0B,qCAAqC,CAAC;AAE7E,8CAA8C;AAC9C,wBAAgB,4BAA4B,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAOpE;AAoCD,yCAAyC;AACzC,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,MAAM,GAAG;IACrD,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,MAAM,CAAC;CAChB,CAeA;AAED,wBAAgB,sBAAsB,CACpC,QAAQ,EAAE,MAAM,EAChB,MAAM,EAAE,MAAM,GACb,MAAM,CAOR;AAED;;;;GAIG;AACH,wBAAgB,0BAA0B,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAelE;AAED,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAE3D;AAED,4CAA4C;AAC5C,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAI1D;AAED;;;GAGG;AACH,wBAAgB,sBAAsB,CAAC,OAAO,EAAE,MAAM,GAAG;IACvD,MAAM,EAAE,MAAM,CAAC;IACf,iBAAiB,EAAE,MAAM,CAAC;CAC3B,CAiBA;AAED,uCAAuC;AACvC,wBAAgB,2BAA2B,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAEnE;AAED,gCAAgC;AAChC,wBAAgB,uBAAuB,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAI/D"}
1
+ {"version":3,"file":"displayText.d.ts","sourceRoot":"","sources":["../../../src/store/pipeline/displayText.ts"],"names":[],"mappings":"AAeA,kEAAkE;AAClE,eAAO,MAAM,0BAA0B,qCAAqC,CAAC;AAE7E,8CAA8C;AAC9C,wBAAgB,4BAA4B,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAOpE;AAoCD,yCAAyC;AACzC,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,MAAM,GAAG;IACrD,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,MAAM,CAAC;CAChB,CAeA;AAED,wBAAgB,sBAAsB,CACpC,QAAQ,EAAE,MAAM,EAChB,MAAM,EAAE,MAAM,GACb,MAAM,CAOR;AAED;;;;GAIG;AACH,wBAAgB,0BAA0B,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAelE;AAED,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAM3D;AAED,wBAAgB,YAAY,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAEpD;AAED,4CAA4C;AAC5C,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAI1D;AAED;;;GAGG;AACH,wBAAgB,sBAAsB,CAAC,OAAO,EAAE,MAAM,GAAG;IACvD,MAAM,EAAE,MAAM,CAAC;IACf,iBAAiB,EAAE,MAAM,CAAC;CAC3B,CAiBA;AAED,uCAAuC;AACvC,wBAAgB,2BAA2B,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAEnE;AAED,gCAAgC;AAChC,wBAAgB,uBAAuB,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAI/D"}
@@ -2,7 +2,7 @@ const u = {
2
2
  call_tools: "调用工具",
3
3
  respond: "生成回答",
4
4
  fallback: "兜底回复"
5
- }, p = "3", c = /^第 \d+ 轮:/u, m = /(?:\n\n+)?第 \d+ 轮:[\s\S]*?(?=\n\n第 \d+ 轮:|$)/gu, s = `
5
+ }, p = "3", m = "gather", f = "act", S = "answer", c = /^第 \d+ 轮:/u, g = /(?:\n\n+)?第 \d+ 轮:[\s\S]*?(?=\n\n第 \d+ 轮:|$)/gu, s = `
6
6
 
7
7
  --- spotlight-answer ---
8
8
 
@@ -14,8 +14,8 @@ function l(t) {
14
14
  n = n.replace(new RegExp(`\\b${e}\\b`, "g"), i);
15
15
  return n;
16
16
  }
17
- const a = /(?:\n\n+|^)(【(?:Skill 已(?:加|预加)载|会话 Skill 已恢复)】[\s\S]*?)(?=\n\n(?:第 \d+ 轮:|【(?:Skill 已(?:加|预加)载|会话 Skill 已恢复)】)|$)/gu, f = /【(?:Skill 已(?:加|预加)载|会话 Skill 已恢复)】/u;
18
- function g(t) {
17
+ const a = /(?:\n\n+|^)(【(?:Skill 已(?:加|预加)载|会话 Skill 已恢复)】[\s\S]*?)(?=\n\n(?:第 \d+ 轮:|【(?:Skill 已(?:加|预加)载|会话 Skill 已恢复)】)|$)/gu, _ = /【(?:Skill 已(?:加|预加)载|会话 Skill 已恢复)】/u;
18
+ function T(t) {
19
19
  const n = [
20
20
  ...t.matchAll(/(?:^|\n\n)(第 \d+ 轮:[^\n]+\n原因:[^\n]+)/gu)
21
21
  ].map((r) => r[1]?.trim() ?? "").filter(Boolean), e = [...t.matchAll(a)].map((r) => r[1]?.trim() ?? "").filter(Boolean);
@@ -30,39 +30,42 @@ function g(t) {
30
30
 
31
31
  `).trim(), answer: i };
32
32
  }
33
- function S(t) {
33
+ function L(t) {
34
34
  const n = l(t).trim();
35
35
  if (!n) return { planning: "", answer: "" };
36
36
  const e = n.indexOf(s);
37
37
  return e >= 0 ? {
38
38
  planning: n.slice(0, e).trim(),
39
39
  answer: n.slice(e + s.length).trim()
40
- } : g(n);
40
+ } : T(n);
41
41
  }
42
- function O(t, n) {
42
+ function d(t, n) {
43
43
  const e = t.trim(), i = n.trim();
44
44
  return e && i ? `${e}${s}${i}` : e || i;
45
45
  }
46
- function T(t) {
46
+ function P(t) {
47
47
  const n = l(t).trim();
48
48
  if (!n) return "";
49
- const { planning: e, answer: i } = S(n);
49
+ const { planning: e, answer: i } = L(n);
50
50
  if (e.trim() && !n.includes(s))
51
51
  return "";
52
52
  const o = (i || (e.trim() ? "" : n)).trim();
53
- return !o || f.test(o) ? "" : L(o).replace(a, "").replace(/\n{3,}/g, `
53
+ return !o || _.test(o) ? "" : O(o).replace(a, "").replace(/\n{3,}/g, `
54
54
 
55
55
  `).trim();
56
56
  }
57
- function _(t) {
58
- return t === p;
57
+ function A(t) {
58
+ return t === m || t === f || t === p;
59
59
  }
60
- function P(t) {
60
+ function k(t) {
61
+ return t === S;
62
+ }
63
+ function N(t) {
61
64
  return c.test(
62
65
  l(t).trimStart()
63
66
  );
64
67
  }
65
- function d(t) {
68
+ function E(t) {
66
69
  const n = l(t).trim();
67
70
  if (!n) return { intent: "", misplacedPlanning: "" };
68
71
  const e = n.search(/\n\n第 \d+ 轮:/u);
@@ -71,22 +74,23 @@ function d(t) {
71
74
  misplacedPlanning: n.slice(e).trim()
72
75
  } : c.test(n) ? { intent: "", misplacedPlanning: n } : { intent: n, misplacedPlanning: "" };
73
76
  }
74
- function k(t) {
75
- return d(t).intent;
77
+ function I(t) {
78
+ return E(t).intent;
76
79
  }
77
- function L(t) {
80
+ function O(t) {
78
81
  const n = l(t).trim();
79
- return n ? n.replace(m, "").trim() : "";
82
+ return n ? n.replace(g, "").trim() : "";
80
83
  }
81
84
  export {
82
85
  s as TOOL_STEP_ANSWER_DELIMITER,
83
- O as composeToolStepContent,
84
- k as getIntentStepDisplayContent,
86
+ d as composeToolStepContent,
87
+ I as getIntentStepDisplayContent,
85
88
  l as humanizeSpotlightStepContent,
86
- P as isLoopPlanningChunk,
87
- _ as isToolExecutionStep,
88
- T as sanitizeToolStepAnswerText,
89
- d as splitIntentStepContent,
90
- S as splitToolStepContent,
91
- L as stripLoopPlanningBlocks
89
+ k as isAnswerStep,
90
+ N as isLoopPlanningChunk,
91
+ A as isToolExecutionStep,
92
+ P as sanitizeToolStepAnswerText,
93
+ E as splitIntentStepContent,
94
+ L as splitToolStepContent,
95
+ O as stripLoopPlanningBlocks
92
96
  };
@@ -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,CASN;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,CAuCR"}
@@ -1,11 +1,11 @@
1
- import { SPOTLIGHT_PIPELINE_STEP_IDS as a } from "./constants.js";
1
+ import { SPOTLIGHT_PIPELINE_STEP_IDS as p } from "./constants.js";
2
2
  import { findActiveStep as O } from "./steps.js";
3
- function $(e, o) {
4
- const r = O(e.getSteps());
5
- r ? e.setStep(r.id, "error", o) : (e.setStep(a.breakdown, "done"), e.setStep(a.intent, "error", o)), e.setError(o);
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);
6
6
  }
7
7
  function d(e) {
8
- const o = {
8
+ const r = {
9
9
  UNKNOWN_TOOL: "系统里还没有注册这个操作",
10
10
  HOST_TOOL_NOT_MANIFEST: "该操作未在本页 host 工具清单中注册",
11
11
  CIRCULAR_DEPENDENCY: "工具依赖配置存在循环",
@@ -13,15 +13,15 @@ function d(e) {
13
13
  PRECONDITION_FAILED: "当前页面状态不满足执行条件",
14
14
  TOOL_RUN_FAILED: "工具执行时发生运行错误",
15
15
  TOOL_TIMEOUT: "工具执行超时"
16
- }, r = e.errorCode ? o[e.errorCode] : "工具执行失败", c = e.error?.trim() || "未知错误", n = e.trace ?? [], t = n.at(-1), i = n.filter(
16
+ }, o = e.errorCode ? r[e.errorCode] : "工具执行失败", c = e.error?.trim() || "未知错误", n = e.trace ?? [], t = n.at(-1), i = n.filter(
17
17
  (l) => l.type === "retry_scheduled"
18
- ).length, p = n.some(
18
+ ).length, E = n.some(
19
19
  (l) => l.type === "rollback_applied"
20
20
  ), s = t ? t.detail ? `${t.type}:${t.tool}:${t.detail}` : `${t.type}:${t.tool}` : null, T = [
21
21
  i > 0 ? `系统已自动重试 ${i} 次` : null,
22
- p ? "已执行回滚清理" : null
23
- ].filter(Boolean).join(","), E = T ? `。恢复动作:${T}` : "";
24
- return s ? `${r}:${c}${E}。定位线索:${s}` : `${r}:${c}${E}`;
22
+ E ? "已执行回滚清理" : null
23
+ ].filter(Boolean).join(","), a = T ? `。恢复动作:${T}` : "";
24
+ return s ? `${o}:${c}${a}。定位线索:${s}` : `${o}:${c}${a}`;
25
25
  }
26
26
  export {
27
27
  $ as applyPipelineError,
@@ -0,0 +1,10 @@
1
+ import type { ToolSideEffectV1 } from "@inupedia/spotlight-protocol";
2
+ /**
3
+ * ChatGPT / Claude / Cursor: retrieve first, then act.
4
+ * `sideEffect === "none"` (getVideoInfo, lists) → 获取信息.
5
+ * `ui` / `external` (playVideoFullscreen, open/close) → 操作页面.
6
+ */
7
+ export declare function resolveToolLane(name: string, sideEffect?: ToolSideEffectV1): "gather" | "act";
8
+ export declare function toolLaneStepId(lane: "gather" | "act"): string;
9
+ export declare function toolLaneStepLabel(lane: "gather" | "act"): string;
10
+ //# sourceMappingURL=toolLane.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"toolLane.d.ts","sourceRoot":"","sources":["../../../src/store/pipeline/toolLane.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,8BAA8B,CAAC;AAarE;;;;GAIG;AACH,wBAAgB,eAAe,CAC7B,IAAI,EAAE,MAAM,EACZ,UAAU,CAAC,EAAE,gBAAgB,GAC5B,QAAQ,GAAG,KAAK,CAalB;AAED,wBAAgB,cAAc,CAAC,IAAI,EAAE,QAAQ,GAAG,KAAK,GAAG,MAAM,CAI7D;AAED,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,QAAQ,GAAG,KAAK,GAAG,MAAM,CAEhE"}
@@ -0,0 +1,24 @@
1
+ import { SPOTLIGHT_PIPELINE_STEP_IDS as n } from "./constants.js";
2
+ import { normalizeToolName as o, isInternalKnowledgeSubtool as a } from "./toolDisplay.js";
3
+ const l = /* @__PURE__ */ new Set([
4
+ "web_search",
5
+ "project_knowledge_search",
6
+ "knowledge.searchweb",
7
+ "knowledge.answer",
8
+ "knowledge.synthesizeanswer"
9
+ ]);
10
+ function s(e, r) {
11
+ const t = o(e);
12
+ return l.has(t) || a(e) || r === "none" ? "gather" : r === "ui" || r === "external" ? "act" : /^(get|list|search|query|count|read|inspect|lookup|find)/iu.test(t) ? "gather" : "act";
13
+ }
14
+ function c(e) {
15
+ return e === "gather" ? n.gather : n.act;
16
+ }
17
+ function g(e) {
18
+ return e === "gather" ? "获取信息" : "操作页面";
19
+ }
20
+ export {
21
+ s as resolveToolLane,
22
+ c as toolLaneStepId,
23
+ g as toolLaneStepLabel
24
+ };
@@ -331,8 +331,8 @@ const Z = f("spotlight", {
331
331
  const r = n instanceof Error ? n.message : "解析失败";
332
332
  this.agentSteps.length === 0 && (this.agentSteps = [
333
333
  {
334
- id: b.intent,
335
- label: R.intent,
334
+ id: b.understand,
335
+ label: R.understand,
336
336
  status: "error",
337
337
  content: r
338
338
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@inupedia/spotlight-vue",
3
- "version": "0.5.15",
3
+ "version": "0.5.17",
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.5.15",
95
- "@inupedia/spotlight-protocol": "0.5.15"
94
+ "@inupedia/spotlight-client": "0.5.17",
95
+ "@inupedia/spotlight-protocol": "0.5.17"
96
96
  },
97
97
  "peerDependencies": {
98
98
  "@inspira-ui/plugins": "^0.0.2",