@usine/executor 0.3.0 → 0.4.1-next.240.g158c84b

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 (185) hide show
  1. package/LICENSE +661 -21
  2. package/README.md +116 -19
  3. package/dist/child-command.d.ts +1 -1
  4. package/dist/child-command.d.ts.map +1 -1
  5. package/dist/child-command.js +6 -4
  6. package/dist/child-command.js.map +1 -1
  7. package/dist/child-environment.d.ts +19 -0
  8. package/dist/child-environment.d.ts.map +1 -0
  9. package/dist/child-environment.js +18 -0
  10. package/dist/child-environment.js.map +1 -0
  11. package/dist/claude-login-lock.d.ts +3 -2
  12. package/dist/claude-login-lock.d.ts.map +1 -1
  13. package/dist/claude-login-lock.js +10 -4
  14. package/dist/claude-login-lock.js.map +1 -1
  15. package/dist/cloudflare/client.d.ts +50 -0
  16. package/dist/cloudflare/client.d.ts.map +1 -0
  17. package/dist/cloudflare/client.js +108 -0
  18. package/dist/cloudflare/client.js.map +1 -0
  19. package/dist/cloudflare/cloudflare.d.ts +17 -0
  20. package/dist/cloudflare/cloudflare.d.ts.map +1 -0
  21. package/dist/cloudflare/cloudflare.js +704 -0
  22. package/dist/cloudflare/cloudflare.js.map +1 -0
  23. package/dist/cloudflare/model.d.ts +42 -0
  24. package/dist/cloudflare/model.d.ts.map +1 -0
  25. package/dist/cloudflare/model.js +2 -0
  26. package/dist/cloudflare/model.js.map +1 -0
  27. package/dist/cloudflare/shell/environment.d.ts +12 -0
  28. package/dist/cloudflare/shell/environment.d.ts.map +1 -0
  29. package/dist/cloudflare/shell/environment.js +12 -0
  30. package/dist/cloudflare/shell/environment.js.map +1 -0
  31. package/dist/cloudflare/shell/shell.d.ts +2 -0
  32. package/dist/cloudflare/shell/shell.d.ts.map +1 -0
  33. package/dist/cloudflare/shell/shell.js +155 -0
  34. package/dist/cloudflare/shell/shell.js.map +1 -0
  35. package/dist/durable-session.d.ts +21 -3
  36. package/dist/durable-session.d.ts.map +1 -1
  37. package/dist/durable-session.js +69 -10
  38. package/dist/durable-session.js.map +1 -1
  39. package/dist/exe-dev/commands.d.ts +1 -1
  40. package/dist/exe-dev/commands.d.ts.map +1 -1
  41. package/dist/exe-dev/exe-dev.d.ts +1 -1
  42. package/dist/exe-dev/exe-dev.d.ts.map +1 -1
  43. package/dist/exe-dev/exe-dev.js +9 -1
  44. package/dist/exe-dev/exe-dev.js.map +1 -1
  45. package/dist/exe-dev/preflight.d.ts +2 -2
  46. package/dist/exe-dev/preflight.d.ts.map +1 -1
  47. package/dist/exe-dev/preflight.js +5 -4
  48. package/dist/exe-dev/preflight.js.map +1 -1
  49. package/dist/executor.d.ts +164 -15
  50. package/dist/executor.d.ts.map +1 -1
  51. package/dist/executor.js +100 -3
  52. package/dist/executor.js.map +1 -1
  53. package/dist/guard.d.ts.map +1 -1
  54. package/dist/guard.js +1 -0
  55. package/dist/guard.js.map +1 -1
  56. package/dist/harness-preflight.d.ts +9 -8
  57. package/dist/harness-preflight.d.ts.map +1 -1
  58. package/dist/harness-preflight.js +15 -10
  59. package/dist/harness-preflight.js.map +1 -1
  60. package/dist/local/local.d.ts +1 -1
  61. package/dist/local/local.d.ts.map +1 -1
  62. package/dist/local/local.js +76 -37
  63. package/dist/local/local.js.map +1 -1
  64. package/dist/memory-preflight.d.ts +3 -1
  65. package/dist/memory-preflight.d.ts.map +1 -1
  66. package/dist/memory-preflight.js +1 -1
  67. package/dist/memory-preflight.js.map +1 -1
  68. package/dist/pre-push-hook.d.ts +1 -1
  69. package/dist/pre-push-hook.js +1 -1
  70. package/dist/prepared-attempt.d.ts +8 -0
  71. package/dist/prepared-attempt.d.ts.map +1 -1
  72. package/dist/prepared-attempt.js.map +1 -1
  73. package/dist/provision.d.ts +64 -13
  74. package/dist/provision.d.ts.map +1 -1
  75. package/dist/provision.js +99 -42
  76. package/dist/provision.js.map +1 -1
  77. package/dist/remote/commands.d.ts +1 -1
  78. package/dist/remote/commands.d.ts.map +1 -1
  79. package/dist/remote/commands.js +1 -1
  80. package/dist/remote/commands.js.map +1 -1
  81. package/dist/remote/container.d.ts +90 -0
  82. package/dist/remote/container.d.ts.map +1 -0
  83. package/dist/remote/container.js +480 -0
  84. package/dist/remote/container.js.map +1 -0
  85. package/dist/remote/liveness.d.ts +1 -1
  86. package/dist/remote/liveness.d.ts.map +1 -1
  87. package/dist/remote/liveness.js +6 -4
  88. package/dist/remote/liveness.js.map +1 -1
  89. package/dist/remote/machine.d.ts +52 -6
  90. package/dist/remote/machine.d.ts.map +1 -1
  91. package/dist/remote/remote.d.ts +11 -7
  92. package/dist/remote/remote.d.ts.map +1 -1
  93. package/dist/remote/remote.js +340 -92
  94. package/dist/remote/remote.js.map +1 -1
  95. package/dist/remote/sweep.d.ts +3 -1
  96. package/dist/remote/sweep.d.ts.map +1 -1
  97. package/dist/remote/sweep.js +2 -1
  98. package/dist/remote/sweep.js.map +1 -1
  99. package/dist/salvage.d.ts +18 -10
  100. package/dist/salvage.d.ts.map +1 -1
  101. package/dist/salvage.js +123 -29
  102. package/dist/salvage.js.map +1 -1
  103. package/dist/ssh/api-keys.d.ts +36 -0
  104. package/dist/ssh/api-keys.d.ts.map +1 -0
  105. package/dist/ssh/api-keys.js +72 -0
  106. package/dist/ssh/api-keys.js.map +1 -0
  107. package/dist/ssh/codex-homes.d.ts +21 -0
  108. package/dist/ssh/codex-homes.d.ts.map +1 -0
  109. package/dist/ssh/codex-homes.js +78 -0
  110. package/dist/ssh/codex-homes.js.map +1 -0
  111. package/dist/ssh/container.d.ts +32 -0
  112. package/dist/ssh/container.d.ts.map +1 -0
  113. package/dist/ssh/container.js +282 -0
  114. package/dist/ssh/container.js.map +1 -0
  115. package/dist/ssh/credentials.d.ts +3 -0
  116. package/dist/ssh/credentials.d.ts.map +1 -1
  117. package/dist/ssh/credentials.js +3 -0
  118. package/dist/ssh/credentials.js.map +1 -1
  119. package/dist/ssh/gateway/admin.d.ts +1 -1
  120. package/dist/ssh/gateway/admin.d.ts.map +1 -1
  121. package/dist/ssh/gateway/admin.js +2 -2
  122. package/dist/ssh/gateway/admin.js.map +1 -1
  123. package/dist/ssh/gateway/attachments.d.ts +15 -6
  124. package/dist/ssh/gateway/attachments.d.ts.map +1 -1
  125. package/dist/ssh/gateway/attachments.js +39 -25
  126. package/dist/ssh/gateway/attachments.js.map +1 -1
  127. package/dist/ssh/gateway/environment.d.ts +21 -2
  128. package/dist/ssh/gateway/environment.d.ts.map +1 -1
  129. package/dist/ssh/gateway/environment.js +76 -6
  130. package/dist/ssh/gateway/environment.js.map +1 -1
  131. package/dist/ssh/gateway/forward.d.ts +1 -1
  132. package/dist/ssh/gateway/forward.d.ts.map +1 -1
  133. package/dist/ssh/gateway/forward.js +1 -1
  134. package/dist/ssh/gateway/forward.js.map +1 -1
  135. package/dist/ssh/gateway/preflight.d.ts +51 -12
  136. package/dist/ssh/gateway/preflight.d.ts.map +1 -1
  137. package/dist/ssh/gateway/preflight.js +155 -69
  138. package/dist/ssh/gateway/preflight.js.map +1 -1
  139. package/dist/ssh/limits.d.ts +60 -0
  140. package/dist/ssh/limits.d.ts.map +1 -0
  141. package/dist/ssh/limits.js +84 -0
  142. package/dist/ssh/limits.js.map +1 -0
  143. package/dist/ssh/model.d.ts +97 -9
  144. package/dist/ssh/model.d.ts.map +1 -1
  145. package/dist/ssh/preflight.d.ts +26 -7
  146. package/dist/ssh/preflight.d.ts.map +1 -1
  147. package/dist/ssh/preflight.js +50 -10
  148. package/dist/ssh/preflight.js.map +1 -1
  149. package/dist/ssh/provisioner/boat.d.ts +33 -0
  150. package/dist/ssh/provisioner/boat.d.ts.map +1 -0
  151. package/dist/ssh/provisioner/boat.js +247 -0
  152. package/dist/ssh/provisioner/boat.js.map +1 -0
  153. package/dist/ssh/provisioner/hetzner.d.ts +32 -0
  154. package/dist/ssh/provisioner/hetzner.d.ts.map +1 -0
  155. package/dist/ssh/provisioner/hetzner.js +337 -0
  156. package/dist/ssh/provisioner/hetzner.js.map +1 -0
  157. package/dist/ssh/provisioner/host-key.d.ts +11 -0
  158. package/dist/ssh/provisioner/host-key.d.ts.map +1 -0
  159. package/dist/ssh/provisioner/host-key.js +57 -0
  160. package/dist/ssh/provisioner/host-key.js.map +1 -0
  161. package/dist/ssh/provisioner/http.d.ts +45 -0
  162. package/dist/ssh/provisioner/http.d.ts.map +1 -0
  163. package/dist/ssh/provisioner/http.js +72 -0
  164. package/dist/ssh/provisioner/http.js.map +1 -0
  165. package/dist/ssh/provisioner/machines.d.ts +48 -0
  166. package/dist/ssh/provisioner/machines.d.ts.map +1 -0
  167. package/dist/ssh/provisioner/machines.js +686 -0
  168. package/dist/ssh/provisioner/machines.js.map +1 -0
  169. package/dist/ssh/provisioner/model.d.ts +92 -0
  170. package/dist/ssh/provisioner/model.d.ts.map +1 -0
  171. package/dist/ssh/provisioner/model.js +37 -0
  172. package/dist/ssh/provisioner/model.js.map +1 -0
  173. package/dist/ssh/ssh.d.ts +14 -11
  174. package/dist/ssh/ssh.d.ts.map +1 -1
  175. package/dist/ssh/ssh.js +94 -27
  176. package/dist/ssh/ssh.js.map +1 -1
  177. package/dist/ssh/worker-records.d.ts +18 -0
  178. package/dist/ssh/worker-records.d.ts.map +1 -0
  179. package/dist/ssh/worker-records.js +100 -0
  180. package/dist/ssh/worker-records.js.map +1 -0
  181. package/dist/ssh/workers.d.ts +34 -7
  182. package/dist/ssh/workers.d.ts.map +1 -1
  183. package/dist/ssh/workers.js +92 -18
  184. package/dist/ssh/workers.js.map +1 -1
  185. package/package.json +19 -11
