workflow-agent-cli 2.22.10 → 2.23.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/{chunk-3ARRW423.js → chunk-D36IFZUZ.js} +2 -1
- package/dist/{chunk-3ARRW423.js.map → chunk-D36IFZUZ.js.map} +1 -1
- package/dist/{chunk-MMPXQG3O.js → chunk-M6RHIUSM.js} +10 -4
- package/dist/chunk-M6RHIUSM.js.map +1 -0
- package/dist/cli/index.js +323 -106
- package/dist/cli/index.js.map +1 -1
- package/dist/sync-6T5TD4QS.js +7 -0
- package/dist/{verify-XGCZKY7S.js → verify-TX6LFMI6.js} +2 -2
- package/package.json +3 -3
- package/dist/chunk-MMPXQG3O.js.map +0 -1
- package/dist/sync-ON7M53OC.js +0 -7
- /package/dist/{sync-ON7M53OC.js.map → sync-6T5TD4QS.js.map} +0 -0
- /package/dist/{verify-XGCZKY7S.js.map → verify-TX6LFMI6.js.map} +0 -0
package/dist/cli/index.js
CHANGED
|
@@ -36,15 +36,15 @@ import {
|
|
|
36
36
|
} from "../chunk-YELUGXOM.js";
|
|
37
37
|
import {
|
|
38
38
|
verifyCommand
|
|
39
|
-
} from "../chunk-
|
|
39
|
+
} from "../chunk-D36IFZUZ.js";
|
|
40
40
|
import "../chunk-3ADL5QDN.js";
|
|
41
41
|
import {
|
|
42
42
|
syncCommand
|
|
43
|
-
} from "../chunk-
|
|
43
|
+
} from "../chunk-M6RHIUSM.js";
|
|
44
44
|
|
|
45
45
|
// src/cli/index.ts
|
|
46
46
|
import { Command as Command7 } from "commander";
|
|
47
|
-
import
|
|
47
|
+
import chalk24 from "chalk";
|
|
48
48
|
import { readFileSync as readFileSync3 } from "fs";
|
|
49
49
|
import { fileURLToPath as fileURLToPath4 } from "url";
|
|
50
50
|
import { dirname as dirname5, join as join12 } from "path";
|
|
@@ -5188,7 +5188,7 @@ async function testAction(options) {
|
|
|
5188
5188
|
if (options.dryRun) {
|
|
5189
5189
|
console.log(chalk17.bold.cyan("\n Dry-run hook simulation:\n"));
|
|
5190
5190
|
console.log(chalk17.dim(" Simulating pre-commit hook..."));
|
|
5191
|
-
const { verifyCommand: verifyCommand2 } = await import("../verify-
|
|
5191
|
+
const { verifyCommand: verifyCommand2 } = await import("../verify-TX6LFMI6.js");
|
|
5192
5192
|
try {
|
|
5193
5193
|
await verifyCommand2({ fix: false, dryRun: true, maxRetries: "1" });
|
|
5194
5194
|
} catch {
|
|
@@ -6485,16 +6485,18 @@ async function learnRecordCommand(options) {
|
|
|
6485
6485
|
const catChoice = await p12.select({
|
|
6486
6486
|
message: "Category:",
|
|
6487
6487
|
options: [
|
|
6488
|
-
{ value: "
|
|
6488
|
+
{ value: "lint", label: "\u{1F527} Lint Error" },
|
|
6489
|
+
{ value: "type-error", label: "\u{1F537} Type Error" },
|
|
6490
|
+
{ value: "dependency", label: "\u{1F4E6} Dependency" },
|
|
6491
|
+
{ value: "config", label: "\u2699\uFE0F Configuration" },
|
|
6492
|
+
{ value: "runtime", label: "\u{1F3C3} Runtime" },
|
|
6493
|
+
{ value: "build", label: "\u{1F3D7}\uFE0F Build" },
|
|
6494
|
+
{ value: "test", label: "\u{1F9EA} Test" },
|
|
6489
6495
|
{ value: "security", label: "\u{1F512} Security" },
|
|
6490
|
-
{ value: "
|
|
6491
|
-
{ value: "compatibility", label: "\u{1F517} Compatibility" },
|
|
6496
|
+
{ value: "migration", label: "\u{1F504} Migration" },
|
|
6492
6497
|
{ value: "deprecation", label: "\u26A0\uFE0F Deprecation" },
|
|
6493
|
-
{ value: "
|
|
6494
|
-
{ value: "
|
|
6495
|
-
{ value: "error-handling", label: "\u{1F6A8} Error Handling" },
|
|
6496
|
-
{ value: "testing", label: "\u{1F9EA} Testing" },
|
|
6497
|
-
{ value: "other", label: "\u{1F4E6} Other" }
|
|
6498
|
+
{ value: "performance", label: "\u26A1 Performance" },
|
|
6499
|
+
{ value: "compatibility", label: "\u{1F517} Compatibility" }
|
|
6498
6500
|
]
|
|
6499
6501
|
});
|
|
6500
6502
|
if (p12.isCancel(catChoice)) {
|
|
@@ -6619,6 +6621,7 @@ async function learnRecordCommand(options) {
|
|
|
6619
6621
|
console.log(chalk20.dim(` ID: ${blueprint.id}`));
|
|
6620
6622
|
console.log(chalk20.dim(` Name: ${name}`));
|
|
6621
6623
|
console.log(chalk20.dim(` Framework: ${framework} ${version}`));
|
|
6624
|
+
console.log(chalk20.dim(` Path: .workflow/patterns/blueprints/${blueprint.id}.json`));
|
|
6622
6625
|
} else {
|
|
6623
6626
|
console.log(chalk20.red("\n\u274C Failed to record blueprint"));
|
|
6624
6627
|
console.log(chalk20.dim(` Error: ${result.error}`));
|
|
@@ -7460,82 +7463,82 @@ var LIBRARY_TAG_MAP = {
|
|
|
7460
7463
|
"@nestjs/core": [{ category: "framework", name: "nestjs" }],
|
|
7461
7464
|
"hapi": [{ category: "framework", name: "hapi" }],
|
|
7462
7465
|
// Testing
|
|
7463
|
-
"vitest": [{ category: "
|
|
7464
|
-
"jest": [{ category: "
|
|
7465
|
-
"@testing-library/react": [{ category: "
|
|
7466
|
-
"playwright": [{ category: "
|
|
7467
|
-
"cypress": [{ category: "
|
|
7466
|
+
"vitest": [{ category: "tool", name: "vitest" }, { category: "testing", name: "testing" }],
|
|
7467
|
+
"jest": [{ category: "tool", name: "jest" }, { category: "testing", name: "testing" }],
|
|
7468
|
+
"@testing-library/react": [{ category: "tool", name: "testing-library" }],
|
|
7469
|
+
"playwright": [{ category: "tool", name: "playwright" }, { category: "testing", name: "e2e" }],
|
|
7470
|
+
"cypress": [{ category: "tool", name: "cypress" }, { category: "testing", name: "e2e" }],
|
|
7468
7471
|
// State Management
|
|
7469
|
-
"zustand": [{ category: "
|
|
7470
|
-
"redux": [{ category: "
|
|
7471
|
-
"@reduxjs/toolkit": [{ category: "
|
|
7472
|
-
"jotai": [{ category: "
|
|
7473
|
-
"recoil": [{ category: "
|
|
7474
|
-
"mobx": [{ category: "
|
|
7475
|
-
"pinia": [{ category: "
|
|
7476
|
-
"xstate": [{ category: "
|
|
7472
|
+
"zustand": [{ category: "tool", name: "zustand" }, { category: "state", name: "state" }],
|
|
7473
|
+
"redux": [{ category: "tool", name: "redux" }, { category: "state", name: "state" }],
|
|
7474
|
+
"@reduxjs/toolkit": [{ category: "tool", name: "redux-toolkit" }, { category: "state", name: "state" }],
|
|
7475
|
+
"jotai": [{ category: "tool", name: "jotai" }, { category: "state", name: "state" }],
|
|
7476
|
+
"recoil": [{ category: "tool", name: "recoil" }, { category: "state", name: "state" }],
|
|
7477
|
+
"mobx": [{ category: "tool", name: "mobx" }, { category: "state", name: "state" }],
|
|
7478
|
+
"pinia": [{ category: "tool", name: "pinia" }, { category: "state", name: "state" }],
|
|
7479
|
+
"xstate": [{ category: "tool", name: "xstate" }, { category: "state", name: "state-machine" }],
|
|
7477
7480
|
// Database & ORM
|
|
7478
|
-
"prisma": [{ category: "
|
|
7479
|
-
"@prisma/client": [{ category: "
|
|
7480
|
-
"drizzle-orm": [{ category: "
|
|
7481
|
-
"typeorm": [{ category: "
|
|
7482
|
-
"mongoose": [{ category: "
|
|
7483
|
-
"knex": [{ category: "
|
|
7484
|
-
"sequelize": [{ category: "
|
|
7481
|
+
"prisma": [{ category: "tool", name: "prisma" }, { category: "database", name: "database" }],
|
|
7482
|
+
"@prisma/client": [{ category: "tool", name: "prisma" }, { category: "database", name: "database" }],
|
|
7483
|
+
"drizzle-orm": [{ category: "tool", name: "drizzle" }, { category: "database", name: "database" }],
|
|
7484
|
+
"typeorm": [{ category: "tool", name: "typeorm" }, { category: "database", name: "database" }],
|
|
7485
|
+
"mongoose": [{ category: "tool", name: "mongoose" }, { category: "database", name: "mongodb" }],
|
|
7486
|
+
"knex": [{ category: "tool", name: "knex" }, { category: "database", name: "database" }],
|
|
7487
|
+
"sequelize": [{ category: "tool", name: "sequelize" }, { category: "database", name: "database" }],
|
|
7485
7488
|
// Authentication
|
|
7486
|
-
"next-auth": [{ category: "
|
|
7487
|
-
"@auth/core": [{ category: "
|
|
7488
|
-
"passport": [{ category: "
|
|
7489
|
-
"lucia": [{ category: "
|
|
7490
|
-
"@clerk/nextjs": [{ category: "
|
|
7489
|
+
"next-auth": [{ category: "tool", name: "next-auth" }, { category: "auth", name: "auth" }],
|
|
7490
|
+
"@auth/core": [{ category: "tool", name: "authjs" }, { category: "auth", name: "auth" }],
|
|
7491
|
+
"passport": [{ category: "tool", name: "passport" }, { category: "auth", name: "auth" }],
|
|
7492
|
+
"lucia": [{ category: "tool", name: "lucia" }, { category: "auth", name: "auth" }],
|
|
7493
|
+
"@clerk/nextjs": [{ category: "tool", name: "clerk" }, { category: "auth", name: "auth" }],
|
|
7491
7494
|
// UI Libraries
|
|
7492
|
-
"@radix-ui/react-dialog": [{ category: "
|
|
7493
|
-
"@radix-ui/react-dropdown-menu": [{ category: "
|
|
7494
|
-
"@shadcn/ui": [{ category: "
|
|
7495
|
-
"@chakra-ui/react": [{ category: "
|
|
7496
|
-
"@mantine/core": [{ category: "
|
|
7497
|
-
"@headlessui/react": [{ category: "
|
|
7498
|
-
"antd": [{ category: "
|
|
7499
|
-
"@mui/material": [{ category: "
|
|
7495
|
+
"@radix-ui/react-dialog": [{ category: "tool", name: "radix-ui" }],
|
|
7496
|
+
"@radix-ui/react-dropdown-menu": [{ category: "tool", name: "radix-ui" }],
|
|
7497
|
+
"@shadcn/ui": [{ category: "tool", name: "shadcn" }],
|
|
7498
|
+
"@chakra-ui/react": [{ category: "tool", name: "chakra-ui" }],
|
|
7499
|
+
"@mantine/core": [{ category: "tool", name: "mantine" }],
|
|
7500
|
+
"@headlessui/react": [{ category: "tool", name: "headlessui" }],
|
|
7501
|
+
"antd": [{ category: "tool", name: "antd" }],
|
|
7502
|
+
"@mui/material": [{ category: "tool", name: "material-ui" }],
|
|
7500
7503
|
// Styling
|
|
7501
|
-
"tailwindcss": [{ category: "
|
|
7502
|
-
"styled-components": [{ category: "
|
|
7503
|
-
"@emotion/react": [{ category: "
|
|
7504
|
-
"sass": [{ category: "
|
|
7504
|
+
"tailwindcss": [{ category: "tool", name: "tailwind" }],
|
|
7505
|
+
"styled-components": [{ category: "tool", name: "styled-components" }],
|
|
7506
|
+
"@emotion/react": [{ category: "tool", name: "emotion" }],
|
|
7507
|
+
"sass": [{ category: "tool", name: "sass" }],
|
|
7505
7508
|
// API & Data Fetching
|
|
7506
|
-
"@tanstack/react-query": [{ category: "
|
|
7507
|
-
"swr": [{ category: "
|
|
7508
|
-
"@trpc/server": [{ category: "
|
|
7509
|
-
"@trpc/client": [{ category: "
|
|
7510
|
-
"graphql": [{ category: "
|
|
7511
|
-
"@apollo/client": [{ category: "
|
|
7512
|
-
"axios": [{ category: "
|
|
7509
|
+
"@tanstack/react-query": [{ category: "tool", name: "tanstack-query" }, { category: "api", name: "data-fetching" }],
|
|
7510
|
+
"swr": [{ category: "tool", name: "swr" }, { category: "api", name: "data-fetching" }],
|
|
7511
|
+
"@trpc/server": [{ category: "tool", name: "trpc" }, { category: "api", name: "api" }],
|
|
7512
|
+
"@trpc/client": [{ category: "tool", name: "trpc" }, { category: "api", name: "api" }],
|
|
7513
|
+
"graphql": [{ category: "tool", name: "graphql" }, { category: "api", name: "api" }],
|
|
7514
|
+
"@apollo/client": [{ category: "tool", name: "apollo" }, { category: "api", name: "graphql" }],
|
|
7515
|
+
"axios": [{ category: "tool", name: "axios" }],
|
|
7513
7516
|
// Form Libraries
|
|
7514
|
-
"react-hook-form": [{ category: "
|
|
7515
|
-
"formik": [{ category: "
|
|
7516
|
-
"@tanstack/react-form": [{ category: "
|
|
7517
|
+
"react-hook-form": [{ category: "tool", name: "react-hook-form" }, { category: "feature", name: "forms" }],
|
|
7518
|
+
"formik": [{ category: "tool", name: "formik" }, { category: "feature", name: "forms" }],
|
|
7519
|
+
"@tanstack/react-form": [{ category: "tool", name: "tanstack-form" }, { category: "feature", name: "forms" }],
|
|
7517
7520
|
// Validation
|
|
7518
|
-
"zod": [{ category: "
|
|
7519
|
-
"yup": [{ category: "
|
|
7520
|
-
"valibot": [{ category: "
|
|
7521
|
+
"zod": [{ category: "tool", name: "zod" }, { category: "feature", name: "validation" }],
|
|
7522
|
+
"yup": [{ category: "tool", name: "yup" }, { category: "feature", name: "validation" }],
|
|
7523
|
+
"valibot": [{ category: "tool", name: "valibot" }, { category: "feature", name: "validation" }],
|
|
7521
7524
|
// Build Tools
|
|
7522
|
-
"vite": [{ category: "
|
|
7523
|
-
"esbuild": [{ category: "
|
|
7524
|
-
"tsup": [{ category: "
|
|
7525
|
-
"webpack": [{ category: "
|
|
7526
|
-
"turbo": [{ category: "
|
|
7525
|
+
"vite": [{ category: "tool", name: "vite" }],
|
|
7526
|
+
"esbuild": [{ category: "tool", name: "esbuild" }],
|
|
7527
|
+
"tsup": [{ category: "tool", name: "tsup" }],
|
|
7528
|
+
"webpack": [{ category: "tool", name: "webpack" }],
|
|
7529
|
+
"turbo": [{ category: "tool", name: "turborepo" }],
|
|
7527
7530
|
// Utilities
|
|
7528
|
-
"lodash": [{ category: "
|
|
7529
|
-
"date-fns": [{ category: "
|
|
7530
|
-
"dayjs": [{ category: "
|
|
7531
|
-
"uuid": [{ category: "
|
|
7532
|
-
"nanoid": [{ category: "
|
|
7531
|
+
"lodash": [{ category: "tool", name: "lodash" }],
|
|
7532
|
+
"date-fns": [{ category: "tool", name: "date-fns" }],
|
|
7533
|
+
"dayjs": [{ category: "tool", name: "dayjs" }],
|
|
7534
|
+
"uuid": [{ category: "tool", name: "uuid" }],
|
|
7535
|
+
"nanoid": [{ category: "tool", name: "nanoid" }],
|
|
7533
7536
|
// CLI & Developer Tools
|
|
7534
|
-
"commander": [{ category: "
|
|
7535
|
-
"yargs": [{ category: "
|
|
7536
|
-
"@clack/prompts": [{ category: "
|
|
7537
|
-
"inquirer": [{ category: "
|
|
7538
|
-
"chalk": [{ category: "
|
|
7537
|
+
"commander": [{ category: "tool", name: "commander" }, { category: "feature", name: "cli" }],
|
|
7538
|
+
"yargs": [{ category: "tool", name: "yargs" }, { category: "feature", name: "cli" }],
|
|
7539
|
+
"@clack/prompts": [{ category: "tool", name: "clack" }, { category: "feature", name: "cli" }],
|
|
7540
|
+
"inquirer": [{ category: "tool", name: "inquirer" }, { category: "feature", name: "cli" }],
|
|
7541
|
+
"chalk": [{ category: "tool", name: "chalk" }],
|
|
7539
7542
|
// Runtime & Languages
|
|
7540
7543
|
"typescript": [{ category: "language", name: "typescript" }]
|
|
7541
7544
|
};
|
|
@@ -7618,28 +7621,28 @@ function inferTagsFromContent(filePaths) {
|
|
|
7618
7621
|
} else if (ext === ".rs") {
|
|
7619
7622
|
addTag("language", "rust");
|
|
7620
7623
|
} else if (ext === ".css" || ext === ".scss" || ext === ".sass") {
|
|
7621
|
-
addTag("
|
|
7624
|
+
addTag("file-type", "css");
|
|
7622
7625
|
}
|
|
7623
7626
|
if (ext === ".tsx" || ext === ".jsx") {
|
|
7624
7627
|
addTag("framework", "react");
|
|
7625
7628
|
}
|
|
7626
7629
|
if (fileName.includes(".test.") || fileName.includes(".spec.") || fileName.startsWith("test_")) {
|
|
7627
|
-
addTag("
|
|
7630
|
+
addTag("testing", "testing");
|
|
7628
7631
|
}
|
|
7629
7632
|
if (fileName.includes("config") || fileName.startsWith(".")) {
|
|
7630
|
-
addTag("
|
|
7633
|
+
addTag("file-type", "configuration");
|
|
7631
7634
|
}
|
|
7632
7635
|
if (filePath.includes("/components/") || filePath.includes("\\components\\")) {
|
|
7633
|
-
addTag("
|
|
7636
|
+
addTag("ui", "component");
|
|
7634
7637
|
}
|
|
7635
7638
|
if (filePath.includes("/hooks/") || filePath.includes("\\hooks\\") || fileName.startsWith("use")) {
|
|
7636
|
-
addTag("
|
|
7639
|
+
addTag("pattern", "hooks");
|
|
7637
7640
|
}
|
|
7638
7641
|
if (filePath.includes("/api/") || filePath.includes("\\api\\") || filePath.includes("/routes/")) {
|
|
7639
|
-
addTag("
|
|
7642
|
+
addTag("api", "api");
|
|
7640
7643
|
}
|
|
7641
7644
|
if (filePath.includes("/utils/") || filePath.includes("\\utils\\") || filePath.includes("/lib/")) {
|
|
7642
|
-
addTag("
|
|
7645
|
+
addTag("library", "utilities");
|
|
7643
7646
|
}
|
|
7644
7647
|
}
|
|
7645
7648
|
return tags;
|
|
@@ -7868,6 +7871,7 @@ async function learnCaptureCommand(paths, options) {
|
|
|
7868
7871
|
console.log(chalk20.dim(`Name: ${name}`));
|
|
7869
7872
|
console.log(chalk20.dim(`Files: ${files.length}`));
|
|
7870
7873
|
console.log(chalk20.dim(`Tags: ${formatTags(uniqueTags)}`));
|
|
7874
|
+
console.log(chalk20.dim(`Path: .workflow/patterns/blueprints/${blueprint.id}.json`));
|
|
7871
7875
|
console.log(chalk20.dim(`
|
|
7872
7876
|
To apply this pattern:`));
|
|
7873
7877
|
console.log(chalk20.cyan(` pnpm workflow:learn:apply ${blueprint.id}`));
|
|
@@ -8298,7 +8302,7 @@ ${chalk21.bold("Pro Tip:")}
|
|
|
8298
8302
|
$ workflow sync --all ${chalk21.dim("# Sync everything")}
|
|
8299
8303
|
`
|
|
8300
8304
|
).action(async (options) => {
|
|
8301
|
-
const { syncCommand: syncCommand2 } = await import("../sync-
|
|
8305
|
+
const { syncCommand: syncCommand2 } = await import("../sync-6T5TD4QS.js");
|
|
8302
8306
|
return syncCommand2({ ...options, learn: true });
|
|
8303
8307
|
});
|
|
8304
8308
|
learnCmd.command("config").description("Configure learning settings").option("--enable-sync", "Enable pattern sync").option("--disable-sync", "Disable pattern sync").option("--enable-telemetry", "Enable anonymous telemetry").option("--disable-telemetry", "Disable telemetry").option("--reset-id", "Reset contributor ID").option("--show", "Show current configuration").addHelpText(
|
|
@@ -8495,7 +8499,7 @@ async function scopeRemoveCommand(name) {
|
|
|
8495
8499
|
}
|
|
8496
8500
|
async function scopeSyncCommand(options) {
|
|
8497
8501
|
console.log(chalk22.bold.cyan("\n\u{1F504} Syncing Scopes\n"));
|
|
8498
|
-
const { syncCommand: syncCommand2 } = await import("../sync-
|
|
8502
|
+
const { syncCommand: syncCommand2 } = await import("../sync-6T5TD4QS.js");
|
|
8499
8503
|
await syncCommand2({
|
|
8500
8504
|
...options,
|
|
8501
8505
|
scopes: true,
|
|
@@ -8639,6 +8643,207 @@ ${chalk22.bold("Details:")}
|
|
|
8639
8643
|
return scopeCmd;
|
|
8640
8644
|
}
|
|
8641
8645
|
|
|
8646
|
+
// src/cli/commands/migrate.ts
|
|
8647
|
+
import chalk23 from "chalk";
|
|
8648
|
+
import { PatternStore as PatternStore3 } from "@hawkinside_out/workflow-improvement-tracker";
|
|
8649
|
+
async function migrateCommand(subcommand, options) {
|
|
8650
|
+
if (subcommand === "filenames") {
|
|
8651
|
+
await migrateFilenames(options);
|
|
8652
|
+
} else {
|
|
8653
|
+
console.error(chalk23.red(`Unknown migrate subcommand: ${subcommand}`));
|
|
8654
|
+
console.log(chalk23.dim("\nAvailable subcommands:"));
|
|
8655
|
+
console.log(chalk23.dim(" filenames Migrate pattern files to slugified names"));
|
|
8656
|
+
process.exit(1);
|
|
8657
|
+
}
|
|
8658
|
+
}
|
|
8659
|
+
async function migrateFilenames(options) {
|
|
8660
|
+
const isDryRun = options.dryRun || false;
|
|
8661
|
+
const targetType = options.type || "all";
|
|
8662
|
+
console.log(chalk23.bold.cyan("\n\u{1F4E6} Migrate Pattern Filenames\n"));
|
|
8663
|
+
if (isDryRun) {
|
|
8664
|
+
console.log(chalk23.yellow("\u{1F50D} DRY RUN MODE - No files will be modified\n"));
|
|
8665
|
+
}
|
|
8666
|
+
const store = new PatternStore3();
|
|
8667
|
+
const cwd = process.cwd();
|
|
8668
|
+
let totalProcessed = 0;
|
|
8669
|
+
let totalMigrated = 0;
|
|
8670
|
+
let totalFailed = 0;
|
|
8671
|
+
let totalSkipped = 0;
|
|
8672
|
+
const results = [];
|
|
8673
|
+
if (targetType === "fix" || targetType === "all") {
|
|
8674
|
+
console.log(chalk23.bold("Fixes:"));
|
|
8675
|
+
const fixesResult = await store.getAllFixes();
|
|
8676
|
+
if (fixesResult.success && fixesResult.data) {
|
|
8677
|
+
for (const fix of fixesResult.data) {
|
|
8678
|
+
totalProcessed++;
|
|
8679
|
+
try {
|
|
8680
|
+
const oldPath = store.getFixFilePath(fix.id);
|
|
8681
|
+
const newPath = store.getFixFilePath(fix.id, fix.name);
|
|
8682
|
+
if (oldPath === newPath) {
|
|
8683
|
+
console.log(chalk23.dim(` \u2298 ${fix.name} - already migrated`));
|
|
8684
|
+
results.push({
|
|
8685
|
+
type: "fix",
|
|
8686
|
+
name: fix.name,
|
|
8687
|
+
oldPath,
|
|
8688
|
+
newPath,
|
|
8689
|
+
status: "skipped"
|
|
8690
|
+
});
|
|
8691
|
+
totalSkipped++;
|
|
8692
|
+
continue;
|
|
8693
|
+
}
|
|
8694
|
+
if (!isDryRun) {
|
|
8695
|
+
await store.saveFixPattern(fix);
|
|
8696
|
+
}
|
|
8697
|
+
console.log(chalk23.green(` \u2713 ${fix.name}`));
|
|
8698
|
+
console.log(chalk23.dim(` ${oldPath} \u2192 ${newPath}`));
|
|
8699
|
+
results.push({
|
|
8700
|
+
type: "fix",
|
|
8701
|
+
name: fix.name,
|
|
8702
|
+
oldPath,
|
|
8703
|
+
newPath,
|
|
8704
|
+
status: "success"
|
|
8705
|
+
});
|
|
8706
|
+
totalMigrated++;
|
|
8707
|
+
} catch (error) {
|
|
8708
|
+
console.log(chalk23.red(` \u2717 ${fix.name} - ${error}`));
|
|
8709
|
+
results.push({
|
|
8710
|
+
type: "fix",
|
|
8711
|
+
name: fix.name,
|
|
8712
|
+
oldPath: "",
|
|
8713
|
+
newPath: "",
|
|
8714
|
+
status: "failed",
|
|
8715
|
+
error: String(error)
|
|
8716
|
+
});
|
|
8717
|
+
totalFailed++;
|
|
8718
|
+
}
|
|
8719
|
+
}
|
|
8720
|
+
}
|
|
8721
|
+
console.log();
|
|
8722
|
+
}
|
|
8723
|
+
if (targetType === "blueprint" || targetType === "all") {
|
|
8724
|
+
console.log(chalk23.bold("Blueprints:"));
|
|
8725
|
+
const blueprintsResult = await store.getAllBlueprints();
|
|
8726
|
+
if (blueprintsResult.success && blueprintsResult.data) {
|
|
8727
|
+
for (const blueprint of blueprintsResult.data) {
|
|
8728
|
+
totalProcessed++;
|
|
8729
|
+
try {
|
|
8730
|
+
const oldPath = store.getBlueprintFilePath(blueprint.id);
|
|
8731
|
+
const newPath = store.getBlueprintFilePath(blueprint.id, blueprint.name);
|
|
8732
|
+
if (oldPath === newPath) {
|
|
8733
|
+
console.log(chalk23.dim(` \u2298 ${blueprint.name} - already migrated`));
|
|
8734
|
+
results.push({
|
|
8735
|
+
type: "blueprint",
|
|
8736
|
+
name: blueprint.name,
|
|
8737
|
+
oldPath,
|
|
8738
|
+
newPath,
|
|
8739
|
+
status: "skipped"
|
|
8740
|
+
});
|
|
8741
|
+
totalSkipped++;
|
|
8742
|
+
continue;
|
|
8743
|
+
}
|
|
8744
|
+
if (!isDryRun) {
|
|
8745
|
+
await store.saveBlueprint(blueprint);
|
|
8746
|
+
}
|
|
8747
|
+
console.log(chalk23.green(` \u2713 ${blueprint.name}`));
|
|
8748
|
+
console.log(chalk23.dim(` ${oldPath} \u2192 ${newPath}`));
|
|
8749
|
+
results.push({
|
|
8750
|
+
type: "blueprint",
|
|
8751
|
+
name: blueprint.name,
|
|
8752
|
+
oldPath,
|
|
8753
|
+
newPath,
|
|
8754
|
+
status: "success"
|
|
8755
|
+
});
|
|
8756
|
+
totalMigrated++;
|
|
8757
|
+
} catch (error) {
|
|
8758
|
+
console.log(chalk23.red(` \u2717 ${blueprint.name} - ${error}`));
|
|
8759
|
+
results.push({
|
|
8760
|
+
type: "blueprint",
|
|
8761
|
+
name: blueprint.name,
|
|
8762
|
+
oldPath: "",
|
|
8763
|
+
newPath: "",
|
|
8764
|
+
status: "failed",
|
|
8765
|
+
error: String(error)
|
|
8766
|
+
});
|
|
8767
|
+
totalFailed++;
|
|
8768
|
+
}
|
|
8769
|
+
}
|
|
8770
|
+
}
|
|
8771
|
+
console.log();
|
|
8772
|
+
}
|
|
8773
|
+
if (targetType === "solution" || targetType === "all") {
|
|
8774
|
+
console.log(chalk23.bold("Solutions:"));
|
|
8775
|
+
const solutionsResult = await store.getAllSolutions();
|
|
8776
|
+
if (solutionsResult.success && solutionsResult.data) {
|
|
8777
|
+
for (const solution of solutionsResult.data) {
|
|
8778
|
+
totalProcessed++;
|
|
8779
|
+
try {
|
|
8780
|
+
const oldPath = store.getSolutionFilePath(solution.id);
|
|
8781
|
+
const newPath = store.getSolutionFilePath(solution.id, solution.name);
|
|
8782
|
+
if (oldPath === newPath) {
|
|
8783
|
+
console.log(chalk23.dim(` \u2298 ${solution.name} - already migrated`));
|
|
8784
|
+
results.push({
|
|
8785
|
+
type: "solution",
|
|
8786
|
+
name: solution.name,
|
|
8787
|
+
oldPath,
|
|
8788
|
+
newPath,
|
|
8789
|
+
status: "skipped"
|
|
8790
|
+
});
|
|
8791
|
+
totalSkipped++;
|
|
8792
|
+
continue;
|
|
8793
|
+
}
|
|
8794
|
+
if (!isDryRun) {
|
|
8795
|
+
await store.saveSolution(solution);
|
|
8796
|
+
}
|
|
8797
|
+
console.log(chalk23.green(` \u2713 ${solution.name}`));
|
|
8798
|
+
console.log(chalk23.dim(` ${oldPath} \u2192 ${newPath}`));
|
|
8799
|
+
results.push({
|
|
8800
|
+
type: "solution",
|
|
8801
|
+
name: solution.name,
|
|
8802
|
+
oldPath,
|
|
8803
|
+
newPath,
|
|
8804
|
+
status: "success"
|
|
8805
|
+
});
|
|
8806
|
+
totalMigrated++;
|
|
8807
|
+
} catch (error) {
|
|
8808
|
+
console.log(chalk23.red(` \u2717 ${solution.name} - ${error}`));
|
|
8809
|
+
results.push({
|
|
8810
|
+
type: "solution",
|
|
8811
|
+
name: solution.name,
|
|
8812
|
+
oldPath: "",
|
|
8813
|
+
newPath: "",
|
|
8814
|
+
status: "failed",
|
|
8815
|
+
error: String(error)
|
|
8816
|
+
});
|
|
8817
|
+
totalFailed++;
|
|
8818
|
+
}
|
|
8819
|
+
}
|
|
8820
|
+
}
|
|
8821
|
+
console.log();
|
|
8822
|
+
}
|
|
8823
|
+
console.log(chalk23.bold("Summary:"));
|
|
8824
|
+
console.log(chalk23.dim(` Total patterns: ${totalProcessed}`));
|
|
8825
|
+
if (totalMigrated > 0) {
|
|
8826
|
+
console.log(chalk23.green(` \u2713 Migrated: ${totalMigrated}`));
|
|
8827
|
+
}
|
|
8828
|
+
if (totalSkipped > 0) {
|
|
8829
|
+
console.log(chalk23.dim(` \u2298 Already migrated: ${totalSkipped}`));
|
|
8830
|
+
}
|
|
8831
|
+
if (totalFailed > 0) {
|
|
8832
|
+
console.log(chalk23.red(` \u2717 Failed: ${totalFailed}`));
|
|
8833
|
+
}
|
|
8834
|
+
if (isDryRun && totalMigrated > 0) {
|
|
8835
|
+
console.log(chalk23.yellow("\n\u26A0\uFE0F This was a dry run. Run without --dry-run to apply changes."));
|
|
8836
|
+
} else if (!isDryRun && totalMigrated > 0) {
|
|
8837
|
+
console.log(chalk23.green("\n\u2713 Migration complete!"));
|
|
8838
|
+
} else if (totalSkipped === totalProcessed) {
|
|
8839
|
+
console.log(chalk23.dim("\n\u2713 All patterns already use slugified filenames."));
|
|
8840
|
+
}
|
|
8841
|
+
if (totalFailed > 0) {
|
|
8842
|
+
console.log(chalk23.red("\n\u26A0\uFE0F Some patterns failed to migrate. Check the errors above."));
|
|
8843
|
+
process.exit(1);
|
|
8844
|
+
}
|
|
8845
|
+
}
|
|
8846
|
+
|
|
8642
8847
|
// src/cli/index.ts
|
|
8643
8848
|
var __filename4 = fileURLToPath4(import.meta.url);
|
|
8644
8849
|
var __dirname4 = dirname5(__filename4);
|
|
@@ -8646,8 +8851,8 @@ var packageJson = JSON.parse(
|
|
|
8646
8851
|
readFileSync3(join12(__dirname4, "../../package.json"), "utf-8")
|
|
8647
8852
|
);
|
|
8648
8853
|
function deprecationWarning(oldCmd, newCmd) {
|
|
8649
|
-
console.warn(
|
|
8650
|
-
console.warn(
|
|
8854
|
+
console.warn(chalk24.yellow(`\u26A0\uFE0F "${oldCmd}" is deprecated and will be removed in v2.0.`));
|
|
8855
|
+
console.warn(chalk24.yellow(` Use: ${newCmd}
|
|
8651
8856
|
`));
|
|
8652
8857
|
}
|
|
8653
8858
|
var program = new Command7();
|
|
@@ -8658,33 +8863,45 @@ program.addCommand(createDocsCommand());
|
|
|
8658
8863
|
program.addCommand(createSolutionCommand());
|
|
8659
8864
|
program.addCommand(createLearnCommand());
|
|
8660
8865
|
program.addCommand(createScopeCommand());
|
|
8866
|
+
program.command("migrate <subcommand>").description("Migrate patterns and configurations").option("--dry-run", "Preview without making changes").option("--type <type>", "Pattern type to migrate (fix, blueprint, solution, or all)", "all").addHelpText(
|
|
8867
|
+
"after",
|
|
8868
|
+
`
|
|
8869
|
+
${chalk24.bold("Subcommands:")}
|
|
8870
|
+
filenames ${chalk24.dim("# Migrate to slugified filenames")}
|
|
8871
|
+
|
|
8872
|
+
${chalk24.bold("Examples:")}
|
|
8873
|
+
$ workflow migrate filenames --dry-run ${chalk24.dim("# Preview migration")}
|
|
8874
|
+
$ workflow migrate filenames ${chalk24.dim("# Migrate all patterns")}
|
|
8875
|
+
$ workflow migrate filenames --type fix ${chalk24.dim("# Migrate only fixes")}
|
|
8876
|
+
`
|
|
8877
|
+
).action(migrateCommand);
|
|
8661
8878
|
program.addCommand(createHooksCommand());
|
|
8662
8879
|
program.command("sync").description("Sync patterns and solutions with the community registry").option("--push", "Push local patterns to registry").option("--pull", "Pull patterns from registry").option("--solutions", "Include solution patterns").option("--learn", "Include learning patterns (default)").option("--scopes", "Sync custom scope packages").option("--all", "Sync everything").option("--dry-run", "Preview without syncing").option("--enable-sync", "Enable pattern sync").option("--disable-sync", "Disable pattern sync").option("--include-private", "Include private patterns in push").addHelpText(
|
|
8663
8880
|
"after",
|
|
8664
8881
|
`
|
|
8665
|
-
${
|
|
8666
|
-
${
|
|
8882
|
+
${chalk24.bold("Examples:")}
|
|
8883
|
+
${chalk24.dim("# Enable sync")}
|
|
8667
8884
|
$ workflow sync --enable-sync
|
|
8668
8885
|
|
|
8669
|
-
${
|
|
8886
|
+
${chalk24.dim("# Disable sync")}
|
|
8670
8887
|
$ workflow sync --disable-sync
|
|
8671
8888
|
|
|
8672
|
-
${
|
|
8889
|
+
${chalk24.dim("# Interactive sync (prompts for direction)")}
|
|
8673
8890
|
$ workflow sync
|
|
8674
8891
|
|
|
8675
|
-
${
|
|
8892
|
+
${chalk24.dim("# Push local patterns to registry")}
|
|
8676
8893
|
$ workflow sync --push
|
|
8677
8894
|
|
|
8678
|
-
${
|
|
8895
|
+
${chalk24.dim("# Pull patterns from registry")}
|
|
8679
8896
|
$ workflow sync --pull
|
|
8680
8897
|
|
|
8681
|
-
${
|
|
8898
|
+
${chalk24.dim("# Sync solutions only")}
|
|
8682
8899
|
$ workflow sync --solutions --push
|
|
8683
8900
|
|
|
8684
|
-
${
|
|
8901
|
+
${chalk24.dim("# Include private patterns in push")}
|
|
8685
8902
|
$ workflow sync --solutions --push --include-private
|
|
8686
8903
|
|
|
8687
|
-
${
|
|
8904
|
+
${chalk24.dim("# Preview what would be synced")}
|
|
8688
8905
|
$ workflow sync --all --dry-run
|
|
8689
8906
|
`
|
|
8690
8907
|
).action(syncCommand);
|
|
@@ -8698,28 +8915,28 @@ program.command("validate <type> [value]").description("Validate branch name, co
|
|
|
8698
8915
|
).action(validateCommand);
|
|
8699
8916
|
program.command("config <action> [key] [value]").description("Manage workflow configuration").action(configCommand);
|
|
8700
8917
|
program.command("config:fix").description("Automatically fix common configuration validation issues").action(async () => {
|
|
8701
|
-
const
|
|
8918
|
+
const chalk25 = (await import("chalk")).default;
|
|
8702
8919
|
const { autoFixConfigFile: autoFixConfigFile2 } = await import("../config/index.js");
|
|
8703
|
-
console.log(
|
|
8920
|
+
console.log(chalk25.bold.cyan("\n\u{1F527} Workflow Configuration Auto-Fix\n"));
|
|
8704
8921
|
const result = await autoFixConfigFile2();
|
|
8705
8922
|
if (result.success) {
|
|
8706
8923
|
if (result.changes.length === 0) {
|
|
8707
|
-
console.log(
|
|
8924
|
+
console.log(chalk25.green("\u2713 Configuration is already valid!"));
|
|
8708
8925
|
} else {
|
|
8709
|
-
console.log(
|
|
8710
|
-
console.log(
|
|
8926
|
+
console.log(chalk25.green("\u2713 Configuration fixed successfully!\n"));
|
|
8927
|
+
console.log(chalk25.dim("Changes made:"));
|
|
8711
8928
|
for (const change of result.changes) {
|
|
8712
|
-
console.log(
|
|
8929
|
+
console.log(chalk25.dim(` \u2022 ${change}`));
|
|
8713
8930
|
}
|
|
8714
8931
|
console.log();
|
|
8715
8932
|
}
|
|
8716
8933
|
process.exit(0);
|
|
8717
8934
|
} else {
|
|
8718
8935
|
if (result.configPath) {
|
|
8719
|
-
console.log(
|
|
8936
|
+
console.log(chalk25.red(`\u2717 Failed to fix configuration: ${result.error}`));
|
|
8720
8937
|
} else {
|
|
8721
|
-
console.log(
|
|
8722
|
-
console.log(
|
|
8938
|
+
console.log(chalk25.red("\u2717 No workflow configuration file found"));
|
|
8939
|
+
console.log(chalk25.yellow(" Run: workflow init"));
|
|
8723
8940
|
}
|
|
8724
8941
|
process.exit(1);
|
|
8725
8942
|
}
|