@agentproto/runtime 5.1.0 → 5.2.1

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/dist/config.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- import { S as SpawnDefaultsConfig } from './spawn-defaults-wQV9AeiG.js';
2
- import './context-continuity-Bn99UtVC.js';
1
+ import { S as SpawnDefaultsConfig } from './spawn-defaults-CHvz85DD.js';
2
+ import './context-continuity-BfNVbX5W.js';
3
3
  import '@agentproto/acp';
4
4
  import '@agentproto/command-sandbox';
5
5
  import '@agentproto/model-catalog';
@@ -193,6 +193,15 @@ interface FeaturesConfig {
193
193
  * --host` + `devices add`). Toggle via `agentproto devices
194
194
  * share-inference on|off`. */
195
195
  deviceInferenceShare?: boolean;
196
+ /** Opt this daemon in to being usable as an `agent_start({ sandbox:
197
+ * "device:<name>" })` target (DEVICES-PLAN PR-D) — exposes
198
+ * `/device-spawn/*` in http-server.ts, a self-proxy onto this daemon's
199
+ * own `/mcp` + `/sessions/:id/events/stream`. Default false: even with
200
+ * this on, only a HOST-scoped pairing (`pair offer --host` + `devices
201
+ * add`) can reach the routes — a plain remote-control pairing never can,
202
+ * whatever this is set to. Toggle via `agentproto devices allow-spawn
203
+ * on|off`. */
204
+ deviceSpawnAllow?: boolean;
196
205
  }
197
206
  /**
198
207
  * Policy for `agentproto worktree new` (PLAN.md §1.4 — config carries
@@ -333,6 +342,17 @@ interface SentinelConfig {
333
342
  * over that probe. Per-spawn opt-out: `agent_start.sentinel: false`. */
334
343
  autoWatchPrs?: boolean;
335
344
  }
345
+ /**
346
+ * Review-primitive host policy (`@agentproto/review` + `review-runner.ts`).
347
+ */
348
+ interface ReviewConfig {
349
+ /** The owner identity attestation signatures claim (`attestor.signature.
350
+ * principal`) — see `review-signing.ts`'s `resolvePrincipal`. When unset,
351
+ * the daemon falls back to `git config user.email` of the reviewed repo,
352
+ * then a host-derived value; this never blocks signing, it only lets an
353
+ * operator pin one identity across every repo the daemon reviews. */
354
+ principal?: string;
355
+ }
336
356
  /**
337
357
  * Session-presence policy — how the dashboard triages a session into its
338
358
  * `running` / `tending` / `attention` / `quiet` presence state (see
@@ -517,6 +537,8 @@ interface AgentprotoConfig {
517
537
  provenance?: ProvenanceConfig;
518
538
  /** Sentinel auto-link policy. See {@link SentinelConfig}. */
519
539
  sentinel?: SentinelConfig;
540
+ /** Review-primitive host policy. See {@link ReviewConfig}. */
541
+ review?: ReviewConfig;
520
542
  /** Daemon-side AGENTS.md resolution/injection policy. See {@link AgentsMdConfig}. */
521
543
  agentsMd?: AgentsMdConfig;
522
544
  /** Daemon-side session titler (`session-titler.ts`). DEFAULT OFF — when
@@ -589,4 +611,4 @@ declare function getConfigKey(cfg: AgentprotoConfig, dotted: string): unknown;
589
611
  */
590
612
  declare function setConfigKey(cfg: AgentprotoConfig, dotted: string, value: unknown): AgentprotoConfig;
591
613
 
592
- export { type AcpAgentConfigEntry, type AgentprotoConfig, type AgentsMdConfig, CONFIG_FILE_PATH, CONFIG_VERSION, type DaemonConfig, type FeaturesConfig, type PairingConfig, type ProfileConfig, type ProvenanceConfig, type SentinelConfig, type SessionsConfig, type SpawnAttachMode, type SpawnConfig, type SpawnDedupeMode, type TerminalPreset, type TitlerConfig, type TunnelConfig, type WorktreeIsolationMode, type WorktreesConfig, getConfigKey, loadConfig, saveConfig, setConfigKey };
614
+ export { type AcpAgentConfigEntry, type AgentprotoConfig, type AgentsMdConfig, CONFIG_FILE_PATH, CONFIG_VERSION, type DaemonConfig, type FeaturesConfig, type PairingConfig, type ProfileConfig, type ProvenanceConfig, type ReviewConfig, type SentinelConfig, type SessionsConfig, type SpawnAttachMode, type SpawnConfig, type SpawnDedupeMode, type TerminalPreset, type TitlerConfig, type TunnelConfig, type WorktreeIsolationMode, type WorktreesConfig, getConfigKey, loadConfig, saveConfig, setConfigKey };
package/dist/config.mjs CHANGED
@@ -16,6 +16,7 @@ import '@agentproto/command-sandbox';
16
16
  import '@agentproto/plugin-local-browser';
