@parcha/agentrun-kernel 0.1.0-beta.52 → 0.1.0-beta.53

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -2,6 +2,23 @@
2
2
 
3
3
  ## [Unreleased]
4
4
 
5
+ ## 0.1.0-beta.53 (2026-11-22)
6
+
7
+ - A harness recipe now covers an outside agent's release as its vendor ships it (Google's agy CLI among them), and the owner's own sign-in, made by the agent itself: <!-- changes/recipes-outside-harness.md -->
8
+ - `.zip` releases install, unpacked in Node with no `unzip` on the host. An entry that leaves the folder (`..`, an absolute path, a backslash), a symbolic link, a device, an encrypted entry or a duplicate refuses the whole archive before anything lands.
9
+ - An archive is pinned by one digest, its `sha256` or, where the vendor's manifest lists that, its `sha512` (Google's agy CLI manifests). `release.registry` is optional, for a release that is the vendor's own rather than the ACP registry's.
10
+ - Every file the archive unpacks to is pinned, not the binary alone: the tree's sha256 is recorded at the first install (or given as the release's `treeSha256`), and a check or a sign-in refuses a sidecar that changed since.
11
+ - A release may give its own `args` per platform, over the recipe's.
12
+ - `model.id` picks a plan-billed agent's model among those its `session/new` lists (`session/set_model`); one it does not list is refused before a prompt.
13
+ - A key may be handed under the name the agent reads: `keys: [{ "name": "ANTIGRAVITY_GEMINI_API_KEY", "env": "GEMINI_API_KEY" }]`. It is read by its saved name, so the server's own `GEMINI_API_KEY` never reaches the agent. `keyMethod` is the method the agent's ACP `authenticate` signs in with on it (`gemini-api-key`).
14
+ - One list in the kernel, `launchEnv` (`LAUNCH_ENV`, `LAUNCH_ENV_PREFIXES`), names the variables that change what a process loads or runs before its own code: `PATH`, `LD_*`, `DYLD_*`, `NODE_OPTIONS`, `NODE_PATH`, `PYTHON*`, `BASH_*`, `ENV`, `GIT_*` and a few shells' and interpreters' start-up variables. A key is never handed under one of them, nor a recipe's `env` or `model.env` named one. The recipe loader and the ACP adapter both refuse them.
15
+ - A key's saved and handed names follow the kernel's `KEY_NAME` (capitals, digits and `_`, at most 64) in the recipe loader as in the ACP adapter, so `harness-check` no longer refuses a lowercase key name the loader took. Other variable names keep `ENV_NAME`.
16
+ - `signIn: { "args": [...], "homeArg": FLAG }` names the agent's own sign-in, as T3 Code runs agy: `agentrun harness sign-in --recipe FILE` starts the installed, unmodified agent on your terminal with its arguments, `args` (`--login`) and `homeArg` naming its own folder (`--gemini-dir DIR`). The agent prints the address, reads the code you paste and keeps its sign-in in that folder; exit 0 is signed in (`HARNESS_SIGN_IN_FAILED` otherwise).
17
+ - harness-check runs on the recipe's keys alone, never the sign-in, so a plan-billed recipe names a key beside any `signIn`. A run on the sign-in hands the agent `homeArg` and its folder, no key, nothing it prints kept.
18
+ - AgentRun never reads, refreshes or sends the sign-in's token, and has no usage reader: it never opens the folder, and a test keeps every credential file and Google account or quota endpoint out of the harness sources.
19
+ - The ACP adapter's `stderr: "none"` (`AcpRecipe`) keeps nothing an agent prints, for a run on a sign-in: a failure says its exit status and AgentRun's own code, and an error the agent answers says its JSON-RPC code alone.
20
+ - An ACP run (Cursor, Goose, or a harness recipe) no longer stalls after many turns. Before, the adapter copied the agent's whole session store into the run's records at every turn, so the records grew with the square of the turn count. After about 20 Cursor turns they no longer fit the 32 MiB channel to the run's process: an approval answered 204, and the run then waited for good. Now the mirror stores each file as 64 KiB pieces, each written once per session, so a store that grows by appending costs only its new bytes. It never copies SQLite's `-shm` file, and holds at most 8 MiB per session. Past that, the run's timeline says "The agent's session state passed 8 MiB, so a resume starts it fresh with the conversation so far." and the mirror stops. A run whose records no longer cross to its process now fails at once, naming the size and the limit, and the approval that woke it is answered that the run failed. Adapters get a `notice` event, which serve shows as a step on the run's timeline. A session store mirrored before this version is not restored: such a run resumes fresh with the conversation so far. <!-- changes/acp-state-mirror-bounded.md -->
21
+
5
22
  ## 0.1.0-beta.49 (2026-11-20)
