@statelyai/sdk 0.26.2 → 0.27.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 +30 -2
- package/dist/auth.d.mts +1 -1
- package/dist/{editorHostSession-DFjM-RoT.d.mts → editorHostSession-CWAuoMtC.d.mts} +9 -3
- package/dist/{editorHostSession-CwGeXJ6g.mjs → editorHostSession-shrjfosC.mjs} +6 -3
- package/dist/editorHostSession.d.mts +1 -1
- package/dist/editorHostSession.mjs +1 -1
- package/dist/embed.d.mts +6 -3
- package/dist/embed.mjs +23 -1
- package/dist/embedPanel-Bpbq4sfJ.d.mts +13 -0
- package/dist/{graph-DoUReqxz.d.mts → graph-BwHnhzpC.d.mts} +48 -6
- package/dist/graph.d.mts +1 -1
- package/dist/graph.mjs +36 -4
- package/dist/{index-DKRB-u93.d.mts → index-D2I1qPsf.d.mts} +19 -3
- package/dist/index.d.mts +8 -7
- package/dist/index.mjs +6 -6
- package/dist/{inspect-Br_vS_lK.d.mts → inspect-D61HS-t7.d.mts} +2 -5
- package/dist/{inspect-BA3EPIz9.mjs → inspect-_E2lVbQA.mjs} +2 -4
- package/dist/inspect.d.mts +1 -1
- package/dist/inspect.mjs +2 -2
- package/dist/patchTypes.d.mts +1 -1
- package/dist/protocol.d.mts +46 -15
- package/dist/{statelyPragma-CWxhEIcZ.mjs → statelyPragma-DD7wx7-b.mjs} +1198 -31
- package/dist/{studio-B6P177N3.d.mts → studio-B9-1Ynrx.d.mts} +4 -2
- package/dist/{studio-iNSHtNmP.mjs → studio-CNkxMZyz.mjs} +4 -1
- package/dist/studio.d.mts +1 -1
- package/dist/studio.mjs +1 -1
- package/dist/sync.d.mts +12 -4
- package/dist/sync.mjs +2920 -262
- package/dist/{version-DKSLBwJ9.mjs → version-7SUCFMqb.mjs} +34 -8
- package/package.json +3 -3
- package/schemas/xstate.schema.json +41 -5
- /package/dist/{auth-B0ZTKri2.d.mts → auth-BPyCCHYo.d.mts} +0 -0
- /package/dist/{editor-sync-types-C-zWaaVk.d.mts → editor-sync-types-CTKArS8n.d.mts} +0 -0
package/README.md
CHANGED
|
@@ -42,6 +42,10 @@ embed.init({
|
|
|
42
42
|
{ path: "README.md", content: "# How this workflow works" },
|
|
43
43
|
{ path: "src/machine.ts", content: machineSource },
|
|
44
44
|
],
|
|
45
|
+
panels: [
|
|
46
|
+
{ id: "structure", position: "left", tab: true },
|
|
47
|
+
{ id: "details", position: "right", tab: true },
|
|
48
|
+
],
|
|
45
49
|
});
|
|
46
50
|
```
|
|
47
51
|
|
|
@@ -156,6 +160,10 @@ const extracted = await studio.code.extractMachines({
|
|
|
156
160
|
});
|
|
157
161
|
```
|
|
158
162
|
|
|
163
|
+
Each extracted machine includes `machineIndex`, its zero-based source ordinal.
|
|
164
|
+
The ordinal remains stable when an earlier `createMachine` call cannot be
|
|
165
|
+
extracted.
|
|
166
|
+
|
|
159
167
|
The client namespaces map one-to-one onto the server-owned `/api/v1` contract:
|
|
160
168
|
|
|
161
169
|
| Method | Operation |
|
|
@@ -294,7 +302,8 @@ to registration metadata.
|
|
|
294
302
|
|
|
295
303
|
### CLI and sync
|
|
296
304
|
|
|
297
|
-
<!-- CLI package identity and commands from ../cli/package.json
|
|
305
|
+
<!-- CLI package identity and commands from ../cli/package.json, ../cli/src/cli.ts#COMMANDS, and src/sync.ts#pullSync -->
|
|
306
|
+
<!-- linked-machine read-merge behavior from src/sync.ts#pushLocalMachineLinks and src/sync.ts#pushSync -->
|
|
298
307
|
|
|
299
308
|
The separate [`statelyai`](https://www.npmjs.com/package/statelyai) CLI lists
|
|
300
309
|
local XState machines without authentication and can connect them to Stately
|
|
@@ -310,9 +319,28 @@ npx statelyai diff ./checkout.machine.ts machine-id
|
|
|
310
319
|
npx statelyai open ./checkout.machine.ts
|
|
311
320
|
```
|
|
312
321
|
|
|
322
|
+
`statelyai diff` ignores entity IDs and presentation-only layout or color
|
|
323
|
+
fields, so `--fail-on-changes` can gate CI on machine semantics.
|
|
324
|
+
|
|
325
|
+
Pushing a linked machine reads its remote definition first. Local source wins
|
|
326
|
+
for structure, while presentation attached to unchanged entities—including
|
|
327
|
+
layout, colors, and annotations—is preserved.
|
|
328
|
+
The sync helpers re-read before writing and abort if remote edits keep changing.
|
|
329
|
+
|
|
330
|
+
Pulling into an existing JavaScript or TypeScript machine uses surgical source
|
|
331
|
+
patches. Comments, imports, helpers, and implementation bodies outside the
|
|
332
|
+
changed machine regions remain intact. `force: true` on `pullSync` allows full
|
|
333
|
+
regeneration when the source cannot be reconciled safely.
|
|
334
|
+
|
|
313
335
|
### Graph and codegen helpers
|
|
314
336
|
|
|
315
|
-
|
|
337
|
+
<!-- graph conversion and codegen exports from src/graph.ts and src/index.ts -->
|
|
338
|
+
|
|
339
|
+
Convert between Studio graph data, XState machine configs, and TypeScript
|
|
340
|
+
source with `graphToXStateTS`. Use `graphToXStateFSM` for a flat `createFSM`
|
|
341
|
+
projection and `getXStateFSMCompatibilityIssues` before exporting to report
|
|
342
|
+
semantics that the compact FSM cannot represent. Generate types from JSON
|
|
343
|
+
Schema.
|
|
316
344
|
|
|
317
345
|
## Support
|
|
318
346
|
|
package/dist/auth.d.mts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { i as getCredentialToken, n as StatelyCredential, r as createAuthorizationHeader, t as StatelyAuthMode } from "./auth-
|
|
1
|
+
import { i as getCredentialToken, n as StatelyCredential, r as createAuthorizationHeader, t as StatelyAuthMode } from "./auth-BPyCCHYo.mjs";
|
|
2
2
|
export { StatelyAuthMode, StatelyCredential, createAuthorizationHeader, getCredentialToken };
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { t as EmbedPanelConfig } from "./embedPanel-Bpbq4sfJ.mjs";
|
|
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-CTKArS8n.mjs";
|
|
2
3
|
|
|
3
4
|
//#region src/editorHostProtocol.d.ts
|
|
4
5
|
declare const EDITOR_PROTOCOL_VERSION = 1;
|
|
@@ -60,8 +61,12 @@ type EditorHostInboundMessage = {
|
|
|
60
61
|
};
|
|
61
62
|
interface EditorHostInitOptions {
|
|
62
63
|
settings?: Record<string, unknown>;
|
|
64
|
+
panels?: EmbedPanelConfig[];
|
|
65
|
+
/** @deprecated Use `panels`. */
|
|
63
66
|
leftPanels?: string[];
|
|
67
|
+
/** @deprecated Use `panels`. */
|
|
64
68
|
rightPanels?: string[];
|
|
69
|
+
/** @deprecated Use `panels[].initiallyOpen`. */
|
|
65
70
|
activePanels?: string[];
|
|
66
71
|
unsavedIndicator?: {
|
|
67
72
|
enabled?: boolean;
|
|
@@ -79,8 +84,9 @@ type EditorHostOutboundMessage = {
|
|
|
79
84
|
capabilities?: EditorCapabilities;
|
|
80
85
|
sourceLocations?: MachineSourceLocations;
|
|
81
86
|
settings?: Record<string, unknown>;
|
|
82
|
-
|
|
83
|
-
|
|
87
|
+
panels?: EmbedPanelConfig[]; /** @deprecated Use `panels`. */
|
|
88
|
+
leftPanels?: string[]; /** @deprecated Use `panels`. */
|
|
89
|
+
rightPanels?: string[]; /** @deprecated Use `panels[].initiallyOpen`. */
|
|
84
90
|
activePanels?: string[];
|
|
85
91
|
unsavedIndicator?: {
|
|
86
92
|
enabled?: boolean;
|
|
@@ -340,9 +340,12 @@ var EditorHostSession = class {
|
|
|
340
340
|
theme: this.options.getTheme?.() ?? "light",
|
|
341
341
|
unsavedIndicator: this.options.init?.unsavedIndicator ?? { enabled: true },
|
|
342
342
|
settings: this.options.init?.settings,
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
343
|
+
panels: this.options.init?.panels,
|
|
344
|
+
...this.options.init?.panels === void 0 && {
|
|
345
|
+
leftPanels: this.options.init?.leftPanels ?? [],
|
|
346
|
+
rightPanels: this.options.init?.rightPanels ?? [],
|
|
347
|
+
activePanels: this.options.init?.activePanels ?? []
|
|
348
|
+
}
|
|
346
349
|
});
|
|
347
350
|
}
|
|
348
351
|
async save(message) {
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as EditorSyncError, c as fetchEditorSyncAccess, d as EditorHostExportFormat, f as EditorHostInboundMessage, h as EditorHostValidationIssue, i as EditorSyncBackend, l as EDITOR_PROTOCOL_VERSION, m as EditorHostOutboundMessage, n as EditorHostSessionOptions, o as RemoteEditorSyncBackendOptions, p as EditorHostInitOptions, r as EditorSourceHost, s as createRemoteEditorSyncBackend, t as EditorHostSession, u as EditorHostDiagnostic } from "./editorHostSession-
|
|
1
|
+
import { a as EditorSyncError, c as fetchEditorSyncAccess, d as EditorHostExportFormat, f as EditorHostInboundMessage, h as EditorHostValidationIssue, i as EditorSyncBackend, l as EDITOR_PROTOCOL_VERSION, m as EditorHostOutboundMessage, n as EditorHostSessionOptions, o as RemoteEditorSyncBackendOptions, p as EditorHostInitOptions, r as EditorSourceHost, s as createRemoteEditorSyncBackend, t as EditorHostSession, u as EditorHostDiagnostic } from "./editorHostSession-CWAuoMtC.mjs";
|
|
2
2
|
export { EDITOR_PROTOCOL_VERSION, EditorHostDiagnostic, 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-
|
|
3
|
+
import { i as fetchEditorSyncAccess, n as EditorSyncError, r as createRemoteEditorSyncBackend, t as EditorHostSession } from "./editorHostSession-shrjfosC.mjs";
|
|
4
4
|
|
|
5
5
|
export { EDITOR_PROTOCOL_VERSION, EditorHostSession, EditorSyncError, createRemoteEditorSyncBackend, fetchEditorSyncAccess };
|
package/dist/embed.d.mts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import { i as ProfileManifest } from "./index-
|
|
2
|
-
import { i as StatelyGraph } from "./graph-
|
|
1
|
+
import { i as ProfileManifest } from "./index-D2I1qPsf.mjs";
|
|
2
|
+
import { i as StatelyGraph } from "./graph-BwHnhzpC.mjs";
|
|
3
|
+
import { n as EmbedPanelPosition, t as EmbedPanelConfig } from "./embedPanel-Bpbq4sfJ.mjs";
|
|
3
4
|
import { CapabilityDeniedEvent, CommentsConfig, EditorCapabilities, EmbedDocument, EmbedDocumentLanguage, EmbedEventHandler, EmbedEventMap, EmbedEventName, EmbedExtensionsManifest, EmbedMode, ExportCallOptions, ExportFormat, ExportFormatMap, InitOptions, MachineInitOptions, MachineSourceLocations, MachineVersionAutoSaveOptions, ProjectEmbedMachine, ProjectWorkspaceAction, ProjectWorkspaceActionIcon, ProjectWorkspaceCapabilities, ProjectWorkspaceConfig, ProjectWorkspaceMachine, ProjectWorkspaceMachineOrigin, ProjectWorkspaceProject, UploadResult } from "./protocol.mjs";
|
|
4
5
|
import { AssetUploadAdapter } from "./assetStorage.mjs";
|
|
5
6
|
|
|
@@ -106,6 +107,8 @@ interface StatelyEmbedOptions extends Partial<MachineInitOptions> {
|
|
|
106
107
|
onSave?: (graph: StatelyGraph, machineConfig: unknown) => void;
|
|
107
108
|
onVersionSaveRequested?: (event: EmbedEventMap['versionSaveRequested']) => void;
|
|
108
109
|
onViewModeChanged?: (viewMode: 'graph' | 'list') => void;
|
|
110
|
+
onPanelChanged?: (event: EmbedEventMap['panelChanged']) => void;
|
|
111
|
+
onModeChanged?: (event: EmbedEventMap['modeChanged']) => void;
|
|
109
112
|
onError?: (error: {
|
|
110
113
|
code: string;
|
|
111
114
|
message: string;
|
|
@@ -151,4 +154,4 @@ interface StatelyEmbed {
|
|
|
151
154
|
}
|
|
152
155
|
declare function createStatelyEmbed(options: StatelyEmbedOptions): StatelyEmbed;
|
|
153
156
|
//#endregion
|
|
154
|
-
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 MachineVersionAutoSaveOptions, type ProjectEmbedMachine, type ProjectWorkspaceAction, type ProjectWorkspaceActionIcon, type ProjectWorkspaceCapabilities, type ProjectWorkspaceConfig, type ProjectWorkspaceMachine, type ProjectWorkspaceMachineOrigin, type ProjectWorkspaceProject, StatelyEmbed, StatelyEmbedOptions, type UploadResult, createStatelyEmbed };
|
|
157
|
+
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 };
|
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-7SUCFMqb.mjs";
|
|
2
2
|
import { t as EDITOR_PROTOCOL_VERSION } from "./editorHostProtocol-Bko7wge8.mjs";
|
|
3
3
|
|
|
4
4
|
//#region src/embed.ts
|
|
@@ -333,6 +333,28 @@ function createStatelyEmbed(options) {
|
|
|
333
333
|
});
|
|
334
334
|
break;
|
|
335
335
|
}
|
|
336
|
+
case "@statelyai.panelChanged": {
|
|
337
|
+
const panel = data;
|
|
338
|
+
const event = {
|
|
339
|
+
side: panel.side,
|
|
340
|
+
id: panel.id,
|
|
341
|
+
activePanels: panel.activePanels,
|
|
342
|
+
machineId: panel.machineId
|
|
343
|
+
};
|
|
344
|
+
options.onPanelChanged?.(event);
|
|
345
|
+
events.emit("panelChanged", event);
|
|
346
|
+
break;
|
|
347
|
+
}
|
|
348
|
+
case "@statelyai.modeChanged": {
|
|
349
|
+
const mode = data;
|
|
350
|
+
const event = {
|
|
351
|
+
mode: mode.mode,
|
|
352
|
+
machineId: mode.machineId
|
|
353
|
+
};
|
|
354
|
+
options.onModeChanged?.(event);
|
|
355
|
+
events.emit("modeChanged", event);
|
|
356
|
+
break;
|
|
357
|
+
}
|
|
336
358
|
case "@statelyai.retrieved": {
|
|
337
359
|
const retrieved = data;
|
|
338
360
|
exportManager.resolve(retrieved.requestId, retrieved.data);
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
//#region src/embedPanel.d.ts
|
|
2
|
+
type EmbedPanelPosition = 'left' | 'right' | 'bottom';
|
|
3
|
+
interface EmbedPanelConfig {
|
|
4
|
+
id: string;
|
|
5
|
+
/** Restrict the panel to one side. Omit to allow any side. */
|
|
6
|
+
position?: EmbedPanelPosition;
|
|
7
|
+
/** Keep a one-click tab visible on its positioned or preferred side. */
|
|
8
|
+
tab?: boolean;
|
|
9
|
+
/** Open the panel when the embed is initialized. */
|
|
10
|
+
initiallyOpen?: boolean;
|
|
11
|
+
}
|
|
12
|
+
//#endregion
|
|
13
|
+
export { EmbedPanelPosition as n, EmbedPanelConfig as t };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { t as CodeExpression } from "./index-
|
|
1
|
+
import { t as CodeExpression } from "./index-D2I1qPsf.mjs";
|
|
2
2
|
import * as _statelyai_graph0 from "@statelyai/graph";
|
|
3
3
|
import { Graph } from "@statelyai/graph";
|
|
4
4
|
|
|
@@ -12,7 +12,11 @@ type ExtractorGuard = {
|
|
|
12
12
|
interface DigraphNodeInvokeData {
|
|
13
13
|
src: string;
|
|
14
14
|
id: string;
|
|
15
|
-
|
|
15
|
+
srcExpression?: CodeExpression;
|
|
16
|
+
registryKey?: string;
|
|
17
|
+
timeout?: number | string | CodeExpression;
|
|
18
|
+
input: Record<string, unknown> | CodeExpression | undefined;
|
|
19
|
+
output?: Record<string, unknown> | CodeExpression;
|
|
16
20
|
settings: Record<string, any>;
|
|
17
21
|
kind: 'inline' | 'named';
|
|
18
22
|
}
|
|
@@ -22,10 +26,14 @@ interface DigraphEdgeData {
|
|
|
22
26
|
guard?: ExtractorGuard;
|
|
23
27
|
transitions?: DigraphEdgeTransition[];
|
|
24
28
|
actions: DigraphAction[];
|
|
29
|
+
context?: Record<string, unknown> | CodeExpression;
|
|
30
|
+
input?: Record<string, unknown> | CodeExpression;
|
|
31
|
+
route?: boolean;
|
|
25
32
|
description?: string;
|
|
26
33
|
internal?: boolean | undefined;
|
|
27
34
|
metaEntries?: [key: string, value: any][] | undefined;
|
|
28
35
|
color?: CanvasColor;
|
|
36
|
+
assets?: DigraphAsset[];
|
|
29
37
|
}
|
|
30
38
|
type InvocationEventTypeData = {
|
|
31
39
|
type: 'invocation.done';
|
|
@@ -184,7 +192,7 @@ interface GuardSource {
|
|
|
184
192
|
}
|
|
185
193
|
interface DigraphData {
|
|
186
194
|
name: string;
|
|
187
|
-
context: Record<string, JsonItem> | JsonExpressionString;
|
|
195
|
+
context: Record<string, JsonItem> | JsonExpressionString | CodeExpression;
|
|
188
196
|
schemas: {
|
|
189
197
|
input: SimpleJsonSchema | null;
|
|
190
198
|
output: SimpleJsonSchema | null;
|
|
@@ -205,9 +213,13 @@ interface DigraphData {
|
|
|
205
213
|
interface DigraphConfig {
|
|
206
214
|
id: string;
|
|
207
215
|
profile?: `@${string}/${string}@${string}` | 'xstate-v5' | 'xstate-v6-alpha';
|
|
216
|
+
version?: string | null;
|
|
217
|
+
options?: {
|
|
218
|
+
maxIterations?: number;
|
|
219
|
+
} | null;
|
|
208
220
|
rootNode: DigraphNodeConfig;
|
|
209
221
|
edges: DigraphEdgeConfig[];
|
|
210
|
-
context: Record<string, JsonItem> | JsonExpressionString;
|
|
222
|
+
context: Record<string, JsonItem> | JsonExpressionString | CodeExpression;
|
|
211
223
|
schemas?: DigraphData['schemas'];
|
|
212
224
|
originalCode?: string;
|
|
213
225
|
implementations?: DigraphData['implementations'];
|
|
@@ -279,7 +291,7 @@ type DigraphAssetInternal<T extends AssetTemplate> = {
|
|
|
279
291
|
type DigraphAsset = AssetTemplate extends infer Template ? Template extends AssetTemplate ? DigraphAssetInternal<Template> : never : never;
|
|
280
292
|
interface StateNodeJSONData {
|
|
281
293
|
key: string;
|
|
282
|
-
type?: 'parallel' | 'final' | 'history' | 'annotation';
|
|
294
|
+
type?: 'parallel' | 'final' | 'history' | 'choice' | 'annotation';
|
|
283
295
|
history?: 'shallow' | 'deep';
|
|
284
296
|
order?: number;
|
|
285
297
|
meta?: any;
|
|
@@ -288,12 +300,21 @@ interface StateNodeJSONData {
|
|
|
288
300
|
exit: DigraphAction[];
|
|
289
301
|
invoke: DigraphNodeInvokeData[];
|
|
290
302
|
initial?: string;
|
|
303
|
+
initialInput?: Record<string, unknown> | CodeExpression;
|
|
304
|
+
timeout?: number | string | CodeExpression;
|
|
305
|
+
route?: Record<string, unknown> | CodeExpression;
|
|
306
|
+
output?: Record<string, unknown> | CodeExpression;
|
|
291
307
|
data?: any;
|
|
292
308
|
tags: string[];
|
|
293
309
|
description?: string;
|
|
294
310
|
color?: CanvasColor;
|
|
295
311
|
blockFlowDirection?: 'horizontal' | undefined;
|
|
296
312
|
assets?: DigraphAsset[];
|
|
313
|
+
schemas?: {
|
|
314
|
+
context?: Record<string, SimpleJsonSchema> | null;
|
|
315
|
+
input?: SimpleJsonSchema | null;
|
|
316
|
+
output?: SimpleJsonSchema | null;
|
|
317
|
+
} | null;
|
|
297
318
|
}
|
|
298
319
|
//#endregion
|
|
299
320
|
//#region src/graph.d.ts
|
|
@@ -309,12 +330,20 @@ interface StatelyGuard {
|
|
|
309
330
|
interface StatelyInvoke {
|
|
310
331
|
src: string;
|
|
311
332
|
id: string;
|
|
333
|
+
srcExpression?: CodeExpression;
|
|
334
|
+
registryKey?: string;
|
|
335
|
+
timeout?: number | string | CodeExpression;
|
|
312
336
|
input?: Record<string, unknown> | CodeExpression;
|
|
337
|
+
output?: Record<string, unknown> | CodeExpression;
|
|
313
338
|
}
|
|
314
339
|
interface StatelyNodeData {
|
|
315
340
|
key: string;
|
|
316
|
-
type?: 'parallel' | 'final' | 'history';
|
|
341
|
+
type?: 'parallel' | 'final' | 'history' | 'choice';
|
|
317
342
|
initialId?: string | null;
|
|
343
|
+
initialInput?: Record<string, unknown> | CodeExpression;
|
|
344
|
+
timeout?: number | string | CodeExpression;
|
|
345
|
+
route?: Record<string, unknown> | CodeExpression;
|
|
346
|
+
output?: Record<string, unknown> | CodeExpression;
|
|
318
347
|
history?: 'shallow' | 'deep' | boolean;
|
|
319
348
|
entry?: StatelyAction[];
|
|
320
349
|
exit?: StatelyAction[];
|
|
@@ -323,6 +352,11 @@ interface StatelyNodeData {
|
|
|
323
352
|
description?: string;
|
|
324
353
|
color?: string;
|
|
325
354
|
meta?: Record<string, unknown>;
|
|
355
|
+
schemas?: {
|
|
356
|
+
context?: Record<string, SimpleJsonSchema> | null;
|
|
357
|
+
input?: SimpleJsonSchema | null;
|
|
358
|
+
output?: SimpleJsonSchema | null;
|
|
359
|
+
} | null;
|
|
326
360
|
}
|
|
327
361
|
interface StatelyEdgeData {
|
|
328
362
|
eventType: string;
|
|
@@ -330,12 +364,20 @@ interface StatelyEdgeData {
|
|
|
330
364
|
transitionType?: 'normal' | 'targetless' | 'reenter';
|
|
331
365
|
guard?: StatelyGuard | null;
|
|
332
366
|
actions?: StatelyAction[];
|
|
367
|
+
context?: Record<string, unknown> | CodeExpression;
|
|
368
|
+
input?: Record<string, unknown> | CodeExpression;
|
|
369
|
+
route?: boolean;
|
|
333
370
|
description?: string | null;
|
|
334
371
|
color?: string;
|
|
335
372
|
meta?: Record<string, unknown> | null;
|
|
336
373
|
}
|
|
337
374
|
interface StatelyGraphData {
|
|
338
375
|
profile?: `@${string}/${string}@${string}` | 'xstate-v5' | 'xstate-v6-alpha';
|
|
376
|
+
version?: string | null;
|
|
377
|
+
options?: {
|
|
378
|
+
maxIterations?: number;
|
|
379
|
+
} | null;
|
|
380
|
+
context?: Record<string, unknown> | JsonExpressionString | CodeExpression | null;
|
|
339
381
|
schemas?: {
|
|
340
382
|
context?: Record<string, SimpleJsonSchema> | null;
|
|
341
383
|
events?: Record<string, SimpleJsonSchemaObject> | null;
|
package/dist/graph.d.mts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { _ as studioMachineConverter, a as StatelyGraphData, c as StatelyInvoke, d as StudioAction, f as StudioEdge, g as fromStudioMachine, h as StudioNode, i as StatelyGraph, l as StatelyNodeData, m as StudioMachine, n as StatelyActorImplementation, o as StatelyGuard, p as StudioEventTypeData, r as StatelyEdgeData, s as StatelyImplementation, t as StatelyAction, u as StatelyTagImplementation, v as toStudioMachine } from "./graph-
|
|
1
|
+
import { _ as studioMachineConverter, a as StatelyGraphData, c as StatelyInvoke, d as StudioAction, f as StudioEdge, g as fromStudioMachine, h as StudioNode, i as StatelyGraph, l as StatelyNodeData, m as StudioMachine, n as StatelyActorImplementation, o as StatelyGuard, p as StudioEventTypeData, r as StatelyEdgeData, s as StatelyImplementation, t as StatelyAction, u as StatelyTagImplementation, v as toStudioMachine } from "./graph-BwHnhzpC.mjs";
|
|
2
2
|
export { StatelyAction, StatelyActorImplementation, StatelyEdgeData, StatelyGraph, StatelyGraphData, StatelyGuard, StatelyImplementation, StatelyInvoke, StatelyNodeData, StatelyTagImplementation, StudioAction, StudioEdge, StudioEventTypeData, StudioMachine, StudioNode, fromStudioMachine, studioMachineConverter, toStudioMachine };
|
package/dist/graph.mjs
CHANGED
|
@@ -15,6 +15,9 @@ function toJsonObject(value) {
|
|
|
15
15
|
function toUnknownRecord(value) {
|
|
16
16
|
return value;
|
|
17
17
|
}
|
|
18
|
+
function hasContextValue(value) {
|
|
19
|
+
return !!value && (typeof value === "string" || Object.keys(value).length > 0);
|
|
20
|
+
}
|
|
18
21
|
function normalizeStudioNodeType(type) {
|
|
19
22
|
return type === "annotation" ? void 0 : type;
|
|
20
23
|
}
|
|
@@ -204,19 +207,28 @@ function toStudioNode(graph, nodeId, pathIds, parentPath) {
|
|
|
204
207
|
...normalizeStudioNodeType(node.data.type) ? { type: normalizeStudioNodeType(node.data.type) } : {},
|
|
205
208
|
...normalizeStudioHistory(node.data.history) ? { history: normalizeStudioHistory(node.data.history) } : {},
|
|
206
209
|
...initialKey ? { initial: initialKey } : {},
|
|
210
|
+
...node.data.initialInput ? { initialInput: node.data.initialInput } : {},
|
|
211
|
+
...node.data.timeout !== void 0 ? { timeout: node.data.timeout } : {},
|
|
212
|
+
...node.data.route ? { route: node.data.route } : {},
|
|
213
|
+
...node.data.output ? { output: node.data.output } : {},
|
|
207
214
|
entry: (node.data.entry ?? []).map(toStudioAction),
|
|
208
215
|
exit: (node.data.exit ?? []).map(toStudioAction),
|
|
209
216
|
invoke: (node.data.invokes ?? []).map((invoke) => ({
|
|
210
217
|
src: invoke.src,
|
|
211
218
|
id: invoke.id,
|
|
219
|
+
...invoke.srcExpression ? { srcExpression: invoke.srcExpression } : {},
|
|
220
|
+
...invoke.registryKey ? { registryKey: invoke.registryKey } : {},
|
|
221
|
+
...invoke.timeout !== void 0 ? { timeout: invoke.timeout } : {},
|
|
212
222
|
input: toJsonObject(invoke.input),
|
|
223
|
+
...invoke.output ? { output: invoke.output } : {},
|
|
213
224
|
settings: {},
|
|
214
225
|
kind: invoke.src.startsWith("inline:") ? "inline" : "named"
|
|
215
226
|
})),
|
|
216
227
|
tags: node.data.tags ?? [],
|
|
217
228
|
...node.data.description ? { description: node.data.description } : {},
|
|
218
229
|
...node.data.color ? { color: toCanvasColor(node.data.color) } : {},
|
|
219
|
-
...node.data.meta ? { metaEntries: Object.entries(node.data.meta) } : {}
|
|
230
|
+
...node.data.meta ? { metaEntries: Object.entries(node.data.meta) } : {},
|
|
231
|
+
...node.data.schemas ? { schemas: node.data.schemas } : {}
|
|
220
232
|
},
|
|
221
233
|
nodes: childNodes
|
|
222
234
|
};
|
|
@@ -244,17 +256,26 @@ function flattenStudioNodes(studioNode, parentId, nodes, pathIdToNodeId, actionI
|
|
|
244
256
|
...normalizeStudioNodeType(studioNode.data.type) ? { type: normalizeStudioNodeType(studioNode.data.type) } : {},
|
|
245
257
|
...studioNode.data.history ? { history: studioNode.data.history } : {},
|
|
246
258
|
...initialId ? { initialId } : {},
|
|
259
|
+
...studioNode.data.initialInput ? { initialInput: studioNode.data.initialInput } : {},
|
|
260
|
+
...studioNode.data.timeout !== void 0 ? { timeout: studioNode.data.timeout } : {},
|
|
261
|
+
...studioNode.data.route ? { route: studioNode.data.route } : {},
|
|
262
|
+
...studioNode.data.output ? { output: studioNode.data.output } : {},
|
|
247
263
|
entry: studioNode.data.entry.map((action) => fromStudioAction(action, actionImplementations)),
|
|
248
264
|
exit: studioNode.data.exit.map((action) => fromStudioAction(action, actionImplementations)),
|
|
249
265
|
invokes: studioNode.data.invoke.map((invoke) => ({
|
|
250
266
|
src: invoke.src,
|
|
251
267
|
id: invoke.id,
|
|
252
|
-
|
|
268
|
+
...invoke.srcExpression ? { srcExpression: invoke.srcExpression } : {},
|
|
269
|
+
...invoke.registryKey ? { registryKey: invoke.registryKey } : {},
|
|
270
|
+
...invoke.timeout !== void 0 ? { timeout: invoke.timeout } : {},
|
|
271
|
+
input: toUnknownRecord(invoke.input),
|
|
272
|
+
...invoke.output ? { output: invoke.output } : {}
|
|
253
273
|
})),
|
|
254
274
|
tags: studioNode.data.tags,
|
|
255
275
|
...studioNode.data.description ? { description: studioNode.data.description } : {},
|
|
256
276
|
...studioNode.data.color ? { color: studioNode.data.color } : {},
|
|
257
|
-
...studioNode.data.metaEntries ? { meta: Object.fromEntries(studioNode.data.metaEntries) } : {}
|
|
277
|
+
...studioNode.data.metaEntries ? { meta: Object.fromEntries(studioNode.data.metaEntries) } : {},
|
|
278
|
+
...studioNode.data.schemas ? { schemas: studioNode.data.schemas } : {}
|
|
258
279
|
}
|
|
259
280
|
});
|
|
260
281
|
studioNode.nodes.forEach((child) => flattenStudioNodes(child, nodeId, nodes, pathIdToNodeId, actionImplementations));
|
|
@@ -288,6 +309,9 @@ function toStudioMachine(graph) {
|
|
|
288
309
|
eventTypeData: toStudioEventTypeData(eventType),
|
|
289
310
|
...edge.data.matches ? { matches: edge.data.matches } : {},
|
|
290
311
|
actions: (edge.data.actions ?? []).map(toStudioAction),
|
|
312
|
+
...edge.data.context ? { context: edge.data.context } : {},
|
|
313
|
+
...edge.data.input ? { input: edge.data.input } : {},
|
|
314
|
+
...edge.data.route ? { route: true } : {},
|
|
291
315
|
...edge.data.guard ? { guard: {
|
|
292
316
|
kind: edge.data.guard.code ? "inline" : "named",
|
|
293
317
|
type: edge.data.guard.type,
|
|
@@ -304,9 +328,11 @@ function toStudioMachine(graph) {
|
|
|
304
328
|
id: graph.id,
|
|
305
329
|
rootNode: studioRootNode,
|
|
306
330
|
edges: studioEdges,
|
|
307
|
-
context: {},
|
|
331
|
+
context: graph.data?.context ?? {},
|
|
308
332
|
...graph.data?.schemas ? { schemas: normalizeSchemas(graph.data.schemas) } : {},
|
|
309
333
|
...graph.data?.profile ? { profile: graph.data.profile } : {},
|
|
334
|
+
...graph.data?.version ? { version: graph.data.version } : {},
|
|
335
|
+
...graph.data?.options ? { options: graph.data.options } : {},
|
|
310
336
|
...graph.data?.implementations ? { implementations: {
|
|
311
337
|
actions: Object.fromEntries(graph.data.implementations.actions.map((action) => [action.name, toActionSource(action)])),
|
|
312
338
|
guards: Object.fromEntries(graph.data.implementations.guards.map((guard) => [guard.name, toGuardSource(guard)])),
|
|
@@ -342,6 +368,9 @@ function fromStudioMachine(studioMachine) {
|
|
|
342
368
|
...edge.data.guard.kind === "inline" ? { code: stripExportDefault(studioMachine.implementations?.guards?.[edge.data.guard.type]?.code ?? edge.data.guard.type) } : {}
|
|
343
369
|
} } : {},
|
|
344
370
|
actions: edge.data.actions.map((action) => fromStudioAction(action, studioMachine.implementations?.actions)),
|
|
371
|
+
...edge.data.context ? { context: edge.data.context } : {},
|
|
372
|
+
...edge.data.input ? { input: edge.data.input } : {},
|
|
373
|
+
...edge.data.route ? { route: true } : {},
|
|
345
374
|
...edge.data.description ? { description: edge.data.description } : {},
|
|
346
375
|
...edge.data.color ? { color: edge.data.color } : {},
|
|
347
376
|
...edge.data.metaEntries ? { meta: Object.fromEntries(edge.data.metaEntries) } : {}
|
|
@@ -356,6 +385,9 @@ function fromStudioMachine(studioMachine) {
|
|
|
356
385
|
edges: edges.map(({ type: _type, ...edge }) => edge),
|
|
357
386
|
data: {
|
|
358
387
|
...studioMachine.profile ? { profile: studioMachine.profile } : {},
|
|
388
|
+
...studioMachine.version ? { version: studioMachine.version } : {},
|
|
389
|
+
...studioMachine.options ? { options: studioMachine.options } : {},
|
|
390
|
+
...hasContextValue(studioMachine.context) ? { context: studioMachine.context } : {},
|
|
359
391
|
...studioMachine.schemas ? { schemas: studioMachine.schemas } : {},
|
|
360
392
|
...studioMachine.implementations ? { implementations: {
|
|
361
393
|
actions: Object.entries(studioMachine.implementations.actions).filter(([key]) => !key.startsWith("inline:")).map(([, source]) => fromActionSource(source)),
|
|
@@ -2549,7 +2549,7 @@ declare const graphPatchSchema: ZodDiscriminatedUnion<[ZodObject<{
|
|
|
2549
2549
|
type GraphPatch = output<typeof graphPatchSchema>;
|
|
2550
2550
|
/** AI-only schema: semantic ops + shared ops (no generic graph ops) */
|
|
2551
2551
|
//#endregion
|
|
2552
|
-
//#region ../../node_modules/.pnpm/xstate@6.0.0-alpha.
|
|
2552
|
+
//#region ../../node_modules/.pnpm/xstate@6.0.0-alpha.51/node_modules/xstate/dist/declarations/src/index.d.ts
|
|
2553
2553
|
declare global {
|
|
2554
2554
|
interface SymbolConstructor {
|
|
2555
2555
|
readonly observable: symbol;
|
|
@@ -2759,6 +2759,11 @@ interface CodeGenNodeData {
|
|
|
2759
2759
|
route?: Record<string, unknown> | CodeExpression;
|
|
2760
2760
|
history?: 'shallow' | 'deep' | boolean;
|
|
2761
2761
|
output?: Record<string, unknown> | CodeExpression;
|
|
2762
|
+
schemas?: {
|
|
2763
|
+
context?: Record<string, JSONSchema7> | null;
|
|
2764
|
+
input?: JSONSchema7 | null;
|
|
2765
|
+
output?: JSONSchema7 | null;
|
|
2766
|
+
} | null;
|
|
2762
2767
|
entry?: CodeGenAction[];
|
|
2763
2768
|
exit?: CodeGenAction[];
|
|
2764
2769
|
invokes?: CodeGenInvoke[];
|
|
@@ -2813,7 +2818,11 @@ interface CodeGenActorImplementation {
|
|
|
2813
2818
|
}
|
|
2814
2819
|
interface CodeGenGraphData {
|
|
2815
2820
|
profile?: ProfileRefInput;
|
|
2816
|
-
|
|
2821
|
+
version?: string | null;
|
|
2822
|
+
options?: {
|
|
2823
|
+
maxIterations?: number;
|
|
2824
|
+
} | null;
|
|
2825
|
+
context?: Record<string, unknown> | `{{${string}}}` | CodeExpression | null;
|
|
2817
2826
|
schemas?: {
|
|
2818
2827
|
context?: Record<string, JSONSchema7> | null;
|
|
2819
2828
|
events?: Record<string, JSONSchema7> | null;
|
|
@@ -2947,6 +2956,13 @@ interface XStateTSOptions extends MachineConfigOptions {
|
|
|
2947
2956
|
xstateV6SchemaFormat?: 'types' | 'zod';
|
|
2948
2957
|
}
|
|
2949
2958
|
declare function graphToXStateTS(graph: CodeGenGraph, options?: XStateTSOptions): string; //#endregion
|
|
2959
|
+
//#region src/graphToXStateFSM.d.ts
|
|
2960
|
+
interface XStateFSMOptions {
|
|
2961
|
+
exportStyle?: 'named' | 'default' | 'none';
|
|
2962
|
+
xstateV6SchemaFormat?: 'types' | 'zod';
|
|
2963
|
+
}
|
|
2964
|
+
declare function getXStateFSMCompatibilityIssues(graph: CodeGenGraph): string[];
|
|
2965
|
+
declare function graphToXStateFSM(graph: CodeGenGraph, options?: XStateFSMOptions): string; //#endregion
|
|
2950
2966
|
//#region src/emittedNodeIds.d.ts
|
|
2951
2967
|
//#endregion
|
|
2952
2968
|
//#region src/jsonSchemaToTSType.d.ts
|
|
@@ -2963,4 +2979,4 @@ declare function contextSchemaToTSType(context: Record<string, JSONSchema7> | nu
|
|
|
2963
2979
|
declare function eventsSchemaToTSType(events: Record<string, JSONSchema7> | null | undefined): string | null; //#endregion
|
|
2964
2980
|
//#region src/jsonSchemaToZod.d.ts
|
|
2965
2981
|
//#endregion
|
|
2966
|
-
export {
|
|
2982
|
+
export { ZodString as A, ZodEnum as C, ZodObject as D, ZodNumber as E, ZodUnknown as M, output as N, ZodOptional as O, $strip as P, ZodArray as S, ZodNullable as T, ActionLocation as _, RawCode as a, GraphPatch as b, contextSchemaToTSType as c, graphToMachineConfig as d, graphToXStateFSM as f, serializeJS as g, raw as h, ProfileManifest as i, ZodUnion as j, ZodRecord as k, eventsSchemaToTSType as l, jsonSchemaToTSType as m, CodeGenGraph as n, XStateFSMOptions as o, graphToXStateTS as p, MachineConfigOptions as r, XStateTSOptions as s, CodeExpression as t, getXStateFSMCompatibilityIssues as u, CanvasColor as v, ZodLiteral as w, ImplementationSourceType as x, EditorStateType as y };
|
package/dist/index.d.mts
CHANGED
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
import { StatelyApiClientOptions, StatelyApiError, StatelyApiUrlOptions, createStatelyApiClient, createStatelyApiUrl } from "./api.mjs";
|
|
2
|
-
import { _ as
|
|
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-
|
|
2
|
+
import { _ as ActionLocation, a as RawCode, b as GraphPatch, c as contextSchemaToTSType, d as graphToMachineConfig, f as graphToXStateFSM, g as serializeJS, h as raw, l as eventsSchemaToTSType, m as jsonSchemaToTSType, n as CodeGenGraph, o as XStateFSMOptions, p as graphToXStateTS, r as MachineConfigOptions, s as XStateTSOptions, u as getXStateFSMCompatibilityIssues } from "./index-D2I1qPsf.mjs";
|
|
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-BwHnhzpC.mjs";
|
|
4
|
+
import { n as EmbedPanelPosition, t as EmbedPanelConfig } from "./embedPanel-Bpbq4sfJ.mjs";
|
|
4
5
|
import { CapabilityDeniedCapability, CapabilityDeniedEvent, CommentsConfig, EMBED_DOCUMENT_LANGUAGES, EMBED_DOCUMENT_LIMITS, EditorCapabilities, EmbedDocument, EmbedDocumentLanguage, EmbedEventHandler, EmbedEventMap, EmbedEventName, EmbedExample, EmbedMode, ExportCallOptions, ExportFormat, ExportFormatMap, INSPECTION_PROTOCOL_VERSION, INSPECTION_ROOM_QUERY_PARAM, InitOptions, InspectionAction, InspectionSentEvent, InspectionTakenTransition, MachineVersionAutoSaveOptions, ProjectEmbedMachine, ProjectWorkspaceAction, ProjectWorkspaceActionIcon, ProjectWorkspaceCapabilities, ProjectWorkspaceConfig, ProjectWorkspaceMachine, ProjectWorkspaceMachineOrigin, ProjectWorkspaceProject, UploadResult, assertEmbedExamples, createInspectionActorId, createInspectionRoomUrls, getInspectionRoomId, isEmbedExample, isEmbedExampleMachine } from "./protocol.mjs";
|
|
5
6
|
import { AssetUploadAdapter, AssetUploadContext, AssetUploadRequest, CreateS3AssetUploadAdapterOptions, CreateSupabaseAssetUploadAdapterOptions, S3UploadTarget, SupabaseStorageClient, createS3AssetUploadAdapter, createSupabaseAssetUploadAdapter } from "./assetStorage.mjs";
|
|
6
|
-
import { i as getCredentialToken, n as StatelyCredential, r as createAuthorizationHeader, t as StatelyAuthMode } from "./auth-
|
|
7
|
-
import { c as fetchEditorSyncAccess, d as EditorHostExportFormat, f as EditorHostInboundMessage, h as EditorHostValidationIssue, i as EditorSyncBackend, l as EDITOR_PROTOCOL_VERSION, m as EditorHostOutboundMessage, n as EditorHostSessionOptions, o as RemoteEditorSyncBackendOptions, p as EditorHostInitOptions, r as EditorSourceHost, s as createRemoteEditorSyncBackend, t as EditorHostSession, u as EditorHostDiagnostic } from "./editorHostSession-
|
|
7
|
+
import { i as getCredentialToken, n as StatelyCredential, r as createAuthorizationHeader, t as StatelyAuthMode } from "./auth-BPyCCHYo.mjs";
|
|
8
|
+
import { c as fetchEditorSyncAccess, d as EditorHostExportFormat, f as EditorHostInboundMessage, h as EditorHostValidationIssue, i as EditorSyncBackend, l as EDITOR_PROTOCOL_VERSION, m as EditorHostOutboundMessage, n as EditorHostSessionOptions, o as RemoteEditorSyncBackendOptions, p as EditorHostInitOptions, r as EditorSourceHost, s as createRemoteEditorSyncBackend, t as EditorHostSession, u as EditorHostDiagnostic } from "./editorHostSession-CWAuoMtC.mjs";
|
|
8
9
|
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-
|
|
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-
|
|
10
|
+
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-D61HS-t7.mjs";
|
|
11
|
+
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-B9-1Ynrx.mjs";
|
|
11
12
|
import { OAuthAuthorizationServerMetadata, OAuthClientRegistrationResponse, OAuthProtectedResourceMetadata, OAuthTokenResponse, PkcePair, buildAuthorizeUrl, createPkcePair, discoverAuthorizationServer, discoverProtectedResource, exchangeCodeForToken, refreshToken, registerOAuthClient } from "./oauth.mjs";
|
|
12
13
|
import { PlanSyncOptions, PullSyncResult, PushLocalMachineLinksResult, PushSyncOptions, PushSyncProjectOptions, PushSyncResult, ResolvedSyncInput, SyncInputFormat, SyncPlan, SyncPlanSummary } from "./sync.mjs";
|
|
13
14
|
import { CreateInspectionRelayOptions, InspectionRelay, InspectionRelayEffect, InspectionRelayPeer, InspectionRelayRole, InspectionRelaySnapshot, createInspectionRelay } from "./relay.mjs";
|
|
@@ -33,4 +34,4 @@ declare function findStatelyPragmaAttachments(sourceText: string, fileName?: str
|
|
|
33
34
|
declare function getStatelyPragma(sourceText: string, fileName?: string, machineIndex?: number): StatelyPragma | undefined;
|
|
34
35
|
declare function upsertStatelyPragma(sourceText: string, id: string, options?: UpsertStatelyPragmaOptions): string;
|
|
35
36
|
//#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 EditorHostDiagnostic, 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 EmbedExample, 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 MachineVersionAutoSaveOptions, 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 ProjectWorkspaceMachineOrigin, 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, assertEmbedExamples, 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, isEmbedExample, isEmbedExampleMachine, jsonSchemaToTSType, raw, refreshToken, registerOAuthClient, serializeJS, studioMachineConverter, toStudioMachine, upsertStatelyPragma };
|
|
37
|
+
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 EditorHostDiagnostic, 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 EmbedExample, type EmbedFormatContext, type EmbedFormatDefinition, type EmbedGraph, type EmbedMode, type EmbedPanelConfig, type EmbedPanelPosition, 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 MachineVersionAutoSaveOptions, 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 ProjectWorkspaceMachineOrigin, 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 XStateFSMOptions, type XStateTSOptions, type XStateVersion, assertEmbedExamples, 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, getXStateFSMCompatibilityIssues, graphToMachineConfig, graphToXStateFSM, graphToXStateTS, isEmbedExample, isEmbedExampleMachine, jsonSchemaToTSType, raw, refreshToken, registerOAuthClient, serializeJS, studioMachineConverter, toStudioMachine, upsertStatelyPragma };
|
package/dist/index.mjs
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
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-7SUCFMqb.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-
|
|
7
|
-
import { n as StudioApiError, r as createStatelyClient, t as DEFAULT_STATELY_BASE_URL } from "./studio-
|
|
8
|
-
import { a as RawCode,
|
|
6
|
+
import { i as fetchEditorSyncAccess, r as createRemoteEditorSyncBackend, t as EditorHostSession } from "./editorHostSession-shrjfosC.mjs";
|
|
7
|
+
import { n as StudioApiError, r as createStatelyClient, t as DEFAULT_STATELY_BASE_URL } from "./studio-CNkxMZyz.mjs";
|
|
8
|
+
import { a as RawCode, d as getXStateFSMCompatibilityIssues, g as jsonSchemaToTSType, h as graphToXStateTS, m as graphToXStateFSM, n as getStatelyPragma, p as graphToMachineConfig, r as upsertStatelyPragma, s as contextSchemaToTSType, t as findStatelyPragmaAttachments, u as eventsSchemaToTSType, v as raw, y as serializeJS } from "./statelyPragma-DD7wx7-b.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-_E2lVbQA.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";
|
|
14
14
|
import { fromStudioMachine, studioMachineConverter, toStudioMachine } from "./graph.mjs";
|
|
15
15
|
import { createInspectionRelay } from "./relay.mjs";
|
|
16
16
|
|
|
17
|
-
export { DEFAULT_STATELY_BASE_URL, EDITOR_PROTOCOL_VERSION, EMBED_DOCUMENT_LANGUAGES, EMBED_DOCUMENT_LIMITS, EditorHostSession, INSPECTION_PROTOCOL_VERSION, INSPECTION_ROOM_QUERY_PARAM, RawCode, StatelyApiError, StudioApiError, assertEmbedExamples, 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, isEmbedExample, isEmbedExampleMachine, jsonSchemaToTSType, raw, refreshToken, registerOAuthClient, serializeJS, studioMachineConverter, toStudioMachine, upsertStatelyPragma };
|
|
17
|
+
export { DEFAULT_STATELY_BASE_URL, EDITOR_PROTOCOL_VERSION, EMBED_DOCUMENT_LANGUAGES, EMBED_DOCUMENT_LIMITS, EditorHostSession, INSPECTION_PROTOCOL_VERSION, INSPECTION_ROOM_QUERY_PARAM, RawCode, StatelyApiError, StudioApiError, assertEmbedExamples, 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, getXStateFSMCompatibilityIssues, graphToMachineConfig, graphToXStateFSM, graphToXStateTS, isEmbedExample, isEmbedExampleMachine, jsonSchemaToTSType, raw, refreshToken, registerOAuthClient, serializeJS, studioMachineConverter, toStudioMachine, upsertStatelyPragma };
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { t as EmbedPanelConfig } from "./embedPanel-Bpbq4sfJ.mjs";
|
|
1
2
|
import { EditorCapabilities, EmbedEventMap, ExportCallOptions, ExportFormat, ExportFormatMap, InspectionAction, InspectionClientMetadata, InspectionSentEvent, InspectionTakenTransition, ProtocolMessage } from "./protocol.mjs";
|
|
2
3
|
|
|
3
4
|
//#region src/transport.d.ts
|
|
@@ -198,11 +199,7 @@ interface CreateInspectorOptions {
|
|
|
198
199
|
/** @deprecated Use {@link selectedSessionId}. */
|
|
199
200
|
selectedActorId?: string;
|
|
200
201
|
/** Panel layout forwarded into the system init message. */
|
|
201
|
-
panels?:
|
|
202
|
-
leftPanels?: string[];
|
|
203
|
-
rightPanels?: string[];
|
|
204
|
-
activePanels?: string[];
|
|
205
|
-
};
|
|
202
|
+
panels?: EmbedPanelConfig[];
|
|
206
203
|
theme?: 'light' | 'dark';
|
|
207
204
|
readOnly?: boolean;
|
|
208
205
|
depth?: number;
|