@sanity/workbench 0.1.0-alpha.2 → 0.1.0-alpha.20

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 (48) hide show
  1. package/README.md +24 -0
  2. package/dist/_chunks-es/index.js +39 -0
  3. package/dist/_chunks-es/index.js.map +1 -0
  4. package/dist/_chunks-es/studio.js +864 -0
  5. package/dist/_chunks-es/studio.js.map +1 -0
  6. package/dist/_internal.d.ts +16 -4
  7. package/dist/_internal.js +34 -26
  8. package/dist/_internal.js.map +1 -1
  9. package/dist/core.d.ts +2138 -0
  10. package/dist/core.js +75 -0
  11. package/dist/core.js.map +1 -0
  12. package/dist/system.d.ts +2120 -0
  13. package/dist/system.js +888 -0
  14. package/dist/system.js.map +1 -0
  15. package/package.json +33 -6
  16. package/src/_exports/core.ts +1 -0
  17. package/src/_exports/system.ts +1 -0
  18. package/src/_internal/index.ts +2 -1
  19. package/src/_internal/render.ts +72 -42
  20. package/src/core/applications/application-list.ts +104 -0
  21. package/src/core/applications/application.ts +174 -0
  22. package/src/core/canvases.ts +92 -0
  23. package/src/core/config.ts +34 -0
  24. package/src/core/env.ts +43 -0
  25. package/src/core/index.ts +13 -0
  26. package/src/core/log/index.ts +125 -0
  27. package/src/core/media-libraries.ts +93 -0
  28. package/src/core/organizations.ts +115 -0
  29. package/src/core/projects.ts +114 -0
  30. package/src/core/shared/urls.ts +129 -0
  31. package/src/core/user-applications/core-app.ts +148 -0
  32. package/src/core/user-applications/studios/index.ts +3 -0
  33. package/src/core/user-applications/studios/schemas.ts +128 -0
  34. package/src/core/user-applications/studios/studio.ts +533 -0
  35. package/src/core/user-applications/studios/workspace.ts +152 -0
  36. package/src/core/user-applications/user-application.ts +222 -0
  37. package/src/system/auth.machine.ts +223 -0
  38. package/src/system/index.ts +22 -0
  39. package/src/system/inspect.ts +40 -0
  40. package/src/system/load-federated-module.ts +54 -0
  41. package/src/system/remote.machine.ts +219 -0
  42. package/src/system/remotes.machine.ts +92 -0
  43. package/src/system/root.machine.ts +224 -0
  44. package/src/system/service.machine.ts +207 -0
  45. package/src/system/services.machine.ts +120 -0
  46. package/src/system/system-preferences.machine.ts +215 -0
  47. package/src/system/telemetry.machine.ts +179 -0
  48. package/src/_internal/render.test.ts +0 -18