17
17
  import '@modelcontextprotocol/sdk/types.js';
18
18
  import '@agentproto/provider-kit';
19
+ import '@agentproto/llm-endpoint';
19
20
  import '@modelcontextprotocol/sdk/client/index.js';
20
21
  import '@modelcontextprotocol/sdk/client/streamableHttp.js';
21
22
  import 'net';
@@ -2019,6 +2020,41 @@ var init_canonical_posture = __esm({
2019
2020
  })();
2020
2021
  }
2021
2022
  });
2023
+ var effortSchema, postureSchema, routeSchema, userPresetSchema;
2024
+ var init_user_presets = __esm({
2025
+ "src/user-presets.ts"() {
2026
+ effortSchema = z.enum(["low", "medium", "high", "xhigh", "max", "ultracode"]);
2027
+ postureSchema = z.union([
2028
+ z.enum(["default", "plan", "accept-edits", "bypass", "read-only"]),
2029
+ z.object({ harnessModeId: z.string().min(1) })
2030
+ ]);
2031
+ routeSchema = z.object({
2032
+ gateway: z.string().min(1),
2033
+ baseUrl: z.string().url().optional()
2034
+ });
2035
+ userPresetSchema = z.object({
2036
+ id: z.string().regex(/^[a-z0-9][a-z0-9-]*$/),
2037
+ label: z.string().min(1),
2038
+ adapter: z.string().min(1).optional(),
2039
+ harness: z.string().min(1).optional(),
2040
+ model: z.string().min(1).optional(),
2041
+ route: routeSchema.optional(),
2042
+ access: z.object({ profileRef: z.string().min(1).optional() }).optional(),
2043
+ posture: postureSchema.optional(),
2044
+ effort: effortSchema.optional(),
2045
+ contextProfile: z.string().min(1).optional(),
2046
+ cwd: z.string().min(1).optional(),
2047
+ skills: z.array(z.string().min(1)).optional(),
2048
+ bundles: z.array(z.string().min(1)).optional(),
2049
+ browser: z.union([z.literal("headless"), z.literal(false)]).optional(),
2050
+ lastUsedAt: z.string().min(1).optional()
2051
+ });
2052
+ z.object({
2053
+ version: z.literal(1),
2054
+ presets: z.array(userPresetSchema)
2055
+ });
2056
+ }
2057
+ });
2022
2058
  var harnessPresetSchema;
