@nathapp/nax 0.42.7 → 0.42.8
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/nax.js +28 -7
- package/package.json +1 -1
- package/src/agents/acp/adapter.ts +5 -0
- package/src/agents/acp/spawn-client.ts +5 -0
- package/src/cli/plan.ts +15 -4
package/dist/nax.js
CHANGED
|
@@ -18992,6 +18992,11 @@ class SpawnAcpSession {
|
|
|
18992
18992
|
"--file",
|
|
18993
18993
|
"-"
|
|
18994
18994
|
];
|
|
18995
|
+
getSafeLogger()?.info("acp-adapter", "Sending prompt", {
|
|
18996
|
+
session: this.sessionName,
|
|
18997
|
+
permission: this.permissionMode,
|
|
18998
|
+
cmd: cmd.join(" ")
|
|
18999
|
+
});
|
|
18995
19000
|
getSafeLogger()?.debug("acp-adapter", `Sending prompt to session: ${this.sessionName}`);
|
|
18996
19001
|
const proc = _spawnClientDeps.spawn(cmd, {
|
|
18997
19002
|
cwd: this.cwd,
|
|
@@ -19405,6 +19410,11 @@ class AcpAgentAdapter {
|
|
|
19405
19410
|
}
|
|
19406
19411
|
sessionName ??= buildSessionName(options.workdir, options.featureName, options.storyId, options.sessionRole);
|
|
19407
19412
|
const permissionMode = options.dangerouslySkipPermissions ? "approve-all" : "approve-reads";
|
|
19413
|
+
getSafeLogger()?.info("acp-adapter", "Permission mode resolved", {
|
|
19414
|
+
permission: permissionMode,
|
|
19415
|
+
dangerouslySkipPermissions: options.dangerouslySkipPermissions ?? false,
|
|
19416
|
+
stage: options.featureName ? "run" : "plan"
|
|
19417
|
+
});
|
|
19408
19418
|
const session = await ensureAcpSession(client, sessionName, this.name, permissionMode);
|
|
19409
19419
|
if (options.featureName && options.storyId) {
|
|
19410
19420
|
await saveAcpSession(options.workdir, options.featureName, options.storyId, sessionName);
|
|
@@ -21914,7 +21924,7 @@ var package_default;
|
|
|
21914
21924
|
var init_package = __esm(() => {
|
|
21915
21925
|
package_default = {
|
|
21916
21926
|
name: "@nathapp/nax",
|
|
21917
|
-
version: "0.42.
|
|
21927
|
+
version: "0.42.8",
|
|
21918
21928
|
description: "AI Coding Agent Orchestrator \u2014 loops until done",
|
|
21919
21929
|
type: "module",
|
|
21920
21930
|
bin: {
|
|
@@ -21987,8 +21997,8 @@ var init_version = __esm(() => {
|
|
|
21987
21997
|
NAX_VERSION = package_default.version;
|
|
21988
21998
|
NAX_COMMIT = (() => {
|
|
21989
21999
|
try {
|
|
21990
|
-
if (/^[0-9a-f]{6,10}$/.test("
|
|
21991
|
-
return "
|
|
22000
|
+
if (/^[0-9a-f]{6,10}$/.test("5dc5b37"))
|
|
22001
|
+
return "5dc5b37";
|
|
21992
22002
|
} catch {}
|
|
21993
22003
|
try {
|
|
21994
22004
|
const result = Bun.spawnSync(["git", "rev-parse", "--short", "HEAD"], {
|
|
@@ -65849,7 +65859,18 @@ async function planCommand(workdir, config2, options) {
|
|
|
65849
65859
|
throw new Error(`[plan] No agent adapter found for '${agentName}'`);
|
|
65850
65860
|
const interactionBridge = createCliInteractionBridge();
|
|
65851
65861
|
const pidRegistry = new PidRegistry(workdir);
|
|
65852
|
-
|
|
65862
|
+
const dangerouslySkipPermissions = config2?.execution?.dangerouslySkipPermissions ?? false;
|
|
65863
|
+
const permissionMode = dangerouslySkipPermissions ? "approve-all" : "approve-reads";
|
|
65864
|
+
const resolvedModel = config2?.plan?.model ?? "balanced";
|
|
65865
|
+
logger?.info("plan", "Starting interactive planning session", {
|
|
65866
|
+
agent: agentName,
|
|
65867
|
+
model: resolvedModel,
|
|
65868
|
+
permission: permissionMode,
|
|
65869
|
+
workdir,
|
|
65870
|
+
feature: options.feature,
|
|
65871
|
+
timeoutSeconds
|
|
65872
|
+
});
|
|
65873
|
+
const planStartTime = Date.now();
|
|
65853
65874
|
try {
|
|
65854
65875
|
await adapter.plan({
|
|
65855
65876
|
prompt,
|
|
@@ -65858,15 +65879,15 @@ async function planCommand(workdir, config2, options) {
|
|
|
65858
65879
|
timeoutSeconds,
|
|
65859
65880
|
interactionBridge,
|
|
65860
65881
|
config: config2,
|
|
65861
|
-
modelTier:
|
|
65862
|
-
dangerouslySkipPermissions
|
|
65882
|
+
modelTier: resolvedModel,
|
|
65883
|
+
dangerouslySkipPermissions,
|
|
65863
65884
|
maxInteractionTurns: config2?.agent?.maxInteractionTurns,
|
|
65864
65885
|
featureName: options.feature,
|
|
65865
65886
|
pidRegistry
|
|
65866
65887
|
});
|
|
65867
65888
|
} finally {
|
|
65868
65889
|
await pidRegistry.killAll().catch(() => {});
|
|
65869
|
-
logger?.info("plan", "Interactive session ended");
|
|
65890
|
+
logger?.info("plan", "Interactive session ended", { durationMs: Date.now() - planStartTime });
|
|
65870
65891
|
}
|
|
65871
65892
|
if (!_deps2.existsSync(outputPath)) {
|
|
65872
65893
|
throw new Error(`[plan] Agent did not write PRD to ${outputPath}. Check agent logs for errors.`);
|
package/package.json
CHANGED
|
@@ -453,6 +453,11 @@ export class AcpAgentAdapter implements AgentAdapter {
|
|
|
453
453
|
|
|
454
454
|
// 2. Permission mode follows dangerouslySkipPermissions, default is "approve-reads". or should --deny-all be the default?
|
|
455
455
|
const permissionMode = options.dangerouslySkipPermissions ? "approve-all" : "approve-reads";
|
|
456
|
+
getSafeLogger()?.info("acp-adapter", "Permission mode resolved", {
|
|
457
|
+
permission: permissionMode,
|
|
458
|
+
dangerouslySkipPermissions: options.dangerouslySkipPermissions ?? false,
|
|
459
|
+
stage: options.featureName ? "run" : "plan",
|
|
460
|
+
});
|
|
456
461
|
|
|
457
462
|
// 3. Ensure session (resume existing or create new)
|
|
458
463
|
const session = await ensureAcpSession(client, sessionName, this.name, permissionMode);
|
|
@@ -138,6 +138,11 @@ class SpawnAcpSession implements AcpSession {
|
|
|
138
138
|
"-",
|
|
139
139
|
];
|
|
140
140
|
|
|
141
|
+
getSafeLogger()?.info("acp-adapter", "Sending prompt", {
|
|
142
|
+
session: this.sessionName,
|
|
143
|
+
permission: this.permissionMode,
|
|
144
|
+
cmd: cmd.join(" "),
|
|
145
|
+
});
|
|
141
146
|
getSafeLogger()?.debug("acp-adapter", `Sending prompt to session: ${this.sessionName}`);
|
|
142
147
|
|
|
143
148
|
const proc = _spawnClientDeps.spawn(cmd, {
|
package/src/cli/plan.ts
CHANGED
|
@@ -125,7 +125,18 @@ export async function planCommand(workdir: string, config: NaxConfig, options: P
|
|
|
125
125
|
if (!adapter) throw new Error(`[plan] No agent adapter found for '${agentName}'`);
|
|
126
126
|
const interactionBridge = createCliInteractionBridge();
|
|
127
127
|
const pidRegistry = new PidRegistry(workdir);
|
|
128
|
-
|
|
128
|
+
const dangerouslySkipPermissions = config?.execution?.dangerouslySkipPermissions ?? false;
|
|
129
|
+
const permissionMode = dangerouslySkipPermissions ? "approve-all" : "approve-reads";
|
|
130
|
+
const resolvedModel = config?.plan?.model ?? "balanced";
|
|
131
|
+
logger?.info("plan", "Starting interactive planning session", {
|
|
132
|
+
agent: agentName,
|
|
133
|
+
model: resolvedModel,
|
|
134
|
+
permission: permissionMode,
|
|
135
|
+
workdir,
|
|
136
|
+
feature: options.feature,
|
|
137
|
+
timeoutSeconds,
|
|
138
|
+
});
|
|
139
|
+
const planStartTime = Date.now();
|
|
129
140
|
try {
|
|
130
141
|
await adapter.plan({
|
|
131
142
|
prompt,
|
|
@@ -134,15 +145,15 @@ export async function planCommand(workdir: string, config: NaxConfig, options: P
|
|
|
134
145
|
timeoutSeconds,
|
|
135
146
|
interactionBridge,
|
|
136
147
|
config,
|
|
137
|
-
modelTier:
|
|
138
|
-
dangerouslySkipPermissions
|
|
148
|
+
modelTier: resolvedModel,
|
|
149
|
+
dangerouslySkipPermissions,
|
|
139
150
|
maxInteractionTurns: config?.agent?.maxInteractionTurns,
|
|
140
151
|
featureName: options.feature,
|
|
141
152
|
pidRegistry,
|
|
142
153
|
});
|
|
143
154
|
} finally {
|
|
144
155
|
await pidRegistry.killAll().catch(() => {});
|
|
145
|
-
logger?.info("plan", "Interactive session ended");
|
|
156
|
+
logger?.info("plan", "Interactive session ended", { durationMs: Date.now() - planStartTime });
|
|
146
157
|
}
|
|
147
158
|
// Read back from file written by agent
|
|
148
159
|
if (!_deps.existsSync(outputPath)) {
|