@parcha/agentrun-serve 0.1.0-beta.54 → 0.1.0-beta.55

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.
Files changed (190) hide show
  1. package/CHANGELOG.md +110 -2
  2. package/README.md +266 -88
  3. package/dist/adapters.d.ts +10 -0
  4. package/dist/adapters.js +46 -0
  5. package/dist/agent-package.d.ts +3 -3
  6. package/dist/agent-package.js +6 -13
  7. package/dist/agents-store.js +6 -5
  8. package/dist/api-only.d.ts +16 -4
  9. package/dist/api-only.js +21 -7
  10. package/dist/cli.js +5 -3
  11. package/dist/composio-made.d.ts +26 -1
  12. package/dist/composio-made.js +39 -2
  13. package/dist/composio-preset.d.ts +3 -2
  14. package/dist/composio-preset.js +46 -14
  15. package/dist/computer-held-routes.js +2 -3
  16. package/dist/computer-setting.d.ts +4 -2
  17. package/dist/computer-setting.js +0 -2
  18. package/dist/computers-running.d.ts +8 -0
  19. package/dist/computers-running.js +27 -0
  20. package/dist/console/assets/backend-D5EmB4N3.js +166 -0
  21. package/dist/console/assets/index-DUYLaqiR.js +746 -0
  22. package/dist/console/assets/index-DYhU4adm.css +1 -0
  23. package/dist/console/index.html +2 -2
  24. package/dist/docker-host-addresses.d.ts +23 -3
  25. package/dist/docker-host-addresses.js +90 -18
  26. package/dist/exa-keyless.d.ts +2 -3
  27. package/dist/exa-keyless.js +43 -127
  28. package/dist/firecrawl-keyless.d.ts +41 -0
  29. package/dist/firecrawl-keyless.js +152 -0
  30. package/dist/handed-secret.d.ts +3 -1
  31. package/dist/handed-secret.js +4 -2
  32. package/dist/harness-keys.d.ts +98 -0
  33. package/dist/harness-keys.js +247 -0
  34. package/dist/harness-recipe-entry.d.ts +14 -9
  35. package/dist/harness-recipe-entry.js +25 -14
  36. package/dist/harness-table.d.ts +16 -1
  37. package/dist/harness-table.js +19 -7
  38. package/dist/harness.d.ts +4 -0
  39. package/dist/harness.js +12 -1
  40. package/dist/host-check.d.ts +2 -0
  41. package/dist/host-check.js +6 -0
  42. package/dist/import-summary.d.ts +1 -1
  43. package/dist/import-summary.js +1 -1
  44. package/dist/import.d.ts +5 -5
  45. package/dist/import.js +54 -67
  46. package/dist/keyless-mcp.d.ts +36 -0
  47. package/dist/keyless-mcp.js +127 -0
  48. package/dist/learn/audit.d.ts +3 -3
  49. package/dist/learn/audit.js +3 -3
  50. package/dist/learn/commit.d.ts +8 -7
  51. package/dist/learn/commit.js +60 -20
  52. package/dist/learn/compile.d.ts +4 -3
  53. package/dist/learn/compile.js +7 -5
  54. package/dist/learn/folder.d.ts +16 -3
  55. package/dist/learn/folder.js +46 -13
  56. package/dist/learn/promote.d.ts +37 -13
  57. package/dist/learn/promote.js +112 -40
  58. package/dist/learn/secrets.js +10 -2
  59. package/dist/learning-routes.d.ts +22 -17
  60. package/dist/learning-routes.js +40 -39
  61. package/dist/learning.js +2 -2
  62. package/dist/manifest.d.ts +10 -0
  63. package/dist/manifest.js +30 -0
  64. package/dist/mcp-pin-first.d.ts +4 -2
  65. package/dist/mcp-pin-first.js +5 -2
  66. package/dist/mcp-secret-writes.d.ts +16 -7
  67. package/dist/mcp-secret-writes.js +35 -27
  68. package/dist/mcp-servers-store.d.ts +30 -6
  69. package/dist/mcp-servers-store.js +112 -28
  70. package/dist/mcp-sources.d.ts +10 -2
  71. package/dist/mcp-sources.js +9 -2
  72. package/dist/mcp-store.d.ts +13 -7
  73. package/dist/mcp-store.js +12 -9
  74. package/dist/model-form.d.ts +3 -2
  75. package/dist/model-form.js +11 -7
  76. package/dist/model.d.ts +20 -4
  77. package/dist/model.js +68 -9
  78. package/dist/native/history.d.ts +1 -1
  79. package/dist/native/history.js +2 -2
  80. package/dist/ollama-provider.d.ts +92 -0
  81. package/dist/ollama-provider.js +495 -0
  82. package/dist/openapi/agentrun-v2.openapi.json +2 -2
  83. package/dist/openapi.js +127 -37
  84. package/dist/page.d.ts +11 -3
  85. package/dist/page.js +22 -7
  86. package/dist/place-offers.d.ts +17 -1
  87. package/dist/place-offers.js +46 -5
  88. package/dist/print.js +1 -1
  89. package/dist/purged-workflow.d.ts +35 -7
  90. package/dist/purged-workflow.js +73 -26
  91. package/dist/run-computer.d.ts +2 -0
  92. package/dist/run-computer.js +2 -0
  93. package/dist/run-files.d.ts +4 -0
  94. package/dist/run-files.js +4 -0
  95. package/dist/run-keys.d.ts +2 -4
  96. package/dist/run-keys.js +6 -7
  97. package/dist/run-launch.d.ts +4 -0
  98. package/dist/run-launch.js +4 -0
  99. package/dist/run-reads-over-store.d.ts +3 -2
  100. package/dist/run-reads-over-store.js +66 -2
  101. package/dist/run-secrets.js +5 -2
  102. package/dist/runner/adapter-loop.d.ts +6 -3
  103. package/dist/runner/adapter-loop.js +34 -15
  104. package/dist/runner/adapter-run-spec.d.ts +3 -0
  105. package/dist/runner/adapter-run-spec.js +5 -3
  106. package/dist/runner/audit.js +8 -4
  107. package/dist/runner/beside.d.ts +2 -1
  108. package/dist/runner/beside.js +6 -2
  109. package/dist/runner/claim-secrets.d.ts +5 -8
  110. package/dist/runner/claim-secrets.js +6 -0
  111. package/dist/runner/cli-run-spec.d.ts +1 -1
  112. package/dist/runner/cli-run-spec.js +38 -6
  113. package/dist/runner/harness-loops.d.ts +22 -9
  114. package/dist/runner/harness-loops.js +21 -11
  115. package/dist/runner/held.d.ts +3 -0
  116. package/dist/runner/learning-end.d.ts +1 -1
  117. package/dist/runner/learning-end.js +8 -3
  118. package/dist/runner/loop-contract.d.ts +5 -4
  119. package/dist/runner/main.js +4 -2
  120. package/dist/runner/mcp-claim.d.ts +3 -0
  121. package/dist/runner/mcp-claim.js +26 -2
  122. package/dist/runner/mcp-run.d.ts +3 -0
  123. package/dist/runner/mcp-run.js +2 -1
  124. package/dist/runner/metrics.d.ts +10 -10
  125. package/dist/runner/metrics.js +19 -38
  126. package/dist/runner/model-route.d.ts +3 -0
  127. package/dist/runner/model-route.js +6 -2
  128. package/dist/runner/promotion.d.ts +15 -9
  129. package/dist/runner/promotion.js +25 -15
  130. package/dist/runner/run-child-host.js +17 -7
  131. package/dist/runner/run-child.js +3 -1
  132. package/dist/runner/sdk-loop.js +2 -0
  133. package/dist/runner/workflow-loop.d.ts +2 -2
  134. package/dist/runner/workflow-loop.js +1 -2
  135. package/dist/runner/workflow-spec.d.ts +1 -1
  136. package/dist/runner/workflow-spec.js +6 -6
  137. package/dist/sdk/check.d.ts +4 -1
  138. package/dist/sdk/check.js +2 -1
  139. package/dist/sdk/runs.d.ts +2 -2
  140. package/dist/sdk/runs.js +8 -6
  141. package/dist/secret-cut.js +2 -1
  142. package/dist/secret-writes.d.ts +3 -2
  143. package/dist/secret-writes.js +1 -1
  144. package/dist/server.d.ts +44 -8
  145. package/dist/server.js +283 -108
  146. package/dist/standard-webhooks.d.ts +11 -0
  147. package/dist/standard-webhooks.js +20 -2
  148. package/dist/store/index.d.ts +1 -1
  149. package/dist/store/schema.js +5 -2
  150. package/dist/store/sqlite/store.js +90 -34
  151. package/dist/store/store.d.ts +54 -14
  152. package/dist/store-reads/journal.d.ts +7 -2
  153. package/dist/store-reads/journal.js +9 -6
  154. package/dist/store-reads/learning.d.ts +12 -9
  155. package/dist/store-reads/learning.js +18 -24
  156. package/dist/store-view.d.ts +0 -5
  157. package/dist/store-view.js +9 -8
  158. package/dist/template-eval.d.ts +49 -4
  159. package/dist/template-eval.js +168 -45
  160. package/dist/template-import.js +4 -2
  161. package/dist/templates.d.ts +5 -3
  162. package/dist/templates.js +19 -40
  163. package/dist/timeline/labels.d.ts +2 -2
  164. package/dist/timeline/labels.js +2 -2
  165. package/dist/timeline/timeline.d.ts +2 -2
  166. package/dist/timeline/timeline.js +1 -1
  167. package/dist/tool-plane.d.ts +17 -9
  168. package/dist/tool-plane.js +38 -17
  169. package/dist/tools.js +2 -2
  170. package/dist/trigger-launch-hook.d.ts +16 -8
  171. package/dist/trigger-launch-hook.js +32 -23
  172. package/dist/trigger-targets.d.ts +18 -8
  173. package/dist/trigger-targets.js +42 -19
  174. package/dist/triggers.d.ts +85 -23
  175. package/dist/triggers.js +303 -96
  176. package/dist/web-fake.js +3 -3
  177. package/dist/web-fetch-direct.d.ts +4 -0
  178. package/dist/web-fetch-direct.js +8 -1
  179. package/dist/web-fetch.d.ts +12 -3
  180. package/dist/web-fetch.js +47 -14
  181. package/dist/web-search.d.ts +33 -4
  182. package/dist/web-search.js +100 -41
  183. package/dist/webhooks.js +4 -5
  184. package/launcher/agentrun-serve +5 -1
  185. package/package.json +17 -13
  186. package/templates/README.md +2 -2
  187. package/dist/console/assets/index-B_85An2t.js +0 -745
  188. package/dist/console/assets/index-n1YsbnYh.css +0 -1
  189. package/dist/import-sources.d.ts +0 -116
  190. package/dist/import-sources.js +0 -693
