@aeolus-fleet/common 0.7.0 → 0.8.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/schemas/fleet.d.ts +31 -1
- package/dist/schemas/fleet.js +22 -3
- package/dist/schemas/fleet.js.map +1 -1
- package/dist/schemas/history.d.ts +11 -0
- package/dist/schemas/history.js +7 -1
- package/dist/schemas/history.js.map +1 -1
- package/dist/schemas/index.d.ts +1 -0
- package/dist/schemas/index.js +1 -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/package.json +1 -1
package/dist/schemas/fleet.d.ts
CHANGED
|
@@ -3,7 +3,11 @@ 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;
|
|
@@ -60,6 +64,14 @@ export declare const retireShipOutputSchema: z.ZodObject<{
|
|
|
60
64
|
export declare const recrewShipInputSchema: z.ZodObject<{
|
|
61
65
|
shipId: z.ZodType<`shp_${string}`, unknown, z.core.$ZodTypeInternals<`shp_${string}`, unknown>>;
|
|
62
66
|
}, z.core.$strip>;
|
|
67
|
+
/** How a ship's last ping stands: waiting for an answer, answered with pong, or received with a plain ack. */
|
|
68
|
+
export declare const PING_STATES: readonly ["waiting", "answered", "received"];
|
|
69
|
+
export declare const pingStateSchema: z.ZodEnum<{
|
|
70
|
+
waiting: "waiting";
|
|
71
|
+
answered: "answered";
|
|
72
|
+
received: "received";
|
|
73
|
+
}>;
|
|
74
|
+
export type PingState = z.infer<typeof pingStateSchema>;
|
|
63
75
|
/**
|
|
64
76
|
* One ship in `fleet.list`. `startingPrompt` is the prompt holding the ship's
|
|
65
77
|
* valid secret, when there is one: when it was issued and whether a session
|
|
@@ -94,6 +106,15 @@ export declare const listedShipSchema: z.ZodObject<{
|
|
|
94
106
|
description: z.ZodNullable<z.ZodString>;
|
|
95
107
|
}, z.core.$strip>>;
|
|
96
108
|
lastSeenAt: z.ZodNullable<z.ZodISODateTime>;
|
|
109
|
+
ping: z.ZodNullable<z.ZodObject<{
|
|
110
|
+
state: z.ZodEnum<{
|
|
111
|
+
waiting: "waiting";
|
|
112
|
+
answered: "answered";
|
|
113
|
+
received: "received";
|
|
114
|
+
}>;
|
|
115
|
+
sentAt: z.ZodISODateTime;
|
|
116
|
+
answeredAt: z.ZodNullable<z.ZodISODateTime>;
|
|
117
|
+
}, z.core.$strip>>;
|
|
97
118
|
}, z.core.$strip>;
|
|
98
119
|
export type ListedShip = z.infer<typeof listedShipSchema>;
|
|
99
120
|
/** Output of `fleet.list`: every ship in the caller's fleet, `argo` included. */
|
|
@@ -124,6 +145,15 @@ export declare const fleetListOutputSchema: z.ZodArray<z.ZodObject<{
|
|
|
124
145
|
description: z.ZodNullable<z.ZodString>;
|
|
125
146
|
}, z.core.$strip>>;
|
|
126
147
|
lastSeenAt: z.ZodNullable<z.ZodISODateTime>;
|
|
148
|
+
ping: z.ZodNullable<z.ZodObject<{
|
|
149
|
+
state: z.ZodEnum<{
|
|
150
|
+
waiting: "waiting";
|
|
151
|
+
answered: "answered";
|
|
152
|
+
received: "received";
|
|
153
|
+
}>;
|
|
154
|
+
sentAt: z.ZodISODateTime;
|
|
155
|
+
answeredAt: z.ZodNullable<z.ZodISODateTime>;
|
|
156
|
+
}, z.core.$strip>>;
|
|
127
157
|
}, z.core.$strip>>;
|
|
128
158
|
/**
|
|
129
159
|
* Input of the `fleet.events` subscription: the number of the last event the
|
package/dist/schemas/fleet.js
CHANGED
|
@@ -5,10 +5,14 @@ import { idSchema } from '../ids/index.js';
|
|
|
5
5
|
* Inputs and outputs of the fleet procedures: commission a ship, get its
|
|
6
6
|
* starting prompt, release it, list the fleet, follow its events live.
|
|
7
7
|
*/
|
|
8
|
-
/**
|
|
8
|
+
/**
|
|
9
|
+
* A ship's name and its type are handles (docs/blueprint.md, "Ship"). A colon
|
|
10
|
+
* is an ordinary character, so a prefix can group ships (`hemma:planner`); it
|
|
11
|
+
* carries no meaning for the fleet.
|
|
12
|
+
*/
|
|
9
13
|
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
|
|
14
|
+
export const SHIP_HANDLE_PATTERN = /^[a-z0-9:-]+$/;
|
|
15
|
+
const HANDLE_MESSAGE = `Use 1 to ${SHIP_HANDLE_MAX_LENGTH} lowercase letters, digits, hyphens or colons`;
|
|
12
16
|
export const shipHandleSchema = z
|
|
13
17
|
.string()
|
|
14
18
|
.max(SHIP_HANDLE_MAX_LENGTH, HANDLE_MESSAGE)
|
|
@@ -55,6 +59,9 @@ export const retireShipOutputSchema = z.object({ abandonedDeliveries: z.int().mi
|
|
|
55
59
|
* a new starting prompt, as from `fleet.getStartingPrompt`.
|
|
56
60
|
*/
|
|
57
61
|
export const recrewShipInputSchema = z.object({ shipId: idSchema('ship') });
|
|
62
|
+
/** How a ship's last ping stands: waiting for an answer, answered with pong, or received with a plain ack. */
|
|
63
|
+
export const PING_STATES = ['waiting', 'answered', 'received'];
|
|
64
|
+
export const pingStateSchema = z.enum(PING_STATES);
|
|
58
65
|
/**
|
|
59
66
|
* One ship in `fleet.list`. `startingPrompt` is the prompt holding the ship's
|
|
60
67
|
* valid secret, when there is one: when it was issued and whether a session
|
|
@@ -88,6 +95,18 @@ export const listedShipSchema = z.object({
|
|
|
88
95
|
* observation only, nothing acts on it. Null while no session crews it.
|
|
89
96
|
*/
|
|
90
97
|
lastSeenAt: z.iso.datetime().nullable(),
|
|
98
|
+
/**
|
|
99
|
+
* The ship's last ping (ISO 8601 in UTC): when argo sent it, how it stands,
|
|
100
|
+
* and when pong answered it. Null before any ping, or when the last one went
|
|
101
|
+
* undeliverable. Observation only.
|
|
102
|
+
*/
|
|
103
|
+
ping: z
|
|
104
|
+
.object({
|
|
105
|
+
state: pingStateSchema,
|
|
106
|
+
sentAt: z.iso.datetime(),
|
|
107
|
+
answeredAt: z.iso.datetime().nullable(),
|
|
108
|
+
})
|
|
109
|
+
.nullable(),
|
|
91
110
|
});
|
|
92
111
|
/** Output of `fleet.list`: every ship in the caller's fleet, `argo` included. */
|
|
93
112
|
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;AAC1G,OAAO,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAE3C;;;GAGG;AAEH
|
|
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;AAC1G,OAAO,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAE3C;;;GAGG;AAEH;;;;GAIG;AACH,MAAM,CA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e;IACrB,uBAAuB;IACvB,UAAU,EAAE,CAAC,CAAC,GAAG,CAAC,QAAQ,EAAE;IAC5B,oDAAoD;IACpD,WAAW,EAAE,QAAQ,CAAC,MAAM,CAAC,CAAC,QAAQ,EAAE;IACxC,MAAM,EAAE,QAAQ,CAAC,MAAM,CAAC,CAAC,QAAQ,EAAE;IACnC,SAAS,EAAE,QAAQ,CAAC,SAAS,CAAC,CAAC,QAAQ,EAAE;IACzC,UAAU,EAAE,QAAQ,CAAC,UAAU,CAAC,CAAC,QAAQ,EAAE;CAC5C,CAAC,CAAC;AAIH;;;GAGG;AACH,MAAM,CAAC,MAAM,qBAAqB,GAAG,CAAC,CAAC,kBAAkB,CAAC,MAAM,EAAE;IAChE,CAAC,CAAC,MAAM,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC,OAAO,CAAC,OAAO,CAAC,EAAE,KAAK,EAAE,oBAAoB,EAAE,CAAC;IACnE,CAAC,CAAC,MAAM,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC,OAAO,CAAC,QAAQ,CAAC,EAAE,CAAC;CACxC,CAAC,CAAC"}
|
|
@@ -53,6 +53,15 @@ 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>>;
|
|
56
65
|
commissionedAt: z.ZodISODateTime;
|
|
57
66
|
crewedSince: z.ZodNullable<z.ZodISODateTime>;
|
|
58
67
|
retiredAt: z.ZodNullable<z.ZodISODateTime>;
|
|
@@ -107,6 +116,7 @@ export declare const timelineEntrySchema: z.ZodObject<{
|
|
|
107
116
|
kind: z.ZodLiteral<"type">;
|
|
108
117
|
type: z.ZodString;
|
|
109
118
|
}, z.core.$strip>], "kind">;
|
|
119
|
+
contentType: z.ZodString;
|
|
110
120
|
}, z.core.$strip>>;
|
|
111
121
|
details: z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodNull]>>;
|
|
112
122
|
}, z.core.$strip>;
|
|
@@ -158,6 +168,7 @@ export declare const shipTimelineOutputSchema: z.ZodArray<z.ZodObject<{
|
|
|
158
168
|
kind: z.ZodLiteral<"type">;
|
|
159
169
|
type: z.ZodString;
|
|
160
170
|
}, z.core.$strip>], "kind">;
|
|
171
|
+
contentType: z.ZodString;
|
|
161
172
|
}, z.core.$strip>>;
|
|
162
173
|
details: z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodNull]>>;
|
|
163
174
|
}, 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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AC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,WAAW,EAAE;QACxC,SAAS,EAAE,WAAW,CAAC,QAAQ,EAAE;QACjC,OAAO,EAAE,CAAC,CAAC,KAAK,CAAC,0BAA0B,CAAC;KAC7C,CAAC;CACH,CAAC,CAAC"}
|
package/dist/schemas/index.d.ts
CHANGED
package/dist/schemas/index.js
CHANGED
|
@@ -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,cAAc,CAAC;AAC7B,cAAc,cAAc,CAAC;AAC7B,cAAc,sBAAsB,CAAC;AACrC,cAAc,qBAAqB,CAAC;AACpC,cAAc,WAAW,CAAC;AAC1B,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"}
|