@cerulin/chell 0.2.5

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 (53) hide show
  1. package/README.md +75 -0
  2. package/bin/chell-mcp.mjs +33 -0
  3. package/bin/chell.mjs +37 -0
  4. package/dist/codex/chellMcpStdioBridge.cjs +80 -0
  5. package/dist/codex/chellMcpStdioBridge.d.cts +2 -0
  6. package/dist/codex/chellMcpStdioBridge.d.mts +2 -0
  7. package/dist/codex/chellMcpStdioBridge.mjs +78 -0
  8. package/dist/index-B443j7JQ.mjs +6714 -0
  9. package/dist/index-qS668VWY.cjs +6730 -0
  10. package/dist/index.cjs +42 -0
  11. package/dist/index.d.cts +1 -0
  12. package/dist/index.d.mts +1 -0
  13. package/dist/index.mjs +39 -0
  14. package/dist/lib.cjs +32 -0
  15. package/dist/lib.d.cts +891 -0
  16. package/dist/lib.d.mts +891 -0
  17. package/dist/lib.mjs +22 -0
  18. package/dist/runCodex-DHtm7TWT.cjs +2020 -0
  19. package/dist/runCodex-DLbjgnc4.mjs +2017 -0
  20. package/dist/runGemini-C03RUmvr.mjs +788 -0
  21. package/dist/runGemini-fdb5jxAA.cjs +791 -0
  22. package/dist/types-DBjv5m4J.cjs +2499 -0
  23. package/dist/types-fM_iFuNp.mjs +2452 -0
  24. package/package.json +131 -0
  25. package/scripts/claude_local_launcher.cjs +98 -0
  26. package/scripts/claude_remote_launcher.cjs +13 -0
  27. package/scripts/codex_local_launcher.cjs +155 -0
  28. package/scripts/codex_preload.cjs +56 -0
  29. package/scripts/codex_remote_launcher.cjs +129 -0
  30. package/scripts/obfuscate-dist.mjs +73 -0
  31. package/scripts/pack-chell.cjs +32 -0
  32. package/scripts/publish-scoped.ps1 +58 -0
  33. package/scripts/ripgrep_launcher.cjs +33 -0
  34. package/scripts/unpack-tools.cjs +163 -0
  35. package/tools/archives/difftastic-LICENSE +21 -0
  36. package/tools/archives/difftastic-arm64-darwin.tar.gz +0 -0
  37. package/tools/archives/difftastic-arm64-linux.tar.gz +0 -0
  38. package/tools/archives/difftastic-x64-darwin.tar.gz +0 -0
  39. package/tools/archives/difftastic-x64-linux.tar.gz +0 -0
  40. package/tools/archives/difftastic-x64-win32.tar.gz +0 -0
  41. package/tools/archives/ripgrep-LICENSE +3 -0
  42. package/tools/archives/ripgrep-arm64-darwin.tar.gz +0 -0
  43. package/tools/archives/ripgrep-arm64-linux.tar.gz +0 -0
  44. package/tools/archives/ripgrep-x64-darwin.tar.gz +0 -0
  45. package/tools/archives/ripgrep-x64-linux.tar.gz +0 -0
  46. package/tools/archives/ripgrep-x64-win32.tar.gz +0 -0
  47. package/tools/licenses/difftastic-LICENSE +21 -0
  48. package/tools/licenses/ripgrep-LICENSE +3 -0
  49. package/tools/unpacked/difft +0 -0
  50. package/tools/unpacked/difft.exe +0 -0
  51. package/tools/unpacked/rg +0 -0
  52. package/tools/unpacked/rg.exe +0 -0
  53. package/tools/unpacked/ripgrep.node +0 -0
