@aeolus-fleet/common 0.7.0 → 0.9.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/fleet/index.d.ts +12 -1
- package/dist/fleet/index.js +7 -0
- package/dist/fleet/index.js.map +1 -1
- package/dist/schemas/console.d.ts +11 -0
- package/dist/schemas/console.js +11 -0
- package/dist/schemas/console.js.map +1 -1
- package/dist/schemas/fleet.d.ts +72 -2
- package/dist/schemas/fleet.js +43 -5
- package/dist/schemas/fleet.js.map +1 -1
- package/dist/schemas/follow.d.ts +51 -0
- package/dist/schemas/follow.js +26 -0
- package/dist/schemas/follow.js.map +1 -0
- package/dist/schemas/history.d.ts +28 -0
- package/dist/schemas/history.js +7 -1
- package/dist/schemas/history.js.map +1 -1
- package/dist/schemas/index.d.ts +3 -0
- package/dist/schemas/index.js +3 -0
- package/dist/schemas/index.js.map +1 -1
- package/dist/schemas/ping.d.ts +37 -0
- package/dist/schemas/ping.js +34 -0
- package/dist/schemas/ping.js.map +1 -0
- package/dist/schemas/report.d.ts +25 -0
- package/dist/schemas/report.js +19 -0
- package/dist/schemas/report.js.map +1 -0
- package/package.json +1 -1
package/dist/fleet/index.d.ts
CHANGED
|
@@ -13,6 +13,16 @@ export declare const scopeSchema: z.ZodEnum<{
|
|
|
13
13
|
"fleet:manage": "fleet:manage";
|
|
14
14
|
}>;
|
|
15
15
|
export type Scope = z.infer<typeof scopeSchema>;
|
|
16
|
+
/**
|
|
17
|
+
* The scopes commissioning may add to an agent ship, beside sending and
|
|
18
|
+
* receiving, which every agent ship has (ADR 0002).
|
|
19
|
+
*/
|
|
20
|
+
export declare const FLEET_SCOPES: readonly ["fleet:read", "fleet:manage"];
|
|
21
|
+
export declare const fleetScopeSchema: z.ZodEnum<{
|
|
22
|
+
"fleet:read": "fleet:read";
|
|
23
|
+
"fleet:manage": "fleet:manage";
|
|
24
|
+
}>;
|
|
25
|
+
export type FleetScope = z.infer<typeof fleetScopeSchema>;
|
|
16
26
|
/** `argo` is the one ship of kind `operator` in a fleet; every other ship is an `agent`. */
|
|
17
27
|
export declare const SHIP_KINDS: readonly ["operator", "agent"];
|
|
18
28
|
export declare const shipKindSchema: z.ZodEnum<{
|
|
@@ -63,7 +73,7 @@ export declare const deliveryStateSchema: z.ZodEnum<{
|
|
|
63
73
|
}>;
|
|
64
74
|
export type DeliveryState = z.infer<typeof deliveryStateSchema>;
|
|
65
75
|
/** The event types written so far. Each later slice adds the ones it writes. */
|
|
66
|
-
export declare const EVENT_TYPES: readonly ["FleetInitialised", "ShipCommissioned", "ShipClaimed", "LeaseRevoked", "CredentialRevoked", "StartingPromptIssued", "OperatorPasswordReset", "MessageAccepted", "DeliveryClaimed", "DeliveryAcknowledged", "DeliveryUndeliverable", "DeliveryReturned", "ShipRetired", "DeliveryAbandoned", "DeliveryDismissed", "ShipRenamed"];
|
|
76
|
+
export declare const EVENT_TYPES: readonly ["FleetInitialised", "ShipCommissioned", "ShipClaimed", "LeaseRevoked", "CredentialRevoked", "StartingPromptIssued", "OperatorPasswordReset", "MessageAccepted", "DeliveryClaimed", "DeliveryAcknowledged", "DeliveryUndeliverable", "DeliveryReturned", "ShipRetired", "DeliveryAbandoned", "DeliveryDismissed", "ShipRenamed", "ShipReported"];
|
|
67
77
|
export declare const eventTypeSchema: z.ZodEnum<{
|
|
68
78
|
FleetInitialised: "FleetInitialised";
|
|
69
79
|
ShipCommissioned: "ShipCommissioned";
|
|
@@ -81,5 +91,6 @@ export declare const eventTypeSchema: z.ZodEnum<{
|
|
|
81
91
|
DeliveryAbandoned: "DeliveryAbandoned";
|
|
82
92
|
DeliveryDismissed: "DeliveryDismissed";
|
|
83
93
|
ShipRenamed: "ShipRenamed";
|
|
94
|
+
ShipReported: "ShipReported";
|
|
84
95
|
}>;
|
|
85
96
|
export type EventType = z.infer<typeof eventTypeSchema>;
|
package/dist/fleet/index.js
CHANGED
|
@@ -7,6 +7,12 @@ import { z } from 'zod';
|
|
|
7
7
|
/** A permission of a ship, stored on the server with the ship and checked before every call. */
|
|
8
8
|
export const SCOPES = ['messages:send', 'messages:receive', 'fleet:read', 'fleet:manage'];
|
|
9
9
|
export const scopeSchema = z.enum(SCOPES);
|
|
10
|
+
/**
|
|
11
|
+
* The scopes commissioning may add to an agent ship, beside sending and
|
|
12
|
+
* receiving, which every agent ship has (ADR 0002).
|
|
13
|
+
*/
|
|
14
|
+
export const FLEET_SCOPES = ['fleet:read', 'fleet:manage'];
|
|
15
|
+
export const fleetScopeSchema = z.enum(FLEET_SCOPES);
|
|
10
16
|
/** `argo` is the one ship of kind `operator` in a fleet; every other ship is an `agent`. */
|
|
11
17
|
export const SHIP_KINDS = ['operator', 'agent'];
|
|
12
18
|
export const shipKindSchema = z.enum(SHIP_KINDS);
|
|
@@ -47,6 +53,7 @@ export const EVENT_TYPES = [
|
|
|
47
53
|
'DeliveryAbandoned',
|
|
48
54
|
'DeliveryDismissed',
|
|
49
55
|
'ShipRenamed',
|
|
56
|
+
'ShipReported',
|
|
50
57
|
];
|
|
51
58
|
export const eventTypeSchema = z.enum(EVENT_TYPES);
|
|
52
59
|
//# sourceMappingURL=index.js.map
|
package/dist/fleet/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/fleet/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB;;;;GAIG;AAEH,gGAAgG;AAChG,MAAM,CAAC,MAAM,MAAM,GAAG,CAAC,eAAe,EAAE,kBAAkB,EAAE,YAAY,EAAE,cAAc,CAAU,CAAC;AACnG,MAAM,CAAC,MAAM,WAAW,GAAG,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;AAG1C,4FAA4F;AAC5F,MAAM,CAAC,MAAM,UAAU,GAAG,CAAC,UAAU,EAAE,OAAO,CAAU,CAAC;AACzD,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,CAAC,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,IAAI,CAAC,eAAe,CAAC,CAAC;AAG3D,gFAAgF;AAChF,MAAM,CAAC,MAAM,WAAW,GAAG;IACzB,kBAAkB;IAClB,kBAAkB;IAClB,aAAa;IACb,cAAc;IACd,mBAAmB;IACnB,sBAAsB;IACtB,uBAAuB;IACvB,iBAAiB;IACjB,iBAAiB;IACjB,sBAAsB;IACtB,uBAAuB;IACvB,kBAAkB;IAClB,aAAa;IACb,mBAAmB;IACnB,mBAAmB;IACnB,aAAa;IACb,cAAc;CACN,CAAC;AACX,MAAM,CAAC,MAAM,eAAe,GAAG,CAAC,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC"}
|
|
@@ -27,6 +27,17 @@ export declare const themeSchema: z.ZodEnum<{
|
|
|
27
27
|
system: "system";
|
|
28
28
|
}>;
|
|
29
29
|
export type Theme = z.infer<typeof themeSchema>;
|
|
30
|
+
/**
|
|
31
|
+
* Output of `console.session`: for another service the operator uses beside
|
|
32
|
+
* the console, which forwards the browser's session cookie and asks whether
|
|
33
|
+
* the operator is signed in. The fleet they signed in to, and when the
|
|
34
|
+
* session expires (ISO 8601 in UTC).
|
|
35
|
+
*/
|
|
36
|
+
export declare const consoleSessionOutputSchema: z.ZodObject<{
|
|
37
|
+
fleetId: z.ZodType<`flt_${string}`, unknown, z.core.$ZodTypeInternals<`flt_${string}`, unknown>>;
|
|
38
|
+
expiresAt: z.ZodISODateTime;
|
|
39
|
+
}, z.core.$strip>;
|
|
40
|
+
export type ConsoleSessionOutput = z.infer<typeof consoleSessionOutputSchema>;
|
|
30
41
|
/**
|
|
31
42
|
* Output of `console.account`: the signed-in operator, their theme, and this
|
|
32
43
|
* console session: the device it signed in from and since when.
|
package/dist/schemas/console.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
+
import { idSchema } from '../ids/index.js';
|
|
2
3
|
/** The operator's email: at most 254 characters, the longest address mail carries. */
|
|
3
4
|
export const OPERATOR_EMAIL_MAX_LENGTH = 254;
|
|
4
5
|
/** One @ with something on each side, and no whitespace. */
|
|
@@ -23,6 +24,16 @@ export const THEMES = ['light', 'dark', 'system'];
|
|
|
23
24
|
export const themeSchema = z.enum(THEMES);
|
|
24
25
|
/** ISO 8601 in UTC. */
|
|
25
26
|
const isoTime = z.iso.datetime();
|
|
27
|
+
/**
|
|
28
|
+
* Output of `console.session`: for another service the operator uses beside
|
|
29
|
+
* the console, which forwards the browser's session cookie and asks whether
|
|
30
|
+
* the operator is signed in. The fleet they signed in to, and when the
|
|
31
|
+
* session expires (ISO 8601 in UTC).
|
|
32
|
+
*/
|
|
33
|
+
export const consoleSessionOutputSchema = z.object({
|
|
34
|
+
fleetId: idSchema('fleet'),
|
|
35
|
+
expiresAt: z.iso.datetime(),
|
|
36
|
+
});
|
|
26
37
|
/**
|
|
27
38
|
* Output of `console.account`: the signed-in operator, their theme, and this
|
|
28
39
|
* console session: the device it signed in from and since when.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"console.js","sourceRoot":"","sources":["../../src/schemas/console.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,sFAAsF;AACtF,MAAM,CAAC,MAAM,yBAAyB,GAAG,GAAG,CAAC;AAC7C,4DAA4D;AAC5D,MAAM,CAAC,MAAM,sBAAsB,GAAG,mBAAmB,CAAC;AAC1D;;;GAGG;AACH,MAAM,CAAC,MAAM,4BAA4B,GAAG,IAAI,CAAC;AAEjD;;;;;GAKG;AACH,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAC,CAAC,MAAM,CAAC;IACxC,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,IAAI,EAAE,CAAC,GAAG,CAAC,CAAC,EAAE,kBAAkB,CAAC,CAAC,GAAG,CAAC,yBAAyB,CAAC;IAClF,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,EAAE,qBAAqB,CAAC,CAAC,G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AAC,YAAY,CAAC,EAAE,CAAC,CAAC"}
|
package/dist/schemas/fleet.d.ts
CHANGED
|
@@ -3,15 +3,27 @@ import { z } from 'zod';
|
|
|
3
3
|
* Inputs and outputs of the fleet procedures: commission a ship, get its
|
|
4
4
|
* starting prompt, release it, list the fleet, follow its events live.
|
|
5
5
|
*/
|
|
6
|
-
/**
|
|
6
|
+
/**
|
|
7
|
+
* A ship's name and its type are handles (docs/blueprint.md, "Ship"). A colon
|
|
8
|
+
* is an ordinary character, so a prefix can group ships (`hemma:planner`); it
|
|
9
|
+
* carries no meaning for the fleet.
|
|
10
|
+
*/
|
|
7
11
|
export declare const SHIP_HANDLE_MAX_LENGTH = 48;
|
|
8
12
|
export declare const SHIP_HANDLE_PATTERN: RegExp;
|
|
9
13
|
export declare const shipHandleSchema: z.ZodString;
|
|
10
14
|
export declare const SHIP_NOTE_MAX_LENGTH = 500;
|
|
11
|
-
/**
|
|
15
|
+
/**
|
|
16
|
+
* Input of `fleet.commission`. The note is free text for the operator;
|
|
17
|
+
* whitespace around it is dropped. `fleetScopes` adds fleet:read and/or
|
|
18
|
+
* fleet:manage to the scopes every agent ship has; none when left out.
|
|
19
|
+
*/
|
|
12
20
|
export declare const commissionShipInputSchema: z.ZodObject<{
|
|
13
21
|
name: z.ZodString;
|
|
14
22
|
type: z.ZodString;
|
|
23
|
+
fleetScopes: z.ZodOptional<z.ZodArray<z.ZodEnum<{
|
|
24
|
+
"fleet:read": "fleet:read";
|
|
25
|
+
"fleet:manage": "fleet:manage";
|
|
26
|
+
}>>>;
|
|
15
27
|
note: z.ZodOptional<z.ZodString>;
|
|
16
28
|
}, z.core.$strip>;
|
|
17
29
|
export type CommissionShipInput = z.infer<typeof commissionShipInputSchema>;
|
|
@@ -60,6 +72,14 @@ export declare const retireShipOutputSchema: z.ZodObject<{
|
|
|
60
72
|
export declare const recrewShipInputSchema: z.ZodObject<{
|
|
61
73
|
shipId: z.ZodType<`shp_${string}`, unknown, z.core.$ZodTypeInternals<`shp_${string}`, unknown>>;
|
|
62
74
|
}, z.core.$strip>;
|
|
75
|
+
/** How a ship's last ping stands: waiting for an answer, answered with pong, or received with a plain ack. */
|
|
76
|
+
export declare const PING_STATES: readonly ["waiting", "answered", "received"];
|
|
77
|
+
export declare const pingStateSchema: z.ZodEnum<{
|
|
78
|
+
waiting: "waiting";
|
|
79
|
+
answered: "answered";
|
|
80
|
+
received: "received";
|
|
81
|
+
}>;
|
|
82
|
+
export type PingState = z.infer<typeof pingStateSchema>;
|
|
63
83
|
/**
|
|
64
84
|
* One ship in `fleet.list`. `startingPrompt` is the prompt holding the ship's
|
|
65
85
|
* valid secret, when there is one: when it was issued and whether a session
|
|
@@ -94,6 +114,30 @@ export declare const listedShipSchema: z.ZodObject<{
|
|
|
94
114
|
description: z.ZodNullable<z.ZodString>;
|
|
95
115
|
}, z.core.$strip>>;
|
|
96
116
|
lastSeenAt: z.ZodNullable<z.ZodISODateTime>;
|
|
117
|
+
ping: z.ZodNullable<z.ZodObject<{
|
|
118
|
+
state: z.ZodEnum<{
|
|
119
|
+
waiting: "waiting";
|
|
120
|
+
answered: "answered";
|
|
121
|
+
received: "received";
|
|
122
|
+
}>;
|
|
123
|
+
sentAt: z.ZodISODateTime;
|
|
124
|
+
answeredAt: z.ZodNullable<z.ZodISODateTime>;
|
|
125
|
+
}, z.core.$strip>>;
|
|
126
|
+
scopes: z.ZodArray<z.ZodEnum<{
|
|
127
|
+
"messages:send": "messages:send";
|
|
128
|
+
"messages:receive": "messages:receive";
|
|
129
|
+
"fleet:read": "fleet:read";
|
|
130
|
+
"fleet:manage": "fleet:manage";
|
|
131
|
+
}>>;
|
|
132
|
+
report: z.ZodNullable<z.ZodObject<{
|
|
133
|
+
state: z.ZodEnum<{
|
|
134
|
+
working: "working";
|
|
135
|
+
blocked: "blocked";
|
|
136
|
+
idle: "idle";
|
|
137
|
+
}>;
|
|
138
|
+
note: z.ZodNullable<z.ZodString>;
|
|
139
|
+
reportedAt: z.ZodISODateTime;
|
|
140
|
+
}, z.core.$strip>>;
|
|
97
141
|
}, z.core.$strip>;
|
|
98
142
|
export type ListedShip = z.infer<typeof listedShipSchema>;
|
|
99
143
|
/** Output of `fleet.list`: every ship in the caller's fleet, `argo` included. */
|
|
@@ -124,6 +168,30 @@ export declare const fleetListOutputSchema: z.ZodArray<z.ZodObject<{
|
|
|
124
168
|
description: z.ZodNullable<z.ZodString>;
|
|
125
169
|
}, z.core.$strip>>;
|
|
126
170
|
lastSeenAt: z.ZodNullable<z.ZodISODateTime>;
|
|
171
|
+
ping: z.ZodNullable<z.ZodObject<{
|
|
172
|
+
state: z.ZodEnum<{
|
|
173
|
+
waiting: "waiting";
|
|
174
|
+
answered: "answered";
|
|
175
|
+
received: "received";
|
|
176
|
+
}>;
|
|
177
|
+
sentAt: z.ZodISODateTime;
|
|
178
|
+
answeredAt: z.ZodNullable<z.ZodISODateTime>;
|
|
179
|
+
}, z.core.$strip>>;
|
|
180
|
+
scopes: z.ZodArray<z.ZodEnum<{
|
|
181
|
+
"messages:send": "messages:send";
|
|
182
|
+
"messages:receive": "messages:receive";
|
|
183
|
+
"fleet:read": "fleet:read";
|
|
184
|
+
"fleet:manage": "fleet:manage";
|
|
185
|
+
}>>;
|
|
186
|
+
report: z.ZodNullable<z.ZodObject<{
|
|
187
|
+
state: z.ZodEnum<{
|
|
188
|
+
working: "working";
|
|
189
|
+
blocked: "blocked";
|
|
190
|
+
idle: "idle";
|
|
191
|
+
}>;
|
|
192
|
+
note: z.ZodNullable<z.ZodString>;
|
|
193
|
+
reportedAt: z.ZodISODateTime;
|
|
194
|
+
}, z.core.$strip>>;
|
|
127
195
|
}, z.core.$strip>>;
|
|
128
196
|
/**
|
|
129
197
|
* Input of the `fleet.events` subscription: the number of the last event the
|
|
@@ -160,6 +228,7 @@ export declare const liveFleetEventSchema: z.ZodObject<{
|
|
|
160
228
|
DeliveryAbandoned: "DeliveryAbandoned";
|
|
161
229
|
DeliveryDismissed: "DeliveryDismissed";
|
|
162
230
|
ShipRenamed: "ShipRenamed";
|
|
231
|
+
ShipReported: "ShipReported";
|
|
163
232
|
}>;
|
|
164
233
|
occurredAt: z.ZodISODateTime;
|
|
165
234
|
actorShipId: z.ZodNullable<z.ZodType<`shp_${string}`, unknown, z.core.$ZodTypeInternals<`shp_${string}`, unknown>>>;
|
|
@@ -194,6 +263,7 @@ export declare const fleetStreamItemSchema: z.ZodDiscriminatedUnion<[z.ZodObject
|
|
|
194
263
|
DeliveryAbandoned: "DeliveryAbandoned";
|
|
195
264
|
DeliveryDismissed: "DeliveryDismissed";
|
|
196
265
|
ShipRenamed: "ShipRenamed";
|
|
266
|
+
ShipReported: "ShipReported";
|
|
197
267
|
}>;
|
|
198
268
|
occurredAt: z.ZodISODateTime;
|
|
199
269
|
actorShipId: z.ZodNullable<z.ZodType<`shp_${string}`, unknown, z.core.$ZodTypeInternals<`shp_${string}`, unknown>>>;
|
package/dist/schemas/fleet.js
CHANGED
|
@@ -1,23 +1,33 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
import { eventTypeSchema, locationKindSchema, shipKindSchema, shipStatusSchema } from '../fleet/index.js';
|
|
2
|
+
import { eventTypeSchema, fleetScopeSchema, locationKindSchema, scopeSchema, shipKindSchema, shipStatusSchema } from '../fleet/index.js';
|
|
3
3
|
import { idSchema } from '../ids/index.js';
|
|
4
|
+
import { reportStateSchema } from './report.js';
|
|
4
5
|
/**
|
|
5
6
|
* Inputs and outputs of the fleet procedures: commission a ship, get its
|
|
6
7
|
* starting prompt, release it, list the fleet, follow its events live.
|
|
7
8
|
*/
|
|
8
|
-
/**
|
|
9
|
+
/**
|
|
10
|
+
* A ship's name and its type are handles (docs/blueprint.md, "Ship"). A colon
|
|
11
|
+
* is an ordinary character, so a prefix can group ships (`hemma:planner`); it
|
|
12
|
+
* carries no meaning for the fleet.
|
|
13
|
+
*/
|
|
9
14
|
export const SHIP_HANDLE_MAX_LENGTH = 48;
|
|
10
|
-
export const SHIP_HANDLE_PATTERN = /^[a-z0-9
|
|
11
|
-
const HANDLE_MESSAGE = `Use 1 to ${SHIP_HANDLE_MAX_LENGTH} lowercase letters, digits or
|
|
15
|
+
export const SHIP_HANDLE_PATTERN = /^[a-z0-9:-]+$/;
|
|
16
|
+
const HANDLE_MESSAGE = `Use 1 to ${SHIP_HANDLE_MAX_LENGTH} lowercase letters, digits, hyphens or colons`;
|
|
12
17
|
export const shipHandleSchema = z
|
|
13
18
|
.string()
|
|
14
19
|
.max(SHIP_HANDLE_MAX_LENGTH, HANDLE_MESSAGE)
|
|
15
20
|
.regex(SHIP_HANDLE_PATTERN, HANDLE_MESSAGE);
|
|
16
21
|
export const SHIP_NOTE_MAX_LENGTH = 500;
|
|
17
|
-
/**
|
|
22
|
+
/**
|
|
23
|
+
* Input of `fleet.commission`. The note is free text for the operator;
|
|
24
|
+
* whitespace around it is dropped. `fleetScopes` adds fleet:read and/or
|
|
25
|
+
* fleet:manage to the scopes every agent ship has; none when left out.
|
|
26
|
+
*/
|
|
18
27
|
export const commissionShipInputSchema = z.object({
|
|
19
28
|
name: shipHandleSchema,
|
|
20
29
|
type: shipHandleSchema,
|
|
30
|
+
fleetScopes: z.array(fleetScopeSchema).optional(),
|
|
21
31
|
note: z
|
|
22
32
|
.string()
|
|
23
33
|
.trim()
|
|
@@ -55,6 +65,9 @@ export const retireShipOutputSchema = z.object({ abandonedDeliveries: z.int().mi
|
|
|
55
65
|
* a new starting prompt, as from `fleet.getStartingPrompt`.
|
|
56
66
|
*/
|
|
57
67
|
export const recrewShipInputSchema = z.object({ shipId: idSchema('ship') });
|
|
68
|
+
/** How a ship's last ping stands: waiting for an answer, answered with pong, or received with a plain ack. */
|
|
69
|
+
export const PING_STATES = ['waiting', 'answered', 'received'];
|
|
70
|
+
export const pingStateSchema = z.enum(PING_STATES);
|
|
58
71
|
/**
|
|
59
72
|
* One ship in `fleet.list`. `startingPrompt` is the prompt holding the ship's
|
|
60
73
|
* valid secret, when there is one: when it was issued and whether a session
|
|
@@ -88,6 +101,31 @@ export const listedShipSchema = z.object({
|
|
|
88
101
|
* observation only, nothing acts on it. Null while no session crews it.
|
|
89
102
|
*/
|
|
90
103
|
lastSeenAt: z.iso.datetime().nullable(),
|
|
104
|
+
/**
|
|
105
|
+
* The ship's last ping (ISO 8601 in UTC): when argo sent it, how it stands,
|
|
106
|
+
* and when pong answered it. Null before any ping, or when the last one went
|
|
107
|
+
* undeliverable. Observation only.
|
|
108
|
+
*/
|
|
109
|
+
ping: z
|
|
110
|
+
.object({
|
|
111
|
+
state: pingStateSchema,
|
|
112
|
+
sentAt: z.iso.datetime(),
|
|
113
|
+
answeredAt: z.iso.datetime().nullable(),
|
|
114
|
+
})
|
|
115
|
+
.nullable(),
|
|
116
|
+
/** What the ship may do, checked on every call: every agent ship sends and receives, argo has all. */
|
|
117
|
+
scopes: z.array(scopeSchema),
|
|
118
|
+
/**
|
|
119
|
+
* The crew's last report (ISO 8601 in UTC): its state, its note, and when it
|
|
120
|
+
* last reported. Null until the crew reports, and for a ship no session crews.
|
|
121
|
+
*/
|
|
122
|
+
report: z
|
|
123
|
+
.object({
|
|
124
|
+
state: reportStateSchema,
|
|
125
|
+
note: z.string().nullable(),
|
|
126
|
+
reportedAt: z.iso.datetime(),
|
|
127
|
+
})
|
|
128
|
+
.nullable(),
|
|
91
129
|
});
|
|
92
130
|
/** Output of `fleet.list`: every ship in the caller's fleet, `argo` included. */
|
|
93
131
|
export const fleetListOutputSchema = z.array(listedShipSchema);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fleet.js","sourceRoot":"","sources":["../../src/schemas/fleet.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,eAAe,EAAE,kBAAkB,EAAE,cAAc,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;
|
|
1
|
+
{"version":3,"file":"fleet.js","sourceRoot":"","sources":["../../src/schemas/fleet.ts"],"names":[],"mappings":"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AE,oBAAoB,EAAE,CAAC;IACnE,CAAC,CAAC,MAAM,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC,OAAO,CAAC,QAAQ,CAAC,EAAE,CAAC;CACxC,CAAC,CAAC"}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
/** The most events one follow answers, and how many it answers unless told fewer. */
|
|
3
|
+
export declare const FOLLOW_MAX_LIMIT = 100;
|
|
4
|
+
export declare const FOLLOW_MAX_DEFAULT = 100;
|
|
5
|
+
/** The longest a follow waits while no event has come, in seconds. */
|
|
6
|
+
export declare const FOLLOW_WAIT_MAX_SECONDS = 25;
|
|
7
|
+
/**
|
|
8
|
+
* Input of `fleet.follow`: the number of the last event the caller has (the
|
|
9
|
+
* same commit-ordered numbers the console follows by), at most how many to
|
|
10
|
+
* answer, and how long to wait while none has come. Without a position it
|
|
11
|
+
* answers where to start from.
|
|
12
|
+
*/
|
|
13
|
+
export declare const followFleetInputSchema: z.ZodOptional<z.ZodObject<{
|
|
14
|
+
afterSeq: z.ZodOptional<z.ZodInt>;
|
|
15
|
+
max: z.ZodOptional<z.ZodInt>;
|
|
16
|
+
waitSeconds: z.ZodOptional<z.ZodInt>;
|
|
17
|
+
}, z.core.$strip>>;
|
|
18
|
+
export type FollowFleetInput = z.infer<typeof followFleetInputSchema>;
|
|
19
|
+
/** Output of `fleet.follow`: the events after the position, oldest first, and the number to follow from next. */
|
|
20
|
+
export declare const followFleetOutputSchema: z.ZodObject<{
|
|
21
|
+
events: z.ZodArray<z.ZodObject<{
|
|
22
|
+
seq: z.ZodNumber;
|
|
23
|
+
id: z.ZodType<`evt_${string}`, unknown, z.core.$ZodTypeInternals<`evt_${string}`, unknown>>;
|
|
24
|
+
type: z.ZodEnum<{
|
|
25
|
+
FleetInitialised: "FleetInitialised";
|
|
26
|
+
ShipCommissioned: "ShipCommissioned";
|
|
27
|
+
ShipClaimed: "ShipClaimed";
|
|
28
|
+
LeaseRevoked: "LeaseRevoked";
|
|
29
|
+
CredentialRevoked: "CredentialRevoked";
|
|
30
|
+
StartingPromptIssued: "StartingPromptIssued";
|
|
31
|
+
OperatorPasswordReset: "OperatorPasswordReset";
|
|
32
|
+
MessageAccepted: "MessageAccepted";
|
|
33
|
+
DeliveryClaimed: "DeliveryClaimed";
|
|
34
|
+
DeliveryAcknowledged: "DeliveryAcknowledged";
|
|
35
|
+
DeliveryUndeliverable: "DeliveryUndeliverable";
|
|
36
|
+
DeliveryReturned: "DeliveryReturned";
|
|
37
|
+
ShipRetired: "ShipRetired";
|
|
38
|
+
DeliveryAbandoned: "DeliveryAbandoned";
|
|
39
|
+
DeliveryDismissed: "DeliveryDismissed";
|
|
40
|
+
ShipRenamed: "ShipRenamed";
|
|
41
|
+
ShipReported: "ShipReported";
|
|
42
|
+
}>;
|
|
43
|
+
occurredAt: z.ZodISODateTime;
|
|
44
|
+
actorShipId: z.ZodNullable<z.ZodType<`shp_${string}`, unknown, z.core.$ZodTypeInternals<`shp_${string}`, unknown>>>;
|
|
45
|
+
shipId: z.ZodNullable<z.ZodType<`shp_${string}`, unknown, z.core.$ZodTypeInternals<`shp_${string}`, unknown>>>;
|
|
46
|
+
messageId: z.ZodNullable<z.ZodType<`msg_${string}`, unknown, z.core.$ZodTypeInternals<`msg_${string}`, unknown>>>;
|
|
47
|
+
deliveryId: z.ZodNullable<z.ZodType<`dlv_${string}`, unknown, z.core.$ZodTypeInternals<`dlv_${string}`, unknown>>>;
|
|
48
|
+
}, z.core.$strip>>;
|
|
49
|
+
lastSeq: z.ZodInt;
|
|
50
|
+
}, z.core.$strip>;
|
|
51
|
+
export type FollowFleetOutput = z.infer<typeof followFleetOutputSchema>;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { liveFleetEventSchema } from './fleet.js';
|
|
3
|
+
/** The most events one follow answers, and how many it answers unless told fewer. */
|
|
4
|
+
export const FOLLOW_MAX_LIMIT = 100;
|
|
5
|
+
export const FOLLOW_MAX_DEFAULT = FOLLOW_MAX_LIMIT;
|
|
6
|
+
/** The longest a follow waits while no event has come, in seconds. */
|
|
7
|
+
export const FOLLOW_WAIT_MAX_SECONDS = 25;
|
|
8
|
+
/**
|
|
9
|
+
* Input of `fleet.follow`: the number of the last event the caller has (the
|
|
10
|
+
* same commit-ordered numbers the console follows by), at most how many to
|
|
11
|
+
* answer, and how long to wait while none has come. Without a position it
|
|
12
|
+
* answers where to start from.
|
|
13
|
+
*/
|
|
14
|
+
export const followFleetInputSchema = z
|
|
15
|
+
.object({
|
|
16
|
+
afterSeq: z.int().min(0).optional(),
|
|
17
|
+
max: z.int().min(1).max(FOLLOW_MAX_LIMIT).optional(),
|
|
18
|
+
waitSeconds: z.int().min(0).max(FOLLOW_WAIT_MAX_SECONDS).optional(),
|
|
19
|
+
})
|
|
20
|
+
.optional();
|
|
21
|
+
/** Output of `fleet.follow`: the events after the position, oldest first, and the number to follow from next. */
|
|
22
|
+
export const followFleetOutputSchema = z.object({
|
|
23
|
+
events: z.array(liveFleetEventSchema),
|
|
24
|
+
lastSeq: z.int().min(0),
|
|
25
|
+
});
|
|
26
|
+
//# sourceMappingURL=follow.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"follow.js","sourceRoot":"","sources":["../../src/schemas/follow.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,oBAAoB,EAAE,MAAM,YAAY,CAAC;AAElD,qFAAqF;AACrF,MAAM,CAAC,MAAM,gBAAgB,GAAG,GAAG,CAAC;AACpC,MAAM,CAAC,MAAM,kBAAkB,GAAG,gBAAgB,CAAC;AAEnD,sEAAsE;AACtE,MAAM,CAAC,MAAM,uBAAuB,GAAG,EAAE,CAAC;AAE1C;;;;;GAKG;AACH,MAAM,CAAC,MAAM,sBAAsB,GAAG,CAAC;KACpC,MAAM,CAAC;IACN,QAAQ,EAAE,CAAC,CAAC,GAAG,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,QAAQ,EAAE;IACnC,GAAG,EAAE,CAAC,CAAC,GAAG,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,gBAAgB,CAAC,CAAC,QAAQ,EAAE;IACpD,WAAW,EAAE,CAAC,CAAC,GAAG,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,uBAAuB,CAAC,CAAC,QAAQ,EAAE;CACpE,CAAC;KACD,QAAQ,EAAE,CAAC;AAId,iHAAiH;AACjH,MAAM,CAAC,MAAM,uBAAuB,GAAG,CAAC,CAAC,MAAM,CAAC;IAC9C,MAAM,EAAE,CAAC,CAAC,KAAK,CAAC,oBAAoB,CAAC;IACrC,OAAO,EAAE,CAAC,CAAC,GAAG,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;CACxB,CAAC,CAAC"}
|
|
@@ -53,6 +53,30 @@ export declare const shipDetailOutputSchema: z.ZodObject<{
|
|
|
53
53
|
description: z.ZodNullable<z.ZodString>;
|
|
54
54
|
}, z.core.$strip>>;
|
|
55
55
|
lastSeenAt: z.ZodNullable<z.ZodISODateTime>;
|
|
56
|
+
ping: z.ZodNullable<z.ZodObject<{
|
|
57
|
+
state: z.ZodEnum<{
|
|
58
|
+
waiting: "waiting";
|
|
59
|
+
answered: "answered";
|
|
60
|
+
received: "received";
|
|
61
|
+
}>;
|
|
62
|
+
sentAt: z.ZodISODateTime;
|
|
63
|
+
answeredAt: z.ZodNullable<z.ZodISODateTime>;
|
|
64
|
+
}, z.core.$strip>>;
|
|
65
|
+
scopes: z.ZodArray<z.ZodEnum<{
|
|
66
|
+
"messages:send": "messages:send";
|
|
67
|
+
"messages:receive": "messages:receive";
|
|
68
|
+
"fleet:read": "fleet:read";
|
|
69
|
+
"fleet:manage": "fleet:manage";
|
|
70
|
+
}>>;
|
|
71
|
+
report: z.ZodNullable<z.ZodObject<{
|
|
72
|
+
state: z.ZodEnum<{
|
|
73
|
+
working: "working";
|
|
74
|
+
blocked: "blocked";
|
|
75
|
+
idle: "idle";
|
|
76
|
+
}>;
|
|
77
|
+
note: z.ZodNullable<z.ZodString>;
|
|
78
|
+
reportedAt: z.ZodISODateTime;
|
|
79
|
+
}, z.core.$strip>>;
|
|
56
80
|
commissionedAt: z.ZodISODateTime;
|
|
57
81
|
crewedSince: z.ZodNullable<z.ZodISODateTime>;
|
|
58
82
|
retiredAt: z.ZodNullable<z.ZodISODateTime>;
|
|
@@ -81,6 +105,7 @@ export declare const timelineEntrySchema: z.ZodObject<{
|
|
|
81
105
|
DeliveryAbandoned: "DeliveryAbandoned";
|
|
82
106
|
DeliveryDismissed: "DeliveryDismissed";
|
|
83
107
|
ShipRenamed: "ShipRenamed";
|
|
108
|
+
ShipReported: "ShipReported";
|
|
84
109
|
}>;
|
|
85
110
|
occurredAt: z.ZodISODateTime;
|
|
86
111
|
actor: z.ZodNullable<z.ZodObject<{
|
|
@@ -107,6 +132,7 @@ export declare const timelineEntrySchema: z.ZodObject<{
|
|
|
107
132
|
kind: z.ZodLiteral<"type">;
|
|
108
133
|
type: z.ZodString;
|
|
109
134
|
}, z.core.$strip>], "kind">;
|
|
135
|
+
contentType: z.ZodString;
|
|
110
136
|
}, z.core.$strip>>;
|
|
111
137
|
details: z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodNull]>>;
|
|
112
138
|
}, z.core.$strip>;
|
|
@@ -132,6 +158,7 @@ export declare const shipTimelineOutputSchema: z.ZodArray<z.ZodObject<{
|
|
|
132
158
|
DeliveryAbandoned: "DeliveryAbandoned";
|
|
133
159
|
DeliveryDismissed: "DeliveryDismissed";
|
|
134
160
|
ShipRenamed: "ShipRenamed";
|
|
161
|
+
ShipReported: "ShipReported";
|
|
135
162
|
}>;
|
|
136
163
|
occurredAt: z.ZodISODateTime;
|
|
137
164
|
actor: z.ZodNullable<z.ZodObject<{
|
|
@@ -158,6 +185,7 @@ export declare const shipTimelineOutputSchema: z.ZodArray<z.ZodObject<{
|
|
|
158
185
|
kind: z.ZodLiteral<"type">;
|
|
159
186
|
type: z.ZodString;
|
|
160
187
|
}, z.core.$strip>], "kind">;
|
|
188
|
+
contentType: z.ZodString;
|
|
161
189
|
}, z.core.$strip>>;
|
|
162
190
|
details: z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodNull]>>;
|
|
163
191
|
}, z.core.$strip>>;
|
package/dist/schemas/history.js
CHANGED
|
@@ -44,7 +44,13 @@ export const timelineEntrySchema = z.object({
|
|
|
44
44
|
ship: partySchema.nullable(),
|
|
45
45
|
/** The message it concerns, with its sender and recipient. */
|
|
46
46
|
message: z
|
|
47
|
-
.object({
|
|
47
|
+
.object({
|
|
48
|
+
id: idSchema('message'),
|
|
49
|
+
sender: partySchema,
|
|
50
|
+
recipient: messageRecipientSchema,
|
|
51
|
+
/** As the sender gave it; a ping has the reserved ping content type. */
|
|
52
|
+
contentType: z.string(),
|
|
53
|
+
})
|
|
48
54
|
.nullable(),
|
|
49
55
|
details: z.record(z.string(), z.union([z.string(), z.number(), z.boolean(), z.null()])),
|
|
50
56
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"history.js","sourceRoot":"","sources":["../../src/schemas/history.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,mBAAmB,EAAE,eAAe,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AAC7F,OAAO,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAC3C,OAAO,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AAE9C;;;;GAIG;AAEH,uBAAuB;AACvB,MAAM,OAAO,GAAG,CAAC,CAAC,GAAG,CAAC,QAAQ,EAAE,CAAC;AAEjC,2FAA2F;AAC3F,MAAM,CAAC,MAAM,WAAW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5
|
export * from './history.js';
|
|
5
6
|
export * from './message.js';
|
|
6
7
|
export * from './needs-attention.js';
|
|
7
8
|
export * from './operator-inbox.js';
|
|
9
|
+
export * from './ping.js';
|
|
10
|
+
export * from './report.js';
|
|
8
11
|
export * from './ship.js';
|
|
9
12
|
export * from './system.js';
|
package/dist/schemas/index.js
CHANGED
|
@@ -1,10 +1,13 @@
|
|
|
1
1
|
export * from './console.js';
|
|
2
2
|
export * from './delivery.js';
|
|
3
3
|
export * from './fleet.js';
|
|
4
|
+
export * from './follow.js';
|
|
4
5
|
export * from './history.js';
|
|
5
6
|
export * from './message.js';
|
|
6
7
|
export * from './needs-attention.js';
|
|
7
8
|
export * from './operator-inbox.js';
|
|
9
|
+
export * from './ping.js';
|
|
10
|
+
export * from './report.js';
|
|
8
11
|
export * from './ship.js';
|
|
9
12
|
export * from './system.js';
|
|
10
13
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/schemas/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAC;AAC7B,cAAc,eAAe,CAAC;AAC9B,cAAc,YAAY,CAAC;AAC3B,cAAc,cAAc,CAAC;AAC7B,cAAc,cAAc,CAAC;AAC7B,cAAc,sBAAsB,CAAC;AACrC,cAAc,qBAAqB,CAAC;AACpC,cAAc,WAAW,CAAC;AAC1B,cAAc,aAAa,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/schemas/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAC;AAC7B,cAAc,eAAe,CAAC;AAC9B,cAAc,YAAY,CAAC;AAC3B,cAAc,aAAa,CAAC;AAC5B,cAAc,cAAc,CAAC;AAC7B,cAAc,cAAc,CAAC;AAC7B,cAAc,sBAAsB,CAAC;AACrC,cAAc,qBAAqB,CAAC;AACpC,cAAc,WAAW,CAAC;AAC1B,cAAc,aAAa,CAAC;AAC5B,cAAc,WAAW,CAAC;AAC1B,cAAc,aAAa,CAAC"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
/**
|
|
3
|
+
* A ping: a message from argo to one crewed ship that its session answers
|
|
4
|
+
* with pong, proving the ship's model is working, not only its process. It
|
|
5
|
+
* travels as any message does, told apart by this reserved content type,
|
|
6
|
+
* which only the ping call sends.
|
|
7
|
+
*/
|
|
8
|
+
export declare const PING_CONTENT_TYPE = "application/vnd.aeolus.ping";
|
|
9
|
+
/**
|
|
10
|
+
* Whether a content type is the ping's: media types compare without case and
|
|
11
|
+
* without their parameters (RFC 9110), so no spelling of it slips past.
|
|
12
|
+
*/
|
|
13
|
+
export declare function isPingContentType(contentType: string): boolean;
|
|
14
|
+
/** Input of `fleet.ping`: the crewed ship to ping. */
|
|
15
|
+
export declare const pingShipInputSchema: z.ZodObject<{
|
|
16
|
+
shipId: z.ZodType<`shp_${string}`, unknown, z.core.$ZodTypeInternals<`shp_${string}`, unknown>>;
|
|
17
|
+
}, z.core.$strip>;
|
|
18
|
+
export type PingShipInput = z.infer<typeof pingShipInputSchema>;
|
|
19
|
+
/**
|
|
20
|
+
* Output of `fleet.ping`: the ship's open ping, when it was sent, and whether
|
|
21
|
+
* this call sent it. Pings never stack: while one is unanswered, ping answers
|
|
22
|
+
* with that one.
|
|
23
|
+
*/
|
|
24
|
+
export declare const pingShipOutputSchema: z.ZodObject<{
|
|
25
|
+
messageId: z.ZodType<`msg_${string}`, unknown, z.core.$ZodTypeInternals<`msg_${string}`, unknown>>;
|
|
26
|
+
sentAt: z.ZodISODateTime;
|
|
27
|
+
isNew: z.ZodBoolean;
|
|
28
|
+
}, z.core.$strip>;
|
|
29
|
+
export type PingShipOutput = z.infer<typeof pingShipOutputSchema>;
|
|
30
|
+
/** Input of `pong`: the ping delivery the ship answers. */
|
|
31
|
+
export declare const pongInputSchema: z.ZodObject<{
|
|
32
|
+
deliveryId: z.ZodType<`dlv_${string}`, unknown, z.core.$ZodTypeInternals<`dlv_${string}`, unknown>>;
|
|
33
|
+
}, z.core.$strip>;
|
|
34
|
+
export type PongInput = z.infer<typeof pongInputSchema>;
|
|
35
|
+
/** Output of `pong`: nothing; the OK is the answer. */
|
|
36
|
+
export declare const pongOutputSchema: z.ZodObject<{}, z.core.$strict>;
|
|
37
|
+
export type PongOutput = z.infer<typeof pongOutputSchema>;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { idSchema } from '../ids/index.js';
|
|
3
|
+
/**
|
|
4
|
+
* A ping: a message from argo to one crewed ship that its session answers
|
|
5
|
+
* with pong, proving the ship's model is working, not only its process. It
|
|
6
|
+
* travels as any message does, told apart by this reserved content type,
|
|
7
|
+
* which only the ping call sends.
|
|
8
|
+
*/
|
|
9
|
+
export const PING_CONTENT_TYPE = 'application/vnd.aeolus.ping';
|
|
10
|
+
/**
|
|
11
|
+
* Whether a content type is the ping's: media types compare without case and
|
|
12
|
+
* without their parameters (RFC 9110), so no spelling of it slips past.
|
|
13
|
+
*/
|
|
14
|
+
export function isPingContentType(contentType) {
|
|
15
|
+
const [essence = ''] = contentType.split(';');
|
|
16
|
+
return essence.trim().toLowerCase() === PING_CONTENT_TYPE;
|
|
17
|
+
}
|
|
18
|
+
/** Input of `fleet.ping`: the crewed ship to ping. */
|
|
19
|
+
export const pingShipInputSchema = z.object({ shipId: idSchema('ship') });
|
|
20
|
+
/**
|
|
21
|
+
* Output of `fleet.ping`: the ship's open ping, when it was sent, and whether
|
|
22
|
+
* this call sent it. Pings never stack: while one is unanswered, ping answers
|
|
23
|
+
* with that one.
|
|
24
|
+
*/
|
|
25
|
+
export const pingShipOutputSchema = z.object({
|
|
26
|
+
messageId: idSchema('message'),
|
|
27
|
+
sentAt: z.iso.datetime(),
|
|
28
|
+
isNew: z.boolean(),
|
|
29
|
+
});
|
|
30
|
+
/** Input of `pong`: the ping delivery the ship answers. */
|
|
31
|
+
export const pongInputSchema = z.object({ deliveryId: idSchema('delivery') });
|
|
32
|
+
/** Output of `pong`: nothing; the OK is the answer. */
|
|
33
|
+
export const pongOutputSchema = z.strictObject({});
|
|
34
|
+
//# sourceMappingURL=ping.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ping.js","sourceRoot":"","sources":["../../src/schemas/ping.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAE3C;;;;;GAKG;AACH,MAAM,CAAC,MAAM,iBAAiB,GAAG,6BAA6B,CAAC;AAE/D;;;GAGG;AACH,MAAM,UAAU,iBAAiB,CAAC,WAAmB;IACnD,MAAM,CAAC,OAAO,GAAG,EAAE,CAAC,GAAG,WAAW,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;IAC9C,OAAO,OAAO,CAAC,IAAI,EAAE,CAAC,WAAW,EAAE,KAAK,iBAAiB,CAAC;AAC5D,CAAC;AAED,sDAAsD;AACtD,MAAM,CAAC,MAAM,mBAAmB,GAAG,CAAC,CAAC,MAAM,CAAC,EAAE,MAAM,EAAE,QAAQ,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC;AAI1E;;;;GAIG;AACH,MAAM,CAAC,MAAM,oBAAoB,GAAG,CAAC,CAAC,MAAM,CAAC;IAC3C,SAAS,EAAE,QAAQ,CAAC,SAAS,CAAC;IAC9B,MAAM,EAAE,CAAC,CAAC,GAAG,CAAC,QAAQ,EAAE;IACxB,KAAK,EAAE,CAAC,CAAC,OAAO,EAAE;CACnB,CAAC,CAAC;AAIH,2DAA2D;AAC3D,MAAM,CAAC,MAAM,eAAe,GAAG,CAAC,CAAC,MAAM,CAAC,EAAE,UAAU,EAAE,QAAQ,CAAC,UAAU,CAAC,EAAE,CAAC,CAAC;AAI9E,uDAAuD;AACvD,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,CAAC,YAAY,CAAC,EAAE,CAAC,CAAC"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
/** What a crew says it is doing: working, blocked or idle. Plain data: nothing acts on it. */
|
|
3
|
+
export declare const REPORT_STATES: readonly ["working", "blocked", "idle"];
|
|
4
|
+
export declare const reportStateSchema: z.ZodEnum<{
|
|
5
|
+
working: "working";
|
|
6
|
+
blocked: "blocked";
|
|
7
|
+
idle: "idle";
|
|
8
|
+
}>;
|
|
9
|
+
export type ReportState = z.infer<typeof reportStateSchema>;
|
|
10
|
+
/** The longest a report's note may be. */
|
|
11
|
+
export declare const REPORT_NOTE_MAX_LENGTH = 200;
|
|
12
|
+
/** Whether a note fits on one line. */
|
|
13
|
+
export declare function isOneLine(text: string): boolean;
|
|
14
|
+
/** Input of `report`: the crew's state and a short note on what it is doing, trimmed. Calling it is a check-in. */
|
|
15
|
+
export declare const reportInputSchema: z.ZodObject<{
|
|
16
|
+
state: z.ZodEnum<{
|
|
17
|
+
working: "working";
|
|
18
|
+
blocked: "blocked";
|
|
19
|
+
idle: "idle";
|
|
20
|
+
}>;
|
|
21
|
+
note: z.ZodOptional<z.ZodString>;
|
|
22
|
+
}, z.core.$strip>;
|
|
23
|
+
export type ReportInput = z.infer<typeof reportInputSchema>;
|
|
24
|
+
/** Output of `report`: nothing; the OK is the answer. */
|
|
25
|
+
export declare const reportOutputSchema: z.ZodObject<{}, z.core.$strict>;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
/** What a crew says it is doing: working, blocked or idle. Plain data: nothing acts on it. */
|
|
3
|
+
export const REPORT_STATES = ['working', 'blocked', 'idle'];
|
|
4
|
+
export const reportStateSchema = z.enum(REPORT_STATES);
|
|
5
|
+
/** The longest a report's note may be. */
|
|
6
|
+
export const REPORT_NOTE_MAX_LENGTH = 200;
|
|
7
|
+
const NOTE_MESSAGE = `A note is one line of at most ${String(REPORT_NOTE_MAX_LENGTH)} characters`;
|
|
8
|
+
/** Whether a note fits on one line. */
|
|
9
|
+
export function isOneLine(text) {
|
|
10
|
+
return !/[\r\n]/.test(text);
|
|
11
|
+
}
|
|
12
|
+
/** Input of `report`: the crew's state and a short note on what it is doing, trimmed. Calling it is a check-in. */
|
|
13
|
+
export const reportInputSchema = z.object({
|
|
14
|
+
state: reportStateSchema,
|
|
15
|
+
note: z.string().trim().max(REPORT_NOTE_MAX_LENGTH, NOTE_MESSAGE).refine(isOneLine, NOTE_MESSAGE).optional(),
|
|
16
|
+
});
|
|
17
|
+
/** Output of `report`: nothing; the OK is the answer. */
|
|
18
|
+
export const reportOutputSchema = z.strictObject({});
|
|
19
|
+
//# sourceMappingURL=report.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"report.js","sourceRoot":"","sources":["../../src/schemas/report.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,8FAA8F;AAC9F,MAAM,CAAC,MAAM,aAAa,GAAG,CAAC,SAAS,EAAE,SAAS,EAAE,MAAM,CAAU,CAAC;AACrE,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAC,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC;AAGvD,0CAA0C;AAC1C,MAAM,CAAC,MAAM,sBAAsB,GAAG,GAAG,CAAC;AAE1C,MAAM,YAAY,GAAG,iCAAiC,MAAM,CAAC,sBAAsB,CAAC,aAAa,CAAC;AAElG,uCAAuC;AACvC,MAAM,UAAU,SAAS,CAAC,IAAY;IACpC,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AAC9B,CAAC;AAED,mHAAmH;AACnH,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAC,CAAC,MAAM,CAAC;IACxC,KAAK,EAAE,iBAAiB;IACxB,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,IAAI,EAAE,CAAC,GAAG,CAAC,sBAAsB,EAAE,YAAY,CAAC,CAAC,MAAM,CAAC,SAAS,EAAE,YAAY,CAAC,CAAC,QAAQ,EAAE;CAC7G,CAAC,CAAC;AAIH,yDAAyD;AACzD,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAAC,CAAC,YAAY,CAAC,EAAE,CAAC,CAAC"}
|