@forgehive/forge-cli 0.2.14 → 0.3.0
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 +3 -1
- package/dist/tasks/auth/add.js +23 -19
- package/dist/tasks/auth/list.js +20 -16
- package/dist/tasks/auth/load.js +19 -15
- package/dist/tasks/auth/loadCurrent.js +13 -9
- package/dist/tasks/auth/remove.js +30 -26
- package/dist/tasks/auth/switch.js +19 -15
- package/dist/tasks/bundle/create.js +16 -12
- package/dist/tasks/bundle/fingerprint.d.ts +36 -0
- package/dist/tasks/bundle/fingerprint.js +164 -0
- package/dist/tasks/bundle/load.js +9 -5
- package/dist/tasks/bundle/zip.js +49 -45
- package/dist/tasks/conf/info.js +23 -19
- package/dist/tasks/conf/load.js +8 -4
- package/dist/tasks/fixture/download.js +40 -36
- package/dist/tasks/init.js +35 -31
- package/dist/tasks/runner/bundle.js +34 -30
- package/dist/tasks/runner/create.js +28 -24
- package/dist/tasks/runner/remove.js +22 -18
- package/dist/tasks/task/createTask.js +35 -28
- package/dist/tasks/task/describe.js +85 -81
- package/dist/tasks/task/download.js +63 -59
- package/dist/tasks/task/fingerprint.d.ts +26 -0
- package/dist/tasks/task/fingerprint.js +87 -0
- package/dist/tasks/task/list.js +27 -23
- package/dist/tasks/task/publish.js +72 -68
- package/dist/tasks/task/remove.js +24 -20
- package/dist/tasks/task/replay.js +94 -90
- package/dist/tasks/task/run.js +84 -79
- package/dist/test/tasks/create.test.js +6 -5
- package/dist/utils/taskAnalysis.d.ts +21 -0
- package/dist/utils/taskAnalysis.js +380 -0
- package/forge.json +12 -0
- package/logs/task:fingerprint.log +10 -0
- package/package.json +7 -7
- package/specs/fingerprint.md +380 -0
- package/src/runner.ts +3 -1
- package/src/tasks/README.md +13 -13
- package/src/tasks/auth/add.ts +3 -3
- package/src/tasks/auth/list.ts +3 -3
- package/src/tasks/auth/load.ts +3 -3
- package/src/tasks/auth/loadCurrent.ts +3 -3
- package/src/tasks/auth/remove.ts +3 -3
- package/src/tasks/auth/switch.ts +3 -3
- package/src/tasks/bundle/README.md +7 -7
- package/src/tasks/bundle/create.ts +4 -4
- package/src/tasks/bundle/fingerprint.ts +218 -0
- package/src/tasks/bundle/load.ts +4 -4
- package/src/tasks/bundle/zip.ts +3 -3
- package/src/tasks/conf/info.ts +3 -3
- package/src/tasks/conf/load.ts +3 -3
- package/src/tasks/fixture/download.ts +3 -3
- package/src/tasks/init.ts +3 -3
- package/src/tasks/runner/bundle.ts +3 -3
- package/src/tasks/runner/create.ts +3 -3
- package/src/tasks/runner/remove.ts +3 -3
- package/src/tasks/task/createTask.ts +10 -7
- package/src/tasks/task/describe.ts +3 -3
- package/src/tasks/task/download.ts +3 -3
- package/src/tasks/task/fingerprint.ts +107 -0
- package/src/tasks/task/list.ts +3 -3
- package/src/tasks/task/publish.ts +3 -3
- package/src/tasks/task/remove.ts +3 -3
- package/src/tasks/task/replay.ts +3 -3
- package/src/tasks/task/run.ts +5 -4
- package/src/test/tasks/create.test.ts +9 -9
- package/src/utils/taskAnalysis.ts +419 -0
|
@@ -0,0 +1,380 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
+
exports.analyzeTaskFile = analyzeTaskFile;
|
|
37
|
+
const ts = __importStar(require("typescript"));
|
|
38
|
+
// Hash generation function
|
|
39
|
+
function generateHash(input) {
|
|
40
|
+
let hash = 0;
|
|
41
|
+
for (let i = 0; i < input.length; i++) {
|
|
42
|
+
const char = input.charCodeAt(i);
|
|
43
|
+
hash = ((hash << 5) - hash) + char;
|
|
44
|
+
hash = hash & hash; // Convert to 32-bit integer
|
|
45
|
+
}
|
|
46
|
+
return Math.abs(hash).toString(36);
|
|
47
|
+
}
|
|
48
|
+
// TypeScript AST analysis function
|
|
49
|
+
function extractTaskFingerprints(sourceCode, filePath) {
|
|
50
|
+
const sourceFile = ts.createSourceFile(filePath, sourceCode, ts.ScriptTarget.Latest, true);
|
|
51
|
+
const fingerprints = [];
|
|
52
|
+
let schemaNode = null;
|
|
53
|
+
let boundariesNode = null;
|
|
54
|
+
// First pass: find schema and boundaries variable declarations
|
|
55
|
+
function findVariables(node) {
|
|
56
|
+
if (ts.isVariableStatement(node)) {
|
|
57
|
+
node.declarationList.declarations.forEach(decl => {
|
|
58
|
+
if (ts.isIdentifier(decl.name)) {
|
|
59
|
+
if (decl.name.text === 'schema' && decl.initializer) {
|
|
60
|
+
schemaNode = decl.initializer;
|
|
61
|
+
}
|
|
62
|
+
else if (decl.name.text === 'boundaries' && decl.initializer) {
|
|
63
|
+
boundariesNode = decl.initializer;
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
});
|
|
67
|
+
}
|
|
68
|
+
ts.forEachChild(node, findVariables);
|
|
69
|
+
}
|
|
70
|
+
// Second pass: find createTask calls
|
|
71
|
+
function findCreateTask(node) {
|
|
72
|
+
// Look for createTask calls
|
|
73
|
+
if (ts.isCallExpression(node) &&
|
|
74
|
+
ts.isIdentifier(node.expression) &&
|
|
75
|
+
node.expression.text === 'createTask') {
|
|
76
|
+
const taskName = extractTaskName(node, sourceFile);
|
|
77
|
+
if (taskName) {
|
|
78
|
+
const fingerprint = analyzeCreateTaskCall(node, sourceFile, filePath, taskName, schemaNode, boundariesNode);
|
|
79
|
+
if (fingerprint) {
|
|
80
|
+
fingerprints.push(fingerprint);
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
// Look for exported createTask assignments
|
|
85
|
+
if (ts.isVariableStatement(node) && node.modifiers?.some(m => m.kind === ts.SyntaxKind.ExportKeyword)) {
|
|
86
|
+
node.declarationList.declarations.forEach(decl => {
|
|
87
|
+
if (ts.isVariableDeclaration(decl) &&
|
|
88
|
+
decl.initializer &&
|
|
89
|
+
ts.isCallExpression(decl.initializer) &&
|
|
90
|
+
ts.isIdentifier(decl.initializer.expression) &&
|
|
91
|
+
decl.initializer.expression.text === 'createTask') {
|
|
92
|
+
const taskName = ts.isIdentifier(decl.name) ? decl.name.text : 'unknown';
|
|
93
|
+
const fingerprint = analyzeCreateTaskCall(decl.initializer, sourceFile, filePath, taskName, schemaNode, boundariesNode);
|
|
94
|
+
if (fingerprint) {
|
|
95
|
+
fingerprints.push(fingerprint);
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
});
|
|
99
|
+
}
|
|
100
|
+
ts.forEachChild(node, findCreateTask);
|
|
101
|
+
}
|
|
102
|
+
// Execute both passes
|
|
103
|
+
findVariables(sourceFile);
|
|
104
|
+
findCreateTask(sourceFile);
|
|
105
|
+
return fingerprints;
|
|
106
|
+
}
|
|
107
|
+
function extractTaskName(node, _sourceFile) {
|
|
108
|
+
// Try to find the task name from variable assignment or export
|
|
109
|
+
let parent = node.parent;
|
|
110
|
+
while (parent) {
|
|
111
|
+
if (ts.isVariableDeclaration(parent) && ts.isIdentifier(parent.name)) {
|
|
112
|
+
return parent.name.text;
|
|
113
|
+
}
|
|
114
|
+
parent = parent.parent;
|
|
115
|
+
}
|
|
116
|
+
return null;
|
|
117
|
+
}
|
|
118
|
+
function analyzeCreateTaskCall(node, sourceFile, filePath, taskName, schemaNode = null, boundariesNode = null) {
|
|
119
|
+
try {
|
|
120
|
+
const position = sourceFile.getLineAndCharacterOfPosition(node.getStart());
|
|
121
|
+
const args = node.arguments;
|
|
122
|
+
// Use pre-found schema or fall back to argument analysis
|
|
123
|
+
let inputSchema = { type: 'object', properties: {} };
|
|
124
|
+
if (schemaNode) {
|
|
125
|
+
inputSchema = analyzeSchemaArg(schemaNode, sourceFile);
|
|
126
|
+
}
|
|
127
|
+
else if (args[0]) {
|
|
128
|
+
inputSchema = analyzeSchemaArg(args[0], sourceFile);
|
|
129
|
+
}
|
|
130
|
+
// Use pre-found boundaries or fall back to argument analysis - simplified to just names
|
|
131
|
+
let boundaries = [];
|
|
132
|
+
if (boundariesNode) {
|
|
133
|
+
boundaries = analyzeBoundariesArg(boundariesNode, sourceFile);
|
|
134
|
+
}
|
|
135
|
+
else if (args[1]) {
|
|
136
|
+
boundaries = analyzeBoundariesArg(args[1], sourceFile);
|
|
137
|
+
}
|
|
138
|
+
// Extract function output type with better detection
|
|
139
|
+
let outputType = { type: 'unknown' };
|
|
140
|
+
const functionArg = args[2];
|
|
141
|
+
if (functionArg) {
|
|
142
|
+
if (ts.isFunctionExpression(functionArg) || ts.isArrowFunction(functionArg)) {
|
|
143
|
+
// Better return type extraction
|
|
144
|
+
if (functionArg.type) {
|
|
145
|
+
const typeString = cleanTypeString(functionArg.type.getText(sourceFile));
|
|
146
|
+
outputType = { type: typeString };
|
|
147
|
+
}
|
|
148
|
+
else {
|
|
149
|
+
// Try to infer from return statements with better object analysis
|
|
150
|
+
outputType = inferDetailedReturnType(functionArg, sourceFile);
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
// Generate hash from task signature
|
|
155
|
+
const hashInput = `${taskName}:${JSON.stringify(inputSchema)}:${JSON.stringify(boundaries)}`;
|
|
156
|
+
const hash = generateHash(hashInput);
|
|
157
|
+
return {
|
|
158
|
+
name: taskName,
|
|
159
|
+
location: {
|
|
160
|
+
file: filePath,
|
|
161
|
+
line: position.line + 1,
|
|
162
|
+
column: position.character + 1
|
|
163
|
+
},
|
|
164
|
+
inputSchema,
|
|
165
|
+
outputType,
|
|
166
|
+
boundaries,
|
|
167
|
+
hash
|
|
168
|
+
};
|
|
169
|
+
}
|
|
170
|
+
catch (error) {
|
|
171
|
+
console.warn(`Failed to analyze createTask call for ${taskName}:`, error);
|
|
172
|
+
return null;
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
// Enhanced return type inference with detailed object analysis
|
|
176
|
+
function inferDetailedReturnType(func, _sourceFile) {
|
|
177
|
+
let returnType = { type: 'unknown' };
|
|
178
|
+
function visitReturnStatements(node) {
|
|
179
|
+
if (ts.isReturnStatement(node) && node.expression) {
|
|
180
|
+
if (ts.isObjectLiteralExpression(node.expression)) {
|
|
181
|
+
// Analyze object literal properties
|
|
182
|
+
const properties = {};
|
|
183
|
+
node.expression.properties.forEach(prop => {
|
|
184
|
+
if (ts.isPropertyAssignment(prop) && ts.isIdentifier(prop.name)) {
|
|
185
|
+
// Handle explicit property assignments: { propName: value }
|
|
186
|
+
const propName = prop.name.text;
|
|
187
|
+
let propType = 'unknown';
|
|
188
|
+
// Try to infer property type from the initializer
|
|
189
|
+
if (ts.isStringLiteral(prop.initializer)) {
|
|
190
|
+
propType = 'string';
|
|
191
|
+
}
|
|
192
|
+
else if (ts.isNumericLiteral(prop.initializer)) {
|
|
193
|
+
propType = 'number';
|
|
194
|
+
}
|
|
195
|
+
else if (prop.initializer.kind === ts.SyntaxKind.TrueKeyword ||
|
|
196
|
+
prop.initializer.kind === ts.SyntaxKind.FalseKeyword) {
|
|
197
|
+
propType = 'boolean';
|
|
198
|
+
}
|
|
199
|
+
else if (ts.isIdentifier(prop.initializer)) {
|
|
200
|
+
// Variable reference - try to infer from name
|
|
201
|
+
const varName = prop.initializer.text;
|
|
202
|
+
propType = inferTypeFromVariableName(varName);
|
|
203
|
+
}
|
|
204
|
+
else if (ts.isPropertyAccessExpression(prop.initializer)) {
|
|
205
|
+
// Property access like response.handler
|
|
206
|
+
propType = 'unknown';
|
|
207
|
+
}
|
|
208
|
+
properties[propName] = { type: propType };
|
|
209
|
+
}
|
|
210
|
+
else if (ts.isShorthandPropertyAssignment(prop)) {
|
|
211
|
+
// Handle shorthand properties: { propName } (equivalent to { propName: propName })
|
|
212
|
+
const propName = prop.name.text;
|
|
213
|
+
const propType = inferTypeFromVariableName(propName);
|
|
214
|
+
properties[propName] = { type: propType };
|
|
215
|
+
}
|
|
216
|
+
});
|
|
217
|
+
if (Object.keys(properties).length > 0) {
|
|
218
|
+
returnType = {
|
|
219
|
+
type: 'object',
|
|
220
|
+
properties
|
|
221
|
+
};
|
|
222
|
+
}
|
|
223
|
+
else {
|
|
224
|
+
returnType = { type: 'object' };
|
|
225
|
+
}
|
|
226
|
+
}
|
|
227
|
+
else if (ts.isStringLiteral(node.expression)) {
|
|
228
|
+
returnType = { type: 'string' };
|
|
229
|
+
}
|
|
230
|
+
else if (ts.isNumericLiteral(node.expression)) {
|
|
231
|
+
returnType = { type: 'number' };
|
|
232
|
+
}
|
|
233
|
+
else if (node.expression.kind === ts.SyntaxKind.TrueKeyword ||
|
|
234
|
+
node.expression.kind === ts.SyntaxKind.FalseKeyword) {
|
|
235
|
+
returnType = { type: 'boolean' };
|
|
236
|
+
}
|
|
237
|
+
else if (ts.isIdentifier(node.expression)) {
|
|
238
|
+
// Single variable return
|
|
239
|
+
const varType = inferTypeFromVariableName(node.expression.text);
|
|
240
|
+
returnType = { type: varType };
|
|
241
|
+
}
|
|
242
|
+
}
|
|
243
|
+
ts.forEachChild(node, visitReturnStatements);
|
|
244
|
+
}
|
|
245
|
+
if (func.body) {
|
|
246
|
+
visitReturnStatements(func.body);
|
|
247
|
+
}
|
|
248
|
+
return returnType;
|
|
249
|
+
}
|
|
250
|
+
// Helper function to infer types from variable names
|
|
251
|
+
function inferTypeFromVariableName(varName) {
|
|
252
|
+
// Common patterns for type inference based on variable names
|
|
253
|
+
if (varName.includes('path') || varName.includes('Path') ||
|
|
254
|
+
varName.includes('name') || varName.includes('Name') ||
|
|
255
|
+
varName.includes('descriptor') || varName.includes('Descriptor') ||
|
|
256
|
+
varName.includes('fileName') || varName.includes('handler') ||
|
|
257
|
+
varName.includes('url') || varName.includes('id') ||
|
|
258
|
+
varName.includes('uuid') || varName.includes('token')) {
|
|
259
|
+
return 'string';
|
|
260
|
+
}
|
|
261
|
+
else if (varName.includes('count') || varName.includes('Count') ||
|
|
262
|
+
varName.includes('size') || varName.includes('Size') ||
|
|
263
|
+
varName.includes('length') || varName.includes('Length') ||
|
|
264
|
+
varName.includes('index') || varName.includes('Index')) {
|
|
265
|
+
return 'number';
|
|
266
|
+
}
|
|
267
|
+
else if (varName.includes('is') || varName.includes('has') ||
|
|
268
|
+
varName.includes('can') || varName.includes('should') ||
|
|
269
|
+
varName.includes('enabled') || varName.includes('success')) {
|
|
270
|
+
return 'boolean';
|
|
271
|
+
}
|
|
272
|
+
else if (varName.includes('config') || varName.includes('Config') ||
|
|
273
|
+
varName.includes('options') || varName.includes('Options') ||
|
|
274
|
+
varName.includes('data') || varName.includes('result') ||
|
|
275
|
+
varName.includes('response') || varName.includes('error')) {
|
|
276
|
+
return 'unknown';
|
|
277
|
+
}
|
|
278
|
+
return 'unknown';
|
|
279
|
+
}
|
|
280
|
+
// Clean up type strings (remove Promise wrappers for boundaries)
|
|
281
|
+
function cleanTypeString(typeString) {
|
|
282
|
+
// Remove Promise wrapper for boundary functions
|
|
283
|
+
const promiseMatch = typeString.match(/Promise<(.+)>/);
|
|
284
|
+
if (promiseMatch) {
|
|
285
|
+
return promiseMatch[1];
|
|
286
|
+
}
|
|
287
|
+
return typeString;
|
|
288
|
+
}
|
|
289
|
+
function analyzeSchemaArg(node, sourceFile) {
|
|
290
|
+
// Handle variable references (e.g., when schema is defined as const schema = ...)
|
|
291
|
+
if (ts.isIdentifier(node) && node.text === 'schema') {
|
|
292
|
+
// This case is now handled by pre-finding the schema node
|
|
293
|
+
return { type: 'object', properties: {} };
|
|
294
|
+
}
|
|
295
|
+
// Handle direct Schema constructor calls
|
|
296
|
+
if (ts.isNewExpression(node) && ts.isIdentifier(node.expression) && node.expression.text === 'Schema') {
|
|
297
|
+
const arg = node.arguments?.[0];
|
|
298
|
+
if (arg && ts.isObjectLiteralExpression(arg)) {
|
|
299
|
+
const properties = {};
|
|
300
|
+
arg.properties.forEach(prop => {
|
|
301
|
+
if (ts.isPropertyAssignment(prop) && ts.isIdentifier(prop.name)) {
|
|
302
|
+
const propName = prop.name.text;
|
|
303
|
+
const propValue = analyzeSchemaProp(prop.initializer, sourceFile);
|
|
304
|
+
properties[propName] = propValue;
|
|
305
|
+
}
|
|
306
|
+
});
|
|
307
|
+
return { type: 'object', properties };
|
|
308
|
+
}
|
|
309
|
+
}
|
|
310
|
+
return { type: 'object', properties: {} };
|
|
311
|
+
}
|
|
312
|
+
// Enhanced schema property analysis
|
|
313
|
+
function analyzeSchemaProp(node, _sourceFile) {
|
|
314
|
+
// Analyze Schema.string(), Schema.number(), etc.
|
|
315
|
+
if (ts.isCallExpression(node)) {
|
|
316
|
+
if (ts.isPropertyAccessExpression(node.expression) &&
|
|
317
|
+
ts.isIdentifier(node.expression.expression) &&
|
|
318
|
+
node.expression.expression.text === 'Schema') {
|
|
319
|
+
const methodName = node.expression.name.text;
|
|
320
|
+
let baseType = { type: getSchemaTypeFromMethod(methodName) };
|
|
321
|
+
// Check for chained methods like .optional() or .default()
|
|
322
|
+
let current = node;
|
|
323
|
+
while (current.parent && ts.isCallExpression(current.parent)) {
|
|
324
|
+
current = current.parent;
|
|
325
|
+
if (ts.isPropertyAccessExpression(current.expression)) {
|
|
326
|
+
const chainedMethod = current.expression.name.text;
|
|
327
|
+
if (chainedMethod === 'optional') {
|
|
328
|
+
baseType = { ...baseType, optional: true };
|
|
329
|
+
}
|
|
330
|
+
else if (chainedMethod === 'default' && current.arguments[0]) {
|
|
331
|
+
baseType = { ...baseType, default: current.arguments[0].getText() };
|
|
332
|
+
}
|
|
333
|
+
}
|
|
334
|
+
}
|
|
335
|
+
return baseType;
|
|
336
|
+
}
|
|
337
|
+
}
|
|
338
|
+
return { type: 'unknown' };
|
|
339
|
+
}
|
|
340
|
+
function getSchemaTypeFromMethod(methodName) {
|
|
341
|
+
const typeMap = {
|
|
342
|
+
string: 'string',
|
|
343
|
+
number: 'number',
|
|
344
|
+
boolean: 'boolean',
|
|
345
|
+
array: 'array',
|
|
346
|
+
object: 'object'
|
|
347
|
+
};
|
|
348
|
+
return typeMap[methodName] || 'unknown';
|
|
349
|
+
}
|
|
350
|
+
function analyzeBoundariesArg(node, _sourceFile) {
|
|
351
|
+
const boundaries = [];
|
|
352
|
+
// Handle variable references (e.g., when boundaries is defined as const boundaries = ...)
|
|
353
|
+
if (ts.isIdentifier(node) && node.text === 'boundaries') {
|
|
354
|
+
// This case is now handled by pre-finding the boundaries node
|
|
355
|
+
return [];
|
|
356
|
+
}
|
|
357
|
+
if (ts.isObjectLiteralExpression(node)) {
|
|
358
|
+
node.properties.forEach(prop => {
|
|
359
|
+
if (ts.isPropertyAssignment(prop) && ts.isIdentifier(prop.name)) {
|
|
360
|
+
const boundaryName = prop.name.text;
|
|
361
|
+
boundaries.push(boundaryName);
|
|
362
|
+
}
|
|
363
|
+
});
|
|
364
|
+
}
|
|
365
|
+
return boundaries;
|
|
366
|
+
}
|
|
367
|
+
// Export the core analysis function for reuse
|
|
368
|
+
function analyzeTaskFile(sourceCode, filePath, _expectedTaskName) {
|
|
369
|
+
const taskFingerprint = extractTaskFingerprints(sourceCode, filePath)[0];
|
|
370
|
+
if (!taskFingerprint) {
|
|
371
|
+
return null;
|
|
372
|
+
}
|
|
373
|
+
// Return simplified output without name, location, hash
|
|
374
|
+
return {
|
|
375
|
+
description: taskFingerprint.description,
|
|
376
|
+
inputSchema: taskFingerprint.inputSchema,
|
|
377
|
+
outputType: taskFingerprint.outputType,
|
|
378
|
+
boundaries: taskFingerprint.boundaries
|
|
379
|
+
};
|
|
380
|
+
}
|
package/forge.json
CHANGED
|
@@ -14,6 +14,10 @@
|
|
|
14
14
|
"bucket": ""
|
|
15
15
|
},
|
|
16
16
|
"tasks": {
|
|
17
|
+
"task:createTask": {
|
|
18
|
+
"path": "src/tasks/task/createTask.ts",
|
|
19
|
+
"handler": "createTask"
|
|
20
|
+
},
|
|
17
21
|
"bundle:create": {
|
|
18
22
|
"path": "src/tasks/bundle/create.ts",
|
|
19
23
|
"handler": "create"
|
|
@@ -97,6 +101,14 @@
|
|
|
97
101
|
"task:describe": {
|
|
98
102
|
"path": "src/tasks/task/describe.ts",
|
|
99
103
|
"handler": "describe"
|
|
104
|
+
},
|
|
105
|
+
"task:fingerprint": {
|
|
106
|
+
"path": "src/tasks/task/fingerprint.ts",
|
|
107
|
+
"handler": "fingerprint"
|
|
108
|
+
},
|
|
109
|
+
"bundle:fingerprint": {
|
|
110
|
+
"path": "src/tasks/bundle/fingerprint.ts",
|
|
111
|
+
"handler": "fingerprint"
|
|
100
112
|
}
|
|
101
113
|
},
|
|
102
114
|
"runners": {}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
{"name":"task:fingerprint","type":"success","input":{"descriptorName":"task:download"},"output":{"taskName":"download","fingerprint":{"name":"download","location":{"file":"/Users/danielzavaladlvega/forgehive/forge-mono-repo/apps/cli/src/tasks/task/download.ts","line":93,"column":25},"inputSchema":{"type":"object","properties":{"descriptorName":{"type":"string"},"uuid":{"type":"string"}}},"outputType":{"type":"object","properties":{"taskPath":{"type":"string"},"fileName":{"type":"string"},"descriptor":{"type":"string"},"handler":{"type":"any"}}},"boundaries":{"loadCurrentProfile":{"inputTypes":["any"],"outputType":"any"},"downloadTask":{"inputTypes":["uuid: string","profile: Profile"],"outputType":"any"},"loadConf":{"inputTypes":["any"],"outputType":"any"},"getCwd":{"inputTypes":[],"outputType":"string"},"parseTaskName":{"inputTypes":["taskDescriptor: string"],"outputType":"Promise<{\n descriptor: string\n taskName: string\n fileName: string\n dir?: string\n }>"},"persistTask":{"inputTypes":["dir: string","fileName: string","content: string","cwd: string"],"outputType":"{ path: string }"},"persistConf":{"inputTypes":["forge: ForgeConf","cwd: string"],"outputType":"void"},"checkTaskExists":{"inputTypes":["dir: string","fileName: string"],"outputType":"boolean"}},"hash":"dbhx5s"},"fingerprintFile":"/Users/danielzavaladlvega/.forge/task:download.task-fingerprint.json","hash":"dbhx5s","analysis":{"inputSchemaProps":["descriptorName","uuid"],"boundaryCount":8,"hasDescription":false,"outputType":"object"}},"boundaries":{"getCwd":[{"input":[],"output":"/Users/danielzavaladlvega/forgehive/forge-mono-repo/apps/cli","error":null}],"loadConf":[{"input":[{}],"output":{"project":{"name":"forge-cli"},"paths":{"logs":"logs/","fixtures":"fixtures","tasks":"src/tasks/","runners":"src/runners/","tests":"src/tests/"},"infra":{"region":"us-west-2","bucket":""},"tasks":{"bundle:create":{"path":"src/tasks/bundle/create.ts","handler":"create"},"bundle:load":{"path":"src/tasks/bundle/load.ts","handler":"load"},"task:run":{"path":"src/tasks/task/run.ts","handler":"run"},"task:remove":{"path":"src/tasks/task/remove.ts","handler":"remove"},"conf:info":{"path":"src/tasks/conf/info.ts","handler":"info"},"runner:create":{"path":"src/tasks/runner/create.ts","handler":"create"},"runner:remove":{"path":"src/tasks/runner/remove.ts","handler":"remove"},"runner:bundle":{"path":"src/tasks/runner/bundle.ts","handler":"bundle"},"task:publish":{"path":"src/tasks/task/publish.ts","handler":"publish"},"task:download":{"path":"src/tasks/task/download.ts","handler":"download"},"auth:add":{"path":"src/tasks/auth/add.ts","handler":"add"},"auth:load":{"path":"src/tasks/auth/load.ts","handler":"load"},"auth:loadCurrent":{"path":"src/tasks/auth/loadCurrent.ts","handler":"loadCurrent"},"auth:switch":{"path":"src/tasks/auth/switch.ts","handler":"switchProfile"},"auth:list":{"path":"src/tasks/auth/list.ts","handler":"list"},"auth:remove":{"path":"src/tasks/auth/remove.ts","handler":"remove"},"task:replay":{"path":"src/tasks/task/replay.ts","handler":"replay"},"fixture:download":{"path":"src/tasks/fixture/download.ts","handler":"download"},"bundle:zip":{"path":"src/tasks/bundle/zip.ts","handler":"zip"},"task:list":{"path":"src/tasks/task/list.ts","handler":"list"},"task:describe":{"path":"src/tasks/task/describe.ts","handler":"describe"},"task:fingerprint":{"path":"src/tasks/task/fingerprint.ts","handler":"fingerprint"},"bundle:fingerprint":{"path":"src/tasks/bundle/fingerprint.ts","handler":"fingerprint"}},"runners":{}},"error":null}],"readFile":[{"input":["/Users/danielzavaladlvega/forgehive/forge-mono-repo/apps/cli/src/tasks/task/download.ts"],"output":"// TASK: download\n// Run this task with:\n// forge task:run task:download --descriptorName [name] --uuid [task-uuid]\n\nimport { createTask } from '@forgehive/task'\nimport { Schema } from '@forgehive/schema'\nimport axios from 'axios'\nimport path from 'path'\nimport fs from 'fs/promises'\nimport { camelCase } from '../../utils/camelCase'\nimport { load as loadConf } from '../conf/load'\nimport { loadCurrent as loadCurrentProfile } from '../auth/loadCurrent'\nimport { Profile, type ForgeConf } from '../types'\n\nconst schema = new Schema({\n descriptorName: Schema.string(),\n uuid: Schema.string()\n})\n\nconst boundaries = {\n loadCurrentProfile: loadCurrentProfile.asBoundary(),\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n downloadTask: async (uuid: string, profile: Profile): Promise<any> => {\n const downloadUrl = `${profile.url}/api/tasks/download`\n\n console.log(`Downloading task from ${downloadUrl}...`)\n\n const authToken = `${profile.apiKey}:${profile.apiSecret}`\n const response = await axios.post(downloadUrl, { uuid }, {\n headers: {\n Authorization: `Bearer ${authToken}`,\n 'Content-Type': 'application/json'\n }\n })\n\n return response.data\n },\n loadConf: loadConf.asBoundary(),\n getCwd: async (): Promise<string> => {\n return process.cwd()\n },\n parseTaskName: async (taskDescriptor: string): Promise<{\n descriptor: string\n taskName: string\n fileName: string\n dir?: string\n }> => {\n const res: string[] = taskDescriptor.split(':')\n\n if (res.length === 1) {\n return {\n descriptor: `${camelCase(res[0])}`,\n taskName: `${camelCase(res[0])}`,\n fileName: `${camelCase(res[0])}.ts`\n }\n }\n\n return {\n dir: res[0],\n descriptor: `${res[0]}:${camelCase(res[1])}`,\n taskName: `${camelCase(res[1])}`,\n fileName: `${camelCase(res[1])}.ts`\n }\n },\n persistTask: async (dir: string, fileName: string, content: string, cwd: string): Promise<{ path: string }> => {\n const dirPath = path.resolve(cwd, dir)\n const taskPath = path.resolve(dirPath, fileName)\n\n await fs.mkdir(dirPath, { recursive: true })\n await fs.writeFile(taskPath, content, 'utf-8')\n\n\n return {\n path: taskPath.toString()\n }\n },\n persistConf: async (forge: ForgeConf, cwd: string): Promise<void> => {\n const forgePath = path.join(cwd, 'forge.json')\n await fs.writeFile(forgePath, JSON.stringify(forge, null, 2))\n },\n checkTaskExists: async (dir: string, fileName: string): Promise<boolean> => {\n const taskPath = path.resolve(dir, fileName)\n\n try {\n await fs.access(taskPath)\n return true\n } catch {\n return false\n }\n }\n}\n\nexport const download = createTask(\n schema,\n boundaries,\n async function ({ descriptorName, uuid }, {\n downloadTask,\n getCwd,\n parseTaskName,\n persistTask,\n loadConf,\n persistConf,\n checkTaskExists,\n loadCurrentProfile\n }) {\n console.log(`Attempting to download task with descriptor: ${descriptorName} and uuid: ${uuid}`)\n\n // Parse descriptor name to get task details\n const { taskName, fileName, descriptor, dir } = await parseTaskName(descriptorName)\n const profile = await loadCurrentProfile({})\n const cwd = await getCwd()\n const forge = await loadConf({})\n\n let taskPath: string = forge.paths.tasks\n\n if (dir !== undefined) {\n taskPath = path.join(taskPath, dir)\n }\n\n // Check if task already exists\n const taskExists = await checkTaskExists(taskPath, fileName)\n if (taskExists) {\n console.log(`Task ${descriptor} already exists at ${taskPath}/${fileName}`)\n return {\n error: 'Task already exists',\n taskPath: `${taskPath}/${fileName}`,\n descriptor\n }\n }\n\n // Download from hive api server\n let response\n try {\n response = await downloadTask(uuid, profile)\n } catch (e: unknown) {\n const error = e as { status: number, message: string }\n console.error('Error downloading task:', error.message, error.status)\n\n if (error.status === 404) {\n return {\n error: 'Task not found',\n taskPath: `${taskPath}/${fileName}`,\n descriptor\n }\n }\n\n return {\n error: 'Failed to download task',\n message: error.message,\n taskPath: `${taskPath}/${fileName}`,\n descriptor\n }\n }\n\n console.log(`\n ==================================================\n Starting task download!\n Creating: ${taskName}\n Dir: ${dir ?? ''}\n Into: ${taskPath}\n ==================================================\n `)\n\n console.log('Writing task file:', taskPath, fileName)\n console.log('Handler:', response.handler)\n console.log('Source code:', response.sourceCode)\n\n // Persist task with cwd\n await persistTask(taskPath, fileName, response.sourceCode, cwd)\n\n // Update forge.json with the new task\n if (forge.tasks === undefined) {\n forge.tasks = {}\n }\n\n forge.tasks[descriptor] = {\n path: `${taskPath}/${fileName}`,\n handler: response.handler\n }\n\n console.log('Forge:', forge)\n\n await persistConf(forge, cwd)\n\n return {\n taskPath,\n fileName,\n descriptor,\n handler: response.handler\n }\n }\n)\n","error":null}],"writeFile":[{"input":["/Users/danielzavaladlvega/.forge/task:download.task-fingerprint.json","{\n \"taskFingerprint\": {\n \"name\": \"download\",\n \"location\": {\n \"file\": \"/Users/danielzavaladlvega/forgehive/forge-mono-repo/apps/cli/src/tasks/task/download.ts\",\n \"line\": 93,\n \"column\": 25\n },\n \"inputSchema\": {\n \"type\": \"object\",\n \"properties\": {\n \"descriptorName\": {\n \"type\": \"string\"\n },\n \"uuid\": {\n \"type\": \"string\"\n }\n }\n },\n \"outputType\": {\n \"type\": \"object\",\n \"properties\": {\n \"taskPath\": {\n \"type\": \"string\"\n },\n \"fileName\": {\n \"type\": \"string\"\n },\n \"descriptor\": {\n \"type\": \"string\"\n },\n \"handler\": {\n \"type\": \"any\"\n }\n }\n },\n \"boundaries\": {\n \"loadCurrentProfile\": {\n \"inputTypes\": [\n \"any\"\n ],\n \"outputType\": \"any\"\n },\n \"downloadTask\": {\n \"inputTypes\": [\n \"uuid: string\",\n \"profile: Profile\"\n ],\n \"outputType\": \"any\"\n },\n \"loadConf\": {\n \"inputTypes\": [\n \"any\"\n ],\n \"outputType\": \"any\"\n },\n \"getCwd\": {\n \"inputTypes\": [],\n \"outputType\": \"string\"\n },\n \"parseTaskName\": {\n \"inputTypes\": [\n \"taskDescriptor: string\"\n ],\n \"outputType\": \"Promise<{\\n descriptor: string\\n taskName: string\\n fileName: string\\n dir?: string\\n }>\"\n },\n \"persistTask\": {\n \"inputTypes\": [\n \"dir: string\",\n \"fileName: string\",\n \"content: string\",\n \"cwd: string\"\n ],\n \"outputType\": \"{ path: string }\"\n },\n \"persistConf\": {\n \"inputTypes\": [\n \"forge: ForgeConf\",\n \"cwd: string\"\n ],\n \"outputType\": \"void\"\n },\n \"checkTaskExists\": {\n \"inputTypes\": [\n \"dir: string\",\n \"fileName: string\"\n ],\n \"outputType\": \"boolean\"\n }\n },\n \"hash\": \"dbhx5s\"\n }\n}"],"output":null,"error":null}],"ensureForgeFolder":[{"input":[],"output":"/Users/danielzavaladlvega/.forge","error":null}]},"context":{"environment":"cli"}}
|
|
2
|
+
{"name":"task:fingerprint","type":"success","input":{"descriptorName":"task:download"},"output":{"taskName":"download","fingerprint":{"name":"download","location":{"file":"/Users/danielzavaladlvega/forgehive/forge-mono-repo/apps/cli/src/tasks/task/download.ts","line":93,"column":25},"inputSchema":{"type":"object","properties":{"descriptorName":{"type":"string"},"uuid":{"type":"string"}}},"outputType":{"type":"object","properties":{"taskPath":{"type":"string"},"fileName":{"type":"string"},"descriptor":{"type":"string"},"handler":{"type":"any"}}},"boundaries":["loadCurrentProfile","downloadTask","loadConf","getCwd","parseTaskName","persistTask","persistConf","checkTaskExists"],"hash":"8f8oel"},"fingerprintFile":"/Users/danielzavaladlvega/.forge/task:download.task-fingerprint.json","hash":"8f8oel","analysis":{"inputSchemaProps":["descriptorName","uuid"],"boundaryCount":8,"hasDescription":false,"outputType":"object"}},"boundaries":{"getCwd":[{"input":[],"output":"/Users/danielzavaladlvega/forgehive/forge-mono-repo/apps/cli","error":null}],"loadConf":[{"input":[{}],"output":{"project":{"name":"forge-cli"},"paths":{"logs":"logs/","fixtures":"fixtures","tasks":"src/tasks/","runners":"src/runners/","tests":"src/tests/"},"infra":{"region":"us-west-2","bucket":""},"tasks":{"bundle:create":{"path":"src/tasks/bundle/create.ts","handler":"create"},"bundle:load":{"path":"src/tasks/bundle/load.ts","handler":"load"},"task:run":{"path":"src/tasks/task/run.ts","handler":"run"},"task:remove":{"path":"src/tasks/task/remove.ts","handler":"remove"},"conf:info":{"path":"src/tasks/conf/info.ts","handler":"info"},"runner:create":{"path":"src/tasks/runner/create.ts","handler":"create"},"runner:remove":{"path":"src/tasks/runner/remove.ts","handler":"remove"},"runner:bundle":{"path":"src/tasks/runner/bundle.ts","handler":"bundle"},"task:publish":{"path":"src/tasks/task/publish.ts","handler":"publish"},"task:download":{"path":"src/tasks/task/download.ts","handler":"download"},"auth:add":{"path":"src/tasks/auth/add.ts","handler":"add"},"auth:load":{"path":"src/tasks/auth/load.ts","handler":"load"},"auth:loadCurrent":{"path":"src/tasks/auth/loadCurrent.ts","handler":"loadCurrent"},"auth:switch":{"path":"src/tasks/auth/switch.ts","handler":"switchProfile"},"auth:list":{"path":"src/tasks/auth/list.ts","handler":"list"},"auth:remove":{"path":"src/tasks/auth/remove.ts","handler":"remove"},"task:replay":{"path":"src/tasks/task/replay.ts","handler":"replay"},"fixture:download":{"path":"src/tasks/fixture/download.ts","handler":"download"},"bundle:zip":{"path":"src/tasks/bundle/zip.ts","handler":"zip"},"task:list":{"path":"src/tasks/task/list.ts","handler":"list"},"task:describe":{"path":"src/tasks/task/describe.ts","handler":"describe"},"task:fingerprint":{"path":"src/tasks/task/fingerprint.ts","handler":"fingerprint"},"bundle:fingerprint":{"path":"src/tasks/bundle/fingerprint.ts","handler":"fingerprint"}},"runners":{}},"error":null}],"readFile":[{"input":["/Users/danielzavaladlvega/forgehive/forge-mono-repo/apps/cli/src/tasks/task/download.ts"],"output":"// TASK: download\n// Run this task with:\n// forge task:run task:download --descriptorName [name] --uuid [task-uuid]\n\nimport { createTask } from '@forgehive/task'\nimport { Schema } from '@forgehive/schema'\nimport axios from 'axios'\nimport path from 'path'\nimport fs from 'fs/promises'\nimport { camelCase } from '../../utils/camelCase'\nimport { load as loadConf } from '../conf/load'\nimport { loadCurrent as loadCurrentProfile } from '../auth/loadCurrent'\nimport { Profile, type ForgeConf } from '../types'\n\nconst schema = new Schema({\n descriptorName: Schema.string(),\n uuid: Schema.string()\n})\n\nconst boundaries = {\n loadCurrentProfile: loadCurrentProfile.asBoundary(),\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n downloadTask: async (uuid: string, profile: Profile): Promise<any> => {\n const downloadUrl = `${profile.url}/api/tasks/download`\n\n console.log(`Downloading task from ${downloadUrl}...`)\n\n const authToken = `${profile.apiKey}:${profile.apiSecret}`\n const response = await axios.post(downloadUrl, { uuid }, {\n headers: {\n Authorization: `Bearer ${authToken}`,\n 'Content-Type': 'application/json'\n }\n })\n\n return response.data\n },\n loadConf: loadConf.asBoundary(),\n getCwd: async (): Promise<string> => {\n return process.cwd()\n },\n parseTaskName: async (taskDescriptor: string): Promise<{\n descriptor: string\n taskName: string\n fileName: string\n dir?: string\n }> => {\n const res: string[] = taskDescriptor.split(':')\n\n if (res.length === 1) {\n return {\n descriptor: `${camelCase(res[0])}`,\n taskName: `${camelCase(res[0])}`,\n fileName: `${camelCase(res[0])}.ts`\n }\n }\n\n return {\n dir: res[0],\n descriptor: `${res[0]}:${camelCase(res[1])}`,\n taskName: `${camelCase(res[1])}`,\n fileName: `${camelCase(res[1])}.ts`\n }\n },\n persistTask: async (dir: string, fileName: string, content: string, cwd: string): Promise<{ path: string }> => {\n const dirPath = path.resolve(cwd, dir)\n const taskPath = path.resolve(dirPath, fileName)\n\n await fs.mkdir(dirPath, { recursive: true })\n await fs.writeFile(taskPath, content, 'utf-8')\n\n\n return {\n path: taskPath.toString()\n }\n },\n persistConf: async (forge: ForgeConf, cwd: string): Promise<void> => {\n const forgePath = path.join(cwd, 'forge.json')\n await fs.writeFile(forgePath, JSON.stringify(forge, null, 2))\n },\n checkTaskExists: async (dir: string, fileName: string): Promise<boolean> => {\n const taskPath = path.resolve(dir, fileName)\n\n try {\n await fs.access(taskPath)\n return true\n } catch {\n return false\n }\n }\n}\n\nexport const download = createTask(\n schema,\n boundaries,\n async function ({ descriptorName, uuid }, {\n downloadTask,\n getCwd,\n parseTaskName,\n persistTask,\n loadConf,\n persistConf,\n checkTaskExists,\n loadCurrentProfile\n }) {\n console.log(`Attempting to download task with descriptor: ${descriptorName} and uuid: ${uuid}`)\n\n // Parse descriptor name to get task details\n const { taskName, fileName, descriptor, dir } = await parseTaskName(descriptorName)\n const profile = await loadCurrentProfile({})\n const cwd = await getCwd()\n const forge = await loadConf({})\n\n let taskPath: string = forge.paths.tasks\n\n if (dir !== undefined) {\n taskPath = path.join(taskPath, dir)\n }\n\n // Check if task already exists\n const taskExists = await checkTaskExists(taskPath, fileName)\n if (taskExists) {\n console.log(`Task ${descriptor} already exists at ${taskPath}/${fileName}`)\n return {\n error: 'Task already exists',\n taskPath: `${taskPath}/${fileName}`,\n descriptor\n }\n }\n\n // Download from hive api server\n let response\n try {\n response = await downloadTask(uuid, profile)\n } catch (e: unknown) {\n const error = e as { status: number, message: string }\n console.error('Error downloading task:', error.message, error.status)\n\n if (error.status === 404) {\n return {\n error: 'Task not found',\n taskPath: `${taskPath}/${fileName}`,\n descriptor\n }\n }\n\n return {\n error: 'Failed to download task',\n message: error.message,\n taskPath: `${taskPath}/${fileName}`,\n descriptor\n }\n }\n\n console.log(`\n ==================================================\n Starting task download!\n Creating: ${taskName}\n Dir: ${dir ?? ''}\n Into: ${taskPath}\n ==================================================\n `)\n\n console.log('Writing task file:', taskPath, fileName)\n console.log('Handler:', response.handler)\n console.log('Source code:', response.sourceCode)\n\n // Persist task with cwd\n await persistTask(taskPath, fileName, response.sourceCode, cwd)\n\n // Update forge.json with the new task\n if (forge.tasks === undefined) {\n forge.tasks = {}\n }\n\n forge.tasks[descriptor] = {\n path: `${taskPath}/${fileName}`,\n handler: response.handler\n }\n\n console.log('Forge:', forge)\n\n await persistConf(forge, cwd)\n\n return {\n taskPath,\n fileName,\n descriptor,\n handler: response.handler\n }\n }\n)\n","error":null}],"writeFile":[{"input":["/Users/danielzavaladlvega/.forge/task:download.task-fingerprint.json","{\n \"taskFingerprint\": {\n \"name\": \"download\",\n \"location\": {\n \"file\": \"/Users/danielzavaladlvega/forgehive/forge-mono-repo/apps/cli/src/tasks/task/download.ts\",\n \"line\": 93,\n \"column\": 25\n },\n \"inputSchema\": {\n \"type\": \"object\",\n \"properties\": {\n \"descriptorName\": {\n \"type\": \"string\"\n },\n \"uuid\": {\n \"type\": \"string\"\n }\n }\n },\n \"outputType\": {\n \"type\": \"object\",\n \"properties\": {\n \"taskPath\": {\n \"type\": \"string\"\n },\n \"fileName\": {\n \"type\": \"string\"\n },\n \"descriptor\": {\n \"type\": \"string\"\n },\n \"handler\": {\n \"type\": \"any\"\n }\n }\n },\n \"boundaries\": [\n \"loadCurrentProfile\",\n \"downloadTask\",\n \"loadConf\",\n \"getCwd\",\n \"parseTaskName\",\n \"persistTask\",\n \"persistConf\",\n \"checkTaskExists\"\n ],\n \"hash\": \"8f8oel\"\n }\n}"],"output":null,"error":null}],"ensureForgeFolder":[{"input":[],"output":"/Users/danielzavaladlvega/.forge","error":null}]},"context":{"environment":"cli"}}
|
|
3
|
+
{"name":"task:fingerprint","type":"success","input":{"descriptorName":"task:download"},"output":{"taskName":"download","fingerprint":{"inputSchema":{"type":"object","properties":{"descriptorName":{"type":"string"},"uuid":{"type":"string"}}},"outputType":{"type":"object","properties":{"taskPath":{"type":"string"},"fileName":{"type":"string"},"descriptor":{"type":"string"},"handler":{"type":"any"}}},"boundaries":["loadCurrentProfile","downloadTask","loadConf","getCwd","parseTaskName","persistTask","persistConf","checkTaskExists"]},"fingerprintFile":"/Users/danielzavaladlvega/.forge/task:download.task-fingerprint.json","hash":"8f8oel","analysis":{"inputSchemaProps":["descriptorName","uuid"],"boundaryCount":8,"hasDescription":false,"outputType":"object"}},"boundaries":{"getCwd":[{"input":[],"output":"/Users/danielzavaladlvega/forgehive/forge-mono-repo/apps/cli","error":null}],"loadConf":[{"input":[{}],"output":{"project":{"name":"forge-cli"},"paths":{"logs":"logs/","fixtures":"fixtures","tasks":"src/tasks/","runners":"src/runners/","tests":"src/tests/"},"infra":{"region":"us-west-2","bucket":""},"tasks":{"bundle:create":{"path":"src/tasks/bundle/create.ts","handler":"create"},"bundle:load":{"path":"src/tasks/bundle/load.ts","handler":"load"},"task:run":{"path":"src/tasks/task/run.ts","handler":"run"},"task:remove":{"path":"src/tasks/task/remove.ts","handler":"remove"},"conf:info":{"path":"src/tasks/conf/info.ts","handler":"info"},"runner:create":{"path":"src/tasks/runner/create.ts","handler":"create"},"runner:remove":{"path":"src/tasks/runner/remove.ts","handler":"remove"},"runner:bundle":{"path":"src/tasks/runner/bundle.ts","handler":"bundle"},"task:publish":{"path":"src/tasks/task/publish.ts","handler":"publish"},"task:download":{"path":"src/tasks/task/download.ts","handler":"download"},"auth:add":{"path":"src/tasks/auth/add.ts","handler":"add"},"auth:load":{"path":"src/tasks/auth/load.ts","handler":"load"},"auth:loadCurrent":{"path":"src/tasks/auth/loadCurrent.ts","handler":"loadCurrent"},"auth:switch":{"path":"src/tasks/auth/switch.ts","handler":"switchProfile"},"auth:list":{"path":"src/tasks/auth/list.ts","handler":"list"},"auth:remove":{"path":"src/tasks/auth/remove.ts","handler":"remove"},"task:replay":{"path":"src/tasks/task/replay.ts","handler":"replay"},"fixture:download":{"path":"src/tasks/fixture/download.ts","handler":"download"},"bundle:zip":{"path":"src/tasks/bundle/zip.ts","handler":"zip"},"task:list":{"path":"src/tasks/task/list.ts","handler":"list"},"task:describe":{"path":"src/tasks/task/describe.ts","handler":"describe"},"task:fingerprint":{"path":"src/tasks/task/fingerprint.ts","handler":"fingerprint"},"bundle:fingerprint":{"path":"src/tasks/bundle/fingerprint.ts","handler":"fingerprint"}},"runners":{}},"error":null}],"readFile":[{"input":["/Users/danielzavaladlvega/forgehive/forge-mono-repo/apps/cli/src/tasks/task/download.ts"],"output":"// TASK: download\n// Run this task with:\n// forge task:run task:download --descriptorName [name] --uuid [task-uuid]\n\nimport { createTask } from '@forgehive/task'\nimport { Schema } from '@forgehive/schema'\nimport axios from 'axios'\nimport path from 'path'\nimport fs from 'fs/promises'\nimport { camelCase } from '../../utils/camelCase'\nimport { load as loadConf } from '../conf/load'\nimport { loadCurrent as loadCurrentProfile } from '../auth/loadCurrent'\nimport { Profile, type ForgeConf } from '../types'\n\nconst schema = new Schema({\n descriptorName: Schema.string(),\n uuid: Schema.string()\n})\n\nconst boundaries = {\n loadCurrentProfile: loadCurrentProfile.asBoundary(),\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n downloadTask: async (uuid: string, profile: Profile): Promise<any> => {\n const downloadUrl = `${profile.url}/api/tasks/download`\n\n console.log(`Downloading task from ${downloadUrl}...`)\n\n const authToken = `${profile.apiKey}:${profile.apiSecret}`\n const response = await axios.post(downloadUrl, { uuid }, {\n headers: {\n Authorization: `Bearer ${authToken}`,\n 'Content-Type': 'application/json'\n }\n })\n\n return response.data\n },\n loadConf: loadConf.asBoundary(),\n getCwd: async (): Promise<string> => {\n return process.cwd()\n },\n parseTaskName: async (taskDescriptor: string): Promise<{\n descriptor: string\n taskName: string\n fileName: string\n dir?: string\n }> => {\n const res: string[] = taskDescriptor.split(':')\n\n if (res.length === 1) {\n return {\n descriptor: `${camelCase(res[0])}`,\n taskName: `${camelCase(res[0])}`,\n fileName: `${camelCase(res[0])}.ts`\n }\n }\n\n return {\n dir: res[0],\n descriptor: `${res[0]}:${camelCase(res[1])}`,\n taskName: `${camelCase(res[1])}`,\n fileName: `${camelCase(res[1])}.ts`\n }\n },\n persistTask: async (dir: string, fileName: string, content: string, cwd: string): Promise<{ path: string }> => {\n const dirPath = path.resolve(cwd, dir)\n const taskPath = path.resolve(dirPath, fileName)\n\n await fs.mkdir(dirPath, { recursive: true })\n await fs.writeFile(taskPath, content, 'utf-8')\n\n\n return {\n path: taskPath.toString()\n }\n },\n persistConf: async (forge: ForgeConf, cwd: string): Promise<void> => {\n const forgePath = path.join(cwd, 'forge.json')\n await fs.writeFile(forgePath, JSON.stringify(forge, null, 2))\n },\n checkTaskExists: async (dir: string, fileName: string): Promise<boolean> => {\n const taskPath = path.resolve(dir, fileName)\n\n try {\n await fs.access(taskPath)\n return true\n } catch {\n return false\n }\n }\n}\n\nexport const download = createTask(\n schema,\n boundaries,\n async function ({ descriptorName, uuid }, {\n downloadTask,\n getCwd,\n parseTaskName,\n persistTask,\n loadConf,\n persistConf,\n checkTaskExists,\n loadCurrentProfile\n }) {\n console.log(`Attempting to download task with descriptor: ${descriptorName} and uuid: ${uuid}`)\n\n // Parse descriptor name to get task details\n const { taskName, fileName, descriptor, dir } = await parseTaskName(descriptorName)\n const profile = await loadCurrentProfile({})\n const cwd = await getCwd()\n const forge = await loadConf({})\n\n let taskPath: string = forge.paths.tasks\n\n if (dir !== undefined) {\n taskPath = path.join(taskPath, dir)\n }\n\n // Check if task already exists\n const taskExists = await checkTaskExists(taskPath, fileName)\n if (taskExists) {\n console.log(`Task ${descriptor} already exists at ${taskPath}/${fileName}`)\n return {\n error: 'Task already exists',\n taskPath: `${taskPath}/${fileName}`,\n descriptor\n }\n }\n\n // Download from hive api server\n let response\n try {\n response = await downloadTask(uuid, profile)\n } catch (e: unknown) {\n const error = e as { status: number, message: string }\n console.error('Error downloading task:', error.message, error.status)\n\n if (error.status === 404) {\n return {\n error: 'Task not found',\n taskPath: `${taskPath}/${fileName}`,\n descriptor\n }\n }\n\n return {\n error: 'Failed to download task',\n message: error.message,\n taskPath: `${taskPath}/${fileName}`,\n descriptor\n }\n }\n\n console.log(`\n ==================================================\n Starting task download!\n Creating: ${taskName}\n Dir: ${dir ?? ''}\n Into: ${taskPath}\n ==================================================\n `)\n\n console.log('Writing task file:', taskPath, fileName)\n console.log('Handler:', response.handler)\n console.log('Source code:', response.sourceCode)\n\n // Persist task with cwd\n await persistTask(taskPath, fileName, response.sourceCode, cwd)\n\n // Update forge.json with the new task\n if (forge.tasks === undefined) {\n forge.tasks = {}\n }\n\n forge.tasks[descriptor] = {\n path: `${taskPath}/${fileName}`,\n handler: response.handler\n }\n\n console.log('Forge:', forge)\n\n await persistConf(forge, cwd)\n\n return {\n taskPath,\n fileName,\n descriptor,\n handler: response.handler\n }\n }\n)\n","error":null}],"writeFile":[{"input":["/Users/danielzavaladlvega/.forge/task:download.task-fingerprint.json","{\n \"taskFingerprint\": {\n \"inputSchema\": {\n \"type\": \"object\",\n \"properties\": {\n \"descriptorName\": {\n \"type\": \"string\"\n },\n \"uuid\": {\n \"type\": \"string\"\n }\n }\n },\n \"outputType\": {\n \"type\": \"object\",\n \"properties\": {\n \"taskPath\": {\n \"type\": \"string\"\n },\n \"fileName\": {\n \"type\": \"string\"\n },\n \"descriptor\": {\n \"type\": \"string\"\n },\n \"handler\": {\n \"type\": \"any\"\n }\n }\n },\n \"boundaries\": [\n \"loadCurrentProfile\",\n \"downloadTask\",\n \"loadConf\",\n \"getCwd\",\n \"parseTaskName\",\n \"persistTask\",\n \"persistConf\",\n \"checkTaskExists\"\n ]\n }\n}"],"output":null,"error":null}],"ensureForgeFolder":[{"input":[],"output":"/Users/danielzavaladlvega/.forge","error":null}]},"context":{"environment":"cli"}}
|
|
4
|
+
{"name":"task:fingerprint","type":"error","input":{"descriptorName":"task:download"},"error":"Invalid input on: path: Required","boundaries":{"getCwd":[],"readFile":[],"writeFile":[],"ensureForgeFolder":[]},"context":{"environment":"cli"}}
|
|
5
|
+
{"name":"task:fingerprint","type":"error","input":{"descriptorName":"task:download"},"error":"Invalid input on: path: Required","boundaries":{"getCwd":[],"readFile":[],"writeFile":[],"ensureForgeFolder":[]},"context":{"environment":"cli"}}
|
|
6
|
+
{"name":"task:fingerprint","type":"success","input":{"descriptorName":"task:download"},"output":{"taskName":"task:download","fingerprint":{"inputSchema":{"type":"object","properties":{"descriptorName":{"type":"string"},"uuid":{"type":"string"}}},"outputType":{"type":"object","properties":{"taskPath":{"type":"string"},"fileName":{"type":"string"},"descriptor":{"type":"string"},"handler":{"type":"any"}}},"boundaries":["loadCurrentProfile","downloadTask","loadConf","getCwd","parseTaskName","persistTask","persistConf","checkTaskExists"]},"fingerprintFile":"/Users/danielzavaladlvega/.forge/task:download.task-fingerprint.json","analysis":{"inputSchemaProps":["descriptorName","uuid"],"boundaryCount":8,"hasDescription":false,"outputType":"object"}},"boundaries":{"getCwd":[{"input":[],"output":"/Users/danielzavaladlvega/forgehive/forge-mono-repo/apps/cli","error":null}],"loadConf":[{"input":[{}],"output":{"project":{"name":"forge-cli"},"paths":{"logs":"logs/","fixtures":"fixtures","tasks":"src/tasks/","runners":"src/runners/","tests":"src/tests/"},"infra":{"region":"us-west-2","bucket":""},"tasks":{"bundle:create":{"path":"src/tasks/bundle/create.ts","handler":"create"},"bundle:load":{"path":"src/tasks/bundle/load.ts","handler":"load"},"task:run":{"path":"src/tasks/task/run.ts","handler":"run"},"task:remove":{"path":"src/tasks/task/remove.ts","handler":"remove"},"conf:info":{"path":"src/tasks/conf/info.ts","handler":"info"},"runner:create":{"path":"src/tasks/runner/create.ts","handler":"create"},"runner:remove":{"path":"src/tasks/runner/remove.ts","handler":"remove"},"runner:bundle":{"path":"src/tasks/runner/bundle.ts","handler":"bundle"},"task:publish":{"path":"src/tasks/task/publish.ts","handler":"publish"},"task:download":{"path":"src/tasks/task/download.ts","handler":"download"},"auth:add":{"path":"src/tasks/auth/add.ts","handler":"add"},"auth:load":{"path":"src/tasks/auth/load.ts","handler":"load"},"auth:loadCurrent":{"path":"src/tasks/auth/loadCurrent.ts","handler":"loadCurrent"},"auth:switch":{"path":"src/tasks/auth/switch.ts","handler":"switchProfile"},"auth:list":{"path":"src/tasks/auth/list.ts","handler":"list"},"auth:remove":{"path":"src/tasks/auth/remove.ts","handler":"remove"},"task:replay":{"path":"src/tasks/task/replay.ts","handler":"replay"},"fixture:download":{"path":"src/tasks/fixture/download.ts","handler":"download"},"bundle:zip":{"path":"src/tasks/bundle/zip.ts","handler":"zip"},"task:list":{"path":"src/tasks/task/list.ts","handler":"list"},"task:describe":{"path":"src/tasks/task/describe.ts","handler":"describe"},"task:fingerprint":{"path":"src/tasks/task/fingerprint.ts","handler":"fingerprint"},"bundle:fingerprint":{"path":"src/tasks/bundle/fingerprint.ts","handler":"fingerprint"}},"runners":{}},"error":null}],"readFile":[{"input":["/Users/danielzavaladlvega/forgehive/forge-mono-repo/apps/cli/src/tasks/task/download.ts"],"output":"// TASK: download\n// Run this task with:\n// forge task:run task:download --descriptorName [name] --uuid [task-uuid]\n\nimport { createTask } from '@forgehive/task'\nimport { Schema } from '@forgehive/schema'\nimport axios from 'axios'\nimport path from 'path'\nimport fs from 'fs/promises'\nimport { camelCase } from '../../utils/camelCase'\nimport { load as loadConf } from '../conf/load'\nimport { loadCurrent as loadCurrentProfile } from '../auth/loadCurrent'\nimport { Profile, type ForgeConf } from '../types'\n\nconst schema = new Schema({\n descriptorName: Schema.string(),\n uuid: Schema.string()\n})\n\nconst boundaries = {\n loadCurrentProfile: loadCurrentProfile.asBoundary(),\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n downloadTask: async (uuid: string, profile: Profile): Promise<any> => {\n const downloadUrl = `${profile.url}/api/tasks/download`\n\n console.log(`Downloading task from ${downloadUrl}...`)\n\n const authToken = `${profile.apiKey}:${profile.apiSecret}`\n const response = await axios.post(downloadUrl, { uuid }, {\n headers: {\n Authorization: `Bearer ${authToken}`,\n 'Content-Type': 'application/json'\n }\n })\n\n return response.data\n },\n loadConf: loadConf.asBoundary(),\n getCwd: async (): Promise<string> => {\n return process.cwd()\n },\n parseTaskName: async (taskDescriptor: string): Promise<{\n descriptor: string\n taskName: string\n fileName: string\n dir?: string\n }> => {\n const res: string[] = taskDescriptor.split(':')\n\n if (res.length === 1) {\n return {\n descriptor: `${camelCase(res[0])}`,\n taskName: `${camelCase(res[0])}`,\n fileName: `${camelCase(res[0])}.ts`\n }\n }\n\n return {\n dir: res[0],\n descriptor: `${res[0]}:${camelCase(res[1])}`,\n taskName: `${camelCase(res[1])}`,\n fileName: `${camelCase(res[1])}.ts`\n }\n },\n persistTask: async (dir: string, fileName: string, content: string, cwd: string): Promise<{ path: string }> => {\n const dirPath = path.resolve(cwd, dir)\n const taskPath = path.resolve(dirPath, fileName)\n\n await fs.mkdir(dirPath, { recursive: true })\n await fs.writeFile(taskPath, content, 'utf-8')\n\n\n return {\n path: taskPath.toString()\n }\n },\n persistConf: async (forge: ForgeConf, cwd: string): Promise<void> => {\n const forgePath = path.join(cwd, 'forge.json')\n await fs.writeFile(forgePath, JSON.stringify(forge, null, 2))\n },\n checkTaskExists: async (dir: string, fileName: string): Promise<boolean> => {\n const taskPath = path.resolve(dir, fileName)\n\n try {\n await fs.access(taskPath)\n return true\n } catch {\n return false\n }\n }\n}\n\nexport const download = createTask(\n schema,\n boundaries,\n async function ({ descriptorName, uuid }, {\n downloadTask,\n getCwd,\n parseTaskName,\n persistTask,\n loadConf,\n persistConf,\n checkTaskExists,\n loadCurrentProfile\n }) {\n console.log(`Attempting to download task with descriptor: ${descriptorName} and uuid: ${uuid}`)\n\n // Parse descriptor name to get task details\n const { taskName, fileName, descriptor, dir } = await parseTaskName(descriptorName)\n const profile = await loadCurrentProfile({})\n const cwd = await getCwd()\n const forge = await loadConf({})\n\n let taskPath: string = forge.paths.tasks\n\n if (dir !== undefined) {\n taskPath = path.join(taskPath, dir)\n }\n\n // Check if task already exists\n const taskExists = await checkTaskExists(taskPath, fileName)\n if (taskExists) {\n console.log(`Task ${descriptor} already exists at ${taskPath}/${fileName}`)\n return {\n error: 'Task already exists',\n taskPath: `${taskPath}/${fileName}`,\n descriptor\n }\n }\n\n // Download from hive api server\n let response\n try {\n response = await downloadTask(uuid, profile)\n } catch (e: unknown) {\n const error = e as { status: number, message: string }\n console.error('Error downloading task:', error.message, error.status)\n\n if (error.status === 404) {\n return {\n error: 'Task not found',\n taskPath: `${taskPath}/${fileName}`,\n descriptor\n }\n }\n\n return {\n error: 'Failed to download task',\n message: error.message,\n taskPath: `${taskPath}/${fileName}`,\n descriptor\n }\n }\n\n console.log(`\n ==================================================\n Starting task download!\n Creating: ${taskName}\n Dir: ${dir ?? ''}\n Into: ${taskPath}\n ==================================================\n `)\n\n console.log('Writing task file:', taskPath, fileName)\n console.log('Handler:', response.handler)\n console.log('Source code:', response.sourceCode)\n\n // Persist task with cwd\n await persistTask(taskPath, fileName, response.sourceCode, cwd)\n\n // Update forge.json with the new task\n if (forge.tasks === undefined) {\n forge.tasks = {}\n }\n\n forge.tasks[descriptor] = {\n path: `${taskPath}/${fileName}`,\n handler: response.handler\n }\n\n console.log('Forge:', forge)\n\n await persistConf(forge, cwd)\n\n return {\n taskPath,\n fileName,\n descriptor,\n handler: response.handler\n }\n }\n)\n","error":null}],"writeFile":[{"input":["/Users/danielzavaladlvega/.forge/task:download.task-fingerprint.json","{\n \"taskFingerprint\": {\n \"inputSchema\": {\n \"type\": \"object\",\n \"properties\": {\n \"descriptorName\": {\n \"type\": \"string\"\n },\n \"uuid\": {\n \"type\": \"string\"\n }\n }\n },\n \"outputType\": {\n \"type\": \"object\",\n \"properties\": {\n \"taskPath\": {\n \"type\": \"string\"\n },\n \"fileName\": {\n \"type\": \"string\"\n },\n \"descriptor\": {\n \"type\": \"string\"\n },\n \"handler\": {\n \"type\": \"any\"\n }\n }\n },\n \"boundaries\": [\n \"loadCurrentProfile\",\n \"downloadTask\",\n \"loadConf\",\n \"getCwd\",\n \"parseTaskName\",\n \"persistTask\",\n \"persistConf\",\n \"checkTaskExists\"\n ]\n }\n}"],"output":null,"error":null}],"ensureForgeFolder":[{"input":[],"output":"/Users/danielzavaladlvega/.forge","error":null}]},"context":{"environment":"cli"}}
|
|
7
|
+
{"name":"task:fingerprint","type":"success","input":{"descriptorName":"task:run"},"output":{"taskName":"task:run","fingerprint":{"inputSchema":{"type":"object","properties":{"descriptorName":{"type":"string"},"args":{"type":"unknown"}}},"outputType":{"type":"any"},"boundaries":["loadConf","loadCurrentProfile","bundleCreate","bundleLoad","verifyLogFolder","ensureBuildsFolder","sendLogToAPI"]},"fingerprintFile":"/Users/danielzavaladlvega/.forge/task:run.task-fingerprint.json","analysis":{"inputSchemaProps":["descriptorName","args"],"boundaryCount":7,"hasDescription":false,"outputType":"any"}},"boundaries":{"getCwd":[{"input":[],"output":"/Users/danielzavaladlvega/forgehive/forge-mono-repo/apps/cli","error":null}],"loadConf":[{"input":[{}],"output":{"project":{"name":"forge-cli"},"paths":{"logs":"logs/","fixtures":"fixtures","tasks":"src/tasks/","runners":"src/runners/","tests":"src/tests/"},"infra":{"region":"us-west-2","bucket":""},"tasks":{"bundle:create":{"path":"src/tasks/bundle/create.ts","handler":"create"},"bundle:load":{"path":"src/tasks/bundle/load.ts","handler":"load"},"task:run":{"path":"src/tasks/task/run.ts","handler":"run"},"task:remove":{"path":"src/tasks/task/remove.ts","handler":"remove"},"conf:info":{"path":"src/tasks/conf/info.ts","handler":"info"},"runner:create":{"path":"src/tasks/runner/create.ts","handler":"create"},"runner:remove":{"path":"src/tasks/runner/remove.ts","handler":"remove"},"runner:bundle":{"path":"src/tasks/runner/bundle.ts","handler":"bundle"},"task:publish":{"path":"src/tasks/task/publish.ts","handler":"publish"},"task:download":{"path":"src/tasks/task/download.ts","handler":"download"},"auth:add":{"path":"src/tasks/auth/add.ts","handler":"add"},"auth:load":{"path":"src/tasks/auth/load.ts","handler":"load"},"auth:loadCurrent":{"path":"src/tasks/auth/loadCurrent.ts","handler":"loadCurrent"},"auth:switch":{"path":"src/tasks/auth/switch.ts","handler":"switchProfile"},"auth:list":{"path":"src/tasks/auth/list.ts","handler":"list"},"auth:remove":{"path":"src/tasks/auth/remove.ts","handler":"remove"},"task:replay":{"path":"src/tasks/task/replay.ts","handler":"replay"},"fixture:download":{"path":"src/tasks/fixture/download.ts","handler":"download"},"bundle:zip":{"path":"src/tasks/bundle/zip.ts","handler":"zip"},"task:list":{"path":"src/tasks/task/list.ts","handler":"list"},"task:describe":{"path":"src/tasks/task/describe.ts","handler":"describe"},"task:fingerprint":{"path":"src/tasks/task/fingerprint.ts","handler":"fingerprint"},"bundle:fingerprint":{"path":"src/tasks/bundle/fingerprint.ts","handler":"fingerprint"}},"runners":{}},"error":null}],"readFile":[{"input":["/Users/danielzavaladlvega/forgehive/forge-mono-repo/apps/cli/src/tasks/task/run.ts"],"output":"// TASK: run\n// Run this task with:\n// shadow-cli task:run\n\nimport path from 'path'\nimport fs from 'fs/promises'\nimport os from 'os'\nimport axios from 'axios'\n\nimport { createTask } from '@forgehive/task'\nimport { Schema } from '@forgehive/schema'\nimport { RecordTape } from '@forgehive/record-tape'\n\nimport { create as bundleCreate } from '../bundle/create'\nimport { load as bundleLoad } from '../bundle/load'\nimport { load as loadConf } from '../conf/load'\nimport { loadCurrent as loadCurrentProfile } from '../auth/loadCurrent'\nimport { type ForgeConf, type Profile } from '../types'\n\n// For now, we'll use a simple schema without the record type\n// TODO: Use Schema.record once it's properly built and available\nconst schema = new Schema({\n descriptorName: Schema.string(),\n args: Schema.mixedRecord()\n // args will be passed directly without schema validation for now\n})\n\nconst boundaries = {\n loadConf: loadConf.asBoundary(),\n loadCurrentProfile: loadCurrentProfile.asBoundary(),\n bundleCreate: bundleCreate.asBoundary(),\n bundleLoad: bundleLoad.asBoundary(),\n verifyLogFolder: async (logsPath: string): Promise<boolean> => {\n // return true if the folder exists\n try {\n await fs.access(logsPath)\n } catch (error) {\n return false\n }\n\n return true\n },\n ensureBuildsFolder: async (): Promise<string> => {\n const buildsPath = path.join(os.homedir(), '.forge', 'builds')\n try {\n await fs.access(buildsPath)\n } catch {\n await fs.mkdir(buildsPath, { recursive: true })\n }\n\n return buildsPath\n },\n sendLogToAPI: async (profile: Profile, projectName: string, taskName: string, logItem: unknown): Promise<boolean> => {\n try {\n const logsUrl = `${profile.url}/api/tasks/log-ingest`\n const authToken = `${profile.apiKey}:${profile.apiSecret}`\n\n await axios.post(logsUrl, {\n projectName,\n taskName,\n logItem: JSON.stringify(logItem)\n }, {\n headers: {\n Authorization: `Bearer ${authToken}`,\n 'Content-Type': 'application/json'\n }\n })\n\n console.log('===============================================')\n console.log('Log sent to API... ', profile.name, profile.url)\n\n return true\n } catch (e) {\n const error = e as Error\n console.error('Failed to send log to API:', error.message)\n return false\n }\n }\n}\n\nexport const run = createTask(\n schema,\n boundaries,\n async function ({ descriptorName, args }, {\n loadConf,\n bundleCreate,\n bundleLoad,\n verifyLogFolder,\n ensureBuildsFolder,\n loadCurrentProfile,\n sendLogToAPI\n }) {\n // Load forge configuration\n const forge: ForgeConf = await loadConf({})\n const taskDescriptor = forge.tasks[descriptorName as keyof typeof forge.tasks]\n const projectName = forge.project.name\n\n if (taskDescriptor === undefined) {\n throw new Error('Task is not defined on forge.json')\n }\n\n // Try to load profile, but continue if not found\n let profile = null\n try {\n profile = await loadCurrentProfile({})\n } catch (error) {\n // Profile not found or not configured, continue without it\n console.log('No profile found, logs will not be sent to remote API')\n }\n\n // Verify if log folder exists\n const logFolderPath = path.join(process.cwd(), forge.paths.logs)\n const logFolderExists = await verifyLogFolder(logFolderPath)\n if (!logFolderExists) {\n throw new Error(`Log folder \"${logFolderPath}\" does not exist`)\n }\n\n // Prepare paths\n const logsPath = path.join(logFolderPath, descriptorName)\n const entryPoint = path.join(process.cwd(), taskDescriptor.path)\n const buildsPath = await ensureBuildsFolder()\n const outputFile = path.join(buildsPath, `${descriptorName}.js`)\n\n // Bundle the task\n await bundleCreate({\n entryPoint,\n outputFile\n })\n\n // Load the bundled task\n const bundle = await bundleLoad({\n bundlePath: outputFile\n })\n\n // Get the task handler\n const task = bundle[taskDescriptor.handler]\n\n if (!task) {\n throw new Error(`Handler \"${taskDescriptor.handler}\" not found in bundle`)\n }\n\n // Setup record tape\n let tape = new RecordTape({\n path: logsPath\n })\n\n // load record tape\n try {\n await tape.load()\n\n // Need to figure out how to handle the log length\n // and other options for the RecordTape\n // For now, we'll just keep the implementation simple\n const maxLogLength = 9\n const log = tape.getLog()\n\n if (log.length > maxLogLength) {\n const newTape = new RecordTape({\n path: logsPath,\n log: log.slice(-maxLogLength)\n })\n\n tape = newTape\n }\n } catch (_error) {\n // if the tape is not found, create a new one on saving\n }\n\n // Run the task with provided arguments\n const [result, error, record] = await task.safeRun(args)\n const logItem = tape.push(descriptorName, record, {\n environment: 'cli'\n })\n await tape.save()\n\n if (profile) {\n try {\n await sendLogToAPI(profile, projectName, descriptorName, logItem)\n } catch (e) {\n console.error('Failed to send log to API:', e)\n }\n }\n\n if (error) {\n throw error\n }\n\n return result\n }\n)\n","error":null}],"writeFile":[{"input":["/Users/danielzavaladlvega/.forge/task:run.task-fingerprint.json","{\n \"taskFingerprint\": {\n \"inputSchema\": {\n \"type\": \"object\",\n \"properties\": {\n \"descriptorName\": {\n \"type\": \"string\"\n },\n \"args\": {\n \"type\": \"unknown\"\n }\n }\n },\n \"outputType\": {\n \"type\": \"any\"\n },\n \"boundaries\": [\n \"loadConf\",\n \"loadCurrentProfile\",\n \"bundleCreate\",\n \"bundleLoad\",\n \"verifyLogFolder\",\n \"ensureBuildsFolder\",\n \"sendLogToAPI\"\n ]\n }\n}"],"output":null,"error":null}],"ensureForgeFolder":[{"input":[],"output":"/Users/danielzavaladlvega/.forge","error":null}]},"context":{"environment":"cli"}}
|
|
8
|
+
{"name":"task:fingerprint","type":"success","input":{"descriptorName":"task:run"},"output":{"taskName":"task:run","fingerprint":{"inputSchema":{"type":"object","properties":{"descriptorName":{"type":"string"},"args":{"type":"unknown"}}},"outputType":{"type":"unknown"},"boundaries":["loadConf","loadCurrentProfile","bundleCreate","bundleLoad","verifyLogFolder","ensureBuildsFolder","sendLogToAPI"]},"fingerprintFile":"/Users/danielzavaladlvega/.forge/task:run.task-fingerprint.json","analysis":{"inputSchemaProps":["descriptorName","args"],"boundaryCount":7,"hasDescription":false,"outputType":"unknown"}},"boundaries":{"getCwd":[{"input":[],"output":"/Users/danielzavaladlvega/forgehive/forge-mono-repo/apps/cli","error":null}],"loadConf":[{"input":[{}],"output":{"project":{"name":"forge-cli"},"paths":{"logs":"logs/","fixtures":"fixtures","tasks":"src/tasks/","runners":"src/runners/","tests":"src/tests/"},"infra":{"region":"us-west-2","bucket":""},"tasks":{"bundle:create":{"path":"src/tasks/bundle/create.ts","handler":"create"},"bundle:load":{"path":"src/tasks/bundle/load.ts","handler":"load"},"task:run":{"path":"src/tasks/task/run.ts","handler":"run"},"task:remove":{"path":"src/tasks/task/remove.ts","handler":"remove"},"conf:info":{"path":"src/tasks/conf/info.ts","handler":"info"},"runner:create":{"path":"src/tasks/runner/create.ts","handler":"create"},"runner:remove":{"path":"src/tasks/runner/remove.ts","handler":"remove"},"runner:bundle":{"path":"src/tasks/runner/bundle.ts","handler":"bundle"},"task:publish":{"path":"src/tasks/task/publish.ts","handler":"publish"},"task:download":{"path":"src/tasks/task/download.ts","handler":"download"},"auth:add":{"path":"src/tasks/auth/add.ts","handler":"add"},"auth:load":{"path":"src/tasks/auth/load.ts","handler":"load"},"auth:loadCurrent":{"path":"src/tasks/auth/loadCurrent.ts","handler":"loadCurrent"},"auth:switch":{"path":"src/tasks/auth/switch.ts","handler":"switchProfile"},"auth:list":{"path":"src/tasks/auth/list.ts","handler":"list"},"auth:remove":{"path":"src/tasks/auth/remove.ts","handler":"remove"},"task:replay":{"path":"src/tasks/task/replay.ts","handler":"replay"},"fixture:download":{"path":"src/tasks/fixture/download.ts","handler":"download"},"bundle:zip":{"path":"src/tasks/bundle/zip.ts","handler":"zip"},"task:list":{"path":"src/tasks/task/list.ts","handler":"list"},"task:describe":{"path":"src/tasks/task/describe.ts","handler":"describe"},"task:fingerprint":{"path":"src/tasks/task/fingerprint.ts","handler":"fingerprint"},"bundle:fingerprint":{"path":"src/tasks/bundle/fingerprint.ts","handler":"fingerprint"}},"runners":{}},"error":null}],"readFile":[{"input":["/Users/danielzavaladlvega/forgehive/forge-mono-repo/apps/cli/src/tasks/task/run.ts"],"output":"// TASK: run\n// Run this task with:\n// shadow-cli task:run\n\nimport path from 'path'\nimport fs from 'fs/promises'\nimport os from 'os'\nimport axios from 'axios'\n\nimport { createTask } from '@forgehive/task'\nimport { Schema } from '@forgehive/schema'\nimport { RecordTape } from '@forgehive/record-tape'\n\nimport { create as bundleCreate } from '../bundle/create'\nimport { load as bundleLoad } from '../bundle/load'\nimport { load as loadConf } from '../conf/load'\nimport { loadCurrent as loadCurrentProfile } from '../auth/loadCurrent'\nimport { type ForgeConf, type Profile } from '../types'\n\n// For now, we'll use a simple schema without the record type\n// TODO: Use Schema.record once it's properly built and available\nconst schema = new Schema({\n descriptorName: Schema.string(),\n args: Schema.mixedRecord()\n // args will be passed directly without schema validation for now\n})\n\nconst boundaries = {\n loadConf: loadConf.asBoundary(),\n loadCurrentProfile: loadCurrentProfile.asBoundary(),\n bundleCreate: bundleCreate.asBoundary(),\n bundleLoad: bundleLoad.asBoundary(),\n verifyLogFolder: async (logsPath: string): Promise<boolean> => {\n // return true if the folder exists\n try {\n await fs.access(logsPath)\n } catch (error) {\n return false\n }\n\n return true\n },\n ensureBuildsFolder: async (): Promise<string> => {\n const buildsPath = path.join(os.homedir(), '.forge', 'builds')\n try {\n await fs.access(buildsPath)\n } catch {\n await fs.mkdir(buildsPath, { recursive: true })\n }\n\n return buildsPath\n },\n sendLogToAPI: async (profile: Profile, projectName: string, taskName: string, logItem: unknown): Promise<boolean> => {\n try {\n const logsUrl = `${profile.url}/api/tasks/log-ingest`\n const authToken = `${profile.apiKey}:${profile.apiSecret}`\n\n await axios.post(logsUrl, {\n projectName,\n taskName,\n logItem: JSON.stringify(logItem)\n }, {\n headers: {\n Authorization: `Bearer ${authToken}`,\n 'Content-Type': 'application/json'\n }\n })\n\n console.log('===============================================')\n console.log('Log sent to API... ', profile.name, profile.url)\n\n return true\n } catch (e) {\n const error = e as Error\n console.error('Failed to send log to API:', error.message)\n return false\n }\n }\n}\n\nexport const run = createTask(\n schema,\n boundaries,\n async function ({ descriptorName, args }, {\n loadConf,\n bundleCreate,\n bundleLoad,\n verifyLogFolder,\n ensureBuildsFolder,\n loadCurrentProfile,\n sendLogToAPI\n }) {\n // Load forge configuration\n const forge: ForgeConf = await loadConf({})\n const taskDescriptor = forge.tasks[descriptorName as keyof typeof forge.tasks]\n const projectName = forge.project.name\n\n if (taskDescriptor === undefined) {\n throw new Error('Task is not defined on forge.json')\n }\n\n // Try to load profile, but continue if not found\n let profile = null\n try {\n profile = await loadCurrentProfile({})\n } catch (error) {\n // Profile not found or not configured, continue without it\n console.log('No profile found, logs will not be sent to remote API')\n }\n\n // Verify if log folder exists\n const logFolderPath = path.join(process.cwd(), forge.paths.logs)\n const logFolderExists = await verifyLogFolder(logFolderPath)\n if (!logFolderExists) {\n throw new Error(`Log folder \"${logFolderPath}\" does not exist`)\n }\n\n // Prepare paths\n const logsPath = path.join(logFolderPath, descriptorName)\n const entryPoint = path.join(process.cwd(), taskDescriptor.path)\n const buildsPath = await ensureBuildsFolder()\n const outputFile = path.join(buildsPath, `${descriptorName}.js`)\n\n // Bundle the task\n await bundleCreate({\n entryPoint,\n outputFile\n })\n\n // Load the bundled task\n const bundle = await bundleLoad({\n bundlePath: outputFile\n })\n\n // Get the task handler\n const task = bundle[taskDescriptor.handler]\n\n if (!task) {\n throw new Error(`Handler \"${taskDescriptor.handler}\" not found in bundle`)\n }\n\n // Setup record tape\n let tape = new RecordTape({\n path: logsPath\n })\n\n // load record tape\n try {\n await tape.load()\n\n // Need to figure out how to handle the log length\n // and other options for the RecordTape\n // For now, we'll just keep the implementation simple\n const maxLogLength = 9\n const log = tape.getLog()\n\n if (log.length > maxLogLength) {\n const newTape = new RecordTape({\n path: logsPath,\n log: log.slice(-maxLogLength)\n })\n\n tape = newTape\n }\n } catch (_error) {\n // if the tape is not found, create a new one on saving\n }\n\n // Run the task with provided arguments\n const [result, error, record] = await task.safeRun(args)\n const logItem = tape.push(descriptorName, record, {\n environment: 'cli'\n })\n await tape.save()\n\n if (profile) {\n try {\n await sendLogToAPI(profile, projectName, descriptorName, logItem)\n } catch (e) {\n console.error('Failed to send log to API:', e)\n }\n }\n\n if (error) {\n throw error\n }\n\n return result\n }\n)\n","error":null}],"writeFile":[{"input":["/Users/danielzavaladlvega/.forge/task:run.task-fingerprint.json","{\n \"taskFingerprint\": {\n \"inputSchema\": {\n \"type\": \"object\",\n \"properties\": {\n \"descriptorName\": {\n \"type\": \"string\"\n },\n \"args\": {\n \"type\": \"unknown\"\n }\n }\n },\n \"outputType\": {\n \"type\": \"unknown\"\n },\n \"boundaries\": [\n \"loadConf\",\n \"loadCurrentProfile\",\n \"bundleCreate\",\n \"bundleLoad\",\n \"verifyLogFolder\",\n \"ensureBuildsFolder\",\n \"sendLogToAPI\"\n ]\n }\n}"],"output":null,"error":null}],"ensureForgeFolder":[{"input":[],"output":"/Users/danielzavaladlvega/.forge","error":null}]},"context":{"environment":"cli"}}
|
|
9
|
+
{"name":"task:fingerprint","type":"error","input":{"descriptorName":"task:createTask"},"error":"Task \"task:createTask\" is not defined in forge.json","boundaries":{"getCwd":[{"input":[],"output":"/Users/danielzavaladlvega/forgehive/forge-mono-repo/apps/cli","error":null}],"loadConf":[{"input":[{}],"output":{"project":{"name":"forge-cli"},"paths":{"logs":"logs/","fixtures":"fixtures","tasks":"src/tasks/","runners":"src/runners/","tests":"src/tests/"},"infra":{"region":"us-west-2","bucket":""},"tasks":{"bundle:create":{"path":"src/tasks/bundle/create.ts","handler":"create"},"bundle:load":{"path":"src/tasks/bundle/load.ts","handler":"load"},"task:run":{"path":"src/tasks/task/run.ts","handler":"run"},"task:remove":{"path":"src/tasks/task/remove.ts","handler":"remove"},"conf:info":{"path":"src/tasks/conf/info.ts","handler":"info"},"runner:create":{"path":"src/tasks/runner/create.ts","handler":"create"},"runner:remove":{"path":"src/tasks/runner/remove.ts","handler":"remove"},"runner:bundle":{"path":"src/tasks/runner/bundle.ts","handler":"bundle"},"task:publish":{"path":"src/tasks/task/publish.ts","handler":"publish"},"task:download":{"path":"src/tasks/task/download.ts","handler":"download"},"auth:add":{"path":"src/tasks/auth/add.ts","handler":"add"},"auth:load":{"path":"src/tasks/auth/load.ts","handler":"load"},"auth:loadCurrent":{"path":"src/tasks/auth/loadCurrent.ts","handler":"loadCurrent"},"auth:switch":{"path":"src/tasks/auth/switch.ts","handler":"switchProfile"},"auth:list":{"path":"src/tasks/auth/list.ts","handler":"list"},"auth:remove":{"path":"src/tasks/auth/remove.ts","handler":"remove"},"task:replay":{"path":"src/tasks/task/replay.ts","handler":"replay"},"fixture:download":{"path":"src/tasks/fixture/download.ts","handler":"download"},"bundle:zip":{"path":"src/tasks/bundle/zip.ts","handler":"zip"},"task:list":{"path":"src/tasks/task/list.ts","handler":"list"},"task:describe":{"path":"src/tasks/task/describe.ts","handler":"describe"},"task:fingerprint":{"path":"src/tasks/task/fingerprint.ts","handler":"fingerprint"},"bundle:fingerprint":{"path":"src/tasks/bundle/fingerprint.ts","handler":"fingerprint"}},"runners":{}},"error":null}],"readFile":[],"writeFile":[],"ensureForgeFolder":[]},"context":{"environment":"cli"}}
|
|
10
|
+
{"name":"task:fingerprint","type":"success","input":{"descriptorName":"task:createTask"},"output":{"taskName":"task:createTask","fingerprint":{"inputSchema":{"type":"object","properties":{"descriptorName":{"type":"string"}}},"outputType":{"type":"object","properties":{"taskPath":{"type":"string"},"fileName":{"type":"string"}}},"boundaries":["loadConf","loadTemplate","getCwd","parseTaskName","persistTask","persistConf"]},"fingerprintFile":"/Users/danielzavaladlvega/.forge/task:createTask.task-fingerprint.json","analysis":{"inputSchemaProps":["descriptorName"],"boundaryCount":6,"hasDescription":false,"outputType":"object"}},"boundaries":{"getCwd":[{"input":[],"output":"/Users/danielzavaladlvega/forgehive/forge-mono-repo/apps/cli","error":null}],"loadConf":[{"input":[{}],"output":{"project":{"name":"forge-cli"},"paths":{"logs":"logs/","fixtures":"fixtures","tasks":"src/tasks/","runners":"src/runners/","tests":"src/tests/"},"infra":{"region":"us-west-2","bucket":""},"tasks":{"task:createTask":{"path":"src/tasks/task/createTask.ts","handler":"createTask"},"bundle:create":{"path":"src/tasks/bundle/create.ts","handler":"create"},"bundle:load":{"path":"src/tasks/bundle/load.ts","handler":"load"},"task:run":{"path":"src/tasks/task/run.ts","handler":"run"},"task:remove":{"path":"src/tasks/task/remove.ts","handler":"remove"},"conf:info":{"path":"src/tasks/conf/info.ts","handler":"info"},"runner:create":{"path":"src/tasks/runner/create.ts","handler":"create"},"runner:remove":{"path":"src/tasks/runner/remove.ts","handler":"remove"},"runner:bundle":{"path":"src/tasks/runner/bundle.ts","handler":"bundle"},"task:publish":{"path":"src/tasks/task/publish.ts","handler":"publish"},"task:download":{"path":"src/tasks/task/download.ts","handler":"download"},"auth:add":{"path":"src/tasks/auth/add.ts","handler":"add"},"auth:load":{"path":"src/tasks/auth/load.ts","handler":"load"},"auth:loadCurrent":{"path":"src/tasks/auth/loadCurrent.ts","handler":"loadCurrent"},"auth:switch":{"path":"src/tasks/auth/switch.ts","handler":"switchProfile"},"auth:list":{"path":"src/tasks/auth/list.ts","handler":"list"},"auth:remove":{"path":"src/tasks/auth/remove.ts","handler":"remove"},"task:replay":{"path":"src/tasks/task/replay.ts","handler":"replay"},"fixture:download":{"path":"src/tasks/fixture/download.ts","handler":"download"},"bundle:zip":{"path":"src/tasks/bundle/zip.ts","handler":"zip"},"task:list":{"path":"src/tasks/task/list.ts","handler":"list"},"task:describe":{"path":"src/tasks/task/describe.ts","handler":"describe"},"task:fingerprint":{"path":"src/tasks/task/fingerprint.ts","handler":"fingerprint"},"bundle:fingerprint":{"path":"src/tasks/bundle/fingerprint.ts","handler":"fingerprint"}},"runners":{}},"error":null}],"readFile":[{"input":["/Users/danielzavaladlvega/forgehive/forge-mono-repo/apps/cli/src/tasks/task/createTask.ts"],"output":"import { createTask } from '@forgehive/task'\nimport { Schema } from '@forgehive/schema'\n\nimport Handlebars from 'handlebars'\nimport path from 'path'\nimport fs from 'fs/promises'\nimport { camelCase } from '../../utils/camelCase'\n\nimport { load } from '../conf/load'\nimport { type TaskName, type ForgeConf } from '../types'\n\n// Define the template content directly in the code\n// This eliminates the need to find and load an external file\nconst TASK_TEMPLATE = `// TASK: {{ taskName }}\n// Run this task with:\n// forge task:run {{ taskDescriptor }}\n\nimport { createTask } from '@forgehive/task'\nimport { Schema } from '@forgehive/schema'\n\nconst description = 'Add task description here'\n\nconst schema = new Schema({\n // Add your schema definitions here\n // example: myParam: Schema.string()\n})\n\nconst boundaries = {\n // Add your boundary functions here\n // example: readFile: async (path: string) => fs.readFile(path, 'utf-8')\n}\n\nexport const {{ taskName }} = createTask(\n schema,\n boundaries,\n async function (argv, boundaries) {\n console.log('input:', argv)\n console.log('boundaries:', boundaries)\n // Your task implementation goes here\n const status = { status: 'Ok' }\n\n return status\n }\n)\n\n{{ taskName }}.setDescription(description)\n`\n\nconst schema = new Schema({\n descriptorName: Schema.string()\n})\n\nconst boundaries = {\n // Load boundaries\n loadConf: load.asBoundary(),\n loadTemplate: async (): Promise<string> => {\n return TASK_TEMPLATE\n },\n getCwd: async (): Promise<string> => {\n return process.cwd()\n },\n parseTaskName: async (taskDescriptor: string): Promise<TaskName> => {\n const res: string[] = taskDescriptor.split(':')\n\n if (res.length === 1) {\n return {\n descriptor: `${camelCase(res[0])}`,\n taskName: `${camelCase(res[0])}`,\n fileName: `${camelCase(res[0])}.ts`\n }\n }\n\n return {\n dir: res[0],\n descriptor: `${res[0]}:${camelCase(res[1])}`,\n taskName: `${camelCase(res[1])}`,\n fileName: `${camelCase(res[1])}.ts`\n }\n },\n\n // Persist boundaries\n persistTask: async (dir: string, fileName: string, content: string, cwd: string): Promise<{ path: string }> => {\n const dirPath = path.resolve(cwd, dir)\n const taskPath = path.resolve(dirPath, fileName)\n\n let err\n try {\n await fs.stat(taskPath)\n } catch (e) {\n err = e\n }\n\n if (err === undefined) {\n throw new Error(`File '${taskPath}' already exists.`)\n }\n\n await fs.mkdir(dir, { recursive: true })\n await fs.writeFile(taskPath, content, 'utf-8')\n\n return {\n path: taskPath.toString()\n }\n },\n persistConf: async (forge: ForgeConf, cwd: string): Promise<void> => {\n const forgePath = path.join(cwd, 'forge.json')\n await fs.writeFile(forgePath, JSON.stringify(forge, null, 2))\n }\n}\n\nexport const createTaskCommand = createTask(\n schema,\n boundaries,\n async function ({ descriptorName }, {\n loadTemplate,\n persistTask,\n loadConf,\n persistConf,\n parseTaskName,\n getCwd\n }) {\n const { taskName, fileName, descriptor, dir } = await parseTaskName(descriptorName)\n const cwd = await getCwd()\n\n const forge = await loadConf({})\n let taskPath: string = forge.paths.tasks\n\n if (dir !== undefined) {\n taskPath = path.join(taskPath, dir)\n }\n\n console.log(`\n ==================================================\n Starting task creation!\n Creating: ${taskName}\n Dir: ${dir ?? ''}\n Into: ${taskPath}\n ==================================================\n `)\n\n const template = await loadTemplate()\n const comp = Handlebars.compile(template)\n const content = comp({\n taskName,\n taskDescriptor: descriptor\n })\n\n await persistTask(taskPath, fileName, content, cwd)\n\n if (forge.tasks === undefined) {\n forge.tasks = {}\n }\n\n forge.tasks[descriptor] = {\n path: `${taskPath}/${fileName}`,\n handler: taskName\n }\n\n await persistConf(forge, cwd)\n\n return { taskPath, fileName }\n }\n)\n","error":null}],"writeFile":[{"input":["/Users/danielzavaladlvega/.forge/task:createTask.task-fingerprint.json","{\n \"taskFingerprint\": {\n \"inputSchema\": {\n \"type\": \"object\",\n \"properties\": {\n \"descriptorName\": {\n \"type\": \"string\"\n }\n }\n },\n \"outputType\": {\n \"type\": \"object\",\n \"properties\": {\n \"taskPath\": {\n \"type\": \"string\"\n },\n \"fileName\": {\n \"type\": \"string\"\n }\n }\n },\n \"boundaries\": [\n \"loadConf\",\n \"loadTemplate\",\n \"getCwd\",\n \"parseTaskName\",\n \"persistTask\",\n \"persistConf\"\n ]\n }\n}"],"output":null,"error":null}],"ensureForgeFolder":[{"input":[],"output":"/Users/danielzavaladlvega/.forge","error":null}]},"context":{"environment":"cli"}}
|