@reticlehq/core 3.8.0 → 3.8.2

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 (97) hide show
  1. package/dist/artifacts/drive-script.d.ts +84 -1217
  2. package/dist/artifacts/drive-script.js +1 -1
  3. package/dist/artifacts/flow-expect-flat.d.ts +8 -192
  4. package/dist/artifacts/flow-expect-flat.js +2 -2
  5. package/dist/artifacts/flow-results.d.ts +15 -0
  6. package/dist/artifacts/flow-types.d.ts +202 -2331
  7. package/dist/artifacts/flow-types.js +2 -2
  8. package/dist/artifacts/harness-map.d.ts +8 -69
  9. package/dist/artifacts/harness-map.js +1 -1
  10. package/dist/artifacts/hud-notices.d.ts +8 -82
  11. package/dist/artifacts/hud-notices.js +1 -1
  12. package/dist/artifacts/impact.d.ts +80 -1638
  13. package/dist/artifacts/impact.js +4 -4
  14. package/dist/artifacts/journal.d.ts +12 -247
  15. package/dist/artifacts/journal.js +2 -2
  16. package/dist/artifacts/prompt-context.d.ts +5 -43
  17. package/dist/artifacts/prompt-context.js +1 -1
  18. package/dist/artifacts/screenshot-upload.d.ts +3 -26
  19. package/dist/artifacts/screenshot-upload.js +1 -1
  20. package/dist/hooks/hook-events.d.ts +15 -171
  21. package/dist/hooks/hook-events.js +1 -1
  22. package/dist/index.d.ts +1 -0
  23. package/dist/index.js +1 -0
  24. package/dist/onboarding.d.ts +8 -58
  25. package/dist/onboarding.js +1 -1
  26. package/dist/registry/daemon-registry.d.ts +2 -14
  27. package/dist/registry/daemon-registry.js +1 -1
  28. package/dist/registry/dev-server-registry.d.ts +2 -31
  29. package/dist/registry/dev-server-registry.js +1 -1
  30. package/dist/registry/project-registry.d.ts +4 -32
  31. package/dist/registry/project-registry.js +1 -1
  32. package/dist/schema/command-message.json +65 -68
  33. package/dist/schema/command-name.json +29 -33
  34. package/dist/schema/command-result.json +25 -30
  35. package/dist/schema/event-message.json +104 -103
  36. package/dist/schema/event-payloads.json +142 -119
  37. package/dist/schema/event-type.json +47 -50
  38. package/dist/schema/hello-message.json +150 -154
  39. package/dist/schema/reticle-event.json +98 -96
  40. package/dist/schema/reticle-message.json +338 -333
  41. package/dist/telemetry-bug.d.ts +4 -75
  42. package/dist/telemetry-bug.js +1 -1
  43. package/dist/telemetry-feedback.d.ts +11 -99
  44. package/dist/telemetry-feedback.js +1 -1
  45. package/dist/telemetry-refusal.d.ts +4 -31
  46. package/dist/telemetry-refusal.js +1 -1
  47. package/dist/telemetry-session.d.ts +39 -633
  48. package/dist/telemetry-session.js +10 -8
  49. package/dist/telemetry-signals.d.ts +58 -151
  50. package/dist/telemetry-signals.js +12 -1
  51. package/dist/telemetry.d.ts +137 -1814
  52. package/dist/telemetry.js +1 -1
  53. package/dist/verdict/compare-source.d.ts +1 -1
  54. package/dist/verdict/compare-source.js +1 -1
  55. package/dist/verdict/disparity.d.ts +8 -56
  56. package/dist/verdict/disparity.js +1 -1
  57. package/dist/verdict/instrumentation-coverage.d.ts +3 -3
  58. package/dist/verdict/instrumentation-coverage.js +1 -1
  59. package/dist/verdict/instrumentation-gap.d.ts +3 -10
  60. package/dist/verdict/instrumentation-gap.js +1 -1
  61. package/dist/verdict/intent.d.ts +25 -224
  62. package/dist/verdict/intent.js +1 -1
  63. package/dist/verdict/predicate.d.ts +1 -1
  64. package/dist/verdict/predicate.js +5 -5
  65. package/dist/verdict/property-assertion.d.ts +23 -101
  66. package/dist/verdict/property-assertion.js +1 -1
  67. package/dist/verdict/run-report.d.ts +13 -108
  68. package/dist/verdict/run-report.js +1 -1
  69. package/dist/verdict/security.d.ts +12 -0
  70. package/dist/verdict/security.js +94 -7
  71. package/dist/verdict/verification-run.d.ts +112 -1668
  72. package/dist/verdict/verification-run.js +4 -4
  73. package/dist/verdict/verify-progress.d.ts +22 -64
  74. package/dist/verdict/verify-progress.js +1 -1
  75. package/dist/wire/click-input.d.ts +15 -0
  76. package/dist/wire/click-input.js +42 -0
  77. package/dist/wire/constants/event-types.d.ts +2 -0
  78. package/dist/wire/constants/event-types.js +2 -0
  79. package/dist/wire/constants/response-body-reason.d.ts +4 -4
  80. package/dist/wire/constants/response-body-reason.js +4 -4
  81. package/dist/wire/constants/reticle-env.d.ts +2 -0
  82. package/dist/wire/constants/reticle-env.js +2 -0
  83. package/dist/wire/event-payloads.d.ts +108 -678
  84. package/dist/wire/event-payloads.js +24 -7
  85. package/dist/wire/event-priority.js +1 -0
  86. package/dist/wire/messages.d.ts +66 -755
  87. package/dist/wire/messages.js +3 -3
  88. package/dist/wire/next-step.d.ts +11 -51
  89. package/dist/wire/next-step.js +1 -1
  90. package/dist/wire/platform-link.js +2 -2
  91. package/dist/wire/production/production-policy.d.ts +37 -83
  92. package/dist/wire/production/production-policy.js +1 -1
  93. package/dist/wire/types.d.ts +75 -698
  94. package/dist/wire/types.js +5 -5
  95. package/dist/words/upgrade.d.ts +3 -13
  96. package/dist/words/upgrade.js +1 -1
  97. package/package.json +4 -5
