@seastudio/sdk 3.3.3 → 3.4.1

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.
Files changed (39) hide show
  1. package/dist/{chunk-HXP4V4WE.js → chunk-6DB7VMZE.js} +1 -1
  2. package/dist/{chunk-IZRKT6NQ.js → chunk-BOV7JVZ6.js} +47 -2
  3. package/dist/{chunk-GEPSOYJN.cjs → chunk-GUBMEDHZ.cjs} +15 -5
  4. package/dist/{chunk-3STW46ME.cjs → chunk-N2OEAPF2.cjs} +4 -4
  5. package/dist/{chunk-X62SRZS4.js → chunk-P45BKQJK.js} +15 -5
  6. package/dist/{chunk-UXBJODKS.cjs → chunk-SWEUWPSR.cjs} +47 -1
  7. package/dist/index.cjs +38 -120
  8. package/dist/index.d.cts +1 -3
  9. package/dist/index.d.ts +1 -3
  10. package/dist/index.js +3 -5
  11. package/dist/mcp/core/index.d.cts +2 -2
  12. package/dist/mcp/core/index.d.ts +2 -2
  13. package/dist/mcp/index.cjs +24 -24
  14. package/dist/mcp/index.d.cts +2 -2
  15. package/dist/mcp/index.d.ts +2 -2
  16. package/dist/mcp/index.js +2 -2
  17. package/dist/mcp/seastudio/index.cjs +33 -29
  18. package/dist/mcp/seastudio/index.d.cts +17 -3
  19. package/dist/mcp/seastudio/index.d.ts +17 -3
  20. package/dist/mcp/seastudio/index.js +1 -1
  21. package/dist/{types-DY867NzA.d.cts → types-Coyj9hGb.d.cts} +1 -1
  22. package/dist/{types-DY867NzA.d.ts → types-Coyj9hGb.d.ts} +1 -1
  23. package/dist/ui/index.cjs +14 -14
  24. package/dist/ui/index.js +1 -1
  25. package/package.json +1 -11
  26. package/dist/chunk-GCE3TTCJ.cjs +0 -184
  27. package/dist/chunk-O2C4Z5B5.cjs +0 -65
  28. package/dist/chunk-OVBIWRAB.js +0 -170
  29. package/dist/chunk-ZOGVKB2Z.js +0 -57
  30. package/dist/registry-OS2Xo46V.d.cts +0 -138
  31. package/dist/registry-OS2Xo46V.d.ts +0 -138
  32. package/dist/skill/index.cjs +0 -87
  33. package/dist/skill/index.d.cts +0 -60
  34. package/dist/skill/index.d.ts +0 -60
  35. package/dist/skill/index.js +0 -2
  36. package/dist/skill/registry.cjs +0 -34
  37. package/dist/skill/registry.d.cts +0 -1
  38. package/dist/skill/registry.d.ts +0 -1
  39. package/dist/skill/registry.js +0 -1
