agent-relay 2.0.23 → 2.0.25

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (168) hide show
  1. package/dist/src/cli/index.js +160 -17
  2. package/package.json +18 -52
  3. package/packages/api-types/package.json +1 -1
  4. package/packages/bridge/package.json +8 -8
  5. package/packages/cli-tester/package.json +1 -1
  6. package/packages/config/package.json +2 -2
  7. package/packages/continuity/package.json +1 -1
  8. package/packages/daemon/package.json +12 -12
  9. package/packages/hooks/package.json +4 -4
  10. package/packages/mcp/package.json +2 -2
  11. package/packages/memory/package.json +2 -2
  12. package/packages/policy/package.json +2 -2
  13. package/packages/protocol/package.json +1 -1
  14. package/packages/resiliency/package.json +1 -1
  15. package/packages/sdk/package.json +2 -2
  16. package/packages/spawner/package.json +1 -1
  17. package/packages/state/package.json +1 -1
  18. package/packages/storage/package.json +2 -2
  19. package/packages/telemetry/package.json +1 -1
  20. package/packages/trajectory/package.json +2 -2
  21. package/packages/user-directory/package.json +2 -2
  22. package/packages/utils/package.json +1 -1
  23. package/packages/wrapper/package.json +6 -6
  24. package/deploy/init-db.sql +0 -5
  25. package/deploy/scripts/setup-fly-workspaces.sh +0 -69
  26. package/deploy/scripts/setup-railway.sh +0 -75
  27. package/dist/src/cloud/index.d.ts +0 -8
  28. package/dist/src/cloud/index.js +0 -8
  29. package/packages/cloud/dist/api/admin.d.ts +0 -8
  30. package/packages/cloud/dist/api/admin.js +0 -225
  31. package/packages/cloud/dist/api/auth.d.ts +0 -20
  32. package/packages/cloud/dist/api/auth.js +0 -138
  33. package/packages/cloud/dist/api/billing.d.ts +0 -7
  34. package/packages/cloud/dist/api/billing.js +0 -564
  35. package/packages/cloud/dist/api/cli-pty-runner.d.ts +0 -53
  36. package/packages/cloud/dist/api/cli-pty-runner.js +0 -175
  37. package/packages/cloud/dist/api/codex-auth-helper.d.ts +0 -21
  38. package/packages/cloud/dist/api/codex-auth-helper.js +0 -327
  39. package/packages/cloud/dist/api/consensus.d.ts +0 -13
  40. package/packages/cloud/dist/api/consensus.js +0 -261
  41. package/packages/cloud/dist/api/coordinators.d.ts +0 -8
  42. package/packages/cloud/dist/api/coordinators.js +0 -750
  43. package/packages/cloud/dist/api/daemons.d.ts +0 -12
  44. package/packages/cloud/dist/api/daemons.js +0 -535
  45. package/packages/cloud/dist/api/email-auth.d.ts +0 -11
  46. package/packages/cloud/dist/api/email-auth.js +0 -347
  47. package/packages/cloud/dist/api/generic-webhooks.d.ts +0 -8
  48. package/packages/cloud/dist/api/generic-webhooks.js +0 -129
  49. package/packages/cloud/dist/api/git.d.ts +0 -8
  50. package/packages/cloud/dist/api/git.js +0 -269
  51. package/packages/cloud/dist/api/github-app.d.ts +0 -11
  52. package/packages/cloud/dist/api/github-app.js +0 -223
  53. package/packages/cloud/dist/api/middleware/planLimits.d.ts +0 -43
  54. package/packages/cloud/dist/api/middleware/planLimits.js +0 -202
  55. package/packages/cloud/dist/api/monitoring.d.ts +0 -11
  56. package/packages/cloud/dist/api/monitoring.js +0 -578
  57. package/packages/cloud/dist/api/nango-auth.d.ts +0 -9
  58. package/packages/cloud/dist/api/nango-auth.js +0 -741
  59. package/packages/cloud/dist/api/onboarding.d.ts +0 -15
  60. package/packages/cloud/dist/api/onboarding.js +0 -679
  61. package/packages/cloud/dist/api/policy.d.ts +0 -8
  62. package/packages/cloud/dist/api/policy.js +0 -229
  63. package/packages/cloud/dist/api/provider-env.d.ts +0 -26
  64. package/packages/cloud/dist/api/provider-env.js +0 -141
  65. package/packages/cloud/dist/api/providers.d.ts +0 -7
  66. package/packages/cloud/dist/api/providers.js +0 -574
  67. package/packages/cloud/dist/api/repos.d.ts +0 -8
  68. package/packages/cloud/dist/api/repos.js +0 -577
  69. package/packages/cloud/dist/api/sessions.d.ts +0 -11
  70. package/packages/cloud/dist/api/sessions.js +0 -302
  71. package/packages/cloud/dist/api/teams.d.ts +0 -7
  72. package/packages/cloud/dist/api/teams.js +0 -281
  73. package/packages/cloud/dist/api/test-helpers.d.ts +0 -10
  74. package/packages/cloud/dist/api/test-helpers.js +0 -745
  75. package/packages/cloud/dist/api/usage.d.ts +0 -7
  76. package/packages/cloud/dist/api/usage.js +0 -111
  77. package/packages/cloud/dist/api/webhooks.d.ts +0 -8
  78. package/packages/cloud/dist/api/webhooks.js +0 -645
  79. package/packages/cloud/dist/api/workspaces.d.ts +0 -25
  80. package/packages/cloud/dist/api/workspaces.js +0 -1799
  81. package/packages/cloud/dist/billing/index.d.ts +0 -9
  82. package/packages/cloud/dist/billing/index.js +0 -9
  83. package/packages/cloud/dist/billing/plans.d.ts +0 -39
  84. package/packages/cloud/dist/billing/plans.js +0 -245
  85. package/packages/cloud/dist/billing/service.d.ts +0 -80
  86. package/packages/cloud/dist/billing/service.js +0 -388
  87. package/packages/cloud/dist/billing/types.d.ts +0 -141
  88. package/packages/cloud/dist/billing/types.js +0 -7
  89. package/packages/cloud/dist/config.d.ts +0 -5
  90. package/packages/cloud/dist/config.js +0 -5
  91. package/packages/cloud/dist/db/bulk-ingest.d.ts +0 -89
  92. package/packages/cloud/dist/db/bulk-ingest.js +0 -268
  93. package/packages/cloud/dist/db/drizzle.d.ts +0 -290
  94. package/packages/cloud/dist/db/drizzle.js +0 -1422
  95. package/packages/cloud/dist/db/index.d.ts +0 -56
  96. package/packages/cloud/dist/db/index.js +0 -70
  97. package/packages/cloud/dist/db/schema.d.ts +0 -5117
  98. package/packages/cloud/dist/db/schema.js +0 -656
  99. package/packages/cloud/dist/index.d.ts +0 -11
  100. package/packages/cloud/dist/index.js +0 -38
  101. package/packages/cloud/dist/provisioner/index.d.ts +0 -207
  102. package/packages/cloud/dist/provisioner/index.js +0 -2118
  103. package/packages/cloud/dist/server.d.ts +0 -17
  104. package/packages/cloud/dist/server.js +0 -2055
  105. package/packages/cloud/dist/services/auto-scaler.d.ts +0 -152
  106. package/packages/cloud/dist/services/auto-scaler.js +0 -439
  107. package/packages/cloud/dist/services/capacity-manager.d.ts +0 -148
  108. package/packages/cloud/dist/services/capacity-manager.js +0 -449
  109. package/packages/cloud/dist/services/ci-agent-spawner.d.ts +0 -49
  110. package/packages/cloud/dist/services/ci-agent-spawner.js +0 -373
  111. package/packages/cloud/dist/services/cloud-message-bus.d.ts +0 -28
  112. package/packages/cloud/dist/services/cloud-message-bus.js +0 -19
  113. package/packages/cloud/dist/services/compute-enforcement.d.ts +0 -57
  114. package/packages/cloud/dist/services/compute-enforcement.js +0 -175
  115. package/packages/cloud/dist/services/coordinator.d.ts +0 -62
  116. package/packages/cloud/dist/services/coordinator.js +0 -389
  117. package/packages/cloud/dist/services/index.d.ts +0 -17
  118. package/packages/cloud/dist/services/index.js +0 -25
  119. package/packages/cloud/dist/services/intro-expiration.d.ts +0 -60
  120. package/packages/cloud/dist/services/intro-expiration.js +0 -252
  121. package/packages/cloud/dist/services/mention-handler.d.ts +0 -65
  122. package/packages/cloud/dist/services/mention-handler.js +0 -405
  123. package/packages/cloud/dist/services/nango.d.ts +0 -219
  124. package/packages/cloud/dist/services/nango.js +0 -424
  125. package/packages/cloud/dist/services/persistence.d.ts +0 -131
  126. package/packages/cloud/dist/services/persistence.js +0 -200
  127. package/packages/cloud/dist/services/planLimits.d.ts +0 -147
  128. package/packages/cloud/dist/services/planLimits.js +0 -335
  129. package/packages/cloud/dist/services/presence-registry.d.ts +0 -56
  130. package/packages/cloud/dist/services/presence-registry.js +0 -91
  131. package/packages/cloud/dist/services/scaling-orchestrator.d.ts +0 -159
  132. package/packages/cloud/dist/services/scaling-orchestrator.js +0 -502
  133. package/packages/cloud/dist/services/scaling-policy.d.ts +0 -121
  134. package/packages/cloud/dist/services/scaling-policy.js +0 -415
  135. package/packages/cloud/dist/services/ssh-security.d.ts +0 -31
  136. package/packages/cloud/dist/services/ssh-security.js +0 -63
  137. package/packages/cloud/dist/services/workspace-keepalive.d.ts +0 -76
  138. package/packages/cloud/dist/services/workspace-keepalive.js +0 -234
  139. package/packages/cloud/dist/shims/consensus.d.ts +0 -23
  140. package/packages/cloud/dist/shims/consensus.js +0 -5
  141. package/packages/cloud/dist/webhooks/index.d.ts +0 -24
  142. package/packages/cloud/dist/webhooks/index.js +0 -29
  143. package/packages/cloud/dist/webhooks/parsers/github.d.ts +0 -8
  144. package/packages/cloud/dist/webhooks/parsers/github.js +0 -234
  145. package/packages/cloud/dist/webhooks/parsers/index.d.ts +0 -23
  146. package/packages/cloud/dist/webhooks/parsers/index.js +0 -30
  147. package/packages/cloud/dist/webhooks/parsers/linear.d.ts +0 -9
  148. package/packages/cloud/dist/webhooks/parsers/linear.js +0 -258
  149. package/packages/cloud/dist/webhooks/parsers/slack.d.ts +0 -9
  150. package/packages/cloud/dist/webhooks/parsers/slack.js +0 -214
  151. package/packages/cloud/dist/webhooks/responders/github.d.ts +0 -8
  152. package/packages/cloud/dist/webhooks/responders/github.js +0 -73
  153. package/packages/cloud/dist/webhooks/responders/index.d.ts +0 -23
  154. package/packages/cloud/dist/webhooks/responders/index.js +0 -30
  155. package/packages/cloud/dist/webhooks/responders/linear.d.ts +0 -9
  156. package/packages/cloud/dist/webhooks/responders/linear.js +0 -149
  157. package/packages/cloud/dist/webhooks/responders/slack.d.ts +0 -20
  158. package/packages/cloud/dist/webhooks/responders/slack.js +0 -178
  159. package/packages/cloud/dist/webhooks/router.d.ts +0 -25
  160. package/packages/cloud/dist/webhooks/router.js +0 -504
  161. package/packages/cloud/dist/webhooks/rules-engine.d.ts +0 -24
  162. package/packages/cloud/dist/webhooks/rules-engine.js +0 -287
  163. package/packages/cloud/dist/webhooks/types.d.ts +0 -186
  164. package/packages/cloud/dist/webhooks/types.js +0 -8
  165. package/packages/cloud/package.json +0 -60
  166. package/scripts/run-migrations.js +0 -43
  167. package/scripts/setup-stripe-products.ts +0 -312
  168. package/scripts/verify-schema.js +0 -134
