rovloom 0.6.0 → 0.6.1
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 +2 -2
- package/dist/src/admin/index.js +1 -1
- package/dist/src/{chunk-g27b2gmx.js → chunk-0e9gg4sg.js} +2 -2
- package/dist/src/chunk-1xer1ent.js +102 -0
- package/dist/src/{chunk-863tk45b.js → chunk-41fny9qm.js} +5 -5
- package/dist/src/{chunk-zjzrcc59.js → chunk-59h200cr.js} +139 -7
- package/dist/src/chunk-5w5srj3b.js +93 -0
- package/dist/src/{chunk-d4ejrtjq.js → chunk-6n6b1xpy.js} +1 -1
- package/dist/src/{chunk-ez7d5dac.js → chunk-6w4g9fw8.js} +4 -1
- package/dist/src/{chunk-0dqx2mmz.js → chunk-73aq2qkz.js} +1 -1
- package/dist/src/{chunk-n6wtjyfb.js → chunk-8c9yc0ge.js} +5 -5
- package/dist/src/{chunk-57ayxqnb.js → chunk-8fy8w7ds.js} +2 -23
- package/dist/src/{chunk-2tn0r64b.js → chunk-9h9x79bx.js} +5 -5
- package/dist/src/{chunk-qjh9x872.js → chunk-av31bx1e.js} +1 -1
- package/dist/src/{chunk-0xgpxdgc.js → chunk-bbdtsg4b.js} +7 -5
- package/dist/src/{chunk-q5pgbwb3.js → chunk-e7jgpxkf.js} +2 -2
- package/dist/src/{chunk-zj48jvfe.js → chunk-efty77sb.js} +3 -40
- package/dist/src/{chunk-gyvqqnjb.js → chunk-enj7s8cv.js} +49 -29
- package/dist/src/{chunk-jka7v3wb.js → chunk-ftpy8xx3.js} +311 -23
- package/dist/src/{chunk-zdxww7ms.js → chunk-h3xyq7zk.js} +1 -1
- package/dist/src/{chunk-ttsrctxg.js → chunk-hxmq28pg.js} +9 -7
- package/dist/src/{chunk-s3ydr65k.js → chunk-j59ac0xs.js} +2 -2
- package/dist/src/{chunk-5s2emvww.js → chunk-j6svdqr8.js} +10 -302
- package/dist/src/{chunk-9zkq0kc8.js → chunk-jkzfck98.js} +3 -3
- package/dist/src/{chunk-ssp57p43.js → chunk-m76cmkfy.js} +7 -5
- package/dist/src/{chunk-d2kz25f2.js → chunk-m96mbzcw.js} +674 -308
- package/dist/src/{chunk-yv9px0f5.js → chunk-n3z3jaxy.js} +20 -14
- package/dist/src/{chunk-jf4r0r44.js → chunk-ndj0ay2p.js} +19 -18
- package/dist/src/{chunk-5b8g62kw.js → chunk-pgs9jp6t.js} +61 -179
- package/dist/src/chunk-pksaqt9a.js +25 -0
- package/dist/src/{chunk-wxqhscsw.js → chunk-pnep7yhj.js} +7 -99
- package/dist/src/chunk-qn5xae7g.js +66 -0
- package/dist/src/{chunk-0pewfj89.js → chunk-qp8tgms2.js} +1 -1
- package/dist/src/{chunk-mg0fd6ph.js → chunk-rmgw8h27.js} +10 -8
- package/dist/src/{chunk-gbsbwssz.js → chunk-sf4ztxba.js} +3 -3
- package/dist/src/{chunk-x0td5wn4.js → chunk-shez7hkc.js} +1 -1
- package/dist/src/chunk-sqz614bh.js +30 -0
- package/dist/src/{chunk-09f9q26d.js → chunk-vdwzb63d.js} +2 -2
- package/dist/src/chunk-xtvgm6kf.js +48 -0
- package/dist/src/chunk-y8zm75jt.js +157 -0
- package/dist/src/chunk-yasqw2vj.js +756 -0
- package/dist/src/{chunk-srfbjwtk.js → chunk-z0qmfqvd.js} +3 -3
- package/dist/src/chunk-zm705snh.js +53 -0
- package/dist/src/cli/index.js +29 -28
- package/dist/src/cli/main.js +5 -5
- package/dist/src/connector/herdr/installation.js +4 -4
- package/dist/src/connector/herdr/provider.js +9 -9
- package/dist/src/connector/herdr/runtime.js +7 -7
- package/dist/src/connector/luvus/index.js +7 -6
- package/dist/src/mcp/index.js +16 -15
- package/dist/src/runtime/index.js +16 -15
- package/dist/src/service/index.js +2 -2
- package/dist/src/store.js +4 -4
- package/dist/src/transport/index.js +9 -9
- package/dist/src/webui/index.js +141 -939
- package/package.json +1 -1
- package/dist/src/chunk-0qgk7mhz.js +0 -52
- package/dist/src/chunk-3dvn33c4.js +0 -1299
- package/dist/src/chunk-5j0gj6w2.js +0 -7
- package/dist/src/chunk-vwcntax3.js +0 -228
- package/dist/src/chunk-ytpfmcp1.js +0 -25
- package/dist/src/chunk-zjkjjm81.js +0 -1114
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import {
|
|
3
3
|
cliMessages2,
|
|
4
4
|
formatMessage2
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-pgs9jp6t.js";
|
|
6
6
|
import {
|
|
7
7
|
readRuntimeConfig2
|
|
8
8
|
} from "./chunk-bspzg8er.js";
|
|
@@ -22,7 +22,7 @@ import {
|
|
|
22
22
|
} from "./chunk-hpzr94hm.js";
|
|
23
23
|
import {
|
|
24
24
|
PRODUCT_VERSION2
|
|
25
|
-
} from "./chunk-
|
|
25
|
+
} from "./chunk-j59ac0xs.js";
|
|
26
26
|
import {
|
|
27
27
|
isWildcardHostname
|
|
28
28
|
} from "./chunk-6n9s7nfe.js";
|
|
@@ -113,26 +113,43 @@ function parseCommand2(args, environment) {
|
|
|
113
113
|
throw new CliError2("invalid_arguments");
|
|
114
114
|
}
|
|
115
115
|
const withoutNonInteractive = nonInteractive ? serviceArgs.slice(0, -1) : serviceArgs;
|
|
116
|
-
const
|
|
117
|
-
|
|
118
|
-
const addDevice = withoutNonInteractive[0] === "gateway" && flag === "--add-device";
|
|
119
|
-
const claim = withoutNonInteractive[0] === "connector" && flag === "--claim";
|
|
120
|
-
if ((repair || addDevice || claim) && nonInteractive) {
|
|
116
|
+
const role = withoutNonInteractive[0];
|
|
117
|
+
if (role !== "gateway" && role !== "connector") {
|
|
121
118
|
throw new CliError2("invalid_arguments");
|
|
122
119
|
}
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
120
|
+
let explicit;
|
|
121
|
+
let joinValue;
|
|
122
|
+
let issueCode = false;
|
|
123
|
+
let unpair = false;
|
|
124
|
+
for (let index = 1;index < withoutNonInteractive.length; index++) {
|
|
125
|
+
const option = withoutNonInteractive[index];
|
|
126
|
+
if (option === "--config" && explicit === undefined) {
|
|
127
|
+
explicit = withoutNonInteractive[++index];
|
|
128
|
+
if (explicit === undefined || explicit.startsWith("--")) {
|
|
129
|
+
throw new CliError2("invalid_arguments");
|
|
130
|
+
}
|
|
131
|
+
} else if (option === "--join" && role === "connector" && joinValue === undefined && !unpair) {
|
|
132
|
+
joinValue = withoutNonInteractive[++index];
|
|
133
|
+
if (joinValue === undefined || !/^wss?:\/\/[^#\s]+#[A-Za-z0-9_.-]+$/.test(joinValue)) {
|
|
134
|
+
throw new CliError2("invalid_arguments");
|
|
135
|
+
}
|
|
136
|
+
} else if (option === "--issue-code" && role === "gateway" && !issueCode) {
|
|
137
|
+
issueCode = true;
|
|
138
|
+
} else if (option === "--unpair" && role === "connector" && !unpair && joinValue === undefined) {
|
|
139
|
+
unpair = true;
|
|
140
|
+
} else {
|
|
141
|
+
throw new CliError2("invalid_arguments");
|
|
142
|
+
}
|
|
134
143
|
}
|
|
135
|
-
|
|
144
|
+
return {
|
|
145
|
+
action: role,
|
|
146
|
+
path: resolveRoleConfigPath2(role, explicit, environment),
|
|
147
|
+
...nonInteractive ? { nonInteractive: true } : {},
|
|
148
|
+
...serviceId ? { serviceId } : {},
|
|
149
|
+
...joinValue !== undefined ? { join: joinValue } : {},
|
|
150
|
+
...issueCode ? { issueCode: true } : {},
|
|
151
|
+
...unpair ? { unpair: true } : {}
|
|
152
|
+
};
|
|
136
153
|
}
|
|
137
154
|
async function untilStopped(running, signal) {
|
|
138
155
|
let wake;
|
|
@@ -152,7 +169,7 @@ async function untilStopped(running, signal) {
|
|
|
152
169
|
async function runCli2(args, io, runtime = {}, environment) {
|
|
153
170
|
try {
|
|
154
171
|
if (args[0] === "service") {
|
|
155
|
-
const { handleServiceCommand } = await import("./chunk-
|
|
172
|
+
const { handleServiceCommand } = await import("./chunk-0e9gg4sg.js");
|
|
156
173
|
if (args.length === 2 && args[1] === "--help") {
|
|
157
174
|
io.stderr.write(cliMessages2(io.language)["help.service"]);
|
|
158
175
|
return 0;
|
|
@@ -182,15 +199,15 @@ async function runCli2(args, io, runtime = {}, environment) {
|
|
|
182
199
|
throw new CliError2("invalid_arguments");
|
|
183
200
|
}
|
|
184
201
|
if (args[0] === "admin") {
|
|
185
|
-
const { handleAdminCommand } = await import("./chunk-
|
|
202
|
+
const { handleAdminCommand } = await import("./chunk-n3z3jaxy.js");
|
|
186
203
|
return await handleAdminCommand(args, io, environment);
|
|
187
204
|
}
|
|
188
205
|
if (args[0] === "doctor" || args[0] === "storage") {
|
|
189
|
-
const { handleStorageCommand } = await import("./chunk-
|
|
206
|
+
const { handleStorageCommand } = await import("./chunk-8c9yc0ge.js");
|
|
190
207
|
return await handleStorageCommand(args, io, environment);
|
|
191
208
|
}
|
|
192
209
|
if (args[0] === "token") {
|
|
193
|
-
const { handleTokenCommand } = await import("./chunk-
|
|
210
|
+
const { handleTokenCommand } = await import("./chunk-m76cmkfy.js");
|
|
194
211
|
return await handleTokenCommand(args, io, environment);
|
|
195
212
|
}
|
|
196
213
|
if (args[0] === "config" && args[1] === "init") {
|
|
@@ -251,11 +268,14 @@ async function runCli2(args, io, runtime = {}, environment) {
|
|
|
251
268
|
if (io.signal.aborted) {
|
|
252
269
|
return 0;
|
|
253
270
|
}
|
|
254
|
-
if (
|
|
271
|
+
if (command.unpair) {
|
|
272
|
+
const { handleConnectorUnpair } = await import("./chunk-sqz614bh.js");
|
|
273
|
+
return await handleConnectorUnpair(command.path, io);
|
|
274
|
+
}
|
|
275
|
+
if (!command.nonInteractive || command.join !== undefined || command.issueCode) {
|
|
255
276
|
config = await runtime.prepare?.(config, command.path, io, {
|
|
256
|
-
...command.
|
|
257
|
-
...command.
|
|
258
|
-
...command.claim ? { claim: true } : {}
|
|
277
|
+
...command.join !== undefined ? { join: command.join } : {},
|
|
278
|
+
...command.issueCode ? { issueCode: true } : {}
|
|
259
279
|
}) ?? config;
|
|
260
280
|
}
|
|
261
281
|
if (config.role !== command.action) {
|
|
@@ -285,7 +305,7 @@ async function runCli2(args, io, runtime = {}, environment) {
|
|
|
285
305
|
io.stderr.write(cliMessages2(io.language)["run.wildcardListenWarning"]);
|
|
286
306
|
}
|
|
287
307
|
try {
|
|
288
|
-
const { startHttpFacade } = await import("./chunk-
|
|
308
|
+
const { startHttpFacade } = await import("./chunk-z0qmfqvd.js");
|
|
289
309
|
const http = startHttpFacade({
|
|
290
310
|
service: gateway.service,
|
|
291
311
|
authentication: gateway.authentication,
|
|
@@ -349,4 +369,4 @@ pairing_required
|
|
|
349
369
|
|
|
350
370
|
export { cliHelp2, parseCommand2, runCli2 };
|
|
351
371
|
|
|
352
|
-
//# debugId=
|
|
372
|
+
//# debugId=9F289B394757794864756E2164756E21
|
|
@@ -12,11 +12,13 @@ import {
|
|
|
12
12
|
fields2,
|
|
13
13
|
id2,
|
|
14
14
|
uint2,
|
|
15
|
+
sha2,
|
|
15
16
|
boundedJson2,
|
|
16
17
|
parseJson2,
|
|
17
18
|
hash2,
|
|
18
19
|
validateTarget2,
|
|
19
20
|
validateProvider2,
|
|
21
|
+
validateContractSource2,
|
|
20
22
|
contractRef2,
|
|
21
23
|
validatePolicies2,
|
|
22
24
|
assertBinding2,
|
|
@@ -27,10 +29,10 @@ import {
|
|
|
27
29
|
Router2
|
|
28
30
|
} from "./chunk-y4hksha9.js";
|
|
29
31
|
import {
|
|
30
|
-
LuvusAdapterError2,
|
|
31
32
|
pinTerminalExecution
|
|
32
|
-
} from "./chunk-
|
|
33
|
+
} from "./chunk-8fy8w7ds.js";
|
|
33
34
|
import {
|
|
35
|
+
compileBundle2,
|
|
34
36
|
createNativeValidator2
|
|
35
37
|
} from "./chunk-mqyq5jh6.js";
|
|
36
38
|
import {
|
|
@@ -47,15 +49,17 @@ import {
|
|
|
47
49
|
createConnector2,
|
|
48
50
|
createDeviceLifecycle2,
|
|
49
51
|
createDeviceLifecycleAdapter2
|
|
50
|
-
} from "./chunk-
|
|
52
|
+
} from "./chunk-59h200cr.js";
|
|
51
53
|
import {
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
54
|
+
LUVUS_OPERATION_METHODS2,
|
|
55
|
+
luvusOperationDescriptor2,
|
|
56
|
+
luvusOperationValidation2,
|
|
57
|
+
validateLuvusOperationParams2
|
|
58
|
+
} from "./chunk-efty77sb.js";
|
|
55
59
|
import {
|
|
56
60
|
configuredSnapshotDirectory,
|
|
57
61
|
Store2
|
|
58
|
-
} from "./chunk-
|
|
62
|
+
} from "./chunk-av31bx1e.js";
|
|
59
63
|
import {
|
|
60
64
|
createProviderResultAccess2,
|
|
61
65
|
LUVUS_ENDPOINT_TRANSPORT,
|
|
@@ -72,13 +76,13 @@ import {
|
|
|
72
76
|
parseRpcFrame,
|
|
73
77
|
LuvusRpcAdapter2,
|
|
74
78
|
readLuvusPeer2
|
|
75
|
-
} from "./chunk-
|
|
79
|
+
} from "./chunk-bbdtsg4b.js";
|
|
76
80
|
import {
|
|
77
81
|
CONNECTOR_MAX_DEADLINE_MS2,
|
|
78
82
|
ConnectorAttemptBook2,
|
|
79
83
|
createConnectorAdmissionBackend2,
|
|
80
84
|
connectorAdmissionAdapter
|
|
81
|
-
} from "./chunk-
|
|
85
|
+
} from "./chunk-6n6b1xpy.js";
|
|
82
86
|
import {
|
|
83
87
|
OwnedProcessShutdownError,
|
|
84
88
|
observeLuvusProcess,
|
|
@@ -90,18 +94,22 @@ import {
|
|
|
90
94
|
NativeInstanceContext,
|
|
91
95
|
discoverLuvusInstallation,
|
|
92
96
|
MANAGED_LUVUS_REVISION2,
|
|
97
|
+
MANAGED_LUVUS_CLASSIFICATION2,
|
|
93
98
|
registerLocalOwnerLuvus,
|
|
94
99
|
assertLocalOwnerLuvus,
|
|
95
100
|
observedLuvusContract,
|
|
96
|
-
startManagedLuvus2
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
} from "./chunk-
|
|
101
|
+
startManagedLuvus2
|
|
102
|
+
} from "./chunk-j6svdqr8.js";
|
|
103
|
+
import {
|
|
104
|
+
createLuvusRequestPreflight,
|
|
105
|
+
luvusValidation
|
|
106
|
+
} from "./chunk-xtvgm6kf.js";
|
|
102
107
|
import {
|
|
103
108
|
LuvusDispatchClaims2
|
|
104
|
-
} from "./chunk-
|
|
109
|
+
} from "./chunk-sf4ztxba.js";
|
|
110
|
+
import {
|
|
111
|
+
LuvusAdapterError2
|
|
112
|
+
} from "./chunk-pksaqt9a.js";
|
|
105
113
|
import {
|
|
106
114
|
agentSearchPath
|
|
107
115
|
} from "./chunk-3nnahj0j.js";
|
|
@@ -2126,6 +2134,53 @@ function createManagementSessionAuthority2(source, options = {}) {
|
|
|
2126
2134
|
close
|
|
2127
2135
|
});
|
|
2128
2136
|
}
|
|
2137
|
+
// src/runtime/luvus-operations-authority.ts
|
|
2138
|
+
import { isDeepStrictEqual } from "util";
|
|
2139
|
+
function assertLuvusOperationsContract(contract) {
|
|
2140
|
+
const source = contract.wire.source;
|
|
2141
|
+
const capabilities = object2(object2(contract.capabilities).result);
|
|
2142
|
+
if (contract.wire.support_status !== "validated" || source.provider_kind !== "luvus" || source.protocol_family !== "uhp" || source.schema_origin !== "installed_cli" || source.schema_command !== "luvus uhp schema" || !/^1\.\d+$/u.test(source.native_protocol_version ?? "") || source.support_basis !== "live_catalog" || source.adapter_revision !== MANAGED_LUVUS_REVISION2 || source.classification_revision !== MANAGED_LUVUS_CLASSIFICATION2 || typeof source.runtime_generation !== "string" || !source.runtime_generation.length || source.runtime_generation !== capabilities.server_generation || contract.compiled.identity.binary_sha256 !== source.binary_sha256 || contract.compiled.identity.schema_sha256 !== source.schema_sha256 || contract.compiled.identity.revision !== source.adapter_revision || !Array.isArray(capabilities.method_contracts)) {
|
|
2143
|
+
throw new LuvusAdapterError2("luvus_operations_source_mismatch");
|
|
2144
|
+
}
|
|
2145
|
+
}
|
|
2146
|
+
function createLuvusOperationsAuthority(contract, current, rawAllowed) {
|
|
2147
|
+
assertLuvusOperationsContract(contract);
|
|
2148
|
+
const methods = object2(object2(contract.capabilities).result).method_contracts;
|
|
2149
|
+
return (attempt, native) => {
|
|
2150
|
+
const proven = current(attempt.binding);
|
|
2151
|
+
const descriptor = luvusOperationDescriptor2(attempt.method);
|
|
2152
|
+
if (proven.authenticated !== true || proven.source_verified !== true || !descriptor || attempt.native_request.method !== attempt.method || attempt.mode !== luvusOperationValidation2(attempt.method) || !isDeepStrictEqual(proven.binding, native)) {
|
|
2153
|
+
throw new LuvusAdapterError2("luvus_operation_unreviewed");
|
|
2154
|
+
}
|
|
2155
|
+
const live = methods.filter((row) => row.method === attempt.method);
|
|
2156
|
+
if (live.length !== 1 || !isDeepStrictEqual({
|
|
2157
|
+
method: live[0].method,
|
|
2158
|
+
access: live[0].access,
|
|
2159
|
+
scope: live[0].scope,
|
|
2160
|
+
idempotent: live[0].idempotent
|
|
2161
|
+
}, descriptor.native)) {
|
|
2162
|
+
throw new LuvusAdapterError2("luvus_operations_contract_mismatch");
|
|
2163
|
+
}
|
|
2164
|
+
validateLuvusOperationParams2(attempt.method, attempt.native_request.params);
|
|
2165
|
+
const raw = attempt.mode === "raw-contract";
|
|
2166
|
+
const allowed = raw && rawAllowed(attempt) === true;
|
|
2167
|
+
return {
|
|
2168
|
+
owner: allowed,
|
|
2169
|
+
raw_requested: raw,
|
|
2170
|
+
...allowed ? {
|
|
2171
|
+
raw_grant: {
|
|
2172
|
+
id: attempt.binding.call_id,
|
|
2173
|
+
source_verified: true,
|
|
2174
|
+
principal_id: attempt.principal_id,
|
|
2175
|
+
binding: native,
|
|
2176
|
+
methods: [attempt.method],
|
|
2177
|
+
expires_at: attempt.binding.registration.deadline
|
|
2178
|
+
}
|
|
2179
|
+
} : {}
|
|
2180
|
+
};
|
|
2181
|
+
};
|
|
2182
|
+
}
|
|
2183
|
+
|
|
2129
2184
|
// src/runtime/luvus-operations-provider.ts
|
|
2130
2185
|
function createLuvusOperationsProvider2(owner, peerPolicyRevision) {
|
|
2131
2186
|
assertLocalOwnerLuvus(owner);
|
|
@@ -2175,7 +2230,7 @@ function createLuvusOperationsProvider2(owner, peerPolicyRevision) {
|
|
|
2175
2230
|
}
|
|
2176
2231
|
// src/runtime/native-attach.ts
|
|
2177
2232
|
import { randomUUID } from "crypto";
|
|
2178
|
-
import { isDeepStrictEqual } from "util";
|
|
2233
|
+
import { isDeepStrictEqual as isDeepStrictEqual2 } from "util";
|
|
2179
2234
|
class AttachedLuvus extends NativeInstanceContext {
|
|
2180
2235
|
#observation;
|
|
2181
2236
|
#closed = false;
|
|
@@ -2254,7 +2309,7 @@ async function attachExistingLuvus2(config, options = {}) {
|
|
|
2254
2309
|
bytes,
|
|
2255
2310
|
beforeWrite() {
|
|
2256
2311
|
observation.assertLive();
|
|
2257
|
-
if (!
|
|
2312
|
+
if (!isDeepStrictEqual2(readLuvusPeer2(socket, endpoint), observation.identity())) {
|
|
2258
2313
|
throw new LuvusAdapterError2("attached_peer_mismatch");
|
|
2259
2314
|
}
|
|
2260
2315
|
}
|
|
@@ -2279,7 +2334,7 @@ async function attachExistingLuvus2(config, options = {}) {
|
|
|
2279
2334
|
}
|
|
2280
2335
|
// src/runtime/production-luvus.ts
|
|
2281
2336
|
import { join as join2 } from "path";
|
|
2282
|
-
import { isDeepStrictEqual as
|
|
2337
|
+
import { isDeepStrictEqual as isDeepStrictEqual3 } from "util";
|
|
2283
2338
|
|
|
2284
2339
|
// src/runtime/luvus-user-source.ts
|
|
2285
2340
|
import { spawn } from "child_process";
|
|
@@ -2458,6 +2513,239 @@ async function startUserLuvus(input) {
|
|
|
2458
2513
|
});
|
|
2459
2514
|
}
|
|
2460
2515
|
|
|
2516
|
+
// src/runtime/remote-luvus.ts
|
|
2517
|
+
function checkedRemoteLuvusConfig(reference, input) {
|
|
2518
|
+
const config = object2(JSON.parse(boundedJson2(input)));
|
|
2519
|
+
fields2(config, ["kind", "authentication", "binding", "target", "contract", "peer_policy_revision"], ["raw_grant"]);
|
|
2520
|
+
validateProvider2(config.binding);
|
|
2521
|
+
validateTarget2(config.target);
|
|
2522
|
+
id2(config.peer_policy_revision);
|
|
2523
|
+
const pin = object2(config.contract);
|
|
2524
|
+
fields2(pin, [
|
|
2525
|
+
"binary_version",
|
|
2526
|
+
"binary_sha256",
|
|
2527
|
+
"schema_sha256",
|
|
2528
|
+
"adapter_revision",
|
|
2529
|
+
"classification_revision",
|
|
2530
|
+
"schema_bundle"
|
|
2531
|
+
]);
|
|
2532
|
+
sha2(pin.binary_sha256);
|
|
2533
|
+
sha2(pin.schema_sha256);
|
|
2534
|
+
if (config.kind !== "luvus" || config.authentication !== "remote_connector" || config.binding.kind !== "luvus" || config.target.profile !== "session" || config.binding.machine_id !== config.target.machine_id || config.binding.provider_id !== config.target.provider_id || config.binding.config_ref !== reference || typeof pin.binary_version !== "string" || !pin.binary_version.length || pin.binary_version.length > 128 || pin.adapter_revision !== MANAGED_LUVUS_REVISION2 || pin.classification_revision !== MANAGED_LUVUS_CLASSIFICATION2 || typeof pin.schema_bundle !== "string" || hash2(pin.schema_bundle) !== pin.schema_sha256) {
|
|
2535
|
+
throw new LuvusAdapterError2("remote_luvus_pin_invalid");
|
|
2536
|
+
}
|
|
2537
|
+
if (config.raw_grant !== undefined) {
|
|
2538
|
+
const grant = object2(config.raw_grant);
|
|
2539
|
+
fields2(grant, ["principal_id", "methods"]);
|
|
2540
|
+
id2(grant.principal_id);
|
|
2541
|
+
if (!Array.isArray(grant.methods) || grant.methods.length > LUVUS_OPERATION_METHODS2.length || new Set(grant.methods).size !== grant.methods.length || grant.methods.some((method) => !LUVUS_OPERATION_METHODS2.includes(method))) {
|
|
2542
|
+
throw new LuvusAdapterError2("remote_luvus_raw_grant_invalid");
|
|
2543
|
+
}
|
|
2544
|
+
Object.freeze(grant.methods);
|
|
2545
|
+
Object.freeze(grant);
|
|
2546
|
+
}
|
|
2547
|
+
Object.freeze(config.binding);
|
|
2548
|
+
Object.freeze(config.target);
|
|
2549
|
+
Object.freeze(pin);
|
|
2550
|
+
return Object.freeze(config);
|
|
2551
|
+
}
|
|
2552
|
+
async function createPinnedRemoteLuvus(config) {
|
|
2553
|
+
const pin = config.contract;
|
|
2554
|
+
const compiled = await compileBundle2(Buffer.from(pin.schema_bundle), {
|
|
2555
|
+
identity: { binary_sha256: pin.binary_sha256, schema_sha256: pin.schema_sha256, revision: pin.adapter_revision }
|
|
2556
|
+
});
|
|
2557
|
+
if (!compiled.ok) {
|
|
2558
|
+
throw new LuvusAdapterError2(compiled.error.code);
|
|
2559
|
+
}
|
|
2560
|
+
const contractHandle = compiled.value;
|
|
2561
|
+
const target = config.target;
|
|
2562
|
+
if (target.profile !== "session") {
|
|
2563
|
+
throw new LuvusAdapterError2("remote_luvus_pin_invalid");
|
|
2564
|
+
}
|
|
2565
|
+
const validator = createNativeValidator2(contractHandle);
|
|
2566
|
+
let closed = false;
|
|
2567
|
+
let active;
|
|
2568
|
+
function assertEpoch(epoch) {
|
|
2569
|
+
if (closed || epoch.closed || active !== epoch) {
|
|
2570
|
+
throw new LuvusAdapterError2("remote_luvus_epoch_unavailable");
|
|
2571
|
+
}
|
|
2572
|
+
const checked = epoch.assertCurrent();
|
|
2573
|
+
if (checked !== undefined) {
|
|
2574
|
+
Promise.resolve(checked).catch(() => {});
|
|
2575
|
+
throw new LuvusAdapterError2("synchronous_remote_source_required");
|
|
2576
|
+
}
|
|
2577
|
+
if (closed || epoch.closed || active !== epoch) {
|
|
2578
|
+
throw new LuvusAdapterError2("remote_luvus_epoch_unavailable");
|
|
2579
|
+
}
|
|
2580
|
+
}
|
|
2581
|
+
function closeEpoch(epoch) {
|
|
2582
|
+
epoch.closed = true;
|
|
2583
|
+
epoch.record = undefined;
|
|
2584
|
+
epoch.provider = undefined;
|
|
2585
|
+
if (active === epoch) {
|
|
2586
|
+
active = undefined;
|
|
2587
|
+
}
|
|
2588
|
+
}
|
|
2589
|
+
function nativeBinding(epoch, policies) {
|
|
2590
|
+
assertEpoch(epoch);
|
|
2591
|
+
const record = epoch.record;
|
|
2592
|
+
if (!record) {
|
|
2593
|
+
throw new LuvusAdapterError2("remote_luvus_snapshot_required");
|
|
2594
|
+
}
|
|
2595
|
+
id2(policies.caller_policy_revision);
|
|
2596
|
+
id2(policies.local_policy_revision);
|
|
2597
|
+
const target = config.target;
|
|
2598
|
+
if (target.profile !== "session") {
|
|
2599
|
+
throw new LuvusAdapterError2("remote_luvus_pin_invalid");
|
|
2600
|
+
}
|
|
2601
|
+
const binding = Object.freeze({
|
|
2602
|
+
kind: "luvus",
|
|
2603
|
+
provider_id: target.provider_id,
|
|
2604
|
+
binding_revision: config.binding.binding_revision,
|
|
2605
|
+
contract_source_ref: contractRef2(record.wire.source),
|
|
2606
|
+
target: Object.freeze({ machine_id: target.machine_id, profile: "session", session: target.session }),
|
|
2607
|
+
server_generation: record.wire.source.runtime_generation,
|
|
2608
|
+
connection_epoch: epoch.connection.connection_epoch,
|
|
2609
|
+
recovery_generation: epoch.connection.recovery_generation,
|
|
2610
|
+
capability_revision: record.capability_revision,
|
|
2611
|
+
caller_policy_revision: policies.caller_policy_revision,
|
|
2612
|
+
local_policy_revision: policies.local_policy_revision,
|
|
2613
|
+
classification_revision: pin.classification_revision,
|
|
2614
|
+
contract: contractHandle.identity
|
|
2615
|
+
});
|
|
2616
|
+
assertEpoch(epoch);
|
|
2617
|
+
return Object.freeze({ binding, authenticated: true, source_verified: true });
|
|
2618
|
+
}
|
|
2619
|
+
function ready() {
|
|
2620
|
+
try {
|
|
2621
|
+
if (!active?.record) {
|
|
2622
|
+
return false;
|
|
2623
|
+
}
|
|
2624
|
+
assertEpoch(active);
|
|
2625
|
+
return true;
|
|
2626
|
+
} catch {
|
|
2627
|
+
return false;
|
|
2628
|
+
}
|
|
2629
|
+
}
|
|
2630
|
+
const provider = Object.freeze({
|
|
2631
|
+
remote_luvus: true,
|
|
2632
|
+
binding: config.binding,
|
|
2633
|
+
target: config.target,
|
|
2634
|
+
peer_policy_revision: config.peer_policy_revision,
|
|
2635
|
+
preflightRequest: createLuvusRequestPreflight(contractHandle),
|
|
2636
|
+
ready,
|
|
2637
|
+
open(connection, assertCurrent) {
|
|
2638
|
+
if (closed || active || !connection.authenticated || !connection.active || connection.machine_id !== config.target.machine_id || !connection.negotiated.capabilities.includes("provider_snapshot")) {
|
|
2639
|
+
throw new LuvusAdapterError2("remote_luvus_epoch_unavailable");
|
|
2640
|
+
}
|
|
2641
|
+
const epoch = { connection: structuredClone(connection), assertCurrent, closed: false };
|
|
2642
|
+
active = epoch;
|
|
2643
|
+
try {
|
|
2644
|
+
assertEpoch(epoch);
|
|
2645
|
+
} catch (error) {
|
|
2646
|
+
closeEpoch(epoch);
|
|
2647
|
+
throw error;
|
|
2648
|
+
}
|
|
2649
|
+
return Object.freeze({
|
|
2650
|
+
accept(input) {
|
|
2651
|
+
assertEpoch(epoch);
|
|
2652
|
+
const copied = parseNativeJson2(boundedJson2(input));
|
|
2653
|
+
if (!copied.ok) {
|
|
2654
|
+
throw new LuvusAdapterError2(copied.error.code);
|
|
2655
|
+
}
|
|
2656
|
+
const snapshot = copied.value;
|
|
2657
|
+
fields2(object2(snapshot), ["binding", "target", "source", "capabilities", "capability_revision"]);
|
|
2658
|
+
validateProvider2(snapshot.binding);
|
|
2659
|
+
validateTarget2(snapshot.target);
|
|
2660
|
+
validateContractSource2(snapshot.source);
|
|
2661
|
+
sha2(snapshot.capability_revision);
|
|
2662
|
+
if (boundedJson2(snapshot.binding) !== boundedJson2(config.binding) || boundedJson2(snapshot.target) !== boundedJson2(config.target)) {
|
|
2663
|
+
throw new LuvusAdapterError2("remote_luvus_binding_mismatch");
|
|
2664
|
+
}
|
|
2665
|
+
const source = snapshot.source;
|
|
2666
|
+
if (source.binary_sha256 !== pin.binary_sha256 || source.schema_sha256 !== pin.schema_sha256 || source.adapter_revision !== pin.adapter_revision || source.classification_revision !== pin.classification_revision || typeof source.runtime_generation !== "string" || !source.runtime_generation.length) {
|
|
2667
|
+
throw new LuvusAdapterError2("remote_luvus_contract_mismatch");
|
|
2668
|
+
}
|
|
2669
|
+
const capabilities = object2(snapshot.capabilities);
|
|
2670
|
+
const value = object2(capabilities.result);
|
|
2671
|
+
if (hash2(boundedJson2(value)) !== snapshot.capability_revision) {
|
|
2672
|
+
throw new LuvusAdapterError2("remote_luvus_capability_mismatch");
|
|
2673
|
+
}
|
|
2674
|
+
const shape = validator.checkCapabilitiesShape(capabilities, {
|
|
2675
|
+
target: { machine_id: target.machine_id, profile: "session", session: target.session },
|
|
2676
|
+
server_generation: source.runtime_generation
|
|
2677
|
+
});
|
|
2678
|
+
if (!shape.ok) {
|
|
2679
|
+
throw new LuvusAdapterError2(shape.error.code);
|
|
2680
|
+
}
|
|
2681
|
+
const record = Object.freeze({
|
|
2682
|
+
wire: Object.freeze({ source: Object.freeze(source), support_status: "validated" }),
|
|
2683
|
+
compiled: contractHandle,
|
|
2684
|
+
capabilities,
|
|
2685
|
+
capability_revision: snapshot.capability_revision
|
|
2686
|
+
});
|
|
2687
|
+
assertLuvusOperationsContract(record);
|
|
2688
|
+
const fingerprint = hash2(boundedJson2(snapshot));
|
|
2689
|
+
if (epoch.fingerprint !== undefined) {
|
|
2690
|
+
if (epoch.fingerprint !== fingerprint) {
|
|
2691
|
+
throw new LuvusAdapterError2("remote_luvus_snapshot_changed");
|
|
2692
|
+
}
|
|
2693
|
+
assertEpoch(epoch);
|
|
2694
|
+
return epoch.provider;
|
|
2695
|
+
}
|
|
2696
|
+
function sourceFor(binding) {
|
|
2697
|
+
assertEpoch(epoch);
|
|
2698
|
+
assertBinding2(binding, binding);
|
|
2699
|
+
if (binding.machine_id !== epoch.connection.machine_id || binding.recovery_generation !== epoch.connection.recovery_generation || binding.connection_epoch !== epoch.connection.connection_epoch || binding.provider_kind !== "luvus" || binding.binding_revision !== config.binding.binding_revision || boundedJson2(binding.target) !== boundedJson2(config.target) || binding.contract_ref !== contractRef2(record.wire.source)) {
|
|
2700
|
+
throw new LuvusAdapterError2("remote_luvus_binding_mismatch");
|
|
2701
|
+
}
|
|
2702
|
+
return nativeBinding(epoch, binding.registration);
|
|
2703
|
+
}
|
|
2704
|
+
const live = Object.freeze({
|
|
2705
|
+
binding: config.binding,
|
|
2706
|
+
target: config.target,
|
|
2707
|
+
peer_policy_revision: config.peer_policy_revision,
|
|
2708
|
+
contract: record,
|
|
2709
|
+
source: sourceFor,
|
|
2710
|
+
catalogSource(current, policies) {
|
|
2711
|
+
if (boundedJson2(current) !== boundedJson2(epoch.connection)) {
|
|
2712
|
+
throw new LuvusAdapterError2("remote_luvus_epoch_unavailable");
|
|
2713
|
+
}
|
|
2714
|
+
return nativeBinding(epoch, policies);
|
|
2715
|
+
},
|
|
2716
|
+
authority: createLuvusOperationsAuthority(record, sourceFor, (attempt) => config.raw_grant?.principal_id === attempt.principal_id && config.raw_grant.methods.includes(attempt.method)),
|
|
2717
|
+
ready() {
|
|
2718
|
+
try {
|
|
2719
|
+
assertEpoch(epoch);
|
|
2720
|
+
return !!epoch.record;
|
|
2721
|
+
} catch {
|
|
2722
|
+
return false;
|
|
2723
|
+
}
|
|
2724
|
+
}
|
|
2725
|
+
});
|
|
2726
|
+
assertEpoch(epoch);
|
|
2727
|
+
epoch.record = record;
|
|
2728
|
+
epoch.fingerprint = fingerprint;
|
|
2729
|
+
epoch.provider = live;
|
|
2730
|
+
return live;
|
|
2731
|
+
},
|
|
2732
|
+
close() {
|
|
2733
|
+
closeEpoch(epoch);
|
|
2734
|
+
}
|
|
2735
|
+
});
|
|
2736
|
+
}
|
|
2737
|
+
});
|
|
2738
|
+
return Object.freeze({
|
|
2739
|
+
provider,
|
|
2740
|
+
close() {
|
|
2741
|
+
closed = true;
|
|
2742
|
+
if (active) {
|
|
2743
|
+
closeEpoch(active);
|
|
2744
|
+
}
|
|
2745
|
+
}
|
|
2746
|
+
});
|
|
2747
|
+
}
|
|
2748
|
+
|
|
2461
2749
|
// src/runtime/production-luvus.ts
|
|
2462
2750
|
function references(input, mode) {
|
|
2463
2751
|
try {
|
|
@@ -2804,8 +3092,8 @@ function createLuvusProductionSources2() {
|
|
|
2804
3092
|
routes,
|
|
2805
3093
|
book,
|
|
2806
3094
|
source: {
|
|
2807
|
-
provider: (target) =>
|
|
2808
|
-
localProvider: (target) =>
|
|
3095
|
+
provider: (target) => isDeepStrictEqual3(target, fixed.target) ? provider.binding : undefined,
|
|
3096
|
+
localProvider: (target) => isDeepStrictEqual3(target, fixed.target) ? provider.binding : undefined,
|
|
2809
3097
|
contract: (ref) => ref === reference ? provider.contract : undefined,
|
|
2810
3098
|
nativeSource: (call, attempt) => {
|
|
2811
3099
|
const row = admitted.backend?.attempt(call, attempt);
|
|
@@ -2867,6 +3155,6 @@ function createLuvusProductionSources2() {
|
|
|
2867
3155
|
}
|
|
2868
3156
|
});
|
|
2869
3157
|
}
|
|
2870
|
-
export { createTrustedRequestScope2, composeGatewaySessions2, composeConnectorSessions2, createGatewayRuntime2, createProviderGatewayRuntime2, openGatewayState2, createLuvusConnectorSessions2, createConnectorRuntime2, ConnectorHostStartupError2, createProviderConnectorRuntime2, createManagementSessionAuthority2, createLuvusOperationsProvider2, attachExistingLuvus2, LuvusProductionStartupError2, createLuvusProductionSources2 };
|
|
3158
|
+
export { createTrustedRequestScope2, composeGatewaySessions2, composeConnectorSessions2, createGatewayRuntime2, createProviderGatewayRuntime2, openGatewayState2, createLuvusConnectorSessions2, createConnectorRuntime2, ConnectorHostStartupError2, createProviderConnectorRuntime2, createManagementSessionAuthority2, createLuvusOperationsProvider2, attachExistingLuvus2, checkedRemoteLuvusConfig, createPinnedRemoteLuvus, LuvusProductionStartupError2, createLuvusProductionSources2 };
|
|
2871
3159
|
|
|
2872
|
-
//# debugId=
|
|
3160
|
+
//# debugId=A165CD691DA8923B64756E2164756E21
|
|
@@ -11,27 +11,29 @@ import {
|
|
|
11
11
|
MessageWindow2
|
|
12
12
|
} from "./chunk-g7pnjzkk.js";
|
|
13
13
|
import {
|
|
14
|
-
LuvusAdapterError2,
|
|
15
|
-
ConnectorCapacityError,
|
|
16
14
|
assertTerminalExecutionAllowed
|
|
17
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-8fy8w7ds.js";
|
|
18
16
|
import {
|
|
19
17
|
HerdrLocalError,
|
|
20
18
|
readHerdrPeer
|
|
21
|
-
} from "./chunk-
|
|
19
|
+
} from "./chunk-e7jgpxkf.js";
|
|
22
20
|
import {
|
|
23
21
|
checkHerdrSignal,
|
|
24
22
|
herdrDeadline,
|
|
25
23
|
withHerdrSocket,
|
|
26
24
|
exchangeHerdr,
|
|
27
25
|
HerdrInstallation2
|
|
28
|
-
} from "./chunk-
|
|
26
|
+
} from "./chunk-41fny9qm.js";
|
|
29
27
|
import {
|
|
30
28
|
createHerdrReadonlyAdapter2
|
|
31
29
|
} from "./chunk-zb641qa3.js";
|
|
32
30
|
import {
|
|
33
31
|
LuvusDispatchClaims2
|
|
34
|
-
} from "./chunk-
|
|
32
|
+
} from "./chunk-sf4ztxba.js";
|
|
33
|
+
import {
|
|
34
|
+
LuvusAdapterError2,
|
|
35
|
+
ConnectorCapacityError
|
|
36
|
+
} from "./chunk-pksaqt9a.js";
|
|
35
37
|
|
|
36
38
|
// src/connector/herdr/wire.ts
|
|
37
39
|
function identityOf(binding) {
|
|
@@ -273,4 +275,4 @@ function createHerdrRuntime2(installation, backend, claims, terminalExecution) {
|
|
|
273
275
|
|
|
274
276
|
export { createHerdrWireAdapter, createHerdrRuntime2 };
|
|
275
277
|
|
|
276
|
-
//# debugId=
|
|
278
|
+
//# debugId=0A9E0EF4232D9B8364756E2164756E21
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
// @bun
|
|
2
2
|
// src/mcp/version.ts
|
|
3
3
|
var MCP_REVISION2 = "2025-11-25";
|
|
4
|
-
var PRODUCT_VERSION2 = "0.6.
|
|
4
|
+
var PRODUCT_VERSION2 = "0.6.1";
|
|
5
5
|
|
|
6
6
|
export { MCP_REVISION2, PRODUCT_VERSION2 };
|
|
7
7
|
|
|
8
|
-
//# debugId=
|
|
8
|
+
//# debugId=D4F5A83CF09C923064756E2164756E21
|