@aeolus-fleet/common 0.18.0 → 0.20.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.
Files changed (40) hide show
  1. package/LICENSE +201 -0
  2. package/dist/fleet/index.d.ts +21 -9
  3. package/dist/fleet/index.js +16 -6
  4. package/dist/fleet/index.js.map +1 -1
  5. package/dist/ids/index.d.ts +4 -0
  6. package/dist/ids/index.js +2 -0
  7. package/dist/ids/index.js.map +1 -1
  8. package/dist/schemas/clear-request.d.ts +46 -0
  9. package/dist/schemas/clear-request.js +42 -0
  10. package/dist/schemas/clear-request.js.map +1 -0
  11. package/dist/schemas/console.d.ts +2 -1
  12. package/dist/schemas/crew-request.d.ts +6 -0
  13. package/dist/schemas/crew-request.js +12 -1
  14. package/dist/schemas/crew-request.js.map +1 -1
  15. package/dist/schemas/fleet.d.ts +41 -4
  16. package/dist/schemas/fleet.js +4 -1
  17. package/dist/schemas/fleet.js.map +1 -1
  18. package/dist/schemas/follow.d.ts +9 -0
  19. package/dist/schemas/history.d.ts +28 -1
  20. package/dist/schemas/index.d.ts +2 -0
  21. package/dist/schemas/index.js +2 -0
  22. package/dist/schemas/index.js.map +1 -1
  23. package/dist/schemas/label.d.ts +110 -0
  24. package/dist/schemas/label.js +58 -0
  25. package/dist/schemas/label.js.map +1 -0
  26. package/dist/trierarch/configuration.js +1 -1
  27. package/dist/trierarch/configuration.js.map +1 -1
  28. package/dist/trierarch/crew-settings.d.ts +42 -0
  29. package/dist/trierarch/crew-settings.js +49 -0
  30. package/dist/trierarch/crew-settings.js.map +1 -0
  31. package/dist/trierarch/index.d.ts +2 -1
  32. package/dist/trierarch/index.js +2 -1
  33. package/dist/trierarch/index.js.map +1 -1
  34. package/dist/trierarch/report-details.d.ts +42 -0
  35. package/dist/trierarch/report-details.js +52 -0
  36. package/dist/trierarch/report-details.js.map +1 -0
  37. package/package.json +4 -2
  38. package/dist/trierarch/protocol.d.ts +0 -146
  39. package/dist/trierarch/protocol.js +0 -115
  40. package/dist/trierarch/protocol.js.map +0 -1
