@namzu/cli 0.6.0 → 0.7.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 (197) hide show
  1. package/dist/__tests__/permission-rules-reach-the-turn.test.d.ts +31 -0
  2. package/dist/__tests__/permission-rules-reach-the-turn.test.d.ts.map +1 -0
  3. package/dist/__tests__/permission-rules-reach-the-turn.test.js +132 -0
  4. package/dist/__tests__/permission-rules-reach-the-turn.test.js.map +1 -0
  5. package/dist/cli.d.ts.map +1 -1
  6. package/dist/cli.js +16 -3
  7. package/dist/cli.js.map +1 -1
  8. package/dist/cli.test.js +7 -1
  9. package/dist/cli.test.js.map +1 -1
  10. package/dist/commands/__tests__/run-flags.test.js +0 -1
  11. package/dist/commands/__tests__/run-flags.test.js.map +1 -1
  12. package/dist/commands/__tests__/run-stream-flags.test.js +0 -1
  13. package/dist/commands/__tests__/run-stream-flags.test.js.map +1 -1
  14. package/dist/commands/run-stream.d.ts +3 -3
  15. package/dist/commands/run-stream.js +3 -3
  16. package/dist/commands/run.d.ts.map +1 -1
  17. package/dist/commands/run.js +4 -0
  18. package/dist/commands/run.js.map +1 -1
  19. package/dist/commands/stubs.d.ts +10 -0
  20. package/dist/commands/stubs.d.ts.map +1 -1
  21. package/dist/commands/stubs.js +12 -2
  22. package/dist/commands/stubs.js.map +1 -1
  23. package/dist/config/load.d.ts.map +1 -1
  24. package/dist/config/load.js +20 -4
  25. package/dist/config/load.js.map +1 -1
  26. package/dist/config/schema.d.ts +0 -12
  27. package/dist/config/schema.d.ts.map +1 -1
  28. package/dist/config/schema.js.map +1 -1
  29. package/dist/doctor/checks/credentials.d.ts +20 -0
  30. package/dist/doctor/checks/credentials.d.ts.map +1 -0
  31. package/dist/doctor/checks/credentials.js +58 -0
  32. package/dist/doctor/checks/credentials.js.map +1 -0
  33. package/dist/doctor/checks/credentials.test.d.ts +10 -0
  34. package/dist/doctor/checks/credentials.test.d.ts.map +1 -0
  35. package/dist/doctor/checks/credentials.test.js +47 -0
  36. package/dist/doctor/checks/credentials.test.js.map +1 -0
  37. package/dist/doctor/checks/index.d.ts +2 -1
  38. package/dist/doctor/checks/index.d.ts.map +1 -1
  39. package/dist/doctor/checks/index.js +3 -1
  40. package/dist/doctor/checks/index.js.map +1 -1
  41. package/dist/index.d.ts +1 -1
  42. package/dist/index.d.ts.map +1 -1
  43. package/dist/index.js +1 -1
  44. package/dist/index.js.map +1 -1
  45. package/dist/integrations/providers/discover.d.ts +3 -8
  46. package/dist/integrations/providers/discover.d.ts.map +1 -1
  47. package/dist/integrations/providers/discover.js +2 -12
  48. package/dist/integrations/providers/discover.js.map +1 -1
  49. package/dist/integrations/providers/discover.test.js +1 -28
  50. package/dist/integrations/providers/discover.test.js.map +1 -1
  51. package/dist/integrations/providers/index.d.ts +0 -1
  52. package/dist/integrations/providers/index.d.ts.map +1 -1
  53. package/dist/integrations/providers/index.js +0 -1
  54. package/dist/integrations/providers/index.js.map +1 -1
  55. package/dist/integrations/providers/oauth.d.ts +1 -1
  56. package/dist/integrations/providers/oauth.js +1 -1
  57. package/dist/integrations/providers/preferences.d.ts +2 -2
  58. package/dist/integrations/providers/preferences.js +2 -2
  59. package/dist/integrations/sessions/store.js +1 -1
  60. package/dist/integrations/sessions/store.js.map +1 -1
  61. package/dist/integrations/subagents/__tests__/delegation-trace.test.d.ts +2 -0
  62. package/dist/integrations/subagents/__tests__/delegation-trace.test.d.ts.map +1 -0
  63. package/dist/integrations/subagents/__tests__/delegation-trace.test.js +69 -0
  64. package/dist/integrations/subagents/__tests__/delegation-trace.test.js.map +1 -0
  65. package/dist/integrations/subagents/runtime.d.ts.map +1 -1
  66. package/dist/integrations/subagents/runtime.js +12 -2
  67. package/dist/integrations/subagents/runtime.js.map +1 -1
  68. package/dist/integrations/updates.d.ts +4 -12
  69. package/dist/integrations/updates.d.ts.map +1 -1
  70. package/dist/integrations/updates.js +6 -53
  71. package/dist/integrations/updates.js.map +1 -1
  72. package/dist/tui/App.d.ts.map +1 -1
  73. package/dist/tui/App.js +42 -141
  74. package/dist/tui/App.js.map +1 -1
  75. package/dist/tui/Picker.d.ts +4 -4
  76. package/dist/tui/Picker.d.ts.map +1 -1
  77. package/dist/tui/Picker.js +6 -8
  78. package/dist/tui/Picker.js.map +1 -1
  79. package/dist/tui/StatusBar.d.ts +39 -3
  80. package/dist/tui/StatusBar.d.ts.map +1 -1
  81. package/dist/tui/StatusBar.js +33 -9
  82. package/dist/tui/StatusBar.js.map +1 -1
  83. package/dist/tui/__tests__/context-gauge.test.d.ts +2 -0
  84. package/dist/tui/__tests__/context-gauge.test.d.ts.map +1 -0
  85. package/dist/tui/__tests__/context-gauge.test.js +83 -0
  86. package/dist/tui/__tests__/context-gauge.test.js.map +1 -0
  87. package/dist/tui/__tests__/deferred-tool-discovery.test.d.ts +24 -0
  88. package/dist/tui/__tests__/deferred-tool-discovery.test.d.ts.map +1 -0
  89. package/dist/tui/__tests__/deferred-tool-discovery.test.js +111 -0
  90. package/dist/tui/__tests__/deferred-tool-discovery.test.js.map +1 -0
  91. package/dist/tui/__tests__/to-agent-event.test.js +181 -0
  92. package/dist/tui/__tests__/to-agent-event.test.js.map +1 -1
  93. package/dist/tui/__tests__/working-directory.test.js +0 -6
  94. package/dist/tui/__tests__/working-directory.test.js.map +1 -1
  95. package/dist/tui/agent.d.ts +38 -2
  96. package/dist/tui/agent.d.ts.map +1 -1
  97. package/dist/tui/agent.js +110 -31
  98. package/dist/tui/agent.js.map +1 -1
  99. package/dist/tui/slashCommands.d.ts +0 -6
  100. package/dist/tui/slashCommands.d.ts.map +1 -1
  101. package/dist/tui/slashCommands.js +1 -21
  102. package/dist/tui/slashCommands.js.map +1 -1
  103. package/dist/tui/types.d.ts +12 -0
  104. package/dist/tui/types.d.ts.map +1 -1
  105. package/package.json +5 -6
  106. package/dist/commands/tools.d.ts +0 -16
  107. package/dist/commands/tools.d.ts.map +0 -1
  108. package/dist/commands/tools.js +0 -161
  109. package/dist/commands/tools.js.map +0 -1
  110. package/dist/integrations/clawtool/agents.d.ts +0 -31
  111. package/dist/integrations/clawtool/agents.d.ts.map +0 -1
  112. package/dist/integrations/clawtool/agents.js +0 -30
  113. package/dist/integrations/clawtool/agents.js.map +0 -1
  114. package/dist/integrations/clawtool/agents.test.d.ts +0 -2
  115. package/dist/integrations/clawtool/agents.test.d.ts.map +0 -1
  116. package/dist/integrations/clawtool/agents.test.js +0 -79
  117. package/dist/integrations/clawtool/agents.test.js.map +0 -1
  118. package/dist/integrations/clawtool/auth.d.ts +0 -26
  119. package/dist/integrations/clawtool/auth.d.ts.map +0 -1
  120. package/dist/integrations/clawtool/auth.js +0 -56
  121. package/dist/integrations/clawtool/auth.js.map +0 -1
  122. package/dist/integrations/clawtool/auth.test.d.ts +0 -2
  123. package/dist/integrations/clawtool/auth.test.d.ts.map +0 -1
  124. package/dist/integrations/clawtool/auth.test.js +0 -40
  125. package/dist/integrations/clawtool/auth.test.js.map +0 -1
  126. package/dist/integrations/clawtool/binary.d.ts +0 -25
  127. package/dist/integrations/clawtool/binary.d.ts.map +0 -1
  128. package/dist/integrations/clawtool/binary.js +0 -50
  129. package/dist/integrations/clawtool/binary.js.map +0 -1
  130. package/dist/integrations/clawtool/binary.test.d.ts +0 -2
  131. package/dist/integrations/clawtool/binary.test.d.ts.map +0 -1
  132. package/dist/integrations/clawtool/binary.test.js +0 -50
  133. package/dist/integrations/clawtool/binary.test.js.map +0 -1
  134. package/dist/integrations/clawtool/daemon.d.ts +0 -37
  135. package/dist/integrations/clawtool/daemon.d.ts.map +0 -1
  136. package/dist/integrations/clawtool/daemon.js +0 -109
  137. package/dist/integrations/clawtool/daemon.js.map +0 -1
  138. package/dist/integrations/clawtool/daemon.test.d.ts +0 -11
  139. package/dist/integrations/clawtool/daemon.test.d.ts.map +0 -1
  140. package/dist/integrations/clawtool/daemon.test.js +0 -118
  141. package/dist/integrations/clawtool/daemon.test.js.map +0 -1
  142. package/dist/integrations/clawtool/dispatch.d.ts +0 -33
  143. package/dist/integrations/clawtool/dispatch.d.ts.map +0 -1
  144. package/dist/integrations/clawtool/dispatch.js +0 -155
  145. package/dist/integrations/clawtool/dispatch.js.map +0 -1
  146. package/dist/integrations/clawtool/dispatch.test.d.ts +0 -2
  147. package/dist/integrations/clawtool/dispatch.test.d.ts.map +0 -1
  148. package/dist/integrations/clawtool/dispatch.test.js +0 -138
  149. package/dist/integrations/clawtool/dispatch.test.js.map +0 -1
  150. package/dist/integrations/clawtool/index.d.ts +0 -11
  151. package/dist/integrations/clawtool/index.d.ts.map +0 -1
  152. package/dist/integrations/clawtool/index.js +0 -10
  153. package/dist/integrations/clawtool/index.js.map +0 -1
  154. package/dist/integrations/clawtool/mcp.d.ts +0 -51
  155. package/dist/integrations/clawtool/mcp.d.ts.map +0 -1
  156. package/dist/integrations/clawtool/mcp.js +0 -174
  157. package/dist/integrations/clawtool/mcp.js.map +0 -1
  158. package/dist/integrations/clawtool/mcp.test.d.ts +0 -2
  159. package/dist/integrations/clawtool/mcp.test.d.ts.map +0 -1
  160. package/dist/integrations/clawtool/mcp.test.js +0 -126
  161. package/dist/integrations/clawtool/mcp.test.js.map +0 -1
  162. package/dist/integrations/clawtool/paths.d.ts +0 -8
  163. package/dist/integrations/clawtool/paths.d.ts.map +0 -1
  164. package/dist/integrations/clawtool/paths.js +0 -19
  165. package/dist/integrations/clawtool/paths.js.map +0 -1
  166. package/dist/integrations/clawtool/peers.d.ts +0 -67
  167. package/dist/integrations/clawtool/peers.d.ts.map +0 -1
  168. package/dist/integrations/clawtool/peers.js +0 -150
  169. package/dist/integrations/clawtool/peers.js.map +0 -1
  170. package/dist/integrations/clawtool/plugin.d.ts +0 -42
  171. package/dist/integrations/clawtool/plugin.d.ts.map +0 -1
  172. package/dist/integrations/clawtool/plugin.js +0 -38
  173. package/dist/integrations/clawtool/plugin.js.map +0 -1
  174. package/dist/integrations/clawtool/state.d.ts +0 -11
  175. package/dist/integrations/clawtool/state.d.ts.map +0 -1
  176. package/dist/integrations/clawtool/state.js +0 -41
  177. package/dist/integrations/clawtool/state.js.map +0 -1
  178. package/dist/integrations/clawtool/state.test.d.ts +0 -2
  179. package/dist/integrations/clawtool/state.test.d.ts.map +0 -1
  180. package/dist/integrations/clawtool/state.test.js +0 -38
  181. package/dist/integrations/clawtool/state.test.js.map +0 -1
  182. package/dist/integrations/clawtool/tooling.d.ts +0 -52
  183. package/dist/integrations/clawtool/tooling.d.ts.map +0 -1
  184. package/dist/integrations/clawtool/tooling.js +0 -91
  185. package/dist/integrations/clawtool/tooling.js.map +0 -1
  186. package/dist/integrations/clawtool/tooling.test.d.ts +0 -2
  187. package/dist/integrations/clawtool/tooling.test.d.ts.map +0 -1
  188. package/dist/integrations/clawtool/tooling.test.js +0 -58
  189. package/dist/integrations/clawtool/tooling.test.js.map +0 -1
  190. package/dist/integrations/clawtool/types.d.ts +0 -41
  191. package/dist/integrations/clawtool/types.d.ts.map +0 -1
  192. package/dist/integrations/clawtool/types.js +0 -9
  193. package/dist/integrations/clawtool/types.js.map +0 -1
  194. package/dist/integrations/providers/secrets.d.ts +0 -37
  195. package/dist/integrations/providers/secrets.d.ts.map +0 -1
  196. package/dist/integrations/providers/secrets.js +0 -69
  197. package/dist/integrations/providers/secrets.js.map +0 -1
