@sanity/workbench-cli 2.8.4 → 2.9.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (29) hide show
  1. package/dist/_exports/_internal_worker_bus.d.ts +29 -0
  2. package/dist/_exports/_internal_worker_bus.js +3 -0
  3. package/dist/_exports/_internal_worker_bus.js.map +1 -0
  4. package/dist/_exports/build.d.ts +1 -1
  5. package/dist/_exports/contract-D_HnLQtT.d.ts +197 -0
  6. package/dist/_exports/defineApp-4hImcIIe.d.ts +182 -0
  7. package/dist/_exports/defineService-C1MhDwmh.d.ts +74 -0
  8. package/dist/_exports/deploy.d.ts +11 -3
  9. package/dist/_exports/index.d.ts +4 -50
  10. package/dist/_exports/index.js.map +1 -1
  11. package/dist/_exports/{resolveWorkbenchConfig-KhXnVKZ6.d.ts → resolveWorkbenchConfig-s3msa3Hu.d.ts} +3 -2
  12. package/dist/_exports/{summarizeInterfaces-noqbAtVC.d.ts → summarizeInterfaces-C0TCOa0J.d.ts} +4 -4
  13. package/dist/_exports/undeploy.d.ts +2 -2
  14. package/dist/actions/build/services/artifact.js +13 -3
  15. package/dist/actions/build/services/artifact.js.map +1 -1
  16. package/dist/actions/build/services/workerBus.js +159 -0
  17. package/dist/actions/build/services/workerBus.js.map +1 -0
  18. package/dist/actions/build/vite/plugins/plugin-sanity-extension-artifacts.js +17 -0
  19. package/dist/actions/build/vite/plugins/plugin-sanity-extension-artifacts.js.map +1 -1
  20. package/dist/actions/deploy/checkBuiltOutput.js +10 -2
  21. package/dist/actions/deploy/checkBuiltOutput.js.map +1 -1
  22. package/dist/actions/deploy/deployWorkbenchApp.js +10 -3
  23. package/dist/actions/deploy/deployWorkbenchApp.js.map +1 -1
  24. package/dist/defineService.js +11 -2
  25. package/dist/defineService.js.map +1 -1
  26. package/dist/services/applications.js +20 -8
  27. package/dist/services/applications.js.map +1 -1
  28. package/package.json +9 -4
  29. package/dist/_exports/defineApp-DOJE2kjo.d.ts +0 -376
@@ -0,0 +1,29 @@
1
+ import { n as ServiceBus } from "./defineService-C1MhDwmh.js";
2
+ /**
3
+ * The worker's side of the `workbench.bus.*` wire contract. The host relays
4
+ * each request to the Dashboard bus and stamps it with the worker's identity,
5
+ * so the client only tracks ids.
6
+ * @internal
7
+ */
8
+ declare function createWorkerBus(): {
9
+ /**
10
+ * The service author's API. The host owns the connection, opening it and ending it when
11
+ * it terminates the worker, so the worker cannot end it.
12
+ */
13
+ bus: ServiceBus;
14
+ /**
15
+ * The generated entry's terminate hook, not the author's. It sends nothing to
16
+ * the host, which has already disconnected; it only marks the client closed so
17
+ * the disposer's bus calls reject `ABORTED` at once instead of waiting out the
18
+ * local timeout. Hence not `disconnect`.
19
+ */
20
+ close: () => void;
21
+ /**
22
+ * The generated `worker.js` is the single `message` listener on `self` and
23
+ * routes every kind (terminate to the disposer, `workbench.bus.*` here), the
24
+ * way the host's `runWorker` routes to its relay.
25
+ */
26
+ receive: (data: unknown) => void;
27
+ };
28
+ export { createWorkerBus };
29
+ //# sourceMappingURL=_internal_worker_bus.d.ts.map
@@ -0,0 +1,3 @@
1
+ export { createWorkerBus } from '../actions/build/services/workerBus.js';
2
+
3
+ //# sourceMappingURL=_internal_worker_bus.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/_exports/_internal_worker_bus.ts"],"sourcesContent":["export {createWorkerBus} from '../actions/build/services/workerBus.js'\n"],"names":["createWorkerBus"],"mappings":"AAAA,SAAQA,eAAe,QAAO,yCAAwC"}
@@ -1,4 +1,4 @@
1
- import { a as resolveWorkbenchApp, i as WorkbenchExposes, n as resolveWorkbenchConfig, r as ResolvedWorkbenchApp, t as ResolvedMediaLibraryConfig } from "./resolveWorkbenchConfig-KhXnVKZ6.js";
1
+ import { a as resolveWorkbenchApp, i as WorkbenchExposes, n as resolveWorkbenchConfig, r as ResolvedWorkbenchApp, t as ResolvedMediaLibraryConfig } from "./resolveWorkbenchConfig-s3msa3Hu.js";
2
2
  import { InlineConfig, PluginOption } from "vite";