@@ -1,4 +1,4 @@
1
- import { z } from 'zod';
1
+ import * as z from 'zod';
2
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';
@@ -108,7 +108,7 @@ export const ReticleEventSchema = z.object({
108
108
  */
109
109
  editEpoch: z.number().int().min(NO_EDITS_OBSERVED).optional(),
110
110
  /** Event-type-specific payload. Kept open here; refined per observer at the edges. */
111
- data: z.record(z.unknown()).default({}),
111
+ data: z.record(z.string(), z.unknown()).default({}),
112
112
  });
113
113
  /** Browser announces itself to the bridge on connect. */
114
114
  export const HelloMessageSchema = z.object({
@@ -276,7 +276,7 @@ export const CommandMessageSchema = z.object({
276
276
  id: z.string().min(1).max(TRANSPORT_LIMITS.MAX_COMMAND_ID_LENGTH),
277
277
  sessionId: sessionIdSchema.optional(),
278
278
  name: z.string().min(1).max(TRANSPORT_LIMITS.MAX_COMMAND_NAME_LENGTH),
279
- args: z.record(z.unknown()).default({}),
279
+ args: z.record(z.string(), z.unknown()).default({}),
280
280
  /** Set when the Harness sent it, so the HUD can say who is driving. */
281
281
  by: z.nativeEnum(CommandActor).optional(),
282
282
  /**
@@ -5,7 +5,7 @@
5
5
  * wrote its own, the Harness refusal said `reticle connect` and the recovery beside it said
6
6
  * `npx @reticlehq/server connect`: two spellings of one command, in one answer.
7
7
  */
8
- import { z } from 'zod';
8
+ import * as z from 'zod';
9
9
  /** The command that signs a person in and links a project. The docs spell it this way. */
10
10
  export declare const CONNECT_COMMAND = "reticle connect";
11
11
  /** The refusals that say what to do next as data rather than in a sentence. */
@@ -19,67 +19,27 @@ export declare const NextWho: {
19
19
  readonly HUMAN: "human";
20
20
  readonly AGENT: "agent";
21
21
  };
22
- export declare const NextStepSchema: z.ZodDiscriminatedUnion<"who", [z.ZodObject<{
22
+ export declare const NextStepSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
23
23
  who: z.ZodLiteral<"human">;
24
24
  run: z.ZodString;
25
- }, "strip", z.ZodTypeAny, {
26
- who: "human";
27
- run: string;
28
- }, {
29
- who: "human";
30
- run: string;
31
- }>, z.ZodObject<{
25
+ }, z.core.$strip>, z.ZodObject<{
32
26
  who: z.ZodLiteral<"agent">;
33
27
  tool: z.ZodString;
34
- }, "strip", z.ZodTypeAny, {
35
- tool: string;
36
- who: "agent";
37
- }, {
38
- tool: string;
39
- who: "agent";
40
- }>]>;
28
+ }, z.core.$strip>], "who">;
41
29
  export type NextStep = z.infer<typeof NextStepSchema>;
42
30
  /** A coded refusal, as it rides on a tool's error envelope beside `error`. */
43
31
  export declare const CodedRefusalSchema: z.ZodObject<{
44
- code: z.ZodEnum<["harness_not_linked"]>;
45
- next: z.ZodArray<z.ZodDiscriminatedUnion<"who", [z.ZodObject<{
32
+ code: z.ZodEnum<{
33
+ harness_not_linked: "harness_not_linked";
34
+ }>;
35
+ next: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
46
36
  who: z.ZodLiteral<"human">;
47
37
  run: z.ZodString;
48
- }, "strip", z.ZodTypeAny, {
49
- who: "human";
50
- run: string;
51
- }, {
52
- who: "human";
53
- run: string;
54
- }>, z.ZodObject<{
38
+ }, z.core.$strip>, z.ZodObject<{
55
39
  who: z.ZodLiteral<"agent">;
56
40
  tool: z.ZodString;
57
- }, "strip", z.ZodTypeAny, {
58
- tool: string;
59
- who: "agent";
60
- }, {
61
- tool: string;
62
- who: "agent";
63
- }>]>, "many">;
64
- }, "strip", z.ZodTypeAny, {
65
- code: "harness_not_linked";
66
- next: ({
67
- who: "human";
68
- run: string;
69
- } | {
70
- tool: string;
71
- who: "agent";
72
- })[];
73
- }, {
74
- code: "harness_not_linked";
75
- next: ({
76
- who: "human";
77
- run: string;
78
- } | {
79
- tool: string;
80
- who: "agent";
81
- })[];
82
- }>;
41
+ }, z.core.$strip>], "who">>;
42
+ }, z.core.$strip>;
83
43
  export type CodedRefusal = z.infer<typeof CodedRefusalSchema>;
