@parcha/agentrun-serve 0.1.0-beta.60 → 0.1.0-beta.61

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 (93) hide show
  1. package/CHANGELOG.md +58 -0
  2. package/README.md +42 -14
  3. package/dist/acp-package.d.ts +4 -0
  4. package/dist/api-only.d.ts +19 -1
  5. package/dist/api-only.js +38 -3
  6. package/dist/browser-person.d.ts +1 -1
  7. package/dist/browser-person.js +1 -1
  8. package/dist/calendar/tools.js +1 -1
  9. package/dist/cli.js +42 -10
  10. package/dist/console/assets/{backend-QnwGVBeU.js → backend-C9ffXUR5.js} +1 -1
  11. package/dist/console/assets/index-BnZV3lvW.js +639 -0
  12. package/dist/console/assets/{share-pz61zIn9.js → share-B1o5mJ56.js} +2 -2
  13. package/dist/console/assets/{styles-CcceGcu2.js → styles-D_znYrHR.js} +2 -2
  14. package/dist/console/index.html +2 -2
  15. package/dist/console/share.html +2 -2
  16. package/dist/errors.d.ts +1 -0
  17. package/dist/errors.js +2 -0
  18. package/dist/harness-check.js +2 -1
  19. package/dist/harness-recipe.d.ts +13 -2
  20. package/dist/harness-recipe.js +30 -7
  21. package/dist/harness-sign-in.js +2 -1
  22. package/dist/harness-table.d.ts +5 -3
  23. package/dist/harness-table.js +7 -5
  24. package/dist/key-refusal.js +6 -4
  25. package/dist/learn/secrets.d.ts +2 -1
  26. package/dist/learn/secrets.js +2 -2
  27. package/dist/learned-nodes.d.ts +36 -0
  28. package/dist/learned-nodes.js +23 -0
  29. package/dist/local-model.d.ts +144 -0
  30. package/dist/local-model.js +214 -0
  31. package/dist/mcp-probe.d.ts +7 -0
  32. package/dist/mcp-probe.js +7 -0
  33. package/dist/ollama-provider.d.ts +35 -0
  34. package/dist/ollama-provider.js +108 -2
  35. package/dist/openapi.js +59 -7
  36. package/dist/place.d.ts +7 -6
  37. package/dist/place.js +13 -10
  38. package/dist/print.js +1 -1
  39. package/dist/redact/match.d.ts +17 -4
  40. package/dist/redact/match.js +57 -15
  41. package/dist/run-export.js +4 -2
  42. package/dist/run-usage.js +3 -2
  43. package/dist/runner/adapter-loop.d.ts +8 -1
  44. package/dist/runner/adapter-loop.js +100 -20
  45. package/dist/runner/adapter-run-spec.d.ts +3 -5
  46. package/dist/runner/adapter-run-spec.js +26 -43
  47. package/dist/runner/adapters/pi.d.ts +3 -2
  48. package/dist/runner/adapters/pi.js +3 -1
  49. package/dist/runner/audit.d.ts +1 -1
  50. package/dist/runner/cli-run-spec.js +13 -10
  51. package/dist/runner/compare-end.d.ts +1 -1
  52. package/dist/runner/dispatch.js +2 -2
  53. package/dist/runner/harness-loops.d.ts +9 -0
  54. package/dist/runner/harness-loops.js +47 -4
  55. package/dist/runner/held.d.ts +4 -1
  56. package/dist/runner/live-ticker.js +3 -4
  57. package/dist/runner/mcp-claim.js +3 -2
  58. package/dist/runner/mcp-run.d.ts +19 -4
  59. package/dist/runner/mcp-run.js +29 -2
  60. package/dist/runner/metrics.d.ts +4 -0
  61. package/dist/runner/metrics.js +9 -3
  62. package/dist/runner/monid-run.js +3 -1
  63. package/dist/runner/native-loop.js +1 -1
  64. package/dist/runner/redact.d.ts +3 -0
  65. package/dist/runner/redact.js +7 -0
  66. package/dist/runner/run-child-host.js +1 -1
  67. package/dist/runner/sdk-loop.js +5 -3
  68. package/dist/runner/workflow-calls.d.ts +4 -1
  69. package/dist/runner/workflow-calls.js +35 -18
  70. package/dist/runner/workflow-loop.d.ts +1 -1
  71. package/dist/runner/workflow-loop.js +3 -1
  72. package/dist/runner/workflow-spec.d.ts +4 -0
  73. package/dist/runner/workflow-spec.js +18 -13
  74. package/dist/runs-over-store.d.ts +2 -2
  75. package/dist/runs-over-store.js +1 -1
  76. package/dist/secret-cut.js +7 -4
  77. package/dist/secret-rules.js +97 -83
  78. package/dist/server.d.ts +7 -0
  79. package/dist/server.js +97 -34
  80. package/dist/slack.js +2 -1
  81. package/dist/store/postgres/migrate.js +3 -1
  82. package/dist/store-reads/learning.d.ts +5 -4
  83. package/dist/store-reads/learning.js +7 -4
  84. package/dist/tool-plane.d.ts +23 -1
  85. package/dist/tool-plane.js +70 -2
  86. package/dist/tools.d.ts +12 -2
  87. package/dist/tools.js +42 -7
  88. package/dist/trigger-launch-hook.d.ts +2 -2
  89. package/dist/trigger-launch-hook.js +1 -1
  90. package/dist/triggers.d.ts +7 -4
  91. package/dist/triggers.js +4 -4
  92. package/package.json +12 -12
  93. package/dist/console/assets/index-DZi-muIj.js +0 -629
package/CHANGELOG.md CHANGED
@@ -2,6 +2,64 @@
2
2
 
3
3
  ## [Unreleased]
4
4
 