2023
2059
  var init_harness_preset_store = __esm({
2024
2060
  "src/harness-preset-store.ts"() {
@@ -2119,6 +2155,10 @@ var init_session_title = __esm({
2119
2155
  "src/session-title.ts"() {
2120
2156
  }
2121
2157
  });
2158
+ var init_inference_binding = __esm({
2159
+ "src/inference-binding.ts"() {
2160
+ }
2161
+ });
2122
2162
 
2123
2163
  // src/mcp-credential-deps.ts
2124
2164
  var init_mcp_credential_deps = __esm({
@@ -2183,6 +2223,7 @@ var init_session_spawn = __esm({
2183
2223
  init_catalog_models();
2184
2224
  init_context_continuity();
2185
2225
  init_canonical_posture();
2226
+ init_user_presets();
2186
2227
  init_harness_preset_store();
2187
2228
  init_browser_mount();
2188
2229
  init_role();
@@ -2191,6 +2232,7 @@ var init_session_spawn = __esm({
2191
2232
  init_agents_md();
2192
2233
  init_workspace_rules();
2193
2234
  init_session_title();
2235
+ init_inference_binding();
2194
2236
  init_mcp_credential_deps();
2195
2237
  init_sandbox_agent_session_proxy();
2196
2238
  init_sandbox_ledger();
@@ -2354,6 +2396,16 @@ var init_agent_start_schema = __esm({
2354
2396
  route: jsonTolerant(
2355
2397
  z.object({ gateway: z.string().min(1), baseUrl: z.string().url().optional() })
2356
2398
  ).optional().describe("Billing route/gateway. Independent of `model` and `access`."),
2399
+ inference: jsonTolerant(
2400
+ z.object({
2401
+ endpoint: z.string().min(1).optional().describe('A registered local/LAN inference endpoint id (`agentproto llm endpoints list`), or "<id>@<device>" for a paired device\'s own shared endpoint.'),
2402
+ model: z.string().min(1).optional().describe('A bare model id (paired with `endpoint`), or the shorthand "<model>@<device|endpoint>" when `endpoint` is omitted.'),
2403
+ force: mcpBool.optional().describe("Skip the fit-check refusal on a clear miss (the check still runs and still warns)."),
2404
+ headroomPct: z.number().min(0).max(95).optional().describe("Headroom percentage held back from the endpoint's loaded ctx for the fit check. Default 25.")
2405
+ })
2406
+ ).optional().describe(
2407
+ `Bind this spawn to a local/LAN inference endpoint instead of a cloud model: \`{endpoint}\`, \`{endpoint, model}\`, or the shorthand \`{model: "<model>@<device|endpoint>"}\`. Runs a fit check (the harness's known first-request size vs the endpoint's loaded ctx) BEFORE spawning and refuses with an actionable error on a clear miss (\`force\` overrides). Defaults \`adapter\`/\`harness\` to "pi" when neither is set. Mutually exclusive with \`model\`/\`route\`/\`access\` \u2014 set those directly instead of \`inference\`, never both. ${help("inference")}`
2408
+ ),
2357
2409
  access: jsonTolerant(z.object({ profileRef: z.string().min(1).optional() })).optional().describe("Named auth profile to bill at initial spawn; resolved from the local keychain."),
2358
2410
  posture: z.string().optional().describe("Canonical agent posture (plan, bypass, accept-edits, read-only) or native harness mode."),
2359
2411
  contextProfile: z.string().optional().describe("Context intake profile (for example full or lean)."),
@@ -2492,40 +2544,6 @@ var init_agent_start_schema = __esm({
2492
2544
  agentStartInputSchema.omit({ wait: true });
2493
2545
  }
2494
2546
  });
2495
- var effortSchema, postureSchema, routeSchema, userPresetSchema;
2496
- var init_user_presets = __esm({
2497
- "src/user-presets.ts"() {
2498
- effortSchema = z.enum(["low", "medium", "high", "xhigh", "max", "ultracode"]);
2499
- postureSchema = z.union([
2500
- z.enum(["default", "plan", "accept-edits", "bypass", "read-only"]),
2501
- z.object({ harnessModeId: z.string().min(1) })
2502
- ]);
2503
- routeSchema = z.object({
2504
- gateway: z.string().min(1),
2505
- baseUrl: z.string().url().optional()
2506
- });
2507
- userPresetSchema = z.object({
2508
- id: z.string().regex(/^[a-z0-9][a-z0-9-]*$/),
2509
- label: z.string().min(1),
2510
- adapter: z.string().min(1).optional(),
2511
- harness: z.string().min(1).optional(),
2512
- model: z.string().min(1).optional(),
2513
- route: routeSchema.optional(),
2514
- access: z.object({ profileRef: z.string().min(1).optional() }).optional(),
2515
- posture: postureSchema.optional(),
2516
- effort: effortSchema.optional(),
2517
- contextProfile: z.string().min(1).optional(),
2518
- cwd: z.string().min(1).optional(),
2519
- skills: z.array(z.string().min(1)).optional(),
2520
- bundles: z.array(z.string().min(1)).optional(),
2521
- browser: z.union([z.literal("headless"), z.literal(false)]).optional()
2522
- });
2523
- z.object({
2524
- version: z.literal(1),
2525
- presets: z.array(userPresetSchema)
2526
- });
2527
- }
2528
- });
2529
2547
  var init_catalog_provider_models = __esm({
2530
2548
  "src/catalog-provider-models.ts"() {
2531
2549
  }
@@ -2828,7 +2846,8 @@ var init_config_schema = __esm({
2828
2846
  featuresConfigSchema = z.object({
2829
2847
  pty: z.boolean().optional(),
2830
2848
  llmEndpoint: z.boolean().optional(),
2831
- deviceInferenceShare: z.boolean().optional()
2849
+ deviceInferenceShare: z.boolean().optional(),
2850
+ deviceSpawnAllow: z.boolean().optional()
2832
2851
  }).passthrough();
2833
2852
  worktreesConfigSchema = z.object({
2834
2853
  root: z.string().optional(),
@@ -3675,6 +3694,16 @@ var init_config_schema = __esm({
3675
3694
  label: "Device inference sharing",
3676
3695
  help: "Expose this daemon's local inference endpoint(s) to a paired HOST-scoped controller. Toggle via `agentproto devices share-inference on|off`.",
3677
3696
  default: false
3697
+ },
3698
+ {
3699
+ path: "features.deviceSpawnAllow",
3700
+ schema: bool,
3701
+ apply: "restart",
3702
+ writable: true,
3703
+ section: "daemon",
3704
+ label: "Device spawn allow",
3705
+ help: 'Allow a paired HOST-scoped controller to spawn/drive agent sessions on this daemon (`agent_start({ sandbox: "device:<name>" })`). Toggle via `agentproto devices allow-spawn on|off`.',
3706
+ default: false
3678
3707
  }
3679
3708
  ];
3680
3709
  }