84
44
  /** Not linked: the person connects, or the agent drives the journey itself. */
85
45
  export declare const HARNESS_NOT_LINKED_NEXT: readonly NextStep[];
@@ -5,7 +5,7 @@
5
5
  * wrote its own, the Harness refusal said `reticle connect` and the recovery beside it said
6
6
  * `npx @reticlehq/server connect`: two spellings of one command, in one answer.
7
7
  */
8
- import { z } from 'zod';
8
+ import * as z from 'zod';
9
9
  import { ReticleTool } from './tool-names.js';
10
10
  /** The command that signs a person in and links a project. The docs spell it this way. */
11
11
  export const CONNECT_COMMAND = 'reticle connect';
@@ -18,7 +18,7 @@
18
18
  * Every arrow points out from the daemon: it asks, the platform answers. Nothing listens for the
19
19
  * platform on the person's machine.
20
20
  */
21
- import { z } from 'zod';
21
+ import * as z from 'zod';
22
22
  import { HudVisibility } from './constants/hud-use.js';
23
23
  /** Bumped only for a change an older reader would MISREAD. A new field is not one. */
24
24
  export const PLATFORM_LINK_VERSION = 1;
@@ -130,7 +130,7 @@ export const sessionAskRetryable = (status) => 500 <= status || 429 === status |
130
130
  const SessionCallSchema = z.object({
131
131
  seq: z.number().int().nonnegative(),
132
132
  tool: z.string().min(1).max(100),
133
- args: z.record(z.unknown()).default({}),
133
+ args: z.record(z.string(), z.unknown()).default({}),
134
134
  });
135
135
  /**
136
136
  * Read the platform's answer. Never throws: an answer that does not read is "done", because a drive
@@ -1,4 +1,4 @@
1
- import { z } from 'zod';
1
+ import * as z from 'zod';
2
2
  /**
3
3
  * The production action policy: what a drive on a live site may not do unless its intent says so.
4
4
  *
@@ -30,32 +30,30 @@ export type LiftableProductionRule = (typeof LIFTABLE_PRODUCTION_RULES)[number];
30
30
  * case-insensitively anywhere in the URL's pathname).
31
31
  */
