@nebutra/contracts 0.1.1 → 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/.turbo/turbo-build.log +16 -6
- package/.turbo/turbo-test.log +15 -0
- package/.turbo/turbo-typecheck.log +1 -1
- package/CHANGELOG.md +31 -0
- package/LICENSE +21 -676
- package/dist/admin.d.ts +416 -0
- package/dist/admin.js +51 -0
- package/dist/admin.js.map +1 -0
- package/dist/chunk-ERZTZ3PW.js +257 -0
- package/dist/chunk-ERZTZ3PW.js.map +1 -0
- package/dist/chunk-PU65L2HQ.js +218 -0
- package/dist/chunk-PU65L2HQ.js.map +1 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +107 -1
- package/dist/notifications.d.ts +1 -1
- package/dist/sleptons.d.ts +510 -0
- package/dist/sleptons.js +61 -0
- package/dist/sleptons.js.map +1 -0
- package/package.json +18 -3
- package/src/__tests__/admin.test.ts +120 -0
- package/src/admin.ts +297 -0
- package/src/index.ts +2 -0
- package/src/sleptons.test.ts +62 -0
- package/src/sleptons.ts +242 -0
- package/tsup.config.ts +2 -0
- package/vitest.config.ts +10 -0
package/dist/admin.d.ts
ADDED
|
@@ -0,0 +1,416 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Admin Contract — `nebutra.admin/v1`.
|
|
5
|
+
*
|
|
6
|
+
* Every Nebutra SaaS exposes one manifest describing the admin surface it
|
|
7
|
+
* owns: resources (nouns), actions (audited verbs, plan → apply), signals
|
|
8
|
+
* (probed facts) and policies (actions the system runs by itself). The
|
|
9
|
+
* platform admin renders any product from its manifest; an agent derives
|
|
10
|
+
* tools from it. Nothing product-specific lives in the renderer.
|
|
11
|
+
*
|
|
12
|
+
* See docs/plans/2026-09-08-admin-of-admins-model.md.
|
|
13
|
+
*/
|
|
14
|
+
declare const ADMIN_CONTRACT_VERSION: "nebutra.admin/v1";
|
|
15
|
+
/** One status vocabulary. `unknown` is first-class and never renders green. */
|
|
16
|
+
declare const AdminStatusSchema: z.ZodEnum<{
|
|
17
|
+
healthy: "healthy";
|
|
18
|
+
degraded: "degraded";
|
|
19
|
+
down: "down";
|
|
20
|
+
unknown: "unknown";
|
|
21
|
+
}>;
|
|
22
|
+
type AdminStatus = z.infer<typeof AdminStatusSchema>;
|
|
23
|
+
/** One role ladder; product roles map onto it, staff grants mean the same everywhere. */
|
|
24
|
+
declare const StaffRoleSchema: z.ZodEnum<{
|
|
25
|
+
platform_readonly: "platform_readonly";
|
|
26
|
+
platform_support: "platform_support";
|
|
27
|
+
platform_operator: "platform_operator";
|
|
28
|
+
platform_owner: "platform_owner";
|
|
29
|
+
}>;
|
|
30
|
+
type StaffRole = z.infer<typeof StaffRoleSchema>;
|
|
31
|
+
declare const STAFF_ROLE_RANK: Record<StaffRole, number>;
|
|
32
|
+
declare function roleAtLeast(role: StaffRole, required: StaffRole): boolean;
|
|
33
|
+
declare const AdminSeveritySchema: z.ZodEnum<{
|
|
34
|
+
info: "info";
|
|
35
|
+
warn: "warn";
|
|
36
|
+
critical: "critical";
|
|
37
|
+
}>;
|
|
38
|
+
type AdminSeverity = z.infer<typeof AdminSeveritySchema>;
|
|
39
|
+
/** The canonical eleven. A product declares the subset it has. */
|
|
40
|
+
declare const AdminDomainIdSchema: z.ZodEnum<{
|
|
41
|
+
identity: "identity";
|
|
42
|
+
access: "access";
|
|
43
|
+
commerce: "commerce";
|
|
44
|
+
usage: "usage";
|
|
45
|
+
catalog: "catalog";
|
|
46
|
+
operations: "operations";
|
|
47
|
+
integrations: "integrations";
|
|
48
|
+
trust: "trust";
|
|
49
|
+
support: "support";
|
|
50
|
+
growth: "growth";
|
|
51
|
+
settings: "settings";
|
|
52
|
+
supply: "supply";
|
|
53
|
+
}>;
|
|
54
|
+
type AdminDomainId = z.infer<typeof AdminDomainIdSchema>;
|
|
55
|
+
declare const AdminColumnSchema: z.ZodObject<{
|
|
56
|
+
key: z.ZodString;
|
|
57
|
+
label: z.ZodString;
|
|
58
|
+
kind: z.ZodDefault<z.ZodEnum<{
|
|
59
|
+
number: "number";
|
|
60
|
+
text: "text";
|
|
61
|
+
mono: "mono";
|
|
62
|
+
status: "status";
|
|
63
|
+
badge: "badge";
|
|
64
|
+
time: "time";
|
|
65
|
+
link: "link";
|
|
66
|
+
}>>;
|
|
67
|
+
align: z.ZodDefault<z.ZodEnum<{
|
|
68
|
+
start: "start";
|
|
69
|
+
end: "end";
|
|
70
|
+
}>>;
|
|
71
|
+
}, z.core.$strip>;
|
|
72
|
+
type AdminColumn = z.infer<typeof AdminColumnSchema>;
|
|
73
|
+
declare const AdminResourceSchema: z.ZodObject<{
|
|
74
|
+
id: z.ZodString;
|
|
75
|
+
label: z.ZodString;
|
|
76
|
+
list: z.ZodString;
|
|
77
|
+
detail: z.ZodOptional<z.ZodString>;
|
|
78
|
+
columns: z.ZodArray<z.ZodObject<{
|
|
79
|
+
key: z.ZodString;
|
|
80
|
+
label: z.ZodString;
|
|
81
|
+
kind: z.ZodDefault<z.ZodEnum<{
|
|
82
|
+
number: "number";
|
|
83
|
+
text: "text";
|
|
84
|
+
mono: "mono";
|
|
85
|
+
status: "status";
|
|
86
|
+
badge: "badge";
|
|
87
|
+
time: "time";
|
|
88
|
+
link: "link";
|
|
89
|
+
}>>;
|
|
90
|
+
align: z.ZodDefault<z.ZodEnum<{
|
|
91
|
+
start: "start";
|
|
92
|
+
end: "end";
|
|
93
|
+
}>>;
|
|
94
|
+
}, z.core.$strip>>;
|
|
95
|
+
key: z.ZodDefault<z.ZodString>;
|
|
96
|
+
search: z.ZodDefault<z.ZodBoolean>;
|
|
97
|
+
actions: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
98
|
+
}, z.core.$strip>;
|
|
99
|
+
type AdminResource = z.infer<typeof AdminResourceSchema>;
|
|
100
|
+
declare const AdminActionSchema: z.ZodObject<{
|
|
101
|
+
id: z.ZodString;
|
|
102
|
+
verb: z.ZodString;
|
|
103
|
+
resource: z.ZodOptional<z.ZodString>;
|
|
104
|
+
role: z.ZodEnum<{
|
|
105
|
+
platform_readonly: "platform_readonly";
|
|
106
|
+
platform_support: "platform_support";
|
|
107
|
+
platform_operator: "platform_operator";
|
|
108
|
+
platform_owner: "platform_owner";
|
|
109
|
+
}>;
|
|
110
|
+
url: z.ZodString;
|
|
111
|
+
plan: z.ZodDefault<z.ZodBoolean>;
|
|
112
|
+
destructive: z.ZodDefault<z.ZodBoolean>;
|
|
113
|
+
input: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
114
|
+
description: z.ZodOptional<z.ZodString>;
|
|
115
|
+
}, z.core.$strip>;
|
|
116
|
+
type AdminAction = z.infer<typeof AdminActionSchema>;
|
|
117
|
+
declare const AdminSignalSchema: z.ZodObject<{
|
|
118
|
+
id: z.ZodString;
|
|
119
|
+
label: z.ZodString;
|
|
120
|
+
severity: z.ZodEnum<{
|
|
121
|
+
info: "info";
|
|
122
|
+
warn: "warn";
|
|
123
|
+
critical: "critical";
|
|
124
|
+
}>;
|
|
125
|
+
probe: z.ZodString;
|
|
126
|
+
resource: z.ZodOptional<z.ZodString>;
|
|
127
|
+
action: z.ZodOptional<z.ZodString>;
|
|
128
|
+
}, z.core.$strip>;
|
|
129
|
+
type AdminSignal = z.infer<typeof AdminSignalSchema>;
|
|
130
|
+
declare const AdminPolicySchema: z.ZodObject<{
|
|
131
|
+
id: z.ZodString;
|
|
132
|
+
label: z.ZodString;
|
|
133
|
+
on: z.ZodString;
|
|
134
|
+
runs: z.ZodString;
|
|
135
|
+
enabled: z.ZodDefault<z.ZodBoolean>;
|
|
136
|
+
intent: z.ZodOptional<z.ZodString>;
|
|
137
|
+
}, z.core.$strip>;
|
|
138
|
+
type AdminPolicy = z.infer<typeof AdminPolicySchema>;
|
|
139
|
+
declare const AdminDomainSchema: z.ZodObject<{
|
|
140
|
+
id: z.ZodEnum<{
|
|
141
|
+
identity: "identity";
|
|
142
|
+
access: "access";
|
|
143
|
+
commerce: "commerce";
|
|
144
|
+
usage: "usage";
|
|
145
|
+
catalog: "catalog";
|
|
146
|
+
operations: "operations";
|
|
147
|
+
integrations: "integrations";
|
|
148
|
+
trust: "trust";
|
|
149
|
+
support: "support";
|
|
150
|
+
growth: "growth";
|
|
151
|
+
settings: "settings";
|
|
152
|
+
supply: "supply";
|
|
153
|
+
}>;
|
|
154
|
+
label: z.ZodString;
|
|
155
|
+
resources: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
156
|
+
id: z.ZodString;
|
|
157
|
+
label: z.ZodString;
|
|
158
|
+
list: z.ZodString;
|
|
159
|
+
detail: z.ZodOptional<z.ZodString>;
|
|
160
|
+
columns: z.ZodArray<z.ZodObject<{
|
|
161
|
+
key: z.ZodString;
|
|
162
|
+
label: z.ZodString;
|
|
163
|
+
kind: z.ZodDefault<z.ZodEnum<{
|
|
164
|
+
number: "number";
|
|
165
|
+
text: "text";
|
|
166
|
+
mono: "mono";
|
|
167
|
+
status: "status";
|
|
168
|
+
badge: "badge";
|
|
169
|
+
time: "time";
|
|
170
|
+
link: "link";
|
|
171
|
+
}>>;
|
|
172
|
+
align: z.ZodDefault<z.ZodEnum<{
|
|
173
|
+
start: "start";
|
|
174
|
+
end: "end";
|
|
175
|
+
}>>;
|
|
176
|
+
}, z.core.$strip>>;
|
|
177
|
+
key: z.ZodDefault<z.ZodString>;
|
|
178
|
+
search: z.ZodDefault<z.ZodBoolean>;
|
|
179
|
+
actions: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
180
|
+
}, z.core.$strip>>>;
|
|
181
|
+
actions: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
182
|
+
id: z.ZodString;
|
|
183
|
+
verb: z.ZodString;
|
|
184
|
+
resource: z.ZodOptional<z.ZodString>;
|
|
185
|
+
role: z.ZodEnum<{
|
|
186
|
+
platform_readonly: "platform_readonly";
|
|
187
|
+
platform_support: "platform_support";
|
|
188
|
+
platform_operator: "platform_operator";
|
|
189
|
+
platform_owner: "platform_owner";
|
|
190
|
+
}>;
|
|
191
|
+
url: z.ZodString;
|
|
192
|
+
plan: z.ZodDefault<z.ZodBoolean>;
|
|
193
|
+
destructive: z.ZodDefault<z.ZodBoolean>;
|
|
194
|
+
input: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
195
|
+
description: z.ZodOptional<z.ZodString>;
|
|
196
|
+
}, z.core.$strip>>>;
|
|
197
|
+
signals: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
198
|
+
id: z.ZodString;
|
|
199
|
+
label: z.ZodString;
|
|
200
|
+
severity: z.ZodEnum<{
|
|
201
|
+
info: "info";
|
|
202
|
+
warn: "warn";
|
|
203
|
+
critical: "critical";
|
|
204
|
+
}>;
|
|
205
|
+
probe: z.ZodString;
|
|
206
|
+
resource: z.ZodOptional<z.ZodString>;
|
|
207
|
+
action: z.ZodOptional<z.ZodString>;
|
|
208
|
+
}, z.core.$strip>>>;
|
|
209
|
+
policies: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
210
|
+
id: z.ZodString;
|
|
211
|
+
label: z.ZodString;
|
|
212
|
+
on: z.ZodString;
|
|
213
|
+
runs: z.ZodString;
|
|
214
|
+
enabled: z.ZodDefault<z.ZodBoolean>;
|
|
215
|
+
intent: z.ZodOptional<z.ZodString>;
|
|
216
|
+
}, z.core.$strip>>>;
|
|
217
|
+
slot: z.ZodOptional<z.ZodString>;
|
|
218
|
+
}, z.core.$strip>;
|
|
219
|
+
type AdminDomain = z.infer<typeof AdminDomainSchema>;
|
|
220
|
+
declare const AdminManifestSchema: z.ZodObject<{
|
|
221
|
+
contract: z.ZodLiteral<"nebutra.admin/v1">;
|
|
222
|
+
product: z.ZodString;
|
|
223
|
+
label: z.ZodString;
|
|
224
|
+
version: z.ZodString;
|
|
225
|
+
origin: z.ZodString;
|
|
226
|
+
graph: z.ZodEnum<{
|
|
227
|
+
core: "core";
|
|
228
|
+
runtime: "runtime";
|
|
229
|
+
labs: "labs";
|
|
230
|
+
}>;
|
|
231
|
+
status: z.ZodEnum<{
|
|
232
|
+
stable: "stable";
|
|
233
|
+
foundation: "foundation";
|
|
234
|
+
wip: "wip";
|
|
235
|
+
experimental: "experimental";
|
|
236
|
+
}>;
|
|
237
|
+
health: z.ZodString;
|
|
238
|
+
audit: z.ZodOptional<z.ZodString>;
|
|
239
|
+
domains: z.ZodArray<z.ZodObject<{
|
|
240
|
+
id: z.ZodEnum<{
|
|
241
|
+
identity: "identity";
|
|
242
|
+
access: "access";
|
|
243
|
+
commerce: "commerce";
|
|
244
|
+
usage: "usage";
|
|
245
|
+
catalog: "catalog";
|
|
246
|
+
operations: "operations";
|
|
247
|
+
integrations: "integrations";
|
|
248
|
+
trust: "trust";
|
|
249
|
+
support: "support";
|
|
250
|
+
growth: "growth";
|
|
251
|
+
settings: "settings";
|
|
252
|
+
supply: "supply";
|
|
253
|
+
}>;
|
|
254
|
+
label: z.ZodString;
|
|
255
|
+
resources: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
256
|
+
id: z.ZodString;
|
|
257
|
+
label: z.ZodString;
|
|
258
|
+
list: z.ZodString;
|
|
259
|
+
detail: z.ZodOptional<z.ZodString>;
|
|
260
|
+
columns: z.ZodArray<z.ZodObject<{
|
|
261
|
+
key: z.ZodString;
|
|
262
|
+
label: z.ZodString;
|
|
263
|
+
kind: z.ZodDefault<z.ZodEnum<{
|
|
264
|
+
number: "number";
|
|
265
|
+
text: "text";
|
|
266
|
+
mono: "mono";
|
|
267
|
+
status: "status";
|
|
268
|
+
badge: "badge";
|
|
269
|
+
time: "time";
|
|
270
|
+
link: "link";
|
|
271
|
+
}>>;
|
|
272
|
+
align: z.ZodDefault<z.ZodEnum<{
|
|
273
|
+
start: "start";
|
|
274
|
+
end: "end";
|
|
275
|
+
}>>;
|
|
276
|
+
}, z.core.$strip>>;
|
|
277
|
+
key: z.ZodDefault<z.ZodString>;
|
|
278
|
+
search: z.ZodDefault<z.ZodBoolean>;
|
|
279
|
+
actions: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
280
|
+
}, z.core.$strip>>>;
|
|
281
|
+
actions: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
282
|
+
id: z.ZodString;
|
|
283
|
+
verb: z.ZodString;
|
|
284
|
+
resource: z.ZodOptional<z.ZodString>;
|
|
285
|
+
role: z.ZodEnum<{
|
|
286
|
+
platform_readonly: "platform_readonly";
|
|
287
|
+
platform_support: "platform_support";
|
|
288
|
+
platform_operator: "platform_operator";
|
|
289
|
+
platform_owner: "platform_owner";
|
|
290
|
+
}>;
|
|
291
|
+
url: z.ZodString;
|
|
292
|
+
plan: z.ZodDefault<z.ZodBoolean>;
|
|
293
|
+
destructive: z.ZodDefault<z.ZodBoolean>;
|
|
294
|
+
input: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
295
|
+
description: z.ZodOptional<z.ZodString>;
|
|
296
|
+
}, z.core.$strip>>>;
|
|
297
|
+
signals: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
298
|
+
id: z.ZodString;
|
|
299
|
+
label: z.ZodString;
|
|
300
|
+
severity: z.ZodEnum<{
|
|
301
|
+
info: "info";
|
|
302
|
+
warn: "warn";
|
|
303
|
+
critical: "critical";
|
|
304
|
+
}>;
|
|
305
|
+
probe: z.ZodString;
|
|
306
|
+
resource: z.ZodOptional<z.ZodString>;
|
|
307
|
+
action: z.ZodOptional<z.ZodString>;
|
|
308
|
+
}, z.core.$strip>>>;
|
|
309
|
+
policies: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
310
|
+
id: z.ZodString;
|
|
311
|
+
label: z.ZodString;
|
|
312
|
+
on: z.ZodString;
|
|
313
|
+
runs: z.ZodString;
|
|
314
|
+
enabled: z.ZodDefault<z.ZodBoolean>;
|
|
315
|
+
intent: z.ZodOptional<z.ZodString>;
|
|
316
|
+
}, z.core.$strip>>>;
|
|
317
|
+
slot: z.ZodOptional<z.ZodString>;
|
|
318
|
+
}, z.core.$strip>>;
|
|
319
|
+
}, z.core.$strip>;
|
|
320
|
+
type AdminManifest = z.infer<typeof AdminManifestSchema>;
|
|
321
|
+
declare const ResourceListSchema: z.ZodObject<{
|
|
322
|
+
items: z.ZodArray<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
323
|
+
total: z.ZodNumber;
|
|
324
|
+
probedAt: z.ZodOptional<z.ZodString>;
|
|
325
|
+
}, z.core.$strip>;
|
|
326
|
+
type ResourceList = z.infer<typeof ResourceListSchema>;
|
|
327
|
+
declare const ActionRequestSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
328
|
+
mode: z.ZodLiteral<"plan">;
|
|
329
|
+
input: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
330
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
331
|
+
mode: z.ZodLiteral<"apply">;
|
|
332
|
+
input: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
333
|
+
planId: z.ZodOptional<z.ZodString>;
|
|
334
|
+
}, z.core.$strip>], "mode">;
|
|
335
|
+
type ActionRequest = z.infer<typeof ActionRequestSchema>;
|
|
336
|
+
declare const PlanDiffEntrySchema: z.ZodObject<{
|
|
337
|
+
op: z.ZodEnum<{
|
|
338
|
+
add: "add";
|
|
339
|
+
remove: "remove";
|
|
340
|
+
change: "change";
|
|
341
|
+
}>;
|
|
342
|
+
path: z.ZodString;
|
|
343
|
+
from: z.ZodOptional<z.ZodUnknown>;
|
|
344
|
+
to: z.ZodOptional<z.ZodUnknown>;
|
|
345
|
+
}, z.core.$strip>;
|
|
346
|
+
declare const ActionPlanSchema: z.ZodObject<{
|
|
347
|
+
planId: z.ZodString;
|
|
348
|
+
summary: z.ZodString;
|
|
349
|
+
diff: z.ZodArray<z.ZodObject<{
|
|
350
|
+
op: z.ZodEnum<{
|
|
351
|
+
add: "add";
|
|
352
|
+
remove: "remove";
|
|
353
|
+
change: "change";
|
|
354
|
+
}>;
|
|
355
|
+
path: z.ZodString;
|
|
356
|
+
from: z.ZodOptional<z.ZodUnknown>;
|
|
357
|
+
to: z.ZodOptional<z.ZodUnknown>;
|
|
358
|
+
}, z.core.$strip>>;
|
|
359
|
+
affected: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
360
|
+
resource: z.ZodString;
|
|
361
|
+
id: z.ZodString;
|
|
362
|
+
label: z.ZodOptional<z.ZodString>;
|
|
363
|
+
}, z.core.$strip>>>;
|
|
364
|
+
warnings: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
365
|
+
expiresAt: z.ZodString;
|
|
366
|
+
}, z.core.$strip>;
|
|
367
|
+
type ActionPlan = z.infer<typeof ActionPlanSchema>;
|
|
368
|
+
declare const ActionResultSchema: z.ZodObject<{
|
|
369
|
+
auditId: z.ZodString;
|
|
370
|
+
summary: z.ZodString;
|
|
371
|
+
result: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
372
|
+
}, z.core.$strip>;
|
|
373
|
+
type ActionResult = z.infer<typeof ActionResultSchema>;
|
|
374
|
+
declare const SignalReadingSchema: z.ZodObject<{
|
|
375
|
+
id: z.ZodString;
|
|
376
|
+
status: z.ZodEnum<{
|
|
377
|
+
unknown: "unknown";
|
|
378
|
+
ok: "ok";
|
|
379
|
+
raised: "raised";
|
|
380
|
+
}>;
|
|
381
|
+
severity: z.ZodEnum<{
|
|
382
|
+
info: "info";
|
|
383
|
+
warn: "warn";
|
|
384
|
+
critical: "critical";
|
|
385
|
+
}>;
|
|
386
|
+
probedAt: z.ZodString;
|
|
387
|
+
title: z.ZodOptional<z.ZodString>;
|
|
388
|
+
detail: z.ZodOptional<z.ZodString>;
|
|
389
|
+
resource: z.ZodOptional<z.ZodString>;
|
|
390
|
+
action: z.ZodOptional<z.ZodString>;
|
|
391
|
+
data: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
392
|
+
}, z.core.$strip>;
|
|
393
|
+
type SignalReading = z.infer<typeof SignalReadingSchema>;
|
|
394
|
+
/** Standard error body for contract endpoints. */
|
|
395
|
+
declare const AdminErrorSchema: z.ZodObject<{
|
|
396
|
+
error: z.ZodObject<{
|
|
397
|
+
code: z.ZodEnum<{
|
|
398
|
+
unauthenticated: "unauthenticated";
|
|
399
|
+
forbidden: "forbidden";
|
|
400
|
+
not_found: "not_found";
|
|
401
|
+
invalid_input: "invalid_input";
|
|
402
|
+
plan_required: "plan_required";
|
|
403
|
+
plan_expired: "plan_expired";
|
|
404
|
+
upstream_unavailable: "upstream_unavailable";
|
|
405
|
+
internal: "internal";
|
|
406
|
+
}>;
|
|
407
|
+
message: z.ZodString;
|
|
408
|
+
}, z.core.$strip>;
|
|
409
|
+
}, z.core.$strip>;
|
|
410
|
+
type AdminError = z.infer<typeof AdminErrorSchema>;
|
|
411
|
+
/** Validate an apply against its action: destructive applies must reference a plan. */
|
|
412
|
+
declare function assertApplyAllowed(action: AdminAction, request: ActionRequest): AdminError | null;
|
|
413
|
+
/** Resolve a contract path against the manifest origin. */
|
|
414
|
+
declare function resolveContractUrl(manifest: Pick<AdminManifest, "origin">, path: string): string;
|
|
415
|
+
|
|
416
|
+
export { ADMIN_CONTRACT_VERSION, type ActionPlan, ActionPlanSchema, type ActionRequest, ActionRequestSchema, type ActionResult, ActionResultSchema, type AdminAction, AdminActionSchema, type AdminColumn, AdminColumnSchema, type AdminDomain, type AdminDomainId, AdminDomainIdSchema, AdminDomainSchema, type AdminError, AdminErrorSchema, type AdminManifest, AdminManifestSchema, type AdminPolicy, AdminPolicySchema, type AdminResource, AdminResourceSchema, type AdminSeverity, AdminSeveritySchema, type AdminSignal, AdminSignalSchema, type AdminStatus, AdminStatusSchema, PlanDiffEntrySchema, type ResourceList, ResourceListSchema, STAFF_ROLE_RANK, type SignalReading, SignalReadingSchema, type StaffRole, StaffRoleSchema, assertApplyAllowed, resolveContractUrl, roleAtLeast };
|
package/dist/admin.js
ADDED
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import {
|
|
2
|
+
ADMIN_CONTRACT_VERSION,
|
|
3
|
+
ActionPlanSchema,
|
|
4
|
+
ActionRequestSchema,
|
|
5
|
+
ActionResultSchema,
|
|
6
|
+
AdminActionSchema,
|
|
7
|
+
AdminColumnSchema,
|
|
8
|
+
AdminDomainIdSchema,
|
|
9
|
+
AdminDomainSchema,
|
|
10
|
+
AdminErrorSchema,
|
|
11
|
+
AdminManifestSchema,
|
|
12
|
+
AdminPolicySchema,
|
|
13
|
+
AdminResourceSchema,
|
|
14
|
+
AdminSeveritySchema,
|
|
15
|
+
AdminSignalSchema,
|
|
16
|
+
AdminStatusSchema,
|
|
17
|
+
PlanDiffEntrySchema,
|
|
18
|
+
ResourceListSchema,
|
|
19
|
+
STAFF_ROLE_RANK,
|
|
20
|
+
SignalReadingSchema,
|
|
21
|
+
StaffRoleSchema,
|
|
22
|
+
assertApplyAllowed,
|
|
23
|
+
resolveContractUrl,
|
|
24
|
+
roleAtLeast
|
|
25
|
+
} from "./chunk-ERZTZ3PW.js";
|
|
26
|
+
export {
|
|
27
|
+
ADMIN_CONTRACT_VERSION,
|
|
28
|
+
ActionPlanSchema,
|
|
29
|
+
ActionRequestSchema,
|
|
30
|
+
ActionResultSchema,
|
|
31
|
+
AdminActionSchema,
|
|
32
|
+
AdminColumnSchema,
|
|
33
|
+
AdminDomainIdSchema,
|
|
34
|
+
AdminDomainSchema,
|
|
35
|
+
AdminErrorSchema,
|
|
36
|
+
AdminManifestSchema,
|
|
37
|
+
AdminPolicySchema,
|
|
38
|
+
AdminResourceSchema,
|
|
39
|
+
AdminSeveritySchema,
|
|
40
|
+
AdminSignalSchema,
|
|
41
|
+
AdminStatusSchema,
|
|
42
|
+
PlanDiffEntrySchema,
|
|
43
|
+
ResourceListSchema,
|
|
44
|
+
STAFF_ROLE_RANK,
|
|
45
|
+
SignalReadingSchema,
|
|
46
|
+
StaffRoleSchema,
|
|
47
|
+
assertApplyAllowed,
|
|
48
|
+
resolveContractUrl,
|
|
49
|
+
roleAtLeast
|
|
50
|
+
};
|
|
51
|
+
//# sourceMappingURL=admin.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|