@@ -1,24 +1,41 @@
1
1
  import type { RemoteShell } from "@usine/agents/child-host";
2
2
  import type { BrainSpec, Harness } from "@usine/core/agent/brain";
3
3
  import type { AttemptId } from "@usine/core/attempt";
4
+ import type { AttemptRecovery } from "@usine/core/attempt/salvage";
4
5
  import type { LoopPermissions } from "@usine/core/loop";
5
6
  import type { RepositoryName } from "@usine/core/repository";
6
- import type { GatewayCredentialKind, WorkerKind, WorkerName } from "@usine/core/worker";
7
- import type { Effect, Option, Scope } from "effect";
8
- import type { CredentialUnavailableError, ExecutorError, ExecutorOperation } from "../executor.ts";
7
+ import type { GatewayCredentialKind, MachineId, WorkerKind, WorkerName } from "@usine/core/worker";
8
+ import type { Effect, Option, Redacted, Scope } from "effect";
9
+ import type { CredentialUnavailableError, ExecutorError, ExecutorOperation, PreflightReport } from "../executor.ts";
9
10
  import type { HarnessProbe } from "../harness-preflight.ts";
10
11
  import type { RemoteCommands } from "./commands.ts";
12
+ import type { AttemptIsolation } from "./container.ts";
13
+ /** A machine with checkouts left for reconciliation. */
14
+ interface RemoteLeftovers<M extends RemoteMachine> {
15
+ readonly machine: M;
16
+ /** The paths directly under the Worker's `attempts` directory. */
17
+ readonly checkouts: ReadonlySet<string>;
18
+ }
11
19
  export interface RemoteMachine {
12
20
  readonly shell: RemoteShell;
13
21
  /** The Worker directory on the machine, with cached clones under `repos` and checkouts under `attempts`. */
14
22
  readonly workerDirectory: string;
23
+ /** The provider's ID of a machine created for one Attempt, or `None` for a long-lived machine. */
24
+ readonly provisioned: Option.Option<MachineId>;
15
25
  }
