@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.
- package/images/standard/Dockerfile +32 -0
- package/images/standard/README.md +7 -7
- package/lib/agent-cli-issues.ts +42 -13
- package/lib/agent-cli.ts +63 -42
- package/lib/agents/agy-pin.ts +36 -0
- package/lib/agents/agy-scrub.ts +11 -0
- package/lib/agents/claude.ts +5 -2
- package/lib/agents/codex.ts +5 -0
- package/lib/agents/factory.ts +1 -0
- package/lib/agents/gemini-credentials.ts +61 -0
- package/lib/agents/gemini-stream.fixture.json +439 -0
- package/lib/agents/gemini.ts +836 -0
- package/lib/agents/transport.ts +5 -2
- package/lib/credential-cleanup-inventory.ts +19 -1
- package/lib/credential-consumers/engines.ts +70 -9
- package/lib/engine-accounts.ts +3 -0
- package/lib/engine-login.ts +162 -7
- package/lib/engine-spawn-env.ts +63 -0
- package/lib/orchestrator.ts +62 -25
- package/lib/standard-image-pin.ts +2 -1
- package/lib/standard-image.ts +9 -1
- package/lib/task-credential-cleanup.ts +3 -1
- package/package.json +1 -1
- package/scripts/agent/task-up.sh +36 -0
- package/scripts/agent/uai-env-exec.sh +89 -1
- package/src/cloud-credentials.ts +6 -0
- package/src/engine-account-paths.ts +2 -0
- package/src/engine-usage.ts +1 -0
- package/src/index.ts +4 -1
- package/src/main.ts +7 -1
- package/src/protocol.ts +7 -4
- package/src/task-env-names.ts +70 -0
|
@@ -38,6 +38,12 @@ ENV UAI_CLAUDE_CODE_VERSION=2.1.322
|
|
|
38
38
|
ENV UAI_CODEX_CLI_VERSION=0.164.0
|
|
39
39
|
ENV UAI_CURSOR_AGENT_VERSION=2026.10.22-27dcf5f
|
|
40
40
|
ENV UAI_GROK_CLI_VERSION=1.0.70
|
|
41
|
+
# Antigravity CLI (gemini engine). Pinned by tarball URL + SHA-512 from Google's
|
|
42
|
+
# per-platform manifest (antigravity-cli-auto-updater…/manifests/linux_*.json).
|
|
43
|
+
ENV UAI_AGY_CLI_VERSION=1.5.16
|
|
44
|
+
ENV UAI_AGY_CLI_BUILD=1.5.16-5250855658717184
|
|
45
|
+
ENV UAI_AGY_SHA512_X64=3dee9f26e298156db673f6ce2a0f5dfed5b30006e04ceb9809c68070e7b717587b33a3da0f8bc2eda45af81a50bc8b14c82b28ae5832bcfe3e7fd49397117b31
|
|
46
|
+
ENV UAI_AGY_SHA512_ARM64=23c193151499a4986fd5fa0d8132665cc8ffbad6cc0b3ff4fd53a2cb68abb76b149a992b836d53063443cd89add335f14d8134fb02abdcecbf6e1eaef6c53d33
|
|
41
47
|
|
|
42
48
|
# ---------------------------------------------------------------------------
|
|
43
49
|
# 1. System packages.
|
|
@@ -349,6 +355,32 @@ RUN if [ "$INSTALL_OPENCODE" = "1" ]; then \
|
|
|
349
355
|
|| echo "[warn] opencode install failed — opencode engine unavailable in this image"; \
|
|
350
356
|
fi
|
|
351
357
|
|
|
358
|
+
# Antigravity CLI (`agy`, the gemini engine) — one ~246 MB Go binary at
|
|
359
|
+
# /home/node/.local/bin/agy. Pinned build, checksum-verified, self-update off
|
|
360
|
+
# (AGY_CLI_DISABLE_AUTO_UPDATE). Non-fatal like the others.
|
|
361
|
+
ARG INSTALL_GEMINI=0
|
|
362
|
+
RUN if [ "$INSTALL_GEMINI" = "1" ]; then \
|
|
363
|
+
bash -lc 'set -e; \
|
|
364
|
+
case "$(uname -m)" in \
|
|
365
|
+
x86_64|amd64) agy_dir=linux-x64; agy_pkg=cli_linux_x64; agy_sum="$UAI_AGY_SHA512_X64" ;; \
|
|
366
|
+
aarch64|arm64) agy_dir=linux-arm; agy_pkg=cli_linux_arm64; agy_sum="$UAI_AGY_SHA512_ARM64" ;; \
|
|
367
|
+
*) echo "unsupported Antigravity CLI architecture: $(uname -m)" >&2; exit 1 ;; \
|
|
368
|
+
esac; \
|
|
369
|
+
agy_tmp="$(mktemp -d)"; \
|
|
370
|
+
curl -fsSL -o "$agy_tmp/agy.tar.gz" "https://storage.googleapis.com/antigravity-public/antigravity-cli/$UAI_AGY_CLI_BUILD/$agy_dir/$agy_pkg.tar.gz"; \
|
|
371
|
+
echo "$agy_sum $agy_tmp/agy.tar.gz" | sha512sum -c -; \
|
|
372
|
+
tar -xzf "$agy_tmp/agy.tar.gz" -C "$agy_tmp" antigravity; \
|
|
373
|
+
mkdir -p "$HOME/.local/bin"; \
|
|
374
|
+
install -m 0755 "$agy_tmp/antigravity" "$HOME/.local/bin/agy"; \
|
|
375
|
+
rm -rf -- "$agy_tmp"; \
|
|
376
|
+
test "$(AGY_CLI_DISABLE_AUTO_UPDATE=true "$HOME/.local/bin/agy" --version)" = "$UAI_AGY_CLI_VERSION"' \
|
|
377
|
+
|| { \
|
|
378
|
+
rm -f -- "$HOME/.local/bin/agy"; \
|
|
379
|
+
echo "[warn] antigravity cli install failed — gemini engine unavailable in this image"; \
|
|
380
|
+
}; \
|
|
381
|
+
fi
|
|
382
|
+
ENV AGY_CLI_DISABLE_AUTO_UPDATE=true
|
|
383
|
+
|
|
352
384
|
ENV PATH=/home/node/.local/bin:$PATH
|
|
353
385
|
|
|
354
386
|
# ---------------------------------------------------------------------------
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
The single per-host workbench image, built once at host startup and cached as
|
|
4
4
|
`moondeck-standard:dev` (ADR-022). Every task reuses it unchanged unless a selected
|
|
5
|
-
|
|
5
|
+
repository declares an [`extra`](../../../docs/runtime.md#the-extra-escape-hatch)
|
|
6
6
|
snippet, in which case task-up derives `uai-task-<id>` FROM this image.
|
|
7
7
|
|
|
8
8
|
See [`docs/runtime.md`](../../../docs/runtime.md) for the authoritative spec.
|
|
@@ -28,9 +28,9 @@ See [`docs/runtime.md`](../../../docs/runtime.md) for the authoritative spec.
|
|
|
28
28
|
pinning a default Node + Python. The `tool-versions` file in this directory is
|
|
29
29
|
the authoritative source for the numbers; the `Dockerfile` `COPY`s it to
|
|
30
30
|
`/home/node/.tool-versions` and installs exactly those versions at build time.
|
|
31
|
-
This guarantees the agent CLIs and a 0-
|
|
31
|
+
This guarantees the agent CLIs and a 0-repository scratchpad always have a
|
|
32
32
|
runtime. asdf uses its default `.tool-versions` filename and walks UP from the
|
|
33
|
-
cwd, so a
|
|
33
|
+
cwd, so a repository's `/workspace/<slug>/.tool-versions` **takes precedence**;
|
|
34
34
|
the home file is only the fallback. (Do **not** set
|
|
35
35
|
`ASDF_DEFAULT_TOOL_VERSIONS_FILENAME` to an absolute path — that overrides the
|
|
36
36
|
search filename and makes asdf ignore per-project files.)
|
|
@@ -47,9 +47,9 @@ See [`docs/runtime.md`](../../../docs/runtime.md) for the authoritative spec.
|
|
|
47
47
|
- **`uai-materialize-runtimes`** baked at
|
|
48
48
|
`/usr/local/bin/uai-materialize-runtimes`; it is the credential-free,
|
|
49
49
|
workspace-read-only shared-cache writer used before Compose starts a task.
|
|
50
|
-
The host supplies the selected
|
|
50
|
+
The host supplies the selected repository slugs at the fixed, read-only
|
|
51
51
|
`/run/uai/runtime-projects` allowlist; only those immediate Git worktrees are
|
|
52
|
-
inspected, so workspace control/shared directories cannot become
|
|
52
|
+
inspected, so workspace control/shared directories cannot become repositories.
|
|
53
53
|
- **`uai-init`** baked at `/usr/local/bin/uai-init`; it installs task-local
|
|
54
54
|
dependencies and starts code-server, but does not mutate asdf runtimes.
|
|
55
55
|
- **Task-private npm globals** under `/home/node/.local/share/uai-npm`, with
|
|
@@ -83,7 +83,7 @@ stale. To build by hand from the repo root:
|
|
|
83
83
|
docker build -t moondeck-standard:dev host-agent/images/standard
|
|
84
84
|
```
|
|
85
85
|
|
|
86
|
-
A derived per-task image (when a
|
|
86
|
+
A derived per-task image (when a repository has `extra`) is built by `task-up`
|
|
87
87
|
from a generated `.uai/Dockerfile` that is `FROM moondeck-standard:dev` plus the
|
|
88
88
|
concatenated `extra` RUN lines, tagged `uai-task-<id>`.
|
|
89
89
|
|
|
@@ -97,7 +97,7 @@ steps below are for local image iteration only.
|
|
|
97
97
|
docker build -t moondeck-standard:dev host-agent/images/standard
|
|
98
98
|
|
|
99
99
|
# 2. Create the shared asdf data volume + a throwaway Git worktree and the
|
|
100
|
-
# host-controlled selected-
|
|
100
|
+
# host-controlled selected-repository allowlist.
|
|
101
101
|
docker volume create moondeck-asdf-data
|
|
102
102
|
mkdir -p /tmp/uai-smoke/workspace/demo/.git
|
|
103
103
|
printf 'nodejs 22.11.0\n' > /tmp/uai-smoke/workspace/demo/.tool-versions
|
package/lib/agent-cli-issues.ts
CHANGED
|
@@ -37,6 +37,22 @@ function issueExpectedRevision(flags) {
|
|
|
37
37
|
issueUsage("--expected-revision must be a nonnegative safe integer");
|
|
38
38
|
return expected === undefined ? undefined : Number(expected);
|
|
39
39
|
}
|
|
40
|
+
function issueViewerDate() {
|
|
41
|
+
const date = new Date();
|
|
42
|
+
return String(date.getFullYear()).padStart(4, "0") + "-" + String(date.getMonth() + 1).padStart(2, "0") + "-" + String(date.getDate()).padStart(2, "0");
|
|
43
|
+
}
|
|
44
|
+
function issueCalendarDate(value, flag) {
|
|
45
|
+
if (value === undefined) return undefined;
|
|
46
|
+
const date = new Date(value + "T00:00:00.000Z");
|
|
47
|
+
if (!/^(19|[2-9]\d)\d{2}-\d{2}-\d{2}$/.test(value) || !Number.isFinite(date.getTime()) || date.toISOString().slice(0, 10) !== value)
|
|
48
|
+
issueUsage("--" + flag + " must be a real calendar date in YYYY-MM-DD format, from 1900-01-01 through 9999-12-31; nothing was sent");
|
|
49
|
+
return value;
|
|
50
|
+
}
|
|
51
|
+
function issueDeadline(flags) {
|
|
52
|
+
if (flags.deadline !== undefined && flags["clear-deadline"])
|
|
53
|
+
issueUsage("--deadline and --clear-deadline cannot be combined; nothing was sent");
|
|
54
|
+
return flags["clear-deadline"] ? null : issueCalendarDate(flags.deadline, "deadline");
|
|
55
|
+
}
|
|
40
56
|
function issueLabelOptions(flags) {
|
|
41
57
|
const add = flags.label || [], remove = flags["remove-label"] || [];
|
|
42
58
|
const replace = flags.labels !== undefined, clear = !!flags["clear-labels"];
|
|
@@ -104,6 +120,8 @@ function issueHierarchyLine(issue) {
|
|
|
104
120
|
return issue.key + " " + issue.title + " [" + issue.status.name + "]";
|
|
105
121
|
}
|
|
106
122
|
function issueErrorHint(code, status, context, retryAfter, details) {
|
|
123
|
+
if (code === "ISSUE_CURSOR_INVALID" && context?.deadlineFilter)
|
|
124
|
+
console.error("If the viewer day rolled over between pages, restart from page 1 without --cursor. Use --viewer-date YYYY-MM-DD for a human's local day.");
|
|
107
125
|
if (context?.commentAction && status === 403)
|
|
108
126
|
console.error("Comments require issues.read + issues.write within the owner's rights; a human must grant missing issues.write. Edit/delete requires the same owner, Task and agent that posted the comment.");
|
|
109
127
|
if (context?.commentAction && code === "ISSUE_COMMENT_CONFLICT")
|
|
@@ -140,16 +158,17 @@ function issueErrorHint(code, status, context, retryAfter, details) {
|
|
|
140
158
|
else if (context?.parentKey && status === 403)
|
|
141
159
|
console.error("Setting a parent requires issues.read on the parent and issues.write on the child, within the human owner's permissions. A human must grant any missing access.");
|
|
142
160
|
}
|
|
143
|
-
function issueLine(issue) {
|
|
161
|
+
function issueLine(issue, viewerDate = issueViewerDate()) {
|
|
144
162
|
const assignees = (issue.assignees || []).map((a) => a.handle ? "@" + a.handle : a.name || a.userId).join(", ") || "unassigned";
|
|
145
163
|
return issue.identifier + (issue.archivedAt != null ? " [archived]" : "") + " " + issue.title + " [" + (issue.status?.name || issue.statusId) + "] " + issue.priority +
|
|
146
164
|
" " + (issue.project?.key || issue.projectId) + " " + assignees +
|
|
147
|
-
" labels: " + ((issue.labels || []).map(label => label.name).join(", ") || "none")
|
|
165
|
+
" labels: " + ((issue.labels || []).map(label => label.name).join(", ") || "none") +
|
|
166
|
+
(issue.deadline ? " deadline: " + issue.deadline + (issue.deadline < viewerDate && !["done", "canceled"].includes(issue.status?.category) ? " [overdue]" : "") : "");
|
|
148
167
|
}
|
|
149
|
-
function issuePage(page, current, json) {
|
|
168
|
+
function issuePage(page, current, json, viewerDate) {
|
|
150
169
|
if (json) return out(page);
|
|
151
170
|
const issues = current ? page.issues.map((entry) => entry.issue) : page.issues;
|
|
152
|
-
out(issues.length ? issues.map(issueLine).join(NL) : "No issues.");
|
|
171
|
+
out(issues.length ? issues.map(issue => issueLine(issue, viewerDate)).join(NL) : "No issues.");
|
|
153
172
|
if (page.nextCursor) out("More issues: repeat this command with --cursor " + page.nextCursor);
|
|
154
173
|
}
|
|
155
174
|
async function issueReadDetail(key, initial) {
|
|
@@ -224,16 +243,21 @@ async function issueCommand(action, args) {
|
|
|
224
243
|
? catalog.labels.map(label => label.name + " " + label.color + " " + label.id).join(NL) : "No workspace labels.");
|
|
225
244
|
}
|
|
226
245
|
if (action === "list" || action === "current") {
|
|
227
|
-
const allowed = action === "list" ? ["status", "assignee", "project", "priority", "label", "archived", "q", "limit", "cursor", "no-sub-issues", "exclude-tree-of", "json"] : ["limit", "cursor", "json"];
|
|
246
|
+
const allowed = action === "list" ? ["status", "assignee", "project", "priority", "label", "archived", "deadline", "viewer-date", "sort", "q", "limit", "cursor", "no-sub-issues", "exclude-tree-of", "json"] : ["limit", "cursor", "json"];
|
|
228
247
|
const { flags, positional } = issueFlags(args, allowed, ["json", "no-sub-issues"]);
|
|
229
248
|
if (positional.length) issueUsage(action + " does not take positional arguments");
|
|
230
249
|
if (action === "current" && flags.limit !== undefined && Number(flags.limit) > 5) issueUsage("current --limit must be from 1 to 5");
|
|
231
250
|
if (flags.assignee?.length > 1) issueUsage("list accepts one --assignee");
|
|
232
251
|
if (flags.archived !== undefined && !["only", "include"].includes(flags.archived))
|
|
233
252
|
issueUsage("--archived must be only or include; omit it to exclude archived Issues");
|
|
253
|
+
if (flags.deadline !== undefined && !["overdue", "next7", "none"].includes(flags.deadline))
|
|
254
|
+
issueUsage("list --deadline must be overdue, next7 or none");
|
|
255
|
+
if (flags.sort !== undefined && flags.sort !== "deadline") issueUsage("--sort must be deadline");
|
|
256
|
+
const viewerDate = issueCalendarDate(flags["viewer-date"], "viewer-date") ?? issueViewerDate();
|
|
234
257
|
const labels = issueLabelOptions(flags);
|
|
235
258
|
const query = new URLSearchParams();
|
|
236
|
-
for (const [name, value] of Object.entries(flags)) if (name !== "json" && name !== "label" && name !== "no-sub-issues" && name !== "exclude-tree-of") query.set(name, name === "assignee" ? value[0] : value);
|
|
259
|
+
for (const [name, value] of Object.entries(flags)) if (name !== "json" && name !== "label" && name !== "no-sub-issues" && name !== "exclude-tree-of" && name !== "viewer-date") query.set(name, name === "assignee" ? value[0] : value);
|
|
260
|
+
if (flags.deadline !== undefined || flags["viewer-date"] !== undefined) query.set("viewerDate", viewerDate);
|
|
237
261
|
if (labels.changed) for (const id of await issueLabelSet(labels)) query.append("labelIds", id);
|
|
238
262
|
if (flags["exclude-tree-of"] !== undefined) {
|
|
239
263
|
const selector = flags["exclude-tree-of"];
|
|
@@ -242,12 +266,12 @@ async function issueCommand(action, args) {
|
|
|
242
266
|
query.set("excludeTreeOf", root.issue.id);
|
|
243
267
|
}
|
|
244
268
|
if (flags["no-sub-issues"]) query.set("showSubIssues", "false");
|
|
245
|
-
const page = await api("GET", base + (action === "current" ? "/current" : "") + "?" + query);
|
|
269
|
+
const page = await api("GET", base + (action === "current" ? "/current" : "") + "?" + query, undefined, { deadlineFilter: flags.deadline });
|
|
246
270
|
if (action === "current" && flags.json) {
|
|
247
271
|
page.issues = page.issues.map(issueDetailContext);
|
|
248
272
|
}
|
|
249
273
|
if (page.skippedIssues) console.error("Warning: " + page.skippedIssues + " Issue(s) disappeared while reading current; refresh or continue with the returned cursor.");
|
|
250
|
-
return issuePage(page, action === "current", flags.json);
|
|
274
|
+
return issuePage(page, action === "current", flags.json, viewerDate);
|
|
251
275
|
}
|
|
252
276
|
if (action === "comments") {
|
|
253
277
|
const { flags, positional } = issueFlags(args, ["limit", "before-seq", "json"]);
|
|
@@ -337,11 +361,12 @@ async function issueCommand(action, args) {
|
|
|
337
361
|
return out(flags.json ? result : (result.changed ? "Updated " : "Already set: ") + key + " item " + itemIndex + " " + (checked ? "[x] " : "[ ] ") + item.text + " (revision " + result.issue.revision + ")");
|
|
338
362
|
}
|
|
339
363
|
if (action === "show") {
|
|
340
|
-
const { flags, positional } = issueFlags(args, ["json"]);
|
|
364
|
+
const { flags, positional } = issueFlags(args, ["viewer-date", "json"]);
|
|
341
365
|
const key = issueKey(positional);
|
|
366
|
+
const viewerDate = issueCalendarDate(flags["viewer-date"], "viewer-date") ?? issueViewerDate();
|
|
342
367
|
const detail = await issueReadDetail(key);
|
|
343
368
|
if (flags.json) return out(detail);
|
|
344
|
-
out(issueLine(detail.issue));
|
|
369
|
+
out(issueLine(detail.issue, viewerDate));
|
|
345
370
|
out("Revision: " + detail.issue.revision);
|
|
346
371
|
if (detail.url) out("URL: " + detail.url);
|
|
347
372
|
const progress = detail.issue.checklistProgress || issueChecklistProgress(detail.issue.description || "");
|
|
@@ -360,11 +385,13 @@ async function issueCommand(action, args) {
|
|
|
360
385
|
return;
|
|
361
386
|
}
|
|
362
387
|
if (action === "create") {
|
|
363
|
-
const { flags, positional } = issueFlags(args, ["title", "description", "project", "status", "assignee", "priority", "parent", "label", "json"]);
|
|
388
|
+
const { flags, positional } = issueFlags(args, ["title", "description", "project", "status", "assignee", "priority", "parent", "label", "deadline", "json"]);
|
|
364
389
|
if (positional.length || !flags.title?.trim()) issueUsage("create needs --title and no positional arguments");
|
|
365
390
|
issueParentKey(flags);
|
|
366
391
|
const labels = issueLabelOptions(flags);
|
|
367
392
|
const body = {};
|
|
393
|
+
const deadline = issueDeadline(flags);
|
|
394
|
+
if (deadline !== undefined) body.deadline = deadline;
|
|
368
395
|
for (const name of ["title", "description", "project", "status", "priority"]) if (flags[name] !== undefined) body[name] = flags[name];
|
|
369
396
|
if (flags.assignee) body.assignees = flags.assignee;
|
|
370
397
|
if (labels.changed) body.labelIds = await issueLabelSet(labels);
|
|
@@ -373,12 +400,14 @@ async function issueCommand(action, args) {
|
|
|
373
400
|
return out(flags.json ? result : "Created " + issueLine(result.issue));
|
|
374
401
|
}
|
|
375
402
|
if (action === "update") {
|
|
376
|
-
const { flags, positional } = issueFlags(args, ["status", "assignee", "priority", "title", "description", "description-file", "clear-description", "expected-revision", "parent", "no-parent", "label", "remove-label", "labels", "clear-labels", "override-active-tasks", "json"], ["json", "override-active-tasks", "no-parent", "clear-description", "clear-labels"]);
|
|
403
|
+
const { flags, positional } = issueFlags(args, ["status", "assignee", "priority", "title", "description", "description-file", "clear-description", "expected-revision", "parent", "no-parent", "label", "remove-label", "labels", "clear-labels", "deadline", "clear-deadline", "override-active-tasks", "json"], ["json", "override-active-tasks", "no-parent", "clear-description", "clear-labels", "clear-deadline"]);
|
|
377
404
|
const key = issueKey(positional);
|
|
378
405
|
issueParentKey(flags);
|
|
379
406
|
const expected = issueExpectedRevision(flags);
|
|
380
407
|
const labels = issueLabelOptions(flags);
|
|
381
408
|
const body = {};
|
|
409
|
+
const deadline = issueDeadline(flags);
|
|
410
|
+
if (deadline !== undefined) body.deadline = deadline;
|
|
382
411
|
const description = issueDescription(flags);
|
|
383
412
|
if (description !== undefined) body.description = description;
|
|
384
413
|
if (flags["no-parent"]) body.parentId = null;
|
|
@@ -387,7 +416,7 @@ async function issueCommand(action, args) {
|
|
|
387
416
|
if (flags.assignee.some((s) => !/^[+-].+/.test(s))) issueUsage("update --assignee needs +HANDLE or -HANDLE (repeat for multiple changes)");
|
|
388
417
|
body.assignees = flags.assignee;
|
|
389
418
|
}
|
|
390
|
-
if (!Object.keys(body).length && flags.parent === undefined && !labels.changed) issueUsage("update needs a field change (status, assignee, priority, title, description, parent or
|
|
419
|
+
if (!Object.keys(body).length && flags.parent === undefined && !labels.changed) issueUsage("update needs a field change (status, assignee, priority, title, description, parent, labels or deadline)");
|
|
391
420
|
if (flags["override-active-tasks"] && !flags.status) issueUsage("--override-active-tasks requires --status");
|
|
392
421
|
if (flags["override-active-tasks"]) body.overrideActiveTasks = true;
|
|
393
422
|
const path = base + "/" + encodeURIComponent(key);
|
package/lib/agent-cli.ts
CHANGED
|
@@ -36,7 +36,7 @@ import {
|
|
|
36
36
|
import { signTaskToken } from "./task-token";
|
|
37
37
|
import { assertSafeHostTaskId } from "./task-identity";
|
|
38
38
|
import type { RosterAgent } from "./agents/types";
|
|
39
|
-
import type
|
|
39
|
+
import { isEnvironmentTransportProvider, type TaskEnvironmentAgentSessionSurface, type TaskEnvironmentHandle } from "./task-environment/types";
|
|
40
40
|
import { makeContainedDirectoriesSync, writeContainedFile } from "./task-environment/workspace-files";
|
|
41
41
|
import { STATION_AGENT_CLI } from "../src/station-identity";
|
|
42
42
|
import { isProxiableDomain } from "./secrets-proxy/hostname";
|
|
@@ -78,14 +78,23 @@ export const AGENT_RUNTIME_AUTHORITY_ENV = RUNTIME_AUTHORITY_ENV;
|
|
|
78
78
|
/**
|
|
79
79
|
* One rollout-aware argv policy for every agent CLI. The wrapper is installed
|
|
80
80
|
* only in PR2+ environments; legacy baked tasks must launch exactly as before.
|
|
81
|
+
*
|
|
82
|
+
* `unsetOnBaked` (engine-spawn-env.ts, restore-only names): a baked Docker or
|
|
83
|
+
* Apple container carries project env as container env, which an exec env
|
|
84
|
+
* can set but never remove, so those names are removed by `env -u` in front
|
|
85
|
+
* of the CLI. A loader task's wrapper already restores them, and a machine's
|
|
86
|
+
* project floor never carries them, so neither gets the prefix.
|
|
81
87
|
*/
|
|
82
88
|
export function agentCliArgv(
|
|
83
89
|
environment: Pick<TaskEnvironmentAgentSessionSurface, "descriptor">,
|
|
84
90
|
argv: readonly [string, ...string[]],
|
|
91
|
+
unsetOnBaked: readonly string[] = [],
|
|
85
92
|
): [string, ...string[]] {
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
93
|
+
if (environment.descriptor.envMode === "loader") return [PROJECT_ENV_EXEC_PATH, ...argv];
|
|
94
|
+
if (unsetOnBaked.length > 0 && !isEnvironmentTransportProvider(environment.descriptor.locator.provider)) {
|
|
95
|
+
return ["/usr/bin/env", ...unsetOnBaked.flatMap((name) => ["-u", name]), ...argv];
|
|
96
|
+
}
|
|
97
|
+
return [...argv];
|
|
89
98
|
}
|
|
90
99
|
|
|
91
100
|
// The task's cli secret lives HOST-PRIVATE (never the container), so it survives
|
|
@@ -438,7 +447,7 @@ function opLine(op) {
|
|
|
438
447
|
if (op.state === "ready" || op.state === "ready_with_warning") {
|
|
439
448
|
return "added " + op.slug + " at " + op.path + (op.warning ? " (warning: " + op.warning + ")" : "");
|
|
440
449
|
}
|
|
441
|
-
return "adding " + op.slug + " (" + op.state + ")" + (op.warning ? " (warning: " + op.warning + ")" : "") + "; check again with: moondeck task
|
|
450
|
+
return "adding " + op.slug + " (" + op.state + ")" + (op.warning ? " (warning: " + op.warning + ")" : "") + "; check again with: moondeck task repo status " + op.operationId;
|
|
442
451
|
}
|
|
443
452
|
function opProgress(op) {
|
|
444
453
|
const attempts = Number.isInteger(op.attempts) ? "; attempts: " + op.attempts : "";
|
|
@@ -1191,7 +1200,8 @@ async function main() {
|
|
|
1191
1200
|
}
|
|
1192
1201
|
const key = group + " " + (action || "");
|
|
1193
1202
|
switch (key) {
|
|
1194
|
-
case "projects list":
|
|
1203
|
+
case "projects list": // Silent compatibility alias.
|
|
1204
|
+
case "repos list": out((await api("GET", "/api/agent/projects")).projects); break;
|
|
1195
1205
|
case "people list": out(await api("GET", "/api/agent/people")); break;
|
|
1196
1206
|
case "task list": out((await api("GET", "/api/agent/tasks")).tasks); break;
|
|
1197
1207
|
case "memory search": {
|
|
@@ -1221,7 +1231,7 @@ async function main() {
|
|
|
1221
1231
|
out((await api("POST", "/api/agent/memory", {
|
|
1222
1232
|
text,
|
|
1223
1233
|
author: flags.as || null,
|
|
1224
|
-
projectId: flags.project || null,
|
|
1234
|
+
projectId: flags.repo || flags.project || null,
|
|
1225
1235
|
tags: flags.tags ? String(flags.tags).split(",").map((s) => s.trim()).filter(Boolean) : [],
|
|
1226
1236
|
})).memory);
|
|
1227
1237
|
break;
|
|
@@ -1252,10 +1262,11 @@ async function main() {
|
|
|
1252
1262
|
if (flags.start && (!flags["request-id"] || flags["request-id"] === "true")) {
|
|
1253
1263
|
console.error("moondeck: --start requires --request-id <logical-run-id>; reuse it after a timeout"); process.exit(1);
|
|
1254
1264
|
}
|
|
1265
|
+
const repoList = flags.repos ?? flags.projects;
|
|
1255
1266
|
const created = (await api("POST", "/api/agent/tasks", {
|
|
1256
1267
|
name: flags.name,
|
|
1257
1268
|
prompt,
|
|
1258
|
-
projects:
|
|
1269
|
+
projects: repoList ? String(repoList).split(",").map((s) => s.trim()).filter(Boolean) : [],
|
|
1259
1270
|
agents: flags.agents ? String(flags.agents).split(",").map((s) => s.trim()).filter(Boolean) : [],
|
|
1260
1271
|
parent: flags.parent || null,
|
|
1261
1272
|
start: flags.start === "true",
|
|
@@ -1408,47 +1419,53 @@ async function main() {
|
|
|
1408
1419
|
if (!r.enabled && r.public) console.error("moondeck: it's public but off — it serves nothing until: moondeck preview enable " + r.name);
|
|
1409
1420
|
break;
|
|
1410
1421
|
}
|
|
1411
|
-
case "project list":
|
|
1422
|
+
case "project list": // Silent compatibility alias.
|
|
1423
|
+
case "repo list": {
|
|
1412
1424
|
const projects = (await api("GET", "/api/agent/projects")).projects || [];
|
|
1413
1425
|
out(projects.length ? projects.map((p) => p.id + " " + p.slug + " " + p.name).join(NL) : "no repositories");
|
|
1414
1426
|
break;
|
|
1415
1427
|
}
|
|
1416
|
-
case "project show":
|
|
1417
|
-
|
|
1428
|
+
case "project show": // Silent compatibility alias.
|
|
1429
|
+
case "repo show": {
|
|
1430
|
+
if (!pos[0]) { console.error("moondeck: repo show <id|slug>"); process.exit(1); }
|
|
1418
1431
|
out((await api("GET", "/api/agent/projects/" + encodeURIComponent(pos[0]))).project);
|
|
1419
1432
|
break;
|
|
1420
1433
|
}
|
|
1421
|
-
case "project create":
|
|
1434
|
+
case "project create": // Silent compatibility alias.
|
|
1435
|
+
case "repo create": {
|
|
1422
1436
|
const attach = rest.includes("--attach");
|
|
1423
1437
|
const name = flags.name || pos.join(" ");
|
|
1424
|
-
if (!name || !flags.repo || flags.repo === "true") { console.error("moondeck:
|
|
1438
|
+
if (!name || !flags.repo || flags.repo === "true") { console.error("moondeck: repo create --name <n> --repo <git-url> [--slug <s>] [--prompt <p> | --prompt-file <f>] [--previews-file <f>] [--tool-versions-file <f>] [--attach]"); process.exit(1); }
|
|
1425
1439
|
const body = { name, repoUrl: flags.repo, ...projectSetupFields(flags) };
|
|
1426
1440
|
const p = (await api("POST", "/api/agent/projects", body)).project;
|
|
1427
|
-
out("created
|
|
1441
|
+
out("created repository " + p.slug + " (" + p.id + ")");
|
|
1428
1442
|
if (attach) await addProjectToTask(p.id, true);
|
|
1429
1443
|
break;
|
|
1430
1444
|
}
|
|
1431
|
-
case "project update":
|
|
1432
|
-
|
|
1445
|
+
case "project update": // Silent compatibility alias.
|
|
1446
|
+
case "repo update": {
|
|
1447
|
+
if (!pos[0]) { console.error("moondeck: repo update <id|slug> [--name <n>] [--slug <s>] [--repo <url>] [--prompt <p> | --prompt-file <f>] [--previews-file <f>] [--tool-versions-file <f>]"); process.exit(1); }
|
|
1433
1448
|
const body = { ...(flagValue(flags.name) ? { name: flags.name } : {}), ...(flagValue(flags.repo) ? { repoUrl: flags.repo } : {}), ...projectSetupFields(flags) };
|
|
1434
|
-
if (Object.keys(body).length === 0) { console.error("moondeck:
|
|
1449
|
+
if (Object.keys(body).length === 0) { console.error("moondeck: repo update needs at least one field"); process.exit(1); }
|
|
1435
1450
|
const r = await api("PATCH", "/api/agent/projects/" + encodeURIComponent(pos[0]), body);
|
|
1436
1451
|
const proposed = r.proposed || [];
|
|
1437
1452
|
out("updated " + r.project.slug + " (applies to the next task)");
|
|
1438
1453
|
for (const pr of proposed) out("proposed " + pr.field + " (proposal " + pr.id + "): it changes what later tasks clone or read, so a member must approve it in the repository's Settings.");
|
|
1439
1454
|
break;
|
|
1440
1455
|
}
|
|
1441
|
-
case "project propose-extra":
|
|
1442
|
-
|
|
1456
|
+
case "project propose-extra": // Silent compatibility alias.
|
|
1457
|
+
case "repo propose-extra": {
|
|
1458
|
+
if (!pos[0] || !flagValue(flags["extra-file"])) { console.error("moondeck: repo propose-extra <id|slug> --extra-file <file>"); process.exit(1); }
|
|
1443
1459
|
const r = await api("POST", "/api/agent/projects/" + encodeURIComponent(pos[0]) + "/extra-proposals", { extra: readFlagFile(flags["extra-file"]) });
|
|
1444
1460
|
out("proposed Dockerfile additions (proposal " + r.proposal.id + "). They run as root at image build, so a member must approve them in the repository's Settings before any task uses them.");
|
|
1445
1461
|
break;
|
|
1446
1462
|
}
|
|
1447
|
-
case "project env":
|
|
1463
|
+
case "project env": // Silent compatibility alias.
|
|
1464
|
+
case "repo env": {
|
|
1448
1465
|
const sub = pos[0], project = pos[1], name = pos[2];
|
|
1449
1466
|
const base = "/api/agent/projects/" + encodeURIComponent(project || "") + "/env";
|
|
1450
1467
|
if (!project || (["add", "remove", "propose-proxy"].includes(sub) && !name)) {
|
|
1451
|
-
console.error("moondeck:
|
|
1468
|
+
console.error("moondeck: repo env list|observed <id> | add <id> NAME --label <l> [--secret] | remove <id> NAME | propose-proxy <id> NAME --domain <d>[,<d>…] [--placeholder-prefix <p> --placeholder-length <n>]");
|
|
1452
1469
|
process.exit(1);
|
|
1453
1470
|
}
|
|
1454
1471
|
if (sub === "list") {
|
|
@@ -1464,7 +1481,7 @@ async function main() {
|
|
|
1464
1481
|
const r = await api("DELETE", base + "/keys", { key: name });
|
|
1465
1482
|
out("removed the declaration of " + r.key + ". No value was touched.");
|
|
1466
1483
|
} else if (sub === "propose-proxy") {
|
|
1467
|
-
if (!flagValue(flags.domain)) { console.error("moondeck:
|
|
1484
|
+
if (!flagValue(flags.domain)) { console.error("moondeck: repo env propose-proxy <id> NAME --domain <d>[,<d>…]"); process.exit(1); }
|
|
1468
1485
|
const prefix = flags["placeholder-prefix"], length = flags["placeholder-length"];
|
|
1469
1486
|
if ((prefix === undefined) !== (length === undefined)) { console.error("moondeck: --placeholder-prefix and --placeholder-length go together"); process.exit(1); }
|
|
1470
1487
|
const placeholder = prefix === undefined ? null : { prefix: prefix === "true" ? "" : prefix, totalLength: Number(length) };
|
|
@@ -1472,12 +1489,13 @@ async function main() {
|
|
|
1472
1489
|
const r = await api("POST", base + "/proxy-proposals", { key: name, domains, placeholder });
|
|
1473
1490
|
out("proposed sending " + name + " only to " + r.proposal.domains.join(", ") + " (proposal " + r.proposal.id + "). A member must confirm it in the repository's Settings before the proxy uses it.");
|
|
1474
1491
|
} else {
|
|
1475
|
-
console.error("moondeck:
|
|
1492
|
+
console.error("moondeck: repo env commands are list, add, remove, propose-proxy and observed");
|
|
1476
1493
|
process.exit(1);
|
|
1477
1494
|
}
|
|
1478
1495
|
break;
|
|
1479
1496
|
}
|
|
1480
|
-
case "task project":
|
|
1497
|
+
case "task project": // Silent compatibility alias.
|
|
1498
|
+
case "task repo": {
|
|
1481
1499
|
const words = rest.filter((word) => word !== "--no-wait");
|
|
1482
1500
|
const sub = words[0];
|
|
1483
1501
|
if (sub === "add" && words.length === 2 && !words[1].startsWith("--")) {
|
|
@@ -1490,7 +1508,7 @@ async function main() {
|
|
|
1490
1508
|
if (op.state === "failed") process.exit(1);
|
|
1491
1509
|
break;
|
|
1492
1510
|
}
|
|
1493
|
-
console.error("moondeck: task
|
|
1511
|
+
console.error("moondeck: task repo add <repoId|slug> [--no-wait] | task repo status <operationId>");
|
|
1494
1512
|
process.exit(1);
|
|
1495
1513
|
}
|
|
1496
1514
|
case "task rename": {
|
|
@@ -1552,8 +1570,10 @@ async function main() {
|
|
|
1552
1570
|
" Never paste secrets into chat. A person supplies them through the private dialog.",
|
|
1553
1571
|
' moondeck support submit --category bug --message "details" [--subject "subject"] [--file path]…',
|
|
1554
1572
|
" moondeck artifacts",
|
|
1555
|
-
" moondeck issue list [--status NAME] [--assignee me|HANDLE|unassigned] [--project KEY] [--priority P] [--label NAME]... [--archived only|include] [-q TEXT] [--exclude-tree-of KEY|ID] [--no-sub-issues] [--limit 1..100] [--cursor C] [--json]",
|
|
1556
|
-
"
|
|
1573
|
+
" moondeck issue list [--status NAME] [--assignee me|HANDLE|unassigned] [--project KEY] [--priority P] [--label NAME]... [--archived only|include] [--deadline overdue|next7|none] [--viewer-date YYYY-MM-DD] [--sort deadline] [-q TEXT] [--exclude-tree-of KEY|ID] [--no-sub-issues] [--limit 1..100] [--cursor C] [--json]",
|
|
1574
|
+
" Deadline filters/overdue use the machine local day (containers default to UTC); pass --viewer-date for a human local day. overdue/next7 exclude done/canceled; next7 is today..today+6. Sort: ascending, undated last.",
|
|
1575
|
+
" If the day rolls over between pages (ISSUE_CURSOR_INVALID), restart from page 1 without --cursor.",
|
|
1576
|
+
" moondeck issue show KEY-N [--viewer-date YYYY-MM-DD] [--json] Override the local day for overdue markers.",
|
|
1557
1577
|
" moondeck issue comment KEY-N (--body TEXT | --body-file PATH|-) [--mention NAME]... [--json]",
|
|
1558
1578
|
" moondeck issue comment edit KEY-N COMMENT_ID (--body TEXT | --body-file PATH|-) [--mention NAME]... [--clear-mentions] [--expected-revision N] [--json]",
|
|
1559
1579
|
" moondeck issue comment delete KEY-N COMMENT_ID [--expected-revision N] [--json]",
|
|
@@ -1565,8 +1585,8 @@ async function main() {
|
|
|
1565
1585
|
" Repeat --label NAME on list (any-of filtering) or create (add existing labels).",
|
|
1566
1586
|
" show includes checklist progress, parent and direct children with visible running Tasks (up to 50 pages); warns on incomplete paging; child progress excludes canceled children.",
|
|
1567
1587
|
" moondeck issue current [--limit 1..5] [--cursor C] [--json]",
|
|
1568
|
-
" moondeck issue create --title T [--description D] [--project KEY] [--status S] [--assignee A] [--priority P] [--parent KEY-N] [--label NAME]... [--json]",
|
|
1569
|
-
" moondeck issue update KEY-N [--status S] [--assignee +HANDLE|-HANDLE] [--priority P] [--title T] [--label NAME]... [--remove-label NAME]... [--labels NAME]... [--clear-labels] [--description TEXT|- | --description-file PATH | --clear-description] [--parent KEY-N|--no-parent] [--expected-revision N] [--override-active-tasks] [--json]",
|
|
1588
|
+
" moondeck issue create --title T [--description D] [--project KEY] [--status S] [--assignee A] [--priority P] [--parent KEY-N] [--label NAME]... [--deadline YYYY-MM-DD] [--json]",
|
|
1589
|
+
" moondeck issue update KEY-N [--status S] [--assignee +HANDLE|-HANDLE] [--priority P] [--title T] [--label NAME]... [--remove-label NAME]... [--labels NAME]... [--clear-labels] [--description TEXT|- | --description-file PATH | --clear-description] [--parent KEY-N|--no-parent] [--deadline YYYY-MM-DD|--clear-deadline] [--expected-revision N] [--override-active-tasks] [--json]",
|
|
1570
1590
|
" Description: Markdown, at most 100,000 UTF-16 code units; file/stdin preserve whitespace. Empty input requires --clear-description; nonempty input cannot be combined with it.",
|
|
1571
1591
|
" Labels: repeat --label NAME to add and --remove-label NAME to remove; repeat --labels NAME to replace the set; --clear-labels clears it. Commas are literal name characters. Replacement/clear cannot mix with add/remove. At most 50 labels.",
|
|
1572
1592
|
" Label-only add/remove prints Unchanged (JSON changed:false) and skips PATCH when the fetched set and expected revision already match; other field changes and stale revision fences still reach the server.",
|
|
@@ -1583,12 +1603,13 @@ async function main() {
|
|
|
1583
1603
|
" moondeck issue detach KEY-N ATTACHMENT_ID [--expected-revision N] [--json]",
|
|
1584
1604
|
" Attachments are Files references. Detach never deletes the file; failed attachment admission retains an upload.",
|
|
1585
1605
|
" moondeck issue link|unlink KEY-N [--task ID] [--json]",
|
|
1586
|
-
" moondeck
|
|
1606
|
+
" moondeck repos list",
|
|
1607
|
+
" Repository permissions: projects.read (view repositories), projects.write (manage repositories).",
|
|
1587
1608
|
" moondeck files ls [org|me[/prefix]] (one folder: names, sizes, mtimes, etags; defaults to org)",
|
|
1588
1609
|
" moondeck files get <org|me>/<path> [<dest>] (download; default /workspace/files/<org|me>/<path>; -r is a folder, capped at 500 files / 1 GB)",
|
|
1589
1610
|
" moondeck people list",
|
|
1590
1611
|
" moondeck task list",
|
|
1591
|
-
" moondeck task create --name <n> --prompt <text|-> [--
|
|
1612
|
+
" moondeck task create --name <n> --prompt <text|-> [--repos id,id] [--agents handle,handle] [--astronaut engine/model/effort] [--start --request-id <logical-run-id>]",
|
|
1592
1613
|
" moondeck task watch <childId> [--after <cursor>] [--limit N]",
|
|
1593
1614
|
" moondeck task usage <childId>",
|
|
1594
1615
|
' moondeck task send <childId> "text"',
|
|
@@ -1599,7 +1620,7 @@ async function main() {
|
|
|
1599
1620
|
' moondeck task label add <name> [<name>…] (label this running task; one argument per label, quote "a, b" to keep it whole; missing labels are created)',
|
|
1600
1621
|
" moondeck task label remove <name> [<name>…]",
|
|
1601
1622
|
" moondeck memory search <query> [--as handle] [--limit N|all]",
|
|
1602
|
-
" moondeck memory save <text> [--
|
|
1623
|
+
" moondeck memory save <text> [--repo id] [--tags a,b]",
|
|
1603
1624
|
" moondeck memory delete <id>",
|
|
1604
1625
|
" moondeck todo list",
|
|
1605
1626
|
" moondeck todo add <text>",
|
|
@@ -1616,16 +1637,16 @@ async function main() {
|
|
|
1616
1637
|
" Portless >= 0.16 (no sudo for ports >= 80), outside self: portless proxy start --lan or PORTLESS_LAN=1 (mDNS); use printed *.local Host and proxy port 443/80, or explicit -p 1355. Check for LAN mode disabled; update the image/install avahi-utils and resolve the reported LAN issue, then restart.",
|
|
1617
1638
|
" moondeck preview enable|disable <name> (turn it on; prints its URL)",
|
|
1618
1639
|
" moondeck preview public|private <name> (public: a link anyone can open)",
|
|
1619
|
-
" moondeck
|
|
1620
|
-
" moondeck
|
|
1621
|
-
" moondeck
|
|
1622
|
-
" moondeck
|
|
1623
|
-
" moondeck
|
|
1624
|
-
" moondeck
|
|
1625
|
-
" moondeck
|
|
1626
|
-
" moondeck
|
|
1627
|
-
" moondeck task
|
|
1628
|
-
" moondeck task
|
|
1640
|
+
" moondeck repo list | show <id|slug>",
|
|
1641
|
+
" moondeck repo create --name <n> --repo <git-url> [--slug <s>] [--prompt <p> | --prompt-file <f>] [--previews-file <f>] [--tool-versions-file <f>] [--attach] (--attach: also add it to this task)",
|
|
1642
|
+
" moondeck repo update <id|slug> [--name <n>] [--slug <s>] [--repo <url>] [--prompt <p> | --prompt-file <f>] [--previews-file <f>] [--tool-versions-file <f>] (applies to the next task; --repo and the brief are proposals unless you created the repository in this task)",
|
|
1643
|
+
" moondeck repo propose-extra <id|slug> --extra-file <f> (Dockerfile additions; a member approves them)",
|
|
1644
|
+
" moondeck repo env list|observed <id|slug>",
|
|
1645
|
+
" moondeck repo env add <id|slug> NAME [--label <l>] [--secret] (declares a key; values are a member's)",
|
|
1646
|
+
" moondeck repo env remove <id|slug> NAME (drops a declaration with no value; never deletes a value; when the workspace allows it)",
|
|
1647
|
+
" moondeck repo env propose-proxy <id|slug> NAME --domain <d>[,<d>…] [--placeholder-prefix <p> --placeholder-length <n>] (a member confirms)",
|
|
1648
|
+
" moondeck task repo add <repoId|slug> [--no-wait] (clone a repository into this running task; waits until ready)",
|
|
1649
|
+
" moondeck task repo status <operationId>",
|
|
1629
1650
|
" moondeck task search <query> (your own past tasks)",
|
|
1630
1651
|
" moondeck task history (list your past tasks)",
|
|
1631
1652
|
" moondeck task read <taskId> (full chat of a past task you were on)",
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The qualified Antigravity CLI build (ADR-178). The standard image's
|
|
3
|
+
* INSTALL_GEMINI layer pins the same build by these values
|
|
4
|
+
* (images/standard/Dockerfile, UAI_AGY_*); task-runtime-pins.test.ts keeps the
|
|
5
|
+
* two in step. Values come from Google's per-platform manifest
|
|
6
|
+
* (antigravity-cli-auto-updater…/manifests/linux_{amd64,arm64}.json).
|
|
7
|
+
*/
|
|
8
|
+
export const AGY_CLI_VERSION = "1.5.16";
|
|
9
|
+
export const AGY_CLI_BUILD = "1.5.16-5250855658717184";
|
|
10
|
+
export const AGY_SHA512 = {
|
|
11
|
+
x64: "3dee9f26e298156db673f6ce2a0f5dfed5b30006e04ceb9809c68070e7b717587b33a3da0f8bc2eda45af81a50bc8b14c82b28ae5832bcfe3e7fd49397117b31",
|
|
12
|
+
arm64: "23c193151499a4986fd5fa0d8132665cc8ffbad6cc0b3ff4fd53a2cb68abb76b149a992b836d53063443cd89add335f14d8134fb02abdcecbf6e1eaef6c53d33",
|
|
13
|
+
} as const;
|
|
14
|
+
|
|
15
|
+
/** POSIX sh that leaves the agy path in `$a`: the image's binary, else the
|
|
16
|
+
* pinned build downloaded into `$HOME/.agy-bin`, checksum-verified. Exits
|
|
17
|
+
* 127 when neither is possible. */
|
|
18
|
+
export function agyResolveShell(): string {
|
|
19
|
+
const base = `https://storage.googleapis.com/antigravity-public/antigravity-cli/${AGY_CLI_BUILD}`;
|
|
20
|
+
return [
|
|
21
|
+
'a="$(command -v agy 2>/dev/null || true)"',
|
|
22
|
+
'[ -n "$a" ] || [ ! -x "$HOME/.local/bin/agy" ] || a="$HOME/.local/bin/agy"',
|
|
23
|
+
'if [ -z "$a" ]; then',
|
|
24
|
+
' case "$(uname -m)" in',
|
|
25
|
+
` x86_64|amd64) d=linux-x64; p=cli_linux_x64; s=${AGY_SHA512.x64} ;;`,
|
|
26
|
+
` aarch64|arm64) d=linux-arm; p=cli_linux_arm64; s=${AGY_SHA512.arm64} ;;`,
|
|
27
|
+
' *) echo "unsupported Antigravity CLI architecture" >&2; exit 127 ;;',
|
|
28
|
+
' esac',
|
|
29
|
+
' b="$HOME/.agy-bin"; mkdir -p "$b" &&',
|
|
30
|
+
` curl -fsSL -o "$b/agy.tar.gz" "${base}/$d/$p.tar.gz" &&`,
|
|
31
|
+
' echo "$s $b/agy.tar.gz" | sha512sum -c - >/dev/null &&',
|
|
32
|
+
' tar -xzf "$b/agy.tar.gz" -C "$b" antigravity && rm -f "$b/agy.tar.gz" && a="$b/antigravity"',
|
|
33
|
+
'fi',
|
|
34
|
+
'[ -n "$a" ] && [ -x "$a" ] || { echo "Antigravity CLI is not available in the login image" >&2; exit 127; }',
|
|
35
|
+
].join("\n");
|
|
36
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { stripVTControlCharacters } from "node:util";
|
|
2
|
+
|
|
3
|
+
/** Remove OAuth URLs (and any other URL carrying OAuth parameters) so a login
|
|
4
|
+
* prompt or an echoed callback can never reach chat or logs that leave the
|
|
5
|
+
* host. Shared by the gemini turn path and the sign-in box's failure
|
|
6
|
+
* evidence; free of heavy imports on purpose. */
|
|
7
|
+
export function scrubAgyDiagnostics(text: string): string {
|
|
8
|
+
return stripVTControlCharacters(text)
|
|
9
|
+
.replace(/https?:\/\/accounts\.google\.com\S*/gi, "<sign-in URL removed>")
|
|
10
|
+
.replace(/https?:\/\/\S*(?:code_challenge|client_id|access_token|refresh_token|[?&]code)=\S*/gi, "<URL removed>");
|
|
11
|
+
}
|
package/lib/agents/claude.ts
CHANGED
|
@@ -22,6 +22,7 @@
|
|
|
22
22
|
import { requireContainerRuntimeOperational } from "../runtime-guard";
|
|
23
23
|
import type { TaskEnvironmentAgentSessionSurface } from "../task-environment/types";
|
|
24
24
|
import { newId } from "../ulid";
|
|
25
|
+
import { CLAUDE_SPAWN_BLANKS } from "../engine-spawn-env";
|
|
25
26
|
import { createAgentTransport, type LineTransport } from "./transport";
|
|
26
27
|
import { rateLimitErrorUsage, resetSecondsToEpochMs } from "./rate-limit";
|
|
27
28
|
import { register } from "./registry";
|
|
@@ -634,10 +635,12 @@ export class ClaudeSession implements AgentSession {
|
|
|
634
635
|
cli: "claude",
|
|
635
636
|
cliArgs,
|
|
636
637
|
passEnv: ["CLAUDE_CODE_OAUTH_TOKEN", "ANTHROPIC_API_KEY", "ANTHROPIC_AUTH_TOKEN"],
|
|
638
|
+
// App-shared names Claude routes by are blanked first (a connection's
|
|
639
|
+
// agentEnv may still set them; engine-spawn-env.ts).
|
|
637
640
|
explicitEnv:
|
|
638
641
|
args.executionProfile === "communicator"
|
|
639
|
-
? { ...(args.agentEnv ?? {}), ...CLAUDE_COMMUNICATOR_ENV }
|
|
640
|
-
: (args.agentEnv ?? {}),
|
|
642
|
+
? { ...CLAUDE_SPAWN_BLANKS, ...(args.agentEnv ?? {}), ...CLAUDE_COMMUNICATOR_ENV }
|
|
643
|
+
: { ...CLAUDE_SPAWN_BLANKS, ...(args.agentEnv ?? {}) },
|
|
641
644
|
allowAttach: args.executionProfile !== "communicator",
|
|
642
645
|
attachCompatibilityKey: args.attachCompatibilityKey,
|
|
643
646
|
kind: "claude",
|
package/lib/agents/codex.ts
CHANGED
|
@@ -30,6 +30,7 @@
|
|
|
30
30
|
*/
|
|
31
31
|
|
|
32
32
|
import { connectionFailureReason, tomlString } from "../custom-connection-launch";
|
|
33
|
+
import { CODEX_UNSET_ONLY_NAMES } from "../engine-spawn-env";
|
|
33
34
|
import { connectionFailureDetail } from "../custom-connection-runtime";
|
|
34
35
|
import { existsSync } from "node:fs";
|
|
35
36
|
import { homedir } from "node:os";
|
|
@@ -729,6 +730,10 @@ export class CodexSession implements AgentSession {
|
|
|
729
730
|
cliArgs: codexArgs,
|
|
730
731
|
passEnv: [],
|
|
731
732
|
explicitEnv: args.agentEnv ?? {},
|
|
733
|
+
// Codex refuses an empty workload-identity name, so on a baked
|
|
734
|
+
// container a project's value is removed instead of blanked; one the
|
|
735
|
+
// agent's own env sets (a connection) passes through.
|
|
736
|
+
unsetEnv: CODEX_UNSET_ONLY_NAMES.filter((name) => !Object.hasOwn(args.agentEnv ?? {}, name)),
|
|
732
737
|
allowAttach: false,
|
|
733
738
|
attachCompatibilityKey: args.attachCompatibilityKey,
|
|
734
739
|
kind: "codex",
|