@stitchwire/client 0.0.0-stage → 0.31.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +296 -2
- package/dist/chunk-d3248e3w.js +728 -0
- package/dist/chunk-mva06nh4.js +709 -0
- package/dist/contracts.d.ts +1 -0
- package/dist/contracts.js +84 -0
- package/dist/enrollment.d.ts +1 -0
- package/dist/enrollment.js +503 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1680 -0
- package/dist/types/client/src/contracts.d.ts +1 -0
- package/dist/types/client/src/enrollment.d.ts +11 -0
- package/dist/types/client/src/index.d.ts +1 -0
- package/dist/types/contracts/src/door/client-error.d.ts +20 -0
- package/dist/types/contracts/src/door/common.d.ts +3 -0
- package/dist/types/contracts/src/door/event-lifecycle.d.ts +22 -0
- package/dist/types/contracts/src/door/local-contract.d.ts +466 -0
- package/dist/types/contracts/src/door/paths.d.ts +17 -0
- package/dist/types/contracts/src/door/request-bounds.d.ts +4 -0
- package/dist/types/contracts/src/door/requests.d.ts +47 -0
- package/dist/types/contracts/src/door/results.d.ts +319 -0
- package/dist/types/contracts/src/door/status.d.ts +859 -0
- package/dist/types/contracts/src/door/streams.d.ts +226 -0
- package/dist/types/contracts/src/enrollment/fleet-admission.d.ts +413 -0
- package/dist/types/contracts/src/enrollment/outcome.d.ts +29 -0
- package/dist/types/contracts/src/enrollment/request.d.ts +281 -0
- package/dist/types/contracts/src/enrollment/result.d.ts +713 -0
- package/dist/types/contracts/src/fleet/bundle.d.ts +209 -0
- package/dist/types/contracts/src/fleet/identity.d.ts +4 -0
- package/dist/types/contracts/src/fleet/manifest.d.ts +71 -0
- package/dist/types/contracts/src/fleet/status.d.ts +56 -0
- package/dist/types/contracts/src/peer-contract.d.ts +78 -0
- package/dist/types/contracts/src/protocol/bounds.d.ts +37 -0
- package/dist/types/contracts/src/protocol/broker-health.d.ts +384 -0
- package/dist/types/contracts/src/protocol/event.d.ts +222 -0
- package/dist/types/contracts/src/protocol/failure.d.ts +146 -0
- package/dist/types/contracts/src/protocol/identity.d.ts +11 -0
- package/dist/types/contracts/src/protocol/json-bounds.d.ts +6 -0
- package/dist/types/contracts/src/protocol/lane-url.d.ts +16 -0
- package/dist/types/contracts/src/protocol/paths.d.ts +7 -0
- package/dist/types/contracts/src/protocol/payload.d.ts +25 -0
- package/dist/types/contracts/src/protocol/presence.d.ts +66 -0
- package/dist/types/contracts/src/protocol/release.d.ts +61 -0
- package/dist/types/contracts/src/protocol/result.d.ts +41 -0
- package/dist/types/contracts/src/protocol/rpc.d.ts +106 -0
- package/dist/types/contracts/src/protocol/schema-parse.d.ts +23 -0
- package/dist/types/contracts/src/protocol/stream.d.ts +290 -0
- package/dist/types/contracts/src/protocol/topic.d.ts +185 -0
- package/dist/types/contracts/src/service/budgets.d.ts +3 -0
- package/dist/types/contracts/src/service/contract-descriptor.d.ts +9 -0
- package/dist/types/contracts/src/service/contracts.d.ts +430 -0
- package/dist/types/contracts/src/service/declaration.d.ts +122 -0
- package/dist/types/contracts/src/service/diagnostics.d.ts +104 -0
- package/dist/types/contracts/src/service/owner-route-path.d.ts +11 -0
- package/dist/types/contracts/src/service/policy-schema.d.ts +154 -0
- package/dist/types/contracts/src/service/request-bounds.d.ts +5 -0
- package/dist/types/contracts/src/service/service-contract.d.ts +112 -0
- package/dist/types/local-client/src/broker-health.d.ts +18 -0
- package/dist/types/local-client/src/client.d.ts +377 -0
- package/dist/types/local-client/src/contracts.d.ts +112 -0
- package/dist/types/local-client/src/declarations.d.ts +57 -0
- package/dist/types/local-client/src/door-paths.d.ts +18 -0
- package/dist/types/local-client/src/errno.d.ts +6 -0
- package/dist/types/local-client/src/error-chain.d.ts +25 -0
- package/dist/types/local-client/src/errors.d.ts +39 -0
- package/dist/types/local-client/src/event-sequence.d.ts +4 -0
- package/dist/types/local-client/src/feed.d.ts +8 -0
- package/dist/types/local-client/src/http.d.ts +20 -0
- package/dist/types/local-client/src/index.d.ts +13 -0
- package/dist/types/local-client/src/ingress.d.ts +31 -0
- package/dist/types/local-client/src/operation.d.ts +37 -0
- package/dist/types/local-client/src/options.d.ts +18 -0
- package/dist/types/local-client/src/paths.d.ts +52 -0
- package/dist/types/local-client/src/readers.d.ts +143 -0
- package/dist/types/local-client/src/service.d.ts +33 -0
- package/dist/types/local-client/src/status-readers.d.ts +756 -0
- package/dist/types/local-client/src/unary.d.ts +10 -0
- package/package.json +58 -4
|
@@ -0,0 +1,281 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
/** A source runtime is a bounded regular artifact, never a stream or device. */
|
|
3
|
+
export declare const MAX_ENROLLMENT_ARTIFACT_BYTES: number;
|
|
4
|
+
/** The oldest Bun an installed runtime runs under. */
|
|
5
|
+
export declare const MINIMUM_BUN_VERSION = "1.4.4";
|
|
6
|
+
/** Whether a `bun --version` answer is exactly three numbers and at least the minimum. */
|
|
7
|
+
export declare function supportsBun(version: string): boolean;
|
|
8
|
+
/** A path that enters a node configuration, whose entries hold at most 1024 characters. */
|
|
9
|
+
export declare const EnrollmentPathSchema: z.ZodString;
|
|
10
|
+
/** Bootstrap carries only the addressed node's signed slice and independently trusted public keys. */
|
|
11
|
+
export declare const EnrollmentMaterialSchema: z.ZodObject<{
|
|
12
|
+
trust: z.ZodArray<z.ZodObject<{
|
|
13
|
+
id: z.ZodString;
|
|
14
|
+
publicKey: z.ZodString;
|
|
15
|
+
}, z.core.$strict>>;
|
|
16
|
+
bundle: z.ZodObject<{
|
|
17
|
+
format: z.ZodLiteral<"stitchwire.fleet-bundle">;
|
|
18
|
+
serial: z.ZodNumber;
|
|
19
|
+
full: z.ZodNullable<z.ZodObject<{
|
|
20
|
+
keyId: z.ZodString;
|
|
21
|
+
payload: z.ZodString;
|
|
22
|
+
signature: z.ZodString;
|
|
23
|
+
}, z.core.$strict>>;
|
|
24
|
+
slices: z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
25
|
+
keyId: z.ZodString;
|
|
26
|
+
payload: z.ZodString;
|
|
27
|
+
signature: z.ZodString;
|
|
28
|
+
}, z.core.$strict>>;
|
|
29
|
+
}, z.core.$strict>;
|
|
30
|
+
}, z.core.$strict>;
|
|
31
|
+
export type EnrollmentMaterial = z.infer<typeof EnrollmentMaterialSchema>;
|
|
32
|
+
declare const EnrollmentEndpointSchema: z.ZodObject<{
|
|
33
|
+
id: z.ZodString;
|
|
34
|
+
url: z.ZodString;
|
|
35
|
+
}, z.core.$strict>;
|
|
36
|
+
export type EnrollmentEndpoint = z.infer<typeof EnrollmentEndpointSchema>;
|
|
37
|
+
/** The brokers a node dials: each named once and reached at its own address. */
|
|
38
|
+
export declare const EnrollmentBrokersSchema: z.ZodArray<z.ZodObject<{
|
|
39
|
+
id: z.ZodString;
|
|
40
|
+
url: z.ZodString;
|
|
41
|
+
}, z.core.$strict>>;
|
|
42
|
+
/** The digest of the token a node presents to one broker; the token itself never leaves the node. */
|
|
43
|
+
export declare const EnrollmentCredentialSchema: z.ZodObject<{
|
|
44
|
+
broker: z.ZodString;
|
|
45
|
+
sha256: z.ZodString;
|
|
46
|
+
}, z.core.$strict>;
|
|
47
|
+
export type EnrollmentCredential = z.infer<typeof EnrollmentCredentialSchema>;
|
|
48
|
+
/** An installed runtime together with the delivered file it is copied from. */
|
|
49
|
+
declare const EnrollmentArtifactSchema: z.ZodObject<{
|
|
50
|
+
destination: z.ZodString;
|
|
51
|
+
sha256: z.ZodString;
|
|
52
|
+
source: z.ZodString;
|
|
53
|
+
}, z.core.$strict>;
|
|
54
|
+
export type EnrollmentArtifact = z.infer<typeof EnrollmentArtifactSchema>;
|
|
55
|
+
/** A plain systemd service name: no path separator, template instance or specifier. */
|
|
56
|
+
export declare const EnrollmentUnitSchema: z.ZodString;
|
|
57
|
+
/** A supervised installation as its layout: everything but where the runtime is delivered from. */
|
|
58
|
+
export declare const EnrollmentSystemdLayoutSchema: z.ZodObject<{
|
|
59
|
+
kind: z.ZodLiteral<"systemd">;
|
|
60
|
+
scope: z.ZodEnum<{
|
|
61
|
+
system: "system";
|
|
62
|
+
user: "user";
|
|
63
|
+
}>;
|
|
64
|
+
bun: z.ZodString;
|
|
65
|
+
unit: z.ZodOptional<z.ZodString>;
|
|
66
|
+
artifact: z.ZodObject<{
|
|
67
|
+
destination: z.ZodString;
|
|
68
|
+
sha256: z.ZodString;
|
|
69
|
+
}, z.core.$strict>;
|
|
70
|
+
}, z.core.$strict>;
|
|
71
|
+
/** A new supervised installation always names its runtime; an existing agent never does. */
|
|
72
|
+
declare const EnrollmentSystemdSupervisorSchema: z.ZodObject<{
|
|
73
|
+
kind: z.ZodLiteral<"systemd">;
|
|
74
|
+
scope: z.ZodEnum<{
|
|
75
|
+
system: "system";
|
|
76
|
+
user: "user";
|
|
77
|
+
}>;
|
|
78
|
+
bun: z.ZodString;
|
|
79
|
+
unit: z.ZodOptional<z.ZodString>;
|
|
80
|
+
artifact: z.ZodObject<{
|
|
81
|
+
destination: z.ZodString;
|
|
82
|
+
sha256: z.ZodString;
|
|
83
|
+
source: z.ZodString;
|
|
84
|
+
}, z.core.$strict>;
|
|
85
|
+
}, z.core.$strict>;
|
|
86
|
+
export type EnrollmentSystemdSupervisor = z.infer<typeof EnrollmentSystemdSupervisorSchema>;
|
|
87
|
+
declare const EnrollmentSupervisorSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
88
|
+
kind: z.ZodLiteral<"existing">;
|
|
89
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
90
|
+
kind: z.ZodLiteral<"systemd">;
|
|
91
|
+
scope: z.ZodEnum<{
|
|
92
|
+
system: "system";
|
|
93
|
+
user: "user";
|
|
94
|
+
}>;
|
|
95
|
+
bun: z.ZodString;
|
|
96
|
+
unit: z.ZodOptional<z.ZodString>;
|
|
97
|
+
artifact: z.ZodObject<{
|
|
98
|
+
destination: z.ZodString;
|
|
99
|
+
sha256: z.ZodString;
|
|
100
|
+
source: z.ZodString;
|
|
101
|
+
}, z.core.$strict>;
|
|
102
|
+
}, z.core.$strict>], "kind">;
|
|
103
|
+
export type EnrollmentSupervisor = z.infer<typeof EnrollmentSupervisorSchema>;
|
|
104
|
+
/** One owner binding; its kind chooses the file parser and the node configuration table. */
|
|
105
|
+
export declare const EnrollmentDescriptorSchema: z.ZodObject<{
|
|
106
|
+
kind: z.ZodEnum<{
|
|
107
|
+
service: "service";
|
|
108
|
+
topic: "topic";
|
|
109
|
+
}>;
|
|
110
|
+
path: z.ZodString;
|
|
111
|
+
}, z.core.$strict>;
|
|
112
|
+
export type EnrollmentDescriptor = z.infer<typeof EnrollmentDescriptorSchema>;
|
|
113
|
+
declare const EnrollmentOwnerSchema: z.ZodObject<{
|
|
114
|
+
id: z.ZodString;
|
|
115
|
+
adopt: z.ZodOptional<z.ZodBoolean>;
|
|
116
|
+
descriptors: z.ZodArray<z.ZodObject<{
|
|
117
|
+
kind: z.ZodEnum<{
|
|
118
|
+
service: "service";
|
|
119
|
+
topic: "topic";
|
|
120
|
+
}>;
|
|
121
|
+
path: z.ZodString;
|
|
122
|
+
}, z.core.$strict>>;
|
|
123
|
+
}, z.core.$strict>;
|
|
124
|
+
export type EnrollmentOwner = z.infer<typeof EnrollmentOwnerSchema>;
|
|
125
|
+
declare const EnrollmentProofSchema: z.ZodObject<{
|
|
126
|
+
descriptor: z.ZodString;
|
|
127
|
+
call: z.ZodObject<{
|
|
128
|
+
traceId: z.ZodOptional<z.ZodUUID>;
|
|
129
|
+
to: z.ZodString;
|
|
130
|
+
service: z.ZodString;
|
|
131
|
+
revision: z.ZodString;
|
|
132
|
+
operation: z.ZodString;
|
|
133
|
+
payload: z.ZodString;
|
|
134
|
+
timeoutMs: z.ZodNumber;
|
|
135
|
+
}, z.core.$strict>;
|
|
136
|
+
responseSha256: z.ZodString;
|
|
137
|
+
}, z.core.$strict>;
|
|
138
|
+
export type EnrollmentProof = z.infer<typeof EnrollmentProofSchema>;
|
|
139
|
+
export declare const EnrollmentVersionSchema: z.ZodString;
|
|
140
|
+
export declare const EnrollmentNodeRequestSchema: z.ZodObject<{
|
|
141
|
+
v: z.ZodLiteral<1>;
|
|
142
|
+
requestId: z.ZodUUID;
|
|
143
|
+
nodeId: z.ZodString;
|
|
144
|
+
expectedVersion: z.ZodString;
|
|
145
|
+
config: z.ZodString;
|
|
146
|
+
kind: z.ZodLiteral<"node">;
|
|
147
|
+
material: z.ZodOptional<z.ZodString>;
|
|
148
|
+
brokers: z.ZodArray<z.ZodObject<{
|
|
149
|
+
id: z.ZodString;
|
|
150
|
+
url: z.ZodString;
|
|
151
|
+
}, z.core.$strict>>;
|
|
152
|
+
agentSocket: z.ZodString;
|
|
153
|
+
supervisor: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
154
|
+
kind: z.ZodLiteral<"existing">;
|
|
155
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
156
|
+
kind: z.ZodLiteral<"systemd">;
|
|
157
|
+
scope: z.ZodEnum<{
|
|
158
|
+
system: "system";
|
|
159
|
+
user: "user";
|
|
160
|
+
}>;
|
|
161
|
+
bun: z.ZodString;
|
|
162
|
+
unit: z.ZodOptional<z.ZodString>;
|
|
163
|
+
artifact: z.ZodObject<{
|
|
164
|
+
destination: z.ZodString;
|
|
165
|
+
sha256: z.ZodString;
|
|
166
|
+
source: z.ZodString;
|
|
167
|
+
}, z.core.$strict>;
|
|
168
|
+
}, z.core.$strict>], "kind">;
|
|
169
|
+
owner: z.ZodObject<{
|
|
170
|
+
id: z.ZodString;
|
|
171
|
+
adopt: z.ZodOptional<z.ZodBoolean>;
|
|
172
|
+
descriptors: z.ZodArray<z.ZodObject<{
|
|
173
|
+
kind: z.ZodEnum<{
|
|
174
|
+
service: "service";
|
|
175
|
+
topic: "topic";
|
|
176
|
+
}>;
|
|
177
|
+
path: z.ZodString;
|
|
178
|
+
}, z.core.$strict>>;
|
|
179
|
+
}, z.core.$strict>;
|
|
180
|
+
proof: z.ZodOptional<z.ZodObject<{
|
|
181
|
+
descriptor: z.ZodString;
|
|
182
|
+
call: z.ZodObject<{
|
|
183
|
+
traceId: z.ZodOptional<z.ZodUUID>;
|
|
184
|
+
to: z.ZodString;
|
|
185
|
+
service: z.ZodString;
|
|
186
|
+
revision: z.ZodString;
|
|
187
|
+
operation: z.ZodString;
|
|
188
|
+
payload: z.ZodString;
|
|
189
|
+
timeoutMs: z.ZodNumber;
|
|
190
|
+
}, z.core.$strict>;
|
|
191
|
+
responseSha256: z.ZodString;
|
|
192
|
+
}, z.core.$strict>>;
|
|
193
|
+
}, z.core.$strict>;
|
|
194
|
+
export type EnrollmentNodeRequest = z.infer<typeof EnrollmentNodeRequestSchema>;
|
|
195
|
+
export declare const EnrollmentAdmissionRequestSchema: z.ZodObject<{
|
|
196
|
+
v: z.ZodLiteral<1>;
|
|
197
|
+
requestId: z.ZodUUID;
|
|
198
|
+
nodeId: z.ZodString;
|
|
199
|
+
expectedVersion: z.ZodString;
|
|
200
|
+
config: z.ZodString;
|
|
201
|
+
kind: z.ZodLiteral<"admission">;
|
|
202
|
+
tokenSha256: z.ZodOptional<z.ZodString>;
|
|
203
|
+
}, z.core.$strict>;
|
|
204
|
+
export type EnrollmentAdmissionRequest = z.infer<typeof EnrollmentAdmissionRequestSchema>;
|
|
205
|
+
export declare const EnrollmentRequestSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
206
|
+
v: z.ZodLiteral<1>;
|
|
207
|
+
requestId: z.ZodUUID;
|
|
208
|
+
nodeId: z.ZodString;
|
|
209
|
+
expectedVersion: z.ZodString;
|
|
210
|
+
config: z.ZodString;
|
|
211
|
+
kind: z.ZodLiteral<"node">;
|
|
212
|
+
material: z.ZodOptional<z.ZodString>;
|
|
213
|
+
brokers: z.ZodArray<z.ZodObject<{
|
|
214
|
+
id: z.ZodString;
|
|
215
|
+
url: z.ZodString;
|
|
216
|
+
}, z.core.$strict>>;
|
|
217
|
+
agentSocket: z.ZodString;
|
|
218
|
+
supervisor: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
219
|
+
kind: z.ZodLiteral<"existing">;
|
|
220
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
221
|
+
kind: z.ZodLiteral<"systemd">;
|
|
222
|
+
scope: z.ZodEnum<{
|
|
223
|
+
system: "system";
|
|
224
|
+
user: "user";
|
|
225
|
+
}>;
|
|
226
|
+
bun: z.ZodString;
|
|
227
|
+
unit: z.ZodOptional<z.ZodString>;
|
|
228
|
+
artifact: z.ZodObject<{
|
|
229
|
+
destination: z.ZodString;
|
|
230
|
+
sha256: z.ZodString;
|
|
231
|
+
source: z.ZodString;
|
|
232
|
+
}, z.core.$strict>;
|
|
233
|
+
}, z.core.$strict>], "kind">;
|
|
234
|
+
owner: z.ZodObject<{
|
|
235
|
+
id: z.ZodString;
|
|
236
|
+
adopt: z.ZodOptional<z.ZodBoolean>;
|
|
237
|
+
descriptors: z.ZodArray<z.ZodObject<{
|
|
238
|
+
kind: z.ZodEnum<{
|
|
239
|
+
service: "service";
|
|
240
|
+
topic: "topic";
|
|
241
|
+
}>;
|
|
242
|
+
path: z.ZodString;
|
|
243
|
+
}, z.core.$strict>>;
|
|
244
|
+
}, z.core.$strict>;
|
|
245
|
+
proof: z.ZodOptional<z.ZodObject<{
|
|
246
|
+
descriptor: z.ZodString;
|
|
247
|
+
call: z.ZodObject<{
|
|
248
|
+
traceId: z.ZodOptional<z.ZodUUID>;
|
|
249
|
+
to: z.ZodString;
|
|
250
|
+
service: z.ZodString;
|
|
251
|
+
revision: z.ZodString;
|
|
252
|
+
operation: z.ZodString;
|
|
253
|
+
payload: z.ZodString;
|
|
254
|
+
timeoutMs: z.ZodNumber;
|
|
255
|
+
}, z.core.$strict>;
|
|
256
|
+
responseSha256: z.ZodString;
|
|
257
|
+
}, z.core.$strict>>;
|
|
258
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
259
|
+
v: z.ZodLiteral<1>;
|
|
260
|
+
requestId: z.ZodUUID;
|
|
261
|
+
nodeId: z.ZodString;
|
|
262
|
+
expectedVersion: z.ZodString;
|
|
263
|
+
config: z.ZodString;
|
|
264
|
+
kind: z.ZodLiteral<"admission">;
|
|
265
|
+
tokenSha256: z.ZodOptional<z.ZodString>;
|
|
266
|
+
}, z.core.$strict>], "kind">;
|
|
267
|
+
export type EnrollmentRequest = z.infer<typeof EnrollmentRequestSchema>;
|
|
268
|
+
export declare const EnrollmentOperationSchema: z.ZodEnum<{
|
|
269
|
+
apply: "apply";
|
|
270
|
+
detach: "detach";
|
|
271
|
+
plan: "plan";
|
|
272
|
+
prepare: "prepare";
|
|
273
|
+
status: "status";
|
|
274
|
+
}>;
|
|
275
|
+
export type EnrollmentOperation = z.infer<typeof EnrollmentOperationSchema>;
|
|
276
|
+
/** A broker admits or reads; credential preparation and owner detach are a node's operations. */
|
|
277
|
+
export declare const ENROLLMENT_OPERATIONS: {
|
|
278
|
+
node: ("apply" | "detach" | "plan" | "prepare" | "status")[];
|
|
279
|
+
admission: ("apply" | "plan" | "status")[];
|
|
280
|
+
};
|
|
281
|
+
export {};
|