@actiondock/core 2.0.12 → 2.2.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.
- package/README.md +61 -30
- package/dist/app/app.d.ts +73 -0
- package/dist/app/app.js +700 -0
- package/dist/app/index.d.ts +2 -0
- package/dist/app/index.js +2 -0
- package/dist/app/types.d.ts +283 -0
- package/dist/app/types.js +1 -0
- package/dist/catalog/action-index.d.ts +1 -1
- package/dist/catalog/action-index.js +93 -0
- package/dist/catalog/action-resolver.d.ts +2 -2
- package/dist/catalog/action-resolver.js +95 -0
- package/dist/catalog/index.d.ts +5 -5
- package/dist/catalog/index.js +5 -0
- package/dist/catalog/location-registry.d.ts +5 -5
- package/dist/catalog/location-registry.js +138 -0
- package/dist/catalog/package-catalog.d.ts +2 -2
- package/dist/catalog/package-catalog.js +76 -0
- package/dist/catalog/types.d.ts +2 -2
- package/dist/catalog/types.js +1 -0
- package/dist/doctor/doctor.d.ts +2 -1
- package/dist/doctor/doctor.js +613 -0
- package/dist/doctor/index.d.ts +2 -2
- package/dist/doctor/index.js +2 -0
- package/dist/doctor/types.js +1 -0
- package/dist/errors.d.ts +122 -0
- package/dist/errors.js +123 -0
- package/dist/execution/index.d.ts +2 -2
- package/dist/execution/index.js +2 -0
- package/dist/execution/service.d.ts +46 -41
- package/dist/execution/service.js +633 -0
- package/dist/execution/types.d.ts +59 -2
- package/dist/execution/types.js +1 -0
- package/dist/export/index.d.ts +1 -1
- package/dist/export/index.js +1 -0
- package/dist/export/templates.d.ts +45 -7
- package/dist/export/templates.js +631 -0
- package/dist/filter/index.d.ts +1 -1
- package/dist/filter/index.js +1 -0
- package/dist/filter/intent.js +123 -0
- package/dist/host/host.d.ts +55 -0
- package/dist/host/host.js +740 -0
- package/dist/host/index.d.ts +2 -0
- package/dist/host/index.js +2 -0
- package/dist/host/types.d.ts +81 -0
- package/dist/host/types.js +1 -0
- package/dist/index.d.ts +21 -16
- package/dist/index.js +20 -8458
- package/dist/ipc/diagnostic.d.ts +65 -0
- package/dist/ipc/diagnostic.js +129 -0
- package/dist/ipc/host.d.ts +7 -0
- package/dist/ipc/host.js +93 -0
- package/dist/ipc/index.d.ts +4 -0
- package/dist/ipc/index.js +4 -0
- package/dist/ipc/target.d.ts +56 -0
- package/dist/ipc/target.js +297 -0
- package/dist/ipc/types.d.ts +42 -0
- package/dist/ipc/types.js +1 -0
- package/dist/platform/default.d.ts +32 -0
- package/dist/platform/default.js +40 -0
- package/dist/platform/index.d.ts +3 -0
- package/dist/platform/index.js +3 -0
- package/dist/platform/node-fs.d.ts +37 -0
- package/dist/platform/node-fs.js +81 -0
- package/dist/platform/types.d.ts +104 -0
- package/dist/platform/types.js +1 -0
- package/dist/profile/client.d.ts +58 -12
- package/dist/profile/client.js +467 -0
- package/dist/profile/index.d.ts +3 -3
- package/dist/profile/index.js +3 -0
- package/dist/profile/manager.d.ts +2 -2
- package/dist/profile/manager.js +294 -0
- package/dist/profile/types.d.ts +1 -1
- package/dist/profile/types.js +1 -0
- package/dist/project/closure.js +68 -0
- package/dist/project/digest.d.ts +29 -0
- package/dist/project/digest.js +324 -0
- package/dist/project/index.d.ts +10 -5
- package/dist/project/index.js +10 -0
- package/dist/project/init.d.ts +3 -4
- package/dist/project/init.js +175 -0
- package/dist/project/loader.d.ts +21 -27
- package/dist/project/loader.js +484 -0
- package/dist/project/lockfile.d.ts +55 -0
- package/dist/project/lockfile.js +175 -0
- package/dist/project/manifest.d.ts +6 -28
- package/dist/project/manifest.js +220 -0
- package/dist/project/resolver.d.ts +116 -0
- package/dist/project/resolver.js +376 -0
- package/dist/project/transactions.d.ts +103 -0
- package/dist/project/transactions.js +1203 -0
- package/dist/project/types-generator.d.ts +33 -0
- package/dist/project/types-generator.js +168 -0
- package/dist/project/types.d.ts +58 -82
- package/dist/project/types.js +1 -0
- package/dist/registry/index.d.ts +5 -2
- package/dist/registry/index.js +5 -0
- package/dist/registry/lock.d.ts +27 -0
- package/dist/registry/lock.js +93 -0
- package/dist/registry/registry.d.ts +32 -11
- package/dist/registry/registry.js +611 -0
- package/dist/registry/resolve.d.ts +62 -0
- package/dist/registry/resolve.js +195 -0
- package/dist/registry/scan.d.ts +38 -0
- package/dist/registry/scan.js +135 -0
- package/dist/registry/types.d.ts +1 -1
- package/dist/registry/types.js +1 -0
- package/dist/runtime/action-collection.d.ts +27 -0
- package/dist/runtime/action-collection.js +57 -0
- package/dist/runtime/clock.d.ts +0 -2
- package/dist/runtime/clock.js +17 -0
- package/dist/runtime/context.d.ts +16 -5
- package/dist/runtime/context.js +242 -0
- package/dist/runtime/env.d.ts +3 -1
- package/dist/runtime/env.js +159 -0
- package/dist/runtime/events.d.ts +46 -14
- package/dist/runtime/events.js +604 -0
- package/dist/runtime/execution-manager.d.ts +1 -1
- package/dist/runtime/execution-manager.js +66 -0
- package/dist/runtime/index.d.ts +10 -9
- package/dist/runtime/index.js +10 -0
- package/dist/runtime/module-loader.d.ts +0 -8
- package/dist/runtime/module-loader.js +16 -0
- package/dist/runtime/process.d.ts +2 -4
- package/dist/runtime/process.js +146 -0
- package/dist/runtime/runner.d.ts +117 -10
- package/dist/runtime/runner.js +984 -0
- package/dist/runtime/standalone.d.ts +68 -19
- package/dist/runtime/standalone.js +536 -0
- package/dist/schema/validator.js +122 -0
- package/dist/server/body.js +93 -0
- package/dist/server/index.d.ts +5 -6
- package/dist/server/index.js +5 -0
- package/dist/server/routes/actions.d.ts +2 -2
- package/dist/server/routes/actions.js +298 -0
- package/dist/server/routes/common.d.ts +28 -17
- package/dist/server/routes/common.js +104 -0
- package/dist/server/routes/config.d.ts +2 -1
- package/dist/server/routes/config.js +173 -0
- package/dist/server/routes/doctor.d.ts +2 -2
- package/dist/server/routes/doctor.js +63 -0
- package/dist/server/routes/health.d.ts +2 -2
- package/dist/server/routes/health.js +35 -0
- package/dist/server/routes/index.d.ts +9 -9
- package/dist/server/routes/index.js +9 -0
- package/dist/server/routes/info.d.ts +4 -2
- package/dist/server/routes/info.js +158 -0
- package/dist/server/routes/playbooks.d.ts +2 -2
- package/dist/server/routes/playbooks.js +134 -0
- package/dist/server/routes/runs.d.ts +2 -2
- package/dist/server/routes/runs.js +343 -0
- package/dist/server/routes/state.d.ts +2 -1
- package/dist/server/routes/state.js +169 -0
- package/dist/server/security.d.ts +11 -4
- package/dist/server/security.js +101 -0
- package/dist/server/server.d.ts +6 -6
- package/dist/server/server.js +355 -0
- package/dist/server/types.d.ts +27 -8
- package/dist/server/types.js +1 -0
- package/dist/storage/data-dir-lock.d.ts +119 -0
- package/dist/storage/data-dir-lock.js +1016 -0
- package/dist/storage/driver.d.ts +4 -10
- package/dist/storage/driver.js +59 -0
- package/dist/storage/index.d.ts +30 -10
- package/dist/storage/index.js +98 -0
- package/dist/storage/lazy.d.ts +8 -0
- package/dist/storage/lazy.js +44 -0
- package/dist/storage/mask.d.ts +12 -5
- package/dist/storage/mask.js +48 -0
- package/dist/storage/params.d.ts +13 -0
- package/dist/storage/params.js +32 -0
- package/dist/storage/sqlite.d.ts +19 -6
- package/dist/storage/sqlite.js +689 -0
- package/dist/storage/types.d.ts +57 -6
- package/dist/storage/types.js +14 -0
- package/dist/target/index.d.ts +4 -0
- package/dist/target/index.js +4 -0
- package/dist/target/local.d.ts +52 -0
- package/dist/target/local.js +343 -0
- package/dist/target/remote.d.ts +76 -0
- package/dist/target/remote.js +839 -0
- package/dist/target/target.d.ts +6 -0
- package/dist/target/target.js +35 -0
- package/dist/target/types.d.ts +246 -0
- package/dist/target/types.js +34 -0
- package/dist/utils/index.d.ts +22 -2
- package/dist/utils/index.js +180 -0
- package/dist/version.d.ts +1 -1
- package/dist/version.js +4 -0
- package/package.json +6 -7
- package/dist/build/index.d.ts +0 -1
- package/dist/build/templates.d.ts +0 -19
- package/dist/server/runtime-registry.d.ts +0 -78
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
import type { ActionRef, ExecutionEvent, ExecutionResult, JsonValue, Logger, ProcessAPI, RunRecord } from "@actiondock/sdk";
|
|
2
|
+
import type { ActionDockApp, ActionDockAppOptions, ActionSpec, ActionSummary, ListActionsOptions, PackageInfo, PlaybookSpec, PlaybookSummary } from "../app/types.js";
|
|
3
|
+
import type { CancelResult, ExecuteOptions, ExecutionTicket } from "../execution/types.js";
|
|
4
|
+
import type { Clock } from "../runtime/clock.js";
|
|
5
|
+
import type { EventSink } from "../runtime/events.js";
|
|
6
|
+
import type { RuntimePlatform } from "../platform/types.js";
|
|
7
|
+
/**
|
|
8
|
+
* ActionDock 宿主容器初始化配置选项。
|
|
9
|
+
*/
|
|
10
|
+
export interface ActionDockHostOptions {
|
|
11
|
+
/** 显式预注册的包列表(现成 ActionDockApp 实例或 ActionDockAppOptions 配置)。外部传入的 App 属于借用(borrowed),生命周期完全由调用方负责管理,Host 关闭或初始化失败时仅解绑引用并清理自身内部实例,严禁关闭外部借用的 App 实例。 */
|
|
12
|
+
packages?: Array<ActionDockApp | ActionDockAppOptions>;
|
|
13
|
+
/** 当前工程根目录绝对物理路径 */
|
|
14
|
+
projectRoot?: string;
|
|
15
|
+
/** 是否自动加载当前工程(默认为 true) */
|
|
16
|
+
autoLoadCurrentProject?: boolean;
|
|
17
|
+
/** 是否扫描已软链接的外部包(通过 listLinkedPackages,默认为 false) */
|
|
18
|
+
scanLinkedPackages?: boolean;
|
|
19
|
+
/** 显式注入的运行时平台适配 */
|
|
20
|
+
platform?: RuntimePlatform;
|
|
21
|
+
/** 全局最大并发活跃运行数 */
|
|
22
|
+
maxActiveRuns?: number;
|
|
23
|
+
/** 全局调用嵌套深度限制(默认 16) */
|
|
24
|
+
maxCallDepth?: number;
|
|
25
|
+
/** 全局子任务数限制(默认 64) */
|
|
26
|
+
maxSubRuns?: number;
|
|
27
|
+
/** 日志记录器 */
|
|
28
|
+
logger?: Logger;
|
|
29
|
+
/** 时钟源 */
|
|
30
|
+
clock?: Clock;
|
|
31
|
+
/** 进程执行器 */
|
|
32
|
+
process?: ProcessAPI;
|
|
33
|
+
/** 数据持久化存储目录 */
|
|
34
|
+
dataDir?: string;
|
|
35
|
+
/** 自定义 ActionDock 家目录 */
|
|
36
|
+
customHome?: string;
|
|
37
|
+
/** 是否采用纯内存运行模式 */
|
|
38
|
+
inMemory?: boolean;
|
|
39
|
+
/** 事件接收器 */
|
|
40
|
+
eventSink?: EventSink;
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* ActionDock 多包宿主容器领域契约。
|
|
44
|
+
* 作为多包环境下的全局协调中枢,负责多包生命周期、完全限定引用路由、依赖校验与配额管理。
|
|
45
|
+
*/
|
|
46
|
+
export interface ActionDockHost {
|
|
47
|
+
/** 获取所有已注册包的元数据信息列表 */
|
|
48
|
+
info(): Promise<PackageInfo[]>;
|
|
49
|
+
/** 静态列出所有已注册包中可用的 Action 摘要 */
|
|
50
|
+
listActions(options?: ListActionsOptions): Promise<ActionSummary[]>;
|
|
51
|
+
/** 静态查询并返回指定 Action 的规范结构与模式定义 */
|
|
52
|
+
describeAction(ref: ActionRef | string): Promise<ActionSpec>;
|
|
53
|
+
/** 静态列出所有已注册包中可用的 Playbook 规程摘要 */
|
|
54
|
+
listPlaybooks(): Promise<PlaybookSummary[]>;
|
|
55
|
+
/** 静态查询并返回指定 Playbook 的规范内容与操作指南 */
|
|
56
|
+
describePlaybook(id: string): Promise<PlaybookSpec>;
|
|
57
|
+
/** 同步执行指定 Action 并等待终态结果 */
|
|
58
|
+
runAction(ref: ActionRef | string, input: JsonValue, options?: ExecuteOptions): Promise<ExecutionResult>;
|
|
59
|
+
/** 异步启动指定 Action 并立即返回任务执行票据 */
|
|
60
|
+
startAction(ref: ActionRef | string, input: JsonValue, options?: ExecuteOptions): Promise<ExecutionTicket>;
|
|
61
|
+
/** 查询指定运行标识的记录详情 */
|
|
62
|
+
getRun(runId: string): Promise<RunRecord | undefined>;
|
|
63
|
+
/** 取消指定在运行的任务 */
|
|
64
|
+
cancelRun(runId: string, reason?: string): Promise<CancelResult>;
|
|
65
|
+
/** 订阅指定运行的事件流 */
|
|
66
|
+
events(runId: string, options?: {
|
|
67
|
+
after?: number | string;
|
|
68
|
+
signal?: AbortSignal;
|
|
69
|
+
maxQueueSize?: number;
|
|
70
|
+
}): AsyncIterable<ExecutionEvent>;
|
|
71
|
+
/** 根据包唯一标识获取指定 App 实例 */
|
|
72
|
+
getApp(packageId: string): ActionDockApp | undefined;
|
|
73
|
+
/** 获取所有当前已注册的 App 实例列表 */
|
|
74
|
+
listApps(): ActionDockApp[];
|
|
75
|
+
/** 注册新的 App 实例至当前宿主容器 */
|
|
76
|
+
registerApp(app: ActionDockApp): void;
|
|
77
|
+
/** 优雅关闭宿主容器。仅对内部创建的 App 实例执行 close 并安全释放底层资源;外部传入借用的 App 实例生命周期完全由调用方负责管理,Host 关闭时仅解绑引用并清理自身内部实例。 */
|
|
78
|
+
close(options?: {
|
|
79
|
+
graceMs?: number;
|
|
80
|
+
}): Promise<void>;
|
|
81
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/dist/index.d.ts
CHANGED
|
@@ -1,16 +1,21 @@
|
|
|
1
|
-
export * from "./
|
|
2
|
-
export * from "./
|
|
3
|
-
export * from "./
|
|
4
|
-
export * from "./execution";
|
|
5
|
-
export * from "./export";
|
|
6
|
-
export * from "./filter";
|
|
7
|
-
export * from "./
|
|
8
|
-
export * from "./
|
|
9
|
-
export * from "./
|
|
10
|
-
export * from "./
|
|
11
|
-
export * from "./
|
|
12
|
-
export * from "./
|
|
13
|
-
export * from "./
|
|
14
|
-
export * from "./
|
|
15
|
-
export * from "./
|
|
16
|
-
export
|
|
1
|
+
export * from "./catalog/index.js";
|
|
2
|
+
export * from "./doctor/index.js";
|
|
3
|
+
export * from "./errors.js";
|
|
4
|
+
export * from "./execution/index.js";
|
|
5
|
+
export * from "./export/index.js";
|
|
6
|
+
export * from "./filter/index.js";
|
|
7
|
+
export * from "./platform/index.js";
|
|
8
|
+
export * from "./profile/index.js";
|
|
9
|
+
export * from "./project/index.js";
|
|
10
|
+
export * from "./registry/index.js";
|
|
11
|
+
export * from "./runtime/index.js";
|
|
12
|
+
export * from "./schema/validator.js";
|
|
13
|
+
export * from "./server/index.js";
|
|
14
|
+
export * from "./storage/index.js";
|
|
15
|
+
export * from "./utils/index.js";
|
|
16
|
+
export * from "./version.js";
|
|
17
|
+
export * from "./app/index.js";
|
|
18
|
+
export * from "./host/index.js";
|
|
19
|
+
export * from "./target/index.js";
|
|
20
|
+
export * from "./ipc/index.js";
|
|
21
|
+
export type { ModuleLoader } from "./runtime/index.js";
|