@reticlehq/core 3.6.0 → 3.8.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 (133) hide show
  1. package/dist/activation-entry.d.ts +9 -0
  2. package/dist/activation-entry.js +9 -0
  3. package/dist/artifacts/artifacts-entry.d.ts +2 -0
  4. package/dist/artifacts/artifacts-entry.js +2 -0
  5. package/dist/artifacts/drive-script.d.ts +222 -116
  6. package/dist/artifacts/drive-script.js +24 -1
  7. package/dist/artifacts/flow-constants.d.ts +33 -0
  8. package/dist/artifacts/flow-constants.js +35 -0
  9. package/dist/artifacts/flow-expect-flat.d.ts +8 -8
  10. package/dist/artifacts/flow-results.d.ts +461 -0
  11. package/dist/artifacts/flow-results.js +1 -0
  12. package/dist/artifacts/flow-types.d.ts +177 -543
  13. package/dist/artifacts/flow-types.js +17 -2
  14. package/dist/artifacts/harness-credits.d.ts +42 -0
  15. package/dist/artifacts/harness-credits.js +72 -0
  16. package/dist/artifacts/harness-map.d.ts +98 -0
  17. package/dist/artifacts/harness-map.js +36 -0
  18. package/dist/artifacts/impact.d.ts +355 -149
  19. package/dist/artifacts/impact.js +84 -49
  20. package/dist/artifacts/journal.d.ts +81 -11
  21. package/dist/artifacts/journal.js +39 -0
  22. package/dist/artifacts/prompt-context.d.ts +12 -0
  23. package/dist/artifacts/prompt-context.js +14 -3
  24. package/dist/artifacts/screenshot-upload.d.ts +51 -0
  25. package/dist/artifacts/screenshot-upload.js +26 -0
  26. package/dist/graph/app-graph.d.ts +137 -0
  27. package/dist/graph/app-graph.js +498 -0
  28. package/dist/hooks/hook-events.d.ts +26 -26
  29. package/dist/hud-entry.d.ts +1 -0
  30. package/dist/hud-entry.js +2 -0
  31. package/dist/identity/checkout.d.ts +41 -0
  32. package/dist/identity/checkout.js +118 -0
  33. package/dist/identity/state-dir.d.ts +23 -0
  34. package/dist/identity/state-dir.js +43 -0
  35. package/dist/index.d.ts +15 -0
  36. package/dist/index.js +15 -0
  37. package/dist/onboarding.d.ts +30 -1
  38. package/dist/onboarding.js +25 -0
  39. package/dist/realm/registry.js +19 -1
  40. package/dist/registry/dev-server-registry.d.ts +2 -2
  41. package/dist/schema/command-message.json +30 -0
  42. package/dist/schema/command-name.json +3 -1
  43. package/dist/schema/event-message.json +3 -1
  44. package/dist/schema/event-payloads.json +156 -3
  45. package/dist/schema/event-type.json +3 -1
  46. package/dist/schema/hello-message.json +21 -0
  47. package/dist/schema/reticle-event.json +3 -1
  48. package/dist/schema/reticle-message.json +54 -1
  49. package/dist/telemetry-bug.d.ts +169 -0
  50. package/dist/telemetry-bug.js +123 -0
  51. package/dist/telemetry-entry.d.ts +2 -1
  52. package/dist/telemetry-entry.js +2 -1
  53. package/dist/telemetry-feedback.d.ts +16 -2
  54. package/dist/telemetry-feedback.js +19 -0
  55. package/dist/telemetry-session.d.ts +91 -2
  56. package/dist/telemetry-session.js +65 -0
  57. package/dist/telemetry-signals.d.ts +557 -0
  58. package/dist/telemetry-signals.js +225 -0
  59. package/dist/telemetry.d.ts +649 -296
  60. package/dist/telemetry.js +110 -119
  61. package/dist/verdict/check-sentence.d.ts +34 -0
  62. package/dist/verdict/check-sentence.js +228 -0
  63. package/dist/verdict/consequence.d.ts +15 -0
  64. package/dist/verdict/consequence.js +11 -0
  65. package/dist/verdict/disparity.d.ts +105 -0
  66. package/dist/verdict/disparity.js +40 -0
  67. package/dist/verdict/findings.d.ts +16 -0
  68. package/dist/verdict/findings.js +22 -0
  69. package/dist/verdict/instrumentation-coverage.d.ts +84 -0
  70. package/dist/verdict/instrumentation-coverage.js +182 -0
  71. package/dist/verdict/instrumentation-gap.d.ts +79 -0
  72. package/dist/verdict/instrumentation-gap.js +65 -1
  73. package/dist/verdict/intent.d.ts +19 -5
  74. package/dist/verdict/intent.js +13 -1
  75. package/dist/verdict/predicate-tree.d.ts +17 -0
  76. package/dist/verdict/predicate-tree.js +37 -0
  77. package/dist/verdict/predicate.d.ts +16 -1
  78. package/dist/verdict/predicate.js +188 -13
  79. package/dist/verdict/property-assertion.d.ts +2 -2
  80. package/dist/verdict/run-report.d.ts +166 -0
  81. package/dist/verdict/run-report.js +53 -0
  82. package/dist/verdict/security.d.ts +60 -1
  83. package/dist/verdict/security.js +174 -12
  84. package/dist/verdict/verification-run.d.ts +713 -68
  85. package/dist/verdict/verification-run.js +113 -0
  86. package/dist/verdict/verify-progress.d.ts +6 -6
  87. package/dist/wire/constants/constants.d.ts +69 -155
  88. package/dist/wire/constants/constants.js +78 -159
  89. package/dist/wire/constants/discovery.d.ts +4 -4
  90. package/dist/wire/constants/discovery.js +4 -4
  91. package/dist/wire/constants/event-types.d.ts +35 -1
  92. package/dist/wire/constants/event-types.js +33 -1
  93. package/dist/wire/constants/hud-controls.js +15 -5
  94. package/dist/wire/constants/hud-use.d.ts +33 -4
  95. package/dist/wire/constants/hud-use.js +30 -4
  96. package/dist/wire/constants/mcp-wire.d.ts +26 -0
  97. package/dist/wire/constants/mcp-wire.js +26 -0
  98. package/dist/wire/constants/response-body-reason.d.ts +19 -0
  99. package/dist/wire/constants/response-body-reason.js +18 -0
  100. package/dist/wire/constants/reticle-chrome.d.ts +19 -0
  101. package/dist/wire/constants/reticle-chrome.js +19 -0
  102. package/dist/wire/constants/reticle-env.d.ts +138 -0
  103. package/dist/wire/constants/reticle-env.js +138 -0
  104. package/dist/wire/constants/session-constants.d.ts +26 -2
  105. package/dist/wire/constants/session-constants.js +26 -2
  106. package/dist/wire/desktop-contract.d.ts +8 -0
  107. package/dist/wire/desktop-contract.js +11 -0
  108. package/dist/wire/event-payloads.d.ts +202 -36
  109. package/dist/wire/event-payloads.js +100 -16
  110. package/dist/wire/messages.d.ts +193 -54
  111. package/dist/wire/messages.js +25 -1
  112. package/dist/wire/narrow.d.ts +6 -0
  113. package/dist/wire/narrow.js +26 -0
  114. package/dist/wire/next-step.d.ts +90 -0
  115. package/dist/wire/next-step.js +37 -0
  116. package/dist/wire/platform-link.d.ts +84 -0
  117. package/dist/wire/platform-link.js +57 -6
  118. package/dist/wire/production/activation-ticket.d.ts +64 -0
  119. package/dist/wire/production/activation-ticket.js +148 -0
  120. package/dist/wire/production/hello-mode.d.ts +35 -0
  121. package/dist/wire/production/hello-mode.js +32 -0
  122. package/dist/wire/production/production-policy.d.ts +138 -0
  123. package/dist/wire/production/production-policy.js +133 -0
  124. package/dist/wire/tool-names.d.ts +4 -0
  125. package/dist/wire/tool-names.js +4 -0
  126. package/dist/wire/types.d.ts +90 -52
  127. package/dist/wire/types.js +5 -0
  128. package/dist/words/notices.d.ts +1 -1
  129. package/dist/words/notices.js +1 -1
  130. package/dist/words/upgrade.js +1 -1
  131. package/dist/words/writing-rule.d.ts +14 -0
  132. package/dist/words/writing-rule.js +17 -0
  133. package/package.json +5 -1
