@statelyai/sdk 0.23.0 → 0.24.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.
package/README.md CHANGED
@@ -45,6 +45,10 @@ embed.init({
45
45
  });
46
46
  ```
47
47
 
48
+ The embed `apiKey` is sent to the iframe over `postMessage` after the editor
49
+ handshake; it is not included in the iframe URL. Call `embed.setApiKey(token)`
50
+ when the host refreshes the access token.
51
+
48
52
  Use `viewMode: 'list'` on `createStatelyEmbed` to add `?view=list` to the
49
53
  iframe URL, or subscribe to `viewModeChanged` when the user switches views.
50
54
 
@@ -108,7 +112,7 @@ Key capabilities:
108
112
  - **Reference documents** supplied as ordered, read-only Markdown, code, or text
109
113
  - **Comments** via Liveblocks integration (optional)
110
114
  - **Asset uploads** with built-in S3 and Supabase adapters, or bring your own upload handler
111
- - **Runtime settings** - toggle color mode, grid, snap lines, autolayout, and view mode on the fly
115
+ - **Runtime settings** - toggle color mode, grid, snap lines, and view mode on the fly
112
116
 
113
117
  ### Resource API client
114
118
 
@@ -177,15 +177,32 @@ var EditorHostSession = class {
177
177
  access;
178
178
  watchedSourceUris = /* @__PURE__ */ new Set();
179
179
  selfEditCount = 0;
180
+ saveReminderShown = false;
180
181
  watcher;
182
+ changeWatcher;
181
183
  retrieveRequestCount = 0;
182
184
  pendingRetrievals = /* @__PURE__ */ new Map();
183
185
  constructor(options) {
184
186
  this.options = options;
185
- this.watcher = options.source.watchSavedDocuments?.((uri) => this.handleSavedDocument(uri));
187
+ this.watcher = options.source.watchSavedDocuments?.((uri) => {
188
+ this.saveReminderShown = false;
189
+ return this.handleSavedDocument(uri);
190
+ });
191
+ this.changeWatcher = options.source.watchChangedDocuments?.((uri) => {
192
+ if (uri !== this.options.source.rootUri && !this.watchedSourceUris.has(uri)) return;
193
+ if (this.selfEditCount > 0) return;
194
+ if (this.saveReminderShown) return;
195
+ this.saveReminderShown = true;
196
+ this.options.send({
197
+ type: "@statelyai.toast",
198
+ message: "Save code to see changes.",
199
+ toastType: "info"
200
+ });
201
+ });
186
202
  }
187
203
  dispose() {
188
204
  this.watcher?.dispose();
205
+ this.changeWatcher?.dispose();
189
206
  for (const pending of this.pendingRetrievals.values()) pending.reject(/* @__PURE__ */ new Error("Editor session disposed before export completed."));
190
207
  this.pendingRetrievals.clear();
191
208
  }
@@ -142,6 +142,9 @@ interface EditorSourceHost {
142
142
  watchSavedDocuments?(listener: (uri: string) => void | Promise<void>): {
143
143
  dispose(): void;
144
144
  };
145
+ watchChangedDocuments?(listener: (uri: string) => void): {
146
+ dispose(): void;
147
+ };
145
148
  getPreserveStatelyMetadata?(uri: string): boolean;
146
149
  }
147
150
  interface EditorHostSessionOptions {
@@ -170,7 +173,9 @@ declare class EditorHostSession {
170
173
  private access;
171
174
  private watchedSourceUris;
172
175
  private selfEditCount;
176
+ private saveReminderShown;
173
177
  private watcher;
178
+ private changeWatcher;
174
179
  private retrieveRequestCount;
175
180
  private pendingRetrievals;
176
181
  constructor(options: EditorHostSessionOptions);
@@ -1,2 +1,2 @@
1
- import { a as EditorSyncError, c as fetchEditorSyncAccess, d as EditorHostInboundMessage, f as EditorHostInitOptions, i as EditorSyncBackend, l as EDITOR_PROTOCOL_VERSION, m as EditorHostValidationIssue, n as EditorHostSessionOptions, o as RemoteEditorSyncBackendOptions, p as EditorHostOutboundMessage, r as EditorSourceHost, s as createRemoteEditorSyncBackend, t as EditorHostSession, u as EditorHostExportFormat } from "./editorHostSession-CMwC9KKh.mjs";
1
+ import { a as EditorSyncError, c as fetchEditorSyncAccess, d as EditorHostInboundMessage, f as EditorHostInitOptions, i as EditorSyncBackend, l as EDITOR_PROTOCOL_VERSION, m as EditorHostValidationIssue, n as EditorHostSessionOptions, o as RemoteEditorSyncBackendOptions, p as EditorHostOutboundMessage, r as EditorSourceHost, s as createRemoteEditorSyncBackend, t as EditorHostSession, u as EditorHostExportFormat } from "./editorHostSession-DTXKcLhR.mjs";
2
2
  export { EDITOR_PROTOCOL_VERSION, EditorHostExportFormat, EditorHostInboundMessage, EditorHostInitOptions, EditorHostOutboundMessage, EditorHostSession, EditorHostSessionOptions, EditorHostValidationIssue, EditorSourceHost, EditorSyncBackend, EditorSyncError, RemoteEditorSyncBackendOptions, createRemoteEditorSyncBackend, fetchEditorSyncAccess };
@@ -1,5 +1,5 @@
1
1
  import "./openapi-BTDjYWXd.mjs";
2
2
  import { t as EDITOR_PROTOCOL_VERSION } from "./editorHostProtocol-Bko7wge8.mjs";
3
- import { i as fetchEditorSyncAccess, n as EditorSyncError, r as createRemoteEditorSyncBackend, t as EditorHostSession } from "./editorHostSession-BZE_Wm0m.mjs";
3
+ import { i as fetchEditorSyncAccess, n as EditorSyncError, r as createRemoteEditorSyncBackend, t as EditorHostSession } from "./editorHostSession-BwS-EiBJ.mjs";
4
4
 
5
5
  export { EDITOR_PROTOCOL_VERSION, EditorHostSession, EditorSyncError, createRemoteEditorSyncBackend, fetchEditorSyncAccess };
package/dist/embed.d.mts CHANGED
@@ -1,6 +1,6 @@
1
1
  import { i as ProfileManifest } from "./index-D_pO_Pr8.mjs";
2
2
  import { i as StatelyGraph } from "./graph-1fwR0Ynl.mjs";
3
- import { CapabilityDeniedEvent, CommentsConfig, EditorCapabilities, EmbedDocument, EmbedDocumentLanguage, EmbedEventHandler, EmbedEventMap, EmbedEventName, EmbedExtensionsManifest, EmbedMode, ExportCallOptions, ExportFormat, ExportFormatMap, InitOptions, MachineInitOptions, MachineSourceLocations, ProjectEmbedMachine, UploadResult } from "./protocol.mjs";
3
+ import { CapabilityDeniedEvent, CommentsConfig, EditorCapabilities, EmbedDocument, EmbedDocumentLanguage, EmbedEventHandler, EmbedEventMap, EmbedEventName, EmbedExtensionsManifest, EmbedMode, ExportCallOptions, ExportFormat, ExportFormatMap, InitOptions, MachineInitOptions, MachineSourceLocations, ProjectEmbedMachine, ProjectWorkspaceAction, ProjectWorkspaceActionIcon, ProjectWorkspaceCapabilities, ProjectWorkspaceConfig, ProjectWorkspaceMachine, ProjectWorkspaceProject, UploadResult } from "./protocol.mjs";
4
4
  import { AssetUploadAdapter } from "./assetStorage.mjs";
5
5
 
6
6
  //#region src/embed.d.ts
@@ -71,6 +71,7 @@ type EmbedFormatDefinition = {
71
71
  };
72
72
  interface StatelyEmbedOptions extends Partial<MachineInitOptions> {
73
73
  baseUrl: string;
74
+ /** Access token sent to the iframe over the embed protocol. */
74
75
  apiKey?: string;
75
76
  /** Initial canvas view. Also reflected in the iframe URL as `?view=`. */
76
77
  viewMode?: 'graph' | 'list';
@@ -89,6 +90,10 @@ interface StatelyEmbedOptions extends Partial<MachineInitOptions> {
89
90
  currentMachineId?: string;
90
91
  /** Project mode only — initial comments keyed by machine id. */
91
92
  commentsByMachineId?: Record<string, CommentsConfig>;
93
+ /** Project mode only — optional host-provided sidebar content/actions. */
94
+ projectWorkspace?: ProjectWorkspaceConfig;
95
+ /** Project mode only — whether the project workspace starts open. */
96
+ projectWorkspaceOpen?: boolean;
92
97
  /** Asset upload configuration. If omitted, files are stored as base64 data URLs. */
93
98
  assets?: AssetConfig;
94
99
  profiles?: readonly EmbedProfileDefinition[];
@@ -111,14 +116,21 @@ interface StatelyEmbed {
111
116
  attach(iframe: HTMLIFrameElement): void;
112
117
  /** Create an iframe and mount it into a container element. */
113
118
  mount(container: HTMLElement): HTMLIFrameElement;
119
+ /** Update the access token used by the iframe. */
120
+ setApiKey(apiKey: string): void;
114
121
  /** Send init message (queued if iframe not ready yet). */
115
122
  init(options: InitOptions): void;
116
123
  /** Update the machine (shorthand for update message). */
117
124
  updateMachine(machine: unknown, format?: string, sourceLocations?: MachineSourceLocations): void;
118
125
  /** Update the project machine list without re-creating the iframe. */
119
- updateProject(machines: ProjectEmbedMachine[], currentMachineId?: string, commentsByMachineId?: Record<string, CommentsConfig>): void;
126
+ updateProject(machines: ProjectEmbedMachine[], currentMachineId?: string, commentsByMachineId?: Record<string, CommentsConfig>, projectOptions?: {
127
+ projectWorkspace?: ProjectWorkspaceConfig;
128
+ projectWorkspaceOpen?: boolean;
129
+ }): void;
120
130
  /** Select the active machine in project mode. */
121
131
  selectMachine(machineId: string): void;
132
+ /** Open or close the project sidebar in project mode. */
133
+ setProjectWorkspaceOpen(open: boolean): void;
122
134
  /** Change the embed mode. */
123
135
  setMode(mode: EmbedMode): void;
124
136
  /** Change the embed theme. */
@@ -138,4 +150,4 @@ interface StatelyEmbed {
138
150
  }
139
151
  declare function createStatelyEmbed(options: StatelyEmbedOptions): StatelyEmbed;
140
152
  //#endregion
141
- export { AssetConfig, type CapabilityDeniedEvent, type CommentsConfig, type EditorCapabilities, type EmbedDocument, type EmbedDocumentLanguage, EmbedEntity, type EmbedEventHandler, type EmbedEventMap, type EmbedEventName, type EmbedExtensionsManifest, EmbedFormatContext, EmbedFormatDefinition, EmbedGraph, type EmbedMode, EmbedProfileDefinition, type ExportCallOptions, type ExportFormat, type ExportFormatMap, type InitOptions, type MachineInitOptions, type MachineSourceLocations, type ProjectEmbedMachine, StatelyEmbed, StatelyEmbedOptions, type UploadResult, createStatelyEmbed };
153
+ export { AssetConfig, type CapabilityDeniedEvent, type CommentsConfig, type EditorCapabilities, type EmbedDocument, type EmbedDocumentLanguage, EmbedEntity, type EmbedEventHandler, type EmbedEventMap, type EmbedEventName, type EmbedExtensionsManifest, EmbedFormatContext, EmbedFormatDefinition, EmbedGraph, type EmbedMode, EmbedProfileDefinition, type ExportCallOptions, type ExportFormat, type ExportFormatMap, type InitOptions, type MachineInitOptions, type MachineSourceLocations, type ProjectEmbedMachine, type ProjectWorkspaceAction, type ProjectWorkspaceActionIcon, type ProjectWorkspaceCapabilities, type ProjectWorkspaceConfig, type ProjectWorkspaceMachine, type ProjectWorkspaceProject, StatelyEmbed, StatelyEmbedOptions, type UploadResult, createStatelyEmbed };
package/dist/embed.mjs CHANGED
@@ -1,4 +1,4 @@
1
- import { a as createEventRegistry, o as createPendingExportManager, r as createPostMessageTransport, s as toInitMessage, t as SDK_VERSION } from "./version-D3ug8VHa.mjs";
1
+ import { a as createEventRegistry, o as createPendingExportManager, r as createPostMessageTransport, s as toInitMessage, t as SDK_VERSION } from "./version-DALql3iM.mjs";
2
2
  import { t as EDITOR_PROTOCOL_VERSION } from "./editorHostProtocol-Bko7wge8.mjs";
3
3
 
4
4
  //#region src/embed.ts
@@ -25,10 +25,13 @@ function assertExtensionCall(value) {
25
25
  if ((value.method === "export" || value.method === "validate") && !isEmbedGraph(payload.graph)) throw new Error("Invalid extension graph payload.");
26
26
  if (value.method === "validate" && payload.revision !== void 0 && typeof payload.revision !== "number") throw new Error("Invalid extension revision payload.");
27
27
  }
28
+ function normalizeApiKey(apiKey) {
29
+ return apiKey?.trim() || void 0;
30
+ }
28
31
  function buildEmbedUrl(options) {
29
32
  const base = options.baseUrl.replace(/\/+$/, "") + "/embed";
30
33
  const url = new URL(base);
31
- if (options.apiKey) url.searchParams.set("api_key", options.apiKey);
34
+ if (normalizeApiKey(options.apiKey)) url.searchParams.set("auth", "message");
32
35
  if (options.viewMode) url.searchParams.set("view", options.viewMode);
33
36
  return url.toString();
34
37
  }
@@ -81,6 +84,8 @@ function extractInitOptions(options) {
81
84
  capabilities: options.capabilities,
82
85
  panels: options.panels,
83
86
  commentsByMachineId: options.commentsByMachineId,
87
+ projectWorkspace: options.projectWorkspace,
88
+ projectWorkspaceOpen: options.projectWorkspaceOpen,
84
89
  settings: options.settings,
85
90
  unsavedIndicator: options.unsavedIndicator
86
91
  };
@@ -111,6 +116,7 @@ function createStatelyEmbed(options) {
111
116
  let ownedIframe = false;
112
117
  let destroyed = false;
113
118
  let editorProtocolCompatible;
119
+ let apiKey = normalizeApiKey(options.apiKey);
114
120
  const pendingMessages = [];
115
121
  const events = createEventRegistry();
116
122
  const profiles = new Map((options.profiles ?? []).map((profile) => [profile.profile, profile]));
@@ -139,6 +145,12 @@ function createStatelyEmbed(options) {
139
145
  transport.send(msg);
140
146
  }
141
147
  }
148
+ function sendApiKey() {
149
+ if (apiKey) send({
150
+ type: "@statelyai.setApiKey",
151
+ apiKey
152
+ });
153
+ }
142
154
  function formatContext(profile) {
143
155
  const namespace = profile.namespace ?? /^(@[^/]+)\//.exec(profile.profile)?.[1];
144
156
  if (!namespace) throw new Error(`Profile ${profile.profile} has no namespace.`);
@@ -229,6 +241,7 @@ function createStatelyEmbed(options) {
229
241
  }
230
242
  });
231
243
  } else editorProtocolCompatible = true;
244
+ sendApiKey();
232
245
  flush();
233
246
  if (uploadAsset) send({
234
247
  type: "@statelyai.uploadCapabilities",
@@ -278,6 +291,19 @@ function createStatelyEmbed(options) {
278
291
  case "@statelyai.project.machineSelected":
279
292
  events.emit("machineSelected", { machineId: String(data.machineId) });
280
293
  break;
294
+ case "@statelyai.project.workspaceAction": {
295
+ const action = data;
296
+ events.emit("projectWorkspaceAction", {
297
+ actionId: String(action.actionId),
298
+ projectId: typeof action.projectId === "string" ? action.projectId : void 0,
299
+ machineId: typeof action.machineId === "string" ? action.machineId : void 0,
300
+ ...action.data !== void 0 ? { data: action.data } : {}
301
+ });
302
+ break;
303
+ }
304
+ case "@statelyai.project.workspaceOpenChanged":
305
+ events.emit("projectWorkspaceOpenChanged", { open: Boolean(data.open) });
306
+ break;
281
307
  case "@statelyai.viewModeChanged": {
282
308
  const viewMode = data;
283
309
  options.onViewModeChanged?.(viewMode.viewMode);
@@ -396,6 +422,10 @@ function createStatelyEmbed(options) {
396
422
  setupTransport(el);
397
423
  return el;
398
424
  },
425
+ setApiKey(nextApiKey) {
426
+ apiKey = normalizeApiKey(nextApiKey);
427
+ sendApiKey();
428
+ },
399
429
  init(opts) {
400
430
  send(toInitMessage("machine" in opts ? {
401
431
  ...opts,
@@ -410,12 +440,14 @@ function createStatelyEmbed(options) {
410
440
  sourceLocations
411
441
  });
412
442
  },
413
- updateProject(machines, currentMachineId, commentsByMachineId) {
443
+ updateProject(machines, currentMachineId, commentsByMachineId, projectOptions) {
414
444
  send({
415
445
  type: "@statelyai.project.update",
416
446
  machines,
417
447
  currentMachineId,
418
- commentsByMachineId
448
+ commentsByMachineId,
449
+ projectWorkspace: projectOptions?.projectWorkspace,
450
+ projectWorkspaceOpen: projectOptions?.projectWorkspaceOpen
419
451
  });
420
452
  },
421
453
  selectMachine(machineId) {
@@ -424,6 +456,12 @@ function createStatelyEmbed(options) {
424
456
  machineId
425
457
  });
426
458
  },
459
+ setProjectWorkspaceOpen(open) {
460
+ send({
461
+ type: "@statelyai.project.setWorkspaceOpen",
462
+ open
463
+ });
464
+ },
427
465
  setMode(mode) {
428
466
  send({
429
467
  type: "@statelyai.setMode",
package/dist/index.d.mts CHANGED
@@ -1,10 +1,10 @@
1
1
  import { StatelyApiClientOptions, StatelyApiError, StatelyApiUrlOptions, createStatelyApiClient, createStatelyApiUrl } from "./api.mjs";
2
2
  import { _ as GraphPatch, a as RawCode, c as eventsSchemaToTSType, d as jsonSchemaToTSType, f as raw, l as graphToMachineConfig, m as ActionLocation, n as CodeGenGraph, o as XStateTSOptions, p as serializeJS, r as MachineConfigOptions, s as contextSchemaToTSType, u as graphToXStateTS } from "./index-D_pO_Pr8.mjs";
3
3
  import { C as EventTypeData, S as DigraphNodeConfig, _ as studioMachineConverter, a as StatelyGraphData, b as DigraphConfig, c as StatelyInvoke, d as StudioAction, f as StudioEdge, g as fromStudioMachine, h as StudioNode, i as StatelyGraph, l as StatelyNodeData, m as StudioMachine, o as StatelyGuard, r as StatelyEdgeData, t as StatelyAction, v as toStudioMachine, w as StateNodeJSONData, x as DigraphEdgeConfig, y as DigraphAction } from "./graph-1fwR0Ynl.mjs";
4
- import { CapabilityDeniedCapability, CapabilityDeniedEvent, CommentsConfig, EMBED_DOCUMENT_LANGUAGES, EMBED_DOCUMENT_LIMITS, EditorCapabilities, EmbedDocument, EmbedDocumentLanguage, EmbedEventHandler, EmbedEventMap, EmbedEventName, EmbedMode, ExportCallOptions, ExportFormat, ExportFormatMap, INSPECTION_PROTOCOL_VERSION, INSPECTION_ROOM_QUERY_PARAM, InitOptions, InspectionAction, InspectionSentEvent, InspectionTakenTransition, ProjectEmbedMachine, UploadResult, createInspectionActorId, createInspectionRoomUrls, getInspectionRoomId } from "./protocol.mjs";
4
+ import { CapabilityDeniedCapability, CapabilityDeniedEvent, CommentsConfig, EMBED_DOCUMENT_LANGUAGES, EMBED_DOCUMENT_LIMITS, EditorCapabilities, EmbedDocument, EmbedDocumentLanguage, EmbedEventHandler, EmbedEventMap, EmbedEventName, EmbedMode, ExportCallOptions, ExportFormat, ExportFormatMap, INSPECTION_PROTOCOL_VERSION, INSPECTION_ROOM_QUERY_PARAM, InitOptions, InspectionAction, InspectionSentEvent, InspectionTakenTransition, ProjectEmbedMachine, ProjectWorkspaceAction, ProjectWorkspaceActionIcon, ProjectWorkspaceCapabilities, ProjectWorkspaceConfig, ProjectWorkspaceMachine, ProjectWorkspaceProject, UploadResult, createInspectionActorId, createInspectionRoomUrls, getInspectionRoomId } from "./protocol.mjs";
5
5
  import { AssetUploadAdapter, AssetUploadContext, AssetUploadRequest, CreateS3AssetUploadAdapterOptions, CreateSupabaseAssetUploadAdapterOptions, S3UploadTarget, SupabaseStorageClient, createS3AssetUploadAdapter, createSupabaseAssetUploadAdapter } from "./assetStorage.mjs";
6
6
  import { i as getCredentialToken, n as StatelyCredential, r as createAuthorizationHeader, t as StatelyAuthMode } from "./auth-B0ZTKri2.mjs";
7
- import { c as fetchEditorSyncAccess, d as EditorHostInboundMessage, f as EditorHostInitOptions, i as EditorSyncBackend, l as EDITOR_PROTOCOL_VERSION, m as EditorHostValidationIssue, n as EditorHostSessionOptions, o as RemoteEditorSyncBackendOptions, p as EditorHostOutboundMessage, r as EditorSourceHost, s as createRemoteEditorSyncBackend, t as EditorHostSession, u as EditorHostExportFormat } from "./editorHostSession-CMwC9KKh.mjs";
7
+ import { c as fetchEditorSyncAccess, d as EditorHostInboundMessage, f as EditorHostInitOptions, i as EditorSyncBackend, l as EDITOR_PROTOCOL_VERSION, m as EditorHostValidationIssue, n as EditorHostSessionOptions, o as RemoteEditorSyncBackendOptions, p as EditorHostOutboundMessage, r as EditorSourceHost, s as createRemoteEditorSyncBackend, t as EditorHostSession, u as EditorHostExportFormat } from "./editorHostSession-DTXKcLhR.mjs";
8
8
  import { AssetConfig, EmbedEntity, EmbedFormatContext, EmbedFormatDefinition, EmbedGraph, EmbedProfileDefinition, StatelyEmbed, StatelyEmbedOptions, createStatelyEmbed } from "./embed.mjs";
9
9
  import { _ as createWebSocketTransport, a as InspectedTransition, c as InspectorDiscoveryEntry, d as ManualActorOptions, f as createInspector, g as createPostMessageTransport, h as TransportFailure, i as InspectedSnapshot, l as InspectorEvents, m as Transport, n as CreateInspectorOptions, o as Inspector, p as createStatelyInspector, r as InspectedEvent, s as InspectorConnection, t as AdoptedActor, u as InspectorInspectionEvent } from "./inspect-Br_vS_lK.mjs";
10
10
  import { A as Machine, C as StudioMachineRecord, D as VerifyApiKeyResponse, E as UpdateProjectInput, F as ProjectVisibility, I as VerifyResult, L as XStateVersion, M as Project, N as ProjectMachineSummary, O as createStatelyClient, P as ProjectSummary, R as ResourceErrorCode, S as StudioClientOptions, T as UpdateMachineInput, _ as ProjectMachine, a as CreateMachineTemplate, b as StudioApiErrorOptions, c as EnsureProjectInput, d as ExtractedMachine, f as GetMachineOptions, g as ProjectData, h as LegacyUpdateMachineInput, i as CreateMachineInput, j as MachineVersion, k as ExtractedMachines, l as ExtractMachinesInput, m as LegacyProjectVisibility, n as CreateMachineFromDefinitionInput, o as CreateProjectInput, r as CreateMachineFromTemplateInput, s as DEFAULT_STATELY_BASE_URL, t as ConnectedRepo, u as ExtractMachinesResponse, v as RepoType, w as StudioRequestOptions, x as StudioClient, y as StudioApiError } from "./studio-CkrbMK00.mjs";
@@ -33,4 +33,4 @@ declare function findStatelyPragmaAttachments(sourceText: string, fileName?: str
33
33
  declare function getStatelyPragma(sourceText: string, fileName?: string, machineIndex?: number): StatelyPragma | undefined;
34
34
  declare function upsertStatelyPragma(sourceText: string, id: string, options?: UpsertStatelyPragmaOptions): string;
35
35
  //#endregion
36
- export { type ActionLocation, type AdoptedActor, type AssetConfig, type AssetUploadAdapter, type AssetUploadContext, type AssetUploadRequest, type CapabilityDeniedCapability, type CapabilityDeniedEvent, type CodeGenGraph, type CommentsConfig, type ConnectedRepo, type CreateInspectionRelayOptions, type CreateInspectorOptions, type CreateMachineFromDefinitionInput, type CreateMachineFromTemplateInput, type CreateMachineInput, type CreateMachineTemplate, type CreateProjectInput, type CreateS3AssetUploadAdapterOptions, type CreateSupabaseAssetUploadAdapterOptions, DEFAULT_STATELY_BASE_URL, type DigraphAction, type DigraphConfig, type DigraphEdgeConfig, type DigraphNodeConfig, EDITOR_PROTOCOL_VERSION, EMBED_DOCUMENT_LANGUAGES, EMBED_DOCUMENT_LIMITS, type EditorCapabilities, type EditorHostExportFormat, type EditorHostInboundMessage, type EditorHostInitOptions, type EditorHostOutboundMessage, EditorHostSession, type EditorHostSessionOptions, type EditorHostValidationIssue, type EditorSourceHost, type EditorSyncBackend, type EmbedDocument, type EmbedDocumentLanguage, type EmbedEntity, type EmbedEventHandler, type EmbedEventMap, type EmbedEventName, type EmbedFormatContext, type EmbedFormatDefinition, type EmbedGraph, type EmbedMode, type EmbedProfileDefinition, type EnsureProjectInput, type EventTypeData, type ExportCallOptions, type ExportFormat, type ExportFormatMap, type ExtractMachinesInput, type ExtractMachinesResponse, type ExtractedMachine, type ExtractedMachines, type GetMachineOptions, type GraphPatch, INSPECTION_PROTOCOL_VERSION, INSPECTION_ROOM_QUERY_PARAM, type InitOptions, type InspectedEvent, type InspectedSnapshot, type InspectedTransition, type InspectionAction, type InspectionRelay, type InspectionRelayEffect, type InspectionRelayPeer, type InspectionRelayRole, type InspectionRelaySnapshot, type InspectionSentEvent, type InspectionTakenTransition, type Inspector, type InspectorConnection, type InspectorDiscoveryEntry, type InspectorEvents, type InspectorInspectionEvent, type LegacyProjectVisibility, type LegacyUpdateMachineInput, type Machine, type MachineConfigOptions, type MachineVersion, type ManualActorOptions, type OAuthAuthorizationServerMetadata, type OAuthClientRegistrationResponse, type OAuthProtectedResourceMetadata, type OAuthTokenResponse, type PkcePair, type PlanSyncOptions, type Project, type ProjectData, type ProjectEmbedMachine, type ProjectMachine, type ProjectMachineSummary, type ProjectSummary, type ProjectVisibility, type PullSyncResult, type PushLocalMachineLinksResult, type PushSyncOptions, type PushSyncProjectOptions, type PushSyncResult, RawCode, type RemoteEditorSyncBackendOptions, type RepoType, type ResolvedSyncInput, type ResourceErrorCode, type S3UploadTarget, type StateNodeJSONData, type StatelyAction, type StatelyApiClientOptions, StatelyApiError, type StatelyApiUrlOptions, type StatelyAuthMode, type StatelyCredential, type StatelyEdgeData, type StatelyEmbed, type StatelyEmbedOptions, type StatelyGraph, type StatelyGraphData, type StatelyGuard, type StatelyInvoke, type StatelyNodeData, type StatelyPragma, type StatelyPragmaAttachment, type StudioAction, StudioApiError, type StudioApiErrorOptions, type StudioClient, type StudioClientOptions, type StudioEdge, type StudioMachine, type StudioMachineRecord, type StudioNode, type StudioRequestOptions, type SupabaseStorageClient, type SyncInputFormat, type SyncPlan, type SyncPlanSummary, type Transport, type TransportFailure, type UpdateMachineInput, type UpdateProjectInput, type UploadResult, type UpsertStatelyPragmaOptions, type VerifyApiKeyResponse, type VerifyResult, type XStateTSOptions, type XStateVersion, buildAuthorizeUrl, contextSchemaToTSType, createAuthorizationHeader, createInspectionActorId, createInspectionRelay, createInspectionRoomUrls, createInspector, createPkcePair, createPostMessageTransport, createRemoteEditorSyncBackend, createS3AssetUploadAdapter, createStatelyApiClient, createStatelyApiUrl, createStatelyClient, createStatelyEmbed, createStatelyInspector, createSupabaseAssetUploadAdapter, createWebSocketTransport, discoverAuthorizationServer, discoverProtectedResource, eventsSchemaToTSType, exchangeCodeForToken, fetchEditorSyncAccess, findStatelyPragmaAttachments, fromStudioMachine, getCredentialToken, getInspectionRoomId, getStatelyPragma, graphToMachineConfig, graphToXStateTS, jsonSchemaToTSType, raw, refreshToken, registerOAuthClient, serializeJS, studioMachineConverter, toStudioMachine, upsertStatelyPragma };
36
+ export { type ActionLocation, type AdoptedActor, type AssetConfig, type AssetUploadAdapter, type AssetUploadContext, type AssetUploadRequest, type CapabilityDeniedCapability, type CapabilityDeniedEvent, type CodeGenGraph, type CommentsConfig, type ConnectedRepo, type CreateInspectionRelayOptions, type CreateInspectorOptions, type CreateMachineFromDefinitionInput, type CreateMachineFromTemplateInput, type CreateMachineInput, type CreateMachineTemplate, type CreateProjectInput, type CreateS3AssetUploadAdapterOptions, type CreateSupabaseAssetUploadAdapterOptions, DEFAULT_STATELY_BASE_URL, type DigraphAction, type DigraphConfig, type DigraphEdgeConfig, type DigraphNodeConfig, EDITOR_PROTOCOL_VERSION, EMBED_DOCUMENT_LANGUAGES, EMBED_DOCUMENT_LIMITS, type EditorCapabilities, type EditorHostExportFormat, type EditorHostInboundMessage, type EditorHostInitOptions, type EditorHostOutboundMessage, EditorHostSession, type EditorHostSessionOptions, type EditorHostValidationIssue, type EditorSourceHost, type EditorSyncBackend, type EmbedDocument, type EmbedDocumentLanguage, type EmbedEntity, type EmbedEventHandler, type EmbedEventMap, type EmbedEventName, type EmbedFormatContext, type EmbedFormatDefinition, type EmbedGraph, type EmbedMode, type EmbedProfileDefinition, type EnsureProjectInput, type EventTypeData, type ExportCallOptions, type ExportFormat, type ExportFormatMap, type ExtractMachinesInput, type ExtractMachinesResponse, type ExtractedMachine, type ExtractedMachines, type GetMachineOptions, type GraphPatch, INSPECTION_PROTOCOL_VERSION, INSPECTION_ROOM_QUERY_PARAM, type InitOptions, type InspectedEvent, type InspectedSnapshot, type InspectedTransition, type InspectionAction, type InspectionRelay, type InspectionRelayEffect, type InspectionRelayPeer, type InspectionRelayRole, type InspectionRelaySnapshot, type InspectionSentEvent, type InspectionTakenTransition, type Inspector, type InspectorConnection, type InspectorDiscoveryEntry, type InspectorEvents, type InspectorInspectionEvent, type LegacyProjectVisibility, type LegacyUpdateMachineInput, type Machine, type MachineConfigOptions, type MachineVersion, type ManualActorOptions, type OAuthAuthorizationServerMetadata, type OAuthClientRegistrationResponse, type OAuthProtectedResourceMetadata, type OAuthTokenResponse, type PkcePair, type PlanSyncOptions, type Project, type ProjectData, type ProjectEmbedMachine, type ProjectMachine, type ProjectMachineSummary, type ProjectSummary, type ProjectVisibility, type ProjectWorkspaceAction, type ProjectWorkspaceActionIcon, type ProjectWorkspaceCapabilities, type ProjectWorkspaceConfig, type ProjectWorkspaceMachine, type ProjectWorkspaceProject, type PullSyncResult, type PushLocalMachineLinksResult, type PushSyncOptions, type PushSyncProjectOptions, type PushSyncResult, RawCode, type RemoteEditorSyncBackendOptions, type RepoType, type ResolvedSyncInput, type ResourceErrorCode, type S3UploadTarget, type StateNodeJSONData, type StatelyAction, type StatelyApiClientOptions, StatelyApiError, type StatelyApiUrlOptions, type StatelyAuthMode, type StatelyCredential, type StatelyEdgeData, type StatelyEmbed, type StatelyEmbedOptions, type StatelyGraph, type StatelyGraphData, type StatelyGuard, type StatelyInvoke, type StatelyNodeData, type StatelyPragma, type StatelyPragmaAttachment, type StudioAction, StudioApiError, type StudioApiErrorOptions, type StudioClient, type StudioClientOptions, type StudioEdge, type StudioMachine, type StudioMachineRecord, type StudioNode, type StudioRequestOptions, type SupabaseStorageClient, type SyncInputFormat, type SyncPlan, type SyncPlanSummary, type Transport, type TransportFailure, type UpdateMachineInput, type UpdateProjectInput, type UploadResult, type UpsertStatelyPragmaOptions, type VerifyApiKeyResponse, type VerifyResult, type XStateTSOptions, type XStateVersion, buildAuthorizeUrl, contextSchemaToTSType, createAuthorizationHeader, createInspectionActorId, createInspectionRelay, createInspectionRoomUrls, createInspector, createPkcePair, createPostMessageTransport, createRemoteEditorSyncBackend, createS3AssetUploadAdapter, createStatelyApiClient, createStatelyApiUrl, createStatelyClient, createStatelyEmbed, createStatelyInspector, createSupabaseAssetUploadAdapter, createWebSocketTransport, discoverAuthorizationServer, discoverProtectedResource, eventsSchemaToTSType, exchangeCodeForToken, fetchEditorSyncAccess, findStatelyPragmaAttachments, fromStudioMachine, getCredentialToken, getInspectionRoomId, getStatelyPragma, graphToMachineConfig, graphToXStateTS, jsonSchemaToTSType, raw, refreshToken, registerOAuthClient, serializeJS, studioMachineConverter, toStudioMachine, upsertStatelyPragma };
package/dist/index.mjs CHANGED
@@ -1,13 +1,13 @@
1
1
  import "./openapi-BTDjYWXd.mjs";
2
2
  import { EMBED_DOCUMENT_LANGUAGES, EMBED_DOCUMENT_LIMITS, INSPECTION_PROTOCOL_VERSION, INSPECTION_ROOM_QUERY_PARAM, createInspectionActorId, createInspectionRoomUrls, getInspectionRoomId } from "./protocol.mjs";
3
- import { i as createWebSocketTransport, r as createPostMessageTransport } from "./version-D3ug8VHa.mjs";
3
+ import { i as createWebSocketTransport, r as createPostMessageTransport } from "./version-DALql3iM.mjs";
4
4
  import { t as EDITOR_PROTOCOL_VERSION } from "./editorHostProtocol-Bko7wge8.mjs";
5
5
  import { createStatelyEmbed } from "./embed.mjs";
6
- import { i as fetchEditorSyncAccess, r as createRemoteEditorSyncBackend, t as EditorHostSession } from "./editorHostSession-BZE_Wm0m.mjs";
6
+ import { i as fetchEditorSyncAccess, r as createRemoteEditorSyncBackend, t as EditorHostSession } from "./editorHostSession-BwS-EiBJ.mjs";
7
7
  import { n as StudioApiError, r as createStatelyClient, t as DEFAULT_STATELY_BASE_URL } from "./studio-iNSHtNmP.mjs";
8
8
  import { a as RawCode, c as eventsSchemaToTSType, d as jsonSchemaToTSType, l as graphToMachineConfig, m as serializeJS, n as getStatelyPragma, o as contextSchemaToTSType, p as raw, r as upsertStatelyPragma, t as findStatelyPragmaAttachments, u as graphToXStateTS } from "./statelyPragma-0djA1cnm.mjs";
9
9
  import { createS3AssetUploadAdapter, createSupabaseAssetUploadAdapter } from "./assetStorage.mjs";
10
- import { n as createStatelyInspector, t as createInspector } from "./inspect-Bz3dcNBH.mjs";
10
+ import { n as createStatelyInspector, t as createInspector } from "./inspect-j1T7sM6_.mjs";
11
11
  import { createAuthorizationHeader, getCredentialToken } from "./auth.mjs";
12
12
  import { buildAuthorizeUrl, createPkcePair, discoverAuthorizationServer, discoverProtectedResource, exchangeCodeForToken, refreshToken, registerOAuthClient } from "./oauth.mjs";
13
13
  import { StatelyApiError, createStatelyApiClient, createStatelyApiUrl } from "./api.mjs";
@@ -1,5 +1,5 @@
1
1
  import { INSPECTION_PROTOCOL_VERSION, createInspectionRoomUrls, getInspectionRoomId } from "./protocol.mjs";
2
- import { a as createEventRegistry, i as createWebSocketTransport, n as inspectionRuntime, o as createPendingExportManager, t as SDK_VERSION } from "./version-D3ug8VHa.mjs";
2
+ import { a as createEventRegistry, i as createWebSocketTransport, n as inspectionRuntime, o as createPendingExportManager, t as SDK_VERSION } from "./version-DALql3iM.mjs";
3
3
 
4
4
  //#region src/openBrowser.ts
5
5
  async function openBrowser(url) {
package/dist/inspect.mjs CHANGED
@@ -1,4 +1,4 @@
1
- import "./version-D3ug8VHa.mjs";
2
- import { n as createStatelyInspector, t as createInspector } from "./inspect-Bz3dcNBH.mjs";
1
+ import "./version-DALql3iM.mjs";
2
+ import { n as createStatelyInspector, t as createInspector } from "./inspect-j1T7sM6_.mjs";
3
3
 
4
4
  export { createInspector, createStatelyInspector };
@@ -35,8 +35,58 @@ interface CommentsConfig {
35
35
  interface ProjectEmbedMachine {
36
36
  id: string;
37
37
  name?: string;
38
+ /** Optional host project scope for machine-to-machine references. */
39
+ projectId?: string;
38
40
  machine: unknown;
39
41
  }
42
+ type ProjectWorkspaceActionIcon = 'arrow-left' | 'copy' | 'fork' | 'history';
43
+ interface ProjectWorkspaceAction {
44
+ id: string;
45
+ label: string;
46
+ icon?: ProjectWorkspaceActionIcon;
47
+ disabled?: boolean;
48
+ }
49
+ interface ProjectWorkspaceMachine {
50
+ id: string;
51
+ name?: string;
52
+ }
53
+ interface ProjectWorkspaceProject {
54
+ id: string;
55
+ name: string;
56
+ machines: ProjectWorkspaceMachine[];
57
+ rootMachineId?: string;
58
+ }
59
+ /** Host-backed operations for the built-in workspace controls. */
60
+ interface ProjectWorkspaceCapabilities {
61
+ renameProject?: ProjectWorkspaceAction;
62
+ createMachine?: ProjectWorkspaceAction;
63
+ renameMachine?: ProjectWorkspaceAction;
64
+ copyMachine?: ProjectWorkspaceAction;
65
+ deleteMachine?: ProjectWorkspaceAction;
66
+ setRootMachine?: ProjectWorkspaceAction;
67
+ }
68
+ interface ProjectWorkspaceConfigBase {
69
+ defaultProjectId?: string;
70
+ /** Optional navigation action shown above the workspace. Set to null to hide it. */
71
+ backAction?: ProjectWorkspaceAction | null;
72
+ userAvatarUrl?: string;
73
+ machineSelectionDisabled?: boolean;
74
+ /** Optional host-backed operations for the built-in workspace controls. */
75
+ workspaceCapabilities?: ProjectWorkspaceCapabilities;
76
+ /** Actions rendered from the workspace options menu. */
77
+ workspaceActions?: ProjectWorkspaceAction[];
78
+ /** Optional actions keyed by project or machine id. */
79
+ projectActions?: Record<string, ProjectWorkspaceAction[]>;
80
+ machineActions?: Record<string, ProjectWorkspaceAction[]>;
81
+ }
82
+ /** Serializable workspace tree rendered by project-mode embeds. */
83
+ type ProjectWorkspaceConfig = (ProjectWorkspaceConfigBase & {
84
+ /** Single-project mode: hides project CRUD and flattens its machines. */project: ProjectWorkspaceProject;
85
+ projects?: never;
86
+ }) | (ProjectWorkspaceConfigBase & {
87
+ /** Multi-project mode: renders a collapsible project tree. */projects: ProjectWorkspaceProject[];
88
+ project?: never;
89
+ });
40
90
  declare const EMBED_DOCUMENT_LANGUAGES: readonly ["markdown", "typescript", "javascript", "json", "xml", "mermaid", "text"];
41
91
  type EmbedDocumentLanguage = (typeof EMBED_DOCUMENT_LANGUAGES)[number];
42
92
  declare const EMBED_DOCUMENT_LIMITS: {
@@ -171,6 +221,15 @@ interface EmbedEventMap {
171
221
  machineSelected: {
172
222
  machineId: string;
173
223
  };
224
+ projectWorkspaceAction: {
225
+ actionId: string;
226
+ projectId?: string;
227
+ machineId?: string;
228
+ data?: unknown;
229
+ };
230
+ projectWorkspaceOpenChanged: {
231
+ open: boolean;
232
+ };
174
233
  viewModeChanged: {
175
234
  viewMode: 'graph' | 'list';
176
235
  machineId?: string;
@@ -225,7 +284,7 @@ interface MachineInitOptions {
225
284
  * - `enabled` — whether to show the pill at all. Defaults to `false`.
226
285
  * - `mode` — `'structural'` (default) only triggers on graph-structural
227
286
  * changes (state/transition/action/invoke/schema edits). Pure visual
228
- * changes like drag-to-position, color, and autolayout are ignored.
287
+ * changes like drag-to-position, color, and layout are ignored.
229
288
  * `'all'` triggers on any graph change.
230
289
  */
231
290
  unsavedIndicator?: {
@@ -249,6 +308,8 @@ interface ProjectInitOptions {
249
308
  activePanels?: string[];
250
309
  };
251
310
  commentsByMachineId?: Record<string, CommentsConfig>;
311
+ projectWorkspace?: ProjectWorkspaceConfig;
312
+ projectWorkspaceOpen?: boolean;
252
313
  settings?: Record<string, unknown>;
253
314
  unsavedIndicator?: {
254
315
  enabled?: boolean;
@@ -321,6 +382,8 @@ interface ProjectInitMessage {
321
382
  rightPanels?: string[];
322
383
  activePanels?: string[];
323
384
  commentsByMachineId?: Record<string, CommentsConfig>;
385
+ projectWorkspace?: ProjectWorkspaceConfig;
386
+ projectWorkspaceOpen?: boolean;
324
387
  settings?: Record<string, unknown>;
325
388
  unsavedIndicator?: {
326
389
  enabled?: boolean;
@@ -333,11 +396,17 @@ interface ProjectUpdateMessage {
333
396
  machines: ProjectEmbedMachine[];
334
397
  currentMachineId?: string;
335
398
  commentsByMachineId?: Record<string, CommentsConfig>;
399
+ projectWorkspace?: ProjectWorkspaceConfig;
400
+ projectWorkspaceOpen?: boolean;
336
401
  }
337
402
  interface ProjectSelectMachineMessage {
338
403
  type: '@statelyai.project.selectMachine';
339
404
  machineId: string;
340
405
  }
406
+ interface ProjectSetWorkspaceOpenMessage {
407
+ type: '@statelyai.project.setWorkspaceOpen';
408
+ open: boolean;
409
+ }
341
410
  interface UpdateMessage {
342
411
  type: '@statelyai.update';
343
412
  machine: unknown;
@@ -510,6 +579,17 @@ interface ProjectMachineSelectedMessage {
510
579
  type: '@statelyai.project.machineSelected';
511
580
  machineId: string;
512
581
  }
582
+ interface ProjectWorkspaceActionMessage {
583
+ type: '@statelyai.project.workspaceAction';
584
+ actionId: string;
585
+ projectId?: string;
586
+ machineId?: string;
587
+ data?: unknown;
588
+ }
589
+ interface ProjectWorkspaceOpenChangedMessage {
590
+ type: '@statelyai.project.workspaceOpenChanged';
591
+ open: boolean;
592
+ }
513
593
  interface ViewModeChangedMessage {
514
594
  type: '@statelyai.viewModeChanged';
515
595
  viewMode: 'graph' | 'list';
@@ -583,9 +663,9 @@ interface ExtensionResultMessage {
583
663
  error?: string;
584
664
  }
585
665
  /** All messages a client (embed/inspector) can send to the viz. */
586
- type ClientMessage = InitMessage | SetApiKeyMessage | EditorHandshakeMessage | SavedMessage | ClipboardReadResponseMessage | ClipboardWriteResponseMessage | ProjectInitMessage | ProjectUpdateMessage | ProjectSelectMachineMessage | UpdateMessage | SetModeMessage | SetThemeMessage | SetSettingsMessage | RetrieveMessage | ToastMessage | InspectSnapshotMessage | SystemInitMessage | SystemSelectActorMessage | SystemActorRegisteredMessage | SystemActorEventMessage | SystemActorSnapshotMessage | SystemActorStoppedMessage | UploadCapabilitiesMessage | UploadResponseMessage | ExtensionResultMessage | ErrorMessage;
666
+ type ClientMessage = InitMessage | SetApiKeyMessage | EditorHandshakeMessage | SavedMessage | ClipboardReadResponseMessage | ClipboardWriteResponseMessage | ProjectInitMessage | ProjectUpdateMessage | ProjectSelectMachineMessage | ProjectSetWorkspaceOpenMessage | UpdateMessage | SetModeMessage | SetThemeMessage | SetSettingsMessage | RetrieveMessage | ToastMessage | InspectSnapshotMessage | SystemInitMessage | SystemSelectActorMessage | SystemActorRegisteredMessage | SystemActorEventMessage | SystemActorSnapshotMessage | SystemActorStoppedMessage | UploadCapabilitiesMessage | UploadResponseMessage | ExtensionResultMessage | ErrorMessage;
587
667
  /** All messages the viz can send back to a client. */
588
- type VizMessage = ReadyMessage | LoadedMessage | ChangeMessage | SaveMessage | ProjectMachineSelectedMessage | ViewModeChangedMessage | RetrievedMessage | ErrorMessage | CapabilityDeniedMessage | ClipboardReadMessage | ClipboardWriteMessage | UploadRequestMessage | ExtensionCallMessage;
668
+ type VizMessage = ReadyMessage | LoadedMessage | ChangeMessage | SaveMessage | ProjectMachineSelectedMessage | ProjectWorkspaceActionMessage | ProjectWorkspaceOpenChangedMessage | ViewModeChangedMessage | RetrievedMessage | ErrorMessage | CapabilityDeniedMessage | ClipboardReadMessage | ClipboardWriteMessage | UploadRequestMessage | ExtensionCallMessage;
589
669
  interface InspectionClientMetadata {
590
670
  name?: string;
591
671
  machineId?: string;
@@ -614,4 +694,4 @@ declare const PREFIX = "@statelyai.";
614
694
  /** Current WebSocket inspection protocol version. */
615
695
  declare const INSPECTION_PROTOCOL_VERSION = 2;
616
696
  //#endregion
617
- export { ActorSystemEntry, CapabilityDeniedCapability, CapabilityDeniedEvent, CapabilityDeniedMessage, ChangeMessage, ClientMessage, ClipboardReadMessage, ClipboardReadResponseMessage, ClipboardWriteMessage, ClipboardWriteResponseMessage, CommentsConfig, EMBED_DOCUMENT_LANGUAGES, EMBED_DOCUMENT_LIMITS, EditorCapabilities, EditorHandshakeMessage, EmbedDocument, EmbedDocumentLanguage, EmbedEventHandler, EmbedEventMap, EmbedEventName, EmbedExtensionsManifest, EmbedFormatManifest, EmbedMode, ErrorMessage, ExportCallOptions, ExportFormat, ExportFormatMap, ExtensionCallMessage, ExtensionResultMessage, INSPECTION_PROTOCOL_VERSION, INSPECTION_ROOM_QUERY_PARAM, InitMessage, InitOptions, InspectSnapshotMessage, InspectionAction, InspectionClientMetadata, InspectionRoomUrls, InspectionSentEvent, InspectionTakenTransition, LoadedMessage, MachineInitOptions, MachineSourceLocations, PREFIX, ProjectEmbedMachine, ProjectInitMessage, ProjectInitOptions, ProjectMachineSelectedMessage, ProjectSelectMachineMessage, ProjectUpdateMessage, ProtocolMessage, ReadOnlyReason, ReadyMessage, RegisterMessage, RegisteredMessage, RetrieveMessage, RetrievedMessage, SaveMessage, SavedMessage, SessionMessage, SetApiKeyMessage, SetModeMessage, SetSettingsMessage, SetThemeMessage, SourceLocation, SourceRange, StateSourceLocation, SystemActorEventMessage, SystemActorRegisteredMessage, SystemActorSnapshotMessage, SystemActorStoppedMessage, SystemInitMessage, SystemSelectActorMessage, ToastMessage, UpdateMessage, UploadCapabilitiesMessage, UploadFileInfo, UploadRequestMessage, UploadResponseMessage, UploadResult, ValidationIssue, ViewModeChangedMessage, VizMessage, createInspectionActorId, createInspectionRoomUrls, getInspectionRoomId };
697
+ export { ActorSystemEntry, CapabilityDeniedCapability, CapabilityDeniedEvent, CapabilityDeniedMessage, ChangeMessage, ClientMessage, ClipboardReadMessage, ClipboardReadResponseMessage, ClipboardWriteMessage, ClipboardWriteResponseMessage, CommentsConfig, EMBED_DOCUMENT_LANGUAGES, EMBED_DOCUMENT_LIMITS, EditorCapabilities, EditorHandshakeMessage, EmbedDocument, EmbedDocumentLanguage, EmbedEventHandler, EmbedEventMap, EmbedEventName, EmbedExtensionsManifest, EmbedFormatManifest, EmbedMode, ErrorMessage, ExportCallOptions, ExportFormat, ExportFormatMap, ExtensionCallMessage, ExtensionResultMessage, INSPECTION_PROTOCOL_VERSION, INSPECTION_ROOM_QUERY_PARAM, InitMessage, InitOptions, InspectSnapshotMessage, InspectionAction, InspectionClientMetadata, InspectionRoomUrls, InspectionSentEvent, InspectionTakenTransition, LoadedMessage, MachineInitOptions, MachineSourceLocations, PREFIX, ProjectEmbedMachine, ProjectInitMessage, ProjectInitOptions, ProjectMachineSelectedMessage, ProjectSelectMachineMessage, ProjectSetWorkspaceOpenMessage, ProjectUpdateMessage, ProjectWorkspaceAction, ProjectWorkspaceActionIcon, ProjectWorkspaceActionMessage, ProjectWorkspaceCapabilities, ProjectWorkspaceConfig, ProjectWorkspaceMachine, ProjectWorkspaceOpenChangedMessage, ProjectWorkspaceProject, ProtocolMessage, ReadOnlyReason, ReadyMessage, RegisterMessage, RegisteredMessage, RetrieveMessage, RetrievedMessage, SaveMessage, SavedMessage, SessionMessage, SetApiKeyMessage, SetModeMessage, SetSettingsMessage, SetThemeMessage, SourceLocation, SourceRange, StateSourceLocation, SystemActorEventMessage, SystemActorRegisteredMessage, SystemActorSnapshotMessage, SystemActorStoppedMessage, SystemInitMessage, SystemSelectActorMessage, ToastMessage, UpdateMessage, UploadCapabilitiesMessage, UploadFileInfo, UploadRequestMessage, UploadResponseMessage, UploadResult, ValidationIssue, ViewModeChangedMessage, VizMessage, createInspectionActorId, createInspectionRoomUrls, getInspectionRoomId };
@@ -127,6 +127,8 @@ function toInitMessage(options) {
127
127
  rightPanels: options.panels?.rightPanels,
128
128
  activePanels: options.panels?.activePanels,
129
129
  commentsByMachineId: options.commentsByMachineId,
130
+ projectWorkspace: options.projectWorkspace,
131
+ projectWorkspaceOpen: options.projectWorkspaceOpen,
130
132
  settings: options.settings,
131
133
  unsavedIndicator: options.unsavedIndicator
132
134
  };
@@ -331,7 +333,7 @@ function createWebSocketTransport(options) {
331
333
 
332
334
  //#endregion
333
335
  //#region src/version.ts
334
- const SDK_VERSION = "0.23.0";
336
+ const SDK_VERSION = "0.24.0";
335
337
  function inspectionRuntime() {
336
338
  if (typeof window !== "undefined") return "browser";
337
339
  if (typeof process !== "undefined" && process.versions?.node) return "node";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@statelyai/sdk",
3
- "version": "0.23.0",
3
+ "version": "0.24.0",
4
4
  "license": "MIT",
5
5
  "bin": {
6
6
  "stately-sdk": "./dist/bin.mjs"
@@ -93,8 +93,8 @@
93
93
  "jsdom": "^27.4.0",
94
94
  "tsdown": "0.21.0-beta.2",
95
95
  "vitest": "^3.2.4",
96
- "@statelyai/api-contract": "0.3.8",
97
- "@statelyai/graph-tools": "0.2.2"
96
+ "@statelyai/graph-tools": "0.2.2",
97
+ "@statelyai/api-contract": "0.3.8"
98
98
  },
99
99
  "engines": {
100
100
  "node": ">=22.4"