@reticlehq/core 3.8.0 → 3.8.1

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 (93) 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/onboarding.d.ts +8 -58
  23. package/dist/onboarding.js +1 -1
  24. package/dist/registry/daemon-registry.d.ts +2 -14
  25. package/dist/registry/daemon-registry.js +1 -1
  26. package/dist/registry/dev-server-registry.d.ts +2 -31
  27. package/dist/registry/dev-server-registry.js +1 -1
  28. package/dist/registry/project-registry.d.ts +4 -32
  29. package/dist/registry/project-registry.js +1 -1
  30. package/dist/schema/command-message.json +65 -68
  31. package/dist/schema/command-name.json +29 -33
  32. package/dist/schema/command-result.json +25 -30
  33. package/dist/schema/event-message.json +104 -103
  34. package/dist/schema/event-payloads.json +142 -119
  35. package/dist/schema/event-type.json +47 -50
  36. package/dist/schema/hello-message.json +150 -154
  37. package/dist/schema/reticle-event.json +98 -96
  38. package/dist/schema/reticle-message.json +338 -333
  39. package/dist/telemetry-bug.d.ts +4 -75
  40. package/dist/telemetry-bug.js +1 -1
  41. package/dist/telemetry-feedback.d.ts +11 -99
  42. package/dist/telemetry-feedback.js +1 -1
  43. package/dist/telemetry-refusal.d.ts +4 -31
  44. package/dist/telemetry-refusal.js +1 -1
  45. package/dist/telemetry-session.d.ts +39 -633
  46. package/dist/telemetry-session.js +10 -8
  47. package/dist/telemetry-signals.d.ts +58 -151
  48. package/dist/telemetry-signals.js +12 -1
  49. package/dist/telemetry.d.ts +137 -1814
  50. package/dist/telemetry.js +1 -1
  51. package/dist/verdict/compare-source.d.ts +1 -1
  52. package/dist/verdict/compare-source.js +1 -1
  53. package/dist/verdict/disparity.d.ts +8 -56
  54. package/dist/verdict/disparity.js +1 -1
  55. package/dist/verdict/instrumentation-coverage.d.ts +3 -3
  56. package/dist/verdict/instrumentation-coverage.js +1 -1
  57. package/dist/verdict/instrumentation-gap.d.ts +3 -10
  58. package/dist/verdict/instrumentation-gap.js +1 -1
  59. package/dist/verdict/intent.d.ts +25 -224
  60. package/dist/verdict/intent.js +1 -1
  61. package/dist/verdict/predicate.d.ts +1 -1
  62. package/dist/verdict/predicate.js +5 -5
  63. package/dist/verdict/property-assertion.d.ts +23 -101
  64. package/dist/verdict/property-assertion.js +1 -1
  65. package/dist/verdict/run-report.d.ts +13 -108
  66. package/dist/verdict/run-report.js +1 -1
  67. package/dist/verdict/security.d.ts +12 -0
  68. package/dist/verdict/security.js +94 -7
  69. package/dist/verdict/verification-run.d.ts +112 -1668
  70. package/dist/verdict/verification-run.js +4 -4
  71. package/dist/verdict/verify-progress.d.ts +22 -64
  72. package/dist/verdict/verify-progress.js +1 -1
  73. package/dist/wire/constants/event-types.d.ts +2 -0
  74. package/dist/wire/constants/event-types.js +2 -0
  75. package/dist/wire/constants/response-body-reason.d.ts +4 -4
  76. package/dist/wire/constants/response-body-reason.js +4 -4
  77. package/dist/wire/constants/reticle-env.d.ts +2 -0
  78. package/dist/wire/constants/reticle-env.js +2 -0
  79. package/dist/wire/event-payloads.d.ts +108 -678
  80. package/dist/wire/event-payloads.js +24 -7
  81. package/dist/wire/event-priority.js +1 -0
  82. package/dist/wire/messages.d.ts +66 -755
  83. package/dist/wire/messages.js +3 -3
  84. package/dist/wire/next-step.d.ts +11 -51
  85. package/dist/wire/next-step.js +1 -1
  86. package/dist/wire/platform-link.js +2 -2
  87. package/dist/wire/production/production-policy.d.ts +37 -83
  88. package/dist/wire/production/production-policy.js +1 -1
  89. package/dist/wire/types.d.ts +75 -698
  90. package/dist/wire/types.js +5 -5
  91. package/dist/words/upgrade.d.ts +3 -13
  92. package/dist/words/upgrade.js +1 -1
  93. package/package.json +3 -4
