Adopts the round's main features into the v2 architecture: the #9023 media rework (streamed videos, media-file assets, protocol-relative links), #9098 shared live-activity row folded into the v2 working and thinking rows, the #9084/#9078 Claude model catalog for v2 consumers, a native #9005 OpenCode child-session abort in the v2 adapter, #9013's landed LegendList patch, and per-environment sidebar provider entries. For #8600 the server-side pieces land, but auto-settle evaluation stays client-side (reading the new server-owned settings) until the v2 orchestrator grows its own settlement reactor; main's v1-only reactor and coalescer additions are dropped with the rest of the v1 path.
Showing the changes to apps/server/src/persistence (2 of 47 files). Show all
Unified · Split
| @@ -647,16 +647,17 @@ const makeEventStore = Effect.gen(function* () { · 646 unmodified lines | |||
| 647 | const findEventAfter = SqlSchema.findOneOption({ | 647 | const findEventAfter = SqlSchema.findOneOption({ |
| 648 | Request: HasEventAfterRequestSchema, | 648 | Request: HasEventAfterRequestSchema, |
| 649 | Result: Schema.Struct({ sequence: Schema.Number }), | 649 | Result: Schema.Struct({ sequence: Schema.Number }), |
| 650 | execute: (request) => | 650 | execute: (request) => sql` |
| 651 | sql` | 651 | SELECT sequence |
| 652 | SELECT sequence | 652 | FROM orchestration_events |
| 653 | FROM orchestration_events | 653 | WHERE aggregate_kind = ${request.aggregateKind} |
| 654 | WHERE aggregate_kind = ${request.aggregateKind} | 654 | AND stream_id = ${request.aggregateId} |
| 655 | AND stream_id = ${request.aggregateId} | 655 | AND ${sql.and([ |
| 656 | AND event_type = ${request.type} | 656 | sql`sequence > ${request.sequenceExclusive}`, |
| 657 | AND sequence > ${request.sequenceExclusive} | 657 | ...(request.type === undefined ? [] : [sql`event_type = ${request.type}`]), |
| 658 | LIMIT 1 | 658 | ])} |
| 659 | `, | 659 | LIMIT 1 |
| 660 | `, | ||
| 660 | }); | 661 | }); |
| 661 | 662 | ||
| 662 | const hasEventAfter: OrchestrationEventStoreShape["hasEventAfter"] = (input) => | 663 | const hasEventAfter: OrchestrationEventStoreShape["hasEventAfter"] = (input) => |
| @@ -123,7 +123,8 @@ export interface OrchestrationEventStoreShape { · 122 unmodified lines | |||
| 123 | readonly afterSequence?: number; | 123 | readonly afterSequence?: number; |
| 124 | }) => Stream.Stream<ApplicationStoredEvent, OrchestrationEventStoreError>; | 124 | }) => Stream.Stream<ApplicationStoredEvent, OrchestrationEventStoreError>; |
| 125 | /** | 125 | /** |
| 126 | * Check whether an aggregate has an event of the given type after a sequence. | 126 | * Check whether an aggregate has an event after a sequence, optionally |
| 127 | * restricted to one event type. | ||
| 127 | * | 128 | * |
| 128 | * Used during replay to tell whether a later event supersedes the one being | 129 | * Used during replay to tell whether a later event supersedes the one being |
| 129 | * applied, without streaming the rest of the log. | 130 | * applied, without streaming the rest of the log. |
| @@ -131,7 +132,7 @@ export interface OrchestrationEventStoreShape { · 1 unmodified line | |||
| 131 | readonly hasEventAfter: (input: { | 132 | readonly hasEventAfter: (input: { |
| 132 | readonly aggregateKind: OrchestrationEvent["aggregateKind"]; | 133 | readonly aggregateKind: OrchestrationEvent["aggregateKind"]; |
| 133 | readonly aggregateId: string; | 134 | readonly aggregateId: string; |
| 134 | readonly type: OrchestrationEvent["type"]; | 135 | readonly type?: OrchestrationEvent["type"]; |
| 135 | readonly sequenceExclusive: number; | 136 | readonly sequenceExclusive: number; |
| 136 | }) => Effect.Effect<boolean, OrchestrationEventStoreError>; | 137 | }) => Effect.Effect<boolean, OrchestrationEventStoreError>; |
| 137 | } | 138 | } |