@@ -1,9 +0,0 @@
1
- /**
2
- * Shared types for the clawtool integration.
3
- *
4
- * Wire shapes mirror clawtool's Go source (cogitave/clawtool) verbatim so
5
- * upgrades on the clawtool side stay backwards-compatible without TS
6
- * changes. The source of truth for each shape is cited inline.
7
- */
8
- export {};
9
- //# sourceMappingURL=types.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/integrations/clawtool/types.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG"}
@@ -1,37 +0,0 @@
1
- /**
2
- * Reader for clawtool's `~/.config/clawtool/secrets.toml`.
3
- *
4
- * Schema (per clawtool's `internal/config/portals_io.go`):
5
- *
6
- * [secrets.work]
7
- * ANTHROPIC_API_KEY = "sk-ant-..."
8
- * OPENAI_API_KEY = "sk-..."
9
- *
10
- * [secrets.personal]
11
- * OPENROUTER_API_KEY = "..."
12
- *
13
- * Namzu treats each `[secrets.X]` section as a candidate credential
14
- * bundle — the env-var keys inside are the same names as native env
15
- * vars (e.g. `ANTHROPIC_API_KEY`). We flatten every section into a
16
- * single `Map<envVarName, value[]>` so the discoverer can ask "does any
17
- * source have ANTHROPIC_API_KEY?" without caring which scope it came
18
- * from. Multiple sections can carry the same key; we keep all values
19
- * so the picker can present them as distinct candidates if the user
20
- * has multiple Anthropic accounts.
21
- */
22
- export interface SecretCandidate {
23
- /** Env-var name as it would appear at runtime (e.g. `ANTHROPIC_API_KEY`). */
24
- readonly envName: string;
25
- readonly value: string;
26
- /** Which `[secrets.X]` section it came from (e.g. `work`, `personal`). */
27
- readonly scope: string;
28
- }
29
- export declare function clawtoolSecretsPath(home?: string): string;
30
- /**
31
- * Read clawtool's secrets.toml and return a flat array of every
32
- * env-var-style credential it carries, tagged by scope. Returns `[]`
33
- * when the file is missing or unparseable — never throws (this is an
34
- * optional discovery source).
35
- */
36
- export declare function readClawtoolSecrets(home?: string): readonly SecretCandidate[];
37
- //# sourceMappingURL=secrets.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"secrets.d.ts","sourceRoot":"","sources":["../../../src/integrations/providers/secrets.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAQH,MAAM,WAAW,eAAe;IAC/B,6EAA6E;IAC7E,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAA;IACxB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAA;IACtB,0EAA0E;IAC1E,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAA;CACtB;AAED,wBAAgB,mBAAmB,CAAC,IAAI,GAAE,MAAkB,GAAG,MAAM,CAEpE;AAED;;;;;GAKG;AACH,wBAAgB,mBAAmB,CAAC,IAAI,GAAE,MAAkB,GAAG,SAAS,eAAe,EAAE,CA4BxF"}
@@ -1,69 +0,0 @@
1
- /**
2
- * Reader for clawtool's `~/.config/clawtool/secrets.toml`.
3
- *
4
- * Schema (per clawtool's `internal/config/portals_io.go`):
5
- *
6
- * [secrets.work]
7
- * ANTHROPIC_API_KEY = "sk-ant-..."
8
- * OPENAI_API_KEY = "sk-..."
9
- *
10
- * [secrets.personal]
11
- * OPENROUTER_API_KEY = "..."
12
- *
13
- * Namzu treats each `[secrets.X]` section as a candidate credential
14
- * bundle — the env-var keys inside are the same names as native env
15
- * vars (e.g. `ANTHROPIC_API_KEY`). We flatten every section into a
16
- * single `Map<envVarName, value[]>` so the discoverer can ask "does any
17
- * source have ANTHROPIC_API_KEY?" without caring which scope it came
18
- * from. Multiple sections can carry the same key; we keep all values
19
- * so the picker can present them as distinct candidates if the user
20
- * has multiple Anthropic accounts.
21
- */
22
- import { readFileSync } from 'node:fs';
23
- import { homedir } from 'node:os';
24
- import { join } from 'node:path';
25
- import { parse as tomlParse } from 'smol-toml';
26
- export function clawtoolSecretsPath(home = homedir()) {
27
- return join(home, '.config', 'clawtool', 'secrets.toml');
28
- }
29
- /**
30
- * Read clawtool's secrets.toml and return a flat array of every
31
- * env-var-style credential it carries, tagged by scope. Returns `[]`
32
- * when the file is missing or unparseable — never throws (this is an
33
- * optional discovery source).
34
- */
35
- export function readClawtoolSecrets(home = homedir()) {
36
- const path = clawtoolSecretsPath(home);
37
- let raw;
38
- try {
39
- raw = readFileSync(path, 'utf8');
40
- }
41
- catch {
42
- return [];
43
- }
44
- let parsed;
45
- try {
46
- parsed = tomlParse(raw);
47
- }
48
- catch {
49
- return [];
50
- }
51
- if (typeof parsed !== 'object' || parsed === null)
52
- return [];
53
- const root = parsed;
54
- const secrets = root.secrets;
55
- if (typeof secrets !== 'object' || secrets === null)
56
- return [];
57
- const out = [];
58
- for (const [scope, section] of Object.entries(secrets)) {
59
- if (typeof section !== 'object' || section === null)
60
- continue;
61
- for (const [envName, value] of Object.entries(section)) {
62
- if (typeof value === 'string' && value.length > 0) {
63
- out.push({ envName, value, scope });
64
- }
65
- }
66
- }
67
- return out;
68
- }
69
- //# sourceMappingURL=secrets.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"secrets.js","sourceRoot":"","sources":["../../../src/integrations/providers/secrets.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAA;AACtC,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAA;AACjC,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAA;AAEhC,OAAO,EAAE,KAAK,IAAI,SAAS,EAAE,MAAM,WAAW,CAAA;AAU9C,MAAM,UAAU,mBAAmB,CAAC,OAAe,OAAO,EAAE;IAC3D,OAAO,IAAI,CAAC,IAAI,EAAE,SAAS,EAAE,UAAU,EAAE,cAAc,CAAC,CAAA;AACzD,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,mBAAmB,CAAC,OAAe,OAAO,EAAE;IAC3D,MAAM,IAAI,GAAG,mBAAmB,CAAC,IAAI,CAAC,CAAA;IACtC,IAAI,GAAW,CAAA;IACf,IAAI,CAAC;QACJ,GAAG,GAAG,YAAY,CAAC,IAAI,EAAE,MAAM,CAAC,CAAA;IACjC,CAAC;IAAC,MAAM,CAAC;QACR,OAAO,EAAE,CAAA;IACV,CAAC;IACD,IAAI,MAAe,CAAA;IACnB,IAAI,CAAC;QACJ,MAAM,GAAG,SAAS,CAAC,GAAG,CAAC,CAAA;IACxB,CAAC;IAAC,MAAM,CAAC;QACR,OAAO,EAAE,CAAA;IACV,CAAC;IACD,IAAI,OAAO,MAAM,KAAK,QAAQ,IAAI,MAAM,KAAK,IAAI;QAAE,OAAO,EAAE,CAAA;IAC5D,MAAM,IAAI,GAAG,MAAiC,CAAA;IAC9C,MAAM,OAAO,GAAG,IAAI,CAAC,OAAO,CAAA;IAC5B,IAAI,OAAO,OAAO,KAAK,QAAQ,IAAI,OAAO,KAAK,IAAI;QAAE,OAAO,EAAE,CAAA;IAC9D,MAAM,GAAG,GAAsB,EAAE,CAAA;IACjC,KAAK,MAAM,CAAC,KAAK,EAAE,OAAO,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,OAAkC,CAAC,EAAE,CAAC;QACnF,IAAI,OAAO,OAAO,KAAK,QAAQ,IAAI,OAAO,KAAK,IAAI;YAAE,SAAQ;QAC7D,KAAK,MAAM,CAAC,OAAO,EAAE,KAAK,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,OAAkC,CAAC,EAAE,CAAC;YACnF,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;gBACnD,GAAG,CAAC,IAAI,CAAC,EAAE,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,CAAC,CAAA;YACpC,CAAC;QACF,CAAC;IACF,CAAC;IACD,OAAO,GAAG,CAAA;AACX,CAAC"}