@@ -0,0 +1,52 @@
1
+ import { z } from 'zod';
2
+ import { idSchema } from '../ids/index.js';
3
+ import { harnessSchema } from '../schemas/ship.js';
4
+ import { TRIERARCH_NAME_MAX_LENGTH, trierarchNameSchema } from './names.js';
5
+ /** The operating systems a trierarch names its machine by, for the trierarch plugin's os label (#102); any other is left out. */
6
+ export const MACHINE_OS = ['macos', 'linux', 'windows'];
7
+ /** The architectures a trierarch names its machine by, for the trierarch plugin's arch label (#102); any other is left out. */
8
+ export const MACHINE_ARCH = ['arm64', 'amd64'];
9
+ /**
10
+ * The details of a trierarch's report (docs/trierarch.md, "What a trierarch
11
+ * reports"; decision 0028): what its machine can do, read from its local
12
+ * configuration and what runs. The trierarch plugin places crew requests
13
+ * from them. No entry per ship: each crew request carries its own status.
14
+ * Every object refuses unknown fields.
15
+ */
16
+ /** A folder's name under the trierarch's worktree root, as it is on disk: one name, never a path. */
17
+ const worktreeFolderNameSchema = z
18
+ .string()
19
+ .min(1)
20
+ .max(TRIERARCH_NAME_MAX_LENGTH)
21
+ .refine((name) => !/[/\\]/.test(name) && name !== '.' && name !== '..', 'A folder name is one name, never a path');
22
+ export const trierarchReportDetailsSchema = z.strictObject({
23
+ harnesses: z.array(z.strictObject({
24
+ harness: harnessSchema,
25
+ /** The JSON Schema a crew request's options for this harness are checked against. */
26
+ options: z.record(z.string(), z.json()),
27
+ /** The flags every launch of this harness gets, as the configuration makes them. */
28
+ flags: z.array(z.string()),
29
+ /**
30
+ * Which of those flags are risky, as the trierarch's adapter for the
31
+ * harness knows them, so a reader needs no harness knowledge (#326).
32
+ * None from a trierarch before 0.20.0, which marked none.
33
+ */
34
+ riskyFlags: z.array(z.string()).optional(),
35
+ })),
36
+ workspaces: z.strictObject({ repositories: z.array(trierarchNameSchema), folders: z.array(trierarchNameSchema) }),
37
+ /** How many ships the machine crews at most, and how many sessions run at once. */
38
+ caps: z.strictObject({ ships: z.int().positive(), running: z.int().positive() }),
39
+ /** Worktrees kept because they had changes, by the ship they belonged to and their repository: paths stay on the machine (decision 0032). */
40
+ kept: z.array(z.strictObject({ shipId: idSchema('ship'), repository: trierarchNameSchema })),
41
+ /** Worktrees under the trierarch's root with no assigned request: reported, never deleted. */
42
+ orphans: z.array(z.strictObject({ repository: worktreeFolderNameSchema, name: worktreeFolderNameSchema })),
43
+ /**
44
+ * The machine it runs on, for the trierarch plugin to label its ship by
45
+ * (docs/trierarch.md, "Machine labels"): an os or arch outside the known
46
+ * ones is left out. None from a trierarch before 0.20.0.
47
+ */
48
+ machine: z.strictObject({ os: z.enum(MACHINE_OS).optional(), arch: z.enum(MACHINE_ARCH).optional() }).optional(),
49
+ /** The trierarch's own version. */
50
+ version: z.string().min(1),
51
+ });
52
+ //# sourceMappingURL=report-details.js.map
@@ -0,0 +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,+HAA+H;AAC/H,MAAM,CAAC,MAAM,YAAY,GAAG,CAAC,OAAO,EAAE,OAAO,CAAU,CAAC;AAExD;;;;;;GAMG;AACH,qGAAqG;AACrG,MAAM,wBAAwB,GAAG,CAAC;KAC/B,MAAM,EAAE;KACR,GAAG,CAAC,CAAC,CAAC;KACN,GAAG,CAAC,yBAAyB,CAAC;KAC9B,MAAM,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,OAAO,CAAC,IAAI,CAAC,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AE,CAAC,CAAC;IAC1G;;;;OAIG;IACH,OAAO,EAAE,CAAC,CAAC,YAAY,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC,QAAQ,EAAE,EAAE,IAAI,EAAE,CAAC,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC,QAAQ,EAAE,EAAE,CAAC,CAAC,QAAQ,EAAE;IAChH,mCAAmC;IACnC,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;CAC3B,CAAC,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aeolus-fleet/common",
3
- "version": "0.18.0",
3
+ "version": "0.20.0",
4
4
  "description": "Aeolus shared schemas, prefixed ids and types.",
5
5
  "license": "Apache-2.0",
6
6
  "type": "module",
@@ -24,7 +24,9 @@
24
24
  ],
25
25
  "scripts": {
26
26
  "build": "tsc --project tsconfig.build.json",
27
- "typecheck": "tsc --project tsconfig.json"
27
+ "typecheck": "tsc --project tsconfig.json",
28
+ "prepack": "cp ../../LICENSE LICENSE",
29
+ "postpack": "rm LICENSE"
28
30
  },
