rovloom 0.5.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.
Files changed (64) hide show
  1. package/README.md +9 -1
  2. package/dist/src/admin/index.js +1 -1
  3. package/dist/src/{chunk-emcefrc1.js → chunk-0e9gg4sg.js} +3 -4
  4. package/dist/src/chunk-1xer1ent.js +102 -0
  5. package/dist/src/{chunk-863tk45b.js → chunk-41fny9qm.js} +5 -5
  6. package/dist/src/{chunk-zjzrcc59.js → chunk-59h200cr.js} +139 -7
  7. package/dist/src/chunk-5w5srj3b.js +93 -0
  8. package/dist/src/{chunk-d4ejrtjq.js → chunk-6n6b1xpy.js} +1 -1
  9. package/dist/src/{chunk-ympzv86c.js → chunk-6w4g9fw8.js} +16 -4
  10. package/dist/src/{chunk-smpevv7n.js → chunk-73aq2qkz.js} +9 -16
  11. package/dist/src/{chunk-0ake7e4r.js → chunk-8c9yc0ge.js} +9 -17
  12. package/dist/src/{chunk-57ayxqnb.js → chunk-8fy8w7ds.js} +2 -23
  13. package/dist/src/{chunk-64ftwe9b.js → chunk-8ykrqhxh.js} +8 -2
  14. package/dist/src/{chunk-2tn0r64b.js → chunk-9h9x79bx.js} +5 -5
  15. package/dist/src/{chunk-nyn75b8v.js → chunk-av31bx1e.js} +31 -2
  16. package/dist/src/{chunk-0xgpxdgc.js → chunk-bbdtsg4b.js} +7 -5
  17. package/dist/src/{chunk-q5pgbwb3.js → chunk-e7jgpxkf.js} +2 -2
  18. package/dist/src/{chunk-zj48jvfe.js → chunk-efty77sb.js} +3 -40
  19. package/dist/src/{chunk-abd4envz.js → chunk-enj7s8cv.js} +71 -78
  20. package/dist/src/{chunk-4etdq0cp.js → chunk-ftpy8xx3.js} +313 -28
  21. package/dist/src/{chunk-zdxww7ms.js → chunk-h3xyq7zk.js} +1 -1
  22. package/dist/src/{chunk-ttsrctxg.js → chunk-hxmq28pg.js} +9 -7
  23. package/dist/src/{chunk-r0nfthsf.js → chunk-j59ac0xs.js} +2 -2
  24. package/dist/src/{chunk-5s2emvww.js → chunk-j6svdqr8.js} +10 -302
  25. package/dist/src/{chunk-9y36gntb.js → chunk-jkzfck98.js} +10 -5
  26. package/dist/src/{chunk-sj24fpz3.js → chunk-m76cmkfy.js} +28 -30
  27. package/dist/src/{chunk-5n8csngz.js → chunk-m96mbzcw.js} +816 -305
  28. package/dist/src/{chunk-xhq21g24.js → chunk-m9c1pnv9.js} +3 -3
  29. package/dist/src/{chunk-fnakrk0a.js → chunk-n3z3jaxy.js} +39 -36
  30. package/dist/src/{chunk-e7x51y0t.js → chunk-ndj0ay2p.js} +19 -18
  31. package/dist/src/chunk-pgs9jp6t.js +320 -0
  32. package/dist/src/chunk-pksaqt9a.js +25 -0
  33. package/dist/src/{chunk-ebm3kvnq.js → chunk-pnep7yhj.js} +31 -100
  34. package/dist/src/chunk-qn5xae7g.js +66 -0
  35. package/dist/src/{chunk-0pewfj89.js → chunk-qp8tgms2.js} +1 -1
  36. package/dist/src/{chunk-7k9g0x5e.js → chunk-rmgw8h27.js} +10 -8
  37. package/dist/src/{chunk-gbsbwssz.js → chunk-sf4ztxba.js} +3 -3
  38. package/dist/src/{chunk-7q96e161.js → chunk-shez7hkc.js} +6 -12
  39. package/dist/src/chunk-sqz614bh.js +30 -0
  40. package/dist/src/{chunk-09f9q26d.js → chunk-vdwzb63d.js} +2 -2
  41. package/dist/src/chunk-xtvgm6kf.js +48 -0
  42. package/dist/src/chunk-y8zm75jt.js +157 -0
  43. package/dist/src/chunk-yasqw2vj.js +756 -0
  44. package/dist/src/{chunk-ybte82d3.js → chunk-z0qmfqvd.js} +4 -3
  45. package/dist/src/chunk-zm705snh.js +53 -0
  46. package/dist/src/cli/index.js +39 -30
  47. package/dist/src/cli/main.js +14 -9
  48. package/dist/src/connector/herdr/installation.js +4 -4
  49. package/dist/src/connector/herdr/provider.js +9 -9
  50. package/dist/src/connector/herdr/runtime.js +7 -7
  51. package/dist/src/connector/luvus/index.js +7 -6
  52. package/dist/src/mcp/index.js +16 -14
  53. package/dist/src/runtime/index.js +16 -15
  54. package/dist/src/service/index.js +3 -4
  55. package/dist/src/store.js +4 -4
  56. package/dist/src/transport/index.js +9 -9
  57. package/dist/src/webui/index.js +975 -834
  58. package/package.json +1 -1
  59. package/dist/src/chunk-5j0gj6w2.js +0 -7
  60. package/dist/src/chunk-9yg6x3gt.js +0 -24
  61. package/dist/src/chunk-erdq0rn8.js +0 -1300
  62. package/dist/src/chunk-n073xnr1.js +0 -1117
  63. package/dist/src/chunk-rwpynx2j.js +0 -51
  64. package/dist/src/chunk-vwcntax3.js +0 -228
