@actiondock/builder 2.0.11 → 2.2.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/src/types.ts DELETED
@@ -1,337 +0,0 @@
1
- import type { ActionDockManifest, ActionManifestEntry, PlaybookDefinition, ProjectConfig } from "@actiondock/core";
2
-
3
- /**
4
- * Action 依赖描述。
5
- */
6
- export interface ActionDependency {
7
- /** Action 唯一标识符 */
8
- id: string;
9
- /** Action 入口文件相对路径 */
10
- entry: string;
11
- /** Action 源码文件绝对路径 */
12
- resolvedPath: string;
13
- /** 静态依赖的下游 Action ID 列表 */
14
- uses: string[];
15
- /** Action 功能描述 */
16
- description?: string;
17
- /** 入参校验模式 */
18
- inputSchema?: Record<string, unknown> | boolean;
19
- /** 出参校验模式 */
20
- outputSchema?: Record<string, unknown> | boolean;
21
- /** 标签列表 */
22
- tags?: string[];
23
- /** 扩展注解 */
24
- annotations?: Record<string, unknown>;
25
- }
26
-
27
- /**
28
- * 资产或模块依赖描述。
29
- */
30
- export interface AssetDependency {
31
- /** 资产相对路径 */
32
- path: string;
33
- /** 资产绝对物理路径 */
34
- resolvedPath: string;
35
- /** 资产类型:静态资产、规程文档、配置文件或模块源码 */
36
- type: "asset" | "playbook" | "config" | "module";
37
- }
38
-
39
- /**
40
- * 外部依赖描述。
41
- */
42
- export interface ExternalDependency {
43
- /** 外部依赖包名 */
44
- name: string;
45
- /** 版本约束范围 */
46
- versionRange?: string;
47
- /** 是否为开发期依赖 */
48
- isDev?: boolean;
49
- }
50
-
51
- /**
52
- * 构建规划中的依赖集合分类。
53
- */
54
- export interface BuildPlanDependencies {
55
- /** Action 依赖闭包 */
56
- actions: ActionDependency[];
57
- /** 模块与资产依赖 */
58
- modulesAndAssets: AssetDependency[];
59
- /** 外部 npm 依赖 */
60
- external: ExternalDependency[];
61
- }
62
-
63
- /**
64
- * Playbook 规划项。
65
- */
66
- export interface PlaybookPlanEntry {
67
- id: string;
68
- filePath: string;
69
- actions?: string[];
70
- description?: string;
71
- }
72
-
73
- /**
74
- * 构建规划产物结构。
75
- */
76
- export interface BuildPlan {
77
- /** 所属 Package ID */
78
- packageId: string;
79
- /** 项目展示名称 */
80
- packageName: string;
81
- /** 版本号 */
82
- version: string;
83
- /** 描述信息 */
84
- description?: string;
85
- /** 项目根目录绝对路径 */
86
- projectRoot: string;
87
- /** 参与构建的 Action 列表 */
88
- actions: ActionDependency[];
89
- /** 参与构建的 Playbook 列表 */
90
- playbooks: PlaybookPlanEntry[];
91
- /** 分类依赖明细 */
92
- dependencies: BuildPlanDependencies;
93
- /** 资产路径列表 */
94
- assets: string[];
95
- /** 声明的配置定义字典 */
96
- configDefs?: Record<string, unknown>;
97
- /** 规划元数据 */
98
- metadata: {
99
- plannedAt: string;
100
- schemaVersion: number;
101
- actionCount: number;
102
- playbookCount: number;
103
- };
104
- }
105
-
106
- /**
107
- * 构建规划器配置选项。
108
- */
109
- export interface BuildPlannerOptions {
110
- /** 项目根目录绝对路径 */
111
- projectRoot: string;
112
- /** 显式传入的项目配置(若未提供则从 actiondock.json 读取) */
113
- config?: ProjectConfig;
114
- /** 显式传入的声明式清单(若未提供则从 actiondock.manifest.json 读取) */
115
- manifest?: ActionDockManifest;
116
- /** 挑选的 Action ID 列表(用于依赖闭包裁剪) */
117
- actions?: string[];
118
- /** 挑选的 Playbook ID 列表(用于 Playbook 驱动的依赖闭包裁剪) */
119
- playbooks?: string[];
120
- }
121
-
122
- /**
123
- * 支持的 Bun 独立编译目标平台。
124
- */
125
- export type CompileTarget =
126
- | "bun"
127
- | "host"
128
- | "bun-linux-x64"
129
- | "linux-x64"
130
- | "bun-linux-arm64"
131
- | "linux-arm64"
132
- | "bun-darwin-x64"
133
- | "darwin-x64"
134
- | "bun-darwin-arm64"
135
- | "darwin-arm64"
136
- | "bun-windows-x64"
137
- | "windows-x64"
138
- | "bun-linux-x64-baseline"
139
- | "linux-x64-baseline"
140
- | "bun-linux-x64-modern"
141
- | "linux-x64-modern";
142
-
143
- /**
144
- * Bun 独立编译器参数选项。
145
- */
146
- export interface BunCompilerOptions {
147
- /** 编译入口文件绝对路径 */
148
- entrypoint: string;
149
- /** 目标二进制文件输出路径 */
150
- outfile: string;
151
- /** 编译目标平台架构(默认 host) */
152
- target?: CompileTarget | string;
153
- /** 是否开启代码压缩混淆(默认 true) */
154
- minify?: boolean;
155
- /** 是否启用字节码预编译(默认 true) */
156
- bytecode?: boolean;
157
- /** 构建工作目录(默认入口文件所在根目录) */
158
- cwd?: string;
159
- /** 自定义环境变量 */
160
- env?: Record<string, string>;
161
- /** 所属 Package ID(写入元数据用) */
162
- packageId?: string;
163
- /** 所属版本号(写入元数据用) */
164
- version?: string;
165
- /** 包含的 Action ID 列表(写入元数据用) */
166
- actions?: string[];
167
- /** 是否生成 artifact.json 元数据文件(默认 true) */
168
- emitMetadata?: boolean;
169
- }
170
-
171
- /**
172
- * Bun 独立编译器输出结果。
173
- */
174
- export interface BunCompilerResult {
175
- /** 所属 Package ID */
176
- packageId?: string;
177
- /** 版本号 */
178
- version?: string;
179
- /** 编译目标架构 */
180
- target: string;
181
- /** 独立二进制文件绝对路径 */
182
- executablePath: string;
183
- /** 独立二进制文件字节大小 */
184
- sizeBytes: number;
185
- /** 独立二进制文件的 SHA-256 校验和 */
186
- sha256: string;
187
- /** 生成的元数据文件绝对路径(若生成) */
188
- metadataPath?: string;
189
- /** 编译是否开启混淆 */
190
- minify: boolean;
191
- /** 编译是否启用字节码 */
192
- bytecode: boolean;
193
- /** 编译耗时(毫秒) */
194
- durationMs: number;
195
- /** 编译完成时间戳 */
196
- compiledAt: string;
197
- }
198
-
199
- /**
200
- * 归档压缩格式。
201
- */
202
- export type ArchiveFormat = "zip" | "tar.gz";
203
-
204
- /**
205
- * Skill 导出选项。
206
- */
207
- export interface SkillExporterOptions {
208
- /** 源码项目根目录绝对路径 */
209
- projectRoot: string;
210
- /** 导出模式:source 源码模式 或 standalone 独立二进制模式(默认 source) */
211
- mode?: "source" | "standalone";
212
- /** 是否开启独立二进制模式(简写选项) */
213
- standalone?: boolean;
214
- /** 二进制编译目标架构(仅在独立二进制模式生效,默认 host) */
215
- target?: CompileTarget | string;
216
- /** 导出产物目标目录(默认输出至 dist 目录) */
217
- outDir?: string;
218
- /** 是否执行归档压缩,亦可直接指定归档格式 */
219
- archive?: boolean | ArchiveFormat;
220
- /** 归档压缩格式(zip 或 tar.gz) */
221
- archiveFormat?: ArchiveFormat;
222
- /** 挑选的 Playbook 列表(用于 Playbook 驱动的依赖闭包裁剪) */
223
- playbooks?: string[];
224
- /** 挑选的 Action 列表(用于 Action 驱动的依赖闭包裁剪) */
225
- actions?: string[];
226
- /** 独立二进制模式下是否开启代码混淆(默认 true) */
227
- minify?: boolean;
228
- /** 独立二进制模式下是否编译为字节码(默认 true) */
229
- bytecode?: boolean;
230
- /** 预置的项目配置(可选) */
231
- config?: ProjectConfig;
232
- /** 预置的声明式清单(可选) */
233
- manifest?: ActionDockManifest;
234
- /** 是否跳过生成 SKILL.md(多包聚合时避免子包重复生成,对外保持唯一定义) */
235
- skipSkillMd?: boolean;
236
- /** 显式指定的已有 SKILL.md 文件路径(若提供或存在则直接使用,不再动态生成) */
237
- skillMdPath?: string;
238
- }
239
-
240
- /**
241
- * Skill 导出完成结果。
242
- */
243
- export interface SkillExportResult {
244
- /** 所属 Package ID */
245
- packageId: string;
246
- /** 项目版本号 */
247
- version: string;
248
- /** 导出模式 */
249
- mode: "source" | "standalone";
250
- /** 目标平台架构 */
251
- target: string;
252
- /** 生成的 Skill 目录绝对路径 */
253
- skillDir: string;
254
- /** 生成的归档文件绝对路径(若开启压缩) */
255
- archivePath?: string;
256
- /** 导出的 Action 数量 */
257
- actionsCount: number;
258
- /** 导出的 Playbook 数量 */
259
- playbooksCount: number;
260
- /** 导出的 Action ID 列表 */
261
- actions: string[];
262
- /** 导出的 Playbook ID 列表 */
263
- playbooks: string[];
264
- /** 导出的文件相对路径清单 */
265
- files: string[];
266
- /** 若复用了已有的 SKILL.md 文件,返回该文件的绝对路径 */
267
- usedExistingSkillMd?: string;
268
- }
269
-
270
- /**
271
- * 批量 Skill 导出选项。
272
- */
273
- export interface BatchSkillExportOptions extends Omit<SkillExporterOptions, "projectRoot"> {
274
- /** 待导出的项目根目录绝对路径列表 */
275
- projectRoots: string[];
276
- }
277
-
278
- /**
279
- * 批量 Skill 导出结果。
280
- */
281
- export interface BatchSkillExportResult {
282
- /** 各包独立导出结果列表 */
283
- results: SkillExportResult[];
284
- /** 批量导出根目录 */
285
- outDir: string;
286
- /** 导出的总 Action 数量 */
287
- totalActions: number;
288
- /** 导出的总 Playbook 数量 */
289
- totalPlaybooks: number;
290
- }
291
-
292
- /**
293
- * 复合 Skill 套件导出选项。
294
- */
295
- export interface CompositeSkillExportOptions {
296
- /** 复合技能套件名称 */
297
- bundleName: string;
298
- /** 参与聚合的项目根目录绝对路径列表 */
299
- projectRoots: string[];
300
- /** 复合套件输出目标目录(默认输出至 dist 目录) */
301
- outDir?: string;
302
- /** 复合技能描述信息 */
303
- description?: string;
304
- /** 是否执行归档压缩,亦可直接指定归档格式 */
305
- archive?: boolean | ArchiveFormat;
306
- /** 归档压缩格式(zip 或 tar.gz) */
307
- archiveFormat?: ArchiveFormat;
308
- /** 工作区根目录(用于检索工作区现有的 SKILL.md 等资产,默认基于 cwd 与项目目录推导) */
309
- workspaceRoot?: string;
310
- /** 显式指定的已有 SKILL.md 文件路径(若存在则直接使用,不再动态生成) */
311
- skillMdPath?: string;
312
- }
313
-
314
- /**
315
- * 复合 Skill 套件导出结果。
316
- */
317
- export interface CompositeSkillExportResult {
318
- /** 复合技能套件名称 */
319
- bundleName: string;
320
- /** 生成的复合 Skill 目录绝对路径 */
321
- skillDir: string;
322
- /** 生成的归档文件绝对路径(若开启压缩) */
323
- archivePath?: string;
324
- /** 包含的 Package 数量 */
325
- packagesCount: number;
326
- /** 包含的总 Action 数量 */
327
- actionsCount: number;
328
- /** 包含的总 Playbook 数量 */
329
- playbooksCount: number;
330
- /** 各包的摘要明细 */
331
- packages: Array<{ packageId: string; actions: string[]; playbooks: string[] }>;
332
- /** 生成的文件清单 */
333
- files: string[];
334
- /** 若复用了已有的 SKILL.md 文件,返回该文件的绝对路径 */
335
- usedExistingSkillMd?: string;
336
- }
337
-