@react-grab/claude-code 0.0.59 → 0.0.60
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/dist/server.cjs +16 -19
- package/dist/server.d.cts +1 -1
- package/dist/server.d.ts +1 -1
- package/dist/server.js +15 -19
- package/package.json +2 -2
package/dist/server.cjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var net = require('net');
|
|
4
4
|
var http = require('http');
|
|
5
5
|
var http2 = require('http2');
|
|
6
6
|
var stream = require('stream');
|
|
@@ -8,6 +8,7 @@ var crypto = require('crypto');
|
|
|
8
8
|
var path = require('path');
|
|
9
9
|
var url = require('url');
|
|
10
10
|
var events = require('events');
|
|
11
|
+
var child_process = require('child_process');
|
|
11
12
|
var readline = require('readline');
|
|
12
13
|
var fs = require('fs');
|
|
13
14
|
var promises = require('fs/promises');
|
|
@@ -35,6 +36,7 @@ function _interopNamespace(e) {
|
|
|
35
36
|
return Object.freeze(n);
|
|
36
37
|
}
|
|
37
38
|
|
|
39
|
+
var net__default = /*#__PURE__*/_interopDefault(net);
|
|
38
40
|
var crypto__default = /*#__PURE__*/_interopDefault(crypto);
|
|
39
41
|
var fs__namespace = /*#__PURE__*/_interopNamespace(fs);
|
|
40
42
|
|
|
@@ -14646,27 +14648,22 @@ ${content}`;
|
|
|
14646
14648
|
});
|
|
14647
14649
|
return app;
|
|
14648
14650
|
};
|
|
14649
|
-
var
|
|
14650
|
-
|
|
14651
|
-
|
|
14652
|
-
|
|
14653
|
-
|
|
14654
|
-
|
|
14655
|
-
|
|
14656
|
-
|
|
14657
|
-
|
|
14658
|
-
|
|
14659
|
-
|
|
14660
|
-
|
|
14661
|
-
}
|
|
14662
|
-
} catch {
|
|
14651
|
+
var isPortInUse = (port) => new Promise((resolve) => {
|
|
14652
|
+
const server = net__default.default.createServer();
|
|
14653
|
+
server.once("error", () => resolve(true));
|
|
14654
|
+
server.once("listening", () => {
|
|
14655
|
+
server.close();
|
|
14656
|
+
resolve(false);
|
|
14657
|
+
});
|
|
14658
|
+
server.listen(port);
|
|
14659
|
+
});
|
|
14660
|
+
var startServer = async (port = DEFAULT_PORT) => {
|
|
14661
|
+
if (await isPortInUse(port)) {
|
|
14662
|
+
return;
|
|
14663
14663
|
}
|
|
14664
|
-
};
|
|
14665
|
-
var startServer = (port = DEFAULT_PORT) => {
|
|
14666
|
-
killProcessOnPort(port);
|
|
14667
14664
|
const app = createServer();
|
|
14668
14665
|
serve({ fetch: app.fetch, port });
|
|
14669
|
-
console.log(
|
|
14666
|
+
console.log(`[React Grab] Server started on port ${port}`);
|
|
14670
14667
|
};
|
|
14671
14668
|
|
|
14672
14669
|
exports.createServer = createServer;
|
package/dist/server.d.cts
CHANGED
|
@@ -2,6 +2,6 @@ import * as hono_types from 'hono/types';
|
|
|
2
2
|
import { Hono } from 'hono';
|
|
3
3
|
|
|
4
4
|
declare const createServer: () => Hono<hono_types.BlankEnv, hono_types.BlankSchema, "/">;
|
|
5
|
-
declare const startServer: (port?: number) => void
|
|
5
|
+
declare const startServer: (port?: number) => Promise<void>;
|
|
6
6
|
|
|
7
7
|
export { createServer, startServer };
|
package/dist/server.d.ts
CHANGED
|
@@ -2,6 +2,6 @@ import * as hono_types from 'hono/types';
|
|
|
2
2
|
import { Hono } from 'hono';
|
|
3
3
|
|
|
4
4
|
declare const createServer: () => Hono<hono_types.BlankEnv, hono_types.BlankSchema, "/">;
|
|
5
|
-
declare const startServer: (port?: number) => void
|
|
5
|
+
declare const startServer: (port?: number) => Promise<void>;
|
|
6
6
|
|
|
7
7
|
export { createServer, startServer };
|
package/dist/server.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import net from 'net';
|
|
2
2
|
import { createServer as createServer$1 } from 'http';
|
|
3
3
|
import { Http2ServerRequest } from 'http2';
|
|
4
4
|
import { Readable } from 'stream';
|
|
@@ -6,6 +6,7 @@ import crypto, { randomUUID } from 'crypto';
|
|
|
6
6
|
import { dirname, join } from 'path';
|
|
7
7
|
import { fileURLToPath } from 'url';
|
|
8
8
|
import { setMaxListeners } from 'events';
|
|
9
|
+
import { spawn } from 'child_process';
|
|
9
10
|
import { createInterface } from 'readline';
|
|
10
11
|
import * as fs from 'fs';
|
|
11
12
|
import { realpathSync } from 'fs';
|
|
@@ -14621,27 +14622,22 @@ ${content}`;
|
|
|
14621
14622
|
});
|
|
14622
14623
|
return app;
|
|
14623
14624
|
};
|
|
14624
|
-
var
|
|
14625
|
-
|
|
14626
|
-
|
|
14627
|
-
|
|
14628
|
-
|
|
14629
|
-
|
|
14630
|
-
|
|
14631
|
-
|
|
14632
|
-
|
|
14633
|
-
|
|
14634
|
-
|
|
14635
|
-
|
|
14636
|
-
}
|
|
14637
|
-
} catch {
|
|
14625
|
+
var isPortInUse = (port) => new Promise((resolve) => {
|
|
14626
|
+
const server = net.createServer();
|
|
14627
|
+
server.once("error", () => resolve(true));
|
|
14628
|
+
server.once("listening", () => {
|
|
14629
|
+
server.close();
|
|
14630
|
+
resolve(false);
|
|
14631
|
+
});
|
|
14632
|
+
server.listen(port);
|
|
14633
|
+
});
|
|
14634
|
+
var startServer = async (port = DEFAULT_PORT) => {
|
|
14635
|
+
if (await isPortInUse(port)) {
|
|
14636
|
+
return;
|
|
14638
14637
|
}
|
|
14639
|
-
};
|
|
14640
|
-
var startServer = (port = DEFAULT_PORT) => {
|
|
14641
|
-
killProcessOnPort(port);
|
|
14642
14638
|
const app = createServer();
|
|
14643
14639
|
serve({ fetch: app.fetch, port });
|
|
14644
|
-
console.log(
|
|
14640
|
+
console.log(`[React Grab] Server started on port ${port}`);
|
|
14645
14641
|
};
|
|
14646
14642
|
|
|
14647
14643
|
export { createServer, startServer };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@react-grab/claude-code",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.60",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"exports": {
|
|
6
6
|
"./client": {
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
"@anthropic-ai/claude-agent-sdk": "^0.1.0",
|
|
25
25
|
"@hono/node-server": "^1.19.6",
|
|
26
26
|
"hono": "^4.0.0",
|
|
27
|
-
"react-grab": "0.0.
|
|
27
|
+
"react-grab": "0.0.60"
|
|
28
28
|
},
|
|
29
29
|
"scripts": {
|
|
30
30
|
"dev": "tsup --watch",
|