29
31
  "dependencies": {
30
32
  "zod": "^4.6.5"
@@ -1,146 +0,0 @@
1
- import { z } from 'zod';
2
- /**
3
- * The trierarch protocol (docs/trierarch.md, decision 0027): fleet messages
4
- * to and from a trierarch's ship. Aeolus reads none of them. The core is
5
- * fixed for every dispatcher; each harness's options are open, described by
6
- * the JSON Schema describe answers with. Every message refuses unknown
7
- * fields, so a dispatcher never ignores what a requester meant.
8
- */
9
- /** A message's content type, by convention: `application/vnd.aeolus.trierarch.<name>+json`. */
10
- export declare function trierarchContentType(name: string): string;
11
- /** The longest first prompt, in UTF-8 bytes: 8 KB, given on the first start only. */
12
- export declare const FIRST_PROMPT_MAX_BYTES = 8192;
13
- /** Where an entry stands in the trierarch's loop; running covers idle and busy. */
14
- export declare const TRIERARCH_ENTRY_STATES: readonly ["wanted", "crewing", "running", "restarting", "crashed", "releasing"];
15
- export declare const trierarchEntryStateSchema: z.ZodEnum<{
16
- crewing: "crewing";
17
- running: "running";
18
- restarting: "restarting";
19
- crashed: "crashed";
20
- releasing: "releasing";
21
- wanted: "wanted";
22
- }>;
23
- export type TrierarchEntryState = z.infer<typeof trierarchEntryStateSchema>;
24
- /** A new git worktree of a configured repository, or a configured folder used as it is: named, never a path. */
25
- export declare const trierarchWorkspaceSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
26
- kind: z.ZodLiteral<"worktree">;
27
- repository: z.ZodString;
28
- ref: z.ZodOptional<z.ZodString>;
29
- }, z.core.$strict>, z.ZodObject<{
30
- kind: z.ZodLiteral<"folder">;
31
- name: z.ZodString;
32
- }, z.core.$strict>], "kind">;
33
- export type TrierarchWorkspace = z.infer<typeof trierarchWorkspaceSchema>;
34
- export declare const describeCommandSchema: z.ZodObject<{}, z.core.$strict>;
35
- /** A flag a harness adapter adds itself, as mechanism, never the operator's: on every launch or on a restart only. */
36
- export declare const trierarchAdapterFlagSchema: z.ZodObject<{
37
- flag: z.ZodString;
38
- when: z.ZodEnum<{
39
- always: "always";
40
- restart: "restart";
41
- }>;
42
- }, z.core.$strict>;
43
- export type TrierarchAdapterFlag = z.infer<typeof trierarchAdapterFlagSchema>;
44
- export declare const describedAnswerSchema: z.ZodObject<{
45
- harnesses: z.ZodArray<z.ZodObject<{
46
- harness: z.ZodString;
47
- options: z.ZodRecord<z.ZodString, z.ZodJSONSchema>;
48
- flags: z.ZodArray<z.ZodString>;
49
- adapterFlags: z.ZodArray<z.ZodObject<{
50
- flag: z.ZodString;
51
- when: z.ZodEnum<{
52
- always: "always";
53
- restart: "restart";
54
- }>;
55
- }, z.core.$strict>>;
56
- }, z.core.$strict>>;
57
- workspaces: z.ZodObject<{
58
- repositories: z.ZodArray<z.ZodString>;
59
- folders: z.ZodArray<z.ZodString>;
60
- }, z.core.$strict>;
61
- caps: z.ZodObject<{
62
- ships: z.ZodInt;
63
- running: z.ZodInt;
64
- }, z.core.$strict>;
65
- kept: z.ZodArray<z.ZodObject<{
66
- shipId: z.ZodType<`shp_${string}`, unknown, z.core.$ZodTypeInternals<`shp_${string}`, unknown>>;
67
- path: z.ZodString;
68
- }, z.core.$strict>>;
69
- version: z.ZodString;
70
- }, z.core.$strict>;
71
- export declare const wantCommandSchema: z.ZodObject<{
72
- shipId: z.ZodType<`shp_${string}`, unknown, z.core.$ZodTypeInternals<`shp_${string}`, unknown>>;
73
- harness: z.ZodString;
74
- workspace: z.ZodDiscriminatedUnion<[z.ZodObject<{
75
- kind: z.ZodLiteral<"worktree">;
76
- repository: z.ZodString;
77
- ref: z.ZodOptional<z.ZodString>;
78
- }, z.core.$strict>, z.ZodObject<{
79
- kind: z.ZodLiteral<"folder">;
80
- name: z.ZodString;
81
- }, z.core.$strict>], "kind">;
82
- squadron: z.ZodOptional<z.ZodString>;
83
- firstPrompt: z.ZodOptional<z.ZodString>;
84
- options: z.ZodRecord<z.ZodString, z.ZodJSONSchema>;
85
- }, z.core.$strict>;
86
- export type WantCommand = z.infer<typeof wantCommandSchema>;
87
- export declare const wantedAnswerSchema: z.ZodObject<{
88
- shipId: z.ZodType<`shp_${string}`, unknown, z.core.$ZodTypeInternals<`shp_${string}`, unknown>>;
89
- }, z.core.$strict>;
90
- export declare const refusedAnswerSchema: z.ZodObject<{
91
- shipId: z.ZodType<`shp_${string}`, unknown, z.core.$ZodTypeInternals<`shp_${string}`, unknown>>;
92
- field: z.ZodOptional<z.ZodString>;
93
- reason: z.ZodString;
94
- }, z.core.$strict>;
95
- export declare const releaseCommandSchema: z.ZodObject<{
96
- shipId: z.ZodType<`shp_${string}`, unknown, z.core.$ZodTypeInternals<`shp_${string}`, unknown>>;
97
- force: z.ZodOptional<z.ZodBoolean>;
98
- }, z.core.$strict>;
99
- export declare const releasedAnswerSchema: z.ZodObject<{
100
- shipId: z.ZodType<`shp_${string}`, unknown, z.core.$ZodTypeInternals<`shp_${string}`, unknown>>;
101
- workspace: z.ZodEnum<{
102
- kept: "kept";
103
- removed: "removed";
104
- }>;
105
- path: z.ZodOptional<z.ZodString>;
106
- }, z.core.$strict>;
107
- export declare const listCommandSchema: z.ZodObject<{}, z.core.$strict>;
108
- export declare const listedAnswerSchema: z.ZodObject<{
109
- ships: z.ZodArray<z.ZodObject<{
110
- shipId: z.ZodType<`shp_${string}`, unknown, z.core.$ZodTypeInternals<`shp_${string}`, unknown>>;
111
- harness: z.ZodString;
112
- state: z.ZodEnum<{
113
- crewing: "crewing";
114
- running: "running";
115
- restarting: "restarting";
116
- crashed: "crashed";
117
- releasing: "releasing";
118
- wanted: "wanted";
119
- }>;
120
- since: z.ZodISODateTime;
121
- restarts: z.ZodInt;
122
- }, z.core.$strict>>;
123
- kept: z.ZodArray<z.ZodObject<{
124
- shipId: z.ZodType<`shp_${string}`, unknown, z.core.$ZodTypeInternals<`shp_${string}`, unknown>>;
125
- path: z.ZodString;
126
- }, z.core.$strict>>;
127
- orphans: z.ZodArray<z.ZodObject<{
128
- path: z.ZodString;
129
- }, z.core.$strict>>;
130
- }, z.core.$strict>;
131
- export declare const runningNoticeSchema: z.ZodObject<{
132
- shipId: z.ZodType<`shp_${string}`, unknown, z.core.$ZodTypeInternals<`shp_${string}`, unknown>>;
133
- }, z.core.$strict>;
134
- export declare const crashedNoticeSchema: z.ZodObject<{
135
- shipId: z.ZodType<`shp_${string}`, unknown, z.core.$ZodTypeInternals<`shp_${string}`, unknown>>;
136
- exits: z.ZodInt;
137
- }, z.core.$strict>;
138
- export declare const leaseEndedNoticeSchema: z.ZodObject<{
139
- shipId: z.ZodType<`shp_${string}`, unknown, z.core.$ZodTypeInternals<`shp_${string}`, unknown>>;
140
- }, z.core.$strict>;
141
- /** The commands, by name: what a requester sends a trierarch. */
142
- export declare const trierarchCommandSchemas: Readonly<Record<string, z.ZodType>>;
143
- /** The answers, by name, each in reply to its command. */
144
- export declare const trierarchAnswerSchemas: Readonly<Record<string, z.ZodType>>;
145
- /** The notices, by name, unasked, to the ship that sent the want. */
146
- export declare const trierarchNoticeSchemas: Readonly<Record<string, z.ZodType>>;
@@ -1,115 +0,0 @@
1
- import { z } from 'zod';
2
- import { idSchema } from '../ids/index.js';
3
- import { shipHandleSchema } from '../schemas/fleet.js';
4
- import { harnessSchema } from '../schemas/ship.js';
5
- import { trierarchNameSchema } from './names.js';
6
- /**
7
- * The trierarch protocol (docs/trierarch.md, decision 0027): fleet messages
8
- * to and from a trierarch's ship. Aeolus reads none of them. The core is
9
- * fixed for every dispatcher; each harness's options are open, described by
10
- * the JSON Schema describe answers with. Every message refuses unknown
11
- * fields, so a dispatcher never ignores what a requester meant.
12
- */
13
- /** A message's content type, by convention: `application/vnd.aeolus.trierarch.<name>+json`. */
14
- export function trierarchContentType(name) {
15
- return `application/vnd.aeolus.trierarch.${name}+json`;
16
- }
17
- /** The longest first prompt, in UTF-8 bytes: 8 KB, given on the first start only. */
18
- export const FIRST_PROMPT_MAX_BYTES = 8192;
19
- const utf8 = new TextEncoder();
20
- /** Where an entry stands in the trierarch's loop; running covers idle and busy. */
21
- export const TRIERARCH_ENTRY_STATES = ['wanted', 'crewing', 'running', 'restarting', 'crashed', 'releasing'];
22
- export const trierarchEntryStateSchema = z.enum(TRIERARCH_ENTRY_STATES);
23
- const shipIdSchema = idSchema('ship');
24
- /** A new git worktree of a configured repository, or a configured folder used as it is: named, never a path. */
25
- export const trierarchWorkspaceSchema = z.discriminatedUnion('kind', [
26
- z.strictObject({ kind: z.literal('worktree'), repository: trierarchNameSchema, ref: z.string().min(1).optional() }),
27
- z.strictObject({ kind: z.literal('folder'), name: trierarchNameSchema }),
28
- ]);
29
- /** A worktree the trierarch kept because it had changes, until a human or a release with force clears it. */
30
- const keptWorktreeSchema = z.strictObject({ shipId: shipIdSchema, path: z.string().min(1) });
31
- export const describeCommandSchema = z.strictObject({});
32
- /** A flag a harness adapter adds itself, as mechanism, never the operator's: on every launch or on a restart only. */
33
- export const trierarchAdapterFlagSchema = z.strictObject({ flag: z.string().min(1), when: z.enum(['always', 'restart']) });
34
- export const describedAnswerSchema = z.strictObject({
35
- harnesses: z.array(z.strictObject({
36
- harness: harnessSchema,
37
- /** The JSON Schema a want's options are checked against. */
38
- options: z.record(z.string(), z.json()),
39
- /** The flags every launch of this harness gets, as the configuration makes them. */
40
- flags: z.array(z.string()),
41
- /** The flags the harness's adapter adds itself, beside the configured ones. */
42
- adapterFlags: z.array(trierarchAdapterFlagSchema),
43
- })),
44
- workspaces: z.strictObject({ repositories: z.array(trierarchNameSchema), folders: z.array(trierarchNameSchema) }),
45
- caps: z.strictObject({ ships: z.int().positive(), running: z.int().positive() }),
46
- kept: z.array(keptWorktreeSchema),
47
- version: z.string().min(1),
48
- });
49
- export const wantCommandSchema = z.strictObject({
50
- shipId: shipIdSchema,
51
- harness: harnessSchema,
52
- workspace: trierarchWorkspaceSchema,
53
- /** The squadron the ship is a member of, so it checks in at its flagship as a crew line's squadron id does. */
54
- squadron: shipHandleSchema.optional(),
55
- firstPrompt: z
56
- .string()
57
- .min(1)
58
- .refine((prompt) => utf8.encode(prompt).byteLength <= FIRST_PROMPT_MAX_BYTES, `A first prompt is at most ${String(FIRST_PROMPT_MAX_BYTES)} bytes`)
59
- // A harness would read it as a flag the operator never configured (decision 0027).
60
- .refine((prompt) => !prompt.startsWith('-'), 'A first prompt may not start with -, which reads as a flag')
61
- .optional(),
62
- /** Named settings from what describe offers; checked against its JSON Schema by the trierarch. */
63
- options: z.record(z.string(), z.json()),
64
- });
65
- export const wantedAnswerSchema = z.strictObject({ shipId: shipIdSchema });
66
- export const refusedAnswerSchema = z.strictObject({
67
- shipId: shipIdSchema,
68
- /** The field that was refused, such as `options.model`, when one was. */
69
- field: z.string().min(1).optional(),
70
- reason: z.string().min(1),
71
- });
72
- export const releaseCommandSchema = z.strictObject({ shipId: shipIdSchema, force: z.boolean().optional() });
73
- export const releasedAnswerSchema = z.strictObject({
74
- shipId: shipIdSchema,
75
- workspace: z.enum(['removed', 'kept']),
76
- path: z.string().min(1).optional(),
77
- });
78
- export const listCommandSchema = z.strictObject({});
79
- export const listedAnswerSchema = z.strictObject({
80
- ships: z.array(z.strictObject({
81
- shipId: shipIdSchema,
82
- harness: harnessSchema,
83
- state: trierarchEntryStateSchema,
84
- since: z.iso.datetime(),
85
- restarts: z.int().nonnegative(),
86
- })),
87
- kept: z.array(keptWorktreeSchema),
88
- /** Worktrees under the trierarch's root with no entry: reported, never deleted. */
89
- orphans: z.array(z.strictObject({ path: z.string().min(1) })),
90
- });
91
- export const runningNoticeSchema = z.strictObject({ shipId: shipIdSchema });
92
- export const crashedNoticeSchema = z.strictObject({ shipId: shipIdSchema, exits: z.int().positive() });
93
- export const leaseEndedNoticeSchema = z.strictObject({ shipId: shipIdSchema });
94
- /** The commands, by name: what a requester sends a trierarch. */
95
- export const trierarchCommandSchemas = {
96
- describe: describeCommandSchema,
97
- want: wantCommandSchema,
98
- release: releaseCommandSchema,
99
- list: listCommandSchema,
100
- };
101
- /** The answers, by name, each in reply to its command. */
102
- export const trierarchAnswerSchemas = {
103
- described: describedAnswerSchema,
104
- wanted: wantedAnswerSchema,
105
- refused: refusedAnswerSchema,
106
- released: releasedAnswerSchema,
107
- listed: listedAnswerSchema,
108
- };
109
- /** The notices, by name, unasked, to the ship that sent the want. */
110
- export const trierarchNoticeSchemas = {
111
- running: runningNoticeSchema,
112
- crashed: crashedNoticeSchema,
113
- leaseEnded: leaseEndedNoticeSchema,
114
- };
115
- //# sourceMappingURL=protocol.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"protocol.js","sourceRoot":"","sources":["../../src/trierarch/protocol.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,qBAAqB,CAAC;AACvD,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACnD,OAAO,E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