@autodev/codebase 0.0.2 → 0.0.3

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.
package/README.md CHANGED
@@ -116,6 +116,22 @@ Configure your IDE to connect to the MCP server:
116
116
  }
117
117
  ```
118
118
 
119
+ For clients that do not support SSE MCP, you can use the following configuration:
120
+
121
+ ```json
122
+ {
123
+ "mcpServers": {
124
+ "codebase": {
125
+ "command": "codebase",
126
+ "args": [
127
+ "stdio-adapter",
128
+ "--server-url=http://localhost:3001/sse"
129
+ ]
130
+ }
131
+ }
132
+ }
133
+ ```
134
+
119
135
  ### Library Usage
120
136
 
121
137
  #### Node.js Usage
package/dist/cli.js CHANGED
@@ -15,12 +15,17 @@ global.self = global;
15
15
  global.window = global;
16
16
  global.document = { createElement: () => ({}), addEventListener: () => {}, removeEventListener: () => {} };
17
17
  // Fix for Ink color detection - provide proper navigator object for Node.js
18
- global.navigator = {
19
- userAgent: 'Node.js',
20
- userAgentData: {
21
- brands: [{ brand: 'Chromium', version: '100' }]
22
- }
23
- };
18
+ Object.defineProperty(global, 'navigator', {
19
+ value: {
20
+ userAgent: 'Node.js',
21
+ userAgentData: {
22
+ brands: [{ brand: 'Chromium', version: '100' }]
23
+ }
24
+ },
25
+ writable: true,
26
+ configurable: true
27
+ });
28
+
24
29
  global.HTMLElement = class HTMLElement {};
25
30
  global.Element = class Element {};
26
31
  global.addEventListener = () => {};
@@ -30,6 +35,8 @@ global.__dirname = dirname(fileURLToPath(import.meta.url));
30
35
  process.env['NODE_ENV'] = process.env['NODE_ENV'] || 'production';
31
36
  process.env['REACT_EDITOR'] = 'none';
32
37
  process.env['DISABLE_REACT_DEVTOOLS'] = 'true';
38
+ // Prevent Ink from loading react-devtools-core
39
+ process.env['DEV'] = 'false';
33
40
 
34
41
  process.argv = [process.argv[0], '${indexPath}', ...${JSON.stringify(cliArgs)}];
35
42
  await import('${indexPath}').then(({ main }) => main());
@@ -41,7 +48,8 @@ const child = spawn('node', ['--input-type=module', '-e', command], {
41
48
  ...process.env,
42
49
  NODE_ENV: process.env['NODE_ENV'] || 'production',
43
50
  REACT_EDITOR: 'none',
44
- DISABLE_REACT_DEVTOOLS: 'true'
51
+ DISABLE_REACT_DEVTOOLS: 'true',
52
+ DEV: 'false'
45
53
  }
46
54
  });
47
55
  child.on('exit', (code) => {
package/dist/cli.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"cli.js","sources":["../src/cli.ts"],"sourcesContent":["import { spawn } from 'child_process';\nimport { fileURLToPath } from 'url';\nimport path from 'path';\n\n// Get the directory of the current module\nconst __dirname = path.dirname(fileURLToPath(import.meta.url));\nconst indexPath = path.join(__dirname, 'index.js');\n\n// Build the command with polyfills\nconst cliArgs = process.argv.slice(2);\nconst command = `\nimport { fileURLToPath } from 'url';\nimport { dirname } from 'path';\nglobal.self = global;\nglobal.window = global;\nglobal.document = { createElement: () => ({}), addEventListener: () => {}, removeEventListener: () => {} };\n// Fix for Ink color detection - provide proper navigator object for Node.js\nglobal.navigator = {\n userAgent: 'Node.js',\n userAgentData: {\n brands: [{ brand: 'Chromium', version: '100' }]\n }\n};\nglobal.HTMLElement = class HTMLElement {};\nglobal.Element = class Element {};\nglobal.addEventListener = () => {};\nglobal.removeEventListener = () => {};\n// Set up __dirname for ESM modules\nglobal.__dirname = dirname(fileURLToPath(import.meta.url));\nprocess.env['NODE_ENV'] = process.env['NODE_ENV'] || 'production';\nprocess.env['REACT_EDITOR'] = 'none';\nprocess.env['DISABLE_REACT_DEVTOOLS'] = 'true';\n\nprocess.argv = [process.argv[0], '${indexPath}', ...${JSON.stringify(cliArgs)}];\nawait import('${indexPath}').then(({ main }) => main());\n`;\n\n// Execute the command with Node.js\nconst child = spawn('node', ['--input-type=module', '-e', command], {\n stdio: 'inherit',\n env: {\n ...process.env,\n NODE_ENV: process.env['NODE_ENV'] || 'production',\n REACT_EDITOR: 'none',\n DISABLE_REACT_DEVTOOLS: 'true'\n }\n});\n\nchild.on('exit', (code) => {\n process.exit(code || 0);\n});\n\nchild.on('error', (error) => {\n console.error('Failed to start CLI:', error);\n process.exit(1);\n});\n"],"names":[],"mappings":";;;;;AAIA;AACA,MAAM,SAAS,GAAG,IAAI,CAAC,OAAO,CAAC,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AAC9D,MAAM,SAAS,GAAG,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,UAAU,CAAC;AAElD;AACA,MAAM,OAAO,GAAG,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC;AACrC,MAAM,OAAO,GAAG;;;;;;;;;;;;;;;;;;;;;;;AAuBoB,kCAAA,EAAA,SAAS,SAAS,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,CAAA;gBAC7D,SAAS,CAAA;CACxB;AAED;AACA,MAAM,KAAK,GAAG,KAAK,CAAC,MAAM,EAAE,CAAC,qBAAqB,EAAE,IAAI,EAAE,OAAO,CAAC,EAAE;AAClE,IAAA,KAAK,EAAE,SAAS;AAChB,IAAA,GAAG,EAAE;QACH,GAAG,OAAO,CAAC,GAAG;QACd,QAAQ,EAAE,OAAO,CAAC,GAAG,CAAC,UAAU,CAAC,IAAI,YAAY;AACjD,QAAA,YAAY,EAAE,MAAM;AACpB,QAAA,sBAAsB,EAAE;AACzB;AACF,CAAA,CAAC;AAEF,KAAK,CAAC,EAAE,CAAC,MAAM,EAAE,CAAC,IAAI,KAAI;AACxB,IAAA,OAAO,CAAC,IAAI,CAAC,IAAI,IAAI,CAAC,CAAC;AACzB,CAAC,CAAC;AAEF,KAAK,CAAC,EAAE,CAAC,OAAO,EAAE,CAAC,KAAK,KAAI;AAC1B,IAAA,OAAO,CAAC,KAAK,CAAC,sBAAsB,EAAE,KAAK,CAAC;AAC5C,IAAA,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC;AACjB,CAAC,CAAC"}
1
+ {"version":3,"file":"cli.js","sources":["../src/cli.ts"],"sourcesContent":["import { spawn } from 'child_process';\nimport { fileURLToPath } from 'url';\nimport path from 'path';\n\n// Get the directory of the current module\nconst __dirname = path.dirname(fileURLToPath(import.meta.url));\nconst indexPath = path.join(__dirname, 'index.js');\n\n// Build the command with polyfills\nconst cliArgs = process.argv.slice(2);\nconst command = `\nimport { fileURLToPath } from 'url';\nimport { dirname } from 'path';\nglobal.self = global;\nglobal.window = global;\nglobal.document = { createElement: () => ({}), addEventListener: () => {}, removeEventListener: () => {} };\n// Fix for Ink color detection - provide proper navigator object for Node.js\nObject.defineProperty(global, 'navigator', {\n value: {\n userAgent: 'Node.js',\n userAgentData: {\n brands: [{ brand: 'Chromium', version: '100' }]\n }\n },\n writable: true,\n configurable: true\n});\n\nglobal.HTMLElement = class HTMLElement {};\nglobal.Element = class Element {};\nglobal.addEventListener = () => {};\nglobal.removeEventListener = () => {};\n// Set up __dirname for ESM modules\nglobal.__dirname = dirname(fileURLToPath(import.meta.url));\nprocess.env['NODE_ENV'] = process.env['NODE_ENV'] || 'production';\nprocess.env['REACT_EDITOR'] = 'none';\nprocess.env['DISABLE_REACT_DEVTOOLS'] = 'true';\n// Prevent Ink from loading react-devtools-core\nprocess.env['DEV'] = 'false';\n\nprocess.argv = [process.argv[0], '${indexPath}', ...${JSON.stringify(cliArgs)}];\nawait import('${indexPath}').then(({ main }) => main());\n`;\n\n// Execute the command with Node.js\nconst child = spawn('node', ['--input-type=module', '-e', command], {\n stdio: 'inherit',\n env: {\n ...process.env,\n NODE_ENV: process.env['NODE_ENV'] || 'production',\n REACT_EDITOR: 'none',\n DISABLE_REACT_DEVTOOLS: 'true',\n DEV: 'false'\n }\n});\n\nchild.on('exit', (code) => {\n process.exit(code || 0);\n});\n\nchild.on('error', (error) => {\n console.error('Failed to start CLI:', error);\n process.exit(1);\n});\n"],"names":[],"mappings":";;;;;AAIA;AACA,MAAM,SAAS,GAAG,IAAI,CAAC,OAAO,CAAC,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AAC9D,MAAM,SAAS,GAAG,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,UAAU,CAAC;AAElD;AACA,MAAM,OAAO,GAAG,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC;AACrC,MAAM,OAAO,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA8BoB,kCAAA,EAAA,SAAS,SAAS,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,CAAA;gBAC7D,SAAS,CAAA;CACxB;AAED;AACA,MAAM,KAAK,GAAG,KAAK,CAAC,MAAM,EAAE,CAAC,qBAAqB,EAAE,IAAI,EAAE,OAAO,CAAC,EAAE;AAClE,IAAA,KAAK,EAAE,SAAS;AAChB,IAAA,GAAG,EAAE;QACH,GAAG,OAAO,CAAC,GAAG;QACd,QAAQ,EAAE,OAAO,CAAC,GAAG,CAAC,UAAU,CAAC,IAAI,YAAY;AACjD,QAAA,YAAY,EAAE,MAAM;AACpB,QAAA,sBAAsB,EAAE,MAAM;AAC9B,QAAA,GAAG,EAAE;AACN;AACF,CAAA,CAAC;AAEF,KAAK,CAAC,EAAE,CAAC,MAAM,EAAE,CAAC,IAAI,KAAI;AACxB,IAAA,OAAO,CAAC,IAAI,CAAC,IAAI,IAAI,CAAC,CAAC;AACzB,CAAC,CAAC;AAEF,KAAK,CAAC,EAAE,CAAC,OAAO,EAAE,CAAC,KAAK,KAAI;AAC1B,IAAA,OAAO,CAAC,KAAK,CAAC,sBAAsB,EAAE,KAAK,CAAC;AAC5C,IAAA,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC;AACjB,CAAC,CAAC"}