@burdenoff/ui-engine 0.0.0-stage → 2026.1127.1

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.
@@ -0,0 +1,214 @@
1
+ import { z } from 'zod';
2
+ /** Lower-case hex sha256 of the UTF-8 bytes of `text` (same output as node:crypto). */
3
+ export declare function sha256Hex(text: string): string;
4
+ export declare const RECORDING_VERSION = 1;
5
+ export declare const MAX_RECORDED_STEPS = 200;
6
+ /** Who wrote a playbook version's saved steps (spec 10 section 3.11). There is no STEWARD value, by design. */
7
+ export declare const SAVED_STEP_AUTHORS: readonly ["PERSON", "TEACH_MODE", "IMPORT"];
8
+ export type SavedStepAuthor = (typeof SAVED_STEP_AUTHORS)[number];
9
+ /** Desk actions a recording may replay. Shell and file actions are never replayed without the model. */
10
+ export declare const REPLAYABLE_ACTIONS: readonly ["click", "type", "secret_fill", "key", "scroll", "navigate", "focus_window"];
11
+ export type ReplayableAction = (typeof REPLAYABLE_ACTIONS)[number];
12
+ export declare const recordedTargetSchema: z.ZodObject<{
13
+ app: z.ZodOptional<z.ZodString>;
14
+ window: z.ZodOptional<z.ZodString>;
15
+ role: z.ZodString;
16
+ name: z.ZodString;
17
+ nth: z.ZodDefault<z.ZodInt>;
18
+ }, z.core.$strict>;
19
+ export type RecordedTarget = z.infer<typeof recordedTargetSchema>;
20
+ export declare const recordedStepSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
21
+ action: z.ZodLiteral<"click">;
22
+ button: z.ZodDefault<z.ZodEnum<{
23
+ left: "left";
24
+ right: "right";
25
+ }>>;
26
+ count: z.ZodDefault<z.ZodUnion<readonly [z.ZodLiteral<1>, z.ZodLiteral<2>]>>;
27
+ target: z.ZodObject<{
28
+ app: z.ZodOptional<z.ZodString>;
29
+ window: z.ZodOptional<z.ZodString>;
30
+ role: z.ZodString;
31
+ name: z.ZodString;
32
+ nth: z.ZodDefault<z.ZodInt>;
33
+ }, z.core.$strict>;
34
+ id: z.ZodString;
35
+ intent: z.ZodString;
36
+ screenshotRef: z.ZodOptional<z.ZodString>;
37
+ fingerprint: z.ZodString;
38
+ }, z.core.$strict>, z.ZodObject<{
39
+ action: z.ZodLiteral<"type">;
40
+ target: z.ZodOptional<z.ZodObject<{
41
+ app: z.ZodOptional<z.ZodString>;
42
+ window: z.ZodOptional<z.ZodString>;
43
+ role: z.ZodString;
44
+ name: z.ZodString;
45
+ nth: z.ZodDefault<z.ZodInt>;
46
+ }, z.core.$strict>>;
47
+ text: z.ZodOptional<z.ZodString>;
48
+ masked: z.ZodDefault<z.ZodBoolean>;
49
+ id: z.ZodString;
50
+ intent: z.ZodString;
51
+ screenshotRef: z.ZodOptional<z.ZodString>;
52
+ fingerprint: z.ZodString;
53
+ }, z.core.$strict>, z.ZodObject<{
54
+ action: z.ZodLiteral<"secret_fill">;
55
+ secretRef: z.ZodString;
56
+ expectedOrigin: z.ZodURL;
57
+ target: z.ZodObject<{
58
+ app: z.ZodOptional<z.ZodString>;
59
+ window: z.ZodOptional<z.ZodString>;
60
+ role: z.ZodString;
61
+ name: z.ZodString;
62
+ nth: z.ZodDefault<z.ZodInt>;
63
+ }, z.core.$strict>;
64
+ id: z.ZodString;
65
+ intent: z.ZodString;
66
+ screenshotRef: z.ZodOptional<z.ZodString>;
67
+ fingerprint: z.ZodString;
68
+ }, z.core.$strict>, z.ZodObject<{
69
+ action: z.ZodLiteral<"key">;
70
+ keys: z.ZodArray<z.ZodString>;
71
+ id: z.ZodString;
72
+ intent: z.ZodString;
73
+ screenshotRef: z.ZodOptional<z.ZodString>;
74
+ fingerprint: z.ZodString;
75
+ }, z.core.$strict>, z.ZodObject<{
76
+ action: z.ZodLiteral<"scroll">;
77
+ target: z.ZodOptional<z.ZodObject<{
78
+ app: z.ZodOptional<z.ZodString>;
79
+ window: z.ZodOptional<z.ZodString>;
80
+ role: z.ZodString;
81
+ name: z.ZodString;
82
+ nth: z.ZodDefault<z.ZodInt>;
83
+ }, z.core.$strict>>;
84
+ dx: z.ZodInt;
85
+ dy: z.ZodInt;
86
+ id: z.ZodString;
87
+ intent: z.ZodString;
88
+ screenshotRef: z.ZodOptional<z.ZodString>;
89
+ fingerprint: z.ZodString;
90
+ }, z.core.$strict>, z.ZodObject<{
91
+ action: z.ZodLiteral<"navigate">;
92
+ url: z.ZodURL;
93
+ id: z.ZodString;
94
+ intent: z.ZodString;
95
+ screenshotRef: z.ZodOptional<z.ZodString>;
96
+ fingerprint: z.ZodString;
97
+ }, z.core.$strict>, z.ZodObject<{
98
+ action: z.ZodLiteral<"focus_window">;
99
+ app: z.ZodString;
100
+ title: z.ZodOptional<z.ZodString>;
101
+ id: z.ZodString;
102
+ intent: z.ZodString;
103
+ screenshotRef: z.ZodOptional<z.ZodString>;
104
+ fingerprint: z.ZodString;
105
+ }, z.core.$strict>], "action">;
106
+ export type RecordedStep = z.infer<typeof recordedStepSchema>;
107
+ export declare const recordingSchema: z.ZodObject<{
108
+ version: z.ZodLiteral<1>;
109
+ steps: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
110
+ action: z.ZodLiteral<"click">;
111
+ button: z.ZodDefault<z.ZodEnum<{
112
+ left: "left";
113
+ right: "right";
114
+ }>>;
115
+ count: z.ZodDefault<z.ZodUnion<readonly [z.ZodLiteral<1>, z.ZodLiteral<2>]>>;
116
+ target: z.ZodObject<{
117
+ app: z.ZodOptional<z.ZodString>;
118
+ window: z.ZodOptional<z.ZodString>;
119
+ role: z.ZodString;
120
+ name: z.ZodString;
121
+ nth: z.ZodDefault<z.ZodInt>;
122
+ }, z.core.$strict>;
123
+ id: z.ZodString;
124
+ intent: z.ZodString;
125
+ screenshotRef: z.ZodOptional<z.ZodString>;
126
+ fingerprint: z.ZodString;
127
+ }, z.core.$strict>, z.ZodObject<{
128
+ action: z.ZodLiteral<"type">;
129
+ target: z.ZodOptional<z.ZodObject<{
130
+ app: z.ZodOptional<z.ZodString>;
131
+ window: z.ZodOptional<z.ZodString>;
132
+ role: z.ZodString;
133
+ name: z.ZodString;
134
+ nth: z.ZodDefault<z.ZodInt>;
135
+ }, z.core.$strict>>;
136
+ text: z.ZodOptional<z.ZodString>;
137
+ masked: z.ZodDefault<z.ZodBoolean>;
138
+ id: z.ZodString;
139
+ intent: z.ZodString;
140
+ screenshotRef: z.ZodOptional<z.ZodString>;
141
+ fingerprint: z.ZodString;
142
+ }, z.core.$strict>, z.ZodObject<{
143
+ action: z.ZodLiteral<"secret_fill">;
144
+ secretRef: z.ZodString;
145
+ expectedOrigin: z.ZodURL;
146
+ target: z.ZodObject<{
147
+ app: z.ZodOptional<z.ZodString>;
148
+ window: z.ZodOptional<z.ZodString>;
149
+ role: z.ZodString;
150
+ name: z.ZodString;
151
+ nth: z.ZodDefault<z.ZodInt>;
152
+ }, z.core.$strict>;
153
+ id: z.ZodString;
154
+ intent: z.ZodString;
155
+ screenshotRef: z.ZodOptional<z.ZodString>;
156
+ fingerprint: z.ZodString;
157
+ }, z.core.$strict>, z.ZodObject<{
158
+ action: z.ZodLiteral<"key">;
159
+ keys: z.ZodArray<z.ZodString>;
160
+ id: z.ZodString;
161
+ intent: z.ZodString;
162
+ screenshotRef: z.ZodOptional<z.ZodString>;
163
+ fingerprint: z.ZodString;
164
+ }, z.core.$strict>, z.ZodObject<{
165
+ action: z.ZodLiteral<"scroll">;
166
+ target: z.ZodOptional<z.ZodObject<{
167
+ app: z.ZodOptional<z.ZodString>;
168
+ window: z.ZodOptional<z.ZodString>;
169
+ role: z.ZodString;
170
+ name: z.ZodString;
171
+ nth: z.ZodDefault<z.ZodInt>;
172
+ }, z.core.$strict>>;
173
+ dx: z.ZodInt;
174
+ dy: z.ZodInt;
175
+ id: z.ZodString;
176
+ intent: z.ZodString;
177
+ screenshotRef: z.ZodOptional<z.ZodString>;
178
+ fingerprint: z.ZodString;
179
+ }, z.core.$strict>, z.ZodObject<{
180
+ action: z.ZodLiteral<"navigate">;
181
+ url: z.ZodURL;
182
+ id: z.ZodString;
183
+ intent: z.ZodString;
184
+ screenshotRef: z.ZodOptional<z.ZodString>;
185
+ fingerprint: z.ZodString;
186
+ }, z.core.$strict>, z.ZodObject<{
187
+ action: z.ZodLiteral<"focus_window">;
188
+ app: z.ZodString;
189
+ title: z.ZodOptional<z.ZodString>;
190
+ id: z.ZodString;
191
+ intent: z.ZodString;
192
+ screenshotRef: z.ZodOptional<z.ZodString>;
193
+ fingerprint: z.ZodString;
194
+ }, z.core.$strict>], "action">>;
195
+ }, z.core.$strict>;
196
+ export type Recording = z.infer<typeof recordingSchema>;
197
+ /** The parts of a step that say where it acts. */
198
+ type FingerprintSource = {
199
+ action: string;
200
+ target?: RecordedTarget;
201
+ url?: string;
202
+ app?: string;
203
+ title?: string;
204
+ } | RecordedStep;
205
+ /** sha256 over the step's action and target, so a stored step cannot be silently retargeted. */
206
+ export declare function targetFingerprint(step: FingerprintSource): string;
207
+ export declare class RecordingError extends Error {
208
+ readonly code: 'INVALID_RECORDING' | 'FINGERPRINT_MISMATCH' | 'DUPLICATE_STEP_ID' | 'CREDENTIAL_IN_RECORDING';
209
+ constructor(code: 'INVALID_RECORDING' | 'FINGERPRINT_MISMATCH' | 'DUPLICATE_STEP_ID' | 'CREDENTIAL_IN_RECORDING', message: string);
210
+ }
211
+ /** A stored recording, validated: shape, unique step ids, and every fingerprint. Throws RecordingError. */
212
+ export declare function parseRecording(value: unknown): Recording;
213
+ export declare function isSavedStepAuthor(value: unknown): value is SavedStepAuthor;
214
+ export {};
@@ -0,0 +1,28 @@
1
+ import {
2
+ sha256Hex2,
3
+ RECORDING_VERSION2,
4
+ MAX_RECORDED_STEPS2,
5
+ SAVED_STEP_AUTHORS2,
6
+ REPLAYABLE_ACTIONS2,
7
+ recordedTargetSchema2,
8
+ recordedStepSchema2,
9
+ recordingSchema2,
10
+ targetFingerprint2,
11
+ RecordingError2,
12
+ parseRecording2,
13
+ isSavedStepAuthor2
14
+ } from "./index-c6pmt2rg.js";
15
+ export {
16
+ MAX_RECORDED_STEPS2 as MAX_RECORDED_STEPS,
17
+ RECORDING_VERSION2 as RECORDING_VERSION,
18
+ REPLAYABLE_ACTIONS2 as REPLAYABLE_ACTIONS,
19
+ RecordingError2 as RecordingError,
20
+ SAVED_STEP_AUTHORS2 as SAVED_STEP_AUTHORS,
21
+ isSavedStepAuthor2 as isSavedStepAuthor,
22
+ parseRecording2 as parseRecording,
23
+ recordedStepSchema2 as recordedStepSchema,
24
+ recordedTargetSchema2 as recordedTargetSchema,
25
+ recordingSchema2 as recordingSchema,
26
+ sha256Hex2 as sha256Hex,
27
+ targetFingerprint2 as targetFingerprint
28
+ };
@@ -0,0 +1,39 @@
1
+ /**
2
+ * Credential redaction for provider error text (BOFF-15376).
3
+ *
4
+ * Copied from wspace-botmanor-svc `src/utils/redact-credentials.ts` at
5
+ * 6558d8b (BOFF-16873). Keep the patterns in step with that file until
6
+ * Stewards adopts this package.
7
+ *
8
+ * LLM providers echo part of the rejected key in their error bodies (for
9
+ * example OpenAI's "Incorrect API key provided: sk-abc***xyz"). That text is
10
+ * stored on execution runs, activity rows and fallback records and returned
11
+ * to callers, so every credential-like fragment is replaced before the text
12
+ * leaves the adapter. Over-redaction is acceptable; a leaked fragment is not.
13
+ *
14
+ * Added in this package: `containsCredential` and `containsCredentialInUrl`,
15
+ * the checks `parseRecording` uses to refuse stored text that still holds a
16
+ * recognisable credential, and `decodeUriText`, the lenient URL decoding that
17
+ * capture and parsing share.
18
+ */
19
+ /** Same marker `LLMProvider` uses when it strips a known key from a message. */
20
+ export declare const REDACTED = "[REDACTED]";
21
+ /**
22
+ * Replace credential-like fragments in `text` with "[REDACTED]".
23
+ * Returns the input unchanged when nothing matches.
24
+ */
25
+ export declare function redactCredentials(text: string): string;
26
+ /**
27
+ * True when `text` still holds a fragment that `redactCredentials` would
28
+ * replace. Markers already in the text are allowed, so text that went through
29
+ * `redactCredentials` once is never reported.
30
+ */
31
+ export declare function containsCredential(text: string): boolean;
32
+ /** URL text decoded for checks (`+` as a space); text that does not decode is returned as written. */
33
+ export declare function decodeUriText(text: string): string;
34
+ /**
35
+ * `containsCredential` for a URL or a part of one: the text is decoded and its
36
+ * path and query delimiters become spaces, so `/api_key=abc/` and
37
+ * `?token=abc&x=1` are read as words.
38
+ */
39
+ export declare function containsCredentialInUrl(text: string): boolean;
@@ -0,0 +1,144 @@
1
+ /**
2
+ * Saved-step replay for steward runs (BOFF-16214, plan 5.7 and phase 6).
3
+ *
4
+ * Copied from wspace-botmanor-svc `src/modules/stewards/teach/replay.ts` at
5
+ * 6558d8b (BOFF-16873). Changes from that file:
6
+ * - the tool-call and chat-message types are local structural copies of
7
+ * Stewards' `ToolLoopFunctionCall` and `ToolLoopMessage`, so the package has
8
+ * no service imports and Stewards still type-checks against it unchanged;
9
+ * - `replayStateFrom` takes `unknown` instead of `Prisma.JsonValue`;
10
+ * - `planReplay`, `afterReplayCall` and `replayReasons` take optional
11
+ * `ReplayOptions` (tool names and call-id prefix). The defaults produce
12
+ * exactly the Stewards calls: `desk_snapshot`, `desk_<action>` and ids that
13
+ * start with `replay-`.
14
+ *
15
+ * A run that starts with a recording replays it step by step with no model
16
+ * call. Each step goes through the Action Gateway exactly like a call the
17
+ * model proposed, so the charter, the TOOL policy, egress, trust, taint,
18
+ * approvals and the effect guard all apply unchanged:
19
+ *
20
+ * 1. A step with a target first takes a desk snapshot (`desk_snapshot`).
21
+ * 2. The target is found again by app, window, role and label (`resolve.ts`),
22
+ * and the action is issued with the ref it has on this screen.
23
+ * 3. When the target is not on the screen, the snapshot fails or the action
24
+ * fails or is refused, that one step falls back to the model: it gets the
25
+ * step's recorded intent and the current transcript, and its calls go
26
+ * through the gateway too. When the model's calls for the step are done,
27
+ * replay goes on with the next step.
28
+ * 4. After the last step the run completes. With no fallback there was no
29
+ * model call at all.
30
+ *
31
+ * The recording in the checkpoint is the copy the run started with. The run
32
+ * only moves its cursor; it never edits, adds or removes saved steps, and no
33
+ * steward tool can write a recording.
34
+ *
35
+ * Every step row says where it came from in `verdictReasons`:
36
+ * `replay:snapshot:<step>`, `replay:step:<step>` and `replay:fallback:<step>:<why>`.
37
+ */
38
+ import { type RecordedStep, type Recording } from './recording.js';
39
+ import { type SnapshotNode } from './resolve.js';
40
+ /** A function call in the OpenAI tool-calling shape (structurally Stewards' `ToolLoopFunctionCall`). */
41
+ export interface ReplayFunctionCall {
42
+ id: string;
43
+ type: 'function';
44
+ function: {
45
+ name: string;
46
+ arguments: string;
47
+ };
48
+ }
49
+ /** A chat message in the OpenAI tool-calling shape (structurally Stewards' `ToolLoopMessage`). */
50
+ export type ReplayChatMessage = {
51
+ role: 'system';
52
+ content: string;
53
+ } | {
54
+ role: 'user';
55
+ content: string;
56
+ } | {
57
+ role: 'assistant';
58
+ content: string | null;
59
+ tool_calls?: ReplayFunctionCall[];
60
+ } | {
61
+ role: 'tool';
62
+ tool_call_id: string;
63
+ content: string;
64
+ };
65
+ /** The kinds of call replay issues: one per saved-step action, plus the snapshot before a targeted step. */
66
+ export type ReplayCallKind = RecordedStep['action'] | 'snapshot';
67
+ /** How replay names its calls. The defaults are the Stewards desk tools. */
68
+ export interface ReplayOptions {
69
+ /** The tool a call kind maps to. Default: `desk_<kind>` (`desk_snapshot`, `desk_click`, ...). */
70
+ toolName?: (kind: ReplayCallKind) => string;
71
+ /** The prefix of every call id replay issues. Default: `replay-`. */
72
+ callPrefix?: string;
73
+ }
74
+ /** Where the recording came from, for the ledger. */
75
+ export interface ReplaySource {
76
+ playbookId: string | null;
77
+ version: number | null;
78
+ }
79
+ export interface ReplayState {
80
+ recording: Recording;
81
+ source: ReplaySource;
82
+ /** Index of the next saved step. */
83
+ cursor: number;
84
+ /** The last snapshot, taken for the step at `snapshotFor`. */
85
+ snapshot: SnapshotNode[] | null;
86
+ snapshotFor: number | null;
87
+ /** The model is handling this step; `asked` once the model has been called for it. */
88
+ fallback: {
89
+ index: number;
90
+ reason: string;
91
+ asked: boolean;
92
+ } | null;
93
+ replayed: number;
94
+ fallbacks: number;
95
+ /** The id of the call replay issued and is waiting for; only that call advances replay. */
96
+ awaiting: string | null;
97
+ }
98
+ export type FallbackReason = 'masked-input' | 'not-found' | 'fewer-matches' | 'no-snapshot' | 'snapshot-failed' | 'action-failed' | 'action-refused';
99
+ /** What the engine does next for a replaying run. */
100
+ export type ReplayPlan = {
101
+ kind: 'call';
102
+ state: ReplayState;
103
+ call: ReplayFunctionCall;
104
+ reasons: string[];
105
+ } | {
106
+ kind: 'fallback';
107
+ state: ReplayState;
108
+ message: ReplayChatMessage;
109
+ reasons: string[];
110
+ } | {
111
+ kind: 'done';
112
+ state: ReplayState;
113
+ output: string;
114
+ };
115
+ /** The run's replay state from its context (`run.context.replay`), or null when it has none. Throws RecordingError. */
116
+ export declare function replayStateFrom(context: unknown): ReplayState | null;
117
+ /** A checkpoint's replay state, read back; null when absent or unreadable (the run then works without it). */
118
+ export declare function readReplayState(value: unknown): ReplayState | null;
119
+ /** The next thing a replaying run does. Pure: the engine applies the returned state. */
120
+ export declare function planReplay(state: ReplayState, options?: ReplayOptions): ReplayPlan;
121
+ /** The outcome of a replayed call, as far as replay cares. */
122
+ export interface ReplayCallOutcome {
123
+ verdict: string;
124
+ data?: unknown;
125
+ }
126
+ /**
127
+ * Advance after a replayed call ran through the gateway. Returns the new state,
128
+ * or a fallback plan when the step has to go to the model. An ASKED call is
129
+ * not reported here: it stays pending and re-enters the gateway on resume.
130
+ */
131
+ export declare function afterReplayCall(state: ReplayState, callId: string, outcome: ReplayCallOutcome, options?: ReplayOptions): {
132
+ state: ReplayState;
133
+ } | Extract<ReplayPlan, {
134
+ kind: 'fallback';
135
+ }>;
136
+ /** The model finished its fallback step (no calls left): move on to the next saved step. */
137
+ export declare function finishFallback(state: ReplayState): ReplayState;
138
+ /** The model has been called for the fallback step. */
139
+ export declare function markFallbackAsked(state: ReplayState): ReplayState;
140
+ /**
141
+ * What a step row records about replay: the saved step a replayed call came
142
+ * from, or the step a model call (or the model's tool call) stood in for.
143
+ */
144
+ export declare function replayReasons(state: ReplayState | null | undefined, callId: string | null): string[];
package/dist/replay.js ADDED
@@ -0,0 +1,20 @@
1
+ import {
2
+ replayStateFrom2,
3
+ readReplayState2,
4
+ planReplay2,
5
+ afterReplayCall2,
6
+ finishFallback2,
7
+ markFallbackAsked2,
8
+ replayReasons2
9
+ } from "./index-05zgh18g.js";
10
+ import"./index-c6pmt2rg.js";
11
+ import"./index-3v887c75.js";
12
+ export {
13
+ afterReplayCall2 as afterReplayCall,
14
+ finishFallback2 as finishFallback,
15
+ markFallbackAsked2 as markFallbackAsked,
16
+ planReplay2 as planReplay,
17
+ readReplayState2 as readReplayState,
18
+ replayReasons2 as replayReasons,
19
+ replayStateFrom2 as replayStateFrom
20
+ };
@@ -0,0 +1,43 @@
1
+ /**
2
+ * Re-resolve a saved step's target on the current screen (BOFF-16214).
3
+ *
4
+ * Copied from wspace-botmanor-svc `src/modules/stewards/teach/resolve.ts` at
5
+ * 6558d8b (BOFF-16873). One change: `readSnapshotNodes` also reads the
6
+ * `{ elements }` list that the browser desk (`vibe-plugin-desk-browser`
7
+ * `PageSnapshot`) returns. The Stewards copy reads only an array or `.nodes`,
8
+ * so against the real browser desk every targeted step finds 0 nodes.
9
+ *
10
+ * A desk snapshot (contract 2 `snapshot`) is an accessibility tree flattened to
11
+ * nodes with a ref, a role and a label; desktop desks add the app and window.
12
+ * A recorded target matches a node when its role and label are equal (case and
13
+ * whitespace aside) and, when the recording names them, the app and window are
14
+ * equal too. With several equal matches, the recorded `nth` picks one.
15
+ *
16
+ * No match, or fewer matches than `nth` needs, means the screen changed: the
17
+ * step falls back to the model. There is no fuzzy matching on purpose: a
18
+ * replayed click on the wrong element is worse than one model call.
19
+ *
20
+ * Snapshot content is untrusted page data. It is only compared here; it never
21
+ * becomes an instruction.
22
+ */
23
+ import type { RecordedTarget } from './recording.js';
24
+ export interface SnapshotNode {
25
+ ref: string;
26
+ role: string;
27
+ name: string;
28
+ app?: string;
29
+ window?: string;
30
+ }
31
+ /** Most nodes kept from one snapshot (they are stored in the run checkpoint). */
32
+ export declare const MAX_SNAPSHOT_NODES = 2000;
33
+ /** The nodes of a desk snapshot, read leniently: anything that is not a node is skipped. */
34
+ export declare function readSnapshotNodes(snapshot: unknown): SnapshotNode[];
35
+ export type ResolveOutcome = {
36
+ resolved: true;
37
+ ref: string;
38
+ } | {
39
+ resolved: false;
40
+ reason: 'no-snapshot' | 'not-found' | 'fewer-matches';
41
+ };
42
+ /** The ref of the recorded target on this screen, or why it cannot be found. */
43
+ export declare function resolveTarget(target: RecordedTarget, nodes: readonly SnapshotNode[] | null): ResolveOutcome;
@@ -0,0 +1,10 @@
1
+ import {
2
+ MAX_SNAPSHOT_NODES2,
3
+ readSnapshotNodes2,
4
+ resolveTarget2
5
+ } from "./index-3v887c75.js";
6
+ export {
7
+ MAX_SNAPSHOT_NODES2 as MAX_SNAPSHOT_NODES,
8
+ readSnapshotNodes2 as readSnapshotNodes,
9
+ resolveTarget2 as resolveTarget
10
+ };
package/package.json CHANGED
@@ -1,6 +1,96 @@
1
1
  {
2
2
  "name": "@burdenoff/ui-engine",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
6
- }
3
+ "version": "2026.1127.1",
4
+ "description": "Shared, browser-safe UI automation engine: recordings, capture-time masking, target resolution and replay for FluidGrids RPA and BotManor Stewards.",
5
+ "license": "MIT",
6
+ "author": "Burdenoff Consultancy Services Pvt. Ltd.",
7
+ "repository": {
8
+ "type": "git",
9
+ "url": "git+https://github.com/Algoshred/burdenoff-ui-engine.git"
10
+ },
11
+ "type": "module",
12
+ "sideEffects": false,
13
+ "main": "./dist/index.js",
14
+ "types": "./dist/index.d.ts",
15
+ "exports": {
16
+ ".": {
17
+ "types": "./dist/index.d.ts",
18
+ "import": "./dist/index.js"
19
+ },
20
+ "./recording": {
21
+ "types": "./dist/recording.d.ts",
22
+ "import": "./dist/recording.js"
23
+ },
24
+ "./capture": {
25
+ "types": "./dist/capture.d.ts",
26
+ "import": "./dist/capture.js"
27
+ },
28
+ "./resolve": {
29
+ "types": "./dist/resolve.d.ts",
30
+ "import": "./dist/resolve.js"
31
+ },
32
+ "./replay": {
33
+ "types": "./dist/replay.d.ts",
34
+ "import": "./dist/replay.js"
35
+ },
36
+ "./package.json": "./package.json"
37
+ },
38
+ "files": [
39
+ "dist",
40
+ "README.md",
41
+ "LICENSE"
42
+ ],
43
+ "scripts": {
44
+ "build": "rm -rf dist && bun build src/index.ts src/recording.ts src/capture.ts src/resolve.ts src/replay.ts --outdir dist --target browser --format esm --splitting --packages external && tsc -p tsconfig.build.json",
45
+ "type:check": "boff gate -- bun check --no-pretty",
46
+ "lint": "eslint .",
47
+ "lint:fix": "eslint . --fix",
48
+ "format": "bun fmt src tests scripts",
49
+ "format:check": "bun fmt --check src tests scripts",
50
+ "test": "bun test",
51
+ "sanity": "boff sanity",
52
+ "sanity:force": "boff sanity --force",
53
+ "audit": "bun audit --audit-level=high",
54
+ "check:browser-safe": "bun run scripts/check-browser-safe.ts"
55
+ },
56
+ "dependencies": {
57
+ "@noble/hashes": "2.4.0"
58
+ },
59
+ "peerDependencies": {
60
+ "zod": "^4.6.6"
61
+ },
62
+ "devDependencies": {
63
+ "@burdenoff/toolchain": "2026.1123.1",
64
+ "@types/bun": "^1.4.4",
65
+ "eslint": "^9.39.5",
66
+ "typescript": "6.0.3",
67
+ "zod": "4.6.7"
68
+ },
69
+ "publishConfig": {
70
+ "access": "public"
71
+ },
72
+ "engines": {
73
+ "node": ">=20",
74
+ "bun": ">=1.4.4"
75
+ },
76
+ "packageManager": "bun@1.4.4",
77
+ "boff": {
78
+ "type": "lib",
79
+ "sanity": {
80
+ "formatPaths": [
81
+ "src",
82
+ "tests",
83
+ "scripts"
84
+ ],
85
+ "extra": [
86
+ "check:browser-safe"
87
+ ]
88
+ },
89
+ "coverage": {
90
+ "global": 90,
91
+ "lines": 90,
92
+ "functions": 90,
93
+ "diff": 80
94
+ }
95
+ }
96
+ }