@agentproto/runtime 3.3.0 → 3.5.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
@@ -13,8 +13,8 @@ export { CostBudget, CostBudgetScope } from '@agentproto/auth';
13
13
  import { R as ResolvedContextContinuityPolicy } from './context-continuity-ib9_bVYM.js';
14
14
  import { SandboxMode } from '@agentproto/command-sandbox';
15
15
  import { AdapterHandle, SetupField, AdapterResolver, AdapterLister, CredsStore, HarnessCapabilities, AdapterEntry } from '@agentproto/provider-kit';
16
- import { R as ResolvedAuthSpec, D as DeclaredAdapterOption, A as AdapterAuthDescriptor } from './spawn-defaults-D4W661ui.js';
17
- export { a as AuthEcho, b as AuthResolutionError, C as CLAUDE_CODE_OAUTH_SOURCE, c as CredentialSource, d as DefaultsAdapterAuthConfig, e as DefaultsAdapterConfig, f as ResolveSubscriptionCredentialInput, g as ResolvedSpawnAuthMaterial, h as ResolvedSpawnDefaults, S as SpawnDefaultsConfig, i as SubscriptionCredentialResolution, j as SubscriptionSourceError, k as credentialFingerprint, n as normalizeSkillsOption, r as resolveAuthSpec, l as resolveSpawnDefaults, m as resolveSubscriptionCredential } from './spawn-defaults-D4W661ui.js';
16
+ import { R as ResolvedAuthSpec, D as DeclaredAdapterOption, A as AdapterAuthDescriptor } from './spawn-defaults-CwI9Puwy.js';
17
+ export { a as AuthEcho, b as AuthResolutionError, C as CLAUDE_CODE_OAUTH_SOURCE, c as CredentialSource, d as DefaultsAdapterAuthConfig, e as DefaultsAdapterConfig, f as ResolveSubscriptionCredentialInput, g as ResolvedSpawnAuthMaterial, h as ResolvedSpawnDefaults, S as SpawnDefaultsConfig, i as SubscriptionCredentialResolution, j as SubscriptionSourceError, k as credentialFingerprint, n as normalizeSkillsOption, r as resolveAuthSpec, l as resolveSpawnDefaults, m as resolveSubscriptionCredential } from './spawn-defaults-CwI9Puwy.js';
18
18
  import { CatalogModelsQuery, CatalogModelsResponse } from './catalog-models.js';
19
19
  export { CatalogAdapterInput, CatalogAdapterModelInput, CatalogPricing, CatalogProduct, CatalogRoute, CatalogRouteSummary, CatalogVendor, buildCatalogModels } from './catalog-models.js';
20
20
  import { FooterSession } from './pr-provenance.js';
@@ -3010,7 +3010,7 @@ interface InboundMessage {
3010
3010
  type InboundEnqueuePrompt = (sessionId: string, text: string, opts?: {
3011
3011
  interrupt?: boolean;
3012
3012
  queue?: boolean;
3013
- }) => Promise<void> | void;
3013
+ }) => Promise<unknown> | void;
3014
3014
  /** Whether `sessionId` is currently live enough to route into without a
3015
3015
  * restart first. */
3016
3016
  type InboundIsSessionAlive = (sessionId: string) => boolean;
@@ -3331,6 +3331,12 @@ interface OrchestratorGatewayDeps {
3331
3331
  * spawn is rejected with `sandbox_provider_not_found`, exactly as the
3332
3332
  * root gateway would be without it. */
3333
3333
  resolveSandboxProvider?: SandboxProviderResolver;
3334
+ /** Forwarded to `registerSessionTools` — config.json
3335
+ * `defaults.agentPromptInterrupt`, the unset-default for `interrupt` on
3336
+ * `agent_prompt` / `message_parent`. Threaded here so a child driving its
3337
+ * parent/peers (or reporting up via `message_parent`) through this scoped
3338
+ * gateway honours the same daemon default as the root `/mcp` surface. */
3339
+ defaultAgentPromptInterrupt?: boolean;
3334
3340
  }
3335
3341
  type OrchestratorMcpServerFactory = (scope: OrchestratorScope) => Promise<McpServer>;
