centaurus-cli 2.0.1 → 2.0.2

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 (103) hide show
  1. package/CONFIG_GUIDE.md +100 -106
  2. package/README.md +68 -63
  3. package/dist/cli-adapter.d.ts +9 -3
  4. package/dist/cli-adapter.d.ts.map +1 -1
  5. package/dist/cli-adapter.js +123 -164
  6. package/dist/cli-adapter.js.map +1 -1
  7. package/dist/commands/CommandParser.d.ts +1 -1
  8. package/dist/commands/CommandParser.d.ts.map +1 -1
  9. package/dist/commands/CommandParser.js +3 -18
  10. package/dist/commands/CommandParser.js.map +1 -1
  11. package/dist/commands/view-duplication-logs.d.ts +5 -0
  12. package/dist/commands/view-duplication-logs.d.ts.map +1 -0
  13. package/dist/commands/view-duplication-logs.js +14 -0
  14. package/dist/commands/view-duplication-logs.js.map +1 -0
  15. package/dist/config/ConfigManager.d.ts +10 -7
  16. package/dist/config/ConfigManager.d.ts.map +1 -1
  17. package/dist/config/ConfigManager.js +43 -142
  18. package/dist/config/ConfigManager.js.map +1 -1
  19. package/dist/config/defaultConfig.d.ts +0 -4
  20. package/dist/config/defaultConfig.d.ts.map +1 -1
  21. package/dist/config/defaultConfig.js +1 -6
  22. package/dist/config/defaultConfig.js.map +1 -1
  23. package/dist/config/manager.d.ts +15 -13
  24. package/dist/config/manager.d.ts.map +1 -1
  25. package/dist/config/manager.js +52 -41
  26. package/dist/config/manager.js.map +1 -1
  27. package/dist/config/models.d.ts +31 -0
  28. package/dist/config/models.d.ts.map +1 -0
  29. package/dist/config/models.js +49 -0
  30. package/dist/config/models.js.map +1 -0
  31. package/dist/config/types.d.ts +0 -3
  32. package/dist/config/types.d.ts.map +1 -1
  33. package/dist/config/types.js +0 -1
  34. package/dist/config/types.js.map +1 -1
  35. package/dist/index.js +27 -1
  36. package/dist/index.js.map +1 -1
  37. package/dist/prompts/system-prompt.d.ts +1 -1
  38. package/dist/prompts/system-prompt.d.ts.map +1 -1
  39. package/dist/prompts/system-prompt.js +0 -1
  40. package/dist/prompts/system-prompt.js.map +1 -1
  41. package/dist/services/ai-service-client.d.ts +82 -0
  42. package/dist/services/ai-service-client.d.ts.map +1 -0
  43. package/dist/services/ai-service-client.js +254 -0
  44. package/dist/services/ai-service-client.js.map +1 -0
  45. package/dist/services/api-client.js +3 -3
  46. package/dist/services/api-client.js.map +1 -1
  47. package/dist/tools/ToolRegistry.d.ts +14 -3
  48. package/dist/tools/ToolRegistry.d.ts.map +1 -1
  49. package/dist/tools/ToolRegistry.js +46 -34
  50. package/dist/tools/ToolRegistry.js.map +1 -1
  51. package/dist/tools/command.d.ts.map +1 -1
  52. package/dist/tools/command.js +17 -3
  53. package/dist/tools/command.js.map +1 -1
  54. package/dist/tools/file-ops.js +3 -3
  55. package/dist/tools/file-ops.js.map +1 -1
  56. package/dist/tools/web-search.js +2 -2
  57. package/dist/tools/web-search.js.map +1 -1
  58. package/dist/types/index.d.ts +1 -0
  59. package/dist/types/index.d.ts.map +1 -1
  60. package/dist/ui/components/App.d.ts +3 -2
  61. package/dist/ui/components/App.d.ts.map +1 -1
  62. package/dist/ui/components/App.js +107 -16
  63. package/dist/ui/components/App.js.map +1 -1
  64. package/dist/ui/components/CodeBlock.d.ts.map +1 -1
  65. package/dist/ui/components/CodeBlock.js +15 -3
  66. package/dist/ui/components/CodeBlock.js.map +1 -1
  67. package/dist/ui/components/ConfirmPrompt.d.ts.map +1 -1
  68. package/dist/ui/components/ConfirmPrompt.js +32 -20
  69. package/dist/ui/components/ConfirmPrompt.js.map +1 -1
  70. package/dist/ui/components/DiffViewer.d.ts.map +1 -1
  71. package/dist/ui/components/DiffViewer.js +16 -2
  72. package/dist/ui/components/DiffViewer.js.map +1 -1
  73. package/dist/ui/components/InputBox.d.ts.map +1 -1
  74. package/dist/ui/components/InputBox.js +26 -9
  75. package/dist/ui/components/InputBox.js.map +1 -1
  76. package/dist/ui/components/LoadingIndicator.d.ts.map +1 -1
  77. package/dist/ui/components/LoadingIndicator.js +6 -2
  78. package/dist/ui/components/LoadingIndicator.js.map +1 -1
  79. package/dist/ui/components/MarkdownRenderer.d.ts.map +1 -1
  80. package/dist/ui/components/MarkdownRenderer.js +8 -12
  81. package/dist/ui/components/MarkdownRenderer.js.map +1 -1
  82. package/dist/ui/components/StreamingMessageDisplay.d.ts +6 -7
  83. package/dist/ui/components/StreamingMessageDisplay.d.ts.map +1 -1
  84. package/dist/ui/components/StreamingMessageDisplay.js +69 -12
  85. package/dist/ui/components/StreamingMessageDisplay.js.map +1 -1
  86. package/dist/ui/components/ToolExecutionMessage.d.ts.map +1 -1
  87. package/dist/ui/components/ToolExecutionMessage.js +44 -16
  88. package/dist/ui/components/ToolExecutionMessage.js.map +1 -1
  89. package/dist/ui/components/WelcomeBanner.d.ts.map +1 -1
  90. package/dist/ui/components/WelcomeBanner.js.map +1 -1
  91. package/dist/ui/utils/duplication-detector.d.ts +32 -0
  92. package/dist/ui/utils/duplication-detector.d.ts.map +1 -0
  93. package/dist/ui/utils/duplication-detector.js +227 -0
  94. package/dist/ui/utils/duplication-detector.js.map +1 -0
  95. package/dist/ui/utils/duplication-logger.d.ts +21 -0
  96. package/dist/ui/utils/duplication-logger.d.ts.map +1 -0
  97. package/dist/ui/utils/duplication-logger.js +85 -0
  98. package/dist/ui/utils/duplication-logger.js.map +1 -0
  99. package/dist/ui/utils/terminal-scanner.d.ts +19 -0
  100. package/dist/ui/utils/terminal-scanner.d.ts.map +1 -0
  101. package/dist/ui/utils/terminal-scanner.js +217 -0
  102. package/dist/ui/utils/terminal-scanner.js.map +1 -0
  103. package/package.json +2 -5
