@volter/world-runtime 3.0.165 → 3.0.167
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/known-external-services.json +0 -1
- package/dist/src/actions-runner.js +53 -14
- package/dist/src/attach.d.ts +9 -0
- package/dist/src/attach.js +9 -2
- package/dist/src/cli-commands.js +19 -3
- package/dist/src/console-apart.js +3 -2
- package/dist/src/credential-door.d.ts +8 -0
- package/dist/src/credential-door.js +54 -0
- package/dist/src/fixture-env.js +2 -2
- package/dist/src/forwardable-headers.d.ts +1 -0
- package/dist/src/forwardable-headers.js +19 -0
- package/dist/src/go-mysql-binding.d.ts +2 -0
- package/dist/src/go-mysql-binding.js +7 -1
- package/dist/src/guest-runner.js +8 -4
- package/dist/src/host-ready.d.ts +7 -3
- package/dist/src/host-ready.js +16 -3
- package/dist/src/index.d.ts +5 -1
- package/dist/src/index.js +4 -1
- package/dist/src/infra.js +10 -5
- package/dist/src/init.d.ts +5 -0
- package/dist/src/init.js +157 -23
- package/dist/src/managed-api-needs.d.ts +101 -0
- package/dist/src/managed-api-needs.js +312 -0
- package/dist/src/managed-api-source.d.ts +24 -0
- package/dist/src/managed-api-source.js +59 -0
- package/dist/src/mongodb-backing.js +33 -58
- package/dist/src/mongodb-command.d.ts +21 -0
- package/dist/src/mongodb-command.js +317 -0
- package/dist/src/pglite-host.mjs +2 -2
- package/dist/src/placeholder.d.ts +24 -1
- package/dist/src/placeholder.js +105 -13
- package/dist/src/process-signal.d.mts +2 -0
- package/dist/src/process-signal.mjs +44 -2
- package/dist/src/project-inspect.d.ts +1 -1
- package/dist/src/project-inspect.js +8 -1
- package/dist/src/redirect-proxy.js +4 -19
- package/dist/src/reflect.js +2 -2
- package/dist/src/runtime.d.ts +5 -1
- package/dist/src/runtime.js +309 -58
- package/dist/src/schema.d.ts +10 -0
- package/dist/src/schema.js +76 -3
- package/dist/src/serve.js +24 -4
- package/dist/src/served-world.d.ts +2 -1
- package/dist/src/served-world.js +6 -4
- package/dist/src/service-command.d.ts +7 -3
- package/dist/src/service-command.js +53 -22
- package/dist/src/service-environment.d.ts +4 -0
- package/dist/src/service-environment.js +21 -0
- package/dist/src/service-recorder.js +9 -13
- package/known-external-services.json +0 -1
- package/package.json +5 -5
- package/src/actions-runner.ts +38 -10
- package/src/attach.ts +15 -2
- package/src/cli-commands.ts +18 -3
- package/src/console-apart.ts +3 -2
- package/src/credential-door.ts +54 -0
- package/src/fixture-env.ts +2 -2
- package/src/forwardable-headers.ts +15 -0
- package/src/go-mysql-binding.ts +8 -1
- package/src/guest-runner.ts +8 -4
- package/src/host-ready.ts +12 -3
- package/src/index.ts +5 -1
- package/src/infra.ts +8 -3
- package/src/init.ts +145 -23
- package/src/managed-api-needs.ts +285 -0
- package/src/managed-api-source.ts +67 -0
- package/src/mongodb-backing.ts +32 -48
- package/src/mongodb-command.ts +238 -0
- package/src/pglite-host.mjs +2 -2
- package/src/placeholder.ts +90 -13
- package/src/process-signal.d.mts +2 -0
- package/src/process-signal.mjs +44 -2
- package/src/project-inspect.ts +9 -2
- package/src/redirect-proxy.ts +4 -15
- package/src/reflect.ts +2 -2
- package/src/runtime.ts +270 -44
- package/src/schema.ts +73 -3
- package/src/serve.ts +22 -4
- package/src/served-world.ts +7 -5
- package/src/service-command.ts +41 -19
- package/src/service-environment.ts +21 -0
- package/src/service-recorder.ts +9 -9
|
@@ -39,6 +39,7 @@ import { readFileSync } from 'node:fs';
|
|
|
39
39
|
import { loadInject } from "./inject-map.js";
|
|
40
40
|
import { packFacts } from "./pack-facts.js";
|
|
41
41
|
import { sessionTrustEnv } from "./ca-trust.js";
|
|
42
|
+
import { forwardableHeaders } from "./forwardable-headers.js";
|
|
42
43
|
/**
|
|
43
44
|
* The body served when a host was MITM'd but no twin serves the PATH.
|
|
44
45
|
*
|
|
@@ -198,24 +199,6 @@ export function twinUnreachableMessage(vendor, origin, err, world) {
|
|
|
198
199
|
const cause = err.cause;
|
|
199
200
|
return `twin "${vendor}" at ${origin} is unreachable${world ? ` in World "${world}"` : ''}: ${errorMessage(err)}${cause?.code ? ` (${cause.code})` : cause?.message ? ` (${errorMessage(cause)})` : ''}; check \`volter-world doctor${world ? ` ${world}` : ''}\`\n`;
|
|
200
201
|
}
|
|
201
|
-
/** The headers of one connection, not of the request (RFC 9110 §7.6.1), with `expect`: the hop that received them
|
|
202
|
-
* answered them (Node's server sends the 100 Continue itself). Node's fetch refuses `transfer-encoding`,
|
|
203
|
-
* `keep-alive`, `upgrade`, `expect` and a `connection` other than close/keep-alive outright, so a `git push` whose
|
|
204
|
-
* pack came chunked (larger than `http.postBuffer`) failed `fetch failed (UND_ERR_INVALID_ARG)`; the body streams
|
|
205
|
-
* on and fetch frames it afresh. */
|
|
206
|
-
const HOP_BY_HOP = ['connection', 'keep-alive', 'proxy-connection', 'transfer-encoding', 'te', 'trailer', 'upgrade', 'expect'];
|
|
207
|
-
const TOKEN = /^[!#$%&'*+.^_`|~0-9a-z-]+$/i;
|
|
208
|
-
function forwardableHeaders(incoming) {
|
|
209
|
-
const headers = new Headers(incoming);
|
|
210
|
-
for (const listed of (incoming.get('connection') ?? '').split(',')) {
|
|
211
|
-
const name = listed.trim();
|
|
212
|
-
if (TOKEN.test(name))
|
|
213
|
-
headers.delete(name);
|
|
214
|
-
}
|
|
215
|
-
for (const h of HOP_BY_HOP)
|
|
216
|
-
headers.delete(h);
|
|
217
|
-
return headers;
|
|
218
|
-
}
|
|
219
202
|
/** Start the ambient redirect proxy. Returns a handle with the listen port + the env to export.
|
|
220
203
|
* - Plain `http://` proxied requests to a vendor host → forwarded to the twin.
|
|
221
204
|
* - `CONNECT host:443` to a vendor host → MITM-terminated with a session-signed leaf, decrypted, and
|
|
@@ -372,7 +355,9 @@ export async function startRedirectProxy(options) {
|
|
|
372
355
|
const hostServer = await serveHttp({
|
|
373
356
|
hostname: '127.0.0.1',
|
|
374
357
|
port: 0,
|
|
375
|
-
|
|
358
|
+
// the leaf, then the session CA that signed it: a client given no CA file can still pin this World's CA by its key
|
|
359
|
+
// (Chrome's --ignore-certificate-errors-spki-list, the manifest's `browser`), which it matches in the chain served
|
|
360
|
+
tls: { key: leaf.key, cert: `${leaf.cert.trimEnd()}\n${readFileSync(ca.caCert, 'utf8')}` },
|
|
376
361
|
// Carry a twin's declared transport cap through TLS termination; public grants add no cap.
|
|
377
362
|
maxRequestBodySize: packFacts()[proxyTargetFor(vendorHost, currentEnv())?.vendor ?? '']?.maxRequestBodySize,
|
|
378
363
|
// A twin can think before its first byte (a git pack built from a cold cache took 19-28 s); Bun's 10 s idle
|
package/dist/src/reflect.js
CHANGED
|
@@ -36,6 +36,7 @@ import { connect as netConnect, createServer as createNetServer } from 'node:net
|
|
|
36
36
|
import { join } from 'node:path';
|
|
37
37
|
import { activeVendorMap, ensureCa, leafCertFor, noTwinMessage, proxyTargetFor, twinUnreachableMessage } from "./redirect-proxy.js";
|
|
38
38
|
import { instanceDir } from "./runtime.js";
|
|
39
|
+
import { forwardableHeaders } from "./forwardable-headers.js";
|
|
39
40
|
// ---------------------------------------------------------------------------
|
|
40
41
|
// Routes — attachment-scoped, file-backed, re-read live by the resolver.
|
|
41
42
|
// ---------------------------------------------------------------------------
|
|
@@ -139,9 +140,8 @@ export async function startReflectFront(options) {
|
|
|
139
140
|
catch {
|
|
140
141
|
return new Response('bad twin origin', { status: 502 });
|
|
141
142
|
}
|
|
142
|
-
const headers =
|
|
143
|
+
const headers = forwardableHeaders(req.headers);
|
|
143
144
|
headers.delete('x-volter-world-browser');
|
|
144
|
-
headers.delete('proxy-connection');
|
|
145
145
|
headers.delete('accept-encoding');
|
|
146
146
|
// the consumer spoke TLS to the front; a twin that answers with an absolute URL (Slack's Socket Mode link)
|
|
147
147
|
// gives the scheme the consumer can reach again, as a vendor behind a TLS-terminating edge does
|
package/dist/src/runtime.d.ts
CHANGED
|
@@ -88,7 +88,7 @@ export declare function withoutVaultSignIn<T extends Record<string, string | und
|
|
|
88
88
|
export declare function recordedWorldNetwork(instance: WorldInstance): WorldNetwork | undefined;
|
|
89
89
|
/** A stopped receipt checks byte consistency before fields are read; it is not authentication. */
|
|
90
90
|
export declare function readWorldBootRecord(name: string, root: string): WorldInstance;
|
|
91
|
-
export declare function admittedEnv(strip: string[] | undefined, env?: NodeJS.ProcessEnv): Record<string, string>;
|
|
91
|
+
export declare function admittedEnv(strip: string[] | undefined, env?: NodeJS.ProcessEnv, platform?: NodeJS.Platform): Record<string, string>;
|
|
92
92
|
/** The names a twin of this World was to issue and did not (its door failed): kept out of every command's env, so a
|
|
93
93
|
* caller's own value (a real key in their shell) never stands in for the credential the World meant to issue. */
|
|
94
94
|
export declare const UNISSUED_ENV = "VOLTER_WORLD_UNISSUED";
|
|
@@ -116,6 +116,10 @@ export declare function managedDatabaseFor(vendor: string, configPath: string |
|
|
|
116
116
|
arg: string;
|
|
117
117
|
url: string;
|
|
118
118
|
} | undefined;
|
|
119
|
+
/** Capture the validated boot's values before an owned executor applies its own environment layers. */
|
|
120
|
+
export declare function worldRequiredCredentialGate(instance: WorldInstance): (env: NodeJS.ProcessEnv, boundary: string) => void;
|
|
121
|
+
/** These transports do not carry required ownership/value authority; refuse instead of exporting an optional-only rendering. */
|
|
122
|
+
export declare function refuseRequiredCredentialTransport(instance: WorldInstance, transport: string, code?: 'WORLD_MACHINE_CAPABILITY_GAP'): void;
|
|
119
123
|
export declare function upWorld(configId: string, options?: UpWorldOptions, abort?: AbortSignal): Promise<WorldInstance>;
|
|
120
124
|
/** The same bounded, identity-checked retirement used by World down, for provider-owned groups.
|
|
121
125
|
* No caller may release a durable receipt when inspection or signal delivery is uncertain. */
|