@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,76 @@
|
|
|
1
|
+
import { existsSync, realpathSync } from "node:fs";
|
|
2
|
+
import { randomUUID } from "node:crypto";
|
|
3
|
+
import { resolve } from "node:path";
|
|
4
|
+
import { findProjectRoot, loadProjectConfig } from "../project/loader.js";
|
|
5
|
+
import { discoverProjects } from "../registry/registry.js";
|
|
6
|
+
import { LocationRegistry } from "./location-registry.js";
|
|
7
|
+
export class PackageCatalog {
|
|
8
|
+
registry;
|
|
9
|
+
constructor(registry) {
|
|
10
|
+
this.registry = registry || new LocationRegistry();
|
|
11
|
+
}
|
|
12
|
+
buildSnapshot(cwd = process.cwd()) {
|
|
13
|
+
const packages = new Map();
|
|
14
|
+
const seenRealPaths = new Map(); // realPath -> packageId
|
|
15
|
+
const seenPackageIds = new Map(); // packageId -> realPath
|
|
16
|
+
const registerPackage = (root, isChild = false) => {
|
|
17
|
+
const abs = resolve(root);
|
|
18
|
+
if (!existsSync(abs))
|
|
19
|
+
return;
|
|
20
|
+
const real = realpathSync(abs);
|
|
21
|
+
if (seenRealPaths.has(real)) {
|
|
22
|
+
return; // 符号链接归一化去重
|
|
23
|
+
}
|
|
24
|
+
try {
|
|
25
|
+
const config = loadProjectConfig(abs);
|
|
26
|
+
if (seenPackageIds.has(config.id)) {
|
|
27
|
+
const existingPath = seenPackageIds.get(config.id);
|
|
28
|
+
if (existingPath !== real) {
|
|
29
|
+
throw new Error(`PACKAGE_ID_CONFLICT: Package ID '${config.id}' is declared by multiple directories: '${existingPath}' and '${real}'`);
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
const entry = {
|
|
33
|
+
id: config.id,
|
|
34
|
+
packageInstanceId: `${config.id}:${real}`,
|
|
35
|
+
projectRoot: abs,
|
|
36
|
+
config,
|
|
37
|
+
isWorkspaceChild: isChild,
|
|
38
|
+
};
|
|
39
|
+
packages.set(config.id, entry);
|
|
40
|
+
seenRealPaths.set(real, config.id);
|
|
41
|
+
seenPackageIds.set(config.id, real);
|
|
42
|
+
}
|
|
43
|
+
catch (e) {
|
|
44
|
+
if (e.message?.startsWith("PACKAGE_ID_CONFLICT")) {
|
|
45
|
+
throw e;
|
|
46
|
+
}
|
|
47
|
+
// 忽略无效项目
|
|
48
|
+
}
|
|
49
|
+
};
|
|
50
|
+
// 优先包含当前工作目录所在项目
|
|
51
|
+
const currentRoot = findProjectRoot(cwd);
|
|
52
|
+
if (currentRoot) {
|
|
53
|
+
registerPackage(currentRoot);
|
|
54
|
+
}
|
|
55
|
+
// 扫描注册表中的位置
|
|
56
|
+
const regData = this.registry.load();
|
|
57
|
+
for (const link of regData.links) {
|
|
58
|
+
if (!existsSync(link.path))
|
|
59
|
+
continue;
|
|
60
|
+
if (link.type === "package") {
|
|
61
|
+
registerPackage(link.path);
|
|
62
|
+
}
|
|
63
|
+
else if (link.type === "workspace") {
|
|
64
|
+
const subprojects = discoverProjects(link.path, link.depth ?? 3);
|
|
65
|
+
for (const sub of subprojects) {
|
|
66
|
+
registerPackage(sub, true);
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
return {
|
|
71
|
+
generationId: randomUUID(),
|
|
72
|
+
createdAt: new Date().toISOString(),
|
|
73
|
+
packages,
|
|
74
|
+
};
|
|
75
|
+
}
|
|
76
|
+
}
|
package/dist/catalog/types.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { ActionContract } from "@actiondock/sdk";
|
|
2
|
-
import type { ProjectConfig } from "../project/types";
|
|
2
|
+
import type { ProjectConfig } from "../project/types.js";
|
|
3
3
|
/**
|
|
4
4
|
* 注册的位置条目类型。
|
|
5
5
|
*/
|
|
@@ -65,4 +65,4 @@ export interface IndexedAction {
|
|
|
65
65
|
/** 包根目录绝对路径 */
|
|
66
66
|
projectRoot: string;
|
|
67
67
|
}
|
|
68
|
-
export type { ModuleLoader } from "../runtime/module-loader";
|
|
68
|
+
export type { ModuleLoader } from "../runtime/module-loader.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/dist/doctor/doctor.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import type { DoctorReport } from "./types";
|
|
1
|
+
import type { DoctorReport } from "./types.js";
|
|
2
2
|
export declare function runDoctorChecks(options?: {
|
|
3
3
|
cwd?: string;
|
|
4
4
|
packageIdOrPath?: string;
|
|
5
5
|
customHome?: string;
|
|
6
|
+
packageAllowlist?: string[];
|
|
6
7
|
}): Promise<DoctorReport>;
|