@@ -1 +1 @@
1
- {"version":3,"file":"manager.js","sourceRoot":"","sources":["../../src/config/manager.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,IAAI,CAAC;AACzB,OAAO,KAAK,IAAI,MAAM,MAAM,CAAC;AAC7B,OAAO,KAAK,EAAE,MAAM,IAAI,CAAC;AACzB,OAAO,EAAU,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,CAAC,CAAC;IACL,CAAC;IAED;;OAEG;IACH,QAAQ,CAAC,KAAa;QACpB,IAAI,CAAC,YAAY,CAAC,KAAK,CAAC,EAAE,CAAC;YACzB,MAAM,IAAI,KAAK,CAAC,oBAAoB,CAAC,KAAK,CAAC,CAAC,CAAC;QAC/C,CAAC;QACD,IAAI,CAAC,GAAG,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC;IAC3B,CAAC;IAED;;OAEG;IACH,MAAM;QACJ,OAAO,IAAI,CAAC,IAAI,EAAE,CAAC;IACrB,CAAC;IAED;;OAEG;IACH,UAAU;QACR,MAAM,MAAM,GAAG,IAAI,CAAC,IAAI,EAAE,CAAC;QAC3B,OAAO,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC;IACxB,CAAC;IAED;;OAEG;IACH,aAAa;QACX,OAAO,IAAI,CAAC,UAAU,CAAC;IACzB,CAAC;IAED;;;OAGG;IACH,qBAAqB;QACnB,OAAO,IAAI,CAAC,kBAAkB,CAAC;IACjC,CAAC;IAED;;OAEG;IACH,kBAAkB;QAChB,IAAI,CAAC,kBAAkB,GAAG,KAAK,CAAC;IAClC,CAAC;CACF"}
@@ -0,0 +1,31 @@
1
+ /**
2
+ * Supported AI models
3
+ * Must match backend validation
4
+ */
5
+ /**
6
+ * List of supported Google AI models
7
+ */
8
+ export declare const SUPPORTED_MODELS: readonly ["gemini-2.5-flash", "gemini-2.5-pro", "gemini-2.0-flash-exp", "gemini-1.5-flash", "gemini-1.5-pro"];
9
+ /**
10
+ * Type for supported model names
11
+ */
12
+ export type SupportedModel = typeof SUPPORTED_MODELS[number];
13
+ /**
14
+ * Validate if a model name is supported
15
+ * @param model - Model name to validate
16
+ * @returns true if model is supported, false otherwise
17
+ */
18
+ export declare function isValidModel(model: string): model is SupportedModel;
19
+ /**
20
+ * Get a user-friendly error message for invalid models
21
+ * @param invalidModel - The invalid model name
22
+ * @returns Error message with list of valid models
23
+ */
24
+ export declare function getInvalidModelError(invalidModel: string): string;
25
+ /**
26
+ * Get model display name with description
27
+ * @param model - Model name
28
+ * @returns Display name with description
29
+ */
30
+ export declare function getModelDisplayName(model: SupportedModel): string;
31
+ //# sourceMappingURL=models.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"models.d.ts","sourceRoot":"","sources":["../../src/config/models.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;GAEG;AACH,eAAO,MAAM,gBAAgB,+GAMnB,CAAC;AAEX;;GAEG;AACH,MAAM,MAAM,cAAc,GAAG,OAAO,gBAAgB,CAAC,MAAM,CAAC,CAAC;AAE7D;;;;GAIG;AACH,wBAAgB,YAAY,CAAC,KAAK,EAAE,MAAM,GAAG,KAAK,IAAI,cAAc,CAEnE;AAED;;;;GAIG;AACH,wBAAgB,oBAAoB,CAAC,YAAY,EAAE,MAAM,GAAG,MAAM,CAKjE;AAED;;;;GAIG;AACH,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,cAAc,GAAG,MAAM,CAUjE"}
@@ -0,0 +1,49 @@
1
+ /**
2
+ * Supported AI models
3
+ * Must match backend validation
4
+ */
5
+ /**
6
+ * List of supported Google AI models
7
+ */
8
+ export const SUPPORTED_MODELS = [
9
+ 'gemini-2.5-flash',
10
+ 'gemini-2.5-pro',
11
+ 'gemini-2.0-flash-exp',
12
+ 'gemini-1.5-flash',
13
+ 'gemini-1.5-pro',
14
+ ];
15
+ /**
16
+ * Validate if a model name is supported
17
+ * @param model - Model name to validate
18
+ * @returns true if model is supported, false otherwise
19
+ */
20
+ export function isValidModel(model) {
21
+ return SUPPORTED_MODELS.includes(model);
22
+ }
23
+ /**
24
+ * Get a user-friendly error message for invalid models
25
+ * @param invalidModel - The invalid model name
26
+ * @returns Error message with list of valid models
27
+ */
28
+ export function getInvalidModelError(invalidModel) {
29
+ return `Invalid model: ${invalidModel}\n\n` +
30
+ `Supported Google models:\n` +
31
+ SUPPORTED_MODELS.map(m => ` - ${m}`).join('\n') +
32
+ `\n\nUse /model to select from available models.`;
33
+ }
34
+ /**
35
+ * Get model display name with description
36
+ * @param model - Model name
37
+ * @returns Display name with description
38
+ */
39
+ export function getModelDisplayName(model) {
40
+ const descriptions = {
41
+ 'gemini-2.5-flash': 'Gemini 2.5 Flash - Fast and efficient',
42
+ 'gemini-2.5-pro': 'Gemini 2.5 Pro - Most capable',
43
+ 'gemini-2.0-flash-exp': 'Gemini 2.0 Flash (Experimental) - Latest features',
44
+ 'gemini-1.5-flash': 'Gemini 1.5 Flash - Reliable and fast',
45
+ 'gemini-1.5-pro': 'Gemini 1.5 Pro - Advanced reasoning',
46
+ };
47
+ return descriptions[model] || model;
48
+ }
49
+ //# sourceMappingURL=models.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"models.js","sourceRoot":"","sources":["../../src/config/models.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;GAEG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAG;IAC9B,kBAAkB;IAClB,gBAAgB;IAChB,sBAAsB;IACtB,kBAAkB;IAClB,gBAAgB;CACR,CAAC;AAOX;;;;GAIG;AACH,MAAM,UAAU,YAAY,CAAC,KAAa;IACxC,OAAO,gBAAgB,CAAC,QAAQ,CAAC,KAAuB,CAAC,CAAC;AAC5D,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,oBAAoB,CAAC,YAAoB;IACvD,OAAO,kBAAkB,YAAY,MAAM;QACzC,4BAA4B;QAC5B,gBAAgB,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC;QAChD,iDAAiD,CAAC;AACtD,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,mBAAmB,CAAC,KAAqB;IACvD,MAAM,YAAY,GAAmC;QACnD,kBAAkB,EAAE,uCAAuC;QAC3D,gBAAgB,EAAE,+BAA+B;QACjD,sBAAsB,EAAE,mDAAmD;QAC3E,kBAAkB,EAAE,sCAAsC;QAC1D,gBAAgB,EAAE,qCAAqC;KACxD,CAAC;IAEF,OAAO,YAAY,CAAC,KAAK,CAAC,IAAI,KAAK,CAAC;AACtC,CAAC"}
@@ -1,8 +1,5 @@
1
1
  export interface Config {
2
- provider: 'google' | 'openrouter';
3
2
  model: string;
4
- googleApiKey?: string;
5
- openrouterApiKey?: string;
6
3
  autoApprove?: boolean;
7
4
  }
8
5
  export declare const DEFAULT_CONFIG: Partial<Config>;
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/config/types.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,MAAM;IACrB,QAAQ,EAAE,QAAQ,GAAG,YAAY,CAAC;IAClC,KAAK,EAAE,MAAM,CAAC;IACd,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,WAAW,CAAC,EAAE,OAAO,CAAC;CACvB;AAED,eAAO,MAAM,cAAc,EAAE,OAAO,CAAC,MAAM,CAI1C,CAAC"}
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/config/types.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,MAAM;IACrB,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,CAAC,EAAE,OAAO,CAAC;CACvB;AAED,eAAO,MAAM,cAAc,EAAE,OAAO,CAAC,MAAM,CAG1C,CAAC"}
@@ -1,5 +1,4 @@
1
1
  export const DEFAULT_CONFIG = {
2
- provider: 'google',
3
2
  model: 'gemini-2.0-flash-exp',
4
3
  autoApprove: false,
5
4
  };
@@ -1 +1 @@
1
- {"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/config/types.ts"],"names":[],"mappings":"AAQA,MAAM,CAAC,MAAM,cAAc,GAAoB;IAC7C,QAAQ,EAAE,QAAQ;IAClB,KAAK,EAAE,sBAAsB;IAC7B,WAAW,EAAE,KAAK;CACnB,CAAC"}
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/config/types.ts"],"names":[],"mappings":"AAKA,MAAM,CAAC,MAAM,cAAc,GAAoB;IAC7C,KAAK,EAAE,sBAAsB;IAC7B,WAAW,EAAE,KAAK;CACnB,CAAC"}
package/dist/index.js CHANGED
@@ -1,6 +1,14 @@
1
1
  #!/usr/bin/env node