@@ -1,11 +0,0 @@
1
- /**
2
- * Agent Relay Cloud - Main Entry Point
3
- *
4
- * One-click server provisioning for AI agent orchestration.
5
- */
6
- export { createServer } from './server.js';
7
- export { getConfig, loadConfig, type CloudConfig } from './config.js';
8
- export { WorkspaceProvisioner, type ProvisionConfig, type Workspace, type WorkspaceStatus, } from './provisioner/index.js';
9
- export { ScalingPolicyService, type ScalingThresholds, type ScalingPolicy, type ScalingDecision, type WorkspaceMetrics, getScalingPolicyService, AutoScaler, type ScalingOperation, getAutoScaler, createAutoScaler, CapacityManager, type WorkspaceCapacity, type PlacementRecommendation, type CapacityForecast, getCapacityManager, createCapacityManager, ScalingOrchestrator, type ScalingEvent, getScalingOrchestrator, createScalingOrchestrator, } from './services/index.js';
10
- export * from './billing/index.js';
11
- //# sourceMappingURL=index.d.ts.map
@@ -1,38 +0,0 @@
1
- /**
2
- * Agent Relay Cloud - Main Entry Point
3
- *
4
- * One-click server provisioning for AI agent orchestration.
5
- */
6
- import { fileURLToPath } from 'node:url';
7
- export { createServer } from './server.js';
8
- export { getConfig, loadConfig } from './config.js';
9
- // Services
10
- export { WorkspaceProvisioner, } from './provisioner/index.js';
11
- // Scaling infrastructure
12
- export { ScalingPolicyService, getScalingPolicyService, AutoScaler, getAutoScaler, createAutoScaler, CapacityManager, getCapacityManager, createCapacityManager, ScalingOrchestrator, getScalingOrchestrator, createScalingOrchestrator, } from './services/index.js';
13
- // Billing
14
- export * from './billing/index.js';
15
- // Run if executed directly (ES module compatible check)
16
- const isMain = process.argv[1] === fileURLToPath(import.meta.url);
17
- if (isMain) {
18
- (async () => {
19
- try {
20
- const { createServer } = await import('./server.js');
21
- const server = await createServer();
22
- await server.start();
23
- // Graceful shutdown
24
- const shutdown = async () => {
25
- console.log('\nShutting down...');
26
- await server.stop();
27
- process.exit(0);
28
- };
29
- process.on('SIGINT', shutdown);
30
- process.on('SIGTERM', shutdown);
31
- }
32
- catch (error) {
33
- console.error('Failed to start server:', error);
34
- process.exit(1);
35
- }
36
- })();
37
- }
38
- //# sourceMappingURL=index.js.map
@@ -1,207 +0,0 @@
1
- /**
2
- * Agent Relay Cloud - Workspace Provisioner
3
- *
4
- * One-click provisioning for compute resources (Fly.io, Railway, Docker).
5
- */
6
- import { Workspace } from '../db/index.js';
7
- export type ProvisioningStage = 'creating' | 'networking' | 'secrets' | 'machine' | 'booting' | 'health' | 'complete';
8
- interface ProvisioningProgress {
9
- stage: ProvisioningStage;
10
- startedAt: number;
11
- updatedAt: number;
12
- }
13
- /**
14
- * Get the current provisioning stage for a workspace
15
- */
16
- export declare function getProvisioningStage(workspaceId: string): ProvisioningProgress | null;
17
- export interface ProvisionConfig {
18
- userId: string;
19
- name: string;
20
- providers: string[];
21
- repositories: string[];
22
- supervisorEnabled?: boolean;
23
- maxAgents?: number;
24
- /** Direct GitHub token for testing (bypasses Nango lookup) */
25
- githubToken?: string;
26
- }
27
- export interface ProvisionResult {
28
- workspaceId: string;
29
- status: 'provisioning' | 'running' | 'error';
30
- publicUrl?: string;
31
- error?: string;
32
- }
33
- export type WorkspaceStatus = Workspace['status'];
34
- export type { Workspace };
35
- /**
36
- * Resource tier configurations for vertical scaling
37
- */
38
- export interface ResourceTier {
39
- name: 'small' | 'medium' | 'large' | 'xlarge';
40
- cpuCores: number;
41
- memoryMb: number;
42
- maxAgents: number;
43
- cpuKind: 'shared' | 'performance';
44
- }
45
- export declare const RESOURCE_TIERS: Record<string, ResourceTier>;
46
- /**
47
- * Main Workspace Provisioner
48
- */
49
- export declare class WorkspaceProvisioner {
50
- private provisioner;
51
- constructor();
52
- /**
53
- * Provision a new workspace (one-click)
54
- * Returns immediately with 'provisioning' status and runs actual provisioning in background
55
- */
56
- provision(config: ProvisionConfig): Promise<ProvisionResult>;
57
- /**
58
- * Run the actual provisioning work asynchronously
59
- */
60
- private runProvisioningAsync;
61
- /**
62
- * Deprovision a workspace
63
- */
64
- deprovision(workspaceId: string): Promise<void>;
65
- /**
66
- * Get workspace status
67
- */
68
- getStatus(workspaceId: string): Promise<WorkspaceStatus>;
69
- /**
70
- * Restart a workspace
71
- */
72
- restart(workspaceId: string): Promise<void>;
73
- /**
74
- * Update environment variables for a workspace instance.
75
- */
76
- setWorkspaceEnvVars(workspace: Workspace, envVars: Record<string, string>): Promise<void>;
77
- /**
78
- * Stop a workspace
79
- */
80
- stop(workspaceId: string): Promise<void>;
81
- /**
82
- * Resize a workspace (vertical scaling)
83
- * @param skipRestart - If true, config is saved but machine won't restart (changes apply on next start)
84
- */
85
- resize(workspaceId: string, tier: ResourceTier, skipRestart?: boolean): Promise<void>;
86
- /**
87
- * Update the max agent limit for a workspace
88
- */
89
- updateAgentLimit(workspaceId: string, newLimit: number): Promise<void>;
90
- /**
91
- * Get current resource tier for a workspace
92
- */
93
- getCurrentTier(workspaceId: string): Promise<ResourceTier>;
94
- /**
95
- * Get recommended tier based on agent count
96
- * Uses 1.5-2GB per agent as baseline for Claude Code
97
- */
98
- getRecommendedTier(agentCount: number): ResourceTier;
99
- /**
100
- * Auto-scale workspace based on current agent count
101
- * Respects plan limits - free tier cannot scale, others have max tier limits
102
- * Returns { scaled: boolean, reason?: string }
103
- */
104
- autoScale(workspaceId: string, currentAgentCount: number): Promise<{
105
- scaled: boolean;
106
- reason?: string;
107
- currentTier?: string;
108
- targetTier?: string;
109
- }>;
110
- /**
111
- * Create an on-demand snapshot of a workspace's volume
112
- * Use before risky operations (e.g., major refactors, untrusted code execution)
113
- */
114
- createSnapshot(workspaceId: string): Promise<{
115
- snapshotId: string;
116
- } | null>;
117
- /**
118
- * List available snapshots for a workspace
119
- * Includes both automatic daily snapshots and on-demand snapshots
120
- */
121
- listSnapshots(workspaceId: string): Promise<Array<{
122
- id: string;
123
- createdAt: string;
124
- sizeBytes: number;
125
- }>>;
126
- /**
127
- * Get the volume ID for a workspace (needed for restore operations)
128
- */
129
- getVolumeId(workspaceId: string): Promise<string | null>;
130
- /**
131
- * Result of a graceful update attempt
132
- */
133
- static readonly UpdateResult: {
134
- readonly UPDATED: "updated";
135
- readonly UPDATED_PENDING_RESTART: "updated_pending_restart";
136
- readonly SKIPPED_ACTIVE_AGENTS: "skipped_active_agents";
137
- readonly SKIPPED_VERIFICATION_FAILED: "skipped_verification_failed";
138
- readonly SKIPPED_NOT_RUNNING: "skipped_not_running";
139
- readonly NOT_SUPPORTED: "not_supported";
140
- readonly ERROR: "error";
141
- };
142
- /**
143
- * Gracefully update a single workspace's image
144
- *
145
- * Behavior:
146
- * - If workspace is stopped: Update config, will use new image on next wake
147
- * - If workspace is running with no agents: Update config and restart
148
- * - If workspace is running with active agents: Skip (or force if specified)
149
- *
150
- * @param workspaceId - Workspace to update
151
- * @param newImage - New Docker image to use
152
- * @param options - Update options
153
- * @returns Update result with details
154
- */
155
- gracefulUpdateImage(workspaceId: string, newImage: string, options?: {
156
- force?: boolean;
157
- skipRestart?: boolean;
158
- }): Promise<{
159
- result: string;
160
- workspaceId: string;
161
- machineState?: string;
162
- agentCount?: number;
163
- agents?: Array<{
164
- name: string;
165
- status: string;
166
- }>;
167
- error?: string;
168
- reason?: string;
169
- }>;
170
- /**
171
- * Gracefully update all workspaces to a new image
172
- *
173
- * Processes workspaces in batches, respecting active agents unless forced.
174
- * Returns detailed results for each workspace.
175
- *
176
- * @param newImage - New Docker image to use
177
- * @param options - Update options
178
- * @returns Summary and per-workspace results
179
- */
180
- gracefulUpdateAllImages(newImage: string, options?: {
181
- force?: boolean;
182
- skipRestart?: boolean;
183
- batchSize?: number;
184
- userIds?: string[];
185
- workspaceIds?: string[];
186
- }): Promise<{
187
- summary: {
188
- total: number;
189
- updated: number;
190
- pendingRestart: number;
191
- skippedActiveAgents: number;
192
- skippedVerificationFailed: number;
193
- skippedNotRunning: number;
194
- errors: number;
195
- };
196
- results: Array<{
197
- result: string;
198
- workspaceId: string;
199
- machineState?: string;
200
- agentCount?: number;
201
- error?: string;
202
- reason?: string;
203
- }>;
204
- }>;
205
- }
206
- export declare function getProvisioner(): WorkspaceProvisioner;
207
- //# sourceMappingURL=index.d.ts.map