6
23
 
7
24
  - `GET /v2/runs/{run_id}/usage` (`runusage/1`) says what one run cost, line by line, and whose invoice each part lands on: `tokens` per model (`model`, and `provider` where the server sent the requests itself; null behind a gateway), `tools` per charger (`charged_by`, with calls of unpriced tools in `not_metered_calls`), and `browser_time` per browser provider (`provider`, seconds). Each line has its quantity as measured, its dollars as the run's booking holds them, and its basis (`reported`, `estimate`, `unpriced`). It reads the same for a pi run, a CLI-harness run and a workflow run (its decisions on the model that answered them). The lines join to `total`, the run's `cost.usd`; a charge of unknown cost is null with what is known beside it, never $0. `ended_at` is the end the lines cover: a follow-up can reopen an ended run, and a later read with another `ended_at` says it moved. The console's Dev tools tab shows the lines as "Cost by line". In the kernel, a paid request may say `reported` (it settles at the provider's own figure), written on its `runner.request`. <!-- changes/run-usage-lines.md -->
package/dist/index.d.ts CHANGED
@@ -4,6 +4,7 @@ export type { Admission, BeforeRequest, Refusal, HarnessRunner, HarnessRunnerOpt
4
4
  export { HarnessRunError, SessionFenced, TurnParked } from "./errors.js";
5
5
  export { CODEMODE, DEFER_CATALOG_OVER, defersCatalog, isCatalogWire, META_TOOLS, TOOLS_CALL, TOOLS_SEARCH } from "./tool-deferral.js";
6
6
  export { toolSchemaProblems } from "./schema-check.js";
7
+ export { ENV_NAME, KEY_NAME, LAUNCH_ENV, LAUNCH_ENV_PREFIXES, launchEnv } from "./launch-env.js";
7
8
  export { READ_SKILL_FILE, readSkillFileTool, SKILL_BYTES, skillProblems } from "./skill-files.js";
8
9
  export type { HostSkill, SkillFileList } from "./skill-files.js";
9
10
  export type { HarnessRunReason } from "./errors.js";
package/dist/index.js CHANGED
@@ -3,6 +3,7 @@ export { RECORD_WAIT_MS, runBooking, WAIT_POLL_FIRST_MS, WAIT_POLL_MOST_MS, WAIT
3
3
  export { HarnessRunError, SessionFenced, TurnParked } from "./errors.js";
4
4
  export { CODEMODE, DEFER_CATALOG_OVER, defersCatalog, isCatalogWire, META_TOOLS, TOOLS_CALL, TOOLS_SEARCH } from "./tool-deferral.js";
5
5
  export { toolSchemaProblems } from "./schema-check.js";
6
+ export { ENV_NAME, KEY_NAME, LAUNCH_ENV, LAUNCH_ENV_PREFIXES, launchEnv } from "./launch-env.js";
6
7
  export { READ_SKILL_FILE, readSkillFileTool, SKILL_BYTES, skillProblems } from "./skill-files.js";
7
8
  export { CONTENT_FILTERED, HOST_RESULT_MAX_CHARS, hostedTool, PLAN_LIMIT_CODE, PLAN_LIMIT_WORDS } from "./types.js";
8
9
  export { bookRequest, isConnectCode, isGatewayTimeout, rejectionCode } from "./booking.js";
@@ -0,0 +1,13 @@
1
+ /** An environment variable's name, as a recipe may write one (`GEMINI_HOME`, `agent_home`): the recipe loader and the
2
+ * ACP adapter read the same rule, so the adapter never refuses a name the loader took. */
3
+ export declare const ENV_NAME: RegExp;
4
+ /** A key's name, as it is saved and as it is handed to the agent (`ANTIGRAVITY_GEMINI_API_KEY`, `GEMINI_API_KEY`):
5
+ * capitals, digits and `_`, at most 64, stricter than ENV_NAME. The loader and the ACP adapter read this one rule, so
6
+ * harness-check never refuses a key the loader took. */
7
+ export declare const KEY_NAME: RegExp;
8
+ /** Names refused whole. */
9
+ export declare const LAUNCH_ENV: readonly string[];
10
+ /** Prefixes refused with every name they start: BASH_ holds BASH_ENV and exported functions (BASH_FUNC_*). */
11
+ export declare const LAUNCH_ENV_PREFIXES: readonly string[];
12
+ /** Whether `name` changes what a process loads or runs before its own code (LAUNCH_ENV, LAUNCH_ENV_PREFIXES). */
13
+ export declare const launchEnv: (name: string) => boolean;
@@ -0,0 +1,35 @@
1
+ // The one list of variables that change what a process loads or runs before its own code does: a dynamic loader's
2
+ // (LD_*, DYLD_*), an interpreter's (NODE_OPTIONS, NODE_PATH, PYTHON*), a shell's (BASH_ENV, ENV and bash's other
3
+ // start-up variables), git's (GIT_*: its config, its ssh and pager commands), and PATH, which picks every program a
4
+ // name runs. Whoever hands an agent's process a value under a name of its choosing (a recipe's key, handed under the
5
+ // name the agent reads; the variable an agent reads its sign-in folder from; a recipe's env) refuses these names: a
6
+ // value there would run code the pinned binary never named. The ACP adapter and serve's recipe loader both read it.
7
+ /** An environment variable's name, as a recipe may write one (`GEMINI_HOME`, `agent_home`): the recipe loader and the
8
+ * ACP adapter read the same rule, so the adapter never refuses a name the loader took. */
9
+ export const ENV_NAME = /^[A-Za-z_][A-Za-z0-9_]{0,127}$/;
10
+ /** A key's name, as it is saved and as it is handed to the agent (`ANTIGRAVITY_GEMINI_API_KEY`, `GEMINI_API_KEY`):
11
+ * capitals, digits and `_`, at most 64, stricter than ENV_NAME. The loader and the ACP adapter read this one rule, so
12
+ * harness-check never refuses a key the loader took. */
13
+ export const KEY_NAME = /^[A-Z][A-Z0-9_]{0,63}$/;
14
+ /** Names refused whole. */
15
+ export const LAUNCH_ENV = Object.freeze([
16
+ "PATH",
17
+ "NODE_OPTIONS",
18
+ "NODE_PATH",
19
+ "ENV",
20
+ "IFS",
21
+ "PS4",
22
+ "SHELLOPTS",
23
+ "PROMPT_COMMAND",
24
+ "ZDOTDIR",
25
+ "PERL5OPT",
26
+ "PERL5LIB",
27
+ "RUBYOPT",
28
+ "RUBYLIB",
29
+ "JAVA_TOOL_OPTIONS",
30
+ "_JAVA_OPTIONS",
31
+ ]);
32
+ /** Prefixes refused with every name they start: BASH_ holds BASH_ENV and exported functions (BASH_FUNC_*). */
33
+ export const LAUNCH_ENV_PREFIXES = Object.freeze(["LD_", "DYLD_", "PYTHON", "BASH_", "GIT_"]);
34
+ /** Whether `name` changes what a process loads or runs before its own code (LAUNCH_ENV, LAUNCH_ENV_PREFIXES). */
35
+ export const launchEnv = (name) => LAUNCH_ENV.includes(name) || LAUNCH_ENV_PREFIXES.some((prefix) => name.startsWith(prefix));
package/dist/types.d.ts CHANGED
@@ -450,6 +450,12 @@ export type AdapterEvent = {
450
450
  | {
451
451
  type: "message_taken";
452
452
  ids: readonly string[];
453
+ }
454
+ /** Something of the adapter's own the person should read on the run, in its words (the ACP mirror past its budget): a
455
+ * host shows it as a step of the run, never as the model's text. */
456
+ | {
457
+ type: "notice";
458
+ text: string;
453
459
  };
454
460
  /** An event as a host receives it: the adapter's, the runner's own, and the node each belongs to. */
455
461
  export type HarnessEvent = (AdapterEvent | {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@parcha/agentrun-kernel",
3
- "version": "0.1.0-beta.52",
3
+ "version": "0.1.0-beta.53",
4
4
  "description": "Agent harnesses other than Pi, starting with Codex, behind one seam: a DSL node's runNode and an AgentRun run on a harness adapter, durable in AgentRun's own store.",
5
5
  "keywords": [
6
6
  "agentrun",
@@ -62,7 +62,7 @@
62
62
  "test": "node --test --test-concurrency=8 'test/*.test.mjs'"
63
63
  },
64
64
  "dependencies": {
65
- "@parcha/agentrun-dsl": "0.1.0-beta.52",
65
+ "@parcha/agentrun-dsl": "0.1.0-beta.53",
66
66
  "ajv": "8.18.0",
67
67
  "typebox": "1.3.27"
68
68
  },