@fractary/faber-cli 1.5.28 → 1.5.29
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.
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"anthropic-client.d.ts","sourceRoot":"","sources":["../../src/lib/anthropic-client.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAMH,OAAO,EAAyB,KAAK,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AAE/E,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AAK5D,UAAU,iBAAiB;IACzB,QAAQ,EAAE,MAAM,CAAC;IACjB,UAAU,EAAE,MAAM,CAAC;IACnB,gBAAgB,EAAE,MAAM,CAAC;IACzB,WAAW,EAAE,MAAM,CAAC;CACrB;AAED,MAAM,WAAW,gBAAgB;IAC/B,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,MAAM,CAAC;IAChB,aAAa,EAAE,SAAS,CAAC;IACzB,KAAK,EAAE;QACL,MAAM,EAAE,MAAM,CAAC;QACf,KAAK,EAAE,MAAM,CAAC;QACd,GAAG,EAAE,MAAM,CAAC;KACb,CAAC;IACF,cAAc,EAAE,IAAI,CAAC;IACrB,MAAM,EAAE;QACN,IAAI,EAAE,MAAM,CAAC;QACb,MAAM,EAAE,KAAK,GAAG,OAAO,GAAG,QAAQ,CAAC;KACpC,CAAC;IACF,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;CACzB;AAED,MAAM,WAAW,YAAY;IAC3B,EAAE,EAAE,MAAM,CAAC;IACX,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,EAAE,MAAM,CAAC;IACnB,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,EAAE;QACR,GAAG,EAAE,MAAM,CAAC;QACZ,OAAO,EAAE,MAAM,CAAC;QAChB,UAAU,EAAE,MAAM,CAAC;QACnB,IAAI,EAAE,MAAM,CAAC;QACb,KAAK,EA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AE,iBAAiB,GAAG,OAAO,CAAC,YAAY,CAAC;IA+FnE;;OAEG;YACW,eAAe;CAoB9B"}
|
|
@@ -71,7 +71,9 @@ export class AnthropicClient {
|
|
|
71
71
|
const workflowConfig = await resolver.resolveWorkflow(input.workflow);
|
|
72
72
|
// Extract repo info
|
|
73
73
|
const { organization, project } = await this.extractRepoInfo();
|
|
74
|
-
// Generate plan ID
|
|
74
|
+
// Generate plan ID: {org}-{project}-{work-id}
|
|
75
|
+
// Timestamp is omitted from plan-id since run-ids already contain timestamps.
|
|
76
|
+
// This keeps plan directories human-readable and scoped to the work item.
|
|
75
77
|
const now = new Date();
|
|
76
78
|
const year = now.getFullYear().toString();
|
|
77
79
|
const month = String(now.getMonth() + 1).padStart(2, '0');
|
|
@@ -79,9 +81,8 @@ export class AnthropicClient {
|
|
|
79
81
|
const hour = String(now.getHours()).padStart(2, '0');
|
|
80
82
|
const minute = String(now.getMinutes()).padStart(2, '0');
|
|
81
83
|
const second = String(now.getSeconds()).padStart(2, '0');
|
|
82
|
-
const timestamp = `${year}${month}${day}-${hour}${minute}${second}`;
|
|
83
84
|
const subproject = `issue-${input.issueNumber}`;
|
|
84
|
-
const planId = `${slugify(organization)}-${slugify(project)}-${input.issueNumber}
|
|
85
|
+
const planId = `${slugify(organization)}-${slugify(project)}-${input.issueNumber}`;
|
|
85
86
|
// Build the plan deterministically — no LLM call needed
|
|
86
87
|
const plan = {
|
|
87
88
|
id: planId,
|
|
@@ -99,8 +99,8 @@ export declare function validateJsonSize(jsonString: string, maxSizeBytes?: numb
|
|
|
99
99
|
export declare function slugify(input: string): string;
|
|
100
100
|
/**
|
|
101
101
|
* Validates plan ID format
|
|
102
|
-
* Plan IDs follow format: {org}-{project}-{work-id}
|
|
103
|
-
* Also accepts legacy format:
|
|
102
|
+
* Plan IDs follow format: {org}-{project}-{work-id}
|
|
103
|
+
* Also accepts legacy format with timestamp: {org}-{project}-{work-id}-{YYYYMMDD}-{HHMMSS}
|
|
104
104
|
*
|
|
105
105
|
* @param planId - Plan ID to validate
|
|
106
106
|
* @returns True if valid
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"validation.d.ts","sourceRoot":"","sources":["../../src/utils/validation.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH;;;;;;GAMG;AACH,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,MAAM,CAY1E;AAED;;;;;;GAMG;AACH,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,MAAM,GAAG,SAAS,EAAE,SAAS,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAMrG;AAED;;;;;;GAMG;AACH,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,MAAM,CAQ7E;AAED;;;;;;;GAOG;AACH,wBAAgB,cAAc,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAWtD;AAED;;;;;;GAMG;AACH,wBAAgB,eAAe,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,EAAE,CAiBzD;AAED;;;;;;;GAOG;AACH,wBAAgB,aAAa,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAYpD;AAED;;;;;;GAMG;AACH,wBAAgB,cAAc,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,EAAE,CAiBvD;AAED;;;;;;;GAOG;AACH,wBAAgB,oBAAoB,CAAC,YAAY,EAAE,MAAM,GAAG,OAAO,CAYlE;AAED;;;;;;;;GAQG;AACH,wBAAgB,gBAAgB,CAAC,QAAQ,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM,GAAG,MAAM,CAoC3E;AAED;;;;;;;GAOG;AACH,wBAAgB,gBAAgB,CAAC,UAAU,EAAE,MAAM,EAAE,YAAY,GAAE,MAAoB,GAAG,OAAO,CAYhG;AAED;;;;;;GAMG;AACH,wBAAgB,OAAO,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAM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,CAM7C;AAED;;;;;;;;GAQG;AACH,wBAAgB,cAAc,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAatD"}
|
package/dist/utils/validation.js
CHANGED
|
@@ -205,19 +205,20 @@ export function slugify(input) {
|
|
|
205
205
|
}
|
|
206
206
|
/**
|
|
207
207
|
* Validates plan ID format
|
|
208
|
-
* Plan IDs follow format: {org}-{project}-{work-id}
|
|
209
|
-
* Also accepts legacy format:
|
|
208
|
+
* Plan IDs follow format: {org}-{project}-{work-id}
|
|
209
|
+
* Also accepts legacy format with timestamp: {org}-{project}-{work-id}-{YYYYMMDD}-{HHMMSS}
|
|
210
210
|
*
|
|
211
211
|
* @param planId - Plan ID to validate
|
|
212
212
|
* @returns True if valid
|
|
213
213
|
* @throws Error if invalid
|
|
214
214
|
*/
|
|
215
215
|
export function validatePlanId(planId) {
|
|
216
|
-
// Accepts
|
|
217
|
-
//
|
|
218
|
-
|
|
216
|
+
// Accepts slug segments. The new format ends with a work-id (digits or slug).
|
|
217
|
+
// Legacy format may end with -{8digits}-{6digits} timestamp suffix.
|
|
218
|
+
// Only [a-z0-9-] allowed, which inherently prevents path traversal.
|
|
219
|
+
const planIdPattern = /^[a-z0-9]+(?:-[a-z0-9]+)*(?:-\d{8}-\d{6})?$/;
|
|
219
220
|
if (!planIdPattern.test(planId)) {
|
|
220
|
-
throw new Error(`Invalid plan ID format: "${planId}". Expected format: {org}-{project}-{work-id}
|
|
221
|
+
throw new Error(`Invalid plan ID format: "${planId}". Expected format: {org}-{project}-{work-id}`);
|
|
221
222
|
}
|
|
222
223
|
return true;
|
|
223
224
|
}
|