16
26
  export interface RemoteAccess {
17
27
  /**
18
28
  * The shell for the Attempt's children, harvesting, and git commands: the machine's own, or one
19
- * that sends the Attempt's secrets through the SSH connection (`sendingShell`).
29
+ * that sends `secrets` through the SSH connection (`sendingShell`). An Attempt container gets
30
+ * `secrets` when it starts instead.
20
31
  */
21
32
  readonly shell: RemoteShell;
33
+ /** The variables with the Attempt's secrets, which never appear in a command line. */
34
+ readonly secrets: Readonly<Record<string, Redacted.Redacted<string>>>;
35
+ /** The machine directories that the Attempt's container mounts read-only, such as its credential directory. */
36
+ readonly readOnlyPaths: ReadonlyArray<string>;
37
+ /** The machine directories of the Attempt that its container mounts read-write, such as a harness's home. */
38
+ readonly writablePaths: ReadonlyArray<string>;
22
39
  /** The extra environment for the Attempt's children and harvesting commands. Values appear in the command line, so none can be secret. */
23
40
  readonly environment: Readonly<Record<string, string>>;
24
41
  /** The extra environment for the executor's git commands on the checkout. Values appear in the command line, so none can be secret. */
@@ -45,9 +62,35 @@ export interface RemoteWorker<M extends RemoteMachine> {
45
62
  readonly commands: RemoteCommands;
46
63
  /** Returns a Worker's machine. Fails with a typed error if the machine is missing or doesn't respond. */
47
64
  readonly machineFor: (worker: WorkerName) => Effect.Effect<M, ExecutorError>;
65
+ /**
66
+ * Returns the machine an Attempt runs on, if the Worker kind creates one per Attempt.
67
+ * Defaults to `machineFor`.
68
+ */
69
+ readonly attemptMachine?: (worker: WorkerName, attemptId: AttemptId) => Effect.Effect<M, ExecutorError>;
70
+ /**
71
+ * Returns the machine with `attempt`'s leftover checkout and the paths under its `attempts`
72
+ * directory, or `None` if the Attempt's machine is gone. `listed` is the Worker's machine and
73
+ * its listed checkouts, the default.
74
+ */
75
+ readonly leftovers?: (attempt: AttemptRecovery, listed: Effect.Effect<RemoteLeftovers<M>, ExecutorError>) => Effect.Effect<Option.Option<RemoteLeftovers<M>>, ExecutorError>;
76
+ /** Runs after `recover` reconciled `attempt`'s machine, with whether it succeeded. */
77
+ readonly recovered?: (attempt: AttemptRecovery, succeeded: boolean) => Effect.Effect<void>;
78
+ /**
79
+ * Records whether the machine of `attemptId` has the Attempt's checkout: from its preparation
80
+ * or a recovery that finds it, until its removal succeeds.
81
+ */
82
+ readonly checkoutHeld?: (attemptId: AttemptId, held: boolean) => Effect.Effect<void>;
48
83
  /** See `Executor.preflight`. */
49
- readonly preflight: (worker: WorkerName, brains: ReadonlyArray<BrainSpec>, maxConcurrentAttempts: number) => Effect.Effect<void, ExecutorError>;
50
- readonly harnessProbe: (machine: M) => HarnessProbe;
84
+ readonly preflight: (worker: WorkerName, brains: ReadonlyArray<BrainSpec>, maxConcurrentAttempts: number) => Effect.Effect<PreflightReport, ExecutorError>;
85
+ /** Returns the probe of a brain's binary and login through `shell`, on `machine` or in a container on it. */
86
+ readonly harnessProbe: (machine: M, shell: RemoteShell) => HarnessProbe;
87
+ /** Returns how new Attempts on `machine` run, as the Worker's last preflight found. */
88
+ readonly isolation: (machine: M) => Effect.Effect<AttemptIsolation, ExecutorError>;
89
+ /**
90
+ * Whether the Worker kind runs Attempt containers. If true, each existing checkout's container
91
+ * marker decides how a reattachment or recovery runs commands in it.
92
+ */
93
+ readonly runsContainers: boolean;
51
94
  /** Returns the URL the cached clone on `machine` fetches `repository` from. */
52
95
  readonly repositoryUrl: (machine: M, repository: RepositoryName) => string;
53
96
  /** Returns the credential kind that the Gateway on `machine` injects for `harness`. Returns `None` if the machine has no Gateway or the harness uses its own login. */
@@ -58,7 +101,10 @@ export interface RemoteWorker<M extends RemoteMachine> {
58
101
  readonly readOnlyAccessGap: Option.Option<string>;
59
102
  /** Removes leftovers of earlier processes that no Attempt can use. Runs before the Worker's checkouts are listed. */
60
103
  readonly reclaim: (worker: WorkerName) => Effect.Effect<void>;
104
+ /** See `Executor.sweep`. Defaults to removing nothing. */
105
+ readonly sweep?: Effect.Effect<void>;
61
106
  /** The timeout for the parent task's cancellation, then separately for the Attempt to finish. */
62
107
  readonly interruptGrace: Parameters<typeof Effect.timeoutOption>[1];
63
108
  }
109
+ export {};
64
110
  //# sourceMappingURL=machine.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"machine.d.ts","sourceRoot":"","sources":["../../src/remote/machine.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAC5D,OAAO,KAAK,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,yBAAyB,CAAC;AAClE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AACrD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AACxD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AAC7D,OAAO,KAAK,EAAE,qBAAqB,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AACxF,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM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,EAAE,UAAU,CAAC,OAAO,MAAM,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC,CAAC;CACrE"}
@@ -1,7 +1,9 @@
1
1
  import { ClaudeLoginLock } from "@usine/agents/runtime";
2
+ import type { AttemptId } from "@usine/core/attempt";
2
3
  import { type AttemptFailure } from "@usine/core/attempt/failure";
3
4
  import type { AttemptRecovery, RecoverySink } from "@usine/core/attempt/salvage";
4
5
  import type * as AttemptChannel from "@usine/core/attempt/channel";
6
+ import type { BotAccount, WorkerName } from "@usine/core/worker";
5
7
  import { AttemptRuntime } from "@usine/durable/attempt-runtime";
6
8
  import { Effect, Option, Scope } from "effect";
7
9
  import { CheckoutRequest, ExecutorError } from "../executor.ts";
@@ -9,16 +11,18 @@ import type { RemoteMachine, RemoteWorker } from "./machine.ts";
9
11
  /**
10
12
  * Returns the executor for Workers accessed over SSH. Each Attempt's Pi parent is a durable task
11
13
  * in this process, and each child runs on the machine as one SSH command with a pid file next
12
- * to the worktree. `worker` provides the machine, preflight, and repository access.
14
+ * to the worktree, or inside the Attempt's container. `worker` provides the machine, preflight,
15
+ * isolation, and repository access.
13
16
  */
14
17
  export declare const remoteExecutorFor: <M extends RemoteMachine>(worker: RemoteWorker<M>) => Effect.Effect<{
15
- readonly recover: <E>(attempt: AttemptRecovery, record: RecoverySink<E>) => Effect.Effect<void, E | ExecutorError>;
18
+ readonly recover: <E, A>(attempt: AttemptRecovery, record: RecoverySink<E>, commitAuthor: Effect.Effect<BotAccount, A>) => Effect.Effect<void, E | A | ExecutorError>;
16
19
  readonly kind: import("@usine/core/worker").WorkerKind;
17
- readonly isLive: (attemptId: import("@usine/core/attempt").AttemptId) => Effect.Effect<boolean, AttemptFailure>;
18
- readonly outcome: (attemptId: import("@usine/core/attempt").AttemptId) => Effect.Effect<Option.Option<import("effect/Result").Result<import("@usine/core/step/result").StepResult, AttemptFailure>>, AttemptFailure>;
19
- readonly preflight: (worker: import("@usine/core/worker").WorkerName, brains: ReadonlyArray<import("@usine/core/agent/brain").BrainSpec>, maxConcurrentAttempts: number) => Effect.Effect<void, ExecutorError>;
20
+ readonly isLive: (attemptId: AttemptId) => Effect.Effect<boolean, AttemptFailure>;
21
+ readonly outcome: (attemptId: AttemptId) => Effect.Effect<Option.Option<import("effect/Result").Result<import("@usine/core/step/result").StepResult, AttemptFailure>>, AttemptFailure>;
22
+ readonly preflight: (worker: WorkerName, brains: ReadonlyArray<import("@usine/core/agent/brain").BrainSpec>, maxConcurrentAttempts: number) => Effect.Effect<import("../executor.ts").PreflightReport, ExecutorError>;
20
23
  readonly prepare: (request: CheckoutRequest) => Effect.Effect<import("../executor.ts").PreparedAttempt, ExecutorError, Scope.Scope>;
21
- readonly cancel: (attemptId: import("@usine/core/attempt").AttemptId) => Effect.Effect<void, ExecutorError>;
22
- readonly intervene: (attemptId: import("@usine/core/attempt").AttemptId, intervention: AttemptChannel.Intervention) => Effect.Effect<void, AttemptFailure>;
24
+ readonly cancel: (attemptId: AttemptId, reason: import("@usine/core/attempt").StopReason) => Effect.Effect<void, ExecutorError>;
25
+ readonly intervene: (attemptId: AttemptId, intervention: AttemptChannel.Intervention) => Effect.Effect<void, AttemptFailure>;
26
+ readonly sweep: Effect.Effect<void>;
23
27
  }, never, AttemptRuntime | ClaudeLoginLock | Scope.Scope>;
24
28
  //# sourceMappingURL=remote.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"remote.d.ts","sourceRoot":"","sources":["../../src/remote/remote.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AACxD,OAAO,EAAE,KAAK,cAAc,EAAgB,MAAM,6BAA6B,CAAC;AAChF,OAAO,KAAK,EAAE,eAAe,EAAkB,YAAY,EAAE,MAAM,6BAA6B,CAAC;AACjG,OAAO,KAAK,KAAK,cAAc,MAAM,6BAA6B,CAAC;AAOnE,OAAO,EAAE,cAAc,EAAE,MAAM,gCAAgC,CAAC;AAChE,OAAO,EAAY,MAAM,EAAQ,MAAM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