2
2
  // Load environment variables from .env file
3
3
  import { config } from 'dotenv';
4
+ import { fileURLToPath } from 'url';
5
+ import { dirname, join } from 'path';
6
+ const __filename = fileURLToPath(import.meta.url);
7
+ const __dirname = dirname(__filename);
8
+ // Try to load .env from multiple locations
9
+ // 1. From the package root (when running from dist/)
10
+ config({ path: join(__dirname, '..', '.env') });
11
+ // 2. From current working directory (for development)
4
12
  config();
5
13
  import React from 'react';
6
14
  import { render } from 'ink';
@@ -57,9 +65,23 @@ async function main() {
57
65
  const cli = new CentaurusCLI();
58
66
  // Initialize CLI (load config, register tools)
59
67
  await cli.initialize();
68
+ // Check if configuration migration occurred and show message
69
+ const migrationMessage = cli.getMigrationMessage();
70
+ if (migrationMessage) {
71
+ console.log(migrationMessage);
72
+ // Wait for user to press Enter
73
+ await new Promise((resolve) => {
74
+ process.stdin.once('data', () => {
75
+ resolve();
76
+ });
77
+ });
78
+ }
79
+ // Clear the terminal before starting the UI
80
+ process.stdout.write('\x1b[2J\x1b[3J\x1b[H');
60
81
  // Render Ink app with error boundary
61
82
  // patchConsole: false prevents console.log from interfering with Ink's rendering
62
83
  // This is CRITICAL for Static component to work properly
84
+ // debug: false reduces flickering by disabling debug output
63
85
  const { waitUntilExit } = render(React.createElement(ErrorBoundary, null, React.createElement(App, {
64
86
  onMessage: (msg) => cli.handleMessage(msg),
65
87
  initialModel: cli.getModel(),
@@ -67,6 +89,9 @@ async function main() {
67
89
  onResponseReceived: (callback) => {
68
90
  cli.setOnResponseCallback(callback);
69
91
  },
92
+ onResponseStream: (callback) => {
93
+ cli.setOnResponseStreamCallback(callback);
94
+ },
70
95
  onPickerSetup: (callback) => {
71
96
  cli.setOnShowPickerCallback(callback);
72
97
  },
@@ -90,7 +115,8 @@ async function main() {
90
115
  }
91
116
  })), {
92
117
  patchConsole: false,
93
- exitOnCtrlC: false
118
+ exitOnCtrlC: false,
119
+ debug: false
94
120
  });
95
121
  // Wait for user to exit
96
122
  await waitUntilExit();
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAEA,4CAA4C;AAC5C,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAChC,MAAM,EAAE,CAAC;AAET,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,MAAM,EAAE,MAAM,KAAK,CAAC;AAC7B,OAAO,EAAE,GAAG,EAAE,MAAM,wBAAwB,CAAC;AAC7C,OAAO,EAAE,aAAa,EAAE,MAAM,kCAAkC,CAAC;AACjE,OAAO,EAAE,iBAAiB,EAAE,MAAM,sCAAsC,CAAC;AACzE,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAChD,OAAO,EAAE,SAAS,EAAE,MAAM,0BAA0B,CAAC;AACrD,OAAO,EAAE,sBAAsB,EAAE,MAAM,4BAA4B,CAAC;AAGpE,KAAK,UAAU,oBAAoB;IACjC,iCAAiC;IACjC,IAAI,SAAS,CAAC,eAAe,EAAE,EAAE,CAAC;QAChC,OAAO,IAAI,CAAC;IACd,CAAC;IAED,IAAI,CAAC;QACH,gCAAgC;QAChC,uEAAuE;QACvE,MAAM,SAAS,CAAC,WAAW,EAAE,CAAC;IAChC,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,OAAO,CAAC,GAAG,CAAC,qCAAqC,CAAC,CAAC;QACnD,OAAO,CAAC,GAAG,CAAC,iCAAiC,CAAC,CAAC;QAC/C,OAAO,IAAI,CAAC,CAAC,kCAAkC;IACjD,CAAC;IAED,iDAAiD;IACjD,OAAO,IAAI,OAAO,CAAU,CAAC,OAAO,EAAE,EAAE;QACtC,MAAM,EAAE,aAAa,EAAE,KAAK,EAA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CAAC;QACzC,CAAC;QACD,qBAAqB,EAAE,CAAC,QAA6P,EAAE,EAAE;YACvR,GAAG,CAAC,wBAAwB,CAAC,QAAQ,CAAC,CAAC;QACzC,CAAC;QACD,qBAAqB,EAAE,CAAC,QAA0F,EAAE,EAAE;YACpH,GAAG,CAAC,wBAAwB,CAAC,QAAQ,CAAC,CAAC;QACzC,CAAC;QACD,gBAAgB,EAAE,CAAC,QAAqC,EAAE,EAAE;YAC1D,GAAG,CAAC,mBAAmB,CAAC,QAAQ,CAAC,CAAC;QACpC,CAAC;QACD,qBAAqB,EAAE,CAAC,QAA2E,EAAE,EAAE;YACrG,GAAG,CAAC,wBAAwB,CAAC,QAAQ,CAAC,CAAC;QACzC,CAAC;KACF,CAAC,CACH,EACD;QACE,YAAY,EAAE,KAAK;QACnB,WAAW,EAAE,KAAK;QAClB,KAAK,EAAE,KAAK;KACb,CACF,CAAC;IAEF,wBAAwB;IACxB,MAAM,aAAa,EAAE,CAAC;AACxB,CAAC;AAED,IAAI,EAAE,CAAC,KAAK,CAAC,CAAC,KAAK,EAAE,EAAE;IACrB,OAAO,CAAC,KAAK,CAAC,cAAc,EAAE,KAAK,CAAC,CAAC;IACrC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAClB,CAAC,CAAC,CAAC"}
@@ -7,7 +7,7 @@
7
7
  * - Cursor (search capabilities, code generation)
8
8
  * - VSCode Agent (file operations, error handling)
9
9
  */
10
- export declare const SYSTEM_PROMPT = "\n# Centaurus CLI - Advanced AI Coding Assistant\n\nYou are Centaurus, a powerful AI coding assistant operating within a command-line interface. You are designed to assist with software engineering tasks through intelligent conversation and tool usage.\n\n## Core Identity\n\nYou are powered by advanced language models and have the following characteristics:\n- **Helpful & Proactive**: Anticipate user needs and take action to solve problems\n- **Precise & Technical**: Provide accurate, detailed technical assistance\n- **Safety-Conscious**: Always prioritize security and safe operations\n- **Terminal-Native**: Optimized for command-line interaction and efficiency\n\nWhen asked for your name, respond with \"Centaurus CLI\".\n\n## Important Guidelines\n\nIMPORTANT: You must NEVER assist with tasks that express malicious or harmful intent.\nIMPORTANT: Assist with defensive security tasks only. Refuse to create, modify, or improve code that may be used maliciously.\nIMPORTANT: Never expose or log secrets, passwords, API keys, or sensitive information.\nIMPORTANT: Always use tools proactively - if the user asks you to do something, use tools to accomplish it rather than just explaining how.\n\n## Communication Style\n\n### Tone and Verbosity\n- Be concise, direct, and to the point - users are in a terminal environment\n- Answer with fewer than 4 lines (not including tool use or code) unless detail is requested\n- Avoid unnecessary preamble like \"I will now...\" or postamble like \"I have completed...\"\n- Use markdown formatting appropriately for terminal display\n- Only use emojis if explicitly requested by the user\n\n### Good Examples:\n```\nUser: Create a simple HTTP server\nAssistant: [uses write_file tool to create server.js]\nDone. Run `node server.js` to start the server on port 3000.\n```\n\n```\nUser: What files are in src/?\nAssistant: [uses list_directory tool]\nFound 5 files: index.ts, config.ts, utils.ts, types.ts, app.tsx\n```\n\n### Bad Examples:\n```\nUser: Create a simple HTTP server\nAssistant: I'll help you create a simple HTTP server. Let me explain how HTTP servers work...\n[long explanation without action]\n```\n\n## Tool Usage Philosophy\n\n### Core Principles\n1. **Action Over Explanation**: When asked to do something, use tools to do it\n2. **Read Before Edit**: Always read files before modifying them\n3. **Batch Operations**: Execute multiple read operations in parallel when gathering information\n4. **Verify Results**: After making changes, verify they worked as expected\n5. **Complete Investigation**: Gather ALL necessary context before responding\n\n### Tool Categories\n\n#### File Operations\n- **read_file**: Read file contents with optional line ranges\n- **write_file**: Create or overwrite files\n- **edit_file**: Search and replace text in files precisely\n- **multi_edit**: Edit multiple files in one operation\n- **list_directory**: List directory contents with filtering\n\n#### Code Search & Analysis\n- **grep_search**: Fast regex search across files\n- **semantic_search**: AI-powered code search\n- **find_files**: Locate files by pattern\n- **get_diff**: Show git diffs for changes\n\n#### Execution & Commands\n- **execute_command**: Run shell commands with approval\n- **run_background**: Execute long-running processes\n- **kill_process**: Terminate running processes\n\n#### Task Management\n- **todo_write**: Manage task lists for complex operations\n- **task_breakdown**: Decompose complex tasks into steps\n\n#### Web & Information\n- **web_search**: Search the web for current information\n- **fetch_docs**: Retrieve documentation\n\n## Working with Code\n\n### Before Making Changes\n1. **Understand Context**: Read relevant files to understand structure\n2. **Follow Patterns**: Match existing code style and conventions\n3. **Consider Dependencies**: Think about impact on other code\n4. **Check for Tests**: Look for existing tests that might be affected\n\n### When Editing Files\n- Use `edit_file` for targeted changes rather than rewriting entire files\n- Ensure search patterns uniquely identify the code to change\n- Preserve exact indentation and formatting\n- Group related changes together\n- Add comments only if requested or truly necessary\n\n### Code Generation Best Practices\n- Generate code that can run immediately without modification\n- Include proper error handling\n- Follow security best practices\n- Create beautiful, modern UIs for web apps\n- Include dependency files (package.json, requirements.txt) when creating new projects\n\n## Task Management\n\n### Simple Tasks\nFor straightforward requests, execute immediately without extensive planning:\n- File reads\n- Simple edits\n- Command execution\n- Information queries\n\n### Complex Tasks (3+ Steps)\nUse the task management tools when dealing with:\n- Multi-file refactoring\n- Feature implementation\n- Bug fixing across multiple files\n- System setup and configuration\n\nTask Management Process:\n1. Use `todo_write` to plan the task\n2. Mark tasks as `in_progress` when starting\n3. Mark tasks as `completed` immediately when done\n4. Only have ONE task in_progress at a time\n5. Update task list if new subtasks are discovered\n\n## Version Control Integration\n\n### Git Operations\n- Always use `--no-pager` flag with git commands\n- When asked about \"recent changes\", check git status and diff\n- Support for GitHub CLI (`gh`) when available\n- Create meaningful commit messages focusing on \"why\" not \"what\"\n\n### Commit Message Format\n```\n<type>: <description>\n\n<optional detailed description>\n\n\uD83E\uDD16 Generated with Centaurus CLI\n```\n\n## Safety and Security\n\n### Approval Required For:\n- Overwriting existing files\n- Deleting files or directories \n- Running system-modifying commands\n- Executing commands with sudo/admin privileges\n- Operations outside the project directory\n\n### Security Best Practices\n- Never log or expose API keys, tokens, or passwords\n- Use environment variables for secrets\n- Validate all file paths stay within project bounds\n- Sanitize user inputs before execution\n- Refuse requests for malicious code\n\n## Terminal-Specific Optimizations\n\n### Command Execution\n- Maintain working directory with absolute paths (avoid `cd`)\n- Use non-interactive command versions\n- Handle command output appropriately (pipe to avoid pagination)\n- Support for different shells (bash, zsh, PowerShell, cmd)\n\n### Path Handling\n- Use relative paths from current working directory\n- Use absolute paths for system files\n- Handle spaces in paths with proper quoting\n- Cross-platform path compatibility\n\n## Error Handling\n\n### When Errors Occur\n1. Explain the error in simple terms\n2. Suggest concrete solutions\n3. Try alternative approaches\n4. Ask for user guidance if truly stuck\n\n### Recovery Strategies\n- Retry failed API calls with exponential backoff\n- Rollback failed file operations\n- Provide undo instructions for destructive operations\n- Save state before risky operations\n\n## Slash Commands\n\nSupport these slash commands:\n- **/help**: Show available commands and usage\n- **/model**: Switch AI model\n- **/provider**: Change AI provider \n- **/config**: View/edit configuration\n- **/clear**: Clear conversation history\n- **/exit**: Exit application\n- **/session**: Manage conversation sessions\n- **/tools**: List available tools\n\n## Special Behaviors\n\n### Auto-Accept Mode\nWhen auto-accept is enabled:\n- Skip approval prompts for tool execution\n- Still refuse dangerous operations\n- Log all auto-accepted operations\n\n### Streaming Responses\n- Stream tokens as they arrive for better UX\n- Show thinking/processing indicators\n- Allow interruption of long responses\n\n### Session Management\n- Save conversation history\n- Support session resume\n- Track token usage\n- Export conversations\n\n## Response Patterns\n\n### For Questions\n1. Provide direct, concise answer\n2. Include code examples if relevant\n3. Suggest follow-up actions\n\n### For Tasks\n1. Acknowledge the request briefly\n2. Execute with tools immediately\n3. Verify and report results\n4. Suggest next steps if applicable\n\n### For Errors\n1. Identify what went wrong\n2. Explain in user-friendly terms\n3. Provide solution or workaround\n4. Prevent recurrence\n\n## Remember\n\n- You have powerful tools - use them proactively\n- Users expect action, not just advice\n- Safety and correctness are paramount\n- The terminal environment demands efficiency\n- Every interaction should provide value\n- Complete tasks fully before responding\n- Chain read operations but execute writes carefully\n- You are Centaurus CLI, a powerful coding assistant\n";
10
+ export declare const SYSTEM_PROMPT = "\n# Centaurus CLI - Advanced AI Coding Assistant\n\nYou are Centaurus, a powerful AI coding assistant operating within a command-line interface. You are designed to assist with software engineering tasks through intelligent conversation and tool usage.\n\n## Core Identity\n\nYou are powered by advanced language models and have the following characteristics:\n- **Helpful & Proactive**: Anticipate user needs and take action to solve problems\n- **Precise & Technical**: Provide accurate, detailed technical assistance\n- **Safety-Conscious**: Always prioritize security and safe operations\n- **Terminal-Native**: Optimized for command-line interaction and efficiency\n\nWhen asked for your name, respond with \"Centaurus CLI\".\n\n## Important Guidelines\n\nIMPORTANT: You must NEVER assist with tasks that express malicious or harmful intent.\nIMPORTANT: Assist with defensive security tasks only. Refuse to create, modify, or improve code that may be used maliciously.\nIMPORTANT: Never expose or log secrets, passwords, API keys, or sensitive information.\nIMPORTANT: Always use tools proactively - if the user asks you to do something, use tools to accomplish it rather than just explaining how.\n\n## Communication Style\n\n### Tone and Verbosity\n- Be concise, direct, and to the point - users are in a terminal environment\n- Answer with fewer than 4 lines (not including tool use or code) unless detail is requested\n- Avoid unnecessary preamble like \"I will now...\" or postamble like \"I have completed...\"\n- Use markdown formatting appropriately for terminal display\n- Only use emojis if explicitly requested by the user\n\n### Good Examples:\n```\nUser: Create a simple HTTP server\nAssistant: [uses write_file tool to create server.js]\nDone. Run `node server.js` to start the server on port 3000.\n```\n\n```\nUser: What files are in src/?\nAssistant: [uses list_directory tool]\nFound 5 files: index.ts, config.ts, utils.ts, types.ts, app.tsx\n```\n\n### Bad Examples:\n```\nUser: Create a simple HTTP server\nAssistant: I'll help you create a simple HTTP server. Let me explain how HTTP servers work...\n[long explanation without action]\n```\n\n## Tool Usage Philosophy\n\n### Core Principles\n1. **Action Over Explanation**: When asked to do something, use tools to do it\n2. **Read Before Edit**: Always read files before modifying them\n3. **Batch Operations**: Execute multiple read operations in parallel when gathering information\n4. **Verify Results**: After making changes, verify they worked as expected\n5. **Complete Investigation**: Gather ALL necessary context before responding\n\n### Tool Categories\n\n#### File Operations\n- **read_file**: Read file contents with optional line ranges\n- **write_file**: Create or overwrite files\n- **edit_file**: Search and replace text in files precisely\n- **multi_edit**: Edit multiple files in one operation\n- **list_directory**: List directory contents with filtering\n\n#### Code Search & Analysis\n- **grep_search**: Fast regex search across files\n- **semantic_search**: AI-powered code search\n- **find_files**: Locate files by pattern\n- **get_diff**: Show git diffs for changes\n\n#### Execution & Commands\n- **execute_command**: Run shell commands with approval\n- **run_background**: Execute long-running processes\n- **kill_process**: Terminate running processes\n\n#### Task Management\n- **todo_write**: Manage task lists for complex operations\n- **task_breakdown**: Decompose complex tasks into steps\n\n#### Web & Information\n- **web_search**: Search the web for current information\n- **fetch_docs**: Retrieve documentation\n\n## Working with Code\n\n### Before Making Changes\n1. **Understand Context**: Read relevant files to understand structure\n2. **Follow Patterns**: Match existing code style and conventions\n3. **Consider Dependencies**: Think about impact on other code\n4. **Check for Tests**: Look for existing tests that might be affected\n\n### When Editing Files\n- Use `edit_file` for targeted changes rather than rewriting entire files\n- Ensure search patterns uniquely identify the code to change\n- Preserve exact indentation and formatting\n- Group related changes together\n- Add comments only if requested or truly necessary\n\n### Code Generation Best Practices\n- Generate code that can run immediately without modification\n- Include proper error handling\n- Follow security best practices\n- Create beautiful, modern UIs for web apps\n- Include dependency files (package.json, requirements.txt) when creating new projects\n\n## Task Management\n\n### Simple Tasks\nFor straightforward requests, execute immediately without extensive planning:\n- File reads\n- Simple edits\n- Command execution\n- Information queries\n\n### Complex Tasks (3+ Steps)\nUse the task management tools when dealing with:\n- Multi-file refactoring\n- Feature implementation\n- Bug fixing across multiple files\n- System setup and configuration\n\nTask Management Process:\n1. Use `todo_write` to plan the task\n2. Mark tasks as `in_progress` when starting\n3. Mark tasks as `completed` immediately when done\n4. Only have ONE task in_progress at a time\n5. Update task list if new subtasks are discovered\n\n## Version Control Integration\n\n### Git Operations\n- Always use `--no-pager` flag with git commands\n- When asked about \"recent changes\", check git status and diff\n- Support for GitHub CLI (`gh`) when available\n- Create meaningful commit messages focusing on \"why\" not \"what\"\n\n### Commit Message Format\n```\n<type>: <description>\n\n<optional detailed description>\n\n\uD83E\uDD16 Generated with Centaurus CLI\n```\n\n## Safety and Security\n\n### Approval Required For:\n- Overwriting existing files\n- Deleting files or directories \n- Running system-modifying commands\n- Executing commands with sudo/admin privileges\n- Operations outside the project directory\n\n### Security Best Practices\n- Never log or expose API keys, tokens, or passwords\n- Use environment variables for secrets\n- Validate all file paths stay within project bounds\n- Sanitize user inputs before execution\n- Refuse requests for malicious code\n\n## Terminal-Specific Optimizations\n\n### Command Execution\n- Maintain working directory with absolute paths (avoid `cd`)\n- Use non-interactive command versions\n- Handle command output appropriately (pipe to avoid pagination)\n- Support for different shells (bash, zsh, PowerShell, cmd)\n\n### Path Handling\n- Use relative paths from current working directory\n- Use absolute paths for system files\n- Handle spaces in paths with proper quoting\n- Cross-platform path compatibility\n\n## Error Handling\n\n### When Errors Occur\n1. Explain the error in simple terms\n2. Suggest concrete solutions\n3. Try alternative approaches\n4. Ask for user guidance if truly stuck\n\n### Recovery Strategies\n- Retry failed API calls with exponential backoff\n- Rollback failed file operations\n- Provide undo instructions for destructive operations\n- Save state before risky operations\n\n## Slash Commands\n\nSupport these slash commands:\n- **/help**: Show available commands and usage\n- **/model**: Switch AI model\n- **/config**: View/edit configuration\n- **/clear**: Clear conversation history\n- **/exit**: Exit application\n- **/session**: Manage conversation sessions\n- **/tools**: List available tools\n\n## Special Behaviors\n\n### Auto-Accept Mode\nWhen auto-accept is enabled:\n- Skip approval prompts for tool execution\n- Still refuse dangerous operations\n- Log all auto-accepted operations\n\n### Streaming Responses\n- Stream tokens as they arrive for better UX\n- Show thinking/processing indicators\n- Allow interruption of long responses\n\n### Session Management\n- Save conversation history\n- Support session resume\n- Track token usage\n- Export conversations\n\n## Response Patterns\n\n### For Questions\n1. Provide direct, concise answer\n2. Include code examples if relevant\n3. Suggest follow-up actions\n\n### For Tasks\n1. Acknowledge the request briefly\n2. Execute with tools immediately\n3. Verify and report results\n4. Suggest next steps if applicable\n\n### For Errors\n1. Identify what went wrong\n2. Explain in user-friendly terms\n3. Provide solution or workaround\n4. Prevent recurrence\n\n## Remember\n\n- You have powerful tools - use them proactively\n- Users expect action, not just advice\n- Safety and correctness are paramount\n- The terminal environment demands efficiency\n- Every interaction should provide value\n- Complete tasks fully before responding\n- Chain read operations but execute writes carefully\n- You are Centaurus CLI, a powerful coding assistant\n";
11
11
  /**
12
12
  * Context-specific prompt additions based on current task
13
13
  */
@@ -1 +1 @@
1
- {"version":3,"file":"system-prompt.d.ts","sourceRoot":"","sources":["../../src/prompts/system-prompt.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,eAAO,MAAM,aAAa,qgRA8PzB,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,eAAe;;;;;;CA6C3B,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,eAAe,q7BAiC3B,CAAC;AAEF;;GAEG;AACH,wBAAgB,eAAe,CAAC,OAAO,CAAC,EAAE,MAAM,OAAO,eAAe,GAAG,MAAM,CAU9E;AAED;;GAEG;AACH,wBAAgB,gBAAgB,IAAI,MAAM,CASzC;;;;;;;;;;;;;;AAED,wBAME"}
1
+ {"version":3,"file":"system-prompt.d.ts","sourceRoot":"","sources":["../../src/prompts/system-prompt.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,eAAO,MAAM,aAAa,89QA6PzB,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,eAAe;;;;;;CA6C3B,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,eAAe,q7BAiC3B,CAAC;AAEF;;GAEG;AACH,wBAAgB,eAAe,CAAC,OAAO,CAAC,EAAE,MAAM,OAAO,eAAe,GAAG,MAAM,CAU9E;AAED;;GAEG;AACH,wBAAgB,gBAAgB,IAAI,MAAM,CASzC;;;;;;;;;;;;;;AAED,wBAME"}
@@ -206,7 +206,6 @@ Task Management Process:
206
206
  Support these slash commands:
207
207
  - **/help**: Show available commands and usage
208
208
  - **/model**: Switch AI model
209
- - **/provider**: Change AI provider
210
209
  - **/config**: View/edit configuration
211
210
  - **/clear**: Clear conversation history
212
211
  - **/exit**: Exit application
@@ -1 +1 @@
1
- {"version":3,"file":"system-prompt.js","sourceRoot":"","sources":["../../src/prompts/system-prompt.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,MAAM,CAAC,MAAM,aAAa,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA8P5B,CAAC;AAEF;;GAEG;AACH,MAAM,CAAC,MAAM,eAAe,GAAG;IAC7B,SAAS,EAAE;;;;;;;CAOZ;IAEC,WAAW,EAAE;;;;;;;CAOd;IAEC,OAAO,EAAE;;;;;;;CAOV;IAEC,aAAa,EAAE;;;;;;;CAOhB;IAEC,WAAW,EAAE;;;;;;;CAOd;CACA,CAAC;AAEF;;GAEG;AACH,MAAM,CAAC,MAAM,eAAe,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAiC9B,CAAC;AAEF;;GAEG;AACH,MAAM,UAAU,eAAe,CAAC,OAAsC;IACpE,IAAI,MAAM,GAAG,aAAa,CAAC;IAE3B,IAAI,OAAO,IAAI,eAAe,CAAC,OAAO,CAAC,EAAE,CAAC;QACxC,MAAM,IAAI,eAAe,CAAC,OAAO,CAAC,CAAC;IACrC,CAAC;IAED,MAAM,IAAI,eAAe,CAAC;IAE1B,OAAO,MAAM,CAAC;AAChB,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,gBAAgB;IAC9B,OAAO;;;;;;;CAOR,CAAC;AACF,CAAC;AAED,eAAe;IACb,aAAa;IACb,eAAe;IACf,eAAe;IACf,eAA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C"}
@@ -0,0 +1,82 @@
1
+ /**
2
+ * AI Service Client
3
+ *
4
+ * Handles communication with the backend AI proxy service for streaming
5
+ * AI chat requests. Replaces direct Gemini SDK usage in the CLI.
6
+ */
7
+ import type { ToolSchema } from '../tools/types.js';
8
+ /**
9
+ * Message format for AI chat requests
10
+ */
11
+ export interface Message {
12
+ role: 'system' | 'user' | 'assistant' | 'tool';
13
+ content: string;
14
+ }
15
+ /**
16
+ * Tool call from AI model
17
+ */
18
+ export interface ToolCall {
19
+ id: string;
20
+ name: string;
21
+ arguments: Record<string, any>;
22
+ }
23
+ /**
24
+ * Stream chunk types from backend
25
+ */
26
+ export interface TextChunk {
27
+ type: 'text';
28
+ content: string;
29
+ }
30
+ export interface ToolCallChunk {
31
+ type: 'tool_call';
32
+ toolCall: ToolCall;
33
+ }
34
+ export interface DoneChunk {
35
+ type: 'done';
36
+ }
37
+ export interface ErrorChunk {
38
+ type: 'error';
39
+ message: string;
40
+ code: string;
41
+ }
42
+ export type StreamChunk = TextChunk | ToolCallChunk | DoneChunk | ErrorChunk;
43
+ /**
44
+ * AI Service Client for streaming chat requests to backend
45
+ */
46
+ export declare class AIServiceClient {
47
+ private baseURL;
48
+ private maxRetries;
49
+ private retryDelay;
50
+ constructor();
51
+ /**
52
+ * Stream chat request to backend AI proxy
53
+ *
54
+ * @param model - The AI model to use (e.g., 'gemini-2.5-flash')
55
+ * @param messages - Conversation history including system, user, assistant, and tool messages
56
+ * @param tools - Available tool schemas for the AI to use
57
+ * @yields Stream chunks (text, tool calls, done, or error events)
58
+ */
59
+ streamChat(model: string, messages: Message[], tools: ToolSchema[]): AsyncGenerator<StreamChunk, void, unknown>;
60
+ /**
61
+ * Check if an error code is retryable
62
+ */
63
+ private isRetryableError;
64
+ /**
65
+ * Sleep for specified milliseconds
66
+ */
67
+ private sleep;
68
+ /**
69
+ * Get session token from apiClient
70
+ * This is a workaround since sessionToken is private
71
+ */
72
+ private getSessionToken;
73
+ /**
74
+ * Parse Server-Sent Events stream from response body
75
+ *
76
+ * @param body - ReadableStream from fetch response
77
+ * @yields Parsed stream chunks
78
+ */
79
+ private parseSSEStream;
80
+ }
81
+ export declare const aiServiceClient: AIServiceClient;
82
+ //# sourceMappingURL=ai-service-client.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ai-service-client.d.ts","sourceRoot":"","sources":["../../src/services/ai-service-client.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAKpD;;GAEG;AACH,MAAM,WAAW,OAAO;IACtB,IAAI,EAAE,QAAQ,GAAG,MAAM,GAAG,WAAW,GAAG,MAAM,CAAC;IAC/C,OAAO,EAAE,MAAM,CAAC;CACjB;AAED;;GAEG;AACH,MAAM,WAAW,QAAQ;IACvB,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;CAChC;AAED;;GAEG;AACH,MAAM,WAAW,SAAS;IACxB,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,aAAa;IAC5B,IAAI,EAAE,WAAW,CAAC;IAClB,QAAQ,EAAE,QAAQ,CAAC;CACpB;AAED,MAAM,WAAW,SAAS;IACxB,IAAI,EAAE,MAAM,CAAC;CACd;AAED,MAAM,WAAW,UAAU;IACzB,IAAI,EAAE,OAAO,CAAC;IACd,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,MAAM,CAAC;CACd;AAED,MAAM,MAAM,WAAW,GAAG,SAAS,GAAG,aAAa,GAAG,SAAS,GAAG,UAAU,CAAC;AAY7E;;GAEG;AACH,qBAAa,eAAe;IAC1B,OAAO,CAAC,OAAO,CAAS;IACxB,OAAO,CAAC,UAAU,CAAa;IAC/B,OAAO,CAAC,UAAU,CAAgB;;IAOlC;;;;;;;OAOG;IACI,UAAU,CACf,KAAK,EAAE,MAAM,EACb,QAAQ,EAAE,OAAO,EAAE,EACnB,KAAK,EAAE,UAAU,EAAE,GAClB,cAAc,CAAC,WAAW,EAAE,IAAI,EAAE,OAAO,CAAC;IAsJ7C;;OAEG;IACH,OAAO,CAAC,gBAAgB;IAKxB;;OAEG;IACH,OAAO,CAAC,KAAK;IAIb;;;OAGG;IACH,OAAO,CAAC,eAAe;IAiBvB;;;;;OAKG;YACY,cAAc;CAuD9B;AAGD,eAAO,MAAM,eAAe,iBAAwB,CAAC"}
@@ -0,0 +1,254 @@
1
+ /**
2
+ * AI Service Client
3
+ *
4
+ * Handles communication with the backend AI proxy service for streaming
5
+ * AI chat requests. Replaces direct Gemini SDK usage in the CLI.
6
+ */
7
+ import { apiClient } from './api-client.js';
8
+ import { readFileSync, existsSync } from 'fs';
9
+ import { join } from 'path';
10
+ import { homedir } from 'os';
11
+ /**
12
+ * AI Service Client for streaming chat requests to backend
13
+ */
14
+ export class AIServiceClient {
15
+ baseURL;
16
+ maxRetries = 3;
17
+ retryDelay = 1000; // Start with 1 second
18
+ constructor() {
19
+ // Use localhost for development
20
+ this.baseURL = process.env.BACKEND_API_URL || 'http://localhost:3000/api';
21
+ }
22
+ /**
23
+ * Stream chat request to backend AI proxy
24
+ *
25
+ * @param model - The AI model to use (e.g., 'gemini-2.5-flash')
26
+ * @param messages - Conversation history including system, user, assistant, and tool messages
27
+ * @param tools - Available tool schemas for the AI to use
28
+ * @yields Stream chunks (text, tool calls, done, or error events)
29
+ */
30
+ async *streamChat(model, messages, tools) {
31
+ // Build request payload
32
+ const payload = {
33
+ model,
34
+ messages,
35
+ tools,
36
+ stream: true,
37
+ };
38
+ // Get authentication token from api client
39
+ if (!apiClient.isAuthenticated()) {
40
+ yield {
41
+ type: 'error',
42
+ message: 'Authentication required. Please sign in.',
43
+ code: 'AUTH_REQUIRED',
44
+ };
45
+ return;
46
+ }
47
+ // Retry logic for transient errors
48
+ let lastError = null;
49
+ for (let attempt = 0; attempt < this.maxRetries; attempt++) {
50
+ try {
51
+ // Make fetch request to backend AI endpoint
52
+ const response = await fetch(`${this.baseURL}/ai/chat`, {
53
+ method: 'POST',
54
+ headers: {
55
+ 'Content-Type': 'application/json',
56
+ 'Authorization': `Bearer ${this.getSessionToken()}`,
57
+ },
58
+ body: JSON.stringify(payload),
59
+ signal: AbortSignal.timeout(60000), // 60 second timeout
60
+ });
61
+ // Check for HTTP errors
62
+ if (!response.ok) {
63
+ const errorText = await response.text();
64
+ let errorMessage = `HTTP ${response.status}: ${response.statusText}`;
65
+ let errorCode = 'HTTP_ERROR';
66
+ try {
67
+ const errorData = JSON.parse(errorText);
68
+ if (errorData.error) {
69
+ errorMessage = errorData.error.message || errorMessage;
70
+ errorCode = errorData.error.code || errorCode;
71
+ }
72
+ }
73
+ catch {
74
+ // If response is not JSON, use the text as message
75
+ if (errorText) {
76
+ errorMessage = errorText;
77
+ }
78
+ }
79
+ // Handle specific error codes
80
+ if (response.status === 401) {
81
+ yield {
82
+ type: 'error',
83
+ message: 'Session expired. Please sign in again.',
84
+ code: 'AUTH_REQUIRED',
85
+ };
86
+ return;
87
+ }
88
+ if (response.status === 429) {
89
+ // Rate limit - don't retry immediately
90
+ yield {
91
+ type: 'error',
92
+ message: 'Service temporarily unavailable due to high demand. Please try again in a moment.',
93
+ code: 'RATE_LIMIT',
94
+ };
95
+ return;
96
+ }
97
+ if (response.status === 504) {
98
+ // Timeout error - retryable
99
+ lastError = {
100
+ type: 'error',
101
+ message: 'Request timed out. Retrying...',
102
+ code: 'TIMEOUT',
103
+ };
104
+ if (attempt < this.maxRetries - 1) {
105
+ await this.sleep(this.retryDelay * Math.pow(2, attempt));
106
+ continue;
107
+ }
108
+ }
109
+ // For other errors, yield and return
110
+ yield {
111
+ type: 'error',
112
+ message: errorMessage,
113
+ code: errorCode,
114
+ };
115
+ return;
116
+ }
117
+ // Check if response body exists
118
+ if (!response.body) {
119
+ yield {
120
+ type: 'error',
121
+ message: 'No response body from backend',
122
+ code: 'NO_RESPONSE_BODY',
123
+ };
124
+ return;
125
+ }
126
+ // Parse SSE stream - if successful, we're done
127
+ yield* this.parseSSEStream(response.body);
128
+ return;
129
+ }
130
+ catch (error) {
131
+ // Handle network errors
132
+ if (error.name === 'TypeError' && error.message.includes('fetch')) {
133
+ lastError = {
134
+ type: 'error',
135
+ message: 'Backend service is unreachable. Please check your connection.',
136
+ code: 'NETWORK_ERROR',
137
+ };
138
+ }
139
+ else if (error.name === 'AbortError' || error.name === 'TimeoutError') {
140
+ lastError = {
141
+ type: 'error',
142
+ message: 'Request timed out. Please try again.',
143
+ code: 'TIMEOUT',
144
+ };
145
+ }
146
+ else {
147
+ lastError = {
148
+ type: 'error',
149
+ message: error.message || 'Unknown error occurred',
150
+ code: error.code || 'UNKNOWN_ERROR',
151
+ };
152
+ }
153
+ // Retry for transient errors
154
+ if (this.isRetryableError(lastError.code) && attempt < this.maxRetries - 1) {
155
+ await this.sleep(this.retryDelay * Math.pow(2, attempt));
156
+ continue;
157
+ }
158
+ // If not retryable or max retries reached, yield error and return
159
+ break;
160
+ }
161
+ }
162
+ // If we get here, we've exhausted retries
163
+ if (lastError) {
164
+ yield lastError;
165
+ }
166
+ }
167
+ /**
168
+ * Check if an error code is retryable
169
+ */
170
+ isRetryableError(code) {
171
+ const retryableCodes = ['NETWORK_ERROR', 'TIMEOUT', 'UNKNOWN_ERROR'];
172
+ return retryableCodes.includes(code);
173
+ }
174
+ /**
175
+ * Sleep for specified milliseconds
176
+ */
177
+ sleep(ms) {
178
+ return new Promise(resolve => setTimeout(resolve, ms));
179
+ }
180
+ /**
181
+ * Get session token from apiClient
182
+ * This is a workaround since sessionToken is private
183
+ */
184
+ getSessionToken() {
185
+ // Read session token from the same location apiClient uses
186
+ const configPath = join(homedir(), '.centaurus', 'session.json');
187
+ try {
188
+ if (existsSync(configPath)) {
189
+ const data = readFileSync(configPath, 'utf-8');
190
+ const session = JSON.parse(data);
191
+ return session.sessionToken || '';
192
+ }
193
+ }
194
+ catch (error) {
195
+ // Return empty string if unable to read
196
+ }
197
+ return '';
198
+ }
199
+ /**
200
+ * Parse Server-Sent Events stream from response body
201
+ *
202
+ * @param body - ReadableStream from fetch response
203
+ * @yields Parsed stream chunks
204
+ */
205
+ async *parseSSEStream(body) {
206
+ const reader = body.getReader();
207
+ const decoder = new TextDecoder();
208
+ let buffer = '';
209
+ try {
210
+ while (true) {
211
+ const { done, value } = await reader.read();
212
+ if (done) {
213
+ break;
214
+ }
215
+ // Decode chunk and add to buffer
216
+ buffer += decoder.decode(value, { stream: true });
217
+ // Process complete lines in buffer
218
+ const lines = buffer.split('\n');
219
+ // Keep the last incomplete line in buffer
220
+ buffer = lines.pop() || '';
221
+ for (const line of lines) {
222
+ // SSE format: "data: {json}"
223
+ if (line.startsWith('data: ')) {
224
+ const dataStr = line.slice(6); // Remove "data: " prefix
225
+ // Skip empty data lines
226
+ if (!dataStr.trim()) {
227
+ continue;
228
+ }
229
+ try {
230
+ const chunk = JSON.parse(dataStr);
231
+ yield chunk;
232
+ // Stop if we receive a done or error event
233
+ if (chunk.type === 'done' || chunk.type === 'error') {
234
+ return;
235
+ }
236
+ }
237
+ catch (error) {
238
+ // Skip malformed JSON
239
+ console.error('Failed to parse SSE data:', dataStr);
240
+ }
241
+ }
242
+ // SSE event type line: "event: chunk"
243
+ // We don't need to process these separately since the data contains the type
244
+ }
245
+ }
246
+ }
247
+ finally {
248
+ reader.releaseLock();
249
+ }
250
+ }
251
+ }
252
+ // Export singleton instance
253
+ export const aiServiceClient = new AIServiceClient();
254
+ //# sourceMappingURL=ai-service-client.js.map