@agentproto/runtime 5.6.0 → 5.8.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
@@ -3,8 +3,8 @@ import { h as WorktreeIsolationMode, i as SpawnAttachMode, j as SpawnDedupeMode,
3
3
  export { k as DEFAULT_MODEL_ROLES, M as MODEL_ROLE_REF_PREFIX, l as ModelRoleContext, m as ModelRoleEntry, n as ModelRoleSource, o as ModelRoleValue, p as ModelRolesConfig, q as listModelRoles, r as parseModelRoleRef, s as resolveModelRole } from './config-Gz7q9yfJ.js';
4
4
  import { B as BuildHeartbeatAgent } from './heartbeat-BJtxbDb9.js';
5
5
  export { H as HeartbeatAgent, a as HeartbeatRunner, R as RuntimeEvent, b as RuntimeEvents, p as parseDuration } from './heartbeat-BJtxbDb9.js';
6
- import { M as MessageUrgency, S as SessionEvent, a as SessionEventType, b as SessionEventBus, c as SessionsRegistry, C as CompletionPolicySupervisor, T as TaskLedger, d as SessionDescriptor, e as SessionEndReason, A as ActivityPolicySlice, f as ActivityListFilter, g as ActivityRecord, h as ActivityTurnSession, i as ActivityPrSession, j as ActivityWorkflowRunSlice, P as PrResolvedState, k as ActivityTaskSlice, W as WorktreeProvisioner, l as AgentsMdResolution, U as UserPreset, R as RestartPolicy, m as SandboxAppServeSpec, n as WorktreeField, o as AgentSessionLike, p as UsageReadContext, q as UsageReadResult, r as MessageKind, s as SessionMessage, t as AgentStreamEvent, u as SessionUsage, v as ToolCallRecord, w as StatsSessionDescriptor, x as ProcRow, y as ProvisionInFlight, z as ProvisionTracker, B as UsageRollup, D as RemainingQuotaReader, Q as QuotaReadableProfile, E as UsageSnapshotRecord, F as SessionAwaitingQuestion, G as PolicyRunState, H as PtyFactory, I as WorktreeAutoReclaimer } from './sessions-DMzCgTVy.js';
7
- export { J as ActivityKind, K as ActivitySource, L as ActivityState, N as ActivityWaitingOn, O as AnthropicReaderConfig, V as AnthropicRemainingQuotaReader, X as AttachPolicyInput, Y as CommandGroupStats, Z as CommitSpec, _ as DEFAULT_WORKTREE_ISOLATION, $ as DEFAULT_WORKTREE_PROVISION_CONCURRENCY, a0 as EagerResumeFailReason, a1 as EagerResumeOutcome, a2 as EagerResumeSkipReason, a3 as GateSpec, a4 as HostInfo, a5 as JudgeGateSpec, a6 as LabeledProcessStatsReport, a7 as LabeledSessionStats, a8 as MAX_MESSAGE_DATA_BYTES, a9 as MESSAGE_KINDS, aa as MESSAGE_PREAMBLE, ab as MESSAGE_TAG, ac as MESSAGE_URGENCIES, ad as MessageDeliveryVia, ae as MessageFilter, af as MessageRelation, ag as MessageTreeNode, ah as OnFailSpec, ai as OrphanGroup, aj as PendingPermission, ak as PermissionRespondInput, al as PermissionRespondResult, am as PolicyRunStatus, an as PricingResolver, ao as ProcessDetail, ap as ProcessStatsReport, aq as ProcessStatsService, ar as QuotaStoreFile, as as QuotaStoreOptions, at as RegisterBrowserInput, au as RegisterSessionInput, av as RemainingQuota, aw as ResourceStats, ax as ResumeDisabledError, ay as SESSION_END_REASONS, az as SESSION_ID_ENV, aA as SessionCurrentPhase, aB as SessionKind, aC as SessionMessageFrom, aD as SessionOutcome, aE as SessionOutcomeArtifact, aF as SessionOutcomeCompact, aG as SessionOutcomeLink, aH as SessionResourceStats, aI as SessionSnapshots, aJ as SessionStatus, aK as ShellGateSpec, aL as SpawnAgentInput, aM as SpawnSessionInput, aN as StatsDetail, aO as StoredProfileQuota, aP as TASK_STATUSES, aQ as TaskCaller, aR as TaskChangedEvent, aS as TaskClaimInput, aT as TaskCreateInput, aU as TaskGateOutcome, aV as TaskGateRunner, aW as TaskLedgerRegistry, aX as TaskLedgerSessionSlice, aY as TaskListFilter, aZ as TaskRecord, a_ as TaskStatus, a$ as TaskUpdateInput, b0 as TaskVerification, b1 as TaskVerifySupervisor, b2 as TaskWriteResult, b3 as TokenPricing, b4 as UsageBucket, b5 as UsageComputeInput, b6 as UsageDetail, b7 as UsageSource, b8 as UserPresetsFile, b9 as WORKSPACE_SLUG_ENV, ba as WORKTREE_ISOLATION_ENV, bb as WORKTREE_PROVISION_CONCURRENCY_ENV, bc as WorktreeDecision, bd as WorktreeProvisionOutcome, be as WorktreeProvisionPhase, bf as WorktreeProvisionProgress, bg as WorktreeProvisionRequest, bh as WorktreeRequest, bi as activityCounts, bj as compactOutcome, bk as createProcessStatsService, bl as createSessionMessage, bm as createSupervisorTaskGateRunner, bn as createTaskLedger, bo as decideWorktreeIsolation, bp as deleteUserPreset, bq as deriveSessionOutcome, br as deriveSessionUsage, bs as escapeHumanPrompt, bt as escapeMessageBody, bu as filterActivities, bv as getProcessStatsService, bw as getUserPreset, bx as isClosedTaskStatus, by as isKnownSessionEndReason, bz as isMessageAllowed, bA as isProviderLimitError, bB as isTerminalActivityState, bC as listUserPresets, bD as loadQuotaStore, bE as loadUserPresets, bF as loadWorktreeIsolation, bG as matchesMessageFilter, bH as messageFrom, bI as mintMessageId, bJ as normalizeCommand, bK as normalizeWorktreeField, bL as parseAnthropicRateLimitHeaders, bM as parseTaskStatus, bN as parseWindow, bO as parseWorktreeIsolationMode, bP as pickUsageDetail, bQ as policyToActivities, bR as policyWatchesSession, bS as prToActivities, bT as projectSessionUsage, bU as readProfileQuota, bV as recordProfileQuota, bW as renderInboxDigest, bX as renderSessionMessage, bY as renderSessionMessages, bZ as resolveRelation, b_ as rollupUsage, b$ as sanitizeLabel, c0 as saveUserPreset, c1 as trackWorktreeProvision, c2 as turnToActivities, c3 as userPresetsPath, c4 as workflowToActivities } from './sessions-DMzCgTVy.js';
6
+ import { M as MessageUrgency, S as SessionEvent, a as SessionEventType, b as SessionEventBus, c as SessionsRegistry, C as CompletionPolicySupervisor, T as TaskLedger, d as SessionDescriptor, e as SessionEndReason, A as ActivityPolicySlice, f as ActivityListFilter, g as ActivityRecord, h as ActivityTurnSession, i as ActivityPrSession, j as ActivityWorkflowRunSlice, P as PrResolvedState, k as ActivityTaskSlice, W as WorktreeProvisioner, l as AgentsMdResolution, U as UserPreset, R as RestartPolicy, m as SandboxAppServeSpec, n as WorktreeField, o as AgentSessionLike, p as UsageReadContext, q as UsageReadResult, r as MessageKind, s as SessionMessage, t as AgentStreamEvent, u as SessionUsage, v as ToolCallRecord, w as StatsSessionDescriptor, x as ProcRow, y as ProvisionInFlight, z as ProvisionTracker, B as UsageRollup, D as RemainingQuotaReader, Q as QuotaReadableProfile, E as UsageSnapshotRecord, F as SessionAwaitingQuestion, G as PolicyRunState, H as PtyFactory, I as WorktreeAutoReclaimer } from './sessions-SrISpFsH.js';
7
+ export { J as ActivityKind, K as ActivitySource, L as ActivityState, N as ActivityWaitingOn, O as AnthropicReaderConfig, V as AnthropicRemainingQuotaReader, X as AttachPolicyInput, Y as CommandGroupStats, Z as CommitSpec, _ as DEFAULT_WORKTREE_ISOLATION, $ as DEFAULT_WORKTREE_PROVISION_CONCURRENCY, a0 as EagerResumeFailReason, a1 as EagerResumeOutcome, a2 as EagerResumeSkipReason, a3 as GateSpec, a4 as HostInfo, a5 as JudgeGateSpec, a6 as LabeledProcessStatsReport, a7 as LabeledSessionStats, a8 as MAX_MESSAGE_DATA_BYTES, a9 as MESSAGE_KINDS, aa as MESSAGE_PREAMBLE, ab as MESSAGE_TAG, ac as MESSAGE_URGENCIES, ad as MessageDeliveryVia, ae as MessageFilter, af as MessageRelation, ag as MessageTreeNode, ah as OnFailSpec, ai as OrphanGroup, aj as PendingPermission, ak as PermissionRespondInput, al as PermissionRespondResult, am as PolicyRunStatus, an as PricingResolver, ao as ProcessDetail, ap as ProcessStatsReport, aq as ProcessStatsService, ar as QuotaStoreFile, as as QuotaStoreOptions, at as RegisterBrowserInput, au as RegisterSessionInput, av as RemainingQuota, aw as ResourceStats, ax as ResumeDisabledError, ay as SESSION_END_REASONS, az as SESSION_ID_ENV, aA as SessionCurrentPhase, aB as SessionKind, aC as SessionMessageFrom, aD as SessionOutcome, aE as SessionOutcomeArtifact, aF as SessionOutcomeCompact, aG as SessionOutcomeLink, aH as SessionResourceStats, aI as SessionSnapshots, aJ as SessionStatus, aK as ShellGateSpec, aL as SpawnAgentInput, aM as SpawnSessionInput, aN as StatsDetail, aO as StoredProfileQuota, aP as TASK_STATUSES, aQ as TaskCaller, aR as TaskChangedEvent, aS as TaskClaimInput, aT as TaskCreateInput, aU as TaskGateOutcome, aV as TaskGateRunner, aW as TaskLedgerRegistry, aX as TaskLedgerSessionSlice, aY as TaskListFilter, aZ as TaskRecord, a_ as TaskStatus, a$ as TaskUpdateInput, b0 as TaskVerification, b1 as TaskVerifySupervisor, b2 as TaskWriteResult, b3 as TokenPricing, b4 as UsageBucket, b5 as UsageComputeInput, b6 as UsageDetail, b7 as UsageSource, b8 as UserPresetsFile, b9 as WORKSPACE_SLUG_ENV, ba as WORKTREE_ISOLATION_ENV, bb as WORKTREE_PROVISION_CONCURRENCY_ENV, bc as WorktreeDecision, bd as WorktreeProvisionOutcome, be as WorktreeProvisionPhase, bf as WorktreeProvisionProgress, bg as WorktreeProvisionRequest, bh as WorktreeRequest, bi as activityCounts, bj as compactOutcome, bk as createProcessStatsService, bl as createSessionMessage, bm as createSupervisorTaskGateRunner, bn as createTaskLedger, bo as decideWorktreeIsolation, bp as deleteUserPreset, bq as deriveSessionOutcome, br as deriveSessionUsage, bs as escapeHumanPrompt, bt as escapeMessageBody, bu as filterActivities, bv as getProcessStatsService, bw as getUserPreset, bx as isClosedTaskStatus, by as isKnownSessionEndReason, bz as isMessageAllowed, bA as isProviderLimitError, bB as isTerminalActivityState, bC as listUserPresets, bD as loadQuotaStore, bE as loadUserPresets, bF as loadWorktreeIsolation, bG as matchesMessageFilter, bH as messageFrom, bI as mintMessageId, bJ as normalizeCommand, bK as normalizeWorktreeField, bL as parseAnthropicRateLimitHeaders, bM as parseTaskStatus, bN as parseWindow, bO as parseWorktreeIsolationMode, bP as pickUsageDetail, bQ as policyToActivities, bR as policyWatchesSession, bS as prToActivities, bT as projectSessionUsage, bU as readProfileQuota, bV as recordProfileQuota, bW as renderInboxDigest, bX as renderSessionMessage, bY as renderSessionMessages, bZ as resolveRelation, b_ as rollupUsage, b$ as sanitizeLabel, c0 as saveUserPreset, c1 as trackWorktreeProvision, c2 as turnToActivities, c3 as userPresetsPath, c4 as workflowToActivities } from './sessions-SrISpFsH.js';
8
8
  import { R as RouteSpec, P as Posture, C as ContextProfile, a as CanonicalPosture } from './session-config-DxIIuJFY.js';
9
9
  export { A as AuthMethod, D as DeclaredAdapterMode, E as EffortLevel, S as SessionConfig, c as composeMode, d as decomposeMode } from './session-config-DxIIuJFY.js';
10
10
  import { AcpMcpServer } from '@agentproto/acp';
@@ -328,6 +328,46 @@ declare class TunnelRegistry {
328
328
  * here rather than the other way around.
329
329
  */
330
330
 
331
+ /**
332
+ * One normalized immutable fact, emitted by a provider and landed into a
333
+ * session's inbox. CloudEvents 1.0 structured JSON plus agentproto extension
334
+ * attributes (`summary`, `subjects`, `terminal`, `consumerref`, `seq`).
335
+ *
336
+ * `type` grammar: `<scheme>.<object>.<action>` (e.g.
337
+ * `github.pull_request.closed`). `subject` grammar: `<scheme>:<path>` (e.g.
338
+ * `github:agentproto/ts#1428`). `subjects` is the full hierarchy, most
339
+ * specific first — a sentinel `subject` ending in `*` prefix-matches it.
340
+ */
341
+ interface SentinelEvent {
342
+ readonly specversion: "1.0";
343
+ /** Stable across retries/redeliveries. Idempotency key is `(sentinelId,
344
+ * event.id)` — unaffected by `SentinelSpec.match` fan-out: an event that
345
+ * happens to satisfy more than one match clause on the same sentinel is
346
+ * still landed at most once. */
347
+ readonly id: string;
348
+ /** URI naming the provider instance that emitted this event. */
349
+ readonly source: string;
350
+ readonly type: string;
351
+ /** Primary (most specific) subject this event is filed under. */
352
+ readonly subject: string;
353
+ /** ISO-8601. */
354
+ readonly time: string;
355
+ readonly datacontenttype: "application/json";
356
+ /** Normalized projection, <= 32 KiB. Raw provider payloads never appear
357
+ * here. */
358
+ readonly data: Record<string, unknown>;
359
+ /** One line, used verbatim as inbox text (after a `[<scheme>]` prefix). */
360
+ readonly summary: string;
361
+ /** Full subject hierarchy, most specific first. */
362
+ readonly subjects: readonly string[];
363
+ /** Ends the subject's lifecycle when `spec.until.kind === "subject_terminal"`. */
364
+ readonly terminal: boolean;
365
+ /** Opaque consumer reference the provider was asked to stamp (agentpush's
366
+ * `consumerRef`), when applicable. */
367
+ readonly consumerref?: string;
368
+ /** Monotonic sequence, when the provider assigns one. */
369
+ readonly seq?: number;
370
+ }
331
371
  /** When a sentinel stops watching. */
332
372
  type SentinelUntil = {
333
373
  kind: "subject_terminal";
@@ -415,6 +455,14 @@ interface SentinelSpec {
415
455
  * Writes are atomic (write to a per-process tmp file, then rename), same
416
456
  * idiom as `sandbox-ledger.ts` — a crash mid-write must never leave a
417
457
  * corrupt `sentinels.json` behind.
458
+ *
459
+ * Secret-at-rest (W-B): a `webhook` target's signing secret never lives
460
+ * inside the `Sentinel` record (whose `spec` is echoed verbatim by views) —
461
+ * it is kept in a sidecar row keyed by an opaque `secretRef` handle,
462
+ * persisted to `sentinels-secrets.json` next to `sentinels.json` with the
463
+ * SAME 0600 plaintext-at-rest tradeoff every other credential store in this
464
+ * runtime commits to (`handle.state`, `makeCredsStore` family files). Keys
465
+ * are never logged; the delivery path is the only consumer of the sidecar.
418
466
  */
419
467
 
420
468
  type SentinelStatus = "active" | "paused" | "expired" | "orphaned" | "error";
@@ -2153,6 +2201,12 @@ interface SpawnAgentSessionDeps {
2153
2201
  * tool and HTTP route each have their own "not enabled" response
2154
2202
  * shape for the missing-resolver case). */
2155
2203
  resolveAgentAdapter: AgentAdapterResolver;
2204
+ /** Installed-adapter lister — ONLY used to enumerate the valid slugs in
2205
+ * the generic `adapter_not_found` error, so a genuinely unknown adapter
2206
+ * name names what IS installed instead of just saying "install it".
2207
+ * Omitted ⇒ the error keeps its previous wording. Mirrors
2208
+ * `CronAdapterCheckDeps.listAgentAdapters` (cron's create-time check). */
2209
+ listAgentAdapters?: AgentAdapterLister;
2156
2210
  /** Optional orchestrator-injection builder (WP3). See
2157
2211
  * `RegisterAgentToolsOptions.buildOrchestratorMcp` for the full
2158
2212
  * contract. Omitted → `orchestrator` is rejected with
@@ -2274,6 +2328,21 @@ interface SpawnAgentSessionInput {
2274
2328
  harness?: string;
2275
2329
  cwd?: string;
2276
2330
  workspaceSlug?: string;
2331
+ /** CONTROLLER-side marker (issue #1647): set ONLY by the device-sandbox
2332
+ * proxy path when the controller dials the TARGET daemon's own
2333
+ * `agent_start` through the `/device-spawn` bridge (the bridge carries
2334
+ * no ambient marker paths — the controller-side spawn already knows
2335
+ * which spawns cross a device). On the TARGET daemon this marks the
2336
+ * spawn as arriving "through the bridge", so an unresolvable
2337
+ * `workspaceSlug` there fails loudly with the slug + the target's known
2338
+ * slugs instead of silently falling through to the active workspace.
2339
+ * NEVER set (never expose) on a local spawn — local fallback semantics
2340
+ * are deliberately unchanged. Stripped by the controller before the
2341
+ * inner `agent_start` call (the target's own schema has no such field;
2342
+ * an unknown extra key there would 400 an otherwise-fine spawn). Controller
2343
+ * input arriving with this field is consumed immediately (read + delete,
2344
+ * never an error) so it can't leak into spawn defaults or the registry. */
2345
+ deviceBridge?: boolean;
2277
2346
  /** Trusted-loopback parent-lineage hint (WP-R1). Attributes this spawn to a
2278
2347
  * logical parent session so it nests under that node in the sessions tree,
2279
2348
  * filling the gap that otherwise leaves an anonymous `agent_start` (an
@@ -3756,6 +3825,10 @@ type GhRunner$1 = (args: readonly string[], cwd: string) => Promise<{
3756
3825
  * B. BRANCH — resolve the OPEN PR for the session cwd's current branch
3757
3826
  * (via the injected {@link OpenPrResolver} port), the fallback for
3758
3827
  * adapters whose tool calls aren't recorded.
3828
+ * C. TEXTUAL — pull-request urls mentioned in the session's own assistant
3829
+ * output (bounded transcript-tail scan); records on `openedPrs`
3830
+ * (adapter "output-scan") but never stamps a footer — a mention is
3831
+ * not proof of creation.
3759
3832
  *
3760
3833
  * Turn-end/exit are only poll checkpoints, never an assertion the PR is
3761
3834
  * ready: the real predicate is "did this session create a PR / does an open
@@ -3792,6 +3865,10 @@ interface ReconcilerSession extends FooterSession {
3792
3865
  url: string;
3793
3866
  number?: number;
3794
3867
  }[];
3868
+ /** Ephemeral transcript path the live registry stamps on every read
3869
+ * (see `SessionDescriptor.eventsPath`); lane C's bounded tail read
3870
+ * needs it. Absent from test fakes without a transcript on disk. */
3871
+ eventsPath?: string;
3795
3872
  }
3796
3873
  /** The registry slice the reconciler needs — structurally satisfied by the full
3797
3874
  * `SessionsRegistry`, and by a trivial fake in tests. It is also a valid
@@ -6404,15 +6481,28 @@ declare function readUsageSnapshots(sessionId: string, baseDir?: string): Promis
6404
6481
  * method, since sentinel creation also needs the provider handle.
6405
6482
  */
6406
6483
 
6484
+ /** The wire view of a target: for a `webhook` target this is the REDACTED
6485
+ * shape — `url` yes, plus `hasSecret:true`/`secretRedacted:true`. The
6486
+ * secret material (or even its `secretRef` handle) NEVER crosses a
6487
+ * listing/get view (plan §4 W-B task 4 — code-verified leak closed here). */
6488
+ type SentinelTargetView = Exclude<SentinelTarget, {
6489
+ kind: "webhook";
6490
+ }> | {
6491
+ kind: "webhook";
6492
+ url: string;
6493
+ hasSecret: true;
6494
+ secretRedacted: true;
6495
+ };
6407
6496
  /** Compact wire view of a sentinel for tool/HTTP results — the internal-only
6408
- * fields (`handle`, `seen`, `terminalSubjects`) never leave the daemon. */
6497
+ * fields (`handle`, `seen`, `terminalSubjects`) and any secret material
6498
+ * never leave the daemon. */
6409
6499
  interface SentinelView {
6410
6500
  id: string;
6411
6501
  provider: string;
6412
6502
  status: SentinelStatus;
6413
6503
  match: SentinelMatchClause[];
6414
6504
  until: SentinelUntil;
6415
- target: SentinelTarget;
6505
+ target: SentinelTargetView;
6416
6506
  group?: string;
6417
6507
  label?: string;
6418
6508
  createdTs: number;
@@ -6677,6 +6767,134 @@ declare function envelopeClampedBytes(event: McpEventEnvelope): {
6677
6767
  };
6678
6768
  declare function deliverEventEnvelope(replay: DeliveryReplay, event: McpEventEnvelope, deps?: DeliverEventDeps): Promise<DeliveryOutcome>;
6679
6769
 
6770
+ /**
6771
+ * SentinelWebhookOutbox — the PERSISTED outbox for `webhook`-target sentinel
6772
+ * events (W-B of `.plans/sentinel-mcp-events/PLAN.md`, §4 task 3).
6773
+ *
6774
+ * Why an outbox: the runtime's `processEvents` marks an event `seen` the
6775
+ * moment in-process handling resolves, but a webhook POST is an EXTERNAL
6776
+ * delivery — a crash between ack and delivery loses the event forever (I4).
6777
+ * So the webhook fire path appends a DURABLE row first:
6778
+ *
6779
+ * `{sentinelId, requestId, eventId, bodyBytes, cursor:null,
6780
+ * deliveryState, status: pending|delivered|dead}`
6781
+ *
6782
+ * with `bodyBytes` = the EXACT canonical body bytes that will be sent (I2 —
6783
+ * the envelope is serialized once here via `serializeEnvelope`; the dispatch
6784
+ * re-signs those same bytes, and `deliverEventEnvelope`'s internal
6785
+ * serialization is deterministic over the stored envelope — asserted by
6786
+ * tests). The underlying sentinel event is marked seen/acked ONLY when the
6787
+ * row reaches terminal status (`delivered`, or `dead` per the retry cap /
6788
+ * age-out); a dispatch that THREW (crash-shaped) leaves the row `pending`,
6789
+ * the event UN-acked, and a restart re-dispatches it by exact bytes.
6790
+ *
6791
+ * Ordering across events of one subscription is never assumed (I5). Rows
6792
+ * reaped once `delivered` for 24 h; pending rows age out after 7 d (plan
6793
+ * risk table); the file is capped. Feedback-loop guard is data, not policy:
6794
+ * the `ssrfFetch` gate inside `deliverEventEnvelope` inherently blocks
6795
+ * loopback/private delivery targets, so nothing here can ring back into our
6796
+ * own inbound routes — self-delivery cannot even connect.
6797
+ */
6798
+
6799
+ type SentinelWebhookOutboxStatus = "pending" | "delivered" | "dead";
6800
+ interface SentinelWebhookOutboxRow {
6801
+ sentinelId: string;
6802
+ /** Deterministic sub id over `(sentinelId, eventId)` — stable across
6803
+ * restarts (I1: a redelivery is a consumer no-op; the wire `webhook-id`
6804
+ * header stays the EVENT id). */
6805
+ requestId: string;
6806
+ eventId: string;
6807
+ /** The EXACT body bytes, as sent — utf-8 base64 of `serializeEnvelope`
6808
+ * (I2: bytes stored exactly as sent; resume dispatches the stored bytes). */
6809
+ bodyBytes: string;
6810
+ /** v1 events are non-replayable (plan §2) — always null. */
6811
+ cursor: null;
6812
+ /** Persisted W-A delivery state so a post-restart dispatch makes sense. */
6813
+ deliveryState: {
6814
+ attempts: number;
6815
+ lastError?: string;
6816
+ lastAt?: string;
6817
+ };
6818
+ status: SentinelWebhookOutboxStatus;
6819
+ /** The bounded-retry loop's final `ok:false` reason. */
6820
+ failReason?: string;
6821
+ /** Why the outbox itself went a row `dead` (`sentinel_expired`,
6822
+ * `sentinel_removed`, `age_out`). */
6823
+ deadReason?: string;
6824
+ createdAt: number;
6825
+ /** Wall-clock ms the row reached terminal status (drives reaping). */
6826
+ terminalAt?: number;
6827
+ }
6828
+ /** The full row is JSON-persisted; the envelope rides along so a resumed
6829
+ * dispatch re-delivers byte-identically without re-deriving the projection,
6830
+ * and the original event rides along for ack-time lifetime bookkeeping
6831
+ * (terminal flag / subject tracking). */
6832
+ type PersistedOutboxRow = SentinelWebhookOutboxRow & {
6833
+ envelope?: McpEventEnvelope;
6834
+ event?: SentinelEvent;
6835
+ };
6836
+ interface SentinelWebhookOutbox {
6837
+ /** Append a row for a matched webhook-delivery event. Idempotent per
6838
+ * `(sentinelId, eventId)`: an existing row (pending OR terminal) is never
6839
+ * duplicated — returns `undefined`, and for a terminal existing row
6840
+ * re-fires `onTerminal` so a lost ack (crash between the terminal
6841
+ * transition and the store write) still lands. Kicks dispatch off
6842
+ * asynchronously. */
6843
+ enqueue(input: {
6844
+ sentinelId: string;
6845
+ event: SentinelEvent;
6846
+ }): Promise<SentinelWebhookOutboxRow | undefined>;
6847
+ /** Dispatch every `pending` row (serialized, one POST in flight). Consults
6848
+ * `isExpired` per row AND the secrets sidecar BEFORE dispatch — an
6849
+ * expired or unwound sentinel never delivers another byte. */
6850
+ dispatch(): Promise<void>;
6851
+ /** Startup re-enqueue: re-dispatch every `pending` row by exact stored
6852
+ * bytes (no payload re-serialization on the resume path). */
6853
+ resumeDeliveries(): Promise<void>;
6854
+ /** Re-`delivered` rows after 24 h are reaped; pending rows age out after
6855
+ * 7 d (plan risk table). Cheap; called on the runtime's periodic tick. */
6856
+ sweep(): void;
6857
+ rows(): PersistedOutboxRow[];
6858
+ /** Synchronous flush for shutdown paths. */
6859
+ flushSync(): void;
6860
+ }
6861
+ interface SentinelWebhookOutboxOptions {
6862
+ /** Override persist path. Default `~/.agentproto/sentinel-webhook-outbox.json`. */
6863
+ filePath?: string;
6864
+ /** Injectable clock. */
6865
+ nowMs?: () => number;
6866
+ /** Debounce interval for disk persistence. Default 1500 ms. */
6867
+ debounceMs?: number;
6868
+ /** Disable disk persistence (unit tests). Default false unless filePath. */
6869
+ persist?: boolean;
6870
+ /** DI boundary (not module fakes): replaces W-A's `deliverEventEnvelope`
6871
+ * as the POST boundary. Throws = dispatch did not complete (row stays
6872
+ * pending, event stays un-acked). Default: the real deliverer. */
6873
+ deliverEvent?: (input: {
6874
+ replay: DeliveryReplay;
6875
+ row: PersistedOutboxRow;
6876
+ }) => Promise<DeliveryOutcome>;
6877
+ /** Signing secrets for a sentinel — `{subId, callbackUrl, secrets[]}`, or
6878
+ * null when the sentinel/secret sidecar is gone (row goes dead, never
6879
+ * silently lost). */
6880
+ secretsFor: (sentinelId: string) => DeliveryReplay | null;
6881
+ /** Expiry gate, consulted BEFORE every dispatch (plan §4 W-B task 2b).
6882
+ * true = the sentinel is past its `until` and must not deliver. */
6883
+ isExpired: (sentinelId: string) => boolean;
6884
+ /** The ack — mark the underlying event seen, after terminal status only. */
6885
+ onTerminal: (sentinelId: string, row: SentinelWebhookOutboxRow) => void;
6886
+ log?: (line: string) => void;
6887
+ }
6888
+ /** `sub_<hex32>` — deterministic over (sentinelId, eventId). */
6889
+ declare function webhookRequestId(sentinelId: string, eventId: string): `sub_${string}`;
6890
+ /** The CloudEvents → MCP-Events-envelope fusion this WP owns (W-C's adapter
6891
+ * becomes the canonical owner of the same mapping; this shape is the frozen
6892
+ * §3 wire envelope — insertion order stable, so its serialization is
6893
+ * byte-stable across restarts). `data` gains `subject`/`summary` so the
6894
+ * 256 KiB clamp's `{summary, subject}` replacement never goes blind. */
6895
+ declare function toWebhookEnvelope(event: SentinelEvent): McpEventEnvelope;
6896
+ declare function createSentinelWebhookOutbox(opts: SentinelWebhookOutboxOptions): SentinelWebhookOutbox;
6897
+
6680
6898
  /**
6681
6899
  * Smart default for `features.llmEndpoint` (daemon-managed-gateway): an
6682
6900
  * operator who already configured a named endpoint, an upstream credential
@@ -6872,6 +7090,53 @@ interface PromptHostSessionResult {
6872
7090
  * snapshot fallback for a write.
6873
7091
  */
6874
7092
  declare function promptHostSession(hosts: HostRegistry | undefined, target: string, sessionId: string, input: PromptHostSessionInput): Promise<PromptHostSessionResult>;
7093
+ /** A narrow slice of the sessions registry `promptDeviceSession` needs —
7094
+ * kept minimal so tests stub one function. */
7095
+ interface DevicePromptSessionsLike {
7096
+ findByIdOrName(idOrName: string): {
7097
+ id: string;
7098
+ hostSessionId?: string;
7099
+ hostFingerprint?: string;
7100
+ } | undefined;
7101
+ }
7102
+ /** Is this failure the "the given session id doesn't exist on the host"
7103
+ * shape — the only case P7a's controller-id resolution may rescue? A
7104
+ * `no session "<id>"` envelope (the host's `enqueuePrompt` 404, the shape
7105
+ * behind the field finding's `{"ok":false,"status":404,…}`) is the match;
7106
+ * ANY other failure (pairing gate, wait arm, prompt validation) must pass
7107
+ * through untouched rather than get masked by a mapping retry. */
7108
+ declare function isNoSessionPromptFailure(result: PromptHostSessionResult): boolean;
7109
+ /** The controller→host mapping for one id, resolved against the LOCAL
7110
+ * registry — dial-free. Answers `kind: "controller"` only when a local
7111
+ * descriptor with that controller id carries BOTH `hostSessionId` AND a
7112
+ * device identity whose fingerprint-or-name belongs to the SAME target
7113
+ * device (exact-string when no `hosts` registry is wired — the raw
7114
+ * `device:<…>` target round-tripped; fingerprint-vs-name reversed against
7115
+ * the host records otherwise). Resolution order at the call site stays
7116
+ * (a) exact host-id first (promoted by the direct-attempt 404),
7117
+ * (b) this mapping second. */
7118
+ declare function resolveDevicePromptMapping(sessions: DevicePromptSessionsLike | undefined, hosts: HostRegistry | undefined, sessionId: string, target: string): Promise<{
7119
+ kind: "controller";
7120
+ hostSessionId: string;
7121
+ } | {
7122
+ kind: "none";
7123
+ }>;
7124
+ /**
7125
+ * `device_prompt` with P7a id resolution (#1637). Resolution order:
7126
+ *
7127
+ * (a) exact host session id match — the current behavior, tried FIRST,
7128
+ * exactly as `promptHostSession` always has;
7129
+ * (b) controller-id → host-id via the local registry: when (a) fails
7130
+ * with a no-session failure AND a local device descriptor maps the
7131
+ * given id (`hostSessionId` stamped at device spawn), retry once
7132
+ * against the mapped host id.
7133
+ *
7134
+ * Any other failure passes through untouched — the mapping must never mask
7135
+ * a pairing gate, a prompt-validation rejection, or a wait-arm error. When
7136
+ * both fail, the error names the host and the mapping so the operator
7137
+ * knows both halves were checked.
7138
+ */
7139
+ declare function promptDeviceSession(hosts: HostRegistry | undefined, sessions: DevicePromptSessionsLike | undefined, target: string, sessionId: string, input: PromptHostSessionInput): Promise<PromptHostSessionResult>;
6875
7140
 
6876
7141
  /**
6877
7142
  * MCP tools over the device registry (DEVICES-PLAN PR-A/PR-C) — `device_list`
@@ -6899,12 +7164,155 @@ interface RegisterDeviceToolsOptions {
6899
7164
  * would happily answer from cache. When absent, `device_prompt` is not
6900
7165
  * registered. */
6901
7166
  hosts?: HostRegistry;
7167
+ /** Optional (BOOTSTRAP P7a) — the session registry, for `device_prompt`
7168
+ * to resolve a CONTROLLER session id onto its mapped HOST session id
7169
+ * (the issue #1637 id split). Absent ⇒ no controller-id resolution and
7170
+ * the tool keeps behaving exactly as before. */
7171
+ sessions?: DevicePromptSessionsLike;
6902
7172
  /** Optional (SANDBOX-VISIBILITY-JOIN) — when wired, registers
6903
7173
  * `join_token_create`/`join_token_list`/`join_token_revoke`. */
6904
7174
  joinTokens?: JoinTokenRegistry;
6905
7175
  }
6906
7176
  declare function registerDeviceTools(server: McpServer, opts: RegisterDeviceToolsOptions): void;
6907
7177
 
7178
+ /**
7179
+ * BOOTSTRAP P7b — read-time mirror of a HOST device's turns into the
7180
+ * CONTROLLER's own session reads (issue #1637).
7181
+ *
7182
+ * A `session spawned with sandbox: "device:<fp|name>"` lives on TWO
7183
+ * daemons: the controller keeps a thin proxy-backed descriptor (its `id`,
7184
+ * e.g. `sess_305be17c`) while the real conversation accumulates on the
7185
+ * host' under a DIFFERENT id (`sess_cf318f00`, on the descriptor's
7186
+ * `hostSessionId`). #1640 gave the controller WRITE access across the gap
7187
+ * (`device_prompt`); this module closes the READ half: nothing runs in
7188
+ * the background — every controller READ (`GET /sessions/:id`, the
7189
+ * `/output` tail, `/events`, `/export`, the `agent_output` tool) calls
7190
+ * {@link syncDeviceMirror} first, which:
7191
+ *
7192
+ * 1. derives the dedup cursor from the session's OWN events.jsonl (max
7193
+ * `hostSeq` across records tagged `origin: "device"` — so the cursor
7194
+ * survives a daemon restart by construction, P7b-3), seeding it the
7195
+ * first time from what the controller already knows locally (below),
7196
+ * 2. dials the host ONCE over the existing E2E channel
7197
+ * (`HostRegistry.forwardHttp`, the same path `device_sessions` uses)
7198
+ * and pages `GET /sessions/:hostSessionId/events?since=<cursor>` —
7199
+ * an EXISTING host route; no host-side changes are consumed for this
7200
+ * (P7b uses today's 1.7.x-compatible endpoints only),
7201
+ * 3. appends the new host records to the controller transcript,
7202
+ * byte-faithful, tagged `origin: "device"` + `hostSeq` +
7203
+ * `sourceRef: "device:<fp>"` (idempotent by the hostSeq cursor —
7204
+ * re-reading never duplicates), and
7205
+ * 4. cheaply refreshes the controller descriptor's live projection
7206
+ * fields from the host snapshot (`lastActivityAt`, `busy`, usage),
7207
+ * without touching controller-local fields (label, agentsMdMode…).
7208
+ *
7209
+ * Backward compatibility (P7b constraint): only EXISTING host endpoints
7210
+ * are consumed. An older host, or one whose daemon lacks the events route,
7211
+ * surfaces as `mirrorError` on the descriptor — never a crash, never a
7212
+ * silent stale overwrite.
7213
+ */
7214
+
7215
+ /** One raw record off the host's own transcript (the exact on-disk shape —
7216
+ * `{seq, ts, kind, ...}` — so the mirror is byte-faithful to the host). */
7217
+ type HostEventRecord = Record<string, unknown>;
7218
+ /**
7219
+ * Dial the host and read its session's transcript from `sinceSeq`
7220
+ * (exclusive), paginating until the host reports the tail complete.
7221
+ *
7222
+ * Same failure semantics as `device_sessions`' tail mode, but WITHOUT its
7223
+ * stale-snapshot fallback: the host's unreachability must surface as
7224
+ * `{ ok: false, error }` so readers can show "host unreachable" rather
7225
+ * than silently rendering the last snapshot (P7b-1). `404 no_transcript`
7226
+ * (a host session with nothing written — most usefully a just-spawned one)
7227
+ * is a NORMAL empty result, not an error.
7228
+ */
7229
+ type FetchHostTurnsResult = {
7230
+ ok: true;
7231
+ /** Records strictly AFTER `sinceSeq`, ascending. */
7232
+ events: HostEventRecord[];
7233
+ /** Host-reported tip: the seq the next call should use as `sinceSeq`. */
7234
+ nextSeq: number;
7235
+ } | {
7236
+ ok: false;
7237
+ error: string;
7238
+ staleAt?: string;
7239
+ };
7240
+ declare function fetchHostTurns(hosts: HostRegistry, hostFingerprint: string, hostSessionId: string, sinceSeq: number): Promise<FetchHostTurnsResult>;
7241
+ /** The highest `hostSeq` already mirrored into the session's transcript —
7242
+ * the next sync reads only what is STRICTLY newer, so a daemon restart or
7243
+ * a re-read can never duplicate or skip turns (P7b-3, the correctness
7244
+ * core). Scans for `origin === "device"` records; every other line is
7245
+ * controller-local and owns no `hostSeq`. Standalone fs reader (tests +
7246
+ * tooling): the LIVE sync path uses the registry's own
7247
+ * `scanDeviceMirrorState` so custom transcript base dirs can't drift. */
7248
+ declare function mirrorCursorForSession(sessionId: string, baseDir?: string): Promise<number>;
7249
+ /**
7250
+ * Seed the cursor so a FIRST mirror read (before anything was ever
7251
+ * mirrored) skips the turns the controller already recorded on its own.
7252
+ *
7253
+ * Walks the host transcript in order; a host `user-prompt` whose text
7254
+ * matches the NEXT unmatched known local prompt is a turn the controller
7255
+ * already has (it captured that turn live through the sandbox proxy) —
7256
+ * consume it and keep walking. The first host turn that does NOT match is
7257
+ * where local knowledge ends: the cursor is the last turn-end BEFORE it,
7258
+ * so everything from that turn onward gets mirrored exactly once.
7259
+ *
7260
+ * Ordered (not set-membership) on purpose: re-issued prompts later in a
7261
+ * conversation legitimately reappear in the host transcript and a
7262
+ * set-membership match would wrongly skip them.
7263
+ *
7264
+ * Exit states: every host turn matched → full tip is known, cursor is the
7265
+ * last turn-end; no local prompts (or the first host prompt already
7266
+ * unknown) → 0, mirror everything. A transcript longer than one page
7267
+ * leaves the seed `undefined` — the caller merges from 0 (a possible
7268
+ * duplicate beats any lost content) rather than trusting a partial walk.
7269
+ */
7270
+ declare function seedWalkForTranscript(localTexts: readonly string[], hostRecords: readonly HostEventRecord[]): number | undefined;
7271
+ /** Turn a raw host record into the controller-transcript record the mirror
7272
+ * appends — same `kind` (so every existing transcript renderer renders it
7273
+ * unchanged) plus the three mirror tags, and the HOST's own `ts` preserved
7274
+ * inside the record. `undefined` for kinds that carry conversations the
7275
+ * controller doesn't derive value from duplicating (`system-prompt`,
7276
+ * `usage_update`, derived `tool-call-record`, …). */
7277
+ declare function hostRecordToMirrorRecord(rec: HostEventRecord, hostFingerprint: string): Record<string, unknown> | undefined;
7278
+ /** The slice of `SessionsRegistry` (and the descriptor) the sync needs —
7279
+ * kept narrow so tests can stub the registry. */
7280
+ interface DeviceMirrorTarget {
7281
+ findByIdOrName(idOrName: string): SessionDescriptor | undefined;
7282
+ appendDeviceMirrorRecords(id: string, records: readonly Record<string, unknown>[]): number;
7283
+ /** Preferred cursor/prompt source — the registry's own scan (correct
7284
+ * transcript base dir). Falls back to this module's default-dir fs read
7285
+ * when absent (older registry shapes / direct unit calls). */
7286
+ scanDeviceMirrorState?(id: string): {
7287
+ cursor: number;
7288
+ localPromptTexts: readonly string[];
7289
+ };
7290
+ }
7291
+ type DeviceMirrorSyncResult = {
7292
+ ok: true;
7293
+ /** New records merged from the host this call. */
7294
+ merged: number;
7295
+ /** The advanced mirror cursor after the merge. */
7296
+ cursor: number;
7297
+ } | {
7298
+ ok: false;
7299
+ reason: "no-session" | "not-device" | "no-host-registry";
7300
+ error?: string;
7301
+ } | {
7302
+ ok: false;
7303
+ reason: "mirror-error";
7304
+ error: string;
7305
+ };
7306
+ /**
7307
+ * One read-time sync for a controller id/name. Fast no-op path: no local
7308
+ * descriptor, or not a device-mirrored session (both fields absent) —
7309
+ * local spawns pay ZERO extra reads/calls (P7b test invariant). Reads the
7310
+ * cursor, dials the host, appends new records, refreshes the descriptor's
7311
+ * live projection fields, and stamps/clears `mirrorError` on the
7312
+ * descriptor for unreachable-host surfacing.
7313
+ */
7314
+ declare function syncDeviceMirror(sessions: DeviceMirrorTarget, hosts: HostRegistry | undefined, idOrName: string): Promise<DeviceMirrorSyncResult>;
7315
+
6908
7316
  /**
6909
7317
  * Provider-preset family on top of `@agentproto/provider-kit` — the *thin,
6910
7318
  * honest* lister (Option B). Unlike tunnels/sandboxes/eval-reporters, presets
@@ -8261,4 +8669,4 @@ interface GatewayHandle {
8261
8669
  */
8262
8670
  declare function createGateway(opts: CreateGatewayOptions): Promise<GatewayHandle>;
8263
8671
 
8264
- export { ActivityListFilter, type ActivityPolicyLister, type ActivityProjector, type ActivityProjectorRegistry, type ActivityProjectorSession, ActivityRecord, type ActivityWorkflowLister, AdapterAuthDescriptor, type AdapterCapabilitiesLister, type AdapterInstallResult, type AdapterListEntry, type AgentAdapterInstaller, type AgentAdapterLister, type AgentAdapterResolver, AgentSessionLike, AgentStreamEvent, type AttachSandboxOpts, type AttachSandboxResult, BUCKETS_ROOT, type BranchGcClass, type BranchGcCoverageView, type BranchGcHoldReason, type BranchGcKind, type BranchGcOutcomeView, type BranchGcPlanEntryView, type BranchGcPlanView, type BranchGcReclaimReason, type BranchGcResult, type BranchGcRunInput, type BranchGcRunner, type BranchGcStatus, type BranchGcSummaryView, type BranchGcTriageVerdict, type BranchGcVerdictInput, type BranchGcVerdictLookupInput, type BranchGcVerdictReader, type BranchGcVerdictRecordView, type BranchGcVerdictRecorder, type BrowserAdapterHandle, type BrowserAdapterInfo, type BrowserAdapterLister, type BrowserAdapterResolver, BuildHeartbeatAgent, CLAMP_LIMIT_BYTES, CONTINUE_PROMPT_SOURCE, CanonicalPosture, type CapabilitiesInventory, type CapabilitiesInventoryMcp, type CapabilitiesInventorySkills, type CatalogModelsLister, CatalogModelsQuery, CatalogModelsResponse, type CatalogProviderModel, type CatalogProviderModelsQuery, type CatalogProviderModelsResponse, type CatalogProviderPricing, type ChallengeFailureReason, type ChallengeOutcome, type ClaudeNativeRef, CompletionPolicySupervisor, type ComposeCandidate, ContextProfile, type ContinueInterruptedMode, type ContinueInterruptedOutcome, type ContinueInterruptedResult, type ContinueInterruptedSkipReason, type ContinueOnBootSummary, type ConversationIndexRecord, type ConversationNativeRef, type CostBudgetDecision, type CrashDetectSummary, type CrashReaperRegistry, type CreateGatewayOptions, type CreateJoinTokenInput, type CreateReviewRunnerOptions, type CreatedJoinToken, DEAD_SESSION_STATUSES, DEFAULT_ALWAYS_ON_TOOLS, DEFAULT_BUCKET, DEFAULT_CONTINUE_PROMPT, DEFAULT_HOST_LOAD_BUDGET_MS, DEFAULT_HOST_LOAD_THRESHOLDS, DEFAULT_ORCHESTRATOR_TOOLS, DEVICE_PROMPT_PATH_PREFIX, type DaemonReviewerHostDeps, DeclaredAdapterOption, type DeclaredAdapterPreset, DefaultsAdapterAuthConfig, type DeliveryOutcome, type DeliveryReplay, type DeliveryState, type Device, type DeviceKind, type DeviceRegistry, type DeviceRole, type DiskLoad, type EagerResumeSummary, type EgressDispatcher, type EnableInput, type EnableResult, type FindComposeCandidateInput, type ForwardHttpRequest, type ForwardHttpResponse, GC_REAPABLE_STATES, type GatewayHandle, type GhRunner, HOSTS_VERSION, HOST_HANDSHAKE_REMEDIATION_HINT, HOST_SCOPE_HEADER, type HarnessPreset, type HarnessPresetValidationDeps, HarnessPresetValidationError, type HarnessPresetsFile, type HermesNativeRef, type HostJoinMeta, type HostLoadCpu, type HostLoadDetail, type HostLoadMemory, type HostLoadReport, type HostLoadService, type HostLoadSwap, type HostLoadThresholds, type HostProbes, type HostProcess, type HostProcessOwner, type HostRecord, type HostRegistry, type HostRegistryDeps, type HostSessionRollup, type HostWarning, type HostWarningKind, INBOUND_PROVIDERS, type IdleReapSummary, type IdleReaperRegistry, type InboundEndpoint, type InboundEndpointStore, type InboundEndpointStoreOptions, type InboundEnqueuePrompt, type InboundIsSessionAlive, type InboundMessage, type InboundProvider, type InboundRestartSession, type InboundRouteMode, type InboundRouterDeps, type InboundRouterLog, type InboundSpawnForContact, type InboundWatcher, JOIN_TOKENS_VERSION, type JoinTokenRecord, type JoinTokenRegistry, type JoinTokenRegistryDeps, LEGACY_SESSIONS_FILE, type LedgerAnnotations, type LedgerEntry, type LedgerHostMeta, type LlmEndpointDescriptor, type LlmEndpointStatus, type LlmEndpointStatusReport, type LocatedConversation, type LocatedConversationByPath, MAX_ATTEMPTS, MAX_AUTO_CONTINUE_ATTEMPTS, MCP_APP_BRIDGE_SCRIPT, type McpCredentialDeps, type McpEventEnvelope, type MeasurableTool, type MeasuredToolEntry, MessageKind, MessageUrgency, type MigrationMarker, type ModelRolesInput, type ModelRolesOutput, type NormalizeInboundResult, type OpenPrResolver, type OrchestratorGatewayDeps, type OrchestratorInjection, type OrchestratorInjector, type OrchestratorInjectorDeps, type OrchestratorMcpServerFactory, type OrchestratorScope, type OrphanReaperRegistry, POSTURE_NATIVE_ALIASES, POSTURE_PREAMBLES, PolicyRunState, Posture, type PostureResolution, PrLookupError, type PrLookupErrorCode, PrResolvedState, type PrStateResolver, type PrStatusSnapshot, type PresetInfo, type ProjectBrowserToolsOptions, type ProjectedBrowserTool, type ProjectedBrowserTools, type ProjectedProvider, type ProjectedToolResult, type PromptHostSessionInput, type PromptHostSessionResult, ProvisionInFlight, QuotaReadableProfile, type RegisterBrainToolsOptions, type RegisterDeviceToolsOptions, type RegisterPairingToolsOptions, type RegisterReviewToolsOptions, type RegisterWebSearchToolsOptions, RemainingQuotaReader, type RemoteStatus, type ResolveNativeLinkInput, ResolvedAuthSpec, ResolvedModelRole, type ReuseResolution, type ReviewComposeContext, type ReviewLedger, type ReviewLedgerFilter, type ReviewRun, type ReviewRunInput, type ReviewRunStatus, type ReviewRunner, type ReviewSignature, type ReviewSigningKey, type ReviewerRunResult, type ReviewerSessionHost, type RouteAwareLaunchConfig, type RouteAwareLaunchConfigInput, RouteSpec, type RuntimeMeta, SIGN_NAMESPACE, type SandboxAdapterInfo, type SandboxConnectionDescriptor, type SandboxGcCandidate, type SandboxGcProviderHandle, type SandboxGcReapDeps, type SandboxGcReapResult, type SandboxLedgerEntry, type SandboxLedgerState, type SandboxProviderCapabilities, type SandboxProviderHandle, type SandboxProviderLister, type SandboxProviderResolver, type SandboxReconcileDeps, type SandboxReconcileProviderHandle, type SandboxReconcileResult, type SandboxReconcileRow, type SandboxReconcileVerdict, type ScopeTokenRegistry, type SentinelMatchClause, type SentinelSpec, type SentinelStatus, type SentinelTarget, type SentinelUntil, type SentinelView, SessionDescriptor, SessionEndReason, SessionMessage, type SessionMessageSentRecord, type SessionObserver, SessionUsage, type SessionUsageWithSubtree, type SessionWaitEvent, type SessionWaitResult, SessionsRegistry, type SkillPackInventoryEntry, type SkillsByHarnessEntry, SpawnDefaultsConfig, SsrfFetchError, type SsrfFetchInit, type SsrfFetchReason, type SsrfFetchResult, type StallWatchdogRegistry, type StallWatchdogSummary, type SubtreeChildUsage, type SubtreeUsageTotals, TaskLedger, type ToolListMeasurement, type TransmitterBinding, type TransmitterBindingStore, type TunnelDescriptor, type TunnelProvider, type TunnelStatus, UsageReadContext, UsageReadResult, UsageRollup, UsageSnapshotRecord, UserPreset, type VerifyCallbackInput, type VerifySignedAttestationResult, type WatcherDescriptor, type WatcherStartInput, type WebSearchInput, type WebSearchOutput, type WebSearchResult, type WebhookSignInput, type WebhookSignatureHeaders, type WorkspaceBrainSubscriber, type WorkspaceBrainSubscriberOptions, type WorkspaceBrains, WorkspaceFs, WorktreeAutoReclaimer, WorktreeField, type WorktreeGcClass, type WorktreeGcOutcomeView, type WorktreeGcPlanEntryView, type WorktreeGcReclaimReason, type WorktreeGcResult, type WorktreeGcRunInput, type WorktreeGcRunner, WorktreeIsolationMode, WorktreeProvisioner, type WorktreeStatusLister, type WorktreeStatusView, addHarnessPreset, allowedSignersLine, appendConversationRecord, attachSandbox, bucketDir, bucketSessionsFile, bucketTranscriptDir, buildCatalogProviderModels, buildHostLoadReport, buildMcpConfigSnippet, buildRouteAwareLaunchConfig, canonicalForModeId, challengeCacheSize, challengeReasonForSsrf, claudeProjectSlug, collectGcCandidates, collectHostSample, composeSessionObservers, composedFromRangeSha, computeHostWarnings, continueInterruptedSessions, continueSkipReason, conversationIndexPath, createActivityProjector, createDaemonReviewerHost, createDefaultHostProbes, createDeviceRegistry, createFileStepCache, createGateway, createHostLoadService, createHostRegistry, createInboundEndpointStore, createJoinTokenRegistry, createOrchestratorInjector, createOrchestratorMcpServerFactory, createPrProvenanceReconciler, createReviewLaneExecutor, createReviewLedger, createReviewPackLoader, createReviewRunner, createScopeTokenRegistry, createWorkspaceBrainSubscriber, createWorkspaceBrains, daemonRegistryDir, declaredPresetToProviderPreset, decodeWhsecSecret, defaultBrowserAdapterIds, defaultBrowserAdapterResolution, defaultReviewKeysDir, defaultReviewLedgerRoot, defaultReviewPackCacheDir, defineBraveSearchHttpDriver, defineSerperHttpDriver, deliverEventEnvelope, deliveryBackoffDelay, describeOwner, encodeWhsecSecret, enrichRollupWithProviderQuota, enrichWithRemainingQuota, ensureReviewSigningKey, envelopeClampedBytes, evaluateCostBudget, execGh, extractHelpSection, fetchPrStatus, fileExists, findComposeCandidate, findConversationRecord, findNativeMode, findPrForCommit, formatToolCall, formatToolResult, getDefaultHarnessPreset, getHarnessPreset, getHostLoadService, getMcpCredentialDeps, getToolHelp, githubRepoOf, harnessPresetsPath, hostPlaceholders, injectMcpAppBridge, isAgentCliAuthConfigured, isPubliclyRoutable, isSafeBucketSlug, listBuckets, listHarnessPresets, listPresets, listToolHelpTopics, loadHarnessPresets, loadWorkspaceModelRoles, locateConversationByNativePath, locateConversationBySessionId, makeBrowserAdapterLister, makeSandboxCredsStore, makeSandboxResolver, measureTool, measureToolList, migrateLegacySessionsFile, migrationMarkerPath, monitorPolicyWait, monitorSessionWait, narrowOrchestratorTools, normalizeCallbackUrl, normalizeInbound, normalizeModeId, normalizeRemote, parsePrUrl, prHeadSha, projectBrowserTools, promptHostSession, readConversationIndex, readDaemonRegistry, readHostsSnapshot, readRegisteredSlugs, readRuntimeMeta, readSandboxLedger, readSessionForBrain, readUsageSnapshots, reapGcEntry, reapOrphanedDescendants, reconcileSandboxLedger, recordSandboxBoot, recordSandboxLiveness, recordSandboxOrigin, recordSandboxState, registerBrainTools, registerBuiltinRoutes, registerDeviceTools, registerPairingTools, registerReviewTools, registerSandboxAttachTool, registerWebSearchTools, removeHarnessPreset, removeSandboxLedgerEntry, repoSlug, resetChallengeCacheForTests, resolveBucketSlug, resolveEffectiveLlmEndpointFlag, resolveNativeLink, resolvePosture, resolvePrincipal, resolveReuseFromLedger, resolveReviewerPreset, rollupSessionSubtree, runContinueOnBootPass, runCrashDetectPass, runEagerResumePass, runIdleReapPass, runShellLane, runStallWatchdogPass, sandboxLedgerPath, serializeEnvelope, setDefaultPreset, setEgressDispatcherForTests, setMcpCredentialDeps, signAttestation, signWebhook, ssrfFetch, sweepStaleDaemonRegistry, sweepStaleRuntimeMetas, toWorktreeStatusView, unlinkDaemonRegistryEntry, unlinkRuntimeMeta, updateHarnessPreset, upsertSandboxLedger, verifyCallback, verifyInboundSignature, verifySignedAttestation, webSearchTool, withPr, withPrStatus, writeDaemonRegistryEntry };
8672
+ export { ActivityListFilter, type ActivityPolicyLister, type ActivityProjector, type ActivityProjectorRegistry, type ActivityProjectorSession, ActivityRecord, type ActivityWorkflowLister, AdapterAuthDescriptor, type AdapterCapabilitiesLister, type AdapterInstallResult, type AdapterListEntry, type AgentAdapterInstaller, type AgentAdapterLister, type AgentAdapterResolver, AgentSessionLike, AgentStreamEvent, type AttachSandboxOpts, type AttachSandboxResult, BUCKETS_ROOT, type BranchGcClass, type BranchGcCoverageView, type BranchGcHoldReason, type BranchGcKind, type BranchGcOutcomeView, type BranchGcPlanEntryView, type BranchGcPlanView, type BranchGcReclaimReason, type BranchGcResult, type BranchGcRunInput, type BranchGcRunner, type BranchGcStatus, type BranchGcSummaryView, type BranchGcTriageVerdict, type BranchGcVerdictInput, type BranchGcVerdictLookupInput, type BranchGcVerdictReader, type BranchGcVerdictRecordView, type BranchGcVerdictRecorder, type BrowserAdapterHandle, type BrowserAdapterInfo, type BrowserAdapterLister, type BrowserAdapterResolver, BuildHeartbeatAgent, CLAMP_LIMIT_BYTES, CONTINUE_PROMPT_SOURCE, CanonicalPosture, type CapabilitiesInventory, type CapabilitiesInventoryMcp, type CapabilitiesInventorySkills, type CatalogModelsLister, CatalogModelsQuery, CatalogModelsResponse, type CatalogProviderModel, type CatalogProviderModelsQuery, type CatalogProviderModelsResponse, type CatalogProviderPricing, type ChallengeFailureReason, type ChallengeOutcome, type ClaudeNativeRef, CompletionPolicySupervisor, type ComposeCandidate, ContextProfile, type ContinueInterruptedMode, type ContinueInterruptedOutcome, type ContinueInterruptedResult, type ContinueInterruptedSkipReason, type ContinueOnBootSummary, type ConversationIndexRecord, type ConversationNativeRef, type CostBudgetDecision, type CrashDetectSummary, type CrashReaperRegistry, type CreateGatewayOptions, type CreateJoinTokenInput, type CreateReviewRunnerOptions, type CreatedJoinToken, DEAD_SESSION_STATUSES, DEFAULT_ALWAYS_ON_TOOLS, DEFAULT_BUCKET, DEFAULT_CONTINUE_PROMPT, DEFAULT_HOST_LOAD_BUDGET_MS, DEFAULT_HOST_LOAD_THRESHOLDS, DEFAULT_ORCHESTRATOR_TOOLS, DEVICE_PROMPT_PATH_PREFIX, type DaemonReviewerHostDeps, DeclaredAdapterOption, type DeclaredAdapterPreset, DefaultsAdapterAuthConfig, type DeliveryOutcome, type DeliveryReplay, type DeliveryState, type Device, type DeviceKind, type DeviceMirrorSyncResult, type DeviceMirrorTarget, type DevicePromptSessionsLike, type DeviceRegistry, type DeviceRole, type DiskLoad, type EagerResumeSummary, type EgressDispatcher, type EnableInput, type EnableResult, type FetchHostTurnsResult, type FindComposeCandidateInput, type ForwardHttpRequest, type ForwardHttpResponse, GC_REAPABLE_STATES, type GatewayHandle, type GhRunner, HOSTS_VERSION, HOST_HANDSHAKE_REMEDIATION_HINT, HOST_SCOPE_HEADER, type HarnessPreset, type HarnessPresetValidationDeps, HarnessPresetValidationError, type HarnessPresetsFile, type HermesNativeRef, type HostEventRecord, type HostJoinMeta, type HostLoadCpu, type HostLoadDetail, type HostLoadMemory, type HostLoadReport, type HostLoadService, type HostLoadSwap, type HostLoadThresholds, type HostProbes, type HostProcess, type HostProcessOwner, type HostRecord, type HostRegistry, type HostRegistryDeps, type HostSessionRollup, type HostWarning, type HostWarningKind, INBOUND_PROVIDERS, type IdleReapSummary, type IdleReaperRegistry, type InboundEndpoint, type InboundEndpointStore, type InboundEndpointStoreOptions, type InboundEnqueuePrompt, type InboundIsSessionAlive, type InboundMessage, type InboundProvider, type InboundRestartSession, type InboundRouteMode, type InboundRouterDeps, type InboundRouterLog, type InboundSpawnForContact, type InboundWatcher, JOIN_TOKENS_VERSION, type JoinTokenRecord, type JoinTokenRegistry, type JoinTokenRegistryDeps, LEGACY_SESSIONS_FILE, type LedgerAnnotations, type LedgerEntry, type LedgerHostMeta, type LlmEndpointDescriptor, type LlmEndpointStatus, type LlmEndpointStatusReport, type LocatedConversation, type LocatedConversationByPath, MAX_ATTEMPTS, MAX_AUTO_CONTINUE_ATTEMPTS, MCP_APP_BRIDGE_SCRIPT, type McpCredentialDeps, type McpEventEnvelope, type MeasurableTool, type MeasuredToolEntry, MessageKind, MessageUrgency, type MigrationMarker, type ModelRolesInput, type ModelRolesOutput, type NormalizeInboundResult, type OpenPrResolver, type OrchestratorGatewayDeps, type OrchestratorInjection, type OrchestratorInjector, type OrchestratorInjectorDeps, type OrchestratorMcpServerFactory, type OrchestratorScope, type OrphanReaperRegistry, POSTURE_NATIVE_ALIASES, POSTURE_PREAMBLES, type PersistedOutboxRow, PolicyRunState, Posture, type PostureResolution, PrLookupError, type PrLookupErrorCode, PrResolvedState, type PrStateResolver, type PrStatusSnapshot, type PresetInfo, type ProjectBrowserToolsOptions, type ProjectedBrowserTool, type ProjectedBrowserTools, type ProjectedProvider, type ProjectedToolResult, type PromptHostSessionInput, type PromptHostSessionResult, ProvisionInFlight, QuotaReadableProfile, type RegisterBrainToolsOptions, type RegisterDeviceToolsOptions, type RegisterPairingToolsOptions, type RegisterReviewToolsOptions, type RegisterWebSearchToolsOptions, RemainingQuotaReader, type RemoteStatus, type ResolveNativeLinkInput, ResolvedAuthSpec, ResolvedModelRole, type ReuseResolution, type ReviewComposeContext, type ReviewLedger, type ReviewLedgerFilter, type ReviewRun, type ReviewRunInput, type ReviewRunStatus, type ReviewRunner, type ReviewSignature, type ReviewSigningKey, type ReviewerRunResult, type ReviewerSessionHost, type RouteAwareLaunchConfig, type RouteAwareLaunchConfigInput, RouteSpec, type RuntimeMeta, SIGN_NAMESPACE, type SandboxAdapterInfo, type SandboxConnectionDescriptor, type SandboxGcCandidate, type SandboxGcProviderHandle, type SandboxGcReapDeps, type SandboxGcReapResult, type SandboxLedgerEntry, type SandboxLedgerState, type SandboxProviderCapabilities, type SandboxProviderHandle, type SandboxProviderLister, type SandboxProviderResolver, type SandboxReconcileDeps, type SandboxReconcileProviderHandle, type SandboxReconcileResult, type SandboxReconcileRow, type SandboxReconcileVerdict, type ScopeTokenRegistry, type SentinelMatchClause, type SentinelSpec, type SentinelStatus, type SentinelTarget, type SentinelUntil, type SentinelView, type SentinelWebhookOutbox, type SentinelWebhookOutboxOptions, type SentinelWebhookOutboxRow, type SentinelWebhookOutboxStatus, SessionDescriptor, SessionEndReason, SessionMessage, type SessionMessageSentRecord, type SessionObserver, SessionUsage, type SessionUsageWithSubtree, type SessionWaitEvent, type SessionWaitResult, SessionsRegistry, type SkillPackInventoryEntry, type SkillsByHarnessEntry, SpawnDefaultsConfig, SsrfFetchError, type SsrfFetchInit, type SsrfFetchReason, type SsrfFetchResult, type StallWatchdogRegistry, type StallWatchdogSummary, type SubtreeChildUsage, type SubtreeUsageTotals, TaskLedger, type ToolListMeasurement, type TransmitterBinding, type TransmitterBindingStore, type TunnelDescriptor, type TunnelProvider, type TunnelStatus, UsageReadContext, UsageReadResult, UsageRollup, UsageSnapshotRecord, UserPreset, type VerifyCallbackInput, type VerifySignedAttestationResult, type WatcherDescriptor, type WatcherStartInput, type WebSearchInput, type WebSearchOutput, type WebSearchResult, type WebhookSignInput, type WebhookSignatureHeaders, type WorkspaceBrainSubscriber, type WorkspaceBrainSubscriberOptions, type WorkspaceBrains, WorkspaceFs, WorktreeAutoReclaimer, WorktreeField, type WorktreeGcClass, type WorktreeGcOutcomeView, type WorktreeGcPlanEntryView, type WorktreeGcReclaimReason, type WorktreeGcResult, type WorktreeGcRunInput, type WorktreeGcRunner, WorktreeIsolationMode, WorktreeProvisioner, type WorktreeStatusLister, type WorktreeStatusView, addHarnessPreset, allowedSignersLine, appendConversationRecord, attachSandbox, bucketDir, bucketSessionsFile, bucketTranscriptDir, buildCatalogProviderModels, buildHostLoadReport, buildMcpConfigSnippet, buildRouteAwareLaunchConfig, canonicalForModeId, challengeCacheSize, challengeReasonForSsrf, claudeProjectSlug, collectGcCandidates, collectHostSample, composeSessionObservers, composedFromRangeSha, computeHostWarnings, continueInterruptedSessions, continueSkipReason, conversationIndexPath, createActivityProjector, createDaemonReviewerHost, createDefaultHostProbes, createDeviceRegistry, createFileStepCache, createGateway, createHostLoadService, createHostRegistry, createInboundEndpointStore, createJoinTokenRegistry, createOrchestratorInjector, createOrchestratorMcpServerFactory, createPrProvenanceReconciler, createReviewLaneExecutor, createReviewLedger, createReviewPackLoader, createReviewRunner, createScopeTokenRegistry, createSentinelWebhookOutbox, createWorkspaceBrainSubscriber, createWorkspaceBrains, daemonRegistryDir, declaredPresetToProviderPreset, decodeWhsecSecret, defaultBrowserAdapterIds, defaultBrowserAdapterResolution, defaultReviewKeysDir, defaultReviewLedgerRoot, defaultReviewPackCacheDir, defineBraveSearchHttpDriver, defineSerperHttpDriver, deliverEventEnvelope, deliveryBackoffDelay, describeOwner, encodeWhsecSecret, enrichRollupWithProviderQuota, enrichWithRemainingQuota, ensureReviewSigningKey, envelopeClampedBytes, evaluateCostBudget, execGh, extractHelpSection, fetchHostTurns, fetchPrStatus, fileExists, findComposeCandidate, findConversationRecord, findNativeMode, findPrForCommit, formatToolCall, formatToolResult, getDefaultHarnessPreset, getHarnessPreset, getHostLoadService, getMcpCredentialDeps, getToolHelp, githubRepoOf, harnessPresetsPath, hostPlaceholders, hostRecordToMirrorRecord, injectMcpAppBridge, isAgentCliAuthConfigured, isNoSessionPromptFailure, isPubliclyRoutable, isSafeBucketSlug, listBuckets, listHarnessPresets, listPresets, listToolHelpTopics, loadHarnessPresets, loadWorkspaceModelRoles, locateConversationByNativePath, locateConversationBySessionId, makeBrowserAdapterLister, makeSandboxCredsStore, makeSandboxResolver, measureTool, measureToolList, migrateLegacySessionsFile, migrationMarkerPath, mirrorCursorForSession, monitorPolicyWait, monitorSessionWait, narrowOrchestratorTools, normalizeCallbackUrl, normalizeInbound, normalizeModeId, normalizeRemote, parsePrUrl, prHeadSha, projectBrowserTools, promptDeviceSession, promptHostSession, readConversationIndex, readDaemonRegistry, readHostsSnapshot, readRegisteredSlugs, readRuntimeMeta, readSandboxLedger, readSessionForBrain, readUsageSnapshots, reapGcEntry, reapOrphanedDescendants, reconcileSandboxLedger, recordSandboxBoot, recordSandboxLiveness, recordSandboxOrigin, recordSandboxState, registerBrainTools, registerBuiltinRoutes, registerDeviceTools, registerPairingTools, registerReviewTools, registerSandboxAttachTool, registerWebSearchTools, removeHarnessPreset, removeSandboxLedgerEntry, repoSlug, resetChallengeCacheForTests, resolveBucketSlug, resolveDevicePromptMapping, resolveEffectiveLlmEndpointFlag, resolveNativeLink, resolvePosture, resolvePrincipal, resolveReuseFromLedger, resolveReviewerPreset, rollupSessionSubtree, runContinueOnBootPass, runCrashDetectPass, runEagerResumePass, runIdleReapPass, runShellLane, runStallWatchdogPass, sandboxLedgerPath, seedWalkForTranscript, serializeEnvelope, setDefaultPreset, setEgressDispatcherForTests, setMcpCredentialDeps, signAttestation, signWebhook, ssrfFetch, sweepStaleDaemonRegistry, sweepStaleRuntimeMetas, syncDeviceMirror, toWebhookEnvelope, toWorktreeStatusView, unlinkDaemonRegistryEntry, unlinkRuntimeMeta, updateHarnessPreset, upsertSandboxLedger, verifyCallback, verifyInboundSignature, verifySignedAttestation, webSearchTool, webhookRequestId, withPr, withPrStatus, writeDaemonRegistryEntry };