package/dist/telemetry.js CHANGED
@@ -14,7 +14,7 @@
14
14
  * the tool's behaviour). Same conventions as the rest of core: enums are `as const` narrowed with
15
15
  * `z.nativeEnum`, timestamps are epoch-ms NUMBERS, no `any`.
16
16
  */
17
- import { z } from 'zod';
17
+ import * as z from 'zod';
18
18
  import { NextStepOffered, OnboardingPhase, OnboardingStepSchema, OnboardingStepStatus, OnboardingSteps, } from './onboarding.js';
19
19
  /**
20
20
  * The setup funnel's vocabulary. It is defined in `onboarding.ts`, which is its own subject, and
@@ -13,7 +13,7 @@
13
13
  * payload field, a store path, an element's text). Route, console and animation carry events, not
14
14
  * values, so they are not sources.
15
15
  */
16
- import { z } from 'zod';
16
+ import * as z from 'zod';
17
17
  import { PredicateKind } from './consequence.js';
18
18
  /** Which half of an exchange a `net` source reads. */
19
19
  export declare const NetBodySide: {
@@ -13,7 +13,7 @@
13
13
  * payload field, a store path, an element's text). Route, console and animation carry events, not
14
14
  * values, so they are not sources.
15
15
  */
16
- import { z } from 'zod';
16
+ import * as z from 'zod';
17
17
  import { PredicateKind } from './consequence.js';
18
18
  /** Which half of an exchange a `net` source reads. */
19
19
  export const NetBodySide = {
@@ -6,7 +6,7 @@
6
6
  * that proved a goal the Harness could not find is a discoverability finding, not noise and not a
7
7
  * defect. Carried on a Harness run's artifact and on the explore tool's answer.
8
8
  */
9
- import { z } from 'zod';
9
+ import * as z from 'zod';
10
10
  /** How the two verdicts on one goal compare. */
11
11
  export declare const DisparityKind: {
12
12
  /** Both proved it: it works, and someone new can find it. */
@@ -22,9 +22,8 @@ export type DisparityKind = (typeof DisparityKind)[keyof typeof DisparityKind];
22
22
  /** Where the Harness looked, at most this many places. */
23
23
  export declare const MAX_DISPARITY_SEARCHED = 20;
24
24
  export declare const RunDisparitySchema: z.ZodObject<{
25
- /** The goal's text, as the journey quoted it. */
26
25
  goal: z.ZodString;
27
- kind: z.ZodNativeEnum<{
26
+ kind: z.ZodEnum<{
28
27
  /** Both proved it: it works, and someone new can find it. */
29
28
  readonly FINDABLE: "findable";
30
29
  /** The agent proved it; the Harness searched and could not find it. */
@@ -34,72 +33,25 @@ export declare const RunDisparitySchema: z.ZodObject<{
34
33
  /** The agent saw it fail and the Harness did not prove it: a defect. */
35
34
  readonly DEFECT: "defect";
36
35
  }>;
37
- /** The coding agent's verdict on a claim naming the goal, in the same app. */
38
36
  agent: z.ZodObject<{
39
- verified: z.ZodNativeEnum<{
37
+ verified: z.ZodEnum<{
40
38
  readonly YES: "yes";
41
39
  readonly NO: "no";
42
40
  readonly UNKNOWN: "unknown";
43
41
  readonly NO_FAULT: "no-fault";
44
42
  }>;
45
43
  claim: z.ZodString;
46
- }, "strip", z.ZodTypeAny, {
47
- verified: "yes" | "no" | "unknown" | "no-fault";
48
- claim: string;
49
- }, {
50
- verified: "yes" | "no" | "unknown" | "no-fault";
51
- claim: string;
52
- }>;
53
- /** The Harness's verdict, and the hunt behind it. */
44
+ }, z.core.$strip>;
54
45
  harness: z.ZodObject<{
55
- verified: z.ZodNativeEnum<{
46
+ verified: z.ZodEnum<{
56
47
  readonly YES: "yes";
57
48
  readonly NO: "no";
58
49
  readonly UNKNOWN: "unknown";
59
50
  readonly NO_FAULT: "no-fault";
60
51
  }>;
61
- /** Whether its search found the goal on a page at all. */
62
52
  found: z.ZodBoolean;
63
- /** The places it searched, in order: the path a newcomer would take. */
64
- searched: z.ZodArray<z.ZodString, "many">;
65
- /** The last place it looked before giving up, when it did. */
53
+ searched: z.ZodArray<z.ZodString>;
66
54
  gaveUpAt: z.ZodOptional<z.ZodString>;
67
- }, "strip", z.ZodTypeAny, {
68
- verified: "yes" | "no" | "unknown" | "no-fault";
69
- found: boolean;
70
- searched: string[];
71
- gaveUpAt?: string | undefined;
72
- }, {
73
- verified: "yes" | "no" | "unknown" | "no-fault";
74
- found: boolean;
75
- searched: string[];
76
- gaveUpAt?: string | undefined;
77
- }>;
78
- }, "strip", z.ZodTypeAny, {
79
- kind: "findable" | "discoverability" | "agent_assumption" | "defect";
80
- goal: string;
81
- agent: {
82
- verified: "yes" | "no" | "unknown" | "no-fault";
83
- claim: string;
84
- };
85
- harness: {
86
- verified: "yes" | "no" | "unknown" | "no-fault";
87
- found: boolean;
88
- searched: string[];
89
- gaveUpAt?: string | undefined;
90
- };
91
- }, {
92
- kind: "findable" | "discoverability" | "agent_assumption" | "defect";
93
- goal: string;
94
- agent: {
95
- verified: "yes" | "no" | "unknown" | "no-fault";
96
- claim: string;
97
- };
98
- harness: {
99
- verified: "yes" | "no" | "unknown" | "no-fault";
100
- found: boolean;
101
- searched: string[];
102
- gaveUpAt?: string | undefined;
103
- };
104
- }>;
55
+ }, z.core.$strip>;
56
+ }, z.core.$strip>;
105
57
  export type RunDisparity = z.infer<typeof RunDisparitySchema>;
@@ -6,7 +6,7 @@
6
6
  * that proved a goal the Harness could not find is a discoverability finding, not noise and not a
7
7
  * defect. Carried on a Harness run's artifact and on the explore tool's answer.
8
8
  */
9
- import { z } from 'zod';
9
+ import * as z from 'zod';
10
10
  import { Verified } from './verified-constants.js';
11
11
  /** How the two verdicts on one goal compare. */
12
12
  export const DisparityKind = {
@@ -11,7 +11,7 @@
11
11
  * seen its channel or marker was announced
12
12
  * not seen yet neither — never counted as covered
13
13
  */
14
- import { z } from 'zod';
14
+ import * as z from 'zod';
15
15
  /** The eight things that decide how strong a verdict on this app can be. */
16
16
  export declare const CoverageCapability: {
17
17
  readonly PAGE_CONNECTED: "page connected";
@@ -68,7 +68,7 @@ export declare function agentPromptFor(input: {
68
68
  url: string;
69
69
  }): string;
70
70
  /** The capabilities an app reports as not applying to it, on the wire. Closed: core's eight only. */
71
- export declare const NotApplicableSchema: z.ZodArray<z.ZodNativeEnum<{
71
+ export declare const NotApplicableSchema: z.ZodArray<z.ZodEnum<{
72
72
  readonly PAGE_CONNECTED: "page connected";
73
73
  readonly DOM_ACTIONS: "DOM actions";
74
74
  readonly NETWORK: "network";
@@ -77,7 +77,7 @@ export declare const NotApplicableSchema: z.ZodArray<z.ZodNativeEnum<{
77
77
  readonly SIGNALS: "signals on mutation";
78
78
  readonly SOURCE_MAPPING: "file:line source mapping";
79
79
  readonly TEST_IDS: "stable test ids";
80
- }>, "many">;
80
+ }>>;
81
81
  /** Seen ÷ applicable over the eight capabilities. See the header for the exact rule. */
82
82
  export declare function coverageScore(coverage: Pick<Coverage, 'seen'>, notApplicable?: readonly CoverageCapability[]): number;
83
83
  /** floor(coverageScore × 100): the setup score a person reads. */
@@ -11,7 +11,7 @@
11
11
  * seen its channel or marker was announced
12
12
  * not seen yet neither — never counted as covered
13
13
  */
14
- import { z } from 'zod';
14
+ import * as z from 'zod';
15
15
  import { ChannelId } from 'open-verification';
16
16
  import { InstrumentationGapKind, fixForGap } from './instrumentation-gap.js';
17
17
  import { CoverageMarker, SOURCE_MAPPING_CAPABILITY } from '../wire/platform-link.js';
@@ -14,7 +14,7 @@
14
14
  * everything uninstrumented on the page. The test is *did this absence change the answer the agent
15
15
  * just got?* — if not, it does not fire.
16
16
  */
17
- import { z } from 'zod';
17
+ import * as z from 'zod';
18
18
  /**
19
19
  * The kinds of absence that can weaken a verdict. Most name a capability the app did not provide;
20
20
  * `UNDECLARED_CHANGE` names one the agent did not, and is here because it costs a verdict the same.
@@ -178,7 +178,7 @@ export declare const EngineBlindSpotKind: {
178
178
  };
179
179
  export type EngineBlindSpotKind = (typeof EngineBlindSpotKind)[keyof typeof EngineBlindSpotKind];
180
180
  export declare const EngineBlindSpotSchema: z.ZodObject<{
181
- kind: z.ZodNativeEnum<{
181
+ kind: z.ZodEnum<{
182
182
  /**
183
183
  * An action ran while a `<canvas>` was visible, and this engine records no canvas digest.
184
184
  *
@@ -197,15 +197,8 @@ export declare const EngineBlindSpotSchema: z.ZodObject<{
197
197
  */
198
198
  readonly CLAIM_ARITHMETIC_UNCHECKED: "claim-arithmetic-unchecked";
199
199
  }>;
200
- /** What could not be seen, in words. */
201
200
  detail: z.ZodString;
202
- }, "strip", z.ZodTypeAny, {
203
- kind: "pixels-unobserved" | "claim-arithmetic-unchecked";
204
- detail: string;
205
- }, {
206
- kind: "pixels-unobserved" | "claim-arithmetic-unchecked";
207
- detail: string;
208
- }>;
201
+ }, z.core.$strip>;
209
202
  export type EngineBlindSpot = z.infer<typeof EngineBlindSpotSchema>;
210
203
  /** The verdict-result field that carries a session's `EngineBlindSpot[]`. */
211
204
  export declare const ENGINE_BLIND_SPOTS_FIELD = "engineBlindSpots";
@@ -14,7 +14,7 @@
14
14
  * everything uninstrumented on the page. The test is *did this absence change the answer the agent
15
15
  * just got?* — if not, it does not fire.
16
16
  */
17
- import { z } from 'zod';
17
+ import * as z from 'zod';
18
18
  /**
19
19
  * The kinds of absence that can weaken a verdict. Most name a capability the app did not provide;
20
20
  * `UNDECLARED_CHANGE` names one the agent did not, and is here because it costs a verdict the same.
@@ -1,4 +1,4 @@
1
- import { z } from 'zod';
1
+ import * as z from 'zod';
2
2
  /**
3
3
  * What a change was supposed to make true, captured while somebody still knows.
4
4
  *
@@ -37,271 +37,72 @@ export type IntentState = (typeof IntentState)[keyof typeof IntentState];
37
37
  export declare const IntentSurfaceSchema: z.ZodObject<{
38
38
  route: z.ZodOptional<z.ZodString>;
39
39
  flow: z.ZodOptional<z.ZodString>;
40
- files: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
41
- }, "strip", z.ZodTypeAny, {
42
- route?: string | undefined;
43
- flow?: string | undefined;
44
- files?: string[] | undefined;
45
- }, {
46
- route?: string | undefined;
47
- flow?: string | undefined;
48
- files?: string[] | undefined;
49
- }>;
40
+ files: z.ZodOptional<z.ZodArray<z.ZodString>>;
41
+ }, z.core.$strip>;
50
42
  export type IntentSurface = z.infer<typeof IntentSurfaceSchema>;
51
43
  /** Which verdict discharged it, and how strongly. The grade is what makes a later weakening visible. */
52
44
  export declare const IntentProofSchema: z.ZodObject<{
53
45
  verdictId: z.ZodString;
54
46
  grade: z.ZodString;
55
47
  at: z.ZodNumber;
56
- /** The run the proving check landed in, so a reader links proof and run by id, not by time. */
57
48
  runId: z.ZodOptional<z.ZodString>;
58
- }, "strip", z.ZodTypeAny, {
59
- at: number;
60
- grade: string;
61
- verdictId: string;
62
- runId?: string | undefined;
63
- }, {
64
- at: number;
65
- grade: string;
66
- verdictId: string;
67
- runId?: string | undefined;
68
- }>;
49
+ }, z.core.$strip>;
69
50
  export declare const IntentSchema: z.ZodObject<{
70
51
  id: z.ZodString;
71
- /** The prose. Survives even when the binding rots, which is most of the point. */
72
52
  statement: z.ZodString;
73
- state: z.ZodEnum<["declared", "bound", "proved"]>;
53
+ state: z.ZodEnum<{
54
+ proved: "proved";
55
+ declared: "declared";
56
+ bound: "bound";
57
+ }>;
74
58
  declaredAt: z.ZodNumber;
75
- /** Left as `unknown`: core must not depend on the server's predicate vocabulary. */
76
59
  binding: z.ZodOptional<z.ZodUnknown>;
77
60
  surface: z.ZodOptional<z.ZodObject<{
78
61
  route: z.ZodOptional<z.ZodString>;
79
62
  flow: z.ZodOptional<z.ZodString>;
80
- files: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
81
- }, "strip", z.ZodTypeAny, {
82
- route?: string | undefined;
83
- flow?: string | undefined;
84
- files?: string[] | undefined;
85
- }, {
86
- route?: string | undefined;
87
- flow?: string | undefined;
88
- files?: string[] | undefined;
89
- }>>;
63
+ files: z.ZodOptional<z.ZodArray<z.ZodString>>;
64
+ }, z.core.$strip>>;
90
65
  provenBy: z.ZodOptional<z.ZodObject<{
91
66
  verdictId: z.ZodString;
92
67
  grade: z.ZodString;
93
68
  at: z.ZodNumber;
94
- /** The run the proving check landed in, so a reader links proof and run by id, not by time. */
95
69
  runId: z.ZodOptional<z.ZodString>;
96
- }, "strip", z.ZodTypeAny, {
97
- at: number;
98
- grade: string;
99
- verdictId: string;
100
- runId?: string | undefined;
101
- }, {
102
- at: number;
103
- grade: string;
104
- verdictId: string;
105
- runId?: string | undefined;
106
- }>>;
107
- /** Every statement this intent previously carried, oldest first. Append-only, never rewritten. */
70
+ }, z.core.$strip>>;
108
71
  amended: z.ZodOptional<z.ZodArray<z.ZodObject<{
109
72
  statement: z.ZodString;
110
73
  at: z.ZodNumber;
111
- }, "strip", z.ZodTypeAny, {
112
- at: number;
113
- statement: string;
114
- }, {
115
- at: number;
116
- statement: string;
117
- }>, "many">>;
118
- }, "strip", z.ZodTypeAny, {
119
- state: "proved" | "declared" | "bound";
120
- id: string;
121
- statement: string;
122
- declaredAt: number;
123
- surface?: {
124
- route?: string | undefined;
125
- flow?: string | undefined;
126
- files?: string[] | undefined;
127
- } | undefined;
128
- binding?: unknown;
129
- provenBy?: {
130
- at: number;
131
- grade: string;
132
- verdictId: string;
133
- runId?: string | undefined;
134
- } | undefined;
135
- amended?: {
136
- at: number;
137
- statement: string;
138
- }[] | undefined;
139
- }, {
140
- state: "proved" | "declared" | "bound";
141
- id: string;
142
- statement: string;
143
- declaredAt: number;
144
- surface?: {
145
- route?: string | undefined;
146
- flow?: string | undefined;
147
- files?: string[] | undefined;
148
- } | undefined;
149
- binding?: unknown;
150
- provenBy?: {
151
- at: number;
152
- grade: string;
153
- verdictId: string;
154
- runId?: string | undefined;
155
- } | undefined;
156
- amended?: {
157
- at: number;
158
- statement: string;
159
- }[] | undefined;
160
- }>;
74
+ }, z.core.$strip>>>;
75
+ }, z.core.$strip>;
161
76
  export type Intent = z.infer<typeof IntentSchema>;
