@pentoshi/clai 0.8.2 → 0.9.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 (48) hide show
  1. package/dist/agent/loop-guard.d.ts +43 -0
  2. package/dist/agent/loop-guard.js +75 -0
  3. package/dist/agent/loop-guard.js.map +1 -0
  4. package/dist/agent/progress.d.ts +14 -0
  5. package/dist/agent/progress.js +112 -0
  6. package/dist/agent/progress.js.map +1 -0
  7. package/dist/agent/runner.js +57 -9
  8. package/dist/agent/runner.js.map +1 -1
  9. package/dist/agent/task-analyzer.d.ts +13 -0
  10. package/dist/agent/task-analyzer.js +158 -0
  11. package/dist/agent/task-analyzer.js.map +1 -0
  12. package/dist/agent/task-plan.d.ts +37 -0
  13. package/dist/agent/task-plan.js +98 -0
  14. package/dist/agent/task-plan.js.map +1 -0
  15. package/dist/prompts/index.d.ts +1 -1
  16. package/dist/prompts/index.js +20 -1
  17. package/dist/prompts/index.js.map +1 -1
  18. package/dist/safety/classifier.js +64 -0
  19. package/dist/safety/classifier.js.map +1 -1
  20. package/dist/safety/path-permissions.d.ts +14 -0
  21. package/dist/safety/path-permissions.js +43 -0
  22. package/dist/safety/path-permissions.js.map +1 -0
  23. package/dist/tools/capabilities.d.ts +11 -0
  24. package/dist/tools/capabilities.js +136 -0
  25. package/dist/tools/capabilities.js.map +1 -0
  26. package/dist/tools/command-intent.d.ts +11 -0
  27. package/dist/tools/command-intent.js +61 -0
  28. package/dist/tools/command-intent.js.map +1 -0
  29. package/dist/tools/fs.d.ts +10 -0
  30. package/dist/tools/fs.js +73 -2
  31. package/dist/tools/fs.js.map +1 -1
  32. package/dist/tools/jobs.d.ts +28 -0
  33. package/dist/tools/jobs.js +161 -0
  34. package/dist/tools/jobs.js.map +1 -0
  35. package/dist/tools/net-ping-sweep.d.ts +24 -0
  36. package/dist/tools/net-ping-sweep.js +205 -0
  37. package/dist/tools/net-ping-sweep.js.map +1 -0
  38. package/dist/tools/network-context.d.ts +26 -0
  39. package/dist/tools/network-context.js +138 -0
  40. package/dist/tools/network-context.js.map +1 -0
  41. package/dist/tools/registry.js +43 -1
  42. package/dist/tools/registry.js.map +1 -1
  43. package/dist/tools/shell.js +3 -3
  44. package/dist/tools/shell.js.map +1 -1
  45. package/dist/ui/task-pane.d.ts +17 -0
  46. package/dist/ui/task-pane.js +80 -0
  47. package/dist/ui/task-pane.js.map +1 -0
  48. package/package.json +1 -1
