@nimbus-sh/core 0.4.0 → 0.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.
- package/README.md +35 -7
- package/dist/_shared/error-text.d.ts +15 -0
- package/dist/_shared/error-text.d.ts.map +1 -0
- package/dist/_shared/error-text.js +21 -0
- package/dist/_shared/exports-resolver.d.ts +19 -7
- package/dist/_shared/exports-resolver.d.ts.map +1 -1
- package/dist/_shared/exports-resolver.js +1 -1
- package/dist/_shared/retry.d.ts.map +1 -1
- package/dist/_shared/retry.js +3 -1
- package/dist/_shared/w7-frame.js +2 -1
- package/dist/constants.d.ts.map +1 -1
- package/dist/constants.js +30 -16
- package/dist/observability/oom-classify.d.ts +1 -1
- package/dist/observability/oom-classify.d.ts.map +1 -1
- package/dist/observability/oom-classify.js +7 -0
- package/dist/observability/oom-discriminator.d.ts +1 -1
- package/dist/runtime/esbuild-service.d.ts +4 -3
- package/dist/runtime/esbuild-service.d.ts.map +1 -1
- package/dist/runtime/esbuild-service.js +9 -4
- package/dist/runtime/installed-runtimes.d.ts +4 -3
- package/dist/runtime/installed-runtimes.d.ts.map +1 -1
- package/dist/runtime/long-running-handle.d.ts +3 -3
- package/dist/runtime/long-running-handle.d.ts.map +1 -1
- package/dist/runtime/os-contracts.d.ts +7 -5
- package/dist/runtime/os-contracts.d.ts.map +1 -1
- package/dist/runtime/port-registry.d.ts +28 -0
- package/dist/runtime/port-registry.d.ts.map +1 -1
- package/dist/runtime/port-registry.js +79 -9
- package/dist/runtime/process-logs.d.ts +9 -1
- package/dist/runtime/process-logs.d.ts.map +1 -1
- package/dist/runtime/project-detect.d.ts +6 -1
- package/dist/runtime/project-detect.d.ts.map +1 -1
- package/dist/runtime/require-resolver.d.ts.map +1 -1
- package/dist/runtime/require-resolver.js +3 -4
- package/dist/runtime/runtime-registry.d.ts +4 -3
- package/dist/runtime/runtime-registry.d.ts.map +1 -1
- package/dist/runtime/runtime-registry.js +2 -1
- package/dist/runtime/sqlite-runtime-fs-bridge.js +1 -5
- package/dist/runtime/virtual-socket-kernel.d.ts.map +1 -1
- package/dist/runtime/virtual-socket-kernel.generated.d.ts +1 -1
- package/dist/runtime/virtual-socket-kernel.generated.d.ts.map +1 -1
- package/dist/runtime/virtual-socket-kernel.generated.js +2 -2
- package/dist/runtime/virtual-socket-kernel.js +10 -5
- package/dist/runtime/wasm-runner.d.ts.map +1 -1
- package/dist/runtime/wasm-runner.js +22 -14
- package/dist/shell/features.d.ts.map +1 -1
- package/dist/shell/features.js +5 -4
- package/dist/shell/unix-commands.d.ts +14 -1
- package/dist/shell/unix-commands.d.ts.map +1 -1
- package/dist/shell/unix-commands.js +115 -69
- package/dist/substrate/lifo/commands/net/ip.d.ts.map +1 -1
- package/dist/substrate/lifo/commands/system/ps.d.ts +2 -1
- package/dist/substrate/lifo/commands/system/ps.d.ts.map +1 -1
- package/dist/substrate/lifo/kernel/ServiceManager.d.ts.map +1 -1
- package/dist/substrate/lifo/kernel/ServiceManager.js +0 -2
- package/dist/substrate/lifo/kernel/network/NetworkStack.d.ts +22 -11
- package/dist/substrate/lifo/kernel/network/NetworkStack.d.ts.map +1 -1
- package/dist/substrate/lifo/kernel/network/NetworkStack.js +0 -2
- package/dist/substrate/lifo/kernel/network/tunnel/WebSocketTunnel.d.ts +2 -1
- package/dist/substrate/lifo/kernel/network/tunnel/WebSocketTunnel.d.ts.map +1 -1
- package/dist/substrate/lifo/kernel/network/tunnel/WebSocketTunnel.js +3 -4
- package/dist/substrate/lifo/kernel/vfs/VFS.d.ts +17 -0
- package/dist/substrate/lifo/kernel/vfs/VFS.d.ts.map +1 -1
- package/dist/substrate/lifo/kernel/vfs/VFS.js +33 -0
- package/dist/substrate/lifo/node-compat/esbuild.d.ts.map +1 -1
- package/dist/substrate/lifo/node-compat/esbuild.js +2 -4
- package/dist/substrate/lifo/node-compat/index.d.ts.map +1 -1
- package/dist/substrate/lifo/node-compat/index.js +3 -2
- package/dist/substrate/lifo/node-compat/loose-equality.d.ts +19 -0
- package/dist/substrate/lifo/node-compat/loose-equality.d.ts.map +1 -0
- package/dist/substrate/lifo/node-compat/loose-equality.js +91 -0
- package/dist/substrate/lifo/node-compat/process.d.ts.map +1 -1
- package/dist/substrate/lifo/node-compat/process.js +6 -3
- package/dist/substrate/lifo/shell/Shell.d.ts +19 -0
- package/dist/substrate/lifo/shell/Shell.d.ts.map +1 -1
- package/dist/substrate/lifo/shell/Shell.js +86 -75
- package/dist/substrate/lifo/shell/lexer.d.ts +9 -0
- package/dist/substrate/lifo/shell/lexer.d.ts.map +1 -1
- package/dist/substrate/lifo/shell/lexer.js +40 -0
- package/dist/vfs/seed-project.d.ts.map +1 -1
- package/dist/vfs/seed-project.js +8 -2
- package/dist/vfs/sqlite-vfs.d.ts +61 -1
- package/dist/vfs/sqlite-vfs.d.ts.map +1 -1
- package/dist/vfs/sqlite-vfs.js +199 -35
- package/package.json +1 -1
- package/src/_shared/error-text.ts +21 -0
- package/src/_shared/exports-resolver.ts +24 -4
- package/src/_shared/retry.ts +4 -2
- package/src/_shared/w7-frame.ts +2 -1
- package/src/constants.ts +30 -16
- package/src/observability/oom-classify.ts +7 -0
- package/src/observability/oom-discriminator.ts +1 -1
- package/src/runtime/esbuild-service.ts +16 -11
- package/src/runtime/installed-runtimes.ts +4 -3
- package/src/runtime/long-running-handle.ts +3 -3
- package/src/runtime/os-contracts.ts +7 -5
- package/src/runtime/port-registry.ts +97 -9
- package/src/runtime/process-logs.ts +12 -3
- package/src/runtime/project-detect.ts +7 -1
- package/src/runtime/require-resolver.ts +7 -7
- package/src/runtime/runtime-registry.ts +9 -7
- package/src/runtime/sqlite-runtime-fs-bridge.ts +9 -6
- package/src/runtime/virtual-socket-kernel.generated.ts +2 -2
- package/src/runtime/virtual-socket-kernel.ts +10 -5
- package/src/runtime/wasm-runner.ts +55 -29
- package/src/shell/features.ts +5 -4
- package/src/shell/unix-commands.ts +273 -128
- package/src/substrate/lifo/commands/net/ip.ts +15 -15
- package/src/substrate/lifo/commands/system/ps.ts +2 -1
- package/src/substrate/lifo/kernel/ServiceManager.ts +0 -2
- package/src/substrate/lifo/kernel/network/NetworkStack.ts +24 -17
- package/src/substrate/lifo/kernel/network/tunnel/WebSocketTunnel.ts +37 -12
- package/src/substrate/lifo/kernel/vfs/VFS.ts +34 -0
- package/src/substrate/lifo/node-compat/esbuild.ts +16 -8
- package/src/substrate/lifo/node-compat/index.ts +3 -2
- package/src/substrate/lifo/node-compat/loose-equality.ts +81 -0
- package/src/substrate/lifo/node-compat/process.ts +5 -2
- package/src/substrate/lifo/shell/Shell.ts +92 -70
- package/src/substrate/lifo/shell/lexer.ts +38 -0
- package/src/vfs/seed-project.ts +10 -3
- package/src/vfs/sqlite-vfs.ts +209 -36
|
@@ -99,7 +99,9 @@ function encodeHttpRequest(request, body) {
|
|
|
99
99
|
headers.set('Content-Length', String(body.byteLength));
|
|
100
100
|
}
|
|
101
101
|
const lines = [`${request.method} ${path} HTTP/1.1`];
|
|
102
|
-
headers.forEach((value, key) =>
|
|
102
|
+
headers.forEach((value, key) => {
|
|
103
|
+
lines.push(`${key}: ${value}`);
|
|
104
|
+
});
|
|
103
105
|
lines.push('', '');
|
|
104
106
|
return concatBytes([new TextEncoder().encode(lines.join('\r\n')), body]);
|
|
105
107
|
}
|
|
@@ -115,7 +117,9 @@ function encodeHttpRequest(request, body) {
|
|
|
115
117
|
*/
|
|
116
118
|
function encodeHttpResponseHead(status, statusText, headers, chunkedBody) {
|
|
117
119
|
const lines = [`HTTP/1.1 ${status} ${statusText}`];
|
|
118
|
-
headers.forEach((value, key) =>
|
|
120
|
+
headers.forEach((value, key) => {
|
|
121
|
+
lines.push(`${key}: ${value}`);
|
|
122
|
+
});
|
|
119
123
|
if (chunkedBody)
|
|
120
124
|
lines.push('Transfer-Encoding: chunked');
|
|
121
125
|
lines.push('Connection: close');
|
|
@@ -647,8 +651,8 @@ class LoopbackClientConnection {
|
|
|
647
651
|
throw new Error('Nimbus loopback socket: read before a complete HTTP request was written ' +
|
|
648
652
|
'(loopback sockets carry HTTP requests, not arbitrary byte streams)');
|
|
649
653
|
}
|
|
650
|
-
|
|
651
|
-
await
|
|
654
|
+
this.readable ??= new Deferred();
|
|
655
|
+
await this.readable.promise;
|
|
652
656
|
}
|
|
653
657
|
}
|
|
654
658
|
close() {
|
|
@@ -775,7 +779,8 @@ class LoopbackClientConnection {
|
|
|
775
779
|
awaitDrain() {
|
|
776
780
|
if (this.inbound.pendingBytes <= LOOPBACK_READ_HIGH_WATER_BYTES)
|
|
777
781
|
return Promise.resolve();
|
|
778
|
-
|
|
782
|
+
this.drained ??= new Deferred();
|
|
783
|
+
return this.drained.promise;
|
|
779
784
|
}
|
|
780
785
|
withTimeout(promise) {
|
|
781
786
|
let timer = null;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"wasm-runner.d.ts","sourceRoot":"","sources":["../../src/runtime/wasm-runner.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+CG;AAEH,OAAO,KAAK,EAAE,cAAc,EAAE,gBAAgB,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AAC3F,OAAO,KAAK,EAAS,SAAS,EAAE,MAAM,iBAAiB,CAAC;AACxD,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,iCAAiC,CAAC;AAChF,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;
|
|
1
|
+
{"version":3,"file":"wasm-runner.d.ts","sourceRoot":"","sources":["../../src/runtime/wasm-runner.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+CG;AAEH,OAAO,KAAK,EAAE,cAAc,EAAE,gBAAgB,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AAC3F,OAAO,KAAK,EAAS,SAAS,EAAE,MAAM,iBAAiB,CAAC;AACxD,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,iCAAiC,CAAC;AAChF,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AAmDtD,eAAO,MAAM,mBAAmB,UAAU,CAAC;AAE3C,eAAO,MAAM,gBAAgB,QAoCwC,CAAC;AAEtE,wBAAgB,wBAAwB,IAAI,MAAM,CASjD;AAyCD;;;;;GAKG;AACH,wBAAgB,cAAc,CAAC,IAAI,EAAE;IACnC,GAAG,EAAE,SAAS,CAAC;IACf,MAAM,EAAE,SAAS,CAAC;IAClB,SAAS,EAAE,wBAAwB,CAAC;CACrC,IAEG,OAAO,MAAM,EACb,MAAM,cAAc,KACnB,OAAO,CAAC,gBAAgB,CAAC,CA+mB7B;AAED;;;;;;;GAOG;AACH,wBAAgB,cAAc,CAAC,IAAI,EAAE;IACnC,GAAG,EAAE,SAAS,CAAC;IACf,MAAM,EAAE,SAAS,CAAC;IAClB,SAAS,EAAE,wBAAwB,CAAC;CACrC,GAAG,WAAW,CAgBd"}
|
|
@@ -50,6 +50,7 @@ import { requireVfsCred, WASM32_WASI_NIMBUS_ABI } from './os-contracts.js';
|
|
|
50
50
|
import { WASI_INSTANCE_PREAMBLE_SRC, WASI_IMPLEMENTED_FNS, WASI_ABI_NAMESPACE } from './wasi-instance.js';
|
|
51
51
|
import { inspectWasmThreads, wasiThreadsLoadError } from './wasi-threads.js';
|
|
52
52
|
import { withMemoryLimit, DEFAULT_WASM_PROCESS_LIMIT_BYTES } from './wasm-memory.js';
|
|
53
|
+
import { errorText } from '../_shared/error-text.js';
|
|
53
54
|
export const WASM_RUNNER_VERSION = '0.3.0';
|
|
54
55
|
export const WASM_RUNNER_HELP = 'Usage: wasm-runner [options] <file.wasm> [exportName] [int args...]\n' +
|
|
55
56
|
' wasm-runner --version\n' +
|
|
@@ -271,6 +272,12 @@ export function makeWasmRunner(deps) {
|
|
|
271
272
|
// overly conservative; cast to ArrayBuffer is correct.
|
|
272
273
|
const buf = limited.buffer.slice(limited.byteOffset, limited.byteOffset + limited.byteLength);
|
|
273
274
|
const facetFn = async function wasmFacetCall(args, facetEnv) {
|
|
275
|
+
// This body is serialized into the facet isolate, where the supervisor's
|
|
276
|
+
// module graph — and so _shared/error-text.js — does not exist. Same
|
|
277
|
+
// fallback as errorText, spelled out locally.
|
|
278
|
+
const errText = (err) => typeof err === 'object' && err !== null && 'message' in err && err.message
|
|
279
|
+
? String(err.message)
|
|
280
|
+
: String(err);
|
|
274
281
|
const wasmTable = globalThis.__NIMBUS_WASM || {};
|
|
275
282
|
const mod = wasmTable['user.wasm'];
|
|
276
283
|
if (!mod) {
|
|
@@ -390,7 +397,7 @@ export function makeWasmRunner(deps) {
|
|
|
390
397
|
mode: 'wasi',
|
|
391
398
|
error: `wasi-threads: could not reserve the shared memory the module declares `
|
|
392
399
|
+ `(${args.threads.memory.initial}–${args.threads.memory.maximum} pages, `
|
|
393
|
-
+ `${(args.threads.memory.maximum * 64) / 1024} MiB): ${e
|
|
400
|
+
+ `${(args.threads.memory.maximum * 64) / 1024} MiB): ${errText(e)}. `
|
|
394
401
|
+ 'A shared memory reserves its maximum immediately — lower --max-memory.',
|
|
395
402
|
};
|
|
396
403
|
}
|
|
@@ -414,11 +421,14 @@ export function makeWasmRunner(deps) {
|
|
|
414
421
|
return {
|
|
415
422
|
ok: false,
|
|
416
423
|
mode: 'wasi',
|
|
417
|
-
error: `instantiate failed: ${e
|
|
424
|
+
error: `instantiate failed: ${errText(e)}`,
|
|
418
425
|
};
|
|
419
426
|
}
|
|
420
|
-
if (!memRef.mem)
|
|
421
|
-
|
|
427
|
+
if (!memRef.mem) {
|
|
428
|
+
const exported = inst.exports.memory;
|
|
429
|
+
if (exported instanceof WebAssembly.Memory)
|
|
430
|
+
memRef.mem = exported;
|
|
431
|
+
}
|
|
422
432
|
if (!memRef.mem) {
|
|
423
433
|
return {
|
|
424
434
|
ok: false,
|
|
@@ -464,7 +474,7 @@ export function makeWasmRunner(deps) {
|
|
|
464
474
|
return {
|
|
465
475
|
ok: false,
|
|
466
476
|
mode: 'direct',
|
|
467
|
-
error: `instantiate failed: ${e
|
|
477
|
+
error: `instantiate failed: ${errText(e)}`,
|
|
468
478
|
};
|
|
469
479
|
}
|
|
470
480
|
const exportNames = Object.keys(inst.exports);
|
|
@@ -487,7 +497,7 @@ export function makeWasmRunner(deps) {
|
|
|
487
497
|
ok: false,
|
|
488
498
|
mode: 'direct',
|
|
489
499
|
exports: exportNames,
|
|
490
|
-
error: `${args.exportName}(${(args.intArgs || []).join(', ')}) threw: ${e
|
|
500
|
+
error: `${args.exportName}(${(args.intArgs || []).join(', ')}) threw: ${errText(e)}`,
|
|
491
501
|
};
|
|
492
502
|
}
|
|
493
503
|
// BigInt (i64) → string; everything else → as-is.
|
|
@@ -585,7 +595,7 @@ export function makeWasmRunner(deps) {
|
|
|
585
595
|
}));
|
|
586
596
|
}
|
|
587
597
|
catch (e) {
|
|
588
|
-
outcome = { ok: false, error: `dispatch failed: ${e
|
|
598
|
+
outcome = { ok: false, error: `dispatch failed: ${errorText(e)}` };
|
|
589
599
|
}
|
|
590
600
|
finally {
|
|
591
601
|
facet?.dispose();
|
|
@@ -603,15 +613,13 @@ export function makeWasmRunner(deps) {
|
|
|
603
613
|
// If runStart reported an `error` (wasm trapped, _start missing,
|
|
604
614
|
// …), append it to stderr but still surface its exitCode (default
|
|
605
615
|
// 1 from runStart on trap) so callers can distinguish.
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
stderr = wasiOut.stderr || '';
|
|
610
|
-
if (wasiOut.error) {
|
|
616
|
+
stdout = outcome.stdout || '';
|
|
617
|
+
stderr = outcome.stderr || '';
|
|
618
|
+
if (outcome.error) {
|
|
611
619
|
stderr = (stderr ? stderr : '') +
|
|
612
|
-
`wasm-runner: wasi trap: ${
|
|
620
|
+
`wasm-runner: wasi trap: ${outcome.error}\n`;
|
|
613
621
|
}
|
|
614
|
-
exitCode =
|
|
622
|
+
exitCode = outcome.exitCode ?? (outcome.ok ? 0 : 1);
|
|
615
623
|
}
|
|
616
624
|
else if (!outcome.ok) {
|
|
617
625
|
// Direct-mode failure or pre-instantiate dispatch failure — shell
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"features.d.ts","sourceRoot":"","sources":["../../src/shell/features.ts"],"names":[],"mappings":"AAGA,UAAU,SAAS;IACjB,WAAW,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IACzC,WAAW,IAAI,IAAI,CAAC;IACpB,WAAW,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;IAChC,eAAe,IAAI,IAAI,CAAC;IACxB,UAAU,IAAI,IAAI,CAAC;IACnB,OAAO,EAAE,OAAO,CAAC;IACjB,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,UAAU,EAAE,MAAM,CAAC;IACnB,SAAS,EAAE,MAAM,CAAC;IAClB,eAAe,EAAE,MAAM,CAAC;IACxB,YAAY,EAAE,MAAM,CAAC;IACrB,UAAU,EAAE,MAAM,EAAE,CAAC;CACtB;AAED,UAAU,YAAY;IACpB,KAAK,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;CAC3B;AAED,MAAM,WAAW,WAAW;IAC1B,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,EAAE,KAAK,CAAC;QAChB,SAAS,EAAE,MAAM,CAAC;QAClB,SAAS,EAAE,OAAO,CAAC;KACpB,CAAC,CAAC;CACJ;AAED,wBAAgB,YAAY,CAAC,KAAK,EAAE,MAAM,GAAG,WAAW,GAAG,IAAI,CAkB9D;AAED,qBAAa,cAAc;IACzB,OAAO,CAAC,KAAK,CAAY;IACzB,OAAO,CAAC,QAAQ,CAAe;IAC/B,OAAO,CAAC,mBAAmB,CAAkD;IAC7E,OAAO,CAAC,mBAAmB,CAA6B;IACxD,OAAO,CAAC,mBAAmB,CAAyC;IAGpE,OAAO,CAAC,MAAM,CAAS;IACvB,OAAO,CAAC,WAAW,CAA4B;I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E;IAClE,OAAO,CAAC,cAAc;IAStB,4DAA4D;IAC5D,OAAO,CAAC,YAAY;IAWpB,OAAO,CAAC,kBAAkB;IAuB1B,OAAO,CAAC,YAAY;IAiCpB,OAAO,CAAC,aAAa;IAOrB,OAAO,CAAC,cAAc;IA0EtB,qEAAqE;IACrE,OAAO,CAAC,eAAe;IAavB,8DAA8D;IAC9D,OAAO,CAAC,cAAc;IAgBtB,OAAO,CAAC,oBAAoB;IAM5B,qCAAqC;IACrC,OAAO,CAAC,cAAc;IAWtB;;;;OAIG;IACH,OAAO,CAAC,YAAY;CAWrB"}
|
package/dist/shell/features.js
CHANGED
|
@@ -121,7 +121,7 @@ export class HeredocHandler {
|
|
|
121
121
|
}
|
|
122
122
|
return;
|
|
123
123
|
}
|
|
124
|
-
|
|
124
|
+
this._handleOriginalInput(data);
|
|
125
125
|
};
|
|
126
126
|
this.shell.executeLine = async (line) => {
|
|
127
127
|
if (this.active) {
|
|
@@ -144,7 +144,7 @@ export class HeredocHandler {
|
|
|
144
144
|
this._accumulateLine('');
|
|
145
145
|
return;
|
|
146
146
|
}
|
|
147
|
-
|
|
147
|
+
this._printPrompt();
|
|
148
148
|
};
|
|
149
149
|
}
|
|
150
150
|
_printPrompt() {
|
|
@@ -353,7 +353,8 @@ export class LineEditorExtender {
|
|
|
353
353
|
// shell-prompt input. Process-stdin input has its own model
|
|
354
354
|
// (terminalStdin / stdinLineBuffer) handled by the shell.
|
|
355
355
|
if (this.shell.running) {
|
|
356
|
-
|
|
356
|
+
this.originalHandleInput(data);
|
|
357
|
+
return;
|
|
357
358
|
}
|
|
358
359
|
// Reverse-i-search sub-mode owns ALL input until exited.
|
|
359
360
|
if (this.rsearchActive) {
|
|
@@ -368,7 +369,7 @@ export class LineEditorExtender {
|
|
|
368
369
|
// Try each binding. First-match wins; on no match fall through.
|
|
369
370
|
if (this._handleBinding(data))
|
|
370
371
|
return;
|
|
371
|
-
|
|
372
|
+
this.originalHandleInput(data);
|
|
372
373
|
};
|
|
373
374
|
}
|
|
374
375
|
/**
|
|
@@ -11,5 +11,18 @@
|
|
|
11
11
|
* touch, stat, file, xxd, base64, sha256sum, id, hostname, realpath
|
|
12
12
|
*/
|
|
13
13
|
import type { SqliteVFS } from '../vfs/sqlite-vfs.js';
|
|
14
|
-
|
|
14
|
+
import type { Command } from '../substrate/lifo/commands/types.js';
|
|
15
|
+
/**
|
|
16
|
+
* The registry these commands dispatch through: registration, and name
|
|
17
|
+
* resolution for `which`, `type`, `command`, `find -exec` and `xargs`.
|
|
18
|
+
* `resolve` answers `unknown` because the registry holds whatever any module
|
|
19
|
+
* registered — and the worker's npm-bin fallback replaces the method outright
|
|
20
|
+
* — so what comes back is a command only once it has been checked.
|
|
21
|
+
*/
|
|
22
|
+
type UnixCommandRegistry = {
|
|
23
|
+
register(name: string, handler: Command): void;
|
|
24
|
+
resolve(name: string): unknown;
|
|
25
|
+
};
|
|
26
|
+
export declare function registerUnixCommands(registry: UnixCommandRegistry, sqliteVfs: SqliteVFS): void;
|
|
27
|
+
export {};
|
|
15
28
|
//# sourceMappingURL=unix-commands.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"unix-commands.d.ts","sourceRoot":"","sources":["../../src/shell/unix-commands.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,KAAK,EAAmB,SAAS,EAAE,MAAM,sBAAsB,CAAC;
|
|
1
|
+
{"version":3,"file":"unix-commands.d.ts","sourceRoot":"","sources":["../../src/shell/unix-commands.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,KAAK,EAAmB,SAAS,EAAE,MAAM,sBAAsB,CAAC;AAavE,OAAO,KAAK,EAAE,OAAO,EAAsB,MAAM,qCAAqC,CAAC;AAoFvF;;;;;;GAMG;AACH,KAAK,mBAAmB,GAAG;IACzB,QAAQ,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,GAAG,IAAI,CAAC;IAC/C,OAAO,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC;CAChC,CAAC;AAgmIF,wBAAgB,oBAAoB,CAClC,QAAQ,EAAE,mBAAmB,EAC7B,SAAS,EAAE,SAAS,GACnB,IAAI,CAoKN"}
|