@alienplatform/commands 3.3.10 → 3.3.12

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/README.md ADDED
@@ -0,0 +1,86 @@
1
+ # `@alienplatform/commands`
2
+
3
+ Send commands to an Alien deployment or receive them from any Node or Bun
4
+ process. For hosted Alien, an ordinary app needs no `alien.ts`, manager URL, or
5
+ manually minted token. The package is pure TypeScript over `fetch`.
6
+
7
+ ## Install
8
+
9
+ ```sh
10
+ npm install @alienplatform/commands
11
+ ```
12
+
13
+ Requires Node 18+ or Bun 1.0.23+.
14
+
15
+ ## Send from an external app
16
+
17
+ Connect with the deployment ID and a server-side Alien API key:
18
+
19
+ ```ts
20
+ import { CommandsClient } from "@alienplatform/commands"
21
+
22
+ const commands = await CommandsClient.forDeployment({
23
+ deploymentId: "dep_123",
24
+ apiKey: process.env.ALIEN_API_KEY!,
25
+ })
26
+
27
+ const result = await commands
28
+ .target("image-processor")
29
+ .invoke<{ ok: boolean }>("health-check", {})
30
+ ```
31
+
32
+ Alien discovers the deployment's current manager and mints short-lived,
33
+ commands-only access. The API key is sent only to the Alien API; the client uses
34
+ the short-lived credential with the manager and refreshes it internally.
35
+
36
+ ## Receive in an external app
37
+
38
+ Name the command-enabled Container or Daemon this process serves:
39
+
40
+ ```ts
41
+ import { createCommandReceiver } from "@alienplatform/commands"
42
+
43
+ const receiver = createCommandReceiver({
44
+ deploymentId: "dep_123",
45
+ apiKey: process.env.ALIEN_API_KEY!,
46
+ target: "image-processor",
47
+ })
48
+
49
+ receiver.command("health-check", async () => ({ ok: true }))
50
+
51
+ process.on("SIGTERM", () => receiver.stop())
52
+ await receiver.run()
53
+ ```
54
+
55
+ The target is explicit because one deployment can contain several
56
+ command-capable resources. Discovery starts when `run()` starts; Alien resolves
57
+ whether the target is a Container or Daemon and issues short-lived access
58
+ limited to that deployment and target.
59
+
60
+ Apps deployed by Alien remain zero-config because Alien injects their receiver
61
+ identity and credentials:
62
+
63
+ ```ts
64
+ const receiver = createCommandReceiver()
65
+ receiver.command("health-check", async () => ({ ok: true }))
66
+ await receiver.run()
67
+ ```
68
+
69
+ ## Self-hosted manager
70
+
71
+ The explicit constructor remains available for self-hosting and local
72
+ development:
73
+
74
+ ```ts
75
+ const commands = new CommandsClient({
76
+ managerUrl: "http://localhost:8080",
77
+ deploymentId: "dep_123",
78
+ token: process.env.ALIEN_COMMANDS_TOKEN!,
79
+ })
80
+ ```
81
+
82
+ For an explicit receiver, configure the existing `ALIEN_COMMANDS_*`
83
+ environment variables and call `createCommandReceiver()`.
84
+
85
+ Both hosted APIs accept `platformUrl` when the Alien Platform API is not at
86
+ `https://api.alien.dev`.
@@ -0,0 +1,72 @@
1
+ import type { CommandTargetType } from "./protocol.js";
2
+ interface CommandConnectionBase {
3
+ managerUrl: string;
4
+ token: string;
5
+ expiresAt: Date;
6
+ }
7
+ export interface SenderCommandConnection extends CommandConnectionBase {
8
+ role: "sender";
9
+ }
10
+ export interface ReceiverCommandConnection extends CommandConnectionBase {
11
+ role: "receiver";
12
+ target: {
13
+ resourceId: string;
14
+ resourceType: Exclude<CommandTargetType, "worker">;
15
+ };
16
+ }
17
+ export type CommandConnection = SenderCommandConnection | ReceiverCommandConnection;
18
+ interface HostedConnectionOptionsBase {
19
+ deploymentId: string;
20
+ apiKey: string;
21
+ platformUrl?: string;
22
+ fetch?: typeof fetch;
23
+ }
24
+ type HostedConnectionOptions = HostedConnectionOptionsBase & ({
25
+ role: "sender";
26
+ target?: never;
27
+ } | {
28
+ role: "receiver";
29
+ target: string;
30
+ });
31
+ export interface RefreshingConnectionProvider<Connection> {
32
+ get(signal?: AbortSignal): Promise<Connection>;
33
+ /**
34
+ * Refresh credentials after an authentication failure. Returns `undefined`
35
+ * when this connection is fixed and the request must not be retried.
36
+ */
37
+ refresh(signal?: AbortSignal): Promise<Connection | undefined>;
38
+ }
39
+ export type CommandConnectionProvider = RefreshingConnectionProvider<CommandConnection>;
40
+ /**
41
+ * Execute an authenticated request and retry it once when the server rejects
42
+ * credentials that the provider can refresh.
43
+ */
44
+ export declare function requestWithRefreshingConnection<Connection, Result extends {
45
+ response: Response;
46
+ }>(provider: RefreshingConnectionProvider<Connection>, request: (connection: Connection) => Promise<Result>, signal?: AbortSignal): Promise<Result>;
47
+ export declare class FixedCommandConnectionProvider implements CommandConnectionProvider {
48
+ private readonly connection;
49
+ constructor(connection: CommandConnection);
50
+ get(): Promise<CommandConnection>;
51
+ refresh(): Promise<undefined>;
52
+ }
53
+ /**
54
+ * Refreshable hosted-Platform connection. Refreshes before expiration and
55
+ * coalesces concurrent refreshes so one reused client does not stampede the
56
+ * bootstrap endpoint.
57
+ */
58
+ export declare class HostedCommandConnectionProvider implements CommandConnectionProvider {
59
+ private readonly request;
60
+ private readonly apiKey;
61
+ private readonly platformUrl;
62
+ private readonly fetchImpl;
63
+ private current;
64
+ private refreshInFlight;
65
+ constructor(options: HostedConnectionOptions);
66
+ get(signal?: AbortSignal): Promise<CommandConnection>;
67
+ refresh(signal?: AbortSignal): Promise<CommandConnection>;
68
+ private bootstrap;
69
+ }
70
+ export declare function managerCommandsUrl(managerUrl: string): string;
71
+ export {};
72
+ //# sourceMappingURL=bootstrap.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"bootstrap.d.ts","sourceRoot":"","sources":["../src/bootstrap.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAA;AA2BtD,UAAU,qBAAqB;IAC7B,UAAU,EAAE,MAAM,CAAA;IAClB,KAAK,EAAE,MAAM,CAAA;IACb,SAAS,EAAE,IAAI,CAAA;CAChB;AAED,MAAM,WAAW,uBAAwB,SAAQ,qBAAqB;IACpE,IAAI,EAAE,QAAQ,CAAA;CACf;AAED,MAAM,WAAW,yBAA0B,SAAQ,qBAAqB;IACtE,IAAI,EAAE,UAAU,CAAA;IAChB,MAAM,EAAE;QACN,UAAU,EAAE,MAAM,CAAA;QAClB,YAA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IjC,OAAO,IAAI,OAAO,CAAC,SAAS,CAAC;CAG9B;AAED;;;;GAIG;AACH,qBAAa,+BAAgC,YAAW,yBAAyB;IAC/E,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAkB;IAC1C,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAQ;IAC/B,OAAO,CAAC,QAAQ,CAAC,WAAW,CAAQ;IACpC,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAc;IACxC,OAAO,CAAC,OAAO,CAA+B;IAC9C,OAAO,CAAC,eAAe,CAAwC;gBAEnD,OAAO,EAAE,uBAAuB;IAkBtC,GAAG,CAAC,MAAM,CAAC,EAAE,WAAW,GAAG,OAAO,CAAC,iBAAiB,CAAC;IAUrD,OAAO,CAAC,MAAM,CAAC,EAAE,WAAW,GAAG,OAAO,CAAC,iBAAiB,CAAC;YAkBjD,SAAS;CAoFxB;AAED,wBAAgB,kBAAkB,CAAC,UAAU,EAAE,MAAM,GAAG,MAAM,CAa7D"}
package/dist/client.d.ts CHANGED
@@ -30,6 +30,23 @@ export interface CommandsClientConfig {
30
30
  /** `fetch` implementation (defaults to the global `fetch`). */
31
31
  fetch?: typeof fetch;
32
32
  }