@@ -6,12 +6,7 @@ import {
6
6
  object2,
7
7
  fields2,
8
8
  id2,
9
- sha2,
10
9
  boundedJson2,
11
- hash2,
12
- validateTarget2,
13
- validateProvider2,
14
- validateContractSource2,
15
10
  contractRef2,
16
11
  assertBinding2
17
12
  } from "./chunk-qt9m2kg2.js";
@@ -19,9 +14,6 @@ import {
19
14
  compileBundle2,
20
15
  createNativeValidator2
21
16
  } from "./chunk-mqyq5jh6.js";
22
- import {
23
- LuvusAdapterError2
24
- } from "./chunk-57ayxqnb.js";
25
17
  import {
26
18
  macosProcessState,
27
19
  macosProcessUid,
@@ -30,7 +22,7 @@ import {
30
22
  windowsInspectPath,
31
23
  windowsProcessFacts,
32
24
  windowsProcessState
33
- } from "./chunk-09f9q26d.js";
25
+ } from "./chunk-vdwzb63d.js";
34
26
  import {
35
27
  WINDOWS_PIPE,
36
28
  LUVUS_ENDPOINT_TRANSPORT,
@@ -50,27 +42,23 @@ import {
50
42
  readWindowsLuvusPeer2,
51
43
  readMacosLuvusPeer2,
52
44
  readLuvusPeer2
53
- } from "./chunk-0xgpxdgc.js";
54
- import {
55
- LUVUS_OPERATION_METHODS2,
56
- luvusOperationDescriptor2,
57
- luvusOperationValidation2,
58
- validateLuvusOperationParams2,
59
- createLuvusRequestPreflight
60
- } from "./chunk-zj48jvfe.js";
45
+ } from "./chunk-bbdtsg4b.js";
61
46
  import {
62
47
  LUVUS_CLAIMS_LOCK_FORMAT
63
- } from "./chunk-gbsbwssz.js";
48
+ } from "./chunk-sf4ztxba.js";
49
+ import {
50
+ LuvusAdapterError2
51
+ } from "./chunk-pksaqt9a.js";
64
52
  import {
65
53
  lockOwnerFields,
66
54
  recordedProcess,
67
55
  ownedFile,
68
56
  recoverStaleLock
69
- } from "./chunk-zdxww7ms.js";
57
+ } from "./chunk-h3xyq7zk.js";
70
58
  import {
71
59
  listening,
72
60
  ownerIsDead
73
- } from "./chunk-0pewfj89.js";
61
+ } from "./chunk-qp8tgms2.js";
74
62
  import {
75
63
  syncParentDirectory
76
64
  } from "./chunk-0y5542k8.js";
