@reticlehq/core 2.13.1 → 3.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/artifacts/artifacts-entry.d.ts +20 -0
- package/dist/artifacts/artifacts-entry.js +20 -0
- package/dist/artifacts/flow-composition.d.ts +30 -0
- package/dist/artifacts/flow-composition.js +19 -0
- package/dist/{flow-constants.d.ts → artifacts/flow-constants.d.ts} +97 -3
- package/dist/{flow-constants.js → artifacts/flow-constants.js} +103 -4
- package/dist/artifacts/flow-mutation-target.d.ts +39 -0
- package/dist/artifacts/flow-mutation-target.js +89 -0
- package/dist/artifacts/flow-order.d.ts +30 -0
- package/dist/artifacts/flow-order.js +49 -0
- package/dist/artifacts/flow-select.d.ts +56 -0
- package/dist/artifacts/flow-select.js +56 -0
- package/dist/artifacts/flow-step-tool.d.ts +31 -0
- package/dist/artifacts/flow-step-tool.js +31 -0
- package/dist/artifacts/flow-types.d.ts +3736 -0
- package/dist/artifacts/flow-types.js +463 -0
- package/dist/artifacts/flow-unreached.d.ts +12 -0
- package/dist/artifacts/flow-unreached.js +24 -0
- package/dist/{impact-savings.d.ts → artifacts/impact-savings.d.ts} +7 -3
- package/dist/{impact-savings.js → artifacts/impact-savings.js} +27 -4
- package/dist/{impact.d.ts → artifacts/impact.d.ts} +122 -54
- package/dist/{impact.js → artifacts/impact.js} +30 -0
- package/dist/{journal.d.ts → artifacts/journal.d.ts} +50 -6
- package/dist/{journal.js → artifacts/journal.js} +38 -2
- package/dist/artifacts/step-effect.d.ts +29 -0
- package/dist/artifacts/step-effect.js +28 -0
- package/dist/hooks/hook-events.d.ts +311 -0
- package/dist/hooks/hook-events.js +127 -0
- package/dist/hooks/hooks-entry.d.ts +9 -0
- package/dist/hooks/hooks-entry.js +9 -0
- package/dist/{brand.d.ts → identity/brand.d.ts} +7 -0
- package/dist/{contract-fingerprint.d.ts → identity/contract-fingerprint.d.ts} +21 -3
- package/dist/{contract-fingerprint.js → identity/contract-fingerprint.js} +22 -4
- package/dist/{document-identity.d.ts → identity/document-identity.d.ts} +4 -5
- package/dist/{document-identity.js → identity/document-identity.js} +4 -5
- package/dist/{source-constants.d.ts → identity/source-constants.d.ts} +4 -4
- package/dist/{source-constants.js → identity/source-constants.js} +4 -4
- package/dist/index.d.ts +69 -42
- package/dist/index.js +78 -44
- package/dist/onboarding.d.ts +114 -0
- package/dist/onboarding.js +141 -0
- package/dist/realm/registry.d.ts +212 -0
- package/dist/realm/registry.js +302 -0
- package/dist/{dev-server-registry.d.ts → registry/dev-server-registry.d.ts} +4 -5
- package/dist/{dev-server-registry.js → registry/dev-server-registry.js} +28 -19
- package/dist/{project-registry.d.ts → registry/project-registry.d.ts} +5 -5
- package/dist/{project-registry.js → registry/project-registry.js} +5 -5
- package/dist/schema/command-name.json +31 -0
- package/dist/schema/event-message.json +1 -0
- package/dist/schema/event-payloads.json +791 -0
- package/dist/schema/event-type.json +1 -0
- package/dist/schema/hello-message.json +76 -2
- package/dist/schema/reticle-event.json +1 -0
- package/dist/schema/reticle-message.json +77 -2
- package/dist/telemetry-entry.d.ts +15 -0
- package/dist/telemetry-entry.js +15 -0
- package/dist/telemetry-feedback.d.ts +13 -14
- package/dist/telemetry-feedback.js +11 -12
- package/dist/telemetry-license.d.ts +1 -1
- package/dist/telemetry-license.js +1 -1
- package/dist/telemetry-refusal.d.ts +11 -11
- package/dist/telemetry-refusal.js +7 -8
- package/dist/telemetry-session.d.ts +49 -57
- package/dist/telemetry-session.js +47 -55
- package/dist/telemetry.d.ts +229 -198
- package/dist/telemetry.js +83 -98
- package/dist/tour-entry.d.ts +10 -0
- package/dist/tour-entry.js +10 -0
- package/dist/tour.d.ts +125 -0
- package/dist/tour.js +165 -0
- package/dist/{consequence.d.ts → verdict/consequence.d.ts} +35 -11
- package/dist/{consequence.js → verdict/consequence.js} +9 -22
- package/dist/{finding-fingerprint.js → verdict/finding-fingerprint.js} +1 -1
- package/dist/{findings.d.ts → verdict/findings.d.ts} +149 -41
- package/dist/{findings.js → verdict/findings.js} +169 -48
- package/dist/{instrumentation-gap.d.ts → verdict/instrumentation-gap.d.ts} +22 -14
- package/dist/{instrumentation-gap.js → verdict/instrumentation-gap.js} +23 -15
- package/dist/{intent.d.ts → verdict/intent.d.ts} +41 -52
- package/dist/{intent.js → verdict/intent.js} +11 -22
- package/dist/verdict/revision.d.ts +44 -0
- package/dist/verdict/revision.js +53 -0
- package/dist/{run-context.d.ts → verdict/run-context.d.ts} +13 -34
- package/dist/{run-context.js → verdict/run-context.js} +15 -36
- package/dist/{security.js → verdict/security.js} +12 -21
- package/dist/{verification-run.d.ts → verdict/verification-run.d.ts} +369 -93
- package/dist/{verification-run.js → verdict/verification-run.js} +157 -21
- package/dist/{verified-constants.d.ts → verdict/verified-constants.d.ts} +36 -13
- package/dist/{verified-constants.js → verdict/verified-constants.js} +36 -13
- package/dist/verdict/verify-progress.d.ts +129 -0
- package/dist/verdict/verify-progress.js +74 -0
- package/dist/wire/channel.d.ts +46 -0
- package/dist/wire/channel.js +95 -0
- package/dist/{constants.d.ts → wire/constants/constants.d.ts} +124 -28
- package/dist/{constants.js → wire/constants/constants.js} +137 -28
- package/dist/{session-constants.d.ts → wire/constants/session-constants.d.ts} +9 -2
- package/dist/{session-constants.js → wire/constants/session-constants.js} +9 -2
- package/dist/{desktop-contract.js → wire/desktop-contract.js} +1 -1
- package/dist/{event-classification.js → wire/event-classification.js} +1 -1
- package/dist/{event-payloads.d.ts → wire/event-payloads.d.ts} +229 -17
- package/dist/{event-payloads.js → wire/event-payloads.js} +61 -3
- package/dist/{event-priority.d.ts → wire/event-priority.d.ts} +1 -4
- package/dist/{event-priority.js → wire/event-priority.js} +2 -5
- package/dist/wire/global-press.d.ts +30 -0
- package/dist/wire/global-press.js +54 -0
- package/dist/{messages.d.ts → wire/messages.d.ts} +290 -38
- package/dist/{messages.js → wire/messages.js} +93 -5
- package/dist/wire/narrow.d.ts +39 -0
- package/dist/wire/narrow.js +45 -0
- package/dist/{net.d.ts → wire/net.d.ts} +49 -10
- package/dist/{net.js → wire/net.js} +49 -10
- package/dist/wire/platform.d.ts +37 -0
- package/dist/wire/platform.js +36 -0
- package/dist/{redaction.d.ts → wire/redaction.d.ts} +30 -0
- package/dist/wire/redaction.js +274 -0
- package/dist/wire/tool-names.d.ts +133 -0
- package/dist/wire/tool-names.js +142 -0
- package/dist/{toon.js → wire/toon.js} +1 -1
- package/dist/{types.d.ts → wire/types.d.ts} +106 -66
- package/dist/{types.js → wire/types.js} +24 -4
- package/dist/{no-session-reason.d.ts → words/no-session-reason.d.ts} +7 -3
- package/dist/{no-session-reason.js → words/no-session-reason.js} +7 -3
- package/dist/{notices.d.ts → words/notices.d.ts} +24 -12
- package/dist/{notices.js → words/notices.js} +27 -12
- package/package.json +22 -5
- package/dist/flow-types.d.ts +0 -1473
- package/dist/flow-types.js +0 -195
- package/dist/redaction.js +0 -149
- /package/dist/{brand.js → identity/brand.js} +0 -0
- /package/dist/{edit-epoch.d.ts → identity/edit-epoch.d.ts} +0 -0
- /package/dist/{edit-epoch.js → identity/edit-epoch.js} +0 -0
- /package/dist/{project-id.d.ts → identity/project-id.d.ts} +0 -0
- /package/dist/{project-id.js → identity/project-id.js} +0 -0
- /package/dist/{daemon-registry.d.ts → registry/daemon-registry.d.ts} +0 -0
- /package/dist/{daemon-registry.js → registry/daemon-registry.js} +0 -0
- /package/dist/{finding-fingerprint.d.ts → verdict/finding-fingerprint.d.ts} +0 -0
- /package/dist/{security.d.ts → verdict/security.d.ts} +0 -0
- /package/dist/{desktop-contract.d.ts → wire/desktop-contract.d.ts} +0 -0
- /package/dist/{event-classification.d.ts → wire/event-classification.d.ts} +0 -0
- /package/dist/{state-select.d.ts → wire/state-select.d.ts} +0 -0
- /package/dist/{state-select.js → wire/state-select.js} +0 -0
- /package/dist/{toon.d.ts → wire/toon.d.ts} +0 -0
- /package/dist/{browser-misdirect.d.ts → words/browser-misdirect.d.ts} +0 -0
- /package/dist/{browser-misdirect.js → words/browser-misdirect.js} +0 -0
- /package/dist/{unreachable-notice.d.ts → words/unreachable-notice.d.ts} +0 -0
- /package/dist/{unreachable-notice.js → words/unreachable-notice.js} +0 -0
- /package/dist/{upgrade.d.ts → words/upgrade.d.ts} +0 -0
- /package/dist/{upgrade.js → words/upgrade.js} +0 -0
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
import { CHANNEL_DEFAULTS, ChannelId, Independence, disagreementCanConvict as protocolRule, } from 'open-verification';
|
|
2
|
+
import { PredicateKind } from '../verdict/consequence.js';
|
|
3
|
+
/**
|
|
4
|
+
* The sources of truth a verdict can be built from.
|
|
5
|
+
*
|
|
6
|
+
* An implementation declares which of these it can observe. A claim reads one or more of them. Put
|
|
7
|
+
* those two facts together and you can tell, at the moment a connection opens, whether a claim is
|
|
8
|
+
* answerable at all -- rather than finding out after the action has been spent and the moment has
|
|
9
|
+
* passed.
|
|
10
|
+
*
|
|
11
|
+
* That ordering is the whole point. Reticle has a history of discovering a missing observation at
|
|
12
|
+
* assert time and reporting a result that looked like evidence: the assertion could not be answered
|
|
13
|
+
* because nothing was watching, and "nothing was watching" and "it did not happen" produced the same
|
|
14
|
+
* empty answer. Each time, the fix was one more flag on the handshake named for that one case. This
|
|
15
|
+
* is the mechanism those flags were each a hand-made instance of.
|
|
16
|
+
*
|
|
17
|
+
* Names are chosen for what the thing IS, not for what one surface calls it. A browser console, a
|
|
18
|
+
* phone's log stream and a server's stdout are one channel: `log`. A realm that has no console still
|
|
19
|
+
* has somewhere errors go.
|
|
20
|
+
*/
|
|
21
|
+
export { ChannelId };
|
|
22
|
+
/**
|
|
23
|
+
* Which channels each kind of claim needs to look at.
|
|
24
|
+
*
|
|
25
|
+
* `Record<PredicateKind, ...>` on purpose: a new kind of claim will not compile until somebody says
|
|
26
|
+
* what it reads. A kind that answered "nothing" would slip past the rule that refuses claims reading
|
|
27
|
+
* undeclared channels, so silence is not an available answer.
|
|
28
|
+
*/
|
|
29
|
+
const CHANNELS_OF = {
|
|
30
|
+
[PredicateKind.ELEMENT]: [ChannelId.UI],
|
|
31
|
+
[PredicateKind.TEXT]: [ChannelId.UI],
|
|
32
|
+
[PredicateKind.SIGNAL]: [ChannelId.SIGNAL],
|
|
33
|
+
[PredicateKind.NET]: [ChannelId.NET],
|
|
34
|
+
[PredicateKind.STATE]: [ChannelId.STATE],
|
|
35
|
+
[PredicateKind.ROUTE]: [ChannelId.ROUTE],
|
|
36
|
+
[PredicateKind.CONSOLE]: [ChannelId.LOG],
|
|
37
|
+
// An animation is a thing on screen, observed over time. Both, because a realm that renders but
|
|
38
|
+
// cannot tell you when something settled cannot answer this either.
|
|
39
|
+
[PredicateKind.ANIMATION]: [ChannelId.UI, ChannelId.TIME],
|
|
40
|
+
// "Has everything gone quiet" is a question about time, and about the traffic being waited on.
|
|
41
|
+
[PredicateKind.SETTLED]: [ChannelId.TIME, ChannelId.NET],
|
|
42
|
+
// A claim made of other claims can contain any of them. Reporting only its own channels would
|
|
43
|
+
// make `allOf` a way to wrap a claim and escape the rule entirely.
|
|
44
|
+
[PredicateKind.ALL_OF]: ANY_CHANNEL_A_CLAIM_CAN_READ(),
|
|
45
|
+
[PredicateKind.ANY_OF]: ANY_CHANNEL_A_CLAIM_CAN_READ(),
|
|
46
|
+
[PredicateKind.NOT]: ANY_CHANNEL_A_CLAIM_CAN_READ(),
|
|
47
|
+
};
|
|
48
|
+
/**
|
|
49
|
+
* Every channel a claim could possibly read -- the answer for a claim built out of other claims.
|
|
50
|
+
*
|
|
51
|
+
* Deliberately the whole set rather than an inspection of the children. The children are not
|
|
52
|
+
* available here (this is a table keyed by kind, not a function of a value), and being pessimistic
|
|
53
|
+
* is the safe direction: it can refuse a composite that would in fact have been answerable, which
|
|
54
|
+
* costs a false refusal. The other direction costs a false verdict.
|
|
55
|
+
*/
|
|
56
|
+
function ANY_CHANNEL_A_CLAIM_CAN_READ() {
|
|
57
|
+
return [
|
|
58
|
+
ChannelId.UI,
|
|
59
|
+
ChannelId.NET,
|
|
60
|
+
ChannelId.STATE,
|
|
61
|
+
ChannelId.SIGNAL,
|
|
62
|
+
ChannelId.LOG,
|
|
63
|
+
ChannelId.ROUTE,
|
|
64
|
+
ChannelId.TIME,
|
|
65
|
+
];
|
|
66
|
+
}
|
|
67
|
+
/** The channels a claim of this kind needs to look at. */
|
|
68
|
+
export function channelsRead(kind) {
|
|
69
|
+
return CHANNELS_OF[kind];
|
|
70
|
+
}
|
|
71
|
+
/**
|
|
72
|
+
* The independence rule, and where it lives.
|
|
73
|
+
*
|
|
74
|
+
* It is not defined here. It is defined in `open-verification`, the specification this codebase
|
|
75
|
+
* implements, and re-exported here so the rest of the repository can reach it.
|
|
76
|
+
*
|
|
77
|
+
* That direction is the point. A rule this load-bearing, defined in the product and described in
|
|
78
|
+
* the spec, is two definitions of one contract -- and the two would drift the way every such pair
|
|
79
|
+
* drifts, silently and in the product's favour. Defining it in the protocol and importing it here
|
|
80
|
+
* means an implementation cannot quietly hold a more convenient version of the rule than the one
|
|
81
|
+
* it publishes.
|
|
82
|
+
*/
|
|
83
|
+
export { Independence, CHANNEL_DEFAULTS };
|
|
84
|
+
/**
|
|
85
|
+
* May a disagreement between these two channels be reported as a fault?
|
|
86
|
+
*
|
|
87
|
+
* The protocol's rule, reached by channel id rather than by descriptor, because that is the shape
|
|
88
|
+
* every caller here already holds. The judgement itself is not re-implemented -- it is the
|
|
89
|
+
* specification's function, applied to this repository's defaults.
|
|
90
|
+
*/
|
|
91
|
+
export function disagreementCanConvict(a, b) {
|
|
92
|
+
return protocolRule({ id: a, ...CHANNEL_DEFAULTS[a] }, { id: b, ...CHANNEL_DEFAULTS[b] });
|
|
93
|
+
}
|
|
94
|
+
/** How independent each channel is, in the shape this repository already reads it in. */
|
|
95
|
+
export const CHANNEL_INDEPENDENCE = Object.fromEntries(Object.entries(CHANNEL_DEFAULTS).map(([id, spec]) => [id, spec.independence]));
|
|
@@ -37,6 +37,17 @@ export declare const STATUS_PATH = "/status";
|
|
|
37
37
|
*/
|
|
38
38
|
export declare const DRIVE_PATH = "/drive";
|
|
39
39
|
export declare const RETICLE_PROTOCOL_VERSION = 1;
|
|
40
|
+
/**
|
|
41
|
+
* The oldest protocol version this build still talks to.
|
|
42
|
+
*
|
|
43
|
+
* A range rather than a single number. An exact door refuses a peer one version out, which is
|
|
44
|
+
* correct when both sides ship together and wrong the moment anything else implements this -- an
|
|
45
|
+
* SDK a user has not upgraded yet is not an incompatible SDK.
|
|
46
|
+
*
|
|
47
|
+
* Equal to the current version today, so nothing changes yet. It exists so that raising the current
|
|
48
|
+
* version is a decision about what to keep supporting, rather than an automatic break.
|
|
49
|
+
*/
|
|
50
|
+
export declare const RETICLE_MIN_PROTOCOL_VERSION = 1;
|
|
40
51
|
/**
|
|
41
52
|
* The host a CLIENT names when it dials the bridge, as opposed to the address the bridge BINDS.
|
|
42
53
|
*
|
|
@@ -67,6 +78,15 @@ export declare function bridgeWsUrl(port?: number, host?: string): string;
|
|
|
67
78
|
export declare const RETICLE_URL_PARAM: {
|
|
68
79
|
readonly SESSION: "__reticle_session";
|
|
69
80
|
readonly PROJECT: "__reticle_project";
|
|
81
|
+
/**
|
|
82
|
+
* "Reticle opened this page for itself" — and nothing more.
|
|
83
|
+
*
|
|
84
|
+
* Deliberately NOT the session stamp. `resolveConnectIdentity` reads SESSION as the session id
|
|
85
|
+
* when the app names none, so marking a drive with it would rename every driven session to one
|
|
86
|
+
* shared constant and make two concurrent drives collide. This carries the one fact the page
|
|
87
|
+
* needs (nobody is sitting in front of it) without touching identity.
|
|
88
|
+
*/
|
|
89
|
+
readonly OPENED: "__reticle_opened";
|
|
70
90
|
};
|
|
71
91
|
/** The loopback bind address. The daemon/bridge bind here by default — never expose Reticle off-host. */
|
|
72
92
|
export declare const LOOPBACK_HOST = "127.0.0.1";
|
|
@@ -142,6 +162,22 @@ export declare const ReticleEnv: {
|
|
|
142
162
|
* shortening it. A budget nobody can reach in a test is a budget nobody tests.
|
|
143
163
|
*/
|
|
144
164
|
readonly RECONNECT_ATTEMPTS: "RETICLE_RECONNECT_ATTEMPTS";
|
|
165
|
+
/** Quiet window before an abandoned MCP stdio proxy exits; `0` disables the watcher. */
|
|
166
|
+
readonly MCP_PROXY_IDLE: "RETICLE_MCP_PROXY_IDLE_MS";
|
|
167
|
+
/**
|
|
168
|
+
* API key for the harness — the model that drives the app when no coding agent is in the loop.
|
|
169
|
+
*
|
|
170
|
+
* The standard Anthropic name, on purpose: a machine that can already run a coding agent can
|
|
171
|
+
* already run the harness, with nothing to configure. Absent ⇒ the harness is simply unavailable
|
|
172
|
+
* and every other part of Reticle is unaffected.
|
|
173
|
+
*/
|
|
174
|
+
readonly HARNESS_KEY: "ANTHROPIC_API_KEY";
|
|
175
|
+
/** Model the harness drives with. Defaults to a small one — see `DEFAULT_HARNESS_MODEL`. */
|
|
176
|
+
readonly HARNESS_MODEL: "RETICLE_HARNESS_MODEL";
|
|
177
|
+
/** Base URL for the harness's model API, for a proxy or a gateway. */
|
|
178
|
+
readonly HARNESS_BASE_URL: "RETICLE_HARNESS_BASE_URL";
|
|
179
|
+
/** Hard ceiling on harness model turns in one drive. Bounds cost, not value. */
|
|
180
|
+
readonly HARNESS_MAX_STEPS: "RETICLE_HARNESS_MAX_STEPS";
|
|
145
181
|
};
|
|
146
182
|
/** Hard transport bounds shared by the browser and bridge. */
|
|
147
183
|
export declare const TRANSPORT_LIMITS: {
|
|
@@ -149,25 +185,17 @@ export declare const TRANSPORT_LIMITS: {
|
|
|
149
185
|
/**
|
|
150
186
|
* Inbound events per second before the bridge SAMPLES rather than records everything.
|
|
151
187
|
*
|
|
152
|
-
*
|
|
153
|
-
*
|
|
154
|
-
*
|
|
155
|
-
*
|
|
156
|
-
* catches false greens is blindest exactly there — but landing that on the first drive after an
|
|
157
|
-
* install, recoverable only by knowing an environment variable exists and inventing a number for
|
|
158
|
-
* it, is the worst possible place to spend the honesty.
|
|
159
|
-
*
|
|
160
|
-
* 20000 is the value that was measured to work on the page that reported it. The cap exists to stop
|
|
161
|
-
* a PATHOLOGICAL page (an animation loop firing DOM mutations every frame), not to throttle a busy
|
|
162
|
-
* one, and the ceiling it has to defend is cheap: the daemon is on the same machine and a typical
|
|
163
|
-
* event is a few hundred bytes, so this is single-digit MB/s over loopback.
|
|
188
|
+
* The cap exists to stop a PATHOLOGICAL page (an animation loop firing DOM mutations every frame),
|
|
189
|
+
* not to throttle a busy one: an ordinary React app with an active query cache passes 1000/s, and a
|
|
190
|
+
* sampled window cannot support a verdict, so too low a cap answers `unknown` with
|
|
191
|
+
* `unclean_capture` on the first `act_and_wait` after an install (#316).
|
|
164
192
|
*
|
|
165
|
-
*
|
|
166
|
-
*
|
|
167
|
-
*
|
|
168
|
-
*
|
|
169
|
-
*
|
|
170
|
-
*
|
|
193
|
+
* The ceiling it defends is cheap — the daemon is on the same machine and a typical event is a few
|
|
194
|
+
* hundred bytes, so 20000/s is single-digit MB/s over loopback. Raising it does not raise what a
|
|
195
|
+
* runaway page can make the bridge HOLD: memory is bounded independently by the ring buffer, which
|
|
196
|
+
* evicts on `RING_BUFFER_DEFAULTS.MAX_BYTES` (this same constant through that alias) as well as on
|
|
197
|
+
* a count and an age. The rate cap defends parse cost, the ring buffer defends memory, and they are
|
|
198
|
+
* not substitutes.
|
|
171
199
|
*/
|
|
172
200
|
readonly MAX_MESSAGES_PER_SECOND: 20000;
|
|
173
201
|
readonly MAX_SESSIONS: 32;
|
|
@@ -178,6 +206,7 @@ export declare const TRANSPORT_LIMITS: {
|
|
|
178
206
|
readonly MAX_URL_LENGTH: 4096;
|
|
179
207
|
readonly MAX_TITLE_LENGTH: 512;
|
|
180
208
|
readonly MAX_ADAPTERS: 32;
|
|
209
|
+
readonly MAX_CONTRACT_NAMES: 128;
|
|
181
210
|
readonly MAX_ADAPTER_NAME_LENGTH: 128;
|
|
182
211
|
readonly MAX_TOKEN_LENGTH: 512;
|
|
183
212
|
readonly MAX_COMMAND_ID_LENGTH: 128;
|
|
@@ -220,8 +249,8 @@ export declare const ReticleDir: {
|
|
|
220
249
|
/**
|
|
221
250
|
* the user's own record of what Reticle has done for them — .reticle/impact.json.
|
|
222
251
|
*
|
|
223
|
-
* Local only, never uploaded, and deliberately NOT part of telemetry: telemetry answers
|
|
224
|
-
*
|
|
252
|
+
* Local only, never uploaded, and deliberately NOT part of telemetry: telemetry answers questions
|
|
253
|
+
* about the product; this answers the user's question about their own work.
|
|
225
254
|
*/
|
|
226
255
|
readonly IMPACT_FILE: "impact.json";
|
|
227
256
|
/** what changes were SUPPOSED to make true —.reticle/intent.json (git-checked, reviewed) */
|
|
@@ -264,6 +293,17 @@ export declare const ReticleDir: {
|
|
|
264
293
|
readonly ISSUES_FILE: "issues.json";
|
|
265
294
|
/** Per-flow assertion tiers recorded on each PASSING replay — the gate's anti-downgrade baseline. */
|
|
266
295
|
readonly TIERS_FILE: "assertion-tiers.json";
|
|
296
|
+
/**
|
|
297
|
+
* what to run when something happens — .reticle/hooks.json. Git-checked on purpose: a hook is a
|
|
298
|
+
* decision the whole team shares, the same way a git hook or a package script is, and one that
|
|
299
|
+
* only exists on the machine that wrote it is a rule nobody else is following.
|
|
300
|
+
*
|
|
301
|
+
* It names COMMANDS, so it is exactly as trusted as `package.json` scripts in the same repository
|
|
302
|
+
* and no more: opening a repo does not run them, and Reticle runs one only when the event it is
|
|
303
|
+
* attached to actually happens. The event payload is handed over on stdin, never interpolated into
|
|
304
|
+
* the command line, so a defect's own text can never become part of a command.
|
|
305
|
+
*/
|
|
306
|
+
readonly HOOKS_FILE: "hooks.json";
|
|
267
307
|
/**
|
|
268
308
|
* Auto-provisioned bridge pairing token, stored at ~/.reticle/pairing-token (mode 0600). Written by
|
|
269
309
|
* the daemon, read Node-side by the build plugins to inject into connect. A browser sandbox cannot
|
|
@@ -326,9 +366,7 @@ export declare const ContractReadError: {
|
|
|
326
366
|
readonly MALFORMED: "contract-malformed";
|
|
327
367
|
};
|
|
328
368
|
export type ContractReadError = (typeof ContractReadError)[keyof typeof ContractReadError];
|
|
329
|
-
/**
|
|
330
|
-
export * from './flow-constants.js';
|
|
331
|
-
/** Bounds for the per-session ring buffer (see plan/02-architecture.md). */
|
|
369
|
+
/** Bounds for the per-session ring buffer. */
|
|
332
370
|
export declare const RING_BUFFER_DEFAULTS: {
|
|
333
371
|
readonly MAX_EVENTS: 2000;
|
|
334
372
|
readonly MAX_AGE_MS: 60000;
|
|
@@ -370,6 +408,16 @@ export declare const EventType: {
|
|
|
370
408
|
* `data: { href }` — the URL the page asked to open, when it named one.
|
|
371
409
|
*/
|
|
372
410
|
readonly CONTEXT_OPENED: "context.opened";
|
|
411
|
+
/**
|
|
412
|
+
* The app opened a native `alert`/`confirm`/`prompt` while Reticle was driving it.
|
|
413
|
+
*
|
|
414
|
+
* Recorded because Reticle ANSWERS these rather than letting them block — a native dialog halts
|
|
415
|
+
* the main thread, and the SDK's own message pump is on that thread, so one `confirm` behind a
|
|
416
|
+
* driven click made the tab permanently unresponsive with no recovery from inside the session.
|
|
417
|
+
* Answering silently would trade a wedge for an invisible one, so the question the app asked, and
|
|
418
|
+
* the answer given, ride out as an event.
|
|
419
|
+
*/
|
|
420
|
+
readonly DIALOG_OPENED: "dialog.opened";
|
|
373
421
|
/** aggregated React commits over a throttle window (dev builds) — `data: { commits }`. Commit storms /
|
|
374
422
|
* wasted re-renders show up here without a per-render flood. */
|
|
375
423
|
readonly RENDER_COMMIT: "render.commit";
|
|
@@ -531,6 +579,11 @@ export declare const ActionWarning: {
|
|
|
531
579
|
* actionable. Scroll it into a clear area or dismiss the overlay on top.
|
|
532
580
|
*/
|
|
533
581
|
readonly CLICK_OCCLUDED: "target is visually occluded by another element; a real user could not click it (synthetic dispatch still delivered the event) — dismiss the overlay or scroll the target clear";
|
|
582
|
+
/**
|
|
583
|
+
* A document-key press (Escape, Tab, a modifier shortcut) was dispatched at the focused
|
|
584
|
+
* element or the document. No named target was given, so the effect must not claim one.
|
|
585
|
+
*/
|
|
586
|
+
readonly GLOBAL_PRESS: "press landed on the focused element or document — no named target was given, so this effect does not claim one";
|
|
534
587
|
};
|
|
535
588
|
export type ActionWarning = (typeof ActionWarning)[keyof typeof ActionWarning];
|
|
536
589
|
/** Failure modes when Reticle launches/drives its own browser (`reticle drive`). */
|
|
@@ -542,7 +595,7 @@ export declare const DriveErrorCode: {
|
|
|
542
595
|
export type DriveErrorCode = (typeof DriveErrorCode)[keyof typeof DriveErrorCode];
|
|
543
596
|
/** Human-facing message when the optional playwright dep is absent. */
|
|
544
597
|
export declare const DRIVE_PLAYWRIGHT_MISSING_MSG = "reticle drive needs the optional 'playwright' package \u2014 install it: pnpm add -D playwright && npx playwright install chromium";
|
|
545
|
-
/** Actions the executor can perform against a ref
|
|
598
|
+
/** Actions the executor can perform against a ref. */
|
|
546
599
|
/**
|
|
547
600
|
* The console levels an agent can filter by, DERIVED from the console EventTypes rather than
|
|
548
601
|
* retyped. `reticle_console { level }` matches by building `console.${level}`, so any list written
|
|
@@ -567,7 +620,34 @@ export declare const ActionType: {
|
|
|
567
620
|
readonly PRESS: "press";
|
|
568
621
|
readonly UPLOAD: "upload";
|
|
569
622
|
readonly SCROLL_INTO_VIEW: "scrollIntoView";
|
|
623
|
+
/**
|
|
624
|
+
* Scroll a container (or the document) by a delta, in either axis and EITHER DIRECTION.
|
|
625
|
+
*
|
|
626
|
+
* `scrollIntoView` puts a known element on screen; this is the gesture for looking around when you
|
|
627
|
+
* do not know what you are looking for yet — back up to what scrolled past, or move sideways on a
|
|
628
|
+
* wide table. Until now the only scroll available stepped DOWN, so a page could be walked in one
|
|
629
|
+
* direction and never back, and `inspect` reported `scrollLeft`/`scrollWidth` that nothing could act on.
|
|
630
|
+
*/
|
|
631
|
+
readonly SCROLL: "scroll";
|
|
570
632
|
readonly DRAG: "drag";
|
|
633
|
+
/**
|
|
634
|
+
* A TOUCH tap: pointerdown(touch) → touchstart → touchend → pointerup → click.
|
|
635
|
+
*
|
|
636
|
+
* Not a click with another name. A handler bound to `touchstart`, or one that branches on
|
|
637
|
+
* `event.pointerType`, never runs for a mouse click — so mobile-web behaviour, swipe/press
|
|
638
|
+
* affordances and touch-only controls were undriveable. `args.holdMs` makes it a LONG PRESS, the
|
|
639
|
+
* gesture behind context menus and reorder handles on touch.
|
|
640
|
+
*/
|
|
641
|
+
readonly TAP: "tap";
|
|
642
|
+
/**
|
|
643
|
+
* Page zoom, as a fraction (1 = 100%).
|
|
644
|
+
*
|
|
645
|
+
* Real browser zoom is not scriptable from inside the page, so this needs a driven browser and
|
|
646
|
+
* REFUSES without one rather than faking it with CSS — see the note on `hover`, which refuses for
|
|
647
|
+
* the same reason. A layout that breaks at 200% is a real and common defect; a CSS transform that
|
|
648
|
+
* merely looks like zoom would report it caught while the layout viewport never changed.
|
|
649
|
+
*/
|
|
650
|
+
readonly ZOOM: "zoom";
|
|
571
651
|
readonly WEBMCP: "webmcp";
|
|
572
652
|
};
|
|
573
653
|
export type ActionType = (typeof ActionType)[keyof typeof ActionType];
|
|
@@ -603,7 +683,7 @@ export interface ComponentStateResult {
|
|
|
603
683
|
note: string;
|
|
604
684
|
};
|
|
605
685
|
}
|
|
606
|
-
/** Element states the assertion engine can check
|
|
686
|
+
/** Element states the assertion engine can check. */
|
|
607
687
|
export declare const ElementState: {
|
|
608
688
|
readonly VISIBLE: "visible";
|
|
609
689
|
readonly HIDDEN: "hidden";
|
|
@@ -623,7 +703,7 @@ export declare const ElementState: {
|
|
|
623
703
|
readonly IN_VIEWPORT: "inViewport";
|
|
624
704
|
};
|
|
625
705
|
export type ElementState = (typeof ElementState)[keyof typeof ElementState];
|
|
626
|
-
/** Query strategies, aligned with Testing Library semantics
|
|
706
|
+
/** Query strategies, aligned with Testing Library semantics. */
|
|
627
707
|
export declare const QueryBy: {
|
|
628
708
|
readonly ROLE: "role";
|
|
629
709
|
readonly TEXT: "text";
|
|
@@ -663,7 +743,7 @@ export declare const ReticleCommand: {
|
|
|
663
743
|
/**
|
|
664
744
|
* Bridge -> browser: the user's own impact record, so the HUD can show what Reticle has done for
|
|
665
745
|
* them without the page asking for it. `args: { snapshot: ImpactSnapshot }`. Local data on a
|
|
666
|
-
* local socket - it is the same file the report is stored in, not a fetch
|
|
746
|
+
* local socket - it is the same file the report is stored in, not a network fetch.
|
|
667
747
|
*/
|
|
668
748
|
readonly IMPACT: "impact";
|
|
669
749
|
/**
|
|
@@ -694,7 +774,7 @@ export declare const PresenterMode: {
|
|
|
694
774
|
readonly ACTING: "acting";
|
|
695
775
|
};
|
|
696
776
|
export type PresenterMode = (typeof PresenterMode)[keyof typeof PresenterMode];
|
|
697
|
-
/** Snapshot rendering modes
|
|
777
|
+
/** Snapshot rendering modes. */
|
|
698
778
|
export declare const SnapshotMode: {
|
|
699
779
|
readonly FULL: "full";
|
|
700
780
|
readonly INTERACTIVE: "interactive";
|
|
@@ -709,3 +789,19 @@ export declare const MessageKind: {
|
|
|
709
789
|
readonly EVENT: "event";
|
|
710
790
|
};
|
|
711
791
|
export type MessageKind = (typeof MessageKind)[keyof typeof MessageKind];
|
|
792
|
+
/**
|
|
793
|
+
* WHY a lease came back `ready: false` — the two situations that were one word.
|
|
794
|
+
*
|
|
795
|
+
* `ready: false` meant exactly one thing on the mint path: the SDK never dialled in, so the app
|
|
796
|
+
* probably does not embed `@reticlehq/core`. A REUSED lease can fail readiness a second way, and it
|
|
797
|
+
* is the opposite problem: an SDK did dial in, and has since stopped answering. The next action
|
|
798
|
+
* differs — check the install versus recover the tab — so the two get names rather than sharing a
|
|
799
|
+
* bare `false`.
|
|
800
|
+
*/
|
|
801
|
+
export declare const LeaseNotReadyReason: {
|
|
802
|
+
/** No SDK dialled in within the wait. The install is the thing to look at. */
|
|
803
|
+
readonly SDK_NEVER_DIALLED: "sdk_never_dialled";
|
|
804
|
+
/** One dialled in and stopped answering: the tab is attached but wedged. */
|
|
805
|
+
readonly SDK_STOPPED_ANSWERING: "sdk_stopped_answering";
|
|
806
|
+
};
|
|
807
|
+
export type LeaseNotReadyReason = (typeof LeaseNotReadyReason)[keyof typeof LeaseNotReadyReason];
|
|
@@ -37,6 +37,17 @@ export const STATUS_PATH = '/status';
|
|
|
37
37
|
*/
|
|
38
38
|
export const DRIVE_PATH = '/drive';
|
|
39
39
|
export const RETICLE_PROTOCOL_VERSION = 1;
|
|
40
|
+
/**
|
|
41
|
+
* The oldest protocol version this build still talks to.
|
|
42
|
+
*
|
|
43
|
+
* A range rather than a single number. An exact door refuses a peer one version out, which is
|
|
44
|
+
* correct when both sides ship together and wrong the moment anything else implements this -- an
|
|
45
|
+
* SDK a user has not upgraded yet is not an incompatible SDK.
|
|
46
|
+
*
|
|
47
|
+
* Equal to the current version today, so nothing changes yet. It exists so that raising the current
|
|
48
|
+
* version is a decision about what to keep supporting, rather than an automatic break.
|
|
49
|
+
*/
|
|
50
|
+
export const RETICLE_MIN_PROTOCOL_VERSION = 1;
|
|
40
51
|
/**
|
|
41
52
|
* The host a CLIENT names when it dials the bridge, as opposed to the address the bridge BINDS.
|
|
42
53
|
*
|
|
@@ -69,6 +80,15 @@ export function bridgeWsUrl(port = RETICLE_DEFAULT_PORT, host = RETICLE_CLIENT_H
|
|
|
69
80
|
export const RETICLE_URL_PARAM = {
|
|
70
81
|
SESSION: '__reticle_session',
|
|
71
82
|
PROJECT: '__reticle_project',
|
|
83
|
+
/**
|
|
84
|
+
* "Reticle opened this page for itself" — and nothing more.
|
|
85
|
+
*
|
|
86
|
+
* Deliberately NOT the session stamp. `resolveConnectIdentity` reads SESSION as the session id
|
|
87
|
+
* when the app names none, so marking a drive with it would rename every driven session to one
|
|
88
|
+
* shared constant and make two concurrent drives collide. This carries the one fact the page
|
|
89
|
+
* needs (nobody is sitting in front of it) without touching identity.
|
|
90
|
+
*/
|
|
91
|
+
OPENED: '__reticle_opened',
|
|
72
92
|
};
|
|
73
93
|
/** The loopback bind address. The daemon/bridge bind here by default — never expose Reticle off-host. */
|
|
74
94
|
export const LOOPBACK_HOST = '127.0.0.1';
|
|
@@ -144,6 +164,22 @@ export const ReticleEnv = {
|
|
|
144
164
|
* shortening it. A budget nobody can reach in a test is a budget nobody tests.
|
|
145
165
|
*/
|
|
146
166
|
RECONNECT_ATTEMPTS: 'RETICLE_RECONNECT_ATTEMPTS',
|
|
167
|
+
/** Quiet window before an abandoned MCP stdio proxy exits; `0` disables the watcher. */
|
|
168
|
+
MCP_PROXY_IDLE: 'RETICLE_MCP_PROXY_IDLE_MS',
|
|
169
|
+
/**
|
|
170
|
+
* API key for the harness — the model that drives the app when no coding agent is in the loop.
|
|
171
|
+
*
|
|
172
|
+
* The standard Anthropic name, on purpose: a machine that can already run a coding agent can
|
|
173
|
+
* already run the harness, with nothing to configure. Absent ⇒ the harness is simply unavailable
|
|
174
|
+
* and every other part of Reticle is unaffected.
|
|
175
|
+
*/
|
|
176
|
+
HARNESS_KEY: 'ANTHROPIC_API_KEY',
|
|
177
|
+
/** Model the harness drives with. Defaults to a small one — see `DEFAULT_HARNESS_MODEL`. */
|
|
178
|
+
HARNESS_MODEL: 'RETICLE_HARNESS_MODEL',
|
|
179
|
+
/** Base URL for the harness's model API, for a proxy or a gateway. */
|
|
180
|
+
HARNESS_BASE_URL: 'RETICLE_HARNESS_BASE_URL',
|
|
181
|
+
/** Hard ceiling on harness model turns in one drive. Bounds cost, not value. */
|
|
182
|
+
HARNESS_MAX_STEPS: 'RETICLE_HARNESS_MAX_STEPS',
|
|
147
183
|
};
|
|
148
184
|
/** Hard transport bounds shared by the browser and bridge. */
|
|
149
185
|
export const TRANSPORT_LIMITS = {
|
|
@@ -151,25 +187,17 @@ export const TRANSPORT_LIMITS = {
|
|
|
151
187
|
/**
|
|
152
188
|
* Inbound events per second before the bridge SAMPLES rather than records everything.
|
|
153
189
|
*
|
|
154
|
-
*
|
|
155
|
-
*
|
|
156
|
-
*
|
|
157
|
-
*
|
|
158
|
-
* catches false greens is blindest exactly there — but landing that on the first drive after an
|
|
159
|
-
* install, recoverable only by knowing an environment variable exists and inventing a number for
|
|
160
|
-
* it, is the worst possible place to spend the honesty.
|
|
161
|
-
*
|
|
162
|
-
* 20000 is the value that was measured to work on the page that reported it. The cap exists to stop
|
|
163
|
-
* a PATHOLOGICAL page (an animation loop firing DOM mutations every frame), not to throttle a busy
|
|
164
|
-
* one, and the ceiling it has to defend is cheap: the daemon is on the same machine and a typical
|
|
165
|
-
* event is a few hundred bytes, so this is single-digit MB/s over loopback.
|
|
190
|
+
* The cap exists to stop a PATHOLOGICAL page (an animation loop firing DOM mutations every frame),
|
|
191
|
+
* not to throttle a busy one: an ordinary React app with an active query cache passes 1000/s, and a
|
|
192
|
+
* sampled window cannot support a verdict, so too low a cap answers `unknown` with
|
|
193
|
+
* `unclean_capture` on the first `act_and_wait` after an install (#316).
|
|
166
194
|
*
|
|
167
|
-
*
|
|
168
|
-
*
|
|
169
|
-
*
|
|
170
|
-
*
|
|
171
|
-
*
|
|
172
|
-
*
|
|
195
|
+
* The ceiling it defends is cheap — the daemon is on the same machine and a typical event is a few
|
|
196
|
+
* hundred bytes, so 20000/s is single-digit MB/s over loopback. Raising it does not raise what a
|
|
197
|
+
* runaway page can make the bridge HOLD: memory is bounded independently by the ring buffer, which
|
|
198
|
+
* evicts on `RING_BUFFER_DEFAULTS.MAX_BYTES` (this same constant through that alias) as well as on
|
|
199
|
+
* a count and an age. The rate cap defends parse cost, the ring buffer defends memory, and they are
|
|
200
|
+
* not substitutes.
|
|
173
201
|
*/
|
|
174
202
|
MAX_MESSAGES_PER_SECOND: 20000,
|
|
175
203
|
MAX_SESSIONS: 32,
|
|
@@ -180,6 +208,21 @@ export const TRANSPORT_LIMITS = {
|
|
|
180
208
|
MAX_URL_LENGTH: 4096,
|
|
181
209
|
MAX_TITLE_LENGTH: 512,
|
|
182
210
|
MAX_ADAPTERS: 32,
|
|
211
|
+
/*
|
|
212
|
+
* The cap on ONE vocabulary in `contractParts` — the commands, events or actions a peer says it
|
|
213
|
+
* speaks.
|
|
214
|
+
*
|
|
215
|
+
* Its own number, and the reason is an outage this nearly shipped. `contractParts` reused
|
|
216
|
+
* `MAX_ADAPTERS` (32), and this implementation's own event vocabulary is larger than that. The
|
|
217
|
+
* field had never had a producer, so nothing had ever tried: the first build to actually send it
|
|
218
|
+
* had every HELLO rejected by the schema and NO SESSION COULD CONNECT AT ALL. The unit gate is
|
|
219
|
+
* blind to it — the schema accepts the shape in isolation, and only a real page talking to a real
|
|
220
|
+
* daemon fails — so the e2e battery is what caught it.
|
|
221
|
+
*
|
|
222
|
+
* 128 leaves the vocabularies room to roughly triple. A cap here is still worth having: this
|
|
223
|
+
* arrives on an unauthenticated HELLO, so it is an untrusted list and the bound is chosen here.
|
|
224
|
+
*/
|
|
225
|
+
MAX_CONTRACT_NAMES: 128,
|
|
183
226
|
MAX_ADAPTER_NAME_LENGTH: 128,
|
|
184
227
|
MAX_TOKEN_LENGTH: 512,
|
|
185
228
|
MAX_COMMAND_ID_LENGTH: 128,
|
|
@@ -222,8 +265,8 @@ export const ReticleDir = {
|
|
|
222
265
|
/**
|
|
223
266
|
* the user's own record of what Reticle has done for them — .reticle/impact.json.
|
|
224
267
|
*
|
|
225
|
-
* Local only, never uploaded, and deliberately NOT part of telemetry: telemetry answers
|
|
226
|
-
*
|
|
268
|
+
* Local only, never uploaded, and deliberately NOT part of telemetry: telemetry answers questions
|
|
269
|
+
* about the product; this answers the user's question about their own work.
|
|
227
270
|
*/
|
|
228
271
|
IMPACT_FILE: 'impact.json',
|
|
229
272
|
/** what changes were SUPPOSED to make true —.reticle/intent.json (git-checked, reviewed) */
|
|
@@ -266,6 +309,17 @@ export const ReticleDir = {
|
|
|
266
309
|
ISSUES_FILE: 'issues.json',
|
|
267
310
|
/** Per-flow assertion tiers recorded on each PASSING replay — the gate's anti-downgrade baseline. */
|
|
268
311
|
TIERS_FILE: 'assertion-tiers.json',
|
|
312
|
+
/**
|
|
313
|
+
* what to run when something happens — .reticle/hooks.json. Git-checked on purpose: a hook is a
|
|
314
|
+
* decision the whole team shares, the same way a git hook or a package script is, and one that
|
|
315
|
+
* only exists on the machine that wrote it is a rule nobody else is following.
|
|
316
|
+
*
|
|
317
|
+
* It names COMMANDS, so it is exactly as trusted as `package.json` scripts in the same repository
|
|
318
|
+
* and no more: opening a repo does not run them, and Reticle runs one only when the event it is
|
|
319
|
+
* attached to actually happens. The event payload is handed over on stdin, never interpolated into
|
|
320
|
+
* the command line, so a defect's own text can never become part of a command.
|
|
321
|
+
*/
|
|
322
|
+
HOOKS_FILE: 'hooks.json',
|
|
269
323
|
/**
|
|
270
324
|
* Auto-provisioned bridge pairing token, stored at ~/.reticle/pairing-token (mode 0600). Written by
|
|
271
325
|
* the daemon, read Node-side by the build plugins to inject into connect. A browser sandbox cannot
|
|
@@ -334,9 +388,7 @@ export const ContractReadError = {
|
|
|
334
388
|
MISSING: 'contract-missing', // no .reticle/contract.json on disk
|
|
335
389
|
MALFORMED: 'contract-malformed', // present but not valid JSON / fails schema
|
|
336
390
|
};
|
|
337
|
-
/**
|
|
338
|
-
export * from './flow-constants.js';
|
|
339
|
-
/** Bounds for the per-session ring buffer (see plan/02-architecture.md). */
|
|
391
|
+
/** Bounds for the per-session ring buffer. */
|
|
340
392
|
export const RING_BUFFER_DEFAULTS = {
|
|
341
393
|
MAX_EVENTS: 2000,
|
|
342
394
|
MAX_AGE_MS: 60_000,
|
|
@@ -378,6 +430,16 @@ export const EventType = {
|
|
|
378
430
|
* `data: { href }` — the URL the page asked to open, when it named one.
|
|
379
431
|
*/
|
|
380
432
|
CONTEXT_OPENED: 'context.opened',
|
|
433
|
+
/**
|
|
434
|
+
* The app opened a native `alert`/`confirm`/`prompt` while Reticle was driving it.
|
|
435
|
+
*
|
|
436
|
+
* Recorded because Reticle ANSWERS these rather than letting them block — a native dialog halts
|
|
437
|
+
* the main thread, and the SDK's own message pump is on that thread, so one `confirm` behind a
|
|
438
|
+
* driven click made the tab permanently unresponsive with no recovery from inside the session.
|
|
439
|
+
* Answering silently would trade a wedge for an invisible one, so the question the app asked, and
|
|
440
|
+
* the answer given, ride out as an event.
|
|
441
|
+
*/
|
|
442
|
+
DIALOG_OPENED: 'dialog.opened',
|
|
381
443
|
/** aggregated React commits over a throttle window (dev builds) — `data: { commits }`. Commit storms /
|
|
382
444
|
* wasted re-renders show up here without a per-render flood. */
|
|
383
445
|
RENDER_COMMIT: 'render.commit',
|
|
@@ -534,6 +596,11 @@ export const ActionWarning = {
|
|
|
534
596
|
* actionable. Scroll it into a clear area or dismiss the overlay on top.
|
|
535
597
|
*/
|
|
536
598
|
CLICK_OCCLUDED: 'target is visually occluded by another element; a real user could not click it (synthetic dispatch still delivered the event) — dismiss the overlay or scroll the target clear',
|
|
599
|
+
/**
|
|
600
|
+
* A document-key press (Escape, Tab, a modifier shortcut) was dispatched at the focused
|
|
601
|
+
* element or the document. No named target was given, so the effect must not claim one.
|
|
602
|
+
*/
|
|
603
|
+
GLOBAL_PRESS: 'press landed on the focused element or document — no named target was given, so this effect does not claim one',
|
|
537
604
|
};
|
|
538
605
|
/** Failure modes when Reticle launches/drives its own browser (`reticle drive`). */
|
|
539
606
|
export const DriveErrorCode = {
|
|
@@ -543,7 +610,7 @@ export const DriveErrorCode = {
|
|
|
543
610
|
};
|
|
544
611
|
/** Human-facing message when the optional playwright dep is absent. */
|
|
545
612
|
export const DRIVE_PLAYWRIGHT_MISSING_MSG = "reticle drive needs the optional 'playwright' package — install it: pnpm add -D playwright && npx playwright install chromium";
|
|
546
|
-
/** Actions the executor can perform against a ref
|
|
613
|
+
/** Actions the executor can perform against a ref. */
|
|
547
614
|
/**
|
|
548
615
|
* The console levels an agent can filter by, DERIVED from the console EventTypes rather than
|
|
549
616
|
* retyped. `reticle_console { level }` matches by building `console.${level}`, so any list written
|
|
@@ -573,7 +640,34 @@ export const ActionType = {
|
|
|
573
640
|
PRESS: 'press',
|
|
574
641
|
UPLOAD: 'upload',
|
|
575
642
|
SCROLL_INTO_VIEW: 'scrollIntoView',
|
|
643
|
+
/**
|
|
644
|
+
* Scroll a container (or the document) by a delta, in either axis and EITHER DIRECTION.
|
|
645
|
+
*
|
|
646
|
+
* `scrollIntoView` puts a known element on screen; this is the gesture for looking around when you
|
|
647
|
+
* do not know what you are looking for yet — back up to what scrolled past, or move sideways on a
|
|
648
|
+
* wide table. Until now the only scroll available stepped DOWN, so a page could be walked in one
|
|
649
|
+
* direction and never back, and `inspect` reported `scrollLeft`/`scrollWidth` that nothing could act on.
|
|
650
|
+
*/
|
|
651
|
+
SCROLL: 'scroll',
|
|
576
652
|
DRAG: 'drag',
|
|
653
|
+
/**
|
|
654
|
+
* A TOUCH tap: pointerdown(touch) → touchstart → touchend → pointerup → click.
|
|
655
|
+
*
|
|
656
|
+
* Not a click with another name. A handler bound to `touchstart`, or one that branches on
|
|
657
|
+
* `event.pointerType`, never runs for a mouse click — so mobile-web behaviour, swipe/press
|
|
658
|
+
* affordances and touch-only controls were undriveable. `args.holdMs` makes it a LONG PRESS, the
|
|
659
|
+
* gesture behind context menus and reorder handles on touch.
|
|
660
|
+
*/
|
|
661
|
+
TAP: 'tap',
|
|
662
|
+
/**
|
|
663
|
+
* Page zoom, as a fraction (1 = 100%).
|
|
664
|
+
*
|
|
665
|
+
* Real browser zoom is not scriptable from inside the page, so this needs a driven browser and
|
|
666
|
+
* REFUSES without one rather than faking it with CSS — see the note on `hover`, which refuses for
|
|
667
|
+
* the same reason. A layout that breaks at 200% is a real and common defect; a CSS transform that
|
|
668
|
+
* merely looks like zoom would report it caught while the layout viewport never changed.
|
|
669
|
+
*/
|
|
670
|
+
ZOOM: 'zoom',
|
|
577
671
|
WEBMCP: 'webmcp',
|
|
578
672
|
};
|
|
579
673
|
/** Why an action's settle wait ended without a real animation frame. */
|
|
@@ -585,7 +679,7 @@ export const SettleReason = {
|
|
|
585
679
|
export const ComponentStateReason = {
|
|
586
680
|
UNAVAILABLE: 'component-state-unavailable',
|
|
587
681
|
};
|
|
588
|
-
/** Element states the assertion engine can check
|
|
682
|
+
/** Element states the assertion engine can check. */
|
|
589
683
|
export const ElementState = {
|
|
590
684
|
VISIBLE: 'visible',
|
|
591
685
|
HIDDEN: 'hidden',
|
|
@@ -604,7 +698,7 @@ export const ElementState = {
|
|
|
604
698
|
*/
|
|
605
699
|
IN_VIEWPORT: 'inViewport',
|
|
606
700
|
};
|
|
607
|
-
/** Query strategies, aligned with Testing Library semantics
|
|
701
|
+
/** Query strategies, aligned with Testing Library semantics. */
|
|
608
702
|
export const QueryBy = {
|
|
609
703
|
ROLE: 'role',
|
|
610
704
|
TEXT: 'text',
|
|
@@ -643,7 +737,7 @@ export const ReticleCommand = {
|
|
|
643
737
|
/**
|
|
644
738
|
* Bridge -> browser: the user's own impact record, so the HUD can show what Reticle has done for
|
|
645
739
|
* them without the page asking for it. `args: { snapshot: ImpactSnapshot }`. Local data on a
|
|
646
|
-
* local socket - it is the same file the report is stored in, not a fetch
|
|
740
|
+
* local socket - it is the same file the report is stored in, not a network fetch.
|
|
647
741
|
*/
|
|
648
742
|
IMPACT: 'impact',
|
|
649
743
|
/**
|
|
@@ -672,7 +766,7 @@ export const PresenterMode = {
|
|
|
672
766
|
READING: 'reading',
|
|
673
767
|
ACTING: 'acting',
|
|
674
768
|
};
|
|
675
|
-
/** Snapshot rendering modes
|
|
769
|
+
/** Snapshot rendering modes. */
|
|
676
770
|
export const SnapshotMode = {
|
|
677
771
|
FULL: 'full',
|
|
678
772
|
INTERACTIVE: 'interactive',
|
|
@@ -685,3 +779,18 @@ export const MessageKind = {
|
|
|
685
779
|
COMMAND_RESULT: 'command_result',
|
|
686
780
|
EVENT: 'event',
|
|
687
781
|
};
|
|
782
|
+
/**
|
|
783
|
+
* WHY a lease came back `ready: false` — the two situations that were one word.
|
|
784
|
+
*
|
|
785
|
+
* `ready: false` meant exactly one thing on the mint path: the SDK never dialled in, so the app
|
|
786
|
+
* probably does not embed `@reticlehq/core`. A REUSED lease can fail readiness a second way, and it
|
|
787
|
+
* is the opposite problem: an SDK did dial in, and has since stopped answering. The next action
|
|
788
|
+
* differs — check the install versus recover the tab — so the two get names rather than sharing a
|
|
789
|
+
* bare `false`.
|
|
790
|
+
*/
|
|
791
|
+
export const LeaseNotReadyReason = {
|
|
792
|
+
/** No SDK dialled in within the wait. The install is the thing to look at. */
|
|
793
|
+
SDK_NEVER_DIALLED: 'sdk_never_dialled',
|
|
794
|
+
/** One dialled in and stopped answering: the tab is attached but wedged. */
|
|
795
|
+
SDK_STOPPED_ANSWERING: 'sdk_stopped_answering',
|
|
796
|
+
};
|