@marcusrbrown/infra 0.9.9 → 0.9.10

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@marcusrbrown/infra",
3
- "version": "0.9.9",
3
+ "version": "0.9.10",
4
4
  "description": "Infrastructure management CLI — deploy automation, health checks, and MCP bridge",
5
5
  "keywords": [
6
6
  "infra",
@@ -13,6 +13,7 @@ const envKeys = [
13
13
  'DISCORD_GUILD_ID',
14
14
  'DISCORD_TOKEN',
15
15
  'GATEWAY_HOST',
16
+ 'GATEWAY_TRIGGER_ROLE_ID',
16
17
  'HOME',
17
18
  'OBJECT_STORE_HOSTS',
18
19
  'PATH',
@@ -20,6 +21,11 @@ const envKeys = [
20
21
  'S3_ENDPOINT',
21
22
  'S3_REGION',
22
23
  'SSH_AUTH_SOCK',
24
+ 'WORKSPACE_OPENCODE_AUTH',
25
+ 'WORKSPACE_OPENCODE_CONFIG',
26
+ 'WORKSPACE_OPENCODE_MODEL',
27
+ 'WORKSPACE_OPENCODE_TOKEN',
28
+ 'WORKSPACE_OPENCODE_URL',
23
29
  ] as const
24
30
 
25
31
  type ManagedEnvKey = (typeof envKeys)[number]
@@ -269,6 +275,92 @@ describe('gateway deploy', () => {
269
275
  const env = getGatewayDeployEnv()
270
276
  expect(env.DISCORD_PRIVILEGED_INTENTS).toBe('')
271
277
  })
278
+
279
+ // ── workspace mention-loop var parity ─────────────────────────────────────
280
+
281
+ it('forwards WORKSPACE_OPENCODE_TOKEN when set', () => {
282
+ setManagedEnv({
283
+ GATEWAY_HOST: 'gateway.example.com',
284
+ HOME: '/tmp/test-home',
285
+ PATH: '/usr/bin:/bin',
286
+ SSH_AUTH_SOCK: '/tmp/test-sock',
287
+ WORKSPACE_OPENCODE_TOKEN: 'ws-tok-123',
288
+ })
289
+ const env = getGatewayDeployEnv()
290
+ expect(env.WORKSPACE_OPENCODE_TOKEN).toBe('ws-tok-123')
291
+ })
292
+
293
+ it('forwards WORKSPACE_OPENCODE_AUTH when set', () => {
294
+ setManagedEnv({
295
+ GATEWAY_HOST: 'gateway.example.com',
296
+ HOME: '/tmp/test-home',
297
+ PATH: '/usr/bin:/bin',
298
+ SSH_AUTH_SOCK: '/tmp/test-sock',
299
+ WORKSPACE_OPENCODE_AUTH: '{"provider":{}}',
300
+ })
301
+ const env = getGatewayDeployEnv()
302
+ expect(env.WORKSPACE_OPENCODE_AUTH).toBe('{"provider":{}}')
303
+ })
304
+
305
+ it('forwards WORKSPACE_OPENCODE_URL when set', () => {
306
+ setManagedEnv({
307
+ GATEWAY_HOST: 'gateway.example.com',
308
+ HOME: '/tmp/test-home',
309
+ PATH: '/usr/bin:/bin',
310
+ SSH_AUTH_SOCK: '/tmp/test-sock',
311
+ WORKSPACE_OPENCODE_URL: 'http://workspace:9200',
312
+ })
313
+ const env = getGatewayDeployEnv()
314
+ expect(env.WORKSPACE_OPENCODE_URL).toBe('http://workspace:9200')
315
+ })
316
+
317
+ it('WORKSPACE_OPENCODE_URL unset → forwarded as empty string (optional)', () => {
318
+ setManagedEnv({
319
+ GATEWAY_HOST: 'gateway.example.com',
320
+ HOME: '/tmp/test-home',
321
+ PATH: '/usr/bin:/bin',
322
+ SSH_AUTH_SOCK: '/tmp/test-sock',
323
+ WORKSPACE_OPENCODE_URL: undefined,
324
+ })
325
+ const env = getGatewayDeployEnv()
326
+ expect(env.WORKSPACE_OPENCODE_URL).toBe('')
327
+ })
328
+
329
+ it('forwards WORKSPACE_OPENCODE_MODEL when set', () => {
330
+ setManagedEnv({
331
+ GATEWAY_HOST: 'gateway.example.com',
332
+ HOME: '/tmp/test-home',
333
+ PATH: '/usr/bin:/bin',
334
+ SSH_AUTH_SOCK: '/tmp/test-sock',
335
+ WORKSPACE_OPENCODE_MODEL: 'anthropic/claude-sonnet-4-6',
336
+ })
337
+ const env = getGatewayDeployEnv()
338
+ expect(env.WORKSPACE_OPENCODE_MODEL).toBe('anthropic/claude-sonnet-4-6')
339
+ })
340
+
341
+ it('forwards WORKSPACE_OPENCODE_CONFIG when set', () => {
342
+ setManagedEnv({
343
+ GATEWAY_HOST: 'gateway.example.com',
344
+ HOME: '/tmp/test-home',
345
+ PATH: '/usr/bin:/bin',
346
+ SSH_AUTH_SOCK: '/tmp/test-sock',
347
+ WORKSPACE_OPENCODE_CONFIG: '{"provider":{}}',
348
+ })
349
+ const env = getGatewayDeployEnv()
350
+ expect(env.WORKSPACE_OPENCODE_CONFIG).toBe('{"provider":{}}')
351
+ })
352
+
353
+ it('forwards GATEWAY_TRIGGER_ROLE_ID when set', () => {
354
+ setManagedEnv({
355
+ GATEWAY_HOST: 'gateway.example.com',
356
+ HOME: '/tmp/test-home',
357
+ PATH: '/usr/bin:/bin',
358
+ SSH_AUTH_SOCK: '/tmp/test-sock',
359
+ GATEWAY_TRIGGER_ROLE_ID: '987654321098765432',
360
+ })
361
+ const env = getGatewayDeployEnv()
362
+ expect(env.GATEWAY_TRIGGER_ROLE_ID).toBe('987654321098765432')
363
+ })
272
364
  })
273
365
 
274
366
  describe('validateGatewayRemotePreconditions', () => {
@@ -50,6 +50,12 @@ export function getGatewayDeployEnv(): Record<string, string> {
50
50
  GH_APP_ID: process.env.GH_APP_ID ?? '',
51
51
  GH_APP_PRIVATE_KEY: process.env.GH_APP_PRIVATE_KEY ?? '',
52
52
  DISCORD_PRIVILEGED_INTENTS: process.env.DISCORD_PRIVILEGED_INTENTS ?? '',
53
+ WORKSPACE_OPENCODE_TOKEN: process.env.WORKSPACE_OPENCODE_TOKEN ?? '',
54
+ WORKSPACE_OPENCODE_AUTH: process.env.WORKSPACE_OPENCODE_AUTH ?? '',
55
+ WORKSPACE_OPENCODE_URL: process.env.WORKSPACE_OPENCODE_URL ?? '',
56
+ WORKSPACE_OPENCODE_MODEL: process.env.WORKSPACE_OPENCODE_MODEL ?? '',
57
+ WORKSPACE_OPENCODE_CONFIG: process.env.WORKSPACE_OPENCODE_CONFIG ?? '',
58
+ GATEWAY_TRIGGER_ROLE_ID: process.env.GATEWAY_TRIGGER_ROLE_ID ?? '',
53
59
  }
54
60
  }
55
61