@statelyai/sdk 0.31.1 → 0.32.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 +19 -6
- package/dist/assetStorage.d.mts +1 -1
- package/dist/{editorHostSession-Bo-YhDEG.d.mts → editorHostSession-BqyuKldr.d.mts} +12 -1
- package/dist/{editorHostSession-CT8y0yzG.mjs → editorHostSession-DfmHzpls.mjs} +16 -7
- package/dist/editorHostSession.d.mts +1 -1
- package/dist/editorHostSession.mjs +1 -1
- package/dist/embed.d.mts +4 -2
- package/dist/embed.mjs +2 -1
- package/dist/index.d.mts +3 -3
- package/dist/index.mjs +3 -3
- package/dist/{inspect-BoWXrB-V.d.mts → inspect-C18TbR-o.d.mts} +14 -5
- package/dist/{inspect-DoDj7iWa.mjs → inspect-GI2nE3J9.mjs} +136 -49
- package/dist/inspect.d.mts +2 -2
- package/dist/inspect.mjs +2 -2
- package/dist/{protocol-2cvzJtGN.d.mts → protocol-C-tx0WI6.d.mts} +17 -2
- package/dist/protocol.d.mts +2 -2
- package/dist/relay.d.mts +1 -1
- package/dist/{version-B6OHpDiz.mjs → version-1vqjW2Am.mjs} +2 -1
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -258,22 +258,35 @@ Error, or Stopped); “Awaiting snapshot” means no snapshot has arrived.
|
|
|
258
258
|
|
|
259
259
|
For persisted actors, `resolveSessionId` can keep one producer-local identity
|
|
260
260
|
across sequential restore/resume incarnations. Generate a new id for a new
|
|
261
|
-
logical invocation, persist it beside the actor snapshot, and reuse it
|
|
262
|
-
|
|
263
|
-
|
|
261
|
+
logical invocation, persist it beside the actor snapshot, and reuse it after
|
|
262
|
+
the previous incarnation has stopped. The same inspector may observe the
|
|
263
|
+
replacement runtime actor:
|
|
264
264
|
|
|
265
265
|
```ts
|
|
266
266
|
const inspector = createInspector({
|
|
267
267
|
roomId: persistedInspectionRoomId,
|
|
268
268
|
producerId: persistedInspectionProducerId,
|
|
269
|
-
resolveSessionId: (actor, defaultSessionId) =>
|
|
270
|
-
|
|
269
|
+
resolveSessionId: (actor, defaultSessionId, parentSessionId) =>
|
|
270
|
+
parentSessionId
|
|
271
|
+
? `${parentSessionId}/${actor.id}`
|
|
272
|
+
: persistedInspectionId,
|
|
271
273
|
});
|
|
272
274
|
```
|
|
273
275
|
|
|
274
276
|
A resume must reuse the same room id, producer id, and resolved session id. Keep
|
|
275
277
|
the room id private because it is the room's bearer capability. A new logical
|
|
276
|
-
invocation keeps the producer id but receives a new resolved session id.
|
|
278
|
+
invocation keeps the producer id but receives a new resolved session id. Active
|
|
279
|
+
owners reject collisions unless `sessionIdReuse: "always"` explicitly permits
|
|
280
|
+
replacement; late observations from a displaced actor are ignored.
|
|
281
|
+
|
|
282
|
+
The resolver's third argument is the parent's resolved id, so recreated child
|
|
283
|
+
actors can use stable paths instead of accumulating runtime session ids. IDs
|
|
284
|
+
must still be unique within one live actor tree.
|
|
285
|
+
|
|
286
|
+
To present a stopped request-scoped runtime as waiting for its next resume, map
|
|
287
|
+
its serialized status to a non-terminal value such as `suspended` in
|
|
288
|
+
`serializeSnapshot`. The raw terminal status still permits the next runtime
|
|
289
|
+
actor to rebind automatically.
|
|
277
290
|
|
|
278
291
|
Stopped actors remain in `inspector.actors` and in reconnect checkpoints, so
|
|
279
292
|
completed request-scoped runs stay available for inspection.
|
package/dist/assetStorage.d.mts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Qt as EmbedPanelConfig, Y as ProjectEmbedMachine, ot as ProjectWorkspaceConfig } from "./protocol-C-tx0WI6.mjs";
|
|
2
2
|
import { a as EditorSyncParseRequest, d as EditorSyncTextReplacement, f as MachineSourceLocations, i as EditorSyncApplyResponse, n as EditorSyncAccess, o as EditorSyncParseResponse, r as EditorSyncApplyRequest, s as EditorSyncSourceDocument, t as EditorCapabilities } from "./editor-sync-types-CPpzTSnT.mjs";
|
|
3
3
|
|
|
4
4
|
//#region src/editorHostProtocol.d.ts
|
|
@@ -114,6 +114,9 @@ type EditorHostOutboundMessage = {
|
|
|
114
114
|
} | {
|
|
115
115
|
type: '@statelyai.project.init';
|
|
116
116
|
machines: ProjectEmbedMachine[];
|
|
117
|
+
chrome?: {
|
|
118
|
+
header?: boolean;
|
|
119
|
+
};
|
|
117
120
|
currentMachineId?: string;
|
|
118
121
|
mode?: 'editing' | 'viewing';
|
|
119
122
|
theme?: 'light' | 'dark';
|
|
@@ -131,6 +134,7 @@ type EditorHostOutboundMessage = {
|
|
|
131
134
|
} | {
|
|
132
135
|
type: '@statelyai.project.update';
|
|
133
136
|
machines: ProjectEmbedMachine[];
|
|
137
|
+
source?: 'external';
|
|
134
138
|
currentMachineId?: string;
|
|
135
139
|
projectWorkspace?: ProjectWorkspaceConfig;
|
|
136
140
|
projectWorkspaceOpen?: boolean;
|
|
@@ -167,6 +171,11 @@ type EditorHostOutboundMessage = {
|
|
|
167
171
|
type: '@statelyai.toast';
|
|
168
172
|
message: string;
|
|
169
173
|
toastType?: 'success' | 'error' | 'info' | 'warning';
|
|
174
|
+
id?: string;
|
|
175
|
+
machineId?: string;
|
|
176
|
+
} | {
|
|
177
|
+
type: '@statelyai.toast.dismiss';
|
|
178
|
+
id: string;
|
|
170
179
|
machineId?: string;
|
|
171
180
|
} | {
|
|
172
181
|
type: '@statelyai.error';
|
|
@@ -263,6 +272,7 @@ declare class EditorHostSession {
|
|
|
263
272
|
receive(message: EditorHostInboundMessage): Promise<void>;
|
|
264
273
|
private initialize;
|
|
265
274
|
private save;
|
|
275
|
+
private isExternalSourceDocument;
|
|
266
276
|
private handleSavedDocument;
|
|
267
277
|
private reportSourceSyncError;
|
|
268
278
|
private updateWatchedSourceUris;
|
|
@@ -282,6 +292,7 @@ type EditorHostWorkspaceSessionOptions = Omit<EditorHostSessionOptions, 'source'
|
|
|
282
292
|
currentMachineId?: string;
|
|
283
293
|
workspaceName?: string;
|
|
284
294
|
projectWorkspaceOpen?: boolean;
|
|
295
|
+
showHeader?: boolean;
|
|
285
296
|
};
|
|
286
297
|
/**
|
|
287
298
|
* Runs one source-sync session per discovered machine while presenting the
|
|
@@ -181,6 +181,7 @@ function assertEditorSyncResponseProtocol(response) {
|
|
|
181
181
|
if (selectedVersion === null || selectedVersion === String(EDITOR_SYNC_PROTOCOL_VERSION)) return;
|
|
182
182
|
throw new Error(`Editor Sync protocol ${selectedVersion} is unsupported; this client supports ${EDITOR_SYNC_PROTOCOL_VERSION}.`);
|
|
183
183
|
}
|
|
184
|
+
const SOURCE_SAVE_REMINDER_ID = "source-save-reminder";
|
|
184
185
|
var EditorHostSession = class {
|
|
185
186
|
editorProtocolState = "awaiting";
|
|
186
187
|
currentGraph;
|
|
@@ -197,17 +198,14 @@ var EditorHostSession = class {
|
|
|
197
198
|
this.options = options;
|
|
198
199
|
this.saveReminderState = saveReminderState;
|
|
199
200
|
this.selfEditState = selfEditState;
|
|
200
|
-
this.watcher = options.source.watchSavedDocuments?.((uri) =>
|
|
201
|
-
this.saveReminderState.shown = false;
|
|
202
|
-
return this.handleSavedDocument(uri);
|
|
203
|
-
});
|
|
201
|
+
this.watcher = options.source.watchSavedDocuments?.((uri) => this.handleSavedDocument(uri));
|
|
204
202
|
this.changeWatcher = options.source.watchChangedDocuments?.((uri) => {
|
|
205
|
-
if (
|
|
206
|
-
if (this.selfEditState.count > 0) return;
|
|
203
|
+
if (!this.isExternalSourceDocument(uri)) return;
|
|
207
204
|
if (this.saveReminderState.shown) return;
|
|
208
205
|
this.saveReminderState.shown = true;
|
|
209
206
|
this.options.send({
|
|
210
207
|
type: "@statelyai.toast",
|
|
208
|
+
id: SOURCE_SAVE_REMINDER_ID,
|
|
211
209
|
message: "Save code to see changes.",
|
|
212
210
|
toastType: "warning"
|
|
213
211
|
});
|
|
@@ -451,9 +449,17 @@ var EditorHostSession = class {
|
|
|
451
449
|
graph: message.graph
|
|
452
450
|
});
|
|
453
451
|
}
|
|
452
|
+
isExternalSourceDocument(uri) {
|
|
453
|
+
return (uri === this.options.source.rootUri || this.watchedSourceUris.has(uri)) && this.selfEditState.count === 0;
|
|
454
|
+
}
|
|
454
455
|
async handleSavedDocument(uri) {
|
|
456
|
+
if (!this.isExternalSourceDocument(uri)) return;
|
|
457
|
+
if (this.saveReminderState.shown) this.options.send({
|
|
458
|
+
type: "@statelyai.toast.dismiss",
|
|
459
|
+
id: SOURCE_SAVE_REMINDER_ID
|
|
460
|
+
});
|
|
461
|
+
this.saveReminderState.shown = false;
|
|
455
462
|
if (this.editorProtocolState !== "compatible") return;
|
|
456
|
-
if (uri !== this.options.source.rootUri && !this.watchedSourceUris.has(uri) || this.selfEditState.count > 0) return;
|
|
457
463
|
try {
|
|
458
464
|
const documents = await this.options.source.collectDocuments(sourceLocationUris(this.currentSourceLocations));
|
|
459
465
|
const update = await this.options.sync.parse({
|
|
@@ -643,6 +649,7 @@ var EditorHostWorkspaceSession = class {
|
|
|
643
649
|
if (this.initialized) this.options.send({
|
|
644
650
|
type: "@statelyai.project.update",
|
|
645
651
|
machines: this.getProjectMachines(),
|
|
652
|
+
source: "external",
|
|
646
653
|
currentMachineId: this.selectedMachineId,
|
|
647
654
|
projectWorkspace: this.getProjectWorkspace(),
|
|
648
655
|
projectWorkspaceOpen: this.projectWorkspaceOpen
|
|
@@ -674,6 +681,7 @@ var EditorHostWorkspaceSession = class {
|
|
|
674
681
|
}
|
|
675
682
|
case "@statelyai.saved":
|
|
676
683
|
case "@statelyai.toast":
|
|
684
|
+
case "@statelyai.toast.dismiss":
|
|
677
685
|
case "@statelyai.error":
|
|
678
686
|
this.options.send({
|
|
679
687
|
...message,
|
|
@@ -696,6 +704,7 @@ var EditorHostWorkspaceSession = class {
|
|
|
696
704
|
this.options.send({
|
|
697
705
|
type: "@statelyai.project.init",
|
|
698
706
|
machines: this.getProjectMachines(),
|
|
707
|
+
chrome: this.options.showHeader ? { header: true } : void 0,
|
|
699
708
|
currentMachineId: this.selectedMachineId,
|
|
700
709
|
mode: first.mode,
|
|
701
710
|
theme: first.theme,
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { _ as EditorHostOutboundMessage, a as EditorHostWorkspaceSessionOptions, c as EditorSyncError, d as fetchEditorSyncAccess, f as EDITOR_PROTOCOL_VERSION, g as EditorHostInitOptions, h as EditorHostInboundMessage, i as EditorHostWorkspaceSession, l as RemoteEditorSyncBackendOptions, m as EditorHostExportFormat, n as EditorHostSessionOptions, o as EditorSourceHost, p as EditorHostDiagnostic, r as EditorHostWorkspaceMachine, s as EditorSyncBackend, t as EditorHostSession, u as createRemoteEditorSyncBackend, v as EditorHostValidationIssue } from "./editorHostSession-
|
|
1
|
+
import { _ as EditorHostOutboundMessage, a as EditorHostWorkspaceSessionOptions, c as EditorSyncError, d as fetchEditorSyncAccess, f as EDITOR_PROTOCOL_VERSION, g as EditorHostInitOptions, h as EditorHostInboundMessage, i as EditorHostWorkspaceSession, l as RemoteEditorSyncBackendOptions, m as EditorHostExportFormat, n as EditorHostSessionOptions, o as EditorSourceHost, p as EditorHostDiagnostic, r as EditorHostWorkspaceMachine, s as EditorSyncBackend, t as EditorHostSession, u as createRemoteEditorSyncBackend, v as EditorHostValidationIssue } from "./editorHostSession-BqyuKldr.mjs";
|
|
2
2
|
export { EDITOR_PROTOCOL_VERSION, EditorHostDiagnostic, EditorHostExportFormat, EditorHostInboundMessage, EditorHostInitOptions, EditorHostOutboundMessage, EditorHostSession, EditorHostSessionOptions, EditorHostValidationIssue, EditorHostWorkspaceMachine, EditorHostWorkspaceSession, EditorHostWorkspaceSessionOptions, EditorSourceHost, EditorSyncBackend, EditorSyncError, RemoteEditorSyncBackendOptions, createRemoteEditorSyncBackend, fetchEditorSyncAccess };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import "./openapi-BTDjYWXd.mjs";
|
|
2
2
|
import { t as EDITOR_PROTOCOL_VERSION } from "./editorHostProtocol-Bko7wge8.mjs";
|
|
3
|
-
import { a as fetchEditorSyncAccess, i as createRemoteEditorSyncBackend, n as EditorHostWorkspaceSession, r as EditorSyncError, t as EditorHostSession } from "./editorHostSession-
|
|
3
|
+
import { a as fetchEditorSyncAccess, i as createRemoteEditorSyncBackend, n as EditorHostWorkspaceSession, r as EditorSyncError, t as EditorHostSession } from "./editorHostSession-DfmHzpls.mjs";
|
|
4
4
|
import "./dist-wbhkeGh6.mjs";
|
|
5
5
|
|
|
6
6
|
export { EDITOR_PROTOCOL_VERSION, EditorHostSession, EditorHostWorkspaceSession, EditorSyncError, createRemoteEditorSyncBackend, fetchEditorSyncAccess };
|
package/dist/embed.d.mts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { i as ProfileManifest } from "./index-DlOZxzrW.mjs";
|
|
2
2
|
import { i as StatelyGraph } from "./graph-CR_g-mOq.mjs";
|
|
3
|
-
import {
|
|
3
|
+
import { $t as EmbedPanelPosition, D as ExportCallOptions, F as InitOptions, G as MachineVersionAutoSaveOptions, O as ExportFormat, Qt as EmbedPanelConfig, S as EmbedExtensionsManifest, U as MachineInitOptions, Vt as UploadResult, W as MachineSourceLocations, Y as ProjectEmbedMachine, Z as ProjectInitOptions, _ as EmbedDocumentLanguage, at as ProjectWorkspaceCapabilities, b as EmbedEventName, ct as ProjectWorkspaceMachineOrigin, d as CommentsConfig, g as EmbedDocument, k as ExportFormatMap, m as EditorCapabilities, nt as ProjectWorkspaceAction, ot as ProjectWorkspaceConfig, r as CapabilityDeniedEvent, rt as ProjectWorkspaceActionIcon, st as ProjectWorkspaceMachine, ut as ProjectWorkspaceProject, v as EmbedEventHandler, w as EmbedMode, y as EmbedEventMap } from "./protocol-C-tx0WI6.mjs";
|
|
4
4
|
import { AssetUploadAdapter } from "./assetStorage.mjs";
|
|
5
5
|
|
|
6
6
|
//#region src/embed.d.ts
|
|
@@ -86,6 +86,8 @@ interface StatelyEmbedOptions extends Partial<MachineInitOptions> {
|
|
|
86
86
|
* auto-sent on attach using these machines.
|
|
87
87
|
*/
|
|
88
88
|
machines?: ProjectEmbedMachine[];
|
|
89
|
+
/** Project mode only — optional project-level editor chrome. */
|
|
90
|
+
chrome?: ProjectInitOptions['chrome'];
|
|
89
91
|
/** Project mode only — initially selected machine id. */
|
|
90
92
|
currentMachineId?: string;
|
|
91
93
|
/** Project mode only — initial comments keyed by machine id. */
|
|
@@ -150,4 +152,4 @@ interface StatelyEmbed {
|
|
|
150
152
|
}
|
|
151
153
|
declare function createStatelyEmbed(options: StatelyEmbedOptions): StatelyEmbed;
|
|
152
154
|
//#endregion
|
|
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, type EmbedPanelConfig, type EmbedPanelPosition, EmbedProfileDefinition, type ExportCallOptions, type ExportFormat, type ExportFormatMap, type InitOptions, type MachineInitOptions, type MachineSourceLocations, type MachineVersionAutoSaveOptions, type ProjectEmbedMachine, type ProjectWorkspaceAction, type ProjectWorkspaceActionIcon, type ProjectWorkspaceCapabilities, type ProjectWorkspaceConfig, type ProjectWorkspaceMachine, type ProjectWorkspaceMachineOrigin, type ProjectWorkspaceProject, StatelyEmbed, StatelyEmbedOptions, type UploadResult, createStatelyEmbed };
|
|
155
|
+
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, type EmbedPanelConfig, type EmbedPanelPosition, EmbedProfileDefinition, type ExportCallOptions, type ExportFormat, type ExportFormatMap, type InitOptions, type MachineInitOptions, type MachineSourceLocations, type MachineVersionAutoSaveOptions, type ProjectEmbedMachine, type ProjectInitOptions, type ProjectWorkspaceAction, type ProjectWorkspaceActionIcon, type ProjectWorkspaceCapabilities, type ProjectWorkspaceConfig, type ProjectWorkspaceMachine, type ProjectWorkspaceMachineOrigin, 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-
|
|
1
|
+
import { a as createEventRegistry, o as createPendingExportManager, r as createPostMessageTransport, s as toInitMessage, t as SDK_VERSION } from "./version-1vqjW2Am.mjs";
|
|
2
2
|
import { t as EDITOR_PROTOCOL_VERSION } from "./editorHostProtocol-Bko7wge8.mjs";
|
|
3
3
|
|
|
4
4
|
//#region src/embed.ts
|
|
@@ -90,6 +90,7 @@ function extractInitOptions(options) {
|
|
|
90
90
|
commentsByMachineId: options.commentsByMachineId,
|
|
91
91
|
projectWorkspace: options.projectWorkspace,
|
|
92
92
|
projectWorkspaceOpen: options.projectWorkspaceOpen,
|
|
93
|
+
chrome: options.chrome,
|
|
93
94
|
settings: options.settings,
|
|
94
95
|
unsavedIndicator: options.unsavedIndicator,
|
|
95
96
|
versionAutoSave: options.versionAutoSave
|
package/dist/index.d.mts
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { StatelyApiClientOptions, StatelyApiError, StatelyApiUrlOptions, createStatelyApiClient, createStatelyApiUrl } from "./api.mjs";
|
|
2
2
|
import { S as GraphPatch, _ as raw, a as RawCode, c as XStateV4TSOptions, d as getXStateFSMCompatibilityIssues, f as graphToMachineConfig, g as jsonSchemaToTSType, h as graphToXStateV4TS, l as contextSchemaToTSType, m as graphToXStateTS, n as CodeGenGraph, o as XStateFSMOptions, p as graphToXStateFSM, r as MachineConfigOptions, s as XStateTSOptions, u as eventsSchemaToTSType, v as serializeJS, y as ActionLocation } from "./index-DlOZxzrW.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-CR_g-mOq.mjs";
|
|
4
|
-
import {
|
|
4
|
+
import { $t as EmbedPanelPosition, B as InspectionSentEvent, D as ExportCallOptions, F as InitOptions, G as MachineVersionAutoSaveOptions, Jt as createInspectionRoomUrls, Kt as assertEmbedExamples, L as InspectionAction, M as INSPECTION_PROTOCOL_VERSION, N as INSPECTION_ROOM_QUERY_PARAM, O as ExportFormat, Qt as EmbedPanelConfig, V as InspectionTakenTransition, Vt as UploadResult, Xt as isEmbedExample, Y as ProjectEmbedMachine, Yt as getInspectionRoomId, Zt as isEmbedExampleMachine, _ as EmbedDocumentLanguage, at as ProjectWorkspaceCapabilities, b as EmbedEventName, ct as ProjectWorkspaceMachineOrigin, d as CommentsConfig, f as EMBED_DOCUMENT_LANGUAGES, g as EmbedDocument, k as ExportFormatMap, m as EditorCapabilities, n as CapabilityDeniedCapability, nt as ProjectWorkspaceAction, ot as ProjectWorkspaceConfig, p as EMBED_DOCUMENT_LIMITS, qt as createInspectionActorId, r as CapabilityDeniedEvent, rt as ProjectWorkspaceActionIcon, st as ProjectWorkspaceMachine, ut as ProjectWorkspaceProject, v as EmbedEventHandler, w as EmbedMode, x as EmbedExample, y as EmbedEventMap } from "./protocol-C-tx0WI6.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-Dg7prjeL.mjs";
|
|
7
|
-
import { _ as EditorHostOutboundMessage, a as EditorHostWorkspaceSessionOptions, d as fetchEditorSyncAccess, f as EDITOR_PROTOCOL_VERSION, g as EditorHostInitOptions, h as EditorHostInboundMessage, i as EditorHostWorkspaceSession, l as RemoteEditorSyncBackendOptions, m as EditorHostExportFormat, n as EditorHostSessionOptions, o as EditorSourceHost, p as EditorHostDiagnostic, r as EditorHostWorkspaceMachine, s as EditorSyncBackend, t as EditorHostSession, u as createRemoteEditorSyncBackend, v as EditorHostValidationIssue } from "./editorHostSession-
|
|
7
|
+
import { _ as EditorHostOutboundMessage, a as EditorHostWorkspaceSessionOptions, d as fetchEditorSyncAccess, f as EDITOR_PROTOCOL_VERSION, g as EditorHostInitOptions, h as EditorHostInboundMessage, i as EditorHostWorkspaceSession, l as RemoteEditorSyncBackendOptions, m as EditorHostExportFormat, n as EditorHostSessionOptions, o as EditorSourceHost, p as EditorHostDiagnostic, r as EditorHostWorkspaceMachine, s as EditorSyncBackend, t as EditorHostSession, u as createRemoteEditorSyncBackend, v as EditorHostValidationIssue } from "./editorHostSession-BqyuKldr.mjs";
|
|
8
8
|
import { AssetConfig, EmbedEntity, EmbedFormatContext, EmbedFormatDefinition, EmbedGraph, EmbedProfileDefinition, StatelyEmbed, StatelyEmbedOptions, createStatelyEmbed } from "./embed.mjs";
|
|
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-
|
|
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-C18TbR-o.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-DV5IIGhV.mjs";
|
|
11
11
|
import { OAuthAuthorizationServerMetadata, OAuthClientRegistrationResponse, OAuthProtectedResourceMetadata, OAuthTokenResponse, PkcePair, buildAuthorizeUrl, createPkcePair, discoverAuthorizationServer, discoverProtectedResource, exchangeCodeForToken, refreshToken, registerOAuthClient } from "./oauth.mjs";
|
|
12
12
|
import { PlanSyncOptions, PullSyncResult, PushLocalMachineLinksResult, PushSyncOptions, PushSyncProjectOptions, PushSyncResult, ResolvedSyncInput, SyncInputFormat, SyncPlan, SyncPlanSummary } from "./sync.mjs";
|
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, assertEmbedExamples, createInspectionActorId, createInspectionRoomUrls, getInspectionRoomId, isEmbedExample, isEmbedExampleMachine } from "./protocol.mjs";
|
|
3
|
-
import { i as createWebSocketTransport, r as createPostMessageTransport } from "./version-
|
|
3
|
+
import { i as createWebSocketTransport, r as createPostMessageTransport } from "./version-1vqjW2Am.mjs";
|
|
4
4
|
import { t as EDITOR_PROTOCOL_VERSION } from "./editorHostProtocol-Bko7wge8.mjs";
|
|
5
5
|
import { createStatelyEmbed } from "./embed.mjs";
|
|
6
|
-
import { a as fetchEditorSyncAccess, i as createRemoteEditorSyncBackend, n as EditorHostWorkspaceSession, t as EditorHostSession } from "./editorHostSession-
|
|
6
|
+
import { a as fetchEditorSyncAccess, i as createRemoteEditorSyncBackend, n as EditorHostWorkspaceSession, t as EditorHostSession } from "./editorHostSession-DfmHzpls.mjs";
|
|
7
7
|
import { n as StudioApiError, r as createStatelyClient, t as DEFAULT_STATELY_BASE_URL } from "./studio-rSI54Ese.mjs";
|
|
8
8
|
import { _ as graphToXStateV4TS, b as raw, f as getXStateFSMCompatibilityIssues, g as graphToXStateTS, h as graphToXStateFSM, l as eventsSchemaToTSType, m as graphToMachineConfig, n as RawCode, o as contextSchemaToTSType, v as jsonSchemaToTSType, x as serializeJS } from "./dist-wbhkeGh6.mjs";
|
|
9
9
|
import { createS3AssetUploadAdapter, createSupabaseAssetUploadAdapter } from "./assetStorage.mjs";
|
|
10
|
-
import { n as createStatelyInspector, t as createInspector } from "./inspect-
|
|
10
|
+
import { n as createStatelyInspector, t as createInspector } from "./inspect-GI2nE3J9.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,4 +1,4 @@
|
|
|
1
|
-
import { B as InspectionSentEvent, D as ExportCallOptions, L as InspectionAction, O as ExportFormat,
|
|
1
|
+
import { B as InspectionSentEvent, D as ExportCallOptions, L as InspectionAction, O as ExportFormat, Qt as EmbedPanelConfig, R as InspectionClientMetadata, V as InspectionTakenTransition, dt as ProtocolMessage, k as ExportFormatMap, m as EditorCapabilities, y as EmbedEventMap } from "./protocol-C-tx0WI6.mjs";
|
|
2
2
|
|
|
3
3
|
//#region src/transport.d.ts
|
|
4
4
|
interface TransportFailure {
|
|
@@ -173,7 +173,9 @@ interface CreateInspectorOptions {
|
|
|
173
173
|
/**
|
|
174
174
|
* Serialize a snapshot for the wire. Defaults to `{value, status}` —
|
|
175
175
|
* dropping context entirely because xstate contexts routinely contain
|
|
176
|
-
* spawned actor refs which are not JSON-safe.
|
|
176
|
+
* spawned actor refs which are not JSON-safe. An explicit serialized status
|
|
177
|
+
* controls terminal presentation; for example, map a runtime `stopped`
|
|
178
|
+
* status to `suspended` when a logical actor is expected to resume.
|
|
177
179
|
*/
|
|
178
180
|
serializeSnapshot?: (snapshot: MinimalSnapshot) => unknown;
|
|
179
181
|
/**
|
|
@@ -191,10 +193,17 @@ interface CreateInspectorOptions {
|
|
|
191
193
|
/**
|
|
192
194
|
* Resolve the producer-local identity used for an actor on the inspection
|
|
193
195
|
* wire. Defaults to XState's runtime `actor.sessionId`. The resolver runs
|
|
194
|
-
* once per runtime actor and
|
|
195
|
-
*
|
|
196
|
+
* once per runtime actor and receives its parent's resolved id as the third
|
|
197
|
+
* argument. It must return a non-empty id. Reusing an id follows
|
|
198
|
+
* {@link CreateInspectorOptions.sessionIdReuse}.
|
|
196
199
|
*/
|
|
197
|
-
resolveSessionId?: (actor: any, defaultSessionId: string) => string;
|
|
200
|
+
resolveSessionId?: (actor: any, defaultSessionId: string, parentSessionId: string | null) => string;
|
|
201
|
+
/**
|
|
202
|
+
* Controls when a resolved session id may move to another runtime actor.
|
|
203
|
+
* Stopped actors are replaced by default. Use `always` for hosts that can
|
|
204
|
+
* guarantee the previous runtime actor will no longer produce relevant events.
|
|
205
|
+
*/
|
|
206
|
+
sessionIdReuse?: 'stopped' | 'always';
|
|
198
207
|
/** Selected actor session id to focus on first. */
|
|
199
208
|
selectedSessionId?: string;
|
|
200
209
|
/** @deprecated Use {@link selectedSessionId}. */
|
|
@@ -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-
|
|
2
|
+
import { a as createEventRegistry, i as createWebSocketTransport, n as inspectionRuntime, o as createPendingExportManager, t as SDK_VERSION } from "./version-1vqjW2Am.mjs";
|
|
3
3
|
|
|
4
4
|
//#region src/openBrowser.ts
|
|
5
5
|
async function openBrowser(url) {
|
|
@@ -78,7 +78,7 @@ function generateRoomId() {
|
|
|
78
78
|
function createInspector(options = {}) {
|
|
79
79
|
const environmentUrl = typeof process !== "undefined" ? process.env?.STATELY_INSPECT_URL : void 0;
|
|
80
80
|
const url = options.url ?? environmentUrl ?? "wss://sky.stately.ai";
|
|
81
|
-
const { inspectorBaseUrl, name, serializeSnapshot = defaultSerializeSnapshot, selectedSessionId: configuredSelectedSessionId, selectedActorId, panels, theme, readOnly, depth, capabilities, transport: injectedTransport } = options;
|
|
81
|
+
const { inspectorBaseUrl, name, serializeSnapshot = defaultSerializeSnapshot, selectedSessionId: configuredSelectedSessionId, selectedActorId, panels, theme, readOnly, depth, capabilities, sessionIdReuse = "stopped", transport: injectedTransport } = options;
|
|
82
82
|
const launch = options.launch ?? (options.autoOpen === true ? "browser" : "none");
|
|
83
83
|
const extractMachine = options.extractMachine ?? options.extractMachineConfig ?? defaultExtractMachineConfig;
|
|
84
84
|
const roomId = options.roomId ?? options.sessionId ?? getInspectionRoomId(url) ?? generateRoomId();
|
|
@@ -241,26 +241,60 @@ function createInspector(options = {}) {
|
|
|
241
241
|
const actors = /* @__PURE__ */ new Map();
|
|
242
242
|
const resolvedSessionIds = /* @__PURE__ */ new WeakMap();
|
|
243
243
|
const actorsByResolvedSessionId = /* @__PURE__ */ new Map();
|
|
244
|
+
const runtimeRoots = /* @__PURE__ */ new WeakMap();
|
|
245
|
+
const terminatedActors = /* @__PURE__ */ new WeakSet();
|
|
246
|
+
const reboundActors = /* @__PURE__ */ new WeakSet();
|
|
244
247
|
const manualSessionIds = /* @__PURE__ */ new Map();
|
|
245
248
|
/** Tracks which actors we've already emitted local actor events for. */
|
|
246
249
|
const locallyRegistered = /* @__PURE__ */ new Set();
|
|
247
250
|
/** v5 emits transition facets separately; accumulate them until snapshot. */
|
|
248
251
|
const pendingTransitions = /* @__PURE__ */ new Map();
|
|
249
|
-
function
|
|
252
|
+
function runtimeRootOf(actorRef, parentRef) {
|
|
253
|
+
const known = runtimeRoots.get(actorRef);
|
|
254
|
+
if (known) return known;
|
|
255
|
+
let rootRef = parentRef ?? actorRef;
|
|
256
|
+
while (rootRef._parent) rootRef = rootRef._parent;
|
|
257
|
+
runtimeRoots.set(actorRef, rootRef);
|
|
258
|
+
return rootRef;
|
|
259
|
+
}
|
|
260
|
+
function sessionIdOf(actorRef, parentRef = actorRef._parent, runtimeRoot) {
|
|
250
261
|
const existing = resolvedSessionIds.get(actorRef);
|
|
251
262
|
if (existing) return existing;
|
|
252
|
-
const
|
|
263
|
+
const parentSessionId = parentRef ? sessionIdOf(parentRef, parentRef._parent, runtimeRoot) : null;
|
|
264
|
+
const resolved = options.resolveSessionId?.(actorRef, actorRef.sessionId, parentSessionId) ?? actorRef.sessionId;
|
|
253
265
|
if (typeof resolved !== "string" || resolved.length === 0) throw new Error("createInspector(): resolveSessionId must return a non-empty string.");
|
|
266
|
+
assertSessionIdAvailable(actorRef, resolved, runtimeRoot ?? runtimeRootOf(actorRef, parentRef));
|
|
267
|
+
return claimSessionId(actorRef, resolved);
|
|
268
|
+
}
|
|
269
|
+
function assertSessionIdAvailable(actorRef, resolved, nextRoot) {
|
|
254
270
|
const claimedBy = actorsByResolvedSessionId.get(resolved);
|
|
255
|
-
|
|
271
|
+
const claimedEntry = actors.get(resolved);
|
|
272
|
+
if (claimedBy !== void 0 && claimedBy !== actorRef) {
|
|
273
|
+
if (runtimeRootOf(claimedBy) === nextRoot || !terminatedActors.has(claimedBy) && sessionIdReuse !== "always") throw new Error(`createInspector(): resolveSessionId returned duplicate id "${resolved}".`);
|
|
274
|
+
}
|
|
275
|
+
if (claimedBy === void 0 && claimedEntry) throw new Error(`createInspector(): resolveSessionId returned duplicate id "${resolved}".`);
|
|
276
|
+
}
|
|
277
|
+
function claimSessionId(actorRef, resolved) {
|
|
278
|
+
const claimedBy = actorsByResolvedSessionId.get(resolved);
|
|
279
|
+
if (claimedBy !== void 0 && claimedBy !== actorRef) {
|
|
280
|
+
actorsByResolvedSessionId.set(resolved, actorRef);
|
|
281
|
+
resolvedSessionIds.set(actorRef, resolved);
|
|
282
|
+
reboundActors.add(actorRef);
|
|
283
|
+
pendingTransitions.delete(resolved);
|
|
284
|
+
return resolved;
|
|
285
|
+
}
|
|
256
286
|
resolvedSessionIds.set(actorRef, resolved);
|
|
257
287
|
actorsByResolvedSessionId.set(resolved, actorRef);
|
|
258
288
|
return resolved;
|
|
259
289
|
}
|
|
290
|
+
function isCurrentOwner(actorRef) {
|
|
291
|
+
const sessionId = resolvedSessionIds.get(actorRef);
|
|
292
|
+
return sessionId === void 0 || actorsByResolvedSessionId.get(sessionId) === actorRef;
|
|
293
|
+
}
|
|
260
294
|
function rootSessionIdOf(runtimeRootId, actorRef) {
|
|
261
295
|
let rootRef = actorRef;
|
|
262
296
|
while (rootRef._parent) rootRef = rootRef._parent;
|
|
263
|
-
return rootRef.sessionId === runtimeRootId ? sessionIdOf(rootRef) : runtimeRootId;
|
|
297
|
+
return rootRef.sessionId === runtimeRootId ? sessionIdOf(rootRef, void 0, rootRef) : runtimeRootId;
|
|
264
298
|
}
|
|
265
299
|
function emitRegisterOnce(entry) {
|
|
266
300
|
if (locallyRegistered.has(entry.sessionId)) return;
|
|
@@ -268,23 +302,26 @@ function createInspector(options = {}) {
|
|
|
268
302
|
emitLocal("actor", entry);
|
|
269
303
|
emitLocal("register", entry);
|
|
270
304
|
}
|
|
271
|
-
function
|
|
305
|
+
function readSnapshot(actorRef) {
|
|
272
306
|
try {
|
|
273
|
-
return
|
|
307
|
+
return actorRef.getSnapshot();
|
|
274
308
|
} catch {
|
|
275
|
-
return
|
|
309
|
+
return;
|
|
276
310
|
}
|
|
277
311
|
}
|
|
278
|
-
function
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
312
|
+
function trackTermination(actorRef, snapshot) {
|
|
313
|
+
if (isStoppedSnapshot(snapshot)) terminatedActors.add(actorRef);
|
|
314
|
+
}
|
|
315
|
+
function serializedStoppedValue(serialized, snapshot) {
|
|
316
|
+
if (serialized !== null && typeof serialized === "object" && Object.hasOwn(serialized, "status")) return isStoppedSnapshot(serialized);
|
|
317
|
+
return isStoppedSnapshot(snapshot);
|
|
284
318
|
}
|
|
285
319
|
function toEntry(actorRef, rootActorId, details) {
|
|
286
|
-
const sessionId = sessionIdOf(actorRef);
|
|
287
320
|
const parentRef = details?.parentRef ?? actorRef._parent;
|
|
321
|
+
const sessionId = sessionIdOf(actorRef, parentRef);
|
|
322
|
+
const snapshot = details?.snapshot ?? readSnapshot(actorRef);
|
|
323
|
+
const serialized = snapshot === void 0 ? null : serializeSnapshot(snapshot);
|
|
324
|
+
if (snapshot !== void 0) trackTermination(actorRef, snapshot);
|
|
288
325
|
return {
|
|
289
326
|
sessionId,
|
|
290
327
|
actorId: details?.id ?? actorRef.id ?? sessionId,
|
|
@@ -292,8 +329,8 @@ function createInspector(options = {}) {
|
|
|
292
329
|
parentSessionId: parentRef ? sessionIdOf(parentRef) : null,
|
|
293
330
|
rootSessionId: rootActorId,
|
|
294
331
|
systemId: actorRef.systemId,
|
|
295
|
-
snapshot:
|
|
296
|
-
stopped:
|
|
332
|
+
snapshot: serialized,
|
|
333
|
+
stopped: snapshot === void 0 ? false : serializedStoppedValue(serialized, snapshot),
|
|
297
334
|
machineConfig: extractMachine(actorRef, details?.source ?? actorRef.src)
|
|
298
335
|
};
|
|
299
336
|
}
|
|
@@ -308,26 +345,73 @@ function createInspector(options = {}) {
|
|
|
308
345
|
...entry.stopped && { stopped: true }
|
|
309
346
|
};
|
|
310
347
|
}
|
|
311
|
-
function resolveActorTreeSessionIds(
|
|
312
|
-
|
|
313
|
-
const
|
|
314
|
-
|
|
348
|
+
function resolveActorTreeSessionIds(rootRef) {
|
|
349
|
+
const pending = /* @__PURE__ */ new Map();
|
|
350
|
+
const owners = /* @__PURE__ */ new Map();
|
|
351
|
+
function visit(actorRef, parentRef) {
|
|
352
|
+
const existing = resolvedSessionIds.get(actorRef);
|
|
353
|
+
const parentSessionId = parentRef ? resolvedSessionIds.get(parentRef) ?? pending.get(parentRef)?.resolved : null;
|
|
354
|
+
const resolved = existing ?? options.resolveSessionId?.(actorRef, actorRef.sessionId, parentSessionId ?? null) ?? actorRef.sessionId;
|
|
355
|
+
if (typeof resolved !== "string" || resolved.length === 0) throw new Error("createInspector(): resolveSessionId must return a non-empty string.");
|
|
356
|
+
const localOwner = owners.get(resolved);
|
|
357
|
+
if (localOwner && localOwner !== actorRef) throw new Error(`createInspector(): resolveSessionId returned duplicate id "${resolved}".`);
|
|
358
|
+
owners.set(resolved, actorRef);
|
|
359
|
+
if (!existing) pending.set(actorRef, {
|
|
360
|
+
resolved,
|
|
361
|
+
parentRef
|
|
362
|
+
});
|
|
363
|
+
assertSessionIdAvailable(actorRef, resolved, rootRef);
|
|
364
|
+
const children = actorRef.getSnapshot()?.children ?? {};
|
|
365
|
+
for (const child of Object.values(children)) if (child) visit(child, actorRef);
|
|
366
|
+
}
|
|
367
|
+
visit(rootRef);
|
|
368
|
+
for (const [actorRef, { resolved }] of pending) {
|
|
369
|
+
runtimeRoots.set(actorRef, rootRef);
|
|
370
|
+
claimSessionId(actorRef, resolved);
|
|
371
|
+
}
|
|
315
372
|
}
|
|
316
373
|
/**
|
|
317
374
|
* Walk the actor tree and populate the local `actors` map. Idempotent —
|
|
318
375
|
* existing entries stay in place but have their snapshot refreshed.
|
|
319
376
|
*/
|
|
320
|
-
function
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
377
|
+
function publishActorRegistered(entry, replaces = false) {
|
|
378
|
+
if (!initSent) return;
|
|
379
|
+
send({
|
|
380
|
+
type: "@statelyai.system.actorRegistered",
|
|
381
|
+
sessionId: entry.sessionId,
|
|
382
|
+
actorId: entry.actorId,
|
|
383
|
+
...replaces && { replaces: true },
|
|
384
|
+
...entry.displayName && { displayName: entry.displayName },
|
|
385
|
+
parentSessionId: entry.parentSessionId,
|
|
386
|
+
machine: entry.machineConfig,
|
|
387
|
+
snapshot: entry.snapshot ?? void 0
|
|
388
|
+
});
|
|
389
|
+
if ((configuredSelectedSessionId ?? selectedActorId) === entry.sessionId) send({
|
|
390
|
+
type: "@statelyai.system.selectActor",
|
|
391
|
+
sessionId: entry.sessionId
|
|
392
|
+
});
|
|
393
|
+
}
|
|
394
|
+
function backfillActorTree(actorRef, rootActorId, publish = false) {
|
|
395
|
+
const sessionId = sessionIdOf(actorRef);
|
|
396
|
+
const existing = actors.get(sessionId);
|
|
397
|
+
const replaces = reboundActors.delete(actorRef);
|
|
398
|
+
const entry = !existing || replaces ? toEntry(actorRef, rootActorId) : existing;
|
|
399
|
+
if (existing && !replaces) {
|
|
324
400
|
const snapshot = actorRef.getSnapshot();
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
401
|
+
const serialized = serializeSnapshot(snapshot);
|
|
402
|
+
trackTermination(actorRef, snapshot);
|
|
403
|
+
existing.snapshot = serialized;
|
|
404
|
+
existing.stopped ||= serializedStoppedValue(serialized, snapshot);
|
|
405
|
+
} else {
|
|
406
|
+
actors.set(entry.sessionId, entry);
|
|
407
|
+
if (replaces) {
|
|
408
|
+
emitLocal("actor", entry);
|
|
409
|
+
emitLocal("register", entry);
|
|
410
|
+
} else emitRegisterOnce(entry);
|
|
411
|
+
if (publish) publishActorRegistered(entry, replaces);
|
|
412
|
+
}
|
|
329
413
|
const children = actorRef.getSnapshot()?.children ?? {};
|
|
330
|
-
for (const child of Object.values(children)) if (child) backfillActorTree(child, rootActorId);
|
|
414
|
+
for (const child of Object.values(children)) if (child) backfillActorTree(child, rootActorId, publish);
|
|
331
415
|
}
|
|
332
416
|
const inspectedRoots = /* @__PURE__ */ new Map();
|
|
333
417
|
const observedRootIds = /* @__PURE__ */ new Set();
|
|
@@ -356,19 +440,16 @@ function createInspector(options = {}) {
|
|
|
356
440
|
initSent = true;
|
|
357
441
|
}
|
|
358
442
|
function handleActor(actorRef, rootActorId, details) {
|
|
359
|
-
|
|
443
|
+
const sessionId = sessionIdOf(actorRef, details?.parentRef);
|
|
444
|
+
const replaces = reboundActors.delete(actorRef);
|
|
445
|
+
if (actors.has(sessionId) && !replaces) return;
|
|
360
446
|
const entry = toEntry(actorRef, rootActorId, details);
|
|
361
447
|
actors.set(entry.sessionId, entry);
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
...entry.displayName && { displayName: entry.displayName },
|
|
368
|
-
parentSessionId: entry.parentSessionId,
|
|
369
|
-
machine: entry.machineConfig,
|
|
370
|
-
snapshot: entry.snapshot ?? void 0
|
|
371
|
-
});
|
|
448
|
+
if (replaces) {
|
|
449
|
+
emitLocal("actor", entry);
|
|
450
|
+
emitLocal("register", entry);
|
|
451
|
+
} else emitRegisterOnce(entry);
|
|
452
|
+
publishActorRegistered(entry, replaces);
|
|
372
453
|
}
|
|
373
454
|
function normalizeAction(action) {
|
|
374
455
|
return {
|
|
@@ -436,6 +517,7 @@ function createInspector(options = {}) {
|
|
|
436
517
|
const entry = actors.get(sessionId);
|
|
437
518
|
if (!entry) return;
|
|
438
519
|
const serialized = serializeSnapshot(snapshot);
|
|
520
|
+
trackTermination(actorRef, snapshot);
|
|
439
521
|
const inspectedSnapshot = {
|
|
440
522
|
sessionId: entry.sessionId,
|
|
441
523
|
sourceSessionId: transition.sourceSessionId,
|
|
@@ -448,7 +530,7 @@ function createInspector(options = {}) {
|
|
|
448
530
|
};
|
|
449
531
|
const wasStopped = entry.stopped;
|
|
450
532
|
entry.snapshot = serialized;
|
|
451
|
-
const stopped =
|
|
533
|
+
const stopped = serializedStoppedValue(serialized, snapshot);
|
|
452
534
|
entry.stopped ||= stopped;
|
|
453
535
|
pendingTransitions.delete(entry.sessionId);
|
|
454
536
|
if (initSent) send({
|
|
@@ -480,6 +562,7 @@ function createInspector(options = {}) {
|
|
|
480
562
|
materializePendingInit();
|
|
481
563
|
const event = inspectionEvent;
|
|
482
564
|
const rootActorId = rootSessionIdOf(event.rootId, event.actorRef);
|
|
565
|
+
if (!isCurrentOwner(event.actorRef)) return;
|
|
483
566
|
const isNewRoot = !observedRootIds.has(rootActorId);
|
|
484
567
|
observedRootIds.add(rootActorId);
|
|
485
568
|
switch (event.type) {
|
|
@@ -522,26 +605,30 @@ function createInspector(options = {}) {
|
|
|
522
605
|
break;
|
|
523
606
|
default: break;
|
|
524
607
|
}
|
|
525
|
-
if (isNewRoot) sendInit();
|
|
608
|
+
if (isNewRoot && !initSent) sendInit();
|
|
526
609
|
}
|
|
527
610
|
function attachActor(actor) {
|
|
528
611
|
const root = actor;
|
|
612
|
+
resolveActorTreeSessionIds(root);
|
|
529
613
|
const rootActorId = sessionIdOf(root);
|
|
530
614
|
const existing = inspectedRoots.get(rootActorId);
|
|
531
|
-
if (existing) return existing.subscription;
|
|
615
|
+
if (existing?.actor === root) return existing.subscription;
|
|
616
|
+
if (existing) {
|
|
617
|
+
existing.subscription.unsubscribe();
|
|
618
|
+
inspectedRoots.delete(rootActorId);
|
|
619
|
+
}
|
|
532
620
|
materializePendingInit();
|
|
533
|
-
resolveActorTreeSessionIds(root);
|
|
534
621
|
observedRootIds.add(rootActorId);
|
|
535
622
|
const subscription = root.system.inspect(handleInspectionEvent);
|
|
536
623
|
inspectedRoots.set(rootActorId, {
|
|
537
624
|
actor: root,
|
|
538
625
|
subscription
|
|
539
626
|
});
|
|
540
|
-
backfillActorTree(root, rootActorId);
|
|
541
|
-
sendInit();
|
|
627
|
+
backfillActorTree(root, rootActorId, true);
|
|
628
|
+
if (!initSent) sendInit();
|
|
542
629
|
return { unsubscribe() {
|
|
543
630
|
subscription.unsubscribe();
|
|
544
|
-
inspectedRoots.delete(rootActorId);
|
|
631
|
+
if (inspectedRoots.get(rootActorId)?.subscription === subscription) inspectedRoots.delete(rootActorId);
|
|
545
632
|
} };
|
|
546
633
|
}
|
|
547
634
|
function getManualSessionId(actorId) {
|
package/dist/inspect.d.mts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { B as InspectionSentEvent, D as ExportCallOptions, L as InspectionAction, O as ExportFormat, V as InspectionTakenTransition, b as EmbedEventName, k as ExportFormatMap, m as EditorCapabilities, v as EmbedEventHandler, w as EmbedMode, y as EmbedEventMap } from "./protocol-
|
|
2
|
-
import { a as InspectedTransition, c as InspectorDiscoveryEntry, d as ManualActorOptions, f as createInspector, 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-
|
|
1
|
+
import { B as InspectionSentEvent, D as ExportCallOptions, L as InspectionAction, O as ExportFormat, V as InspectionTakenTransition, b as EmbedEventName, k as ExportFormatMap, m as EditorCapabilities, v as EmbedEventHandler, w as EmbedMode, y as EmbedEventMap } from "./protocol-C-tx0WI6.mjs";
|
|
2
|
+
import { a as InspectedTransition, c as InspectorDiscoveryEntry, d as ManualActorOptions, f as createInspector, 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-C18TbR-o.mjs";
|
|
3
3
|
export { AdoptedActor, CreateInspectorOptions, EditorCapabilities, EmbedEventHandler, EmbedEventMap, EmbedEventName, EmbedMode, ExportCallOptions, ExportFormat, ExportFormatMap, InspectedEvent, InspectedSnapshot, InspectedTransition, InspectionAction, InspectionSentEvent, InspectionTakenTransition, Inspector, InspectorConnection, InspectorDiscoveryEntry, InspectorEvents, InspectorInspectionEvent, ManualActorOptions, Transport, createInspector, createStatelyInspector };
|
package/dist/inspect.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import "./version-
|
|
2
|
-
import { n as createStatelyInspector, t as createInspector } from "./inspect-
|
|
1
|
+
import "./version-1vqjW2Am.mjs";
|
|
2
|
+
import { n as createStatelyInspector, t as createInspector } from "./inspect-GI2nE3J9.mjs";
|
|
3
3
|
|
|
4
4
|
export { createInspector, createStatelyInspector };
|
|
@@ -383,6 +383,10 @@ interface MachineInitOptions {
|
|
|
383
383
|
}
|
|
384
384
|
interface ProjectInitOptions {
|
|
385
385
|
machines: ProjectEmbedMachine[];
|
|
386
|
+
/** Optional project-level chrome owned by the embed host. */
|
|
387
|
+
chrome?: {
|
|
388
|
+
/** Reserve a header row above the editor canvas. */header?: boolean;
|
|
389
|
+
};
|
|
386
390
|
/** Ephemeral, read-only reference documents shared across the project. */
|
|
387
391
|
documents?: EmbedDocument[];
|
|
388
392
|
currentMachineId?: string;
|
|
@@ -467,6 +471,9 @@ interface ClipboardWriteMessage {
|
|
|
467
471
|
interface ProjectInitMessage {
|
|
468
472
|
type: '@statelyai.project.init';
|
|
469
473
|
machines: ProjectEmbedMachine[];
|
|
474
|
+
chrome?: {
|
|
475
|
+
header?: boolean;
|
|
476
|
+
};
|
|
470
477
|
documents?: EmbedDocument[];
|
|
471
478
|
currentMachineId?: string;
|
|
472
479
|
mode?: EmbedMode;
|
|
@@ -497,6 +504,7 @@ interface ProjectInitMessage {
|
|
|
497
504
|
interface ProjectUpdateMessage {
|
|
498
505
|
type: '@statelyai.project.update';
|
|
499
506
|
machines: ProjectEmbedMachine[];
|
|
507
|
+
source?: 'external';
|
|
500
508
|
currentMachineId?: string;
|
|
501
509
|
commentsByMachineId?: Record<string, CommentsConfig>;
|
|
502
510
|
projectWorkspace?: ProjectWorkspaceConfig;
|
|
@@ -538,6 +546,11 @@ interface ToastMessage {
|
|
|
538
546
|
type: '@statelyai.toast';
|
|
539
547
|
message: string;
|
|
540
548
|
toastType?: 'success' | 'error' | 'info' | 'warning';
|
|
549
|
+
id?: string;
|
|
550
|
+
}
|
|
551
|
+
interface ToastDismissMessage {
|
|
552
|
+
type: '@statelyai.toast.dismiss';
|
|
553
|
+
id: string;
|
|
541
554
|
}
|
|
542
555
|
interface InspectSnapshotMessage {
|
|
543
556
|
type: '@statelyai.inspectSnapshot';
|
|
@@ -614,6 +627,8 @@ interface SystemActorRegisteredMessage {
|
|
|
614
627
|
type: '@statelyai.system.actorRegistered';
|
|
615
628
|
sessionId: string;
|
|
616
629
|
actorId: string;
|
|
630
|
+
/** This runtime actor replaces the previous owner of `sessionId`. */
|
|
631
|
+
replaces?: boolean;
|
|
617
632
|
/** Optional readable label; never replaces the runtime actor ID. */
|
|
618
633
|
displayName?: string;
|
|
619
634
|
parentSessionId: string | null;
|
|
@@ -812,7 +827,7 @@ interface ExtensionResultMessage {
|
|
|
812
827
|
error?: string;
|
|
813
828
|
}
|
|
814
829
|
/** All messages a client (embed/inspector) can send to the viz. */
|
|
815
|
-
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;
|
|
830
|
+
type ClientMessage = InitMessage | SetApiKeyMessage | EditorHandshakeMessage | SavedMessage | ClipboardReadResponseMessage | ClipboardWriteResponseMessage | ProjectInitMessage | ProjectUpdateMessage | ProjectSelectMachineMessage | ProjectSetWorkspaceOpenMessage | UpdateMessage | SetModeMessage | SetThemeMessage | SetSettingsMessage | RetrieveMessage | ToastMessage | ToastDismissMessage | InspectSnapshotMessage | SystemInitMessage | SystemSelectActorMessage | SystemActorRegisteredMessage | SystemActorEventMessage | SystemActorSnapshotMessage | SystemActorStoppedMessage | UploadCapabilitiesMessage | UploadResponseMessage | ExtensionResultMessage | ErrorMessage;
|
|
816
831
|
/** All messages the viz can send back to a client. */
|
|
817
832
|
type VizMessage = ReadyMessage | LoadedMessage | ChangeMessage | SaveMessage | VersionSaveRequestedMessage | ProjectMachineSelectedMessage | ProjectWorkspaceActionMessage | ProjectWorkspaceOpenChangedMessage | ViewModeChangedMessage | PanelChangedMessage | ModeChangedMessage | RetrievedMessage | ErrorMessage | CapabilityDeniedMessage | ClipboardReadMessage | ClipboardWriteMessage | UploadRequestMessage | ExtensionCallMessage;
|
|
818
833
|
interface InspectionClientMetadata {
|
|
@@ -843,4 +858,4 @@ declare const PREFIX = "@statelyai.";
|
|
|
843
858
|
/** Current WebSocket inspection protocol version. */
|
|
844
859
|
declare const INSPECTION_PROTOCOL_VERSION = 2;
|
|
845
860
|
//#endregion
|
|
846
|
-
export { ProjectSelectMachineMessage as $, ExtensionCallMessage as A, SystemActorSnapshotMessage as At, InspectionSentEvent as B,
|
|
861
|
+
export { ProjectSelectMachineMessage as $, EmbedPanelPosition as $t, ExtensionCallMessage as A, SystemActorSnapshotMessage as At, InspectionSentEvent as B, UploadResponseMessage as Bt, EmbedFormatManifest as C, SetSettingsMessage as Ct, ExportCallOptions as D, StateSourceLocation as Dt, ErrorMessage as E, SourceRange as Et, InitOptions as F, ToastMessage as Ft, MachineVersionAutoSaveOptions as G, VizMessage as Gt, LoadedMessage as H, ValidationIssue as Ht, InspectSnapshotMessage as I, UpdateMessage as It, PanelChangedMessage as J, createInspectionRoomUrls as Jt, ModeChangedMessage as K, assertEmbedExamples as Kt, InspectionAction as L, UploadCapabilitiesMessage as Lt, INSPECTION_PROTOCOL_VERSION as M, SystemInitMessage as Mt, INSPECTION_ROOM_QUERY_PARAM as N, SystemSelectActorMessage as Nt, ExportFormat as O, SystemActorEventMessage as Ot, InitMessage as P, ToastDismissMessage as Pt, ProjectMachineSelectedMessage as Q, EmbedPanelConfig as Qt, InspectionClientMetadata as R, UploadFileInfo as Rt, EmbedExtensionsManifest as S, SetModeMessage as St, ErrorCode as T, SourceLocation as Tt, MachineInitOptions as U, VersionSaveRequestedMessage as Ut, InspectionTakenTransition as V, UploadResult as Vt, MachineSourceLocations as W, ViewModeChangedMessage as Wt, ProjectInitMessage as X, isEmbedExample as Xt, ProjectEmbedMachine as Y, getInspectionRoomId as Yt, ProjectInitOptions as Z, isEmbedExampleMachine as Zt, EmbedDocumentLanguage as _, RetrievedMessage as _t, ChangeMessage as a, ProjectWorkspaceCapabilities as at, EmbedEventName as b, SessionMessage as bt, ClipboardReadResponseMessage as c, ProjectWorkspaceMachineOrigin as ct, CommentsConfig as d, ProtocolMessage as dt, ProjectSetWorkspaceOpenMessage as et, EMBED_DOCUMENT_LANGUAGES as f, ReadOnlyReason as ft, EmbedDocument as g, RetrieveMessage as gt, EditorHandshakeMessage as h, RegisteredMessage as ht, CapabilityDeniedMessage as i, ProjectWorkspaceActionMessage as it, ExtensionResultMessage as j, SystemActorStoppedMessage as jt, ExportFormatMap as k, SystemActorRegisteredMessage as kt, ClipboardWriteMessage as l, ProjectWorkspaceOpenChangedMessage as lt, EditorCapabilities as m, RegisterMessage as mt, CapabilityDeniedCapability as n, ProjectWorkspaceAction as nt, ClientMessage as o, ProjectWorkspaceConfig as ot, EMBED_DOCUMENT_LIMITS as p, ReadyMessage as pt, PREFIX as q, createInspectionActorId as qt, CapabilityDeniedEvent as r, ProjectWorkspaceActionIcon as rt, ClipboardReadMessage as s, ProjectWorkspaceMachine as st, ActorSystemEntry as t, ProjectUpdateMessage as tt, ClipboardWriteResponseMessage as u, ProjectWorkspaceProject as ut, EmbedEventHandler as v, SaveMessage as vt, EmbedMode as w, SetThemeMessage as wt, EmbedExample as x, SetApiKeyMessage as xt, EmbedEventMap as y, SavedMessage as yt, InspectionRoomUrls as z, UploadRequestMessage as zt };
|
package/dist/protocol.d.mts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { $ as ProjectSelectMachineMessage, A as ExtensionCallMessage, At as SystemActorSnapshotMessage, B as InspectionSentEvent, Bt as
|
|
2
|
-
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, EmbedExample, EmbedExtensionsManifest, EmbedFormatManifest, EmbedMode, EmbedPanelConfig, EmbedPanelPosition, ErrorCode, ErrorMessage, ExportCallOptions, ExportFormat, ExportFormatMap, ExtensionCallMessage, ExtensionResultMessage, INSPECTION_PROTOCOL_VERSION, INSPECTION_ROOM_QUERY_PARAM, InitMessage, InitOptions, InspectSnapshotMessage, InspectionAction, InspectionClientMetadata, InspectionRoomUrls, InspectionSentEvent, InspectionTakenTransition, LoadedMessage, MachineInitOptions, MachineSourceLocations, MachineVersionAutoSaveOptions, ModeChangedMessage, PREFIX, PanelChangedMessage, ProjectEmbedMachine, ProjectInitMessage, ProjectInitOptions, ProjectMachineSelectedMessage, ProjectSelectMachineMessage, ProjectSetWorkspaceOpenMessage, ProjectUpdateMessage, ProjectWorkspaceAction, ProjectWorkspaceActionIcon, ProjectWorkspaceActionMessage, ProjectWorkspaceCapabilities, ProjectWorkspaceConfig, ProjectWorkspaceMachine, ProjectWorkspaceMachineOrigin, 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, VersionSaveRequestedMessage, ViewModeChangedMessage, VizMessage, assertEmbedExamples, createInspectionActorId, createInspectionRoomUrls, getInspectionRoomId, isEmbedExample, isEmbedExampleMachine };
|
|
1
|
+
import { $ as ProjectSelectMachineMessage, $t as EmbedPanelPosition, A as ExtensionCallMessage, At as SystemActorSnapshotMessage, B as InspectionSentEvent, Bt as UploadResponseMessage, C as EmbedFormatManifest, Ct as SetSettingsMessage, D as ExportCallOptions, Dt as StateSourceLocation, E as ErrorMessage, Et as SourceRange, F as InitOptions, Ft as ToastMessage, G as MachineVersionAutoSaveOptions, Gt as VizMessage, H as LoadedMessage, Ht as ValidationIssue, I as InspectSnapshotMessage, It as UpdateMessage, J as PanelChangedMessage, Jt as createInspectionRoomUrls, K as ModeChangedMessage, Kt as assertEmbedExamples, L as InspectionAction, Lt as UploadCapabilitiesMessage, M as INSPECTION_PROTOCOL_VERSION, Mt as SystemInitMessage, N as INSPECTION_ROOM_QUERY_PARAM, Nt as SystemSelectActorMessage, O as ExportFormat, Ot as SystemActorEventMessage, P as InitMessage, Pt as ToastDismissMessage, Q as ProjectMachineSelectedMessage, Qt as EmbedPanelConfig, R as InspectionClientMetadata, Rt as UploadFileInfo, S as EmbedExtensionsManifest, St as SetModeMessage, T as ErrorCode, Tt as SourceLocation, U as MachineInitOptions, Ut as VersionSaveRequestedMessage, V as InspectionTakenTransition, Vt as UploadResult, W as MachineSourceLocations, Wt as ViewModeChangedMessage, X as ProjectInitMessage, Xt as isEmbedExample, Y as ProjectEmbedMachine, Yt as getInspectionRoomId, Z as ProjectInitOptions, Zt as isEmbedExampleMachine, _ as EmbedDocumentLanguage, _t as RetrievedMessage, a as ChangeMessage, at as ProjectWorkspaceCapabilities, b as EmbedEventName, bt as SessionMessage, c as ClipboardReadResponseMessage, ct as ProjectWorkspaceMachineOrigin, d as CommentsConfig, dt as ProtocolMessage, et as ProjectSetWorkspaceOpenMessage, f as EMBED_DOCUMENT_LANGUAGES, ft as ReadOnlyReason, g as EmbedDocument, gt as RetrieveMessage, h as EditorHandshakeMessage, ht as RegisteredMessage, i as CapabilityDeniedMessage, it as ProjectWorkspaceActionMessage, j as ExtensionResultMessage, jt as SystemActorStoppedMessage, k as ExportFormatMap, kt as SystemActorRegisteredMessage, l as ClipboardWriteMessage, lt as ProjectWorkspaceOpenChangedMessage, m as EditorCapabilities, mt as RegisterMessage, n as CapabilityDeniedCapability, nt as ProjectWorkspaceAction, o as ClientMessage, ot as ProjectWorkspaceConfig, p as EMBED_DOCUMENT_LIMITS, pt as ReadyMessage, q as PREFIX, qt as createInspectionActorId, r as CapabilityDeniedEvent, rt as ProjectWorkspaceActionIcon, s as ClipboardReadMessage, st as ProjectWorkspaceMachine, t as ActorSystemEntry, tt as ProjectUpdateMessage, u as ClipboardWriteResponseMessage, ut as ProjectWorkspaceProject, v as EmbedEventHandler, vt as SaveMessage, w as EmbedMode, wt as SetThemeMessage, x as EmbedExample, xt as SetApiKeyMessage, y as EmbedEventMap, yt as SavedMessage, z as InspectionRoomUrls, zt as UploadRequestMessage } from "./protocol-C-tx0WI6.mjs";
|
|
2
|
+
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, EmbedExample, EmbedExtensionsManifest, EmbedFormatManifest, EmbedMode, EmbedPanelConfig, EmbedPanelPosition, ErrorCode, ErrorMessage, ExportCallOptions, ExportFormat, ExportFormatMap, ExtensionCallMessage, ExtensionResultMessage, INSPECTION_PROTOCOL_VERSION, INSPECTION_ROOM_QUERY_PARAM, InitMessage, InitOptions, InspectSnapshotMessage, InspectionAction, InspectionClientMetadata, InspectionRoomUrls, InspectionSentEvent, InspectionTakenTransition, LoadedMessage, MachineInitOptions, MachineSourceLocations, MachineVersionAutoSaveOptions, ModeChangedMessage, PREFIX, PanelChangedMessage, ProjectEmbedMachine, ProjectInitMessage, ProjectInitOptions, ProjectMachineSelectedMessage, ProjectSelectMachineMessage, ProjectSetWorkspaceOpenMessage, ProjectUpdateMessage, ProjectWorkspaceAction, ProjectWorkspaceActionIcon, ProjectWorkspaceActionMessage, ProjectWorkspaceCapabilities, ProjectWorkspaceConfig, ProjectWorkspaceMachine, ProjectWorkspaceMachineOrigin, 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, ToastDismissMessage, ToastMessage, UpdateMessage, UploadCapabilitiesMessage, UploadFileInfo, UploadRequestMessage, UploadResponseMessage, UploadResult, ValidationIssue, VersionSaveRequestedMessage, ViewModeChangedMessage, VizMessage, assertEmbedExamples, createInspectionActorId, createInspectionRoomUrls, getInspectionRoomId, isEmbedExample, isEmbedExampleMachine };
|
package/dist/relay.d.mts
CHANGED
|
@@ -133,6 +133,7 @@ function toInitMessage(options) {
|
|
|
133
133
|
if ("machines" in options) return {
|
|
134
134
|
type: "@statelyai.project.init",
|
|
135
135
|
machines: options.machines,
|
|
136
|
+
chrome: options.chrome,
|
|
136
137
|
documents: options.documents,
|
|
137
138
|
currentMachineId: options.currentMachineId,
|
|
138
139
|
mode: options.mode,
|
|
@@ -365,7 +366,7 @@ function createWebSocketTransport(options) {
|
|
|
365
366
|
|
|
366
367
|
//#endregion
|
|
367
368
|
//#region src/version.ts
|
|
368
|
-
const SDK_VERSION = "0.
|
|
369
|
+
const SDK_VERSION = "0.32.0";
|
|
369
370
|
function inspectionRuntime() {
|
|
370
371
|
if (typeof window !== "undefined") return "browser";
|
|
371
372
|
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.
|
|
3
|
+
"version": "0.32.0",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"bin": {
|
|
6
6
|
"stately-sdk": "./dist/bin.mjs"
|
|
@@ -93,7 +93,7 @@
|
|
|
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.
|
|
96
|
+
"@statelyai/api-contract": "0.5.0",
|
|
97
97
|
"@statelyai/graph-tools": "0.8.3"
|
|
98
98
|
},
|
|
99
99
|
"engines": {
|