@getmarrow/mcp 3.9.98 → 3.9.100
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/README.md +53 -343
- package/dist/cli.js +249 -47
- package/dist/cli.js.map +1 -1
- package/dist/hook-context.d.ts.map +1 -1
- package/dist/hook-context.js +142 -16
- package/dist/hook-context.js.map +1 -1
- package/dist/hook-contract.d.ts +34 -5
- package/dist/hook-contract.d.ts.map +1 -1
- package/dist/hook-contract.js +223 -15
- package/dist/hook-contract.js.map +1 -1
- package/dist/hook-pre-action.d.ts +42 -1
- package/dist/hook-pre-action.d.ts.map +1 -1
- package/dist/hook-pre-action.js +447 -58
- package/dist/hook-pre-action.js.map +1 -1
- package/dist/hook-session.d.ts.map +1 -1
- package/dist/hook-session.js +35 -3
- package/dist/hook-session.js.map +1 -1
- package/dist/hook.d.ts +12 -0
- package/dist/hook.d.ts.map +1 -1
- package/dist/hook.js +147 -7
- package/dist/hook.js.map +1 -1
- package/dist/host-approval-state.d.ts +137 -0
- package/dist/host-approval-state.d.ts.map +1 -0
- package/dist/host-approval-state.js +510 -0
- package/dist/host-approval-state.js.map +1 -0
- package/dist/host-approval.d.ts +436 -0
- package/dist/host-approval.d.ts.map +1 -0
- package/dist/host-approval.js +1417 -0
- package/dist/host-approval.js.map +1 -0
- package/dist/host-session.d.ts +104 -0
- package/dist/host-session.d.ts.map +1 -0
- package/dist/host-session.js +728 -0
- package/dist/host-session.js.map +1 -0
- package/dist/index.d.ts +150 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +748 -33
- package/dist/index.js.map +1 -1
- package/dist/lifecycle-spool.d.ts +17 -0
- package/dist/lifecycle-spool.d.ts.map +1 -1
- package/dist/lifecycle-spool.js +39 -9
- package/dist/lifecycle-spool.js.map +1 -1
- package/dist/normalized-action.d.ts +131 -0
- package/dist/normalized-action.d.ts.map +1 -0
- package/dist/normalized-action.js +1203 -0
- package/dist/normalized-action.js.map +1 -0
- package/dist/runtime-contract.d.ts +108 -4
- package/dist/runtime-contract.d.ts.map +1 -1
- package/dist/runtime-contract.js +178 -35
- package/dist/runtime-contract.js.map +1 -1
- package/dist/types.d.ts +128 -0
- package/dist/types.d.ts.map +1 -1
- package/package.json +19 -25
- package/server.json +15 -4
|
@@ -0,0 +1,436 @@
|
|
|
1
|
+
import { type NativeHookHarness } from './hook-contract';
|
|
2
|
+
import { type ArbitrationApprovalGuidance, type OrdinaryApprovalGuidance } from './runtime-contract';
|
|
3
|
+
import { type HoldRecord } from './host-approval-state';
|
|
4
|
+
import type { MarrowOwnerApprovalStatus } from './types';
|
|
5
|
+
/**
|
|
6
|
+
* Chat and terminal approvals: the operator answers a held action in the
|
|
7
|
+
* host's own permission prompt, and the host's Marrow hook records that answer
|
|
8
|
+
* with the server (client-attested). Rules (backend contract, section 3):
|
|
9
|
+
* - ask only where the host really shows its own prompt for this call, and only
|
|
10
|
+
* when the server says a host approval counts for this hold;
|
|
11
|
+
* - report exactly what the host reported, with its marker event; never invent
|
|
12
|
+
* an answer, a marker or a time; never let the model report an approval;
|
|
13
|
+
* - a decline is only a permission rejection, never an interruption;
|
|
14
|
+
* - a proof-required hold is committed by the agent with its proof (a hook
|
|
15
|
+
* commit without proof would leave an unverified observation that blocks the
|
|
16
|
+
* trusted close).
|
|
17
|
+
*/
|
|
18
|
+
export type ApprovalHost = 'claude-code' | 'codex' | 'cursor' | 'cline' | 'windsurf' | 'gemini' | 'grok' | 'other';
|
|
19
|
+
export declare const HOST_LABEL: Record<ApprovalHost, string>;
|
|
20
|
+
export declare function approvalHostFor(harness: NativeHookHarness, env?: NodeJS.ProcessEnv): ApprovalHost;
|
|
21
|
+
/** Claude Code entrypoints with no one at a dialog (claude -p, the Agent SDKs, its GitHub Action); hooks inherit it. */
|
|
22
|
+
export declare const HEADLESS_CLAUDE_ENTRYPOINTS: Set<string>;
|
|
23
|
+
export declare function claudeCodeHeadless(env?: NodeJS.ProcessEnv): boolean;
|
|
24
|
+
/** Cursor events on which a hook "ask" is enforced (never preToolUse). */
|
|
25
|
+
export declare const CURSOR_ASK_EVENTS: Set<string>;
|
|
26
|
+
export declare const HOST_APPROVAL_REQUEST_TIMEOUT_MS = 4000;
|
|
27
|
+
/**
|
|
28
|
+
* One total time budget for a pre-tool hook, counted from the start of the
|
|
29
|
+
* hook process and set from each host's real kill timeout as
|
|
30
|
+
* @getmarrow/install configures it: Codex 5 s (it then lets the call run),
|
|
31
|
+
* Cursor 5 s with failClosed, the installer's Grok guard 5 s (it then blocks),
|
|
32
|
+
* Gemini CLI 5 s. The margin covers npx start-up before the process starts.
|
|
33
|
+
* Cold auth can take 900 ms plus a 1.6 s grace, so the control path keeps
|
|
34
|
+
* room for a slow but healthy Marrow; when the budget still runs out, an
|
|
35
|
+
* action that can be held stays held (never an outage allow).
|
|
36
|
+
*/
|
|
37
|
+
export declare function preToolBudgetMs(host: ApprovalHost): number;
|
|
38
|
+
/**
|
|
39
|
+
* The hook process's deadline for its pre-tool answer and any follow-up work.
|
|
40
|
+
* Codex's kill clock starts when it spawns the hook command, so the time npx
|
|
41
|
+
* (or a shell) took to start this process comes out of the budget: the answer
|
|
42
|
+
* comes about 2.6 s after spawn, with at least 1 s for this process itself.
|
|
43
|
+
*/
|
|
44
|
+
export declare function preToolDeadline(host: ApprovalHost, headStartMs?: () => number): number;
|
|
45
|
+
/** Time left before the hook must have written its answer (Infinity without a deadline). */
|
|
46
|
+
export declare function remainingMs(ctx: {
|
|
47
|
+
deadlineAt?: number;
|
|
48
|
+
}): number;
|
|
49
|
+
/** A step's timeout inside the budget, or null when there is no time for it before the answer. */
|
|
50
|
+
export declare function stepTimeoutMs(ctx: {
|
|
51
|
+
deadlineAt?: number;
|
|
52
|
+
}, max: number, reserve?: number): number | null;
|
|
53
|
+
/**
|
|
54
|
+
* Work a post-tool hook does for a held call. Codex and Cursor run these hooks
|
|
55
|
+
* with a 5-second timeout (as @getmarrow/install configures them); a hook cut
|
|
56
|
+
* short keeps its queued report, which a later hook resends.
|
|
57
|
+
*/
|
|
58
|
+
export declare function settleBudgetMs(host: ApprovalHost): number;
|
|
59
|
+
export type HoldContext = {
|
|
60
|
+
apiKey: string;
|
|
61
|
+
baseUrl: string;
|
|
62
|
+
/** The Marrow session (X-Marrow-Session-Id) the hold was issued to. */
|
|
63
|
+
sessionId: string;
|
|
64
|
+
agentId?: string;
|
|
65
|
+
harness: NativeHookHarness;
|
|
66
|
+
host: ApprovalHost;
|
|
67
|
+
/** The host's own session or conversation id, as reported to the server. */
|
|
68
|
+
hostSessionId: string;
|
|
69
|
+
home?: string;
|
|
70
|
+
/** Pre-tool hooks: when the answer must be written (see preToolBudgetMs). */
|
|
71
|
+
deadlineAt?: number;
|
|
72
|
+
};
|
|
73
|
+
export declare function hostSessionIdFor(candidates: unknown[], fallback: string): string;
|
|
74
|
+
/**
|
|
75
|
+
* Stands in a plan's text for what happened to the owner's one-tap link; it is
|
|
76
|
+
* always replaced (finalizeOwnerRequest) before anyone sees the text, so no
|
|
77
|
+
* text says a request was sent when none was.
|
|
78
|
+
*/
|
|
79
|
+
export declare const OWNER_APPROVAL_REQUEST_TEXT = "[owner-request]";
|
|
80
|
+
/** An older Marrow service: no host approvals and no links; only the account owner can approve. */
|
|
81
|
+
export declare const LEGACY_SERVICE_TEXT = "This Marrow service does not support chat or terminal approvals yet, so only the account owner can approve it.";
|
|
82
|
+
/** Marrow could not be read while this action waits for an approval: it stays held. */
|
|
83
|
+
export declare const HELD_UNREACHABLE_TEXT = "Marrow could not confirm the owner's approval; this action stays held. Retry when Marrow is reachable.";
|
|
84
|
+
export type OwnerLinkOutcome = {
|
|
85
|
+
kind: 'sent';
|
|
86
|
+
channel: string;
|
|
87
|
+
}
|
|
88
|
+
/** The owner already has a live link (this hold's, or the arbitration's own on the service). */
|
|
89
|
+
| {
|
|
90
|
+
kind: 'already_sent';
|
|
91
|
+
channel?: string;
|
|
92
|
+
expiresAt?: string | null;
|
|
93
|
+
} | {
|
|
94
|
+
kind: 'deferred';
|
|
95
|
+
} | {
|
|
96
|
+
kind: 'retryable';
|
|
97
|
+
} | {
|
|
98
|
+
kind: 'failed';
|
|
99
|
+
code: string | null;
|
|
100
|
+
}
|
|
101
|
+
/** The service sent nothing on purpose (owner_ping_off): the hold waits quietly. */
|
|
102
|
+
| {
|
|
103
|
+
kind: 'not_sent';
|
|
104
|
+
} | {
|
|
105
|
+
kind: 'none';
|
|
106
|
+
};
|
|
107
|
+
/** The sentence for what happened to the owner's link. Never claims a send that did not happen. */
|
|
108
|
+
export declare function ownerRequestText(outcome: OwnerLinkOutcome): string;
|
|
109
|
+
export type HoldPlan = {
|
|
110
|
+
kind: 'ask';
|
|
111
|
+
promptText: string;
|
|
112
|
+
}
|
|
113
|
+
/**
|
|
114
|
+
* Marrow does not block: a person is here but Marrow can neither ask in this
|
|
115
|
+
* host nor observe its answer, so the host's own approval step decides (owner
|
|
116
|
+
* rule). The outcome is recorded as approved through the host's own prompt,
|
|
117
|
+
* not observed by Marrow (an allow rule, client-attested), never as the operator's answer.
|
|
118
|
+
*/
|
|
119
|
+
| {
|
|
120
|
+
kind: 'pass';
|
|
121
|
+
contextText: string;
|
|
122
|
+
} | {
|
|
123
|
+
kind: 'deny';
|
|
124
|
+
agentText: string;
|
|
125
|
+
userText: string;
|
|
126
|
+
code: boolean;
|
|
127
|
+
/** The owner's one-tap link: request it now, or only when the operator asks by retrying. */
|
|
128
|
+
ownerLink?: 'now' | 'on_request';
|
|
129
|
+
/** Denied only because Claude Code showed no dialog; a retry where it can asks. */
|
|
130
|
+
dialogLater?: boolean;
|
|
131
|
+
/** Not remembered as waiting: the next attempt starts over (approval state unreadable). */
|
|
132
|
+
retryFresh?: boolean;
|
|
133
|
+
/** The prompt to show if a retry can ask in the host's own dialog (keeps the notice and reason). */
|
|
134
|
+
laterPrompt?: string;
|
|
135
|
+
/** Waits quietly: nobody can be asked here (attended) or nobody is here (unattended). */
|
|
136
|
+
quiet?: 'attended' | 'unattended';
|
|
137
|
+
};
|
|
138
|
+
/** Shown when the owner's link is sent only if the operator asks for it. */
|
|
139
|
+
export declare const OWNER_LINK_ON_REQUEST_TEXT = "To ask the account owner, retry this exact action; Marrow then sends the owner a one-tap approval link.";
|
|
140
|
+
/** The sentence that replaces OWNER_APPROVAL_REQUEST_TEXT once Marrow sent the owner a one-tap link. */
|
|
141
|
+
export declare function ownerLinkSentText(channel: string): string;
|
|
142
|
+
/** Puts what happened to the owner's link into the plan's text (always, before output). */
|
|
143
|
+
export declare function finalizeOwnerRequest(plan: HoldPlan, outcome: OwnerLinkOutcome): HoldPlan;
|
|
144
|
+
/** Hosts whose typed reply is a person-only marker, and that marker (backend OPERATOR_MARKER_BY_HOST). */
|
|
145
|
+
export declare const TYPED_REPLY_MARKER: Readonly<Record<string, string>>;
|
|
146
|
+
/**
|
|
147
|
+
* Decides how a hook answers an ordinary held action. The operator approves
|
|
148
|
+
* where they work: the host's own dialog (Claude Code, Cursor shell and MCP
|
|
149
|
+
* calls), or a typed reply in a local interactive session of a host without a
|
|
150
|
+
* dialog (Codex, Gemini CLI, Cursor otherwise). The approval code and its
|
|
151
|
+
* prompt go only to a user-only channel; model-facing text never contains it.
|
|
152
|
+
* When no one can answer here, the action waits quietly (the owner's link only
|
|
153
|
+
* for owner-locked categories, the owner's own decline when the operator asks,
|
|
154
|
+
* or unattended runs with the owner's pings on).
|
|
155
|
+
* No text makes a dashboard login the step to take.
|
|
156
|
+
*/
|
|
157
|
+
export declare function planHeldAction(input: {
|
|
158
|
+
guidance: OrdinaryApprovalGuidance;
|
|
159
|
+
host: ApprovalHost;
|
|
160
|
+
hookEvent: string;
|
|
161
|
+
reason: string;
|
|
162
|
+
/** Claude Code: whether a hook "ask" reaches a person in this permission mode and version. */
|
|
163
|
+
claudePrompt?: {
|
|
164
|
+
available: boolean;
|
|
165
|
+
unavailableReason: string;
|
|
166
|
+
headless?: boolean;
|
|
167
|
+
};
|
|
168
|
+
/** Cursor: true only when sessionStart reported a local, non-background session. */
|
|
169
|
+
cursorInteractive?: boolean | null;
|
|
170
|
+
/** A local interactive session whose typed-reply hook runs (see typedReplyAvailable). */
|
|
171
|
+
typedReply?: boolean;
|
|
172
|
+
/** No person is in this run (headless, `codex exec`, `gemini -p`, a background agent). */
|
|
173
|
+
unattended?: boolean;
|
|
174
|
+
/**
|
|
175
|
+
* There is positive evidence that a person is at this host (a local
|
|
176
|
+
* interactive Codex, Gemini CLI or Cursor session; Grok, Cline and Windsurf
|
|
177
|
+
* run where their user works). Without it a hold that cannot be asked waits quietly.
|
|
178
|
+
*/
|
|
179
|
+
attendedConfirmed?: boolean;
|
|
180
|
+
/**
|
|
181
|
+
* The host's own approval prompt is off in this session (Codex started with
|
|
182
|
+
* its approval bypass, never-ask, automatic review, full auto or full
|
|
183
|
+
* access): leaving the action to it would let it run with no one asked.
|
|
184
|
+
*/
|
|
185
|
+
hostPromptOff?: boolean;
|
|
186
|
+
}): HoldPlan;
|
|
187
|
+
/**
|
|
188
|
+
* Hosts where an ordinary hold Marrow cannot ask about is left to the host's
|
|
189
|
+
* own approval step: those whose hook can answer neutrally (no decision), so
|
|
190
|
+
* the host's normal permission flow runs. A hook never emits an explicit
|
|
191
|
+
* allow for a held action. Gemini CLI and Grok are not here (their installed
|
|
192
|
+
* guards accept only an explicit allow or a fixed denial), nor is Cursor
|
|
193
|
+
* (preToolUse has no neutral answer and "ask" is not enforced there): those
|
|
194
|
+
* hold quietly.
|
|
195
|
+
*/
|
|
196
|
+
export declare const PASS_THROUGH_HOSTS: ReadonlySet<ApprovalHost>;
|
|
197
|
+
/** The hook_event of an answer given in a host prompt Marrow did not observe (labelled an allow rule). */
|
|
198
|
+
export declare const HOST_PROMPT_NOT_OBSERVED = "host_prompt_not_observed";
|
|
199
|
+
/** What the person sees when this host cannot ask them: the action waits for them. */
|
|
200
|
+
export declare const HELD_FOR_YOU_TEXT = "This action is held until you approve it. Approve it by retrying it in a session with Marrow's prompt.";
|
|
201
|
+
/**
|
|
202
|
+
* Arbitration review_required with the server's one-tap path: the owner picks
|
|
203
|
+
* and approves one proposal. The hook denies, asks Marrow to send the owner a
|
|
204
|
+
* link, and the retried action reads the status. Nobody is told to log in.
|
|
205
|
+
*/
|
|
206
|
+
export declare function planArbitrationHold(guidance: ArbitrationApprovalGuidance, options?: {
|
|
207
|
+
unattended?: boolean;
|
|
208
|
+
}): HoldPlan;
|
|
209
|
+
/** User-only text with the typed-reply code (Cursor user_message, Codex and Gemini systemMessage). */
|
|
210
|
+
export declare function typedReplyUserText(userText: string, code: string): string;
|
|
211
|
+
/** What a hold record needs from the runtime's guidance (ordinary or arbitration). */
|
|
212
|
+
export type HoldGuidance = Pick<OrdinaryApprovalGuidance, 'gateReceiptId' | 'decisionId' | 'proofRequired' | 'proofFields' | 'expiresAt' | 'approvalLinkPath'> & {
|
|
213
|
+
hostApprovalSupported?: boolean;
|
|
214
|
+
arbitrationReceiptId?: string | null;
|
|
215
|
+
};
|
|
216
|
+
export declare function arbitrationHoldGuidance(guidance: ArbitrationApprovalGuidance): HoldGuidance;
|
|
217
|
+
export type RecordHoldInput = {
|
|
218
|
+
guidance: HoldGuidance;
|
|
219
|
+
correlation: string;
|
|
220
|
+
toolUseId: string | null;
|
|
221
|
+
generationId: string | null;
|
|
222
|
+
toolName: string;
|
|
223
|
+
hookEvent: string;
|
|
224
|
+
mode: 'ask' | 'wait';
|
|
225
|
+
withCode: boolean;
|
|
226
|
+
preActionEventId: string | null;
|
|
227
|
+
action: {
|
|
228
|
+
action: string;
|
|
229
|
+
target: string;
|
|
230
|
+
type: string;
|
|
231
|
+
surfaces: string[];
|
|
232
|
+
};
|
|
233
|
+
/** From the plan: whether and when the owner's one-tap link is requested. */
|
|
234
|
+
ownerLink?: 'now' | 'on_request';
|
|
235
|
+
/** The normalized action the runtime call carried; the answer is reported with the same one. */
|
|
236
|
+
normalizedAction?: Record<string, unknown> | null;
|
|
237
|
+
/** Arbitration: a person is at this session (its retry asks for the owner's link). */
|
|
238
|
+
personPresent?: boolean;
|
|
239
|
+
dialogLater?: boolean;
|
|
240
|
+
laterPrompt?: string;
|
|
241
|
+
quiet?: 'attended' | 'unattended';
|
|
242
|
+
/** Left to the host's own approval step, which Marrow does not observe. */
|
|
243
|
+
notObserved?: boolean;
|
|
244
|
+
};
|
|
245
|
+
export declare function rememberHold(ctx: HoldContext, input: RecordHoldInput): HoldRecord;
|
|
246
|
+
/**
|
|
247
|
+
* Remembers the categories the account owner protects, from a hold's guidance,
|
|
248
|
+
* so an owner-protected action stays held while Marrow cannot be reached.
|
|
249
|
+
*/
|
|
250
|
+
export declare function rememberProtection(ctx: HoldContext, guidance: OrdinaryApprovalGuidance): void;
|
|
251
|
+
/** Of these categories, the ones this key last saw the account owner protect. */
|
|
252
|
+
export declare function protectedAmong(ctx: HoldContext, categories: string[]): string[];
|
|
253
|
+
/** Text for a person: the agent's text without receipt ids (the agent keeps them to close the action). */
|
|
254
|
+
export declare function forPerson(text: string): string;
|
|
255
|
+
/** An agent id worth showing a person: not an automatic seat or key-derived fallback id. */
|
|
256
|
+
export declare function personAgentName(agent: string | null | undefined): string | null;
|
|
257
|
+
/**
|
|
258
|
+
* Asks Marrow to send the account owner a one-tap approval link for this hold.
|
|
259
|
+
* A retryable failure (network, rate limit, undelivered) is tried again on a
|
|
260
|
+
* later attempt, up to the server's per-receipt limit; a final refusal is not.
|
|
261
|
+
* Returns what happened. The link itself never reaches this client or the agent.
|
|
262
|
+
*/
|
|
263
|
+
export declare function requestOwnerLink(ctx: HoldContext, hold: HoldRecord, reserve?: number): Promise<OwnerLinkOutcome>;
|
|
264
|
+
/**
|
|
265
|
+
* Once per interactive host session (its first prompt): tells the person how
|
|
266
|
+
* many held actions are waiting for them, with the action type and agent only,
|
|
267
|
+
* and refreshes this machine's copy of the owner-locked categories (so they
|
|
268
|
+
* stay held during an outage on a fresh machine). Returns user-only text, or null.
|
|
269
|
+
*/
|
|
270
|
+
export declare function heldActionsNotice(ctx: HoldContext, budgetMs?: number): Promise<string | null>;
|
|
271
|
+
/** PermissionRequest (pass-through): the host is about to show its own dialog for an asked call. */
|
|
272
|
+
export declare function noteDialogShown(ctx: HoldContext, correlation: string): HoldRecord | null;
|
|
273
|
+
/**
|
|
274
|
+
* Whether Claude Code runs Marrow's pass-through PermissionRequest hook here:
|
|
275
|
+
* seen on this machine for this key, or configured in the user's or the
|
|
276
|
+
* project's Claude Code settings. Without it there is no marker to wait for.
|
|
277
|
+
*/
|
|
278
|
+
export declare function permissionMarkerHookPresent(ctx: HoldContext, cwd?: string): boolean;
|
|
279
|
+
/**
|
|
280
|
+
* Who approved, as the status says it. "The account owner" only for the
|
|
281
|
+
* owner's verified approval; anything else is named for what it is.
|
|
282
|
+
*/
|
|
283
|
+
export declare function approvalSentence(status: MarrowOwnerApprovalStatus): string;
|
|
284
|
+
export type WaitingResolution = {
|
|
285
|
+
kind: 'allow';
|
|
286
|
+
hold: HoldRecord;
|
|
287
|
+
contextText: string;
|
|
288
|
+
} | {
|
|
289
|
+
kind: 'ask';
|
|
290
|
+
hold: HoldRecord;
|
|
291
|
+
promptText: string;
|
|
292
|
+
} | {
|
|
293
|
+
kind: 'deny';
|
|
294
|
+
hold: HoldRecord;
|
|
295
|
+
agentText: string;
|
|
296
|
+
userText: string;
|
|
297
|
+
deferredLink?: boolean;
|
|
298
|
+
};
|
|
299
|
+
/**
|
|
300
|
+
* The same action, retried after a hold that waited (denied while it waited
|
|
301
|
+
* for an approval). Reads the hold's status first: approved allows it once on
|
|
302
|
+
* the same gate receipt (compare-and-set: a second identical call is denied);
|
|
303
|
+
* pending denies again without a new hold; a status Marrow cannot give keeps
|
|
304
|
+
* it held; declined, expired or used fall back to the normal flow (null).
|
|
305
|
+
*/
|
|
306
|
+
export declare function resumeWaitingHold(ctx: HoldContext, input: {
|
|
307
|
+
correlation: string;
|
|
308
|
+
toolUseId: string | null;
|
|
309
|
+
generationId: string | null;
|
|
310
|
+
/** Claude Code shows its dialog for this attempt (permission mode and version). */
|
|
311
|
+
dialogAvailable?: boolean;
|
|
312
|
+
}): Promise<WaitingResolution | null>;
|
|
313
|
+
export type DeliveryResult = {
|
|
314
|
+
kind: 'recorded';
|
|
315
|
+
answeredBy: 'host_operator' | 'host_allow_rule' | 'owner_chat_preapproval';
|
|
316
|
+
verdict: 'approved' | 'declined';
|
|
317
|
+
committed: 'committed' | 'unverified' | 'failed' | 'skipped';
|
|
318
|
+
} | {
|
|
319
|
+
kind: 'already_approved';
|
|
320
|
+
committed: 'committed' | 'unverified' | 'failed' | 'skipped';
|
|
321
|
+
} | {
|
|
322
|
+
kind: 'queued';
|
|
323
|
+
} | {
|
|
324
|
+
kind: 'refused';
|
|
325
|
+
code: string | null;
|
|
326
|
+
committed: 'committed' | 'unverified' | 'failed' | 'skipped';
|
|
327
|
+
} | {
|
|
328
|
+
kind: 'dropped';
|
|
329
|
+
code: string | null;
|
|
330
|
+
};
|
|
331
|
+
/**
|
|
332
|
+
* Sends a hold's queued report (and the commit that follows it) once. A
|
|
333
|
+
* retryable failure (network, 409 STATE_UNAVAILABLE, 429, 5xx) keeps the
|
|
334
|
+
* identical body queued with backoff: the operator's answer is never dropped
|
|
335
|
+
* while its gate receipt can still accept it.
|
|
336
|
+
*/
|
|
337
|
+
export declare function deliverHold(ctx: HoldContext, holdId: string, deadline?: number): Promise<DeliveryResult | null>;
|
|
338
|
+
/** Delivers due queued reports for this key (bounded); called at the start of later hooks. */
|
|
339
|
+
export declare function flushHoldOutbox(ctx: HoldContext, limit?: number, budgetMs?: number): Promise<void>;
|
|
340
|
+
/**
|
|
341
|
+
* marrow_commit from the MCP server: the hooks bound this gate receipt to the
|
|
342
|
+
* host session (for example Claude Code's session_id), which the MCP server
|
|
343
|
+
* process does not know. The receipt stays the authority; the session only has
|
|
344
|
+
* to match it.
|
|
345
|
+
*/
|
|
346
|
+
export declare function holdSessionForReceipt(ctx: HoldContext, gateReceiptId: string): string | null;
|
|
347
|
+
/** The proof fields this machine's hold for a receipt asked for (empty when unknown). */
|
|
348
|
+
export declare function proofFieldsForReceipt(ctx: HoldContext, gateReceiptId: string): string[];
|
|
349
|
+
/** marrow_commit: send a queued host approval for this receipt before the agent's own commit. */
|
|
350
|
+
export declare function deliverQueuedForReceipt(ctx: HoldContext, gateReceiptId: string): Promise<void>;
|
|
351
|
+
/** How long a post-tool hook waits for Claude Code's async PermissionRequest marker. */
|
|
352
|
+
export declare const LATE_MARKER_WAIT_MS = 1500;
|
|
353
|
+
/**
|
|
354
|
+
* After the tool ran (PostToolUse/PostToolUseFailure, Cursor after*Execution):
|
|
355
|
+
* the operator allowed an asked call, or a waited hold was approved and retried.
|
|
356
|
+
* Reports the approval (asked calls only), then commits the real outcome when
|
|
357
|
+
* no proof is required and the host reported it; otherwise tells the agent how
|
|
358
|
+
* to close it.
|
|
359
|
+
*/
|
|
360
|
+
export declare function settleAfterTool(ctx: HoldContext, input: {
|
|
361
|
+
correlation: string;
|
|
362
|
+
toolUseId: string | null;
|
|
363
|
+
generationId: string | null;
|
|
364
|
+
/** null when the host does not say whether the call succeeded (Cursor's after-execution events). */
|
|
365
|
+
success: boolean | null;
|
|
366
|
+
/** Test seam: how long to wait for a late dialog marker. */
|
|
367
|
+
markerWaitMs?: number;
|
|
368
|
+
/** The exact action from this hook event, for the report (never stored). */
|
|
369
|
+
normalizedAction?: Record<string, unknown> | null;
|
|
370
|
+
}): Promise<string | null>;
|
|
371
|
+
export declare const CLAUDE_CODE_USER_REJECTED = "The user doesn't want to proceed with this tool use. The tool use was rejected (eg. if it was a file edit, the new_string was NOT written to the file). STOP what you are doing and wait for the user to tell you how to proceed.";
|
|
372
|
+
export declare const CLAUDE_CODE_USER_REJECTED_WITH_FEEDBACK = "The user doesn't want to proceed with this tool use. The tool use was rejected (eg. if it was a file edit, the new_string was NOT written to the file). To tell you how to proceed, the user said:\n";
|
|
373
|
+
/** Interruptions, cancellations and unanswered prompts: never a decline. */
|
|
374
|
+
export declare const CLAUDE_CODE_NOT_A_DECISION_PREFIXES: string[];
|
|
375
|
+
export type ClaudeCallResolution = 'declined' | 'interrupted' | 'unknown';
|
|
376
|
+
export declare function toolResultText(value: unknown): string | null;
|
|
377
|
+
/**
|
|
378
|
+
* A structured transcript denial kind wins. Free text is used only for
|
|
379
|
+
* built-in tools: an MCP tool authors its own result text and could imitate a
|
|
380
|
+
* rejection, so for MCP tools only the structured kind counts.
|
|
381
|
+
*/
|
|
382
|
+
export declare function classifyClaudeToolResult(input: {
|
|
383
|
+
toolName: string;
|
|
384
|
+
text: string | null;
|
|
385
|
+
denialKind?: string | null;
|
|
386
|
+
unanswered?: string | null;
|
|
387
|
+
}): ClaudeCallResolution;
|
|
388
|
+
export type TranscriptToolResult = {
|
|
389
|
+
text: string | null;
|
|
390
|
+
denialKind: string | null;
|
|
391
|
+
unanswered: string | null;
|
|
392
|
+
};
|
|
393
|
+
/** Reads only a bounded tail of the host's own transcript, and only the tool results asked for. */
|
|
394
|
+
export declare function transcriptToolResults(path: unknown, toolUseIds: Set<string>): Map<string, TranscriptToolResult>;
|
|
395
|
+
/** Claude Code PostToolBatch: decide each still-open asked call of the batch per tool_use_id. */
|
|
396
|
+
export declare function settleToolBatch(ctx: HoldContext, input: {
|
|
397
|
+
toolCalls: unknown;
|
|
398
|
+
transcriptPath?: unknown;
|
|
399
|
+
}): Promise<number>;
|
|
400
|
+
/** Claude Code UserPromptSubmit fallback: a rejected dialog can end the turn before PostToolBatch. */
|
|
401
|
+
export declare function settleAtPrompt(ctx: HoldContext, transcriptPath: unknown): Promise<number>;
|
|
402
|
+
export declare function parseTypedReply(prompt: unknown): {
|
|
403
|
+
verdict: 'approved' | 'declined';
|
|
404
|
+
code: string;
|
|
405
|
+
} | null;
|
|
406
|
+
export declare function noteCursorSession(ctx: HoldContext, input: {
|
|
407
|
+
isBackgroundAgent: unknown;
|
|
408
|
+
}): void;
|
|
409
|
+
export declare function cursorSessionEvidence(ctx: HoldContext): {
|
|
410
|
+
interactive: boolean | null;
|
|
411
|
+
promptHook: boolean | null;
|
|
412
|
+
};
|
|
413
|
+
/**
|
|
414
|
+
* A typed reply counts only from a person: the session must be local and
|
|
415
|
+
* interactive (Codex and Gemini CLI: the host process has a terminal and no
|
|
416
|
+
* scripted subcommand or prompt flag), the host must still ask before it runs
|
|
417
|
+
* a tool (otherwise the agent could run the prompt hook itself with a code it
|
|
418
|
+
* read from this user's files: Codex with its approval prompt off, Gemini CLI
|
|
419
|
+
* in YOLO mode, and Cursor, whose auto-run cannot be seen, get no typed reply
|
|
420
|
+
* and no code), and its prompt hook must already have run, so the reply can
|
|
421
|
+
* reach Marrow at all.
|
|
422
|
+
*/
|
|
423
|
+
export declare function typedReplyAvailable(ctx: HoldContext, interactive?: (host: string) => boolean | null, promptOff?: (host: string) => boolean): boolean;
|
|
424
|
+
export type TypedReplyResult = {
|
|
425
|
+
ok: boolean;
|
|
426
|
+
verdict: 'approved' | 'declined';
|
|
427
|
+
userText: string;
|
|
428
|
+
agentText: string | null;
|
|
429
|
+
};
|
|
430
|
+
/**
|
|
431
|
+
* The host's prompt hook (Codex UserPromptSubmit, Gemini BeforeAgent, Cursor
|
|
432
|
+
* beforeSubmitPrompt): records that the hook runs for this session, and records
|
|
433
|
+
* "marrow approve CODE" / "marrow decline CODE" typed by the operator.
|
|
434
|
+
*/
|
|
435
|
+
export declare function settleTypedReply(ctx: HoldContext, prompt: unknown, interactive?: (host: string) => boolean | null): Promise<TypedReplyResult | null>;
|
|
436
|
+
//# sourceMappingURL=host-approval.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"host-approval.d.ts","sourceRoot":"","sources":["../src/host-approval.ts"],"names":[],"mappings":"AAMA,OAAO,EAAyB,KAAK,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AAChF,OAAO,EAAmB,KAAK,2BAA2B,EAAE,KAAK,wBAAwB,EAAE,MAAM,oBAAoB,CAAC;AACtH,OAAO,EAaL,KAAK,UAAU,EAGhB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,SAAS,C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