@usine/engine 0.1.0 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +37 -12
- package/dist/cursor/{store.d.ts → cursor.d.ts} +9 -7
- package/dist/cursor/cursor.d.ts.map +1 -0
- package/dist/cursor/{store.js → cursor.js} +8 -7
- package/dist/cursor/cursor.js.map +1 -0
- package/dist/cycle-budget/cycle-budget.d.ts +25 -0
- package/dist/cycle-budget/cycle-budget.d.ts.map +1 -0
- package/dist/cycle-budget/cycle-budget.js +117 -0
- package/dist/cycle-budget/cycle-budget.js.map +1 -0
- package/dist/cycle-budget/model.d.ts +26 -0
- package/dist/cycle-budget/model.d.ts.map +1 -0
- package/dist/cycle-budget/model.js +20 -0
- package/dist/cycle-budget/model.js.map +1 -0
- package/dist/cycle-budget/queries.d.ts +27 -0
- package/dist/cycle-budget/queries.d.ts.map +1 -0
- package/dist/cycle-budget/queries.js +175 -0
- package/dist/cycle-budget/queries.js.map +1 -0
- package/dist/database/database.d.ts +1 -1
- package/dist/database/database.d.ts.map +1 -1
- package/dist/database/local-sqlite.d.ts +32 -12
- package/dist/database/local-sqlite.d.ts.map +1 -1
- package/dist/database/local-sqlite.js +113 -14
- package/dist/database/local-sqlite.js.map +1 -1
- package/dist/database/schema.d.ts +254 -9
- package/dist/database/schema.d.ts.map +1 -1
- package/dist/database/schema.js +65 -12
- package/dist/database/schema.js.map +1 -1
- package/dist/engine/engine.d.ts +55 -0
- package/dist/engine/engine.d.ts.map +1 -0
- package/dist/{engine.js → engine/engine.js} +44 -30
- package/dist/engine/engine.js.map +1 -0
- package/dist/engine/error.d.ts +37 -0
- package/dist/engine/error.d.ts.map +1 -0
- package/dist/engine/error.js +41 -0
- package/dist/engine/error.js.map +1 -0
- package/dist/engine/lifecycle.d.ts +112 -0
- package/dist/engine/lifecycle.d.ts.map +1 -0
- package/dist/engine/lifecycle.js +132 -0
- package/dist/engine/lifecycle.js.map +1 -0
- package/dist/engine/shutdown.d.ts +12 -0
- package/dist/engine/shutdown.d.ts.map +1 -0
- package/dist/engine/shutdown.js +10 -0
- package/dist/engine/shutdown.js.map +1 -0
- package/dist/engine/submission.d.ts +58 -0
- package/dist/engine/submission.d.ts.map +1 -0
- package/dist/engine/submission.js +54 -0
- package/dist/engine/submission.js.map +1 -0
- package/dist/item-projection/{service.d.ts → item-projection.d.ts} +6 -6
- package/dist/item-projection/item-projection.d.ts.map +1 -0
- package/dist/item-projection/{service.js → item-projection.js} +7 -5
- package/dist/item-projection/item-projection.js.map +1 -0
- package/dist/item-projection/model.d.ts +2 -5
- package/dist/item-projection/model.d.ts.map +1 -1
- package/dist/item-projection/model.js +5 -5
- package/dist/item-projection/model.js.map +1 -1
- package/dist/loop-control/loop-control.d.ts +21 -0
- package/dist/loop-control/loop-control.d.ts.map +1 -0
- package/dist/{loop-control.js → loop-control/loop-control.js} +7 -5
- package/dist/loop-control/loop-control.js.map +1 -0
- package/dist/loop-control/model.d.ts +10 -0
- package/dist/loop-control/model.d.ts.map +1 -0
- package/dist/loop-control/model.js +9 -0
- package/dist/loop-control/model.js.map +1 -0
- package/dist/repository-label-projection/model.d.ts +12 -3
- package/dist/repository-label-projection/model.d.ts.map +1 -1
- package/dist/repository-label-projection/model.js +14 -5
- package/dist/repository-label-projection/model.js.map +1 -1
- package/dist/repository-label-projection/{service.d.ts → repository-label-projection.d.ts} +5 -5
- package/dist/repository-label-projection/repository-label-projection.d.ts.map +1 -0
- package/dist/repository-label-projection/{service.js → repository-label-projection.js} +17 -7
- package/dist/repository-label-projection/repository-label-projection.js.map +1 -0
- package/dist/run-reader/model.d.ts +46 -0
- package/dist/run-reader/model.d.ts.map +1 -0
- package/dist/run-reader/model.js +44 -0
- package/dist/run-reader/model.js.map +1 -0
- package/dist/run-reader/run-reader.d.ts +29 -0
- package/dist/run-reader/run-reader.d.ts.map +1 -0
- package/dist/run-reader/run-reader.js +44 -0
- package/dist/run-reader/run-reader.js.map +1 -0
- package/dist/step-executor.d.ts +34 -12
- package/dist/step-executor.d.ts.map +1 -1
- package/dist/step-executor.js +22 -5
- package/dist/step-executor.js.map +1 -1
- package/dist/store/codec.d.ts +104 -40
- package/dist/store/codec.d.ts.map +1 -1
- package/dist/store/codec.js +66 -44
- package/dist/store/codec.js.map +1 -1
- package/dist/store/queries.d.ts +47 -15
- package/dist/store/queries.d.ts.map +1 -1
- package/dist/store/queries.js +74 -39
- package/dist/store/queries.js.map +1 -1
- package/dist/store/store.d.ts +44 -26
- package/dist/store/store.d.ts.map +1 -1
- package/dist/store/store.js +185 -127
- package/dist/store/store.js.map +1 -1
- package/dist/transcript.d.ts +64 -0
- package/dist/transcript.d.ts.map +1 -0
- package/dist/transcript.js +59 -0
- package/dist/transcript.js.map +1 -0
- package/dist/workflow/admission.d.ts +13 -0
- package/dist/workflow/admission.d.ts.map +1 -0
- package/dist/workflow/admission.js +55 -0
- package/dist/workflow/admission.js.map +1 -0
- package/dist/workflow/command.d.ts +13 -0
- package/dist/workflow/command.d.ts.map +1 -0
- package/dist/workflow/command.js +17 -0
- package/dist/workflow/command.js.map +1 -0
- package/dist/workflow/workflow.d.ts +18 -0
- package/dist/workflow/workflow.d.ts.map +1 -0
- package/dist/workflow/workflow.js +108 -0
- package/dist/workflow/workflow.js.map +1 -0
- package/drizzle/20260903091940_queued_approved_runs/migration.sql +3 -0
- package/drizzle/20260903091940_queued_approved_runs/snapshot.json +1147 -0
- package/drizzle/20260905150403_item_cycle_budgets/migration.sql +58 -0
- package/drizzle/20260905150403_item_cycle_budgets/snapshot.json +1417 -0
- package/drizzle/20260905174009_item_run_history/migration.sql +1 -0
- package/drizzle/20260905174009_item_run_history/snapshot.json +1431 -0
- package/package.json +41 -5
- package/dist/cursor/model.d.ts +0 -5
- package/dist/cursor/model.d.ts.map +0 -1
- package/dist/cursor/model.js +0 -4
- package/dist/cursor/model.js.map +0 -1
- package/dist/cursor/store.d.ts.map +0 -1
- package/dist/cursor/store.js.map +0 -1
- package/dist/engine.d.ts +0 -39
- package/dist/engine.d.ts.map +0 -1
- package/dist/engine.js.map +0 -1
- package/dist/index.d.ts +0 -20
- package/dist/index.d.ts.map +0 -1
- package/dist/index.js +0 -20
- package/dist/index.js.map +0 -1
- package/dist/item-projection/service.d.ts.map +0 -1
- package/dist/item-projection/service.js.map +0 -1
- package/dist/loop-control.d.ts +0 -16
- package/dist/loop-control.d.ts.map +0 -1
- package/dist/loop-control.js.map +0 -1
- package/dist/model.d.ts +0 -185
- package/dist/model.d.ts.map +0 -1
- package/dist/model.js +0 -174
- package/dist/model.js.map +0 -1
- package/dist/repository-label-projection/service.d.ts.map +0 -1
- package/dist/repository-label-projection/service.js.map +0 -1
- package/dist/run-reader.d.ts +0 -20
- package/dist/run-reader.d.ts.map +0 -1
- package/dist/run-reader.js +0 -19
- package/dist/run-reader.js.map +0 -1
- package/dist/workflow.d.ts +0 -14
- package/dist/workflow.d.ts.map +0 -1
- package/dist/workflow.js +0 -105
- package/dist/workflow.js.map +0 -1
package/dist/store/codec.d.ts
CHANGED
|
@@ -1,6 +1,17 @@
|
|
|
1
|
-
import { Agent
|
|
1
|
+
import { Agent } from "@usine/core/agent";
|
|
2
|
+
import { BrainSpec } from "@usine/core/agent/brain";
|
|
3
|
+
import { Attempt } from "@usine/core/attempt";
|
|
4
|
+
import * as AttemptChannel from "@usine/core/attempt/channel";
|
|
5
|
+
import { Event } from "@usine/core/event";
|
|
6
|
+
import { Run } from "@usine/core/run";
|
|
7
|
+
import { Step } from "@usine/core/step";
|
|
8
|
+
import * as RunState from "@usine/core/run/state";
|
|
9
|
+
import { StepResult } from "@usine/core/step/result";
|
|
2
10
|
import { Effect, Schema } from "effect";
|
|
3
|
-
import { RunStoreError
|
|
11
|
+
import { RunStoreError } from "../engine/error.ts";
|
|
12
|
+
import { Submission } from "../engine/submission.ts";
|
|
13
|
+
import { RunSummary } from "../run-reader/model.ts";
|
|
14
|
+
import { TranscriptEntry } from "../transcript.ts";
|
|
4
15
|
export declare const EventRouteRow: Schema.Struct<{
|
|
5
16
|
readonly eventId: Schema.brand<Schema.NonEmptyString, "EventId">;
|
|
6
17
|
readonly dedupKey: Schema.brand<Schema.NonEmptyString, "DedupKey">;
|
|
@@ -10,27 +21,29 @@ export declare const EventRouteRow: Schema.Struct<{
|
|
|
10
21
|
readonly loop: Schema.brand<Schema.NonEmptyString, "LoopName">;
|
|
11
22
|
readonly step: Schema.brand<Schema.NonEmptyString, "StepName">;
|
|
12
23
|
readonly approval: Schema.Literals<readonly ["none", "required"]>;
|
|
13
|
-
readonly
|
|
24
|
+
readonly cycleLimit: Schema.NullOr<Schema.brand<Schema.Int, "CycleLimit">>;
|
|
25
|
+
readonly cycleGeneration: Schema.brand<Schema.Int, "CycleGeneration">;
|
|
26
|
+
readonly repository: Schema.brand<Schema.String, "RepositoryName">;
|
|
14
27
|
readonly revision: Schema.brand<Schema.String, "RepositoryRevision">;
|
|
15
28
|
readonly task: Schema.brand<Schema.String, "AttemptTask">;
|
|
16
|
-
readonly agent: typeof Agent
|
|
29
|
+
readonly agent: typeof Agent;
|
|
17
30
|
readonly parentModel: Schema.NullOr<Schema.brand<Schema.String, "ModelId">>;
|
|
18
31
|
}>;
|
|
19
32
|
export type EventRouteRow = typeof EventRouteRow.Type;
|
|
20
33
|
export declare const RunRow: Schema.Struct<{
|
|
21
34
|
readonly itemKey: Schema.brand<Schema.NonEmptyString, "ItemKey">;
|
|
22
|
-
readonly repository: Schema.brand<Schema.String, "
|
|
35
|
+
readonly repository: Schema.brand<Schema.String, "RepositoryName">;
|
|
23
36
|
readonly revision: Schema.brand<Schema.String, "RepositoryRevision">;
|
|
24
37
|
readonly task: Schema.brand<Schema.String, "AttemptTask">;
|
|
25
|
-
readonly agent: typeof Agent
|
|
38
|
+
readonly agent: typeof Agent;
|
|
26
39
|
readonly parentModel: Schema.NullOr<Schema.brand<Schema.String, "ModelId">>;
|
|
27
40
|
readonly runId: Schema.brand<Schema.NonEmptyString, "RunId">;
|
|
28
41
|
readonly eventId: Schema.brand<Schema.NonEmptyString, "EventId">;
|
|
29
42
|
readonly loop: Schema.brand<Schema.NonEmptyString, "LoopName">;
|
|
30
|
-
readonly state: Schema.Union<readonly [typeof RunState.Pending, typeof RunState.Waiting, typeof RunState.Running, typeof RunState.Succeeded, typeof RunState.Failed, typeof RunState.Canceled]>;
|
|
43
|
+
readonly state: Schema.Union<readonly [typeof RunState.Pending, typeof RunState.Waiting, typeof RunState.Queued, typeof RunState.Running, typeof RunState.Succeeded, typeof RunState.Failed, typeof RunState.Canceled]>;
|
|
31
44
|
readonly openedAt: Schema.DateTimeUtcFromString;
|
|
32
45
|
readonly stepName: Schema.brand<Schema.NonEmptyString, "StepName">;
|
|
33
|
-
readonly result: Schema.NullOr<typeof StepResult
|
|
46
|
+
readonly result: Schema.NullOr<typeof StepResult>;
|
|
34
47
|
}>;
|
|
35
48
|
export type RunRow = typeof RunRow.Type;
|
|
36
49
|
export declare const AttemptRow: Schema.Struct<{
|
|
@@ -39,17 +52,31 @@ export declare const AttemptRow: Schema.Struct<{
|
|
|
39
52
|
readonly stepName: Schema.brand<Schema.NonEmptyString, "StepName">;
|
|
40
53
|
readonly worker: Schema.brand<Schema.String, "WorkerName">;
|
|
41
54
|
readonly number: Schema.brand<Schema.Int, "AttemptNumber">;
|
|
42
|
-
readonly brain: typeof
|
|
55
|
+
readonly brain: typeof BrainSpec;
|
|
43
56
|
readonly parentModel: Schema.NullOr<Schema.brand<Schema.String, "ModelId">>;
|
|
44
57
|
readonly startedAt: Schema.DateTimeUtcFromString;
|
|
45
|
-
readonly outcome: Schema.NullOr<Schema.Union<readonly [typeof
|
|
58
|
+
readonly outcome: Schema.NullOr<Schema.Union<readonly [typeof import("@usine/core/attempt/outcome").AttemptSucceeded, typeof import("@usine/core/attempt/outcome").AttemptFailed, typeof import("@usine/core/attempt/outcome").AttemptCanceled]>>;
|
|
46
59
|
}>;
|
|
47
60
|
export type AttemptRow = typeof AttemptRow.Type;
|
|
48
61
|
export declare const TranscriptRow: Schema.Struct<{
|
|
49
62
|
readonly sequence: Schema.brand<Schema.Int, "TranscriptSequence">;
|
|
50
63
|
readonly attemptId: Schema.brand<Schema.NonEmptyString, "AttemptId">;
|
|
51
64
|
readonly direction: Schema.Literals<readonly ["inbound", "outbound"]>;
|
|
52
|
-
readonly envelope: Schema.Union<readonly [typeof AttemptChannel.OutboundEnvelope, typeof AttemptChannel.InboundEnvelope]
|
|
65
|
+
readonly envelope: Schema.Union<readonly [Schema.Union<readonly [typeof AttemptChannel.OutboundEnvelope, typeof AttemptChannel.InboundEnvelope]>, Schema.Union<readonly [Schema.Struct<{
|
|
66
|
+
readonly _tag: Schema.tag<"OutboundEnvelope">;
|
|
67
|
+
readonly attemptId: Schema.brand<Schema.NonEmptyString, "AttemptId">;
|
|
68
|
+
readonly sequence: Schema.brand<Schema.Int, "AttemptChannelSequence">;
|
|
69
|
+
readonly sentAt: Schema.DateTimeUtcFromString;
|
|
70
|
+
readonly payload: Schema.Union<readonly [typeof AttemptChannel.Started, typeof AttemptChannel.SessionEvent, typeof AttemptChannel.Final, typeof AttemptChannel.Failed, typeof AttemptChannel.Interrupted]>;
|
|
71
|
+
readonly version: Schema.Literal<3>;
|
|
72
|
+
}>, Schema.Struct<{
|
|
73
|
+
readonly _tag: Schema.tag<"InboundEnvelope">;
|
|
74
|
+
readonly attemptId: Schema.brand<Schema.NonEmptyString, "AttemptId">;
|
|
75
|
+
readonly sequence: Schema.brand<Schema.Int, "AttemptChannelSequence">;
|
|
76
|
+
readonly sentAt: Schema.DateTimeUtcFromString;
|
|
77
|
+
readonly payload: Schema.Union<readonly [typeof AttemptChannel.Steer, typeof AttemptChannel.Interrupt]>;
|
|
78
|
+
readonly version: Schema.Literal<3>;
|
|
79
|
+
}>]>]>;
|
|
53
80
|
readonly receivedAt: Schema.DateTimeUtcFromString;
|
|
54
81
|
}>;
|
|
55
82
|
export type TranscriptRow = typeof TranscriptRow.Type;
|
|
@@ -67,26 +94,28 @@ export declare const decodeEventRoutes: (input: unknown, options?: import("effec
|
|
|
67
94
|
readonly loop: string & import("effect/Brand").Brand<"LoopName">;
|
|
68
95
|
readonly step: string & import("effect/Brand").Brand<"StepName">;
|
|
69
96
|
readonly approval: "none" | "required";
|
|
70
|
-
readonly
|
|
97
|
+
readonly cycleLimit: (number & import("effect/Brand").Brand<"CycleLimit">) | null;
|
|
98
|
+
readonly cycleGeneration: number & import("effect/Brand").Brand<"CycleGeneration">;
|
|
99
|
+
readonly repository: string & import("effect/Brand").Brand<"RepositoryName">;
|
|
71
100
|
readonly revision: string & import("effect/Brand").Brand<"RepositoryRevision">;
|
|
72
101
|
readonly task: string & import("effect/Brand").Brand<"AttemptTask">;
|
|
73
|
-
readonly agent: Agent
|
|
102
|
+
readonly agent: Agent;
|
|
74
103
|
readonly parentModel: (string & import("effect/Brand").Brand<"ModelId">) | null;
|
|
75
104
|
}[], Schema.SchemaError, never>;
|
|
76
105
|
export declare const decodeRunRows: (input: unknown, options?: import("effect/SchemaAST").ParseOptions) => Effect.Effect<readonly {
|
|
77
106
|
readonly itemKey: string & import("effect/Brand").Brand<"ItemKey">;
|
|
78
|
-
readonly repository: string & import("effect/Brand").Brand<"
|
|
107
|
+
readonly repository: string & import("effect/Brand").Brand<"RepositoryName">;
|
|
79
108
|
readonly revision: string & import("effect/Brand").Brand<"RepositoryRevision">;
|
|
80
109
|
readonly task: string & import("effect/Brand").Brand<"AttemptTask">;
|
|
81
|
-
readonly agent: Agent
|
|
110
|
+
readonly agent: Agent;
|
|
82
111
|
readonly parentModel: (string & import("effect/Brand").Brand<"ModelId">) | null;
|
|
83
112
|
readonly runId: string & import("effect/Brand").Brand<"RunId">;
|
|
84
113
|
readonly eventId: string & import("effect/Brand").Brand<"EventId">;
|
|
85
114
|
readonly loop: string & import("effect/Brand").Brand<"LoopName">;
|
|
86
|
-
readonly state: RunState.Canceled | RunState.Failed | RunState.Pending | RunState.Running | RunState.Succeeded | RunState.Waiting;
|
|
115
|
+
readonly state: RunState.Canceled | RunState.Failed | RunState.Pending | RunState.Queued | RunState.Running | RunState.Succeeded | RunState.Waiting;
|
|
87
116
|
readonly openedAt: import("effect/DateTime").Utc;
|
|
88
117
|
readonly stepName: string & import("effect/Brand").Brand<"StepName">;
|
|
89
|
-
readonly result: StepResult
|
|
118
|
+
readonly result: StepResult | null;
|
|
90
119
|
}[], Schema.SchemaError, never>;
|
|
91
120
|
export declare const decodeAttemptRows: (input: unknown, options?: import("effect/SchemaAST").ParseOptions) => Effect.Effect<readonly {
|
|
92
121
|
readonly attemptId: string & import("effect/Brand").Brand<"AttemptId">;
|
|
@@ -94,10 +123,10 @@ export declare const decodeAttemptRows: (input: unknown, options?: import("effec
|
|
|
94
123
|
readonly stepName: string & import("effect/Brand").Brand<"StepName">;
|
|
95
124
|
readonly worker: string & import("effect/Brand").Brand<"WorkerName">;
|
|
96
125
|
readonly number: number & import("effect/Brand").Brand<"AttemptNumber">;
|
|
97
|
-
readonly brain:
|
|
126
|
+
readonly brain: BrainSpec;
|
|
98
127
|
readonly parentModel: (string & import("effect/Brand").Brand<"ModelId">) | null;
|
|
99
128
|
readonly startedAt: import("effect/DateTime").Utc;
|
|
100
|
-
readonly outcome:
|
|
129
|
+
readonly outcome: import("@usine/core/attempt/outcome").AttemptCanceled | import("@usine/core/attempt/outcome").AttemptFailed | import("@usine/core/attempt/outcome").AttemptSucceeded | null;
|
|
101
130
|
}[], Schema.SchemaError, never>;
|
|
102
131
|
export declare const decodeRecoverableRuns: (input: unknown, options?: import("effect/SchemaAST").ParseOptions) => Effect.Effect<readonly {
|
|
103
132
|
readonly eventId: string & import("effect/Brand").Brand<"EventId">;
|
|
@@ -108,13 +137,15 @@ export declare const decodeRecoverableRuns: (input: unknown, options?: import("e
|
|
|
108
137
|
readonly loop: string & import("effect/Brand").Brand<"LoopName">;
|
|
109
138
|
readonly step: string & import("effect/Brand").Brand<"StepName">;
|
|
110
139
|
readonly approval: "none" | "required";
|
|
111
|
-
readonly
|
|
140
|
+
readonly cycleLimit: (number & import("effect/Brand").Brand<"CycleLimit">) | null;
|
|
141
|
+
readonly cycleGeneration: number & import("effect/Brand").Brand<"CycleGeneration">;
|
|
142
|
+
readonly repository: string & import("effect/Brand").Brand<"RepositoryName">;
|
|
112
143
|
readonly revision: string & import("effect/Brand").Brand<"RepositoryRevision">;
|
|
113
144
|
readonly task: string & import("effect/Brand").Brand<"AttemptTask">;
|
|
114
|
-
readonly agent: Agent
|
|
145
|
+
readonly agent: Agent;
|
|
115
146
|
readonly parentModel: (string & import("effect/Brand").Brand<"ModelId">) | null;
|
|
116
147
|
readonly runId: string & import("effect/Brand").Brand<"RunId">;
|
|
117
|
-
readonly state: RunState.Canceled | RunState.Failed | RunState.Pending | RunState.Running | RunState.Succeeded | RunState.Waiting;
|
|
148
|
+
readonly state: RunState.Canceled | RunState.Failed | RunState.Pending | RunState.Queued | RunState.Running | RunState.Succeeded | RunState.Waiting;
|
|
118
149
|
}[], Schema.SchemaError, never>;
|
|
119
150
|
export declare const decodeRunIds: (input: unknown, options?: import("effect/SchemaAST").ParseOptions) => Effect.Effect<readonly {
|
|
120
151
|
readonly runId: string & import("effect/Brand").Brand<"RunId">;
|
|
@@ -133,19 +164,35 @@ export declare const decodeTranscriptRows: (input: unknown, options?: import("ef
|
|
|
133
164
|
readonly sequence: number & import("effect/Brand").Brand<"TranscriptSequence">;
|
|
134
165
|
readonly attemptId: string & import("effect/Brand").Brand<"AttemptId">;
|
|
135
166
|
readonly direction: "inbound" | "outbound";
|
|
136
|
-
readonly envelope: AttemptChannel.InboundEnvelope | AttemptChannel.OutboundEnvelope
|
|
167
|
+
readonly envelope: AttemptChannel.InboundEnvelope | AttemptChannel.OutboundEnvelope | {
|
|
168
|
+
readonly _tag: "OutboundEnvelope";
|
|
169
|
+
readonly attemptId: string & import("effect/Brand").Brand<"AttemptId">;
|
|
170
|
+
readonly sequence: number & import("effect/Brand").Brand<"AttemptChannelSequence">;
|
|
171
|
+
readonly sentAt: import("effect/DateTime").Utc;
|
|
172
|
+
readonly payload: AttemptChannel.Failed | AttemptChannel.Final | AttemptChannel.Interrupted | AttemptChannel.SessionEvent | AttemptChannel.Started;
|
|
173
|
+
readonly version: 3;
|
|
174
|
+
} | {
|
|
175
|
+
readonly _tag: "InboundEnvelope";
|
|
176
|
+
readonly attemptId: string & import("effect/Brand").Brand<"AttemptId">;
|
|
177
|
+
readonly sequence: number & import("effect/Brand").Brand<"AttemptChannelSequence">;
|
|
178
|
+
readonly sentAt: import("effect/DateTime").Utc;
|
|
179
|
+
readonly payload: AttemptChannel.Interrupt | AttemptChannel.Steer;
|
|
180
|
+
readonly version: 3;
|
|
181
|
+
};
|
|
137
182
|
readonly receivedAt: import("effect/DateTime").Utc;
|
|
138
183
|
}[], Schema.SchemaError, never>;
|
|
139
184
|
export declare const encodePayload: (input: Schema.Json, options?: import("effect/SchemaAST").ParseOptions) => Schema.Json;
|
|
140
185
|
export declare const encodeDateTime: (input: import("effect/DateTime").Utc, options?: import("effect/SchemaAST").ParseOptions) => string;
|
|
141
|
-
export declare const encodeRunState: (input: RunState.Canceled | RunState.Failed | RunState.Pending | RunState.Running | RunState.Succeeded | RunState.Waiting, options?: import("effect/SchemaAST").ParseOptions) => {
|
|
186
|
+
export declare const encodeRunState: (input: RunState.Canceled | RunState.Failed | RunState.Pending | RunState.Queued | RunState.Running | RunState.Succeeded | RunState.Waiting, options?: import("effect/SchemaAST").ParseOptions) => {
|
|
187
|
+
readonly _tag: "Succeeded";
|
|
188
|
+
} | {
|
|
142
189
|
readonly _tag: "Pending";
|
|
143
190
|
} | {
|
|
144
191
|
readonly _tag: "Waiting";
|
|
145
192
|
} | {
|
|
146
|
-
readonly _tag: "
|
|
193
|
+
readonly _tag: "Queued";
|
|
147
194
|
} | {
|
|
148
|
-
readonly _tag: "
|
|
195
|
+
readonly _tag: "Running";
|
|
149
196
|
} | {
|
|
150
197
|
readonly _tag: "Failed";
|
|
151
198
|
} | {
|
|
@@ -159,7 +206,7 @@ export declare const encodeRunState: (input: RunState.Canceled | RunState.Failed
|
|
|
159
206
|
readonly _tag: "Revoked";
|
|
160
207
|
};
|
|
161
208
|
};
|
|
162
|
-
export declare const encodeOutcome: (input:
|
|
209
|
+
export declare const encodeOutcome: (input: import("@usine/core/attempt/outcome").AttemptCanceled | import("@usine/core/attempt/outcome").AttemptFailed | import("@usine/core/attempt/outcome").AttemptSucceeded, options?: import("effect/SchemaAST").ParseOptions) => {
|
|
163
210
|
readonly _tag: "Succeeded";
|
|
164
211
|
} | {
|
|
165
212
|
readonly _tag: "Failed";
|
|
@@ -167,17 +214,25 @@ export declare const encodeOutcome: (input: Attempt.Canceled | Attempt.Failed |
|
|
|
167
214
|
readonly _tag: "InfraFailure";
|
|
168
215
|
readonly message: string;
|
|
169
216
|
readonly cause: Schema.Json;
|
|
217
|
+
} | {
|
|
218
|
+
readonly _tag: "DefectFailure";
|
|
219
|
+
readonly message: string;
|
|
220
|
+
readonly cause: Schema.Json;
|
|
170
221
|
} | {
|
|
171
222
|
readonly _tag: "AgentFailure";
|
|
172
223
|
readonly message: string;
|
|
173
224
|
} | {
|
|
174
225
|
readonly _tag: "RunawayFailure";
|
|
175
226
|
readonly ceiling: "tokens" | "wall-clock";
|
|
227
|
+
} | {
|
|
228
|
+
readonly _tag: "ChildSessionBudgetFailure";
|
|
229
|
+
readonly maxChildren: number;
|
|
230
|
+
readonly attemptedChildren: number;
|
|
176
231
|
};
|
|
177
232
|
} | {
|
|
178
233
|
readonly _tag: "Canceled";
|
|
179
234
|
};
|
|
180
|
-
export declare const encodeStepResult: (input: StepResult
|
|
235
|
+
export declare const encodeStepResult: (input: StepResult, options?: import("effect/SchemaAST").ParseOptions) => {
|
|
181
236
|
readonly message: string;
|
|
182
237
|
readonly facts: readonly ({
|
|
183
238
|
readonly _tag: "Commit";
|
|
@@ -186,15 +241,15 @@ export declare const encodeStepResult: (input: StepResult.StepResult, options?:
|
|
|
186
241
|
} | {
|
|
187
242
|
readonly _tag: "PullRequest";
|
|
188
243
|
readonly number: number;
|
|
189
|
-
readonly url:
|
|
244
|
+
readonly url: string;
|
|
190
245
|
} | {
|
|
191
246
|
readonly _tag: "Comment";
|
|
192
|
-
readonly url:
|
|
247
|
+
readonly url: string;
|
|
193
248
|
})[];
|
|
194
249
|
};
|
|
195
250
|
export declare const encodeEnvelope: (input: AttemptChannel.InboundEnvelope | AttemptChannel.OutboundEnvelope, options?: import("effect/SchemaAST").ParseOptions) => {
|
|
196
251
|
readonly _tag: "OutboundEnvelope";
|
|
197
|
-
readonly version:
|
|
252
|
+
readonly version: 4;
|
|
198
253
|
readonly attemptId: string;
|
|
199
254
|
readonly sequence: number;
|
|
200
255
|
readonly sentAt: string;
|
|
@@ -370,10 +425,10 @@ export declare const encodeEnvelope: (input: AttemptChannel.InboundEnvelope | At
|
|
|
370
425
|
} | {
|
|
371
426
|
readonly _tag: "PullRequest";
|
|
372
427
|
readonly number: number;
|
|
373
|
-
readonly url:
|
|
428
|
+
readonly url: string;
|
|
374
429
|
} | {
|
|
375
430
|
readonly _tag: "Comment";
|
|
376
|
-
readonly url:
|
|
431
|
+
readonly url: string;
|
|
377
432
|
})[];
|
|
378
433
|
};
|
|
379
434
|
} | {
|
|
@@ -382,19 +437,27 @@ export declare const encodeEnvelope: (input: AttemptChannel.InboundEnvelope | At
|
|
|
382
437
|
readonly _tag: "InfraFailure";
|
|
383
438
|
readonly message: string;
|
|
384
439
|
readonly cause: Schema.Json;
|
|
440
|
+
} | {
|
|
441
|
+
readonly _tag: "DefectFailure";
|
|
442
|
+
readonly message: string;
|
|
443
|
+
readonly cause: Schema.Json;
|
|
385
444
|
} | {
|
|
386
445
|
readonly _tag: "AgentFailure";
|
|
387
446
|
readonly message: string;
|
|
388
447
|
} | {
|
|
389
448
|
readonly _tag: "RunawayFailure";
|
|
390
449
|
readonly ceiling: "tokens" | "wall-clock";
|
|
450
|
+
} | {
|
|
451
|
+
readonly _tag: "ChildSessionBudgetFailure";
|
|
452
|
+
readonly maxChildren: number;
|
|
453
|
+
readonly attemptedChildren: number;
|
|
391
454
|
};
|
|
392
455
|
} | {
|
|
393
456
|
readonly _tag: "Interrupted";
|
|
394
457
|
};
|
|
395
458
|
} | {
|
|
396
459
|
readonly _tag: "InboundEnvelope";
|
|
397
|
-
readonly version:
|
|
460
|
+
readonly version: 4;
|
|
398
461
|
readonly attemptId: string;
|
|
399
462
|
readonly sequence: number;
|
|
400
463
|
readonly sentAt: string;
|
|
@@ -405,7 +468,7 @@ export declare const encodeEnvelope: (input: AttemptChannel.InboundEnvelope | At
|
|
|
405
468
|
readonly _tag: "Interrupt";
|
|
406
469
|
};
|
|
407
470
|
};
|
|
408
|
-
export declare const encodeAgent: (input: Agent
|
|
471
|
+
export declare const encodeAgent: (input: Agent, options?: import("effect/SchemaAST").ParseOptions) => {
|
|
409
472
|
readonly name: string;
|
|
410
473
|
readonly brain: {
|
|
411
474
|
readonly harness: "claude" | "codex" | "pi";
|
|
@@ -413,19 +476,20 @@ export declare const encodeAgent: (input: Agent.Agent, options?: import("effect/
|
|
|
413
476
|
readonly effort: "high" | "low" | "max" | "medium" | "minimal" | "off" | "xhigh";
|
|
414
477
|
};
|
|
415
478
|
readonly parentModel: string | null;
|
|
479
|
+
readonly parentEffort?: "high" | "low" | "max" | "medium" | "minimal" | "off" | "xhigh";
|
|
416
480
|
readonly persona: string;
|
|
417
481
|
};
|
|
418
|
-
export declare const encodeBrainSpec: (input:
|
|
482
|
+
export declare const encodeBrainSpec: (input: BrainSpec, options?: import("effect/SchemaAST").ParseOptions) => {
|
|
419
483
|
readonly harness: "claude" | "codex" | "pi";
|
|
420
484
|
readonly model: string;
|
|
421
485
|
readonly effort: "high" | "low" | "max" | "medium" | "minimal" | "off" | "xhigh";
|
|
422
486
|
};
|
|
423
487
|
export declare const persistence: (operation: string) => <A, E, R>(effect: Effect.Effect<A, E, R>) => Effect.Effect<A, RunStoreError, R>;
|
|
424
|
-
export declare const eventFromRow: (row: EventRouteRow) => Event
|
|
488
|
+
export declare const eventFromRow: (row: EventRouteRow) => Event;
|
|
425
489
|
export declare const submissionFromRow: (row: EventRouteRow) => Submission;
|
|
426
|
-
export declare const runFromRow: (row: RunRow) => Run
|
|
427
|
-
export declare const stepFromRow: (row: RunRow) => Step
|
|
428
|
-
export declare const attemptFromRow: (row: AttemptRow) => Attempt
|
|
490
|
+
export declare const runFromRow: (row: RunRow) => Run;
|
|
491
|
+
export declare const stepFromRow: (row: RunRow) => Step;
|
|
492
|
+
export declare const attemptFromRow: (row: AttemptRow) => Attempt;
|
|
429
493
|
export declare const runSummaryFromRow: (row: RunRow, storedAttempts: ReadonlyArray<AttemptRow>) => RunSummary;
|
|
430
494
|
export declare const transcriptEntryFromRow: (row: TranscriptRow) => TranscriptEntry;
|
|
431
495
|
//# sourceMappingURL=codec.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"codec.d.ts","sourceRoot":"","sources":["../../src/store/codec.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"codec.d.ts","sourceRoot":"","sources":["../../src/store/codec.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAE1C,OAAO,EAAE,SAAS,EAAW,MAAM,yBAAyB,CAAC;AAC7D,OAAO,EAAE,OAAO,EAAyC,MAAM,qBAAqB,CAAC;AACrF,OAAO,KAAK,cAAc,MAAM,6BAA6B,CAAC;AAE9D,OAAO,EAAE,KAAK,EAAqB,MAAM,mBAAmB,CAAC;AAI7D,OAAO,EAAS,GAAG,EAAE,MAAM,iBAAiB,CAAC;AAC7C,OAAO,EAAY,IAAI,EAAE,MAAM,kBAAkB,CAAC;AAElD,OAAO,KAAK,QAAQ,MAAM,uBAAuB,CAAC;AAClD,OAAO,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AACrD,OAAO,EAAE,MAAM,EAAU,MAAM,EAAE,MAAM,QAAQ,CAAC;AAChD,OAAO,EAA0B,aAAa,EAAE,MAAM,oBA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G,eAOxD,CAAC"}
|
package/dist/store/codec.js
CHANGED
|
@@ -1,63 +1,83 @@
|
|
|
1
|
-
import { Agent
|
|
1
|
+
import { Agent } from "@usine/core/agent";
|
|
2
|
+
import { CycleGeneration, CycleLimit } from "@usine/core/cycle-budget";
|
|
3
|
+
import { BrainSpec, ModelId } from "@usine/core/agent/brain";
|
|
4
|
+
import { Attempt, AttemptNumber, AttemptTask, AttemptId } from "@usine/core/attempt";
|
|
5
|
+
import * as AttemptChannel from "@usine/core/attempt/channel";
|
|
6
|
+
import { AttemptOutcome } from "@usine/core/attempt/outcome";
|
|
7
|
+
import { Event, DedupKey, EventId } from "@usine/core/event";
|
|
8
|
+
import { ApprovalRequirement, LoopName } from "@usine/core/loop";
|
|
9
|
+
import { ItemKey } from "@usine/core/item";
|
|
10
|
+
import { RepositoryName, RepositoryRevision } from "@usine/core/repository";
|
|
11
|
+
import { RunId, Run } from "@usine/core/run";
|
|
12
|
+
import { StepName, Step } from "@usine/core/step";
|
|
13
|
+
import { WorkerName } from "@usine/core/worker";
|
|
14
|
+
import * as RunState from "@usine/core/run/state";
|
|
15
|
+
import { StepResult } from "@usine/core/step/result";
|
|
2
16
|
import { Effect, Option, Schema } from "effect";
|
|
3
|
-
import {
|
|
17
|
+
import { EnginePersistenceError, RunStoreError } from "../engine/error.js";
|
|
18
|
+
import { IgnoreReason, Submission } from "../engine/submission.js";
|
|
19
|
+
import { ProjectionRevision, RunSummary } from "../run-reader/model.js";
|
|
20
|
+
import { TranscriptEntry, TranscriptSequence } from "../transcript.js";
|
|
21
|
+
import { WorkflowCommand } from "../workflow/command.js";
|
|
4
22
|
export const EventRouteRow = Schema.Struct({
|
|
5
|
-
eventId:
|
|
6
|
-
dedupKey:
|
|
23
|
+
eventId: EventId,
|
|
24
|
+
dedupKey: DedupKey,
|
|
7
25
|
payload: Schema.Json,
|
|
8
26
|
receivedAt: Schema.DateTimeUtcFromString,
|
|
9
|
-
itemKey:
|
|
10
|
-
loop:
|
|
11
|
-
step:
|
|
27
|
+
itemKey: ItemKey,
|
|
28
|
+
loop: LoopName,
|
|
29
|
+
step: StepName,
|
|
12
30
|
approval: ApprovalRequirement,
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
31
|
+
cycleLimit: Schema.NullOr(CycleLimit),
|
|
32
|
+
cycleGeneration: CycleGeneration,
|
|
33
|
+
repository: RepositoryName,
|
|
34
|
+
revision: RepositoryRevision,
|
|
35
|
+
task: AttemptTask,
|
|
36
|
+
agent: Agent,
|
|
37
|
+
parentModel: Schema.NullOr(ModelId),
|
|
18
38
|
});
|
|
19
39
|
export const RunRow = Schema.Struct({
|
|
20
|
-
itemKey:
|
|
21
|
-
repository:
|
|
22
|
-
revision:
|
|
23
|
-
task:
|
|
24
|
-
agent: Agent
|
|
25
|
-
parentModel: Schema.NullOr(
|
|
26
|
-
runId:
|
|
27
|
-
eventId:
|
|
28
|
-
loop:
|
|
40
|
+
itemKey: ItemKey,
|
|
41
|
+
repository: RepositoryName,
|
|
42
|
+
revision: RepositoryRevision,
|
|
43
|
+
task: AttemptTask,
|
|
44
|
+
agent: Agent,
|
|
45
|
+
parentModel: Schema.NullOr(ModelId),
|
|
46
|
+
runId: RunId,
|
|
47
|
+
eventId: EventId,
|
|
48
|
+
loop: LoopName,
|
|
29
49
|
state: RunState.RunState,
|
|
30
50
|
openedAt: Schema.DateTimeUtcFromString,
|
|
31
|
-
stepName:
|
|
32
|
-
result: Schema.NullOr(StepResult
|
|
51
|
+
stepName: StepName,
|
|
52
|
+
result: Schema.NullOr(StepResult),
|
|
33
53
|
});
|
|
34
54
|
export const AttemptRow = Schema.Struct({
|
|
35
|
-
attemptId:
|
|
36
|
-
runId:
|
|
37
|
-
stepName:
|
|
38
|
-
worker:
|
|
39
|
-
number:
|
|
40
|
-
brain:
|
|
41
|
-
parentModel: Schema.NullOr(
|
|
55
|
+
attemptId: AttemptId,
|
|
56
|
+
runId: RunId,
|
|
57
|
+
stepName: StepName,
|
|
58
|
+
worker: WorkerName,
|
|
59
|
+
number: AttemptNumber,
|
|
60
|
+
brain: BrainSpec,
|
|
61
|
+
parentModel: Schema.NullOr(ModelId),
|
|
42
62
|
startedAt: Schema.DateTimeUtcFromString,
|
|
43
|
-
outcome: Schema.NullOr(
|
|
63
|
+
outcome: Schema.NullOr(AttemptOutcome),
|
|
44
64
|
});
|
|
45
65
|
export const TranscriptRow = Schema.Struct({
|
|
46
66
|
sequence: TranscriptSequence,
|
|
47
|
-
attemptId:
|
|
67
|
+
attemptId: AttemptId,
|
|
48
68
|
direction: AttemptChannel.Direction,
|
|
49
|
-
envelope:
|
|
69
|
+
envelope: TranscriptEntry.fields.envelope,
|
|
50
70
|
receivedAt: Schema.DateTimeUtcFromString,
|
|
51
71
|
});
|
|
52
72
|
const RecoverableRunRow = Schema.Struct({
|
|
53
73
|
...EventRouteRow.fields,
|
|
54
|
-
runId:
|
|
74
|
+
runId: RunId,
|
|
55
75
|
state: RunState.RunState,
|
|
56
76
|
});
|
|
57
|
-
const RunIdRow = Schema.Struct({ runId:
|
|
77
|
+
const RunIdRow = Schema.Struct({ runId: RunId });
|
|
58
78
|
const DiscardRow = Schema.Struct({ reason: IgnoreReason });
|
|
59
79
|
export const WorkflowCommandRow = Schema.Struct({
|
|
60
|
-
runId:
|
|
80
|
+
runId: RunId,
|
|
61
81
|
command: WorkflowCommand,
|
|
62
82
|
});
|
|
63
83
|
const ProjectionRevisionRow = Schema.Struct({ revision: ProjectionRevision });
|
|
@@ -73,14 +93,14 @@ export const decodeTranscriptRows = Schema.decodeUnknownEffect(Schema.Array(Tran
|
|
|
73
93
|
export const encodePayload = Schema.encodeSync(Schema.Json);
|
|
74
94
|
export const encodeDateTime = Schema.encodeSync(Schema.DateTimeUtcFromString);
|
|
75
95
|
export const encodeRunState = Schema.encodeSync(RunState.RunState);
|
|
76
|
-
export const encodeOutcome = Schema.encodeSync(
|
|
77
|
-
export const encodeStepResult = Schema.encodeSync(StepResult
|
|
96
|
+
export const encodeOutcome = Schema.encodeSync(AttemptOutcome);
|
|
97
|
+
export const encodeStepResult = Schema.encodeSync(StepResult);
|
|
78
98
|
export const encodeEnvelope = Schema.encodeSync(AttemptChannel.Envelope);
|
|
79
|
-
export const encodeAgent = Schema.encodeSync(Agent
|
|
80
|
-
export const encodeBrainSpec = Schema.encodeSync(
|
|
99
|
+
export const encodeAgent = Schema.encodeSync(Agent);
|
|
100
|
+
export const encodeBrainSpec = Schema.encodeSync(BrainSpec);
|
|
81
101
|
const isRunStoreError = Schema.is(RunStoreError);
|
|
82
102
|
export const persistence = (operation) => (effect) => Effect.mapError(effect, (error) => isRunStoreError(error) ? error : new EnginePersistenceError({ operation, cause: error }));
|
|
83
|
-
export const eventFromRow = (row) => new Event
|
|
103
|
+
export const eventFromRow = (row) => new Event({
|
|
84
104
|
id: row.eventId,
|
|
85
105
|
dedupKey: row.dedupKey,
|
|
86
106
|
payload: row.payload,
|
|
@@ -92,25 +112,27 @@ export const submissionFromRow = (row) => new Submission({
|
|
|
92
112
|
loop: row.loop,
|
|
93
113
|
step: row.step,
|
|
94
114
|
approval: row.approval,
|
|
115
|
+
cycleLimit: Option.fromNullishOr(row.cycleLimit),
|
|
116
|
+
cycleGeneration: row.cycleGeneration,
|
|
95
117
|
repository: row.repository,
|
|
96
118
|
revision: row.revision,
|
|
97
119
|
task: row.task,
|
|
98
120
|
agent: row.agent,
|
|
99
121
|
parentModel: Option.fromNullishOr(row.parentModel),
|
|
100
122
|
});
|
|
101
|
-
export const runFromRow = (row) => new Run
|
|
123
|
+
export const runFromRow = (row) => new Run({
|
|
102
124
|
id: row.runId,
|
|
103
125
|
eventId: row.eventId,
|
|
104
126
|
loop: row.loop,
|
|
105
127
|
state: row.state,
|
|
106
128
|
openedAt: row.openedAt,
|
|
107
129
|
});
|
|
108
|
-
export const stepFromRow = (row) => new Step
|
|
130
|
+
export const stepFromRow = (row) => new Step({
|
|
109
131
|
runId: row.runId,
|
|
110
132
|
name: row.stepName,
|
|
111
133
|
result: Option.fromNullishOr(row.result),
|
|
112
134
|
});
|
|
113
|
-
export const attemptFromRow = (row) => new Attempt
|
|
135
|
+
export const attemptFromRow = (row) => new Attempt({
|
|
114
136
|
id: row.attemptId,
|
|
115
137
|
runId: row.runId,
|
|
116
138
|
stepName: row.stepName,
|
package/dist/store/codec.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"codec.js","sourceRoot":"","sources":["../../src/store/codec.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"codec.js","sourceRoot":"","sources":["../../src/store/codec.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAC1C,OAAO,EAAE,eAAe,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AACvE,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,yBAAyB,CAAC;AAC7D,OAAO,EAAE,OAAO,EAAE,aAAa,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AACrF,OAAO,KAAK,cAAc,MAAM,6BAA6B,CAAC;AAC9D,OAAO,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAC;AAC7D,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAC7D,OAAO,EAAE,mBAAmB,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AACjE,OAAO,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAC3C,OAAO,EAAE,cAAc,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAC;AAC5E,OAAO,EAAE,KAAK,EAAE,GAAG,EAAE,MAAM,iBAAiB,CAAC;AAC7C,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAChD,OAAO,KAAK,QAAQ,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