@roamcode.ai/server 1.4.5 → 2.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.ts CHANGED
@@ -1,7 +1,6 @@
1
1
  import * as better_sqlite3 from 'better-sqlite3';
2
- import { FastifyInstance } from 'fastify';
3
- import WebSocket from 'ws';
4
2
  import { z, ZodType } from 'zod';
3
+ import { FastifyInstance } from 'fastify';
5
4
  import { spawn, ChildProcess, SpawnOptions } from 'node:child_process';
6
5
  import { EventEmitter } from 'node:events';
7
6
 
@@ -692,121 +691,31 @@ declare function resolveAccessToken(opts: ResolveAccessTokenOptions): {
692
691
 
693
692
  /** A pairing link is deliberately short-lived and can be claimed exactly once. */
694
693
  declare const PAIRING_TTL_MS: number;
695
- type DeviceScope = "direct" | "relay";
694
+ type DeviceScope = "direct";
696
695
  interface DeviceInfo {
697
696
  id: string;
698
697
  name: string;
699
698
  createdAt: number;
700
699
  lastSeenAt: number;
701
700
  scopes: DeviceScope[];
702
- /** Pinned E2E relay signing identity. Public material only; the private key never leaves the device. */
703
- relayIdentityFingerprint?: string;
704
- }
705
- interface DeviceRelayIdentity {
706
- publicKey: string;
707
- fingerprint: string;
708
- }
709
- declare class DevicePairingError extends Error {
710
- readonly code: "INVALID_RELAY_IDENTITY";
711
- constructor(code: "INVALID_RELAY_IDENTITY", message: string);
712
701
  }
713
702
  interface PairingTicket {
714
703
  /** One-time capability carried by the pairing URL. Never persisted in plaintext. */
715
704
  secret: string;
716
705
  expiresAt: number;
717
- /** Exact product surfaces the resulting device credential can reach. */
718
706
  scopes: DeviceScope[];
719
707
  }
720
- /**
721
- * Relay bootstrap pre-allocates both durable ids. The token is still inert until the one-use pairing
722
- * capability is claimed, but carrying it in the URL fragment makes a dropped final response recoverable:
723
- * the browser can reconnect with the same credential after the host committed the claim.
724
- */
725
- interface RelayPairingTicket extends PairingTicket {
726
- deviceId: string;
727
- token: string;
728
- }
729
- interface RelayPairingCancellationReservation {
730
- deviceId: string;
731
- reservationId: string;
732
- }
733
- type RelayPairingCancellationStart = {
734
- status: "reserved";
735
- reservation: RelayPairingCancellationReservation;
736
- } | {
737
- status: "busy";
738
- } | {
739
- status: "missing";
740
- };
741
708
  interface DeviceEnrollment {
742
709
  /** The per-device bearer credential. Returned once; only its SHA-256 digest is persisted. */
743
710
  token: string;
744
711
  device: DeviceInfo;
745
712
  }
746
- type CloudDeviceEnrollmentState = "prepared" | "local-finalized" | "cloud-report-pending" | "complete" | "revoked";
747
- interface CloudDeviceEnrollmentPrepareInput {
748
- enrollmentId: string;
749
- deviceId: string;
750
- challenge: string;
751
- name: string;
752
- token: string;
753
- relayIdentityPublicKey: string;
754
- durableRelayCredentialHash: string;
755
- }
756
- interface CloudDeviceEnrollmentProgress {
757
- enrollmentId: string;
758
- deviceId: string;
759
- state: CloudDeviceEnrollmentState;
760
- durableRelayCredentialHash: string;
761
- temporaryRelayCredentialHash?: string;
762
- controlPlaneDeviceId?: string;
763
- device?: DeviceInfo;
764
- }
765
- interface PendingCloudDevicePromotion {
766
- enrollmentId: string;
767
- deviceId: string;
768
- expectedCredentialHash: string;
769
- credentialHash: string;
770
- controlPlaneDeviceId: string;
771
- brokerPromoted: boolean;
772
- }
773
- declare class CloudDeviceEnrollmentConflictError extends Error {
774
- constructor();
775
- }
776
713
  interface DeviceStore {
777
714
  readonly mode: "sqlite" | "memory-fallback";
778
- issuePairing(now?: number, scopes?: DeviceScope[]): PairingTicket;
715
+ issuePairing(now?: number): PairingTicket;
779
716
  cancelPairing(secret: string): boolean;
780
- claimPairing(secret: string, name: string, now?: number, relayIdentityPublicKey?: string): DeviceEnrollment | undefined;
781
- issueRelayPairing(now?: number): RelayPairingTicket;
782
- pendingRelayPairing(deviceId: string, now?: number): boolean;
783
- /** Atomically prevents a relay claim from winning while broker revocation is in flight. */
784
- beginRelayPairingCancellation(deviceId: string, now?: number): RelayPairingCancellationStart;
785
- /** Release a failed broker-revocation attempt so the same expiry-bounded link can be retried. */
786
- releaseRelayPairingCancellation(reservation: RelayPairingCancellationReservation): boolean;
787
- /** Delete the local bootstrap only after broker revocation is authoritative. */
788
- finishRelayPairingCancellation(reservation: RelayPairingCancellationReservation): boolean;
789
- cancelRelayPairing(deviceId: string): boolean;
790
- claimRelayPairing(secret: string, token: string, name: string, relayIdentityPublicKey: string, now?: number): DeviceEnrollment | undefined;
791
- /** Resolve a per-device bearer credential and best-effort touch its last-seen time. */
717
+ claimPairing(secret: string, name: string, now?: number): DeviceEnrollment | undefined;
792
718
  authenticate(token: string, now?: number, requiredScope?: DeviceScope): DeviceInfo | undefined;
793
- relayIdentity(id: string): DeviceRelayIdentity | undefined;
794
- /** Persist only digests before contacting the control plane; exact replays resume the same saga. */
795
- beginCloudDeviceEnrollment(input: CloudDeviceEnrollmentPrepareInput, now?: number): CloudDeviceEnrollmentProgress;
796
- /** Atomically inserts the canonical relay actor and advances the saga after control-plane confirmation. */
797
- finalizeCloudDeviceEnrollment(enrollmentId: string, temporaryRelayCredentialHash: string, controlPlaneDeviceId: string, now?: number): CloudDeviceEnrollmentProgress;
798
- /** Persist the successful broker CAS before the control-plane completion report is attempted. */
799
- markCloudDeviceEnrollmentPromoted(enrollmentId: string, expectedCredentialHash: string, credentialHash: string, now?: number): CloudDeviceEnrollmentProgress;
800
- /** Marks activation durable only after the broker CAS and control-plane report both commit. */
801
- completeCloudDeviceEnrollment(enrollmentId: string, expectedCredentialHash: string, credentialHash: string, now?: number): CloudDeviceEnrollmentProgress;
802
- /** Tombstone a control-plane-revoked enrollment and remove its still-inert local actor. */
803
- revokeCloudDeviceEnrollment(enrollmentId: string, controlPlaneDeviceId: string, expectedCredentialHash: string, credentialHash: string, now?: number): CloudDeviceEnrollmentProgress;
804
- /** Pending local actors must not normal-auth until broker promotion and a fresh cloud grant both commit. */
805
- cloudDeviceEnrollmentPending(deviceId: string): boolean;
806
- /** Return a bounded, oldest-attempted-first recovery page without materializing the full queue. */
807
- pendingCloudDevicePromotions(now?: number, limit?: number): PendingCloudDevicePromotion[];
808
- /** Move an exact still-pending promotion behind other queued work after a failed recovery attempt. */
809
- deferCloudDevicePromotion(enrollmentId: string, expectedCredentialHash: string, credentialHash: string, now?: number): boolean;
810
719
  list(): DeviceInfo[];
811
720
  rename(id: string, name: string): DeviceInfo | undefined;
812
721
  revoke(id: string): boolean;
@@ -814,21 +723,19 @@ interface DeviceStore {
814
723
  close(): void;
815
724
  }
816
725
  interface OpenDeviceStoreOptions {
817
- /** SQLite file path. ":memory:" uses an in-process DB. */
818
726
  dbPath: string;
819
727
  generateSecret?: () => string;
820
728
  generateToken?: () => string;
821
729
  generateId?: () => string;
822
- /** Test/portable hook; a loader failure selects the bounded in-memory fallback. */
823
730
  loadDatabase?: () => typeof better_sqlite3;
824
731
  }
825
- declare function normalizeDeviceScopes(value: unknown): DeviceScope[] | undefined;
826
732
  /** Keep device labels useful in UI while refusing control characters and unbounded payloads. */
827
733
  declare function normalizeDeviceName(value: unknown): string | undefined;
734
+ declare function normalizeDeviceScopes(value: unknown): DeviceScope[] | undefined;
828
735
  declare function openDeviceStore(opts: OpenDeviceStoreOptions): DeviceStore;
829
736
 
830
737
  declare const INPUT_LEASE_TTL_MS = 30000;
831
- type InputLeaseActorType = "device" | "host" | "local" | "relay";
738
+ type InputLeaseActorType = "device" | "host" | "local";
832
739
  interface InputLeasePrincipal {
833
740
  actorType: InputLeaseActorType;
834
741
  actorId: string;
@@ -916,7 +823,7 @@ type TeamMemberKind = "person" | "service";
916
823
  type TeamMemberStatus = "active" | "suspended" | "removed";
917
824
  type TeamRole = "viewer" | "operator" | "node-admin" | "workspace-manager" | "extension-manager" | "policy-admin" | "organization-admin";
918
825
  type TeamScopeType = "team" | "host" | "workspace";
919
- type TeamPrincipalType = "device" | "host" | "local" | "relay";
826
+ type TeamPrincipalType = "device" | "host" | "local";
920
827
  type TeamPermission = "team:read" | "sessions:read" | "sessions:operate" | "attention:read" | "attention:manage" | "presence:read" | "presence:write" | "workspaces:manage" | "extensions:manage" | "policy:manage" | "members:manage" | "node-access:manage" | "audit:read" | "fleet:read";
921
828
  interface TeamRecord {
922
829
  id: string;
@@ -1098,1927 +1005,14 @@ declare class PresenceCoordinator {
1098
1005
  private emit;
1099
1006
  }
1100
1007
 
1101
- declare const RELAY_PROTOCOL_VERSION: 1;
1102
- declare const RELAY_HANDSHAKE_MAX_SKEW_MS: number;
1103
- declare const RELAY_CHANNEL_MAX_AGE_MS: number;
1104
- declare const RELAY_CHANNEL_MAX_FRAMES = 1000000;
1105
- declare const RELAY_MAX_PLAINTEXT_BYTES: number;
1106
- type RelayRole = "device" | "host";
1107
- type RelayDirection = "device-to-host" | "host-to-device";
1108
- type RelayFrameKind = "auth" | "rpc-request" | "rpc-response" | "stream-open" | "stream-data" | "stream-control" | "close";
1109
- type RelayCryptoErrorCode = "INVALID_RELAY_IDENTITY" | "INVALID_RELAY_HELLO" | "RELAY_IDENTITY_MISMATCH" | "RELAY_SIGNATURE_INVALID" | "RELAY_HANDSHAKE_EXPIRED" | "RELAY_HANDSHAKE_MISMATCH" | "RELAY_FRAME_INVALID" | "RELAY_FRAME_OUT_OF_ORDER" | "RELAY_FRAME_AUTH_FAILED" | "RELAY_FRAME_TOO_LARGE" | "RELAY_KEY_ROTATION_REQUIRED" | "RELAY_CHANNEL_CLOSED";
1110
- declare class RelayCryptoError extends Error {
1111
- readonly code: RelayCryptoErrorCode;
1112
- constructor(code: RelayCryptoErrorCode, message: string);
1113
- }
1114
- interface RelayIdentity {
1115
- /** Base64url-encoded SPKI DER public key. Safe to pin and exchange. */
1116
- publicKey: string;
1117
- /** Base64url-encoded PKCS#8 DER private key. Host persistence must use mode 0600. */
1118
- privateKey: string;
1119
- fingerprint: string;
1120
- }
1121
- interface RelayEphemeralKeyPair {
1122
- publicKey: string;
1123
- privateKey: string;
1124
- }
1125
- interface RelayHandshakeHello {
1126
- v: typeof RELAY_PROTOCOL_VERSION;
1127
- role: RelayRole;
1128
- routeId: string;
1129
- deviceId: string;
1130
- sessionId: string;
1131
- issuedAt: number;
1132
- nonce: string;
1133
- ephemeralPublicKey: string;
1134
- identityFingerprint: string;
1135
- signature: string;
1136
- }
1137
- interface RelayEncryptedFrame {
1138
- v: typeof RELAY_PROTOCOL_VERSION;
1139
- sessionId: string;
1140
- seq: string;
1141
- kind: RelayFrameKind;
1142
- ciphertext: string;
1143
- }
1144
- interface RelayChannelOptions {
1145
- role: RelayRole;
1146
- localEphemeral: RelayEphemeralKeyPair;
1147
- deviceHello: RelayHandshakeHello;
1148
- hostHello: RelayHandshakeHello;
1149
- deviceIdentityPublicKey: string;
1150
- hostIdentityPublicKey: string;
1151
- now?: () => number;
1152
- maxAgeMs?: number;
1153
- maxFrames?: number;
1154
- }
1155
- declare function relayIdentityFingerprint(publicKey: string): string;
1156
- declare function generateRelayIdentity(): RelayIdentity;
1157
- /** Validates both key encodings and proves that the persisted private key belongs to the advertised identity. */
1158
- declare function validateRelayIdentity(value: unknown): RelayIdentity;
1159
- declare function generateRelayEphemeralKeyPair(): RelayEphemeralKeyPair;
1160
- declare function createRelayHandshakeHello(input: {
1161
- role: RelayRole;
1162
- routeId: string;
1163
- deviceId: string;
1164
- sessionId?: string;
1165
- identity: RelayIdentity;
1166
- ephemeral?: RelayEphemeralKeyPair;
1167
- nonce?: Uint8Array;
1168
- issuedAt?: number;
1169
- }): {
1170
- hello: RelayHandshakeHello;
1171
- ephemeral: RelayEphemeralKeyPair;
1172
- };
1173
- declare function verifyRelayHandshakeHello(hello: RelayHandshakeHello, expected: {
1174
- role: RelayRole;
1175
- routeId: string;
1176
- deviceId: string;
1177
- sessionId: string;
1178
- identityPublicKey: string;
1179
- now?: number;
1180
- maxSkewMs?: number;
1181
- }): void;
1182
- /** Small exported primitive used to pin RFC 5869 test vectors independently of the handshake. */
1183
- declare function hkdfSha256(input: Uint8Array, salt: Uint8Array, info: Uint8Array, length: number): Buffer;
1184
- declare class RelayCipherState {
1185
- readonly sessionId: string;
1186
- readonly role: RelayRole;
1187
- private readonly sendKey;
1188
- private readonly receiveKey;
1189
- private readonly sendBaseNonce;
1190
- private readonly receiveBaseNonce;
1191
- private readonly now;
1192
- private readonly maxAgeMs;
1193
- private readonly maxFrames;
1194
- private sendSequence;
1195
- private receiveSequence;
1196
- private closed;
1197
- private readonly createdAt;
1198
- private readonly sendDirection;
1199
- private readonly receiveDirection;
1200
- constructor(sessionId: string, role: RelayRole, sendKey: Buffer, receiveKey: Buffer, sendBaseNonce: Buffer, receiveBaseNonce: Buffer, now: () => number, maxAgeMs: number, maxFrames: number);
1201
- encrypt(kind: RelayFrameKind, plaintext: Uint8Array): RelayEncryptedFrame;
1202
- decrypt(frame: RelayEncryptedFrame): Buffer;
1203
- needsRotation(): boolean;
1204
- sequences(): {
1205
- send: string;
1206
- receive: string;
1207
- };
1208
- close(): void;
1209
- private assertOpen;
1210
- private assertKind;
1211
- }
1212
- declare function establishRelayChannel(options: RelayChannelOptions): RelayCipherState;
1213
-
1214
- interface RelayIdentityStoreOptions {
1215
- dataDir: string;
1216
- generate?: () => RelayIdentity;
1217
- now?: () => number;
1218
- }
1219
- interface DurableRelayIdentity {
1220
- identity: RelayIdentity;
1221
- createdAt: number;
1222
- path: string;
1223
- generated: boolean;
1224
- }
1225
- /** Loads one stable host identity or creates it once without allowing concurrent processes to overwrite it. */
1226
- declare function loadOrCreateRelayIdentity(options: RelayIdentityStoreOptions): DurableRelayIdentity;
1227
-
1228
- type RelayStoreMode = "sqlite" | "memory";
1229
- interface RelayRouteRecord {
1230
- id: string;
1231
- label: string;
1232
- hostCredentialHash: string;
1233
- ownerAccountId?: string;
1234
- createdAt: number;
1235
- updatedAt: number;
1236
- }
1237
- interface RelayDeviceRouteRecord {
1238
- routeId: string;
1239
- deviceId: string;
1240
- credentialHash: string;
1241
- createdAt: number;
1242
- updatedAt: number;
1243
- /** Bootstrap credentials expire unless the host promotes the device after the E2E pairing claim. */
1244
- expiresAt?: number;
1245
- }
1246
- interface PublicRelayRouteRecord {
1247
- id: string;
1248
- label: string;
1249
- deviceCount: number;
1250
- createdAt: number;
1251
- updatedAt: number;
1252
- }
1253
- interface RelayRouteStore {
1254
- readonly mode: RelayStoreMode;
1255
- createRoute(input: {
1256
- id?: string;
1257
- label: string;
1258
- hostCredentialHash: string;
1259
- ownerAccountId?: string;
1260
- }, now?: number): RelayRouteRecord;
1261
- getRoute(id: string): RelayRouteRecord | undefined;
1262
- listRoutes(now?: number): PublicRelayRouteRecord[];
1263
- listRoutesByOwner(ownerAccountId: string, now?: number): PublicRelayRouteRecord[];
1264
- countDevices(routeId: string, now?: number): number;
1265
- rotateHostCredential(routeId: string, credentialHash: string, now?: number): boolean;
1266
- deleteRoute(id: string): boolean;
1267
- authenticateHost(routeId: string, credential: string): boolean;
1268
- putDevice(input: {
1269
- routeId: string;
1270
- deviceId: string;
1271
- credentialHash: string;
1272
- expiresAt?: number;
1273
- }, now?: number): RelayDeviceRouteRecord;
1274
- getDevice(routeId: string, deviceId: string, now?: number): RelayDeviceRouteRecord | undefined;
1275
- authenticateDevice(routeId: string, deviceId: string, credential: string, now?: number): boolean;
1276
- revokeDevice(routeId: string, deviceId: string): boolean;
1277
- close(): void;
1278
- }
1279
- interface OpenRelayRouteStoreOptions {
1280
- dbPath: string;
1281
- generateRouteId?: () => string;
1282
- loadDatabase?: () => typeof better_sqlite3;
1283
- }
1284
- declare function relayCredentialHash(credential: string): string;
1285
- declare function generateRelayCredential(prefix?: "rrh" | "rrd" | "rrp"): string;
1286
- declare function openRelayRouteStore(options: OpenRelayRouteStoreOptions): RelayRouteStore;
1287
-
1288
- type RelayAccountStoreMode = "sqlite" | "memory";
1289
- type RelayAccountStatus = "active" | "suspended" | "deleted";
1290
- type RelayAccountPlan = "free" | "team" | "enterprise";
1291
- interface RelayAccountRecord {
1292
- id: string;
1293
- label: string;
1294
- status: RelayAccountStatus;
1295
- plan: RelayAccountPlan;
1296
- maxRoutes: number;
1297
- maxDevicesPerRoute: number;
1298
- revision: number;
1299
- createdAt: number;
1300
- updatedAt: number;
1301
- }
1302
- interface RelayAccountFields {
1303
- /** Stable control-plane identity. Omit for the legacy server-generated account flow. */
1304
- id?: string;
1305
- label: string;
1306
- plan?: RelayAccountPlan;
1307
- maxRoutes?: number;
1308
- maxDevicesPerRoute?: number;
1309
- }
1310
- interface RelayAccountCredentialMaterial {
1311
- credentialHash: string;
1312
- credentialLookup: string;
1313
- }
1314
- type CreateRelayAccountInput = RelayAccountFields & (({
1315
- credential: string;
1316
- } & Partial<Record<keyof RelayAccountCredentialMaterial, never>>) | ({
1317
- credential?: never;
1318
- } & RelayAccountCredentialMaterial));
1319
- type RelayAccountCredentialInput = string | RelayAccountCredentialMaterial;
1320
- interface UpdateRelayAccountInput {
1321
- label?: string;
1322
- status?: RelayAccountStatus;
1323
- plan?: RelayAccountPlan;
1324
- maxRoutes?: number;
1325
- maxDevicesPerRoute?: number;
1326
- }
1327
- interface RelayAccountStore {
1328
- readonly mode: RelayAccountStoreMode;
1329
- createAccount(input: CreateRelayAccountInput, now?: number): RelayAccountRecord;
1330
- getAccount(id: string): RelayAccountRecord | undefined;
1331
- listAccounts(options?: {
1332
- includeDeleted?: boolean;
1333
- }): RelayAccountRecord[];
1334
- /** Verify ownership for recovery without granting a suspended account route access. */
1335
- verifyCredential(credential: string): RelayAccountRecord | undefined;
1336
- authenticate(credential: string): RelayAccountRecord | undefined;
1337
- /** Constant-time comparison for idempotent control-plane provisioning and credential rotation. */
1338
- credentialMatches(id: string, credential: RelayAccountCredentialInput): boolean;
1339
- updateAccount(id: string, input: UpdateRelayAccountInput, expectedRevision: number, now?: number): RelayAccountRecord | undefined;
1340
- rotateCredential(id: string, credential: RelayAccountCredentialInput, expectedRevision: number, now?: number): RelayAccountRecord | undefined;
1341
- close(): void;
1342
- }
1343
- interface OpenRelayAccountStoreOptions {
1344
- dbPath: string;
1345
- generateAccountId?: () => string;
1346
- loadDatabase?: () => typeof better_sqlite3;
1347
- }
1348
- declare class RelayAccountRevisionConflictError extends Error {
1349
- readonly current: RelayAccountRecord;
1350
- constructor(current: RelayAccountRecord);
1351
- }
1352
- declare function relayAccountCredentialHash(credential: string): string;
1353
- declare function relayAccountCredentialLookup(credential: string): string;
1354
- declare function generateRelayAccountCredential(): string;
1355
- declare function openRelayAccountStore(options: OpenRelayAccountStoreOptions): RelayAccountStore;
1356
-
1357
- interface RelayDeviceProvisioner {
1358
- putDevice(deviceId: string, credentialHash: string, expiresAt?: number): Promise<void>;
1359
- promoteDevice(deviceId: string, expectedCredentialHash: string, credentialHash: string): Promise<void>;
1360
- revokeDevice(deviceId: string, expectedCredentialHash?: string): Promise<void>;
1361
- }
1362
- interface RelayDeviceProvisionerOptions {
1363
- relayUrl: string;
1364
- routeId: string;
1365
- hostCredential: string;
1366
- request?: typeof globalThis.fetch;
1367
- timeoutMs?: number;
1368
- }
1369
- /** Host-authenticated provisioning uses HTTPS; routing credentials never appear in URLs or logs. */
1370
- declare function createRelayDeviceProvisioner(options: RelayDeviceProvisionerOptions): RelayDeviceProvisioner;
1371
-
1372
- interface RelayPairingPackage {
1373
- v: 1;
1374
- label: string;
1375
- relayUrl: string;
1376
- routeId: string;
1377
- deviceId: string;
1378
- deviceCredential: string;
1379
- deviceToken: string;
1380
- pairingSecret: string;
1381
- expiresAt: number;
1382
- hostIdentityPublicKey: string;
1383
- hostIdentityFingerprint: string;
1384
- }
1385
- interface RelayPairingBootstrap {
1386
- appUrl: string;
1387
- label: string;
1388
- relayUrl: string;
1389
- routeId: string;
1390
- hostIdentityPublicKey: string;
1391
- hostIdentityFingerprint: string;
1392
- provisioner: RelayDeviceProvisioner;
1393
- generateDeviceCredential?: () => string;
1394
- }
1395
- declare function normalizeRelayAppUrl(value: string): string;
1396
- declare function buildRelayPairingUrl(appUrl: string, pairing: RelayPairingPackage, options?: {
1397
- hostedApp?: boolean;
1398
- }): string;
1399
-
1400
- declare const BLIND_RELAY_PROTOCOL_VERSION: 1;
1401
- declare const BLIND_RELAY_DEFAULT_MAX_FRAME_BYTES = 1500000;
1402
- declare const BLIND_RELAY_DEFAULT_MAX_QUEUE_BYTES = 4000000;
1403
- declare const BLIND_RELAY_DEFAULT_MAX_TOTAL_CONNECTIONS = 1024;
1404
- declare const BLIND_RELAY_DEFAULT_MAX_CONNECTIONS_PER_ROUTE = 64;
1405
- declare const BLIND_RELAY_DEFAULT_MAX_BYTES_PER_MINUTE: number;
1406
- declare const BLIND_RELAY_DEFAULT_MAX_MESSAGES_PER_MINUTE = 12000;
1407
- interface CreateBlindRelayOptions {
1408
- rootToken: string;
1409
- /** Previous provisioning capabilities accepted only during an explicit, bounded zero-downtime rotation window. */
1410
- previousRootTokens?: string[];
1411
- store?: RelayRouteStore;
1412
- /** Optional hosted control plane. Self-hosted root-only routing remains available without it. */
1413
- accountStore?: RelayAccountStore;
1414
- allowedOrigins?: string[];
1415
- handshakeTimeoutMs?: number;
1416
- idleTimeoutMs?: number;
1417
- maxFrameBytes?: number;
1418
- maxQueueBytes?: number;
1419
- maxTotalConnections?: number;
1420
- maxConnectionsPerRoute?: number;
1421
- maxBytesPerMinute?: number;
1422
- maxMessagesPerMinute?: number;
1423
- now?: () => number;
1424
- generateChannelId?: () => string;
1425
- }
1426
- interface BlindRelayMetrics {
1427
- activeConnections: number;
1428
- activeHosts: number;
1429
- activeDevices: number;
1430
- acceptedConnections: number;
1431
- rejectedConnections: number;
1432
- forwardedFrames: number;
1433
- forwardedBytes: number;
1434
- droppedFrames: number;
1435
- }
1436
- interface BlindRelayServer {
1437
- app: FastifyInstance;
1438
- store: RelayRouteStore;
1439
- accountStore?: RelayAccountStore;
1440
- metrics(): BlindRelayMetrics;
1441
- }
1442
- declare function createBlindRelayServer(options: CreateBlindRelayOptions): BlindRelayServer;
1443
-
1444
- interface StartedBlindRelay extends BlindRelayServer {
1445
- url: string;
1446
- }
1447
- declare function startBlindRelay(env?: NodeJS.ProcessEnv): Promise<StartedBlindRelay>;
1448
- declare function isRelayDirectExecution(moduleUrl: string, argv1: string | undefined, embeddedContainerBuild?: boolean): boolean;
1449
-
1450
- /** RPC uses JSON inside an encrypted frame inside a base64 relay envelope. Larger data uses chunked streams. */
1451
- declare const RELAY_RPC_MAX_BODY_BYTES: number;
1452
- declare const RELAY_RPC_MAX_PATH_BYTES = 4096;
1453
- type RelayRpcMethod = "GET" | "HEAD" | "POST" | "PUT" | "PATCH" | "DELETE";
1454
- interface RelayRpcRequest {
1455
- id: string;
1456
- method: RelayRpcMethod;
1457
- path: string;
1458
- headers: Record<string, string>;
1459
- body?: Buffer;
1460
- }
1461
- interface RelayRpcResponse {
1462
- id: string;
1463
- status: number;
1464
- headers: Record<string, string>;
1465
- body?: string;
1466
- }
1467
- declare function parseRelayRpcRequest(value: unknown): RelayRpcRequest;
1468
- declare function relayRpcResponse(input: {
1469
- id: string;
1470
- status: number;
1471
- headers: Record<string, string | string[] | number | undefined>;
1472
- body?: Uint8Array;
1473
- }): RelayRpcResponse;
1474
-
1475
- declare const CLOUD_CONTRACT_VERSION: 1;
1476
- declare const CLOUD_AUTHORIZATION_CONTRACT_VERSION: 2;
1477
- declare const CLOUD_AUTHORIZATION_SIGNATURE_ALGORITHM: "Ed25519";
1478
- declare const CLOUD_AUTHORIZATION_SIGNATURE_ALGORITHM_V2: "Ed25519-SHA256";
1479
- declare const CLOUD_AUTHORIZATION_SIGNATURE_DOMAIN = "roamcode-cloud-authorization-snapshot-v1";
1480
- declare const CLOUD_AUTHORIZATION_SIGNATURE_DOMAIN_V2 = "roamcode-cloud-authorization-snapshot-v2";
1481
- declare const CLOUD_AUTHORIZATION_PERMISSIONS: readonly ["team:read", "sessions:read", "sessions:operate", "attention:read", "attention:manage", "presence:read", "presence:write", "workspaces:manage", "extensions:manage", "policy:manage", "members:manage", "node-access:manage", "audit:read", "fleet:read"];
1482
- declare const CloudRelayHostIdentitySchema: z.ZodObject<{
1483
- publicKey: z.ZodString;
1484
- fingerprint: z.ZodString;
1485
- }, z.core.$strict>;
1486
- declare const CloudAuthorizationPermissionSchema: z.ZodEnum<{
1487
- "team:read": "team:read";
1488
- "sessions:read": "sessions:read";
1489
- "sessions:operate": "sessions:operate";
1490
- "attention:read": "attention:read";
1491
- "attention:manage": "attention:manage";
1492
- "presence:read": "presence:read";
1493
- "presence:write": "presence:write";
1494
- "workspaces:manage": "workspaces:manage";
1495
- "extensions:manage": "extensions:manage";
1496
- "policy:manage": "policy:manage";
1497
- "members:manage": "members:manage";
1498
- "node-access:manage": "node-access:manage";
1499
- "audit:read": "audit:read";
1500
- "fleet:read": "fleet:read";
1501
- }>;
1502
- declare const CloudHostHeartbeatV1Schema: z.ZodObject<{
1503
- v: z.ZodLiteral<1>;
1504
- kind: z.ZodLiteral<"host-heartbeat">;
1505
- organizationId: z.ZodString;
1506
- hostId: z.ZodString;
1507
- instanceId: z.ZodString;
1508
- sentAt: z.ZodNumber;
1509
- sequence: z.ZodNumber;
1510
- softwareVersion: z.ZodString;
1511
- state: z.ZodEnum<{
1512
- ready: "ready";
1513
- draining: "draining";
1514
- }>;
1515
- authorizationRevision: z.ZodNullable<z.ZodNumber>;
1516
- relayHostIdentity: z.ZodOptional<z.ZodObject<{
1517
- publicKey: z.ZodString;
1518
- fingerprint: z.ZodString;
1519
- }, z.core.$strict>>;
1520
- capabilities: z.ZodArray<z.ZodString>;
1521
- }, z.core.$strict>;
1522
- declare const CloudAutomationWebhookRegistrationSchema: z.ZodObject<{
1523
- hookId: z.ZodString;
1524
- automationId: z.ZodString;
1525
- triggerId: z.ZodString;
1526
- secretHash: z.ZodString;
1527
- enabled: z.ZodBoolean;
1528
- }, z.core.$strict>;
1529
- declare const CloudAutomationInvocationSchema: z.ZodObject<{
1530
- id: z.ZodUUID;
1531
- automationId: z.ZodString;
1532
- triggerId: z.ZodString;
1533
- hookId: z.ZodString;
1534
- createdAt: z.ZodNumber;
1535
- }, z.core.$strict>;
1536
- type CloudAutomationWebhookRegistration = z.infer<typeof CloudAutomationWebhookRegistrationSchema>;
1537
- type CloudAutomationInvocation = z.infer<typeof CloudAutomationInvocationSchema>;
1538
- declare const CloudAuthorizationScopeV1Schema: z.ZodDiscriminatedUnion<[z.ZodObject<{
1539
- type: z.ZodLiteral<"organization">;
1540
- }, z.core.$strict>, z.ZodObject<{
1541
- type: z.ZodLiteral<"host">;
1542
- id: z.ZodString;
1543
- }, z.core.$strict>, z.ZodObject<{
1544
- type: z.ZodLiteral<"workspace">;
1545
- id: z.ZodString;
1546
- }, z.core.$strict>], "type">;
1547
- declare const CloudAuthorizationGrantV1Schema: z.ZodObject<{
1548
- principalType: z.ZodEnum<{
1549
- device: "device";
1550
- relay: "relay";
1551
- }>;
1552
- principalId: z.ZodString;
1553
- permissions: z.ZodArray<z.ZodEnum<{
1554
- "team:read": "team:read";
1555
- "sessions:read": "sessions:read";
1556
- "sessions:operate": "sessions:operate";
1557
- "attention:read": "attention:read";
1558
- "attention:manage": "attention:manage";
1559
- "presence:read": "presence:read";
1560
- "presence:write": "presence:write";
1561
- "workspaces:manage": "workspaces:manage";
1562
- "extensions:manage": "extensions:manage";
1563
- "policy:manage": "policy:manage";
1564
- "members:manage": "members:manage";
1565
- "node-access:manage": "node-access:manage";
1566
- "audit:read": "audit:read";
1567
- "fleet:read": "fleet:read";
1568
- }>>;
1569
- scope: z.ZodDiscriminatedUnion<[z.ZodObject<{
1570
- type: z.ZodLiteral<"organization">;
1571
- }, z.core.$strict>, z.ZodObject<{
1572
- type: z.ZodLiteral<"host">;
1573
- id: z.ZodString;
1574
- }, z.core.$strict>, z.ZodObject<{
1575
- type: z.ZodLiteral<"workspace">;
1576
- id: z.ZodString;
1577
- }, z.core.$strict>], "type">;
1578
- }, z.core.$strict>;
1579
- declare const CloudAuthorizationSnapshotV1Schema: z.ZodObject<{
1580
- v: z.ZodLiteral<1>;
1581
- kind: z.ZodLiteral<"authorization-snapshot">;
1582
- organizationId: z.ZodString;
1583
- hostId: z.ZodString;
1584
- revision: z.ZodNumber;
1585
- issuedAt: z.ZodNumber;
1586
- notBefore: z.ZodNumber;
1587
- expiresAt: z.ZodNumber;
1588
- grants: z.ZodArray<z.ZodObject<{
1589
- principalType: z.ZodEnum<{
1590
- device: "device";
1591
- relay: "relay";
1592
- }>;
1593
- principalId: z.ZodString;
1594
- permissions: z.ZodArray<z.ZodEnum<{
1595
- "team:read": "team:read";
1596
- "sessions:read": "sessions:read";
1597
- "sessions:operate": "sessions:operate";
1598
- "attention:read": "attention:read";
1599
- "attention:manage": "attention:manage";
1600
- "presence:read": "presence:read";
1601
- "presence:write": "presence:write";
1602
- "workspaces:manage": "workspaces:manage";
1603
- "extensions:manage": "extensions:manage";
1604
- "policy:manage": "policy:manage";
1605
- "members:manage": "members:manage";
1606
- "node-access:manage": "node-access:manage";
1607
- "audit:read": "audit:read";
1608
- "fleet:read": "fleet:read";
1609
- }>>;
1610
- scope: z.ZodDiscriminatedUnion<[z.ZodObject<{
1611
- type: z.ZodLiteral<"organization">;
1612
- }, z.core.$strict>, z.ZodObject<{
1613
- type: z.ZodLiteral<"host">;
1614
- id: z.ZodString;
1615
- }, z.core.$strict>, z.ZodObject<{
1616
- type: z.ZodLiteral<"workspace">;
1617
- id: z.ZodString;
1618
- }, z.core.$strict>], "type">;
1619
- }, z.core.$strict>>;
1620
- }, z.core.$strict>;
1621
- declare const CloudAuthorizationSnapshotV2Schema: z.ZodObject<{
1622
- v: z.ZodLiteral<2>;
1623
- kind: z.ZodLiteral<"authorization-snapshot">;
1624
- organizationId: z.ZodString;
1625
- hostId: z.ZodString;
1626
- revision: z.ZodNumber;
1627
- issuedAt: z.ZodNumber;
1628
- notBefore: z.ZodNumber;
1629
- expiresAt: z.ZodNumber;
1630
- grants: z.ZodArray<z.ZodObject<{
1631
- principalType: z.ZodEnum<{
1632
- device: "device";
1633
- relay: "relay";
1634
- }>;
1635
- principalId: z.ZodString;
1636
- permissions: z.ZodArray<z.ZodEnum<{
1637
- "team:read": "team:read";
1638
- "sessions:read": "sessions:read";
1639
- "sessions:operate": "sessions:operate";
1640
- "attention:read": "attention:read";
1641
- "attention:manage": "attention:manage";
1642
- "presence:read": "presence:read";
1643
- "presence:write": "presence:write";
1644
- "workspaces:manage": "workspaces:manage";
1645
- "extensions:manage": "extensions:manage";
1646
- "policy:manage": "policy:manage";
1647
- "members:manage": "members:manage";
1648
- "node-access:manage": "node-access:manage";
1649
- "audit:read": "audit:read";
1650
- "fleet:read": "fleet:read";
1651
- }>>;
1652
- scope: z.ZodDiscriminatedUnion<[z.ZodObject<{
1653
- type: z.ZodLiteral<"organization">;
1654
- }, z.core.$strict>, z.ZodObject<{
1655
- type: z.ZodLiteral<"host">;
1656
- id: z.ZodString;
1657
- }, z.core.$strict>, z.ZodObject<{
1658
- type: z.ZodLiteral<"workspace">;
1659
- id: z.ZodString;
1660
- }, z.core.$strict>], "type">;
1661
- }, z.core.$strict>>;
1662
- }, z.core.$strict>;
1663
- declare const CloudAuthorizationSnapshotSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
1664
- v: z.ZodLiteral<1>;
1665
- kind: z.ZodLiteral<"authorization-snapshot">;
1666
- organizationId: z.ZodString;
1667
- hostId: z.ZodString;
1668
- revision: z.ZodNumber;
1669
- issuedAt: z.ZodNumber;
1670
- notBefore: z.ZodNumber;
1671
- expiresAt: z.ZodNumber;
1672
- grants: z.ZodArray<z.ZodObject<{
1673
- principalType: z.ZodEnum<{
1674
- device: "device";
1675
- relay: "relay";
1676
- }>;
1677
- principalId: z.ZodString;
1678
- permissions: z.ZodArray<z.ZodEnum<{
1679
- "team:read": "team:read";
1680
- "sessions:read": "sessions:read";
1681
- "sessions:operate": "sessions:operate";
1682
- "attention:read": "attention:read";
1683
- "attention:manage": "attention:manage";
1684
- "presence:read": "presence:read";
1685
- "presence:write": "presence:write";
1686
- "workspaces:manage": "workspaces:manage";
1687
- "extensions:manage": "extensions:manage";
1688
- "policy:manage": "policy:manage";
1689
- "members:manage": "members:manage";
1690
- "node-access:manage": "node-access:manage";
1691
- "audit:read": "audit:read";
1692
- "fleet:read": "fleet:read";
1693
- }>>;
1694
- scope: z.ZodDiscriminatedUnion<[z.ZodObject<{
1695
- type: z.ZodLiteral<"organization">;
1696
- }, z.core.$strict>, z.ZodObject<{
1697
- type: z.ZodLiteral<"host">;
1698
- id: z.ZodString;
1699
- }, z.core.$strict>, z.ZodObject<{
1700
- type: z.ZodLiteral<"workspace">;
1701
- id: z.ZodString;
1702
- }, z.core.$strict>], "type">;
1703
- }, z.core.$strict>>;
1704
- }, z.core.$strict>, z.ZodObject<{
1705
- v: z.ZodLiteral<2>;
1706
- kind: z.ZodLiteral<"authorization-snapshot">;
1707
- organizationId: z.ZodString;
1708
- hostId: z.ZodString;
1709
- revision: z.ZodNumber;
1710
- issuedAt: z.ZodNumber;
1711
- notBefore: z.ZodNumber;
1712
- expiresAt: z.ZodNumber;
1713
- grants: z.ZodArray<z.ZodObject<{
1714
- principalType: z.ZodEnum<{
1715
- device: "device";
1716
- relay: "relay";
1717
- }>;
1718
- principalId: z.ZodString;
1719
- permissions: z.ZodArray<z.ZodEnum<{
1720
- "team:read": "team:read";
1721
- "sessions:read": "sessions:read";
1722
- "sessions:operate": "sessions:operate";
1723
- "attention:read": "attention:read";
1724
- "attention:manage": "attention:manage";
1725
- "presence:read": "presence:read";
1726
- "presence:write": "presence:write";
1727
- "workspaces:manage": "workspaces:manage";
1728
- "extensions:manage": "extensions:manage";
1729
- "policy:manage": "policy:manage";
1730
- "members:manage": "members:manage";
1731
- "node-access:manage": "node-access:manage";
1732
- "audit:read": "audit:read";
1733
- "fleet:read": "fleet:read";
1734
- }>>;
1735
- scope: z.ZodDiscriminatedUnion<[z.ZodObject<{
1736
- type: z.ZodLiteral<"organization">;
1737
- }, z.core.$strict>, z.ZodObject<{
1738
- type: z.ZodLiteral<"host">;
1739
- id: z.ZodString;
1740
- }, z.core.$strict>, z.ZodObject<{
1741
- type: z.ZodLiteral<"workspace">;
1742
- id: z.ZodString;
1743
- }, z.core.$strict>], "type">;
1744
- }, z.core.$strict>>;
1745
- }, z.core.$strict>], "v">;
1746
- declare const SignedCloudAuthorizationSnapshotV1Schema: z.ZodObject<{
1747
- v: z.ZodLiteral<1>;
1748
- kind: z.ZodLiteral<"signed-authorization-snapshot">;
1749
- algorithm: z.ZodLiteral<"Ed25519">;
1750
- keyId: z.ZodString;
1751
- snapshot: z.ZodObject<{
1752
- v: z.ZodLiteral<1>;
1753
- kind: z.ZodLiteral<"authorization-snapshot">;
1754
- organizationId: z.ZodString;
1755
- hostId: z.ZodString;
1756
- revision: z.ZodNumber;
1757
- issuedAt: z.ZodNumber;
1758
- notBefore: z.ZodNumber;
1759
- expiresAt: z.ZodNumber;
1760
- grants: z.ZodArray<z.ZodObject<{
1761
- principalType: z.ZodEnum<{
1762
- device: "device";
1763
- relay: "relay";
1764
- }>;
1765
- principalId: z.ZodString;
1766
- permissions: z.ZodArray<z.ZodEnum<{
1767
- "team:read": "team:read";
1768
- "sessions:read": "sessions:read";
1769
- "sessions:operate": "sessions:operate";
1770
- "attention:read": "attention:read";
1771
- "attention:manage": "attention:manage";
1772
- "presence:read": "presence:read";
1773
- "presence:write": "presence:write";
1774
- "workspaces:manage": "workspaces:manage";
1775
- "extensions:manage": "extensions:manage";
1776
- "policy:manage": "policy:manage";
1777
- "members:manage": "members:manage";
1778
- "node-access:manage": "node-access:manage";
1779
- "audit:read": "audit:read";
1780
- "fleet:read": "fleet:read";
1781
- }>>;
1782
- scope: z.ZodDiscriminatedUnion<[z.ZodObject<{
1783
- type: z.ZodLiteral<"organization">;
1784
- }, z.core.$strict>, z.ZodObject<{
1785
- type: z.ZodLiteral<"host">;
1786
- id: z.ZodString;
1787
- }, z.core.$strict>, z.ZodObject<{
1788
- type: z.ZodLiteral<"workspace">;
1789
- id: z.ZodString;
1790
- }, z.core.$strict>], "type">;
1791
- }, z.core.$strict>>;
1792
- }, z.core.$strict>;
1793
- signature: z.ZodString;
1794
- }, z.core.$strict>;
1795
- declare const SignedCloudAuthorizationSnapshotV2Schema: z.ZodObject<{
1796
- v: z.ZodLiteral<2>;
1797
- kind: z.ZodLiteral<"signed-authorization-snapshot">;
1798
- algorithm: z.ZodLiteral<"Ed25519-SHA256">;
1799
- keyId: z.ZodString;
1800
- snapshot: z.ZodObject<{
1801
- v: z.ZodLiteral<2>;
1802
- kind: z.ZodLiteral<"authorization-snapshot">;
1803
- organizationId: z.ZodString;
1804
- hostId: z.ZodString;
1805
- revision: z.ZodNumber;
1806
- issuedAt: z.ZodNumber;
1807
- notBefore: z.ZodNumber;
1808
- expiresAt: z.ZodNumber;
1809
- grants: z.ZodArray<z.ZodObject<{
1810
- principalType: z.ZodEnum<{
1811
- device: "device";
1812
- relay: "relay";
1813
- }>;
1814
- principalId: z.ZodString;
1815
- permissions: z.ZodArray<z.ZodEnum<{
1816
- "team:read": "team:read";
1817
- "sessions:read": "sessions:read";
1818
- "sessions:operate": "sessions:operate";
1819
- "attention:read": "attention:read";
1820
- "attention:manage": "attention:manage";
1821
- "presence:read": "presence:read";
1822
- "presence:write": "presence:write";
1823
- "workspaces:manage": "workspaces:manage";
1824
- "extensions:manage": "extensions:manage";
1825
- "policy:manage": "policy:manage";
1826
- "members:manage": "members:manage";
1827
- "node-access:manage": "node-access:manage";
1828
- "audit:read": "audit:read";
1829
- "fleet:read": "fleet:read";
1830
- }>>;
1831
- scope: z.ZodDiscriminatedUnion<[z.ZodObject<{
1832
- type: z.ZodLiteral<"organization">;
1833
- }, z.core.$strict>, z.ZodObject<{
1834
- type: z.ZodLiteral<"host">;
1835
- id: z.ZodString;
1836
- }, z.core.$strict>, z.ZodObject<{
1837
- type: z.ZodLiteral<"workspace">;
1838
- id: z.ZodString;
1839
- }, z.core.$strict>], "type">;
1840
- }, z.core.$strict>>;
1841
- }, z.core.$strict>;
1842
- signature: z.ZodString;
1843
- }, z.core.$strict>;
1844
- declare const SignedCloudAuthorizationSnapshotSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
1845
- v: z.ZodLiteral<1>;
1846
- kind: z.ZodLiteral<"signed-authorization-snapshot">;
1847
- algorithm: z.ZodLiteral<"Ed25519">;
1848
- keyId: z.ZodString;
1849
- snapshot: z.ZodObject<{
1850
- v: z.ZodLiteral<1>;
1851
- kind: z.ZodLiteral<"authorization-snapshot">;
1852
- organizationId: z.ZodString;
1853
- hostId: z.ZodString;
1854
- revision: z.ZodNumber;
1855
- issuedAt: z.ZodNumber;
1856
- notBefore: z.ZodNumber;
1857
- expiresAt: z.ZodNumber;
1858
- grants: z.ZodArray<z.ZodObject<{
1859
- principalType: z.ZodEnum<{
1860
- device: "device";
1861
- relay: "relay";
1862
- }>;
1863
- principalId: z.ZodString;
1864
- permissions: z.ZodArray<z.ZodEnum<{
1865
- "team:read": "team:read";
1866
- "sessions:read": "sessions:read";
1867
- "sessions:operate": "sessions:operate";
1868
- "attention:read": "attention:read";
1869
- "attention:manage": "attention:manage";
1870
- "presence:read": "presence:read";
1871
- "presence:write": "presence:write";
1872
- "workspaces:manage": "workspaces:manage";
1873
- "extensions:manage": "extensions:manage";
1874
- "policy:manage": "policy:manage";
1875
- "members:manage": "members:manage";
1876
- "node-access:manage": "node-access:manage";
1877
- "audit:read": "audit:read";
1878
- "fleet:read": "fleet:read";
1879
- }>>;
1880
- scope: z.ZodDiscriminatedUnion<[z.ZodObject<{
1881
- type: z.ZodLiteral<"organization">;
1882
- }, z.core.$strict>, z.ZodObject<{
1883
- type: z.ZodLiteral<"host">;
1884
- id: z.ZodString;
1885
- }, z.core.$strict>, z.ZodObject<{
1886
- type: z.ZodLiteral<"workspace">;
1887
- id: z.ZodString;
1888
- }, z.core.$strict>], "type">;
1889
- }, z.core.$strict>>;
1890
- }, z.core.$strict>;
1891
- signature: z.ZodString;
1892
- }, z.core.$strict>, z.ZodObject<{
1893
- v: z.ZodLiteral<2>;
1894
- kind: z.ZodLiteral<"signed-authorization-snapshot">;
1895
- algorithm: z.ZodLiteral<"Ed25519-SHA256">;
1896
- keyId: z.ZodString;
1897
- snapshot: z.ZodObject<{
1898
- v: z.ZodLiteral<2>;
1899
- kind: z.ZodLiteral<"authorization-snapshot">;
1900
- organizationId: z.ZodString;
1901
- hostId: z.ZodString;
1902
- revision: z.ZodNumber;
1903
- issuedAt: z.ZodNumber;
1904
- notBefore: z.ZodNumber;
1905
- expiresAt: z.ZodNumber;
1906
- grants: z.ZodArray<z.ZodObject<{
1907
- principalType: z.ZodEnum<{
1908
- device: "device";
1909
- relay: "relay";
1910
- }>;
1911
- principalId: z.ZodString;
1912
- permissions: z.ZodArray<z.ZodEnum<{
1913
- "team:read": "team:read";
1914
- "sessions:read": "sessions:read";
1915
- "sessions:operate": "sessions:operate";
1916
- "attention:read": "attention:read";
1917
- "attention:manage": "attention:manage";
1918
- "presence:read": "presence:read";
1919
- "presence:write": "presence:write";
1920
- "workspaces:manage": "workspaces:manage";
1921
- "extensions:manage": "extensions:manage";
1922
- "policy:manage": "policy:manage";
1923
- "members:manage": "members:manage";
1924
- "node-access:manage": "node-access:manage";
1925
- "audit:read": "audit:read";
1926
- "fleet:read": "fleet:read";
1927
- }>>;
1928
- scope: z.ZodDiscriminatedUnion<[z.ZodObject<{
1929
- type: z.ZodLiteral<"organization">;
1930
- }, z.core.$strict>, z.ZodObject<{
1931
- type: z.ZodLiteral<"host">;
1932
- id: z.ZodString;
1933
- }, z.core.$strict>, z.ZodObject<{
1934
- type: z.ZodLiteral<"workspace">;
1935
- id: z.ZodString;
1936
- }, z.core.$strict>], "type">;
1937
- }, z.core.$strict>>;
1938
- }, z.core.$strict>;
1939
- signature: z.ZodString;
1940
- }, z.core.$strict>], "v">;
1941
- declare const CloudAuthorizationTrustedKeySchema: z.ZodObject<{
1942
- keyId: z.ZodString;
1943
- algorithm: z.ZodLiteral<"Ed25519">;
1944
- publicKey: z.ZodString;
1945
- notBefore: z.ZodOptional<z.ZodNumber>;
1946
- notAfter: z.ZodOptional<z.ZodNumber>;
1947
- trustExpiresAt: z.ZodOptional<z.ZodNumber>;
1948
- }, z.core.$strict>;
1949
- declare const CloudAuthorizationTrustedKeyV2Schema: z.ZodObject<{
1950
- keyId: z.ZodString;
1951
- algorithm: z.ZodLiteral<"Ed25519-SHA256">;
1952
- publicKey: z.ZodString;
1953
- notBefore: z.ZodOptional<z.ZodNumber>;
1954
- notAfter: z.ZodOptional<z.ZodNumber>;
1955
- trustExpiresAt: z.ZodOptional<z.ZodNumber>;
1956
- }, z.core.$strict>;
1957
- declare const CloudAuthorizationTrustedKeyAnySchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
1958
- keyId: z.ZodString;
1959
- algorithm: z.ZodLiteral<"Ed25519">;
1960
- publicKey: z.ZodString;
1961
- notBefore: z.ZodOptional<z.ZodNumber>;
1962
- notAfter: z.ZodOptional<z.ZodNumber>;
1963
- trustExpiresAt: z.ZodOptional<z.ZodNumber>;
1964
- }, z.core.$strict>, z.ZodObject<{
1965
- keyId: z.ZodString;
1966
- algorithm: z.ZodLiteral<"Ed25519-SHA256">;
1967
- publicKey: z.ZodString;
1968
- notBefore: z.ZodOptional<z.ZodNumber>;
1969
- notAfter: z.ZodOptional<z.ZodNumber>;
1970
- trustExpiresAt: z.ZodOptional<z.ZodNumber>;
1971
- }, z.core.$strict>], "algorithm">;
1972
- type CloudAuthorizationPermission = z.infer<typeof CloudAuthorizationPermissionSchema>;
1973
- type CloudRelayHostIdentity = z.infer<typeof CloudRelayHostIdentitySchema>;
1974
- type CloudHostHeartbeatV1 = z.infer<typeof CloudHostHeartbeatV1Schema>;
1975
- type CloudAuthorizationScopeV1 = z.infer<typeof CloudAuthorizationScopeV1Schema>;
1976
- type CloudAuthorizationGrantV1 = z.infer<typeof CloudAuthorizationGrantV1Schema>;
1977
- type CloudAuthorizationSnapshotV1 = z.infer<typeof CloudAuthorizationSnapshotV1Schema>;
1978
- type CloudAuthorizationSnapshotV2 = z.infer<typeof CloudAuthorizationSnapshotV2Schema>;
1979
- type CloudAuthorizationSnapshot = z.infer<typeof CloudAuthorizationSnapshotSchema>;
1980
- type SignedCloudAuthorizationSnapshotV1 = z.infer<typeof SignedCloudAuthorizationSnapshotV1Schema>;
1981
- type SignedCloudAuthorizationSnapshotV2 = z.infer<typeof SignedCloudAuthorizationSnapshotV2Schema>;
1982
- type SignedCloudAuthorizationSnapshot = z.infer<typeof SignedCloudAuthorizationSnapshotSchema>;
1983
- type CloudAuthorizationTrustedKeyV1 = z.infer<typeof CloudAuthorizationTrustedKeySchema>;
1984
- type CloudAuthorizationTrustedKeyV2 = z.infer<typeof CloudAuthorizationTrustedKeyV2Schema>;
1985
- type CloudAuthorizationTrustedKey = z.infer<typeof CloudAuthorizationTrustedKeyAnySchema>;
1986
- type CloudAuthorizationVerificationErrorCode = "INVALID_ENVELOPE" | "INVALID_KEYRING" | "UNKNOWN_KEY" | "KEY_NOT_ACTIVE" | "TRUST_EXPIRED" | "ALGORITHM_MISMATCH" | "INVALID_PUBLIC_KEY" | "INVALID_SIGNATURE";
1987
- declare class CloudAuthorizationVerificationError extends Error {
1988
- readonly code: CloudAuthorizationVerificationErrorCode;
1989
- constructor(code: CloudAuthorizationVerificationErrorCode, message: string);
1990
- }
1991
- declare function canonicalCloudJson(value: unknown): string;
1992
- declare function parseCloudHostHeartbeat(value: unknown): CloudHostHeartbeatV1;
1993
- declare function parseCloudAuthorizationSnapshot(value: unknown): CloudAuthorizationSnapshot;
1994
- declare function parseSignedCloudAuthorizationSnapshot(value: unknown): SignedCloudAuthorizationSnapshot;
1995
- /**
1996
- * Exact, domain-separated bytes that the cloud control plane signs and the host verifies.
1997
- *
1998
- * V1 signs the raw protected envelope for self-host compatibility. V2 signs exactly the SHA-256 digest of the
1999
- * protected envelope so hardware signers never receive attacker-amplifiable snapshot bytes.
2000
- */
2001
- declare function cloudAuthorizationSnapshotSigningPayload(snapshot: unknown, keyId: string): Buffer;
2002
- /** Verifies one envelope against any active key id, allowing safe overlap during signing-key rotation. */
2003
- declare function verifySignedCloudAuthorizationSnapshot(value: unknown, trustedKeys: readonly CloudAuthorizationTrustedKey[], verificationTime?: number): SignedCloudAuthorizationSnapshot;
2004
-
2005
- declare const CLOUD_AUTHORIZATION_FILE = "cloud-authorization.json";
2006
- declare const CLOUD_AUTHORIZATION_LAST_GOOD_FILE = "cloud-authorization.last-good.json";
2007
- declare const CLOUD_AUTHORIZATION_CLOCK_SKEW_MS: number;
2008
- type CloudAuthorizationSnapshotStatus = "unavailable" | "pending" | "active" | "expired";
2009
- type CloudAuthorizationPrincipalType = "device" | "relay";
2010
- type CloudAuthorizationStoreErrorCode = "TARGET_MISMATCH" | "CONTRACT_MISMATCH" | "REPLAY" | "TEMPORAL_REGRESSION" | "ISSUED_IN_FUTURE" | "ISSUED_TOO_OLD" | "NOT_YET_VALID" | "EXPIRED" | "PERSISTENCE_CORRUPT" | "PERSISTENCE_UNSAFE" | "REVISION_CONFLICT";
2011
- declare class CloudAuthorizationStoreError extends Error {
2012
- readonly code: CloudAuthorizationStoreErrorCode;
2013
- constructor(code: CloudAuthorizationStoreErrorCode, message: string);
2014
- }
2015
- interface StoredCloudAuthorizationSnapshot {
2016
- acceptedAt: number;
2017
- envelope: SignedCloudAuthorizationSnapshot;
2018
- snapshot: CloudAuthorizationSnapshot;
2019
- }
2020
- interface CloudAuthorizationState {
2021
- status: CloudAuthorizationSnapshotStatus;
2022
- revision?: number;
2023
- notBefore?: number;
2024
- expiresAt?: number;
2025
- }
2026
- interface CloudAuthorizationDecision {
2027
- allowed: boolean;
2028
- reason: "cloud-grant" | "cloud-authorization-unavailable" | "cloud-authorization-pending" | "cloud-authorization-expired" | "cloud-principal-unbound" | "cloud-missing-permission" | "cloud-host-mismatch";
2029
- revision?: number;
2030
- }
2031
- interface OpenCloudAuthorizationStoreOptions {
2032
- dataDir: string;
2033
- organizationId: string;
2034
- hostId: string;
2035
- trustedKeys: readonly CloudAuthorizationTrustedKey[] | (() => readonly CloudAuthorizationTrustedKey[]);
2036
- /** Provisioned authorization contract. An envelope from another version is never accepted as a downgrade. */
2037
- authorizationVersion?: 1 | 2;
2038
- now?: () => number;
2039
- clockSkewMs?: number;
2040
- }
2041
- interface CloudAuthorizationStore {
2042
- readonly path: string;
2043
- readonly backupPath: string;
2044
- getLastKnownGood(): StoredCloudAuthorizationSnapshot | undefined;
2045
- getState(now?: number): CloudAuthorizationState;
2046
- getActiveSnapshot(now?: number): CloudAuthorizationSnapshot | undefined;
2047
- apply(value: unknown, now?: number): StoredCloudAuthorizationSnapshot;
2048
- reload(): StoredCloudAuthorizationSnapshot | undefined;
2049
- authorize(actorType: CloudAuthorizationPrincipalType, actorId: string, permission: CloudAuthorizationPermission, resource?: TeamAuthorizationResource, now?: number): CloudAuthorizationDecision;
2050
- }
2051
- declare function openCloudAuthorizationStore(options: OpenCloudAuthorizationStoreOptions): CloudAuthorizationStore;
2052
-
2053
- declare const DEFAULT_CLOUD_CONTROL_PLANE_URL = "https://roamcode.ai";
2054
- declare const CLOUD_DEVICE_ENROLLMENT_CONFIRM_PATH = "/api/v1/hosts/device-enrollments/confirm";
2055
- declare const CLOUD_DEVICE_ENROLLMENT_COMPLETE_PATH = "/api/v1/hosts/device-enrollments/complete";
2056
- declare const CLOUD_DEVICE_ENROLLMENT_HOST_ROUTE = "/api/v1/cloud/device-enrollments/confirm";
2057
- declare const CloudDeviceEnrollmentRequestSchema: z.ZodObject<{
2058
- v: z.ZodLiteral<1>;
2059
- enrollmentId: z.ZodUUID;
2060
- challenge: z.ZodString;
2061
- }, z.core.$strict>;
2062
- declare const CloudHostDeviceEnrollmentConfirmationSchema: z.ZodObject<{
2063
- v: z.ZodLiteral<1>;
2064
- kind: z.ZodLiteral<"host-device-enrollment-confirmation">;
2065
- enrollmentId: z.ZodUUID;
2066
- challenge: z.ZodString;
2067
- actorId: z.ZodString;
2068
- deviceIdentityPublicKey: z.ZodOptional<z.ZodString>;
2069
- }, z.core.$strict>;
2070
- declare const CloudHostDeviceEnrollmentCompletionSchema: z.ZodObject<{
2071
- v: z.ZodLiteral<1>;
2072
- kind: z.ZodLiteral<"host-device-enrollment-completion">;
2073
- enrollmentId: z.ZodUUID;
2074
- actorId: z.ZodString;
2075
- temporaryRelayCredentialHash: z.ZodString;
2076
- durableRelayCredentialHash: z.ZodString;
2077
- }, z.core.$strict>;
2078
- declare const CloudRelayDeviceEnrollmentPayloadSchema: z.ZodObject<{
2079
- v: z.ZodLiteral<1>;
2080
- kind: z.ZodLiteral<"cloud-device-enrollment">;
2081
- enrollmentId: z.ZodUUID;
2082
- challenge: z.ZodString;
2083
- name: z.ZodString;
2084
- localDeviceToken: z.ZodString;
2085
- durableRelayCredential: z.ZodString;
2086
- }, z.core.$strict>;
2087
- declare const CloudRelayDeviceEnrollmentAuthSchema: z.ZodObject<{
2088
- token: z.ZodString;
2089
- relayCredential: z.ZodString;
2090
- cloudEnrollment: z.ZodObject<{
2091
- v: z.ZodLiteral<1>;
2092
- kind: z.ZodLiteral<"cloud-device-enrollment">;
2093
- enrollmentId: z.ZodUUID;
2094
- challenge: z.ZodString;
2095
- name: z.ZodString;
2096
- localDeviceToken: z.ZodString;
2097
- durableRelayCredential: z.ZodString;
2098
- }, z.core.$strict>;
2099
- }, z.core.$strict>;
2100
- declare const CloudHostDeviceEnrollmentCompletionResponseSchema: z.ZodObject<{
2101
- v: z.ZodLiteral<1>;
2102
- state: z.ZodEnum<{
2103
- revoked: "revoked";
2104
- active: "active";
2105
- }>;
2106
- deviceId: z.ZodUUID;
2107
- }, z.core.$strict>;
2108
- type CloudDeviceEnrollmentRequest = z.infer<typeof CloudDeviceEnrollmentRequestSchema>;
2109
- type CloudHostDeviceEnrollmentConfirmation = z.infer<typeof CloudHostDeviceEnrollmentConfirmationSchema>;
2110
- type CloudHostDeviceEnrollmentCompletion = z.infer<typeof CloudHostDeviceEnrollmentCompletionSchema>;
2111
- type CloudHostDeviceEnrollmentCompletionResult = z.infer<typeof CloudHostDeviceEnrollmentCompletionResponseSchema>;
2112
- type CloudRelayDeviceEnrollmentPayload = z.infer<typeof CloudRelayDeviceEnrollmentPayloadSchema>;
2113
- type CloudRelayDeviceEnrollmentAuth = z.infer<typeof CloudRelayDeviceEnrollmentAuthSchema>;
2114
- interface CloudDeviceEnrollmentConfirmationResult {
2115
- actorId: string;
2116
- deviceId: string;
2117
- temporaryRelayCredentialHash?: string;
2118
- deviceIdentity?: {
2119
- publicKey: string;
2120
- fingerprint: string;
2121
- };
2122
- }
2123
- interface CloudRelayDeviceEnrollmentSaga {
2124
- enroll(input: {
2125
- actorId: string;
2126
- deviceIdentityPublicKey: string;
2127
- cloudEnrollment: unknown;
2128
- }): Promise<{
2129
- device: DeviceInfo;
2130
- token: string;
2131
- }>;
2132
- recover(): Promise<{
2133
- completed: number;
2134
- failed: number;
2135
- }>;
2136
- }
2137
- interface CloudDeviceEnrollmentConfirmer {
2138
- confirm(input: CloudHostDeviceEnrollmentConfirmation): Promise<CloudDeviceEnrollmentConfirmationResult>;
2139
- complete(input: CloudHostDeviceEnrollmentCompletion): Promise<CloudHostDeviceEnrollmentCompletionResult>;
2140
- }
2141
- interface CloudDeviceEnrollmentRuntimeConfig {
2142
- controlPlaneOrigin: string;
2143
- hostCredential: string;
2144
- }
2145
- type CloudDeviceEnrollmentErrorCode = "REJECTED" | "UNAVAILABLE" | "INVALID_RESPONSE";
2146
- declare class CloudDeviceEnrollmentError extends Error {
2147
- readonly code: CloudDeviceEnrollmentErrorCode;
2148
- readonly retryable: boolean;
2149
- constructor(code: CloudDeviceEnrollmentErrorCode, retryable: boolean);
2150
- }
2151
- interface CreateCloudDeviceEnrollmentConfirmerOptions extends CloudDeviceEnrollmentRuntimeConfig {
2152
- fetch?: typeof globalThis.fetch;
2153
- timeoutMs?: number;
2154
- }
2155
- /** Normalize an origin once so a client payload can never choose where the host credential is sent. */
2156
- declare function normalizeCloudControlPlaneOrigin(value: string): string;
2157
- /** Read a host capability without following links or accepting permissions that expose it to other users. */
2158
- declare function readCloudHostCredentialFile(path: string): string;
2159
- /** URL-only configuration is harmless; cloud host enrollment is enabled only when its credential file is set. */
2160
- declare function resolveCloudDeviceEnrollmentConfig(env: NodeJS.ProcessEnv): CloudDeviceEnrollmentRuntimeConfig | undefined;
2161
- declare function createCloudDeviceEnrollmentConfirmer(options: CreateCloudDeviceEnrollmentConfirmerOptions): CloudDeviceEnrollmentConfirmer;
2162
- interface CreateCloudRelayDeviceEnrollmentSagaOptions {
2163
- devices: DeviceStore;
2164
- confirmer: CloudDeviceEnrollmentConfirmer;
2165
- provisioner: RelayDeviceProvisioner;
2166
- refreshAuthorization?: () => Promise<unknown>;
2167
- /** Managed Nodes must observe the newly confirmed relay actor in a fresh signed snapshot before activation. */
2168
- authorizationReady?: (actorId: string) => boolean;
2169
- now?: () => number;
2170
- }
2171
- /** The control plane has one canonical identity namespace for both direct and relay-connected browsers. */
2172
- declare function cloudDeviceEnrollmentAuthorizationReady(authorizationStore: Pick<CloudAuthorizationStore, "getActiveSnapshot">, actorId: string): boolean;
2173
- /**
2174
- * Commits a browser enrollment in three durable phases. The control plane sees only the signed device public key;
2175
- * local and relay bearer credentials stay inside the encrypted browser-to-Node channel and are persisted as hashes.
2176
- */
2177
- declare function createCloudRelayDeviceEnrollmentSaga(options: CreateCloudRelayDeviceEnrollmentSagaOptions): CloudRelayDeviceEnrollmentSaga;
2178
- interface CloudDeviceEnrollmentRecoveryLoop {
2179
- start(): void;
2180
- stop(): Promise<void>;
2181
- }
2182
- interface CreateCloudDeviceEnrollmentRecoveryLoopOptions {
2183
- saga: Pick<CloudRelayDeviceEnrollmentSaga, "recover">;
2184
- intervalMs?: number;
2185
- onResult?: (result: {
2186
- completed: number;
2187
- failed: number;
2188
- }) => void;
2189
- }
2190
- /**
2191
- * Starts one recovery attempt immediately and retries on a fixed cadence without ever overlapping attempts.
2192
- * The saga itself caps each pass and every network client it calls has a request timeout.
2193
- */
2194
- declare function createCloudDeviceEnrollmentRecoveryLoop(options: CreateCloudDeviceEnrollmentRecoveryLoopOptions): CloudDeviceEnrollmentRecoveryLoop;
2195
-
2196
- type RelayHostStatus = "idle" | "connecting" | "online" | "reconnecting" | "stopped";
2197
- interface RelayHostMetrics {
2198
- status: RelayHostStatus;
2199
- activeChannels: number;
2200
- acceptedChannels: number;
2201
- rejectedChannels: number;
2202
- completedRequests: number;
2203
- failedRequests: number;
2204
- reconnects: number;
2205
- activeTransfers: number;
2206
- completedTransfers: number;
2207
- failedTransfers: number;
2208
- streamedRequestBytes: number;
2209
- streamedResponseBytes: number;
2210
- }
2211
- interface RelayHostConnectorOptions {
2212
- relayUrl: string;
2213
- routeId: string;
2214
- hostCredential: string;
2215
- hostIdentity: RelayIdentity;
2216
- devices: DeviceStore;
2217
- dispatchRequest(token: string, request: RelayRpcRequest): Promise<RelayRpcResponse>;
2218
- openTerminal?: RelayTerminalOpener;
2219
- openHttp?: RelayHttpOpener;
2220
- WebSocketClass?: typeof WebSocket;
2221
- now?: () => number;
2222
- random?: () => number;
2223
- handshakeTimeoutMs?: number;
2224
- requestTimeoutMs?: number;
2225
- maxStreamRequestBytes?: number;
2226
- onStatus?: (status: RelayHostStatus) => void;
2227
- /** Promotes a five-minute broker bootstrap credential after the E2E pairing claim commits. */
2228
- promoteDevice?: (deviceId: string, credentialHash: string) => Promise<void>;
2229
- /** Account-driven browser enrollment over the already encrypted relay auth channel. */
2230
- cloudDeviceEnrollment?: CloudRelayDeviceEnrollmentSaga;
2231
- }
2232
- interface RelayTerminalOpenRequest {
2233
- streamId: string;
2234
- sessionId: string;
2235
- cols?: number;
2236
- rows?: number;
2237
- respawn?: "continue" | "fresh";
2238
- }
2239
- interface RelayTerminalHandlers {
2240
- onBinary(data: Uint8Array): void;
2241
- onControl(data: string): void;
2242
- onClose(code: number): void;
2243
- }
2244
- interface RelayTerminalBridge {
2245
- send(data: string): void;
2246
- close(): void;
2247
- }
2248
- type RelayTerminalOpener = (token: string, request: RelayTerminalOpenRequest, handlers: RelayTerminalHandlers) => Promise<RelayTerminalBridge>;
2249
- interface RelayHttpOpenRequest {
2250
- streamId: string;
2251
- method: RelayRpcRequest["method"];
2252
- path: string;
2253
- headers: Record<string, string>;
2254
- }
2255
- interface RelayHttpResponseHead {
2256
- status: number;
2257
- headers: Record<string, string>;
2258
- }
2259
- interface RelayHttpHandlers {
2260
- onResponse(response: RelayHttpResponseHead): void | Promise<void>;
2261
- onData(data: Uint8Array): void | Promise<void>;
2262
- onEnd(): void | Promise<void>;
2263
- onError(error: Error): void;
2264
- }
2265
- interface RelayHttpBridge {
2266
- write(data: Uint8Array): Promise<void>;
2267
- end(): void;
2268
- close(): void;
2269
- }
2270
- type RelayHttpOpener = (token: string, request: RelayHttpOpenRequest, handlers: RelayHttpHandlers) => Promise<RelayHttpBridge>;
2271
- interface RelayHostConnector {
2272
- start(): void;
2273
- stop(): Promise<void>;
2274
- waitUntilReady(timeoutMs?: number): Promise<void>;
2275
- closeDevice(deviceId: string): void;
2276
- metrics(): RelayHostMetrics;
2277
- }
2278
- declare function relayConnectUrl(raw: string): string;
2279
- declare function createRelayHostConnector(options: RelayHostConnectorOptions): RelayHostConnector;
2280
-
2281
- interface RelayHostRuntimeConfig {
2282
- relayUrl: string;
2283
- routeId: string;
2284
- hostCredential: string;
2285
- hostIdentity: RelayIdentity;
2286
- /** Static PWA origin used only for one-use remote pairing links. */
2287
- appUrl?: string;
2288
- hostLabel: string;
2289
- }
2290
- interface PersistedRelayHostConfig {
2291
- version: 1;
2292
- relayUrl: string;
2293
- routeId: string;
2294
- hostCredential: string;
2295
- appUrl?: string;
2296
- hostLabel: string;
2297
- }
2298
- type RelayHostConfigInput = Omit<PersistedRelayHostConfig, "version">;
2299
- declare function relayHostConfigPath(dataDir: string): string;
2300
- declare function readRelayHostConfig(dataDir: string): PersistedRelayHostConfig | undefined;
2301
- declare function writeRelayHostConfig(dataDir: string, input: RelayHostConfigInput): PersistedRelayHostConfig;
2302
- declare function removeRelayHostConfig(dataDir: string): boolean;
2303
- declare function resolveRelayHostConfig(env: NodeJS.ProcessEnv, dataDir: string): RelayHostRuntimeConfig | undefined;
2304
-
2305
- declare const CLOUD_AUTHORIZATION_KEYSET_SIGNATURE_DOMAIN = "roamcode-cloud-authorization-keyset-v1";
2306
- declare const CLOUD_AUTHORIZATION_KEYSET_SIGNATURE_DOMAIN_V2 = "roamcode-cloud-authorization-keyset-v2";
2307
- declare const CLOUD_AUTHORIZATION_KEYSET_PATH = "/api/v1/meta/authorization-keyset";
2308
- declare const CLOUD_KEYSET_CLOCK_SKEW_MS: number;
2309
- declare const CloudAuthorizationKeysetKeyV1Schema: z.ZodObject<{
2310
- keyId: z.ZodString;
2311
- algorithm: z.ZodLiteral<"Ed25519">;
2312
- publicKey: z.ZodString;
2313
- notBefore: z.ZodNumber;
2314
- notAfter: z.ZodNullable<z.ZodNumber>;
2315
- status: z.ZodEnum<{
2316
- current: "current";
2317
- previous: "previous";
2318
- }>;
2319
- }, z.core.$strict>;
2320
- declare const CloudAuthorizationKeysetKeyV2Schema: z.ZodObject<{
2321
- keyId: z.ZodString;
2322
- algorithm: z.ZodLiteral<"Ed25519-SHA256">;
2323
- publicKey: z.ZodString;
2324
- notBefore: z.ZodNumber;
2325
- notAfter: z.ZodNullable<z.ZodNumber>;
2326
- status: z.ZodEnum<{
2327
- current: "current";
2328
- previous: "previous";
2329
- }>;
2330
- }, z.core.$strict>;
2331
- declare const CloudAuthorizationKeysetV1Schema: z.ZodObject<{
2332
- v: z.ZodLiteral<1>;
2333
- kind: z.ZodLiteral<"authorization-keyset">;
2334
- issuedAt: z.ZodNumber;
2335
- expiresAt: z.ZodNumber;
2336
- keys: z.ZodArray<z.ZodObject<{
2337
- keyId: z.ZodString;
2338
- algorithm: z.ZodLiteral<"Ed25519">;
2339
- publicKey: z.ZodString;
2340
- notBefore: z.ZodNumber;
2341
- notAfter: z.ZodNullable<z.ZodNumber>;
2342
- status: z.ZodEnum<{
2343
- current: "current";
2344
- previous: "previous";
2345
- }>;
2346
- }, z.core.$strict>>;
2347
- }, z.core.$strict>;
2348
- declare const CloudAuthorizationKeysetV2Schema: z.ZodObject<{
2349
- v: z.ZodLiteral<2>;
2350
- kind: z.ZodLiteral<"authorization-keyset">;
2351
- issuedAt: z.ZodNumber;
2352
- expiresAt: z.ZodNumber;
2353
- keys: z.ZodArray<z.ZodObject<{
2354
- keyId: z.ZodString;
2355
- algorithm: z.ZodLiteral<"Ed25519-SHA256">;
2356
- publicKey: z.ZodString;
2357
- notBefore: z.ZodNumber;
2358
- notAfter: z.ZodNullable<z.ZodNumber>;
2359
- status: z.ZodEnum<{
2360
- current: "current";
2361
- previous: "previous";
2362
- }>;
2363
- }, z.core.$strict>>;
2364
- }, z.core.$strict>;
2365
- declare const CloudAuthorizationKeysetSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
2366
- v: z.ZodLiteral<1>;
2367
- kind: z.ZodLiteral<"authorization-keyset">;
2368
- issuedAt: z.ZodNumber;
2369
- expiresAt: z.ZodNumber;
2370
- keys: z.ZodArray<z.ZodObject<{
2371
- keyId: z.ZodString;
2372
- algorithm: z.ZodLiteral<"Ed25519">;
2373
- publicKey: z.ZodString;
2374
- notBefore: z.ZodNumber;
2375
- notAfter: z.ZodNullable<z.ZodNumber>;
2376
- status: z.ZodEnum<{
2377
- current: "current";
2378
- previous: "previous";
2379
- }>;
2380
- }, z.core.$strict>>;
2381
- }, z.core.$strict>, z.ZodObject<{
2382
- v: z.ZodLiteral<2>;
2383
- kind: z.ZodLiteral<"authorization-keyset">;
2384
- issuedAt: z.ZodNumber;
2385
- expiresAt: z.ZodNumber;
2386
- keys: z.ZodArray<z.ZodObject<{
2387
- keyId: z.ZodString;
2388
- algorithm: z.ZodLiteral<"Ed25519-SHA256">;
2389
- publicKey: z.ZodString;
2390
- notBefore: z.ZodNumber;
2391
- notAfter: z.ZodNullable<z.ZodNumber>;
2392
- status: z.ZodEnum<{
2393
- current: "current";
2394
- previous: "previous";
2395
- }>;
2396
- }, z.core.$strict>>;
2397
- }, z.core.$strict>], "v">;
2398
- declare const SignedCloudAuthorizationKeysetSignatureV1Schema: z.ZodObject<{
2399
- keyId: z.ZodString;
2400
- algorithm: z.ZodLiteral<"Ed25519">;
2401
- signature: z.ZodString;
2402
- }, z.core.$strict>;
2403
- declare const SignedCloudAuthorizationKeysetSignatureV2Schema: z.ZodObject<{
2404
- keyId: z.ZodString;
2405
- algorithm: z.ZodLiteral<"Ed25519-SHA256">;
2406
- signature: z.ZodString;
2407
- }, z.core.$strict>;
2408
- declare const SignedCloudAuthorizationKeysetV1Schema: z.ZodObject<{
2409
- v: z.ZodLiteral<1>;
2410
- kind: z.ZodLiteral<"signed-authorization-keyset">;
2411
- keyset: z.ZodObject<{
2412
- v: z.ZodLiteral<1>;
2413
- kind: z.ZodLiteral<"authorization-keyset">;
2414
- issuedAt: z.ZodNumber;
2415
- expiresAt: z.ZodNumber;
2416
- keys: z.ZodArray<z.ZodObject<{
2417
- keyId: z.ZodString;
2418
- algorithm: z.ZodLiteral<"Ed25519">;
2419
- publicKey: z.ZodString;
2420
- notBefore: z.ZodNumber;
2421
- notAfter: z.ZodNullable<z.ZodNumber>;
2422
- status: z.ZodEnum<{
2423
- current: "current";
2424
- previous: "previous";
2425
- }>;
2426
- }, z.core.$strict>>;
2427
- }, z.core.$strict>;
2428
- signatures: z.ZodArray<z.ZodObject<{
2429
- keyId: z.ZodString;
2430
- algorithm: z.ZodLiteral<"Ed25519">;
2431
- signature: z.ZodString;
2432
- }, z.core.$strict>>;
2433
- }, z.core.$strict>;
2434
- declare const SignedCloudAuthorizationKeysetV2Schema: z.ZodObject<{
2435
- v: z.ZodLiteral<2>;
2436
- kind: z.ZodLiteral<"signed-authorization-keyset">;
2437
- keyset: z.ZodObject<{
2438
- v: z.ZodLiteral<2>;
2439
- kind: z.ZodLiteral<"authorization-keyset">;
2440
- issuedAt: z.ZodNumber;
2441
- expiresAt: z.ZodNumber;
2442
- keys: z.ZodArray<z.ZodObject<{
2443
- keyId: z.ZodString;
2444
- algorithm: z.ZodLiteral<"Ed25519-SHA256">;
2445
- publicKey: z.ZodString;
2446
- notBefore: z.ZodNumber;
2447
- notAfter: z.ZodNullable<z.ZodNumber>;
2448
- status: z.ZodEnum<{
2449
- current: "current";
2450
- previous: "previous";
2451
- }>;
2452
- }, z.core.$strict>>;
2453
- }, z.core.$strict>;
2454
- signatures: z.ZodArray<z.ZodObject<{
2455
- keyId: z.ZodString;
2456
- algorithm: z.ZodLiteral<"Ed25519-SHA256">;
2457
- signature: z.ZodString;
2458
- }, z.core.$strict>>;
2459
- }, z.core.$strict>;
2460
- declare const SignedCloudAuthorizationKeysetSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
2461
- v: z.ZodLiteral<1>;
2462
- kind: z.ZodLiteral<"signed-authorization-keyset">;
2463
- keyset: z.ZodObject<{
2464
- v: z.ZodLiteral<1>;
2465
- kind: z.ZodLiteral<"authorization-keyset">;
2466
- issuedAt: z.ZodNumber;
2467
- expiresAt: z.ZodNumber;
2468
- keys: z.ZodArray<z.ZodObject<{
2469
- keyId: z.ZodString;
2470
- algorithm: z.ZodLiteral<"Ed25519">;
2471
- publicKey: z.ZodString;
2472
- notBefore: z.ZodNumber;
2473
- notAfter: z.ZodNullable<z.ZodNumber>;
2474
- status: z.ZodEnum<{
2475
- current: "current";
2476
- previous: "previous";
2477
- }>;
2478
- }, z.core.$strict>>;
2479
- }, z.core.$strict>;
2480
- signatures: z.ZodArray<z.ZodObject<{
2481
- keyId: z.ZodString;
2482
- algorithm: z.ZodLiteral<"Ed25519">;
2483
- signature: z.ZodString;
2484
- }, z.core.$strict>>;
2485
- }, z.core.$strict>, z.ZodObject<{
2486
- v: z.ZodLiteral<2>;
2487
- kind: z.ZodLiteral<"signed-authorization-keyset">;
2488
- keyset: z.ZodObject<{
2489
- v: z.ZodLiteral<2>;
2490
- kind: z.ZodLiteral<"authorization-keyset">;
2491
- issuedAt: z.ZodNumber;
2492
- expiresAt: z.ZodNumber;
2493
- keys: z.ZodArray<z.ZodObject<{
2494
- keyId: z.ZodString;
2495
- algorithm: z.ZodLiteral<"Ed25519-SHA256">;
2496
- publicKey: z.ZodString;
2497
- notBefore: z.ZodNumber;
2498
- notAfter: z.ZodNullable<z.ZodNumber>;
2499
- status: z.ZodEnum<{
2500
- current: "current";
2501
- previous: "previous";
2502
- }>;
2503
- }, z.core.$strict>>;
2504
- }, z.core.$strict>;
2505
- signatures: z.ZodArray<z.ZodObject<{
2506
- keyId: z.ZodString;
2507
- algorithm: z.ZodLiteral<"Ed25519-SHA256">;
2508
- signature: z.ZodString;
2509
- }, z.core.$strict>>;
2510
- }, z.core.$strict>], "v">;
2511
- type CloudAuthorizationKeysetKeyV1 = z.infer<typeof CloudAuthorizationKeysetKeyV1Schema>;
2512
- type CloudAuthorizationKeysetKeyV2 = z.infer<typeof CloudAuthorizationKeysetKeyV2Schema>;
2513
- type CloudAuthorizationKeysetKey = CloudAuthorizationKeysetKeyV1 | CloudAuthorizationKeysetKeyV2;
2514
- type CloudAuthorizationKeysetV1 = z.infer<typeof CloudAuthorizationKeysetV1Schema>;
2515
- type CloudAuthorizationKeysetV2 = z.infer<typeof CloudAuthorizationKeysetV2Schema>;
2516
- type CloudAuthorizationKeyset = z.infer<typeof CloudAuthorizationKeysetSchema>;
2517
- type SignedCloudAuthorizationKeysetV1 = z.infer<typeof SignedCloudAuthorizationKeysetV1Schema>;
2518
- type SignedCloudAuthorizationKeysetV2 = z.infer<typeof SignedCloudAuthorizationKeysetV2Schema>;
2519
- type SignedCloudAuthorizationKeyset = z.infer<typeof SignedCloudAuthorizationKeysetSchema>;
2520
- type CloudKeysetVerificationErrorCode = "INVALID_KEYSET" | "INVALID_PINNED_KEY" | "ISSUED_IN_FUTURE" | "EXPIRED" | "PIN_EXPIRED" | "UNTRUSTED_ROTATION" | "KEYSET_ROLLBACK";
2521
- declare class CloudKeysetVerificationError extends Error {
2522
- readonly code: CloudKeysetVerificationErrorCode;
2523
- constructor(code: CloudKeysetVerificationErrorCode);
2524
- }
2525
- declare function parseCloudAuthorizationKeyset(value: unknown): CloudAuthorizationKeyset;
2526
- declare function cloudAuthorizationKeysetSigningPayload(keyset: unknown): Buffer;
2527
- declare function cloudAuthorizationTrustedKeysFromKeyset(value: unknown): readonly CloudAuthorizationTrustedKey[];
2528
- declare function verifySignedCloudAuthorizationKeyset(value: unknown, pinnedKeysetValue: unknown, now?: number, clockSkewMs?: number): SignedCloudAuthorizationKeyset;
2529
-
2530
- declare const CLOUD_HOST_CONFIG_FILE = "cloud-host.json";
2531
- declare const CloudHostConfigV1Schema: z.ZodPipe<z.ZodObject<{
2532
- v: z.ZodLiteral<1>;
2533
- kind: z.ZodLiteral<"roamcode-cloud-host-config">;
2534
- organizationId: z.ZodUUID;
2535
- hostId: z.ZodUUID;
2536
- controlPlaneOrigin: z.ZodString;
2537
- hostCredential: z.ZodString;
2538
- authorization: z.ZodObject<{
2539
- algorithm: z.ZodLiteral<"Ed25519">;
2540
- signatureDomain: z.ZodLiteral<"roamcode-cloud-authorization-snapshot-v1">;
2541
- keysetSignatureDomain: z.ZodLiteral<"roamcode-cloud-authorization-keyset-v1">;
2542
- keyset: z.ZodObject<{
2543
- v: z.ZodLiteral<1>;
2544
- kind: z.ZodLiteral<"authorization-keyset">;
2545
- issuedAt: z.ZodNumber;
2546
- expiresAt: z.ZodNumber;
2547
- keys: z.ZodArray<z.ZodObject<{
2548
- keyId: z.ZodString;
2549
- algorithm: z.ZodLiteral<"Ed25519">;
2550
- publicKey: z.ZodString;
2551
- notBefore: z.ZodNumber;
2552
- notAfter: z.ZodNullable<z.ZodNumber>;
2553
- status: z.ZodEnum<{
2554
- current: "current";
2555
- previous: "previous";
2556
- }>;
2557
- }, z.core.$strict>>;
2558
- }, z.core.$strict>;
2559
- }, z.core.$strict>;
2560
- heartbeatIntervalSeconds: z.ZodNumber;
2561
- authorizationRefreshIntervalSeconds: z.ZodNumber;
2562
- }, z.core.$strict>, z.ZodTransform<{
2563
- controlPlaneOrigin: string;
2564
- v: 1;
2565
- kind: "roamcode-cloud-host-config";
2566
- organizationId: string;
2567
- hostId: string;
2568
- hostCredential: string;
2569
- authorization: {
2570
- algorithm: "Ed25519";
2571
- signatureDomain: "roamcode-cloud-authorization-snapshot-v1";
2572
- keysetSignatureDomain: "roamcode-cloud-authorization-keyset-v1";
2573
- keyset: {
2574
- v: 1;
2575
- kind: "authorization-keyset";
2576
- issuedAt: number;
2577
- expiresAt: number;
2578
- keys: {
2579
- keyId: string;
2580
- algorithm: "Ed25519";
2581
- publicKey: string;
2582
- notBefore: number;
2583
- notAfter: number | null;
2584
- status: "current" | "previous";
2585
- }[];
2586
- };
2587
- };
2588
- heartbeatIntervalSeconds: number;
2589
- authorizationRefreshIntervalSeconds: number;
2590
- }, {
2591
- v: 1;
2592
- kind: "roamcode-cloud-host-config";
2593
- organizationId: string;
2594
- hostId: string;
2595
- controlPlaneOrigin: string;
2596
- hostCredential: string;
2597
- authorization: {
2598
- algorithm: "Ed25519";
2599
- signatureDomain: "roamcode-cloud-authorization-snapshot-v1";
2600
- keysetSignatureDomain: "roamcode-cloud-authorization-keyset-v1";
2601
- keyset: {
2602
- v: 1;
2603
- kind: "authorization-keyset";
2604
- issuedAt: number;
2605
- expiresAt: number;
2606
- keys: {
2607
- keyId: string;
2608
- algorithm: "Ed25519";
2609
- publicKey: string;
2610
- notBefore: number;
2611
- notAfter: number | null;
2612
- status: "current" | "previous";
2613
- }[];
2614
- };
2615
- };
2616
- heartbeatIntervalSeconds: number;
2617
- authorizationRefreshIntervalSeconds: number;
2618
- }>>;
2619
- declare const CloudHostConfigV2Schema: z.ZodPipe<z.ZodObject<{
2620
- v: z.ZodLiteral<2>;
2621
- kind: z.ZodLiteral<"roamcode-cloud-host-config">;
2622
- organizationId: z.ZodUUID;
2623
- hostId: z.ZodUUID;
2624
- controlPlaneOrigin: z.ZodString;
2625
- hostCredential: z.ZodString;
2626
- authorization: z.ZodObject<{
2627
- algorithm: z.ZodLiteral<"Ed25519-SHA256">;
2628
- signatureDomain: z.ZodLiteral<"roamcode-cloud-authorization-snapshot-v2">;
2629
- keysetSignatureDomain: z.ZodLiteral<"roamcode-cloud-authorization-keyset-v2">;
2630
- keyset: z.ZodObject<{
2631
- v: z.ZodLiteral<2>;
2632
- kind: z.ZodLiteral<"authorization-keyset">;
2633
- issuedAt: z.ZodNumber;
2634
- expiresAt: z.ZodNumber;
2635
- keys: z.ZodArray<z.ZodObject<{
2636
- keyId: z.ZodString;
2637
- algorithm: z.ZodLiteral<"Ed25519-SHA256">;
2638
- publicKey: z.ZodString;
2639
- notBefore: z.ZodNumber;
2640
- notAfter: z.ZodNullable<z.ZodNumber>;
2641
- status: z.ZodEnum<{
2642
- current: "current";
2643
- previous: "previous";
2644
- }>;
2645
- }, z.core.$strict>>;
2646
- }, z.core.$strict>;
2647
- }, z.core.$strict>;
2648
- heartbeatIntervalSeconds: z.ZodNumber;
2649
- authorizationRefreshIntervalSeconds: z.ZodNumber;
2650
- }, z.core.$strict>, z.ZodTransform<{
2651
- controlPlaneOrigin: string;
2652
- v: 2;
2653
- kind: "roamcode-cloud-host-config";
2654
- organizationId: string;
2655
- hostId: string;
2656
- hostCredential: string;
2657
- authorization: {
2658
- algorithm: "Ed25519-SHA256";
2659
- signatureDomain: "roamcode-cloud-authorization-snapshot-v2";
2660
- keysetSignatureDomain: "roamcode-cloud-authorization-keyset-v2";
2661
- keyset: {
2662
- v: 2;
2663
- kind: "authorization-keyset";
2664
- issuedAt: number;
2665
- expiresAt: number;
2666
- keys: {
2667
- keyId: string;
2668
- algorithm: "Ed25519-SHA256";
2669
- publicKey: string;
2670
- notBefore: number;
2671
- notAfter: number | null;
2672
- status: "current" | "previous";
2673
- }[];
2674
- };
2675
- };
2676
- heartbeatIntervalSeconds: number;
2677
- authorizationRefreshIntervalSeconds: number;
2678
- }, {
2679
- v: 2;
2680
- kind: "roamcode-cloud-host-config";
2681
- organizationId: string;
2682
- hostId: string;
2683
- controlPlaneOrigin: string;
2684
- hostCredential: string;
2685
- authorization: {
2686
- algorithm: "Ed25519-SHA256";
2687
- signatureDomain: "roamcode-cloud-authorization-snapshot-v2";
2688
- keysetSignatureDomain: "roamcode-cloud-authorization-keyset-v2";
2689
- keyset: {
2690
- v: 2;
2691
- kind: "authorization-keyset";
2692
- issuedAt: number;
2693
- expiresAt: number;
2694
- keys: {
2695
- keyId: string;
2696
- algorithm: "Ed25519-SHA256";
2697
- publicKey: string;
2698
- notBefore: number;
2699
- notAfter: number | null;
2700
- status: "current" | "previous";
2701
- }[];
2702
- };
2703
- };
2704
- heartbeatIntervalSeconds: number;
2705
- authorizationRefreshIntervalSeconds: number;
2706
- }>>;
2707
- declare const CloudHostConfigSchema: z.ZodUnion<readonly [z.ZodPipe<z.ZodObject<{
2708
- v: z.ZodLiteral<1>;
2709
- kind: z.ZodLiteral<"roamcode-cloud-host-config">;
2710
- organizationId: z.ZodUUID;
2711
- hostId: z.ZodUUID;
2712
- controlPlaneOrigin: z.ZodString;
2713
- hostCredential: z.ZodString;
2714
- authorization: z.ZodObject<{
2715
- algorithm: z.ZodLiteral<"Ed25519">;
2716
- signatureDomain: z.ZodLiteral<"roamcode-cloud-authorization-snapshot-v1">;
2717
- keysetSignatureDomain: z.ZodLiteral<"roamcode-cloud-authorization-keyset-v1">;
2718
- keyset: z.ZodObject<{
2719
- v: z.ZodLiteral<1>;
2720
- kind: z.ZodLiteral<"authorization-keyset">;
2721
- issuedAt: z.ZodNumber;
2722
- expiresAt: z.ZodNumber;
2723
- keys: z.ZodArray<z.ZodObject<{
2724
- keyId: z.ZodString;
2725
- algorithm: z.ZodLiteral<"Ed25519">;
2726
- publicKey: z.ZodString;
2727
- notBefore: z.ZodNumber;
2728
- notAfter: z.ZodNullable<z.ZodNumber>;
2729
- status: z.ZodEnum<{
2730
- current: "current";
2731
- previous: "previous";
2732
- }>;
2733
- }, z.core.$strict>>;
2734
- }, z.core.$strict>;
2735
- }, z.core.$strict>;
2736
- heartbeatIntervalSeconds: z.ZodNumber;
2737
- authorizationRefreshIntervalSeconds: z.ZodNumber;
2738
- }, z.core.$strict>, z.ZodTransform<{
2739
- controlPlaneOrigin: string;
2740
- v: 1;
2741
- kind: "roamcode-cloud-host-config";
2742
- organizationId: string;
2743
- hostId: string;
2744
- hostCredential: string;
2745
- authorization: {
2746
- algorithm: "Ed25519";
2747
- signatureDomain: "roamcode-cloud-authorization-snapshot-v1";
2748
- keysetSignatureDomain: "roamcode-cloud-authorization-keyset-v1";
2749
- keyset: {
2750
- v: 1;
2751
- kind: "authorization-keyset";
2752
- issuedAt: number;
2753
- expiresAt: number;
2754
- keys: {
2755
- keyId: string;
2756
- algorithm: "Ed25519";
2757
- publicKey: string;
2758
- notBefore: number;
2759
- notAfter: number | null;
2760
- status: "current" | "previous";
2761
- }[];
2762
- };
2763
- };
2764
- heartbeatIntervalSeconds: number;
2765
- authorizationRefreshIntervalSeconds: number;
2766
- }, {
2767
- v: 1;
2768
- kind: "roamcode-cloud-host-config";
2769
- organizationId: string;
2770
- hostId: string;
2771
- controlPlaneOrigin: string;
2772
- hostCredential: string;
2773
- authorization: {
2774
- algorithm: "Ed25519";
2775
- signatureDomain: "roamcode-cloud-authorization-snapshot-v1";
2776
- keysetSignatureDomain: "roamcode-cloud-authorization-keyset-v1";
2777
- keyset: {
2778
- v: 1;
2779
- kind: "authorization-keyset";
2780
- issuedAt: number;
2781
- expiresAt: number;
2782
- keys: {
2783
- keyId: string;
2784
- algorithm: "Ed25519";
2785
- publicKey: string;
2786
- notBefore: number;
2787
- notAfter: number | null;
2788
- status: "current" | "previous";
2789
- }[];
2790
- };
2791
- };
2792
- heartbeatIntervalSeconds: number;
2793
- authorizationRefreshIntervalSeconds: number;
2794
- }>>, z.ZodPipe<z.ZodObject<{
2795
- v: z.ZodLiteral<2>;
2796
- kind: z.ZodLiteral<"roamcode-cloud-host-config">;
2797
- organizationId: z.ZodUUID;
2798
- hostId: z.ZodUUID;
2799
- controlPlaneOrigin: z.ZodString;
2800
- hostCredential: z.ZodString;
2801
- authorization: z.ZodObject<{
2802
- algorithm: z.ZodLiteral<"Ed25519-SHA256">;
2803
- signatureDomain: z.ZodLiteral<"roamcode-cloud-authorization-snapshot-v2">;
2804
- keysetSignatureDomain: z.ZodLiteral<"roamcode-cloud-authorization-keyset-v2">;
2805
- keyset: z.ZodObject<{
2806
- v: z.ZodLiteral<2>;
2807
- kind: z.ZodLiteral<"authorization-keyset">;
2808
- issuedAt: z.ZodNumber;
2809
- expiresAt: z.ZodNumber;
2810
- keys: z.ZodArray<z.ZodObject<{
2811
- keyId: z.ZodString;
2812
- algorithm: z.ZodLiteral<"Ed25519-SHA256">;
2813
- publicKey: z.ZodString;
2814
- notBefore: z.ZodNumber;
2815
- notAfter: z.ZodNullable<z.ZodNumber>;
2816
- status: z.ZodEnum<{
2817
- current: "current";
2818
- previous: "previous";
2819
- }>;
2820
- }, z.core.$strict>>;
2821
- }, z.core.$strict>;
2822
- }, z.core.$strict>;
2823
- heartbeatIntervalSeconds: z.ZodNumber;
2824
- authorizationRefreshIntervalSeconds: z.ZodNumber;
2825
- }, z.core.$strict>, z.ZodTransform<{
2826
- controlPlaneOrigin: string;
2827
- v: 2;
2828
- kind: "roamcode-cloud-host-config";
2829
- organizationId: string;
2830
- hostId: string;
2831
- hostCredential: string;
2832
- authorization: {
2833
- algorithm: "Ed25519-SHA256";
2834
- signatureDomain: "roamcode-cloud-authorization-snapshot-v2";
2835
- keysetSignatureDomain: "roamcode-cloud-authorization-keyset-v2";
2836
- keyset: {
2837
- v: 2;
2838
- kind: "authorization-keyset";
2839
- issuedAt: number;
2840
- expiresAt: number;
2841
- keys: {
2842
- keyId: string;
2843
- algorithm: "Ed25519-SHA256";
2844
- publicKey: string;
2845
- notBefore: number;
2846
- notAfter: number | null;
2847
- status: "current" | "previous";
2848
- }[];
2849
- };
2850
- };
2851
- heartbeatIntervalSeconds: number;
2852
- authorizationRefreshIntervalSeconds: number;
2853
- }, {
2854
- v: 2;
2855
- kind: "roamcode-cloud-host-config";
2856
- organizationId: string;
2857
- hostId: string;
2858
- controlPlaneOrigin: string;
2859
- hostCredential: string;
2860
- authorization: {
2861
- algorithm: "Ed25519-SHA256";
2862
- signatureDomain: "roamcode-cloud-authorization-snapshot-v2";
2863
- keysetSignatureDomain: "roamcode-cloud-authorization-keyset-v2";
2864
- keyset: {
2865
- v: 2;
2866
- kind: "authorization-keyset";
2867
- issuedAt: number;
2868
- expiresAt: number;
2869
- keys: {
2870
- keyId: string;
2871
- algorithm: "Ed25519-SHA256";
2872
- publicKey: string;
2873
- notBefore: number;
2874
- notAfter: number | null;
2875
- status: "current" | "previous";
2876
- }[];
2877
- };
2878
- };
2879
- heartbeatIntervalSeconds: number;
2880
- authorizationRefreshIntervalSeconds: number;
2881
- }>>]>;
2882
- type CloudHostConfigV1 = z.output<typeof CloudHostConfigV1Schema>;
2883
- type CloudHostConfigV2 = z.output<typeof CloudHostConfigV2Schema>;
2884
- type CloudHostConfig = z.output<typeof CloudHostConfigSchema>;
2885
- interface ResolvedCloudHostConfig {
2886
- path: string;
2887
- config: CloudHostConfig;
2888
- }
2889
- declare function cloudHostConfigPath(dataDir: string): string;
2890
- declare function readCloudHostConfig(path: string): CloudHostConfig | undefined;
2891
- declare function writeCloudHostConfig(path: string, value: unknown): CloudHostConfig;
2892
- /** Remove a managed host configuration without following links or deleting an unowned file. */
2893
- declare function removeCloudHostConfig(path: string): boolean;
2894
- declare function replaceCloudHostAuthorizationKeyset(path: string, current: CloudHostConfig, keyset: CloudAuthorizationKeyset): CloudHostConfig;
2895
- declare function resolveCloudHostConfig(env: NodeJS.ProcessEnv, dataDir: string): ResolvedCloudHostConfig | undefined;
2896
-
2897
- declare const CLOUD_HOST_HEARTBEAT_PATH = "/api/v1/hosts/heartbeat";
2898
- declare const CLOUD_HOST_AUTOMATION_SYNC_PATH = "/api/v1/hosts/automation-sync";
2899
- declare const CLOUD_HOST_AUTHORIZATION_SNAPSHOT_PATH = "/api/v1/hosts/authorization-snapshot";
2900
- declare const CLOUD_HOST_MAX_SIGNED_RESPONSE_BYTES: number;
2901
- interface CloudHostRuntimeStatus {
2902
- running: boolean;
2903
- heartbeatFailures: number;
2904
- authorizationFailures: number;
2905
- automationFailures: number;
2906
- authorizationIssue?: CloudHostAuthorizationIssue;
2907
- lastHeartbeatAt?: number;
2908
- lastAuthorizationAt?: number;
2909
- authorization: CloudAuthorizationState;
2910
- }
2911
- type CloudHostAuthorizationIssue = "connectivity" | "credential-rejected" | "invalid-control-plane-response" | "authorization-verification-failed" | "trust-expired";
2912
- interface CloudHostRuntime {
2913
- start(): void;
2914
- stop(): Promise<void>;
2915
- sendHeartbeat(state?: "ready" | "draining"): Promise<void>;
2916
- refreshAuthorizationKeyset(): Promise<boolean>;
2917
- refreshAuthorizationSnapshot(): Promise<number>;
2918
- syncAuthorization(): Promise<number>;
2919
- /** Waits out an older in-flight poll, then starts a snapshot request from the resulting durable revision. */
2920
- syncAuthorizationFresh(): Promise<number>;
2921
- status(): CloudHostRuntimeStatus;
2922
- }
2923
- interface CreateCloudHostRuntimeOptions {
2924
- config: CloudHostConfig;
2925
- authorizationStore: CloudAuthorizationStore;
2926
- instanceId: string;
2927
- softwareVersion: string;
2928
- capabilities: readonly string[] | (() => readonly string[]);
2929
- automationWebhooks?: readonly CloudAutomationWebhookRegistration[] | (() => readonly CloudAutomationWebhookRegistration[]);
2930
- onAutomationInvocation?: (invocation: CloudAutomationInvocation) => Promise<void>;
2931
- /** Stable P-256 host identity advertised for browser enrollment pinning; private key never leaves this Node. */
2932
- relayHostIdentity?: CloudRelayHostIdentity;
2933
- /** Called only after a signed rotation verifies against the currently pinned keyset. Must persist atomically. */
2934
- replaceAuthorizationKeyset: (keyset: CloudAuthorizationKeyset) => void;
2935
- fetch?: typeof globalThis.fetch;
2936
- now?: () => number;
2937
- random?: () => number;
2938
- requestTimeoutMs?: number;
2939
- setTimeout?: typeof globalThis.setTimeout;
2940
- clearTimeout?: typeof globalThis.clearTimeout;
2941
- }
2942
- type CloudHostRuntimeErrorCode = "UNAVAILABLE" | "REJECTED" | "INVALID_RESPONSE" | "KEYSET_REPLAY";
2943
- declare class CloudHostRuntimeError extends Error {
2944
- readonly code: CloudHostRuntimeErrorCode;
2945
- readonly retryable: boolean;
2946
- constructor(code: CloudHostRuntimeErrorCode, retryable: boolean);
2947
- }
2948
- declare function createCloudHostRuntime(options: CreateCloudHostRuntimeOptions): CloudHostRuntime;
2949
-
2950
- type CompositeAuthorizationReason = TeamAuthorizationDecision["reason"] | CloudAuthorizationDecision["reason"];
2951
- interface CompositeAuthorizationDecision {
2952
- allowed: boolean;
2953
- reason: CompositeAuthorizationReason;
2954
- source: "local" | "team" | "cloud";
2955
- roles: TeamRole[];
2956
- member?: TeamMember;
2957
- cloudRevision?: number;
2958
- }
2959
- interface CompositeAuthorizer {
2960
- authorize(actorType: TeamPrincipalType, actorId: string, permission: TeamPermission, resource?: TeamAuthorizationResource): CompositeAuthorizationDecision;
2961
- }
2962
- interface CreateCompositeAuthorizerOptions {
2963
- teamStore: TeamStore;
2964
- /** Omit for self-hosted mode; presence makes a valid cloud grant an additional requirement for remote actors. */
2965
- cloudStore?: CloudAuthorizationStore;
2966
- /**
2967
- * The managed control plane may assign the same physical Node a cloud Host id that differs from the
2968
- * command-center store's local Host id. TeamStore must continue authorizing against the local id while the
2969
- * signed cloud snapshot must see its own target id, so translate only the cloud layer at this composition
2970
- * boundary instead of leaking a connection alias into every local resource.
2971
- */
2972
- cloudHostId?: string;
2973
- /** Persisted managed ownership without a usable cloud store remains fail-closed for every remote actor. */
2974
- requireCloud?: boolean;
2975
- now?: () => number;
2976
- }
2977
- /**
2978
- * Composes cloud grants with the existing local TeamStore policy. Self-hosted callers keep TeamStore behavior
2979
- * exactly; cloud-managed callers must pass both layers. Host and local recovery principals never depend on cloud
2980
- * availability, so an expired or unreachable control plane cannot lock an operator out of their own machine.
2981
- */
2982
- declare function createCompositeAuthorizer(options: CreateCompositeAuthorizerOptions): CompositeAuthorizer;
2983
-
2984
- interface LoopbackRelayTerminalOptions {
2985
- baseUrl(): string | undefined;
2986
- issueTicket(token: string): Promise<string>;
2987
- WebSocketClass?: typeof WebSocket;
2988
- openTimeoutMs?: number;
1008
+ interface AuthorizationDecision extends TeamAuthorizationDecision {
1009
+ source: "local" | "team";
2989
1010
  }
2990
- declare function createLoopbackRelayTerminalOpener(options: LoopbackRelayTerminalOptions): RelayTerminalOpener;
2991
-
2992
- interface LoopbackRelayHttpOptions {
2993
- baseUrl(): string | undefined;
2994
- headers(token: string, requestHeaders: Record<string, string>): Record<string, string>;
2995
- idleTimeoutMs?: number;
1011
+ interface Authorizer {
1012
+ authorize(actorType: TeamPrincipalType, actorId: string, permission: TeamPermission, resource?: TeamAuthorizationResource): AuthorizationDecision;
2996
1013
  }
2997
- /**
2998
- * Streams an authenticated relay request through the real loopback HTTP server. This deliberately traverses
2999
- * the normal auth, RBAC, rate-limit, idempotency, audit, multipart, and route hooks instead of calling file
3000
- * services out of band.
3001
- */
3002
- declare function createLoopbackRelayHttpOpener(options: LoopbackRelayHttpOptions): RelayHttpOpener;
3003
-
3004
- declare const RELAY_WIRE_PROTOCOL_VERSION: 1;
3005
- declare const RELAY_WIRE_MAX_ENVELOPE_BYTES = 1400000;
3006
- type RelayWireEnvelope = {
3007
- v: 1;
3008
- t: "device-hello";
3009
- hello: RelayHandshakeHello;
3010
- identityPublicKey?: string;
3011
- } | {
3012
- v: 1;
3013
- t: "host-hello";
3014
- hello: RelayHandshakeHello;
3015
- } | {
3016
- v: 1;
3017
- t: "cipher";
3018
- frame: RelayEncryptedFrame;
3019
- };
3020
- declare function encodeRelayWireEnvelope(envelope: RelayWireEnvelope): string;
3021
- declare function decodeRelayWireEnvelope(payload: unknown): RelayWireEnvelope;
1014
+ /** Standalone authorization is owned entirely by the local durable TeamStore. */
1015
+ declare function createTeamAuthorizer(teamStore: TeamStore): Authorizer;
3022
1016
 
3023
1017
  type PolicyStoreMode = "sqlite" | "memory-fallback";
3024
1018
  type ExtensionPolicyMode = "allow-integrity" | "signed-only" | "deny";
@@ -3031,7 +1025,6 @@ interface EnterprisePolicy {
3031
1025
  allowDangerousProviderModes: boolean;
3032
1026
  allowFileTransfer: boolean;
3033
1027
  extensionMode: ExtensionPolicyMode;
3034
- allowRelay: boolean;
3035
1028
  updateMode: UpdatePolicyMode;
3036
1029
  revision: number;
3037
1030
  createdAt: number;
@@ -3045,10 +1038,9 @@ interface EnterprisePolicyUpdate {
3045
1038
  allowDangerousProviderModes?: boolean;
3046
1039
  allowFileTransfer?: boolean;
3047
1040
  extensionMode?: ExtensionPolicyMode;
3048
- allowRelay?: boolean;
3049
1041
  updateMode?: UpdatePolicyMode;
3050
1042
  }
3051
- type EnterprisePolicyAction = "access" | "session.launch" | "file.transfer" | "extension.mutate" | "relay.access" | "update.mutate";
1043
+ type EnterprisePolicyAction = "access" | "session.launch" | "file.transfer" | "extension.mutate" | "update.mutate";
3052
1044
  interface EnterprisePolicyContext {
3053
1045
  hostId: string;
3054
1046
  workspaceId?: string;
@@ -3059,7 +1051,7 @@ interface EnterprisePolicyContext {
3059
1051
  }
3060
1052
  interface EnterprisePolicyDecision {
3061
1053
  allowed: boolean;
3062
- reason: "not-enforced" | "allowed" | "host-denied" | "workspace-denied" | "provider-denied" | "dangerous-mode-denied" | "file-transfer-denied" | "extension-denied" | "extension-signature-required" | "relay-denied" | "updates-denied" | "update-channel-denied";
1054
+ reason: "not-enforced" | "allowed" | "host-denied" | "workspace-denied" | "provider-denied" | "dangerous-mode-denied" | "file-transfer-denied" | "extension-denied" | "extension-signature-required" | "updates-denied" | "update-channel-denied";
3063
1055
  }
3064
1056
  interface PolicyStore {
3065
1057
  readonly mode: PolicyStoreMode;
@@ -3883,7 +1875,7 @@ interface ProductContext {
3883
1875
  name: string;
3884
1876
  }
3885
1877
  interface NodeAlias {
3886
- kind: "command-host" | "cloud-host" | "peer-host" | "direct-host" | "relay-route";
1878
+ kind: "command-host" | "peer-host" | "direct-host";
3887
1879
  id: string;
3888
1880
  }
3889
1881
  interface NodeRecord {
@@ -4083,7 +2075,7 @@ interface WsTicketStoreOptions {
4083
2075
  generate?: () => string;
4084
2076
  }
4085
2077
  interface WsTicketContext {
4086
- actorType: "device" | "host" | "local" | "relay";
2078
+ actorType: "device" | "host" | "local";
4087
2079
  actorId: string;
4088
2080
  label: string;
4089
2081
  }
@@ -5652,16 +3644,14 @@ interface CreateServerDeps {
5652
3644
  wsTickets?: WsTicketStore;
5653
3645
  /** One-writer/many-observer terminal input coordinator. Injectable for deterministic multi-client tests. */
5654
3646
  inputLeases?: InputLeaseCoordinator;
5655
- /** Managed-cloud terminal authorization poll cadence. Injectable only so socket revocation tests stay fast. */
5656
- terminalAuthorizationRecheckMs?: number;
5657
3647
  /** Team policy seam: direct local mode permits confirmed takeover; enterprise policy can deny it here. */
5658
3648
  authorizeInputTakeover?: (principal: InputLeasePrincipal, sessionId: string) => boolean;
5659
3649
  /** Optional policy seam for acquiring/writing input. Team RBAC is applied in addition when enabled. */
5660
3650
  authorizeInputWrite?: (principal: InputLeasePrincipal, sessionId: string) => boolean;
5661
3651
  /** Durable team membership and role assignments. start.ts supplies SQLite; tests may inject memory. */
5662
3652
  teamStore?: TeamStore;
5663
- /** Additive local-team + signed-cloud authorization. Omit to preserve exact self-hosted TeamStore behavior. */
5664
- authorizer?: CompositeAuthorizer;
3653
+ /** Local durable team authorization. */
3654
+ authorizer?: Authorizer;
5665
3655
  /** Durable organization policy. Disabled by default; enforced uniformly when explicitly enabled. */
5666
3656
  policyStore?: PolicyStore;
5667
3657
  /** Durable, explicitly scoped host-to-host API connections. Raw peer credentials never leave this store. */
@@ -5670,70 +3660,16 @@ interface CreateServerDeps {
5670
3660
  peerFetch?: typeof globalThis.fetch;
5671
3661
  /** Ephemeral, bounded presence heartbeats. */
5672
3662
  presence?: PresenceCoordinator;
5673
- /** Advertises and enforces that this host has an outbound blind-relay transport configured. */
5674
- relayEnabled?: boolean;
5675
- /** Privacy-bounded connector health for the authenticated settings UI. */
5676
- relayStatus?: () => {
5677
- status: "idle" | "connecting" | "online" | "reconnecting" | "stopped";
5678
- activeChannels: number;
5679
- reconnects: number;
5680
- };
5681
- /** Privacy-safe managed-host sync status. Presence means cloud management is configured. */
5682
- cloudStatus?: () => CloudHostRuntimeStatus;
5683
- /** Signed managed-cloud authorization authority, used only for read-only Node grant projection. */
5684
- cloudAuthorizationStore?: CloudAuthorizationStore;
5685
- /** Managed ownership remains read-only/fail-closed even if its signed cloud store is temporarily unavailable. */
5686
- managedAuthorization?: boolean;
5687
- /** Canonical product ownership for this Node. Local installs default to the Personal context. */
5688
- nodeOwner?: OwnerRef;
5689
- /** Non-authoritative connection identifiers that resolve to this persistent command-host Node. */
5690
- nodeAliases?: readonly NodeAlias[];
5691
- /** Product context label; never used as an authorization decision. */
5692
- nodeOwnerName?: string;
5693
- /** Optional hosted/self-hosted bootstrap; absent means relay works for already-provisioned devices only. */
5694
- relayPairing?: RelayPairingBootstrap;
5695
- /**
5696
- * Optional hosted control-plane bridge. The request actor always comes from DeviceStore authentication;
5697
- * clients can supply only their one-use enrollment challenge.
5698
- */
5699
- cloudDeviceEnrollmentConfirmer?: CloudDeviceEnrollmentConfirmer;
5700
- /** Late-bound host connector hook so device revocation closes relay channels immediately. */
5701
- onDeviceRevoked?: (deviceId: string) => void;
5702
- }
5703
- type CloudStatusSyncState = "not-configured" | "syncing" | "healthy" | "pending" | "degraded" | "expired";
5704
- type CloudStatusRecoveryAction = "none" | "wait-for-cloud-sync" | "wait-for-authorization-activation" | "check-host-connectivity" | "reauthorize-host" | "contact-organization-admin";
5705
- interface CloudStatusResponse {
5706
- v: 1;
5707
- mode: "self-hosted" | "managed";
5708
- configured: boolean;
5709
- sync: {
5710
- state: CloudStatusSyncState;
5711
- lastSuccessfulAt: number | null;
5712
- };
5713
- authorization: {
5714
- status: "not-configured" | CloudHostRuntimeStatus["authorization"]["status"];
5715
- revision: number | null;
5716
- expiresAt: number | null;
5717
- expired: boolean;
5718
- };
5719
- action: CloudStatusRecoveryAction;
5720
3663
  }
5721
- declare function cloudStatusResponse(status?: CloudHostRuntimeStatus): CloudStatusResponse;
5722
3664
  interface CreateServerResult {
5723
3665
  app: FastifyInstance;
5724
3666
  authGate: AuthGate;
5725
3667
  /** Issue a five-minute, one-use pairing capability without exposing the host's master token. */
5726
3668
  issuePairing(): PairingTicket;
5727
- /** Internal E2E-relay bridge. It authenticates relay-scoped devices through the exact normal route hooks. */
5728
- dispatchRelayRequest(token: string, request: RelayRpcRequest): Promise<RelayRpcResponse>;
5729
- /** Issues a relay-principal terminal ticket without exposing the bridge's process-local capability. */
5730
- issueRelayTerminalTicket(token: string): Promise<string>;
5731
- /** Process-local loopback headers for streamed relay HTTP. Never expose these outside this server process. */
5732
- relayLoopbackHeaders(token: string, headers?: Record<string, string>): Record<string, string>;
5733
3669
  /** Exposed so startServer can late-bind the MCP attach config (after listen() resolves the port) —
5734
3670
  * this is what gives the terminal's claude send_image/send_file. */
5735
3671
  terminalManager: TerminalManager;
5736
- /** Exposed for relay/team composition and isolated ownership tests. */
3672
+ /** Exposed for team composition and isolated ownership tests. */
5737
3673
  inputLeases: InputLeaseCoordinator;
5738
3674
  teamStore: TeamStore;
5739
3675
  policyStore: PolicyStore;
@@ -5741,17 +3677,13 @@ interface CreateServerResult {
5741
3677
  presence: PresenceCoordinator;
5742
3678
  /** False when tmux/node-pty is unavailable → terminal sessions are disabled (startServer warns loudly). */
5743
3679
  terminalAvailable: boolean;
5744
- /** Privacy-bounded webhook routing records synchronized to an optional managed control plane. */
5745
- automationWebhookRegistrations(): CloudAutomationWebhookRegistration[];
5746
- /** Durably accepts one control-plane signal; the invocation id makes redelivery idempotent. */
5747
- acceptCloudAutomationInvocation(invocation: CloudAutomationInvocation): Promise<void>;
5748
3680
  }
5749
3681
  declare function createServer(config: ServerRuntimeConfig, deps?: CreateServerDeps): CreateServerResult;
5750
3682
 
5751
3683
  /** Hash of the intentionally inline boot-recovery watchdog in packages/web/index.html. */
5752
3684
  declare const PWA_BOOT_WATCHDOG_SHA256 = "sha256-tcgQYptaPeNGqJtts8Ft/5H4tf+s+jfSWQSguIhTp8k=";
5753
3685
  /**
5754
- * Static-shell policy shared by direct hosts and mirrored by packaging/relay/Caddyfile.
3686
+ * Static-shell policy shared by standalone hosts.
5755
3687
  * Inline component styles remain necessary; executable inline code is restricted to the reviewed watchdog hash.
5756
3688
  */
5757
3689
  declare const PWA_CONTENT_SECURITY_POLICY: string;
@@ -5874,22 +3806,10 @@ declare function claudePreflightWarning(availability: ClaudeAvailability): strin
5874
3806
  * (the probe is short-timeout-guarded). Injectable probe + log sink so it's testable without a spawn.
5875
3807
  */
5876
3808
  declare function runClaudePreflight(probe: ClaudeVersionProbe, warn?: (msg: string) => void): Promise<void>;
5877
- interface StartServerOptions {
5878
- /** Shared control-plane transport seam for isolated embedding and startup tests. */
5879
- fetch?: typeof globalThis.fetch;
5880
- }
5881
- declare function cloudHostCapabilities(input: {
5882
- authorizationVersion: number;
5883
- terminalAvailable: boolean;
5884
- relayEnabled: boolean;
5885
- managedDeviceEnrollmentEnabled: boolean;
5886
- }): string[];
5887
- declare function startServer(env?: NodeJS.ProcessEnv, options?: StartServerOptions): Promise<CreateServerResult & {
3809
+ declare function startServer(env?: NodeJS.ProcessEnv): Promise<CreateServerResult & {
5888
3810
  url: string;
5889
3811
  token?: string;
5890
3812
  tokenGenerated: boolean;
5891
- relayHost?: RelayHostConnector;
5892
- cloudHostRuntime?: CloudHostRuntime;
5893
3813
  }>;
5894
3814
 
5895
3815
  interface ProcessLifecycleTarget {
@@ -6097,4 +4017,4 @@ declare function codexClassifierVersionWarning(codexVersion: string | undefined)
6097
4017
 
6098
4018
  declare const SERVER_PACKAGE = "@roamcode.ai/server";
6099
4019
 
6100
- export { ADAPTER_CONTRACT_VERSION, API_PATH_DENYLIST, type AdapterCapabilityName, AdapterManifestError, type AdapterManifestV1, type AdapterPackageManifestV1, type AdapterRuntimeV1, type AdapterStateAuthority, type AgentActivity, type AgentProvider, type AgentRecord, type AgentRuntimeAuthState, type AgentRuntimeRecord, type AttachSpawnOptions, type AttentionItem, type AttentionKind, type AttentionState, type AuditActorType, type AuditRecord, type AuditResult, type AuthCheckResult, AuthGate, type AuthGateOptions, type AutomationAction, type AutomationDefinition, type AutomationRun, type AutomationTrigger, BLIND_RELAY_DEFAULT_MAX_BYTES_PER_MINUTE, BLIND_RELAY_DEFAULT_MAX_CONNECTIONS_PER_ROUTE, BLIND_RELAY_DEFAULT_MAX_FRAME_BYTES, BLIND_RELAY_DEFAULT_MAX_MESSAGES_PER_MINUTE, BLIND_RELAY_DEFAULT_MAX_QUEUE_BYTES, BLIND_RELAY_DEFAULT_MAX_TOTAL_CONNECTIONS, BLIND_RELAY_PROTOCOL_VERSION, type Bar, type BlindRelayMetrics, type BlindRelayServer, CHECK_CACHE_MS, CLASSIFIER_TESTED_UP_TO, CLAUDE_LATEST_CACHE_MS, CLAUDE_VERSION_CACHE_MS, CLAUDE_VERSION_TIMEOUT_MS, CLOUD_AUTHORIZATION_CLOCK_SKEW_MS, CLOUD_AUTHORIZATION_CONTRACT_VERSION, CLOUD_AUTHORIZATION_FILE, CLOUD_AUTHORIZATION_KEYSET_PATH, CLOUD_AUTHORIZATION_KEYSET_SIGNATURE_DOMAIN, CLOUD_AUTHORIZATION_KEYSET_SIGNATURE_DOMAIN_V2, CLOUD_AUTHORIZATION_LAST_GOOD_FILE, CLOUD_AUTHORIZATION_PERMISSIONS, CLOUD_AUTHORIZATION_SIGNATURE_ALGORITHM, CLOUD_AUTHORIZATION_SIGNATURE_ALGORITHM_V2, CLOUD_AUTHORIZATION_SIGNATURE_DOMAIN, CLOUD_AUTHORIZATION_SIGNATURE_DOMAIN_V2, CLOUD_CONTRACT_VERSION, CLOUD_DEVICE_ENROLLMENT_COMPLETE_PATH, CLOUD_DEVICE_ENROLLMENT_CONFIRM_PATH, CLOUD_DEVICE_ENROLLMENT_HOST_ROUTE, CLOUD_HOST_AUTHORIZATION_SNAPSHOT_PATH, CLOUD_HOST_AUTOMATION_SYNC_PATH, CLOUD_HOST_CONFIG_FILE, CLOUD_HOST_HEARTBEAT_PATH, CLOUD_HOST_MAX_SIGNED_RESPONSE_BYTES, CLOUD_KEYSET_CLOCK_SKEW_MS, CODEX_CLASSIFIER_TESTED_UP_TO, CODEX_EXECUTABLE_PROBE_TIMEOUT_MS, CODEX_OSC_MAX_CARRY, CONTROL_IDEMPOTENCY_TTL_MS, type CaptureOptions, type ChangelogEntry, type ClaudeAuthDeps, ClaudeAuthService, type ClaudeAuthStatus, type ClaudeAvailability, type ClaudeLatestDeps, ClaudeLatestService, type ClaudeMetadataRunner, ClaudeMetadataService, type ClaudeModelCatalogItem, type ClaudeSessionOptions, type ClaudeVersionProbe, type CloudAuthorizationDecision, type CloudAuthorizationGrantV1, CloudAuthorizationGrantV1Schema, type CloudAuthorizationKeyset, type CloudAuthorizationKeysetKey, type CloudAuthorizationKeysetKeyV1, CloudAuthorizationKeysetKeyV1Schema, type CloudAuthorizationKeysetKeyV2, CloudAuthorizationKeysetKeyV2Schema, CloudAuthorizationKeysetSchema, type CloudAuthorizationKeysetV1, CloudAuthorizationKeysetV1Schema, type CloudAuthorizationKeysetV2, CloudAuthorizationKeysetV2Schema, type CloudAuthorizationPermission, CloudAuthorizationPermissionSchema, type CloudAuthorizationPrincipalType, type CloudAuthorizationScopeV1, CloudAuthorizationScopeV1Schema, type CloudAuthorizationSnapshot, CloudAuthorizationSnapshotSchema, type CloudAuthorizationSnapshotStatus, type CloudAuthorizationSnapshotV1, CloudAuthorizationSnapshotV1Schema, type CloudAuthorizationSnapshotV2, CloudAuthorizationSnapshotV2Schema, type CloudAuthorizationState, type CloudAuthorizationStore, CloudAuthorizationStoreError, type CloudAuthorizationStoreErrorCode, type CloudAuthorizationTrustedKey, CloudAuthorizationTrustedKeyAnySchema, CloudAuthorizationTrustedKeySchema, type CloudAuthorizationTrustedKeyV1, type CloudAuthorizationTrustedKeyV2, CloudAuthorizationTrustedKeyV2Schema, CloudAuthorizationVerificationError, type CloudAuthorizationVerificationErrorCode, type CloudDeviceEnrollmentConfirmationResult, type CloudDeviceEnrollmentConfirmer, CloudDeviceEnrollmentConflictError, CloudDeviceEnrollmentError, type CloudDeviceEnrollmentErrorCode, type CloudDeviceEnrollmentPrepareInput, type CloudDeviceEnrollmentProgress, type CloudDeviceEnrollmentRecoveryLoop, type CloudDeviceEnrollmentRequest, CloudDeviceEnrollmentRequestSchema, type CloudDeviceEnrollmentRuntimeConfig, type CloudDeviceEnrollmentState, type CloudHostAuthorizationIssue, type CloudHostConfig, CloudHostConfigSchema, type CloudHostConfigV1, CloudHostConfigV1Schema, type CloudHostConfigV2, CloudHostConfigV2Schema, type CloudHostDeviceEnrollmentCompletion, type CloudHostDeviceEnrollmentCompletionResult, CloudHostDeviceEnrollmentCompletionSchema, type CloudHostDeviceEnrollmentConfirmation, CloudHostDeviceEnrollmentConfirmationSchema, type CloudHostHeartbeatV1, CloudHostHeartbeatV1Schema, type CloudHostRuntime, CloudHostRuntimeError, type CloudHostRuntimeErrorCode, type CloudHostRuntimeStatus, CloudKeysetVerificationError, type CloudKeysetVerificationErrorCode, type CloudRelayDeviceEnrollmentAuth, CloudRelayDeviceEnrollmentAuthSchema, type CloudRelayDeviceEnrollmentPayload, CloudRelayDeviceEnrollmentPayloadSchema, type CloudRelayDeviceEnrollmentSaga, type CloudStatusRecoveryAction, type CloudStatusResponse, type CloudStatusSyncState, type CodexAccount, CodexAppServerClient, type CodexAppServerClientOptions, type CodexDeviceLogin, type CodexExecutableDeps, type CodexExecutableProbe, type CodexExecutableResolution, type CodexInstallProvenance, CodexLatestService, type CodexLoginCompletion, type CodexLoginStatus, type CodexMetadataDiagnostics, type CodexMetadataRpc, CodexMetadataService, type CodexMetadataServiceOptions, type CodexModel, type CodexOscParser, type CodexProfileClientLifecycle, type CodexSessionOptions, type CodexSpawnLease, type CodexThreadInventoryEntry, type CodexThreadPersistence, CodexThreadResolver, type CodexThreadResolverOptions, type CodexUsage, type CodexVersionInfo, CommandCenterRevisionConflictError, type CommandCenterStore, type CommandCenterStoreMode, type CommandEvent, type CommandLayoutEnvelope, type CompositeAuthorizationDecision, type CompositeAuthorizationReason, type CompositeAuthorizer, type ControlStore, type ControlStoreMode, type CreateAutomationInput, type CreateBlindRelayOptions, type CreateClaudeProviderOptions, type CreateCloudDeviceEnrollmentConfirmerOptions, type CreateCloudDeviceEnrollmentRecoveryLoopOptions, type CreateCloudHostRuntimeOptions, type CreateCloudRelayDeviceEnrollmentSagaOptions, type CreateCodexProfileClientLifecycleOptions, type CreateCodexProviderOptions, type CreateCompositeAuthorizerOptions, type CreateInstalledAdapterProviderOptions, type CreatePeerInput, type CreatePluginRuntimeOptions, type CreatePushDispatcherDeps, type CreateRelayAccountInput, type CreateServerDeps, type CreateServerResult, type CreateSessionAutomationInput, type CreateSessionAutomationRunInput, type CreateWebPushSendOptions, type CreateWorktreeInput, type CreateWorktreeResult, type CreateWorktreeServiceOptions, DEFAULT_CLOUD_CONTROL_PLANE_URL, type DeviceEnrollment, type DeviceInfo, DevicePairingError, type DeviceRelayIdentity, type DeviceScope, type DeviceStore, type DirEntry, type DirListing, type DirSearchResult, type DurableRelayIdentity, type EnterprisePolicy, type EnterprisePolicyAction, type EnterprisePolicyContext, type EnterprisePolicyDecision, EnterprisePolicyRevisionConflictError, type EnterprisePolicyUpdate, ExtensionError, type ExtensionKind, type ExtensionManager, type ExtensionManifestV1, type ExtensionPolicyMode, type ExtensionTrust, type ExtensionVersionRecord, FETCH_TIMEOUT_MS, type FetchLatest, type FetchManifest, type FetchReleases, FsError, type FsErrorCode, FsService, type FsServiceOptions, type GitHubRelease, type HooksSettingsDocument, type HostRecord, INPUT_LEASE_TTL_MS, type IPty, type IdempotencyRecord, type InputLease, type InputLeaseAcquireResult, type InputLeaseActorType, InputLeaseCoordinator, type InputLeaseCoordinatorOptions, type InputLeaseEvent, type InputLeasePrincipal, type InstallExtensionInput, type InstallServiceContext, type InstallServiceResult, type InstallationKind, type InstalledExtension, type LaunchIntent, type LoopbackRelayHttpOptions, type LoopbackRelayTerminalOptions, type ManagedInstallOptions, type ManagedInstallResult, type ManagedInstallStatus, type ManagedPaths, type MarketplaceEntry, type McpConfigDocument, type ModelWeekBar, type NodeAlias, type NodeRecord, OPENAI_CODE_SIGNING_TEAM_ID, type OpenApiBuildOptions, type OpenCloudAuthorizationStoreOptions, type OpenCommandCenterStoreOptions, type OpenControlStoreOptions, type OpenDeviceStoreOptions, type OpenExtensionManagerOptions, type OpenPeerStoreOptions, type OpenPolicyStoreOptions, type OpenPushStoreOptions, type OpenRelayAccountStoreOptions, type OpenRelayRouteStoreOptions, type OpenSessionAutomationStoreOptions, type OpenSessionStoreOptions, type OpenTeamStoreOptions, type OriginCheckOptions, type OwnerRef, PAIRING_TTL_MS, PRESENCE_HEARTBEAT_MS, PRESENCE_TTL_MS, PWA_BOOT_WATCHDOG_SHA256, PWA_CONTENT_SECURITY_POLICY, type PairingTicket, type PaneStatus, type PeerAction, type PeerConnection, type PeerJsonResponse, type PeerRecord, PeerRequestError, PeerRevisionConflictError, type PeerStatus, type PeerStore, type PeerStoreMode, type PendingCloudDevicePromotion, type PersistedRelayHostConfig, type PluginAuditEvent, type PluginManifestV1, type PluginPermission, type PluginRunInput, type PluginRunResult, type PluginRuntime, PluginRuntimeError, type PolicyStore, type PolicyStoreMode, PresenceCoordinator, type PresenceCoordinatorOptions, type PresenceEvent, type PresenceHeartbeatInput, type PresenceMode, type PresenceRecord, type PresenceTarget, type ProcessLifecycleHandle, type ProcessLifecycleOptions, type ProcessLifecycleTarget, type ProcessSpec, type ProductContext, type ProviderAdapterV1, type ProviderAvailability, ProviderError, type ProviderId, ProviderOptionsError, type ProviderProcessContext, ProviderRegistry, type ProviderRuntimeSignal, type ProviderRuntimeSignalParser, type ProviderSessionOptions, type PtySpawn, type PublicRelayRouteRecord, type PushDispatcher, type PushEvent, type PushEventKind, type PushPayload, type PushRecipient, type PushSendFn, type PushStore, type PushSubscriptionRecord, RELAY_CHANNEL_MAX_AGE_MS, RELAY_CHANNEL_MAX_FRAMES, RELAY_HANDSHAKE_MAX_SKEW_MS, RELAY_MAX_PLAINTEXT_BYTES, RELAY_PROTOCOL_VERSION, RELAY_RPC_MAX_BODY_BYTES, RELAY_RPC_MAX_PATH_BYTES, RELAY_WIRE_MAX_ENVELOPE_BYTES, RELAY_WIRE_PROTOCOL_VERSION, RUNNING_BUILD, RUNNING_VERSION, type RateLimitDecision, RateLimiter, type RateLimiterOptions, type RegisterStaticOptions, type RelayAccountCredentialInput, type RelayAccountCredentialMaterial, type RelayAccountPlan, type RelayAccountRecord, RelayAccountRevisionConflictError, type RelayAccountStatus, type RelayAccountStore, type RelayAccountStoreMode, type RelayChannelOptions, RelayCipherState, RelayCryptoError, type RelayCryptoErrorCode, type RelayDeviceProvisioner, type RelayDeviceProvisionerOptions, type RelayDeviceRouteRecord, type RelayDirection, type RelayEncryptedFrame, type RelayEphemeralKeyPair, type RelayFrameKind, type RelayHandshakeHello, type RelayHostConfigInput, type RelayHostConnector, type RelayHostConnectorOptions, type RelayHostMetrics, type RelayHostRuntimeConfig, type RelayHostStatus, type RelayHttpBridge, type RelayHttpHandlers, type RelayHttpOpenRequest, type RelayHttpOpener, type RelayHttpResponseHead, type RelayIdentity, type RelayIdentityStoreOptions, type RelayPairingBootstrap, type RelayPairingPackage, type RelayRole, type RelayRouteRecord, type RelayRouteStore, type RelayRpcMethod, type RelayRpcRequest, type RelayRpcResponse, type RelayStoreMode, type RelayTerminalBridge, type RelayTerminalHandlers, type RelayTerminalOpenRequest, type RelayTerminalOpener, type RelayWireEnvelope, type ReleaseRecord, type RenderLaunchdOptions, type RenderSystemdOptions, type ResolveAccessTokenOptions, type ResolveCodexExecutableOptions, type ResolveCodexThreadOptions, type ResolveVapidKeysOptions, type ResolvedCloudHostConfig, type ReturnTypeOfDescriptors, type RunClaudeVersion, type RunUsage, SEARCH_MAX_DEPTH, SEARCH_MAX_DIRS, SEARCH_MAX_RESULTS, SERVER_PACKAGE, SHELL_PATH_ALLOWLIST, type ServerConfig, type ServerRuntimeConfig, type ServiceRecord, type SessionAutomationDefinition, SessionAutomationRevisionConflictError, type SessionAutomationRun, type SessionAutomationRunStatus, type SessionAutomationStore, type SessionAutomationStoreMode, type SessionAutomationTrigger, type SessionDefaults, SessionDefaultsConflictError, type SessionFileDirection, type SessionFileKind, type SessionFileStorage, type SessionPlacement, type SessionStore, type SignedCloudAuthorizationKeyset, SignedCloudAuthorizationKeysetSchema, SignedCloudAuthorizationKeysetSignatureV1Schema, SignedCloudAuthorizationKeysetSignatureV2Schema, type SignedCloudAuthorizationKeysetV1, SignedCloudAuthorizationKeysetV1Schema, type SignedCloudAuthorizationKeysetV2, SignedCloudAuthorizationKeysetV2Schema, type SignedCloudAuthorizationSnapshot, SignedCloudAuthorizationSnapshotSchema, type SignedCloudAuthorizationSnapshotV1, SignedCloudAuthorizationSnapshotV1Schema, type SignedCloudAuthorizationSnapshotV2, SignedCloudAuthorizationSnapshotV2Schema, type StartServerOptions, type StartedBlindRelay, type StoreMode, type StoredCloudAuthorizationSnapshot, type StoredExternalSession, type StoredSession, type StoredSessionDefaults, type StoredSessionFile, type StoredStatus, type TeamAuthorizationDecision, type TeamAuthorizationResource, type TeamMember, type TeamMemberKind, type TeamMemberStatus, type TeamPermission, type TeamPrincipalBinding, type TeamPrincipalType, type TeamRecord, TeamRevisionConflictError, type TeamRole, type TeamRoleBinding, type TeamScopeType, type TeamStore, type TeamStoreMode, TerminalManager, type TerminalManagerDeps, type TerminalMeta, TerminalProcess, type TerminalProcessOptions, type TerminalSub, USAGE_CACHE_MS, USAGE_TIMEOUT_MS, type UpdateAction, type UpdateAutomationInput, type UpdatePeerInput, type UpdatePolicyMode, type UpdateRelayAccountInput, type UpdateSessionAutomationInput, type UpdateState, type UpdateStatus, Updater, type UpdaterDeps, type UpdaterFs, type UsageInfo, UsageService, type UsageServiceDeps, type VapidKeys, type VerifiedPeerIdentity, type VersionInfo, WS_TICKET_TTL_MS, type WorkspaceKind, type WorkspaceRecord, WorktreeError, type WorktreeErrorCode, type WorktreeRecord, type WorktreeService, type WsTicketContext, WsTicketStore, type WsTicketStoreOptions, adapterCapabilityNames, agentRuntimeId, assertConfigAllowsStart, buildCodexArgs, buildHooksSettingsDocument, buildMcpConfigDocument, buildOpenApiDocument, buildPushPayload, buildRelayPairingUrl, buildServicePath, canonicalCloudJson, capturePane, classifierVersionWarning, classifyCodexPane, classifyPaneStatus, claudePreflightWarning, cloudAuthorizationKeysetSigningPayload, cloudAuthorizationSnapshotSigningPayload, cloudAuthorizationTrustedKeysFromKeyset, cloudDeviceEnrollmentAuthorizationReady, cloudHostCapabilities, cloudHostConfigPath, cloudStatusResponse, codexClassifierVersionWarning, compareVersions, computeBuildDrift, computeInstallDrift, createBlindRelayServer, createClaudeAuthService, createClaudeLatestService, createClaudeMetadataRunner, createClaudeProvider, createClaudeVersionProbe, createCloudDeviceEnrollmentConfirmer, createCloudDeviceEnrollmentRecoveryLoop, createCloudHostRuntime, createCloudRelayDeviceEnrollmentSaga, createCodexOscParser, createCodexProfileClientLifecycle, createCodexProvider, createCodexThreadInventory, createCodexThreadPersistence, createCompositeAuthorizer, createInstalledAdapterProvider, createLoopbackRelayHttpOpener, createLoopbackRelayTerminalOpener, createPluginRuntime, createPushDispatcher, createRelayDeviceProvisioner, createRelayHandshakeHello, createRelayHostConnector, createServer, createUpdater, createUsageRunner, createUsageService, createWebPushSend, createWorktreeService, currentAgentIdForSession, decodeRelayWireEnvelope, defaultFetchManifest, defaultFetchReleases, defaultProbeCodexExecutable, defaultRunClaudeVersion, defaultUpdaterFs, defineAdapterManifest, detectTerminalSupport, enableService, encodeRelayWireEnvelope, ensureDataDir, establishRelayChannel, evaluateEnterprisePolicy, extractBearerToken, extractLoginUrl, generateAccessToken, generateRelayAccountCredential, generateRelayCredential, generateRelayEphemeralKeyPair, generateRelayIdentity, hasEncodedSep, hkdfSha256, hookAuthFileContent, hookAuthPathFor, hooksSettingsPathFor, inspectExtensionPackage, installManagedRelease, installProcessLifecycle, installService, isCodexProfileClientLifecycle, isLoopbackAddress, isNewerMajorMinor, isOriginAllowed, isPublicForRequest, isPublicPath, isRelayDirectExecution, isShellPath, isStableVersion, isTeamRole, isTeamScopeType, listTmuxSessions, loadConfig, loadOrCreateRelayIdentity, loadServerConfig, looksLikeAssetRequest, managedPaths, mcpConfigPathFor, migrateServiceToLauncher, normalizeAutomationAction, normalizeAutomationInput, normalizeAutomationTrigger, normalizeCloudControlPlaneOrigin, normalizeCommandCenterLabel, normalizeDeviceName, normalizeDeviceScopes, normalizeOrigin, normalizePeerBaseUrl, normalizeProviderAvailability, normalizeRelayAppUrl, normalizeRelease, normalizeSessionDefaults, openCloudAuthorizationStore, openCommandCenterStore, openControlStore, openDeviceStore, openExtensionManager, openPeerStore, openPolicyStore, openPushStore, openRelayAccountStore, openRelayRouteStore, openSessionAutomationStore, openSessionStore, openTeamStore, ownerFromProductContext, parseAllowedOrigins, parseAuthStatus, parseClaudeVersion, parseCloudAuthorizationKeyset, parseCloudAuthorizationSnapshot, parseCloudHostHeartbeat, parseCodexOscNotifications, parseCodexVersion, parseLegacyClaudeArgs, parseMarketplaceIndex, parseNpmLatest, parseProviderOptions, parseRelayRpcRequest, parseReleaseNotes, parseSignedCloudAuthorizationSnapshot, parseUsage, pathForGate, persistAccessToken, privacySafeAuditMetadata, productContextFromOwner, projectAgentRuntimeRecords, projectNodeRecord, providerPreflightWarning, publicAdapterDescriptor, readActiveVersion, readCloudHostConfig, readCloudHostCredentialFile, readPreviousVersion, readRelayHostConfig, readServiceRecord, registerStatic, relativeWhen, relayAccountCredentialHash, relayAccountCredentialLookup, relayConnectUrl, relayCredentialHash, relayHostConfigPath, relayIdentityFingerprint, relayRpcResponse, removeCloudHostConfig, removeRelayHostConfig, renderLaunchdPlist, renderManagedLauncher, renderSystemdUnit, replaceCloudHostAuthorizationKeyset, requestPeerJson, resetCodexThreadResolutionCoordinatorForTests, resolveAccessToken, resolveCloudDeviceEnrollmentConfig, resolveCloudHostConfig, resolveCodexExecutable, resolveDataDir, resolveInstallRoot, resolveRelayHostConfig, resolveVapidKeys, restartService, runClaudePreflight, runProviderPreflight, safeProcessErrorSummary, searchMarketplace, stableReleases, startBlindRelay, startServer, teamRolePermissions, tmuxSessionName, validateAdapterManifest, validateAdapterOptionSchema, validateRelayIdentity, verifyPeerConnection, verifyRelayHandshakeHello, verifySignedCloudAuthorizationKeyset, verifySignedCloudAuthorizationSnapshot, writeCloudHostConfig, writeManagedLauncher, writeRelayHostConfig };
4020
+ export { ADAPTER_CONTRACT_VERSION, API_PATH_DENYLIST, type AdapterCapabilityName, AdapterManifestError, type AdapterManifestV1, type AdapterPackageManifestV1, type AdapterRuntimeV1, type AdapterStateAuthority, type AgentActivity, type AgentProvider, type AgentRecord, type AgentRuntimeAuthState, type AgentRuntimeRecord, type AttachSpawnOptions, type AttentionItem, type AttentionKind, type AttentionState, type AuditActorType, type AuditRecord, type AuditResult, type AuthCheckResult, AuthGate, type AuthGateOptions, type AuthorizationDecision, type Authorizer, type AutomationAction, type AutomationDefinition, type AutomationRun, type AutomationTrigger, type Bar, CHECK_CACHE_MS, CLASSIFIER_TESTED_UP_TO, CLAUDE_LATEST_CACHE_MS, CLAUDE_VERSION_CACHE_MS, CLAUDE_VERSION_TIMEOUT_MS, CODEX_CLASSIFIER_TESTED_UP_TO, CODEX_EXECUTABLE_PROBE_TIMEOUT_MS, CODEX_OSC_MAX_CARRY, CONTROL_IDEMPOTENCY_TTL_MS, type CaptureOptions, type ChangelogEntry, type ClaudeAuthDeps, ClaudeAuthService, type ClaudeAuthStatus, type ClaudeAvailability, type ClaudeLatestDeps, ClaudeLatestService, type ClaudeMetadataRunner, ClaudeMetadataService, type ClaudeModelCatalogItem, type ClaudeSessionOptions, type ClaudeVersionProbe, type CodexAccount, CodexAppServerClient, type CodexAppServerClientOptions, type CodexDeviceLogin, type CodexExecutableDeps, type CodexExecutableProbe, type CodexExecutableResolution, type CodexInstallProvenance, CodexLatestService, type CodexLoginCompletion, type CodexLoginStatus, type CodexMetadataDiagnostics, type CodexMetadataRpc, CodexMetadataService, type CodexMetadataServiceOptions, type CodexModel, type CodexOscParser, type CodexProfileClientLifecycle, type CodexSessionOptions, type CodexSpawnLease, type CodexThreadInventoryEntry, type CodexThreadPersistence, CodexThreadResolver, type CodexThreadResolverOptions, type CodexUsage, type CodexVersionInfo, CommandCenterRevisionConflictError, type CommandCenterStore, type CommandCenterStoreMode, type CommandEvent, type CommandLayoutEnvelope, type ControlStore, type ControlStoreMode, type CreateAutomationInput, type CreateClaudeProviderOptions, type CreateCodexProfileClientLifecycleOptions, type CreateCodexProviderOptions, type CreateInstalledAdapterProviderOptions, type CreatePeerInput, type CreatePluginRuntimeOptions, type CreatePushDispatcherDeps, type CreateServerDeps, type CreateServerResult, type CreateSessionAutomationInput, type CreateSessionAutomationRunInput, type CreateWebPushSendOptions, type CreateWorktreeInput, type CreateWorktreeResult, type CreateWorktreeServiceOptions, type DeviceEnrollment, type DeviceInfo, type DeviceScope, type DeviceStore, type DirEntry, type DirListing, type DirSearchResult, type EnterprisePolicy, type EnterprisePolicyAction, type EnterprisePolicyContext, type EnterprisePolicyDecision, EnterprisePolicyRevisionConflictError, type EnterprisePolicyUpdate, ExtensionError, type ExtensionKind, type ExtensionManager, type ExtensionManifestV1, type ExtensionPolicyMode, type ExtensionTrust, type ExtensionVersionRecord, FETCH_TIMEOUT_MS, type FetchLatest, type FetchManifest, type FetchReleases, FsError, type FsErrorCode, FsService, type FsServiceOptions, type GitHubRelease, type HooksSettingsDocument, type HostRecord, INPUT_LEASE_TTL_MS, type IPty, type IdempotencyRecord, type InputLease, type InputLeaseAcquireResult, type InputLeaseActorType, InputLeaseCoordinator, type InputLeaseCoordinatorOptions, type InputLeaseEvent, type InputLeasePrincipal, type InstallExtensionInput, type InstallServiceContext, type InstallServiceResult, type InstallationKind, type InstalledExtension, type LaunchIntent, type ManagedInstallOptions, type ManagedInstallResult, type ManagedInstallStatus, type ManagedPaths, type MarketplaceEntry, type McpConfigDocument, type ModelWeekBar, type NodeAlias, type NodeRecord, OPENAI_CODE_SIGNING_TEAM_ID, type OpenApiBuildOptions, type OpenCommandCenterStoreOptions, type OpenControlStoreOptions, type OpenDeviceStoreOptions, type OpenExtensionManagerOptions, type OpenPeerStoreOptions, type OpenPolicyStoreOptions, type OpenPushStoreOptions, type OpenSessionAutomationStoreOptions, type OpenSessionStoreOptions, type OpenTeamStoreOptions, type OriginCheckOptions, type OwnerRef, PAIRING_TTL_MS, PRESENCE_HEARTBEAT_MS, PRESENCE_TTL_MS, PWA_BOOT_WATCHDOG_SHA256, PWA_CONTENT_SECURITY_POLICY, type PairingTicket, type PaneStatus, type PeerAction, type PeerConnection, type PeerJsonResponse, type PeerRecord, PeerRequestError, PeerRevisionConflictError, type PeerStatus, type PeerStore, type PeerStoreMode, type PluginAuditEvent, type PluginManifestV1, type PluginPermission, type PluginRunInput, type PluginRunResult, type PluginRuntime, PluginRuntimeError, type PolicyStore, type PolicyStoreMode, PresenceCoordinator, type PresenceCoordinatorOptions, type PresenceEvent, type PresenceHeartbeatInput, type PresenceMode, type PresenceRecord, type PresenceTarget, type ProcessLifecycleHandle, type ProcessLifecycleOptions, type ProcessLifecycleTarget, type ProcessSpec, type ProductContext, type ProviderAdapterV1, type ProviderAvailability, ProviderError, type ProviderId, ProviderOptionsError, type ProviderProcessContext, ProviderRegistry, type ProviderRuntimeSignal, type ProviderRuntimeSignalParser, type ProviderSessionOptions, type PtySpawn, type PushDispatcher, type PushEvent, type PushEventKind, type PushPayload, type PushRecipient, type PushSendFn, type PushStore, type PushSubscriptionRecord, RUNNING_BUILD, RUNNING_VERSION, type RateLimitDecision, RateLimiter, type RateLimiterOptions, type RegisterStaticOptions, type ReleaseRecord, type RenderLaunchdOptions, type RenderSystemdOptions, type ResolveAccessTokenOptions, type ResolveCodexExecutableOptions, type ResolveCodexThreadOptions, type ResolveVapidKeysOptions, type ReturnTypeOfDescriptors, type RunClaudeVersion, type RunUsage, SEARCH_MAX_DEPTH, SEARCH_MAX_DIRS, SEARCH_MAX_RESULTS, SERVER_PACKAGE, SHELL_PATH_ALLOWLIST, type ServerConfig, type ServerRuntimeConfig, type ServiceRecord, type SessionAutomationDefinition, SessionAutomationRevisionConflictError, type SessionAutomationRun, type SessionAutomationRunStatus, type SessionAutomationStore, type SessionAutomationStoreMode, type SessionAutomationTrigger, type SessionDefaults, SessionDefaultsConflictError, type SessionFileDirection, type SessionFileKind, type SessionFileStorage, type SessionPlacement, type SessionStore, type StoreMode, type StoredExternalSession, type StoredSession, type StoredSessionDefaults, type StoredSessionFile, type StoredStatus, type TeamAuthorizationDecision, type TeamAuthorizationResource, type TeamMember, type TeamMemberKind, type TeamMemberStatus, type TeamPermission, type TeamPrincipalBinding, type TeamPrincipalType, type TeamRecord, TeamRevisionConflictError, type TeamRole, type TeamRoleBinding, type TeamScopeType, type TeamStore, type TeamStoreMode, TerminalManager, type TerminalManagerDeps, type TerminalMeta, TerminalProcess, type TerminalProcessOptions, type TerminalSub, USAGE_CACHE_MS, USAGE_TIMEOUT_MS, type UpdateAction, type UpdateAutomationInput, type UpdatePeerInput, type UpdatePolicyMode, type UpdateSessionAutomationInput, type UpdateState, type UpdateStatus, Updater, type UpdaterDeps, type UpdaterFs, type UsageInfo, UsageService, type UsageServiceDeps, type VapidKeys, type VerifiedPeerIdentity, type VersionInfo, WS_TICKET_TTL_MS, type WorkspaceKind, type WorkspaceRecord, WorktreeError, type WorktreeErrorCode, type WorktreeRecord, type WorktreeService, type WsTicketContext, WsTicketStore, type WsTicketStoreOptions, adapterCapabilityNames, agentRuntimeId, assertConfigAllowsStart, buildCodexArgs, buildHooksSettingsDocument, buildMcpConfigDocument, buildOpenApiDocument, buildPushPayload, buildServicePath, capturePane, classifierVersionWarning, classifyCodexPane, classifyPaneStatus, claudePreflightWarning, codexClassifierVersionWarning, compareVersions, computeBuildDrift, computeInstallDrift, createClaudeAuthService, createClaudeLatestService, createClaudeMetadataRunner, createClaudeProvider, createClaudeVersionProbe, createCodexOscParser, createCodexProfileClientLifecycle, createCodexProvider, createCodexThreadInventory, createCodexThreadPersistence, createInstalledAdapterProvider, createPluginRuntime, createPushDispatcher, createServer, createTeamAuthorizer, createUpdater, createUsageRunner, createUsageService, createWebPushSend, createWorktreeService, currentAgentIdForSession, defaultFetchManifest, defaultFetchReleases, defaultProbeCodexExecutable, defaultRunClaudeVersion, defaultUpdaterFs, defineAdapterManifest, detectTerminalSupport, enableService, ensureDataDir, evaluateEnterprisePolicy, extractBearerToken, extractLoginUrl, generateAccessToken, hasEncodedSep, hookAuthFileContent, hookAuthPathFor, hooksSettingsPathFor, inspectExtensionPackage, installManagedRelease, installProcessLifecycle, installService, isCodexProfileClientLifecycle, isLoopbackAddress, isNewerMajorMinor, isOriginAllowed, isPublicForRequest, isPublicPath, isShellPath, isStableVersion, isTeamRole, isTeamScopeType, listTmuxSessions, loadConfig, loadServerConfig, looksLikeAssetRequest, managedPaths, mcpConfigPathFor, migrateServiceToLauncher, normalizeAutomationAction, normalizeAutomationInput, normalizeAutomationTrigger, normalizeCommandCenterLabel, normalizeDeviceName, normalizeDeviceScopes, normalizeOrigin, normalizePeerBaseUrl, normalizeProviderAvailability, normalizeRelease, normalizeSessionDefaults, openCommandCenterStore, openControlStore, openDeviceStore, openExtensionManager, openPeerStore, openPolicyStore, openPushStore, openSessionAutomationStore, openSessionStore, openTeamStore, ownerFromProductContext, parseAllowedOrigins, parseAuthStatus, parseClaudeVersion, parseCodexOscNotifications, parseCodexVersion, parseLegacyClaudeArgs, parseMarketplaceIndex, parseNpmLatest, parseProviderOptions, parseReleaseNotes, parseUsage, pathForGate, persistAccessToken, privacySafeAuditMetadata, productContextFromOwner, projectAgentRuntimeRecords, projectNodeRecord, providerPreflightWarning, publicAdapterDescriptor, readActiveVersion, readPreviousVersion, readServiceRecord, registerStatic, relativeWhen, renderLaunchdPlist, renderManagedLauncher, renderSystemdUnit, requestPeerJson, resetCodexThreadResolutionCoordinatorForTests, resolveAccessToken, resolveCodexExecutable, resolveDataDir, resolveInstallRoot, resolveVapidKeys, restartService, runClaudePreflight, runProviderPreflight, safeProcessErrorSummary, searchMarketplace, stableReleases, startServer, teamRolePermissions, tmuxSessionName, validateAdapterManifest, validateAdapterOptionSchema, verifyPeerConnection, writeManagedLauncher };