package/dist/server.d.ts CHANGED
@@ -8,7 +8,8 @@ import { type LearningMode } from "./learning.js";
8
8
  import { type Place } from "./place.js";
9
9
  import { type ApiToken } from "./api-token.js";
10
10
  import { type Store } from "./store/index.js";
11
- import { type BoxOffer } from "./place-offers.js";
11
+ import { type BoxOffer, type ContainerFacts } from "./place-offers.js";
12
+ import { type Wait } from "./docker-host-addresses.js";
12
13
  import { type StoredKeys } from "./secrets.js";
13
14
  import { type ComposioControl } from "./composio-preset.js";
14
15
  import type { UsageEventName } from "./telemetry.js";
@@ -146,6 +147,10 @@ export type ServeOptions = {
146
147
  /** With `faux` only: a module whose default export is the fetch web_search's keyless Exa search sends through, in place
147
148
  * of Exa's MCP endpoint (exa-keyless.ts). */
148
149
  fauxExa?: string;
150
+ /** With `faux` only: the URL of a fake MCP server (a test's, on loopback) that web_search's and web_fetch's keyless
151
+ * Firecrawl ask in place of Firecrawl's endpoint (firecrawl-keyless.ts). A URL, not a module: it is passed as given.
152
+ * Under `faux` with none, keyless Firecrawl is never asked. */
153
+ fauxFirecrawl?: string;
149
154
  /** A module of harness table entries merged over the built-in ones (harness-table.ts HARNESS_TABLE_ENV): a test's
150
155
  * stand-ins for the harnesses. */
151
156
  harnessTable?: string;
@@ -169,6 +174,12 @@ export type ServeOptions = {
169
174
  /** Under `faux`: a file read as this server's /proc/self/mountinfo (box-paths.ts), a container's in a test; absent (and
170
175
  * no FAUX_MOUNTINFO_ENV), a faux server is on a host. */
171
176
  fauxMountinfo?: string;
177
+ /** For tests: whether Docker's start probe takes this server to be in a container (place-offers.ts containerReason),
178
+ * in place of its own marks; a faux server's is a host's. */
179
+ probeContainer?: ContainerFacts;
180
+ /** For tests: the wait before each read again of the Docker host's addresses after the start's failed
181
+ * (docker-host-addresses.ts retryHostAddresses), in place of the backoff's timer. */
182
+ hostReadWait?: Wait;
172
183
  /** Extra `Host` names to accept besides the loopback ones, on any port (host-check.ts). */
173
184
  allowHosts?: string[];
174
185
  /** The console's built files, answered at / (default dist/console beside the server, which this package's build copies
@@ -219,6 +230,9 @@ export type ServeOptions = {
219
230
  githubApi?: string;
220
231
  /** A test's seam: the origin a github_app MCP server may have (default GitHub's hosted MCP: github.ts GITHUB_MCP_ORIGIN). */
221
232
  githubMcpOrigin?: string;
233
+ /** A test's seam: the one origin a Composio key read from the environment is sent to (default Composio's:
234
+ * composio-made.ts COMPOSIO_ORIGIN). */
235
+ composioMcpOrigin?: string;
222
236
  /** A test's seam: how long a hook's body has to arrive, whole (default 30 s: push-handler.ts HOOK_BODY_MS). */
223
237
  hookBodyMs?: number;
224
238
  /** A test's seam: awaited by a message (a person's, or a trigger's firing) once its checks have passed and just before its
@@ -298,6 +312,9 @@ export type Serve = {
298
312
  * it is this process's finding, never a store's, so another runner on a shared store never inherits it. A runner in
299
313
  * its own process takes its own operator's opt-in from its own environment (runner/main.ts runnerLoopback). */
300
314
  localInstall: boolean;
315
+ /** The OLLAMA_HOST its runner beside it asks (ollama-provider.ts ollamaHostOf): this server's own, else the default
316
+ * address where this is one owner's own machine; none on a shared one that names none (runner/beside.ts ollamaHost). */
317
+ ollamaHost: string | undefined;
301
318
  /** This server's own addresses (McpServersOverStore.own): where it listens, and its public address when that is on
302
319
  * loopback. The runner beside it is told them with localInstall (runner/beside.ts mcpOwn), so its runs' loopback reads
303
320
  * never reach this server, as its own reads never do. */
@@ -375,11 +392,11 @@ export declare function readingOf(base: NodeJS.ProcessEnv, maxRuns: number, stor
375
392
  run_isolation: "uid" | "process";
376
393
  /** The harnesses a revision may name (`definition.harness`), whether this server runs each, and how many at once. */
377
394
  harnesses: {
395
+ available: boolean;
378
396
  max_concurrent_runs: number;
379
397
  id: string;
380
398
  label: string;
381
399
  promises: import("./harness-table.js").HarnessPromises;
382
- available: boolean;
383
400
  steer: boolean;
384
401
  reason?: string;
385
402
  default_model: string | null;
@@ -607,6 +624,13 @@ export declare function readingOf(base: NodeJS.ProcessEnv, maxRuns: number, stor
607
624
  routes: boolean;
608
625
  at_rest: string;
609
626
  };
627
+ /** GET /settings/harness-keys and PUT/DELETE of one key: a plan-billed recipe's keys, saved for that harness alone
628
+ * (harness-keys.ts); `harnesses` its ids here, so the console offers the page only where there is one. */
629
+ harness_keys: {
630
+ routes: boolean;
631
+ at_rest: string;
632
+ harnesses: string[];
633
+ };
610
634
  /** /settings/mcp-servers: remote MCP servers previewed and saved, each credential sealed under the server's seal key,
611
635
  * which always exists (seal-key.ts), so MCP credentials are always kept sealed. Every harness of the table runs a
612
636
  * grant (runnable.ts takes one on any), a module's among them. */
@@ -703,11 +727,11 @@ export declare function capabilities(env?: NodeJS.ProcessEnv, maxRuns?: number,
703
727
  run_isolation: "uid" | "process";
704
728
  /** The harnesses a revision may name (`definition.harness`), whether this server runs each, and how many at once. */
705
729
  harnesses: {
730
+ available: boolean;
706
731
  max_concurrent_runs: number;
707
732
  id: string;
708
733
  label: string;
709
734
  promises: import("./harness-table.js").HarnessPromises;
710
- available: boolean;
711
735
  steer: boolean;
712
736
  reason?: string;
713
737
  default_model: string | null;
@@ -935,6 +959,13 @@ export declare function capabilities(env?: NodeJS.ProcessEnv, maxRuns?: number,
935
959
  routes: boolean;
936
960
  at_rest: string;
937
961
  };
962
+ /** GET /settings/harness-keys and PUT/DELETE of one key: a plan-billed recipe's keys, saved for that harness alone
963
+ * (harness-keys.ts); `harnesses` its ids here, so the console offers the page only where there is one. */
964
+ harness_keys: {
965
+ routes: boolean;
966
+ at_rest: string;
967
+ harnesses: string[];
968
+ };
938
969
  /** /settings/mcp-servers: remote MCP servers previewed and saved, each credential sealed under the server's seal key,
939
970
  * which always exists (seal-key.ts), so MCP credentials are always kept sealed. Every harness of the table runs a
940
971
  * grant (runnable.ts takes one on any), a module's among them. */
@@ -1023,11 +1054,16 @@ export declare function forCaller<T extends {
1023
1054
  }>(caps: T, ownerSession: boolean): T;
1024
1055
  /** A start with --harness-sign-in on a server that is not one owner's own, on their own machine. */
1025
1056
  export declare const HARNESS_SIGN_IN_NOT_LOCAL = "HARNESS_SIGN_IN_NOT_LOCAL";
1057
+ /** Why `options` on `data` is not one owner's own server on their own machine, each reason in words; none when it is. One
1058
+ * owner's own: it listens on loopback alone, with no public address; its store is the SQLite one in its data directory (no
1059
+ * AGENTRUN_STORE_URL, which servers elsewhere share); its runs run beside it as its own user (`ownUser`:
1060
+ * runIsolationOf's `process`), never under --no-runner or a user of their own; and one person starts them, as Claude
1061
+ * Code's login on this machine asks (claude-login.ts whyNotOneOwner): an owner, and one API token. What --harness-sign-in
1062
+ * starts under (harnessSignInRefusal), and where the Ollama at this machine's default address is a model of the person
1063
+ * who starts runs (ollama-provider.ts ollamaHostOf). */
1064
+ export declare function whyNotOwnMachine(options: Pick<ServeOptions, "host" | "publicUrl" | "runnerApart" | "apiOnly" | "token" | "tokens">, data: string, ownUser: boolean): string[];
1026
1065
  /** Why `options` on `data` may not run a recipe on its owner's own sign-in (--harness-sign-in), in words; undefined when
1027
- * it may. One owner's own server on their own machine: it listens on loopback alone, with no public address; its store
1028
- * is the SQLite one in its data directory (no AGENTRUN_STORE_URL, which servers elsewhere share); its runs run beside
1029
- * it as its own user (`ownUser`: runIsolationOf's `process`), never under --no-runner or a user of their own; and one
1030
- * person starts them, as Claude Code's login on this machine asks (claude-login.ts whyNotOneOwner): an owner, and one
1031
- * API token. A check, a schedule and a shared server run on a key (HARNESS.md#sign-in). */
1066
+ * it may: one owner's own server on their own machine alone (whyNotOwnMachine). A check, a schedule and a shared server
1067
+ * run on a key (HARNESS.md#sign-in). */
1032
1068
  export declare function harnessSignInRefusal(options: Pick<ServeOptions, "host" | "publicUrl" | "runnerApart" | "apiOnly" | "token" | "tokens">, data: string, ownUser: boolean): string | undefined;
1033
1069
  export declare function startServe(options: ServeOptions): Promise<Serve>;