create-nx-workspace 23.2.0-beta.10 → 23.2.0-beta.12
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
CHANGED
|
@@ -7,9 +7,9 @@
|
|
|
7
7
|
|
|
8
8
|
<div style="text-align: center;">
|
|
9
9
|
|
|
10
|
-
[]()
|
|
10
|
+
[](<>)
|
|
11
11
|
[](https://www.npmjs.com/package/nx)
|
|
12
|
-
[]()
|
|
12
|
+
[](<>)
|
|
13
13
|
[](http://commitizen.github.io/cz-cli/)
|
|
14
14
|
[](https://go.nx.dev/community)
|
|
15
15
|
[](https://nx.dev/docs/features/ci-features/sandboxing)
|
|
@@ -130,7 +130,11 @@ async function determineAiAgents(parsedArgs) {
|
|
|
130
130
|
return [];
|
|
131
131
|
}
|
|
132
132
|
const detected = (0, ai_output_1.detectAiAgentName)();
|
|
133
|
-
|
|
133
|
+
// Detection is broader than what the generator can configure — `copilot-cli`
|
|
134
|
+
// is reported so CNW can switch to agent output, but has no generator branch,
|
|
135
|
+
// and `copilot` is the VS Code extension, whose branch installs Nx Console.
|
|
136
|
+
// Mirrors the same guard in nx's `ai/detect-ai-agent.ts`.
|
|
137
|
+
if (detected && create_workspace_options_1.supportedAgents.includes(detected)) {
|
|
134
138
|
return [detected];
|
|
135
139
|
}
|
|
136
140
|
return [];
|
|
@@ -12,6 +12,13 @@ import { CnwErrorCode } from '../error-utils';
|
|
|
12
12
|
export declare function isAiAgent(): boolean;
|
|
13
13
|
export declare function isClaudeCode(): boolean;
|
|
14
14
|
export declare function isOpenCode(): boolean;
|
|
15
|
+
export declare function isCodex(): boolean;
|
|
16
|
+
/**
|
|
17
|
+
* `COPILOT_CLI` is set by the GitHub Copilot CLI in the shells it spawns.
|
|
18
|
+
* Distinct from the VS Code extension's agent mode: different products, and
|
|
19
|
+
* only the CLI drives `create-nx-workspace` from a shell.
|
|
20
|
+
*/
|
|
21
|
+
export declare function isCopilotCli(): boolean;
|
|
15
22
|
export declare function isReplitAi(): boolean;
|
|
16
23
|
export declare function isCursorAi(): boolean;
|
|
17
24
|
export declare function isGeminiCli(): boolean;
|
|
@@ -14,6 +14,8 @@ exports.SUGGESTED_WORKSPACE_NAME = void 0;
|
|
|
14
14
|
exports.isAiAgent = isAiAgent;
|
|
15
15
|
exports.isClaudeCode = isClaudeCode;
|
|
16
16
|
exports.isOpenCode = isOpenCode;
|
|
17
|
+
exports.isCodex = isCodex;
|
|
18
|
+
exports.isCopilotCli = isCopilotCli;
|
|
17
19
|
exports.isReplitAi = isReplitAi;
|
|
18
20
|
exports.isCursorAi = isCursorAi;
|
|
19
21
|
exports.isGeminiCli = isGeminiCli;
|
|
@@ -29,6 +31,8 @@ function isAiAgent() {
|
|
|
29
31
|
_isAiAgent =
|
|
30
32
|
isClaudeCode() ||
|
|
31
33
|
isOpenCode() ||
|
|
34
|
+
isCodex() ||
|
|
35
|
+
isCopilotCli() ||
|
|
32
36
|
isReplitAi() ||
|
|
33
37
|
isCursorAi() ||
|
|
34
38
|
isGeminiCli();
|
|
@@ -41,6 +45,17 @@ function isClaudeCode() {
|
|
|
41
45
|
function isOpenCode() {
|
|
42
46
|
return !!process.env.OPENCODE;
|
|
43
47
|
}
|
|
48
|
+
function isCodex() {
|
|
49
|
+
return (!!process.env.CODEX_THREAD_ID || process.env.SUPERSET_AGENT_ID === 'codex');
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* `COPILOT_CLI` is set by the GitHub Copilot CLI in the shells it spawns.
|
|
53
|
+
* Distinct from the VS Code extension's agent mode: different products, and
|
|
54
|
+
* only the CLI drives `create-nx-workspace` from a shell.
|
|
55
|
+
*/
|
|
56
|
+
function isCopilotCli() {
|
|
57
|
+
return !!process.env.COPILOT_CLI;
|
|
58
|
+
}
|
|
44
59
|
function isReplitAi() {
|
|
45
60
|
return !!process.env.REPL_ID;
|
|
46
61
|
}
|
|
@@ -60,6 +75,10 @@ function detectAiAgentName() {
|
|
|
60
75
|
return 'cursor';
|
|
61
76
|
if (isOpenCode())
|
|
62
77
|
return 'opencode';
|
|
78
|
+
if (isCodex())
|
|
79
|
+
return 'codex';
|
|
80
|
+
if (isCopilotCli())
|
|
81
|
+
return 'copilot-cli';
|
|
63
82
|
if (isGeminiCli())
|
|
64
83
|
return 'gemini';
|
|
65
84
|
return null;
|