@reticlehq/core 3.9.0 → 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.
Files changed (55) hide show
  1. package/dist/artifacts/flow-constants.d.ts +17 -0
  2. package/dist/artifacts/flow-constants.js +15 -0
  3. package/dist/artifacts/flow-results.d.ts +27 -2
  4. package/dist/artifacts/flow-step-tool.d.ts +17 -0
  5. package/dist/artifacts/flow-step-tool.js +18 -1
  6. package/dist/artifacts/flow-types.d.ts +59 -0
  7. package/dist/artifacts/flow-types.js +51 -6
  8. package/dist/identity/github-action.d.ts +2 -2
  9. package/dist/identity/github-action.js +1 -1
  10. package/dist/index.d.ts +3 -0
  11. package/dist/index.js +3 -0
  12. package/dist/schema/event-message.json +1 -0
  13. package/dist/schema/event-payloads.json +47 -1
  14. package/dist/schema/event-type.json +1 -0
  15. package/dist/schema/reticle-event.json +1 -0
  16. package/dist/schema/reticle-message.json +1 -0
  17. package/dist/telemetry-refusal.d.ts +82 -0
  18. package/dist/telemetry-refusal.js +49 -0
  19. package/dist/telemetry-signals.d.ts +44 -0
  20. package/dist/telemetry-signals.js +17 -0
  21. package/dist/telemetry.d.ts +45 -2
  22. package/dist/telemetry.js +1 -1
  23. package/dist/verdict/findings.d.ts +34 -0
  24. package/dist/verdict/findings.js +37 -0
  25. package/dist/verdict/predicate.d.ts +1 -0
  26. package/dist/verdict/predicate.js +26 -1
  27. package/dist/verdict/verdict-attribution.js +1 -0
  28. package/dist/verdict/verified-constants.d.ts +17 -0
  29. package/dist/verdict/verified-constants.js +17 -0
  30. package/dist/wire/click-input.d.ts +26 -0
  31. package/dist/wire/click-input.js +65 -0
  32. package/dist/wire/constants/animation-command.d.ts +2 -0
  33. package/dist/wire/constants/animation-command.js +2 -0
  34. package/dist/wire/constants/console-event.d.ts +44 -0
  35. package/dist/wire/constants/console-event.js +44 -0
  36. package/dist/wire/constants/constants.d.ts +38 -13
  37. package/dist/wire/constants/constants.js +38 -13
  38. package/dist/wire/constants/determinism.d.ts +17 -0
  39. package/dist/wire/constants/determinism.js +17 -0
  40. package/dist/wire/constants/event-types.d.ts +113 -0
  41. package/dist/wire/constants/event-types.js +87 -0
  42. package/dist/wire/event-payloads.d.ts +16 -93
  43. package/dist/wire/event-payloads.js +26 -72
  44. package/dist/wire/event-priority.js +1 -0
  45. package/dist/wire/global-press.d.ts +9 -2
  46. package/dist/wire/global-press.js +39 -12
  47. package/dist/wire/messages.d.ts +3 -0
  48. package/dist/wire/net.d.ts +39 -0
  49. package/dist/wire/net.js +56 -8
  50. package/dist/wire/redaction.d.ts +18 -0
  51. package/dist/wire/redaction.js +72 -0
  52. package/dist/wire/tool-names.d.ts +4 -0
  53. package/dist/wire/tool-names.js +4 -0
  54. package/dist/wire/types.d.ts +8 -0
  55. package/package.json +1 -1
@@ -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. */
@@ -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. */
@@ -121,6 +121,12 @@ export interface MatchResult {
121
121
  * confirmed absence (a false negative); both are the false-green shape this tool exists to prevent.
122
122
  */
123
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;
124
130
  /**
125
131
  * Present only when a framework error dialog (Next.js, Vite) is open over the page and a match is
126
132
  * under it: the name of that dialog. The match is in the DOM, but a user sees only the dialog, so a
@@ -248,6 +254,8 @@ export interface QueryResult {
248
254
  hint?: QueryEmptyHint;
249
255
  /** See MatchResult.scopeMissing — a provided scope resolved to nothing; the search did not widen. */
250
256
  scopeMissing?: boolean;
257
+ /** See MatchResult.scopeMatches — how many elements a CSS scope matched, when more than one. */
258
+ scopeMatches?: number;
251
259
  }
252
260
  /** One named flow advertised by the app (mirrors the browser CapabilityFlow). */
253
261
  export declare const CapabilityFlowSchema: z.ZodObject<{
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@reticlehq/core",
3
- "version": "3.9.0",
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",