@@ -1,184 +0,0 @@
1
- 'use strict';
2
-
3
- // src/skill/parser.ts
4
- var FRONTMATTER_RE = /^---\r?\n([\s\S]*?)\r?\n---\r?\n?/;
5
- function stripQuotes(value) {
6
- const trimmed = value.trim();
7
- if (trimmed.length >= 2) {
8
- const first = trimmed[0];
9
- const last = trimmed[trimmed.length - 1];
10
- if (first === '"' && last === '"' || first === "'" && last === "'") {
11
- return trimmed.slice(1, -1);
12
- }
13
- }
14
- return trimmed;
15
- }
16
- function parseInlineList(value) {
17
- const trimmed = value.trim();
18
- if (!trimmed.startsWith("[") || !trimmed.endsWith("]")) {
19
- return null;
20
- }
21
- const inner = trimmed.slice(1, -1).trim();
22
- if (!inner) return [];
23
- return inner.split(",").map((part) => stripQuotes(part)).filter((s) => s.length > 0);
24
- }
25
- function parseSkillFrontmatter(markdown) {
26
- const match = FRONTMATTER_RE.exec(markdown);
27
- if (!match) return {};
28
- const block = match[1];
29
- const result = { extra: {} };
30
- const lines = block.split(/\r?\n/);
31
- let pendingListKey = null;
32
- const pendingList = [];
33
- const flushPendingList = () => {
34
- if (pendingListKey) {
35
- if (pendingListKey === "tags") {
36
- result.tags = [...pendingList];
37
- } else {
38
- result.extra[pendingListKey] = pendingList.join(",");
39
- }
40
- pendingListKey = null;
41
- pendingList.length = 0;
42
- }
43
- };
44
- for (const rawLine of lines) {
45
- const line = rawLine.replace(/\s+$/g, "");
46
- if (!line.trim()) {
47
- flushPendingList();
48
- continue;
49
- }
50
- const listItemMatch = /^\s*-\s+(.*)$/.exec(line);
51
- if (listItemMatch && pendingListKey) {
52
- pendingList.push(stripQuotes(listItemMatch[1]));
53
- continue;
54
- }
55
- flushPendingList();
56
- const kvMatch = /^([A-Za-z0-9_-]+)\s*:\s*(.*)$/.exec(line);
57
- if (!kvMatch) continue;
58
- const key = kvMatch[1];
59
- const value = kvMatch[2];
60
- if (value === "") {
61
- pendingListKey = key;
62
- pendingList.length = 0;
63
- continue;
64
- }
65
- if (key === "tags") {
66
- const inline = parseInlineList(value);
67
- if (inline !== null) {
68
- result.tags = inline;
69
- } else {
70
- result.tags = stripQuotes(value).split(",").map((s) => s.trim()).filter(Boolean);
71
- }
72
- continue;
73
- }
74
- const cleaned = stripQuotes(value);
75
- if (key === "name") result.name = cleaned;
76
- else if (key === "description") result.description = cleaned;
77
- else result.extra[key] = cleaned;
78
- }
79
- flushPendingList();
80
- if (result.extra && Object.keys(result.extra).length === 0) {
81
- delete result.extra;
82
- }
83
- return result;
84
- }
85
- function buildSkillId(source, dirName) {
86
- const safe = dirName.trim().replace(/[\\/]+/g, "-").replace(/\s+/g, "-");
87
- return `${source}:${safe}`;
88
- }
89
-
90
- // src/skill/client.ts
91
- var currentTransport = null;
92
- function setSkillTransport(transport) {
93
- currentTransport = transport;
94
- }
95
- function getSkillTransport() {
96
- if (currentTransport) {
97
- return currentTransport;
98
- }
99
- const auto = tryAutoBindElectronTransport();
100
- if (auto) {
101
- currentTransport = auto;
102
- return auto;
103
- }
104
- throw new Error(
105
- "[skill] No SkillTransport configured. Call setSkillTransport() or useElectronSkillTransport() first."
106
- );
107
- }
108
- async function listSkills() {
109
- return getSkillTransport().list();
110
- }
111
- async function getSkill(id) {
112
- return getSkillTransport().get(id);
113
- }
114
- async function rescanSkills() {
115
- return getSkillTransport().rescan();
116
- }
117
- function onSkillsChanged(listener) {
118
- const transport = getSkillTransport();
119
- if (!transport.onChanged) {
120
- return () => {
121
- };
122
- }
123
- return transport.onChanged(listener);
124
- }
125
- async function setSkillEnabled(id, value) {
126
- const t = getSkillTransport();
127
- if (!t.setEnabled) throw new Error("[skill] transport.setEnabled not supported");
128
- return t.setEnabled(id, value);
129
- }
130
- async function setSkillScope(id, scope) {
131
- const t = getSkillTransport();
132
- if (!t.setScope) throw new Error("[skill] transport.setScope not supported");
133
- return t.setScope(id, scope);
134
- }
135
- async function uninstallSkill(id) {
136
- const t = getSkillTransport();
137
- if (!t.uninstall) throw new Error("[skill] transport.uninstall not supported");
138
- return t.uninstall(id);
139
- }
140
- async function listSkillProjects() {
141
- const t = getSkillTransport();
142
- if (!t.listProjects) throw new Error("[skill] transport.listProjects not supported");
143
- return t.listProjects();
144
- }
145
- function readElectronSkillBridge() {
146
- const globalAny = globalThis;
147
- return globalAny.electronAPI?.engine?.skill ?? null;
148
- }
149
- function tryAutoBindElectronTransport() {
150
- const bridge = readElectronSkillBridge();
151
- if (!bridge) return null;
152
- return {
153
- list: () => bridge.list(),
154
- get: (id) => bridge.get(id),
155
- rescan: () => bridge.rescan(),
156
- onChanged: bridge.onChanged ? (cb) => bridge.onChanged(cb) : void 0,
157
- setEnabled: bridge.setEnabled ? (id, value) => bridge.setEnabled(id, value) : void 0,
158
- setScope: bridge.setScope ? (id, scope) => bridge.setScope(id, scope) : void 0,
159
- uninstall: bridge.uninstall ? (id) => bridge.uninstall(id) : void 0,
160
- listProjects: bridge.listProjects ? () => bridge.listProjects() : void 0
161
- };
162
- }
163
- function useElectronSkillTransport() {
164
- const transport = tryAutoBindElectronTransport();
165
- if (transport) {
166
- setSkillTransport(transport);
167
- return true;
168
- }
169
- return false;
170
- }
171
-
172
- exports.buildSkillId = buildSkillId;
173
- exports.getSkill = getSkill;
174
- exports.getSkillTransport = getSkillTransport;
175
- exports.listSkillProjects = listSkillProjects;
176
- exports.listSkills = listSkills;
177
- exports.onSkillsChanged = onSkillsChanged;
178
- exports.parseSkillFrontmatter = parseSkillFrontmatter;
179
- exports.rescanSkills = rescanSkills;
180
- exports.setSkillEnabled = setSkillEnabled;
181
- exports.setSkillScope = setSkillScope;
182
- exports.setSkillTransport = setSkillTransport;
183
- exports.uninstallSkill = uninstallSkill;
184
- exports.useElectronSkillTransport = useElectronSkillTransport;
@@ -1,65 +0,0 @@
1
- 'use strict';
2
-
3
- // src/skill/registry.ts
4
- var currentTransport = null;
5
- function setSkillRegistryTransport(transport) {
6
- currentTransport = transport;
7
- }
8
- function getSkillRegistryTransport() {
9
- if (currentTransport) return currentTransport;
10
- const auto = tryAutoBindElectronTransport();
11
- if (auto) {
12
- currentTransport = auto;
13
- return auto;
14
- }
15
- throw new Error(
16
- "[skill/registry] No SkillRegistryTransport configured. Call setSkillRegistryTransport() or useElectronSkillRegistryTransport() first."
17
- );
18
- }
19
- async function listMarketSkills() {
20
- const payload = await getSkillRegistryTransport().list();
21
- return Array.isArray(payload.skills) ? payload.skills : [];
22
- }
23
- async function getMarketSkill(id) {
24
- return getSkillRegistryTransport().detail(id);
25
- }
26
- async function selectPublishSkillFile() {
27
- const t = getSkillRegistryTransport();
28
- if (!t.selectPublishFile) throw new Error("[skill/registry] transport.selectPublishFile not supported");
29
- return t.selectPublishFile();
30
- }
31
- async function publishSkill(archivePath, publishPassword) {
32
- const t = getSkillRegistryTransport();
33
- if (!t.publishFile) throw new Error("[skill/registry] transport.publishFile not supported");
34
- return t.publishFile(archivePath, publishPassword);
35
- }
36
- function readElectronSkillRegistryBridge() {
37
- const globalAny = globalThis;
38
- return globalAny.electronAPI?.engine?.skillRegistry ?? null;
39
- }
40
- function tryAutoBindElectronTransport() {
41
- const bridge = readElectronSkillRegistryBridge();
42
- if (!bridge) return null;
43
- return {
44
- list: () => bridge.list(),
45
- detail: (id) => bridge.detail(id),
46
- selectPublishFile: bridge.selectPublishFile ? () => bridge.selectPublishFile() : void 0,
47
- publishFile: bridge.publishFile ? (archivePath, password) => bridge.publishFile(archivePath, password) : void 0
48
- };
49
- }
50
- function useElectronSkillRegistryTransport() {
51
- const transport = tryAutoBindElectronTransport();
52
- if (transport) {
53
- setSkillRegistryTransport(transport);
54
- return true;
55
- }
56
- return false;
57
- }
58
-
59
- exports.getMarketSkill = getMarketSkill;
60
- exports.getSkillRegistryTransport = getSkillRegistryTransport;
61
- exports.listMarketSkills = listMarketSkills;
62
- exports.publishSkill = publishSkill;
63
- exports.selectPublishSkillFile = selectPublishSkillFile;
64
- exports.setSkillRegistryTransport = setSkillRegistryTransport;
65
- exports.useElectronSkillRegistryTransport = useElectronSkillRegistryTransport;
@@ -1,170 +0,0 @@
1
- // src/skill/parser.ts
2
- var FRONTMATTER_RE = /^---\r?\n([\s\S]*?)\r?\n---\r?\n?/;
3
- function stripQuotes(value) {
4
- const trimmed = value.trim();
5
- if (trimmed.length >= 2) {
6
- const first = trimmed[0];
7
- const last = trimmed[trimmed.length - 1];
8
- if (first === '"' && last === '"' || first === "'" && last === "'") {
9
- return trimmed.slice(1, -1);
10
- }
11
- }
12
- return trimmed;
13
- }
14
- function parseInlineList(value) {
15
- const trimmed = value.trim();
16
- if (!trimmed.startsWith("[") || !trimmed.endsWith("]")) {
17
- return null;
18
- }
19
- const inner = trimmed.slice(1, -1).trim();
20
- if (!inner) return [];
21
- return inner.split(",").map((part) => stripQuotes(part)).filter((s) => s.length > 0);
22
- }
23
- function parseSkillFrontmatter(markdown) {
24
- const match = FRONTMATTER_RE.exec(markdown);
25
- if (!match) return {};
26
- const block = match[1];
27
- const result = { extra: {} };
28
- const lines = block.split(/\r?\n/);
29
- let pendingListKey = null;
30
- const pendingList = [];
31
- const flushPendingList = () => {
32
- if (pendingListKey) {
33
- if (pendingListKey === "tags") {
34
- result.tags = [...pendingList];
35
- } else {
36
- result.extra[pendingListKey] = pendingList.join(",");
37
- }
38
- pendingListKey = null;
39
- pendingList.length = 0;
40
- }
41
- };
42
- for (const rawLine of lines) {
43
- const line = rawLine.replace(/\s+$/g, "");
44
- if (!line.trim()) {
45
- flushPendingList();
46
- continue;
47
- }
48
- const listItemMatch = /^\s*-\s+(.*)$/.exec(line);
49
- if (listItemMatch && pendingListKey) {
50
- pendingList.push(stripQuotes(listItemMatch[1]));
51
- continue;
52
- }
53
- flushPendingList();
54
- const kvMatch = /^([A-Za-z0-9_-]+)\s*:\s*(.*)$/.exec(line);
55
- if (!kvMatch) continue;
56
- const key = kvMatch[1];
57
- const value = kvMatch[2];
58
- if (value === "") {
59
- pendingListKey = key;
60
- pendingList.length = 0;
61
- continue;
62
- }
63
- if (key === "tags") {
64
- const inline = parseInlineList(value);
65
- if (inline !== null) {
66
- result.tags = inline;
67
- } else {
68
- result.tags = stripQuotes(value).split(",").map((s) => s.trim()).filter(Boolean);
69
- }
70
- continue;
71
- }
72
- const cleaned = stripQuotes(value);
73
- if (key === "name") result.name = cleaned;
74
- else if (key === "description") result.description = cleaned;
75
- else result.extra[key] = cleaned;
76
- }
77
- flushPendingList();
78
- if (result.extra && Object.keys(result.extra).length === 0) {
79
- delete result.extra;
80
- }
81
- return result;
82
- }
83
- function buildSkillId(source, dirName) {
84
- const safe = dirName.trim().replace(/[\\/]+/g, "-").replace(/\s+/g, "-");
85
- return `${source}:${safe}`;
86
- }
87
-
88
- // src/skill/client.ts
89
- var currentTransport = null;
90
- function setSkillTransport(transport) {
91
- currentTransport = transport;
92
- }
93
- function getSkillTransport() {
94
- if (currentTransport) {
95
- return currentTransport;
96
- }
97
- const auto = tryAutoBindElectronTransport();
98
- if (auto) {
99
- currentTransport = auto;
100
- return auto;
101
- }
102
- throw new Error(
103
- "[skill] No SkillTransport configured. Call setSkillTransport() or useElectronSkillTransport() first."
104
- );
105
- }
106
- async function listSkills() {
107
- return getSkillTransport().list();
108
- }
109
- async function getSkill(id) {
110
- return getSkillTransport().get(id);
111
- }
112
- async function rescanSkills() {
113
- return getSkillTransport().rescan();
114
- }
115
- function onSkillsChanged(listener) {
116
- const transport = getSkillTransport();
117
- if (!transport.onChanged) {
118
- return () => {
119
- };
120
- }
121
- return transport.onChanged(listener);
122
- }
123
- async function setSkillEnabled(id, value) {
124
- const t = getSkillTransport();
125
- if (!t.setEnabled) throw new Error("[skill] transport.setEnabled not supported");
126
- return t.setEnabled(id, value);
127
- }
128
- async function setSkillScope(id, scope) {
129
- const t = getSkillTransport();
130
- if (!t.setScope) throw new Error("[skill] transport.setScope not supported");
131
- return t.setScope(id, scope);
132
- }
133
- async function uninstallSkill(id) {
134
- const t = getSkillTransport();
135
- if (!t.uninstall) throw new Error("[skill] transport.uninstall not supported");
136
- return t.uninstall(id);
137
- }
138
- async function listSkillProjects() {
139
- const t = getSkillTransport();
140
- if (!t.listProjects) throw new Error("[skill] transport.listProjects not supported");
141
- return t.listProjects();
142
- }
143
- function readElectronSkillBridge() {
144
- const globalAny = globalThis;
145
- return globalAny.electronAPI?.engine?.skill ?? null;
146
- }
147
- function tryAutoBindElectronTransport() {
148
- const bridge = readElectronSkillBridge();
149
- if (!bridge) return null;
150
- return {
151
- list: () => bridge.list(),
152
- get: (id) => bridge.get(id),
153
- rescan: () => bridge.rescan(),
154
- onChanged: bridge.onChanged ? (cb) => bridge.onChanged(cb) : void 0,
155
- setEnabled: bridge.setEnabled ? (id, value) => bridge.setEnabled(id, value) : void 0,
156
- setScope: bridge.setScope ? (id, scope) => bridge.setScope(id, scope) : void 0,
157
- uninstall: bridge.uninstall ? (id) => bridge.uninstall(id) : void 0,
158
- listProjects: bridge.listProjects ? () => bridge.listProjects() : void 0
159
- };
160
- }
161
- function useElectronSkillTransport() {
162
- const transport = tryAutoBindElectronTransport();
163
- if (transport) {
164
- setSkillTransport(transport);
165
- return true;
166
- }
167
- return false;
168
- }
169
-
170
- export { buildSkillId, getSkill, getSkillTransport, listSkillProjects, listSkills, onSkillsChanged, parseSkillFrontmatter, rescanSkills, setSkillEnabled, setSkillScope, setSkillTransport, uninstallSkill, useElectronSkillTransport };
@@ -1,57 +0,0 @@
1
- // src/skill/registry.ts
2
- var currentTransport = null;
3
- function setSkillRegistryTransport(transport) {
4
- currentTransport = transport;
5
- }
6
- function getSkillRegistryTransport() {
7
- if (currentTransport) return currentTransport;
8
- const auto = tryAutoBindElectronTransport();
9
- if (auto) {
10
- currentTransport = auto;
11
- return auto;
12
- }
13
- throw new Error(
14
- "[skill/registry] No SkillRegistryTransport configured. Call setSkillRegistryTransport() or useElectronSkillRegistryTransport() first."
15
- );
16
- }
17
- async function listMarketSkills() {
18
- const payload = await getSkillRegistryTransport().list();
19
- return Array.isArray(payload.skills) ? payload.skills : [];
20
- }
21
- async function getMarketSkill(id) {
22
- return getSkillRegistryTransport().detail(id);
23
- }
24
- async function selectPublishSkillFile() {
25
- const t = getSkillRegistryTransport();
26
- if (!t.selectPublishFile) throw new Error("[skill/registry] transport.selectPublishFile not supported");
27
- return t.selectPublishFile();
28
- }
29
- async function publishSkill(archivePath, publishPassword) {
30
- const t = getSkillRegistryTransport();
31
- if (!t.publishFile) throw new Error("[skill/registry] transport.publishFile not supported");
32
- return t.publishFile(archivePath, publishPassword);
33
- }
34
- function readElectronSkillRegistryBridge() {
35
- const globalAny = globalThis;
36
- return globalAny.electronAPI?.engine?.skillRegistry ?? null;
37
- }
38
- function tryAutoBindElectronTransport() {
39
- const bridge = readElectronSkillRegistryBridge();
40
- if (!bridge) return null;
41
- return {
42
- list: () => bridge.list(),
43
- detail: (id) => bridge.detail(id),
44
- selectPublishFile: bridge.selectPublishFile ? () => bridge.selectPublishFile() : void 0,
45
- publishFile: bridge.publishFile ? (archivePath, password) => bridge.publishFile(archivePath, password) : void 0
46
- };
47
- }
48
- function useElectronSkillRegistryTransport() {
49
- const transport = tryAutoBindElectronTransport();
50
- if (transport) {
51
- setSkillRegistryTransport(transport);
52
- return true;
53
- }
54
- return false;
55
- }
56
-
57
- export { getMarketSkill, getSkillRegistryTransport, listMarketSkills, publishSkill, selectPublishSkillFile, setSkillRegistryTransport, useElectronSkillRegistryTransport };
@@ -1,138 +0,0 @@
1
- /**
2
- * Skill 数据模型
3
- *
4
- * 表示一个外部 Agent Skill(Claude Code / Codex / Cursor / SeaStudio 自带)的
5
- * 基础元信息和加载入口。识别约定:每个 skill 是一个目录,里面包含 SKILL.md。
6
- */
7
- type SkillSource = 'seastudio' | 'claude-code' | 'codex' | 'cursor' | 'custom';
8
- interface SkillScope {
9
- /** 是否对当前用户「个人」全局生效(不限项目) */
10
- personal: boolean;
11
- /** 在哪些项目(projectId)下生效 */
12
- projects: string[];
13
- }
14
- interface SkillProjectInfo {
15
- id: string;
16
- name: string;
17
- }
18
- interface Skill {
19
- /** 稳定 id:`${source}:${dirName}` */
20
- id: string;
21
- /** 显示名(来自 frontmatter.name 或目录名) */
22
- name: string;
23
- /** 描述(来自 frontmatter.description,缺失则空字符串) */
24
- description: string;
25
- /** 版本号(若 frontmatter 含 version 则填充) */
26
- version?: string;
27
- /** 标签(来自 frontmatter.tags) */
28
- tags?: string[];
29
- /** Skill 目录的绝对路径 */
30
- path: string;
31
- /** 入口文件绝对路径(通常为 SKILL.md) */
32
- entryFile: string;
33
- /** 来源类型 */
34
- source: SkillSource;
35
- /** 来源的人类可读标签,例如 "Claude Code (~/.claude/skills)" */
36
- sourceLabel?: string;
37
- /** 是否启用(持久化到 <userData>/skills-state.json) */
38
- enabled?: boolean;
39
- /** 生效范围(持久化到 <userData>/skills-state.json) */
40
- scope?: SkillScope;
41
- /** 其它 frontmatter 原样字段,便于上层扩展 */
42
- metadata?: Record<string, unknown>;
43
- }
44
- interface SkillContent {
45
- id: string;
46
- /** SKILL.md 的完整文本内容 */
47
- content: string;
48
- metadata: {
49
- name: string;
50
- description: string;
51
- tags?: string[];
52
- };
53
- }
54
- interface ScannedRoot {
55
- source: SkillSource;
56
- path: string;
57
- label: string;
58
- exists: boolean;
59
- count: number;
60
- }
61
- interface SkillScanResult {
62
- skills: Skill[];
63
- scannedRoots: ScannedRoot[];
64
- }
65
- type SkillReleaseStatus = 'draft' | 'published' | 'hidden' | 'pending_review';
66
- interface RegistrySkillSummary {
67
- id: string;
68
- name: string;
69
- description?: string;
70
- protocol_host?: string;
71
- icon_url?: string;
72
- tags?: string[];
73
- official: boolean;
74
- builtin: boolean;
75
- version: string;
76
- filename: string;
77
- download_url: string;
78
- checksum?: string;
79
- size?: number;
80
- status: SkillReleaseStatus;
81
- created_at: string;
82
- updated_at: string;
83
- }
84
- interface SkillReleaseRecord {
85
- version: string;
86
- filename: string;
87
- download_url: string;
88
- checksum?: string;
89
- size?: number;
90
- status: SkillReleaseStatus;
91
- created_at: string;
92
- }
93
- interface SkillDetailResponse {
94
- id: string;
95
- name: string;
96
- description?: string;
97
- protocol_host?: string;
98
- icon_url?: string;
99
- tags?: string[];
100
- official: boolean;
101
- builtin: boolean;
102
- releases: SkillReleaseRecord[];
103
- }
104
- interface SkillRegistryListResponse {
105
- updated_at: string;
106
- skills: RegistrySkillSummary[];
107
- }
108
- interface PublishSkillReleaseResult {
109
- success: boolean;
110
- skill_id: string;
111
- version: string;
112
- status: SkillReleaseStatus;
113
- download_url: string;
114
- }
115
-
116
- /**
117
- * Skill 市场(DataServer 注册表)SDK Client
118
- *
119
- * 与 [client.ts](./client.ts) 保持一致的"transport 由宿主注入 + Electron 自动桥接"模式。
120
- * Renderer 通过 `window.electronAPI.engine.skillRegistry` 走 IPC,
121
- * 其它环境(测试 / Node)调用 `setSkillRegistryTransport(...)` 注入自定义实现。
122
- */
123
-
124
- interface SkillRegistryTransport {
125
- list(): Promise<SkillRegistryListResponse>;
126
- detail(id: string): Promise<SkillDetailResponse>;
127
- selectPublishFile?(): Promise<string | null>;
128
- publishFile?(archivePath: string, publishPassword?: string): Promise<PublishSkillReleaseResult>;
129
- }
130
- declare function setSkillRegistryTransport(transport: SkillRegistryTransport | null): void;
131
- declare function getSkillRegistryTransport(): SkillRegistryTransport;
132
- declare function listMarketSkills(): Promise<RegistrySkillSummary[]>;
133
- declare function getMarketSkill(id: string): Promise<SkillDetailResponse>;
134
- declare function selectPublishSkillFile(): Promise<string | null>;
135
- declare function publishSkill(archivePath: string, publishPassword?: string): Promise<PublishSkillReleaseResult>;
136
- declare function useElectronSkillRegistryTransport(): boolean;
137
-
138
- export { type PublishSkillReleaseResult as P, type RegistrySkillSummary as R, type ScannedRoot as S, type Skill as a, type SkillContent as b, type SkillDetailResponse as c, type SkillProjectInfo as d, type SkillRegistryListResponse as e, type SkillRegistryTransport as f, type SkillReleaseRecord as g, type SkillReleaseStatus as h, type SkillScanResult as i, type SkillScope as j, type SkillSource as k, getMarketSkill as l, getSkillRegistryTransport as m, listMarketSkills as n, setSkillRegistryTransport as o, publishSkill as p, selectPublishSkillFile as s, useElectronSkillRegistryTransport as u };