@agent-relay/config 0.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/agent-config.d.ts +47 -0
- package/dist/agent-config.d.ts.map +1 -0
- package/dist/agent-config.js +119 -0
- package/dist/agent-config.js.map +1 -0
- package/dist/bridge-config.d.ts +52 -0
- package/dist/bridge-config.d.ts.map +1 -0
- package/dist/bridge-config.js +143 -0
- package/dist/bridge-config.js.map +1 -0
- package/dist/bridge-utils.d.ts +30 -0
- package/dist/bridge-utils.d.ts.map +1 -0
- package/dist/bridge-utils.js +54 -0
- package/dist/bridge-utils.js.map +1 -0
- package/dist/cli-auth-config.d.ts +110 -0
- package/dist/cli-auth-config.d.ts.map +1 -0
- package/dist/cli-auth-config.js +391 -0
- package/dist/cli-auth-config.js.map +1 -0
- package/dist/cloud-config.d.ts +75 -0
- package/dist/cloud-config.d.ts.map +1 -0
- package/dist/cloud-config.js +109 -0
- package/dist/cloud-config.js.map +1 -0
- package/dist/index.d.ts +13 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +13 -0
- package/dist/index.js.map +1 -0
- package/dist/project-namespace.d.ts +73 -0
- package/dist/project-namespace.d.ts.map +1 -0
- package/dist/project-namespace.js +280 -0
- package/dist/project-namespace.js.map +1 -0
- package/dist/relay-config.d.ts +25 -0
- package/dist/relay-config.d.ts.map +1 -0
- package/dist/relay-config.js +25 -0
- package/dist/relay-config.js.map +1 -0
- package/dist/relay-file-writer.d.ts +200 -0
- package/dist/relay-file-writer.d.ts.map +1 -0
- package/dist/relay-file-writer.js +407 -0
- package/dist/relay-file-writer.js.map +1 -0
- package/dist/schemas.d.ts +672 -0
- package/dist/schemas.d.ts.map +1 -0
- package/dist/schemas.js +180 -0
- package/dist/schemas.js.map +1 -0
- package/dist/shadow-config.d.ts +87 -0
- package/dist/shadow-config.d.ts.map +1 -0
- package/dist/shadow-config.js +134 -0
- package/dist/shadow-config.js.map +1 -0
- package/dist/teams-config.d.ts +47 -0
- package/dist/teams-config.d.ts.map +1 -0
- package/dist/teams-config.js +100 -0
- package/dist/teams-config.js.map +1 -0
- package/dist/trajectory-config.d.ts +102 -0
- package/dist/trajectory-config.d.ts.map +1 -0
- package/dist/trajectory-config.js +185 -0
- package/dist/trajectory-config.js.map +1 -0
- package/package.json +98 -0
|
@@ -0,0 +1,391 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shared CLI Auth Configuration
|
|
3
|
+
*
|
|
4
|
+
* Provider-specific CLI commands and patterns for OAuth authentication.
|
|
5
|
+
* Used by both the cloud API and workspace daemon.
|
|
6
|
+
*/
|
|
7
|
+
/**
|
|
8
|
+
* CLI commands and URL patterns for each provider
|
|
9
|
+
*
|
|
10
|
+
* Each CLI tool outputs an OAuth URL when run without credentials.
|
|
11
|
+
* We capture stdout/stderr and extract the URL using regex patterns.
|
|
12
|
+
*
|
|
13
|
+
* IMPORTANT: These CLIs are interactive - they output the auth URL then wait
|
|
14
|
+
* for the user to complete OAuth in their browser. We capture the URL and
|
|
15
|
+
* display it in a popup for the user.
|
|
16
|
+
*/
|
|
17
|
+
export const CLI_AUTH_CONFIG = {
|
|
18
|
+
anthropic: {
|
|
19
|
+
command: 'claude',
|
|
20
|
+
args: [],
|
|
21
|
+
urlPattern: /(https:\/\/[^\s]+)/,
|
|
22
|
+
credentialPath: '~/.claude/.credentials.json',
|
|
23
|
+
displayName: 'Claude',
|
|
24
|
+
waitTimeout: 30000, // Claude can take a while to show the auth URL
|
|
25
|
+
prompts: [
|
|
26
|
+
{
|
|
27
|
+
// Claude Code version selection - accept default (recommended)
|
|
28
|
+
pattern: /which\s*version|claude\s*code\s*version|select.*version/i,
|
|
29
|
+
response: '\r',
|
|
30
|
+
delay: 100,
|
|
31
|
+
description: 'Version selection prompt',
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
pattern: /dark\s*(mode|theme)/i,
|
|
35
|
+
response: '\r', // Press enter to accept default
|
|
36
|
+
delay: 100,
|
|
37
|
+
description: 'Dark mode prompt',
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
// Login method selection - "Select login method:" with Claude account or Console options
|
|
41
|
+
pattern: /select\s*login\s*method|how\s*would\s*you\s*like\s*to\s*authenticate|choose.*auth.*method|select.*auth|subscription\s*or.*api\s*key/i,
|
|
42
|
+
response: '\r', // Press enter for first option (Claude account with subscription)
|
|
43
|
+
delay: 100,
|
|
44
|
+
description: 'Login method selection',
|
|
45
|
+
},
|
|
46
|
+
{
|
|
47
|
+
// Login success - press enter to continue
|
|
48
|
+
pattern: /login\s*successful|logged\s*in.*press\s*enter|press\s*enter\s*to\s*continue/i,
|
|
49
|
+
response: '\r',
|
|
50
|
+
delay: 200,
|
|
51
|
+
description: 'Login success prompt',
|
|
52
|
+
},
|
|
53
|
+
{
|
|
54
|
+
// Trust directory - matches various trust prompts including:
|
|
55
|
+
// "Quick safety check: Is this a project you created or one you trust?"
|
|
56
|
+
// "Yes, I trust this folder"
|
|
57
|
+
// "Do you trust the files in this folder?"
|
|
58
|
+
pattern: /trust\s*(this|the)?\s*(files|directory|folder|workspace)|do\s*you\s*trust|safety\s*check|yes,?\s*i\s*trust/i,
|
|
59
|
+
response: '\r', // Press enter for first option (Yes, proceed)
|
|
60
|
+
delay: 300, // Slightly longer delay for menu to render
|
|
61
|
+
description: 'Trust directory prompt',
|
|
62
|
+
},
|
|
63
|
+
{
|
|
64
|
+
// "Ready to code here?" permission prompt - asks for file access permission
|
|
65
|
+
// Shows "Yes, continue" / "No, exit" options with "Enter to confirm"
|
|
66
|
+
// This is different from trust directory - it's about granting file permissions
|
|
67
|
+
pattern: /ready\s*to\s*code\s*here|permission\s*to\s*work\s*with\s*your\s*files|yes,?\s*continue/i,
|
|
68
|
+
response: '\r', // Press enter to accept "Yes, continue" (already selected)
|
|
69
|
+
delay: 300,
|
|
70
|
+
description: 'Ready to code permission prompt',
|
|
71
|
+
},
|
|
72
|
+
{
|
|
73
|
+
// Fallback: Any "press enter" or "enter to confirm/continue" prompt
|
|
74
|
+
// Keep this LAST so more specific handlers match first
|
|
75
|
+
// NOTE: Error messages like "Press Enter to retry" are handled by checking
|
|
76
|
+
// error patterns FIRST in the PTY handler, so this won't trigger on errors
|
|
77
|
+
pattern: /press\s*enter|enter\s*to\s*(confirm|continue|proceed)|hit\s*enter/i,
|
|
78
|
+
response: '\r',
|
|
79
|
+
delay: 300,
|
|
80
|
+
description: 'Generic enter prompt',
|
|
81
|
+
},
|
|
82
|
+
],
|
|
83
|
+
successPatterns: [/success/i, /authenticated/i, /logged\s*in/i, /you.*(?:are|now).*logged/i],
|
|
84
|
+
errorPatterns: [
|
|
85
|
+
{
|
|
86
|
+
pattern: /oauth\s*error.*(?:status\s*code\s*)?400/i,
|
|
87
|
+
message: 'Authentication failed - the authorization code was invalid or expired',
|
|
88
|
+
recoverable: true,
|
|
89
|
+
hint: 'This usually happens if the login took too long or the code was already used. Please try again and complete the browser login within a few minutes.',
|
|
90
|
+
},
|
|
91
|
+
{
|
|
92
|
+
pattern: /oauth\s*error.*(?:status\s*code\s*)?401/i,
|
|
93
|
+
message: 'Authentication failed - unauthorized',
|
|
94
|
+
recoverable: true,
|
|
95
|
+
hint: 'Please try logging in again.',
|
|
96
|
+
},
|
|
97
|
+
{
|
|
98
|
+
pattern: /oauth\s*error.*(?:status\s*code\s*)?403/i,
|
|
99
|
+
message: 'Authentication failed - access denied',
|
|
100
|
+
recoverable: true,
|
|
101
|
+
hint: 'Your account may not have access to Claude Code. Please check your Anthropic subscription.',
|
|
102
|
+
},
|
|
103
|
+
{
|
|
104
|
+
pattern: /network\s*error|ENOTFOUND|ECONNREFUSED|timeout/i,
|
|
105
|
+
message: 'Network error during authentication',
|
|
106
|
+
recoverable: true,
|
|
107
|
+
hint: 'Please check your internet connection and try again.',
|
|
108
|
+
},
|
|
109
|
+
{
|
|
110
|
+
pattern: /invalid\s*(?:code|token)|code\s*(?:expired|invalid)/i,
|
|
111
|
+
message: 'The authorization code was invalid or has expired',
|
|
112
|
+
recoverable: true,
|
|
113
|
+
hint: 'OAuth codes expire quickly. Please try again and complete the browser login promptly.',
|
|
114
|
+
},
|
|
115
|
+
],
|
|
116
|
+
},
|
|
117
|
+
openai: {
|
|
118
|
+
command: 'codex',
|
|
119
|
+
args: ['login'], // Standard OAuth flow
|
|
120
|
+
deviceFlowArgs: ['login', '--device-auth'], // Device auth for headless/container environments
|
|
121
|
+
supportsDeviceFlow: true,
|
|
122
|
+
urlPattern: /(https:\/\/[^\s]+)/,
|
|
123
|
+
credentialPath: '~/.codex/auth.json',
|
|
124
|
+
displayName: 'Codex',
|
|
125
|
+
waitTimeout: 30000,
|
|
126
|
+
prompts: [
|
|
127
|
+
{
|
|
128
|
+
pattern: /trust\s*(this|the)\s*(directory|folder|workspace)/i,
|
|
129
|
+
response: 'y\r',
|
|
130
|
+
delay: 100,
|
|
131
|
+
description: 'Trust directory prompt',
|
|
132
|
+
},
|
|
133
|
+
],
|
|
134
|
+
successPatterns: [/success/i, /authenticated/i, /logged\s*in/i],
|
|
135
|
+
},
|
|
136
|
+
google: {
|
|
137
|
+
command: 'gemini',
|
|
138
|
+
args: [],
|
|
139
|
+
urlPattern: /(https:\/\/[^\s]+)/,
|
|
140
|
+
displayName: 'Gemini',
|
|
141
|
+
waitTimeout: 30000,
|
|
142
|
+
prompts: [
|
|
143
|
+
{
|
|
144
|
+
// Auth method selection - select first option (Login with Google for OAuth)
|
|
145
|
+
pattern: /login\s*with\s*google|google\s*account|choose.*auth|how\s*would\s*you\s*like\s*to\s*authenticate/i,
|
|
146
|
+
response: '\r',
|
|
147
|
+
delay: 200,
|
|
148
|
+
description: 'Auth method selection',
|
|
149
|
+
},
|
|
150
|
+
{
|
|
151
|
+
// API key detected - press Enter to confirm/continue
|
|
152
|
+
pattern: /press\s*enter|enter\s*to\s*(confirm|continue|proceed)|using.*api.*key|api.*key.*detected/i,
|
|
153
|
+
response: '\r',
|
|
154
|
+
delay: 300,
|
|
155
|
+
description: 'API key confirmation',
|
|
156
|
+
},
|
|
157
|
+
{
|
|
158
|
+
// Accept terms/privacy notice
|
|
159
|
+
pattern: /terms\s*of\s*service|privacy\s*notice|accept|agree/i,
|
|
160
|
+
response: '\r',
|
|
161
|
+
delay: 200,
|
|
162
|
+
description: 'Terms acceptance',
|
|
163
|
+
},
|
|
164
|
+
],
|
|
165
|
+
successPatterns: [/success/i, /authenticated/i, /logged\s*in/i, /ready/i],
|
|
166
|
+
},
|
|
167
|
+
opencode: {
|
|
168
|
+
command: 'opencode',
|
|
169
|
+
args: ['auth', 'login'],
|
|
170
|
+
// OpenCode redirects to provider OAuth pages (Anthropic, OpenAI, Google)
|
|
171
|
+
urlPattern: /(https:\/\/[^\s]+)/,
|
|
172
|
+
credentialPath: '~/.local/share/opencode/auth.json',
|
|
173
|
+
displayName: 'OpenCode',
|
|
174
|
+
waitTimeout: 30000,
|
|
175
|
+
prompts: [
|
|
176
|
+
{
|
|
177
|
+
pattern: /select.*provider|choose.*provider|which.*provider/i,
|
|
178
|
+
response: '\r', // Select first provider (OpenCode Zen - recommended)
|
|
179
|
+
delay: 300,
|
|
180
|
+
description: 'Provider selection',
|
|
181
|
+
},
|
|
182
|
+
{
|
|
183
|
+
pattern: /opencode\s*zen|recommended/i,
|
|
184
|
+
response: '\r', // Confirm provider selection
|
|
185
|
+
delay: 200,
|
|
186
|
+
description: 'Confirm provider',
|
|
187
|
+
},
|
|
188
|
+
],
|
|
189
|
+
// Success patterns include credential added and existing credentials list
|
|
190
|
+
successPatterns: [/success/i, /authenticated/i, /logged\s*in/i, /credential\s*added/i, /\d+\s*credentials?/i],
|
|
191
|
+
},
|
|
192
|
+
droid: {
|
|
193
|
+
command: 'droid',
|
|
194
|
+
args: ['--login'],
|
|
195
|
+
urlPattern: /(https:\/\/[^\s]+)/,
|
|
196
|
+
displayName: 'Droid',
|
|
197
|
+
waitTimeout: 30000,
|
|
198
|
+
prompts: [
|
|
199
|
+
{
|
|
200
|
+
pattern: /sign\s*in|log\s*in|authenticate/i,
|
|
201
|
+
response: '\r',
|
|
202
|
+
delay: 200,
|
|
203
|
+
description: 'Login prompt',
|
|
204
|
+
},
|
|
205
|
+
],
|
|
206
|
+
successPatterns: [/success/i, /authenticated/i, /logged\s*in/i],
|
|
207
|
+
},
|
|
208
|
+
cursor: {
|
|
209
|
+
command: 'agent', // Cursor CLI installs as 'agent'
|
|
210
|
+
args: ['login'], // agent login - triggers OAuth flow
|
|
211
|
+
urlPattern: /(https:\/\/[^\s]+)/,
|
|
212
|
+
credentialPath: '~/.cursor/auth.json',
|
|
213
|
+
displayName: 'Cursor',
|
|
214
|
+
waitTimeout: 30000,
|
|
215
|
+
prompts: [
|
|
216
|
+
{
|
|
217
|
+
// Workspace Trust screen - must press 'a' to trust
|
|
218
|
+
// "Do you want to mark this workspace as trusted?"
|
|
219
|
+
// "[a] Trust this workspace"
|
|
220
|
+
// "[q] Quit"
|
|
221
|
+
pattern: /workspace\s*trust|mark\s*this\s*workspace\s*as\s*trusted|trust\s*this\s*workspace|\[a\]\s*trust/i,
|
|
222
|
+
response: 'a',
|
|
223
|
+
delay: 300,
|
|
224
|
+
description: 'Workspace trust prompt',
|
|
225
|
+
},
|
|
226
|
+
{
|
|
227
|
+
// Generic trust directory prompt (similar to Claude)
|
|
228
|
+
pattern: /trust\s*(this|the)?\s*(files|directory|folder|workspace)|do\s*you\s*trust/i,
|
|
229
|
+
response: '\r',
|
|
230
|
+
delay: 300,
|
|
231
|
+
description: 'Trust directory prompt',
|
|
232
|
+
},
|
|
233
|
+
{
|
|
234
|
+
// Login success - press enter to continue
|
|
235
|
+
pattern: /login\s*successful|logged\s*in.*press\s*enter|press\s*enter\s*to\s*continue/i,
|
|
236
|
+
response: '\r',
|
|
237
|
+
delay: 200,
|
|
238
|
+
description: 'Login success prompt',
|
|
239
|
+
},
|
|
240
|
+
{
|
|
241
|
+
// Generic enter prompt (fallback)
|
|
242
|
+
pattern: /press\s*enter|enter\s*to\s*(confirm|continue|proceed)/i,
|
|
243
|
+
response: '\r',
|
|
244
|
+
delay: 300,
|
|
245
|
+
description: 'Generic enter prompt',
|
|
246
|
+
},
|
|
247
|
+
],
|
|
248
|
+
successPatterns: [/success/i, /authenticated/i, /logged\s*in/i, /you.*(?:are|now).*logged/i],
|
|
249
|
+
errorPatterns: [
|
|
250
|
+
{
|
|
251
|
+
pattern: /oauth\s*error|auth.*failed|authentication\s*error/i,
|
|
252
|
+
message: 'Authentication failed',
|
|
253
|
+
recoverable: true,
|
|
254
|
+
hint: 'Please try logging in again.',
|
|
255
|
+
},
|
|
256
|
+
{
|
|
257
|
+
pattern: /network\s*error|ENOTFOUND|ECONNREFUSED|timeout/i,
|
|
258
|
+
message: 'Network error during authentication',
|
|
259
|
+
recoverable: true,
|
|
260
|
+
hint: 'Please check your internet connection and try again.',
|
|
261
|
+
},
|
|
262
|
+
],
|
|
263
|
+
},
|
|
264
|
+
};
|
|
265
|
+
/**
|
|
266
|
+
* Strip ANSI escape codes from text
|
|
267
|
+
*/
|
|
268
|
+
/* eslint-disable no-control-regex */
|
|
269
|
+
export function stripAnsiCodes(text) {
|
|
270
|
+
// Handle various ANSI escape sequences:
|
|
271
|
+
// - CSI sequences: ESC [ params letter (params can include ?, >, =, etc.)
|
|
272
|
+
// - OSC sequences: ESC ] ... BEL/ST
|
|
273
|
+
// - Simple escapes: ESC letter
|
|
274
|
+
return text
|
|
275
|
+
.replace(/\x1b\[[0-9;?]*[a-zA-Z]/g, '') // CSI sequences including private modes (?2026h, etc.)
|
|
276
|
+
.replace(/\x1b\][^\x07]*\x07/g, '') // OSC sequences (title, etc.)
|
|
277
|
+
.replace(/\x1b[a-zA-Z]/g, ''); // Simple escape sequences
|
|
278
|
+
}
|
|
279
|
+
/* eslint-enable no-control-regex */
|
|
280
|
+
/**
|
|
281
|
+
* Check if text matches any success pattern
|
|
282
|
+
*/
|
|
283
|
+
export function matchesSuccessPattern(text, patterns) {
|
|
284
|
+
const cleanText = stripAnsiCodes(text).toLowerCase();
|
|
285
|
+
return patterns.some((p) => p.test(cleanText));
|
|
286
|
+
}
|
|
287
|
+
/**
|
|
288
|
+
* Find matching prompt handler that hasn't been responded to yet
|
|
289
|
+
*/
|
|
290
|
+
export function findMatchingPrompt(text, prompts, respondedPrompts) {
|
|
291
|
+
const cleanText = stripAnsiCodes(text);
|
|
292
|
+
for (const prompt of prompts) {
|
|
293
|
+
if (respondedPrompts.has(prompt.description))
|
|
294
|
+
continue;
|
|
295
|
+
if (prompt.pattern.test(cleanText)) {
|
|
296
|
+
return prompt;
|
|
297
|
+
}
|
|
298
|
+
}
|
|
299
|
+
return null;
|
|
300
|
+
}
|
|
301
|
+
/**
|
|
302
|
+
* Check if text matches any error pattern and return the matched error
|
|
303
|
+
*/
|
|
304
|
+
export function findMatchingError(text, errorPatterns) {
|
|
305
|
+
if (!errorPatterns || errorPatterns.length === 0)
|
|
306
|
+
return null;
|
|
307
|
+
const cleanText = stripAnsiCodes(text);
|
|
308
|
+
for (const error of errorPatterns) {
|
|
309
|
+
if (error.pattern.test(cleanText)) {
|
|
310
|
+
return error;
|
|
311
|
+
}
|
|
312
|
+
}
|
|
313
|
+
return null;
|
|
314
|
+
}
|
|
315
|
+
/**
|
|
316
|
+
* Get list of supported provider IDs
|
|
317
|
+
*/
|
|
318
|
+
export function getSupportedProviderIds() {
|
|
319
|
+
return Object.keys(CLI_AUTH_CONFIG);
|
|
320
|
+
}
|
|
321
|
+
/**
|
|
322
|
+
* Get list of supported providers with details
|
|
323
|
+
*/
|
|
324
|
+
export function getSupportedProviders() {
|
|
325
|
+
return Object.entries(CLI_AUTH_CONFIG).map(([id, config]) => ({
|
|
326
|
+
id,
|
|
327
|
+
displayName: config.displayName,
|
|
328
|
+
command: config.command,
|
|
329
|
+
}));
|
|
330
|
+
}
|
|
331
|
+
/**
|
|
332
|
+
* Validate a provider's CLI auth configuration
|
|
333
|
+
* Returns null if valid, or an error message if invalid
|
|
334
|
+
*/
|
|
335
|
+
export function validateProviderConfig(providerId, config) {
|
|
336
|
+
if (!config.command || typeof config.command !== 'string') {
|
|
337
|
+
return `${providerId}: missing or invalid 'command'`;
|
|
338
|
+
}
|
|
339
|
+
if (!Array.isArray(config.args)) {
|
|
340
|
+
return `${providerId}: 'args' must be an array`;
|
|
341
|
+
}
|
|
342
|
+
if (!(config.urlPattern instanceof RegExp)) {
|
|
343
|
+
return `${providerId}: 'urlPattern' must be a RegExp`;
|
|
344
|
+
}
|
|
345
|
+
// Check urlPattern has a capture group
|
|
346
|
+
const testUrl = 'https://example.com/test';
|
|
347
|
+
const match = testUrl.match(config.urlPattern);
|
|
348
|
+
if (!match || !match[1]) {
|
|
349
|
+
return `${providerId}: 'urlPattern' must have a capture group - got ${config.urlPattern}`;
|
|
350
|
+
}
|
|
351
|
+
if (!config.displayName || typeof config.displayName !== 'string') {
|
|
352
|
+
return `${providerId}: missing or invalid 'displayName'`;
|
|
353
|
+
}
|
|
354
|
+
if (typeof config.waitTimeout !== 'number' || config.waitTimeout <= 0) {
|
|
355
|
+
return `${providerId}: 'waitTimeout' must be a positive number`;
|
|
356
|
+
}
|
|
357
|
+
if (!Array.isArray(config.prompts)) {
|
|
358
|
+
return `${providerId}: 'prompts' must be an array`;
|
|
359
|
+
}
|
|
360
|
+
for (let i = 0; i < config.prompts.length; i++) {
|
|
361
|
+
const prompt = config.prompts[i];
|
|
362
|
+
if (!(prompt.pattern instanceof RegExp)) {
|
|
363
|
+
return `${providerId}: prompt[${i}].pattern must be a RegExp`;
|
|
364
|
+
}
|
|
365
|
+
if (typeof prompt.response !== 'string') {
|
|
366
|
+
return `${providerId}: prompt[${i}].response must be a string`;
|
|
367
|
+
}
|
|
368
|
+
if (!prompt.description) {
|
|
369
|
+
return `${providerId}: prompt[${i}].description is required`;
|
|
370
|
+
}
|
|
371
|
+
}
|
|
372
|
+
if (!Array.isArray(config.successPatterns)) {
|
|
373
|
+
return `${providerId}: 'successPatterns' must be an array`;
|
|
374
|
+
}
|
|
375
|
+
return null;
|
|
376
|
+
}
|
|
377
|
+
/**
|
|
378
|
+
* Validate all provider configurations
|
|
379
|
+
* Returns array of error messages (empty if all valid)
|
|
380
|
+
*/
|
|
381
|
+
export function validateAllProviderConfigs() {
|
|
382
|
+
const errors = [];
|
|
383
|
+
for (const [id, config] of Object.entries(CLI_AUTH_CONFIG)) {
|
|
384
|
+
const error = validateProviderConfig(id, config);
|
|
385
|
+
if (error) {
|
|
386
|
+
errors.push(error);
|
|
387
|
+
}
|
|
388
|
+
}
|
|
389
|
+
return errors;
|
|
390
|
+
}
|
|
391
|
+
//# sourceMappingURL=cli-auth-config.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cli-auth-config.js","sourceRoot":"","sources":["../src/cli-auth-config.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AA2DH;;;;;;;;;GASG;AACH,MAAM,CAAC,MAAM,eAAe,GAAkC;IAC5D,SAAS,EAAE;QACT,OAAO,EAAE,QAAQ;QACjB,IAAI,EAAE,EAAE;QACR,UAAU,EAAE,oBAAoB;QAChC,cAAc,EAAE,6BAA6B;QAC7C,WAAW,EAAE,QAAQ;QACrB,WAAW,EAAE,KAAK,EAAE,+CAA+C;QACnE,OAAO,EAAE;YACP;gBACE,+DAA+D;gBAC/D,OAAO,EAAE,0DAA0D;gBACnE,QAAQ,EAAE,IAAI;gBACd,KAAK,EAAE,GAAG;gBACV,WAAW,EAAE,0BAA0B;aACxC;YACD;gBACE,OAAO,EAAE,sBAAsB;gBAC/B,QAAQ,EAAE,IAAI,EAAE,gCAAgC;gBAChD,KAAK,EAAE,GAAG;gBACV,WAAW,EAAE,kBAAkB;aAChC;YACD;gBACE,yFAAyF;gBACzF,OAAO,EAAE,sIAAsI;gBAC/I,QAAQ,EAAE,IAAI,EAAE,kEAAkE;gBAClF,KAAK,EAAE,GAAG;gBACV,WAAW,EAAE,wBAAwB;aACtC;YACD;gBACE,0CAA0C;gBAC1C,OAAO,EAAE,8EAA8E;gBACvF,QAAQ,EAAE,IAAI;gBACd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AM,CAAC;AAChB,CAAC"}
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Agent Relay Cloud - Configuration
|
|
3
|
+
*/
|
|
4
|
+
export interface CloudConfig {
|
|
5
|
+
port: number;
|
|
6
|
+
publicUrl: string;
|
|
7
|
+
appUrl: string;
|
|
8
|
+
sessionSecret: string;
|
|
9
|
+
localDashboardUrl?: string;
|
|
10
|
+
databaseUrl: string;
|
|
11
|
+
redisUrl: string;
|
|
12
|
+
github: {
|
|
13
|
+
clientId: string;
|
|
14
|
+
clientSecret: string;
|
|
15
|
+
webhookSecret?: string;
|
|
16
|
+
};
|
|
17
|
+
providers: {
|
|
18
|
+
anthropic?: {
|
|
19
|
+
clientId: string;
|
|
20
|
+
};
|
|
21
|
+
openai?: {
|
|
22
|
+
clientId: string;
|
|
23
|
+
};
|
|
24
|
+
google?: {
|
|
25
|
+
clientId: string;
|
|
26
|
+
clientSecret: string;
|
|
27
|
+
};
|
|
28
|
+
};
|
|
29
|
+
vault: {
|
|
30
|
+
masterKey: string;
|
|
31
|
+
};
|
|
32
|
+
compute: {
|
|
33
|
+
provider: 'fly' | 'railway' | 'docker';
|
|
34
|
+
fly?: {
|
|
35
|
+
apiToken: string;
|
|
36
|
+
org: string;
|
|
37
|
+
region?: string;
|
|
38
|
+
workspaceDomain?: string;
|
|
39
|
+
registryAuth?: {
|
|
40
|
+
username: string;
|
|
41
|
+
password: string;
|
|
42
|
+
};
|
|
43
|
+
snapshotRetentionDays?: number;
|
|
44
|
+
volumeSizeGb?: number;
|
|
45
|
+
};
|
|
46
|
+
railway?: {
|
|
47
|
+
apiToken: string;
|
|
48
|
+
};
|
|
49
|
+
};
|
|
50
|
+
nango: {
|
|
51
|
+
secretKey: string;
|
|
52
|
+
host?: string;
|
|
53
|
+
};
|
|
54
|
+
stripe: {
|
|
55
|
+
secretKey: string;
|
|
56
|
+
publishableKey: string;
|
|
57
|
+
webhookSecret: string;
|
|
58
|
+
priceIds: {
|
|
59
|
+
proMonthly?: string;
|
|
60
|
+
proYearly?: string;
|
|
61
|
+
teamMonthly?: string;
|
|
62
|
+
teamYearly?: string;
|
|
63
|
+
enterpriseMonthly?: string;
|
|
64
|
+
enterpriseYearly?: string;
|
|
65
|
+
};
|
|
66
|
+
};
|
|
67
|
+
adminUsers: string[];
|
|
68
|
+
}
|
|
69
|
+
export declare function loadConfig(): CloudConfig;
|
|
70
|
+
/**
|
|
71
|
+
* Check if a GitHub username is an admin user
|
|
72
|
+
*/
|
|
73
|
+
export declare function isAdminUser(githubUsername: string): boolean;
|
|
74
|
+
export declare function getConfig(): CloudConfig;
|
|
75
|
+
//# sourceMappingURL=cloud-config.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cloud-config.d.ts","sourceRoot":"","sources":["../src/cloud-config.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,MAAM,WAAW,WAAW;IAE1B,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,EAAE,MAAM,CAAC;IACf,aAAa,EAAE,MAAM,CAAC;IAItB,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAG3B,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,EAAE,MAAM,CAAC;IAGjB,MAAM,EAAE;QACN,QAAQ,EAAE,MAAM,CAAC;QACjB,YAAY,EAAE,MAAM,CAAC;QACrB,aAAa,CAAC,EAAE,MAAM,CAAC;KACxB,CAAC;IAIF,SAAS,EAAE;QAET,SAAS,CAAC,EAAE;YAAE,QAAQ,EAAE,MAAM,CAAA;SAAE,CAAC;QAEjC,MAAM,CAAC,EAAE;YAAE,QAAQ,EAAE,MAAM,CAAA;SAAE,CAAC;QAE9B,MAAM,CAAC,EAAE;YAAE,QAAQ,EAAE,MAAM,CAAC;YAAC,YAAY,EAAE,MAAM,CAAA;SAAE,CAAC;KACrD,CAAC;IAGF,KAAK,EAAE;QACL,SAAS,EAAE,MAAM,CAAC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Relay Cloud - Configuration
|
|
3
|
+
*/
|
|
4
|
+
function requireEnv(name) {
|
|
5
|
+
const value = process.env[name];
|
|
6
|
+
if (!value) {
|
|
7
|
+
throw new Error(`Missing required environment variable: ${name}`);
|
|
8
|
+
}
|
|
9
|
+
return value;
|
|
10
|
+
}
|
|
11
|
+
function optionalEnv(name) {
|
|
12
|
+
return process.env[name];
|
|
13
|
+
}
|
|
14
|
+
export function loadConfig() {
|
|
15
|
+
return {
|
|
16
|
+
port: parseInt(process.env.PORT || '4567', 10),
|
|
17
|
+
publicUrl: process.env.PUBLIC_URL || 'http://localhost:4567',
|
|
18
|
+
appUrl: process.env.APP_URL || process.env.PUBLIC_URL || 'http://localhost:4567',
|
|
19
|
+
sessionSecret: requireEnv('SESSION_SECRET'),
|
|
20
|
+
// Local dashboard for channel API (auto-detected if not set)
|
|
21
|
+
localDashboardUrl: optionalEnv('LOCAL_DASHBOARD_URL'),
|
|
22
|
+
databaseUrl: requireEnv('DATABASE_URL'),
|
|
23
|
+
redisUrl: process.env.REDIS_URL || 'redis://localhost:6379',
|
|
24
|
+
github: {
|
|
25
|
+
clientId: requireEnv('GITHUB_CLIENT_ID'),
|
|
26
|
+
clientSecret: requireEnv('GITHUB_CLIENT_SECRET'),
|
|
27
|
+
webhookSecret: optionalEnv('GITHUB_WEBHOOK_SECRET'),
|
|
28
|
+
},
|
|
29
|
+
providers: {
|
|
30
|
+
anthropic: optionalEnv('ANTHROPIC_CLIENT_ID')
|
|
31
|
+
? { clientId: optionalEnv('ANTHROPIC_CLIENT_ID') }
|
|
32
|
+
: undefined,
|
|
33
|
+
openai: optionalEnv('OPENAI_CLIENT_ID')
|
|
34
|
+
? { clientId: optionalEnv('OPENAI_CLIENT_ID') }
|
|
35
|
+
: undefined,
|
|
36
|
+
google: optionalEnv('GOOGLE_CLIENT_ID') && optionalEnv('GOOGLE_CLIENT_SECRET')
|
|
37
|
+
? {
|
|
38
|
+
clientId: optionalEnv('GOOGLE_CLIENT_ID'),
|
|
39
|
+
clientSecret: optionalEnv('GOOGLE_CLIENT_SECRET'),
|
|
40
|
+
}
|
|
41
|
+
: undefined,
|
|
42
|
+
},
|
|
43
|
+
vault: {
|
|
44
|
+
masterKey: requireEnv('VAULT_MASTER_KEY'),
|
|
45
|
+
},
|
|
46
|
+
compute: {
|
|
47
|
+
provider: process.env.COMPUTE_PROVIDER || 'docker',
|
|
48
|
+
fly: optionalEnv('FLY_API_TOKEN')
|
|
49
|
+
? {
|
|
50
|
+
apiToken: optionalEnv('FLY_API_TOKEN'),
|
|
51
|
+
org: optionalEnv('FLY_ORG') || 'personal',
|
|
52
|
+
region: optionalEnv('FLY_REGION') || 'sjc',
|
|
53
|
+
workspaceDomain: optionalEnv('FLY_WORKSPACE_DOMAIN'),
|
|
54
|
+
registryAuth: optionalEnv('GHCR_USERNAME') && optionalEnv('GHCR_TOKEN')
|
|
55
|
+
? {
|
|
56
|
+
username: optionalEnv('GHCR_USERNAME'),
|
|
57
|
+
password: optionalEnv('GHCR_TOKEN'),
|
|
58
|
+
}
|
|
59
|
+
: undefined,
|
|
60
|
+
snapshotRetentionDays: parseInt(optionalEnv('FLY_SNAPSHOT_RETENTION_DAYS') || '14', 10),
|
|
61
|
+
volumeSizeGb: parseInt(optionalEnv('FLY_VOLUME_SIZE_GB') || '10', 10),
|
|
62
|
+
}
|
|
63
|
+
: undefined,
|
|
64
|
+
railway: optionalEnv('RAILWAY_API_TOKEN')
|
|
65
|
+
? {
|
|
66
|
+
apiToken: optionalEnv('RAILWAY_API_TOKEN'),
|
|
67
|
+
}
|
|
68
|
+
: undefined,
|
|
69
|
+
},
|
|
70
|
+
nango: {
|
|
71
|
+
secretKey: requireEnv('NANGO_SECRET_KEY'),
|
|
72
|
+
host: optionalEnv('NANGO_HOST'),
|
|
73
|
+
},
|
|
74
|
+
stripe: {
|
|
75
|
+
secretKey: requireEnv('STRIPE_SECRET_KEY'),
|
|
76
|
+
publishableKey: requireEnv('STRIPE_PUBLISHABLE_KEY'),
|
|
77
|
+
webhookSecret: requireEnv('STRIPE_WEBHOOK_SECRET'),
|
|
78
|
+
priceIds: {
|
|
79
|
+
proMonthly: optionalEnv('STRIPE_PRO_MONTHLY_PRICE_ID'),
|
|
80
|
+
proYearly: optionalEnv('STRIPE_PRO_YEARLY_PRICE_ID'),
|
|
81
|
+
teamMonthly: optionalEnv('STRIPE_TEAM_MONTHLY_PRICE_ID'),
|
|
82
|
+
teamYearly: optionalEnv('STRIPE_TEAM_YEARLY_PRICE_ID'),
|
|
83
|
+
enterpriseMonthly: optionalEnv('STRIPE_ENTERPRISE_MONTHLY_PRICE_ID'),
|
|
84
|
+
enterpriseYearly: optionalEnv('STRIPE_ENTERPRISE_YEARLY_PRICE_ID'),
|
|
85
|
+
},
|
|
86
|
+
},
|
|
87
|
+
// Admin users - comma-separated GitHub usernames (e.g., "khaliqgant,admin2")
|
|
88
|
+
adminUsers: (optionalEnv('ADMIN_USERS') || '')
|
|
89
|
+
.split(',')
|
|
90
|
+
.map((u) => u.trim().toLowerCase())
|
|
91
|
+
.filter(Boolean),
|
|
92
|
+
};
|
|
93
|
+
}
|
|
94
|
+
/**
|
|
95
|
+
* Check if a GitHub username is an admin user
|
|
96
|
+
*/
|
|
97
|
+
export function isAdminUser(githubUsername) {
|
|
98
|
+
const config = getConfig();
|
|
99
|
+
return config.adminUsers.includes(githubUsername.toLowerCase());
|
|
100
|
+
}
|
|
101
|
+
// Singleton config instance
|
|
102
|
+
let _config = null;
|
|
103
|
+
export function getConfig() {
|
|
104
|
+
if (!_config) {
|
|
105
|
+
_config = loadConfig();
|
|
106
|
+
}
|
|
107
|
+
return _config;
|
|
108
|
+
}
|
|
109
|
+
//# sourceMappingURL=cloud-config.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cloud-config.js","sourceRoot":"","sources":["../src/cloud-config.ts"],"names":[],"mappings":"AAAA;;GAEG;AAsFH,SAAS,UAAU,CAAC,IAAY;IAC9B,MAAM,KAAK,GAA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 +1,13 @@
|
|
|
1
|
+
export * from './relay-config.js';
|
|
2
|
+
export * from './bridge-config.js';
|
|
3
|
+
export * from './bridge-utils.js';
|
|
4
|
+
export * from './teams-config.js';
|
|
5
|
+
export * from './shadow-config.js';
|
|
6
|
+
export * from './trajectory-config.js';
|
|
7
|
+
export * from './agent-config.js';
|
|
8
|
+
export * from './cli-auth-config.js';
|
|
9
|
+
export * from './cloud-config.js';
|
|
10
|
+
export * from './project-namespace.js';
|
|
11
|
+
export * from './schemas.js';
|
|
12
|
+
export * from './relay-file-writer.js';
|
|
13
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,mBAAmB,CAAC;AAClC,cAAc,oBAAoB,CAAC;AACnC,cAAc,mBAAmB,CAAC;AAClC,cAAc,mBAAmB,CAAC;AAClC,cAAc,oBAAoB,CAAC;AACnC,cAAc,wBAAwB,CAAC;AACvC,cAAc,mBAAmB,CAAC;AAClC,cAAc,sBAAsB,CAAC;AACrC,cAAc,mBAAmB,CAAC;AAClC,cAAc,wBAAwB,CAAC;AACvC,cAAc,cAAc,CAAC;AAC7B,cAAc,wBAAwB,CAAC"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export * from './relay-config.js';
|
|
2
|
+
export * from './bridge-config.js';
|
|
3
|
+
export * from './bridge-utils.js';
|
|
4
|
+
export * from './teams-config.js';
|
|
5
|
+
export * from './shadow-config.js';
|
|
6
|
+
export * from './trajectory-config.js';
|
|
7
|
+
export * from './agent-config.js';
|
|
8
|
+
export * from './cli-auth-config.js';
|
|
9
|
+
export * from './cloud-config.js';
|
|
10
|
+
export * from './project-namespace.js';
|
|
11
|
+
export * from './schemas.js';
|
|
12
|
+
export * from './relay-file-writer.js';
|
|
13
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,mBAAmB,CAAC;AAClC,cAAc,oBAAoB,CAAC;AACnC,cAAc,mBAAmB,CAAC;AAClC,cAAc,mBAAmB,CAAC;AAClC,cAAc,oBAAoB,CAAC;AACnC,cAAc,wBAAwB,CAAC;AACvC,cAAc,mBAAmB,CAAC;AAClC,cAAc,sBAAsB,CAAC;AACrC,cAAc,mBAAmB,CAAC;AAClC,cAAc,wBAAwB,CAAC;AACvC,cAAc,cAAc,CAAC;AAC7B,cAAc,wBAAwB,CAAC"}
|