@@ -1345,286 +1333,6 @@ async function startManagedLuvus2(root) {
1345
1333
  }
1346
1334
  }
1347
1335
 
1348
- // src/runtime/luvus-operations-authority.ts
1349
- import { isDeepStrictEqual as isDeepStrictEqual4 } from "util";
1350
- function assertLuvusOperationsContract(contract) {
1351
- const source = contract.wire.source;
1352
- const capabilities = object2(object2(contract.capabilities).result);
1353
- 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)) {
1354
- throw new LuvusAdapterError2("luvus_operations_source_mismatch");
1355
- }
1356
- }
1357
- function createLuvusOperationsAuthority(contract, current, rawAllowed) {
1358
- assertLuvusOperationsContract(contract);
1359
- const methods = object2(object2(contract.capabilities).result).method_contracts;
1360
- return (attempt, native) => {
1361
- const proven = current(attempt.binding);
1362
- const descriptor = luvusOperationDescriptor2(attempt.method);
1363
- if (proven.authenticated !== true || proven.source_verified !== true || !descriptor || attempt.native_request.method !== attempt.method || attempt.mode !== luvusOperationValidation2(attempt.method) || !isDeepStrictEqual4(proven.binding, native)) {
1364
- throw new LuvusAdapterError2("luvus_operation_unreviewed");
1365
- }
1366
- const live = methods.filter((row) => row.method === attempt.method);
1367
- if (live.length !== 1 || !isDeepStrictEqual4({
1368
- method: live[0].method,
1369
- access: live[0].access,
1370
- scope: live[0].scope,
1371
- idempotent: live[0].idempotent
1372
- }, descriptor.native)) {
1373
- throw new LuvusAdapterError2("luvus_operations_contract_mismatch");
1374
- }
1375
- validateLuvusOperationParams2(attempt.method, attempt.native_request.params);
1376
- const raw = attempt.mode === "raw-contract";
1377
- const allowed = raw && rawAllowed(attempt) === true;
1378
- return {
1379
- owner: allowed,
1380
- raw_requested: raw,
1381
- ...allowed ? {
1382
- raw_grant: {
1383
- id: attempt.binding.call_id,
1384
- source_verified: true,
1385
- principal_id: attempt.principal_id,
1386
- binding: native,
1387
- methods: [attempt.method],
1388
- expires_at: attempt.binding.registration.deadline
1389
- }
1390
- } : {}
1391
- };
1392
- };
1393
- }
1394
-
1395
- // src/runtime/remote-luvus.ts
1396
- function checkedRemoteLuvusConfig(reference, input) {
1397
- const config = object2(JSON.parse(boundedJson2(input)));
1398
- fields2(config, ["kind", "authentication", "binding", "target", "contract", "peer_policy_revision"], ["raw_grant"]);
1399
- validateProvider2(config.binding);
1400
- validateTarget2(config.target);
1401
- id2(config.peer_policy_revision);
1402
- const pin = object2(config.contract);
1403
- fields2(pin, [
1404
- "binary_version",
1405
- "binary_sha256",
1406
- "schema_sha256",
1407
- "adapter_revision",
1408
- "classification_revision",
1409
- "schema_bundle"
1410
- ]);
1411
- sha2(pin.binary_sha256);
1412
- sha2(pin.schema_sha256);
1413
- 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) {
1414
- throw new LuvusAdapterError2("remote_luvus_pin_invalid");
1415
- }
1416
- if (config.raw_grant !== undefined) {
1417
- const grant = object2(config.raw_grant);
1418
- fields2(grant, ["principal_id", "methods"]);
1419
- id2(grant.principal_id);
1420
- 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))) {
1421
- throw new LuvusAdapterError2("remote_luvus_raw_grant_invalid");
1422
- }
1423
- Object.freeze(grant.methods);
1424
- Object.freeze(grant);
1425
- }
1426
- Object.freeze(config.binding);
1427
- Object.freeze(config.target);
1428
- Object.freeze(pin);
1429
- return Object.freeze(config);
1430
- }
1431
- async function createPinnedRemoteLuvus(config) {
1432
- const pin = config.contract;
1433
- const compiled = await compileBundle2(Buffer.from(pin.schema_bundle), {
1434
- identity: { binary_sha256: pin.binary_sha256, schema_sha256: pin.schema_sha256, revision: pin.adapter_revision }
1435
- });
1436
- if (!compiled.ok) {
1437
- throw new LuvusAdapterError2(compiled.error.code);
1438
- }
1439
- const contractHandle = compiled.value;
1440
- const target = config.target;
1441
- if (target.profile !== "session") {
1442
- throw new LuvusAdapterError2("remote_luvus_pin_invalid");
1443
- }
1444
- const validator = createNativeValidator2(contractHandle);
1445
- let closed = false;
1446
- let active;
1447
- function assertEpoch(epoch) {
1448
- if (closed || epoch.closed || active !== epoch) {
1449
- throw new LuvusAdapterError2("remote_luvus_epoch_unavailable");
1450
- }
1451
- const checked = epoch.assertCurrent();
1452
- if (checked !== undefined) {
1453
- Promise.resolve(checked).catch(() => {});
1454
- throw new LuvusAdapterError2("synchronous_remote_source_required");
1455
- }
1456
- if (closed || epoch.closed || active !== epoch) {
1457
- throw new LuvusAdapterError2("remote_luvus_epoch_unavailable");
1458
- }
1459
- }
1460
- function closeEpoch(epoch) {
1461
- epoch.closed = true;
1462
- epoch.record = undefined;
1463
- epoch.provider = undefined;
1464
- if (active === epoch) {
1465
- active = undefined;
1466
- }
1467
- }
1468
- function nativeBinding(epoch, policies) {
1469
- assertEpoch(epoch);
1470
- const record = epoch.record;
1471
- if (!record) {
1472
- throw new LuvusAdapterError2("remote_luvus_snapshot_required");
1473
- }
1474
- id2(policies.caller_policy_revision);
1475
- id2(policies.local_policy_revision);
1476
- const target = config.target;
1477
- if (target.profile !== "session") {
1478
- throw new LuvusAdapterError2("remote_luvus_pin_invalid");
1479
- }
1480
- const binding = Object.freeze({
1481
- kind: "luvus",
1482
- provider_id: target.provider_id,
1483
- binding_revision: config.binding.binding_revision,
1484
- contract_source_ref: contractRef2(record.wire.source),
1485
- target: Object.freeze({ machine_id: target.machine_id, profile: "session", session: target.session }),
1486
- server_generation: record.wire.source.runtime_generation,
1487
- connection_epoch: epoch.connection.connection_epoch,
1488
- recovery_generation: epoch.connection.recovery_generation,
1489
- capability_revision: record.capability_revision,
1490
- caller_policy_revision: policies.caller_policy_revision,
1491
- local_policy_revision: policies.local_policy_revision,
1492
- classification_revision: pin.classification_revision,
1493
- contract: contractHandle.identity
1494
- });
1495
- assertEpoch(epoch);
1496
- return Object.freeze({ binding, authenticated: true, source_verified: true });
1497
- }
1498
- function ready() {
1499
- try {
1500
- if (!active?.record) {
1501
- return false;
1502
- }
1503
- assertEpoch(active);
1504
- return true;
1505
- } catch {
1506
- return false;
1507
- }
1508
- }
1509
- const provider = Object.freeze({
1510
- remote_luvus: true,
1511
- binding: config.binding,
1512
- target: config.target,
1513
- peer_policy_revision: config.peer_policy_revision,
1514
- preflightRequest: createLuvusRequestPreflight(contractHandle),
1515
- ready,
1516
- open(connection, assertCurrent) {
1517
- if (closed || active || !connection.authenticated || !connection.active || connection.machine_id !== config.target.machine_id || !connection.negotiated.capabilities.includes("provider_snapshot")) {
1518
- throw new LuvusAdapterError2("remote_luvus_epoch_unavailable");
1519
- }
1520
- const epoch = { connection: structuredClone(connection), assertCurrent, closed: false };
1521
- active = epoch;
1522
- try {
1523
- assertEpoch(epoch);
1524
- } catch (error) {
1525
- closeEpoch(epoch);
1526
- throw error;
1527
- }
1528
- return Object.freeze({
1529
- accept(input) {
1530
- assertEpoch(epoch);
1531
- const copied = parseNativeJson2(boundedJson2(input));
1532
- if (!copied.ok) {
1533
- throw new LuvusAdapterError2(copied.error.code);
1534
- }
1535
- const snapshot = copied.value;
1536
- fields2(object2(snapshot), ["binding", "target", "source", "capabilities", "capability_revision"]);
1537
- validateProvider2(snapshot.binding);
1538
- validateTarget2(snapshot.target);
1539
- validateContractSource2(snapshot.source);
1540
- sha2(snapshot.capability_revision);
1541
- if (boundedJson2(snapshot.binding) !== boundedJson2(config.binding) || boundedJson2(snapshot.target) !== boundedJson2(config.target)) {
1542
- throw new LuvusAdapterError2("remote_luvus_binding_mismatch");
1543
- }
1544
- const source = snapshot.source;
1545
- 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) {
1546
- throw new LuvusAdapterError2("remote_luvus_contract_mismatch");
1547
- }
1548
- const capabilities = object2(snapshot.capabilities);
1549
- const value = object2(capabilities.result);
1550
- if (hash2(boundedJson2(value)) !== snapshot.capability_revision) {
1551
- throw new LuvusAdapterError2("remote_luvus_capability_mismatch");
1552
- }
1553
- const shape = validator.checkCapabilitiesShape(capabilities, {
1554
- target: { machine_id: target.machine_id, profile: "session", session: target.session },
1555
- server_generation: source.runtime_generation
1556
- });
1557
- if (!shape.ok) {
1558
- throw new LuvusAdapterError2(shape.error.code);
1559
- }
1560
- const record = Object.freeze({
1561
- wire: Object.freeze({ source: Object.freeze(source), support_status: "validated" }),
1562
- compiled: contractHandle,
1563
- capabilities,
1564
- capability_revision: snapshot.capability_revision
1565
- });
1566
- assertLuvusOperationsContract(record);
1567
- const fingerprint = hash2(boundedJson2(snapshot));
1568
- if (epoch.fingerprint !== undefined) {
1569
- if (epoch.fingerprint !== fingerprint) {
1570
- throw new LuvusAdapterError2("remote_luvus_snapshot_changed");
1571
- }
1572
- assertEpoch(epoch);
1573
- return epoch.provider;
1574
- }
1575
- function sourceFor(binding) {
1576
- assertEpoch(epoch);
1577
- assertBinding2(binding, binding);
1578
- 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)) {
1579
- throw new LuvusAdapterError2("remote_luvus_binding_mismatch");
1580
- }
1581
- return nativeBinding(epoch, binding.registration);
1582
- }
1583
- const live = Object.freeze({
1584
- binding: config.binding,
1585
- target: config.target,
1586
- peer_policy_revision: config.peer_policy_revision,
1587
- contract: record,
1588
- source: sourceFor,
1589
- catalogSource(current, policies) {
1590
- if (boundedJson2(current) !== boundedJson2(epoch.connection)) {
1591
- throw new LuvusAdapterError2("remote_luvus_epoch_unavailable");
1592
- }
1593
- return nativeBinding(epoch, policies);
1594
- },
1595
- authority: createLuvusOperationsAuthority(record, sourceFor, (attempt) => config.raw_grant?.principal_id === attempt.principal_id && config.raw_grant.methods.includes(attempt.method)),
1596
- ready() {
1597
- try {
1598
- assertEpoch(epoch);
1599
- return !!epoch.record;
1600
- } catch {
1601
- return false;
1602
- }
1603
- }
1604
- });
1605
- assertEpoch(epoch);
1606
- epoch.record = record;
1607
- epoch.fingerprint = fingerprint;
1608
- epoch.provider = live;
1609
- return live;
1610
- },
1611
- close() {
1612
- closeEpoch(epoch);
1613
- }
1614
- });
1615
- }
1616
- });
1617
- return Object.freeze({
1618
- provider,
1619
- close() {
1620
- closed = true;
1621
- if (active) {
1622
- closeEpoch(active);
1623
- }
1624
- }
1625
- });
1626
- }
1627
-
1628
- export { OwnedProcessShutdownError, observeLuvusProcess, nativeRecordStamp, readNativeRecord, createNativeRecord, removeNativeRecord, recoverLuvusClaimsLock, recoverLuvusOwnerLock, assertManagedControlDirectory, initializeManagedLuvusRoot2, openManagedLuvusRoot2, assertManagedRoot, NativeInstanceContext, discoverLuvusInstallation, MANAGED_LUVUS_REVISION2, MANAGED_LUVUS_CLASSIFICATION2, registerLocalOwnerLuvus, assertLocalOwnerLuvus, observedLuvusContract, startManagedLuvus2, assertLuvusOperationsContract, createLuvusOperationsAuthority, checkedRemoteLuvusConfig, createPinnedRemoteLuvus };
1336
+ export { OwnedProcessShutdownError, observeLuvusProcess, nativeRecordStamp, readNativeRecord, createNativeRecord, removeNativeRecord, recoverLuvusClaimsLock, recoverLuvusOwnerLock, assertManagedControlDirectory, initializeManagedLuvusRoot2, openManagedLuvusRoot2, assertManagedRoot, NativeInstanceContext, discoverLuvusInstallation, MANAGED_LUVUS_REVISION2, MANAGED_LUVUS_CLASSIFICATION2, registerLocalOwnerLuvus, assertLocalOwnerLuvus, observedLuvusContract, startManagedLuvus2 };
1629
1337
 
