@statelyai/sdk 0.29.1 → 0.31.1
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 +15 -0
- package/dist/assetStorage.d.mts +1 -1
- package/dist/auth.d.mts +1 -1
- package/dist/{statelyPragma-p1vu8PmH.mjs → dist-wbhkeGh6.mjs} +468 -204
- package/dist/{editor-sync-types-DB1N6QUK.d.mts → editor-sync-types-CPpzTSnT.d.mts} +4 -0
- package/dist/{editorHostSession-vSt07IJV.d.mts → editorHostSession-Bo-YhDEG.d.mts} +105 -6
- package/dist/{editorHostSession-DNpXPNAc.mjs → editorHostSession-CT8y0yzG.mjs} +380 -20
- package/dist/editorHostSession.d.mts +2 -2
- package/dist/editorHostSession.mjs +3 -2
- package/dist/embed.d.mts +3 -4
- package/dist/embed.mjs +5 -2
- package/dist/{graph-C8E1Exad.d.mts → graph-CR_g-mOq.d.mts} +1 -1
- package/dist/graph.d.mts +1 -1
- package/dist/{index-D4pdeDpT.d.mts → index-DlOZxzrW.d.mts} +92 -2
- package/dist/index.d.mts +8 -9
- package/dist/index.mjs +6 -5
- package/dist/{inspect-D61HS-t7.d.mts → inspect-BoWXrB-V.d.mts} +3 -2
- package/dist/{inspect-dmCvrIl1.mjs → inspect-DoDj7iWa.mjs} +25 -1
- package/dist/inspect.d.mts +2 -2
- package/dist/inspect.mjs +2 -2
- package/dist/patchTypes.d.mts +1 -1
- package/dist/protocol-2cvzJtGN.d.mts +846 -0
- package/dist/protocol.d.mts +2 -821
- package/dist/relay.d.mts +1 -1
- package/dist/statelyPragma-D46lczJR.mjs +102 -0
- package/dist/{studio-D-yqFd0u.d.mts → studio-DV5IIGhV.d.mts} +2 -2
- package/dist/studio.d.mts +1 -1
- package/dist/sync.d.mts +2 -2
- package/dist/sync.mjs +411 -30
- package/dist/{version-DC3yW9Dk.mjs → version-B6OHpDiz.mjs} +1 -1
- package/package.json +3 -3
- package/schemas/statelyai.schema.json +6 -0
- package/dist/embedPanel-Bpbq4sfJ.d.mts +0 -13
- /package/dist/{auth-BPyCCHYo.d.mts → auth-Dg7prjeL.d.mts} +0 -0
|
@@ -2532,6 +2532,10 @@ declare const graphPatchSchema: ZodDiscriminatedUnion<[ZodObject<{
|
|
|
2532
2532
|
op: ZodLiteral<"deleteAnnotation">;
|
|
2533
2533
|
description: ZodOptional<ZodString>;
|
|
2534
2534
|
annotationId: ZodString;
|
|
2535
|
+
}, $strip>, ZodObject<{
|
|
2536
|
+
op: ZodLiteral<"setProfile">;
|
|
2537
|
+
description: ZodOptional<ZodString>;
|
|
2538
|
+
profile: ZodString;
|
|
2535
2539
|
}, $strip>, ZodObject<{
|
|
2536
2540
|
op: ZodLiteral<"setContext">;
|
|
2537
2541
|
description: ZodOptional<ZodString>;
|
|
@@ -2783,6 +2787,8 @@ interface CodeGenNodeData {
|
|
|
2783
2787
|
}
|
|
2784
2788
|
interface CodeGenEdgeData {
|
|
2785
2789
|
eventType: string;
|
|
2790
|
+
/** Additional resolved targets for a parallel multi-target transition. */
|
|
2791
|
+
additionalTargetIds?: string[];
|
|
2786
2792
|
matches?: Record<string, unknown>;
|
|
2787
2793
|
transitionType?: 'normal' | 'targetless' | 'reenter';
|
|
2788
2794
|
guard?: CodeGenGuard | null;
|
|
@@ -2827,12 +2833,20 @@ interface CodeGenGraphData {
|
|
|
2827
2833
|
options?: {
|
|
2828
2834
|
maxIterations?: number;
|
|
2829
2835
|
} | null;
|
|
2836
|
+
internalEvents?: string[] | null;
|
|
2830
2837
|
context?: Record<string, unknown> | `{{${string}}}` | CodeExpression | null;
|
|
2831
2838
|
schemas?: {
|
|
2832
2839
|
context?: Record<string, JSONSchema7> | null;
|
|
2833
2840
|
events?: Record<string, JSONSchema7> | null;
|
|
2841
|
+
internalEvents?: Record<string, JSONSchema7> | null;
|
|
2842
|
+
emitted?: Record<string, JSONSchema7> | null;
|
|
2843
|
+
actions?: Record<string, unknown> | null;
|
|
2844
|
+
guards?: Record<string, unknown> | null;
|
|
2845
|
+
children?: Record<string, JSONSchema7> | null;
|
|
2834
2846
|
input?: JSONSchema7 | null;
|
|
2835
2847
|
output?: JSONSchema7 | null;
|
|
2848
|
+
tags?: JSONSchema7 | null;
|
|
2849
|
+
meta?: JSONSchema7 | null;
|
|
2836
2850
|
} | null;
|
|
2837
2851
|
implementations?: {
|
|
2838
2852
|
actions: CodeGenImplementation[];
|
|
@@ -2897,6 +2911,77 @@ declare function serializeJS(value: unknown, indent?: number, step?: number): st
|
|
|
2897
2911
|
//#region src/profiles/xgraphMetadata.d.ts
|
|
2898
2912
|
//#endregion
|
|
2899
2913
|
//#region src/profiles/types.d.ts
|
|
2914
|
+
/**
|
|
2915
|
+
* The profile boundary only relies on XGraph's stable structural fields. This
|
|
2916
|
+
* keeps profile packages independent from a particular editor's richer graph
|
|
2917
|
+
* types while still allowing them to own semantic projection.
|
|
2918
|
+
*/
|
|
2919
|
+
type ProfileGraph = {
|
|
2920
|
+
data: Record<string, unknown> & {
|
|
2921
|
+
profile?: ProfileSpecifier;
|
|
2922
|
+
schemas?: Record<string, unknown> | null;
|
|
2923
|
+
importMetadata?: (Record<string, unknown> & {
|
|
2924
|
+
warnings?: string[];
|
|
2925
|
+
}) | null;
|
|
2926
|
+
};
|
|
2927
|
+
nodes: Array<{
|
|
2928
|
+
id: string;
|
|
2929
|
+
parentId: string | null;
|
|
2930
|
+
initialNodeId?: string;
|
|
2931
|
+
data: Record<string, unknown> & {
|
|
2932
|
+
key?: string;
|
|
2933
|
+
kind?: string;
|
|
2934
|
+
type?: string | null;
|
|
2935
|
+
initialId?: string | null;
|
|
2936
|
+
meta?: Record<string, unknown> | null;
|
|
2937
|
+
};
|
|
2938
|
+
}>;
|
|
2939
|
+
edges: Array<{
|
|
2940
|
+
id: string;
|
|
2941
|
+
sourceId: string;
|
|
2942
|
+
targetId: string | null;
|
|
2943
|
+
data: Record<string, unknown> & {
|
|
2944
|
+
kind?: string;
|
|
2945
|
+
eventType?: string;
|
|
2946
|
+
transitionType?: string;
|
|
2947
|
+
guard?: {
|
|
2948
|
+
type?: string;
|
|
2949
|
+
} | null;
|
|
2950
|
+
meta?: Record<string, unknown> | null;
|
|
2951
|
+
};
|
|
2952
|
+
}>;
|
|
2953
|
+
[key: string]: unknown;
|
|
2954
|
+
};
|
|
2955
|
+
type ProfileCompatibilityIssue = {
|
|
2956
|
+
level: 'info' | 'warning' | 'error';
|
|
2957
|
+
message: string; /** Canonical data paths that remain stored but must not be authored here. */
|
|
2958
|
+
readOnlyPaths?: string[];
|
|
2959
|
+
nodeIds?: string[];
|
|
2960
|
+
edgeIds?: string[];
|
|
2961
|
+
};
|
|
2962
|
+
/** Additive data written only inside the target profile namespace. */
|
|
2963
|
+
type ProfileDataSet = {
|
|
2964
|
+
graph?: Record<string, unknown>;
|
|
2965
|
+
nodes?: Record<string, Record<string, unknown>>;
|
|
2966
|
+
edges?: Record<string, Record<string, unknown>>;
|
|
2967
|
+
};
|
|
2968
|
+
type ProfileProjectionResult = {
|
|
2969
|
+
data?: ProfileDataSet;
|
|
2970
|
+
warnings?: string[];
|
|
2971
|
+
};
|
|
2972
|
+
type ProfileProjectionContext = {
|
|
2973
|
+
sourceProfile: ResolvedProfileRef;
|
|
2974
|
+
targetProfile: ResolvedProfileRef;
|
|
2975
|
+
};
|
|
2976
|
+
type ProfileProjection = {
|
|
2977
|
+
/** Canonical paths this profile cannot author. `*` matches one path segment. */readOnlyPaths?: readonly string[]; /** Derive additive target-namespaced data without rewriting canonical data. */
|
|
2978
|
+
adapt?: (graph: Readonly<ProfileGraph>, context: ProfileProjectionContext) => ProfileProjectionResult; /** Report retained canonical fields this target cannot safely author. */
|
|
2979
|
+
analyzeCompatibility?: (graph: ProfileGraph) => ProfileCompatibilityIssue[];
|
|
2980
|
+
};
|
|
2981
|
+
type ProfileMigration = {
|
|
2982
|
+
/** Exact earlier profile version in the same lineage. */from: ResolvedProfileRef; /** Adapt source-namespaced data into target-namespaced data. */
|
|
2983
|
+
migrate: (data: Readonly<ProfileDataSet>, context: ProfileProjectionContext) => ProfileProjectionResult;
|
|
2984
|
+
};
|
|
2900
2985
|
type FormatId = string;
|
|
2901
2986
|
type ProfileFormatManifest = {
|
|
2902
2987
|
format: FormatId;
|
|
@@ -2941,7 +3026,11 @@ type ProfileManifest = {
|
|
|
2941
3026
|
name: string;
|
|
2942
3027
|
description?: string; /** Namespace for canonical profile data, for example `@mastra`. */
|
|
2943
3028
|
namespace?: `@${string}`;
|
|
2944
|
-
extends?: ProfileSpecifier;
|
|
3029
|
+
extends?: ProfileSpecifier; /** Stable semantic family. Migrations may only run within this lineage. */
|
|
3030
|
+
lineage?: string;
|
|
3031
|
+
projection?: ProfileProjection;
|
|
3032
|
+
migrations?: readonly ProfileMigration[]; /** Whether the built-in editor profile picker should offer this profile. */
|
|
3033
|
+
selectable?: boolean;
|
|
2945
3034
|
formats: ProfileFormatManifest[];
|
|
2946
3035
|
defaultFormat?: FormatId;
|
|
2947
3036
|
graph?: {
|
|
@@ -2967,7 +3056,8 @@ interface XStateTSOptions extends MachineConfigOptions {
|
|
|
2967
3056
|
xstateVersion?: 5 | 6;
|
|
2968
3057
|
xstateV6SchemaFormat?: 'types' | 'zod';
|
|
2969
3058
|
}
|
|
2970
|
-
declare function graphToXStateTS(graph: CodeGenGraph, options?: XStateTSOptions): string;
|
|
3059
|
+
declare function graphToXStateTS(graph: CodeGenGraph, options?: XStateTSOptions): string;
|
|
3060
|
+
//#endregion
|
|
2971
3061
|
//#region src/graphToXStateV4TS.d.ts
|
|
2972
3062
|
interface XStateV4TSOptions extends MachineConfigOptions {
|
|
2973
3063
|
exportStyle?: 'named' | 'default' | 'none';
|
package/dist/index.d.mts
CHANGED
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
import { StatelyApiClientOptions, StatelyApiError, StatelyApiUrlOptions, createStatelyApiClient, createStatelyApiUrl } from "./api.mjs";
|
|
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-
|
|
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-
|
|
4
|
-
import {
|
|
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";
|
|
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
|
+
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 { B as InspectionSentEvent, Bt as UploadResult, D as ExportCallOptions, F as InitOptions, G as MachineVersionAutoSaveOptions, Gt as assertEmbedExamples, Jt as getInspectionRoomId, Kt as createInspectionActorId, L as InspectionAction, M as INSPECTION_PROTOCOL_VERSION, N as INSPECTION_ROOM_QUERY_PARAM, O as ExportFormat, Qt as EmbedPanelPosition, V as InspectionTakenTransition, Xt as isEmbedExampleMachine, Y as ProjectEmbedMachine, Yt as isEmbedExample, Zt as EmbedPanelConfig, _ 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 createInspectionRoomUrls, 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-2cvzJtGN.mjs";
|
|
6
5
|
import { AssetUploadAdapter, AssetUploadContext, AssetUploadRequest, CreateS3AssetUploadAdapterOptions, CreateSupabaseAssetUploadAdapterOptions, S3UploadTarget, SupabaseStorageClient, createS3AssetUploadAdapter, createSupabaseAssetUploadAdapter } from "./assetStorage.mjs";
|
|
7
|
-
import { i as getCredentialToken, n as StatelyCredential, r as createAuthorizationHeader, t as StatelyAuthMode } from "./auth-
|
|
8
|
-
import {
|
|
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-Bo-YhDEG.mjs";
|
|
9
8
|
import { AssetConfig, EmbedEntity, EmbedFormatContext, EmbedFormatDefinition, EmbedGraph, EmbedProfileDefinition, StatelyEmbed, StatelyEmbedOptions, createStatelyEmbed } from "./embed.mjs";
|
|
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-
|
|
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-
|
|
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-BoWXrB-V.mjs";
|
|
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";
|
|
12
11
|
import { OAuthAuthorizationServerMetadata, OAuthClientRegistrationResponse, OAuthProtectedResourceMetadata, OAuthTokenResponse, PkcePair, buildAuthorizeUrl, createPkcePair, discoverAuthorizationServer, discoverProtectedResource, exchangeCodeForToken, refreshToken, registerOAuthClient } from "./oauth.mjs";
|
|
13
12
|
import { PlanSyncOptions, PullSyncResult, PushLocalMachineLinksResult, PushSyncOptions, PushSyncProjectOptions, PushSyncResult, ResolvedSyncInput, SyncInputFormat, SyncPlan, SyncPlanSummary } from "./sync.mjs";
|
|
14
13
|
import { CreateInspectionRelayOptions, InspectionRelay, InspectionRelayEffect, InspectionRelayPeer, InspectionRelayRole, InspectionRelaySnapshot, createInspectionRelay } from "./relay.mjs";
|
|
@@ -34,4 +33,4 @@ declare function findStatelyPragmaAttachments(sourceText: string, fileName?: str
|
|
|
34
33
|
declare function getStatelyPragma(sourceText: string, fileName?: string, machineIndex?: number): StatelyPragma | undefined;
|
|
35
34
|
declare function upsertStatelyPragma(sourceText: string, id: string, options?: UpsertStatelyPragmaOptions): string;
|
|
36
35
|
//#endregion
|
|
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 XStateV4TSOptions, 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, graphToXStateV4TS, isEmbedExample, isEmbedExampleMachine, jsonSchemaToTSType, raw, refreshToken, registerOAuthClient, serializeJS, studioMachineConverter, toStudioMachine, upsertStatelyPragma };
|
|
36
|
+
export { type ActionLocation, type AdoptedActor, type AssetConfig, type AssetUploadAdapter, type AssetUploadContext, type AssetUploadRequest, type CapabilityDeniedCapability, type CapabilityDeniedEvent, type CodeGenGraph, type CommentsConfig, type ConnectedRepo, type CreateInspectionRelayOptions, type CreateInspectorOptions, type CreateMachineFromDefinitionInput, type CreateMachineFromTemplateInput, type CreateMachineInput, type CreateMachineTemplate, type CreateProjectInput, type CreateS3AssetUploadAdapterOptions, type CreateSupabaseAssetUploadAdapterOptions, DEFAULT_STATELY_BASE_URL, type DigraphAction, type DigraphConfig, type DigraphEdgeConfig, type DigraphNodeConfig, EDITOR_PROTOCOL_VERSION, EMBED_DOCUMENT_LANGUAGES, EMBED_DOCUMENT_LIMITS, type EditorCapabilities, type EditorHostDiagnostic, type EditorHostExportFormat, type EditorHostInboundMessage, type EditorHostInitOptions, type EditorHostOutboundMessage, EditorHostSession, type EditorHostSessionOptions, type EditorHostValidationIssue, type EditorHostWorkspaceMachine, EditorHostWorkspaceSession, type EditorHostWorkspaceSessionOptions, 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 XStateV4TSOptions, 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, graphToXStateV4TS, isEmbedExample, isEmbedExampleMachine, jsonSchemaToTSType, raw, refreshToken, registerOAuthClient, serializeJS, studioMachineConverter, toStudioMachine, upsertStatelyPragma };
|
package/dist/index.mjs
CHANGED
|
@@ -1,17 +1,18 @@
|
|
|
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-B6OHpDiz.mjs";
|
|
4
4
|
import { t as EDITOR_PROTOCOL_VERSION } from "./editorHostProtocol-Bko7wge8.mjs";
|
|
5
5
|
import { createStatelyEmbed } from "./embed.mjs";
|
|
6
|
-
import {
|
|
6
|
+
import { a as fetchEditorSyncAccess, i as createRemoteEditorSyncBackend, n as EditorHostWorkspaceSession, t as EditorHostSession } from "./editorHostSession-CT8y0yzG.mjs";
|
|
7
7
|
import { n as StudioApiError, r as createStatelyClient, t as DEFAULT_STATELY_BASE_URL } from "./studio-rSI54Ese.mjs";
|
|
8
|
-
import { _ as
|
|
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-DoDj7iWa.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
|
+
import { n as getStatelyPragma, r as upsertStatelyPragma, t as findStatelyPragmaAttachments } from "./statelyPragma-D46lczJR.mjs";
|
|
14
15
|
import { fromStudioMachine, studioMachineConverter, toStudioMachine } from "./graph.mjs";
|
|
15
16
|
import { createInspectionRelay } from "./relay.mjs";
|
|
16
17
|
|
|
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, graphToXStateV4TS, isEmbedExample, isEmbedExampleMachine, jsonSchemaToTSType, raw, refreshToken, registerOAuthClient, serializeJS, studioMachineConverter, toStudioMachine, upsertStatelyPragma };
|
|
18
|
+
export { DEFAULT_STATELY_BASE_URL, EDITOR_PROTOCOL_VERSION, EMBED_DOCUMENT_LANGUAGES, EMBED_DOCUMENT_LIMITS, EditorHostSession, EditorHostWorkspaceSession, 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, graphToXStateV4TS, isEmbedExample, isEmbedExampleMachine, jsonSchemaToTSType, raw, refreshToken, registerOAuthClient, serializeJS, studioMachineConverter, toStudioMachine, upsertStatelyPragma };
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { EditorCapabilities, EmbedEventMap, ExportCallOptions, ExportFormat, ExportFormatMap, InspectionAction, InspectionClientMetadata, InspectionSentEvent, InspectionTakenTransition, ProtocolMessage } from "./protocol.mjs";
|
|
1
|
+
import { B as InspectionSentEvent, D as ExportCallOptions, L as InspectionAction, O as ExportFormat, R as InspectionClientMetadata, V as InspectionTakenTransition, Zt as EmbedPanelConfig, dt as ProtocolMessage, k as ExportFormatMap, m as EditorCapabilities, y as EmbedEventMap } from "./protocol-2cvzJtGN.mjs";
|
|
3
2
|
|
|
4
3
|
//#region src/transport.d.ts
|
|
5
4
|
interface TransportFailure {
|
|
@@ -67,6 +66,8 @@ interface AdoptedActor {
|
|
|
67
66
|
sessionId: string;
|
|
68
67
|
/** System-local `actor.id`. */
|
|
69
68
|
actorId: string;
|
|
69
|
+
/** Optional invocation label; the runtime actor ID remains unchanged. */
|
|
70
|
+
displayName?: string;
|
|
70
71
|
/** Parent actor's sessionId, or `null` for the root. */
|
|
71
72
|
parentSessionId: string | null;
|
|
72
73
|
/** Root actor's sessionId. */
|
|
@@ -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-B6OHpDiz.mjs";
|
|
3
3
|
|
|
4
4
|
//#region src/openBrowser.ts
|
|
5
5
|
async function openBrowser(url) {
|
|
@@ -26,6 +26,27 @@ async function openBrowser(url) {
|
|
|
26
26
|
});
|
|
27
27
|
}
|
|
28
28
|
|
|
29
|
+
//#endregion
|
|
30
|
+
//#region src/actorDisplayName.ts
|
|
31
|
+
/** Read resolved invocation metadata instead of parsing runtime-generated IDs.
|
|
32
|
+
* XState v5 and v6 currently expose these declarations on the parent machine.
|
|
33
|
+
* Unrecognized runtimes retain their original actor IDs in the viewer.
|
|
34
|
+
*/
|
|
35
|
+
function deriveActorDisplayName(parentLogic, actorId) {
|
|
36
|
+
const machine = parentLogic;
|
|
37
|
+
if (!(machine?.idMap instanceof Map)) return void 0;
|
|
38
|
+
for (const node of machine.idMap.values()) {
|
|
39
|
+
if (!Array.isArray(node.invoke)) continue;
|
|
40
|
+
const index = node.invoke.findIndex((invoke) => invoke.id === actorId);
|
|
41
|
+
if (index < 0) continue;
|
|
42
|
+
const raw = node.config?.invoke;
|
|
43
|
+
const config = Array.isArray(raw) ? raw[index] : index === 0 ? raw : void 0;
|
|
44
|
+
if (!config || typeof config !== "object" || config.id !== void 0) return void 0;
|
|
45
|
+
if (typeof node.id !== "string" || !node.id) return void 0;
|
|
46
|
+
return `${typeof config.src === "string" && config.src ? config.src : "Invocation"} · ${node.id}${node.invoke.length > 1 ? ` [${index + 1}]` : ""}`;
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
|
|
29
50
|
//#endregion
|
|
30
51
|
//#region src/inspect.ts
|
|
31
52
|
const defaultSerializeSnapshot = (snapshot) => ({
|
|
@@ -267,6 +288,7 @@ function createInspector(options = {}) {
|
|
|
267
288
|
return {
|
|
268
289
|
sessionId,
|
|
269
290
|
actorId: details?.id ?? actorRef.id ?? sessionId,
|
|
291
|
+
displayName: deriveActorDisplayName(parentRef?.logic, details?.id ?? actorRef.id),
|
|
270
292
|
parentSessionId: parentRef ? sessionIdOf(parentRef) : null,
|
|
271
293
|
rootSessionId: rootActorId,
|
|
272
294
|
systemId: actorRef.systemId,
|
|
@@ -279,6 +301,7 @@ function createInspector(options = {}) {
|
|
|
279
301
|
return {
|
|
280
302
|
sessionId: entry.sessionId,
|
|
281
303
|
actorId: entry.actorId,
|
|
304
|
+
...entry.displayName && { displayName: entry.displayName },
|
|
282
305
|
parentSessionId: entry.parentSessionId,
|
|
283
306
|
machine: entry.machineConfig,
|
|
284
307
|
snapshot: entry.snapshot ?? void 0,
|
|
@@ -341,6 +364,7 @@ function createInspector(options = {}) {
|
|
|
341
364
|
type: "@statelyai.system.actorRegistered",
|
|
342
365
|
sessionId: entry.sessionId,
|
|
343
366
|
actorId: entry.actorId,
|
|
367
|
+
...entry.displayName && { displayName: entry.displayName },
|
|
344
368
|
parentSessionId: entry.parentSessionId,
|
|
345
369
|
machine: entry.machineConfig,
|
|
346
370
|
snapshot: entry.snapshot ?? void 0
|
package/dist/inspect.d.mts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import {
|
|
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-2cvzJtGN.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-BoWXrB-V.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-B6OHpDiz.mjs";
|
|
2
|
+
import { n as createStatelyInspector, t as createInspector } from "./inspect-DoDj7iWa.mjs";
|
|
3
3
|
|
|
4
4
|
export { createInspector, createStatelyInspector };
|
package/dist/patchTypes.d.mts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { C as ImplementationSourceType, S as GraphPatch, b as CanvasColor, x as EditorStateType, y as ActionLocation } from "./index-
|
|
1
|
+
import { C as ImplementationSourceType, S as GraphPatch, b as CanvasColor, x as EditorStateType, y as ActionLocation } from "./index-DlOZxzrW.mjs";
|
|
2
2
|
export { type ActionLocation, type CanvasColor, type EditorStateType, type GraphPatch, type ImplementationSourceType };
|