@agentproto/runtime 2.10.0 → 2.11.0

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/index.d.ts CHANGED
@@ -557,15 +557,16 @@ interface ToolCallRecord {
557
557
  *
558
558
  * Deliberately dependency-free — a `SessionState`, two pure summarisers, one
559
559
  * regenerate/guard helper — so it can be BOTH:
560
- * - reused verbatim by `summarize_session` (agents-overview-app.ts re-exports
561
- * `summarizeLines` / `deriveSessionState` from here), and
560
+ * - reused verbatim by `summarize_session` (summarize-session-tool.ts
561
+ * imports `summarizeLines` / `deriveSessionState` from here), and
562
562
  * - imported by the session store (sessions.ts) to stamp `activitySummary`
563
563
  * onto the descriptor on turn-end, WITHOUT dragging the overview panel's
564
- * HTML bundle or the MCP-app wiring into the hot session path.
564
+ * HTML bundle (now @agentproto/apps/agents-overview) or the MCP-app
565
+ * wiring into the hot session path.
565
566
  *
566
- * HEURISTIC, no LLM: `@agentproto/runtime` has no inference client (see the
567
- * agents-overview-app.ts header for why a `ModelLike.complete` call is too
568
- * heavy today). `regenerateActivitySummary` is the documented swap point —
567
+ * HEURISTIC, no LLM: `@agentproto/runtime` has no inference client (see
568
+ * summarize-session-tool.ts's header for why a `ModelLike.complete` call is
569
+ * too heavy today). `regenerateActivitySummary` is the documented swap point —
569
570
  * replace its `summarizeLines`/`deriveSessionState` body with a
570
571
  * `ModelLike.complete({ system, prompt })` call to upgrade the line to a
571
572
  * semantic one; the trigger + `renamedByUser` guard contract and the
@@ -4924,6 +4925,16 @@ interface SessionDescriptor {
4924
4925
  * may name a gateway route.
4925
4926
  */
4926
4927
  adapterProvider?: string;
4928
+ /**
4929
+ * The adapter manifest's `authDescriptor.modelDerivedApiKey` — recorded at
4930
+ * spawn time so a live `setModel` applies the SAME wire normalization the
4931
+ * spawn path used (`normalizeModelForWire`'s `ModelWireOptions.modelDerivedApiKey`
4932
+ * doc): for a `derived-from-model` adapter billed through a gateway/router,
4933
+ * this decides whether the wire model needs the router re-added as a
4934
+ * literal leading segment (opencode/mastracode/jcode/pi/mastra-agent) or
4935
+ * left bare (hermes).
4936
+ */
4937
+ modelDerivedApiKey?: boolean;
4927
4938
  /**
4928
4939
  * AIP-45 mode the session was spawned with (`AgentCliStartOptions.config.
4929
4940
  * mode` — e.g. claude-code's `plan`/`accept-edits`, a gateway preset mode
@@ -6240,6 +6251,10 @@ interface SpawnAgentInput {
6240
6251
  * {@link SessionDescriptor.adapterProvider} so live `setModel` knows when
6241
6252
  * to bare a direct `vendor/product` ref; ignored for derived adapters. */
6242
6253
  adapterProvider?: string;
6254
+ /** Manifest-declared `authDescriptor.modelDerivedApiKey` — recorded onto
6255
+ * {@link SessionDescriptor.modelDerivedApiKey} so live `setModel` applies
6256
+ * the same router re-prefixing the spawn path used. */
6257
+ modelDerivedApiKey?: boolean;
6243
6258
  /** Optional initial prompt to dispatch immediately. The promise
6244
6259
  * the registry returns resolves AFTER the spawn — the prompt
6245
6260
  * runs in the background, projecting events into the ring
@@ -6337,6 +6352,7 @@ interface SpawnAgentInput {
6337
6352
  * reads its state.db keyed by the adapter session id). Omit for adapters
6338
6353
  * with no usage source. */
6339
6354
  readUsage?: () => Promise<{
6355
+ model?: string;
6340
6356
  costUsd?: number;
6341
6357
  tokensIn?: number;
6342
6358
  tokensOut?: number;
@@ -6386,6 +6402,7 @@ type PendingAgentOutcome = {
6386
6402
  resumable?: boolean;
6387
6403
  nativeTerminalResume?: boolean;
6388
6404
  readUsage?: () => Promise<{
6405
+ model?: string;
6389
6406
  costUsd?: number;
6390
6407
  tokensIn?: number;
6391
6408
  tokensOut?: number;
@@ -6767,6 +6784,7 @@ interface ReconcilerSession extends FooterSession {
6767
6784
  worktreePath?: string;
6768
6785
  openedPrs?: readonly {
6769
6786
  url: string;
6787
+ number?: number;
6770
6788
  }[];
6771
6789
  }
6772
6790
  /** The registry slice the reconciler needs — structurally satisfied by the full
@@ -8489,6 +8507,10 @@ interface RouteAwareLaunchConfigInput {
8489
8507
  routeSelection?: "free" | "derived-from-model";
8490
8508
  /** Fixed provider for this adapter (e.g. `"anthropic"`), used for wire-model prefix stripping. */
8491
8509
  adapterProvider?: string;
8510
+ /** `AdapterAuthDescriptor.modelDerivedApiKey` — see `normalizeModelForWire`'s
8511
+ * `ModelWireOptions.modelDerivedApiKey` doc for why this changes the wire
8512
+ * shape on a gateway-routed `derived-from-model` adapter. */
8513
+ modelDerivedApiKey?: boolean;
8492
8514
  /** Skills list folded into `options.skills` per the manifest's declared shape. */
8493
8515
  skills?: string[];
8494
8516
  /**