@actiondock/core 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.
- package/dist/build/templates.d.ts +19 -0
- package/dist/catalog/action-index.d.ts +9 -0
- package/dist/catalog/action-resolver.d.ts +20 -0
- package/dist/catalog/location-registry.d.ts +15 -0
- package/dist/catalog/package-catalog.d.ts +7 -0
- package/dist/catalog/types.d.ts +68 -0
- package/dist/doctor/doctor.d.ts +6 -0
- package/dist/doctor/types.d.ts +23 -0
- package/dist/execution/index.d.ts +2 -0
- package/dist/execution/service.d.ts +74 -0
- package/dist/execution/types.d.ts +74 -0
- package/dist/export/templates.d.ts +33 -0
- package/dist/filter/intent.d.ts +33 -0
- package/{src/index.ts → dist/index.d.ts} +1 -1
- package/dist/index.js +8458 -0
- package/dist/profile/client.d.ts +116 -0
- package/dist/profile/manager.d.ts +47 -0
- package/dist/profile/types.d.ts +61 -0
- package/dist/project/closure.d.ts +25 -0
- package/{src/project/index.ts → dist/project/index.d.ts} +1 -0
- package/dist/project/init.d.ts +27 -0
- package/dist/project/loader.d.ts +105 -0
- package/dist/project/manifest.d.ts +44 -0
- package/dist/project/types.d.ts +131 -0
- package/dist/registry/registry.d.ts +24 -0
- package/dist/registry/types.d.ts +117 -0
- package/dist/runtime/clock.d.ts +21 -0
- package/dist/runtime/context.d.ts +75 -0
- package/dist/runtime/env.d.ts +54 -0
- package/dist/runtime/events.d.ts +61 -0
- package/dist/runtime/execution-manager.d.ts +48 -0
- package/{src/runtime/index.ts → dist/runtime/index.d.ts} +0 -1
- package/dist/runtime/module-loader.d.ts +42 -0
- package/dist/runtime/process.d.ts +11 -0
- package/dist/runtime/runner.d.ts +186 -0
- package/dist/runtime/standalone.d.ts +40 -0
- package/dist/schema/validator.d.ts +28 -0
- package/dist/server/body.d.ts +40 -0
- package/{src/server/index.ts → dist/server/index.d.ts} +0 -1
- package/dist/server/routes/actions.d.ts +5 -0
- package/dist/server/routes/common.d.ts +36 -0
- package/dist/server/routes/config.d.ts +5 -0
- package/dist/server/routes/doctor.d.ts +5 -0
- package/dist/server/routes/health.d.ts +5 -0
- package/dist/server/routes/info.d.ts +5 -0
- package/dist/server/routes/playbooks.d.ts +5 -0
- package/dist/server/routes/runs.d.ts +5 -0
- package/dist/server/routes/state.d.ts +5 -0
- package/dist/server/runtime-registry.d.ts +78 -0
- package/dist/server/security.d.ts +37 -0
- package/dist/server/server.d.ts +15 -0
- package/dist/server/types.d.ts +59 -0
- package/dist/storage/driver.d.ts +15 -0
- package/dist/storage/index.d.ts +44 -0
- package/{src/storage/mask.ts → dist/storage/mask.d.ts} +5 -20
- package/dist/storage/sqlite.d.ts +66 -0
- package/dist/storage/types.d.ts +121 -0
- package/dist/utils/index.d.ts +29 -0
- package/dist/version.d.ts +4 -0
- package/package.json +11 -10
- package/src/build/templates.ts +0 -59
- package/src/catalog/action-index.ts +0 -92
- package/src/catalog/action-resolver.ts +0 -120
- package/src/catalog/location-registry.ts +0 -134
- package/src/catalog/package-catalog.ts +0 -87
- package/src/catalog/types.ts +0 -75
- package/src/doctor/doctor.ts +0 -419
- package/src/doctor/types.ts +0 -25
- package/src/execution/index.ts +0 -2
- package/src/execution/service.ts +0 -322
- package/src/execution/types.ts +0 -73
- package/src/export/templates.ts +0 -590
- package/src/filter/intent.ts +0 -154
- package/src/profile/client.ts +0 -552
- package/src/profile/manager.ts +0 -341
- package/src/profile/types.ts +0 -71
- package/src/project/init.ts +0 -242
- package/src/project/loader.ts +0 -479
- package/src/project/manifest.ts +0 -299
- package/src/project/types.ts +0 -141
- package/src/registry/registry.ts +0 -940
- package/src/registry/types.ts +0 -127
- package/src/runtime/clock.ts +0 -41
- package/src/runtime/context.ts +0 -259
- package/src/runtime/env.ts +0 -172
- package/src/runtime/events.ts +0 -142
- package/src/runtime/execution-manager.ts +0 -74
- package/src/runtime/module-loader.ts +0 -67
- package/src/runtime/process.ts +0 -245
- package/src/runtime/runner.ts +0 -527
- package/src/runtime/standalone.ts +0 -429
- package/src/schema/validator.ts +0 -61
- package/src/server/body.ts +0 -112
- package/src/server/routes/actions.ts +0 -262
- package/src/server/routes/common.ts +0 -126
- package/src/server/routes/config.ts +0 -147
- package/src/server/routes/doctor.ts +0 -29
- package/src/server/routes/health.ts +0 -40
- package/src/server/routes/info.ts +0 -221
- package/src/server/routes/playbooks.ts +0 -109
- package/src/server/routes/runs.ts +0 -301
- package/src/server/routes/state.ts +0 -133
- package/src/server/runtime-registry.ts +0 -115
- package/src/server/security.ts +0 -115
- package/src/server/server.ts +0 -251
- package/src/server/types.ts +0 -57
- package/src/storage/driver.ts +0 -126
- package/src/storage/index.ts +0 -81
- package/src/storage/sqlite.ts +0 -714
- package/src/storage/types.ts +0 -139
- package/src/utils/index.ts +0 -62
- /package/{src/build/index.ts → dist/build/index.d.ts} +0 -0
- /package/{src/catalog/index.ts → dist/catalog/index.d.ts} +0 -0
- /package/{src/doctor/index.ts → dist/doctor/index.d.ts} +0 -0
- /package/{src/export/index.ts → dist/export/index.d.ts} +0 -0
- /package/{src/filter/index.ts → dist/filter/index.d.ts} +0 -0
- /package/{src/profile/index.ts → dist/profile/index.d.ts} +0 -0
- /package/{src/registry/index.ts → dist/registry/index.d.ts} +0 -0
- /package/{src/server/routes/index.ts → dist/server/routes/index.d.ts} +0 -0
package/src/project/manifest.ts
DELETED
|
@@ -1,299 +0,0 @@
|
|
|
1
|
-
import { existsSync, readFileSync, writeFileSync } from "node:fs";
|
|
2
|
-
import { join, relative } from "node:path";
|
|
3
|
-
import { loadActionFileMap, loadProjectConfig } from "./loader";
|
|
4
|
-
import type {
|
|
5
|
-
ActionDockManifest,
|
|
6
|
-
ActionManifestEntry,
|
|
7
|
-
ManifestSyncChange,
|
|
8
|
-
ManifestSyncResult,
|
|
9
|
-
SyncManifestOptions,
|
|
10
|
-
} from "./types";
|
|
11
|
-
|
|
12
|
-
export const MANIFEST_FILE_NAME = "actiondock.manifest.json";
|
|
13
|
-
|
|
14
|
-
function deepEqual(a: unknown, b: unknown): boolean {
|
|
15
|
-
if (a === b) return true;
|
|
16
|
-
if (a == null || b == null) return a === b;
|
|
17
|
-
if (typeof a !== "object" || typeof b !== "object") return false;
|
|
18
|
-
if (Array.isArray(a) !== Array.isArray(b)) return false;
|
|
19
|
-
if (Array.isArray(a)) {
|
|
20
|
-
const arrB = b as unknown[];
|
|
21
|
-
if (a.length !== arrB.length) return false;
|
|
22
|
-
for (let i = 0; i < a.length; i++) {
|
|
23
|
-
if (!deepEqual(a[i], arrB[i])) return false;
|
|
24
|
-
}
|
|
25
|
-
return true;
|
|
26
|
-
}
|
|
27
|
-
const keysA = Object.keys(a as Record<string, unknown>);
|
|
28
|
-
const keysB = Object.keys(b as Record<string, unknown>);
|
|
29
|
-
if (keysA.length !== keysB.length) return false;
|
|
30
|
-
for (const k of keysA) {
|
|
31
|
-
if (!Object.prototype.hasOwnProperty.call(b, k)) return false;
|
|
32
|
-
if (!deepEqual((a as Record<string, unknown>)[k], (b as Record<string, unknown>)[k])) return false;
|
|
33
|
-
}
|
|
34
|
-
return true;
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
/**
|
|
38
|
-
* 读取并解析项目的声明式清单文件。
|
|
39
|
-
* 若文件不存在则返回 null。
|
|
40
|
-
*/
|
|
41
|
-
export function loadManifest(projectRoot: string): ActionDockManifest | null {
|
|
42
|
-
const filePath = join(projectRoot, MANIFEST_FILE_NAME);
|
|
43
|
-
if (!existsSync(filePath)) {
|
|
44
|
-
return null;
|
|
45
|
-
}
|
|
46
|
-
try {
|
|
47
|
-
const raw = readFileSync(filePath, "utf-8");
|
|
48
|
-
const parsed = JSON.parse(raw) as ActionDockManifest;
|
|
49
|
-
if (!parsed || typeof parsed !== "object" || parsed.schemaVersion !== 1) {
|
|
50
|
-
return null;
|
|
51
|
-
}
|
|
52
|
-
return parsed;
|
|
53
|
-
} catch {
|
|
54
|
-
return null;
|
|
55
|
-
}
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
/**
|
|
59
|
-
* 保存声明式清单文件至项目根目录。
|
|
60
|
-
*/
|
|
61
|
-
export function saveManifest(projectRoot: string, manifest: ActionDockManifest): void {
|
|
62
|
-
const filePath = join(projectRoot, MANIFEST_FILE_NAME);
|
|
63
|
-
writeFileSync(filePath, JSON.stringify(manifest, null, 2) + "\n", "utf-8");
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
/**
|
|
67
|
-
* 校验清单数据结构的合法性。
|
|
68
|
-
*/
|
|
69
|
-
export function validateManifest(manifest: unknown): { valid: boolean; errors?: string[] } {
|
|
70
|
-
if (!manifest || typeof manifest !== "object") {
|
|
71
|
-
return { valid: false, errors: ["Manifest must be an object"] };
|
|
72
|
-
}
|
|
73
|
-
const m = manifest as ActionDockManifest;
|
|
74
|
-
const errors: string[] = [];
|
|
75
|
-
|
|
76
|
-
if (m.schemaVersion !== 1) {
|
|
77
|
-
errors.push("Manifest 'schemaVersion' must be 1");
|
|
78
|
-
}
|
|
79
|
-
if (!m.actions || typeof m.actions !== "object") {
|
|
80
|
-
errors.push("Manifest 'actions' must be an object");
|
|
81
|
-
} else {
|
|
82
|
-
for (const [actionId, item] of Object.entries(m.actions)) {
|
|
83
|
-
if (!item || typeof item !== "object") {
|
|
84
|
-
errors.push(`Action entry '${actionId}' must be an object`);
|
|
85
|
-
continue;
|
|
86
|
-
}
|
|
87
|
-
if (!item.entry || typeof item.entry !== "string") {
|
|
88
|
-
errors.push(`Action '${actionId}' must specify string 'entry'`);
|
|
89
|
-
}
|
|
90
|
-
if (item.uses && !Array.isArray(item.uses)) {
|
|
91
|
-
errors.push(`Action '${actionId}' property 'uses' must be an array`);
|
|
92
|
-
}
|
|
93
|
-
if (item.tags && !Array.isArray(item.tags)) {
|
|
94
|
-
errors.push(`Action '${actionId}' property 'tags' must be an array`);
|
|
95
|
-
}
|
|
96
|
-
}
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
return {
|
|
100
|
-
valid: errors.length === 0,
|
|
101
|
-
errors: errors.length > 0 ? errors : undefined,
|
|
102
|
-
};
|
|
103
|
-
}
|
|
104
|
-
|
|
105
|
-
/**
|
|
106
|
-
* 为单个 Action 构建清单项。
|
|
107
|
-
*/
|
|
108
|
-
export function createManifestEntry(options: {
|
|
109
|
-
entry: string;
|
|
110
|
-
description?: string;
|
|
111
|
-
inputSchema?: Record<string, unknown> | boolean;
|
|
112
|
-
outputSchema?: Record<string, unknown> | boolean;
|
|
113
|
-
uses?: string[];
|
|
114
|
-
tags?: string[];
|
|
115
|
-
annotations?: Record<string, unknown>;
|
|
116
|
-
}): ActionManifestEntry {
|
|
117
|
-
return {
|
|
118
|
-
entry: options.entry,
|
|
119
|
-
description: options.description,
|
|
120
|
-
inputSchema: options.inputSchema,
|
|
121
|
-
outputSchema: options.outputSchema,
|
|
122
|
-
uses: options.uses || [],
|
|
123
|
-
tags: options.tags || [],
|
|
124
|
-
annotations: options.annotations,
|
|
125
|
-
};
|
|
126
|
-
}
|
|
127
|
-
|
|
128
|
-
/**
|
|
129
|
-
* 依据动作源码目录中的 Action 定义,增量同步或校验 actiondock.manifest.json 文件。
|
|
130
|
-
*
|
|
131
|
-
* @param projectRoot 项目根目录绝对路径
|
|
132
|
-
* @param options 同步选项(包括 actionsDir、check、prune、autoInstall)
|
|
133
|
-
* @returns 同步变更结果报告
|
|
134
|
-
*/
|
|
135
|
-
export async function syncManifest(
|
|
136
|
-
projectRoot: string,
|
|
137
|
-
options: SyncManifestOptions = {}
|
|
138
|
-
): Promise<ManifestSyncResult> {
|
|
139
|
-
const manifestPath = join(projectRoot, MANIFEST_FILE_NAME);
|
|
140
|
-
|
|
141
|
-
// 1. 确定 actions 目录
|
|
142
|
-
let actionsDir = options.actionsDir;
|
|
143
|
-
if (!actionsDir) {
|
|
144
|
-
try {
|
|
145
|
-
const config = loadProjectConfig(projectRoot);
|
|
146
|
-
actionsDir = config.actionsDir || "actions";
|
|
147
|
-
} catch {
|
|
148
|
-
actionsDir = "actions";
|
|
149
|
-
}
|
|
150
|
-
}
|
|
151
|
-
|
|
152
|
-
// 2. 加载现有清单,不存在则初始化基准结构
|
|
153
|
-
const existingManifest = loadManifest(projectRoot);
|
|
154
|
-
const manifest: ActionDockManifest = existingManifest
|
|
155
|
-
? {
|
|
156
|
-
schemaVersion: existingManifest.schemaVersion || 1,
|
|
157
|
-
actions: { ...existingManifest.actions },
|
|
158
|
-
assets: existingManifest.assets ? [...existingManifest.assets] : [],
|
|
159
|
-
}
|
|
160
|
-
: {
|
|
161
|
-
schemaVersion: 1,
|
|
162
|
-
actions: {},
|
|
163
|
-
assets: [],
|
|
164
|
-
};
|
|
165
|
-
|
|
166
|
-
// 3. 动态加载所有 Action 源码定义
|
|
167
|
-
const actionFileMap = await loadActionFileMap(projectRoot, actionsDir, {
|
|
168
|
-
autoInstall: options.autoInstall !== false,
|
|
169
|
-
strict: true,
|
|
170
|
-
});
|
|
171
|
-
|
|
172
|
-
const changes: ManifestSyncChange[] = [];
|
|
173
|
-
const added: string[] = [];
|
|
174
|
-
const updated: string[] = [];
|
|
175
|
-
const removed: string[] = [];
|
|
176
|
-
const unchanged: string[] = [];
|
|
177
|
-
|
|
178
|
-
const scannedActionIds = new Set<string>();
|
|
179
|
-
|
|
180
|
-
// 4. 比对源码中的每个 Action 与现有清单项
|
|
181
|
-
for (const [actionId, fileEntry] of actionFileMap.entries()) {
|
|
182
|
-
scannedActionIds.add(actionId);
|
|
183
|
-
const relEntry = relative(projectRoot, fileEntry.filePath).replace(/\\/g, "/");
|
|
184
|
-
const act = fileEntry.action;
|
|
185
|
-
|
|
186
|
-
const newManifestEntry: ActionManifestEntry = {
|
|
187
|
-
entry: relEntry,
|
|
188
|
-
description: act.description ?? "",
|
|
189
|
-
inputSchema: act.inputSchema ?? {},
|
|
190
|
-
outputSchema: act.outputSchema ?? {},
|
|
191
|
-
uses: Array.isArray(act.uses) ? [...act.uses] : [],
|
|
192
|
-
tags: Array.isArray(act.tags) ? [...act.tags] : [],
|
|
193
|
-
};
|
|
194
|
-
if (act.annotations && typeof act.annotations === "object") {
|
|
195
|
-
newManifestEntry.annotations = act.annotations;
|
|
196
|
-
}
|
|
197
|
-
|
|
198
|
-
const oldManifestEntry = manifest.actions[actionId];
|
|
199
|
-
|
|
200
|
-
if (!oldManifestEntry) {
|
|
201
|
-
changes.push({
|
|
202
|
-
actionId,
|
|
203
|
-
type: "added",
|
|
204
|
-
entry: relEntry,
|
|
205
|
-
});
|
|
206
|
-
added.push(actionId);
|
|
207
|
-
if (!options.check) {
|
|
208
|
-
manifest.actions[actionId] = newManifestEntry;
|
|
209
|
-
}
|
|
210
|
-
} else {
|
|
211
|
-
const changedFields: string[] = [];
|
|
212
|
-
|
|
213
|
-
if (oldManifestEntry.entry !== newManifestEntry.entry) {
|
|
214
|
-
changedFields.push("entry");
|
|
215
|
-
}
|
|
216
|
-
if ((oldManifestEntry.description ?? "") !== (newManifestEntry.description ?? "")) {
|
|
217
|
-
changedFields.push("description");
|
|
218
|
-
}
|
|
219
|
-
if (!deepEqual(oldManifestEntry.inputSchema ?? {}, newManifestEntry.inputSchema ?? {})) {
|
|
220
|
-
changedFields.push("inputSchema");
|
|
221
|
-
}
|
|
222
|
-
if (!deepEqual(oldManifestEntry.outputSchema ?? {}, newManifestEntry.outputSchema ?? {})) {
|
|
223
|
-
changedFields.push("outputSchema");
|
|
224
|
-
}
|
|
225
|
-
if (!deepEqual(oldManifestEntry.uses ?? [], newManifestEntry.uses ?? [])) {
|
|
226
|
-
changedFields.push("uses");
|
|
227
|
-
}
|
|
228
|
-
if (!deepEqual(oldManifestEntry.tags ?? [], newManifestEntry.tags ?? [])) {
|
|
229
|
-
changedFields.push("tags");
|
|
230
|
-
}
|
|
231
|
-
if (!deepEqual(oldManifestEntry.annotations ?? {}, newManifestEntry.annotations ?? {})) {
|
|
232
|
-
changedFields.push("annotations");
|
|
233
|
-
}
|
|
234
|
-
|
|
235
|
-
if (changedFields.length > 0) {
|
|
236
|
-
changes.push({
|
|
237
|
-
actionId,
|
|
238
|
-
type: "updated",
|
|
239
|
-
entry: relEntry,
|
|
240
|
-
changedFields,
|
|
241
|
-
});
|
|
242
|
-
updated.push(actionId);
|
|
243
|
-
if (!options.check) {
|
|
244
|
-
manifest.actions[actionId] = newManifestEntry;
|
|
245
|
-
}
|
|
246
|
-
} else {
|
|
247
|
-
changes.push({
|
|
248
|
-
actionId,
|
|
249
|
-
type: "unchanged",
|
|
250
|
-
entry: relEntry,
|
|
251
|
-
});
|
|
252
|
-
unchanged.push(actionId);
|
|
253
|
-
}
|
|
254
|
-
}
|
|
255
|
-
}
|
|
256
|
-
|
|
257
|
-
// 5. 检查清单中存在但源码中已不存在的废弃动作
|
|
258
|
-
for (const [actionId, item] of Object.entries(manifest.actions)) {
|
|
259
|
-
if (!scannedActionIds.has(actionId)) {
|
|
260
|
-
changes.push({
|
|
261
|
-
actionId,
|
|
262
|
-
type: "removed",
|
|
263
|
-
entry: item.entry,
|
|
264
|
-
});
|
|
265
|
-
removed.push(actionId);
|
|
266
|
-
if (!options.check && options.prune !== false) {
|
|
267
|
-
delete manifest.actions[actionId];
|
|
268
|
-
}
|
|
269
|
-
}
|
|
270
|
-
}
|
|
271
|
-
|
|
272
|
-
const inSync = added.length === 0 && updated.length === 0 && removed.length === 0;
|
|
273
|
-
|
|
274
|
-
// 6. 如果存在变更且非仅检查模式,保存清单文件
|
|
275
|
-
if (!options.check && !inSync) {
|
|
276
|
-
saveManifest(projectRoot, manifest);
|
|
277
|
-
}
|
|
278
|
-
|
|
279
|
-
return {
|
|
280
|
-
inSync,
|
|
281
|
-
manifestPath,
|
|
282
|
-
changes,
|
|
283
|
-
added,
|
|
284
|
-
updated,
|
|
285
|
-
removed,
|
|
286
|
-
unchanged,
|
|
287
|
-
};
|
|
288
|
-
}
|
|
289
|
-
|
|
290
|
-
/**
|
|
291
|
-
* 校验当前 actiondock.manifest.json 是否与动作源码定义保持一致(只读检查)。
|
|
292
|
-
*/
|
|
293
|
-
export async function checkManifestSync(
|
|
294
|
-
projectRoot: string,
|
|
295
|
-
options: Omit<SyncManifestOptions, "check"> = {}
|
|
296
|
-
): Promise<ManifestSyncResult> {
|
|
297
|
-
return syncManifest(projectRoot, { ...options, check: true });
|
|
298
|
-
}
|
|
299
|
-
|
package/src/project/types.ts
DELETED
|
@@ -1,141 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* 配置项的值类型枚举。用于自动类型推断与环境变量自动转换。
|
|
3
|
-
*/
|
|
4
|
-
export type ConfigValueType = "string" | "number" | "boolean" | "object" | "array";
|
|
5
|
-
|
|
6
|
-
/**
|
|
7
|
-
* 在 actiondock.json 中声明的单项配置定义。
|
|
8
|
-
*/
|
|
9
|
-
export interface ConfigItemDefinition {
|
|
10
|
-
/** 配置项的功能描述,展示在 CLI 配置提示与帮助文档中 */
|
|
11
|
-
description?: string;
|
|
12
|
-
/** 默认回退值。若未配置任何自定义值或环境变量,将使用此默认值 */
|
|
13
|
-
default?: unknown;
|
|
14
|
-
/** 是否为敏感信息(如 API Key, Password)。若为 true,在日志与 CLI 输出中默认脱敏 */
|
|
15
|
-
secret?: boolean;
|
|
16
|
-
/** 期望的目标数据类型,从 process.env 读取字符串时将自动尝试强转为此类型 */
|
|
17
|
-
type?: ConfigValueType;
|
|
18
|
-
/** 显式绑定的外部环境变量名(支持单个或优先级数组) */
|
|
19
|
-
env?: string | string[];
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
/**
|
|
23
|
-
* ActionDock 项目根配置文件契约(对应 actiondock.json)。
|
|
24
|
-
*/
|
|
25
|
-
export interface ProjectConfig {
|
|
26
|
-
/** 项目全局唯一 ID(例如 "team4u.github-tools") */
|
|
27
|
-
id: string;
|
|
28
|
-
/** 项目展示名称(例如 "GitHub Tools") */
|
|
29
|
-
name: string;
|
|
30
|
-
/** 项目版本号(遵循语义化版本 Semantic Versioning,如 "1.0.0") */
|
|
31
|
-
version: string;
|
|
32
|
-
/** 项目描述信息 */
|
|
33
|
-
description?: string;
|
|
34
|
-
/** Action 脚本文件存放目录(相对于项目根目录,默认为 "actions") */
|
|
35
|
-
actionsDir?: string;
|
|
36
|
-
/** Playbook SOP 文档存放目录(相对于项目根目录,默认为 "playbooks") */
|
|
37
|
-
playbooksDir?: string;
|
|
38
|
-
/** 声明的项目依赖配置项清单 */
|
|
39
|
-
config?: Record<string, ConfigItemDefinition>;
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
/**
|
|
43
|
-
* Playbook Markdown 文档头部 YAML Frontmatter 元数据。
|
|
44
|
-
*/
|
|
45
|
-
export interface PlaybookFrontmatter {
|
|
46
|
-
/** Playbook 唯一标识符(例如 "review-pr") */
|
|
47
|
-
id: string;
|
|
48
|
-
/** Playbook 任务描述 */
|
|
49
|
-
description?: string;
|
|
50
|
-
/** 该 Playbook SOP 所依赖/调用的 Action ID 列表(用于最小化构建与 Tree-shaking 导出) */
|
|
51
|
-
actions?: string[];
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
/**
|
|
55
|
-
* 解析后的完整 Playbook 定义对象。
|
|
56
|
-
*/
|
|
57
|
-
export interface PlaybookDefinition extends PlaybookFrontmatter {
|
|
58
|
-
/** Markdown 正文内容(去除了头部 YAML Frontmatter 后的 SOP 指南内容) */
|
|
59
|
-
content: string;
|
|
60
|
-
/** Playbook 源文件的绝对物理路径 */
|
|
61
|
-
filePath: string;
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
/**
|
|
65
|
-
* 单个 Action 在清单中的声明项。
|
|
66
|
-
*/
|
|
67
|
-
export interface ActionManifestEntry {
|
|
68
|
-
/** Action 入口文件相对路径(如 "actions/greet.ts") */
|
|
69
|
-
entry: string;
|
|
70
|
-
/** Action 功能描述 */
|
|
71
|
-
description?: string;
|
|
72
|
-
/** 输入参数模式规范 */
|
|
73
|
-
inputSchema?: Record<string, unknown> | boolean;
|
|
74
|
-
/** 输出结果模式规范 */
|
|
75
|
-
outputSchema?: Record<string, unknown> | boolean;
|
|
76
|
-
/** 静态依赖的 Action 列表 */
|
|
77
|
-
uses?: string[];
|
|
78
|
-
/** 标签列表 */
|
|
79
|
-
tags?: string[];
|
|
80
|
-
/** 协议注解元数据 */
|
|
81
|
-
annotations?: Record<string, unknown>;
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
/**
|
|
85
|
-
* ActionDock 声明式清单(actiondock.manifest.json)规范。
|
|
86
|
-
* 作为元数据的单一事实源,实现无副作用的模块发现与构建规划。
|
|
87
|
-
*/
|
|
88
|
-
export interface ActionDockManifest {
|
|
89
|
-
schemaVersion: number;
|
|
90
|
-
actions: Record<string, ActionManifestEntry>;
|
|
91
|
-
assets?: string[];
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
/**
|
|
95
|
-
* 清单同步操作选项。
|
|
96
|
-
*/
|
|
97
|
-
export interface SyncManifestOptions {
|
|
98
|
-
/** 自定义 actions 源码目录(默认为工程配置中的 actionsDir 或 "actions") */
|
|
99
|
-
actionsDir?: string;
|
|
100
|
-
/** 是否仅检查同步状态而不保存写入文件(默认 false) */
|
|
101
|
-
check?: boolean;
|
|
102
|
-
/** 是否自动移除源码中已不存在的 Action(默认 true) */
|
|
103
|
-
prune?: boolean;
|
|
104
|
-
/** 缺失依赖时是否自动执行安装(默认 true) */
|
|
105
|
-
autoInstall?: boolean;
|
|
106
|
-
}
|
|
107
|
-
|
|
108
|
-
/**
|
|
109
|
-
* 单个 Action 的清单同步变更项。
|
|
110
|
-
*/
|
|
111
|
-
export interface ManifestSyncChange {
|
|
112
|
-
/** Action 标识符 */
|
|
113
|
-
actionId: string;
|
|
114
|
-
/** 变更类型:新增、更新、删除或未变 */
|
|
115
|
-
type: "added" | "updated" | "removed" | "unchanged";
|
|
116
|
-
/** 源码入口文件相对路径 */
|
|
117
|
-
entry?: string;
|
|
118
|
-
/** 发生变更的字段列表(例如 ["description", "inputSchema"]) */
|
|
119
|
-
changedFields?: string[];
|
|
120
|
-
}
|
|
121
|
-
|
|
122
|
-
/**
|
|
123
|
-
* 清单同步执行结果。
|
|
124
|
-
*/
|
|
125
|
-
export interface ManifestSyncResult {
|
|
126
|
-
/** 清单当前是否已与源码完全一致 */
|
|
127
|
-
inSync: boolean;
|
|
128
|
-
/** 清单文件的物理绝对路径 */
|
|
129
|
-
manifestPath: string;
|
|
130
|
-
/** 所有 Action 的变更详情列表 */
|
|
131
|
-
changes: ManifestSyncChange[];
|
|
132
|
-
/** 新增的 Action 标识列表 */
|
|
133
|
-
added: string[];
|
|
134
|
-
/** 更新的 Action 标识列表 */
|
|
135
|
-
updated: string[];
|
|
136
|
-
/** 移除的 Action 标识列表 */
|
|
137
|
-
removed: string[];
|
|
138
|
-
/** 未改变的 Action 标识列表 */
|
|
139
|
-
unchanged: string[];
|
|
140
|
-
}
|
|
141
|
-
|