3336
3342
  /**
@@ -4727,6 +4733,16 @@ interface QueuedPrompt {
4727
4733
  * falls back to `source`, then `"user"`. */
4728
4734
  origin?: string;
4729
4735
  }
4736
+ /** What `enqueuePrompt` resolved to — lets a caller (e.g. MCP `agent_prompt`)
4737
+ * tell the user whether the prompt was delivered/started now or PARKED behind
4738
+ * an in-flight turn. `queued: true` fires ONLY on the mid-turn queue arm
4739
+ * (`opts.queue` true, session busy, no `interrupt`): the prompt sits in
4740
+ * `promptQueue` and won't run until the current turn ends. Every other path —
4741
+ * idle dispatch, an interrupt that redirected the live turn, a structured-
4742
+ * question answer — resolves `queued: false`. */
4743
+ interface EnqueuePromptResult {
4744
+ queued: boolean;
4745
+ }
4730
4746
  /** One entry in the after-the-fact queue listing (`listQueuedPrompts` /
4731
4747
  * `session_queue_list` / `GET /sessions/:id/queue`). `position` is the
4732
4748
  * array index (0 = next to dispatch). */
@@ -5165,8 +5181,12 @@ interface SessionDescriptor {
5165
5181
  * so a restarted daemon can still show the hand-off / review links. */
5166
5182
  openedPrs?: readonly OpenedPullRequest[];
5167
5183
  /** Adapter slug for agent-cli sessions — restart uses this with
5168
- * `/sessions/agent` to spin up a fresh ACP runtime. Undefined for
5169
- * pty/command kinds. */
5184
+ * `/sessions/agent` to spin up a fresh ACP runtime. ALSO stamped on a
5185
+ * conversation-terminal PTY (`isConversationTerminal` — a native
5186
+ * provider TUI launch like `claude`, classified at `spawnPty`), so the
5187
+ * Sessions list, the link probe, and the harness switch know which
5188
+ * provider the terminal is. Undefined for plain-shell PTYs and command
5189
+ * kinds. */
5170
5190
  adapterSlug?: string;
5171
5191
  /** Manifest-declared `capabilities.resumable` for this session's adapter
5172
5192
  * (AIP-45), stamped from {@link AgentAdapterResolver}'s resolved
@@ -5260,6 +5280,15 @@ interface SessionDescriptor {
5260
5280
  * posture or a raw `{ harnessModeId }` sourced from the harness's ACP mode
5261
5281
  * registry (SPEC §3.4a). */
5262
5282
  posture?: Posture;
5283
+ /**
5284
+ * Read-surface echo of the live harness's advertised ACP session modes
5285
+ * (`SessionModeState.availableModes`, #482) — stamped at READ TIME from the
5286
+ * live agent session by `list()`/`get()`, never persisted. A client posture
5287
+ * picker resolves the native (enforced, live-switchable) rows from this;
5288
+ * absent for arms with no native mode registry (print/proprietary) and for a
5289
+ * session whose live runtime handle is gone.
5290
+ */
5291
+ availableModes?: SessionMode[];
5263
5292
  /** Endpoint / gateway rail (SPEC §3.1 axis 4). `baseUrl` is carried only
5264
5293
  * for a custom gateway the catalog can't resolve; `access` is downstream
5265
5294
  * of this axis (SPEC §1c). */
@@ -5361,6 +5390,14 @@ interface SessionDescriptor {
5361
5390
  * Keys are adapter-specific so future adapters can add their own
5362
5391
  * ("hermesResumeId", etc.) without changing this type. */
5363
5392
  resumeMetadata?: Record<string, string>;
5393
+ /** Conversation-terminal link probe verdict — `"ambiguous"` when MORE
5394
+ * than one fresh native transcript matched this PTY's cwd + start time,
5395
+ * so the daemon refused to bind any of them (never bind a sibling —
5396
+ * same invariant as the fs-probe's exact-bind rule). Absent while the
5397
+ * probe is still looking, and cleared once an unambiguous link lands
5398
+ * (`adapterSessionId` + `resumeMetadata`). Only ever set on
5399
+ * conversation-terminal rows (`isConversationTerminal`). */
5400
+ linkStatus?: "ambiguous";
5364
5401
  /** Extra env this PTY (`kind: "terminal"`) session was spawned with, on
5365
5402
  * top of `process.env` — e.g. `{ CLAUDE_CONFIG_DIR: "..." }` for a
5366
5403
  * `pty-native` restart of a claude-code session (see
@@ -5701,6 +5738,17 @@ interface SessionSummary {
5701
5738
  origin?: string;
5702
5739
  parentSessionId?: string;
5703
5740
  depth?: number;
5741
+ /**
5742
+ * Server-computed Sessions-panel lane verdict, stamped by `listSummaries`
5743
+ * against the daemon's FULL in-memory session map (archived and dead
5744
+ * parents included) — so a client paging summaries never has to re-derive
5745
+ * lineage from whatever happens to be on its current page, and a row's
5746
+ * lane cannot flip between page 1 and page N. Absent on shell-only rows
5747
+ * (`isShellOnlyRow` — plain-shell PTYs and command rows belong to the
5748
+ * Activity panel, not either lane; a conversation terminal DOES get a
5749
+ * lane) and on rows from older daemons.
5750
+ */
5751
+ lane?: "agents" | "auto";
5704
5752
  priorCommandSessionId?: string;
5705
5753
  continuedFrom?: string;
5706
5754
  continuedTo?: string;
@@ -6048,7 +6096,7 @@ interface SessionsRegistry {
6048
6096
  queue?: boolean;
6049
6097
  force?: boolean;
6050
6098
  queueId?: string;
6051
- }): Promise<void>;
6099
+ }): Promise<EnqueuePromptResult>;
6052
6100
  /** Cancel one not-yet-dispatched item in `SessionDescriptor.promptQueue`
6053
6101
  * by id — the composer's per-item "remove" action. Idempotent: an
6054
6102
  * unknown session or an id that's already gone (dispatched, already
@@ -6227,6 +6275,7 @@ interface SessionsRegistry {
6227
6275
  */
