@agentproto/runtime 3.4.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
@@ -5370,6 +5390,14 @@ interface SessionDescriptor {
5370
5390
  * Keys are adapter-specific so future adapters can add their own
5371
5391
  * ("hermesResumeId", etc.) without changing this type. */
5372
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";
5373
5401
  /** Extra env this PTY (`kind: "terminal"`) session was spawned with, on
5374
5402
  * top of `process.env` — e.g. `{ CLAUDE_CONFIG_DIR: "..." }` for a
5375
5403
  * `pty-native` restart of a claude-code session (see
@@ -5710,6 +5738,17 @@ interface SessionSummary {
5710
5738
  origin?: string;
5711
5739
  parentSessionId?: string;
5712
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";
5713
5752
  priorCommandSessionId?: string;
5714
5753
  continuedFrom?: string;
5715
5754
  continuedTo?: string;
@@ -6057,7 +6096,7 @@ interface SessionsRegistry {
6057
6096
  queue?: boolean;
6058
6097
  force?: boolean;
6059
6098
  queueId?: string;
6060
- }): Promise<void>;
6099
+ }): Promise<EnqueuePromptResult>;
6061
6100
  /** Cancel one not-yet-dispatched item in `SessionDescriptor.promptQueue`
6062
6101
  * by id — the composer's per-item "remove" action. Idempotent: an
6063
6102
  * unknown session or an id that's already gone (dispatched, already