@agentproto/runtime 5.13.0 → 5.15.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/app-mcp-server.d.ts +69 -0
- package/dist/app-mcp-server.mjs +206 -0
- package/dist/app-mcp-server.mjs.map +1 -0
- package/dist/config-schema.mjs +12 -8
- package/dist/config-schema.mjs.map +1 -1
- package/dist/config.mjs +12 -8
- package/dist/config.mjs.map +1 -1
- package/dist/index.d.ts +533 -225
- package/dist/index.mjs +1849 -390
- package/dist/index.mjs.map +1 -1
- package/dist/resume-strategies.mjs +12 -8
- package/dist/resume-strategies.mjs.map +1 -1
- package/dist/session-presence.mjs +12 -8
- package/dist/session-presence.mjs.map +1 -1
- package/dist/{sessions-DtkidPeI.d.ts → sessions-Dq4mAphj.d.ts} +2 -0
- package/dist/user-presets.d.ts +1 -1
- package/docs/mcp-tools/agent_start.md +11 -0
- package/docs/mcp-tools/session_list.md +66 -0
- package/package.json +30 -25
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-CoLz8Pkh.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 PendingPromptView, x as StatsSessionDescriptor, y as ProcRow, z as ProvisionInFlight, B as ProvisionTracker, D as SessionCrashReason, E as UsageRollup, F as RemainingQuotaReader, Q as QuotaReadableProfile, G as UsageSnapshotRecord, H as SessionAwaitingQuestion, I as PolicyRunState, J as PtyFactory, K as WorktreeAutoReclaimer } from './sessions-
|
|
7
|
-
export { L as ActivityKind, N as ActivitySource, O as ActivityState, V as ActivityWaitingOn, X as AnthropicReaderConfig, Y as AnthropicRemainingQuotaReader, Z as AttachPolicyInput, _ as CommandGroupStats, $ as CommitSpec, a0 as DEFAULT_WORKTREE_ISOLATION, a1 as DEFAULT_WORKTREE_PROVISION_CONCURRENCY, a2 as EagerResumeFailReason, a3 as EagerResumeOutcome, a4 as EagerResumeSkipReason, a5 as GateSpec, a6 as HostInfo, a7 as JudgeGateSpec, a8 as LabeledProcessStatsReport, a9 as LabeledSessionStats, aa as MAX_MESSAGE_DATA_BYTES, ab as MESSAGE_KINDS, ac as MESSAGE_PREAMBLE, ad as MESSAGE_TAG, ae as MESSAGE_URGENCIES, af as MessageDeliveryVia, ag as MessageFilter, ah as MessageRelation, ai as MessageTreeNode, aj as NO_OUTPUT_STALL_TURN_ERROR, ak as OnFailSpec, al as OrphanGroup, am as PendingPermission, an as PermissionRespondInput, ao as PermissionRespondResult, ap as PolicyRunStatus, aq as PricingResolver, ar as ProcessDetail, as as ProcessStatsReport, at as ProcessStatsService, au as QuotaStoreFile, av as QuotaStoreOptions, aw as RegisterBrowserInput, ax as RegisterSessionInput, ay as RemainingQuota, az as ResourceStats, aA as ResumeDisabledError, aB as SESSION_END_REASONS, aC as SESSION_ID_ENV, aD as SessionCurrentPhase, aE as SessionKind, aF as SessionMessageFrom, aG as SessionOutcome, aH as SessionOutcomeArtifact, aI as SessionOutcomeCompact, aJ as SessionOutcomeLink, aK as SessionResourceStats, aL as SessionRetiredError, aM as SessionSnapshots, aN as SessionStatus, aO as ShellGateSpec, aP as SpawnAgentInput, aQ as SpawnSessionInput, aR as StatsDetail, aS as StoredProfileQuota, aT as TASK_STATUSES, aU as TaskCaller, aV as TaskChangedEvent, aW as TaskClaimInput, aX as TaskCreateInput, aY as TaskGateOutcome, aZ as TaskGateRunner, a_ as TaskLedgerRegistry, a$ as TaskLedgerSessionSlice, b0 as TaskListFilter, b1 as TaskRecord, b2 as TaskStatus, b3 as TaskUpdateInput, b4 as TaskVerification, b5 as TaskVerifySupervisor, b6 as TaskWriteResult, b7 as TokenPricing, b8 as UsageBucket, b9 as UsageComputeInput, ba as UsageDetail, bb as UsageSource, bc as UserPresetsFile, bd as WORKSPACE_SLUG_ENV, be as WORKTREE_ISOLATION_ENV, bf as WORKTREE_PROVISION_CONCURRENCY_ENV, bg as WorktreeDecision, bh as WorktreeProvisionOutcome, bi as WorktreeProvisionPhase, bj as WorktreeProvisionProgress, bk as WorktreeProvisionRequest, bl as WorktreeRequest, bm as activityCounts, bn as compactOutcome, bo as createProcessStatsService, bp as createSessionMessage, bq as createSupervisorTaskGateRunner, br as createTaskLedger, bs as decideWorktreeIsolation, bt as deleteUserPreset, bu as deriveSessionOutcome, bv as deriveSessionUsage, bw as escapeHumanPrompt, bx as escapeMessageBody, by as filterActivities, bz as getProcessStatsService, bA as getUserPreset, bB as isClosedTaskStatus, bC as isKnownSessionEndReason, bD as isMessageAllowed, bE as isProviderLimitError, bF as isTerminalActivityState, bG as listUserPresets, bH as loadQuotaStore, bI as loadUserPresets, bJ as loadWorktreeIsolation, bK as matchesMessageFilter, bL as messageFrom, bM as mintMessageId, bN as normalizeCommand, bO as normalizeWorktreeField, bP as parseAnthropicRateLimitHeaders, bQ as parseTaskStatus, bR as parseWindow, bS as parseWorktreeIsolationMode, bT as pickUsageDetail, bU as policyToActivities, bV as policyWatchesSession, bW as prToActivities, bX as projectSessionUsage, bY as readProfileQuota, bZ as recordProfileQuota, b_ as renderInboxDigest, b$ as renderSessionMessage, c0 as renderSessionMessages, c1 as resolveRelation, c2 as rollupUsage, c3 as sanitizeLabel, c4 as saveUserPreset, c5 as trackWorktreeProvision, c6 as turnToActivities, c7 as userPresetsPath, c8 as workflowToActivities } from './sessions-
|
|
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 PendingPromptView, x as StatsSessionDescriptor, y as ProcRow, z as ProvisionInFlight, B as ProvisionTracker, D as SessionCrashReason, E as UsageRollup, F as RemainingQuotaReader, Q as QuotaReadableProfile, G as UsageSnapshotRecord, H as SessionAwaitingQuestion, I as PolicyRunState, J as PtyFactory, K as WorktreeAutoReclaimer } from './sessions-Dq4mAphj.js';
|
|
7
|
+
export { L as ActivityKind, N as ActivitySource, O as ActivityState, V as ActivityWaitingOn, X as AnthropicReaderConfig, Y as AnthropicRemainingQuotaReader, Z as AttachPolicyInput, _ as CommandGroupStats, $ as CommitSpec, a0 as DEFAULT_WORKTREE_ISOLATION, a1 as DEFAULT_WORKTREE_PROVISION_CONCURRENCY, a2 as EagerResumeFailReason, a3 as EagerResumeOutcome, a4 as EagerResumeSkipReason, a5 as GateSpec, a6 as HostInfo, a7 as JudgeGateSpec, a8 as LabeledProcessStatsReport, a9 as LabeledSessionStats, aa as MAX_MESSAGE_DATA_BYTES, ab as MESSAGE_KINDS, ac as MESSAGE_PREAMBLE, ad as MESSAGE_TAG, ae as MESSAGE_URGENCIES, af as MessageDeliveryVia, ag as MessageFilter, ah as MessageRelation, ai as MessageTreeNode, aj as NO_OUTPUT_STALL_TURN_ERROR, ak as OnFailSpec, al as OrphanGroup, am as PendingPermission, an as PermissionRespondInput, ao as PermissionRespondResult, ap as PolicyRunStatus, aq as PricingResolver, ar as ProcessDetail, as as ProcessStatsReport, at as ProcessStatsService, au as QuotaStoreFile, av as QuotaStoreOptions, aw as RegisterBrowserInput, ax as RegisterSessionInput, ay as RemainingQuota, az as ResourceStats, aA as ResumeDisabledError, aB as SESSION_END_REASONS, aC as SESSION_ID_ENV, aD as SessionCurrentPhase, aE as SessionKind, aF as SessionMessageFrom, aG as SessionOutcome, aH as SessionOutcomeArtifact, aI as SessionOutcomeCompact, aJ as SessionOutcomeLink, aK as SessionResourceStats, aL as SessionRetiredError, aM as SessionSnapshots, aN as SessionStatus, aO as ShellGateSpec, aP as SpawnAgentInput, aQ as SpawnSessionInput, aR as StatsDetail, aS as StoredProfileQuota, aT as TASK_STATUSES, aU as TaskCaller, aV as TaskChangedEvent, aW as TaskClaimInput, aX as TaskCreateInput, aY as TaskGateOutcome, aZ as TaskGateRunner, a_ as TaskLedgerRegistry, a$ as TaskLedgerSessionSlice, b0 as TaskListFilter, b1 as TaskRecord, b2 as TaskStatus, b3 as TaskUpdateInput, b4 as TaskVerification, b5 as TaskVerifySupervisor, b6 as TaskWriteResult, b7 as TokenPricing, b8 as UsageBucket, b9 as UsageComputeInput, ba as UsageDetail, bb as UsageSource, bc as UserPresetsFile, bd as WORKSPACE_SLUG_ENV, be as WORKTREE_ISOLATION_ENV, bf as WORKTREE_PROVISION_CONCURRENCY_ENV, bg as WorktreeDecision, bh as WorktreeProvisionOutcome, bi as WorktreeProvisionPhase, bj as WorktreeProvisionProgress, bk as WorktreeProvisionRequest, bl as WorktreeRequest, bm as activityCounts, bn as compactOutcome, bo as createProcessStatsService, bp as createSessionMessage, bq as createSupervisorTaskGateRunner, br as createTaskLedger, bs as decideWorktreeIsolation, bt as deleteUserPreset, bu as deriveSessionOutcome, bv as deriveSessionUsage, bw as escapeHumanPrompt, bx as escapeMessageBody, by as filterActivities, bz as getProcessStatsService, bA as getUserPreset, bB as isClosedTaskStatus, bC as isKnownSessionEndReason, bD as isMessageAllowed, bE as isProviderLimitError, bF as isTerminalActivityState, bG as listUserPresets, bH as loadQuotaStore, bI as loadUserPresets, bJ as loadWorktreeIsolation, bK as matchesMessageFilter, bL as messageFrom, bM as mintMessageId, bN as normalizeCommand, bO as normalizeWorktreeField, bP as parseAnthropicRateLimitHeaders, bQ as parseTaskStatus, bR as parseWindow, bS as parseWorktreeIsolationMode, bT as pickUsageDetail, bU as policyToActivities, bV as policyWatchesSession, bW as prToActivities, bX as projectSessionUsage, bY as readProfileQuota, bZ as recordProfileQuota, b_ as renderInboxDigest, b$ as renderSessionMessage, c0 as renderSessionMessages, c1 as resolveRelation, c2 as rollupUsage, c3 as sanitizeLabel, c4 as saveUserPreset, c5 as trackWorktreeProvision, c6 as turnToActivities, c7 as userPresetsPath, c8 as workflowToActivities } from './sessions-Dq4mAphj.js';
|
|
8
8
|
import { R as RouteSpec, P as Posture, C as ContextProfile, a as CanonicalPosture } from './session-config-B3PRyxlI.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-B3PRyxlI.js';
|
|
10
10
|
import { AcpMcpServer } from '@agentproto/acp';
|
|
@@ -532,6 +532,44 @@ type DeliveryPreference = {
|
|
|
532
532
|
callbackUrl?: string;
|
|
533
533
|
secret?: string;
|
|
534
534
|
};
|
|
535
|
+
/** One polled item the provider could not turn into a {@link SentinelEvent}
|
|
536
|
+
* (poison envelope). Reported — never silently skipped — so the runtime can
|
|
537
|
+
* quarantine it durably BEFORE the cursor moves past it. Deliberately carries
|
|
538
|
+
* no payload `data`: identifiers, the parse error, and a digest only, so the
|
|
539
|
+
* quarantine record can be inspected without exposing secrets. */
|
|
540
|
+
interface SentinelMalformedItem {
|
|
541
|
+
/** Provider sequence number, when the item had one. */
|
|
542
|
+
seq?: number;
|
|
543
|
+
/** The provider's own delivery id (agentpush `delivery_id`). */
|
|
544
|
+
remoteDeliveryId?: string;
|
|
545
|
+
error: string;
|
|
546
|
+
/** Best-effort string identifiers lifted from the envelope. */
|
|
547
|
+
excerpt?: {
|
|
548
|
+
id?: string;
|
|
549
|
+
type?: string;
|
|
550
|
+
subject?: string;
|
|
551
|
+
source?: string;
|
|
552
|
+
};
|
|
553
|
+
/** sha256 hex of the item's JSON, for correlating with the remote copy. */
|
|
554
|
+
digest?: string;
|
|
555
|
+
bytes?: number;
|
|
556
|
+
}
|
|
557
|
+
/** Result of one provider poll. */
|
|
558
|
+
interface SentinelPollResult {
|
|
559
|
+
events: SentinelEvent[];
|
|
560
|
+
cursor: string;
|
|
561
|
+
/** Items that could not be parsed. The runtime quarantines each before it
|
|
562
|
+
* acknowledges `cursor`. */
|
|
563
|
+
malformed?: SentinelMalformedItem[];
|
|
564
|
+
}
|
|
565
|
+
/** `renew` found the backing remote subscription already expired or deleted.
|
|
566
|
+
* The caller must unsubscribe and recreate; a provider never silently
|
|
567
|
+
* provisions a replacement. */
|
|
568
|
+
declare class SentinelBackingExpiredError extends Error {
|
|
569
|
+
readonly code: "backing_subscription_expired";
|
|
570
|
+
readonly remoteId?: string;
|
|
571
|
+
constructor(message: string, remoteId?: string);
|
|
572
|
+
}
|
|
535
573
|
/** Extra context the runtime/tools hand to `create` beyond the spec. */
|
|
536
574
|
interface SentinelCreateContext {
|
|
537
575
|
/** The id the store will record this sentinel under (`sen_<ulid>`), minted
|
|
@@ -563,6 +601,19 @@ interface SentinelProviderHandle extends AdapterHandle {
|
|
|
563
601
|
* cursor). */
|
|
564
602
|
attach(handle: SentinelHandle, delivery: DeliveryPreference): Promise<SentinelHandle>;
|
|
565
603
|
cancel(handle: SentinelHandle): Promise<void>;
|
|
604
|
+
/** True when every handle owns a DISTINCT remote resource (agentpush: one
|
|
605
|
+
* subscription per sentinel), so a failed `cancel` is worth persisting and
|
|
606
|
+
* retrying as a cancel tombstone keyed by `provider + remoteId`. Providers
|
|
607
|
+
* that share one remote across handles (the webhook provider's per-repo
|
|
608
|
+
* hook, refcounted by holder) leave this unset and keep the best-effort
|
|
609
|
+
* cancel. */
|
|
610
|
+
exclusiveRemote?: boolean;
|
|
611
|
+
/** Extend the backing remote watch to `until` (MCP Events refresh). Throws
|
|
612
|
+
* {@link SentinelBackingExpiredError} when the remote is already expired or
|
|
613
|
+
* deleted; any other throw is a transient failure. Absent = the provider
|
|
614
|
+
* holds no remote lifetime to extend (local-only watches). Returns the
|
|
615
|
+
* (possibly updated) handle. */
|
|
616
|
+
renew?(handle: SentinelHandle, until: SentinelUntil): Promise<SentinelHandle>;
|
|
566
617
|
status(handle: SentinelHandle): Promise<{
|
|
567
618
|
ok: boolean;
|
|
568
619
|
detail?: string;
|
|
@@ -570,10 +621,7 @@ interface SentinelProviderHandle extends AdapterHandle {
|
|
|
570
621
|
}>;
|
|
571
622
|
/** Poll mode: events after `handle.cursor`, oldest first, plus the new
|
|
572
623
|
* cursor. */
|
|
573
|
-
poll?(handle: SentinelHandle, limit: number): Promise<
|
|
574
|
-
events: SentinelEvent[];
|
|
575
|
-
cursor: string;
|
|
576
|
-
}>;
|
|
624
|
+
poll?(handle: SentinelHandle, limit: number): Promise<SentinelPollResult>;
|
|
577
625
|
ack?(handle: SentinelHandle, cursor: string): Promise<void>;
|
|
578
626
|
/** Push mode: verify + parse one inbound HTTP request into events (called
|
|
579
627
|
* by the `"sentinel"` dialect on `POST /inbound/sentinel-<hookKey>`). */
|
|
@@ -832,6 +880,304 @@ interface SessionFollowStoreOptions {
|
|
|
832
880
|
}
|
|
833
881
|
declare function createSessionFollowStore(opts?: SessionFollowStoreOptions): SessionFollowStore;
|
|
834
882
|
|
|
883
|
+
/**
|
|
884
|
+
* Persisted cancel tombstones — the remote-deletion half of unwatching.
|
|
885
|
+
*
|
|
886
|
+
* Removing a local sentinel while the backing remote subscription is
|
|
887
|
+
* unreachable used to orphan the remote (a best-effort `provider.cancel` whose
|
|
888
|
+
* failure was swallowed). Now the intent to delete is recorded durably FIRST,
|
|
889
|
+
* keyed by `provider + remoteId` — the identity of the remote resource, NOT the
|
|
890
|
+
* (deterministic) MCP subscription id, so an immediate re-subscribe, which
|
|
891
|
+
* provisions a new remote with a new id, is never touched by the old tombstone.
|
|
892
|
+
* A sweep retries (with backoff) until the provider reports the remote gone
|
|
893
|
+
* (`cancel` is idempotent: 404/204 both resolve).
|
|
894
|
+
*
|
|
895
|
+
* Only identifiers are persisted; any state field that looks like a secret or
|
|
896
|
+
* route key is stripped from the stored handle.
|
|
897
|
+
*/
|
|
898
|
+
|
|
899
|
+
interface CancelTombstone {
|
|
900
|
+
/** `provider|remoteId`. */
|
|
901
|
+
key: string;
|
|
902
|
+
provider: string;
|
|
903
|
+
remoteId: string;
|
|
904
|
+
/** The handle with secrets stripped — enough for `provider.cancel`. */
|
|
905
|
+
handle: SentinelHandle;
|
|
906
|
+
createdAt: number;
|
|
907
|
+
attempts: number;
|
|
908
|
+
nextAttemptAt: number;
|
|
909
|
+
lastAttemptAt?: number;
|
|
910
|
+
lastError?: string;
|
|
911
|
+
}
|
|
912
|
+
interface CancelResult {
|
|
913
|
+
/** The provider confirmed the remote is gone (deleted or already absent). */
|
|
914
|
+
converged: boolean;
|
|
915
|
+
tombstone?: CancelTombstone;
|
|
916
|
+
}
|
|
917
|
+
interface CancelTombstoneStore {
|
|
918
|
+
/** Record the deletion intent durably, run `afterRecorded` (the caller drops
|
|
919
|
+
* its local record there, so delivery eligibility ends BEFORE any network
|
|
920
|
+
* call), attempt the remote delete, and remove the tombstone once the
|
|
921
|
+
* provider confirms. Rejects only when the intent could not be made
|
|
922
|
+
* durable — nothing local has been dropped yet at that point. */
|
|
923
|
+
cancel(handle: SentinelHandle, afterRecorded?: () => void): Promise<CancelResult>;
|
|
924
|
+
/** Retry every tombstone whose backoff elapsed. */
|
|
925
|
+
sweep(): Promise<{
|
|
926
|
+
attempted: number;
|
|
927
|
+
converged: number;
|
|
928
|
+
remaining: number;
|
|
929
|
+
}>;
|
|
930
|
+
list(): CancelTombstone[];
|
|
931
|
+
has(provider: string, remoteId: string): boolean;
|
|
932
|
+
}
|
|
933
|
+
|
|
934
|
+
/**
|
|
935
|
+
* Signed event delivery with bounded retry (W-A of
|
|
936
|
+
* `.plans/sentinel-mcp-events/PLAN.md`, §3 frozen).
|
|
937
|
+
*
|
|
938
|
+
* I2 — the body is serialized ONCE: the clamp (when needed) happens first,
|
|
939
|
+
* then the exact bytes are signed per attempt with a FRESH timestamp. An
|
|
940
|
+
* observer sees a different `webhook-signature` header per attempt while the
|
|
941
|
+
* body bytes stay bitwise identical — `signWebhook` returns ONLY headers and
|
|
942
|
+
* never re-serializes.
|
|
943
|
+
*
|
|
944
|
+
* ≤ 256 KiB — when the serialized body exceeds 262 144 bytes, `data` is
|
|
945
|
+
* replaced with `{summary, subject}` and the envelope gains `truncated: true`
|
|
946
|
+
* (no read tool — plan §5), and the CLAMPED bytes (not the original) are what
|
|
947
|
+
* every attempt signs.
|
|
948
|
+
*
|
|
949
|
+
* Retry — exponential backoff bounded to 5 attempts; 3xx / other 4xx / 5xx /
|
|
950
|
+
* network errors retry; 410/413 are terminal with NO further attempt;
|
|
951
|
+
* 2xx = delivered. The returned `DeliveryState` is what the caller persists
|
|
952
|
+
* into the store for post-restart resume (W-B's job to wire).
|
|
953
|
+
*/
|
|
954
|
+
type McpEventEnvelope = {
|
|
955
|
+
/** OpenAI doc wire shape VERBATIM (developers.openai.com/plugins/build/mcp-events):
|
|
956
|
+
* `eventId` (NOT `id` — the `webhook-id` header carries eventId), `name`,
|
|
957
|
+
* `timestamp`, `data`, `cursor`. A top-level `type` field = protocol
|
|
958
|
+
* control notification only — never sent by us (no control events). */
|
|
959
|
+
eventId: string;
|
|
960
|
+
name: string;
|
|
961
|
+
timestamp: string;
|
|
962
|
+
data: Record<string, unknown>;
|
|
963
|
+
cursor: string | null;
|
|
964
|
+
truncated?: boolean;
|
|
965
|
+
};
|
|
966
|
+
interface DeliveryState {
|
|
967
|
+
attempts: number;
|
|
968
|
+
lastError?: string;
|
|
969
|
+
lastAt?: string;
|
|
970
|
+
}
|
|
971
|
+
interface DeliveryReplay {
|
|
972
|
+
subId: string;
|
|
973
|
+
callbackUrl: string;
|
|
974
|
+
secrets: readonly string[];
|
|
975
|
+
}
|
|
976
|
+
/** One event → one POST. Frozen §3 outcome. */
|
|
977
|
+
type DeliveryOutcome = {
|
|
978
|
+
ok: true;
|
|
979
|
+
delivery: DeliveryState;
|
|
980
|
+
} | {
|
|
981
|
+
ok: false;
|
|
982
|
+
reason: string;
|
|
983
|
+
delivery: DeliveryState;
|
|
984
|
+
};
|
|
985
|
+
interface SsrfFetchArgs$1 {
|
|
986
|
+
method?: "POST";
|
|
987
|
+
headers?: Record<string, string>;
|
|
988
|
+
body?: Uint8Array;
|
|
989
|
+
timeoutMs: number;
|
|
990
|
+
}
|
|
991
|
+
interface DeliverEventDeps {
|
|
992
|
+
/** Replaces the POST boundary (tests only). Default: the shared `ssrfFetch` gate. */
|
|
993
|
+
fetch?: (url: string, init: SsrfFetchArgs$1) => Promise<{
|
|
994
|
+
status: number;
|
|
995
|
+
body: string;
|
|
996
|
+
}>;
|
|
997
|
+
/** Backoff sleep (tests only). Default: real `setTimeout`. */
|
|
998
|
+
sleep?: (ms: number) => Promise<void>;
|
|
999
|
+
/** Clock (tests only). Default: real wall clock. */
|
|
1000
|
+
now?: () => number;
|
|
1001
|
+
/** Observability hook: one call per attempt outcome. Carries NO url, body or
|
|
1002
|
+
* secret — only the attempt number, HTTP status / redacted error reason,
|
|
1003
|
+
* and whether the attempt ended the delivery (`delivered`/`dead`) or will
|
|
1004
|
+
* be retried. A throwing hook never affects delivery. */
|
|
1005
|
+
onAttempt?: (info: DeliveryAttemptInfo) => void;
|
|
1006
|
+
}
|
|
1007
|
+
interface DeliveryAttemptInfo {
|
|
1008
|
+
attempt: number;
|
|
1009
|
+
/** HTTP status when the receiver answered. */
|
|
1010
|
+
status?: number;
|
|
1011
|
+
/** Redacted failure reason (no URL) when there is no usable status. */
|
|
1012
|
+
error?: string;
|
|
1013
|
+
outcome: "delivered" | "retry" | "dead";
|
|
1014
|
+
}
|
|
1015
|
+
declare const CLAMP_LIMIT_BYTES = 262144;
|
|
1016
|
+
declare const MAX_ATTEMPTS = 5;
|
|
1017
|
+
/** Bounded exponential backoff: 250, 500, 1000, 2000, capped at 4000 (attempt ≥ 4). */
|
|
1018
|
+
declare function deliveryBackoffDelay(attempt: number): number;
|
|
1019
|
+
declare function serializeEnvelope(envelope: McpEventEnvelope): Uint8Array;
|
|
1020
|
+
/** Serialize once; over-size → `{summary, subject}` + `truncated:true` (§3). */
|
|
1021
|
+
declare function envelopeClampedBytes(event: McpEventEnvelope): {
|
|
1022
|
+
bytes: Uint8Array;
|
|
1023
|
+
clamped: boolean;
|
|
1024
|
+
};
|
|
1025
|
+
declare function deliverEventEnvelope(replay: DeliveryReplay, event: McpEventEnvelope, deps?: DeliverEventDeps): Promise<DeliveryOutcome>;
|
|
1026
|
+
|
|
1027
|
+
/**
|
|
1028
|
+
* SentinelWebhookOutbox — the PERSISTED outbox for `webhook`-target sentinel
|
|
1029
|
+
* events (W-B of `.plans/sentinel-mcp-events/PLAN.md`, §4 task 3).
|
|
1030
|
+
*
|
|
1031
|
+
* Why an outbox: the runtime's `processEvents` marks an event `seen` the
|
|
1032
|
+
* moment in-process handling resolves, but a webhook POST is an EXTERNAL
|
|
1033
|
+
* delivery — a crash between ack and delivery loses the event forever (I4).
|
|
1034
|
+
* So the webhook fire path appends a DURABLE row first:
|
|
1035
|
+
*
|
|
1036
|
+
* `{sentinelId, requestId, eventId, bodyBytes, cursor:null,
|
|
1037
|
+
* deliveryState, status: pending|delivered|dead}`
|
|
1038
|
+
*
|
|
1039
|
+
* with `bodyBytes` = the EXACT canonical body bytes that will be sent (I2 —
|
|
1040
|
+
* the envelope is serialized once here via `serializeEnvelope`; the dispatch
|
|
1041
|
+
* re-signs those same bytes, and `deliverEventEnvelope`'s internal
|
|
1042
|
+
* serialization is deterministic over the stored envelope — asserted by
|
|
1043
|
+
* tests). The underlying sentinel event is marked seen/acked ONLY when the
|
|
1044
|
+
* row reaches terminal status (`delivered`, or `dead` per the retry cap /
|
|
1045
|
+
* age-out); a dispatch that THREW (crash-shaped) leaves the row `pending`,
|
|
1046
|
+
* the event UN-acked, and a restart re-dispatches it by exact bytes.
|
|
1047
|
+
*
|
|
1048
|
+
* Ordering across events of one subscription is never assumed (I5). Rows
|
|
1049
|
+
* reaped once `delivered` for 24 h; pending rows age out after 7 d (plan
|
|
1050
|
+
* risk table); the file is capped. Feedback-loop guard is data, not policy:
|
|
1051
|
+
* the `ssrfFetch` gate inside `deliverEventEnvelope` inherently blocks
|
|
1052
|
+
* loopback/private delivery targets, so nothing here can ring back into our
|
|
1053
|
+
* own inbound routes — self-delivery cannot even connect.
|
|
1054
|
+
*/
|
|
1055
|
+
|
|
1056
|
+
type SentinelWebhookOutboxStatus = "pending" | "delivered" | "dead";
|
|
1057
|
+
interface SentinelWebhookOutboxRow {
|
|
1058
|
+
sentinelId: string;
|
|
1059
|
+
/** Deterministic sub id over `(sentinelId, eventId)` — stable across
|
|
1060
|
+
* restarts (I1: a redelivery is a consumer no-op; the wire `webhook-id`
|
|
1061
|
+
* header stays the EVENT id). */
|
|
1062
|
+
requestId: string;
|
|
1063
|
+
eventId: string;
|
|
1064
|
+
/** The EXACT body bytes, as sent — utf-8 base64 of `serializeEnvelope`
|
|
1065
|
+
* (I2: bytes stored exactly as sent; resume dispatches the stored bytes). */
|
|
1066
|
+
bodyBytes: string;
|
|
1067
|
+
/** v1 events are non-replayable (plan §2) — always null. */
|
|
1068
|
+
cursor: null;
|
|
1069
|
+
/** Persisted W-A delivery state so a post-restart dispatch makes sense. */
|
|
1070
|
+
deliveryState: {
|
|
1071
|
+
attempts: number;
|
|
1072
|
+
lastError?: string;
|
|
1073
|
+
lastAt?: string;
|
|
1074
|
+
};
|
|
1075
|
+
status: SentinelWebhookOutboxStatus;
|
|
1076
|
+
/** The bounded-retry loop's final `ok:false` reason. */
|
|
1077
|
+
failReason?: string;
|
|
1078
|
+
/** Why the outbox itself went a row `dead` (`sentinel_expired`,
|
|
1079
|
+
* `sentinel_removed`, `age_out`). */
|
|
1080
|
+
deadReason?: string;
|
|
1081
|
+
createdAt: number;
|
|
1082
|
+
/** Wall-clock ms the row reached terminal status (drives reaping). */
|
|
1083
|
+
terminalAt?: number;
|
|
1084
|
+
}
|
|
1085
|
+
/** The full row is JSON-persisted; the envelope rides along so a resumed
|
|
1086
|
+
* dispatch re-delivers byte-identically without re-deriving the projection,
|
|
1087
|
+
* and the original event rides along for ack-time lifetime bookkeeping
|
|
1088
|
+
* (terminal flag / subject tracking). */
|
|
1089
|
+
type PersistedOutboxRow = SentinelWebhookOutboxRow & {
|
|
1090
|
+
envelope?: McpEventEnvelope;
|
|
1091
|
+
event?: SentinelEvent;
|
|
1092
|
+
};
|
|
1093
|
+
/** Per-sentinel delivery health, derived from the outbox rows. Carries no
|
|
1094
|
+
* URL, body or secret — `lastError` is URL-redacted. */
|
|
1095
|
+
interface SentinelDeliveryStatus {
|
|
1096
|
+
/** At least one row is still `pending` (being delivered / retried). */
|
|
1097
|
+
active: boolean;
|
|
1098
|
+
/** ISO time of the most recent delivery attempt, when any ran. */
|
|
1099
|
+
lastDeliveryAt?: string;
|
|
1100
|
+
/** Status of the most recent row. */
|
|
1101
|
+
lastStatus: SentinelWebhookOutboxStatus;
|
|
1102
|
+
lastError?: string;
|
|
1103
|
+
/** Attempts spent on the most recent row. */
|
|
1104
|
+
attempts: number;
|
|
1105
|
+
/** Count of `dead` rows still held by the outbox. */
|
|
1106
|
+
dead: number;
|
|
1107
|
+
}
|
|
1108
|
+
interface SentinelWebhookOutbox {
|
|
1109
|
+
/** Delivery health for one sentinel, or `undefined` when the outbox holds no
|
|
1110
|
+
* row for it (never delivered anything / reaped). */
|
|
1111
|
+
deliveryStatus(sentinelId: string): SentinelDeliveryStatus | undefined;
|
|
1112
|
+
/** Append a row for a matched webhook-delivery event. Resolves ONLY after
|
|
1113
|
+
* the row is crash-durable (atomic write + fsync + rename + dir fsync) —
|
|
1114
|
+
* callers ack the upstream (Agentpush cursor, push HTTP 2xx) on resolve.
|
|
1115
|
+
* A persistence failure rejects and rolls the row back, so the caller
|
|
1116
|
+
* leaves the upstream un-acked. Idempotent per `(sentinelId, eventId)`: an
|
|
1117
|
+
* existing row (pending OR terminal) is never duplicated — returns
|
|
1118
|
+
* `undefined` (after waiting for any in-flight write that carries it), and
|
|
1119
|
+
* for a terminal existing row re-fires `onTerminal` so a lost ack (crash
|
|
1120
|
+
* between the terminal transition and the store write) still lands. Kicks
|
|
1121
|
+
* dispatch off asynchronously once durable. */
|
|
1122
|
+
enqueue(input: {
|
|
1123
|
+
sentinelId: string;
|
|
1124
|
+
event: SentinelEvent;
|
|
1125
|
+
}): Promise<SentinelWebhookOutboxRow | undefined>;
|
|
1126
|
+
/** Dispatch every `pending` row (serialized, one POST in flight). Consults
|
|
1127
|
+
* `isExpired` per row AND the secrets sidecar BEFORE dispatch — an
|
|
1128
|
+
* expired or unwound sentinel never delivers another byte. */
|
|
1129
|
+
dispatch(): Promise<void>;
|
|
1130
|
+
/** Startup re-enqueue: re-dispatch every `pending` row by exact stored
|
|
1131
|
+
* bytes (no payload re-serialization on the resume path). */
|
|
1132
|
+
resumeDeliveries(): Promise<void>;
|
|
1133
|
+
/** Re-`delivered` rows after 24 h are reaped; pending rows age out after
|
|
1134
|
+
* 7 d (plan risk table). Cheap; called on the runtime's periodic tick. */
|
|
1135
|
+
sweep(): void;
|
|
1136
|
+
rows(): PersistedOutboxRow[];
|
|
1137
|
+
/** Synchronous flush for shutdown paths. */
|
|
1138
|
+
flushSync(): void;
|
|
1139
|
+
}
|
|
1140
|
+
interface SentinelWebhookOutboxOptions {
|
|
1141
|
+
/** Override persist path. Default `~/.agentproto/sentinel-webhook-outbox.json`. */
|
|
1142
|
+
filePath?: string;
|
|
1143
|
+
/** Injectable clock. */
|
|
1144
|
+
nowMs?: () => number;
|
|
1145
|
+
/** Debounce interval for the non-critical (status-transition) disk writes.
|
|
1146
|
+
* Enqueue never debounces. Default 1500 ms. */
|
|
1147
|
+
debounceMs?: number;
|
|
1148
|
+
/** Disable disk persistence (unit tests). Default false unless filePath. */
|
|
1149
|
+
persist?: boolean;
|
|
1150
|
+
/** DI boundary (not module fakes): replaces W-A's `deliverEventEnvelope`
|
|
1151
|
+
* as the POST boundary. Throws = dispatch did not complete (row stays
|
|
1152
|
+
* pending, event stays un-acked). Default: the real deliverer. */
|
|
1153
|
+
deliverEvent?: (input: {
|
|
1154
|
+
replay: DeliveryReplay;
|
|
1155
|
+
row: PersistedOutboxRow;
|
|
1156
|
+
}) => Promise<DeliveryOutcome>;
|
|
1157
|
+
/** Test seam for the DEFAULT deliverer only (fetch / sleep / clock). */
|
|
1158
|
+
deliverDeps?: Pick<DeliverEventDeps, "fetch" | "sleep" | "now">;
|
|
1159
|
+
/** Signing secrets for a sentinel — `{subId, callbackUrl, secrets[]}`, or
|
|
1160
|
+
* null when the sentinel/secret sidecar is gone (row goes dead, never
|
|
1161
|
+
* silently lost). */
|
|
1162
|
+
secretsFor: (sentinelId: string) => DeliveryReplay | null;
|
|
1163
|
+
/** Expiry gate, consulted BEFORE every dispatch (plan §4 W-B task 2b).
|
|
1164
|
+
* true = the sentinel is past its `until` and must not deliver. */
|
|
1165
|
+
isExpired: (sentinelId: string) => boolean;
|
|
1166
|
+
/** The ack — mark the underlying event seen, after terminal status only. */
|
|
1167
|
+
onTerminal: (sentinelId: string, row: SentinelWebhookOutboxRow) => void;
|
|
1168
|
+
log?: (line: string) => void;
|
|
1169
|
+
}
|
|
1170
|
+
/** `sub_<hex32>` — deterministic over (sentinelId, eventId). */
|
|
1171
|
+
declare function webhookRequestId(sentinelId: string, eventId: string): `sub_${string}`;
|
|
1172
|
+
/** The CloudEvents → MCP-Events-envelope fusion. W-C's `mcp-events/adapter.ts`
|
|
1173
|
+
* is now the canonical owner of this mapping (`toMcpEvent`); this alias keeps
|
|
1174
|
+
* the W-B call sites/tests working. The shape is the frozen §3 wire envelope —
|
|
1175
|
+
* insertion order stable, so its serialization is byte-stable across
|
|
1176
|
+
* restarts. `data` gains `subject`/`summary` so the 256 KiB clamp's
|
|
1177
|
+
* `{summary, subject}` replacement never goes blind. */
|
|
1178
|
+
declare function toWebhookEnvelope(event: SentinelEvent): McpEventEnvelope;
|
|
1179
|
+
declare function createSentinelWebhookOutbox(opts: SentinelWebhookOutboxOptions): SentinelWebhookOutbox;
|
|
1180
|
+
|
|
835
1181
|
/**
|
|
836
1182
|
* LlmEndpointRegistry — supervised-sidecar manager for the
|
|
837
1183
|
* `@agentproto/llm-endpoint` proxy gateway.
|
|
@@ -3354,18 +3700,44 @@ interface BranchGcOutcomeView {
|
|
|
3354
3700
|
to?: BranchGcClass;
|
|
3355
3701
|
message?: string;
|
|
3356
3702
|
}
|
|
3357
|
-
|
|
3358
|
-
|
|
3359
|
-
|
|
3360
|
-
|
|
3361
|
-
|
|
3703
|
+
/** Per-scope tally of apply outcomes. `skipped` = everything that was not
|
|
3704
|
+
* deleted and did not fail (held, skipped-review, aborted-*); the exact
|
|
3705
|
+
* per-result counts stay in `byResult`. */
|
|
3706
|
+
interface BranchGcApplyScopeCounts {
|
|
3707
|
+
deleted: number;
|
|
3708
|
+
skipped: number;
|
|
3709
|
+
failed: number;
|
|
3710
|
+
}
|
|
3711
|
+
interface BranchGcApplySummary {
|
|
3712
|
+
/** `ok` = deletes only, no failures/aborts; `partial` = some deleted but
|
|
3713
|
+
* also failed or aborted; `failed` = failures and nothing deleted;
|
|
3714
|
+
* `noop` = nothing deleted, nothing failed. */
|
|
3715
|
+
status: "ok" | "partial" | "failed" | "noop";
|
|
3716
|
+
totals: BranchGcApplyScopeCounts;
|
|
3717
|
+
byScope: Record<BranchGcKind, BranchGcApplyScopeCounts>;
|
|
3718
|
+
byResult: Partial<Record<BranchGcOutcomeView["result"], number>>;
|
|
3719
|
+
restoreLog: string | null;
|
|
3720
|
+
}
|
|
3721
|
+
type BranchGcApplyResult = {
|
|
3362
3722
|
mode: "apply";
|
|
3363
3723
|
plan: BranchGcPlanView;
|
|
3364
3724
|
summary: BranchGcSummaryView;
|
|
3365
3725
|
outcomes: BranchGcOutcomeView[];
|
|
3366
3726
|
/** Restore log written before the first delete; `null` when nothing was deleted. */
|
|
3367
3727
|
restoreLog: string | null;
|
|
3728
|
+
/** Same value as `applySummary.status`, hoisted so a caller can branch on it. */
|
|
3729
|
+
status?: BranchGcApplySummary["status"];
|
|
3730
|
+
applySummary?: BranchGcApplySummary;
|
|
3368
3731
|
};
|
|
3732
|
+
type BranchGcResult = {
|
|
3733
|
+
mode: "plan";
|
|
3734
|
+
plan: BranchGcPlanView;
|
|
3735
|
+
summary: BranchGcSummaryView;
|
|
3736
|
+
} | BranchGcApplyResult;
|
|
3737
|
+
/** Pure: tally an apply result's outcomes per scope. */
|
|
3738
|
+
declare function summarizeBranchGcApply(result: BranchGcApplyResult): BranchGcApplySummary;
|
|
3739
|
+
/** Attach `status` + `applySummary` to an apply result; a plan passes through. */
|
|
3740
|
+
declare function withBranchGcApplySummary(result: BranchGcResult): BranchGcResult;
|
|
3369
3741
|
/** Input to the injected runner. `apply` defaults to false at the tool/route
|
|
3370
3742
|
* boundary — a bare call is a dry run — and an apply requires `scopes`. */
|
|
3371
3743
|
interface BranchGcRunInput {
|
|
@@ -6147,6 +6519,101 @@ interface SandboxReconcileResult {
|
|
|
6147
6519
|
*/
|
|
6148
6520
|
declare function reconcileSandboxLedger(deps: SandboxReconcileDeps): Promise<SandboxReconcileResult>;
|
|
6149
6521
|
|
|
6522
|
+
/**
|
|
6523
|
+
* Server-side narrowing for the session listers — the `session_list` MCP
|
|
6524
|
+
* tool and `GET /sessions` (+ `agentproto sessions --json`) share this one
|
|
6525
|
+
* module so the vocabulary and the semantics cannot drift between surfaces.
|
|
6526
|
+
*
|
|
6527
|
+
* Every filter is optional and AND-ed with the others. Vocabulary reuses
|
|
6528
|
+
* `session_follow`'s selector/exclude names (`rootOnly`, labels,
|
|
6529
|
+
* `parentSessionId`) rather than inventing a second one.
|
|
6530
|
+
*
|
|
6531
|
+
* Pure: no registry, no I/O, an injectable clock. The callers own subtree
|
|
6532
|
+
* scoping, archived/kind/status handling and pagination.
|
|
6533
|
+
*/
|
|
6534
|
+
|
|
6535
|
+
/** Raised for caller-fixable filter input (an unparsable time bound). */
|
|
6536
|
+
declare class SessionListFilterError extends Error {
|
|
6537
|
+
constructor(message: string);
|
|
6538
|
+
}
|
|
6539
|
+
/** A string or a list of strings. HTTP callers send `a,b` or repeat the key. */
|
|
6540
|
+
type StringOrList = string | readonly string[];
|
|
6541
|
+
interface SessionListFilterInput {
|
|
6542
|
+
/** Case-insensitive substring over id, name, label, title and cwd. */
|
|
6543
|
+
q?: string;
|
|
6544
|
+
/** Drop sessions whose `label` starts with any of these (case-sensitive). */
|
|
6545
|
+
excludeLabelPrefix?: StringOrList;
|
|
6546
|
+
/** Drop sessions whose `label` equals any of these (as `session_follow`'s `exclude.labels`). */
|
|
6547
|
+
excludeLabels?: StringOrList;
|
|
6548
|
+
/** Drop sessions of these kinds (`terminal` | `agent-cli` | `command`). */
|
|
6549
|
+
excludeKinds?: StringOrList;
|
|
6550
|
+
/** Only sessions with no parent (as `session_follow`'s `selector.rootOnly`). */
|
|
6551
|
+
rootOnly?: boolean;
|
|
6552
|
+
/** Only direct children of this session (the caller resolves a name to an id first). */
|
|
6553
|
+
parentSessionId?: string;
|
|
6554
|
+
/** Only sessions whose last activity (else start) is at/after this: ISO-8601 or relative (`30m`, `24h`, `7d`, `2w`). */
|
|
6555
|
+
updatedSince?: string;
|
|
6556
|
+
/** Only sessions started at/after this: ISO-8601 or relative. */
|
|
6557
|
+
startedSince?: string;
|
|
6558
|
+
/** Preset: drop review lanes, workflow stages and ended one-shot command runs (see {@link isNoiseSession}). */
|
|
6559
|
+
excludeNoise?: boolean;
|
|
6560
|
+
}
|
|
6561
|
+
/** Names of every filter key, for surfaces that parse them from a query string. */
|
|
6562
|
+
declare const SESSION_LIST_FILTER_KEYS: readonly ["q", "excludeLabelPrefix", "excludeLabels", "excludeKinds", "rootOnly", "parentSessionId", "updatedSince", "startedSince", "excludeNoise"];
|
|
6563
|
+
/** Copy only the filter keys (a tool input carries many other params). */
|
|
6564
|
+
declare function pickSessionListFilters(input: SessionListFilterInput): SessionListFilterInput;
|
|
6565
|
+
/**
|
|
6566
|
+
* Parse an ISO-8601 instant or a relative age (`90s`, `30m`, `24h`, `7d`,
|
|
6567
|
+
* `2w` = "that long before `now`") into epoch ms. Throws
|
|
6568
|
+
* {@link SessionListFilterError} on anything else.
|
|
6569
|
+
*/
|
|
6570
|
+
declare function parseTimeBound(raw: string, field: string, now?: number): number;
|
|
6571
|
+
type NoiseView = Pick<SessionDescriptor, "kind" | "status" | "label" | "origin" | "adapterSlug">;
|
|
6572
|
+
/**
|
|
6573
|
+
* What `excludeNoise: true` drops — exactly these, nothing else:
|
|
6574
|
+
* 1. review lanes: `label` starts with `review:` or `origin === "review"`;
|
|
6575
|
+
* 2. workflow stage sessions: `label` starts with `wf:` or `origin === "workflow"`;
|
|
6576
|
+
* 3. ended one-shot command runs: `status` is `exited` or `killed` and the
|
|
6577
|
+
* session is a plain command — `kind: "command"`, or `kind: "terminal"`
|
|
6578
|
+
* with no `adapterSlug` (an interactive agent TUI such as `claude` carries
|
|
6579
|
+
* one, so it is kept).
|
|
6580
|
+
* A live session of kind 3 (a running dev server, a `bash` you are typing in)
|
|
6581
|
+
* and every agent-cli session outside 1–2 are kept, as is anything `error`ed.
|
|
6582
|
+
*/
|
|
6583
|
+
declare function isNoiseSession(s: NoiseView): boolean;
|
|
6584
|
+
/** Epoch ms of a session's last activity, falling back to its start. */
|
|
6585
|
+
declare function sessionActivityMs(s: Pick<SessionDescriptor, "lastActivityAt" | "startedAt">): number;
|
|
6586
|
+
/** Newest activity first; ties broken by id so cursors stay stable. Returns a new array. */
|
|
6587
|
+
declare function sortNewestActivityFirst<T extends Pick<SessionDescriptor, "id" | "lastActivityAt" | "startedAt">>(rows: readonly T[]): T[];
|
|
6588
|
+
/** True when `input` carries at least one filter (an empty `q` / `false` flag does not count). */
|
|
6589
|
+
declare function hasSessionListFilters(input: SessionListFilterInput): boolean;
|
|
6590
|
+
type FilterableSession = Pick<SessionDescriptor, "id" | "kind" | "status" | "name" | "label" | "title" | "cwd" | "origin" | "adapterSlug" | "parentSessionId" | "lastActivityAt" | "startedAt">;
|
|
6591
|
+
/**
|
|
6592
|
+
* Compile `input` into a row predicate. Validates (and resolves relative
|
|
6593
|
+
* times against `now`) once, up front, so a bad `updatedSince` fails the
|
|
6594
|
+
* whole call instead of silently matching nothing.
|
|
6595
|
+
*/
|
|
6596
|
+
declare function compileSessionListFilters(input: SessionListFilterInput, now?: number): (s: FilterableSession) => boolean;
|
|
6597
|
+
/** Filter `rows` (order preserved). Throws {@link SessionListFilterError} on a bad time bound. */
|
|
6598
|
+
declare function applySessionListFilters<T extends FilterableSession>(rows: readonly T[], input: SessionListFilterInput, now?: number): T[];
|
|
6599
|
+
/**
|
|
6600
|
+
* Read the filters off an HTTP query string. Array-valued keys accept
|
|
6601
|
+
* `a,b` or a repeated key; booleans accept `true`/`1` (anything else is off).
|
|
6602
|
+
*/
|
|
6603
|
+
declare function parseSessionListFilterParams(params: URLSearchParams): SessionListFilterInput;
|
|
6604
|
+
/** Zod fragment spread into `session_list`'s input schema. */
|
|
6605
|
+
declare const sessionListFilterShape: {
|
|
6606
|
+
readonly q: z.ZodOptional<z.ZodString>;
|
|
6607
|
+
readonly excludeLabelPrefix: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]>>;
|
|
6608
|
+
readonly excludeLabels: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]>>;
|
|
6609
|
+
readonly excludeKinds: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]>>;
|
|
6610
|
+
readonly rootOnly: z.ZodOptional<z.ZodPreprocess<z.ZodBoolean, unknown>>;
|
|
6611
|
+
readonly parentSessionId: z.ZodOptional<z.ZodString>;
|
|
6612
|
+
readonly updatedSince: z.ZodOptional<z.ZodString>;
|
|
6613
|
+
readonly startedSince: z.ZodOptional<z.ZodString>;
|
|
6614
|
+
readonly excludeNoise: z.ZodOptional<z.ZodPreprocess<z.ZodBoolean, unknown>>;
|
|
6615
|
+
};
|
|
6616
|
+
|
|
6150
6617
|
/**
|
|
6151
6618
|
* Per-session structured event capture — one append-only JSONL file per
|
|
6152
6619
|
* agent-cli session, written at the same tap point where `projectEvent`
|
|
@@ -7167,6 +7634,52 @@ interface SentinelView {
|
|
|
7167
7634
|
eventCount: number;
|
|
7168
7635
|
lastEventTs?: number;
|
|
7169
7636
|
lastError?: string;
|
|
7637
|
+
/** Webhook-target sentinels only, once the outbox holds a row for it. */
|
|
7638
|
+
deliveryStatus?: SentinelDeliveryStatus;
|
|
7639
|
+
}
|
|
7640
|
+
|
|
7641
|
+
/**
|
|
7642
|
+
* Poison-item quarantine for polled sentinel batches.
|
|
7643
|
+
*
|
|
7644
|
+
* A provider that cannot turn a polled item into a `SentinelEvent` reports it
|
|
7645
|
+
* as malformed. The runtime must not advance (and acknowledge) the cursor past
|
|
7646
|
+
* it without a durable trace, or the item is lost the moment the remote drops
|
|
7647
|
+
* acked rows — yet it also must not stall the subscription forever on an item
|
|
7648
|
+
* that will never parse. So: record it here (fsynced append), THEN ack.
|
|
7649
|
+
*
|
|
7650
|
+
* Records carry identifiers, the parse error and a digest only — never the
|
|
7651
|
+
* envelope `data` or any credential — so the file is safe to inspect and ship
|
|
7652
|
+
* in a bug report. Recording is idempotent per
|
|
7653
|
+
* (sentinel, provider, remote delivery id | seq, digest): a redelivered batch
|
|
7654
|
+
* after a crash between "quarantined" and "acked" does not duplicate lines.
|
|
7655
|
+
*/
|
|
7656
|
+
|
|
7657
|
+
interface SentinelQuarantineRecord {
|
|
7658
|
+
/** Idempotency key. */
|
|
7659
|
+
key: string;
|
|
7660
|
+
quarantinedAt: string;
|
|
7661
|
+
sentinelId: string;
|
|
7662
|
+
provider: string;
|
|
7663
|
+
remoteId?: string;
|
|
7664
|
+
seq?: number;
|
|
7665
|
+
remoteDeliveryId?: string;
|
|
7666
|
+
error: string;
|
|
7667
|
+
excerpt?: SentinelMalformedItem["excerpt"];
|
|
7668
|
+
digest?: string;
|
|
7669
|
+
bytes?: number;
|
|
7670
|
+
}
|
|
7671
|
+
interface SentinelQuarantine {
|
|
7672
|
+
/** Durably record one poison item (idempotent). Throws when the write
|
|
7673
|
+
* fails — the caller must then NOT acknowledge the cursor. */
|
|
7674
|
+
record(input: {
|
|
7675
|
+
sentinelId: string;
|
|
7676
|
+
provider: string;
|
|
7677
|
+
remoteId?: string;
|
|
7678
|
+
item: SentinelMalformedItem;
|
|
7679
|
+
}): SentinelQuarantineRecord;
|
|
7680
|
+
list(filter?: {
|
|
7681
|
+
sentinelId?: string;
|
|
7682
|
+
}): SentinelQuarantineRecord[];
|
|
7170
7683
|
}
|
|
7171
7684
|
|
|
7172
7685
|
/**
|
|
@@ -7343,11 +7856,11 @@ interface VerifyCallbackInput {
|
|
|
7343
7856
|
}
|
|
7344
7857
|
interface VerifyCallbackDeps {
|
|
7345
7858
|
/** Replaces the POST boundary. Default: the shared `ssrfFetch` gate. */
|
|
7346
|
-
fetch?: (url: string, init: SsrfFetchArgs
|
|
7859
|
+
fetch?: (url: string, init: SsrfFetchArgs) => Promise<SsrfFetchView>;
|
|
7347
7860
|
/** Clock for the bounded TTL. Default: real wall clock. */
|
|
7348
7861
|
now?: () => number;
|
|
7349
7862
|
}
|
|
7350
|
-
interface SsrfFetchArgs
|
|
7863
|
+
interface SsrfFetchArgs {
|
|
7351
7864
|
method?: "POST";
|
|
7352
7865
|
headers?: Record<string, string>;
|
|
7353
7866
|
body?: Uint8Array;
|
|
@@ -7366,86 +7879,6 @@ declare function resetChallengeCacheForTests(): void;
|
|
|
7366
7879
|
declare function normalizeCallbackUrl(url: string): string | null;
|
|
7367
7880
|
declare function verifyCallback(input: VerifyCallbackInput, deps?: VerifyCallbackDeps): Promise<ChallengeOutcome>;
|
|
7368
7881
|
|
|
7369
|
-
/**
|
|
7370
|
-
* Signed event delivery with bounded retry (W-A of
|
|
7371
|
-
* `.plans/sentinel-mcp-events/PLAN.md`, §3 frozen).
|
|
7372
|
-
*
|
|
7373
|
-
* I2 — the body is serialized ONCE: the clamp (when needed) happens first,
|
|
7374
|
-
* then the exact bytes are signed per attempt with a FRESH timestamp. An
|
|
7375
|
-
* observer sees a different `webhook-signature` header per attempt while the
|
|
7376
|
-
* body bytes stay bitwise identical — `signWebhook` returns ONLY headers and
|
|
7377
|
-
* never re-serializes.
|
|
7378
|
-
*
|
|
7379
|
-
* ≤ 256 KiB — when the serialized body exceeds 262 144 bytes, `data` is
|
|
7380
|
-
* replaced with `{summary, subject}` and the envelope gains `truncated: true`
|
|
7381
|
-
* (no read tool — plan §5), and the CLAMPED bytes (not the original) are what
|
|
7382
|
-
* every attempt signs.
|
|
7383
|
-
*
|
|
7384
|
-
* Retry — exponential backoff bounded to 5 attempts; 3xx / other 4xx / 5xx /
|
|
7385
|
-
* network errors retry; 410/413 are terminal with NO further attempt;
|
|
7386
|
-
* 2xx = delivered. The returned `DeliveryState` is what the caller persists
|
|
7387
|
-
* into the store for post-restart resume (W-B's job to wire).
|
|
7388
|
-
*/
|
|
7389
|
-
type McpEventEnvelope = {
|
|
7390
|
-
/** OpenAI doc wire shape VERBATIM (developers.openai.com/plugins/build/mcp-events):
|
|
7391
|
-
* `eventId` (NOT `id` — the `webhook-id` header carries eventId), `name`,
|
|
7392
|
-
* `timestamp`, `data`, `cursor`. A top-level `type` field = protocol
|
|
7393
|
-
* control notification only — never sent by us (no control events). */
|
|
7394
|
-
eventId: string;
|
|
7395
|
-
name: string;
|
|
7396
|
-
timestamp: string;
|
|
7397
|
-
data: Record<string, unknown>;
|
|
7398
|
-
cursor: string | null;
|
|
7399
|
-
truncated?: boolean;
|
|
7400
|
-
};
|
|
7401
|
-
interface DeliveryState {
|
|
7402
|
-
attempts: number;
|
|
7403
|
-
lastError?: string;
|
|
7404
|
-
lastAt?: string;
|
|
7405
|
-
}
|
|
7406
|
-
interface DeliveryReplay {
|
|
7407
|
-
subId: string;
|
|
7408
|
-
callbackUrl: string;
|
|
7409
|
-
secrets: readonly string[];
|
|
7410
|
-
}
|
|
7411
|
-
/** One event → one POST. Frozen §3 outcome. */
|
|
7412
|
-
type DeliveryOutcome = {
|
|
7413
|
-
ok: true;
|
|
7414
|
-
delivery: DeliveryState;
|
|
7415
|
-
} | {
|
|
7416
|
-
ok: false;
|
|
7417
|
-
reason: string;
|
|
7418
|
-
delivery: DeliveryState;
|
|
7419
|
-
};
|
|
7420
|
-
interface SsrfFetchArgs {
|
|
7421
|
-
method?: "POST";
|
|
7422
|
-
headers?: Record<string, string>;
|
|
7423
|
-
body?: Uint8Array;
|
|
7424
|
-
timeoutMs: number;
|
|
7425
|
-
}
|
|
7426
|
-
interface DeliverEventDeps {
|
|
7427
|
-
/** Replaces the POST boundary (tests only). Default: the shared `ssrfFetch` gate. */
|
|
7428
|
-
fetch?: (url: string, init: SsrfFetchArgs) => Promise<{
|
|
7429
|
-
status: number;
|
|
7430
|
-
body: string;
|
|
7431
|
-
}>;
|
|
7432
|
-
/** Backoff sleep (tests only). Default: real `setTimeout`. */
|
|
7433
|
-
sleep?: (ms: number) => Promise<void>;
|
|
7434
|
-
/** Clock (tests only). Default: real wall clock. */
|
|
7435
|
-
now?: () => number;
|
|
7436
|
-
}
|
|
7437
|
-
declare const CLAMP_LIMIT_BYTES = 262144;
|
|
7438
|
-
declare const MAX_ATTEMPTS = 5;
|
|
7439
|
-
/** Bounded exponential backoff: 250, 500, 1000, 2000, capped at 4000 (attempt ≥ 4). */
|
|
7440
|
-
declare function deliveryBackoffDelay(attempt: number): number;
|
|
7441
|
-
declare function serializeEnvelope(envelope: McpEventEnvelope): Uint8Array;
|
|
7442
|
-
/** Serialize once; over-size → `{summary, subject}` + `truncated:true` (§3). */
|
|
7443
|
-
declare function envelopeClampedBytes(event: McpEventEnvelope): {
|
|
7444
|
-
bytes: Uint8Array;
|
|
7445
|
-
clamped: boolean;
|
|
7446
|
-
};
|
|
7447
|
-
declare function deliverEventEnvelope(replay: DeliveryReplay, event: McpEventEnvelope, deps?: DeliverEventDeps): Promise<DeliveryOutcome>;
|
|
7448
|
-
|
|
7449
7882
|
/**
|
|
7450
7883
|
* MCP Events registry (W-C of `.plans/sentinel-mcp-events/PLAN.md`, §2/§3).
|
|
7451
7884
|
*
|
|
@@ -7558,8 +7991,8 @@ declare function findEventDefinition(name: string): EventRegistration | undefine
|
|
|
7558
7991
|
* `runtime/index.ts`.
|
|
7559
7992
|
*
|
|
7560
7993
|
* INVARIANTS v1 (plan §2, code-verified):
|
|
7561
|
-
* - every event is NON-REPLAYABLE → `cursor` is always `null
|
|
7562
|
-
*
|
|
7994
|
+
* - every event is NON-REPLAYABLE → `cursor` is always `null`; subscribe
|
|
7995
|
+
* results carry `truncated: false`, events never set `truncated`;
|
|
7563
7996
|
* - no `read` tool, no separate package, no batching.
|
|
7564
7997
|
*
|
|
7565
7998
|
* Subscription ids are deterministic (`subscription-id.ts`): subscribe upserts
|
|
@@ -7646,6 +8079,10 @@ interface EventsUnsubscribeContext {
|
|
|
7646
8079
|
principal: Principal;
|
|
7647
8080
|
store: SentinelStore;
|
|
7648
8081
|
resolveProvider: (slug: string) => Promise<SentinelProviderHandle | null>;
|
|
8082
|
+
/** Persisted remote-cancel store. Present ⇒ unsubscribe records a tombstone
|
|
8083
|
+
* keyed by provider + remote id, drops the local row (delivery eligibility
|
|
8084
|
+
* ends immediately) and lets the sweep converge an unreachable remote. */
|
|
8085
|
+
tombstones?: CancelTombstoneStore;
|
|
7649
8086
|
}
|
|
7650
8087
|
declare function eventsList(r: EventsListRequest, ctx: EventsListContext): Promise<EventsListResult>;
|
|
7651
8088
|
declare function eventsSubscribe(input: EventsSubscribeInput, ctx: EventsSubscribeContext): Promise<EventsSubscribeResult>;
|
|
@@ -7756,135 +8193,6 @@ declare function decodeWhsecSecret(secret: string): Buffer | null;
|
|
|
7756
8193
|
*/
|
|
7757
8194
|
declare function signWebhook(input: WebhookSignInput): WebhookSignatureHeaders;
|
|
7758
8195
|
|
|
7759
|
-
/**
|
|
7760
|
-
* SentinelWebhookOutbox — the PERSISTED outbox for `webhook`-target sentinel
|
|
7761
|
-
* events (W-B of `.plans/sentinel-mcp-events/PLAN.md`, §4 task 3).
|
|
7762
|
-
*
|
|
7763
|
-
* Why an outbox: the runtime's `processEvents` marks an event `seen` the
|
|
7764
|
-
* moment in-process handling resolves, but a webhook POST is an EXTERNAL
|
|
7765
|
-
* delivery — a crash between ack and delivery loses the event forever (I4).
|
|
7766
|
-
* So the webhook fire path appends a DURABLE row first:
|
|
7767
|
-
*
|
|
7768
|
-
* `{sentinelId, requestId, eventId, bodyBytes, cursor:null,
|
|
7769
|
-
* deliveryState, status: pending|delivered|dead}`
|
|
7770
|
-
*
|
|
7771
|
-
* with `bodyBytes` = the EXACT canonical body bytes that will be sent (I2 —
|
|
7772
|
-
* the envelope is serialized once here via `serializeEnvelope`; the dispatch
|
|
7773
|
-
* re-signs those same bytes, and `deliverEventEnvelope`'s internal
|
|
7774
|
-
* serialization is deterministic over the stored envelope — asserted by
|
|
7775
|
-
* tests). The underlying sentinel event is marked seen/acked ONLY when the
|
|
7776
|
-
* row reaches terminal status (`delivered`, or `dead` per the retry cap /
|
|
7777
|
-
* age-out); a dispatch that THREW (crash-shaped) leaves the row `pending`,
|
|
7778
|
-
* the event UN-acked, and a restart re-dispatches it by exact bytes.
|
|
7779
|
-
*
|
|
7780
|
-
* Ordering across events of one subscription is never assumed (I5). Rows
|
|
7781
|
-
* reaped once `delivered` for 24 h; pending rows age out after 7 d (plan
|
|
7782
|
-
* risk table); the file is capped. Feedback-loop guard is data, not policy:
|
|
7783
|
-
* the `ssrfFetch` gate inside `deliverEventEnvelope` inherently blocks
|
|
7784
|
-
* loopback/private delivery targets, so nothing here can ring back into our
|
|
7785
|
-
* own inbound routes — self-delivery cannot even connect.
|
|
7786
|
-
*/
|
|
7787
|
-
|
|
7788
|
-
type SentinelWebhookOutboxStatus = "pending" | "delivered" | "dead";
|
|
7789
|
-
interface SentinelWebhookOutboxRow {
|
|
7790
|
-
sentinelId: string;
|
|
7791
|
-
/** Deterministic sub id over `(sentinelId, eventId)` — stable across
|
|
7792
|
-
* restarts (I1: a redelivery is a consumer no-op; the wire `webhook-id`
|
|
7793
|
-
* header stays the EVENT id). */
|
|
7794
|
-
requestId: string;
|
|
7795
|
-
eventId: string;
|
|
7796
|
-
/** The EXACT body bytes, as sent — utf-8 base64 of `serializeEnvelope`
|
|
7797
|
-
* (I2: bytes stored exactly as sent; resume dispatches the stored bytes). */
|
|
7798
|
-
bodyBytes: string;
|
|
7799
|
-
/** v1 events are non-replayable (plan §2) — always null. */
|
|
7800
|
-
cursor: null;
|
|
7801
|
-
/** Persisted W-A delivery state so a post-restart dispatch makes sense. */
|
|
7802
|
-
deliveryState: {
|
|
7803
|
-
attempts: number;
|
|
7804
|
-
lastError?: string;
|
|
7805
|
-
lastAt?: string;
|
|
7806
|
-
};
|
|
7807
|
-
status: SentinelWebhookOutboxStatus;
|
|
7808
|
-
/** The bounded-retry loop's final `ok:false` reason. */
|
|
7809
|
-
failReason?: string;
|
|
7810
|
-
/** Why the outbox itself went a row `dead` (`sentinel_expired`,
|
|
7811
|
-
* `sentinel_removed`, `age_out`). */
|
|
7812
|
-
deadReason?: string;
|
|
7813
|
-
createdAt: number;
|
|
7814
|
-
/** Wall-clock ms the row reached terminal status (drives reaping). */
|
|
7815
|
-
terminalAt?: number;
|
|
7816
|
-
}
|
|
7817
|
-
/** The full row is JSON-persisted; the envelope rides along so a resumed
|
|
7818
|
-
* dispatch re-delivers byte-identically without re-deriving the projection,
|
|
7819
|
-
* and the original event rides along for ack-time lifetime bookkeeping
|
|
7820
|
-
* (terminal flag / subject tracking). */
|
|
7821
|
-
type PersistedOutboxRow = SentinelWebhookOutboxRow & {
|
|
7822
|
-
envelope?: McpEventEnvelope;
|
|
7823
|
-
event?: SentinelEvent;
|
|
7824
|
-
};
|
|
7825
|
-
interface SentinelWebhookOutbox {
|
|
7826
|
-
/** Append a row for a matched webhook-delivery event. Idempotent per
|
|
7827
|
-
* `(sentinelId, eventId)`: an existing row (pending OR terminal) is never
|
|
7828
|
-
* duplicated — returns `undefined`, and for a terminal existing row
|
|
7829
|
-
* re-fires `onTerminal` so a lost ack (crash between the terminal
|
|
7830
|
-
* transition and the store write) still lands. Kicks dispatch off
|
|
7831
|
-
* asynchronously. */
|
|
7832
|
-
enqueue(input: {
|
|
7833
|
-
sentinelId: string;
|
|
7834
|
-
event: SentinelEvent;
|
|
7835
|
-
}): Promise<SentinelWebhookOutboxRow | undefined>;
|
|
7836
|
-
/** Dispatch every `pending` row (serialized, one POST in flight). Consults
|
|
7837
|
-
* `isExpired` per row AND the secrets sidecar BEFORE dispatch — an
|
|
7838
|
-
* expired or unwound sentinel never delivers another byte. */
|
|
7839
|
-
dispatch(): Promise<void>;
|
|
7840
|
-
/** Startup re-enqueue: re-dispatch every `pending` row by exact stored
|
|
7841
|
-
* bytes (no payload re-serialization on the resume path). */
|
|
7842
|
-
resumeDeliveries(): Promise<void>;
|
|
7843
|
-
/** Re-`delivered` rows after 24 h are reaped; pending rows age out after
|
|
7844
|
-
* 7 d (plan risk table). Cheap; called on the runtime's periodic tick. */
|
|
7845
|
-
sweep(): void;
|
|
7846
|
-
rows(): PersistedOutboxRow[];
|
|
7847
|
-
/** Synchronous flush for shutdown paths. */
|
|
7848
|
-
flushSync(): void;
|
|
7849
|
-
}
|
|
7850
|
-
interface SentinelWebhookOutboxOptions {
|
|
7851
|
-
/** Override persist path. Default `~/.agentproto/sentinel-webhook-outbox.json`. */
|
|
7852
|
-
filePath?: string;
|
|
7853
|
-
/** Injectable clock. */
|
|
7854
|
-
nowMs?: () => number;
|
|
7855
|
-
/** Debounce interval for disk persistence. Default 1500 ms. */
|
|
7856
|
-
debounceMs?: number;
|
|
7857
|
-
/** Disable disk persistence (unit tests). Default false unless filePath. */
|
|
7858
|
-
persist?: boolean;
|
|
7859
|
-
/** DI boundary (not module fakes): replaces W-A's `deliverEventEnvelope`
|
|
7860
|
-
* as the POST boundary. Throws = dispatch did not complete (row stays
|
|
7861
|
-
* pending, event stays un-acked). Default: the real deliverer. */
|
|
7862
|
-
deliverEvent?: (input: {
|
|
7863
|
-
replay: DeliveryReplay;
|
|
7864
|
-
row: PersistedOutboxRow;
|
|
7865
|
-
}) => Promise<DeliveryOutcome>;
|
|
7866
|
-
/** Signing secrets for a sentinel — `{subId, callbackUrl, secrets[]}`, or
|
|
7867
|
-
* null when the sentinel/secret sidecar is gone (row goes dead, never
|
|
7868
|
-
* silently lost). */
|
|
7869
|
-
secretsFor: (sentinelId: string) => DeliveryReplay | null;
|
|
7870
|
-
/** Expiry gate, consulted BEFORE every dispatch (plan §4 W-B task 2b).
|
|
7871
|
-
* true = the sentinel is past its `until` and must not deliver. */
|
|
7872
|
-
isExpired: (sentinelId: string) => boolean;
|
|
7873
|
-
/** The ack — mark the underlying event seen, after terminal status only. */
|
|
7874
|
-
onTerminal: (sentinelId: string, row: SentinelWebhookOutboxRow) => void;
|
|
7875
|
-
log?: (line: string) => void;
|
|
7876
|
-
}
|
|
7877
|
-
/** `sub_<hex32>` — deterministic over (sentinelId, eventId). */
|
|
7878
|
-
declare function webhookRequestId(sentinelId: string, eventId: string): `sub_${string}`;
|
|
7879
|
-
/** The CloudEvents → MCP-Events-envelope fusion. W-C's `mcp-events/adapter.ts`
|
|
7880
|
-
* is now the canonical owner of this mapping (`toMcpEvent`); this alias keeps
|
|
7881
|
-
* the W-B call sites/tests working. The shape is the frozen §3 wire envelope —
|
|
7882
|
-
* insertion order stable, so its serialization is byte-stable across
|
|
7883
|
-
* restarts. `data` gains `subject`/`summary` so the 256 KiB clamp's
|
|
7884
|
-
* `{summary, subject}` replacement never goes blind. */
|
|
7885
|
-
declare function toWebhookEnvelope(event: SentinelEvent): McpEventEnvelope;
|
|
7886
|
-
declare function createSentinelWebhookOutbox(opts: SentinelWebhookOutboxOptions): SentinelWebhookOutbox;
|
|
7887
|
-
|
|
7888
8196
|
/**
|
|
7889
8197
|
* Smart default for `features.llmEndpoint` (daemon-managed-gateway): an
|
|
7890
8198
|
* operator who already configured a named endpoint, an upstream credential
|
|
@@ -9696,4 +10004,4 @@ interface GatewayHandle {
|
|
|
9696
10004
|
*/
|
|
9697
10005
|
declare function createGateway(opts: CreateGatewayOptions): Promise<GatewayHandle>;
|
|
9698
10006
|
|
|
9699
|
-
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 ArgumentsResult, 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, DEFAULT_TTL_MS, 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, EVENT_REGISTRY, type EagerResumeSummary, type EgressDispatcher, type EnableInput, type EnableResult, type EventDefinition, type EventRegistration, type EventsListContext, type EventsListRequest, type EventsListResult, type EventsSubscribeContext, type EventsSubscribeInput, type EventsSubscribeResult, type EventsUnsubscribeContext, type EventsUnsubscribeInput, FOLLOW_EVENTS, type FetchHostTurnsResult, type FindComposeCandidateInput, type FollowEvent, type ForwardHttpRequest, type ForwardHttpResponse, GC_REAPABLE_STATES, GITHUB_SCHEME, 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, INDEX_DEFAULT_LIMIT, INDEX_MAX_OUTPUT, INDEX_MAX_PROMPT, INDEX_TAIL_BYTES, 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, type InternalEventMeta, 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, MAX_TTL_MS, MCP_APP_BRIDGE_SCRIPT, MIN_TTL_MS, type McpCredentialDeps, type McpEventEnvelope, McpEventsError, 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 Principal, 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 SchemeRegistry, type ScopeTokenRegistry, type SentinelMatchClause, type SentinelSpec, type SentinelStatus, type SentinelTarget, type SentinelUntil, type SentinelView, type SentinelWebhookOutbox, type SentinelWebhookOutboxOptions, type SentinelWebhookOutboxRow, type SentinelWebhookOutboxStatus, SessionDescriptor, SessionEndReason, type SessionFollow, type SessionFollowHandle, type SessionFollowStore, type SessionIndexEntry, SessionMessage, type SessionMessageSentRecord, type SessionObserver, type SessionRecap, 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 SubscriptionIdentity, type SubtreeChildUsage, type SubtreeUsageTotals, TaskLedger, type ToolListMeasurement, type TranscriptPrompt, type TranscriptTail, 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, backfillSessionIndexes, bucketDir, bucketSessionsFile, bucketTranscriptDir, buildCatalogProviderModels, buildHostLoadReport, buildMcpConfigSnippet, buildRouteAwareLaunchConfig, buildSessionRecap, canonicalForModeId, canonicalizeJcs, challengeCacheSize, challengeReasonForSsrf, claudeProjectSlug, collectGcCandidates, collectHostSample, composeSessionObservers, composedFromRangeSha, computeHostWarnings, computeRefreshBefore, continueInterruptedSessions, continueSkipReason, conversationIndexPath, createActivityProjector, createDaemonReviewerHost, createDefaultHostProbes, createDeviceRegistry, createFileStepCache, createGateway, createHostLoadService, createHostRegistry, createInboundEndpointStore, createJoinTokenRegistry, createOrchestratorInjector, createOrchestratorMcpServerFactory, createPrProvenanceReconciler, createReviewLaneExecutor, createReviewLedger, createReviewPackLoader, createReviewRunner, createScopeTokenRegistry, createSentinelWebhookOutbox, createSessionFollowStore, createWorkspaceBrainSubscriber, createWorkspaceBrains, daemonBearerPrincipal, daemonRegistryDir, declaredPresetToProviderPreset, decodeWhsecSecret, defaultBrowserAdapterIds, defaultBrowserAdapterResolution, defaultReviewKeysDir, defaultReviewLedgerRoot, defaultReviewPackCacheDir, defaultTranscriptBaseDir, defineBraveSearchHttpDriver, defineSerperHttpDriver, deliverEventEnvelope, deliveryBackoffDelay, deriveIndexFromTranscript, describeOwner, encodeWhsecSecret, enrichRollupWithProviderQuota, enrichWithRemainingQuota, ensureReviewSigningKey, envelopeClampedBytes, evaluateCostBudget, eventsList, eventsSubscribe, eventsUnsubscribe, execGh, extractHelpSection, fetchHostTurns, fetchPrStatus, fileExists, findComposeCandidate, findConversationRecord, findEventDefinition, findNativeMode, findPrForCommit, formatToolCall, formatToolResult, getDefaultHarnessPreset, getHarnessPreset, getHostLoadService, getMcpCredentialDeps, getToolHelp, githubRepoOf, harnessPresetsPath, hostPlaceholders, hostRecordToMirrorRecord, indexEntryFromDescriptor, injectMcpAppBridge, isAgentCliAuthConfigured, isAutomatedPromptSource, isNoSessionPromptFailure, isPubliclyRoutable, isRetired, isSafeBucketSlug, listBuckets, listHarnessPresets, listPresets, listToolHelpTopics, loadHarnessPresets, loadWorkspaceModelRoles, locateConversationByNativePath, locateConversationBySessionId, makeBrowserAdapterLister, makeRestartForRouting, makeSandboxCredsStore, makeSandboxResolver, matchesSessionQuery, measureTool, measureToolList, migrateLegacySessionsFile, migrationMarkerPath, mirrorCursorForSession, monitorPolicyWait, monitorSessionWait, narrowOrchestratorTools, normalizeCallbackUrl, normalizeInbound, normalizeModeId, normalizeRemote, parsePrUrl, prHeadSha, projectBrowserTools, promptDeviceSession, promptHostSession, readAllSessionIndexes, readConversationIndex, readDaemonRegistry, readHostsSnapshot, readRegisteredSlugs, readRuntimeMeta, readSandboxLedger, readSessionForBrain, readSessionIndex, readTranscriptTail, 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, resolveSuccessor, rollupSessionSubtree, runContinueOnBootPass, runCrashDetectPass, runEagerResumePass, runIdleReapPass, runShellLane, runStallWatchdogPass, sandboxLedgerPath, searchSessionIndexes, seedWalkForTranscript, serializeEnvelope, sessionEventsPath, sessionIndexPath, sessionPrincipal, sessionTranscriptDir, setDefaultPreset, setDefaultSessionsBaseDir, setEgressDispatcherForTests, setMcpCredentialDeps, signAttestation, signWebhook, ssrfFetch, subscriptionId, sweepStaleDaemonRegistry, sweepStaleRuntimeMetas, syncDeviceMirror, tenantScope, toMcpEvent, toWebhookEnvelope, toWorktreeStatusView, unlinkDaemonRegistryEntry, unlinkRuntimeMeta, untilForTtl, updateHarnessPreset, upsertSandboxLedger, validateAgainstInputSchema, verifyCallback, verifyInboundSignature, verifySignedAttestation, webSearchTool, webhookRequestId, wireSessionFollow, withPr, withPrStatus, writeDaemonRegistryEntry, writeSessionIndex };
|
|
10007
|
+
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 ArgumentsResult, type AttachSandboxOpts, type AttachSandboxResult, BUCKETS_ROOT, type BranchGcApplyScopeCounts, type BranchGcApplySummary, 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, type CancelTombstone, type CancelTombstoneStore, 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, DEFAULT_TTL_MS, 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, EVENT_REGISTRY, type EagerResumeSummary, type EgressDispatcher, type EnableInput, type EnableResult, type EventDefinition, type EventRegistration, type EventsListContext, type EventsListRequest, type EventsListResult, type EventsSubscribeContext, type EventsSubscribeInput, type EventsSubscribeResult, type EventsUnsubscribeContext, type EventsUnsubscribeInput, FOLLOW_EVENTS, type FetchHostTurnsResult, type FindComposeCandidateInput, type FollowEvent, type ForwardHttpRequest, type ForwardHttpResponse, GC_REAPABLE_STATES, GITHUB_SCHEME, 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, INDEX_DEFAULT_LIMIT, INDEX_MAX_OUTPUT, INDEX_MAX_PROMPT, INDEX_TAIL_BYTES, 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, type InternalEventMeta, 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, MAX_TTL_MS, MCP_APP_BRIDGE_SCRIPT, MIN_TTL_MS, type McpCredentialDeps, type McpEventEnvelope, McpEventsError, 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 Principal, 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, SESSION_LIST_FILTER_KEYS, 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 SchemeRegistry, type ScopeTokenRegistry, SentinelBackingExpiredError, type SentinelMalformedItem, type SentinelMatchClause, type SentinelPollResult, type SentinelQuarantine, type SentinelQuarantineRecord, type SentinelSpec, type SentinelStatus, type SentinelTarget, type SentinelUntil, type SentinelView, type SentinelWebhookOutbox, type SentinelWebhookOutboxOptions, type SentinelWebhookOutboxRow, type SentinelWebhookOutboxStatus, SessionDescriptor, SessionEndReason, type SessionFollow, type SessionFollowHandle, type SessionFollowStore, type SessionIndexEntry, SessionListFilterError, type SessionListFilterInput, SessionMessage, type SessionMessageSentRecord, type SessionObserver, type SessionRecap, 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 SubscriptionIdentity, type SubtreeChildUsage, type SubtreeUsageTotals, TaskLedger, type ToolListMeasurement, type TranscriptPrompt, type TranscriptTail, 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, applySessionListFilters, attachSandbox, backfillSessionIndexes, bucketDir, bucketSessionsFile, bucketTranscriptDir, buildCatalogProviderModels, buildHostLoadReport, buildMcpConfigSnippet, buildRouteAwareLaunchConfig, buildSessionRecap, canonicalForModeId, canonicalizeJcs, challengeCacheSize, challengeReasonForSsrf, claudeProjectSlug, collectGcCandidates, collectHostSample, compileSessionListFilters, composeSessionObservers, composedFromRangeSha, computeHostWarnings, computeRefreshBefore, continueInterruptedSessions, continueSkipReason, conversationIndexPath, createActivityProjector, createDaemonReviewerHost, createDefaultHostProbes, createDeviceRegistry, createFileStepCache, createGateway, createHostLoadService, createHostRegistry, createInboundEndpointStore, createJoinTokenRegistry, createOrchestratorInjector, createOrchestratorMcpServerFactory, createPrProvenanceReconciler, createReviewLaneExecutor, createReviewLedger, createReviewPackLoader, createReviewRunner, createScopeTokenRegistry, createSentinelWebhookOutbox, createSessionFollowStore, createWorkspaceBrainSubscriber, createWorkspaceBrains, daemonBearerPrincipal, daemonRegistryDir, declaredPresetToProviderPreset, decodeWhsecSecret, defaultBrowserAdapterIds, defaultBrowserAdapterResolution, defaultReviewKeysDir, defaultReviewLedgerRoot, defaultReviewPackCacheDir, defaultTranscriptBaseDir, defineBraveSearchHttpDriver, defineSerperHttpDriver, deliverEventEnvelope, deliveryBackoffDelay, deriveIndexFromTranscript, describeOwner, encodeWhsecSecret, enrichRollupWithProviderQuota, enrichWithRemainingQuota, ensureReviewSigningKey, envelopeClampedBytes, evaluateCostBudget, eventsList, eventsSubscribe, eventsUnsubscribe, execGh, extractHelpSection, fetchHostTurns, fetchPrStatus, fileExists, findComposeCandidate, findConversationRecord, findEventDefinition, findNativeMode, findPrForCommit, formatToolCall, formatToolResult, getDefaultHarnessPreset, getHarnessPreset, getHostLoadService, getMcpCredentialDeps, getToolHelp, githubRepoOf, harnessPresetsPath, hasSessionListFilters, hostPlaceholders, hostRecordToMirrorRecord, indexEntryFromDescriptor, injectMcpAppBridge, isAgentCliAuthConfigured, isAutomatedPromptSource, isNoSessionPromptFailure, isNoiseSession, isPubliclyRoutable, isRetired, isSafeBucketSlug, listBuckets, listHarnessPresets, listPresets, listToolHelpTopics, loadHarnessPresets, loadWorkspaceModelRoles, locateConversationByNativePath, locateConversationBySessionId, makeBrowserAdapterLister, makeRestartForRouting, makeSandboxCredsStore, makeSandboxResolver, matchesSessionQuery, measureTool, measureToolList, migrateLegacySessionsFile, migrationMarkerPath, mirrorCursorForSession, monitorPolicyWait, monitorSessionWait, narrowOrchestratorTools, normalizeCallbackUrl, normalizeInbound, normalizeModeId, normalizeRemote, parsePrUrl, parseSessionListFilterParams, parseTimeBound, pickSessionListFilters, prHeadSha, projectBrowserTools, promptDeviceSession, promptHostSession, readAllSessionIndexes, readConversationIndex, readDaemonRegistry, readHostsSnapshot, readRegisteredSlugs, readRuntimeMeta, readSandboxLedger, readSessionForBrain, readSessionIndex, readTranscriptTail, 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, resolveSuccessor, rollupSessionSubtree, runContinueOnBootPass, runCrashDetectPass, runEagerResumePass, runIdleReapPass, runShellLane, runStallWatchdogPass, sandboxLedgerPath, searchSessionIndexes, seedWalkForTranscript, serializeEnvelope, sessionActivityMs, sessionEventsPath, sessionIndexPath, sessionListFilterShape, sessionPrincipal, sessionTranscriptDir, setDefaultPreset, setDefaultSessionsBaseDir, setEgressDispatcherForTests, setMcpCredentialDeps, signAttestation, signWebhook, sortNewestActivityFirst, ssrfFetch, subscriptionId, summarizeBranchGcApply, sweepStaleDaemonRegistry, sweepStaleRuntimeMetas, syncDeviceMirror, tenantScope, toMcpEvent, toWebhookEnvelope, toWorktreeStatusView, unlinkDaemonRegistryEntry, unlinkRuntimeMeta, untilForTtl, updateHarnessPreset, upsertSandboxLedger, validateAgainstInputSchema, verifyCallback, verifyInboundSignature, verifySignedAttestation, webSearchTool, webhookRequestId, wireSessionFollow, withBranchGcApplySummary, withPr, withPrStatus, writeDaemonRegistryEntry, writeSessionIndex };
|