@reticlehq/core 3.6.0 → 3.7.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 (90) hide show
  1. package/dist/artifacts/artifacts-entry.d.ts +2 -0
  2. package/dist/artifacts/artifacts-entry.js +2 -0
  3. package/dist/artifacts/drive-script.d.ts +158 -52
  4. package/dist/artifacts/drive-script.js +24 -1
  5. package/dist/artifacts/flow-constants.d.ts +18 -0
  6. package/dist/artifacts/flow-constants.js +20 -0
  7. package/dist/artifacts/flow-results.d.ts +450 -0
  8. package/dist/artifacts/flow-results.js +1 -0
  9. package/dist/artifacts/flow-types.d.ts +25 -437
  10. package/dist/artifacts/flow-types.js +5 -2
  11. package/dist/artifacts/harness-credits.d.ts +39 -0
  12. package/dist/artifacts/harness-credits.js +69 -0
  13. package/dist/artifacts/harness-map.d.ts +98 -0
  14. package/dist/artifacts/harness-map.js +36 -0
  15. package/dist/artifacts/impact.d.ts +354 -145
  16. package/dist/artifacts/impact.js +66 -48
  17. package/dist/artifacts/journal.d.ts +56 -5
  18. package/dist/artifacts/journal.js +26 -0
  19. package/dist/artifacts/screenshot-upload.d.ts +51 -0
  20. package/dist/artifacts/screenshot-upload.js +26 -0
  21. package/dist/hooks/hook-events.d.ts +4 -4
  22. package/dist/hud-entry.d.ts +1 -0
  23. package/dist/hud-entry.js +2 -0
  24. package/dist/index.d.ts +5 -0
  25. package/dist/index.js +5 -0
  26. package/dist/onboarding.d.ts +8 -0
  27. package/dist/onboarding.js +6 -0
  28. package/dist/realm/registry.js +19 -1
  29. package/dist/schema/command-message.json +30 -0
  30. package/dist/schema/command-name.json +3 -1
  31. package/dist/schema/event-payloads.json +40 -2
  32. package/dist/schema/reticle-message.json +30 -0
  33. package/dist/telemetry-bug.d.ts +169 -0
  34. package/dist/telemetry-bug.js +123 -0
  35. package/dist/telemetry-entry.d.ts +1 -0
  36. package/dist/telemetry-entry.js +1 -0
  37. package/dist/telemetry-feedback.d.ts +2 -2
  38. package/dist/telemetry-refusal.d.ts +2 -2
  39. package/dist/telemetry-session.d.ts +74 -0
  40. package/dist/telemetry-session.js +54 -0
  41. package/dist/telemetry-signals.d.ts +339 -0
  42. package/dist/telemetry-signals.js +138 -0
  43. package/dist/telemetry.d.ts +300 -254
  44. package/dist/telemetry.js +40 -115
  45. package/dist/verdict/disparity.d.ts +105 -0
  46. package/dist/verdict/disparity.js +40 -0
  47. package/dist/verdict/findings.d.ts +6 -0
  48. package/dist/verdict/findings.js +9 -0
  49. package/dist/verdict/instrumentation-coverage.d.ts +115 -0
  50. package/dist/verdict/instrumentation-coverage.js +226 -0
  51. package/dist/verdict/instrumentation-gap.js +1 -1
  52. package/dist/verdict/intent.d.ts +19 -5
  53. package/dist/verdict/intent.js +13 -1
  54. package/dist/verdict/predicate-tree.d.ts +15 -0
  55. package/dist/verdict/predicate-tree.js +21 -0
  56. package/dist/verdict/predicate.d.ts +14 -0
  57. package/dist/verdict/predicate.js +87 -3
  58. package/dist/verdict/security.d.ts +25 -0
  59. package/dist/verdict/security.js +82 -0
  60. package/dist/verdict/verification-run.d.ts +620 -32
  61. package/dist/verdict/verification-run.js +82 -0
  62. package/dist/wire/constants/constants.d.ts +15 -16
  63. package/dist/wire/constants/constants.js +16 -17
  64. package/dist/wire/constants/hud-controls.js +17 -5
  65. package/dist/wire/constants/hud-use.d.ts +29 -4
  66. package/dist/wire/constants/hud-use.js +26 -4
  67. package/dist/wire/constants/mcp-wire.d.ts +10 -0
  68. package/dist/wire/constants/mcp-wire.js +10 -0
  69. package/dist/wire/constants/reticle-chrome.d.ts +19 -0
  70. package/dist/wire/constants/reticle-chrome.js +19 -0
  71. package/dist/wire/constants/session-constants.d.ts +15 -2
  72. package/dist/wire/constants/session-constants.js +15 -2
  73. package/dist/wire/desktop-contract.d.ts +8 -0
  74. package/dist/wire/desktop-contract.js +11 -0
  75. package/dist/wire/event-payloads.d.ts +56 -4
  76. package/dist/wire/event-payloads.js +17 -0
  77. package/dist/wire/messages.d.ts +105 -32
  78. package/dist/wire/messages.js +9 -1
  79. package/dist/wire/platform-link.d.ts +77 -0
  80. package/dist/wire/platform-link.js +45 -0
  81. package/dist/wire/tool-names.d.ts +2 -0
  82. package/dist/wire/tool-names.js +2 -0
  83. package/dist/wire/types.d.ts +19 -6
  84. package/dist/wire/types.js +5 -0
  85. package/dist/words/notices.d.ts +1 -1
  86. package/dist/words/notices.js +1 -1
  87. package/dist/words/upgrade.js +1 -1
  88. package/dist/words/writing-rule.d.ts +14 -0
  89. package/dist/words/writing-rule.js +17 -0
  90. package/package.json +1 -1
