@aeolus-fleet/common 0.9.0 → 0.11.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 +28 -2
- package/dist/schemas/fleet.js +25 -4
- package/dist/schemas/fleet.js.map +1 -1
- package/dist/schemas/history.d.ts +1 -0
- package/dist/schemas/idempotency-key.d.ts +5 -0
- package/dist/schemas/idempotency-key.js +6 -0
- package/dist/schemas/idempotency-key.js.map +1 -0
- 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/message.d.ts +0 -2
- package/dist/schemas/message.js +2 -3
- package/dist/schemas/message.js.map +1 -1
- package/package.json +1 -1
package/dist/schemas/fleet.d.ts
CHANGED
|
@@ -16,6 +16,8 @@ export declare const SHIP_NOTE_MAX_LENGTH = 500;
|
|
|
16
16
|
* Input of `fleet.commission`. The note is free text for the operator;
|
|
17
17
|
* whitespace around it is dropped. `fleetScopes` adds fleet:read and/or
|
|
18
18
|
* fleet:manage to the scopes every agent ship has; none when left out.
|
|
19
|
+
* `idempotencyKey` is the caller's own key, as for a send: a retry with the
|
|
20
|
+
* same key and the same request commissions no second ship.
|
|
19
21
|
*/
|
|
20
22
|
export declare const commissionShipInputSchema: z.ZodObject<{
|
|
21
23
|
name: z.ZodString;
|
|
@@ -25,6 +27,7 @@ export declare const commissionShipInputSchema: z.ZodObject<{
|
|
|
25
27
|
"fleet:manage": "fleet:manage";
|
|
26
28
|
}>>>;
|
|
27
29
|
note: z.ZodOptional<z.ZodString>;
|
|
30
|
+
idempotencyKey: z.ZodString;
|
|
28
31
|
}, z.core.$strip>;
|
|
29
32
|
export type CommissionShipInput = z.infer<typeof commissionShipInputSchema>;
|
|
30
33
|
/** Input of `fleet.getStartingPrompt`. */
|
|
@@ -43,6 +46,22 @@ export declare const startingPromptOutputSchema: z.ZodObject<{
|
|
|
43
46
|
crewLine: z.ZodString;
|
|
44
47
|
}, z.core.$strip>;
|
|
45
48
|
export type StartingPromptOutput = z.infer<typeof startingPromptOutputSchema>;
|
|
49
|
+
/**
|
|
50
|
+
* Output of `fleet.commission`: the ship, and on the first commission its
|
|
51
|
+
* starting prompt and crew line, shown once. A repeat under the same key
|
|
52
|
+
* answers neither (the secret is never readable again), and says how its
|
|
53
|
+
* starting prompt stands; get a new one with `fleet.getStartingPrompt`.
|
|
54
|
+
*/
|
|
55
|
+
export declare const commissionShipOutputSchema: z.ZodObject<{
|
|
56
|
+
shipId: z.ZodType<`shp_${string}`, unknown, z.core.$ZodTypeInternals<`shp_${string}`, unknown>>;
|
|
57
|
+
prompt: z.ZodNullable<z.ZodString>;
|
|
58
|
+
crewLine: z.ZodNullable<z.ZodString>;
|
|
59
|
+
startingPrompt: z.ZodNullable<z.ZodObject<{
|
|
60
|
+
issuedAt: z.ZodISODateTime;
|
|
61
|
+
isClaimed: z.ZodBoolean;
|
|
62
|
+
}, z.core.$strip>>;
|
|
63
|
+
}, z.core.$strip>;
|
|
64
|
+
export type CommissionShipOutput = z.infer<typeof commissionShipOutputSchema>;
|
|
46
65
|
/** Input of `fleet.release`: the crewed ship whose session loses it. */
|
|
47
66
|
export declare const releaseShipInputSchema: z.ZodObject<{
|
|
48
67
|
shipId: z.ZodType<`shp_${string}`, unknown, z.core.$ZodTypeInternals<`shp_${string}`, unknown>>;
|
|
@@ -72,9 +91,14 @@ export declare const retireShipOutputSchema: z.ZodObject<{
|
|
|
72
91
|
export declare const recrewShipInputSchema: z.ZodObject<{
|
|
73
92
|
shipId: z.ZodType<`shp_${string}`, unknown, z.core.$ZodTypeInternals<`shp_${string}`, unknown>>;
|
|
74
93
|
}, z.core.$strip>;
|
|
75
|
-
/**
|
|
76
|
-
|
|
94
|
+
/**
|
|
95
|
+
* How a ship's last ping stands: waiting for an answer, answered with pong,
|
|
96
|
+
* received with a plain ack, or undeliverable: handed out again and again and
|
|
97
|
+
* never acknowledged.
|
|
98
|
+
*/
|
|
99
|
+
export declare const PING_STATES: readonly ["waiting", "answered", "received", "undeliverable"];
|
|
77
100
|
export declare const pingStateSchema: z.ZodEnum<{
|
|
101
|
+
undeliverable: "undeliverable";
|
|
78
102
|
waiting: "waiting";
|
|
79
103
|
answered: "answered";
|
|
80
104
|
received: "received";
|
|
@@ -116,6 +140,7 @@ export declare const listedShipSchema: z.ZodObject<{
|
|
|
116
140
|
lastSeenAt: z.ZodNullable<z.ZodISODateTime>;
|
|
117
141
|
ping: z.ZodNullable<z.ZodObject<{
|
|
118
142
|
state: z.ZodEnum<{
|
|
143
|
+
undeliverable: "undeliverable";
|
|
119
144
|
waiting: "waiting";
|
|
120
145
|
answered: "answered";
|
|
121
146
|
received: "received";
|
|
@@ -170,6 +195,7 @@ export declare const fleetListOutputSchema: z.ZodArray<z.ZodObject<{
|
|
|
170
195
|
lastSeenAt: z.ZodNullable<z.ZodISODateTime>;
|
|
171
196
|
ping: z.ZodNullable<z.ZodObject<{
|
|
172
197
|
state: z.ZodEnum<{
|
|
198
|
+
undeliverable: "undeliverable";
|
|
173
199
|
waiting: "waiting";
|
|
174
200
|
answered: "answered";
|
|
175
201
|
received: "received";
|
package/dist/schemas/fleet.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
import { eventTypeSchema, fleetScopeSchema, locationKindSchema, scopeSchema, shipKindSchema, shipStatusSchema } from '../fleet/index.js';
|
|
3
3
|
import { idSchema } from '../ids/index.js';
|
|
4
|
+
import { idempotencyKeySchema } from './idempotency-key.js';
|
|
4
5
|
import { reportStateSchema } from './report.js';
|
|
5
6
|
/**
|
|
6
7
|
* Inputs and outputs of the fleet procedures: commission a ship, get its
|
|
@@ -23,6 +24,8 @@ export const SHIP_NOTE_MAX_LENGTH = 500;
|
|
|
23
24
|
* Input of `fleet.commission`. The note is free text for the operator;
|
|
24
25
|
* whitespace around it is dropped. `fleetScopes` adds fleet:read and/or
|
|
25
26
|
* fleet:manage to the scopes every agent ship has; none when left out.
|
|
27
|
+
* `idempotencyKey` is the caller's own key, as for a send: a retry with the
|
|
28
|
+
* same key and the same request commissions no second ship.
|
|
26
29
|
*/
|
|
27
30
|
export const commissionShipInputSchema = z.object({
|
|
28
31
|
name: shipHandleSchema,
|
|
@@ -33,6 +36,7 @@ export const commissionShipInputSchema = z.object({
|
|
|
33
36
|
.trim()
|
|
34
37
|
.max(SHIP_NOTE_MAX_LENGTH, `A note is at most ${SHIP_NOTE_MAX_LENGTH} characters`)
|
|
35
38
|
.optional(),
|
|
39
|
+
idempotencyKey: idempotencyKeySchema,
|
|
36
40
|
});
|
|
37
41
|
/** Input of `fleet.getStartingPrompt`. */
|
|
38
42
|
export const getStartingPromptInputSchema = z.object({ shipId: idSchema('ship') });
|
|
@@ -48,6 +52,19 @@ export const startingPromptOutputSchema = z.object({
|
|
|
48
52
|
/** `/aeolus:crew <fleetUrl> <shipId> <secret>`. */
|
|
49
53
|
crewLine: z.string(),
|
|
50
54
|
});
|
|
55
|
+
/**
|
|
56
|
+
* Output of `fleet.commission`: the ship, and on the first commission its
|
|
57
|
+
* starting prompt and crew line, shown once. A repeat under the same key
|
|
58
|
+
* answers neither (the secret is never readable again), and says how its
|
|
59
|
+
* starting prompt stands; get a new one with `fleet.getStartingPrompt`.
|
|
60
|
+
*/
|
|
61
|
+
export const commissionShipOutputSchema = z.object({
|
|
62
|
+
shipId: idSchema('ship'),
|
|
63
|
+
prompt: z.string().nullable(),
|
|
64
|
+
crewLine: z.string().nullable(),
|
|
65
|
+
/** When its valid secret was issued (ISO 8601 in UTC) and whether a session claimed it; null when it has none. */
|
|
66
|
+
startingPrompt: z.object({ issuedAt: z.iso.datetime(), isClaimed: z.boolean() }).nullable(),
|
|
67
|
+
});
|
|
51
68
|
/** Input of `fleet.release`: the crewed ship whose session loses it. */
|
|
52
69
|
export const releaseShipInputSchema = z.object({ shipId: idSchema('ship') });
|
|
53
70
|
/** Output of `fleet.release`: nothing; the OK is the answer. */
|
|
@@ -65,8 +82,12 @@ export const retireShipOutputSchema = z.object({ abandonedDeliveries: z.int().mi
|
|
|
65
82
|
* a new starting prompt, as from `fleet.getStartingPrompt`.
|
|
66
83
|
*/
|
|
67
84
|
export const recrewShipInputSchema = z.object({ shipId: idSchema('ship') });
|
|
68
|
-
/**
|
|
69
|
-
|
|
85
|
+
/**
|
|
86
|
+
* How a ship's last ping stands: waiting for an answer, answered with pong,
|
|
87
|
+
* received with a plain ack, or undeliverable: handed out again and again and
|
|
88
|
+
* never acknowledged.
|
|
89
|
+
*/
|
|
90
|
+
export const PING_STATES = ['waiting', 'answered', 'received', 'undeliverable'];
|
|
70
91
|
export const pingStateSchema = z.enum(PING_STATES);
|
|
71
92
|
/**
|
|
72
93
|
* One ship in `fleet.list`. `startingPrompt` is the prompt holding the ship's
|
|
@@ -103,8 +124,8 @@ export const listedShipSchema = z.object({
|
|
|
103
124
|
lastSeenAt: z.iso.datetime().nullable(),
|
|
104
125
|
/**
|
|
105
126
|
* 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
|
|
107
|
-
*
|
|
127
|
+
* and when pong answered it. Null before any ping, or once the operator
|
|
128
|
+
* dismissed the last one. Observation only.
|
|
108
129
|
*/
|
|
109
130
|
ping: z
|
|
110
131
|
.object({
|
|
@@ -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,gBAAgB,EAAE,kBAAkB,EAAE,WAAW,EAAE,cAAc,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AACzI,OAAO,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAC3C,OAAO,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAEhD;;;GAGG;AAEH;;;;GAIG;AACH,MA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ateTime>;
|
|
56
56
|
ping: z.ZodNullable<z.ZodObject<{
|
|
57
57
|
state: z.ZodEnum<{
|
|
58
|
+
undeliverable: "undeliverable";
|
|
58
59
|
waiting: "waiting";
|
|
59
60
|
answered: "answered";
|
|
60
61
|
received: "received";
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
/** The longest idempotency key a caller may give. It is opaque: any text of 1 to this many characters. */
|
|
3
|
+
export declare const IDEMPOTENCY_KEY_MAX_LENGTH = 256;
|
|
4
|
+
/** The caller's own key for one send or one commission, so a retry never does it twice. */
|
|
5
|
+
export declare const idempotencyKeySchema: z.ZodString;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
/** The longest idempotency key a caller may give. It is opaque: any text of 1 to this many characters. */
|
|
3
|
+
export const IDEMPOTENCY_KEY_MAX_LENGTH = 256;
|
|
4
|
+
/** The caller's own key for one send or one commission, so a retry never does it twice. */
|
|
5
|
+
export const idempotencyKeySchema = z.string().min(1).max(IDEMPOTENCY_KEY_MAX_LENGTH);
|
|
6
|
+
//# sourceMappingURL=idempotency-key.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"idempotency-key.js","sourceRoot":"","sources":["../../src/schemas/idempotency-key.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,0GAA0G;AAC1G,MAAM,CAAC,MAAM,0BAA0B,GAAG,GAAG,CAAC;AAE9C,2FAA2F;AAC3F,MAAM,CAAC,MAAM,oBAAoB,GAAG,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,0BAA0B,CAAC,CAAC"}
|
package/dist/schemas/index.d.ts
CHANGED
|
@@ -3,6 +3,7 @@ export * from './delivery.js';
|
|
|
3
3
|
export * from './fleet.js';
|
|
4
4
|
export * from './follow.js';
|
|
5
5
|
export * from './history.js';
|
|
6
|
+
export * from './idempotency-key.js';
|
|
6
7
|
export * from './message.js';
|
|
7
8
|
export * from './needs-attention.js';
|
|
8
9
|
export * from './operator-inbox.js';
|
package/dist/schemas/index.js
CHANGED
|
@@ -3,6 +3,7 @@ export * from './delivery.js';
|
|
|
3
3
|
export * from './fleet.js';
|
|
4
4
|
export * from './follow.js';
|
|
5
5
|
export * from './history.js';
|
|
6
|
+
export * from './idempotency-key.js';
|
|
6
7
|
export * from './message.js';
|
|
7
8
|
export * from './needs-attention.js';
|
|
8
9
|
export * from './operator-inbox.js';
|
|
@@ -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,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"}
|
|
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,sBAAsB,CAAC;AACrC,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"}
|
|
@@ -26,8 +26,6 @@ export declare function isMediaType(value: string): boolean;
|
|
|
26
26
|
* payload by it (ADR 0016: no policy).
|
|
27
27
|
*/
|
|
28
28
|
export declare const contentTypeSchema: z.ZodString;
|
|
29
|
-
/** The longest idempotency key a sender may give. It is opaque: any text of 1 to this many characters. */
|
|
30
|
-
export declare const IDEMPOTENCY_KEY_MAX_LENGTH = 256;
|
|
31
29
|
/**
|
|
32
30
|
* Who a message is for (docs/blueprint.md, "Selector"): one ship, by id or by
|
|
33
31
|
* name, or any ship of a type. A name is resolved to the ship's id at send time.
|
package/dist/schemas/message.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
import { idSchema } from '../ids/index.js';
|
|
3
3
|
import { shipHandleSchema } from './fleet.js';
|
|
4
|
+
import { idempotencyKeySchema } from './idempotency-key.js';
|
|
4
5
|
/**
|
|
5
6
|
* Inputs and outputs of sending a message (`ship.send`): who it is for, its
|
|
6
7
|
* payload and content type, the sender's idempotency key, and the message it
|
|
@@ -44,8 +45,6 @@ export const contentTypeSchema = z
|
|
|
44
45
|
.string()
|
|
45
46
|
.max(CONTENT_TYPE_MAX_LENGTH, CONTENT_TYPE_MESSAGE)
|
|
46
47
|
.refine(isMediaType, CONTENT_TYPE_MESSAGE);
|
|
47
|
-
/** The longest idempotency key a sender may give. It is opaque: any text of 1 to this many characters. */
|
|
48
|
-
export const IDEMPOTENCY_KEY_MAX_LENGTH = 256;
|
|
49
48
|
/**
|
|
50
49
|
* Who a message is for (docs/blueprint.md, "Selector"): one ship, by id or by
|
|
51
50
|
* name, or any ship of a type. A name is resolved to the ship's id at send time.
|
|
@@ -63,7 +62,7 @@ export const sendInputSchema = z.object({
|
|
|
63
62
|
.refine((payload) => payloadBytes(payload) <= PAYLOAD_MAX_BYTES, `A payload is at most ${PAYLOAD_MAX_BYTES} bytes (64 KB) in UTF-8`),
|
|
64
63
|
/** Without it, the payload is text/plain. */
|
|
65
64
|
contentType: contentTypeSchema.optional(),
|
|
66
|
-
idempotencyKey:
|
|
65
|
+
idempotencyKey: idempotencyKeySchema,
|
|
67
66
|
/** The id of the message, in the same fleet, that this one replies to. */
|
|
68
67
|
inReplyTo: idSchema('message').optional(),
|
|
69
68
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"message.js","sourceRoot":"","sources":["../../src/schemas/message.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAC3C,OAAO,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"message.js","sourceRoot":"","sources":["../../src/schemas/message.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAC3C,OAAO,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AAC9C,OAAO,EAAE,oBAAoB,EAAE,MAAM,sBAAsB,CAAC;AAE5D;;;;GAIG;AAEH;;;GAGG;AACH,MAAM,CAAC,MAAM,iBAAiB,GAAG,EAAE,GAAG,IAAI,CAAC;AAE3C,MAAM,IAAI,GAAG,IAAI,WAAW,EAAE,CAAC;AAE/B;;;GAGG;AACH,MAAM,UAAU,YAAY,CAAC,OAAe;IAC1C,OAAO,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,UAAU,CAAC;AACzC,CAAC;AAED,uEAAuE;AACvE,MAAM,CAAC,MAAM,uBAAuB,GAAG,GAAG,CAAC;AAE3C,6DAA6D;AAC7D,MAAM,CAAC,MAAM,oBAAoB,GAAG,YAAY,CAAC;AAEjD,6EAA6E;AAC7E,0EAA0E;AAC1E,yEAAyE;AACzE,MAAM,KAAK,GAAG,+BAA+B,CAAC;AAC9C,MAAM,aAAa,GAAG,sFAAsF,CAAC;AAC7G,MAAM,KAAK,GAAG,SAAS,CAAC;AACxB,MAAM,UAAU,GAAG,IAAI,MAA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