@aeolus-fleet/common 0.8.0 → 0.10.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 +60 -1
- package/dist/schemas/fleet.js +38 -2
- 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 +17 -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 +3 -0
- package/dist/schemas/index.js +3 -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/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,M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AM,CAAC,MAAM,mBAAmB,GAAG,CAAC,CAAC,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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,MAAM,CAAC,MAAM,oBAAoB,GAAG,CAAC,CAAC,YAAY,CAAC,EAAE,CAAC,CAAC"}
|
package/dist/schemas/fleet.d.ts
CHANGED
|
@@ -12,11 +12,22 @@ export declare const SHIP_HANDLE_MAX_LENGTH = 48;
|
|
|
12
12
|
export declare const SHIP_HANDLE_PATTERN: RegExp;
|
|
13
13
|
export declare const shipHandleSchema: z.ZodString;
|
|
14
14
|
export declare const SHIP_NOTE_MAX_LENGTH = 500;
|
|
15
|
-
/**
|
|
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
|
+
* `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.
|
|
21
|
+
*/
|
|
16
22
|
export declare const commissionShipInputSchema: z.ZodObject<{
|
|
17
23
|
name: z.ZodString;
|
|
18
24
|
type: z.ZodString;
|
|
25
|
+
fleetScopes: z.ZodOptional<z.ZodArray<z.ZodEnum<{
|
|
26
|
+
"fleet:read": "fleet:read";
|
|
27
|
+
"fleet:manage": "fleet:manage";
|
|
28
|
+
}>>>;
|
|
19
29
|
note: z.ZodOptional<z.ZodString>;
|
|
30
|
+
idempotencyKey: z.ZodString;
|
|
20
31
|
}, z.core.$strip>;
|
|
21
32
|
export type CommissionShipInput = z.infer<typeof commissionShipInputSchema>;
|
|
22
33
|
/** Input of `fleet.getStartingPrompt`. */
|
|
@@ -35,6 +46,22 @@ export declare const startingPromptOutputSchema: z.ZodObject<{
|
|
|
35
46
|
crewLine: z.ZodString;
|
|
36
47
|
}, z.core.$strip>;
|
|
37
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>;
|
|
38
65
|
/** Input of `fleet.release`: the crewed ship whose session loses it. */
|
|
39
66
|
export declare const releaseShipInputSchema: z.ZodObject<{
|
|
40
67
|
shipId: z.ZodType<`shp_${string}`, unknown, z.core.$ZodTypeInternals<`shp_${string}`, unknown>>;
|
|
@@ -115,6 +142,21 @@ export declare const listedShipSchema: z.ZodObject<{
|
|
|
115
142
|
sentAt: z.ZodISODateTime;
|
|
116
143
|
answeredAt: z.ZodNullable<z.ZodISODateTime>;
|
|
117
144
|
}, z.core.$strip>>;
|
|
145
|
+
scopes: z.ZodArray<z.ZodEnum<{
|
|
146
|
+
"messages:send": "messages:send";
|
|
147
|
+
"messages:receive": "messages:receive";
|
|
148
|
+
"fleet:read": "fleet:read";
|
|
149
|
+
"fleet:manage": "fleet:manage";
|
|
150
|
+
}>>;
|
|
151
|
+
report: z.ZodNullable<z.ZodObject<{
|
|
152
|
+
state: z.ZodEnum<{
|
|
153
|
+
working: "working";
|
|
154
|
+
blocked: "blocked";
|
|
155
|
+
idle: "idle";
|
|
156
|
+
}>;
|
|
157
|
+
note: z.ZodNullable<z.ZodString>;
|
|
158
|
+
reportedAt: z.ZodISODateTime;
|
|
159
|
+
}, z.core.$strip>>;
|
|
118
160
|
}, z.core.$strip>;
|
|
119
161
|
export type ListedShip = z.infer<typeof listedShipSchema>;
|
|
120
162
|
/** Output of `fleet.list`: every ship in the caller's fleet, `argo` included. */
|
|
@@ -154,6 +196,21 @@ export declare const fleetListOutputSchema: z.ZodArray<z.ZodObject<{
|
|
|
154
196
|
sentAt: z.ZodISODateTime;
|
|
155
197
|
answeredAt: z.ZodNullable<z.ZodISODateTime>;
|
|
156
198
|
}, z.core.$strip>>;
|
|
199
|
+
scopes: z.ZodArray<z.ZodEnum<{
|
|
200
|
+
"messages:send": "messages:send";
|
|
201
|
+
"messages:receive": "messages:receive";
|
|
202
|
+
"fleet:read": "fleet:read";
|
|
203
|
+
"fleet:manage": "fleet:manage";
|
|
204
|
+
}>>;
|
|
205
|
+
report: z.ZodNullable<z.ZodObject<{
|
|
206
|
+
state: z.ZodEnum<{
|
|
207
|
+
working: "working";
|
|
208
|
+
blocked: "blocked";
|
|
209
|
+
idle: "idle";
|
|
210
|
+
}>;
|
|
211
|
+
note: z.ZodNullable<z.ZodString>;
|
|
212
|
+
reportedAt: z.ZodISODateTime;
|
|
213
|
+
}, z.core.$strip>>;
|
|
157
214
|
}, z.core.$strip>>;
|
|
158
215
|
/**
|
|
159
216
|
* Input of the `fleet.events` subscription: the number of the last event the
|
|
@@ -190,6 +247,7 @@ export declare const liveFleetEventSchema: z.ZodObject<{
|
|
|
190
247
|
DeliveryAbandoned: "DeliveryAbandoned";
|
|
191
248
|
DeliveryDismissed: "DeliveryDismissed";
|
|
192
249
|
ShipRenamed: "ShipRenamed";
|
|
250
|
+
ShipReported: "ShipReported";
|
|
193
251
|
}>;
|
|
194
252
|
occurredAt: z.ZodISODateTime;
|
|
195
253
|
actorShipId: z.ZodNullable<z.ZodType<`shp_${string}`, unknown, z.core.$ZodTypeInternals<`shp_${string}`, unknown>>>;
|
|
@@ -224,6 +282,7 @@ export declare const fleetStreamItemSchema: z.ZodDiscriminatedUnion<[z.ZodObject
|
|
|
224
282
|
DeliveryAbandoned: "DeliveryAbandoned";
|
|
225
283
|
DeliveryDismissed: "DeliveryDismissed";
|
|
226
284
|
ShipRenamed: "ShipRenamed";
|
|
285
|
+
ShipReported: "ShipReported";
|
|
227
286
|
}>;
|
|
228
287
|
occurredAt: z.ZodISODateTime;
|
|
229
288
|
actorShipId: z.ZodNullable<z.ZodType<`shp_${string}`, unknown, z.core.$ZodTypeInternals<`shp_${string}`, unknown>>>;
|
package/dist/schemas/fleet.js
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
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 { idempotencyKeySchema } from './idempotency-key.js';
|
|
5
|
+
import { reportStateSchema } from './report.js';
|
|
4
6
|
/**
|
|
5
7
|
* Inputs and outputs of the fleet procedures: commission a ship, get its
|
|
6
8
|
* starting prompt, release it, list the fleet, follow its events live.
|
|
@@ -18,15 +20,23 @@ export const shipHandleSchema = z
|
|
|
18
20
|
.max(SHIP_HANDLE_MAX_LENGTH, HANDLE_MESSAGE)
|
|
19
21
|
.regex(SHIP_HANDLE_PATTERN, HANDLE_MESSAGE);
|
|
20
22
|
export const SHIP_NOTE_MAX_LENGTH = 500;
|
|
21
|
-
/**
|
|
23
|
+
/**
|
|
24
|
+
* Input of `fleet.commission`. The note is free text for the operator;
|
|
25
|
+
* whitespace around it is dropped. `fleetScopes` adds fleet:read and/or
|
|
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.
|
|
29
|
+
*/
|
|
22
30
|
export const commissionShipInputSchema = z.object({
|
|
23
31
|
name: shipHandleSchema,
|
|
24
32
|
type: shipHandleSchema,
|
|
33
|
+
fleetScopes: z.array(fleetScopeSchema).optional(),
|
|
25
34
|
note: z
|
|
26
35
|
.string()
|
|
27
36
|
.trim()
|
|
28
37
|
.max(SHIP_NOTE_MAX_LENGTH, `A note is at most ${SHIP_NOTE_MAX_LENGTH} characters`)
|
|
29
38
|
.optional(),
|
|
39
|
+
idempotencyKey: idempotencyKeySchema,
|
|
30
40
|
});
|
|
31
41
|
/** Input of `fleet.getStartingPrompt`. */
|
|
32
42
|
export const getStartingPromptInputSchema = z.object({ shipId: idSchema('ship') });
|
|
@@ -42,6 +52,19 @@ export const startingPromptOutputSchema = z.object({
|
|
|
42
52
|
/** `/aeolus:crew <fleetUrl> <shipId> <secret>`. */
|
|
43
53
|
crewLine: z.string(),
|
|
44
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
|
+
});
|
|
45
68
|
/** Input of `fleet.release`: the crewed ship whose session loses it. */
|
|
46
69
|
export const releaseShipInputSchema = z.object({ shipId: idSchema('ship') });
|
|
47
70
|
/** Output of `fleet.release`: nothing; the OK is the answer. */
|
|
@@ -107,6 +130,19 @@ export const listedShipSchema = z.object({
|
|
|
107
130
|
answeredAt: z.iso.datetime().nullable(),
|
|
108
131
|
})
|
|
109
132
|
.nullable(),
|
|
133
|
+
/** What the ship may do, checked on every call: every agent ship sends and receives, argo has all. */
|
|
134
|
+
scopes: z.array(scopeSchema),
|
|
135
|
+
/**
|
|
136
|
+
* The crew's last report (ISO 8601 in UTC): its state, its note, and when it
|
|
137
|
+
* last reported. Null until the crew reports, and for a ship no session crews.
|
|
138
|
+
*/
|
|
139
|
+
report: z
|
|
140
|
+
.object({
|
|
141
|
+
state: reportStateSchema,
|
|
142
|
+
note: z.string().nullable(),
|
|
143
|
+
reportedAt: z.iso.datetime(),
|
|
144
|
+
})
|
|
145
|
+
.nullable(),
|
|
110
146
|
});
|
|
111
147
|
/** Output of `fleet.list`: every ship in the caller's fleet, `argo` included. */
|
|
112
148
|
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":"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,oBAAoB,EAAE,MAAM,sBAAsB,CAAC;AAC5D,OAAO,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAEhD;;;GAGG;AAEH;;;;GAIG;AACH,MAAM,CAAC,MAAM,sBAAsB,GAAG,EAAE,CAAC;AACzC,MAAM,CAAC,MA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,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"}
|
|
@@ -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"}
|
|
@@ -62,6 +62,21 @@ export declare const shipDetailOutputSchema: z.ZodObject<{
|
|
|
62
62
|
sentAt: z.ZodISODateTime;
|
|
63
63
|
answeredAt: z.ZodNullable<z.ZodISODateTime>;
|
|
64
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>>;
|
|
65
80
|
commissionedAt: z.ZodISODateTime;
|
|
66
81
|
crewedSince: z.ZodNullable<z.ZodISODateTime>;
|
|
67
82
|
retiredAt: z.ZodNullable<z.ZodISODateTime>;
|
|
@@ -90,6 +105,7 @@ export declare const timelineEntrySchema: z.ZodObject<{
|
|
|
90
105
|
DeliveryAbandoned: "DeliveryAbandoned";
|
|
91
106
|
DeliveryDismissed: "DeliveryDismissed";
|
|
92
107
|
ShipRenamed: "ShipRenamed";
|
|
108
|
+
ShipReported: "ShipReported";
|
|
93
109
|
}>;
|
|
94
110
|
occurredAt: z.ZodISODateTime;
|
|
95
111
|
actor: z.ZodNullable<z.ZodObject<{
|
|
@@ -142,6 +158,7 @@ export declare const shipTimelineOutputSchema: z.ZodArray<z.ZodObject<{
|
|
|
142
158
|
DeliveryAbandoned: "DeliveryAbandoned";
|
|
143
159
|
DeliveryDismissed: "DeliveryDismissed";
|
|
144
160
|
ShipRenamed: "ShipRenamed";
|
|
161
|
+
ShipReported: "ShipReported";
|
|
145
162
|
}>;
|
|
146
163
|
occurredAt: z.ZodISODateTime;
|
|
147
164
|
actor: z.ZodNullable<z.ZodObject<{
|
|
@@ -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
|
@@ -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';
|
|
6
|
+
export * from './idempotency-key.js';
|
|
5
7
|
export * from './message.js';
|
|
6
8
|
export * from './needs-attention.js';
|
|
7
9
|
export * from './operator-inbox.js';
|
|
8
10
|
export * from './ping.js';
|
|
11
|
+
export * from './report.js';
|
|
9
12
|
export * from './ship.js';
|
|
10
13
|
export * from './system.js';
|
package/dist/schemas/index.js
CHANGED
|
@@ -1,11 +1,14 @@
|
|
|
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';
|
|
6
|
+
export * from './idempotency-key.js';
|
|
5
7
|
export * from './message.js';
|
|
6
8
|
export * from './needs-attention.js';
|
|
7
9
|
export * from './operator-inbox.js';
|
|
8
10
|
export * from './ping.js';
|
|
11
|
+
export * from './report.js';
|
|
9
12
|
export * from './ship.js';
|
|
10
13
|
export * from './system.js';
|
|
11
14
|
//# 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,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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
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"}
|