@@ -0,0 +1,17 @@
1
+ import type { TaskPlan } from "../agent/task-plan.js";
2
+ /**
3
+ * Render the task plan as an inline block for the terminal. Called after
4
+ * each tool result to show current progress. The output is compact:
5
+ * typically 3-8 lines for a standard plan.
6
+ */
7
+ export declare function renderTaskPane(plan: TaskPlan): string;
8
+ /**
9
+ * Render a minimal one-line progress bar suitable for inserting between
10
+ * tool calls. Shows just the current step.
11
+ */
12
+ export declare function renderProgressLine(plan: TaskPlan): string;
13
+ /**
14
+ * Format the full plan for `/tasks` or `/plan` slash commands.
15
+ * More detailed than the inline progress pane.
16
+ */
17
+ export declare function renderTaskPaneDetailed(plan: TaskPlan): string;
@@ -0,0 +1,80 @@
1
+ import chalk from "chalk";
2
+ const STATUS_ICONS = {
3
+ pending: chalk.gray("·"),
4
+ running: chalk.cyan("▶"),
5
+ done: chalk.green("✓"),
6
+ failed: chalk.red("✗"),
7
+ skipped: chalk.dim("↷"),
8
+ };
9
+ const STATUS_LABELS = {
10
+ pending: chalk.gray("pending"),
11
+ running: chalk.cyan("running"),
12
+ done: chalk.green("done"),
13
+ failed: chalk.red("failed"),
14
+ skipped: chalk.dim("skipped"),
15
+ };
16
+ function formatStep(step, index) {
17
+ const icon = STATUS_ICONS[step.status];
18
+ const label = step.title;
19
+ const note = step.notes ? chalk.dim(` — ${step.notes}`) : "";
20
+ return ` ${icon} ${chalk.dim(`${index + 1}.`)} ${label}${note}`;
21
+ }
22
+ /**
23
+ * Render the task plan as an inline block for the terminal. Called after
24
+ * each tool result to show current progress. The output is compact:
25
+ * typically 3-8 lines for a standard plan.
26
+ */
27
+ export function renderTaskPane(plan) {
28
+ const lines = [];
29
+ const total = plan.steps.length;
30
+ const done = plan.steps.filter((s) => s.status === "done").length;
31
+ const failed = plan.steps.filter((s) => s.status === "failed").length;
32
+ const pct = total > 0 ? Math.round(((done + failed) / total) * 100) : 0;
33
+ lines.push(chalk.bold(` 📋 ${plan.goal}`) +
34
+ chalk.dim(` [${done}/${total}] ${pct}%`));
35
+ for (let i = 0; i < plan.steps.length; i += 1) {
36
+ lines.push(formatStep(plan.steps[i], i));
37
+ }
38
+ return lines.join("\n");
39
+ }
40
+ /**
41
+ * Render a minimal one-line progress bar suitable for inserting between
42
+ * tool calls. Shows just the current step.
43
+ */
44
+ export function renderProgressLine(plan) {
45
+ const current = plan.steps.find((s) => s.status === "running");
46
+ if (!current)
47
+ return "";
48
+ const idx = plan.steps.indexOf(current) + 1;
49
+ const total = plan.steps.length;
50
+ return chalk.dim(` ◉ step ${idx}/${total}: ${current.title}`);
51
+ }
52
+ /**
53
+ * Format the full plan for `/tasks` or `/plan` slash commands.
54
+ * More detailed than the inline progress pane.
55
+ */
56
+ export function renderTaskPaneDetailed(plan) {
57
+ const lines = [];
58
+ const total = plan.steps.length;
59
+ const done = plan.steps.filter((s) => s.status === "done").length;
60
+ lines.push(chalk.bold.underline(`Plan: ${plan.goal}`));
61
+ lines.push(chalk.dim(` complexity: ${plan.complexity} | progress: ${done}/${total}`));
62
+ lines.push("");
63
+ for (let i = 0; i < plan.steps.length; i += 1) {
64
+ const step = plan.steps[i];
65
+ const icon = STATUS_ICONS[step.status];
66
+ const status = STATUS_LABELS[step.status];
67
+ lines.push(` ${icon} ${chalk.dim(`${i + 1}.`)} ${step.title} ${chalk.dim(`[${status}]`)}`);
68
+ if (step.toolHint) {
69
+ lines.push(chalk.dim(` tool: ${step.toolHint}`));
70
+ }
71
+ if (step.notes) {
72
+ lines.push(chalk.dim(` note: ${step.notes}`));
73
+ }
74
+ if (step.successCriteria) {
75
+ lines.push(chalk.dim(` done when: ${step.successCriteria}`));
76
+ }
77
+ }
78
+ return lines.join("\n");
79
+ }
80
+ //# sourceMappingURL=task-pane.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"task-pane.js","sourceRoot":"","sources":["../../src/ui/task-pane.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,MAAM,YAAY,GAA+B;IAC/C,OAAO,EAAE,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC;IACxB,OAAO,EAAE,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC;IACxB,IAAI,EAAE,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC;IACtB,MAAM,EAAE,KAAK,CAAC,GAAG,CAAC,GAAG,CAAC;IACtB,OAAO,EAAE,KAAK,CAAC,GAAG,CAAC,GAAG,CAAC;CACxB,CAAC;AAEF,MAAM,aAAa,GAA+B;IAChD,OAAO,EAAE,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC;IAC9B,OAAO,EAAE,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC;IAC9B,IAAI,EAAE,KAAK,CAAC,KAAK,CAAC,MAAM,CAAC;IACzB,MAAM,EAAE,KAAK,CAAC,GAAG,CAAC,QAAQ,CAAC;IAC3B,OAAO,EAAE,KAAK,CAAC,GAAG,CAAC,SAAS,CAAC;CAC9B,CAAC;AAEF,SAAS,UAAU,CAAC,IAAc,EAAE,KAAa;IAC/C,MAAM,IAAI,GAAG,YAAY,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;IACvC,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC;IACzB,MAAM,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,MAAM,IAAI,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;IAC7D,OAAO,KAAK,IAAI,IAAI,KAAK,CAAC,GAAG,CAAC,GAAG,KAAK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5B,MAAM,IAAI,GAAG,YAAY,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;QACvC,MAAM,MAAM,GAAG,aAAa,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;QAC1C,KAAK,CAAC,IAAI,CAAC,KAAK,IAAI,IAAI,KAAK,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,IAAI,IAAI,CAAC,KAAK,IAAI,KAAK,CAAC,GAAG,CAAC,IAAI,MAAM,GAAG,CAAC,EAAE,CAAC,CAAC;QAC5F,IAAI,IAAI,CAAC,QAAQ,EAAE,CAAC;YAClB,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,eAAe,IAAI,CAAC,QAAQ,EAAE,CAAC,CAAC,CAAC;QACxD,CAAC;QACD,IAAI,IAAI,CAAC,KAAK,EAAE,CAAC;YACf,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,eAAe,IAAI,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC;QACrD,CAAC;QACD,IAAI,IAAI,CAAC,eAAe,EAAE,CAAC;YACzB,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,oBAAoB,IAAI,CAAC,eAAe,EAAE,CAAC,CAAC,CAAC;QACpE,CAAC;IACH,CAAC;IACD,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AAC1B,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pentoshi/clai",
3
- "version": "0.8.2",
3
+ "version": "0.9.0",
4
4
  "description": "A fast, cross-platform AI CLI assistant with ask and agent modes for shell tasks, file operations, and cybersecurity workflows.",
5
5
  "type": "module",
6
6
  "license": "MIT",