cuhlab-companion 0.1.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 (45) hide show
  1. package/dist/bin/cuhlab.d.ts +3 -0
  2. package/dist/bin/cuhlab.d.ts.map +1 -0
  3. package/dist/bin/cuhlab.js +9 -0
  4. package/dist/bin/cuhlab.js.map +1 -0
  5. package/dist/src/claude-md.d.ts +11 -0
  6. package/dist/src/claude-md.d.ts.map +1 -0
  7. package/dist/src/claude-md.js +123 -0
  8. package/dist/src/claude-md.js.map +1 -0
  9. package/dist/src/detect-tools.d.ts +16 -0
  10. package/dist/src/detect-tools.d.ts.map +1 -0
  11. package/dist/src/detect-tools.js +133 -0
  12. package/dist/src/detect-tools.js.map +1 -0
  13. package/dist/src/index.d.ts +5 -0
  14. package/dist/src/index.d.ts.map +1 -0
  15. package/dist/src/index.js +221 -0
  16. package/dist/src/index.js.map +1 -0
  17. package/dist/src/mcp-config.d.ts +21 -0
  18. package/dist/src/mcp-config.d.ts.map +1 -0
  19. package/dist/src/mcp-config.js +200 -0
  20. package/dist/src/mcp-config.js.map +1 -0
  21. package/dist/src/permission-server.d.ts +52 -0
  22. package/dist/src/permission-server.d.ts.map +1 -0
  23. package/dist/src/permission-server.js +233 -0
  24. package/dist/src/permission-server.js.map +1 -0
  25. package/dist/src/platform.d.ts +23 -0
  26. package/dist/src/platform.d.ts.map +1 -0
  27. package/dist/src/platform.js +133 -0
  28. package/dist/src/platform.js.map +1 -0
  29. package/dist/src/pty-bridge.d.ts +37 -0
  30. package/dist/src/pty-bridge.d.ts.map +1 -0
  31. package/dist/src/pty-bridge.js +121 -0
  32. package/dist/src/pty-bridge.js.map +1 -0
  33. package/dist/src/server.d.ts +41 -0
  34. package/dist/src/server.d.ts.map +1 -0
  35. package/dist/src/server.js +305 -0
  36. package/dist/src/server.js.map +1 -0
  37. package/dist/src/version.d.ts +5 -0
  38. package/dist/src/version.d.ts.map +1 -0
  39. package/dist/src/version.js +11 -0
  40. package/dist/src/version.js.map +1 -0
  41. package/dist/src/welcome.d.ts +6 -0
  42. package/dist/src/welcome.d.ts.map +1 -0
  43. package/dist/src/welcome.js +24 -0
  44. package/dist/src/welcome.js.map +1 -0
  45. package/package.json +40 -0
