@fractary/codex-cli 0.9.1 → 0.10.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/README.md +2 -2
- package/dist/cli.cjs +235 -407
- package/dist/cli.cjs.map +1 -1
- package/dist/cli.js +234 -406
- package/dist/cli.js.map +1 -1
- package/package.json +2 -2
package/dist/cli.cjs
CHANGED
|
@@ -8,7 +8,7 @@ var codex = require('@fractary/codex');
|
|
|
8
8
|
var os = require('os');
|
|
9
9
|
var child_process = require('child_process');
|
|
10
10
|
var commander = require('commander');
|
|
11
|
-
var
|
|
11
|
+
var chalk7 = require('chalk');
|
|
12
12
|
var crypto = require('crypto');
|
|
13
13
|
var fs = require('fs');
|
|
14
14
|
var url = require('url');
|
|
@@ -37,7 +37,7 @@ var fs__namespace = /*#__PURE__*/_interopNamespace(fs$1);
|
|
|
37
37
|
var path4__namespace = /*#__PURE__*/_interopNamespace(path4);
|
|
38
38
|
var yaml__namespace = /*#__PURE__*/_interopNamespace(yaml);
|
|
39
39
|
var os__namespace = /*#__PURE__*/_interopNamespace(os);
|
|
40
|
-
var
|
|
40
|
+
var chalk7__default = /*#__PURE__*/_interopDefault(chalk7);
|
|
41
41
|
var crypto__namespace = /*#__PURE__*/_interopNamespace(crypto);
|
|
42
42
|
|
|
43
43
|
var __defProp = Object.defineProperty;
|
|
@@ -829,14 +829,14 @@ function fetchCommand() {
|
|
|
829
829
|
try {
|
|
830
830
|
const { validateUri } = await import('@fractary/codex');
|
|
831
831
|
if (!validateUri(uri)) {
|
|
832
|
-
console.error(
|
|
833
|
-
console.log(
|
|
834
|
-
console.log(
|
|
832
|
+
console.error(chalk7__default.default.red("Error: Invalid URI format"));
|
|
833
|
+
console.log(chalk7__default.default.dim("Expected: codex://org/project/path/to/file.md"));
|
|
834
|
+
console.log(chalk7__default.default.dim("Example: codex://fractary/codex/docs/api.md"));
|
|
835
835
|
process.exit(1);
|
|
836
836
|
}
|
|
837
837
|
const client = await getClient();
|
|
838
838
|
if (!options.json && !options.bypassCache) {
|
|
839
|
-
console.error(
|
|
839
|
+
console.error(chalk7__default.default.dim(`Fetching ${uri}...`));
|
|
840
840
|
}
|
|
841
841
|
const result = await client.fetch(uri, {
|
|
842
842
|
bypassCache: options.bypassCache,
|
|
@@ -857,30 +857,30 @@ function fetchCommand() {
|
|
|
857
857
|
console.log(JSON.stringify(output, null, 2));
|
|
858
858
|
} else if (options.output) {
|
|
859
859
|
await fs__namespace.writeFile(options.output, result.content);
|
|
860
|
-
console.log(
|
|
861
|
-
console.log(
|
|
860
|
+
console.log(chalk7__default.default.green("\u2713"), `Written to ${options.output}`);
|
|
861
|
+
console.log(chalk7__default.default.dim(` Size: ${result.content.length} bytes`));
|
|
862
862
|
if (result.fromCache) {
|
|
863
|
-
console.log(
|
|
863
|
+
console.log(chalk7__default.default.dim(" Source: cache"));
|
|
864
864
|
} else {
|
|
865
|
-
console.log(
|
|
865
|
+
console.log(chalk7__default.default.dim(" Source: storage"));
|
|
866
866
|
}
|
|
867
867
|
} else {
|
|
868
868
|
if (result.fromCache && !options.bypassCache) {
|
|
869
|
-
console.error(
|
|
869
|
+
console.error(chalk7__default.default.green("\u2713"), chalk7__default.default.dim("from cache\n"));
|
|
870
870
|
} else {
|
|
871
|
-
console.error(
|
|
871
|
+
console.error(chalk7__default.default.green("\u2713"), chalk7__default.default.dim("fetched\n"));
|
|
872
872
|
}
|
|
873
873
|
console.log(result.content.toString("utf-8"));
|
|
874
874
|
}
|
|
875
875
|
} catch (error) {
|
|
876
|
-
console.error(
|
|
876
|
+
console.error(chalk7__default.default.red("Error:"), error.message);
|
|
877
877
|
if (error.message.includes("Failed to load configuration")) {
|
|
878
|
-
console.log(
|
|
878
|
+
console.log(chalk7__default.default.dim('\nRun "fractary codex init" to create a configuration.'));
|
|
879
879
|
} else if (error.message.includes("GITHUB_TOKEN")) {
|
|
880
|
-
console.log(
|
|
880
|
+
console.log(chalk7__default.default.dim('\nSet your GitHub token: export GITHUB_TOKEN="your_token"'));
|
|
881
881
|
} else if (error.message.includes("not found") || error.message.includes("404")) {
|
|
882
|
-
console.log(
|
|
883
|
-
console.log(
|
|
882
|
+
console.log(chalk7__default.default.dim("\nThe document may not exist or you may not have access."));
|
|
883
|
+
console.log(chalk7__default.default.dim("Check the URI and ensure your storage providers are configured correctly."));
|
|
884
884
|
}
|
|
885
885
|
process.exit(1);
|
|
886
886
|
}
|
|
@@ -1032,7 +1032,6 @@ var DEFAULT_FRACTARY_GITIGNORE = `# .fractary/.gitignore
|
|
|
1032
1032
|
codex/cache/
|
|
1033
1033
|
# ===== end fractary-codex =====
|
|
1034
1034
|
`;
|
|
1035
|
-
var DEFAULT_CACHE_DIR = "codex/cache/";
|
|
1036
1035
|
async function readFractaryGitignore(projectRoot) {
|
|
1037
1036
|
const gitignorePath = path4__namespace.join(projectRoot, ".fractary", ".gitignore");
|
|
1038
1037
|
try {
|
|
@@ -1147,7 +1146,7 @@ function initCommand() {
|
|
|
1147
1146
|
const cmd = new commander.Command("init");
|
|
1148
1147
|
cmd.description("Initialize unified Fractary configuration (.fractary/config.yaml)").option("--org <slug>", 'Organization slug (e.g., "fractary")').option("--project <name>", "Project name (default: derived from directory)").option("--force", "Overwrite existing configuration").action(async (options) => {
|
|
1149
1148
|
try {
|
|
1150
|
-
console.log(
|
|
1149
|
+
console.log(chalk7__default.default.blue("Initializing unified Fractary configuration...\n"));
|
|
1151
1150
|
let org = options.org;
|
|
1152
1151
|
if (!org) {
|
|
1153
1152
|
org = await getOrgFromGitRemote();
|
|
@@ -1163,23 +1162,23 @@ function initCommand() {
|
|
|
1163
1162
|
}
|
|
1164
1163
|
if (!org) {
|
|
1165
1164
|
org = path4__namespace.basename(process.cwd()).split("-")[0] || "default";
|
|
1166
|
-
console.log(
|
|
1167
|
-
console.log(
|
|
1165
|
+
console.log(chalk7__default.default.yellow(`\u26A0 Could not detect organization, using: ${org}`));
|
|
1166
|
+
console.log(chalk7__default.default.dim(" Use --org <slug> to specify explicitly\n"));
|
|
1168
1167
|
} else {
|
|
1169
|
-
console.log(
|
|
1168
|
+
console.log(chalk7__default.default.dim(`Organization: ${chalk7__default.default.cyan(org)}
|
|
1170
1169
|
`));
|
|
1171
1170
|
}
|
|
1172
1171
|
let project = options.project;
|
|
1173
1172
|
if (!project) {
|
|
1174
1173
|
project = path4__namespace.basename(process.cwd());
|
|
1175
|
-
console.log(
|
|
1174
|
+
console.log(chalk7__default.default.dim(`Project: ${chalk7__default.default.cyan(project)}
|
|
1176
1175
|
`));
|
|
1177
1176
|
}
|
|
1178
1177
|
const configPath = path4__namespace.join(process.cwd(), ".fractary", "config.yaml");
|
|
1179
1178
|
const configExists = await fileExists(configPath);
|
|
1180
1179
|
if (configExists && !options.force) {
|
|
1181
|
-
console.log(
|
|
1182
|
-
console.log(
|
|
1180
|
+
console.log(chalk7__default.default.yellow(`\u26A0 Configuration already exists at .fractary/config.yaml`));
|
|
1181
|
+
console.log(chalk7__default.default.dim("Merging with existing configuration...\n"));
|
|
1183
1182
|
}
|
|
1184
1183
|
console.log("Creating directory structure...");
|
|
1185
1184
|
const dirs = [
|
|
@@ -1191,15 +1190,15 @@ function initCommand() {
|
|
|
1191
1190
|
];
|
|
1192
1191
|
for (const dir of dirs) {
|
|
1193
1192
|
await fs__namespace.mkdir(path4__namespace.join(process.cwd(), dir), { recursive: true });
|
|
1194
|
-
console.log(
|
|
1193
|
+
console.log(chalk7__default.default.green("\u2713"), chalk7__default.default.dim(dir + "/"));
|
|
1195
1194
|
}
|
|
1196
1195
|
const gitignoreResult = await ensureCachePathIgnored(process.cwd(), ".fractary/codex/cache");
|
|
1197
1196
|
if (gitignoreResult.created) {
|
|
1198
|
-
console.log(
|
|
1197
|
+
console.log(chalk7__default.default.green("\u2713"), chalk7__default.default.dim(".fractary/.gitignore (created)"));
|
|
1199
1198
|
} else if (gitignoreResult.updated) {
|
|
1200
|
-
console.log(
|
|
1199
|
+
console.log(chalk7__default.default.green("\u2713"), chalk7__default.default.dim(".fractary/.gitignore (updated)"));
|
|
1201
1200
|
} else {
|
|
1202
|
-
console.log(
|
|
1201
|
+
console.log(chalk7__default.default.green("\u2713"), chalk7__default.default.dim(".fractary/.gitignore (exists)"));
|
|
1203
1202
|
}
|
|
1204
1203
|
console.log("\nInitializing configuration...");
|
|
1205
1204
|
const result = await initializeUnifiedConfig(
|
|
@@ -1209,198 +1208,28 @@ function initCommand() {
|
|
|
1209
1208
|
{ force: options.force }
|
|
1210
1209
|
);
|
|
1211
1210
|
if (result.created) {
|
|
1212
|
-
console.log(
|
|
1211
|
+
console.log(chalk7__default.default.green("\u2713"), chalk7__default.default.dim(".fractary/config.yaml (created)"));
|
|
1213
1212
|
} else if (result.merged) {
|
|
1214
|
-
console.log(
|
|
1215
|
-
}
|
|
1216
|
-
console.log(
|
|
1217
|
-
console.log(
|
|
1218
|
-
console.log(
|
|
1219
|
-
console.log(
|
|
1220
|
-
console.log(
|
|
1221
|
-
console.log(
|
|
1222
|
-
console.log(
|
|
1223
|
-
console.log(
|
|
1224
|
-
console.log(
|
|
1225
|
-
console.log(
|
|
1226
|
-
console.log(
|
|
1227
|
-
console.log(
|
|
1228
|
-
console.log(
|
|
1229
|
-
console.log(
|
|
1230
|
-
console.log(
|
|
1231
|
-
console.log(
|
|
1213
|
+
console.log(chalk7__default.default.green("\u2713"), chalk7__default.default.dim(".fractary/config.yaml (merged with existing)"));
|
|
1214
|
+
}
|
|
1215
|
+
console.log(chalk7__default.default.green("\n\u2713 Unified configuration initialized successfully!\n"));
|
|
1216
|
+
console.log(chalk7__default.default.bold("Configuration:"));
|
|
1217
|
+
console.log(chalk7__default.default.dim(` Organization: ${org}`));
|
|
1218
|
+
console.log(chalk7__default.default.dim(` Project: ${project}`));
|
|
1219
|
+
console.log(chalk7__default.default.dim(` Config: .fractary/config.yaml`));
|
|
1220
|
+
console.log(chalk7__default.default.bold("\nFile plugin sources:"));
|
|
1221
|
+
console.log(chalk7__default.default.dim(" - specs: .fractary/specs/ \u2192 S3"));
|
|
1222
|
+
console.log(chalk7__default.default.dim(" - logs: .fractary/logs/ \u2192 S3"));
|
|
1223
|
+
console.log(chalk7__default.default.bold("\nCodex plugin:"));
|
|
1224
|
+
console.log(chalk7__default.default.dim(" - Cache: .fractary/codex/cache/"));
|
|
1225
|
+
console.log(chalk7__default.default.dim(" - Dependencies: (none configured)"));
|
|
1226
|
+
console.log(chalk7__default.default.bold("\nNext steps:"));
|
|
1227
|
+
console.log(chalk7__default.default.dim(" 1. Configure AWS credentials for S3 access"));
|
|
1228
|
+
console.log(chalk7__default.default.dim(" 2. Edit .fractary/config.yaml to add external project dependencies"));
|
|
1229
|
+
console.log(chalk7__default.default.dim(" 3. Access current project files: codex://specs/SPEC-001.md"));
|
|
1230
|
+
console.log(chalk7__default.default.dim(" 4. Access external projects: codex://org/project/docs/README.md"));
|
|
1232
1231
|
} catch (error) {
|
|
1233
|
-
console.error(
|
|
1234
|
-
process.exit(1);
|
|
1235
|
-
}
|
|
1236
|
-
});
|
|
1237
|
-
return cmd;
|
|
1238
|
-
}
|
|
1239
|
-
|
|
1240
|
-
// src/commands/config/migrate.ts
|
|
1241
|
-
init_cjs_shims();
|
|
1242
|
-
init_migrate_config();
|
|
1243
|
-
async function fileExists2(filePath) {
|
|
1244
|
-
try {
|
|
1245
|
-
await fs__namespace.access(filePath);
|
|
1246
|
-
return true;
|
|
1247
|
-
} catch {
|
|
1248
|
-
return false;
|
|
1249
|
-
}
|
|
1250
|
-
}
|
|
1251
|
-
async function readFileContent(filePath) {
|
|
1252
|
-
return fs__namespace.readFile(filePath, "utf-8");
|
|
1253
|
-
}
|
|
1254
|
-
function migrateCommand() {
|
|
1255
|
-
const cmd = new commander.Command("migrate");
|
|
1256
|
-
cmd.description("Migrate legacy JSON configuration to v3.0 YAML format").option("--dry-run", "Show migration plan without executing").option("--no-backup", "Skip creating backup of old config").option("--json", "Output as JSON").action(async (options) => {
|
|
1257
|
-
try {
|
|
1258
|
-
const legacyConfigPath = path4__namespace.join(process.cwd(), ".fractary", "plugins", "codex", "config.json");
|
|
1259
|
-
const newConfigPath = path4__namespace.join(process.cwd(), ".fractary", "codex", "config.yaml");
|
|
1260
|
-
if (!await fileExists2(legacyConfigPath)) {
|
|
1261
|
-
if (options.json) {
|
|
1262
|
-
console.log(JSON.stringify({
|
|
1263
|
-
status: "no_config",
|
|
1264
|
-
message: "No legacy configuration file found",
|
|
1265
|
-
path: legacyConfigPath
|
|
1266
|
-
}));
|
|
1267
|
-
} else {
|
|
1268
|
-
console.log(chalk8__default.default.yellow("\u26A0 No legacy configuration file found."));
|
|
1269
|
-
console.log(chalk8__default.default.dim(` Expected: ${legacyConfigPath}`));
|
|
1270
|
-
console.log(chalk8__default.default.dim('\nRun "fractary codex init" to create a new v3.0 YAML configuration.'));
|
|
1271
|
-
}
|
|
1272
|
-
return;
|
|
1273
|
-
}
|
|
1274
|
-
if (await fileExists2(newConfigPath) && !options.dryRun) {
|
|
1275
|
-
if (options.json) {
|
|
1276
|
-
console.log(JSON.stringify({
|
|
1277
|
-
status: "already_migrated",
|
|
1278
|
-
message: "YAML configuration already exists",
|
|
1279
|
-
path: newConfigPath
|
|
1280
|
-
}));
|
|
1281
|
-
} else {
|
|
1282
|
-
console.log(chalk8__default.default.yellow("\u26A0 YAML configuration already exists."));
|
|
1283
|
-
console.log(chalk8__default.default.dim(` Path: ${newConfigPath}`));
|
|
1284
|
-
console.log(chalk8__default.default.dim('\nUse "fractary codex init --force" to recreate.'));
|
|
1285
|
-
}
|
|
1286
|
-
return;
|
|
1287
|
-
}
|
|
1288
|
-
const legacyContent = await readFileContent(legacyConfigPath);
|
|
1289
|
-
let legacyConfig;
|
|
1290
|
-
try {
|
|
1291
|
-
legacyConfig = JSON.parse(legacyContent);
|
|
1292
|
-
} catch (parseError) {
|
|
1293
|
-
console.error(chalk8__default.default.red("Error:"), "Invalid JSON in legacy config file.");
|
|
1294
|
-
console.error(chalk8__default.default.dim("Details:"), parseError.message);
|
|
1295
|
-
process.exit(1);
|
|
1296
|
-
}
|
|
1297
|
-
if (!options.json && !options.dryRun) {
|
|
1298
|
-
console.log(chalk8__default.default.blue("Migrating Codex configuration to v3.0 YAML format...\n"));
|
|
1299
|
-
}
|
|
1300
|
-
const migrationResult = await migrateConfig(
|
|
1301
|
-
legacyConfigPath,
|
|
1302
|
-
{
|
|
1303
|
-
createBackup: options.backup !== false,
|
|
1304
|
-
backupSuffix: (/* @__PURE__ */ new Date()).toISOString().replace(/[:.]/g, "-")
|
|
1305
|
-
}
|
|
1306
|
-
);
|
|
1307
|
-
if (!options.json) {
|
|
1308
|
-
console.log(chalk8__default.default.bold("Legacy Configuration:"));
|
|
1309
|
-
console.log(chalk8__default.default.dim(` Path: ${legacyConfigPath}`));
|
|
1310
|
-
console.log(chalk8__default.default.dim(` Organization: ${legacyConfig.organization || legacyConfig.organizationSlug || "unknown"}`));
|
|
1311
|
-
console.log("");
|
|
1312
|
-
console.log(chalk8__default.default.bold("Migration Changes:"));
|
|
1313
|
-
console.log(chalk8__default.default.green(" + Format: JSON \u2192 YAML"));
|
|
1314
|
-
console.log(chalk8__default.default.green(" + Location: .fractary/plugins/codex/ \u2192 .fractary/"));
|
|
1315
|
-
console.log(chalk8__default.default.green(" + File: config.json \u2192 codex.yaml"));
|
|
1316
|
-
console.log(chalk8__default.default.green(" + Storage: Multi-provider configuration"));
|
|
1317
|
-
console.log(chalk8__default.default.green(" + Cache: Modern cache management"));
|
|
1318
|
-
console.log(chalk8__default.default.green(" + Types: Custom type registry"));
|
|
1319
|
-
if (migrationResult.warnings.length > 0) {
|
|
1320
|
-
console.log("");
|
|
1321
|
-
console.log(chalk8__default.default.yellow("Warnings:"));
|
|
1322
|
-
for (const warning of migrationResult.warnings) {
|
|
1323
|
-
console.log(chalk8__default.default.yellow(" \u26A0"), chalk8__default.default.dim(warning));
|
|
1324
|
-
}
|
|
1325
|
-
}
|
|
1326
|
-
console.log("");
|
|
1327
|
-
if (options.dryRun) {
|
|
1328
|
-
console.log(chalk8__default.default.blue("Dry run - no changes made."));
|
|
1329
|
-
console.log(chalk8__default.default.dim("Run without --dry-run to execute migration."));
|
|
1330
|
-
return;
|
|
1331
|
-
}
|
|
1332
|
-
}
|
|
1333
|
-
if (options.json) {
|
|
1334
|
-
const output = {
|
|
1335
|
-
status: options.dryRun ? "migration_ready" : "migrated",
|
|
1336
|
-
dryRun: options.dryRun || false,
|
|
1337
|
-
legacyConfig: {
|
|
1338
|
-
path: legacyConfigPath,
|
|
1339
|
-
organization: legacyConfig.organization || legacyConfig.organizationSlug
|
|
1340
|
-
},
|
|
1341
|
-
newConfig: {
|
|
1342
|
-
path: newConfigPath,
|
|
1343
|
-
organization: migrationResult.yamlConfig.organization
|
|
1344
|
-
},
|
|
1345
|
-
warnings: migrationResult.warnings,
|
|
1346
|
-
backupPath: migrationResult.backupPath
|
|
1347
|
-
};
|
|
1348
|
-
console.log(JSON.stringify(output, null, 2));
|
|
1349
|
-
if (options.dryRun) {
|
|
1350
|
-
return;
|
|
1351
|
-
}
|
|
1352
|
-
}
|
|
1353
|
-
if (!options.dryRun) {
|
|
1354
|
-
await writeYamlConfig(migrationResult.yamlConfig, newConfigPath);
|
|
1355
|
-
const configuredCacheDir = migrationResult.yamlConfig.cacheDir || ".fractary/codex/cache";
|
|
1356
|
-
const cacheDir = path4__namespace.join(process.cwd(), configuredCacheDir);
|
|
1357
|
-
await fs__namespace.mkdir(cacheDir, { recursive: true });
|
|
1358
|
-
const gitignoreResult = await ensureCachePathIgnored(process.cwd(), configuredCacheDir);
|
|
1359
|
-
const isCustomCachePath = normalizeCachePath(configuredCacheDir) !== DEFAULT_CACHE_DIR;
|
|
1360
|
-
if (!options.json) {
|
|
1361
|
-
console.log(chalk8__default.default.green("\u2713"), "YAML configuration created");
|
|
1362
|
-
console.log(chalk8__default.default.green("\u2713"), "Cache directory initialized");
|
|
1363
|
-
if (migrationResult.backupPath) {
|
|
1364
|
-
console.log(chalk8__default.default.green("\u2713"), "Legacy config backed up");
|
|
1365
|
-
}
|
|
1366
|
-
if (gitignoreResult.created) {
|
|
1367
|
-
console.log(chalk8__default.default.green("\u2713"), ".fractary/.gitignore created");
|
|
1368
|
-
} else if (gitignoreResult.updated) {
|
|
1369
|
-
console.log(chalk8__default.default.green("\u2713"), ".fractary/.gitignore updated with cache path");
|
|
1370
|
-
} else if (gitignoreResult.alreadyIgnored) {
|
|
1371
|
-
console.log(chalk8__default.default.green("\u2713"), "Cache path already in .fractary/.gitignore");
|
|
1372
|
-
}
|
|
1373
|
-
if (isCustomCachePath) {
|
|
1374
|
-
console.log("");
|
|
1375
|
-
console.log(chalk8__default.default.yellow("\u26A0 Custom cache directory detected:"), chalk8__default.default.dim(configuredCacheDir));
|
|
1376
|
-
console.log(chalk8__default.default.dim(" Ensure .fractary/.gitignore includes this path to avoid committing cache files."));
|
|
1377
|
-
}
|
|
1378
|
-
console.log("");
|
|
1379
|
-
console.log(chalk8__default.default.bold("New Configuration:"));
|
|
1380
|
-
console.log(chalk8__default.default.dim(` Path: ${newConfigPath}`));
|
|
1381
|
-
console.log(chalk8__default.default.dim(` Organization: ${migrationResult.yamlConfig.organization}`));
|
|
1382
|
-
console.log(chalk8__default.default.dim(` Cache: ${configuredCacheDir}`));
|
|
1383
|
-
console.log(chalk8__default.default.dim(` Storage Providers: ${migrationResult.yamlConfig.storage?.length || 0}`));
|
|
1384
|
-
console.log("");
|
|
1385
|
-
console.log(chalk8__default.default.bold("Next Steps:"));
|
|
1386
|
-
console.log(chalk8__default.default.dim(" 1. Review the new configuration: .fractary/codex/config.yaml"));
|
|
1387
|
-
console.log(chalk8__default.default.dim(' 2. Set your GitHub token: export GITHUB_TOKEN="your_token"'));
|
|
1388
|
-
console.log(chalk8__default.default.dim(" 3. Test fetching: fractary codex fetch codex://org/project/path"));
|
|
1389
|
-
if (migrationResult.backupPath) {
|
|
1390
|
-
console.log("");
|
|
1391
|
-
console.log(chalk8__default.default.dim(`Backup saved: ${path4__namespace.basename(migrationResult.backupPath)}`));
|
|
1392
|
-
}
|
|
1393
|
-
}
|
|
1394
|
-
}
|
|
1395
|
-
} catch (error) {
|
|
1396
|
-
if (options.json) {
|
|
1397
|
-
console.log(JSON.stringify({
|
|
1398
|
-
status: "error",
|
|
1399
|
-
message: error.message
|
|
1400
|
-
}));
|
|
1401
|
-
} else {
|
|
1402
|
-
console.error(chalk8__default.default.red("Error:"), error.message);
|
|
1403
|
-
}
|
|
1232
|
+
console.error(chalk7__default.default.red("Error:"), error.message);
|
|
1404
1233
|
process.exit(1);
|
|
1405
1234
|
}
|
|
1406
1235
|
});
|
|
@@ -1412,7 +1241,6 @@ function configCommand() {
|
|
|
1412
1241
|
const cmd = new commander.Command("config");
|
|
1413
1242
|
cmd.description("Manage configuration");
|
|
1414
1243
|
cmd.addCommand(initCommand());
|
|
1415
|
-
cmd.addCommand(migrateCommand());
|
|
1416
1244
|
return cmd;
|
|
1417
1245
|
}
|
|
1418
1246
|
|
|
@@ -1436,8 +1264,8 @@ function cacheListCommand() {
|
|
|
1436
1264
|
if (options.json) {
|
|
1437
1265
|
console.log(JSON.stringify({ entries: 0, message: "Cache is empty" }));
|
|
1438
1266
|
} else {
|
|
1439
|
-
console.log(
|
|
1440
|
-
console.log(
|
|
1267
|
+
console.log(chalk7__default.default.yellow("Cache is empty."));
|
|
1268
|
+
console.log(chalk7__default.default.dim("Fetch some documents to populate the cache."));
|
|
1441
1269
|
}
|
|
1442
1270
|
return;
|
|
1443
1271
|
}
|
|
@@ -1451,25 +1279,25 @@ function cacheListCommand() {
|
|
|
1451
1279
|
}, null, 2));
|
|
1452
1280
|
return;
|
|
1453
1281
|
}
|
|
1454
|
-
console.log(
|
|
1455
|
-
console.log(
|
|
1456
|
-
console.log(` Total: ${
|
|
1457
|
-
console.log(` Fresh: ${
|
|
1458
|
-
console.log(` Stale: ${stats.staleCount > 0 ?
|
|
1459
|
-
console.log(` Expired: ${stats.expiredCount > 0 ?
|
|
1282
|
+
console.log(chalk7__default.default.bold("Cache Overview\n"));
|
|
1283
|
+
console.log(chalk7__default.default.bold("Entries:"));
|
|
1284
|
+
console.log(` Total: ${chalk7__default.default.cyan(stats.entryCount.toString())} entries`);
|
|
1285
|
+
console.log(` Fresh: ${chalk7__default.default.green(stats.freshCount.toString())} entries`);
|
|
1286
|
+
console.log(` Stale: ${stats.staleCount > 0 ? chalk7__default.default.yellow(stats.staleCount.toString()) : chalk7__default.default.dim("0")} entries`);
|
|
1287
|
+
console.log(` Expired: ${stats.expiredCount > 0 ? chalk7__default.default.red(stats.expiredCount.toString()) : chalk7__default.default.dim("0")} entries`);
|
|
1460
1288
|
console.log("");
|
|
1461
|
-
console.log(
|
|
1462
|
-
console.log(` Total size: ${
|
|
1289
|
+
console.log(chalk7__default.default.bold("Storage:"));
|
|
1290
|
+
console.log(` Total size: ${chalk7__default.default.cyan(formatSize(stats.totalSize))}`);
|
|
1463
1291
|
console.log("");
|
|
1464
1292
|
const healthPercent = stats.entryCount > 0 ? stats.freshCount / stats.entryCount * 100 : 100;
|
|
1465
|
-
const healthColor = healthPercent > 80 ?
|
|
1293
|
+
const healthColor = healthPercent > 80 ? chalk7__default.default.green : healthPercent > 50 ? chalk7__default.default.yellow : chalk7__default.default.red;
|
|
1466
1294
|
console.log(`Cache health: ${healthColor(`${healthPercent.toFixed(0)}% fresh`)}`);
|
|
1467
1295
|
console.log("");
|
|
1468
|
-
console.log(
|
|
1469
|
-
console.log(
|
|
1470
|
-
console.log(
|
|
1296
|
+
console.log(chalk7__default.default.dim("Note: Individual cache entries are managed by the SDK."));
|
|
1297
|
+
console.log(chalk7__default.default.dim('Use "fractary codex cache stats" for detailed statistics.'));
|
|
1298
|
+
console.log(chalk7__default.default.dim('Use "fractary codex cache clear" to clear cache entries.'));
|
|
1471
1299
|
} catch (error) {
|
|
1472
|
-
console.error(
|
|
1300
|
+
console.error(chalk7__default.default.red("Error:"), error.message);
|
|
1473
1301
|
process.exit(1);
|
|
1474
1302
|
}
|
|
1475
1303
|
});
|
|
@@ -1485,7 +1313,7 @@ function cacheClearCommand() {
|
|
|
1485
1313
|
const client = await getClient();
|
|
1486
1314
|
const statsBefore = await client.getCacheStats();
|
|
1487
1315
|
if (statsBefore.entryCount === 0) {
|
|
1488
|
-
console.log(
|
|
1316
|
+
console.log(chalk7__default.default.yellow("Cache is already empty. Nothing to clear."));
|
|
1489
1317
|
return;
|
|
1490
1318
|
}
|
|
1491
1319
|
let pattern;
|
|
@@ -1494,45 +1322,45 @@ function cacheClearCommand() {
|
|
|
1494
1322
|
} else if (options.pattern) {
|
|
1495
1323
|
pattern = options.pattern;
|
|
1496
1324
|
} else {
|
|
1497
|
-
console.log(
|
|
1498
|
-
console.log(
|
|
1499
|
-
console.log(
|
|
1325
|
+
console.log(chalk7__default.default.yellow("Please specify what to clear:"));
|
|
1326
|
+
console.log(chalk7__default.default.dim(" --all Clear entire cache"));
|
|
1327
|
+
console.log(chalk7__default.default.dim(' --pattern Clear entries matching pattern (e.g., "codex://fractary/*")'));
|
|
1500
1328
|
console.log("");
|
|
1501
|
-
console.log(
|
|
1502
|
-
console.log(
|
|
1503
|
-
console.log(
|
|
1329
|
+
console.log(chalk7__default.default.dim("Examples:"));
|
|
1330
|
+
console.log(chalk7__default.default.dim(" fractary codex cache clear --all"));
|
|
1331
|
+
console.log(chalk7__default.default.dim(' fractary codex cache clear --pattern "codex://fractary/cli/*"'));
|
|
1504
1332
|
return;
|
|
1505
1333
|
}
|
|
1506
1334
|
if (options.dryRun) {
|
|
1507
|
-
console.log(
|
|
1335
|
+
console.log(chalk7__default.default.blue("Dry run - would clear:\n"));
|
|
1508
1336
|
if (pattern) {
|
|
1509
|
-
console.log(
|
|
1510
|
-
console.log(
|
|
1337
|
+
console.log(chalk7__default.default.dim(` Pattern: ${pattern}`));
|
|
1338
|
+
console.log(chalk7__default.default.dim(` This would invalidate matching cache entries`));
|
|
1511
1339
|
} else {
|
|
1512
|
-
console.log(
|
|
1340
|
+
console.log(chalk7__default.default.dim(` All cache entries (${statsBefore.entryCount} entries)`));
|
|
1513
1341
|
}
|
|
1514
|
-
console.log(
|
|
1342
|
+
console.log(chalk7__default.default.dim(`
|
|
1515
1343
|
Total size: ${formatSize2(statsBefore.totalSize)}`));
|
|
1516
1344
|
return;
|
|
1517
1345
|
}
|
|
1518
1346
|
if (pattern) {
|
|
1519
|
-
console.log(
|
|
1347
|
+
console.log(chalk7__default.default.blue(`Clearing cache entries matching pattern: ${pattern}
|
|
1520
1348
|
`));
|
|
1521
1349
|
await client.invalidateCache(pattern);
|
|
1522
1350
|
} else {
|
|
1523
|
-
console.log(
|
|
1351
|
+
console.log(chalk7__default.default.blue(`Clearing entire cache (${statsBefore.entryCount} entries)...
|
|
1524
1352
|
`));
|
|
1525
1353
|
await client.invalidateCache();
|
|
1526
1354
|
}
|
|
1527
1355
|
const statsAfter = await client.getCacheStats();
|
|
1528
1356
|
const entriesCleared = statsBefore.entryCount - statsAfter.entryCount;
|
|
1529
1357
|
const sizeFreed = statsBefore.totalSize - statsAfter.totalSize;
|
|
1530
|
-
console.log(
|
|
1358
|
+
console.log(chalk7__default.default.green(`\u2713 Cleared ${entriesCleared} entries (${formatSize2(sizeFreed)} freed)`));
|
|
1531
1359
|
if (statsAfter.entryCount > 0) {
|
|
1532
|
-
console.log(
|
|
1360
|
+
console.log(chalk7__default.default.dim(` Remaining: ${statsAfter.entryCount} entries (${formatSize2(statsAfter.totalSize)})`));
|
|
1533
1361
|
}
|
|
1534
1362
|
} catch (error) {
|
|
1535
|
-
console.error(
|
|
1363
|
+
console.error(chalk7__default.default.red("Error:"), error.message);
|
|
1536
1364
|
process.exit(1);
|
|
1537
1365
|
}
|
|
1538
1366
|
});
|
|
@@ -1561,25 +1389,25 @@ function cacheStatsCommand() {
|
|
|
1561
1389
|
console.log(JSON.stringify(stats, null, 2));
|
|
1562
1390
|
return;
|
|
1563
1391
|
}
|
|
1564
|
-
console.log(
|
|
1565
|
-
console.log(
|
|
1566
|
-
console.log(` Total entries: ${
|
|
1567
|
-
console.log(` Total size: ${
|
|
1568
|
-
console.log(` Fresh entries: ${
|
|
1569
|
-
console.log(` Stale entries: ${stats.staleCount > 0 ?
|
|
1570
|
-
console.log(` Expired entries: ${stats.expiredCount > 0 ?
|
|
1392
|
+
console.log(chalk7__default.default.bold("Cache Statistics\n"));
|
|
1393
|
+
console.log(chalk7__default.default.bold("Overview"));
|
|
1394
|
+
console.log(` Total entries: ${chalk7__default.default.cyan(stats.entryCount.toString())}`);
|
|
1395
|
+
console.log(` Total size: ${chalk7__default.default.cyan(formatSize3(stats.totalSize))}`);
|
|
1396
|
+
console.log(` Fresh entries: ${chalk7__default.default.green(stats.freshCount.toString())}`);
|
|
1397
|
+
console.log(` Stale entries: ${stats.staleCount > 0 ? chalk7__default.default.yellow(stats.staleCount.toString()) : chalk7__default.default.dim("0")}`);
|
|
1398
|
+
console.log(` Expired entries: ${stats.expiredCount > 0 ? chalk7__default.default.red(stats.expiredCount.toString()) : chalk7__default.default.dim("0")}`);
|
|
1571
1399
|
console.log("");
|
|
1572
1400
|
const healthPercent = stats.entryCount > 0 ? stats.freshCount / stats.entryCount * 100 : 100;
|
|
1573
|
-
const healthColor = healthPercent > 80 ?
|
|
1401
|
+
const healthColor = healthPercent > 80 ? chalk7__default.default.green : healthPercent > 50 ? chalk7__default.default.yellow : chalk7__default.default.red;
|
|
1574
1402
|
console.log(`Cache health: ${healthColor(`${healthPercent.toFixed(0)}% fresh`)}`);
|
|
1575
1403
|
if (stats.expiredCount > 0) {
|
|
1576
|
-
console.log(
|
|
1404
|
+
console.log(chalk7__default.default.dim('\nRun "fractary codex cache clear --pattern <pattern>" to clean up entries.'));
|
|
1577
1405
|
}
|
|
1578
1406
|
if (stats.entryCount === 0) {
|
|
1579
|
-
console.log(
|
|
1407
|
+
console.log(chalk7__default.default.dim("\nNo cached entries. Fetch some documents to populate the cache."));
|
|
1580
1408
|
}
|
|
1581
1409
|
} catch (error) {
|
|
1582
|
-
console.error(
|
|
1410
|
+
console.error(chalk7__default.default.red("Error:"), error.message);
|
|
1583
1411
|
process.exit(1);
|
|
1584
1412
|
}
|
|
1585
1413
|
});
|
|
@@ -1589,7 +1417,7 @@ function cacheStatsCommand() {
|
|
|
1589
1417
|
// src/commands/cache/health.ts
|
|
1590
1418
|
init_cjs_shims();
|
|
1591
1419
|
init_migrate_config();
|
|
1592
|
-
async function
|
|
1420
|
+
async function fileExists2(filePath) {
|
|
1593
1421
|
try {
|
|
1594
1422
|
await fs__namespace.access(filePath);
|
|
1595
1423
|
return true;
|
|
@@ -1598,11 +1426,11 @@ async function fileExists3(filePath) {
|
|
|
1598
1426
|
}
|
|
1599
1427
|
}
|
|
1600
1428
|
async function checkConfiguration() {
|
|
1601
|
-
const configPath = path4__namespace.join(process.cwd(), ".fractary", "
|
|
1429
|
+
const configPath = path4__namespace.join(process.cwd(), ".fractary", "config.yaml");
|
|
1602
1430
|
const legacyConfigPath = path4__namespace.join(process.cwd(), ".fractary", "plugins", "codex", "config.json");
|
|
1603
1431
|
try {
|
|
1604
|
-
if (!await
|
|
1605
|
-
if (await
|
|
1432
|
+
if (!await fileExists2(configPath)) {
|
|
1433
|
+
if (await fileExists2(legacyConfigPath)) {
|
|
1606
1434
|
return {
|
|
1607
1435
|
name: "Configuration",
|
|
1608
1436
|
status: "warn",
|
|
@@ -1706,7 +1534,7 @@ async function checkCache() {
|
|
|
1706
1534
|
}
|
|
1707
1535
|
}
|
|
1708
1536
|
async function checkStorage() {
|
|
1709
|
-
const configPath = path4__namespace.join(process.cwd(), ".fractary", "
|
|
1537
|
+
const configPath = path4__namespace.join(process.cwd(), ".fractary", "config.yaml");
|
|
1710
1538
|
try {
|
|
1711
1539
|
const config = await readYamlConfig(configPath);
|
|
1712
1540
|
const providers = config.storage || [];
|
|
@@ -1715,7 +1543,7 @@ async function checkStorage() {
|
|
|
1715
1543
|
name: "Storage",
|
|
1716
1544
|
status: "warn",
|
|
1717
1545
|
message: "No storage providers configured",
|
|
1718
|
-
details: "Configure at least one provider in .fractary/
|
|
1546
|
+
details: "Configure at least one provider in .fractary/config.yaml"
|
|
1719
1547
|
};
|
|
1720
1548
|
}
|
|
1721
1549
|
const providerTypes = providers.map((p) => p.type).join(", ");
|
|
@@ -1796,32 +1624,32 @@ function healthCommand() {
|
|
|
1796
1624
|
}, null, 2));
|
|
1797
1625
|
return;
|
|
1798
1626
|
}
|
|
1799
|
-
console.log(
|
|
1627
|
+
console.log(chalk7__default.default.bold("Codex Health Check\n"));
|
|
1800
1628
|
for (const check of checks) {
|
|
1801
|
-
const icon = check.status === "pass" ?
|
|
1802
|
-
const statusColor = check.status === "pass" ?
|
|
1803
|
-
console.log(`${icon} ${
|
|
1629
|
+
const icon = check.status === "pass" ? chalk7__default.default.green("\u2713") : check.status === "warn" ? chalk7__default.default.yellow("\u26A0") : chalk7__default.default.red("\u2717");
|
|
1630
|
+
const statusColor = check.status === "pass" ? chalk7__default.default.green : check.status === "warn" ? chalk7__default.default.yellow : chalk7__default.default.red;
|
|
1631
|
+
console.log(`${icon} ${chalk7__default.default.bold(check.name)}`);
|
|
1804
1632
|
console.log(` ${statusColor(check.message)}`);
|
|
1805
1633
|
if (check.details) {
|
|
1806
|
-
console.log(` ${
|
|
1634
|
+
console.log(` ${chalk7__default.default.dim(check.details)}`);
|
|
1807
1635
|
}
|
|
1808
1636
|
console.log("");
|
|
1809
1637
|
}
|
|
1810
|
-
console.log(
|
|
1811
|
-
const overallStatus = failed > 0 ?
|
|
1638
|
+
console.log(chalk7__default.default.dim("\u2500".repeat(60)));
|
|
1639
|
+
const overallStatus = failed > 0 ? chalk7__default.default.red("UNHEALTHY") : warned > 0 ? chalk7__default.default.yellow("DEGRADED") : chalk7__default.default.green("HEALTHY");
|
|
1812
1640
|
console.log(`Status: ${overallStatus}`);
|
|
1813
|
-
console.log(
|
|
1641
|
+
console.log(chalk7__default.default.dim(`${passed} passed, ${warned} warnings, ${failed} failed`));
|
|
1814
1642
|
if (failed > 0 || warned > 0) {
|
|
1815
1643
|
console.log("");
|
|
1816
|
-
console.log(
|
|
1817
|
-
console.log(
|
|
1818
|
-
console.log(
|
|
1644
|
+
console.log(chalk7__default.default.dim("Run checks individually for more details:"));
|
|
1645
|
+
console.log(chalk7__default.default.dim(" fractary codex cache stats"));
|
|
1646
|
+
console.log(chalk7__default.default.dim(" fractary codex types list"));
|
|
1819
1647
|
}
|
|
1820
1648
|
if (failed > 0) {
|
|
1821
1649
|
process.exit(1);
|
|
1822
1650
|
}
|
|
1823
1651
|
} catch (error) {
|
|
1824
|
-
console.error(
|
|
1652
|
+
console.error(chalk7__default.default.red("Error:"), error.message);
|
|
1825
1653
|
process.exit(1);
|
|
1826
1654
|
}
|
|
1827
1655
|
});
|
|
@@ -1869,8 +1697,8 @@ function syncCommand() {
|
|
|
1869
1697
|
try {
|
|
1870
1698
|
config = await readYamlConfig(configPath);
|
|
1871
1699
|
} catch (error) {
|
|
1872
|
-
console.error(
|
|
1873
|
-
console.log(
|
|
1700
|
+
console.error(chalk7__default.default.red("Error:"), "Codex not initialized.");
|
|
1701
|
+
console.log(chalk7__default.default.dim('Run "fractary codex init" first.'));
|
|
1874
1702
|
process.exit(1);
|
|
1875
1703
|
}
|
|
1876
1704
|
const { createSyncManager, createLocalStorage, detectCurrentProject } = await import('@fractary/codex');
|
|
@@ -1880,14 +1708,14 @@ function syncCommand() {
|
|
|
1880
1708
|
projectName = detected.project || void 0;
|
|
1881
1709
|
}
|
|
1882
1710
|
if (!projectName) {
|
|
1883
|
-
console.error(
|
|
1884
|
-
console.log(
|
|
1711
|
+
console.error(chalk7__default.default.red("Error:"), "Could not determine project name.");
|
|
1712
|
+
console.log(chalk7__default.default.dim("Provide project name as argument or run from a git repository."));
|
|
1885
1713
|
process.exit(1);
|
|
1886
1714
|
}
|
|
1887
1715
|
const validDirections = ["to-codex", "from-codex", "bidirectional"];
|
|
1888
1716
|
if (!validDirections.includes(options.direction)) {
|
|
1889
|
-
console.error(
|
|
1890
|
-
console.log(
|
|
1717
|
+
console.error(chalk7__default.default.red("Error:"), `Invalid direction: ${options.direction}`);
|
|
1718
|
+
console.log(chalk7__default.default.dim("Valid options: to-codex, from-codex, bidirectional"));
|
|
1891
1719
|
process.exit(1);
|
|
1892
1720
|
}
|
|
1893
1721
|
const direction = options.direction;
|
|
@@ -1944,13 +1772,13 @@ function syncCommand() {
|
|
|
1944
1772
|
});
|
|
1945
1773
|
matches.forEach((match) => matchedFilePaths.add(match));
|
|
1946
1774
|
} catch (error) {
|
|
1947
|
-
console.error(
|
|
1775
|
+
console.error(chalk7__default.default.yellow(`Warning: Invalid pattern "${pattern}": ${error.message}`));
|
|
1948
1776
|
}
|
|
1949
1777
|
}
|
|
1950
1778
|
const targetFiles = await Promise.all(
|
|
1951
1779
|
Array.from(matchedFilePaths).map(async (filePath) => {
|
|
1952
1780
|
const fullPath = path4__namespace.join(sourceDir, filePath);
|
|
1953
|
-
const stats = await import('fs/promises').then((
|
|
1781
|
+
const stats = await import('fs/promises').then((fs8) => fs8.stat(fullPath));
|
|
1954
1782
|
return {
|
|
1955
1783
|
path: filePath,
|
|
1956
1784
|
size: stats.size,
|
|
@@ -1972,14 +1800,14 @@ function syncCommand() {
|
|
|
1972
1800
|
try {
|
|
1973
1801
|
const { ensureCodexCloned: ensureCodexCloned2 } = await Promise.resolve().then(() => (init_codex_repository(), codex_repository_exports));
|
|
1974
1802
|
if (!options.json) {
|
|
1975
|
-
console.log(
|
|
1803
|
+
console.log(chalk7__default.default.blue("\u2139 Cloning/updating codex repository..."));
|
|
1976
1804
|
}
|
|
1977
1805
|
codexRepoPath = await ensureCodexCloned2(config, {
|
|
1978
1806
|
branch: targetBranch
|
|
1979
1807
|
});
|
|
1980
1808
|
if (!options.json) {
|
|
1981
|
-
console.log(
|
|
1982
|
-
console.log(
|
|
1809
|
+
console.log(chalk7__default.default.dim(` Codex cloned to: ${codexRepoPath}`));
|
|
1810
|
+
console.log(chalk7__default.default.dim(" Scanning for files routing to this project...\n"));
|
|
1983
1811
|
} else {
|
|
1984
1812
|
console.log(JSON.stringify({
|
|
1985
1813
|
info: "Routing-aware sync: cloned codex repository and scanning for files targeting this project",
|
|
@@ -1987,29 +1815,29 @@ function syncCommand() {
|
|
|
1987
1815
|
}, null, 2));
|
|
1988
1816
|
}
|
|
1989
1817
|
} catch (error) {
|
|
1990
|
-
console.error(
|
|
1991
|
-
console.error(
|
|
1992
|
-
console.log(
|
|
1818
|
+
console.error(chalk7__default.default.red("Error:"), "Failed to clone codex repository");
|
|
1819
|
+
console.error(chalk7__default.default.dim(` ${error.message}`));
|
|
1820
|
+
console.log(chalk7__default.default.yellow("\nTroubleshooting:"));
|
|
1993
1821
|
if (error.message.includes("Git command not found")) {
|
|
1994
|
-
console.log(
|
|
1995
|
-
console.log(
|
|
1822
|
+
console.log(chalk7__default.default.dim(" Git is not installed or not in PATH."));
|
|
1823
|
+
console.log(chalk7__default.default.dim(" Install git: https://git-scm.com/downloads"));
|
|
1996
1824
|
} else if (error.message.includes("authentication failed") || error.message.includes("Authentication failed")) {
|
|
1997
|
-
console.log(
|
|
1998
|
-
console.log(
|
|
1999
|
-
console.log(
|
|
2000
|
-
console.log(
|
|
1825
|
+
console.log(chalk7__default.default.dim(" GitHub authentication is required for private repositories."));
|
|
1826
|
+
console.log(chalk7__default.default.dim(" 1. Check auth status: gh auth status"));
|
|
1827
|
+
console.log(chalk7__default.default.dim(" 2. Login if needed: gh auth login"));
|
|
1828
|
+
console.log(chalk7__default.default.dim(" 3. Or set GITHUB_TOKEN environment variable"));
|
|
2001
1829
|
} else if (error.message.includes("Permission denied")) {
|
|
2002
|
-
console.log(
|
|
2003
|
-
console.log(
|
|
2004
|
-
console.log(
|
|
1830
|
+
console.log(chalk7__default.default.dim(" Permission denied accessing repository files."));
|
|
1831
|
+
console.log(chalk7__default.default.dim(" 1. Check file/directory permissions"));
|
|
1832
|
+
console.log(chalk7__default.default.dim(" 2. Ensure you have access to the repository"));
|
|
2005
1833
|
} else if (error.message.includes("not found") || error.message.includes("does not exist")) {
|
|
2006
|
-
console.log(
|
|
2007
|
-
console.log(
|
|
2008
|
-
console.log(
|
|
1834
|
+
console.log(chalk7__default.default.dim(` Repository not found: ${config.organization}/${config.codex_repository || "codex"}`));
|
|
1835
|
+
console.log(chalk7__default.default.dim(" 1. Verify the repository exists on GitHub"));
|
|
1836
|
+
console.log(chalk7__default.default.dim(" 2. Check organization and repository names in config"));
|
|
2009
1837
|
} else {
|
|
2010
|
-
console.log(
|
|
2011
|
-
console.log(
|
|
2012
|
-
console.log(
|
|
1838
|
+
console.log(chalk7__default.default.dim(" 1. Ensure git is installed: git --version"));
|
|
1839
|
+
console.log(chalk7__default.default.dim(" 2. Check GitHub auth: gh auth status"));
|
|
1840
|
+
console.log(chalk7__default.default.dim(` 3. Verify repo exists: ${config.organization}/${config.codex_repository || "codex"}`));
|
|
2013
1841
|
}
|
|
2014
1842
|
process.exit(1);
|
|
2015
1843
|
}
|
|
@@ -2039,7 +1867,7 @@ function syncCommand() {
|
|
|
2039
1867
|
synced: 0
|
|
2040
1868
|
}, null, 2));
|
|
2041
1869
|
} else {
|
|
2042
|
-
console.log(
|
|
1870
|
+
console.log(chalk7__default.default.yellow("No files to sync."));
|
|
2043
1871
|
}
|
|
2044
1872
|
return;
|
|
2045
1873
|
}
|
|
@@ -2082,98 +1910,98 @@ function syncCommand() {
|
|
|
2082
1910
|
}, null, 2));
|
|
2083
1911
|
return;
|
|
2084
1912
|
}
|
|
2085
|
-
console.log(
|
|
2086
|
-
console.log(` Project: ${
|
|
2087
|
-
console.log(` Organization: ${
|
|
2088
|
-
console.log(` Environment: ${
|
|
2089
|
-
console.log(` Direction: ${
|
|
2090
|
-
console.log(` Files: ${
|
|
2091
|
-
console.log(` Total size: ${
|
|
1913
|
+
console.log(chalk7__default.default.bold("Sync Plan\n"));
|
|
1914
|
+
console.log(` Project: ${chalk7__default.default.cyan(projectName)}`);
|
|
1915
|
+
console.log(` Organization: ${chalk7__default.default.cyan(config.organization)}`);
|
|
1916
|
+
console.log(` Environment: ${chalk7__default.default.cyan(options.env)} (${targetBranch})`);
|
|
1917
|
+
console.log(` Direction: ${chalk7__default.default.cyan(direction)}`);
|
|
1918
|
+
console.log(` Files: ${chalk7__default.default.cyan(plan.totalFiles.toString())}`);
|
|
1919
|
+
console.log(` Total size: ${chalk7__default.default.cyan(formatBytes(plan.totalBytes))}`);
|
|
2092
1920
|
if (plan.estimatedTime) {
|
|
2093
|
-
console.log(` Est. time: ${
|
|
1921
|
+
console.log(` Est. time: ${chalk7__default.default.dim(formatDuration(plan.estimatedTime))}`);
|
|
2094
1922
|
}
|
|
2095
1923
|
if (routingScan) {
|
|
2096
1924
|
console.log("");
|
|
2097
|
-
console.log(
|
|
2098
|
-
console.log(` Scanned: ${
|
|
2099
|
-
console.log(` Matched: ${
|
|
2100
|
-
console.log(` Source projects: ${
|
|
1925
|
+
console.log(chalk7__default.default.bold("Routing Statistics\n"));
|
|
1926
|
+
console.log(` Scanned: ${chalk7__default.default.cyan(routingScan.stats.totalScanned.toString())} files`);
|
|
1927
|
+
console.log(` Matched: ${chalk7__default.default.cyan(routingScan.stats.totalMatched.toString())} files`);
|
|
1928
|
+
console.log(` Source projects: ${chalk7__default.default.cyan(routingScan.stats.sourceProjects.length.toString())}`);
|
|
2101
1929
|
if (routingScan.stats.sourceProjects.length > 0) {
|
|
2102
|
-
console.log(
|
|
1930
|
+
console.log(chalk7__default.default.dim(` ${routingScan.stats.sourceProjects.slice(0, 5).join(", ")}`));
|
|
2103
1931
|
if (routingScan.stats.sourceProjects.length > 5) {
|
|
2104
|
-
console.log(
|
|
1932
|
+
console.log(chalk7__default.default.dim(` ... and ${routingScan.stats.sourceProjects.length - 5} more`));
|
|
2105
1933
|
}
|
|
2106
1934
|
}
|
|
2107
|
-
console.log(` Scan time: ${
|
|
1935
|
+
console.log(` Scan time: ${chalk7__default.default.dim(formatDuration(routingScan.stats.durationMs))}`);
|
|
2108
1936
|
}
|
|
2109
1937
|
console.log("");
|
|
2110
1938
|
if (plan.conflicts.length > 0) {
|
|
2111
|
-
console.log(
|
|
1939
|
+
console.log(chalk7__default.default.yellow(`\u26A0 ${plan.conflicts.length} conflicts detected:`));
|
|
2112
1940
|
for (const conflict of plan.conflicts.slice(0, 5)) {
|
|
2113
|
-
console.log(
|
|
1941
|
+
console.log(chalk7__default.default.yellow(` \u2022 ${conflict.path}`));
|
|
2114
1942
|
}
|
|
2115
1943
|
if (plan.conflicts.length > 5) {
|
|
2116
|
-
console.log(
|
|
1944
|
+
console.log(chalk7__default.default.dim(` ... and ${plan.conflicts.length - 5} more`));
|
|
2117
1945
|
}
|
|
2118
1946
|
console.log("");
|
|
2119
1947
|
}
|
|
2120
1948
|
if (plan.skipped.length > 0) {
|
|
2121
|
-
console.log(
|
|
1949
|
+
console.log(chalk7__default.default.dim(`${plan.skipped.length} files skipped (no changes)`));
|
|
2122
1950
|
console.log("");
|
|
2123
1951
|
}
|
|
2124
1952
|
if (options.dryRun) {
|
|
2125
|
-
console.log(
|
|
1953
|
+
console.log(chalk7__default.default.blue("Dry run - would sync:\n"));
|
|
2126
1954
|
const filesToShow = plan.files.slice(0, 10);
|
|
2127
1955
|
for (const file of filesToShow) {
|
|
2128
1956
|
const arrow = direction === "to-codex" ? "\u2192" : direction === "from-codex" ? "\u2190" : "\u2194";
|
|
2129
|
-
const opColor = file.operation === "create" ?
|
|
1957
|
+
const opColor = file.operation === "create" ? chalk7__default.default.green : file.operation === "update" ? chalk7__default.default.yellow : chalk7__default.default.dim;
|
|
2130
1958
|
console.log(
|
|
2131
|
-
|
|
1959
|
+
chalk7__default.default.dim(` ${arrow}`),
|
|
2132
1960
|
opColor(file.operation.padEnd(7)),
|
|
2133
1961
|
file.path,
|
|
2134
|
-
|
|
1962
|
+
chalk7__default.default.dim(`(${formatBytes(file.size || 0)})`)
|
|
2135
1963
|
);
|
|
2136
1964
|
}
|
|
2137
1965
|
if (plan.files.length > 10) {
|
|
2138
|
-
console.log(
|
|
1966
|
+
console.log(chalk7__default.default.dim(` ... and ${plan.files.length - 10} more files`));
|
|
2139
1967
|
}
|
|
2140
|
-
console.log(
|
|
1968
|
+
console.log(chalk7__default.default.dim(`
|
|
2141
1969
|
Total: ${plan.totalFiles} files (${formatBytes(plan.totalBytes)})`));
|
|
2142
|
-
console.log(
|
|
1970
|
+
console.log(chalk7__default.default.dim("Run without --dry-run to execute sync."));
|
|
2143
1971
|
return;
|
|
2144
1972
|
}
|
|
2145
|
-
console.log(
|
|
1973
|
+
console.log(chalk7__default.default.blue("Syncing...\n"));
|
|
2146
1974
|
const startTime = Date.now();
|
|
2147
1975
|
const result = await syncManager.executePlan(plan, syncOptions);
|
|
2148
1976
|
const duration = Date.now() - startTime;
|
|
2149
1977
|
console.log("");
|
|
2150
1978
|
if (result.success) {
|
|
2151
|
-
console.log(
|
|
2152
|
-
console.log(
|
|
1979
|
+
console.log(chalk7__default.default.green(`\u2713 Sync completed successfully`));
|
|
1980
|
+
console.log(chalk7__default.default.dim(` Synced: ${result.synced} files`));
|
|
2153
1981
|
if (result.skipped > 0) {
|
|
2154
|
-
console.log(
|
|
1982
|
+
console.log(chalk7__default.default.dim(` Skipped: ${result.skipped} files`));
|
|
2155
1983
|
}
|
|
2156
|
-
console.log(
|
|
1984
|
+
console.log(chalk7__default.default.dim(` Duration: ${formatDuration(duration)}`));
|
|
2157
1985
|
} else {
|
|
2158
|
-
console.log(
|
|
2159
|
-
console.log(
|
|
2160
|
-
console.log(
|
|
1986
|
+
console.log(chalk7__default.default.yellow(`\u26A0 Sync completed with errors`));
|
|
1987
|
+
console.log(chalk7__default.default.green(` Synced: ${result.synced} files`));
|
|
1988
|
+
console.log(chalk7__default.default.red(` Failed: ${result.failed} files`));
|
|
2161
1989
|
if (result.skipped > 0) {
|
|
2162
|
-
console.log(
|
|
1990
|
+
console.log(chalk7__default.default.dim(` Skipped: ${result.skipped} files`));
|
|
2163
1991
|
}
|
|
2164
1992
|
if (result.errors.length > 0) {
|
|
2165
1993
|
console.log("");
|
|
2166
|
-
console.log(
|
|
1994
|
+
console.log(chalk7__default.default.red("Errors:"));
|
|
2167
1995
|
for (const error of result.errors.slice(0, 5)) {
|
|
2168
|
-
console.log(
|
|
1996
|
+
console.log(chalk7__default.default.red(` \u2022 ${error.path}: ${error.error}`));
|
|
2169
1997
|
}
|
|
2170
1998
|
if (result.errors.length > 5) {
|
|
2171
|
-
console.log(
|
|
1999
|
+
console.log(chalk7__default.default.dim(` ... and ${result.errors.length - 5} more errors`));
|
|
2172
2000
|
}
|
|
2173
2001
|
}
|
|
2174
2002
|
}
|
|
2175
2003
|
} catch (error) {
|
|
2176
|
-
console.error(
|
|
2004
|
+
console.error(chalk7__default.default.red("Error:"), error.message);
|
|
2177
2005
|
process.exit(1);
|
|
2178
2006
|
}
|
|
2179
2007
|
});
|
|
@@ -2225,35 +2053,35 @@ function typesListCommand() {
|
|
|
2225
2053
|
return;
|
|
2226
2054
|
}
|
|
2227
2055
|
if (types.length === 0) {
|
|
2228
|
-
console.log(
|
|
2056
|
+
console.log(chalk7__default.default.yellow("No types found."));
|
|
2229
2057
|
return;
|
|
2230
2058
|
}
|
|
2231
|
-
console.log(
|
|
2059
|
+
console.log(chalk7__default.default.bold("Artifact Types\n"));
|
|
2232
2060
|
const builtinTypes = types.filter((t) => registry.isBuiltIn(t.name));
|
|
2233
2061
|
const customTypes = types.filter((t) => !registry.isBuiltIn(t.name));
|
|
2234
2062
|
if (builtinTypes.length > 0 && !options.customOnly) {
|
|
2235
|
-
console.log(
|
|
2236
|
-
console.log(
|
|
2063
|
+
console.log(chalk7__default.default.bold("Built-in Types"));
|
|
2064
|
+
console.log(chalk7__default.default.dim("\u2500".repeat(70)));
|
|
2237
2065
|
for (const type of builtinTypes) {
|
|
2238
2066
|
const patternStr = type.patterns[0] || "";
|
|
2239
|
-
console.log(` ${
|
|
2240
|
-
console.log(` ${
|
|
2067
|
+
console.log(` ${chalk7__default.default.cyan(type.name.padEnd(12))} ${patternStr.padEnd(30)} ${chalk7__default.default.dim(`TTL: ${formatTtl(type.defaultTtl)}`)}`);
|
|
2068
|
+
console.log(` ${chalk7__default.default.dim(" ".repeat(12) + type.description)}`);
|
|
2241
2069
|
}
|
|
2242
2070
|
console.log("");
|
|
2243
2071
|
}
|
|
2244
2072
|
if (customTypes.length > 0 && !options.builtinOnly) {
|
|
2245
|
-
console.log(
|
|
2246
|
-
console.log(
|
|
2073
|
+
console.log(chalk7__default.default.bold("Custom Types"));
|
|
2074
|
+
console.log(chalk7__default.default.dim("\u2500".repeat(70)));
|
|
2247
2075
|
for (const type of customTypes) {
|
|
2248
2076
|
const patternStr = type.patterns[0] || "";
|
|
2249
|
-
console.log(` ${
|
|
2250
|
-
console.log(` ${
|
|
2077
|
+
console.log(` ${chalk7__default.default.green(type.name.padEnd(12))} ${patternStr.padEnd(30)} ${chalk7__default.default.dim(`TTL: ${formatTtl(type.defaultTtl)}`)}`);
|
|
2078
|
+
console.log(` ${chalk7__default.default.dim(" ".repeat(12) + type.description)}`);
|
|
2251
2079
|
}
|
|
2252
2080
|
console.log("");
|
|
2253
2081
|
}
|
|
2254
|
-
console.log(
|
|
2082
|
+
console.log(chalk7__default.default.dim(`Total: ${types.length} types (${builtinTypes.length} built-in, ${customTypes.length} custom)`));
|
|
2255
2083
|
} catch (error) {
|
|
2256
|
-
console.error(
|
|
2084
|
+
console.error(chalk7__default.default.red("Error:"), error.message);
|
|
2257
2085
|
process.exit(1);
|
|
2258
2086
|
}
|
|
2259
2087
|
});
|
|
@@ -2276,8 +2104,8 @@ function typesShowCommand() {
|
|
|
2276
2104
|
const registry = client.getTypeRegistry();
|
|
2277
2105
|
const type = registry.get(name);
|
|
2278
2106
|
if (!type) {
|
|
2279
|
-
console.error(
|
|
2280
|
-
console.log(
|
|
2107
|
+
console.error(chalk7__default.default.red("Error:"), `Type "${name}" not found.`);
|
|
2108
|
+
console.log(chalk7__default.default.dim('Run "fractary codex types list" to see available types.'));
|
|
2281
2109
|
process.exit(1);
|
|
2282
2110
|
}
|
|
2283
2111
|
const isBuiltin = registry.isBuiltIn(name);
|
|
@@ -2296,39 +2124,39 @@ function typesShowCommand() {
|
|
|
2296
2124
|
}, null, 2));
|
|
2297
2125
|
return;
|
|
2298
2126
|
}
|
|
2299
|
-
const nameColor = isBuiltin ?
|
|
2300
|
-
console.log(
|
|
2127
|
+
const nameColor = isBuiltin ? chalk7__default.default.cyan : chalk7__default.default.green;
|
|
2128
|
+
console.log(chalk7__default.default.bold(`Type: ${nameColor(name)}
|
|
2301
2129
|
`));
|
|
2302
|
-
console.log(` ${
|
|
2303
|
-
console.log(` ${
|
|
2304
|
-
console.log(` ${
|
|
2130
|
+
console.log(` ${chalk7__default.default.dim("Source:")} ${isBuiltin ? "Built-in" : "Custom"}`);
|
|
2131
|
+
console.log(` ${chalk7__default.default.dim("Description:")} ${type.description}`);
|
|
2132
|
+
console.log(` ${chalk7__default.default.dim("TTL:")} ${formatTtl2(type.defaultTtl)} (${type.defaultTtl} seconds)`);
|
|
2305
2133
|
console.log("");
|
|
2306
|
-
console.log(
|
|
2134
|
+
console.log(chalk7__default.default.bold("Patterns"));
|
|
2307
2135
|
for (const pattern of type.patterns) {
|
|
2308
|
-
console.log(` ${
|
|
2136
|
+
console.log(` ${chalk7__default.default.dim("\u2022")} ${pattern}`);
|
|
2309
2137
|
}
|
|
2310
2138
|
if (type.archiveAfterDays !== null) {
|
|
2311
2139
|
console.log("");
|
|
2312
|
-
console.log(
|
|
2313
|
-
console.log(` ${
|
|
2314
|
-
console.log(` ${
|
|
2140
|
+
console.log(chalk7__default.default.bold("Archive Settings"));
|
|
2141
|
+
console.log(` ${chalk7__default.default.dim("After:")} ${type.archiveAfterDays} days`);
|
|
2142
|
+
console.log(` ${chalk7__default.default.dim("Storage:")} ${type.archiveStorage || "not set"}`);
|
|
2315
2143
|
}
|
|
2316
2144
|
if (type.syncPatterns && type.syncPatterns.length > 0) {
|
|
2317
2145
|
console.log("");
|
|
2318
|
-
console.log(
|
|
2146
|
+
console.log(chalk7__default.default.bold("Sync Patterns"));
|
|
2319
2147
|
for (const pattern of type.syncPatterns) {
|
|
2320
|
-
console.log(` ${
|
|
2148
|
+
console.log(` ${chalk7__default.default.dim("\u2022")} ${pattern}`);
|
|
2321
2149
|
}
|
|
2322
2150
|
}
|
|
2323
2151
|
if (type.excludePatterns && type.excludePatterns.length > 0) {
|
|
2324
2152
|
console.log("");
|
|
2325
|
-
console.log(
|
|
2153
|
+
console.log(chalk7__default.default.bold("Exclude Patterns"));
|
|
2326
2154
|
for (const pattern of type.excludePatterns) {
|
|
2327
|
-
console.log(` ${
|
|
2155
|
+
console.log(` ${chalk7__default.default.dim("\u2022")} ${pattern}`);
|
|
2328
2156
|
}
|
|
2329
2157
|
}
|
|
2330
2158
|
} catch (error) {
|
|
2331
|
-
console.error(
|
|
2159
|
+
console.error(chalk7__default.default.red("Error:"), error.message);
|
|
2332
2160
|
process.exit(1);
|
|
2333
2161
|
}
|
|
2334
2162
|
});
|
|
@@ -2372,30 +2200,30 @@ function typesAddCommand() {
|
|
|
2372
2200
|
cmd.description("Add a custom artifact type").argument("<name>", "Type name (lowercase, alphanumeric with hyphens)").requiredOption("--pattern <glob>", "File pattern (glob syntax)").option("--ttl <duration>", 'Cache TTL (e.g., "24h", "7d")', "24h").option("--description <text>", "Type description").option("--json", "Output as JSON").action(async (name, options) => {
|
|
2373
2201
|
try {
|
|
2374
2202
|
if (!isValidTypeName(name)) {
|
|
2375
|
-
console.error(
|
|
2376
|
-
console.log(
|
|
2203
|
+
console.error(chalk7__default.default.red("Error:"), "Invalid type name.");
|
|
2204
|
+
console.log(chalk7__default.default.dim("Type name must be lowercase, start with a letter, and contain only letters, numbers, and hyphens."));
|
|
2377
2205
|
process.exit(1);
|
|
2378
2206
|
}
|
|
2379
2207
|
const client = await getClient();
|
|
2380
2208
|
const registry = client.getTypeRegistry();
|
|
2381
2209
|
if (registry.isBuiltIn(name)) {
|
|
2382
|
-
console.error(
|
|
2210
|
+
console.error(chalk7__default.default.red("Error:"), `Cannot override built-in type "${name}".`);
|
|
2383
2211
|
const builtinNames = registry.list().filter((t) => registry.isBuiltIn(t.name)).map((t) => t.name);
|
|
2384
|
-
console.log(
|
|
2212
|
+
console.log(chalk7__default.default.dim("Built-in types: " + builtinNames.join(", ")));
|
|
2385
2213
|
process.exit(1);
|
|
2386
2214
|
}
|
|
2387
2215
|
if (registry.has(name)) {
|
|
2388
|
-
console.error(
|
|
2389
|
-
console.log(
|
|
2216
|
+
console.error(chalk7__default.default.red("Error:"), `Custom type "${name}" already exists.`);
|
|
2217
|
+
console.log(chalk7__default.default.dim('Use "fractary codex types remove" first to remove it.'));
|
|
2390
2218
|
process.exit(1);
|
|
2391
2219
|
}
|
|
2392
2220
|
let ttlSeconds;
|
|
2393
2221
|
try {
|
|
2394
2222
|
ttlSeconds = parseTtl(options.ttl);
|
|
2395
2223
|
} catch {
|
|
2396
|
-
console.error(
|
|
2397
|
-
console.log(
|
|
2398
|
-
console.log(
|
|
2224
|
+
console.error(chalk7__default.default.red("Error:"), "Invalid TTL format.");
|
|
2225
|
+
console.log(chalk7__default.default.dim("Expected format: <number><unit> where unit is s (seconds), m (minutes), h (hours), or d (days)"));
|
|
2226
|
+
console.log(chalk7__default.default.dim("Examples: 30m, 24h, 7d"));
|
|
2399
2227
|
process.exit(1);
|
|
2400
2228
|
}
|
|
2401
2229
|
const configPath = path4__namespace.join(process.cwd(), ".fractary", "codex", "config.yaml");
|
|
@@ -2427,19 +2255,19 @@ function typesAddCommand() {
|
|
|
2427
2255
|
}, null, 2));
|
|
2428
2256
|
return;
|
|
2429
2257
|
}
|
|
2430
|
-
console.log(
|
|
2258
|
+
console.log(chalk7__default.default.green("\u2713"), `Added custom type "${chalk7__default.default.cyan(name)}"`);
|
|
2431
2259
|
console.log("");
|
|
2432
|
-
console.log(` ${
|
|
2433
|
-
console.log(` ${
|
|
2260
|
+
console.log(` ${chalk7__default.default.dim("Pattern:")} ${options.pattern}`);
|
|
2261
|
+
console.log(` ${chalk7__default.default.dim("TTL:")} ${formatTtl3(ttlSeconds)} (${ttlSeconds} seconds)`);
|
|
2434
2262
|
if (options.description) {
|
|
2435
|
-
console.log(` ${
|
|
2263
|
+
console.log(` ${chalk7__default.default.dim("Description:")} ${options.description}`);
|
|
2436
2264
|
}
|
|
2437
2265
|
console.log("");
|
|
2438
|
-
console.log(
|
|
2266
|
+
console.log(chalk7__default.default.dim("Note: Custom type will be available on next CLI invocation."));
|
|
2439
2267
|
} catch (error) {
|
|
2440
|
-
console.error(
|
|
2268
|
+
console.error(chalk7__default.default.red("Error:"), error.message);
|
|
2441
2269
|
if (error.message.includes("Failed to load configuration")) {
|
|
2442
|
-
console.log(
|
|
2270
|
+
console.log(chalk7__default.default.dim('\nRun "fractary codex init" to create a configuration.'));
|
|
2443
2271
|
}
|
|
2444
2272
|
process.exit(1);
|
|
2445
2273
|
}
|
|
@@ -2457,20 +2285,20 @@ function typesRemoveCommand() {
|
|
|
2457
2285
|
const client = await getClient();
|
|
2458
2286
|
const registry = client.getTypeRegistry();
|
|
2459
2287
|
if (registry.isBuiltIn(name)) {
|
|
2460
|
-
console.error(
|
|
2461
|
-
console.log(
|
|
2288
|
+
console.error(chalk7__default.default.red("Error:"), `Cannot remove built-in type "${name}".`);
|
|
2289
|
+
console.log(chalk7__default.default.dim("Built-in types are permanent and cannot be removed."));
|
|
2462
2290
|
process.exit(1);
|
|
2463
2291
|
}
|
|
2464
2292
|
if (!registry.has(name)) {
|
|
2465
|
-
console.error(
|
|
2466
|
-
console.log(
|
|
2293
|
+
console.error(chalk7__default.default.red("Error:"), `Custom type "${name}" not found.`);
|
|
2294
|
+
console.log(chalk7__default.default.dim('Run "fractary codex types list --custom-only" to see custom types.'));
|
|
2467
2295
|
process.exit(1);
|
|
2468
2296
|
}
|
|
2469
2297
|
const typeInfo = registry.get(name);
|
|
2470
2298
|
const configPath = path4__namespace.join(process.cwd(), ".fractary", "codex", "config.yaml");
|
|
2471
2299
|
const config = await readYamlConfig(configPath);
|
|
2472
2300
|
if (!config.types?.custom?.[name]) {
|
|
2473
|
-
console.error(
|
|
2301
|
+
console.error(chalk7__default.default.red("Error:"), `Custom type "${name}" not found in configuration.`);
|
|
2474
2302
|
process.exit(1);
|
|
2475
2303
|
}
|
|
2476
2304
|
delete config.types.custom[name];
|
|
@@ -2494,17 +2322,17 @@ function typesRemoveCommand() {
|
|
|
2494
2322
|
}, null, 2));
|
|
2495
2323
|
return;
|
|
2496
2324
|
}
|
|
2497
|
-
console.log(
|
|
2325
|
+
console.log(chalk7__default.default.green("\u2713"), `Removed custom type "${chalk7__default.default.cyan(name)}"`);
|
|
2498
2326
|
console.log("");
|
|
2499
|
-
console.log(
|
|
2500
|
-
console.log(` ${
|
|
2501
|
-
console.log(` ${
|
|
2327
|
+
console.log(chalk7__default.default.dim("Removed configuration:"));
|
|
2328
|
+
console.log(` ${chalk7__default.default.dim("Pattern:")} ${typeInfo.patterns.join(", ")}`);
|
|
2329
|
+
console.log(` ${chalk7__default.default.dim("Description:")} ${typeInfo.description}`);
|
|
2502
2330
|
console.log("");
|
|
2503
|
-
console.log(
|
|
2331
|
+
console.log(chalk7__default.default.dim("Note: Custom type will be removed on next CLI invocation."));
|
|
2504
2332
|
} catch (error) {
|
|
2505
|
-
console.error(
|
|
2333
|
+
console.error(chalk7__default.default.red("Error:"), error.message);
|
|
2506
2334
|
if (error.message.includes("Failed to load configuration")) {
|
|
2507
|
-
console.log(
|
|
2335
|
+
console.log(chalk7__default.default.dim('\nRun "fractary codex init" to create a configuration.'));
|
|
2508
2336
|
}
|
|
2509
2337
|
process.exit(1);
|
|
2510
2338
|
}
|