@actiondock/builder 2.0.11 → 2.0.12

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.
@@ -0,0 +1,26 @@
1
+ /**
2
+ * 将目录打包为标准 zip 归档(PKZIP APPNOTE 结构)。
3
+ * 直接流式分块写入磁盘,避免在内存中积压全量归档内容。
4
+ *
5
+ * @param dir 待打包目录(目录名即归档内根文件夹名)
6
+ * @param outPath 输出 zip 文件路径
7
+ */
8
+ export declare function createZipArchive(dir: string, outPath: string): void;
9
+ /**
10
+ * 异步标准 zip 归档。
11
+ */
12
+ export declare function createZipArchiveAsync(dir: string, outPath: string): Promise<void>;
13
+ /**
14
+ * 将目录打包为标准 tar.gz 归档(USTAR + gzip)。
15
+ *
16
+ * @param dir 待打包目录(目录名即归档内根文件夹名)
17
+ * @param outPath 输出 tar.gz 文件路径
18
+ */
19
+ export declare function createTarGzArchive(dir: string, outPath: string): void;
20
+ /**
21
+ * 将目录异步流式打包为标准 tar.gz 归档(USTAR + gzip 流),避免把超大二进制和归档缓冲在内存中。
22
+ *
23
+ * @param dir 待打包目录
24
+ * @param outPath 输出 tar.gz 文件路径
25
+ */
26
+ export declare function createTarGzArchiveAsync(dir: string, outPath: string): Promise<void>;
@@ -0,0 +1,41 @@
1
+ /**
2
+ * 独立二进制可执行文件构建选项。
3
+ */
4
+ export interface BuildOptions {
5
+ /** 目标项目根目录 */
6
+ projectRoot: string;
7
+ /** 目标架构(如 "bun-linux-x64", "bun-darwin-arm64", "bun-windows-x64" 等) */
8
+ target?: string;
9
+ /** 输出可执行文件的目标路径(默认输出到 dist/ 目录) */
10
+ outfile?: string;
11
+ /** 是否开启代码压缩混淆(默认 true) */
12
+ minify?: boolean;
13
+ /** 是否编译为 V8/JavaScriptCore 字节码(默认 true) */
14
+ bytecode?: boolean;
15
+ /** 显式挑选打包的 Action ID 清单(用于按需子集打包) */
16
+ actions?: string[];
17
+ }
18
+ /**
19
+ * 独立二进制构建完成后的元数据结果对象。
20
+ */
21
+ export interface BuildResult {
22
+ /** 所属 Package ID */
23
+ packageId: string;
24
+ /** 打包的项目版本号 */
25
+ version: string;
26
+ /** 编译的目标平台架构 */
27
+ target: string;
28
+ /** 生成的独立二进制可执行文件绝对路径 */
29
+ executablePath: string;
30
+ /** 生成的 sidecar 元数据 JSON 文件绝对路径 */
31
+ metadataPath: string;
32
+ /** 打包内置的 Action ID 列表 */
33
+ actions: string[];
34
+ }
35
+ /**
36
+ * 调用 Bun 原生编译引擎(Bun.build --compile)将 Action Package 打包为零外部依赖的独立二进制可执行文件。
37
+ *
38
+ * @param options 构建参数
39
+ * @returns 构建产物结果元数据
40
+ */
41
+ export declare function buildProject(options: BuildOptions): Promise<BuildResult>;
@@ -0,0 +1,22 @@
1
+ import type { BunCompilerOptions, BunCompilerResult } from "./types";
2
+ /**
3
+ * Bun 独立二进制编译器。
4
+ * 封装 bun build --compile 调用,提前校验选项组合,收集构建产物与元数据。
5
+ */
6
+ export declare class BunCompiler {
7
+ /**
8
+ * 执行独立二进制编译。
9
+ *
10
+ * @param options 编译参数
11
+ * @returns 编译产物元数据结果
12
+ */
13
+ compile(options: BunCompilerOptions): Promise<BunCompilerResult>;
14
+ /**
15
+ * 静态辅助调用方法。
16
+ */
17
+ static compile(options: BunCompilerOptions): Promise<BunCompilerResult>;
18
+ }
19
+ /**
20
+ * 快捷独立二进制编译函数。
21
+ */
22
+ export declare function compileBinary(options: BunCompilerOptions): Promise<BunCompilerResult>;
@@ -0,0 +1,41 @@
1
+ /**
2
+ * Builder 模块基础错误类。
3
+ */
4
+ export declare class BuilderError extends Error {
5
+ constructor(message: string);
6
+ }
7
+ /**
8
+ * 构建规划阶段抛出的错误。
9
+ */
10
+ export declare class PlannerError extends BuilderError {
11
+ readonly code: string;
12
+ constructor(message: string, code?: string);
13
+ }
14
+ /**
15
+ * 编译器参数与目标平台校验错误。
16
+ */
17
+ export declare class CompilerValidationError extends BuilderError {
18
+ readonly code: string;
19
+ readonly target?: string;
20
+ constructor(message: string, options?: {
21
+ code?: string;
22
+ target?: string;
23
+ });
24
+ }
25
+ /**
26
+ * 编译器调用执行失败错误。包含标准化错误码与详情。
27
+ */
28
+ export declare class CompilerError extends BuilderError {
29
+ readonly code: string;
30
+ readonly exitCode: number;
31
+ readonly rawError: string;
32
+ readonly details: string[];
33
+ readonly target?: string;
34
+ constructor(message: string, options: {
35
+ code: string;
36
+ exitCode: number;
37
+ rawError: string;
38
+ details?: string[];
39
+ target?: string;
40
+ });
41
+ }
@@ -0,0 +1,59 @@
1
+ /**
2
+ * 获取内部 @actiondock/* 依赖的版本号规则。
3
+ * 若为主干预发布版本(包含破折号如 -beta / -rc),直接对齐精确版本;普通正式版采用 ^ 范围约束。
4
+ */
5
+ export declare function getInternalDependencyVersion(version?: string): string;
6
+ import type { BatchSkillExportOptions, BatchSkillExportResult, CompositeSkillExportOptions, CompositeSkillExportResult, SkillExporterOptions, SkillExportResult } from "./types";
7
+ /**
8
+ * 检索单个 Action 项目目录中已存在的 SKILL.md 文件。
9
+ */
10
+ export declare function findExistingSingleSkillMd(projectRoot: string, explicitPath?: string, pkgSlug?: string): string | undefined;
11
+ /**
12
+ * 检索复合套件工作区中已存在的 SKILL.md 文件。
13
+ */
14
+ export declare function findExistingCompositeSkillMd(options: CompositeSkillExportOptions): string | undefined;
15
+ /**
16
+ * Agent Skill 导出器。
17
+ * 负责源码型 Skill 与独立二进制型 Skill 的构建、打包与归档分发。
18
+ */
19
+ export declare class SkillExporter {
20
+ /**
21
+ * 导出 Skill 产物包。
22
+ *
23
+ * @param options 导出配置
24
+ * @returns 导出产物详细描述
25
+ */
26
+ export(options: SkillExporterOptions): Promise<SkillExportResult>;
27
+ /**
28
+ * 批量导出多个 Skill。
29
+ */
30
+ exportBatch(options: BatchSkillExportOptions): Promise<BatchSkillExportResult>;
31
+ /**
32
+ * 静态辅助调用批量导出方法。
33
+ */
34
+ static exportBatch(options: BatchSkillExportOptions): Promise<BatchSkillExportResult>;
35
+ /**
36
+ * 复合模式导出:将多个包聚合为一个统一的复合技能目录。
37
+ */
38
+ exportComposite(options: CompositeSkillExportOptions): Promise<CompositeSkillExportResult>;
39
+ /**
40
+ * 静态辅助调用复合导出方法。
41
+ */
42
+ static exportComposite(options: CompositeSkillExportOptions): Promise<CompositeSkillExportResult>;
43
+ /**
44
+ * 静态辅助调用方法。
45
+ */
46
+ static export(options: SkillExporterOptions): Promise<SkillExportResult>;
47
+ }
48
+ /**
49
+ * 快捷导出 Skill 产物函数。
50
+ */
51
+ export declare function exportSkill(options: SkillExporterOptions): Promise<SkillExportResult>;
52
+ /**
53
+ * 快捷批量导出多个 Skill 产物函数。
54
+ */
55
+ export declare function exportSkillBatch(options: BatchSkillExportOptions): Promise<BatchSkillExportResult>;
56
+ /**
57
+ * 快捷复合模式导出 Skill 产物函数。
58
+ */
59
+ export declare function exportCompositeSkill(options: CompositeSkillExportOptions): Promise<CompositeSkillExportResult>;
@@ -4,3 +4,4 @@ export * from "./build";
4
4
  export * from "./planner";
5
5
  export * from "./compiler";
6
6
  export * from "./exporter";
7
+ export * from "./archive";