@@ -46,6 +46,21 @@ export declare const ScrollDirection: {
46
46
  readonly DOWN: "down";
47
47
  };
48
48
  export type ScrollDirection = (typeof ScrollDirection)[keyof typeof ScrollDirection];
49
+ /**
50
+ * How a `route.change` happened.
51
+ *
52
+ * `push` is `history.pushState`, `replace` is `history.replaceState`, and `pop` is the session
53
+ * history moving under the page (`popstate`, or a `hashchange` the page did not push). A
54
+ * same-pathname replace records UI state in the URL; it is not a navigation to a new view.
55
+ */
56
+ export declare const RouteChangeHow: {
57
+ readonly PUSH: "push";
58
+ readonly REPLACE: "replace";
59
+ readonly POP: "pop";
60
+ };
61
+ export type RouteChangeHow = (typeof RouteChangeHow)[keyof typeof RouteChangeHow];
62
+ /** Wire field on `route.change` carrying a `RouteChangeHow`. */
63
+ export declare const ROUTE_CHANGE_HOW_FIELD = "how";
49
64
  /**
50
65
  * The three readable client-side storage areas.
51
66
  *
@@ -368,14 +383,32 @@ export declare const EVENT_PAYLOAD_SCHEMAS: {
368
383
  }>;
369
384
  value: z.ZodNumber;
370
385
  at: z.ZodNumber;
386
+ shifted: z.ZodOptional<z.ZodObject<{
387
+ ref: z.ZodString;
388
+ selector: z.ZodString;
389
+ }, "strip", z.ZodTypeAny, {
390
+ ref: string;
391
+ selector: string;
392
+ }, {
393
+ ref: string;
394
+ selector: string;
395
+ }>>;
371
396
  }, "strip", z.ZodTypeAny, {
372
397
  value: number;
373
398
  at: number;
374
399
  metric: "lcp" | "cls" | "longtask";
400
+ shifted?: {
401
+ ref: string;
402
+ selector: string;
403
+ } | undefined;
375
404
  }, {
376
405
  value: number;
377
406
  at: number;
378
407
  metric: "lcp" | "cls" | "longtask";
408
+ shifted?: {
409
+ ref: string;
410
+ selector: string;
411
+ } | undefined;
379
412
  }>;
380
413
  "route.change": z.ZodObject<{
381
414
  from: z.ZodString;
@@ -383,16 +416,23 @@ export declare const EVENT_PAYLOAD_SCHEMAS: {
383
416
  pathname: z.ZodString;
384
417
  search: z.ZodString;
385
418
  hash: z.ZodString;
419
+ how: z.ZodNativeEnum<{
420
+ readonly PUSH: "push";
421
+ readonly REPLACE: "replace";
422
+ readonly POP: "pop";
423
+ }>;
386
424
  }, "strip", z.ZodTypeAny, {
387
425
  from: string;
388
426
  to: string;
389
427
  pathname: string;
428
+ how: "pop" | "push" | "replace";
390
429
  search: string;
391
430
  hash: string;
392
431
  }, {
393
432
  from: string;
394
433
  to: string;
395
434
  pathname: string;
435
+ how: "pop" | "push" | "replace";
396
436
  search: string;
397
437
  hash: string;
398
438
  }>;
@@ -835,13 +875,16 @@ export declare const EVENT_PAYLOAD_SCHEMAS: {
835
875
  readonly SYNC: "sync";
836
876
  readonly SIGNIN: "signin";
837
877
  readonly HARNESS: "harness";
878
+ readonly HARNESS_RUN: "harness-run";
879
+ readonly HARNESS_STOP: "harness-stop";
880
+ readonly HARNESS_LINK: "harness-link";
838
881
  }>;
839
882
  text: z.ZodOptional<z.ZodString>;
840
883
  }, "strip", z.ZodTypeAny, {
841
- kind: "message" | "harness" | "pause" | "resume" | "end" | "replay" | "sync" | "signin";
884
+ kind: "message" | "harness" | "pause" | "resume" | "end" | "replay" | "sync" | "signin" | "harness-run" | "harness-stop" | "harness-link";
842
885
  text?: string | undefined;
843
886
  }, {
844
- kind: "message" | "harness" | "pause" | "resume" | "end" | "replay" | "sync" | "signin";
887
+ kind: "message" | "harness" | "pause" | "resume" | "end" | "replay" | "sync" | "signin" | "harness-run" | "harness-stop" | "harness-link";
845
888
  text?: string | undefined;
846
889
  }>;
847
890
  "human.mark": z.ZodObject<{
@@ -901,23 +944,32 @@ export declare const EVENT_PAYLOAD_SCHEMAS: {
901
944
  readonly CHAT: "chat";
902
945
  readonly FLOWS: "flows";
903
946
  readonly NOTES: "notes";
947
+ readonly HARNESS: "harness";
904
948
  readonly SETTINGS: "settings";
905
949
  readonly REPORT: "report";
950
+ readonly ACCOUNT: "account";
906
951
  readonly NONE: "none";
907
952
  }>>;
908
953
  slide: z.ZodOptional<z.ZodString>;
954
+ prompt: z.ZodOptional<z.ZodNativeEnum<{
955
+ readonly RAIL: "rail";
956
+ readonly HARNESS: "harness";
957
+ readonly HEADER: "header";
958
+ }>>;
909
959
  }, "strip", z.ZodTypeAny, {
910
960
  control?: string | undefined;
911
961
  toggle?: "on" | "off" | undefined;
912
962
  view?: "expanded" | "bubble" | "collapsed" | undefined;
913
- panel?: "flows" | "none" | "chat" | "notes" | "settings" | "report" | undefined;
963
+ panel?: "flows" | "harness" | "none" | "chat" | "notes" | "settings" | "report" | "account" | undefined;
914
964
  slide?: string | undefined;
965
+ prompt?: "harness" | "rail" | "header" | undefined;
915
966
  }, {
916
967
  control?: string | undefined;
917
968
  toggle?: "on" | "off" | undefined;
918
969
  view?: "expanded" | "bubble" | "collapsed" | undefined;
919
- panel?: "flows" | "none" | "chat" | "notes" | "settings" | "report" | undefined;
970
+ panel?: "flows" | "harness" | "none" | "chat" | "notes" | "settings" | "report" | "account" | undefined;
920
971
  slide?: string | undefined;
972
+ prompt?: "harness" | "rail" | "header" | undefined;
921
973
  }>;
922
974
  };
923
975
  /** Narrow an event's `data` against its type's payload schema. Unknown in, typed-or-error out. */
