@source-repo/rpc-cli 3.0.0 → 3.2.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.
- package/README.md +612 -708
- package/dist/extract.d.ts.map +1 -1
- package/dist/extract.js +15 -3
- package/dist/extract.js.map +1 -1
- package/dist/fake.d.ts +39 -0
- package/dist/fake.d.ts.map +1 -1
- package/dist/fake.js +26 -3
- package/dist/fake.js.map +1 -1
- package/dist/handlers.d.ts +46 -0
- package/dist/handlers.d.ts.map +1 -0
- package/dist/handlers.js +253 -0
- package/dist/handlers.js.map +1 -0
- package/dist/index.js +37 -4
- package/dist/index.js.map +1 -1
- package/dist/mcp.d.ts +28 -0
- package/dist/mcp.d.ts.map +1 -1
- package/dist/mcp.js +304 -5
- package/dist/mcp.js.map +1 -1
- package/dist/network.d.ts +7 -1
- package/dist/network.d.ts.map +1 -1
- package/dist/network.js +2 -1
- package/dist/network.js.map +1 -1
- package/dist/packages.d.ts +41 -0
- package/dist/packages.d.ts.map +1 -0
- package/dist/packages.js +120 -0
- package/dist/packages.js.map +1 -0
- package/dist/scripting.d.ts +171 -0
- package/dist/scripting.d.ts.map +1 -0
- package/dist/scripting.js +186 -0
- package/dist/scripting.js.map +1 -0
- package/dist/scripts.d.ts +62 -0
- package/dist/scripts.d.ts.map +1 -0
- package/dist/scripts.js +193 -0
- package/dist/scripts.js.map +1 -0
- package/dist/web/app.js +7 -7
- package/dist/web/app.js.map +1 -1
- package/package.json +77 -63
package/dist/scripts.js
ADDED
|
@@ -0,0 +1,193 @@
|
|
|
1
|
+
import { spawn } from 'node:child_process';
|
|
2
|
+
import { existsSync, mkdirSync, readdirSync, readFileSync, rmSync, writeFileSync } from 'node:fs';
|
|
3
|
+
import { extname, join, resolve, sep } from 'node:path';
|
|
4
|
+
import { createInterface } from 'node:readline';
|
|
5
|
+
import { ensureManifest } from './packages.js';
|
|
6
|
+
/**
|
|
7
|
+
* A directory of peers that are kept rather than typed again.
|
|
8
|
+
*
|
|
9
|
+
* `start_fake` answers calls from a contract, which is the two-minute answer and is gone when the
|
|
10
|
+
* conversation ends. A script is the other thing: a real program using the client package, living in
|
|
11
|
+
* a file, that can drive a sequence, poll a device and log what it sees, bridge two networks, or
|
|
12
|
+
* stand up a simulator far past what a method body can hold. It is written once and started again
|
|
13
|
+
* next week.
|
|
14
|
+
*
|
|
15
|
+
* **Each script is its own process.** That is the whole design decision. It means a script can
|
|
16
|
+
* `import` whatever it likes and be run by hand with `node` as easily as through a tool; it means a
|
|
17
|
+
* script that throws, leaks or wedges cannot take the server down with it; and it means starting and
|
|
18
|
+
* stopping are a spawn and a kill rather than a module cache to reason about.
|
|
19
|
+
*
|
|
20
|
+
* It also means a script is **arbitrary code with the privileges of whoever started this server** -
|
|
21
|
+
* more than the sandboxed handlers in handlers.ts, not less. `--scripts <dir>` is what permits it,
|
|
22
|
+
* absent by default, and the directory says exactly where the writing is allowed to happen.
|
|
23
|
+
*
|
|
24
|
+
* TypeScript is the default, because this library's whole idea is that a class is the contract: a
|
|
25
|
+
* script that says `import type { Pump } from '../plant.js'` gets the same typed proxy the rest of
|
|
26
|
+
* the codebase does, which is most of the reason to write one here rather than curl a socket. Node
|
|
27
|
+
* runs it directly - see `nodeArgvFor` for which versions, and `.mjs` for the ones that cannot.
|
|
28
|
+
*/
|
|
29
|
+
/** Scripts are named, not pathed. A name that could climb out of the directory is refused. */
|
|
30
|
+
const SAFE_SCRIPT_NAME = /^[A-Za-z0-9][A-Za-z0-9._-]{0,63}$/;
|
|
31
|
+
/** TypeScript first; `.mjs` for a Node too old to run it, or an author who would rather not. */
|
|
32
|
+
export const SCRIPT_EXTENSIONS = ['.ts', '.mjs'];
|
|
33
|
+
/** Recent output per script, so a model can read what one printed without a terminal. Bounded, since a chatty script must not grow without limit. */
|
|
34
|
+
const KEPT_LINES = 200;
|
|
35
|
+
const assertUsable = (name) => {
|
|
36
|
+
if (!SAFE_SCRIPT_NAME.test(name))
|
|
37
|
+
throw new Error(`'${name}' is not a usable script name`);
|
|
38
|
+
};
|
|
39
|
+
/** Where a script of this language would be written. Proven to stay inside the directory. */
|
|
40
|
+
export const scriptPath = (directory, name, language = 'ts') => {
|
|
41
|
+
assertUsable(name);
|
|
42
|
+
const file = resolve(join(directory, `${name}.${language}`));
|
|
43
|
+
// Proven to stay inside rather than assumed to, the same way contracts and console assets are.
|
|
44
|
+
if (!file.startsWith(resolve(directory) + sep))
|
|
45
|
+
throw new Error(`'${name}' would write outside the scripts directory`);
|
|
46
|
+
return file;
|
|
47
|
+
};
|
|
48
|
+
/** The file a saved script actually occupies, whichever language it was written in. */
|
|
49
|
+
export const scriptFile = (directory, name) => {
|
|
50
|
+
assertUsable(name);
|
|
51
|
+
for (const extension of SCRIPT_EXTENSIONS) {
|
|
52
|
+
const file = scriptPath(directory, name, extension.slice(1));
|
|
53
|
+
if (existsSync(file))
|
|
54
|
+
return file;
|
|
55
|
+
}
|
|
56
|
+
throw new Error(`no script called '${name}' in the scripts directory`);
|
|
57
|
+
};
|
|
58
|
+
export const saveScript = (directory, name, source, language = 'ts') => {
|
|
59
|
+
const file = scriptPath(directory, name, language);
|
|
60
|
+
mkdirSync(resolve(directory), { recursive: true });
|
|
61
|
+
// Written on the way past, because a `.ts` script using `import` inside a CommonJS project makes
|
|
62
|
+
// Node warn on every run, and that warning lands in the script's own output.
|
|
63
|
+
ensureManifest(directory);
|
|
64
|
+
// The other language's file goes, so a script rewritten as TypeScript does not leave a stale
|
|
65
|
+
// .mjs behind for scriptFile to find first.
|
|
66
|
+
for (const other of SCRIPT_EXTENSIONS) {
|
|
67
|
+
const candidate = scriptPath(directory, name, other.slice(1));
|
|
68
|
+
if (candidate !== file && existsSync(candidate))
|
|
69
|
+
rmSync(candidate);
|
|
70
|
+
}
|
|
71
|
+
writeFileSync(file, source.endsWith('\n') ? source : `${source}\n`, 'utf8');
|
|
72
|
+
return file;
|
|
73
|
+
};
|
|
74
|
+
export const readScript = (directory, name) => readFileSync(scriptFile(directory, name), 'utf8');
|
|
75
|
+
export const deleteScript = (directory, name) => rmSync(scriptFile(directory, name));
|
|
76
|
+
export const listScripts = (directory) => {
|
|
77
|
+
try {
|
|
78
|
+
return readdirSync(resolve(directory))
|
|
79
|
+
.filter((file) => SCRIPT_EXTENSIONS.includes(extname(file)))
|
|
80
|
+
.map((file) => ({ name: file.slice(0, -extname(file).length), language: extname(file).slice(1) }))
|
|
81
|
+
.sort((a, b) => a.name.localeCompare(b.name));
|
|
82
|
+
}
|
|
83
|
+
catch {
|
|
84
|
+
// Not yet created is not an error: it is an empty directory that costs nothing to report.
|
|
85
|
+
return [];
|
|
86
|
+
}
|
|
87
|
+
};
|
|
88
|
+
/**
|
|
89
|
+
* What this Node needs in order to run that file.
|
|
90
|
+
*
|
|
91
|
+
* Type stripping landed behind `--experimental-strip-types` in 22.6 and became the default in 23.6,
|
|
92
|
+
* so the flag is passed only where it is both needed and understood - passing it to 24 is a warning,
|
|
93
|
+
* and passing it to 22.5 is an error about an unknown option rather than about TypeScript.
|
|
94
|
+
*/
|
|
95
|
+
export const nodeArgvFor = (file, version = process.versions.node) => {
|
|
96
|
+
if (extname(file) !== '.ts')
|
|
97
|
+
return [file];
|
|
98
|
+
const [major = 0, minor = 0] = version.split('.').map(Number);
|
|
99
|
+
if (major > 23 || (major === 23 && minor >= 6))
|
|
100
|
+
return [file];
|
|
101
|
+
if (major > 22 || (major === 22 && minor >= 6))
|
|
102
|
+
return ['--experimental-strip-types', file];
|
|
103
|
+
throw new Error(`this Node (v${version}) cannot run TypeScript directly - it arrived in 22.6. Save the script as .mjs, or run the server on a newer Node.`);
|
|
104
|
+
};
|
|
105
|
+
/**
|
|
106
|
+
* The network this server is on, handed to a script as environment.
|
|
107
|
+
*
|
|
108
|
+
* So a script does not hardcode a broker url that is right on one machine and wrong on the next -
|
|
109
|
+
* and so a model writing one has something to read rather than a value to invent. The names match
|
|
110
|
+
* the flags they came from, and `SOURCE_RPC_TOKEN` is the one the CLI already reads for credentials.
|
|
111
|
+
*/
|
|
112
|
+
export const environmentFor = (options) => ({
|
|
113
|
+
...(options.broker ? { SOURCE_RPC_BROKER: options.broker } : {}),
|
|
114
|
+
...(options.hub ? { SOURCE_RPC_HUB: options.hub } : {}),
|
|
115
|
+
...(options.prefix ? { SOURCE_RPC_PREFIX: options.prefix } : {}),
|
|
116
|
+
...(options.hubCredentials?.token
|
|
117
|
+
? { SOURCE_RPC_TOKEN: options.hubCredentials.token }
|
|
118
|
+
: {})
|
|
119
|
+
});
|
|
120
|
+
/** Starts, stops and remembers the scripts this server is running. */
|
|
121
|
+
export class ScriptRunner {
|
|
122
|
+
directory;
|
|
123
|
+
environment;
|
|
124
|
+
running = new Map();
|
|
125
|
+
finished = new Map();
|
|
126
|
+
constructor(directory, environment = {}) {
|
|
127
|
+
this.directory = directory;
|
|
128
|
+
this.environment = environment;
|
|
129
|
+
}
|
|
130
|
+
isRunning(name) {
|
|
131
|
+
return this.running.has(name);
|
|
132
|
+
}
|
|
133
|
+
start(name) {
|
|
134
|
+
if (this.running.has(name))
|
|
135
|
+
throw new Error(`'${name}' is already running. Stop it first.`);
|
|
136
|
+
const file = scriptFile(this.directory, name);
|
|
137
|
+
const argv = nodeArgvFor(file);
|
|
138
|
+
const record = { name, startedAt: Date.now(), output: [] };
|
|
139
|
+
const child = spawn(process.execPath, argv, {
|
|
140
|
+
// The script's own directory, so a relative import in it means what its author meant and
|
|
141
|
+
// `@source-repo/rpc` resolves from the project the directory sits in.
|
|
142
|
+
cwd: resolve(this.directory),
|
|
143
|
+
env: { ...process.env, ...this.environment },
|
|
144
|
+
stdio: ['ignore', 'pipe', 'pipe']
|
|
145
|
+
});
|
|
146
|
+
record.pid = child.pid ?? undefined;
|
|
147
|
+
const keep = (prefix) => (line) => {
|
|
148
|
+
record.output.push(`${prefix}${line}`);
|
|
149
|
+
if (record.output.length > KEPT_LINES)
|
|
150
|
+
record.output.splice(0, record.output.length - KEPT_LINES);
|
|
151
|
+
};
|
|
152
|
+
if (child.stdout)
|
|
153
|
+
createInterface({ input: child.stdout }).on('line', keep(''));
|
|
154
|
+
if (child.stderr)
|
|
155
|
+
createInterface({ input: child.stderr }).on('line', keep('! '));
|
|
156
|
+
child.on('exit', (code, signal) => {
|
|
157
|
+
record.ended = { code, signal, at: Date.now() };
|
|
158
|
+
this.running.delete(name);
|
|
159
|
+
// Kept rather than dropped: "it stopped, and here is the last thing it said" is the
|
|
160
|
+
// answer somebody wants, and it is gone if the record goes with the process.
|
|
161
|
+
this.finished.set(name, record);
|
|
162
|
+
});
|
|
163
|
+
child.on('error', (e) => keep('! ')(`could not start: ${e.message}`));
|
|
164
|
+
this.running.set(name, { child, record });
|
|
165
|
+
return record;
|
|
166
|
+
}
|
|
167
|
+
async stop(name) {
|
|
168
|
+
const entry = this.running.get(name);
|
|
169
|
+
if (!entry)
|
|
170
|
+
throw new Error(`'${name}' is not running here.`);
|
|
171
|
+
entry.child.kill();
|
|
172
|
+
// A script that ignores SIGTERM is not allowed to hold the server open indefinitely.
|
|
173
|
+
const ended = new Promise((done) => entry.child.once('exit', () => done()));
|
|
174
|
+
const forced = new Promise((done) => setTimeout(() => {
|
|
175
|
+
entry.child.kill('SIGKILL');
|
|
176
|
+
done();
|
|
177
|
+
}, 2000).unref());
|
|
178
|
+
await Promise.race([ended, forced]);
|
|
179
|
+
this.running.delete(name);
|
|
180
|
+
return entry.record;
|
|
181
|
+
}
|
|
182
|
+
status(name) {
|
|
183
|
+
return this.running.get(name)?.record ?? this.finished.get(name);
|
|
184
|
+
}
|
|
185
|
+
all() {
|
|
186
|
+
return [...[...this.running.values()].map((entry) => entry.record), ...this.finished.values()];
|
|
187
|
+
}
|
|
188
|
+
async stopAll() {
|
|
189
|
+
for (const name of [...this.running.keys()])
|
|
190
|
+
await this.stop(name).catch(() => undefined);
|
|
191
|
+
}
|
|
192
|
+
}
|
|
193
|
+
//# sourceMappingURL=scripts.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"scripts.js","s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