claude-relay 2.4.2 → 2.5.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 (75) hide show
  1. package/bin/cli.js +1 -2350
  2. package/package.json +7 -42
  3. package/LICENSE +0 -21
  4. package/README.md +0 -281
  5. package/lib/cli-sessions.js +0 -270
  6. package/lib/config.js +0 -222
  7. package/lib/daemon.js +0 -423
  8. package/lib/ipc.js +0 -112
  9. package/lib/pages.js +0 -714
  10. package/lib/project.js +0 -1224
  11. package/lib/public/app.js +0 -2157
  12. package/lib/public/apple-touch-icon.png +0 -0
  13. package/lib/public/css/base.css +0 -145
  14. package/lib/public/css/diff.css +0 -128
  15. package/lib/public/css/filebrowser.css +0 -1076
  16. package/lib/public/css/highlight.css +0 -144
  17. package/lib/public/css/input.css +0 -512
  18. package/lib/public/css/menus.css +0 -683
  19. package/lib/public/css/messages.css +0 -1159
  20. package/lib/public/css/overlays.css +0 -731
  21. package/lib/public/css/rewind.css +0 -529
  22. package/lib/public/css/sidebar.css +0 -794
  23. package/lib/public/favicon.svg +0 -26
  24. package/lib/public/icon-192.png +0 -0
  25. package/lib/public/icon-512.png +0 -0
  26. package/lib/public/icon-mono.svg +0 -19
  27. package/lib/public/index.html +0 -460
  28. package/lib/public/manifest.json +0 -27
  29. package/lib/public/modules/diff.js +0 -398
  30. package/lib/public/modules/events.js +0 -21
  31. package/lib/public/modules/filebrowser.js +0 -1375
  32. package/lib/public/modules/fileicons.js +0 -172
  33. package/lib/public/modules/icons.js +0 -54
  34. package/lib/public/modules/input.js +0 -578
  35. package/lib/public/modules/markdown.js +0 -149
  36. package/lib/public/modules/notifications.js +0 -643
  37. package/lib/public/modules/qrcode.js +0 -70
  38. package/lib/public/modules/rewind.js +0 -334
  39. package/lib/public/modules/sidebar.js +0 -628
  40. package/lib/public/modules/state.js +0 -3
  41. package/lib/public/modules/terminal.js +0 -658
  42. package/lib/public/modules/theme.js +0 -622
  43. package/lib/public/modules/tools.js +0 -1410
  44. package/lib/public/modules/utils.js +0 -56
  45. package/lib/public/style.css +0 -10
  46. package/lib/public/sw.js +0 -75
  47. package/lib/push.js +0 -125
  48. package/lib/sdk-bridge.js +0 -771
  49. package/lib/server.js +0 -577
  50. package/lib/sessions.js +0 -402
  51. package/lib/terminal-manager.js +0 -187
  52. package/lib/terminal.js +0 -24
  53. package/lib/themes/ayu-light.json +0 -9
  54. package/lib/themes/catppuccin-latte.json +0 -9
  55. package/lib/themes/catppuccin-mocha.json +0 -9
  56. package/lib/themes/claude-light.json +0 -9
  57. package/lib/themes/claude.json +0 -9
  58. package/lib/themes/dracula.json +0 -9
  59. package/lib/themes/everforest-light.json +0 -9
  60. package/lib/themes/everforest.json +0 -9
  61. package/lib/themes/github-light.json +0 -9
  62. package/lib/themes/gruvbox-dark.json +0 -9
  63. package/lib/themes/gruvbox-light.json +0 -9
  64. package/lib/themes/monokai.json +0 -9
  65. package/lib/themes/nord-light.json +0 -9
  66. package/lib/themes/nord.json +0 -9
  67. package/lib/themes/one-dark.json +0 -9
  68. package/lib/themes/one-light.json +0 -9
  69. package/lib/themes/rose-pine-dawn.json +0 -9
  70. package/lib/themes/rose-pine.json +0 -9
  71. package/lib/themes/solarized-dark.json +0 -9
  72. package/lib/themes/solarized-light.json +0 -9
  73. package/lib/themes/tokyo-night-light.json +0 -9
  74. package/lib/themes/tokyo-night.json +0 -9
  75. package/lib/updater.js +0 -96
