@pentoshi/clai 2.0.28 → 2.0.29

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 (105) hide show
  1. package/dist/agent/confirm-port.d.ts +30 -0
  2. package/dist/agent/confirm-port.js +89 -0
  3. package/dist/agent/confirm-port.js.map +1 -0
  4. package/dist/agent/plan-tool.d.ts +26 -0
  5. package/dist/agent/plan-tool.js +188 -0
  6. package/dist/agent/plan-tool.js.map +1 -0
  7. package/dist/agent/runner.d.ts +6 -174
  8. package/dist/agent/runner.js +25 -1606
  9. package/dist/agent/runner.js.map +1 -1
  10. package/dist/agent/session-policy.d.ts +19 -0
  11. package/dist/agent/session-policy.js +40 -0
  12. package/dist/agent/session-policy.js.map +1 -0
  13. package/dist/agent/stop-summary.d.ts +8 -0
  14. package/dist/agent/stop-summary.js +53 -0
  15. package/dist/agent/stop-summary.js.map +1 -0
  16. package/dist/agent/tool-call-parser.d.ts +155 -0
  17. package/dist/agent/tool-call-parser.js +1107 -0
  18. package/dist/agent/tool-call-parser.js.map +1 -0
  19. package/dist/agent/tool-output-formatting.d.ts +7 -0
  20. package/dist/agent/tool-output-formatting.js +127 -0
  21. package/dist/agent/tool-output-formatting.js.map +1 -0
  22. package/dist/commands/update.js +1 -1
  23. package/dist/prompts/index.d.ts +2 -2
  24. package/dist/prompts/index.js +103 -59
  25. package/dist/prompts/index.js.map +1 -1
  26. package/dist/repl/prompt-line.d.ts +19 -0
  27. package/dist/repl/prompt-line.js +555 -0
  28. package/dist/repl/prompt-line.js.map +1 -0
  29. package/dist/repl/slash-commands.d.ts +24 -0
  30. package/dist/repl/slash-commands.js +317 -0
  31. package/dist/repl/slash-commands.js.map +1 -0
  32. package/dist/repl.d.ts +2 -25
  33. package/dist/repl.js +41 -898
  34. package/dist/repl.js.map +1 -1
  35. package/dist/safety/classifier.js +1 -1
  36. package/dist/safety/classifier.js.map +1 -1
  37. package/dist/store/keys.js +0 -4
  38. package/dist/store/keys.js.map +1 -1
  39. package/dist/store/plan.js +1 -1
  40. package/dist/store/plan.js.map +1 -1
  41. package/dist/tools/nmap-runner.d.ts +19 -0
  42. package/dist/tools/nmap-runner.js +177 -0
  43. package/dist/tools/nmap-runner.js.map +1 -0
  44. package/dist/tools/package-binary.d.ts +1 -0
  45. package/dist/tools/package-binary.js +30 -0
  46. package/dist/tools/package-binary.js.map +1 -0
  47. package/dist/tools/pdf.js +2 -2
  48. package/dist/tools/pdf.js.map +1 -1
  49. package/dist/tools/registry.d.ts +2 -11
  50. package/dist/tools/registry.js +3 -203
  51. package/dist/tools/registry.js.map +1 -1
  52. package/dist/tools/tool-types.d.ts +12 -0
  53. package/dist/tools/tool-types.js +2 -0
  54. package/dist/tools/tool-types.js.map +1 -0
  55. package/dist/tools/web/audit.d.ts +7 -29
  56. package/dist/tools/web/audit.js +7 -29
  57. package/dist/tools/web/audit.js.map +1 -1
  58. package/dist/tools/web/budget.d.ts +5 -28
  59. package/dist/tools/web/budget.js +5 -28
  60. package/dist/tools/web/budget.js.map +1 -1
  61. package/dist/tools/web/capture.d.ts +8 -35
  62. package/dist/tools/web/capture.js +8 -35
  63. package/dist/tools/web/capture.js.map +1 -1
  64. package/dist/tools/web/fetch-core.d.ts +6 -26
  65. package/dist/tools/web/fetch-core.js +6 -26
  66. package/dist/tools/web/fetch-core.js.map +1 -1
  67. package/dist/tools/web/readable.d.ts +7 -13
  68. package/dist/tools/web/readable.js +7 -13
  69. package/dist/tools/web/readable.js.map +1 -1
  70. package/dist/tools/web/search.d.ts +7 -20
  71. package/dist/tools/web/search.js +7 -20
  72. package/dist/tools/web/search.js.map +1 -1
  73. package/dist/tools/web/ssrf-guard.d.ts +8 -27
  74. package/dist/tools/web/ssrf-guard.js +8 -27
  75. package/dist/tools/web/ssrf-guard.js.map +1 -1
  76. package/dist/tui/App.js +19 -88
  77. package/dist/tui/App.js.map +1 -1
  78. package/dist/tui/key-intent.d.ts +36 -0
  79. package/dist/tui/key-intent.js +54 -0
  80. package/dist/tui/key-intent.js.map +1 -0
  81. package/dist/tui/render-lines.js +125 -37
  82. package/dist/tui/render-lines.js.map +1 -1
  83. package/dist/tui/state.js +2 -2
  84. package/dist/tui/state.js.map +1 -1
  85. package/dist/tui/text-format.d.ts +11 -0
  86. package/dist/tui/text-format.js +85 -0
  87. package/dist/tui/text-format.js.map +1 -0
  88. package/dist/ui/ansi-box.d.ts +7 -0
  89. package/dist/ui/ansi-box.js +18 -0
  90. package/dist/ui/ansi-box.js.map +1 -0
  91. package/dist/ui/banner.d.ts +0 -9
  92. package/dist/ui/banner.js +1 -43
  93. package/dist/ui/banner.js.map +1 -1
  94. package/dist/ui/intro-card.d.ts +10 -0
  95. package/dist/ui/intro-card.js +39 -0
  96. package/dist/ui/intro-card.js.map +1 -0
  97. package/dist/ui/markdown.js +1 -1
  98. package/dist/ui/markdown.js.map +1 -1
  99. package/dist/ui/output-pane.js.map +1 -1
  100. package/dist/ui/spinner.js +6 -17
  101. package/dist/ui/spinner.js.map +1 -1
  102. package/dist/ui/wordmark.d.ts +7 -0
  103. package/dist/ui/wordmark.js +42 -0
  104. package/dist/ui/wordmark.js.map +1 -0
  105. package/package.json +1 -1
