@stitchwire/client 0.0.0-stage → 0.31.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.
Files changed (78) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +296 -2
  3. package/dist/chunk-d3248e3w.js +728 -0
  4. package/dist/chunk-mva06nh4.js +709 -0
  5. package/dist/contracts.d.ts +1 -0
  6. package/dist/contracts.js +84 -0
  7. package/dist/enrollment.d.ts +1 -0
  8. package/dist/enrollment.js +503 -0
  9. package/dist/index.d.ts +1 -0
  10. package/dist/index.js +1680 -0
  11. package/dist/types/client/src/contracts.d.ts +1 -0
  12. package/dist/types/client/src/enrollment.d.ts +11 -0
  13. package/dist/types/client/src/index.d.ts +1 -0
  14. package/dist/types/contracts/src/door/client-error.d.ts +20 -0
  15. package/dist/types/contracts/src/door/common.d.ts +3 -0
  16. package/dist/types/contracts/src/door/event-lifecycle.d.ts +22 -0
  17. package/dist/types/contracts/src/door/local-contract.d.ts +466 -0
  18. package/dist/types/contracts/src/door/paths.d.ts +17 -0
  19. package/dist/types/contracts/src/door/request-bounds.d.ts +4 -0
  20. package/dist/types/contracts/src/door/requests.d.ts +47 -0
  21. package/dist/types/contracts/src/door/results.d.ts +319 -0
  22. package/dist/types/contracts/src/door/status.d.ts +859 -0
  23. package/dist/types/contracts/src/door/streams.d.ts +226 -0
  24. package/dist/types/contracts/src/enrollment/fleet-admission.d.ts +413 -0
  25. package/dist/types/contracts/src/enrollment/outcome.d.ts +29 -0
  26. package/dist/types/contracts/src/enrollment/request.d.ts +281 -0
  27. package/dist/types/contracts/src/enrollment/result.d.ts +713 -0
  28. package/dist/types/contracts/src/fleet/bundle.d.ts +209 -0
  29. package/dist/types/contracts/src/fleet/identity.d.ts +4 -0
  30. package/dist/types/contracts/src/fleet/manifest.d.ts +71 -0
  31. package/dist/types/contracts/src/fleet/status.d.ts +56 -0
  32. package/dist/types/contracts/src/peer-contract.d.ts +78 -0
  33. package/dist/types/contracts/src/protocol/bounds.d.ts +37 -0
  34. package/dist/types/contracts/src/protocol/broker-health.d.ts +384 -0
  35. package/dist/types/contracts/src/protocol/event.d.ts +222 -0
  36. package/dist/types/contracts/src/protocol/failure.d.ts +146 -0
  37. package/dist/types/contracts/src/protocol/identity.d.ts +11 -0
  38. package/dist/types/contracts/src/protocol/json-bounds.d.ts +6 -0
  39. package/dist/types/contracts/src/protocol/lane-url.d.ts +16 -0
  40. package/dist/types/contracts/src/protocol/paths.d.ts +7 -0
  41. package/dist/types/contracts/src/protocol/payload.d.ts +25 -0
  42. package/dist/types/contracts/src/protocol/presence.d.ts +66 -0
  43. package/dist/types/contracts/src/protocol/release.d.ts +61 -0
  44. package/dist/types/contracts/src/protocol/result.d.ts +41 -0
  45. package/dist/types/contracts/src/protocol/rpc.d.ts +106 -0
  46. package/dist/types/contracts/src/protocol/schema-parse.d.ts +23 -0
  47. package/dist/types/contracts/src/protocol/stream.d.ts +290 -0
  48. package/dist/types/contracts/src/protocol/topic.d.ts +185 -0
  49. package/dist/types/contracts/src/service/budgets.d.ts +3 -0
  50. package/dist/types/contracts/src/service/contract-descriptor.d.ts +9 -0
  51. package/dist/types/contracts/src/service/contracts.d.ts +430 -0
  52. package/dist/types/contracts/src/service/declaration.d.ts +122 -0
  53. package/dist/types/contracts/src/service/diagnostics.d.ts +104 -0
  54. package/dist/types/contracts/src/service/owner-route-path.d.ts +11 -0
  55. package/dist/types/contracts/src/service/policy-schema.d.ts +154 -0
  56. package/dist/types/contracts/src/service/request-bounds.d.ts +5 -0
  57. package/dist/types/contracts/src/service/service-contract.d.ts +112 -0
  58. package/dist/types/local-client/src/broker-health.d.ts +18 -0
  59. package/dist/types/local-client/src/client.d.ts +377 -0
  60. package/dist/types/local-client/src/contracts.d.ts +112 -0
  61. package/dist/types/local-client/src/declarations.d.ts +57 -0
  62. package/dist/types/local-client/src/door-paths.d.ts +18 -0
  63. package/dist/types/local-client/src/errno.d.ts +6 -0
  64. package/dist/types/local-client/src/error-chain.d.ts +25 -0
  65. package/dist/types/local-client/src/errors.d.ts +39 -0
  66. package/dist/types/local-client/src/event-sequence.d.ts +4 -0
  67. package/dist/types/local-client/src/feed.d.ts +8 -0
  68. package/dist/types/local-client/src/http.d.ts +20 -0
  69. package/dist/types/local-client/src/index.d.ts +13 -0
  70. package/dist/types/local-client/src/ingress.d.ts +31 -0
  71. package/dist/types/local-client/src/operation.d.ts +37 -0
  72. package/dist/types/local-client/src/options.d.ts +18 -0
  73. package/dist/types/local-client/src/paths.d.ts +52 -0
  74. package/dist/types/local-client/src/readers.d.ts +143 -0
  75. package/dist/types/local-client/src/service.d.ts +33 -0
  76. package/dist/types/local-client/src/status-readers.d.ts +756 -0
  77. package/dist/types/local-client/src/unary.d.ts +10 -0
  78. package/package.json +58 -4