162
77
  export declare const IntentFileSchema: z.ZodObject<{
163
78
  version: z.ZodLiteral<1>;
164
79
  intents: z.ZodRecord<z.ZodString, z.ZodObject<{
165
80
  id: z.ZodString;
166
- /** The prose. Survives even when the binding rots, which is most of the point. */
167
81
  statement: z.ZodString;
168
- state: z.ZodEnum<["declared", "bound", "proved"]>;
82
+ state: z.ZodEnum<{
83
+ proved: "proved";
84
+ declared: "declared";
85
+ bound: "bound";
86
+ }>;
169
87
  declaredAt: z.ZodNumber;
170
- /** Left as `unknown`: core must not depend on the server's predicate vocabulary. */
171
88
  binding: z.ZodOptional<z.ZodUnknown>;
172
89
  surface: z.ZodOptional<z.ZodObject<{
173
90
  route: z.ZodOptional<z.ZodString>;
174
91
  flow: z.ZodOptional<z.ZodString>;
175
- files: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
176
- }, "strip", z.ZodTypeAny, {
177
- route?: string | undefined;
178
- flow?: string | undefined;
179
- files?: string[] | undefined;
180
- }, {
181
- route?: string | undefined;
182
- flow?: string | undefined;
183
- files?: string[] | undefined;
184
- }>>;
92
+ files: z.ZodOptional<z.ZodArray<z.ZodString>>;
93
+ }, z.core.$strip>>;
185
94
  provenBy: z.ZodOptional<z.ZodObject<{
186
95
  verdictId: z.ZodString;
187
96
  grade: z.ZodString;
188
97
  at: z.ZodNumber;
189
- /** The run the proving check landed in, so a reader links proof and run by id, not by time. */
190
98
  runId: z.ZodOptional<z.ZodString>;
191
- }, "strip", z.ZodTypeAny, {
192
- at: number;
193
- grade: string;
194
- verdictId: string;
195
- runId?: string | undefined;
196
- }, {
197
- at: number;
198
- grade: string;
199
- verdictId: string;
200
- runId?: string | undefined;
201
- }>>;
202
- /** Every statement this intent previously carried, oldest first. Append-only, never rewritten. */
99
+ }, z.core.$strip>>;
203
100
  amended: z.ZodOptional<z.ZodArray<z.ZodObject<{
204
101
  statement: z.ZodString;
205
102
  at: z.ZodNumber;
206
- }, "strip", z.ZodTypeAny, {
207
- at: number;
208
- statement: string;
209
- }, {
210
- at: number;
211
- statement: string;
212
- }>, "many">>;
213
- }, "strip", z.ZodTypeAny, {
214
- state: "proved" | "declared" | "bound";
215
- id: string;
216
- statement: string;
217
- declaredAt: number;
218
- surface?: {
219
- route?: string | undefined;
220
- flow?: string | undefined;
221
- files?: string[] | undefined;
222
- } | undefined;
223
- binding?: unknown;
224
- provenBy?: {
225
- at: number;
226
- grade: string;
227
- verdictId: string;
228
- runId?: string | undefined;
229
- } | undefined;
230
- amended?: {
231
- at: number;
232
- statement: string;
233
- }[] | undefined;
234
- }, {
235
- state: "proved" | "declared" | "bound";
236
- id: string;
237
- statement: string;
238
- declaredAt: number;
239
- surface?: {
240
- route?: string | undefined;
241
- flow?: string | undefined;
242
- files?: string[] | undefined;
243
- } | undefined;
244
- binding?: unknown;
245
- provenBy?: {
246
- at: number;
247
- grade: string;
248
- verdictId: string;
249
- runId?: string | undefined;
250
- } | undefined;
251
- amended?: {
252
- at: number;
253
- statement: string;
254
- }[] | undefined;
255
- }>>;
256
- }, "strip", z.ZodTypeAny, {
257
- version: 1;
258
- intents: Record<string, {
259
- state: "proved" | "declared" | "bound";
260
- id: string;
261
- statement: string;
262
- declaredAt: number;
263
- surface?: {
264
- route?: string | undefined;
265
- flow?: string | undefined;
266
- files?: string[] | undefined;
267
- } | undefined;
268
- binding?: unknown;
269
- provenBy?: {
270
- at: number;
271
- grade: string;
272
- verdictId: string;
273
- runId?: string | undefined;
274
- } | undefined;
275
- amended?: {
276
- at: number;
277
- statement: string;
278
- }[] | undefined;
279
- }>;
280
- }, {
281
- version: 1;
282
- intents: Record<string, {
283
- state: "proved" | "declared" | "bound";
284
- id: string;
285
- statement: string;
286
- declaredAt: number;
287
- surface?: {
288
- route?: string | undefined;
289
- flow?: string | undefined;
290
- files?: string[] | undefined;
291
- } | undefined;
292
- binding?: unknown;
293
- provenBy?: {
294
- at: number;
295
- grade: string;
296
- verdictId: string;
297
- runId?: string | undefined;
298
- } | undefined;
299
- amended?: {
300
- at: number;
301
- statement: string;
302
- }[] | undefined;
303
- }>;
304
- }>;
103
+ }, z.core.$strip>>>;
104
+ }, z.core.$strip>>;
105
+ }, z.core.$strip>;
305
106
  export type IntentFile = z.infer<typeof IntentFileSchema>;