5
+ ## 0.1.0-beta.61 (2026-11-26)
6
+
7
+ **Breaking:**
8
+
9
+ - Who breaks: an agent whose own `tool_settings` pick `firecrawl-keyless`, `exa-keyless`, `auto` or `parallel` for `web_search` or `web_fetch` on a server set to `kernel` for `web_fetch`, or to `native` or `off` for `web_search`, and an agent that picks `native` for `web_search` on a server set to `off`. The server's setting is now a ceiling the agent's pick cannot raise: the pick resolves as the server's setting does, so its URLs and queries go to no keyless service and not to Parallel. A server's `deny` stays absolute. <!-- changes/web-tools-server-ceiling.md -->
10
+ - To let agents use Parallel, set it server-wide (`PUT /v2/settings/tools` with `parallel`); a server pick of `auto`, `firecrawl-keyless`, `exa-keyless` or `parallel` is still only a default an agent's pick replaces.
11
+ - Where the harness has no native search, such an agent's `web_search` under `native` is unavailable, and its new runs are refused (409). A run that already exists is not refused: its follow-up, resume or reclaim goes on with `web_search` unavailable, each call answering that it does not run here.
12
+ - The way back for `web_search`: set the server's `web_search` to `auto`, `firecrawl-keyless`, `exa-keyless` or `parallel`. For `web_fetch`: set the server's `web_fetch` to `auto`, `firecrawl-keyless` or `parallel`.
13
+ - A server setting applies at a run's next claim (its start, a follow-up, a resume or a reclaim). A claim keeps the plane it began with to its end, through any approval it waits on while it holds the run.
14
+ - Tool settings a claim cannot read fail closed: a capability kept on a keyless service or on Parallel runs nothing, its tool saying the server's tool settings could not be read. One a claim finds past a ceiling with nothing the setting allows in its place runs nothing either, never the value it was kept with.
15
+ - Capabilities' `why` says when the server's setting is a ceiling over an agent's pick ("the server's setting, kernel, is a ceiling over this agent's pick of auto").
16
+
17
+ **Changes:**
18
+
19
+ - Google Antigravity's recipe ships with the ACP adapter, and every command takes its name where it takes a recipe file: `agentrun harness install antigravity`, `agentrun harness-check --recipe antigravity`, `agentrun harness sign-in --recipe antigravity` and `agentrun-serve --harness-recipe antigravity` (or `AGENTRUN_SERVE_HARNESS_RECIPES=antigravity`). It is still a recipe, with the same pins, check, keys page and sign-in. Each command says which recipe it resolved. A file of that name in the directory is never passed over: the command is refused, saying both, and `./antigravity` names the file. The hints a recipe prints (install, check, sign-in) name a shipped recipe by its name, not by where the package is installed. The recipe file moved from `examples/harness-recipe/antigravity.json` to the package's `recipes/bundled/antigravity.json`. An AgentRun release that changes it asks for a new check and the keys to be saved again, as an edit of your own recipe file would. <!-- changes/antigravity-bundled.md -->
20
+
21
+ agy joins server and tool with a single `_`, so another MCP server's tool could spell one of AgentRun's (a server `agentrun_look` with a tool `up` reads as `mcp_agentrun_look_up`), be taken as AgentRun's by the recipe's `announces.prefix`, and have its permission request allowed once on the title tie without the host's gate. Under a recipe whose `announces.prefix` joins `agentrun` to the tool's name with one `_` or `-`, as the Antigravity recipe's `mcp_agentrun_` does, the agent is now given AgentRun's MCP server under a name of each start's own, `agentrun` and 8 random hex digits, and the prefix and the title tie read that name alone: any other server's call goes to the host's gate. Goose's and Cursor's recipes keep `agentrun`. agy caps a tool's name at 64 characters, so under that name a tool of AgentRun's may be named at most 43: a longer one refuses the start, naming it. An agent that announces a call with a field the tool's schema declares but the model left out has that announcement matched to its MCP call with the field or without it, so two such calls in flight keep their own ids. An `announces.extras` field that a tool's own input schema declares (a `toolSummary` argument of the tool's, at its top, in `allOf`, `anyOf` or `oneOf`, or behind a local `$ref`) is kept as that call's argument, never left out as agy's. Two calls in flight whose arguments differ only in that field, one sending it and one leaving it out, keep their own ids whichever reaches MCP first: a call matching more than one announcement only without the field waits while another call may still need one of them.
22
+ - The console has a Free page (`#/free`) that shows what runs for $0 on the server. It lists the free models, with the ones on this machine's Ollama first and each with its context size. A free catalog model also shows the server's request limit a run. It shows what `web_search` and `web_fetch` go through now, in the server's own `why` words. It lists the templates that run on a free model and ask for nothing else that costs money (no key, no MCP toolkit, no browser tool, and no computer but this server's own Docker sandbox), whatever tags their package gives them, each with "Use free", which opens the template's Apply screen with the agent on the free default model of the harness Apply makes it on (apply's `overrides.model`). Where that harness has no free model, "Use free" is off and the card says so. With no local model, the page says so and shows the Free local model card, which pulls the model that fits this machine through its own Ollama. Once a pull there ends, "Use free" opens Apply on that pulled model, though the server's default is another free model. <!-- changes/free-shelf.md -->
23
+ A completed run that cost $0 on free models shows a receipt on its page. The receipt gives the model, why the run was free (a local model on Ollama, a free model with its request limit a run, or both), the requests and tokens, each tool's calls and what they went through, the run's time and its $0 cost. For a run whose trace was cut at its cap, each tool's count reads "at least" and the receipt says how many rows it did not read. A failed or cancelled run, a run whose cost is unknown, and one that cost money show none. Nor does a run whose usage has anything unpriced or unbooked beside its free model requests: a usage total that is not exactly $0 (browser time with no booked charge), a line with no figure (computer time no price was set for), MCP calls no price meters, or computer time no claim held. GET /v2/runs/{id}/usage reads a `compute_time` line's `unheld_quantity` as 0 on a provider that bills nothing (Docker), so a free run on Docker keeps its receipt.
24
+ - A server with no model can pull a free local model in one click. The console's first screen shows a "Free local model" card beside the model key card: this machine in one line (system, memory, GPU, Ollama version), the model recommended for it and why, and a Pull button with a progress bar. Once the pull ends the model is in the picker with no restart, and the first screen's templates run on it: a template's agent made earlier on another model is left as it is, and a new one is made on the pulled model. A progress read that fails is followed by another, so the card still reaches ready. <!-- changes/ollama-fit.md -->
25
+ - `GET /settings/local-model` reads the machine (platform, arch, total memory, Apple silicon or the first NVIDIA GPU `nvidia-smi` names), whether the Ollama here answers `/api/version` and its version, the recommendation, and the pull here with its progress. `POST /settings/local-model/pull` with `{ "tag": "<tag>" }` starts a pull through that Ollama's `/api/pull`. Both take the owner's session alone, never the API token.
26
+ - The recommendation: `inkling-2-mini` on Apple silicon with Ollama 0.40.17 or later; everyone else gets `qwen3:8b`, or `qwen3:4b` where memory is short, or none with what to do instead. Each tag's memory floor is named in the why. Apple silicon on an older Ollama is told to update it for `inkling-2-mini`. With no Ollama running, the card says where to install it. A tag already pulled needs no pull.
27
+ - A pull takes only a tag the recommendation can name (422 for any other), runs only on one owner's own server on their own machine, never under the faux model or a model gateway, and never into an Ollama that `OLLAMA_HOST` puts on another machine (403 in words), and runs one at a time (409 `local_model_pulling`). The server logs its start, end and failure with the tag, the bytes and the milliseconds alone.
28
+ - With `OLLAMA_HOST` on another machine, the server recommends nothing: it reads only its own memory and GPU, so it says to pull where that Ollama runs.
29
+ - The card stays up from a pull's start until its Done, on the first screen and on `#/free`, so a capabilities read that lists the model first never takes it down before the pulled tag is picked.
30
+ - A pull says done only once this server's Ollama lists the pulled tag, so a template the card runs next runs on it: a listing that missed it is read again, and a tag never listed ends the pull failed, saying to pull again.
31
+ - With no Ollama running, the card offers Check again, and reads the machine again when the page is back in view, so Ollama installed or started meanwhile shows the Pull button with no reload.
32
+ - Under the faux model or a model gateway this server asks no Ollama: the read surface says so (`ollama.asked` false), and the card shows only why no pull is made here.
33
+ - A pull that gets no byte from Ollama for two minutes (a registry that stalls, an Ollama that wedges) ends failed, saying to press Pull again, and frees the one pull here, so the next starts instead of answering 409. A progress line over 64 KiB ends it too. The pull's `tag` in the API description is the enum of tags a recommendation names.
34
+ - API-only server (`AGENTRUN_API_ONLY=1`): a trigger that turned itself off after 5 failed firings in a row (`disabled.reason` `auto_paused`) can be turned on again. Before, every trigger route was `404` there and there is no console, so nothing could turn it back on: a redeploy left it as it was, and an unarchive turned on only the triggers the archive had turned off. The token now reads the triggers (`GET /triggers`, `GET /triggers/{id}`, `GET /triggers/{id}/firings`) and turns one on or off with `PATCH /triggers/{id}`. On this profile the PATCH takes `enabled` alone (any other field is `422 not_allowed`), and turns on only what the apply makes here: a schedule or a feed trigger, with the launch hook set. Anything else is `422` under `enabled`, since its firings would start runs on the server's keys or wait on a hook this profile refuses. That includes a schedule or feed trigger that messages a run (a `message_run` target, made before the profile): its firings never go to the launch hook, so on, each would open that run on the server's keys. The agent's unarchive leaves such a trigger off too, and names it. Making, deleting or firing a trigger, and its secret, are still `404`. <!-- changes/api-only-trigger-resume.md -->
35
+
36
+ The CLI's `agentrun triggers update <id> --enabled` (or `--no-enabled`) sends the same PATCH and works against an API-only server too. The Slack message for an auto-paused trigger now names each way to turn it on: the console, `agentrun triggers update <id> --enabled`, or `PATCH /v2/triggers/{id}` with `{"enabled": true}`. An API-only redeploy that skips a trigger the agent still has on now says that PATCH with `{"enabled": false}` turns it off. Before, it said to archive the agent.
37
+ - A refresh of Claude Code's login that finds its offers dropped by another probe makes the offers again without relisting runs or reading the keys again, since no key changed. A new Ollama listing does the same, and still works out again what a revision that names no model runs on, which reads that listing. <!-- changes/claude-login-offers-now.md -->
38
+ - In the console, an agent card's Run and Edit now go where that agent runs. For an agent this server runs, Run opens the agent's page, where its Run box is, and Edit opens its settings; before, both opened the coding-agent menu. Native, SDK and CLI agents keep the coding-agent menu. The runs list of an agent with no runs now points to the page's Run box when that agent runs here, instead of a Run agent button the page does not show. <!-- changes/console-card-run-here.md -->
39
+ - In Mode 2 (workspaces on Archil) a new agent that names no place now runs on the runner, with bash on Archil's serverless exec, even where Docker answers. Before, it got Docker's box, which can't mount Archil's workspaces, so every run was refused: a race could not start, and neither could an agent made with the form's default tools. `capabilities.places.default_place` is `{"mode": "runner"}` in Mode 2, and the start's Boxes line says so. A race lane whose run the server refuses now has its agent archived at once, so a refused race leaves no agents behind. <!-- changes/mode2-new-agents-on-runner.md -->
40
+ - MCP: when a run was handed no credential for a per_run server (no `mcp_auth` for it), or no account for a per-run Composio server, the model is no longer offered that server's tools. Before, the model saw the tools and every call came back refused. The run's timeline now says which server was left out and why, in the same words the refusal used. A message that hands the credential brings the tools back the next time the run picks up work, and a run handed the credential at the start gets them as before. A message that hands it while a turn is still going isn't put into that turn, whose tools can't change: it runs as the run's next turn, which has the tools, and the timeline says so. Every message sent after it waits behind it, so none runs first. If the run is waiting on a person's answer with a browser open, it stops waiting at once and parks on its question, so the answer is never held until the browser's time runs out; when it resumes, the messages run in the order they came. This applies to pi, Claude Code, OpenCode and the ACP agents, which take their tools again each time a run picks up work. Codex is the exception: it keeps the tools its thread started with, and a resume can't add new ones. A Codex run therefore keeps listing the server's tools, and their calls are refused, with nothing sent, until the credential comes. <!-- changes/per-run-mcp-left-out.md -->
41
+ - A saved secret now stays hidden when control characters that show as nothing (a NUL, an escape, a delete, a C1 control), or a U+FFFF that shows as a box at most, sit between its characters, whether raw, written as a JSON or Python escape, percent-encoded or as an HTML character reference, in a tool's output, a call's arguments, an answer or an imported transcript. Text with such characters and no secret in it is shown as before. <!-- changes/redact-control-characters.md -->
42
+ - With `AGENTRUN_RUN_KEYS=1`, an update apply that skips a template's trigger and keeps the agent's trigger of that name on now says, in the skip's warning, which of its firings are refused: one that would start a run of the new revision is refused 409 for the keys it owes and starts no run, but a `message_run` firing aimed at a run of an earlier revision that owes no keys still reaches that run, which may spend. Turning the trigger off stops both. In 0.1.0-beta.55 the warning said only that the trigger is kept and still fires. <!-- changes/run-keys-kept-trigger-spend.md -->
43
+ - `serve()`'s launch hook keeps its 10-second bound on every POST: the hook's `bound` signal, a test's seam, can cut a POST sooner, never later. In 0.1.0-beta.55 a `bound` given replaced the 10 seconds.
44
+ - A note on 0.1.0-beta.55's refusal of a `message_run` firing to a run that owes a key: a firing is checked as one that brings no keys, whatever the run holds then. So a `message_run` firing to a run mid-turn, still holding the keys its start or a person's message carried, is refused, while a person's message to that run passes on those keys. For a run whose template's keys the server does not hold, that is the safe side: a trigger's message never spends the keys a person handed that run. A run that owes no keys (an agent from no template, or one whose keys the server holds) is not checked, so a `message_run` firing to it mid-turn still runs on the keys its start or a person's message carried.
45
+ - The scrubber reads a call's command for an environment dump by its tokens, not by the shape of the command. It drops the line's quotes and escapes, lower-cases it, and splits it on anything but a letter, a digit, `_` or `-`. The call's whole output is one `env-dump` cut when any of these holds: <!-- changes/scrubber-env-words.md -->
46
+ - a token runs, names or reads the environment, wherever it stands: `env`, `printenv`, `envsubst`, `environ`, `getenv`, `$_ENV`, `$_SERVER`, `compgen`, `show-environment`, `inspect` or `xtrace`. This covers `sudo -n env`, `env FOO=1 printenv A`, `ssh host env`, `kubectl exec p -- env`, `cat</proc/self/environ`, `node -p 'process["env"]'`, `jq -rn 'env.A'` and shells nested to any depth;
47
+ - a print (`echo`, `printf`, an awk program's `print`) or a here-string stands in a line that expands a variable anywhere (`$A`, any `${…}`, cmd's `%A%`);
48
+ - `set` has nothing after it, or `set` or a shell has an xtrace flag (`set -x`, `bash -x`);
49
+ - `export`, `declare`, `typeset` or `readonly` has flags only or `-p`;
50
+ - `ps` has an `e` option;
51
+ - the line is longer than is read.
52
+
53
+ An env token in an argument or a file's name is read the same way (`grep env notes.txt`, `ls src/env.ts`, a commit message naming `env`). That over-cut is kept on purpose: it fails closed. A dotfile `.env` named in the command (`cat .env.example`, `source .env`) is a file, which `env-file` reads, not an env read; `process.env` and `Bun.env` are still read.
54
+
55
+ In a transcript with no command given, a `$`, `%` or `❯` prompt line whose command prints the environment cuts everything after it up to the next such prompt or a cut marker. A multi-line value, or a `#` or `>` line inside the output, no longer ends the cut.
56
+
57
+ A run's export cuts a file's content knowing the path the run wrote, and writes only the cut path into the bundle. A `.env.<held value>` file is still cut as an env file.
58
+ - A learned workflow call in a run's `workflow_calls` reads `refused` (`usd` 0) only while nothing was booked under its call id. A call whose earlier attempt spent before a crash cut it, and whose rerun was then refused (at the gate, or because a tool one of its call nodes runs was set to deny), now reads `failed` at what it booked, or `usd` null when a request of it has no known cost. Before, it read `refused` at $0, and a run whose calls all read so took the agent's path. <!-- changes/workflow-calls-booked.md -->
59
+ - An agent's `learned_workflow` call that the run's gate refuses (the tool set to deny, a person's deny of its ask, or the cap's wrap-up) is now on the run's `workflow_calls`, as the agent's, with outcome `refused` and `usd` 0, on pi and on every CLI harness. Before, it never reached the tool, kept no record and dropped out of `workflow_calls` and the learning ledger. A run whose learned calls were all refused ran no workflow: its `path` is now `agent` and it names no `workflow`, where it read `handed_back` with none. A Postgres open refused because an applied migration's text differs from this build's now names both files, the applied one and this build's, each with the start of its sha256, so a renamed or renumbered migration is plain to see. <!-- changes/workflow-calls-refused.md -->
60
+ - Workflow runs: a model node's tool answer (`web_search`, `web_fetch`) now passes the run's redactor before the node's model or the run's journal sees it, as an agentic run's tool answers do. Before, a search result or a page that echoed a key the run holds reached the node's model and was stored uncut. A web call's JSON is cut string by string, so it still parses and keeps its links. <!-- changes/workflow-node-tool-cut.md -->
61
+ - Each card on the Wrapped page has a "Download PNG" button that saves it as a PNG named for its year and card (`wrapped-2026-cover.png`); a browser that can't draw one gets a note beside the button instead. Setup's list of this machine's sessions names the tools it found, each by its own name, OpenCode included, where it used to say "from Claude Code, Codex and pi" whatever it found; while it counts, it says it is looking for coding-agent sessions. <!-- changes/wrapped-card-png-and-setup-sources.md -->
62
+
5
63
  ## 0.1.0-beta.60 (2026-11-26)