@@ -0,0 +1,317 @@
1
+ import { nvidiaFallbackModels } from "../llm/nvidia.js";
2
+ /** Shared command catalogue used by both the classic REPL and the Ink TUI. */
3
+ export const slashCommands = [
4
+ { command: "/ask", description: "switch to ask mode" },
5
+ { command: "/agent", description: "switch to agent mode" },
6
+ {
7
+ command: "/model",
8
+ usage: "[name|#]",
9
+ description: "open searchable picker (type/↑/↓ + Enter), or pass a name/number",
10
+ },
11
+ {
12
+ command: "/provider",
13
+ usage: "[name]",
14
+ description: "switch provider or open picker",
15
+ },
16
+ {
17
+ command: "/use",
18
+ usage: "<provider>",
19
+ description: "alias for /provider <name>",
20
+ },
21
+ { command: "/set", usage: "[provider] [key]", description: "store API key or open picker" },
22
+ { command: "/unset", usage: "[provider]", description: "remove key or open picker" },
23
+ { command: "/keys", description: "list configured providers" },
24
+ {
25
+ command: "/info",
26
+ usage: "[provider]",
27
+ description: "show info for the active or specified provider",
28
+ },
29
+ {
30
+ command: "/search",
31
+ usage: "[provider]",
32
+ description: "switch web.search provider or open picker",
33
+ },
34
+ {
35
+ command: "/search-provider",
36
+ usage: "[provider]",
37
+ description: "alias for /search",
38
+ },
39
+ {
40
+ command: "/mouse",
41
+ usage: "[on|off]",
42
+ description: "toggle touchpad transcript scrolling vs native selection",
43
+ },
44
+ {
45
+ command: "/variants",
46
+ usage: "[on|off|none|minimal|low|medium|high|xhigh]",
47
+ description: "toggle thinking/effort (interactive picker if no arg)",
48
+ },
49
+ {
50
+ command: "/reasoning",
51
+ usage: "[on|off|none|minimal|low|medium|high|xhigh]",
52
+ description: "alias for /variants",
53
+ },
54
+ { command: "/clear", description: "clear context" },
55
+ {
56
+ command: "/new",
57
+ description: "start a fresh session (clear context, no history carryover)",
58
+ },
59
+ {
60
+ command: "/history",
61
+ description: "browse & resume past sessions (interactive picker)",
62
+ },
63
+ { command: "/save", usage: "<name>", description: "save session" },
64
+ { command: "/reset", description: "clear all saved history" },
65
+ { command: "/cwd", usage: "<path>", description: "change working directory" },
66
+ {
67
+ command: "/allow",
68
+ usage: "<tool>|list",
69
+ description: "allow a tool for this session (not persisted)",
70
+ },
71
+ {
72
+ command: "/disallow",
73
+ usage: "<tool>",
74
+ description: "revoke a session allow",
75
+ },
76
+ { command: "/think", description: "show thinking from last response" },
77
+ { command: "/thinking", description: "alias for /think" },
78
+ {
79
+ command: "/output",
80
+ usage: "[last|<id>|list]",
81
+ description: "open full tool output (Ctrl+O); q closes the pager",
82
+ },
83
+ {
84
+ command: "/freeonly",
85
+ usage: "[on|off]",
86
+ description: "skip paid providers when fallback is enabled",
87
+ },
88
+ {
89
+ command: "/fallback",
90
+ usage: "[on|off]",
91
+ description: "try other configured providers after a failure (off by default)",
92
+ },
93
+ { command: "/compact", description: "compact session history now" },
94
+ { command: "/context", description: "show estimated context size" },
95
+ {
96
+ command: "/plan",
97
+ description: "view the current session plan (also Ctrl+P)",
98
+ },
99
+ {
100
+ command: "/implement",
101
+ description: "approve the current plan and have clai execute it",
102
+ },
103
+ {
104
+ command: "/discard",
105
+ description: "discard the current plan so later messages ignore it",
106
+ },
107
+ {
108
+ command: "/scope",
109
+ usage: "[show|clear|new|add <targets>]",
110
+ description: "manage pentest engagement scope",
111
+ },
112
+ {
113
+ command: "/privacy",
114
+ usage: "[status|clear-history|clear-logs|clear-artifacts|clear-all|on|off]",
115
+ description: "control retention and private mode (in-memory only)",
116
+ },
117
+ { command: "/update", description: "check for updates" },
118
+ {
119
+ command: "/clean",
120
+ description: "clear screen and reset chat (fresh start)",
121
+ },
122
+ { command: "/exit", description: "quit" },
123
+ { command: "/quit", description: "alias for /exit" },
124
+ { command: "/help", description: "list commands" },
125
+ ];
126
+ // Well-known models per provider (refreshed May 2026)
127
+ /** Curated model choices used by both frontends. */
128
+ export const knownModels = {
129
+ groq: [
130
+ "openai/gpt-oss-20b",
131
+ "openai/gpt-oss-120b",
132
+ "openai/gpt-oss-safeguard-20b",
133
+ "qwen/qwen3-32b",
134
+ "llama-3.3-70b-versatile",
135
+ "llama-3.1-8b-instant",
136
+ "meta-llama/llama-4-scout-17b-16e-instruct",
137
+ "groq/compound-mini",
138
+ "groq/compound",
139
+ ],
140
+ gemini: [
141
+ "gemini-3.5-flash",
142
+ "gemini-3.1-pro-preview",
143
+ "gemini-3-flash-preview",
144
+ "gemini-3.1-flash-lite",
145
+ "gemini-3-pro-preview",
146
+ "gemini-2.5-pro",
147
+ "gemini-2.5-flash",
148
+ "gemini-2.5-flash-lite",
149
+ "gemini-2.0-flash",
150
+ "gemini-2.0-flash-lite",
151
+ ],
152
+ openrouter: [
153
+ "meta-llama/llama-3.3-70b-instruct:free",
154
+ "deepseek/deepseek-v4-flash:free",
155
+ "openai/gpt-oss-20b:free",
156
+ "qwen/qwen3-coder:free",
157
+ "qwen/qwen3-next-80b-a3b-instruct:free",
158
+ "google/gemma-4-31b-it:free",
159
+ "nvidia/nemotron-3-nano-30b-a3b:free",
160
+ "z-ai/glm-4.5-air:free",
161
+ "moonshotai/kimi-k2.6",
162
+ "meta-llama/llama-4-maverick",
163
+ "google/gemini-2.5-flash",
164
+ ],
165
+ openai: [
166
+ "gpt-5.5",
167
+ "gpt-5.5-pro",
168
+ "gpt-5.4",
169
+ "gpt-5.4-pro",
170
+ "gpt-5.4-mini",
171
+ "gpt-5.4-nano",
172
+ "gpt-rosalind",
173
+ "gpt-realtime-2",
174
+ "openai/gpt-oss-20b",
175
+ "openai/gpt-oss-120b",
176
+ "gpt-5",
177
+ "gpt-5-mini",
178
+ "gpt-5-nano",
179
+ "gpt-4o-mini",
180
+ "gpt-4o",
181
+ ],
182
+ anthropic: [
183
+ "claude-opus-4-7",
184
+ "claude-sonnet-4-6",
185
+ "claude-haiku-4-5",
186
+ "claude-opus-4-6",
187
+ "claude-sonnet-4-5",
188
+ "claude-3-5-sonnet-latest",
189
+ "claude-3-5-haiku-latest",
190
+ ],
191
+ nvidia: nvidiaFallbackModels,
192
+ ollama: [
193
+ "llama3.3:70b",
194
+ "llama3.2:3b",
195
+ "llama3.1:8b",
196
+ "qwen2.5:7b",
197
+ "qwen2.5-coder:7b",
198
+ "deepseek-r1:7b",
199
+ "mistral:7b",
200
+ "gemma3:9b",
201
+ "phi4:14b",
202
+ "codellama:7b",
203
+ ],
204
+ agentrouter: [
205
+ "claude-opus-4-6",
206
+ "claude-opus-4-7",
207
+ "claude-opus-4-8",
208
+ "glm-5.2",
209
+ "gpt-5.5",
210
+ ],
211
+ kimchi: [
212
+ "kimi-k2.6",
213
+ "minimax-m2.7",
214
+ "nemotron-3-super-fp4",
215
+ ],
216
+ "aws-mantle": [],
217
+ bynara: [
218
+ // Free tier models
219
+ "mimo-v2.5-free",
220
+ "mimo-v2.5-pro-free",
221
+ "mistral-large",
222
+ "mistral-medium-3-5",
223
+ // Pay-as-you-go / subscription models (from https://router.bynara.id/pricing)
224
+ "mimo-v2.5",
225
+ "mimo-v2.5-pro",
226
+ "mimo-v2.5-hermes",
227
+ "mimo-v2.5-pro-hermes",
228
+ "mimo-v2.5-pro-ultraspeed",
229
+ "claude-opus-4.7",
230
+ "claude-opus-4.8",
231
+ "claude-sonnet-4.6",
232
+ "claude-sonnet-4.5",
233
+ "claude-haiku-4.5",
234
+ "deepseek-v4-flash",
235
+ "deepseek-v4-pro",
236
+ "gemini-3-flash",
237
+ "gemini-3.1-pro",
238
+ "gemini-3.5-flash",
239
+ "gemini-2.5-flash",
240
+ "glm-5.1",
241
+ "glm-5.2",
242
+ "gpt-5.4",
243
+ "gpt-5.5",
244
+ "kimi-k2.6",
245
+ "kimi-k2.7-code",
246
+ "minimax-m3",
247
+ "qwen-3.7-max",
248
+ "qwen-3.7-plus",
249
+ "qwen-3.7-plus-1m",
250
+ "bynara-max",
251
+ ],
252
+ };
253
+ export function getKnownModels(provider) {
254
+ return [...(knownModels[provider] ?? [])];
255
+ }
256
+ /** Set of known slash-command names (without the leading "/"). */
257
+ const knownSlashNames = new Set(slashCommands.map((c) => c.command.slice(1).toLowerCase()));
258
+ /**
259
+ * Decide whether a line that starts with "/" is actually a slash command
260
+ * versus an absolute filesystem path the user typed or drag-dropped (e.g.
261
+ * `/Users/me/Desktop/Screenshot.png`). A real command is "/" + a single
262
+ * known command word (optionally followed by arguments). An absolute path
263
+ * has extra "/" segments in its first token and won't match a known command,
264
+ * so we route it to the normal prompt path where expandMentions() turns it
265
+ * into a file attachment.
266
+ */
267
+ export function looksLikeSlashCommand(line) {
268
+ if (!line.startsWith("/") || line.length < 2)
269
+ return false;
270
+ // First whitespace-delimited token, minus the leading slash.
271
+ const firstToken = line.slice(1).split(/\s/)[0] ?? "";
272
+ // A path-like first token (contains another "/" or a backslash escape, or
273
+ // looks like a filename with an extension) is never a command.
274
+ if (firstToken.includes("/") || firstToken.includes("\\"))
275
+ return false;
276
+ const name = firstToken.toLowerCase();
277
+ // Exact match against a known command, or a unique prefix of one (so
278
+ // partial typing like "/imp" still routes to the command handler, which
279
+ // already resolves abbreviations). Unknown words like a single-segment
280
+ // path token still fall through to handleSlash's "unknown command" help,
281
+ // which is the historical behavior for genuine typos.
282
+ if (knownSlashNames.has(name))
283
+ return true;
284
+ // Only treat as a (mistyped) command when it has no path/extension shape.
285
+ // "Users" alone (from "/Users") would be caught above by the "/" check,
286
+ // so here we accept bare alpha words as command attempts.
287
+ return /^[a-z][a-z0-9-]*$/i.test(firstToken);
288
+ }
289
+ export function slashCommandLabel(command) {
290
+ return command.usage
291
+ ? `${command.command} ${command.usage}`
292
+ : command.command;
293
+ }
294
+ export function slashCommandFilter(line) {
295
+ // Show the menu immediately on '/' so the user can see available commands,
296
+ // but let Enter submit a raw '/' unless they explicitly navigate the menu.
297
+ if (!line.startsWith("/") || line.length < 1 || /\s/.test(line))
298
+ return null;
299
+ // Don't show the command menu for an absolute path the user is typing or
300
+ // drag-dropped (e.g. "/Users/me/file.png"): a path's first token has more
301
+ // "/" or backslash escapes in it. Those go to the normal prompt path.
302
+ const firstToken = line.slice(1).split(/\s/)[0] ?? "";
303
+ if (firstToken.includes("/") || firstToken.includes("\\"))
304
+ return null;
305
+ return line.slice(1).toLowerCase();
306
+ }
307
+ export function getSlashCommandSuggestions(line) {
308
+ const filter = slashCommandFilter(line);
309
+ if (filter === null)
310
+ return [];
311
+ return slashCommands.filter((command) => command.command.slice(1).toLowerCase().startsWith(filter));
312
+ }
313
+ export function isKnownSlashCommand(command) {
314
+ const normalized = command.trim().split(/\s+/, 1)[0]?.toLowerCase();
315
+ return slashCommands.some((item) => item.command === normalized);
316
+ }
317
+ //# sourceMappingURL=slash-commands.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"slash-commands.js","sourceRoot":"","sources":["../../src/repl/slash-commands.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,kBAAkB,CAAC;AAQxD,8EAA8E;AAC9E,MAAM,CAAC,MAAM,aAAa,GAAmB;IAC3C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zE,0EAA0E;IAC1E,sEAAsE;IACtE,MAAM,UAAU,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC;IACtD,IAAI,UAAU,CAAC,QAAQ,CAAC,GAAG,CAAC,IAAI,UAAU,CAAC,QAAQ,CAAC,IAAI,CAAC;QAAE,OAAO,IAAI,CAAC;IACvE,OAAO,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,WAAW,EAAE,CAAC;AACrC,CAAC;AAED,MAAM,UAAU,0BAA0B,CAAC,IAAY;IACrD,MAAM,MAAM,GAAG,kBAAkB,CAAC,IAAI,CAAC,CAAC;IACxC,IAAI,MAAM,KAAK,IAAI;QAAE,OAAO,EAAE,CAAC;IAC/B,OAAO,aAAa,CAAC,MAAM,CAAC,CAAC,OAAO,EAAE,EAAE,CACtC,OAAO,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,WAAW,EAAE,CAAC,UAAU,CAAC,MAAM,CAAC,CAC1D,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,mBAAmB,CAAC,OAAe;IACjD,MAAM,UAAU,GAAG,OAAO,CAAC,IAAI,EAAE,CAAC,KAAK,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,WAAW,EAAE,CAAC;IACpE,OAAO,aAAa,CAAC,IAAI,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,OAAO,KAAK,UAAU,CAAC,CAAC;AACnE,CAAC"}
package/dist/repl.d.ts CHANGED
@@ -1,33 +1,10 @@
1
1
  import type { Mode, ProviderId } from "./types.js";
