@namzu/cli 12.1.0 → 14.0.0
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 +35 -2
- package/dist/cli.d.ts.map +1 -1
- package/dist/cli.js +119 -60
- package/dist/cli.js.map +1 -1
- package/dist/commands/acp.d.ts +24 -8
- package/dist/commands/acp.d.ts.map +1 -1
- package/dist/commands/acp.js +221 -80
- package/dist/commands/acp.js.map +1 -1
- package/dist/commands/drain.d.ts.map +1 -1
- package/dist/commands/drain.js +45 -9
- package/dist/commands/drain.js.map +1 -1
- package/dist/commands/login.d.ts +2 -0
- package/dist/commands/login.d.ts.map +1 -1
- package/dist/commands/login.js +79 -21
- package/dist/commands/login.js.map +1 -1
- package/dist/commands/prior-messages.d.ts +11 -0
- package/dist/commands/prior-messages.d.ts.map +1 -0
- package/dist/commands/prior-messages.js +280 -0
- package/dist/commands/prior-messages.js.map +1 -0
- package/dist/commands/resume.d.ts.map +1 -1
- package/dist/commands/resume.js +21 -19
- package/dist/commands/resume.js.map +1 -1
- package/dist/commands/run-stream.d.ts +5 -3
- package/dist/commands/run-stream.d.ts.map +1 -1
- package/dist/commands/run-stream.js +66 -62
- package/dist/commands/run-stream.js.map +1 -1
- package/dist/commands/run.d.ts.map +1 -1
- package/dist/commands/run.js +50 -37
- package/dist/commands/run.js.map +1 -1
- package/dist/config/debug.d.ts +55 -0
- package/dist/config/debug.d.ts.map +1 -0
- package/dist/config/debug.js +126 -0
- package/dist/config/debug.js.map +1 -0
- package/dist/config/load.d.ts +88 -4
- package/dist/config/load.d.ts.map +1 -1
- package/dist/config/load.js +386 -56
- package/dist/config/load.js.map +1 -1
- package/dist/config/schema.d.ts +87 -5
- package/dist/config/schema.d.ts.map +1 -1
- package/dist/config/schema.js +5 -5
- package/dist/config/schema.js.map +1 -1
- package/dist/config/trusted-project-context.d.ts +11 -0
- package/dist/config/trusted-project-context.d.ts.map +1 -0
- package/dist/config/trusted-project-context.js +28 -0
- package/dist/config/trusted-project-context.js.map +1 -0
- package/dist/context/project-path.d.ts +3 -0
- package/dist/context/project-path.d.ts.map +1 -0
- package/dist/context/project-path.js +16 -0
- package/dist/context/project-path.js.map +1 -0
- package/dist/context/project-tracker.d.ts +30 -0
- package/dist/context/project-tracker.d.ts.map +1 -0
- package/dist/context/project-tracker.js +217 -0
- package/dist/context/project-tracker.js.map +1 -0
- package/dist/context/sandbox.d.ts +29 -9
- package/dist/context/sandbox.d.ts.map +1 -1
- package/dist/context/sandbox.js +8 -0
- package/dist/context/sandbox.js.map +1 -1
- package/dist/doctor/checks/credentials.d.ts.map +1 -1
- package/dist/doctor/checks/credentials.js +7 -1
- package/dist/doctor/checks/credentials.js.map +1 -1
- package/dist/exit-codes.d.ts +5 -4
- package/dist/exit-codes.d.ts.map +1 -1
- package/dist/exit-codes.js +5 -4
- package/dist/exit-codes.js.map +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -2
- package/dist/index.js.map +1 -1
- package/dist/integrations/clipboard/text.d.ts +43 -0
- package/dist/integrations/clipboard/text.d.ts.map +1 -0
- package/dist/integrations/clipboard/text.js +43 -0
- package/dist/integrations/clipboard/text.js.map +1 -0
- package/dist/integrations/mcp/servers.d.ts +9 -0
- package/dist/integrations/mcp/servers.d.ts.map +1 -1
- package/dist/integrations/mcp/servers.js +11 -4
- package/dist/integrations/mcp/servers.js.map +1 -1
- package/dist/integrations/notifications/terminal.d.ts +32 -0
- package/dist/integrations/notifications/terminal.d.ts.map +1 -0
- package/dist/integrations/notifications/terminal.js +46 -0
- package/dist/integrations/notifications/terminal.js.map +1 -0
- package/dist/integrations/plugins/runtime.d.ts +17 -0
- package/dist/integrations/plugins/runtime.d.ts.map +1 -0
- package/dist/integrations/plugins/runtime.js +100 -0
- package/dist/integrations/plugins/runtime.js.map +1 -0
- package/dist/integrations/providers/codex-device-login.d.ts +27 -0
- package/dist/integrations/providers/codex-device-login.d.ts.map +1 -0
- package/dist/integrations/providers/codex-device-login.js +195 -0
- package/dist/integrations/providers/codex-device-login.js.map +1 -0
- package/dist/integrations/providers/codex-oauth.d.ts +10 -0
- package/dist/integrations/providers/codex-oauth.d.ts.map +1 -0
- package/dist/integrations/providers/codex-oauth.js +95 -0
- package/dist/integrations/providers/codex-oauth.js.map +1 -0
- package/dist/integrations/providers/credential-store.d.ts +40 -4
- package/dist/integrations/providers/credential-store.d.ts.map +1 -1
- package/dist/integrations/providers/credential-store.js +236 -18
- package/dist/integrations/providers/credential-store.js.map +1 -1
- package/dist/integrations/providers/discover.d.ts +25 -13
- package/dist/integrations/providers/discover.d.ts.map +1 -1
- package/dist/integrations/providers/discover.js +98 -44
- package/dist/integrations/providers/discover.js.map +1 -1
- package/dist/integrations/providers/harness-credentials.d.ts +36 -0
- package/dist/integrations/providers/harness-credentials.d.ts.map +1 -0
- package/dist/integrations/providers/harness-credentials.js +146 -0
- package/dist/integrations/providers/harness-credentials.js.map +1 -0
- package/dist/integrations/providers/identity.d.ts +8 -15
- package/dist/integrations/providers/identity.d.ts.map +1 -1
- package/dist/integrations/providers/identity.js +8 -15
- package/dist/integrations/providers/identity.js.map +1 -1
- package/dist/integrations/providers/index.d.ts +7 -4
- package/dist/integrations/providers/index.d.ts.map +1 -1
- package/dist/integrations/providers/index.js +6 -3
- package/dist/integrations/providers/index.js.map +1 -1
- package/dist/integrations/providers/keychain.d.ts +0 -13
- package/dist/integrations/providers/keychain.d.ts.map +1 -1
- package/dist/integrations/providers/keychain.js +0 -76
- package/dist/integrations/providers/keychain.js.map +1 -1
- package/dist/integrations/providers/oauth.d.ts +46 -17
- package/dist/integrations/providers/oauth.d.ts.map +1 -1
- package/dist/integrations/providers/oauth.js +175 -45
- package/dist/integrations/providers/oauth.js.map +1 -1
- package/dist/integrations/providers/register.d.ts.map +1 -1
- package/dist/integrations/providers/register.js +9 -1
- package/dist/integrations/providers/register.js.map +1 -1
- package/dist/integrations/providers/registry.d.ts +8 -1
- package/dist/integrations/providers/registry.d.ts.map +1 -1
- package/dist/integrations/providers/registry.js +29 -0
- package/dist/integrations/providers/registry.js.map +1 -1
- package/dist/integrations/providers/subscription-login.d.ts +2 -0
- package/dist/integrations/providers/subscription-login.d.ts.map +1 -1
- package/dist/integrations/providers/subscription-login.js +117 -14
- package/dist/integrations/providers/subscription-login.js.map +1 -1
- package/dist/integrations/sessions/store.d.ts +111 -1
- package/dist/integrations/sessions/store.d.ts.map +1 -1
- package/dist/integrations/sessions/store.js +400 -7
- package/dist/integrations/sessions/store.js.map +1 -1
- package/dist/integrations/sessions/transcript-export.d.ts +25 -0
- package/dist/integrations/sessions/transcript-export.d.ts.map +1 -0
- package/dist/integrations/sessions/transcript-export.js +441 -0
- package/dist/integrations/sessions/transcript-export.js.map +1 -0
- package/dist/integrations/sessions/turn-evidence.d.ts +138 -0
- package/dist/integrations/sessions/turn-evidence.d.ts.map +1 -0
- package/dist/integrations/sessions/turn-evidence.js +506 -0
- package/dist/integrations/sessions/turn-evidence.js.map +1 -0
- package/dist/integrations/subagents/runtime.d.ts +7 -12
- package/dist/integrations/subagents/runtime.d.ts.map +1 -1
- package/dist/integrations/subagents/runtime.js +19 -10
- package/dist/integrations/subagents/runtime.js.map +1 -1
- package/dist/integrations/trust/store.d.ts.map +1 -1
- package/dist/integrations/trust/store.js +27 -13
- package/dist/integrations/trust/store.js.map +1 -1
- package/dist/permissions/canonical-project.d.ts +9 -0
- package/dist/permissions/canonical-project.d.ts.map +1 -0
- package/dist/permissions/canonical-project.js +13 -0
- package/dist/permissions/canonical-project.js.map +1 -0
- package/dist/permissions/checks.d.ts +65 -0
- package/dist/permissions/checks.d.ts.map +1 -0
- package/dist/permissions/checks.js +122 -0
- package/dist/permissions/checks.js.map +1 -0
- package/dist/permissions/headless-trust.d.ts +9 -5
- package/dist/permissions/headless-trust.d.ts.map +1 -1
- package/dist/permissions/headless-trust.js +18 -4
- package/dist/permissions/headless-trust.js.map +1 -1
- package/dist/permissions/rules.d.ts +16 -7
- package/dist/permissions/rules.d.ts.map +1 -1
- package/dist/permissions/rules.js +78 -13
- package/dist/permissions/rules.js.map +1 -1
- package/dist/tui/App.d.ts +5 -2
- package/dist/tui/App.d.ts.map +1 -1
- package/dist/tui/App.js +1621 -196
- package/dist/tui/App.js.map +1 -1
- package/dist/tui/Composer.d.ts +14 -3
- package/dist/tui/Composer.d.ts.map +1 -1
- package/dist/tui/Composer.js +53 -15
- package/dist/tui/Composer.js.map +1 -1
- package/dist/tui/EditPromptPicker.d.ts +8 -0
- package/dist/tui/EditPromptPicker.d.ts.map +1 -0
- package/dist/tui/EditPromptPicker.js +18 -0
- package/dist/tui/EditPromptPicker.js.map +1 -0
- package/dist/tui/LiveActivity.d.ts.map +1 -1
- package/dist/tui/LiveActivity.js +2 -1
- package/dist/tui/LiveActivity.js.map +1 -1
- package/dist/tui/Markdown.d.ts.map +1 -1
- package/dist/tui/Markdown.js +2 -1
- package/dist/tui/Markdown.js.map +1 -1
- package/dist/tui/PermissionOverlay.d.ts.map +1 -1
- package/dist/tui/PermissionOverlay.js +7 -1
- package/dist/tui/PermissionOverlay.js.map +1 -1
- package/dist/tui/Picker.d.ts +8 -6
- package/dist/tui/Picker.d.ts.map +1 -1
- package/dist/tui/Picker.js +145 -18
- package/dist/tui/Picker.js.map +1 -1
- package/dist/tui/ResumePicker.d.ts.map +1 -1
- package/dist/tui/ResumePicker.js +1 -1
- package/dist/tui/ResumePicker.js.map +1 -1
- package/dist/tui/Transcript.d.ts +4 -2
- package/dist/tui/Transcript.d.ts.map +1 -1
- package/dist/tui/Transcript.js +31 -5
- package/dist/tui/Transcript.js.map +1 -1
- package/dist/tui/agent.d.ts +123 -19
- package/dist/tui/agent.d.ts.map +1 -1
- package/dist/tui/agent.js +757 -144
- package/dist/tui/agent.js.map +1 -1
- package/dist/tui/compact-transcript.d.ts +24 -0
- package/dist/tui/compact-transcript.d.ts.map +1 -0
- package/dist/tui/compact-transcript.js +46 -0
- package/dist/tui/compact-transcript.js.map +1 -0
- package/dist/tui/conversation-history.d.ts +33 -0
- package/dist/tui/conversation-history.d.ts.map +1 -0
- package/dist/tui/conversation-history.js +42 -0
- package/dist/tui/conversation-history.js.map +1 -0
- package/dist/tui/edit-prompts.d.ts +23 -0
- package/dist/tui/edit-prompts.d.ts.map +1 -0
- package/dist/tui/edit-prompts.js +35 -0
- package/dist/tui/edit-prompts.js.map +1 -0
- package/dist/tui/live-window.d.ts +3 -1
- package/dist/tui/live-window.d.ts.map +1 -1
- package/dist/tui/live-window.js +20 -8
- package/dist/tui/live-window.js.map +1 -1
- package/dist/tui/login-prompt.d.ts +5 -0
- package/dist/tui/login-prompt.d.ts.map +1 -1
- package/dist/tui/login-prompt.js +14 -0
- package/dist/tui/login-prompt.js.map +1 -1
- package/dist/tui/slashCommands.d.ts +178 -9
- package/dist/tui/slashCommands.d.ts.map +1 -1
- package/dist/tui/slashCommands.js +340 -16
- package/dist/tui/slashCommands.js.map +1 -1
- package/dist/tui/terminal-display.d.ts +12 -0
- package/dist/tui/terminal-display.d.ts.map +1 -0
- package/dist/tui/terminal-display.js +65 -0
- package/dist/tui/terminal-display.js.map +1 -0
- package/dist/tui/types.d.ts +14 -2
- package/dist/tui/types.d.ts.map +1 -1
- package/dist/tui/workspace-diff.d.ts +40 -0
- package/dist/tui/workspace-diff.d.ts.map +1 -0
- package/dist/tui/workspace-diff.js +101 -0
- package/dist/tui/workspace-diff.js.map +1 -0
- package/package.json +8 -8
package/README.md
CHANGED
|
@@ -6,7 +6,7 @@ description: >-
|
|
|
6
6
|
you get. Interactive sessions, headless runs that stream structured events,
|
|
7
7
|
and a doctor that reports what the host can actually do.
|
|
8
8
|
tags: [readme, package, cli, agent]
|
|
9
|
-
timestamp: 2026-08-
|
|
9
|
+
timestamp: 2026-08-22T00:00:00Z
|
|
10
10
|
status: active
|
|
11
11
|
diataxis: reference
|
|
12
12
|
-->
|
|
@@ -64,9 +64,36 @@ probes for.
|
|
|
64
64
|
```bash
|
|
65
65
|
namzu # interactive session in the current directory
|
|
66
66
|
namzu doctor # what this host can actually do, and what is missing
|
|
67
|
-
namzu login
|
|
67
|
+
namzu login claude # create a Namzu-owned Claude subscription session
|
|
68
|
+
namzu login codex # create a Namzu-owned ChatGPT subscription session
|
|
68
69
|
```
|
|
69
70
|
|
|
71
|
+
On startup, Namzu first reuses usable `Claude` and `Codex` sessions already owned
|
|
72
|
+
by their installed command-line clients. If both are available, the provider
|
|
73
|
+
picker asks which one to use. These borrowed credentials remain read-only and
|
|
74
|
+
are never copied into `~/.namzu`. A Namzu-owned sign-in is needed only when no
|
|
75
|
+
usable device session exists or when you explicitly want a separate login.
|
|
76
|
+
API keys remain optional alternatives through environment variables or the
|
|
77
|
+
session-only credential picker.
|
|
78
|
+
|
|
79
|
+
Repository policy stays live for the whole session. The CLI starts with the
|
|
80
|
+
applicable `AGENTS.md` chain, discovers nested instruction files after
|
|
81
|
+
successful reads, writes and edits, and labels every file with its directory
|
|
82
|
+
scope. The current snapshot is retained in durable model context, while a
|
|
83
|
+
resumed session uses its validated project-relative paths to re-read the files
|
|
84
|
+
from disk instead of trusting stale saved prose.
|
|
85
|
+
|
|
86
|
+
Executable SDK plugins are available but default off. Opt in from a config file
|
|
87
|
+
with `plugins.enabled: true`, then restrict discovery to `project`, `user`, or
|
|
88
|
+
both scopes. Project plugins are not read before the project trust gate, and
|
|
89
|
+
plugin paths are canonicalized against the trusted project or user-home root;
|
|
90
|
+
links that leave that scope and symlinked manifests are refused. Plugin
|
|
91
|
+
settings cannot be activated by an environment-selected profile. The
|
|
92
|
+
same plugin hooks and skills reach interactive turns, headless runs, durable
|
|
93
|
+
resumes, and ACP sessions; session shutdown settles live work before unloading
|
|
94
|
+
them. See the [operator configuration
|
|
95
|
+
reference](https://github.com/cogitave/namzu/blob/main/docs/cli/reference.md#plugins).
|
|
96
|
+
|
|
70
97
|
## Headless runs
|
|
71
98
|
|
|
72
99
|
```bash
|
|
@@ -79,6 +106,12 @@ run happens, so a script can act on a tool call before the run is over. Both
|
|
|
79
106
|
take `--verbose`/`--quiet`, and both write logs to stderr so stdout stays a
|
|
80
107
|
clean protocol stream.
|
|
81
108
|
|
|
109
|
+
The interactive transcript also shows provider capability mismatches and
|
|
110
|
+
tool-history repairs before the affected answer. A history warning reports the
|
|
111
|
+
source and measured rewrite counts without echoing tool content, and tells the
|
|
112
|
+
operator to verify external state before retrying a non-idempotent interrupted
|
|
113
|
+
call.
|
|
114
|
+
|
|
82
115
|
## Documentation
|
|
83
116
|
|
|
84
117
|
- [The operator application](https://github.com/cogitave/namzu/blob/main/docs/cli/reference.md) — every command, the configuration surface, headless event shapes
|
package/dist/cli.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cli.d.ts","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;
|
|
1
|
+
{"version":3,"file":"cli.d.ts","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AA8BH,OAAO,EAEN,KAAK,gBAAgB,EAKrB,MAAM,kBAAkB,CAAA;AACzB,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAA;AAuCxD,MAAM,WAAW,aAAa;IAC7B,iFAAiF;IACjF,QAAQ,CAAC,IAAI,EAAE,SAAS,MAAM,EAAE,CAAA;CAChC;AAQD,wBAAsB,MAAM,CAAC,IAAI,EAAE,aAAa,GAAG,OAAO,CAAC,MAAM,CAAC,CAgPjE;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,iBAAiB,CAAC,UAAU,EAAE,gBAAgB,EAAE,MAAM,EAAE,cAAc,GAAG,IAAI,CA4E5F"}
|
package/dist/cli.js
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
* this and exits with the returned code.
|
|
8
8
|
*/
|
|
9
9
|
import { readFileSync } from 'node:fs';
|
|
10
|
-
import { dirname, join } from 'node:path';
|
|
10
|
+
import { dirname, join, resolve } from 'node:path';
|
|
11
11
|
import { fileURLToPath } from 'node:url';
|
|
12
12
|
import { Command, CommanderError, Option } from 'commander';
|
|
13
13
|
import { BOOT_EVENT_NAMES, EVENT_NAME_ATTRIBUTE, VERSION as SDK_VERSION } from '@namzu/sdk';
|
|
@@ -20,7 +20,9 @@ import { registerAll } from './commands/registry.js';
|
|
|
20
20
|
import { historyCommand, providersJSONCommand, runStreamCommand, skillsJSONCommand, } from './commands/run-stream.js';
|
|
21
21
|
import { runCommand } from './commands/run.js';
|
|
22
22
|
import { stubCommands } from './commands/stubs.js';
|
|
23
|
-
import {
|
|
23
|
+
import { createConfigDebugSnapshot, formatConfigSource, } from './config/debug.js';
|
|
24
|
+
import { ConfigLoadError, ConfigValueError, loadBootstrapConfigWithProvenance, loadConfigWithProvenance, } from './config/load.js';
|
|
25
|
+
import { bindTrustedProjectContext, resolveTrustedProjectContext, } from './config/trusted-project-context.js';
|
|
24
26
|
import { EXIT_BAD_CONFIG, EXIT_INTERNAL_ERROR } from './exit-codes.js';
|
|
25
27
|
import { cliLogger, createStderrSink, installCliLogging, resolveLogFormat, resolveLogLevel, } from './logging.js';
|
|
26
28
|
import { createFormatter, isFormatName } from './output/index.js';
|
|
@@ -52,27 +54,49 @@ export async function runCli(opts) {
|
|
|
52
54
|
.name('namzu')
|
|
53
55
|
.description('Operator CLI for the Namzu agent platform')
|
|
54
56
|
.version(CLI_VERSION, '-V, --version', 'Print version and exit')
|
|
55
|
-
.
|
|
57
|
+
.addOption(new Option('-f, --format <type>', 'Output format: text, json, yaml').choices([
|
|
58
|
+
'text',
|
|
59
|
+
'json',
|
|
60
|
+
'yaml',
|
|
61
|
+
]))
|
|
56
62
|
.option('-q, --quiet', 'Suppress non-essential output; also raises the log floor to warn')
|
|
57
63
|
.addOption(new Option('-v, --verbose', 'Emit debug-level log records to stderr').conflicts('quiet'))
|
|
58
64
|
.addOption(new Option('--log-format <format>', 'Log record format for run/drain/TUI-flush output: pretty (default) or json. namzu run-stream always writes json, regardless of this flag.').choices(['pretty', 'json']))
|
|
59
65
|
.option('--dangerously-skip-permissions', 'Run tools without asking for approval (no permission prompts). Only use in a sandbox or a folder you fully trust.')
|
|
60
66
|
.option('--yolo', 'Alias of --dangerously-skip-permissions.')
|
|
67
|
+
.option('--profile <name>', 'Apply a named profile from the config files. A name no file declares is refused, not ignored.')
|
|
61
68
|
// Required by Commander 14 so subcommands (doctor) can opt into
|
|
62
69
|
// passThroughOptions for unparsed argument forwarding.
|
|
63
70
|
.enablePositionalOptions(true)
|
|
64
71
|
.exitOverride()
|
|
65
72
|
.showHelpAfterError(false);
|
|
66
|
-
|
|
67
|
-
const getContext = () => {
|
|
68
|
-
if (ctx)
|
|
69
|
-
return ctx;
|
|
73
|
+
const buildContext = (load) => {
|
|
70
74
|
const globalOpts = program.opts();
|
|
71
|
-
const { config: fileConfig, provenance } =
|
|
72
|
-
const
|
|
73
|
-
|
|
74
|
-
|
|
75
|
+
const { config: fileConfig, provenance } = load();
|
|
76
|
+
const cliFormat = (() => {
|
|
77
|
+
if (globalOpts.format === undefined)
|
|
78
|
+
return undefined;
|
|
79
|
+
if (isFormatName(globalOpts.format))
|
|
80
|
+
return globalOpts.format;
|
|
81
|
+
// Commander's enumerated option owns the operator-facing refusal. This
|
|
82
|
+
// branch is an invariant check so removing `.choices(...)` cannot bring
|
|
83
|
+
// back the old silent fallback.
|
|
84
|
+
throw new Error(`Commander admitted an invalid --format value: ${globalOpts.format}`);
|
|
85
|
+
})();
|
|
86
|
+
const formatFromCli = cliFormat !== undefined;
|
|
87
|
+
const format = cliFormat ?? fileConfig.format ?? 'text';
|
|
75
88
|
const quiet = globalOpts.quiet ?? fileConfig.quiet ?? false;
|
|
89
|
+
const envProfile = process.env.NAMZU_PROFILE;
|
|
90
|
+
const selectedProfile = globalOpts.profile !== undefined && globalOpts.profile !== ''
|
|
91
|
+
? { name: globalOpts.profile, selectedBy: '--profile' }
|
|
92
|
+
: globalOpts.profile === undefined && envProfile !== undefined && envProfile !== ''
|
|
93
|
+
? { name: envProfile, selectedBy: 'NAMZU_PROFILE' }
|
|
94
|
+
: undefined;
|
|
95
|
+
const configDebug = createConfigDebugSnapshot(provenance, {
|
|
96
|
+
formatFromCli,
|
|
97
|
+
quietFromCli: globalOpts.quiet !== undefined,
|
|
98
|
+
...(selectedProfile ? { selectedProfile } : {}),
|
|
99
|
+
});
|
|
76
100
|
// Resolved from the ACTUAL parsed flags, not `quiet` above — that value
|
|
77
101
|
// already folds in NAMZU_QUIET and a config file's `quiet: true`.
|
|
78
102
|
// "Flag beats env" (LOG-05) means the literal --verbose/--quiet on THIS
|
|
@@ -80,30 +104,56 @@ export async function runCli(opts) {
|
|
|
80
104
|
// can produce `quiet: true` would let NAMZU_QUIET silently override an
|
|
81
105
|
// operator's own NAMZU_LOG_LEVEL, which neither variable promises.
|
|
82
106
|
const logging = {
|
|
83
|
-
level: resolveLogLevel({
|
|
107
|
+
level: resolveLogLevel({
|
|
108
|
+
verbose: globalOpts.verbose,
|
|
109
|
+
quiet: globalOpts.quiet,
|
|
110
|
+
}),
|
|
84
111
|
format: resolveLogFormat({ logFormat: globalOpts.logFormat }),
|
|
85
112
|
};
|
|
86
|
-
|
|
87
|
-
// invocation has resolved a level/format — rather than left for
|
|
88
|
-
// whichever subcommand happens to reach `createAgentSession`. `doctor`
|
|
89
|
-
// and `login` never call that function at all; without this line, a
|
|
90
|
-
// debug-level `namzu.config.resolved` row would be unreachable under
|
|
91
|
-
// `--verbose` for either of them. `{ replace: true }` for the same
|
|
92
|
-
// reason every other call site takes it (`commands/run.ts`): a
|
|
93
|
-
// subcommand installs its OWN sink moments later, computed from the
|
|
94
|
-
// SAME `logging` this line just resolved, or a deliberately different
|
|
95
|
-
// one (the TUI's ring buffer) — never a second party fighting this one
|
|
96
|
-
// for the destination.
|
|
97
|
-
installCliLogging(createStderrSink(logging.format), logging.level);
|
|
98
|
-
emitBootNarrative(provenance, fileConfig);
|
|
99
|
-
ctx = {
|
|
113
|
+
return {
|
|
100
114
|
formatter: createFormatter(format, { quiet }),
|
|
101
115
|
config: { ...fileConfig, format, quiet },
|
|
116
|
+
configDebug,
|
|
102
117
|
logging,
|
|
103
118
|
};
|
|
104
|
-
return ctx;
|
|
105
119
|
};
|
|
106
|
-
|
|
120
|
+
const selectedConfigOpts = (cwd) => {
|
|
121
|
+
const profile = program.opts().profile;
|
|
122
|
+
return {
|
|
123
|
+
...(profile !== undefined ? { profile } : {}),
|
|
124
|
+
...(cwd !== undefined ? { cwd } : {}),
|
|
125
|
+
};
|
|
126
|
+
};
|
|
127
|
+
let bootstrapCtx = null;
|
|
128
|
+
const trustedContexts = new Map();
|
|
129
|
+
const getTrustedContext = (cwd) => {
|
|
130
|
+
const target = resolve(cwd);
|
|
131
|
+
const cached = trustedContexts.get(target);
|
|
132
|
+
if (cached)
|
|
133
|
+
return cached;
|
|
134
|
+
const loaded = loadConfigWithProvenance(selectedConfigOpts(target));
|
|
135
|
+
const trusted = buildContext(() => loaded);
|
|
136
|
+
emitBootNarrative(loaded.provenance, loaded.config);
|
|
137
|
+
trustedContexts.set(target, trusted);
|
|
138
|
+
return trusted;
|
|
139
|
+
};
|
|
140
|
+
const getBootstrapContext = () => {
|
|
141
|
+
if (bootstrapCtx)
|
|
142
|
+
return bootstrapCtx;
|
|
143
|
+
const loaded = loadBootstrapConfigWithProvenance(selectedConfigOpts());
|
|
144
|
+
const bootstrap = buildContext(() => loaded);
|
|
145
|
+
// Claim stderr before any handler can log. A later TUI launch replaces
|
|
146
|
+
// this with its ring sink; trusted project activation deliberately does
|
|
147
|
+
// not replace that owner.
|
|
148
|
+
installCliLogging(createStderrSink(bootstrap.logging.format), bootstrap.logging.level);
|
|
149
|
+
bootstrapCtx = bindTrustedProjectContext(bootstrap, getTrustedContext);
|
|
150
|
+
return bootstrapCtx;
|
|
151
|
+
};
|
|
152
|
+
const getContext = () => {
|
|
153
|
+
getBootstrapContext();
|
|
154
|
+
return getTrustedContext(process.cwd());
|
|
155
|
+
};
|
|
156
|
+
for (const def of [
|
|
107
157
|
acpCommand,
|
|
108
158
|
doctorCommand,
|
|
109
159
|
runCommand,
|
|
@@ -116,10 +166,14 @@ export async function runCli(opts) {
|
|
|
116
166
|
skillsJSONCommand,
|
|
117
167
|
providersJSONCommand,
|
|
118
168
|
...stubCommands,
|
|
119
|
-
]
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
169
|
+
]) {
|
|
170
|
+
registerAll(program, [def], {
|
|
171
|
+
getContext: def === acpCommand || def === runCommand || def === runStreamCommand || def === drainCommand
|
|
172
|
+
? getBootstrapContext
|
|
173
|
+
: getContext,
|
|
174
|
+
setExitCode,
|
|
175
|
+
});
|
|
176
|
+
}
|
|
123
177
|
// Default behavior when `namzu` is invoked with no subcommand: launch
|
|
124
178
|
// the TUI (M3). When stdout is not a TTY (tests, pipes, CI), print a
|
|
125
179
|
// one-line marker instead so the binary stays scriptable and our test
|
|
@@ -131,22 +185,30 @@ export async function runCli(opts) {
|
|
|
131
185
|
// The same three lines `run` and `run-stream` use. The TUI compiled
|
|
132
186
|
// nothing at all, so a `permissions` table in a config file did nothing
|
|
133
187
|
// in the mode most people actually use.
|
|
134
|
-
const
|
|
135
|
-
const
|
|
136
|
-
|
|
137
|
-
const
|
|
138
|
-
|
|
139
|
-
|
|
188
|
+
const commandCtx = getBootstrapContext();
|
|
189
|
+
const buildTuiContext = (resolvedCtx, cwd) => {
|
|
190
|
+
const permissions = compilePermissions(resolvedCtx.config.permissions, resolvedCtx.config.permissionChecks);
|
|
191
|
+
for (const d of permissions.diagnostics) {
|
|
192
|
+
const where = d.pattern ? `permissions.${d.tool}."${d.pattern}"` : `permissions.${d.tool}`;
|
|
193
|
+
resolvedCtx.formatter.error({ message: `${where}: ${d.message}` });
|
|
194
|
+
}
|
|
195
|
+
return {
|
|
196
|
+
cwd,
|
|
197
|
+
version: CLI_VERSION,
|
|
198
|
+
configDebug: resolvedCtx.configDebug,
|
|
199
|
+
skipPermissions,
|
|
200
|
+
rules: permissions.rules,
|
|
201
|
+
logging: resolvedCtx.logging,
|
|
202
|
+
...(resolvedCtx.config.mcpServers ? { mcpServers: resolvedCtx.config.mcpServers } : {}),
|
|
203
|
+
...(resolvedCtx.config.plugins ? { plugins: resolvedCtx.config.plugins } : {}),
|
|
204
|
+
...(resolvedCtx.config.sandbox ? { sandbox: resolvedCtx.config.sandbox } : {}),
|
|
205
|
+
...(resolvedCtx.config.tui ? { tui: resolvedCtx.config.tui } : {}),
|
|
206
|
+
};
|
|
207
|
+
};
|
|
208
|
+
const tuiCtx = buildTuiContext(commandCtx, process.cwd());
|
|
209
|
+
bindTrustedProjectContext(tuiCtx, (cwd) => buildTuiContext(resolveTrustedProjectContext(commandCtx, cwd), cwd));
|
|
140
210
|
const { launchTui } = await import('./tui/index.js');
|
|
141
|
-
await launchTui(
|
|
142
|
-
cwd: process.cwd(),
|
|
143
|
-
version: CLI_VERSION,
|
|
144
|
-
skipPermissions,
|
|
145
|
-
rules: permissions.rules,
|
|
146
|
-
logging: tuiCtx.logging,
|
|
147
|
-
...(tuiCtx.config.mcpServers ? { mcpServers: tuiCtx.config.mcpServers } : {}),
|
|
148
|
-
...(tuiCtx.config.sandbox ? { sandbox: tuiCtx.config.sandbox } : {}),
|
|
149
|
-
});
|
|
211
|
+
await launchTui(tuiCtx);
|
|
150
212
|
const code = await Promise.resolve(0);
|
|
151
213
|
setExitCode(code);
|
|
152
214
|
return;
|
|
@@ -168,6 +230,13 @@ export async function runCli(opts) {
|
|
|
168
230
|
process.stderr.write(`${err.message}\nnamzu will not start with a config it cannot read. Fix the file or remove it.\n`);
|
|
169
231
|
return EXIT_BAD_CONFIG;
|
|
170
232
|
}
|
|
233
|
+
if (err instanceof ConfigValueError) {
|
|
234
|
+
const remediation = err.source.kind === 'file'
|
|
235
|
+
? 'Fix the named setting or remove it from that file.'
|
|
236
|
+
: `Fix or unset ${err.source.variable}.`;
|
|
237
|
+
process.stderr.write(`${err.message}\nnamzu will not start with an explicit config value it cannot honour. ${remediation}\n`);
|
|
238
|
+
return EXIT_BAD_CONFIG;
|
|
239
|
+
}
|
|
171
240
|
process.stderr.write(`Fatal: ${err instanceof Error ? (err.stack ?? err.message) : String(err)}\n`);
|
|
172
241
|
return EXIT_INTERNAL_ERROR;
|
|
173
242
|
}
|
|
@@ -197,7 +266,9 @@ export function emitBootNarrative(provenance, config) {
|
|
|
197
266
|
default: 0,
|
|
198
267
|
'user-file': 0,
|
|
199
268
|
'project-file': 0,
|
|
269
|
+
profile: 0,
|
|
200
270
|
env: 0,
|
|
271
|
+
managed: 0,
|
|
201
272
|
};
|
|
202
273
|
for (const source of Object.values(provenance)) {
|
|
203
274
|
if (source)
|
|
@@ -229,7 +300,7 @@ export function emitBootNarrative(provenance, config) {
|
|
|
229
300
|
[EVENT_NAME_ATTRIBUTE]: BOOT_EVENT_NAMES.CONFIG_RESOLVED,
|
|
230
301
|
'namzu.config.key': key,
|
|
231
302
|
'namzu.config.value': JSON.stringify(config[key]),
|
|
232
|
-
'namzu.config.source':
|
|
303
|
+
'namzu.config.source': formatConfigSource(source),
|
|
233
304
|
});
|
|
234
305
|
}
|
|
235
306
|
// The CLI never calls `registerTelemetry()` on any path today — this is
|
|
@@ -256,18 +327,6 @@ export function emitBootNarrative(provenance, config) {
|
|
|
256
327
|
'namzu.telemetry.session_export': config.telemetry?.sessionExport !== undefined,
|
|
257
328
|
});
|
|
258
329
|
}
|
|
259
|
-
function describeConfigSource(source) {
|
|
260
|
-
switch (source.kind) {
|
|
261
|
-
case 'default':
|
|
262
|
-
return 'default';
|
|
263
|
-
case 'user-file':
|
|
264
|
-
return `user-file ${source.path}`;
|
|
265
|
-
case 'project-file':
|
|
266
|
-
return `project-file ${source.path}`;
|
|
267
|
-
case 'env':
|
|
268
|
-
return `env ${source.variable}`;
|
|
269
|
-
}
|
|
270
|
-
}
|
|
271
330
|
function mapCommanderError(err) {
|
|
272
331
|
switch (err.code) {
|
|
273
332
|
case 'commander.helpDisplayed':
|
package/dist/cli.js.map
CHANGED
|
@@ -1 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E,oEAAoE;QACpE,cAAc;QACd,EAAE;QACF,uEAAuE;QACvE,kEAAkE;QAClE,mEAAmE;QACnE,kEAAkE;QAClE,sEAAsE;QACtE,qEAAqE;QACrE,gCAAgC,EAAE,MAAM,CAAC,SAAS,EAAE,aAAa,KAAK,SAAS;KAC/E,CACD,CAAA;AACF,CAAC;AAED,SAAS,iBAAiB,CAAC,GAAmB;IAC7C,QAAQ,GAAG,CAAC,IAAI,EAAE,CAAC;QAClB,KAAK,yBAAyB,CAAC;QAC/B,KAAK,gBAAgB,CAAC;QACtB,KAAK,mBAAmB;YACvB,OAAO,CAAC,CAAA;QACT,KAAK,0BAA0B,CAAC;QAChC,KAAK,yBAAyB,CAAC;QAC/B,KAAK,2BAA2B,CAAC;QACjC,KAAK,uCAAuC,CAAC;QAC7C,KAAK,2BAA2B,CAAC;QACjC,KAAK,iCAAiC,CAAC;QACvC,KAAK,2BAA2B,CAAC;QACjC,KAAK,6BAA6B;YACjC,OAAO,QAAQ,CAAA;QAChB;YACC,OAAO,mBAAmB,CAAA;IAC5B,CAAC;AACF,CAAC"}
|
package/dist/commands/acp.d.ts
CHANGED
|
@@ -1,4 +1,9 @@
|
|
|
1
|
-
import type
|
|
1
|
+
import { type AcpAgentGateway } from '@namzu/sdk';
|
|
2
|
+
import { resolveTrustedProjectContext } from '../config/trusted-project-context.js';
|
|
3
|
+
import type { DetectedProvider, Preferences } from '../integrations/providers/index.js';
|
|
4
|
+
import { decideHeadlessTrust } from '../permissions/headless-trust.js';
|
|
5
|
+
import { type AgentSession, createAgentSession, probeAgentSession } from '../tui/agent.js';
|
|
6
|
+
import type { CommandContext, CommandDef } from './types.js';
|
|
2
7
|
/**
|
|
3
8
|
* `namzu acp` — the agent-client protocol over this process's stdio.
|
|
4
9
|
*
|
|
@@ -15,15 +20,26 @@ import type { CommandDef } from './types.js';
|
|
|
15
20
|
* file must not do is `console.log`, and a test asserts zero non-JSON bytes
|
|
16
21
|
* on the child's stdout under info-level logging.
|
|
17
22
|
*/
|
|
23
|
+
type AcpLiveSession = Pick<AgentSession, 'hasProvider' | 'errorHint' | 'mcpFailed' | 'send' | 'close'>;
|
|
24
|
+
export interface AcpRuntimeDependencies {
|
|
25
|
+
readonly probe: typeof probeAgentSession;
|
|
26
|
+
readonly createSession: (preferences: Preferences, detected: readonly DetectedProvider[], options: Parameters<typeof createAgentSession>[2]) => Promise<AcpLiveSession>;
|
|
27
|
+
readonly decideTrust: typeof decideHeadlessTrust;
|
|
28
|
+
readonly resolveProjectContext: typeof resolveTrustedProjectContext;
|
|
29
|
+
}
|
|
30
|
+
export interface CliAcpRuntime {
|
|
31
|
+
readonly gateway: AcpAgentGateway;
|
|
32
|
+
close(): Promise<void>;
|
|
33
|
+
}
|
|
18
34
|
/**
|
|
19
|
-
*
|
|
35
|
+
* Owns the CLI runtime behind one ACP connection.
|
|
20
36
|
*
|
|
21
|
-
*
|
|
22
|
-
*
|
|
23
|
-
* session
|
|
24
|
-
* result, a background job settling — reaches no client, which is correct:
|
|
25
|
-
* there is no prompt for it to belong to.
|
|
37
|
+
* The wire server owns IDs, cwd, cancellation and history. This owner mirrors
|
|
38
|
+
* that boundary into the model runtime: one AgentSession and event route per
|
|
39
|
+
* wire session, never one mutable connection-global slot.
|
|
26
40
|
*/
|
|
27
|
-
export declare function
|
|
41
|
+
export declare function createCliAcpRuntime(bootstrapCtx: CommandContext, deps?: AcpRuntimeDependencies): CliAcpRuntime;
|
|
42
|
+
export declare function runAcpCommand(ctx: CommandContext): Promise<number>;
|
|
28
43
|
export declare const acpCommand: CommandDef;
|
|
44
|
+
export {};
|
|
29
45
|
//# sourceMappingURL=acp.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"acp.d.ts","sourceRoot":"","sources":["../../src/commands/acp.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"acp.d.ts","sourceRoot":"","sources":["../../src/commands/acp.ts"],"names":[],"mappings":"AAAA,OAAO,EAEN,KAAK,eAAe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