nx 24.0.0-beta.2 → 24.0.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/dist/bin/post-install.js +5 -3
- package/dist/src/adapter/ngcli-adapter.js +1 -2
- package/dist/src/command-line/add/add.d.ts +2 -0
- package/dist/src/command-line/add/add.js +23 -5
- package/dist/src/command-line/affected/affected.js +2 -2
- package/dist/src/command-line/init/implementation/add-nx-to-nest.js +21 -62
- package/dist/src/command-line/migrate/agentic/definitions.d.ts +1 -3
- package/dist/src/command-line/migrate/agentic/definitions.js +5 -97
- package/dist/src/command-line/migrate/agentic/handoff-gitignore.d.ts +7 -41
- package/dist/src/command-line/migrate/agentic/handoff-gitignore.js +9 -48
- package/dist/src/command-line/migrate/agentic/handoff.d.ts +1 -43
- package/dist/src/command-line/migrate/agentic/handoff.js +3 -119
- package/dist/src/command-line/migrate/agentic/instruction-files.d.ts +0 -21
- package/dist/src/command-line/migrate/agentic/instruction-files.js +6 -27
- package/dist/src/command-line/migrate/agentic/master/run-master-session.d.ts +19 -1
- package/dist/src/command-line/migrate/agentic/master/run-master-session.js +63 -36
- package/dist/src/command-line/migrate/agentic/master/spawn-master.d.ts +1 -0
- package/dist/src/command-line/migrate/agentic/master/spawn-master.js +7 -5
- package/dist/src/command-line/migrate/agentic/print-dropped-agent-context.d.ts +2 -2
- package/dist/src/command-line/migrate/agentic/print-dropped-agent-context.js +2 -2
- package/dist/src/command-line/migrate/agentic/prompts/fragments.d.ts +1 -12
- package/dist/src/command-line/migrate/agentic/prompts/fragments.js +8 -17
- package/dist/src/command-line/migrate/agentic/prompts/shared-rendering.d.ts +0 -15
- package/dist/src/command-line/migrate/agentic/prompts/shared-rendering.js +3 -100
- package/dist/src/command-line/migrate/agentic/select.d.ts +12 -6
- package/dist/src/command-line/migrate/agentic/select.js +35 -5
- package/dist/src/command-line/migrate/agentic/types.d.ts +9 -68
- package/dist/src/command-line/migrate/agentic/types.js +5 -5
- package/dist/src/command-line/migrate/command-object.js +3 -3
- package/dist/src/command-line/migrate/migrate-analytics.d.ts +12 -1
- package/dist/src/command-line/migrate/migrate-analytics.js +26 -0
- package/dist/src/command-line/migrate/migrate-commits.d.ts +9 -10
- package/dist/src/command-line/migrate/migrate-commits.js +25 -18
- package/dist/src/command-line/migrate/migrate-output.d.ts +1 -6
- package/dist/src/command-line/migrate/migrate-output.js +1 -10
- package/dist/src/command-line/migrate/migrate.js +16 -27
- package/dist/src/command-line/migrate/run/agent-output.d.ts +1 -0
- package/dist/src/command-line/migrate/run/agent-output.js +4 -0
- package/dist/src/command-line/migrate/run/broker.js +1 -1
- package/dist/src/command-line/migrate/run/give-up.d.ts +4 -3
- package/dist/src/command-line/migrate/run/give-up.js +8 -5
- package/dist/src/command-line/migrate/run/index.d.ts +2 -1
- package/dist/src/command-line/migrate/run/index.js +5 -1
- package/dist/src/command-line/migrate/run/issues.js +7 -2
- package/dist/src/command-line/migrate/run/orchestrator.d.ts +40 -4
- package/dist/src/command-line/migrate/run/orchestrator.js +233 -92
- package/dist/src/command-line/migrate/run/run-state.d.ts +4 -1
- package/dist/src/command-line/migrate/run/run-state.js +20 -2
- package/dist/src/command-line/migrate/run/runbook.d.ts +1 -0
- package/dist/src/command-line/migrate/run/runbook.js +99 -21
- package/dist/src/command-line/migrate/run/state-lock.d.ts +29 -4
- package/dist/src/command-line/migrate/run/state-lock.js +102 -10
- package/dist/src/command-line/migrate/run/util.d.ts +4 -2
- package/dist/src/command-line/migrate/run/util.js +23 -2
- package/dist/src/command-line/migrate/run/worker.d.ts +1 -1
- package/dist/src/command-line/migrate/run/worker.js +252 -250
- package/dist/src/command-line/release/changelog.js +9 -6
- package/dist/src/command-line/release/config/config.d.ts +1 -0
- package/dist/src/command-line/release/config/config.js +48 -9
- package/dist/src/command-line/release/release.js +2 -2
- package/dist/src/command-line/release/utils/git.js +8 -7
- package/dist/src/command-line/release/utils/interpolate-release-config.d.ts +6 -0
- package/dist/src/command-line/release/utils/interpolate-release-config.js +39 -0
- package/dist/src/command-line/release/utils/release-graph.d.ts +5 -0
- package/dist/src/command-line/release/utils/release-graph.js +1 -0
- package/dist/src/command-line/release/utils/resolve-changelog-renderer.js +2 -2
- package/dist/src/command-line/release/utils/shared.js +10 -10
- package/dist/src/command-line/release/utils/version-plan-utils.d.ts +3 -12
- package/dist/src/command-line/release/utils/version-plan-utils.js +33 -55
- package/dist/src/command-line/release/version/version-actions.js +2 -1
- package/dist/src/command-line/release/version.js +5 -2
- package/dist/src/command-line/show/projects.js +5 -3
- package/dist/src/command-line/yargs-utils/shared-options.js +1 -1
- package/dist/src/config/nx-json.d.ts +8 -5
- package/dist/src/config/workspace-json-project-json.d.ts +12 -9
- package/dist/src/core/graph/main.js +1 -1
- package/dist/src/devkit-exports.d.ts +4 -0
- package/dist/src/devkit-exports.js +6 -1
- package/dist/src/devkit-internals.d.ts +1 -1
- package/dist/src/devkit-internals.js +4 -3
- package/dist/src/executors/run-commands/run-commands.impl.d.ts +2 -2
- package/dist/src/executors/run-commands/run-commands.impl.js +20 -10
- package/dist/src/executors/run-commands/running-tasks.d.ts +12 -3
- package/dist/src/executors/run-commands/running-tasks.js +22 -18
- package/dist/src/hasher/check-task-files.js +1 -4
- package/dist/src/migrations/update-23-2-0/set-cache-on-executor-target-defaults.d.ts +1 -2
- package/dist/src/migrations/update-23-2-0/set-cache-on-executor-target-defaults.js +6 -11
- package/dist/src/migrations/update-23-2-0/set-cache-on-executor-target-defaults.md +2 -2
- package/dist/src/migrations/update-24-0-0/enable-legacy-affected.d.ts +4 -0
- package/dist/src/migrations/update-24-0-0/enable-legacy-affected.js +15 -0
- package/dist/src/migrations/update-24-0-0/enable-legacy-affected.md +30 -0
- package/dist/src/migrations/update-24-0-0/move-custom-hashers-to-inputs.md +7 -6
- package/dist/src/migrations/update-24-0-0/rename-ultracache-ignore-options.d.ts +3 -0
- package/dist/src/migrations/update-24-0-0/rename-ultracache-ignore-options.js +130 -0
- package/dist/src/migrations/update-24-0-0/rename-ultracache-ignore-options.md +62 -0
- package/dist/src/native/index.d.ts +3 -3
- package/dist/src/native/nx.wasm32-wasi.debug.wasm +0 -0
- package/dist/src/native/nx.wasm32-wasi.wasm +0 -0
- package/dist/src/plugins/js/lock-file/pnpm-parser.js +1 -3
- package/dist/src/plugins/js/lock-file/pruned-output.d.ts +2 -2
- package/dist/src/plugins/js/lock-file/pruned-output.js +4 -4
- package/dist/src/project-graph/affected/affected-tasks.d.ts +6 -5
- package/dist/src/project-graph/affected/affected-tasks.js +16 -6
- package/dist/src/project-graph/utils/project-configuration/target-merging.js +1 -1
- package/dist/src/project-graph/utils/project-configuration/target-normalization.js +7 -133
- package/dist/src/project-graph/utils/project-configuration-utils.js +2 -2
- package/dist/src/tasks-runner/readiness/probes.js +30 -1
- package/dist/src/tasks-runner/readiness/ready-when.d.ts +31 -10
- package/dist/src/tasks-runner/readiness/ready-when.js +178 -41
- package/dist/src/tasks-runner/task-orchestrator.d.ts +4 -0
- package/dist/src/tasks-runner/task-orchestrator.js +113 -38
- package/dist/src/tasks-runner/tokens.d.ts +54 -0
- package/dist/src/tasks-runner/tokens.js +161 -0
- package/dist/src/tasks-runner/utils.d.ts +15 -1
- package/dist/src/tasks-runner/utils.js +79 -33
- package/dist/src/utils/acknowledge-build-scripts.d.ts +34 -1
- package/dist/src/utils/acknowledge-build-scripts.js +171 -32
- package/dist/src/utils/long-running-target.d.ts +1 -3
- package/dist/src/utils/long-running-target.js +1 -3
- package/migrations.json +13 -6
- package/package.json +11 -11
- package/schemas/nx-schema.json +17 -11
- package/schemas/project-schema.json +8 -7
- package/dist/src/command-line/migrate/agentic/prompts/generic-validation.d.ts +0 -56
- package/dist/src/command-line/migrate/agentic/prompts/generic-validation.js +0 -67
- package/dist/src/command-line/migrate/agentic/prompts/hybrid-prompt-migration.d.ts +0 -49
- package/dist/src/command-line/migrate/agentic/prompts/hybrid-prompt-migration.js +0 -53
- package/dist/src/command-line/migrate/agentic/prompts/prompt-migration.d.ts +0 -26
- package/dist/src/command-line/migrate/agentic/prompts/prompt-migration.js +0 -27
- package/dist/src/command-line/migrate/agentic/prompts/system-prompt.d.ts +0 -70
- package/dist/src/command-line/migrate/agentic/prompts/system-prompt.js +0 -113
- package/dist/src/command-line/migrate/agentic/run-step.d.ts +0 -68
- package/dist/src/command-line/migrate/agentic/run-step.js +0 -148
- package/dist/src/command-line/migrate/agentic/runner.d.ts +0 -21
- package/dist/src/command-line/migrate/agentic/runner.js +0 -262
- package/dist/src/migrations/update-23-0-0/consolidate-release-tag-config.d.ts +0 -9
- package/dist/src/migrations/update-23-0-0/consolidate-release-tag-config.js +0 -18
|
@@ -1,262 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.runAgentic = runAgentic;
|
|
4
|
-
const tslib_1 = require("tslib");
|
|
5
|
-
const child_process_1 = require("child_process");
|
|
6
|
-
const pc = tslib_1.__importStar(require("picocolors"));
|
|
7
|
-
const logger_1 = require("../../../utils/logger");
|
|
8
|
-
const output_1 = require("../../../utils/output");
|
|
9
|
-
const migrate_analytics_1 = require("../migrate-analytics");
|
|
10
|
-
const safe_prompt_1 = require("../safe-prompt");
|
|
11
|
-
const close_agent_session_1 = require("./close-agent-session");
|
|
12
|
-
const handoff_1 = require("./handoff");
|
|
13
|
-
const terminal_repair_1 = require("./terminal-repair");
|
|
14
|
-
const windows_cmd_1 = require("./windows-cmd");
|
|
15
|
-
/**
|
|
16
|
-
* Spawns the selected agent with `stdio: 'inherit'`, swallows SIGINT while the
|
|
17
|
-
* child is alive, waits for it to exit, and resolves the run's outcome from
|
|
18
|
-
* the handoff file (or the user when the file is missing).
|
|
19
|
-
*/
|
|
20
|
-
async function runAgentic(args) {
|
|
21
|
-
const { detected, definition, invocationContext, handoffFilePath, handoffsDir, handoffPollIntervalMs, gracefulExitMs = close_agent_session_1.AGENT_GRACEFUL_EXIT_MS, forceKillWaitMs = close_agent_session_1.FORCE_KILL_WAIT_MS, } = args;
|
|
22
|
-
const adapted = adaptWithinCommandLineBudget(detected, definition, invocationContext);
|
|
23
|
-
let child;
|
|
24
|
-
// Local alias so `@nx/workspace-require-windows-hide` recognizes the
|
|
25
|
-
// options arg as a tracked Identifier rather than giving up on a
|
|
26
|
-
// member-expression skip — keeps the lint rule strict on other call sites.
|
|
27
|
-
const spawnOptions = adapted.options;
|
|
28
|
-
try {
|
|
29
|
-
child = (0, child_process_1.spawn)(adapted.binary, adapted.args, spawnOptions);
|
|
30
|
-
}
|
|
31
|
-
catch (err) {
|
|
32
|
-
return resolveFromHandoffOrPrompt(handoffFilePath, handoffsDir, false, {
|
|
33
|
-
spawnError: err instanceof Error ? err.message : String(err),
|
|
34
|
-
});
|
|
35
|
-
}
|
|
36
|
-
// Counts SIGINTs while the agent runs. Non-zero after exit means the
|
|
37
|
-
// user pressed Ctrl+C → skip the ambiguous abort/continue prompt. Prompting
|
|
38
|
-
// in the TTY state left by a SIGINT-killed child misbehaved under enquirer
|
|
39
|
-
// (ERR_USE_AFTER_CLOSE, setRawMode EIO) from async chains `await` could not
|
|
40
|
-
// catch. Whether @clack/prompts shares that fault is unverified, so the skip
|
|
41
|
-
// stays; reproducing it needs a real terminal.
|
|
42
|
-
let userInterruptCount = 0;
|
|
43
|
-
const swallowSigint = () => {
|
|
44
|
-
userInterruptCount++;
|
|
45
|
-
};
|
|
46
|
-
process.on('SIGINT', swallowSigint);
|
|
47
|
-
const handoffWatchAbort = new AbortController();
|
|
48
|
-
const exitPromise = (0, close_agent_session_1.waitForExit)(child);
|
|
49
|
-
const handoffPromise = (0, handoff_1.waitForValidHandoff)(handoffFilePath, handoffsDir, {
|
|
50
|
-
signal: handoffWatchAbort.signal,
|
|
51
|
-
intervalMs: handoffPollIntervalMs,
|
|
52
|
-
});
|
|
53
|
-
let exitInfo = {};
|
|
54
|
-
try {
|
|
55
|
-
const winner = await Promise.race([
|
|
56
|
-
exitPromise.then((info) => {
|
|
57
|
-
exitInfo = info;
|
|
58
|
-
return 'exit';
|
|
59
|
-
}),
|
|
60
|
-
// Rejection handler swallows the abort-triggered rejection from the
|
|
61
|
-
// `finally` block after the race has settled — otherwise Node logs it
|
|
62
|
-
// as an unhandled rejection.
|
|
63
|
-
handoffPromise.then(() => 'handoff', () => 'exit'),
|
|
64
|
-
]);
|
|
65
|
-
if (winner === 'handoff') {
|
|
66
|
-
await (0, close_agent_session_1.closeAgentSession)(child, exitPromise, gracefulExitMs, forceKillWaitMs);
|
|
67
|
-
// Extra safety bound so the orchestrator can't hang if the child
|
|
68
|
-
// stays stuck after SIGKILL / taskkill (e.g. D-state on a hung NFS
|
|
69
|
-
// read, or taskkill returning before the process actually exits).
|
|
70
|
-
await (0, close_agent_session_1.raceWithTimeout)(exitPromise, forceKillWaitMs);
|
|
71
|
-
}
|
|
72
|
-
}
|
|
73
|
-
finally {
|
|
74
|
-
handoffWatchAbort.abort();
|
|
75
|
-
process.removeListener('SIGINT', swallowSigint);
|
|
76
|
-
(0, terminal_repair_1.restoreTermiosAfterAgent)();
|
|
77
|
-
}
|
|
78
|
-
return resolveFromHandoffOrPrompt(handoffFilePath, handoffsDir, userInterruptCount > 0, exitInfoToCause(exitInfo));
|
|
79
|
-
}
|
|
80
|
-
/**
|
|
81
|
-
* Builds Windows shim arguments within budget, trying the shorter context
|
|
82
|
-
* before aborting. Rejects overflow to avoid truncated instructions.
|
|
83
|
-
* Leaves command lines unmeasured off the shim path.
|
|
84
|
-
*/
|
|
85
|
-
function adaptWithinCommandLineBudget(detected, definition, invocationContext) {
|
|
86
|
-
const adapt = (ctx) => {
|
|
87
|
-
const spec = definition.buildInteractive(ctx);
|
|
88
|
-
return (0, windows_cmd_1.adaptSpawnForWindowsShim)(detected.binary, spec.args, {
|
|
89
|
-
stdio: 'inherit',
|
|
90
|
-
cwd: spec.cwd ?? ctx.workspaceRoot,
|
|
91
|
-
env: spec.env ? { ...process.env, ...spec.env } : process.env,
|
|
92
|
-
windowsHide: true,
|
|
93
|
-
});
|
|
94
|
-
};
|
|
95
|
-
const adapted = adapt(invocationContext);
|
|
96
|
-
if ((0, windows_cmd_1.withinCommandLineBudget)(adapted)) {
|
|
97
|
-
return adapted;
|
|
98
|
-
}
|
|
99
|
-
const reduced = adapt({
|
|
100
|
-
...invocationContext,
|
|
101
|
-
inlineSystemContext: invocationContext.inlineSystemContextFallback,
|
|
102
|
-
});
|
|
103
|
-
if ((0, windows_cmd_1.withinCommandLineBudget)(reduced)) {
|
|
104
|
-
logger_1.logger.info(pc.dim(` Passing the agent a reduced system context. The full one does not fit on a Windows command line alongside these paths.`));
|
|
105
|
-
return reduced;
|
|
106
|
-
}
|
|
107
|
-
output_1.output.error({
|
|
108
|
-
title: `${detected.displayName} cannot be started for this migration step`,
|
|
109
|
-
bodyLines: [
|
|
110
|
-
`Launching it needs a ${reduced.commandLineLength}-character command line. cmd.exe runs at most ${windows_cmd_1.WINDOWS_COMMAND_LINE_LIMIT} characters, and nx stops at ${windows_cmd_1.WINDOWS_COMMAND_LINE_BUDGET} to leave room for what it cannot measure from here.`,
|
|
111
|
-
`The length is paths: the workspace root, at ${invocationContext.workspaceRoot.length} characters, and the migration's package and name, each repeated across several of them.`,
|
|
112
|
-
``,
|
|
113
|
-
`Re-run with \`--agentic=false\` to apply the remaining migrations yourself. Moving the workspace to a shorter path can help too, but only for agents that put it on the command line.`,
|
|
114
|
-
],
|
|
115
|
-
});
|
|
116
|
-
throw new Error(`Cannot start ${detected.displayName}: the command line exceeds the Windows limit.`);
|
|
117
|
-
}
|
|
118
|
-
function exitInfoToCause(info) {
|
|
119
|
-
const cause = {};
|
|
120
|
-
// Include `code === 0` so the prompt can distinguish "agent exited cleanly
|
|
121
|
-
// without writing a handoff" (likely the user closed the agent on purpose,
|
|
122
|
-
// or the agent terminated without invoking the handoff step) from "agent
|
|
123
|
-
// was killed before it could write" (signal) or "agent crashed" (non-zero
|
|
124
|
-
// code). Without this distinction every clean-exit-no-handoff collapses
|
|
125
|
-
// into the same uninformative ambiguous-prompt body.
|
|
126
|
-
if (info.code !== undefined && info.code !== null) {
|
|
127
|
-
cause.exitCode = info.code;
|
|
128
|
-
}
|
|
129
|
-
if (info.signal)
|
|
130
|
-
cause.exitSignal = info.signal;
|
|
131
|
-
if (info.error)
|
|
132
|
-
cause.exitError = info.error.message;
|
|
133
|
-
return cause;
|
|
134
|
-
}
|
|
135
|
-
async function resolveFromHandoffOrPrompt(handoffFilePath, handoffsDir, userInterrupted = false, cause = {}) {
|
|
136
|
-
const read = (0, handoff_1.readHandoffWithReason)(handoffFilePath, handoffsDir);
|
|
137
|
-
if (read.ok === true) {
|
|
138
|
-
return {
|
|
139
|
-
kind: read.handoff.status,
|
|
140
|
-
summary: read.handoff.summary,
|
|
141
|
-
extras: read.handoff.extras,
|
|
142
|
-
};
|
|
143
|
-
}
|
|
144
|
-
const fullCause = {
|
|
145
|
-
...cause,
|
|
146
|
-
handoff: { reason: read.reason, detail: read.detail },
|
|
147
|
-
};
|
|
148
|
-
if (userInterrupted) {
|
|
149
|
-
// User pressed Ctrl+C. Don't show the abort/continue prompt — they
|
|
150
|
-
// already told us what they want. Prompting in the TTY state left by a
|
|
151
|
-
// SIGINT-killed child also tripped enquirer's setRawMode-EIO and
|
|
152
|
-
// ERR_USE_AFTER_CLOSE bugs; whether @clack/prompts shares that fault is
|
|
153
|
-
// unverified, so the skip stays. The orchestrator's standard failure
|
|
154
|
-
// cascade surfaces the abort outcome.
|
|
155
|
-
//
|
|
156
|
-
// After user interruption, suppress conventional stop statuses and retain
|
|
157
|
-
// independent failure diagnostics for the caller to display.
|
|
158
|
-
const exitWasCtrlC = cause.exitCode === 130 ||
|
|
159
|
-
cause.exitCode === 143 ||
|
|
160
|
-
cause.exitSignal === 'SIGINT' ||
|
|
161
|
-
cause.exitSignal === 'SIGTERM';
|
|
162
|
-
const userScrubbed = {
|
|
163
|
-
exitError: cause.exitError,
|
|
164
|
-
exitCode: exitWasCtrlC ? undefined : cause.exitCode,
|
|
165
|
-
exitSignal: exitWasCtrlC ? undefined : cause.exitSignal,
|
|
166
|
-
handoff: read.reason === 'missing'
|
|
167
|
-
? undefined
|
|
168
|
-
: { reason: read.reason, detail: read.detail },
|
|
169
|
-
};
|
|
170
|
-
const causeSummary = describeAmbiguousCause(userScrubbed);
|
|
171
|
-
return {
|
|
172
|
-
kind: 'ambiguous-abort',
|
|
173
|
-
...(causeSummary.length > 0 && { causeSummary }),
|
|
174
|
-
};
|
|
175
|
-
}
|
|
176
|
-
return promptAmbiguous(fullCause);
|
|
177
|
-
}
|
|
178
|
-
async function promptAmbiguous(cause) {
|
|
179
|
-
// stderr blank line so the spacer lands in the same stream as output.warn
|
|
180
|
-
// and the prompt — buffered stdout could otherwise reorder it and glue the
|
|
181
|
-
// prompt to the agent's trailing exit message.
|
|
182
|
-
process.stderr.write('\n');
|
|
183
|
-
// Cause rendered ABOVE the prompt rather than inlined into its message:
|
|
184
|
-
// enquirer's select redraw used different math for clear (wrap-aware) vs
|
|
185
|
-
// restore (raw \n-split count), so a multi-line message could leave orphaned
|
|
186
|
-
// cells on arrow-key re-renders. Kept single-line because that constraint is
|
|
187
|
-
// unverified under @clack/prompts, not because the cause still applies.
|
|
188
|
-
const causeLines = describeAmbiguousCause(cause);
|
|
189
|
-
if (causeLines.length > 0) {
|
|
190
|
-
output_1.output.warn({
|
|
191
|
-
title: 'The agent run ended without a usable handoff',
|
|
192
|
-
bodyLines: causeLines,
|
|
193
|
-
});
|
|
194
|
-
}
|
|
195
|
-
// Cancelling exits 130 from inside the prompt; any other rejection is an
|
|
196
|
-
// abort.
|
|
197
|
-
try {
|
|
198
|
-
const choice = await (0, safe_prompt_1.migrateChoice)({
|
|
199
|
-
message: 'How should nx migrate proceed?',
|
|
200
|
-
choices: [
|
|
201
|
-
{ value: 'abort', label: 'Treat as failed — abort the run' },
|
|
202
|
-
{
|
|
203
|
-
value: 'continue',
|
|
204
|
-
label: 'Treat as completed — mark done and continue',
|
|
205
|
-
},
|
|
206
|
-
],
|
|
207
|
-
});
|
|
208
|
-
(0, migrate_analytics_1.reportMigratePrompt)('ambiguous_agent_outcome', choice);
|
|
209
|
-
return choice === 'continue'
|
|
210
|
-
? { kind: 'ambiguous-continue' }
|
|
211
|
-
: { kind: 'ambiguous-abort' };
|
|
212
|
-
}
|
|
213
|
-
catch {
|
|
214
|
-
return { kind: 'ambiguous-abort' };
|
|
215
|
-
}
|
|
216
|
-
}
|
|
217
|
-
function describeAmbiguousCause(cause) {
|
|
218
|
-
const lines = [];
|
|
219
|
-
if (cause.spawnError) {
|
|
220
|
-
lines.push(`Could not spawn the agent: ${cause.spawnError}`);
|
|
221
|
-
}
|
|
222
|
-
if (cause.exitError) {
|
|
223
|
-
lines.push(`Agent process emitted an error: ${cause.exitError}`);
|
|
224
|
-
}
|
|
225
|
-
if (cause.exitCode !== undefined && cause.exitCode !== null) {
|
|
226
|
-
// Distinguish clean-exit-without-handoff (likely a deliberate close by
|
|
227
|
-
// the user, or the agent ended its session without invoking the handoff
|
|
228
|
-
// step) from a non-zero crash, so the prompt body doesn't collapse them
|
|
229
|
-
// into the same uninformative "exited with code N" line.
|
|
230
|
-
lines.push(cause.exitCode === 0
|
|
231
|
-
? 'Agent exited cleanly (code 0) without writing a handoff.'
|
|
232
|
-
: `Agent exited with code ${cause.exitCode}.`);
|
|
233
|
-
}
|
|
234
|
-
if (cause.exitSignal) {
|
|
235
|
-
lines.push(`Agent was terminated by signal ${cause.exitSignal}.`);
|
|
236
|
-
}
|
|
237
|
-
// "No handoff file was written." is redundant when another cause line
|
|
238
|
-
// already implies it (spawn error, exit code/signal, process error).
|
|
239
|
-
// Independent diagnostics (read-error, parse-error, shape-mismatch) always
|
|
240
|
-
// surface — they're not implied by the exit shape.
|
|
241
|
-
const handoffMissingIsRedundant = !!cause.spawnError ||
|
|
242
|
-
!!cause.exitError ||
|
|
243
|
-
cause.exitCode !== undefined ||
|
|
244
|
-
cause.exitSignal !== undefined;
|
|
245
|
-
switch (cause.handoff?.reason) {
|
|
246
|
-
case 'missing':
|
|
247
|
-
if (!handoffMissingIsRedundant) {
|
|
248
|
-
lines.push('No handoff file was written.');
|
|
249
|
-
}
|
|
250
|
-
break;
|
|
251
|
-
case 'read-error':
|
|
252
|
-
lines.push(`Handoff file could not be read${cause.handoff.detail ? `: ${cause.handoff.detail}` : '.'}`);
|
|
253
|
-
break;
|
|
254
|
-
case 'parse-error':
|
|
255
|
-
lines.push(`Handoff file contained invalid JSON${cause.handoff.detail ? `: ${cause.handoff.detail}` : '.'}`);
|
|
256
|
-
break;
|
|
257
|
-
case 'shape-mismatch':
|
|
258
|
-
lines.push('Handoff file was missing required fields or had an unexpected shape.');
|
|
259
|
-
break;
|
|
260
|
-
}
|
|
261
|
-
return lines;
|
|
262
|
-
}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import type { Tree } from '../../generators/tree';
|
|
2
|
-
/**
|
|
3
|
-
* The deprecated releaseTag* flat properties were removed in Nx 23. Re-run the
|
|
4
|
-
* v22 consolidation for any workspaces that still have the legacy keys (e.g.,
|
|
5
|
-
* configs added manually after the v22 migration ran). Runs automatically as
|
|
6
|
-
* part of `nx migrate` and is also triggered by `nx repair` when the runtime
|
|
7
|
-
* detects legacy keys still present in `nx.json`.
|
|
8
|
-
*/
|
|
9
|
-
export default function (tree: Tree): Promise<void>;
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.default = default_1;
|
|
4
|
-
const tslib_1 = require("tslib");
|
|
5
|
-
const consolidate_release_tag_config_1 = tslib_1.__importDefault(require("../update-22-0-0/consolidate-release-tag-config"));
|
|
6
|
-
/**
|
|
7
|
-
* The deprecated releaseTag* flat properties were removed in Nx 23. Re-run the
|
|
8
|
-
* v22 consolidation for any workspaces that still have the legacy keys (e.g.,
|
|
9
|
-
* configs added manually after the v22 migration ran). Runs automatically as
|
|
10
|
-
* part of `nx migrate` and is also triggered by `nx repair` when the runtime
|
|
11
|
-
* detects legacy keys still present in `nx.json`.
|
|
12
|
-
*/
|
|
13
|
-
// TODO(v24): remove this migration (along with its registration in
|
|
14
|
-
// migrations.json) and the LEGACY_RELEASE_TAG_PATTERN_PROPERTIES_DETECTED
|
|
15
|
-
// runtime error path in packages/nx/src/command-line/release/config/config.ts.
|
|
16
|
-
async function default_1(tree) {
|
|
17
|
-
return (0, consolidate_release_tag_config_1.default)(tree);
|
|
18
|
-
}
|