@parcha/agentrun-serve 0.1.0-beta.39 → 0.1.0-beta.41
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 +114 -0
- package/README.md +129 -16
- package/dist/api-only.d.ts +3 -1
- package/dist/api-only.js +4 -2
- package/dist/api-token.d.ts +30 -0
- package/dist/api-token.js +89 -0
- package/dist/cli.js +19 -5
- package/dist/composio-made.d.ts +54 -0
- package/dist/composio-made.js +83 -0
- package/dist/composio-preset.d.ts +16 -8
- package/dist/composio-preset.js +106 -43
- package/dist/composio-triggers.d.ts +7 -2
- package/dist/composio-triggers.js +13 -7
- package/dist/computer-attach.d.ts +29 -11
- package/dist/computer-attach.js +141 -47
- package/dist/computer-keys.d.ts +4 -0
- package/dist/computer-keys.js +5 -0
- package/dist/computers.d.ts +11 -1
- package/dist/computers.js +21 -12
- package/dist/console/assets/index-C3gNPz58.css +1 -0
- package/dist/console/assets/index-COGhx_2Z.js +711 -0
- package/dist/console/index.html +2 -2
- package/dist/decisions.js +9 -2
- package/dist/email/account.d.ts +0 -1
- package/dist/email/account.js +3 -3
- package/dist/email/answer.d.ts +5 -0
- package/dist/email/answer.js +35 -0
- package/dist/email/mail.js +19 -26
- package/dist/email/names.d.ts +30 -0
- package/dist/email/names.js +34 -0
- package/dist/email/routes.d.ts +1 -0
- package/dist/email/routes.js +1 -1
- package/dist/email/tools.d.ts +11 -4
- package/dist/email/tools.js +91 -46
- package/dist/eval-feed.d.ts +26 -0
- package/dist/eval-feed.js +68 -0
- package/dist/eval-mailbox.d.ts +5 -2
- package/dist/eval-mailbox.js +14 -6
- package/dist/exa-keyless.d.ts +1 -1
- package/dist/exa-keyless.js +1 -1
- package/dist/feed/feed-faux.d.ts +62 -0
- package/dist/feed/feed-faux.js +123 -0
- package/dist/feed/fetch.d.ts +41 -0
- package/dist/feed/fetch.js +128 -0
- package/dist/feed/parse.d.ts +41 -0
- package/dist/feed/parse.js +300 -0
- package/dist/learn/check.d.ts +3 -1
- package/dist/learn/check.js +57 -2
- package/dist/learn/compile.d.ts +3 -2
- package/dist/learn/compile.js +7 -6
- package/dist/learn/promote.d.ts +25 -14
- package/dist/learn/promote.js +32 -14
- package/dist/learned-nodes.d.ts +21 -4
- package/dist/learned-nodes.js +21 -8
- package/dist/learned-workflow.d.ts +3 -3
- package/dist/learned-workflow.js +14 -5
- package/dist/learning-cost.d.ts +17 -8
- package/dist/learning-cost.js +12 -4
- package/dist/local-models.d.ts +7 -1
- package/dist/local-models.js +11 -5
- package/dist/mcp-oauth.d.ts +15 -1
- package/dist/mcp-oauth.js +39 -5
- package/dist/mcp-pin-first.d.ts +4 -2
- package/dist/mcp-pin-first.js +4 -3
- package/dist/mcp-servers-store.d.ts +58 -5
- package/dist/mcp-servers-store.js +136 -17
- package/dist/mcp.d.ts +2 -2
- package/dist/mcp.js +2 -2
- package/dist/observation/http.d.ts +4 -1
- package/dist/observation/http.js +5 -4
- package/dist/openapi.d.ts +1 -1
- package/dist/openapi.js +63 -27
- package/dist/port-models.d.ts +4 -1
- package/dist/port-models.js +1 -0
- package/dist/print.d.ts +6 -3
- package/dist/print.js +4 -2
- package/dist/refusal-words.d.ts +3 -0
- package/dist/refusal-words.js +3 -0
- package/dist/run-labels.d.ts +23 -0
- package/dist/run-labels.js +79 -0
- package/dist/run-launch.d.ts +2 -0
- package/dist/run-launch.js +2 -0
- package/dist/run-secrets.js +12 -4
- package/dist/run-view.d.ts +3 -4
- package/dist/run-view.js +26 -24
- package/dist/runner/adapter-loop.d.ts +6 -2
- package/dist/runner/adapter-loop.js +136 -22
- package/dist/runner/adapter-run-spec.d.ts +5 -0
- package/dist/runner/adapter-run-spec.js +75 -32
- package/dist/runner/beside.d.ts +6 -3
- package/dist/runner/beside.js +9 -7
- package/dist/runner/cli-run-spec.js +33 -26
- package/dist/runner/conformance/harness.js +69 -14
- package/dist/runner/conformance/subject.d.ts +4 -1
- package/dist/runner/journal-kinds.d.ts +22 -0
- package/dist/runner/journal-kinds.js +39 -0
- package/dist/runner/main.d.ts +1 -1
- package/dist/runner/main.js +2 -2
- package/dist/runner/mcp-claim.d.ts +3 -0
- package/dist/runner/mcp-claim.js +1 -1
- package/dist/runner/mcp-run.d.ts +4 -0
- package/dist/runner/mcp-run.js +5 -3
- package/dist/runner/model-route.d.ts +7 -3
- package/dist/runner/model-route.js +24 -9
- package/dist/runner/promotion.d.ts +16 -8
- package/dist/runner/promotion.js +178 -55
- package/dist/runner/workflow-first.d.ts +6 -5
- package/dist/runner/workflow-first.js +9 -7
- package/dist/runs-over-store.js +5 -2
- package/dist/sdk/runs.d.ts +7 -1
- package/dist/sdk/runs.js +19 -6
- package/dist/secret-cut.js +3 -1
- package/dist/secrets.js +3 -1
- package/dist/server.d.ts +27 -2
- package/dist/server.js +181 -56
- package/dist/store/dialect.d.ts +6 -0
- package/dist/store/dialect.js +2 -0
- package/dist/store/index.d.ts +1 -1
- package/dist/store/postgres/connection.d.ts +11 -5
- package/dist/store/postgres/connection.js +44 -17
- package/dist/store/postgres/dialect.js +6 -0
- package/dist/store/postgres/migrations/0015_run_labels.sql +5 -0
- package/dist/store/postgres/migrations/0016_minted_tokens.sql +21 -0
- package/dist/store/postgres/store.d.ts +7 -3
- package/dist/store/postgres/store.js +1 -0
- package/dist/store/schema.d.ts +9 -0
- package/dist/store/schema.js +26 -2
- package/dist/store/sqlite/connection.js +80 -8
- package/dist/store/sqlite/run-launch.d.ts +11 -0
- package/dist/store/sqlite/run-launch.js +8 -0
- package/dist/store/sqlite/run-patch.d.ts +2 -1
- package/dist/store/sqlite/run-patch.js +3 -2
- package/dist/store/sqlite/store.js +101 -26
- package/dist/store/sqlite/worker.d.ts +2 -0
- package/dist/store/sqlite/worker.js +13 -10
- package/dist/store/store.d.ts +53 -1
- package/dist/store-reads/journal.js +2 -1
- package/dist/store-reads/learning.d.ts +30 -13
- package/dist/store-reads/learning.js +130 -51
- package/dist/store-reads/runs.d.ts +4 -3
- package/dist/store-reads/runs.js +3 -2
- package/dist/store-view.js +4 -2
- package/dist/template-eval.d.ts +4 -0
- package/dist/template-eval.js +127 -50
- package/dist/templates.d.ts +24 -1
- package/dist/templates.js +129 -21
- package/dist/timeline/origin.d.ts +1 -1
- package/dist/timeline/origin.js +2 -2
- package/dist/tool-gate.d.ts +5 -3
- package/dist/tool-gate.js +5 -2
- package/dist/tools.d.ts +13 -0
- package/dist/tools.js +15 -10
- package/dist/trigger-adapter.d.ts +12 -36
- package/dist/trigger-adapters.js +2 -1
- package/dist/trigger-email.js +30 -77
- package/dist/trigger-feed.d.ts +12 -0
- package/dist/trigger-feed.js +371 -0
- package/dist/triggers.d.ts +27 -14
- package/dist/triggers.js +121 -80
- package/dist/webhooks.js +9 -5
- package/dist/workflow/decision-recovery.js +5 -2
- package/dist/workflow/decisions.d.ts +7 -0
- package/dist/workspace/computer-deps.d.ts +5 -1
- package/dist/workspace/computer-deps.js +2 -2
- package/dist/workspace/index.d.ts +1 -0
- package/dist/workspace/index.js +2 -0
- package/dist/workspace/resolve-computer.d.ts +32 -3
- package/dist/workspace/resolve-computer.js +47 -9
- package/launcher/agentrun-serve +6 -1
- package/package.json +10 -9
- package/templates/README.md +27 -2
- package/dist/console/assets/index-BNhZs-jp.css +0 -1
- package/dist/console/assets/index-BQv5aOGB.js +0 -700
package/dist/server.d.ts
CHANGED
|
@@ -3,6 +3,7 @@ import { type HarnessCapability } from "./harness.js";
|
|
|
3
3
|
import { type HarnessInstaller } from "./harness-install.js";
|
|
4
4
|
import { type LearningMode } from "./learning.js";
|
|
5
5
|
import { type Place } from "./place.js";
|
|
6
|
+
import { type ApiToken } from "./api-token.js";
|
|
6
7
|
import { type Store } from "./store/index.js";
|
|
7
8
|
import { type BoxOffer } from "./place-offers.js";
|
|
8
9
|
import { type StoredKeys } from "./secrets.js";
|
|
@@ -10,7 +11,7 @@ import { type ComposioControl } from "./composio-preset.js";
|
|
|
10
11
|
import type { TriggerAdapter } from "./trigger-adapter.js";
|
|
11
12
|
import { type TriggerClock } from "./triggers.js";
|
|
12
13
|
import { type ToolSettingsMap } from "./tool-plane.js";
|
|
13
|
-
import { AttachHub } from "@parcha/agentrun-computer";
|
|
14
|
+
import { AttachHub, type HostedDial } from "@parcha/agentrun-computer";
|
|
14
15
|
export declare const CONTRACT = "agentrun.v2/0";
|
|
15
16
|
export declare const DEFAULT_PORT = 7340;
|
|
16
17
|
export type ServeOptions = {
|
|
@@ -54,8 +55,13 @@ export type ServeOptions = {
|
|
|
54
55
|
/** The address to listen on (default 127.0.0.1). On any other address every `Host` name is served and the token is
|
|
55
56
|
* the only lock: put TLS in front of it. */
|
|
56
57
|
host?: string;
|
|
57
|
-
/** The token to require in place of the one `DIR/.token` keeps: 32 characters or more, no whitespace.
|
|
58
|
+
/** The token to require in place of the one `DIR/.token` keeps: 32 characters or more, no whitespace. Its id is
|
|
59
|
+
* `default` (api-token.ts). */
|
|
58
60
|
token?: string;
|
|
61
|
+
/** More API tokens (AGENTRUN_TOKENS, api-token.ts parseTokens), each with an id: every one opens every route the
|
|
62
|
+
* token opens. Given these and no `token`, `DIR/.token` is neither read nor made, and the first is the server's
|
|
63
|
+
* token. Each id names its token in the request log; no line holds a secret. */
|
|
64
|
+
tokens?: readonly ApiToken[];
|
|
59
65
|
/** Default 7340; 0 is any free port. */
|
|
60
66
|
port?: number;
|
|
61
67
|
/** When the port is taken at the listen, the next one that is not, of the 100 from it: the port is found by listening,
|
|
@@ -165,6 +171,10 @@ export type ServeOptions = {
|
|
|
165
171
|
learningBudget?: number;
|
|
166
172
|
/** A test's seam: the triggers' clock and timer (triggers.ts), in place of Date.now and setTimeout. */
|
|
167
173
|
triggerClock?: TriggerClock;
|
|
174
|
+
/** A test's and a template eval's seam: the URL a feed trigger's read of `url` goes to in its place (a fake feed on
|
|
175
|
+
* loopback, feed/feed-faux.ts); null when it serves no feed at `url` (read as unreachable, nothing sent); undefined
|
|
176
|
+
* to read it as it is. The trigger, its payload and its words keep `url`. */
|
|
177
|
+
feedsAt?: (url: string) => string | null | undefined;
|
|
168
178
|
/** The server's store (store/index.ts), where the triggers and their firings live, with the agents they run as. Without
|
|
169
179
|
* it the trigger routes answer unavailable and nothing fires. */
|
|
170
180
|
store?: Pick<Store, "triggers" | "runs" | "agents"> & Partial<Pick<Store, "liveViewers">>;
|
|
@@ -191,6 +201,10 @@ export type ServeOptions = {
|
|
|
191
201
|
/** Whether the outbound webhook may send to a private network or this machine: off by default, so no caller of the API
|
|
192
202
|
* can make the server POST inside its own network. The operator's AGENTRUN_WEBHOOK_PRIVATE_TARGETS=1 turns it on. */
|
|
193
203
|
webhookPrivateTargets?: boolean;
|
|
204
|
+
/** A test's seam: the addresses the outbound webhook's receiver's name resolves to, at a save's check and at each try
|
|
205
|
+
* (webhooks.ts), in place of the system resolver's. A test's server answers its example hosts here, so no CI
|
|
206
|
+
* runner's resolver decides what a test sees. */
|
|
207
|
+
webhookLookup?: (host: string) => Promise<string[]>;
|
|
194
208
|
};
|
|
195
209
|
/** The test switches a run's process gets, each module path resolved: empty outside tests. A test's in-process runner
|
|
196
210
|
* takes the same (test/support.mjs startInProcessRunner). */
|
|
@@ -201,11 +215,14 @@ export declare function fauxEnvOf(options: ServeOptions): NodeJS.ProcessEnv;
|
|
|
201
215
|
/** `boxesLine`: what the start's banner says of the boxes, in words (place.ts boxesLine). */
|
|
202
216
|
/** `launchCode`: with no accounts, the code of the console's link this start prints (`/?launch=<code>`), which gives the
|
|
203
217
|
* browser that opens it a console session (page.ts ConsoleSessions). */
|
|
218
|
+
/** `token` is the first of `tokenIds` (the console's session stands for it); `tokenIds` are the ids of every token the
|
|
219
|
+
* server takes, in order (api-token.ts), never their secrets. */
|
|
204
220
|
export type Serve = {
|
|
205
221
|
url: string;
|
|
206
222
|
baseUrl: string;
|
|
207
223
|
port: number;
|
|
208
224
|
token: string;
|
|
225
|
+
tokenIds: readonly string[];
|
|
209
226
|
tokenFile: string | null;
|
|
210
227
|
tokenMade: boolean;
|
|
211
228
|
setupUrl?: string;
|
|
@@ -216,10 +233,18 @@ export type Serve = {
|
|
|
216
233
|
/** The live sockets of the computers paired with this server (computer-attach.ts): a runner beside the server in this
|
|
217
234
|
* process takes it (runner/beside.ts), so its runs can use them. */
|
|
218
235
|
attachHub: AttachHub;
|
|
236
|
+
/** What a dial provider's create takes of this server (HostedProvider's dial): the address its machines dial
|
|
237
|
+
* (AGENTRUN_PUBLIC_URL, absent without one), the tokens it mints for them (computer-attach.ts machineTokens) and the
|
|
238
|
+
* hub their sockets land in. The runner beside the server hands it to its remote providers (runner/beside.ts). */
|
|
239
|
+
dial: HostedDial;
|
|
219
240
|
/** Whether this server is a local install (listening on loopback, reached at no address off it): the one kind whose own
|
|
220
241
|
* runner beside it may reach an MCP server's URL on loopback (runner/beside.ts mcpLoopback). Only that runner is told:
|
|
221
242
|
* it is this process's finding, never a store's, so another host's runner on a shared store never inherits it. */
|
|
222
243
|
localInstall: boolean;
|
|
244
|
+
/** This server's own addresses (McpServersOverStore.own): where it listens, and its public address when that is on
|
|
245
|
+
* loopback. The runner beside it is told them with localInstall (runner/beside.ts mcpOwn), so its runs' loopback reads
|
|
246
|
+
* never reach this server, as its own reads never do. */
|
|
247
|
+
own: readonly string[];
|
|
223
248
|
/** What a stop waits on: the runs whose processes still finish their turn, and the longest it waits on them. */
|
|
224
249
|
stopping(): {
|
|
225
250
|
runs: number;
|