33
+ /**
34
+ * Hosted Alien configuration for {@link CommandsClient.forDeployment}.
35
+ */
36
+ export interface CommandsClientDeploymentConfig {
37
+ /** Deployment ID to invoke commands on. */
38
+ deploymentId: string;
39
+ /** Alien API key used to discover the manager and mint command-only access. */
40
+ apiKey: string;
41
+ /** Alien Platform API base URL (default: "https://api.alien.dev"). */
42
+ platformUrl?: string;
43
+ /** Default invoke timeout in milliseconds (default: 60000). */
44
+ timeoutMs?: number;
45
+ /** Allow reading local files for storage responses (default: false, local dev only). */
46
+ allowLocalStorage?: boolean;
47
+ /** `fetch` implementation (defaults to the global `fetch`). */
48
+ fetch?: typeof fetch;
49
+ }
33
50
  /**
34
51
  * Per-invoke options.
35
52
  */
@@ -53,13 +70,19 @@ export interface InvokeOptions {
53
70
  * Command sender for invoking deployment commands.
54
71
  */
55
72
  export declare class CommandsClient {
56
- private readonly managerUrl;
57
73
  private readonly deploymentId;
58
- private readonly token;
59
74
  private readonly defaultTimeout;
60
75
  private readonly allowLocalStorage;
61
76
  private readonly fetchImpl;
77
+ private connectionProvider;
62
78
  constructor(config: CommandsClientConfig);
79
+ /**
80
+ * Connect to an Alien-hosted deployment using only its ID and an Alien API
81
+ * key. Alien resolves the deployment's current manager and mints a
82
+ * short-lived command-only credential. Reused clients refresh that
83
+ * connection before expiry and once after a manager 401.
84
+ */
85
+ static forDeployment(config: CommandsClientDeploymentConfig): Promise<CommandsClient>;
63
86
  /**
64
87
  * Scope this client to one target command-capable resource: every `invoke`
65
88
  * made through the returned builder presets `targetResourceId` to `name`,
@@ -1 +1 @@
1
- {"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AA2BH;;GAEG;AACH,MAAM,WAAW,oBAAoB;IACnC,uFAAuF;IACvF,UAAU,EAAE,MAAM,CAAA;IAClB,2CAA2C;IAC3C,YAAY,EAAE,MAAM,CAAA;IACpB,0DAA0D;IAC1D,KAAK,EAAE,MAAM,CAAA;IACb,+DAA+D;IAC/D,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,wFAAwF;IACxF,iBAAiB,CAAC,EAAE,OAAO,CAAA;IAC3B,+DAA+D;IAC/D,KAAK,CAAC,EAAE,OAAO,KAAK,CAAA;CACrB;AAED;;GAEG;AACH,MAAM,WAAW,aAAa;IAC5B,8EAA8E;IAC9E,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,4DAA4D;IAC5D,QAAQ,CAAC,EAAE,IAAI,CAAA;IACf,iFAAiF;IACjF,cAAc,CAAC,EAAE,MAAM,CAAA;IACvB,oFAAoF;IACpF,gBAAgB,CAAC,EAAE,MAAM,CAAA;IACzB,+DAA+D;IAC/D,cAAc,CAAC,EAAE,MAAM,CAAA;IACvB,gEAAgE;IAChE,iBAAiB,C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Q;IACrC,OAAO,CAAC,QAAQ,CAAC,cAAc,CAAQ;IACvC,OAAO,CAAC,QAAQ,CAAC,iBAAiB,CAAS;IAC3C,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAc;IACxC,OAAO,CAAC,kBAAkB,CAA2B;gBAEzC,MAAM,EAAE,oBAAoB;IAaxC;;;;;OAKG;WACU,aAAa,CAAC,MAAM,EAAE,8BAA8B,GAAG,OAAO,CAAC,cAAc,CAAC;IAqB3F;;;;;;;;OAQG;IACH,MAAM,CAAC,IAAI,EAAE,MAAM,GAAG,gBAAgB;IAItC;;;;;;;OAOG;IACG,MAAM,CAAC,SAAS,GAAG,OAAO,EAC9B,OAAO,EAAE,MAAM,EACf,KAAK,EAAE,OAAO,EACd,OAAO,CAAC,EAAE,aAAa,GACtB,OAAO,CAAC,SAAS,CAAC;IAsCrB;;;;;;;OAOG;IACH;;;;;;;;;OASG;IACH,OAAO,CAAC,eAAe;YAQT,YAAY;IAgD1B;;OAEG;IACH,OAAO,CAAC,aAAa;IAuBrB;;OAEG;IACH,OAAO,CAAC,gBAAgB;IAMxB;;OAEG;YACW,mBAAmB;IA4DjC;;OAEG;IACH,OAAO,CAAC,KAAK;CAGd;AAED;;;;;;;GAOG;AACH,qBAAa,gBAAgB;IAEzB,OAAO,CAAC,QAAQ,CAAC,MAAM;IACvB,OAAO,CAAC,QAAQ,CAAC,UAAU;gBADV,MAAM,EAAE,cAAc,EACtB,UAAU,EAAE,MAAM;IAGrC;;;OAGG;IACH,MAAM,CAAC,SAAS,GAAG,OAAO,EACxB,OAAO,EAAE,MAAM,EACf,KAAK,EAAE,OAAO,EACd,OAAO,CAAC,EAAE,aAAa,GACtB,OAAO,CAAC,SAAS,CAAC;CAMtB"}
package/dist/errors.d.ts CHANGED
@@ -6,6 +6,88 @@
6
6
  * `@alienplatform/core` so it carries the shared `AlienError` identity.
7
7
  */
8
8
  import * as z from "zod/v4";
9
+ /**
10
+ * Error thrown when hosted command bootstrap configuration is invalid.
11
+ */
12
+ export declare const CommandBootstrapConfigInvalidError: {
13
+ metadata: import("@alienplatform/core").AlienErrorMetadata<z.ZodObject<{
14
+ field: z.ZodString;
15
+ reason: z.ZodString;
16
+ }, z.core.$strip>>;
17
+ contextSchema: z.ZodObject<{
18
+ field: z.ZodString;
19
+ reason: z.ZodString;
20
+ }, z.core.$strip>;
21
+ create: (context: {
22
+ field: string;
23
+ reason: string;
24
+ }) => import("@alienplatform/core").AlienErrorDefinition<z.ZodObject<{
25
+ field: z.ZodString;
26
+ reason: z.ZodString;
27
+ }, z.core.$strip>>;
28
+ };
29
+ /**
30
+ * Error thrown when a network or transport failure prevents hosted command
31
+ * bootstrap.
32
+ */
33
+ export declare const CommandBootstrapFailedError: {
34
+ metadata: import("@alienplatform/core").AlienErrorMetadata<z.ZodObject<{
35
+ deploymentId: z.ZodString;
36
+ role: z.ZodEnum<{
37
+ sender: "sender";
38
+ receiver: "receiver";
39
+ }>;
40
+ reason: z.ZodString;
41
+ }, z.core.$strip>>;
42
+ contextSchema: z.ZodObject<{
43
+ deploymentId: z.ZodString;
44
+ role: z.ZodEnum<{
45
+ sender: "sender";
46
+ receiver: "receiver";
47
+ }>;
48
+ reason: z.ZodString;
49
+ }, z.core.$strip>;
50
+ create: (context: {
51
+ deploymentId: string;
52
+ role: "sender" | "receiver";
53
+ reason: string;
54
+ }) => import("@alienplatform/core").AlienErrorDefinition<z.ZodObject<{
55
+ deploymentId: z.ZodString;
56
+ role: z.ZodEnum<{
57
+ sender: "sender";
58
+ receiver: "receiver";
59
+ }>;
60
+ reason: z.ZodString;
61
+ }, z.core.$strip>>;
62
+ };
63
+ /**
64
+ * Error thrown when the Alien Platform API rejects command bootstrap.
65
+ */
66
+ export declare const PlatformHttpError: {
67
+ metadata: import("@alienplatform/core").AlienErrorMetadata<z.ZodObject<{
68
+ method: z.ZodString;
69
+ url: z.ZodString;
70
+ status: z.ZodNumber;
71
+ statusText: z.ZodString;
72
+ }, z.core.$strip>>;
73
+ contextSchema: z.ZodObject<{
74
+ method: z.ZodString;
75
+ url: z.ZodString;
76
+ status: z.ZodNumber;
77
+ statusText: z.ZodString;
78
+ }, z.core.$strip>;
79
+ create: (context: {
80
+ method: string;
81
+ url: string;
82
+ status: number;
83
+ statusText: string;
84
+ }) => import("@alienplatform/core").AlienErrorDefinition<z.ZodObject<{
85
+ method: z.ZodString;
86
+ url: z.ZodString;
87
+ status: z.ZodNumber;
88
+ statusText: z.ZodString;
89
+ }, z.core.$strip>>;
90
+ };
9
91
  /**
10
92
  * Error thrown when command creation fails.
11
93
  */
@@ -1 +1 @@
1
- {"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../src/errors.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAGH,OAAO,KAAK,CAAC,MAAM,QAAQ,CAAA;AAE3B;;GAEG;AACH,eAAO,MAAM,0BAA0B;;;;;;;;;;;;;;;;;;;;CAYrC,CAAA;AAEF;;;GAGG;AACH,eAAO,MAAM,wBAAwB;;;;;;;;;;;;;;;;CAWnC,CAAA;AAEF;;GAEG;AACH,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;;;;;;;;;;CAa9B,CAAA;AAEF;;GAEG;AACH,eAAO,MAAM,sBAAsB;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAcjC,CAAA;AAEF;;GAEG;AACH,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;;CAU9B,CAAA;AAEF;;GAEG;AACH,eAAO,MAAM,2BAA2B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAWtC,CAAA;AAEF;;GAEG;AACH,eAAO,MAAM,2BAA2B;;;;;;;;;;;;;;;;;;;;CAWtC,CAAA;AAEF;;;;;;;;GAQG;AACH,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;;CAU/B,CAAA;AAEF;;;;;;;;GAQG;AACH,eAAO,MAAM,iCAAiC;;;;;;;;;;;;;;;;CAU5C,CAAA;AAEF;;GAEG;AACH,eAAO,MAAM,gBAAgB;;;;;;;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;;;;;;;;;;;;;;CAc3B,CAAA;AAEF;;;;;GAKG;AACH,eAAO,MAAM,sBAAsB;;;;;;;;;;;;;;;;;;;;CAWjC,CAAA"}
package/dist/index.d.ts CHANGED
@@ -26,11 +26,11 @@
26
26
  * await scoped.invoke("restart", {})
27
27
  * ```
28
28
  */
29
+ export { AlienError, defineError } from "@alienplatform/core";
30
+ export type { CommandsClientConfig, CommandsClientDeploymentConfig, InvokeOptions, } from "./client.js";
29
31
  export { CommandsClient, TargetedCommands } from "./client.js";
30
- export type { CommandsClientConfig, InvokeOptions } from "./client.js";
31
- export { createCommandReceiver } from "./receiver.js";
32
- export type { CommandContext, CommandHandler, CommandReceiver, CommandReceiverOptions, RawCommandHandler, StandardSchema, StandardSchemaOutput, } from "./receiver.js";
33
- export { CommandCreationFailedError, CommandExpiredError, CommandReceiverConfigInvalidError, CommandStatusFailedError, CommandTimeoutError, DeploymentCommandError, InvalidEnvelopeError, ManagerHttpError, MalformedResponseError, ResponseDecodingFailedError, StorageOperationFailedError, } from "./errors.js";
32
+ export { CommandBootstrapConfigInvalidError, CommandBootstrapFailedError, CommandCreationFailedError, CommandExpiredError, CommandReceiverConfigInvalidError, CommandStatusFailedError, CommandTimeoutError, DeploymentCommandError, InvalidEnvelopeError, MalformedResponseError, ManagerHttpError, PlatformHttpError, ResponseDecodingFailedError, StorageOperationFailedError, } from "./errors.js";
34
33
  export type { BodySpec, CommandResponse, CommandState, CommandStatusResponse, CommandTarget, CommandTargetType, CreateCommandRequest, CreateCommandResponse, Envelope, ErrorResponse, LeaseInfo, LeaseRequest, LeaseResponse, PresignedRequest, ReleaseRequest, ResponseHandling, StorageUpload, SubmitResponseRequest, UploadCompleteRequest, UploadCompleteResponse, } from "./protocol.js";
35
- export { AlienError, defineError } from "@alienplatform/core";
34
+ export type { CommandContext, CommandHandler, CommandReceiver, CommandReceiverOptions, HostedCommandReceiverOptions, RawCommandHandler, StandardSchema, StandardSchemaOutput, } from "./receiver.js";
35
+ export { createCommandReceiver } from "./receiver.js";
36
36
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AAGH,OAAO,EAAE,cAAc,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAA;AAC9D,YAAY,EAAE,oBAAoB,EAAE,aAAa,EAAE,MAAM,aAAa,CAAA;AAGtE,OAAO,EAAE,qBAAqB,EAAE,MAAM,eAAe,CAAA;AACrD,YAAY,EACV,cAAc,EACd,cAAc,EACd,eAAe,EACf,sBAAsB,EACtB,iBAAiB,EACjB,cAAc,EACd,oBAAoB,GACrB,MAAM,eAAe,CAAA;AAGtB,OAAO,EACL,0BAA0B,EAC1B,mBAAmB,EACnB,iCAAiC,EACjC,wBAAwB,EACxB,mBAAmB,EACnB,sBAAsB,EACtB,oBAAoB,EACpB,gBAAgB,EAChB,sBAAsB,EACtB,2BAA2B,EAC3B,2BAA2B,GAC5B,MAAM,aAAa,CAAA;AAGpB,YAAY,EACV,QAAQ,EACR,eAAe,EACf,YAAY,EACZ,qBAAqB,EACrB,aAAa,EACb,iBAAiB,EACjB,oBAAoB,EACpB,qBAAqB,EACrB,QAAQ,EACR,aAAa,EACb,SAAS,EACT,YAAY,EACZ,aAAa,EACb,gBAAgB,EAChB,cAAc,EACd,gBAAgB,EAChB,aAAa,EACb,qBAAqB,EACrB,qBAAqB,EACrB,sBAAsB,GACvB,MAAM,eAAe,CAAA;AAGtB,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AAGH,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAA;AAC7D,YAAY,EACV,oBAAoB,EACpB,8BA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