@ricsam/r5d-worker 0.0.177 → 0.0.178
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/cjs/package.json
CHANGED
|
@@ -20605,7 +20605,7 @@ function resolveEntrypointPath(entrypoint) {
|
|
|
20605
20605
|
}
|
|
20606
20606
|
}
|
|
20607
20607
|
function getR5dctlVersion() {
|
|
20608
|
-
if (true) return "0.0.
|
|
20608
|
+
if (true) return "0.0.178";
|
|
20609
20609
|
const entrypoint = process.argv[1] ? resolveEntrypointPath(process.argv[1]) : null;
|
|
20610
20610
|
let current = entrypoint ? import_node_path2.default.dirname(entrypoint) : process.cwd();
|
|
20611
20611
|
for (let index = 0; index < 12; index += 1) {
|
package/dist/mjs/main.mjs
CHANGED
|
@@ -7,7 +7,7 @@ import { startManagerRpc } from "./runtime/releases/rpc-main.mjs";
|
|
|
7
7
|
import { ManagerRpcConfig } from "./runtime/releases/rpc-protocol.mjs";
|
|
8
8
|
const args = process.argv.slice(2);
|
|
9
9
|
if (args.includes("--version")) {
|
|
10
|
-
console.log(`r5d-worker ${true ? "0.0.
|
|
10
|
+
console.log(`r5d-worker ${true ? "0.0.178" : "development"}`);
|
|
11
11
|
} else if (!args.length || args.includes("--help")) {
|
|
12
12
|
console.log(
|
|
13
13
|
"Usage: r5d-worker start --label <label> [--root <dir>] [--base-url <url>] [--token <worker-token>] [--initial-sync merge|reset]\n r5d-worker executor /absolute/private/config.json\n r5d-worker manager /absolute/private/config.json\n\nRun independently supervised durable runtime services. Provision configuration with r5dinfra."
|
|
@@ -15,7 +15,7 @@ if (args.includes("--version")) {
|
|
|
15
15
|
} else if (args[0] === "start") {
|
|
16
16
|
const runtime = await startPersonalWorker(
|
|
17
17
|
parsePersonalWorkerOptions(args.slice(1)),
|
|
18
|
-
true ? "0.0.
|
|
18
|
+
true ? "0.0.178" : "development"
|
|
19
19
|
);
|
|
20
20
|
console.log(`Worker connected: ${runtime.resourceId}`);
|
|
21
21
|
let closing = false;
|
package/dist/mjs/package.json
CHANGED
|
@@ -26,8 +26,8 @@ function startTerminalStream(options) {
|
|
|
26
26
|
}
|
|
27
27
|
};
|
|
28
28
|
async function attach(ws, frame) {
|
|
29
|
-
const stream = { sessionId: frame.sessionId, operationId: frame.operationId, close: () => {
|
|
30
|
-
}, pending: Buffer.alloc(0), closed: false };
|
|
29
|
+
const stream = { streamId: frame.streamId, sessionId: frame.sessionId, operationId: frame.operationId, close: () => {
|
|
30
|
+
}, pending: Buffer.alloc(0), closed: false, queue: [], draining: null };
|
|
31
31
|
try {
|
|
32
32
|
const subscription = await options.runtime.subscribeTerminal(
|
|
33
33
|
{ sessionId: frame.sessionId, workbench: frame.workbench, operationId: frame.operationId, offset: frame.offset },
|
|
@@ -94,16 +94,27 @@ function startTerminalStream(options) {
|
|
|
94
94
|
if (!pending) return send(ws, { type: "error", streamId: frame.streamId, code: "stream_not_attached" });
|
|
95
95
|
const stream = await pending;
|
|
96
96
|
if (!stream || stream.closed) return send(ws, { type: "error", streamId: frame.streamId, code: "stream_not_attached" });
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
97
|
+
stream.queue.push({ ...frame.data !== void 0 ? { data: frame.data } : {}, ...frame.resize ? { resize: frame.resize } : {} });
|
|
98
|
+
if (!stream.draining) stream.draining = drain(ws, stream);
|
|
99
|
+
}
|
|
100
|
+
async function drain(ws, stream) {
|
|
101
|
+
while (stream.queue.length && !stream.closed) {
|
|
102
|
+
let data = "";
|
|
103
|
+
while (stream.queue.length && stream.queue[0].data !== void 0) data += stream.queue.shift().data;
|
|
104
|
+
const resize = stream.queue[0]?.resize ? stream.queue.shift().resize : void 0;
|
|
105
|
+
if (data === "" && !resize) continue;
|
|
106
|
+
try {
|
|
107
|
+
await options.runtime.terminalInput({
|
|
108
|
+
sessionId: stream.sessionId,
|
|
109
|
+
operationId: stream.operationId,
|
|
110
|
+
...data !== "" ? { data } : {},
|
|
111
|
+
...resize ? { resize } : {}
|
|
112
|
+
});
|
|
113
|
+
} catch (error) {
|
|
114
|
+
send(ws, { type: "error", streamId: stream.streamId, code: safeCode(error) });
|
|
115
|
+
}
|
|
106
116
|
}
|
|
117
|
+
stream.draining = null;
|
|
107
118
|
}
|
|
108
119
|
function open() {
|
|
109
120
|
if (stopped) return;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ricsam/r5d-worker",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.178",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "./dist/mjs/main.mjs",
|
|
6
6
|
"module": "./dist/mjs/main.mjs",
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
"r5d-worker": "dist/mjs/main.mjs"
|
|
22
22
|
},
|
|
23
23
|
"dependencies": {
|
|
24
|
-
"@ricsam/r5d-api": "^0.0.
|
|
24
|
+
"@ricsam/r5d-api": "^0.0.178",
|
|
25
25
|
"node-pty": "1.1.0",
|
|
26
26
|
"zod": "^4.1.13",
|
|
27
27
|
"picomatch": "^4.0.3"
|