@@ -0,0 +1,226 @@
1
+ import { type EndpointStreamDescriptor } from 'stitchkit';
2
+ import { z } from 'zod';
3
+ /** Wire owns its frames; Kit owns framing, bounded parsing and terminal lifetime. */
4
+ export declare function itemStream<T>(item: z.ZodType<T>, terminal: z.ZodType, maxFrameBytes?: number): EndpointStreamDescriptor<z.ZodType<T>>;
5
+ export declare const streamDoorContract: import("stitchkit").ContractDef<{
6
+ readonly stream: {
7
+ readonly method: "POST";
8
+ readonly path: "/stream";
9
+ readonly desc: "Bounded command stream";
10
+ readonly input: z.ZodUnion<readonly [z.ZodObject<{
11
+ to: z.ZodString;
12
+ profile: z.ZodString;
13
+ args: z.ZodDefault<z.ZodArray<z.ZodString>>;
14
+ stdin: z.ZodDefault<z.ZodNullable<z.ZodString>>;
15
+ cursor: z.ZodDefault<z.ZodNullable<z.ZodString>>;
16
+ timeoutMs: z.ZodOptional<z.ZodNumber>;
17
+ }, z.core.$strict>, z.ZodObject<{
18
+ to: z.ZodString;
19
+ source: z.ZodObject<{
20
+ kind: z.ZodLiteral<"service">;
21
+ service: z.ZodString;
22
+ revision: z.ZodString;
23
+ operation: z.ZodString;
24
+ payload: z.ZodString;
25
+ }, z.core.$strict>;
26
+ timeoutMs: z.ZodOptional<z.ZodNumber>;
27
+ }, z.core.$strict>]>;
28
+ readonly maxJsonBodyBytes: number;
29
+ readonly stream: EndpointStreamDescriptor<z.ZodType<{
30
+ streamId: string;
31
+ from: string;
32
+ seq: number;
33
+ channel: "data" | "stderr" | "stdout";
34
+ encoding: "base64";
35
+ data: string;
36
+ bytes: number;
37
+ cursor: string | null;
38
+ v: 7;
39
+ } | {
40
+ streamId: string;
41
+ from: string;
42
+ lastSeq: number;
43
+ code: number;
44
+ reason: "cancelled" | "completed" | "disconnect" | "error" | "limit" | "slow-consumer" | "timeout" | "unsupported";
45
+ cursor: string | null;
46
+ v: 7;
47
+ } | {
48
+ refusal: "capacity" | "none" | "policy" | "request";
49
+ retryAfterMs: number | null;
50
+ transportCause: "acknowledgement-timeout" | "lane-lost-after-dispatch" | "no-connected-lane" | "presence-pending-timeout" | "target-offline" | null;
51
+ streamId: string;
52
+ from: string;
53
+ failure: "cancelled" | "denied" | "exec" | "none" | "offline" | "rejected" | "timeout" | "transport";
54
+ reason: "cancelled" | "completed" | "disconnect" | "error" | "limit" | "slow-consumer" | "timeout" | "unsupported";
55
+ detail: string;
56
+ v: 7;
57
+ }, unknown, z.core.$ZodTypeInternals<{
58
+ streamId: string;
59
+ from: string;
60
+ seq: number;
61
+ channel: "data" | "stderr" | "stdout";
62
+ encoding: "base64";
63
+ data: string;
64
+ bytes: number;
65
+ cursor: string | null;
66
+ v: 7;
67
+ } | {
68
+ streamId: string;
69
+ from: string;
70
+ lastSeq: number;
71
+ code: number;
72
+ reason: "cancelled" | "completed" | "disconnect" | "error" | "limit" | "slow-consumer" | "timeout" | "unsupported";
73
+ cursor: string | null;
74
+ v: 7;
75
+ } | {
76
+ refusal: "capacity" | "none" | "policy" | "request";
77
+ retryAfterMs: number | null;
78
+ transportCause: "acknowledgement-timeout" | "lane-lost-after-dispatch" | "no-connected-lane" | "presence-pending-timeout" | "target-offline" | null;
79
+ streamId: string;
80
+ from: string;
81
+ failure: "cancelled" | "denied" | "exec" | "none" | "offline" | "rejected" | "timeout" | "transport";
82
+ reason: "cancelled" | "completed" | "disconnect" | "error" | "limit" | "slow-consumer" | "timeout" | "unsupported";
83
+ detail: string;
84
+ v: 7;
85
+ }, unknown>>>;
86
+ };
87
+ }, "public">;
88
+ export declare const eventDoorContract: import("stitchkit").ContractDef<{
89
+ /**
90
+ * Publishing is described by the contract like every other door endpoint: `maxJsonBodyBytes`
91
+ * is its byte ceiling, and the body reader and the refusal come with it.
92
+ */
93
+ readonly publish: {
94
+ readonly method: "POST";
95
+ readonly path: "/publish";
96
+ readonly desc: "Publish one bounded event on a declared topic";
97
+ readonly input: z.ZodObject<{
98
+ topic: z.ZodString;
99
+ bootId: z.ZodUUID;
100
+ seq: z.ZodNumber;
101
+ observedAt: z.ZodDefault<z.ZodNullable<z.ZodISODateTime>>;
102
+ cursor: z.ZodDefault<z.ZodNullable<z.ZodString>>;
103
+ data: z.ZodString;
104
+ }, z.core.$strict>;
105
+ readonly output: z.ZodObject<{
106
+ refusal: z.ZodEnum<{
107
+ capacity: "capacity";
108
+ none: "none";
109
+ policy: "policy";
110
+ request: "request";
111
+ }>;
112
+ retryAfterMs: z.ZodNullable<z.ZodNumber>;
113
+ transportCause: z.ZodNullable<z.ZodEnum<{
114
+ "acknowledgement-timeout": "acknowledgement-timeout";
115
+ "lane-lost-after-dispatch": "lane-lost-after-dispatch";
116
+ "no-connected-lane": "no-connected-lane";
117
+ "presence-pending-timeout": "presence-pending-timeout";
118
+ "target-offline": "target-offline";
119
+ }>>;
120
+ ok: z.ZodBoolean;
121
+ failure: z.ZodEnum<{
122
+ cancelled: "cancelled";
123
+ denied: "denied";
124
+ exec: "exec";
125
+ none: "none";
126
+ offline: "offline";
127
+ rejected: "rejected";
128
+ timeout: "timeout";
129
+ transport: "transport";
130
+ }>;
131
+ detail: z.ZodString;
132
+ }, z.core.$strict>;
133
+ readonly maxJsonBodyBytes: number;
134
+ };
135
+ readonly subscribe: {
136
+ readonly method: "POST";
137
+ readonly path: "/subscribe";
138
+ readonly desc: "Quiet live events with explicit gaps";
139
+ readonly input: z.ZodObject<{
140
+ topic: z.ZodString;
141
+ resume: z.ZodDefault<z.ZodNullable<z.ZodObject<{
142
+ bootId: z.ZodUUID;
143
+ afterSeq: z.ZodNumber;
144
+ }, z.core.$strict>>>;
145
+ lifecycle: z.ZodOptional<z.ZodBoolean>;
146
+ }, z.core.$strict>;
147
+ readonly maxJsonBodyBytes: number;
148
+ readonly stream: EndpointStreamDescriptor<z.ZodType<{
149
+ subscriptionId: string;
150
+ topic: string;
151
+ producer: string;
152
+ bootId: string;
153
+ fromSeq: number;
154
+ toSeq: number;
155
+ reason: "boot-change" | "latest-wins" | "overflow" | "resume" | "retention";
156
+ nextBootId?: string | undefined;
157
+ v: 7;
158
+ } | {
159
+ topic: string;
160
+ producer: string;
161
+ bootId: string;
162
+ seq: number;
163
+ observedAt: string | null;
164
+ cursor: string | null;
165
+ encoding: "base64";
166
+ data: string;
167
+ bytes: number;
168
+ v: 7;
169
+ subscriptionId: string;
170
+ } | {
171
+ refusal: "capacity" | "none" | "policy" | "request";
172
+ retryAfterMs: number | null;
173
+ transportCause: "acknowledgement-timeout" | "lane-lost-after-dispatch" | "no-connected-lane" | "presence-pending-timeout" | "target-offline" | null;
174
+ v: 7;
175
+ subscriptionId: string | null;
176
+ topic: string;
177
+ from: "broker";
178
+ failure: "cancelled" | "denied" | "exec" | "none" | "offline" | "rejected" | "timeout" | "transport";
179
+ detail: string;
180
+ } | {
181
+ subscriptionId: string;
182
+ topic: string;
183
+ subscriptionState: "opening" | "ready";
184
+ lanes: string[];
185
+ v: 7;
186
+ }, unknown, z.core.$ZodTypeInternals<{
187
+ subscriptionId: string;
188
+ topic: string;
189
+ producer: string;
190
+ bootId: string;
191
+ fromSeq: number;
192
+ toSeq: number;
193
+ reason: "boot-change" | "latest-wins" | "overflow" | "resume" | "retention";
194
+ nextBootId?: string | undefined;
195
+ v: 7;
196
+ } | {
197
+ topic: string;
198
+ producer: string;
199
+ bootId: string;
200
+ seq: number;
201
+ observedAt: string | null;
202
+ cursor: string | null;
203
+ encoding: "base64";
204
+ data: string;
205
+ bytes: number;
206
+ v: 7;
207
+ subscriptionId: string;
208
+ } | {
209
+ refusal: "capacity" | "none" | "policy" | "request";
210
+ retryAfterMs: number | null;
211
+ transportCause: "acknowledgement-timeout" | "lane-lost-after-dispatch" | "no-connected-lane" | "presence-pending-timeout" | "target-offline" | null;
212
+ v: 7;
213
+ subscriptionId: string | null;
214
+ topic: string;
215
+ from: "broker";
216
+ failure: "cancelled" | "denied" | "exec" | "none" | "offline" | "rejected" | "timeout" | "transport";
217
+ detail: string;
218
+ } | {
219
+ subscriptionId: string;
220
+ topic: string;
221
+ subscriptionState: "opening" | "ready";
222
+ lanes: string[];
223
+ v: 7;
224
+ }, unknown>>>;
225
+ };
226
+ }, "public">;
@@ -0,0 +1,413 @@
1
+ import { z } from 'zod';
2
+ /**
3
+ * `plan` and `status` read; `apply` also makes the operator's moves towards a member of the fleet;
4
+ * `withdraw` makes them backwards for an admission that was given up before the node was activated.
5
+ */
6
+ export declare const FleetAdmissionOperationSchema: z.ZodEnum<{
7
+ apply: "apply";
8
+ plan: "plan";
9
+ status: "status";
10
+ withdraw: "withdraw";
11
+ }>;
12
+ export type FleetAdmissionOperation = z.infer<typeof FleetAdmissionOperationSchema>;
13
+ /** The rights the node asks for: its own service namespaces and the topic namespaces it produces. */
14
+ declare const FleetAdmissionGrantsSchema: z.ZodObject<{
15
+ services: z.ZodArray<z.ZodString>;
16
+ topics: z.ZodArray<z.ZodObject<{
17
+ subscribers: z.ZodArray<z.ZodString>;
18
+ maxTopics: z.ZodNumber;
19
+ maxRetainedBytes: z.ZodOptional<z.ZodNumber>;
20
+ namespace: z.ZodString;
21
+ }, z.core.$strict>>;
22
+ }, z.core.$strict>;
23
+ export type FleetAdmissionGrants = z.infer<typeof FleetAdmissionGrantsSchema>;
24
+ export declare const FleetAdmissionRequestSchema: z.ZodObject<{
25
+ v: z.ZodLiteral<1>;
26
+ requestId: z.ZodUUID;
27
+ nodeId: z.ZodString;
28
+ target: z.ZodString;
29
+ grants: z.ZodObject<{
30
+ services: z.ZodArray<z.ZodString>;
31
+ topics: z.ZodArray<z.ZodObject<{
32
+ subscribers: z.ZodArray<z.ZodString>;
33
+ maxTopics: z.ZodNumber;
34
+ maxRetainedBytes: z.ZodOptional<z.ZodNumber>;
35
+ namespace: z.ZodString;
36
+ }, z.core.$strict>>;
37
+ }, z.core.$strict>;
38
+ credentials: z.ZodOptional<z.ZodArray<z.ZodObject<{
39
+ broker: z.ZodString;
40
+ sha256: z.ZodString;
41
+ }, z.core.$strict>>>;
42
+ }, z.core.$strict>;
43
+ export type FleetAdmissionRequest = z.infer<typeof FleetAdmissionRequestSchema>;
44
+ export declare const FleetAdmissionPhaseSchema: z.ZodEnum<{
45
+ activation: "activation";
46
+ admission: "admission";
47
+ inventory: "inventory";
48
+ membership: "membership";
49
+ preflight: "preflight";
50
+ }>;
51
+ export type FleetAdmissionPhase = z.infer<typeof FleetAdmissionPhaseSchema>;
52
+ /**
53
+ * Whose move the admission waits for.
54
+ *
55
+ * awaiting-operator an operator `apply` would act now
56
+ * awaiting-credentials the node is a member; run node `enroll prepare`, then apply with its digests
57
+ * awaiting-node every broker admits it; run node `enroll apply`, then apply again. In a
58
+ * withdrawal: the node is still connected; stop its agent, then withdraw again
59
+ * ready the node is an ordinary member of the fleet
60
+ * withdrawn nothing of this admission is left: no admission on a broker, no membership
61
+ * it added, no row of the operator's inventory
62
+ */
63
+ export declare const FleetAdmissionStatusSchema: z.ZodEnum<{
64
+ "awaiting-credentials": "awaiting-credentials";
65
+ "awaiting-node": "awaiting-node";
66
+ "awaiting-operator": "awaiting-operator";
67
+ ready: "ready";
68
+ withdrawn: "withdrawn";
69
+ }>;
70
+ export type FleetAdmissionStatus = z.infer<typeof FleetAdmissionStatusSchema>;
71
+ export declare const FleetAdmissionCodeSchema: z.ZodEnum<{
72
+ "admission-failed": "admission-failed";
73
+ "artifact-unpublished": "artifact-unpublished";
74
+ "broker-unavailable": "broker-unavailable";
75
+ busy: "busy";
76
+ "credential-conflict": "credential-conflict";
77
+ "grant-conflict": "grant-conflict";
78
+ "invalid-request": "invalid-request";
79
+ "io-failed": "io-failed";
80
+ "manifest-unpublished": "manifest-unpublished";
81
+ "namespace-conflict": "namespace-conflict";
82
+ "node-active": "node-active";
83
+ "platform-unsupported": "platform-unsupported";
84
+ "policy-unaligned": "policy-unaligned";
85
+ "publication-failed": "publication-failed";
86
+ "reach-failed": "reach-failed";
87
+ "record-failed": "record-failed";
88
+ "release-unfinished": "release-unfinished";
89
+ "request-conflict": "request-conflict";
90
+ "state-invalid": "state-invalid";
91
+ "version-mismatch": "version-mismatch";
92
+ }>;
93
+ export type FleetAdmissionCode = z.infer<typeof FleetAdmissionCodeSchema>;
94
+ export declare const FleetAdmissionFailureSchema: z.ZodObject<{
95
+ code: z.ZodEnum<{
96
+ "admission-failed": "admission-failed";
97
+ "artifact-unpublished": "artifact-unpublished";
98
+ "broker-unavailable": "broker-unavailable";
99
+ busy: "busy";
100
+ "credential-conflict": "credential-conflict";
101
+ "grant-conflict": "grant-conflict";
102
+ "invalid-request": "invalid-request";
103
+ "io-failed": "io-failed";
104
+ "manifest-unpublished": "manifest-unpublished";
105
+ "namespace-conflict": "namespace-conflict";
106
+ "node-active": "node-active";
107
+ "platform-unsupported": "platform-unsupported";
108
+ "policy-unaligned": "policy-unaligned";
109
+ "publication-failed": "publication-failed";
110
+ "reach-failed": "reach-failed";
111
+ "record-failed": "record-failed";
112
+ "release-unfinished": "release-unfinished";
113
+ "request-conflict": "request-conflict";
114
+ "state-invalid": "state-invalid";
115
+ "version-mismatch": "version-mismatch";
116
+ }>;
117
+ phase: z.ZodEnum<{
118
+ activation: "activation";
119
+ admission: "admission";
120
+ inventory: "inventory";
121
+ membership: "membership";
122
+ preflight: "preflight";
123
+ }>;
124
+ broker: z.ZodNullable<z.ZodString>;
125
+ at: z.ZodISODateTime;
126
+ }, z.core.$strict>;
127
+ export type FleetAdmissionFailure = z.infer<typeof FleetAdmissionFailureSchema>;
128
+ /**
129
+ * Exactly what the operation changes: the manifest entries it adds, or in a withdrawal takes back,
130
+ * and the operator's own records by name.
131
+ */
132
+ export declare const FleetAdmissionDeltaSchema: z.ZodObject<{
133
+ manifest: z.ZodObject<{
134
+ members: z.ZodRecord<z.ZodString, z.ZodObject<{
135
+ copy: z.ZodEnum<{
136
+ full: "full";
137
+ own: "own";
138
+ }>;
139
+ }, z.core.$strict>>;
140
+ serviceNamespaces: z.ZodRecord<z.ZodString, z.ZodArray<z.ZodString>>;
141
+ topicNamespaces: z.ZodRecord<z.ZodString, z.ZodObject<{
142
+ subscribers: z.ZodArray<z.ZodString>;
143
+ maxTopics: z.ZodNumber;
144
+ maxRetainedBytes: z.ZodOptional<z.ZodNumber>;
145
+ producer: z.ZodString;
146
+ }, z.core.$strict>>;
147
+ }, z.core.$strict>;
148
+ records: z.ZodArray<z.ZodObject<{
149
+ record: z.ZodString;
150
+ change: z.ZodEnum<{
151
+ add: "add";
152
+ remove: "remove";
153
+ replace: "replace";
154
+ }>;
155
+ value: z.ZodUnknown;
156
+ }, z.core.$strict>>;
157
+ }, z.core.$strict>;
158
+ export type FleetAdmissionDelta = z.infer<typeof FleetAdmissionDeltaSchema>;
159
+ /** The node request fields the operator owns; the orchestrator adds the delivered source, owner and proof. */
160
+ export declare const FleetAdmissionNodeRequestSchema: z.ZodObject<{
161
+ nodeId: z.ZodString;
162
+ expectedVersion: z.ZodString;
163
+ config: z.ZodString;
164
+ brokers: z.ZodArray<z.ZodObject<{
165
+ id: z.ZodString;
166
+ url: z.ZodString;
167
+ }, z.core.$strict>>;
168
+ agentSocket: z.ZodString;
169
+ supervisor: z.ZodObject<{
170
+ kind: z.ZodLiteral<"systemd">;
171
+ scope: z.ZodEnum<{
172
+ system: "system";
173
+ user: "user";
174
+ }>;
175
+ bun: z.ZodString;
176
+ unit: z.ZodOptional<z.ZodString>;
177
+ artifact: z.ZodObject<{
178
+ destination: z.ZodString;
179
+ sha256: z.ZodString;
180
+ }, z.core.$strict>;
181
+ }, z.core.$strict>;
182
+ }, z.core.$strict>;
183
+ export type FleetAdmissionNodeRequest = z.infer<typeof FleetAdmissionNodeRequestSchema>;
184
+ export declare const FleetAdmissionResultSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
185
+ v: z.ZodLiteral<1>;
186
+ requestId: z.ZodNullable<z.ZodUUID>;
187
+ nodeId: z.ZodNullable<z.ZodString>;
188
+ operation: z.ZodNullable<z.ZodEnum<{
189
+ apply: "apply";
190
+ plan: "plan";
191
+ status: "status";
192
+ withdraw: "withdraw";
193
+ }>>;
194
+ observedAt: z.ZodISODateTime;
195
+ completed: z.ZodArray<z.ZodEnum<{
196
+ activation: "activation";
197
+ admission: "admission";
198
+ inventory: "inventory";
199
+ membership: "membership";
200
+ preflight: "preflight";
201
+ }>>;
202
+ firstFailure: z.ZodNullable<z.ZodObject<{
203
+ code: z.ZodEnum<{
204
+ "admission-failed": "admission-failed";
205
+ "artifact-unpublished": "artifact-unpublished";
206
+ "broker-unavailable": "broker-unavailable";
207
+ busy: "busy";
208
+ "credential-conflict": "credential-conflict";
209
+ "grant-conflict": "grant-conflict";
210
+ "invalid-request": "invalid-request";
211
+ "io-failed": "io-failed";
212
+ "manifest-unpublished": "manifest-unpublished";
213
+ "namespace-conflict": "namespace-conflict";
214
+ "node-active": "node-active";
215
+ "platform-unsupported": "platform-unsupported";
216
+ "policy-unaligned": "policy-unaligned";
217
+ "publication-failed": "publication-failed";
218
+ "reach-failed": "reach-failed";
219
+ "record-failed": "record-failed";
220
+ "release-unfinished": "release-unfinished";
221
+ "request-conflict": "request-conflict";
222
+ "state-invalid": "state-invalid";
223
+ "version-mismatch": "version-mismatch";
224
+ }>;
225
+ phase: z.ZodEnum<{
226
+ activation: "activation";
227
+ admission: "admission";
228
+ inventory: "inventory";
229
+ membership: "membership";
230
+ preflight: "preflight";
231
+ }>;
232
+ broker: z.ZodNullable<z.ZodString>;
233
+ at: z.ZodISODateTime;
234
+ }, z.core.$strict>>;
235
+ unrecorded: z.ZodArray<z.ZodString>;
236
+ status: z.ZodLiteral<"failed">;
237
+ failure: z.ZodObject<{
238
+ code: z.ZodEnum<{
239
+ "admission-failed": "admission-failed";
240
+ "artifact-unpublished": "artifact-unpublished";
241
+ "broker-unavailable": "broker-unavailable";
242
+ busy: "busy";
243
+ "credential-conflict": "credential-conflict";
244
+ "grant-conflict": "grant-conflict";
245
+ "invalid-request": "invalid-request";
246
+ "io-failed": "io-failed";
247
+ "manifest-unpublished": "manifest-unpublished";
248
+ "namespace-conflict": "namespace-conflict";
249
+ "node-active": "node-active";
250
+ "platform-unsupported": "platform-unsupported";
251
+ "policy-unaligned": "policy-unaligned";
252
+ "publication-failed": "publication-failed";
253
+ "reach-failed": "reach-failed";
254
+ "record-failed": "record-failed";
255
+ "release-unfinished": "release-unfinished";
256
+ "request-conflict": "request-conflict";
257
+ "state-invalid": "state-invalid";
258
+ "version-mismatch": "version-mismatch";
259
+ }>;
260
+ phase: z.ZodEnum<{
261
+ activation: "activation";
262
+ admission: "admission";
263
+ inventory: "inventory";
264
+ membership: "membership";
265
+ preflight: "preflight";
266
+ }>;
267
+ broker: z.ZodNullable<z.ZodString>;
268
+ at: z.ZodISODateTime;
269
+ }, z.core.$strict>;
270
+ }, z.core.$strict>, z.ZodObject<{
271
+ v: z.ZodLiteral<1>;
272
+ requestId: z.ZodNullable<z.ZodUUID>;
273
+ nodeId: z.ZodNullable<z.ZodString>;
274
+ operation: z.ZodNullable<z.ZodEnum<{
275
+ apply: "apply";
276
+ plan: "plan";
277
+ status: "status";
278
+ withdraw: "withdraw";
279
+ }>>;
280
+ observedAt: z.ZodISODateTime;
281
+ completed: z.ZodArray<z.ZodEnum<{
282
+ activation: "activation";
283
+ admission: "admission";
284
+ inventory: "inventory";
285
+ membership: "membership";
286
+ preflight: "preflight";
287
+ }>>;
288
+ firstFailure: z.ZodNullable<z.ZodObject<{
289
+ code: z.ZodEnum<{
290
+ "admission-failed": "admission-failed";
291
+ "artifact-unpublished": "artifact-unpublished";
292
+ "broker-unavailable": "broker-unavailable";
293
+ busy: "busy";
294
+ "credential-conflict": "credential-conflict";
295
+ "grant-conflict": "grant-conflict";
296
+ "invalid-request": "invalid-request";
297
+ "io-failed": "io-failed";
298
+ "manifest-unpublished": "manifest-unpublished";
299
+ "namespace-conflict": "namespace-conflict";
300
+ "node-active": "node-active";
301
+ "platform-unsupported": "platform-unsupported";
302
+ "policy-unaligned": "policy-unaligned";
303
+ "publication-failed": "publication-failed";
304
+ "reach-failed": "reach-failed";
305
+ "record-failed": "record-failed";
306
+ "release-unfinished": "release-unfinished";
307
+ "request-conflict": "request-conflict";
308
+ "state-invalid": "state-invalid";
309
+ "version-mismatch": "version-mismatch";
310
+ }>;
311
+ phase: z.ZodEnum<{
312
+ activation: "activation";
313
+ admission: "admission";
314
+ inventory: "inventory";
315
+ membership: "membership";
316
+ preflight: "preflight";
317
+ }>;
318
+ broker: z.ZodNullable<z.ZodString>;
319
+ at: z.ZodISODateTime;
320
+ }, z.core.$strict>>;
321
+ unrecorded: z.ZodArray<z.ZodString>;
322
+ status: z.ZodEnum<{
323
+ "awaiting-credentials": "awaiting-credentials";
324
+ "awaiting-node": "awaiting-node";
325
+ "awaiting-operator": "awaiting-operator";
326
+ ready: "ready";
327
+ withdrawn: "withdrawn";
328
+ }>;
329
+ phase: z.ZodNullable<z.ZodEnum<{
330
+ activation: "activation";
331
+ admission: "admission";
332
+ inventory: "inventory";
333
+ membership: "membership";
334
+ preflight: "preflight";
335
+ }>>;
336
+ waiting: z.ZodArray<z.ZodString>;
337
+ delta: z.ZodObject<{
338
+ manifest: z.ZodObject<{
339
+ members: z.ZodRecord<z.ZodString, z.ZodObject<{
340
+ copy: z.ZodEnum<{
341
+ full: "full";
342
+ own: "own";
343
+ }>;
344
+ }, z.core.$strict>>;
345
+ serviceNamespaces: z.ZodRecord<z.ZodString, z.ZodArray<z.ZodString>>;
346
+ topicNamespaces: z.ZodRecord<z.ZodString, z.ZodObject<{
347
+ subscribers: z.ZodArray<z.ZodString>;
348
+ maxTopics: z.ZodNumber;
349
+ maxRetainedBytes: z.ZodOptional<z.ZodNumber>;
350
+ producer: z.ZodString;
351
+ }, z.core.$strict>>;
352
+ }, z.core.$strict>;
353
+ records: z.ZodArray<z.ZodObject<{
354
+ record: z.ZodString;
355
+ change: z.ZodEnum<{
356
+ add: "add";
357
+ remove: "remove";
358
+ replace: "replace";
359
+ }>;
360
+ value: z.ZodUnknown;
361
+ }, z.core.$strict>>;
362
+ }, z.core.$strict>;
363
+ node: z.ZodNullable<z.ZodObject<{
364
+ request: z.ZodObject<{
365
+ nodeId: z.ZodString;
366
+ expectedVersion: z.ZodString;
367
+ config: z.ZodString;
368
+ brokers: z.ZodArray<z.ZodObject<{
369
+ id: z.ZodString;
370
+ url: z.ZodString;
371
+ }, z.core.$strict>>;
372
+ agentSocket: z.ZodString;
373
+ supervisor: z.ZodObject<{
374
+ kind: z.ZodLiteral<"systemd">;
375
+ scope: z.ZodEnum<{
376
+ system: "system";
377
+ user: "user";
378
+ }>;
379
+ bun: z.ZodString;
380
+ unit: z.ZodOptional<z.ZodString>;
381
+ artifact: z.ZodObject<{
382
+ destination: z.ZodString;
383
+ sha256: z.ZodString;
384
+ }, z.core.$strict>;
385
+ }, z.core.$strict>;
386
+ }, z.core.$strict>;
387
+ delivery: z.ZodObject<{
388
+ material: z.ZodObject<{
389
+ trust: z.ZodArray<z.ZodObject<{
390
+ id: z.ZodString;
391
+ publicKey: z.ZodString;
392
+ }, z.core.$strict>>;
393
+ bundle: z.ZodObject<{
394
+ format: z.ZodLiteral<"stitchwire.fleet-bundle">;
395
+ serial: z.ZodNumber;
396
+ full: z.ZodNullable<z.ZodObject<{
397
+ keyId: z.ZodString;
398
+ payload: z.ZodString;
399
+ signature: z.ZodString;
400
+ }, z.core.$strict>>;
401
+ slices: z.ZodRecord<z.ZodString, z.ZodObject<{
402
+ keyId: z.ZodString;
403
+ payload: z.ZodString;
404
+ signature: z.ZodString;
405
+ }, z.core.$strict>>;
406
+ }, z.core.$strict>;
407
+ }, z.core.$strict>;
408
+ runtime: z.ZodString;
409
+ }, z.core.$strict>;
410
+ }, z.core.$strict>>;
411
+ }, z.core.$strict>], "status">;
412
+ export type FleetAdmissionResult = z.infer<typeof FleetAdmissionResultSchema>;
413
+ export {};
@@ -0,0 +1,29 @@
1
+ import { z } from 'zod';
2
+ /** Refusals every enrollment operation shares, whichever side executes it. */
3
+ export declare const EnrollmentCommonCodeSchema: z.ZodEnum<{
4
+ "broker-unavailable": "broker-unavailable";
5
+ busy: "busy";
6
+ "credential-conflict": "credential-conflict";
7
+ "invalid-request": "invalid-request";
8
+ "io-failed": "io-failed";
9
+ "request-conflict": "request-conflict";
10
+ "state-invalid": "state-invalid";
11
+ "version-mismatch": "version-mismatch";
12
+ }>;
13
+ /**
14
+ * What every operation result says before its own outcome: the request and operation it answers,
15
+ * when it was observed, and what the request's journal holds across its runs.
16
+ */
17
+ export declare function resultShell<Operation extends z.ZodType, Phase extends z.ZodType, Failure extends z.ZodType>(operation: Operation, phase: Phase, failure: Failure): {
18
+ v: z.ZodLiteral<1>;
19
+ /** Null when the request could not be read. */
20
+ requestId: z.ZodNullable<z.ZodUUID>;
21
+ nodeId: z.ZodNullable<z.ZodString>;
22
+ /** Null when the command named no valid operation. */
23
+ operation: z.ZodNullable<Operation>;
24
+ observedAt: z.ZodISODateTime;
25
+ /** Phases this request completed, from its journal; a read-only operation reports none. */
26
+ completed: z.ZodArray<Phase>;
27
+ /** The first refusal this request met; a later success keeps it as recovery evidence. */
28
+ firstFailure: z.ZodNullable<Failure>;
29
+ };