@roamcode.ai/server 1.0.22 → 1.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.
@@ -406,7 +406,10 @@ async function smokeServer(serverEntry, dataDir, nodePath, log) {
406
406
  ACCESS_TOKEN: `rc-smoke-${randomUUID()}`,
407
407
  ROAMCODE_DATA_DIR: smokeDir,
408
408
  RC_TMUX_SOCKET: `rc-smoke-${process.pid}`,
409
- ROAMCODE_INSTALL_ROOT: ""
409
+ ROAMCODE_INSTALL_ROOT: "",
410
+ // The boot smoke already owns this isolated child and health-checks it directly. Never let an
411
+ // inherited managed-launcher marker create a second supervisor for the throwaway process.
412
+ ROAMCODE_DISABLE_WATCHDOG: "1"
410
413
  },
411
414
  stdio: ["ignore", "pipe", "pipe"]
412
415
  });
@@ -0,0 +1,118 @@
1
+ import { FastifyInstance } from 'fastify';
2
+
3
+ type RelayAccountStoreMode = "sqlite" | "memory";
4
+ type RelayAccountStatus = "active" | "suspended" | "deleted";
5
+ type RelayAccountPlan = "free" | "team" | "enterprise";
6
+ interface RelayAccountRecord {
7
+ id: string;
8
+ label: string;
9
+ status: RelayAccountStatus;
10
+ plan: RelayAccountPlan;
11
+ maxRoutes: number;
12
+ maxDevicesPerRoute: number;
13
+ revision: number;
14
+ createdAt: number;
15
+ updatedAt: number;
16
+ }
17
+ interface CreateRelayAccountInput {
18
+ label: string;
19
+ credential: string;
20
+ plan?: RelayAccountPlan;
21
+ maxRoutes?: number;
22
+ maxDevicesPerRoute?: number;
23
+ }
24
+ interface UpdateRelayAccountInput {
25
+ label?: string;
26
+ status?: RelayAccountStatus;
27
+ plan?: RelayAccountPlan;
28
+ maxRoutes?: number;
29
+ maxDevicesPerRoute?: number;
30
+ }
31
+ interface RelayAccountStore {
32
+ readonly mode: RelayAccountStoreMode;
33
+ createAccount(input: CreateRelayAccountInput, now?: number): RelayAccountRecord;
34
+ getAccount(id: string): RelayAccountRecord | undefined;
35
+ listAccounts(options?: {
36
+ includeDeleted?: boolean;
37
+ }): RelayAccountRecord[];
38
+ authenticate(credential: string): RelayAccountRecord | undefined;
39
+ updateAccount(id: string, input: UpdateRelayAccountInput, expectedRevision: number, now?: number): RelayAccountRecord | undefined;
40
+ rotateCredential(id: string, credential: string, expectedRevision: number, now?: number): RelayAccountRecord | undefined;
41
+ close(): void;
42
+ }
43
+
44
+ type RelayStoreMode = "sqlite" | "memory";
45
+ interface RelayRouteRecord {
46
+ id: string;
47
+ label: string;
48
+ hostCredentialHash: string;
49
+ ownerAccountId?: string;
50
+ createdAt: number;
51
+ updatedAt: number;
52
+ }
53
+ interface RelayDeviceRouteRecord {
54
+ routeId: string;
55
+ deviceId: string;
56
+ credentialHash: string;
57
+ createdAt: number;
58
+ updatedAt: number;
59
+ /** Bootstrap credentials expire unless the host promotes the device after the E2E pairing claim. */
60
+ expiresAt?: number;
61
+ }
62
+ interface PublicRelayRouteRecord {
63
+ id: string;
64
+ label: string;
65
+ deviceCount: number;
66
+ createdAt: number;
67
+ updatedAt: number;
68
+ }
69
+ interface RelayRouteStore {
70
+ readonly mode: RelayStoreMode;
71
+ createRoute(input: {
72
+ id?: string;
73
+ label: string;
74
+ hostCredentialHash: string;
75
+ ownerAccountId?: string;
76
+ }, now?: number): RelayRouteRecord;
77
+ getRoute(id: string): RelayRouteRecord | undefined;
78
+ listRoutes(now?: number): PublicRelayRouteRecord[];
79
+ listRoutesByOwner(ownerAccountId: string, now?: number): PublicRelayRouteRecord[];
80
+ countDevices(routeId: string, now?: number): number;
81
+ rotateHostCredential(routeId: string, credentialHash: string, now?: number): boolean;
82
+ deleteRoute(id: string): boolean;
83
+ authenticateHost(routeId: string, credential: string): boolean;
84
+ putDevice(input: {
85
+ routeId: string;
86
+ deviceId: string;
87
+ credentialHash: string;
88
+ expiresAt?: number;
89
+ }, now?: number): RelayDeviceRouteRecord;
90
+ getDevice(routeId: string, deviceId: string, now?: number): RelayDeviceRouteRecord | undefined;
91
+ authenticateDevice(routeId: string, deviceId: string, credential: string, now?: number): boolean;
92
+ revokeDevice(routeId: string, deviceId: string): boolean;
93
+ close(): void;
94
+ }
95
+
96
+ interface BlindRelayMetrics {
97
+ activeHosts: number;
98
+ activeDevices: number;
99
+ acceptedConnections: number;
100
+ rejectedConnections: number;
101
+ forwardedFrames: number;
102
+ forwardedBytes: number;
103
+ droppedFrames: number;
104
+ }
105
+ interface BlindRelayServer {
106
+ app: FastifyInstance;
107
+ store: RelayRouteStore;
108
+ accountStore?: RelayAccountStore;
109
+ metrics(): BlindRelayMetrics;
110
+ }
111
+
112
+ interface StartedBlindRelay extends BlindRelayServer {
113
+ url: string;
114
+ }
115
+ declare function startBlindRelay(env?: NodeJS.ProcessEnv): Promise<StartedBlindRelay>;
116
+ declare function isRelayDirectExecution(moduleUrl: string, argv1: string | undefined, embeddedContainerBuild?: boolean): boolean;
117
+
118
+ export { type StartedBlindRelay, isRelayDirectExecution, startBlindRelay };