@@ -35,6 +35,20 @@ export const StreamTransport = { SSE: 'sse', WS: 'ws', FETCH: 'fetch' };
35
35
  /** `CLOSE` pairs with `OPEN`: until it arrives, the body is still being written. */
36
36
  export const StreamDirection = { OPEN: 'open', IN: 'in', OUT: 'out', CLOSE: 'close' };
37
37
  export const ScrollDirection = { UP: 'up', DOWN: 'down' };
38
+ /**
39
+ * How a `route.change` happened.
40
+ *
41
+ * `push` is `history.pushState`, `replace` is `history.replaceState`, and `pop` is the session
42
+ * history moving under the page (`popstate`, or a `hashchange` the page did not push). A
43
+ * same-pathname replace records UI state in the URL; it is not a navigation to a new view.
44
+ */
45
+ export const RouteChangeHow = {
46
+ PUSH: 'push',
47
+ REPLACE: 'replace',
48
+ POP: 'pop',
49
+ };
50
+ /** Wire field on `route.change` carrying a `RouteChangeHow`. */
51
+ export const ROUTE_CHANGE_HOW_FIELD = 'how';
38
52
  /**
39
53
  * The three readable client-side storage areas.
40
54
  *
@@ -145,6 +159,8 @@ export const EVENT_PAYLOAD_SCHEMAS = {
145
159
  metric: z.nativeEnum(PerfMetric),
146
160
  value: z.number(),
147
161
  at: z.number(),
162
+ // CLS only: the element the shift moved most, so the value has somewhere to point (#1266).
163
+ shifted: z.object({ ref: z.string(), selector: z.string() }).optional(),
148
164
  }),
149
165
  [EventType.ROUTE_CHANGE]: z.object({
150
166
  from: z.string(),
@@ -152,6 +168,7 @@ export const EVENT_PAYLOAD_SCHEMAS = {
152
168
  pathname: z.string(),
153
169
  search: z.string(),
154
170
  hash: z.string(),
171
+ [ROUTE_CHANGE_HOW_FIELD]: z.nativeEnum(RouteChangeHow),
155
172
  }),
156
173
  [EventType.CONSOLE_LOG]: consoleSchema,
157
174
  [EventType.CONSOLE_WARN]: consoleSchema,
@@ -13,13 +13,16 @@ export declare const HumanControlDataSchema: z.ZodObject<{
13
13
  readonly SYNC: "sync";
14
14
  readonly SIGNIN: "signin";
15
15
  readonly HARNESS: "harness";
16
+ readonly HARNESS_RUN: "harness-run";
17
+ readonly HARNESS_STOP: "harness-stop";
18
+ readonly HARNESS_LINK: "harness-link";
16
19
  }>;
17
20
  text: z.ZodOptional<z.ZodString>;
18
21
  }, "strip", z.ZodTypeAny, {
19
- kind: "message" | "harness" | "pause" | "resume" | "end" | "replay" | "sync" | "signin";
22
+ kind: "message" | "harness" | "pause" | "resume" | "end" | "replay" | "sync" | "signin" | "harness-run" | "harness-stop" | "harness-link";
20
23
  text?: string | undefined;
21
24
  }, {
22
- kind: "message" | "harness" | "pause" | "resume" | "end" | "replay" | "sync" | "signin";
25
+ kind: "message" | "harness" | "pause" | "resume" | "end" | "replay" | "sync" | "signin" | "harness-run" | "harness-stop" | "harness-link";
23
26
  text?: string | undefined;
24
27
  }>;
25
28
  export type HumanControlData = z.infer<typeof HumanControlDataSchema>;
@@ -44,24 +47,34 @@ export declare const HudUseDataSchema: z.ZodObject<{
44
47
  readonly CHAT: "chat";
45
48
  readonly FLOWS: "flows";
46
49
  readonly NOTES: "notes";
50
+ readonly HARNESS: "harness";
47
51
  readonly SETTINGS: "settings";
48
52
  readonly REPORT: "report";
53
+ readonly ACCOUNT: "account";
49
54
  readonly NONE: "none";
50
55
  }>>;
51
56
  /** A rail slide that became the visible one. Its shape is checked where it is counted. */
