Open History to see the last commit
1import * as Effect from "effect/Effect";
2import * as Schema from "effect/Schema";
3import { ExecutionEnvironmentDescriptor } from "./environment.ts";
4import { ServerAuthDescriptor } from "./auth.ts";
5import {
6 IsoDateTime,
7 NonNegativeInt,
8 PositiveInt,
9 ProjectId,
10 ThreadId,
11 TrimmedNonEmptyString,
12} from "./baseSchemas.ts";
13import {
14 KeybindingCommand,
15 KeybindingValue,
16 KeybindingWhen,
17 ResolvedKeybindingsConfig,
18} from "./keybindings.ts";
19import { EditorId } from "./editor.ts";
20import { ModelCapabilities } from "./model.ts";
21import { ProviderDriverKind, ProviderInstanceId } from "./providerInstance.ts";
22import { ServerSettings } from "./settings.ts";
23
24const KeybindingsMalformedConfigIssue = Schema.Struct({
25 kind: Schema.Literal("keybindings.malformed-config"),
26 message: TrimmedNonEmptyString,
27});
28
29const KeybindingsInvalidEntryIssue = Schema.Struct({
30 kind: Schema.Literal("keybindings.invalid-entry"),
31 message: TrimmedNonEmptyString,
32 index: Schema.Number,
33});
34
35export const ServerConfigIssue = Schema.Union([
36 KeybindingsMalformedConfigIssue,
37 KeybindingsInvalidEntryIssue,
38]);
39export type ServerConfigIssue = typeof ServerConfigIssue.Type;
40
41const ServerConfigIssues = Schema.Array(ServerConfigIssue);
42
43export const ServerProviderState = Schema.Literals(["ready", "warning", "error", "disabled"]);
44export type ServerProviderState = typeof ServerProviderState.Type;
45
46export const ServerProviderAuthStatus = Schema.Literals([
47 "authenticated",
48 "unauthenticated",
49 "unknown",
50]);
51export type ServerProviderAuthStatus = typeof ServerProviderAuthStatus.Type;
52
53export const ServerProviderAuth = Schema.Struct({
54 status: ServerProviderAuthStatus,
55 type: Schema.optional(TrimmedNonEmptyString),
56 label: Schema.optional(TrimmedNonEmptyString),
57 email: Schema.optional(TrimmedNonEmptyString),
58});
59export type ServerProviderAuth = typeof ServerProviderAuth.Type;
60
61export const ServerProviderModel = Schema.Struct({
62 slug: TrimmedNonEmptyString,
63 name: TrimmedNonEmptyString,
64 shortName: Schema.optional(TrimmedNonEmptyString),
65 subProvider: Schema.optional(TrimmedNonEmptyString),
66 isCustom: Schema.Boolean,
67 capabilities: Schema.NullOr(ModelCapabilities),
68});
69export type ServerProviderModel = typeof ServerProviderModel.Type;
70
71export const ServerProviderSlashCommandInput = Schema.Struct({
72 hint: TrimmedNonEmptyString,
73});
74export type ServerProviderSlashCommandInput = typeof ServerProviderSlashCommandInput.Type;
75
76export const ServerProviderSlashCommand = Schema.Struct({
77 name: TrimmedNonEmptyString,
78 description: Schema.optional(TrimmedNonEmptyString),
79 input: Schema.optional(ServerProviderSlashCommandInput),
80});
81export type ServerProviderSlashCommand = typeof ServerProviderSlashCommand.Type;
82
83export const ServerProviderSkill = Schema.Struct({
84 name: TrimmedNonEmptyString,
85 description: Schema.optional(TrimmedNonEmptyString),
86 path: TrimmedNonEmptyString,
87 scope: Schema.optional(TrimmedNonEmptyString),
88 enabled: Schema.Boolean,
89 displayName: Schema.optional(TrimmedNonEmptyString),
90 shortDescription: Schema.optional(TrimmedNonEmptyString),
91});
92export type ServerProviderSkill = typeof ServerProviderSkill.Type;
93
94/**
95 * Availability of a configured provider instance from the runtime's POV.
96 *
97 * - `available` — the build ships this driver and an instance is wired
98 * up. Default for legacy snapshots produced from the closed
99 * `ServerSettings.providers` map.
100 * - `unavailable` — the user's `ServerSettings.providerInstances` (or a
101 * persisted thread / session binding) references a driver this build
102 * doesn't ship. Common after rolling back from a fork or PR branch
103 * that introduced a new driver. The snapshot is preserved so the UI
104 * can render "missing driver" affordances and so the data round-trips
105 * when the user moves back to the fork.
106 *
107 * Snapshots with `availability: "unavailable"` MUST set
108 * `installed: false` and `enabled: false`; the runtime refuses turn
109 * starts against them with a structured error.
110 */
111export const ServerProviderAvailability = Schema.Literals(["available", "unavailable"]);
112export type ServerProviderAvailability = typeof ServerProviderAvailability.Type;
113
114export const ServerProviderContinuation = Schema.Struct({
115 groupKey: TrimmedNonEmptyString,
116});
117export type ServerProviderContinuation = typeof ServerProviderContinuation.Type;
118
119export const ServerProviderVersionAdvisoryStatus = Schema.Literals([
120 "unknown",
121 "current",
122 "behind_latest",
123]);
124export type ServerProviderVersionAdvisoryStatus = typeof ServerProviderVersionAdvisoryStatus.Type;
125
126export const ServerProviderVersionAdvisory = Schema.Struct({
127 status: ServerProviderVersionAdvisoryStatus,
128 currentVersion: Schema.NullOr(TrimmedNonEmptyString),
129 latestVersion: Schema.NullOr(TrimmedNonEmptyString),
130 updateCommand: Schema.NullOr(TrimmedNonEmptyString),
131 canUpdate: Schema.Boolean.pipe(Schema.withDecodingDefault(Effect.succeed(false))),
132 checkedAt: Schema.NullOr(IsoDateTime),
133 message: Schema.NullOr(TrimmedNonEmptyString),
134});
135export type ServerProviderVersionAdvisory = typeof ServerProviderVersionAdvisory.Type;
136
137export const ServerProviderUpdateStatus = Schema.Literals([
138 "idle",
139 "queued",
140 "running",
141 "succeeded",
142 "failed",
143 "unchanged",
144]);
145export type ServerProviderUpdateStatus = typeof ServerProviderUpdateStatus.Type;
146
147export const ServerProviderUpdateState = Schema.Struct({
148 status: ServerProviderUpdateStatus,
149 startedAt: Schema.NullOr(IsoDateTime),
150 finishedAt: Schema.NullOr(IsoDateTime),
151 message: Schema.NullOr(TrimmedNonEmptyString),
152 output: Schema.NullOr(Schema.String.check(Schema.isMaxLength(10_000))),
153});
154export type ServerProviderUpdateState = typeof ServerProviderUpdateState.Type;
155
156export const ServerProvider = Schema.Struct({
157 // Routing key for the configured instance this snapshot represents. This
158 // is the only stable identity consumers may use for provider routing.
159 instanceId: ProviderInstanceId,
160 // Open driver kind slug that selects the implementation handling this
161 // instance. It is metadata/capability context, not a routing key.
162 driver: ProviderDriverKind,
163 displayName: Schema.optional(TrimmedNonEmptyString),
164 accentColor: Schema.optional(TrimmedNonEmptyString),
165 badgeLabel: Schema.optional(TrimmedNonEmptyString),
166 continuation: Schema.optional(ServerProviderContinuation),
167 showInteractionModeToggle: Schema.optional(Schema.Boolean),
168 enabled: Schema.Boolean,
169 installed: Schema.Boolean,
170 version: Schema.NullOr(TrimmedNonEmptyString),
171 status: ServerProviderState,
172 auth: ServerProviderAuth,
173 checkedAt: IsoDateTime,
174 message: Schema.optional(TrimmedNonEmptyString),
175 // Optional for back-compat: every legacy producer omits this field and
176 // an absent value is interpreted as `"available"` by consumers (see
177 // `isProviderAvailable`). New `ProviderInstanceRegistry` outputs set it
178 // explicitly so the UI can render unavailable shadows from
179 // `ServerSettings.providerInstances`.
180 availability: Schema.optional(ServerProviderAvailability),
181 // Human-readable reason populated when `availability === "unavailable"`.
182 // Surfaces in the UI alongside the missing-driver affordance.
183 unavailableReason: Schema.optional(TrimmedNonEmptyString),
184 models: Schema.Array(ServerProviderModel),
185 slashCommands: Schema.Array(ServerProviderSlashCommand).pipe(
186 Schema.withDecodingDefault(Effect.succeed([])),
187 ),
188 skills: Schema.Array(ServerProviderSkill).pipe(Schema.withDecodingDefault(Effect.succeed([]))),
189 versionAdvisory: Schema.optionalKey(ServerProviderVersionAdvisory),
190 updateState: Schema.optionalKey(ServerProviderUpdateState),
191});
192export type ServerProvider = typeof ServerProvider.Type;
193
194export const ServerProviders = Schema.Array(ServerProvider);
195export type ServerProviders = typeof ServerProviders.Type;
196
197/**
198 * Treat the optional `availability` as "available" when absent. This is
199 * the rule legacy producers (which omit the field) and new producers
200 * (which set it explicitly) agree on so consumers never have to thread
201 * `?? "available"` defaults through their code paths.
202 */
203export const isProviderAvailable = (snapshot: ServerProvider): boolean =>
204 snapshot.availability !== "unavailable";
205
206export const ServerObservability = Schema.Struct({
207 logsDirectoryPath: TrimmedNonEmptyString,
208 localTracingEnabled: Schema.Boolean,
209 otlpTracesUrl: Schema.optional(TrimmedNonEmptyString),
210 otlpTracesEnabled: Schema.Boolean,
211 otlpMetricsUrl: Schema.optional(TrimmedNonEmptyString),
212 otlpMetricsEnabled: Schema.Boolean,
213});
214export type ServerObservability = typeof ServerObservability.Type;
215
216export const ServerTraceDiagnosticsErrorKind = Schema.Literals([
217 "trace-file-not-found",
218 "trace-file-read-failed",
219]);
220export type ServerTraceDiagnosticsErrorKind = typeof ServerTraceDiagnosticsErrorKind.Type;
221
222export const ServerTraceDiagnosticsSpanSummary = Schema.Struct({
223 name: TrimmedNonEmptyString,
224 count: NonNegativeInt,
225 failureCount: NonNegativeInt,
226 totalDurationMs: Schema.Number,
227 averageDurationMs: Schema.Number,
228 maxDurationMs: Schema.Number,
229});
230export type ServerTraceDiagnosticsSpanSummary = typeof ServerTraceDiagnosticsSpanSummary.Type;
231
232export const ServerTraceDiagnosticsFailureSummary = Schema.Struct({
233 name: TrimmedNonEmptyString,
234 cause: TrimmedNonEmptyString,
235 count: NonNegativeInt,
236 lastSeenAt: Schema.DateTimeUtc,
237 traceId: TrimmedNonEmptyString,
238 spanId: TrimmedNonEmptyString,
239});
240export type ServerTraceDiagnosticsFailureSummary = typeof ServerTraceDiagnosticsFailureSummary.Type;
241
242export const ServerTraceDiagnosticsRecentFailure = Schema.Struct({
243 name: TrimmedNonEmptyString,
244 cause: TrimmedNonEmptyString,
245 durationMs: Schema.Number,
246 endedAt: Schema.DateTimeUtc,
247 traceId: TrimmedNonEmptyString,
248 spanId: TrimmedNonEmptyString,
249});
250export type ServerTraceDiagnosticsRecentFailure = typeof ServerTraceDiagnosticsRecentFailure.Type;
251
252export const ServerTraceDiagnosticsSpanOccurrence = Schema.Struct({
253 name: TrimmedNonEmptyString,
254 durationMs: Schema.Number,
255 endedAt: Schema.DateTimeUtc,
256 traceId: TrimmedNonEmptyString,
257 spanId: TrimmedNonEmptyString,
258});
259export type ServerTraceDiagnosticsSpanOccurrence = typeof ServerTraceDiagnosticsSpanOccurrence.Type;
260
261export const ServerTraceDiagnosticsLogEvent = Schema.Struct({
262 spanName: TrimmedNonEmptyString,
263 level: TrimmedNonEmptyString,
264 message: TrimmedNonEmptyString,
265 seenAt: Schema.DateTimeUtc,
266 traceId: TrimmedNonEmptyString,
267 spanId: TrimmedNonEmptyString,
268});
269export type ServerTraceDiagnosticsLogEvent = typeof ServerTraceDiagnosticsLogEvent.Type;
270
271export const ServerTraceDiagnosticsResult = Schema.Struct({
272 traceFilePath: TrimmedNonEmptyString,
273 scannedFilePaths: Schema.Array(TrimmedNonEmptyString),
274 readAt: Schema.DateTimeUtc,
275 recordCount: NonNegativeInt,
276 parseErrorCount: NonNegativeInt,
277 firstSpanAt: Schema.Option(Schema.DateTimeUtc),
278 lastSpanAt: Schema.Option(Schema.DateTimeUtc),
279 failureCount: NonNegativeInt,
280 interruptionCount: NonNegativeInt,
281 slowSpanThresholdMs: NonNegativeInt,
282 slowSpanCount: NonNegativeInt,
283 logLevelCounts: Schema.Record(TrimmedNonEmptyString, NonNegativeInt),
284 topSpansByCount: Schema.Array(ServerTraceDiagnosticsSpanSummary),
285 slowestSpans: Schema.Array(ServerTraceDiagnosticsSpanOccurrence),
286 commonFailures: Schema.Array(ServerTraceDiagnosticsFailureSummary),
287 latestFailures: Schema.Array(ServerTraceDiagnosticsRecentFailure),
288 latestWarningAndErrorLogs: Schema.Array(ServerTraceDiagnosticsLogEvent),
289 partialFailure: Schema.Option(Schema.Boolean),
290 error: Schema.Option(
291 Schema.Struct({
292 kind: ServerTraceDiagnosticsErrorKind,
293 message: TrimmedNonEmptyString,
294 }),
295 ),
296});
297export type ServerTraceDiagnosticsResult = typeof ServerTraceDiagnosticsResult.Type;
298
299export const ServerProcessSignal = Schema.Literals(["SIGINT", "SIGKILL"]);
300export type ServerProcessSignal = typeof ServerProcessSignal.Type;
301
302export const ServerProcessDiagnosticsEntry = Schema.Struct({
303 pid: PositiveInt,
304 ppid: NonNegativeInt,
305 pgid: Schema.Option(Schema.Int),
306 status: TrimmedNonEmptyString,
307 cpuPercent: Schema.Number,
308 rssBytes: NonNegativeInt,
309 elapsed: TrimmedNonEmptyString,
310 command: TrimmedNonEmptyString,
311 depth: NonNegativeInt,
312 childPids: Schema.Array(PositiveInt),
313});
314export type ServerProcessDiagnosticsEntry = typeof ServerProcessDiagnosticsEntry.Type;
315
316export const ServerProcessDiagnosticsResult = Schema.Struct({
317 serverPid: PositiveInt,
318 readAt: Schema.DateTimeUtc,
319 processCount: NonNegativeInt,
320 totalRssBytes: NonNegativeInt,
321 totalCpuPercent: Schema.Number,
322 processes: Schema.Array(ServerProcessDiagnosticsEntry),
323 error: Schema.Option(
324 Schema.Struct({
325 message: TrimmedNonEmptyString,
326 }),
327 ),
328});
329export type ServerProcessDiagnosticsResult = typeof ServerProcessDiagnosticsResult.Type;
330
331export const ServerProcessResourceHistoryInput = Schema.Struct({
332 windowMs: NonNegativeInt,
333 bucketMs: NonNegativeInt,
334});
335export type ServerProcessResourceHistoryInput = typeof ServerProcessResourceHistoryInput.Type;
336
337export const ServerProcessResourceHistoryBucket = Schema.Struct({
338 startedAt: Schema.DateTimeUtc,
339 endedAt: Schema.DateTimeUtc,
340 avgCpuPercent: Schema.Number,
341 maxCpuPercent: Schema.Number,
342 maxRssBytes: NonNegativeInt,
343 maxProcessCount: NonNegativeInt,
344});
345export type ServerProcessResourceHistoryBucket = typeof ServerProcessResourceHistoryBucket.Type;
346
347export const ServerProcessResourceHistorySummary = Schema.Struct({
348 processKey: TrimmedNonEmptyString,
349 pid: PositiveInt,
350 ppid: NonNegativeInt,
351 command: TrimmedNonEmptyString,
352 depth: NonNegativeInt,
353 isServerRoot: Schema.Boolean,
354 firstSeenAt: Schema.DateTimeUtc,
355 lastSeenAt: Schema.DateTimeUtc,
356 currentCpuPercent: Schema.Number,
357 avgCpuPercent: Schema.Number,
358 maxCpuPercent: Schema.Number,
359 cpuSecondsApprox: Schema.Number,
360 currentRssBytes: NonNegativeInt,
361 maxRssBytes: NonNegativeInt,
362 sampleCount: NonNegativeInt,
363});
364export type ServerProcessResourceHistorySummary = typeof ServerProcessResourceHistorySummary.Type;
365
366export const ServerProcessResourceHistoryResult = Schema.Struct({
367 readAt: Schema.DateTimeUtc,
368 windowMs: NonNegativeInt,
369 bucketMs: NonNegativeInt,
370 sampleIntervalMs: NonNegativeInt,
371 retainedSampleCount: NonNegativeInt,
372 totalCpuSecondsApprox: Schema.Number,
373 buckets: Schema.Array(ServerProcessResourceHistoryBucket),
374 topProcesses: Schema.Array(ServerProcessResourceHistorySummary),
375 error: Schema.Option(
376 Schema.Struct({
377 message: TrimmedNonEmptyString,
378 }),
379 ),
380});
381export type ServerProcessResourceHistoryResult = typeof ServerProcessResourceHistoryResult.Type;
382
383export const ServerSignalProcessInput = Schema.Struct({
384 pid: PositiveInt,
385 signal: ServerProcessSignal,
386});
387export type ServerSignalProcessInput = typeof ServerSignalProcessInput.Type;
388
389export const ServerSignalProcessResult = Schema.Struct({
390 pid: PositiveInt,
391 signal: ServerProcessSignal,
392 signaled: Schema.Boolean,
393 message: Schema.Option(TrimmedNonEmptyString),
394});
395export type ServerSignalProcessResult = typeof ServerSignalProcessResult.Type;
396
397export const ServerConfig = Schema.Struct({
398 environment: ExecutionEnvironmentDescriptor,
399 auth: ServerAuthDescriptor,
400 cwd: TrimmedNonEmptyString,
401 keybindingsConfigPath: TrimmedNonEmptyString,
402 keybindings: ResolvedKeybindingsConfig,
403 issues: ServerConfigIssues,
404 providers: ServerProviders,
405 availableEditors: Schema.Array(EditorId),
406 observability: ServerObservability,
407 settings: ServerSettings,
408});
409export type ServerConfig = typeof ServerConfig.Type;
410
411const ServerUpsertKeybindingReplaceTarget = Schema.Struct({
412 key: KeybindingValue,
413 command: KeybindingCommand,
414 when: Schema.optional(KeybindingWhen),
415});
416
417export const ServerUpsertKeybindingInput = Schema.Struct({
418 key: KeybindingValue,
419 command: KeybindingCommand,
420 when: Schema.optional(KeybindingWhen),
421 replace: Schema.optional(ServerUpsertKeybindingReplaceTarget),
422});
423export type ServerUpsertKeybindingInput = typeof ServerUpsertKeybindingInput.Type;
424
425export const ServerRemoveKeybindingInput = ServerUpsertKeybindingReplaceTarget;
426export type ServerRemoveKeybindingInput = typeof ServerRemoveKeybindingInput.Type;
427
428export const ServerUpsertKeybindingResult = Schema.Struct({
429 keybindings: ResolvedKeybindingsConfig,
430 issues: ServerConfigIssues,
431});
432export type ServerUpsertKeybindingResult = typeof ServerUpsertKeybindingResult.Type;
433
434export const ServerRemoveKeybindingResult = ServerUpsertKeybindingResult;
435export type ServerRemoveKeybindingResult = typeof ServerRemoveKeybindingResult.Type;
436
437export const ServerConfigUpdatedPayload = Schema.Struct({
438 issues: ServerConfigIssues,
439 providers: ServerProviders,
440 settings: Schema.optional(ServerSettings),
441});
442export type ServerConfigUpdatedPayload = typeof ServerConfigUpdatedPayload.Type;
443
444export const ServerConfigKeybindingsUpdatedPayload = Schema.Struct({
445 keybindings: ResolvedKeybindingsConfig,
446 issues: ServerConfigIssues,
447});
448export type ServerConfigKeybindingsUpdatedPayload =
449 typeof ServerConfigKeybindingsUpdatedPayload.Type;
450
451export const ServerConfigProviderStatusesPayload = Schema.Struct({
452 providers: ServerProviders,
453});
454export type ServerConfigProviderStatusesPayload = typeof ServerConfigProviderStatusesPayload.Type;
455
456export const ServerConfigSettingsUpdatedPayload = Schema.Struct({
457 settings: ServerSettings,
458});
459export type ServerConfigSettingsUpdatedPayload = typeof ServerConfigSettingsUpdatedPayload.Type;
460
461export const ServerConfigStreamSnapshotEvent = Schema.Struct({
462 version: Schema.Literal(1),
463 type: Schema.Literal("snapshot"),
464 config: ServerConfig,
465});
466export type ServerConfigStreamSnapshotEvent = typeof ServerConfigStreamSnapshotEvent.Type;
467
468export const ServerConfigStreamKeybindingsUpdatedEvent = Schema.Struct({
469 version: Schema.Literal(1),
470 type: Schema.Literal("keybindingsUpdated"),
471 payload: ServerConfigKeybindingsUpdatedPayload,
472});
473export type ServerConfigStreamKeybindingsUpdatedEvent =
474 typeof ServerConfigStreamKeybindingsUpdatedEvent.Type;
475
476export const ServerConfigStreamProviderStatusesEvent = Schema.Struct({
477 version: Schema.Literal(1),
478 type: Schema.Literal("providerStatuses"),
479 payload: ServerConfigProviderStatusesPayload,
480});
481export type ServerConfigStreamProviderStatusesEvent =
482 typeof ServerConfigStreamProviderStatusesEvent.Type;
483
484export const ServerConfigStreamSettingsUpdatedEvent = Schema.Struct({
485 version: Schema.Literal(1),
486 type: Schema.Literal("settingsUpdated"),
487 payload: ServerConfigSettingsUpdatedPayload,
488});
489export type ServerConfigStreamSettingsUpdatedEvent =
490 typeof ServerConfigStreamSettingsUpdatedEvent.Type;
491
492export const ServerConfigStreamEvent = Schema.Union([
493 ServerConfigStreamSnapshotEvent,
494 ServerConfigStreamKeybindingsUpdatedEvent,
495 ServerConfigStreamProviderStatusesEvent,
496 ServerConfigStreamSettingsUpdatedEvent,
497]);
498export type ServerConfigStreamEvent = typeof ServerConfigStreamEvent.Type;
499
500export const ServerLifecycleReadyPayload = Schema.Struct({
501 at: IsoDateTime,
502 environment: ExecutionEnvironmentDescriptor,
503});
504export type ServerLifecycleReadyPayload = typeof ServerLifecycleReadyPayload.Type;
505
506export const ServerLifecycleWelcomePayload = Schema.Struct({
507 environment: ExecutionEnvironmentDescriptor,
508 cwd: TrimmedNonEmptyString,
509 projectName: TrimmedNonEmptyString,
510 bootstrapProjectId: Schema.optional(ProjectId),
511 bootstrapThreadId: Schema.optional(ThreadId),
512});
513export type ServerLifecycleWelcomePayload = typeof ServerLifecycleWelcomePayload.Type;
514
515export const ServerLifecycleStreamWelcomeEvent = Schema.Struct({
516 version: Schema.Literal(1),
517 sequence: NonNegativeInt,
518 type: Schema.Literal("welcome"),
519 payload: ServerLifecycleWelcomePayload,
520});
521export type ServerLifecycleStreamWelcomeEvent = typeof ServerLifecycleStreamWelcomeEvent.Type;
522
523export const ServerLifecycleStreamReadyEvent = Schema.Struct({
524 version: Schema.Literal(1),
525 sequence: NonNegativeInt,
526 type: Schema.Literal("ready"),
527 payload: ServerLifecycleReadyPayload,
528});
529export type ServerLifecycleStreamReadyEvent = typeof ServerLifecycleStreamReadyEvent.Type;
530
531export const ServerLifecycleStreamEvent = Schema.Union([
532 ServerLifecycleStreamWelcomeEvent,
533 ServerLifecycleStreamReadyEvent,
534]);
535export type ServerLifecycleStreamEvent = typeof ServerLifecycleStreamEvent.Type;
536
537export const ServerProviderUpdatedPayload = Schema.Struct({
538 providers: ServerProviders,
539});
540export type ServerProviderUpdatedPayload = typeof ServerProviderUpdatedPayload.Type;
541
542export const ServerProviderUpdateInput = Schema.Struct({
543 provider: ProviderDriverKind,
544 instanceId: Schema.optionalKey(ProviderInstanceId),
545});
546export type ServerProviderUpdateInput = typeof ServerProviderUpdateInput.Type;
547
548export class ServerProviderUpdateError extends Schema.TaggedErrorClass<ServerProviderUpdateError>()(
549 "ServerProviderUpdateError",
550 {
551 provider: ProviderDriverKind,
552 reason: TrimmedNonEmptyString,
553 cause: Schema.optional(Schema.Defect),
554 },
555) {
556 override get message(): string {
557 return `Provider update failed for ${this.provider}: ${this.reason}`;
558 }
559}