1630
- //# debugId=38EA45B552DA108E64756E2164756E21
1338
+ //# debugId=23AB0591A85323DB64756E2164756E21
@@ -3,6 +3,9 @@ import {
3
3
  canonical2,
4
4
  digest2
5
5
  } from "./chunk-d71r315c.js";
6
+ import {
7
+ cliMessages2
8
+ } from "./chunk-pgs9jp6t.js";
6
9
  import {
7
10
  MAX_MCP_BYTES2,
8
11
  TOOLS_PAGE_SIZE,
@@ -13,13 +16,13 @@ import {
13
16
  SERVICE_ERROR_CODES,
14
17
  FacadeServiceError2,
15
18
  NativeRequestNotDispatchedError
16
- } from "./chunk-smpevv7n.js";
19
+ } from "./chunk-73aq2qkz.js";
17
20
  import {
18
21
  parseNativeJson2
19
22
  } from "./chunk-7crhmqn2.js";
20
23
  import {
21
24
  PRODUCT_VERSION2
22
- } from "./chunk-r0nfthsf.js";
25
+ } from "./chunk-j59ac0xs.js";
23
26
  import {
24
27
  canonicalLoopbackHost
25
28
  } from "./chunk-6n9s7nfe.js";
@@ -109,9 +112,10 @@ function toolOffset(cursor) {
109
112
  return offset;
110
113
  }