306
107
  export declare function emptyIntentFile(): IntentFile;
307
108
  export declare function declareIntent(input: {
@@ -1,4 +1,4 @@
1
- import { z } from 'zod';
1
+ import * as z from 'zod';
2
2
  /**
3
3
  * What a change was supposed to make true, captured while somebody still knows.
4
4
  *
@@ -15,7 +15,7 @@
15
15
  * the contract, not the reasoning. A reader looking for "what may I write" is in the right file; a
16
16
  * reader looking for "what does it decide" is one package out.
17
17
  */
18
- import { z } from 'zod';
18
+ import * as z from 'zod';
19
19
  import { type ElementQuery } from '../wire/types.js';
20
20
  import { ElementState } from '../wire/constants/constants.js';
21
21
  import { CompareAs, type CompareSource } from './compare-source.js';
@@ -15,7 +15,7 @@
15
15
  * the contract, not the reasoning. A reader looking for "what may I write" is in the right file; a
16
16
  * reader looking for "what does it decide" is one package out.
17
17
  */
18
- import { z } from 'zod';
18
+ import * as z from 'zod';
19
19
  import { ElementQuerySchema } from '../wire/types.js';
20
20
  import { ElementState } from '../wire/constants/constants.js';
21
21
  import { CompareAs, CompareSourceSchema, sameCompareSource, } from './compare-source.js';
@@ -125,7 +125,7 @@ function keysOfEachKind() {
125
125
  const out = new Map();
126
126
  for (const option of predicateUnion().options) {
127
127
  const shape = option.shape;
128
- const kind = shape['kind']._def.value;
128
+ const kind = String(shape['kind'].value);
129
129
  const flat = PredicateKind.ELEMENT === kind ? ELEMENT_QUERY_FIELDS : [];
130
130
  out.set(kind, new Set([
131
131
  ...Object.keys(shape).filter((key) => 'kind' !== key),
@@ -427,7 +427,7 @@ function predicateUnion() {
427
427
  .object({
428
428
  kind: z.literal(PredicateKind.SIGNAL),
429
429
  name: z.string().optional(),
430
- dataMatches: z.record(z.unknown()).optional(),
430
+ dataMatches: z.record(z.string(), z.unknown()).optional(),
431
431
  /**
432
432
  * Exact number of matching signals since the action — presence becomes cardinality.
433
433
  *
@@ -592,9 +592,9 @@ export function predicateShapeFor(kind) {
592
592
  for (const option of predicateUnion().options) {
593
593
  const shape = option.shape;
594
594
  const literal = shape?.['kind'];
595
- const value = literal?._def?.value;
596
- if (value === kind)
595
+ if (literal instanceof z.ZodLiteral && literal.value === kind) {
597
596
  return shape;
597
+ }
598
598
  }
599
599
  return null;
600
600
  }