@parcha/agentrun-serve 0.1.0-beta.41 → 0.1.0-beta.42
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 +53 -0
- package/NOTICE +2 -0
- package/README.md +77 -12
- package/dist/agent-rows.d.ts +1 -1
- package/dist/agents-store.js +3 -1
- package/dist/calendar/address.d.ts +49 -0
- package/dist/calendar/address.js +153 -0
- package/dist/calendar/fetch.d.ts +24 -0
- package/dist/calendar/fetch.js +146 -0
- package/dist/calendar/ics-faux.d.ts +39 -0
- package/dist/calendar/ics-faux.js +236 -0
- package/dist/calendar/labels.d.ts +3 -0
- package/dist/calendar/labels.js +61 -0
- package/dist/calendar/names.d.ts +52 -0
- package/dist/calendar/names.js +54 -0
- package/dist/calendar/parse.d.ts +108 -0
- package/dist/calendar/parse.js +625 -0
- package/dist/calendar/routes.d.ts +17 -0
- package/dist/calendar/routes.js +81 -0
- package/dist/calendar/tools.d.ts +23 -0
- package/dist/calendar/tools.js +124 -0
- package/dist/cli.js +3 -1
- package/dist/computer-record.d.ts +55 -0
- package/dist/computer-record.js +315 -0
- package/dist/computer-setting.d.ts +1 -0
- package/dist/computer-setting.js +15 -2
- package/dist/computers.js +2 -14
- package/dist/console/assets/index-DYJ_wj27.js +711 -0
- package/dist/console/index.html +1 -1
- package/dist/eval-feed.d.ts +2 -2
- package/dist/eval-feed.js +9 -5
- package/dist/feed/parse.d.ts +3 -2
- package/dist/feed/parse.js +9 -18
- package/dist/feed/pointer.d.ts +2 -0
- package/dist/feed/pointer.js +17 -0
- package/dist/file-types.js +1 -0
- package/dist/host-command.d.ts +3 -0
- package/dist/host-command.js +18 -0
- package/dist/host.d.ts +3 -0
- package/dist/host.js +3 -0
- package/dist/learn/check.d.ts +14 -0
- package/dist/learn/check.js +194 -14
- package/dist/learn/compile.d.ts +48 -27
- package/dist/learn/compile.js +134 -101
- package/dist/learn/promote.d.ts +61 -5
- package/dist/learn/promote.js +12 -2
- package/dist/learning-setting.d.ts +23 -0
- package/dist/learning-setting.js +51 -0
- package/dist/learning-words.d.ts +3 -0
- package/dist/learning-words.js +3 -0
- package/dist/learning.d.ts +3 -2
- package/dist/learning.js +5 -3
- package/dist/mcp-oauth.d.ts +8 -0
- package/dist/mcp-oauth.js +7 -0
- package/dist/mcp-private-hosts.d.ts +13 -0
- package/dist/mcp-private-hosts.js +16 -0
- package/dist/openapi.d.ts +1 -0
- package/dist/openapi.js +105 -9
- package/dist/run-files.d.ts +6 -2
- package/dist/run-files.js +29 -7
- package/dist/run-learning-served.d.ts +1 -1
- package/dist/run-reads-over-store.d.ts +5 -1
- package/dist/run-reads-over-store.js +8 -4
- package/dist/run-recordings.d.ts +20 -0
- package/dist/run-recordings.js +133 -0
- package/dist/runner/adapter-loop.d.ts +1 -1
- package/dist/runner/adapter-loop.js +3 -6
- package/dist/runner/adapter-run-spec.d.ts +16 -1
- package/dist/runner/adapter-run-spec.js +20 -6
- package/dist/runner/beside.js +1 -1
- package/dist/runner/cli-run-spec.js +10 -7
- package/dist/runner/feedback-round.d.ts +9 -25
- package/dist/runner/feedback-round.js +22 -40
- package/dist/runner/learning-end.d.ts +17 -7
- package/dist/runner/learning-end.js +79 -53
- package/dist/runner/main.d.ts +11 -0
- package/dist/runner/main.js +29 -2
- package/dist/runner/mcp-run.d.ts +2 -2
- package/dist/runner/promotion.d.ts +36 -4
- package/dist/runner/promotion.js +280 -20
- package/dist/runner/reflect-hook.d.ts +5 -0
- package/dist/runner/reflect-hook.js +22 -14
- package/dist/runner/store-secrets.js +3 -1
- package/dist/runner/workflow-first.d.ts +0 -6
- package/dist/runner/workflow-first.js +7 -13
- package/dist/runs-over-store.d.ts +1 -1
- package/dist/sdk/runs.js +2 -1
- package/dist/secrets.js +2 -2
- package/dist/server.d.ts +4 -3
- package/dist/server.js +72 -11
- package/dist/store/agent-body.d.ts +5 -3
- package/dist/store/agent-body.js +14 -10
- package/dist/store-reads/learning.d.ts +1 -1
- package/dist/store-reads/loop.d.ts +1 -0
- package/dist/store-reads/loop.js +14 -4
- package/dist/store-view.d.ts +5 -0
- package/dist/store-view.js +4 -0
- package/dist/template-eval.d.ts +7 -0
- package/dist/template-eval.js +54 -6
- package/dist/templates.d.ts +3 -1
- package/dist/templates.js +14 -1
- package/dist/timeline/computer.js +2 -1
- package/dist/tool-list.js +1 -0
- package/dist/tools.d.ts +7 -0
- package/dist/tools.js +11 -0
- package/dist/trigger-feed.js +67 -18
- package/dist/validate.js +7 -2
- package/dist/workspace/computer-for-claim.d.ts +7 -0
- package/dist/workspace/computer-for-claim.js +12 -2
- package/dist/workspace/paths.d.ts +4 -0
- package/dist/workspace/paths.js +9 -0
- package/dist/workspace/resolve-computer.d.ts +3 -1
- package/launcher/agentrun-serve +31 -24
- package/package.json +10 -9
- package/templates/README.md +11 -2
- package/dist/console/assets/index-COGhx_2Z.js +0 -711
package/dist/computer-setting.js
CHANGED
|
@@ -1,14 +1,16 @@
|
|
|
1
1
|
// An agent's computer, its one setting for where its tools run (Settings → Computers): `computer: { kind, provider?,
|
|
2
|
-
// image?, gpu?, persistent?, surface?, exec? }` on its revision. kind is none, sandbox, desktop, phone or browser;
|
|
2
|
+
// image?, gpu?, persistent?, surface?, exec?, record? }` on its revision. kind is none, sandbox, desktop, phone or browser;
|
|
3
3
|
// provider names one of the computer providers (the computer package's kind registry), and is absent for none; image
|
|
4
4
|
// names one the provider offers for the kind, and absent is the kind's default; a sandbox's gpu is { type, count };
|
|
5
5
|
// persistent: true keeps the agent's own computer between its runs, where the configuration declares persistence. A
|
|
6
6
|
// desktop's or a phone's surface ("code" or "tools") is how the agent drives it, and exec: false gives the agent no
|
|
7
|
-
// shell and no program start on it (run-tools.ts); the owner's own computer calls keep everything.
|
|
7
|
+
// shell and no program start on it (run-tools.ts); the owner's own computer calls keep everything. record: true makes
|
|
8
|
+
// each run a video of a desktop's or a phone's screen (computer-record.ts). The v2 API's `place` is this
|
|
8
9
|
// setting's view, one to one where it can say it: {mode: "runner"} is {kind: "none"}, and {mode: "sandbox", box: X} is
|
|
9
10
|
// {kind: "sandbox", provider: X}. Writing either sets both. A desktop, phone or browser computer leaves the run's folder
|
|
10
11
|
// on the runner, so its place reads runner.
|
|
11
12
|
import { configurationOf, PROVIDERS, serves } from "@parcha/agentrun-computer";
|
|
13
|
+
import { recorderMissing } from "./computer-record.js";
|
|
12
14
|
const isObject = (value) => typeof value === "object" && value !== null && !Array.isArray(value);
|
|
13
15
|
/** The kinds of computer an agent can be given. */
|
|
14
16
|
export const COMPUTER_KINDS = ["none", "sandbox", "desktop", "phone", "browser"];
|
|
@@ -46,6 +48,17 @@ const OPTIONAL = {
|
|
|
46
48
|
kinds: ["desktop", "phone"],
|
|
47
49
|
check: (value, field) => (typeof value === "boolean" ? [] : [{ field, reason: "wrong_type", message: `${field} is false (the agent gets no shell and starts no program on its computer) or true (as absent)` }]),
|
|
48
50
|
},
|
|
51
|
+
// true: each run's video of the screen (computer-record.ts), made with this server's ffmpeg, so a server without one
|
|
52
|
+
// refuses it here.
|
|
53
|
+
record: {
|
|
54
|
+
kinds: ["desktop", "phone"],
|
|
55
|
+
check: (value, field) => {
|
|
56
|
+
if (typeof value !== "boolean")
|
|
57
|
+
return [{ field, reason: "wrong_type", message: `${field} is true (each run records a video of the computer's screen) or false (as absent)` }];
|
|
58
|
+
const missing = value ? recorderMissing() : undefined;
|
|
59
|
+
return missing ? [{ field, reason: "not_allowed", message: `${field} needs ffmpeg, which records the video: ${missing}`, fix: `Install ffmpeg on this server's PATH (Debian: apt install ffmpeg), or remove ${field}.` }] : [];
|
|
60
|
+
},
|
|
61
|
+
},
|
|
49
62
|
gpu: {
|
|
50
63
|
kinds: ["sandbox"],
|
|
51
64
|
check: (gpu, field) => {
|
package/dist/computers.js
CHANGED
|
@@ -7,8 +7,6 @@
|
|
|
7
7
|
// their names only: a provider declares them, Settings takes only those, and the store keeps each sealed under the
|
|
8
8
|
// server's seal key (server-keys.ts); a provider is handed its keys only at the claim, or for its test, both through
|
|
9
9
|
// computer-keys.ts (providerOptions, testConnection), which maps a key's name onto the option it fills.
|
|
10
|
-
import { accessSync, constants, statSync } from "node:fs";
|
|
11
|
-
import { delimiter, join } from "node:path";
|
|
12
10
|
import { imagesOf } from "@parcha/agentrun-computer";
|
|
13
11
|
import { BOX_ALLOW_ENV, boxAllowOf } from "./box-settings.js";
|
|
14
12
|
import { KEY_TABLE, keyChoices, providerOptions, testConnection } from "./computer-keys.js";
|
|
@@ -16,6 +14,7 @@ import { COMPUTER_KINDS, gpuOf } from "./computer-setting.js";
|
|
|
16
14
|
import { inArchilMode } from "./archil-settings.js";
|
|
17
15
|
import { daemonUp, noDockerWords } from "./docker-daemon.js";
|
|
18
16
|
import { ApiError, invalid } from "./errors.js";
|
|
17
|
+
import { commandOnPath } from "./host-command.js";
|
|
19
18
|
import { gpuRefused } from "./gpu-words.js";
|
|
20
19
|
import { redacted } from "./key-refusal.js";
|
|
21
20
|
import { keyMetaOf, envValue } from "./key-meta.js";
|
|
@@ -45,18 +44,7 @@ export function hostCommandWhy(label, { command, from, builds }, platform = proc
|
|
|
45
44
|
* words: what Settings → Computers, a run's start and the claim say for it. A command is there when a folder of `path`
|
|
46
45
|
* holds an executable file of its name. */
|
|
47
46
|
export function hostCommandRefusals(providers, path, platform = process.platform, arch = process.arch) {
|
|
48
|
-
|
|
49
|
-
const named = (command) => (platform === "win32" ? [command, ...[".exe", ".cmd", ".bat"].map((extension) => `${command}${extension}`)] : [command]);
|
|
50
|
-
const found = (command) => (path ?? "").split(delimiter).some((folder) => folder !== "" && named(command).some((file) => {
|
|
51
|
-
try {
|
|
52
|
-
accessSync(join(folder, file), constants.X_OK);
|
|
53
|
-
return statSync(join(folder, file)).isFile();
|
|
54
|
-
}
|
|
55
|
-
catch {
|
|
56
|
-
return false;
|
|
57
|
-
}
|
|
58
|
-
}));
|
|
59
|
-
return Object.fromEntries(providers.flatMap((provider) => (provider.hostCommand && !found(provider.hostCommand.command) ? [[provider.id, hostCommandWhy(provider.label, provider.hostCommand, platform, arch)]] : [])));
|
|
47
|
+
return Object.fromEntries(providers.flatMap((provider) => (provider.hostCommand && !commandOnPath(provider.hostCommand.command, path, platform) ? [[provider.id, hostCommandWhy(provider.label, provider.hostCommand, platform, arch)]] : [])));
|
|
60
48
|
}
|
|
61
49
|
/** A computer with no network: its programs run in a network of their own, so a run's allow-list is never offered it. */
|
|
62
50
|
export const NO_NETWORK_WORDS = "no network, so this server's allow-list isn't offered";
|