@parcha/agentrun-serve 0.1.0-beta.60 → 0.1.0-beta.62
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 +124 -0
- package/README.md +139 -22
- package/dist/acp-package.d.ts +4 -0
- package/dist/api-only.d.ts +23 -1
- package/dist/api-only.js +43 -4
- 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/browser-person.d.ts +1 -1
- package/dist/browser-person.js +1 -1
- package/dist/calendar/tools.js +1 -1
- package/dist/chatgpt-plan.d.ts +26 -8
- package/dist/chatgpt-plan.js +89 -21
- package/dist/claude-login.d.ts +12 -5
- package/dist/claude-login.js +28 -3
- package/dist/cli.js +61 -18
- 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-QnwGVBeU.js → backend-DEgVn5lC.js} +1 -1
- package/dist/console/assets/index-CG5tELph.js +639 -0
- package/dist/console/assets/share-CIeFK2Oe.js +6 -0
- package/dist/console/assets/{styles-CcceGcu2.js → styles-BGZxYkky.js} +2 -2
- 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/errors.d.ts +1 -0
- package/dist/errors.js +2 -0
- package/dist/harness-check.js +2 -1
- package/dist/harness-recipe.d.ts +13 -2
- package/dist/harness-recipe.js +30 -7
- package/dist/harness-sign-in.js +2 -1
- package/dist/harness-table.d.ts +12 -3
- package/dist/harness-table.js +13 -8
- package/dist/import.d.ts +8 -1
- package/dist/import.js +36 -5
- package/dist/key-check.js +22 -8
- package/dist/key-refusal.js +6 -4
- package/dist/learn/secrets.d.ts +2 -1
- package/dist/learn/secrets.js +2 -2
- package/dist/learned-nodes.d.ts +37 -0
- package/dist/learned-nodes.js +24 -0
- package/dist/local-model.d.ts +144 -0
- package/dist/local-model.js +214 -0
- package/dist/mcp-gateway.d.ts +24 -0
- package/dist/mcp-gateway.js +97 -8
- package/dist/mcp-probe.d.ts +7 -0
- package/dist/mcp-probe.js +7 -0
- 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 +42 -0
- package/dist/ollama-provider.js +118 -2
- package/dist/openapi.js +85 -16
- 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 +28 -11
- package/dist/place.js +43 -14
- package/dist/print.d.ts +3 -2
- package/dist/print.js +8 -6
- package/dist/redact/match.d.ts +17 -4
- package/dist/redact/match.js +57 -15
- package/dist/run-export.js +4 -2
- package/dist/run-launch.js +16 -3
- 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-usage.js +3 -2
- package/dist/runnable.d.ts +6 -3
- package/dist/runnable.js +16 -6
- package/dist/runner/adapter-loop.d.ts +8 -1
- package/dist/runner/adapter-loop.js +148 -29
- package/dist/runner/adapter-run-spec.d.ts +9 -6
- package/dist/runner/adapter-run-spec.js +38 -52
- package/dist/runner/adapters/index.d.ts +4 -0
- package/dist/runner/adapters/index.js +2 -1
- package/dist/runner/adapters/pi.d.ts +3 -2
- package/dist/runner/adapters/pi.js +3 -1
- package/dist/runner/audit.d.ts +1 -1
- package/dist/runner/claim-secrets.d.ts +3 -1
- package/dist/runner/claim-secrets.js +18 -7
- package/dist/runner/cli-run-spec.js +24 -17
- package/dist/runner/compare-end.d.ts +1 -1
- package/dist/runner/dispatch.js +4 -2
- package/dist/runner/harness-loops.d.ts +14 -0
- package/dist/runner/harness-loops.js +51 -5
- package/dist/runner/held.d.ts +4 -1
- package/dist/runner/live-ticker.js +5 -4
- package/dist/runner/loop-contract.d.ts +4 -1
- package/dist/runner/mcp-claim.js +3 -2
- package/dist/runner/mcp-run.d.ts +24 -4
- package/dist/runner/mcp-run.js +47 -2
- package/dist/runner/meta-tools.js +4 -4
- package/dist/runner/metrics.d.ts +6 -0
- package/dist/runner/metrics.js +12 -4
- package/dist/runner/monid-run.js +3 -1
- package/dist/runner/native-loop.js +3 -3
- package/dist/runner/redact.d.ts +3 -0
- package/dist/runner/redact.js +7 -0
- package/dist/runner/run-child-host.d.ts +10 -6
- package/dist/runner/run-child-host.js +44 -29
- package/dist/runner/run-child.js +1 -0
- package/dist/runner/runner.js +2 -0
- package/dist/runner/sdk-loop.js +5 -3
- package/dist/runner/workflow-calls.d.ts +5 -1
- package/dist/runner/workflow-calls.js +65 -19
- package/dist/runner/workflow-loop.d.ts +1 -1
- package/dist/runner/workflow-loop.js +3 -1
- package/dist/runner/workflow-spec.d.ts +4 -0
- package/dist/runner/workflow-spec.js +18 -13
- package/dist/runs-over-store.d.ts +2 -2
- package/dist/runs-over-store.js +1 -1
- package/dist/secret-cut.js +7 -4
- package/dist/secret-rules.d.ts +0 -1
- package/dist/secret-rules.js +122 -88
- package/dist/server.d.ts +17 -1
- package/dist/server.js +208 -69
- package/dist/share-host.d.ts +111 -0
- package/dist/share-host.js +666 -0
- package/dist/slack.js +2 -1
- package/dist/store/postgres/migrate.js +3 -1
- package/dist/store-reads/analytics.d.ts +15 -0
- package/dist/store-reads/analytics.js +17 -0
- package/dist/store-reads/learning.d.ts +5 -4
- package/dist/store-reads/learning.js +7 -4
- 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-plane.d.ts +24 -1
- package/dist/tool-plane.js +75 -3
- package/dist/tools.d.ts +12 -2
- package/dist/tools.js +42 -7
- package/dist/trigger-composio.js +1 -1
- package/dist/trigger-launch-hook.d.ts +2 -2
- package/dist/trigger-launch-hook.js +1 -1
- package/dist/triggers.d.ts +7 -4
- package/dist/triggers.js +4 -4
- 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/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 +12 -3
- 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/dist/console/assets/index-DZi-muIj.js +0 -629
- package/dist/console/assets/share-pz61zIn9.js +0 -6
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
import type { IncomingMessage, ServerResponse } from "node:http";
|
|
2
|
+
import { type CutScrub } from "./run-export.js";
|
|
3
|
+
export { SHARE_HOST_CSP } from "./page.js";
|
|
4
|
+
/** Where everything a share host serves lives. */
|
|
5
|
+
export declare const SHARE_ROOT = "/r/";
|
|
6
|
+
/** The share host's API. */
|
|
7
|
+
export declare const SHARE_API = "/r/v2/";
|
|
8
|
+
/** The most shares one token keeps: a delete makes room. No share expires. */
|
|
9
|
+
export declare const SHARE_QUOTA = 100;
|
|
10
|
+
/** The most reads one upload's per-string scrub makes, a distinct string once per context it stands under (a file's
|
|
11
|
+
* path, a call's command): each is a scrub of its own (about 0.1 ms), so past it the upload is 413 before any is read.
|
|
12
|
+
* With the body's cap it bounds what one upload asks of the scrubber: the whole body once, and at most this many reads,
|
|
13
|
+
* each of a string with a place of its own in the body, so together no more than the body; each context's command is
|
|
14
|
+
* read once (screenShare). */
|
|
15
|
+
export declare const SHARE_STRINGS = 50000;
|
|
16
|
+
/** The rule ids of Jev's cuts (Scrubber beta 3; "jev" until its id is fixed). A share host never runs Jev (it holds no
|
|
17
|
+
* model key), so a restored record of one names a value the host can't find: it is not checked, and counted in the
|
|
18
|
+
* answer, never refused. The value itself is scrubbed as every other, and a hit there needs its own record. */
|
|
19
|
+
export declare const SHARE_JEV_RULES: ReadonlySet<string>;
|
|
20
|
+
/** The most bytes an upload's body may hold: the export's document cap, and room for nothing else. */
|
|
21
|
+
export declare const SHARE_BODY_BYTES: number;
|
|
22
|
+
/** A share's id: 128 bits of randomness in base32 (lowercase, no padding). The URL is the capability. */
|
|
23
|
+
export declare const SHARE_ID: RegExp;
|
|
24
|
+
/** The share host's API, by method, path and name. Nothing else under /r/v2/ is served. */
|
|
25
|
+
export declare const SHARE_HOST_ROUTES: readonly {
|
|
26
|
+
method: string;
|
|
27
|
+
path: string;
|
|
28
|
+
pattern: RegExp;
|
|
29
|
+
name: string;
|
|
30
|
+
}[];
|
|
31
|
+
/** A new share id: 16 random bytes as 26 base32 letters. */
|
|
32
|
+
export declare function newShareId(): string;
|
|
33
|
+
/** `text` read as a share bundle the host takes, or a 400 that says why (never quoting a value of it): canonical JSON (the
|
|
34
|
+
* bytes the export writes: what is hashed, scanned and stored is one text), `agentrun.share/1`, the export's closed keys
|
|
35
|
+
* at every level it fixes (the run's allowlist, agent, source, files, omitted, cuts, restored; rows and the graph are
|
|
36
|
+
* the served shapes, read by the scrubber whole), its caps on files, each file's size and digest, and the document's
|
|
37
|
+
* sha256. */
|
|
38
|
+
export declare function checkShareBundle(text: string): {
|
|
39
|
+
sha256: string;
|
|
40
|
+
};
|
|
41
|
+
/** The scrubber over a bundle as a host reads it, refusing (422, counts by rule id, never a value or where) unless every
|
|
42
|
+
* value it finds is a declared restore.
|
|
43
|
+
*
|
|
44
|
+
* Strict at its core: the scrubber in cut mode with `held` over the whole body, and again over every string value alone
|
|
45
|
+
* (as the export cut them: each at its pointer, so a value a string's own context gives away is found though its JSON
|
|
46
|
+
* escaping hides it from the whole-body read). A scrub that fails or throws is `scrub_failed`. The one exception is a
|
|
47
|
+
* filter over those hits: a hit of one string is excused when the scrubber's table says its kind restores (label,
|
|
48
|
+
* personal, jev; never format, held or dump) AND one `restored` record names it exactly (at, rule, start, end); a hit of
|
|
49
|
+
* the whole body is excused when it lies in one string and overlaps an excused hit there of its rule. Any hit left is
|
|
50
|
+
* `scrub_found`; a `restored` record that excuses no hit (a stale or edited bundle) is `restored_unmatched`, unless its
|
|
51
|
+
* rule is Jev's (SHARE_JEV_RULES), which the host never runs: that one is counted in `unchecked`, by rule, and taken.
|
|
52
|
+
* The kind a record says is never read. More than `strings` reads (each distinct string once per context it stands
|
|
53
|
+
* under) is 413 before any scrub. The cut text is
|
|
54
|
+
* never used: the host stores what was sent or nothing. */
|
|
55
|
+
export declare function screenShare(text: string, held: readonly string[], cutPass?: CutScrub, strings?: number): Promise<{
|
|
56
|
+
unchecked: Record<string, number>;
|
|
57
|
+
}>;
|
|
58
|
+
/** What the host keeps of a share beside its bytes. `deleted_at` marks one its owner deleted: its bytes are gone, and its
|
|
59
|
+
* page answers 410. */
|
|
60
|
+
export type ShareMeta = {
|
|
61
|
+
id: string;
|
|
62
|
+
sha256: string;
|
|
63
|
+
token_id: string;
|
|
64
|
+
created_at: string;
|
|
65
|
+
bytes: number;
|
|
66
|
+
deleted_at?: string;
|
|
67
|
+
};
|
|
68
|
+
/** The shares of one host, in files under `dir`, written to a temp file and renamed, 0600 in 0700 folders. Kept in
|
|
69
|
+
* memory once read: this process is the folder's one writer. */
|
|
70
|
+
export declare class ShareStore {
|
|
71
|
+
readonly dir: string;
|
|
72
|
+
private index;
|
|
73
|
+
private queue;
|
|
74
|
+
constructor(dir: string);
|
|
75
|
+
private all;
|
|
76
|
+
/** One write at a time: a quota is read and a share made in one step. */
|
|
77
|
+
private serial;
|
|
78
|
+
get(id: string): Promise<ShareMeta | undefined>;
|
|
79
|
+
/** The live shares `tokenId` made, oldest first. */
|
|
80
|
+
list(tokenId: string): Promise<ShareMeta[]>;
|
|
81
|
+
/** A 403 when `tokenId` keeps its quota of shares already. */
|
|
82
|
+
roomFor(tokenId: string, quota: number): Promise<void>;
|
|
83
|
+
/** Stores `body` as a new share of `tokenId`, the quota checked again inside the write. */
|
|
84
|
+
create(tokenId: string, body: string, sha256: string, quota: number): Promise<ShareMeta>;
|
|
85
|
+
/** The stored bytes of live share `id`. */
|
|
86
|
+
bytes(id: string): Promise<Buffer>;
|
|
87
|
+
/** Deletes share `id` of `tokenId`: its bytes go, its meta stays as the tombstone its page's 410 reads. */
|
|
88
|
+
delete(id: string, tokenId: string): Promise<void>;
|
|
89
|
+
}
|
|
90
|
+
export interface ShareHostDeps {
|
|
91
|
+
/** The server's data folder: shares live in its `shares/`. */
|
|
92
|
+
readonly data: string;
|
|
93
|
+
/** The id of the token an Authorization header carries (api-token.ts bearerCheck), else undefined. */
|
|
94
|
+
who(req: IncomingMessage): string | undefined;
|
|
95
|
+
/** A refused credential, for the server's log line. */
|
|
96
|
+
authFailed?(route: string, reason: string): void;
|
|
97
|
+
/** The values this host holds (its own keys and tokens): a bundle that holds one is refused. */
|
|
98
|
+
held(): readonly string[];
|
|
99
|
+
/** The origin a share's URL is on: AGENTRUN_PUBLIC_URL, else the server's own address. Never a request's Host. */
|
|
100
|
+
origin(): string;
|
|
101
|
+
/** The console's build (share.html and its assets); the one beside the server when undefined. */
|
|
102
|
+
console: string | undefined;
|
|
103
|
+
version: string;
|
|
104
|
+
/** The scrubber in cut mode, or a test's stand-in. */
|
|
105
|
+
scrub?: CutScrub;
|
|
106
|
+
quota?: number;
|
|
107
|
+
/** The most distinct strings an upload may hold (SHARE_STRINGS), for a test. */
|
|
108
|
+
strings?: number;
|
|
109
|
+
}
|
|
110
|
+
/** The share host's answer to every request, under /r/ or not: `fail` renders a refusal (server.ts's envelope). */
|
|
111
|
+
export declare function shareHost(deps: ShareHostDeps): (req: IncomingMessage, res: ServerResponse, raw: string) => Promise<void>;
|