111
114
  function createMcpFacade2(options) {
115
+ const language = options.language ?? "en";
112
116
  const server = new Server({ name: "rovloom", version: PRODUCT_VERSION2 }, {
113
117
  capabilities: { tools: {} },
114
- instructions: "\u5DE5\u5177\u5B58\u5728\u4E0D\u8868\u793A\u540E\u7AEF\u53EF\u7528\uFF1B\u6267\u884C\u3001\u6388\u6743\u3001\u786E\u8BA4\u3001\u53BB\u91CD\u4E0E\u7ED3\u679C\u4FDD\u7559\u7531\u53D7\u4FE1\u670D\u52A1\u8D1F\u8D23\u3002"
118
+ instructions: cliMessages2(language)["mcp.instructions"]
115
119
  });
116
120
  let initialized = false;
117
121
  let inflight = 0;
@@ -140,7 +144,7 @@ function createMcpFacade2(options) {
140
144
  const names = toolNames2();
141
145
  const next = offset + TOOLS_PAGE_SIZE;
142
146
  return {
143
- tools: names.slice(offset, next).map(toolDefinition2),
147
+ tools: names.slice(offset, next).map((name) => toolDefinition2(name, language)),
144
148
  ...next < names.length ? { nextCursor: Buffer.from(`rovloom-tools-v1:${next}`).toString("base64url") } : {}
145
149
  };
146
150
  });
