@moondeck/station 1.0.13 → 1.0.14

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.
@@ -0,0 +1,61 @@
1
+ /**
2
+ * The seam through which the gemini engine (Antigravity CLI, `agy`) learns
3
+ * about its credential. Deliberately tiny and free of heavy imports, so
4
+ * standard-image.ts and engine-login.ts can use it without the adapter.
5
+ *
6
+ * ADR-178 (owner, 2026-11-24): gemini accounts live in the cloud vault. A
7
+ * subscription account's lease carries agy's whole token file, which the
8
+ * credential consumer writes to `containerTokenPath` in the task (mode 600,
9
+ * credential-consumers/engines.ts); agy alone renews it. An API-key account
10
+ * is an env-token account (GEMINI_API_KEY). `hostSignedIn` only says whether
11
+ * the operator ran agy on this host, which pre-installs agy in a locally
12
+ * built image; it never makes the engine runnable.
13
+ *
14
+ * Guardrail: nothing here ever OPENS the token file. Existence checks only.
15
+ */
16
+ import { existsSync } from "node:fs";
17
+ import { homedir } from "node:os";
18
+ import { join } from "node:path";
19
+
20
+ /** agy's file token store, relative to $HOME. Verified on agy 1.5.16: with no
21
+ * D-Bus (or `AGY_CLI_FORCE_FILE_TOKEN_STORAGE=1`) this single file is the
22
+ * whole sign-in; a fresh HOME holding only it runs turns. */
23
+ export const AGY_TOKEN_RELATIVE_PATH = ".gemini/antigravity-cli/antigravity-oauth-token";
24
+
25
+ /** The same file relative to agy's "gemini dir" (`--gemini_dir`, default
26
+ * `~/.gemini`): what the launcher checks in a spawn's own dir. */
27
+ export const AGY_DIR_TOKEN_PATH = "antigravity-cli/antigravity-oauth-token";
28
+
29
+ /** The command a person runs (in a terminal on the machine) to sign in. */
30
+ export const AGY_LOGIN_COMMAND = "AGY_CLI_FORCE_FILE_TOKEN_STORAGE=1 agy acp --login";
31
+
32
+ export interface GeminiCredentialSource {
33
+ /** Host side: does this runner have a Gemini (Antigravity) sign-in to offer?
34
+ * Drives engine advertisement and the optional image install. */
35
+ hostSignedIn(): boolean;
36
+ /** In-container token path relative to the spawn's gemini dir, checked
37
+ * (existence only) by the adapter's preflight before agy starts. */
38
+ readonly containerTokenPath: string;
39
+ }
40
+
41
+ function ownerHome(): string {
42
+ return process.env.UAI_OWNER_HOME?.trim() || homedir();
43
+ }
44
+
45
+ /** The default source: the task file path agy reads, and whether the
46
+ * operator signed agy in on this host (image pre-install only). */
47
+ export const hostResidentCredentialSource: GeminiCredentialSource = {
48
+ hostSignedIn: () => existsSync(join(ownerHome(), AGY_TOKEN_RELATIVE_PATH)),
49
+ containerTokenPath: AGY_DIR_TOKEN_PATH,
50
+ };
51
+
52
+ let active: GeminiCredentialSource = hostResidentCredentialSource;
53
+
54
+ export function geminiCredentialSource(): GeminiCredentialSource {
55
+ return active;
56
+ }
57
+
58
+ /** Install a different source (the chosen ADR-154 option, or a test double). */
59
+ export function setGeminiCredentialSource(source: GeminiCredentialSource): void {
60
+ active = source;
61
+ }
@@ -0,0 +1,439 @@
1
+ {
2
+ "provenance": {
3
+ "kind": "Real agy 1.5.16 stream-json captures (linux_arm64, Google AI Plus account, 2026-11-24), redacted: conversation ids replaced, cwd and tools list normalized, interrupt stream truncated. No account identifiers.",
4
+ "agyVersion": "1.5.16"
5
+ },
6
+ "firstTurn": [
7
+ {
8
+ "event": "init",
9
+ "conversation_id": "00000000-0000-4000-8000-000000000001",
10
+ "init": {
11
+ "model": "gemini-4-hydrogen-low",
12
+ "cwd": "/workspace/project",
13
+ "tools": [
14
+ "ask_permission",
15
+ "run_command",
16
+ "write_to_file",
17
+ "..."
18
+ ],
19
+ "permission_mode": "request-review"
20
+ }
21
+ },
22
+ {
23
+ "event": "step_update",
24
+ "step_update": {
25
+ "conversation_id": "00000000-0000-4000-8000-000000000001",
26
+ "step_index": 0,
27
+ "state": "DONE",
28
+ "step_type": "user_input"
29
+ }
30
+ },
31
+ {
32
+ "event": "step_update",
33
+ "step_update": {
34
+ "conversation_id": "00000000-0000-4000-8000-000000000001",
35
+ "step_index": 1,
36
+ "state": "ACTIVE",
37
+ "step_type": "agent_response",
38
+ "text_delta": "noted"
39
+ }
40
+ },
41
+ {
42
+ "event": "step_update",
43
+ "step_update": {
44
+ "conversation_id": "00000000-0000-4000-8000-000000000001",
45
+ "step_index": 1,
46
+ "state": "DONE",
47
+ "step_type": "agent_response",
48
+ "text_delta": "\n",
49
+ "duration_seconds": 2.451900438,
50
+ "usage": {
51
+ "input_tokens": 10848,
52
+ "output_tokens": 40,
53
+ "thinking_tokens": 35,
54
+ "cache_read_tokens": 0,
55
+ "total_tokens": 10888
56
+ }
57
+ }
58
+ },
59
+ {
60
+ "event": "result",
61
+ "result": {
62
+ "conversation_id": "00000000-0000-4000-8000-000000000001",
63
+ "status": "SUCCESS",
64
+ "response": "noted\n",
65
+ "duration_seconds": 2.477233085,
66
+ "num_turns": 1,
67
+ "usage": {
68
+ "input_tokens": 10848,
69
+ "output_tokens": 40,
70
+ "thinking_tokens": 35,
71
+ "cache_read_tokens": 0,
72
+ "total_tokens": 10888
73
+ }
74
+ }
75
+ }
76
+ ],
77
+ "resumeTurn": [
78
+ {
79
+ "event": "init",
80
+ "conversation_id": "00000000-0000-4000-8000-000000000001",
81
+ "init": {
82
+ "model": "gemini-4-hydrogen-low",
83
+ "cwd": "/workspace/project",
84
+ "tools": [
85
+ "ask_permission",
86
+ "run_command",
87
+ "write_to_file",
88
+ "..."
89
+ ],
90
+ "permission_mode": "request-review"
91
+ }
92
+ },
93
+ {
94
+ "event": "step_update",
95
+ "step_update": {
96
+ "conversation_id": "00000000-0000-4000-8000-000000000001",
97
+ "step_index": 2,
98
+ "state": "DONE",
99
+ "step_type": "user_input"
100
+ }
101
+ },
102
+ {
103
+ "event": "step_update",
104
+ "step_update": {
105
+ "conversation_id": "00000000-0000-4000-8000-000000000001",
106
+ "step_index": 3,
107
+ "state": "DONE",
108
+ "step_type": "system_message",
109
+ "duration_seconds": 0.000121209
110
+ }
111
+ },
112
+ {
113
+ "event": "step_update",
114
+ "step_update": {
115
+ "conversation_id": "00000000-0000-4000-8000-000000000001",
116
+ "step_index": 4,
117
+ "state": "ACTIVE",
118
+ "step_type": "agent_response",
119
+ "text_delta": "PLUM-42"
120
+ }
121
+ },
122
+ {
123
+ "event": "step_update",
124
+ "step_update": {
125
+ "conversation_id": "00000000-0000-4000-8000-000000000001",
126
+ "step_index": 4,
127
+ "state": "DONE",
128
+ "step_type": "agent_response",
129
+ "text_delta": "\n",
130
+ "duration_seconds": 2.090446218,
131
+ "usage": {
132
+ "input_tokens": 2299,
133
+ "output_tokens": 24,
134
+ "thinking_tokens": 15,
135
+ "cache_read_tokens": 8799,
136
+ "total_tokens": 2323
137
+ }
138
+ }
139
+ },
140
+ {
141
+ "event": "result",
142
+ "result": {
143
+ "conversation_id": "00000000-0000-4000-8000-000000000001",
144
+ "status": "SUCCESS",
145
+ "response": "PLUM-42\n",
146
+ "duration_seconds": 13.011257526,
147
+ "num_turns": 2,
148
+ "usage": {
149
+ "input_tokens": 13147,
150
+ "output_tokens": 64,
151
+ "thinking_tokens": 50,
152
+ "cache_read_tokens": 8799,
153
+ "total_tokens": 13211
154
+ }
155
+ }
156
+ }
157
+ ],
158
+ "toolTurn": [
159
+ {
160
+ "event": "init",
161
+ "conversation_id": "00000000-0000-4000-8000-000000000002",
162
+ "init": {
163
+ "model": "gemini-4-hydrogen-low",
164
+ "cwd": "/workspace/project",
165
+ "tools": [
166
+ "ask_permission",
167
+ "run_command",
168
+ "write_to_file",
169
+ "..."
170
+ ],
171
+ "permission_mode": "always-proceed"
172
+ }
173
+ },
174
+ {
175
+ "event": "step_update",
176
+ "step_update": {
177
+ "conversation_id": "00000000-0000-4000-8000-000000000002",
178
+ "step_index": 0,
179
+ "state": "DONE",
180
+ "step_type": "user_input"
181
+ }
182
+ },
183
+ {
184
+ "event": "step_update",
185
+ "step_update": {
186
+ "conversation_id": "00000000-0000-4000-8000-000000000002",
187
+ "step_index": 1,
188
+ "state": "DONE",
189
+ "step_type": "agent_response",
190
+ "duration_seconds": 2.397640354,
191
+ "usage": {
192
+ "input_tokens": 10143,
193
+ "output_tokens": 121,
194
+ "thinking_tokens": 73,
195
+ "cache_read_tokens": 0,
196
+ "total_tokens": 10264
197
+ }
198
+ }
199
+ },
200
+ {
201
+ "event": "step_update",
202
+ "step_update": {
203
+ "conversation_id": "00000000-0000-4000-8000-000000000002",
204
+ "step_index": 2,
205
+ "state": "ACTIVE",
206
+ "step_type": "tool",
207
+ "tool_name": "run_command",
208
+ "tool_info": {
209
+ "name": "run_command",
210
+ "parameters": {
211
+ "CommandLine": "echo agy_tool_probe"
212
+ }
213
+ }
214
+ }
215
+ },
216
+ {
217
+ "event": "step_update",
218
+ "step_update": {
219
+ "conversation_id": "00000000-0000-4000-8000-000000000002",
220
+ "step_index": 2,
221
+ "state": "DONE",
222
+ "step_type": "tool",
223
+ "tool_name": "run_command",
224
+ "duration_seconds": 0.073555402,
225
+ "tool_info": {
226
+ "name": "run_command",
227
+ "parameters": {
228
+ "CommandLine": "echo agy_tool_probe"
229
+ },
230
+ "output": "Created At: 2026-01-01T00:00:00Z\nCompleted At: 2026-01-01T00:00:00Z\nCommand exited with code 0.\n\nCommand output:\nagy_tool_probe\r\n"
231
+ }
232
+ }
233
+ },
234
+ {
235
+ "event": "step_update",
236
+ "step_update": {
237
+ "conversation_id": "00000000-0000-4000-8000-000000000002",
238
+ "step_index": 3,
239
+ "state": "ACTIVE",
240
+ "step_type": "agent_response",
241
+ "text_delta": "It printed:\n"
242
+ }
243
+ },
244
+ {
245
+ "event": "step_update",
246
+ "step_update": {
247
+ "conversation_id": "00000000-0000-4000-8000-000000000002",
248
+ "step_index": 3,
249
+ "state": "ACTIVE",
250
+ "step_type": "agent_response",
251
+ "text_delta": "\n```\nagy_tool_probe\n```\n\nBANANA"
252
+ }
253
+ },
254
+ {
255
+ "event": "step_update",
256
+ "step_update": {
257
+ "conversation_id": "00000000-0000-4000-8000-000000000002",
258
+ "step_index": 3,
259
+ "state": "DONE",
260
+ "step_type": "agent_response",
261
+ "text_delta": "\n",
262
+ "duration_seconds": 2.00996303,
263
+ "usage": {
264
+ "input_tokens": 2255,
265
+ "output_tokens": 48,
266
+ "thinking_tokens": 28,
267
+ "cache_read_tokens": 8094,
268
+ "total_tokens": 2303
269
+ }
270
+ }
271
+ },
272
+ {
273
+ "event": "result",
274
+ "result": {
275
+ "conversation_id": "00000000-0000-4000-8000-000000000002",
276
+ "status": "SUCCESS",
277
+ "response": "It printed:\n\n```\nagy_tool_probe\n```\n\nBANANA\n",
278
+ "duration_seconds": 4.453549099,
279
+ "num_turns": 1,
280
+ "usage": {
281
+ "input_tokens": 12398,
282
+ "output_tokens": 169,
283
+ "thinking_tokens": 101,
284
+ "cache_read_tokens": 8094,
285
+ "total_tokens": 12567
286
+ }
287
+ }
288
+ }
289
+ ],
290
+ "interruptedTurn": [
291
+ {
292
+ "event": "init",
293
+ "conversation_id": "00000000-0000-4000-8000-000000000003",
294
+ "init": {
295
+ "model": "gemini-4-hydrogen-low",
296
+ "cwd": "/workspace/project",
297
+ "tools": [
298
+ "ask_permission",
299
+ "run_command",
300
+ "write_to_file",
301
+ "..."
302
+ ],
303
+ "permission_mode": "request-review"
304
+ }
305
+ },
306
+ {
307
+ "event": "step_update",
308
+ "step_update": {
309
+ "conversation_id": "00000000-0000-4000-8000-000000000003",
310
+ "step_index": 0,
311
+ "state": "DONE",
312
+ "step_type": "user_input"
313
+ }
314
+ },
315
+ {
316
+ "event": "step_update",
317
+ "step_update": {
318
+ "conversation_id": "00000000-0000-4000-8000-000000000003",
319
+ "step_index": 1,
320
+ "state": "ACTIVE",
321
+ "step_type": "agent_response",
322
+ "text_delta": "1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n"
323
+ }
324
+ },
325
+ {
326
+ "event": "step_update",
327
+ "step_update": {
328
+ "conversation_id": "00000000-0000-4000-8000-000000000003",
329
+ "step_index": 1,
330
+ "state": "ACTIVE",
331
+ "step_type": "agent_response",
332
+ "text_delta": "12\n13\n14\n15\n16\n17\n18\n19\n"
333
+ }
334
+ },
335
+ {
336
+ "event": "step_update",
337
+ "step_update": {
338
+ "conversation_id": "00000000-0000-4000-8000-000000000003",
339
+ "step_index": 1,
340
+ "state": "ACTIVE",
341
+ "step_type": "agent_response",
342
+ "text_delta": "20\n21\n22\n23\n24\n25\n26\n27\n"
343
+ }
344
+ },
345
+ {
346
+ "event": "result",
347
+ "result": {
348
+ "conversation_id": "00000000-0000-4000-8000-000000000003",
349
+ "status": "ERROR",
350
+ "response": "1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n1",
351
+ "error": "interrupted",
352
+ "duration_seconds": 3.529590415,
353
+ "num_turns": 1,
354
+ "usage": {
355
+ "input_tokens": 10859,
356
+ "output_tokens": 555,
357
+ "thinking_tokens": 48,
358
+ "cache_read_tokens": 0,
359
+ "total_tokens": 11414
360
+ },
361
+ "finished_reason": "interrupted"
362
+ }
363
+ }
364
+ ],
365
+ "usageCommand": {
366
+ "conversation_id": "",
367
+ "status": "SUCCESS",
368
+ "response": "Gemini Models\tWeekly Limit Remaining\t100%\t2026-12-01T21:39:59Z\n",
369
+ "duration_seconds": 0,
370
+ "num_turns": 0,
371
+ "usage": {
372
+ "input_tokens": 0,
373
+ "output_tokens": 0,
374
+ "thinking_tokens": 0,
375
+ "cache_read_tokens": 0,
376
+ "total_tokens": 0
377
+ },
378
+ "command": {
379
+ "name": "usage",
380
+ "data": {
381
+ "description": "Within each group, models share a weekly limit and a 5-hour limit. Quota is cons\u2026",
382
+ "groups": [
383
+ {
384
+ "name": "Gemini Models",
385
+ "description": "Models within this group: Gemini 4 Hydrogen, Gemini 3.8 Flash",
386
+ "buckets": [
387
+ {
388
+ "id": "gemini-weekly",
389
+ "name": "Weekly Limit Remaining",
390
+ "window": "weekly",
391
+ "remaining_fraction": 1,
392
+ "reset_time": "2026-12-01T21:39:59Z"
393
+ }
394
+ ]
395
+ },
396
+ {
397
+ "name": "Claude and GPT models",
398
+ "description": "Models within this group: Claude Sonnet 4.6, Claude Opus 4.6, GPT-OSS 120B",
399
+ "buckets": [
400
+ {
401
+ "id": "3p-weekly",
402
+ "name": "Weekly Limit Remaining",
403
+ "window": "weekly",
404
+ "remaining_fraction": 1,
405
+ "reset_time": "1970-01-01T00:00:00Z"
406
+ },
407
+ {
408
+ "id": "3p-5h",
409
+ "name": "Five Hour Limit Remaining",
410
+ "window": "5h",
411
+ "remaining_fraction": 1,
412
+ "reset_time": "1970-01-01T00:00:00Z"
413
+ }
414
+ ]
415
+ }
416
+ ]
417
+ }
418
+ }
419
+ },
420
+ "signedOut": {
421
+ "stderrFirstLine": "Authentication required. Please visit the URL to log in:",
422
+ "result": {
423
+ "conversation_id": "",
424
+ "status": "ERROR",
425
+ "response": "",
426
+ "error": "authentication failed or timed out",
427
+ "duration_seconds": 0,
428
+ "num_turns": 0,
429
+ "usage": {
430
+ "input_tokens": 0,
431
+ "output_tokens": 0,
432
+ "thinking_tokens": 0,
433
+ "cache_read_tokens": 0,
434
+ "total_tokens": 0
435
+ },
436
+ "finished_reason": "error"
437
+ }
438
+ }
439
+ }