@namzu/cli 2.0.0 → 2.1.1

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.
Files changed (176) hide show
  1. package/dist/tui/App.d.ts.map +1 -1
  2. package/dist/tui/App.js +8 -0
  3. package/dist/tui/App.js.map +1 -1
  4. package/dist/tui/agent.d.ts +10 -0
  5. package/dist/tui/agent.d.ts.map +1 -1
  6. package/dist/tui/agent.js +10 -0
  7. package/dist/tui/agent.js.map +1 -1
  8. package/dist/tui/slashCommands.d.ts +46 -0
  9. package/dist/tui/slashCommands.d.ts.map +1 -1
  10. package/dist/tui/slashCommands.js +96 -0
  11. package/dist/tui/slashCommands.js.map +1 -1
  12. package/package.json +11 -6
  13. package/dist/__tests__/environment-reaches-the-turn.test.d.ts +0 -17
  14. package/dist/__tests__/environment-reaches-the-turn.test.d.ts.map +0 -1
  15. package/dist/__tests__/environment-reaches-the-turn.test.js +0 -128
  16. package/dist/__tests__/environment-reaches-the-turn.test.js.map +0 -1
  17. package/dist/__tests__/headless-trust-gate.test.d.ts +0 -23
  18. package/dist/__tests__/headless-trust-gate.test.d.ts.map +0 -1
  19. package/dist/__tests__/headless-trust-gate.test.js +0 -227
  20. package/dist/__tests__/headless-trust-gate.test.js.map +0 -1
  21. package/dist/__tests__/mcp-servers-reach-the-session.test.d.ts +0 -17
  22. package/dist/__tests__/mcp-servers-reach-the-session.test.d.ts.map +0 -1
  23. package/dist/__tests__/mcp-servers-reach-the-session.test.js +0 -171
  24. package/dist/__tests__/mcp-servers-reach-the-session.test.js.map +0 -1
  25. package/dist/__tests__/permission-rules-reach-the-turn.test.d.ts +0 -31
  26. package/dist/__tests__/permission-rules-reach-the-turn.test.d.ts.map +0 -1
  27. package/dist/__tests__/permission-rules-reach-the-turn.test.js +0 -132
  28. package/dist/__tests__/permission-rules-reach-the-turn.test.js.map +0 -1
  29. package/dist/__tests__/project-instructions-reach-the-turn.test.d.ts +0 -24
  30. package/dist/__tests__/project-instructions-reach-the-turn.test.d.ts.map +0 -1
  31. package/dist/__tests__/project-instructions-reach-the-turn.test.js +0 -153
  32. package/dist/__tests__/project-instructions-reach-the-turn.test.js.map +0 -1
  33. package/dist/cli.test.d.ts +0 -2
  34. package/dist/cli.test.d.ts.map +0 -1
  35. package/dist/cli.test.js +0 -108
  36. package/dist/cli.test.js.map +0 -1
  37. package/dist/commands/__tests__/eval.test.d.ts +0 -2
  38. package/dist/commands/__tests__/eval.test.d.ts.map +0 -1
  39. package/dist/commands/__tests__/eval.test.js +0 -165
  40. package/dist/commands/__tests__/eval.test.js.map +0 -1
  41. package/dist/commands/__tests__/passthrough-help.test.d.ts +0 -2
  42. package/dist/commands/__tests__/passthrough-help.test.d.ts.map +0 -1
  43. package/dist/commands/__tests__/passthrough-help.test.js +0 -96
  44. package/dist/commands/__tests__/passthrough-help.test.js.map +0 -1
  45. package/dist/commands/__tests__/resume.test.d.ts +0 -15
  46. package/dist/commands/__tests__/resume.test.d.ts.map +0 -1
  47. package/dist/commands/__tests__/resume.test.js +0 -116
  48. package/dist/commands/__tests__/resume.test.js.map +0 -1
  49. package/dist/commands/__tests__/run-exit-code.test.d.ts +0 -2
  50. package/dist/commands/__tests__/run-exit-code.test.d.ts.map +0 -1
  51. package/dist/commands/__tests__/run-exit-code.test.js +0 -100
  52. package/dist/commands/__tests__/run-exit-code.test.js.map +0 -1
  53. package/dist/commands/__tests__/run-flags.test.d.ts +0 -11
  54. package/dist/commands/__tests__/run-flags.test.d.ts.map +0 -1
  55. package/dist/commands/__tests__/run-flags.test.js +0 -238
  56. package/dist/commands/__tests__/run-flags.test.js.map +0 -1
  57. package/dist/commands/__tests__/run-stream-flags.test.d.ts +0 -2
  58. package/dist/commands/__tests__/run-stream-flags.test.d.ts.map +0 -1
  59. package/dist/commands/__tests__/run-stream-flags.test.js +0 -295
  60. package/dist/commands/__tests__/run-stream-flags.test.js.map +0 -1
  61. package/dist/commands/doctor.test.d.ts +0 -2
  62. package/dist/commands/doctor.test.d.ts.map +0 -1
  63. package/dist/commands/doctor.test.js +0 -82
  64. package/dist/commands/doctor.test.js.map +0 -1
  65. package/dist/config/load.test.d.ts +0 -2
  66. package/dist/config/load.test.d.ts.map +0 -1
  67. package/dist/config/load.test.js +0 -57
  68. package/dist/config/load.test.js.map +0 -1
  69. package/dist/context/__tests__/environment.test.d.ts +0 -10
  70. package/dist/context/__tests__/environment.test.d.ts.map +0 -1
  71. package/dist/context/__tests__/environment.test.js +0 -84
  72. package/dist/context/__tests__/environment.test.js.map +0 -1
  73. package/dist/context/__tests__/project.test.d.ts +0 -12
  74. package/dist/context/__tests__/project.test.d.ts.map +0 -1
  75. package/dist/context/__tests__/project.test.js +0 -201
  76. package/dist/context/__tests__/project.test.js.map +0 -1
  77. package/dist/doctor/checks/credentials.test.d.ts +0 -10
  78. package/dist/doctor/checks/credentials.test.d.ts.map +0 -1
  79. package/dist/doctor/checks/credentials.test.js +0 -47
  80. package/dist/doctor/checks/credentials.test.js.map +0 -1
  81. package/dist/doctor/checks/sandbox.test.d.ts +0 -2
  82. package/dist/doctor/checks/sandbox.test.d.ts.map +0 -1
  83. package/dist/doctor/checks/sandbox.test.js +0 -59
  84. package/dist/doctor/checks/sandbox.test.js.map +0 -1
  85. package/dist/doctor/registry.test.d.ts +0 -7
  86. package/dist/doctor/registry.test.d.ts.map +0 -1
  87. package/dist/doctor/registry.test.js +0 -379
  88. package/dist/doctor/registry.test.js.map +0 -1
  89. package/dist/integrations/mcp/__tests__/connect.test.d.ts +0 -11
  90. package/dist/integrations/mcp/__tests__/connect.test.d.ts.map +0 -1
  91. package/dist/integrations/mcp/__tests__/connect.test.js +0 -231
  92. package/dist/integrations/mcp/__tests__/connect.test.js.map +0 -1
  93. package/dist/integrations/providers/discover.test.d.ts +0 -2
  94. package/dist/integrations/providers/discover.test.d.ts.map +0 -1
  95. package/dist/integrations/providers/discover.test.js +0 -93
  96. package/dist/integrations/providers/discover.test.js.map +0 -1
  97. package/dist/integrations/providers/keychain.test.d.ts +0 -2
  98. package/dist/integrations/providers/keychain.test.d.ts.map +0 -1
  99. package/dist/integrations/providers/keychain.test.js +0 -21
  100. package/dist/integrations/providers/keychain.test.js.map +0 -1
  101. package/dist/integrations/providers/oauth.test.d.ts +0 -2
  102. package/dist/integrations/providers/oauth.test.d.ts.map +0 -1
  103. package/dist/integrations/providers/oauth.test.js +0 -86
  104. package/dist/integrations/providers/oauth.test.js.map +0 -1
  105. package/dist/integrations/providers/preferences.test.d.ts +0 -2
  106. package/dist/integrations/providers/preferences.test.d.ts.map +0 -1
  107. package/dist/integrations/providers/preferences.test.js +0 -76
  108. package/dist/integrations/providers/preferences.test.js.map +0 -1
  109. package/dist/integrations/sessions/__tests__/archived-workspace.test.d.ts +0 -21
  110. package/dist/integrations/sessions/__tests__/archived-workspace.test.d.ts.map +0 -1
  111. package/dist/integrations/sessions/__tests__/archived-workspace.test.js +0 -62
  112. package/dist/integrations/sessions/__tests__/archived-workspace.test.js.map +0 -1
  113. package/dist/integrations/subagents/__tests__/delegation-trace.test.d.ts +0 -2
  114. package/dist/integrations/subagents/__tests__/delegation-trace.test.d.ts.map +0 -1
  115. package/dist/integrations/subagents/__tests__/delegation-trace.test.js +0 -114
  116. package/dist/integrations/subagents/__tests__/delegation-trace.test.js.map +0 -1
  117. package/dist/integrations/trust/store.test.d.ts +0 -2
  118. package/dist/integrations/trust/store.test.d.ts.map +0 -1
  119. package/dist/integrations/trust/store.test.js +0 -50
  120. package/dist/integrations/trust/store.test.js.map +0 -1
  121. package/dist/memory/store.test.d.ts +0 -2
  122. package/dist/memory/store.test.d.ts.map +0 -1
  123. package/dist/memory/store.test.js +0 -63
  124. package/dist/memory/store.test.js.map +0 -1
  125. package/dist/output/formatter.test.d.ts +0 -2
  126. package/dist/output/formatter.test.d.ts.map +0 -1
  127. package/dist/output/formatter.test.js +0 -88
  128. package/dist/output/formatter.test.js.map +0 -1
  129. package/dist/output/rendered-payload.test.d.ts +0 -2
  130. package/dist/output/rendered-payload.test.d.ts.map +0 -1
  131. package/dist/output/rendered-payload.test.js +0 -61
  132. package/dist/output/rendered-payload.test.js.map +0 -1
  133. package/dist/permissions/__tests__/mode.test.d.ts +0 -10
  134. package/dist/permissions/__tests__/mode.test.d.ts.map +0 -1
  135. package/dist/permissions/__tests__/mode.test.js +0 -115
  136. package/dist/permissions/__tests__/mode.test.js.map +0 -1
  137. package/dist/permissions/__tests__/rules.test.d.ts +0 -10
  138. package/dist/permissions/__tests__/rules.test.d.ts.map +0 -1
  139. package/dist/permissions/__tests__/rules.test.js +0 -196
  140. package/dist/permissions/__tests__/rules.test.js.map +0 -1
  141. package/dist/skills/store.test.d.ts +0 -2
  142. package/dist/skills/store.test.d.ts.map +0 -1
  143. package/dist/skills/store.test.js +0 -80
  144. package/dist/skills/store.test.js.map +0 -1
  145. package/dist/tui/__tests__/context-gauge.test.d.ts +0 -2
  146. package/dist/tui/__tests__/context-gauge.test.d.ts.map +0 -1
  147. package/dist/tui/__tests__/context-gauge.test.js +0 -83
  148. package/dist/tui/__tests__/context-gauge.test.js.map +0 -1
  149. package/dist/tui/__tests__/deferred-tool-discovery.test.d.ts +0 -24
  150. package/dist/tui/__tests__/deferred-tool-discovery.test.d.ts.map +0 -1
  151. package/dist/tui/__tests__/deferred-tool-discovery.test.js +0 -111
  152. package/dist/tui/__tests__/deferred-tool-discovery.test.js.map +0 -1
  153. package/dist/tui/__tests__/to-agent-event.test.d.ts +0 -2
  154. package/dist/tui/__tests__/to-agent-event.test.d.ts.map +0 -1
  155. package/dist/tui/__tests__/to-agent-event.test.js +0 -230
  156. package/dist/tui/__tests__/to-agent-event.test.js.map +0 -1
  157. package/dist/tui/__tests__/working-directory.test.d.ts +0 -13
  158. package/dist/tui/__tests__/working-directory.test.d.ts.map +0 -1
  159. package/dist/tui/__tests__/working-directory.test.js +0 -109
  160. package/dist/tui/__tests__/working-directory.test.js.map +0 -1
  161. package/dist/tui/agent.test.d.ts +0 -2
  162. package/dist/tui/agent.test.d.ts.map +0 -1
  163. package/dist/tui/agent.test.js +0 -225
  164. package/dist/tui/agent.test.js.map +0 -1
  165. package/dist/tui/markdownParser.test.d.ts +0 -2
  166. package/dist/tui/markdownParser.test.d.ts.map +0 -1
  167. package/dist/tui/markdownParser.test.js +0 -90
  168. package/dist/tui/markdownParser.test.js.map +0 -1
  169. package/dist/tui/mentions.test.d.ts +0 -2
  170. package/dist/tui/mentions.test.d.ts.map +0 -1
  171. package/dist/tui/mentions.test.js +0 -35
  172. package/dist/tui/mentions.test.js.map +0 -1
  173. package/dist/tui/slashCommands.test.d.ts +0 -2
  174. package/dist/tui/slashCommands.test.d.ts.map +0 -1
  175. package/dist/tui/slashCommands.test.js +0 -114
  176. package/dist/tui/slashCommands.test.js.map +0 -1