3
3
  /**
4
4
  * Resource bindings ride in a dedicated module in the app's bundle rather than an
@@ -0,0 +1,197 @@
1
+ import { z } from "zod/mini";
2
+ /** @internal */
3
+ declare const VIEW_CONTRACT_VERSION = 1;
4
+ /** @internal */
5
+ declare const SERVICE_CONTRACT_VERSION = 1;
6
+ /**
7
+ * A view component. The return is opaque so the runtime helpers carry no React
8
+ * dependency — the generated artifact renders it with the app's own React.
9
+ * @public
10
+ */
11
+ type ViewComponent<TProps> = (props: TProps) => unknown;
12
+ /** @public */
13
+ interface ViewComponentBaseProps<TView> {
14
+ view: TView;
15
+ }
16
+ /** Component slots per view surface; windows load outside the component artifact path. @internal */
17
+ declare const VIEW_COMPONENTS: {
18
+ readonly asset_source: readonly ["asset_source"];
19
+ readonly panel: readonly ["title", "panel"];
20
+ readonly tile: readonly ["tile"];
21
+ readonly window: readonly [];
22
+ };
23
+ /** @public */
24
+ type ViewSurface = keyof typeof VIEW_COMPONENTS;
25
+ /**
26
+ * A tile's footprint family — the shape it occupies on the dashboard. Modelled
27
+ * on iOS WidgetKit families, not a linear scale: `banner` is full-width and
28
+ * shallow, which a `small`→`large` magnitude can't express. The host maps a
29
+ * family to a layout slot; the component reads it to render per footprint.
30
+ * @public
31
+ */
32
+ declare const TileSizeSchema: z.ZodMiniEnum<{
33
+ small: "small";
34
+ large: "large";
35
+ banner: "banner";
36
+ }>;
37
+ /** @public */
38
+ type TileSize = z.infer<typeof TileSizeSchema>;
39
+ /** @public */
40
+ type ServiceType = 'worker';
41
+ declare const DockGroupSchema: z.ZodMiniEnum<{
42
+ system: "system";
43
+ applications: "applications";
44
+ user: "user";
45
+ }>;
46
+ /** @public */
47
+ type DockGroup = z.output<typeof DockGroupSchema>;
48
+ declare const PanelViewSchema: z.ZodMiniObject<{
49
+ dock: z.ZodMiniOptional<z.ZodMiniObject<{
50
+ group: z.ZodMiniOptional<z.ZodMiniEnum<{
51
+ system: "system";
52
+ applications: "applications";
53
+ user: "user";
54
+ }>>;
55
+ order: z.ZodMiniOptional<z.ZodMiniNumber<number>>;
56
+ }, z.core.$strip>>;
57
+ title: z.ZodMiniString<string>;
58
+ name: z.ZodMiniString<string>;
59
+ src: z.ZodMiniString<string>;
60
+ surface: z.ZodMiniLiteral<"panel">;
61
+ }, z.core.$strip>;
62
+ /** @public */
63
+ type PanelView = z.output<typeof PanelViewSchema>;
64
+ /** @public */
65
+ type DefinePanelViewInput = Omit<PanelView, 'surface'>;
66
+ /** @public */
67
+ declare function definePanelView(view: DefinePanelViewInput): PanelView;
68
+ declare const WindowViewSchema: z.ZodMiniObject<{
69
+ dock: z.ZodMiniOptional<z.ZodMiniObject<{
70
+ group: z.ZodMiniOptional<z.ZodMiniEnum<{
71
+ system: "system";
72
+ applications: "applications";
73
+ user: "user";
74
+ }>>;
75
+ order: z.ZodMiniOptional<z.ZodMiniNumber<number>>;
76
+ }, z.core.$strip>>;
77
+ title: z.ZodMiniString<string>;
78
+ name: z.ZodMiniString<string>;
79
+ src: z.ZodMiniString<string>;
80
+ surface: z.ZodMiniLiteral<"window">;
81
+ }, z.core.$strip>;
82
+ /** @public */
83
+ type WindowView = z.output<typeof WindowViewSchema>;
84
+ /** @public */
85
+ type DefineWindowViewInput = Omit<WindowView, 'surface'>;
86
+ /** @public */
87
+ declare function defineWindowView(view: DefineWindowViewInput): WindowView;
88
+ declare const AssetSourceViewSchema: z.ZodMiniObject<{
89
+ title: z.ZodMiniString<string>;
90
+ name: z.ZodMiniString<string>;
91
+ src: z.ZodMiniString<string>;
92
+ surface: z.ZodMiniLiteral<"asset_source">;
93
+ }, z.core.$strip>;
94
+ /** @public */
95
+ type AssetSourceView = z.output<typeof AssetSourceViewSchema>;
96
+ /** @public */
97
+ type DefineAssetSourceViewInput = Omit<AssetSourceView, 'surface'>;
98
+ /** @public */
99
+ declare function defineAssetSourceView(view: DefineAssetSourceViewInput): AssetSourceView;
100
+ declare const TileViewSchema: z.ZodMiniObject<{
101
+ order: z.ZodMiniOptional<z.ZodMiniNumber<number>>;
102
+ size: z.ZodMiniEnum<{
103
+ small: "small";
104
+ large: "large";
105
+ banner: "banner";
106
+ }>;
107
+ title: z.ZodMiniString<string>;
108
+ name: z.ZodMiniString<string>;
109
+ src: z.ZodMiniString<string>;
110
+ surface: z.ZodMiniLiteral<"tile">;
111
+ }, z.core.$strip>;
112
+ /** @public */
113
+ type TileView = z.output<typeof TileViewSchema>;
114
+ /** @public */
115
+ type DefineTileViewInput = Omit<TileView, 'surface'>;
116
+ /** @public */
117
+ declare function defineTileView(view: DefineTileViewInput): TileView;
118
+ /** @internal */
119
+ declare const InterfaceDeclarationSchema: z.ZodMiniDiscriminatedUnion<[z.ZodMiniObject<{
120
+ dock: z.ZodMiniOptional<z.ZodMiniObject<{
121
+ group: z.ZodMiniOptional<z.ZodMiniEnum<{
122
+ system: "system";
123
+ applications: "applications";
124
+ user: "user";
125
+ }>>;
126
+ order: z.ZodMiniOptional<z.ZodMiniNumber<number>>;
127
+ }, z.core.$strip>>;
128
+ title: z.ZodMiniString<string>;
129
+ name: z.ZodMiniString<string>;
130
+ src: z.ZodMiniString<string>;
131
+ surface: z.ZodMiniLiteral<"window">;
132
+ }, z.core.$strip>, z.ZodMiniObject<{
133
+ dock: z.ZodMiniOptional<z.ZodMiniObject<{
134
+ group: z.ZodMiniOptional<z.ZodMiniEnum<{
135
+ system: "system";
136
+ applications: "applications";
137
+ user: "user";
138
+ }>>;
139
+ order: z.ZodMiniOptional<z.ZodMiniNumber<number>>;
140
+ }, z.core.$strip>>;
141
+ title: z.ZodMiniString<string>;
142
+ name: z.ZodMiniString<string>;
143
+ src: z.ZodMiniString<string>;
144
+ surface: z.ZodMiniLiteral<"panel">;
145
+ }, z.core.$strip>, z.ZodMiniObject<{
146
+ title: z.ZodMiniString<string>;
147
+ name: z.ZodMiniString<string>;
148
+ src: z.ZodMiniString<string>;
149
+ surface: z.ZodMiniLiteral<"asset_source">;
150
+ }, z.core.$strip>, z.ZodMiniObject<{
151
+ order: z.ZodMiniOptional<z.ZodMiniNumber<number>>;
152
+ size: z.ZodMiniEnum<{
153
+ small: "small";
154
+ large: "large";
155
+ banner: "banner";
156
+ }>;
157
+ title: z.ZodMiniString<string>;
158
+ name: z.ZodMiniString<string>;
159
+ src: z.ZodMiniString<string>;
160
+ surface: z.ZodMiniLiteral<"tile">;
161
+ }, z.core.$strip>], "surface">;
162
+ /** @public */
163
+ type ViewDeclaration = z.output<typeof InterfaceDeclarationSchema>;
164
+ declare const WebWorkerSchema: z.ZodMiniObject<{
165
+ title: z.ZodMiniString<string>;
166
+ name: z.ZodMiniString<string>;
167
+ src: z.ZodMiniString<string>;
168
+ type: z.ZodMiniLiteral<"worker">;
169
+ }, z.core.$strip>;
170
+ /** @public */
171
+ type WebWorker = z.output<typeof WebWorkerSchema>;
172
+ /** @public */
173
+ type DefineWebWorkerInput = Omit<WebWorker, 'type'>;
174
+ /** @public */
175
+ declare function defineWebWorker(webWorker: DefineWebWorkerInput): WebWorker;
176
+ /**
177
+ * A workbench config's built value, keyed by `appType`; deploys as a versioned
178
+ * snapshot, not an interface.
179
+ * @internal
180
+ */
181
+ declare const ConfigSchema: z.ZodMiniDiscriminatedUnion<[z.ZodMiniObject<{
182
+ appType: z.ZodMiniLiteral<"media-library">;
183
+ fields: z.ZodMiniArray<z.ZodMiniObject<{
184
+ public: z.ZodMiniOptional<z.ZodMiniBoolean<boolean>>;
185
+ title: z.ZodMiniString<string>;
186
+ name: z.ZodMiniString<string>;
187
+ src: z.ZodMiniString<string>;
188
+ }, z.core.$strip>>;
189
+ }, z.core.$strip>], "appType">;
190
+ /**
191
+ * The `{appType, fields}` config value the build expands into a federation
192
+ * remote and the deploy summarizes.
193
+ * @internal
194
+ */
195
+ type WorkbenchConfigValue = z.output<typeof ConfigSchema>;
196
+ export { defineTileView as C, definePanelView as S, defineWindowView as T, ViewSurface as _, DefineWebWorkerInput as a, WorkbenchConfigValue as b, PanelView as c, TileSize as d, TileView as f, ViewDeclaration as g, ViewComponentBaseProps as h, DefineTileViewInput as i, SERVICE_CONTRACT_VERSION as l, ViewComponent as m, DefineAssetSourceViewInput as n, DefineWindowViewInput as o, VIEW_CONTRACT_VERSION as p, DefinePanelViewInput as r, DockGroup as s, AssetSourceView as t, ServiceType as u, WebWorker as v, defineWebWorker as w, defineAssetSourceView as x, WindowView as y };
197
+ //# sourceMappingURL=contract-D_HnLQtT.d.ts.map
@@ -0,0 +1,182 @@
1
+ import { z } from "zod/mini";
2
+ /**
3
+ * Runtime-validation schema for `defineApplication`.
4
+ * @internal
5
+ */
6
+ declare const DefineAppInputSchema: z.ZodMiniObject<{
7
+ applicationType: z.ZodMiniOptional<z.ZodMiniEnum<{
8
+ coreApp: "coreApp";
9
+ studio: "studio";
10
+ canvas: "canvas";
11
+ dashboard: "dashboard";
12
+ }>>;
13
+ dock: z.ZodMiniOptional<z.ZodMiniObject<{
14
+ group: z.ZodMiniOptional<z.ZodMiniEnum<{
15
+ system: "system";
16
+ applications: "applications";
17
+ user: "user";
18
+ }>>;
19
+ order: z.ZodMiniOptional<z.ZodMiniNumber<number>>;
20
+ }, z.core.$strip>>;
21
+ entry: z.ZodMiniOptional<z.ZodMiniString<string>>;
22
+ icon: z.ZodMiniOptional<z.ZodMiniString<string>>;
23
+ isSingleton: z.ZodMiniOptional<z.ZodMiniBoolean<boolean>>;
24
+ name: z.ZodMiniOptional<z.ZodMiniString<string>>;
25
+ organizationId: z.ZodMiniString<string>;
26
+ slug: z.ZodMiniString<string>;
27
+ title: z.ZodMiniString<string>;
28
+ views: z.ZodMiniOptional<z.ZodMiniArray<z.ZodMiniDiscriminatedUnion<[z.ZodMiniObject<{
29
+ dock: z.ZodMiniOptional<z.ZodMiniObject<{
30
+ group: z.ZodMiniOptional<z.ZodMiniEnum<{
31
+ system: "system";
32
+ applications: "applications";
33
+ user: "user";
34
+ }>>;
35
+ order: z.ZodMiniOptional<z.ZodMiniNumber<number>>;
36
+ }, z.core.$strip>>;
37
+ title: z.ZodMiniString<string>;
38
+ name: z.ZodMiniString<string>;
39
+ src: z.ZodMiniString<string>;
40
+ surface: z.ZodMiniLiteral<"window">;
41
+ }, z.core.$strip>, z.ZodMiniObject<{
42
+ dock: z.ZodMiniOptional<z.ZodMiniObject<{
43
+ group: z.ZodMiniOptional<z.ZodMiniEnum<{
44
+ system: "system";
45
+ applications: "applications";
46
+ user: "user";
47
+ }>>;
48
+ order: z.ZodMiniOptional<z.ZodMiniNumber<number>>;
49
+ }, z.core.$strip>>;
50
+ title: z.ZodMiniString<string>;
51
+ name: z.ZodMiniString<string>;
52
+ src: z.ZodMiniString<string>;
53
+ surface: z.ZodMiniLiteral<"panel">;
54
+ }, z.core.$strip>, z.ZodMiniObject<{
55
+ title: z.ZodMiniString<string>;
56
+ name: z.ZodMiniString<string>;
57
+ src: z.ZodMiniString<string>;
58
+ surface: z.ZodMiniLiteral<"asset_source">;
59
+ }, z.core.$strip>, z.ZodMiniObject<{
60
+ order: z.ZodMiniOptional<z.ZodMiniNumber<number>>;
61
+ size: z.ZodMiniEnum<{
62
+ small: "small";
63
+ large: "large";
64
+ banner: "banner";
65
+ }>;
66
+ title: z.ZodMiniString<string>;
67
+ name: z.ZodMiniString<string>;
68
+ src: z.ZodMiniString<string>;
69
+ surface: z.ZodMiniLiteral<"tile">;
70
+ }, z.core.$strip>], "surface">>>;
71
+ visibility: z.ZodMiniOptional<z.ZodMiniEnum<{
72
+ default: "default";
73
+ unlisted: "unlisted";
74
+ disabled: "disabled";
75
+ }>>;
76
+ webWorkers: z.ZodMiniOptional<z.ZodMiniArray<z.ZodMiniDiscriminatedUnion<[z.ZodMiniObject<{
77
+ title: z.ZodMiniString<string>;
78
+ name: z.ZodMiniString<string>;
79
+ src: z.ZodMiniString<string>;
80
+ type: z.ZodMiniLiteral<"worker">;
81
+ }, z.core.$strip>], "type">>>;
82
+ }, z.core.$strip>;
83
+ /**
84
+ * User-facing input for `defineApplication`. Excludes the internal
85
+ * `applicationType` and `isSingleton`.
86
+ * @public
87
+ */
88
+ type DefineAppInput = Omit<z.output<typeof DefineAppInputSchema>, 'applicationType' | 'isSingleton'>;
89
+ /**
90
+ * Nominal brand the CLI discriminates on to enable the workbench build/deploy
91
+ * codepath. Registered via `Symbol.for` so the marker survives module-realm
92
+ * boundaries — `@sanity/cli-core` re-derives the same global symbol with
93
+ * `Symbol.for` rather than importing it, so it stays internal to this module.
94
+ */
95
+ declare const WORKBENCH_APP: unique symbol;
96
+ /**
97
+ * The branded result of `defineApplication`. Carries the same fields as the
98
+ * input plus the internal brand — users only ever see `DefineAppInput`.
99
+ * @public
100
+ */
101
+ type DefineAppResult = DefineAppInput & {
102
+ readonly [WORKBENCH_APP]: true;
103
+ };
104
+ /**
105
+ * A branded app as the CLI reads it — the full schema shape, including the
106
+ * internal fields `DefineAppInput` omits. Schema-derived so the narrowing
107
+ * can't drift from what the schema validates.
108
+ * @public
109
+ */
110
+ type WorkbenchApp = DefineAppResult & z.output<typeof DefineAppInputSchema>;
111
+ /**
112
+ * Whether `app` is a branded `defineApplication(...)` result — the sole
113
+ * workbench opt-in.
114
+ * @public
115
+ */
116
+ declare function isWorkbenchApp(app: unknown): app is WorkbenchApp;
117
+ /**
118
+ * Declare a Sanity Dashboard application. Identity at runtime — returns the same
119
+ * object reference, tagged with the Dashboard brand. Field validation (the
120
+ * `slug` pattern etc.) runs at build time in the CLI via `DefineAppInputSchema`;
121
+ * this helper stays a thin, pure identity wrapper.
122
+ * @public
123
+ */
124
+ declare function defineApplication(input: DefineAppInput): DefineAppResult;
125
+ /**
126
+ * One custom field a media library exposes. `src` default-exports a `defineField(...)` schema type.
127
+ * @public
128
+ */
129
+ interface MediaLibraryField {
130
+ /** Unique within the media library. */
131
+ name: string;
132
+ src: string;
133
+ title: string;
134
+ /** Readable outside the owning organization. */
135
+ public?: boolean;
136
+ }
137
+ /**
138
+ * Sanity-owned singleton, so authors don't name or title the app — only `organizationId` is required.
139
+ * @public
140
+ */
141
+ interface DefineMediaLibraryInput {
142
+ /** Organization that owns the media library — the CLI runs and deploys against it. */
143
+ organizationId: string;
144
+ fields?: MediaLibraryField[];
145
+ }
146
+ /**
147
+ * Nominal brand the CLI discriminates a config on. A config is *not* an app: it
148
+ * carries no `slug`/`title`/application identity, only a target `appType`, its
149
+ * owning `organizationId`, and its `fields`. Registered via `Symbol.for` so the
150
+ * marker survives module-realm boundaries — `@sanity/cli-core` re-derives the
151
+ * same global symbol rather than importing it.
152
+ */
153
+ declare const WORKBENCH_CONFIG: unique symbol;
154
+ /**
155
+ * A branded workbench config as the CLI reads it: bound to its target app by
156
+ * `appType`, not carrying its own app identity. The deploy/undeploy/build paths
157
+ * discriminate it via {@link isWorkbenchConfig}.
158
+ * @public
159
+ */
160
+ interface WorkbenchConfig {
161
+ appType: 'media-library';
162
+ fields: MediaLibraryField[];
163
+ organizationId: string;
164
+ readonly [WORKBENCH_CONFIG]: true;
165
+ }
166
+ /**
167
+ * Whether `app` is a branded `unstable_defineMediaLibrary(...)` config — a
168
+ * config-carrier rather than an app. Configs live in `cliConfig.app` alongside
169
+ * apps but resolve through `resolveWorkbenchConfig`, not `resolveWorkbenchApp`.
170
+ * @public
171
+ */
172
+ declare function isWorkbenchConfig(app: unknown): app is WorkbenchConfig;
173
+ /**
174
+ * Declare the Sanity Media Library config. The Media Library is a Sanity-owned
175
+ * singleton, so this is not an app — it carries no slug or title, only the
176
+ * target `appType`, its owning organization, and the `fields` it contributes to
177
+ * the installation's config.
178
+ * @public
179
+ */
180
+ declare function unstable_defineMediaLibrary(input: DefineMediaLibraryInput): WorkbenchConfig;
181
+ export { WorkbenchApp as a, isWorkbenchApp as c, MediaLibraryField as i, isWorkbenchConfig as l, DefineAppResult as n, WorkbenchConfig as o, DefineMediaLibraryInput as r, defineApplication as s, DefineAppInput as t, unstable_defineMediaLibrary as u };
182
+ //# sourceMappingURL=defineApp-4hImcIIe.d.ts.map
@@ -0,0 +1,74 @@
1
+ import { l as SERVICE_CONTRACT_VERSION, u as ServiceType } from "./contract-D_HnLQtT.js";
2
+ import { MessageBus, MessageBusAbortOptions, StateTopic, ValueOf } from "@sanity/sdk/dashboard";
3
+ /**
4
+ * The service's own declaration, surfaced to the callback.
5
+ * @public
6
+ */
7
+ interface ServiceInfo {
8
+ readonly name: string;
9
+ readonly type: string;
10
+ }
11
+ /**
12
+ * The message bus as a service sees it: `emit` and `query` as in the SDK, and
13
+ * `subscribe` for state topics only. Only Dashboard can respond to its event
14
+ * topics, so a service has no reason to subscribe to them. There is no
15
+ * `disconnect`: Dashboard owns the connection and ends it when it stops the
16
+ * worker.
17
+ * @public
18
+ */
19
+ interface ServiceBus extends Omit<MessageBus, 'subscribe'> {
20
+ /** Runs a handler for each state value until its signal aborts. */
21
+ subscribe<K extends StateTopic>(type: K, handler: (value: ValueOf<K>) => void, options?: MessageBusAbortOptions): void;
22
+ }
23
+ /**
24
+ * Context every service callback receives when its worker starts. Mirrors how a
25
+ * view component receives its `view` — the service receives its own `service`.
26
+ * @public
27
+ */
28
+ interface ServiceContext {
29
+ readonly bus: ServiceBus;
30
+ readonly service: ServiceInfo;
31
+ }
32
+ /**
33
+ * A service callback. Runs once inside the worker on start; returns an optional
34
+ * disposer the host calls before terminating the worker.
35
+ * @public
36
+ */
37
+ type ServiceCallback = (context: ServiceContext) => (() => void) | void;
38
+ /** The callback shape each service type defines, keyed by type. */
39
+ interface ServiceCallbacksByType {
40
+ worker: ServiceCallback;
41
+ }
42
+ /**
43
+ * The result of `unstable_defineService`: the author's callback, the service
44
+ * type, and the internal contract version the worker artifact targets.
45
+ * @public
46
+ */
47
+ interface DefinedService<TType extends ServiceType = ServiceType> {
48
+ readonly run: ServiceCallbacksByType[TType];
49
+ readonly type: TType;
50
+ /** @internal */
51
+ readonly version: typeof SERVICE_CONTRACT_VERSION;
52
+ }
53
+ /**
54
+ * Define a Sanity Dashboard background service. The first argument narrows the
55
+ * callback shape — `"worker"` runs the callback inside a Web Worker.
56
+ *
57
+ * The callback receives `bus`, its connection to the Dashboard message bus:
58
+ * `bus.emit` sends an event (such as a dock-badge update), `bus.query` reads the
59
+ * current value of a state topic, and `bus.subscribe` runs a handler on each
60
+ * new value of a state topic until its `signal` aborts. A refused, unanswered
61
+ * or timed-out request rejects with an `Error` named `MessageBusError` whose
62
+ * `code` says why; it is not an instance of the SDK's `MessageBusError` class.
63
+ * The callback can return a disposer, which runs when Dashboard stops the
64
+ * worker. By then the bus is closed: subscriptions have ended, `emit` and
65
+ * `query` reject with code `ABORTED`, and `subscribe` throws that error.
66
+ *
67
+ * Identity at runtime: returns the callback tagged with its type and the contract
68
+ * version, for the CLI build to generate a worker artifact from. Used as the
69
+ * default export of a service's `src` file.
70
+ * @public
71
+ */
72
+ declare function unstable_defineService<TType extends ServiceType>(type: TType, run: ServiceCallbacksByType[TType]): DefinedService<TType>;
73
+ export { ServiceInfo as a, ServiceContext as i, ServiceBus as n, unstable_defineService as o, ServiceCallback as r, DefinedService as t };
74
+ //# sourceMappingURL=defineService-C1MhDwmh.d.ts.map
@@ -1,6 +1,6 @@
1
- import "./defineApp-DOJE2kjo.js";
2
- import { n as resolveWorkbenchConfig, t as ResolvedMediaLibraryConfig } from "./resolveWorkbenchConfig-KhXnVKZ6.js";
3
- import { a as DeployableWorkbenchApp, i as summarizeInterfaces, n as DeployedView, o as getWorkbench, r as DeployedWebWorker, t as DeployedInterface } from "./summarizeInterfaces-noqbAtVC.js";
1
+ import "./contract-D_HnLQtT.js";
2
+ import { n as resolveWorkbenchConfig, t as ResolvedMediaLibraryConfig } from "./resolveWorkbenchConfig-s3msa3Hu.js";
3
+ import { a as DeployableWorkbenchApp, i as summarizeInterfaces, n as DeployedView, o as getWorkbench, r as DeployedWebWorker, t as DeployedInterface } from "./summarizeInterfaces-C0TCOa0J.js";
4
4
  import { AppVisibility, CliConfig, Output } from "@sanity/cli-core";