6
64
 
7
65
  **Breaking:**
package/README.md CHANGED
@@ -1633,7 +1633,9 @@ unless the [launch hook](#launch-hook) is set, which hands each firing to your b
1633
1633
  would start runs of the agent with no hook, or message one of its runs, hook or not. A `message_run` trigger made
1634
1634
  before the setting was on, or while the server held the key, fails each firing with that 409 and sends nothing. An
1635
1635
  update apply that skips a trigger leaves the agent's trigger of that name as it was; when that one is on, it still
1636
- fires, and the skip's warning names it and says how to turn it off.
1636
+ fires until you turn it off. A firing that would start a run of the new revision is refused 409 for the keys it owes and
1637
+ starts no run, but a `message_run` firing aimed at a run of an earlier revision that owes no keys still reaches that run,
1638
+ which may spend. The skip's warning names the trigger and says how to turn it off.
1637
1639
 
1638
1640
  `MONID_API_KEY` stays the server's even with the setting on: an agent's monid tools are checked with it when the agent
1639
1641
  is saved, before any run, so a template that grants them is still refused at its apply (409 at
@@ -2147,7 +2149,8 @@ Each child books on the run's cap, so size the cap for K passes, not one.
2147
2149
 
2148
2150
  `web_search` and `web_fetch` work on every harness with only a model key. Each resolves, for a run, in one order: (1) the
2149
2151
  provider the user picked, optional: the agent's own (`definition.tool_settings`) over the server's
2150
- (`PUT /settings/tools`); (2) for
2152
+ (`PUT /settings/tools`), except that the server's `kernel` for `web_fetch`, and its `native` or `off` for `web_search`,
2153
+ are a ceiling no agent's pick raises ([below](#search-and-fetch)); (2) for
2151
2154
  `web_search`, Parallel, where the server holds a Parallel key (`PARALLEL_API_KEY` in its environment, or one saved on Tool
2152
2155
  keys): `auto` then uses that key and bills it, each search booked as the run's cost ($0.001 a search); (3) the keyless
2153
2156
  fallback, Firecrawl's public MCP endpoint (for `web_search` with Exa's behind it). A revision's `tools` (and a pack's grant) names the capability, never a provider.
@@ -2197,7 +2200,9 @@ objective sends the page's text and the objective to TypeSafe …`, and for eith
2197
2200
 
2198
2201
  `GET /settings/tools` answers the server's settings, `{web_search: {provider}, web_fetch: {provider}, browser: {provider}}`, the default