@@ -504,6 +508,7 @@ function createHttpFacade2(options) {
504
508
  const server = createMcpFacade2({
505
509
  service: options.service,
506
510
  diagnostic: options.diagnostic,
511
+ ...options.language ? { language: options.language } : {},
507
512
  context: {
508
513
  resolve: (signal) => {
509
514
  const context = scope.getStore();
@@ -764,4 +769,4 @@ function startHttpFacade2(options) {
764
769
 
765
770
  export { createMcpFacade2, HTTP_BODY_BYTES2, createHttpFacade2, startHttpFacade2 };
766
771
 
767
- //# debugId=7CD2FDC41059ADFA64756E2164756E21
772
+ //# debugId=69C1DCB6911C499664756E2164756E21
@@ -7,8 +7,10 @@ import {
7
7
  import"./chunk-9tt13dm0.js";
8
8
  import"./chunk-g7pnjzkk.js";
9
9
  import {
10
- setupFileStamp,
11
- writeSetupFile,
10
+ cliMessages2,
11
+ formatMessage2
12
+ } from "./chunk-pgs9jp6t.js";
13
+ import {
12
14
  REGISTRY_MAX_BYTES,
13
15
  parseRegistry,
14
16
  createCaller,
@@ -18,7 +20,11 @@ import {
18
20
  revokeCaller,
19
21
  summarize,
20
22
  isAdminPlaceholder
21
- } from "./chunk-ebm3kvnq.js";
23
+ } from "./chunk-pnep7yhj.js";
24
+ import {
25
+ setupFileStamp,
26
+ writeSetupFile
27
+ } from "./chunk-1xer1ent.js";
22
28
  import {
23
29
  resolveRoleConfigPath2
24
30
  } from "./chunk-1bf0wmgk.js";
@@ -35,21 +41,6 @@ import"./chunk-3nnahj0j.js";
35
41
  import"./chunk-0y5542k8.js";
36
42
 
37
43
  // src/cli/token-command.ts
38
- var TOKEN_HELP = `\u7528\u6CD5\uFF1A
39
- rovloom token list [--config /absolute/path/gateway.json]
40
- rovloom token create --principal ID --like EXISTING_ID [--ttl-days N]
41
- rovloom token renew --principal ID [--ttl-days N]
42
- rovloom token rotate --principal ID [--ttl-days N] [--grace-minutes M]
43
- rovloom token revoke --principal ID
44
- rovloom token permissions --principal ID --discard-response true|false
45
-
46
- \u4EE4\u724C\u6CE8\u518C\u8868\u4F4D\u4E8E Gateway \u72B6\u6001\u76EE\u5F55\uFF1BGateway \u6BCF\u6B21\u8BA4\u8BC1\u91CD\u8BFB\uFF0C\u4FEE\u6539\u7ACB\u5373\u751F\u6548\u3001\u65E0\u9700\u91CD\u542F\u3002
47
- create/rotate \u628A\u65B0\u4EE4\u724C\u539F\u503C\u53EA\u5199\u5230 stdout \u4E00\u6B21\uFF08\u6CE8\u518C\u8868\u53EA\u4FDD\u5B58 SHA-256 \u6458\u8981\uFF09\uFF1B\u5176\u4F59\u4FE1\u606F\u5199\u5230 stderr\u3002
48
- create \u7684\u65B0\u4E3B\u4F53\u6743\u9650\u514B\u9686\u81EA --like \u6307\u5B9A\u7684\u73B0\u6709\u4E3B\u4F53\uFF0C\u4E0D\u6269\u5927\u6743\u9650\u3002renew \u5EF6\u957F\u5230\u671F\u65F6\u95F4\u3001\u4EE4\u724C\u4E0D\u53D8\u3002
49
- rotate \u7B7E\u53D1\u65B0\u4EE4\u724C\uFF1B--grace-minutes \u5185\u65E7\u4EE4\u724C\u7EE7\u7EED\u6709\u6548\uFF08\u9ED8\u8BA4 0\uFF0C\u7ACB\u5373\u5931\u6548\uFF09\u3002revoke \u5220\u9664\u4E3B\u4F53\u3002
50
- permissions \u663E\u5F0F\u7BA1\u7406\u7ED3\u679C\u5220\u9664\u6743\u9650\uFF0C\u70ED\u751F\u6548\uFF1B\u9ED8\u8BA4\u5173\u95ED\u3002\u5220\u9664\u7ED3\u679C\u524D\u5E94\u5148\u8BFB\u53D6\u5E76\u4FDD\u5B58\u6240\u9700\u5185\u5BB9\u3002
51
- ttl \u9ED8\u8BA4 30 \u5929\uFF081-365\uFF09\u3002
52
- `;
53
44
  function parse(args) {
54
45
  const sub = args[1];
55
46
  if (!sub || !["list", "create", "renew", "rotate", "revoke", "permissions"].includes(sub)) {
@@ -129,7 +120,7 @@ function syncClientFile(stateDir, principal, token, issued, expires) {
129
120
  async function handleTokenCommand(args, io, environment, now = Date.now) {
130
121
  try {
131
122
  if (args.length === 2 && args[1] === "--help") {
132
- io.stderr.write(TOKEN_HELP);
123
+ io.stderr.write(cliMessages2(io.language)["help.token"]);
133
124
  return 0;
134
125
  }
135
126
  const flags = parse(args);
@@ -154,31 +145,38 @@ async function handleTokenCommand(args, io, environment, now = Date.now) {
154
145
  if (flags.sub === "create") {
155
146
  const made = createCaller(registry, flags.principal, flags.like, at, flags.days);
156
147
  next = made.registry;
157
- io.stderr.write("created " + flags.principal + " expires " + new Date(made.expires_at).toISOString() + `
158
- `);
148
+ io.stderr.write(formatMessage2(cliMessages2(io.language)["token.created"], {
149
+ principal: flags.principal,
150
+ expires: new Date(made.expires_at).toISOString()
151
+ }));
159
152
  io.stdout.write(made.token + `
160
153
  `);
161
154
  } else if (flags.sub === "renew") {
162
155
  const renewed = renewCaller(registry, flags.principal, at, flags.days);
163
156
  next = renewed.registry;
164
- io.stderr.write("renewed " + flags.principal + " expires " + new Date(renewed.expires_at).toISOString() + `
165
- `);
157
+ io.stderr.write(formatMessage2(cliMessages2(io.language)["token.renewed"], {
158
+ principal: flags.principal,
159
+ expires: new Date(renewed.expires_at).toISOString()
160
+ }));
166
161
  } else if (flags.sub === "rotate") {
167
162
  const rotated = rotateCaller(registry, flags.principal, at, { days: flags.days, graceMinutes: flags.grace });
168
163
  next = rotated.registry;
169
- io.stderr.write("rotated " + flags.principal + " expires " + new Date(rotated.expires_at).toISOString() + `
170
- `);
164
+ io.stderr.write(formatMessage2(cliMessages2(io.language)["token.rotated"], {
165
+ principal: flags.principal,
166
+ expires: new Date(rotated.expires_at).toISOString()
167
+ }));
171
168
  issued = rotated.token;
172
169
  io.stdout.write(rotated.token + `
173
170
  `);
174
171
  } else if (flags.sub === "permissions") {
175
172
  next = setDiscardPermission(registry, flags.principal, flags.discard);
176
- io.stderr.write("permissions " + flags.principal + " discard_response=" + String(flags.discard) + `
177
- `);
173
+ io.stderr.write(formatMessage2(cliMessages2(io.language)["token.permissions"], {
174
+ principal: flags.principal,
175
+ discard: String(flags.discard)
176
+ }));
178
177
  } else {
179
178
  next = revokeCaller(registry, flags.principal);
180
- io.stderr.write("revoked " + flags.principal + `
181
- `);
179
+ io.stderr.write(formatMessage2(cliMessages2(io.language)["token.revoked"], { principal: flags.principal }));
182
180
  }
183
181
  writeSetupFile(path, boundedJson2(next, REGISTRY_MAX_BYTES), true, stamp);
184
182
  if (flags.sub === "renew" || flags.sub === "rotate") {
@@ -201,4 +199,4 @@ export {
201
199
  handleTokenCommand
202
200
  };
203
201
 
204
- //# debugId=FA979FCCD381000964756E2164756E21
202
+ //# debugId=4D3B6508C39A168F64756E2164756E21