5
5
  import "node:zlib";
6
6
  /**
@@ -76,6 +76,8 @@ interface Application {
76
76
  slug: string | null;
77
77
  title: string;
78
78
  type: ApplicationType;
79
+ /** Set when the customer serves the build; such an application never receives a tarball. */
80
+ externalUrl?: string;
79
81
  }
80
82
  /**
81
83
  * A resource a deployment may interact with, as Brett stores it. Per-deployment
@@ -129,6 +131,7 @@ declare function createCoreApp(options: {
129
131
  * @internal
130
132
  */
131
133
  declare function createStudio(options: {
134
+ externalUrl?: string;
132
135
  name?: string;
133
136
  organizationId: string;
134
137
  projectId: string | undefined;
@@ -145,6 +148,10 @@ declare function createStudio(options: {
145
148
  * `onDeployed` fires the instant the deployment is live, before the metadata
146
149
  * sync — so a caller can disarm a create-time rollback that must not delete an
147
150
  * application once it has an active deployment.
151
+ *
152
+ * The build's `mf-manifest.json` ships with every deployment. `isExternal`
153
+ * skips the tarball: the customer serves the build from the application's
154
+ * registered origin.
148
155
  * @internal
149
156
  */
150
157
  declare function deployWorkbenchApp(options: {
@@ -154,6 +161,7 @@ declare function deployWorkbenchApp(options: {
154
161
  icon?: string;
155
162
  isApp: boolean;
156
163
  isAutoUpdating: boolean;
164
+ isExternal?: boolean;
157
165
  label?: string;
158
166
  onDeployed?: () => void;
159
167
  /**
@@ -1,53 +1,7 @@
1
- import { C as VIEW_CONTRACT_VERSION, D as ViewSurface, E as ViewDeclaration, F as defineWindowView, M as definePanelView, N as defineTileView, O as WebWorker, P as defineWebWorker, S as TileView, T as ViewComponentBaseProps, _ as DockGroup, a as WorkbenchApp, b as ServiceType, c as isWorkbenchApp, d as AssetSourceView, f as DefineAssetSourceViewInput, g as DefineWindowViewInput, h as DefineWebWorkerInput, i as MediaLibraryField, j as defineAssetSourceView, k as WindowView, l as isWorkbenchConfig, m as DefineTileViewInput, n as DefineAppResult, o as WorkbenchConfig, p as DefinePanelViewInput, r as DefineMediaLibraryInput, s as defineApplication, t as DefineAppInput, u as unstable_defineMediaLibrary, v as PanelView, w as ViewComponent, x as TileSize, y as SERVICE_CONTRACT_VERSION } from "./defineApp-DOJE2kjo.js";
1
+ import { C as defineTileView, S as definePanelView, T as defineWindowView, _ as ViewSurface, a as DefineWebWorkerInput, c as PanelView, d as TileSize, f as TileView, g as ViewDeclaration, h as ViewComponentBaseProps, i as DefineTileViewInput, m as ViewComponent, n as DefineAssetSourceViewInput, o as DefineWindowViewInput, p as VIEW_CONTRACT_VERSION, r as DefinePanelViewInput, s as DockGroup, t as AssetSourceView, u as ServiceType, v as WebWorker, w as defineWebWorker, x as defineAssetSourceView, y as WindowView } from "./contract-D_HnLQtT.js";
2
+ import { a as ServiceInfo, i as ServiceContext, n as ServiceBus, o as unstable_defineService, r as ServiceCallback, t as DefinedService } from "./defineService-C1MhDwmh.js";
3
+ import { a as WorkbenchApp, c as isWorkbenchApp, i as MediaLibraryField, l as isWorkbenchConfig, n as DefineAppResult, o as WorkbenchConfig, r as DefineMediaLibraryInput, s as defineApplication, t as DefineAppInput, u as unstable_defineMediaLibrary } from "./defineApp-4hImcIIe.js";
2
4
  import { AssetSourceComponentProps } from "@sanity/types";
3
- /**
4
- * The service's own declaration, surfaced to the callback.
5
- * @public
6
- */
7
- interface ServiceInfo {
8
- readonly name: string;
9
- readonly type: string;
10
- }
11
- /**
12
- * Context every service callback receives when its worker starts. Mirrors how a
13
- * view component receives its `view` — the service receives its own `service`.
14
- * @public
15
- */
16
- interface ServiceContext {
17
- readonly service: ServiceInfo;
18
- }
19
- /**
20
- * A service callback. Runs once inside the worker on start; returns an optional
21
- * disposer the host calls before terminating the worker.
22
- * @public
23
- */
24
- type ServiceCallback = (context: ServiceContext) => (() => void) | void;
25
- /** The callback shape each service type defines, keyed by type. */
26
- interface ServiceCallbacksByType {
27
- worker: ServiceCallback;
28
- }
29
- /**
30
- * The result of `unstable_defineService`: the author's callback, the service
31
- * type, and the internal contract version the worker artifact targets.
32
- * @public
33
- */
34
- interface DefinedService<TType extends ServiceType = ServiceType> {
35
- readonly run: ServiceCallbacksByType[TType];
36
- readonly type: TType;
37
- /** @internal */
38
- readonly version: typeof SERVICE_CONTRACT_VERSION;
39
- }
40
- /**
41
- * Define a Sanity Dashboard background service. The first argument narrows the
42
- * callback shape — `"worker"` runs the callback inside a Web Worker, where it
43
- * can emit dock-badge updates and return a disposer.
44
- *
45
- * Identity at runtime: returns the callback tagged with its type and the contract
46
- * version, for the CLI build to generate a worker artifact from. Used as the
47
- * default export of a service's `src` file.
48
- * @public
49
- */
50
- declare function unstable_defineService<TType extends ServiceType>(type: TType, run: ServiceCallbacksByType[TType]): DefinedService<TType>;
51
5
  /** @public */
52
6
  type WindowViewProps = ViewComponentBaseProps<{
53
7
  name: string;
@@ -157,5 +111,5 @@ interface DefinedView<TSurface extends ViewSurface = ViewSurface> {
157
111
  * @public
158
112
  */
159
113
  declare function unstable_defineView<TSurface extends ViewSurface>(surface: TSurface, components: ViewComponentsBySurface[TSurface]): DefinedView<TSurface>;
160
- export { type AssetSourceComponent, type AssetSourceView, type AssetSourceViewComponents, type DefineAppInput, type DefineAppResult, type DefineAssetSourceViewInput, type DefineMediaLibraryInput, type DefinePanelViewInput, type DefineTileViewInput, type DefineWebWorkerInput, type DefineWindowViewInput, type DefinedService, type DefinedView, type DockGroup, type MediaLibraryField, type PanelComponent, type PanelView, type PanelViewComponents, type PanelViewProps, type ServiceCallback, type ServiceContext, type ServiceInfo, type ServiceType, type TileComponent, type TileSize, type TileView, type TileViewComponents, type TileViewProps, type ViewComponentsBySurface, type ViewDeclaration, type ViewSurface, type WebWorker, type WindowView, type WindowViewProps, type WorkbenchApp, type WorkbenchConfig, defineApplication, defineAssetSourceView, definePanelView, defineTileView, defineWebWorker, defineWindowView, isWorkbenchApp, isWorkbenchConfig, unstable_defineMediaLibrary, unstable_defineService, unstable_defineView };
114
+ export { type AssetSourceComponent, type AssetSourceView, type AssetSourceViewComponents, type DefineAppInput, type DefineAppResult, type DefineAssetSourceViewInput, type DefineMediaLibraryInput, type DefinePanelViewInput, type DefineTileViewInput, type DefineWebWorkerInput, type DefineWindowViewInput, type DefinedService, type DefinedView, type DockGroup, type MediaLibraryField, type PanelComponent, type PanelView, type PanelViewComponents, type PanelViewProps, type ServiceBus, type ServiceCallback, type ServiceContext, type ServiceInfo, type ServiceType, type TileComponent, type TileSize, type TileView, type TileViewComponents, type TileViewProps, type ViewComponentsBySurface, type ViewDeclaration, type ViewSurface, type WebWorker, type WindowView, type WindowViewProps, type WorkbenchApp, type WorkbenchConfig, defineApplication, defineAssetSourceView, definePanelView, defineTileView, defineWebWorker, defineWindowView, isWorkbenchApp, isWorkbenchConfig, unstable_defineMediaLibrary, unstable_defineService, unstable_defineView };
161
115
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/_exports/index.ts"],"sourcesContent":["export type {\n AssetSourceView,\n DefineAssetSourceViewInput,\n DefinePanelViewInput,\n DefineTileViewInput,\n DefineWebWorkerInput,\n DefineWindowViewInput,\n DockGroup,\n PanelView,\n ServiceType,\n TileSize,\n TileView,\n ViewDeclaration,\n ViewSurface,\n WebWorker,\n WindowView,\n} from '../contract.js'\nexport {\n defineAssetSourceView,\n definePanelView,\n defineTileView,\n defineWebWorker,\n defineWindowView,\n} from '../contract.js'\nexport {\n defineApplication,\n isWorkbenchApp,\n isWorkbenchConfig,\n unstable_defineMediaLibrary,\n} from '../defineApp.js'\nexport type {\n DefineAppInput,\n DefineAppResult,\n DefineMediaLibraryInput,\n MediaLibraryField,\n WorkbenchApp,\n WorkbenchConfig,\n} from '../defineApp.js'\nexport {unstable_defineService} from '../defineService.js'\nexport type {\n DefinedService,\n ServiceCallback,\n ServiceContext,\n ServiceInfo,\n} from '../defineService.js'\nexport {unstable_defineView} from '../defineView.js'\nexport type {\n AssetSourceComponent,\n AssetSourceViewComponents,\n DefinedView,\n PanelComponent,\n PanelViewComponents,\n PanelViewProps,\n TileComponent,\n TileViewComponents,\n TileViewProps,\n ViewComponentsBySurface,\n WindowViewProps,\n} from '../defineView.js'\n"],"names":["defineAssetSourceView","definePanelView","defineTileView","defineWebWorker","defineWindowView","defineApplication","isWorkbenchApp","isWorkbenchConfig","unstable_defineMediaLibrary","unstable_defineService","unstable_defineView"],"mappings":"AAiBA,SACEA,qBAAqB,EACrBC,eAAe,EACfC,cAAc,EACdC,eAAe,EACfC,gBAAgB,QACX,iBAAgB;AACvB,SACEC,iBAAiB,EACjBC,cAAc,EACdC,iBAAiB,EACjBC,2BAA2B,QACtB,kBAAiB;AASxB,SAAQC,sBAAsB,QAAO,sBAAqB;AAO1D,SAAQC,mBAAmB,QAAO,mBAAkB"}
1
+ {"version":3,"sources":["../../src/_exports/index.ts"],"sourcesContent":["export type {\n AssetSourceView,\n DefineAssetSourceViewInput,\n DefinePanelViewInput,\n DefineTileViewInput,\n DefineWebWorkerInput,\n DefineWindowViewInput,\n DockGroup,\n PanelView,\n ServiceType,\n TileSize,\n TileView,\n ViewDeclaration,\n ViewSurface,\n WebWorker,\n WindowView,\n} from '../contract.js'\nexport {\n defineAssetSourceView,\n definePanelView,\n defineTileView,\n defineWebWorker,\n defineWindowView,\n} from '../contract.js'\nexport {\n defineApplication,\n isWorkbenchApp,\n isWorkbenchConfig,\n unstable_defineMediaLibrary,\n} from '../defineApp.js'\nexport type {\n DefineAppInput,\n DefineAppResult,\n DefineMediaLibraryInput,\n MediaLibraryField,\n WorkbenchApp,\n WorkbenchConfig,\n} from '../defineApp.js'\nexport {unstable_defineService} from '../defineService.js'\nexport type {\n DefinedService,\n ServiceBus,\n ServiceCallback,\n ServiceContext,\n ServiceInfo,\n} from '../defineService.js'\nexport {unstable_defineView} from '../defineView.js'\nexport type {\n AssetSourceComponent,\n AssetSourceViewComponents,\n DefinedView,\n PanelComponent,\n PanelViewComponents,\n PanelViewProps,\n TileComponent,\n TileViewComponents,\n TileViewProps,\n ViewComponentsBySurface,\n WindowViewProps,\n} from '../defineView.js'\n"],"names":["defineAssetSourceView","definePanelView","defineTileView","defineWebWorker","defineWindowView","defineApplication","isWorkbenchApp","isWorkbenchConfig","unstable_defineMediaLibrary","unstable_defineService","unstable_defineView"],"mappings":"AAiBA,SACEA,qBAAqB,EACrBC,eAAe,EACfC,cAAc,EACdC,eAAe,EACfC,gBAAgB,QACX,iBAAgB;AACvB,SACEC,iBAAiB,EACjBC,cAAc,EACdC,iBAAiB,EACjBC,2BAA2B,QACtB,kBAAiB;AASxB,SAAQC,sBAAsB,QAAO,sBAAqB;AAQ1D,SAAQC,mBAAmB,QAAO,mBAAkB"}
@@ -1,4 +1,5 @@
1
- import { A as WorkbenchConfigValue, t as DefineAppInput } from "./defineApp-DOJE2kjo.js";
1
+ import { b as WorkbenchConfigValue } from "./contract-D_HnLQtT.js";
2
+ import { t as DefineAppInput } from "./defineApp-4hImcIIe.js";
2
3
  import { AppVisibility, CliConfig } from "@sanity/cli-core";
3
4
  /**
4
5
  * Bundled so adding a declaration family touches this type and the artifact
@@ -59,4 +60,4 @@ interface ResolvedMediaLibraryConfig {
59
60
  */
60
61
  declare function resolveWorkbenchConfig(cliConfig: CliConfig | null | undefined): ResolvedMediaLibraryConfig | null;
61
62
  export { resolveWorkbenchApp as a, WorkbenchExposes as i, resolveWorkbenchConfig as n, ResolvedWorkbenchApp as r, ResolvedMediaLibraryConfig as t };
62
- //# sourceMappingURL=resolveWorkbenchConfig-KhXnVKZ6.d.ts.map
63
+ //# sourceMappingURL=resolveWorkbenchConfig-s3msa3Hu.d.ts.map
@@ -1,7 +1,7 @@
1
- import { D as ViewSurface, b as ServiceType } from "./defineApp-DOJE2kjo.js";
2
- import { i as WorkbenchExposes, r as ResolvedWorkbenchApp } from "./resolveWorkbenchConfig-KhXnVKZ6.js";
3
- import { CliConfig } from "@sanity/cli-core";
1
+ import { _ as ViewSurface, u as ServiceType } from "./contract-D_HnLQtT.js";
2
+ import { i as WorkbenchExposes, r as ResolvedWorkbenchApp } from "./resolveWorkbenchConfig-s3msa3Hu.js";
4
3
  import { z } from "zod/mini";
4
+ import { CliConfig } from "@sanity/cli-core";
5
5
  /**
6
6
  * Payload registering an app's views with the application service on deploy.
7
7
  *
@@ -62,4 +62,4 @@ declare function summarizeInterfaces({ views, webWorkers }: WorkbenchExposes): {
62
62
  views: DeployedView[];
63
63
  };
64
64
  export { DeployableWorkbenchApp as a, summarizeInterfaces as i, DeployedView as n, getWorkbench as o, DeployedWebWorker as r, DeployedInterface as t };
65
- //# sourceMappingURL=summarizeInterfaces-noqbAtVC.d.ts.map
65
+ //# sourceMappingURL=summarizeInterfaces-C0TCOa0J.d.ts.map
@@ -1,5 +1,5 @@
1
- import { t as ResolvedMediaLibraryConfig } from "./resolveWorkbenchConfig-KhXnVKZ6.js";
2
- import { a as DeployableWorkbenchApp, n as DeployedView, r as DeployedWebWorker } from "./summarizeInterfaces-noqbAtVC.js";
1
+ import { t as ResolvedMediaLibraryConfig } from "./resolveWorkbenchConfig-s3msa3Hu.js";
2
+ import { a as DeployableWorkbenchApp, n as DeployedView, r as DeployedWebWorker } from "./summarizeInterfaces-C0TCOa0J.js";
3
3
  import "node:zlib";
4
4
  import { UndeployAdapter, UndeployApplicationTarget, UndeployConfigTarget } from "@sanity/cli-core/undeploy";
5
5
  interface ConfigSnapshot {