kaze-cli 2.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 (91) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +224 -0
  3. package/dist/api/client.d.ts +15 -0
  4. package/dist/api/client.d.ts.map +1 -0
  5. package/dist/api/client.js +129 -0
  6. package/dist/api/client.js.map +1 -0
  7. package/dist/api/universal-client.d.ts +36 -0
  8. package/dist/api/universal-client.d.ts.map +1 -0
  9. package/dist/api/universal-client.js +184 -0
  10. package/dist/api/universal-client.js.map +1 -0
  11. package/dist/cli/config-command.d.ts +29 -0
  12. package/dist/cli/config-command.d.ts.map +1 -0
  13. package/dist/cli/config-command.js +458 -0
  14. package/dist/cli/config-command.js.map +1 -0
  15. package/dist/cli/repl.d.ts +98 -0
  16. package/dist/cli/repl.d.ts.map +1 -0
  17. package/dist/cli/repl.js +1782 -0
  18. package/dist/cli/repl.js.map +1 -0
  19. package/dist/config/interactive-setup.d.ts +26 -0
  20. package/dist/config/interactive-setup.d.ts.map +1 -0
  21. package/dist/config/interactive-setup.js +308 -0
  22. package/dist/config/interactive-setup.js.map +1 -0
  23. package/dist/config/manager.d.ts +125 -0
  24. package/dist/config/manager.d.ts.map +1 -0
  25. package/dist/config/manager.js +240 -0
  26. package/dist/config/manager.js.map +1 -0
  27. package/dist/config/setup.d.ts +29 -0
  28. package/dist/config/setup.d.ts.map +1 -0
  29. package/dist/config/setup.js +442 -0
  30. package/dist/config/setup.js.map +1 -0
  31. package/dist/context/memory.d.ts +65 -0
  32. package/dist/context/memory.d.ts.map +1 -0
  33. package/dist/context/memory.js +215 -0
  34. package/dist/context/memory.js.map +1 -0
  35. package/dist/index.d.ts +2 -0
  36. package/dist/index.d.ts.map +1 -0
  37. package/dist/index.js +207 -0
  38. package/dist/index.js.map +1 -0
  39. package/dist/mcp/client.d.ts +38 -0
  40. package/dist/mcp/client.d.ts.map +1 -0
  41. package/dist/mcp/client.js +288 -0
  42. package/dist/mcp/client.js.map +1 -0
  43. package/dist/mcp/manager.d.ts +43 -0
  44. package/dist/mcp/manager.d.ts.map +1 -0
  45. package/dist/mcp/manager.js +230 -0
  46. package/dist/mcp/manager.js.map +1 -0
  47. package/dist/mcp/types.d.ts +106 -0
  48. package/dist/mcp/types.d.ts.map +1 -0
  49. package/dist/mcp/types.js +3 -0
  50. package/dist/mcp/types.js.map +1 -0
  51. package/dist/personality/manager.d.ts +24 -0
  52. package/dist/personality/manager.d.ts.map +1 -0
  53. package/dist/personality/manager.js +217 -0
  54. package/dist/personality/manager.js.map +1 -0
  55. package/dist/tools/codebase.d.ts +34 -0
  56. package/dist/tools/codebase.d.ts.map +1 -0
  57. package/dist/tools/codebase.js +291 -0
  58. package/dist/tools/codebase.js.map +1 -0
  59. package/dist/tools/filesystem.d.ts +41 -0
  60. package/dist/tools/filesystem.d.ts.map +1 -0
  61. package/dist/tools/filesystem.js +263 -0
  62. package/dist/tools/filesystem.js.map +1 -0
  63. package/dist/tools/terminal.d.ts +30 -0
  64. package/dist/tools/terminal.d.ts.map +1 -0
  65. package/dist/tools/terminal.js +217 -0
  66. package/dist/tools/terminal.js.map +1 -0
  67. package/dist/tools/todo.d.ts +58 -0
  68. package/dist/tools/todo.d.ts.map +1 -0
  69. package/dist/tools/todo.js +233 -0
  70. package/dist/tools/todo.js.map +1 -0
  71. package/dist/types/index.d.ts +104 -0
  72. package/dist/types/index.d.ts.map +1 -0
  73. package/dist/types/index.js +3 -0
  74. package/dist/types/index.js.map +1 -0
  75. package/dist/types/personality.d.ts +21 -0
  76. package/dist/types/personality.d.ts.map +1 -0
  77. package/dist/types/personality.js +3 -0
  78. package/dist/types/personality.js.map +1 -0
  79. package/dist/ui/logger.d.ts +76 -0
  80. package/dist/ui/logger.d.ts.map +1 -0
  81. package/dist/ui/logger.js +488 -0
  82. package/dist/ui/logger.js.map +1 -0
  83. package/dist/ui/renderer.d.ts +52 -0
  84. package/dist/ui/renderer.d.ts.map +1 -0
  85. package/dist/ui/renderer.js +294 -0
  86. package/dist/ui/renderer.js.map +1 -0
  87. package/dist/ui/tui.d.ts +53 -0
  88. package/dist/ui/tui.d.ts.map +1 -0
  89. package/dist/ui/tui.js +131 -0
  90. package/dist/ui/tui.js.map +1 -0
  91. package/package.json +70 -0
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,OAAO;IACtB,IAAI,EAAE,QAAQ,GAAG,MAAM,GAAG,WAAW,GAAG,MAAM,CAAC;IAC/C,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,CAAC,EAAE,QAAQ,EAAE,CAAC;IACxB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AACD,MAAM,WAAW,QAAQ;IACvB,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,UAAU,CAAC;IACjB,QAAQ,EAAE;QACR,IAAI,EAAE,MAAM,CAAC;QACb,SAAS,EAAE,MAAM,CAAC;KACnB,CAAC;CACH;AACD,MAAM,WAAW,IAAI;IACnB,IAAI,EAAE,UAAU,CAAC;IACjB,QAAQ,EAAE;QACR,IAAI,EAAE,MAAM,CAAC;QACb,WAAW,EAAE,MAAM,CAAC;QACpB,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;KACjC,CAAC;CACH;AACD,MAAM,WAAW,cAAc;IAC7B,IAAI,EAAE,SAAS,GAAG,UAAU,CAAC;CAC9B;AACD,MAAM,WAAW,qBAAqB;IACpC,QAAQ,EAAE,OAAO,EAAE,CAAC;IACpB,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,IAAI,EAAE,CAAC;IACf,WAAW,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG;QAAE,IAAI,EAAE,UAAU,CAAA;KAAE,CAAC;IACrD,QAAQ,CAAC,EAAE,cAAc,CAAC;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AAC;IACjB,MAAM,EAAE,GAAG,CAAC;IACZ,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AACD,MAAM,WAAW,UAAU;IACzB,OAAO,EAAE,OAAO,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AACD,MAAM,WAAW,WAAW;IAC1B,OAAO,EAAE,OAAO,CAAC;IACjB,WAAW,EAAE,OAAO,CAAC;IACrB,kBAAkB,EAAE,OAAO,CAAC;IAC5B,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE;QACL,SAAS,EAAE,UAAU,CAAC;QACtB,SAAS,EAAE,UAAU,CAAC;QACtB,UAAU,EAAE,UAAU,CAAC;QACvB,YAAY,EAAE,UAAU,CAAC;QACzB,eAAe,EAAE,UAAU,CAAC;QAC5B,WAAW,EAAE,UAAU,CAAC;KACzB,CAAC;CACH"}
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":""}
@@ -0,0 +1,21 @@
1
+ export interface Personality {
2
+ name: string;
3
+ description: string;
4
+ systemPrompt: string;
5
+ temperature?: number;
6
+ maxTokens?: number;
7
+ version: string;
8
+ author?: string;
9
+ tags?: string[];
10
+ metadata?: Record<string, any>;
11
+ }
12
+ export interface PersonalityRegistry {
13
+ personalities: Map<string, Personality>;
14
+ customProfilesPath: string;
15
+ }
16
+ export interface PersonalityImportOptions {
17
+ url?: string;
18
+ path?: string;
19
+ overwrite?: boolean;
20
+ }
21
+ //# sourceMappingURL=personality.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"personality.d.ts","sourceRoot":"","sources":["../../src/types/personality.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,WAAW;IAC1B,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,YAAY,EAAE,MAAM,CAAC;IACrB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,IAAI,CAAC,EAAE,MAAM,EAAE,CAAC;IAChB,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;CAChC;AACD,MAAM,WAAW,mBAAmB;IAClC,aAAa,EAAE,GAAG,CAAC,MAAM,EAAE,WAAW,CAAC,CAAC;IACxC,kBAAkB,EAAE,MAAM,CAAC;CAC5B;AACD,MAAM,WAAW,wBAAwB;IACvC,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB"}
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=personality.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"personality.js","sourceRoot":"","sources":["../../src/types/personality.ts"],"names":[],"mappings":""}
@@ -0,0 +1,76 @@
1
+ export declare const THEME: {
2
+ readonly cyan: "#22d3ee";
3
+ readonly purple: "#a855f7";
4
+ readonly pink: "#f0abfc";
5
+ readonly indigo: "#6366f1";
6
+ readonly teal: "#10b981";
7
+ readonly dim: "#64748b";
8
+ readonly bg: "#0f172a";
9
+ readonly gradientStart: "#f0abfc";
10
+ readonly gradientEnd: "#6366f1";
11
+ };
12
+ export declare enum LogLevel {
13
+ DEBUG = 0,
14
+ INFO = 1,
15
+ SUCCESS = 2,
16
+ WARNING = 3,
17
+ ERROR = 4,
18
+ CRITICAL = 5,
19
+ TRACE = -1
20
+ }
21
+ export interface LogOptions {
22
+ level?: LogLevel;
23
+ }
24
+ interface EditProgress {
25
+ step: 'reading' | 'searching' | 'diffing' | 'applying' | 'saving' | 'done';
26
+ current: number;
27
+ total: number;
28
+ message: string;
29
+ }
30
+ interface BannerInfo {
31
+ version?: string;
32
+ model?: string;
33
+ mcpStatus?: string;
34
+ }
35
+ export declare class Logger {
36
+ private logLevel;
37
+ private thinkingSpinner;
38
+ private isThinking;
39
+ private currentEditProgress;
40
+ constructor(options?: LogOptions);
41
+ banner(info?: BannerInfo): void;
42
+ debug(message: string, ...args: any[]): void;
43
+ trace(message: string, ...args: any[]): void;
44
+ info(message: string, ...args: any[]): void;
45
+ success(message: string, ...args: any[]): void;
46
+ warning(message: string, ...args: any[]): void;
47
+ error(message: string, ...args: any[]): void;
48
+ toolAction(toolName: string, action: string, params?: string | object): void;
49
+ readFileAction(filePath: string, lines: number, _size: number): void;
50
+ writeFileAction(filePath: string, lines: number, _size: number): void;
51
+ editFileAction(filePath: string, linesAdded: number, linesRemoved: number): void;
52
+ searchFilesAction(query: string, searchMode: string, resultsFound: number, filesSearched: number): void;
53
+ executeCommandAction(command: string, exitCode: number | null, _duration: number): void;
54
+ searchCodeAction(query: string, _matchesFound: number, language?: string): void;
55
+ permissionRequest(toolName: string, action: string, params?: object): void;
56
+ startThinking(): void;
57
+ stopThinking(): void;
58
+ step(stepNum: number, totalSteps: number, message: string): void;
59
+ section(title: string): void;
60
+ divider(char?: string, length?: number): void;
61
+ raw(message: string): void;
62
+ markdown(text: string): void;
63
+ private processMarkdownLine;
64
+ code(code: string, language?: string): void;
65
+ private highlightSyntax;
66
+ fileEdit(original: string, modified: string, filePath?: string): void;
67
+ inlineDiff(original: string, modified: string, filePath?: string): void;
68
+ diffSummary(original: string, modified: string, filePath?: string): void;
69
+ editProgress(step: EditProgress['step'], current: number, total: number, message: string): void;
70
+ editStep(stepNum: number, _total: number, message: string, status?: 'pending' | 'active' | 'done' | 'error'): void;
71
+ liveDiff(filePath: string, original: string, search: string, replace: string): void;
72
+ setLogLevel(level: LogLevel): void;
73
+ clear(): void;
74
+ }
75
+ export {};
76
+ //# sourceMappingURL=logger.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"logger.d.ts","sourceRoot":"","sources":["../../src/ui/logger.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,KAAK;;;;;;;;;;CAUR,CAAC;AACX,oBAAY,QAAQ;IAClB,KAAK,IAAI;IACT,IAAI,IAAI;IACR,OAAO,IAAI;IACX,OAAO,IAAI;IACX,KAAK,IAAI;IACT,QAAQ,IAAI;IACZ,KAAK,KAAK;CACX;AACD,MAAM,WAAW,UAAU;IACzB,KAAK,CAAC,EAAE,QAAQ,CAAC;CAClB;AACD,UAAU,YAAY;IACpB,IAAI,EAAE,SAAS,GAAG,WAAW,GAAG,SAAS,GAAG,UAAU,GAAG,QAAQ,GAAG,MAAM,CAAC;IAC3E,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,MAAM,CAAC;CACjB;AACD,UAAU,UAAU;IAClB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAsGD,qBAAa,MAAM;IACjB,OAAO,CAAC,QAAQ,CAAW;IAC3B,OAAO,CAAC,eAAe,CAAkB;IACzC,OAAO,CAAC,UAAU,CAAS;IAC3B,OAAO,CAAC,mBAAmB,CAA6B;gBAC5C,OAAO,GAAE,UAAe;IAIpC,MAAM,CAAC,IAAI,CAAC,EAAE,UAAU,GAAG,IAAI;IAG/B,KAAK,CAAC,OAAO,EAAE,MAAM,EAAE,GAAG,IAAI,EAAE,GAAG,EAAE,GAAG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EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,IAAI;IA8DnF,WAAW,CAAC,KAAK,EAAE,QAAQ,GAAG,IAAI;IAGlC,KAAK,IAAI,IAAI;CAGd"}
@@ -0,0 +1,488 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || (function () {
19
+ var ownKeys = function(o) {
20
+ ownKeys = Object.getOwnPropertyNames || function (o) {
21
+ var ar = [];
22
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
+ return ar;
24
+ };
25
+ return ownKeys(o);
26
+ };
27
+ return function (mod) {
28
+ if (mod && mod.__esModule) return mod;
29
+ var result = {};
30
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
+ __setModuleDefault(result, mod);
32
+ return result;
33
+ };
34
+ })();
35
+ var __importDefault = (this && this.__importDefault) || function (mod) {
36
+ return (mod && mod.__esModule) ? mod : { "default": mod };
37
+ };
38
+ Object.defineProperty(exports, "__esModule", { value: true });
39
+ exports.Logger = exports.LogLevel = exports.THEME = void 0;
40
+ const chalk_1 = __importDefault(require("chalk"));
41
+ const diff = __importStar(require("diff"));
42
+ exports.THEME = {
43
+ cyan: '#22d3ee',
44
+ purple: '#a855f7',
45
+ pink: '#f0abfc',
46
+ indigo: '#6366f1',
47
+ teal: '#10b981',
48
+ dim: '#64748b',
49
+ bg: '#0f172a',
50
+ gradientStart: '#f0abfc',
51
+ gradientEnd: '#6366f1'
52
+ };
53
+ var LogLevel;
54
+ (function (LogLevel) {
55
+ LogLevel[LogLevel["DEBUG"] = 0] = "DEBUG";
56
+ LogLevel[LogLevel["INFO"] = 1] = "INFO";
57
+ LogLevel[LogLevel["SUCCESS"] = 2] = "SUCCESS";
58
+ LogLevel[LogLevel["WARNING"] = 3] = "WARNING";
59
+ LogLevel[LogLevel["ERROR"] = 4] = "ERROR";
60
+ LogLevel[LogLevel["CRITICAL"] = 5] = "CRITICAL";
61
+ LogLevel[LogLevel["TRACE"] = -1] = "TRACE";
62
+ })(LogLevel || (exports.LogLevel = LogLevel = {}));
63
+ function renderBanner(info) {
64
+ const { cyan, purple, pink, indigo, dim } = exports.THEME;
65
+ const w = process.stdout.columns || 80;
66
+ const title = chalk_1.default.hex(pink).bold('Kaze™');
67
+ const ver = info?.version ? chalk_1.default.dim(` v${info.version} `) : chalk_1.default.dim(' ');
68
+ const label = `${title}${ver}`;
69
+ const labelLen = label.length;
70
+ const sideLen = Math.floor((w - labelLen) / 2);
71
+ const dash = (n) => chalk_1.default.hex(purple)('─'.repeat(Math.max(0, n)));
72
+ console.log('');
73
+ console.log(dash(sideLen) + ' ' + label + ' ' + dash(Math.max(0, w - sideLen - labelLen - 2)));
74
+ const bigKAZE = [
75
+ '██╗ ██╗ █████╗ ███████╗███████╗',
76
+ '██║ ██╔╝██╔══██╗╚══███╔╝██╔════╝',
77
+ '█████╔╝ ███████║ ███╔╝ █████╗ ',
78
+ '██╔═██╗ ██╔══██║ ███╔╝ ██╔══╝ ',
79
+ '██║ ██╗██║ ██║███████╗███████╗ ',
80
+ '╚═╝ ╚═╝╚═╝ ╚═╝╚══════╝╚══════╝',
81
+ ];
82
+ const rowColors = ['#f0abfc', '#d946ef', '#a855f7', '#8b5cf6', '#6366f1', '#6366f1'];
83
+ const logoW = bigKAZE[0].length;
84
+ const logoSide = Math.floor((w - logoW) / 2);
85
+ for (let i = 0; i < bigKAZE.length; i++) {
86
+ const colored = bigKAZE[i];
87
+ const pad = ' '.repeat(Math.max(0, logoSide));
88
+ process.stdout.write(pad + chalk_1.default.hex(rowColors[i]).bold(colored) + '\n');
89
+ }
90
+ console.log(dash(w));
91
+ if (info?.model || info?.mcpStatus) {
92
+ if (info?.model) {
93
+ console.log(chalk_1.default.dim(' ') + chalk_1.default.dim(info.model));
94
+ }
95
+ if (info?.mcpStatus) {
96
+ const statusColor = info.mcpStatus.includes('connected') ? exports.THEME.teal : exports.THEME.dim;
97
+ console.log(chalk_1.default.dim(' ') + chalk_1.default.hex(statusColor)(info.mcpStatus));
98
+ }
99
+ }
100
+ }
101
+ class ThinkingSpinner {
102
+ interval = null;
103
+ dotCount = 0;
104
+ lastLineLength = 0;
105
+ start() {
106
+ this.stop();
107
+ this.dotCount = 0;
108
+ this.interval = setInterval(() => {
109
+ this.dotCount = (this.dotCount + 1) % 4;
110
+ this.render();
111
+ }, 300);
112
+ this.render();
113
+ }
114
+ stop() {
115
+ if (this.interval) {
116
+ clearInterval(this.interval);
117
+ this.interval = null;
118
+ }
119
+ this.clearLine();
120
+ }
121
+ render() {
122
+ this.clearLine();
123
+ const dots = '.'.repeat(this.dotCount);
124
+ const line = chalk_1.default.hex(exports.THEME.cyan)('> ') + chalk_1.default.dim('Thinking' + dots);
125
+ this.lastLineLength = ('> Thinking' + dots).length;
126
+ process.stdout.write(line);
127
+ }
128
+ clearLine() {
129
+ if (this.lastLineLength > 0) {
130
+ process.stdout.write('\r' + ' '.repeat(this.lastLineLength + 4) + '\r');
131
+ this.lastLineLength = 0;
132
+ }
133
+ }
134
+ }
135
+ function renderPermissionDialog(toolName, path, params) {
136
+ const width = 60;
137
+ const border = chalk_1.default.hex('#a855f7');
138
+ console.log('');
139
+ console.log(border('┌' + '─'.repeat(width) + '┐'));
140
+ console.log(border('│') + ' ' + chalk_1.default.hex('#a855f7')('Permission Required') + ' '.repeat(width - 21) + ' ' + border('│'));
141
+ console.log(border('│') + ' '.repeat(width) + border('│'));
142
+ console.log(border('│') + ' ' + chalk_1.default.white('Tool ') + chalk_1.default.bold.white(toolName) + chalk_1.default.dim(' → ') + chalk_1.default.bold.white(path) + ' '.repeat(Math.max(0, width - toolName.length - path.length - 9)) + border('│'));
143
+ console.log(border('│') + ' ' + chalk_1.default.dim('Path') + ' ' + chalk_1.default.white('~') + ' '.repeat(width - 8) + border('│'));
144
+ console.log(border('│') + ' '.repeat(width) + border('│'));
145
+ const paramStr = JSON.stringify(params, null, 2);
146
+ const paramLines = paramStr.split('\n');
147
+ console.log(border('│') + ' ' + chalk_1.default.dim('┌' + '─'.repeat(width - 4) + '┐') + ' ' + border('│'));
148
+ for (const line of paramLines) {
149
+ const padded = (' │ ' + line).padEnd(width + 1);
150
+ console.log(border('│') + chalk_1.default.dim(padded) + border('│'));
151
+ }
152
+ console.log(border('│') + ' ' + chalk_1.default.dim('└' + '─'.repeat(width - 4) + '┘') + ' ' + border('│'));
153
+ console.log(border('│') + ' '.repeat(width) + border('│'));
154
+ const allow = chalk_1.default.bgHex('#d946ef').black(' Allow ');
155
+ const session = chalk_1.default.bgHex('#374151').white(' Allow for Session ');
156
+ const deny = chalk_1.default.bgHex('#1f2937').white(' Deny ');
157
+ const btnLine = ` ${allow} ${session} ${deny}`;
158
+ console.log(border('│') + btnLine + ' '.repeat(Math.max(0, width - 40)) + border('│'));
159
+ console.log(border('│') + ' '.repeat(width) + border('│'));
160
+ console.log(border('│') + ' ' + chalk_1.default.dim('</> choose • enter confirm • esc exit') + ' '.repeat(width - 43) + border('│'));
161
+ console.log(border('└' + '─'.repeat(width) + '┘'));
162
+ console.log('');
163
+ }
164
+ class Logger {
165
+ logLevel;
166
+ thinkingSpinner;
167
+ isThinking = false;
168
+ currentEditProgress = null;
169
+ constructor(options = {}) {
170
+ this.logLevel = options.level ?? LogLevel.INFO;
171
+ this.thinkingSpinner = new ThinkingSpinner();
172
+ }
173
+ banner(info) {
174
+ renderBanner(info);
175
+ }
176
+ debug(message, ...args) {
177
+ if (this.logLevel <= LogLevel.DEBUG) {
178
+ console.log(chalk_1.default.hex(exports.THEME.purple)('[DEBUG]'), message, ...args);
179
+ }
180
+ }
181
+ trace(message, ...args) {
182
+ if (this.logLevel <= LogLevel.TRACE) {
183
+ console.log(chalk_1.default.hex(exports.THEME.dim)('[TRACE]'), message, ...args);
184
+ }
185
+ }
186
+ info(message, ...args) {
187
+ if (this.logLevel <= LogLevel.INFO) {
188
+ console.log(chalk_1.default.hex(exports.THEME.cyan)('[INFO]'), message, ...args);
189
+ }
190
+ }
191
+ success(message, ...args) {
192
+ if (this.logLevel <= LogLevel.SUCCESS) {
193
+ console.log(chalk_1.default.hex(exports.THEME.teal)('[SUCCESS]'), message, ...args);
194
+ }
195
+ }
196
+ warning(message, ...args) {
197
+ if (this.logLevel <= LogLevel.WARNING) {
198
+ console.log(chalk_1.default.yellow('[WARNING]'), message, ...args);
199
+ }
200
+ }
201
+ error(message, ...args) {
202
+ if (this.logLevel <= LogLevel.ERROR) {
203
+ console.log(chalk_1.default.red('[ERROR]'), message, ...args);
204
+ }
205
+ }
206
+ toolAction(toolName, action, params) {
207
+ const dot = chalk_1.default.hex(exports.THEME.teal)('●');
208
+ const name = chalk_1.default.hex(exports.THEME.cyan)(toolName);
209
+ const arrow = chalk_1.default.dim('→');
210
+ const act = chalk_1.default.hex(exports.THEME.cyan)(action);
211
+ let paramStr = '';
212
+ if (params) {
213
+ const raw = typeof params === 'string' ? params : JSON.stringify(params);
214
+ const maxLen = 60;
215
+ paramStr = ' ' + chalk_1.default.dim(raw.length > maxLen ? raw.slice(0, maxLen - 3) + '...' : raw);
216
+ }
217
+ console.log(`${dot} ${name} ${arrow} ${act}${paramStr}`);
218
+ }
219
+ readFileAction(filePath, lines, _size) {
220
+ this.toolAction('Read File', 'Read file contents', { file: filePath, lines });
221
+ }
222
+ writeFileAction(filePath, lines, _size) {
223
+ this.toolAction('Write File', 'Write content to file', { file: filePath, lines });
224
+ }
225
+ editFileAction(filePath, linesAdded, linesRemoved) {
226
+ this.toolAction('Edit File', 'Edit a file using search and replace', { file: filePath, '+': linesAdded, '-': linesRemoved });
227
+ }
228
+ searchFilesAction(query, searchMode, resultsFound, filesSearched) {
229
+ this.toolAction('Search Files', 'Search for files by name or content', { query, mode: searchMode, found: resultsFound });
230
+ }
231
+ executeCommandAction(command, exitCode, _duration) {
232
+ this.toolAction('Execute Command', 'Run shell commands', { command, exit: exitCode });
233
+ }
234
+ searchCodeAction(query, _matchesFound, language) {
235
+ this.toolAction('Search Code', 'Search codebase using semantic search', language ? { query, language } : { query });
236
+ }
237
+ permissionRequest(toolName, action, params = {}) {
238
+ renderPermissionDialog(toolName, action, params);
239
+ }
240
+ startThinking() {
241
+ if (this.isThinking)
242
+ return;
243
+ this.isThinking = true;
244
+ this.thinkingSpinner.start();
245
+ }
246
+ stopThinking() {
247
+ if (this.isThinking) {
248
+ this.thinkingSpinner.stop();
249
+ this.isThinking = false;
250
+ }
251
+ }
252
+ step(stepNum, totalSteps, message) {
253
+ console.log(chalk_1.default.hex(exports.THEME.cyan)(`[${stepNum}/${totalSteps}]`) + ' ' + message);
254
+ }
255
+ section(title) {
256
+ console.log(chalk_1.default.dim('• ') + chalk_1.default.hex(exports.THEME.purple)(title));
257
+ }
258
+ divider(char = '·', length = 60) {
259
+ console.log(chalk_1.default.hex(exports.THEME.dim)(char.repeat(length)));
260
+ }
261
+ raw(message) {
262
+ console.log(message);
263
+ }
264
+ markdown(text) {
265
+ const lines = text.split('\n');
266
+ let inCodeBlock = false;
267
+ let codeLanguage = '';
268
+ let codeContent = [];
269
+ for (const line of lines) {
270
+ const codeMatch = line.match(/^```(\w+)?$/);
271
+ if (codeMatch) {
272
+ if (inCodeBlock) {
273
+ this.code(codeContent.join('\n'), codeLanguage || 'text');
274
+ codeContent = [];
275
+ inCodeBlock = false;
276
+ }
277
+ else {
278
+ inCodeBlock = true;
279
+ codeLanguage = codeMatch[1] || 'text';
280
+ }
281
+ }
282
+ else if (inCodeBlock) {
283
+ codeContent.push(line);
284
+ }
285
+ else {
286
+ const processed = this.processMarkdownLine(line);
287
+ if (processed)
288
+ console.log(processed);
289
+ }
290
+ }
291
+ if (inCodeBlock)
292
+ this.code(codeContent.join('\n'), codeLanguage || 'text');
293
+ }
294
+ processMarkdownLine(line) {
295
+ if (!line.trim())
296
+ return null;
297
+ let p = line;
298
+ p = p.replace(/^###\s+(.+)$/, (_, t) => chalk_1.default.hex('#a855f7')('### ' + t));
299
+ p = p.replace(/^##\s+(.+)$/, (_, t) => chalk_1.default.hex('#8b5cf6')('## ' + t));
300
+ p = p.replace(/^#\s+(.+)$/, (_, t) => chalk_1.default.bold.hex('#6366f1')('# ' + t));
301
+ p = p.replace(/\*\*(.+?)\*\*/g, (_, t) => chalk_1.default.bold(t));
302
+ p = p.replace(/\*(.+?)\*/g, (_, t) => chalk_1.default.italic(t));
303
+ p = p.replace(/`(.+?)`/g, (_, t) => chalk_1.default.dim('`' + t + '`'));
304
+ p = p.replace(/^[-*]\s+(.+)$/, (_, item) => ' • ' + item);
305
+ p = p.replace(/^\d+\.\s+(.+)$/, (_, item) => ' • ' + item);
306
+ p = p.replace(/^>\s+(.+)$/, (_, q) => chalk_1.default.dim('│ ' + q));
307
+ return p;
308
+ }
309
+ code(code, language = 'text') {
310
+ const lines = code.split('\n');
311
+ const padding = lines.length.toString().length;
312
+ console.log(chalk_1.default.dim(language));
313
+ lines.forEach((line, i) => {
314
+ const lineNum = (i + 1).toString().padStart(padding);
315
+ console.log(chalk_1.default.dim(lineNum + '│ ') + this.highlightSyntax(line, language));
316
+ });
317
+ }
318
+ highlightSyntax(line, language) {
319
+ const lang = language.toLowerCase();
320
+ if (lang === 'javascript' || lang === 'typescript') {
321
+ return line
322
+ .replace(/(const|let|var|function|return|if|else|for|while|class|import|export|from|async|await|try|catch|new|this|typeof|interface|type|extends|implements)/g, chalk_1.default.hex('#c586c0')('$1'))
323
+ .replace(/(".*?"|'.*?'|`.*?`)/g, chalk_1.default.hex('#ce9178')('$1'))
324
+ .replace(/(\d+)/g, chalk_1.default.hex('#b5cea8')('$1'))
325
+ .replace(/(\/\/.*$)/gm, chalk_1.default.gray('$1'));
326
+ }
327
+ if (lang === 'python') {
328
+ return line
329
+ .replace(/(def|class|if|elif|else|for|while|return|import|from|as|try|except|with|True|False|None)/g, chalk_1.default.hex('#569cd6')('$1'))
330
+ .replace(/(".*?"|'.*?')/g, chalk_1.default.hex('#ce9178')('$1'))
331
+ .replace(/(#.*$)/gm, chalk_1.default.gray('$1'));
332
+ }
333
+ if (lang === 'bash' || lang === 'sh') {
334
+ return line
335
+ .replace(/(#.*$)/gm, chalk_1.default.gray('$1'))
336
+ .replace(/(\$\w+)/g, chalk_1.default.hex('#4ec9b0')('$1'))
337
+ .replace(/\b(sudo|npm|yarn|pip|python|node|git|ls|cd|mkdir|rm|cp|mv|cat|echo)\b/g, chalk_1.default.hex('#c586c0')('$1'));
338
+ }
339
+ if (lang === 'json') {
340
+ return line
341
+ .replace(/(".*?"):/g, chalk_1.default.hex('#9cdcfe')('$1') + chalk_1.default.gray(':'))
342
+ .replace(/:\s*(".*?")/g, ': ' + chalk_1.default.hex('#ce9178')('$1'))
343
+ .replace(/:\s*(\d+|true|false|null)/g, ': ' + chalk_1.default.hex('#b5cea8')('$1'));
344
+ }
345
+ if (lang === 'sql') {
346
+ return line
347
+ .replace(/\b(SELECT|FROM|WHERE|INSERT|UPDATE|DELETE|JOIN|LEFT|RIGHT|INNER|GROUP|ORDER|BY|HAVING|LIMIT|AND|OR|NOT|IN|IS|NULL|AS)\b/gi, chalk_1.default.hex('#569cd6')('$1'))
348
+ .replace(/(--.*$)/gm, chalk_1.default.gray('$1'));
349
+ }
350
+ return chalk_1.default.white(line);
351
+ }
352
+ fileEdit(original, modified, filePath) {
353
+ this.diffSummary(original, modified, filePath);
354
+ }
355
+ inlineDiff(original, modified, filePath) {
356
+ if (filePath) {
357
+ console.log('');
358
+ console.log(chalk_1.default.hex('#22d3ee')('diff: ' + filePath));
359
+ }
360
+ const parts = diff.diffWordsWithSpace(original, modified);
361
+ let out = '';
362
+ for (const p of parts) {
363
+ if (p.added)
364
+ out += chalk_1.default.bgGreen.black(p.value);
365
+ else if (p.removed)
366
+ out += chalk_1.default.bgRed.white(p.value);
367
+ else
368
+ out += p.value;
369
+ }
370
+ console.log(out);
371
+ }
372
+ diffSummary(original, modified, filePath) {
373
+ const result = diff.diffLines(original, modified);
374
+ const added = result.reduce((n, p) => n + (p.added ? p.value.split('\n').length - 1 : 0), 0);
375
+ const removed = result.reduce((n, p) => n + (p.removed ? p.value.split('\n').length - 1 : 0), 0);
376
+ console.log('');
377
+ console.log(chalk_1.default.dim('┌─ Diff Summary'));
378
+ console.log(chalk_1.default.dim('│'));
379
+ console.log(` ${chalk_1.default.green('+' + added)} added, ${chalk_1.default.red('-' + removed)} removed`);
380
+ console.log(` ${chalk_1.default.white((added + removed) + ' total changes')}`);
381
+ if (filePath)
382
+ console.log(` ${chalk_1.default.dim('File:')} ${chalk_1.default.white(filePath)}`);
383
+ console.log(chalk_1.default.dim('│'));
384
+ console.log(chalk_1.default.dim('└─'));
385
+ }
386
+ editProgress(step, current, total, message) {
387
+ const pct = total > 0 ? Math.round((current / total) * 100) : 0;
388
+ const bar = chalk_1.default.green('█'.repeat(Math.round(pct / 5))) + chalk_1.default.gray('░'.repeat(20 - Math.round(pct / 5)));
389
+ const icon = step === 'done' ? chalk_1.default.green('✓') : chalk_1.default.hex('#22d3ee')('○');
390
+ const stepColor = step === 'done' ? chalk_1.default.green : chalk_1.default.hex('#22d3ee');
391
+ const line = ` ${icon} ${stepColor(step.padEnd(10))} ${bar} ${chalk_1.default.white(pct + '%')} ${chalk_1.default.dim(`(${current}/${total})`)}`;
392
+ if (this.currentEditProgress) {
393
+ process.stdout.write('\r' + ' '.repeat(process.stdout.columns ?? 80) + '\r');
394
+ }
395
+ process.stdout.write(line);
396
+ this.currentEditProgress = { step, current, total, message };
397
+ if (step === 'done') {
398
+ process.stdout.write('\n');
399
+ console.log(chalk_1.default.dim(` └─ ${message}`));
400
+ this.currentEditProgress = null;
401
+ }
402
+ }
403
+ editStep(stepNum, _total, message, status = 'pending') {
404
+ const icons = { pending: '○', active: '◉', done: '✓', error: '✗' };
405
+ const colors = {
406
+ pending: chalk_1.default.gray,
407
+ active: chalk_1.default.hex('#22d3ee'),
408
+ done: chalk_1.default.green,
409
+ error: chalk_1.default.red,
410
+ };
411
+ console.log(` ${colors[status](icons[status])} ${message}`);
412
+ }
413
+ liveDiff(filePath, original, search, replace) {
414
+ this.editProgress('searching', 0, 4, 'Initializing...');
415
+ setTimeout(() => {
416
+ this.editProgress('searching', 1, 4, 'Finding pattern...');
417
+ const modified = original.replace(search, replace);
418
+ this.editProgress('applying', 2, 4, 'Replacement applied');
419
+ const result = diff.diffLines(original, modified);
420
+ this.editProgress('diffing', 3, 4, 'Computing changes...');
421
+ const originalLines = original.split('\n');
422
+ const modifiedLines = modified.split('\n');
423
+ const output = [];
424
+ let hasChanges = false;
425
+ let origIdx = 0;
426
+ let modIdx = 0;
427
+ for (const part of result) {
428
+ const lines = part.value.split('\n').filter((l, i, a) => !(i === a.length - 1 && l === ''));
429
+ if (part.removed) {
430
+ hasChanges = true;
431
+ for (let i = origIdx; i < origIdx + lines.length; i++) {
432
+ const wd = diff.diffWordsWithSpace(originalLines[i] ?? '', modifiedLines[i] ?? '');
433
+ let lineOut = '';
434
+ for (const d of wd) {
435
+ if (d.added)
436
+ lineOut += chalk_1.default.bgGreen.black(d.value);
437
+ else if (d.removed)
438
+ lineOut += chalk_1.default.bgRed.white(d.value);
439
+ else
440
+ lineOut += d.value;
441
+ }
442
+ output.push(chalk_1.default.red('- ') + lineOut);
443
+ }
444
+ origIdx += lines.length;
445
+ }
446
+ else if (part.added) {
447
+ hasChanges = true;
448
+ for (const line of lines) {
449
+ output.push(chalk_1.default.green('+ ') + line);
450
+ modIdx++;
451
+ }
452
+ }
453
+ else {
454
+ origIdx += lines.length;
455
+ modIdx += lines.length;
456
+ }
457
+ }
458
+ this.editProgress('done', 4, 4, 'Preview complete');
459
+ if (!hasChanges) {
460
+ console.log('');
461
+ console.log(chalk_1.default.yellow(' ! No changes would be made'));
462
+ return;
463
+ }
464
+ console.log('');
465
+ console.log(chalk_1.default.dim('┌─ Search & Replace'));
466
+ console.log(chalk_1.default.dim('│'));
467
+ console.log(` ${chalk_1.default.yellow('Finding:')} ${chalk_1.default.dim(search)}`);
468
+ console.log(` ${chalk_1.default.green('Replacing:')} ${chalk_1.default.dim(replace)}`);
469
+ console.log(chalk_1.default.dim('│'));
470
+ console.log(chalk_1.default.dim('├─ Preview'));
471
+ console.log('');
472
+ output.forEach(l => console.log(l));
473
+ console.log('');
474
+ console.log(chalk_1.default.dim('└─'));
475
+ const added = result.reduce((n, p) => n + (p.added ? p.value.split('\n').length - 1 : 0), 0);
476
+ const removed = result.reduce((n, p) => n + (p.removed ? p.value.split('\n').length - 1 : 0), 0);
477
+ console.log(chalk_1.default.dim(` +${added} -${removed} lines in preview`));
478
+ }, 50);
479
+ }
480
+ setLogLevel(level) {
481
+ this.logLevel = level;
482
+ }
483
+ clear() {
484
+ console.clear();
485
+ }
486
+ }
487
+ exports.Logger = Logger;
488
+ //# sourceMappingURL=logger.js.map