2199
2202
  where none is set; `PUT /settings/tools` takes the same map and replaces it (a capability it leaves out takes its
2200
- default). An agent's `definition.tool_settings` has the same shape and is over the server's. A provider is one offered
2203
+ default). An agent's `definition.tool_settings` has the same shape and is over the server's, except under the server's
2204
+ `kernel` for `web_fetch`, or its `native` or `off` for `web_search`, a ceiling no agent's pick raises, and a `deny`,
2205
+ which no agent's setting reaches past. A provider is one offered
2201
2206
  for its capability (`auto`, `native`, `firecrawl-keyless`, `exa-keyless`, `parallel` or `off` for `web_search`; `auto`,
2202
2207
  `firecrawl-keyless`, `kernel` or `parallel` for `web_fetch`;
2203
2208
  `auto`, `browserbase`, `kernel` or `chrome` for `browser`, [below](#tools)); an
@@ -2272,9 +2277,18 @@ sees the URL, its query string included, so a token in a URL's query goes to Fir
2272
2277
  guard's own check, and one it refuses (a private, loopback, link-local or intranet address, a name that resolves to one,
2273
2278
  or a URL holding a user name or password) is refused as the guarded direct fetch refuses it, and never sent to Firecrawl,
2274
2279
  to Exa or to Parallel. To keep every URL on the server, pick `kernel` for `web_fetch`, or hold a Parallel key, where
2275
- `auto` is the guarded direct fetch. A server's pick is the default only: an agent's own `tool_settings` outrank it, so an
2276
- agent (an imported template's among them) that picks `firecrawl-keyless` or `auto` still sends its URLs to Firecrawl.
2277
- Only a server's `deny` is absolute: set `web_fetch` to `deny` to stop every agent's fetches.
2280
+ `auto` is the guarded direct fetch. A server's pick is the default only, an agent's own `tool_settings` (an imported
2281
+ template's among them) over it, except for these. The server's `kernel` for `web_fetch`, and its `native` or `off` for
2282
+ `web_search`, are a ceiling: an agent's pick of `firecrawl-keyless`, `exa-keyless`, `auto` or `parallel` resolves as the
2283
+ server's setting does, so nothing goes to Firecrawl, to Exa or to Parallel, and capabilities' `why` says so ("the
2284
+ server's setting, kernel, is a ceiling over this agent's pick of auto"). Under `off`, an agent's `native` is off too;
2285
+ under `native`, it is the ceiling's own. To let agents use Parallel, set `parallel` server-wide; any server pick but
2286
+ these three (`auto`, `firecrawl-keyless`, `exa-keyless`, `parallel`) is only a default an agent's pick replaces. A
2287
+ server's `deny` is absolute: set `web_fetch` or `web_search` to `deny` to refuse every agent's calls, whatever it picks.
2288
+ A server setting applies at a run's next claim (its start, a follow-up, a resume or a reclaim): a claim keeps the plane
2289
+ it began with to its end, through any approval it waits on while it holds the run. Tool settings a claim cannot read
2290
+ fail closed: a capability kept on a keyless service or on Parallel runs nothing, its tool saying the settings could not
2291
+ be read.
2278
2292
 
2279
2293
  A `web_fetch` through keyless Firecrawl takes at most about 95 s: up to 30 s for the guard's check of the URL, 30 s for
2280
2294
  Firecrawl, then, where Firecrawl gives no page, the guarded fetch's 30 s and 5 s to read the page.
@@ -2745,8 +2759,9 @@ curl -X POST "$BASE/v2/agents/$AGENT/runs" -H "authorization: Bearer $TOKEN" -H
2745
2759
  user and account, the Composio key staying the server's own. The binding is kept as a `per_run` server's headers are:
2746
2760
  sealed into the run's launch, erased from the store by the write that ends the run, never on the server's row, the
2747
2761
  run's view, its timeline, its trace or a log line, and its values are cut from whatever the run shows. A message's
2748
- binding replaces the run's for the turn it starts. A run that names no account has its calls of the server answered, unsent, that it was
2749
- handed none, so a per-run server never calls as a default account. A malformed user or account is `422 input_invalid` at
2762
+ binding replaces the run's for the turn it starts. A run that names no account is not offered the server's tools (on
2763
+ Codex, its calls of them are answered, unsent, that it was handed none), so a per-run server never calls as a default
2764
+ account. A malformed user or account is `422 input_invalid` at
2750
2765
  `mcp_auth.<server>.composio_user_id` or `.connected_account_id`, and so is a binding to the preset's default user
2751
2766
  `agentrun` (`not_allowed`: the user single-user preset servers call as); headers for such a server, or a binding for any
2752
2767
  other server, are `422` at `mcp_auth.<server>`, and no run starts. A per-run server makes no Composio trigger: a trigger
@@ -2849,7 +2864,11 @@ credential answers the first request's run), and its values are cut from whateve
2849
2864
  `POST /v2/runs/{run_id}/messages` takes `mcp_auth` too: it replaces the run's credentials in the message's own write, so the turn the message starts (a
2850
2865
  steer into a working run from its next model request, or a follow-up that opens an ended run again) calls with them. A
2851
2866
  name that is not a saved per_run server is `422` at `mcp_auth.<server>`, and no run starts. A run handed no credential
2852
- for a per_run server it calls has those calls answered, unsent, that it was handed none. `POST .../{name}/refresh` lists
2867
+ for a per_run server it calls is not offered that server's tools, and its timeline says which server was left out and
2868
+ why; the next time the run picks up work after a message hands the credential, it has them. A message that hands it
2869
+ while a turn is still going is not put into that turn, whose tools can't change: it runs as the run's next turn, and
2870
+ the timeline says so. Codex keeps the tools its thread started with, so a Codex run keeps listing them, and their
2871
+ calls are answered, unsent, that it was handed none until the credential comes. `POST .../{name}/refresh` lists
2853
2872
  a per_run server's tools with no credential: save it again with `headers` for a server that lists only to a caller it
2854
2873
  knows. The tools are those it listed at its save, so a server whose tool list varies by caller shows each run the saved
2855
2874
  list.
@@ -3859,11 +3878,20 @@ serves these routes alone:
3859
3878
  is what its delete (`DELETE /agents/{id}`) needs first. With the [launch hook](#launch-hook) set, the apply makes the
3860
3879
  package's schedule and feed triggers, and every firing that starts a run goes to the backend, which starts it through
3861
3880
  the API with the keys and budget it sends, a trigger the agent had before the profile included; the unarchive turns
3862
- them on again, as no trigger route is served to. Without the hook it makes neither (`not_set_up_here`: set the hook,
3863
- or start those runs through the API), and a trigger the agent already had stays as it was: an enabled one still fires
3864
- here, on this server's keys, until the agent is archived, and the skip's warning says so. A webhook, GitHub, Composio or email trigger is never made here, hook
3881
+ them on again. Without the hook it makes neither (`not_set_up_here`: set the hook, or start those runs through the
3882
+ API), and a trigger the agent already had stays as it was: an enabled one still fires here, on this server's keys,
3883
+ until it is turned off (below) or the agent is archived, and the skip's warning says so. A webhook, GitHub, Composio or email trigger is never made here, hook
3865
3884
  or not, since this profile refuses the hook or setting each needs (`not_an_option`). Each skipped trigger is a warning
3866
3885
  under `warnings` (`triggers.<i>`), and the dry run (`dry_run: true`) plans it as `skip` in the same words;
3886
+ - the triggers, for a backend to see one that is off and turn it on again: their list (`GET /triggers`), one
3887
+ (`GET /triggers/{id}`), its firings (`GET /triggers/{id}/firings`), and its turn on or off
3888
+ (`PATCH /triggers/{id}` with `{"enabled": true}` or `{"enabled": false}`; from the CLI,
3889
+ `agentrun triggers update <id> --enabled` or `--no-enabled`). A trigger whose firings failed 5 times in
3890
+ a row turns itself off (`disabled.reason` `auto_paused`), and there is no console here to turn it on in. The PATCH
3891
+ takes `enabled` alone (any other field is `422 not_allowed`), and turns on only what the apply would make: a schedule
3892
+ or a feed, with the launch hook set (`422` under `enabled` otherwise, since its firings would start runs on this
3893
+ server's keys or wait on a hook this profile refuses). Turning one off always works. Making, deleting or firing a
3894
+ trigger, and its secret, stay refused;
3867
3895
  - a Composio server's save (a new name, or a server the token saved) and the delete of a server the token saved, for a
3868
3896
  backend that grants its runs Composio tools. The token here never writes a secret, so the save keeps none:
3869
3897
  - a Composio server (`PUT /settings/mcp-servers/{name}/composio`) names its key with
@@ -3952,7 +3980,7 @@ Here a run's computer routes take the server's token. `POST /runs/{id}/computer/
3952
3980
  `AGENTRUN_PUBLIC_URL` that opens that run's live page and socket until the run ends (API doc).
3953
3981
 
3954
3982
  Every other address is `404 not_found`, answered before the request is read further: the console at `/` and its
3955
- assets, sign-in and setup, every other `/settings` route, `POST /mcp`, triggers and their
3983
+ assets, sign-in and setup, every other `/settings` route, `POST /mcp`, every other trigger route and the triggers'
3956
3984
  `POST /hooks/{id}`, the agents list, an agent made or edited through `/agents`, the templates list and every other
3957
3985
  template route, `/openapi.json`, `/llms.txt` and a browser's live view. It has no accounts: there is no page to sign in
3958
3986
  to, so no setup code is printed. The token works as it does on every route served. Unset, `0` or `false` serve the
@@ -5091,7 +5119,7 @@ were reached. Nothing is priced here, and nothing is rounded to a billing increm
5091
5119
  over a 730-hour month); a computer still open is counted up to `measured_to` (`open_computers` says how many). `usd` is
5092
5120
  what the run's ledger booked for it while a claim held the computer, at the operator's price ([Computer
5093
5121
  time](#computer-time)), so `total` stays the run's `cost.usd`. The part no claim held (`unheld_quantity`: a computer
5094
- kept past its claim for a follow-up, one deleted after its run, one whose delete failed) is in no cost. A resource with
5122
+ kept past its claim for a follow-up, one deleted after its run, one whose delete failed) is in no cost; on a provider that bills nothing (`docker`) it reads 0, since none of its time costs anything. A resource with
5095
5123
  no price set, or whose figure no one said, is `unpriced`, its `usd` null; a provider that bills nothing (`docker`) is
5096
5124
  $0. A `compute_time` line that is `unpriced` and any `unheld_quantity` are outside `total`.
5097
5125
  ```json
@@ -49,6 +49,10 @@ export type AcpPackage = {
49
49
  }): AcpRecipe;
50
50
  /** The folder Cursor was installed into, from its launcher's path and the pin's `cmd`; undefined when it is not there. */
51
51
  cursorRootOf(binary: string, cmd: string): string | undefined;
52
+ /** The recipes the package ships whole, by name (Google Antigravity's), and the file of each: absent from a package
53
+ * older than them. */
54
+ readonly BUNDLED_RECIPES?: readonly string[];
55
+ bundledRecipePath?(name: string): string | undefined;
52
56
  /** The form a model id an ACP agent lists takes (Cursor's `gpt-5.4-nano[reasoning=medium]` among them). */
53
57
  readonly MODEL_ID: RegExp;
54
58
  /** The forms a recipe's allowFile may take (`goose-permission`). */
@@ -1,3 +1,4 @@
1
+ import type { InputIssue } from "./errors.js";
1
2
  import { NOT_SET_UP } from "./runnable.js";
2
3
  import type { Route } from "./server.js";
3
4
  /** The routes (server.ts ROUTES, by name) an API-only server serves. Past a run's own, why each group is here:
@@ -20,7 +21,12 @@ import type { Route } from "./server.js";
20
21
  * agents and revisions that stay, archives and deletes any agent made here and purges any run of one, as the whole
21
22
  * server's token does, and with the launch hook its apply makes schedule and feed triggers. A trigger the apply can't
22
23
  * make here is skipped, and said (apiOnlyTriggerSkipped). One the agent had before the profile stays as it was:
23
- * without the hook, an enabled one still fires here on this server's keys until the agent is archived;
24
+ * without the hook, an enabled one still fires here on this server's keys until it is turned off (below) or the agent
25
+ * is archived;
26
+ * - a backend reads the triggers (their list, one, its firings) and turns one on or off (updateTrigger, `enabled` alone:
27
+ * apiOnlyTriggerEdit), since a trigger whose firings failed FAILURES_TO_PAUSE times in a row turns itself off and
28
+ * there is no console here to turn it on in. It turns one on under the apply's rule: a schedule or a feed, with the
29
+ * launch hook. Making, deleting, firing a trigger and its secret stay refused;
24
30
  * - an API-only server has no owner, so the token is the backend's own, as with take-over: it saves the Composio servers
25
31
  * its agents need through the preset (saveComposioServer), saves over or deletes only a server it saved
26
32
  * (mcp-secret-writes.ts tokenWriteOverRefused), and never writes a secret (secret-writes.ts). A Composio server names
@@ -49,6 +55,18 @@ export declare function apiOnlyTriggerSkipped(packageName: string, trigger: {
49
55
  reason: typeof NOT_SET_UP | "not_an_option";
50
56
  message: string;
51
57
  } | undefined;
58
+ /** Whether an API-only server turns on a trigger whose source is `kind` and whose target is `target` (its PATCH, its
59
+ * agent's unarchive): only one the apply would make, a source of API_ONLY_HOOKED_KINDS aimed at an agent (start_run),
60
+ * with the launch hook `hooked`, so each firing goes to the backend. A message_run firing never goes to the hook
61
+ * (triggers.ts): on, it would open its run on this server's keys. */
62
+ export declare function apiOnlyTurnsOn(kind: string, target: string, hooked: boolean): boolean;
63
+ /** Why an API-only server refuses `body`, a PATCH of a trigger whose source is `kind` and whose target is `target`, each
64
+ * an issue (none: it goes on to the trigger's own checks). It takes `enabled` alone: a new source or target would let
65
+ * the token aim a trigger at an address or an agent of its own choosing (a feed's urls fetched by this server, a run of
66
+ * another agent), which no route here lets it make, and a name or a cap is the console's to edit. Turned off: always,
67
+ * it stops firings. Turned on: only where the apply would make it (apiOnlyTurnsOn), so its firings go to the backend;
68
+ * any other would start or open runs on this server's keys, or wait on a hook or setting this profile refuses. */
69
+ export declare function apiOnlyTriggerEdit(body: unknown, kind: string, hooked: boolean, target: string): InputIssue[];
52
70
  /** Whether an API-only server saves `body` through the generic save (saveMcpServer) over the name its path gives: a
53
71
  * per_run server (no credential kept) whose url's origin is one of `origins`, under a name that is not a Composio
54
72
  * preset's (`preset`; Composio's own route saves those). Checked before anything reaches the address. A body that
package/dist/api-only.js CHANGED
@@ -2,8 +2,8 @@
2
2
  // deploy's routes alone, and refuses every other address before anything else reads the request: the console at "/" and
3
3
  // its assets, sign-in and setup, settings but the MCP servers' names, a Composio server's save and the delete of a server
4
4
  // (the secret-write gate lets the token save over or delete only a server it saved, mcp-secret-writes.ts), the MCP
5
- // endpoint, triggers and their webhook hooks (all but a firing's release, which the launch hook's host sends), the rest
6
- // of agents and templates. Off by default.
5
+ // endpoint, triggers but their reads, their turn on or off (apiOnlyTriggerEdit) and a firing's release (which the launch
6
+ // hook's host sends), their webhook hooks, the rest of agents and templates. Off by default.
7
7
  import { API_ONLY_ENV } from "./env-switch.js";
8
8
  import { NOT_SET_UP } from "./runnable.js";
9
9
  import { LAUNCH_HOOK_SECRET_ENV, LAUNCH_HOOK_URL_ENV } from "./trigger-launch-hook.js";
@@ -27,7 +27,12 @@ import { LAUNCH_HOOK_SECRET_ENV, LAUNCH_HOOK_URL_ENV } from "./trigger-launch-ho
27
27
  * agents and revisions that stay, archives and deletes any agent made here and purges any run of one, as the whole
28
28
  * server's token does, and with the launch hook its apply makes schedule and feed triggers. A trigger the apply can't
29
29
  * make here is skipped, and said (apiOnlyTriggerSkipped). One the agent had before the profile stays as it was:
30
- * without the hook, an enabled one still fires here on this server's keys until the agent is archived;
30
+ * without the hook, an enabled one still fires here on this server's keys until it is turned off (below) or the agent
31
+ * is archived;
32
+ * - a backend reads the triggers (their list, one, its firings) and turns one on or off (updateTrigger, `enabled` alone:
33
+ * apiOnlyTriggerEdit), since a trigger whose firings failed FAILURES_TO_PAUSE times in a row turns itself off and
34
+ * there is no console here to turn it on in. It turns one on under the apply's rule: a schedule or a feed, with the
35
+ * launch hook. Making, deleting, firing a trigger and its secret stay refused;
31
36
  * - an API-only server has no owner, so the token is the backend's own, as with take-over: it saves the Composio servers
32
37
  * its agents need through the preset (saveComposioServer), saves over or deletes only a server it saved
33
38
  * (mcp-secret-writes.ts tokenWriteOverRefused), and never writes a secret (secret-writes.ts). A Composio server names
@@ -52,6 +57,7 @@ export const API_ONLY_ROUTES = new Set([
52
57
  "getCapabilities", "getHealth", "getUsage", "getCapacity", "listMcpServerNames",
53
58
  "importTemplate", "applyTemplate", "getAgent", "listRevisions", "setCurrent", "archiveAgent", "unarchiveAgent",
54
59
  "saveComposioServer", "deleteMcpServer", "releaseTriggerFiring",
60
+ "listTriggers", "getTrigger", "listTriggerFirings", "updateTrigger",
55
61
  // Refused in its own words (403): it reads the machine's session files, which a server behind a backend does not have to give.
56
62
  "getWrapped",
57
63
  ]);
@@ -73,6 +79,35 @@ export function apiOnlyTriggerSkipped(packageName, trigger, hooked) {
73
79
  return undefined;
74
80
  return { reason: NOT_SET_UP, message: `${named} and has no launch hook, so its firings have nowhere to go. Start its runs through the API, or set the launch hook (${LAUNCH_HOOK_URL_ENV} and ${LAUNCH_HOOK_SECRET_ENV}) and apply again: each firing then goes to your backend, which starts its run.` };
75
81
  }
82
+ /** Whether an API-only server turns on a trigger whose source is `kind` and whose target is `target` (its PATCH, its
83
+ * agent's unarchive): only one the apply would make, a source of API_ONLY_HOOKED_KINDS aimed at an agent (start_run),
84
+ * with the launch hook `hooked`, so each firing goes to the backend. A message_run firing never goes to the hook
85
+ * (triggers.ts): on, it would open its run on this server's keys. */
86
+ export function apiOnlyTurnsOn(kind, target, hooked) {
87
+ return hooked && API_ONLY_HOOKED_KINDS.has(kind) && target === "start_run";
88
+ }
89
+ /** Why an API-only server refuses `body`, a PATCH of a trigger whose source is `kind` and whose target is `target`, each
90
+ * an issue (none: it goes on to the trigger's own checks). It takes `enabled` alone: a new source or target would let
91
+ * the token aim a trigger at an address or an agent of its own choosing (a feed's urls fetched by this server, a run of
92
+ * another agent), which no route here lets it make, and a name or a cap is the console's to edit. Turned off: always,
93
+ * it stops firings. Turned on: only where the apply would make it (apiOnlyTurnsOn), so its firings go to the backend;
94
+ * any other would start or open runs on this server's keys, or wait on a hook or setting this profile refuses. */
95
+ export function apiOnlyTriggerEdit(body, kind, hooked, target) {
96
+ if (body === null || typeof body !== "object" || Array.isArray(body))
97
+ return [];
98
+ const issues = Object.keys(body).filter((key) => key !== "enabled").map((field) => ({ field, reason: "not_allowed", message: `This server serves the run API only (${API_ONLY_ENV}=1), where a trigger is turned on or off alone: send {"enabled": true} or {"enabled": false}, without ${field}.` }));
99
+ if (body.enabled !== true || apiOnlyTurnsOn(kind, target, hooked))
100
+ return issues;
101
+ const named = `This server serves the run API only (${API_ONLY_ENV}=1)`;
102
+ if (target !== "start_run") {
103
+ issues.push({ field: "enabled", reason: "not_an_option", message: `${named}, and this trigger messages a run: its firings never go to the launch hook, so each would open that run on this server's keys. It is not turned on here. Send the run its messages through the API instead.` });
104
+ return issues;
105
+ }
106
+ issues.push(API_ONLY_HOOKED_KINDS.has(kind)
107
+ ? { field: "enabled", reason: NOT_SET_UP, message: `${named} and has no launch hook, so this ${kind} trigger's firings would start runs on this server's keys: set the launch hook (${LAUNCH_HOOK_URL_ENV} and ${LAUNCH_HOOK_SECRET_ENV}), then turn it on.` }
108
+ : { field: "enabled", reason: "not_an_option", message: `${named}, which serves no route or setting a ${kind} trigger needs, so it is not turned on here. Start its runs through the API instead.` });
109
+ return issues;
110
+ }
76
111
  /** Whether an API-only server saves `body` through the generic save (saveMcpServer) over the name its path gives: a
77
112
  * per_run server (no credential kept) whose url's origin is one of `origins`, under a name that is not a Composio
78
113
  * preset's (`preset`; Composio's own route saves those). Checked before anything reaches the address. A body that
@@ -71,7 +71,7 @@ export declare function personHands(options: {
71
71
  /** For tests: the clock the person's time is measured by. */
72
72
  now?: () => number;
73
73
  /** The run's held values cut from the ask's words, whole, before they are cut to their bound and written. */
74
- redact?: (text: string) => string;
74
+ redact: (text: string) => string;
75
75
  /** The person's time on a session that just ended, `seconds` of it, to hold until a charge books it (browser-cost.ts
76
76
  * carry): the up-front holds go as it ends, the time it took stays counted. */
77
77
  carry?(tag: string, seconds: number): void;
@@ -475,7 +475,7 @@ export function personHands(options) {
475
475
  const hold = { drop: () => release(ask.sessionTag, user) };
476
476
  const at = Date.now();
477
477
  // Redacted whole, then cut to their bound: a held value the cut would split never leaves its head in the record.
478
- const shown = (text) => (options.redact ? options.redact(text) : text).slice(0, MAX_TEXT);
478
+ const shown = (text) => options.redact(text).slice(0, MAX_TEXT);
479
479
  const record = { id, tag: ask.sessionTag, instruction: shown(ask.instruction), completion_condition: shown(ask.completionCondition), asked_at: new Date(at).toISOString(), expires_at: new Date(at + holdMs).toISOString() };
480
480
  open.set(id, { tag: ask.sessionTag, expiresAt: at + holdMs, drop: () => hold.drop() });
481
481
  watch();
@@ -76,7 +76,7 @@ function calendarTool(host) {
76
76
  let secret = [saved.url];
77
77
  const clean = (text) => {
78
78
  const cut = scrubAddress(text, secret);
79
- return host.redact ? host.redact(cut) : cut;
79
+ return host.redact(cut);
80
80
  };
81
81
  const failed = (words) => forModel(clean(calendarError(`${CALENDAR_EVENTS}: ${words}`)), { isError: true });
82
82
  const given = (isObject(args) ? args : {});
package/dist/cli.js CHANGED
@@ -32,7 +32,7 @@ installEnvProxy();
32
32
  const USAGE = `usage: agentrun-serve [--data DIR] [--listen ADDR] [--port N] [--open] [--faux MODULE] [--faux-browser MODULE] [--faux-github] [--allow-host NAME ...] [--max-runs N] [--drain-timeout D] [--documents DIR] [--allow-code-nodes] [--learning on|off] [--no-runner] [--harness-module MODULE ...] [--harness-recipe FILE ...] [--harness-sign-in]
33
33
  agentrun-serve reset-password [--data DIR]
34
34
  agentrun-serve validate-template DIR
35
- agentrun-serve install-harness goose|cursor [--data DIR]
35
+ agentrun-serve install-harness goose|cursor|antigravity [--data DIR]
36
36
  agentrun-serve install-harness --recipe FILE [--data DIR]
37
37
  agentrun-serve sign-in-harness --recipe FILE [--data DIR]
38
38
  agentrun-serve check-harness --recipe FILE [--model PROVIDER/MODEL] [--data DIR] [--report FILE] [--cap USD]
@@ -84,7 +84,8 @@ const USAGE = `usage: agentrun-serve [--data DIR] [--listen ADDR] [--port N] [--
84
84
  separated), installed into DIR with agentrun harness install --recipe FILE. Its harness runs once a
85
85
  harness-check of it passed on DIR, through this server's model proxy (a plan-billed one's keys are
86
86
  not saved on a server yet); a recipe the loader refuses, or whose id another harness has, refuses
87
- the start
87
+ the start. FILE may be the name of a recipe AgentRun ships (antigravity), unless a file of that
88
+ name is in this directory (./NAME names the file)
88
89
  --harness-sign-in run a person's runs of a plan-billed recipe with a sign-in on your own sign-in (agentrun harness
89
90
  sign-in), never a schedule's or a trigger's. One owner's own machine alone: the start is refused
90
91
  unless the server listens on loopback with no public address, keeps its store in DIR (no
@@ -238,21 +239,26 @@ if (process.argv[2] === "install-harness") {
238
239
  }
239
240
  };
240
241
  const { values, positionals } = read();
242
+ if (values.recipe !== undefined && positionals.length)
243
+ usage("it takes a harness's name or --recipe FILE, not both.");
244
+ // A recipe AgentRun ships (the ACP package's: Google Antigravity's), by its name, is installed as its file is.
245
+ const { acpPackage: shipping } = await import("./acp-package.js");
246
+ const shipped = positionals.length === 1 ? shipping()?.bundledRecipePath?.(positionals[0]) : undefined;
241
247
  // A recipe's harness (harness-recipe.ts): the recipe loaded under its five rules first, so a refused one downloads
242
- // nothing; then its release for this platform, as the Goose install does it.
243
- if (values.recipe !== undefined) {
244
- if (positionals.length)
245
- usage("it takes a harness's name or --recipe FILE, not both.");
246
- const [{ ArchiveInstallFailed }, { installRecipe, loadRecipe, recipeCheckLine, RecipeRefused }] = await Promise.all([import("./harness-archive.js"), import("./harness-recipe.js")]);
248
+ // nothing; then its release for this platform, as the Goose install does it. Which recipe resolved is said first.
249
+ if (values.recipe !== undefined || shipped) {
250
+ const [{ ArchiveInstallFailed }, { installRecipe, loadRecipe, recipeCheckLine, RecipeRefused, recipeSaid }] = await Promise.all([import("./harness-archive.js"), import("./harness-recipe.js")]);
247
251
  const data = resolve(values.data ?? defaultData());
248
252
  try {
249
- const { recipe, file } = loadRecipe(values.recipe);
253
+ // A shipped recipe by the name given, never by its path: a file of that name in the directory refuses it (resolveRecipe).
254
+ const { recipe, file, bundled } = loadRecipe(shipped ? positionals[0] : values.recipe);
255
+ console.error(recipeSaid(recipe.label, file, bundled));
250
256
  const said = { downloaded: "the archive is downloaded and its sha256 matches the recipe", unpacked: "unpacked", verified: "its files are checked" };
251
257
  const { version, installed, binary, pinnedBy } = await installRecipe(recipe, file, data, { onStep: (step) => console.error(`${recipe.label}: ${said[step]}`) });
252
258
  const held = { recipe: "the recipe's tree pin", "first-seen": "the tree an earlier install recorded", recorded: "their tree recorded now, as the first one; a later binary or file beside it that differs is refused" }[pinnedBy];
253
259
  console.log(installed === "already"
254
260
  ? `${recipe.label} ${version} is installed in ${dirname(binary)} (already: the pinned files are there, so nothing was downloaded; held to ${held}).`
255
- : `${recipe.label} ${version} is installed in ${dirname(binary)} (now; the binary and every file beside it held to ${held}). Check it with: ${recipeCheckLine(file, data)} --model PROVIDER/MODEL`);
261
+ : `${recipe.label} ${version} is installed in ${dirname(binary)} (now; the binary and every file beside it held to ${held}). Check it with: ${recipeCheckLine(file, data)}${recipe.model.billing === "proxy" ? " --model PROVIDER/MODEL" : ""}`);
256
262
  process.exit(0);
257
263
  }
258
264
  catch (error) {
@@ -264,7 +270,7 @@ if (process.argv[2] === "install-harness") {
264
270
  }
265
271
  // The owner-installed harnesses (harness-owned.ts), each one's id, label, install and what its install checks.
266
272
  const installers = await Promise.all([import("./harness-goose.js").then((m) => m.GOOSE), import("./harness-cursor.js").then((m) => m.CURSOR)]);
267
- const names = installers.map((each) => each.id).join(" or ");
273
+ const names = [...installers.map((each) => each.id), ...(shipping()?.BUNDLED_RECIPES ?? [])].join(" or ");
268
274
  if (positionals.length !== 1)
269
275
  usage(`it takes one harness: ${names}.`);
270
276
  const chosen = installers.find((each) => each.id === positionals[0]);
@@ -610,6 +616,32 @@ else {
610
616
  console.error(`agentrun-serve: ${error.message}`);
611
617
  process.exit(2);
612
618
  }
619
+ // Which recipe each --harness-recipe NAME resolved to, said before the start: one AgentRun ships (resolveRecipe), and a
620
+ // name a file here also holds refuses the start, saying both.
621
+ if (harnessRecipesOf(values["harness-recipe"], process.env).length) {
622
+ const { loadRecipe, RecipeRefused, recipeSaid, resolveRecipe } = await import("./harness-recipe.js");
623
+ for (const given of harnessRecipesOf(values["harness-recipe"], process.env)) {
624
+ let resolved;
625
+ try {
626
+ resolved = resolveRecipe(given);
627
+ }
628
+ catch (error) {
629
+ if (!(error instanceof RecipeRefused))
630
+ throw error;
631
+ console.error(`agentrun-serve: --harness-recipe ${given}: ${error.message}`);
632
+ process.exit(2);
633
+ }
634
+ // A refused recipe's words are the start's own, as for a file (the harness table loads each).
635
+ if (resolved.bundled) {
636
+ let label = given;
637
+ try {
638
+ label = loadRecipe(resolved.file).recipe.label;
639
+ }
640
+ catch { }
641
+ console.error(recipeSaid(label, resolved.file, true));
642
+ }
643
+ }
644
+ }
613
645
  const accounts = !apiOnly && process.env.AGENTRUN_ACCOUNTS !== "0";
614
646
  // The address first (listen-first.ts): the port bound and named before the rest of the server loads, then answering that
615
647
  // the server is warming until it takes the socket over. A port already taken is left to the start's own listen below,
@@ -1,4 +1,4 @@
1
- import{d as It,D as Yn}from"./index-DZi-muIj.js";import{az as bt}from"./styles-CcceGcu2.js";const we=t=>({type:"boolean",description:t}),Yt={type:"object",required:["name","pageCount","pages","text"],properties:{name:{type:"string"},pageCount:{type:"integer"},pages:{type:"array"},text:{type:"string"}}},Jn={type:"object",required:["status","text"],properties:{status:{type:"integer"},url:{type:"string"},title:{type:"string"},text:{type:"string"}}},vt={type:"object"},Ke={type:"object",additionalProperties:!1,required:["altered","seal","signature","legible"],properties:{altered:we("Does the page show signs of digital alteration: mismatched fonts, misaligned lines, pasted regions or an edited date?"),seal:we("Is a state seal or a filing stamp visible on the page?"),signature:we("Is the certificate signed by a state official?"),legible:we("Is the entity's full legal name legible on the page?")}},mt={v:2,name:"coi-batch-review",schemas:{Input:{type:"object",required:["documents"],properties:{documents:{type:"array",items:{type:"string"},minItems:1,maxItems:50}}},DocChecks:Ke,Pages:Yt,Report:vt},input:{schemaId:"Input"},output:{schemaId:"Report",path:"report"},root:{node:"chain",steps:[{node:"map",label:"each-document",itemsPath:"documents",as:"rows",maxConcurrency:4,onItemFailure:"collect",failedAs:"failed",body:{node:"chain",steps:[{node:"call",label:"render-pages",via:"tool",tool:"pdf_pages",args:{path:"{item}",maxPages:2},out:"Pages",as:"pages",deadline_s:60},{node:"judge",label:"inspect-certificate",provider:"jev",state:{document:"{item}",page:"<page1>",text:"{pages.text}"},images:{"<page1>":"{pages.pages.0.image}"},out:"DocChecks",as:"checks"},{node:"code",label:"grade",code:"(s) => ({ document: s.item, verdict: s.checks.altered || !s.checks.seal || !s.checks.legible ? 'doubtful' : 'valid', checks: s.checks })",as:"row"}]}},{node:"code",label:"batch-report",code:"(s) => ({ valid: s.rows.filter((r) => r && r.verdict === 'valid').length, doubtful: s.rows.filter((r) => r && r.verdict === 'doubtful').map((r) => r.document), failed: s.failed })",as:"report"}]}},xe={v:2,name:"kyb-onboarding",schemas:{Pages:Yt,Result:vt,Input:{type:"object",required:["company","state","registration_number","documents"],properties:{company:{type:"string"},state:{type:"string"},registration_number:{type:"string"},documents:{type:"array",items:{type:"string"}}}},Registry:{type:"object",additionalProperties:!1,required:["registered","active","name_matches"],properties:{registered:we("Is a company with this exact registration number on file with the named state's business registry?"),active:we("Is that registration currently active (in good standing, not dissolved, forfeited or revoked)?"),name_matches:we("Does the registry's legal name match the applicant's name, ignoring punctuation and suffix style?")}},CertLook:{type:"object",additionalProperties:!1,required:["altered","seal","legible"],properties:{altered:Ke.properties.altered,seal:Ke.properties.seal,legible:Ke.properties.legible}},CrossCheck:{type:"object",additionalProperties:!1,required:["same_entity","same_state","dates_consistent"],properties:{same_entity:we("Do the registry record and the certificate name the same legal entity?"),same_state:we("Do they name the same state of incorporation?"),dates_consistent:we("Is the certificate's filing date consistent with the registry's formation date (within 3 days)?")}}},input:{schemaId:"Input"},root:{node:"chain",steps:[{node:"call",label:"render-certificate",via:"tool",tool:"pdf_pages",args:{path:"{documents.0}",maxPages:1},out:"Pages",as:"cert",deadline_s:60},{node:"parallel",label:"checks",branches:[{node:"judge",label:"registry-lookup",provider:"parallel",model:"standard",state:{company:"{company}",state:"{state}",registration_number:"{registration_number}"},out:"Registry",as:"registry"},{node:"judge",label:"certificate-look",provider:"jev",state:{page:"<cert>",text:"{cert.text}"},images:{"<cert>":"{cert.pages.0.image}"},out:"CertLook",as:"look"}]},{node:"judge",label:"cross-check",provider:"jev",state:{applicant:{company:"{company}",state:"{state}"},registry:"{registry$answers}",certificate_text:"{cert.text}"},out:"CrossCheck",as:"cross"},{node:"route",label:"decide",provider:"jev",state:{registry:"{registry}",look:"{look}",cross:"{cross}"},instructions:"Decide the onboarding outcome for this business from the registry check, the certificate's look and the cross-check.",branches:{approve:{criteria:"Registered, active, the certificate looks genuine, and every cross-check agrees.",body:{node:"code",label:"record-approval",code:"(s) => ({ outcome: 'approved' })",as:"outcome"}},review:{criteria:"Mostly consistent, but one check is doubtful or the evidence disagrees on a detail.",body:{node:"code",label:"open-review-case",code:"(s) => ({ outcome: 'review', reasons: s.cross })",as:"outcome"}},reject:{criteria:"Not registered, dissolved, or the certificate is altered.",body:{node:"code",label:"record-rejection",code:"(s) => ({ outcome: 'rejected' })",as:"outcome"}}},unsure:{branch:"review",gte:.75}}]},output:{schemaId:"Result",path:"outcome"}},Vn={type:"object",additionalProperties:!1,required:["prohibited"],properties:{prohibited:we("Does this merchant sell goods the card networks prohibit: weapons, controlled substances, counterfeit goods, or unlicensed nicotine products?")}},Ve=(t,s,o)=>({node:"judge",label:t,provider:s,...o?{model:o}:{},state:{merchant:"{merchant}",url:"{url}",page_text:"{page.text}"},out:"Prohibited",as:t.replace(/-/g,"_")}),Ze={v:2,name:"prohibited-goods-jury",schemas:{Page:Jn,Result:vt,Input:{type:"object",required:["merchant","url"],properties:{merchant:{type:"string"},url:{type:"string"}}},Prohibited:Vn},input:{schemaId:"Input"},root:{node:"chain",steps:[{node:"call",label:"fetch-storefront",via:"tool",tool:"web_fetch",args:{url:"{url}"},out:"Page",as:"page",deadline_s:30},{node:"parallel",label:"jury",branches:[Ve("jev","jev"),Ve("pplx-decider","openrouter","perplexity/pplx-decider-v1.2"),Ve("liquid-d1","openrouter","liquid/d1"),Ve("clef","openrouter","cloudflare/clef")]},{node:"code",label:"aggregate",code:"(s) => { const p = [s.jev$answers, s.pplx_decider$answers, s.liquid_d1$answers, s.clef$answers].map((a) => a.answers.prohibited.noul); const mean = p.reduce((x, y) => x + y, 0) / p.length; const spread = Math.max(...p) - Math.min(...p); return { mean, spread, outcome: spread > 0.3 ? 'disagree' : 'agree' }; }",as:"agreement"},{node:"route",label:"agreement",valuePath:"agreement.outcome",branches:{agree:{body:{node:"code",label:"auto-decide",code:"(s) => ({ decision: s.agreement.mean >= 0.5 ? 'decline' : 'approve' })",as:"decision"}},disagree:{body:{node:"code",label:"human-review",code:"(s) => ({ decision: 'review', spread: s.agreement.spread })",as:"decision"}}}}]},output:{schemaId:"Result",path:"decision"}},re=6e4,le=60*re,W=24*le,se={default:"anthropic/claude-sonnet-5-5",fast:"openai/gpt-6-luna",strong:"anthropic/claude-opus-5-5",codex:"openai/gpt-6.1-sol"},Qn={v:2,name:"ticket-triage",schemas:{Ticket:{type:"object",required:["subject","body"],properties:{subject:{type:"string"},body:{type:"string"}}},Triage:{type:"object",required:["queue","urgency"],properties:{queue:{type:"string"},urgency:{type:"integer"}}}},input:{schemaId:"Ticket"},output:{schemaId:"Triage",path:"triage"},root:{node:"chain",steps:[{node:"call",label:"read the playbook",tool:"read",args:{path:"playbooks/triage.md"},as:"playbook"},{node:"pick",label:"which queue",from:"playbook.queues",instructions:"Which queue does this ticket belong to, by what the buyer or seller asks for?",as:"queue",none:"hand back"},{node:"code",label:"score the urgency",as:"triage"}]}},Zn=`# ticket-triage
1
+ import{d as It,D as Yn}from"./index-BnZV3lvW.js";import{az as bt}from"./styles-D_znYrHR.js";const we=t=>({type:"boolean",description:t}),Yt={type:"object",required:["name","pageCount","pages","text"],properties:{name:{type:"string"},pageCount:{type:"integer"},pages:{type:"array"},text:{type:"string"}}},Jn={type:"object",required:["status","text"],properties:{status:{type:"integer"},url:{type:"string"},title:{type:"string"},text:{type:"string"}}},vt={type:"object"},Ke={type:"object",additionalProperties:!1,required:["altered","seal","signature","legible"],properties:{altered:we("Does the page show signs of digital alteration: mismatched fonts, misaligned lines, pasted regions or an edited date?"),seal:we("Is a state seal or a filing stamp visible on the page?"),signature:we("Is the certificate signed by a state official?"),legible:we("Is the entity's full legal name legible on the page?")}},mt={v:2,name:"coi-batch-review",schemas:{Input:{type:"object",required:["documents"],properties:{documents:{type:"array",items:{type:"string"},minItems:1,maxItems:50}}},DocChecks:Ke,Pages:Yt,Report:vt},input:{schemaId:"Input"},output:{schemaId:"Report",path:"report"},root:{node:"chain",steps:[{node:"map",label:"each-document",itemsPath:"documents",as:"rows",maxConcurrency:4,onItemFailure:"collect",failedAs:"failed",body:{node:"chain",steps:[{node:"call",label:"render-pages",via:"tool",tool:"pdf_pages",args:{path:"{item}",maxPages:2},out:"Pages",as:"pages",deadline_s:60},{node:"judge",label:"inspect-certificate",provider:"jev",state:{document:"{item}",page:"<page1>",text:"{pages.text}"},images:{"<page1>":"{pages.pages.0.image}"},out:"DocChecks",as:"checks"},{node:"code",label:"grade",code:"(s) => ({ document: s.item, verdict: s.checks.altered || !s.checks.seal || !s.checks.legible ? 'doubtful' : 'valid', checks: s.checks })",as:"row"}]}},{node:"code",label:"batch-report",code:"(s) => ({ valid: s.rows.filter((r) => r && r.verdict === 'valid').length, doubtful: s.rows.filter((r) => r && r.verdict === 'doubtful').map((r) => r.document), failed: s.failed })",as:"report"}]}},xe={v:2,name:"kyb-onboarding",schemas:{Pages:Yt,Result:vt,Input:{type:"object",required:["company","state","registration_number","documents"],properties:{company:{type:"string"},state:{type:"string"},registration_number:{type:"string"},documents:{type:"array",items:{type:"string"}}}},Registry:{type:"object",additionalProperties:!1,required:["registered","active","name_matches"],properties:{registered:we("Is a company with this exact registration number on file with the named state's business registry?"),active:we("Is that registration currently active (in good standing, not dissolved, forfeited or revoked)?"),name_matches:we("Does the registry's legal name match the applicant's name, ignoring punctuation and suffix style?")}},CertLook:{type:"object",additionalProperties:!1,required:["altered","seal","legible"],properties:{altered:Ke.properties.altered,seal:Ke.properties.seal,legible:Ke.properties.legible}},CrossCheck:{type:"object",additionalProperties:!1,required:["same_entity","same_state","dates_consistent"],properties:{same_entity:we("Do the registry record and the certificate name the same legal entity?"),same_state:we("Do they name the same state of incorporation?"),dates_consistent:we("Is the certificate's filing date consistent with the registry's formation date (within 3 days)?")}}},input:{schemaId:"Input"},root:{node:"chain",steps:[{node:"call",label:"render-certificate",via:"tool",tool:"pdf_pages",args:{path:"{documents.0}",maxPages:1},out:"Pages",as:"cert",deadline_s:60},{node:"parallel",label:"checks",branches:[{node:"judge",label:"registry-lookup",provider:"parallel",model:"standard",state:{company:"{company}",state:"{state}",registration_number:"{registration_number}"},out:"Registry",as:"registry"},{node:"judge",label:"certificate-look",provider:"jev",state:{page:"<cert>",text:"{cert.text}"},images:{"<cert>":"{cert.pages.0.image}"},out:"CertLook",as:"look"}]},{node:"judge",label:"cross-check",provider:"jev",state:{applicant:{company:"{company}",state:"{state}"},registry:"{registry$answers}",certificate_text:"{cert.text}"},out:"CrossCheck",as:"cross"},{node:"route",label:"decide",provider:"jev",state:{registry:"{registry}",look:"{look}",cross:"{cross}"},instructions:"Decide the onboarding outcome for this business from the registry check, the certificate's look and the cross-check.",branches:{approve:{criteria:"Registered, active, the certificate looks genuine, and every cross-check agrees.",body:{node:"code",label:"record-approval",code:"(s) => ({ outcome: 'approved' })",as:"outcome"}},review:{criteria:"Mostly consistent, but one check is doubtful or the evidence disagrees on a detail.",body:{node:"code",label:"open-review-case",code:"(s) => ({ outcome: 'review', reasons: s.cross })",as:"outcome"}},reject:{criteria:"Not registered, dissolved, or the certificate is altered.",body:{node:"code",label:"record-rejection",code:"(s) => ({ outcome: 'rejected' })",as:"outcome"}}},unsure:{branch:"review",gte:.75}}]},output:{schemaId:"Result",path:"outcome"}},Vn={type:"object",additionalProperties:!1,required:["prohibited"],properties:{prohibited:we("Does this merchant sell goods the card networks prohibit: weapons, controlled substances, counterfeit goods, or unlicensed nicotine products?")}},Ve=(t,s,o)=>({node:"judge",label:t,provider:s,...o?{model:o}:{},state:{merchant:"{merchant}",url:"{url}",page_text:"{page.text}"},out:"Prohibited",as:t.replace(/-/g,"_")}),Ze={v:2,name:"prohibited-goods-jury",schemas:{Page:Jn,Result:vt,Input:{type:"object",required:["merchant","url"],properties:{merchant:{type:"string"},url:{type:"string"}}},Prohibited:Vn},input:{schemaId:"Input"},root:{node:"chain",steps:[{node:"call",label:"fetch-storefront",via:"tool",tool:"web_fetch",args:{url:"{url}"},out:"Page",as:"page",deadline_s:30},{node:"parallel",label:"jury",branches:[Ve("jev","jev"),Ve("pplx-decider","openrouter","perplexity/pplx-decider-v1.2"),Ve("liquid-d1","openrouter","liquid/d1"),Ve("clef","openrouter","cloudflare/clef")]},{node:"code",label:"aggregate",code:"(s) => { const p = [s.jev$answers, s.pplx_decider$answers, s.liquid_d1$answers, s.clef$answers].map((a) => a.answers.prohibited.noul); const mean = p.reduce((x, y) => x + y, 0) / p.length; const spread = Math.max(...p) - Math.min(...p); return { mean, spread, outcome: spread > 0.3 ? 'disagree' : 'agree' }; }",as:"agreement"},{node:"route",label:"agreement",valuePath:"agreement.outcome",branches:{agree:{body:{node:"code",label:"auto-decide",code:"(s) => ({ decision: s.agreement.mean >= 0.5 ? 'decline' : 'approve' })",as:"decision"}},disagree:{body:{node:"code",label:"human-review",code:"(s) => ({ decision: 'review', spread: s.agreement.spread })",as:"decision"}}}}]},output:{schemaId:"Result",path:"decision"}},re=6e4,le=60*re,W=24*le,se={default:"anthropic/claude-sonnet-5-5",fast:"openai/gpt-6-luna",strong:"anthropic/claude-opus-5-5",codex:"openai/gpt-6.1-sol"},Qn={v:2,name:"ticket-triage",schemas:{Ticket:{type:"object",required:["subject","body"],properties:{subject:{type:"string"},body:{type:"string"}}},Triage:{type:"object",required:["queue","urgency"],properties:{queue:{type:"string"},urgency:{type:"integer"}}}},input:{schemaId:"Ticket"},output:{schemaId:"Triage",path:"triage"},root:{node:"chain",steps:[{node:"call",label:"read the playbook",tool:"read",args:{path:"playbooks/triage.md"},as:"playbook"},{node:"pick",label:"which queue",from:"playbook.queues",instructions:"Which queue does this ticket belong to, by what the buyer or seller asks for?",as:"queue",none:"hand back"},{node:"code",label:"score the urgency",as:"triage"}]}},Zn=`# ticket-triage
2
2
 
3
3
  Files a ticket under its queue (billing, shipping, account, merchant, abuse) and scores its urgency from the playbook: a chargeback, a locked account or a safety problem is 4 or more.
4
4