package/lib/ipc.js DELETED
@@ -1,112 +0,0 @@
1
- var net = require("net");
2
- var fs = require("fs");
3
-
4
- /**
5
- * Create IPC server on a Unix domain socket.
6
- * handler(msg) should return a response object (or a Promise of one).
7
- */
8
- function createIPCServer(sockPath, handler) {
9
- // Remove stale socket file (not needed for Windows named pipes)
10
- if (process.platform !== "win32") {
11
- try { fs.unlinkSync(sockPath); } catch (e) {}
12
- }
13
-
14
- var server = net.createServer(function (conn) {
15
- var buffer = "";
16
- conn.setEncoding("utf8");
17
-
18
- conn.on("data", function (chunk) {
19
- buffer += chunk;
20
- var lines = buffer.split("\n");
21
- buffer = lines.pop(); // keep incomplete line
22
-
23
- for (var i = 0; i < lines.length; i++) {
24
- if (!lines[i].trim()) continue;
25
- try {
26
- var msg = JSON.parse(lines[i]);
27
- var result = handler(msg);
28
- // Support both sync and async handlers
29
- if (result && typeof result.then === "function") {
30
- (function (c) {
31
- result.then(function (res) {
32
- try { c.write(JSON.stringify(res) + "\n"); } catch (e) {}
33
- }).catch(function (err) {
34
- try { c.write(JSON.stringify({ ok: false, error: err.message }) + "\n"); } catch (e) {}
35
- });
36
- })(conn);
37
- } else {
38
- conn.write(JSON.stringify(result) + "\n");
39
- }
40
- } catch (e) {
41
- try { conn.write(JSON.stringify({ ok: false, error: "parse error" }) + "\n"); } catch (e2) {}
42
- }
43
- }
44
- });
45
-
46
- conn.on("error", function () {});
47
- });
48
-
49
- server.listen(sockPath);
50
-
51
- return {
52
- close: function () {
53
- server.close();
54
- if (process.platform !== "win32") {
55
- try { fs.unlinkSync(sockPath); } catch (e) {}
56
- }
57
- },
58
- };
59
- }
60
-
61
- /**
62
- * Send a command to the daemon IPC server and wait for response.
63
- * Returns a Promise resolving to the parsed response.
64
- */
65
- function sendIPCCommand(sockPath, message) {
66
- return new Promise(function (resolve) {
67
- var client = net.connect(sockPath);
68
- var buffer = "";
69
- var done = false;
70
-
71
- var timer = setTimeout(function () {
72
- if (!done) {
73
- done = true;
74
- client.destroy();
75
- resolve({ ok: false, error: "timeout" });
76
- }
77
- }, 3000);
78
-
79
- client.on("connect", function () {
80
- client.write(JSON.stringify(message) + "\n");
81
- });
82
-
83
- client.on("data", function (chunk) {
84
- buffer += chunk;
85
- var idx = buffer.indexOf("\n");
86
- if (idx !== -1 && !done) {
87
- done = true;
88
- clearTimeout(timer);
89
- try {
90
- var resp = JSON.parse(buffer.substring(0, idx));
91
- resolve(resp);
92
- } catch (e) {
93
- resolve({ ok: false, error: "invalid response" });
94
- }
95
- client.destroy();
96
- }
97
- });
98
-
99
- client.on("error", function (err) {
100
- if (!done) {
101
- done = true;
102
- clearTimeout(timer);
103
- resolve({ ok: false, error: err.code === "ECONNREFUSED" ? "daemon not responding" : err.message });
104
- }
105
- });
106
- });
107
- }
108
-
109
- module.exports = {
110
- createIPCServer: createIPCServer,
111
- sendIPCCommand: sendIPCCommand,
112
- };