@melra/cli 0.3.0-alpha.10
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/LICENSE +202 -0
- package/README.md +40 -0
- package/dist/bin.d.ts +3 -0
- package/dist/bin.d.ts.map +1 -0
- package/dist/bin.js +31 -0
- package/dist/bin.js.map +1 -0
- package/dist/conformance.d.ts +17 -0
- package/dist/conformance.d.ts.map +1 -0
- package/dist/conformance.js +381 -0
- package/dist/conformance.js.map +1 -0
- package/dist/environment.d.ts +22 -0
- package/dist/environment.d.ts.map +1 -0
- package/dist/environment.js +109 -0
- package/dist/environment.js.map +1 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +770 -0
- package/dist/index.js.map +1 -0
- package/package.json +45 -0
|
@@ -0,0 +1,381 @@
|
|
|
1
|
+
// Copyright 2026 XAGI Labs Private Limited
|
|
2
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
3
|
+
/**
|
|
4
|
+
* The compatibility suite, run against a live endpoint rather than a build.
|
|
5
|
+
*
|
|
6
|
+
* A runtime that speaks these tools is asking to be trusted with real effects,
|
|
7
|
+
* and "it has the right tool names" is not that claim. This drives one probe
|
|
8
|
+
* effect through the whole pipeline over an actual transport and reports the
|
|
9
|
+
* highest level the endpoint earned:
|
|
10
|
+
*
|
|
11
|
+
* L1 typed effects — every effect is a strict, bounded, typed request
|
|
12
|
+
* L2 governed effects — policy and approval decide before anything runs
|
|
13
|
+
* L3 verified effects — nothing is success without evidence, and every
|
|
14
|
+
* effect leaves a receipt
|
|
15
|
+
*
|
|
16
|
+
* Levels are cumulative and ordered by what they let you conclude, so the
|
|
17
|
+
* report names the highest level with no failed check at or below it. A
|
|
18
|
+
* runtime claims a level by publishing this report.
|
|
19
|
+
*
|
|
20
|
+
* Read `notProven` before quoting a result. This is a black-box check of one
|
|
21
|
+
* endpoint: it can show that the endpoint governs the effects it is asked for,
|
|
22
|
+
* and it cannot show that the harness on the other side has no second way to
|
|
23
|
+
* reach the same disk.
|
|
24
|
+
*/
|
|
25
|
+
import { randomBytes } from "node:crypto";
|
|
26
|
+
import { Client } from "@modelcontextprotocol/sdk/client/index.js";
|
|
27
|
+
import { StdioClientTransport } from "@modelcontextprotocol/sdk/client/stdio.js";
|
|
28
|
+
import { StreamableHTTPClientTransport } from "@modelcontextprotocol/sdk/client/streamableHttp.js";
|
|
29
|
+
import { PRODUCT_VERSION } from "@melra/protocol";
|
|
30
|
+
export const CONFORMANCE_SUITE = "melra-conformance/1";
|
|
31
|
+
const LEVEL_NAMES = {
|
|
32
|
+
0: "none",
|
|
33
|
+
1: "L1 typed effects",
|
|
34
|
+
2: "L2 governed effects",
|
|
35
|
+
3: "L3 verified effects",
|
|
36
|
+
};
|
|
37
|
+
/** The kernel surface. A harness adapter may add tools; it may not remove one. */
|
|
38
|
+
const KERNEL_TOOLS = [
|
|
39
|
+
"melra_capabilities",
|
|
40
|
+
"melra_plan",
|
|
41
|
+
"melra_execute",
|
|
42
|
+
"melra_task_status",
|
|
43
|
+
"melra_task_cancel",
|
|
44
|
+
"melra_receipt",
|
|
45
|
+
"melra_workflow_plan",
|
|
46
|
+
"melra_workflow_advance",
|
|
47
|
+
"melra_workflow_status",
|
|
48
|
+
"melra_workflow_cancel",
|
|
49
|
+
"melra_workflow_control",
|
|
50
|
+
];
|
|
51
|
+
const NOT_PROVEN = [
|
|
52
|
+
"That the harness has no second, ungoverned path to the same systems. A harness holding both a MELRA terminal and a native one makes the kernel optional, and an optional boundary is not a trust boundary. Nothing observable from this side distinguishes the two.",
|
|
53
|
+
"That the endpoint's own policy is well chosen. The suite checks that policy is consulted and obeyed, not that it says the right thing.",
|
|
54
|
+
"Anything about effects this suite does not exercise. It probes one file effect end to end; browser, terminal, computer, and memory adapters are out of scope.",
|
|
55
|
+
];
|
|
56
|
+
function must(condition, detail) {
|
|
57
|
+
if (condition !== true)
|
|
58
|
+
throw new Error(detail);
|
|
59
|
+
}
|
|
60
|
+
function message(error) {
|
|
61
|
+
return error instanceof Error ? error.message : String(error);
|
|
62
|
+
}
|
|
63
|
+
/** A field the report needs from an untyped reply, or a failed check saying so. */
|
|
64
|
+
function field(source, path) {
|
|
65
|
+
let value = source;
|
|
66
|
+
for (const key of path.split(".")) {
|
|
67
|
+
if (typeof value !== "object" || value === null || !(key in value)) {
|
|
68
|
+
throw new Error(`reply has no ${path}`);
|
|
69
|
+
}
|
|
70
|
+
value = value[key];
|
|
71
|
+
}
|
|
72
|
+
return value;
|
|
73
|
+
}
|
|
74
|
+
/**
|
|
75
|
+
* Every call goes through here, and none of them throws.
|
|
76
|
+
*
|
|
77
|
+
* A refusal is a result in this suite — "the endpoint said no" is what half the
|
|
78
|
+
* checks are looking for — so the transport's own error signalling has to be
|
|
79
|
+
* data rather than control flow. `ok` is false for both a tool that answered
|
|
80
|
+
* with `isError` and a protocol-level failure, because from the caller's side
|
|
81
|
+
* those are the same fact: the effect did not happen.
|
|
82
|
+
*/
|
|
83
|
+
function caller(client) {
|
|
84
|
+
return async (name, args) => {
|
|
85
|
+
try {
|
|
86
|
+
const result = (await client.callTool({ name, arguments: args }));
|
|
87
|
+
const text = result.content?.find((item) => item.type === "text")?.text ?? "";
|
|
88
|
+
if (result.isError === true)
|
|
89
|
+
return { ok: false, value: {}, text };
|
|
90
|
+
return {
|
|
91
|
+
ok: true,
|
|
92
|
+
value: JSON.parse(text),
|
|
93
|
+
text,
|
|
94
|
+
};
|
|
95
|
+
}
|
|
96
|
+
catch (error) {
|
|
97
|
+
return { ok: false, value: {}, text: message(error) };
|
|
98
|
+
}
|
|
99
|
+
};
|
|
100
|
+
}
|
|
101
|
+
export async function runConformance(options = {}) {
|
|
102
|
+
const claim = options.claim ?? 3;
|
|
103
|
+
const client = new Client({
|
|
104
|
+
name: "melra-conformance",
|
|
105
|
+
version: PRODUCT_VERSION,
|
|
106
|
+
});
|
|
107
|
+
const target = await connect(client, options);
|
|
108
|
+
const call = caller(client);
|
|
109
|
+
const checks = [];
|
|
110
|
+
const check = async (level, name, run) => {
|
|
111
|
+
try {
|
|
112
|
+
checks.push({ level, name, passed: true, detail: await run() });
|
|
113
|
+
}
|
|
114
|
+
catch (error) {
|
|
115
|
+
checks.push({ level, name, passed: false, detail: message(error) });
|
|
116
|
+
}
|
|
117
|
+
};
|
|
118
|
+
// Unique per run, so the suite can never collide with — or delete — a file
|
|
119
|
+
// that was already there. Flat rather than in a directory, so cleanup is one
|
|
120
|
+
// named file and never a recursive delete of something a user owns.
|
|
121
|
+
const probe = `melra-conformance-${randomBytes(4).toString("hex")}.txt`;
|
|
122
|
+
const marker = `melra conformance ${CONFORMANCE_SUITE}\n`;
|
|
123
|
+
const write = {
|
|
124
|
+
kind: "file",
|
|
125
|
+
action: "write",
|
|
126
|
+
path: probe,
|
|
127
|
+
content: marker,
|
|
128
|
+
};
|
|
129
|
+
let probeWritten = false;
|
|
130
|
+
let approvalId;
|
|
131
|
+
let phrase;
|
|
132
|
+
let writeTaskId;
|
|
133
|
+
await check(1, "kernel-tools-present", async () => {
|
|
134
|
+
const listed = (await client.listTools()).tools.map((tool) => tool.name);
|
|
135
|
+
const missing = KERNEL_TOOLS.filter((tool) => !listed.includes(tool));
|
|
136
|
+
must(missing.length === 0, `missing tools: ${missing.join(", ")}`);
|
|
137
|
+
return `${KERNEL_TOOLS.length} kernel tools present of ${listed.length} offered`;
|
|
138
|
+
});
|
|
139
|
+
await check(1, "capabilities-describe-the-surface", async () => {
|
|
140
|
+
const reply = await call("melra_capabilities", {});
|
|
141
|
+
must(reply.ok, reply.text);
|
|
142
|
+
const version = field(reply.value, "version");
|
|
143
|
+
const file = field(reply.value, "operations.file");
|
|
144
|
+
for (const action of ["read", "write", "delete"]) {
|
|
145
|
+
must(file.includes(action), `operations.file omits ${action}`);
|
|
146
|
+
}
|
|
147
|
+
return `version ${version}, ${file.length} file actions declared`;
|
|
148
|
+
});
|
|
149
|
+
await check(1, "unknown-field-rejected", async () => {
|
|
150
|
+
const reply = await call("melra_plan", {
|
|
151
|
+
goal: "Conformance: an operation carrying a field the schema does not know",
|
|
152
|
+
operation: { ...write, unexpected: true },
|
|
153
|
+
});
|
|
154
|
+
must(!reply.ok, "an unknown operation field was accepted");
|
|
155
|
+
return "strict schema refused an unrecognised field";
|
|
156
|
+
});
|
|
157
|
+
await check(1, "incomplete-operation-rejected", async () => {
|
|
158
|
+
const reply = await call("melra_plan", {
|
|
159
|
+
goal: "Conformance: an operation missing a required field",
|
|
160
|
+
operation: { kind: "file", action: "write", content: marker },
|
|
161
|
+
});
|
|
162
|
+
must(!reply.ok, "an operation with no path was accepted");
|
|
163
|
+
return "schema refused an operation missing a required field";
|
|
164
|
+
});
|
|
165
|
+
await check(1, "plan-returns-an-effect-contract", async () => {
|
|
166
|
+
const reply = await call("melra_plan", {
|
|
167
|
+
goal: "Conformance: read the capabilities of this endpoint",
|
|
168
|
+
operation: { kind: "system", action: "info" },
|
|
169
|
+
});
|
|
170
|
+
must(reply.ok, reply.text);
|
|
171
|
+
const capability = field(reply.value, "contract.capability");
|
|
172
|
+
const effect = field(reply.value, "contract.effect");
|
|
173
|
+
must(effect === "read", `a system info read was classified ${effect}`);
|
|
174
|
+
return `contract ${field(reply.value, "contract.contractVersion")} for ${capability} (${effect})`;
|
|
175
|
+
});
|
|
176
|
+
await check(2, "mutation-is-held-for-approval", async () => {
|
|
177
|
+
const reply = await call("melra_plan", {
|
|
178
|
+
goal: "Conformance: write the probe file",
|
|
179
|
+
operation: write,
|
|
180
|
+
});
|
|
181
|
+
must(reply.ok, reply.text);
|
|
182
|
+
writeTaskId = field(reply.value, "id");
|
|
183
|
+
const outcome = field(reply.value, "policyDecision.outcome");
|
|
184
|
+
must(outcome === "confirm", `policy answered ${outcome}; L2 needs a mutation to be gated (policy.mutations: "confirm")`);
|
|
185
|
+
must(field(reply.value, "status") === "awaiting_approval", "a gated mutation was not left awaiting approval");
|
|
186
|
+
approvalId = field(reply.value, "approval.approvalId");
|
|
187
|
+
phrase = field(reply.value, "approval.phrase");
|
|
188
|
+
must(field(reply.value, "approval.taskId") === writeTaskId, "the approval challenge is not scoped to this task");
|
|
189
|
+
must(/^[a-f0-9]{64}$/.test(field(reply.value, "approval.actionDigest")), "the approval challenge carries no action digest");
|
|
190
|
+
return "planning a mutation produced a task-scoped approval challenge";
|
|
191
|
+
});
|
|
192
|
+
await check(2, "no-approval-is-refused", async () => {
|
|
193
|
+
must(writeTaskId !== undefined, "no planned mutation to execute");
|
|
194
|
+
const reply = await call("melra_execute", { taskId: writeTaskId });
|
|
195
|
+
must(!reply.ok, "a gated mutation executed with no approval at all");
|
|
196
|
+
return `refused: ${reply.text}`;
|
|
197
|
+
});
|
|
198
|
+
await check(2, "wrong-phrase-is-refused", async () => {
|
|
199
|
+
must(writeTaskId !== undefined, "no planned mutation to execute");
|
|
200
|
+
must(phrase !== undefined && approvalId !== undefined, "no challenge issued");
|
|
201
|
+
const reply = await call("melra_execute", {
|
|
202
|
+
taskId: writeTaskId,
|
|
203
|
+
approval: { approvalId, phrase: `${phrase} and also this` },
|
|
204
|
+
});
|
|
205
|
+
must(!reply.ok, "a gated mutation executed on a phrase that was not the one issued");
|
|
206
|
+
return `refused: ${reply.text}`;
|
|
207
|
+
});
|
|
208
|
+
await check(2, "refused-effects-did-not-happen", async () => {
|
|
209
|
+
const reply = await call("melra_plan", {
|
|
210
|
+
goal: "Conformance: confirm the refused write left nothing behind",
|
|
211
|
+
operation: { kind: "file", action: "read", path: probe },
|
|
212
|
+
});
|
|
213
|
+
must(reply.ok, reply.text);
|
|
214
|
+
const executed = await call("melra_execute", {
|
|
215
|
+
taskId: field(reply.value, "id"),
|
|
216
|
+
});
|
|
217
|
+
const status = executed.ok
|
|
218
|
+
? field(executed.value, "task.status")
|
|
219
|
+
: "refused";
|
|
220
|
+
must(status !== "verified_success", "the probe file exists, so a refused mutation ran anyway");
|
|
221
|
+
return "two refusals, and the file they would have created does not exist";
|
|
222
|
+
});
|
|
223
|
+
await check(2, "freeform-constraints-are-denied-as-a-result", async () => {
|
|
224
|
+
const reply = await call("melra_plan", {
|
|
225
|
+
goal: "Conformance: a limit expressed as prose",
|
|
226
|
+
operation: { kind: "system", action: "info" },
|
|
227
|
+
constraints: ["do not touch anything important"],
|
|
228
|
+
});
|
|
229
|
+
// Denial has to be a normal result. A harness that cannot tell "policy said
|
|
230
|
+
// no" from "the call failed" will retry a denial as if it were a blip.
|
|
231
|
+
must(reply.ok, `a policy denial came back as a transport error: ${reply.text}`);
|
|
232
|
+
must(field(reply.value, "status") === "policy_blocked", "prose constraints were not denied");
|
|
233
|
+
const blocked = field(reply.value, "id");
|
|
234
|
+
const executed = await call("melra_execute", { taskId: blocked });
|
|
235
|
+
must(executed.ok, `executing a blocked task errored: ${executed.text}`);
|
|
236
|
+
must(field(executed.value, "task.status") === "policy_blocked", "a blocked task ran when executed anyway");
|
|
237
|
+
must(executed.value.receipt === undefined, "a blocked task produced an execution receipt");
|
|
238
|
+
return `denied with ${field(reply.value, "policyDecision.reason")}, and still denied at execute`;
|
|
239
|
+
});
|
|
240
|
+
await check(3, "approved-mutation-verifies", async () => {
|
|
241
|
+
must(writeTaskId !== undefined, "no planned mutation to execute");
|
|
242
|
+
must(phrase !== undefined && approvalId !== undefined, "no challenge issued");
|
|
243
|
+
const reply = await call("melra_execute", {
|
|
244
|
+
taskId: writeTaskId,
|
|
245
|
+
approval: { approvalId, phrase },
|
|
246
|
+
});
|
|
247
|
+
must(reply.ok, reply.text);
|
|
248
|
+
probeWritten = true;
|
|
249
|
+
const status = field(reply.value, "task.status");
|
|
250
|
+
must(status === "verified_success", `approved mutation ended ${status}`);
|
|
251
|
+
const result = field(reply.value, "certificate.result");
|
|
252
|
+
must(result === "VERIFIED_SUCCESS", `certificate says ${result}`);
|
|
253
|
+
must(/^[a-f0-9]{64}$/.test(field(reply.value, "certificate.digest")), "the certificate carries no SHA-256 digest");
|
|
254
|
+
const evidence = field(reply.value, "certificate.evidence");
|
|
255
|
+
must(evidence.length > 0, "verified success with no evidence at all");
|
|
256
|
+
must(evidence.every((item) => item.passed), `verified success over failing evidence: ${JSON.stringify(evidence)}`);
|
|
257
|
+
return `${status} on ${evidence.length} passing evidence item(s)`;
|
|
258
|
+
});
|
|
259
|
+
await check(3, "the-effect-really-happened", async () => {
|
|
260
|
+
const reply = await call("melra_plan", {
|
|
261
|
+
goal: "Conformance: read back what the approved write claims to have done",
|
|
262
|
+
operation: { kind: "file", action: "read", path: probe },
|
|
263
|
+
});
|
|
264
|
+
must(reply.ok, reply.text);
|
|
265
|
+
const executed = await call("melra_execute", {
|
|
266
|
+
taskId: field(reply.value, "id"),
|
|
267
|
+
});
|
|
268
|
+
must(executed.ok, executed.text);
|
|
269
|
+
must(field(executed.value, "task.status") === "verified_success", "reading the file the kernel says it wrote did not verify");
|
|
270
|
+
must(field(executed.value, "output.content") === marker, "the file exists but does not hold what was approved");
|
|
271
|
+
return "the approved bytes are on disk, read back through the kernel";
|
|
272
|
+
});
|
|
273
|
+
await check(3, "the-receipt-outlives-the-call", async () => {
|
|
274
|
+
must(writeTaskId !== undefined, "no executed mutation to read back");
|
|
275
|
+
const status = await call("melra_task_status", { taskId: writeTaskId });
|
|
276
|
+
must(status.ok, status.text);
|
|
277
|
+
must(field(status.value, "status") === "verified_success", "the durable record disagrees with what execute returned");
|
|
278
|
+
const receiptIds = field(status.value, "receiptIds");
|
|
279
|
+
must(receiptIds.length === 1, `${receiptIds.length} receipts for one effect`);
|
|
280
|
+
const reply = await call("melra_receipt", { taskId: writeTaskId });
|
|
281
|
+
must(reply.ok, reply.text);
|
|
282
|
+
const receipts = field(reply.value, "receipts");
|
|
283
|
+
must(receipts.length === 1, `${receipts.length} receipts returned`);
|
|
284
|
+
must(receipts[0]?.receiptId === receiptIds[0], "the receipt read back is not the one the task records");
|
|
285
|
+
must(field(reply.value, "certificate.result") === "VERIFIED_SUCCESS", "no verified certificate survived the call");
|
|
286
|
+
return `receipt ${receipts[0]?.receiptId} for ${receipts[0]?.capability}, still readable after other tasks ran`;
|
|
287
|
+
});
|
|
288
|
+
// Last, because it is also the cleanup: a destructive effect gated by its own
|
|
289
|
+
// approval, verified by the file being gone.
|
|
290
|
+
await check(3, "destructive-effects-are-gated-and-verified", async () => {
|
|
291
|
+
must(probeWritten, "nothing was written, so nothing is left to delete");
|
|
292
|
+
const reply = await call("melra_plan", {
|
|
293
|
+
goal: "Conformance: remove the probe file",
|
|
294
|
+
operation: { kind: "file", action: "delete", path: probe },
|
|
295
|
+
});
|
|
296
|
+
must(reply.ok, reply.text);
|
|
297
|
+
const effect = field(reply.value, "policyDecision.effect");
|
|
298
|
+
must(effect === "destructive", `deleting a file was classified ${effect}`);
|
|
299
|
+
must(field(reply.value, "policyDecision.risk") === "high", "a destructive effect was not classified high risk");
|
|
300
|
+
must(field(reply.value, "status") === "awaiting_approval", "a destructive effect was not gated");
|
|
301
|
+
const executed = await call("melra_execute", {
|
|
302
|
+
taskId: field(reply.value, "id"),
|
|
303
|
+
approval: {
|
|
304
|
+
approvalId: field(reply.value, "approval.approvalId"),
|
|
305
|
+
phrase: field(reply.value, "approval.phrase"),
|
|
306
|
+
},
|
|
307
|
+
});
|
|
308
|
+
must(executed.ok, executed.text);
|
|
309
|
+
must(field(executed.value, "task.status") === "verified_success", "the delete did not verify");
|
|
310
|
+
probeWritten = false;
|
|
311
|
+
return "a destructive effect needed its own approval and verified as absent";
|
|
312
|
+
});
|
|
313
|
+
await client.close();
|
|
314
|
+
const failedLevels = new Set(checks.filter((entry) => !entry.passed).map((entry) => entry.level));
|
|
315
|
+
let level = 0;
|
|
316
|
+
for (const candidate of [1, 2, 3]) {
|
|
317
|
+
if (failedLevels.has(candidate))
|
|
318
|
+
break;
|
|
319
|
+
level = candidate;
|
|
320
|
+
}
|
|
321
|
+
return {
|
|
322
|
+
report: {
|
|
323
|
+
suite: CONFORMANCE_SUITE,
|
|
324
|
+
runner: PRODUCT_VERSION,
|
|
325
|
+
target,
|
|
326
|
+
level,
|
|
327
|
+
claimed: claim,
|
|
328
|
+
claim: LEVEL_NAMES[level],
|
|
329
|
+
passed: checks.filter((entry) => entry.passed).length,
|
|
330
|
+
of: checks.length,
|
|
331
|
+
checks,
|
|
332
|
+
notProven: NOT_PROVEN,
|
|
333
|
+
// Only ever set when a level-3 check failed between writing the probe and
|
|
334
|
+
// deleting it. Saying where it is beats silently leaving it.
|
|
335
|
+
...(probeWritten ? { uncleanedProbeFile: probe } : {}),
|
|
336
|
+
},
|
|
337
|
+
failed: level < claim,
|
|
338
|
+
};
|
|
339
|
+
}
|
|
340
|
+
async function connect(client, options) {
|
|
341
|
+
if (options.url !== undefined) {
|
|
342
|
+
// Forgiving about the one thing people get wrong: `serve --http` prints both
|
|
343
|
+
// the console URL and the MCP URL, and only one of them is an endpoint.
|
|
344
|
+
const url = new URL(options.url.endsWith("/mcp") ? options.url : `${options.url.replace(/\/$/, "")}/mcp`);
|
|
345
|
+
await client.connect(
|
|
346
|
+
// ponytail: the SDK declares `sessionId?: string` on this transport, which
|
|
347
|
+
// `exactOptionalPropertyTypes` reads as incompatible with the `Transport`
|
|
348
|
+
// it implements. Cast here rather than loosen the flag for the package.
|
|
349
|
+
new StreamableHTTPClientTransport(url, {
|
|
350
|
+
...(options.token === undefined
|
|
351
|
+
? {}
|
|
352
|
+
: {
|
|
353
|
+
requestInit: {
|
|
354
|
+
headers: { authorization: `Bearer ${options.token}` },
|
|
355
|
+
},
|
|
356
|
+
}),
|
|
357
|
+
}));
|
|
358
|
+
return { transport: "http", url: url.href, authenticated: options.token !== undefined };
|
|
359
|
+
}
|
|
360
|
+
const command = options.command ?? process.execPath;
|
|
361
|
+
const args = options.args ??
|
|
362
|
+
(options.command === undefined
|
|
363
|
+
? // Reproduce how this process was started, loaders included, so the same
|
|
364
|
+
// command works from `dist/bin.js` and from `tsx src/index.ts`.
|
|
365
|
+
[...process.execArgv, process.argv[1] ?? "", "serve"]
|
|
366
|
+
: ["serve"]);
|
|
367
|
+
await client.connect(new StdioClientTransport({
|
|
368
|
+
command,
|
|
369
|
+
args,
|
|
370
|
+
// The SDK forwards a small allowlist by default, which would drop every
|
|
371
|
+
// MELRA_* variable and quietly check a server configured differently from
|
|
372
|
+
// the one the operator runs. The point is to check *their* endpoint.
|
|
373
|
+
env: options.env ?? inheritedEnvironment(),
|
|
374
|
+
stderr: "pipe",
|
|
375
|
+
}));
|
|
376
|
+
return { transport: "stdio", command, args };
|
|
377
|
+
}
|
|
378
|
+
function inheritedEnvironment() {
|
|
379
|
+
return Object.fromEntries(Object.entries(process.env).filter((entry) => entry[1] !== undefined));
|
|
380
|
+
}
|
|
381
|
+
//# sourceMappingURL=conformance.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"conformance.js","sourceRoot":"","sources":["../src/conformance.ts"],"names":[],"mappings":"AAAA,2CAA2C;AAC3C,sCAAsC;AAEtC;;;;;;;;;;;;;;;;;;;;;GAqBG;AAEH,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAC1C,OAAO,EAAE,MAAM,EAAE,MAAM,2CAA2C,CAAC;AACnE,OAAO,EAAE,oBAAoB,EAAE,MAAM,2CAA2C,CAAC;AACjF,OAAO,EAAE,6BAA6B,EAAE,MAAM,oDAAoD,CAAC;AAEnG,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAElD,MAAM,CAAC,MAAM,iBAAiB,GAAG,qBAAqB,CAAC;AAEvD,MAAM,WAAW,GAA2B;IAC1C,CAAC,EAAE,MAAM;IACT,CAAC,EAAE,kBAAkB;IACrB,CAAC,EAAE,qBAAqB;IACxB,CAAC,EAAE,qBAAqB;CACzB,CAAC;AAEF,kFAAkF;AAClF,MAAM,YAAY,GAAG;IACnB,oBAAoB;IACpB,YAAY;IACZ,eAAe;IACf,mBAAmB;IACnB,mBAAmB;IACnB,eAAe;IACf,qBAAqB;IACrB,wBAAwB;IACxB,uBAAuB;IACvB,uBAAuB;IACvB,wBAAwB;CAChB,CAAC;AAEX,MAAM,UAAU,GAAG;IACj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C;IACpD,MAAM,IAAI,GACR,OAAO,CAAC,IAAI;QACZ,CAAC,OAAO,CAAC,OAAO,KAAK,SAAS;YAC5B,CAAC,CAAC,wEAAwE;gBACxE,gEAAgE;gBAChE,CAAC,GAAG,OAAO,CAAC,QAAQ,EAAE,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,EAAE,EAAE,OAAO,CAAC;YACvD,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC;IACjB,MAAM,MAAM,CAAC,OAAO,CAClB,IAAI,oBAAoB,CAAC;QACvB,OAAO;QACP,IAAI;QACJ,wEAAwE;QACxE,0EAA0E;QAC1E,qEAAqE;QACrE,GAAG,EAAE,OAAO,CAAC,GAAG,IAAI,oBAAoB,EAAE;QAC1C,MAAM,EAAE,MAAM;KACf,CAAC,CACH,CAAC;IACF,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;AAC/C,CAAC;AAED,SAAS,oBAAoB;IAC3B,OAAO,MAAM,CAAC,WAAW,CACvB,MAAM,CAAC,OAAO,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,MAAM,CAChC,CAAC,KAAK,EAA6B,EAAE,CAAC,KAAK,CAAC,CAAC,CAAC,KAAK,SAAS,CAC7D,CACF,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
export interface CliEnvironment {
|
|
2
|
+
workspaceRoot: string;
|
|
3
|
+
dataDirectory: string;
|
|
4
|
+
unhinged: boolean;
|
|
5
|
+
policyPath?: string;
|
|
6
|
+
browserExecutablePath?: string;
|
|
7
|
+
browserCdpEndpoint?: string;
|
|
8
|
+
browserCdpContextIndex?: number;
|
|
9
|
+
browserHarPath?: string;
|
|
10
|
+
browserHarReplayPath?: string;
|
|
11
|
+
browserProfileDir?: string;
|
|
12
|
+
}
|
|
13
|
+
export interface CliEnvironmentDefaults {
|
|
14
|
+
cwd: string;
|
|
15
|
+
home: string;
|
|
16
|
+
}
|
|
17
|
+
export declare function serverLaunch(moduleDirectory: string, version: string): {
|
|
18
|
+
command: string;
|
|
19
|
+
args: string[];
|
|
20
|
+
};
|
|
21
|
+
export declare function parseCliEnvironment(source: NodeJS.ProcessEnv, defaults?: CliEnvironmentDefaults): CliEnvironment;
|
|
22
|
+
//# sourceMappingURL=environment.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"environment.d.ts","sourceRoot":"","sources":["../src/environment.ts"],"names":[],"mappings":"AAOA,MAAM,WAAW,cAAc;IAC7B,aAAa,EAAE,MAAM,CAAC;IACtB,aAAa,EAAE,MAAM,CAAC;IACtB,QAAQ,EAAE,OAAO,CAAC;IAClB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,qBAAqB,CAAC,EAAE,MAAM,CAAC;IAC/B,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,sBAAsB,CAAC,EAAE,MAAM,CAAC;IAChC,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,oBAAoB,CAAC,EAAE,MAAM,CAAC;IAC9B,iBAAiB,CAAC,EAAE,MAAM,CAAC;CAC5B;AAED,MAAM,WAAW,sBAAsB;IACrC,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,EAAE,MAAM,CAAC;CACd;AAOD,wBAAgB,YAAY,CAC1B,eAAe,EAAE,MAAM,EACvB,OAAO,EAAE,MAAM,GACd;IAAE,OAAO,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,EAAE,CAAA;CAAE,CAIrC;AA0CD,wBAAgB,mBAAmB,CACjC,MAAM,EAAE,MAAM,CAAC,UAAU,EACzB,QAAQ,GAAE,sBAGT,GACA,cAAc,CAwDhB"}
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
// Copyright 2026 XAGI Labs Private Limited
|
|
2
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
3
|
+
import { homedir } from "node:os";
|
|
4
|
+
import { isAbsolute, join, resolve } from "node:path";
|
|
5
|
+
import { unhingedFromEnvironment } from "@melra/server";
|
|
6
|
+
// A generated client config has to name a command the client can actually
|
|
7
|
+
// spawn. `npx` runs the CLI out of its own cache and leaves nothing on PATH,
|
|
8
|
+
// so `melra` would fail to start for exactly the users who took the shortest
|
|
9
|
+
// install path. Pin the version that wrote the config, so the client keeps
|
|
10
|
+
// launching the same server until someone changes it.
|
|
11
|
+
export function serverLaunch(moduleDirectory, version) {
|
|
12
|
+
return /[\\/]_npx[\\/]/.test(moduleDirectory)
|
|
13
|
+
? { command: "npx", args: ["-y", `@melra/cli@${version}`, "serve"] }
|
|
14
|
+
: { command: "melra", args: ["serve"] };
|
|
15
|
+
}
|
|
16
|
+
function cdpEndpoint(value) {
|
|
17
|
+
if (value === undefined)
|
|
18
|
+
return undefined;
|
|
19
|
+
let parsed;
|
|
20
|
+
try {
|
|
21
|
+
parsed = new URL(value);
|
|
22
|
+
}
|
|
23
|
+
catch {
|
|
24
|
+
throw new Error("browser_cdp_endpoint_invalid");
|
|
25
|
+
}
|
|
26
|
+
if (!["http:", "https:"].includes(parsed.protocol) ||
|
|
27
|
+
parsed.username !== "" ||
|
|
28
|
+
parsed.password !== "" ||
|
|
29
|
+
parsed.search !== "" ||
|
|
30
|
+
parsed.hash !== "") {
|
|
31
|
+
throw new Error("browser_cdp_endpoint_invalid");
|
|
32
|
+
}
|
|
33
|
+
return parsed.href;
|
|
34
|
+
}
|
|
35
|
+
function cdpContextIndex(value) {
|
|
36
|
+
if (value === undefined)
|
|
37
|
+
return undefined;
|
|
38
|
+
if (!/^-?\d+$/.test(value)) {
|
|
39
|
+
throw new Error("browser_cdp_context_index_invalid");
|
|
40
|
+
}
|
|
41
|
+
const parsed = Number(value);
|
|
42
|
+
if (!Number.isSafeInteger(parsed) || parsed < -1) {
|
|
43
|
+
throw new Error("browser_cdp_context_index_invalid");
|
|
44
|
+
}
|
|
45
|
+
return parsed;
|
|
46
|
+
}
|
|
47
|
+
function harPath(value) {
|
|
48
|
+
if (value === undefined)
|
|
49
|
+
return undefined;
|
|
50
|
+
if (!isAbsolute(value)) {
|
|
51
|
+
throw new Error("browser_har_path_must_be_absolute");
|
|
52
|
+
}
|
|
53
|
+
return resolve(value);
|
|
54
|
+
}
|
|
55
|
+
export function parseCliEnvironment(source, defaults = {
|
|
56
|
+
cwd: process.cwd(),
|
|
57
|
+
home: homedir(),
|
|
58
|
+
}) {
|
|
59
|
+
const endpoint = cdpEndpoint(source.MELRA_BROWSER_CDP_ENDPOINT);
|
|
60
|
+
const contextIndex = cdpContextIndex(source.MELRA_BROWSER_CDP_CONTEXT_INDEX);
|
|
61
|
+
const recordHarPath = harPath(source.MELRA_BROWSER_HAR_PATH);
|
|
62
|
+
const replayHarPath = harPath(source.MELRA_BROWSER_HAR_REPLAY);
|
|
63
|
+
const profileDir = source.MELRA_BROWSER_PROFILE;
|
|
64
|
+
if (profileDir !== undefined && !isAbsolute(profileDir)) {
|
|
65
|
+
throw new Error("browser_profile_must_be_absolute");
|
|
66
|
+
}
|
|
67
|
+
if (endpoint !== undefined && profileDir !== undefined) {
|
|
68
|
+
// An attached browser already has whatever profile it was started with;
|
|
69
|
+
// pointing at a second one would silently do nothing.
|
|
70
|
+
throw new Error("browser_cdp_cannot_use_profile");
|
|
71
|
+
}
|
|
72
|
+
if (endpoint !== undefined && recordHarPath !== undefined) {
|
|
73
|
+
throw new Error("browser_cdp_cannot_start_har_recording");
|
|
74
|
+
}
|
|
75
|
+
if (endpoint !== undefined && replayHarPath !== undefined) {
|
|
76
|
+
// Replay serves requests from the archive, which means never opening the
|
|
77
|
+
// socket an attached browser is already holding open.
|
|
78
|
+
throw new Error("browser_cdp_cannot_replay_har");
|
|
79
|
+
}
|
|
80
|
+
if (recordHarPath !== undefined && replayHarPath !== undefined) {
|
|
81
|
+
throw new Error("browser_har_replay_cannot_record");
|
|
82
|
+
}
|
|
83
|
+
if (contextIndex !== undefined && endpoint === undefined) {
|
|
84
|
+
throw new Error("browser_cdp_context_requires_endpoint");
|
|
85
|
+
}
|
|
86
|
+
return {
|
|
87
|
+
workspaceRoot: resolve(source.MELRA_WORKSPACE ?? defaults.cwd),
|
|
88
|
+
dataDirectory: resolve(source.MELRA_HOME ?? join(defaults.home, ".melra")),
|
|
89
|
+
unhinged: unhingedFromEnvironment(source),
|
|
90
|
+
...(source.MELRA_POLICY === undefined
|
|
91
|
+
? {}
|
|
92
|
+
: { policyPath: resolve(source.MELRA_POLICY) }),
|
|
93
|
+
...(source.MELRA_BROWSER === undefined
|
|
94
|
+
? {}
|
|
95
|
+
: { browserExecutablePath: resolve(source.MELRA_BROWSER) }),
|
|
96
|
+
...(endpoint === undefined ? {} : { browserCdpEndpoint: endpoint }),
|
|
97
|
+
...(contextIndex === undefined
|
|
98
|
+
? {}
|
|
99
|
+
: { browserCdpContextIndex: contextIndex }),
|
|
100
|
+
...(recordHarPath === undefined ? {} : { browserHarPath: recordHarPath }),
|
|
101
|
+
...(replayHarPath === undefined
|
|
102
|
+
? {}
|
|
103
|
+
: { browserHarReplayPath: replayHarPath }),
|
|
104
|
+
...(profileDir === undefined
|
|
105
|
+
? {}
|
|
106
|
+
: { browserProfileDir: resolve(profileDir) }),
|
|
107
|
+
};
|
|
108
|
+
}
|
|
109
|
+
//# sourceMappingURL=environment.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"environment.js","sourceRoot":"","sources":["../src/environment.ts"],"names":[],"mappings":"AAAA,2CAA2C;AAC3C,sCAAsC;AAEtC,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAClC,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACtD,OAAO,EAAE,uBAAuB,EAAE,MAAM,eAAe,CAAC;AAoBxD,0EAA0E;AAC1E,6EAA6E;AAC7E,6EAA6E;AAC7E,2EAA2E;AAC3E,sDAAsD;AACtD,MAAM,UAAU,YAAY,CAC1B,eAAuB,EACvB,OAAe;IAEf,OAAO,gBAA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