@caelo-cms/shared 0.10.47 → 0.10.49
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/ai-tools.d.ts +4 -3
- package/dist/ai-tools.d.ts.map +1 -1
- package/dist/ai-tools.js +5 -4
- package/dist/ai-tools.js.map +1 -1
- package/dist/auto-update.d.ts +124 -0
- package/dist/auto-update.d.ts.map +1 -0
- package/dist/auto-update.js +228 -0
- package/dist/auto-update.js.map +1 -0
- package/dist/cloud-shell-install.d.ts +27 -0
- package/dist/cloud-shell-install.d.ts.map +1 -0
- package/dist/cloud-shell-install.js +38 -0
- package/dist/cloud-shell-install.js.map +1 -0
- package/dist/database-url.d.ts +15 -0
- package/dist/database-url.d.ts.map +1 -1
- package/dist/database-url.js +15 -0
- package/dist/database-url.js.map +1 -1
- package/dist/index.d.ts +4 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +4 -0
- package/dist/index.js.map +1 -1
- package/dist/platform-updates.d.ts +159 -0
- package/dist/platform-updates.d.ts.map +1 -0
- package/dist/platform-updates.js +253 -0
- package/dist/platform-updates.js.map +1 -0
- package/dist/release-manifest.d.ts +99 -0
- package/dist/release-manifest.d.ts.map +1 -0
- package/dist/release-manifest.js +161 -0
- package/dist/release-manifest.js.map +1 -0
- package/dist/seo.d.ts.map +1 -1
- package/dist/seo.js +4 -1
- package/dist/seo.js.map +1 -1
- package/dist/static-cache-policy.d.ts +7 -4
- package/dist/static-cache-policy.d.ts.map +1 -1
- package/dist/static-cache-policy.js +7 -4
- package/dist/static-cache-policy.js.map +1 -1
- package/dist/subagents.d.ts +1 -1
- package/dist/version.d.ts +2 -2
- package/dist/version.js +1 -1
- package/package.json +1 -1
- package/src/ai-tools.ts +5 -4
- package/src/auto-update.test.ts +321 -0
- package/src/auto-update.ts +315 -0
- package/src/cloud-shell-install.test.ts +20 -0
- package/src/cloud-shell-install.ts +47 -0
- package/src/database-url.test.ts +16 -1
- package/src/database-url.ts +21 -0
- package/src/index.ts +4 -0
- package/src/platform-updates.test.ts +160 -0
- package/src/platform-updates.ts +336 -0
- package/src/release-manifest.ts +212 -0
- package/src/seo.ts +4 -1
- package/src/static-cache-policy.test.ts +6 -2
- package/src/static-cache-policy.ts +7 -4
- package/src/version.ts +1 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cloud-shell-install.js","sourceRoot":"","sources":["../src/cloud-shell-install.ts"],"names":[],"mappings":"AAAA,mCAAmC;AAEnC;;;;;;;;;GASG;AAEH,oDAAoD;AACpD,MAAM,CAAC,MAAM,wBAAwB,GAAG,sCAAsC,CAAC;AAE/E,yEAAyE;AACzE,MAAM,CAAC,MAAM,wBAAwB,GAAG,kDAAkD,CAAC;AAK3F,MAAM,MAAM,GAAG,qBAAqB,CAAC;AAErC;;;;;;;;GAQG;AACH,MAAM,UAAU,oBAAoB,CAAC,OAAe,EAAE,QAA4B;IAChF,MAAM,CAAC,GAAG,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IAC/B,IAAI,CAAC,CAAC,EAAE,CAAC;QACP,MAAM,IAAI,KAAK,CACb,oCAAoC,OAAO,yCAAyC,wBAAwB,EAAE,CAC/G,CAAC;IACJ,CAAC;IACD,OAAO;QACL,kDAAkD;QAClD,wBAAwB,wBAAwB,EAAE;QAClD,mCAAmC,CAAC,CAAC,CAAC,CAAC,EAAE;QACzC,wBAAwB,QAAQ,KAAK;KACtC,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;AACb,CAAC"}
|
package/dist/database-url.d.ts
CHANGED
|
@@ -35,4 +35,19 @@ export declare function withDatabasePassword(url: string, password: string, labe
|
|
|
35
35
|
* @param env The environment to read (defaults to `process.env`).
|
|
36
36
|
*/
|
|
37
37
|
export declare function databaseUrlFromEnv(urlVars: readonly string[], env?: Readonly<Record<string, string | undefined>>): string | undefined;
|
|
38
|
+
/**
|
|
39
|
+
* Password-less database URLs for Cloud SQL IAM database authentication —
|
|
40
|
+
* how the in-cloud jobs (the operator-access sync job, the upgrader job)
|
|
41
|
+
* connect: the user is the service account email without
|
|
42
|
+
* `.gserviceaccount.com`, the password a short-lived OAuth access token.
|
|
43
|
+
*
|
|
44
|
+
* @example
|
|
45
|
+
* cloudSqlIamDatabaseUrls("10.0.0.3", "job@p.iam.gserviceaccount.com", "ya29.x").user
|
|
46
|
+
* // → "job@p.iam"
|
|
47
|
+
*/
|
|
48
|
+
export declare function cloudSqlIamDatabaseUrls(host: string, serviceAccountEmail: string, accessToken: string): {
|
|
49
|
+
admin: string;
|
|
50
|
+
public: string;
|
|
51
|
+
user: string;
|
|
52
|
+
};
|
|
38
53
|
//# sourceMappingURL=database-url.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"database-url.d.ts","sourceRoot":"","sources":["../src/database-url.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;;GAcG;AAEH,oEAAoE;AACpE,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAK1D;AAED;;;;;;;;GAQG;AACH,wBAAgB,oBAAoB,CAClC,GAAG,EAAE,MAAM,EACX,QAAQ,EAAE,MAAM,EAChB,KAAK,SAAiB,GACrB,MAAM,CAoBR;AAED;;;;;;;;GAQG;AACH,wBAAgB,kBAAkB,CAChC,OAAO,EAAE,SAAS,MAAM,EAAE,EAC1B,GAAG,GAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC,CAAe,GAC9D,MAAM,GAAG,SAAS,CASpB"}
|
|
1
|
+
{"version":3,"file":"database-url.d.ts","sourceRoot":"","sources":["../src/database-url.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;;GAcG;AAEH,oEAAoE;AACpE,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAK1D;AAED;;;;;;;;GAQG;AACH,wBAAgB,oBAAoB,CAClC,GAAG,EAAE,MAAM,EACX,QAAQ,EAAE,MAAM,EAChB,KAAK,SAAiB,GACrB,MAAM,CAoBR;AAED;;;;;;;;GAQG;AACH,wBAAgB,kBAAkB,CAChC,OAAO,EAAE,SAAS,MAAM,EAAE,EAC1B,GAAG,GAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC,CAAe,GAC9D,MAAM,GAAG,SAAS,CASpB;AAED;;;;;;;;;GASG;AACH,wBAAgB,uBAAuB,CACrC,IAAI,EAAE,MAAM,EACZ,mBAAmB,EAAE,MAAM,EAC3B,WAAW,EAAE,MAAM,GAClB;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,CAKjD"}
|
package/dist/database-url.js
CHANGED
|
@@ -70,4 +70,19 @@ export function databaseUrlFromEnv(urlVars, env = process.env) {
|
|
|
70
70
|
}
|
|
71
71
|
return undefined;
|
|
72
72
|
}
|
|
73
|
+
/**
|
|
74
|
+
* Password-less database URLs for Cloud SQL IAM database authentication —
|
|
75
|
+
* how the in-cloud jobs (the operator-access sync job, the upgrader job)
|
|
76
|
+
* connect: the user is the service account email without
|
|
77
|
+
* `.gserviceaccount.com`, the password a short-lived OAuth access token.
|
|
78
|
+
*
|
|
79
|
+
* @example
|
|
80
|
+
* cloudSqlIamDatabaseUrls("10.0.0.3", "job@p.iam.gserviceaccount.com", "ya29.x").user
|
|
81
|
+
* // → "job@p.iam"
|
|
82
|
+
*/
|
|
83
|
+
export function cloudSqlIamDatabaseUrls(host, serviceAccountEmail, accessToken) {
|
|
84
|
+
const user = serviceAccountEmail.replace(/\.gserviceaccount\.com$/, "");
|
|
85
|
+
const url = (db) => `postgresql://${encodeURIComponent(user)}:${encodeURIComponent(accessToken)}@${host}:5432/${db}?sslmode=require`;
|
|
86
|
+
return { admin: url("cms_admin"), public: url("cms_public"), user };
|
|
87
|
+
}
|
|
73
88
|
//# sourceMappingURL=database-url.js.map
|
package/d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,GAAG,CAAC,WAAW,CAAC,EAAE,MAAM,EAAE,GAAG,CAAC,YAAY,CAAC,EAAE,IAAI,EAAE,CAAC;AACtE,CAAC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
export declare const PROJECT_NAME = "caelo-cms";
|
|
2
2
|
export * from "./ai-tools.js";
|
|
3
3
|
export * from "./auth-forms.js";
|
|
4
|
+
export * from "./auto-update.js";
|
|
4
5
|
export * from "./base-css.js";
|
|
5
6
|
export * from "./build-page.js";
|
|
6
7
|
export * from "./cap-failures.js";
|
|
8
|
+
export * from "./cloud-shell-install.js";
|
|
7
9
|
export * from "./content.js";
|
|
8
10
|
export * from "./context.js";
|
|
9
11
|
export * from "./css-gradient-scan.js";
|
|
@@ -22,12 +24,14 @@ export { type LogContext, type Logger, type LoggerOptions, type LogLevel, makeLo
|
|
|
22
24
|
export * from "./media.js";
|
|
23
25
|
export * from "./nested-module-render.js";
|
|
24
26
|
export * from "./page-log.js";
|
|
27
|
+
export * from "./platform-updates.js";
|
|
25
28
|
export * from "./plugin-preview.js";
|
|
26
29
|
export * from "./preview-compose.js";
|
|
27
30
|
export * from "./preview-scanner.js";
|
|
28
31
|
export * from "./proposal-status.js";
|
|
29
32
|
export * from "./provisioning-command.js";
|
|
30
33
|
export * from "./redirect-target.js";
|
|
34
|
+
export * from "./release-manifest.js";
|
|
31
35
|
export * from "./responsive-images.js";
|
|
32
36
|
export * from "./result.js";
|
|
33
37
|
export * from "./safe-keys.js";
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,YAAY,cAAc,CAAC;AAExC,cAAc,eAAe,CAAC;AAC9B,cAAc,iBAAiB,CAAC;AAChC,cAAc,eAAe,CAAC;AAC9B,cAAc,iBAAiB,CAAC;AAChC,cAAc,mBAAmB,CAAC;AAClC,cAA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AAC;AACtC,cAAc,qBAAqB,CAAC;AACpC,cAAc,sBAAsB,CAAC;AACrC,cAAc,sBAAsB,CAAC;AACrC,cAAc,sBAAsB,CAAC;AACrC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,sBAAsB,CAAC;AACrC,cAAc,uBAAuB,CAAC;AACtC,cAAc,wBAAwB,CAAC;AACvC,cAAc,aAAa,CAAC;AAC5B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,UAAU,CAAC;AACzB,cAAc,aAAa,CAAC;AAC5B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,mBAAmB,CAAC;AAClC,cAAc,0BAA0B,CAAC;AACzC,cAAc,kBAAkB,CAAC;AACjC,cAAc,sBAAsB,CAAC;AACrC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,sBAAsB,CAAC;AACrC,cAAc,kCAAkC,CAAC;AACjD,cAAc,2BAA2B,CAAC;AAC1C,cAAc,4BAA4B,CAAC;AAC3C,cAAc,6BAA6B,CAAC;AAC5C,cAAc,uCAAuC,CAAC;AACtD,cAAc,+BAA+B,CAAC;AAC9C,cAAc,4BAA4B,CAAC;AAC3C,cAAc,sBAAsB,CAAC;AACrC,cAAc,iBAAiB,CAAC;AAChC,cAAc,mBAAmB,CAAC;AAClC,cAAc,aAAa,CAAC;AAC5B,cAAc,oBAAoB,CAAC;AACnC,cAAc,UAAU,CAAC;AACzB,OAAO,EACL,aAAa,EACb,aAAa,EACb,KAAK,YAAY,EACjB,cAAc,EACd,YAAY,GACb,MAAM,cAAc,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -2,9 +2,11 @@
|
|
|
2
2
|
export const PROJECT_NAME = "caelo-cms";
|
|
3
3
|
export * from "./ai-tools.js";
|
|
4
4
|
export * from "./auth-forms.js";
|
|
5
|
+
export * from "./auto-update.js";
|
|
5
6
|
export * from "./base-css.js";
|
|
6
7
|
export * from "./build-page.js";
|
|
7
8
|
export * from "./cap-failures.js";
|
|
9
|
+
export * from "./cloud-shell-install.js";
|
|
8
10
|
export * from "./content.js";
|
|
9
11
|
export * from "./context.js";
|
|
10
12
|
export * from "./css-gradient-scan.js";
|
|
@@ -23,12 +25,14 @@ export { makeLogger, mintRequestId, redact, } from "./logger.js";
|
|
|
23
25
|
export * from "./media.js";
|
|
24
26
|
export * from "./nested-module-render.js";
|
|
25
27
|
export * from "./page-log.js";
|
|
28
|
+
export * from "./platform-updates.js";
|
|
26
29
|
export * from "./plugin-preview.js";
|
|
27
30
|
export * from "./preview-compose.js";
|
|
28
31
|
export * from "./preview-scanner.js";
|
|
29
32
|
export * from "./proposal-status.js";
|
|
30
33
|
export * from "./provisioning-command.js";
|
|
31
34
|
export * from "./redirect-target.js";
|
|
35
|
+
export * from "./release-manifest.js";
|
|
32
36
|
export * from "./responsive-images.js";
|
|
33
37
|
export * from "./result.js";
|
|
34
38
|
export * from "./safe-keys.js";
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,mCAAmC;AAEnC,MAAM,CAAC,MAAM,YAAY,GAAG,WAAW,CAAC;AAExC,cAAc,eAAe,CAAC;AAC9B,cAAc,iBAAiB,CAAC;AAChC,cAAc,eAAe,CAAC;AAC9B,cAAc,iBAAiB,CAAC;AAChC,cAAc,mBAAmB,CAAC;AAClC,cAAc,cAAc,CAAC;AAC7B,cAAc,cAAc,CAAC;AAC7B,cAAc,wBAAwB,CAAC;AACvC,cAAc,mBAAmB,CAAC;AAClC,cAAc,mBAAmB,CAAC;AAClC,cAAc,yBAAyB,CAAC;AACxC,cAAc,wBAAwB,CAAC;AACvC,cAAc,kBAAkB,CAAC;AACjC,cAAc,YAAY,CAAC;AAC3B,cAAc,cAAc,CAAC;AAC7B,cAAc,wBAAwB,CAAC;AACvC,cAAc,oBAAoB,CAAC;AACnC,cAAc,yBAAyB,CAAC;AACxC,cAAc,mBAAmB,CAAC;AAClC,OAAO,EAKL,UAA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CAAC;AAC3C,cAAc,6BAA6B,CAAC;AAC5C,cAAc,uCAAuC,CAAC;AACtD,cAAc,+BAA+B,CAAC;AAC9C,cAAc,4BAA4B,CAAC;AAC3C,cAAc,sBAAsB,CAAC;AACrC,cAAc,iBAAiB,CAAC;AAChC,cAAc,mBAAmB,CAAC;AAClC,cAAc,aAAa,CAAC;AAC5B,cAAc,oBAAoB,CAAC;AACnC,cAAc,UAAU,CAAC;AACzB,OAAO,EACL,aAAa,EACb,aAAa,EAEb,cAAc,EACd,YAAY,GACb,MAAM,cAAc,CAAC"}
|
|
@@ -0,0 +1,159 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* In-product Caelo updates (epic #696): the vocabulary the admin (Settings →
|
|
3
|
+
* Updates, the `platform_updates.*` ops), the upgrader job and the Phase 5
|
|
4
|
+
* scheduler share. One module so the timeline the page renders, the states
|
|
5
|
+
* the job writes and the database CHECK constraints (migration 0267) agree.
|
|
6
|
+
*/
|
|
7
|
+
import { z } from "zod";
|
|
8
|
+
/** Every state of an update request (`platform_update_requests.status`). */
|
|
9
|
+
export declare const PLATFORM_UPDATE_STATUSES: readonly ["pending", "running", "succeeded", "rolled_back", "failed", "refused", "needs_cloud_shell", "cancelled"];
|
|
10
|
+
export type PlatformUpdateStatusValue = (typeof PLATFORM_UPDATE_STATUSES)[number];
|
|
11
|
+
/** States in which a request is still in flight (at most one at a time). */
|
|
12
|
+
export declare const ACTIVE_UPDATE_STATUSES: readonly PlatformUpdateStatusValue[];
|
|
13
|
+
/** Whether `status` is an end state. */
|
|
14
|
+
export declare function isFinishedUpdateStatus(status: PlatformUpdateStatusValue): boolean;
|
|
15
|
+
/**
|
|
16
|
+
* The phases of an upgrader run, in order (`platform_update_events.phase`).
|
|
17
|
+
* `rollback` only appears when a roll had to be undone.
|
|
18
|
+
*/
|
|
19
|
+
export declare const PLATFORM_UPDATE_PHASES: readonly ["queued", "start", "verify", "assess", "backup", "health-baseline", "migrations", "roll", "health", "rollback", "record", "self-update", "finish"];
|
|
20
|
+
export type PlatformUpdatePhase = (typeof PLATFORM_UPDATE_PHASES)[number];
|
|
21
|
+
/** Severity of one timeline line. */
|
|
22
|
+
export declare const PLATFORM_UPDATE_EVENT_LEVELS: readonly ["info", "success", "warn", "error"];
|
|
23
|
+
export type PlatformUpdateEventLevel = (typeof PLATFORM_UPDATE_EVENT_LEVELS)[number];
|
|
24
|
+
/** Who started a request: the Owner's click, or the Phase 5 scheduler. */
|
|
25
|
+
export declare const PLATFORM_UPDATE_TRIGGERS: readonly ["manual", "auto"];
|
|
26
|
+
export type PlatformUpdateTrigger = (typeof PLATFORM_UPDATE_TRIGGERS)[number];
|
|
27
|
+
/**
|
|
28
|
+
* A run still `running` this long after it started died (the upgrader job's
|
|
29
|
+
* task timeout is 60 minutes). The next job run, and the next install
|
|
30
|
+
* request, end it as failed — so a crashed run never blocks updates.
|
|
31
|
+
*/
|
|
32
|
+
export declare const PLATFORM_UPDATE_STALE_MINUTES = 90;
|
|
33
|
+
/**
|
|
34
|
+
* Why a stale run was ended (shown on its timeline). Provider-neutral: the
|
|
35
|
+
* same text ends a dead Google Cloud job run and a dead self-hosted agent
|
|
36
|
+
* run, and Settings → Updates shows each install its own way to upgrade by
|
|
37
|
+
* hand (Cloud Shell there, the upgrade command on the server here).
|
|
38
|
+
*/
|
|
39
|
+
export declare const PLATFORM_UPDATE_STALE_REASON = "The upgrader stopped before it finished (its run timed out or crashed). The previous release may still serve, or the new one may be partly rolled out: open the site, and if it misbehaves run the upgrade by hand once \u2014 Settings \u2192 Updates shows how for this install.";
|
|
40
|
+
/** Longest an event message may be (DB CHECK). */
|
|
41
|
+
export declare const PLATFORM_UPDATE_EVENT_MAX = 4000;
|
|
42
|
+
/** A SemVer release version without a leading `v` (`0.11.0`, `0.11.0-rc.1`). */
|
|
43
|
+
export declare const releaseVersionSchema: z.ZodString;
|
|
44
|
+
/** How big a step from `from` to `to` is, by SemVer position. */
|
|
45
|
+
export type UpdateKind = "major" | "minor" | "patch";
|
|
46
|
+
/**
|
|
47
|
+
* Classify the step from the installed release to a newer one.
|
|
48
|
+
*
|
|
49
|
+
* @returns null when `to` is not newer than `from` or either is not SemVer.
|
|
50
|
+
* @example updateKind("0.10.45", "0.10.46") // → "patch"
|
|
51
|
+
*/
|
|
52
|
+
export declare function updateKind(from: string, to: string): UpdateKind | null;
|
|
53
|
+
/** The automatic-update modes. */
|
|
54
|
+
export declare const UPDATE_POLICY_MODES: readonly ["off", "notify", "auto"];
|
|
55
|
+
export type UpdatePolicyMode = (typeof UPDATE_POLICY_MODES)[number];
|
|
56
|
+
/** Release channels a policy may follow (only `stable` installs automatically). */
|
|
57
|
+
export declare const UPDATE_POLICY_CHANNELS: readonly ["stable", "rc", "beta", "alpha"];
|
|
58
|
+
/** Whether `tz` is an IANA time zone this runtime knows. */
|
|
59
|
+
export declare function isKnownTimeZone(tz: string): boolean;
|
|
60
|
+
/**
|
|
61
|
+
* The Owner's automatic-update policy (`platform_update_policy`), as the
|
|
62
|
+
* ops read and write it. Major releases have no toggle: they are never
|
|
63
|
+
* installed automatically before 1.0.
|
|
64
|
+
*/
|
|
65
|
+
export declare const updatePolicySchema: z.ZodObject<{
|
|
66
|
+
mode: z.ZodEnum<{
|
|
67
|
+
auto: "auto";
|
|
68
|
+
off: "off";
|
|
69
|
+
notify: "notify";
|
|
70
|
+
}>;
|
|
71
|
+
autoSecurity: z.ZodBoolean;
|
|
72
|
+
autoPatch: z.ZodBoolean;
|
|
73
|
+
autoMinor: z.ZodBoolean;
|
|
74
|
+
channel: z.ZodEnum<{
|
|
75
|
+
stable: "stable";
|
|
76
|
+
rc: "rc";
|
|
77
|
+
beta: "beta";
|
|
78
|
+
alpha: "alpha";
|
|
79
|
+
}>;
|
|
80
|
+
windowStart: z.ZodNullable<z.ZodString>;
|
|
81
|
+
windowEnd: z.ZodNullable<z.ZodString>;
|
|
82
|
+
windowTimezone: z.ZodString;
|
|
83
|
+
soakHours: z.ZodNumber;
|
|
84
|
+
securitySoakHours: z.ZodNumber;
|
|
85
|
+
}, z.core.$strict>;
|
|
86
|
+
export type UpdatePolicy = z.infer<typeof updatePolicySchema>;
|
|
87
|
+
/** The policy plus its pause state, as stored. */
|
|
88
|
+
export interface StoredUpdatePolicy extends UpdatePolicy {
|
|
89
|
+
readonly paused: boolean;
|
|
90
|
+
readonly pausedReason: string | null;
|
|
91
|
+
readonly pausedAt: string | null;
|
|
92
|
+
/** End of the Owner's pause; null = until resumed (or not paused). */
|
|
93
|
+
readonly pausedUntil: string | null;
|
|
94
|
+
/** True when the Owner paused; false when the upgrader paused after a failure. */
|
|
95
|
+
readonly pausedByOwner: boolean;
|
|
96
|
+
readonly updatedAt: string;
|
|
97
|
+
}
|
|
98
|
+
/**
|
|
99
|
+
* Whether `at` falls inside the policy's maintenance window. A window whose
|
|
100
|
+
* end is before its start spans midnight (`22:00`–`04:00`).
|
|
101
|
+
*/
|
|
102
|
+
export declare function inMaintenanceWindow(policy: Pick<UpdatePolicy, "windowStart" | "windowEnd" | "windowTimezone">, at: Date): boolean;
|
|
103
|
+
/** What the policy needs to know about a release to decide on an automatic install. */
|
|
104
|
+
export interface AutoInstallCandidate {
|
|
105
|
+
readonly kind: UpdateKind;
|
|
106
|
+
/** From the signed manifest AND auto-installable (assessAutoInstall's `kind`). */
|
|
107
|
+
readonly security: boolean;
|
|
108
|
+
/** Manifest `migrations.contract` (or a skipped contract release). */
|
|
109
|
+
readonly contractMigrations: boolean;
|
|
110
|
+
/** The release's channel. */
|
|
111
|
+
readonly channel: string;
|
|
112
|
+
}
|
|
113
|
+
/**
|
|
114
|
+
* Whether the policy lets the upgrader install `candidate` unattended at
|
|
115
|
+
* `at` — the job's check for `trigger = 'auto'` requests (the scheduler
|
|
116
|
+
* applies the soak period before it ever queues one).
|
|
117
|
+
*
|
|
118
|
+
* @returns null when allowed, else the reason in plain words
|
|
119
|
+
*/
|
|
120
|
+
export declare function autoInstallRefusal(policy: Pick<StoredUpdatePolicy, "mode" | "autoSecurity" | "autoPatch" | "autoMinor" | "paused" | "pausedUntil" | "windowStart" | "windowEnd" | "windowTimezone">, candidate: AutoInstallCandidate, at: Date): string | null;
|
|
121
|
+
/**
|
|
122
|
+
* How long a verified Google sign-in authorizes one guarded action. Long
|
|
123
|
+
* enough to read the confirmation dialog, short enough that an unattended
|
|
124
|
+
* browser is useless soon after.
|
|
125
|
+
*/
|
|
126
|
+
export declare const STEP_UP_MAX_AGE_SECONDS = 600;
|
|
127
|
+
/** What a step-up is for (`step_up_challenges.purpose`). */
|
|
128
|
+
export declare const STEP_UP_PURPOSES: readonly ["platform_update", "update_policy", "step_up_client"];
|
|
129
|
+
export type StepUpPurpose = (typeof STEP_UP_PURPOSES)[number];
|
|
130
|
+
/**
|
|
131
|
+
* Self-hosted installs (#696 Phase 4c): the host agent (`caelo-agent`, a
|
|
132
|
+
* systemd timer on the install's host) polls for update requests this
|
|
133
|
+
* often and writes a heartbeat each time it looks.
|
|
134
|
+
*/
|
|
135
|
+
export declare const PLATFORM_UPDATE_AGENT_POLL_SECONDS = 60;
|
|
136
|
+
/**
|
|
137
|
+
* The admin offers "Install update" on a self-hosted install only while the
|
|
138
|
+
* agent's last heartbeat is younger than this (five missed polls): a request
|
|
139
|
+
* nobody picks up would just sit there.
|
|
140
|
+
*/
|
|
141
|
+
export declare const PLATFORM_UPDATE_AGENT_FRESH_SECONDS = 300;
|
|
142
|
+
/** The host agent's last check-in (`platform_update_agent`), as the admin reads it. */
|
|
143
|
+
export interface PlatformUpdateAgentStatus {
|
|
144
|
+
/** The Caelo release of the agent's own code. */
|
|
145
|
+
readonly agentVersion: string;
|
|
146
|
+
/** The host it runs on (its hostname). */
|
|
147
|
+
readonly host: string;
|
|
148
|
+
readonly lastSeenAt: string;
|
|
149
|
+
/**
|
|
150
|
+
* What would make an install fail on that host (cosign missing, Docker
|
|
151
|
+
* not reachable), in plain words; null when its preflight passed.
|
|
152
|
+
*/
|
|
153
|
+
readonly problem: string | null;
|
|
154
|
+
/** Whether {@link lastSeenAt} is within {@link PLATFORM_UPDATE_AGENT_FRESH_SECONDS}. */
|
|
155
|
+
readonly checkedInRecently: boolean;
|
|
156
|
+
}
|
|
157
|
+
/** Whether an agent last seen at `lastSeenAt` counts as running at `now`. */
|
|
158
|
+
export declare function agentCheckedInRecently(lastSeenAt: Date | string, now: Date): boolean;
|
|
159
|
+
//# sourceMappingURL=platform-updates.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"platform-updates.d.ts","sourceRoot":"","sources":["../src/platform-updates.ts"],"names":[],"mappings":"AAEA;;;;;GAKG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,4EAA4E;AAC5E,eAAO,MAAM,wBAAwB,oHAS3B,CAAC;AACX,MAAM,MAAM,yBAAyB,GAAG,CAAC,OAAO,wBAAwB,CAAC,CAAC,MAAM,CAAC,CAAC;AAElF,4EAA4E;AAC5E,eAAO,MAAM,sBAAsB,EAAE,SAAS,yBAAyB,EAA2B,CAAC;AAEnG,wCAAwC;AACxC,wBAAgB,sBAAsB,CAAC,MAAM,EAAE,yBAAyB,GAAG,OAAO,CAEjF;AAED;;;GAGG;AACH,eAAO,MAAM,sBAAsB,8JAczB,CAAC;AACX,MAAM,MAAM,mBAAmB,GAAG,CAAC,OAAO,sBAAsB,CAAC,CAAC,MAAM,CAAC,CAAC;AAE1E,qCAAqC;AACrC,eAAO,MAAM,4BAA4B,+CAAgD,CAAC;AAC1F,MAAM,MAAM,wBAAwB,GAAG,CAAC,OAAO,4BAA4B,CAAC,CAAC,MAAM,CAAC,CAAC;AAErF,0EAA0E;AAC1E,eAAO,MAAM,wBAAwB,6BAA8B,CAAC;AACpE,MAAM,MAAM,qBAAqB,GAAG,CAAC,OAAO,wBAAwB,CAAC,CAAC,MAAM,CAAC,CAAC;AAE9E;;;;GAIG;AACH,eAAO,MAAM,6BAA6B,KAAK,CAAC;AAEhD;;;;;GAKG;AACH,eAAO,MAAM,4BAA4B,uRACmO,CAA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AED,6EAA6E;AAC7E,wBAAgB,sBAAsB,CAAC,UAAU,EAAE,IAAI,GAAG,MAAM,EAAE,GAAG,EAAE,IAAI,GAAG,OAAO,CAKpF"}
|
|
@@ -0,0 +1,253 @@
|
|
|
1
|
+
// SPDX-License-Identifier: MPL-2.0
|
|
2
|
+
/**
|
|
3
|
+
* In-product Caelo updates (epic #696): the vocabulary the admin (Settings →
|
|
4
|
+
* Updates, the `platform_updates.*` ops), the upgrader job and the Phase 5
|
|
5
|
+
* scheduler share. One module so the timeline the page renders, the states
|
|
6
|
+
* the job writes and the database CHECK constraints (migration 0267) agree.
|
|
7
|
+
*/
|
|
8
|
+
import { z } from "zod";
|
|
9
|
+
/** Every state of an update request (`platform_update_requests.status`). */
|
|
10
|
+
export const PLATFORM_UPDATE_STATUSES = [
|
|
11
|
+
"pending",
|
|
12
|
+
"running",
|
|
13
|
+
"succeeded",
|
|
14
|
+
"rolled_back",
|
|
15
|
+
"failed",
|
|
16
|
+
"refused",
|
|
17
|
+
"needs_cloud_shell",
|
|
18
|
+
"cancelled",
|
|
19
|
+
];
|
|
20
|
+
/** States in which a request is still in flight (at most one at a time). */
|
|
21
|
+
export const ACTIVE_UPDATE_STATUSES = ["pending", "running"];
|
|
22
|
+
/** Whether `status` is an end state. */
|
|
23
|
+
export function isFinishedUpdateStatus(status) {
|
|
24
|
+
return !ACTIVE_UPDATE_STATUSES.includes(status);
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* The phases of an upgrader run, in order (`platform_update_events.phase`).
|
|
28
|
+
* `rollback` only appears when a roll had to be undone.
|
|
29
|
+
*/
|
|
30
|
+
export const PLATFORM_UPDATE_PHASES = [
|
|
31
|
+
"queued",
|
|
32
|
+
"start",
|
|
33
|
+
"verify",
|
|
34
|
+
"assess",
|
|
35
|
+
"backup",
|
|
36
|
+
"health-baseline",
|
|
37
|
+
"migrations",
|
|
38
|
+
"roll",
|
|
39
|
+
"health",
|
|
40
|
+
"rollback",
|
|
41
|
+
"record",
|
|
42
|
+
"self-update",
|
|
43
|
+
"finish",
|
|
44
|
+
];
|
|
45
|
+
/** Severity of one timeline line. */
|
|
46
|
+
export const PLATFORM_UPDATE_EVENT_LEVELS = ["info", "success", "warn", "error"];
|
|
47
|
+
/** Who started a request: the Owner's click, or the Phase 5 scheduler. */
|
|
48
|
+
export const PLATFORM_UPDATE_TRIGGERS = ["manual", "auto"];
|
|
49
|
+
/**
|
|
50
|
+
* A run still `running` this long after it started died (the upgrader job's
|
|
51
|
+
* task timeout is 60 minutes). The next job run, and the next install
|
|
52
|
+
* request, end it as failed — so a crashed run never blocks updates.
|
|
53
|
+
*/
|
|
54
|
+
export const PLATFORM_UPDATE_STALE_MINUTES = 90;
|
|
55
|
+
/**
|
|
56
|
+
* Why a stale run was ended (shown on its timeline). Provider-neutral: the
|
|
57
|
+
* same text ends a dead Google Cloud job run and a dead self-hosted agent
|
|
58
|
+
* run, and Settings → Updates shows each install its own way to upgrade by
|
|
59
|
+
* hand (Cloud Shell there, the upgrade command on the server here).
|
|
60
|
+
*/
|
|
61
|
+
export const PLATFORM_UPDATE_STALE_REASON = "The upgrader stopped before it finished (its run timed out or crashed). The previous release may still serve, or the new one may be partly rolled out: open the site, and if it misbehaves run the upgrade by hand once — Settings → Updates shows how for this install.";
|
|
62
|
+
/** Longest an event message may be (DB CHECK). */
|
|
63
|
+
export const PLATFORM_UPDATE_EVENT_MAX = 4000;
|
|
64
|
+
const SEMVER = /^(\d+)\.(\d+)\.(\d+)(?:-([0-9A-Za-z.-]+))?$/;
|
|
65
|
+
/** A SemVer release version without a leading `v` (`0.11.0`, `0.11.0-rc.1`). */
|
|
66
|
+
export const releaseVersionSchema = z
|
|
67
|
+
.string()
|
|
68
|
+
.regex(SEMVER, "expected a release version like 0.11.0 (no leading v)");
|
|
69
|
+
/**
|
|
70
|
+
* Classify the step from the installed release to a newer one.
|
|
71
|
+
*
|
|
72
|
+
* @returns null when `to` is not newer than `from` or either is not SemVer.
|
|
73
|
+
* @example updateKind("0.10.45", "0.10.46") // → "patch"
|
|
74
|
+
*/
|
|
75
|
+
export function updateKind(from, to) {
|
|
76
|
+
const a = SEMVER.exec(from);
|
|
77
|
+
const b = SEMVER.exec(to);
|
|
78
|
+
if (!a || !b)
|
|
79
|
+
return null;
|
|
80
|
+
const [fa, fb, fc] = [Number(a[1]), Number(a[2]), Number(a[3])];
|
|
81
|
+
const [ta, tb, tc] = [Number(b[1]), Number(b[2]), Number(b[3])];
|
|
82
|
+
if (ta !== fa)
|
|
83
|
+
return ta > fa ? "major" : null;
|
|
84
|
+
if (tb !== fb)
|
|
85
|
+
return tb > fb ? "minor" : null;
|
|
86
|
+
if (tc !== fc)
|
|
87
|
+
return tc > fc ? "patch" : null;
|
|
88
|
+
// Same X.Y.Z: a stable release over its own pre-release, or a later
|
|
89
|
+
// pre-release (rc.1 → rc.2), is a step.
|
|
90
|
+
if (a[4] === undefined)
|
|
91
|
+
return null;
|
|
92
|
+
if (b[4] === undefined)
|
|
93
|
+
return "patch";
|
|
94
|
+
return comparePrerelease(b[4], a[4]) > 0 ? "patch" : null;
|
|
95
|
+
}
|
|
96
|
+
/** SemVer §11 precedence of two pre-release identifier lists. */
|
|
97
|
+
function comparePrerelease(x, y) {
|
|
98
|
+
const xs = x.split(".");
|
|
99
|
+
const ys = y.split(".");
|
|
100
|
+
for (let i = 0; i < Math.max(xs.length, ys.length); i++) {
|
|
101
|
+
const p = xs[i];
|
|
102
|
+
const q = ys[i];
|
|
103
|
+
if (p === undefined)
|
|
104
|
+
return -1;
|
|
105
|
+
if (q === undefined)
|
|
106
|
+
return 1;
|
|
107
|
+
const pn = /^\d+$/.test(p);
|
|
108
|
+
const qn = /^\d+$/.test(q);
|
|
109
|
+
if (pn && qn && Number(p) !== Number(q))
|
|
110
|
+
return Number(p) - Number(q);
|
|
111
|
+
if (pn !== qn)
|
|
112
|
+
return pn ? -1 : 1;
|
|
113
|
+
if (p !== q)
|
|
114
|
+
return p < q ? -1 : 1;
|
|
115
|
+
}
|
|
116
|
+
return 0;
|
|
117
|
+
}
|
|
118
|
+
/** The automatic-update modes. */
|
|
119
|
+
export const UPDATE_POLICY_MODES = ["off", "notify", "auto"];
|
|
120
|
+
/** Release channels a policy may follow (only `stable` installs automatically). */
|
|
121
|
+
export const UPDATE_POLICY_CHANNELS = ["stable", "rc", "beta", "alpha"];
|
|
122
|
+
const WALL_CLOCK = /^([01]\d|2[0-3]):[0-5]\d$/;
|
|
123
|
+
/** Whether `tz` is an IANA time zone this runtime knows. */
|
|
124
|
+
export function isKnownTimeZone(tz) {
|
|
125
|
+
try {
|
|
126
|
+
new Intl.DateTimeFormat("en-US", { timeZone: tz });
|
|
127
|
+
return true;
|
|
128
|
+
}
|
|
129
|
+
catch {
|
|
130
|
+
return false;
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
/**
|
|
134
|
+
* The Owner's automatic-update policy (`platform_update_policy`), as the
|
|
135
|
+
* ops read and write it. Major releases have no toggle: they are never
|
|
136
|
+
* installed automatically before 1.0.
|
|
137
|
+
*/
|
|
138
|
+
export const updatePolicySchema = z
|
|
139
|
+
.object({
|
|
140
|
+
mode: z.enum(UPDATE_POLICY_MODES),
|
|
141
|
+
autoSecurity: z.boolean(),
|
|
142
|
+
autoPatch: z.boolean(),
|
|
143
|
+
autoMinor: z.boolean(),
|
|
144
|
+
channel: z.enum(UPDATE_POLICY_CHANNELS),
|
|
145
|
+
/** `HH:MM` local time in `windowTimezone`, or null with windowEnd null = any time. */
|
|
146
|
+
windowStart: z.string().regex(WALL_CLOCK, "expected HH:MM").nullable(),
|
|
147
|
+
windowEnd: z.string().regex(WALL_CLOCK, "expected HH:MM").nullable(),
|
|
148
|
+
windowTimezone: z.string().min(1).max(64).refine(isKnownTimeZone, "unknown time zone"),
|
|
149
|
+
/** Hours after publication before a non-security release installs automatically. */
|
|
150
|
+
soakHours: z.number().int().min(0).max(720),
|
|
151
|
+
/**
|
|
152
|
+
* The same for a release whose signed manifest names a published GitHub
|
|
153
|
+
* Security Advisory (auto-update.ts `isSecurityRelease`). Shorter by
|
|
154
|
+
* default (2 h vs 24 h): the fix is public, so every hour unpatched is
|
|
155
|
+
* exposure, while two hours still let a broken release be pulled first.
|
|
156
|
+
*/
|
|
157
|
+
securitySoakHours: z.number().int().min(0).max(720),
|
|
158
|
+
})
|
|
159
|
+
.strict()
|
|
160
|
+
.refine((p) => (p.windowStart === null) === (p.windowEnd === null), {
|
|
161
|
+
message: "set both ends of the maintenance window, or neither",
|
|
162
|
+
})
|
|
163
|
+
.refine((p) => p.mode !== "auto" || p.channel === "stable", {
|
|
164
|
+
message: "automatic installs follow the stable channel only",
|
|
165
|
+
})
|
|
166
|
+
.refine((p) => p.securitySoakHours <= p.soakHours, {
|
|
167
|
+
message: "security fixes cannot wait longer than other releases",
|
|
168
|
+
});
|
|
169
|
+
/** Minutes since local midnight of `at` in `timeZone`. */
|
|
170
|
+
function localMinutes(at, timeZone) {
|
|
171
|
+
const parts = new Intl.DateTimeFormat("en-GB", {
|
|
172
|
+
timeZone,
|
|
173
|
+
hour: "2-digit",
|
|
174
|
+
minute: "2-digit",
|
|
175
|
+
hourCycle: "h23",
|
|
176
|
+
}).formatToParts(at);
|
|
177
|
+
const n = (t) => Number(parts.find((p) => p.type === t)?.value ?? "0");
|
|
178
|
+
return n("hour") * 60 + n("minute");
|
|
179
|
+
}
|
|
180
|
+
const toMinutes = (hhmm) => Number(hhmm.slice(0, 2)) * 60 + Number(hhmm.slice(3, 5));
|
|
181
|
+
/**
|
|
182
|
+
* Whether `at` falls inside the policy's maintenance window. A window whose
|
|
183
|
+
* end is before its start spans midnight (`22:00`–`04:00`).
|
|
184
|
+
*/
|
|
185
|
+
export function inMaintenanceWindow(policy, at) {
|
|
186
|
+
if (policy.windowStart === null || policy.windowEnd === null)
|
|
187
|
+
return true;
|
|
188
|
+
const now = localMinutes(at, policy.windowTimezone);
|
|
189
|
+
const start = toMinutes(policy.windowStart);
|
|
190
|
+
const end = toMinutes(policy.windowEnd);
|
|
191
|
+
if (start === end)
|
|
192
|
+
return true;
|
|
193
|
+
return start < end ? now >= start && now < end : now >= start || now < end;
|
|
194
|
+
}
|
|
195
|
+
/**
|
|
196
|
+
* Whether the policy lets the upgrader install `candidate` unattended at
|
|
197
|
+
* `at` — the job's check for `trigger = 'auto'` requests (the scheduler
|
|
198
|
+
* applies the soak period before it ever queues one).
|
|
199
|
+
*
|
|
200
|
+
* @returns null when allowed, else the reason in plain words
|
|
201
|
+
*/
|
|
202
|
+
export function autoInstallRefusal(policy, candidate, at) {
|
|
203
|
+
if (policy.mode !== "auto")
|
|
204
|
+
return "automatic installs are switched off in the update policy";
|
|
205
|
+
// An Owner pause with an end that has passed no longer holds (the
|
|
206
|
+
// scheduler lifts it on its next tick; this keeps the job consistent).
|
|
207
|
+
if (policy.paused &&
|
|
208
|
+
(policy.pausedUntil === null || Date.parse(policy.pausedUntil) > at.getTime())) {
|
|
209
|
+
return "automatic installs are paused";
|
|
210
|
+
}
|
|
211
|
+
if (candidate.channel !== "stable")
|
|
212
|
+
return "only stable releases install automatically";
|
|
213
|
+
if (candidate.contractMigrations) {
|
|
214
|
+
return "the release carries destructive database changes; the Owner installs it by hand";
|
|
215
|
+
}
|
|
216
|
+
if (candidate.kind === "major")
|
|
217
|
+
return "major releases never install automatically";
|
|
218
|
+
const allowed = (candidate.security && policy.autoSecurity) ||
|
|
219
|
+
(candidate.kind === "patch" && policy.autoPatch) ||
|
|
220
|
+
(candidate.kind === "minor" && policy.autoMinor);
|
|
221
|
+
if (!allowed) {
|
|
222
|
+
return `the policy does not install ${candidate.security ? "security fixes or " : ""}${candidate.kind} releases automatically`;
|
|
223
|
+
}
|
|
224
|
+
if (!inMaintenanceWindow(policy, at))
|
|
225
|
+
return "outside the maintenance window";
|
|
226
|
+
return null;
|
|
227
|
+
}
|
|
228
|
+
/**
|
|
229
|
+
* How long a verified Google sign-in authorizes one guarded action. Long
|
|
230
|
+
* enough to read the confirmation dialog, short enough that an unattended
|
|
231
|
+
* browser is useless soon after.
|
|
232
|
+
*/
|
|
233
|
+
export const STEP_UP_MAX_AGE_SECONDS = 600;
|
|
234
|
+
/** What a step-up is for (`step_up_challenges.purpose`). */
|
|
235
|
+
export const STEP_UP_PURPOSES = ["platform_update", "update_policy", "step_up_client"];
|
|
236
|
+
/**
|
|
237
|
+
* Self-hosted installs (#696 Phase 4c): the host agent (`caelo-agent`, a
|
|
238
|
+
* systemd timer on the install's host) polls for update requests this
|
|
239
|
+
* often and writes a heartbeat each time it looks.
|
|
240
|
+
*/
|
|
241
|
+
export const PLATFORM_UPDATE_AGENT_POLL_SECONDS = 60;
|
|
242
|
+
/**
|
|
243
|
+
* The admin offers "Install update" on a self-hosted install only while the
|
|
244
|
+
* agent's last heartbeat is younger than this (five missed polls): a request
|
|
245
|
+
* nobody picks up would just sit there.
|
|
246
|
+
*/
|
|
247
|
+
export const PLATFORM_UPDATE_AGENT_FRESH_SECONDS = 300;
|
|
248
|
+
/** Whether an agent last seen at `lastSeenAt` counts as running at `now`. */
|
|
249
|
+
export function agentCheckedInRecently(lastSeenAt, now) {
|
|
250
|
+
const seen = new Date(lastSeenAt).getTime();
|
|
251
|
+
return (Number.isFinite(seen) && now.getTime() - seen <= PLATFORM_UPDATE_AGENT_FRESH_SECONDS * 1000);
|
|
252
|
+
}
|
|
253
|
+
//# sourceMappingURL=platform-updates.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"platform-updates.js","sourceRoot":"","sources":["../src/platform-updates.ts"],"names":[],"mappings":"AAAA,mCAAmC;AAEnC;;;;;GAKG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,4EAA4E;AAC5E,MAAM,CAAC,MAAM,wBAAwB,GAAG;IACtC,SAAS;IACT,SAAS;IACT,WAAW;IACX,aAAa;IACb,QAAQ;IACR,SAAS;IACT,mBAAmB;IACnB,WAAW;CACH,CAAC;AAGX,4EAA4E;AAC5E,MAAM,CAAC,MAAM,sBA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