@agentproto/runtime 5.14.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/index.d.ts +349 -219
- package/dist/index.mjs +367 -66
- package/dist/index.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/session_list.md +66 -0
- package/package.json +25 -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';
|
|
@@ -931,6 +931,253 @@ interface CancelTombstoneStore {
|
|
|
931
931
|
has(provider: string, remoteId: string): boolean;
|
|
932
932
|
}
|
|
933
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
|
+
|
|
934
1181
|
/**
|
|
935
1182
|
* LlmEndpointRegistry — supervised-sidecar manager for the
|
|
936
1183
|
* `@agentproto/llm-endpoint` proxy gateway.
|
|
@@ -6272,6 +6519,101 @@ interface SandboxReconcileResult {
|
|
|
6272
6519
|
*/
|
|
6273
6520
|
declare function reconcileSandboxLedger(deps: SandboxReconcileDeps): Promise<SandboxReconcileResult>;
|
|
6274
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
|
+
|
|
6275
6617
|
/**
|
|
6276
6618
|
* Per-session structured event capture — one append-only JSONL file per
|
|
6277
6619
|
* agent-cli session, written at the same tap point where `projectEvent`
|
|
@@ -7292,6 +7634,8 @@ interface SentinelView {
|
|
|
7292
7634
|
eventCount: number;
|
|
7293
7635
|
lastEventTs?: number;
|
|
7294
7636
|
lastError?: string;
|
|
7637
|
+
/** Webhook-target sentinels only, once the outbox holds a row for it. */
|
|
7638
|
+
deliveryStatus?: SentinelDeliveryStatus;
|
|
7295
7639
|
}
|
|
7296
7640
|
|
|
7297
7641
|
/**
|
|
@@ -7512,11 +7856,11 @@ interface VerifyCallbackInput {
|
|
|
7512
7856
|
}
|
|
7513
7857
|
interface VerifyCallbackDeps {
|
|
7514
7858
|
/** Replaces the POST boundary. Default: the shared `ssrfFetch` gate. */
|
|
7515
|
-
fetch?: (url: string, init: SsrfFetchArgs
|
|
7859
|
+
fetch?: (url: string, init: SsrfFetchArgs) => Promise<SsrfFetchView>;
|
|
7516
7860
|
/** Clock for the bounded TTL. Default: real wall clock. */
|
|
7517
7861
|
now?: () => number;
|
|
7518
7862
|
}
|
|
7519
|
-
interface SsrfFetchArgs
|
|
7863
|
+
interface SsrfFetchArgs {
|
|
7520
7864
|
method?: "POST";
|
|
7521
7865
|
headers?: Record<string, string>;
|
|
7522
7866
|
body?: Uint8Array;
|
|
@@ -7535,86 +7879,6 @@ declare function resetChallengeCacheForTests(): void;
|
|
|
7535
7879
|
declare function normalizeCallbackUrl(url: string): string | null;
|
|
7536
7880
|
declare function verifyCallback(input: VerifyCallbackInput, deps?: VerifyCallbackDeps): Promise<ChallengeOutcome>;
|
|
7537
7881
|
|
|
7538
|
-
/**
|
|
7539
|
-
* Signed event delivery with bounded retry (W-A of
|
|
7540
|
-
* `.plans/sentinel-mcp-events/PLAN.md`, §3 frozen).
|
|
7541
|
-
*
|
|
7542
|
-
* I2 — the body is serialized ONCE: the clamp (when needed) happens first,
|
|
7543
|
-
* then the exact bytes are signed per attempt with a FRESH timestamp. An
|
|
7544
|
-
* observer sees a different `webhook-signature` header per attempt while the
|
|
7545
|
-
* body bytes stay bitwise identical — `signWebhook` returns ONLY headers and
|
|
7546
|
-
* never re-serializes.
|
|
7547
|
-
*
|
|
7548
|
-
* ≤ 256 KiB — when the serialized body exceeds 262 144 bytes, `data` is
|
|
7549
|
-
* replaced with `{summary, subject}` and the envelope gains `truncated: true`
|
|
7550
|
-
* (no read tool — plan §5), and the CLAMPED bytes (not the original) are what
|
|
7551
|
-
* every attempt signs.
|
|
7552
|
-
*
|
|
7553
|
-
* Retry — exponential backoff bounded to 5 attempts; 3xx / other 4xx / 5xx /
|
|
7554
|
-
* network errors retry; 410/413 are terminal with NO further attempt;
|
|
7555
|
-
* 2xx = delivered. The returned `DeliveryState` is what the caller persists
|
|
7556
|
-
* into the store for post-restart resume (W-B's job to wire).
|
|
7557
|
-
*/
|
|
7558
|
-
type McpEventEnvelope = {
|
|
7559
|
-
/** OpenAI doc wire shape VERBATIM (developers.openai.com/plugins/build/mcp-events):
|
|
7560
|
-
* `eventId` (NOT `id` — the `webhook-id` header carries eventId), `name`,
|
|
7561
|
-
* `timestamp`, `data`, `cursor`. A top-level `type` field = protocol
|
|
7562
|
-
* control notification only — never sent by us (no control events). */
|
|
7563
|
-
eventId: string;
|
|
7564
|
-
name: string;
|
|
7565
|
-
timestamp: string;
|
|
7566
|
-
data: Record<string, unknown>;
|
|
7567
|
-
cursor: string | null;
|
|
7568
|
-
truncated?: boolean;
|
|
7569
|
-
};
|
|
7570
|
-
interface DeliveryState {
|
|
7571
|
-
attempts: number;
|
|
7572
|
-
lastError?: string;
|
|
7573
|
-
lastAt?: string;
|
|
7574
|
-
}
|
|
7575
|
-
interface DeliveryReplay {
|
|
7576
|
-
subId: string;
|
|
7577
|
-
callbackUrl: string;
|
|
7578
|
-
secrets: readonly string[];
|
|
7579
|
-
}
|
|
7580
|
-
/** One event → one POST. Frozen §3 outcome. */
|
|
7581
|
-
type DeliveryOutcome = {
|
|
7582
|
-
ok: true;
|
|
7583
|
-
delivery: DeliveryState;
|
|
7584
|
-
} | {
|
|
7585
|
-
ok: false;
|
|
7586
|
-
reason: string;
|
|
7587
|
-
delivery: DeliveryState;
|
|
7588
|
-
};
|
|
7589
|
-
interface SsrfFetchArgs {
|
|
7590
|
-
method?: "POST";
|
|
7591
|
-
headers?: Record<string, string>;
|
|
7592
|
-
body?: Uint8Array;
|
|
7593
|
-
timeoutMs: number;
|
|
7594
|
-
}
|
|
7595
|
-
interface DeliverEventDeps {
|
|
7596
|
-
/** Replaces the POST boundary (tests only). Default: the shared `ssrfFetch` gate. */
|
|
7597
|
-
fetch?: (url: string, init: SsrfFetchArgs) => Promise<{
|
|
7598
|
-
status: number;
|
|
7599
|
-
body: string;
|
|
7600
|
-
}>;
|
|
7601
|
-
/** Backoff sleep (tests only). Default: real `setTimeout`. */
|
|
7602
|
-
sleep?: (ms: number) => Promise<void>;
|
|
7603
|
-
/** Clock (tests only). Default: real wall clock. */
|
|
7604
|
-
now?: () => number;
|
|
7605
|
-
}
|
|
7606
|
-
declare const CLAMP_LIMIT_BYTES = 262144;
|
|
7607
|
-
declare const MAX_ATTEMPTS = 5;
|
|
7608
|
-
/** Bounded exponential backoff: 250, 500, 1000, 2000, capped at 4000 (attempt ≥ 4). */
|
|
7609
|
-
declare function deliveryBackoffDelay(attempt: number): number;
|
|
7610
|
-
declare function serializeEnvelope(envelope: McpEventEnvelope): Uint8Array;
|
|
7611
|
-
/** Serialize once; over-size → `{summary, subject}` + `truncated:true` (§3). */
|
|
7612
|
-
declare function envelopeClampedBytes(event: McpEventEnvelope): {
|
|
7613
|
-
bytes: Uint8Array;
|
|
7614
|
-
clamped: boolean;
|
|
7615
|
-
};
|
|
7616
|
-
declare function deliverEventEnvelope(replay: DeliveryReplay, event: McpEventEnvelope, deps?: DeliverEventDeps): Promise<DeliveryOutcome>;
|
|
7617
|
-
|
|
7618
7882
|
/**
|
|
7619
7883
|
* MCP Events registry (W-C of `.plans/sentinel-mcp-events/PLAN.md`, §2/§3).
|
|
7620
7884
|
*
|
|
@@ -7929,140 +8193,6 @@ declare function decodeWhsecSecret(secret: string): Buffer | null;
|
|
|
7929
8193
|
*/
|
|
7930
8194
|
declare function signWebhook(input: WebhookSignInput): WebhookSignatureHeaders;
|
|
7931
8195
|
|
|
7932
|
-
/**
|
|
7933
|
-
* SentinelWebhookOutbox — the PERSISTED outbox for `webhook`-target sentinel
|
|
7934
|
-
* events (W-B of `.plans/sentinel-mcp-events/PLAN.md`, §4 task 3).
|
|
7935
|
-
*
|
|
7936
|
-
* Why an outbox: the runtime's `processEvents` marks an event `seen` the
|
|
7937
|
-
* moment in-process handling resolves, but a webhook POST is an EXTERNAL
|
|
7938
|
-
* delivery — a crash between ack and delivery loses the event forever (I4).
|
|
7939
|
-
* So the webhook fire path appends a DURABLE row first:
|
|
7940
|
-
*
|
|
7941
|
-
* `{sentinelId, requestId, eventId, bodyBytes, cursor:null,
|
|
7942
|
-
* deliveryState, status: pending|delivered|dead}`
|
|
7943
|
-
*
|
|
7944
|
-
* with `bodyBytes` = the EXACT canonical body bytes that will be sent (I2 —
|
|
7945
|
-
* the envelope is serialized once here via `serializeEnvelope`; the dispatch
|
|
7946
|
-
* re-signs those same bytes, and `deliverEventEnvelope`'s internal
|
|
7947
|
-
* serialization is deterministic over the stored envelope — asserted by
|
|
7948
|
-
* tests). The underlying sentinel event is marked seen/acked ONLY when the
|
|
7949
|
-
* row reaches terminal status (`delivered`, or `dead` per the retry cap /
|
|
7950
|
-
* age-out); a dispatch that THREW (crash-shaped) leaves the row `pending`,
|
|
7951
|
-
* the event UN-acked, and a restart re-dispatches it by exact bytes.
|
|
7952
|
-
*
|
|
7953
|
-
* Ordering across events of one subscription is never assumed (I5). Rows
|
|
7954
|
-
* reaped once `delivered` for 24 h; pending rows age out after 7 d (plan
|
|
7955
|
-
* risk table); the file is capped. Feedback-loop guard is data, not policy:
|
|
7956
|
-
* the `ssrfFetch` gate inside `deliverEventEnvelope` inherently blocks
|
|
7957
|
-
* loopback/private delivery targets, so nothing here can ring back into our
|
|
7958
|
-
* own inbound routes — self-delivery cannot even connect.
|
|
7959
|
-
*/
|
|
7960
|
-
|
|
7961
|
-
type SentinelWebhookOutboxStatus = "pending" | "delivered" | "dead";
|
|
7962
|
-
interface SentinelWebhookOutboxRow {
|
|
7963
|
-
sentinelId: string;
|
|
7964
|
-
/** Deterministic sub id over `(sentinelId, eventId)` — stable across
|
|
7965
|
-
* restarts (I1: a redelivery is a consumer no-op; the wire `webhook-id`
|
|
7966
|
-
* header stays the EVENT id). */
|
|
7967
|
-
requestId: string;
|
|
7968
|
-
eventId: string;
|
|
7969
|
-
/** The EXACT body bytes, as sent — utf-8 base64 of `serializeEnvelope`
|
|
7970
|
-
* (I2: bytes stored exactly as sent; resume dispatches the stored bytes). */
|
|
7971
|
-
bodyBytes: string;
|
|
7972
|
-
/** v1 events are non-replayable (plan §2) — always null. */
|
|
7973
|
-
cursor: null;
|
|
7974
|
-
/** Persisted W-A delivery state so a post-restart dispatch makes sense. */
|
|
7975
|
-
deliveryState: {
|
|
7976
|
-
attempts: number;
|
|
7977
|
-
lastError?: string;
|
|
7978
|
-
lastAt?: string;
|
|
7979
|
-
};
|
|
7980
|
-
status: SentinelWebhookOutboxStatus;
|
|
7981
|
-
/** The bounded-retry loop's final `ok:false` reason. */
|
|
7982
|
-
failReason?: string;
|
|
7983
|
-
/** Why the outbox itself went a row `dead` (`sentinel_expired`,
|
|
7984
|
-
* `sentinel_removed`, `age_out`). */
|
|
7985
|
-
deadReason?: string;
|
|
7986
|
-
createdAt: number;
|
|
7987
|
-
/** Wall-clock ms the row reached terminal status (drives reaping). */
|
|
7988
|
-
terminalAt?: number;
|
|
7989
|
-
}
|
|
7990
|
-
/** The full row is JSON-persisted; the envelope rides along so a resumed
|
|
7991
|
-
* dispatch re-delivers byte-identically without re-deriving the projection,
|
|
7992
|
-
* and the original event rides along for ack-time lifetime bookkeeping
|
|
7993
|
-
* (terminal flag / subject tracking). */
|
|
7994
|
-
type PersistedOutboxRow = SentinelWebhookOutboxRow & {
|
|
7995
|
-
envelope?: McpEventEnvelope;
|
|
7996
|
-
event?: SentinelEvent;
|
|
7997
|
-
};
|
|
7998
|
-
interface SentinelWebhookOutbox {
|
|
7999
|
-
/** Append a row for a matched webhook-delivery event. Resolves ONLY after
|
|
8000
|
-
* the row is crash-durable (atomic write + fsync + rename + dir fsync) —
|
|
8001
|
-
* callers ack the upstream (Agentpush cursor, push HTTP 2xx) on resolve.
|
|
8002
|
-
* A persistence failure rejects and rolls the row back, so the caller
|
|
8003
|
-
* leaves the upstream un-acked. Idempotent per `(sentinelId, eventId)`: an
|
|
8004
|
-
* existing row (pending OR terminal) is never duplicated — returns
|
|
8005
|
-
* `undefined` (after waiting for any in-flight write that carries it), and
|
|
8006
|
-
* for a terminal existing row re-fires `onTerminal` so a lost ack (crash
|
|
8007
|
-
* between the terminal transition and the store write) still lands. Kicks
|
|
8008
|
-
* dispatch off asynchronously once durable. */
|
|
8009
|
-
enqueue(input: {
|
|
8010
|
-
sentinelId: string;
|
|
8011
|
-
event: SentinelEvent;
|
|
8012
|
-
}): Promise<SentinelWebhookOutboxRow | undefined>;
|
|
8013
|
-
/** Dispatch every `pending` row (serialized, one POST in flight). Consults
|
|
8014
|
-
* `isExpired` per row AND the secrets sidecar BEFORE dispatch — an
|
|
8015
|
-
* expired or unwound sentinel never delivers another byte. */
|
|
8016
|
-
dispatch(): Promise<void>;
|
|
8017
|
-
/** Startup re-enqueue: re-dispatch every `pending` row by exact stored
|
|
8018
|
-
* bytes (no payload re-serialization on the resume path). */
|
|
8019
|
-
resumeDeliveries(): Promise<void>;
|
|
8020
|
-
/** Re-`delivered` rows after 24 h are reaped; pending rows age out after
|
|
8021
|
-
* 7 d (plan risk table). Cheap; called on the runtime's periodic tick. */
|
|
8022
|
-
sweep(): void;
|
|
8023
|
-
rows(): PersistedOutboxRow[];
|
|
8024
|
-
/** Synchronous flush for shutdown paths. */
|
|
8025
|
-
flushSync(): void;
|
|
8026
|
-
}
|
|
8027
|
-
interface SentinelWebhookOutboxOptions {
|
|
8028
|
-
/** Override persist path. Default `~/.agentproto/sentinel-webhook-outbox.json`. */
|
|
8029
|
-
filePath?: string;
|
|
8030
|
-
/** Injectable clock. */
|
|
8031
|
-
nowMs?: () => number;
|
|
8032
|
-
/** Debounce interval for the non-critical (status-transition) disk writes.
|
|
8033
|
-
* Enqueue never debounces. Default 1500 ms. */
|
|
8034
|
-
debounceMs?: number;
|
|
8035
|
-
/** Disable disk persistence (unit tests). Default false unless filePath. */
|
|
8036
|
-
persist?: boolean;
|
|
8037
|
-
/** DI boundary (not module fakes): replaces W-A's `deliverEventEnvelope`
|
|
8038
|
-
* as the POST boundary. Throws = dispatch did not complete (row stays
|
|
8039
|
-
* pending, event stays un-acked). Default: the real deliverer. */
|
|
8040
|
-
deliverEvent?: (input: {
|
|
8041
|
-
replay: DeliveryReplay;
|
|
8042
|
-
row: PersistedOutboxRow;
|
|
8043
|
-
}) => Promise<DeliveryOutcome>;
|
|
8044
|
-
/** Signing secrets for a sentinel — `{subId, callbackUrl, secrets[]}`, or
|
|
8045
|
-
* null when the sentinel/secret sidecar is gone (row goes dead, never
|
|
8046
|
-
* silently lost). */
|
|
8047
|
-
secretsFor: (sentinelId: string) => DeliveryReplay | null;
|
|
8048
|
-
/** Expiry gate, consulted BEFORE every dispatch (plan §4 W-B task 2b).
|
|
8049
|
-
* true = the sentinel is past its `until` and must not deliver. */
|
|
8050
|
-
isExpired: (sentinelId: string) => boolean;
|
|
8051
|
-
/** The ack — mark the underlying event seen, after terminal status only. */
|
|
8052
|
-
onTerminal: (sentinelId: string, row: SentinelWebhookOutboxRow) => void;
|
|
8053
|
-
log?: (line: string) => void;
|
|
8054
|
-
}
|
|
8055
|
-
/** `sub_<hex32>` — deterministic over (sentinelId, eventId). */
|
|
8056
|
-
declare function webhookRequestId(sentinelId: string, eventId: string): `sub_${string}`;
|
|
8057
|
-
/** The CloudEvents → MCP-Events-envelope fusion. W-C's `mcp-events/adapter.ts`
|
|
8058
|
-
* is now the canonical owner of this mapping (`toMcpEvent`); this alias keeps
|
|
8059
|
-
* the W-B call sites/tests working. The shape is the frozen §3 wire envelope —
|
|
8060
|
-
* insertion order stable, so its serialization is byte-stable across
|
|
8061
|
-
* restarts. `data` gains `subject`/`summary` so the 256 KiB clamp's
|
|
8062
|
-
* `{summary, subject}` replacement never goes blind. */
|
|
8063
|
-
declare function toWebhookEnvelope(event: SentinelEvent): McpEventEnvelope;
|
|
8064
|
-
declare function createSentinelWebhookOutbox(opts: SentinelWebhookOutboxOptions): SentinelWebhookOutbox;
|
|
8065
|
-
|
|
8066
8196
|
/**
|
|
8067
8197
|
* Smart default for `features.llmEndpoint` (daemon-managed-gateway): an
|
|
8068
8198
|
* operator who already configured a named endpoint, an upstream credential
|
|
@@ -9874,4 +10004,4 @@ interface GatewayHandle {
|
|
|
9874
10004
|
*/
|
|
9875
10005
|
declare function createGateway(opts: CreateGatewayOptions): Promise<GatewayHandle>;
|
|
9876
10006
|
|
|
9877
|
-
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, 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, 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, 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 };
|
|
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 };
|