import { z } from "zod"; import { ColorHueKey } from "@sanity/color"; /** * Returns the text and color for an identity marker. Hashing the id keeps its * color stable across sessions and across every surface that draws it. * Initials are at most two upper-cased characters. Names carry punctuation and * digits ("7-Eleven", "0xHoldings"), which a plain whitespace split reduces to * "7" or to nothing at all. * @public */ declare function getInitials({ id, name }: { id: string; name: string; }): { initials: string; color: ColorHueKey; }; /** * A tile's footprint family — the shape it occupies on the dashboard. Not a * linear scale (`banner` is full-width and shallow), so it's an enum, not a * magnitude. The dashboard maps a family to a layout slot. * @public */ type TileSize = "small" | "large" | "banner"; /** * The shape the workbench renders from — a `panel` renders in the dock, a * `worker` runs a background service, an `app` is the navigable full-page view. * @public */ declare const InterfaceSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{ id: z.ZodString; name: z.ZodString; title: z.ZodString; version: z.ZodOptional; moduleId: z.ZodString; type: z.ZodLiteral<"panel">; }, z.core.$strip>, z.ZodObject<{ id: z.ZodString; name: z.ZodString; title: z.ZodString; version: z.ZodOptional; moduleId: z.ZodString; type: z.ZodLiteral<"worker">; }, z.core.$strip>, z.ZodObject<{ id: z.ZodString; name: z.ZodString; title: z.ZodString; version: z.ZodOptional; moduleId: z.ZodString; type: z.ZodLiteral<"asset_source">; }, z.core.$strip>, z.ZodObject<{ id: z.ZodString; name: z.ZodString; title: z.ZodString; version: z.ZodOptional; moduleId: z.ZodString; type: z.ZodLiteral<"tile">; metadata: z.ZodObject<{ priority: z.ZodOptional; size: z.ZodEnum<{ banner: "banner"; large: "large"; small: "small"; }>; }, z.core.$strip>; }, z.core.$strip>, z.ZodObject<{ id: z.ZodString; name: z.ZodString; title: z.ZodString; version: z.ZodOptional; moduleId: z.ZodString; type: z.ZodLiteral<"app">; metadata: z.ZodNullable; priority: z.ZodOptional; }, z.core.$strip>>; }, z.core.$strip>], "type">; /** @public */ type Interface = z.output; /** The interface record for a given `type`. @public */ type InterfaceOfType = Extract; /** * What `interfaces(type?)` returns: narrowed to `type`, or every interface when * `type` is omitted or `undefined` — so a caller can forward an optional type * through without branching on it. * @public */ type InterfacesOf = readonly (T extends Interface["type"] ? InterfaceOfType : Interface)[]; /** @public */ type Panel = InterfaceOfType<"panel">; /** * The interface a local CLI dev server forwards — a deployed interface plus the * `src` file it serves. The create-from-local helpers strip `src` to read it as * an {@link Interface}. * @public */ declare const LocalInterfaceSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{ id: z.ZodString; name: z.ZodString; title: z.ZodString; version: z.ZodOptional; moduleId: z.ZodString; type: z.ZodLiteral<"panel">; src: z.ZodString; }, z.core.$strip>, z.ZodObject<{ id: z.ZodString; name: z.ZodString; title: z.ZodString; version: z.ZodOptional; moduleId: z.ZodString; type: z.ZodLiteral<"worker">; src: z.ZodString; }, z.core.$strip>, z.ZodObject<{ id: z.ZodString; name: z.ZodString; title: z.ZodString; version: z.ZodOptional; moduleId: z.ZodString; type: z.ZodLiteral<"asset_source">; src: z.ZodString; }, z.core.$strip>, z.ZodObject<{ id: z.ZodString; name: z.ZodString; title: z.ZodString; version: z.ZodOptional; moduleId: z.ZodString; type: z.ZodLiteral<"tile">; metadata: z.ZodObject<{ priority: z.ZodOptional; size: z.ZodEnum<{ banner: "banner"; large: "large"; small: "small"; }>; }, z.core.$strip>; src: z.ZodString; }, z.core.$strip>, z.ZodObject<{ id: z.ZodString; name: z.ZodString; title: z.ZodString; version: z.ZodOptional; moduleId: z.ZodString; type: z.ZodLiteral<"app">; metadata: z.ZodNullable; priority: z.ZodOptional; }, z.core.$strip>>; src: z.ZodString; }, z.core.$strip>], "type">; /** @public */ type LocalInterface = z.output; /** * A panel's view-component slots, in render order — each its own federation * island (`${id}/views/${name}/${component}`). * @public */ type PanelComponent = "title" | "panel"; /** * Where an application docks — the `group` value the workbench reads to place an * app in the dock. * @public */ type DockGroup = "dock.system" | "dock.applications" | "dock.user"; /** * Raw data for a local application discovered by the CLI dev server. * * The CLI forwards the full studio or app manifest so the workbench can * derive icons, titles, workspaces and schema references the same way it * does for deployed applications. The manifest shape is discriminated on * `type`: studios receive a `LocalStudioApplicationManifest`, core apps a `LocalCoreApplicationManifest`. * * When set on an application, `isLocal` is `true` and `url`/`isFederated` * honour the local dev-server instead of the deployed application's host. * * @public */ declare const LocalApplication: z.ZodDiscriminatedUnion<[z.ZodObject<{ host: z.ZodString; port: z.ZodNumber; interfaces: z.ZodOptional; moduleId: z.ZodString; type: z.ZodLiteral<"panel">; src: z.ZodString; }, z.core.$strip>, z.ZodObject<{ id: z.ZodString; name: z.ZodString; title: z.ZodString; version: z.ZodOptional; moduleId: z.ZodString; type: z.ZodLiteral<"worker">; src: z.ZodString; }, z.core.$strip>, z.ZodObject<{ id: z.ZodString; name: z.ZodString; title: z.ZodString; version: z.ZodOptional; moduleId: z.ZodString; type: z.ZodLiteral<"asset_source">; src: z.ZodString; }, z.core.$strip>, z.ZodObject<{ id: z.ZodString; name: z.ZodString; title: z.ZodString; version: z.ZodOptional; moduleId: z.ZodString; type: z.ZodLiteral<"tile">; metadata: z.ZodObject<{ priority: z.ZodOptional; size: z.ZodEnum<{ banner: "banner"; large: "large"; small: "small"; }>; }, z.core.$strip>; src: z.ZodString; }, z.core.$strip>, z.ZodObject<{ id: z.ZodString; name: z.ZodString; title: z.ZodString; version: z.ZodOptional; moduleId: z.ZodString; type: z.ZodLiteral<"app">; metadata: z.ZodNullable; priority: z.ZodOptional; }, z.core.$strip>>; src: z.ZodString; }, z.core.$strip>], "type">>>; id: z.ZodString; name: z.ZodString; reference: z.ZodString; projectId: z.ZodOptional; type: z.ZodLiteral<"studio">; manifest: z.ZodOptional; icon?: string | null | undefined; dataset: string; schema: string; tools?: string | undefined; }[]; }, { version: number; createdAt: string; studioVersion?: string | undefined; workspaces: { name: string; title: string; subtitle?: string | null | undefined; basePath: string; projectId: string & z.$brand<"ProjectId">; icon?: string | null | undefined; dataset: string; schema: string; tools?: string | undefined; }[]; }>>; }, z.core.$strip>, z.ZodObject<{ host: z.ZodString; port: z.ZodNumber; interfaces: z.ZodOptional; moduleId: z.ZodString; type: z.ZodLiteral<"panel">; src: z.ZodString; }, z.core.$strip>, z.ZodObject<{ id: z.ZodString; name: z.ZodString; title: z.ZodString; version: z.ZodOptional; moduleId: z.ZodString; type: z.ZodLiteral<"worker">; src: z.ZodString; }, z.core.$strip>, z.ZodObject<{ id: z.ZodString; name: z.ZodString; title: z.ZodString; version: z.ZodOptional; moduleId: z.ZodString; type: z.ZodLiteral<"asset_source">; src: z.ZodString; }, z.core.$strip>, z.ZodObject<{ id: z.ZodString; name: z.ZodString; title: z.ZodString; version: z.ZodOptional; moduleId: z.ZodString; type: z.ZodLiteral<"tile">; metadata: z.ZodObject<{ priority: z.ZodOptional; size: z.ZodEnum<{ banner: "banner"; large: "large"; small: "small"; }>; }, z.core.$strip>; src: z.ZodString; }, z.core.$strip>, z.ZodObject<{ id: z.ZodString; name: z.ZodString; title: z.ZodString; version: z.ZodOptional; moduleId: z.ZodString; type: z.ZodLiteral<"app">; metadata: z.ZodNullable; priority: z.ZodOptional; }, z.core.$strip>>; src: z.ZodString; }, z.core.$strip>], "type">>>; id: z.ZodString; name: z.ZodString; reference: z.ZodString; projectId: z.ZodOptional; type: z.ZodLiteral<"coreApp">; manifest: z.ZodOptional>; }, z.core.$strip>], "type">; /** * @public */ type LocalApplication = z.output; /** * @public */ type AbstractApplicationType = "studio" | "coreApp" | "canvas" | "media-library" | "workspace"; /** * A description a renderer turns into markup, so drawing an application's icon * needs no dispatch on `app.type` and this stays framework-agnostic enough to * live in `core`. Callers add the dev overlay from `isLocal`. * @public */ type IconDescriptor = { variant: "image"; svg: string; } | { variant: "avatar"; initials: string; color: ReturnType["color"]; }; /** * One loadable expose of an interface, flattened with everything a consumer * needs to load it into its own module-federation instance (`registerRemotes` * then `loadRemote`) — self-contained and clone-safe. A discriminated union on * `type`, mirroring {@link Interface}: narrow to a `tile` (or `app`) and its * `metadata` comes with it, while the metadata-less types never carry the field. * A multi-component view (a panel) yields one of these per component. Produced * by {@link AbstractApplication.resolvedInterfaces}. * @public */ type ResolvedInterface = { [TType in Interface["type"]]: Readonly, "id" | "version" | "moduleId">> & { /** The owning app — the remote name to `registerRemotes` under. */ readonly appId: string; /** The remote entry to `registerRemotes` with — the owning app's origin. */ readonly entry: string; /** * The module id a consumer `loadRemote`s — `${appId}/${moduleId}`, with a * `/${component}` slot appended for a view island. */ readonly moduleId: string; }; }[Interface["type"]]; /** The resolved ref for a given interface `type`. @public */ type ResolvedInterfaceOfType = Extract; /** * What `resolvedInterfaces(type?)` returns: narrowed to `type` (so a `tile`'s * `metadata` is in hand without a second lookup), or every resolved ref when * `type` is omitted — the {@link InterfacesOf} mirror for resolved refs. * @public */ type ResolvedInterfacesOf = readonly (T extends Interface["type"] ? ResolvedInterfaceOfType : ResolvedInterface)[]; /** * @public */ declare abstract class AbstractApplication { readonly type: TType; constructor(type: TType); /** * The in-app route this application navigates to, or `null` when it isn't * navigable as a full-page app (US5, spec 002-workbench-extension-api — e.g. an SDK app with no `app` view). * The dock renders a navigable item only for a non-null `href`; the app * routes 404 a `null`-href app on direct visit. */ abstract get href(): string | null; abstract get title(): string; abstract get id(): string; /** Hashed off the id, so the fallback hue is stable across sessions. */ get avatarColor(): ReturnType["color"]; /** * Whether the application is federated or not. This is used to determine * if the application should be rendered in an iframe or not. */ abstract get isFederated(): boolean; /** * Whether the application is served by a local CLI dev server rather than a * deployed remote. Defaults to `false`; applications flip this when * constructed from a `LocalApplication` payload. */ get isLocal(): boolean; abstract get url(): URL; /** * Interfaces the application exposes (e.g. dock panels) — all of them, or * only those of the given `type`. Defaults to none; applications * surface what they declared via `unstable_defineApp`. */ interfaces(_type?: T): InterfacesOf; /** * Whether the application has a navigable full-page `app` view (US5, spec 002-workbench-extension-api). Defaults * to `true` — studios, Canvas, and Media Library are always navigable. An SDK * app overrides this to derive it from whether it declares an `app` interface. */ get hasAppView(): boolean; /** * Federation module id of the app's full-page view, or `null` when it can't * be federation-loaded: the app isn't federated (Canvas, Media Library, * deployed apps shown in an iframe) or has no app view. Only a non-null * `moduleId` is fetched and rendered by the remotes machine. */ get moduleId(): string | null; /** * Federation module id of one of this app's panel view components, or `null` * when the app isn't federated (a non-federated app's panels can't be loaded * as remotes). */ resolveViewModuleId(view: Panel, component: PanelComponent): string | null; /** * Every interface this app exposes, each flattened into a self-contained, * loadable {@link ResolvedInterface} — the app's remote `entry`, the * `moduleId` a consumer `loadRemote`s, and the interface's identity — or only * those of the given `type`. A view yields one ref per component slot; an * `app` view or `worker` service yields a single ref. Empty when the app * can't be federation-loaded (an iframe app). A consumer loads each into its * own federation instance the way the workbench loads its own remotes. */ resolvedInterfaces(type?: T): ResolvedInterfacesOf; get initials(): string; } /** * Canvas ID schema, branded for type safety. * @public */ declare const CanvasIdSchema: z.core.$ZodBranded; /** * Canvas ID type, branded for type safety. * @public */ type CanvasId = z.output; /** * Validates and brands a string as a CanvasId. * @public */ declare function brandCanvasId(id: string): CanvasId; declare const CanvasSchema: z.ZodObject<{ id: z.core.$ZodBranded; organizationId: z.core.$ZodBranded; status: z.ZodEnum<{ active: "active"; provisioning: "provisioning"; }>; }, z.core.$strip>; /** * Represents a Canvas resource as returned from the API. * @public */ type Canvas = z.output; /** * Validates and parses a raw API response into a branded * Canvas. * @public */ declare function parseCanvas(data: unknown): Canvas; /** * Whilst the constructor takes an organization's canvas resource the existance * therefore implies the organization has access to the canvas application which * is what workbench most importantly wants to know. * @public */ declare class CanvasApplication extends AbstractApplication<"canvas"> { readonly canvas: Canvas; constructor(canvas: Canvas); get id(): CanvasId; get href(): string; get title(): string; get url(): URL; get isFederated(): boolean; get icon(): IconDescriptor; } /** * Organization ID schema, branded for type safety. * @public */ declare const OrganizationId: z.core.$ZodBranded; /** * Organization ID type, branded for type safety. * @public */ type OrganizationId = z.output; /** * Validates and brands a string as an OrganizationId. * @public */ declare function brandOrganizationId(id: string): OrganizationId; declare const OrganizationMemberSchema: z.ZodObject<{ sanityUserId: z.ZodString; isCurrentUser: z.ZodBoolean; user: z.ZodObject<{ id: z.ZodString; displayName: z.ZodString; familyName: z.ZodString; givenName: z.ZodString; middleName: z.ZodNullable; imageUrl: z.ZodNullable; email: z.ZodString; loginProvider: z.ZodString; }, z.core.$strip>; roles: z.ZodArray; }, z.core.$strip>>; }, z.core.$strip>; /** * @public */ type OrganizationMember = z.output; /** * Organization schema — validates and brands API responses * from the `/organizations/:id` endpoint. * @public */ declare const Organization: z.ZodObject<{ id: z.core.$ZodBranded; name: z.ZodString; slug: z.ZodNullable; createdAt: z.ZodString; updatedAt: z.ZodString; dashboardStatus: z.ZodEnum<{ disabled: "disabled"; enabled: "enabled"; }>; aiFeaturesStatus: z.ZodEnum<{ disabled: "disabled"; enabled: "enabled"; }>; defaultRoleName: z.ZodNullable; }, z.core.$strip>; /** * Represents an organization with optional members and * features arrays depending on the generic parameters. * - `Organization` — base fields only (default) * - `Organization` — includes `members` * - `Organization` — includes both * @public */ type Organization = z.output & (IncludeMembers extends true ? { members: OrganizationMember[]; } : unknown) & (IncludeFeatures extends true ? { features: string[]; } : unknown); /** * Validates and parses a raw API response into a branded * Organization. The options control which schema is used — * matching what the API returns based on query params. * @public */ declare function parseOrganization(data: unknown, options?: { includeMembers?: IncludeMembers; includeFeatures?: IncludeFeatures; }): Organization; /** * A reference to a versioned module on a federation remote — the shape a topic * uses to hand a consumer a module it loads itself, through its own federation * instance (`registerRemotes` then `loadRemote`). * @public */ type RemoteModule = { readonly entry: string; /** The exposed module's name in the remote's manifest. */ readonly moduleId: string; /** The module's release version, so consumers can tell versions apart. */ readonly version: string; }; /** * An installation's config snapshot, embedded with `include=activeConfig`. The * `version` is caller-supplied at deploy and mirrors interface versioning. * @public */ declare const ActiveConfig: z.ZodObject<{ id: z.ZodString; version: z.ZodString; }, z.core.$strip>; /** * @public */ type ActiveConfig = z.output; /** * A config a local dev server forwards. * @public */ interface LocalAppConfig { appType: "media-library"; version: string; remoteURL: string; } /** * The stable `name` each local config's `appType` binds to — the workbench's own * mapping, since a local config carries no application identity of its own. This * is the key config↔app pairing matches on (identity, not the mutable slug). * @public */ declare const APP_TYPE_NAME: { readonly "media-library": "media-library"; }; /** * The exposed module's manifest name the CLI emits every installation config * under — a config ref's `moduleId`. * @public */ declare const CONFIG_MODULE_EXPOSE = "configs/installation_config"; /** * The module ref for a deployed installation's active config, served at the * stable `-configs-` host. * @public */ declare function getDeployedConfigModuleRef(slug: string, config: ActiveConfig, organizationId: OrganizationId): RemoteModule; /** * @public */ declare const LocalCoreApplicationManifest: z.ZodObject<{ version: z.ZodString; icon: z.ZodOptional; title: z.ZodOptional; slug: z.ZodString; }, z.core.$strip>; /** * @public */ type LocalCoreApplicationManifest = z.output; declare const internalCoreApplication: z.ZodObject<{ id: z.core.$ZodBranded; organizationId: z.core.$ZodBranded; isSingleton: z.ZodBoolean; name: z.ZodString; reference: z.ZodString; visibility: z.ZodEnum<{ default: "default"; disabled: "disabled"; unlisted: "unlisted"; }>; icon: z.ZodOptional>; createdAt: z.ZodString; updatedAt: z.ZodString; activeDeployment: z.ZodOptional; size: z.ZodNullable; version: z.ZodNullable; isAutoUpdating: z.ZodNullable; isActiveDeployment: z.ZodBoolean; deployedBy: z.ZodNullable; createdAt: z.ZodString; updatedAt: z.ZodString; interfaces: z.ZodOptional; moduleId: z.ZodString; type: z.ZodLiteral<"panel">; }, z.core.$strip>, z.ZodObject<{ id: z.ZodString; name: z.ZodString; title: z.ZodString; version: z.ZodOptional; moduleId: z.ZodString; type: z.ZodLiteral<"worker">; }, z.core.$strip>, z.ZodObject<{ id: z.ZodString; name: z.ZodString; title: z.ZodString; version: z.ZodOptional; moduleId: z.ZodString; type: z.ZodLiteral<"asset_source">; }, z.core.$strip>, z.ZodObject<{ id: z.ZodString; name: z.ZodString; title: z.ZodString; version: z.ZodOptional; moduleId: z.ZodString; type: z.ZodLiteral<"tile">; metadata: z.ZodObject<{ priority: z.ZodOptional; size: z.ZodEnum<{ banner: "banner"; large: "large"; small: "small"; }>; }, z.core.$strip>; }, z.core.$strip>, z.ZodObject<{ id: z.ZodString; name: z.ZodString; title: z.ZodString; version: z.ZodOptional; moduleId: z.ZodString; type: z.ZodLiteral<"app">; metadata: z.ZodNullable; priority: z.ZodOptional; }, z.core.$strip>>; }, z.core.$strip>], "type">>>; workspaces: z.ZodOptional; subtitle: z.ZodNullable; projectId: z.core.$ZodBranded; dataset: z.ZodString; schemaDescriptorId: z.ZodNullable; basePath: z.ZodNullable; icon: z.ZodNullable; }, z.core.$strip>>>>; }, z.core.$strip>>>; slug: z.ZodString; externalUrl: z.ZodNull; type: z.ZodLiteral<"coreApp">; title: z.ZodString; config: z.ZodOptional; }, z.core.$strip>>; manifest: z.ZodOptional; title: z.ZodOptional; slug: z.ZodString; }, z.core.$strip>>>; }, z.core.$strip>; declare const externalCoreApplication: z.ZodObject<{ id: z.core.$ZodBranded; organizationId: z.core.$ZodBranded; isSingleton: z.ZodBoolean; name: z.ZodString; reference: z.ZodString; visibility: z.ZodEnum<{ default: "default"; disabled: "disabled"; unlisted: "unlisted"; }>; icon: z.ZodOptional>; createdAt: z.ZodString; updatedAt: z.ZodString; activeDeployment: z.ZodOptional; size: z.ZodNullable; version: z.ZodNullable; isAutoUpdating: z.ZodNullable; isActiveDeployment: z.ZodBoolean; deployedBy: z.ZodNullable; createdAt: z.ZodString; updatedAt: z.ZodString; interfaces: z.ZodOptional; moduleId: z.ZodString; type: z.ZodLiteral<"panel">; }, z.core.$strip>, z.ZodObject<{ id: z.ZodString; name: z.ZodString; title: z.ZodString; version: z.ZodOptional; moduleId: z.ZodString; type: z.ZodLiteral<"worker">; }, z.core.$strip>, z.ZodObject<{ id: z.ZodString; name: z.ZodString; title: z.ZodString; version: z.ZodOptional; moduleId: z.ZodString; type: z.ZodLiteral<"asset_source">; }, z.core.$strip>, z.ZodObject<{ id: z.ZodString; name: z.ZodString; title: z.ZodString; version: z.ZodOptional; moduleId: z.ZodString; type: z.ZodLiteral<"tile">; metadata: z.ZodObject<{ priority: z.ZodOptional; size: z.ZodEnum<{ banner: "banner"; large: "large"; small: "small"; }>; }, z.core.$strip>; }, z.core.$strip>, z.ZodObject<{ id: z.ZodString; name: z.ZodString; title: z.ZodString; version: z.ZodOptional; moduleId: z.ZodString; type: z.ZodLiteral<"app">; metadata: z.ZodNullable; priority: z.ZodOptional; }, z.core.$strip>>; }, z.core.$strip>], "type">>>; workspaces: z.ZodOptional; subtitle: z.ZodNullable; projectId: z.core.$ZodBranded; dataset: z.ZodString; schemaDescriptorId: z.ZodNullable; basePath: z.ZodNullable; icon: z.ZodNullable; }, z.core.$strip>>>>; }, z.core.$strip>>>; slug: z.ZodNull; externalUrl: z.ZodString; type: z.ZodLiteral<"coreApp">; title: z.ZodString; config: z.ZodOptional; }, z.core.$strip>>; manifest: z.ZodOptional; title: z.ZodOptional; slug: z.ZodString; }, z.core.$strip>>>; }, z.core.$strip>; /** * A Sanity-hosted SDK app (`slug` set, `externalUrl: null`) — the only kind * brett hosts. * @public */ type InternalCoreApplication = z.output; /** * An externally served SDK app (`externalUrl` set, `slug: null`). Never on * the wire — brett doesn't host external SDK apps — but a local CLI dev * server serves its app from `http://localhost`. * @public */ type ExternalCoreApplication = z.output; /** * An SDK app from `GET /applications?type=coreApp`, brett's shape verbatim. * `manifest` is the one addition: the channel a local CLI dev server forwards * its extracted manifest on — never present on the wire. * @public */ type CoreApp = InternalCoreApplication | ExternalCoreApplication; /** * Validates and parses a raw API response into a branded * CoreApp. Parses the internal variant only — brett doesn't host * external SDK apps. * @public */ declare function parseCoreApplication(data: unknown): CoreApp; /** * @public */ declare class CoreApplication extends BrettApplication { readonly activeDeployment: CoreApp["activeDeployment"]; constructor(application: CoreApp, options?: { isLocal?: boolean; remoteApplication?: CoreApplication | null; }); get hasAppView(): boolean; /** * An SDK app that declares no `app` view is panel-only, so it gets no dock * entry and 404s on direct visit (US5). */ get href(): string | null; get icon(): IconDescriptor; /** * Read off the `app` interface for local and deployed apps alike, since a * local app's manifest value is adapted onto that interface upstream. */ get group(): DockGroup | undefined; get priority(): number | undefined; get title(): string; /** * The manifest a local CLI dev server forwards. Deployed apps carry none — * their dock metadata rides the `app` interface (see {@link group} and * {@link priority}) and their icon rides the application-level `icon` field. */ get manifest(): LocalCoreApplicationManifest | null; get subtitle(): undefined; get updatedAt(): string; get(attr: TKey): CoreApp[TKey]; } declare const WorkspaceSchema: z.ZodObject<{ name: z.ZodString; title: z.ZodString; subtitle: z.ZodOptional>; basePath: z.ZodString; projectId: z.core.$ZodBranded; dataset: z.ZodOptional; icon: z.ZodOptional>; }, z.core.$strip>; /** * @public */ type Workspace = z.output; /** * @public */ declare const LocalStudioApplicationManifest: z.ZodObject<{ version: z.ZodNumber; createdAt: z.ZodString; studioVersion: z.ZodOptional; workspaces: z.ZodArray>; basePath: z.ZodString; projectId: z.core.$ZodBranded; icon: z.ZodOptional>; dataset: z.ZodString; schema: z.ZodString; tools: z.ZodOptional; }, z.core.$strip>>; }, z.core.$strip>; /** * @public */ type LocalStudioApplicationManifest = z.output; declare const internalStudioApplication: z.ZodObject<{ type: z.ZodLiteral<"studio">; title: z.ZodString; config: z.ZodObject<{ studio: z.ZodObject<{ projectId: z.core.$ZodBranded; autoUpdatingVersion: z.ZodNullable; }, z.core.$strip>; mfManifest: z.ZodOptional; }, z.core.$strip>; id: z.core.$ZodBranded; organizationId: z.core.$ZodBranded; isSingleton: z.ZodBoolean; name: z.ZodString; reference: z.ZodString; visibility: z.ZodEnum<{ default: "default"; disabled: "disabled"; unlisted: "unlisted"; }>; icon: z.ZodOptional>; createdAt: z.ZodString; updatedAt: z.ZodString; activeDeployment: z.ZodOptional; size: z.ZodNullable; version: z.ZodNullable; isAutoUpdating: z.ZodNullable; isActiveDeployment: z.ZodBoolean; deployedBy: z.ZodNullable; createdAt: z.ZodString; updatedAt: z.ZodString; interfaces: z.ZodOptional; moduleId: z.ZodString; type: z.ZodLiteral<"panel">; }, z.core.$strip>, z.ZodObject<{ id: z.ZodString; name: z.ZodString; title: z.ZodString; version: z.ZodOptional; moduleId: z.ZodString; type: z.ZodLiteral<"worker">; }, z.core.$strip>, z.ZodObject<{ id: z.ZodString; name: z.ZodString; title: z.ZodString; version: z.ZodOptional; moduleId: z.ZodString; type: z.ZodLiteral<"asset_source">; }, z.core.$strip>, z.ZodObject<{ id: z.ZodString; name: z.ZodString; title: z.ZodString; version: z.ZodOptional; moduleId: z.ZodString; type: z.ZodLiteral<"tile">; metadata: z.ZodObject<{ priority: z.ZodOptional; size: z.ZodEnum<{ banner: "banner"; large: "large"; small: "small"; }>; }, z.core.$strip>; }, z.core.$strip>, z.ZodObject<{ id: z.ZodString; name: z.ZodString; title: z.ZodString; version: z.ZodOptional; moduleId: z.ZodString; type: z.ZodLiteral<"app">; metadata: z.ZodNullable; priority: z.ZodOptional; }, z.core.$strip>>; }, z.core.$strip>], "type">>>; workspaces: z.ZodOptional; subtitle: z.ZodNullable; projectId: z.core.$ZodBranded; dataset: z.ZodString; schemaDescriptorId: z.ZodNullable; basePath: z.ZodNullable; icon: z.ZodNullable; }, z.core.$strip>>>>; }, z.core.$strip>>>; slug: z.ZodString; externalUrl: z.ZodNull; }, z.core.$strip>; declare const externalStudioApplication: z.ZodObject<{ type: z.ZodLiteral<"studio">; title: z.ZodString; config: z.ZodObject<{ studio: z.ZodObject<{ projectId: z.core.$ZodBranded; autoUpdatingVersion: z.ZodNullable; }, z.core.$strip>; mfManifest: z.ZodOptional; }, z.core.$strip>; id: z.core.$ZodBranded; organizationId: z.core.$ZodBranded; isSingleton: z.ZodBoolean; name: z.ZodString; reference: z.ZodString; visibility: z.ZodEnum<{ default: "default"; disabled: "disabled"; unlisted: "unlisted"; }>; icon: z.ZodOptional>; createdAt: z.ZodString; updatedAt: z.ZodString; activeDeployment: z.ZodOptional; size: z.ZodNullable; version: z.ZodNullable; isAutoUpdating: z.ZodNullable; isActiveDeployment: z.ZodBoolean; deployedBy: z.ZodNullable; createdAt: z.ZodString; updatedAt: z.ZodString; interfaces: z.ZodOptional; moduleId: z.ZodString; type: z.ZodLiteral<"panel">; }, z.core.$strip>, z.ZodObject<{ id: z.ZodString; name: z.ZodString; title: z.ZodString; version: z.ZodOptional; moduleId: z.ZodString; type: z.ZodLiteral<"worker">; }, z.core.$strip>, z.ZodObject<{ id: z.ZodString; name: z.ZodString; title: z.ZodString; version: z.ZodOptional; moduleId: z.ZodString; type: z.ZodLiteral<"asset_source">; }, z.core.$strip>, z.ZodObject<{ id: z.ZodString; name: z.ZodString; title: z.ZodString; version: z.ZodOptional; moduleId: z.ZodString; type: z.ZodLiteral<"tile">; metadata: z.ZodObject<{ priority: z.ZodOptional; size: z.ZodEnum<{ banner: "banner"; large: "large"; small: "small"; }>; }, z.core.$strip>; }, z.core.$strip>, z.ZodObject<{ id: z.ZodString; name: z.ZodString; title: z.ZodString; version: z.ZodOptional; moduleId: z.ZodString; type: z.ZodLiteral<"app">; metadata: z.ZodNullable; priority: z.ZodOptional; }, z.core.$strip>>; }, z.core.$strip>], "type">>>; workspaces: z.ZodOptional; subtitle: z.ZodNullable; projectId: z.core.$ZodBranded; dataset: z.ZodString; schemaDescriptorId: z.ZodNullable; basePath: z.ZodNullable; icon: z.ZodNullable; }, z.core.$strip>>>>; }, z.core.$strip>>>; slug: z.ZodNull; externalUrl: z.ZodString; }, z.core.$strip>; /** * A studio from `GET /applications?type=studio`, brett's shape verbatim. * @public */ declare const Studio: z.ZodUnion; title: z.ZodString; config: z.ZodObject<{ studio: z.ZodObject<{ projectId: z.core.$ZodBranded; autoUpdatingVersion: z.ZodNullable; }, z.core.$strip>; mfManifest: z.ZodOptional; }, z.core.$strip>; id: z.core.$ZodBranded; organizationId: z.core.$ZodBranded; isSingleton: z.ZodBoolean; name: z.ZodString; reference: z.ZodString; visibility: z.ZodEnum<{ default: "default"; disabled: "disabled"; unlisted: "unlisted"; }>; icon: z.ZodOptional>; createdAt: z.ZodString; updatedAt: z.ZodString; activeDeployment: z.ZodOptional; size: z.ZodNullable; version: z.ZodNullable; isAutoUpdating: z.ZodNullable; isActiveDeployment: z.ZodBoolean; deployedBy: z.ZodNullable; createdAt: z.ZodString; updatedAt: z.ZodString; interfaces: z.ZodOptional; moduleId: z.ZodString; type: z.ZodLiteral<"panel">; }, z.core.$strip>, z.ZodObject<{ id: z.ZodString; name: z.ZodString; title: z.ZodString; version: z.ZodOptional; moduleId: z.ZodString; type: z.ZodLiteral<"worker">; }, z.core.$strip>, z.ZodObject<{ id: z.ZodString; name: z.ZodString; title: z.ZodString; version: z.ZodOptional; moduleId: z.ZodString; type: z.ZodLiteral<"asset_source">; }, z.core.$strip>, z.ZodObject<{ id: z.ZodString; name: z.ZodString; title: z.ZodString; version: z.ZodOptional; moduleId: z.ZodString; type: z.ZodLiteral<"tile">; metadata: z.ZodObject<{ priority: z.ZodOptional; size: z.ZodEnum<{ banner: "banner"; large: "large"; small: "small"; }>; }, z.core.$strip>; }, z.core.$strip>, z.ZodObject<{ id: z.ZodString; name: z.ZodString; title: z.ZodString; version: z.ZodOptional; moduleId: z.ZodString; type: z.ZodLiteral<"app">; metadata: z.ZodNullable; priority: z.ZodOptional; }, z.core.$strip>>; }, z.core.$strip>], "type">>>; workspaces: z.ZodOptional; subtitle: z.ZodNullable; projectId: z.core.$ZodBranded; dataset: z.ZodString; schemaDescriptorId: z.ZodNullable; basePath: z.ZodNullable; icon: z.ZodNullable; }, z.core.$strip>>>>; }, z.core.$strip>>>; slug: z.ZodString; externalUrl: z.ZodNull; }, z.core.$strip>, z.ZodObject<{ type: z.ZodLiteral<"studio">; title: z.ZodString; config: z.ZodObject<{ studio: z.ZodObject<{ projectId: z.core.$ZodBranded; autoUpdatingVersion: z.ZodNullable; }, z.core.$strip>; mfManifest: z.ZodOptional; }, z.core.$strip>; id: z.core.$ZodBranded; organizationId: z.core.$ZodBranded; isSingleton: z.ZodBoolean; name: z.ZodString; reference: z.ZodString; visibility: z.ZodEnum<{ default: "default"; disabled: "disabled"; unlisted: "unlisted"; }>; icon: z.ZodOptional>; createdAt: z.ZodString; updatedAt: z.ZodString; activeDeployment: z.ZodOptional; size: z.ZodNullable; version: z.ZodNullable; isAutoUpdating: z.ZodNullable; isActiveDeployment: z.ZodBoolean; deployedBy: z.ZodNullable; createdAt: z.ZodString; updatedAt: z.ZodString; interfaces: z.ZodOptional; moduleId: z.ZodString; type: z.ZodLiteral<"panel">; }, z.core.$strip>, z.ZodObject<{ id: z.ZodString; name: z.ZodString; title: z.ZodString; version: z.ZodOptional; moduleId: z.ZodString; type: z.ZodLiteral<"worker">; }, z.core.$strip>, z.ZodObject<{ id: z.ZodString; name: z.ZodString; title: z.ZodString; version: z.ZodOptional; moduleId: z.ZodString; type: z.ZodLiteral<"asset_source">; }, z.core.$strip>, z.ZodObject<{ id: z.ZodString; name: z.ZodString; title: z.ZodString; version: z.ZodOptional; moduleId: z.ZodString; type: z.ZodLiteral<"tile">; metadata: z.ZodObject<{ priority: z.ZodOptional; size: z.ZodEnum<{ banner: "banner"; large: "large"; small: "small"; }>; }, z.core.$strip>; }, z.core.$strip>, z.ZodObject<{ id: z.ZodString; name: z.ZodString; title: z.ZodString; version: z.ZodOptional; moduleId: z.ZodString; type: z.ZodLiteral<"app">; metadata: z.ZodNullable; priority: z.ZodOptional; }, z.core.$strip>>; }, z.core.$strip>], "type">>>; workspaces: z.ZodOptional; subtitle: z.ZodNullable; projectId: z.core.$ZodBranded; dataset: z.ZodString; schemaDescriptorId: z.ZodNullable; basePath: z.ZodNullable; icon: z.ZodNullable; }, z.core.$strip>>>>; }, z.core.$strip>>>; slug: z.ZodNull; externalUrl: z.ZodString; }, z.core.$strip>]>; /** * A Sanity-hosted studio (`slug` set, `externalUrl: null`). * @public */ type InternalStudioApplication = z.output; /** * An externally hosted studio (`externalUrl` set, `slug: null`). * @public */ type ExternalStudioApplication = z.output; /** * @public */ type Studio = z.output; /** * Validates and parses a raw API response into a branded * Studio. * @public */ declare function parseStudioApplication(data: unknown): Studio; /** * Project ID schema, branded for type safety. * @public */ declare const ProjectId: z.core.$ZodBranded; /** * Project ID type, branded for type safety. * @public */ type ProjectId = z.output; /** * Validates and brands a string as a ProjectId. * @public */ declare function brandProjectId(id: string): ProjectId; declare const ProjectMemberSchema: z.ZodObject<{ id: z.ZodString; createdAt: z.ZodString; updatedAt: z.ZodString; isCurrentUser: z.ZodBoolean; isRobot: z.ZodBoolean; roles: z.ZodArray>; }, z.core.$strip>; /** * @public */ type ProjectMember = z.output; /** * Project schema — validates and brands API responses * from the `/projects/:id` endpoint. * @public */ declare const Project: z.ZodObject<{ id: z.core.$ZodBranded; displayName: z.ZodString; studioHost: z.ZodNullable; organizationId: z.core.$ZodBranded; metadata: z.ZodObject<{ color: z.ZodOptional; externalStudioHost: z.ZodNullable>; initialTemplate: z.ZodOptional; cliInitializedAt: z.ZodOptional; integration: z.ZodOptional; }, z.core.$strip>; isBlocked: z.ZodBoolean; isDisabled: z.ZodBoolean; isDisabledByUser: z.ZodBoolean; activityFeedEnabled: z.ZodBoolean; createdAt: z.ZodString; updatedAt: z.ZodString; }, z.core.$strip>; /** * Represents a Sanity project with optional members and * features arrays depending on the generic parameters. * By default, neither members nor features are included. * - `Project` — base fields only (default) * - `Project` — includes `members` * - `Project` — includes both * @public */ type Project = z.output & (IncludeMembers extends true ? { members: ProjectMember[]; } : unknown) & (IncludeFeatures extends true ? { features: string[]; } : unknown); /** * Validates and parses a raw API response into a branded * Project. The options control which schema is used — * matching what the API returns based on query params. * @public */ declare function parseProject(data: unknown, options?: { includeMembers?: IncludeMembers; includeFeatures?: IncludeFeatures; }): Project; /** * @public */ declare class StudioWorkspace extends AbstractApplication<"workspace"> { /** * Workspaces always belong to a studio application. * They do not exist on their own & therefore can access * information about the studio they're in via this property. */ private readonly studioApplication; readonly workspace: Workspace; readonly project: Project; private readonly isDefaultWorkspace; constructor(studioApplication: StudioApplication, workspace: Workspace, project: Project, isDefaultWorkspace: boolean); /** * The studio application that this workspace belongs to. */ get studio(): StudioApplication; get id(): string; get href(): string; get title(): string; get subtitle(): string | null | undefined; get>(attr: TKey): Workspace[TKey]; get isFederated(): boolean; /** * @returns the URL to the workspace of a studio application. */ get url(): URL; get icon(): IconDescriptor; static makeId(applicationId: ApplicationId, workspaceName: string): string; static splitId(id: string): [string, string]; } /** * @public */ declare class StudioApplication extends BrettApplication { /** * Returns a list of studio workspaces based on the application manifest. * If there is no manifest, or alternatively it is not valid, then we create a default workspace. */ readonly workspaces: readonly StudioWorkspace[]; readonly project: Project; /** * The projects actually referenced by this studio — the application's own * project plus any project used by a workspace. Preserved so the instance * can be re-constructed (e.g. by dock wrappers) without having to thread * the full organization project list through again. */ readonly projects: Project[]; /** * @param application - The studio application to create a list of workspaces for * @param projects - The projects available in the organization. It's not enough to just pass * the project that associates with the application because that is the project the app is deployed in relation to. * The workspaces may have different projects completely. */ constructor(application: Studio, projects: Project[], options?: { isLocal?: boolean; remoteApplication?: StudioApplication | null; }); /** * Factory hook called for each workspace during construction. Subclasses * override this to substitute a `StudioWorkspace` subclass (e.g. a UI-aware * variant in a downstream package) without re-implementing the constructor's * workspace-derivation logic. */ protected createWorkspace(workspace: Workspace, project: Project, isDefaultWorkspace: boolean): StudioWorkspace; get href(): string; get title(): string; get subtitle(): string; /** * A single-workspace studio stands for that workspace, so it borrows the * workspace's icon and initials. */ get icon(): IconDescriptor; /** * Read off the `app` interface for local and deployed studios alike, since a * local studio's manifest value is adapted onto that interface upstream. */ get group(): DockGroup | undefined; get priority(): number | undefined; get(attr: TKey): Studio[TKey]; get hasManifest(): boolean; get hasSchema(): boolean; private resolveVersion; get version(): string | null; get compatibilityStatus(): CompatibilityStatus; /** * Used to calculate the compatibility status of a given studio application. * Optionally if you've resolved the version elsewhere provide that value to * get the new compatibility status without mutating the application. */ static resolveCompatibilityStatus(application: StudioApplication, version?: string | null): CompatibilityStatus; get isAutoRedirecting(): boolean; /** * Mirrors the `isRedirectable` function from Saison defined in * https://github.com/sanity-io/saison/blob/83556405d23e07f6d3a71c76249c67e33fe1101f/src/utils/applications.ts * * Returns whether a studio application is auto-redirecting, meaning it can only be accessed in the context of * Dashboard. */ static resolveIsAutoRedirecting(application: StudioApplication, versionArg?: string | null): boolean; /** * Returns a list of issues that prevent the studio from functioning properly in the Dashboard. * This static value depends on the version of the studio that comes from the `activeDeployment` property. * As such, if the studio is auto-updating, this list will be incorrect & instead you should use * the static method `resolveIssues` to get the correct issues by passing the resolved version. */ get issues(): StudioIssues; static resolveIssues(application: StudioApplication, version?: string | null): StudioIssues; protected isFeatureSupported(feature: StudioDashboardIssue, version?: string | null): boolean; static CompatibilityStatuses: { readonly UNKNOWN: "unknown"; readonly PARTIALLY_COMPATIBLE: "partially-compatible"; readonly FULLY_COMPATIBLE: "fully-compatible"; }; static StudioIssues: { readonly ISSUE_ACTIVITY: "ACTIVITY"; readonly ISSUE_AGENT: "AGENT"; readonly ISSUE_FAVORITES: "FAVORITES"; readonly ISSUE_URL_SYNCING: "URL_SYNCING"; readonly ISSUE_UI_ADJUSTMENT: "UI_ADJUSTMENT"; readonly ISSUE_CONTENT_MAPPING: "CONTENT_MAPPING"; readonly ISSUE_LOGIN: "LOGIN"; readonly ISSUE_MANIFEST: "MANIFEST"; }; static Features: ({ id: "AGENT"; version: string; } | { id: "FAVORITES"; version: string; } | { id: "ACTIVITY"; version: string; } | { id: "URL_SYNCING"; version: string; } | { id: "UI_ADJUSTMENT"; version: string; } | { id: "CONTENT_MAPPING"; version: string; } | { id: "LOGIN"; version: string; })[]; static MinimumStudioVersion: "2.28.0"; static MinimumStudioVersionWithNoIssues: string | undefined; } type CompatibilityStatus = (typeof StudioApplication.CompatibilityStatuses)[keyof typeof StudioApplication.CompatibilityStatuses]; type StudioDashboardIssue = (typeof StudioApplication.StudioIssues)[keyof typeof StudioApplication.StudioIssues]; type StudioIssues = Array<{ id: StudioDashboardIssue; version?: string; }>; /** * Application ID schema, branded for type safety. * @public */ declare const ApplicationId: z.core.$ZodBranded; /** * Application ID type, branded for type safety. * @public */ type ApplicationId = z.output; /** * Validates and brands a string as an ApplicationId. * @public */ declare function brandApplicationId(id: string): ApplicationId; /** * A studio deployment's workspace record, as brett returns it. * @public */ declare const BrettWorkspace: z.ZodObject<{ id: z.ZodString; name: z.ZodString; title: z.ZodNullable; subtitle: z.ZodNullable; projectId: z.core.$ZodBranded; dataset: z.ZodString; schemaDescriptorId: z.ZodNullable; basePath: z.ZodNullable; icon: z.ZodNullable; }, z.core.$strip>; /** * @public */ type BrettWorkspace = z.output; /** * An application's active deployment from `GET /applications` with * `include=activeDeployment,interfaces,workspaces`. * @public */ declare const ActiveDeployment: z.ZodObject<{ id: z.ZodString; applicationId: z.core.$ZodBranded; size: z.ZodNullable; version: z.ZodNullable; isAutoUpdating: z.ZodNullable; isActiveDeployment: z.ZodBoolean; deployedBy: z.ZodNullable; createdAt: z.ZodString; updatedAt: z.ZodString; interfaces: z.ZodOptional; moduleId: z.ZodString; type: z.ZodLiteral<"panel">; }, z.core.$strip>, z.ZodObject<{ id: z.ZodString; name: z.ZodString; title: z.ZodString; version: z.ZodOptional; moduleId: z.ZodString; type: z.ZodLiteral<"worker">; }, z.core.$strip>, z.ZodObject<{ id: z.ZodString; name: z.ZodString; title: z.ZodString; version: z.ZodOptional; moduleId: z.ZodString; type: z.ZodLiteral<"asset_source">; }, z.core.$strip>, z.ZodObject<{ id: z.ZodString; name: z.ZodString; title: z.ZodString; version: z.ZodOptional; moduleId: z.ZodString; type: z.ZodLiteral<"tile">; metadata: z.ZodObject<{ priority: z.ZodOptional; size: z.ZodEnum<{ banner: "banner"; large: "large"; small: "small"; }>; }, z.core.$strip>; }, z.core.$strip>, z.ZodObject<{ id: z.ZodString; name: z.ZodString; title: z.ZodString; version: z.ZodOptional; moduleId: z.ZodString; type: z.ZodLiteral<"app">; metadata: z.ZodNullable; priority: z.ZodOptional; }, z.core.$strip>>; }, z.core.$strip>], "type">>>; workspaces: z.ZodOptional; subtitle: z.ZodNullable; projectId: z.core.$ZodBranded; dataset: z.ZodString; schemaDescriptorId: z.ZodNullable; basePath: z.ZodNullable; icon: z.ZodNullable; }, z.core.$strip>>>>; }, z.core.$strip>; /** * The internal (Sanity-hosted) hosting variant of the base application; studio * and core-app schemas extend it with their type-specific config. * @internal */ declare const InternalApplication: z.ZodObject<{ id: z.core.$ZodBranded; organizationId: z.core.$ZodBranded; isSingleton: z.ZodBoolean; name: z.ZodString; reference: z.ZodString; visibility: z.ZodEnum<{ default: "default"; disabled: "disabled"; unlisted: "unlisted"; }>; icon: z.ZodOptional>; createdAt: z.ZodString; updatedAt: z.ZodString; activeDeployment: z.ZodOptional; size: z.ZodNullable; version: z.ZodNullable; isAutoUpdating: z.ZodNullable; isActiveDeployment: z.ZodBoolean; deployedBy: z.ZodNullable; createdAt: z.ZodString; updatedAt: z.ZodString; interfaces: z.ZodOptional; moduleId: z.ZodString; type: z.ZodLiteral<"panel">; }, z.core.$strip>, z.ZodObject<{ id: z.ZodString; name: z.ZodString; title: z.ZodString; version: z.ZodOptional; moduleId: z.ZodString; type: z.ZodLiteral<"worker">; }, z.core.$strip>, z.ZodObject<{ id: z.ZodString; name: z.ZodString; title: z.ZodString; version: z.ZodOptional; moduleId: z.ZodString; type: z.ZodLiteral<"asset_source">; }, z.core.$strip>, z.ZodObject<{ id: z.ZodString; name: z.ZodString; title: z.ZodString; version: z.ZodOptional; moduleId: z.ZodString; type: z.ZodLiteral<"tile">; metadata: z.ZodObject<{ priority: z.ZodOptional; size: z.ZodEnum<{ banner: "banner"; large: "large"; small: "small"; }>; }, z.core.$strip>; }, z.core.$strip>, z.ZodObject<{ id: z.ZodString; name: z.ZodString; title: z.ZodString; version: z.ZodOptional; moduleId: z.ZodString; type: z.ZodLiteral<"app">; metadata: z.ZodNullable; priority: z.ZodOptional; }, z.core.$strip>>; }, z.core.$strip>], "type">>>; workspaces: z.ZodOptional; subtitle: z.ZodNullable; projectId: z.core.$ZodBranded; dataset: z.ZodString; schemaDescriptorId: z.ZodNullable; basePath: z.ZodNullable; icon: z.ZodNullable; }, z.core.$strip>>>>; }, z.core.$strip>>>; slug: z.ZodString; externalUrl: z.ZodNull; }, z.core.$strip>; /** * The external hosting variant of the base application. * @internal */ declare const ExternalApplication: z.ZodObject<{ id: z.core.$ZodBranded; organizationId: z.core.$ZodBranded; isSingleton: z.ZodBoolean; name: z.ZodString; reference: z.ZodString; visibility: z.ZodEnum<{ default: "default"; disabled: "disabled"; unlisted: "unlisted"; }>; icon: z.ZodOptional>; createdAt: z.ZodString; updatedAt: z.ZodString; activeDeployment: z.ZodOptional; size: z.ZodNullable; version: z.ZodNullable; isAutoUpdating: z.ZodNullable; isActiveDeployment: z.ZodBoolean; deployedBy: z.ZodNullable; createdAt: z.ZodString; updatedAt: z.ZodString; interfaces: z.ZodOptional; moduleId: z.ZodString; type: z.ZodLiteral<"panel">; }, z.core.$strip>, z.ZodObject<{ id: z.ZodString; name: z.ZodString; title: z.ZodString; version: z.ZodOptional; moduleId: z.ZodString; type: z.ZodLiteral<"worker">; }, z.core.$strip>, z.ZodObject<{ id: z.ZodString; name: z.ZodString; title: z.ZodString; version: z.ZodOptional; moduleId: z.ZodString; type: z.ZodLiteral<"asset_source">; }, z.core.$strip>, z.ZodObject<{ id: z.ZodString; name: z.ZodString; title: z.ZodString; version: z.ZodOptional; moduleId: z.ZodString; type: z.ZodLiteral<"tile">; metadata: z.ZodObject<{ priority: z.ZodOptional; size: z.ZodEnum<{ banner: "banner"; large: "large"; small: "small"; }>; }, z.core.$strip>; }, z.core.$strip>, z.ZodObject<{ id: z.ZodString; name: z.ZodString; title: z.ZodString; version: z.ZodOptional; moduleId: z.ZodString; type: z.ZodLiteral<"app">; metadata: z.ZodNullable; priority: z.ZodOptional; }, z.core.$strip>>; }, z.core.$strip>], "type">>>; workspaces: z.ZodOptional; subtitle: z.ZodNullable; projectId: z.core.$ZodBranded; dataset: z.ZodString; schemaDescriptorId: z.ZodNullable; basePath: z.ZodNullable; icon: z.ZodNullable; }, z.core.$strip>>>>; }, z.core.$strip>>>; slug: z.ZodNull; externalUrl: z.ZodString; }, z.core.$strip>; /** * Attributes every application from `GET /applications` carries; the studio and * core-app schemas extend a hosting variant with their type-specific config. * @public */ declare const ApplicationBase: z.ZodUnion; organizationId: z.core.$ZodBranded; isSingleton: z.ZodBoolean; name: z.ZodString; reference: z.ZodString; visibility: z.ZodEnum<{ default: "default"; disabled: "disabled"; unlisted: "unlisted"; }>; icon: z.ZodOptional>; createdAt: z.ZodString; updatedAt: z.ZodString; activeDeployment: z.ZodOptional; size: z.ZodNullable; version: z.ZodNullable; isAutoUpdating: z.ZodNullable; isActiveDeployment: z.ZodBoolean; deployedBy: z.ZodNullable; createdAt: z.ZodString; updatedAt: z.ZodString; interfaces: z.ZodOptional; moduleId: z.ZodString; type: z.ZodLiteral<"panel">; }, z.core.$strip>, z.ZodObject<{ id: z.ZodString; name: z.ZodString; title: z.ZodString; version: z.ZodOptional; moduleId: z.ZodString; type: z.ZodLiteral<"worker">; }, z.core.$strip>, z.ZodObject<{ id: z.ZodString; name: z.ZodString; title: z.ZodString; version: z.ZodOptional; moduleId: z.ZodString; type: z.ZodLiteral<"asset_source">; }, z.core.$strip>, z.ZodObject<{ id: z.ZodString; name: z.ZodString; title: z.ZodString; version: z.ZodOptional; moduleId: z.ZodString; type: z.ZodLiteral<"tile">; metadata: z.ZodObject<{ priority: z.ZodOptional; size: z.ZodEnum<{ banner: "banner"; large: "large"; small: "small"; }>; }, z.core.$strip>; }, z.core.$strip>, z.ZodObject<{ id: z.ZodString; name: z.ZodString; title: z.ZodString; version: z.ZodOptional; moduleId: z.ZodString; type: z.ZodLiteral<"app">; metadata: z.ZodNullable; priority: z.ZodOptional; }, z.core.$strip>>; }, z.core.$strip>], "type">>>; workspaces: z.ZodOptional; subtitle: z.ZodNullable; projectId: z.core.$ZodBranded; dataset: z.ZodString; schemaDescriptorId: z.ZodNullable; basePath: z.ZodNullable; icon: z.ZodNullable; }, z.core.$strip>>>>; }, z.core.$strip>>>; slug: z.ZodString; externalUrl: z.ZodNull; }, z.core.$strip>, z.ZodObject<{ id: z.core.$ZodBranded; organizationId: z.core.$ZodBranded; isSingleton: z.ZodBoolean; name: z.ZodString; reference: z.ZodString; visibility: z.ZodEnum<{ default: "default"; disabled: "disabled"; unlisted: "unlisted"; }>; icon: z.ZodOptional>; createdAt: z.ZodString; updatedAt: z.ZodString; activeDeployment: z.ZodOptional; size: z.ZodNullable; version: z.ZodNullable; isAutoUpdating: z.ZodNullable; isActiveDeployment: z.ZodBoolean; deployedBy: z.ZodNullable; createdAt: z.ZodString; updatedAt: z.ZodString; interfaces: z.ZodOptional; moduleId: z.ZodString; type: z.ZodLiteral<"panel">; }, z.core.$strip>, z.ZodObject<{ id: z.ZodString; name: z.ZodString; title: z.ZodString; version: z.ZodOptional; moduleId: z.ZodString; type: z.ZodLiteral<"worker">; }, z.core.$strip>, z.ZodObject<{ id: z.ZodString; name: z.ZodString; title: z.ZodString; version: z.ZodOptional; moduleId: z.ZodString; type: z.ZodLiteral<"asset_source">; }, z.core.$strip>, z.ZodObject<{ id: z.ZodString; name: z.ZodString; title: z.ZodString; version: z.ZodOptional; moduleId: z.ZodString; type: z.ZodLiteral<"tile">; metadata: z.ZodObject<{ priority: z.ZodOptional; size: z.ZodEnum<{ banner: "banner"; large: "large"; small: "small"; }>; }, z.core.$strip>; }, z.core.$strip>, z.ZodObject<{ id: z.ZodString; name: z.ZodString; title: z.ZodString; version: z.ZodOptional; moduleId: z.ZodString; type: z.ZodLiteral<"app">; metadata: z.ZodNullable; priority: z.ZodOptional; }, z.core.$strip>>; }, z.core.$strip>], "type">>>; workspaces: z.ZodOptional; subtitle: z.ZodNullable; projectId: z.core.$ZodBranded; dataset: z.ZodString; schemaDescriptorId: z.ZodNullable; basePath: z.ZodNullable; icon: z.ZodNullable; }, z.core.$strip>>>>; }, z.core.$strip>>>; slug: z.ZodNull; externalUrl: z.ZodString; }, z.core.$strip>]>; /** * The shape every application class instance carries. Each concrete schema * declares its own `config`; the base type only knows the shared `mfManifest` * slot — a federation app serves one, which routes it to the application domain. * @public */ type ApplicationBase = z.output & { config?: { mfManifest?: unknown; }; }; /** * @public */ type ActiveDeployment = z.output; /** * @public */ declare abstract class BrettApplication> extends AbstractApplication { #private; readonly application: TApplication; readonly id: ApplicationId; /** * For local applications (`isLocal === true`), the deployed application * that shares the same `id` — if one was passed at construction. `null` * for deployed applications or when no remote twin was provided. */ readonly remoteApplication: this | null; constructor(application: TApplication, type: TType, options?: { isLocal?: boolean; remoteApplication?: BrettApplication | null; }); abstract get subtitle(): string | undefined; /** Stable identity, distinct from the address — what config matching keys on. */ get name(): string; /** Qualified, globally-unique handle, read straight off the server-computed field. */ get reference(): string; toJSON(): TApplication; /** * Local dev servers and deployed federation apps (they serve an * mf-manifest) render as federated remotes; everything else in an iframe. */ get isFederated(): boolean; get isLocal(): boolean; /** * Interfaces ride the active deployment — a deployed app's own, or the ones a * local dev server's were adapted into upstream, so the read never branches. */ interfaces(type?: T): InterfacesOf; /** * @returns A fully resolved URL instance for the application. * For Sanity-hosted applications, constructs a URL from the `slug` using the * studio domain pattern resolved from the environment at the consuming * app's build time. For externally hosted applications (including local dev * servers), returns the `externalUrl` as-is. */ get url(): URL; } /** * Installation ID schema, branded to keep it distinct from the application id * an installation points at. * @public */ declare const InstallationId: z.core.$ZodBranded; /** * Installation ID type, branded for type safety. * @public */ type InstallationId = z.output; declare const InstallationSchema: z.ZodObject<{ id: z.core.$ZodBranded; applicationId: z.core.$ZodBranded; organizationId: z.core.$ZodBranded; application: z.ZodObject<{ title: z.ZodString; name: z.ZodString; reference: z.ZodString; slug: z.ZodNullable; }, z.core.$strip>; access: z.ZodArray>; activeConfig: z.ZodOptional>>; }, z.core.$strip>; /** * An organization's active installation of a singleton application, as returned * from `GET /installations?organizationId=&include=activeConfig,access`. * @public */ type Installation = z.output; /** * Validates and parses a raw `/installations` record into a branded * Installation. * @public */ declare function parseInstalledApplication(data: unknown): Installation; /** * @public */ declare abstract class InstalledApplication extends AbstractApplication { readonly id: ApplicationId; readonly organizationId: OrganizationId; readonly slug: string; /** Stable identity of the installed singleton — what config matching keys on. */ readonly name: string; /** Qualified, globally-unique handle of the installed singleton. */ readonly reference: string; constructor({ type, slug, name, reference, id, organizationId }: { type: TType; slug: string; name: string; reference: string; id: ApplicationId; organizationId: OrganizationId; }); get isFederated(): boolean; } /** * The deployed media-library config, as a module ref. A singleton application * has at most one active config, so the first match wins. * @public */ declare function findDeployedConfigRef(installations: Installation[]): RemoteModule | null; /** * @public */ declare class MediaLibraryApplication extends InstalledApplication<"media-library"> { constructor(id: ApplicationId, organizationId: OrganizationId); get href(): string; get title(): string; get url(): URL; get icon(): IconDescriptor; } /** * @public */ type Application = CoreApplication | StudioApplication | StudioWorkspace | CanvasApplication | MediaLibraryApplication; /** * @public */ declare class ApplicationList { readonly applications: TApplication[]; /** * @param applications - The applications to initialize the list with. */ constructor(applications: TApplication[]); toJSON(): (Studio | CoreApp)[]; /** Enables `for...of`, spread and `Array.from` over the list. */ [Symbol.iterator](): ArrayIterator; findApplicationsByType(type: T): Extract[]; findApplicationsByType(types: T): Extract[]; findApplication(type: "media-library"): Extract | undefined; findApplication(type: "canvas"): Extract | undefined; findApplication(type: "coreApp", id: ApplicationId): Extract | undefined; findApplication(type: "studio", id: ApplicationId): Extract | undefined; findApplication(type: "workspace", id: string): Extract | undefined; /** * The one application a location puts in the foreground — media library and * canvas by route (one per org), applications by the id in the URL. * `undefined` when nothing matches or the match has no app view (not * navigable, e.g. an SDK app that only docks panels). */ findByPath(pathname: string): TApplication | undefined; /** * Every brokered interface across the whole list, flattened into loadable * resolved refs — narrowed to the given `type`, or all of them. Delegates to * each app's {@link AbstractApplication.resolvedInterfaces}, so a consumer * holding the list (e.g. off the `applications.list` bus topic) can discover * every `tile` (with its footprint metadata) in the workbench and load each * into its own federation instance in one call. */ resolvedInterfaces(type?: T): ResolvedInterfacesOf; /** * Absence counts as a value, so callers diffing the foregrounded application * can compare across the states where nothing is. */ static areApplicationsEqual(application1?: Application | null, application2?: Application | null): boolean; } export { AbstractApplicationType as $, CoreApp as A, getDeployedConfigModuleRef as B, parseProject as C, Studio as D, LocalStudioApplicationManifest as E, parseCoreApplication as F, brandOrganizationId as G, Organization as H, APP_TYPE_NAME as I, CanvasApplication as J, parseOrganization as K, ActiveConfig as L, ExternalCoreApplication as M, InternalCoreApplication as N, Workspace as O, LocalCoreApplicationManifest as P, AbstractApplication as Q, CONFIG_MODULE_EXPOSE as R, brandProjectId as S, InternalStudioApplication as T, OrganizationId as U, RemoteModule as V, OrganizationMember as W, brandCanvasId as X, CanvasId as Y, parseCanvas as Z, StudioApplication as _, Installation as a, DockGroup as at, ProjectId as b, parseInstalledApplication as c, InterfaceSchema as ct, ApplicationId as d, LocalInterfaceSchema as dt, IconDescriptor as et, BrettApplication as f, Panel as ft, brandApplicationId as g, InternalApplication as h, getInitials as ht, findDeployedConfigRef as i, ResolvedInterfacesOf as it, CoreApplication as j, parseStudioApplication as k, ActiveDeployment as l, InterfacesOf as lt, ExternalApplication as m, TileSize as mt, ApplicationList as n, ResolvedInterface as nt, InstallationId as o, Interface as ot, BrettWorkspace as p, PanelComponent as pt, Canvas as q, MediaLibraryApplication as r, ResolvedInterfaceOfType as rt, InstalledApplication as s, InterfaceOfType as st, Application as t, LocalApplication as tt, ApplicationBase as u, LocalInterface as ut, StudioWorkspace as v, ExternalStudioApplication as w, ProjectMember as x, Project as y, LocalAppConfig as z }; //# sourceMappingURL=application-list-Dh3Y9exX.d.ts.map