2
- import { type FileSuggestion } from "./ui/mentions.js";
2
+ export { slashCommands, knownModels, getKnownModels, looksLikeSlashCommand, getSlashCommandSuggestions, isKnownSlashCommand, type SlashCommand, } from "./repl/slash-commands.js";
3
+ export { renderSlashCommandMenu, renderFileMentionMenu, } from "./repl/prompt-line.js";
3
4
  export interface ReplOptions {
4
5
  mode?: Mode | undefined;
5
6
  provider?: ProviderId | undefined;
6
7
  model?: string | undefined;
7
8
  noHistory?: boolean | undefined;
8
9
  }
9
- export interface SlashCommand {
10
- command: string;
11
- usage?: string;
12
- description: string;
13
- }
14
- /** Shared command catalogue used by both the classic REPL and the Ink TUI. */
15
- export declare const slashCommands: SlashCommand[];
16
- /** Curated model choices used by both frontends. */
17
- export declare const knownModels: Record<string, string[]>;
18
- export declare function getKnownModels(provider: string): string[];
19
- /**
20
- * Decide whether a line that starts with "/" is actually a slash command
21
- * versus an absolute filesystem path the user typed or drag-dropped (e.g.
22
- * `/Users/me/Desktop/Screenshot.png`). A real command is "/" + a single
23
- * known command word (optionally followed by arguments). An absolute path
24
- * has extra "/" segments in its first token and won't match a known command,
25
- * so we route it to the normal prompt path where expandMentions() turns it
26
- * into a file attachment.
27
- */
28
- export declare function looksLikeSlashCommand(line: string): boolean;
29
- export declare function getSlashCommandSuggestions(line: string): SlashCommand[];
30
- export declare function isKnownSlashCommand(command: string): boolean;
31
- export declare function renderSlashCommandMenu(line: string, suggestions: SlashCommand[], selectedIndex: number): string[];
32
- export declare function renderFileMentionMenu(query: string, suggestions: FileSuggestion[], selectedIndex: number): string[];
33
10
  export declare function startRepl(options?: ReplOptions): Promise<void>;