@@ -71,6 +71,12 @@ export const OnboardingSteps = {
71
71
  ],
72
72
  [OnboardingPhase.FIRST_RUN]: [
73
73
  'project_detected',
74
+ /**
75
+ * The first session call in an unwired project named a next step (`offered`) and changed no
76
+ * file. Reported `started` when it is offered, and `completed` on the agent's next call, with
77
+ * `nextFollowed`.
78
+ */
79
+ 'next_step_offered',
74
80
  /** The SDK is in the bundle. Files written is NOT this — see `app_instrumented`. */
75
81
  'instrumented',
76
82
  /** A page loaded and the SDK dialled the bridge. The half of the install nothing else can see. */
@@ -89,6 +95,15 @@ export const OnboardingSteps = {
89
95
  'verdict_produced',
90
96
  ],
91
97
  };
98
+ /**
99
+ * The next step that the first session call in an unwired project offers. `lease` checks the
100
+ * running app now and installs nothing. `init_consent` asks the user to agree to wire the app,
101
+ * when no app is up to lease.
102
+ */
103
+ export const NextStepOffered = {
104
+ LEASE: 'lease',
105
+ INIT_CONSENT: 'init_consent',
106
+ };
92
107
  /**
93
108
  * ONE event for every step of every phase, rather than an event name per step.
94
109
  *
@@ -138,4 +153,14 @@ export const OnboardingStepSchema = z.object({
138
153
  * neither: a human abandons a step, an agent's run exits.
139
154
  */