@@ -1,238 +0,0 @@
1
- /**
2
- * `namzu run` accepts what `namzu run-stream` accepts.
3
- *
4
- * The two are the same headless one-shot and differ only in how they print, so
5
- * an option one takes and the other reads aloud to the model is a defect, not a
6
- * design. `run` joined every argument into the prompt, which is the exact shape
7
- * already fixed once in the streaming sibling — `--cwd` was documented there,
8
- * unparsed, and silently ran in the process's own directory.
9
- */
10
- import { mkdtempSync, rmSync } from 'node:fs';
11
- import { tmpdir } from 'node:os';
12
- import { join } from 'node:path';
13
- import { Readable } from 'node:stream';
14
- import { describe, expect, it, vi } from 'vitest';
15
- import { EXIT_USAGE } from '../../exit-codes.js';
16
- import { composePrompt, runCommand } from '../run.js';
17
- const seen = { prompt: null, cwd: undefined, provider: undefined, model: undefined };
18
- /**
19
- * What the stubbed session reports about project instructions.
20
- *
21
- * Mutable so a test can produce the case that matters — a file that is PRESENT
22
- * and was refused. Left empty, the reader below is a branch no test ever
23
- * enters, which is the state this whole file exists to catch elsewhere.
24
- */
25
- const instructions = { loaded: [], skipped: [] };
26
- // The folder-trust gate is not what these tests are about: they exercise
27
- // argument handling, and each runs in a fresh temp directory no operator has
28
- // ever trusted. Standing in a trusted folder is the ordinary production state,
29
- // so that is where they stand. The gate itself is tested in
30
- // `__tests__/headless-trust-gate.test.ts`.
31
- vi.mock('../../integrations/trust/store.js', () => ({
32
- isTrusted: () => true,
33
- trustDir: () => { },
34
- }));
35
- vi.mock('../../tui/agent.js', () => ({
36
- probeAgentSession: vi.fn(async () => ({
37
- preferences: { version: 2, provider: 'mock', subagents: { active: [] } },
38
- needsRepickReason: null,
39
- detected: [],
40
- })),
41
- createAgentSession: vi.fn(async (prefs, _detected, opts) => {
42
- seen.cwd = opts?.cwd;
43
- seen.provider = prefs.provider;
44
- seen.model = prefs.model;
45
- return {
46
- hasProvider: true,
47
- providerSummary: 'mock',
48
- modelSummary: 'mock-model',
49
- toolNames: [],
50
- // Present because a real session always sets these — a stub missing a
51
- // field production always has is a fixture for a system that does
52
- // not ship.
53
- instructionFiles: instructions.loaded,
54
- skippedInstructionFiles: instructions.skipped,
55
- mcpConnected: [],
56
- mcpFailed: [],
57
- close: async () => { },
58
- errorHint: null,
59
- send: (messages) => {
60
- seen.prompt = messages[0]?.content ?? null;
61
- return (async function* () {
62
- yield { kind: 'done', stopReason: 'end_turn' };
63
- })();
64
- },
65
- };
66
- }),
67
- }));
68
- function context() {
69
- const printed = [];
70
- const errors = [];
71
- const ctx = {
72
- formatter: {
73
- name: 'text',
74
- print: (d) => printed.push(String(d?.text ?? d)),
75
- info: () => { },
76
- error: (e) => errors.push(String(e?.message ?? e)),
77
- },
78
- config: {},
79
- };
80
- return { ctx, printed, errors };
81
- }
82
- async function run(rawArgs, setup) {
83
- seen.prompt = null;
84
- seen.cwd = undefined;
85
- seen.provider = undefined;
86
- seen.model = undefined;
87
- instructions.loaded = [];
88
- instructions.skipped = [];
89
- setup?.();
90
- const { ctx, errors } = context();
91
- const code = (await runCommand.handler({ rawArgs, ctx }));
92
- return { code, errors };
93
- }
94
- describe('namzu run reads its options instead of reciting them', () => {
95
- it('works in --cwd and keeps it out of the prompt', async () => {
96
- const elsewhere = mkdtempSync(join(tmpdir(), 'namzu-run-cwd-'));
97
- try {
98
- const { code } = await run(['--cwd', elsewhere, 'fix', 'the', 'test']);
99
- expect(code).toBe(0);
100
- expect(seen.cwd).toBe(elsewhere);
101
- // The whole point: the flag was previously the first two words the
102
- // model was asked to act on.
103
- expect(seen.prompt).toBe('fix the test');
104
- }
105
- finally {
106
- rmSync(elsewhere, { recursive: true, force: true });
107
- }
108
- });
109
- it('takes --provider and --model over the stored preference', async () => {
110
- const { code } = await run(['--provider', 'openai', '--model', 'some-model', 'hello']);
111
- expect(code).toBe(0);
112
- expect(seen.provider).toBe('openai');
113
- expect(seen.model).toBe('some-model');
114
- expect(seen.prompt).toBe('hello');
115
- });
116
- it('refuses an option it does not know, with a usage exit code', async () => {
117
- // A shell caller reads `$?`; saying "--temperature 0.5" to the model and
118
- // exiting 0 is the failure this replaces.
119
- const { code, errors } = await run(['--temperature', '0.5', 'hello']);
120
- expect(code).toBe(EXIT_USAGE);
121
- expect(errors.join('')).toContain('--temperature');
122
- expect(seen.prompt).toBeNull();
123
- });
124
- it('refuses a --cwd that is not there rather than running in this one', async () => {
125
- const { code, errors } = await run(['--cwd', join(tmpdir(), 'namzu-run-no-such'), 'hello']);
126
- expect(code).toBe(EXIT_USAGE);
127
- expect(errors.join('')).toContain('--cwd does not exist');
128
- expect(seen.prompt).toBeNull();
129
- });
130
- it('lets `--` carry a prompt that begins with a dash', async () => {
131
- const { code } = await run(['--', '--force', 'is', 'part', 'of', 'the', 'question']);
132
- expect(code).toBe(0);
133
- expect(seen.prompt).toBe('--force is part of the question');
134
- });
135
- it('accepts --yolo and does not put it in the prompt', async () => {
136
- // Headless turns never prompt for approval, so there is nothing to skip.
137
- // Accepting it silently is what keeps `namzu --yolo run …` working.
138
- const { code } = await run(['--yolo', 'hello']);
139
- expect(code).toBe(0);
140
- expect(seen.prompt).toBe('hello');
141
- });
142
- });
143
- describe('a pipe and a question are both the prompt', () => {
144
- // `cat notes.txt | namzu run "summarise this"` read the three words and
145
- // silently dropped the file: piped input was consulted only when there was
146
- // no argument prompt. The run succeeded and answered about nothing.
147
- it('keeps piped material alongside the question', () => {
148
- const prompt = composePrompt('summarise this', 'line one\nline two\n');
149
- expect(prompt).toContain('summarise this');
150
- expect(prompt).toContain('line one');
151
- expect(prompt).toContain('line two');
152
- });
153
- it('fences the piped material so it cannot read as part of the question', () => {
154
- // Without a boundary the last line of a long paste runs into the
155
- // instruction, and the model cannot tell the request from the material.
156
- const prompt = composePrompt('what is wrong here?', 'const x = 1');
157
- expect(prompt).toBe('what is wrong here?\n\n<stdin>\nconst x = 1\n</stdin>');
158
- });
159
- it('is just the pipe when no question was given', () => {
160
- expect(composePrompt('', 'do the thing')).toBe('do the thing');
161
- });
162
- it('is just the question when nothing was piped', () => {
163
- expect(composePrompt('do the thing', '')).toBe('do the thing');
164
- // No empty tag block either — a model shown `<stdin></stdin>` is being
165
- // told something was attached when nothing was.
166
- expect(composePrompt('do the thing', ' \n ')).toBe('do the thing');
167
- });
168
- it('is empty when neither was given, so the caller can report it', () => {
169
- expect(composePrompt('', '')).toBe('');
170
- });
171
- });
172
- describe('the pipe reaches the model, not just the composer', () => {
173
- // composePrompt is pure and proves the shape. This proves the plumbing:
174
- // that piped bytes are actually READ when a prompt argument is present.
175
- // They were not — stdin was consulted only when the argument was absent —
176
- // and a unit test of the composer alone would pass with that defect intact.
177
- function withStdin(text, fn) {
178
- const real = Object.getOwnPropertyDescriptor(process, 'stdin');
179
- const fake = text === null ? Readable.from([]) : Readable.from([Buffer.from(text)]);
180
- Object.defineProperty(process, 'stdin', {
181
- configurable: true,
182
- get: () => Object.assign(fake, { isTTY: text === null }),
183
- });
184
- return fn().finally(() => {
185
- if (real)
186
- Object.defineProperty(process, 'stdin', real);
187
- });
188
- }
189
- it('sends the piped file alongside the question', async () => {
190
- await withStdin('the contents of notes.txt', async () => {
191
- const { code } = await run(['summarise this']);
192
- expect(code).toBe(0);
193
- expect(seen.prompt).toContain('summarise this');
194
- expect(seen.prompt).toContain('the contents of notes.txt');
195
- });
196
- });
197
- it('reads the pipe as the whole prompt for the `-` sentinel', async () => {
198
- await withStdin('the question is in here', async () => {
199
- const { code } = await run(['-']);
200
- expect(code).toBe(0);
201
- expect(seen.prompt).toBe('the question is in here');
202
- });
203
- });
204
- });
205
- describe('an instruction file that was refused is named, not omitted', () => {
206
- // The session reports a refusal and `run` has to print it. An empty loaded
207
- // list cannot distinguish "this project declares none" from "yours is a
208
- // symlink out of the tree and namzu would not read it", and those two want
209
- // opposite responses from whoever is reading the output.
210
- it('reports a skipped file and why, on stderr', async () => {
211
- const { code, errors } = await run(['hello'], () => {
212
- instructions.skipped = [
213
- { path: '/repo/AGENTS.md', reason: 'it is a symlink to /etc/shadow, outside the project' },
214
- ];
215
- });
216
- expect(code).toBe(0);
217
- const said = errors.join('\n');
218
- expect(said).toContain('AGENTS.md');
219
- expect(said, 'a refusal that does not say why sends the reader nowhere').toContain('outside the project');
220
- });
221
- it('says nothing when nothing was refused', async () => {
222
- const { errors } = await run(['hello']);
223
- expect(errors.join('\n')).not.toContain('skipped');
224
- });
225
- });
226
- describe('a flag that was never read is refused, not swallowed', () => {
227
- // `--instance` was parsed into a field nothing anywhere in the repo read.
228
- // A host passing it got the persona selection it asked for exactly never,
229
- // and was told exactly nothing — which is worse than an absent flag,
230
- // because an absent flag says so immediately.
231
- it('refuses --instance now that it means nothing', async () => {
232
- const { code, errors } = await run(['--instance', 'namzu-2', 'hello']);
233
- expect(code).toBe(EXIT_USAGE);
234
- expect(errors.join('')).toContain('--instance');
235
- expect(seen.prompt).toBeNull();
236
- });
237
- });
238
- //# sourceMappingURL=run-flags.test.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"run-flags.test.js","sourceRoot":"","sources":["../../../src/commands/__tests__/run-flags.test.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAAE,WAAW,EAAE,MAAM,EAAE,MAAM,SAAS,CAAA;AAC7C,OAAO,EAAE,MAAM,EAAE,MAAM,SAAS,CAAA;AAChC,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW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uC,EAAE,KAAK,IAAI,EAAE;QACtD,MAAM,EAAE,MAAM,EAAE,GAAG,MAAM,GAAG,CAAC,CAAC,OAAO,CAAC,CAAC,CAAA;QAEvC,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,GAAG,CAAC,SAAS,CAAC,SAAS,CAAC,CAAA;IACnD,CAAC,CAAC,CAAA;AACH,CAAC,CAAC,CAAA;AAEF,QAAQ,CAAC,sDAAsD,EAAE,GAAG,EAAE;IACrE,0EAA0E;IAC1E,0EAA0E;IAC1E,qEAAqE;IACrE,8CAA8C;IAC9C,EAAE,CAAC,8CAA8C,EAAE,KAAK,IAAI,EAAE;QAC7D,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,GAAG,MAAM,GAAG,CAAC,CAAC,YAAY,EAAE,SAAS,EAAE,OAAO,CAAC,CAAC,CAAA;QAEtE,MAAM,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,UAAU,CAAC,CAAA;QAC7B,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC,CAAC,SAAS,CAAC,YAAY,CAAC,CAAA;QAC/C,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,QAAQ,EAAE,CAAA;IAC/B,CAAC,CAAC,CAAA;AACH,CAAC,CAAC,CAAA"}
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=run-stream-flags.test.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"run-stream-flags.test.d.ts","sourceRoot":"","sources":["../../../src/commands/__tests__/run-stream-flags.test.ts"],"names":[],"mappings":""}
@@ -1,295 +0,0 @@
1
- import { mkdirSync, mkdtempSync, rmSync, writeFileSync } from 'node:fs';
2
- import { tmpdir } from 'node:os';
3
- import { join, resolve } from 'node:path';
4
- import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest';
5
- import { openSessions } from '../../integrations/sessions/store.js';
6
- import { parseRunFlags } from '../run-flags.js';
7
- import { historyCommand, runStreamCommand, skillsJSONCommand } from '../run-stream.js';
8
- // Mocked so the directory the store is opened at is observable. Nothing here
9
- // touches a real `.namzu` store; `resolveConversation` returning null is the
10
- // "no such session" path, which is what makes the handler terminate.
11
- vi.mock('../../integrations/sessions/store.js', () => ({
12
- openSessions: vi.fn(async () => ({})),
13
- resolveConversation: vi.fn(async () => null),
14
- loadConversation: vi.fn(async () => []),
15
- appendMessages: vi.fn(async () => undefined),
16
- }));
17
- // Stubbed so a turn can be driven to completion without a credential, and so
18
- // the directory the SESSION is created in is observable. What the session then
19
- // does with that directory is asserted in `src/tui/__tests__/`.
20
- const sessionOptions = [];
21
- // Standing in a trusted folder, which is the ordinary production state. These
22
- // tests are about the option surface and the permission table; the gate that
23
- // refuses an untrusted folder is tested in
24
- // `__tests__/headless-trust-gate.test.ts`.
25
- vi.mock('../../integrations/trust/store.js', () => ({
26
- isTrusted: () => true,
27
- trustDir: () => { },
28
- }));
29
- vi.mock('../../tui/agent.js', () => ({
30
- probeAgentSession: vi.fn(async () => ({
31
- preferences: { version: 2, provider: 'anthropic', subagents: { active: [] } },
32
- needsRepickReason: null,
33
- detected: [],
34
- })),
35
- createAgentSession: vi.fn(async (_prefs, _detected, opts) => {
36
- sessionOptions.push(opts);
37
- return {
38
- hasProvider: true,
39
- providerSummary: 'stub',
40
- modelSummary: 'stub',
41
- toolNames: [],
42
- // Present because a real session always sets these: a stub missing a
43
- // field production always has is a fixture for a system that does not
44
- // ship.
45
- instructionFiles: [],
46
- skippedInstructionFiles: [],
47
- mcpConnected: [],
48
- mcpFailed: [],
49
- close: async () => { },
50
- errorHint: null,
51
- send: async function* () { },
52
- };
53
- }),
54
- }));
55
- /**
56
- * `run-stream` folded every argument it did not recognise into `rest`, and
57
- * `rest.join(' ')` is the PROMPT. `--cwd <path>` was in this command's own help
58
- * text and was never parsed, so the invocation our documentation teaches sent
59
- * the model a prompt beginning `--cwd /path …` while silently reading the
60
- * process's own directory.
61
- *
62
- * That is the same defect the sibling test in `passthrough-help.test.ts`
63
- * describes one level up, where `--help` became the prompt. The fix there was
64
- * to stop treating an option as content; the fix here is the same, plus
65
- * actually honouring the flag that was advertised.
66
- */
67
- const ctx = { config: {} };
68
- function capture() {
69
- const lines = [];
70
- const spy = vi.spyOn(process.stdout, 'write').mockImplementation((chunk) => {
71
- lines.push(String(chunk));
72
- return true;
73
- });
74
- return { lines, restore: () => spy.mockRestore() };
75
- }
76
- beforeEach(() => {
77
- vi.mocked(openSessions).mockClear();
78
- sessionOptions.length = 0;
79
- });
80
- afterEach(() => {
81
- vi.restoreAllMocks();
82
- });
83
- async function run(rawArgs) {
84
- const { lines, restore } = capture();
85
- try {
86
- await runStreamCommand.handler({ rawArgs, ctx });
87
- }
88
- finally {
89
- restore();
90
- }
91
- return lines;
92
- }
93
- describe('run-stream does not turn options into prompt text', () => {
94
- it('consumes --cwd instead of speaking it to the model', async () => {
95
- // With `--cwd` unparsed these two tokens WERE the prompt, so the run
96
- // proceeded. Reaching "no prompt" is what proves they were consumed.
97
- const lines = await run(['--cwd', '/tmp/somewhere']);
98
- expect(lines.join('')).toContain('no prompt');
99
- });
100
- it('refuses an option it does not know rather than saying it out loud', async () => {
101
- const lines = await run(['--temperature', '0.5', 'hello']);
102
- const joined = lines.join('');
103
- expect(joined).toContain('unknown option');
104
- expect(joined).toContain('--temperature');
105
- });
106
- it('refuses the flag form written with an equals sign', async () => {
107
- const lines = await run(['--nope=1', 'hello']);
108
- expect(lines.join('')).toContain('--nope');
109
- });
110
- it('still emits a terminal event when it refuses, so a host is not left hanging', async () => {
111
- // The NDJSON contract is that every run ends with `done`. A refusal that
112
- // skipped it would strand a host line-scanning stdout.
113
- const lines = await run(['--bogus', 'hello']);
114
- expect(lines.join('')).toContain('"kind":"done"');
115
- });
116
- });
117
- describe('run-stream works in the directory it was pointed at', () => {
118
- it('hands --cwd to the agent session, not only to the session store', async () => {
119
- // `--session` keeps the turn off stdin: without a session key the command
120
- // reads prior history from a pipe, and in a test runner that pipe never
121
- // closes.
122
- const elsewhere = mkdtempSync(join(tmpdir(), 'namzu-run-stream-'));
123
- try {
124
- await run(['--cwd', elsewhere, '--session', 'k', 'read', 'notes.txt']);
125
- }
126
- finally {
127
- rmSync(elsewhere, { recursive: true, force: true });
128
- }
129
- expect(sessionOptions[0]?.cwd).toBe(elsewhere);
130
- });
131
- it('refuses a --cwd that is not there instead of quietly using this one', async () => {
132
- // The silent fallback is the whole defect: the run proceeds, searches the
133
- // wrong tree, finds nothing, and reports that the file does not exist.
134
- const lines = await run(['--cwd', join(tmpdir(), 'namzu-no-such-dir'), 'hello']);
135
- const joined = lines.join('');
136
- expect(joined).toContain('--cwd does not exist');
137
- expect(joined).toContain('"kind":"done"');
138
- expect(sessionOptions).toEqual([]);
139
- });
140
- });
141
- describe('the flag parser itself', () => {
142
- // Asserted here rather than through the handler: a valid prompt sends the
143
- // handler on to stdin and a provider probe, so the first version of this
144
- // case hung for five seconds and failed on a timeout rather than on the
145
- // behaviour. A pure function deserves to be called.
146
- it('lets `--` carry a prompt that begins with a dash', () => {
147
- const flags = parseRunFlags(['--', '--this-is-the-prompt']);
148
- expect(flags.rest).toEqual(['--this-is-the-prompt']);
149
- expect(flags.unknown).toEqual([]);
150
- });
151
- it('stops interpreting options after `--`', () => {
152
- const flags = parseRunFlags(['--session', 'abc', '--', '--model', 'not-a-flag']);
153
- expect(flags.session).toBe('abc');
154
- expect(flags.model).toBeNull();
155
- expect(flags.rest).toEqual(['--model', 'not-a-flag']);
156
- });
157
- it('reads --cwd in both spellings', () => {
158
- expect(parseRunFlags(['--cwd', '/a', 'hi']).cwd).toBe('/a');
159
- expect(parseRunFlags(['--cwd=/b', 'hi']).cwd).toBe('/b');
160
- expect(parseRunFlags(['--cwd', '/a', 'hi']).rest).toEqual(['hi']);
161
- });
162
- it('leaves a lone dash alone, since that is not an option', () => {
163
- expect(parseRunFlags(['-', 'hi']).unknown).toEqual([]);
164
- expect(parseRunFlags(['-', 'hi']).rest).toEqual(['-', 'hi']);
165
- });
166
- });
167
- describe('skills-json lists the directory it was pointed at', () => {
168
- // A host that lists skills for one checkout and then runs a turn in that
169
- // same checkout has to be told about the same skills both times. It was
170
- // not: this command read the process directory whatever `--cwd` said, so
171
- // it could offer a skill that `run-stream --cwd <there>` then could not
172
- // find, and hide one that was actually available.
173
- function skillIn(root, name) {
174
- mkdirSync(join(root, 'skills', name), { recursive: true });
175
- writeFileSync(join(root, 'skills', name, 'SKILL.md'), `---\nname: ${name}\ndescription: only in this checkout\n---\n\nbody\n`);
176
- }
177
- it('discovers the project skills under --cwd', async () => {
178
- const elsewhere = mkdtempSync(join(tmpdir(), 'namzu-skills-'));
179
- skillIn(elsewhere, 'only-over-there');
180
- const { lines, restore } = capture();
181
- try {
182
- await skillsJSONCommand.handler({ rawArgs: ['--cwd', elsewhere], ctx });
183
- }
184
- finally {
185
- restore();
186
- rmSync(elsewhere, { recursive: true, force: true });
187
- }
188
- const names = JSON.parse(lines.join('').trim()).map((s) => s.name);
189
- expect(names).toContain('only-over-there');
190
- });
191
- // There is deliberately no paired "and not from anywhere else" case: with
192
- // the flag ignored the command read `packages/cli`, which has no skills
193
- // directory, so a negative assertion passes with the defect still in place
194
- // and would only look like coverage.
195
- });
196
- describe('history reads the directory it was pointed at', () => {
197
- it('opens the store at --cwd, not at the process directory', async () => {
198
- // Parsing the flag is not the fix; USING it is. An assertion that the
199
- // command merely survives `--cwd` would pass with the wiring reverted —
200
- // `[]` is printed either way — which would leave the flag parsed and
201
- // still undriven, the exact shape being repaired here.
202
- //
203
- // A real directory, because `--cwd` is now resolved and checked before
204
- // the store is opened: a path that is not there cannot be told apart
205
- // from a session with no messages, so it never reaches the store.
206
- const elsewhere = mkdtempSync(join(tmpdir(), 'namzu-history-'));
207
- const { lines, restore } = capture();
208
- try {
209
- await historyCommand.handler({
210
- rawArgs: ['--cwd', elsewhere, '--session', 'some-key'],
211
- ctx,
212
- });
213
- }
214
- finally {
215
- restore();
216
- rmSync(elsewhere, { recursive: true, force: true });
217
- }
218
- expect(openSessions).toHaveBeenCalledWith(elsewhere);
219
- expect(lines.join('').trim()).toBe('[]');
220
- });
221
- it('resolves a relative --cwd against the process directory', async () => {
222
- // A host that passes `.` or `../sibling` gets the directory it meant,
223
- // and the agent downstream gets an absolute path it cannot misread.
224
- const { restore } = capture();
225
- try {
226
- await historyCommand.handler({ rawArgs: ['--cwd', '.', '--session', 'k'], ctx });
227
- }
228
- finally {
229
- restore();
230
- }
231
- expect(openSessions).toHaveBeenCalledWith(resolve(process.cwd(), '.'));
232
- });
233
- it('falls back to the process directory when --cwd is absent', async () => {
234
- const { restore } = capture();
235
- try {
236
- await historyCommand.handler({ rawArgs: ['--session', 'some-key'], ctx });
237
- }
238
- finally {
239
- restore();
240
- }
241
- expect(openSessions).toHaveBeenCalledWith(process.cwd());
242
- });
243
- });
244
- describe('run-stream honours the permission surface, not just parses it', () => {
245
- // It accepted `--permission-mode` and never used it, and it never compiled
246
- // the `[permissions]` table at all — so an operator who wrote rules, or who
247
- // typed `--permission-mode strict` precisely because they did not trust the
248
- // run, got an unrestricted one that looked like it had obeyed. A safety
249
- // control that parses and does nothing is worse than one that is missing,
250
- // because the absence is visible and the silence is not.
251
- const withConfig = {
252
- config: { permissions: { bash: 'deny' } },
253
- };
254
- async function runWith(rawArgs, context = withConfig) {
255
- const { lines, restore } = capture();
256
- try {
257
- await runStreamCommand.handler({ rawArgs, ctx: context });
258
- }
259
- finally {
260
- restore();
261
- }
262
- return lines;
263
- }
264
- it('compiles the operator table into the session', async () => {
265
- await runWith(['--session', 'k', 'hello']);
266
- expect(sessionOptions[0]?.rules).toEqual([{ type: 'deny_by_name', toolNames: ['bash'] }]);
267
- });
268
- it('passes --permission-mode through instead of ignoring it', async () => {
269
- await runWith(['--session', 'k', '--permission-mode', 'strict', 'hello']);
270
- expect(sessionOptions[0]?.permissionMode).toBe('strict');
271
- });
272
- it('refuses a mode it does not know rather than running unrestricted', async () => {
273
- const lines = await runWith(['--session', 'k', '--permission-mode', 'yolo', 'hello']);
274
- expect(lines.join('')).toContain('--permission-mode must be one of');
275
- expect(sessionOptions).toEqual([]);
276
- });
277
- it('defaults to auto when nothing was asked for, and says so by acting on it', async () => {
278
- await runWith(['--session', 'k', 'hello']);
279
- expect(sessionOptions[0]?.permissionMode).toBe('auto');
280
- });
281
- it('reports an unreadable rule in band, where a host can see it', async () => {
282
- const bad = {
283
- config: { permissions: { bash: { 'git push*': 'maybe' } } },
284
- };
285
- const lines = await runWith(['--session', 'k', 'hello'], bad);
286
- // Parsed, not substring-matched: the line is JSON, so the quotes around
287
- // the pattern are escaped in the raw text and a naive contains() would
288
- // pass or fail for reasons unrelated to what the host actually reads.
289
- const messages = lines
290
- .map((l) => JSON.parse(l))
291
- .map((e) => e.message ?? '');
292
- expect(messages.some((m) => m.includes('permissions.bash."git push*"'))).toBe(true);
293
- });
294
- });
295
- //# sourceMappingURL=run-stream-flags.test.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"run-stream-flags.test.js","sourceRoot":"","sources":["../../../src/commands/__tests__/run-stream-flags.test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM,SAAS,CAAA;AACvE,OAAO,EAAE,MAAM,EAAE,MAAM,SAAS,CAAA;AAChC,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AACzC,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,EAAE,EAAE,EAAE,EAAE,EAAE,MAAM,QAAQ,CAAA;AAExE,OAAO,EAAE,YAAY,EAAE,MAAM,sCAAsC,CAAA;AACnE,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAA;AAC/C,OAAO,EAAE,cAAc,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAA;AAGtF,6EAA6E;AAC7E,6EAA6E;AAC7E,qEAAqE;AACrE,EAAE,CAAC,IAA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