@te-river/opencode-team-mode 1.7.2 → 1.7.4
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 +1008 -849
- package/README.zh-CN.md +905 -756
- package/dist/host/v2-browser-gate.d.ts +4 -1
- package/dist/host/v2-browser-gate.d.ts.map +1 -1
- package/dist/host/v2-browser-gate.js +1 -1
- package/dist/host/v2-browser-gate.js.map +1 -1
- package/dist/host/v2-capabilities.js +1 -1
- package/dist/host/v2-capabilities.js.map +1 -1
- package/dist/host/v2-events.d.ts +8 -2
- package/dist/host/v2-events.d.ts.map +1 -1
- package/dist/host/v2-events.js +16 -2
- package/dist/host/v2-events.js.map +1 -1
- package/dist/host/v2-guard.d.ts +3 -45
- package/dist/host/v2-guard.d.ts.map +1 -1
- package/dist/host/v2-guard.js +10 -73
- package/dist/host/v2-guard.js.map +1 -1
- package/dist/host/v2-offload.d.ts +12 -2
- package/dist/host/v2-offload.d.ts.map +1 -1
- package/dist/host/v2-offload.js +9 -9
- package/dist/host/v2-offload.js.map +1 -1
- package/dist/host/v2-probe-chain.d.ts +5 -1
- package/dist/host/v2-probe-chain.d.ts.map +1 -1
- package/dist/host/v2-probe-chain.js +4 -6
- package/dist/host/v2-probe-chain.js.map +1 -1
- package/dist/host/v2-probe.d.ts.map +1 -1
- package/dist/host/v2-probe.js +2 -1
- package/dist/host/v2-probe.js.map +1 -1
- package/dist/host/v2-prune.d.ts +5 -1
- package/dist/host/v2-prune.d.ts.map +1 -1
- package/dist/host/v2-prune.js +8 -14
- package/dist/host/v2-prune.js.map +1 -1
- package/dist/host/v2-retry.d.ts +10 -3
- package/dist/host/v2-retry.d.ts.map +1 -1
- package/dist/host/v2-retry.js +14 -16
- package/dist/host/v2-retry.js.map +1 -1
- package/dist/host/v2-session.d.ts +6 -2
- package/dist/host/v2-session.d.ts.map +1 -1
- package/dist/host/v2-session.js +7 -13
- package/dist/host/v2-session.js.map +1 -1
- package/dist/host/v2.d.ts +0 -5
- package/dist/host/v2.d.ts.map +1 -1
- package/dist/host/v2.js +32 -73
- package/dist/host/v2.js.map +1 -1
- package/dist/prompts/lead.d.ts +1 -1
- package/dist/prompts/lead.d.ts.map +1 -1
- package/dist/prompts/lead.js +47 -19
- package/dist/prompts/lead.js.map +1 -1
- package/dist/prompts/shared.d.ts +1 -1
- package/dist/prompts/shared.d.ts.map +1 -1
- package/dist/prompts/shared.js +16 -0
- package/dist/prompts/shared.js.map +1 -1
- package/dist/prompts/specialists.d.ts +1 -1
- package/dist/prompts/specialists.d.ts.map +1 -1
- package/dist/prompts/specialists.js +1 -1
- package/dist/tm/args-schema.d.ts +1 -1
- package/dist/tm/args-schema.js +6 -6
- package/dist/tm/args-schema.js.map +1 -1
- package/dist/tm/board.js +2 -2
- package/dist/tm/board.js.map +1 -1
- package/dist/tm/config-files.d.ts +41 -17
- package/dist/tm/config-files.d.ts.map +1 -1
- package/dist/tm/config-files.js +68 -73
- package/dist/tm/config-files.js.map +1 -1
- package/dist/tm/config-layers.d.ts +65 -33
- package/dist/tm/config-layers.d.ts.map +1 -1
- package/dist/tm/config-layers.js +164 -81
- package/dist/tm/config-layers.js.map +1 -1
- package/dist/tm/config-template.d.ts +32 -0
- package/dist/tm/config-template.d.ts.map +1 -0
- package/dist/tm/config-template.js +74 -0
- package/dist/tm/config-template.js.map +1 -0
- package/dist/tm/config.d.ts +113 -140
- package/dist/tm/config.d.ts.map +1 -1
- package/dist/tm/config.js +100 -200
- package/dist/tm/config.js.map +1 -1
- package/dist/tm/dispatch.d.ts +0 -9
- package/dist/tm/dispatch.d.ts.map +1 -1
- package/dist/tm/dispatch.js +14 -16
- package/dist/tm/dispatch.js.map +1 -1
- package/dist/tm/index.d.ts +12 -12
- package/dist/tm/index.d.ts.map +1 -1
- package/dist/tm/index.js +48 -26
- package/dist/tm/index.js.map +1 -1
- package/dist/tm/ledger.d.ts +7 -3
- package/dist/tm/ledger.d.ts.map +1 -1
- package/dist/tm/ledger.js +5 -4
- package/dist/tm/ledger.js.map +1 -1
- package/dist/tm/memory.js +3 -3
- package/dist/tm/pipelines.js +1 -1
- package/dist/tm/search.js +6 -6
- package/dist/tm/search.js.map +1 -1
- package/dist/tm/stats.js +2 -2
- package/dist/tm/stats.js.map +1 -1
- package/dist/tm/tools.js +2 -2
- package/dist/tm/webfetch.d.ts +5 -2
- package/dist/tm/webfetch.d.ts.map +1 -1
- package/dist/tm/webfetch.js +24 -18
- package/dist/tm/webfetch.js.map +1 -1
- package/docs/installation-v2.md +59 -38
- package/docs/installation.md +4 -4
- package/package.json +1 -1
- package/scripts/gen-v2-config.mjs +8 -7
- package/dist/approval-gate.d.ts +0 -205
- package/dist/approval-gate.d.ts.map +0 -1
- package/dist/approval-gate.js +0 -627
- package/dist/approval-gate.js.map +0 -1
- package/dist/host/v1.d.ts +0 -14
- package/dist/host/v1.d.ts.map +0 -1
- package/dist/host/v1.js +0 -340
- package/dist/host/v1.js.map +0 -1
- package/dist/host/v2-client.d.ts +0 -53
- package/dist/host/v2-client.d.ts.map +0 -1
- package/dist/host/v2-client.js +0 -193
- package/dist/host/v2-client.js.map +0 -1
- package/dist/host/v2-transcript.d.ts +0 -73
- package/dist/host/v2-transcript.d.ts.map +0 -1
- package/dist/host/v2-transcript.js +0 -151
- package/dist/host/v2-transcript.js.map +0 -1
- package/dist/host-hooks.d.ts +0 -126
- package/dist/host-hooks.d.ts.map +0 -1
- package/dist/host-hooks.js +0 -284
- package/dist/host-hooks.js.map +0 -1
- package/dist/tm/bash-timeout.d.ts +0 -72
- package/dist/tm/bash-timeout.d.ts.map +0 -1
- package/dist/tm/bash-timeout.js +0 -100
- package/dist/tm/bash-timeout.js.map +0 -1
- package/dist/tm/browser.d.ts +0 -642
- package/dist/tm/browser.d.ts.map +0 -1
- package/dist/tm/browser.js +0 -2836
- package/dist/tm/browser.js.map +0 -1
- package/dist/tm/ptc/budgets.d.ts +0 -59
- package/dist/tm/ptc/budgets.d.ts.map +0 -1
- package/dist/tm/ptc/budgets.js +0 -138
- package/dist/tm/ptc/budgets.js.map +0 -1
- package/dist/tm/ptc/contract.d.ts +0 -171
- package/dist/tm/ptc/contract.d.ts.map +0 -1
- package/dist/tm/ptc/contract.js +0 -85
- package/dist/tm/ptc/contract.js.map +0 -1
- package/dist/tm/ptc/driver.d.ts +0 -40
- package/dist/tm/ptc/driver.d.ts.map +0 -1
- package/dist/tm/ptc/driver.js +0 -213
- package/dist/tm/ptc/driver.js.map +0 -1
- package/dist/tm/ptc/engines.d.ts +0 -43
- package/dist/tm/ptc/engines.d.ts.map +0 -1
- package/dist/tm/ptc/engines.js +0 -454
- package/dist/tm/ptc/engines.js.map +0 -1
- package/dist/tm/ptc/gate.d.ts +0 -28
- package/dist/tm/ptc/gate.d.ts.map +0 -1
- package/dist/tm/ptc/gate.js +0 -130
- package/dist/tm/ptc/gate.js.map +0 -1
- package/dist/tm/ptc/index.d.ts +0 -19
- package/dist/tm/ptc/index.d.ts.map +0 -1
- package/dist/tm/ptc/index.js +0 -15
- package/dist/tm/ptc/index.js.map +0 -1
- package/dist/tm/ptc/pscan.d.ts +0 -30
- package/dist/tm/ptc/pscan.d.ts.map +0 -1
- package/dist/tm/ptc/pscan.js +0 -341
- package/dist/tm/ptc/pscan.js.map +0 -1
- package/dist/tm/ptc/summary.d.ts +0 -17
- package/dist/tm/ptc/summary.d.ts.map +0 -1
- package/dist/tm/ptc/summary.js +0 -134
- package/dist/tm/ptc/summary.js.map +0 -1
- package/dist/tm/ptc/tool.d.ts +0 -66
- package/dist/tm/ptc/tool.d.ts.map +0 -1
- package/dist/tm/ptc/tool.js +0 -231
- package/dist/tm/ptc/tool.js.map +0 -1
- package/dist/tm/ptc.d.ts +0 -298
- package/dist/tm/ptc.d.ts.map +0 -1
- package/dist/tm/ptc.js +0 -865
- package/dist/tm/ptc.js.map +0 -1
- package/dist/tm/pty.d.ts +0 -70
- package/dist/tm/pty.d.ts.map +0 -1
- package/dist/tm/pty.js +0 -245
- package/dist/tm/pty.js.map +0 -1
- package/dist/tool-coerce.d.ts +0 -24
- package/dist/tool-coerce.d.ts.map +0 -1
- package/dist/tool-coerce.js +0 -63
- package/dist/tool-coerce.js.map +0 -1
package/dist/approval-gate.d.ts
DELETED
|
@@ -1,205 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Unified approval gate — Layer 2 (timeout auto-reject) + Layer 3 (SDK
|
|
3
|
-
* fallback) of the R6 + R2 approval flow.
|
|
4
|
-
*
|
|
5
|
-
* The host only shows its official confirmation dialog for command patterns
|
|
6
|
-
* declared `ask` in an agent's permission config (Layer 1, envprotect.ts).
|
|
7
|
-
* When a dialog opens it SUSPENDS the tool call and waits for a human; on the
|
|
8
|
-
* OpenCode DESKTOP that human is present, but a request can also be left
|
|
9
|
-
* unanswered. This module owns ONE timer that watches the host permission
|
|
10
|
-
* events and closes abandoned requests on the safe side.
|
|
11
|
-
*
|
|
12
|
-
* REAL host contract (1.18.29, probed live via SSE + the plugin event hook —
|
|
13
|
-
* see gate-test report-p5):
|
|
14
|
-
* permission.asked → properties = { id, sessionID, permission: "bash",
|
|
15
|
-
* patterns: [<concrete command segment>, …], metadata:
|
|
16
|
-
* { command }, always: [<host's "always" generalization
|
|
17
|
-
* proposal>], tool: { messageID, callID } } — the props
|
|
18
|
-
* carry NO `type` field, and the tool name sits in
|
|
19
|
-
* `permission`. A props matching one of OUR injected
|
|
20
|
-
* bash ask sets means the dialog is ours: audit "ask",
|
|
21
|
-
* arm the timeout, and — for the R6 env face — mark
|
|
22
|
-
* the session deferrable (canDefer, see below).
|
|
23
|
-
* permission.replied → properties = { sessionID, requestID, reply } on the
|
|
24
|
-
* wire, but the plugin-side observer has also seen it
|
|
25
|
-
* with ONLY { sessionID }. The gate therefore cancels
|
|
26
|
-
* EVERY pending timer of that session on a reply: an
|
|
27
|
-
* already-approved command left on a live timer would
|
|
28
|
-
* get a second reject after the timeout, the SDK call
|
|
29
|
-
* would hit a dead id (4xx) and flip the gate
|
|
30
|
-
* permanently degraded.
|
|
31
|
-
*
|
|
32
|
-
* Older/typed spellings (`permission.updated`, `pattern`, `permissionID`,
|
|
33
|
-
* `response`) keep being accepted — the shipped SDK d.ts still names the
|
|
34
|
-
* events that way, and some builds omit the reply id entirely (a short
|
|
35
|
-
* ghost-suppression window per session then absorbs late/duplicate `asked`
|
|
36
|
-
* replays instead of re-arming a ghost timer).
|
|
37
|
-
*
|
|
38
|
-
* Hard rules (HUMAN-approved):
|
|
39
|
-
* - the plugin NEVER self-allows: `reply` is fixed to "reject". The only
|
|
40
|
-
* way a gated command runs is a human approving the dialog;
|
|
41
|
-
* - on `TM_ENV_PROTECT=off` the gate is not armed (the caller decides);
|
|
42
|
-
* - deferral is SESSION-SCOPED (canDefer): only sessions registered as
|
|
43
|
-
* carrying our injected ask set may have env reads passed through —
|
|
44
|
-
* registration comes from an exec-role user prompt (the live-proven
|
|
45
|
-
* `message.updated` UserMessage{role,agent,sessionID} signal, plus the
|
|
46
|
-
* documented `chat.message` hook) or from an R6-env-classified asked
|
|
47
|
-
* event. Stock build/plan sessions never register, so the global R6
|
|
48
|
-
* hook keeps hard-throwing there — closing the R6 bypass the global
|
|
49
|
-
* `isArmed()` deferral allowed;
|
|
50
|
-
* - if the SDK reply FAILS (network/host — including the SDK's
|
|
51
|
-
* `throwOnError:false` envelope resolving with `{ error }`), we cannot
|
|
52
|
-
* close the dialog, so the gate flips itself permanently "degraded" —
|
|
53
|
-
* the R6 hook stops deferring env reads and hard-throws them again
|
|
54
|
-
* (fail-closed), and the event is audited "degraded".
|
|
55
|
-
*
|
|
56
|
-
* SDK surface (probed live): the host client may carry NO `permission`
|
|
57
|
-
* namespace and NO list/create endpoint; the reply path is the top-level
|
|
58
|
-
* `postSessionIdPermissionsPermissionId({ path: { id: sessionID,
|
|
59
|
-
* permissionID }, body: { response } })`. `client.permission.reply` /
|
|
60
|
-
* `client.permission.list` are still tried first so a richer host build is
|
|
61
|
-
* supported, but when they are absent the poll fallback is a no-op (events
|
|
62
|
-
* are the sole pending signal).
|
|
63
|
-
*/
|
|
64
|
-
import type { PermissionEvent } from "./types.js";
|
|
65
|
-
/** Default timeout, in minutes, before an unanswered dialog is auto-rejected.
|
|
66
|
-
* 1 min (user directive) — an unanswered dialog no longer hangs for 10.
|
|
67
|
-
* A short timer is safe because a reject that lands on an already-closed
|
|
68
|
-
* request is benign; see `MIN_ASK_TIMEOUT_MIN` for the full rationale. */
|
|
69
|
-
export declare const DEFAULT_ASK_TIMEOUT_MIN = 1;
|
|
70
|
-
/**
|
|
71
|
-
* Hard floor (minutes) for the auto-reject timeout. The HISTORIC 3-min
|
|
72
|
-
* floor existed to dodge the measured ~120s `permission.replied` bus lag:
|
|
73
|
-
* a shorter timer would fire before the cancel arrives and auto-reject a
|
|
74
|
-
* just-approved request. That lag, though, is the HOST DELIVERING the
|
|
75
|
-
* replied event to the plugin over the bus — NOT the host resolving the
|
|
76
|
-
* user's click: an approval takes effect instantly host-side, so the
|
|
77
|
-
* plugin's late reject simply targets an already-closed request id → 404.
|
|
78
|
-
* T2's `classifyReplyFailure` maps that outcome to the benign
|
|
79
|
-
* `already-closed` verdict (it never flips the gate to `degraded`, and the
|
|
80
|
-
* approved command runs either way); `onReplied` records a reply landing
|
|
81
|
-
* after the auto-reject as `late-<verdict>` for observability. With that
|
|
82
|
-
* classification in place a short timeout no longer disables the gate, so
|
|
83
|
-
* the floor drops to 1 minute (user directive). Trade-off: an UNANSWERED
|
|
84
|
-
* dialog auto-rejects after 1 min — a user who stepped away re-triggers
|
|
85
|
-
* the command. In-range values below the floor still clamp UP to it.
|
|
86
|
-
*
|
|
87
|
-
* This is the FALLBACK default of the floor. The live floor comes from the
|
|
88
|
-
* P0 config knob `TM_ASK_TIMEOUT_FLOOR_MIN`
|
|
89
|
-
* (`resolveTmConfig().askTimeoutFloorMin`, itself defaulted to 1).
|
|
90
|
-
*/
|
|
91
|
-
export declare const MIN_ASK_TIMEOUT_MIN = 1;
|
|
92
|
-
/** The verdict vocabulary recorded in the audit trail (privacy: no command
|
|
93
|
-
* text, path, variable name or value is ever logged). `already-closed` /
|
|
94
|
-
* `rejected-shape-bug` split the old blanket `degraded` on a failed reply by
|
|
95
|
-
* `classifyReplyFailure`; a late reply past the auto-reject is recorded as a
|
|
96
|
-
* dynamic `late-<verdict>` string (observability only — never re-runs or
|
|
97
|
-
* revives the command). */
|
|
98
|
-
export type ApprovalVerdict = "ask" | "allowed-once" | "allowed-always" | "rejected" | "timeout-rejected" | "already-closed" | "rejected-shape-bug" | "degraded";
|
|
99
|
-
/**
|
|
100
|
-
* Resolve `TM_ASK_TIMEOUT_MIN`. Unset / blank / non-numeric / <1 / >1440
|
|
101
|
-
* (24h) fall back to the 1-minute default — a mistyped value can never
|
|
102
|
-
* disable the timeout or make it absurdly long. Valid values below the
|
|
103
|
-
* floor clamp UP to it — the floor is the P0 config knob
|
|
104
|
-
* `TM_ASK_TIMEOUT_FLOOR_MIN` (`resolveTmConfig().askTimeoutFloorMin`,
|
|
105
|
-
* default 1). The historic ~120s bus-lag reason for a 3-min floor is
|
|
106
|
-
* obsolete: a late reject on an already-closed id is benign
|
|
107
|
-
* `already-closed`, not a degraded flip (see `MIN_ASK_TIMEOUT_MIN`).
|
|
108
|
-
*/
|
|
109
|
-
export declare function resolveAskTimeoutMs(env?: Record<string, string | undefined>): number;
|
|
110
|
-
type TimerHandle = unknown;
|
|
111
|
-
export interface GateTimers {
|
|
112
|
-
setTimeoutFn: (cb: () => void, ms: number) => TimerHandle;
|
|
113
|
-
clearTimeoutFn: (handle: TimerHandle) => void;
|
|
114
|
-
}
|
|
115
|
-
export interface ApprovalGateDeps {
|
|
116
|
-
client: unknown;
|
|
117
|
-
timeoutMs: number;
|
|
118
|
-
/** Injectable timers (default: real global timers) for deterministic tests. */
|
|
119
|
-
timers?: GateTimers;
|
|
120
|
-
/** Injectable clock (default: Date.now) for deterministic window tests. */
|
|
121
|
-
now?: () => number;
|
|
122
|
-
/** Best-effort attention hook — fired on EVERY permission.asked (all
|
|
123
|
-
* dialogs: bash R2/R6 asks AND the tm_* ctx.ask web dialogs) so a user
|
|
124
|
-
* not staring at the screen learns a confirmation is waiting. The caller
|
|
125
|
-
* wires this to the host's `tui.showToast`. Never throws into the gate. */
|
|
126
|
-
notify?: (message: string) => void;
|
|
127
|
-
}
|
|
128
|
-
export interface ApprovalGate {
|
|
129
|
-
/** Handle one host event (permission.asked/updated / permission.replied). */
|
|
130
|
-
handleEvent(event: PermissionEvent): void;
|
|
131
|
-
/** Start the poll fallback (no-op when the host has no list endpoint). */
|
|
132
|
-
start(): void;
|
|
133
|
-
/** Stop the poll + every pending timer. */
|
|
134
|
-
dispose(): void;
|
|
135
|
-
/** Global gate health: armed, not degraded, and the client can reply. */
|
|
136
|
-
isArmed(): boolean;
|
|
137
|
-
/**
|
|
138
|
-
* The R6 hook's deferral query: TRUE only when this exact session is
|
|
139
|
-
* registered as carrying our injected ask set AND the gate is healthy.
|
|
140
|
-
* Replaces the old global `isArmed()` deferral (which let stock build/plan
|
|
141
|
-
* sessions pass env reads silently with no dialog in front of them).
|
|
142
|
-
*/
|
|
143
|
-
canDefer(sessionID?: string): boolean;
|
|
144
|
-
/** True once a session registered (exec-role prompt seen on
|
|
145
|
-
* message.updated / chat.message by index.ts, or an R6-env-classified
|
|
146
|
-
* asked event). Introspection for tests/diagnostics. */
|
|
147
|
-
hasLiveAsk(sessionID?: string): boolean;
|
|
148
|
-
/** Mark a session as carrying the injected ask set (index.ts calls this
|
|
149
|
-
* when a user prompt routes to an agent we injected the escalated bash
|
|
150
|
-
* ask object into — proven live: `message.updated` UserMessage carries
|
|
151
|
-
* { sessionID, role:"user", agent } and fires BEFORE the session's first
|
|
152
|
-
* tool call, while permission.asked fires AFTER tool.execute.before). */
|
|
153
|
-
registerExecSession(sessionID?: string): void;
|
|
154
|
-
/**
|
|
155
|
-
* Drop a session's exec-role registration (index.ts calls this when a user
|
|
156
|
-
* prompt routes to an agent that does NOT carry our injected ask set).
|
|
157
|
-
* The verified host passes {tool, sessionID, callID} with NO agent to
|
|
158
|
-
* tool.execute.before (desktop binary: `plugin.trigger("tool.execute.before",
|
|
159
|
-
* { tool, sessionID, callID }, { args })`), so the per-turn agent signal
|
|
160
|
-
* can only come from message.updated/chat.message. Without revocation a
|
|
161
|
-
* session that once ran a team prompt stayed deferrable forever — even
|
|
162
|
-
* after the user switched the picker to a stock agent whose dialogs would
|
|
163
|
-
* never fire, silently passing env reads (canDefer true + no dialog).
|
|
164
|
-
* A later env-classified permission.asked re-registers on real dialog
|
|
165
|
-
* evidence, and the next exec-role prompt re-registers again — both paths
|
|
166
|
-
* re-arm from fresh evidence, so revocation only ever closes a stale
|
|
167
|
-
* window (fail-closed direction).
|
|
168
|
-
*/
|
|
169
|
-
revokeExecSession(sessionID?: string): void;
|
|
170
|
-
/** True after the user picked "always" on an env-related ask in this session
|
|
171
|
-
* — subsequent env reads pass silently (the approval event itself is audited). */
|
|
172
|
-
isEnvApproved(sessionID?: string): boolean;
|
|
173
|
-
/** Number of pending requests currently being timed (tests / introspection). */
|
|
174
|
-
pendingSize(): number;
|
|
175
|
-
}
|
|
176
|
-
/** How a FAILED permission-reply call should be treated by the gate. */
|
|
177
|
-
export type ReplyFailureClass = "benign-closed" | "param-shape" | "transport";
|
|
178
|
-
/**
|
|
179
|
-
* Classify a reply-call failure so the gate no longer flips permanently
|
|
180
|
-
* `degraded` on a harmless close. `unwrapSdkEnvelope` has already hoisted the
|
|
181
|
-
* HTTP status onto the thrown envelope error; a genuine `Promise.reject`
|
|
182
|
-
* arrives as a plain Error with no status.
|
|
183
|
-
* - `benign-closed`: 404, or a NotFound/PermissionNotFound name/_tag — the
|
|
184
|
-
* dialog was ALREADY closed on the host (the D4 late-reply race): our
|
|
185
|
-
* reject was a no-op, so the popup path stays trustworthy.
|
|
186
|
-
* - `param-shape`: 400, or a BadRequest/InvalidRequest name/_tag — our
|
|
187
|
-
* reply body/params are wrong for this host: a real integration bug.
|
|
188
|
-
* - `transport`: everything else — a genuine Error, a 5xx, or an empty /
|
|
189
|
-
* status-less body — we could not reach or close the dialog.
|
|
190
|
-
* Reads only the error CLASS + status number (privacy: never message text).
|
|
191
|
-
*/
|
|
192
|
-
export declare function classifyReplyFailure(err: unknown): ReplyFailureClass;
|
|
193
|
-
/** True when the client exposes a permission-reply path at all. index.ts
|
|
194
|
-
* arms the gate ONLY for such a client — fail-closed otherwise (no armed
|
|
195
|
-
* auto-reject ⇒ the R6 hook keeps hard-throwing every env read). */
|
|
196
|
-
export declare function hasPermissionReplyCapability(client: unknown): boolean;
|
|
197
|
-
/**
|
|
198
|
-
* Create the approval gate. It is intentionally pure about timing +
|
|
199
|
-
* replying + session registration; the caller (index.ts) decides whether to
|
|
200
|
-
* arm it (mode != off AND the client is reply-capable), feeds events in, and
|
|
201
|
-
* wires `canDefer(sessionID)` into the R6 hook.
|
|
202
|
-
*/
|
|
203
|
-
export declare function createApprovalGate(deps: ApprovalGateDeps): ApprovalGate;
|
|
204
|
-
export {};
|
|
205
|
-
//# sourceMappingURL=approval-gate.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"approval-gate.d.ts","sourceRoot":"","sources":["../src/approval-gate.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8DG;AAEH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,YAAY,CAAA;AAIjD;;;2EAG2E;AAC3E,eAAO,MAAM,uBAAuB,IAAI,CAAA;AAExC;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,eAAO,MAAM,mBAAmB,IAAI,CAAA;AAkBpC;;;;;4BAK4B;AAC5B,MAAM,MAAM,eAAe,GACvB,KAAK,GACL,cAAc,GACd,gBAAgB,GAChB,UAAU,GACV,kBAAkB,GAClB,gBAAgB,GAChB,oBAAoB,GACpB,UAAU,CAAA;AAEd;;;;;;;;;GASG;AACH,wBAAgB,mBAAmB,CAAC,GAAG,GAA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