52
57
  slide: z.ZodOptional<z.ZodString>;
58
+ /** A sign-in or link prompt became visible on this surface. */
59
+ prompt: z.ZodOptional<z.ZodNativeEnum<{
60
+ readonly RAIL: "rail";
61
+ readonly HARNESS: "harness";
62
+ readonly HEADER: "header";
63
+ }>>;
53
64
  }, "strip", z.ZodTypeAny, {
54
65
  control?: string | undefined;
55
66
  toggle?: "on" | "off" | undefined;
56
67
  view?: "expanded" | "bubble" | "collapsed" | undefined;
57
- panel?: "flows" | "none" | "chat" | "notes" | "settings" | "report" | undefined;
68
+ panel?: "flows" | "harness" | "none" | "chat" | "notes" | "settings" | "report" | "account" | undefined;
58
69
  slide?: string | undefined;
70
+ prompt?: "harness" | "rail" | "header" | undefined;
59
71
  }, {
60
72
  control?: string | undefined;
61
73
  toggle?: "on" | "off" | undefined;
62
74
  view?: "expanded" | "bubble" | "collapsed" | undefined;
63
- panel?: "flows" | "none" | "chat" | "notes" | "settings" | "report" | undefined;
75
+ panel?: "flows" | "harness" | "none" | "chat" | "notes" | "settings" | "report" | "account" | undefined;
64
76
  slide?: string | undefined;
77
+ prompt?: "harness" | "rail" | "header" | undefined;
65
78
  }>;
66
79
  export type HudUseData = z.infer<typeof HudUseDataSchema>;