@@ -0,0 +1,3 @@
1
+ #!/usr/bin/env node
2
+ export {};
3
+ //# sourceMappingURL=cuhlab.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cuhlab.d.ts","sourceRoot":"","sources":["../../bin/cuhlab.ts"],"names":[],"mappings":""}
@@ -0,0 +1,9 @@
1
+ #!/usr/bin/env node
2
+ "use strict";
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ const index_js_1 = require("../src/index.js");
5
+ (0, index_js_1.main)(process.argv.slice(2)).catch((err) => {
6
+ console.error(`\n Fatal error: ${err instanceof Error ? err.message : String(err)}\n`);
7
+ process.exit(1);
8
+ });
9
+ //# sourceMappingURL=cuhlab.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cuhlab.js","sourceRoot":"","sources":["../../bin/cuhlab.ts"],"names":[],"mappings":";;;AACA,8CAAuC;AAEvC,IAAA,eAAI,EAAC,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,GAAG,EAAE,EAAE;IACxC,OAAO,CAAC,KAAK,CAAC,oBAAoB,GAAG,YAAY,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;IACxF,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAClB,CAAC,CAAC,CAAC"}
@@ -0,0 +1,11 @@
1
+ interface ClaudeMdOptions {
2
+ projectId: string;
3
+ projectUrl: string;
4
+ }
5
+ /**
6
+ * Generate a .claude/CLAUDE.md file in the project directory.
7
+ * Only overwrites if the file starts with "# Cuhlab Project" (preserves user customizations).
8
+ */
9
+ export declare function generateClaudeMd(projectDir: string, options: ClaudeMdOptions): void;
10
+ export {};
11
+ //# sourceMappingURL=claude-md.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"claude-md.d.ts","sourceRoot":"","sources":["../../src/claude-md.ts"],"names":[],"mappings":"AAKA,UAAU,eAAe;IACvB,SAAS,EAAE,MAAM,CAAC;IAClB,UAAU,EAAE,MAAM,CAAC;CACpB;AAED;;;GAGG;AACH,wBAAgB,gBAAgB,CAC9B,UAAU,EAAE,MAAM,EAClB,OAAO,EAAE,eAAe,GACvB,IAAI,CAkFN"}
@@ -0,0 +1,123 @@
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
+ Object.defineProperty(exports, "__esModule", { value: true });
36
+ exports.generateClaudeMd = generateClaudeMd;
37
+ const fs = __importStar(require("fs"));
38
+ const path = __importStar(require("path"));
39
+ const HEADER = '# Cuhlab Project';
40
+ /**
41
+ * Generate a .claude/CLAUDE.md file in the project directory.
42
+ * Only overwrites if the file starts with "# Cuhlab Project" (preserves user customizations).
43
+ */
44
+ function generateClaudeMd(projectDir, options) {
45
+ const claudeDir = path.join(projectDir, '.claude');
46
+ const claudeMdPath = path.join(claudeDir, 'CLAUDE.md');
47
+ // Check if file exists and was user-customized
48
+ if (fs.existsSync(claudeMdPath)) {
49
+ const existing = fs.readFileSync(claudeMdPath, 'utf-8');
50
+ if (!existing.startsWith(HEADER)) {
51
+ // User has customized it — don't overwrite
52
+ return;
53
+ }
54
+ }
55
+ // Ensure .claude directory exists
56
+ if (!fs.existsSync(claudeDir)) {
57
+ fs.mkdirSync(claudeDir, { recursive: true });
58
+ }
59
+ const content = `${HEADER}
60
+
61
+ > Auto-generated by Cuhlab Companion. Edit freely — this file won't be overwritten
62
+ > unless it starts with "# Cuhlab Project".
63
+
64
+ ## Project Info
65
+
66
+ - **Project ID:** ${options.projectId}
67
+ - **Project URL:** ${options.projectUrl}
68
+
69
+ ## Workflow
70
+
71
+ This project uses Cuhlab for collaborative development. Here's how the workflow works:
72
+
73
+ ### Making Changes
74
+ 1. Edit files locally in this directory
75
+ 2. Use \`git add . && git commit -m "your message" && git push\` to push changes
76
+ 3. Changes appear on your individual branch in the Cuhlab web UI
77
+
78
+ ### Deploying to Live
79
+ To deploy your changes to the live/production site:
80
+ \`\`\`bash
81
+ git add . && git commit -m "update from cuhlab" && git push
82
+ \`\`\`
83
+ Then use the "Deploy to Live" button in the web UI, or the \`push_to_shared\` MCP tool.
84
+
85
+ ### Pulling Latest
86
+ To get the latest changes from the live site:
87
+ \`\`\`bash
88
+ git pull origin main
89
+ \`\`\`
90
+
91
+ ## MCP Tools Reference
92
+
93
+ The following MCP tools are available when connected to Cuhlab:
94
+
95
+ | Tool | Description |
96
+ |------|-------------|
97
+ | \`list_files\` | List files in a directory |
98
+ | \`read_file\` | Read file contents |
99
+ | \`write_file\` | Create or update a file |
100
+ | \`delete_file\` | Delete a file |
101
+ | \`push_to_shared\` | Deploy changes to the live project |
102
+ | \`pull_from_shared\` | Pull latest from live |
103
+ | \`view_pending\` | See open pull requests |
104
+ | \`view_activity\` | See recent merged changes |
105
+ | \`approve_change\` | Approve and merge a PR |
106
+ | \`reject_change\` | Reject a PR with feedback |
107
+ | \`request_approval\` | Ask user for approval (returns approvalId) |
108
+ | \`check_approval\` | Check status of an approval request |
109
+ | \`project_status\` | Get project overview |
110
+ | \`preview_url\` | Get preview URLs |
111
+ | \`get_user_input\` | Check for user messages |
112
+ | \`send_response\` | Send message to user |
113
+
114
+ ## Rules
115
+
116
+ - **Never push directly to main** — always use your branch and create a PR
117
+ - Keep commits small and descriptive
118
+ - Test changes locally before deploying to live
119
+ `;
120
+ fs.writeFileSync(claudeMdPath, content, 'utf-8');
121
+ console.log(' Generated .claude/CLAUDE.md');
122
+ }
123
+ //# sourceMappingURL=claude-md.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"claude-md.js","sourceRoot":"","sources":["../../src/claude-md.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAcA,4CAqFC;AAnGD,uCAAyB;AACzB,2CAA6B;AAE7B,MAAM,MAAM,GAAG,kBAAkB,CAAC;AAOlC;;;GAGG;AACH,SAAgB,gBAAgB,CAC9B,UAAkB,EAClB,OAAwB;IAExB,MAAM,SAAS,GAAG,IAAI,CAAC,IAAI,CAAC,UAAU,EAAE,SAAS,CAAC,CAAC;IACnD,MAAM,YAAY,GAAG,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,WAAW,CAAC,CAAC;IAEvD,+CAA+C;IAC/C,IAAI,EAAE,CAAC,UAAU,CAAC,YAAY,CAAC,EAAE,CAAC;QAChC,MAAM,QAAQ,GAAG,EAAE,CAAC,YAAY,CAAC,YAAY,EAAE,OAAO,CAAC,CAAC;QACxD,IAAI,CAAC,QAAQ,CAAC,UAAU,CAAC,MAAM,CAAC,EAAE,CAAC;YACjC,2CAA2C;YAC3C,OAAO;QACT,CAAC;IACH,CAAC;IAED,kCAAkC;IAClC,IAAI,CAAC,EAAE,CAAC,UAAU,CAAC,SAAS,CAAC,EAAE,CAAC;QAC9B,EAAE,CAAC,SAAS,CAAC,SAAS,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;IAC/C,CAAC;IAED,MAAM,OAAO,GAAG,GAAG,MAAM;;;;;;;oBAOP,OAAO,CAAC,SAAS;qBAChB,OAAO,CAAC,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAoDtC,CAAC;IAEA,EAAE,CAAC,aAAa,CAAC,YAAY,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC;IACjD,OAAO,CAAC,GAAG,CAAC,+BAA+B,CAAC,CAAC;AAC/C,CAAC"}
@@ -0,0 +1,16 @@
1
+ export interface DetectedTool {
2
+ name: string;
3
+ command: string;
4
+ version: string;
5
+ authenticated: boolean;
6
+ }
7
+ /**
8
+ * Detect which AI coding tools are installed on this system.
9
+ * Checks for Claude Code, Codex CLI, and Gemini CLI.
10
+ */
11
+ export declare function detectTools(): Promise<DetectedTool[]>;
12
+ /**
13
+ * Print a summary of detected tools to the console.
14
+ */
15
+ export declare function printToolSummary(tools: DetectedTool[]): void;
16
+ //# sourceMappingURL=detect-tools.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"detect-tools.d.ts","sourceRoot":"","sources":["../../src/detect-tools.ts"],"names":[],"mappings":"AAGA,MAAM,WAAW,YAAY;IAC3B,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;IAChB,aAAa,EAAE,OAAO,CAAC;CACxB;AAED;;;GAGG;AACH,wBAAsB,WAAW,IAAI,OAAO,CAAC,YAAY,EAAE,CAAC,CAyB3D;AAwFD;;GAEG;AACH,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,YAAY,EAAE,GAAG,IAAI,CAgB5D"}
@@ -0,0 +1,133 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.detectTools = detectTools;
4
+ exports.printToolSummary = printToolSummary;
5
+ const child_process_1 = require("child_process");
6
+ const platform_js_1 = require("./platform.js");
7
+ /**
8
+ * Detect which AI coding tools are installed on this system.
9
+ * Checks for Claude Code, Codex CLI, and Gemini CLI.
10
+ */
11
+ async function detectTools() {
12
+ const tools = [];
13
+ // Claude Code
14
+ const claudePath = platform_js_1.platform.claudeCodePath();
15
+ if (claudePath) {
16
+ const tool = await probeClaudeCode(claudePath);
17
+ if (tool)
18
+ tools.push(tool);
19
+ }
20
+ // Codex CLI
21
+ const codexPath = platform_js_1.platform.codexPath();
22
+ if (codexPath) {
23
+ const tool = await probeCodex(codexPath);
24
+ if (tool)
25
+ tools.push(tool);
26
+ }
27
+ // Gemini CLI
28
+ const geminiPath = platform_js_1.platform.geminiPath();
29
+ if (geminiPath) {
30
+ const tool = await probeGemini(geminiPath);
31
+ if (tool)
32
+ tools.push(tool);
33
+ }
34
+ return tools;
35
+ }
36
+ async function probeClaudeCode(binaryPath) {
37
+ let version = 'unknown';
38
+ let authenticated = false;
39
+ try {
40
+ version = (0, child_process_1.execSync)(`"${binaryPath}" --version`, {
41
+ encoding: 'utf8',
42
+ timeout: 10000,
43
+ stdio: ['pipe', 'pipe', 'pipe'],
44
+ }).trim();
45
+ }
46
+ catch {
47
+ // Could not get version but binary exists
48
+ }
49
+ try {
50
+ const authOutput = (0, child_process_1.execSync)(`"${binaryPath}" auth status`, {
51
+ encoding: 'utf8',
52
+ timeout: 10000,
53
+ stdio: ['pipe', 'pipe', 'pipe'],
54
+ }).trim();
55
+ // Claude Code auth status returns info about the authenticated user
56
+ authenticated = authOutput.length > 0 && !authOutput.toLowerCase().includes('not authenticated');
57
+ }
58
+ catch {
59
+ // Auth check failed; assume not authenticated
60
+ }
61
+ return {
62
+ name: 'Claude Code',
63
+ command: binaryPath,
64
+ version,
65
+ authenticated,
66
+ };
67
+ }
68
+ async function probeCodex(binaryPath) {
69
+ let version = 'unknown';
70
+ let authenticated = false;
71
+ try {
72
+ version = (0, child_process_1.execSync)(`"${binaryPath}" --version`, {
73
+ encoding: 'utf8',
74
+ timeout: 10000,
75
+ stdio: ['pipe', 'pipe', 'pipe'],
76
+ }).trim();
77
+ }
78
+ catch {
79
+ // Could not get version
80
+ }
81
+ // Codex CLI authenticates via OPENAI_API_KEY env var
82
+ authenticated = typeof process.env.OPENAI_API_KEY === 'string' && process.env.OPENAI_API_KEY.length > 0;
83
+ return {
84
+ name: 'Codex CLI',
85
+ command: binaryPath,
86
+ version,
87
+ authenticated,
88
+ };
89
+ }
90
+ async function probeGemini(binaryPath) {
91
+ let version = 'unknown';
92
+ let authenticated = false;
93
+ try {
94
+ version = (0, child_process_1.execSync)(`"${binaryPath}" --version`, {
95
+ encoding: 'utf8',
96
+ timeout: 10000,
97
+ stdio: ['pipe', 'pipe', 'pipe'],
98
+ }).trim();
99
+ }
100
+ catch {
101
+ // Could not get version
102
+ }
103
+ // Gemini CLI authenticates via GOOGLE_API_KEY or gcloud
104
+ authenticated =
105
+ (typeof process.env.GOOGLE_API_KEY === 'string' && process.env.GOOGLE_API_KEY.length > 0) ||
106
+ (typeof process.env.GEMINI_API_KEY === 'string' && process.env.GEMINI_API_KEY.length > 0);
107
+ return {
108
+ name: 'Gemini CLI',
109
+ command: binaryPath,
110
+ version,
111
+ authenticated,
112
+ };
113
+ }
114
+ /**
115
+ * Print a summary of detected tools to the console.
116
+ */
117
+ function printToolSummary(tools) {
118
+ if (tools.length === 0) {
119
+ console.log('\n No AI coding tools detected.');
120
+ console.log(' Install Claude Code, Codex CLI, or Gemini CLI to get started.\n');
121
+ return;
122
+ }
123
+ console.log(`\n Detected ${tools.length} AI tool${tools.length > 1 ? 's' : ''}:\n`);
124
+ for (const tool of tools) {
125
+ const authLabel = tool.authenticated ? 'authenticated' : 'not authenticated';
126
+ console.log(` ${tool.name}`);
127
+ console.log(` Path: ${tool.command}`);
128
+ console.log(` Version: ${tool.version}`);
129
+ console.log(` Auth: ${authLabel}`);
130
+ console.log('');
131
+ }
132
+ }
133
+ //# sourceMappingURL=detect-tools.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"detect-tools.js","sourceRoot":"","sources":["../../src/detect-tools.ts"],"names":[],"mappings":";;AAcA,kCAyBC;AA2FD,4CAgBC;AAlJD,iDAAyC;AACzC,+CAAyC;AASzC;;;GAGG;AACI,KAAK,UAAU,WAAW;IAC/B,MAAM,KAAK,GAAmB,EAAE,CAAC;IAEjC,cAAc;IACd,MAAM,UAAU,GAAG,sBAAQ,CAAC,cAAc,EAAE,CAAC;IAC7C,IAAI,UAAU,EAAE,CAAC;QACf,MAAM,IAAI,GAAG,MAAM,eAAe,CAAC,UAAU,CAAC,CAAC;QAC/C,IAAI,IAAI;YAAE,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IAC7B,CAAC;IAED,YAAY;IACZ,MAAM,SAAS,GAAG,sBAAQ,CAAC,SAAS,EAAE,CAAC;IACvC,IAAI,SAAS,EAAE,CAAC;QACd,MAAM,IAAI,GAAG,MAAM,UAAU,CAAC,SAAS,CAAC,CAAC;QACzC,IAAI,IAAI;YAAE,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IAC7B,CAAC;IAED,aAAa;IACb,MAAM,UAAU,GAAG,sBAAQ,CAAC,UAAU,EAAE,CAAC;IACzC,IAAI,UAAU,EAAE,CAAC;QACf,MAAM,IAAI,GAAG,MAAM,WAAW,CAAC,UAAU,CAAC,CAAC;QAC3C,IAAI,IAAI;YAAE,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IAC7B,CAAC;IAED,OAAO,KAAK,CAAC;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O,CAAC,GAAG,CAAC,kCAAkC,CAAC,CAAC;QAChD,OAAO,CAAC,GAAG,CAAC,mEAAmE,CAAC,CAAC;QACjF,OAAO;IACT,CAAC;IAED,OAAO,CAAC,GAAG,CAAC,gBAAgB,KAAK,CAAC,MAAM,WAAW,KAAK,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,KAAK,CAAC,CAAC;IACrF,KAAK,MAAM,IAAI,IAAI,KAAK,EAAE,CAAC;QACzB,MAAM,SAAS,GAAG,IAAI,CAAC,aAAa,CAAC,CAAC,CAAC,eAAe,CAAC,CAAC,CAAC,mBAAmB,CAAC;QAC7E,OAAO,CAAC,GAAG,CAAC,OAAO,IAAI,CAAC,IAAI,EAAE,CAAC,CAAC;QAChC,OAAO,CAAC,GAAG,CAAC,kBAAkB,IAAI,CAAC,OAAO,EAAE,CAAC,CAAC;QAC9C,OAAO,CAAC,GAAG,CAAC,kBAAkB,IAAI,CAAC,OAAO,EAAE,CAAC,CAAC;QAC9C,OAAO,CAAC,GAAG,CAAC,kBAAkB,SAAS,EAAE,CAAC,CAAC;QAC3C,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;IAClB,CAAC;AACH,CAAC"}
@@ -0,0 +1,5 @@
1
+ /**
2
+ * Parse CLI arguments and dispatch to the appropriate command.
3
+ */
4
+ export declare function main(args: string[]): Promise<void>;
5
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAaA;;GAEG;AACH,wBAAsB,IAAI,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CA2BxD"}
@@ -0,0 +1,221 @@
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
+ Object.defineProperty(exports, "__esModule", { value: true });
36
+ exports.main = main;
37
+ const fs = __importStar(require("fs"));
38
+ const server_js_1 = require("./server.js");
39
+ const detect_tools_js_1 = require("./detect-tools.js");
40
+ const version_js_1 = require("./version.js");
41
+ const welcome_js_1 = require("./welcome.js");
42
+ const CUHLAB_API_BASE = 'https://davisbrief.com';
43
+ const URL_PATTERNS = [
44
+ /^https?:\/\/(?:www\.)?davisbrief\.com\/project\/([a-zA-Z0-9_-]+)/,
45
+ /^https?:\/\/localhost:\d+\/project\/([a-zA-Z0-9_-]+)/,
46
+ ];
47
+ /**
48
+ * Parse CLI arguments and dispatch to the appropriate command.
49
+ */
50
+ async function main(args) {
51
+ const command = args[0];
52
+ if (!command || command === '--help' || command === '-h') {
53
+ (0, welcome_js_1.printWelcome)();
54
+ return;
55
+ }
56
+ if (command === '--version' || command === '-v') {
57
+ console.log((0, version_js_1.versionString)());
58
+ return;
59
+ }
60
+ switch (command) {
61
+ case 'connect':
62
+ await handleConnect(args.slice(1));
63
+ break;
64
+ case 'status':
65
+ await handleStatus();
66
+ break;
67
+ default:
68
+ console.error(` Unknown command: ${command}\n`);
69
+ printHelp();
70
+ process.exit(1);
71
+ }
72
+ }
73
+ function printHelp() {
74
+ console.log(`
75
+ ${bold((0, version_js_1.versionString)())}
76
+
77
+ Connect your local AI coding tools to the Cuhlab browser IDE.
78
+
79
+ ${bold('Usage:')}
80
+
81
+ cuhlab connect <project-url> Connect to a Cuhlab project
82
+ cuhlab status Show connection status and detected tools
83
+ cuhlab --help Show this help message
84
+ cuhlab --version Show version number
85
+
86
+ ${bold('Examples:')}
87
+
88
+ cuhlab connect https://davisbrief.com/project/my-app
89
+ cuhlab status
90
+
91
+ ${bold('How it works:')}
92
+
93
+ 1. Run "cuhlab connect <url>" in your project directory
94
+ 2. The companion starts a local terminal and WebSocket server
95
+ 3. Your Cuhlab browser tab connects to the companion
96
+ 4. AI tool actions appear in the browser for review
97
+ 5. Terminal output streams to the browser in real time
98
+ `);
99
+ }
100
+ async function handleConnect(args) {
101
+ const projectUrl = args[0];
102
+ if (!projectUrl) {
103
+ console.error(' Error: Missing project URL.\n');
104
+ console.error(' Usage: cuhlab connect <project-url>');
105
+ console.error(' Example: cuhlab connect https://davisbrief.com/project/my-app\n');
106
+ process.exit(1);
107
+ }
108
+ // Extract project ID from URL
109
+ const projectId = extractProjectId(projectUrl);
110
+ if (!projectId) {
111
+ console.error(' Error: Could not extract project ID from URL.\n');
112
+ console.error(' Expected URL format: https://davisbrief.com/project/<project-id>\n');
113
+ process.exit(1);
114
+ }
115
+ // Determine project directory (current working directory)
116
+ const projectDir = process.cwd();
117
+ if (!fs.existsSync(projectDir)) {
118
+ console.error(` Error: Directory does not exist: ${projectDir}\n`);
119
+ process.exit(1);
120
+ }
121
+ // Determine API base URL
122
+ const apiBaseUrl = extractApiBase(projectUrl);
123
+ console.log(`\n ${bold('Cuhlab Companion')}\n`);
124
+ console.log(` Project: ${projectId}`);
125
+ console.log(` Directory: ${projectDir}`);
126
+ console.log(` API: ${apiBaseUrl}`);
127
+ // Detect installed AI tools
128
+ const tools = await (0, detect_tools_js_1.detectTools)();
129
+ (0, detect_tools_js_1.printToolSummary)(tools);
130
+ // Start the server
131
+ const server = new server_js_1.CompanionServer({
132
+ projectId,
133
+ projectDir,
134
+ apiBaseUrl,
135
+ });
136
+ // Handle graceful shutdown
137
+ const shutdown = async () => {
138
+ console.log('\n Shutting down...');
139
+ await server.stop();
140
+ process.exit(0);
141
+ };
142
+ process.on('SIGINT', shutdown);
143
+ process.on('SIGTERM', shutdown);
144
+ try {
145
+ await server.start();
146
+ console.log(` ${bold('Ready.')} Open your project in the Cuhlab browser to connect.\n`);
147
+ }
148
+ catch (err) {
149
+ const message = err instanceof Error ? err.message : String(err);
150
+ console.error(`\n Error: ${message}\n`);
151
+ process.exit(1);
152
+ }
153
+ }
154
+ async function handleStatus() {
155
+ console.log(`\n ${bold('Cuhlab Companion Status')}\n`);
156
+ // Check if a companion server is already running
157
+ const wsRunning = await checkPort(19836);
158
+ const httpRunning = await checkPort(19837);
159
+ if (wsRunning || httpRunning) {
160
+ console.log(' Companion server: running');
161
+ console.log(` WebSocket (port 19836): ${wsRunning ? 'active' : 'inactive'}`);
162
+ console.log(` Permission (port 19837): ${httpRunning ? 'active' : 'inactive'}`);
163
+ // Try to get status from the WebSocket server's HTTP endpoint
164
+ if (wsRunning) {
165
+ try {
166
+ const response = await fetch('http://127.0.0.1:19836/');
167
+ if (response.ok) {
168
+ const data = await response.json();
169
+ console.log(` Project: ${data.projectId || 'unknown'}`);
170
+ console.log(` PTY: ${data.pty ? 'running' : 'stopped'}`);
171
+ console.log(` Browser: ${data.browser ? 'connected' : 'disconnected'}`);
172
+ if (typeof data.pendingPermissions === 'number' && data.pendingPermissions > 0) {
173
+ console.log(` Pending permissions: ${data.pendingPermissions}`);
174
+ }
175
+ }
176
+ }
177
+ catch {
178
+ // Could not reach server status endpoint
179
+ }
180
+ }
181
+ }
182
+ else {
183
+ console.log(' Companion server: not running');
184
+ }
185
+ // Show detected tools
186
+ const tools = await (0, detect_tools_js_1.detectTools)();
187
+ (0, detect_tools_js_1.printToolSummary)(tools);
188
+ }
189
+ function extractProjectId(urlStr) {
190
+ for (const pattern of URL_PATTERNS) {
191
+ const match = urlStr.match(pattern);
192
+ if (match && match[1]) {
193
+ return match[1];
194
+ }
195
+ }
196
+ return null;
197
+ }
198
+ function extractApiBase(urlStr) {
199
+ try {
200
+ const parsed = new URL(urlStr);
201
+ return `${parsed.protocol}//${parsed.host}`;
202
+ }
203
+ catch {
204
+ return CUHLAB_API_BASE;
205
+ }
206
+ }
207
+ async function checkPort(port) {
208
+ try {
209
+ const response = await fetch(`http://127.0.0.1:${port}/`, {
210
+ signal: AbortSignal.timeout(2000),
211
+ });
212
+ return response.ok;
213
+ }
214
+ catch {
215
+ return false;
216
+ }
217
+ }
218
+ function bold(text) {
219
+ return `\x1b[1m${text}\x1b[0m`;
220
+ }
221
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAgBA,oBA2BC;AA1CD,uCAAyB;AACzB,2CAA8C;AAC9C,uDAAkE;AAClE,6CAA6C;AAC7C,6CAA4C;AAE5C,MAAM,eAAe,GAAG,wBAAwB,CAAC;AACjD,MAAM,YAAY,GAAG;IACnB,kEAAkE;IAClE,sDAAsD;CACvD,CAAC;AAEF;;GAEG;AACI,KAAK,UAAU,IAAI,CAAC,IAAc;IACvC,MAAM,OAAO,GAAG,IAAI,CAAC,CAAC,CAAC,CAAC;IAExB,IAAI,CAAC,OAAO,IAAI,OAAO,KAAK,QAAQ,IAAI,OAAO,KAAK,IAAI,EAAE,CAAC;QACz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,SAAS,cAAc,CAAC,MAAc;IACpC,IAAI,CAAC;QACH,MAAM,MAAM,GAAG,IAAI,GAAG,CAAC,MAAM,CAAC,CAAC;QAC/B,OAAO,GAAG,MAAM,CAAC,QAAQ,KAAK,MAAM,CAAC,IAAI,EAAE,CAAC;IAC9C,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,eAAe,CAAC;IACzB,CAAC;AACH,CAAC;AAED,KAAK,UAAU,SAAS,CAAC,IAAY;IACnC,IAAI,CAAC;QACH,MAAM,QAAQ,GAAG,MAAM,KAAK,CAAC,oBAAoB,IAAI,GAAG,EAAE;YACxD,MAAM,EAAE,WAAW,CAAC,OAAO,CAAC,IAAI,CAAC;SAClC,CAAC,CAAC;QACH,OAAO,QAAQ,CAAC,EAAE,CAAC;IACrB,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,KAAK,CAAC;IACf,CAAC;AACH,CAAC;AAED,SAAS,IAAI,CAAC,IAAY;IACxB,OAAO,UAAU,IAAI,SAAS,CAAC;AACjC,CAAC"}
@@ -0,0 +1,21 @@
1
+ /**
2
+ * Configure Claude Code hooks in the project directory.
3
+ * Writes to .claude/settings.local.json, merging with any existing settings.
4
+ */
5
+ export declare function configureClaudeCode(projectDir: string): boolean;
6
+ /**
7
+ * Configure Codex CLI for the project.
8
+ * Codex CLI uses a .codex/config.json file in the project directory for hooks.
9
+ */
10
+ export declare function configureCodexCli(projectDir: string): boolean;
11
+ /**
12
+ * Configure Gemini CLI for the project.
13
+ * Gemini CLI uses a .gemini/settings.json file in the project directory.
14
+ */
15
+ export declare function configureGeminiCli(projectDir: string): boolean;
16
+ /**
17
+ * Auto-configure all detected AI tools for the given project directory.
18
+ * Returns the number of tools successfully configured.
19
+ */
20
+ export declare function configureAllTools(projectDir: string): number;
21
+ //# sourceMappingURL=mcp-config.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mcp-config.d.ts","sourceRoot":"","sources":["../../src/mcp-config.ts"],"names":[],"mappings":"AAOA;;;GAGG;AACH,wBAAgB,mBAAmB,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAmD/D;AAED;;;GAGG;AACH,wBAAgB,iBAAiB,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAmC7D;AAED;;;GAGG;AACH,wBAAgB,kBAAkB,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAoC9D;AAED;;;GAGG;AACH,wBAAgB,iBAAiB,CAAC,UAAU,EAAE,MAAM,GAAG,MAAM,CAyB5D"}