@agentuity/cli 1.0.40 → 1.0.41
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/cli.d.ts.map +1 -1
- package/dist/cli.js +9 -1
- package/dist/cli.js.map +1 -1
- package/dist/cmd/project/import.d.ts.map +1 -1
- package/dist/cmd/project/import.js +11 -1
- package/dist/cmd/project/import.js.map +1 -1
- package/dist/cmd/project/reconcile.d.ts +8 -0
- package/dist/cmd/project/reconcile.d.ts.map +1 -1
- package/dist/cmd/project/reconcile.js +150 -61
- package/dist/cmd/project/reconcile.js.map +1 -1
- package/dist/cmd/project/remote-import.d.ts +2 -0
- package/dist/cmd/project/remote-import.d.ts.map +1 -1
- package/dist/cmd/project/remote-import.js +2 -2
- package/dist/cmd/project/remote-import.js.map +1 -1
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js +8 -1
- package/dist/config.js.map +1 -1
- package/dist/schema-parser.d.ts.map +1 -1
- package/dist/schema-parser.js +6 -2
- package/dist/schema-parser.js.map +1 -1
- package/package.json +6 -6
- package/src/cli.ts +9 -1
- package/src/cmd/project/import.ts +11 -1
- package/src/cmd/project/reconcile.ts +147 -61
- package/src/cmd/project/remote-import.ts +4 -2
- package/src/config.ts +8 -1
- package/src/schema-parser.ts +8 -2
package/src/config.ts
CHANGED
|
@@ -141,6 +141,8 @@ function expandTilde(path: string): string {
|
|
|
141
141
|
}
|
|
142
142
|
|
|
143
143
|
let cachedConfig: Config | null | undefined;
|
|
144
|
+
// Track the resolved config path so saveConfig writes back to the same file
|
|
145
|
+
let cachedConfigPath: string | undefined;
|
|
144
146
|
|
|
145
147
|
export async function loadConfig(
|
|
146
148
|
customPath?: string,
|
|
@@ -217,6 +219,7 @@ export async function loadConfig(
|
|
|
217
219
|
// This ensures --config flag is respected across all commands
|
|
218
220
|
if (!skipCache) {
|
|
219
221
|
cachedConfig = result.data;
|
|
222
|
+
cachedConfigPath = configPath;
|
|
220
223
|
}
|
|
221
224
|
return result.data;
|
|
222
225
|
} catch (error) {
|
|
@@ -227,6 +230,7 @@ export async function loadConfig(
|
|
|
227
230
|
// Note: For long-running processes, consider time-based cache expiry for transient failures.
|
|
228
231
|
if (!skipCache) {
|
|
229
232
|
cachedConfig = null;
|
|
233
|
+
cachedConfigPath = configPath;
|
|
230
234
|
}
|
|
231
235
|
return null;
|
|
232
236
|
}
|
|
@@ -275,7 +279,10 @@ function formatYAML(obj: unknown, indent = 0): string {
|
|
|
275
279
|
}
|
|
276
280
|
|
|
277
281
|
export async function saveConfig(config: Config, customPath?: string): Promise<void> {
|
|
278
|
-
|
|
282
|
+
// Use the path the config was originally loaded from (cachedConfigPath) so that
|
|
283
|
+
// saves go back to the correct profile even when --profile was used to load it.
|
|
284
|
+
// Falls back to getProfile() if no config has been loaded yet.
|
|
285
|
+
const configPath = customPath || cachedConfigPath || (await getProfile());
|
|
279
286
|
await ensureConfigDir();
|
|
280
287
|
|
|
281
288
|
const content = formatYAML(config);
|
package/src/schema-parser.ts
CHANGED
|
@@ -443,8 +443,14 @@ export function buildValidationInput(
|
|
|
443
443
|
const camelCaseName = opt.name.replace(/-([a-z])/g, (_, letter) => letter.toUpperCase());
|
|
444
444
|
let value = rawOptions[opt.name] ?? rawOptions[camelCaseName];
|
|
445
445
|
|
|
446
|
-
// Handle --yes
|
|
447
|
-
|
|
446
|
+
// Handle --yes and --force aliases for --confirm: if confirm is not set but yes/force is, use that value
|
|
447
|
+
// Only treat --force as a --confirm alias if the schema does NOT declare a separate 'force' option
|
|
448
|
+
if (
|
|
449
|
+
opt.name === 'confirm' &&
|
|
450
|
+
value === undefined &&
|
|
451
|
+
(rawOptions.yes === true ||
|
|
452
|
+
(rawOptions.force === true && !parsed.some((o) => o.name === 'force')))
|
|
453
|
+
) {
|
|
448
454
|
value = true;
|
|
449
455
|
}
|
|
450
456
|
|