@inupedia/spotlight-protocol 0.1.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/dist/index.d.ts +199 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +8 -0
- package/dist/inupediaSkillsReference.d.ts +91 -0
- package/dist/inupediaSkillsReference.d.ts.map +1 -0
- package/dist/inupediaSkillsReference.js +135 -0
- package/dist/standards.d.ts +97 -0
- package/dist/standards.d.ts.map +1 -0
- package/dist/standards.js +68 -0
- package/package.json +27 -0
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,199 @@
|
|
|
1
|
+
/** Shared Spotlight protocol types (client ↔ spotlight-server). */
|
|
2
|
+
export type ToolExecutionTarget = "runtime" | "host";
|
|
3
|
+
export interface HostToolEffect {
|
|
4
|
+
type: string;
|
|
5
|
+
target?: string;
|
|
6
|
+
payload?: Record<string, unknown>;
|
|
7
|
+
}
|
|
8
|
+
export type AgentToolErrorCode = "UNKNOWN_TOOL" | "HOST_TOOL_NOT_MANIFEST" | "CIRCULAR_DEPENDENCY" | "PREREQUISITE_FAILED" | "PRECONDITION_FAILED" | "TOOL_RUN_FAILED" | "TOOL_TIMEOUT";
|
|
9
|
+
export interface ToolTraceEvent {
|
|
10
|
+
phase: "dependency" | "context" | "execution";
|
|
11
|
+
source: "executor" | "spotlight_action" | "spotlight_server";
|
|
12
|
+
type: string;
|
|
13
|
+
tool: string;
|
|
14
|
+
detail?: string;
|
|
15
|
+
at: number;
|
|
16
|
+
elapsedMs: number;
|
|
17
|
+
}
|
|
18
|
+
export type AgentStepStatus = "pending" | "active" | "done" | "error";
|
|
19
|
+
export interface AgentStepToolCall {
|
|
20
|
+
id: string;
|
|
21
|
+
name: string;
|
|
22
|
+
displayName?: string;
|
|
23
|
+
argsText?: string;
|
|
24
|
+
resultText?: string;
|
|
25
|
+
summary?: string;
|
|
26
|
+
errorCode?: string;
|
|
27
|
+
trace?: ToolTraceEvent[];
|
|
28
|
+
status: "pending" | "running" | "done" | "error";
|
|
29
|
+
}
|
|
30
|
+
export interface AgentStep {
|
|
31
|
+
id: string;
|
|
32
|
+
label: string;
|
|
33
|
+
status: AgentStepStatus;
|
|
34
|
+
content?: string;
|
|
35
|
+
toolCalls?: AgentStepToolCall[];
|
|
36
|
+
}
|
|
37
|
+
export type SpotlightStepContentChannel = "body" | "planning" | "answer" | "tool" | "trace";
|
|
38
|
+
/** Host-reported UI context; keep generic for SaaS consumers. */
|
|
39
|
+
export type AgentUiContext = Record<string, unknown>;
|
|
40
|
+
export type ConversationTurn = {
|
|
41
|
+
role: "user" | "assistant" | "tool";
|
|
42
|
+
content: string;
|
|
43
|
+
timestamp: number;
|
|
44
|
+
purpose?: string;
|
|
45
|
+
};
|
|
46
|
+
export interface PendingTask {
|
|
47
|
+
id: string;
|
|
48
|
+
type: string;
|
|
49
|
+
pauseReason?: string | null;
|
|
50
|
+
pausedAt?: number | null;
|
|
51
|
+
}
|
|
52
|
+
export interface SpotlightSessionInvokedSkill {
|
|
53
|
+
skillName: string;
|
|
54
|
+
invokedAt: number;
|
|
55
|
+
args?: string;
|
|
56
|
+
}
|
|
57
|
+
export interface SpotlightSessionState {
|
|
58
|
+
sessionId?: string;
|
|
59
|
+
activeTaskId?: string | null;
|
|
60
|
+
activeTopic?: string | null;
|
|
61
|
+
pendingTask?: PendingTask | null;
|
|
62
|
+
conversationSummary?: string;
|
|
63
|
+
summarizedTurnCount?: number;
|
|
64
|
+
conversationHistory?: ConversationTurn[];
|
|
65
|
+
lastAssistantReply?: string | null;
|
|
66
|
+
invokedSkills?: SpotlightSessionInvokedSkill[];
|
|
67
|
+
skillPermissionGrants?: string[];
|
|
68
|
+
}
|
|
69
|
+
export interface SpotlightRuntimeState {
|
|
70
|
+
activeDomain?: string | null;
|
|
71
|
+
activeTarget?: string | null;
|
|
72
|
+
activeAction?: string | null;
|
|
73
|
+
resumableAction?: string | null;
|
|
74
|
+
lastResolvedTarget?: string | null;
|
|
75
|
+
[key: string]: unknown;
|
|
76
|
+
}
|
|
77
|
+
export interface ClientToolDescriptor {
|
|
78
|
+
name: string;
|
|
79
|
+
displayName?: string;
|
|
80
|
+
description?: string;
|
|
81
|
+
inputSchema?: Record<string, unknown>;
|
|
82
|
+
executionTarget?: ToolExecutionTarget;
|
|
83
|
+
}
|
|
84
|
+
export type AssetType = "video_channel" | "bim_model" | "device" | "sensor" | "panel" | "scene_target";
|
|
85
|
+
export type SpotlightSkillResponseStrategy = "direct_answer" | "tool_answer" | "clarify";
|
|
86
|
+
export interface SpotlightSkill {
|
|
87
|
+
name: string;
|
|
88
|
+
displayName?: string;
|
|
89
|
+
description: string;
|
|
90
|
+
whenToUse?: string;
|
|
91
|
+
allowedTools?: string[];
|
|
92
|
+
argumentHint?: string;
|
|
93
|
+
argNames?: string[];
|
|
94
|
+
keywords?: string[];
|
|
95
|
+
responseStrategy?: SpotlightSkillResponseStrategy;
|
|
96
|
+
assetTypes?: AssetType[];
|
|
97
|
+
capabilityExamples?: string[];
|
|
98
|
+
version?: string;
|
|
99
|
+
model?: string;
|
|
100
|
+
disableModelInvocation?: boolean;
|
|
101
|
+
userInvocable?: boolean;
|
|
102
|
+
paths?: string[];
|
|
103
|
+
executionContext?: "inline" | "fork";
|
|
104
|
+
agent?: string;
|
|
105
|
+
effort?: string;
|
|
106
|
+
hooks?: Record<string, unknown>;
|
|
107
|
+
shell?: string;
|
|
108
|
+
skillPackAppendix?: string;
|
|
109
|
+
skillInstructionBody?: string;
|
|
110
|
+
loadedFrom?: string;
|
|
111
|
+
sourcePath?: string;
|
|
112
|
+
/** Skill 目录(相对项目根或绝对路径),用于 scripts/ 与占位符 */
|
|
113
|
+
skillRoot?: string;
|
|
114
|
+
}
|
|
115
|
+
export interface SpotlightCommandCatalogAction {
|
|
116
|
+
domain: string;
|
|
117
|
+
action: string;
|
|
118
|
+
description: string;
|
|
119
|
+
}
|
|
120
|
+
export interface SpotlightCommandCatalogTarget {
|
|
121
|
+
id: string;
|
|
122
|
+
label: string;
|
|
123
|
+
aliases?: string[];
|
|
124
|
+
}
|
|
125
|
+
export interface SpotlightCommandCatalogVideoChannel {
|
|
126
|
+
id: string;
|
|
127
|
+
label?: string;
|
|
128
|
+
aliases?: string[];
|
|
129
|
+
}
|
|
130
|
+
export interface SpotlightCommandActionBinding {
|
|
131
|
+
action: string;
|
|
132
|
+
toolCalls: Array<{
|
|
133
|
+
name: string;
|
|
134
|
+
input: Record<string, unknown>;
|
|
135
|
+
}>;
|
|
136
|
+
}
|
|
137
|
+
export interface SpotlightCommandCatalog {
|
|
138
|
+
actions: SpotlightCommandCatalogAction[];
|
|
139
|
+
targets: SpotlightCommandCatalogTarget[];
|
|
140
|
+
videoChannels?: SpotlightCommandCatalogVideoChannel[];
|
|
141
|
+
domainLabels?: Record<string, string>;
|
|
142
|
+
actionBindings: SpotlightCommandActionBinding[];
|
|
143
|
+
scopes: string[];
|
|
144
|
+
useBundledGuards?: boolean;
|
|
145
|
+
}
|
|
146
|
+
export interface CreateRunRequest {
|
|
147
|
+
projectId?: string;
|
|
148
|
+
sessionId?: string;
|
|
149
|
+
userQuestion: string;
|
|
150
|
+
uiContext?: AgentUiContext;
|
|
151
|
+
sessionState?: SpotlightSessionState;
|
|
152
|
+
runtimeState?: SpotlightRuntimeState;
|
|
153
|
+
clientTools?: ClientToolDescriptor[];
|
|
154
|
+
clientToolsManifestVersion?: string;
|
|
155
|
+
skills?: SpotlightSkill[];
|
|
156
|
+
commandCatalog?: SpotlightCommandCatalog;
|
|
157
|
+
}
|
|
158
|
+
export interface CreateRunResponse {
|
|
159
|
+
runId: string;
|
|
160
|
+
}
|
|
161
|
+
export interface HostToolResultRequest {
|
|
162
|
+
correlationId: string;
|
|
163
|
+
success: boolean;
|
|
164
|
+
output?: unknown;
|
|
165
|
+
error?: string;
|
|
166
|
+
errorCode?: string;
|
|
167
|
+
trace?: ToolTraceEvent[];
|
|
168
|
+
}
|
|
169
|
+
export interface SpotlightHostToolsManifest {
|
|
170
|
+
version: string;
|
|
171
|
+
tools: Array<{
|
|
172
|
+
name: string;
|
|
173
|
+
displayName?: string;
|
|
174
|
+
description?: string;
|
|
175
|
+
executionTarget?: ToolExecutionTarget;
|
|
176
|
+
}>;
|
|
177
|
+
}
|
|
178
|
+
export interface RemoteHostToolCall {
|
|
179
|
+
id: string;
|
|
180
|
+
name: string;
|
|
181
|
+
input: Record<string, unknown>;
|
|
182
|
+
displayName: string;
|
|
183
|
+
}
|
|
184
|
+
export interface HostToolExecutionResult {
|
|
185
|
+
success: boolean;
|
|
186
|
+
data?: unknown;
|
|
187
|
+
error?: string;
|
|
188
|
+
errorCode?: AgentToolErrorCode;
|
|
189
|
+
trace: ToolTraceEvent[];
|
|
190
|
+
executionTarget: "host";
|
|
191
|
+
}
|
|
192
|
+
export declare const SPOTLIGHT_CORE_TOOL_NAMES: {
|
|
193
|
+
readonly skillInvoke: "skill.invoke";
|
|
194
|
+
readonly knowledgeAnswer: "knowledge.answer";
|
|
195
|
+
readonly knowledgeSearchWeb: "knowledge.searchWeb";
|
|
196
|
+
};
|
|
197
|
+
export { SPOTLIGHT_LAYOUT, SPOTLIGHT_SKILL_FRONTMATTER_KEYS, SPOTLIGHT_SKILL_LOAD_LEVELS, SPOTLIGHT_SKILLS_SERVICE_SPLIT, spotlightSkillsGlobPattern, type CapabilitySurface, type SpotlightServiceContract, type SpotlightSkillFrontmatter, } from "./standards.js";
|
|
198
|
+
export { AGENT_SKILLS_LAYOUT, INUPEDIA_SHARED_SKILL_FRONTMATTER, INUPEDIA_SKILL_EXTENSIONS, INUPEDIA_SKILL_LAYOUT, INUPEDIA_SKILL_LOAD_MODEL, INUPEDIA_SKILL_PLACEHOLDERS, INUPEDIA_SKILLS_REFERENCE_MAP, INUPEDIA_SKILLS_SERVICE_MODEL, } from "./inupediaSkillsReference.js";
|
|
199
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceR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CAAC,EAAE,mBAAmB,CAAC;KACvC,CAAC,CAAC;CACJ;AAED,MAAM,WAAW,kBAAkB;IACjC,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAC/B,WAAW,EAAE,MAAM,CAAC;CACrB;AAED,MAAM,WAAW,uBAAuB;IACtC,OAAO,EAAE,OAAO,CAAC;IACjB,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,SAAS,CAAC,EAAE,kBAAkB,CAAC;IAC/B,KAAK,EAAE,cAAc,EAAE,CAAC;IACxB,eAAe,EAAE,MAAM,CAAC;CACzB;AAED,eAAO,MAAM,yBAAyB;;;;CAI5B,CAAC;AAEX,OAAO,EACL,gBAAgB,EAChB,gCAAgC,EAChC,2BAA2B,EAC3B,8BAA8B,EAC9B,0BAA0B,EAC1B,KAAK,iBAAiB,EACtB,KAAK,wBAAwB,EAC7B,KAAK,yBAAyB,GAC/B,MAAM,gBAAgB,CAAC;AACxB,OAAO,EACL,mBAAmB,EACnB,iCAAiC,EACjC,yBAAyB,EACzB,qBAAqB,EACrB,yBAAyB,EACzB,2BAA2B,EAC3B,6BAA6B,EAC7B,6BAA6B,GAC9B,MAAM,8BAA8B,CAAC"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/** Shared Spotlight protocol types (client ↔ spotlight-server). */
|
|
2
|
+
export const SPOTLIGHT_CORE_TOOL_NAMES = {
|
|
3
|
+
skillInvoke: "skill.invoke",
|
|
4
|
+
knowledgeAnswer: "knowledge.answer",
|
|
5
|
+
knowledgeSearchWeb: "knowledge.searchWeb",
|
|
6
|
+
};
|
|
7
|
+
export { SPOTLIGHT_LAYOUT, SPOTLIGHT_SKILL_FRONTMATTER_KEYS, SPOTLIGHT_SKILL_LOAD_LEVELS, SPOTLIGHT_SKILLS_SERVICE_SPLIT, spotlightSkillsGlobPattern, } from "./standards.js";
|
|
8
|
+
export { AGENT_SKILLS_LAYOUT, INUPEDIA_SHARED_SKILL_FRONTMATTER, INUPEDIA_SKILL_EXTENSIONS, INUPEDIA_SKILL_LAYOUT, INUPEDIA_SKILL_LOAD_MODEL, INUPEDIA_SKILL_PLACEHOLDERS, INUPEDIA_SKILLS_REFERENCE_MAP, INUPEDIA_SKILLS_SERVICE_MODEL, } from "./inupediaSkillsReference.js";
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Inupedia Agent Skills 参考实现 ↔ Spotlight 模块映射。
|
|
3
|
+
* 布局与行为对齐 Inupedia Agent Skills 开放约定(渐进披露 + skill.invoke)。
|
|
4
|
+
*/
|
|
5
|
+
/** 通用 Agent Skills 目录布局(其它产品可能用不同根路径) */
|
|
6
|
+
export declare const AGENT_SKILLS_LAYOUT: {
|
|
7
|
+
readonly entryFile: "SKILL.md";
|
|
8
|
+
readonly supportDirs: readonly ["scripts", "references", "templates", "examples"];
|
|
9
|
+
};
|
|
10
|
+
/** Inupedia 项目技能包路径 */
|
|
11
|
+
export declare const INUPEDIA_SKILL_LAYOUT: {
|
|
12
|
+
readonly projectRoot: ".inupedia/skills/<skill-id>/SKILL.md";
|
|
13
|
+
readonly entryFile: "SKILL.md";
|
|
14
|
+
readonly supportDirs: readonly ["scripts", "references", "templates", "examples"];
|
|
15
|
+
};
|
|
16
|
+
/**
|
|
17
|
+
* 渐进披露 — Inupedia Spotlight 标准加载模型。
|
|
18
|
+
*
|
|
19
|
+
* Level 1: 仅 frontmatter 进入 skill 名录
|
|
20
|
+
* Level 2: skill.invoke 后加载 SKILL.md + references/templates/examples
|
|
21
|
+
* scripts/: 附录列路径;宿主 skillExecution hook 或 MCP 执行
|
|
22
|
+
*/
|
|
23
|
+
export declare const INUPEDIA_SKILL_LOAD_MODEL: {
|
|
24
|
+
readonly level1Fields: readonly ["name", "description", "when_to_use", "allowed-tools", "disable-model-invocation", "user-invocable"];
|
|
25
|
+
readonly level2Content: readonly ["SKILL.md body", "references/", "templates/", "examples/"];
|
|
26
|
+
readonly scriptsPolicy: {
|
|
27
|
+
readonly host: "skill.runScript + ${INUPEDIA_SKILL_DIR}/scripts;或 SKILL 内 !`cmd`(宿主 runInlineShell)";
|
|
28
|
+
readonly saas: "附录备案;不在服务端执行";
|
|
29
|
+
readonly mcp: "allowed-tools 引用 MCP tool 名";
|
|
30
|
+
};
|
|
31
|
+
};
|
|
32
|
+
/** Skill 正文占位符(宿主渲染 skill 内容时替换) */
|
|
33
|
+
export declare const INUPEDIA_SKILL_PLACEHOLDERS: {
|
|
34
|
+
readonly skillDir: "${INUPEDIA_SKILL_DIR}";
|
|
35
|
+
readonly projectDir: "${INUPEDIA_PROJECT_DIR}";
|
|
36
|
+
readonly sessionId: "${INUPEDIA_SESSION_ID}";
|
|
37
|
+
/** 兼容旧模板,解析时等同 INUPEDIA_SKILL_DIR */
|
|
38
|
+
readonly legacySkillDir: "${CLAUDE_SKILL_DIR}";
|
|
39
|
+
readonly legacyProjectDir: "${CLAUDE_PROJECT_DIR}";
|
|
40
|
+
};
|
|
41
|
+
/** 参考能力 → Spotlight 实现位置 */
|
|
42
|
+
export declare const INUPEDIA_SKILLS_REFERENCE_MAP: {
|
|
43
|
+
readonly skillDirectoryLoader: {
|
|
44
|
+
readonly spotlight: readonly ["packages/spotlight-vue/src/skills/skillFrontmatterParse.ts", "宿主 import.meta.glob('.inupedia/skills/**/SKILL.md')", "spotlight-server/src/packs/projectPack.ts"];
|
|
45
|
+
readonly notes: "宿主 eager glob + 服务端 project pack";
|
|
46
|
+
};
|
|
47
|
+
readonly skillInvokeTool: {
|
|
48
|
+
readonly spotlight: readonly ["spotlight-server/src/runtime/skillInvoke.ts", "skill.invoke"];
|
|
49
|
+
readonly notes: "inline 注入 allowedTools;context:fork → forkedSkillAgent";
|
|
50
|
+
};
|
|
51
|
+
readonly skillListingBudget: {
|
|
52
|
+
readonly spotlight: readonly ["spotlight-server/src/runtime/skillListing.ts", "packages/spotlight-vue/src/skills/skillListing.ts"];
|
|
53
|
+
};
|
|
54
|
+
readonly argumentSubstitution: {
|
|
55
|
+
readonly spotlight: readonly ["spotlight-server/src/runtime/argumentSubstitution.ts"];
|
|
56
|
+
};
|
|
57
|
+
readonly skillScriptExecution: {
|
|
58
|
+
readonly spotlight: readonly ["packages/spotlight-client/src/skillPrompt.ts", "packages/spotlight-client/src/skillScriptTool.ts"];
|
|
59
|
+
readonly notes: "宿主注入 runScript / runInlineShell;SaaS 不执行";
|
|
60
|
+
};
|
|
61
|
+
readonly mcpSkills: {
|
|
62
|
+
readonly spotlight: readonly ["allowed-tools 写 MCP tool 名;消费端接 MCP 服务器"];
|
|
63
|
+
};
|
|
64
|
+
readonly invokedSkillRegistry: {
|
|
65
|
+
readonly spotlight: readonly ["spotlight-server/src/runtime/invokedSkills.ts", "spotlight-server/src/runtime/invokeToolGuard.ts"];
|
|
66
|
+
};
|
|
67
|
+
};
|
|
68
|
+
/**
|
|
69
|
+
* Skills 与 Service 分工(Inupedia 标准)。
|
|
70
|
+
* Service = 宿主可执行 tool 注册表;Skills = 知识 + allowed-tools 白名单。
|
|
71
|
+
*/
|
|
72
|
+
export declare const INUPEDIA_SKILLS_SERVICE_MODEL: {
|
|
73
|
+
readonly skills: {
|
|
74
|
+
readonly role: "知识 + 流程 + allowed-tools";
|
|
75
|
+
readonly path: ".inupedia/skills/";
|
|
76
|
+
};
|
|
77
|
+
readonly service: {
|
|
78
|
+
readonly role: "host tool 注册与 invoke";
|
|
79
|
+
readonly path: "src/service/agent/";
|
|
80
|
+
};
|
|
81
|
+
readonly apiCalls: {
|
|
82
|
+
readonly skillScript: "skill/scripts/ + skill.runScript 或 SKILL 内 !`cmd`";
|
|
83
|
+
readonly mcp: "MCP tool 写入 allowed-tools";
|
|
84
|
+
readonly hostTool: "@agent capabilities + resolveAgentMeta";
|
|
85
|
+
};
|
|
86
|
+
};
|
|
87
|
+
/** Agent Skills 通用 frontmatter 字段 */
|
|
88
|
+
export declare const INUPEDIA_SHARED_SKILL_FRONTMATTER: readonly ["name", "description", "when_to_use", "allowed-tools", "argument-hint", "arguments", "disable-model-invocation", "user-invocable", "disallowed-tools", "paths", "context", "agent", "model", "effort", "hooks", "shell"];
|
|
89
|
+
/** Inupedia Spotlight 扩展字段 */
|
|
90
|
+
export declare const INUPEDIA_SKILL_EXTENSIONS: readonly ["id", "spotlight-response-strategy", "spotlight-asset-types", "capability-examples"];
|
|
91
|
+
//# sourceMappingURL=inupediaSkillsReference.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"inupediaSkillsReference.d.ts","sourceRoot":"","sources":["../src/inupediaSkillsReference.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,yCAAyC;AACzC,eAAO,MAAM,mBAAmB;;;CAGtB,CAAC;AAEX,uBAAuB;AACvB,eAAO,MAAM,qBAAqB;;;;CAIxB,CAAC;AAEX;;;;;;GAMG;AACH,eAAO,MAAM,yBAAyB;;;;;;;;CAe5B,CAAC;AAEX,oCAAoC;AACpC,eAAO,MAAM,2BAA2B;;;;IAItC,qCAAqC;;;CAG7B,CAAC;AAEX,4BAA4B;AAC5B,eAAO,MAAM,6BAA6B;;;;;;;;;;;;;;;;;;;;;;;;;CAyChC,CAAC;AAEX;;;GAGG;AACH,eAAO,MAAM,6BAA6B;;;;;;;;;;;;;;CAchC,CAAC;AAEX,qCAAqC;AACrC,eAAO,MAAM,iCAAiC,oOAiBpC,CAAC;AAEX,8BAA8B;AAC9B,eAAO,MAAM,yBAAyB,gGAK5B,CAAC"}
|
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Inupedia Agent Skills 参考实现 ↔ Spotlight 模块映射。
|
|
3
|
+
* 布局与行为对齐 Inupedia Agent Skills 开放约定(渐进披露 + skill.invoke)。
|
|
4
|
+
*/
|
|
5
|
+
/** 通用 Agent Skills 目录布局(其它产品可能用不同根路径) */
|
|
6
|
+
export const AGENT_SKILLS_LAYOUT = {
|
|
7
|
+
entryFile: "SKILL.md",
|
|
8
|
+
supportDirs: ["scripts", "references", "templates", "examples"],
|
|
9
|
+
};
|
|
10
|
+
/** Inupedia 项目技能包路径 */
|
|
11
|
+
export const INUPEDIA_SKILL_LAYOUT = {
|
|
12
|
+
projectRoot: ".inupedia/skills/<skill-id>/SKILL.md",
|
|
13
|
+
entryFile: "SKILL.md",
|
|
14
|
+
supportDirs: ["scripts", "references", "templates", "examples"],
|
|
15
|
+
};
|
|
16
|
+
/**
|
|
17
|
+
* 渐进披露 — Inupedia Spotlight 标准加载模型。
|
|
18
|
+
*
|
|
19
|
+
* Level 1: 仅 frontmatter 进入 skill 名录
|
|
20
|
+
* Level 2: skill.invoke 后加载 SKILL.md + references/templates/examples
|
|
21
|
+
* scripts/: 附录列路径;宿主 skillExecution hook 或 MCP 执行
|
|
22
|
+
*/
|
|
23
|
+
export const INUPEDIA_SKILL_LOAD_MODEL = {
|
|
24
|
+
level1Fields: [
|
|
25
|
+
"name",
|
|
26
|
+
"description",
|
|
27
|
+
"when_to_use",
|
|
28
|
+
"allowed-tools",
|
|
29
|
+
"disable-model-invocation",
|
|
30
|
+
"user-invocable",
|
|
31
|
+
],
|
|
32
|
+
level2Content: ["SKILL.md body", "references/", "templates/", "examples/"],
|
|
33
|
+
scriptsPolicy: {
|
|
34
|
+
host: "skill.runScript + ${INUPEDIA_SKILL_DIR}/scripts;或 SKILL 内 !`cmd`(宿主 runInlineShell)",
|
|
35
|
+
saas: "附录备案;不在服务端执行",
|
|
36
|
+
mcp: "allowed-tools 引用 MCP tool 名",
|
|
37
|
+
},
|
|
38
|
+
};
|
|
39
|
+
/** Skill 正文占位符(宿主渲染 skill 内容时替换) */
|
|
40
|
+
export const INUPEDIA_SKILL_PLACEHOLDERS = {
|
|
41
|
+
skillDir: "${INUPEDIA_SKILL_DIR}",
|
|
42
|
+
projectDir: "${INUPEDIA_PROJECT_DIR}",
|
|
43
|
+
sessionId: "${INUPEDIA_SESSION_ID}",
|
|
44
|
+
/** 兼容旧模板,解析时等同 INUPEDIA_SKILL_DIR */
|
|
45
|
+
legacySkillDir: "${CLAUDE_SKILL_DIR}",
|
|
46
|
+
legacyProjectDir: "${CLAUDE_PROJECT_DIR}",
|
|
47
|
+
};
|
|
48
|
+
/** 参考能力 → Spotlight 实现位置 */
|
|
49
|
+
export const INUPEDIA_SKILLS_REFERENCE_MAP = {
|
|
50
|
+
skillDirectoryLoader: {
|
|
51
|
+
spotlight: [
|
|
52
|
+
"packages/spotlight-vue/src/skills/skillFrontmatterParse.ts",
|
|
53
|
+
"宿主 import.meta.glob('.inupedia/skills/**/SKILL.md')",
|
|
54
|
+
"spotlight-server/src/packs/projectPack.ts",
|
|
55
|
+
],
|
|
56
|
+
notes: "宿主 eager glob + 服务端 project pack",
|
|
57
|
+
},
|
|
58
|
+
skillInvokeTool: {
|
|
59
|
+
spotlight: [
|
|
60
|
+
"spotlight-server/src/runtime/skillInvoke.ts",
|
|
61
|
+
"skill.invoke",
|
|
62
|
+
],
|
|
63
|
+
notes: "inline 注入 allowedTools;context:fork → forkedSkillAgent",
|
|
64
|
+
},
|
|
65
|
+
skillListingBudget: {
|
|
66
|
+
spotlight: [
|
|
67
|
+
"spotlight-server/src/runtime/skillListing.ts",
|
|
68
|
+
"packages/spotlight-vue/src/skills/skillListing.ts",
|
|
69
|
+
],
|
|
70
|
+
},
|
|
71
|
+
argumentSubstitution: {
|
|
72
|
+
spotlight: ["spotlight-server/src/runtime/argumentSubstitution.ts"],
|
|
73
|
+
},
|
|
74
|
+
skillScriptExecution: {
|
|
75
|
+
spotlight: [
|
|
76
|
+
"packages/spotlight-client/src/skillPrompt.ts",
|
|
77
|
+
"packages/spotlight-client/src/skillScriptTool.ts",
|
|
78
|
+
],
|
|
79
|
+
notes: "宿主注入 runScript / runInlineShell;SaaS 不执行",
|
|
80
|
+
},
|
|
81
|
+
mcpSkills: {
|
|
82
|
+
spotlight: ["allowed-tools 写 MCP tool 名;消费端接 MCP 服务器"],
|
|
83
|
+
},
|
|
84
|
+
invokedSkillRegistry: {
|
|
85
|
+
spotlight: [
|
|
86
|
+
"spotlight-server/src/runtime/invokedSkills.ts",
|
|
87
|
+
"spotlight-server/src/runtime/invokeToolGuard.ts",
|
|
88
|
+
],
|
|
89
|
+
},
|
|
90
|
+
};
|
|
91
|
+
/**
|
|
92
|
+
* Skills 与 Service 分工(Inupedia 标准)。
|
|
93
|
+
* Service = 宿主可执行 tool 注册表;Skills = 知识 + allowed-tools 白名单。
|
|
94
|
+
*/
|
|
95
|
+
export const INUPEDIA_SKILLS_SERVICE_MODEL = {
|
|
96
|
+
skills: {
|
|
97
|
+
role: "知识 + 流程 + allowed-tools",
|
|
98
|
+
path: ".inupedia/skills/",
|
|
99
|
+
},
|
|
100
|
+
service: {
|
|
101
|
+
role: "host tool 注册与 invoke",
|
|
102
|
+
path: "src/service/agent/",
|
|
103
|
+
},
|
|
104
|
+
apiCalls: {
|
|
105
|
+
skillScript: "skill/scripts/ + skill.runScript 或 SKILL 内 !`cmd`",
|
|
106
|
+
mcp: "MCP tool 写入 allowed-tools",
|
|
107
|
+
hostTool: "@agent capabilities + resolveAgentMeta",
|
|
108
|
+
},
|
|
109
|
+
};
|
|
110
|
+
/** Agent Skills 通用 frontmatter 字段 */
|
|
111
|
+
export const INUPEDIA_SHARED_SKILL_FRONTMATTER = [
|
|
112
|
+
"name",
|
|
113
|
+
"description",
|
|
114
|
+
"when_to_use",
|
|
115
|
+
"allowed-tools",
|
|
116
|
+
"argument-hint",
|
|
117
|
+
"arguments",
|
|
118
|
+
"disable-model-invocation",
|
|
119
|
+
"user-invocable",
|
|
120
|
+
"disallowed-tools",
|
|
121
|
+
"paths",
|
|
122
|
+
"context",
|
|
123
|
+
"agent",
|
|
124
|
+
"model",
|
|
125
|
+
"effort",
|
|
126
|
+
"hooks",
|
|
127
|
+
"shell",
|
|
128
|
+
];
|
|
129
|
+
/** Inupedia Spotlight 扩展字段 */
|
|
130
|
+
export const INUPEDIA_SKILL_EXTENSIONS = [
|
|
131
|
+
"id",
|
|
132
|
+
"spotlight-response-strategy",
|
|
133
|
+
"spotlight-asset-types",
|
|
134
|
+
"capability-examples",
|
|
135
|
+
];
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Spotlight consumer layout & skills/service contract.
|
|
3
|
+
* Aligned with Inupedia Agent Skills / agentskills.io layout.
|
|
4
|
+
*/
|
|
5
|
+
/** Project-level paths (conventions — consumers may override glob roots). */
|
|
6
|
+
export declare const SPOTLIGHT_LAYOUT: {
|
|
7
|
+
/** Skill pack root relative to repo root. */
|
|
8
|
+
readonly skillsRoot: ".inupedia/skills";
|
|
9
|
+
readonly skillEntryFile: "SKILL.md";
|
|
10
|
+
/** Supporting dirs under each skill folder (Agent Skills standard). */
|
|
11
|
+
readonly skillSupportDirs: readonly ["scripts", "references", "templates", "examples"];
|
|
12
|
+
/** Optional project UI copy / chips. */
|
|
13
|
+
readonly uiPromptsFile: ".inupedia/ui-prompts.json";
|
|
14
|
+
/** Recommended service root in host apps. */
|
|
15
|
+
readonly serviceRoot: "src/service/agent";
|
|
16
|
+
/** IoC capabilities (`@agent` / project presets). */
|
|
17
|
+
readonly serviceCapabilitiesDir: "src/service/agent/capabilities";
|
|
18
|
+
readonly serviceToolsDir: "src/service/agent/tools";
|
|
19
|
+
readonly serviceHostFile: "src/service/agent/host.ts";
|
|
20
|
+
readonly serviceExecutorFile: "src/service/agent/host.ts";
|
|
21
|
+
readonly spotlightConfigFile: "spotlight.config.ts";
|
|
22
|
+
};
|
|
23
|
+
/** Vite / bundler glob for eager skill markdown load. */
|
|
24
|
+
export declare function spotlightSkillsGlobPattern(skillsRoot?: ".inupedia/skills"): string;
|
|
25
|
+
/**
|
|
26
|
+
* Where a capability executes. Pick one surface per capability; document in skill `allowed-tools`.
|
|
27
|
+
*
|
|
28
|
+
* - `host-tool` — browser/host `registerTool` (UI navigation, panels, local data read)
|
|
29
|
+
* - `skill-script` — file under skill `scripts/` (API glue; host or CI runs it, not SaaS by default)
|
|
30
|
+
* - `mcp` — MCP server tool (external systems, shared across projects)
|
|
31
|
+
* - `runtime` — spotlight-server runtime tool (server-side only)
|
|
32
|
+
*/
|
|
33
|
+
export type CapabilitySurface = "host-tool" | "skill-script" | "mcp" | "runtime";
|
|
34
|
+
/** Agent Skills–compatible frontmatter (+ Spotlight extensions). */
|
|
35
|
+
export interface SpotlightSkillFrontmatter {
|
|
36
|
+
/** Stable id; folder name should match (e.g. skill.navigate.scene). */
|
|
37
|
+
id?: string;
|
|
38
|
+
name?: string;
|
|
39
|
+
description: string;
|
|
40
|
+
when_to_use?: string;
|
|
41
|
+
/** Comma-separated or YAML list — must name registered tools / MCP tools. */
|
|
42
|
+
"allowed-tools"?: string | string[];
|
|
43
|
+
"argument-hint"?: string;
|
|
44
|
+
arguments?: string | string[];
|
|
45
|
+
"disable-model-invocation"?: boolean;
|
|
46
|
+
"user-invocable"?: boolean;
|
|
47
|
+
"disallowed-tools"?: string | string[];
|
|
48
|
+
paths?: string | string[];
|
|
49
|
+
context?: "inline" | "fork";
|
|
50
|
+
agent?: string;
|
|
51
|
+
model?: string;
|
|
52
|
+
effort?: string;
|
|
53
|
+
hooks?: Record<string, unknown>;
|
|
54
|
+
shell?: string;
|
|
55
|
+
/** Spotlight: how the agent should respond after invoke. */
|
|
56
|
+
"spotlight-response-strategy"?: "direct_answer" | "tool_answer" | "clarify";
|
|
57
|
+
/** Spotlight: asset retrieval scope. */
|
|
58
|
+
"spotlight-asset-types"?: string | string[];
|
|
59
|
+
"capability-examples"?: string | string[];
|
|
60
|
+
}
|
|
61
|
+
/** Recommended service injection contract (consumer implements). */
|
|
62
|
+
export interface SpotlightServiceContract {
|
|
63
|
+
/** Registry listing for server manifest + planner. */
|
|
64
|
+
listTools: () => readonly {
|
|
65
|
+
name: string;
|
|
66
|
+
description: string;
|
|
67
|
+
}[];
|
|
68
|
+
getToolExecutionTarget: (name: string) => "host" | "runtime" | undefined;
|
|
69
|
+
/** Host-side executor (navigation preflight + invoke). */
|
|
70
|
+
runTool: (name: string, input: unknown) => Promise<unknown>;
|
|
71
|
+
/** Current UI context for planner / preconditions (shape is app-specific). */
|
|
72
|
+
getUiContext?: () => Record<string, unknown>;
|
|
73
|
+
/** Side-effect import of tool modules. */
|
|
74
|
+
loadTools?: () => void | Promise<unknown>;
|
|
75
|
+
}
|
|
76
|
+
/**
|
|
77
|
+
* Skills teach what/when; service implements how.
|
|
78
|
+
* Skills: .inupedia/skills/.../SKILL.md → listing, skill.invoke, allowed-tools
|
|
79
|
+
* Service: src/service/agent/tools → runTool, host manifest
|
|
80
|
+
* Scripts: skill/scripts → appendix paths; host or MCP executes
|
|
81
|
+
* MCP: external tools referenced in allowed-tools
|
|
82
|
+
*/
|
|
83
|
+
export declare const SPOTLIGHT_SKILLS_SERVICE_SPLIT: {
|
|
84
|
+
readonly skills: "Knowledge + procedure: description, when_to_use, allowed-tools, markdown body.";
|
|
85
|
+
readonly service: "Executable host capabilities: @agent in capabilities/ (compile-time IoC).";
|
|
86
|
+
readonly scripts: "Optional API/CLI glue under skill/scripts/ — list in appendix; wire execution in host or MCP.";
|
|
87
|
+
readonly mcp: "External integrations; reference MCP tool names in allowed-tools.";
|
|
88
|
+
};
|
|
89
|
+
/** Progressive disclosure levels (matches spotlight-server + host adapter). */
|
|
90
|
+
export declare const SPOTLIGHT_SKILL_LOAD_LEVELS: {
|
|
91
|
+
readonly listing: "name + description + when_to_use in skill catalog (always)";
|
|
92
|
+
readonly invoke: "SKILL.md body + references/templates/examples appendix (after skill.invoke)";
|
|
93
|
+
readonly scripts: "scripts/ paths listed in appendix only — execution is consumer-defined";
|
|
94
|
+
};
|
|
95
|
+
/** Frontmatter keys recognized by @inupedia/spotlight-vue parser. */
|
|
96
|
+
export declare const SPOTLIGHT_SKILL_FRONTMATTER_KEYS: readonly ["id", "name", "description", "when_to_use", "allowed-tools", "argument-hint", "arguments", "disable-model-invocation", "user-invocable", "disallowed-tools", "paths", "context", "agent", "model", "effort", "hooks", "shell", "spotlight-response-strategy", "spotlight-asset-types", "capability-examples"];
|
|
97
|
+
//# sourceMappingURL=standards.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"standards.d.ts","sourceRoot":"","sources":["../src/standards.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,6EAA6E;AAC7E,eAAO,MAAM,gBAAgB;IAC3B,6CAA6C;;;IAG7C,uEAAuE;;IAEvE,wCAAwC;;IAExC,6CAA6C;;IAE7C,qDAAqD;;;;;;CAM7C,CAAC;AAEX,yDAAyD;AACzD,wBAAgB,0BAA0B,CACxC,UAAU,qBAA8B,GACvC,MAAM,CAER;AAED;;;;;;;GAOG;AACH,MAAM,MAAM,iBAAiB,GAAG,WAAW,GAAG,cAAc,GAAG,KAAK,GAAG,SAAS,CAAC;AAEjF,oEAAoE;AACpE,MAAM,WAAW,yBAAyB;IACxC,uEAAuE;IACvE,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,WAAW,EAAE,MAAM,CAAC;IACpB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,6EAA6E;IAC7E,eAAe,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;IACpC,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,SAAS,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;IAC9B,0BAA0B,CAAC,EAAE,OAAO,CAAC;IACrC,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,kBAAkB,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;IACvC,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;IAC1B,OAAO,CAAC,EAAE,QAAQ,GAAG,MAAM,CAAC;IAC5B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,CAAC;I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/** Project-level paths (conventions — consumers may override glob roots). */
|
|
6
|
+
export const SPOTLIGHT_LAYOUT = {
|
|
7
|
+
/** Skill pack root relative to repo root. */
|
|
8
|
+
skillsRoot: ".inupedia/skills",
|
|
9
|
+
skillEntryFile: "SKILL.md",
|
|
10
|
+
/** Supporting dirs under each skill folder (Agent Skills standard). */
|
|
11
|
+
skillSupportDirs: ["scripts", "references", "templates", "examples"],
|
|
12
|
+
/** Optional project UI copy / chips. */
|
|
13
|
+
uiPromptsFile: ".inupedia/ui-prompts.json",
|
|
14
|
+
/** Recommended service root in host apps. */
|
|
15
|
+
serviceRoot: "src/service/agent",
|
|
16
|
+
/** IoC capabilities (`@agent` / project presets). */
|
|
17
|
+
serviceCapabilitiesDir: "src/service/agent/capabilities",
|
|
18
|
+
serviceToolsDir: "src/service/agent/tools",
|
|
19
|
+
serviceHostFile: "src/service/agent/host.ts",
|
|
20
|
+
serviceExecutorFile: "src/service/agent/host.ts",
|
|
21
|
+
spotlightConfigFile: "spotlight.config.ts",
|
|
22
|
+
};
|
|
23
|
+
/** Vite / bundler glob for eager skill markdown load. */
|
|
24
|
+
export function spotlightSkillsGlobPattern(skillsRoot = SPOTLIGHT_LAYOUT.skillsRoot) {
|
|
25
|
+
return `${skillsRoot}/**/${SPOTLIGHT_LAYOUT.skillEntryFile}`;
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* Skills teach what/when; service implements how.
|
|
29
|
+
* Skills: .inupedia/skills/.../SKILL.md → listing, skill.invoke, allowed-tools
|
|
30
|
+
* Service: src/service/agent/tools → runTool, host manifest
|
|
31
|
+
* Scripts: skill/scripts → appendix paths; host or MCP executes
|
|
32
|
+
* MCP: external tools referenced in allowed-tools
|
|
33
|
+
*/
|
|
34
|
+
export const SPOTLIGHT_SKILLS_SERVICE_SPLIT = {
|
|
35
|
+
skills: "Knowledge + procedure: description, when_to_use, allowed-tools, markdown body.",
|
|
36
|
+
service: "Executable host capabilities: @agent in capabilities/ (compile-time IoC).",
|
|
37
|
+
scripts: "Optional API/CLI glue under skill/scripts/ — list in appendix; wire execution in host or MCP.",
|
|
38
|
+
mcp: "External integrations; reference MCP tool names in allowed-tools.",
|
|
39
|
+
};
|
|
40
|
+
/** Progressive disclosure levels (matches spotlight-server + host adapter). */
|
|
41
|
+
export const SPOTLIGHT_SKILL_LOAD_LEVELS = {
|
|
42
|
+
listing: "name + description + when_to_use in skill catalog (always)",
|
|
43
|
+
invoke: "SKILL.md body + references/templates/examples appendix (after skill.invoke)",
|
|
44
|
+
scripts: "scripts/ paths listed in appendix only — execution is consumer-defined",
|
|
45
|
+
};
|
|
46
|
+
/** Frontmatter keys recognized by @inupedia/spotlight-vue parser. */
|
|
47
|
+
export const SPOTLIGHT_SKILL_FRONTMATTER_KEYS = [
|
|
48
|
+
"id",
|
|
49
|
+
"name",
|
|
50
|
+
"description",
|
|
51
|
+
"when_to_use",
|
|
52
|
+
"allowed-tools",
|
|
53
|
+
"argument-hint",
|
|
54
|
+
"arguments",
|
|
55
|
+
"disable-model-invocation",
|
|
56
|
+
"user-invocable",
|
|
57
|
+
"disallowed-tools",
|
|
58
|
+
"paths",
|
|
59
|
+
"context",
|
|
60
|
+
"agent",
|
|
61
|
+
"model",
|
|
62
|
+
"effort",
|
|
63
|
+
"hooks",
|
|
64
|
+
"shell",
|
|
65
|
+
"spotlight-response-strategy",
|
|
66
|
+
"spotlight-asset-types",
|
|
67
|
+
"capability-examples",
|
|
68
|
+
];
|
package/package.json
ADDED
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@inupedia/spotlight-protocol",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "Shared wire types for Inupedia Spotlight (client ↔ server)",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"license": "MIT",
|
|
7
|
+
"author": "inupedia",
|
|
8
|
+
"exports": {
|
|
9
|
+
".": {
|
|
10
|
+
"types": "./dist/index.d.ts",
|
|
11
|
+
"import": "./dist/index.js"
|
|
12
|
+
}
|
|
13
|
+
},
|
|
14
|
+
"main": "./dist/index.js",
|
|
15
|
+
"types": "./dist/index.d.ts",
|
|
16
|
+
"files": [
|
|
17
|
+
"dist"
|
|
18
|
+
],
|
|
19
|
+
"devDependencies": {
|
|
20
|
+
"typescript": "^5.9.3"
|
|
21
|
+
},
|
|
22
|
+
"scripts": {
|
|
23
|
+
"clean": "rm -rf dist",
|
|
24
|
+
"typecheck": "tsc -p tsconfig.json --noEmit",
|
|
25
|
+
"build": "pnpm run clean && tsc -p tsconfig.json"
|
|
26
|
+
}
|
|
27
|
+
}
|