@sagentlab/navarch-runtime 0.1.28 → 0.1.30
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/README.md +31 -2
- package/dist/github-pr.cjs +8 -2
- package/dist/session.cjs +4 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -22,7 +22,34 @@ the API contract.
|
|
|
22
22
|
For a project machine, use the command generated by **Onboard → Connect an
|
|
23
23
|
agent** or **Project settings → Connect an agent**. It includes a single-use,
|
|
24
24
|
project-scoped enrollment token and the correct control-plane origin. The
|
|
25
|
-
recommended npm package requires Node.js 20 or later
|
|
25
|
+
recommended npm package requires Node.js 20 or later.
|
|
26
|
+
|
|
27
|
+
Before generating the command, prepare the machine:
|
|
28
|
+
|
|
29
|
+
- install Node.js 20 or later (the standard installation includes `npm` and
|
|
30
|
+
`npx`) and Git;
|
|
31
|
+
- install the coding-agent CLI selected in Navarch — `claude`, `codex`,
|
|
32
|
+
`gemini`, or `opencode` — and complete its normal authentication flow; and
|
|
33
|
+
- for Docker-backed sessions, install and start Docker and use an image that
|
|
34
|
+
contains the selected agent CLI and the repository toolchain, with provider
|
|
35
|
+
credentials supplied through the approved machine or project configuration.
|
|
36
|
+
|
|
37
|
+
The generated command installs/runs only the Navarch runtime. It does not
|
|
38
|
+
install Git, Docker, or a coding-agent CLI, and it cannot sign in to the agent
|
|
39
|
+
provider for you. Verify the host path before enrollment (substitute the CLI
|
|
40
|
+
selected in the UI):
|
|
41
|
+
|
|
42
|
+
```sh
|
|
43
|
+
node --version # 20 or later
|
|
44
|
+
npm --version
|
|
45
|
+
npx --version
|
|
46
|
+
git --version
|
|
47
|
+
codex --version # or: claude --version / gemini --version / opencode --version
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
Every command above must succeed before the long-running worker starts. See
|
|
51
|
+
[Choosing an agent](#choosing-an-agent) for runtime-specific environment
|
|
52
|
+
variables and isolation requirements.
|
|
26
53
|
|
|
27
54
|
```sh
|
|
28
55
|
# Run the two commands copied from Navarch. Their values resemble:
|
|
@@ -516,7 +543,9 @@ contract used by `api.cts`, including:
|
|
|
516
543
|
distinct from the per-lease heartbeat, needed because `machines.last_heartbeat_at`
|
|
517
544
|
/`status` must update even when no task is claimed.
|
|
518
545
|
3. **`POST /api/dispatch/:leaseId/transcript-upload-url`** — a signed
|
|
519
|
-
Supabase Storage upload URL for the session's redacted transcript.
|
|
546
|
+
Supabase Storage upload URL for the session's redacted transcript. The
|
|
547
|
+
bucket is private; the legacy `public_url` response field is only an
|
|
548
|
+
attested locator returned at completion, not an anonymous read URL.
|
|
520
549
|
|
|
521
550
|
`POST /api/machines/connect` is the project-scoped alternative: it redeems a
|
|
522
551
|
single-use token minted by an owner through the onboarding or Fleet UI.
|
package/dist/github-pr.cjs
CHANGED
|
@@ -41,9 +41,11 @@ function matchingPullRequestUrl(body, repository, matchesHead) {
|
|
|
41
41
|
const candidate = matches.find((pullRequest) => pullRequest.state === "open") ?? matches[0];
|
|
42
42
|
return typeof candidate?.html_url === "string" ? candidate.html_url : null;
|
|
43
43
|
}
|
|
44
|
-
async function fetchPullRequests(url, headers, fetchImpl) {
|
|
44
|
+
async function fetchPullRequests(url, headers, fetchImpl, options = {}) {
|
|
45
45
|
const response = await fetchImpl(url, { headers });
|
|
46
46
|
if (!response.ok) {
|
|
47
|
+
if (options.emptyStatuses?.includes(response.status))
|
|
48
|
+
return [];
|
|
47
49
|
throw new Error(`GitHub pull request lookup failed with HTTP ${response.status}`);
|
|
48
50
|
}
|
|
49
51
|
return response.json();
|
|
@@ -87,7 +89,11 @@ async function findHeadBranchPullRequestUrl(options) {
|
|
|
87
89
|
return branchMatch;
|
|
88
90
|
const commitUrl = new URL(`https://api.github.com/repos/${encodeURIComponent(owner)}/${encodeURIComponent(name)}/commits/${normalizedHeadSha}/pulls`);
|
|
89
91
|
commitUrl.searchParams.set("per_page", "10");
|
|
90
|
-
return matchingPullRequestUrl(
|
|
92
|
+
return matchingPullRequestUrl(
|
|
93
|
+
// GitHub answers 422 ("No commit found for SHA") when the local head was
|
|
94
|
+
// never pushed -- the normal case for sessions that end without a PR, so
|
|
95
|
+
// it means "no evidence", not a lookup failure.
|
|
96
|
+
await fetchPullRequests(commitUrl, headers, fetchImpl, { emptyStatuses: [404, 422] }), normalizedRepository, (candidate) => typeof candidate.head?.sha === "string" &&
|
|
91
97
|
candidate.head.sha.toLowerCase() === normalizedHeadSha);
|
|
92
98
|
}
|
|
93
99
|
function isPullRequestUrlForRepository(value, repository) {
|
package/dist/session.cjs
CHANGED
|
@@ -637,6 +637,10 @@ const REMEDIABLE_REJECTION_CODES = new Set([
|
|
|
637
637
|
// The marker is already on the right head; the reviewer only has to relabel
|
|
638
638
|
// the body, which is exactly what a remediation turn can do.
|
|
639
639
|
"review_evidence_mislabeled",
|
|
640
|
+
// GitHub could not prove the native review's edit provenance. The control
|
|
641
|
+
// plane keeps the lease active and still fails closed; another turn retries
|
|
642
|
+
// the check without consuming a task retry as a crashed session.
|
|
643
|
+
"review_attestation_unavailable",
|
|
640
644
|
// A verify agent that exited zero without the mandated leading
|
|
641
645
|
// `Verification verdict:` line only has to restate its report; the
|
|
642
646
|
// rejection prose spells out the exact format. Failed outcomes never reach
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sagentlab/navarch-runtime",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.30",
|
|
4
4
|
"description": "Navarch machine-side session manager: claims delivery tasks and runs them through Claude Code, Codex, Gemini, or OpenCode.",
|
|
5
5
|
"type": "commonjs",
|
|
6
6
|
"license": "MIT",
|