@ailu-ai/contracts 2.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +201 -0
- package/dist/admin.d.ts +99 -0
- package/dist/admin.d.ts.map +1 -0
- package/dist/admin.js +59 -0
- package/dist/admin.js.map +1 -0
- package/dist/admin.test.d.ts +2 -0
- package/dist/admin.test.d.ts.map +1 -0
- package/dist/admin.test.js +42 -0
- package/dist/admin.test.js.map +1 -0
- package/dist/approvals.d.ts +58 -0
- package/dist/approvals.d.ts.map +1 -0
- package/dist/approvals.js +28 -0
- package/dist/approvals.js.map +1 -0
- package/dist/artifacts.d.ts +22 -0
- package/dist/artifacts.d.ts.map +1 -0
- package/dist/artifacts.js +9 -0
- package/dist/artifacts.js.map +1 -0
- package/dist/catalog.d.ts +626 -0
- package/dist/catalog.d.ts.map +1 -0
- package/dist/catalog.js +69 -0
- package/dist/catalog.js.map +1 -0
- package/dist/catalog.test.d.ts +2 -0
- package/dist/catalog.test.d.ts.map +1 -0
- package/dist/catalog.test.js +98 -0
- package/dist/catalog.test.js.map +1 -0
- package/dist/compliance.d.ts +428 -0
- package/dist/compliance.d.ts.map +1 -0
- package/dist/compliance.js +80 -0
- package/dist/compliance.js.map +1 -0
- package/dist/connectors.d.ts +161 -0
- package/dist/connectors.d.ts.map +1 -0
- package/dist/connectors.js +49 -0
- package/dist/connectors.js.map +1 -0
- package/dist/error-envelope.d.ts +16 -0
- package/dist/error-envelope.d.ts.map +1 -0
- package/dist/error-envelope.js +7 -0
- package/dist/error-envelope.js.map +1 -0
- package/dist/eval.d.ts +144 -0
- package/dist/eval.d.ts.map +1 -0
- package/dist/eval.js +36 -0
- package/dist/eval.js.map +1 -0
- package/dist/events.d.ts +359 -0
- package/dist/events.d.ts.map +1 -0
- package/dist/events.js +134 -0
- package/dist/events.js.map +1 -0
- package/dist/fleet.d.ts +147 -0
- package/dist/fleet.d.ts.map +1 -0
- package/dist/fleet.js +34 -0
- package/dist/fleet.js.map +1 -0
- package/dist/fs-policy.d.ts +101 -0
- package/dist/fs-policy.d.ts.map +1 -0
- package/dist/fs-policy.js +36 -0
- package/dist/fs-policy.js.map +1 -0
- package/dist/fs-policy.test.d.ts +2 -0
- package/dist/fs-policy.test.d.ts.map +1 -0
- package/dist/fs-policy.test.js +35 -0
- package/dist/fs-policy.test.js.map +1 -0
- package/dist/fs.d.ts +182 -0
- package/dist/fs.d.ts.map +1 -0
- package/dist/fs.js +59 -0
- package/dist/fs.js.map +1 -0
- package/dist/fs.test.d.ts +2 -0
- package/dist/fs.test.d.ts.map +1 -0
- package/dist/fs.test.js +35 -0
- package/dist/fs.test.js.map +1 -0
- package/dist/graphs.d.ts +951 -0
- package/dist/graphs.d.ts.map +1 -0
- package/dist/graphs.js +94 -0
- package/dist/graphs.js.map +1 -0
- package/dist/graphs.test.d.ts +2 -0
- package/dist/graphs.test.d.ts.map +1 -0
- package/dist/graphs.test.js +65 -0
- package/dist/graphs.test.js.map +1 -0
- package/dist/index.d.ts +25 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +25 -0
- package/dist/index.js.map +1 -0
- package/dist/index.test.d.ts +2 -0
- package/dist/index.test.d.ts.map +1 -0
- package/dist/index.test.js +9 -0
- package/dist/index.test.js.map +1 -0
- package/dist/knowledge.d.ts +315 -0
- package/dist/knowledge.d.ts.map +1 -0
- package/dist/knowledge.js +111 -0
- package/dist/knowledge.js.map +1 -0
- package/dist/knowledge.test.d.ts +2 -0
- package/dist/knowledge.test.d.ts.map +1 -0
- package/dist/knowledge.test.js +22 -0
- package/dist/knowledge.test.js.map +1 -0
- package/dist/node-metadata.d.ts +3096 -0
- package/dist/node-metadata.d.ts.map +1 -0
- package/dist/node-metadata.js +184 -0
- package/dist/node-metadata.js.map +1 -0
- package/dist/node-metadata.test.d.ts +2 -0
- package/dist/node-metadata.test.d.ts.map +1 -0
- package/dist/node-metadata.test.js +126 -0
- package/dist/node-metadata.test.js.map +1 -0
- package/dist/observability.d.ts +154 -0
- package/dist/observability.d.ts.map +1 -0
- package/dist/observability.js +34 -0
- package/dist/observability.js.map +1 -0
- package/dist/pii.d.ts +88 -0
- package/dist/pii.d.ts.map +1 -0
- package/dist/pii.js +42 -0
- package/dist/pii.js.map +1 -0
- package/dist/principal.d.ts +81 -0
- package/dist/principal.d.ts.map +1 -0
- package/dist/principal.js +48 -0
- package/dist/principal.js.map +1 -0
- package/dist/principal.test.d.ts +2 -0
- package/dist/principal.test.d.ts.map +1 -0
- package/dist/principal.test.js +44 -0
- package/dist/principal.test.js.map +1 -0
- package/dist/registries.d.ts +26 -0
- package/dist/registries.d.ts.map +1 -0
- package/dist/registries.js +11 -0
- package/dist/registries.js.map +1 -0
- package/dist/router.d.ts +48 -0
- package/dist/router.d.ts.map +1 -0
- package/dist/router.js +22 -0
- package/dist/router.js.map +1 -0
- package/dist/runs.d.ts +270 -0
- package/dist/runs.d.ts.map +1 -0
- package/dist/runs.js +108 -0
- package/dist/runs.js.map +1 -0
- package/dist/runs.test.d.ts +2 -0
- package/dist/runs.test.d.ts.map +1 -0
- package/dist/runs.test.js +79 -0
- package/dist/runs.test.js.map +1 -0
- package/dist/search.d.ts +88 -0
- package/dist/search.d.ts.map +1 -0
- package/dist/search.js +23 -0
- package/dist/search.js.map +1 -0
- package/dist/skills.d.ts +208 -0
- package/dist/skills.d.ts.map +1 -0
- package/dist/skills.js +63 -0
- package/dist/skills.js.map +1 -0
- package/dist/tenant.d.ts +204 -0
- package/dist/tenant.d.ts.map +1 -0
- package/dist/tenant.js +46 -0
- package/dist/tenant.js.map +1 -0
- package/package.json +33 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,201 @@
|
|
|
1
|
+
Apache License
|
|
2
|
+
Version 2.0, January 2004
|
|
3
|
+
http://www.apache.org/licenses/
|
|
4
|
+
|
|
5
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
6
|
+
|
|
7
|
+
1. Definitions.
|
|
8
|
+
|
|
9
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
10
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
11
|
+
|
|
12
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
13
|
+
the copyright owner that is granting the License.
|
|
14
|
+
|
|
15
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
16
|
+
other entities that control, are controlled by, or are under common
|
|
17
|
+
control with that entity. For the purposes of this definition,
|
|
18
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
19
|
+
direction or management of such entity, whether by contract or
|
|
20
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
21
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
22
|
+
|
|
23
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
24
|
+
exercising permissions granted by this License.
|
|
25
|
+
|
|
26
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
27
|
+
including but not limited to software source code, documentation
|
|
28
|
+
source, and configuration files.
|
|
29
|
+
|
|
30
|
+
"Object" form shall mean any form resulting from mechanical
|
|
31
|
+
transformation or translation of a Source form, including but
|
|
32
|
+
not limited to compiled object code, generated documentation,
|
|
33
|
+
and conversions to other media types.
|
|
34
|
+
|
|
35
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
36
|
+
Object form, made available under the License, as indicated by a
|
|
37
|
+
copyright notice that is included in or attached to the work
|
|
38
|
+
(an example is provided in the Appendix below).
|
|
39
|
+
|
|
40
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
41
|
+
form, that is based on (or derived from) the Work and for which the
|
|
42
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
43
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
44
|
+
of this License, Derivative Works shall not include works that remain
|
|
45
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
46
|
+
the Work and Derivative Works thereof.
|
|
47
|
+
|
|
48
|
+
"Contribution" shall mean any work of authorship, including
|
|
49
|
+
the original version of the Work and any modifications or additions
|
|
50
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
51
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
52
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
53
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
54
|
+
means any form of electronic, verbal, or written communication sent
|
|
55
|
+
to the Licensor or its representatives, including but not limited to
|
|
56
|
+
communication on electronic mailing lists, source code control systems,
|
|
57
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
58
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
59
|
+
excluding communication that is conspicuously marked or otherwise
|
|
60
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
61
|
+
|
|
62
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
63
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
64
|
+
subsequently incorporated within the Work.
|
|
65
|
+
|
|
66
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
67
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
68
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
69
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
70
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
71
|
+
Work and such Derivative Works in Source or Object form.
|
|
72
|
+
|
|
73
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
74
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
75
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
76
|
+
(except as stated in this section) patent license to make, have made,
|
|
77
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
78
|
+
where such license applies only to those patent claims licensable
|
|
79
|
+
by such Contributor that are necessarily infringed by their
|
|
80
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
81
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
82
|
+
institute patent litigation against any entity (including a
|
|
83
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
84
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
85
|
+
or contributory patent infringement, then any patent licenses
|
|
86
|
+
granted to You under this License for that Work shall terminate
|
|
87
|
+
as of the date such litigation is filed.
|
|
88
|
+
|
|
89
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
90
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
91
|
+
modifications, and in Source or Object form, provided that You
|
|
92
|
+
meet the following conditions:
|
|
93
|
+
|
|
94
|
+
(a) You must give any other recipients of the Work or Derivative
|
|
95
|
+
Works a copy of this License; and
|
|
96
|
+
|
|
97
|
+
(b) You must cause any modified files to carry prominent notices
|
|
98
|
+
stating that You changed the files; and
|
|
99
|
+
|
|
100
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
101
|
+
that You distribute, all copyright, patent, trademark, and
|
|
102
|
+
attribution notices from the Source form of the Work,
|
|
103
|
+
excluding those notices that do not pertain to any part of
|
|
104
|
+
the Derivative Works; and
|
|
105
|
+
|
|
106
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
107
|
+
distribution, then any Derivative Works that You distribute must
|
|
108
|
+
include a readable copy of the attribution notices contained
|
|
109
|
+
within such NOTICE file, excluding those notices that do not
|
|
110
|
+
pertain to any part of the Derivative Works, in at least one
|
|
111
|
+
of the following places: within a NOTICE text file distributed
|
|
112
|
+
as part of the Derivative Works; within the Source form or
|
|
113
|
+
documentation, if provided along with the Derivative Works; or,
|
|
114
|
+
within a display generated by the Derivative Works, if and
|
|
115
|
+
wherever such third-party notices normally appear. The contents
|
|
116
|
+
of the NOTICE file are for informational purposes only and do
|
|
117
|
+
not modify the License. You may add Your own attribution notices
|
|
118
|
+
within Derivative Works that You distribute, alongside or as an
|
|
119
|
+
addendum to the NOTICE text from the Work, provided that such
|
|
120
|
+
additional attribution notices cannot be construed as modifying
|
|
121
|
+
the License.
|
|
122
|
+
|
|
123
|
+
You may add Your own copyright statement to Your modifications and
|
|
124
|
+
may provide additional or different license terms and conditions
|
|
125
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
126
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
127
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
128
|
+
the conditions stated in this License.
|
|
129
|
+
|
|
130
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
131
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
132
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
133
|
+
this License, without any additional terms or conditions.
|
|
134
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
135
|
+
the terms of any separate license agreement you may have executed
|
|
136
|
+
with Licensor regarding such Contributions.
|
|
137
|
+
|
|
138
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
139
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
140
|
+
except as required for reasonable and customary use in describing the
|
|
141
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
142
|
+
|
|
143
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
144
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
145
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
146
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
147
|
+
implied, including, without limitation, any warranties or conditions
|
|
148
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
149
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
150
|
+
appropriateness of using or redistributing the Work and assume any
|
|
151
|
+
risks associated with Your exercise of permissions under this License.
|
|
152
|
+
|
|
153
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
154
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
155
|
+
unless required by applicable law (such as deliberate and grossly
|
|
156
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
157
|
+
liable to You for damages, including any direct, indirect, special,
|
|
158
|
+
incidental, or consequential damages of any character arising as a
|
|
159
|
+
result of this License or out of the use or inability to use the
|
|
160
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
161
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
162
|
+
other commercial damages or losses), even if such Contributor
|
|
163
|
+
has been advised of the possibility of such damages.
|
|
164
|
+
|
|
165
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
166
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
167
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
168
|
+
or other liability obligations and/or rights consistent with this
|
|
169
|
+
License. However, in accepting such obligations, You may act only
|
|
170
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
171
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
172
|
+
defend, and hold each Contributor harmless for any liability
|
|
173
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
174
|
+
of your accepting any such warranty or additional liability.
|
|
175
|
+
|
|
176
|
+
END OF TERMS AND CONDITIONS
|
|
177
|
+
|
|
178
|
+
APPENDIX: How to apply the Apache License to your work.
|
|
179
|
+
|
|
180
|
+
To apply the Apache License to your work, attach the following
|
|
181
|
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
182
|
+
replaced with your own identifying information. (Don't include
|
|
183
|
+
the brackets!) The text should be enclosed in the appropriate
|
|
184
|
+
comment syntax for the file format. We also recommend that a
|
|
185
|
+
file or class name and description of purpose be included on the
|
|
186
|
+
same "printed page" as the copyright notice for easier
|
|
187
|
+
identification within third-party archives.
|
|
188
|
+
|
|
189
|
+
Copyright 2026 Ailu
|
|
190
|
+
|
|
191
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
192
|
+
you may not use this file except in compliance with the License.
|
|
193
|
+
You may obtain a copy of the License at
|
|
194
|
+
|
|
195
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
196
|
+
|
|
197
|
+
Unless required by applicable law or agreed to in writing, software
|
|
198
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
199
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
200
|
+
See the License for the specific language governing permissions and
|
|
201
|
+
limitations under the License.
|
package/dist/admin.d.ts
ADDED
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
/**
|
|
3
|
+
* Administration DTOs (ADR 0010) — admin-managed, per-tenant config that replaces `.env` for
|
|
4
|
+
* self-hosting clients. Secrets are WRITE-ONLY across the wire: set them with the `Set*` DTOs;
|
|
5
|
+
* read DTOs never carry the secret, only `configured` + a last-4 hint.
|
|
6
|
+
*/
|
|
7
|
+
/** Providers whose keys can be set in the admin UI. */
|
|
8
|
+
export declare const LlmProviderSchema: z.ZodEnum<["openai", "anthropic", "mistral", "google", "openrouter", "minimax", "huggingface", "ollama", "lmstudio"]>;
|
|
9
|
+
export type LlmProvider = z.infer<typeof LlmProviderSchema>;
|
|
10
|
+
/** Returned: what's configured, never the key. `source` says where the key resolves from. */
|
|
11
|
+
export declare const LlmProviderKeyDtoSchema: z.ZodObject<{
|
|
12
|
+
provider: z.ZodEnum<["openai", "anthropic", "mistral", "google", "openrouter", "minimax", "huggingface", "ollama", "lmstudio"]>;
|
|
13
|
+
configured: z.ZodBoolean;
|
|
14
|
+
source: z.ZodEnum<["tenant", "env", "none"]>;
|
|
15
|
+
last4: z.ZodOptional<z.ZodString>;
|
|
16
|
+
baseUrl: z.ZodOptional<z.ZodString>;
|
|
17
|
+
defaultModel: z.ZodOptional<z.ZodString>;
|
|
18
|
+
}, "strip", z.ZodTypeAny, {
|
|
19
|
+
provider: "openai" | "anthropic" | "mistral" | "google" | "openrouter" | "minimax" | "huggingface" | "ollama" | "lmstudio";
|
|
20
|
+
configured: boolean;
|
|
21
|
+
source: "tenant" | "env" | "none";
|
|
22
|
+
last4?: string | undefined;
|
|
23
|
+
baseUrl?: string | undefined;
|
|
24
|
+
defaultModel?: string | undefined;
|
|
25
|
+
}, {
|
|
26
|
+
provider: "openai" | "anthropic" | "mistral" | "google" | "openrouter" | "minimax" | "huggingface" | "ollama" | "lmstudio";
|
|
27
|
+
configured: boolean;
|
|
28
|
+
source: "tenant" | "env" | "none";
|
|
29
|
+
last4?: string | undefined;
|
|
30
|
+
baseUrl?: string | undefined;
|
|
31
|
+
defaultModel?: string | undefined;
|
|
32
|
+
}>;
|
|
33
|
+
export type LlmProviderKeyDto = z.infer<typeof LlmProviderKeyDtoSchema>;
|
|
34
|
+
/**
|
|
35
|
+
* Body for PUT /admin/llm-providers/:provider — set/replace the tenant's key.
|
|
36
|
+
*
|
|
37
|
+
* `apiKey` is OPTIONAL because the local providers in {@link LlmProviderSchema} (`ollama`,
|
|
38
|
+
* `lmstudio`) are KEYLESS: they are reached over a `baseUrl` with no credential, so requiring a key
|
|
39
|
+
* made them impossible to configure at all. It keeps `.min(1)` when present, so a cloud provider can
|
|
40
|
+
* still never store an empty secret. "Required unless the provider is local" is enforced by the API,
|
|
41
|
+
* which knows which provider the route targets — the schema does not.
|
|
42
|
+
*/
|
|
43
|
+
export declare const SetLlmProviderKeyDtoSchema: z.ZodObject<{
|
|
44
|
+
apiKey: z.ZodOptional<z.ZodString>;
|
|
45
|
+
baseUrl: z.ZodOptional<z.ZodString>;
|
|
46
|
+
defaultModel: z.ZodOptional<z.ZodString>;
|
|
47
|
+
}, "strip", z.ZodTypeAny, {
|
|
48
|
+
baseUrl?: string | undefined;
|
|
49
|
+
defaultModel?: string | undefined;
|
|
50
|
+
apiKey?: string | undefined;
|
|
51
|
+
}, {
|
|
52
|
+
baseUrl?: string | undefined;
|
|
53
|
+
defaultModel?: string | undefined;
|
|
54
|
+
apiKey?: string | undefined;
|
|
55
|
+
}>;
|
|
56
|
+
export type SetLlmProviderKeyDto = z.infer<typeof SetLlmProviderKeyDtoSchema>;
|
|
57
|
+
/** Connector OAuth *app* credential — what's configured (no secret returned). */
|
|
58
|
+
export declare const ConnectorAppCredentialDtoSchema: z.ZodObject<{
|
|
59
|
+
provider: z.ZodString;
|
|
60
|
+
configured: z.ZodBoolean;
|
|
61
|
+
source: z.ZodEnum<["tenant", "env", "none"]>;
|
|
62
|
+
clientIdLast4: z.ZodOptional<z.ZodString>;
|
|
63
|
+
}, "strip", z.ZodTypeAny, {
|
|
64
|
+
provider: string;
|
|
65
|
+
configured: boolean;
|
|
66
|
+
source: "tenant" | "env" | "none";
|
|
67
|
+
clientIdLast4?: string | undefined;
|
|
68
|
+
}, {
|
|
69
|
+
provider: string;
|
|
70
|
+
configured: boolean;
|
|
71
|
+
source: "tenant" | "env" | "none";
|
|
72
|
+
clientIdLast4?: string | undefined;
|
|
73
|
+
}>;
|
|
74
|
+
export type ConnectorAppCredentialDto = z.infer<typeof ConnectorAppCredentialDtoSchema>;
|
|
75
|
+
/** Body for PUT /admin/connector-apps/:provider — set the tenant's OAuth app creds. */
|
|
76
|
+
export declare const SetConnectorAppCredentialDtoSchema: z.ZodObject<{
|
|
77
|
+
clientId: z.ZodString;
|
|
78
|
+
clientSecret: z.ZodString;
|
|
79
|
+
}, "strip", z.ZodTypeAny, {
|
|
80
|
+
clientId: string;
|
|
81
|
+
clientSecret: string;
|
|
82
|
+
}, {
|
|
83
|
+
clientId: string;
|
|
84
|
+
clientSecret: string;
|
|
85
|
+
}>;
|
|
86
|
+
export type SetConnectorAppCredentialDto = z.infer<typeof SetConnectorAppCredentialDtoSchema>;
|
|
87
|
+
/** Result of a "test this provider key" call. */
|
|
88
|
+
export declare const ProviderTestResultDtoSchema: z.ZodObject<{
|
|
89
|
+
ok: z.ZodBoolean;
|
|
90
|
+
detail: z.ZodOptional<z.ZodString>;
|
|
91
|
+
}, "strip", z.ZodTypeAny, {
|
|
92
|
+
ok: boolean;
|
|
93
|
+
detail?: string | undefined;
|
|
94
|
+
}, {
|
|
95
|
+
ok: boolean;
|
|
96
|
+
detail?: string | undefined;
|
|
97
|
+
}>;
|
|
98
|
+
export type ProviderTestResultDto = z.infer<typeof ProviderTestResultDtoSchema>;
|
|
99
|
+
//# sourceMappingURL=admin.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"admin.d.ts","sourceRoot":"","sources":["../src/admin.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB;;;;GAIG;AAEH,uDAAuD;AACvD,eAAO,MAAM,iBAAiB,uHAU5B,CAAC;AACH,MAAM,MAAM,WAAW,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,iBAAiB,CAAC,CAAC;AAE5D,6FAA6F;AAC7F,eAAO,MAAM,uBAAuB;;;;;;;;;;;;;;;;;;;;;EAOlC,CAAC;AACH,MAAM,MAAM,iBAAiB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,uBAAuB,CAAC,CAAC;AAExE;;;;;;;;GAQG;AACH,eAAO,MAAM,0BAA0B;;;;;;;;;;;;EAIrC,CAAC;AACH,MAAM,MAAM,oBAAoB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,0BAA0B,CAAC,CAAC;AAE9E,iFAAiF;AACjF,eAAO,MAAM,+BAA+B;;;;;;;;;;;;;;;EAK1C,CAAC;AACH,MAAM,MAAM,yBAAyB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,+BAA+B,CAAC,CAAC;AAExF,uFAAuF;AACvF,eAAO,MAAM,kCAAkC;;;;;;;;;EAG7C,CAAC;AACH,MAAM,MAAM,4BAA4B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kCAAkC,CAAC,CAAC;AAE9F,iDAAiD;AACjD,eAAO,MAAM,2BAA2B;;;;;;;;;EAGtC,CAAC;AACH,MAAM,MAAM,qBAAqB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,2BAA2B,CAAC,CAAC"}
|
package/dist/admin.js
ADDED
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
/**
|
|
3
|
+
* Administration DTOs (ADR 0010) — admin-managed, per-tenant config that replaces `.env` for
|
|
4
|
+
* self-hosting clients. Secrets are WRITE-ONLY across the wire: set them with the `Set*` DTOs;
|
|
5
|
+
* read DTOs never carry the secret, only `configured` + a last-4 hint.
|
|
6
|
+
*/
|
|
7
|
+
/** Providers whose keys can be set in the admin UI. */
|
|
8
|
+
export const LlmProviderSchema = z.enum([
|
|
9
|
+
"openai",
|
|
10
|
+
"anthropic",
|
|
11
|
+
"mistral",
|
|
12
|
+
"google",
|
|
13
|
+
"openrouter",
|
|
14
|
+
"minimax",
|
|
15
|
+
"huggingface",
|
|
16
|
+
"ollama",
|
|
17
|
+
"lmstudio"
|
|
18
|
+
]);
|
|
19
|
+
/** Returned: what's configured, never the key. `source` says where the key resolves from. */
|
|
20
|
+
export const LlmProviderKeyDtoSchema = z.object({
|
|
21
|
+
provider: LlmProviderSchema,
|
|
22
|
+
configured: z.boolean(),
|
|
23
|
+
source: z.enum(["tenant", "env", "none"]),
|
|
24
|
+
last4: z.string().optional(),
|
|
25
|
+
baseUrl: z.string().optional(),
|
|
26
|
+
defaultModel: z.string().optional()
|
|
27
|
+
});
|
|
28
|
+
/**
|
|
29
|
+
* Body for PUT /admin/llm-providers/:provider — set/replace the tenant's key.
|
|
30
|
+
*
|
|
31
|
+
* `apiKey` is OPTIONAL because the local providers in {@link LlmProviderSchema} (`ollama`,
|
|
32
|
+
* `lmstudio`) are KEYLESS: they are reached over a `baseUrl` with no credential, so requiring a key
|
|
33
|
+
* made them impossible to configure at all. It keeps `.min(1)` when present, so a cloud provider can
|
|
34
|
+
* still never store an empty secret. "Required unless the provider is local" is enforced by the API,
|
|
35
|
+
* which knows which provider the route targets — the schema does not.
|
|
36
|
+
*/
|
|
37
|
+
export const SetLlmProviderKeyDtoSchema = z.object({
|
|
38
|
+
apiKey: z.string().min(1).optional(),
|
|
39
|
+
baseUrl: z.string().optional(),
|
|
40
|
+
defaultModel: z.string().optional()
|
|
41
|
+
});
|
|
42
|
+
/** Connector OAuth *app* credential — what's configured (no secret returned). */
|
|
43
|
+
export const ConnectorAppCredentialDtoSchema = z.object({
|
|
44
|
+
provider: z.string(),
|
|
45
|
+
configured: z.boolean(),
|
|
46
|
+
source: z.enum(["tenant", "env", "none"]),
|
|
47
|
+
clientIdLast4: z.string().optional()
|
|
48
|
+
});
|
|
49
|
+
/** Body for PUT /admin/connector-apps/:provider — set the tenant's OAuth app creds. */
|
|
50
|
+
export const SetConnectorAppCredentialDtoSchema = z.object({
|
|
51
|
+
clientId: z.string().min(1),
|
|
52
|
+
clientSecret: z.string().min(1)
|
|
53
|
+
});
|
|
54
|
+
/** Result of a "test this provider key" call. */
|
|
55
|
+
export const ProviderTestResultDtoSchema = z.object({
|
|
56
|
+
ok: z.boolean(),
|
|
57
|
+
detail: z.string().optional()
|
|
58
|
+
});
|
|
59
|
+
//# sourceMappingURL=admin.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"admin.js","sourceRoot":"","sources":["../src/admin.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB;;;;GAIG;AAEH,uDAAuD;AACvD,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAC,CAAC,IAAI,CAAC;IACtC,QAAQ;IACR,WAAW;IACX,SAAS;IACT,QAAQ;IACR,YAAY;IACZ,SAAS;IACT,aAAa;IACb,QAAQ;IACR,UAAU;CACX,CAAC,CAAC;AAGH,6FAA6F;AAC7F,MAAM,CAAC,MAAM,uBAAuB,GAAG,CAAC,CAAC,MAAM,CAAC;IAC9C,QAAQ,EAAE,iBAAiB;IAC3B,UAAU,EAAE,CAAC,CAAC,OAAO,EAAE;IACvB,MAAM,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,QAAQ,EAAE,KAAK,EAAE,MAAM,CAAC,CAAC;IACzC,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAC5B,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAC9B,YAAY,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QA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@ -0,0 +1,42 @@
|
|
|
1
|
+
import { describe, expect, it } from "vitest";
|
|
2
|
+
import { LlmProviderSchema, SetLlmProviderKeyDtoSchema } from "./admin.js";
|
|
3
|
+
describe("LlmProviderSchema", () => {
|
|
4
|
+
it("includes the keyless local providers", () => {
|
|
5
|
+
expect(() => LlmProviderSchema.parse("ollama")).not.toThrow();
|
|
6
|
+
expect(() => LlmProviderSchema.parse("lmstudio")).not.toThrow();
|
|
7
|
+
});
|
|
8
|
+
it("rejects an unknown provider", () => {
|
|
9
|
+
expect(() => LlmProviderSchema.parse("not-a-provider")).toThrow();
|
|
10
|
+
});
|
|
11
|
+
});
|
|
12
|
+
describe("SetLlmProviderKeyDtoSchema — keyless local providers", () => {
|
|
13
|
+
it("accepts a body with only a baseUrl (the Ollama case)", () => {
|
|
14
|
+
// A local server needs no credential; requiring apiKey made `ollama` impossible to configure.
|
|
15
|
+
expect(() => SetLlmProviderKeyDtoSchema.parse({ baseUrl: "http://127.0.0.1:11434/v1" })).not.toThrow();
|
|
16
|
+
});
|
|
17
|
+
it("accepts a baseUrl plus a default model", () => {
|
|
18
|
+
expect(() => SetLlmProviderKeyDtoSchema.parse({
|
|
19
|
+
baseUrl: "http://127.0.0.1:11434/v1",
|
|
20
|
+
defaultModel: "llama3.1"
|
|
21
|
+
})).not.toThrow();
|
|
22
|
+
});
|
|
23
|
+
it("still rejects an EMPTY apiKey when one is supplied", () => {
|
|
24
|
+
// Optional must not become "anything goes": a cloud provider can never store an empty secret.
|
|
25
|
+
expect(() => SetLlmProviderKeyDtoSchema.parse({ apiKey: "" })).toThrow();
|
|
26
|
+
expect(() => SetLlmProviderKeyDtoSchema.parse({ apiKey: "", baseUrl: "https://api.openai.com/v1" })).toThrow();
|
|
27
|
+
});
|
|
28
|
+
it("still accepts the cloud-provider shape it always accepted", () => {
|
|
29
|
+
const parsed = SetLlmProviderKeyDtoSchema.parse({
|
|
30
|
+
apiKey: "sk-live-secret",
|
|
31
|
+
baseUrl: "https://openrouter.ai/api/v1",
|
|
32
|
+
defaultModel: "anthropic/claude-3.5-sonnet"
|
|
33
|
+
});
|
|
34
|
+
expect(parsed.apiKey).toBe("sk-live-secret");
|
|
35
|
+
expect(parsed.baseUrl).toBe("https://openrouter.ai/api/v1");
|
|
36
|
+
});
|
|
37
|
+
it("leaves apiKey undefined rather than defaulting it", () => {
|
|
38
|
+
const parsed = SetLlmProviderKeyDtoSchema.parse({ baseUrl: "http://127.0.0.1:11434/v1" });
|
|
39
|
+
expect(parsed.apiKey).toBeUndefined();
|
|
40
|
+
});
|
|
41
|
+
});
|
|
42
|
+
//# sourceMappingURL=admin.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"admin.test.js","sourceRoot":"","sources":["../src/admin.test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,QAAQ,CAAC;AAE9C,OAAO,EAAE,iBAAiB,EAAE,0BAA0B,EAAE,MAAM,YAAY,CAAC;AAE3E,QAAQ,CAAC,mBAAmB,EAAE,GAAG,EAAE;IACjC,EAAE,CAAC,sCAAsC,EAAE,GAAG,EAAE;QAC9C,MAAM,CAAC,GAAG,EAAE,CAAC,iBAAiB,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,EAAE,CAAC;QAC9D,MAAM,CAAC,GAAG,EAAE,CAAC,iBAAiB,CAAC,KAAK,CAAC,UAAU,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,EAAE,CAAC;IAClE,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,6BAA6B,EAAE,GAAG,EAAE;QACrC,MAAM,CAAC,GAAG,EAAE,CAAC,iBAAiB,CAAC,KAAK,CAAC,gBAAgB,CAAC,CAAC,CAAC,OAAO,EAAE,CAAC;IACpE,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC;AAEH,QAAQ,CAAC,sDAAsD,EAAE,GAAG,EA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,mDAAmD,EAAE,GAAG,EAAE;QAC3D,MAAM,MAAM,GAAG,0BAA0B,CAAC,KAAK,CAAC,EAAE,OAAO,EAAE,2BAA2B,EAAE,CAAC,CAAC;QAC1F,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,aAAa,EAAE,CAAC;IACxC,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
export declare const ApprovalDtoSchema: z.ZodObject<{
|
|
3
|
+
id: z.ZodString;
|
|
4
|
+
runId: z.ZodString;
|
|
5
|
+
nodeId: z.ZodString;
|
|
6
|
+
requestedBy: z.ZodString;
|
|
7
|
+
/** Human-readable subject (e.g. `tool:refund`). */
|
|
8
|
+
subject: z.ZodString;
|
|
9
|
+
status: z.ZodEnum<["pending", "approved", "rejected"]>;
|
|
10
|
+
resolvedBy: z.ZodOptional<z.ZodString>;
|
|
11
|
+
reason: z.ZodOptional<z.ZodString>;
|
|
12
|
+
/** Owning tenant (tenancy). Optional for pre-tenancy rows backfilled to `default`. */
|
|
13
|
+
tenantId: z.ZodOptional<z.ZodString>;
|
|
14
|
+
requestedAt: z.ZodString;
|
|
15
|
+
decidedAt: z.ZodOptional<z.ZodString>;
|
|
16
|
+
}, "strip", z.ZodTypeAny, {
|
|
17
|
+
status: "pending" | "approved" | "rejected";
|
|
18
|
+
id: string;
|
|
19
|
+
runId: string;
|
|
20
|
+
nodeId: string;
|
|
21
|
+
requestedBy: string;
|
|
22
|
+
subject: string;
|
|
23
|
+
requestedAt: string;
|
|
24
|
+
resolvedBy?: string | undefined;
|
|
25
|
+
reason?: string | undefined;
|
|
26
|
+
tenantId?: string | undefined;
|
|
27
|
+
decidedAt?: string | undefined;
|
|
28
|
+
}, {
|
|
29
|
+
status: "pending" | "approved" | "rejected";
|
|
30
|
+
id: string;
|
|
31
|
+
runId: string;
|
|
32
|
+
nodeId: string;
|
|
33
|
+
requestedBy: string;
|
|
34
|
+
subject: string;
|
|
35
|
+
requestedAt: string;
|
|
36
|
+
resolvedBy?: string | undefined;
|
|
37
|
+
reason?: string | undefined;
|
|
38
|
+
tenantId?: string | undefined;
|
|
39
|
+
decidedAt?: string | undefined;
|
|
40
|
+
}>;
|
|
41
|
+
export type ApprovalDto = z.infer<typeof ApprovalDtoSchema>;
|
|
42
|
+
/**
|
|
43
|
+
* BREAKING (tenancy/auth): `resolvedBy` is no longer accepted in the request body. The
|
|
44
|
+
* server derives the resolver from the authenticated principal (`@CurrentUser().id`) so
|
|
45
|
+
* a caller can NOT forge who approved/rejected a gate (which would also defeat the
|
|
46
|
+
* no-self-approval invariant). Approve carries no body; reject carries only `reason`.
|
|
47
|
+
*/
|
|
48
|
+
export declare const ApproveApprovalDtoSchema: z.ZodObject<{}, "strict", z.ZodTypeAny, {}, {}>;
|
|
49
|
+
export declare const RejectApprovalDtoSchema: z.ZodObject<{
|
|
50
|
+
reason: z.ZodString;
|
|
51
|
+
}, "strip", z.ZodTypeAny, {
|
|
52
|
+
reason: string;
|
|
53
|
+
}, {
|
|
54
|
+
reason: string;
|
|
55
|
+
}>;
|
|
56
|
+
export type ApproveApprovalDto = z.infer<typeof ApproveApprovalDtoSchema>;
|
|
57
|
+
export type RejectApprovalDto = z.infer<typeof RejectApprovalDtoSchema>;
|
|
58
|
+
//# sourceMappingURL=approvals.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"approvals.d.ts","sourceRoot":"","sources":["../src/approvals.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAIxB,eAAO,MAAM,iBAAiB;;;;;IAK5B,mDAAmD;;;;;IAKnD,sFAAsF;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAItF,CAAC;AAEH,MAAM,MAAM,WAAW,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,iBAAiB,CAAC,CAAC;AAE5D;;;;;GAKG;AACH,eAAO,MAAM,wBAAwB,iDAAwB,CAAC;AAE9D,eAAO,MAAM,uBAAuB;;;;;;EAElC,CAAC;AAEH,MAAM,MAAM,kBAAkB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,wBAAwB,CAAC,CAAC;AAC1E,MAAM,MAAM,iBAAiB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,uBAAuB,CAAC,CAAC"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
const ApprovalStatusSchema = z.enum(["pending", "approved", "rejected"]);
|
|
3
|
+
export const ApprovalDtoSchema = z.object({
|
|
4
|
+
id: z.string().min(1),
|
|
5
|
+
runId: z.string().min(1),
|
|
6
|
+
nodeId: z.string().min(1),
|
|
7
|
+
requestedBy: z.string().min(1),
|
|
8
|
+
/** Human-readable subject (e.g. `tool:refund`). */
|
|
9
|
+
subject: z.string().min(1),
|
|
10
|
+
status: ApprovalStatusSchema,
|
|
11
|
+
resolvedBy: z.string().min(1).optional(),
|
|
12
|
+
reason: z.string().min(1).optional(),
|
|
13
|
+
/** Owning tenant (tenancy). Optional for pre-tenancy rows backfilled to `default`. */
|
|
14
|
+
tenantId: z.string().min(1).optional(),
|
|
15
|
+
requestedAt: z.string().datetime(),
|
|
16
|
+
decidedAt: z.string().datetime().optional()
|
|
17
|
+
});
|
|
18
|
+
/**
|
|
19
|
+
* BREAKING (tenancy/auth): `resolvedBy` is no longer accepted in the request body. The
|
|
20
|
+
* server derives the resolver from the authenticated principal (`@CurrentUser().id`) so
|
|
21
|
+
* a caller can NOT forge who approved/rejected a gate (which would also defeat the
|
|
22
|
+
* no-self-approval invariant). Approve carries no body; reject carries only `reason`.
|
|
23
|
+
*/
|
|
24
|
+
export const ApproveApprovalDtoSchema = z.object({}).strict();
|
|
25
|
+
export const RejectApprovalDtoSchema = z.object({
|
|
26
|
+
reason: z.string().min(1)
|
|
27
|
+
});
|
|
28
|
+
//# sourceMappingURL=approvals.js.map
|
|
@@ -0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CAAC,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC;AAE9D,MAAM,CAAC,MAAM,uBAAuB,GAAG,CAAC,CAAC,MAAM,CAAC;IAC9C,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;CAC1B,CAAC,CAAC"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
export declare const ArtifactDtoSchema: z.ZodObject<{
|
|
3
|
+
runId: z.ZodString;
|
|
4
|
+
name: z.ZodString;
|
|
5
|
+
contentType: z.ZodString;
|
|
6
|
+
content: z.ZodUnknown;
|
|
7
|
+
createdAt: z.ZodString;
|
|
8
|
+
}, "strip", z.ZodTypeAny, {
|
|
9
|
+
runId: string;
|
|
10
|
+
name: string;
|
|
11
|
+
contentType: string;
|
|
12
|
+
createdAt: string;
|
|
13
|
+
content?: unknown;
|
|
14
|
+
}, {
|
|
15
|
+
runId: string;
|
|
16
|
+
name: string;
|
|
17
|
+
contentType: string;
|
|
18
|
+
createdAt: string;
|
|
19
|
+
content?: unknown;
|
|
20
|
+
}>;
|
|
21
|
+
export type ArtifactDto = z.infer<typeof ArtifactDtoSchema>;
|
|
22
|
+
//# sourceMappingURL=artifacts.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"artifacts.d.ts","sourceRoot":"","sources":["../src/artifacts.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;;;;EAM5B,CAAC;AAEH,MAAM,MAAM,WAAW,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,iBAAiB,CAAC,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
export const ArtifactDtoSchema = z.object({
|
|
3
|
+
runId: z.string().min(1),
|
|
4
|
+
name: z.string().min(1),
|
|
5
|
+
contentType: z.string().min(1),
|
|
6
|
+
content: z.unknown(),
|
|
7
|
+
createdAt: z.string().datetime()
|
|
8
|
+
});
|
|
9
|
+
//# sourceMappingURL=artifacts.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"artifacts.js","sourceRoot":"","sources":["../src/artifacts.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAC,CAAC,MAAM,CAAC;IACxC,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;IACxB,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;IACvB,WAAW,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;IAC9B,OAAO,EAAE,CAAC,CAAC,OAAO,EAAE;IACpB,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;CACjC,CAAC,CAAC"}
|