@aeolus-fleet/common 0.32.4 → 0.34.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 +13 -2
- package/dist/fleet/index.js +12 -0
- package/dist/fleet/index.js.map +1 -1
- package/dist/ids/index.d.ts +3 -0
- package/dist/ids/index.js +2 -0
- package/dist/ids/index.js.map +1 -1
- package/dist/schemas/console.d.ts +3 -0
- package/dist/schemas/console.js +3 -0
- package/dist/schemas/console.js.map +1 -1
- package/dist/schemas/feature-flags.d.ts +55 -0
- package/dist/schemas/feature-flags.js +41 -0
- package/dist/schemas/feature-flags.js.map +1 -0
- package/dist/schemas/fleet.d.ts +22 -1
- package/dist/schemas/fleet.js +2 -1
- package/dist/schemas/fleet.js.map +1 -1
- package/dist/schemas/follow.d.ts +10 -0
- package/dist/schemas/health.d.ts +64 -0
- package/dist/schemas/health.js +9 -0
- package/dist/schemas/health.js.map +1 -1
- package/dist/schemas/history.d.ts +28 -0
- package/dist/schemas/history.js +8 -1
- package/dist/schemas/history.js.map +1 -1
- package/dist/schemas/index.d.ts +2 -0
- package/dist/schemas/index.js +2 -0
- package/dist/schemas/index.js.map +1 -1
- package/dist/schemas/installation.d.ts +17 -0
- package/dist/schemas/installation.js +5 -0
- package/dist/schemas/installation.js.map +1 -1
- package/dist/schemas/meeting.d.ts +2 -0
- package/dist/schemas/meeting.js +2 -0
- package/dist/schemas/meeting.js.map +1 -1
- package/dist/schemas/message.d.ts +3 -2
- package/dist/schemas/message.js +3 -2
- package/dist/schemas/message.js.map +1 -1
- package/dist/schemas/needs-attention.d.ts +2 -0
- package/dist/schemas/needs-attention.js +2 -0
- package/dist/schemas/needs-attention.js.map +1 -1
- package/dist/schemas/operator-inbox.d.ts +6 -0
- package/dist/schemas/operator-inbox.js +5 -1
- package/dist/schemas/operator-inbox.js.map +1 -1
- package/dist/schemas/sealing.d.ts +126 -0
- package/dist/schemas/sealing.js +75 -0
- package/dist/schemas/sealing.js.map +1 -0
- package/dist/schemas/ship.d.ts +2 -2
- package/dist/schemas/ship.js +2 -2
- package/dist/schemas/ship.js.map +1 -1
- package/dist/trierarch/index.d.ts +1 -0
- package/dist/trierarch/index.js +1 -0
- package/dist/trierarch/index.js.map +1 -1
- package/dist/trierarch/report-details.d.ts +57 -0
- package/dist/trierarch/report-details.js +34 -14
- package/dist/trierarch/report-details.js.map +1 -1
- package/dist/trierarch/usage-message.d.ts +47 -0
- package/dist/trierarch/usage-message.js +51 -0
- package/dist/trierarch/usage-message.js.map +1 -0
- package/package.json +1 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sealing.js","sourceRoot":"","sources":["../../src/schemas/sealing.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAE3C,oGAAoG;AACpG,MAAM,sBAAsB,GAAG,IAAI,CAAC;AAEpC,gFAAgF;AAChF,MAAM,uBAAuB,GAAG,GAAG,CAAC;AAEpC,8HAA8H;AAC9H,MAAM,iBAAiB,GAAG,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,uBAAuB,CAAC,CAAC;AAEzE,iJAAiJ;AACjJ,MAAM,CAAC,MAAM,wBAAwB,GAAG,CAAC,CAAC,YAAY,CAAC,EAAE,UAAU,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,sBAAsB,CAAC,EAAE,WAAW,EAAE,iBAAiB,CAAC,QAAQ,EAAE,EAAE,CAAC,CAAC;AAEjK,6KAA6K;AAC7K,MAAM,CAAC,MAAM,yBAAyB,GAAG,CAAC,CAAC,MAAM,CAAC,EAAE,KAAK,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,SAAS,EAAE,QAAQ,CAAC,CAAC,EAAE,UAAU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O,EAAE,QAAQ,CAAC,OAAO,CAAC;IAC1B,sBAAsB,EAAE,CAAC,CAAC,MAAM,EAAE;IAClC,QAAQ,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,CAAC,EAAE,EAAE,EAAE,QAAQ,CAAC,SAAS,CAAC,EAAE,oBAAoB,EAAE,CAAC,CAAC,MAAM,EAAE,EAAE,UAAU,EAAE,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC;CACnH,CAAC,CAAC;AAEH;;;;;GAKG;AACH,MAAM,CAAC,MAAM,sBAAsB,GAAG,CAAC,CAAC,YAAY,CAAC;IACnD,UAAU,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,sBAAsB,CAAC;IACzD,QAAQ,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,YAAY,CAAC,EAAE,EAAE,EAAE,QAAQ,CAAC,SAAS,CAAC,EAAE,mBAAmB,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,2BAA2B,CAAC,EAAE,CAAC,CAAC,CAAC,GAAG,CAAC,sBAAsB,CAAC;CACpK,CAAC,CAAC;AAEH,iGAAiG;AACjG,MAAM,CAAC,MAAM,uBAAuB,GAAG,CAAC,CAAC,MAAM,CAAC,EAAE,UAAU,EAAE,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC"}
|
package/dist/schemas/ship.d.ts
CHANGED
|
@@ -28,12 +28,12 @@ export declare const locationSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
28
28
|
}, z.core.$strict>], "kind">;
|
|
29
29
|
export type LocationInput = z.infer<typeof locationSchema>;
|
|
30
30
|
/** The harnesses the console names; any other is free text. */
|
|
31
|
-
export declare const KNOWN_HARNESSES: readonly ["claude-code", "claude-chat", "codex"];
|
|
31
|
+
export declare const KNOWN_HARNESSES: readonly ["claude-code", "claude-chat", "codex", "copilot"];
|
|
32
32
|
/** The longest harness a session may state. */
|
|
33
33
|
export declare const HARNESS_MAX_LENGTH = 50;
|
|
34
34
|
/**
|
|
35
35
|
* The harness a session runs in (docs/blueprint.md, "Harness"), such as
|
|
36
|
-
* claude-code, claude-chat or
|
|
36
|
+
* claude-code, claude-chat, codex or copilot: free text, trimmed and in lower case.
|
|
37
37
|
* Stated once when the session crews the ship, read together with its
|
|
38
38
|
* location; never interpreted.
|
|
39
39
|
*/
|
package/dist/schemas/ship.js
CHANGED
|
@@ -29,12 +29,12 @@ export const locationSchema = z.discriminatedUnion('kind', [
|
|
|
29
29
|
}),
|
|
30
30
|
]);
|
|
31
31
|
/** The harnesses the console names; any other is free text. */
|
|
32
|
-
export const KNOWN_HARNESSES = ['claude-code', 'claude-chat', 'codex'];
|
|
32
|
+
export const KNOWN_HARNESSES = ['claude-code', 'claude-chat', 'codex', 'copilot'];
|
|
33
33
|
/** The longest harness a session may state. */
|
|
34
34
|
export const HARNESS_MAX_LENGTH = 50;
|
|
35
35
|
/**
|
|
36
36
|
* The harness a session runs in (docs/blueprint.md, "Harness"), such as
|
|
37
|
-
* claude-code, claude-chat or
|
|
37
|
+
* claude-code, claude-chat, codex or copilot: free text, trimmed and in lower case.
|
|
38
38
|
* Stated once when the session crews the ship, read together with its
|
|
39
39
|
* location; never interpreted.
|
|
40
40
|
*/
|
package/dist/schemas/ship.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ship.js","sourceRoot":"","sources":["../../src/schemas/ship.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAE3C;;;;GAIG;AAEH,4FAA4F;AAC5F,MAAM,CAAC,MAAM,+BAA+B,GAAG,GAAG,CAAC;AAEnD;;;GAGG;AACH,MAAM,CAAC,MAAM,sBAAsB,GAAG,GAAG,CAAC;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AQ,CAAC,OAAO,CAAC;IAC1B,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE;IAChB,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE;IAChB;;;;OAIG;IACH,WAAW,EAAE,QAAQ,CAAC,MAAM,CAAC,CAAC,QAAQ,EAAE;IACxC,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;CACjC,CAAC,CAAC;AAIH,kEAAkE;AAClE,MAAM,CAAC,MAAM,sBAAsB,GAAG,CAAC,CAAC,YAAY,CAAC,EAAE,CAAC,CAAC"}
|
package/dist/trierarch/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/trierarch/index.ts"],"names":[],"mappings":"AAAA,cAAc,oBAAoB,CAAC;AACnC,cAAc,oBAAoB,CAAC;AACnC,cAAc,YAAY,CAAC;AAC3B,cAAc,qBAAqB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/trierarch/index.ts"],"names":[],"mappings":"AAAA,cAAc,oBAAoB,CAAC;AACnC,cAAc,oBAAoB,CAAC;AACnC,cAAc,YAAY,CAAC;AAC3B,cAAc,qBAAqB,CAAC;AACpC,cAAc,oBAAoB,CAAC"}
|
|
@@ -5,6 +5,35 @@ export declare const MACHINE_OS: readonly ["macos", "linux", "windows"];
|
|
|
5
5
|
export declare const MACHINE_ARCH: readonly ["arm64", "amd64"];
|
|
6
6
|
/** Where a trierarch runs its sessions: on the host or each in a container of its own (decision 0039). */
|
|
7
7
|
export declare const SESSION_RUNTIMES: readonly ["host", "container"];
|
|
8
|
+
/** How much of one harness's subscription is used, per window, as the trierarch read it. */
|
|
9
|
+
export declare const subscriptionReadingSchema: z.ZodObject<{
|
|
10
|
+
harness: z.ZodString;
|
|
11
|
+
readAt: z.ZodISODateTime;
|
|
12
|
+
windows: z.ZodArray<z.ZodObject<{
|
|
13
|
+
windowMinutes: z.ZodInt;
|
|
14
|
+
usedPercent: z.ZodNumber;
|
|
15
|
+
resetsAt: z.ZodISODateTime;
|
|
16
|
+
}, z.core.$strict>>;
|
|
17
|
+
}, z.core.$strict>;
|
|
18
|
+
/** The logins a session runs on (aeolus-fleet-trierarch's api keys design, K5): its harness's subscription, or an API key kept on the computer. */
|
|
19
|
+
export declare const SESSION_LOGINS: readonly ["subscription", "apiKey"];
|
|
20
|
+
/** Where a harness's API key stands (K8): none on the computer, ready, refused by its vendor, or out of credit. */
|
|
21
|
+
export declare const KEY_STATES: readonly ["none", "ready", "refused", "outOfCredit"];
|
|
22
|
+
/** The tokens of one model, with their cost estimated from the trierarch's price table (null for a model it does not price). */
|
|
23
|
+
export declare const modelUsageSchema: z.ZodObject<{
|
|
24
|
+
model: z.ZodString;
|
|
25
|
+
login: z.ZodOptional<z.ZodEnum<{
|
|
26
|
+
subscription: "subscription";
|
|
27
|
+
apiKey: "apiKey";
|
|
28
|
+
}>>;
|
|
29
|
+
tokens: z.ZodObject<{
|
|
30
|
+
input: z.ZodInt;
|
|
31
|
+
output: z.ZodInt;
|
|
32
|
+
cacheRead: z.ZodInt;
|
|
33
|
+
cacheWrite: z.ZodInt;
|
|
34
|
+
}, z.core.$strict>;
|
|
35
|
+
estimatedCostUsd: z.ZodNullable<z.ZodNumber>;
|
|
36
|
+
}, z.core.$strict>;
|
|
8
37
|
/** The longest reason a harness is not offered: one line for the console. */
|
|
9
38
|
export declare const NOT_OFFERED_REASON_MAX_LENGTH = 280;
|
|
10
39
|
export declare const trierarchReportDetailsSchema: z.ZodObject<{
|
|
@@ -15,6 +44,19 @@ export declare const trierarchReportDetailsSchema: z.ZodObject<{
|
|
|
15
44
|
riskyFlags: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
16
45
|
version: z.ZodOptional<z.ZodString>;
|
|
17
46
|
modelsConfirmedAt: z.ZodOptional<z.ZodNullable<z.ZodISODateTime>>;
|
|
47
|
+
login: z.ZodOptional<z.ZodObject<{
|
|
48
|
+
default: z.ZodEnum<{
|
|
49
|
+
subscription: "subscription";
|
|
50
|
+
apiKey: "apiKey";
|
|
51
|
+
}>;
|
|
52
|
+
key: z.ZodEnum<{
|
|
53
|
+
none: "none";
|
|
54
|
+
refused: "refused";
|
|
55
|
+
ready: "ready";
|
|
56
|
+
outOfCredit: "outOfCredit";
|
|
57
|
+
}>;
|
|
58
|
+
keyStateAt: z.ZodOptional<z.ZodISODateTime>;
|
|
59
|
+
}, z.core.$strict>>;
|
|
18
60
|
}, z.core.$strict>>;
|
|
19
61
|
workspaces: z.ZodObject<{
|
|
20
62
|
repositories: z.ZodArray<z.ZodString>;
|
|
@@ -51,6 +93,17 @@ export declare const trierarchReportDetailsSchema: z.ZodObject<{
|
|
|
51
93
|
harness: z.ZodString;
|
|
52
94
|
reason: z.ZodString;
|
|
53
95
|
}, z.core.$strict>>>;
|
|
96
|
+
logins: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
97
|
+
shipId: z.ZodType<`shp_${string}`, unknown, z.core.$ZodTypeInternals<`shp_${string}`, unknown>>;
|
|
98
|
+
login: z.ZodEnum<{
|
|
99
|
+
subscription: "subscription";
|
|
100
|
+
apiKey: "apiKey";
|
|
101
|
+
}>;
|
|
102
|
+
next: z.ZodOptional<z.ZodEnum<{
|
|
103
|
+
subscription: "subscription";
|
|
104
|
+
apiKey: "apiKey";
|
|
105
|
+
}>>;
|
|
106
|
+
}, z.core.$strict>>>;
|
|
54
107
|
load: z.ZodOptional<z.ZodObject<{
|
|
55
108
|
memory: z.ZodObject<{
|
|
56
109
|
totalBytes: z.ZodInt;
|
|
@@ -83,6 +136,10 @@ export declare const trierarchReportDetailsSchema: z.ZodObject<{
|
|
|
83
136
|
shipId: z.ZodType<`shp_${string}`, unknown, z.core.$ZodTypeInternals<`shp_${string}`, unknown>>;
|
|
84
137
|
models: z.ZodArray<z.ZodObject<{
|
|
85
138
|
model: z.ZodString;
|
|
139
|
+
login: z.ZodOptional<z.ZodEnum<{
|
|
140
|
+
subscription: "subscription";
|
|
141
|
+
apiKey: "apiKey";
|
|
142
|
+
}>>;
|
|
86
143
|
tokens: z.ZodObject<{
|
|
87
144
|
input: z.ZodInt;
|
|
88
145
|
output: z.ZodInt;
|
|
@@ -38,6 +38,26 @@ const machineLoadSchema = z.strictObject({
|
|
|
38
38
|
/** The filesystem the trierarch's worktree root is on. */
|
|
39
39
|
disk: z.strictObject({ totalBytes: byteCountSchema, freeBytes: byteCountSchema }),
|
|
40
40
|
});
|
|
41
|
+
/** How much of one harness's subscription is used, per window, as the trierarch read it. */
|
|
42
|
+
export const subscriptionReadingSchema = z.strictObject({
|
|
43
|
+
harness: harnessSchema,
|
|
44
|
+
/** When the trierarch read it (ISO 8601 in UTC). */
|
|
45
|
+
readAt: z.iso.datetime(),
|
|
46
|
+
windows: z.array(z.strictObject({ windowMinutes: z.int().positive(), usedPercent: percentSchema, resetsAt: z.iso.datetime() })),
|
|
47
|
+
});
|
|
48
|
+
/** The logins a session runs on (aeolus-fleet-trierarch's api keys design, K5): its harness's subscription, or an API key kept on the computer. */
|
|
49
|
+
export const SESSION_LOGINS = ['subscription', 'apiKey'];
|
|
50
|
+
const sessionLoginSchema = z.enum(SESSION_LOGINS);
|
|
51
|
+
/** Where a harness's API key stands (K8): none on the computer, ready, refused by its vendor, or out of credit. */
|
|
52
|
+
export const KEY_STATES = ['none', 'ready', 'refused', 'outOfCredit'];
|
|
53
|
+
/** The tokens of one model, with their cost estimated from the trierarch's price table (null for a model it does not price). */
|
|
54
|
+
export const modelUsageSchema = z.strictObject({
|
|
55
|
+
model: z.string().min(1),
|
|
56
|
+
/** The login of the sessions that used them (K8), so a ship's cost on the key is the sum of its apiKey entries. None from a trierarch before 0.34.0. */
|
|
57
|
+
login: sessionLoginSchema.optional(),
|
|
58
|
+
tokens: z.strictObject({ input: tokenCountSchema, output: tokenCountSchema, cacheRead: tokenCountSchema, cacheWrite: tokenCountSchema }),
|
|
59
|
+
estimatedCostUsd: z.number().nonnegative().nullable(),
|
|
60
|
+
});
|
|
41
61
|
/**
|
|
42
62
|
* What the trierarch reads of its harnesses' usage (#353): how much of each
|
|
43
63
|
* harness's subscription is used, per window, and the tokens each ship it
|
|
@@ -45,20 +65,8 @@ const machineLoadSchema = z.strictObject({
|
|
|
45
65
|
* for a model the table does not price).
|
|
46
66
|
*/
|
|
47
67
|
const harnessUsageSchema = z.strictObject({
|
|
48
|
-
subscriptions: z.array(
|
|
49
|
-
|
|
50
|
-
/** When the trierarch read it (ISO 8601 in UTC). */
|
|
51
|
-
readAt: z.iso.datetime(),
|
|
52
|
-
windows: z.array(z.strictObject({ windowMinutes: z.int().positive(), usedPercent: percentSchema, resetsAt: z.iso.datetime() })),
|
|
53
|
-
})),
|
|
54
|
-
ships: z.array(z.strictObject({
|
|
55
|
-
shipId: idSchema('ship'),
|
|
56
|
-
models: z.array(z.strictObject({
|
|
57
|
-
model: z.string().min(1),
|
|
58
|
-
tokens: z.strictObject({ input: tokenCountSchema, output: tokenCountSchema, cacheRead: tokenCountSchema, cacheWrite: tokenCountSchema }),
|
|
59
|
-
estimatedCostUsd: z.number().nonnegative().nullable(),
|
|
60
|
-
})),
|
|
61
|
-
})),
|
|
68
|
+
subscriptions: z.array(subscriptionReadingSchema),
|
|
69
|
+
ships: z.array(z.strictObject({ shipId: idSchema('ship'), models: z.array(modelUsageSchema) })),
|
|
62
70
|
});
|
|
63
71
|
/** The longest reason a harness is not offered: one line for the console. */
|
|
64
72
|
export const NOT_OFFERED_REASON_MAX_LENGTH = 280;
|
|
@@ -79,6 +87,12 @@ export const trierarchReportDetailsSchema = z.strictObject({
|
|
|
79
87
|
version: z.string().min(1).optional(),
|
|
80
88
|
/** When the trierarch last confirmed this harness's models (ISO 8601 in UTC); null while none is. None with no version. */
|
|
81
89
|
modelsConfirmedAt: z.iso.datetime().nullable().optional(),
|
|
90
|
+
/**
|
|
91
|
+
* The login the harness's sessions run on by default, and its API key's
|
|
92
|
+
* state, never the key (K7, K8), with since when (ISO 8601 in UTC) where
|
|
93
|
+
* the trierarch knows it. None from a trierarch before 0.34.0.
|
|
94
|
+
*/
|
|
95
|
+
login: z.strictObject({ default: sessionLoginSchema, key: z.enum(KEY_STATES), keyStateAt: z.iso.datetime().optional() }).optional(),
|
|
82
96
|
})),
|
|
83
97
|
workspaces: z.strictObject({ repositories: z.array(trierarchNameSchema), folders: z.array(trierarchNameSchema) }),
|
|
84
98
|
/** How many ships the machine crews at most, and how many sessions run at once. */
|
|
@@ -106,6 +120,12 @@ export const trierarchReportDetailsSchema = z.strictObject({
|
|
|
106
120
|
* before 0.31.0, or with every harness offered.
|
|
107
121
|
*/
|
|
108
122
|
notOffered: z.array(z.strictObject({ harness: harnessSchema, reason: z.string().min(1).max(NOT_OFFERED_REASON_MAX_LENGTH) })).optional(),
|
|
123
|
+
/**
|
|
124
|
+
* The login of each ship it crews (K8): its running or last session's, and
|
|
125
|
+
* `next` when its next start would use the other one (K3). None from a
|
|
126
|
+
* trierarch before 0.34.0.
|
|
127
|
+
*/
|
|
128
|
+
logins: z.array(z.strictObject({ shipId: idSchema('ship'), login: sessionLoginSchema, next: sessionLoginSchema.optional() })).optional(),
|
|
109
129
|
/** None from a trierarch before 0.31.0. */
|
|
110
130
|
load: machineLoadSchema.optional(),
|
|
111
131
|
/** None from a trierarch before 0.31.0. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"report-details.js","sourceRoot":"","sources":["../../src/trierarch/report-details.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAC3C,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACnD,OAAO,EAAE,yBAAyB,EAAE,mBAAmB,EAAE,MAAM,YAAY,CAAC;AAE5E,iIAAiI;AACjI,MAAM,CAAC,MAAM,UAAU,GAAG,CAAC,OAAO,EAAE,OAAO,EAAE,SAAS,CAAU,CAAC;AAEjE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B,CAAC,CAAC"}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
/** The content type of a trierarch's usage message to the trierarch plugin's ship. */
|
|
3
|
+
export declare const TRIERARCH_USAGE_CONTENT_TYPE = "application/vnd.aeolus.trierarch.usage+json";
|
|
4
|
+
/**
|
|
5
|
+
* The usage a trierarch sends its trierarch plugin's ship (aeolus-fleet's
|
|
6
|
+
* docs/design/usage/usage.md, "What the trierarch sends, and when"): the hours
|
|
7
|
+
* that changed since its last send that returned OK, each whole, and the
|
|
8
|
+
* subscription readings since then. An hour's tokens are its total so far, set,
|
|
9
|
+
* never added. Every object refuses unknown fields.
|
|
10
|
+
*/
|
|
11
|
+
export declare const trierarchUsageMessageSchema: z.ZodObject<{
|
|
12
|
+
hours: z.ZodArray<z.ZodObject<{
|
|
13
|
+
hour: z.ZodISODateTime;
|
|
14
|
+
ships: z.ZodArray<z.ZodObject<{
|
|
15
|
+
shipId: z.ZodType<`shp_${string}`, unknown, z.core.$ZodTypeInternals<`shp_${string}`, unknown>>;
|
|
16
|
+
harness: z.ZodString;
|
|
17
|
+
folderMadeAt: z.ZodISODateTime;
|
|
18
|
+
login: z.ZodNullable<z.ZodString>;
|
|
19
|
+
models: z.ZodArray<z.ZodObject<{
|
|
20
|
+
model: z.ZodString;
|
|
21
|
+
tokens: z.ZodObject<{
|
|
22
|
+
input: z.ZodInt;
|
|
23
|
+
output: z.ZodInt;
|
|
24
|
+
cacheRead: z.ZodInt;
|
|
25
|
+
cacheWrite: z.ZodInt;
|
|
26
|
+
}, z.core.$strict>;
|
|
27
|
+
estimatedCostUsd: z.ZodNullable<z.ZodObject<{
|
|
28
|
+
input: z.ZodNumber;
|
|
29
|
+
output: z.ZodNumber;
|
|
30
|
+
cacheRead: z.ZodNumber;
|
|
31
|
+
cacheWrite: z.ZodNumber;
|
|
32
|
+
}, z.core.$strict>>;
|
|
33
|
+
}, z.core.$strict>>;
|
|
34
|
+
}, z.core.$strict>>;
|
|
35
|
+
}, z.core.$strict>>;
|
|
36
|
+
subscriptions: z.ZodArray<z.ZodObject<{
|
|
37
|
+
harness: z.ZodString;
|
|
38
|
+
readAt: z.ZodISODateTime;
|
|
39
|
+
windows: z.ZodArray<z.ZodObject<{
|
|
40
|
+
windowMinutes: z.ZodInt;
|
|
41
|
+
usedPercent: z.ZodNumber;
|
|
42
|
+
resetsAt: z.ZodISODateTime;
|
|
43
|
+
}, z.core.$strict>>;
|
|
44
|
+
}, z.core.$strict>>;
|
|
45
|
+
readAt: z.ZodISODateTime;
|
|
46
|
+
}, z.core.$strict>;
|
|
47
|
+
export type TrierarchUsageMessage = z.infer<typeof trierarchUsageMessageSchema>;
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { idSchema } from '../ids/index.js';
|
|
3
|
+
import { harnessSchema } from '../schemas/ship.js';
|
|
4
|
+
import { subscriptionReadingSchema } from './report-details.js';
|
|
5
|
+
/** The content type of a trierarch's usage message to the trierarch plugin's ship. */
|
|
6
|
+
export const TRIERARCH_USAGE_CONTENT_TYPE = 'application/vnd.aeolus.trierarch.usage+json';
|
|
7
|
+
/**
|
|
8
|
+
* A timestamp at the start of a UTC hour (ISO 8601 in UTC): a ship's tokens
|
|
9
|
+
* count in the UTC hour each transcript entry happened.
|
|
10
|
+
*/
|
|
11
|
+
const utcHourSchema = z.iso.datetime().refine((value) => {
|
|
12
|
+
const at = new Date(value);
|
|
13
|
+
return at.getUTCMinutes() === 0 && at.getUTCSeconds() === 0 && at.getUTCMilliseconds() === 0;
|
|
14
|
+
}, 'An hour starts a UTC hour');
|
|
15
|
+
const tokenCountSchema = z.int().nonnegative();
|
|
16
|
+
const costSchema = z.number().nonnegative();
|
|
17
|
+
/**
|
|
18
|
+
* The tokens of one model in one hour, each kind with its cost estimated from
|
|
19
|
+
* the trierarch's price table, so the Usage page splits cost by token kind;
|
|
20
|
+
* null for a model the table does not price.
|
|
21
|
+
*/
|
|
22
|
+
const modelHourUsageSchema = z.strictObject({
|
|
23
|
+
model: z.string().min(1),
|
|
24
|
+
tokens: z.strictObject({ input: tokenCountSchema, output: tokenCountSchema, cacheRead: tokenCountSchema, cacheWrite: tokenCountSchema }),
|
|
25
|
+
estimatedCostUsd: z.strictObject({ input: costSchema, output: costSchema, cacheRead: costSchema, cacheWrite: costSchema }).nullable(),
|
|
26
|
+
});
|
|
27
|
+
/**
|
|
28
|
+
* The usage a trierarch sends its trierarch plugin's ship (aeolus-fleet's
|
|
29
|
+
* docs/design/usage/usage.md, "What the trierarch sends, and when"): the hours
|
|
30
|
+
* that changed since its last send that returned OK, each whole, and the
|
|
31
|
+
* subscription readings since then. An hour's tokens are its total so far, set,
|
|
32
|
+
* never added. Every object refuses unknown fields.
|
|
33
|
+
*/
|
|
34
|
+
export const trierarchUsageMessageSchema = z.strictObject({
|
|
35
|
+
hours: z.array(z.strictObject({
|
|
36
|
+
hour: utcHourSchema,
|
|
37
|
+
ships: z.array(z.strictObject({
|
|
38
|
+
shipId: idSchema('ship'),
|
|
39
|
+
harness: harnessSchema,
|
|
40
|
+
/** When the ship's folder was made on the machine: tells two folders of one ship apart. */
|
|
41
|
+
folderMadeAt: z.iso.datetime(),
|
|
42
|
+
/** The subscription or API key the ship ran on; null while the trierarch names none. */
|
|
43
|
+
login: z.string().min(1).nullable(),
|
|
44
|
+
models: z.array(modelHourUsageSchema),
|
|
45
|
+
})),
|
|
46
|
+
})),
|
|
47
|
+
subscriptions: z.array(subscriptionReadingSchema),
|
|
48
|
+
/** When the trierarch read it (ISO 8601 in UTC). */
|
|
49
|
+
readAt: z.iso.datetime(),
|
|
50
|
+
});
|
|
51
|
+
//# sourceMappingURL=usage-message.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"usage-message.js","sourceRoot":"","sources":["../../src/trierarch/usage-message.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,E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