@parcha/agentrun-serve 0.1.0-beta.61 → 0.1.0-beta.63
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/CHANGELOG.md +113 -0
- package/README.md +128 -20
- package/dist/adapters.js +4 -2
- package/dist/agent-delete.d.ts +3 -3
- package/dist/agent-delete.js +50 -4
- package/dist/api-only.d.ts +4 -0
- package/dist/api-only.js +5 -1
- package/dist/archil-settings.d.ts +9 -0
- package/dist/archil-settings.js +8 -1
- package/dist/bash-read-only.d.ts +3 -0
- package/dist/bash-read-only.js +6 -3
- package/dist/chatgpt-plan.d.ts +33 -8
- package/dist/chatgpt-plan.js +141 -24
- package/dist/claude-login.d.ts +12 -5
- package/dist/claude-login.js +28 -3
- package/dist/cli.js +19 -8
- package/dist/composio-triggers.d.ts +9 -3
- package/dist/computers.d.ts +3 -0
- package/dist/computers.js +2 -1
- package/dist/console/assets/{backend-C9ffXUR5.js → backend-BxQ2G1M0.js} +2 -2
- package/dist/console/assets/index-C8Y5Zl8x.js +639 -0
- package/dist/console/assets/share-CjBJ_rxP.js +6 -0
- package/dist/console/assets/{styles-fjQBFfMv.css → styles-D0SufbzK.css} +1 -1
- package/dist/console/index.html +3 -3
- package/dist/console/share.html +3 -3
- package/dist/cut-pool.d.ts +14 -0
- package/dist/cut-pool.js +98 -0
- package/dist/cut-worker.d.ts +14 -0
- package/dist/cut-worker.js +16 -0
- package/dist/decisions.d.ts +4 -0
- package/dist/decisions.js +9 -1
- package/dist/env-switch.d.ts +3 -0
- package/dist/env-switch.js +3 -0
- package/dist/harness-opencode/adapter.d.ts +3 -1
- package/dist/harness-opencode/adapter.js +6 -2
- package/dist/harness-opencode/harness.d.ts +4 -0
- package/dist/harness-opencode/harness.js +6 -1
- package/dist/harness-table.d.ts +7 -0
- package/dist/harness-table.js +6 -3
- package/dist/host-tools.d.ts +18 -3
- package/dist/host-tools.js +27 -4
- package/dist/import.d.ts +8 -1
- package/dist/import.js +36 -5
- package/dist/key-check.js +22 -8
- package/dist/learn/ledger.d.ts +37 -16
- package/dist/learn/ledger.js +56 -24
- package/dist/learn/promote.d.ts +4 -1
- package/dist/learned-nodes.d.ts +2 -1
- package/dist/learned-nodes.js +2 -1
- package/dist/learning-cost.d.ts +5 -3
- package/dist/learning-model.js +7 -5
- package/dist/learning-work.d.ts +69 -0
- package/dist/learning-work.js +148 -0
- package/dist/mcp-gateway.d.ts +24 -0
- package/dist/mcp-gateway.js +97 -8
- package/dist/mcp-servers-store.d.ts +7 -10
- package/dist/mcp-servers-store.js +15 -9
- package/dist/native/cli.js +5 -1
- package/dist/ollama-provider.d.ts +10 -3
- package/dist/ollama-provider.js +17 -7
- package/dist/openapi.js +51 -20
- package/dist/otel/tracer.d.ts +6 -3
- package/dist/otel/tracer.js +24 -6
- package/dist/page.d.ts +7 -0
- package/dist/page.js +17 -4
- package/dist/place.d.ts +25 -9
- package/dist/place.js +37 -11
- package/dist/print.d.ts +3 -2
- package/dist/print.js +8 -6
- package/dist/run-export.js +7 -4
- package/dist/run-launch.d.ts +6 -1
- package/dist/run-launch.js +26 -6
- package/dist/run-model-key.d.ts +2 -1
- package/dist/run-model-key.js +2 -1
- package/dist/run-reads-over-store.d.ts +7 -0
- package/dist/run-reads-over-store.js +32 -4
- package/dist/run-view.js +9 -3
- package/dist/runnable.d.ts +6 -3
- package/dist/runnable.js +21 -11
- package/dist/runner/adapter-loop.js +95 -28
- package/dist/runner/adapter-run-spec.d.ts +20 -4
- package/dist/runner/adapter-run-spec.js +64 -30
- package/dist/runner/adapters/index.d.ts +6 -0
- package/dist/runner/adapters/index.js +5 -1
- package/dist/runner/adapters/pi.d.ts +42 -3
- package/dist/runner/adapters/pi.js +114 -13
- package/dist/runner/audit.d.ts +8 -2
- package/dist/runner/audit.js +34 -18
- package/dist/runner/book-cut.d.ts +6 -0
- package/dist/runner/book-cut.js +38 -0
- package/dist/runner/claim-secrets.d.ts +12 -5
- package/dist/runner/claim-secrets.js +28 -12
- package/dist/runner/cli-run-spec.d.ts +0 -2
- package/dist/runner/cli-run-spec.js +54 -25
- package/dist/runner/dispatch.js +2 -0
- package/dist/runner/harness-loops.d.ts +5 -0
- package/dist/runner/harness-loops.js +4 -1
- package/dist/runner/held.d.ts +6 -3
- package/dist/runner/learned-first.d.ts +5 -0
- package/dist/runner/learned-first.js +1 -1
- package/dist/runner/learning-end.d.ts +15 -8
- package/dist/runner/learning-end.js +23 -7
- package/dist/runner/live-ticker.js +3 -1
- package/dist/runner/loop-contract.d.ts +8 -1
- package/dist/runner/main.js +2 -0
- package/dist/runner/mcp-run.d.ts +5 -0
- package/dist/runner/mcp-run.js +18 -0
- package/dist/runner/meta-tools.js +4 -4
- package/dist/runner/metrics.d.ts +4 -2
- package/dist/runner/metrics.js +5 -3
- package/dist/runner/model-route.d.ts +4 -0
- package/dist/runner/model-route.js +1 -1
- package/dist/runner/native-loop.js +2 -2
- package/dist/runner/pr-checkout.d.ts +12 -0
- package/dist/runner/pr-checkout.js +21 -2
- package/dist/runner/promotion.d.ts +9 -2
- package/dist/runner/promotion.js +79 -28
- package/dist/runner/reflect-hook.d.ts +7 -0
- package/dist/runner/reflect-hook.js +2 -1
- package/dist/runner/run-child-host.d.ts +10 -6
- package/dist/runner/run-child-host.js +65 -41
- package/dist/runner/run-child.js +2 -0
- package/dist/runner/runner.d.ts +9 -0
- package/dist/runner/runner.js +158 -25
- package/dist/runner/store-port.d.ts +4 -1
- package/dist/runner/workflow-calls.d.ts +4 -3
- package/dist/runner/workflow-calls.js +41 -12
- package/dist/runner/workflow-first.js +4 -3
- package/dist/runner/workflow-loop.js +13 -1
- package/dist/runner/workflow-spec.js +1 -1
- package/dist/secret-cut.d.ts +4 -0
- package/dist/secret-cut.js +1 -1
- package/dist/secret-rules.d.ts +2 -1
- package/dist/secret-rules.js +88 -24
- package/dist/server.d.ts +10 -1
- package/dist/server.js +131 -44
- package/dist/share-host.d.ts +111 -0
- package/dist/share-host.js +669 -0
- package/dist/store/schema.d.ts +4 -3
- package/dist/store/schema.js +4 -3
- package/dist/store/seal.d.ts +8 -2
- package/dist/store/seal.js +13 -2
- package/dist/store/sqlite/learning-rows.js +2 -1
- package/dist/store/sqlite/run-patch.js +4 -4
- package/dist/store/sqlite/store.js +28 -4
- package/dist/store/store.d.ts +5 -0
- package/dist/store-reads/analytics.d.ts +15 -0
- package/dist/store-reads/analytics.js +17 -0
- package/dist/store-reads/journal.d.ts +2 -0
- package/dist/store-reads/journal.js +1 -1
- package/dist/store-reads/learning.d.ts +4 -3
- package/dist/store-reads/learning.js +62 -18
- package/dist/store-view.d.ts +3 -0
- package/dist/store-view.js +18 -1
- package/dist/suggestions.js +32 -3
- package/dist/templates.d.ts +3 -1
- package/dist/templates.js +7 -3
- package/dist/tool-gate.d.ts +25 -9
- package/dist/tool-gate.js +58 -19
- package/dist/tool-list.d.ts +4 -0
- package/dist/tool-list.js +4 -0
- package/dist/tool-plane.d.ts +1 -0
- package/dist/tool-plane.js +6 -2
- package/dist/tools.js +2 -2
- package/dist/trigger-composio.js +1 -1
- package/dist/webhooks.d.ts +3 -0
- package/dist/webhooks.js +5 -0
- package/dist/workspace/archil-claim.d.ts +7 -3
- package/dist/workspace/archil-claim.js +13 -5
- package/dist/workspace/archil-mount-credential.d.ts +6 -0
- package/dist/workspace/archil-mount-credential.js +11 -0
- package/dist/workspace/attach.js +22 -5
- package/dist/workspace/computer-deps.d.ts +5 -3
- package/dist/workspace/computer-deps.js +11 -9
- package/dist/workspace/computer-for-claim.d.ts +6 -2
- package/dist/workspace/computer-for-claim.js +43 -12
- package/dist/workspace/computer-janitor.d.ts +7 -4
- package/dist/workspace/computer-janitor.js +7 -4
- package/dist/workspace/computer-kept.d.ts +7 -1
- package/dist/workspace/computer-kept.js +7 -1
- package/dist/workspace/kind-skills/desktop/SKILL.md +17 -4
- package/dist/workspace/mount-revoke-left.d.ts +16 -4
- package/dist/workspace/mount-revoke-left.js +42 -22
- package/dist/workspace/resolve-computer.d.ts +11 -5
- package/dist/workspace/resolve-computer.js +22 -13
- package/dist/workspace/run-end-computers.js +1 -1
- package/dist/workspace/run-tools.d.ts +10 -3
- package/dist/workspace/run-tools.js +5 -4
- package/dist/wrapped.d.ts +29 -2
- package/dist/wrapped.js +20 -3
- package/launcher/agentrun-serve +1 -1
- package/package.json +12 -12
- package/templates/kyb/agent.md +7 -1
- package/templates/kyb/evals/list-file-fuzzy-alias/case.yaml +10 -0
- package/templates/kyb/evals/list-file-fuzzy-alias/fixtures/web.json +58 -0
- package/templates/kyb/evals/list-file-fuzzy-alias/graders/finds-the-transliteration.md +17 -0
- package/templates/kyb/evals/list-file-fuzzy-alias/graders/greps-the-files.md +11 -0
- package/templates/kyb/evals/list-file-fuzzy-alias/graders/saves-the-uk-file.md +8 -0
- package/templates/kyb/evals/list-file-fuzzy-alias/prompt.md +7 -0
- package/templates/kyb/evals/list-file-hit/case.yaml +10 -0
- package/templates/kyb/evals/list-file-hit/fixtures/web.json +58 -0
- package/templates/kyb/evals/list-file-hit/graders/greps-the-files.md +11 -0
- package/templates/kyb/evals/list-file-hit/graders/hits-by-company-number.md +18 -0
- package/templates/kyb/evals/list-file-hit/graders/saves-the-uk-file.md +8 -0
- package/templates/kyb/evals/list-file-hit/prompt.md +7 -0
- package/templates/kyb/evals/list-file-no-hit/case.yaml +10 -0
- package/templates/kyb/evals/list-file-no-hit/fixtures/web.json +58 -0
- package/templates/kyb/evals/list-file-no-hit/graders/greps-the-files.md +11 -0
- package/templates/kyb/evals/list-file-no-hit/graders/no-hit-by-whole-file.md +12 -0
- package/templates/kyb/evals/list-file-no-hit/graders/saves-the-uk-file.md +8 -0
- package/templates/kyb/evals/list-file-no-hit/prompt.md +7 -0
- package/templates/kyb/evals/list-file-short-name/case.yaml +9 -0
- package/templates/kyb/evals/list-file-short-name/fixtures/web.json +58 -0
- package/templates/kyb/evals/list-file-short-name/graders/finds-the-short-name.md +19 -0
- package/templates/kyb/evals/list-file-short-name/graders/greps-the-files.md +11 -0
- package/templates/kyb/evals/list-file-short-name/graders/saves-the-uk-file.md +8 -0
- package/templates/kyb/evals/list-file-short-name/prompt.md +7 -0
- package/templates/kyb/evals/list-file-split-name/case.yaml +11 -0
- package/templates/kyb/evals/list-file-split-name/fixtures/web.json +58 -0
- package/templates/kyb/evals/list-file-split-name/graders/finds-the-director.md +18 -0
- package/templates/kyb/evals/list-file-split-name/graders/greps-the-files.md +11 -0
- package/templates/kyb/evals/list-file-split-name/graders/saves-the-uk-file.md +8 -0
- package/templates/kyb/evals/list-file-split-name/prompt.md +7 -0
- package/templates/kyb/kyb.schema.json +2 -2
- package/templates/kyb/rules/SANCTIONS.md +82 -13
- package/dist/console/assets/index-BnZV3lvW.js +0 -639
- package/dist/console/assets/share-B1o5mJ56.js +0 -6
- /package/dist/console/assets/{styles-D_znYrHR.js → styles-BGZxYkky.js} +0 -0
|
@@ -27,20 +27,20 @@ import { openAccount } from "../email/account.js";
|
|
|
27
27
|
import { harnessOf, planRecipeOf, recipeHarness } from "../harness-table.js";
|
|
28
28
|
import { openHarnessKeys } from "../harness-keys.js";
|
|
29
29
|
import { installDirOf, installForClaim, shareInstall } from "../harness-install.js";
|
|
30
|
-
import { loadArchilSettings } from "../archil-settings.js";
|
|
30
|
+
import { loadArchilSettings, noExecRegionOf } from "../archil-settings.js";
|
|
31
31
|
import { planOf } from "../chatgpt-plan.js";
|
|
32
32
|
import { forgottenSignIns, handedSignInReadsBack, peekSignIn, runSignIn, signInReads, verifyRunSignIn } from "../sign-ins-store.js";
|
|
33
33
|
import { vendorsOver } from "../sign-ins.js";
|
|
34
34
|
import { decisionProvidersIn, fauxFetch } from "../decisions.js";
|
|
35
35
|
import { DECISION_PROVIDER_KEYS } from "../tool-plane.js";
|
|
36
36
|
import { learningEndOfRun } from "./learning-end.js";
|
|
37
|
-
import { cutDeep, runnerSecrets } from "./redact.js";
|
|
37
|
+
import { cutDeep, mustHold, runnerSecrets } from "./redact.js";
|
|
38
38
|
import { storeSecrets } from "./store-secrets.js";
|
|
39
39
|
import { FAUX_ENV, GATEWAY_KEY_ENV } from "../model.js";
|
|
40
40
|
import { SAVED_GATEWAY_ENV, savedGatewayIn } from "../model-gateway.js";
|
|
41
41
|
import { FAUX_VENDOR_API_ENV } from "../tools.js";
|
|
42
42
|
import { withinCarried } from "../paid-calls.js";
|
|
43
|
-
import {
|
|
43
|
+
import { sealHandedLaunch } from "../store/seal.js";
|
|
44
44
|
import { runZone } from "../environment.js";
|
|
45
45
|
import { shadowRunId } from "../learn/audit.js";
|
|
46
46
|
import { agreeOnOf } from "../learning-setting.js";
|
|
@@ -50,7 +50,8 @@ import { agentDirName, recordingsFolder, runFolder, scratchFolder } from "../wor
|
|
|
50
50
|
import { keptKeyOf } from "../workspace/computer-kept.js";
|
|
51
51
|
import { waitEndedKey } from "../browser-wait-ended.js";
|
|
52
52
|
import { browserHoldKey } from "../browser-hold.js";
|
|
53
|
-
import { claimModelKey, claimSecrets, claimSpendOff, hostDecisionKeys, learnedDecisionKeys, openRunModelKey, savedModelKeys, sendsNoModelKey, serverKeyless, tierModelKeys, withoutModelKeys } from "./claim-secrets.js";
|
|
53
|
+
import { claimModelKey, claimSecrets, claimSpendOff, hostDecisionKeys, keyedNow, learnedDecisionKeys, openRunModelKey, savedModelKeys, sendsNoModelKey, serverKeyless, tierModelKeys, withoutModelKeys } from "./claim-secrets.js";
|
|
54
|
+
import { atRunEnd, keyedBesideOf } from "../learning-work.js";
|
|
54
55
|
import { githubAppAccess } from "./github-app.js";
|
|
55
56
|
import { githubPullOf, githubTargetOf } from "../github.js";
|
|
56
57
|
import { isObject } from "../validate.js";
|
|
@@ -66,7 +67,7 @@ import { workflowsAt } from "./learning-seed.js";
|
|
|
66
67
|
import { claimMetering, heldMcpOf, mcpForClaim } from "./mcp-run.js";
|
|
67
68
|
import { learnedTiers, learnsWorkflows, mcpReachOf } from "./adapter-run-spec.js";
|
|
68
69
|
import { createDispatchLoop } from "./dispatch.js";
|
|
69
|
-
import { refuseRecipeTriggerRun, resolveRunnerLoop, withSavedGatewayDeps } from "./harness-loops.js";
|
|
70
|
+
import { refuseRecipeTriggerRun, resolveRunnerLoop, underServerCeilings, withSavedGatewayDeps } from "./harness-loops.js";
|
|
70
71
|
import { isWorkflowRevision } from "./workflow-loop.js";
|
|
71
72
|
import { loginForRun } from "../claude-login.js";
|
|
72
73
|
import { harnessOfBody } from "../harness.js";
|
|
@@ -452,8 +453,9 @@ const writableSetting = ([key, value], bound) => {
|
|
|
452
453
|
/** The store's methods a run's loop calls, each with what binds it to the claim. A method not here is refused, and the
|
|
453
454
|
* refusal is said on the runner's log. Reads of the claim's run, its launch, its commands and its agent's revisions;
|
|
454
455
|
* of what was spent beside it (its learning grades, its own audit's shadow run's row and launch, which its cap gates
|
|
455
|
-
* read
|
|
456
|
-
* claim's own rows (settingReadable).
|
|
456
|
+
* read; the replays it started on its own key are summed by its runner, Held.keyedBeside); of the agent's own runs (its
|
|
457
|
+
* learning reads its past runs); the server's settings its tools read and the claim's own rows (settingReadable).
|
|
458
|
+
* Writes only under the claim. */
|
|
457
459
|
const STORE_CALLS = new Map([
|
|
458
460
|
["flush", always],
|
|
459
461
|
["runs.get", ownRunOrShadow],
|
|
@@ -622,7 +624,7 @@ export function heldFor(deps, reads, cut, log, bigs = runBigWrites()) {
|
|
|
622
624
|
const projectStop = new AbortController();
|
|
623
625
|
const projectSignal = reads.signal ? AbortSignal.any([reads.signal, projectStop.signal]) : projectStop.signal;
|
|
624
626
|
let projectIO, projectCapture;
|
|
625
|
-
let projectComputer, projectWorkspace, projectMode = 1;
|
|
627
|
+
let projectComputer, projectWorkspace, projectMode = 1, projectNoExec;
|
|
626
628
|
let projectFailed = false, projectReleased = false, projectClosing = false, projectCaptureDone = false;
|
|
627
629
|
let projectRelease;
|
|
628
630
|
let projectCleanup;
|
|
@@ -660,7 +662,9 @@ export function heldFor(deps, reads, cut, log, bigs = runBigWrites()) {
|
|
|
660
662
|
return pending;
|
|
661
663
|
};
|
|
662
664
|
const fromGitHub = launch.inputOrigin?.kind === "trigger" && launch.inputOrigin.source === "github";
|
|
663
|
-
|
|
665
|
+
// Each credential the claim opens, refreshes or mints here (its MCP's, its GitHub App tokens) joins the runner's redactor.
|
|
666
|
+
const hold = (values) => cut.hold(values);
|
|
667
|
+
const github = () => githubAppAccess(store, sealKey, launch.input, { ...(deps.githubApi ? { api: deps.githubApi } : {}), fromGitHub, hold, ...(launch.repo !== undefined ? { repo: launch.repo } : {}) });
|
|
664
668
|
/** The run's folder as the computer this claim made mounts it (Mode 2), where the claim's MCP files once it is made. */
|
|
665
669
|
let mountedFolder;
|
|
666
670
|
/** Mode 2's Archil claim, made once for the claim on the runner, its folder the run's. */
|
|
@@ -693,6 +697,8 @@ export function heldFor(deps, reads, cut, log, bigs = runBigWrites()) {
|
|
|
693
697
|
let learnedFlows = [];
|
|
694
698
|
/** The claim's one learned first choice: its promotion's writes are made once, however often the process asks. */
|
|
695
699
|
let chosen;
|
|
700
|
+
/** What the claim's learned first choice queued for its run's end (a check on its own key), run by its end-of-run step. */
|
|
701
|
+
const atEnd = atRunEnd(log);
|
|
696
702
|
const held = {
|
|
697
703
|
projectCheckpoint: (...args) => {
|
|
698
704
|
if (args.length > 1 || args[0] !== undefined && !(args[0] instanceof AbortSignal))
|
|
@@ -724,7 +730,7 @@ export function heldFor(deps, reads, cut, log, bigs = runBigWrites()) {
|
|
|
724
730
|
checkpoint = runProjectCheckpoint({ store, agentId: run.agentId, claim, launch, computer: projectComputer, ioHeld: true,
|
|
725
731
|
tools: { get workspace() { if (!tools)
|
|
726
732
|
throw new ClaimRefused("Project settlement has not opened its workspace."); return tools.workspace; },
|
|
727
|
-
settleProject: async () => { tools = await runTools(projectWorkspace, projectComputer.computer, { mode: projectMode, context: BACKGROUND_CONTEXT }); return tools.settleProject(); } },
|
|
733
|
+
settleProject: async () => { tools = await runTools(projectWorkspace, projectComputer.computer, { mode: projectMode, noExec: projectNoExec, context: BACKGROUND_CONTEXT }); return tools.settleProject(); } },
|
|
728
734
|
workspace: { data: deps.data, sealKey, env: deps.env, control: { ...deps.mountControl, ...(deps.makeArchilDisk ? { makeDisk: deps.makeArchilDisk } : {}) } },
|
|
729
735
|
secrets: async () => runnerSecrets(deps.env, [...runnerSecrets(claimed), ...await storeSecrets(store, sealKey, deps.data)]), });
|
|
730
736
|
result = await checkpoint.capture(signal);
|
|
@@ -757,24 +763,24 @@ export function heldFor(deps, reads, cut, log, bigs = runBigWrites()) {
|
|
|
757
763
|
return { state: plan.state, models: [...plan.models], token: () => plan.token(), refused: (sent) => plan.refused(sent), watch: (listener) => plan.watch(listener) };
|
|
758
764
|
},
|
|
759
765
|
// The claim's own login, as this runner reads the claim (its harness, its place, no model key of its own), whatever
|
|
760
|
-
// the process names: its access token alone, read again at each ask and renewed here when it must be (near its end,
|
|
761
|
-
//
|
|
762
|
-
// (redact.ts carry) before it is handed, a renewed one too: model text that repeats it is cut from the run's journal
|
|
763
|
-
//
|
|
764
|
-
// This answer is the one decision whether the run goes on the login: none, it does not.
|
|
765
|
-
// (
|
|
766
|
-
//
|
|
767
|
-
//
|
|
768
|
-
//
|
|
769
|
-
//
|
|
770
|
-
//
|
|
771
|
-
//
|
|
772
|
-
//
|
|
773
|
-
//
|
|
774
|
-
//
|
|
775
|
-
//
|
|
776
|
-
//
|
|
777
|
-
//
|
|
766
|
+
// the process names: its access token alone, read again at each ask and renewed here when it must be (near its end, or
|
|
767
|
+
// refused); never its folder or its refresh token. Each token is carried into the runner's redactor for this run
|
|
768
|
+
// (redact.ts carry) before it is handed, a renewed one too: model text that repeats it is cut from the run's journal as
|
|
769
|
+
// the runner writes it (runner.ts fenced), from what it stages and from its rows, as the run's own tool keys are.
|
|
770
|
+
// This answer is the one decision whether the run goes on the login: none, it does not. A run that sends no model key
|
|
771
|
+
// (keyless: a held run, any run on a --faux runner, a faux-pinned one) gets none, whatever its claim read, and no read
|
|
772
|
+
// of the claim's login or the setting for it: the login is a model credential like any key. Any other claim read the
|
|
773
|
+
// setting (staysInRunner): one that read it off is never put on it, whatever the setting says now; one that read it on
|
|
774
|
+
// has it read again here, at the start, with the claim's
|
|
775
|
+
// settings, data folder, harness and place. That read's environment is the claim's (the process's, when the runner was
|
|
776
|
+
// given none) with a saved gateway laid over it (withSavedGatewayDeps), not always the very one the claim read with;
|
|
777
|
+
// the difference can only refuse the start, never hand another folder, since the login is handed only when both reads
|
|
778
|
+
// name the same folder. A turn-off, or a move to another folder, between the claim and the start refuses the start in
|
|
779
|
+
// LOGIN_CHANGED_SINCE_CLAIM's fixed words (no folder in them), never a start on a login the setting no longer names nor
|
|
780
|
+
// a fall to a model key the run was not claimed on. Nothing else of the claim is read again. A keyless run, a run with
|
|
781
|
+
// a model key of its own and a login other than AgentRun's own folder were each decided at the claim (staysInRunner:
|
|
782
|
+
// no login read for the first two, LOGIN_MACHINE_NEEDS_SERVER_USER for the last), so none reaches here on a login. The
|
|
783
|
+
// process reads no setting or machine id.
|
|
778
784
|
claudeLogin: async () => {
|
|
779
785
|
if (keyless)
|
|
780
786
|
return undefined;
|
|
@@ -825,7 +831,7 @@ export function heldFor(deps, reads, cut, log, bigs = runBigWrites()) {
|
|
|
825
831
|
const overTheDisk = disk === undefined ? undefined : openedAtUse(() => openRunWorkspace({ mode: 2, agentId: run.agentId, runId: claim.runId, archil: disk, sweep: false, log }));
|
|
826
832
|
if (overTheDisk)
|
|
827
833
|
releases.push(() => overTheDisk.end());
|
|
828
|
-
const made = await mcpForClaim({ claim, store, sealKey, grants: granted, harness: harness, toolSettings: revision.body.toolSettings, work: () => (overTheDisk === undefined ? runFolder(deps.data, run.agentId, claim.runId) : mountedFolder ?? overTheDisk.workspace()), launchInput: launch.input, githubAppAccess: () => github(), ...(deps.githubMcpOrigin ? { githubMcpOrigin: deps.githubMcpOrigin } : {}), ...(deps.composioMcpOrigin ? { composioMcpOrigin: deps.composioMcpOrigin } : {}), ...reach, ...claimMetering(deps, undefined, launch) });
|
|
834
|
+
const made = await mcpForClaim({ claim, store, sealKey, grants: granted, harness: harness, toolSettings: revision.body.toolSettings, work: () => (overTheDisk === undefined ? runFolder(deps.data, run.agentId, claim.runId) : mountedFolder ?? overTheDisk.workspace()), launchInput: launch.input, hold, redact: cut, githubAppAccess: () => github(), ...(deps.githubMcpOrigin ? { githubMcpOrigin: deps.githubMcpOrigin } : {}), ...(deps.composioMcpOrigin ? { composioMcpOrigin: deps.composioMcpOrigin } : {}), ...reach, ...claimMetering(deps, undefined, launch) });
|
|
829
835
|
if (!made)
|
|
830
836
|
return undefined;
|
|
831
837
|
releases.push(() => made.release());
|
|
@@ -914,13 +920,14 @@ export function heldFor(deps, reads, cut, log, bigs = runBigWrites()) {
|
|
|
914
920
|
liveViewerDrop: (tag) => dropLiveViewer(store, claim, tag),
|
|
915
921
|
// The claim's own run, whatever the process names: its view on this runner hears the change.
|
|
916
922
|
computerHold: async (change) => heardComputerHold(claim.runId, change, cut),
|
|
917
|
-
handOn: async (from, id) => {
|
|
923
|
+
handOn: async (from, id, keyed) => {
|
|
918
924
|
if (from !== claim.runId || typeof id !== "string")
|
|
919
925
|
return undefined;
|
|
920
926
|
const sealed = await store.runs.launch(from).then((one) => one.sealed ?? null, () => null);
|
|
921
|
-
|
|
922
|
-
return handed && Object.keys(handed).length ? sealRunMcpAuth(sealKey, id, handed) : undefined;
|
|
927
|
+
return sealed === null ? undefined : sealHandedLaunch(sealKey, from, sealed, id, keyed === true);
|
|
923
928
|
},
|
|
929
|
+
// The claim's own run's, whatever the process names: its learning_work row and the replays it names are read here.
|
|
930
|
+
keyedBeside: () => keyedBesideOf(store, claim.runId),
|
|
924
931
|
signInPeek: (resolution) => peekSignIn(store, sealKey, run.agentId, String(resolution)),
|
|
925
932
|
signInForgotten: (resolution) => forgottenSignIns(store, sealKey, run.agentId, String(resolution)),
|
|
926
933
|
emailAccount: async () => (grantsEmail(granted) ? openAccount(store, sealKey) : undefined),
|
|
@@ -939,12 +946,13 @@ export function heldFor(deps, reads, cut, log, bigs = runBigWrites()) {
|
|
|
939
946
|
computer: (ask) => projectCall(async () => {
|
|
940
947
|
const made = await archilOf();
|
|
941
948
|
const mode = made === undefined ? 1 : 2;
|
|
949
|
+
const noExec = noExecRegionOf(made);
|
|
942
950
|
const ws = made === undefined
|
|
943
951
|
? await openRunWorkspace({ mode: 1, agentId: run.agentId, runId: claim.runId, data: deps.data, log })
|
|
944
952
|
: await openRunWorkspace({ mode: 2, agentId: run.agentId, runId: claim.runId, archil: made, log });
|
|
945
953
|
const say = typeof ask.say === "function" ? ask.say : undefined;
|
|
946
954
|
const got = await deps.computerForClaim({ runId: claim.runId, epoch: claim.epoch, claim, agentId: run.agentId, revisionId: run.revisionId, place: launch.place, ...(reads.incarnation ? { holder: { runner: claim.runner, incarnation: reads.incarnation } } : {}) }, store, {
|
|
947
|
-
...deps.computerDeps, mode, workspace: ws.workspace, sealKey,
|
|
955
|
+
...deps.computerDeps, mode, noExec, workspace: ws.workspace, sealKey,
|
|
948
956
|
recordings: { folder: recordingsFolder(deps.data, run.agentId, claim.runId), say: (words) => say?.(cut(words)) },
|
|
949
957
|
hadComputer: async () => (await ask.hadComputer()) === true,
|
|
950
958
|
...(typeof ask.turnedOff === "string" ? { turnedOff: ask.turnedOff } : {}),
|
|
@@ -973,6 +981,7 @@ export function heldFor(deps, reads, cut, log, bigs = runBigWrites()) {
|
|
|
973
981
|
projectComputer = got;
|
|
974
982
|
projectWorkspace = ws.workspace;
|
|
975
983
|
projectMode = mode;
|
|
984
|
+
projectNoExec = noExec;
|
|
976
985
|
const { syncProject: _sync, ...exposed } = got;
|
|
977
986
|
return { ...exposed, ...(exposed.computer ? { computer: projectGate.capability(exposed.computer) } : {}),
|
|
978
987
|
release: (...args) => cleanProject(() => exposed.release(...args)),
|
|
@@ -1013,9 +1022,10 @@ export function heldFor(deps, reads, cut, log, bigs = runBigWrites()) {
|
|
|
1013
1022
|
return rows?.compared ? { also: [], compared: dataOnly(rows.compared) } : undefined;
|
|
1014
1023
|
}
|
|
1015
1024
|
// The audit's spend, skipped as the run's spec skips it (claim-secrets.ts claimSpendOff): over the claim's own key.
|
|
1016
|
-
const
|
|
1025
|
+
const runKey = await claimModelKey(keys, claim.runId);
|
|
1026
|
+
const spendOff = await claimSpendOff(keys, runKey);
|
|
1017
1027
|
// The audit's start after the step (audit.ts withAudit) is this runner's too: it reads the run's journal and writes
|
|
1018
|
-
// the ledger and a run.
|
|
1028
|
+
// the ledger and a run, and starts what the claim queued for the run's end first.
|
|
1019
1029
|
const step = withAudit(learningEndOfRun(launch, {
|
|
1020
1030
|
store,
|
|
1021
1031
|
data: deps.data,
|
|
@@ -1025,7 +1035,7 @@ export function heldFor(deps, reads, cut, log, bigs = runBigWrites()) {
|
|
|
1025
1035
|
stored: () => storeSecrets(store, sealKey, deps.data),
|
|
1026
1036
|
log,
|
|
1027
1037
|
decisionProviders: async () => decisionProvidersIn({ ...(deps.env ?? {}), ...(await hostDecisionKeys(keys, DECISION_PROVIDER_KEYS)) }),
|
|
1028
|
-
}), { store, agentId: run.agentId, revisionId: run.revisionId, context: BACKGROUND_CONTEXT, shown, log, sealKey, spendOff, launch, redact: cut, admitAuxiliary });
|
|
1038
|
+
}), { store, agentId: run.agentId, revisionId: run.revisionId, context: BACKGROUND_CONTEXT, shown, log, sealKey, spendOff, keyed: keyedNow(runKey), atEnd, launch, redact: cut, admitAuxiliary });
|
|
1029
1039
|
if (!step)
|
|
1030
1040
|
return undefined;
|
|
1031
1041
|
// keptOf is the run's process's, asked over the channel: read once, for the round learningEndOfRun reads (the
|
|
@@ -1054,9 +1064,10 @@ export function heldFor(deps, reads, cut, log, bigs = runBigWrites()) {
|
|
|
1054
1064
|
// workflows).
|
|
1055
1065
|
const start = learningStartOf(launch);
|
|
1056
1066
|
const laid = ask?.laid === true && start && !seedFailed(start) && !start.noWorkflows ? await workflowsAt({ store, agentId: run.agentId, shown }, start.seed).catch(() => []) : [];
|
|
1057
|
-
const
|
|
1067
|
+
const runKey = await claimModelKey(keys, claim.runId);
|
|
1068
|
+
const spendOff = await claimSpendOff(keys, runKey);
|
|
1058
1069
|
const outputSchema = revision.body.outputSchema;
|
|
1059
|
-
const got = await learnedFirst({ store, sealKey, agentId: run.agentId, runId: claim.runId, revisionId: run.revisionId, kind: revision.kind, ...(outputSchema !== undefined ? { outputSchema } : {}), launch, context: BACKGROUND_CONTEXT, log, shown, spendOff, admitAuxiliary }, laid);
|
|
1070
|
+
const got = await learnedFirst({ store, sealKey, agentId: run.agentId, runId: claim.runId, revisionId: run.revisionId, kind: revision.kind, ...(outputSchema !== undefined ? { outputSchema } : {}), launch, context: BACKGROUND_CONTEXT, log, shown, spendOff, keyed: keyedNow(runKey), atEnd, admitAuxiliary }, laid);
|
|
1060
1071
|
learnedFlows = got.workflows;
|
|
1061
1072
|
return cutDeep(dataOnly(got), cut);
|
|
1062
1073
|
})()),
|
|
@@ -1141,6 +1152,11 @@ export async function staysInRunner(deps, harness, launch, runId, isolation) {
|
|
|
1141
1152
|
if (revision && isWorkflowRevision(revision))
|
|
1142
1153
|
return STAYS;
|
|
1143
1154
|
}
|
|
1155
|
+
// A run that sends no model key (claim-secrets.ts sendsNoModelKey) is handed no login (heldFor claudeLogin), so its claim
|
|
1156
|
+
// reads none: it is never refused for a login it would never be handed. A held run its model kept from running holds its
|
|
1157
|
+
// computer so, whatever login this machine has on.
|
|
1158
|
+
if (sendsNoModelKey(launch, deps.env ?? {}))
|
|
1159
|
+
return OFF_LOGIN;
|
|
1144
1160
|
const login = await loginForRun(deps.store.settings, deps.data, deps.env ?? {}, harness, launch.place);
|
|
1145
1161
|
if (login === undefined)
|
|
1146
1162
|
return OFF_LOGIN;
|
|
@@ -1206,9 +1222,9 @@ export function runChannel(socket, onClose, gate = SERVER_SLOTS, more = {}) {
|
|
|
1206
1222
|
return channel;
|
|
1207
1223
|
}
|
|
1208
1224
|
/** `login`: the Claude login this run's claim read (staysInRunner), the one its runner hands the run (ClaimReads). */
|
|
1209
|
-
function childLoop(options, slots, loopDeps, login) {
|
|
1225
|
+
export function childLoop(options, slots, loopDeps, login) {
|
|
1226
|
+
const cut = mustHold(loopDeps.redact, "A run's own process's loop");
|
|
1210
1227
|
const { deps, isolation } = options;
|
|
1211
|
-
const cut = loopDeps.redact;
|
|
1212
1228
|
const log = (line) => options.log(cut(line));
|
|
1213
1229
|
let channel;
|
|
1214
1230
|
let child;
|
|
@@ -1291,7 +1307,10 @@ function childLoop(options, slots, loopDeps, login) {
|
|
|
1291
1307
|
// host's default's now, where its revision names no model and a key saved since moved that default. On a --faux
|
|
1292
1308
|
// runner, or pinned to the faux model, a run sends no model key (claim-secrets.ts sendsNoModelKey): its process is
|
|
1293
1309
|
// handed none, not even its revision's model's.
|
|
1294
|
-
|
|
1310
|
+
// Its keys are its capped plane's (harness-loops.ts underServerCeilings), as the run's own loop reads that plane: a
|
|
1311
|
+
// run kept on Parallel and claimed after the server set kernel or native is handed no Parallel key.
|
|
1312
|
+
const capped = await underServerCeilings(claimDeps, launch, revisionRow);
|
|
1313
|
+
const claimed = await claimSecrets({ store: deps.store, sealKey: deps.sealKey, env: claimEnv, redact: loopDeps.redact }, revisionRow, capped, claim.runId);
|
|
1295
1314
|
// A run that holds a model key of its own (model_key, its launch's) spends that key alone: its process is handed
|
|
1296
1315
|
// none of the server's model keys, as its spec drops them from its tools' (claim-secrets.ts withoutModelKeys).
|
|
1297
1316
|
// Copies: the runner's own reads (heldFor's `claimed`: what the run's learning must never keep) stay whole.
|
|
@@ -1413,6 +1432,11 @@ function childLoop(options, slots, loopDeps, login) {
|
|
|
1413
1432
|
const reach = await mcpReachOf(deps);
|
|
1414
1433
|
const init = {
|
|
1415
1434
|
claim, data: deps.data, signal: loopDeps.signal, where: deps.store.where, ...(traced ? { traced: true } : {}),
|
|
1435
|
+
// A learning child's deadline, its abort posted across (run-channel.ts) to the process's request gate.
|
|
1436
|
+
...(loopDeps.pastDeadline ? { pastDeadline: loopDeps.pastDeadline } : {}),
|
|
1437
|
+
// The plane its keys were chosen by (`capped`): the process runs its tools on it, never on a later read of the
|
|
1438
|
+
// server's settings, which may have moved since.
|
|
1439
|
+
...(capped.plane ? { plane: capped.plane } : {}),
|
|
1416
1440
|
...(reach.loopback ? { mcpLoopback: true, mcpOwn: reach.own ?? [] } : {}),
|
|
1417
1441
|
...(deps.githubApi ? { githubApi: deps.githubApi } : {}),
|
|
1418
1442
|
...(deps.githubWeb ? { githubWeb: deps.githubWeb } : {}),
|
package/dist/runner/run-child.js
CHANGED
|
@@ -189,6 +189,7 @@ function childDeps(init, store, journal, held) {
|
|
|
189
189
|
installForClaim: heldInstall,
|
|
190
190
|
// web_save's download slots are the runner's, shared by all its runs (save-slots.ts).
|
|
191
191
|
saveSlots: remoteSaveSlots(channel),
|
|
192
|
+
...(init.plane ? { claimedPlane: init.plane } : {}),
|
|
192
193
|
...(init.githubApi ? { githubApi: init.githubApi } : {}),
|
|
193
194
|
...(init.githubWeb ? { githubWeb: init.githubWeb } : {}),
|
|
194
195
|
...(init.githubMcpOrigin ? { githubMcpOrigin: init.githubMcpOrigin } : {}),
|
|
@@ -221,6 +222,7 @@ channel.expose("loop", async (method, args) => {
|
|
|
221
222
|
journal: () => journal,
|
|
222
223
|
flush: () => channel.call("runner", "flush", []),
|
|
223
224
|
signal: init.signal,
|
|
225
|
+
...(init.pastDeadline ? { pastDeadline: init.pastDeadline } : {}),
|
|
224
226
|
delivered: channel.call("runner", "delivered", []).catch(() => undefined),
|
|
225
227
|
deliverNow: () => channel.call("runner", "deliverNow", []),
|
|
226
228
|
live: (reader) => void (read = reader),
|
package/dist/runner/runner.d.ts
CHANGED
|
@@ -131,6 +131,10 @@ export interface RunnerOptions {
|
|
|
131
131
|
clock?: BoundTimer & {
|
|
132
132
|
now(): number;
|
|
133
133
|
};
|
|
134
|
+
/** For tests: the clock (epoch ms) a held learning child's deadline is read on (its launch's replay or audit
|
|
135
|
+
* deadline_at, store.runs.learningDeadlines): one still held at it is cancelled, as a person's cancel is. Default
|
|
136
|
+
* Date.now. */
|
|
137
|
+
learningClock?: () => number;
|
|
134
138
|
}
|
|
135
139
|
/** A runner's memory budget and its runs' weights, in MiB (RunnerOptions.memory). `weigh` answers each id it is given; an
|
|
136
140
|
* id it leaves out weighs nothing. */
|
|
@@ -195,6 +199,11 @@ export type RunnerEvent = {
|
|
|
195
199
|
| {
|
|
196
200
|
type: "refusing";
|
|
197
201
|
reason: string | null;
|
|
202
|
+
}
|
|
203
|
+
/** A learning child (a check's replay run, an audit's shadow run) held at its deadline: its cancel is written. */
|
|
204
|
+
| {
|
|
205
|
+
type: "learning-deadline";
|
|
206
|
+
runId: string;
|
|
198
207
|
} | {
|
|
199
208
|
type: "error";
|
|
200
209
|
runId?: string;
|