@agentvault/agentvault 0.23.71 → 0.23.73
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 +3 -1
- package/dist/atomic-file.d.ts +11 -0
- package/dist/atomic-file.d.ts.map +1 -0
- package/dist/channel.d.ts +677 -46
- package/dist/channel.d.ts.map +1 -1
- package/dist/cli.js +8169 -2405
- package/dist/cli.js.map +4 -4
- package/dist/dm-group-pins.d.ts +190 -0
- package/dist/dm-group-pins.d.ts.map +1 -0
- package/dist/dr-refusal.d.ts +54 -0
- package/dist/dr-refusal.d.ts.map +1 -0
- package/dist/file-send-failure.d.ts +115 -0
- package/dist/file-send-failure.d.ts.map +1 -0
- package/dist/file-send-policy.d.ts +251 -0
- package/dist/file-send-policy.d.ts.map +1 -0
- package/dist/full-permissions.d.ts +479 -0
- package/dist/full-permissions.d.ts.map +1 -0
- package/dist/gateway-send.d.ts +8 -0
- package/dist/gateway-send.d.ts.map +1 -1
- package/dist/harness-compat.d.ts +12 -0
- package/dist/harness-compat.d.ts.map +1 -1
- package/dist/http-handlers.d.ts +5 -1
- package/dist/http-handlers.d.ts.map +1 -1
- package/dist/index.d.ts +13 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +8672 -2421
- package/dist/index.js.map +4 -4
- package/dist/local-api-server.d.ts +71 -0
- package/dist/local-api-server.d.ts.map +1 -0
- package/dist/local-api.d.ts +107 -0
- package/dist/local-api.d.ts.map +1 -0
- package/dist/mcp-handlers.d.ts +15 -1
- package/dist/mcp-handlers.d.ts.map +1 -1
- package/dist/mcp-server.d.ts +4 -1
- package/dist/mcp-server.d.ts.map +1 -1
- package/dist/off-sequence-report.d.ts +74 -0
- package/dist/off-sequence-report.d.ts.map +1 -0
- package/dist/onturn-stop.d.ts +253 -0
- package/dist/onturn-stop.d.ts.map +1 -0
- package/dist/openclaw-entry.d.ts +44 -6
- package/dist/openclaw-entry.d.ts.map +1 -1
- package/dist/openclaw-entry.js +1384 -177
- package/dist/openclaw-entry.js.map +4 -4
- package/dist/openclaw-file-send.d.ts +308 -0
- package/dist/openclaw-file-send.d.ts.map +1 -0
- package/dist/openclaw-plugin.d.ts +7 -2
- package/dist/openclaw-plugin.d.ts.map +1 -1
- package/dist/openclaw-room-taint.d.ts +43 -0
- package/dist/openclaw-room-taint.d.ts.map +1 -0
- package/dist/openclaw-sender.d.ts +47 -0
- package/dist/openclaw-sender.d.ts.map +1 -0
- package/dist/openclaw-types.d.ts +7 -1
- package/dist/openclaw-types.d.ts.map +1 -1
- package/dist/owner-devices.d.ts +71 -0
- package/dist/owner-devices.d.ts.map +1 -0
- package/dist/owner-epoch.d.ts +36 -0
- package/dist/owner-epoch.d.ts.map +1 -0
- package/dist/room-protocol.d.ts +22 -2
- package/dist/room-protocol.d.ts.map +1 -1
- package/dist/room-send-error.d.ts +17 -0
- package/dist/room-send-error.d.ts.map +1 -0
- package/dist/sender-binding.d.ts +130 -0
- package/dist/sender-binding.d.ts.map +1 -0
- package/dist/tool-telemetry.d.ts +1 -1
- package/dist/tool-telemetry.d.ts.map +1 -1
- package/dist/turn-token.d.ts +168 -0
- package/dist/turn-token.d.ts.map +1 -0
- package/dist/types.d.ts +162 -6
- package/dist/types.d.ts.map +1 -1
- package/openclaw.plugin.json +1 -1
- package/package.json +1 -1
- package/dist/workspace-handlers.d.ts +0 -62
- package/dist/workspace-handlers.d.ts.map +0 -1
|
@@ -0,0 +1,308 @@
|
|
|
1
|
+
import type { FileSendHostOptions, FileSendTarget } from "./file-send-policy.js";
|
|
2
|
+
import { type FileSendCode } from "./file-send-failure.js";
|
|
3
|
+
import { type SdkCandidate, type SdkImporter } from "./openclaw-compat.js";
|
|
4
|
+
import { type TurnLease, type TurnToken } from "./turn-token.js";
|
|
5
|
+
import type { DeliveryTarget } from "./types.js";
|
|
6
|
+
import type { OpenClawSessionState } from "./openclaw-room-taint.js";
|
|
7
|
+
/** The OpenClaw tool a model sends a file with. */
|
|
8
|
+
export declare const OPENCLAW_FILE_TOOL = "message";
|
|
9
|
+
export type MediaRef = {
|
|
10
|
+
kind: "local";
|
|
11
|
+
path: string;
|
|
12
|
+
} | {
|
|
13
|
+
kind: "link";
|
|
14
|
+
url: string;
|
|
15
|
+
} | {
|
|
16
|
+
kind: "refused";
|
|
17
|
+
};
|
|
18
|
+
/**
|
|
19
|
+
* One media reference from a payload or the `message` tool:
|
|
20
|
+
* - `http(s)://…` → a link (sent as `Link: <url>` text, never re-hosted);
|
|
21
|
+
* - `file://…` → the local path it names;
|
|
22
|
+
* - anything else → handed to the path policy as written, which refuses a
|
|
23
|
+
* real URL (`scheme://…`, `data:`, `file:`), a drive letter (`C:`) and a
|
|
24
|
+
* `//host` path — and accepts a name like `v2:report.pdf`.
|
|
25
|
+
*/
|
|
26
|
+
export declare function classifyMediaRef(raw: unknown): MediaRef;
|
|
27
|
+
/** Every media reference a payload carries (`mediaUrl` and `mediaUrls`), once each, strings only. */
|
|
28
|
+
export declare function mediaRefsOf(payload: unknown): string[];
|
|
29
|
+
/** The file target a delivery target maps to; `null` for a2a / channel / context (media refused). */
|
|
30
|
+
export declare function fileTargetFor(target: DeliveryTarget | undefined): FileSendTarget | null;
|
|
31
|
+
/**
|
|
32
|
+
* What OpenClaw's send context tells us (ChannelMessageSendMediaContext): its
|
|
33
|
+
* media roots, and its reader. Whether the session is SANDBOXED is NOT read
|
|
34
|
+
* from the context — 2026.10.8 passes `mediaAccess` / `mediaReadFile` on every
|
|
35
|
+
* `message`-tool send (`deliver-prepare-*.mjs:372-374`), sandboxed or not
|
|
36
|
+
* (dr-evil #1784, MEDIUM 2). The caller passes the real status
|
|
37
|
+
* (`sandboxedForSend`). Not sandboxed → the full host policy (realpath,
|
|
38
|
+
* O_NOFOLLOW, nlink, (dev, ino)) ∩ the media roots, and OpenClaw's reader is
|
|
39
|
+
* not used.
|
|
40
|
+
*/
|
|
41
|
+
export declare function hostFromSendContext(ctx: unknown, sandboxed: boolean): FileSendHostOptions;
|
|
42
|
+
export declare function noteTurnSandbox(token: TurnToken | null | undefined, sandboxed: boolean): void;
|
|
43
|
+
/**
|
|
44
|
+
* Is a `message`-tool send sandboxed? The running turn's own answer when the
|
|
45
|
+
* call chain has a turn; otherwise (turnless) OpenClaw's config rule with no
|
|
46
|
+
* session key, where "non-main" counts as sandboxed (fail closed).
|
|
47
|
+
*/
|
|
48
|
+
export declare function sandboxedForSend(cfg: unknown, accountId: string | undefined, turn: TurnToken | null | undefined, importer?: SdkImporter): Promise<boolean>;
|
|
49
|
+
/** Where `getAgentScopedMediaLocalRoots` lives (2026.10). */
|
|
50
|
+
export declare const MEDIA_ROOTS_CANDIDATES: SdkCandidate[];
|
|
51
|
+
/** Test seam: forget the resolved SDK function. */
|
|
52
|
+
export declare function _resetMediaRootsForTest(): void;
|
|
53
|
+
/**
|
|
54
|
+
* OpenClaw's media roots for an agent, for the REPLY path (it has no media
|
|
55
|
+
* context). `undefined` when the SDK cannot be imported: then only the
|
|
56
|
+
* AgentVault roots apply, and OpenClaw-generated media in replies is refused
|
|
57
|
+
* (a known gap, logged once).
|
|
58
|
+
*/
|
|
59
|
+
export declare function replyMediaRoots(cfg: unknown, agentId: string | undefined, importer?: SdkImporter, log?: (m: string) => void): Promise<string[] | undefined>;
|
|
60
|
+
/**
|
|
61
|
+
* Is this agent's session sandboxed, by OpenClaw config alone? The 2026.10.8
|
|
62
|
+
* rule (`runtime-status-*.mjs:279`): `agents.list[<agentId>].sandbox.mode`,
|
|
63
|
+
* else `agents.defaults.sandbox.mode`, default "off". "all" sandboxes every
|
|
64
|
+
* session; "non-main" every session except the agent's main one
|
|
65
|
+
* (`agent:<agentId>:<session.mainKey ?? "main">`, or "global" when
|
|
66
|
+
* `session.scope` is "global"). Any other value counts as sandboxed (fail
|
|
67
|
+
* closed). The session row's own override is not visible here; the SDK path
|
|
68
|
+
* in `replySandboxed` reads it when available.
|
|
69
|
+
*/
|
|
70
|
+
export declare function sandboxedByConfig(cfg: unknown, agentId: string | undefined, sessionKey?: string): boolean;
|
|
71
|
+
/** A channel as far as media sends need it. */
|
|
72
|
+
export interface MediaChannel {
|
|
73
|
+
sendFile(target: FileSendTarget, path: string, caption: string, turn: TurnToken | null, opts?: FileSendHostOptions): Promise<{
|
|
74
|
+
ok: true;
|
|
75
|
+
filename: string;
|
|
76
|
+
size: number;
|
|
77
|
+
} | {
|
|
78
|
+
ok: false;
|
|
79
|
+
code: FileSendCode;
|
|
80
|
+
error: string;
|
|
81
|
+
filename?: string;
|
|
82
|
+
}>;
|
|
83
|
+
deliver(target: DeliveryTarget, content: {
|
|
84
|
+
type: "text";
|
|
85
|
+
text: string;
|
|
86
|
+
}, options?: Record<string, unknown>): Promise<{
|
|
87
|
+
ok?: boolean;
|
|
88
|
+
error?: unknown;
|
|
89
|
+
}>;
|
|
90
|
+
stagingPathFor?(target: FileSendTarget): string | null;
|
|
91
|
+
}
|
|
92
|
+
export type MediaPartResult = {
|
|
93
|
+
ok: true;
|
|
94
|
+
via: "file" | "link";
|
|
95
|
+
filename?: string;
|
|
96
|
+
size?: number;
|
|
97
|
+
} | {
|
|
98
|
+
ok: false;
|
|
99
|
+
code: FileSendCode;
|
|
100
|
+
error: string;
|
|
101
|
+
filename?: string;
|
|
102
|
+
};
|
|
103
|
+
/**
|
|
104
|
+
* Send one media reference to `target` under `turn`. A local path goes only
|
|
105
|
+
* through `sendFile` (policy, token, no queue); a link is `Link: <url>` text;
|
|
106
|
+
* a refused scheme goes to `sendFile` too, whose policy refuses a URL as a
|
|
107
|
+
* path — so the failure is counted against the turn and its notice posted
|
|
108
|
+
* like any other. Never throws.
|
|
109
|
+
*/
|
|
110
|
+
export declare function sendMediaPart(channel: MediaChannel, target: DeliveryTarget, raw: string, caption: string, turn: TurnToken | null, host: FileSendHostOptions, deliverOptions?: Record<string, unknown>): Promise<MediaPartResult>;
|
|
111
|
+
/** What the model reads back from a media part (no path, ever: R3-9). */
|
|
112
|
+
export declare function mediaPartToolText(channel: MediaChannel, target: DeliveryTarget, res: MediaPartResult): string;
|
|
113
|
+
/**
|
|
114
|
+
* The file lines for THIS turn, in the turn context the model receives: the
|
|
115
|
+
* rule, then where this conversation's files are staged (workspace-relative,
|
|
116
|
+
* never a host path). A room line says files cannot go when the turn is not an
|
|
117
|
+
* attested owner turn (or the session is sandboxed). An A2A turn, or file send
|
|
118
|
+
* being off, gets the "cannot send files" line.
|
|
119
|
+
*/
|
|
120
|
+
export declare function openclawFileLines(channel: {
|
|
121
|
+
stagingPathFor?(t: FileSendTarget): string | null;
|
|
122
|
+
} | undefined, target: FileSendTarget | null, opts: {
|
|
123
|
+
roomsAllowed: boolean;
|
|
124
|
+
}): string;
|
|
125
|
+
/**
|
|
126
|
+
* The one claimant's record of a turn: the lease taken from `onMessage`
|
|
127
|
+
* metadata (synchronously, before any await), the opaque token, every reply
|
|
128
|
+
* text the turn delivered (for the §4.4 prose check at its end), and the
|
|
129
|
+
* OpenClaw runs it started (the turn ends only after they settle: an orphaned
|
|
130
|
+
* run past the turn budget is still this turn's run).
|
|
131
|
+
*/
|
|
132
|
+
export interface OpenClawFileTurn {
|
|
133
|
+
readonly lease: TurnLease | null;
|
|
134
|
+
readonly token: TurnToken | null;
|
|
135
|
+
readonly replies: string[];
|
|
136
|
+
readonly runs: Set<Promise<unknown>>;
|
|
137
|
+
/** Ended, or folded into another turn (its end then belongs to that turn). */
|
|
138
|
+
ended: boolean;
|
|
139
|
+
/** Its content went into a run with no AgentVault turn; ended when that run is known to be over. */
|
|
140
|
+
absorbedPending: boolean;
|
|
141
|
+
}
|
|
142
|
+
/** Take the lease NOW (call this synchronously at the top of onMessage, before any await). */
|
|
143
|
+
export declare function takeFileTurn(metadata: unknown): OpenClawFileTurn;
|
|
144
|
+
type TurnEnder = {
|
|
145
|
+
endTurn?: (l: TurnLease, o?: {
|
|
146
|
+
replies?: readonly string[];
|
|
147
|
+
}) => Promise<void>;
|
|
148
|
+
} | undefined;
|
|
149
|
+
type TurnFolder = {
|
|
150
|
+
foldTurn?: (f: TurnLease, i: TurnLease) => boolean;
|
|
151
|
+
} | undefined;
|
|
152
|
+
/**
|
|
153
|
+
* End the turn exactly once — a turn that ran, or a message dropped (content
|
|
154
|
+
* that never entered any turn's input). Waits for the runs the turn started
|
|
155
|
+
* (bounded by the token TTL). Never throws. With no lease (file send off, a
|
|
156
|
+
* legacy pairwise room frame, an A2A message) there is nothing to end. A turn
|
|
157
|
+
* that was folded, or whose content waits in a run with no AgentVault turn,
|
|
158
|
+
* is not ended here.
|
|
159
|
+
*/
|
|
160
|
+
export declare function endFileTurn(channel: TurnEnder, ft: OpenClawFileTurn | undefined, waitMs?: number): Promise<void>;
|
|
161
|
+
/**
|
|
162
|
+
* The message's content went into ANOTHER running turn's input (OpenClaw
|
|
163
|
+
* steer / followup / collect): NOT a drop, so it is folded — it ends when that
|
|
164
|
+
* turn ends, and a non-eligible message downgrades it. `endTurn` here would let
|
|
165
|
+
* a later owner message attest while this content is still in the running turn
|
|
166
|
+
* (§11 R3-4 (b)). Returns whether it folded.
|
|
167
|
+
*/
|
|
168
|
+
export declare function foldFileTurn(channel: TurnFolder, folded: OpenClawFileTurn | undefined, into: OpenClawFileTurn | undefined): boolean;
|
|
169
|
+
/**
|
|
170
|
+
* Which AgentVault turns have an OpenClaw run in flight, per session key —
|
|
171
|
+
* so a dispatch OpenClaw defers into an active run (`deferredToActiveRun`:
|
|
172
|
+
* steer, or followup/collect) can be folded into the turn that owns it.
|
|
173
|
+
*
|
|
174
|
+
* OpenClaw keys "active" on the session, not on the caller (2026.10.8
|
|
175
|
+
* `get-reply-*.mjs` ~2758-2780): an orphaned run (past our turn budget), a run
|
|
176
|
+
* from another surface on a shared main session, or a heartbeat run all
|
|
177
|
+
* count. When the active run belongs to no AgentVault turn, the message's
|
|
178
|
+
* token waits (`absorbedPending`) and ends at the session's next dispatch that
|
|
179
|
+
* ran its own run — the first evidence that the absorbing run is over. Its
|
|
180
|
+
* TTL backs that up.
|
|
181
|
+
*/
|
|
182
|
+
export declare class OpenClawTurnRuns {
|
|
183
|
+
private readonly active;
|
|
184
|
+
private readonly pending;
|
|
185
|
+
/** Dispatch start order, and the order each tracked dispatch started at. */
|
|
186
|
+
private seq;
|
|
187
|
+
private readonly started;
|
|
188
|
+
/** The last dispatch start before each waiting token was deferred. */
|
|
189
|
+
private readonly waitedAt;
|
|
190
|
+
/** Run one OpenClaw dispatch for `ft` on `sessionKey`, tracked until it settles (also after a turn-budget timeout). */
|
|
191
|
+
track<T>(sessionKey: string, ft: OpenClawFileTurn | undefined, run: Promise<T>): Promise<T>;
|
|
192
|
+
/**
|
|
193
|
+
* After a dispatch returned (dr-evil #1784, MEDIUM 3).
|
|
194
|
+
* - "steer": the text was injected into the run that is active NOW → fold
|
|
195
|
+
* into the AgentVault turn that owns that run.
|
|
196
|
+
* - "followup" (2026.10.8 reports collect the same way: both go through
|
|
197
|
+
* `enqueueFollowupRun`, `agent-runner-run-*.mjs:7930-7950`): the content
|
|
198
|
+
* runs in a LATER run (`scheduleFollowupDrainAfterReplyOperationClear`),
|
|
199
|
+
* which belongs to no AgentVault turn → never folded into the active
|
|
200
|
+
* turn (that would end it before its content ran); it waits.
|
|
201
|
+
* - A steer with no AgentVault owner (another surface, a heartbeat) waits
|
|
202
|
+
* too. A waiting token ends at the session's next dispatch that ran its
|
|
203
|
+
* own run (evidence the absorbing runs are over), or as a drop at the
|
|
204
|
+
* bound (MEDIUM/LOW 4). Room file authority does not depend on it: the
|
|
205
|
+
* content already tainted the room's session (openclaw-room-taint.ts).
|
|
206
|
+
* - Not deferred: this dispatch ran its own run → every waiting token ends.
|
|
207
|
+
*/
|
|
208
|
+
afterDispatch(channel: TurnEnder & TurnFolder, sessionKey: string, ft: OpenClawFileTurn | undefined, result: unknown,
|
|
209
|
+
/** The promise `track` returned for this dispatch (when it STARTED decides what it proves). */
|
|
210
|
+
run?: Promise<unknown>): Promise<void>;
|
|
211
|
+
/** Bounds on waiting tokens (test seam: `OpenClawTurnRuns.bounds`). */
|
|
212
|
+
static bounds: {
|
|
213
|
+
maxMs: number;
|
|
214
|
+
perSession: number;
|
|
215
|
+
total: number;
|
|
216
|
+
};
|
|
217
|
+
private readonly timers;
|
|
218
|
+
private wait;
|
|
219
|
+
private release;
|
|
220
|
+
/** Test seam. */
|
|
221
|
+
_sizes(): {
|
|
222
|
+
active: number;
|
|
223
|
+
pending: number;
|
|
224
|
+
};
|
|
225
|
+
}
|
|
226
|
+
/** The OpenClaw agent bound to an AgentVault account (`bindings[]`), else "main". */
|
|
227
|
+
export declare function openclawAgentIdFor(cfg: unknown, accountId: string | undefined): string;
|
|
228
|
+
/**
|
|
229
|
+
* The agent's OpenClaw workspace for file sending, resolved by OpenClaw's own
|
|
230
|
+
* `resolveAgentWorkspaceDir` when the SDK exposes it, else from config
|
|
231
|
+
* (`agents.list[].workspace`, then `agents.defaults.workspace`). NEVER the
|
|
232
|
+
* AgentVault data dir (the old fallback): `undefined` when unknown — the
|
|
233
|
+
* outbox then sits beside the data dir (design §2, §3.2).
|
|
234
|
+
*/
|
|
235
|
+
export declare function resolveOpenClawWorkspace(cfg: unknown, agentId: string, home: string, importer?: SdkImporter): Promise<string | undefined>;
|
|
236
|
+
/**
|
|
237
|
+
* Is this session sandboxed (reply path: no media context)? OpenClaw's own
|
|
238
|
+
* `resolveSandboxRuntimeStatus` when the SDK exposes it (it also reads the
|
|
239
|
+
* session row's override); else the config rule (2026.10.8
|
|
240
|
+
* `runtime-status-*.mjs:279`): `agents.list[].sandbox.mode` ?? `agents.defaults
|
|
241
|
+
* .sandbox.mode` — "off" → no; "all" → yes; "non-main" → yes unless the
|
|
242
|
+
* session is the agent's main one. Any other value, or an error → yes
|
|
243
|
+
* (fail closed).
|
|
244
|
+
*/
|
|
245
|
+
export declare function replySandboxed(cfg: unknown, agentId: string | undefined, sessionKey: string | undefined, importer?: SdkImporter): Promise<boolean>;
|
|
246
|
+
/**
|
|
247
|
+
* Thrown by `outbound.sendMedia` / `sendPayload` when a file did not go.
|
|
248
|
+
*
|
|
249
|
+
* Why a throw and not `{ ok: false }` (PR-O, evidence in design §2.1):
|
|
250
|
+
* OpenClaw's delivery core never reads `ok`; a result with no `messageId` is
|
|
251
|
+
* "adapter_returned_no_identity", the queue entry is parked as
|
|
252
|
+
* unknown-after-send, and the `message` tool shows the model only
|
|
253
|
+
* `deliveryStatus: "suppressed"` — the error text is lost. A throw from the
|
|
254
|
+
* adapter is recorded after `onPlatformSendStart`, so recovery refuses to
|
|
255
|
+
* replay it blindly (no retry, no duplicated text part), and the tool shows
|
|
256
|
+
* the model this message: "File NOT sent: <reason>. Tell the person…".
|
|
257
|
+
* `retryable = false` matches the core's permanent-rejection shape.
|
|
258
|
+
*/
|
|
259
|
+
export declare class OpenClawFileSendError extends Error {
|
|
260
|
+
readonly code: FileSendCode;
|
|
261
|
+
readonly retryable = false;
|
|
262
|
+
constructor(code: FileSendCode, message: string);
|
|
263
|
+
}
|
|
264
|
+
/** A delivered part, in the shape OpenClaw's receipt check reads (`messageId`). */
|
|
265
|
+
export declare function deliveredResult(messageId: string | undefined): {
|
|
266
|
+
ok: true;
|
|
267
|
+
channel: "agentvault";
|
|
268
|
+
messageId: string;
|
|
269
|
+
};
|
|
270
|
+
/** Test seam: replace (fn), disable (false) or re-resolve (null) the session-entry reader. */
|
|
271
|
+
export declare function _setSessionEntryReaderForTest(fn: ((p: unknown) => unknown) | false | null): void;
|
|
272
|
+
/**
|
|
273
|
+
* Does OpenClaw have a session for `sessionKey`, and what is its id? From
|
|
274
|
+
* OpenClaw's own store: `readSessionUpdatedAt` (the plugin runtime) for
|
|
275
|
+
* existence, `getSessionEntry` (`plugin-sdk/session-store-runtime`) for the
|
|
276
|
+
* id when the SDK loads. A read that throws counts as "a session exists, id
|
|
277
|
+
* unknown" — so the taint record decides, and no record means tainted.
|
|
278
|
+
*/
|
|
279
|
+
export declare function openclawSessionState(core: {
|
|
280
|
+
channel?: {
|
|
281
|
+
session?: {
|
|
282
|
+
readSessionUpdatedAt?: (p: any) => unknown;
|
|
283
|
+
readSessionUpdatedAtAsync?: (p: any) => unknown;
|
|
284
|
+
};
|
|
285
|
+
};
|
|
286
|
+
} | null | undefined, params: {
|
|
287
|
+
storePath?: string;
|
|
288
|
+
sessionKey: string;
|
|
289
|
+
agentId?: string;
|
|
290
|
+
}, importer?: SdkImporter): Promise<OpenClawSessionState>;
|
|
291
|
+
/**
|
|
292
|
+
* The session's last-update time for the envelope's "previous" timestamp:
|
|
293
|
+
* `readSessionUpdatedAtAsync` when the runtime has it, else the deprecated
|
|
294
|
+
* sync reader, else `undefined`. Never throws (#1784 round 2).
|
|
295
|
+
*/
|
|
296
|
+
export declare function readSessionUpdatedAtSafe(core: {
|
|
297
|
+
channel?: {
|
|
298
|
+
session?: {
|
|
299
|
+
readSessionUpdatedAt?: (p: any) => unknown;
|
|
300
|
+
readSessionUpdatedAtAsync?: (p: any) => unknown;
|
|
301
|
+
};
|
|
302
|
+
};
|
|
303
|
+
} | null | undefined, params: {
|
|
304
|
+
storePath?: string;
|
|
305
|
+
sessionKey: string;
|
|
306
|
+
}): Promise<number | undefined>;
|
|
307
|
+
export {};
|
|
308
|
+
//# sourceMappingURL=openclaw-file-send.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"openclaw-file-send.d.ts","sourceRoot":"","sources":["../src/openclaw-file-send.ts"],"names":[],"mappings":"AAwBA,OAAO,KAAK,EAAE,mBAAmB,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AACjF,OAAO,EAML,KAAK,YAAY,EAClB,MAAM,wBAAwB,CAAC;AAChC,OAAO,EAAgB,KAAK,YAAY,EAAE,KAAK,WAAW,EAAE,MAAM,sBAAsB,CAAC;AACzF,OAAO,EAAqB,KAAK,SAAS,EAAE,KAAK,SAAS,EAAE,MAAM,iBAAiB,CAAC;AACpF,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AACjD,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,0BAA0B,CAAC;AAWrE,m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 export declare const agentVaultPlugin: {
|
|
|
80
80
|
ok: boolean;
|
|
81
81
|
error?: string;
|
|
82
82
|
}>;
|
|
83
|
-
sendMedia: (
|
|
83
|
+
sendMedia: (ctx: {
|
|
84
84
|
to: string;
|
|
85
85
|
text?: string;
|
|
86
86
|
mediaUrl: string;
|
|
87
87
|
accountId?: string;
|
|
88
|
-
}) => Promise<{
|
|
88
|
+
} & Record<string, unknown>) => Promise<{
|
|
89
89
|
ok: boolean;
|
|
90
90
|
error?: string;
|
|
91
|
+
messageId?: string;
|
|
91
92
|
}>;
|
|
92
93
|
/** Rich payload delivery — OpenClaw v2026.3.2+ */
|
|
93
94
|
sendPayload: (ctx: ChannelOutboundPayloadContext) => Promise<{
|
|
95
|
+
ok: true;
|
|
96
|
+
channel: "agentvault";
|
|
97
|
+
messageId: string;
|
|
98
|
+
} | {
|
|
94
99
|
ok: boolean;
|
|
95
100
|
error: string;
|
|
96
101
|
} | {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"openclaw-plugin.d.ts","sourceRoot":"","sources":["../src/openclaw-plugin.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAGH,OAAO,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAC7C,OAAO,EAAE,cAAc,EAAE,cAAc,EAAE,KAAK,eAAe,EAAE,MAAM,qBAAqB,CAAC;
|
|
1
|
+
{"version":3,"file":"openclaw-plugin.d.ts","sourceRoot":"","sources":["../src/openclaw-plugin.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAGH,OAAO,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAC7C,OAAO,EAAE,cAAc,EAAE,cAAc,EAAE,KAAK,eAAe,EAAE,MAAM,qBAAqB,CAAC;AA8B3F,OAAO,KAAK,EACV,aAAa,EACb,qBAAqB,EACrB,6BAA6B,EAC9B,MAAM,qBAAqB,CAAC;AAW7B,wBAAgB,YAAY,CAAC,OAAO,EAAE,aAAa,GAAG,IAAI,CAEzD;AAED,wBAAgB,gBAAgB,CAAC,SAAS,SAAY,GAAG,aAAa,GAAG,SAAS,CAEjF;AAMD,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;;;;QAkBzB,0DAA0D;qBACvC,GAAG;;;;;;;;;;;;;QAatB,8DAA8D;sBAChD,GAAG;;;;;;;;;;;;;4BAaS,qBAAqB,CAAC,eAAe,CAAC;;;;;;;;;;;mDAiJ7D;YACD,IAAI,EAAE,MAAM,CAAC;YACb,SAAS,CAAC,EAAE,MAAM,CAAC;YACnB,QAAQ,CAAC,EAAE,MAAM,CAAC;SACnB,KAAG,OAAO,CAAC;YAAE,EAAE,EAAE,OAAO,CAAC;YAAC,KAAK,CAAC,EAAE,MAAM,CAAA;SAAE,CAAC;yBAcrB;YACrB,EAAE,EAAE,MAAM,CAAC;YACX,IAAI,CAAC,EAAE,MAAM,CAAC;YACd,QAAQ,EAAE,MAAM,CAAC;YACjB,SAAS,CAAC,EAAE,MAAM,CAAC;SACpB,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAAG,OAAO,CAAC;YAAE,EAAE,EAAE,OAAO,CAAC;YAAC,KAAK,CAAC,EAAE,MAAM,CAAC;YAAC,SAAS,CAAC,EAAE,MAAM,CAAA;SAAE,CAAC;QAmB1F,kDAAkD;2BACzB,6BAA6B;;;;;;;;;;;;CA+CzD,CAAC"}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
export declare const ROOM_TAINT_FILE = "openclaw-room-taint.json";
|
|
2
|
+
/** What OpenClaw says about a room's session right now. */
|
|
3
|
+
export interface OpenClawSessionState {
|
|
4
|
+
/**
|
|
5
|
+
* A session exists for the key. `false` ONLY when OpenClaw's reader
|
|
6
|
+
* answered "none"; an absent or failing reader reports `true`.
|
|
7
|
+
*/
|
|
8
|
+
exists: boolean;
|
|
9
|
+
/** Its id, when OpenClaw exposes the entry (`getSessionEntry`); otherwise undefined. */
|
|
10
|
+
sessionId?: string;
|
|
11
|
+
/** The entry names a predecessor (previousSessionId, parentSessionId/Key, forkSource). Unknown → treated as true. */
|
|
12
|
+
lineage?: boolean;
|
|
13
|
+
/** When OpenClaw created this session (`createdAt`, epoch ms), if it says. */
|
|
14
|
+
createdAt?: number;
|
|
15
|
+
}
|
|
16
|
+
export declare class RoomTaintStore {
|
|
17
|
+
private readonly log;
|
|
18
|
+
private readonly path;
|
|
19
|
+
private cache;
|
|
20
|
+
/** Rooms whose taint could not be written: tainted for this process whatever the file says. */
|
|
21
|
+
private readonly poisoned;
|
|
22
|
+
constructor(dataDir: string, log?: (m: string) => void);
|
|
23
|
+
private load;
|
|
24
|
+
/**
|
|
25
|
+
* Is the room's session tainted, given what OpenClaw reports? Also resets a
|
|
26
|
+
* record whose session is genuinely new (no session, or a different id).
|
|
27
|
+
*/
|
|
28
|
+
isTainted(key: string, oc: OpenClawSessionState): boolean;
|
|
29
|
+
/**
|
|
30
|
+
* Record the room's state for the session about to receive this turn.
|
|
31
|
+
* `tainted` is sticky within a session: a clean turn never clears a taint
|
|
32
|
+
* (only a genuinely new session does, through `isTainted`'s answer).
|
|
33
|
+
*/
|
|
34
|
+
record(key: string, oc: OpenClawSessionState, turnTaints: boolean): void;
|
|
35
|
+
/**
|
|
36
|
+
* The session the record describes now exists (OpenClaw created it while
|
|
37
|
+
* recording this turn): remember its id, so a later reset — a NEW id — is
|
|
38
|
+
* recognised. Only fills a missing id; never changes `tainted`.
|
|
39
|
+
*/
|
|
40
|
+
bindSession(key: string, oc: OpenClawSessionState): void;
|
|
41
|
+
private write;
|
|
42
|
+
}
|
|
43
|
+
//# sourceMappingURL=openclaw-room-taint.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"openclaw-room-taint.d.ts","sourceRoot":"","sources":["../src/openclaw-room-taint.ts"],"names":[],"mappings":"AA4CA,eAAO,MAAM,eAAe,6BAA6B,CAAC;AAE1D,2DAA2D;AAC3D,MAAM,WAAW,oBAAoB;IACnC;;;OAGG;IACH,MAAM,EAAE,OAAO,CAAC;IAChB,wFAAwF;IACxF,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,qHAAqH;IACrH,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,8EAA8E;IAC9E,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AASD,qBAAa,cAAc;IAMI,OAAO,CAAC,QAAQ,CAAC,GAAG;IALjD,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAS;IAC9B,OAAO,CAAC,KAAK,CAA2C;IACxD,+FAA+F;IAC/F,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAqB;gBAElC,OAAO,EAAE,MAAM,EAAmB,GAAG,GAAE,CAAC,CAAC,EAAE,MAAM,KAAK,IAA6B;IAI/F,OAAO,CAAC,IAAI;IAoBZ;;;OAGG;IACH,SAAS,CAAC,GAAG,EAAE,MAAM,EAAE,EAAE,EAAE,oBAAoB,GAAG,OAAO;IAmBzD;;;;OAIG;IACH,MAAM,CAAC,GAAG,EAAE,MAAM,EAAE,EAAE,EAAE,oBAAoB,EAAE,UAAU,EAAE,OAAO,GAAG,IAAI;IAuBxE;;;;OAIG;IACH,WAAW,CAAC,GAAG,EAAE,MAAM,EAAE,EAAE,EAAE,oBAAoB,GAAG,IAAI;IAQxD,OAAO,CAAC,KAAK;CAWd"}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* #1800 PR B (sinks 5 and 6) — who a turn is, to OpenClaw (design §3.3).
|
|
3
|
+
*
|
|
4
|
+
* OpenClaw keys sessions on the route peer, decides commands by
|
|
5
|
+
* `CommandAuthorized` (with `ownerAllowFrom` and `commands.allowFrom` unset,
|
|
6
|
+
* as on the fleet), and matches plugin-binding approvals EXACTLY on
|
|
7
|
+
* `SenderId`. So:
|
|
8
|
+
*
|
|
9
|
+
* | 1:1 verdict | SenderId / From / peer | SenderName |
|
|
10
|
+
* |--------------------------|------------------------------------|---------------------|
|
|
11
|
+
* | owner | `agentvault:owner` | "Owner" |
|
|
12
|
+
* | bound, not owner (#1820) | `agentvault:device:<id>` | "Not the owner" |
|
|
13
|
+
* | bound, owner list unread | `agentvault:device:<id>` | "Owner status unconfirmed" |
|
|
14
|
+
* | unbound (incl. DR) | `agentvault:unverified:<conv8>` | "Unverified sender" |
|
|
15
|
+
*
|
|
16
|
+
* Every non-owner turn is a DIFFERENT OpenClaw session from the owner's
|
|
17
|
+
* (obligation 2): a Double Ratchet or unverified message can no longer be
|
|
18
|
+
* steered into an active owner run, where it would execute under the owner's
|
|
19
|
+
* turn token. And every non-owner turn sets `CommandInterpretationSuppressed`
|
|
20
|
+
* — `commands.allowFrom` would otherwise bypass `CommandAuthorized`
|
|
21
|
+
* (`command-auth-*.mjs:373`, OpenClaw 2026.10.8).
|
|
22
|
+
*
|
|
23
|
+
* A room keeps the room as the primary scope; an unbound room frame's
|
|
24
|
+
* fragment is `#unverified:<claimed8>` (never `#device:`), so it can never
|
|
25
|
+
* match a member's exact-match binding approval.
|
|
26
|
+
*/
|
|
27
|
+
export interface DmSenderIdentity {
|
|
28
|
+
/** `From`, `SenderId` and the route peer id. */
|
|
29
|
+
id: string;
|
|
30
|
+
/** `SenderName` and the envelope's `from`. */
|
|
31
|
+
name: string;
|
|
32
|
+
/** Only the owner row runs commands and shares the owner session. */
|
|
33
|
+
owner: boolean;
|
|
34
|
+
}
|
|
35
|
+
/** The 1:1 row of the table above, from the channel's metadata. Missing fields fail closed (unbound). */
|
|
36
|
+
export declare function dmSenderIdentity(metadata: {
|
|
37
|
+
ownerDm1to1?: unknown;
|
|
38
|
+
senderIsOwnerDevice?: unknown;
|
|
39
|
+
senderOwnerStatus?: unknown;
|
|
40
|
+
senderBinding?: unknown;
|
|
41
|
+
senderDeviceId?: unknown;
|
|
42
|
+
conversationId?: unknown;
|
|
43
|
+
conversationGroupId?: unknown;
|
|
44
|
+
} | null | undefined): DmSenderIdentity;
|
|
45
|
+
/** The `#unverified:<claimed8>` fragment for an unbound room frame (claimed id sanitized before the cut). */
|
|
46
|
+
export declare function unverifiedRoomFragment(claimed: unknown): string;
|
|
47
|
+
//# sourceMappingURL=openclaw-sender.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"openclaw-sender.d.ts","sourceRoot":"","sources":["../src/openclaw-sender.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AASH,MAAM,WAAW,gBAAgB;IAC/B,gDAAgD;IAChD,EAAE,EAAE,MAAM,CAAC;IACX,8CAA8C;IAC9C,IAAI,EAAE,MAAM,CAAC;IACb,qEAAqE;IACrE,KAAK,EAAE,OAAO,CAAC;CAChB;AAED,yGAAyG;AACzG,wBAAgB,gBAAgB,CAAC,QAAQ,EAAE;IACzC,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,mBAAmB,CAAC,EAAE,OAAO,CAAC;IAC9B,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAC5B,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,mBAAmB,CAAC,EAAE,OAAO,CAAC;CAC/B,GAAG,IAAI,GAAG,SAAS,GAAG,gBAAgB,CAkBtC;AAED,6GAA6G;AAC7G,wBAAgB,sBAAsB,CAAC,OAAO,EAAE,OAAO,GAAG,MAAM,CAE/D"}
|
package/dist/openclaw-types.d.ts
CHANGED
|
@@ -114,7 +114,13 @@ export interface HttpRouteRegistration {
|
|
|
114
114
|
* the handler is on its own.
|
|
115
115
|
*/
|
|
116
116
|
auth: "gateway" | "plugin";
|
|
117
|
-
|
|
117
|
+
/**
|
|
118
|
+
* #1791: OpenClaw 2026.10 calls this as `handler(req, res)` with Node
|
|
119
|
+
* `IncomingMessage`/`ServerResponse` (read 2026.10.8 `plugins-http-*.mjs`:
|
|
120
|
+
* `route.handler(req, res)`; any return but `false` means handled). The
|
|
121
|
+
* simplified `HttpRouteRequest` shape is kept for older gateways.
|
|
122
|
+
*/
|
|
123
|
+
handler: (req: any, res?: any) => Promise<unknown> | unknown;
|
|
118
124
|
}
|
|
119
125
|
/** Simplified request object from OpenClaw managed HTTP routes. */
|
|
120
126
|
export interface HttpRouteRequest {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"openclaw-types.d.ts","sourceRoot":"","sources":["../src/openclaw-types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AASH,gDAAgD;AAChD,MAAM,WAAW,iBAAiB;IAChC,OAAO,EAAE,aAAa,CAAC;IACvB,eAAe,CAAC,IAAI,EAAE;QAAE,MAAM,EAAE,OAAO,CAAA;KAAE,GAAG,IAAI,CAAC;IACjD,YAAY,CAAC,CAAC,IAAI,EAAE,OAAO,EAAE,KAAK,CAAC,EAAE;QAAE,QAAQ,CAAC,EAAE,OAAO,CAAA;KAAE,GAAG,IAAI,CAAC;IACnE,eAAe,CAAC,CAAC,IAAI,EAAE,OAAO,GAAG,IAAI,CAAC;IACtC,iBAAiB,CAAC,CAAC,IAAI,EAAE,qBAAqB,GAAG,IAAI,CAAC;IACtD,EAAE,CAAC,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC;CAC7E;AAED,8EAA8E;AAC9E,MAAM,WAAW,aAAa;IAC5B,OAAO,EAAE;QACP,OAAO,EAAE;YAAE,iBAAiB,CAAC,IAAI,EAAE,OAAO,GAAG;gBAAE,OAAO,EAAE,MAAM,CAAC;gBAAC,UAAU,EAAE,MAAM,CAAA;aAAE,CAAA;SAAE,CAAC;QACvF,OAAO,EAAE;YACP,gBAAgB,CAAC,KAAK,EAAE,OAAO,EAAE,IAAI,EAAE;gBAAE,OAAO,EAAE,MAAM,CAAA;aAAE,GAAG,MAAM,CAAC;YACpE,oBAAoB,CAAC,IAAI,EAAE;gBAAE,SA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ClC,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,EAAE,MAAM,CAAC;IACnB,OAAO,EAAE;QACP,IAAI,EAAE,MAAM,CAAC;QACb,MAAM,CAAC,EAAE,MAAM,CAAC;QAChB,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;KACpC,CAAC;CACH;AAED,6BAA6B;AAC7B,MAAM,MAAM,oBAAoB,GAAG;IACjC,YAAY,CAAC,EAAE,CAAC,KAAK,EAAE,gBAAgB,KAAK,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IACjE,aAAa,CAAC,EAAE,CAAC,KAAK,EAAE,iBAAiB,KAAK,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IACnE,WAAW,CAAC,EAAE,CAAC,KAAK,EAAE,eAAe,KAAK,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAC/D,gBAAgB,CAAC,EAAE,CAAC,KAAK,EAAE,mBAAmB,KAAK,oBAAoB,GAAG,OAAO,CAAC,oBAAoB,CAAC,CAAC;IACxG,eAAe,CAAC,EAAE,CAAC,KAAK,EAAE,mBAAmB,KAAK,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CACxE,CAAC"}
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* #1820 part 2 — "is this 1:1 sender one of the account's CURRENT owner
|
|
3
|
+
* devices?", fail-closed. The TypeScript twin of Hermes'
|
|
4
|
+
* `SecureChannel._sender_is_owner` (#1494, #1803), reading the same
|
|
5
|
+
* endpoint, `GET /api/v1/devices/{id}/owner-devices` (the ACTIVE devices of
|
|
6
|
+
* the account's OWNER_ADMIN).
|
|
7
|
+
*
|
|
8
|
+
* Before this, every message that decrypted under a 1:1 group was handed to
|
|
9
|
+
* the families as `ownerDm1to1: true`. A message a stolen phone sent before
|
|
10
|
+
* its revoke, already pulled (or buffered) when the revoke landed, kept full
|
|
11
|
+
* owner power. Each 1:1 emit site now asks this list at the moment it hands
|
|
12
|
+
* the message over — release time, not pull time.
|
|
13
|
+
*
|
|
14
|
+
* Three answers (#1826 review M3):
|
|
15
|
+
* - `"owner"`: on a list read for the current generation, younger than
|
|
16
|
+
* OWNER_LIST_MAX_AGE_MS.
|
|
17
|
+
* - `"not_owner"`: CONFIRMED — a fresh, successful read of the current
|
|
18
|
+
* generation does not name it (or there is no sender id at all).
|
|
19
|
+
* - `"unknown"`: could not confirm — the read failed, timed out, was
|
|
20
|
+
* malformed or was overtaken by an owner-devices change, or a retry after
|
|
21
|
+
* such a failure is still backing off.
|
|
22
|
+
* Only `"owner"` grants owner power. Families may treat `"unknown"` more
|
|
23
|
+
* gently than `"not_owner"` (no lasting taint, no abort of a running turn),
|
|
24
|
+
* never as the owner.
|
|
25
|
+
*
|
|
26
|
+
* Re-reads:
|
|
27
|
+
* - after a successful read that did not name the sender, at most once per
|
|
28
|
+
* OWNER_LIST_RETRY_MS (a new phone is recognised soon; a flood of
|
|
29
|
+
* non-owner messages cannot hammer the endpoint);
|
|
30
|
+
* - after a FAILED read, with a short backoff (OWNER_LIST_FAIL_BACKOFF_MS,
|
|
31
|
+
* doubling to OWNER_LIST_FAIL_BACKOFF_MAX_MS), so one deploy blip does not
|
|
32
|
+
* refuse the real owner for a minute;
|
|
33
|
+
* - `invalidate()` (on `owner_devices_changed` and every (re)connect) drops
|
|
34
|
+
* the list at once, clears both waits, and bumps `generation`.
|
|
35
|
+
*/
|
|
36
|
+
export declare const OWNER_LIST_MAX_AGE_MS = 600000;
|
|
37
|
+
export declare const OWNER_LIST_RETRY_MS = 60000;
|
|
38
|
+
export declare const OWNER_LIST_TIMEOUT_MS = 5000;
|
|
39
|
+
export declare const OWNER_LIST_FAIL_BACKOFF_MS = 1000;
|
|
40
|
+
export declare const OWNER_LIST_FAIL_BACKOFF_MAX_MS = 15000;
|
|
41
|
+
export type OwnerDeviceStatus = "owner" | "not_owner" | "unknown";
|
|
42
|
+
export interface OwnerDeviceListDeps {
|
|
43
|
+
/** GET the owner-devices body; must honour `signal`. */
|
|
44
|
+
fetchOwnerDevices: (signal: AbortSignal) => Promise<unknown>;
|
|
45
|
+
now?: () => number;
|
|
46
|
+
}
|
|
47
|
+
export declare class OwnerDeviceList {
|
|
48
|
+
private readonly _deps;
|
|
49
|
+
private _ids;
|
|
50
|
+
private _fetchedAt;
|
|
51
|
+
/** No new read before this time (a miss after a good read, or a failure's backoff). */
|
|
52
|
+
private _nextReadAt;
|
|
53
|
+
/** The backoff the NEXT failure waits; reset by a good read. */
|
|
54
|
+
private _failBackoffMs;
|
|
55
|
+
/** Set while the last read failed and its backoff runs: answers are "unknown", not "not_owner". */
|
|
56
|
+
private _lastReadFailed;
|
|
57
|
+
private _generation;
|
|
58
|
+
private _inFlight;
|
|
59
|
+
private readonly _now;
|
|
60
|
+
constructor(_deps: OwnerDeviceListDeps);
|
|
61
|
+
/** Bumped by every invalidation. Families compare it to the value a queued turn carries. */
|
|
62
|
+
get generation(): number;
|
|
63
|
+
/** Forget the list (#1803/#1820). The next check re-reads it. */
|
|
64
|
+
invalidate(): void;
|
|
65
|
+
/** Is `deviceId` a current owner device? Never throws; fails closed. */
|
|
66
|
+
isOwner(deviceId: string | null | undefined): Promise<boolean>;
|
|
67
|
+
/** The three-way answer (see the module comment). Never throws. */
|
|
68
|
+
status(deviceId: string | null | undefined): Promise<OwnerDeviceStatus>;
|
|
69
|
+
private _read;
|
|
70
|
+
}
|
|
71
|
+
//# sourceMappingURL=owner-devices.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"owner-devices.d.ts","sourceRoot":"","sources":["../src/owner-devices.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkCG;AAEH,eAAO,MAAM,qBAAqB,SAAU,CAAC;AAC7C,eAAO,MAAM,mBAAmB,QAAS,CAAC;AAC1C,eAAO,MAAM,qBA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+
export interface OwnerEpochRotation {
|
|
7
|
+
epoch: number;
|
|
8
|
+
/** False when this on period already rotated (a retry): same epoch. */
|
|
9
|
+
rotated: boolean;
|
|
10
|
+
}
|
|
11
|
+
export declare class OwnerEpochStore {
|
|
12
|
+
readonly path: string;
|
|
13
|
+
private readonly _log;
|
|
14
|
+
constructor(opts: {
|
|
15
|
+
dataDir: string;
|
|
16
|
+
family: string;
|
|
17
|
+
log?: (line: string) => void;
|
|
18
|
+
});
|
|
19
|
+
/** The current epoch (0 before the first rotation). */
|
|
20
|
+
current(): number;
|
|
21
|
+
/**
|
|
22
|
+
* Bump the epoch once for the on period `ctx` ends, persist it, return it.
|
|
23
|
+
* A second call for the same period returns the same epoch, `rotated: false`.
|
|
24
|
+
* Throws when the key is missing or the new epoch cannot be persisted.
|
|
25
|
+
*/
|
|
26
|
+
rotateFor(ctx: {
|
|
27
|
+
onPeriodKey: string;
|
|
28
|
+
}): OwnerEpochRotation;
|
|
29
|
+
private _read;
|
|
30
|
+
/**
|
|
31
|
+
* Never back to an epoch already used: restart above every small counter,
|
|
32
|
+
* and persist it at once so `current()` stays stable between calls.
|
|
33
|
+
*/
|
|
34
|
+
private _fresh;
|
|
35
|
+
}
|
|
36
|
+
//# sourceMappingURL=owner-epoch.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"owner-epoch.d.ts","sourceRoot":"","sources":["../src/owner-epoch.ts"],"names":[],"mappings":"AA2CA,MAAM,WAAW,eAAe;IAC9B,KAAK,EAAE,MAAM,CAAC;IACd,0EAA0E;IAC1E,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;CACxB;AAED,MAAM,WAAW,kBAAkB;IACjC,KAAK,EAAE,MAAM,CAAC;IACd,uEAAuE;IACvE,OAAO,EAAE,OAAO,CAAC;CAClB;AAED,qBAAa,eAAe;IAC1B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAyB;gBAElC,IAAI,EAAE;QAAE,OAAO,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAC;QAAC,GAAG,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAA;KAAE;IAOnF,uDAAuD;IACvD,OAAO,IAAI,MAAM;IAIjB;;;;OAIG;IACH,SAAS,CAAC,GAAG,EAAE;QAAE,WAAW,EAAE,MAAM,CAAA;KAAE,GAAG,kBAAkB;IAU3D,OAAO,CAAC,KAAK;IAoBb;;;OAGG;IACH,OAAO,CAAC,MAAM;CAUf"}
|