happy-coder 0.10.0-2 → 0.10.0-4

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 (46) hide show
  1. package/README.md +10 -1
  2. package/bin/happy-mcp.mjs +32 -0
  3. package/dist/codex/happyMcpStdioBridge.cjs +80 -0
  4. package/dist/codex/happyMcpStdioBridge.d.cts +2 -0
  5. package/dist/codex/happyMcpStdioBridge.d.mts +2 -0
  6. package/dist/codex/happyMcpStdioBridge.mjs +78 -0
  7. package/dist/index-67rskwL7.cjs +6033 -0
  8. package/dist/index-Dw96QD4T.mjs +6025 -0
  9. package/dist/index.cjs +33 -6024
  10. package/dist/index.mjs +33 -6024
  11. package/dist/lib.cjs +2 -1
  12. package/dist/lib.d.cts +54 -112
  13. package/dist/lib.d.mts +54 -112
  14. package/dist/lib.mjs +2 -1
  15. package/dist/runCodex-BLNf5zb1.cjs +1155 -0
  16. package/dist/runCodex-BNH8w4O9.mjs +1153 -0
  17. package/dist/{types-xfXKJHdM.mjs → types-2wHnX7UW.mjs} +311 -170
  18. package/dist/{types-WP9wteZE.cjs → types-BcDnTXMg.cjs} +348 -206
  19. package/package.json +20 -6
  20. package/scripts/ripgrep_launcher.cjs +2 -26
  21. package/scripts/unpack-tools.cjs +163 -0
  22. package/tools/archives/difftastic-LICENSE +21 -0
  23. package/tools/archives/difftastic-arm64-darwin.tar.gz +0 -0
  24. package/tools/archives/difftastic-arm64-linux.tar.gz +0 -0
  25. package/tools/archives/difftastic-x64-darwin.tar.gz +0 -0
  26. package/tools/archives/difftastic-x64-linux.tar.gz +0 -0
  27. package/tools/archives/difftastic-x64-win32.tar.gz +0 -0
  28. package/tools/archives/ripgrep-arm64-darwin.tar.gz +0 -0
  29. package/tools/archives/ripgrep-arm64-linux.tar.gz +0 -0
  30. package/tools/archives/ripgrep-x64-darwin.tar.gz +0 -0
  31. package/tools/archives/ripgrep-x64-linux.tar.gz +0 -0
  32. package/tools/archives/ripgrep-x64-win32.tar.gz +0 -0
  33. package/tools/licenses/difftastic-LICENSE +21 -0
  34. package/tools/licenses/ripgrep-LICENSE +3 -0
  35. package/tools/unpacked/difft +0 -0
  36. package/ripgrep/arm64-linux/rg +0 -0
  37. package/ripgrep/arm64-linux/ripgrep.node +0 -0
  38. package/ripgrep/x64-darwin/rg +0 -0
  39. package/ripgrep/x64-darwin/ripgrep.node +0 -0
  40. package/ripgrep/x64-linux/rg +0 -0
  41. package/ripgrep/x64-linux/ripgrep.node +0 -0
  42. package/ripgrep/x64-win32/rg.exe +0 -0
  43. package/ripgrep/x64-win32/ripgrep.node +0 -0
  44. /package/{ripgrep/COPYING → tools/archives/ripgrep-LICENSE} +0 -0
  45. /package/{ripgrep/arm64-darwin → tools/unpacked}/rg +0 -0
  46. /package/{ripgrep/arm64-darwin → tools/unpacked}/ripgrep.node +0 -0
package/README.md CHANGED
@@ -21,6 +21,15 @@ This will:
21
21
  2. Display a QR code to connect from your mobile device
22
22
  3. Allow real-time session sharing between Claude Code and your mobile app
23
23
 
24
+ ## Commands
25
+
26
+ - `happy auth` – Manage authentication
27
+ - `happy codex` – Start Codex mode
28
+ - `happy connect` – Store AI vendor API keys in Happy cloud
29
+ - `happy notify` – Send a push notification to your devices
30
+ - `happy daemon` – Manage background service
31
+ - `happy doctor` – System diagnostics & troubleshooting
32
+
24
33
  ## Options
25
34
 
26
35
  - `-h, --help` - Show help
@@ -40,4 +49,4 @@ This will:
40
49
 
41
50
  ## License
42
51
 
43
- MIT
52
+ MIT
@@ -0,0 +1,32 @@
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', 'happyMcpStdioBridge.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/happyMcpStdioBridge.mjs');
31
+ }
32
+
@@ -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.HAPPY_HTTP_MCP_URL || "";
23
+ if (!baseUrl) {
24
+ process.stderr.write(
25
+ "[happy-mcp] Missing target URL. Set HAPPY_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: "happy-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: "Happy MCP Bridge",
43
+ version: "1.0.0",
44
+ description: "STDIO bridge forwarding to Happy 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(`[happy-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.HAPPY_HTTP_MCP_URL || "";
21
+ if (!baseUrl) {
22
+ process.stderr.write(
23
+ "[happy-mcp] Missing target URL. Set HAPPY_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: "happy-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: "Happy MCP Bridge",
41
+ version: "1.0.0",
42
+ description: "STDIO bridge forwarding to Happy 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(`[happy-mcp] Fatal: ${err instanceof Error ? err.message : String(err)}
74
+ `);
75
+ } finally {
76
+ process.exit(1);
77
+ }
78
+ });