@parcha/agentrun-serve 0.1.0-beta.29 → 0.1.0-beta.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/CHANGELOG.md +188 -0
- package/README.md +564 -97
- package/dist/adapters.d.ts +35 -6
- package/dist/adapters.js +152 -26
- package/dist/agents.d.ts +11 -5
- package/dist/agents.js +16 -10
- package/dist/app.js +80 -20
- package/dist/background.d.ts +28 -0
- package/dist/background.js +376 -0
- package/dist/box-egress.d.ts +98 -0
- package/dist/box-egress.js +259 -0
- package/dist/box-image.d.ts +1 -1
- package/dist/box-image.js +9 -7
- package/dist/box-relay-vm.d.ts +80 -0
- package/dist/box-relay-vm.js +389 -0
- package/dist/box-relay.d.ts +8 -5
- package/dist/box-relay.js +14 -9
- package/dist/boxes.d.ts +21 -3
- package/dist/boxes.js +14 -7
- package/dist/browser-cost.d.ts +41 -0
- package/dist/browser-cost.js +158 -0
- package/dist/cap.d.ts +129 -21
- package/dist/cap.js +338 -67
- package/dist/coding-tools.d.ts +7 -3
- package/dist/coding-tools.js +16 -10
- package/dist/console/THIRD-PARTY-NOTICES.txt +580 -0
- package/dist/console/assets/index-34jfpIbQ.js +481 -0
- package/dist/console/assets/index-DUHbWcIP.css +1 -0
- package/dist/console/index.html +2 -2
- package/dist/content-filter.d.ts +7 -0
- package/dist/content-filter.js +23 -0
- package/dist/decision-rows.d.ts +11 -3
- package/dist/decision-rows.js +18 -11
- package/dist/errors.d.ts +2 -0
- package/dist/errors.js +5 -2
- package/dist/files.d.ts +6 -1
- package/dist/files.js +7 -2
- package/dist/grade.d.ts +7 -10
- package/dist/grade.js +31 -51
- package/dist/graph-served.d.ts +23 -0
- package/dist/graph-served.js +75 -0
- package/dist/graph-view.d.ts +7 -5
- package/dist/graph-view.js +10 -3
- package/dist/harness-app.d.ts +4 -2
- package/dist/harness-app.js +101 -19
- package/dist/harness-opencode/adapter.d.ts +45 -0
- package/dist/harness-opencode/adapter.js +272 -0
- package/dist/harness-opencode/binary.d.ts +18 -0
- package/dist/harness-opencode/binary.js +87 -0
- package/dist/harness-opencode/config.d.ts +24 -0
- package/dist/harness-opencode/config.js +61 -0
- package/dist/harness-opencode/harness.d.ts +77 -0
- package/dist/harness-opencode/harness.js +620 -0
- package/dist/harness-opencode/host/mcp.d.ts +40 -0
- package/dist/harness-opencode/host/mcp.js +208 -0
- package/dist/harness-opencode/host/policy.d.ts +71 -0
- package/dist/harness-opencode/host/policy.js +419 -0
- package/dist/harness-opencode/host/server.d.ts +55 -0
- package/dist/harness-opencode/host/server.js +165 -0
- package/dist/harness-opencode/index.d.ts +9 -0
- package/dist/harness-opencode/index.js +6 -0
- package/dist/harness-opencode/verify.d.ts +32 -0
- package/dist/harness-opencode/verify.js +75 -0
- package/dist/harness-opencode/versions.d.ts +33 -0
- package/dist/harness-opencode/versions.js +64 -0
- package/dist/harness.d.ts +4 -1
- package/dist/harness.js +5 -2
- package/dist/host-tools.d.ts +12 -2
- package/dist/host-tools.js +26 -12
- package/dist/host.js +6 -2
- package/dist/hosted-search.js +5 -1
- package/dist/import.d.ts +2 -2
- package/dist/import.js +4 -3
- package/dist/key-check.d.ts +3 -2
- package/dist/key-check.js +7 -3
- package/dist/key-refusal.js +8 -4
- package/dist/learn/check.d.ts +10 -1
- package/dist/learn/check.js +19 -1
- package/dist/learn/grade.d.ts +3 -2
- package/dist/learn/grade.js +25 -13
- package/dist/learn/index.d.ts +2 -2
- package/dist/learn/index.js +2 -2
- package/dist/learn/notes.js +2 -1
- package/dist/learn/reflect.d.ts +2 -2
- package/dist/learn/reflect.js +51 -5
- package/dist/learn/secrets.js +28 -8
- package/dist/learn/skills.d.ts +17 -4
- package/dist/learn/skills.js +79 -6
- package/dist/learned-workflow.d.ts +59 -0
- package/dist/learned-workflow.js +191 -0
- package/dist/learning-run.d.ts +7 -5
- package/dist/learning-run.js +45 -23
- package/dist/learning-words.d.ts +6 -3
- package/dist/learning-words.js +8 -5
- package/dist/learning.d.ts +44 -3
- package/dist/learning.js +148 -3
- package/dist/mcp-servers.d.ts +7 -4
- package/dist/mcp-servers.js +5 -0
- package/dist/mcp.js +5 -5
- package/dist/model.d.ts +13 -11
- package/dist/model.js +11 -10
- package/dist/openapi/agentrun-v2.openapi.json +1 -0
- package/dist/openapi.js +358 -48
- package/dist/paid-calls.d.ts +5 -1
- package/dist/paid-calls.js +1 -1
- package/dist/pause.d.ts +2 -0
- package/dist/place.d.ts +27 -4
- package/dist/place.js +42 -10
- package/dist/propose.d.ts +2 -0
- package/dist/propose.js +38 -8
- package/dist/request-start.d.ts +12 -4
- package/dist/request-start.js +139 -15
- package/dist/run-box.d.ts +56 -4
- package/dist/run-box.js +173 -23
- package/dist/runnable.d.ts +5 -2
- package/dist/runnable.js +12 -4
- package/dist/runs.d.ts +258 -36
- package/dist/runs.js +830 -89
- package/dist/secrets.d.ts +12 -0
- package/dist/secrets.js +18 -0
- package/dist/server.d.ts +131 -35
- package/dist/server.js +467 -105
- package/dist/sign-ins.d.ts +99 -0
- package/dist/sign-ins.js +288 -0
- package/dist/skills.d.ts +16 -4
- package/dist/skills.js +35 -7
- package/dist/stats.d.ts +7 -2
- package/dist/stats.js +28 -7
- package/dist/tool-gate.d.ts +266 -0
- package/dist/tool-gate.js +554 -0
- package/dist/tool-keys.d.ts +46 -10
- package/dist/tool-keys.js +44 -2
- package/dist/tool-plane.d.ts +112 -27
- package/dist/tool-plane.js +205 -47
- package/dist/tools.d.ts +69 -14
- package/dist/tools.js +143 -24
- package/dist/trigger-secrets.d.ts +32 -0
- package/dist/trigger-secrets.js +143 -0
- package/dist/triggers.d.ts +439 -0
- package/dist/triggers.js +863 -0
- package/dist/turn-end.d.ts +3 -2
- package/dist/turn-end.js +3 -2
- package/dist/usage-lines.d.ts +26 -0
- package/dist/usage-lines.js +28 -0
- package/dist/validate.d.ts +2 -0
- package/dist/validate.js +11 -2
- package/dist/webhooks.d.ts +11 -4
- package/dist/webhooks.js +17 -1
- package/launcher/agentrun-serve +1 -1
- package/package.json +19 -13
- package/dist/console/assets/index-BN7oVcO4.js +0 -445
- package/dist/console/assets/index-By-jkqki.css +0 -1
package/dist/coding-tools.d.ts
CHANGED
|
@@ -1,10 +1,13 @@
|
|
|
1
1
|
import type { Context } from "@earendil-works/chord";
|
|
2
2
|
import { type Extension, type ToolRegistration } from "@earendil-works/pi-durable";
|
|
3
|
+
import { SHELL_TOOLS } from "./background.js";
|
|
3
4
|
import { type Place } from "./place.js";
|
|
4
5
|
/** pi's coding tools on the runner, without bash, each refusal of a path outside the workspace named by the path the
|
|
5
6
|
* call gave (`asGivenRefusals`): the model reads that refusal, and the run's timeline shows it. */
|
|
6
7
|
export declare const CodingTools: Extension;
|
|
7
|
-
/** The tools a box
|
|
8
|
+
/** The tools that run a command in the box, never on this machine: bash, and the background tools (background.ts). */
|
|
9
|
+
export { SHELL_TOOLS };
|
|
10
|
+
/** The tools a box runs, by name: pi's four and the background tools. */
|
|
8
11
|
export declare const BOXED_TOOLS: readonly string[];
|
|
9
12
|
/** A run's coding tools and the extension a conversation selects for them. */
|
|
10
13
|
export type CodingSource = {
|
|
@@ -26,6 +29,7 @@ export type BoxedEnv = {
|
|
|
26
29
|
* path. */
|
|
27
30
|
export declare function boxPath(path: string, hostWork?: string): string | undefined;
|
|
28
31
|
/** A run's coding tools by its place: on the runner, CodingTools (no bash); in a box, pi's read, write, edit and bash,
|
|
29
|
-
* each with its arguments, output and replay as pi ships it and its environment the box's
|
|
30
|
-
* the box's work dir; bash's command is
|
|
32
|
+
* each with its arguments, output and replay as pi ships it and its environment the box's, and the background tools
|
|
33
|
+
* (background.ts), each call a command in the box. A file tool's path stays in the box's work dir; bash's command is
|
|
34
|
+
* the box's own. */
|
|
31
35
|
export declare function codingSource(place: Place, box?: BoxedEnv): CodingSource;
|
package/dist/coding-tools.js
CHANGED
|
@@ -4,19 +4,20 @@
|
|
|
4
4
|
// wrapped so a refusal names the path the call gave (asGivenRefusals), and the extension keeps everything else pi's
|
|
5
5
|
// carries (its name, so a conversation selects it as before).
|
|
6
6
|
//
|
|
7
|
-
// A run whose place is a box gets codingSource's instead: pi's own read, write, edit and bash,
|
|
8
|
-
// box's environment (run-box.ts), so the shell exists only in the box. One source feeds pi's tool table (tools.ts,
|
|
7
|
+
// A run whose place is a box gets codingSource's instead: pi's own read, write, edit and bash, and the background tools
|
|
8
|
+
// (background.ts), each call made on the box's environment (run-box.ts), so the shell exists only in the box. One source feeds pi's tool table (tools.ts,
|
|
9
9
|
// app.ts) and another harness's host tools (host-tools.ts).
|
|
10
10
|
//
|
|
11
11
|
// Where the box binds the run's work/ from this machine and the confinement holds directory handles (Docker on Linux),
|
|
12
12
|
// read, write and edit run on this machine instead, on the bind's source (bound-files.ts): a command in the box costs
|
|
13
|
-
// far more than a file read. bash always
|
|
14
|
-
// directories by path) does too.
|
|
13
|
+
// far more than a file read. bash and the background tools always run in the box, and every tool of any other box (or of
|
|
14
|
+
// any host that reaches directories by path) does too.
|
|
15
15
|
import { posix } from "node:path";
|
|
16
16
|
import { ROOT_CONVERSATION_ID } from "@earendil-works/pi-durable";
|
|
17
17
|
import { FileError } from "@earendil-works/pi-durable/env";
|
|
18
18
|
import { HOST_PHASE } from "@parcha/pi-durable-agent/timeline";
|
|
19
19
|
import { ArchilCodingTools } from "@parcha/pi-durable-disk";
|
|
20
|
+
import { BACKGROUND_TOOLS, backgroundTools, SHELL_TOOLS } from "./background.js";
|
|
20
21
|
import { boundFiles } from "./bound-files.js";
|
|
21
22
|
import { BOX_WORK } from "./place.js";
|
|
22
23
|
import { asGivenRefusals, refuseOutsideWorkspace } from "./workspace-paths.js";
|
|
@@ -27,8 +28,12 @@ const pis = ArchilCodingTools;
|
|
|
27
28
|
/** pi's coding tools on the runner, without bash, each refusal of a path outside the workspace named by the path the
|
|
28
29
|
* call gave (`asGivenRefusals`): the model reads that refusal, and the run's timeline shows it. */
|
|
29
30
|
export const CodingTools = { ...pis, tools: asGivenRefusals((pis.tools ?? []).filter((tool) => tool.name !== "bash")) };
|
|
30
|
-
/**
|
|
31
|
-
|
|
31
|
+
/** pi's tools a box runs, by name. */
|
|
32
|
+
const PI_BOXED = ["read", "write", "edit", "bash"];
|
|
33
|
+
/** The tools that run a command in the box, never on this machine: bash, and the background tools (background.ts). */
|
|
34
|
+
export { SHELL_TOOLS };
|
|
35
|
+
/** The tools a box runs, by name: pi's four and the background tools. */
|
|
36
|
+
export const BOXED_TOOLS = [...PI_BOXED, ...BACKGROUND_TOOLS];
|
|
32
37
|
/** A failed call's error with what the file environment said, where pi's message gives only its code (edit's "Error
|
|
33
38
|
* code: permission_denied."), so the model reads why and what it can do. */
|
|
34
39
|
const withCause = (error) => {
|
|
@@ -47,15 +52,16 @@ export function boxPath(path, hostWork) {
|
|
|
47
52
|
return at === BOX_WORK || at.startsWith(`${BOX_WORK}/`) ? named : undefined;
|
|
48
53
|
}
|
|
49
54
|
/** A run's coding tools by its place: on the runner, CodingTools (no bash); in a box, pi's read, write, edit and bash,
|
|
50
|
-
* each with its arguments, output and replay as pi ships it and its environment the box's
|
|
51
|
-
* the box's work dir; bash's command is
|
|
55
|
+
* each with its arguments, output and replay as pi ships it and its environment the box's, and the background tools
|
|
56
|
+
* (background.ts), each call a command in the box. A file tool's path stays in the box's work dir; bash's command is
|
|
57
|
+
* the box's own. */
|
|
52
58
|
export function codingSource(place, box) {
|
|
53
59
|
if (place.mode === "runner")
|
|
54
60
|
return { extension: CodingTools, tools: CodingTools.tools ?? [] };
|
|
55
61
|
if (!box)
|
|
56
62
|
throw new Error("a run whose place is a box needs its box for its coding tools");
|
|
57
63
|
const here = box.hostWork && writesHeld() ? boundFiles(box.hostWork) : undefined;
|
|
58
|
-
const tools = asGivenRefusals((pis.tools ?? []).filter((tool) =>
|
|
64
|
+
const tools = asGivenRefusals([...(pis.tools ?? []).filter((tool) => PI_BOXED.includes(tool.name)), ...backgroundTools()].map((tool) => ({
|
|
59
65
|
...tool,
|
|
60
66
|
execute: async (args, api, context) => {
|
|
61
67
|
// A file tool's path in the box's words, or refused as the confined tools refuse (refuseOutsideWorkspace): named
|
|
@@ -67,7 +73,7 @@ export function codingSource(place, box) {
|
|
|
67
73
|
const given = inBox === undefined ? args : { ...args, path: inBox };
|
|
68
74
|
// read, write and edit on this machine's work/, where the box binds it; no box is made for them. A box an earlier
|
|
69
75
|
// process left has its left commands killed first, so none of them changes work/ under these tools.
|
|
70
|
-
if (here && tool.name
|
|
76
|
+
if (here && !SHELL_TOOLS.includes(tool.name) && (await box.bound?.()) === true) {
|
|
71
77
|
await box.leftEnded?.(context);
|
|
72
78
|
return tool.execute(given, { ...api, env: here }, context).catch((error) => Promise.reject(withCause(error)));
|
|
73
79
|
}
|