@reticlehq/core 2.0.1 → 2.2.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.
- package/LICENSE +201 -112
- package/NOTICE +5 -0
- package/dist/brand.d.ts +32 -3
- package/dist/brand.d.ts.map +1 -1
- package/dist/brand.js +9 -4
- package/dist/brand.js.map +1 -1
- package/dist/consequence.d.ts +31 -0
- package/dist/consequence.d.ts.map +1 -0
- package/dist/consequence.js +45 -0
- package/dist/consequence.js.map +1 -0
- package/dist/constants.d.ts +161 -5
- package/dist/constants.d.ts.map +1 -1
- package/dist/constants.js +156 -5
- package/dist/constants.js.map +1 -1
- package/dist/daemon-registry.d.ts +5 -5
- package/dist/daemon-registry.d.ts.map +1 -1
- package/dist/daemon-registry.js +5 -5
- package/dist/daemon-registry.js.map +1 -1
- package/dist/event-payloads.d.ts +502 -0
- package/dist/event-payloads.d.ts.map +1 -0
- package/dist/event-payloads.js +138 -0
- package/dist/event-payloads.js.map +1 -0
- package/dist/flow-constants.d.ts +2 -2
- package/dist/flow-constants.js +7 -7
- package/dist/flow-constants.js.map +1 -1
- package/dist/flow-types.d.ts +156 -32
- package/dist/flow-types.d.ts.map +1 -1
- package/dist/flow-types.js +23 -1
- package/dist/flow-types.js.map +1 -1
- package/dist/index.d.ts +19 -6
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +26 -11
- package/dist/index.js.map +1 -1
- package/dist/journal.d.ts +90 -0
- package/dist/journal.d.ts.map +1 -0
- package/dist/journal.js +38 -0
- package/dist/journal.js.map +1 -0
- package/dist/messages.d.ts +118 -16
- package/dist/messages.d.ts.map +1 -1
- package/dist/messages.js +15 -2
- package/dist/messages.js.map +1 -1
- package/dist/notices.d.ts +4 -4
- package/dist/notices.js +4 -4
- package/dist/redaction.d.ts +4 -0
- package/dist/redaction.d.ts.map +1 -0
- package/dist/redaction.js +33 -0
- package/dist/redaction.js.map +1 -0
- package/dist/schema/event-message.json +23 -1
- package/dist/schema/event-type.json +10 -1
- package/dist/schema/reticle-event.json +23 -1
- package/dist/schema/reticle-message.json +23 -1
- package/dist/session-constants.d.ts +2 -2
- package/dist/session-constants.js +2 -2
- package/dist/state-select.d.ts.map +1 -1
- package/dist/state-select.js +21 -5
- package/dist/state-select.js.map +1 -1
- package/dist/toon.d.ts +13 -12
- package/dist/toon.d.ts.map +1 -1
- package/dist/toon.js +37 -20
- package/dist/toon.js.map +1 -1
- package/dist/types.d.ts +80 -18
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js +9 -3
- package/dist/types.js.map +1 -1
- package/dist/upgrade.d.ts +5 -5
- package/dist/upgrade.js +3 -3
- package/dist/verification-run.d.ts +25 -23
- package/dist/verification-run.d.ts.map +1 -1
- package/dist/verification-run.js +1 -1
- package/package.json +6 -2
package/LICENSE
CHANGED
|
@@ -1,113 +1,202 @@
|
|
|
1
|
-
NOTE: @reticlehq/core is an umbrella package that bundles other Reticle packages.
|
|
2
|
-
The embeddable SDK packages it re-exports are Apache-2.0; the server it
|
|
3
|
-
includes is under the Functional Source License below, which is the most
|
|
4
|
-
restrictive term and therefore governs the bundle. See the root LICENSE for
|
|
5
|
-
the full per-package breakdown.
|
|
6
1
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
You
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
2
|
+
Apache License
|
|
3
|
+
Version 2.0, January 2004
|
|
4
|
+
http://www.apache.org/licenses/
|
|
5
|
+
|
|
6
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
7
|
+
|
|
8
|
+
1. Definitions.
|
|
9
|
+
|
|
10
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
11
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
12
|
+
|
|
13
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
14
|
+
the copyright owner that is granting the License.
|
|
15
|
+
|
|
16
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
17
|
+
other entities that control, are controlled by, or are under common
|
|
18
|
+
control with that entity. For the purposes of this definition,
|
|
19
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
20
|
+
direction or management of such entity, whether by contract or
|
|
21
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
22
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
23
|
+
|
|
24
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
25
|
+
exercising permissions granted by this License.
|
|
26
|
+
|
|
27
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
28
|
+
including but not limited to software source code, documentation
|
|
29
|
+
source, and configuration files.
|
|
30
|
+
|
|
31
|
+
"Object" form shall mean any form resulting from mechanical
|
|
32
|
+
transformation or translation of a Source form, including but
|
|
33
|
+
not limited to compiled object code, generated documentation,
|
|
34
|
+
and conversions to other media types.
|
|
35
|
+
|
|
36
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
37
|
+
Object form, made available under the License, as indicated by a
|
|
38
|
+
copyright notice that is included in or attached to the work
|
|
39
|
+
(an example is provided in the Appendix below).
|
|
40
|
+
|
|
41
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
42
|
+
form, that is based on (or derived from) the Work and for which the
|
|
43
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
44
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
45
|
+
of this License, Derivative Works shall not include works that remain
|
|
46
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
47
|
+
the Work and Derivative Works thereof.
|
|
48
|
+
|
|
49
|
+
"Contribution" shall mean any work of authorship, including
|
|
50
|
+
the original version of the Work and any modifications or additions
|
|
51
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
52
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
53
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
54
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
55
|
+
means any form of electronic, verbal, or written communication sent
|
|
56
|
+
to the Licensor or its representatives, including but not limited to
|
|
57
|
+
communication on electronic mailing lists, source code control systems,
|
|
58
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
59
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
60
|
+
excluding communication that is conspicuously marked or otherwise
|
|
61
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
62
|
+
|
|
63
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
64
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
65
|
+
subsequently incorporated within the Work.
|
|
66
|
+
|
|
67
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
68
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
69
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
70
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
71
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
72
|
+
Work and such Derivative Works in Source or Object form.
|
|
73
|
+
|
|
74
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
75
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
76
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
77
|
+
(except as stated in this section) patent license to make, have made,
|
|
78
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
79
|
+
where such license applies only to those patent claims licensable
|
|
80
|
+
by such Contributor that are necessarily infringed by their
|
|
81
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
82
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
83
|
+
institute patent litigation against any entity (including a
|
|
84
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
85
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
86
|
+
or contributory patent infringement, then any patent licenses
|
|
87
|
+
granted to You under this License for that Work shall terminate
|
|
88
|
+
as of the date such litigation is filed.
|
|
89
|
+
|
|
90
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
91
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
92
|
+
modifications, and in Source or Object form, provided that You
|
|
93
|
+
meet the following conditions:
|
|
94
|
+
|
|
95
|
+
(a) You must give any other recipients of the Work or
|
|
96
|
+
Derivative Works a copy of this License; and
|
|
97
|
+
|
|
98
|
+
(b) You must cause any modified files to carry prominent notices
|
|
99
|
+
stating that You changed the files; and
|
|
100
|
+
|
|
101
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
102
|
+
that You distribute, all copyright, patent, trademark, and
|
|
103
|
+
attribution notices from the Source form of the Work,
|
|
104
|
+
excluding those notices that do not pertain to any part of
|
|
105
|
+
the Derivative Works; and
|
|
106
|
+
|
|
107
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
108
|
+
distribution, then any Derivative Works that You distribute must
|
|
109
|
+
include a readable copy of the attribution notices contained
|
|
110
|
+
within such NOTICE file, excluding those notices that do not
|
|
111
|
+
pertain to any part of the Derivative Works, in at least one
|
|
112
|
+
of the following places: within a NOTICE text file distributed
|
|
113
|
+
as part of the Derivative Works; within the Source form or
|
|
114
|
+
documentation, if provided along with the Derivative Works; or,
|
|
115
|
+
within a display generated by the Derivative Works, if and
|
|
116
|
+
wherever such third-party notices normally appear. The contents
|
|
117
|
+
of the NOTICE file are for informational purposes only and
|
|
118
|
+
do not modify the License. You may add Your own attribution
|
|
119
|
+
notices within Derivative Works that You distribute, alongside
|
|
120
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
121
|
+
that such additional attribution notices cannot be construed
|
|
122
|
+
as modifying the License.
|
|
123
|
+
|
|
124
|
+
You may add Your own copyright statement to Your modifications and
|
|
125
|
+
may provide additional or different license terms and conditions
|
|
126
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
127
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
128
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
129
|
+
the conditions stated in this License.
|
|
130
|
+
|
|
131
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
132
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
133
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
134
|
+
this License, without any additional terms or conditions.
|
|
135
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
136
|
+
the terms of any separate license agreement you may have executed
|
|
137
|
+
with Licensor regarding such Contributions.
|
|
138
|
+
|
|
139
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
140
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
141
|
+
except as required for reasonable and customary use in describing the
|
|
142
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
143
|
+
|
|
144
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
145
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
146
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
147
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
148
|
+
implied, including, without limitation, any warranties or conditions
|
|
149
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
150
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
151
|
+
appropriateness of using or redistributing the Work and assume any
|
|
152
|
+
risks associated with Your exercise of permissions under this License.
|
|
153
|
+
|
|
154
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
155
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
156
|
+
unless required by applicable law (such as deliberate and grossly
|
|
157
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
158
|
+
liable to You for damages, including any direct, indirect, special,
|
|
159
|
+
incidental, or consequential damages of any character arising as a
|
|
160
|
+
result of this License or out of the use or inability to use the
|
|
161
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
162
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
163
|
+
other commercial damages or losses), even if such Contributor
|
|
164
|
+
has been advised of the possibility of such damages.
|
|
165
|
+
|
|
166
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
167
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
168
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
169
|
+
or other liability obligations and/or rights consistent with this
|
|
170
|
+
License. However, in accepting such obligations, You may act only
|
|
171
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
172
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
173
|
+
defend, and hold each Contributor harmless for any liability
|
|
174
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
175
|
+
of your accepting any such warranty or additional liability.
|
|
176
|
+
|
|
177
|
+
END OF TERMS AND CONDITIONS
|
|
178
|
+
|
|
179
|
+
APPENDIX: How to apply the Apache License to your work.
|
|
180
|
+
|
|
181
|
+
To apply the Apache License to your work, attach the following
|
|
182
|
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
183
|
+
replaced with your own identifying information. (Don't include
|
|
184
|
+
the brackets!) The text should be enclosed in the appropriate
|
|
185
|
+
comment syntax for the file format. We also recommend that a
|
|
186
|
+
file or class name and description of purpose be included on the
|
|
187
|
+
same "printed page" as the copyright notice for easier
|
|
188
|
+
identification within third-party archives.
|
|
189
|
+
|
|
190
|
+
Copyright 2026 Reticle Labs
|
|
191
|
+
|
|
192
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
193
|
+
you may not use this file except in compliance with the License.
|
|
194
|
+
You may obtain a copy of the License at
|
|
195
|
+
|
|
196
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
197
|
+
|
|
198
|
+
Unless required by applicable law or agreed to in writing, software
|
|
199
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
200
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
201
|
+
See the License for the specific language governing permissions and
|
|
202
|
+
limitations under the License.
|
package/NOTICE
ADDED
package/dist/brand.d.ts
CHANGED
|
@@ -6,16 +6,45 @@
|
|
|
6
6
|
* allowed *set*) with type safety for the *values* that travel.
|
|
7
7
|
*
|
|
8
8
|
* Pattern:
|
|
9
|
-
*
|
|
10
|
-
*
|
|
9
|
+
* export type RunId = Brand<string, 'RunId'>;
|
|
10
|
+
* export const asRunId = (s: string): RunId => s as RunId; // mint at a trusted/validated boundary
|
|
11
11
|
* The brand is a phantom (erased at runtime) — `RunId` is just a string at runtime, free to serialize.
|
|
12
12
|
* Mint ONLY after validation (e.g. behind a `(s): s is RunId` guard) so a branded value is also a valid
|
|
13
|
-
* one. Zod-validated fields use `z.string
|
|
13
|
+
* one. Zod-validated fields use `z.string.brand<'X'>` instead, so the schema is the single source.
|
|
14
14
|
*/
|
|
15
15
|
declare const brand: unique symbol;
|
|
16
16
|
/** A nominal wrapper: `T` tagged with brand `B`, assignable FROM nowhere except an explicit mint/cast. */
|
|
17
17
|
export type Brand<T, B extends string> = T & {
|
|
18
18
|
readonly [brand]: B;
|
|
19
19
|
};
|
|
20
|
+
/**
|
|
21
|
+
* A flow name that has passed the path-segment guard.
|
|
22
|
+
*
|
|
23
|
+
* The doc above names this exact hazard — "a plain `string` runId and a `string` flowName are
|
|
24
|
+
* interchangeable to the compiler and get swapped by accident (both feed path helpers!)" — and for a
|
|
25
|
+
* long time only RunId was branded, so the pair the warning describes was half-fixed. `flowPath` and
|
|
26
|
+
* `runPath` sit beside each other and take the same shape; the compiler could not tell them apart.
|
|
27
|
+
*/
|
|
28
|
+
export type FlowName = Brand<string, 'FlowName'>;
|
|
29
|
+
/**
|
|
30
|
+
* A session id that has passed the path-segment guard. Joined straight into journal paths, so the same
|
|
31
|
+
* argument applies. Mint ONLY through the validating guard, never with a bare cast.
|
|
32
|
+
*/
|
|
33
|
+
export type SessionId = Brand<string, 'SessionId'>;
|
|
34
|
+
/**
|
|
35
|
+
* A live element handle (`e42`) minted by the browser's ref registry.
|
|
36
|
+
*
|
|
37
|
+
* The most-passed identifier in the codebase and the one crossing browser↔bridge↔agent most often. The
|
|
38
|
+
* registry keys a plain `Map<string, WeakRef<Element>>`, so handing it a sessionId returns null — a
|
|
39
|
+
* silent miss rather than an error. Branding stops OUR code confusing the two; a ref arriving from the
|
|
40
|
+
* wire is still an untrusted string until the registry resolves it.
|
|
41
|
+
*/
|
|
42
|
+
export type Ref = Brand<string, 'Ref'>;
|
|
43
|
+
/** Mint a Ref — the registry does this when it hands out a handle. */
|
|
44
|
+
export declare const asRef: (value: string) => Ref;
|
|
45
|
+
/** Mint a FlowName — call ONLY behind isValidFlowName, or on a literal in a test. */
|
|
46
|
+
export declare const asFlowName: (value: string) => FlowName;
|
|
47
|
+
/** Mint a SessionId — call ONLY behind isValidSessionId, or on a literal in a test. */
|
|
48
|
+
export declare const asSessionId: (value: string) => SessionId;
|
|
20
49
|
export {};
|
|
21
50
|
//# sourceMappingURL=brand.d.ts.map
|
package/dist/brand.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"brand.d.ts","sourceRoot":"","sources":["../src/brand.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,OAAO,CAAC,MAAM,KAAK,EAAE,OAAO,MAAM,CAAC;AAEnC,0GAA0G;AAC1G,MAAM,MAAM,KAAK,CAAC,CAAC,EAAE,CAAC,SAAS,MAAM,IAAI,CAAC,GAAG;IAAE,QAAQ,CAAC,CAAC,KAAK,CAAC,EAAE,CAAC,CAAA;CAAE,CAAC"}
|
|
1
|
+
{"version":3,"file":"brand.d.ts","sourceRoot":"","sources":["../src/brand.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,OAAO,CAAC,MAAM,KAAK,EAAE,OAAO,MAAM,CAAC;AAEnC,0GAA0G;AAC1G,MAAM,MAAM,KAAK,CAAC,CAAC,EAAE,CAAC,SAAS,MAAM,IAAI,CAAC,GAAG;IAAE,QAAQ,CAAC,CAAC,KAAK,CAAC,EAAE,CAAC,CAAA;CAAE,CAAC;AAErE;;;;;;;GAOG;AACH,MAAM,MAAM,QAAQ,GAAG,KAAK,CAAC,MAAM,EAAE,UAAU,CAAC,CAAC;AAEjD;;;GAGG;AACH,MAAM,MAAM,SAAS,GAAG,KAAK,CAAC,MAAM,EAAE,WAAW,CAAC,CAAC;AAEnD;;;;;;;GAOG;AACH,MAAM,MAAM,GAAG,GAAG,KAAK,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC;AAEvC,sEAAsE;AACtE,eAAO,MAAM,KAAK,GAAI,OAAO,MAAM,KAAG,GAAmB,CAAC;AAE1D,qFAAqF;AACrF,eAAO,MAAM,UAAU,GAAI,OAAO,MAAM,KAAG,QAA6B,CAAC;AACzE,uFAAuF;AACvF,eAAO,MAAM,WAAW,GAAI,OAAO,MAAM,KAAG,SAA+B,CAAC"}
|
package/dist/brand.js
CHANGED
|
@@ -6,11 +6,16 @@
|
|
|
6
6
|
* allowed *set*) with type safety for the *values* that travel.
|
|
7
7
|
*
|
|
8
8
|
* Pattern:
|
|
9
|
-
*
|
|
10
|
-
*
|
|
9
|
+
* export type RunId = Brand<string, 'RunId'>;
|
|
10
|
+
* export const asRunId = (s: string): RunId => s as RunId; // mint at a trusted/validated boundary
|
|
11
11
|
* The brand is a phantom (erased at runtime) — `RunId` is just a string at runtime, free to serialize.
|
|
12
12
|
* Mint ONLY after validation (e.g. behind a `(s): s is RunId` guard) so a branded value is also a valid
|
|
13
|
-
* one. Zod-validated fields use `z.string
|
|
13
|
+
* one. Zod-validated fields use `z.string.brand<'X'>` instead, so the schema is the single source.
|
|
14
14
|
*/
|
|
15
|
-
|
|
15
|
+
/** Mint a Ref — the registry does this when it hands out a handle. */
|
|
16
|
+
export const asRef = (value) => value;
|
|
17
|
+
/** Mint a FlowName — call ONLY behind isValidFlowName, or on a literal in a test. */
|
|
18
|
+
export const asFlowName = (value) => value;
|
|
19
|
+
/** Mint a SessionId — call ONLY behind isValidSessionId, or on a literal in a test. */
|
|
20
|
+
export const asSessionId = (value) => value;
|
|
16
21
|
//# sourceMappingURL=brand.js.map
|
package/dist/brand.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"brand.js","sourceRoot":"","sources":["../src/brand.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG"}
|
|
1
|
+
{"version":3,"file":"brand.js","sourceRoot":"","sources":["../src/brand.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAiCH,sEAAsE;AACtE,MAAM,CAAC,MAAM,KAAK,GAAG,CAAC,KAAa,EAAO,EAAE,CAAC,KAAY,CAAC;AAE1D,qFAAqF;AACrF,MAAM,CAAC,MAAM,UAAU,GAAG,CAAC,KAAa,EAAY,EAAE,CAAC,KAAiB,CAAC;AACzE,uFAAuF;AACvF,MAAM,CAAC,MAAM,WAAW,GAAG,CAAC,KAAa,EAAa,EAAE,CAAC,KAAkB,CAAC"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import type { FlowExpect } from './flow-types.js';
|
|
2
|
+
/**
|
|
3
|
+
* The product thesis, in one place: a verification "kind" is either a CONSEQUENCE (the app provably
|
|
4
|
+
* did something a locator healed to the WRONG element, or a stale render, cannot fake) or a mere
|
|
5
|
+
* PRESENCE check (which such a wrong locator CAN still satisfy). This classification is the moat —
|
|
6
|
+
* it decides when "green" actually means the feature worked. It was implemented three times over
|
|
7
|
+
* (flow classification, ad-hoc assert grading, flow-success compilation); keeping the vocabulary here
|
|
8
|
+
* means a contributor can never strengthen one grader and silently leave the others weaker.
|
|
9
|
+
*/
|
|
10
|
+
/** Kinds whose satisfaction proves an observable outcome — a wrong/healed element cannot fake them. */
|
|
11
|
+
export declare const ConsequenceKind: {
|
|
12
|
+
readonly SIGNAL: "signal";
|
|
13
|
+
readonly NET: "net";
|
|
14
|
+
readonly STATE: "state";
|
|
15
|
+
};
|
|
16
|
+
export type ConsequenceKind = (typeof ConsequenceKind)[keyof typeof ConsequenceKind];
|
|
17
|
+
/** Kinds that only check presence — weak, because a healed-but-wrong locator can still satisfy them. */
|
|
18
|
+
export declare const PresenceKind: {
|
|
19
|
+
readonly ELEMENT: "element";
|
|
20
|
+
readonly TEXT: "text";
|
|
21
|
+
};
|
|
22
|
+
export type PresenceKind = (typeof PresenceKind)[keyof typeof PresenceKind];
|
|
23
|
+
/** True when `kind` (a predicate/expect kind) asserts a consequence (signal/net/state). */
|
|
24
|
+
export declare function isConsequenceKind(kind: string): boolean;
|
|
25
|
+
/** True when `kind` is a weak presence check (element/text). */
|
|
26
|
+
export declare function isPresenceKind(kind: string): boolean;
|
|
27
|
+
/** True when a FlowExpect asserts at least one consequence (any of the ConsequenceKind fields set). */
|
|
28
|
+
export declare function flowExpectHasConsequence(expect: FlowExpect | undefined): boolean;
|
|
29
|
+
/** True when a FlowExpect checks ONLY element presence — no consequence field is set. */
|
|
30
|
+
export declare function flowExpectIsPresenceOnly(expect: FlowExpect | undefined): boolean;
|
|
31
|
+
//# sourceMappingURL=consequence.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"consequence.d.ts","sourceRoot":"","sources":["../src/consequence.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAElD;;;;;;;GAOG;AAEH,uGAAuG;AACvG,eAAO,MAAM,eAAe;;;;CAIlB,CAAC;AACX,MAAM,MAAM,eAAe,GAAG,CAAC,OAAO,eAAe,CAAC,CAAC,MAAM,OAAO,eAAe,CAAC,CAAC;AAErF,wGAAwG;AACxG,eAAO,MAAM,YAAY;;;CAGf,CAAC;AACX,MAAM,MAAM,YAAY,GAAG,CAAC,OAAO,YAAY,CAAC,CAAC,MAAM,OAAO,YAAY,CAAC,CAAC;AAK5E,2FAA2F;AAC3F,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAEvD;AAED,gEAAgE;AAChE,wBAAgB,cAAc,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAEpD;AAED,uGAAuG;AACvG,wBAAgB,wBAAwB,CAAC,MAAM,EAAE,UAAU,GAAG,SAAS,GAAG,OAAO,CAOhF;AAED,yFAAyF;AACzF,wBAAgB,wBAAwB,CAAC,MAAM,EAAE,UAAU,GAAG,SAAS,GAAG,OAAO,CAEhF"}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The product thesis, in one place: a verification "kind" is either a CONSEQUENCE (the app provably
|
|
3
|
+
* did something a locator healed to the WRONG element, or a stale render, cannot fake) or a mere
|
|
4
|
+
* PRESENCE check (which such a wrong locator CAN still satisfy). This classification is the moat —
|
|
5
|
+
* it decides when "green" actually means the feature worked. It was implemented three times over
|
|
6
|
+
* (flow classification, ad-hoc assert grading, flow-success compilation); keeping the vocabulary here
|
|
7
|
+
* means a contributor can never strengthen one grader and silently leave the others weaker.
|
|
8
|
+
*/
|
|
9
|
+
/** Kinds whose satisfaction proves an observable outcome — a wrong/healed element cannot fake them. */
|
|
10
|
+
export const ConsequenceKind = {
|
|
11
|
+
SIGNAL: 'signal',
|
|
12
|
+
NET: 'net',
|
|
13
|
+
STATE: 'state',
|
|
14
|
+
};
|
|
15
|
+
/** Kinds that only check presence — weak, because a healed-but-wrong locator can still satisfy them. */
|
|
16
|
+
export const PresenceKind = {
|
|
17
|
+
ELEMENT: 'element',
|
|
18
|
+
TEXT: 'text',
|
|
19
|
+
};
|
|
20
|
+
const CONSEQUENCE_KINDS = new Set(Object.values(ConsequenceKind));
|
|
21
|
+
const PRESENCE_KINDS = new Set(Object.values(PresenceKind));
|
|
22
|
+
/** True when `kind` (a predicate/expect kind) asserts a consequence (signal/net/state). */
|
|
23
|
+
export function isConsequenceKind(kind) {
|
|
24
|
+
return CONSEQUENCE_KINDS.has(kind);
|
|
25
|
+
}
|
|
26
|
+
/** True when `kind` is a weak presence check (element/text). */
|
|
27
|
+
export function isPresenceKind(kind) {
|
|
28
|
+
return PRESENCE_KINDS.has(kind);
|
|
29
|
+
}
|
|
30
|
+
/** True when a FlowExpect asserts at least one consequence (any of the ConsequenceKind fields set). */
|
|
31
|
+
export function flowExpectHasConsequence(expect) {
|
|
32
|
+
if (expect === undefined)
|
|
33
|
+
return false;
|
|
34
|
+
const fields = expect;
|
|
35
|
+
for (const kind of CONSEQUENCE_KINDS) {
|
|
36
|
+
if (fields[kind] !== undefined)
|
|
37
|
+
return true;
|
|
38
|
+
}
|
|
39
|
+
return false;
|
|
40
|
+
}
|
|
41
|
+
/** True when a FlowExpect checks ONLY element presence — no consequence field is set. */
|
|
42
|
+
export function flowExpectIsPresenceOnly(expect) {
|
|
43
|
+
return expect !== undefined && expect.element !== undefined && !flowExpectHasConsequence(expect);
|
|
44
|
+
}
|
|
45
|
+
//# sourceMappingURL=consequence.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"consequence.js","sourceRoot":"","sources":["../src/consequence.ts"],"names":[],"mappings":"AAEA;;;;;;;GAOG;AAEH,uGAAuG;AACvG,MAAM,CAAC,MAAM,eAAe,GAAG;IAC7B,MAAM,EAAE,QAAQ;IAChB,GAAG,EAAE,KAAK;IACV,KAAK,EAAE,OAAO;CACN,CAAC;AAGX,wGAAwG;AACxG,MAAM,CAAC,MAAM,YAAY,GAAG;IAC1B,OAAO,EAAE,SAAS;IAClB,IAAI,EAAE,MAAM;CACJ,CAAC;AAGX,MAAM,iBAAiB,GAAwB,IAAI,GAAG,CAAC,MAAM,CAAC,MAAM,CAAC,eAAe,CAAC,CAAC,CAAC;AACvF,MAAM,cAAc,GAAwB,IAAI,GAAG,CAAC,MAAM,CAAC,MAAM,CAAC,YAAY,CAAC,CAAC,CAAC;AAEjF,2FAA2F;AAC3F,MAAM,UAAU,iBAAiB,CAAC,IAAY;IAC5C,OAAO,iBAAiB,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;AACrC,CAAC;AAED,gEAAgE;AAChE,MAAM,UAAU,cAAc,CAAC,IAAY;IACzC,OAAO,cAAc,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;AAClC,CAAC;AAED,uGAAuG;AACvG,MAAM,UAAU,wBAAwB,CAAC,MAA8B;IACrE,IAAI,MAAM,KAAK,SAAS;QAAE,OAAO,KAAK,CAAC;IACvC,MAAM,MAAM,GAAG,MAAiC,CAAC;IACjD,KAAK,MAAM,IAAI,IAAI,iBAAiB,EAAE,CAAC;QACrC,IAAI,MAAM,CAAC,IAAI,CAAC,KAAK,SAAS;YAAE,OAAO,IAAI,CAAC;IAC9C,CAAC;IACD,OAAO,KAAK,CAAC;AACf,CAAC;AAED,yFAAyF;AACzF,MAAM,UAAU,wBAAwB,CAAC,MAA8B;IACrE,OAAO,MAAM,KAAK,SAAS,IAAI,MAAM,CAAC,OAAO,KAAK,SAAS,IAAI,CAAC,wBAAwB,CAAC,MAAM,CAAC,CAAC;AACnG,CAAC"}
|