@inupedia/spotlight-vue 0.2.14 → 0.2.15
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/assets/spotlight-vue.css +1 -1
- package/dist/components/SpotlightCommandPanel.vue.d.ts.map +1 -1
- package/dist/components/SpotlightCommandPanel.vue.js +1 -1
- package/dist/components/SpotlightCommandPanel2.vue.js +41 -40
- package/dist/components/SpotlightRoot.vue.d.ts.map +1 -1
- package/dist/components/SpotlightRoot.vue.js +21 -19
- package/dist/components/SpotlightThinking.vue.d.ts +3 -0
- package/dist/components/SpotlightThinking.vue.d.ts.map +1 -1
- package/dist/components/SpotlightThinking.vue.js +2 -2
- package/dist/components/SpotlightThinking2.vue.js +126 -114
- package/dist/composables/useSpotlightPanelUi.d.ts +3 -1
- package/dist/composables/useSpotlightPanelUi.d.ts.map +1 -1
- package/dist/composables/useSpotlightPanelUi.js +8 -3
- package/dist/remote/runPipeline.d.ts +3 -1
- package/dist/remote/runPipeline.d.ts.map +1 -1
- package/dist/remote/runPipeline.js +149 -133
- package/dist/remote/types.d.ts +2 -0
- package/dist/remote/types.d.ts.map +1 -1
- package/dist/store/spotlightStore.d.ts +68 -2
- package/dist/store/spotlightStore.d.ts.map +1 -1
- package/dist/store/spotlightStore.js +130 -124
- package/package.json +3 -3
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { SpotlightMemoryDecision } from "@inupedia/spotlight-protocol";
|
|
1
2
|
import type { AgentStep } from "./types.js";
|
|
2
3
|
import type { SpotlightExecutionEvent } from "./runtime/types.js";
|
|
3
4
|
import type { HandlerApi } from "./pipeline/types.js";
|
|
@@ -30,7 +31,7 @@ type SpotlightTelemetrySnapshot = {
|
|
|
30
31
|
timeline: SpotlightTimelineEvent[];
|
|
31
32
|
failureSummary: SpotlightFailureSummary | null;
|
|
32
33
|
};
|
|
33
|
-
export type { AgentStep, IntentWithReason, SubIntentConfig
|
|
34
|
+
export type { AgentStep, IntentWithReason, SubIntentConfig } from "./types.js";
|
|
34
35
|
export { SpotlightIntent, SPOTLIGHT_INTENT_LABELS, ProgressSubIntent, PROGRESS_SUB_INTENT_LABELS, InvestmentSubIntent, INVESTMENT_SUB_INTENT_LABELS, QualitySubIntent, QUALITY_SUB_INTENT_LABELS, SafetySubIntent, SAFETY_SUB_INTENT_LABELS, SUB_INTENT_CONFIG, } from "./types.js";
|
|
35
36
|
export type SpotlightSkillPermissionRequest = {
|
|
36
37
|
skillName: string;
|
|
@@ -56,6 +57,8 @@ export declare const useSpotlightStore: import("pinia").StoreDefinition<"spotlig
|
|
|
56
57
|
pipelineRunId: number;
|
|
57
58
|
pipelineAbortController: AbortController | null;
|
|
58
59
|
lastMemoryReplay: SpotlightMemoryReplayBadge | null;
|
|
60
|
+
lastMemoryDecision: SpotlightMemoryDecision | null;
|
|
61
|
+
lastSubmittedQuestion: string;
|
|
59
62
|
telemetrySnapshots: SpotlightTelemetrySnapshot[];
|
|
60
63
|
}, {
|
|
61
64
|
uiExecutionEvents(state: {
|
|
@@ -457,6 +460,16 @@ export declare const useSpotlightStore: import("pinia").StoreDefinition<"spotlig
|
|
|
457
460
|
entryId: string;
|
|
458
461
|
kind: string;
|
|
459
462
|
} | null;
|
|
463
|
+
lastMemoryDecision: {
|
|
464
|
+
action: import("@inupedia/spotlight-protocol").SpotlightMemoryDecisionAction;
|
|
465
|
+
reasonCode: string;
|
|
466
|
+
confidence: number;
|
|
467
|
+
memoryIds: string[];
|
|
468
|
+
sourceLabel?: string | undefined;
|
|
469
|
+
verifiedAt?: number | undefined;
|
|
470
|
+
canForceRefresh: boolean;
|
|
471
|
+
} | null;
|
|
472
|
+
lastSubmittedQuestion: string;
|
|
460
473
|
telemetrySnapshots: {
|
|
461
474
|
turnId: string;
|
|
462
475
|
recordedAt: number;
|
|
@@ -763,6 +776,8 @@ export declare const useSpotlightStore: import("pinia").StoreDefinition<"spotlig
|
|
|
763
776
|
pipelineRunId: number;
|
|
764
777
|
pipelineAbortController: AbortController | null;
|
|
765
778
|
lastMemoryReplay: SpotlightMemoryReplayBadge | null;
|
|
779
|
+
lastMemoryDecision: SpotlightMemoryDecision | null;
|
|
780
|
+
lastSubmittedQuestion: string;
|
|
766
781
|
telemetrySnapshots: SpotlightTelemetrySnapshot[];
|
|
767
782
|
}>): SpotlightExecutionEvent[];
|
|
768
783
|
telemetryExecutionEvents(state: {
|
|
@@ -1164,6 +1179,16 @@ export declare const useSpotlightStore: import("pinia").StoreDefinition<"spotlig
|
|
|
1164
1179
|
entryId: string;
|
|
1165
1180
|
kind: string;
|
|
1166
1181
|
} | null;
|
|
1182
|
+
lastMemoryDecision: {
|
|
1183
|
+
action: import("@inupedia/spotlight-protocol").SpotlightMemoryDecisionAction;
|
|
1184
|
+
reasonCode: string;
|
|
1185
|
+
confidence: number;
|
|
1186
|
+
memoryIds: string[];
|
|
1187
|
+
sourceLabel?: string | undefined;
|
|
1188
|
+
verifiedAt?: number | undefined;
|
|
1189
|
+
canForceRefresh: boolean;
|
|
1190
|
+
} | null;
|
|
1191
|
+
lastSubmittedQuestion: string;
|
|
1167
1192
|
telemetrySnapshots: {
|
|
1168
1193
|
turnId: string;
|
|
1169
1194
|
recordedAt: number;
|
|
@@ -1470,6 +1495,8 @@ export declare const useSpotlightStore: import("pinia").StoreDefinition<"spotlig
|
|
|
1470
1495
|
pipelineRunId: number;
|
|
1471
1496
|
pipelineAbortController: AbortController | null;
|
|
1472
1497
|
lastMemoryReplay: SpotlightMemoryReplayBadge | null;
|
|
1498
|
+
lastMemoryDecision: SpotlightMemoryDecision | null;
|
|
1499
|
+
lastSubmittedQuestion: string;
|
|
1473
1500
|
telemetrySnapshots: SpotlightTelemetrySnapshot[];
|
|
1474
1501
|
}>): SpotlightExecutionEvent[];
|
|
1475
1502
|
turnTimelines(state: {
|
|
@@ -1871,6 +1898,16 @@ export declare const useSpotlightStore: import("pinia").StoreDefinition<"spotlig
|
|
|
1871
1898
|
entryId: string;
|
|
1872
1899
|
kind: string;
|
|
1873
1900
|
} | null;
|
|
1901
|
+
lastMemoryDecision: {
|
|
1902
|
+
action: import("@inupedia/spotlight-protocol").SpotlightMemoryDecisionAction;
|
|
1903
|
+
reasonCode: string;
|
|
1904
|
+
confidence: number;
|
|
1905
|
+
memoryIds: string[];
|
|
1906
|
+
sourceLabel?: string | undefined;
|
|
1907
|
+
verifiedAt?: number | undefined;
|
|
1908
|
+
canForceRefresh: boolean;
|
|
1909
|
+
} | null;
|
|
1910
|
+
lastSubmittedQuestion: string;
|
|
1874
1911
|
telemetrySnapshots: {
|
|
1875
1912
|
turnId: string;
|
|
1876
1913
|
recordedAt: number;
|
|
@@ -2177,6 +2214,8 @@ export declare const useSpotlightStore: import("pinia").StoreDefinition<"spotlig
|
|
|
2177
2214
|
pipelineRunId: number;
|
|
2178
2215
|
pipelineAbortController: AbortController | null;
|
|
2179
2216
|
lastMemoryReplay: SpotlightMemoryReplayBadge | null;
|
|
2217
|
+
lastMemoryDecision: SpotlightMemoryDecision | null;
|
|
2218
|
+
lastSubmittedQuestion: string;
|
|
2180
2219
|
telemetrySnapshots: SpotlightTelemetrySnapshot[];
|
|
2181
2220
|
}>): SpotlightTimelineEvent[][];
|
|
2182
2221
|
latestTurnTimeline(): SpotlightTimelineEvent[];
|
|
@@ -2579,6 +2618,16 @@ export declare const useSpotlightStore: import("pinia").StoreDefinition<"spotlig
|
|
|
2579
2618
|
entryId: string;
|
|
2580
2619
|
kind: string;
|
|
2581
2620
|
} | null;
|
|
2621
|
+
lastMemoryDecision: {
|
|
2622
|
+
action: import("@inupedia/spotlight-protocol").SpotlightMemoryDecisionAction;
|
|
2623
|
+
reasonCode: string;
|
|
2624
|
+
confidence: number;
|
|
2625
|
+
memoryIds: string[];
|
|
2626
|
+
sourceLabel?: string | undefined;
|
|
2627
|
+
verifiedAt?: number | undefined;
|
|
2628
|
+
canForceRefresh: boolean;
|
|
2629
|
+
} | null;
|
|
2630
|
+
lastSubmittedQuestion: string;
|
|
2582
2631
|
telemetrySnapshots: {
|
|
2583
2632
|
turnId: string;
|
|
2584
2633
|
recordedAt: number;
|
|
@@ -2885,6 +2934,8 @@ export declare const useSpotlightStore: import("pinia").StoreDefinition<"spotlig
|
|
|
2885
2934
|
pipelineRunId: number;
|
|
2886
2935
|
pipelineAbortController: AbortController | null;
|
|
2887
2936
|
lastMemoryReplay: SpotlightMemoryReplayBadge | null;
|
|
2937
|
+
lastMemoryDecision: SpotlightMemoryDecision | null;
|
|
2938
|
+
lastSubmittedQuestion: string;
|
|
2888
2939
|
telemetrySnapshots: SpotlightTelemetrySnapshot[];
|
|
2889
2940
|
}>): SpotlightFailureSummary | null;
|
|
2890
2941
|
latestTelemetrySnapshot(state: {
|
|
@@ -3286,6 +3337,16 @@ export declare const useSpotlightStore: import("pinia").StoreDefinition<"spotlig
|
|
|
3286
3337
|
entryId: string;
|
|
3287
3338
|
kind: string;
|
|
3288
3339
|
} | null;
|
|
3340
|
+
lastMemoryDecision: {
|
|
3341
|
+
action: import("@inupedia/spotlight-protocol").SpotlightMemoryDecisionAction;
|
|
3342
|
+
reasonCode: string;
|
|
3343
|
+
confidence: number;
|
|
3344
|
+
memoryIds: string[];
|
|
3345
|
+
sourceLabel?: string | undefined;
|
|
3346
|
+
verifiedAt?: number | undefined;
|
|
3347
|
+
canForceRefresh: boolean;
|
|
3348
|
+
} | null;
|
|
3349
|
+
lastSubmittedQuestion: string;
|
|
3289
3350
|
telemetrySnapshots: {
|
|
3290
3351
|
turnId: string;
|
|
3291
3352
|
recordedAt: number;
|
|
@@ -3592,6 +3653,8 @@ export declare const useSpotlightStore: import("pinia").StoreDefinition<"spotlig
|
|
|
3592
3653
|
pipelineRunId: number;
|
|
3593
3654
|
pipelineAbortController: AbortController | null;
|
|
3594
3655
|
lastMemoryReplay: SpotlightMemoryReplayBadge | null;
|
|
3656
|
+
lastMemoryDecision: SpotlightMemoryDecision | null;
|
|
3657
|
+
lastSubmittedQuestion: string;
|
|
3595
3658
|
telemetrySnapshots: SpotlightTelemetrySnapshot[];
|
|
3596
3659
|
}>): SpotlightTelemetrySnapshot | null;
|
|
3597
3660
|
}, {
|
|
@@ -3627,7 +3690,10 @@ export declare const useSpotlightStore: import("pinia").StoreDefinition<"spotlig
|
|
|
3627
3690
|
buildHandlerApi(runId: number, signal: AbortSignal): HandlerApi;
|
|
3628
3691
|
selectNext(): void;
|
|
3629
3692
|
selectPrev(): void;
|
|
3630
|
-
submit(
|
|
3693
|
+
submit(options?: {
|
|
3694
|
+
forceMemoryRefresh?: boolean;
|
|
3695
|
+
}): Promise<void>;
|
|
3696
|
+
forceRefreshLastAnswer(): Promise<void>;
|
|
3631
3697
|
handleEnter(): void;
|
|
3632
3698
|
}>;
|
|
3633
3699
|
//# sourceMappingURL=spotlightStore.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"spotlightStore.d.ts","sourceRoot":"","sources":["../../src/store/spotlightStore.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"spotlightStore.d.ts","sourceRoot":"","sources":["../../src/store/spotlightStore.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,8BAA8B,CAAC;AAY5E,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAM5C,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,oBAAoB,CAAC;AAMlE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAStD,KAAK,aAAa,GAAG,MAAM,GAAG,SAAS,GAAG,WAAW,GAAG,OAAO,GAAG,MAAM,CAAC;AAIzE,MAAM,MAAM,0BAA0B,GAAG;IACvC,MAAM,EAAE,OAAO,GAAG,UAAU,GAAG,SAAS,CAAC;IACzC,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,MAAM,CAAC;CACd,CAAC;AAEF,KAAK,iCAAiC,GAClC,cAAc,GACd,cAAc,GACd,eAAe,GACf,WAAW,GACX,qBAAqB,GACr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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;wBAKR,MAAM;4BACF,MAAM;8BACJ,MAAM,GAAG,IAAI;0BACjB,iCAAiC;2BAChC,MAAM;4BACL,MAAM,EAAE;;;;;;;;gBA+MF,MAAM,GAAG,IAAI;;;oBAGX,SAAS,EAAE;yBACN,uBAAuB,EAAE;gCAChB,+BAA+B,GAAG,IAAI;yBAC/C,MAAM,EAAE;4BACL,MAAM,EAAE;uBACT,aAAa;;iCAEL,eAAe,GAAG,IAAI;0BAC7B,0BAA0B,GAAG,IAAI;4BAC/B,uBAAuB,GAAG,IAAI;;4BAG5B,0BAA0B,EAAE;SAoB1B,0BAA0B,GAAG,IAAI;;yCAM5B,MAAM;wCAmBP,MAAM,GAAG,MAAM,GAAG,IAAI;qCAMzB,MAAM,GAAG,IAAI;;+BAUnB,MAAM,GAAG,OAAO;;gBAgB/B,MAAM,UAAU,SAAS,CAAC,QAAQ,CAAC,YAAY,MAAM;gCAIrC,uBAAuB;6BAYzC,MAAM,YACJ,MAAM,uCAEC,MAAM,OAAO,GAC7B,OAAO,CAAC,IAAI,CAAC;mCAWN,MAAM,UACN,MAAM,uCAEG,MAAM,OAAO,GAC7B,OAAO,CAAC,IAAI,CAAC;;IAoBhB;;;OAGG;;;gCAcyB,MAAM;;;gCA2BN,MAAM;;;;;uCAyCC,+BAA+B;;;IAelE,kDAAkD;2BAC3B,MAAM,UAAU,WAAW,GAAG,UAAU;;;qBAwDxC;QAAE,kBAAkB,CAAC,EAAE,OAAO,CAAA;KAAE;;;EA+FzD,CAAC"}
|
|
@@ -1,34 +1,34 @@
|
|
|
1
|
-
import { defineStore as
|
|
2
|
-
import { getSpotlightConfig as
|
|
3
|
-
import { runRemoteSpotlightPipeline as
|
|
4
|
-
import { ensureSpotlightMeta as
|
|
5
|
-
import { devWarn as
|
|
6
|
-
import { useAgentSessionStore as
|
|
7
|
-
import { useSpotlightRuntimeStore as
|
|
8
|
-
import { applyPipelineError as
|
|
9
|
-
import { SPOTLIGHT_PIPELINE_STEP_LABELS as
|
|
10
|
-
import { setStepState as
|
|
11
|
-
import { typewriterAppendToStepContent as A, typewriterToStepContent as
|
|
12
|
-
import { addRecentQuestionToList as
|
|
13
|
-
import { getSuggestedQuestions as
|
|
14
|
-
import { buildSpotlightStoreSink as
|
|
15
|
-
import { INVESTMENT_SUB_INTENT_LABELS as
|
|
16
|
-
const
|
|
17
|
-
function
|
|
1
|
+
import { defineStore as f } from "pinia";
|
|
2
|
+
import { getSpotlightConfig as g } from "../plugin.js";
|
|
3
|
+
import { runRemoteSpotlightPipeline as y, warmupSpotlightRemoteContext as a, cancelRemoteSpotlightRunForSignal as T } from "../remote/runPipeline.js";
|
|
4
|
+
import { ensureSpotlightMeta as E } from "../remote/meta.js";
|
|
5
|
+
import { devWarn as I } from "../utils/devConsole.js";
|
|
6
|
+
import { useAgentSessionStore as p } from "../session/agentSession.js";
|
|
7
|
+
import { useSpotlightRuntimeStore as _ } from "./runtimeStore.js";
|
|
8
|
+
import { applyPipelineError as P } from "./pipeline/errors.js";
|
|
9
|
+
import { SPOTLIGHT_PIPELINE_STEP_LABELS as R, SPOTLIGHT_PIPELINE_STEP_IDS as b } from "./pipeline/constants.js";
|
|
10
|
+
import { setStepState as x } from "./pipeline/steps.js";
|
|
11
|
+
import { typewriterAppendToStepContent as A, typewriterToStepContent as v } from "./pipeline/typing.js";
|
|
12
|
+
import { addRecentQuestionToList as Q, persistRecentQuestions as L, loadRecentQuestions as C } from "./recent.js";
|
|
13
|
+
import { getSuggestedQuestions as N } from "./capabilities.js";
|
|
14
|
+
import { buildSpotlightStoreSink as w } from "./storeSink.js";
|
|
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";
|
|
16
|
+
const m = "spotlight-telemetry-snapshots", l = 20;
|
|
17
|
+
function h(e) {
|
|
18
18
|
return e instanceof DOMException && e.name === "AbortError" ? !0 : e instanceof Error && e.name === "AbortError";
|
|
19
19
|
}
|
|
20
20
|
function k() {
|
|
21
21
|
try {
|
|
22
|
-
const e = localStorage.getItem(
|
|
22
|
+
const e = localStorage.getItem(m), i = e ? JSON.parse(e) : [];
|
|
23
23
|
return Array.isArray(i) ? i.slice(0, l) : [];
|
|
24
24
|
} catch {
|
|
25
25
|
return [];
|
|
26
26
|
}
|
|
27
27
|
}
|
|
28
|
-
function
|
|
28
|
+
function c(e) {
|
|
29
29
|
try {
|
|
30
30
|
localStorage.setItem(
|
|
31
|
-
|
|
31
|
+
m,
|
|
32
32
|
JSON.stringify(e.slice(0, l))
|
|
33
33
|
);
|
|
34
34
|
} catch {
|
|
@@ -37,57 +37,57 @@ function h(e) {
|
|
|
37
37
|
function o(e) {
|
|
38
38
|
return e.type === "step_sync" || e.type === "step_status" || e.type === "step_content" || e.type === "step_artifact";
|
|
39
39
|
}
|
|
40
|
-
function
|
|
40
|
+
function B(e) {
|
|
41
41
|
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
42
|
}
|
|
43
|
-
function
|
|
43
|
+
function d(e) {
|
|
44
44
|
const i = /* @__PURE__ */ new Map();
|
|
45
|
-
let
|
|
45
|
+
let s = null;
|
|
46
46
|
for (const t of e) {
|
|
47
|
-
(t.type === "turn_transition" || t.type === "turn_completed") && (
|
|
48
|
-
const
|
|
49
|
-
if (!
|
|
50
|
-
const r = i.get(
|
|
47
|
+
(t.type === "turn_transition" || t.type === "turn_completed") && (s = t.turnId);
|
|
48
|
+
const n = "turnId" in t ? t.turnId : s;
|
|
49
|
+
if (!n || o(t)) continue;
|
|
50
|
+
const r = i.get(n) ?? [];
|
|
51
51
|
r.push({
|
|
52
|
-
turnId:
|
|
52
|
+
turnId: n,
|
|
53
53
|
at: t.at,
|
|
54
54
|
kind: t.type,
|
|
55
55
|
iteration: "iteration" in t ? t.iteration : void 0,
|
|
56
56
|
summary: t.type === "plan" || t.type === "turn_transition" ? t.summary : t.type === "assistant_response" ? t.content : t.type === "tool_result" ? t.result.summary : void 0,
|
|
57
57
|
raw: t
|
|
58
|
-
}), i.set(
|
|
58
|
+
}), i.set(n, r);
|
|
59
59
|
}
|
|
60
60
|
return Array.from(i.values()).sort(
|
|
61
|
-
(t,
|
|
61
|
+
(t, n) => n[0].at - t[0].at
|
|
62
62
|
);
|
|
63
63
|
}
|
|
64
|
-
function
|
|
65
|
-
const
|
|
66
|
-
(
|
|
64
|
+
function S(e, i) {
|
|
65
|
+
const s = [...e].reverse().find(
|
|
66
|
+
(n) => n.type === "turn_completed" && n.turnId === i
|
|
67
67
|
);
|
|
68
|
-
if (!
|
|
68
|
+
if (!s) return null;
|
|
69
69
|
const t = e.filter(
|
|
70
|
-
(
|
|
71
|
-
).map((
|
|
70
|
+
(n) => n.type === "tool_result" && n.result.success === !1 && !!n.result.error
|
|
71
|
+
).map((n) => n.result.error).slice(-5);
|
|
72
72
|
return {
|
|
73
|
-
turnId:
|
|
74
|
-
stopReason:
|
|
75
|
-
failureClass:
|
|
76
|
-
category:
|
|
77
|
-
elapsedMs:
|
|
73
|
+
turnId: s.turnId,
|
|
74
|
+
stopReason: s.stopReason,
|
|
75
|
+
failureClass: s.failureClass,
|
|
76
|
+
category: B(s),
|
|
77
|
+
elapsedMs: s.elapsedMs,
|
|
78
78
|
toolErrors: t
|
|
79
79
|
};
|
|
80
80
|
}
|
|
81
|
-
function
|
|
81
|
+
function M(e) {
|
|
82
82
|
const i = [...e].reverse().find(
|
|
83
|
-
(
|
|
83
|
+
(s) => s.type === "turn_completed"
|
|
84
84
|
);
|
|
85
|
-
return i ?
|
|
85
|
+
return i ? S(e, i.turnId) : null;
|
|
86
86
|
}
|
|
87
|
-
function
|
|
88
|
-
return
|
|
87
|
+
function O(e, i) {
|
|
88
|
+
return d(e).find((s) => s[0]?.turnId === i) ?? [];
|
|
89
89
|
}
|
|
90
|
-
const
|
|
90
|
+
const Z = f("spotlight", {
|
|
91
91
|
state: () => ({
|
|
92
92
|
visible: !1,
|
|
93
93
|
prompt: "",
|
|
@@ -105,6 +105,8 @@ const z = S("spotlight", {
|
|
|
105
105
|
pipelineRunId: 0,
|
|
106
106
|
pipelineAbortController: null,
|
|
107
107
|
lastMemoryReplay: null,
|
|
108
|
+
lastMemoryDecision: null,
|
|
109
|
+
lastSubmittedQuestion: "",
|
|
108
110
|
telemetrySnapshots: k()
|
|
109
111
|
}),
|
|
110
112
|
getters: {
|
|
@@ -117,13 +119,13 @@ const z = S("spotlight", {
|
|
|
117
119
|
);
|
|
118
120
|
},
|
|
119
121
|
turnTimelines(e) {
|
|
120
|
-
return
|
|
122
|
+
return d(e.executionEvents);
|
|
121
123
|
},
|
|
122
124
|
latestTurnTimeline() {
|
|
123
125
|
return this.turnTimelines[0] ?? [];
|
|
124
126
|
},
|
|
125
127
|
latestFailureSummary(e) {
|
|
126
|
-
return
|
|
128
|
+
return M(e.executionEvents);
|
|
127
129
|
},
|
|
128
130
|
latestTelemetrySnapshot(e) {
|
|
129
131
|
return e.telemetrySnapshots[0] ?? null;
|
|
@@ -131,24 +133,24 @@ const z = S("spotlight", {
|
|
|
131
133
|
},
|
|
132
134
|
actions: {
|
|
133
135
|
persistTurnTelemetrySnapshot(e) {
|
|
134
|
-
const i =
|
|
136
|
+
const i = O(this.executionEvents, e);
|
|
135
137
|
if (!i.length) return;
|
|
136
|
-
const
|
|
138
|
+
const s = {
|
|
137
139
|
turnId: e,
|
|
138
140
|
recordedAt: Date.now(),
|
|
139
141
|
timeline: i,
|
|
140
|
-
failureSummary:
|
|
142
|
+
failureSummary: S(
|
|
141
143
|
this.executionEvents,
|
|
142
144
|
e
|
|
143
145
|
)
|
|
144
146
|
};
|
|
145
147
|
this.telemetrySnapshots = [
|
|
146
|
-
|
|
148
|
+
s,
|
|
147
149
|
...this.telemetrySnapshots.filter((t) => t.turnId !== e)
|
|
148
|
-
].slice(0, l),
|
|
150
|
+
].slice(0, l), c(this.telemetrySnapshots);
|
|
149
151
|
},
|
|
150
152
|
exportTurnTelemetrySnapshot(e) {
|
|
151
|
-
const i = this.telemetrySnapshots.find((
|
|
153
|
+
const i = this.telemetrySnapshots.find((s) => s.turnId === e) ?? null;
|
|
152
154
|
return i ? JSON.stringify(i, null, 2) : null;
|
|
153
155
|
},
|
|
154
156
|
exportLatestTelemetrySnapshot() {
|
|
@@ -156,65 +158,65 @@ const z = S("spotlight", {
|
|
|
156
158
|
return e ? JSON.stringify(e, null, 2) : null;
|
|
157
159
|
},
|
|
158
160
|
clearTelemetrySnapshots() {
|
|
159
|
-
this.telemetrySnapshots = [],
|
|
161
|
+
this.telemetrySnapshots = [], c([]);
|
|
160
162
|
},
|
|
161
163
|
isPipelineRunActive(e) {
|
|
162
164
|
return this.pipelineRunId === e && this.pipelinePhase === "running";
|
|
163
165
|
},
|
|
164
166
|
cancelPipeline() {
|
|
165
|
-
this.pipelineAbortController && (
|
|
167
|
+
this.pipelineAbortController && (T(this.pipelineAbortController.signal), this.pipelineAbortController.abort(), this.pipelineAbortController = null), this.loading && (this.loading = !1), this.pipelinePhase === "running" && (this.pipelinePhase = "cancelled");
|
|
166
168
|
},
|
|
167
|
-
setStep(e, i,
|
|
168
|
-
|
|
169
|
+
setStep(e, i, s) {
|
|
170
|
+
x(this.agentSteps, e, i, s);
|
|
169
171
|
},
|
|
170
172
|
recordExecutionEvent(e) {
|
|
171
173
|
this.executionEvents.push(e), this.executionEvents.length > 500 && this.executionEvents.splice(0, this.executionEvents.length - 500), e.type === "turn_completed" && this.persistTurnTelemetrySnapshot(e.turnId);
|
|
172
174
|
},
|
|
173
|
-
async typewriterToStep(e, i,
|
|
174
|
-
return
|
|
175
|
+
async typewriterToStep(e, i, s = 24, t) {
|
|
176
|
+
return v(
|
|
175
177
|
this.agentSteps,
|
|
176
178
|
e,
|
|
177
179
|
i,
|
|
178
|
-
|
|
180
|
+
s,
|
|
179
181
|
t
|
|
180
182
|
);
|
|
181
183
|
},
|
|
182
|
-
async typewriterAppendToStep(e, i,
|
|
184
|
+
async typewriterAppendToStep(e, i, s = 24, t) {
|
|
183
185
|
return A(
|
|
184
186
|
this.agentSteps,
|
|
185
187
|
e,
|
|
186
188
|
i,
|
|
187
|
-
|
|
189
|
+
s,
|
|
188
190
|
t
|
|
189
191
|
);
|
|
190
192
|
},
|
|
191
193
|
open() {
|
|
192
|
-
this.visible = !0, this.loadRecentQuestions(), this.refreshSuggestedQuestions(),
|
|
194
|
+
this.visible = !0, this.loadRecentQuestions(), this.refreshSuggestedQuestions(), a(), this.selectedIndex = -1, this.prompt = "", this.error = "";
|
|
193
195
|
},
|
|
194
196
|
/**
|
|
195
197
|
* ⌘/Ctrl+L 显示数字人时:与 open() 同步推荐问法、历史与输入壳状态,但不打开面板(visible 不变)。
|
|
196
198
|
* 用于「语音等同 Spotlight 文字输入」通道,Thinking 仍走 submit(),布局与 ⌘K 一致。
|
|
197
199
|
*/
|
|
198
200
|
prepareLive2dVoiceChannel() {
|
|
199
|
-
this.loadRecentQuestions(), this.refreshSuggestedQuestions(),
|
|
201
|
+
this.loadRecentQuestions(), this.refreshSuggestedQuestions(), a(), this.selectedIndex = -1, this.prompt = "", this.error = "";
|
|
200
202
|
},
|
|
201
203
|
loadRecentQuestions() {
|
|
202
|
-
this.recentQuestions =
|
|
204
|
+
this.recentQuestions = C();
|
|
203
205
|
},
|
|
204
206
|
addRecentQuestion(e) {
|
|
205
|
-
this.recentQuestions =
|
|
207
|
+
this.recentQuestions = Q(
|
|
206
208
|
this.recentQuestions,
|
|
207
209
|
e
|
|
208
|
-
),
|
|
210
|
+
), L(this.recentQuestions);
|
|
209
211
|
},
|
|
210
212
|
async refreshSuggestedQuestions() {
|
|
211
|
-
await
|
|
212
|
-
const e =
|
|
213
|
+
await E();
|
|
214
|
+
const e = g(), i = e.getUiContext?.() ?? {}, s = _(), t = {
|
|
213
215
|
sceneLevel: i.sceneLevel ?? null,
|
|
214
216
|
smallTab: i.smallTab ?? null,
|
|
215
|
-
activeTarget:
|
|
217
|
+
activeTarget: s.activeTarget
|
|
216
218
|
};
|
|
217
|
-
this.suggestedQuestions = e.getSuggestedQuestions?.(t) ??
|
|
219
|
+
this.suggestedQuestions = e.getSuggestedQuestions?.(t) ?? N(t);
|
|
218
220
|
},
|
|
219
221
|
getSelectionQuestions() {
|
|
220
222
|
return [...this.suggestedQuestions, ...this.recentQuestions];
|
|
@@ -235,7 +237,7 @@ const z = S("spotlight", {
|
|
|
235
237
|
this.visible = !1, this.showThinkingBar = !0;
|
|
236
238
|
},
|
|
237
239
|
closeThinking() {
|
|
238
|
-
this.cancelPipeline(), this.showThinkingBar = !1, this.agentSteps = [], this.executionEvents = [], this.pendingSkillPermission = null, this.error = "", this.result = null, this.lastMemoryReplay = null, this.pipelinePhase = "idle";
|
|
240
|
+
this.cancelPipeline(), this.showThinkingBar = !1, this.agentSteps = [], this.executionEvents = [], this.pendingSkillPermission = null, this.error = "", this.result = null, this.lastMemoryReplay = null, this.lastMemoryDecision = null, this.pipelinePhase = "idle";
|
|
239
241
|
},
|
|
240
242
|
setPendingSkillPermission(e) {
|
|
241
243
|
this.pendingSkillPermission = e;
|
|
@@ -245,32 +247,32 @@ const z = S("spotlight", {
|
|
|
245
247
|
},
|
|
246
248
|
approvePendingSkillPermission() {
|
|
247
249
|
const e = this.pendingSkillPermission;
|
|
248
|
-
e && (
|
|
250
|
+
e && (p().grantSkillPermission(e.skillName), this.pendingSkillPermission = null);
|
|
249
251
|
},
|
|
250
252
|
/** 供 pipeline handlers 使用,不直接依赖 pinia 的 api 封装 */
|
|
251
253
|
buildHandlerApi(e, i) {
|
|
252
|
-
const
|
|
253
|
-
return
|
|
254
|
+
const s = () => this.isPipelineRunActive(e);
|
|
255
|
+
return w({
|
|
254
256
|
signal: i,
|
|
255
|
-
isCurrentRun:
|
|
257
|
+
isCurrentRun: s,
|
|
256
258
|
getSteps: () => this.agentSteps,
|
|
257
259
|
replaceSteps: (t) => {
|
|
258
260
|
this.agentSteps = t;
|
|
259
261
|
},
|
|
260
|
-
setStep: (t,
|
|
261
|
-
this.setStep(t,
|
|
262
|
+
setStep: (t, n, r) => {
|
|
263
|
+
this.setStep(t, n, r);
|
|
262
264
|
},
|
|
263
|
-
typewriterToStep: (t,
|
|
265
|
+
typewriterToStep: (t, n, r) => this.typewriterToStep(
|
|
264
266
|
t,
|
|
265
|
-
|
|
267
|
+
n,
|
|
266
268
|
r,
|
|
267
|
-
|
|
269
|
+
s
|
|
268
270
|
),
|
|
269
|
-
typewriterAppendToStep: (t,
|
|
271
|
+
typewriterAppendToStep: (t, n, r) => this.typewriterAppendToStep(
|
|
270
272
|
t,
|
|
271
|
-
|
|
273
|
+
n,
|
|
272
274
|
r,
|
|
273
|
-
|
|
275
|
+
s
|
|
274
276
|
),
|
|
275
277
|
setError: (t) => {
|
|
276
278
|
this.error = t;
|
|
@@ -293,52 +295,56 @@ const z = S("spotlight", {
|
|
|
293
295
|
const e = this.getSelectionQuestions().length;
|
|
294
296
|
e && (this.selectedIndex = this.selectedIndex < 0 ? e - 1 : (this.selectedIndex - 1 + e) % e);
|
|
295
297
|
},
|
|
296
|
-
async submit() {
|
|
298
|
+
async submit(e) {
|
|
297
299
|
if (!this.prompt.trim() || this.loading) return;
|
|
298
|
-
const
|
|
299
|
-
this.pipelineRunId =
|
|
300
|
-
const
|
|
301
|
-
this.pipelineAbortController =
|
|
302
|
-
const
|
|
303
|
-
this.addRecentQuestion(
|
|
300
|
+
const i = this.pipelineRunId + 1;
|
|
301
|
+
this.pipelineRunId = i;
|
|
302
|
+
const s = new AbortController();
|
|
303
|
+
this.pipelineAbortController = s, this.pipelinePhase = "running", this.loading = !0, this.error = "", this.result = null, this.lastMemoryReplay = null, this.lastMemoryDecision = null, this.executionEvents = [];
|
|
304
|
+
const t = this.prompt.trim();
|
|
305
|
+
this.lastSubmittedQuestion = t, this.addRecentQuestion(t), this.agentSteps = [], this.openThinkingBar();
|
|
304
306
|
try {
|
|
305
|
-
const
|
|
307
|
+
const n = this.buildHandlerApi(i, s.signal);
|
|
306
308
|
try {
|
|
307
|
-
const
|
|
309
|
+
const r = await y(
|
|
310
|
+
t,
|
|
308
311
|
n,
|
|
309
|
-
|
|
312
|
+
e
|
|
310
313
|
);
|
|
311
|
-
|
|
312
|
-
const
|
|
313
|
-
|
|
314
|
-
} catch (
|
|
315
|
-
if (!this.isPipelineRunActive(
|
|
316
|
-
if (
|
|
314
|
+
r.memoryReplay && (this.lastMemoryReplay = r.memoryReplay), r.memoryDecision && (this.lastMemoryDecision = r.memoryDecision);
|
|
315
|
+
const u = p();
|
|
316
|
+
u.pushTurn("user", t, "main_task"), r.assistantReply?.trim() && u.pushTurn("assistant", r.assistantReply, "main_task");
|
|
317
|
+
} catch (r) {
|
|
318
|
+
if (!this.isPipelineRunActive(i)) return;
|
|
319
|
+
if (h(r)) {
|
|
317
320
|
this.pipelinePhase = "cancelled";
|
|
318
321
|
return;
|
|
319
322
|
}
|
|
320
|
-
throw
|
|
323
|
+
throw I("Spotlight", "远程流水线异常(将向上抛出)", r), r;
|
|
321
324
|
}
|
|
322
|
-
} catch (
|
|
323
|
-
if (!this.isPipelineRunActive(
|
|
324
|
-
if (
|
|
325
|
+
} catch (n) {
|
|
326
|
+
if (!this.isPipelineRunActive(i)) return;
|
|
327
|
+
if (h(n)) {
|
|
325
328
|
this.pipelinePhase = "cancelled";
|
|
326
329
|
return;
|
|
327
330
|
}
|
|
328
|
-
const
|
|
331
|
+
const r = n instanceof Error ? n.message : "解析失败";
|
|
329
332
|
this.agentSteps.length === 0 && (this.agentSteps = [
|
|
330
333
|
{
|
|
331
|
-
id:
|
|
332
|
-
label:
|
|
334
|
+
id: b.intent,
|
|
335
|
+
label: R.intent,
|
|
333
336
|
status: "error",
|
|
334
|
-
content:
|
|
337
|
+
content: r
|
|
335
338
|
}
|
|
336
|
-
]),
|
|
339
|
+
]), P(this.buildHandlerApi(i, s.signal), r), this.pipelinePhase = "error";
|
|
337
340
|
} finally {
|
|
338
|
-
const
|
|
339
|
-
(this.isPipelineRunActive(
|
|
341
|
+
const n = this.pipelinePhase;
|
|
342
|
+
(this.isPipelineRunActive(i) || n === "done") && (this.loading = !1, this.pipelineAbortController = null, n === "running" && (this.pipelinePhase = "done"));
|
|
340
343
|
}
|
|
341
344
|
},
|
|
345
|
+
async forceRefreshLastAnswer() {
|
|
346
|
+
this.loading || !this.lastSubmittedQuestion.trim() || (this.prompt = this.lastSubmittedQuestion, await this.submit({ forceMemoryRefresh: !0 }));
|
|
347
|
+
},
|
|
342
348
|
handleEnter() {
|
|
343
349
|
if (!this.loading) {
|
|
344
350
|
if (!this.prompt.trim()) {
|
|
@@ -351,16 +357,16 @@ const z = S("spotlight", {
|
|
|
351
357
|
}
|
|
352
358
|
});
|
|
353
359
|
export {
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
360
|
+
te as INVESTMENT_SUB_INTENT_LABELS,
|
|
361
|
+
ie as InvestmentSubIntent,
|
|
362
|
+
se as PROGRESS_SUB_INTENT_LABELS,
|
|
357
363
|
ne as ProgressSubIntent,
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
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
|
+
Z as useSpotlightStore
|
|
366
372
|
};
|