32
32
  export declare const ProductionPolicyEntrySchema: z.ZodObject<{
33
- rule: z.ZodEnum<["payment or checkout", "delete a workspace or project", "revoke or rotate a key", "send an invite or email", "cancel a subscription", "change a member's role"]>;
34
- methods: z.ZodArray<z.ZodString, "many">;
35
- path: z.ZodEffects<z.ZodString, string, string>;
36
- }, "strip", z.ZodTypeAny, {
37
- path: string;
38
- rule: "payment or checkout" | "delete a workspace or project" | "revoke or rotate a key" | "send an invite or email" | "cancel a subscription" | "change a member's role";
39
- methods: string[];
40
- }, {
41
- path: string;
42
- rule: "payment or checkout" | "delete a workspace or project" | "revoke or rotate a key" | "send an invite or email" | "cancel a subscription" | "change a member's role";
43
- methods: string[];
44
- }>;
33
+ rule: z.ZodEnum<{
34
+ "payment or checkout": "payment or checkout";
35
+ "delete a workspace or project": "delete a workspace or project";
36
+ "revoke or rotate a key": "revoke or rotate a key";
37
+ "send an invite or email": "send an invite or email";
38
+ "cancel a subscription": "cancel a subscription";
39
+ "change a member's role": "change a member's role";
40
+ }>;
41
+ methods: z.ZodArray<z.ZodString>;
42
+ path: z.ZodString;
43
+ }, z.core.$strip>;
45
44
  export type ProductionPolicyEntry = z.infer<typeof ProductionPolicyEntrySchema>;
46
45
  export declare const ProductionPolicySchema: z.ZodArray<z.ZodObject<{
47
- rule: z.ZodEnum<["payment or checkout", "delete a workspace or project", "revoke or rotate a key", "send an invite or email", "cancel a subscription", "change a member's role"]>;
48
- methods: z.ZodArray<z.ZodString, "many">;
49
- path: z.ZodEffects<z.ZodString, string, string>;
50
- }, "strip", z.ZodTypeAny, {
51
- path: string;
52
- rule: "payment or checkout" | "delete a workspace or project" | "revoke or rotate a key" | "send an invite or email" | "cancel a subscription" | "change a member's role";
53
- methods: string[];
54
- }, {
55
- path: string;
56
- rule: "payment or checkout" | "delete a workspace or project" | "revoke or rotate a key" | "send an invite or email" | "cancel a subscription" | "change a member's role";
57
- methods: string[];
58
- }>, "many">;
46
+ rule: z.ZodEnum<{
47
+ "payment or checkout": "payment or checkout";
48
+ "delete a workspace or project": "delete a workspace or project";
49
+ "revoke or rotate a key": "revoke or rotate a key";
50
+ "send an invite or email": "send an invite or email";
51
+ "cancel a subscription": "cancel a subscription";
52
+ "change a member's role": "change a member's role";
53
+ }>;
54
+ methods: z.ZodArray<z.ZodString>;
55
+ path: z.ZodString;
56
+ }, z.core.$strip>>;
59
57
  /** The default list: the REST shapes of the six refused actions. A service may send its own. */
60
58
  export declare const DEFAULT_PRODUCTION_POLICY: readonly ProductionPolicyEntry[];
61
59
  /** What the refusal says. Every refusal is this sentence; nothing is a silent no-op. */
@@ -65,74 +63,30 @@ export declare const productionRefusal: (rule: ProductionRule) => string;
65
63
  export declare const PRODUCTION_TICKET_PATH = "/v1/production-mode/tickets";
