@mostra/conformance 0.6.1 → 0.7.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/dist/cli.js +1 -1
- package/dist/index.d.ts +6 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -3
- package/dist/{protocol-RQ9lbehE.js → protocol-Bi4gZzsu.js} +23 -2
- package/dist/{protocol-RQ9lbehE.js.map → protocol-Bi4gZzsu.js.map} +1 -1
- package/dist/{reference-host-D7fe25go.js → reference-host-BAAxMabg.js} +30 -3
- package/dist/reference-host-BAAxMabg.js.map +1 -0
- package/dist/{reference-host-BJ-A_Qd_.d.ts → reference-host-DYKrtRCH.d.ts} +27 -1
- package/dist/{reference-host-BJ-A_Qd_.d.ts.map → reference-host-DYKrtRCH.d.ts.map} +1 -1
- package/dist/reference-host.d.ts +1 -1
- package/dist/reference-host.js +1 -1
- package/dist/{runner-C8SO70qb.js → runner-DYbtXiL9.js} +248 -54
- package/dist/runner-DYbtXiL9.js.map +1 -0
- package/package.json +5 -4
- package/src/harness/protocol.ts +52 -1
- package/src/reference-host.ts +33 -0
- package/src/scenario.ts +7 -0
- package/src/scenarios/ports.ts +199 -4
- package/src/viewer.ts +59 -7
- package/tunnels/cloudflared.mjs +61 -0
- package/tunnels/forward.mjs +128 -0
- package/tunnels/tailscale.mjs +125 -0
- package/dist/reference-host-D7fe25go.js.map +0 -1
- package/dist/runner-C8SO70qb.js.map +0 -1
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
/**
|
|
3
|
+
* A stand-in for the `tailscale` command line, for tests (`MOSTRA_TEST_TUNNELS`). It answers the
|
|
4
|
+
* three commands a Mostra share runs, as Tailscale 1.102 does (VERIFIED_FACTS, WP-13):
|
|
5
|
+
*
|
|
6
|
+
* - `status --json`: a running device named `localhost` on a tailnet with MagicDNS;
|
|
7
|
+
* - `serve status --json`: the device's own configuration (`MOSTRA_FAKE_TAILSCALE_SERVED`, a
|
|
8
|
+
* comma-separated port list, else none);
|
|
9
|
+
* - `serve|funnel --https=<port> <local>`, in the foreground: it forwards plain HTTP on loopback to
|
|
10
|
+
* `<local>`, prints the address, and, like Tailscale, removes any `Tailscale-*` header a request
|
|
11
|
+
* brought, then adds the tailnet person's (`serve`) or `Tailscale-Funnel-Request: ?1` (`funnel`).
|
|
12
|
+
*
|
|
13
|
+
* `MOSTRA_FAKE_TAILSCALE` plays what can go wrong: `stopped` (not signed in), `no-serve` and
|
|
14
|
+
* `no-funnel` (the feature isn't enabled for the tailnet). The person is
|
|
15
|
+
* `MOSTRA_FAKE_TAILNET_USER` (`login|Display Name`), sent in RFC 2047 Q encoding when it isn't
|
|
16
|
+
* ASCII, as Tailscale sends it.
|
|
17
|
+
*/
|
|
18
|
+
import { forward, marked, untilStopped } from "./forward.mjs";
|
|
19
|
+
|
|
20
|
+
const args = process.argv.slice(2);
|
|
21
|
+
const play = process.env.MOSTRA_FAKE_TAILSCALE ?? "";
|
|
22
|
+
|
|
23
|
+
/** RFC 2047 "Q" encoding of a non-ASCII value, as Go's `mime.QEncoding` writes it. */
|
|
24
|
+
function qEncode(value) {
|
|
25
|
+
if (/^[\x20-\x7e]*$/.test(value)) return value;
|
|
26
|
+
let out = "";
|
|
27
|
+
for (const byte of Buffer.from(value, "utf8")) {
|
|
28
|
+
const char = String.fromCharCode(byte);
|
|
29
|
+
if (byte === 0x20) out += "_";
|
|
30
|
+
else if (/[A-Za-z0-9!*+\-/]/.test(char)) out += char;
|
|
31
|
+
else out += `=${byte.toString(16).toUpperCase().padStart(2, "0")}`;
|
|
32
|
+
}
|
|
33
|
+
return `=?utf-8?q?${out}?=`;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
if (args[0] === "status") {
|
|
37
|
+
// `stopped` in `MOSTRA_FAKE_CONTROL` signs Tailscale out for as long as it is there.
|
|
38
|
+
if (play === "stopped" || marked("stopped")) {
|
|
39
|
+
process.stdout.write(`${JSON.stringify({ BackendState: "NeedsLogin" })}\n`);
|
|
40
|
+
} else {
|
|
41
|
+
process.stdout.write(
|
|
42
|
+
`${JSON.stringify({
|
|
43
|
+
BackendState: "Running",
|
|
44
|
+
Self: { DNSName: "localhost.", HostName: "localhost" },
|
|
45
|
+
CurrentTailnet: { Name: "fake", MagicDNSSuffix: "fake.ts.net", MagicDNSEnabled: true },
|
|
46
|
+
})}\n`,
|
|
47
|
+
);
|
|
48
|
+
}
|
|
49
|
+
process.exit(0);
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
if (args[0] === "serve" && args[1] === "status") {
|
|
53
|
+
const served = (process.env.MOSTRA_FAKE_TAILSCALE_SERVED ?? "").split(",").filter(Boolean);
|
|
54
|
+
const tcp = Object.fromEntries(served.map((port) => [port, { HTTPS: true }]));
|
|
55
|
+
process.stdout.write(`${JSON.stringify(served.length > 0 ? { TCP: tcp } : {})}\n`);
|
|
56
|
+
process.exit(0);
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
const feature = args[0];
|
|
60
|
+
const https = args.find((arg) => arg.startsWith("--https="));
|
|
61
|
+
const local = args.at(-1);
|
|
62
|
+
if ((feature !== "serve" && feature !== "funnel") || !https || !local?.startsWith("http")) {
|
|
63
|
+
process.stderr.write(`fake tailscale: unsupported command ${args.join(" ")}\n`);
|
|
64
|
+
process.exit(2);
|
|
65
|
+
}
|
|
66
|
+
const asked = Number(https.slice("--https=".length));
|
|
67
|
+
// `refuse` (or `refuse-<port>`) in `MOSTRA_FAKE_CONTROL`: Serve and Funnel refuse to start (at
|
|
68
|
+
// that port) while it is there.
|
|
69
|
+
const refusing = marked("refuse") || marked("refuse-" + asked);
|
|
70
|
+
if (
|
|
71
|
+
(feature === "serve" && (play === "no-serve" || refusing)) ||
|
|
72
|
+
(feature === "funnel" && (play === "no-funnel" || refusing))
|
|
73
|
+
) {
|
|
74
|
+
const name = feature === "serve" ? "Serve" : "Funnel";
|
|
75
|
+
process.stdout.write(
|
|
76
|
+
`${name} is not enabled on your tailnet.\nTo enable, visit:\n\n https://login.tailscale.com/f/${feature}?node=FAKE\n\n`,
|
|
77
|
+
);
|
|
78
|
+
await untilStopped();
|
|
79
|
+
process.exit(0);
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
const [login, name] = (
|
|
83
|
+
process.env.MOSTRA_FAKE_TAILNET_USER ?? "ada@example.com|Ada Lovelace"
|
|
84
|
+
).split("|");
|
|
85
|
+
// Tailscale Serve answers on the device's name at the port asked for, so its links stay the
|
|
86
|
+
// same across restarts: the fake does the same on IPv6 loopback, beside the face on IPv4. Funnel's
|
|
87
|
+
// ports (443 and the others) need privileges a test lacks, so Funnel takes a port the system picks.
|
|
88
|
+
// `MOSTRA_FAKE_FUNNEL_PORT_BASE`: Funnel's public ports as fixed ones, as a device's are (443 at
|
|
89
|
+
// the base, 8443 one above, 10000 two above), so a test sees which port a share took and that its
|
|
90
|
+
// address outlives a restart.
|
|
91
|
+
const funnelBase = Number(process.env.MOSTRA_FAKE_FUNNEL_PORT_BASE ?? "");
|
|
92
|
+
const funnelPort =
|
|
93
|
+
feature === "funnel" && Number.isInteger(funnelBase) && funnelBase > 0
|
|
94
|
+
? funnelBase + ({ 443: 0, 8443: 1, 10000: 2 }[asked] ?? 3)
|
|
95
|
+
: undefined;
|
|
96
|
+
const stable = (feature === "serve" && asked >= 1024) || funnelPort !== undefined;
|
|
97
|
+
// `slow` in `MOSTRA_FAKE_CONTROL`: a start takes 3 s, as Tailscale's own can after a restart.
|
|
98
|
+
if (marked("slow")) await new Promise((resolve) => setTimeout(resolve, 3000));
|
|
99
|
+
// `hold`: a start waits for as long as it is there, so a test decides when it ends.
|
|
100
|
+
while (marked("hold")) await new Promise((resolve) => setTimeout(resolve, 100));
|
|
101
|
+
const port = await forward(local, {
|
|
102
|
+
...(stable ? { host: "::1", port: funnelPort ?? asked } : {}),
|
|
103
|
+
rewrite(headers) {
|
|
104
|
+
for (const key of Object.keys(headers)) {
|
|
105
|
+
if (key.toLowerCase().startsWith("tailscale-")) delete headers[key];
|
|
106
|
+
}
|
|
107
|
+
headers["x-forwarded-host"] = headers.host ?? "";
|
|
108
|
+
headers["x-forwarded-proto"] = "https";
|
|
109
|
+
headers["x-forwarded-for"] = "100.64.0.2";
|
|
110
|
+
if (feature === "funnel") {
|
|
111
|
+
headers["tailscale-funnel-request"] = "?1";
|
|
112
|
+
} else {
|
|
113
|
+
headers["tailscale-user-login"] = qEncode(login ?? "");
|
|
114
|
+
headers["tailscale-user-name"] = qEncode(name ?? "");
|
|
115
|
+
headers["tailscale-user-profile-pic"] = "";
|
|
116
|
+
headers["tailscale-headers-info"] = "https://tailscale.com/s/serve-headers";
|
|
117
|
+
}
|
|
118
|
+
return headers;
|
|
119
|
+
},
|
|
120
|
+
});
|
|
121
|
+
const where = feature === "serve" ? "Available within your tailnet:" : "Available on the internet:";
|
|
122
|
+
const address = stable ? `http://[::1]:${port}` : `http://127.0.0.1:${port}`;
|
|
123
|
+
process.stdout.write(`${where}\n\n${address}/\n|-- / proxy ${local}\n\nPress Ctrl+C to exit.\n`);
|
|
124
|
+
await untilStopped(String(asked));
|
|
125
|
+
process.exit(0);
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"reference-host-D7fe25go.js","names":[],"sources":["../src/harness/serve.ts","../src/reference-host.ts"],"sourcesContent":["/**\n * The host's side of the harness protocol, for hosts written in TypeScript: `serveHarness` reads\n * the kit's requests on stdin and answers them with the host's implementation, on stdout. A host\n * writes its shim as one small program around its real integration:\n *\n * ```ts\n * serveHarness({\n * initialize: () => ({ host: { name: \"my-host\", version: \"1.0.0\" }, ports: [\"submissions\"], features: [] }),\n * start: (params) => myHost.startMostra(params.home, params.env),\n * call: (method, params) => myHost.mostra.call(method, params),\n * stop: () => myHost.stopMostra(),\n * store: () => myHost.conformanceStore(),\n * });\n * ```\n *\n * Nothing but protocol messages may go to stdout; log to stderr.\n */\nimport { createDiagnostic, encodeLine, LineSplitter, RpcError, RpcPeer } from \"@mostra/protocol\";\nimport {\n CallParams,\n type CallResult,\n EventsParams,\n type EventsResult,\n HARNESS_METHODS,\n HARNESS_REVISIONS,\n type InitializeResult,\n ScriptParams,\n StartParams,\n type StartResult,\n type StoreResult,\n} from \"./protocol.ts\";\n\n/** What a TypeScript host implements to be driven by the kit. */\nexport interface HarnessImplementation {\n /** Who the host is, the ports it serves and its features. */\n initialize(): Omit<InitializeResult, \"revision\"> | Promise<Omit<InitializeResult, \"revision\">>;\n /** Starts (or attaches to) the host's instance for `params.home`, with its real ports. */\n start(params: StartParams): StartResult | Promise<StartResult>;\n /** Sends one host-protocol request through the host's client; throw an `RpcError` for an error answer. */\n call(method: string, params: unknown, timeoutMs?: number): unknown;\n /** Ends the host's session. */\n stop(): void | Promise<void>;\n /** What the host's own store holds. */\n store(): StoreResult | Promise<StoreResult>;\n /** Feature `faults`: answer a port as the kit asks. */\n script?(params: ScriptParams): void | Promise<void>;\n /** Feature `events`: read pages from the host's own named event stream. */\n events?(params: EventsParams): EventsResult | Promise<EventsResult>;\n}\n\nfunction invalid(method: string, message: string): RpcError {\n return new RpcError(\n createDiagnostic(\"MOSTRA_HOST_INVALID_PARAMS\", { message: `${method}: ${message}` }),\n -32602,\n );\n}\n\n/**\n * Serves the harness protocol on this process's stdin and stdout until stdin ends, then stops\n * the host's session and resolves.\n */\nexport function serveHarness(\n implementation: HarnessImplementation,\n io: { input?: NodeJS.ReadableStream; output?: NodeJS.WritableStream } = {},\n): Promise<void> {\n const input = io.input ?? process.stdin;\n const output = io.output ?? process.stdout;\n const peer = new RpcPeer({\n send: (message) => {\n output.write(encodeLine(message));\n },\n onRequest: async (method, params) => {\n switch (method) {\n case HARNESS_METHODS.initialize: {\n const revision = HARNESS_REVISIONS.at(-1) as string;\n return { revision, ...(await implementation.initialize()) };\n }\n case HARNESS_METHODS.start: {\n const parsed = StartParams.safeParse(params);\n if (!parsed.success) throw invalid(method, parsed.error.message);\n return await implementation.start(parsed.data);\n }\n case HARNESS_METHODS.call: {\n const parsed = CallParams.safeParse(params);\n if (!parsed.success) throw invalid(method, parsed.error.message);\n try {\n const result = await implementation.call(\n parsed.data.method,\n parsed.data.params,\n parsed.data.timeoutMs,\n );\n return { result: result ?? null } satisfies CallResult;\n } catch (error) {\n if (error instanceof RpcError)\n return {\n error: { code: error.code, data: { ...error.diagnostic } },\n } satisfies CallResult;\n throw error;\n }\n }\n case HARNESS_METHODS.stop:\n await implementation.stop();\n return {};\n case HARNESS_METHODS.store:\n return await implementation.store();\n case HARNESS_METHODS.script: {\n if (!implementation.script) break;\n const parsed = ScriptParams.safeParse(params);\n if (!parsed.success) throw invalid(method, parsed.error.message);\n await implementation.script(parsed.data);\n return {};\n }\n case HARNESS_METHODS.events: {\n if (!implementation.events) break;\n const parsed = EventsParams.safeParse(params);\n if (!parsed.success) throw invalid(method, parsed.error.message);\n return await implementation.events(parsed.data);\n }\n }\n throw new RpcError(\n createDiagnostic(\"MOSTRA_HOST_METHOD_UNKNOWN\", {\n message: `This host serves no harness method ${method}.`,\n }),\n -32601,\n );\n },\n onInternalError: (error, method) => {\n process.stderr.write(`harness: ${method} failed: ${(error as Error).stack ?? error}\\n`);\n },\n });\n const lines = new LineSplitter();\n (input as NodeJS.ReadStream).setEncoding?.(\"utf8\");\n input.on(\"data\", (chunk: string) => {\n for (const line of lines.push(chunk)) peer.receiveLine(line);\n });\n return new Promise((done) => {\n input.on(\"end\", () => {\n void Promise.resolve(implementation.stop())\n .catch(() => undefined)\n .finally(() => {\n peer.close();\n done();\n });\n });\n });\n}\n","#!/usr/bin/env node\n/**\n * `mostra-conformance-reference-host`: the TypeScript reference host (HO-05). A host built the way\n * the docs recommend, on `@mostra/sdk`, with a store that keeps each submission once by its\n * `deliveryId` (H-03), every port the SDK serves, and the harness shim the kit drives. It is the\n * model a TypeScript host copies, and the kit's own proof that its scenarios pass.\n *\n * mostra-conformance-reference-host every port\n * mostra-conformance-reference-host --standalone no port: Mostra's built-in adapters\n * mostra-conformance-reference-host --unscripted every port, without the `faults` feature:\n * its policy allows both channels and it names people by its own IDs (`user-1` …), so the\n * kit judges it by the answers it reports, as it must any host that can't be scripted\n * mostra-conformance-reference-host --break <fault,…> a deliberately broken host:\n * store-duplicates stores every delivery call, so a redelivery is stored twice\n * drafts-as-submissions takes draft mirrors for submissions\n * ignore-policy allows both channels whatever the kit scripted\n *\n * Its own runtime is found like any SDK host's (`MOSTRA_BUNDLE`, `MOSTRA_RUNTIME_BIN`, the pinned\n * bundle, a development checkout).\n */\nimport { realpathSync } from \"node:fs\";\nimport { pathToFileURL } from \"node:url\";\nimport { parseArgs } from \"node:util\";\nimport {\n type ArtifactSummary,\n type ControlsPolicy,\n createDiagnostic,\n type DraftMirror,\n hostMethods,\n type PortIdentityResolveParams,\n type PortSecretsGetParams,\n type PortTrustedControlsActivatedParams,\n RpcError,\n type SubmissionEnvelope,\n type SubmissionsDeliverResult,\n} from \"@mostra/protocol\";\nimport { createMostra, type Mostra, type Ports } from \"@mostra/sdk\";\nimport type {\n EventsParams,\n EventsResult,\n ScriptParams,\n StartParams,\n StartResult,\n StoredDelivery,\n StoreResult,\n} from \"./harness/protocol.ts\";\nimport { serveHarness } from \"./harness/serve.ts\";\nimport { kitVersion } from \"./version.ts\";\n\n/** The faults a broken reference host can carry. */\nexport const REFERENCE_FAULTS: readonly string[] = [\n \"store-duplicates\",\n \"drafts-as-submissions\",\n \"ignore-policy\",\n];\n\n/** The reference host's store and port answers: what a real host keeps in its own database. */\nexport class ReferenceStore {\n readonly #deliveries = new Map<string, StoredDelivery & { attempts: number[] }>();\n readonly #drafts: StoreResult[\"drafts\"][number][] = [];\n readonly #activations: StoreResult[\"activations\"][number][] = [];\n readonly #identity: StoreResult[\"identity\"][number][] = [];\n readonly #policies: StoreResult[\"policies\"][number][] = [];\n readonly #secrets: StoreResult[\"secrets\"][number][] = [];\n readonly #faults: ReadonlySet<string>;\n #order = 0;\n /** How the scripted ports answer (feature `faults`). */\n #deliver: Extract<ScriptParams, { port: \"submissions\" }>[\"answer\"] = \"accept\";\n #policy: Extract<ScriptParams, { port: \"trustedControls\" }>[\"answer\"] = {\n submitChannels: [\"shell\"],\n controls: [\"submit\", \"choose\", \"approve\"],\n };\n #person: Extract<ScriptParams, { port: \"identity\" }>[\"answer\"] = \"headers\";\n #secretValues: Readonly<Record<string, string>> = {};\n\n /** People by the header that named them, for an unscripted host's own IDs. */\n readonly #people = new Map<string, string>();\n readonly #unscripted: boolean;\n\n constructor(faults: ReadonlySet<string> = new Set(), unscripted = false) {\n this.#faults = faults;\n this.#unscripted = unscripted;\n if (unscripted) this.#policy = { submitChannels: [\"artifact\", \"shell\"] };\n }\n\n /** Sets how a port answers from now on (feature `faults`). */\n script(params: ScriptParams): void {\n if (params.port === \"submissions\") this.#deliver = params.answer;\n else if (params.port === \"trustedControls\") this.#policy = params.answer;\n else if (params.port === \"identity\") this.#person = params.answer;\n else this.#secretValues = params.answer;\n }\n\n /** Records one delivery the way a host's database would: once per `deliveryId`. */\n #record(envelope: SubmissionEnvelope | (DraftMirror & { kind: string })): void {\n const id =\n \"deliveryId\" in envelope\n ? envelope.deliveryId\n : `draft-${envelope.viewerId}-${envelope.revision}`;\n const existing = this.#deliveries.get(id);\n const attempt = \"attempt\" in envelope ? envelope.attempt : 1;\n if (existing) {\n existing.attempts.push(attempt);\n (existing as { calls: number }).calls += 1;\n if (this.#faults.has(\"store-duplicates\")) (existing as { stored: number }).stored += 1;\n return;\n }\n const results = \"results\" in envelope ? envelope.results : undefined;\n this.#order += 1;\n this.#deliveries.set(id, {\n deliveryId: id,\n submissionId: results?.submission.id ?? \"\",\n artifactId: envelope.artifactId,\n calls: 1,\n stored: 1,\n attempts: [attempt],\n kind: envelope.kind,\n channel: results?.submission.channel ?? \"\",\n viewerKind: results?.submission.viewer.kind ?? \"\",\n ...(results?.submission.viewer.ref !== undefined\n ? { viewerRef: results.submission.viewer.ref }\n : {}),\n order: this.#order,\n });\n }\n\n /** The ports, as the SDK takes them. */\n ports(): Ports {\n return {\n submissions: {\n deliver: async (envelope: SubmissionEnvelope): Promise<SubmissionsDeliverResult> => {\n const answer = this.#deliver;\n if (answer === \"fail\") throw new Error(\"the host's store is unavailable\");\n if (answer === \"hang\") return new Promise(() => undefined);\n if (answer === \"retry\") return { accepted: false, reason: \"busy\", retry: true };\n if (answer === \"undeliverable\")\n return { accepted: false, reason: \"undeliverable\", retry: false };\n if (answer === \"reject\") return { accepted: false, reason: \"invalid\", retry: false };\n // A redelivery of a delivery the store holds is accepted again, never stored twice.\n this.#record(envelope);\n return { accepted: true };\n },\n },\n drafts: {\n mirror: (draft: DraftMirror) => {\n this.#drafts.push({\n artifactId: draft.artifactId,\n viewerId: draft.viewerId,\n revision: draft.revision,\n kind: draft.kind,\n });\n if (this.#faults.has(\"drafts-as-submissions\")) this.#record(draft);\n },\n },\n identity: {\n resolve: async (request: PortIdentityResolveParams) => {\n const call = {\n artifactId: request.artifactId,\n via: request.via,\n headers: Object.keys(request.headers).sort(),\n };\n const answer = this.#person;\n if (answer === \"fail\" || answer === \"hang\") {\n this.#identity.push(call);\n if (answer === \"fail\") throw new Error(\"the host's directory is unavailable\");\n return new Promise<never>(() => undefined);\n }\n let person: { ref: string; name?: string } | null = answer === \"headers\" ? null : answer;\n if (answer === \"headers\") {\n const user = request.headers[\"x-forwarded-user\"];\n if (user && this.#unscripted && !this.#people.has(user)) {\n this.#people.set(user, `user-${this.#people.size + 1}`);\n }\n const ref = user && this.#unscripted ? this.#people.get(user) : user;\n person = user && ref ? { ref, name: user.split(\"@\")[0] ?? user } : null;\n }\n this.#identity.push({ ...call, answer: person });\n return person;\n },\n },\n trustedControls: {\n policy: async (artifact: ArtifactSummary): Promise<ControlsPolicy> => {\n const answer = this.#policy;\n if (this.#faults.has(\"ignore-policy\")) {\n const both: ControlsPolicy = { submitChannels: [\"shell\", \"artifact\"] };\n this.#policies.push({ artifactId: artifact.id, answer: both });\n return both;\n }\n if (answer === \"fail\" || answer === \"hang\") {\n this.#policies.push({ artifactId: artifact.id });\n if (answer === \"fail\") throw new Error(\"the host's policy service is unavailable\");\n return new Promise<never>(() => undefined);\n }\n this.#policies.push({ artifactId: artifact.id, answer: answer as ControlsPolicy });\n return answer as ControlsPolicy;\n },\n activated: (event: PortTrustedControlsActivatedParams) => {\n this.#activations.push({\n artifactId: event.artifactId,\n control: event.control,\n viewId: event.viewId,\n });\n },\n },\n secrets: {\n get: (request: PortSecretsGetParams) => {\n this.#secrets.push({ artifactId: request.artifactId, name: request.name });\n return this.#secretValues[request.name] ?? null;\n },\n },\n };\n }\n\n /** What the store holds now. */\n snapshot(): StoreResult {\n return {\n deliveries: [...this.#deliveries.values()].sort((a, b) => a.order - b.order),\n drafts: [...this.#drafts],\n activations: [...this.#activations],\n identity: [...this.#identity],\n policies: [...this.#policies],\n secrets: [...this.#secrets],\n };\n }\n}\n\n/** Runs the reference host's harness on stdio. */\nexport async function runReferenceHost(\n options: { standalone?: boolean; unscripted?: boolean; faults?: readonly string[] } = {},\n): Promise<void> {\n const faults = new Set(options.faults ?? []);\n const unscripted = options.unscripted ?? false;\n const store = new ReferenceStore(faults, unscripted);\n let mostra: Mostra | undefined;\n const ports = options.standalone ? {} : store.ports();\n const portNames = Object.keys(ports);\n const name = options.standalone\n ? \"reference-host-ts-standalone\"\n : unscripted\n ? \"reference-host-ts-unscripted\"\n : faults.size > 0\n ? \"reference-host-ts-broken\"\n : \"reference-host-ts\";\n await serveHarness({\n initialize: () => ({\n host: { name, version: kitVersion() },\n ports: portNames,\n features: options.standalone || unscripted ? [\"events\"] : [\"faults\", \"events\"],\n }),\n async start(params: StartParams): Promise<StartResult> {\n if (params.mode === \"attach\") {\n throw new RpcError(\n createDiagnostic(\"MOSTRA_HOST_INVALID_PARAMS\", {\n message: \"The TypeScript reference host spawns its instance; it doesn't attach.\",\n }),\n );\n }\n await mostra?.close();\n mostra = await createMostra({\n home: params.home,\n client: { name, version: kitVersion() },\n ports,\n env: { ...process.env, ...params.env },\n onLog: () => undefined,\n });\n return {\n revision: mostra.revision,\n instance: mostra.instance,\n warnings: mostra.warnings,\n };\n },\n async call(method: string, params: unknown, timeoutMs?: number) {\n const definition = hostMethods.find((candidate) => candidate.method === method);\n if (!mostra) {\n throw new RpcError(\n createDiagnostic(\"MOSTRA_HOST_CONNECTION_CLOSED\", { message: \"No instance runs.\" }),\n );\n }\n if (!definition) {\n throw new RpcError(\n createDiagnostic(\"MOSTRA_HOST_METHOD_UNKNOWN\", { message: `No method ${method}.` }),\n -32601,\n );\n }\n return mostra.call(definition, params, timeoutMs !== undefined ? { timeoutMs } : {});\n },\n async stop() {\n const current = mostra;\n mostra = undefined;\n await current?.close();\n },\n store: () => store.snapshot(),\n ...(options.standalone || unscripted\n ? {}\n : { script: (params: ScriptParams) => store.script(params) }),\n async events(params: EventsParams): Promise<EventsResult> {\n if (!mostra) throw new Error(\"No instance runs.\");\n const pages: EventsResult[\"pages\"][number][] = [];\n const stream = mostra\n .events({\n name: params.name,\n filter: {\n ...(params.filter.artifacts ? { artifacts: [...params.filter.artifacts] } : {}),\n ...(params.filter.types ? { types: [...params.filter.types] } : {}),\n },\n })\n [Symbol.asyncIterator]();\n const deadline = Date.now() + params.timeoutMs;\n try {\n while (pages.length < params.pages) {\n const left = deadline - Date.now();\n if (left <= 0) break;\n const next = await Promise.race([\n stream.next(),\n new Promise<\"timeout\">((done) => setTimeout(() => done(\"timeout\"), left)),\n ]);\n if (next === \"timeout\" || next.done) break;\n pages.push({\n cursor: next.value.cursor,\n events: next.value.events.map((event) => ({ ...event })),\n });\n }\n } finally {\n // Asking for the next page is what tells the SDK the last one was handled: it acknowledges\n // it at once, then waits for a page this stream won't read, so the wait is cut short.\n await Promise.race([\n stream.next().catch(() => undefined),\n new Promise((done) => setTimeout(done, 1000)),\n ]);\n await stream.return?.();\n }\n return { pages };\n },\n });\n}\n\n/**\n * Whether this module is the program Node.js was started with: by file URL, which spells a\n * Windows path (`file:///D:/…`) as no string concatenation does, through any link, or as the\n * installed binary (`mostra-conformance-reference-host`, a link or npm's shim to `dist/`).\n */\nfunction isMain(): boolean {\n const entry = process.argv[1];\n if (entry === undefined) return false;\n try {\n if (pathToFileURL(realpathSync(entry)).href === import.meta.url) return true;\n } catch {\n // An entry that doesn't exist as a file is judged by its name alone.\n }\n return entry.endsWith(\"reference-host.js\");\n}\n\nif (isMain()) {\n const { values } = parseArgs({\n options: {\n standalone: { type: \"boolean\" },\n unscripted: { type: \"boolean\" },\n break: { type: \"string\" },\n },\n strict: true,\n });\n const faults = values.break ? values.break.split(\",\").filter(Boolean) : [];\n for (const fault of faults) {\n if (!REFERENCE_FAULTS.includes(fault)) {\n process.stderr.write(`Unknown fault ${fault}; known: ${REFERENCE_FAULTS.join(\", \")}\\n`);\n process.exit(2);\n }\n }\n void runReferenceHost({\n standalone: values.standalone ?? false,\n unscripted: values.unscripted ?? false,\n faults,\n }).then(() => process.exit(0));\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAkDA,SAAS,QAAQ,QAAgB,SAA2B;CAC1D,OAAO,IAAI,SACT,iBAAiB,8BAA8B,EAAE,SAAS,GAAG,OAAO,IAAI,UAAU,CAAC,GACnF,MACF;AACF;;;;;AAMA,SAAgB,aACd,gBACA,KAAwE,CAAC,GAC1D;CACf,MAAM,QAAQ,GAAG,SAAS,QAAQ;CAClC,MAAM,SAAS,GAAG,UAAU,QAAQ;CACpC,MAAM,OAAO,IAAI,QAAQ;EACvB,OAAO,YAAY;GACjB,OAAO,MAAM,WAAW,OAAO,CAAC;EAClC;EACA,WAAW,OAAO,QAAQ,WAAW;GACnC,QAAQ,QAAR;IACE,KAAK,gBAAgB,YAEnB,OAAO;KAAE,UADQ,kBAAkB,GAAG,EACtB;KAAG,GAAI,MAAM,eAAe,WAAW;IAAG;IAE5D,KAAK,gBAAgB,OAAO;KAC1B,MAAM,SAAS,YAAY,UAAU,MAAM;KAC3C,IAAI,CAAC,OAAO,SAAS,MAAM,QAAQ,QAAQ,OAAO,MAAM,OAAO;KAC/D,OAAO,MAAM,eAA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