@inupedia/spotlight-client 0.2.8 → 0.2.10
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 +52 -0
- package/dist/hostCore.d.ts +58 -0
- package/dist/hostCore.d.ts.map +1 -0
- package/dist/hostCore.js +142 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -2,6 +2,58 @@
|
|
|
2
2
|
|
|
3
3
|
Spotlight **宿主侧执行层** + **Inupedia skills/service 标准**。
|
|
4
4
|
|
|
5
|
+
## Framework-neutral Host Core
|
|
6
|
+
|
|
7
|
+
`createSpotlightHostCore` 是任意 frontend 接入 Spotlight SaaS 的最小核心。它不依赖 Vue、DOM、Pinia、Cesium,也不要求项目提供 scene/tab。
|
|
8
|
+
|
|
9
|
+
```ts
|
|
10
|
+
import { createSpotlightHostCore } from "@inupedia/spotlight-client";
|
|
11
|
+
|
|
12
|
+
const hostCore = createSpotlightHostCore({
|
|
13
|
+
actions: [
|
|
14
|
+
{
|
|
15
|
+
name: "ui.openSettings",
|
|
16
|
+
displayName: "Open settings",
|
|
17
|
+
description: "打开设置面板",
|
|
18
|
+
handler: () => openSettings(),
|
|
19
|
+
},
|
|
20
|
+
],
|
|
21
|
+
readables: [
|
|
22
|
+
{
|
|
23
|
+
id: "route",
|
|
24
|
+
description: "当前页面",
|
|
25
|
+
value: () => router.currentRoute.value.name,
|
|
26
|
+
},
|
|
27
|
+
],
|
|
28
|
+
onToolComplete(toolName, input, result) {
|
|
29
|
+
telemetry.record(toolName, input, result);
|
|
30
|
+
},
|
|
31
|
+
});
|
|
32
|
+
|
|
33
|
+
hostCore.listTools();
|
|
34
|
+
await hostCore.runTool("ui.openSettings", {});
|
|
35
|
+
hostCore.getUiContext();
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
Vanilla frontend 也可以直接用:
|
|
39
|
+
|
|
40
|
+
```ts
|
|
41
|
+
const unregister = hostCore.registerAction({
|
|
42
|
+
name: "cart.checkout",
|
|
43
|
+
description: "提交购物车",
|
|
44
|
+
handler: async ({ cartId }) => checkout(String(cartId)),
|
|
45
|
+
});
|
|
46
|
+
|
|
47
|
+
unregister();
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
核心概念只有两类:
|
|
51
|
+
|
|
52
|
+
- `readables`:把当前 UI/业务状态以 `{ description, value }` 暴露给 Spotlight。
|
|
53
|
+
- `actions`:把 frontend 可执行动作以 `{ name, description, handler }` 暴露成 host tools。
|
|
54
|
+
|
|
55
|
+
ydjm 的 `ensureMainScene`、`ensureSmallTab`、Cesium scene 等能力不是 SDK 必填项。需要这类导航前置能力的项目,可以继续通过旧 `@agent` registry 兼容桥注入。
|
|
56
|
+
|
|
5
57
|
## Service 注入(单一 `@agent`)
|
|
6
58
|
|
|
7
59
|
在函数上方加一行 `@agent`;**scene / tab / host 由文件路径 + name 自动推断**。
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import type { ToolFieldSchema } from "./defineAgentTool.js";
|
|
2
|
+
import type { ToolExecutionMode } from "./agentRegistry.js";
|
|
3
|
+
import type { ToolResult } from "./agentExecutor.js";
|
|
4
|
+
import type { SpotlightHostTool } from "./host.js";
|
|
5
|
+
export type SpotlightReadableContext = {
|
|
6
|
+
id?: string;
|
|
7
|
+
description: string;
|
|
8
|
+
value: unknown | (() => unknown);
|
|
9
|
+
available?: boolean | (() => boolean);
|
|
10
|
+
scope?: {
|
|
11
|
+
agentId?: string;
|
|
12
|
+
projectId?: string;
|
|
13
|
+
};
|
|
14
|
+
};
|
|
15
|
+
export type SpotlightActionContext = {
|
|
16
|
+
signal?: AbortSignal;
|
|
17
|
+
toolName: string;
|
|
18
|
+
toolCallId?: string;
|
|
19
|
+
};
|
|
20
|
+
export type SpotlightFrontendAction<TInput extends Record<string, unknown> = Record<string, unknown>> = {
|
|
21
|
+
name: string;
|
|
22
|
+
displayName?: string;
|
|
23
|
+
description: string;
|
|
24
|
+
input?: Record<string, ToolFieldSchema>;
|
|
25
|
+
handler: (input: TInput, context: SpotlightActionContext) => Promise<unknown> | unknown;
|
|
26
|
+
available?: boolean | (() => boolean);
|
|
27
|
+
exposeToLoop?: boolean;
|
|
28
|
+
executionMode?: ToolExecutionMode;
|
|
29
|
+
};
|
|
30
|
+
export type SpotlightHostCoreSubscriber = (event: SpotlightHostCoreEvent) => void;
|
|
31
|
+
export type SpotlightHostCoreEvent = {
|
|
32
|
+
type: "action:registered";
|
|
33
|
+
action: SpotlightFrontendAction;
|
|
34
|
+
} | {
|
|
35
|
+
type: "action:unregistered";
|
|
36
|
+
name: string;
|
|
37
|
+
} | {
|
|
38
|
+
type: "readable:registered";
|
|
39
|
+
readable: SpotlightReadableContext;
|
|
40
|
+
} | {
|
|
41
|
+
type: "readable:unregistered";
|
|
42
|
+
id: string;
|
|
43
|
+
};
|
|
44
|
+
export type SpotlightHostCoreOptions = {
|
|
45
|
+
actions?: SpotlightFrontendAction[];
|
|
46
|
+
readables?: SpotlightReadableContext[];
|
|
47
|
+
onToolComplete?: (toolName: string, input: unknown, result: ToolResult<unknown>) => void;
|
|
48
|
+
};
|
|
49
|
+
export type SpotlightHostCore = {
|
|
50
|
+
registerAction(action: SpotlightFrontendAction): () => void;
|
|
51
|
+
registerReadable(readable: SpotlightReadableContext): () => void;
|
|
52
|
+
listTools(): SpotlightHostTool[];
|
|
53
|
+
runTool(name: string, input: Record<string, unknown>, context?: Partial<SpotlightActionContext>): Promise<ToolResult<unknown>>;
|
|
54
|
+
getUiContext(): Record<string, unknown>;
|
|
55
|
+
subscribe(subscriber: SpotlightHostCoreSubscriber): () => void;
|
|
56
|
+
};
|
|
57
|
+
export declare function createSpotlightHostCore(options?: SpotlightHostCoreOptions): SpotlightHostCore;
|
|
58
|
+
//# sourceMappingURL=hostCore.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"hostCore.d.ts","s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ACxC,SAAS,CAAC,UAAU,EAAE,2BAA2B,GAAG,MAAM,IAAI,CAAC;CAChE,CAAC;AA0DF,wBAAgB,uBAAuB,CACrC,OAAO,GAAE,wBAA6B,GACrC,iBAAiB,CA+GnB"}
|
package/dist/hostCore.js
ADDED
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
function nowTrace(tool, type, detail) {
|
|
2
|
+
return {
|
|
3
|
+
phase: "execution",
|
|
4
|
+
source: "spotlight_action",
|
|
5
|
+
type,
|
|
6
|
+
tool,
|
|
7
|
+
detail,
|
|
8
|
+
at: Date.now(),
|
|
9
|
+
elapsedMs: 0,
|
|
10
|
+
};
|
|
11
|
+
}
|
|
12
|
+
function ok(toolName, data) {
|
|
13
|
+
return {
|
|
14
|
+
success: true,
|
|
15
|
+
data,
|
|
16
|
+
executionTarget: "host",
|
|
17
|
+
trace: [nowTrace(toolName, "done")],
|
|
18
|
+
};
|
|
19
|
+
}
|
|
20
|
+
function fail(toolName, errorCode, error) {
|
|
21
|
+
return {
|
|
22
|
+
success: false,
|
|
23
|
+
errorCode,
|
|
24
|
+
error,
|
|
25
|
+
executionTarget: "host",
|
|
26
|
+
trace: [nowTrace(toolName, "run_failed", error)],
|
|
27
|
+
};
|
|
28
|
+
}
|
|
29
|
+
function isEnabled(entry) {
|
|
30
|
+
if (entry.available === undefined)
|
|
31
|
+
return true;
|
|
32
|
+
return typeof entry.available === "function"
|
|
33
|
+
? entry.available()
|
|
34
|
+
: entry.available;
|
|
35
|
+
}
|
|
36
|
+
function readableKey(readable) {
|
|
37
|
+
return readable.id?.trim() || readable.description;
|
|
38
|
+
}
|
|
39
|
+
export function createSpotlightHostCore(options = {}) {
|
|
40
|
+
const actions = new Map();
|
|
41
|
+
const readables = new Map();
|
|
42
|
+
const subscribers = new Set();
|
|
43
|
+
const emit = (event) => {
|
|
44
|
+
for (const subscriber of subscribers) {
|
|
45
|
+
subscriber(event);
|
|
46
|
+
}
|
|
47
|
+
};
|
|
48
|
+
const core = {
|
|
49
|
+
registerAction(action) {
|
|
50
|
+
actions.set(action.name, action);
|
|
51
|
+
emit({ type: "action:registered", action });
|
|
52
|
+
return () => {
|
|
53
|
+
if (actions.get(action.name) !== action)
|
|
54
|
+
return;
|
|
55
|
+
actions.delete(action.name);
|
|
56
|
+
emit({ type: "action:unregistered", name: action.name });
|
|
57
|
+
};
|
|
58
|
+
},
|
|
59
|
+
registerReadable(readable) {
|
|
60
|
+
const key = readableKey(readable);
|
|
61
|
+
readables.set(key, { ...readable, key });
|
|
62
|
+
emit({ type: "readable:registered", readable });
|
|
63
|
+
return () => {
|
|
64
|
+
const current = readables.get(key);
|
|
65
|
+
if (!current || current.description !== readable.description)
|
|
66
|
+
return;
|
|
67
|
+
readables.delete(key);
|
|
68
|
+
emit({ type: "readable:unregistered", id: key });
|
|
69
|
+
};
|
|
70
|
+
},
|
|
71
|
+
listTools() {
|
|
72
|
+
return Array.from(actions.values())
|
|
73
|
+
.filter(isEnabled)
|
|
74
|
+
.map((action) => ({
|
|
75
|
+
name: action.name,
|
|
76
|
+
displayName: action.displayName,
|
|
77
|
+
description: action.description,
|
|
78
|
+
handler: async ({ input, call }) => {
|
|
79
|
+
const result = await core.runTool(action.name, input, {
|
|
80
|
+
toolCallId: call.id,
|
|
81
|
+
});
|
|
82
|
+
if (!result.success) {
|
|
83
|
+
throw new Error(result.error ?? `Host action failed: ${action.name}`);
|
|
84
|
+
}
|
|
85
|
+
return result.data;
|
|
86
|
+
},
|
|
87
|
+
}));
|
|
88
|
+
},
|
|
89
|
+
async runTool(name, input, context = {}) {
|
|
90
|
+
const action = actions.get(name);
|
|
91
|
+
if (!action) {
|
|
92
|
+
const result = fail(name, "UNKNOWN_TOOL", `未知 Host action: ${name}`);
|
|
93
|
+
options.onToolComplete?.(name, input, result);
|
|
94
|
+
return result;
|
|
95
|
+
}
|
|
96
|
+
if (!isEnabled(action)) {
|
|
97
|
+
const result = fail(name, "PRECONDITION_FAILED", `Host action 不可用: ${name}`);
|
|
98
|
+
options.onToolComplete?.(name, input, result);
|
|
99
|
+
return result;
|
|
100
|
+
}
|
|
101
|
+
try {
|
|
102
|
+
const data = await action.handler(input, {
|
|
103
|
+
...context,
|
|
104
|
+
toolName: name,
|
|
105
|
+
});
|
|
106
|
+
const result = ok(name, data);
|
|
107
|
+
options.onToolComplete?.(name, input, result);
|
|
108
|
+
return result;
|
|
109
|
+
}
|
|
110
|
+
catch (error) {
|
|
111
|
+
const result = fail(name, "TOOL_RUN_FAILED", error instanceof Error ? error.message : String(error));
|
|
112
|
+
options.onToolComplete?.(name, input, result);
|
|
113
|
+
return result;
|
|
114
|
+
}
|
|
115
|
+
},
|
|
116
|
+
getUiContext() {
|
|
117
|
+
const context = {};
|
|
118
|
+
for (const readable of readables.values()) {
|
|
119
|
+
if (!isEnabled(readable))
|
|
120
|
+
continue;
|
|
121
|
+
context[readable.key] =
|
|
122
|
+
typeof readable.value === "function"
|
|
123
|
+
? readable.value()
|
|
124
|
+
: readable.value;
|
|
125
|
+
}
|
|
126
|
+
return context;
|
|
127
|
+
},
|
|
128
|
+
subscribe(subscriber) {
|
|
129
|
+
subscribers.add(subscriber);
|
|
130
|
+
return () => {
|
|
131
|
+
subscribers.delete(subscriber);
|
|
132
|
+
};
|
|
133
|
+
},
|
|
134
|
+
};
|
|
135
|
+
for (const readable of options.readables ?? []) {
|
|
136
|
+
core.registerReadable(readable);
|
|
137
|
+
}
|
|
138
|
+
for (const action of options.actions ?? []) {
|
|
139
|
+
core.registerAction(action);
|
|
140
|
+
}
|
|
141
|
+
return core;
|
|
142
|
+
}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
export type { SpotlightClientConfig } from "./http.js";
|
|
2
2
|
export { appendProjectQuery, buildJsonHeaders, createSpotlightHttp, normalizeServerUrl, resolveSpotlightClientConfig, type SpotlightHttp, } from "./http.js";
|
|
3
3
|
export { buildClientToolsManifest, createSpotlightHostAdapter, executeHostTool, fetchDefaultCommandCatalog, fetchHostToolsManifest, mergeCommandCatalogs, resetHostToolsManifestCacheForTests, resolveHostTools, serializeSkillsForRemote, type SessionHostToolHandler, type SpotlightHostAdapter, type SpotlightHostTool, type SpotlightHostToolHandlerContext, } from "./host.js";
|
|
4
|
+
export { createSpotlightHostCore, type SpotlightActionContext, type SpotlightFrontendAction, type SpotlightHostCore, type SpotlightHostCoreEvent, type SpotlightHostCoreOptions, type SpotlightHostCoreSubscriber, type SpotlightReadableContext, } from "./hostCore.js";
|
|
4
5
|
export { bridgeAgentRegistryToHostTools, type AgentRegistryBridgeDeps, type AgentRegistryTool, } from "./registryBridge.js";
|
|
5
6
|
export { defineToolsFromAgentRegistry, type AgentRegistryHostTools, } from "./defineToolsFromRegistry.js";
|
|
6
7
|
export { registerTool, getTool, listTools, listLoopTools, getToolsByPrefix, clearTools, createToolInputSchema, createLooseObjectSchema, getToolTitle, getToolAvailabilityCheck, getToolRequirements, getToolContextHint, getToolPreflight, getToolInvoker, getToolExecutionMode, getToolExecutionTarget, getToolExposeToLoop, getToolTimeoutMs, getToolRecovery, getToolResultSummarizer, getToolHostEffectBuilder, type AgentTool, type ToolContextHint, type ToolExecutionMode, type ToolInputSchema, type ToolPreflightContext, type ToolPreflightResult, type ToolRecoveryConfig, } from "./agentRegistry.js";
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,qBAAqB,EAAE,MAAM,WAAW,CAAC;AACvD,OAAO,EACL,kBAAkB,EAClB,gBAAgB,EAChB,mBAAmB,EACnB,kBAAkB,EAClB,4BAA4B,EAC5B,KAAK,aAAa,GACnB,MAAM,WAAW,CAAC;AACnB,OAAO,EACL,wBAAwB,EACxB,0BAA0B,EAC1B,eAAe,EACf,0BAA0B,EAC1B,sBAAsB,EACtB,oBAAoB,EACpB,mCAAmC,EACnC,gBAAgB,EAChB,wBAAwB,EACxB,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B,gBAAgB,EAChB,2BAA2B,EAC3B,0BAA0B,EAC1B,KAAK,qBAAqB,EAC1B,KAAK,yBAAyB,GAC/B,MAAM,2BAA2B,CAAC;AACnC,OAAO,EACL,2BAA2B,EAC3B,4BAA4B,EAC5B,2BAA2B,GAC5B,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EACL,uBAAuB,EACvB,KAAK,8BAA8B,EACnC,KAAK,iBAAiB,GACvB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EACL,mBAAmB,EACnB,KAAK,oBAAoB,GAC1B,MAAM,sBAAsB,CAAC;AAC9B,YAAY,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
export { appendProjectQuery, buildJsonHeaders, createSpotlightHttp, normalizeServerUrl, resolveSpotlightClientConfig, } from "./http.js";
|
|
2
2
|
export { buildClientToolsManifest, createSpotlightHostAdapter, executeHostTool, fetchDefaultCommandCatalog, fetchHostToolsManifest, mergeCommandCatalogs, resetHostToolsManifestCacheForTests, resolveHostTools, serializeSkillsForRemote, } from "./host.js";
|
|
3
|
+
export { createSpotlightHostCore, } from "./hostCore.js";
|
|
3
4
|
export { bridgeAgentRegistryToHostTools, } from "./registryBridge.js";
|
|
4
5
|
export { defineToolsFromAgentRegistry, } from "./defineToolsFromRegistry.js";
|
|
5
6
|
export { registerTool, getTool, listTools, listLoopTools, getToolsByPrefix, clearTools, createToolInputSchema, createLooseObjectSchema, getToolTitle, getToolAvailabilityCheck, getToolRequirements, getToolContextHint, getToolPreflight, getToolInvoker, getToolExecutionMode, getToolExecutionTarget, getToolExposeToLoop, getToolTimeoutMs, getToolRecovery, getToolResultSummarizer, getToolHostEffectBuilder, } from "./agentRegistry.js";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@inupedia/spotlight-client",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.10",
|
|
4
4
|
"description": "HTTP/SSE helpers and host tool bridge for Inupedia Spotlight (monorepo workspace package)",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
@@ -40,7 +40,7 @@
|
|
|
40
40
|
"@babel/traverse": "^7.28.5",
|
|
41
41
|
"@babel/types": "^7.28.5",
|
|
42
42
|
"magic-string": "^0.30.21",
|
|
43
|
-
"@inupedia/spotlight-protocol": "0.2.
|
|
43
|
+
"@inupedia/spotlight-protocol": "0.2.10"
|
|
44
44
|
},
|
|
45
45
|
"peerDependencies": {
|
|
46
46
|
"vite": "^5.0.0 || ^6.0.0 || ^7.0.0"
|