66
64
  export declare const ProductionTicketRequestSchema: z.ZodObject<{
67
65
  workspaceId: z.ZodString;
68
- /** The single-use HELLO token the daemon minted for this drive. */
69
66
  nonce: z.ZodString;
70
- /** The daemon's bridge port. The service puts it in the page's bootstrap and its CSP. */
71
67
  bridgePort: z.ZodNumber;
72
- scope: z.ZodNativeEnum<{
68
+ scope: z.ZodEnum<{
73
69
  readonly OBSERVE: "observe";
74
70
  readonly ACT: "act";
75
71
  }>;
76
- /**
77
- * The site origin the lease opens: the ticket's `origin`. Optional only so an older daemon still
78
- * gets a ticket; a service that is told it binds the ticket to it rather than guessing.
79
- */
80
72
  origin: z.ZodOptional<z.ZodString>;
81
- /**
82
- * The bridge the page must dial (`ws://127.0.0.1:<port>/reticle` for the daemon's own): the
83
- * ticket's `bridge`. Optional for the same reason; absent, the service builds it from `bridgePort`.
84
- */
85
73
  bridge: z.ZodOptional<z.ZodString>;
86
- }, "strip", z.ZodTypeAny, {
87
- scope: "observe" | "act";
88
- nonce: string;
89
- workspaceId: string;
90
- bridgePort: number;
91
- origin?: string | undefined;
92
- bridge?: string | undefined;
93
- }, {
94
- scope: "observe" | "act";
95
- nonce: string;
96
- workspaceId: string;
97
- bridgePort: number;
98
- origin?: string | undefined;
99
- bridge?: string | undefined;
100
- }>;
74
+ }, z.core.$strip>;
101
75
  export type ProductionTicketRequest = z.infer<typeof ProductionTicketRequestSchema>;
102
76
  export declare const ProductionTicketResponseSchema: z.ZodObject<{
103
- /** Signed by the service (format: `activation-ticket.ts`). The lease opens `<url>?reticle_activate=<ticket>`. */
104
77
  ticket: z.ZodString;
105
- /** When the ticket must be redeemed by (ISO 8601). Informational. */
106
78
  expiresAt: z.ZodOptional<z.ZodString>;
107
- /** The service's own refused requests for this drive. Absent: `DEFAULT_PRODUCTION_POLICY`. */
108
79
  policy: z.ZodOptional<z.ZodArray<z.ZodObject<{
109
- rule: z.ZodEnum<["payment or checkout", "delete a workspace or project", "revoke or rotate a key", "send an invite or email", "cancel a subscription", "change a member's role"]>;
110
- methods: z.ZodArray<z.ZodString, "many">;
111
- path: z.ZodEffects<z.ZodString, string, string>;
112
- }, "strip", z.ZodTypeAny, {
113
- path: string;
114
- rule: "payment or checkout" | "delete a workspace or project" | "revoke or rotate a key" | "send an invite or email" | "cancel a subscription" | "change a member's role";
115
- methods: string[];
116
- }, {
117
- path: string;
118
- rule: "payment or checkout" | "delete a workspace or project" | "revoke or rotate a key" | "send an invite or email" | "cancel a subscription" | "change a member's role";
119
- methods: string[];
120
- }>, "many">>;
121
- }, "strip", z.ZodTypeAny, {
122
- ticket: string;
123
- expiresAt?: string | undefined;
124
- policy?: {
125
- path: string;
126
- rule: "payment or checkout" | "delete a workspace or project" | "revoke or rotate a key" | "send an invite or email" | "cancel a subscription" | "change a member's role";
127
- methods: string[];
128
- }[] | undefined;
129
- }, {
130
- ticket: string;
131
- expiresAt?: string | undefined;
132
- policy?: {
133
- path: string;
134
- rule: "payment or checkout" | "delete a workspace or project" | "revoke or rotate a key" | "send an invite or email" | "cancel a subscription" | "change a member's role";
135
- methods: string[];
136
- }[] | undefined;
137
- }>;
80
+ rule: z.ZodEnum<{
81
+ "payment or checkout": "payment or checkout";
82
+ "delete a workspace or project": "delete a workspace or project";
83
+ "revoke or rotate a key": "revoke or rotate a key";
84
+ "send an invite or email": "send an invite or email";
85
+ "cancel a subscription": "cancel a subscription";
86
+ "change a member's role": "change a member's role";
87
+ }>;
88
+ methods: z.ZodArray<z.ZodString>;
89
+ path: z.ZodString;
90
+ }, z.core.$strip>>>;
91
+ }, z.core.$strip>;
138
92
  export type ProductionTicketResponse = z.infer<typeof ProductionTicketResponseSchema>;
@@ -1,4 +1,4 @@
1
- import { z } from 'zod';
1
+ import * as z from 'zod';
2
2
  import { HelloScope } from './hello-mode.js';
3
3
  /**
4
4
  * The production action policy: what a drive on a live site may not do unless its intent says so.