nx 22.6.0-beta.2 → 22.6.0-beta.3
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/package.json +12 -12
- package/src/ai/set-up-ai-agents/set-up-ai-agents.d.ts.map +1 -1
- package/src/ai/set-up-ai-agents/set-up-ai-agents.js +1 -0
- package/src/command-line/ai/ai-output.d.ts +47 -0
- package/src/command-line/ai/ai-output.d.ts.map +1 -0
- package/src/command-line/ai/ai-output.js +86 -0
- package/src/command-line/configure-ai-agents/configure-ai-agents.d.ts.map +1 -1
- package/src/command-line/configure-ai-agents/configure-ai-agents.js +77 -1
- package/src/command-line/import/command-object.d.ts.map +1 -1
- package/src/command-line/import/command-object.js +20 -2
- package/src/command-line/import/import.d.ts +1 -0
- package/src/command-line/import/import.d.ts.map +1 -1
- package/src/command-line/import/import.js +264 -40
- package/src/command-line/import/utils/ai-output.d.ts +94 -0
- package/src/command-line/import/utils/ai-output.d.ts.map +1 -0
- package/src/command-line/import/utils/ai-output.js +209 -0
- package/src/command-line/init/init-v2.d.ts +5 -0
- package/src/command-line/init/init-v2.d.ts.map +1 -1
- package/src/command-line/init/init-v2.js +1 -0
- package/src/command-line/init/utils/ai-output.d.ts +4 -43
- package/src/command-line/init/utils/ai-output.d.ts.map +1 -1
- package/src/command-line/init/utils/ai-output.js +7 -81
- package/src/command-line/list/command-object.d.ts.map +1 -1
- package/src/command-line/list/command-object.js +6 -1
- package/src/command-line/list/list.d.ts +2 -0
- package/src/command-line/list/list.d.ts.map +1 -1
- package/src/command-line/list/list.js +5 -1
- package/src/command-line/nx-cloud/apply-locally/apply-locally.d.ts +5 -0
- package/src/command-line/nx-cloud/apply-locally/apply-locally.d.ts.map +1 -0
- package/src/command-line/nx-cloud/apply-locally/apply-locally.js +13 -0
- package/src/command-line/nx-cloud/apply-locally/command-object.d.ts +3 -0
- package/src/command-line/nx-cloud/apply-locally/command-object.d.ts.map +1 -0
- package/src/command-line/nx-cloud/apply-locally/command-object.js +15 -0
- package/src/command-line/nx-commands.d.ts.map +1 -1
- package/src/command-line/nx-commands.js +9 -7
- package/src/command-line/run/executor-utils.d.ts.map +1 -1
- package/src/command-line/run/executor-utils.js +1 -0
- package/src/command-line/yargs-utils/shared-options.d.ts.map +1 -1
- package/src/command-line/yargs-utils/shared-options.js +6 -2
- package/src/config/misc-interfaces.d.ts +2 -0
- package/src/config/misc-interfaces.d.ts.map +1 -1
- package/src/core/graph/main.js +1 -1
- package/src/native/nx.wasm32-wasi.wasm +0 -0
- package/src/tasks-runner/tasks-schedule.d.ts.map +1 -1
- package/src/tasks-runner/tasks-schedule.js +13 -2
- package/src/utils/catalog/manager-factory.d.ts.map +1 -1
- package/src/utils/catalog/manager-factory.js +3 -0
- package/src/utils/catalog/manager.d.ts +4 -4
- package/src/utils/catalog/manager.d.ts.map +1 -1
- package/src/utils/catalog/manager.js +11 -0
- package/src/utils/catalog/pnpm-manager.d.ts +3 -4
- package/src/utils/catalog/pnpm-manager.d.ts.map +1 -1
- package/src/utils/catalog/pnpm-manager.js +57 -68
- package/src/utils/catalog/types.d.ts +7 -0
- package/src/utils/catalog/types.d.ts.map +1 -1
- package/src/utils/catalog/yarn-manager.d.ts +22 -0
- package/src/utils/catalog/yarn-manager.d.ts.map +1 -0
- package/src/utils/catalog/yarn-manager.js +249 -0
- package/src/utils/plugins/output.d.ts +29 -1
- package/src/utils/plugins/output.d.ts.map +1 -1
- package/src/utils/plugins/output.js +90 -1
- package/src/utils/plugins/plugin-capabilities.d.ts +1 -0
- package/src/utils/plugins/plugin-capabilities.d.ts.map +1 -1
- package/src/utils/plugins/plugin-capabilities.js +2 -0
- package/src/native/index.d.ts +0 -569
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "nx",
|
|
3
|
-
"version": "22.6.0-beta.
|
|
3
|
+
"version": "22.6.0-beta.3",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "The core Nx plugin contains the core functionality of Nx like the project graph, nx commands and task orchestration.",
|
|
6
6
|
"repository": {
|
|
@@ -54,7 +54,7 @@
|
|
|
54
54
|
"jest-diff": "^30.0.2",
|
|
55
55
|
"jsonc-parser": "3.2.0",
|
|
56
56
|
"lines-and-columns": "2.0.3",
|
|
57
|
-
"minimatch": "10.
|
|
57
|
+
"minimatch": "10.2.1",
|
|
58
58
|
"node-machine-id": "1.1.12",
|
|
59
59
|
"npm-run-path": "^4.0.1",
|
|
60
60
|
"open": "^8.4.0",
|
|
@@ -84,16 +84,16 @@
|
|
|
84
84
|
}
|
|
85
85
|
},
|
|
86
86
|
"optionalDependencies": {
|
|
87
|
-
"@nx/nx-darwin-arm64": "22.6.0-beta.
|
|
88
|
-
"@nx/nx-darwin-x64": "22.6.0-beta.
|
|
89
|
-
"@nx/nx-freebsd-x64": "22.6.0-beta.
|
|
90
|
-
"@nx/nx-linux-arm-gnueabihf": "22.6.0-beta.
|
|
91
|
-
"@nx/nx-linux-arm64-gnu": "22.6.0-beta.
|
|
92
|
-
"@nx/nx-linux-arm64-musl": "22.6.0-beta.
|
|
93
|
-
"@nx/nx-linux-x64-gnu": "22.6.0-beta.
|
|
94
|
-
"@nx/nx-linux-x64-musl": "22.6.0-beta.
|
|
95
|
-
"@nx/nx-win32-arm64-msvc": "22.6.0-beta.
|
|
96
|
-
"@nx/nx-win32-x64-msvc": "22.6.0-beta.
|
|
87
|
+
"@nx/nx-darwin-arm64": "22.6.0-beta.3",
|
|
88
|
+
"@nx/nx-darwin-x64": "22.6.0-beta.3",
|
|
89
|
+
"@nx/nx-freebsd-x64": "22.6.0-beta.3",
|
|
90
|
+
"@nx/nx-linux-arm-gnueabihf": "22.6.0-beta.3",
|
|
91
|
+
"@nx/nx-linux-arm64-gnu": "22.6.0-beta.3",
|
|
92
|
+
"@nx/nx-linux-arm64-musl": "22.6.0-beta.3",
|
|
93
|
+
"@nx/nx-linux-x64-gnu": "22.6.0-beta.3",
|
|
94
|
+
"@nx/nx-linux-x64-musl": "22.6.0-beta.3",
|
|
95
|
+
"@nx/nx-win32-arm64-msvc": "22.6.0-beta.3",
|
|
96
|
+
"@nx/nx-win32-x64-msvc": "22.6.0-beta.3"
|
|
97
97
|
},
|
|
98
98
|
"nx-migrations": {
|
|
99
99
|
"migrations": "./migrations.json",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"set-up-ai-agents.d.ts","sourceRoot":"","sources":["../../../../../../packages/nx/src/ai/set-up-ai-agents/set-up-ai-agents.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,IAAI,EAAE,MAAM,uBAAuB,CAAC;AAS7C,OAAO,EACL,qBAAqB,EACrB,oBAAoB,EACrB,MAAM,oBAAoB,CAAC;AAwB5B,OAAO,EACL,sCAAsC,EACtC,4BAA4B,EAC7B,MAAM,UAAU,CAAC;AAElB,MAAM,MAAM,mBAAmB,GAAG;IAChC,QAAQ,EAAE,oBAAoB,EAAE,CAAC;IACjC,MAAM,EAAE,qBAAqB,EAAE,CAAC;CACjC,CAAC;AAmCF,wBAAsB,sBAAsB,CAC1C,IAAI,EAAE,IAAI,EACV,OAAO,EAAE,4BAA4B,EACrC,KAAK,UAAQ,GACZ,OAAO,CAAC,CAAC,KAAK,CAAC,EAAE,OAAO,KAAK,OAAO,CAAC,mBAAmB,CAAC,CAAC,CAmC5D;AAaD,wBAAsB,0BAA0B,CAC9C,IAAI,EAAE,IAAI,EACV,OAAO,EAAE,sCAAsC,GAC9C,OAAO,CAAC,MAAM,OAAO,CAAC,mBAAmB,CAAC,CAAC,
|
|
1
|
+
{"version":3,"file":"set-up-ai-agents.d.ts","sourceRoot":"","sources":["../../../../../../packages/nx/src/ai/set-up-ai-agents/set-up-ai-agents.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,IAAI,EAAE,MAAM,uBAAuB,CAAC;AAS7C,OAAO,EACL,qBAAqB,EACrB,oBAAoB,EACrB,MAAM,oBAAoB,CAAC;AAwB5B,OAAO,EACL,sCAAsC,EACtC,4BAA4B,EAC7B,MAAM,UAAU,CAAC;AAElB,MAAM,MAAM,mBAAmB,GAAG;IAChC,QAAQ,EAAE,oBAAoB,EAAE,CAAC;IACjC,MAAM,EAAE,qBAAqB,EAAE,CAAC;CACjC,CAAC;AAmCF,wBAAsB,sBAAsB,CAC1C,IAAI,EAAE,IAAI,EACV,OAAO,EAAE,4BAA4B,EACrC,KAAK,UAAQ,GACZ,OAAO,CAAC,CAAC,KAAK,CAAC,EAAE,OAAO,KAAK,OAAO,CAAC,mBAAmB,CAAC,CAAC,CAmC5D;AAaD,wBAAsB,0BAA0B,CAC9C,IAAI,EAAE,IAAI,EACV,OAAO,EAAE,sCAAsC,GAC9C,OAAO,CAAC,MAAM,OAAO,CAAC,mBAAmB,CAAC,CAAC,CAiO7C;AAqJD,eAAe,sBAAsB,CAAC"}
|
|
@@ -97,6 +97,7 @@ async function setupAiAgentsGeneratorImpl(tree, options) {
|
|
|
97
97
|
...json.extraKnownMarketplaces,
|
|
98
98
|
'nx-claude-plugins': {
|
|
99
99
|
source: {
|
|
100
|
+
...json.extraKnownMarketplaces?.['nx-claude-plugins']?.source,
|
|
100
101
|
source: 'github',
|
|
101
102
|
repo: 'nrwl/nx-ai-agents-config',
|
|
102
103
|
},
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shared AI Agent NDJSON Output Utilities
|
|
3
|
+
*
|
|
4
|
+
* Base types and utilities for AI agent output across all Nx commands.
|
|
5
|
+
* Each command extends with its own specific progress stages, error codes, and result types.
|
|
6
|
+
*/
|
|
7
|
+
export type BaseProgressStage = 'starting' | 'complete' | 'error' | 'needs_input';
|
|
8
|
+
export interface ProgressMessage {
|
|
9
|
+
stage: string;
|
|
10
|
+
message: string;
|
|
11
|
+
}
|
|
12
|
+
export interface DetectedPlugin {
|
|
13
|
+
name: string;
|
|
14
|
+
reason: string;
|
|
15
|
+
}
|
|
16
|
+
export interface NextStep {
|
|
17
|
+
title: string;
|
|
18
|
+
command?: string;
|
|
19
|
+
url?: string;
|
|
20
|
+
note?: string;
|
|
21
|
+
}
|
|
22
|
+
export interface UserNextSteps {
|
|
23
|
+
description: string;
|
|
24
|
+
steps: NextStep[];
|
|
25
|
+
}
|
|
26
|
+
export interface PluginWarning {
|
|
27
|
+
plugin: string;
|
|
28
|
+
error: string;
|
|
29
|
+
hint: string;
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Write NDJSON message to stdout.
|
|
33
|
+
* Only outputs if running under an AI agent.
|
|
34
|
+
* Each message is a single line of JSON.
|
|
35
|
+
*/
|
|
36
|
+
export declare function writeAiOutput(message: Record<string, any>): void;
|
|
37
|
+
/**
|
|
38
|
+
* Log progress stage.
|
|
39
|
+
* Only outputs if running under an AI agent.
|
|
40
|
+
*/
|
|
41
|
+
export declare function logProgress(stage: string, message: string): void;
|
|
42
|
+
/**
|
|
43
|
+
* Write detailed error information to a temp file for AI debugging.
|
|
44
|
+
* Returns the path to the error log file.
|
|
45
|
+
*/
|
|
46
|
+
export declare function writeErrorLog(error: Error | unknown, commandName?: string): string;
|
|
47
|
+
//# sourceMappingURL=ai-output.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ai-output.d.ts","sourceRoot":"","sources":["../../../../../../packages/nx/src/command-line/ai/ai-output.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAQH,MAAM,MAAM,iBAAiB,GACzB,UAAU,GACV,UAAU,GACV,OAAO,GACP,aAAa,CAAC;AAElB,MAAM,WAAW,eAAe;IAC9B,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,cAAc;IAC7B,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,QAAQ;IACvB,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,aAAa;IAC5B,WAAW,EAAE,MAAM,CAAC;IACpB,KAAK,EAAE,QAAQ,EAAE,CAAC;CACnB;AAED,MAAM,WAAW,aAAa;IAC5B,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;CACd;AAED;;;;GAIG;AACH,wBAAgB,aAAa,CAAC,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,IAAI,CAoChE;AAED;;;GAGG;AACH,wBAAgB,WAAW,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,IAAI,CAEhE;AAED;;;GAGG;AACH,wBAAgB,aAAa,CAC3B,KAAK,EAAE,KAAK,GAAG,OAAO,EACtB,WAAW,GAAE,MAAa,GACzB,MAAM,CAwBR"}
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Shared AI Agent NDJSON Output Utilities
|
|
4
|
+
*
|
|
5
|
+
* Base types and utilities for AI agent output across all Nx commands.
|
|
6
|
+
* Each command extends with its own specific progress stages, error codes, and result types.
|
|
7
|
+
*/
|
|
8
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
+
exports.writeAiOutput = writeAiOutput;
|
|
10
|
+
exports.logProgress = logProgress;
|
|
11
|
+
exports.writeErrorLog = writeErrorLog;
|
|
12
|
+
const os_1 = require("os");
|
|
13
|
+
const path_1 = require("path");
|
|
14
|
+
const fs_1 = require("fs");
|
|
15
|
+
const native_1 = require("../../native");
|
|
16
|
+
/**
|
|
17
|
+
* Write NDJSON message to stdout.
|
|
18
|
+
* Only outputs if running under an AI agent.
|
|
19
|
+
* Each message is a single line of JSON.
|
|
20
|
+
*/
|
|
21
|
+
function writeAiOutput(message) {
|
|
22
|
+
if ((0, native_1.isAiAgent)()) {
|
|
23
|
+
process.stdout.write(JSON.stringify(message) + '\n');
|
|
24
|
+
// For success results, output plain text instructions that the agent can show the user
|
|
25
|
+
if (message.stage === 'complete' &&
|
|
26
|
+
'success' in message &&
|
|
27
|
+
message.success &&
|
|
28
|
+
'userNextSteps' in message) {
|
|
29
|
+
const steps = message.userNextSteps?.steps;
|
|
30
|
+
if (Array.isArray(steps)) {
|
|
31
|
+
let plainText = '\n---USER_NEXT_STEPS---\n';
|
|
32
|
+
plainText +=
|
|
33
|
+
'[DISPLAY] Show the user these next steps to complete setup:\n\n';
|
|
34
|
+
steps.forEach((step, i) => {
|
|
35
|
+
plainText += `${i + 1}. ${step.title}`;
|
|
36
|
+
if (step.command) {
|
|
37
|
+
plainText += `\n Run: ${step.command}`;
|
|
38
|
+
}
|
|
39
|
+
if (step.url) {
|
|
40
|
+
plainText += `\n Visit: ${step.url}`;
|
|
41
|
+
}
|
|
42
|
+
if (step.note) {
|
|
43
|
+
plainText += `\n ${step.note}`;
|
|
44
|
+
}
|
|
45
|
+
plainText += '\n';
|
|
46
|
+
});
|
|
47
|
+
plainText += '---END---\n';
|
|
48
|
+
process.stdout.write(plainText);
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* Log progress stage.
|
|
55
|
+
* Only outputs if running under an AI agent.
|
|
56
|
+
*/
|
|
57
|
+
function logProgress(stage, message) {
|
|
58
|
+
writeAiOutput({ stage, message });
|
|
59
|
+
}
|
|
60
|
+
/**
|
|
61
|
+
* Write detailed error information to a temp file for AI debugging.
|
|
62
|
+
* Returns the path to the error log file.
|
|
63
|
+
*/
|
|
64
|
+
function writeErrorLog(error, commandName = 'nx') {
|
|
65
|
+
const timestamp = Date.now();
|
|
66
|
+
const errorLogPath = (0, path_1.join)((0, os_1.tmpdir)(), `${commandName}-error-${timestamp}.log`);
|
|
67
|
+
let errorDetails = `Nx ${commandName} Error Log\n`;
|
|
68
|
+
errorDetails += `==================\n`;
|
|
69
|
+
errorDetails += `Timestamp: ${new Date(timestamp).toISOString()}\n\n`;
|
|
70
|
+
if (error instanceof Error) {
|
|
71
|
+
errorDetails += `Error: ${error.message}\n\n`;
|
|
72
|
+
if (error.stack) {
|
|
73
|
+
errorDetails += `Stack Trace:\n${error.stack}\n`;
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
else {
|
|
77
|
+
errorDetails += `Error: ${String(error)}\n`;
|
|
78
|
+
}
|
|
79
|
+
try {
|
|
80
|
+
(0, fs_1.writeFileSync)(errorLogPath, errorDetails);
|
|
81
|
+
}
|
|
82
|
+
catch {
|
|
83
|
+
return '';
|
|
84
|
+
}
|
|
85
|
+
return errorLogPath;
|
|
86
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"configure-ai-agents.d.ts","sourceRoot":"","sources":["../../../../../../packages/nx/src/command-line/configure-ai-agents/configure-ai-agents.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"configure-ai-agents.d.ts","sourceRoot":"","sources":["../../../../../../packages/nx/src/command-line/configure-ai-agents/configure-ai-agents.ts"],"names":[],"mappings":"AAqBA,OAAO,EAAE,wBAAwB,EAAE,MAAM,kBAAkB,CAAC;AAG5D,wBAAsB,wBAAwB,CAC5C,IAAI,EAAE,wBAAwB,EAC9B,KAAK,UAAQ,GACZ,OAAO,CAAC,IAAI,CAAC,CAsDf;AAED,wBAAsB,4BAA4B,CAChD,OAAO,EAAE,wBAAwB,GAChC,OAAO,CAAC,IAAI,CAAC,CAsUf"}
|
|
@@ -7,6 +7,7 @@ const node_fs_1 = require("node:fs");
|
|
|
7
7
|
const node_path_1 = require("node:path");
|
|
8
8
|
const pc = require("picocolors");
|
|
9
9
|
const constants_1 = require("../../ai/constants");
|
|
10
|
+
const detect_ai_agent_1 = require("../../ai/detect-ai-agent");
|
|
10
11
|
const utils_1 = require("../../ai/utils");
|
|
11
12
|
const client_1 = require("../../daemon/client/client");
|
|
12
13
|
const devkit_internals_1 = require("../../devkit-internals");
|
|
@@ -160,6 +161,81 @@ async function configureAiAgentsHandlerImpl(options) {
|
|
|
160
161
|
process.exit(1);
|
|
161
162
|
}
|
|
162
163
|
}
|
|
164
|
+
// Automatic mode (no explicit --agents): update outdated agents and report
|
|
165
|
+
// non-configured ones. When an AI agent is detected, also configure the
|
|
166
|
+
// detected agent itself (even if non-configured or partial).
|
|
167
|
+
const detectedAgent = (0, detect_ai_agent_1.detectAiAgent)();
|
|
168
|
+
const agentsExplicitlyPassed = options.agents !== undefined;
|
|
169
|
+
const isAutoMode = !agentsExplicitlyPassed && (options.interactive === false || detectedAgent);
|
|
170
|
+
if (isAutoMode) {
|
|
171
|
+
const agentsToConfig = [];
|
|
172
|
+
const allConfigs = [
|
|
173
|
+
...nonConfiguredAgents,
|
|
174
|
+
...partiallyConfiguredAgents,
|
|
175
|
+
...fullyConfiguredAgents,
|
|
176
|
+
];
|
|
177
|
+
// When an AI agent is detected, configure it if it needs it
|
|
178
|
+
if (detectedAgent) {
|
|
179
|
+
const detectedNeedsConfig = nonConfiguredAgents.some((a) => a.name === detectedAgent) ||
|
|
180
|
+
partiallyConfiguredAgents.some((a) => a.name === detectedAgent) ||
|
|
181
|
+
fullyConfiguredAgents.some((a) => a.name === detectedAgent && a.outdated);
|
|
182
|
+
if (detectedNeedsConfig) {
|
|
183
|
+
agentsToConfig.push(detectedAgent);
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
// Update any other outdated agents
|
|
187
|
+
for (const a of fullyConfiguredAgents) {
|
|
188
|
+
if (a.outdated && !agentsToConfig.includes(a.name)) {
|
|
189
|
+
agentsToConfig.push(a.name);
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
const stillNonConfigured = nonConfiguredAgents.filter((a) => !agentsToConfig.includes(a.name));
|
|
193
|
+
const nothingToDoMessage = detectedAgent
|
|
194
|
+
? `${utils_1.agentDisplayMap[detectedAgent] ?? detectedAgent} configuration is up to date`
|
|
195
|
+
: 'All configured AI agents are up to date';
|
|
196
|
+
if (agentsToConfig.length > 0) {
|
|
197
|
+
const configSpinner = ora(`Configuring agent(s)...`).start();
|
|
198
|
+
try {
|
|
199
|
+
await (0, utils_1.configureAgents)(agentsToConfig, workspace_root_1.workspaceRoot, false);
|
|
200
|
+
configSpinner.stop();
|
|
201
|
+
output_1.output.success({
|
|
202
|
+
title: 'AI agents configured successfully',
|
|
203
|
+
bodyLines: agentsToConfig.map((name) => {
|
|
204
|
+
const config = allConfigs.find((a) => a.name === name);
|
|
205
|
+
return config
|
|
206
|
+
? `${config.displayName}: ${getAgentConfiguredDescription(config)}`
|
|
207
|
+
: `- ${name}`;
|
|
208
|
+
}),
|
|
209
|
+
});
|
|
210
|
+
}
|
|
211
|
+
catch (e) {
|
|
212
|
+
configSpinner.fail('Failed to configure AI agents');
|
|
213
|
+
output_1.output.error({
|
|
214
|
+
title: 'Error details:',
|
|
215
|
+
bodyLines: [e.message],
|
|
216
|
+
});
|
|
217
|
+
process.exit(1);
|
|
218
|
+
}
|
|
219
|
+
}
|
|
220
|
+
else {
|
|
221
|
+
output_1.output.success({
|
|
222
|
+
title: nothingToDoMessage,
|
|
223
|
+
});
|
|
224
|
+
}
|
|
225
|
+
if (stillNonConfigured.length > 0) {
|
|
226
|
+
const agentNames = stillNonConfigured.map((a) => a.name);
|
|
227
|
+
output_1.output.log({
|
|
228
|
+
title: 'The following agents are not yet configured:',
|
|
229
|
+
bodyLines: [
|
|
230
|
+
...stillNonConfigured.map((a) => `- ${a.displayName}`),
|
|
231
|
+
'',
|
|
232
|
+
`Run: nx configure-ai-agents --agents ${agentNames.join(' ')}`,
|
|
233
|
+
],
|
|
234
|
+
});
|
|
235
|
+
}
|
|
236
|
+
return;
|
|
237
|
+
}
|
|
238
|
+
// Interactive mode (or non-interactive with explicit --agents)
|
|
163
239
|
const allAgentChoices = [];
|
|
164
240
|
const preselectedIndices = [];
|
|
165
241
|
let currentIndex = 0;
|
|
@@ -210,7 +286,7 @@ async function configureAiAgentsHandlerImpl(options) {
|
|
|
210
286
|
}
|
|
211
287
|
}
|
|
212
288
|
else {
|
|
213
|
-
//
|
|
289
|
+
// non-interactive with explicit --agents: configure all requested
|
|
214
290
|
selectedAgents = allAgentChoices.map((a) => a.name);
|
|
215
291
|
}
|
|
216
292
|
if (selectedAgents?.length === 0) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"command-object.d.ts","sourceRoot":"","sources":["../../../../../../packages/nx/src/command-line/import/command-object.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"command-object.d.ts","sourceRoot":"","sources":["../../../../../../packages/nx/src/command-line/import/command-object.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAYtC,eAAO,MAAM,kBAAkB,EAAE,aAiEhC,CAAC"}
|
|
@@ -1,9 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.yargsImportCommand = void 0;
|
|
4
|
+
const native_1 = require("../../native");
|
|
5
|
+
const handle_errors_1 = require("../../utils/handle-errors");
|
|
6
|
+
const ai_output_1 = require("../ai/ai-output");
|
|
7
|
+
const ai_output_2 = require("./utils/ai-output");
|
|
4
8
|
const documentation_1 = require("../yargs-utils/documentation");
|
|
5
9
|
const shared_options_1 = require("../yargs-utils/shared-options");
|
|
6
|
-
const handle_errors_1 = require("../../utils/handle-errors");
|
|
7
10
|
exports.yargsImportCommand = {
|
|
8
11
|
command: 'import [sourceRepository] [destinationDirectory]',
|
|
9
12
|
describe: 'Import code and git history from another repository into this repository.',
|
|
@@ -34,10 +37,25 @@ exports.yargsImportCommand = {
|
|
|
34
37
|
type: 'boolean',
|
|
35
38
|
description: 'Interactive mode.',
|
|
36
39
|
default: true,
|
|
40
|
+
})
|
|
41
|
+
.option('plugins', {
|
|
42
|
+
type: 'string',
|
|
43
|
+
description: 'Plugins to install after import: "skip" for none, "all" for all detected, or comma-separated list (e.g., @nx/vite,@nx/jest).',
|
|
37
44
|
})), 'import'),
|
|
38
45
|
handler: async (args) => {
|
|
39
46
|
const exitCode = await (0, handle_errors_1.handleErrors)(args.verbose, async () => {
|
|
40
|
-
|
|
47
|
+
try {
|
|
48
|
+
return await (await Promise.resolve().then(() => require('./import'))).importHandler(args);
|
|
49
|
+
}
|
|
50
|
+
catch (error) {
|
|
51
|
+
if ((0, native_1.isAiAgent)()) {
|
|
52
|
+
const errorMessage = error instanceof Error ? error.message : String(error);
|
|
53
|
+
const errorCode = (0, ai_output_2.determineImportErrorCode)(error);
|
|
54
|
+
const errorLogPath = (0, ai_output_2.writeErrorLog)(error, 'nx-import');
|
|
55
|
+
(0, ai_output_1.writeAiOutput)((0, ai_output_2.buildImportErrorResult)(errorMessage, errorCode, errorLogPath));
|
|
56
|
+
}
|
|
57
|
+
throw error;
|
|
58
|
+
}
|
|
41
59
|
});
|
|
42
60
|
process.exit(exitCode);
|
|
43
61
|
},
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"import.d.ts","sourceRoot":"","sources":["../../../../../../packages/nx/src/command-line/import/import.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"import.d.ts","sourceRoot":"","sources":["../../../../../../packages/nx/src/command-line/import/import.ts"],"names":[],"mappings":"AAoDA,MAAM,WAAW,aAAa;IAC5B;;OAEG;IACH,gBAAgB,EAAE,MAAM,CAAC;IACzB;;OAEG;IACH,GAAG,EAAE,MAAM,CAAC;IACZ;;OAEG;IACH,MAAM,EAAE,MAAM,CAAC;IACf;;OAEG;IACH,WAAW,EAAE,MAAM,CAAC;IACpB;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;IAEd,OAAO,EAAE,OAAO,CAAC;IACjB,WAAW,EAAE,OAAO,CAAC;IACrB,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED,wBAAsB,aAAa,CAAC,OAAO,EAAE,aAAa,iBA0ezD"}
|