package/dist/core.d.ts ADDED
@@ -0,0 +1,2138 @@
1
+ import { App } from "@sanity/federation";
2
+ import type { ApplicationResource } from "@sanity/message-protocol";
3
+ import type { CanvasResource } from "@sanity/message-protocol";
4
+ import { Interface } from "@sanity/federation";
5
+ import { InterfaceSchema } from "@sanity/federation";
6
+ import { LocalApp } from "@sanity/federation";
7
+ import { LocalInterface } from "@sanity/federation";
8
+ import { LocalInterfaceSchema } from "@sanity/federation";
9
+ import { LocalPanel } from "@sanity/federation";
10
+ import { LocalService } from "@sanity/federation";
11
+ import type { MediaResource } from "@sanity/message-protocol";
12
+ import { Panel } from "@sanity/federation";
13
+ import { PanelComponent } from "@sanity/federation";
14
+ import type { Resource } from "@sanity/message-protocol";
15
+ import { Service } from "@sanity/federation";
16
+ import type { StudioResource } from "@sanity/message-protocol";
17
+ import { z } from "zod";
18
+
19
+ /**
20
+ * @public
21
+ */
22
+ export declare abstract class AbstractApplication<
23
+ TType extends AbstractApplicationType,
24
+ TProtocolResource extends Resource = Extract<
25
+ Resource,
26
+ {
27
+ type: TType;
28
+ }
29
+ >,
30
+ > {
31
+ readonly type: TType;
32
+ constructor(type: TType);
33
+ /**
34
+ * The in-app route this application navigates to, or `null` when it isn't
35
+ * navigable as a full-page app (US5 — e.g. an SDK app with no `app` view).
36
+ * The dock renders a navigable item only for a non-null `href`; the app
37
+ * routes 404 a `null`-href app on direct visit.
38
+ */
39
+ abstract get href(): string | null;
40
+ abstract get title(): string;
41
+ abstract get id(): string;
42
+ /**
43
+ * Whether the application is federated or not. This is used to determine
44
+ * if the application should be rendered in an iframe or not.
45
+ */
46
+ abstract get isFederated(): boolean;
47
+ /**
48
+ * Whether the application is served by a local CLI dev server rather than a
49
+ * deployed remote. Defaults to `false`; user applications flip this when
50
+ * constructed from a `LocalUserApplication` payload.
51
+ */
52
+ get isLocal(): boolean;
53
+ abstract get url(): URL;
54
+ /**
55
+ * Interfaces the application exposes (e.g. dock panels). Defaults to none;
56
+ * user applications surface what they declared via `unstable_defineApp`.
57
+ */
58
+ get interfaces(): readonly LocalInterface[];
59
+ /**
60
+ * Whether the application has a navigable full-page `app` view (US5). Defaults
61
+ * to `true` — studios, Canvas, and Media Library are always navigable. An SDK
62
+ * app overrides this to derive it from whether it declares an `app` interface.
63
+ */
64
+ get hasAppView(): boolean;
65
+ /**
66
+ * Federation module id of the app's full-page view (`${id}/App`), or `null`
67
+ * when it can't be federation-loaded: the app isn't federated (Canvas, Media
68
+ * Library, deployed apps shown in an iframe) or has no app view. Only a
69
+ * non-null `moduleId` is fetched and rendered by the remotes machine.
70
+ */
71
+ get moduleId(): string | null;
72
+ /**
73
+ * Federation module id of one of this app's panel view components, or `null`
74
+ * when the app isn't federated (a non-federated app's panels can't be loaded
75
+ * as remotes).
76
+ */
77
+ resolveViewModuleId(
78
+ view: LocalPanel,
79
+ component: PanelComponent,
80
+ ): string | null;
81
+ get initials(): string;
82
+ /**
83
+ * Converts the resource to a protocol resource that comlink expects
84
+ * for backwards compatibility with the old API format.
85
+ */
86
+ abstract toProtocolResource(): TProtocolResource;
87
+ }
88
+
89
+ /**
90
+ * @public
91
+ */
92
+ export declare type AbstractApplicationType =
93
+ | "studio"
94
+ | "coreApp"
95
+ | "canvas"
96
+ | "media-library"
97
+ | "workspace";
98
+
99
+ /**
100
+ * @public
101
+ */
102
+ export declare const ActiveDeployment: z.ZodObject<
103
+ {
104
+ id: z.ZodString;
105
+ version: z.ZodString;
106
+ isActiveDeployment: z.ZodBoolean;
107
+ userApplicationId: z.ZodString;
108
+ isAutoUpdating: z.ZodBoolean;
109
+ size: z.ZodNumber;
110
+ deployedAt: z.ZodString;
111
+ deployedBy: z.ZodString;
112
+ createdAt: z.ZodString;
113
+ updatedAt: z.ZodString;
114
+ },
115
+ z.core.$strip
116
+ >;
117
+
118
+ export { App };
119
+
120
+ /**
121
+ * @public
122
+ */
123
+ export declare type Application =
124
+ | CoreAppApplication
125
+ | StudioApplication
126
+ | StudioWorkspace
127
+ | CanvasApplication
128
+ | MediaLibraryApplication;
129
+
130
+ /**
131
+ * @public
132
+ */
133
+ export declare class ApplicationList<
134
+ TApplication extends Application = Application,
135
+ > {
136
+ readonly applications: TApplication[];
137
+ /**
138
+ * @param applications - The applications to initialize the list with.
139
+ */
140
+ constructor(applications: TApplication[]);
141
+ findApplicationsByType<T extends TApplication["type"]>(
142
+ type: T,
143
+ ): Extract<
144
+ TApplication,
145
+ {
146
+ type: T;
147
+ }
148
+ >[];
149
+ findApplicationsByType<T extends TApplication["type"][]>(
150
+ types: T,
151
+ ): Extract<
152
+ TApplication,
153
+ {
154
+ type: T[number];
155
+ }
156
+ >[];
157
+ findApplication(type: "media-library"):
158
+ | Extract<
159
+ TApplication,
160
+ {
161
+ type: "media-library";
162
+ }
163
+ >
164
+ | undefined;
165
+ findApplication(type: "canvas"):
166
+ | Extract<
167
+ TApplication,
168
+ {
169
+ type: "canvas";
170
+ }
171
+ >
172
+ | undefined;
173
+ findApplication(
174
+ type: "coreApp",
175
+ id: UserApplicationId,
176
+ ):
177
+ | Extract<
178
+ TApplication,
179
+ {
180
+ type: "coreApp";
181
+ }
182
+ >
183
+ | undefined;
184
+ findApplication(
185
+ type: "studio",
186
+ id: UserApplicationId,
187
+ ):
188
+ | Extract<
189
+ TApplication,
190
+ {
191
+ type: "studio";
192
+ }
193
+ >
194
+ | undefined;
195
+ findApplication(
196
+ type: "workspace",
197
+ id: string,
198
+ ):
199
+ | Extract<
200
+ TApplication,
201
+ {
202
+ type: "workspace";
203
+ }
204
+ >
205
+ | undefined;
206
+ toProtocolResources(): Resource[];
207
+ static areApplicationsEqual(
208
+ application1?: Application,
209
+ application2?: Application,
210
+ ): boolean;
211
+ }
212
+
213
+ /**
214
+ * Validates and brands a string as a CanvasId.
215
+ * @public
216
+ */
217
+ export declare function brandCanvasId(id: string): CanvasId;
218
+
219
+ /**
220
+ * Validates and brands a string as a MediaLibraryId.
221
+ * @public
222
+ */
223
+ export declare function brandMediaLibraryId(id: string): MediaLibraryId;
224
+
225
+ /**
226
+ * Validates and brands a string as an OrganizationId.
227
+ * @public
228
+ */
229
+ export declare function brandOrganizationId(id: string): OrganizationId;
230
+
231
+ /**
232
+ * Validates and brands a string as a ProjectId.
233
+ * @public
234
+ */
235
+ export declare function brandProjectId(id: string): ProjectId;
236
+
237
+ /**
238
+ * Validates and brands a string as a UserApplicationId.
239
+ * @public
240
+ */
241
+ export declare function brandUserApplicationId(id: string): UserApplicationId;
242
+
243
+ /**
244
+ * Represents a Canvas resource as returned from the API.
245
+ * @public
246
+ */
247
+ export declare type Canvas = z.output<typeof Canvas_2>;
248
+
249
+ declare const Canvas_2: z.ZodObject<
250
+ {
251
+ id: z.core.$ZodBranded<z.ZodString, "CanvasId", "out">;
252
+ organizationId: z.core.$ZodBranded<z.ZodString, "OrganizationId", "out">;
253
+ status: z.ZodEnum<{
254
+ active: "active";
255
+ provisioning: "provisioning";
256
+ }>;
257
+ },
258
+ z.core.$strip
259
+ >;
260
+
261
+ /**
262
+ * Represents a Canvas resource as returned from the API.
263
+ * @public
264
+ */
265
+ declare type Canvas = z.output<typeof Canvas_2>;
266
+
267
+ /**
268
+ * Whilst the constructor takes an organization's canvas resource the existance
269
+ * therefore implies the organization has access to the canvas application which
270
+ * is what workbench most importantly wants to know.
271
+ * @public
272
+ */
273
+ export declare class CanvasApplication extends AbstractApplication<"canvas"> {
274
+ readonly canvas: Canvas;
275
+ constructor(canvas: Canvas);
276
+ get id(): CanvasId;
277
+ get href(): string;
278
+ get title(): string;
279
+ get url(): URL;
280
+ get isFederated(): boolean;
281
+ toProtocolResource(): CanvasResource;
282
+ }
283
+
284
+ /**
285
+ * Canvas ID type, branded for type safety.
286
+ * @public
287
+ */
288
+ export declare type CanvasId = z.output<typeof CanvasId_2>;
289
+
290
+ /**
291
+ * Canvas ID schema, branded for type safety.
292
+ * @public
293
+ */
294
+ declare const CanvasId_2: z.core.$ZodBranded<z.ZodString, "CanvasId", "out">;
295
+
296
+ /**
297
+ * Canvas ID type, branded for type safety.
298
+ * @public
299
+ */
300
+ declare type CanvasId = z.output<typeof CanvasId_2>;
301
+
302
+ /**
303
+ * @public
304
+ */
305
+ export declare const ClientManifest: z.ZodObject<
306
+ {
307
+ version: z.ZodNumber;
308
+ createdAt: z.ZodString;
309
+ studioVersion: z.ZodOptional<z.ZodString>;
310
+ group: z.ZodOptional<z.ZodString>;
311
+ priority: z.ZodOptional<z.ZodNumber>;
312
+ workspaces: z.ZodArray<
313
+ z.ZodObject<
314
+ {
315
+ name: z.ZodString;
316
+ title: z.ZodString;
317
+ subtitle: z.ZodOptional<z.ZodString>;
318
+ basePath: z.ZodString;
319
+ projectId: z.core.$ZodBranded<z.ZodString, "ProjectId", "out">;
320
+ dataset: z.ZodOptional<z.ZodString>;
321
+ icon: z.ZodOptional<z.ZodNullable<z.ZodString>>;
322
+ schema: z.ZodString;
323
+ tools: z.ZodOptional<z.ZodString>;
324
+ },
325
+ z.core.$strip
326
+ >
327
+ >;
328
+ },
329
+ z.core.$strip
330
+ >;
331
+
332
+ /**
333
+ * @public
334
+ */
335
+ export declare type ClientManifest = z.output<typeof ClientManifest>;
336
+
337
+ declare type CompatibilityStatus =
338
+ (typeof StudioApplication.CompatibilityStatuses)[keyof typeof StudioApplication.CompatibilityStatuses];
339
+
340
+ /**
341
+ * Workbench configuration.
342
+ *
343
+ * @public
344
+ */
345
+ export declare interface Config {
346
+ /**
347
+ * The organization ID to use when rendering the workbench.
348
+ */
349
+ organizationId?: string;
350
+ }
351
+
352
+ /**
353
+ * @public
354
+ */
355
+ export declare class CoreAppApplication extends UserApplication<
356
+ CoreAppUserApplication,
357
+ "coreApp",
358
+ ApplicationResource
359
+ > {
360
+ readonly activeDeployment: CoreAppUserApplication["activeDeployment"];
361
+ constructor(
362
+ application: CoreAppUserApplication,
363
+ options?: {
364
+ isLocal?: boolean;
365
+ remoteApplication?: CoreAppApplication | null;
366
+ },
367
+ );
368
+ get href(): string | null;
369
+ get title(): string;
370
+ /**
371
+ * Resolves the core app's manifest from `activeDeployment.manifest`. This
372
+ * is the canonical (and only) slot for core app manifests — both for
373
+ * Sanity-deployed apps and for local CLI dev-server apps, which synthesise
374
+ * a deployment to surface the live manifest.
375
+ */
376
+ get manifest(): CoreAppUserApplicationManifest | null;
377
+ get subtitle(): undefined;
378
+ get updatedAt(): string;
379
+ get<TKey extends keyof CoreAppUserApplication>(
380
+ attr: TKey,
381
+ ): CoreAppUserApplication[TKey];
382
+ toProtocolResource(): ApplicationResource;
383
+ }
384
+
385
+ /**
386
+ * @public
387
+ */
388
+ export declare type CoreAppUserApplication = z.output<
389
+ typeof CoreAppUserApplication_2
390
+ >;
391
+
392
+ /**
393
+ * Core application schema — validates and brands API
394
+ * responses from the `/user-applications?appType=coreApp`
395
+ * endpoint. Uses a discriminated union on `urlType`.
396
+ * @public
397
+ */
398
+ declare const CoreAppUserApplication_2: z.ZodDiscriminatedUnion<
399
+ [
400
+ z.ZodObject<
401
+ {
402
+ id: z.core.$ZodBranded<z.ZodString, "UserApplicationId", "out">;
403
+ appHost: z.ZodString;
404
+ createdAt: z.ZodString;
405
+ updatedAt: z.ZodString;
406
+ dashboardStatus: z.ZodEnum<{
407
+ default: "default";
408
+ disabled: "disabled";
409
+ }>;
410
+ interfaces: z.ZodOptional<
411
+ z.ZodArray<
412
+ z.ZodDiscriminatedUnion<
413
+ [
414
+ z.ZodObject<
415
+ {
416
+ interface_type: z.ZodLiteral<"panel">;
417
+ name: z.ZodString;
418
+ entry_point: z.ZodString;
419
+ },
420
+ z.core.$strip
421
+ >,
422
+ z.ZodObject<
423
+ {
424
+ interface_type: z.ZodLiteral<"worker">;
425
+ name: z.ZodString;
426
+ entry_point: z.ZodString;
427
+ },
428
+ z.core.$strip
429
+ >,
430
+ z.ZodObject<
431
+ {
432
+ interface_type: z.ZodLiteral<"app">;
433
+ name: z.ZodString;
434
+ entry_point: z.ZodString;
435
+ },
436
+ z.core.$strip
437
+ >,
438
+ ],
439
+ "interface_type"
440
+ >
441
+ >
442
+ >;
443
+ title: z.ZodString;
444
+ organizationId: z.core.$ZodBranded<
445
+ z.ZodString,
446
+ "OrganizationId",
447
+ "out"
448
+ >;
449
+ type: z.ZodLiteral<"coreApp">;
450
+ urlType: z.ZodLiteral<"internal">;
451
+ activeDeployment: z.ZodNullable<
452
+ z.ZodObject<
453
+ {
454
+ id: z.ZodString;
455
+ version: z.ZodString;
456
+ isActiveDeployment: z.ZodBoolean;
457
+ userApplicationId: z.ZodString;
458
+ isAutoUpdating: z.ZodBoolean;
459
+ size: z.ZodNumber;
460
+ deployedAt: z.ZodString;
461
+ deployedBy: z.ZodString;
462
+ createdAt: z.ZodString;
463
+ updatedAt: z.ZodString;
464
+ manifest: z.ZodNullable<
465
+ z.ZodObject<
466
+ {
467
+ version: z.ZodString;
468
+ icon: z.ZodOptional<z.ZodString>;
469
+ title: z.ZodOptional<z.ZodString>;
470
+ group: z.ZodOptional<z.ZodString>;
471
+ priority: z.ZodOptional<z.ZodNumber>;
472
+ },
473
+ z.core.$strip
474
+ >
475
+ >;
476
+ },
477
+ z.core.$strip
478
+ >
479
+ >;
480
+ },
481
+ z.core.$strip
482
+ >,
483
+ z.ZodObject<
484
+ {
485
+ id: z.core.$ZodBranded<z.ZodString, "UserApplicationId", "out">;
486
+ appHost: z.ZodString;
487
+ createdAt: z.ZodString;
488
+ updatedAt: z.ZodString;
489
+ dashboardStatus: z.ZodEnum<{
490
+ default: "default";
491
+ disabled: "disabled";
492
+ }>;
493
+ interfaces: z.ZodOptional<
494
+ z.ZodArray<
495
+ z.ZodDiscriminatedUnion<
496
+ [
497
+ z.ZodObject<
498
+ {
499
+ interface_type: z.ZodLiteral<"panel">;
500
+ name: z.ZodString;
501
+ entry_point: z.ZodString;
502
+ },
503
+ z.core.$strip
504
+ >,
505
+ z.ZodObject<
506
+ {
507
+ interface_type: z.ZodLiteral<"worker">;
508
+ name: z.ZodString;
509
+ entry_point: z.ZodString;
510
+ },
511
+ z.core.$strip
512
+ >,
513
+ z.ZodObject<
514
+ {
515
+ interface_type: z.ZodLiteral<"app">;
516
+ name: z.ZodString;
517
+ entry_point: z.ZodString;
518
+ },
519
+ z.core.$strip
520
+ >,
521
+ ],
522
+ "interface_type"
523
+ >
524
+ >
525
+ >;
526
+ title: z.ZodString;
527
+ organizationId: z.core.$ZodBranded<
528
+ z.ZodString,
529
+ "OrganizationId",
530
+ "out"
531
+ >;
532
+ type: z.ZodLiteral<"coreApp">;
533
+ urlType: z.ZodLiteral<"external">;
534
+ activeDeployment: z.ZodNullable<
535
+ z.ZodObject<
536
+ {
537
+ id: z.ZodString;
538
+ version: z.ZodString;
539
+ isActiveDeployment: z.ZodBoolean;
540
+ userApplicationId: z.ZodString;
541
+ isAutoUpdating: z.ZodBoolean;
542
+ size: z.ZodNumber;
543
+ deployedAt: z.ZodString;
544
+ deployedBy: z.ZodString;
545
+ createdAt: z.ZodString;
546
+ updatedAt: z.ZodString;
547
+ manifest: z.ZodNullable<
548
+ z.ZodObject<
549
+ {
550
+ version: z.ZodString;
551
+ icon: z.ZodOptional<z.ZodString>;
552
+ title: z.ZodOptional<z.ZodString>;
553
+ group: z.ZodOptional<z.ZodString>;
554
+ priority: z.ZodOptional<z.ZodNumber>;
555
+ },
556
+ z.core.$strip
557
+ >
558
+ >;
559
+ },
560
+ z.core.$strip
561
+ >
562
+ >;
563
+ },
564
+ z.core.$strip
565
+ >,
566
+ ],
567
+ "urlType"
568
+ >;
569
+
570
+ /**
571
+ * @public
572
+ */
573
+ declare type CoreAppUserApplication = z.output<typeof CoreAppUserApplication_2>;
574
+
575
+ /**
576
+ * @public
577
+ */
578
+ export declare const CoreAppUserApplicationManifest: z.ZodObject<
579
+ {
580
+ version: z.ZodString;
581
+ icon: z.ZodOptional<z.ZodString>;
582
+ title: z.ZodOptional<z.ZodString>;
583
+ group: z.ZodOptional<z.ZodString>;
584
+ priority: z.ZodOptional<z.ZodNumber>;
585
+ },
586
+ z.core.$strip
587
+ >;
588
+
589
+ /**
590
+ * @public
591
+ */
592
+ export declare type CoreAppUserApplicationManifest = z.output<
593
+ typeof CoreAppUserApplicationManifest
594
+ >;
595
+
596
+ /**
597
+ * Creates a leveled logger with an optional namespace prefix and bound
598
+ * context. Calls below the configured `logLevel` are suppressed; `"none"`
599
+ * silences the logger entirely.
600
+ *
601
+ * Use {@link Logger.child} to derive a sub-logger with an extended namespace
602
+ * (e.g. `parent:domain`) that inherits the parent's level and merges its
603
+ * bound context.
604
+ *
605
+ * @param options - Logger configuration.
606
+ * @param options.namespace - Prepended to every message in `[brackets]`.
607
+ * @param options.context - Bound context merged with per-call context.
608
+ * Per-call keys win on conflict.
609
+ * @param options.logLevel - Maximum verbosity to emit. Default `"info"`.
610
+ *
611
+ * @example
612
+ * ```ts
613
+ * const log = createLogger({ namespace: "checkout", logLevel: "debug" });
614
+ * log.info("placed", { orderId: "abc" });
615
+ * // → [checkout] placed { orderId: "abc" }
616
+ *
617
+ * const auth = log.child("auth", { tenant: "acme" });
618
+ * auth.warn("token expiring");
619
+ * // → [checkout:auth] token expiring { tenant: "acme" }
620
+ * ```
621
+ *
622
+ * @public
623
+ */
624
+ export declare function createLogger({
625
+ namespace,
626
+ context: baseContext,
627
+ logLevel,
628
+ }?: LoggerOptions): Logger;
629
+
630
+ /**
631
+ * Returns the API host based on the `__SANITY_STAGING__` runtime-time flag.
632
+ * If the flag is set to `true`, the staging API host is returned.
633
+ * Otherwise, the production API host is returned.
634
+ *
635
+ * @public
636
+ */
637
+ export declare function getApiHost(): string | undefined;
638
+
639
+ /**
640
+ * Returns the Sanity domain based on the `__SANITY_STAGING__` runtime-time flag.
641
+ * If the flag is set to `true`, the staging domain is returned.
642
+ * Otherwise, the production domain is returned.
643
+ *
644
+ * @public
645
+ */
646
+ export declare function getSanityDomain(): string;
647
+
648
+ /**
649
+ * Returns the current Sanity environment based on the `__SANITY_STAGING__` runtime-time flag.
650
+ * If the flag is set to `true`, "staging" is returned.
651
+ * Otherwise, "production" is returned.
652
+ *
653
+ * @public
654
+ */
655
+ export declare function getSanityEnv(): "staging" | "production";
656
+
657
+ export { Interface };
658
+
659
+ export { InterfaceSchema };
660
+
661
+ /**
662
+ * Joins multiple path segments into a single path string.
663
+ * Handles null, undefined, and URL objects gracefully.
664
+ *
665
+ * @public
666
+ * @param paths - An array of path segments to join.
667
+ * @returns A single joined path string.
668
+ */
669
+ export declare const joinUrlPaths: (
670
+ ...paths: Array<string | URL | null | undefined>
671
+ ) => string;
672
+
673
+ export { LocalApp };
674
+
675
+ export { LocalInterface };
676
+
677
+ export { LocalInterfaceSchema };
678
+
679
+ export { LocalPanel };
680
+
681
+ export { LocalService };
682
+
683
+ /**
684
+ * Raw data for a local application discovered by the CLI dev server.
685
+ *
686
+ * The CLI forwards the full studio or app manifest so the workbench can
687
+ * derive icons, titles, workspaces and schema references the same way it
688
+ * does for deployed applications. The manifest shape is discriminated on
689
+ * `type`: studios receive a `ClientManifest`, core apps a `CoreAppUserApplicationManifest`.
690
+ *
691
+ * When set on a `UserApplication`, `isLocal` is `true` and `url`/`isFederated`
692
+ * honour the local dev-server instead of the deployed application's host.
693
+ *
694
+ * @public
695
+ */
696
+ export declare const LocalUserApplication: z.ZodDiscriminatedUnion<
697
+ [
698
+ z.ZodObject<
699
+ {
700
+ host: z.ZodString;
701
+ port: z.ZodNumber;
702
+ interfaces: z.ZodOptional<
703
+ z.ZodArray<
704
+ z.ZodDiscriminatedUnion<
705
+ [
706
+ z.ZodObject<
707
+ {
708
+ interface_type: z.ZodLiteral<"panel">;
709
+ name: z.ZodString;
710
+ entry_point: z.ZodString;
711
+ },
712
+ z.core.$strip
713
+ >,
714
+ z.ZodObject<
715
+ {
716
+ interface_type: z.ZodLiteral<"worker">;
717
+ name: z.ZodString;
718
+ entry_point: z.ZodString;
719
+ },
720
+ z.core.$strip
721
+ >,
722
+ z.ZodObject<
723
+ {
724
+ interface_type: z.ZodLiteral<"app">;
725
+ name: z.ZodString;
726
+ entry_point: z.ZodString;
727
+ },
728
+ z.core.$strip
729
+ >,
730
+ ],
731
+ "interface_type"
732
+ >
733
+ >
734
+ >;
735
+ id: z.ZodOptional<z.ZodString>;
736
+ projectId: z.ZodOptional<z.ZodString>;
737
+ type: z.ZodLiteral<"studio">;
738
+ manifest: z.ZodOptional<
739
+ z.ZodCustom<
740
+ {
741
+ version: number;
742
+ createdAt: string;
743
+ workspaces: {
744
+ name: string;
745
+ title: string;
746
+ basePath: string;
747
+ projectId: string & z.core.$brand<"ProjectId">;
748
+ schema: string;
749
+ subtitle?: string | undefined;
750
+ dataset?: string | undefined;
751
+ icon?: string | null | undefined;
752
+ tools?: string | undefined;
753
+ }[];
754
+ studioVersion?: string | undefined;
755
+ group?: string | undefined;
756
+ priority?: number | undefined;
757
+ },
758
+ {
759
+ version: number;
760
+ createdAt: string;
761
+ workspaces: {
762
+ name: string;
763
+ title: string;
764
+ basePath: string;
765
+ projectId: string & z.core.$brand<"ProjectId">;
766
+ schema: string;
767
+ subtitle?: string | undefined;
768
+ dataset?: string | undefined;
769
+ icon?: string | null | undefined;
770
+ tools?: string | undefined;
771
+ }[];
772
+ studioVersion?: string | undefined;
773
+ group?: string | undefined;
774
+ priority?: number | undefined;
775
+ }
776
+ >
777
+ >;
778
+ },
779
+ z.core.$strip
780
+ >,
781
+ z.ZodObject<
782
+ {
783
+ host: z.ZodString;
784
+ port: z.ZodNumber;
785
+ interfaces: z.ZodOptional<
786
+ z.ZodArray<
787
+ z.ZodDiscriminatedUnion<
788
+ [
789
+ z.ZodObject<
790
+ {
791
+ interface_type: z.ZodLiteral<"panel">;
792
+ name: z.ZodString;
793
+ entry_point: z.ZodString;
794
+ },
795
+ z.core.$strip
796
+ >,
797
+ z.ZodObject<
798
+ {
799
+ interface_type: z.ZodLiteral<"worker">;
800
+ name: z.ZodString;
801
+ entry_point: z.ZodString;
802
+ },
803
+ z.core.$strip
804
+ >,
805
+ z.ZodObject<
806
+ {
807
+ interface_type: z.ZodLiteral<"app">;
808
+ name: z.ZodString;
809
+ entry_point: z.ZodString;
810
+ },
811
+ z.core.$strip
812
+ >,
813
+ ],
814
+ "interface_type"
815
+ >
816
+ >
817
+ >;
818
+ id: z.ZodOptional<z.ZodString>;
819
+ projectId: z.ZodOptional<z.ZodString>;
820
+ type: z.ZodLiteral<"coreApp">;
821
+ manifest: z.ZodOptional<
822
+ z.ZodCustom<
823
+ {
824
+ version: string;
825
+ icon?: string | undefined;
826
+ title?: string | undefined;
827
+ group?: string | undefined;
828
+ priority?: number | undefined;
829
+ },
830
+ {
831
+ version: string;
832
+ icon?: string | undefined;
833
+ title?: string | undefined;
834
+ group?: string | undefined;
835
+ priority?: number | undefined;
836
+ }
837
+ >
838
+ >;
839
+ },
840
+ z.core.$strip
841
+ >,
842
+ ],
843
+ "type"
844
+ >;
845
+
846
+ /**
847
+ * @public
848
+ */
849
+ export declare type LocalUserApplication = z.output<
850
+ typeof LocalUserApplication
851
+ >;
852
+
853
+ declare type LogContext = {
854
+ [key: string]: unknown;
855
+ };
856
+
857
+ /**
858
+ * @public
859
+ */
860
+ export declare interface Logger {
861
+ error: (message: string, context?: LogContext) => void;
862
+ warn: (message: string, context?: LogContext) => void;
863
+ info: (message: string, context?: LogContext) => void;
864
+ debug: (message: string, context?: LogContext) => void;
865
+ child: (domain: string, context?: LogContext) => Logger;
866
+ }
867
+
868
+ /**
869
+ * Shared workbench logger instance. Use this from both the workbench host
870
+ * and its remotes so lifecycle and diagnostic logs appear under a single
871
+ * namespace.
872
+ *
873
+ * @public
874
+ */
875
+ export declare const logger: Logger;
876
+
877
+ declare interface LoggerOptions {
878
+ namespace?: LogNamespace;
879
+ context?: LogContext;
880
+ logLevel?: LogLevel;
881
+ }
882
+
883
+ /**
884
+ * Log levels in order of verbosity (least to most)
885
+ * - none: Silent
886
+ * - error: Critical failures that prevent operation
887
+ * - warn: Issues that may cause problems but don't stop execution
888
+ * - info: High-level informational messages (default)
889
+ * - debug: Detailed debugging information (maintainer level)
890
+ * - trace: Very detailed tracing — sets `internal: true` on context
891
+ * @public
892
+ */
893
+ export declare type LogLevel = "none" | "error" | "warn" | "info" | "debug";
894
+
895
+ /**
896
+ * Namespaces organize logs by functional domain.
897
+ * @internal
898
+ */
899
+ export declare type LogNamespace = string;
900
+
901
+ /**
902
+ * Represents a MediaLibrary resource as returned from the API.
903
+ * @public
904
+ */
905
+ export declare type MediaLibrary = z.output<typeof MediaLibrary_2>;
906
+
907
+ declare const MediaLibrary_2: z.ZodObject<
908
+ {
909
+ id: z.core.$ZodBranded<z.ZodString, "MediaLibraryId", "out">;
910
+ organizationId: z.core.$ZodBranded<z.ZodString, "OrganizationId", "out">;
911
+ status: z.ZodEnum<{
912
+ active: "active";
913
+ provisioning: "provisioning";
914
+ }>;
915
+ aclMode: z.ZodEnum<{
916
+ private: "private";
917
+ public: "public";
918
+ }>;
919
+ },
920
+ z.core.$strip
921
+ >;
922
+
923
+ /**
924
+ * Represents a MediaLibrary resource as returned from the API.
925
+ * @public
926
+ */
927
+ declare type MediaLibrary = z.output<typeof MediaLibrary_2>;
928
+
929
+ /**
930
+ * Whilst the constructor takes an organization's media library resource the existance
931
+ * therefore implies the organization has access to the media library application which
932
+ * is what workbench most importantly wants to know.
933
+ * @public
934
+ */
935
+ export declare class MediaLibraryApplication extends AbstractApplication<"media-library"> {
936
+ readonly library: MediaLibrary;
937
+ constructor(library: MediaLibrary);
938
+ get id(): string;
939
+ get href(): string;
940
+ get title(): string;
941
+ get isFederated(): boolean;
942
+ get url(): URL;
943
+ toProtocolResource(): MediaResource;
944
+ }
945
+
946
+ /**
947
+ * MediaLibrary ID type, branded for type safety.
948
+ * @public
949
+ */
950
+ export declare type MediaLibraryId = z.output<typeof MediaLibraryId_2>;
951
+
952
+ /**
953
+ * Canvas ID schema, branded for type safety.
954
+ * @public
955
+ */
956
+ declare const MediaLibraryId_2: z.core.$ZodBranded<
957
+ z.ZodString,
958
+ "MediaLibraryId",
959
+ "out"
960
+ >;
961
+
962
+ /**
963
+ * MediaLibrary ID type, branded for type safety.
964
+ * @public
965
+ */
966
+ declare type MediaLibraryId = z.output<typeof MediaLibraryId_2>;
967
+
968
+ /**
969
+ * Organization schema — validates and brands API responses
970
+ * from the `/organizations/:id` endpoint.
971
+ * @public
972
+ */
973
+ export declare const Organization: z.ZodObject<
974
+ {
975
+ id: z.core.$ZodBranded<z.ZodString, "OrganizationId", "out">;
976
+ name: z.ZodString;
977
+ slug: z.ZodNullable<z.ZodString>;
978
+ createdAt: z.ZodString;
979
+ updatedAt: z.ZodString;
980
+ dashboardStatus: z.ZodEnum<{
981
+ enabled: "enabled";
982
+ disabled: "disabled";
983
+ }>;
984
+ aiFeaturesStatus: z.ZodEnum<{
985
+ enabled: "enabled";
986
+ disabled: "disabled";
987
+ }>;
988
+ defaultRoleName: z.ZodNullable<z.ZodString>;
989
+ },
990
+ z.core.$strip
991
+ >;
992
+
993
+ /**
994
+ * Represents an organization with optional members and
995
+ * features arrays depending on the generic parameters.
996
+ * - `Organization` — base fields only (default)
997
+ * - `Organization<true>` — includes `members`
998
+ * - `Organization<true, true>` — includes both
999
+ * @public
1000
+ */
1001
+ export declare type Organization<
1002
+ IncludeMembers extends boolean = true,
1003
+ IncludeFeatures extends boolean = true,
1004
+ > = z.output<typeof Organization> &
1005
+ (IncludeMembers extends true
1006
+ ? {
1007
+ members: OrganizationMember[];
1008
+ }
1009
+ : unknown) &
1010
+ (IncludeFeatures extends true
1011
+ ? {
1012
+ features: string[];
1013
+ }
1014
+ : unknown);
1015
+
1016
+ /**
1017
+ * Organization ID schema, branded for type safety.
1018
+ * @public
1019
+ */
1020
+ export declare const OrganizationId: z.core.$ZodBranded<
1021
+ z.ZodString,
1022
+ "OrganizationId",
1023
+ "out"
1024
+ >;
1025
+
1026
+ /**
1027
+ * Organization ID type, branded for type safety.
1028
+ * @public
1029
+ */
1030
+ export declare type OrganizationId = z.output<typeof OrganizationId>;
1031
+
1032
+ /**
1033
+ * @public
1034
+ */
1035
+ export declare type OrganizationMember = z.output<typeof OrganizationMember_2>;
1036
+
1037
+ declare const OrganizationMember_2: z.ZodObject<
1038
+ {
1039
+ sanityUserId: z.ZodString;
1040
+ isCurrentUser: z.ZodBoolean;
1041
+ user: z.ZodObject<
1042
+ {
1043
+ id: z.ZodString;
1044
+ displayName: z.ZodString;
1045
+ familyName: z.ZodString;
1046
+ givenName: z.ZodString;
1047
+ middleName: z.ZodNullable<z.ZodString>;
1048
+ imageUrl: z.ZodNullable<z.ZodString>;
1049
+ email: z.ZodString;
1050
+ loginProvider: z.ZodString;
1051
+ },
1052
+ z.core.$strip
1053
+ >;
1054
+ roles: z.ZodArray<
1055
+ z.ZodObject<
1056
+ {
1057
+ name: z.ZodString;
1058
+ title: z.ZodString;
1059
+ description: z.ZodOptional<z.ZodString>;
1060
+ },
1061
+ z.core.$strip
1062
+ >
1063
+ >;
1064
+ },
1065
+ z.core.$strip
1066
+ >;
1067
+
1068
+ /**
1069
+ * @public
1070
+ */
1071
+ declare type OrganizationMember = z.output<typeof OrganizationMember_2>;
1072
+
1073
+ export { Panel };
1074
+
1075
+ export { PanelComponent };
1076
+
1077
+ /**
1078
+ * Validates and parses a raw API response into a branded
1079
+ * Canvas.
1080
+ * @public
1081
+ */
1082
+ export declare function parseCanvas(data: unknown): Canvas;
1083
+
1084
+ /**
1085
+ * Validates and parses a raw API response into a branded
1086
+ * CoreAppUserApplicationData.
1087
+ * @public
1088
+ */
1089
+ export declare function parseCoreApplication(
1090
+ data: unknown,
1091
+ ): CoreAppUserApplication;
1092
+
1093
+ /**
1094
+ * Validates and parses a raw API response into a branded
1095
+ * MediaLibrary.
1096
+ * @public
1097
+ */
1098
+ export declare function parseMediaLibrary(data: unknown): MediaLibrary;
1099
+
1100
+ /**
1101
+ * Validates and parses a raw API response into a branded
1102
+ * Organization. The options control which schema is used —
1103
+ * matching what the API returns based on query params.
1104
+ * @public
1105
+ */
1106
+ export declare function parseOrganization<
1107
+ IncludeMembers extends boolean = true,
1108
+ IncludeFeatures extends boolean = true,
1109
+ >(
1110
+ data: unknown,
1111
+ options?: {
1112
+ includeMembers?: IncludeMembers;
1113
+ includeFeatures?: IncludeFeatures;
1114
+ },
1115
+ ): Organization<IncludeMembers, IncludeFeatures>;
1116
+
1117
+ /**
1118
+ * Validates and parses a raw API response into a branded
1119
+ * Project. The options control which schema is used —
1120
+ * matching what the API returns based on query params.
1121
+ * @public
1122
+ */
1123
+ export declare function parseProject<
1124
+ IncludeMembers extends boolean = true,
1125
+ IncludeFeatures extends boolean = true,
1126
+ >(
1127
+ data: unknown,
1128
+ options?: {
1129
+ includeMembers?: IncludeMembers;
1130
+ includeFeatures?: IncludeFeatures;
1131
+ },
1132
+ ): Project<IncludeMembers, IncludeFeatures>;
1133
+
1134
+ /**
1135
+ * Validates and parses a raw API response into a branded
1136
+ * StudioUserApplication.
1137
+ * @public
1138
+ */
1139
+ export declare function parseStudioUserApplication(
1140
+ data: unknown,
1141
+ ): StudioUserApplication;
1142
+
1143
+ /**
1144
+ * Project schema — validates and brands API responses
1145
+ * from the `/projects/:id` endpoint.
1146
+ * @public
1147
+ */
1148
+ export declare const Project: z.ZodObject<
1149
+ {
1150
+ id: z.core.$ZodBranded<z.ZodString, "ProjectId", "out">;
1151
+ displayName: z.ZodString;
1152
+ studioHost: z.ZodNullable<z.ZodString>;
1153
+ organizationId: z.core.$ZodBranded<z.ZodString, "OrganizationId", "out">;
1154
+ metadata: z.ZodObject<
1155
+ {
1156
+ color: z.ZodOptional<z.ZodString>;
1157
+ externalStudioHost: z.ZodOptional<z.ZodString>;
1158
+ initialTemplate: z.ZodOptional<z.ZodString>;
1159
+ cliInitializedAt: z.ZodOptional<z.ZodString>;
1160
+ integration: z.ZodOptional<z.ZodString>;
1161
+ },
1162
+ z.core.$strip
1163
+ >;
1164
+ isBlocked: z.ZodBoolean;
1165
+ isDisabled: z.ZodBoolean;
1166
+ isDisabledByUser: z.ZodBoolean;
1167
+ activityFeedEnabled: z.ZodBoolean;
1168
+ createdAt: z.ZodString;
1169
+ updatedAt: z.ZodString;
1170
+ },
1171
+ z.core.$strip
1172
+ >;
1173
+
1174
+ /**
1175
+ * Represents a Sanity project with optional members and
1176
+ * features arrays depending on the generic parameters.
1177
+ * By default, neither members nor features are included.
1178
+ * - `Project` — base fields only (default)
1179
+ * - `Project<true>` — includes `members`
1180
+ * - `Project<true, true>` — includes both
1181
+ * @public
1182
+ */
1183
+ export declare type Project<
1184
+ IncludeMembers extends boolean = true,
1185
+ IncludeFeatures extends boolean = true,
1186
+ > = z.output<typeof Project> &
1187
+ (IncludeMembers extends true
1188
+ ? {
1189
+ members: ProjectMember[];
1190
+ }
1191
+ : unknown) &
1192
+ (IncludeFeatures extends true
1193
+ ? {
1194
+ features: string[];
1195
+ }
1196
+ : unknown);
1197
+
1198
+ /**
1199
+ * Project ID schema, branded for type safety.
1200
+ * @public
1201
+ */
1202
+ export declare const ProjectId: z.core.$ZodBranded<
1203
+ z.ZodString,
1204
+ "ProjectId",
1205
+ "out"
1206
+ >;
1207
+
1208
+ /**
1209
+ * Project ID type, branded for type safety.
1210
+ * @public
1211
+ */
1212
+ export declare type ProjectId = z.output<typeof ProjectId>;
1213
+
1214
+ /**
1215
+ * @public
1216
+ */
1217
+ export declare type ProjectMember = z.output<typeof ProjectMember_2>;
1218
+
1219
+ declare const ProjectMember_2: z.ZodObject<
1220
+ {
1221
+ id: z.ZodString;
1222
+ createdAt: z.ZodString;
1223
+ updatedAt: z.ZodString;
1224
+ isCurrentUser: z.ZodBoolean;
1225
+ isRobot: z.ZodBoolean;
1226
+ roles: z.ZodArray<
1227
+ z.ZodObject<
1228
+ {
1229
+ name: z.ZodString;
1230
+ title: z.ZodString;
1231
+ description: z.ZodString;
1232
+ },
1233
+ z.core.$strip
1234
+ >
1235
+ >;
1236
+ },
1237
+ z.core.$strip
1238
+ >;
1239
+
1240
+ /**
1241
+ * @public
1242
+ */
1243
+ declare type ProjectMember = z.output<typeof ProjectMember_2>;
1244
+
1245
+ /**
1246
+ * Options for rendering a remote module, such as a user application.
1247
+ *
1248
+ * @public
1249
+ */
1250
+ export declare interface RemoteModuleRenderOptions {
1251
+ reactStrictMode?: boolean;
1252
+ }
1253
+
1254
+ /**
1255
+ * The resolved configuration after processing
1256
+ * and validating the provided config.
1257
+ *
1258
+ * @public
1259
+ */
1260
+ export declare type ResolvedConfig = Omit<Config, "organizationId"> & {
1261
+ organizationId: OrganizationId;
1262
+ };
1263
+
1264
+ /**
1265
+ * @public
1266
+ */
1267
+ export declare const ServerManifest: z.ZodObject<
1268
+ {
1269
+ buildId: z.ZodOptional<z.ZodString>;
1270
+ bundleVersion: z.ZodOptional<z.ZodString>;
1271
+ version: z.ZodOptional<z.ZodString>;
1272
+ group: z.ZodOptional<z.ZodString>;
1273
+ priority: z.ZodOptional<z.ZodNumber>;
1274
+ workspaces: z.ZodOptional<
1275
+ z.ZodArray<
1276
+ z.ZodObject<
1277
+ {
1278
+ name: z.ZodString;
1279
+ title: z.ZodString;
1280
+ subtitle: z.ZodOptional<z.ZodString>;
1281
+ basePath: z.ZodString;
1282
+ projectId: z.core.$ZodBranded<z.ZodString, "ProjectId", "out">;
1283
+ icon: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1284
+ dataset: z.ZodString;
1285
+ schemaDescriptorId: z.ZodString;
1286
+ },
1287
+ z.core.$strip
1288
+ >
1289
+ >
1290
+ >;
1291
+ },
1292
+ z.core.$strip
1293
+ >;
1294
+
1295
+ /**
1296
+ * @public
1297
+ */
1298
+ export declare type ServerManifest = z.output<typeof ServerManifest>;
1299
+
1300
+ export { Service };
1301
+
1302
+ /**
1303
+ * @public
1304
+ */
1305
+ export declare class StudioApplication extends UserApplication<
1306
+ StudioUserApplication,
1307
+ "studio",
1308
+ never
1309
+ > {
1310
+ /**
1311
+ * Returns a list of studio workspaces based on the application manifest.
1312
+ * If there is no manifest, or alternatively it is not valid, then we create a default workspace.
1313
+ */
1314
+ readonly workspaces: readonly StudioWorkspace[];
1315
+ readonly project: Project<false, false>;
1316
+ /**
1317
+ * The projects actually referenced by this studio — the application's own
1318
+ * project plus any project used by a workspace. Preserved so the instance
1319
+ * can be re-constructed (e.g. by dock wrappers) without having to thread
1320
+ * the full organization project list through again.
1321
+ */
1322
+ readonly projects: Project<false, false>[];
1323
+ /**
1324
+ * @param application - The studio application to create a list of workspaces for
1325
+ * @param projects - The projects available in the organization. It's not enough to just pass
1326
+ * the project that associates with the application because that is the project the app is deployed in relation to.
1327
+ * The workspaces may have different projects completely.
1328
+ */
1329
+ constructor(
1330
+ application: StudioUserApplication,
1331
+ projects: Project<false, false>[],
1332
+ options?: {
1333
+ isLocal?: boolean;
1334
+ remoteApplication?: StudioApplication | null;
1335
+ },
1336
+ );
1337
+ /**
1338
+ * Factory hook called for each workspace during construction. Subclasses
1339
+ * override this to substitute a `StudioWorkspace` subclass (e.g. a UI-aware
1340
+ * variant in a downstream package) without re-implementing the constructor's
1341
+ * workspace-derivation logic.
1342
+ */
1343
+ protected createWorkspace(
1344
+ workspace: Workspace,
1345
+ project: Project<false, false>,
1346
+ isDefaultWorkspace: boolean,
1347
+ ): StudioWorkspace;
1348
+ get href(): string;
1349
+ get title(): string;
1350
+ get subtitle(): string;
1351
+ get<TKey extends keyof StudioUserApplication>(
1352
+ attr: TKey,
1353
+ ): StudioUserApplication[TKey];
1354
+ /**
1355
+ * Resolves the studio's most authoritative manifest. The lookup order is:
1356
+ *
1357
+ * 1. `activeDeployment.manifest` — deployment manifests are the new
1358
+ * primitive within Sanity and are preferred whenever available.
1359
+ * 2. `manifestData.value` — fallback to support older studios that
1360
+ * haven't produced a deployment manifest yet.
1361
+ * 3. `application.manifest` — last-resort legacy field.
1362
+ *
1363
+ * Returns `null` when no manifest is available. The return shape is a
1364
+ * union because the deployment and client manifests are not
1365
+ * interchangeable — consumers that depend on client-only fields (e.g.
1366
+ * `studioVersion`, workspace `schema`) must narrow or read the raw
1367
+ * field they need.
1368
+ */
1369
+ get manifest(): ClientManifest | ServerManifest | null;
1370
+ get hasManifest(): boolean;
1371
+ get hasSchema(): boolean;
1372
+ private resolveVersion;
1373
+ get version(): string | null;
1374
+ get compatibilityStatus(): CompatibilityStatus;
1375
+ /**
1376
+ * Used to calculate the compatibility status of a given studio application.
1377
+ * Optionally if you've resolved the version elsewhere provide that value to
1378
+ * get the new compatibility status without mutating the application.
1379
+ */
1380
+ static resolveCompatibilityStatus(
1381
+ application: StudioApplication,
1382
+ version?: string | null,
1383
+ ): CompatibilityStatus;
1384
+ get isAutoRedirecting(): boolean;
1385
+ /**
1386
+ * Mirrors the `isRedirectable` function from Saison defined in
1387
+ * https://github.com/sanity-io/saison/blob/83556405d23e07f6d3a71c76249c67e33fe1101f/src/utils/applications.ts
1388
+ *
1389
+ * Returns whether a studio application is auto-redirecting, meaning it can only be accessed in the context of
1390
+ * Dashboard.
1391
+ */
1392
+ static resolveIsAutoRedirecting(
1393
+ application: StudioApplication,
1394
+ versionArg?: string | null,
1395
+ ): boolean;
1396
+ /**
1397
+ * Returns a list of issues that prevent the studio from functioning properly in the Dashboard.
1398
+ * This static value depends on the version of the studio that comes from the `activeDeployment` property.
1399
+ * As such, if the studio is auto-updating, this list will be incorrect & instead you should use
1400
+ * the static method `resolveIssues` to get the correct issues by passing the resolved version.
1401
+ */
1402
+ get issues(): StudioIssues;
1403
+ static resolveIssues(
1404
+ application: StudioApplication,
1405
+ version?: string | null,
1406
+ ): StudioIssues;
1407
+ protected isFeatureSupported(
1408
+ feature: StudioDashboardIssue,
1409
+ version?: string | null,
1410
+ ): boolean;
1411
+ toProtocolResource(): never;
1412
+ static CompatibilityStatuses: {
1413
+ readonly UNKNOWN: "unknown";
1414
+ readonly PARTIALLY_COMPATIBLE: "partially-compatible";
1415
+ readonly FULLY_COMPATIBLE: "fully-compatible";
1416
+ };
1417
+ static StudioIssues: {
1418
+ readonly ISSUE_ACTIVITY: "ACTIVITY";
1419
+ readonly ISSUE_AGENT: "AGENT";
1420
+ readonly ISSUE_FAVORITES: "FAVORITES";
1421
+ readonly ISSUE_URL_SYNCING: "URL_SYNCING";
1422
+ readonly ISSUE_UI_ADJUSTMENT: "UI_ADJUSTMENT";
1423
+ readonly ISSUE_CONTENT_MAPPING: "CONTENT_MAPPING";
1424
+ readonly ISSUE_LOGIN: "LOGIN";
1425
+ readonly ISSUE_MANIFEST: "MANIFEST";
1426
+ };
1427
+ static Features: (
1428
+ | {
1429
+ id: "AGENT";
1430
+ version: string;
1431
+ }
1432
+ | {
1433
+ id: "FAVORITES";
1434
+ version: string;
1435
+ }
1436
+ | {
1437
+ id: "ACTIVITY";
1438
+ version: string;
1439
+ }
1440
+ | {
1441
+ id: "URL_SYNCING";
1442
+ version: string;
1443
+ }
1444
+ | {
1445
+ id: "UI_ADJUSTMENT";
1446
+ version: string;
1447
+ }
1448
+ | {
1449
+ id: "CONTENT_MAPPING";
1450
+ version: string;
1451
+ }
1452
+ | {
1453
+ id: "LOGIN";
1454
+ version: string;
1455
+ }
1456
+ )[];
1457
+ static MinimumStudioVersion: "2.28.0";
1458
+ static MinimumStudioVersionWithNoIssues: string | undefined;
1459
+ }
1460
+
1461
+ declare type StudioDashboardIssue =
1462
+ (typeof StudioApplication.StudioIssues)[keyof typeof StudioApplication.StudioIssues];
1463
+
1464
+ declare type StudioIssues = Array<{
1465
+ id: StudioDashboardIssue;
1466
+ version?: string;
1467
+ }>;
1468
+
1469
+ /**
1470
+ * Studio user application schema — validates and brands API
1471
+ * responses from the `/user-applications?appType=studio`
1472
+ * endpoint. Uses a discriminated union on `urlType`.
1473
+ * @public
1474
+ */
1475
+ export declare const StudioUserApplication: z.ZodDiscriminatedUnion<
1476
+ [
1477
+ z.ZodObject<
1478
+ {
1479
+ id: z.core.$ZodBranded<z.ZodString, "UserApplicationId", "out">;
1480
+ appHost: z.ZodString;
1481
+ createdAt: z.ZodString;
1482
+ updatedAt: z.ZodString;
1483
+ dashboardStatus: z.ZodEnum<{
1484
+ default: "default";
1485
+ disabled: "disabled";
1486
+ }>;
1487
+ interfaces: z.ZodOptional<
1488
+ z.ZodArray<
1489
+ z.ZodDiscriminatedUnion<
1490
+ [
1491
+ z.ZodObject<
1492
+ {
1493
+ interface_type: z.ZodLiteral<"panel">;
1494
+ name: z.ZodString;
1495
+ entry_point: z.ZodString;
1496
+ },
1497
+ z.core.$strip
1498
+ >,
1499
+ z.ZodObject<
1500
+ {
1501
+ interface_type: z.ZodLiteral<"worker">;
1502
+ name: z.ZodString;
1503
+ entry_point: z.ZodString;
1504
+ },
1505
+ z.core.$strip
1506
+ >,
1507
+ z.ZodObject<
1508
+ {
1509
+ interface_type: z.ZodLiteral<"app">;
1510
+ name: z.ZodString;
1511
+ entry_point: z.ZodString;
1512
+ },
1513
+ z.core.$strip
1514
+ >,
1515
+ ],
1516
+ "interface_type"
1517
+ >
1518
+ >
1519
+ >;
1520
+ title: z.ZodNullable<z.ZodString>;
1521
+ projectId: z.core.$ZodBranded<z.ZodString, "ProjectId", "out">;
1522
+ type: z.ZodLiteral<"studio">;
1523
+ manifest: z.ZodNullable<
1524
+ z.ZodObject<
1525
+ {
1526
+ version: z.ZodNumber;
1527
+ createdAt: z.ZodString;
1528
+ studioVersion: z.ZodOptional<z.ZodString>;
1529
+ group: z.ZodOptional<z.ZodString>;
1530
+ priority: z.ZodOptional<z.ZodNumber>;
1531
+ workspaces: z.ZodArray<
1532
+ z.ZodObject<
1533
+ {
1534
+ name: z.ZodString;
1535
+ title: z.ZodString;
1536
+ subtitle: z.ZodOptional<z.ZodString>;
1537
+ basePath: z.ZodString;
1538
+ projectId: z.core.$ZodBranded<
1539
+ z.ZodString,
1540
+ "ProjectId",
1541
+ "out"
1542
+ >;
1543
+ dataset: z.ZodOptional<z.ZodString>;
1544
+ icon: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1545
+ schema: z.ZodString;
1546
+ tools: z.ZodOptional<z.ZodString>;
1547
+ },
1548
+ z.core.$strip
1549
+ >
1550
+ >;
1551
+ },
1552
+ z.core.$strip
1553
+ >
1554
+ >;
1555
+ manifestData: z.ZodNullable<
1556
+ z.ZodObject<
1557
+ {
1558
+ value: z.ZodObject<
1559
+ {
1560
+ version: z.ZodNumber;
1561
+ createdAt: z.ZodString;
1562
+ studioVersion: z.ZodOptional<z.ZodString>;
1563
+ group: z.ZodOptional<z.ZodString>;
1564
+ priority: z.ZodOptional<z.ZodNumber>;
1565
+ workspaces: z.ZodArray<
1566
+ z.ZodObject<
1567
+ {
1568
+ name: z.ZodString;
1569
+ title: z.ZodString;
1570
+ subtitle: z.ZodOptional<z.ZodString>;
1571
+ basePath: z.ZodString;
1572
+ projectId: z.core.$ZodBranded<
1573
+ z.ZodString,
1574
+ "ProjectId",
1575
+ "out"
1576
+ >;
1577
+ dataset: z.ZodOptional<z.ZodString>;
1578
+ icon: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1579
+ schema: z.ZodString;
1580
+ tools: z.ZodOptional<z.ZodString>;
1581
+ },
1582
+ z.core.$strip
1583
+ >
1584
+ >;
1585
+ },
1586
+ z.core.$strip
1587
+ >;
1588
+ },
1589
+ z.core.$strip
1590
+ >
1591
+ >;
1592
+ autoUpdatingVersion: z.ZodNullable<z.ZodString>;
1593
+ config: z.ZodObject<
1594
+ {
1595
+ "live-manifest": z.ZodOptional<
1596
+ z.ZodObject<
1597
+ {
1598
+ createdAt: z.ZodString;
1599
+ updatedAt: z.ZodString;
1600
+ updatedBy: z.ZodString;
1601
+ value: z.ZodObject<
1602
+ {
1603
+ buildId: z.ZodOptional<z.ZodString>;
1604
+ bundleVersion: z.ZodOptional<z.ZodString>;
1605
+ version: z.ZodOptional<z.ZodString>;
1606
+ group: z.ZodOptional<z.ZodString>;
1607
+ priority: z.ZodOptional<z.ZodNumber>;
1608
+ workspaces: z.ZodOptional<
1609
+ z.ZodArray<
1610
+ z.ZodObject<
1611
+ {
1612
+ name: z.ZodString;
1613
+ title: z.ZodString;
1614
+ subtitle: z.ZodOptional<z.ZodString>;
1615
+ basePath: z.ZodString;
1616
+ projectId: z.core.$ZodBranded<
1617
+ z.ZodString,
1618
+ "ProjectId",
1619
+ "out"
1620
+ >;
1621
+ icon: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1622
+ dataset: z.ZodString;
1623
+ schemaDescriptorId: z.ZodString;
1624
+ },
1625
+ z.core.$strip
1626
+ >
1627
+ >
1628
+ >;
1629
+ },
1630
+ z.core.$strip
1631
+ >;
1632
+ },
1633
+ z.core.$strip
1634
+ >
1635
+ >;
1636
+ },
1637
+ z.core.$strip
1638
+ >;
1639
+ urlType: z.ZodLiteral<"internal">;
1640
+ activeDeployment: z.ZodNullable<
1641
+ z.ZodObject<
1642
+ {
1643
+ id: z.ZodString;
1644
+ version: z.ZodString;
1645
+ isActiveDeployment: z.ZodBoolean;
1646
+ userApplicationId: z.ZodString;
1647
+ isAutoUpdating: z.ZodBoolean;
1648
+ size: z.ZodNumber;
1649
+ deployedAt: z.ZodString;
1650
+ deployedBy: z.ZodString;
1651
+ createdAt: z.ZodString;
1652
+ updatedAt: z.ZodString;
1653
+ manifest: z.ZodNullable<
1654
+ z.ZodObject<
1655
+ {
1656
+ buildId: z.ZodOptional<z.ZodString>;
1657
+ bundleVersion: z.ZodOptional<z.ZodString>;
1658
+ version: z.ZodOptional<z.ZodString>;
1659
+ group: z.ZodOptional<z.ZodString>;
1660
+ priority: z.ZodOptional<z.ZodNumber>;
1661
+ workspaces: z.ZodOptional<
1662
+ z.ZodArray<
1663
+ z.ZodObject<
1664
+ {
1665
+ name: z.ZodString;
1666
+ title: z.ZodString;
1667
+ subtitle: z.ZodOptional<z.ZodString>;
1668
+ basePath: z.ZodString;
1669
+ projectId: z.core.$ZodBranded<
1670
+ z.ZodString,
1671
+ "ProjectId",
1672
+ "out"
1673
+ >;
1674
+ icon: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1675
+ dataset: z.ZodString;
1676
+ schemaDescriptorId: z.ZodString;
1677
+ },
1678
+ z.core.$strip
1679
+ >
1680
+ >
1681
+ >;
1682
+ },
1683
+ z.core.$strip
1684
+ >
1685
+ >;
1686
+ },
1687
+ z.core.$strip
1688
+ >
1689
+ >;
1690
+ },
1691
+ z.core.$strip
1692
+ >,
1693
+ z.ZodObject<
1694
+ {
1695
+ id: z.core.$ZodBranded<z.ZodString, "UserApplicationId", "out">;
1696
+ appHost: z.ZodString;
1697
+ createdAt: z.ZodString;
1698
+ updatedAt: z.ZodString;
1699
+ dashboardStatus: z.ZodEnum<{
1700
+ default: "default";
1701
+ disabled: "disabled";
1702
+ }>;
1703
+ interfaces: z.ZodOptional<
1704
+ z.ZodArray<
1705
+ z.ZodDiscriminatedUnion<
1706
+ [
1707
+ z.ZodObject<
1708
+ {
1709
+ interface_type: z.ZodLiteral<"panel">;
1710
+ name: z.ZodString;
1711
+ entry_point: z.ZodString;
1712
+ },
1713
+ z.core.$strip
1714
+ >,
1715
+ z.ZodObject<
1716
+ {
1717
+ interface_type: z.ZodLiteral<"worker">;
1718
+ name: z.ZodString;
1719
+ entry_point: z.ZodString;
1720
+ },
1721
+ z.core.$strip
1722
+ >,
1723
+ z.ZodObject<
1724
+ {
1725
+ interface_type: z.ZodLiteral<"app">;
1726
+ name: z.ZodString;
1727
+ entry_point: z.ZodString;
1728
+ },
1729
+ z.core.$strip
1730
+ >,
1731
+ ],
1732
+ "interface_type"
1733
+ >
1734
+ >
1735
+ >;
1736
+ title: z.ZodNullable<z.ZodString>;
1737
+ projectId: z.core.$ZodBranded<z.ZodString, "ProjectId", "out">;
1738
+ type: z.ZodLiteral<"studio">;
1739
+ manifest: z.ZodNullable<
1740
+ z.ZodObject<
1741
+ {
1742
+ version: z.ZodNumber;
1743
+ createdAt: z.ZodString;
1744
+ studioVersion: z.ZodOptional<z.ZodString>;
1745
+ group: z.ZodOptional<z.ZodString>;
1746
+ priority: z.ZodOptional<z.ZodNumber>;
1747
+ workspaces: z.ZodArray<
1748
+ z.ZodObject<
1749
+ {
1750
+ name: z.ZodString;
1751
+ title: z.ZodString;
1752
+ subtitle: z.ZodOptional<z.ZodString>;
1753
+ basePath: z.ZodString;
1754
+ projectId: z.core.$ZodBranded<
1755
+ z.ZodString,
1756
+ "ProjectId",
1757
+ "out"
1758
+ >;
1759
+ dataset: z.ZodOptional<z.ZodString>;
1760
+ icon: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1761
+ schema: z.ZodString;
1762
+ tools: z.ZodOptional<z.ZodString>;
1763
+ },
1764
+ z.core.$strip
1765
+ >
1766
+ >;
1767
+ },
1768
+ z.core.$strip
1769
+ >
1770
+ >;
1771
+ manifestData: z.ZodNullable<
1772
+ z.ZodObject<
1773
+ {
1774
+ value: z.ZodObject<
1775
+ {
1776
+ version: z.ZodNumber;
1777
+ createdAt: z.ZodString;
1778
+ studioVersion: z.ZodOptional<z.ZodString>;
1779
+ group: z.ZodOptional<z.ZodString>;
1780
+ priority: z.ZodOptional<z.ZodNumber>;
1781
+ workspaces: z.ZodArray<
1782
+ z.ZodObject<
1783
+ {
1784
+ name: z.ZodString;
1785
+ title: z.ZodString;
1786
+ subtitle: z.ZodOptional<z.ZodString>;
1787
+ basePath: z.ZodString;
1788
+ projectId: z.core.$ZodBranded<
1789
+ z.ZodString,
1790
+ "ProjectId",
1791
+ "out"
1792
+ >;
1793
+ dataset: z.ZodOptional<z.ZodString>;
1794
+ icon: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1795
+ schema: z.ZodString;
1796
+ tools: z.ZodOptional<z.ZodString>;
1797
+ },
1798
+ z.core.$strip
1799
+ >
1800
+ >;
1801
+ },
1802
+ z.core.$strip
1803
+ >;
1804
+ },
1805
+ z.core.$strip
1806
+ >
1807
+ >;
1808
+ autoUpdatingVersion: z.ZodNullable<z.ZodString>;
1809
+ config: z.ZodObject<
1810
+ {
1811
+ "live-manifest": z.ZodOptional<
1812
+ z.ZodObject<
1813
+ {
1814
+ createdAt: z.ZodString;
1815
+ updatedAt: z.ZodString;
1816
+ updatedBy: z.ZodString;
1817
+ value: z.ZodObject<
1818
+ {
1819
+ buildId: z.ZodOptional<z.ZodString>;
1820
+ bundleVersion: z.ZodOptional<z.ZodString>;
1821
+ version: z.ZodOptional<z.ZodString>;
1822
+ group: z.ZodOptional<z.ZodString>;
1823
+ priority: z.ZodOptional<z.ZodNumber>;
1824
+ workspaces: z.ZodOptional<
1825
+ z.ZodArray<
1826
+ z.ZodObject<
1827
+ {
1828
+ name: z.ZodString;
1829
+ title: z.ZodString;
1830
+ subtitle: z.ZodOptional<z.ZodString>;
1831
+ basePath: z.ZodString;
1832
+ projectId: z.core.$ZodBranded<
1833
+ z.ZodString,
1834
+ "ProjectId",
1835
+ "out"
1836
+ >;
1837
+ icon: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1838
+ dataset: z.ZodString;
1839
+ schemaDescriptorId: z.ZodString;
1840
+ },
1841
+ z.core.$strip
1842
+ >
1843
+ >
1844
+ >;
1845
+ },
1846
+ z.core.$strip
1847
+ >;
1848
+ },
1849
+ z.core.$strip
1850
+ >
1851
+ >;
1852
+ },
1853
+ z.core.$strip
1854
+ >;
1855
+ urlType: z.ZodLiteral<"external">;
1856
+ activeDeployment: z.ZodNullable<
1857
+ z.ZodObject<
1858
+ {
1859
+ id: z.ZodString;
1860
+ version: z.ZodString;
1861
+ isActiveDeployment: z.ZodBoolean;
1862
+ userApplicationId: z.ZodString;
1863
+ isAutoUpdating: z.ZodBoolean;
1864
+ size: z.ZodNumber;
1865
+ deployedAt: z.ZodString;
1866
+ deployedBy: z.ZodString;
1867
+ createdAt: z.ZodString;
1868
+ updatedAt: z.ZodString;
1869
+ manifest: z.ZodNullable<
1870
+ z.ZodObject<
1871
+ {
1872
+ buildId: z.ZodOptional<z.ZodString>;
1873
+ bundleVersion: z.ZodOptional<z.ZodString>;
1874
+ version: z.ZodOptional<z.ZodString>;
1875
+ group: z.ZodOptional<z.ZodString>;
1876
+ priority: z.ZodOptional<z.ZodNumber>;
1877
+ workspaces: z.ZodOptional<
1878
+ z.ZodArray<
1879
+ z.ZodObject<
1880
+ {
1881
+ name: z.ZodString;
1882
+ title: z.ZodString;
1883
+ subtitle: z.ZodOptional<z.ZodString>;
1884
+ basePath: z.ZodString;
1885
+ projectId: z.core.$ZodBranded<
1886
+ z.ZodString,
1887
+ "ProjectId",
1888
+ "out"
1889
+ >;
1890
+ icon: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1891
+ dataset: z.ZodString;
1892
+ schemaDescriptorId: z.ZodString;
1893
+ },
1894
+ z.core.$strip
1895
+ >
1896
+ >
1897
+ >;
1898
+ },
1899
+ z.core.$strip
1900
+ >
1901
+ >;
1902
+ },
1903
+ z.core.$strip
1904
+ >
1905
+ >;
1906
+ },
1907
+ z.core.$strip
1908
+ >,
1909
+ ],
1910
+ "urlType"
1911
+ >;
1912
+
1913
+ /**
1914
+ * @public
1915
+ */
1916
+ export declare type StudioUserApplication = z.output<
1917
+ typeof StudioUserApplication
1918
+ >;
1919
+
1920
+ /**
1921
+ * @public
1922
+ */
1923
+ export declare class StudioWorkspace extends AbstractApplication<
1924
+ "workspace",
1925
+ StudioResource
1926
+ > {
1927
+ /**
1928
+ * Workspaces always belong to a studio application.
1929
+ * They do not exist on their own & therefore can access
1930
+ * information about the studio they're in via this property.
1931
+ */
1932
+ private readonly studioApplication;
1933
+ private readonly workspace;
1934
+ readonly project: Project<false, false>;
1935
+ private readonly isDefaultWorkspace;
1936
+ constructor(
1937
+ studioApplication: StudioApplication,
1938
+ workspace: Workspace,
1939
+ project: Project<false, false>,
1940
+ isDefaultWorkspace: boolean,
1941
+ );
1942
+ /**
1943
+ * The studio application that this workspace belongs to.
1944
+ */
1945
+ get studio(): StudioApplication;
1946
+ get id(): string;
1947
+ get href(): string;
1948
+ get title(): string;
1949
+ get subtitle(): string | undefined;
1950
+ get<TKey extends Exclude<keyof Workspace, "id" | "icon" | "title">>(
1951
+ attr: TKey,
1952
+ ): Workspace[TKey];
1953
+ get isFederated(): boolean;
1954
+ /**
1955
+ * With comlink, studio-applications were not considered applications at all, only workspaces. This is partially why
1956
+ * we create default workspaces when the application has no manifest or the manifest has no workspaces.
1957
+ *
1958
+ * Thereby, to create it we depend on a lot of information from the parent application even if it's duplicated across
1959
+ * different workspaces.
1960
+ */
1961
+ toProtocolResource(): StudioResource;
1962
+ /**
1963
+ * @returns the URL to the workspace of a studio application.
1964
+ */
1965
+ get url(): URL;
1966
+ static makeId(
1967
+ applicationId: UserApplicationId,
1968
+ workspaceName: string,
1969
+ ): string;
1970
+ static splitId(id: string): [string, string];
1971
+ }
1972
+
1973
+ /**
1974
+ * @public
1975
+ */
1976
+ export declare abstract class UserApplication<
1977
+ TUserApplication extends UserApplicationBase,
1978
+ TType extends Extract<AbstractApplicationType, "coreApp" | "studio">,
1979
+ TProtocolResource extends Resource = Extract<
1980
+ Resource,
1981
+ {
1982
+ type: TType;
1983
+ }
1984
+ >,
1985
+ > extends AbstractApplication<TType, TProtocolResource> {
1986
+ #private;
1987
+ readonly application: TUserApplication;
1988
+ readonly id: UserApplicationId;
1989
+ /**
1990
+ * For local applications (`isLocal === true`), the deployed application
1991
+ * that shares the same `id` — if one was passed at construction. `null`
1992
+ * for deployed applications or when no remote twin was provided.
1993
+ */
1994
+ readonly remoteApplication: this | null;
1995
+ constructor(
1996
+ application: TUserApplication,
1997
+ type: TType,
1998
+ options?: {
1999
+ isLocal?: boolean;
2000
+ remoteApplication?: UserApplication<
2001
+ TUserApplication,
2002
+ TType,
2003
+ TProtocolResource
2004
+ > | null;
2005
+ },
2006
+ );
2007
+ abstract get subtitle(): string | undefined;
2008
+ /**
2009
+ * Local dev servers are rendered as federated remotes; deployed applications
2010
+ * are rendered in an iframe.
2011
+ */
2012
+ get isFederated(): boolean;
2013
+ get isLocal(): boolean;
2014
+ get interfaces(): readonly LocalInterface[];
2015
+ /**
2016
+ * @returns A fully resolved URL instance for the application.
2017
+ * For internal applications, constructs a URL using the Sanity studio domain
2018
+ * pattern resolved from the environment at the consuming app's build time.
2019
+ * For external applications (including local dev servers), returns the
2020
+ * provided app host as a URL.
2021
+ */
2022
+ get url(): URL;
2023
+ /**
2024
+ * Unified manifest accessor for user applications. Resolves the most
2025
+ * authoritative manifest available for the application, preferring the
2026
+ * deployment manifest (`activeDeployment.manifest`) before falling back to
2027
+ * any client-side manifest. The returned shape depends on the application
2028
+ * type and source: studios may yield either a `ServerManifest` (deployment)
2029
+ * or a `ClientManifest` (fallback); core apps yield a
2030
+ * `CoreAppUserApplicationManifest`. Returns `null` when no manifest is
2031
+ * available.
2032
+ */
2033
+ abstract get manifest():
2034
+ | ClientManifest
2035
+ | ServerManifest
2036
+ | CoreAppUserApplicationManifest
2037
+ | null;
2038
+ }
2039
+
2040
+ /**
2041
+ * @public
2042
+ */
2043
+ export declare const UserApplicationBase: z.ZodObject<
2044
+ {
2045
+ id: z.core.$ZodBranded<z.ZodString, "UserApplicationId", "out">;
2046
+ appHost: z.ZodString;
2047
+ urlType: z.ZodEnum<{
2048
+ internal: "internal";
2049
+ external: "external";
2050
+ }>;
2051
+ createdAt: z.ZodString;
2052
+ updatedAt: z.ZodString;
2053
+ dashboardStatus: z.ZodEnum<{
2054
+ default: "default";
2055
+ disabled: "disabled";
2056
+ }>;
2057
+ interfaces: z.ZodOptional<
2058
+ z.ZodArray<
2059
+ z.ZodDiscriminatedUnion<
2060
+ [
2061
+ z.ZodObject<
2062
+ {
2063
+ interface_type: z.ZodLiteral<"panel">;
2064
+ name: z.ZodString;
2065
+ entry_point: z.ZodString;
2066
+ },
2067
+ z.core.$strip
2068
+ >,
2069
+ z.ZodObject<
2070
+ {
2071
+ interface_type: z.ZodLiteral<"worker">;
2072
+ name: z.ZodString;
2073
+ entry_point: z.ZodString;
2074
+ },
2075
+ z.core.$strip
2076
+ >,
2077
+ z.ZodObject<
2078
+ {
2079
+ interface_type: z.ZodLiteral<"app">;
2080
+ name: z.ZodString;
2081
+ entry_point: z.ZodString;
2082
+ },
2083
+ z.core.$strip
2084
+ >,
2085
+ ],
2086
+ "interface_type"
2087
+ >
2088
+ >
2089
+ >;
2090
+ },
2091
+ z.core.$strip
2092
+ >;
2093
+
2094
+ /**
2095
+ * @public
2096
+ */
2097
+ export declare type UserApplicationBase = z.output<typeof UserApplicationBase>;
2098
+
2099
+ /**
2100
+ * User application ID schema, branded for type safety.
2101
+ * @public
2102
+ */
2103
+ export declare const UserApplicationId: z.core.$ZodBranded<
2104
+ z.ZodString,
2105
+ "UserApplicationId",
2106
+ "out"
2107
+ >;
2108
+
2109
+ /**
2110
+ * User application ID type, branded for type safety.
2111
+ * @public
2112
+ */
2113
+ export declare type UserApplicationId = z.output<typeof UserApplicationId>;
2114
+
2115
+ /**
2116
+ * @public
2117
+ */
2118
+ export declare type Workspace = z.output<typeof Workspace_2>;
2119
+
2120
+ declare const Workspace_2: z.ZodObject<
2121
+ {
2122
+ name: z.ZodString;
2123
+ title: z.ZodString;
2124
+ subtitle: z.ZodOptional<z.ZodString>;
2125
+ basePath: z.ZodString;
2126
+ projectId: z.core.$ZodBranded<z.ZodString, "ProjectId", "out">;
2127
+ dataset: z.ZodOptional<z.ZodString>;
2128
+ icon: z.ZodOptional<z.ZodNullable<z.ZodString>>;
2129
+ },
2130
+ z.core.$strip
2131
+ >;
2132
+
2133
+ /**
2134
+ * @public
2135
+ */
2136
+ declare type Workspace = z.output<typeof Workspace_2>;
2137
+
2138
+ export {};