67
80
  /**
@@ -210,21 +223,21 @@ export declare const ReticleEventSchema: z.ZodObject<{
210
223
  data: Record<string, unknown>;
211
224
  t: number;
212
225
  sessionId: string;
213
- editEpoch?: number | undefined;
214
226
  seq?: number | undefined;
215
- ref?: string | undefined;
216
227
  actionId?: string | undefined;
228
+ editEpoch?: number | undefined;
229
+ ref?: string | undefined;
217
230
  attribution?: "window" | undefined;
218
231
  documentId?: string | undefined;
219
232
  }, {
220
233
  type: "signal" | "dom.added" | "dom.removed" | "dom.attr" | "dom.text" | "net.request" | "net.pending" | "net.stream" | "perf" | "route.change" | "console.log" | "console.warn" | "console.error" | "console.info" | "console.debug" | "error.uncaught" | "visible.shown" | "anim.start" | "anim.end" | "scroll.position" | "reveal.shown" | "state.change" | "storage.change" | "page.health" | "context.opened" | "dialog.opened" | "render.commit" | "focus.change" | "field.change" | "flow.recorded" | "transport.overflow" | "truncated" | "blind-spot" | "sdk.failed" | "net.detail" | "human.control" | "human.mark" | "download" | "hud.used";
221
234
  t: number;
222
235
  sessionId: string;
236
+ seq?: number | undefined;
237
+ actionId?: string | undefined;
223
238
  editEpoch?: number | undefined;
224
239
  data?: Record<string, unknown> | undefined;
225
- seq?: number | undefined;
226
240
  ref?: string | undefined;
227
- actionId?: string | undefined;
228
241
  attribution?: "window" | undefined;
229
242
  documentId?: string | undefined;
230
243
  }>;
@@ -385,14 +398,14 @@ export declare const HelloMessageSchema: z.ZodObject<{
385
398
  }, "strip", z.ZodTypeAny, {
386
399
  kind: "hello";
387
400
  url: string;
401
+ adapters: string[];
388
402
  sessionId: string;
389
403
  protocolVersion: number;
390
404
  title: string;
391
- adapters: string[];
392
405
  projectId?: string | undefined;
393
406
  platform?: "native" | "web" | "webview" | "service" | undefined;
394
- token?: string | undefined;
395
407
  channels?: ("signal" | "net" | "state" | "route" | "visual" | "ui" | "log" | "storage" | "time")[] | undefined;
408
+ token?: string | undefined;
396
409
  commands?: string[] | undefined;
397
410
  contractParts?: {
398
411
  events: string[];
@@ -408,14 +421,14 @@ export declare const HelloMessageSchema: z.ZodObject<{
408
421
  }, {
409
422
  kind: "hello";
410
423
  url: string;
424
+ adapters: string[];
411
425
  sessionId: string;
412
426
  protocolVersion: number;
413
427
  title: string;
414
- adapters: string[];
415
428
  projectId?: string | undefined;
416
429
  platform?: "native" | "web" | "webview" | "service" | undefined;
417
- token?: string | undefined;
418
430
  channels?: ("signal" | "net" | "state" | "route" | "visual" | "ui" | "log" | "storage" | "time")[] | undefined;
431
+ token?: string | undefined;
419
432
  commands?: string[] | undefined;
420
433
  contractParts?: {
421
434
  events: string[];
@@ -446,6 +459,30 @@ export declare const CommandMessageSchema: z.ZodObject<{
446
459
  by: z.ZodOptional<z.ZodNativeEnum<{
447
460
  readonly HARNESS: "harness";
448
461
  }>>;
462
+ /**
463
+ * Set on a Harness command a model chose: the outward actions (`OutwardAction`) its journey asks
464
+ * for. The page presses no other outward control. Absent: not gated (an agent, a saved flow).
465
+ */
466
+ outward: z.ZodOptional<z.ZodObject<{
467
+ allowed: z.ZodArray<z.ZodNativeEnum<{
468
+ readonly INVITE: "invite";
469
+ readonly SEND: "send";
470
+ readonly SHARE: "share";
471
+ readonly DELETE: "delete";
472
+ readonly PAY: "pay";
473
+ readonly PUBLISH: "publish";
474
+ readonly REVOKE: "revoke";
475
+ readonly TRANSFER: "transfer";
476
+ readonly SIGN_OUT: "sign out";
477
+ readonly CHANGE_ROLE: "change role";
478
+ readonly CREATE_KEY: "create key";
479
+ readonly CHANGE_STATE: "change state";
480
+ }>, "many">;
481
+ }, "strip", z.ZodTypeAny, {
482
+ allowed: ("invite" | "send" | "share" | "delete" | "pay" | "publish" | "revoke" | "transfer" | "sign out" | "change role" | "create key" | "change state")[];
483
+ }, {
484
+ allowed: ("invite" | "send" | "share" | "delete" | "pay" | "publish" | "revoke" | "transfer" | "sign out" | "change role" | "create key" | "change state")[];
485
+ }>>;
449
486
  }, "strip", z.ZodTypeAny, {
450
487
  kind: "command";
451
488
  name: string;
@@ -453,6 +490,9 @@ export declare const CommandMessageSchema: z.ZodObject<{
453
490
  args: Record<string, unknown>;
454
491
  by?: "harness" | undefined;
455
492
  sessionId?: string | undefined;
493
+ outward?: {
494
+ allowed: ("invite" | "send" | "share" | "delete" | "pay" | "publish" | "revoke" | "transfer" | "sign out" | "change role" | "create key" | "change state")[];
495
+ } | undefined;
456
496
  }, {
457
497
  kind: "command";
458
498
  name: string;
@@ -460,6 +500,9 @@ export declare const CommandMessageSchema: z.ZodObject<{
460
500
  by?: "harness" | undefined;
461
501
  args?: Record<string, unknown> | undefined;
462
502
  sessionId?: string | undefined;
503
+ outward?: {
504
+ allowed: ("invite" | "send" | "share" | "delete" | "pay" | "publish" | "revoke" | "transfer" | "sign out" | "change role" | "create key" | "change state")[];
505
+ } | undefined;
463
506
  }>;
464
507
  export type CommandMessage = z.infer<typeof CommandMessageSchema>;
465
508
  /** Browser -> agent reply to a command. */
@@ -571,21 +614,21 @@ export declare const EventMessageSchema: z.ZodObject<{
571
614
  data: Record<string, unknown>;
572
615
  t: number;
573
616
  sessionId: string;
574
- editEpoch?: number | undefined;
575
617
  seq?: number | undefined;
576
- ref?: string | undefined;
577
618
  actionId?: string | undefined;
619
+ editEpoch?: number | undefined;
620
+ ref?: string | undefined;
578
621
  attribution?: "window" | undefined;
579
622
  documentId?: string | undefined;
580
623
  }, {
581
624
  type: "signal" | "dom.added" | "dom.removed" | "dom.attr" | "dom.text" | "net.request" | "net.pending" | "net.stream" | "perf" | "route.change" | "console.log" | "console.warn" | "console.error" | "console.info" | "console.debug" | "error.uncaught" | "visible.shown" | "anim.start" | "anim.end" | "scroll.position" | "reveal.shown" | "state.change" | "storage.change" | "page.health" | "context.opened" | "dialog.opened" | "render.commit" | "focus.change" | "field.change" | "flow.recorded" | "transport.overflow" | "truncated" | "blind-spot" | "sdk.failed" | "net.detail" | "human.control" | "human.mark" | "download" | "hud.used";
582
625
  t: number;
583
626
  sessionId: string;
627
+ seq?: number | undefined;
628
+ actionId?: string | undefined;
584
629
  editEpoch?: number | undefined;
585
630
  data?: Record<string, unknown> | undefined;
586
- seq?: number | undefined;
587
631
  ref?: string | undefined;
588
- actionId?: string | undefined;
589
632
  attribution?: "window" | undefined;
590
633
  documentId?: string | undefined;
591
634
  }>;
@@ -596,10 +639,10 @@ export declare const EventMessageSchema: z.ZodObject<{
596
639
  data: Record<string, unknown>;
597
640
  t: number;
598
641
  sessionId: string;
599
- editEpoch?: number | undefined;
600
642
  seq?: number | undefined;
601
- ref?: string | undefined;
602
643
  actionId?: string | undefined;
644
+ editEpoch?: number | undefined;
645
+ ref?: string | undefined;
603
646
  attribution?: "window" | undefined;
604
647
  documentId?: string | undefined;
605
648
  };
@@ -609,11 +652,11 @@ export declare const EventMessageSchema: z.ZodObject<{
609
652
  type: "signal" | "dom.added" | "dom.removed" | "dom.attr" | "dom.text" | "net.request" | "net.pending" | "net.stream" | "perf" | "route.change" | "console.log" | "console.warn" | "console.error" | "console.info" | "console.debug" | "error.uncaught" | "visible.shown" | "anim.start" | "anim.end" | "scroll.position" | "reveal.shown" | "state.change" | "storage.change" | "page.health" | "context.opened" | "dialog.opened" | "render.commit" | "focus.change" | "field.change" | "flow.recorded" | "transport.overflow" | "truncated" | "blind-spot" | "sdk.failed" | "net.detail" | "human.control" | "human.mark" | "download" | "hud.used";
610
653
  t: number;
611
654
  sessionId: string;
655
+ seq?: number | undefined;
656
+ actionId?: string | undefined;
612
657
  editEpoch?: number | undefined;
613
658
  data?: Record<string, unknown> | undefined;
614
- seq?: number | undefined;
615
659
  ref?: string | undefined;
616
- actionId?: string | undefined;
617
660
  attribution?: "window" | undefined;
618
661
  documentId?: string | undefined;
619
662
  };
@@ -774,14 +817,14 @@ export declare const ReticleMessageSchema: z.ZodDiscriminatedUnion<"kind", [z.Zo
774
817
  }, "strip", z.ZodTypeAny, {
775
818
  kind: "hello";
776
819
  url: string;
820
+ adapters: string[];
777
821
  sessionId: string;
778
822
  protocolVersion: number;
779
823
  title: string;
780
- adapters: string[];
781
824
  projectId?: string | undefined;
782
825
  platform?: "native" | "web" | "webview" | "service" | undefined;
783
- token?: string | undefined;
784
826
  channels?: ("signal" | "net" | "state" | "route" | "visual" | "ui" | "log" | "storage" | "time")[] | undefined;
827
+ token?: string | undefined;
785
828
  commands?: string[] | undefined;
786
829
  contractParts?: {
787
830
  events: string[];
@@ -797,14 +840,14 @@ export declare const ReticleMessageSchema: z.ZodDiscriminatedUnion<"kind", [z.Zo
797
840
  }, {
798
841
  kind: "hello";
799
842
  url: string;
843
+ adapters: string[];
800
844
  sessionId: string;
801
845
  protocolVersion: number;
802
846
  title: string;
803
- adapters: string[];
804
847
  projectId?: string | undefined;
805
848
  platform?: "native" | "web" | "webview" | "service" | undefined;
806
- token?: string | undefined;
807
849
  channels?: ("signal" | "net" | "state" | "route" | "visual" | "ui" | "log" | "storage" | "time")[] | undefined;
850
+ token?: string | undefined;
808
851
  commands?: string[] | undefined;
809
852
  contractParts?: {
810
853
  events: string[];
@@ -827,6 +870,30 @@ export declare const ReticleMessageSchema: z.ZodDiscriminatedUnion<"kind", [z.Zo
827
870
  by: z.ZodOptional<z.ZodNativeEnum<{
828
871
  readonly HARNESS: "harness";
829
872
  }>>;
873
+ /**
874
+ * Set on a Harness command a model chose: the outward actions (`OutwardAction`) its journey asks
875
+ * for. The page presses no other outward control. Absent: not gated (an agent, a saved flow).
876
+ */
877
+ outward: z.ZodOptional<z.ZodObject<{
878
+ allowed: z.ZodArray<z.ZodNativeEnum<{
879
+ readonly INVITE: "invite";
880
+ readonly SEND: "send";
881
+ readonly SHARE: "share";
882
+ readonly DELETE: "delete";
883
+ readonly PAY: "pay";
884
+ readonly PUBLISH: "publish";
885
+ readonly REVOKE: "revoke";
886
+ readonly TRANSFER: "transfer";
887
+ readonly SIGN_OUT: "sign out";
888
+ readonly CHANGE_ROLE: "change role";
889
+ readonly CREATE_KEY: "create key";
890
+ readonly CHANGE_STATE: "change state";
891
+ }>, "many">;
892
+ }, "strip", z.ZodTypeAny, {
893
+ allowed: ("invite" | "send" | "share" | "delete" | "pay" | "publish" | "revoke" | "transfer" | "sign out" | "change role" | "create key" | "change state")[];
894
+ }, {
895
+ allowed: ("invite" | "send" | "share" | "delete" | "pay" | "publish" | "revoke" | "transfer" | "sign out" | "change role" | "create key" | "change state")[];
896
+ }>>;
830
897
  }, "strip", z.ZodTypeAny, {
831
898
  kind: "command";
832
899
  name: string;
@@ -834,6 +901,9 @@ export declare const ReticleMessageSchema: z.ZodDiscriminatedUnion<"kind", [z.Zo
834
901
  args: Record<string, unknown>;
835
902
  by?: "harness" | undefined;
836
903
  sessionId?: string | undefined;
904
+ outward?: {
905
+ allowed: ("invite" | "send" | "share" | "delete" | "pay" | "publish" | "revoke" | "transfer" | "sign out" | "change role" | "create key" | "change state")[];
906
+ } | undefined;
837
907
  }, {
838
908
  kind: "command";
839
909
  name: string;
@@ -841,6 +911,9 @@ export declare const ReticleMessageSchema: z.ZodDiscriminatedUnion<"kind", [z.Zo
841
911
  by?: "harness" | undefined;
842
912
  args?: Record<string, unknown> | undefined;
843
913
  sessionId?: string | undefined;
914
+ outward?: {
915
+ allowed: ("invite" | "send" | "share" | "delete" | "pay" | "publish" | "revoke" | "transfer" | "sign out" | "change role" | "create key" | "change state")[];
916
+ } | undefined;
844
917
  }>, z.ZodObject<{
845
918
  kind: z.ZodLiteral<"command_result">;
846
919
  id: z.ZodString;
@@ -946,21 +1019,21 @@ export declare const ReticleMessageSchema: z.ZodDiscriminatedUnion<"kind", [z.Zo
946
1019
  data: Record<string, unknown>;
947
1020
  t: number;
948
1021
  sessionId: string;
949
- editEpoch?: number | undefined;
950
1022
  seq?: number | undefined;
951
- ref?: string | undefined;
952
1023
  actionId?: string | undefined;
1024
+ editEpoch?: number | undefined;
1025
+ ref?: string | undefined;
953
1026
  attribution?: "window" | undefined;
954
1027
  documentId?: string | undefined;
955
1028
  }, {
956
1029
  type: "signal" | "dom.added" | "dom.removed" | "dom.attr" | "dom.text" | "net.request" | "net.pending" | "net.stream" | "perf" | "route.change" | "console.log" | "console.warn" | "console.error" | "console.info" | "console.debug" | "error.uncaught" | "visible.shown" | "anim.start" | "anim.end" | "scroll.position" | "reveal.shown" | "state.change" | "storage.change" | "page.health" | "context.opened" | "dialog.opened" | "render.commit" | "focus.change" | "field.change" | "flow.recorded" | "transport.overflow" | "truncated" | "blind-spot" | "sdk.failed" | "net.detail" | "human.control" | "human.mark" | "download" | "hud.used";
957
1030
  t: number;
958
1031
  sessionId: string;
1032
+ seq?: number | undefined;
1033
+ actionId?: string | undefined;
959
1034
  editEpoch?: number | undefined;
960
1035
  data?: Record<string, unknown> | undefined;
961
- seq?: number | undefined;
962
1036
  ref?: string | undefined;
963
- actionId?: string | undefined;
964
1037
  attribution?: "window" | undefined;
965
1038
  documentId?: string | undefined;
966
1039
  }>;
@@ -971,10 +1044,10 @@ export declare const ReticleMessageSchema: z.ZodDiscriminatedUnion<"kind", [z.Zo
971
1044
  data: Record<string, unknown>;
972
1045
  t: number;
973
1046
  sessionId: string;
974
- editEpoch?: number | undefined;
975
1047
  seq?: number | undefined;
976
- ref?: string | undefined;
977
1048
  actionId?: string | undefined;
1049
+ editEpoch?: number | undefined;
1050
+ ref?: string | undefined;
978
1051
  attribution?: "window" | undefined;
979
1052
  documentId?: string | undefined;
980
1053
  };
@@ -984,11 +1057,11 @@ export declare const ReticleMessageSchema: z.ZodDiscriminatedUnion<"kind", [z.Zo
984
1057
  type: "signal" | "dom.added" | "dom.removed" | "dom.attr" | "dom.text" | "net.request" | "net.pending" | "net.stream" | "perf" | "route.change" | "console.log" | "console.warn" | "console.error" | "console.info" | "console.debug" | "error.uncaught" | "visible.shown" | "anim.start" | "anim.end" | "scroll.position" | "reveal.shown" | "state.change" | "storage.change" | "page.health" | "context.opened" | "dialog.opened" | "render.commit" | "focus.change" | "field.change" | "flow.recorded" | "transport.overflow" | "truncated" | "blind-spot" | "sdk.failed" | "net.detail" | "human.control" | "human.mark" | "download" | "hud.used";
985
1058
  t: number;
986
1059
  sessionId: string;
1060
+ seq?: number | undefined;
1061
+ actionId?: string | undefined;
987
1062
  editEpoch?: number | undefined;
988
1063
  data?: Record<string, unknown> | undefined;
989
- seq?: number | undefined;
990
1064
  ref?: string | undefined;
991
- actionId?: string | undefined;
992
1065
  attribution?: "window" | undefined;
993
1066
  documentId?: string | undefined;
994
1067
  };
@@ -1,5 +1,5 @@
1
1
  import { z } from 'zod';
2
- import { HudPanel, HudToggle, HudView } from './constants/hud-use.js';
2
+ import { HudPanel, HudPromptSurface, HudToggle, HudView } from './constants/hud-use.js';
3
3
  import { EventAttribution, EventType, RETICLE_MIN_PROTOCOL_VERSION, RETICLE_PROTOCOL_VERSION, MessageKind, TRANSPORT_LIMITS, } from './constants/constants.js';
4
4
  import { HumanControlKind, MarkAnchorStrategy } from './constants/session-constants.js';
5
5
  import { MAX_WIRE_REDACT_KEYS, MAX_WIRE_REDACT_KEY_LENGTH } from './redaction.js';
@@ -7,6 +7,7 @@ import { DOCUMENT_ID_LENGTH } from '../identity/document-identity.js';
7
7
  import { NO_EDITS_OBSERVED } from '../identity/edit-epoch.js';
8
8
  import { PlatformProfile } from './platform.js';
9
9
  import { ChannelId } from './channel.js';
10
+ import { OutwardAction } from '../verdict/security.js';
10
11
  const sessionIdSchema = z.string().min(1).max(TRANSPORT_LIMITS.MAX_SESSION_ID_LENGTH);
11
12
  const refSchema = z.string().max(TRANSPORT_LIMITS.MAX_REF_LENGTH);
12
13
  const documentIdSchema = z.string().min(1).max(DOCUMENT_ID_LENGTH);
@@ -35,6 +36,8 @@ export const HudUseDataSchema = z.object({
35
36
  panel: z.nativeEnum(HudPanel).optional(),
36
37
  /** A rail slide that became the visible one. Its shape is checked where it is counted. */
37
38
  slide: z.string().max(56).optional(),
39
+ /** A sign-in or link prompt became visible on this surface. */
40
+ prompt: z.nativeEnum(HudPromptSurface).optional(),
38
41
  });
39
42
  /**
40
43
  * Human review: the narrowed payload of a HUMAN_MARK event. A human flagged a mistake pinned to an
@@ -260,6 +263,11 @@ export const CommandMessageSchema = z.object({
260
263
  args: z.record(z.unknown()).default({}),
261
264
  /** Set when the Harness sent it, so the HUD can say who is driving. */
262
265
  by: z.nativeEnum(CommandActor).optional(),
266
+ /**
267
+ * Set on a Harness command a model chose: the outward actions (`OutwardAction`) its journey asks
268
+ * for. The page presses no other outward control. Absent: not gated (an agent, a saved flow).
269
+ */
270
+ outward: z.object({ allowed: z.array(z.nativeEnum(OutwardAction)).max(16) }).optional(),
263
271
  });
264
272
  /** Browser -> agent reply to a command. */
265
273
  export const CommandResultSchema = z.object({
@@ -57,6 +57,14 @@ export interface DriveSpec {
57
57
  maxSteps?: number;
58
58
  /** Whether pictures of the page may leave the machine. */
59
59
  record?: boolean;
60
+ /** A plan the platform saved: run it as it stands instead of asking for a new one. */
61
+ plan?: string;
62
+ /**
63
+ * A person started this run (Run plan, Re-verify, Run suite) and so acknowledged the saved flows'
64
+ * own destructive steps: their replays may take them. A fresh action the model decides keeps the
65
+ * guard whatever this says.
66
+ */
67
+ confirmDangerous?: boolean;
60
68
  }
61
69
  export interface SpecIgnored {
62
70
  field: string;
@@ -159,3 +167,72 @@ export declare const LinkPath: {
159
167
  /** One turn of a tool session: results in, next calls out. */
160
168
  readonly driveSession: (id: string) => string;
161
169
  };
170
+ /**
171
+ * What a daemon adds to each local-apps report so the platform can say what an app is missing and
172
+ * why a page never connected. Every key is additive: a platform that predates one ignores it.
173
+ */
174
+ export declare const LinkReportKey: {
175
+ /** Per app: the channels its page announced in its HELLO. */
176
+ readonly CHANNELS: "channels";
177
+ /** Per app: instrumentation gaps its verdicts recorded, deduped by kind + missing, newest first. */
178
+ readonly GAPS: "gaps";
179
+ /** Per app: the framework adapters its page announced. */
180
+ readonly ADAPTERS: "adapters";
181
+ /**
182
+ * Per app: coverage capabilities that do not apply to it (`CoverageCapability` values, see
183
+ * `NotApplicableSchema`), excluded from both sides of the coverage score. Always sent, empty when
184
+ * every capability applies.
185
+ */
186
+ readonly NOT_APPLICABLE: "notApplicable";
187
+ /** Top level: dev servers listening on this machine that no Reticle page has connected from. */
188
+ readonly DEV_SERVERS: "devServers";
189
+ /** Top level: the last page handshake this daemon refused, and why. */
190
+ readonly HELLO_FAILURE: "helloFailure";
191
+ /** Top level: `.reticle` folders holding runs that never reached the platform. */
192
+ readonly UNSYNCED: "unsynced";
193
+ };
194
+ /** How many recorded gaps one app reports. */
195
+ export declare const LINK_APP_GAPS_MAX = 20;
196
+ /** One recorded instrumentation gap, as an app report carries it. */
197
+ export interface LinkAppGap {
198
+ kind: string;
199
+ missing: string;
200
+ fix: string;
201
+ seenAt: number;
202
+ }
203
+ /** A dev server listening on localhost with no connected Reticle page. */
204
+ export interface LinkDevServer {
205
+ url: string;
206
+ port: number;
207
+ }
208
+ /** The last refused page handshake: version skew, token, port or protocol, in `reason`. */
209
+ export interface LinkHelloFailure {
210
+ reason: string;
211
+ at: number;
212
+ sdkVersion?: string;
213
+ }
214
+ /** A `.reticle` folder with runs that never reached the platform. `root` is `~`-relative. */
215
+ export interface LinkUnsyncedRoot {
216
+ root: string;
217
+ runs: number;
218
+ linked: boolean;
219
+ /** The project the folder belongs to, so a board lists only its own. Absent when none is named. */
220
+ projectId?: string;
221
+ }
222
+ /**
223
+ * Markers a daemon adds to an app's `channels` beside the protocol channel ids, for the two
224
+ * capabilities no channel names. Sent only on evidence, never while the gap that names the same
225
+ * capability is recorded: absence of both reads as "not seen yet", never as covered.
226
+ */
227
+ export declare const CoverageMarker: {
228
+ /** The page carries `data-reticle-source` (the build plugin is active). */
229
+ readonly SOURCE: "source";
230
+ /** The app's snapshots show `data-testid` on its controls. */
231
+ readonly TESTID: "testid";
232
+ };
233
+ export type CoverageMarker = (typeof CoverageMarker)[keyof typeof CoverageMarker];
234
+ /**
235
+ * The file:line capability's name (`CoverageCapability.SOURCE_MAPPING` is this). Here, beside the
236
+ * markers, so a page can say it does not apply without loading the coverage rules into first load.
237
+ */
238
+ export declare const SOURCE_MAPPING_CAPABILITY = "file:line source mapping";