package/README.md ADDED
@@ -0,0 +1,75 @@
1
+ # Chell (aka Happy)
2
+
3
+ Code on the go controlling claude code from your mobile device.
4
+
5
+ Free. Open source. Code anywhere. test
6
+
7
+ ## Installation
8
+
9
+ ```bash
10
+ # From npm registry (once installed globally, the `chell` command is available)
11
+ npm install -g happy-coder
12
+
13
+ # Or install this local checkout (from the repo root)
14
+ npm install -g .
15
+
16
+ # Alternatively, link for active development
17
+ npm link
18
+ ```
19
+
20
+ ## Usage
21
+
22
+ ```bash
23
+ chell
24
+ ```
25
+
26
+ This will:
27
+ 1. Start a Claude Code session
28
+ 2. Display a QR code to connect from your mobile device
29
+ 3. Allow real-time session sharing between Claude Code and your mobile app
30
+
31
+ ## Options
32
+
33
+ - `-h, --help` - Show help
34
+ - `-v, --version` - Show version
35
+ - `-m, --model <model>` - Claude model to use (default: sonnet)
36
+ - `-p, --permission-mode <mode>` - Permission mode: auto, default, or plan
37
+ - `--claude-env KEY=VALUE` - Set environment variable for Claude Code
38
+ - `--claude-arg ARG` - Pass additional argument to Claude CLI
39
+
40
+ ## Command names
41
+
42
+ - Preferred: `chell` (new)
43
+ - Backwards compatible alias: `happy` (still available)
44
+
45
+ For MCP bridge usage, you can also invoke:
46
+
47
+ ```bash
48
+ chell-mcp
49
+ ```
50
+
51
+ This is identical to the legacy `happy-mcp` entry point.
52
+
53
+ ## Requirements
54
+
55
+ - Node.js >= 20.0.0
56
+ - Required by `eventsource-parser@3.0.5`, which is required by
57
+ `@modelcontextprotocol/sdk`, which we used to implement permission forwarding
58
+ to mobile app
59
+ - Claude CLI installed & logged in (`claude` command available in PATH)
60
+
61
+ ## Developing locally
62
+
63
+ If you want to run without a global install during development on Windows/macOS/Linux:
64
+
65
+ ```bash
66
+ yarn dev # runs the TypeScript entrypoint with tsx
67
+ # or
68
+ yarn build && node bin/chell.mjs # starts the built CLI
69
+ ```
70
+
71
+ Note: on Windows, execute with `node bin/chell.mjs` instead of running the script directly.
72
+
73
+ ## License
74
+
75
+ MIT
@@ -0,0 +1,33 @@
1
+ #!/usr/bin/env node
2
+
3
+ import { execFileSync } from 'child_process';
4
+ import { fileURLToPath } from 'url';
5
+ import { join, dirname } from 'path';
6
+
7
+ // Ensure Node flags to reduce noisy warnings on stdout (which could interfere with MCP)
8
+ const hasNoWarnings = process.execArgv.includes('--no-warnings');
9
+ const hasNoDeprecation = process.execArgv.includes('--no-deprecation');
10
+
11
+ if (!hasNoWarnings || !hasNoDeprecation) {
12
+ const projectRoot = dirname(dirname(fileURLToPath(import.meta.url)));
13
+ const entrypoint = join(projectRoot, 'dist', 'codex', 'chellMcpStdioBridge.mjs');
14
+
15
+ try {
16
+ execFileSync(process.execPath, [
17
+ '--no-warnings',
18
+ '--no-deprecation',
19
+ entrypoint,
20
+ ...process.argv.slice(2)
21
+ ], {
22
+ stdio: 'inherit',
23
+ env: process.env
24
+ });
25
+ } catch (error) {
26
+ process.exit(error.status || 1);
27
+ }
28
+ } else {
29
+ // Already have desired flags; import module directly
30
+ import('../dist/codex/chellMcpStdioBridge.mjs');
31
+ }
32
+
33
+
package/bin/chell.mjs ADDED
@@ -0,0 +1,37 @@
1
+ #!/usr/bin/env node
2
+
3
+ import { execFileSync } from 'child_process';
4
+ import { fileURLToPath } from 'url';
5
+ import { join, dirname } from 'path';
6
+
7
+ // Check if we're already running with the flags
8
+ const hasNoWarnings = process.execArgv.includes('--no-warnings');
9
+ const hasNoDeprecation = process.execArgv.includes('--no-deprecation');
10
+
11
+ if (!hasNoWarnings || !hasNoDeprecation) {
12
+ // Get path to the actual CLI entrypoint
13
+ const projectRoot = dirname(dirname(fileURLToPath(import.meta.url)));
14
+ const entrypoint = join(projectRoot, 'dist', 'index.mjs');
15
+
16
+ // Execute the actual CLI directly with the correct flags
17
+ try {
18
+ execFileSync(process.execPath, [
19
+ '--no-warnings',
20
+ '--no-deprecation',
21
+ entrypoint,
22
+ ...process.argv.slice(2)
23
+ ], {
24
+ stdio: 'inherit',
25
+ env: process.env
26
+ });
27
+ } catch (error) {
28
+ // execFileSync throws if the process exits with non-zero
29
+ process.exit(error.status || 1);
30
+ }
31
+ } else {
32
+ // We're running Node with the flags we wanted, import the CLI entrypoint
33
+ // module to avoid creating a new process.
34
+ import("../dist/index.mjs");
35
+ }
36
+
37
+
@@ -0,0 +1,80 @@
1
+ 'use strict';
2
+
3
+ var mcp_js = require('@modelcontextprotocol/sdk/server/mcp.js');
4
+ var stdio_js = require('@modelcontextprotocol/sdk/server/stdio.js');
5
+ var index_js = require('@modelcontextprotocol/sdk/client/index.js');
6
+ var streamableHttp_js = require('@modelcontextprotocol/sdk/client/streamableHttp.js');
7
+ var z = require('zod');
8
+
9
+ function parseArgs(argv) {
10
+ let url = null;
11
+ for (let i = 0; i < argv.length; i++) {
12
+ const a = argv[i];
13
+ if (a === "--url" && i + 1 < argv.length) {
14
+ url = argv[i + 1];
15
+ i++;
16
+ }
17
+ }
18
+ return { url };
19
+ }
20
+ async function main() {
21
+ const { url: urlFromArgs } = parseArgs(process.argv.slice(2));
22
+ const baseUrl = urlFromArgs || process.env.CHELL_HTTP_MCP_URL || "";
23
+ if (!baseUrl) {
24
+ process.stderr.write(
25
+ "[chell-mcp] Missing target URL. Set CHELL_HTTP_MCP_URL or pass --url <http://127.0.0.1:PORT>\n"
26
+ );
27
+ process.exit(2);
28
+ }
29
+ let httpClient = null;
30
+ async function ensureHttpClient() {
31
+ if (httpClient) return httpClient;
32
+ const client = new index_js.Client(
33
+ { name: "chell-stdio-bridge", version: "1.0.0" },
34
+ { capabilities: { tools: {} } }
35
+ );
36
+ const transport = new streamableHttp_js.StreamableHTTPClientTransport(new URL(baseUrl));
37
+ await client.connect(transport);
38
+ httpClient = client;
39
+ return client;
40
+ }
41
+ const server = new mcp_js.McpServer({
42
+ name: "Chell MCP Bridge",
43
+ version: "1.0.0",
44
+ description: "STDIO bridge forwarding to Chell HTTP MCP"
45
+ });
46
+ server.registerTool(
47
+ "change_title",
48
+ {
49
+ description: "Change the title of the current chat session",
50
+ title: "Change Chat Title",
51
+ inputSchema: {
52
+ title: z.z.string().describe("The new title for the chat session")
53
+ }
54
+ },
55
+ async (args) => {
56
+ try {
57
+ const client = await ensureHttpClient();
58
+ const response = await client.callTool({ name: "change_title", arguments: args });
59
+ return response;
60
+ } catch (error) {
61
+ return {
62
+ content: [
63
+ { type: "text", text: `Failed to change chat title: ${error instanceof Error ? error.message : String(error)}` }
64
+ ],
65
+ isError: true
66
+ };
67
+ }
68
+ }
69
+ );
70
+ const stdio = new stdio_js.StdioServerTransport();
71
+ await server.connect(stdio);
72
+ }
73
+ main().catch((err) => {
74
+ try {
75
+ process.stderr.write(`[chell-mcp] Fatal: ${err instanceof Error ? err.message : String(err)}
76
+ `);
77
+ } finally {
78
+ process.exit(1);
79
+ }
80
+ });
@@ -0,0 +1,2 @@
1
+
2
+ export { };
@@ -0,0 +1,2 @@
1
+
2
+ export { };
@@ -0,0 +1,78 @@
1
+ import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
2
+ import { StdioServerTransport } from '@modelcontextprotocol/sdk/server/stdio.js';
3
+ import { Client } from '@modelcontextprotocol/sdk/client/index.js';
4
+ import { StreamableHTTPClientTransport } from '@modelcontextprotocol/sdk/client/streamableHttp.js';
5
+ import { z } from 'zod';
6
+
7
+ function parseArgs(argv) {
8
+ let url = null;
9
+ for (let i = 0; i < argv.length; i++) {
10
+ const a = argv[i];
11
+ if (a === "--url" && i + 1 < argv.length) {
12
+ url = argv[i + 1];
13
+ i++;
14
+ }
15
+ }
16
+ return { url };
17
+ }
18
+ async function main() {
19
+ const { url: urlFromArgs } = parseArgs(process.argv.slice(2));
20
+ const baseUrl = urlFromArgs || process.env.CHELL_HTTP_MCP_URL || "";
21
+ if (!baseUrl) {
22
+ process.stderr.write(
23
+ "[chell-mcp] Missing target URL. Set CHELL_HTTP_MCP_URL or pass --url <http://127.0.0.1:PORT>\n"
24
+ );
25
+ process.exit(2);
26
+ }
27
+ let httpClient = null;
28
+ async function ensureHttpClient() {
29
+ if (httpClient) return httpClient;
30
+ const client = new Client(
31
+ { name: "chell-stdio-bridge", version: "1.0.0" },
32
+ { capabilities: { tools: {} } }
33
+ );
34
+ const transport = new StreamableHTTPClientTransport(new URL(baseUrl));
35
+ await client.connect(transport);
36
+ httpClient = client;
37
+ return client;
38
+ }
39
+ const server = new McpServer({
40
+ name: "Chell MCP Bridge",
41
+ version: "1.0.0",
42
+ description: "STDIO bridge forwarding to Chell HTTP MCP"
43
+ });
44
+ server.registerTool(
45
+ "change_title",
46
+ {
47
+ description: "Change the title of the current chat session",
48
+ title: "Change Chat Title",
49
+ inputSchema: {
50
+ title: z.string().describe("The new title for the chat session")
51
+ }
52
+ },
53
+ async (args) => {
54
+ try {
55
+ const client = await ensureHttpClient();
56
+ const response = await client.callTool({ name: "change_title", arguments: args });
57
+ return response;
58
+ } catch (error) {
59
+ return {
60
+ content: [
61
+ { type: "text", text: `Failed to change chat title: ${error instanceof Error ? error.message : String(error)}` }
62
+ ],
63
+ isError: true
64
+ };
65
+ }
66
+ }
67
+ );
68
+ const stdio = new StdioServerTransport();
69
+ await server.connect(stdio);
70
+ }
71
+ main().catch((err) => {
72
+ try {
73
+ process.stderr.write(`[chell-mcp] Fatal: ${err instanceof Error ? err.message : String(err)}
74
+ `);
75
+ } finally {
76
+ process.exit(1);
77
+ }
78
+ });