@reticlehq/core 3.8.2 → 3.10.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/flow-constants.d.ts +17 -0
- package/dist/artifacts/flow-constants.js +15 -0
- package/dist/artifacts/flow-results.d.ts +27 -2
- package/dist/artifacts/flow-step-tool.d.ts +17 -0
- package/dist/artifacts/flow-step-tool.js +18 -1
- package/dist/artifacts/flow-types.d.ts +59 -0
- package/dist/artifacts/flow-types.js +51 -6
- package/dist/identity/github-action.d.ts +7 -0
- package/dist/identity/github-action.js +7 -0
- package/dist/index.d.ts +5 -0
- package/dist/index.js +5 -0
- package/dist/onboarding.d.ts +60 -0
- package/dist/onboarding.js +35 -0
- package/dist/schema/event-message.json +1 -0
- package/dist/schema/event-payloads.json +47 -1
- package/dist/schema/event-type.json +1 -0
- package/dist/schema/reticle-event.json +1 -0
- package/dist/schema/reticle-message.json +1 -0
- package/dist/telemetry-refusal.d.ts +83 -0
- package/dist/telemetry-refusal.js +56 -0
- package/dist/telemetry-signals.d.ts +132 -0
- package/dist/telemetry-signals.js +68 -0
- package/dist/telemetry.d.ts +89 -4
- package/dist/telemetry.js +5 -3
- package/dist/verdict/findings.d.ts +34 -0
- package/dist/verdict/findings.js +37 -0
- package/dist/verdict/predicate.d.ts +1 -0
- package/dist/verdict/predicate.js +145 -5
- package/dist/verdict/verdict-attribution.js +1 -0
- package/dist/verdict/verified-constants.d.ts +17 -0
- package/dist/verdict/verified-constants.js +17 -0
- package/dist/wire/click-input.d.ts +26 -0
- package/dist/wire/click-input.js +65 -0
- package/dist/wire/constants/animation-command.d.ts +2 -0
- package/dist/wire/constants/animation-command.js +2 -0
- package/dist/wire/constants/console-event.d.ts +44 -0
- package/dist/wire/constants/console-event.js +44 -0
- package/dist/wire/constants/constants.d.ts +45 -0
- package/dist/wire/constants/constants.js +45 -0
- package/dist/wire/constants/determinism.d.ts +17 -0
- package/dist/wire/constants/determinism.js +17 -0
- package/dist/wire/constants/event-types.d.ts +113 -0
- package/dist/wire/constants/event-types.js +87 -0
- package/dist/wire/constants/match-args.d.ts +19 -0
- package/dist/wire/constants/match-args.js +19 -0
- package/dist/wire/constants/reticle-chrome.d.ts +12 -0
- package/dist/wire/constants/reticle-chrome.js +14 -0
- package/dist/wire/constants/session-constants.d.ts +17 -0
- package/dist/wire/constants/session-constants.js +5 -0
- package/dist/wire/event-payloads.d.ts +16 -93
- package/dist/wire/event-payloads.js +26 -72
- package/dist/wire/event-priority.js +1 -0
- package/dist/wire/global-press.d.ts +9 -2
- package/dist/wire/global-press.js +39 -12
- package/dist/wire/messages.d.ts +3 -0
- package/dist/wire/net.d.ts +39 -0
- package/dist/wire/net.js +56 -8
- package/dist/wire/redaction.d.ts +18 -0
- package/dist/wire/redaction.js +72 -0
- package/dist/wire/tool-names.d.ts +4 -0
- package/dist/wire/tool-names.js +4 -0
- package/dist/wire/types.d.ts +31 -0
- package/dist/wire/types.js +10 -0
- package/dist/words/notices.d.ts +10 -0
- package/dist/words/notices.js +19 -0
- package/package.json +1 -1
package/dist/wire/net.js
CHANGED
|
@@ -28,6 +28,16 @@ export const NetInitiator = {
|
|
|
28
28
|
* false red over favicons and fonts.
|
|
29
29
|
*/
|
|
30
30
|
DOCUMENT: 'document',
|
|
31
|
+
/**
|
|
32
|
+
* A file the SERVER sent as a download (`Content-Disposition: attachment`), seen by the driven
|
|
33
|
+
* browser's network stack.
|
|
34
|
+
*
|
|
35
|
+
* The click leaves the page as a navigation the browser turns into a download, so no patched
|
|
36
|
+
* transport in the page ever sees the response. Only a driven browser (CDP) does, and its detail
|
|
37
|
+
* had no in-page request to merge onto, so a `net` check on a working export missed. The engine
|
|
38
|
+
* records such a detail as a request with this initiator.
|
|
39
|
+
*/
|
|
40
|
+
DOWNLOAD: 'download',
|
|
31
41
|
/**
|
|
32
42
|
* The browser is LEAVING for this URL, recorded at the moment of departure.
|
|
33
43
|
*
|
|
@@ -117,8 +127,9 @@ const DEV_TOOLING_PATTERNS = Object.values(DevToolingChannel);
|
|
|
117
127
|
* exclusion is disclosed alongside the verdict.
|
|
118
128
|
*/
|
|
119
129
|
export function isDevToolingUrl(url) {
|
|
120
|
-
if (url === undefined)
|
|
130
|
+
if (url === undefined) {
|
|
121
131
|
return false;
|
|
132
|
+
}
|
|
122
133
|
return DEV_TOOLING_PATTERNS.some((pattern) => url.includes(pattern));
|
|
123
134
|
}
|
|
124
135
|
/**
|
|
@@ -133,8 +144,9 @@ const REGISTRABLE_LABELS = 2;
|
|
|
133
144
|
function hostOf(url, base) {
|
|
134
145
|
try {
|
|
135
146
|
const parsed = new URL(url, base);
|
|
136
|
-
if (!FIRST_PARTY_PROTOCOLS.includes(parsed.protocol))
|
|
147
|
+
if (!FIRST_PARTY_PROTOCOLS.includes(parsed.protocol)) {
|
|
137
148
|
return undefined;
|
|
149
|
+
}
|
|
138
150
|
return parsed.hostname.toLowerCase();
|
|
139
151
|
}
|
|
140
152
|
catch {
|
|
@@ -152,11 +164,13 @@ function hostOf(url, base) {
|
|
|
152
164
|
*/
|
|
153
165
|
function registrableDomain(host) {
|
|
154
166
|
const labels = host.split('.');
|
|
155
|
-
if (labels.length <= REGISTRABLE_LABELS)
|
|
167
|
+
if (labels.length <= REGISTRABLE_LABELS) {
|
|
156
168
|
return host;
|
|
169
|
+
}
|
|
157
170
|
// An IPv4 literal has four labels and no registrable domain — compare it whole.
|
|
158
|
-
if (/^[0-9.]+$/.test(host))
|
|
171
|
+
if (/^[0-9.]+$/.test(host)) {
|
|
159
172
|
return host;
|
|
173
|
+
}
|
|
160
174
|
return labels.slice(-REGISTRABLE_LABELS).join('.');
|
|
161
175
|
}
|
|
162
176
|
/**
|
|
@@ -178,12 +192,14 @@ function registrableDomain(host) {
|
|
|
178
192
|
* caller who cannot say which page is under test gets exactly the behaviour it had before this.
|
|
179
193
|
*/
|
|
180
194
|
export function isThirdPartyUrl(url, appUrl) {
|
|
181
|
-
if (url === undefined || appUrl === undefined)
|
|
195
|
+
if (url === undefined || appUrl === undefined) {
|
|
182
196
|
return false;
|
|
197
|
+
}
|
|
183
198
|
const target = hostOf(url, appUrl);
|
|
184
199
|
const app = hostOf(appUrl, appUrl);
|
|
185
|
-
if (target === undefined || app === undefined)
|
|
200
|
+
if (target === undefined || app === undefined) {
|
|
186
201
|
return false;
|
|
202
|
+
}
|
|
187
203
|
return registrableDomain(target) !== registrableDomain(app);
|
|
188
204
|
}
|
|
189
205
|
/**
|
|
@@ -196,8 +212,9 @@ export function isThirdPartyUrl(url, appUrl) {
|
|
|
196
212
|
* it only stops the request holding a settle window open or contradicting an unrelated claim.
|
|
197
213
|
*/
|
|
198
214
|
export function isOwnBackgroundTraffic(url, declared) {
|
|
199
|
-
if (url === undefined)
|
|
215
|
+
if (url === undefined) {
|
|
200
216
|
return false;
|
|
217
|
+
}
|
|
201
218
|
return declared.some((pattern) => url.includes(pattern));
|
|
202
219
|
}
|
|
203
220
|
/**
|
|
@@ -226,8 +243,9 @@ export const URL_RAW = 'urlRaw';
|
|
|
226
243
|
*/
|
|
227
244
|
export function urlForMatch(data) {
|
|
228
245
|
const raw = data[URL_RAW];
|
|
229
|
-
if ('string' === typeof raw && 0 < raw.length)
|
|
246
|
+
if ('string' === typeof raw && 0 < raw.length) {
|
|
230
247
|
return raw;
|
|
248
|
+
}
|
|
231
249
|
const url = data['url'];
|
|
232
250
|
return 'string' === typeof url ? url : '';
|
|
233
251
|
}
|
|
@@ -272,3 +290,33 @@ export const NEXT_ACTION_HEADER = 'Next-Action';
|
|
|
272
290
|
* that named the same action are the same write even when the body could not be read as text.
|
|
273
291
|
*/
|
|
274
292
|
export const NEXT_ACTION_FIELD = 'nextAction';
|
|
293
|
+
/**
|
|
294
|
+
* Fields the daemon writes on a network record that the document BEFORE this one made (#1944).
|
|
295
|
+
*
|
|
296
|
+
* A click can send a request and then load a new document. The old document sends its records
|
|
297
|
+
* before it unloads, but the new document connects as a new session, and every read after that
|
|
298
|
+
* reads the new session. The daemon carries the old document's network records from the last act
|
|
299
|
+
* into the new session, so a `net` check and `reticle_observe { action: "network" }` still see them.
|
|
300
|
+
*/
|
|
301
|
+
export const DepartedNetField = {
|
|
302
|
+
/**
|
|
303
|
+
* On every carried record. The record came from the document before this one. Its `t` is when
|
|
304
|
+
* the new document connected, not when the request happened, so it does not show the order of
|
|
305
|
+
* the request relative to the old document's other events.
|
|
306
|
+
*/
|
|
307
|
+
FROM_DEPARTED_DOCUMENT: 'fromDepartedDocument',
|
|
308
|
+
/**
|
|
309
|
+
* On a carried `NET_PENDING` that had no answer when its document unloaded. The answer went to a
|
|
310
|
+
* document that no longer exists, so no `NET_REQUEST` can close it. Its outcome is unknown, not
|
|
311
|
+
* absent and not failed: the server can have received it or not.
|
|
312
|
+
*/
|
|
313
|
+
PAGE_UNLOADED: 'pageUnloaded',
|
|
314
|
+
};
|
|
315
|
+
/**
|
|
316
|
+
* True when a `NET_PENDING` can never get its answer in this session: a departure (the browser left
|
|
317
|
+
* for this URL), or a request whose page unloaded before the answer arrived. Neither one is a
|
|
318
|
+
* request in flight. Every settle and in-flight decision reads this one function.
|
|
319
|
+
*/
|
|
320
|
+
export function neverAnswered(data) {
|
|
321
|
+
return (data['initiator'] === NetInitiator.NAVIGATION || true === data[DepartedNetField.PAGE_UNLOADED]);
|
|
322
|
+
}
|
package/dist/wire/redaction.d.ts
CHANGED
|
@@ -6,6 +6,24 @@
|
|
|
6
6
|
* against. Every existing caller wants `isSensitiveKey`.
|
|
7
7
|
*/
|
|
8
8
|
export declare function defaultIsSensitiveKey(key: string): boolean;
|
|
9
|
+
/**
|
|
10
|
+
* The word for a password, a PIN or a one-time code in other languages.
|
|
11
|
+
*
|
|
12
|
+
* The key rule above is English. A field's accessible name is in the language of the app, so a
|
|
13
|
+
* password field called "Пароль" was not recognised by its name. An SDK before 3.8.0 sends no
|
|
14
|
+
* secret mark, so the name is the only signal the server has for that fill.
|
|
15
|
+
*
|
|
16
|
+
* This list is for field names of recorded fills only. It is not part of the network key rule:
|
|
17
|
+
* `код` and `código` are also ordinary words in a request body ("código postal").
|
|
18
|
+
*/
|
|
19
|
+
export declare const CREDENTIAL_FIELD_WORDS: readonly ["пароль", "гасло", "contraseña", "contrasena", "mot de passe", "passwort", "kennwort", "senha", "palavra-passe", "wachtwoord", "hasło", "haslo", "heslo", "jelszó", "şifre", "sifre", "parola", "lösenord", "losenord", "adgangskode", "passord", "salasana", "κωδικός", "סיסמה", "كلمة المرور", "कूटशब्द", "पासवर्ड", "পাসওয়ার্ড", "パスワード", "密码", "密碼", "비밀번호", "mật khẩu", "kata sandi", "katalaluan", "รหัสผ่าน", "pin", "otp", "код", "código"];
|
|
20
|
+
/**
|
|
21
|
+
* Whether a field's name says that the field holds a credential, in English or another language.
|
|
22
|
+
*
|
|
23
|
+
* Use it for the name of a field that a recorded fill typed into. The network key rule stays
|
|
24
|
+
* `defaultIsSensitiveKey`.
|
|
25
|
+
*/
|
|
26
|
+
export declare function isCredentialFieldName(name: string): boolean;
|
|
9
27
|
/**
|
|
10
28
|
* An app's additions to (and subtractions from) the default rule.
|
|
11
29
|
*
|
package/dist/wire/redaction.js
CHANGED
|
@@ -42,6 +42,78 @@ const SENSITIVE_KEY = /password|passwd|passcode|pass[-_]?phrase|(?:otp|totp|mfa|
|
|
|
42
42
|
export function defaultIsSensitiveKey(key) {
|
|
43
43
|
return SENSITIVE_KEY.test(key);
|
|
44
44
|
}
|
|
45
|
+
/**
|
|
46
|
+
* The word for a password, a PIN or a one-time code in other languages.
|
|
47
|
+
*
|
|
48
|
+
* The key rule above is English. A field's accessible name is in the language of the app, so a
|
|
49
|
+
* password field called "Пароль" was not recognised by its name. An SDK before 3.8.0 sends no
|
|
50
|
+
* secret mark, so the name is the only signal the server has for that fill.
|
|
51
|
+
*
|
|
52
|
+
* This list is for field names of recorded fills only. It is not part of the network key rule:
|
|
53
|
+
* `код` and `código` are also ordinary words in a request body ("código postal").
|
|
54
|
+
*/
|
|
55
|
+
export const CREDENTIAL_FIELD_WORDS = [
|
|
56
|
+
'пароль',
|
|
57
|
+
'гасло',
|
|
58
|
+
'contraseña',
|
|
59
|
+
'contrasena',
|
|
60
|
+
'mot de passe',
|
|
61
|
+
'passwort',
|
|
62
|
+
'kennwort',
|
|
63
|
+
'senha',
|
|
64
|
+
'palavra-passe',
|
|
65
|
+
'wachtwoord',
|
|
66
|
+
'hasło',
|
|
67
|
+
'haslo',
|
|
68
|
+
'heslo',
|
|
69
|
+
'jelszó',
|
|
70
|
+
'şifre',
|
|
71
|
+
'sifre',
|
|
72
|
+
'parola',
|
|
73
|
+
'lösenord',
|
|
74
|
+
'losenord',
|
|
75
|
+
'adgangskode',
|
|
76
|
+
'passord',
|
|
77
|
+
'salasana',
|
|
78
|
+
'κωδικός',
|
|
79
|
+
'סיסמה',
|
|
80
|
+
'كلمة المرور',
|
|
81
|
+
'कूटशब्द',
|
|
82
|
+
'पासवर्ड',
|
|
83
|
+
'পাসওয়ার্ড',
|
|
84
|
+
'パスワード',
|
|
85
|
+
'密码',
|
|
86
|
+
'密碼',
|
|
87
|
+
'비밀번호',
|
|
88
|
+
'mật khẩu',
|
|
89
|
+
'kata sandi',
|
|
90
|
+
'katalaluan',
|
|
91
|
+
'รหัสผ่าน',
|
|
92
|
+
'pin',
|
|
93
|
+
'otp',
|
|
94
|
+
'код',
|
|
95
|
+
'código',
|
|
96
|
+
];
|
|
97
|
+
/**
|
|
98
|
+
* Scripts that do not put spaces between words, or that join a prefix to the word (Hebrew). A word
|
|
99
|
+
* in them also matches inside a longer label: "パスワードを入力".
|
|
100
|
+
*/
|
|
101
|
+
const NO_WORD_SPACES = /[\p{Script=Han}\p{Script=Hiragana}\p{Script=Katakana}\p{Script=Hangul}\p{Script=Thai}\p{Script=Hebrew}]/u;
|
|
102
|
+
const WORD_CHAR = '[\\p{L}\\p{M}\\p{N}]';
|
|
103
|
+
function credentialWordPattern(word) {
|
|
104
|
+
const escaped = word.replace(/[.*+?^${}()|[\]\\]/g, '\\$&').replace(/[\s-]+/g, '[\\s_-]+');
|
|
105
|
+
return NO_WORD_SPACES.test(word) ? escaped : `(?<!${WORD_CHAR})${escaped}(?!${WORD_CHAR})`;
|
|
106
|
+
}
|
|
107
|
+
const CREDENTIAL_FIELD_WORD = new RegExp(CREDENTIAL_FIELD_WORDS.map(credentialWordPattern).join('|'), 'iu');
|
|
108
|
+
/**
|
|
109
|
+
* Whether a field's name says that the field holds a credential, in English or another language.
|
|
110
|
+
*
|
|
111
|
+
* Use it for the name of a field that a recorded fill typed into. The network key rule stays
|
|
112
|
+
* `defaultIsSensitiveKey`.
|
|
113
|
+
*/
|
|
114
|
+
export function isCredentialFieldName(name) {
|
|
115
|
+
return defaultIsSensitiveKey(name) || CREDENTIAL_FIELD_WORD.test(name.normalize('NFC'));
|
|
116
|
+
}
|
|
45
117
|
function normalizeNames(values) {
|
|
46
118
|
const out = new Set();
|
|
47
119
|
for (const value of values ?? []) {
|
|
@@ -68,6 +68,8 @@ export declare const ReticleTool: {
|
|
|
68
68
|
readonly VERIFY_CHANGE: "reticle_verify_change";
|
|
69
69
|
/** drive the app with a model and SAVE what it drove, for a project with nothing to replay yet. */
|
|
70
70
|
readonly VERIFY_EXPLORE: "reticle_verify_explore";
|
|
71
|
+
/** drive two running builds the same way and list what differs, from outside the app. */
|
|
72
|
+
readonly VERIFY_COMPARE: "reticle_verify_compare";
|
|
71
73
|
/** Merged: change/flows/affected/coverage/crawl — "what is proved, and what is not". */
|
|
72
74
|
readonly INTENT: "reticle_intent";
|
|
73
75
|
/** what THIS run has established, proved, and not yet discharged — pulled when memory is gone. */
|
|
@@ -127,6 +129,8 @@ export declare const ReticleTool: {
|
|
|
127
129
|
readonly LEASE_ACQUIRE: "reticle_lease_acquire";
|
|
128
130
|
/** Release a previously leased context, freeing the pool slot. */
|
|
129
131
|
readonly LEASE_RELEASE: "reticle_lease_release";
|
|
132
|
+
/** Start, or take, JS coverage on a leased page: which code ran. */
|
|
133
|
+
readonly LEASE_COVERAGE: "reticle_lease_coverage";
|
|
130
134
|
/** Meta: discover tool definitions on demand instead of paying for all of them every turn. */
|
|
131
135
|
readonly TOOLS: "reticle_tools";
|
|
132
136
|
/** Meta: invoke any tool by name — the escape hatch that keeps a trimmed profile a trim, not a removal. */
|
package/dist/wire/tool-names.js
CHANGED
|
@@ -78,6 +78,8 @@ export const ReticleTool = {
|
|
|
78
78
|
VERIFY_CHANGE: 'reticle_verify_change',
|
|
79
79
|
/** drive the app with a model and SAVE what it drove, for a project with nothing to replay yet. */
|
|
80
80
|
VERIFY_EXPLORE: 'reticle_verify_explore',
|
|
81
|
+
/** drive two running builds the same way and list what differs, from outside the app. */
|
|
82
|
+
VERIFY_COMPARE: 'reticle_verify_compare',
|
|
81
83
|
/** Merged: change/flows/affected/coverage/crawl — "what is proved, and what is not". */
|
|
82
84
|
INTENT: 'reticle_intent',
|
|
83
85
|
/** what THIS run has established, proved, and not yet discharged — pulled when memory is gone. */
|
|
@@ -137,6 +139,8 @@ export const ReticleTool = {
|
|
|
137
139
|
LEASE_ACQUIRE: 'reticle_lease_acquire',
|
|
138
140
|
/** Release a previously leased context, freeing the pool slot. */
|
|
139
141
|
LEASE_RELEASE: 'reticle_lease_release',
|
|
142
|
+
/** Start, or take, JS coverage on a leased page: which code ran. */
|
|
143
|
+
LEASE_COVERAGE: 'reticle_lease_coverage',
|
|
140
144
|
/** Meta: discover tool definitions on demand instead of paying for all of them every turn. */
|
|
141
145
|
TOOLS: 'reticle_tools',
|
|
142
146
|
/** Meta: invoke any tool by name — the escape hatch that keeps a trimmed profile a trim, not a removal. */
|
package/dist/wire/types.d.ts
CHANGED
|
@@ -106,6 +106,13 @@ export interface MatchResult {
|
|
|
106
106
|
matched: boolean;
|
|
107
107
|
count: number;
|
|
108
108
|
elements: ElementDescriptor[];
|
|
109
|
+
/**
|
|
110
|
+
* Present, and true, only when the page honoured `MatchArg.FULL_TEXT`: each element's `text` is
|
|
111
|
+
* then the full-form reading, not the 80-character display one. A page too old to know the
|
|
112
|
+
* argument ignores it and answers with the short form, which looks exactly like a short text, so
|
|
113
|
+
* the caller needs this to tell the two apart before it judges a property on what it was given.
|
|
114
|
+
*/
|
|
115
|
+
fullText?: true;
|
|
109
116
|
/**
|
|
110
117
|
* True when a `scope` was given but resolved to nothing (the container was unmounted or the selector
|
|
111
118
|
* matched no element). The search returns zero matches WITHOUT falling back to the whole page, and
|
|
@@ -114,6 +121,12 @@ export interface MatchResult {
|
|
|
114
121
|
* confirmed absence (a false negative); both are the false-green shape this tool exists to prevent.
|
|
115
122
|
*/
|
|
116
123
|
scopeMissing?: boolean;
|
|
124
|
+
/**
|
|
125
|
+
* Present only when a CSS `scope` matched more than one element: how many it matched. The search
|
|
126
|
+
* covers every one of them. Without the count, a miss across a list of repeated items read like a
|
|
127
|
+
* miss in one item (#1663).
|
|
128
|
+
*/
|
|
129
|
+
scopeMatches?: number;
|
|
117
130
|
/**
|
|
118
131
|
* Present only when a framework error dialog (Next.js, Vite) is open over the page and a match is
|
|
119
132
|
* under it: the name of that dialog. The match is in the DOM, but a user sees only the dialog, so a
|
|
@@ -210,7 +223,23 @@ export interface QueryEmptyHint {
|
|
|
210
223
|
* technology", which have opposite fixes (#1070).
|
|
211
224
|
*/
|
|
212
225
|
ariaHiddenMatch?: boolean;
|
|
226
|
+
/**
|
|
227
|
+
* Present only when a query missed and the page has visible targets like the one asked for: up
|
|
228
|
+
* to three, ranked by role and then by name similarity. Advice for one retry, never a match.
|
|
229
|
+
*/
|
|
230
|
+
nearest?: NearestTarget[];
|
|
213
231
|
}
|
|
232
|
+
/**
|
|
233
|
+
* One target near a query that matched nothing. `name` is cut at 60 characters, and
|
|
234
|
+
* `nameTruncated` is true when it was cut.
|
|
235
|
+
*/
|
|
236
|
+
export declare const NearestTargetSchema: z.ZodObject<{
|
|
237
|
+
ref: z.ZodString;
|
|
238
|
+
role: z.ZodString;
|
|
239
|
+
name: z.ZodString;
|
|
240
|
+
nameTruncated: z.ZodOptional<z.ZodLiteral<true>>;
|
|
241
|
+
}, z.core.$strip>;
|
|
242
|
+
export type NearestTarget = z.infer<typeof NearestTargetSchema>;
|
|
214
243
|
/** Result of the QUERY command / reticle_query tool. `hint` present ONLY on zero matches. */
|
|
215
244
|
export interface QueryResult {
|
|
216
245
|
elements: ElementDescriptor[];
|
|
@@ -225,6 +254,8 @@ export interface QueryResult {
|
|
|
225
254
|
hint?: QueryEmptyHint;
|
|
226
255
|
/** See MatchResult.scopeMissing — a provided scope resolved to nothing; the search did not widen. */
|
|
227
256
|
scopeMissing?: boolean;
|
|
257
|
+
/** See MatchResult.scopeMatches — how many elements a CSS scope matched, when more than one. */
|
|
258
|
+
scopeMatches?: number;
|
|
228
259
|
}
|
|
229
260
|
/** One named flow advertised by the app (mirrors the browser CapabilityFlow). */
|
|
230
261
|
export declare const CapabilityFlowSchema: z.ZodObject<{
|
package/dist/wire/types.js
CHANGED
|
@@ -78,6 +78,16 @@ export const ElementQuerySchema = z
|
|
|
78
78
|
matchCase: z.boolean().optional(),
|
|
79
79
|
})
|
|
80
80
|
.strict();
|
|
81
|
+
/**
|
|
82
|
+
* One target near a query that matched nothing. `name` is cut at 60 characters, and
|
|
83
|
+
* `nameTruncated` is true when it was cut.
|
|
84
|
+
*/
|
|
85
|
+
export const NearestTargetSchema = z.object({
|
|
86
|
+
ref: z.string(),
|
|
87
|
+
role: z.string(),
|
|
88
|
+
name: z.string(),
|
|
89
|
+
nameTruncated: z.literal(true).optional(),
|
|
90
|
+
});
|
|
81
91
|
/** One named flow advertised by the app (mirrors the browser CapabilityFlow). */
|
|
82
92
|
export const CapabilityFlowSchema = z.object({
|
|
83
93
|
name: z.string(),
|
package/dist/words/notices.d.ts
CHANGED
|
@@ -42,6 +42,16 @@ export declare const BUFFER_EVICTION_WARNING = "event buffer evicted older event
|
|
|
42
42
|
* so the two no-session paths now agree.
|
|
43
43
|
*/
|
|
44
44
|
export declare const NO_SESSION_CONNECTED_ERROR = "no browser session connected. Two things to check: (1) your app is running with @reticlehq/browser enabled, and (2) it points at THIS daemon's port \u2014 a mismatch between the port the app dials (the build plugin's reticle({ port }), or RETICLE_PORT when the dev server started) and the daemon's port is the usual cause. Call reticle_session { action: \"list\" } for the diagnosis \u2014 it names which of these it is, and what to do next \u2014 rather than retrying this call.";
|
|
45
|
+
/**
|
|
46
|
+
* The one call that starts a session, added to every no-session refusal. `reticle_navigate` with an
|
|
47
|
+
* absolute URL opens a lease on the app when nothing is connected, so the agent does not stop at
|
|
48
|
+
* the diagnosis.
|
|
49
|
+
*/
|
|
50
|
+
export declare const NO_SESSION_NAVIGATE_FIX: string;
|
|
51
|
+
/** Said on a `reticle_navigate` result that opened a lease because no session was connected. */
|
|
52
|
+
export declare const SESSION_STARTED_NOTE: string;
|
|
53
|
+
/** A relative URL with no session: nothing names the app, so the refusal names the absolute form. */
|
|
54
|
+
export declare function relativeUrlNoSession(path: string, origin: string): string;
|
|
45
55
|
/**
|
|
46
56
|
* Explains an unconfirmed navigation that did reconnect, but at a different URL.
|
|
47
57
|
*
|
package/dist/words/notices.js
CHANGED
|
@@ -46,6 +46,25 @@ export const BUFFER_EVICTION_WARNING = 'event buffer evicted older events (age/s
|
|
|
46
46
|
* so the two no-session paths now agree.
|
|
47
47
|
*/
|
|
48
48
|
export const NO_SESSION_CONNECTED_ERROR = "no browser session connected. Two things to check: (1) your app is running with @reticlehq/browser enabled, and (2) it points at THIS daemon's port — a mismatch between the port the app dials (the build plugin's reticle({ port }), or RETICLE_PORT when the dev server started) and the daemon's port is the usual cause. Call reticle_session { action: \"list\" } for the diagnosis — it names which of these it is, and what to do next — rather than retrying this call.";
|
|
49
|
+
/**
|
|
50
|
+
* The one call that starts a session, added to every no-session refusal. `reticle_navigate` with an
|
|
51
|
+
* absolute URL opens a lease on the app when nothing is connected, so the agent does not stop at
|
|
52
|
+
* the diagnosis.
|
|
53
|
+
*/
|
|
54
|
+
export const NO_SESSION_NAVIGATE_FIX = ' To start a session now, call reticle_navigate with the absolute URL of the app, for example ' +
|
|
55
|
+
'{ url: "http://localhost:3000/" }. Reticle opens the app in its own browser tab. Nothing in ' +
|
|
56
|
+
'the project changes.';
|
|
57
|
+
/** Said on a `reticle_navigate` result that opened a lease because no session was connected. */
|
|
58
|
+
export const SESSION_STARTED_NOTE = 'No session was connected, so Reticle opened this URL in a new leased browser tab. Use the ' +
|
|
59
|
+
'sessionId of this result. Release the lease with reticle_lease { action: "release" } when you ' +
|
|
60
|
+
'are done.';
|
|
61
|
+
/** A relative URL with no session: nothing names the app, so the refusal names the absolute form. */
|
|
62
|
+
export function relativeUrlNoSession(path, origin) {
|
|
63
|
+
const absolute = new URL(path, origin).toString();
|
|
64
|
+
return (` The URL "${path}" is relative, and no tab is open to resolve it against. Call ` +
|
|
65
|
+
`reticle_navigate with the absolute URL, for example { url: "${absolute}" }, and Reticle ` +
|
|
66
|
+
'opens a session on it.');
|
|
67
|
+
}
|
|
49
68
|
/**
|
|
50
69
|
* Explains an unconfirmed navigation that did reconnect, but at a different URL.
|
|
51
70
|
*
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@reticlehq/core",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.10.0",
|
|
4
4
|
"description": "The Reticle foundation: the shared wire contract — types, zod schemas, constants, messages, and the isomorphic kernel that every Reticle package (browser SDK, server, kits, test harness) imports. Depends only on zod and open-verification.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|