@tanagram/lore 0.1.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 +557 -0
- package/dist/index.js +2 -0
- package/package.json +31 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,557 @@
|
|
|
1
|
+
Server Side Public License
|
|
2
|
+
VERSION 1, OCTOBER 16, 2018
|
|
3
|
+
|
|
4
|
+
Copyright © 2026 Tanagram, Inc.
|
|
5
|
+
|
|
6
|
+
Everyone is permitted to copy and distribute verbatim copies of this
|
|
7
|
+
license document, but changing it is not allowed.
|
|
8
|
+
|
|
9
|
+
TERMS AND CONDITIONS
|
|
10
|
+
|
|
11
|
+
0. Definitions.
|
|
12
|
+
|
|
13
|
+
“This License” refers to Server Side Public License.
|
|
14
|
+
|
|
15
|
+
“Copyright” also means copyright-like laws that apply to other kinds of
|
|
16
|
+
works, such as semiconductor masks.
|
|
17
|
+
|
|
18
|
+
“The Program” refers to any copyrightable work licensed under this
|
|
19
|
+
License. Each licensee is addressed as “you”. “Licensees” and
|
|
20
|
+
“recipients” may be individuals or organizations.
|
|
21
|
+
|
|
22
|
+
To “modify” a work means to copy from or adapt all or part of the work in
|
|
23
|
+
a fashion requiring copyright permission, other than the making of an
|
|
24
|
+
exact copy. The resulting work is called a “modified version” of the
|
|
25
|
+
earlier work or a work “based on” the earlier work.
|
|
26
|
+
|
|
27
|
+
A “covered work” means either the unmodified Program or a work based on
|
|
28
|
+
the Program.
|
|
29
|
+
|
|
30
|
+
To “propagate” a work means to do anything with it that, without
|
|
31
|
+
permission, would make you directly or secondarily liable for
|
|
32
|
+
infringement under applicable copyright law, except executing it on a
|
|
33
|
+
computer or modifying a private copy. Propagation includes copying,
|
|
34
|
+
distribution (with or without modification), making available to the
|
|
35
|
+
public, and in some countries other activities as well.
|
|
36
|
+
|
|
37
|
+
To “convey” a work means any kind of propagation that enables other
|
|
38
|
+
parties to make or receive copies. Mere interaction with a user through a
|
|
39
|
+
computer network, with no transfer of a copy, is not conveying.
|
|
40
|
+
|
|
41
|
+
An interactive user interface displays “Appropriate Legal Notices” to the
|
|
42
|
+
extent that it includes a convenient and prominently visible feature that
|
|
43
|
+
(1) displays an appropriate copyright notice, and (2) tells the user that
|
|
44
|
+
there is no warranty for the work (except to the extent that warranties
|
|
45
|
+
are provided), that licensees may convey the work under this License, and
|
|
46
|
+
how to view a copy of this License. If the interface presents a list of
|
|
47
|
+
user commands or options, such as a menu, a prominent item in the list
|
|
48
|
+
meets this criterion.
|
|
49
|
+
|
|
50
|
+
1. Source Code.
|
|
51
|
+
|
|
52
|
+
The “source code” for a work means the preferred form of the work for
|
|
53
|
+
making modifications to it. “Object code” means any non-source form of a
|
|
54
|
+
work.
|
|
55
|
+
|
|
56
|
+
A “Standard Interface” means an interface that either is an official
|
|
57
|
+
standard defined by a recognized standards body, or, in the case of
|
|
58
|
+
interfaces specified for a particular programming language, one that is
|
|
59
|
+
widely used among developers working in that language. The “System
|
|
60
|
+
Libraries” of an executable work include anything, other than the work as
|
|
61
|
+
a whole, that (a) is included in the normal form of packaging a Major
|
|
62
|
+
Component, but which is not part of that Major Component, and (b) serves
|
|
63
|
+
only to enable use of the work with that Major Component, or to implement
|
|
64
|
+
a Standard Interface for which an implementation is available to the
|
|
65
|
+
public in source code form. A “Major Component”, in this context, means a
|
|
66
|
+
major essential component (kernel, window system, and so on) of the
|
|
67
|
+
specific operating system (if any) on which the executable work runs, or
|
|
68
|
+
a compiler used to produce the work, or an object code interpreter used
|
|
69
|
+
to run it.
|
|
70
|
+
|
|
71
|
+
The “Corresponding Source” for a work in object code form means all the
|
|
72
|
+
source code needed to generate, install, and (for an executable work) run
|
|
73
|
+
the object code and to modify the work, including scripts to control
|
|
74
|
+
those activities. However, it does not include the work's System
|
|
75
|
+
Libraries, or general-purpose tools or generally available free programs
|
|
76
|
+
which are used unmodified in performing those activities but which are
|
|
77
|
+
not part of the work. For example, Corresponding Source includes
|
|
78
|
+
interface definition files associated with source files for the work, and
|
|
79
|
+
the source code for shared libraries and dynamically linked subprograms
|
|
80
|
+
that the work is specifically designed to require, such as by intimate
|
|
81
|
+
data communication or control flow between those subprograms and other
|
|
82
|
+
parts of the work.
|
|
83
|
+
|
|
84
|
+
The Corresponding Source need not include anything that users can
|
|
85
|
+
regenerate automatically from other parts of the Corresponding Source.
|
|
86
|
+
|
|
87
|
+
The Corresponding Source for a work in source code form is that same work.
|
|
88
|
+
|
|
89
|
+
2. Basic Permissions.
|
|
90
|
+
|
|
91
|
+
All rights granted under this License are granted for the term of
|
|
92
|
+
copyright on the Program, and are irrevocable provided the stated
|
|
93
|
+
conditions are met. This License explicitly affirms your unlimited
|
|
94
|
+
permission to run the unmodified Program, subject to section 13. The
|
|
95
|
+
output from running a covered work is covered by this License only if the
|
|
96
|
+
output, given its content, constitutes a covered work. This License
|
|
97
|
+
acknowledges your rights of fair use or other equivalent, as provided by
|
|
98
|
+
copyright law. Subject to section 13, you may make, run and propagate
|
|
99
|
+
covered works that you do not convey, without conditions so long as your
|
|
100
|
+
license otherwise remains in force. You may convey covered works to
|
|
101
|
+
others for the sole purpose of having them make modifications exclusively
|
|
102
|
+
for you, or provide you with facilities for running those works, provided
|
|
103
|
+
that you comply with the terms of this License in conveying all
|
|
104
|
+
material for which you do not control copyright. Those thus making or
|
|
105
|
+
running the covered works for you must do so exclusively on your
|
|
106
|
+
behalf, under your direction and control, on terms that prohibit them
|
|
107
|
+
from making any copies of your copyrighted material outside their
|
|
108
|
+
relationship with you.
|
|
109
|
+
|
|
110
|
+
Conveying under any other circumstances is permitted solely under the
|
|
111
|
+
conditions stated below. Sublicensing is not allowed; section 10 makes it
|
|
112
|
+
unnecessary.
|
|
113
|
+
|
|
114
|
+
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
|
|
115
|
+
|
|
116
|
+
No covered work shall be deemed part of an effective technological
|
|
117
|
+
measure under any applicable law fulfilling obligations under article 11
|
|
118
|
+
of the WIPO copyright treaty adopted on 20 December 1996, or similar laws
|
|
119
|
+
prohibiting or restricting circumvention of such measures.
|
|
120
|
+
|
|
121
|
+
When you convey a covered work, you waive any legal power to forbid
|
|
122
|
+
circumvention of technological measures to the extent such circumvention is
|
|
123
|
+
effected by exercising rights under this License with respect to the
|
|
124
|
+
covered work, and you disclaim any intention to limit operation or
|
|
125
|
+
modification of the work as a means of enforcing, against the work's users,
|
|
126
|
+
your or third parties' legal rights to forbid circumvention of
|
|
127
|
+
technological measures.
|
|
128
|
+
|
|
129
|
+
4. Conveying Verbatim Copies.
|
|
130
|
+
|
|
131
|
+
You may convey verbatim copies of the Program's source code as you
|
|
132
|
+
receive it, in any medium, provided that you conspicuously and
|
|
133
|
+
appropriately publish on each copy an appropriate copyright notice; keep
|
|
134
|
+
intact all notices stating that this License and any non-permissive terms
|
|
135
|
+
added in accord with section 7 apply to the code; keep intact all notices
|
|
136
|
+
of the absence of any warranty; and give all recipients a copy of this
|
|
137
|
+
License along with the Program. You may charge any price or no price for
|
|
138
|
+
each copy that you convey, and you may offer support or warranty
|
|
139
|
+
protection for a fee.
|
|
140
|
+
|
|
141
|
+
5. Conveying Modified Source Versions.
|
|
142
|
+
|
|
143
|
+
You may convey a work based on the Program, or the modifications to
|
|
144
|
+
produce it from the Program, in the form of source code under the terms
|
|
145
|
+
of section 4, provided that you also meet all of these conditions:
|
|
146
|
+
|
|
147
|
+
a) The work must carry prominent notices stating that you modified it,
|
|
148
|
+
and giving a relevant date.
|
|
149
|
+
|
|
150
|
+
b) The work must carry prominent notices stating that it is released
|
|
151
|
+
under this License and any conditions added under section 7. This
|
|
152
|
+
requirement modifies the requirement in section 4 to “keep intact all
|
|
153
|
+
notices”.
|
|
154
|
+
|
|
155
|
+
c) You must license the entire work, as a whole, under this License to
|
|
156
|
+
anyone who comes into possession of a copy. This License will therefore
|
|
157
|
+
apply, along with any applicable section 7 additional terms, to the
|
|
158
|
+
whole of the work, and all its parts, regardless of how they are
|
|
159
|
+
packaged. This License gives no permission to license the work in any
|
|
160
|
+
other way, but it does not invalidate such permission if you have
|
|
161
|
+
separately received it.
|
|
162
|
+
|
|
163
|
+
d) If the work has interactive user interfaces, each must display
|
|
164
|
+
Appropriate Legal Notices; however, if the Program has interactive
|
|
165
|
+
interfaces that do not display Appropriate Legal Notices, your work
|
|
166
|
+
need not make them do so.
|
|
167
|
+
|
|
168
|
+
A compilation of a covered work with other separate and independent
|
|
169
|
+
works, which are not by their nature extensions of the covered work, and
|
|
170
|
+
which are not combined with it such as to form a larger program, in or on
|
|
171
|
+
a volume of a storage or distribution medium, is called an “aggregate” if
|
|
172
|
+
the compilation and its resulting copyright are not used to limit the
|
|
173
|
+
access or legal rights of the compilation's users beyond what the
|
|
174
|
+
individual works permit. Inclusion of a covered work in an aggregate does
|
|
175
|
+
not cause this License to apply to the other parts of the aggregate.
|
|
176
|
+
|
|
177
|
+
6. Conveying Non-Source Forms.
|
|
178
|
+
|
|
179
|
+
You may convey a covered work in object code form under the terms of
|
|
180
|
+
sections 4 and 5, provided that you also convey the machine-readable
|
|
181
|
+
Corresponding Source under the terms of this License, in one of these
|
|
182
|
+
ways:
|
|
183
|
+
|
|
184
|
+
a) Convey the object code in, or embodied in, a physical product
|
|
185
|
+
(including a physical distribution medium), accompanied by the
|
|
186
|
+
Corresponding Source fixed on a durable physical medium customarily
|
|
187
|
+
used for software interchange.
|
|
188
|
+
|
|
189
|
+
b) Convey the object code in, or embodied in, a physical product
|
|
190
|
+
(including a physical distribution medium), accompanied by a written
|
|
191
|
+
offer, valid for at least three years and valid for as long as you
|
|
192
|
+
offer spare parts or customer support for that product model, to give
|
|
193
|
+
anyone who possesses the object code either (1) a copy of the
|
|
194
|
+
Corresponding Source for all the software in the product that is
|
|
195
|
+
covered by this License, on a durable physical medium customarily used
|
|
196
|
+
for software interchange, for a price no more than your reasonable cost
|
|
197
|
+
of physically performing this conveying of source, or (2) access to
|
|
198
|
+
copy the Corresponding Source from a network server at no charge.
|
|
199
|
+
|
|
200
|
+
c) Convey individual copies of the object code with a copy of the
|
|
201
|
+
written offer to provide the Corresponding Source. This alternative is
|
|
202
|
+
allowed only occasionally and noncommercially, and only if you received
|
|
203
|
+
the object code with such an offer, in accord with subsection 6b.
|
|
204
|
+
|
|
205
|
+
d) Convey the object code by offering access from a designated place
|
|
206
|
+
(gratis or for a charge), and offer equivalent access to the
|
|
207
|
+
Corresponding Source in the same way through the same place at no
|
|
208
|
+
further charge. You need not require recipients to copy the
|
|
209
|
+
Corresponding Source along with the object code. If the place to copy
|
|
210
|
+
the object code is a network server, the Corresponding Source may be on
|
|
211
|
+
a different server (operated by you or a third party) that supports
|
|
212
|
+
equivalent copying facilities, provided you maintain clear directions
|
|
213
|
+
next to the object code saying where to find the Corresponding Source.
|
|
214
|
+
Regardless of what server hosts the Corresponding Source, you remain
|
|
215
|
+
obligated to ensure that it is available for as long as needed to
|
|
216
|
+
satisfy these requirements.
|
|
217
|
+
|
|
218
|
+
e) Convey the object code using peer-to-peer transmission, provided you
|
|
219
|
+
inform other peers where the object code and Corresponding Source of
|
|
220
|
+
the work are being offered to the general public at no charge under
|
|
221
|
+
subsection 6d.
|
|
222
|
+
|
|
223
|
+
A separable portion of the object code, whose source code is excluded
|
|
224
|
+
from the Corresponding Source as a System Library, need not be included
|
|
225
|
+
in conveying the object code work.
|
|
226
|
+
|
|
227
|
+
A “User Product” is either (1) a “consumer product”, which means any
|
|
228
|
+
tangible personal property which is normally used for personal, family,
|
|
229
|
+
or household purposes, or (2) anything designed or sold for incorporation
|
|
230
|
+
into a dwelling. In determining whether a product is a consumer product,
|
|
231
|
+
doubtful cases shall be resolved in favor of coverage. For a particular
|
|
232
|
+
product received by a particular user, “normally used” refers to a
|
|
233
|
+
typical or common use of that class of product, regardless of the status
|
|
234
|
+
of the particular user or of the way in which the particular user
|
|
235
|
+
actually uses, or expects or is expected to use, the product. A product
|
|
236
|
+
is a consumer product regardless of whether the product has substantial
|
|
237
|
+
commercial, industrial or non-consumer uses, unless such uses represent
|
|
238
|
+
the only significant mode of use of the product.
|
|
239
|
+
|
|
240
|
+
“Installation Information” for a User Product means any methods,
|
|
241
|
+
procedures, authorization keys, or other information required to install
|
|
242
|
+
and execute modified versions of a covered work in that User Product from
|
|
243
|
+
a modified version of its Corresponding Source. The information must
|
|
244
|
+
suffice to ensure that the continued functioning of the modified object
|
|
245
|
+
code is in no case prevented or interfered with solely because
|
|
246
|
+
modification has been made.
|
|
247
|
+
|
|
248
|
+
If you convey an object code work under this section in, or with, or
|
|
249
|
+
specifically for use in, a User Product, and the conveying occurs as part
|
|
250
|
+
of a transaction in which the right of possession and use of the User
|
|
251
|
+
Product is transferred to the recipient in perpetuity or for a fixed term
|
|
252
|
+
(regardless of how the transaction is characterized), the Corresponding
|
|
253
|
+
Source conveyed under this section must be accompanied by the
|
|
254
|
+
Installation Information. But this requirement does not apply if neither
|
|
255
|
+
you nor any third party retains the ability to install modified object
|
|
256
|
+
code on the User Product (for example, the work has been installed in
|
|
257
|
+
ROM).
|
|
258
|
+
|
|
259
|
+
The requirement to provide Installation Information does not include a
|
|
260
|
+
requirement to continue to provide support service, warranty, or updates
|
|
261
|
+
for a work that has been modified or installed by the recipient, or for
|
|
262
|
+
the User Product in which it has been modified or installed. Access
|
|
263
|
+
to a network may be denied when the modification itself materially
|
|
264
|
+
and adversely affects the operation of the network or violates the
|
|
265
|
+
rules and protocols for communication across the network.
|
|
266
|
+
|
|
267
|
+
Corresponding Source conveyed, and Installation Information provided, in
|
|
268
|
+
accord with this section must be in a format that is publicly documented
|
|
269
|
+
(and with an implementation available to the public in source code form),
|
|
270
|
+
and must require no special password or key for unpacking, reading or
|
|
271
|
+
copying.
|
|
272
|
+
|
|
273
|
+
7. Additional Terms.
|
|
274
|
+
|
|
275
|
+
“Additional permissions” are terms that supplement the terms of this
|
|
276
|
+
License by making exceptions from one or more of its conditions.
|
|
277
|
+
Additional permissions that are applicable to the entire Program shall be
|
|
278
|
+
treated as though they were included in this License, to the extent that
|
|
279
|
+
they are valid under applicable law. If additional permissions apply only
|
|
280
|
+
to part of the Program, that part may be used separately under those
|
|
281
|
+
permissions, but the entire Program remains governed by this License
|
|
282
|
+
without regard to the additional permissions. When you convey a copy of
|
|
283
|
+
a covered work, you may at your option remove any additional permissions
|
|
284
|
+
from that copy, or from any part of it. (Additional permissions may be
|
|
285
|
+
written to require their own removal in certain cases when you modify the
|
|
286
|
+
work.) You may place additional permissions on material, added by you to
|
|
287
|
+
a covered work, for which you have or can give appropriate copyright
|
|
288
|
+
permission.
|
|
289
|
+
|
|
290
|
+
Notwithstanding any other provision of this License, for material you add
|
|
291
|
+
to a covered work, you may (if authorized by the copyright holders of
|
|
292
|
+
that material) supplement the terms of this License with terms:
|
|
293
|
+
|
|
294
|
+
a) Disclaiming warranty or limiting liability differently from the
|
|
295
|
+
terms of sections 15 and 16 of this License; or
|
|
296
|
+
|
|
297
|
+
b) Requiring preservation of specified reasonable legal notices or
|
|
298
|
+
author attributions in that material or in the Appropriate Legal
|
|
299
|
+
Notices displayed by works containing it; or
|
|
300
|
+
|
|
301
|
+
c) Prohibiting misrepresentation of the origin of that material, or
|
|
302
|
+
requiring that modified versions of such material be marked in
|
|
303
|
+
reasonable ways as different from the original version; or
|
|
304
|
+
|
|
305
|
+
d) Limiting the use for publicity purposes of names of licensors or
|
|
306
|
+
authors of the material; or
|
|
307
|
+
|
|
308
|
+
e) Declining to grant rights under trademark law for use of some trade
|
|
309
|
+
names, trademarks, or service marks; or
|
|
310
|
+
|
|
311
|
+
f) Requiring indemnification of licensors and authors of that material
|
|
312
|
+
by anyone who conveys the material (or modified versions of it) with
|
|
313
|
+
contractual assumptions of liability to the recipient, for any
|
|
314
|
+
liability that these contractual assumptions directly impose on those
|
|
315
|
+
licensors and authors.
|
|
316
|
+
|
|
317
|
+
All other non-permissive additional terms are considered “further
|
|
318
|
+
restrictions” within the meaning of section 10. If the Program as you
|
|
319
|
+
received it, or any part of it, contains a notice stating that it is
|
|
320
|
+
governed by this License along with a term that is a further restriction,
|
|
321
|
+
you may remove that term. If a license document contains a further
|
|
322
|
+
restriction but permits relicensing or conveying under this License, you
|
|
323
|
+
may add to a covered work material governed by the terms of that license
|
|
324
|
+
document, provided that the further restriction does not survive such
|
|
325
|
+
relicensing or conveying.
|
|
326
|
+
|
|
327
|
+
If you add terms to a covered work in accord with this section, you must
|
|
328
|
+
place, in the relevant source files, a statement of the additional terms
|
|
329
|
+
that apply to those files, or a notice indicating where to find the
|
|
330
|
+
applicable terms. Additional terms, permissive or non-permissive, may be
|
|
331
|
+
stated in the form of a separately written license, or stated as
|
|
332
|
+
exceptions; the above requirements apply either way.
|
|
333
|
+
|
|
334
|
+
8. Termination.
|
|
335
|
+
|
|
336
|
+
You may not propagate or modify a covered work except as expressly
|
|
337
|
+
provided under this License. Any attempt otherwise to propagate or modify
|
|
338
|
+
it is void, and will automatically terminate your rights under this
|
|
339
|
+
License (including any patent licenses granted under the third paragraph
|
|
340
|
+
of section 11).
|
|
341
|
+
|
|
342
|
+
However, if you cease all violation of this License, then your license
|
|
343
|
+
from a particular copyright holder is reinstated (a) provisionally,
|
|
344
|
+
unless and until the copyright holder explicitly and finally terminates
|
|
345
|
+
your license, and (b) permanently, if the copyright holder fails to
|
|
346
|
+
notify you of the violation by some reasonable means prior to 60 days
|
|
347
|
+
after the cessation.
|
|
348
|
+
|
|
349
|
+
Moreover, your license from a particular copyright holder is reinstated
|
|
350
|
+
permanently if the copyright holder notifies you of the violation by some
|
|
351
|
+
reasonable means, this is the first time you have received notice of
|
|
352
|
+
violation of this License (for any work) from that copyright holder, and
|
|
353
|
+
you cure the violation prior to 30 days after your receipt of the notice.
|
|
354
|
+
|
|
355
|
+
Termination of your rights under this section does not terminate the
|
|
356
|
+
licenses of parties who have received copies or rights from you under
|
|
357
|
+
this License. If your rights have been terminated and not permanently
|
|
358
|
+
reinstated, you do not qualify to receive new licenses for the same
|
|
359
|
+
material under section 10.
|
|
360
|
+
|
|
361
|
+
9. Acceptance Not Required for Having Copies.
|
|
362
|
+
|
|
363
|
+
You are not required to accept this License in order to receive or run a
|
|
364
|
+
copy of the Program. Ancillary propagation of a covered work occurring
|
|
365
|
+
solely as a consequence of using peer-to-peer transmission to receive a
|
|
366
|
+
copy likewise does not require acceptance. However, nothing other than
|
|
367
|
+
this License grants you permission to propagate or modify any covered
|
|
368
|
+
work. These actions infringe copyright if you do not accept this License.
|
|
369
|
+
Therefore, by modifying or propagating a covered work, you indicate your
|
|
370
|
+
acceptance of this License to do so.
|
|
371
|
+
|
|
372
|
+
10. Automatic Licensing of Downstream Recipients.
|
|
373
|
+
|
|
374
|
+
Each time you convey a covered work, the recipient automatically receives
|
|
375
|
+
a license from the original licensors, to run, modify and propagate that
|
|
376
|
+
work, subject to this License. You are not responsible for enforcing
|
|
377
|
+
compliance by third parties with this License.
|
|
378
|
+
|
|
379
|
+
An “entity transaction” is a transaction transferring control of an
|
|
380
|
+
organization, or substantially all assets of one, or subdividing an
|
|
381
|
+
organization, or merging organizations. If propagation of a covered work
|
|
382
|
+
results from an entity transaction, each party to that transaction who
|
|
383
|
+
receives a copy of the work also receives whatever licenses to the work
|
|
384
|
+
the party's predecessor in interest had or could give under the previous
|
|
385
|
+
paragraph, plus a right to possession of the Corresponding Source of the
|
|
386
|
+
work from the predecessor in interest, if the predecessor has it or can
|
|
387
|
+
get it with reasonable efforts.
|
|
388
|
+
|
|
389
|
+
You may not impose any further restrictions on the exercise of the rights
|
|
390
|
+
granted or affirmed under this License. For example, you may not impose a
|
|
391
|
+
license fee, royalty, or other charge for exercise of rights granted
|
|
392
|
+
under this License, and you may not initiate litigation (including a
|
|
393
|
+
cross-claim or counterclaim in a lawsuit) alleging that any patent claim
|
|
394
|
+
is infringed by making, using, selling, offering for sale, or importing
|
|
395
|
+
the Program or any portion of it.
|
|
396
|
+
|
|
397
|
+
11. Patents.
|
|
398
|
+
|
|
399
|
+
A “contributor” is a copyright holder who authorizes use under this
|
|
400
|
+
License of the Program or a work on which the Program is based. The work
|
|
401
|
+
thus licensed is called the contributor's “contributor version”.
|
|
402
|
+
|
|
403
|
+
A contributor's “essential patent claims” are all patent claims owned or
|
|
404
|
+
controlled by the contributor, whether already acquired or hereafter
|
|
405
|
+
acquired, that would be infringed by some manner, permitted by this
|
|
406
|
+
License, of making, using, or selling its contributor version, but do not
|
|
407
|
+
include claims that would be infringed only as a consequence of further
|
|
408
|
+
modification of the contributor version. For purposes of this definition,
|
|
409
|
+
“control” includes the right to grant patent sublicenses in a manner
|
|
410
|
+
consistent with the requirements of this License.
|
|
411
|
+
|
|
412
|
+
Each contributor grants you a non-exclusive, worldwide, royalty-free
|
|
413
|
+
patent license under the contributor's essential patent claims, to make,
|
|
414
|
+
use, sell, offer for sale, import and otherwise run, modify and propagate
|
|
415
|
+
the contents of its contributor version.
|
|
416
|
+
|
|
417
|
+
In the following three paragraphs, a “patent license” is any express
|
|
418
|
+
agreement or commitment, however denominated, not to enforce a patent
|
|
419
|
+
(such as an express permission to practice a patent or covenant not to
|
|
420
|
+
sue for patent infringement). To “grant” such a patent license to a party
|
|
421
|
+
means to make such an agreement or commitment not to enforce a patent
|
|
422
|
+
against the party.
|
|
423
|
+
|
|
424
|
+
If you convey a covered work, knowingly relying on a patent license, and
|
|
425
|
+
the Corresponding Source of the work is not available for anyone to copy,
|
|
426
|
+
free of charge and under the terms of this License, through a publicly
|
|
427
|
+
available network server or other readily accessible means, then you must
|
|
428
|
+
either (1) cause the Corresponding Source to be so available, or (2)
|
|
429
|
+
arrange to deprive yourself of the benefit of the patent license for this
|
|
430
|
+
particular work, or (3) arrange, in a manner consistent with the
|
|
431
|
+
requirements of this License, to extend the patent license to downstream
|
|
432
|
+
recipients. “Knowingly relying” means you have actual knowledge that, but
|
|
433
|
+
for the patent license, your conveying the covered work in a country, or
|
|
434
|
+
your recipient's use of the covered work in a country, would infringe
|
|
435
|
+
one or more identifiable patents in that country that you have reason
|
|
436
|
+
to believe are valid.
|
|
437
|
+
|
|
438
|
+
If, pursuant to or in connection with a single transaction or
|
|
439
|
+
arrangement, you convey, or propagate by procuring conveyance of, a
|
|
440
|
+
covered work, and grant a patent license to some of the parties receiving
|
|
441
|
+
the covered work authorizing them to use, propagate, modify or convey a
|
|
442
|
+
specific copy of the covered work, then the patent license you grant is
|
|
443
|
+
automatically extended to all recipients of the covered work and works
|
|
444
|
+
based on it.
|
|
445
|
+
|
|
446
|
+
A patent license is “discriminatory” if it does not include within the
|
|
447
|
+
scope of its coverage, prohibits the exercise of, or is conditioned on
|
|
448
|
+
the non-exercise of one or more of the rights that are specifically
|
|
449
|
+
granted under this License. You may not convey a covered work if you are
|
|
450
|
+
a party to an arrangement with a third party that is in the business of
|
|
451
|
+
distributing software, under which you make payment to the third party
|
|
452
|
+
based on the extent of your activity of conveying the work, and under
|
|
453
|
+
which the third party grants, to any of the parties who would receive the
|
|
454
|
+
covered work from you, a discriminatory patent license (a) in connection
|
|
455
|
+
with copies of the covered work conveyed by you (or copies made from
|
|
456
|
+
those copies), or (b) primarily for and in connection with specific
|
|
457
|
+
products or compilations that contain the covered work, unless you
|
|
458
|
+
entered into that arrangement, or that patent license was granted, prior
|
|
459
|
+
to 28 March 2007.
|
|
460
|
+
|
|
461
|
+
Nothing in this License shall be construed as excluding or limiting any
|
|
462
|
+
implied license or other defenses to infringement that may otherwise be
|
|
463
|
+
available to you under applicable patent law.
|
|
464
|
+
|
|
465
|
+
12. No Surrender of Others' Freedom.
|
|
466
|
+
|
|
467
|
+
If conditions are imposed on you (whether by court order, agreement or
|
|
468
|
+
otherwise) that contradict the conditions of this License, they do not
|
|
469
|
+
excuse you from the conditions of this License. If you cannot use,
|
|
470
|
+
propagate or convey a covered work so as to satisfy simultaneously your
|
|
471
|
+
obligations under this License and any other pertinent obligations, then
|
|
472
|
+
as a consequence you may not use, propagate or convey it at all. For
|
|
473
|
+
example, if you agree to terms that obligate you to collect a royalty for
|
|
474
|
+
further conveying from those to whom you convey the Program, the only way
|
|
475
|
+
you could satisfy both those terms and this License would be to refrain
|
|
476
|
+
entirely from conveying the Program.
|
|
477
|
+
|
|
478
|
+
13. Offering the Program as a Service.
|
|
479
|
+
|
|
480
|
+
If you make the functionality of the Program or a modified version
|
|
481
|
+
available to third parties as a service, you must make the Service Source
|
|
482
|
+
Code available via network download to everyone at no charge, under the
|
|
483
|
+
terms of this License. Making the functionality of the Program or
|
|
484
|
+
modified version available to third parties as a service includes,
|
|
485
|
+
without limitation, enabling third parties to interact with the
|
|
486
|
+
functionality of the Program or modified version remotely through a
|
|
487
|
+
computer network, offering a service the value of which entirely or
|
|
488
|
+
primarily derives from the value of the Program or modified version, or
|
|
489
|
+
offering a service that accomplishes for users the primary purpose of the
|
|
490
|
+
Program or modified version.
|
|
491
|
+
|
|
492
|
+
“Service Source Code” means the Corresponding Source for the Program or
|
|
493
|
+
the modified version, and the Corresponding Source for all programs that
|
|
494
|
+
you use to make the Program or modified version available as a service,
|
|
495
|
+
including, without limitation, management software, user interfaces,
|
|
496
|
+
application program interfaces, automation software, monitoring software,
|
|
497
|
+
backup software, storage software and hosting software, all such that a
|
|
498
|
+
user could run an instance of the service using the Service Source Code
|
|
499
|
+
you make available.
|
|
500
|
+
|
|
501
|
+
14. Revised Versions of this License.
|
|
502
|
+
|
|
503
|
+
Tanagram, Inc. may publish revised and/or new versions of the Server Side
|
|
504
|
+
Public License from time to time. Such new versions will be similar in
|
|
505
|
+
spirit to the present version, but may differ in detail to address new
|
|
506
|
+
problems or concerns.
|
|
507
|
+
|
|
508
|
+
Each version is given a distinguishing version number. If the Program
|
|
509
|
+
specifies that a certain numbered version of the Server Side Public
|
|
510
|
+
License “or any later version” applies to it, you have the option of
|
|
511
|
+
following the terms and conditions either of that numbered version or of
|
|
512
|
+
any later version published by Tanagram, Inc. If the Program does not
|
|
513
|
+
specify a version number of the Server Side Public License, you may
|
|
514
|
+
choose any version ever published by Tanagram, Inc.
|
|
515
|
+
|
|
516
|
+
If the Program specifies that a proxy can decide which future versions of
|
|
517
|
+
the Server Side Public License can be used, that proxy's public statement
|
|
518
|
+
of acceptance of a version permanently authorizes you to choose that
|
|
519
|
+
version for the Program.
|
|
520
|
+
|
|
521
|
+
Later license versions may give you additional or different permissions.
|
|
522
|
+
However, no additional obligations are imposed on any author or copyright
|
|
523
|
+
holder as a result of your choosing to follow a later version.
|
|
524
|
+
|
|
525
|
+
15. Disclaimer of Warranty.
|
|
526
|
+
|
|
527
|
+
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
|
|
528
|
+
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
|
|
529
|
+
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM “AS IS” WITHOUT WARRANTY
|
|
530
|
+
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
|
|
531
|
+
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
|
532
|
+
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
|
|
533
|
+
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
|
|
534
|
+
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
|
|
535
|
+
|
|
536
|
+
16. Limitation of Liability.
|
|
537
|
+
|
|
538
|
+
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
|
|
539
|
+
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
|
|
540
|
+
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING
|
|
541
|
+
ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF
|
|
542
|
+
THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO
|
|
543
|
+
LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU
|
|
544
|
+
OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
|
|
545
|
+
PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
|
|
546
|
+
POSSIBILITY OF SUCH DAMAGES.
|
|
547
|
+
|
|
548
|
+
17. Interpretation of Sections 15 and 16.
|
|
549
|
+
|
|
550
|
+
If the disclaimer of warranty and limitation of liability provided above
|
|
551
|
+
cannot be given local legal effect according to their terms, reviewing
|
|
552
|
+
courts shall apply local law that most closely approximates an absolute
|
|
553
|
+
waiver of all civil liability in connection with the Program, unless a
|
|
554
|
+
warranty or assumption of liability accompanies a copy of the Program in
|
|
555
|
+
return for a fee.
|
|
556
|
+
|
|
557
|
+
END OF TERMS AND CONDITIONS
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
var Kt=Object.defineProperty;var Jt=(n,t)=>{for(var r in t)Kt(n,r,{get:t[r],enumerable:!0})};var e={};Jt(e,{BRAND:()=>jr,DIRTY:()=>K,EMPTY_PATH:()=>tr,INVALID:()=>y,NEVER:()=>cn,OK:()=>T,ParseStatus:()=>k,Schema:()=>v,ZodAny:()=>G,ZodArray:()=>V,ZodBigInt:()=>Y,ZodBoolean:()=>X,ZodBranded:()=>Te,ZodCatch:()=>le,ZodDate:()=>ee,ZodDefault:()=>de,ZodDiscriminatedUnion:()=>Oe,ZodEffects:()=>E,ZodEnum:()=>oe,ZodError:()=>z,ZodFirstPartyTypeKind:()=>g,ZodFunction:()=>Ee,ZodIntersection:()=>ae,ZodIssueCode:()=>l,ZodLazy:()=>se,ZodLiteral:()=>ie,ZodMap:()=>_e,ZodNaN:()=>xe,ZodNativeEnum:()=>ce,ZodNever:()=>I,ZodNull:()=>re,ZodNullable:()=>q,ZodNumber:()=>J,ZodObject:()=>C,ZodOptional:()=>O,ZodParsedType:()=>h,ZodPipeline:()=>Re,ZodPromise:()=>Q,ZodReadonly:()=>pe,ZodRecord:()=>Ae,ZodSchema:()=>v,ZodSet:()=>ve,ZodString:()=>F,ZodSymbol:()=>ge,ZodTransformer:()=>E,ZodTuple:()=>B,ZodType:()=>v,ZodUndefined:()=>te,ZodUnion:()=>ne,ZodUnknown:()=>M,ZodVoid:()=>be,addIssueToContext:()=>u,any:()=>Ar,array:()=>Br,bigint:()=>wr,boolean:()=>ut,coerce:()=>on,custom:()=>lt,date:()=>zr,datetimeRegex:()=>ct,defaultErrorMap:()=>D,discriminatedUnion:()=>Dr,effect:()=>Yr,enum:()=>Wr,function:()=>Gr,getErrorMap:()=>he,getParsedType:()=>L,instanceof:()=>Tr,intersection:()=>$r,isAborted:()=>Ce,isAsync:()=>fe,isDirty:()=>Pe,isValid:()=>Z,late:()=>kr,lazy:()=>Qr,literal:()=>Hr,makeIssue:()=>ke,map:()=>Zr,nan:()=>Rr,nativeEnum:()=>Kr,never:()=>Ir,null:()=>Or,nullable:()=>en,number:()=>mt,object:()=>qr,objectUtil:()=>$e,oboolean:()=>sn,onumber:()=>an,optional:()=>Xr,ostring:()=>nn,pipeline:()=>rn,preprocess:()=>tn,promise:()=>Jr,quotelessJson:()=>Yt,record:()=>Vr,set:()=>Fr,setErrorMap:()=>er,strictObject:()=>Ur,string:()=>pt,symbol:()=>Cr,transformer:()=>Yr,tuple:()=>Mr,undefined:()=>Pr,union:()=>Nr,unknown:()=>Er,util:()=>x,void:()=>Lr});var x;(function(n){n.assertEqual=s=>{};function t(s){}n.assertIs=t;function r(s){throw new Error}n.assertNever=r,n.arrayToEnum=s=>{let i={};for(let d of s)i[d]=d;return i},n.getValidEnumValues=s=>{let i=n.objectKeys(s).filter(c=>typeof s[s[c]]!="number"),d={};for(let c of i)d[c]=s[c];return n.objectValues(d)},n.objectValues=s=>n.objectKeys(s).map(function(i){return s[i]}),n.objectKeys=typeof Object.keys=="function"?s=>Object.keys(s):s=>{let i=[];for(let d in s)Object.prototype.hasOwnProperty.call(s,d)&&i.push(d);return i},n.find=(s,i)=>{for(let d of s)if(i(d))return d},n.isInteger=typeof Number.isInteger=="function"?s=>Number.isInteger(s):s=>typeof s=="number"&&Number.isFinite(s)&&Math.floor(s)===s;function a(s,i=" | "){return s.map(d=>typeof d=="string"?`'${d}'`:d).join(i)}n.joinValues=a,n.jsonStringifyReplacer=(s,i)=>typeof i=="bigint"?i.toString():i})(x||(x={}));var $e;(function(n){n.mergeShapes=(t,r)=>({...t,...r})})($e||($e={}));var h=x.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),L=n=>{switch(typeof n){case"undefined":return h.undefined;case"string":return h.string;case"number":return Number.isNaN(n)?h.nan:h.number;case"boolean":return h.boolean;case"function":return h.function;case"bigint":return h.bigint;case"symbol":return h.symbol;case"object":return Array.isArray(n)?h.array:n===null?h.null:n.then&&typeof n.then=="function"&&n.catch&&typeof n.catch=="function"?h.promise:typeof Map<"u"&&n instanceof Map?h.map:typeof Set<"u"&&n instanceof Set?h.set:typeof Date<"u"&&n instanceof Date?h.date:h.object;default:return h.unknown}};var l=x.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]),Yt=n=>JSON.stringify(n,null,2).replace(/"([^"]+)":/g,"$1:"),z=class n extends Error{get errors(){return this.issues}constructor(t){super(),this.issues=[],this.addIssue=a=>{this.issues=[...this.issues,a]},this.addIssues=(a=[])=>{this.issues=[...this.issues,...a]};let r=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,r):this.__proto__=r,this.name="ZodError",this.issues=t}format(t){let r=t||function(i){return i.message},a={_errors:[]},s=i=>{for(let d of i.issues)if(d.code==="invalid_union")d.unionErrors.map(s);else if(d.code==="invalid_return_type")s(d.returnTypeError);else if(d.code==="invalid_arguments")s(d.argumentsError);else if(d.path.length===0)a._errors.push(r(d));else{let c=a,p=0;for(;p<d.path.length;){let m=d.path[p];p===d.path.length-1?(c[m]=c[m]||{_errors:[]},c[m]._errors.push(r(d))):c[m]=c[m]||{_errors:[]},c=c[m],p++}}};return s(this),a}static assert(t){if(!(t instanceof n))throw new Error(`Not a ZodError: ${t}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,x.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(t=r=>r.message){let r={},a=[];for(let s of this.issues)if(s.path.length>0){let i=s.path[0];r[i]=r[i]||[],r[i].push(t(s))}else a.push(t(s));return{formErrors:a,fieldErrors:r}}get formErrors(){return this.flatten()}};z.create=n=>new z(n);var Xt=(n,t)=>{let r;switch(n.code){case l.invalid_type:n.received===h.undefined?r="Required":r=`Expected ${n.expected}, received ${n.received}`;break;case l.invalid_literal:r=`Invalid literal value, expected ${JSON.stringify(n.expected,x.jsonStringifyReplacer)}`;break;case l.unrecognized_keys:r=`Unrecognized key(s) in object: ${x.joinValues(n.keys,", ")}`;break;case l.invalid_union:r="Invalid input";break;case l.invalid_union_discriminator:r=`Invalid discriminator value. Expected ${x.joinValues(n.options)}`;break;case l.invalid_enum_value:r=`Invalid enum value. Expected ${x.joinValues(n.options)}, received '${n.received}'`;break;case l.invalid_arguments:r="Invalid function arguments";break;case l.invalid_return_type:r="Invalid function return type";break;case l.invalid_date:r="Invalid date";break;case l.invalid_string:typeof n.validation=="object"?"includes"in n.validation?(r=`Invalid input: must include "${n.validation.includes}"`,typeof n.validation.position=="number"&&(r=`${r} at one or more positions greater than or equal to ${n.validation.position}`)):"startsWith"in n.validation?r=`Invalid input: must start with "${n.validation.startsWith}"`:"endsWith"in n.validation?r=`Invalid input: must end with "${n.validation.endsWith}"`:x.assertNever(n.validation):n.validation!=="regex"?r=`Invalid ${n.validation}`:r="Invalid";break;case l.too_small:n.type==="array"?r=`Array must contain ${n.exact?"exactly":n.inclusive?"at least":"more than"} ${n.minimum} element(s)`:n.type==="string"?r=`String must contain ${n.exact?"exactly":n.inclusive?"at least":"over"} ${n.minimum} character(s)`:n.type==="number"?r=`Number must be ${n.exact?"exactly equal to ":n.inclusive?"greater than or equal to ":"greater than "}${n.minimum}`:n.type==="bigint"?r=`Number must be ${n.exact?"exactly equal to ":n.inclusive?"greater than or equal to ":"greater than "}${n.minimum}`:n.type==="date"?r=`Date must be ${n.exact?"exactly equal to ":n.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(n.minimum))}`:r="Invalid input";break;case l.too_big:n.type==="array"?r=`Array must contain ${n.exact?"exactly":n.inclusive?"at most":"less than"} ${n.maximum} element(s)`:n.type==="string"?r=`String must contain ${n.exact?"exactly":n.inclusive?"at most":"under"} ${n.maximum} character(s)`:n.type==="number"?r=`Number must be ${n.exact?"exactly":n.inclusive?"less than or equal to":"less than"} ${n.maximum}`:n.type==="bigint"?r=`BigInt must be ${n.exact?"exactly":n.inclusive?"less than or equal to":"less than"} ${n.maximum}`:n.type==="date"?r=`Date must be ${n.exact?"exactly":n.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(n.maximum))}`:r="Invalid input";break;case l.custom:r="Invalid input";break;case l.invalid_intersection_types:r="Intersection results could not be merged";break;case l.not_multiple_of:r=`Number must be a multiple of ${n.multipleOf}`;break;case l.not_finite:r="Number must be finite";break;default:r=t.defaultError,x.assertNever(n)}return{message:r}},D=Xt;var nt=D;function er(n){nt=n}function he(){return nt}var ke=n=>{let{data:t,path:r,errorMaps:a,issueData:s}=n,i=[...r,...s.path||[]],d={...s,path:i};if(s.message!==void 0)return{...s,path:i,message:s.message};let c="",p=a.filter(m=>!!m).slice().reverse();for(let m of p)c=m(d,{data:t,defaultError:c}).message;return{...s,path:i,message:c}},tr=[];function u(n,t){let r=he(),a=ke({issueData:t,data:n.data,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,r,r===D?void 0:D].filter(s=>!!s)});n.common.issues.push(a)}var k=class n{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(t,r){let a=[];for(let s of r){if(s.status==="aborted")return y;s.status==="dirty"&&t.dirty(),a.push(s.value)}return{status:t.value,value:a}}static async mergeObjectAsync(t,r){let a=[];for(let s of r){let i=await s.key,d=await s.value;a.push({key:i,value:d})}return n.mergeObjectSync(t,a)}static mergeObjectSync(t,r){let a={};for(let s of r){let{key:i,value:d}=s;if(i.status==="aborted"||d.status==="aborted")return y;i.status==="dirty"&&t.dirty(),d.status==="dirty"&&t.dirty(),i.value!=="__proto__"&&(typeof d.value<"u"||s.alwaysSet)&&(a[i.value]=d.value)}return{status:t.value,value:a}}},y=Object.freeze({status:"aborted"}),K=n=>({status:"dirty",value:n}),T=n=>({status:"valid",value:n}),Ce=n=>n.status==="aborted",Pe=n=>n.status==="dirty",Z=n=>n.status==="valid",fe=n=>typeof Promise<"u"&&n instanceof Promise;var f;(function(n){n.errToObj=t=>typeof t=="string"?{message:t}:t||{},n.toString=t=>typeof t=="string"?t:t?.message})(f||(f={}));var A=class{constructor(t,r,a,s){this._cachedPath=[],this.parent=t,this.data=r,this._path=a,this._key=s}get path(){return this._cachedPath.length||(Array.isArray(this._key)?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}},at=(n,t)=>{if(Z(t))return{success:!0,data:t.value};if(!n.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;let r=new z(n.common.issues);return this._error=r,this._error}}};function _(n){if(!n)return{};let{errorMap:t,invalid_type_error:r,required_error:a,description:s}=n;if(t&&(r||a))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return t?{errorMap:t,description:s}:{errorMap:(d,c)=>{let{message:p}=n;return d.code==="invalid_enum_value"?{message:p??c.defaultError}:typeof c.data>"u"?{message:p??a??c.defaultError}:d.code!=="invalid_type"?{message:c.defaultError}:{message:p??r??c.defaultError}},description:s}}var v=class{get description(){return this._def.description}_getType(t){return L(t.data)}_getOrReturnCtx(t,r){return r||{common:t.parent.common,data:t.data,parsedType:L(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}_processInputParams(t){return{status:new k,ctx:{common:t.parent.common,data:t.data,parsedType:L(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}}_parseSync(t){let r=this._parse(t);if(fe(r))throw new Error("Synchronous parse encountered promise.");return r}_parseAsync(t){let r=this._parse(t);return Promise.resolve(r)}parse(t,r){let a=this.safeParse(t,r);if(a.success)return a.data;throw a.error}safeParse(t,r){let a={common:{issues:[],async:r?.async??!1,contextualErrorMap:r?.errorMap},path:r?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:L(t)},s=this._parseSync({data:t,path:a.path,parent:a});return at(a,s)}"~validate"(t){let r={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:L(t)};if(!this["~standard"].async)try{let a=this._parseSync({data:t,path:[],parent:r});return Z(a)?{value:a.value}:{issues:r.common.issues}}catch(a){a?.message?.toLowerCase()?.includes("encountered")&&(this["~standard"].async=!0),r.common={issues:[],async:!0}}return this._parseAsync({data:t,path:[],parent:r}).then(a=>Z(a)?{value:a.value}:{issues:r.common.issues})}async parseAsync(t,r){let a=await this.safeParseAsync(t,r);if(a.success)return a.data;throw a.error}async safeParseAsync(t,r){let a={common:{issues:[],contextualErrorMap:r?.errorMap,async:!0},path:r?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:L(t)},s=this._parse({data:t,path:a.path,parent:a}),i=await(fe(s)?s:Promise.resolve(s));return at(a,i)}refine(t,r){let a=s=>typeof r=="string"||typeof r>"u"?{message:r}:typeof r=="function"?r(s):r;return this._refinement((s,i)=>{let d=t(s),c=()=>i.addIssue({code:l.custom,...a(s)});return typeof Promise<"u"&&d instanceof Promise?d.then(p=>p?!0:(c(),!1)):d?!0:(c(),!1)})}refinement(t,r){return this._refinement((a,s)=>t(a)?!0:(s.addIssue(typeof r=="function"?r(a,s):r),!1))}_refinement(t){return new E({schema:this,typeName:g.ZodEffects,effect:{type:"refinement",refinement:t}})}superRefine(t){return this._refinement(t)}constructor(t){this.spa=this.safeParseAsync,this._def=t,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:r=>this["~validate"](r)}}optional(){return O.create(this,this._def)}nullable(){return q.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return V.create(this)}promise(){return Q.create(this,this._def)}or(t){return ne.create([this,t],this._def)}and(t){return ae.create(this,t,this._def)}transform(t){return new E({..._(this._def),schema:this,typeName:g.ZodEffects,effect:{type:"transform",transform:t}})}default(t){let r=typeof t=="function"?t:()=>t;return new de({..._(this._def),innerType:this,defaultValue:r,typeName:g.ZodDefault})}brand(){return new Te({typeName:g.ZodBranded,type:this,..._(this._def)})}catch(t){let r=typeof t=="function"?t:()=>t;return new le({..._(this._def),innerType:this,catchValue:r,typeName:g.ZodCatch})}describe(t){let r=this.constructor;return new r({...this._def,description:t})}pipe(t){return Re.create(this,t)}readonly(){return pe.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}},rr=/^c[^\s-]{8,}$/i,nr=/^[0-9a-z]+$/,ar=/^[0-9A-HJKMNP-TV-Z]{26}$/i,sr=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,ir=/^[a-z0-9_-]{21}$/i,or=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,cr=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,dr=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,lr="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",Me,pr=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,mr=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,ur=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,hr=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,fr=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,yr=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,it="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",gr=new RegExp(`^${it}$`);function ot(n){let t="[0-5]\\d";n.precision?t=`${t}\\.\\d{${n.precision}}`:n.precision==null&&(t=`${t}(\\.\\d+)?`);let r=n.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${t})${r}`}function br(n){return new RegExp(`^${ot(n)}$`)}function ct(n){let t=`${it}T${ot(n)}`,r=[];return r.push(n.local?"Z?":"Z"),n.offset&&r.push("([+-]\\d{2}:?\\d{2})"),t=`${t}(${r.join("|")})`,new RegExp(`^${t}$`)}function _r(n,t){return!!((t==="v4"||!t)&&pr.test(n)||(t==="v6"||!t)&&ur.test(n))}function vr(n,t){if(!or.test(n))return!1;try{let[r]=n.split(".");if(!r)return!1;let a=r.replace(/-/g,"+").replace(/_/g,"/").padEnd(r.length+(4-r.length%4)%4,"="),s=JSON.parse(atob(a));return!(typeof s!="object"||s===null||"typ"in s&&s?.typ!=="JWT"||!s.alg||t&&s.alg!==t)}catch{return!1}}function xr(n,t){return!!((t==="v4"||!t)&&mr.test(n)||(t==="v6"||!t)&&hr.test(n))}var F=class n extends v{_parse(t){if(this._def.coerce&&(t.data=String(t.data)),this._getType(t)!==h.string){let i=this._getOrReturnCtx(t);return u(i,{code:l.invalid_type,expected:h.string,received:i.parsedType}),y}let a=new k,s;for(let i of this._def.checks)if(i.kind==="min")t.data.length<i.value&&(s=this._getOrReturnCtx(t,s),u(s,{code:l.too_small,minimum:i.value,type:"string",inclusive:!0,exact:!1,message:i.message}),a.dirty());else if(i.kind==="max")t.data.length>i.value&&(s=this._getOrReturnCtx(t,s),u(s,{code:l.too_big,maximum:i.value,type:"string",inclusive:!0,exact:!1,message:i.message}),a.dirty());else if(i.kind==="length"){let d=t.data.length>i.value,c=t.data.length<i.value;(d||c)&&(s=this._getOrReturnCtx(t,s),d?u(s,{code:l.too_big,maximum:i.value,type:"string",inclusive:!0,exact:!0,message:i.message}):c&&u(s,{code:l.too_small,minimum:i.value,type:"string",inclusive:!0,exact:!0,message:i.message}),a.dirty())}else if(i.kind==="email")dr.test(t.data)||(s=this._getOrReturnCtx(t,s),u(s,{validation:"email",code:l.invalid_string,message:i.message}),a.dirty());else if(i.kind==="emoji")Me||(Me=new RegExp(lr,"u")),Me.test(t.data)||(s=this._getOrReturnCtx(t,s),u(s,{validation:"emoji",code:l.invalid_string,message:i.message}),a.dirty());else if(i.kind==="uuid")sr.test(t.data)||(s=this._getOrReturnCtx(t,s),u(s,{validation:"uuid",code:l.invalid_string,message:i.message}),a.dirty());else if(i.kind==="nanoid")ir.test(t.data)||(s=this._getOrReturnCtx(t,s),u(s,{validation:"nanoid",code:l.invalid_string,message:i.message}),a.dirty());else if(i.kind==="cuid")rr.test(t.data)||(s=this._getOrReturnCtx(t,s),u(s,{validation:"cuid",code:l.invalid_string,message:i.message}),a.dirty());else if(i.kind==="cuid2")nr.test(t.data)||(s=this._getOrReturnCtx(t,s),u(s,{validation:"cuid2",code:l.invalid_string,message:i.message}),a.dirty());else if(i.kind==="ulid")ar.test(t.data)||(s=this._getOrReturnCtx(t,s),u(s,{validation:"ulid",code:l.invalid_string,message:i.message}),a.dirty());else if(i.kind==="url")try{new URL(t.data)}catch{s=this._getOrReturnCtx(t,s),u(s,{validation:"url",code:l.invalid_string,message:i.message}),a.dirty()}else i.kind==="regex"?(i.regex.lastIndex=0,i.regex.test(t.data)||(s=this._getOrReturnCtx(t,s),u(s,{validation:"regex",code:l.invalid_string,message:i.message}),a.dirty())):i.kind==="trim"?t.data=t.data.trim():i.kind==="includes"?t.data.includes(i.value,i.position)||(s=this._getOrReturnCtx(t,s),u(s,{code:l.invalid_string,validation:{includes:i.value,position:i.position},message:i.message}),a.dirty()):i.kind==="toLowerCase"?t.data=t.data.toLowerCase():i.kind==="toUpperCase"?t.data=t.data.toUpperCase():i.kind==="startsWith"?t.data.startsWith(i.value)||(s=this._getOrReturnCtx(t,s),u(s,{code:l.invalid_string,validation:{startsWith:i.value},message:i.message}),a.dirty()):i.kind==="endsWith"?t.data.endsWith(i.value)||(s=this._getOrReturnCtx(t,s),u(s,{code:l.invalid_string,validation:{endsWith:i.value},message:i.message}),a.dirty()):i.kind==="datetime"?ct(i).test(t.data)||(s=this._getOrReturnCtx(t,s),u(s,{code:l.invalid_string,validation:"datetime",message:i.message}),a.dirty()):i.kind==="date"?gr.test(t.data)||(s=this._getOrReturnCtx(t,s),u(s,{code:l.invalid_string,validation:"date",message:i.message}),a.dirty()):i.kind==="time"?br(i).test(t.data)||(s=this._getOrReturnCtx(t,s),u(s,{code:l.invalid_string,validation:"time",message:i.message}),a.dirty()):i.kind==="duration"?cr.test(t.data)||(s=this._getOrReturnCtx(t,s),u(s,{validation:"duration",code:l.invalid_string,message:i.message}),a.dirty()):i.kind==="ip"?_r(t.data,i.version)||(s=this._getOrReturnCtx(t,s),u(s,{validation:"ip",code:l.invalid_string,message:i.message}),a.dirty()):i.kind==="jwt"?vr(t.data,i.alg)||(s=this._getOrReturnCtx(t,s),u(s,{validation:"jwt",code:l.invalid_string,message:i.message}),a.dirty()):i.kind==="cidr"?xr(t.data,i.version)||(s=this._getOrReturnCtx(t,s),u(s,{validation:"cidr",code:l.invalid_string,message:i.message}),a.dirty()):i.kind==="base64"?fr.test(t.data)||(s=this._getOrReturnCtx(t,s),u(s,{validation:"base64",code:l.invalid_string,message:i.message}),a.dirty()):i.kind==="base64url"?yr.test(t.data)||(s=this._getOrReturnCtx(t,s),u(s,{validation:"base64url",code:l.invalid_string,message:i.message}),a.dirty()):x.assertNever(i);return{status:a.value,value:t.data}}_regex(t,r,a){return this.refinement(s=>t.test(s),{validation:r,code:l.invalid_string,...f.errToObj(a)})}_addCheck(t){return new n({...this._def,checks:[...this._def.checks,t]})}email(t){return this._addCheck({kind:"email",...f.errToObj(t)})}url(t){return this._addCheck({kind:"url",...f.errToObj(t)})}emoji(t){return this._addCheck({kind:"emoji",...f.errToObj(t)})}uuid(t){return this._addCheck({kind:"uuid",...f.errToObj(t)})}nanoid(t){return this._addCheck({kind:"nanoid",...f.errToObj(t)})}cuid(t){return this._addCheck({kind:"cuid",...f.errToObj(t)})}cuid2(t){return this._addCheck({kind:"cuid2",...f.errToObj(t)})}ulid(t){return this._addCheck({kind:"ulid",...f.errToObj(t)})}base64(t){return this._addCheck({kind:"base64",...f.errToObj(t)})}base64url(t){return this._addCheck({kind:"base64url",...f.errToObj(t)})}jwt(t){return this._addCheck({kind:"jwt",...f.errToObj(t)})}ip(t){return this._addCheck({kind:"ip",...f.errToObj(t)})}cidr(t){return this._addCheck({kind:"cidr",...f.errToObj(t)})}datetime(t){return typeof t=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:t}):this._addCheck({kind:"datetime",precision:typeof t?.precision>"u"?null:t?.precision,offset:t?.offset??!1,local:t?.local??!1,...f.errToObj(t?.message)})}date(t){return this._addCheck({kind:"date",message:t})}time(t){return typeof t=="string"?this._addCheck({kind:"time",precision:null,message:t}):this._addCheck({kind:"time",precision:typeof t?.precision>"u"?null:t?.precision,...f.errToObj(t?.message)})}duration(t){return this._addCheck({kind:"duration",...f.errToObj(t)})}regex(t,r){return this._addCheck({kind:"regex",regex:t,...f.errToObj(r)})}includes(t,r){return this._addCheck({kind:"includes",value:t,position:r?.position,...f.errToObj(r?.message)})}startsWith(t,r){return this._addCheck({kind:"startsWith",value:t,...f.errToObj(r)})}endsWith(t,r){return this._addCheck({kind:"endsWith",value:t,...f.errToObj(r)})}min(t,r){return this._addCheck({kind:"min",value:t,...f.errToObj(r)})}max(t,r){return this._addCheck({kind:"max",value:t,...f.errToObj(r)})}length(t,r){return this._addCheck({kind:"length",value:t,...f.errToObj(r)})}nonempty(t){return this.min(1,f.errToObj(t))}trim(){return new n({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new n({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new n({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(t=>t.kind==="datetime")}get isDate(){return!!this._def.checks.find(t=>t.kind==="date")}get isTime(){return!!this._def.checks.find(t=>t.kind==="time")}get isDuration(){return!!this._def.checks.find(t=>t.kind==="duration")}get isEmail(){return!!this._def.checks.find(t=>t.kind==="email")}get isURL(){return!!this._def.checks.find(t=>t.kind==="url")}get isEmoji(){return!!this._def.checks.find(t=>t.kind==="emoji")}get isUUID(){return!!this._def.checks.find(t=>t.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(t=>t.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(t=>t.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(t=>t.kind==="cuid2")}get isULID(){return!!this._def.checks.find(t=>t.kind==="ulid")}get isIP(){return!!this._def.checks.find(t=>t.kind==="ip")}get isCIDR(){return!!this._def.checks.find(t=>t.kind==="cidr")}get isBase64(){return!!this._def.checks.find(t=>t.kind==="base64")}get isBase64url(){return!!this._def.checks.find(t=>t.kind==="base64url")}get minLength(){let t=null;for(let r of this._def.checks)r.kind==="min"&&(t===null||r.value>t)&&(t=r.value);return t}get maxLength(){let t=null;for(let r of this._def.checks)r.kind==="max"&&(t===null||r.value<t)&&(t=r.value);return t}};F.create=n=>new F({checks:[],typeName:g.ZodString,coerce:n?.coerce??!1,..._(n)});function Sr(n,t){let r=(n.toString().split(".")[1]||"").length,a=(t.toString().split(".")[1]||"").length,s=r>a?r:a,i=Number.parseInt(n.toFixed(s).replace(".","")),d=Number.parseInt(t.toFixed(s).replace(".",""));return i%d/10**s}var J=class n extends v{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(t){if(this._def.coerce&&(t.data=Number(t.data)),this._getType(t)!==h.number){let i=this._getOrReturnCtx(t);return u(i,{code:l.invalid_type,expected:h.number,received:i.parsedType}),y}let a,s=new k;for(let i of this._def.checks)i.kind==="int"?x.isInteger(t.data)||(a=this._getOrReturnCtx(t,a),u(a,{code:l.invalid_type,expected:"integer",received:"float",message:i.message}),s.dirty()):i.kind==="min"?(i.inclusive?t.data<i.value:t.data<=i.value)&&(a=this._getOrReturnCtx(t,a),u(a,{code:l.too_small,minimum:i.value,type:"number",inclusive:i.inclusive,exact:!1,message:i.message}),s.dirty()):i.kind==="max"?(i.inclusive?t.data>i.value:t.data>=i.value)&&(a=this._getOrReturnCtx(t,a),u(a,{code:l.too_big,maximum:i.value,type:"number",inclusive:i.inclusive,exact:!1,message:i.message}),s.dirty()):i.kind==="multipleOf"?Sr(t.data,i.value)!==0&&(a=this._getOrReturnCtx(t,a),u(a,{code:l.not_multiple_of,multipleOf:i.value,message:i.message}),s.dirty()):i.kind==="finite"?Number.isFinite(t.data)||(a=this._getOrReturnCtx(t,a),u(a,{code:l.not_finite,message:i.message}),s.dirty()):x.assertNever(i);return{status:s.value,value:t.data}}gte(t,r){return this.setLimit("min",t,!0,f.toString(r))}gt(t,r){return this.setLimit("min",t,!1,f.toString(r))}lte(t,r){return this.setLimit("max",t,!0,f.toString(r))}lt(t,r){return this.setLimit("max",t,!1,f.toString(r))}setLimit(t,r,a,s){return new n({...this._def,checks:[...this._def.checks,{kind:t,value:r,inclusive:a,message:f.toString(s)}]})}_addCheck(t){return new n({...this._def,checks:[...this._def.checks,t]})}int(t){return this._addCheck({kind:"int",message:f.toString(t)})}positive(t){return this._addCheck({kind:"min",value:0,inclusive:!1,message:f.toString(t)})}negative(t){return this._addCheck({kind:"max",value:0,inclusive:!1,message:f.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:0,inclusive:!0,message:f.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:0,inclusive:!0,message:f.toString(t)})}multipleOf(t,r){return this._addCheck({kind:"multipleOf",value:t,message:f.toString(r)})}finite(t){return this._addCheck({kind:"finite",message:f.toString(t)})}safe(t){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:f.toString(t)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:f.toString(t)})}get minValue(){let t=null;for(let r of this._def.checks)r.kind==="min"&&(t===null||r.value>t)&&(t=r.value);return t}get maxValue(){let t=null;for(let r of this._def.checks)r.kind==="max"&&(t===null||r.value<t)&&(t=r.value);return t}get isInt(){return!!this._def.checks.find(t=>t.kind==="int"||t.kind==="multipleOf"&&x.isInteger(t.value))}get isFinite(){let t=null,r=null;for(let a of this._def.checks){if(a.kind==="finite"||a.kind==="int"||a.kind==="multipleOf")return!0;a.kind==="min"?(r===null||a.value>r)&&(r=a.value):a.kind==="max"&&(t===null||a.value<t)&&(t=a.value)}return Number.isFinite(r)&&Number.isFinite(t)}};J.create=n=>new J({checks:[],typeName:g.ZodNumber,coerce:n?.coerce||!1,..._(n)});var Y=class n extends v{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(t){if(this._def.coerce)try{t.data=BigInt(t.data)}catch{return this._getInvalidInput(t)}if(this._getType(t)!==h.bigint)return this._getInvalidInput(t);let a,s=new k;for(let i of this._def.checks)i.kind==="min"?(i.inclusive?t.data<i.value:t.data<=i.value)&&(a=this._getOrReturnCtx(t,a),u(a,{code:l.too_small,type:"bigint",minimum:i.value,inclusive:i.inclusive,message:i.message}),s.dirty()):i.kind==="max"?(i.inclusive?t.data>i.value:t.data>=i.value)&&(a=this._getOrReturnCtx(t,a),u(a,{code:l.too_big,type:"bigint",maximum:i.value,inclusive:i.inclusive,message:i.message}),s.dirty()):i.kind==="multipleOf"?t.data%i.value!==BigInt(0)&&(a=this._getOrReturnCtx(t,a),u(a,{code:l.not_multiple_of,multipleOf:i.value,message:i.message}),s.dirty()):x.assertNever(i);return{status:s.value,value:t.data}}_getInvalidInput(t){let r=this._getOrReturnCtx(t);return u(r,{code:l.invalid_type,expected:h.bigint,received:r.parsedType}),y}gte(t,r){return this.setLimit("min",t,!0,f.toString(r))}gt(t,r){return this.setLimit("min",t,!1,f.toString(r))}lte(t,r){return this.setLimit("max",t,!0,f.toString(r))}lt(t,r){return this.setLimit("max",t,!1,f.toString(r))}setLimit(t,r,a,s){return new n({...this._def,checks:[...this._def.checks,{kind:t,value:r,inclusive:a,message:f.toString(s)}]})}_addCheck(t){return new n({...this._def,checks:[...this._def.checks,t]})}positive(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:f.toString(t)})}negative(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:f.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:f.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:f.toString(t)})}multipleOf(t,r){return this._addCheck({kind:"multipleOf",value:t,message:f.toString(r)})}get minValue(){let t=null;for(let r of this._def.checks)r.kind==="min"&&(t===null||r.value>t)&&(t=r.value);return t}get maxValue(){let t=null;for(let r of this._def.checks)r.kind==="max"&&(t===null||r.value<t)&&(t=r.value);return t}};Y.create=n=>new Y({checks:[],typeName:g.ZodBigInt,coerce:n?.coerce??!1,..._(n)});var X=class extends v{_parse(t){if(this._def.coerce&&(t.data=!!t.data),this._getType(t)!==h.boolean){let a=this._getOrReturnCtx(t);return u(a,{code:l.invalid_type,expected:h.boolean,received:a.parsedType}),y}return T(t.data)}};X.create=n=>new X({typeName:g.ZodBoolean,coerce:n?.coerce||!1,..._(n)});var ee=class n extends v{_parse(t){if(this._def.coerce&&(t.data=new Date(t.data)),this._getType(t)!==h.date){let i=this._getOrReturnCtx(t);return u(i,{code:l.invalid_type,expected:h.date,received:i.parsedType}),y}if(Number.isNaN(t.data.getTime())){let i=this._getOrReturnCtx(t);return u(i,{code:l.invalid_date}),y}let a=new k,s;for(let i of this._def.checks)i.kind==="min"?t.data.getTime()<i.value&&(s=this._getOrReturnCtx(t,s),u(s,{code:l.too_small,message:i.message,inclusive:!0,exact:!1,minimum:i.value,type:"date"}),a.dirty()):i.kind==="max"?t.data.getTime()>i.value&&(s=this._getOrReturnCtx(t,s),u(s,{code:l.too_big,message:i.message,inclusive:!0,exact:!1,maximum:i.value,type:"date"}),a.dirty()):x.assertNever(i);return{status:a.value,value:new Date(t.data.getTime())}}_addCheck(t){return new n({...this._def,checks:[...this._def.checks,t]})}min(t,r){return this._addCheck({kind:"min",value:t.getTime(),message:f.toString(r)})}max(t,r){return this._addCheck({kind:"max",value:t.getTime(),message:f.toString(r)})}get minDate(){let t=null;for(let r of this._def.checks)r.kind==="min"&&(t===null||r.value>t)&&(t=r.value);return t!=null?new Date(t):null}get maxDate(){let t=null;for(let r of this._def.checks)r.kind==="max"&&(t===null||r.value<t)&&(t=r.value);return t!=null?new Date(t):null}};ee.create=n=>new ee({checks:[],coerce:n?.coerce||!1,typeName:g.ZodDate,..._(n)});var ge=class extends v{_parse(t){if(this._getType(t)!==h.symbol){let a=this._getOrReturnCtx(t);return u(a,{code:l.invalid_type,expected:h.symbol,received:a.parsedType}),y}return T(t.data)}};ge.create=n=>new ge({typeName:g.ZodSymbol,..._(n)});var te=class extends v{_parse(t){if(this._getType(t)!==h.undefined){let a=this._getOrReturnCtx(t);return u(a,{code:l.invalid_type,expected:h.undefined,received:a.parsedType}),y}return T(t.data)}};te.create=n=>new te({typeName:g.ZodUndefined,..._(n)});var re=class extends v{_parse(t){if(this._getType(t)!==h.null){let a=this._getOrReturnCtx(t);return u(a,{code:l.invalid_type,expected:h.null,received:a.parsedType}),y}return T(t.data)}};re.create=n=>new re({typeName:g.ZodNull,..._(n)});var G=class extends v{constructor(){super(...arguments),this._any=!0}_parse(t){return T(t.data)}};G.create=n=>new G({typeName:g.ZodAny,..._(n)});var M=class extends v{constructor(){super(...arguments),this._unknown=!0}_parse(t){return T(t.data)}};M.create=n=>new M({typeName:g.ZodUnknown,..._(n)});var I=class extends v{_parse(t){let r=this._getOrReturnCtx(t);return u(r,{code:l.invalid_type,expected:h.never,received:r.parsedType}),y}};I.create=n=>new I({typeName:g.ZodNever,..._(n)});var be=class extends v{_parse(t){if(this._getType(t)!==h.undefined){let a=this._getOrReturnCtx(t);return u(a,{code:l.invalid_type,expected:h.void,received:a.parsedType}),y}return T(t.data)}};be.create=n=>new be({typeName:g.ZodVoid,..._(n)});var V=class n extends v{_parse(t){let{ctx:r,status:a}=this._processInputParams(t),s=this._def;if(r.parsedType!==h.array)return u(r,{code:l.invalid_type,expected:h.array,received:r.parsedType}),y;if(s.exactLength!==null){let d=r.data.length>s.exactLength.value,c=r.data.length<s.exactLength.value;(d||c)&&(u(r,{code:d?l.too_big:l.too_small,minimum:c?s.exactLength.value:void 0,maximum:d?s.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:s.exactLength.message}),a.dirty())}if(s.minLength!==null&&r.data.length<s.minLength.value&&(u(r,{code:l.too_small,minimum:s.minLength.value,type:"array",inclusive:!0,exact:!1,message:s.minLength.message}),a.dirty()),s.maxLength!==null&&r.data.length>s.maxLength.value&&(u(r,{code:l.too_big,maximum:s.maxLength.value,type:"array",inclusive:!0,exact:!1,message:s.maxLength.message}),a.dirty()),r.common.async)return Promise.all([...r.data].map((d,c)=>s.type._parseAsync(new A(r,d,r.path,c)))).then(d=>k.mergeArray(a,d));let i=[...r.data].map((d,c)=>s.type._parseSync(new A(r,d,r.path,c)));return k.mergeArray(a,i)}get element(){return this._def.type}min(t,r){return new n({...this._def,minLength:{value:t,message:f.toString(r)}})}max(t,r){return new n({...this._def,maxLength:{value:t,message:f.toString(r)}})}length(t,r){return new n({...this._def,exactLength:{value:t,message:f.toString(r)}})}nonempty(t){return this.min(1,t)}};V.create=(n,t)=>new V({type:n,minLength:null,maxLength:null,exactLength:null,typeName:g.ZodArray,..._(t)});function ye(n){if(n instanceof C){let t={};for(let r in n.shape){let a=n.shape[r];t[r]=O.create(ye(a))}return new C({...n._def,shape:()=>t})}else return n instanceof V?new V({...n._def,type:ye(n.element)}):n instanceof O?O.create(ye(n.unwrap())):n instanceof q?q.create(ye(n.unwrap())):n instanceof B?B.create(n.items.map(t=>ye(t))):n}var C=class n extends v{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;let t=this._def.shape(),r=x.objectKeys(t);return this._cached={shape:t,keys:r},this._cached}_parse(t){if(this._getType(t)!==h.object){let m=this._getOrReturnCtx(t);return u(m,{code:l.invalid_type,expected:h.object,received:m.parsedType}),y}let{status:a,ctx:s}=this._processInputParams(t),{shape:i,keys:d}=this._getCached(),c=[];if(!(this._def.catchall instanceof I&&this._def.unknownKeys==="strip"))for(let m in s.data)d.includes(m)||c.push(m);let p=[];for(let m of d){let b=i[m],j=s.data[m];p.push({key:{status:"valid",value:m},value:b._parse(new A(s,j,s.path,m)),alwaysSet:m in s.data})}if(this._def.catchall instanceof I){let m=this._def.unknownKeys;if(m==="passthrough")for(let b of c)p.push({key:{status:"valid",value:b},value:{status:"valid",value:s.data[b]}});else if(m==="strict")c.length>0&&(u(s,{code:l.unrecognized_keys,keys:c}),a.dirty());else if(m!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{let m=this._def.catchall;for(let b of c){let j=s.data[b];p.push({key:{status:"valid",value:b},value:m._parse(new A(s,j,s.path,b)),alwaysSet:b in s.data})}}return s.common.async?Promise.resolve().then(async()=>{let m=[];for(let b of p){let j=await b.key,w=await b.value;m.push({key:j,value:w,alwaysSet:b.alwaysSet})}return m}).then(m=>k.mergeObjectSync(a,m)):k.mergeObjectSync(a,p)}get shape(){return this._def.shape()}strict(t){return f.errToObj,new n({...this._def,unknownKeys:"strict",...t!==void 0?{errorMap:(r,a)=>{let s=this._def.errorMap?.(r,a).message??a.defaultError;return r.code==="unrecognized_keys"?{message:f.errToObj(t).message??s}:{message:s}}}:{}})}strip(){return new n({...this._def,unknownKeys:"strip"})}passthrough(){return new n({...this._def,unknownKeys:"passthrough"})}extend(t){return new n({...this._def,shape:()=>({...this._def.shape(),...t})})}merge(t){return new n({unknownKeys:t._def.unknownKeys,catchall:t._def.catchall,shape:()=>({...this._def.shape(),...t._def.shape()}),typeName:g.ZodObject})}setKey(t,r){return this.augment({[t]:r})}catchall(t){return new n({...this._def,catchall:t})}pick(t){let r={};for(let a of x.objectKeys(t))t[a]&&this.shape[a]&&(r[a]=this.shape[a]);return new n({...this._def,shape:()=>r})}omit(t){let r={};for(let a of x.objectKeys(this.shape))t[a]||(r[a]=this.shape[a]);return new n({...this._def,shape:()=>r})}deepPartial(){return ye(this)}partial(t){let r={};for(let a of x.objectKeys(this.shape)){let s=this.shape[a];t&&!t[a]?r[a]=s:r[a]=s.optional()}return new n({...this._def,shape:()=>r})}required(t){let r={};for(let a of x.objectKeys(this.shape))if(t&&!t[a])r[a]=this.shape[a];else{let i=this.shape[a];for(;i instanceof O;)i=i._def.innerType;r[a]=i}return new n({...this._def,shape:()=>r})}keyof(){return dt(x.objectKeys(this.shape))}};C.create=(n,t)=>new C({shape:()=>n,unknownKeys:"strip",catchall:I.create(),typeName:g.ZodObject,..._(t)});C.strictCreate=(n,t)=>new C({shape:()=>n,unknownKeys:"strict",catchall:I.create(),typeName:g.ZodObject,..._(t)});C.lazycreate=(n,t)=>new C({shape:n,unknownKeys:"strip",catchall:I.create(),typeName:g.ZodObject,..._(t)});var ne=class extends v{_parse(t){let{ctx:r}=this._processInputParams(t),a=this._def.options;function s(i){for(let c of i)if(c.result.status==="valid")return c.result;for(let c of i)if(c.result.status==="dirty")return r.common.issues.push(...c.ctx.common.issues),c.result;let d=i.map(c=>new z(c.ctx.common.issues));return u(r,{code:l.invalid_union,unionErrors:d}),y}if(r.common.async)return Promise.all(a.map(async i=>{let d={...r,common:{...r.common,issues:[]},parent:null};return{result:await i._parseAsync({data:r.data,path:r.path,parent:d}),ctx:d}})).then(s);{let i,d=[];for(let p of a){let m={...r,common:{...r.common,issues:[]},parent:null},b=p._parseSync({data:r.data,path:r.path,parent:m});if(b.status==="valid")return b;b.status==="dirty"&&!i&&(i={result:b,ctx:m}),m.common.issues.length&&d.push(m.common.issues)}if(i)return r.common.issues.push(...i.ctx.common.issues),i.result;let c=d.map(p=>new z(p));return u(r,{code:l.invalid_union,unionErrors:c}),y}}get options(){return this._def.options}};ne.create=(n,t)=>new ne({options:n,typeName:g.ZodUnion,..._(t)});var $=n=>n instanceof se?$(n.schema):n instanceof E?$(n.innerType()):n instanceof ie?[n.value]:n instanceof oe?n.options:n instanceof ce?x.objectValues(n.enum):n instanceof de?$(n._def.innerType):n instanceof te?[void 0]:n instanceof re?[null]:n instanceof O?[void 0,...$(n.unwrap())]:n instanceof q?[null,...$(n.unwrap())]:n instanceof Te||n instanceof pe?$(n.unwrap()):n instanceof le?$(n._def.innerType):[],Oe=class n extends v{_parse(t){let{ctx:r}=this._processInputParams(t);if(r.parsedType!==h.object)return u(r,{code:l.invalid_type,expected:h.object,received:r.parsedType}),y;let a=this.discriminator,s=r.data[a],i=this.optionsMap.get(s);return i?r.common.async?i._parseAsync({data:r.data,path:r.path,parent:r}):i._parseSync({data:r.data,path:r.path,parent:r}):(u(r,{code:l.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[a]}),y)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(t,r,a){let s=new Map;for(let i of r){let d=$(i.shape[t]);if(!d.length)throw new Error(`A discriminator value for key \`${t}\` could not be extracted from all schema options`);for(let c of d){if(s.has(c))throw new Error(`Discriminator property ${String(t)} has duplicate value ${String(c)}`);s.set(c,i)}}return new n({typeName:g.ZodDiscriminatedUnion,discriminator:t,options:r,optionsMap:s,..._(a)})}};function Ve(n,t){let r=L(n),a=L(t);if(n===t)return{valid:!0,data:n};if(r===h.object&&a===h.object){let s=x.objectKeys(t),i=x.objectKeys(n).filter(c=>s.indexOf(c)!==-1),d={...n,...t};for(let c of i){let p=Ve(n[c],t[c]);if(!p.valid)return{valid:!1};d[c]=p.data}return{valid:!0,data:d}}else if(r===h.array&&a===h.array){if(n.length!==t.length)return{valid:!1};let s=[];for(let i=0;i<n.length;i++){let d=n[i],c=t[i],p=Ve(d,c);if(!p.valid)return{valid:!1};s.push(p.data)}return{valid:!0,data:s}}else return r===h.date&&a===h.date&&+n==+t?{valid:!0,data:n}:{valid:!1}}var ae=class extends v{_parse(t){let{status:r,ctx:a}=this._processInputParams(t),s=(i,d)=>{if(Ce(i)||Ce(d))return y;let c=Ve(i.value,d.value);return c.valid?((Pe(i)||Pe(d))&&r.dirty(),{status:r.value,value:c.data}):(u(a,{code:l.invalid_intersection_types}),y)};return a.common.async?Promise.all([this._def.left._parseAsync({data:a.data,path:a.path,parent:a}),this._def.right._parseAsync({data:a.data,path:a.path,parent:a})]).then(([i,d])=>s(i,d)):s(this._def.left._parseSync({data:a.data,path:a.path,parent:a}),this._def.right._parseSync({data:a.data,path:a.path,parent:a}))}};ae.create=(n,t,r)=>new ae({left:n,right:t,typeName:g.ZodIntersection,..._(r)});var B=class n extends v{_parse(t){let{status:r,ctx:a}=this._processInputParams(t);if(a.parsedType!==h.array)return u(a,{code:l.invalid_type,expected:h.array,received:a.parsedType}),y;if(a.data.length<this._def.items.length)return u(a,{code:l.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),y;!this._def.rest&&a.data.length>this._def.items.length&&(u(a,{code:l.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),r.dirty());let i=[...a.data].map((d,c)=>{let p=this._def.items[c]||this._def.rest;return p?p._parse(new A(a,d,a.path,c)):null}).filter(d=>!!d);return a.common.async?Promise.all(i).then(d=>k.mergeArray(r,d)):k.mergeArray(r,i)}get items(){return this._def.items}rest(t){return new n({...this._def,rest:t})}};B.create=(n,t)=>{if(!Array.isArray(n))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new B({items:n,typeName:g.ZodTuple,rest:null,..._(t)})};var Ae=class n extends v{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){let{status:r,ctx:a}=this._processInputParams(t);if(a.parsedType!==h.object)return u(a,{code:l.invalid_type,expected:h.object,received:a.parsedType}),y;let s=[],i=this._def.keyType,d=this._def.valueType;for(let c in a.data)s.push({key:i._parse(new A(a,c,a.path,c)),value:d._parse(new A(a,a.data[c],a.path,c)),alwaysSet:c in a.data});return a.common.async?k.mergeObjectAsync(r,s):k.mergeObjectSync(r,s)}get element(){return this._def.valueType}static create(t,r,a){return r instanceof v?new n({keyType:t,valueType:r,typeName:g.ZodRecord,..._(a)}):new n({keyType:F.create(),valueType:t,typeName:g.ZodRecord,..._(r)})}},_e=class extends v{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){let{status:r,ctx:a}=this._processInputParams(t);if(a.parsedType!==h.map)return u(a,{code:l.invalid_type,expected:h.map,received:a.parsedType}),y;let s=this._def.keyType,i=this._def.valueType,d=[...a.data.entries()].map(([c,p],m)=>({key:s._parse(new A(a,c,a.path,[m,"key"])),value:i._parse(new A(a,p,a.path,[m,"value"]))}));if(a.common.async){let c=new Map;return Promise.resolve().then(async()=>{for(let p of d){let m=await p.key,b=await p.value;if(m.status==="aborted"||b.status==="aborted")return y;(m.status==="dirty"||b.status==="dirty")&&r.dirty(),c.set(m.value,b.value)}return{status:r.value,value:c}})}else{let c=new Map;for(let p of d){let m=p.key,b=p.value;if(m.status==="aborted"||b.status==="aborted")return y;(m.status==="dirty"||b.status==="dirty")&&r.dirty(),c.set(m.value,b.value)}return{status:r.value,value:c}}}};_e.create=(n,t,r)=>new _e({valueType:t,keyType:n,typeName:g.ZodMap,..._(r)});var ve=class n extends v{_parse(t){let{status:r,ctx:a}=this._processInputParams(t);if(a.parsedType!==h.set)return u(a,{code:l.invalid_type,expected:h.set,received:a.parsedType}),y;let s=this._def;s.minSize!==null&&a.data.size<s.minSize.value&&(u(a,{code:l.too_small,minimum:s.minSize.value,type:"set",inclusive:!0,exact:!1,message:s.minSize.message}),r.dirty()),s.maxSize!==null&&a.data.size>s.maxSize.value&&(u(a,{code:l.too_big,maximum:s.maxSize.value,type:"set",inclusive:!0,exact:!1,message:s.maxSize.message}),r.dirty());let i=this._def.valueType;function d(p){let m=new Set;for(let b of p){if(b.status==="aborted")return y;b.status==="dirty"&&r.dirty(),m.add(b.value)}return{status:r.value,value:m}}let c=[...a.data.values()].map((p,m)=>i._parse(new A(a,p,a.path,m)));return a.common.async?Promise.all(c).then(p=>d(p)):d(c)}min(t,r){return new n({...this._def,minSize:{value:t,message:f.toString(r)}})}max(t,r){return new n({...this._def,maxSize:{value:t,message:f.toString(r)}})}size(t,r){return this.min(t,r).max(t,r)}nonempty(t){return this.min(1,t)}};ve.create=(n,t)=>new ve({valueType:n,minSize:null,maxSize:null,typeName:g.ZodSet,..._(t)});var Ee=class n extends v{constructor(){super(...arguments),this.validate=this.implement}_parse(t){let{ctx:r}=this._processInputParams(t);if(r.parsedType!==h.function)return u(r,{code:l.invalid_type,expected:h.function,received:r.parsedType}),y;function a(c,p){return ke({data:c,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,he(),D].filter(m=>!!m),issueData:{code:l.invalid_arguments,argumentsError:p}})}function s(c,p){return ke({data:c,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,he(),D].filter(m=>!!m),issueData:{code:l.invalid_return_type,returnTypeError:p}})}let i={errorMap:r.common.contextualErrorMap},d=r.data;if(this._def.returns instanceof Q){let c=this;return T(async function(...p){let m=new z([]),b=await c._def.args.parseAsync(p,i).catch(P=>{throw m.addIssue(a(p,P)),m}),j=await Reflect.apply(d,this,b);return await c._def.returns._def.type.parseAsync(j,i).catch(P=>{throw m.addIssue(s(j,P)),m})})}else{let c=this;return T(function(...p){let m=c._def.args.safeParse(p,i);if(!m.success)throw new z([a(p,m.error)]);let b=Reflect.apply(d,this,m.data),j=c._def.returns.safeParse(b,i);if(!j.success)throw new z([s(b,j.error)]);return j.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...t){return new n({...this._def,args:B.create(t).rest(M.create())})}returns(t){return new n({...this._def,returns:t})}implement(t){return this.parse(t)}strictImplement(t){return this.parse(t)}static create(t,r,a){return new n({args:t||B.create([]).rest(M.create()),returns:r||M.create(),typeName:g.ZodFunction,..._(a)})}},se=class extends v{get schema(){return this._def.getter()}_parse(t){let{ctx:r}=this._processInputParams(t);return this._def.getter()._parse({data:r.data,path:r.path,parent:r})}};se.create=(n,t)=>new se({getter:n,typeName:g.ZodLazy,..._(t)});var ie=class extends v{_parse(t){if(t.data!==this._def.value){let r=this._getOrReturnCtx(t);return u(r,{received:r.data,code:l.invalid_literal,expected:this._def.value}),y}return{status:"valid",value:t.data}}get value(){return this._def.value}};ie.create=(n,t)=>new ie({value:n,typeName:g.ZodLiteral,..._(t)});function dt(n,t){return new oe({values:n,typeName:g.ZodEnum,..._(t)})}var oe=class n extends v{_parse(t){if(typeof t.data!="string"){let r=this._getOrReturnCtx(t),a=this._def.values;return u(r,{expected:x.joinValues(a),received:r.parsedType,code:l.invalid_type}),y}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(t.data)){let r=this._getOrReturnCtx(t),a=this._def.values;return u(r,{received:r.data,code:l.invalid_enum_value,options:a}),y}return T(t.data)}get options(){return this._def.values}get enum(){let t={};for(let r of this._def.values)t[r]=r;return t}get Values(){let t={};for(let r of this._def.values)t[r]=r;return t}get Enum(){let t={};for(let r of this._def.values)t[r]=r;return t}extract(t,r=this._def){return n.create(t,{...this._def,...r})}exclude(t,r=this._def){return n.create(this.options.filter(a=>!t.includes(a)),{...this._def,...r})}};oe.create=dt;var ce=class extends v{_parse(t){let r=x.getValidEnumValues(this._def.values),a=this._getOrReturnCtx(t);if(a.parsedType!==h.string&&a.parsedType!==h.number){let s=x.objectValues(r);return u(a,{expected:x.joinValues(s),received:a.parsedType,code:l.invalid_type}),y}if(this._cache||(this._cache=new Set(x.getValidEnumValues(this._def.values))),!this._cache.has(t.data)){let s=x.objectValues(r);return u(a,{received:a.data,code:l.invalid_enum_value,options:s}),y}return T(t.data)}get enum(){return this._def.values}};ce.create=(n,t)=>new ce({values:n,typeName:g.ZodNativeEnum,..._(t)});var Q=class extends v{unwrap(){return this._def.type}_parse(t){let{ctx:r}=this._processInputParams(t);if(r.parsedType!==h.promise&&r.common.async===!1)return u(r,{code:l.invalid_type,expected:h.promise,received:r.parsedType}),y;let a=r.parsedType===h.promise?r.data:Promise.resolve(r.data);return T(a.then(s=>this._def.type.parseAsync(s,{path:r.path,errorMap:r.common.contextualErrorMap})))}};Q.create=(n,t)=>new Q({type:n,typeName:g.ZodPromise,..._(t)});var E=class extends v{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===g.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(t){let{status:r,ctx:a}=this._processInputParams(t),s=this._def.effect||null,i={addIssue:d=>{u(a,d),d.fatal?r.abort():r.dirty()},get path(){return a.path}};if(i.addIssue=i.addIssue.bind(i),s.type==="preprocess"){let d=s.transform(a.data,i);if(a.common.async)return Promise.resolve(d).then(async c=>{if(r.value==="aborted")return y;let p=await this._def.schema._parseAsync({data:c,path:a.path,parent:a});return p.status==="aborted"?y:p.status==="dirty"?K(p.value):r.value==="dirty"?K(p.value):p});{if(r.value==="aborted")return y;let c=this._def.schema._parseSync({data:d,path:a.path,parent:a});return c.status==="aborted"?y:c.status==="dirty"?K(c.value):r.value==="dirty"?K(c.value):c}}if(s.type==="refinement"){let d=c=>{let p=s.refinement(c,i);if(a.common.async)return Promise.resolve(p);if(p instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return c};if(a.common.async===!1){let c=this._def.schema._parseSync({data:a.data,path:a.path,parent:a});return c.status==="aborted"?y:(c.status==="dirty"&&r.dirty(),d(c.value),{status:r.value,value:c.value})}else return this._def.schema._parseAsync({data:a.data,path:a.path,parent:a}).then(c=>c.status==="aborted"?y:(c.status==="dirty"&&r.dirty(),d(c.value).then(()=>({status:r.value,value:c.value}))))}if(s.type==="transform")if(a.common.async===!1){let d=this._def.schema._parseSync({data:a.data,path:a.path,parent:a});if(!Z(d))return y;let c=s.transform(d.value,i);if(c instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:r.value,value:c}}else return this._def.schema._parseAsync({data:a.data,path:a.path,parent:a}).then(d=>Z(d)?Promise.resolve(s.transform(d.value,i)).then(c=>({status:r.value,value:c})):y);x.assertNever(s)}};E.create=(n,t,r)=>new E({schema:n,typeName:g.ZodEffects,effect:t,..._(r)});E.createWithPreprocess=(n,t,r)=>new E({schema:t,effect:{type:"preprocess",transform:n},typeName:g.ZodEffects,..._(r)});var O=class extends v{_parse(t){return this._getType(t)===h.undefined?T(void 0):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}};O.create=(n,t)=>new O({innerType:n,typeName:g.ZodOptional,..._(t)});var q=class extends v{_parse(t){return this._getType(t)===h.null?T(null):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}};q.create=(n,t)=>new q({innerType:n,typeName:g.ZodNullable,..._(t)});var de=class extends v{_parse(t){let{ctx:r}=this._processInputParams(t),a=r.data;return r.parsedType===h.undefined&&(a=this._def.defaultValue()),this._def.innerType._parse({data:a,path:r.path,parent:r})}removeDefault(){return this._def.innerType}};de.create=(n,t)=>new de({innerType:n,typeName:g.ZodDefault,defaultValue:typeof t.default=="function"?t.default:()=>t.default,..._(t)});var le=class extends v{_parse(t){let{ctx:r}=this._processInputParams(t),a={...r,common:{...r.common,issues:[]}},s=this._def.innerType._parse({data:a.data,path:a.path,parent:{...a}});return fe(s)?s.then(i=>({status:"valid",value:i.status==="valid"?i.value:this._def.catchValue({get error(){return new z(a.common.issues)},input:a.data})})):{status:"valid",value:s.status==="valid"?s.value:this._def.catchValue({get error(){return new z(a.common.issues)},input:a.data})}}removeCatch(){return this._def.innerType}};le.create=(n,t)=>new le({innerType:n,typeName:g.ZodCatch,catchValue:typeof t.catch=="function"?t.catch:()=>t.catch,..._(t)});var xe=class extends v{_parse(t){if(this._getType(t)!==h.nan){let a=this._getOrReturnCtx(t);return u(a,{code:l.invalid_type,expected:h.nan,received:a.parsedType}),y}return{status:"valid",value:t.data}}};xe.create=n=>new xe({typeName:g.ZodNaN,..._(n)});var jr=Symbol("zod_brand"),Te=class extends v{_parse(t){let{ctx:r}=this._processInputParams(t),a=r.data;return this._def.type._parse({data:a,path:r.path,parent:r})}unwrap(){return this._def.type}},Re=class n extends v{_parse(t){let{status:r,ctx:a}=this._processInputParams(t);if(a.common.async)return(async()=>{let i=await this._def.in._parseAsync({data:a.data,path:a.path,parent:a});return i.status==="aborted"?y:i.status==="dirty"?(r.dirty(),K(i.value)):this._def.out._parseAsync({data:i.value,path:a.path,parent:a})})();{let s=this._def.in._parseSync({data:a.data,path:a.path,parent:a});return s.status==="aborted"?y:s.status==="dirty"?(r.dirty(),{status:"dirty",value:s.value}):this._def.out._parseSync({data:s.value,path:a.path,parent:a})}}static create(t,r){return new n({in:t,out:r,typeName:g.ZodPipeline})}},pe=class extends v{_parse(t){let r=this._def.innerType._parse(t),a=s=>(Z(s)&&(s.value=Object.freeze(s.value)),s);return fe(r)?r.then(s=>a(s)):a(r)}unwrap(){return this._def.innerType}};pe.create=(n,t)=>new pe({innerType:n,typeName:g.ZodReadonly,..._(t)});function st(n,t){let r=typeof n=="function"?n(t):typeof n=="string"?{message:n}:n;return typeof r=="string"?{message:r}:r}function lt(n,t={},r){return n?G.create().superRefine((a,s)=>{let i=n(a);if(i instanceof Promise)return i.then(d=>{if(!d){let c=st(t,a),p=c.fatal??r??!0;s.addIssue({code:"custom",...c,fatal:p})}});if(!i){let d=st(t,a),c=d.fatal??r??!0;s.addIssue({code:"custom",...d,fatal:c})}}):G.create()}var kr={object:C.lazycreate},g;(function(n){n.ZodString="ZodString",n.ZodNumber="ZodNumber",n.ZodNaN="ZodNaN",n.ZodBigInt="ZodBigInt",n.ZodBoolean="ZodBoolean",n.ZodDate="ZodDate",n.ZodSymbol="ZodSymbol",n.ZodUndefined="ZodUndefined",n.ZodNull="ZodNull",n.ZodAny="ZodAny",n.ZodUnknown="ZodUnknown",n.ZodNever="ZodNever",n.ZodVoid="ZodVoid",n.ZodArray="ZodArray",n.ZodObject="ZodObject",n.ZodUnion="ZodUnion",n.ZodDiscriminatedUnion="ZodDiscriminatedUnion",n.ZodIntersection="ZodIntersection",n.ZodTuple="ZodTuple",n.ZodRecord="ZodRecord",n.ZodMap="ZodMap",n.ZodSet="ZodSet",n.ZodFunction="ZodFunction",n.ZodLazy="ZodLazy",n.ZodLiteral="ZodLiteral",n.ZodEnum="ZodEnum",n.ZodEffects="ZodEffects",n.ZodNativeEnum="ZodNativeEnum",n.ZodOptional="ZodOptional",n.ZodNullable="ZodNullable",n.ZodDefault="ZodDefault",n.ZodCatch="ZodCatch",n.ZodPromise="ZodPromise",n.ZodBranded="ZodBranded",n.ZodPipeline="ZodPipeline",n.ZodReadonly="ZodReadonly"})(g||(g={}));var Tr=(n,t={message:`Input not instance of ${n.name}`})=>lt(r=>r instanceof n,t),pt=F.create,mt=J.create,Rr=xe.create,wr=Y.create,ut=X.create,zr=ee.create,Cr=ge.create,Pr=te.create,Or=re.create,Ar=G.create,Er=M.create,Ir=I.create,Lr=be.create,Br=V.create,qr=C.create,Ur=C.strictCreate,Nr=ne.create,Dr=Oe.create,$r=ae.create,Mr=B.create,Vr=Ae.create,Zr=_e.create,Fr=ve.create,Gr=Ee.create,Qr=se.create,Hr=ie.create,Wr=oe.create,Kr=ce.create,Jr=Q.create,Yr=E.create,Xr=O.create,en=q.create,tn=E.createWithPreprocess,rn=Re.create,nn=()=>pt().optional(),an=()=>mt().optional(),sn=()=>ut().optional(),on={string:n=>F.create({...n,coerce:!0}),number:n=>J.create({...n,coerce:!0}),boolean:n=>X.create({...n,coerce:!0}),bigint:n=>Y.create({...n,coerce:!0}),date:n=>ee.create({...n,coerce:!0})};var cn=y;var dn=n=>typeof n?.safeParse=="function";var Ze=n=>typeof n?.passthrough=="function";var ln=(n,t)=>Ze(n)?Ze(t)?n.merge(t):n:Ze(t)?t:Object.assign({},n,t);var co=e.object({name:e.literal("ZodError"),issues:e.array(e.object({path:e.array(e.union([e.string(),e.number()])),message:e.string().optional(),code:e.nativeEnum(e.ZodIssueCode)}).catchall(e.any()))}),pn=Symbol("ContractNoBody"),ft=n=>"method"in n&&"path"in n;var yt=(n,t)=>Object.fromEntries(Object.entries(n).map(([r,a])=>{var s,i,d;return ft(a)?[r,{...a,path:t?.pathPrefix?t.pathPrefix+a.path:a.path,headers:ln(t?.baseHeaders,a.headers),strictStatusCodes:(s=a.strictStatusCodes)!==null&&s!==void 0?s:t?.strictStatusCodes,validateResponseOnClient:(i=a.validateResponseOnClient)!==null&&i!==void 0?i:t?.validateResponseOnClient,responses:{...t?.commonResponses,...a.responses},metadata:t?.metadata?{...t?.metadata,...(d=a.metadata)!==null&&d!==void 0?d:{}}:a.metadata}]:[r,yt(a,t)]})),Fe=Symbol("ContractPlainType"),U=()=>({router:(n,t)=>yt(n,t),query:n=>n,mutation:n=>n,responses:n=>n,response:()=>Fe,body:()=>Fe,type:()=>Fe,otherResponse:({contentType:n,body:t})=>({contentType:n,body:t}),noBody:()=>pn}),mn=({path:n,params:t})=>{let r=t;return n.replace(/\/?:([^/?]+)\??/g,(a,s)=>r[s]?`${a.startsWith("/")?"/":""}${r[s]}`:"")},un=(n,t=!1)=>{let r=t?hn(n):fn(n);return r?.length>0?"?"+r:""},hn=n=>n?Object.entries(n).filter(([,t])=>t!==void 0).map(([t,r])=>{let a;return typeof r=="string"&&!["true","false","null"].includes(r.trim())&&isNaN(Number(r))?a=r:a=JSON.stringify(r),`${encodeURIComponent(t)}=${encodeURIComponent(a)}`}).join("&"):"",fn=n=>n?Object.keys(n).flatMap(t=>Ge(t,n[t])).map(([t,r])=>`${encodeURIComponent(t)}=${encodeURIComponent(r)}`).join("&"):"",Ge=(n,t)=>Array.isArray(t)?t.flatMap((r,a)=>Ge(`${n}[${a}]`,r)):t instanceof Date?[[`${n}`,t.toISOString()]]:t===null?[[`${n}`,""]]:t===void 0?[]:typeof t=="object"?Object.keys(t).flatMap(r=>Ge(`${n}[${r}]`,t[r])):[[`${n}`,`${t}`]];var Qe=class extends Error{constructor(t,r){let a=r.join(",");super(`Server returned unexpected response. Expected one of: ${a} got: ${t.status}`),this.response=t}};var yn=async({route:n,path:t,method:r,headers:a,body:s,validateResponse:i,fetchOptions:d})=>{let c=await fetch(t,{...d,method:r,headers:a,body:s}),p=c.headers.get("content-type");if(p?.includes("application/")&&p?.includes("json")){let m={status:c.status,body:await c.json(),headers:c.headers},b=n.responses[m.status];return(i??n.validateResponseOnClient)&&dn(b)?{...m,body:b.parse(m.body)}:m}return p?.includes("text/")?{status:c.status,body:await c.text(),headers:c.headers}:{status:c.status,body:await c.blob(),headers:c.headers}},gn=n=>{let t=new FormData,r=(a,s)=>{s instanceof File?t.append(a,s):t.append(a,JSON.stringify(s))};return Object.entries(n).forEach(([a,s])=>{if(Array.isArray(s))for(let i of s)r(a,i);else r(a,s)}),t},ht=n=>Object.fromEntries(Object.entries(n).map(([t,r])=>[t.toLowerCase(),r])),bn=n=>{let{path:t,clientArgs:r,route:a,body:s,query:i,extraInputArgs:d,headers:c,fetchOptions:p}=n,m=r.api||yn,b=r.baseHeaders&&Object.fromEntries(Object.entries(r.baseHeaders).map(([P,ze])=>typeof ze=="function"?[P,ze(n)]:[P,ze])),j={...b&&ht(b),...ht(c)};Object.keys(j).forEach(P=>{j[P]===void 0&&delete j[P]});let w={route:a,path:t,method:a.method,headers:j,body:void 0,rawBody:s,rawQuery:i,contentType:void 0,validateResponse:r.validateResponse,fetchOptions:{...r.credentials&&{credentials:r.credentials},...p},...p?.signal&&{signal:p.signal},...p?.cache&&{cache:p.cache},...p&&"next"in p&&!!p?.next&&{next:p.next}};return a.method!=="GET"&&("contentType"in a&&a.contentType==="multipart/form-data"?w={...w,contentType:"multipart/form-data",body:s instanceof FormData?s:gn(s)}:"contentType"in a&&a.contentType==="application/x-www-form-urlencoded"?w={...w,contentType:"application/x-www-form-urlencoded",headers:{"content-type":"application/x-www-form-urlencoded",...w.headers},body:typeof s=="string"?s:new URLSearchParams(s)}:s!=null&&(w={...w,contentType:"application/json",headers:{"content-type":"application/json",...w.headers},body:JSON.stringify(s)})),m({...w,...d})},_n=(n,t,r)=>{let{query:a,params:s,body:i,headers:d,extraHeaders:c,overrideClientOptions:p,fetchOptions:m,cache:b,next:j,...w}=r||{},P={...t,...p};return{path:vn(a,P.baseUrl,s,n,!!P.jsonQuery),clientArgs:P,route:n,body:i,query:a,extraInputArgs:w,fetchOptions:{...b&&{cache:b},...j&&{next:j},...m},headers:{...c,...d}}},vn=(n,t,r,a,s)=>{let i=mn({path:a.path,params:r}),d=un(n,s);return`${t}${i}${d}`},xn=(n,t)=>{let r=Object.keys(n.responses);return async a=>{let s=_n(n,t,a),i=await bn(s);if(!t.throwOnUnknownStatus||r.includes(i.status.toString()))return i;throw new Qe(i,r)}},He=(n,t)=>Object.fromEntries(Object.entries(n).map(([r,a])=>ft(a)?[r,xn(a,t)]:[r,He(a,t)]));var We=["free","creator","team"],gt=typeof process<"u"&&process.env?.NODE_ENV!=="production",Sn={stripe:{plans:[{tier:"free",subjectType:"user",name:"Free",description:"Upload threads, share read-only links, and collaborate with your workspace. Shared links expire after 3 days.",price:0,priceId:null,features:[{name:"Thread uploads + public links"},{name:"Workspace membership"},{name:"Shared links live 3 days"}],entitlements:{skills:!1,workspaceScope:!1,review:!1,sharedThreadTtlDays:3}},{tier:"creator",subjectType:"user",name:"Creator",description:"For builders who share a lot. Permanent links and the Skills tab.",price:29,isFeatured:!0,priceId:gt?"price_1TP9BSKwvRM43sh64waIrvjj":"price_1TPA2gKwvRM43sh6Kp4ZCpJZ",features:[{name:"Everything in Free"},{name:"Shared threads live forever"},{name:"Skills tab \u2014 tool usage across every thread"}],entitlements:{skills:!0,workspaceScope:!1,review:!1,sharedThreadTtlDays:null}},{tier:"team",subjectType:"organization",name:"Team",description:"GitHub for Prompts. Org-wide thread sharing plus the review surface.",price:19,minSeats:2,priceId:gt?"price_1TP9MpKwvRM43sh6TBIFxVCd":"price_1TPA3CKwvRM43sh6k0bgPTsQ",features:[{name:"Everything in Creator"},{name:"Workspace-wide thread sharing"},{name:"Minimum 2 seats"},{name:"Review feature (beta)"}],entitlements:{skills:!0,workspaceScope:!0,review:!0,sharedThreadTtlDays:null}}]}};var bt=Sn.stripe.plans,po=Object.freeze(Object.fromEntries(bt.map(n=>[n.tier,n])));var jn=U(),R=e.object({message:e.string()}),Ke=e.record(e.unknown()),me=e.string().regex(/^doc_[0-9A-Za-z]{22}$/),Ie=e.string().regex(/^proj_[0-9A-Za-z]{22}$/),kn=["active","archived"],Le=e.enum(kn),_t=e.object({id:e.string().min(1),display_name:e.string().min(1)}),vt=e.object({id:Ie,name:e.string().min(1)}),Je=e.object({id:me,title:e.string().min(1),status:Le,author:_t,project:vt.nullable(),created_at:e.string().datetime(),updated_at:e.string().datetime(),archived_at:e.string().datetime().nullable()}),Tn=e.object({type:e.literal("list"),list_type:e.literal("doc"),objects:e.array(Je)}),Rn=e.object({project_id:Ie.optional(),status:Le.optional()}),wn=e.object({title:e.string().trim().min(1).max(300).optional(),prosemirror_json:Ke.optional(),project_id:Ie.nullable().optional()}),zn=e.object({id:me,created_at:e.string().datetime()}),Cn=e.object({title:e.string().trim().min(1).max(300).optional(),prosemirror_json:Ke.optional(),project_id:Ie.nullable().optional(),status:Le.optional()}).refine(n=>Object.keys(n).length>0,{message:"At least one field must be provided"}),Pn=e.object({id:me,updated_at:e.string().datetime()}),On=e.object({id:me,title:e.string().min(1),prosemirror_json:Ke,status:Le,author:_t,project:vt.nullable(),created_at:e.string().datetime(),updated_at:e.string().datetime(),archived_at:e.string().datetime().nullable()}),xt=jn.router({listDocs:{method:"GET",path:"/docs",headers:e.object({authorization:e.string().min(1).optional()}),query:Rn,responses:{200:Tn,401:R,403:R},summary:"List docs in the authenticated user\u2019s organization. Optional project_id filter scopes to a single project."},createDoc:{method:"POST",path:"/docs",headers:e.object({authorization:e.string().min(1).optional()}),body:wn,responses:{201:zn,401:R,403:R,404:R,422:R},summary:"Create a doc. If project_id is provided, the doc is scoped to that project; otherwise it lives at the workspace level."},getDoc:{method:"GET",path:"/docs/:docId",pathParams:e.object({docId:me}),headers:e.object({authorization:e.string().min(1).optional()}),responses:{200:On,401:R,403:R,404:R},summary:"Get a doc by id with its rich-text body and parent project (if any)"},updateDoc:{method:"PATCH",path:"/docs/:docId",pathParams:e.object({docId:me}),headers:e.object({authorization:e.string().min(1).optional()}),body:Cn,responses:{200:Pn,401:R,403:R,404:R,422:R},summary:"Update a doc. If prosemirror_json changes, the server re-syncs lore.mention_references from mention nodes."},deleteDoc:{method:"DELETE",path:"/docs/:docId",pathParams:e.object({docId:me}),headers:e.object({authorization:e.string().min(1).optional()}),body:e.object({}).optional(),responses:{204:e.object({}),401:R,403:R,404:R},summary:"Hard-delete a doc and any mention references it owns"}});var An=U(),S=e.object({message:e.string()}),Ye=e.record(e.unknown()),N=e.string().regex(/^proj_[0-9A-Za-z]{22}$/),En=["active","archived"],Be=e.enum(En),Xe=e.object({id:e.string().min(1),display_name:e.string().min(1)}),St=e.object({thread_id:e.string().min(1),title:e.string().min(1),added_at:e.string().datetime(),added_by:Xe}),In=e.object({id:N,name:e.string().min(1),status:Be,author:Xe,thread_count:e.number().int().nonnegative(),doc_count:e.number().int().nonnegative(),created_at:e.string().datetime(),updated_at:e.string().datetime(),archived_at:e.string().datetime().nullable()}),Ln=e.object({type:e.literal("list"),list_type:e.literal("project"),objects:e.array(In)}),Bn=e.object({status:Be.optional()}),qn=e.object({name:e.string().trim().min(1).max(200),prosemirror_json:Ye.optional()}),Un=e.object({id:N,created_at:e.string().datetime()}),Nn=e.object({name:e.string().trim().min(1).max(200).optional(),prosemirror_json:Ye.optional()}).refine(n=>Object.keys(n).length>0,{message:"At least one field must be provided"}),Dn=e.object({id:N,updated_at:e.string().datetime()}),$n=e.object({archived:e.boolean()}),Mn=e.object({id:N,status:Be,archived_at:e.string().datetime().nullable()}),Vn=e.object({id:N,name:e.string().min(1),prosemirror_json:Ye,status:Be,author:Xe,created_at:e.string().datetime(),updated_at:e.string().datetime(),archived_at:e.string().datetime().nullable(),threads:e.array(St),docs:e.array(Je)}),Zn=e.object({thread_id:e.string().min(1).max(64)}),Fn=St,jt=An.router({listProjects:{method:"GET",path:"/projects",headers:e.object({authorization:e.string().min(1).optional()}),query:Bn,responses:{200:Ln,401:S},summary:"List projects in the authenticated user\u2019s organization"},createProject:{method:"POST",path:"/projects",headers:e.object({authorization:e.string().min(1).optional()}),body:qn,responses:{201:Un,401:S,422:S},summary:"Create a new project in the authenticated user\u2019s organization"},getProject:{method:"GET",path:"/projects/:projectId",pathParams:e.object({projectId:N}),headers:e.object({authorization:e.string().min(1).optional()}),responses:{200:Vn,401:S,403:S,404:S},summary:"Get a project with its attached threads and child docs. The project description is the canonical mention source for project-scoped @-mentions."},updateProject:{method:"PATCH",path:"/projects/:projectId",pathParams:e.object({projectId:N}),headers:e.object({authorization:e.string().min(1).optional()}),body:Nn,responses:{200:Dn,401:S,403:S,404:S,422:S},summary:"Update a project\u2019s name or rich-text body. Body changes re-sync mention_references for source_kind=project."},archiveProject:{method:"POST",path:"/projects/:projectId/archive",pathParams:e.object({projectId:N}),headers:e.object({authorization:e.string().min(1).optional()}),body:$n,responses:{200:Mn,401:S,403:S,404:S},summary:"Archive (soft-delete) or unarchive a project"},addProjectThread:{method:"POST",path:"/projects/:projectId/threads",pathParams:e.object({projectId:N}),headers:e.object({authorization:e.string().min(1).optional()}),body:Zn,responses:{201:Fn,401:S,403:S,404:S,409:S,422:S},summary:"Pin an existing visible thread to this project. Idempotent \u2014 re-adding returns the existing membership."},removeProjectThread:{method:"DELETE",path:"/projects/:projectId/threads/:threadId",pathParams:e.object({projectId:N,threadId:e.string().min(1).max(64)}),headers:e.object({authorization:e.string().min(1).optional()}),body:e.object({}).optional(),responses:{204:e.object({}),401:S,403:S,404:S},summary:"Remove a thread membership from a project"}});var Gn=U(),qe=e.object({message:e.string()}),Qn=["thread","plan","doc","user"],Ue=e.enum(Qn),Hn=["doc","project"],Wn=e.enum(Hn),Kn=e.object({kind:Ue,id:e.string().min(1),title:e.string().min(1),href:e.string().min(1)}),Jn=e.object({type:e.literal("list"),list_type:e.literal("mention"),objects:e.array(Kn)}),Yn=e.object({q:e.string().trim().min(1).max(50),kinds:e.string().optional().transform(n=>{if(!n)return;let t=n.split(",").map(r=>r.trim()).filter(r=>r.length>0);return t.length>0?t:void 0}).pipe(e.array(Ue).optional())}),Xn=e.object({source_kind:Wn,source_id:e.string().min(1),source_title:e.string().min(1),source_href:e.string().min(1),target_kind:Ue,target_id:e.string().min(1),created_at:e.string().datetime()}),ea=e.object({type:e.literal("list"),list_type:e.literal("backlink"),objects:e.array(Xn)}),ta=e.object({target_kind:Ue,target_id:e.string().min(1).max(64)}),kt=Gn.router({searchMentions:{method:"GET",path:"/mentions/search",headers:e.object({authorization:e.string().min(1).optional()}),query:Yn,responses:{200:Jn,401:qe,422:qe},summary:"Search threads, plans, files, and users by title/name for @-mention typeahead. Org-scoped, max 10 results across all kinds."},listBacklinks:{method:"GET",path:"/mentions/backlinks",headers:e.object({authorization:e.string().min(1).optional()}),query:ta,responses:{200:ea,401:qe,403:qe},summary:"List every doc/project body in the caller\u2019s organization that mentions the given target. Newest-first."}});var ra=U(),na=e.object({type:e.literal("list"),list_type:e.literal("thread"),has_more:e.boolean(),objects:e.array(e.unknown())}),H=e.object({message:e.string()}),Tt=e.object({thread_id:e.string().min(1),is_favorited:e.boolean(),favorited_at:e.string().datetime().nullable()}),aa=e.object({before:e.string().min(1).max(64).optional()}),Rt=ra.router({addThreadFavorite:{method:"POST",path:"/threads/:id/favorite",pathParams:e.object({id:e.string().min(1).max(64)}),headers:e.object({authorization:e.string().min(1).optional()}),body:e.object({}).optional(),responses:{201:Tt,401:H,403:H,404:H},summary:"Bookmark a thread for the authenticated user. Idempotent \u2014 re-favoriting returns the existing membership."},removeThreadFavorite:{method:"DELETE",path:"/threads/:id/favorite",pathParams:e.object({id:e.string().min(1).max(64)}),headers:e.object({authorization:e.string().min(1).optional()}),body:e.object({}).optional(),responses:{200:Tt,401:H,403:H,404:H},summary:"Remove a thread bookmark for the authenticated user (no-op if absent)."},listFavoriteThreads:{method:"GET",path:"/favorites/threads",headers:e.object({authorization:e.string().min(1).optional()}),query:aa,responses:{200:na,401:H,403:H},summary:"List threads the authenticated user has favorited, newest favorited first. Visibility filtering still applies \u2014 a thread the viewer can no longer see (e.g. visibility downgraded) is omitted from the list."}});var sa=U(),ia=e.object({id:e.string().uuid(),role:e.enum(["user","assistant"]),content:e.string().min(1),timestamp:e.string().datetime()}),oa=e.object({id:e.string().uuid(),title:e.string().min(1),author:e.string().min(1),authorAvatar:e.string().min(1).max(4),model:e.string().min(1),turnCount:e.number().int().nonnegative(),createdAt:e.string().datetime(),preview:e.string()}),Zo=oa.extend({messages:e.array(ia)}),o=e.object({message:e.string()}),ca=/^[a-zA-Z0-9_-]{2,32}$/,It=e.string().regex(ca,"Handle must be 2\u201332 characters: letters, numbers, dashes, or underscores."),et=e.object({id:e.string(),first_name:e.string().min(1),last_name:e.string().min(1),display_name:e.string().min(1),stytch_id:e.string().nullable(),handle:e.string().nullable(),bio:e.string().max(280).nullable(),avatar_url:e.string().nullable(),banner_url:e.string().nullable(),share_new_threads_to_workspace:e.boolean(),experimental_features_enabled:e.boolean(),onboarded_at:e.string().nullable()}),da=e.object({stytchMemberId:e.string().min(1).optional(),emailAddress:e.string().email(),name:e.string().nullable(),user:et,is_admin:e.boolean()}),la=e.object({share_new_threads_to_workspace:e.boolean().optional(),experimental_features_enabled:e.boolean().optional(),onboarded_at:e.union([e.literal("now"),e.null()]).optional(),display_name:e.string().min(1).max(120).optional(),handle:It.optional(),bio:e.string().max(280).nullable().optional(),avatar_storage_url:e.string().min(1).nullable().optional(),banner_storage_url:e.string().min(1).nullable().optional()}).refine(n=>Object.keys(n).length>0,{message:"At least one field must be provided"}),pa=e.object({id:e.string(),display_name:e.string(),handle:e.string().nullable(),avatar_url:e.string().nullable(),visible_thread_count:e.number().int().nonnegative(),last_active_at:e.string().datetime().nullable()}),Lt=e.object({id:e.string().min(1),display_name:e.string().min(1),handle:e.string().nullable(),bio:e.string().max(280).nullable(),avatar_url:e.string().nullable(),banner_url:e.string().nullable(),organization_name:e.string().min(1).nullable(),created_at:e.string().min(1),visible_thread_count:e.number().int().nonnegative(),follower_count:e.number().int().nonnegative(),following_count:e.number().int().nonnegative(),published_project_count:e.number().int().nonnegative(),is_following:e.boolean(),is_self:e.boolean()}),ma=e.object({type:e.literal("list"),list_type:e.literal("organization_member"),objects:e.array(pa)}),ua=e.object({email_address:e.string().email()}),ha=e.object({email_address:e.string().email(),member_id:e.string().min(1)}),fa=e.object({location:e.string().trim().min(1),contact:e.string().trim().email()}),ya=e.object({location:e.string().min(1),contact:e.string().email(),created_at:e.string().datetime()}),ga=e.object({first_name:e.string().min(1),last_name:e.string().min(1),display_name:e.string().min(1),stytch_id:e.string().min(1).optional()}),ba=e.object({name:e.string().min(1),email_domains:e.array(e.string().min(1)).nonempty(),stytch_org_id:e.string().min(1)}),_a=e.object({user:ga,organization:ba}),va=e.object({path_glob:e.string().min(1),name:e.string().min(1),description:e.string().min(1)}),xa=e.object({repo_origin_path:e.string().min(1),building_blocks:e.array(va)}),Bt=e.string().regex(/^th_[0-9A-Za-z]{22}$/),De=e.string().regex(/^tb_[0-9A-Za-z]{22}$/),Sa=e.object({id:Bt,author:e.object({id:e.string().min(1),display_name:e.string().min(1)}),body:e.string(),created_at:e.string().datetime(),repo_origin_path:e.string().min(1),latest_revision_id:De,revision_count:e.number().int().positive()}),ja=e.object({id:e.string().min(1),display_name:e.string().min(1)}),ka=e.object({id:e.string().min(1),author_id:e.string().min(1).nullable(),author:ja.nullable(),created_at:e.string().datetime(),deleted_at:e.string().datetime().nullable(),content:e.string().min(1)}),Ta=e.object({id:e.string().min(1),thread_block_id:e.string().min(1),created_at:e.string().datetime(),resolved_at:e.string().datetime().nullable(),comments:e.array(ka)}),Ra=e.object({thread_block_id:De,from_position:e.number().int().positive(),to_position:e.number().int().positive(),selected_text:e.string().min(1),content:e.string().trim().min(1)}),wa=e.object({id:e.string().min(1)}),za=e.object({content:e.string().trim().min(1)}),Ca=e.object({id:e.string().min(1)}),Pa=e.object({content:e.string().trim().min(1)}),Oa=e.object({id:e.string().min(1)}),Aa=e.object({content:e.string().trim().min(1)}),Ea=e.object({id:e.string().min(1)}),Ia=e.object({resolved:e.boolean()}),La=e.object({id:e.string().min(1),resolved_at:e.string().datetime().nullable()}),Ba=e.object({resolved:e.boolean()}),qa=e.object({id:e.string().min(1),resolved_at:e.string().datetime().nullable()}),qt=e.record(e.unknown()),Ua=e.object({id:De,body:e.string(),created_at:e.string().datetime(),prosemirror_json:qt,comment_threads:e.array(Ta)}),Na=e.object({id:Bt,created_at:e.string().datetime(),repo_origin_path:e.string().min(1),author:e.object({id:e.string().min(1),display_name:e.string().min(1)}),latest_revision_id:De,revision_count:e.number().int().positive(),revisions:e.array(Ua)}),Da=e.object({type:e.literal("list"),list_type:e.literal("plan"),has_more:e.boolean(),objects:e.array(Sa)}),$a=e.object({before:e.string().min(1).optional(),after:e.string().min(1).optional(),author_id:e.string().min(1).optional(),repo_origin_path:e.string().min(1).optional()}),Ut=e.object({id:e.string().min(1),organization_id:e.string().min(1),created_at:e.string().min(1),repo_origin_path:e.string().min(1),path_glob:e.string().min(1),name:e.string().min(1),description:e.string().min(1)}),Ma=e.array(Ut),Va=e.object({type:e.literal("list"),list_type:e.literal("building_block"),has_more:e.boolean(),objects:e.array(Ut)}),Za=e.object({repo_origin_path:e.string().min(1),before:e.string().min(1).optional(),after:e.string().min(1).optional()}),Fa=e.enum(["thread","building_block"]),Ga=e.object({repo_origin_path:e.string().min(1),sources:e.array(Fa).nonempty()}),Qa=e.object({type:e.literal("list"),list_type:e.literal("repository"),has_more:e.boolean(),objects:e.array(Ga)}),W=e.enum(["claudeCode","codex","amp","cursor","unspecified"]),Ha=["transcript","plan"],Wa=e.enum(Ha),Ka=e.object({md5:e.string().min(1),harness:W,filename:e.string().min(1).optional(),repo_origin_path:e.string().min(1).optional(),harness_internal_id:e.string().min(1).optional(),file_type:Wa.optional()}).refine(n=>(n.filename?.trim().length??0)>0||(n.harness_internal_id?.trim().length??0)>0,{path:["harness_internal_id"],message:"filename or harness_internal_id is required"}),rt=e.object({id:e.string().min(1),display_name:e.string().min(1)}),Ja=e.object({id:e.string().min(1),display_name:e.string().min(1)}),Nt=e.object({id:e.string().min(1),author_id:e.string().min(1).nullable(),author:Ja.nullable(),created_at:e.string().datetime(),deleted_at:e.string().datetime().nullable(),content:e.string().min(1)}),Dt=e.object({id:e.string().min(1),thread_block_id:e.string().min(1),created_at:e.string().datetime(),resolved_at:e.string().datetime().nullable()}),Ya=Dt.extend({comments:e.array(Nt)}),we=e.object({id:e.string().min(1),type:e.string().min(1),index_in_thread:e.number().int().nonnegative(),isCritiqued:e.boolean(),comment_threads:e.array(Ya).optional()}).passthrough(),$t=e.object({type:e.literal("list"),list_type:e.literal("thread_block"),has_more:e.boolean(),objects:e.array(we)}),wt=we.extend({type:e.literal("plan"),prosemirror_json:qt,thread_file_id:e.string().min(1)}),Xa=e.union([e.literal(-1),e.literal(1)]),Mt=e.union([e.literal(-1),e.literal(0),e.literal(1)]),zt=e.object({score:e.number().int(),up_count:e.number().int().nonnegative(),down_count:e.number().int().nonnegative(),viewer_vote:Mt}),es=e.object({value:Xa}),ts=e.object({id:e.string().min(1),display_name:e.string().min(1),avatar_url:e.string().nullable()}),ue=e.object({id:e.string().min(1),thread_id:e.string().min(1),author_id:e.string().min(1).nullable(),author:ts.nullable(),parent_comment_id:e.string().min(1).nullable(),content:e.string(),created_at:e.string().datetime(),updated_at:e.string().datetime(),deleted_at:e.string().datetime().nullable()}),rs=e.object({type:e.literal("list"),list_type:e.literal("thread_comment"),objects:e.array(ue)}),ns=e.object({content:e.string().trim().min(1).max(4e3),parent_comment_id:e.string().min(1).optional()}),as=ue,ss=e.object({content:e.string().trim().min(1).max(4e3)}),is=ue,os=ue,Fo=e.discriminatedUnion("kind",[e.object({kind:e.literal("created"),thread_id:e.string().min(1),actor_user_id:e.string().min(1),version:e.number(),comment:ue}),e.object({kind:e.literal("updated"),thread_id:e.string().min(1),actor_user_id:e.string().min(1),version:e.number(),comment:ue}),e.object({kind:e.literal("deleted"),thread_id:e.string().min(1),actor_user_id:e.string().min(1),version:e.number(),comment:ue})]),cs=e.enum(["pending","generating","ready","failed"]),ds=e.enum(["pending","generating","ready","failed"]),ls=e.enum(["pending","placeholder","ai","user"]),Vt=e.enum(["pending","generating","ready","failed"]),ps=e.enum(["asked","requested","decided","corrected","shared"]),ms=e.object({id:e.string().min(1),kind:ps,summary:e.string().min(1),block_id:e.string().min(1)}),us=e.object({type:e.literal("list"),list_type:e.literal("thread_decision"),status:Vt,generated_at:e.string().nullable(),objects:e.array(ms)}),Se=e.object({id:e.string().min(1),thread_file_id:e.string().min(1),organization_id:e.string().min(1),author:rt,repo:e.string().min(1),title:e.string().min(1),started_at:e.string().min(1),blocks:$t,user_message_count:e.number().int().nonnegative(),files_touched:e.array(e.string()),skills_invoked:e.array(e.string()),harness:W,transcript_parsing_state:e.enum(["pending","parsed","too_large_to_parse"]),visibility:e.enum(["private","workspace","public"]),has_plan:e.boolean().optional(),summary:e.string().nullable(),summary_status:cs,summary_generated_at:e.string().nullable(),title_status:ds,title_generated_at:e.string().nullable(),title_source:ls,decisions_status:Vt,decisions_generated_at:e.string().nullable(),score:e.number().int(),up_count:e.number().int().nonnegative(),down_count:e.number().int().nonnegative(),viewer_vote:Mt,comment_count:e.number().int().nonnegative(),is_favorited:e.boolean()}),hs=e.object({storage_url:e.string().min(1)}),fs=e.object({storage_url:e.string(),harness:W,thread:Se.nullable()}),ys=e.object({status:e.literal("complete"),thread_files:e.array(fs)}),gs=e.object({id:e.string(),presigned_url:e.string().nullable(),presigned_url_expires_at:e.string().nullable(),storage_url:e.string(),harness:W,expected_md5:e.string(),error:e.string().nullable(),thread:Se.nullable()}),bs=e.object({id:e.string(),substrate:e.enum(["s3","filesystem"]),status:e.enum(["incomplete","locked_for_parsing","complete","error"]),thread_files:e.array(gs)}),_s=e.object({visibility:e.enum(["private","workspace","public"]).optional(),title:e.string().trim().min(1).max(200).optional()}).refine(n=>n.visibility!==void 0||n.title!==void 0,{message:"At least one of visibility or title must be provided"}),vs=e.discriminatedUnion("visibility",[e.object({visibility:e.literal("private")}),e.object({visibility:e.literal("workspace")}),e.object({visibility:e.literal("public"),title:e.string().min(1),author_display_name:e.string().min(1),first_user_message:e.string().nullable(),summary:e.string().nullable(),started_at:e.string().min(1),harness:W})]),xs=Se,Ct=e.object({type:e.literal("list"),list_type:e.literal("thread"),has_more:e.boolean(),objects:e.array(xs)}),Ss=e.enum(["recent","popular"]),js=Se,ks=e.object({type:e.literal("list"),list_type:e.literal("discover_thread"),has_more:e.boolean(),objects:e.array(js)}),Ts=e.object({before:e.string().min(1).optional(),after:e.string().min(1).optional(),sort:Ss.optional(),harness:W.optional(),search:e.string().max(200).optional()}),Rs=e.object({thread_count:e.number().int().nonnegative(),author_count:e.number().int().nonnegative(),organization_count:e.number().int().nonnegative(),harness_breakdown:e.record(W,e.number().int().nonnegative())}),ws=e.object({id:e.string(),status:e.enum(["incomplete","locked_for_parsing","complete","error"]),created_at:e.string(),thread_count:e.number().int().nonnegative()}),zs=e.object({type:e.literal("list"),list_type:e.literal("upload_session"),objects:e.array(ws)}),Cs=e.object({before:e.string().min(1).optional(),after:e.string().min(1).optional()}),Ps=e.object({before:e.string().min(1).optional(),after:e.string().min(1).optional(),author_ids:e.string().min(1).optional(),created_at:e.string().min(1).optional(),filepath_prefixes:e.string().min(1).optional()}),Os=e.object({path:e.string().min(1),start_offset:e.number().int().nonnegative(),end_offset:e.number().int().positive()}),As=e.object({name:e.string(),usage_count:e.number().int().nonnegative(),author_count:e.number().int().nonnegative(),first_used_at:e.string().nullable(),last_used_at:e.string().nullable(),usage_count_last_24h:e.number().int().nonnegative(),usage_count_last_7d:e.number().int().nonnegative()}),Es=e.object({type:e.literal("list"),list_type:e.literal("skill"),objects:e.array(As)}),Is=e.object({id:e.string(),title:e.string(),visibility:e.enum(["private","workspace","public"]),started_at:e.string(),author:rt,skills_invoked:e.array(e.string())}),Ls=e.object({name:e.string(),usage_count:e.number().int().nonnegative(),author_count:e.number().int().nonnegative(),first_used_at:e.string().nullable(),last_used_at:e.string().nullable(),threads:e.array(Is)}),Bs=e.object({path:e.string().min(1),text:e.string().max(64e3)}),qs=e.enum(["text_edit","redact","delete_block"]),Us=e.object({id:e.string(),thread_block_id:e.string(),editor:e.object({id:e.string(),display_name:e.string()}),kind:qs,path:e.string().nullable(),previous_text:e.string().nullable(),new_text:e.string().nullable(),created_at:e.string()}),Ns=e.object({type:e.literal("list"),list_type:e.literal("thread_block_edit"),objects:e.array(Us)}),Ds=e.object({organization_count:e.number().int().nonnegative(),user_count:e.number().int().nonnegative(),thread_count:e.number().int().nonnegative(),thread_count_last_24h:e.number().int().nonnegative(),user_count_last_24h:e.number().int().nonnegative()}),$s=e.object({id:e.string(),name:e.string(),email_domains:e.array(e.string()),stytch_org_id:e.string(),member_count:e.number().int().nonnegative(),thread_count:e.number().int().nonnegative(),default_thread_visibility:e.enum(["private","workspace","public"]),created_at:e.string()}),Ms=e.object({type:e.literal("list"),list_type:e.literal("admin_organization"),objects:e.array($s)}),Zt=e.object({id:e.string(),name:e.string()}),Vs=e.object({id:e.string(),display_name:e.string(),stytch_id:e.string().nullable(),thread_count:e.number().int().nonnegative(),onboarded_at:e.string().nullable(),created_at:e.string(),organizations:e.array(Zt)}),Zs=e.object({type:e.literal("list"),list_type:e.literal("admin_user"),objects:e.array(Vs)}),Fs=e.object({id:e.string(),title:e.string(),started_at:e.string(),created_at:e.string(),deleted_at:e.string().nullable(),visibility:e.enum(["private","workspace","public"]),harness:W,author:rt,organization:Zt}),Gs=e.object({type:e.literal("list"),list_type:e.literal("admin_thread"),has_more:e.boolean(),objects:e.array(Fs)}),Qs=e.object({before:e.string().min(1).optional(),after:e.string().min(1).optional()}),Pt=e.object({token:e.string().min(1),thread_id:e.string().min(1)}),Hs=e.object({visitor:e.string().min(1).max(64).optional()}),Ws=e.object({user_id:e.string(),display_name:e.string(),shares_sent:e.number().int().nonnegative(),unique_viewers:e.number().int().nonnegative(),attributed_signups:e.number().int().nonnegative()}),Ks=e.object({window_days:e.number().int().positive(),shares_sent:e.number().int().nonnegative(),unique_viewers:e.number().int().nonnegative(),attributed_signups:e.number().int().nonnegative(),active_sharers:e.number().int().nonnegative(),k_factor:e.number().nullable(),shares_sent_sparkline:e.array(e.number().int().nonnegative()),top_sharers:e.array(Ws)}),Js=e.object({windows:e.array(Ks)}),Ys=e.object({quoted_text:e.string().min(1),comment:e.string().nullable(),type:e.enum(["comment","highlight:trapdoor"])}),Xs=Dt,ei=Nt.extend({comment_thread_id:e.string().min(1)}),ti=e.object({markdown:e.string().min(1)}),ri=e.object({storage_url:e.string().min(1),thread_file_id:e.string().min(1),parsed_plan_block:wt,critiqued_plan_block:wt,annotations:e.array(Ys),comment_threads:e.array(Xs),comments:e.array(ei)}),je=e.enum(We),Ft=e.object({skills:e.boolean(),workspace_scope:e.boolean(),review:e.boolean(),shared_thread_ttl_days:e.number().int().positive().nullable()}),tt=e.object({subject_type:e.enum(["user","organization"]),subject_id:e.string().min(1),effective_plan:je,admin_override:je.nullable(),stripe_subscription_status:e.string().nullable(),cancel_at_period_end:e.boolean(),current_period_end:e.string().nullable(),seat_quantity:e.number().int().positive(),member_count:e.number().int().nonnegative().nullable(),features:Ft}),ni=e.object({effective_plan:je,features:Ft,user:tt,organization:tt.nullable()}),ai=e.object({plan:e.enum(["creator","team"]),seat_quantity:e.number().int().positive().optional()}),si=e.object({checkout_url:e.string().min(1)}),ii=e.object({portal_url:e.string().min(1)}),oi=e.object({seat_quantity:e.number().int().positive()}),Ot=e.object({plan:je.nullable()}),Ne=e.object({subject_type:e.enum(["user","organization"]),subject_id:e.string().min(1),label:e.string().min(1),effective_plan:je,admin_override:je.nullable(),stripe_subscription_status:e.string().nullable(),seat_quantity:e.number().int().positive()}),ci=e.object({users:e.array(Ne),organizations:e.array(Ne)}),di=e.object({id:e.string().min(1),display_name:e.string().min(1),handle:e.string().nullable(),avatar_url:e.string().nullable()}),li=e.object({thread_id:e.string().min(1),title:e.string().min(1),author:di,last_active_at:e.string().datetime(),last_block_excerpt:e.string().nullable(),last_block_kind:e.string().min(1).nullable(),is_streaming:e.boolean()}),pi=e.object({type:e.literal("list"),list_type:e.literal("live_thread"),objects:e.array(li)}),mi=e.object({thread_id:e.string().min(1)}),ui=e.object({thread_id:e.string().min(1),last_seen_at:e.string().datetime(),started_at:e.string().datetime()}),hi=e.object({follower_id:e.string().min(1),followee_id:e.string().min(1),is_following:e.literal(!0),follower_count:e.number().int().nonnegative()}),fi=e.object({follower_id:e.string().min(1),followee_id:e.string().min(1),is_following:e.literal(!1),follower_count:e.number().int().nonnegative()}),Gt=e.object({id:e.string().min(1),display_name:e.string().min(1),handle:e.string().nullable(),avatar_url:e.string().nullable(),bio:e.string().max(280).nullable(),is_following:e.boolean(),is_self:e.boolean()}),At=e.object({type:e.literal("list"),list_type:e.literal("user_follow"),objects:e.array(Gt)}),yi=e.object({date:e.string().regex(/^\d{4}-\d{2}-\d{2}$/),count:e.number().int().nonnegative()}),gi=e.object({window_start:e.string().datetime(),window_end:e.string().datetime(),total_contributions:e.number().int().nonnegative(),days_active:e.number().int().nonnegative(),daily_average:e.number().nonnegative(),current_streak_days:e.number().int().nonnegative(),days:e.array(yi)}),bi=e.object({type:e.literal("thread_created"),occurred_at:e.string().datetime(),id:e.string().min(1),thread:e.object({id:e.string().min(1),title:e.string(),visibility:e.enum(["private","workspace","public"])})}),_i=e.object({type:e.literal("comment_posted"),occurred_at:e.string().datetime(),id:e.string().min(1),comment_excerpt:e.string(),thread:e.object({id:e.string().min(1),title:e.string(),visibility:e.enum(["private","workspace","public"])})}),vi=e.object({type:e.literal("project_published"),occurred_at:e.string().datetime(),id:e.string().min(1),project:e.object({id:e.string().min(1),name:e.string().min(1)})}),xi=e.object({type:e.literal("user_followed"),occurred_at:e.string().datetime(),id:e.string().min(1),followee:Gt}),Si=e.discriminatedUnion("type",[bi,_i,vi,xi]),ji=e.object({type:e.literal("list"),list_type:e.literal("user_activity"),objects:e.array(Si)}),ki=e.object({id:e.string().min(1),name:e.string().min(1),excerpt:e.string(),published_at:e.string().datetime(),updated_at:e.string().datetime()}),Ti=e.object({type:e.literal("list"),list_type:e.literal("profile_published_project"),objects:e.array(ki)}),Et=e.object({id:e.string().min(1),published_at:e.string().datetime().nullable()}),Ri=e.enum(["avatar","banner"]),wi=e.enum(["image/png","image/jpeg","image/webp","image/gif"]),zi=e.object({kind:Ri,content_type:wi,base64_data:e.string().min(1)}),Ci=e.object({substrate:e.enum(["s3","filesystem"]),storage_url:e.string().min(1)}),Pi=Lt,Qt=sa.router({health:{method:"GET",path:"/health",responses:{200:e.object({status:e.literal("ok")})},summary:"Health check"},whoAmI:{method:"GET",path:"/whoami",headers:e.object({authorization:e.string().min(1).optional(),"x-lore-referral-token":e.string().min(1).max(16).optional()}),responses:{200:da,401:o},summary:"Validate a Stytch B2B Bearer token and return member plus user fields"},recordHeartbeat:{method:"POST",path:"/heartbeat",headers:e.object({authorization:e.string().min(1).optional()}),body:mi,responses:{200:ui,401:o,403:o,404:o,422:o},summary:"Record (or refresh) a presence heartbeat for the authenticated user against one of their own threads. Idempotent; the daemon should call this every ~30s while a session is open."},listLiveThreads:{method:"GET",path:"/threads/live",headers:e.object({authorization:e.string().min(1).optional()}),responses:{200:pi,401:o,403:o},summary:"List teammates with activity in the last 5 minutes. Excludes the requester. Org-scoped, deduped per author, max 10."},listThreads:{method:"GET",path:"/threads",headers:e.object({authorization:e.string().min(1).optional()}),query:Ps,responses:{200:Ct,401:o},summary:"List threads visible to the authenticated user"},getThread:{method:"GET",path:"/threads/:id",pathParams:e.object({id:e.string().min(1)}),headers:e.object({authorization:e.string().min(1).optional()}),responses:{200:Se,404:o},summary:"Load a visible thread by id"},getSimilarThreads:{method:"GET",path:"/threads/:id/similar",pathParams:e.object({id:e.string().min(1)}),headers:e.object({authorization:e.string().min(1).optional()}),responses:{200:Ct,404:o,409:o},summary:"List the top 20 visible threads with the closest summary embedding"},listThreadBlocks:{method:"GET",path:"/threads/:id/blocks",pathParams:e.object({id:e.string().min(1)}),headers:e.object({authorization:e.string().min(1).optional()}),query:Cs,responses:{200:$t,401:o},summary:"List blocks for a visible thread"},createThreadBlockCommentThread:{method:"POST",path:"/threads/:threadId/blocks/:blockId/comment-threads",pathParams:e.object({threadId:e.string().min(1),blockId:e.string().min(1)}),headers:e.object({authorization:e.string().min(1).optional()}),body:za,responses:{201:Ca,401:o,404:o},summary:"Create a new block-level comment thread on a visible thread block"},createThreadBlockComment:{method:"POST",path:"/threads/:threadId/blocks/:blockId/comment-threads/:commentThreadId/comments",pathParams:e.object({threadId:e.string().min(1),blockId:e.string().min(1),commentThreadId:e.string().min(1)}),headers:e.object({authorization:e.string().min(1).optional()}),body:Aa,responses:{201:Ea,401:o,404:o,409:o},summary:"Reply to a block-level comment thread on a visible thread block"},updateThreadBlockCommentThread:{method:"PATCH",path:"/threads/:threadId/blocks/:blockId/comment-threads/:commentThreadId",pathParams:e.object({threadId:e.string().min(1),blockId:e.string().min(1),commentThreadId:e.string().min(1)}),headers:e.object({authorization:e.string().min(1).optional()}),body:Ba,responses:{200:qa,401:o,404:o},summary:"Resolve or reopen a block-level comment thread on a visible thread block"},listSkills:{method:"GET",path:"/skills",headers:e.object({authorization:e.string().min(1).optional()}),responses:{200:Es,401:o},summary:"Aggregate skill usage across threads the viewer can see"},getSkillDetail:{method:"GET",path:"/skills/:name",pathParams:e.object({name:e.string().min(1)}),headers:e.object({authorization:e.string().min(1).optional()}),responses:{200:Ls,401:o,404:o},summary:"Per-skill detail: usage stats + visible threads that invoked it"},redactThreadBlock:{method:"POST",path:"/threads/:threadId/blocks/:blockId/redactions",pathParams:e.object({threadId:e.string().min(1),blockId:e.string().min(1)}),headers:e.object({authorization:e.string().min(1).optional()}),body:Os,responses:{200:we,401:o,403:o,404:o,422:o},summary:"Permanently redact a character range within a text field of a thread block (author only)"},updateThreadBlockText:{method:"PATCH",path:"/threads/:threadId/blocks/:blockId/text",pathParams:e.object({threadId:e.string().min(1),blockId:e.string().min(1)}),headers:e.object({authorization:e.string().min(1).optional()}),body:Bs,responses:{200:we,401:o,403:o,404:o,422:o},summary:"Replace a single text leaf in a thread block with new content (author only)"},critiqueThreadBlock:{method:"POST",path:"/threads/:threadId/blocks/:blockId/critique",pathParams:e.object({threadId:e.string().min(1),blockId:e.string().min(1)}),headers:e.object({authorization:e.string().min(1).optional()}),body:e.object({}).optional(),responses:{200:we,401:o,403:o,404:o,409:o,422:o},summary:"Critique a plan block once and persist its annotations as nested comment threads (author only)"},deleteThreadBlock:{method:"DELETE",path:"/threads/:threadId/blocks/:blockId",pathParams:e.object({threadId:e.string().min(1),blockId:e.string().min(1)}),headers:e.object({authorization:e.string().min(1).optional()}),body:e.object({}).optional(),responses:{204:e.null(),401:o,403:o,404:o},summary:"Soft-delete a thread block (author only)"},listThreadBlockEdits:{method:"GET",path:"/threads/:threadId/blocks/:blockId/edits",pathParams:e.object({threadId:e.string().min(1),blockId:e.string().min(1)}),headers:e.object({authorization:e.string().min(1).optional()}),responses:{200:Ns,401:o,404:o},summary:"List edits made to a thread block (visible to anyone who can see the thread)"},listThreadDecisions:{method:"GET",path:"/threads/:id/decisions",pathParams:e.object({id:e.string().min(1)}),headers:e.object({authorization:e.string().min(1).optional()}),responses:{200:us,401:o,404:o},summary:"List AI-extracted user decisions for a thread, in chronological order"},updateThread:{method:"PATCH",path:"/threads/:id",pathParams:e.object({id:e.string().min(1)}),headers:e.object({authorization:e.string().min(1).optional()}),body:_s,responses:{200:Se,401:o,403:o,404:o},summary:"Update thread visibility (author only)"},deleteThread:{method:"DELETE",path:"/threads/:id",pathParams:e.object({id:e.string().min(1)}),headers:e.object({authorization:e.string().min(1).optional()}),body:e.object({}).optional(),responses:{204:e.null(),401:o,403:o,404:o},summary:"Soft-delete a thread (author only)"},castThreadVote:{method:"PUT",path:"/threads/:id/vote",pathParams:e.object({id:e.string().min(1)}),headers:e.object({authorization:e.string().min(1).optional()}),body:es,responses:{200:zt,401:o,403:o,404:o,422:o},summary:"Cast or change the caller's up/down vote on a public thread. Idempotent \u2014 re-casting the same value is a no-op."},clearThreadVote:{method:"DELETE",path:"/threads/:id/vote",pathParams:e.object({id:e.string().min(1)}),headers:e.object({authorization:e.string().min(1).optional()}),body:e.object({}).optional(),responses:{200:zt,401:o,404:o},summary:"Clear the caller's vote on a thread. No-op when the caller hasn't voted."},listThreadComments:{method:"GET",path:"/threads/:threadId/comments",pathParams:e.object({threadId:e.string().min(1)}),headers:e.object({authorization:e.string().min(1).optional()}),responses:{200:rs,403:o,404:o},summary:"List all (live + soft-deleted as tombstones) comments on a public thread, flat with parent_comment_id pointers."},createThreadComment:{method:"POST",path:"/threads/:threadId/comments",pathParams:e.object({threadId:e.string().min(1)}),headers:e.object({authorization:e.string().min(1).optional()}),body:ns,responses:{201:as,401:o,403:o,404:o,422:o},summary:"Post a top-level or reply comment on a public thread."},updateThreadComment:{method:"PATCH",path:"/threads/:threadId/comments/:commentId",pathParams:e.object({threadId:e.string().min(1),commentId:e.string().min(1)}),headers:e.object({authorization:e.string().min(1).optional()}),body:ss,responses:{200:is,401:o,403:o,404:o,422:o},summary:"Edit your own thread comment (author only; rejects edits to soft-deleted rows)."},deleteThreadComment:{method:"DELETE",path:"/threads/:threadId/comments/:commentId",pathParams:e.object({threadId:e.string().min(1),commentId:e.string().min(1)}),headers:e.object({authorization:e.string().min(1).optional()}),body:e.object({}).optional(),responses:{200:os,401:o,403:o,404:o},summary:"Soft-delete your own thread comment (author only). Idempotent."},getThreadPreview:{method:"GET",path:"/threads/:id/preview",pathParams:e.object({id:e.string().min(1)}),responses:{200:vs,404:o},summary:"Unauthenticated, visibility-redacted metadata for OG / social preview consumers"},createUser:{method:"POST",path:"/users",headers:e.object({authorization:e.string().min(1).optional()}),body:_a,responses:{201:et,401:o},summary:"Create a user record with ApiKey authentication"},getUser:{method:"GET",path:"/users/:id",pathParams:e.object({id:e.string().min(1)}),headers:e.object({authorization:e.string().min(1).optional()}),responses:{200:Lt,404:o},summary:"Public profile for a user. Optional auth \u2014 unauthenticated viewers see only public thread metadata; signed-in viewers see counts scoped to the threads they'd normally be able to access."},updateCurrentUser:{method:"PATCH",path:"/users/me",headers:e.object({authorization:e.string().min(1).optional()}),body:la,responses:{200:et,401:o,409:o,422:o},summary:"Update the authenticated user profile"},getUserByHandle:{method:"GET",path:"/users/by-handle/:handle",pathParams:e.object({handle:It}),headers:e.object({authorization:e.string().min(1).optional()}),responses:{200:Pi,404:o},summary:"Resolve a public profile by handle \u2014 same shape as GET /users/:id but keyed on the user's chosen handle."},listUserActivity:{method:"GET",path:"/users/:id/activity",pathParams:e.object({id:e.string().min(1)}),headers:e.object({authorization:e.string().min(1).optional()}),query:e.object({limit:e.coerce.number().int().positive().max(100).optional()}),responses:{200:ji,404:o},summary:"Reverse-chronological activity feed for a user, scoped to what the viewer can see (same visibility rules as listThreads)."},getUserContributions:{method:"GET",path:"/users/:id/contributions",pathParams:e.object({id:e.string().min(1)}),headers:e.object({authorization:e.string().min(1).optional()}),responses:{200:gi,404:o},summary:"Daily contribution counts for the trailing 365 days \u2014 counts thread blocks the user authored on threads visible to the viewer."},listUserFollowers:{method:"GET",path:"/users/:id/followers",pathParams:e.object({id:e.string().min(1)}),headers:e.object({authorization:e.string().min(1).optional()}),responses:{200:At,404:o},summary:"List the users following a given user."},listUserFollowing:{method:"GET",path:"/users/:id/following",pathParams:e.object({id:e.string().min(1)}),headers:e.object({authorization:e.string().min(1).optional()}),responses:{200:At,404:o},summary:"List the users a given user is following."},followUser:{method:"POST",path:"/users/:id/follow",pathParams:e.object({id:e.string().min(1)}),headers:e.object({authorization:e.string().min(1).optional()}),body:e.object({}).optional(),responses:{200:hi,401:o,404:o,409:o,422:o},summary:"Follow another user. Idempotent \u2014 repeating the call is a no-op."},unfollowUser:{method:"DELETE",path:"/users/:id/follow",pathParams:e.object({id:e.string().min(1)}),headers:e.object({authorization:e.string().min(1).optional()}),body:e.object({}).optional(),responses:{200:fi,401:o,404:o},summary:"Unfollow a user. Idempotent \u2014 repeating the call is a no-op."},listProfilePublishedProjects:{method:"GET",path:"/users/:id/projects",pathParams:e.object({id:e.string().min(1)}),headers:e.object({authorization:e.string().min(1).optional()}),responses:{200:Ti,404:o},summary:"Projects the user has published to their public profile."},publishProject:{method:"POST",path:"/projects/:id/publish",pathParams:e.object({id:e.string().min(1)}),headers:e.object({authorization:e.string().min(1).optional()}),body:e.object({}).optional(),responses:{200:Et,401:o,403:o,404:o},summary:"Publish a project to the author's public profile. Stamps published_at with `now()`. Author-only."},unpublishProject:{method:"DELETE",path:"/projects/:id/publish",pathParams:e.object({id:e.string().min(1)}),headers:e.object({authorization:e.string().min(1).optional()}),body:e.object({}).optional(),responses:{200:Et,401:o,403:o,404:o},summary:"Remove a project from the author's public profile."},uploadProfileImage:{method:"POST",path:"/users/me/profile-image",headers:e.object({authorization:e.string().min(1).optional()}),body:zi,responses:{200:Ci,401:o,413:o,422:o},summary:"Upload an avatar or banner image (base64-encoded JSON body). The API streams the bytes to its configured storage substrate using its own credentials and returns the canonical storage URL the client passes to PATCH /users/me."},listOrganizationMembers:{method:"GET",path:"/organization/members",headers:e.object({authorization:e.string().min(1).optional()}),responses:{200:ma,401:o},summary:"List members of the authenticated user\u2019s organization"},createOrganizationInvite:{method:"POST",path:"/organization/invites",headers:e.object({authorization:e.string().min(1).optional()}),body:ua,responses:{201:ha,401:o,403:o,409:o,422:o},summary:"Invite a teammate to the authenticated user\u2019s workspace via Stytch B2B"},listRepositories:{method:"GET",path:"/repositories",headers:e.object({authorization:e.string().min(1).optional()}),responses:{200:Qa,401:o,403:o},summary:"List repositories known to the authenticated user\u2019s organization across threads and building blocks"},createBuildingBlockSnapshots:{method:"POST",path:"/building_blocks",headers:e.object({authorization:e.string().min(1).optional()}),body:xa,responses:{201:Ma,401:o,403:o},summary:"Create building block snapshots for the authenticated user\u2019s organization"},getPlan:{method:"GET",path:"/plans/:id",pathParams:e.object({id:e.string().min(1)}),headers:e.object({authorization:e.string().min(1).optional()}),responses:{200:Na,401:o,403:o,404:o},summary:"Load a thread-backed plan container visible to the authenticated user, including all visible plan revisions in that thread"},createPlanCommentThread:{method:"POST",path:"/plans/:id/comment-threads",pathParams:e.object({id:e.string().min(1)}),headers:e.object({authorization:e.string().min(1).optional()}),body:Ra,responses:{201:wa,401:o,403:o,404:o,422:o},summary:"Create a new inline comment thread on a specific revision inside a thread-backed plan container"},createPlanComment:{method:"POST",path:"/plans/:id/comment-threads/:threadId/comments",pathParams:e.object({id:e.string().min(1),threadId:e.string().min(1)}),headers:e.object({authorization:e.string().min(1).optional()}),body:Pa,responses:{201:Oa,401:o,403:o,404:o,409:o},summary:"Reply to an inline comment thread on a thread-backed plan container"},updatePlanCommentThread:{method:"PATCH",path:"/plans/:id/comment-threads/:threadId",pathParams:e.object({id:e.string().min(1),threadId:e.string().min(1)}),headers:e.object({authorization:e.string().min(1).optional()}),body:Ia,responses:{200:La,401:o,403:o,404:o},summary:"Resolve or reopen an inline comment thread on a thread-backed plan container"},listPlans:{method:"GET",path:"/plans",headers:e.object({authorization:e.string().min(1).optional()}),query:$a,responses:{200:Da,401:o,403:o},summary:"List thread-backed plan containers visible to the authenticated user in their organization, ordered by latest visible revision and optionally filtered by author or repository"},listBuildingBlockSnapshots:{method:"GET",path:"/building_blocks",headers:e.object({authorization:e.string().min(1).optional()}),query:Za,responses:{200:Va,401:o,403:o},summary:"List building block snapshots for the authenticated user\u2019s organization and repo origin path"},listUploadSessions:{method:"GET",path:"/upload_sessions",headers:e.object({authorization:e.string().min(1).optional()}),responses:{200:zs,401:o},summary:"List recent upload sessions for the authenticated user"},createUploadSession:{method:"POST",path:"/upload_sessions",headers:e.object({authorization:e.string().min(1).optional()}),body:e.object({thread_files:e.array(Ka).nonempty()}),responses:{201:bs,400:o,401:o},summary:"Create an upload session with presigned URLs for file uploads"},completeUploadSession:{method:"POST",path:"/upload_sessions/:id/complete",pathParams:e.object({id:e.string().min(1)}),headers:e.object({authorization:e.string().min(1).optional()}),body:e.object({thread_files:e.array(hs).nonempty()}),responses:{200:ys,400:o,401:o,404:o,409:o,422:o},summary:"Complete an upload session after files have been uploaded to storage"},adminStats:{method:"GET",path:"/admin/stats",headers:e.object({authorization:e.string().min(1).optional()}),responses:{200:Ds,401:o,403:o},summary:"Cross-org operational counts. Tanagram admins only."},adminListOrganizations:{method:"GET",path:"/admin/organizations",headers:e.object({authorization:e.string().min(1).optional()}),responses:{200:Ms,401:o,403:o},summary:"List every organization with member and thread counts. Tanagram admins only."},adminListUsers:{method:"GET",path:"/admin/users",headers:e.object({authorization:e.string().min(1).optional()}),responses:{200:Zs,401:o,403:o},summary:"List every user with their org memberships and thread count. Tanagram admins only."},adminListThreads:{method:"GET",path:"/admin/threads",headers:e.object({authorization:e.string().min(1).optional()}),query:Qs,responses:{200:Gs,401:o,403:o},summary:"List live threads across every organization. Tanagram admins only."},adminHardDeleteThread:{method:"DELETE",path:"/admin/threads/:id",pathParams:e.object({id:e.string().min(1)}),headers:e.object({authorization:e.string().min(1).optional()}),body:e.object({}).optional(),responses:{204:e.null(),401:o,403:o,404:o},summary:"Permanently remove a thread. Tanagram admins only."},listDiscoverThreads:{method:"GET",path:"/discover/threads",headers:e.object({authorization:e.string().min(1).optional()}),query:Ts,responses:{200:ks},summary:"Feed of public threads with sort, harness filter, search, and cursor pagination. Auth is optional and populates viewer_vote."},discoverStats:{method:"GET",path:"/discover/stats",responses:{200:Rs},summary:"Unauthenticated rollup of public-thread counts for the Discover header."},createWaitlistEntry:{method:"POST",path:"/waitlist_entries",body:fa,responses:{201:ya,409:o},summary:"Create an unauthenticated waitlist entry keyed by (location, contact)."},createShareToken:{method:"POST",path:"/threads/:id/share-token",pathParams:e.object({id:e.string().min(1)}),headers:e.object({authorization:e.string().min(1).optional()}),body:e.object({}).optional(),responses:{201:Pt,401:o,403:o,404:o,409:o},summary:"Mint a short share-link token for a public thread. Author only. The token powers `/s/:token` short URLs and enables k-factor attribution."},resolveShareToken:{method:"GET",path:"/referrals/resolve/:token",pathParams:e.object({token:e.string().min(1).max(16)}),query:Hs,responses:{200:Pt,404:o},summary:"Resolve a share-link token to its thread and record the view. Unauthenticated by design."},adminGrowth:{method:"GET",path:"/admin/growth",headers:e.object({authorization:e.string().min(1).optional()}),responses:{200:Js,401:o,403:o},summary:"Share-link k-factor, funnel, sparkline, and top sharers by window. Tanagram admins only."},adminRunCritiquePlayground:{method:"POST",path:"/admin/critique-playground/run",headers:e.object({authorization:e.string().min(1).optional()}),body:ti,responses:{200:ri,401:o,403:o,409:o},summary:"Admin-only critique playground that saves markdown to a file:// plan artifact and returns parsed + critiqued plan blocks."},getBillingState:{method:"GET",path:"/billing/state",headers:e.object({authorization:e.string().min(1).optional()}),responses:{200:ni,401:o},summary:"Resolve the caller's plan, features, seat count, and any admin override."},createBillingCheckout:{method:"POST",path:"/billing/checkout",headers:e.object({authorization:e.string().min(1).optional()}),body:ai,responses:{200:si,400:o,401:o,403:o,503:o},summary:"Start a Stripe Checkout session for Creator ($29/mo) or Team ($19/seat/mo, min 2)."},createBillingPortal:{method:"POST",path:"/billing/portal",headers:e.object({authorization:e.string().min(1).optional()}),body:e.object({subject_type:e.enum(["user","organization"]).default("user")}).optional(),responses:{200:ii,401:o,404:o,503:o},summary:"Open the Stripe customer portal so the subject can manage their subscription."},updateTeamSeats:{method:"PATCH",path:"/billing/team-seats",headers:e.object({authorization:e.string().min(1).optional()}),body:oi,responses:{200:tt,400:o,401:o,403:o,404:o,503:o},summary:"Adjust the caller-organization's Team seat quantity (admin of that org only)."},adminListBilling:{method:"GET",path:"/admin/billing",headers:e.object({authorization:e.string().min(1).optional()}),responses:{200:ci,401:o,403:o},summary:"List every user and org with current plan + override for the admin panel."},adminSetUserPlanOverride:{method:"PUT",path:"/admin/billing/users/:id/override",pathParams:e.object({id:e.string().min(1)}),headers:e.object({authorization:e.string().min(1).optional()}),body:Ot,responses:{200:Ne,401:o,403:o,404:o},summary:"Admin override for a user's plan tier. Null clears the override."},adminSetOrganizationPlanOverride:{method:"PUT",path:"/admin/billing/organizations/:id/override",pathParams:e.object({id:e.string().min(1)}),headers:e.object({authorization:e.string().min(1).optional()}),body:Ot,responses:{200:Ne,401:o,403:o,404:o},summary:"Admin override for an organization's plan tier. Null clears the override."},projects:jt,docs:xt,mentions:kt,favorites:Rt},{pathPrefix:"/api"});var Oi="prod";function Ht(){return Oi}var Ai={dev:"http://localhost:4000",prod:"https://lore.tanagram.ai"};function Wt(){return He(Qt,{baseUrl:Ai[Ht()],baseHeaders:{}})}async function Ei(n){let[t]=n;switch(t){case void 0:case"hello":return console.log("hello world"),0;case"health":{let a=await Wt().health();return a.status===200?(console.log(a.body.status),0):(console.error(`health check failed: HTTP ${a.status}`),1)}default:return console.error(`lore: unknown subcommand "${t}"`),console.error("usage: lore [hello|health]"),2}}Ei(process.argv.slice(2)).then(n=>process.exit(n),n=>{console.error(n),process.exit(1)});
|
package/package.json
ADDED
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@tanagram/lore",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "Lore CLI",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"bin": {
|
|
7
|
+
"lore": "./dist/index.js"
|
|
8
|
+
},
|
|
9
|
+
"files": [
|
|
10
|
+
"dist"
|
|
11
|
+
],
|
|
12
|
+
"publishConfig": {
|
|
13
|
+
"access": "public"
|
|
14
|
+
},
|
|
15
|
+
"devDependencies": {
|
|
16
|
+
"@ts-rest/core": "^3.52.1",
|
|
17
|
+
"@types/node": "^22.16.5",
|
|
18
|
+
"esbuild": "^0.24.0",
|
|
19
|
+
"tsx": "^4.20.6",
|
|
20
|
+
"typescript": "^5.9.3",
|
|
21
|
+
"@lore/contracts": "0.1.0"
|
|
22
|
+
},
|
|
23
|
+
"scripts": {
|
|
24
|
+
"dev": "tsx watch src/index.ts",
|
|
25
|
+
"build": "esbuild src/index.ts --bundle --platform=node --format=esm --target=node20 --outfile=dist/index.js && chmod +x dist/index.js",
|
|
26
|
+
"build:prod": "esbuild src/index.ts --bundle --minify --legal-comments=none --platform=node --format=esm --target=node20 --define:process.env.LORE_BUILD_ENV='\"prod\"' --outfile=dist/index.js && chmod +x dist/index.js",
|
|
27
|
+
"start": "node dist/index.js",
|
|
28
|
+
"lint": "tsc --noEmit",
|
|
29
|
+
"typecheck": "tsc --noEmit"
|
|
30
|
+
}
|
|
31
|
+
}
|