@namzu/cli 2.6.1 → 4.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.
Files changed (55) hide show
  1. package/dist/commands/doctor.d.ts.map +1 -1
  2. package/dist/commands/doctor.js +15 -4
  3. package/dist/commands/doctor.js.map +1 -1
  4. package/dist/commands/run-flags.d.ts +23 -0
  5. package/dist/commands/run-flags.d.ts.map +1 -1
  6. package/dist/commands/run-flags.js +39 -0
  7. package/dist/commands/run-flags.js.map +1 -1
  8. package/dist/commands/run-stream.d.ts.map +1 -1
  9. package/dist/commands/run-stream.js +12 -6
  10. package/dist/commands/run-stream.js.map +1 -1
  11. package/dist/commands/run.d.ts.map +1 -1
  12. package/dist/commands/run.js +12 -6
  13. package/dist/commands/run.js.map +1 -1
  14. package/dist/doctor/checks/chain.d.ts +32 -0
  15. package/dist/doctor/checks/chain.d.ts.map +1 -0
  16. package/dist/doctor/checks/chain.js +118 -0
  17. package/dist/doctor/checks/chain.js.map +1 -0
  18. package/dist/doctor/checks/index.d.ts +2 -1
  19. package/dist/doctor/checks/index.d.ts.map +1 -1
  20. package/dist/doctor/checks/index.js +6 -1
  21. package/dist/doctor/checks/index.js.map +1 -1
  22. package/dist/index.d.ts +1 -1
  23. package/dist/index.d.ts.map +1 -1
  24. package/dist/index.js +1 -1
  25. package/dist/index.js.map +1 -1
  26. package/dist/integrations/providers/chain-capabilities.d.ts +80 -0
  27. package/dist/integrations/providers/chain-capabilities.d.ts.map +1 -0
  28. package/dist/integrations/providers/chain-capabilities.js +207 -0
  29. package/dist/integrations/providers/chain-capabilities.js.map +1 -0
  30. package/dist/integrations/providers/index.d.ts +2 -1
  31. package/dist/integrations/providers/index.d.ts.map +1 -1
  32. package/dist/integrations/providers/index.js +2 -1
  33. package/dist/integrations/providers/index.js.map +1 -1
  34. package/dist/integrations/providers/preferences.d.ts +84 -15
  35. package/dist/integrations/providers/preferences.d.ts.map +1 -1
  36. package/dist/integrations/providers/preferences.js +180 -25
  37. package/dist/integrations/providers/preferences.js.map +1 -1
  38. package/dist/tui/App.d.ts.map +1 -1
  39. package/dist/tui/App.js +92 -16
  40. package/dist/tui/App.js.map +1 -1
  41. package/dist/tui/PermissionOverlay.d.ts.map +1 -1
  42. package/dist/tui/PermissionOverlay.js +1 -1
  43. package/dist/tui/PermissionOverlay.js.map +1 -1
  44. package/dist/tui/TrustPrompt.d.ts.map +1 -1
  45. package/dist/tui/TrustPrompt.js +1 -1
  46. package/dist/tui/TrustPrompt.js.map +1 -1
  47. package/dist/tui/agent.d.ts +12 -0
  48. package/dist/tui/agent.d.ts.map +1 -1
  49. package/dist/tui/agent.js +70 -10
  50. package/dist/tui/agent.js.map +1 -1
  51. package/dist/tui/consent-timing.d.ts +44 -0
  52. package/dist/tui/consent-timing.d.ts.map +1 -0
  53. package/dist/tui/consent-timing.js +48 -0
  54. package/dist/tui/consent-timing.js.map +1 -0
  55. package/package.json +3 -3
@@ -0,0 +1,48 @@
1
+ /**
2
+ * When a keystroke counts as consent.
3
+ *
4
+ * namzu has two screens that ask the operator to permit something, and both
5
+ * appear on a schedule the operator does not control:
6
+ *
7
+ * - **The tool-permission prompt.** The composer stays editable while a turn
8
+ * runs and the docs encourage typing a follow-up there, so the overlay
9
+ * replaces a composer someone's hands are already in.
10
+ * - **The trust gate.** It is the first screen of the program, reached by
11
+ * typing `namzu` and pressing Enter — so a key repeat, a buffered second
12
+ * press, or an impatient double-tap arrives while it is painting.
13
+ *
14
+ * In both cases the keystroke that lands was aimed at whatever was there
15
+ * before, and must not be read as agreement to what replaced it. So granting
16
+ * is deferred for a beat after the screen appears.
17
+ *
18
+ * **Refusing is never deferred**, at either screen. The asymmetry is the whole
19
+ * design: a refusal the operator did not mean costs them a retry, while a grant
20
+ * they did not mean cannot be taken back — the permission prompt runs the tool,
21
+ * and the trust gate writes durable trust for a directory tree. A guard that
22
+ * hesitated in both directions would make the safe key feel broken to buy
23
+ * nothing.
24
+ */
25
+ /**
26
+ * How long after a consent screen appears a granting key is ignored.
27
+ *
28
+ * Long enough to swallow a keystroke already in flight, short enough that
29
+ * someone who read the screen and reached for `y` never waits on it. A fast
30
+ * typist runs near 100ms between characters, so this covers roughly three
31
+ * characters of overshoot.
32
+ */
33
+ export const APPROVAL_SETTLE_MS = 350;
34
+ /**
35
+ * Whether a granting keypress arriving `now` should decide the screen that
36
+ * appeared at `shownAt`.
37
+ *
38
+ * `null` — no recorded appearance — is refused rather than allowed. The value
39
+ * exists only while such a screen is up, so its absence means the caller cannot
40
+ * establish that the operator has seen anything, and the fail-safe reading of
41
+ * "I cannot establish this" is not consent.
42
+ */
43
+ export function approvalIsDeliberate(shownAt, now) {
44
+ if (shownAt === null)
45
+ return false;
46
+ return now - shownAt >= APPROVAL_SETTLE_MS;
47
+ }
48
+ //# sourceMappingURL=consent-timing.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"consent-timing.js","sourceRoot":"","sources":["../../src/tui/consent-timing.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AAEH;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,kBAAkB,GAAG,GAAG,CAAA;AAErC;;;;;;;;GAQG;AACH,MAAM,UAAU,oBAAoB,CAAC,OAAsB,EAAE,GAAW;IACvE,IAAI,OAAO,KAAK,IAAI;QAAE,OAAO,KAAK,CAAA;IAClC,OAAO,GAAG,GAAG,OAAO,IAAI,kBAAkB,CAAA;AAC3C,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@namzu/cli",
3
- "version": "2.6.1",
3
+ "version": "4.0.0",
4
4
  "description": "Operator CLI for the Namzu agent platform — namzu doctor + future commands. Dual-purpose: standalone bin (`namzu doctor`) and library (`import { runDoctor } from '@namzu/cli'`).",
5
5
  "keywords": [
6
6
  "namzu",
@@ -44,11 +44,11 @@
44
44
  "ink": "^7.0.3",
45
45
  "react": "^19.2.6",
46
46
  "yaml": "^2.9.0",
47
+ "@namzu/anthropic": "3.1.1",
47
48
  "@namzu/ollama": "2.0.1",
48
49
  "@namzu/openai": "1.1.1",
49
- "@namzu/sdk": "^16.0.0",
50
50
  "@namzu/openrouter": "2.0.1",
51
- "@namzu/anthropic": "3.1.1"
51
+ "@namzu/sdk": "^16.0.0"
52
52
  },
53
53
  "devDependencies": {
54
54
  "@biomejs/biome": "^1.9.4",