@forgehive/forge-cli 0.3.17 → 0.5.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/dist/runner.js +71 -3
- package/dist/tasks/auth/add.d.ts +2 -2
- package/dist/tasks/auth/add.js +4 -4
- package/dist/tasks/auth/clear.d.ts +3 -3
- package/dist/tasks/auth/list.d.ts +3 -3
- package/dist/tasks/auth/load.d.ts +1 -1
- package/dist/tasks/auth/loadCurrent.d.ts +3 -3
- package/dist/tasks/auth/remove.d.ts +2 -2
- package/dist/tasks/auth/remove.js +1 -1
- package/dist/tasks/auth/switch.d.ts +2 -2
- package/dist/tasks/auth/switch.js +1 -1
- package/dist/tasks/bundle/create.d.ts +2 -2
- package/dist/tasks/bundle/create.js +2 -2
- package/dist/tasks/bundle/fingerprint.d.ts +2 -2
- package/dist/tasks/bundle/fingerprint.js +2 -2
- package/dist/tasks/bundle/load.js +1 -1
- package/dist/tasks/bundle/zip.js +4 -4
- package/dist/tasks/conf/info.d.ts +5 -5
- package/dist/tasks/conf/load.d.ts +1 -1
- package/dist/tasks/docs/download.js +4 -2
- package/dist/tasks/fixture/download.d.ts +4 -4
- package/dist/tasks/fixture/download.js +1 -1
- package/dist/tasks/init.js +1 -1
- package/dist/tasks/project/create.d.ts +5 -5
- package/dist/tasks/project/create.js +21 -25
- package/dist/tasks/project/link.d.ts +4 -4
- package/dist/tasks/project/link.js +1 -1
- package/dist/tasks/project/sync.d.ts +7 -7
- package/dist/tasks/project/sync.js +7 -3
- package/dist/tasks/project/unlink.d.ts +3 -3
- package/dist/tasks/runner/bundle.d.ts +2 -2
- package/dist/tasks/runner/bundle.js +2 -2
- package/dist/tasks/runner/create.d.ts +2 -2
- package/dist/tasks/runner/create.js +1 -1
- package/dist/tasks/runner/remove.d.ts +2 -2
- package/dist/tasks/runner/remove.js +1 -1
- package/dist/tasks/task/createTask.d.ts +4 -4
- package/dist/tasks/task/createTask.js +3 -2
- package/dist/tasks/task/describe.d.ts +2 -2
- package/dist/tasks/task/describe.js +1 -1
- package/dist/tasks/task/download.d.ts +4 -4
- package/dist/tasks/task/download.js +2 -2
- package/dist/tasks/task/fingerprint.d.ts +2 -2
- package/dist/tasks/task/fingerprint.js +1 -1
- package/dist/tasks/task/invoke.d.ts +4 -4
- package/dist/tasks/task/invoke.js +2 -2
- package/dist/tasks/task/list.d.ts +3 -3
- package/dist/tasks/task/publish.d.ts +4 -4
- package/dist/tasks/task/publish.js +1 -1
- package/dist/tasks/task/remove.d.ts +2 -2
- package/dist/tasks/task/remove.js +1 -1
- package/dist/tasks/task/replay.d.ts +14 -7
- package/dist/tasks/task/replay.js +33 -23
- package/dist/tasks/task/run.d.ts +6 -6
- package/dist/tasks/task/run.js +18 -23
- package/dist/tasks/types.d.ts +1 -0
- package/dist/test/tasks/create.test.js +3 -2
- package/dist/utils/taskAnalysis.d.ts +6 -0
- package/dist/utils/taskAnalysis.js +82 -41
- package/package.json +11 -11
- package/pnpm-workspace.yaml +2 -0
- package/src/runner.ts +80 -3
- package/src/tasks/auth/add.ts +4 -4
- package/src/tasks/auth/remove.ts +1 -1
- package/src/tasks/auth/switch.ts +1 -1
- package/src/tasks/bundle/create.ts +2 -2
- package/src/tasks/bundle/fingerprint.ts +2 -2
- package/src/tasks/bundle/load.ts +1 -1
- package/src/tasks/bundle/zip.ts +4 -4
- package/src/tasks/docs/download.ts +5 -2
- package/src/tasks/fixture/download.ts +1 -1
- package/src/tasks/init.ts +1 -1
- package/src/tasks/project/create.ts +21 -27
- package/src/tasks/project/link.ts +1 -1
- package/src/tasks/project/sync.ts +9 -1
- package/src/tasks/runner/bundle.ts +2 -2
- package/src/tasks/runner/create.ts +1 -1
- package/src/tasks/runner/remove.ts +1 -1
- package/src/tasks/task/createTask.ts +3 -2
- package/src/tasks/task/describe.ts +1 -1
- package/src/tasks/task/download.ts +2 -2
- package/src/tasks/task/fingerprint.ts +1 -1
- package/src/tasks/task/invoke.ts +2 -2
- package/src/tasks/task/publish.ts +1 -1
- package/src/tasks/task/remove.ts +1 -1
- package/src/tasks/task/replay.ts +38 -24
- package/src/tasks/task/run.ts +19 -26
- package/src/tasks/types.ts +1 -0
- package/src/test/tasks/create.test.ts +3 -2
- package/src/utils/taskAnalysis.ts +90 -41
- package/logs/bundle:fingerprint.log +0 -1
- package/logs/task:fingerprint.log +0 -10
- package/logs/task:list.log +0 -1
- package/logs/test:guidance.log +0 -1
- package/logs/test:uuid.log +0 -1
- package/logs/test:uuidCheck.log +0 -1
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { type ForgeConf } from '../types';
|
|
2
|
-
export declare const unlink: import("@forgehive/task").TaskInstanceType<(argv:
|
|
3
|
-
loadConf: (args:
|
|
2
|
+
export declare const unlink: import("@forgehive/task").TaskInstanceType<(argv: Record<string, unknown>, boundaries: import("@forgehive/task").WrappedBoundaries<{
|
|
3
|
+
loadConf: (args: Record<string, unknown>) => Promise<Promise<ForgeConf>>;
|
|
4
4
|
writeFile: (filePath: string, content: string) => Promise<void>;
|
|
5
5
|
}>) => Promise<{
|
|
6
6
|
success: boolean;
|
|
7
7
|
unlinkedUuid: string;
|
|
8
8
|
}>, {
|
|
9
|
-
loadConf: (args:
|
|
9
|
+
loadConf: (args: Record<string, unknown>) => Promise<Promise<ForgeConf>>;
|
|
10
10
|
writeFile: (filePath: string, content: string) => Promise<void>;
|
|
11
11
|
}>;
|
|
@@ -3,7 +3,7 @@ export declare const bundle: import("@forgehive/task").TaskInstanceType<(argv: {
|
|
|
3
3
|
runnerName: string;
|
|
4
4
|
targetPath: string;
|
|
5
5
|
}, boundaries: import("@forgehive/task").WrappedBoundaries<{
|
|
6
|
-
loadConf: (args:
|
|
6
|
+
loadConf: (args: Record<string, unknown>) => Promise<Promise<ForgeConf>>;
|
|
7
7
|
getCwd: () => Promise<string>;
|
|
8
8
|
ensureDir: (dirPath: string) => Promise<void>;
|
|
9
9
|
}>) => Promise<{
|
|
@@ -12,7 +12,7 @@ export declare const bundle: import("@forgehive/task").TaskInstanceType<(argv: {
|
|
|
12
12
|
entryPoint: string;
|
|
13
13
|
outputFile: string;
|
|
14
14
|
}>, {
|
|
15
|
-
loadConf: (args:
|
|
15
|
+
loadConf: (args: Record<string, unknown>) => Promise<Promise<ForgeConf>>;
|
|
16
16
|
getCwd: () => Promise<string>;
|
|
17
17
|
ensureDir: (dirPath: string) => Promise<void>;
|
|
18
18
|
}>;
|
|
@@ -14,8 +14,8 @@ const path_1 = __importDefault(require("path"));
|
|
|
14
14
|
const promises_1 = __importDefault(require("fs/promises"));
|
|
15
15
|
const load_1 = require("../conf/load");
|
|
16
16
|
const schema = new schema_1.Schema({
|
|
17
|
-
runnerName: schema_1.Schema.string(),
|
|
18
|
-
targetPath: schema_1.Schema.string()
|
|
17
|
+
runnerName: schema_1.Schema.string().describe('The name of the runner to bundle'),
|
|
18
|
+
targetPath: schema_1.Schema.string().describe('Target path for the bundled runner')
|
|
19
19
|
});
|
|
20
20
|
const boundaries = {
|
|
21
21
|
loadConf: load_1.load.asBoundary(),
|
|
@@ -2,7 +2,7 @@ import { type ForgeConf } from '../types';
|
|
|
2
2
|
export declare const create: import("@forgehive/task").TaskInstanceType<(argv: {
|
|
3
3
|
runnerName: string;
|
|
4
4
|
}, boundaries: import("@forgehive/task").WrappedBoundaries<{
|
|
5
|
-
loadConf: (args:
|
|
5
|
+
loadConf: (args: Record<string, unknown>) => Promise<Promise<ForgeConf>>;
|
|
6
6
|
getCwd: () => Promise<string>;
|
|
7
7
|
persistRunner: (runnerPath: string, runnerName: string, content: string) => Promise<{
|
|
8
8
|
path: string;
|
|
@@ -12,7 +12,7 @@ export declare const create: import("@forgehive/task").TaskInstanceType<(argv: {
|
|
|
12
12
|
runnerPath: string;
|
|
13
13
|
runnerName: string;
|
|
14
14
|
}>, {
|
|
15
|
-
loadConf: (args:
|
|
15
|
+
loadConf: (args: Record<string, unknown>) => Promise<Promise<ForgeConf>>;
|
|
16
16
|
getCwd: () => Promise<string>;
|
|
17
17
|
persistRunner: (runnerPath: string, runnerName: string, content: string) => Promise<{
|
|
18
18
|
path: string;
|
|
@@ -30,7 +30,7 @@ const {{ runnerName }}Runner = new Runner()
|
|
|
30
30
|
export { {{ runnerName }}Runner }
|
|
31
31
|
`;
|
|
32
32
|
const schema = new schema_1.Schema({
|
|
33
|
-
runnerName: schema_1.Schema.string()
|
|
33
|
+
runnerName: schema_1.Schema.string().describe('The name of the runner to create')
|
|
34
34
|
});
|
|
35
35
|
const boundaries = {
|
|
36
36
|
// Load boundaries
|
|
@@ -2,7 +2,7 @@ import { type ForgeConf } from '../types';
|
|
|
2
2
|
export declare const remove: import("@forgehive/task").TaskInstanceType<(argv: {
|
|
3
3
|
runnerName: string;
|
|
4
4
|
}, boundaries: import("@forgehive/task").WrappedBoundaries<{
|
|
5
|
-
loadConf: (args:
|
|
5
|
+
loadConf: (args: Record<string, unknown>) => Promise<Promise<ForgeConf>>;
|
|
6
6
|
getCwd: () => Promise<string>;
|
|
7
7
|
removeRunner: (runnerPath: string) => Promise<void>;
|
|
8
8
|
persistConf: (forge: ForgeConf, cwd: string) => Promise<void>;
|
|
@@ -11,7 +11,7 @@ export declare const remove: import("@forgehive/task").TaskInstanceType<(argv: {
|
|
|
11
11
|
message: string;
|
|
12
12
|
runnerName: string;
|
|
13
13
|
}>, {
|
|
14
|
-
loadConf: (args:
|
|
14
|
+
loadConf: (args: Record<string, unknown>) => Promise<Promise<ForgeConf>>;
|
|
15
15
|
getCwd: () => Promise<string>;
|
|
16
16
|
removeRunner: (runnerPath: string) => Promise<void>;
|
|
17
17
|
persistConf: (forge: ForgeConf, cwd: string) => Promise<void>;
|
|
@@ -14,7 +14,7 @@ const promises_1 = __importDefault(require("fs/promises"));
|
|
|
14
14
|
const camelCase_1 = require("../../utils/camelCase");
|
|
15
15
|
const load_1 = require("../conf/load");
|
|
16
16
|
const schema = new schema_1.Schema({
|
|
17
|
-
runnerName: schema_1.Schema.string()
|
|
17
|
+
runnerName: schema_1.Schema.string().describe('The name of the runner to remove')
|
|
18
18
|
});
|
|
19
19
|
const boundaries = {
|
|
20
20
|
// Load boundaries
|
|
@@ -2,8 +2,8 @@ import { type TaskName, type ForgeConf } from '../types';
|
|
|
2
2
|
export declare const createTaskCommand: import("@forgehive/task").TaskInstanceType<(argv: {
|
|
3
3
|
descriptorName: string;
|
|
4
4
|
}, boundaries: import("@forgehive/task").WrappedBoundaries<{
|
|
5
|
-
loadConf: (args:
|
|
6
|
-
loadCurrentProfile: (args:
|
|
5
|
+
loadConf: (args: Record<string, unknown>) => Promise<Promise<ForgeConf>>;
|
|
6
|
+
loadCurrentProfile: (args: Record<string, unknown>) => Promise<Promise<import("../types").Profile>>;
|
|
7
7
|
loadTemplate: () => Promise<string>;
|
|
8
8
|
getCwd: () => Promise<string>;
|
|
9
9
|
parseTaskName: (taskDescriptor: string) => Promise<TaskName>;
|
|
@@ -20,8 +20,8 @@ export declare const createTaskCommand: import("@forgehive/task").TaskInstanceTy
|
|
|
20
20
|
taskPath: string;
|
|
21
21
|
fileName: string;
|
|
22
22
|
}>, {
|
|
23
|
-
loadConf: (args:
|
|
24
|
-
loadCurrentProfile: (args:
|
|
23
|
+
loadConf: (args: Record<string, unknown>) => Promise<Promise<ForgeConf>>;
|
|
24
|
+
loadCurrentProfile: (args: Record<string, unknown>) => Promise<Promise<import("../types").Profile>>;
|
|
25
25
|
loadTemplate: () => Promise<string>;
|
|
26
26
|
getCwd: () => Promise<string>;
|
|
27
27
|
parseTaskName: (taskDescriptor: string) => Promise<TaskName>;
|
|
@@ -26,8 +26,9 @@ const name = '{{ taskDescriptor }}'
|
|
|
26
26
|
const description = 'Add task description here'
|
|
27
27
|
|
|
28
28
|
const schema = new Schema({
|
|
29
|
-
// Add your schema definitions here
|
|
30
|
-
//
|
|
29
|
+
// Add your schema definitions here.
|
|
30
|
+
// Use .describe() so the field shows up in \`forge {{ taskDescriptor }} --help\`.
|
|
31
|
+
// example: myParam: Schema.string().describe('What this parameter is for')
|
|
31
32
|
})
|
|
32
33
|
|
|
33
34
|
const boundaries = {
|
|
@@ -2,7 +2,7 @@ import { type ForgeConf } from '../types';
|
|
|
2
2
|
export declare const describe: import("@forgehive/task").TaskInstanceType<(argv: {
|
|
3
3
|
descriptorName: string;
|
|
4
4
|
}, boundaries: import("@forgehive/task").WrappedBoundaries<{
|
|
5
|
-
loadConf: (args:
|
|
5
|
+
loadConf: (args: Record<string, unknown>) => Promise<Promise<ForgeConf>>;
|
|
6
6
|
bundleCreate: (args: {
|
|
7
7
|
entryPoint: string;
|
|
8
8
|
outputFile: string;
|
|
@@ -21,7 +21,7 @@ export declare const describe: import("@forgehive/task").TaskInstanceType<(argv:
|
|
|
21
21
|
schema: any;
|
|
22
22
|
boundaries: string[];
|
|
23
23
|
}>, {
|
|
24
|
-
loadConf: (args:
|
|
24
|
+
loadConf: (args: Record<string, unknown>) => Promise<Promise<ForgeConf>>;
|
|
25
25
|
bundleCreate: (args: {
|
|
26
26
|
entryPoint: string;
|
|
27
27
|
outputFile: string;
|
|
@@ -17,7 +17,7 @@ const load_1 = require("../bundle/load");
|
|
|
17
17
|
const load_2 = require("../conf/load");
|
|
18
18
|
const description = 'Describe a task with detailed information about its schema, boundaries and configuration';
|
|
19
19
|
const schema = new schema_1.Schema({
|
|
20
|
-
descriptorName: schema_1.Schema.string()
|
|
20
|
+
descriptorName: schema_1.Schema.string().describe('The task descriptor name to describe (e.g. domain:taskName)')
|
|
21
21
|
});
|
|
22
22
|
const boundaries = {
|
|
23
23
|
loadConf: load_2.load.asBoundary(),
|
|
@@ -3,9 +3,9 @@ export declare const download: import("@forgehive/task").TaskInstanceType<(argv:
|
|
|
3
3
|
descriptorName: string;
|
|
4
4
|
uuid: string;
|
|
5
5
|
}, boundaries: import("@forgehive/task").WrappedBoundaries<{
|
|
6
|
-
loadCurrentProfile: (args:
|
|
6
|
+
loadCurrentProfile: (args: Record<string, unknown>) => Promise<Promise<Profile>>;
|
|
7
7
|
downloadTask: (uuid: string, profile: Profile) => Promise<any>;
|
|
8
|
-
loadConf: (args:
|
|
8
|
+
loadConf: (args: Record<string, unknown>) => Promise<Promise<ForgeConf>>;
|
|
9
9
|
getCwd: () => Promise<string>;
|
|
10
10
|
parseTaskName: (taskDescriptor: string) => Promise<{
|
|
11
11
|
descriptor: string;
|
|
@@ -40,9 +40,9 @@ export declare const download: import("@forgehive/task").TaskInstanceType<(argv:
|
|
|
40
40
|
error?: undefined;
|
|
41
41
|
message?: undefined;
|
|
42
42
|
}>, {
|
|
43
|
-
loadCurrentProfile: (args:
|
|
43
|
+
loadCurrentProfile: (args: Record<string, unknown>) => Promise<Promise<Profile>>;
|
|
44
44
|
downloadTask: (uuid: string, profile: Profile) => Promise<any>;
|
|
45
|
-
loadConf: (args:
|
|
45
|
+
loadConf: (args: Record<string, unknown>) => Promise<Promise<ForgeConf>>;
|
|
46
46
|
getCwd: () => Promise<string>;
|
|
47
47
|
parseTaskName: (taskDescriptor: string) => Promise<{
|
|
48
48
|
descriptor: string;
|
|
@@ -16,8 +16,8 @@ const camelCase_1 = require("../../utils/camelCase");
|
|
|
16
16
|
const load_1 = require("../conf/load");
|
|
17
17
|
const loadCurrent_1 = require("../auth/loadCurrent");
|
|
18
18
|
const schema = new schema_1.Schema({
|
|
19
|
-
descriptorName: schema_1.Schema.string(),
|
|
20
|
-
uuid: schema_1.Schema.string()
|
|
19
|
+
descriptorName: schema_1.Schema.string().describe('The task descriptor name (e.g. domain:taskName)'),
|
|
20
|
+
uuid: schema_1.Schema.string().describe('The UUID of the task version to download')
|
|
21
21
|
});
|
|
22
22
|
const boundaries = {
|
|
23
23
|
loadCurrentProfile: loadCurrent_1.loadCurrent.asBoundary(),
|
|
@@ -2,7 +2,7 @@ export declare const fingerprint: import("@forgehive/task").TaskInstanceType<(ar
|
|
|
2
2
|
descriptorName: string;
|
|
3
3
|
}, boundaries: import("@forgehive/task").WrappedBoundaries<{
|
|
4
4
|
getCwd: () => Promise<string>;
|
|
5
|
-
loadConf: (args:
|
|
5
|
+
loadConf: (args: Record<string, unknown>) => Promise<Promise<import("../types").ForgeConf>>;
|
|
6
6
|
bundleFingerprint: (args: {
|
|
7
7
|
descriptorName: string;
|
|
8
8
|
filePath?: string | undefined;
|
|
@@ -40,7 +40,7 @@ export declare const fingerprint: import("@forgehive/task").TaskInstanceType<(ar
|
|
|
40
40
|
};
|
|
41
41
|
}>, {
|
|
42
42
|
getCwd: () => Promise<string>;
|
|
43
|
-
loadConf: (args:
|
|
43
|
+
loadConf: (args: Record<string, unknown>) => Promise<Promise<import("../types").ForgeConf>>;
|
|
44
44
|
bundleFingerprint: (args: {
|
|
45
45
|
descriptorName: string;
|
|
46
46
|
filePath?: string | undefined;
|
|
@@ -14,7 +14,7 @@ const load_1 = require("../conf/load");
|
|
|
14
14
|
const fingerprint_1 = require("../bundle/fingerprint");
|
|
15
15
|
const description = 'Analyze a specific task and generate detailed fingerprint without bundling';
|
|
16
16
|
const schema = new schema_1.Schema({
|
|
17
|
-
descriptorName: schema_1.Schema.string()
|
|
17
|
+
descriptorName: schema_1.Schema.string().describe('The task descriptor name to fingerprint (e.g. domain:taskName)')
|
|
18
18
|
});
|
|
19
19
|
const boundaries = {
|
|
20
20
|
getCwd: async () => {
|
|
@@ -4,13 +4,13 @@ export declare const invoke: import("@forgehive/task").TaskInstanceType<(argv: {
|
|
|
4
4
|
descriptorName: string;
|
|
5
5
|
json: string;
|
|
6
6
|
}, boundaries: import("@forgehive/task").WrappedBoundaries<{
|
|
7
|
-
loadConf: (args:
|
|
8
|
-
loadCurrentProfile: (args:
|
|
7
|
+
loadConf: (args: Record<string, unknown>) => Promise<Promise<ForgeConf>>;
|
|
8
|
+
loadCurrentProfile: (args: Record<string, unknown>) => Promise<Promise<Profile>>;
|
|
9
9
|
parseJSON: (jsonString: string) => Promise<unknown>;
|
|
10
10
|
invokeTask: (projectUuid: string, taskUuid: string, profile: Profile, taskName: string, payload: unknown) => Promise<InvokeResult | null>;
|
|
11
11
|
}>) => Promise<unknown>, {
|
|
12
|
-
loadConf: (args:
|
|
13
|
-
loadCurrentProfile: (args:
|
|
12
|
+
loadConf: (args: Record<string, unknown>) => Promise<Promise<ForgeConf>>;
|
|
13
|
+
loadCurrentProfile: (args: Record<string, unknown>) => Promise<Promise<Profile>>;
|
|
14
14
|
parseJSON: (jsonString: string) => Promise<unknown>;
|
|
15
15
|
invokeTask: (projectUuid: string, taskUuid: string, profile: Profile, taskName: string, payload: unknown) => Promise<InvokeResult | null>;
|
|
16
16
|
}>;
|
|
@@ -12,8 +12,8 @@ const loadCurrent_1 = require("../auth/loadCurrent");
|
|
|
12
12
|
const name = 'task:invoke';
|
|
13
13
|
const description = 'Invoke a deployed task remotely using the Hive API';
|
|
14
14
|
const schema = new schema_1.Schema({
|
|
15
|
-
descriptorName: schema_1.Schema.string(),
|
|
16
|
-
json: schema_1.Schema.string()
|
|
15
|
+
descriptorName: schema_1.Schema.string().describe('The task descriptor name (e.g. domain:taskName)'),
|
|
16
|
+
json: schema_1.Schema.string().describe('JSON string of arguments to pass to the task')
|
|
17
17
|
});
|
|
18
18
|
const boundaries = {
|
|
19
19
|
loadConf: load_1.load.asBoundary(),
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { type ForgeConf } from '../types';
|
|
2
|
-
export declare const list: import("@forgehive/task").TaskInstanceType<(argv:
|
|
3
|
-
loadConf: (args:
|
|
2
|
+
export declare const list: import("@forgehive/task").TaskInstanceType<(argv: Record<string, unknown>, boundaries: import("@forgehive/task").WrappedBoundaries<{
|
|
3
|
+
loadConf: (args: Record<string, unknown>) => Promise<Promise<ForgeConf>>;
|
|
4
4
|
}>) => Promise<{
|
|
5
5
|
taskCount: number;
|
|
6
6
|
tasks: never[];
|
|
@@ -8,5 +8,5 @@ export declare const list: import("@forgehive/task").TaskInstanceType<(argv: {},
|
|
|
8
8
|
taskCount: number;
|
|
9
9
|
tasks?: undefined;
|
|
10
10
|
}>, {
|
|
11
|
-
loadConf: (args:
|
|
11
|
+
loadConf: (args: Record<string, unknown>) => Promise<Promise<ForgeConf>>;
|
|
12
12
|
}>;
|
|
@@ -4,8 +4,8 @@ export declare const publish: import("@forgehive/task").TaskInstanceType<(argv:
|
|
|
4
4
|
descriptorName: string;
|
|
5
5
|
}, boundaries: import("@forgehive/task").WrappedBoundaries<{
|
|
6
6
|
getCwd: () => Promise<string>;
|
|
7
|
-
loadConf: (args:
|
|
8
|
-
loadCurrentProfile: (args:
|
|
7
|
+
loadConf: (args: Record<string, unknown>) => Promise<Promise<import("../types").ForgeConf>>;
|
|
8
|
+
loadCurrentProfile: (args: Record<string, unknown>) => Promise<Promise<Profile>>;
|
|
9
9
|
bundleCreate: (args: {
|
|
10
10
|
entryPoint: string;
|
|
11
11
|
outputFile: string;
|
|
@@ -59,8 +59,8 @@ export declare const publish: import("@forgehive/task").TaskInstanceType<(argv:
|
|
|
59
59
|
fingerprint: boolean;
|
|
60
60
|
}>, {
|
|
61
61
|
getCwd: () => Promise<string>;
|
|
62
|
-
loadConf: (args:
|
|
63
|
-
loadCurrentProfile: (args:
|
|
62
|
+
loadConf: (args: Record<string, unknown>) => Promise<Promise<import("../types").ForgeConf>>;
|
|
63
|
+
loadCurrentProfile: (args: Record<string, unknown>) => Promise<Promise<Profile>>;
|
|
64
64
|
bundleCreate: (args: {
|
|
65
65
|
entryPoint: string;
|
|
66
66
|
outputFile: string;
|
|
@@ -20,7 +20,7 @@ const zip_1 = require("../bundle/zip");
|
|
|
20
20
|
const fingerprint_1 = require("../bundle/fingerprint");
|
|
21
21
|
const loadCurrent_1 = require("../auth/loadCurrent");
|
|
22
22
|
const schema = new schema_1.Schema({
|
|
23
|
-
descriptorName: schema_1.Schema.string()
|
|
23
|
+
descriptorName: schema_1.Schema.string().describe('The task descriptor name to publish (e.g. domain:taskName)')
|
|
24
24
|
});
|
|
25
25
|
const boundaries = {
|
|
26
26
|
getCwd: async () => {
|
|
@@ -2,14 +2,14 @@ import { type ForgeConf } from '../types';
|
|
|
2
2
|
export declare const remove: import("@forgehive/task").TaskInstanceType<(argv: {
|
|
3
3
|
descriptorName: string;
|
|
4
4
|
}, boundaries: import("@forgehive/task").WrappedBoundaries<{
|
|
5
|
-
loadConf: (args:
|
|
5
|
+
loadConf: (args: Record<string, unknown>) => Promise<Promise<ForgeConf>>;
|
|
6
6
|
persistConf: (forge: ForgeConf) => Promise<void>;
|
|
7
7
|
deleteFile: (filePath: string) => Promise<void>;
|
|
8
8
|
}>) => Promise<{
|
|
9
9
|
status: string;
|
|
10
10
|
message: string;
|
|
11
11
|
}>, {
|
|
12
|
-
loadConf: (args:
|
|
12
|
+
loadConf: (args: Record<string, unknown>) => Promise<Promise<ForgeConf>>;
|
|
13
13
|
persistConf: (forge: ForgeConf) => Promise<void>;
|
|
14
14
|
deleteFile: (filePath: string) => Promise<void>;
|
|
15
15
|
}>;
|
|
@@ -13,7 +13,7 @@ const path_1 = __importDefault(require("path"));
|
|
|
13
13
|
const promises_1 = __importDefault(require("fs/promises"));
|
|
14
14
|
const load_1 = require("../conf/load");
|
|
15
15
|
const schema = new schema_1.Schema({
|
|
16
|
-
descriptorName: schema_1.Schema.string()
|
|
16
|
+
descriptorName: schema_1.Schema.string().describe('The task descriptor name to remove (e.g. domain:taskName)')
|
|
17
17
|
});
|
|
18
18
|
const boundaries = {
|
|
19
19
|
loadConf: load_1.load.asBoundary(),
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { type ExecutionRecord } from '@forgehive/hive-sdk';
|
|
1
2
|
import { type ForgeConf, type Profile } from '../types';
|
|
2
3
|
interface Fixture {
|
|
3
4
|
fixtureUUID: string;
|
|
@@ -10,13 +11,13 @@ interface Fixture {
|
|
|
10
11
|
context: Record<string, unknown>;
|
|
11
12
|
}
|
|
12
13
|
export declare const replay: import("@forgehive/task").TaskInstanceType<(argv: {
|
|
13
|
-
path: string;
|
|
14
14
|
descriptorName: string;
|
|
15
|
+
path: string;
|
|
15
16
|
cache?: string | undefined;
|
|
16
17
|
}, boundaries: import("@forgehive/task").WrappedBoundaries<{
|
|
17
18
|
readFixture: (filePath: string) => Promise<Fixture>;
|
|
18
|
-
loadConf: (args:
|
|
19
|
-
loadCurrentProfile: (args:
|
|
19
|
+
loadConf: (args: Record<string, unknown>) => Promise<Promise<ForgeConf>>;
|
|
20
|
+
loadCurrentProfile: (args: Record<string, unknown>) => Promise<Promise<Profile>>;
|
|
20
21
|
bundleCreate: (args: {
|
|
21
22
|
entryPoint: string;
|
|
22
23
|
outputFile: string;
|
|
@@ -28,11 +29,14 @@ export declare const replay: import("@forgehive/task").TaskInstanceType<(argv: {
|
|
|
28
29
|
}) => Promise<Promise<any>>;
|
|
29
30
|
ensureBuildsFolder: () => Promise<string>;
|
|
30
31
|
verifyLogFolder: (logsPath: string) => Promise<boolean>;
|
|
31
|
-
sendLogToAPI: (profile: Profile,
|
|
32
|
+
sendLogToAPI: (profile: Profile, record: ExecutionRecord, fixtureUUID: string) => Promise<{
|
|
33
|
+
success: boolean;
|
|
34
|
+
logUuid?: string;
|
|
35
|
+
}>;
|
|
32
36
|
}>) => Promise<any>, {
|
|
33
37
|
readFixture: (filePath: string) => Promise<Fixture>;
|
|
34
|
-
loadConf: (args:
|
|
35
|
-
loadCurrentProfile: (args:
|
|
38
|
+
loadConf: (args: Record<string, unknown>) => Promise<Promise<ForgeConf>>;
|
|
39
|
+
loadCurrentProfile: (args: Record<string, unknown>) => Promise<Promise<Profile>>;
|
|
36
40
|
bundleCreate: (args: {
|
|
37
41
|
entryPoint: string;
|
|
38
42
|
outputFile: string;
|
|
@@ -44,6 +48,9 @@ export declare const replay: import("@forgehive/task").TaskInstanceType<(argv: {
|
|
|
44
48
|
}) => Promise<Promise<any>>;
|
|
45
49
|
ensureBuildsFolder: () => Promise<string>;
|
|
46
50
|
verifyLogFolder: (logsPath: string) => Promise<boolean>;
|
|
47
|
-
sendLogToAPI: (profile: Profile,
|
|
51
|
+
sendLogToAPI: (profile: Profile, record: ExecutionRecord, fixtureUUID: string) => Promise<{
|
|
52
|
+
success: boolean;
|
|
53
|
+
logUuid?: string;
|
|
54
|
+
}>;
|
|
48
55
|
}>;
|
|
49
56
|
export {};
|
|
@@ -12,16 +12,16 @@ const schema_1 = require("@forgehive/schema");
|
|
|
12
12
|
const promises_1 = __importDefault(require("fs/promises"));
|
|
13
13
|
const path_1 = __importDefault(require("path"));
|
|
14
14
|
const os_1 = __importDefault(require("os"));
|
|
15
|
-
const
|
|
15
|
+
const hive_sdk_1 = require("@forgehive/hive-sdk");
|
|
16
16
|
const create_1 = require("../bundle/create");
|
|
17
17
|
const load_1 = require("../bundle/load");
|
|
18
18
|
const load_2 = require("../conf/load");
|
|
19
19
|
const loadCurrent_1 = require("../auth/loadCurrent");
|
|
20
20
|
const description = 'Replay a task execution from a specified path';
|
|
21
21
|
const schema = new schema_1.Schema({
|
|
22
|
-
descriptorName: schema_1.Schema.string(),
|
|
23
|
-
path: schema_1.Schema.string(),
|
|
24
|
-
cache: schema_1.Schema.string().optional()
|
|
22
|
+
descriptorName: schema_1.Schema.string().describe('The task descriptor name to replay (e.g. domain:taskName)'),
|
|
23
|
+
path: schema_1.Schema.string().describe('Path to the execution log fixture to replay'),
|
|
24
|
+
cache: schema_1.Schema.string().describe('Cache mode for boundaries during replay').optional()
|
|
25
25
|
});
|
|
26
26
|
const boundaries = {
|
|
27
27
|
readFixture: async (filePath) => {
|
|
@@ -53,30 +53,41 @@ const boundaries = {
|
|
|
53
53
|
}
|
|
54
54
|
return true;
|
|
55
55
|
},
|
|
56
|
-
sendLogToAPI: async (profile,
|
|
56
|
+
sendLogToAPI: async (profile, record, fixtureUUID) => {
|
|
57
57
|
try {
|
|
58
|
-
|
|
59
|
-
const
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
headers: {
|
|
67
|
-
Authorization: `Bearer ${authToken}`,
|
|
68
|
-
'Content-Type': 'application/json'
|
|
58
|
+
// Use createClientFromForgeConf to automatically load forge.json with task UUIDs
|
|
59
|
+
const client = (0, hive_sdk_1.createClientFromForgeConf)('./forge.json', {
|
|
60
|
+
apiKey: profile.apiKey,
|
|
61
|
+
apiSecret: profile.apiSecret,
|
|
62
|
+
host: profile.url,
|
|
63
|
+
metadata: {
|
|
64
|
+
environment: 'cli',
|
|
65
|
+
replayFrom: fixtureUUID
|
|
69
66
|
}
|
|
70
67
|
});
|
|
71
68
|
console.log('===============================================');
|
|
72
|
-
console.log('
|
|
73
|
-
|
|
74
|
-
|
|
69
|
+
console.log('Sending replay log to Hive...');
|
|
70
|
+
const result = await client.sendLog(record);
|
|
71
|
+
if (result === 'success' || (typeof result === 'object' && 'uuid' in result)) {
|
|
72
|
+
console.log('✅ Log sent to API...', profile.name, profile.url);
|
|
73
|
+
console.log('Replay from fixture UUID:', fixtureUUID);
|
|
74
|
+
console.log('===============================================');
|
|
75
|
+
if (typeof result === 'object' && result && 'uuid' in result) {
|
|
76
|
+
return { success: true, logUuid: result.uuid };
|
|
77
|
+
}
|
|
78
|
+
return { success: true };
|
|
79
|
+
}
|
|
80
|
+
else {
|
|
81
|
+
console.error('❌ Failed to send log to Hive');
|
|
82
|
+
console.log('===============================================');
|
|
83
|
+
return { success: false };
|
|
84
|
+
}
|
|
75
85
|
}
|
|
76
86
|
catch (e) {
|
|
77
87
|
const error = e;
|
|
78
|
-
console.error('Failed to send log to API:', error.message);
|
|
79
|
-
|
|
88
|
+
console.error('❌ Failed to send log to API:', error.message);
|
|
89
|
+
console.log('===============================================');
|
|
90
|
+
return { success: false };
|
|
80
91
|
}
|
|
81
92
|
}
|
|
82
93
|
};
|
|
@@ -90,7 +101,6 @@ exports.replay = (0, task_1.createTask)({
|
|
|
90
101
|
// Load forge configuration
|
|
91
102
|
const forge = await loadConf({});
|
|
92
103
|
const taskDescriptor = forge.tasks[descriptorName];
|
|
93
|
-
const projectName = forge.project.name;
|
|
94
104
|
if (taskDescriptor === undefined) {
|
|
95
105
|
throw new Error(`Task ${descriptorName} is not defined in forge.json`);
|
|
96
106
|
}
|
|
@@ -168,7 +178,7 @@ exports.replay = (0, task_1.createTask)({
|
|
|
168
178
|
// Send the log to API if profile is available
|
|
169
179
|
if (profile) {
|
|
170
180
|
try {
|
|
171
|
-
await sendLogToAPI(profile,
|
|
181
|
+
await sendLogToAPI(profile, record, fixture.fixtureUUID);
|
|
172
182
|
}
|
|
173
183
|
catch (e) {
|
|
174
184
|
console.error('Failed to send log to API:', e);
|
package/dist/tasks/task/run.d.ts
CHANGED
|
@@ -4,8 +4,8 @@ export declare const run: import("@forgehive/task").TaskInstanceType<(argv: {
|
|
|
4
4
|
descriptorName: string;
|
|
5
5
|
args: Record<string, string | number | boolean>;
|
|
6
6
|
}, boundaries: import("@forgehive/task").WrappedBoundaries<{
|
|
7
|
-
loadConf: (args:
|
|
8
|
-
loadCurrentProfile: (args:
|
|
7
|
+
loadConf: (args: Record<string, unknown>) => Promise<Promise<ForgeConf>>;
|
|
8
|
+
loadCurrentProfile: (args: Record<string, unknown>) => Promise<Promise<Profile>>;
|
|
9
9
|
bundleCreate: (args: {
|
|
10
10
|
entryPoint: string;
|
|
11
11
|
outputFile: string;
|
|
@@ -17,15 +17,15 @@ export declare const run: import("@forgehive/task").TaskInstanceType<(argv: {
|
|
|
17
17
|
}) => Promise<Promise<any>>;
|
|
18
18
|
ensureLogFolder: (logsPath: string) => Promise<void>;
|
|
19
19
|
ensureBuildsFolder: () => Promise<string>;
|
|
20
|
-
sendLogToAPI: (profile: Profile,
|
|
20
|
+
sendLogToAPI: (profile: Profile, record: ExecutionRecord, taskUuid?: string) => Promise<{
|
|
21
21
|
success: boolean;
|
|
22
22
|
logUuid?: string;
|
|
23
23
|
taskUuid?: string;
|
|
24
24
|
skipRemoteLog?: boolean;
|
|
25
25
|
}>;
|
|
26
26
|
}>) => Promise<any>, {
|
|
27
|
-
loadConf: (args:
|
|
28
|
-
loadCurrentProfile: (args:
|
|
27
|
+
loadConf: (args: Record<string, unknown>) => Promise<Promise<ForgeConf>>;
|
|
28
|
+
loadCurrentProfile: (args: Record<string, unknown>) => Promise<Promise<Profile>>;
|
|
29
29
|
bundleCreate: (args: {
|
|
30
30
|
entryPoint: string;
|
|
31
31
|
outputFile: string;
|
|
@@ -37,7 +37,7 @@ export declare const run: import("@forgehive/task").TaskInstanceType<(argv: {
|
|
|
37
37
|
}) => Promise<Promise<any>>;
|
|
38
38
|
ensureLogFolder: (logsPath: string) => Promise<void>;
|
|
39
39
|
ensureBuildsFolder: () => Promise<string>;
|
|
40
|
-
sendLogToAPI: (profile: Profile,
|
|
40
|
+
sendLogToAPI: (profile: Profile, record: ExecutionRecord, taskUuid?: string) => Promise<{
|
|
41
41
|
success: boolean;
|
|
42
42
|
logUuid?: string;
|
|
43
43
|
taskUuid?: string;
|
package/dist/tasks/task/run.js
CHANGED
|
@@ -22,8 +22,8 @@ const loadCurrent_1 = require("../auth/loadCurrent");
|
|
|
22
22
|
// For now, we'll use a simple schema without the record type
|
|
23
23
|
// TODO: Use Schema.record once it's properly built and available
|
|
24
24
|
const schema = new schema_1.Schema({
|
|
25
|
-
descriptorName: schema_1.Schema.string(),
|
|
26
|
-
args: schema_1.Schema.mixedRecord()
|
|
25
|
+
descriptorName: schema_1.Schema.string().describe('The task descriptor name to run (e.g. domain:taskName)'),
|
|
26
|
+
args: schema_1.Schema.mixedRecord().describe('Arguments to pass to the task')
|
|
27
27
|
// args will be passed directly without schema validation for now
|
|
28
28
|
});
|
|
29
29
|
const boundaries = {
|
|
@@ -50,39 +50,32 @@ const boundaries = {
|
|
|
50
50
|
}
|
|
51
51
|
return buildsPath;
|
|
52
52
|
},
|
|
53
|
-
sendLogToAPI: async (profile,
|
|
54
|
-
// Check if we have required
|
|
55
|
-
if (!
|
|
53
|
+
sendLogToAPI: async (profile, record, taskUuid) => {
|
|
54
|
+
// Check if we have required UUID for the task
|
|
55
|
+
if (!taskUuid) {
|
|
56
56
|
console.log('===============================================');
|
|
57
|
-
console.log('⚠️ Remote logging skipped - missing
|
|
57
|
+
console.log('⚠️ Remote logging skipped - missing task UUID');
|
|
58
58
|
console.log('');
|
|
59
59
|
console.log('To enable remote logging with enhanced features:');
|
|
60
|
-
|
|
61
|
-
console.log('• Use "forge project:create" to create a new project, or');
|
|
62
|
-
console.log('• Use "forge project:link" to connect to an existing project');
|
|
63
|
-
}
|
|
64
|
-
if (!taskUuid) {
|
|
65
|
-
console.log('• Use "forge project:sync" to get the task to have UUID');
|
|
66
|
-
}
|
|
60
|
+
console.log('• Use "forge project:sync" to sync tasks and get UUIDs');
|
|
67
61
|
console.log('===============================================');
|
|
68
62
|
return { success: true, skipRemoteLog: true };
|
|
69
63
|
}
|
|
70
64
|
try {
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
projectUuid,
|
|
65
|
+
// Use createClientFromForgeConf to automatically load forge.json with task UUIDs
|
|
66
|
+
const client = (0, hive_sdk_1.createClientFromForgeConf)('./forge.json', {
|
|
74
67
|
apiKey: profile.apiKey,
|
|
75
68
|
apiSecret: profile.apiSecret,
|
|
76
69
|
host: profile.url,
|
|
77
70
|
metadata: {
|
|
78
71
|
environment: 'cli'
|
|
79
72
|
}
|
|
80
|
-
};
|
|
81
|
-
|
|
73
|
+
});
|
|
74
|
+
console.log('===============================================');
|
|
82
75
|
console.log('Sending execution log to Hive...');
|
|
83
|
-
const result = await client.
|
|
76
|
+
const result = await client.sendLog(record);
|
|
84
77
|
if (result === 'success' || (typeof result === 'object' && 'uuid' in result)) {
|
|
85
|
-
console.log('
|
|
78
|
+
console.log('');
|
|
86
79
|
console.log('✅ Log sent to Hive successfully');
|
|
87
80
|
console.log(` Profile: ${profile.name}`);
|
|
88
81
|
console.log(` Host: ${profile.url}`);
|
|
@@ -93,14 +86,18 @@ const boundaries = {
|
|
|
93
86
|
return { success: true, taskUuid };
|
|
94
87
|
}
|
|
95
88
|
else {
|
|
89
|
+
console.log('');
|
|
96
90
|
console.error('❌ Failed to send log to Hive:', profile.url);
|
|
91
|
+
console.log('===============================================');
|
|
97
92
|
return { success: false };
|
|
98
93
|
}
|
|
99
94
|
}
|
|
100
95
|
catch (e) {
|
|
96
|
+
console.log('===============================================');
|
|
101
97
|
console.error('❌ Failed to send log to Hive:', profile.url);
|
|
102
98
|
const error = e;
|
|
103
99
|
console.error('Error:', error.message);
|
|
100
|
+
console.log('===============================================');
|
|
104
101
|
return { success: false };
|
|
105
102
|
}
|
|
106
103
|
}
|
|
@@ -112,8 +109,6 @@ exports.run = (0, task_1.createTask)({
|
|
|
112
109
|
// Load forge configuration
|
|
113
110
|
const forge = await loadConf({});
|
|
114
111
|
const taskDescriptor = forge.tasks[descriptorName];
|
|
115
|
-
const projectName = forge.project.name;
|
|
116
|
-
const projectUuid = forge.project.uuid;
|
|
117
112
|
const taskUuid = taskDescriptor?.uuid;
|
|
118
113
|
if (taskDescriptor === undefined) {
|
|
119
114
|
throw new Error('Task is not defined on forge.json');
|
|
@@ -175,7 +170,7 @@ exports.run = (0, task_1.createTask)({
|
|
|
175
170
|
await tape.save();
|
|
176
171
|
if (profile) {
|
|
177
172
|
try {
|
|
178
|
-
const logResult = await sendLogToAPI(profile,
|
|
173
|
+
const logResult = await sendLogToAPI(profile, logItem, taskUuid);
|
|
179
174
|
if (logResult.success && !logResult.skipRemoteLog && taskUuid) {
|
|
180
175
|
console.log(`🔗 View execution logs: ${profile.url}/tasks/${taskUuid}?tab=logs`);
|
|
181
176
|
}
|