@parcha/agentrun-serve 0.1.0-beta.41 → 0.1.0-beta.43
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 +74 -0
- package/NOTICE +2 -0
- package/README.md +85 -19
- 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-BrcDSBD8.css +1 -0
- package/dist/console/assets/index-Bz6IWncl.js +711 -0
- package/dist/console/index.html +2 -2
- package/dist/decisions.js +0 -4
- 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/import-sources.js +25 -5
- package/dist/learn/audit.d.ts +123 -0
- package/dist/learn/audit.js +159 -0
- package/dist/learn/check.d.ts +14 -0
- package/dist/learn/check.js +194 -14
- package/dist/learn/compile.d.ts +75 -78
- package/dist/learn/compile.js +175 -176
- package/dist/learn/folder.d.ts +9 -0
- package/dist/learn/folder.js +13 -2
- package/dist/learn/promote.d.ts +138 -196
- package/dist/learn/promote.js +68 -184
- package/dist/learn/replay-calls.d.ts +5 -0
- package/dist/learn/replay-calls.js +12 -1
- package/dist/learn/secrets.d.ts +8 -0
- package/dist/learn/secrets.js +12 -0
- package/dist/learn/skills.js +2 -4
- package/dist/learn/workflow-nodes.d.ts +1 -2
- package/dist/learn/workflow-nodes.js +2 -3
- package/dist/learned-nodes.d.ts +9 -34
- package/dist/learned-nodes.js +11 -23
- package/dist/learned-workflow.d.ts +6 -8
- package/dist/learned-workflow.js +18 -57
- package/dist/learning-batch.d.ts +13 -5
- package/dist/learning-batch.js +34 -8
- package/dist/learning-cost.d.ts +11 -4
- package/dist/learning-cost.js +4 -2
- package/dist/learning-routes.js +1 -1
- package/dist/learning-setting.d.ts +38 -0
- package/dist/learning-setting.js +83 -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 +195 -59
- package/dist/run-files.d.ts +6 -2
- package/dist/run-files.js +29 -7
- package/dist/run-launch.d.ts +6 -3
- package/dist/run-launch.js +2 -0
- package/dist/run-learning-served.d.ts +2 -2
- 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 +5 -1
- package/dist/runner/adapter-loop.js +20 -8
- package/dist/runner/adapter-run-spec.d.ts +16 -1
- package/dist/runner/adapter-run-spec.js +36 -11
- package/dist/runner/audit.d.ts +64 -0
- package/dist/runner/audit.js +338 -0
- package/dist/runner/beside.js +2 -2
- package/dist/runner/cli-run-spec.js +25 -12
- package/dist/runner/feedback-round.d.ts +9 -25
- package/dist/runner/feedback-round.js +19 -40
- package/dist/runner/harness-loops.js +1 -15
- package/dist/runner/journal-kinds.d.ts +0 -7
- package/dist/runner/journal-kinds.js +0 -7
- package/dist/runner/learning-dispatch.d.ts +0 -16
- package/dist/runner/learning-dispatch.js +4 -47
- package/dist/runner/learning-end.d.ts +62 -13
- package/dist/runner/learning-end.js +180 -74
- package/dist/runner/learning-factory.d.ts +1 -1
- package/dist/runner/learning-factory.js +1 -4
- package/dist/runner/learning-loop.d.ts +2 -38
- package/dist/runner/learning-loop.js +8 -116
- package/dist/runner/main.d.ts +11 -0
- package/dist/runner/main.js +30 -3
- package/dist/runner/mcp-run.d.ts +2 -2
- package/dist/runner/promotion.d.ts +78 -50
- package/dist/runner/promotion.js +371 -503
- package/dist/runner/reflect-hook.d.ts +15 -0
- package/dist/runner/reflect-hook.js +28 -14
- package/dist/runner/store-secrets.js +3 -1
- package/dist/runner/workflow-first.d.ts +6 -11
- package/dist/runner/workflow-first.js +24 -25
- 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 +132 -26
- package/dist/store/agent-body.d.ts +5 -3
- package/dist/store/agent-body.js +14 -10
- package/dist/store/sqlite/store.js +1 -0
- package/dist/store/store.d.ts +3 -0
- package/dist/store-reads/learning.d.ts +18 -7
- package/dist/store-reads/learning.js +36 -23
- package/dist/store-reads/loop.d.ts +5 -39
- package/dist/store-reads/loop.js +21 -80
- package/dist/store-view.d.ts +5 -0
- package/dist/store-view.js +16 -2
- 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/dist/workspace/run-tools.d.ts +1 -1
- package/dist/workspace/run-tools.js +14 -3
- package/launcher/agentrun-serve +31 -24
- package/package.json +10 -9
- package/templates/README.md +11 -2
- package/dist/console/assets/index-C3gNPz58.css +0 -1
- package/dist/console/assets/index-COGhx_2Z.js +0 -711
- package/dist/learn/general.d.ts +0 -69
- package/dist/learn/general.js +0 -75
- package/dist/learn/refit.d.ts +0 -48
- package/dist/learn/refit.js +0 -264
- package/dist/runner/step-guard.d.ts +0 -62
- package/dist/runner/step-guard.js +0 -93
package/dist/mcp-oauth.d.ts
CHANGED
|
@@ -126,6 +126,14 @@ export declare function mcpServerAt(url: URL, signal: AbortSignal, network: OAut
|
|
|
126
126
|
} | {
|
|
127
127
|
address: string | undefined;
|
|
128
128
|
}>;
|
|
129
|
+
/** Where a read of a calendar's file at `url` may go (calendar/fetch.ts, each redirect hop): `mcpServerAt`'s rule, the
|
|
130
|
+
* server's one, in the calendar's words. Dialled with dialAt. */
|
|
131
|
+
export declare function calendarAt(url: URL, signal: AbortSignal, network: OAuthNetwork, reach?: Reach): Promise<{
|
|
132
|
+
refused: string;
|
|
133
|
+
unresolved?: true;
|
|
134
|
+
} | {
|
|
135
|
+
address: string | undefined;
|
|
136
|
+
}>;
|
|
129
137
|
/** A fetch to the MCP server `mcpServerAt` checked: dialled at `address` (the network's dial, else its fetch), or as
|
|
130
138
|
* written when there is none (a loopback URL a local install allows), through `plain`. */
|
|
131
139
|
export declare const dialAt: (network: OAuthNetwork, address: string | undefined, plain?: typeof fetch) => (input: string | URL | Request, init?: RequestInit) => Promise<Response>;
|
package/dist/mcp-oauth.js
CHANGED
|
@@ -255,6 +255,13 @@ export async function mcpServerAt(url, signal, network, reach = {}) {
|
|
|
255
255
|
return { address: undefined };
|
|
256
256
|
return checked(`the MCP server at ${url.host}`, url.href, signal, network, reach);
|
|
257
257
|
}
|
|
258
|
+
/** Where a read of a calendar's file at `url` may go (calendar/fetch.ts, each redirect hop): `mcpServerAt`'s rule, the
|
|
259
|
+
* server's one, in the calendar's words. Dialled with dialAt. */
|
|
260
|
+
export async function calendarAt(url, signal, network, reach = {}) {
|
|
261
|
+
if (reach.loopback && loopbackAllowed(url, url.href, reach.own ?? []))
|
|
262
|
+
return { address: undefined };
|
|
263
|
+
return checked(`the calendar at ${url.host}`, url.href, signal, network, reach);
|
|
264
|
+
}
|
|
258
265
|
/** A fetch to the MCP server `mcpServerAt` checked: dialled at `address` (the network's dial, else its fetch), or as
|
|
259
266
|
* written when there is none (a loopback URL a local install allows), through `plain`. */
|
|
260
267
|
export const dialAt = (network, address, plain = fetch) => (input, init = {}) => {
|
|
@@ -19,6 +19,19 @@ export declare function privateAllowed(address: string, own: readonly string[]):
|
|
|
19
19
|
export declare function privateOAuthHosts(store: {
|
|
20
20
|
settings: Pick<Settings, "get">;
|
|
21
21
|
}): Promise<string[]>;
|
|
22
|
+
/** The store.settings key a server keeps its own addresses under at each start (Serve.own: where it listens, and its
|
|
23
|
+
* public address when that is on loopback): `{ own: string[] }`. Addresses alone, never its loopback opt-in, which each
|
|
24
|
+
* process reads from its own environment: a runner in its own process with its own opt-in reads them so its runs never
|
|
25
|
+
* reach that server's ports on loopback (runner/main.ts runnerLoop), whatever port the server was started on. */
|
|
26
|
+
export declare const MCP_SERVER_OWN_KEY = "mcp.server_own";
|
|
27
|
+
/** The server's start: its own addresses, replacing the last start's. */
|
|
28
|
+
export declare function saveServerOwn(store: {
|
|
29
|
+
settings: Pick<Settings, "put">;
|
|
30
|
+
}, own: readonly string[]): Promise<void>;
|
|
31
|
+
/** The addresses the server kept at its last start (saveServerOwn), read at each use; none before a server started. */
|
|
32
|
+
export declare function serverOwn(store: {
|
|
33
|
+
settings: Pick<Settings, "get">;
|
|
34
|
+
}): Promise<string[]>;
|
|
22
35
|
/** The list replaced with `hosts` (already checked: checkPrivateHosts). */
|
|
23
36
|
export declare function savePrivateOAuthHosts(store: {
|
|
24
37
|
settings: Pick<Settings, "put">;
|
|
@@ -62,6 +62,22 @@ function hostsOf(value) {
|
|
|
62
62
|
export async function privateOAuthHosts(store) {
|
|
63
63
|
return hostsOf(await store.settings.get(MCP_PRIVATE_HOSTS_KEY));
|
|
64
64
|
}
|
|
65
|
+
/** The store.settings key a server keeps its own addresses under at each start (Serve.own: where it listens, and its
|
|
66
|
+
* public address when that is on loopback): `{ own: string[] }`. Addresses alone, never its loopback opt-in, which each
|
|
67
|
+
* process reads from its own environment: a runner in its own process with its own opt-in reads them so its runs never
|
|
68
|
+
* reach that server's ports on loopback (runner/main.ts runnerLoop), whatever port the server was started on. */
|
|
69
|
+
export const MCP_SERVER_OWN_KEY = "mcp.server_own";
|
|
70
|
+
/** The server's start: its own addresses, replacing the last start's. */
|
|
71
|
+
export async function saveServerOwn(store, own) {
|
|
72
|
+
await store.settings.put(MCP_SERVER_OWN_KEY, { own: [...own] });
|
|
73
|
+
}
|
|
74
|
+
/** The addresses the server kept at its last start (saveServerOwn), read at each use; none before a server started. */
|
|
75
|
+
export async function serverOwn(store) {
|
|
76
|
+
const value = await store.settings.get(MCP_SERVER_OWN_KEY);
|
|
77
|
+
if (typeof value !== "object" || value === null || !Array.isArray(value.own))
|
|
78
|
+
return [];
|
|
79
|
+
return (value.own).filter((one) => typeof one === "string");
|
|
80
|
+
}
|
|
65
81
|
/** The list replaced with `hosts` (already checked: checkPrivateHosts). */
|
|
66
82
|
export async function savePrivateOAuthHosts(store, hosts) {
|
|
67
83
|
await store.settings.put(MCP_PRIVATE_HOSTS_KEY, { hosts: [...hosts] });
|
package/dist/openapi.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { type TriggerAdapter } from "./trigger-adapter.js";
|
|
2
2
|
import "./mcp-secret-writes.js";
|
|
3
3
|
import "./email/routes.js";
|
|
4
|
+
import "./calendar/routes.js";
|
|
4
5
|
import "./computers.js";
|
|
5
6
|
type Json = Record<string, unknown>;
|
|
6
7
|
/** Why each capability this server turns off answers 501, by the route's capability. */
|