6228
6276
  listSummaries(opts?: {
6229
6277
  includeArchived?: boolean;
6278
+ lane?: "agents" | "auto";
6230
6279
  limit?: number;
6231
6280
  offset?: number;
6232
6281
  }): {
@@ -7533,14 +7582,17 @@ declare function registerBuiltinRoutes(opts?: {
7533
7582
  * kind-organized catalogs, so NO adapters, NO profiles, NO host wiring.
7534
7583
  * `getModelsByProvider` is itself router-aware: OpenRouter's route table is
7535
7584
  * spread into `LLM_PRICING_CATALOG` upstream (`llm/catalog.ts`), so an
7536
- * `openrouter` query returns that full, large list with bare ids; Requesty
7537
- * and HuggingFace are NOT spread into that catalog — spreading a second
7538
- * router's bare-id pricing there would repoint direct-vendor ids at router
7539
- * pricing (`route-identity/index.ts`) — so `getModelsByProvider` instead
7540
- * folds their generated route tables in directly, emitting `vendor/
7541
- * product@route` ids. All three routers enumerate through the same path;
7542
- * the picker paginates client-side. NEVER log the rows: OpenRouter alone is
7543
- * thousands.
7585
+ * `openrouter` query returns that full, large list with bare ids; Requesty,
7586
+ * HuggingFace and OpenCode's two hosted endpoints (`opencode-go`,
7587
+ * `opencode`) are NOT spread into that catalog — spreading a second router's
7588
+ * bare-id pricing there would repoint direct-vendor ids at router pricing
7589
+ * (`route-identity/index.ts`) — so `getModelsByProvider` instead folds their
7590
+ * generated route tables in directly. The emitted id is whatever the ref
7591
+ * formats to: `vendor/product@route` for the vendor-namespacing routers, and
7592
+ * the bare `opencode-go/glm-5.3` form for the OpenCode endpoints, whose route
7593
+ * IS the id's leading segment. Every provider enumerates through the same
7594
+ * path; the picker paginates client-side. NEVER log the rows: OpenRouter
7595
+ * alone is thousands.
7544
7596
  */
7545
7597
 
7546
7598
  interface CatalogProviderModelsQuery {