140
155
  unattended: z.boolean().optional(),
156
+ /**
157
+ * The first time this machine + project crossed this step, ever. The daemon's "first" steps are
158
+ * claimed on disk and fire once; absent on a step that is not a first, and on one reported from a
159
+ * home that could not be written (which fires once per process instead).
160
+ */
161
+ firstEver: z.boolean().optional(),
162
+ /** Only on `next_step_offered`: the step the first session call offered. */
163
+ offered: z.nativeEnum(NextStepOffered).optional(),
164
+ /** Only on a `completed` `next_step_offered`: the agent's next call did the offered step. */
165
+ nextFollowed: z.boolean().optional(),
141
166
  });
@@ -21,6 +21,7 @@
21
21
  import { Surface } from 'open-verification';
22
22
  import { AppRuntime } from '../telemetry-feedback.js';
23
23
  import { PlatformProfile } from '../wire/platform.js';
24
+ import { RETICLE_URL_PARAM } from '../wire/constants/constants.js';
24
25
  /**
25
26
  * Every realm Reticle knows about.
26
27
  *
@@ -166,9 +167,26 @@ export function subjectOf(facts) {
166
167
  // first document is known, never as a substitute for one.
167
168
  instance: facts.currentDocumentId ?? facts.id,
168
169
  ...(epoch === undefined ? {} : { epoch }),
169
- locator: facts.url,
170
+ // The app's address: the marks Reticle puts on a tab to adopt it are not part of it.
171
+ locator: withoutReticleMarks(facts.url),
170
172
  };
171
173
  }
174
+ const RETICLE_MARKS = new Set(Object.values(RETICLE_URL_PARAM));
175
+ /** `url` without Reticle's own query params; returned as given when it does not parse. */
176
+ function withoutReticleMarks(url) {
177
+ try {
178
+ const parsed = new URL(url);
179
+ if (![...parsed.searchParams.keys()].some((key) => RETICLE_MARKS.has(key)))
180
+ return url;
181
+ for (const key of [...parsed.searchParams.keys()])
182
+ if (RETICLE_MARKS.has(key))
183
+ parsed.searchParams.delete(key);
184
+ return parsed.href;
185
+ }
186
+ catch {
187
+ return url;
188
+ }
189
+ }
172
190
  /**
173
191
  * Which realm a project on disk is, judged only by its markers.
174
192
  *
@@ -33,18 +33,18 @@ export declare const DevServerEntrySchema: z.ZodObject<{
33
33
  projectId: z.ZodOptional<z.ZodString>;
34
34
  }, "strip", z.ZodTypeAny, {
35
35
  url: string;
36
+ root: string;
36
37
  port: number;
37
38
  pid: number;
38
39
  startedAt: number;
39
- root: string;
40
40
  projectId?: string | undefined;
41
41
  sdkVersion?: string | undefined;
42
42
  }, {
43
43
  url: string;
44
+ root: string;
44
45
  port: number;
45
46
  pid: number;
46
47
  startedAt: number;
47
- root: string;
48
48
  projectId?: string | undefined;
49
49
  sdkVersion?: string | undefined;
50
50
  }>;
@@ -33,6 +33,36 @@
33
33
  "enum": [
34
34
  "harness"
35
35
  ]
36
+ },
37
+ "outward": {
38
+ "type": "object",
39
+ "properties": {
40
+ "allowed": {
41
+ "type": "array",
42
+ "items": {
43
+ "type": "string",
44
+ "enum": [
45
+ "invite",
46
+ "send",
47
+ "share",
48
+ "delete",
49
+ "pay",
50
+ "publish",
51
+ "revoke",
52
+ "transfer",
53
+ "sign out",
54
+ "change role",
55
+ "create key",
56
+ "change state"
57
+ ]
58
+ },
59
+ "maxItems": 16
60
+ }
61
+ },
62
+ "required": [
63
+ "allowed"
64
+ ],
65
+ "additionalProperties": false
36
66
  }
37
67
  },
38
68
  "required": [
@@ -21,11 +21,13 @@
21
21
  "presenter",
22
22
  "impact",
23
23
  "capture",
24
+ "render",
24
25
  "navigate",
25
26
  "refresh",
26
27
  "flows",
27
28
  "flow.progress",
28
- "plan"
29
+ "plan",
30
+ "markers"
29
31
  ]
30
32
  }
31
33
  },
@@ -55,7 +55,9 @@
55
55
  "human.control",
56
56
  "human.mark",
57
57
  "download",
58
- "hud.used"
58
+ "hud.used",
59
+ "media.state",
60
+ "canvas.digest"
59
61
  ]
60
62
  },
61
63
  "sessionId": {
@@ -57,6 +57,12 @@
57
57
  },
58
58
  "old": {
59
59
  "type": "string"
60
+ },
61
+ "testid": {
62
+ "type": "string"
63
+ },
64
+ "initial": {
65
+ "type": "boolean"
60
66
  }
61
67
  },
62
68
  "required": [
@@ -219,6 +225,22 @@
219
225
  },
220
226
  "at": {
221
227
  "type": "number"
228
+ },
229
+ "shifted": {
230
+ "type": "object",
231
+ "properties": {
232
+ "ref": {
233
+ "type": "string"
234
+ },
235
+ "selector": {
236
+ "type": "string"
237
+ }
238
+ },
239
+ "required": [
240
+ "ref",
241
+ "selector"
242
+ ],
243
+ "additionalProperties": false
222
244
  }
223
245
  },
224
246
  "required": [
@@ -246,6 +268,17 @@
246
268
  },
247
269
  "hash": {
248
270
  "type": "string"
271
+ },
272
+ "how": {
273
+ "type": "string",
274
+ "enum": [
275
+ "push",
276
+ "replace",
277
+ "pop"
278
+ ]
279
+ },
280
+ "pattern": {
281
+ "type": "string"
249
282
  }
250
283
  },
251
284
  "required": [
@@ -253,7 +286,8 @@
253
286
  "to",
254
287
  "pathname",
255
288
  "search",
256
- "hash"
289
+ "hash",
290
+ "how"
257
291
  ],
258
292
  "additionalProperties": false,
259
293
  "$schema": "http://json-schema.org/draft-07/schema#"
@@ -607,7 +641,8 @@
607
641
  "type": "string",
608
642
  "enum": [
609
643
  "input",
610
- "change"
644
+ "change",
645
+ "settled"
611
646
  ]
612
647
  },
613
648
  "length": {
@@ -620,6 +655,15 @@
620
655
  "redacted": {
621
656
  "type": "boolean",
622
657
  "const": true
658
+ },
659
+ "checked": {
660
+ "type": "boolean"
661
+ },
662
+ "previous": {
663
+ "type": "string"
664
+ },
665
+ "previousChecked": {
666
+ "type": "boolean"
623
667
  }
624
668
  },
625
669
  "required": [
@@ -768,7 +812,10 @@
768
812
  "replay",
769
813
  "sync",
770
814
  "signin",
771
- "harness"
815
+ "harness",
816
+ "harness-run",
817
+ "harness-stop",
818
+ "harness-link"
772
819
  ]
773
820
  },
774
821
  "text": {
@@ -866,18 +913,124 @@
866
913
  "chat",
867
914
  "flows",
868
915
  "notes",
916
+ "harness",
869
917
  "settings",
870
918
  "report",
919
+ "account",
871
920
  "none"
872
921
  ]
873
922
  },
874
923
  "slide": {
875
924
  "type": "string",
876
925
  "maxLength": 56
926
+ },
927
+ "prompt": {
928
+ "type": "string",
929
+ "enum": [
930
+ "rail",
931
+ "harness",
932
+ "header"
933
+ ]
877
934
  }
878
935
  },
879
936
  "additionalProperties": false,
880
937
  "$schema": "http://json-schema.org/draft-07/schema#"
938
+ },
939
+ "media.state": {
940
+ "type": "object",
941
+ "properties": {
942
+ "event": {
943
+ "type": "string",
944
+ "enum": [
945
+ "play",
946
+ "playing",
947
+ "pause",
948
+ "seeked",
949
+ "ended",
950
+ "loadeddata",
951
+ "canplay",
952
+ "waiting",
953
+ "error"
954
+ ]
955
+ },
956
+ "tag": {
957
+ "type": "string",
958
+ "enum": [
959
+ "video",
960
+ "audio"
961
+ ]
962
+ },
963
+ "currentTime": {
964
+ "type": "number"
965
+ },
966
+ "duration": {
967
+ "type": "number"
968
+ },
969
+ "readyState": {
970
+ "type": "integer",
971
+ "minimum": 0,
972
+ "maximum": 4
973
+ },
974
+ "paused": {
975
+ "type": "boolean"
976
+ }
977
+ },
978
+ "required": [
979
+ "event",
980
+ "tag",
981
+ "currentTime",
982
+ "readyState",
983
+ "paused"
984
+ ],
985
+ "additionalProperties": false,
986
+ "$schema": "http://json-schema.org/draft-07/schema#"
987
+ },
988
+ "canvas.digest": {
989
+ "type": "object",
990
+ "properties": {
991
+ "digest": {
992
+ "type": "string"
993
+ },
994
+ "width": {
995
+ "type": "integer",
996
+ "minimum": 0
997
+ },
998
+ "height": {
999
+ "type": "integer",
1000
+ "minimum": 0
1001
+ },
1002
+ "mean": {
1003
+ "type": "array",
1004
+ "minItems": 3,
1005
+ "maxItems": 3,
1006
+ "items": [
1007
+ {
1008
+ "type": "number"
1009
+ },
1010
+ {
1011
+ "type": "number"
1012
+ },
1013
+ {
1014
+ "type": "number"
1015
+ }
1016
+ ]
1017
+ },
1018
+ "trigger": {
1019
+ "type": "string",
1020
+ "enum": [
1021
+ "poll",
1022
+ "act"
1023
+ ]
1024
+ }
1025
+ },
1026
+ "required": [
1027
+ "digest",
1028
+ "width",
1029
+ "height",
1030
+ "mean"
1031
+ ],
1032
+ "additionalProperties": false,
1033
+ "$schema": "http://json-schema.org/draft-07/schema#"
881
1034
  }
882
1035
  }
883
1036
  }
@@ -42,7 +42,9 @@
42
42
  "human.control",
43
43
  "human.mark",
44
44
  "download",
45
- "hud.used"
45
+ "hud.used",
46
+ "media.state",
47
+ "canvas.digest"
46
48
  ]
47
49
  }
48
50
  },
@@ -41,6 +41,20 @@
41
41
  "type": "string",
42
42
  "maxLength": 512
43
43
  },
44
+ "env": {
45
+ "type": "string",
46
+ "enum": [
47
+ "development",
48
+ "production"
49
+ ]
50
+ },
51
+ "scope": {
52
+ "type": "string",
53
+ "enum": [
54
+ "observe",
55
+ "act"
56
+ ]
57
+ },
44
58
  "platform": {
45
59
  "type": "string",
46
60
  "enum": [
@@ -117,6 +131,13 @@
117
131
  "sourceMapping": {
118
132
  "type": "boolean"
119
133
  },
134
+ "instrumentation": {
135
+ "type": "string",
136
+ "enum": [
137
+ "installed",
138
+ "injected"
139
+ ]
140
+ },
120
141
  "sdkVersion": {
121
142
  "type": "string",
122
143
  "maxLength": 128
@@ -48,7 +48,9 @@
48
48
  "human.control",
49
49
  "human.mark",
50
50
  "download",
51
- "hud.used"
51
+ "hud.used",
52
+ "media.state",
53
+ "canvas.digest"
52
54
  ]
53
55
  },
54
56
  "sessionId": {
@@ -43,6 +43,20 @@
43
43
  "type": "string",
44
44
  "maxLength": 512
45
45
  },
46
+ "env": {
47
+ "type": "string",
48
+ "enum": [
49
+ "development",
50
+ "production"
51
+ ]
52
+ },
53
+ "scope": {
54
+ "type": "string",
55
+ "enum": [
56
+ "observe",
57
+ "act"
58
+ ]
59
+ },
46
60
  "platform": {
47
61
  "type": "string",
48
62
  "enum": [
@@ -119,6 +133,13 @@
119
133
  "sourceMapping": {
120
134
  "type": "boolean"
121
135
  },
136
+ "instrumentation": {
137
+ "type": "string",
138
+ "enum": [
139
+ "installed",
140
+ "injected"
141
+ ]
142
+ },
122
143
  "sdkVersion": {
123
144
  "type": "string",
124
145
  "maxLength": 128
@@ -177,6 +198,36 @@
177
198
  "enum": [
178
199
  "harness"
179
200
  ]
201
+ },
202
+ "outward": {
203
+ "type": "object",
204
+ "properties": {
205
+ "allowed": {
206
+ "type": "array",
207
+ "items": {
208
+ "type": "string",
209
+ "enum": [
210
+ "invite",
211
+ "send",
212
+ "share",
213
+ "delete",
214
+ "pay",
215
+ "publish",
216
+ "revoke",
217
+ "transfer",
218
+ "sign out",
219
+ "change role",
220
+ "create key",
221
+ "change state"
222
+ ]
223
+ },
224
+ "maxItems": 16
225
+ }
226
+ },
227
+ "required": [
228
+ "allowed"
229
+ ],
230
+ "additionalProperties": false
180
231
  }
181
232
  },
182
233
  "required": [
@@ -268,7 +319,9 @@
268
319
  "human.control",
269
320
  "human.mark",
270
321
  "download",
271
- "hud.used"
322
+ "hud.used",
323
+ "media.state",
324
+ "canvas.digest"
272
325
  ]
273
326
  },
274
327
  "sessionId": {