@aeolus-fleet/common 0.29.2 → 0.30.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/dist/header/command-palette.d.ts +2 -0
- package/dist/header/command-palette.js +2 -1
- package/dist/header/command-palette.js.map +1 -1
- package/dist/rules/index.d.ts +2 -0
- package/dist/rules/index.js +2 -0
- package/dist/rules/index.js.map +1 -1
- package/dist/rules/page-size.d.ts +4 -0
- package/dist/rules/page-size.js +5 -0
- package/dist/rules/page-size.js.map +1 -0
- package/dist/rules/ship-filter.d.ts +102 -0
- package/dist/rules/ship-filter.js +99 -0
- package/dist/rules/ship-filter.js.map +1 -0
- package/dist/schemas/crew-request.d.ts +18 -0
- package/dist/schemas/crew-request.js +8 -0
- package/dist/schemas/crew-request.js.map +1 -1
- package/dist/schemas/delivery.d.ts +3 -1
- package/dist/schemas/delivery.js +6 -2
- package/dist/schemas/delivery.js.map +1 -1
- package/dist/schemas/fleet.d.ts +149 -3
- package/dist/schemas/fleet.js +25 -2
- package/dist/schemas/fleet.js.map +1 -1
- package/dist/schemas/health.d.ts +91 -0
- package/dist/schemas/health.js +17 -0
- package/dist/schemas/health.js.map +1 -1
- package/dist/schemas/history.d.ts +148 -130
- package/dist/schemas/history.js +10 -5
- package/dist/schemas/history.js.map +1 -1
- package/dist/schemas/index.d.ts +2 -0
- package/dist/schemas/index.js +2 -0
- package/dist/schemas/index.js.map +1 -1
- package/dist/schemas/label.d.ts +242 -6
- package/dist/schemas/label.js +81 -4
- package/dist/schemas/label.js.map +1 -1
- package/dist/schemas/needs-attention.d.ts +48 -30
- package/dist/schemas/needs-attention.js +8 -4
- package/dist/schemas/needs-attention.js.map +1 -1
- package/dist/schemas/network-rules-file.d.ts +301 -0
- package/dist/schemas/network-rules-file.js +97 -0
- package/dist/schemas/network-rules-file.js.map +1 -0
- package/dist/schemas/network.d.ts +72 -66
- package/dist/schemas/network.js +5 -4
- package/dist/schemas/network.js.map +1 -1
- package/dist/schemas/operator-inbox.d.ts +59 -36
- package/dist/schemas/operator-inbox.js +15 -4
- package/dist/schemas/operator-inbox.js.map +1 -1
- package/dist/schemas/page.d.ts +20 -0
- package/dist/schemas/page.js +20 -0
- package/dist/schemas/page.js.map +1 -0
- package/dist/schemas/question.d.ts +2 -2
- package/dist/schemas/question.js +2 -2
- package/package.json +1 -1
package/dist/schemas/index.d.ts
CHANGED
|
@@ -15,8 +15,10 @@ export * from './label.js';
|
|
|
15
15
|
export * from './message.js';
|
|
16
16
|
export * from './needs-attention.js';
|
|
17
17
|
export * from './network.js';
|
|
18
|
+
export * from './network-rules-file.js';
|
|
18
19
|
export * from './notice.js';
|
|
19
20
|
export * from './operator-inbox.js';
|
|
21
|
+
export * from './page.js';
|
|
20
22
|
export * from './ping.js';
|
|
21
23
|
export * from './question.js';
|
|
22
24
|
export * from './report.js';
|
package/dist/schemas/index.js
CHANGED
|
@@ -15,8 +15,10 @@ export * from './label.js';
|
|
|
15
15
|
export * from './message.js';
|
|
16
16
|
export * from './needs-attention.js';
|
|
17
17
|
export * from './network.js';
|
|
18
|
+
export * from './network-rules-file.js';
|
|
18
19
|
export * from './notice.js';
|
|
19
20
|
export * from './operator-inbox.js';
|
|
21
|
+
export * from './page.js';
|
|
20
22
|
export * from './ping.js';
|
|
21
23
|
export * from './question.js';
|
|
22
24
|
export * from './report.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/schemas/index.ts"],"names":[],"mappings":"AAAA,cAAc,oBAAoB,CAAC;AACnC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,oBAAoB,CAAC;AACnC,cAAc,cAAc,CAAC;AAC7B,cAAc,mBAAmB,CAAC;AAClC,cAAc,eAAe,CAAC;AAC9B,cAAc,YAAY,CAAC;AAC3B,cAAc,aAAa,CAAC;AAC5B,cAAc,YAAY,CAAC;AAC3B,cAAc,aAAa,CAAC;AAC5B,cAAc,cAAc,CAAC;AAC7B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AC/B,cAAc,aAAa,CAAC;AAC5B,cAAc,oBAAoB,CAAC"}
|
package/dist/schemas/label.d.ts
CHANGED
|
@@ -23,10 +23,243 @@ export declare const carriedLabelSchema: z.ZodObject<{
|
|
|
23
23
|
valueId: z.ZodType<`lbv_${string}`, unknown, z.core.$ZodTypeInternals<`lbv_${string}`, unknown>>;
|
|
24
24
|
value: z.ZodString;
|
|
25
25
|
}, z.core.$strip>;
|
|
26
|
-
/**
|
|
26
|
+
/**
|
|
27
|
+
* What sort of agent crews a ship (the overview's Kind filter, idea #401):
|
|
28
|
+
* the console (argo and the viewer), a ship a console plugin runs as, a
|
|
29
|
+
* machine's trierarch, or what its crewing session's harness says.
|
|
30
|
+
*/
|
|
31
|
+
export declare const AGENT_KINDS: readonly ["console", "claudeCode", "codex", "trierarch", "plugin", "other"];
|
|
32
|
+
export declare const agentKindSchema: z.ZodEnum<{
|
|
33
|
+
plugin: "plugin";
|
|
34
|
+
console: "console";
|
|
35
|
+
trierarch: "trierarch";
|
|
36
|
+
claudeCode: "claudeCode";
|
|
37
|
+
codex: "codex";
|
|
38
|
+
other: "other";
|
|
39
|
+
}>;
|
|
40
|
+
export type AgentKind = z.infer<typeof agentKindSchema>;
|
|
41
|
+
/**
|
|
42
|
+
* Which ships `fleet.list` and the counts read select, every filter combined
|
|
43
|
+
* with AND: the search text its name or type holds, in any case; its exact
|
|
44
|
+
* name; any of the
|
|
45
|
+
* statuses, types, ship kinds, crew request keys, ship ids and agent kinds picked; and
|
|
46
|
+
* every label value id given (exact matches, decision 0031). A filter left
|
|
47
|
+
* out selects every ship. `pluginShipIds` names the ships the console's
|
|
48
|
+
* plugins run as, which the kind filter counts as plugin.
|
|
49
|
+
*/
|
|
50
|
+
export declare const fleetListFilterSchema: z.ZodObject<{
|
|
51
|
+
query: z.ZodOptional<z.ZodString>;
|
|
52
|
+
name: z.ZodOptional<z.ZodString>;
|
|
53
|
+
status: z.ZodOptional<z.ZodArray<z.ZodEnum<{
|
|
54
|
+
awaitingCrew: "awaitingCrew";
|
|
55
|
+
crewed: "crewed";
|
|
56
|
+
retired: "retired";
|
|
57
|
+
}>>>;
|
|
58
|
+
type: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
59
|
+
shipKind: z.ZodOptional<z.ZodArray<z.ZodEnum<{
|
|
60
|
+
operator: "operator";
|
|
61
|
+
agent: "agent";
|
|
62
|
+
viewer: "viewer";
|
|
63
|
+
person: "person";
|
|
64
|
+
app: "app";
|
|
65
|
+
plugin: "plugin";
|
|
66
|
+
}>>>;
|
|
67
|
+
crewRequest: z.ZodOptional<z.ZodArray<z.ZodEnum<{
|
|
68
|
+
crewing: "crewing";
|
|
69
|
+
running: "running";
|
|
70
|
+
restarting: "restarting";
|
|
71
|
+
crashed: "crashed";
|
|
72
|
+
releasing: "releasing";
|
|
73
|
+
none: "none";
|
|
74
|
+
needsCrew: "needsCrew";
|
|
75
|
+
crewedByHand: "crewedByHand";
|
|
76
|
+
}>>>;
|
|
77
|
+
assignedTo: z.ZodOptional<z.ZodArray<z.ZodType<`shp_${string}`, unknown, z.core.$ZodTypeInternals<`shp_${string}`, unknown>>>>;
|
|
78
|
+
needsCrew: z.ZodOptional<z.ZodEnum<{
|
|
79
|
+
withTrierarchs: "withTrierarchs";
|
|
80
|
+
withoutTrierarchs: "withoutTrierarchs";
|
|
81
|
+
}>>;
|
|
82
|
+
valueIds: z.ZodOptional<z.ZodArray<z.ZodType<`lbv_${string}`, unknown, z.core.$ZodTypeInternals<`lbv_${string}`, unknown>>>>;
|
|
83
|
+
shipIds: z.ZodOptional<z.ZodArray<z.ZodType<`shp_${string}`, unknown, z.core.$ZodTypeInternals<`shp_${string}`, unknown>>>>;
|
|
84
|
+
kind: z.ZodOptional<z.ZodArray<z.ZodEnum<{
|
|
85
|
+
plugin: "plugin";
|
|
86
|
+
console: "console";
|
|
87
|
+
trierarch: "trierarch";
|
|
88
|
+
claudeCode: "claudeCode";
|
|
89
|
+
codex: "codex";
|
|
90
|
+
other: "other";
|
|
91
|
+
}>>>;
|
|
92
|
+
pluginShipIds: z.ZodOptional<z.ZodArray<z.ZodType<`shp_${string}`, unknown, z.core.$ZodTypeInternals<`shp_${string}`, unknown>>>>;
|
|
93
|
+
}, z.core.$strip>;
|
|
94
|
+
/** Input of `fleet.shipCounts`: count only the ships the fleet snapshot's filter selects; none counts every ship. */
|
|
95
|
+
export declare const shipCountsInputSchema: z.ZodOptional<z.ZodObject<{
|
|
96
|
+
filter: z.ZodOptional<z.ZodObject<{
|
|
97
|
+
query: z.ZodOptional<z.ZodString>;
|
|
98
|
+
name: z.ZodOptional<z.ZodString>;
|
|
99
|
+
status: z.ZodOptional<z.ZodArray<z.ZodEnum<{
|
|
100
|
+
awaitingCrew: "awaitingCrew";
|
|
101
|
+
crewed: "crewed";
|
|
102
|
+
retired: "retired";
|
|
103
|
+
}>>>;
|
|
104
|
+
type: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
105
|
+
shipKind: z.ZodOptional<z.ZodArray<z.ZodEnum<{
|
|
106
|
+
operator: "operator";
|
|
107
|
+
agent: "agent";
|
|
108
|
+
viewer: "viewer";
|
|
109
|
+
person: "person";
|
|
110
|
+
app: "app";
|
|
111
|
+
plugin: "plugin";
|
|
112
|
+
}>>>;
|
|
113
|
+
crewRequest: z.ZodOptional<z.ZodArray<z.ZodEnum<{
|
|
114
|
+
crewing: "crewing";
|
|
115
|
+
running: "running";
|
|
116
|
+
restarting: "restarting";
|
|
117
|
+
crashed: "crashed";
|
|
118
|
+
releasing: "releasing";
|
|
119
|
+
none: "none";
|
|
120
|
+
needsCrew: "needsCrew";
|
|
121
|
+
crewedByHand: "crewedByHand";
|
|
122
|
+
}>>>;
|
|
123
|
+
assignedTo: z.ZodOptional<z.ZodArray<z.ZodType<`shp_${string}`, unknown, z.core.$ZodTypeInternals<`shp_${string}`, unknown>>>>;
|
|
124
|
+
needsCrew: z.ZodOptional<z.ZodEnum<{
|
|
125
|
+
withTrierarchs: "withTrierarchs";
|
|
126
|
+
withoutTrierarchs: "withoutTrierarchs";
|
|
127
|
+
}>>;
|
|
128
|
+
valueIds: z.ZodOptional<z.ZodArray<z.ZodType<`lbv_${string}`, unknown, z.core.$ZodTypeInternals<`lbv_${string}`, unknown>>>>;
|
|
129
|
+
shipIds: z.ZodOptional<z.ZodArray<z.ZodType<`shp_${string}`, unknown, z.core.$ZodTypeInternals<`shp_${string}`, unknown>>>>;
|
|
130
|
+
kind: z.ZodOptional<z.ZodArray<z.ZodEnum<{
|
|
131
|
+
plugin: "plugin";
|
|
132
|
+
console: "console";
|
|
133
|
+
trierarch: "trierarch";
|
|
134
|
+
claudeCode: "claudeCode";
|
|
135
|
+
codex: "codex";
|
|
136
|
+
other: "other";
|
|
137
|
+
}>>>;
|
|
138
|
+
pluginShipIds: z.ZodOptional<z.ZodArray<z.ZodType<`shp_${string}`, unknown, z.core.$ZodTypeInternals<`shp_${string}`, unknown>>>>;
|
|
139
|
+
}, z.core.$strip>>;
|
|
140
|
+
}, z.core.$strip>>;
|
|
141
|
+
/** Input of `fleet.shipTypes`: the types of the ships of any of these statuses; none asks the active ships. */
|
|
142
|
+
export declare const shipTypesInputSchema: z.ZodOptional<z.ZodObject<{
|
|
143
|
+
status: z.ZodOptional<z.ZodArray<z.ZodEnum<{
|
|
144
|
+
awaitingCrew: "awaitingCrew";
|
|
145
|
+
crewed: "crewed";
|
|
146
|
+
retired: "retired";
|
|
147
|
+
}>>>;
|
|
148
|
+
}, z.core.$strip>>;
|
|
149
|
+
/** Output of `fleet.shipTypes`: each type once, sorted. */
|
|
150
|
+
export declare const shipTypesOutputSchema: z.ZodArray<z.ZodString>;
|
|
151
|
+
/** The columns `fleet.list` sorts by, as the overview shows them. */
|
|
152
|
+
export declare const SHIP_SORT_COLUMNS: readonly ["ship", "status", "report", "runsOn", "seen", "requested"];
|
|
153
|
+
export type ShipSortColumn = (typeof SHIP_SORT_COLUMNS)[number];
|
|
154
|
+
/**
|
|
155
|
+
* The order of `fleet.list`: a column, A to Z or Z to A (Seen: the most
|
|
156
|
+
* recent first when ascending), ships with nothing in the column last either
|
|
157
|
+
* way, ties by name. Without one: argo first, then by name.
|
|
158
|
+
*/
|
|
159
|
+
export declare const fleetListSortSchema: z.ZodObject<{
|
|
160
|
+
column: z.ZodEnum<{
|
|
161
|
+
ship: "ship";
|
|
162
|
+
status: "status";
|
|
163
|
+
report: "report";
|
|
164
|
+
runsOn: "runsOn";
|
|
165
|
+
seen: "seen";
|
|
166
|
+
requested: "requested";
|
|
167
|
+
}>;
|
|
168
|
+
direction: z.ZodEnum<{
|
|
169
|
+
ascending: "ascending";
|
|
170
|
+
descending: "descending";
|
|
171
|
+
}>;
|
|
172
|
+
}, z.core.$strip>;
|
|
173
|
+
/**
|
|
174
|
+
* Where a page of `fleet.list` starts: after the ship at this position in
|
|
175
|
+
* the order, by whether its sort value is empty, the value, its name and its
|
|
176
|
+
* id. The fleet answers it as an opaque cursor; only the fleet reads it.
|
|
177
|
+
*/
|
|
178
|
+
export declare const shipPositionSchema: z.ZodObject<{
|
|
179
|
+
isEmpty: z.ZodBoolean;
|
|
180
|
+
value: z.ZodString;
|
|
181
|
+
name: z.ZodString;
|
|
182
|
+
id: z.ZodType<`shp_${string}`, unknown, z.core.$ZodTypeInternals<`shp_${string}`, unknown>>;
|
|
183
|
+
}, z.core.$strip>;
|
|
184
|
+
export type ShipPosition = z.infer<typeof shipPositionSchema>;
|
|
185
|
+
/** A position as the opaque cursor fleet.list answers: its JSON in base64url. */
|
|
186
|
+
export declare function shipCursorOf(position: ShipPosition): string;
|
|
187
|
+
/** A cursor fleet.list answered, read back as its position. */
|
|
188
|
+
export declare const shipCursorSchema: z.ZodPipe<z.ZodPipe<z.ZodString, z.ZodTransform<unknown, string>>, z.ZodObject<{
|
|
189
|
+
isEmpty: z.ZodBoolean;
|
|
190
|
+
value: z.ZodString;
|
|
191
|
+
name: z.ZodString;
|
|
192
|
+
id: z.ZodType<`shp_${string}`, unknown, z.core.$ZodTypeInternals<`shp_${string}`, unknown>>;
|
|
193
|
+
}, z.core.$strip>>;
|
|
194
|
+
/** Input of `fleet.list`: the filter, the sort, and the page: the cursor it starts after and its size (decision 4 of the performance design). */
|
|
27
195
|
export declare const fleetListInputSchema: z.ZodOptional<z.ZodObject<{
|
|
196
|
+
cursor: z.ZodOptional<z.ZodPipe<z.ZodPipe<z.ZodString, z.ZodTransform<unknown, string>>, z.ZodObject<{
|
|
197
|
+
isEmpty: z.ZodBoolean;
|
|
198
|
+
value: z.ZodString;
|
|
199
|
+
name: z.ZodString;
|
|
200
|
+
id: z.ZodType<`shp_${string}`, unknown, z.core.$ZodTypeInternals<`shp_${string}`, unknown>>;
|
|
201
|
+
}, z.core.$strip>>>;
|
|
202
|
+
limit: z.ZodOptional<z.ZodInt>;
|
|
203
|
+
sort: z.ZodOptional<z.ZodObject<{
|
|
204
|
+
column: z.ZodEnum<{
|
|
205
|
+
ship: "ship";
|
|
206
|
+
status: "status";
|
|
207
|
+
report: "report";
|
|
208
|
+
runsOn: "runsOn";
|
|
209
|
+
seen: "seen";
|
|
210
|
+
requested: "requested";
|
|
211
|
+
}>;
|
|
212
|
+
direction: z.ZodEnum<{
|
|
213
|
+
ascending: "ascending";
|
|
214
|
+
descending: "descending";
|
|
215
|
+
}>;
|
|
216
|
+
}, z.core.$strip>>;
|
|
217
|
+
query: z.ZodOptional<z.ZodString>;
|
|
218
|
+
name: z.ZodOptional<z.ZodString>;
|
|
219
|
+
status: z.ZodOptional<z.ZodArray<z.ZodEnum<{
|
|
220
|
+
awaitingCrew: "awaitingCrew";
|
|
221
|
+
crewed: "crewed";
|
|
222
|
+
retired: "retired";
|
|
223
|
+
}>>>;
|
|
224
|
+
type: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
225
|
+
shipKind: z.ZodOptional<z.ZodArray<z.ZodEnum<{
|
|
226
|
+
operator: "operator";
|
|
227
|
+
agent: "agent";
|
|
228
|
+
viewer: "viewer";
|
|
229
|
+
person: "person";
|
|
230
|
+
app: "app";
|
|
231
|
+
plugin: "plugin";
|
|
232
|
+
}>>>;
|
|
233
|
+
crewRequest: z.ZodOptional<z.ZodArray<z.ZodEnum<{
|
|
234
|
+
crewing: "crewing";
|
|
235
|
+
running: "running";
|
|
236
|
+
restarting: "restarting";
|
|
237
|
+
crashed: "crashed";
|
|
238
|
+
releasing: "releasing";
|
|
239
|
+
none: "none";
|
|
240
|
+
needsCrew: "needsCrew";
|
|
241
|
+
crewedByHand: "crewedByHand";
|
|
242
|
+
}>>>;
|
|
243
|
+
assignedTo: z.ZodOptional<z.ZodArray<z.ZodType<`shp_${string}`, unknown, z.core.$ZodTypeInternals<`shp_${string}`, unknown>>>>;
|
|
244
|
+
needsCrew: z.ZodOptional<z.ZodEnum<{
|
|
245
|
+
withTrierarchs: "withTrierarchs";
|
|
246
|
+
withoutTrierarchs: "withoutTrierarchs";
|
|
247
|
+
}>>;
|
|
28
248
|
valueIds: z.ZodOptional<z.ZodArray<z.ZodType<`lbv_${string}`, unknown, z.core.$ZodTypeInternals<`lbv_${string}`, unknown>>>>;
|
|
249
|
+
shipIds: z.ZodOptional<z.ZodArray<z.ZodType<`shp_${string}`, unknown, z.core.$ZodTypeInternals<`shp_${string}`, unknown>>>>;
|
|
250
|
+
kind: z.ZodOptional<z.ZodArray<z.ZodEnum<{
|
|
251
|
+
plugin: "plugin";
|
|
252
|
+
console: "console";
|
|
253
|
+
trierarch: "trierarch";
|
|
254
|
+
claudeCode: "claudeCode";
|
|
255
|
+
codex: "codex";
|
|
256
|
+
other: "other";
|
|
257
|
+
}>>>;
|
|
258
|
+
pluginShipIds: z.ZodOptional<z.ZodArray<z.ZodType<`shp_${string}`, unknown, z.core.$ZodTypeInternals<`shp_${string}`, unknown>>>>;
|
|
29
259
|
}, z.core.$strip>>;
|
|
260
|
+
/** `fleet.list`'s filter and sort as a caller writes them, ids as text. */
|
|
261
|
+
export type FleetListFilter = z.input<typeof fleetListFilterSchema>;
|
|
262
|
+
export type FleetListSort = z.input<typeof fleetListSortSchema>;
|
|
30
263
|
/** Input of `fleet.defineLabel` (labels:define): the key, unique in the fleet, and its values. */
|
|
31
264
|
export declare const defineLabelInputSchema: z.ZodObject<{
|
|
32
265
|
key: z.ZodString;
|
|
@@ -103,14 +336,10 @@ export declare const listedLabelSchema: z.ZodObject<{
|
|
|
103
336
|
}, z.core.$strip>], "kind">;
|
|
104
337
|
}, z.core.$strip>;
|
|
105
338
|
export type ListedLabel = z.infer<typeof listedLabelSchema>;
|
|
106
|
-
/** Output of `fleet.labels` (fleet:read): the fleet's labels by key. */
|
|
339
|
+
/** Output of `fleet.labels` (fleet:read): the fleet's labels by key, each with how many active ships in the caller's read reach carry any of its values, and each value with how many carry it. */
|
|
107
340
|
export declare const labelsOutputSchema: z.ZodArray<z.ZodObject<{
|
|
108
341
|
id: z.ZodType<`lbl_${string}`, unknown, z.core.$ZodTypeInternals<`lbl_${string}`, unknown>>;
|
|
109
342
|
key: z.ZodString;
|
|
110
|
-
values: z.ZodArray<z.ZodObject<{
|
|
111
|
-
id: z.ZodType<`lbv_${string}`, unknown, z.core.$ZodTypeInternals<`lbv_${string}`, unknown>>;
|
|
112
|
-
value: z.ZodString;
|
|
113
|
-
}, z.core.$strip>>;
|
|
114
343
|
owner: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
115
344
|
kind: z.ZodLiteral<"ship">;
|
|
116
345
|
id: z.ZodType<`shp_${string}`, unknown, z.core.$ZodTypeInternals<`shp_${string}`, unknown>>;
|
|
@@ -118,4 +347,11 @@ export declare const labelsOutputSchema: z.ZodArray<z.ZodObject<{
|
|
|
118
347
|
}, z.core.$strip>, z.ZodObject<{
|
|
119
348
|
kind: z.ZodLiteral<"installation">;
|
|
120
349
|
}, z.core.$strip>], "kind">;
|
|
350
|
+
shipCount: z.ZodInt;
|
|
351
|
+
values: z.ZodArray<z.ZodObject<{
|
|
352
|
+
id: z.ZodType<`lbv_${string}`, unknown, z.core.$ZodTypeInternals<`lbv_${string}`, unknown>>;
|
|
353
|
+
value: z.ZodString;
|
|
354
|
+
shipCount: z.ZodInt;
|
|
355
|
+
}, z.core.$strip>>;
|
|
121
356
|
}, z.core.$strip>>;
|
|
357
|
+
export type CountedLabel = z.infer<typeof labelsOutputSchema>[number];
|
package/dist/schemas/label.js
CHANGED
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
+
import { shipKindSchema, shipStatusSchema } from '../fleet/index.js';
|
|
2
3
|
import { idSchema } from '../ids/index.js';
|
|
4
|
+
import { crewRequestKeySchema } from './crew-request.js';
|
|
5
|
+
import { pageInputOf } from './page.js';
|
|
3
6
|
/**
|
|
4
7
|
* Labels (decision 0031): an owned vocabulary for selecting ships. A label is
|
|
5
8
|
* a key with a defined set of values, the label and each value with its own
|
|
@@ -21,8 +24,82 @@ const labelTextSchema = z.string();
|
|
|
21
24
|
export const labelValueSchema = z.object({ id: idSchema('labelValue'), value: z.string() });
|
|
22
25
|
/** One value a ship carries, with its label: ids and texts. */
|
|
23
26
|
export const carriedLabelSchema = z.object({ labelId: idSchema('label'), key: z.string(), valueId: idSchema('labelValue'), value: z.string() });
|
|
24
|
-
/**
|
|
25
|
-
|
|
27
|
+
/**
|
|
28
|
+
* What sort of agent crews a ship (the overview's Kind filter, idea #401):
|
|
29
|
+
* the console (argo and the viewer), a ship a console plugin runs as, a
|
|
30
|
+
* machine's trierarch, or what its crewing session's harness says.
|
|
31
|
+
*/
|
|
32
|
+
export const AGENT_KINDS = ['console', 'claudeCode', 'codex', 'trierarch', 'plugin', 'other'];
|
|
33
|
+
export const agentKindSchema = z.enum(AGENT_KINDS);
|
|
34
|
+
/**
|
|
35
|
+
* Which ships `fleet.list` and the counts read select, every filter combined
|
|
36
|
+
* with AND: the search text its name or type holds, in any case; its exact
|
|
37
|
+
* name; any of the
|
|
38
|
+
* statuses, types, ship kinds, crew request keys, ship ids and agent kinds picked; and
|
|
39
|
+
* every label value id given (exact matches, decision 0031). A filter left
|
|
40
|
+
* out selects every ship. `pluginShipIds` names the ships the console's
|
|
41
|
+
* plugins run as, which the kind filter counts as plugin.
|
|
42
|
+
*/
|
|
43
|
+
export const fleetListFilterSchema = z.object({
|
|
44
|
+
query: z.string().optional(),
|
|
45
|
+
name: z.string().optional(),
|
|
46
|
+
status: z.array(shipStatusSchema).optional(),
|
|
47
|
+
type: z.array(z.string()).optional(),
|
|
48
|
+
shipKind: z.array(shipKindSchema).optional(),
|
|
49
|
+
crewRequest: z.array(crewRequestKeySchema).optional(),
|
|
50
|
+
assignedTo: z.array(idSchema('ship')).optional(),
|
|
51
|
+
needsCrew: z.enum(['withTrierarchs', 'withoutTrierarchs']).optional(),
|
|
52
|
+
valueIds: z.array(idSchema('labelValue')).optional(),
|
|
53
|
+
shipIds: z.array(idSchema('ship')).optional(),
|
|
54
|
+
kind: z.array(agentKindSchema).optional(),
|
|
55
|
+
pluginShipIds: z.array(idSchema('ship')).optional(),
|
|
56
|
+
});
|
|
57
|
+
/** Input of `fleet.shipCounts`: count only the ships the fleet snapshot's filter selects; none counts every ship. */
|
|
58
|
+
export const shipCountsInputSchema = z.object({ filter: fleetListFilterSchema.optional() }).optional();
|
|
59
|
+
/** Input of `fleet.shipTypes`: the types of the ships of any of these statuses; none asks the active ships. */
|
|
60
|
+
export const shipTypesInputSchema = z.object({ status: z.array(shipStatusSchema).optional() }).optional();
|
|
61
|
+
/** Output of `fleet.shipTypes`: each type once, sorted. */
|
|
62
|
+
export const shipTypesOutputSchema = z.array(z.string());
|
|
63
|
+
/** The columns `fleet.list` sorts by, as the overview shows them. */
|
|
64
|
+
export const SHIP_SORT_COLUMNS = ['ship', 'status', 'report', 'runsOn', 'seen', 'requested'];
|
|
65
|
+
/**
|
|
66
|
+
* The order of `fleet.list`: a column, A to Z or Z to A (Seen: the most
|
|
67
|
+
* recent first when ascending), ships with nothing in the column last either
|
|
68
|
+
* way, ties by name. Without one: argo first, then by name.
|
|
69
|
+
*/
|
|
70
|
+
export const fleetListSortSchema = z.object({ column: z.enum(SHIP_SORT_COLUMNS), direction: z.enum(['ascending', 'descending']) });
|
|
71
|
+
/**
|
|
72
|
+
* Where a page of `fleet.list` starts: after the ship at this position in
|
|
73
|
+
* the order, by whether its sort value is empty, the value, its name and its
|
|
74
|
+
* id. The fleet answers it as an opaque cursor; only the fleet reads it.
|
|
75
|
+
*/
|
|
76
|
+
export const shipPositionSchema = z.object({ isEmpty: z.boolean(), value: z.string(), name: z.string(), id: idSchema('ship') });
|
|
77
|
+
/** The most characters a cursor may have: a position with a long report note fits. */
|
|
78
|
+
const SHIP_CURSOR_MAX_LENGTH = 4096;
|
|
79
|
+
/** A position as the opaque cursor fleet.list answers: its JSON in base64url. */
|
|
80
|
+
export function shipCursorOf(position) {
|
|
81
|
+
const bytes = new TextEncoder().encode(JSON.stringify(position));
|
|
82
|
+
return btoa(String.fromCharCode(...bytes)).replaceAll('+', '-').replaceAll('/', '_').replace(/=+$/, '');
|
|
83
|
+
}
|
|
84
|
+
function jsonOfCursor(cursor) {
|
|
85
|
+
try {
|
|
86
|
+
const binary = atob(cursor.replaceAll('-', '+').replaceAll('_', '/'));
|
|
87
|
+
return JSON.parse(new TextDecoder().decode(Uint8Array.from(binary, (character) => character.charCodeAt(0))));
|
|
88
|
+
}
|
|
89
|
+
catch {
|
|
90
|
+
return undefined;
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
/** A cursor fleet.list answered, read back as its position. */
|
|
94
|
+
export const shipCursorSchema = z
|
|
95
|
+
.string()
|
|
96
|
+
.max(SHIP_CURSOR_MAX_LENGTH)
|
|
97
|
+
.transform(jsonOfCursor)
|
|
98
|
+
.pipe(shipPositionSchema);
|
|
99
|
+
/** Input of `fleet.list`: the filter, the sort, and the page: the cursor it starts after and its size (decision 4 of the performance design). */
|
|
100
|
+
export const fleetListInputSchema = pageInputOf(shipCursorSchema)
|
|
101
|
+
.extend({ ...fleetListFilterSchema.shape, sort: fleetListSortSchema.optional() })
|
|
102
|
+
.optional();
|
|
26
103
|
/** Input of `fleet.defineLabel` (labels:define): the key, unique in the fleet, and its values. */
|
|
27
104
|
export const defineLabelInputSchema = z.object({ key: labelTextSchema, values: z.array(labelTextSchema) });
|
|
28
105
|
/** Output of `fleet.defineLabel`: the label's id and each value with its id. */
|
|
@@ -55,6 +132,6 @@ export const listedLabelSchema = z.object({
|
|
|
55
132
|
values: z.array(labelValueSchema),
|
|
56
133
|
owner: labelOwnerSchema,
|
|
57
134
|
});
|
|
58
|
-
/** Output of `fleet.labels` (fleet:read): the fleet's labels by key. */
|
|
59
|
-
export const labelsOutputSchema = z.array(listedLabelSchema);
|
|
135
|
+
/** Output of `fleet.labels` (fleet:read): the fleet's labels by key, each with how many active ships in the caller's read reach carry any of its values, and each value with how many carry it. */
|
|
136
|
+
export const labelsOutputSchema = z.array(listedLabelSchema.extend({ shipCount: z.int().min(0), values: z.array(labelValueSchema.extend({ shipCount: z.int().min(0) })) }));
|
|
60
137
|
//# sourceMappingURL=label.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"label.js","sourceRoot":"","sources":["../../src/schemas/label.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;
|
|
1
|
+
{"version":3,"file":"label.js","sourceRoot":"","sources":["../../src/schemas/label.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,cAAc,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AACrE,OAAO,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAC3C,OAAO,EAAE,oBAAoB,EAAE,MAAM,mBAAmB,CAAC;AACzD,OAAO,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AAExC;;;;;;GAMG;AAEH,OAAO,EAAE,uBAAuB,EAAE,oBAAoB,EAAE,MAAM,0BAA0B,CAAC;AAEzF,4CAA4C;A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,CAAC,CAAC,MAAM,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC,OAAO,CAAC,cAAc,CAAC,EAAE,CAAC;CAC9C,CAAC,CAAC;AAEH,wFAAwF;AACxF,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAC,CAAC,MAAM,CAAC;IACxC,EAAE,EAAE,QAAQ,CAAC,OAAO,CAAC;IACrB,GAAG,EAAE,CAAC,CAAC,MAAM,EAAE;IACf,MAAM,EAAE,CAAC,CAAC,KAAK,CAAC,gBAAgB,CAAC;IACjC,KAAK,EAAE,gBAAgB;CACxB,CAAC,CAAC;AAIH,mMAAmM;AACnM,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAAC,CAAC,KAAK,CACvC,iBAAiB,CAAC,MAAM,CAAC,EAAE,SAAS,EAAE,CAAC,CAAC,GAAG,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,CAAC,KAAK,CAAC,gBAAgB,CAAC,MAAM,CAAC,EAAE,SAAS,EAAE,CAAC,CAAC,GAAG,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC,CACjI,CAAC"}
|
|
@@ -1,4 +1,9 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
+
/** The states Needs attention lists. Undeliverable: handed again and again, never acknowledged. Not handled: acknowledged, and its turn died twice (decision 0040). */
|
|
3
|
+
export declare const needsAttentionStateSchema: z.ZodEnum<{
|
|
4
|
+
notHandled: "notHandled";
|
|
5
|
+
undeliverable: "undeliverable";
|
|
6
|
+
}>;
|
|
2
7
|
/** One delivery in Needs attention: its state, its claims, since when, and its whole message. */
|
|
3
8
|
export declare const needsAttentionDeliverySchema: z.ZodObject<{
|
|
4
9
|
deliveryId: z.ZodType<`dlv_${string}`, unknown, z.core.$ZodTypeInternals<`dlv_${string}`, unknown>>;
|
|
@@ -38,44 +43,57 @@ export declare const needsAttentionDeliverySchema: z.ZodObject<{
|
|
|
38
43
|
}, z.core.$strip>;
|
|
39
44
|
}, z.core.$strip>;
|
|
40
45
|
export type NeedsAttentionDelivery = z.infer<typeof needsAttentionDeliverySchema>;
|
|
41
|
-
/**
|
|
42
|
-
export declare const
|
|
43
|
-
|
|
44
|
-
|
|
46
|
+
/** Input of `fleet.needsAttention`: the fleet's, or one ship's for its page, in either state or one, and the cursor and size of a page. */
|
|
47
|
+
export declare const needsAttentionInputSchema: z.ZodObject<{
|
|
48
|
+
cursor: z.ZodOptional<z.ZodType<`dlv_${string}`, unknown, z.core.$ZodTypeInternals<`dlv_${string}`, unknown>>>;
|
|
49
|
+
limit: z.ZodOptional<z.ZodInt>;
|
|
50
|
+
shipId: z.ZodOptional<z.ZodType<`shp_${string}`, unknown, z.core.$ZodTypeInternals<`shp_${string}`, unknown>>>;
|
|
51
|
+
state: z.ZodOptional<z.ZodEnum<{
|
|
45
52
|
notHandled: "notHandled";
|
|
46
53
|
undeliverable: "undeliverable";
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
54
|
+
}>>;
|
|
55
|
+
}, z.core.$strip>;
|
|
56
|
+
/** Output of `fleet.needsAttention`: a page of the undeliverable or not handled deliveries, oldest first by since when. */
|
|
57
|
+
export declare const needsAttentionOutputSchema: z.ZodObject<{
|
|
58
|
+
items: z.ZodArray<z.ZodObject<{
|
|
59
|
+
deliveryId: z.ZodType<`dlv_${string}`, unknown, z.core.$ZodTypeInternals<`dlv_${string}`, unknown>>;
|
|
60
|
+
state: z.ZodEnum<{
|
|
61
|
+
notHandled: "notHandled";
|
|
62
|
+
undeliverable: "undeliverable";
|
|
63
|
+
}>;
|
|
64
|
+
attempts: z.ZodInt;
|
|
65
|
+
isPushed: z.ZodBoolean;
|
|
66
|
+
since: z.ZodISODateTime;
|
|
67
|
+
reason: z.ZodNullable<z.ZodString>;
|
|
68
|
+
ship: z.ZodObject<{
|
|
59
69
|
id: z.ZodType<`shp_${string}`, unknown, z.core.$ZodTypeInternals<`shp_${string}`, unknown>>;
|
|
60
70
|
name: z.ZodString;
|
|
61
71
|
}, z.core.$strip>;
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
72
|
+
message: z.ZodObject<{
|
|
73
|
+
id: z.ZodType<`msg_${string}`, unknown, z.core.$ZodTypeInternals<`msg_${string}`, unknown>>;
|
|
74
|
+
sender: z.ZodObject<{
|
|
65
75
|
id: z.ZodType<`shp_${string}`, unknown, z.core.$ZodTypeInternals<`shp_${string}`, unknown>>;
|
|
66
76
|
name: z.ZodString;
|
|
67
77
|
}, z.core.$strip>;
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
}, z.core.$
|
|
78
|
+
recipient: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
79
|
+
kind: z.ZodLiteral<"ship">;
|
|
80
|
+
ship: z.ZodObject<{
|
|
81
|
+
id: z.ZodType<`shp_${string}`, unknown, z.core.$ZodTypeInternals<`shp_${string}`, unknown>>;
|
|
82
|
+
name: z.ZodString;
|
|
83
|
+
}, z.core.$strip>;
|
|
84
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
85
|
+
kind: z.ZodLiteral<"type">;
|
|
86
|
+
type: z.ZodString;
|
|
87
|
+
}, z.core.$strip>], "kind">;
|
|
88
|
+
inReplyTo: z.ZodNullable<z.ZodType<`msg_${string}`, unknown, z.core.$ZodTypeInternals<`msg_${string}`, unknown>>>;
|
|
89
|
+
sentAt: z.ZodISODateTime;
|
|
90
|
+
contentType: z.ZodString;
|
|
91
|
+
isPing: z.ZodBoolean;
|
|
92
|
+
payload: z.ZodString;
|
|
93
|
+
}, z.core.$strip>;
|
|
94
|
+
}, z.core.$strip>>;
|
|
95
|
+
nextCursor: z.ZodNullable<z.ZodType<`dlv_${string}`, unknown, z.core.$ZodTypeInternals<`dlv_${string}`, unknown>>>;
|
|
96
|
+
}, z.core.$strip>;
|
|
79
97
|
/** Input of `fleet.dismiss`: the undeliverable or not handled delivery the operator lets go. It stays in history, dismissed. */
|
|
80
98
|
export declare const dismissDeliveryInputSchema: z.ZodObject<{
|
|
81
99
|
deliveryId: z.ZodType<`dlv_${string}`, unknown, z.core.$ZodTypeInternals<`dlv_${string}`, unknown>>;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
import { idSchema } from '../ids/index.js';
|
|
3
3
|
import { messageRecipientSchema, partySchema } from './history.js';
|
|
4
|
+
import { pageInputOf, pageOutputOf } from './page.js';
|
|
4
5
|
/**
|
|
5
6
|
* Inputs and outputs of Needs attention (docs/blueprint.md, 'Domain events'):
|
|
6
7
|
* the undeliverable and not handled deliveries, oldest first, which the
|
|
@@ -9,11 +10,12 @@ import { messageRecipientSchema, partySchema } from './history.js';
|
|
|
9
10
|
*/
|
|
10
11
|
/** ISO 8601 in UTC. */
|
|
11
12
|
const isoTime = z.iso.datetime();
|
|
13
|
+
/** The states Needs attention lists. Undeliverable: handed again and again, never acknowledged. Not handled: acknowledged, and its turn died twice (decision 0040). */
|
|
14
|
+
export const needsAttentionStateSchema = z.enum(['undeliverable', 'notHandled']);
|
|
12
15
|
/** One delivery in Needs attention: its state, its claims, since when, and its whole message. */
|
|
13
16
|
export const needsAttentionDeliverySchema = z.object({
|
|
14
17
|
deliveryId: idSchema('delivery'),
|
|
15
|
-
|
|
16
|
-
state: z.enum(['undeliverable', 'notHandled']),
|
|
18
|
+
state: needsAttentionStateSchema,
|
|
17
19
|
/** The claims counted. */
|
|
18
20
|
attempts: z.int().min(0),
|
|
19
21
|
/** A pushed crew's computer side handed it over, with numbers; false when plain receives handed it (pulled). */
|
|
@@ -36,8 +38,10 @@ export const needsAttentionDeliverySchema = z.object({
|
|
|
36
38
|
payload: z.string(),
|
|
37
39
|
}),
|
|
38
40
|
});
|
|
39
|
-
/**
|
|
40
|
-
export const
|
|
41
|
+
/** Input of `fleet.needsAttention`: the fleet's, or one ship's for its page, in either state or one, and the cursor and size of a page. */
|
|
42
|
+
export const needsAttentionInputSchema = z.object({ shipId: idSchema('ship').optional(), state: needsAttentionStateSchema.optional(), ...pageInputOf(idSchema('delivery')).shape });
|
|
43
|
+
/** Output of `fleet.needsAttention`: a page of the undeliverable or not handled deliveries, oldest first by since when. */
|
|
44
|
+
export const needsAttentionOutputSchema = pageOutputOf(needsAttentionDeliverySchema, idSchema('delivery'));
|
|
41
45
|
/** Input of `fleet.dismiss`: the undeliverable or not handled delivery the operator lets go. It stays in history, dismissed. */
|
|
42
46
|
export const dismissDeliveryInputSchema = z.object({
|
|
43
47
|
deliveryId: idSchema('delivery'),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"needs-attention.js","sourceRoot":"","sources":["../../src/schemas/needs-attention.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAC3C,OAAO,EAAE,sBAAsB,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"needs-attention.js","sourceRoot":"","sources":["../../src/schemas/needs-attention.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAC3C,OAAO,EAAE,sBAAsB,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AACnE,OAAO,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AAEtD;;;;;GAKG;AAEH,uBAAuB;AACvB,MAAM,OAAO,GAAG,CAAC,CAAC,GAAG,CAAC,QAAQ,EAAE,CAAC;AAEjC,uKAAuK;AACvK,MA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