@statelyai/sdk 0.9.0 → 0.10.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -21,6 +21,6 @@ The broader in-progress package documentation draft is kept in:
21
21
  Published schemas:
22
22
 
23
23
  - `@statelyai/sdk/statelyai.schema.json`
24
- - `@statelyai/sdk/xstate-json.schema.json`
24
+ - `@statelyai/sdk/xstate.schema.json`
25
25
 
26
- The CLI-facing `statelyai.json` schema now uses top-level `include` / `exclude` globs for local file discovery.
26
+ The CLI-facing `statelyai.json` schema now uses top-level `include` / `exclude` globs for local file discovery, plus `newMachineDir` for pulling remote-only project machines into new local files.
@@ -1,6 +1,256 @@
1
1
  import * as _statelyai_graph0 from "@statelyai/graph";
2
2
  import { Graph } from "@statelyai/graph";
3
3
 
4
+ //#region ../../node_modules/.pnpm/@types+json-schema@7.0.15/node_modules/@types/json-schema/index.d.ts
5
+ // ==================================================================================================
6
+ // JSON Schema Draft 07
7
+ // ==================================================================================================
8
+ // https://tools.ietf.org/html/draft-handrews-json-schema-validation-01
9
+ // --------------------------------------------------------------------------------------------------
10
+ /**
11
+ * Primitive type
12
+ * @see https://tools.ietf.org/html/draft-handrews-json-schema-validation-01#section-6.1.1
13
+ */
14
+ type JSONSchema7TypeName = "string" //
15
+ | "number" | "integer" | "boolean" | "object" | "array" | "null";
16
+ /**
17
+ * Primitive type
18
+ * @see https://tools.ietf.org/html/draft-handrews-json-schema-validation-01#section-6.1.1
19
+ */
20
+ type JSONSchema7Type = string //
21
+ | number | boolean | JSONSchema7Object | JSONSchema7Array | null;
22
+ // Workaround for infinite type recursion
23
+ interface JSONSchema7Object {
24
+ [key: string]: JSONSchema7Type;
25
+ }
26
+ // Workaround for infinite type recursion
27
+ // https://github.com/Microsoft/TypeScript/issues/3496#issuecomment-128553540
28
+ interface JSONSchema7Array extends Array<JSONSchema7Type> {}
29
+ /**
30
+ * Meta schema
31
+ *
32
+ * Recommended values:
33
+ * - 'http://json-schema.org/schema#'
34
+ * - 'http://json-schema.org/hyper-schema#'
35
+ * - 'http://json-schema.org/draft-07/schema#'
36
+ * - 'http://json-schema.org/draft-07/hyper-schema#'
37
+ *
38
+ * @see https://tools.ietf.org/html/draft-handrews-json-schema-validation-01#section-5
39
+ */
40
+ type JSONSchema7Version = string;
41
+ /**
42
+ * JSON Schema v7
43
+ * @see https://tools.ietf.org/html/draft-handrews-json-schema-validation-01
44
+ */
45
+ type JSONSchema7Definition = JSONSchema7 | boolean;
46
+ interface JSONSchema7 {
47
+ $id?: string | undefined;
48
+ $ref?: string | undefined;
49
+ $schema?: JSONSchema7Version | undefined;
50
+ $comment?: string | undefined;
51
+ /**
52
+ * @see https://datatracker.ietf.org/doc/html/draft-bhutton-json-schema-00#section-8.2.4
53
+ * @see https://datatracker.ietf.org/doc/html/draft-bhutton-json-schema-validation-00#appendix-A
54
+ */
55
+ $defs?: {
56
+ [key: string]: JSONSchema7Definition;
57
+ } | undefined;
58
+ /**
59
+ * @see https://tools.ietf.org/html/draft-handrews-json-schema-validation-01#section-6.1
60
+ */
61
+ type?: JSONSchema7TypeName | JSONSchema7TypeName[] | undefined;
62
+ enum?: JSONSchema7Type[] | undefined;
63
+ const?: JSONSchema7Type | undefined;
64
+ /**
65
+ * @see https://tools.ietf.org/html/draft-handrews-json-schema-validation-01#section-6.2
66
+ */
67
+ multipleOf?: number | undefined;
68
+ maximum?: number | undefined;
69
+ exclusiveMaximum?: number | undefined;
70
+ minimum?: number | undefined;
71
+ exclusiveMinimum?: number | undefined;
72
+ /**
73
+ * @see https://tools.ietf.org/html/draft-handrews-json-schema-validation-01#section-6.3
74
+ */
75
+ maxLength?: number | undefined;
76
+ minLength?: number | undefined;
77
+ pattern?: string | undefined;
78
+ /**
79
+ * @see https://tools.ietf.org/html/draft-handrews-json-schema-validation-01#section-6.4
80
+ */
81
+ items?: JSONSchema7Definition | JSONSchema7Definition[] | undefined;
82
+ additionalItems?: JSONSchema7Definition | undefined;
83
+ maxItems?: number | undefined;
84
+ minItems?: number | undefined;
85
+ uniqueItems?: boolean | undefined;
86
+ contains?: JSONSchema7Definition | undefined;
87
+ /**
88
+ * @see https://tools.ietf.org/html/draft-handrews-json-schema-validation-01#section-6.5
89
+ */
90
+ maxProperties?: number | undefined;
91
+ minProperties?: number | undefined;
92
+ required?: string[] | undefined;
93
+ properties?: {
94
+ [key: string]: JSONSchema7Definition;
95
+ } | undefined;
96
+ patternProperties?: {
97
+ [key: string]: JSONSchema7Definition;
98
+ } | undefined;
99
+ additionalProperties?: JSONSchema7Definition | undefined;
100
+ dependencies?: {
101
+ [key: string]: JSONSchema7Definition | string[];
102
+ } | undefined;
103
+ propertyNames?: JSONSchema7Definition | undefined;
104
+ /**
105
+ * @see https://tools.ietf.org/html/draft-handrews-json-schema-validation-01#section-6.6
106
+ */
107
+ if?: JSONSchema7Definition | undefined;
108
+ then?: JSONSchema7Definition | undefined;
109
+ else?: JSONSchema7Definition | undefined;
110
+ /**
111
+ * @see https://tools.ietf.org/html/draft-handrews-json-schema-validation-01#section-6.7
112
+ */
113
+ allOf?: JSONSchema7Definition[] | undefined;
114
+ anyOf?: JSONSchema7Definition[] | undefined;
115
+ oneOf?: JSONSchema7Definition[] | undefined;
116
+ not?: JSONSchema7Definition | undefined;
117
+ /**
118
+ * @see https://tools.ietf.org/html/draft-handrews-json-schema-validation-01#section-7
119
+ */
120
+ format?: string | undefined;
121
+ /**
122
+ * @see https://tools.ietf.org/html/draft-handrews-json-schema-validation-01#section-8
123
+ */
124
+ contentMediaType?: string | undefined;
125
+ contentEncoding?: string | undefined;
126
+ /**
127
+ * @see https://tools.ietf.org/html/draft-handrews-json-schema-validation-01#section-9
128
+ */
129
+ definitions?: {
130
+ [key: string]: JSONSchema7Definition;
131
+ } | undefined;
132
+ /**
133
+ * @see https://tools.ietf.org/html/draft-handrews-json-schema-validation-01#section-10
134
+ */
135
+ title?: string | undefined;
136
+ description?: string | undefined;
137
+ default?: JSONSchema7Type | undefined;
138
+ readOnly?: boolean | undefined;
139
+ writeOnly?: boolean | undefined;
140
+ examples?: JSONSchema7Type | undefined;
141
+ }
142
+ //#endregion
143
+ //#region ../graph-tools/src/codegenTypes.d.ts
144
+ interface CodeGenAction {
145
+ type: string;
146
+ params?: Record<string, unknown>;
147
+ }
148
+ interface CodeGenGuard {
149
+ type: string;
150
+ code?: string;
151
+ params?: Record<string, unknown>;
152
+ }
153
+ /**
154
+ * Serialized inline expression directive.
155
+ *
156
+ * Code generation treats this object as JavaScript/TypeScript source, not as a
157
+ * machine config object. It is used for fields such as invoke `input` and
158
+ * `output` where XState accepts mapper expressions.
159
+ */
160
+ interface CodeExpression {
161
+ '@type': 'code';
162
+ lang: 'js' | 'ts';
163
+ expr: string;
164
+ }
165
+ interface CodeGenInvoke {
166
+ src: string;
167
+ id: string;
168
+ input?: Record<string, unknown> | CodeExpression;
169
+ output?: Record<string, unknown> | CodeExpression;
170
+ }
171
+ interface CodeGenNodeData {
172
+ nodeId?: string | null;
173
+ key: string;
174
+ type?: 'normal' | 'parallel' | 'final' | 'history' | null;
175
+ initialId?: string | null;
176
+ history?: 'shallow' | 'deep' | boolean;
177
+ entry?: CodeGenAction[];
178
+ exit?: CodeGenAction[];
179
+ invokes?: CodeGenInvoke[];
180
+ tags?: Array<string | {
181
+ name: string;
182
+ }>;
183
+ description?: string | null;
184
+ meta?: Record<string, unknown> | null;
185
+ color?: string;
186
+ parentId?: string | null;
187
+ temp?: boolean;
188
+ }
189
+ interface CodeGenEdgeData {
190
+ eventType: string;
191
+ transitionType?: 'normal' | 'targetless' | 'reenter';
192
+ guard?: CodeGenGuard | null;
193
+ actions?: CodeGenAction[];
194
+ description?: string | null;
195
+ color?: string;
196
+ meta?: Record<string, unknown> | null;
197
+ temp?: boolean;
198
+ }
199
+ interface CodeGenImplementation {
200
+ id: string;
201
+ name: string;
202
+ description?: string | null;
203
+ icon?: string;
204
+ paramsSchema?: JSONSchema7 | null;
205
+ code?: {
206
+ body: string;
207
+ lang?: string;
208
+ } | null;
209
+ }
210
+ interface CodeGenActorImplementation {
211
+ id: string;
212
+ name: string;
213
+ description?: string | null;
214
+ icon?: string;
215
+ inputSchema?: JSONSchema7 | null;
216
+ outputSchema?: JSONSchema7 | null;
217
+ code?: {
218
+ body: string;
219
+ lang?: string;
220
+ } | null;
221
+ }
222
+ interface CodeGenGraphData {
223
+ schemas?: {
224
+ context?: Record<string, JSONSchema7> | null;
225
+ events?: Record<string, JSONSchema7> | null;
226
+ input?: JSONSchema7 | null;
227
+ output?: JSONSchema7 | null;
228
+ } | null;
229
+ implementations?: {
230
+ actions: CodeGenImplementation[];
231
+ guards: CodeGenImplementation[];
232
+ actors: CodeGenActorImplementation[];
233
+ delays: CodeGenImplementation[];
234
+ } | null;
235
+ }
236
+ interface CodeGenNode {
237
+ id: string;
238
+ parentId?: string | null;
239
+ data: CodeGenNodeData;
240
+ }
241
+ interface CodeGenEdge {
242
+ id: string;
243
+ sourceId: string;
244
+ targetId: string;
245
+ data: CodeGenEdgeData;
246
+ }
247
+ interface CodeGenGraph {
248
+ id: string;
249
+ nodes: CodeGenNode[];
250
+ edges: CodeGenEdge[];
251
+ data: CodeGenGraphData;
252
+ }
253
+ //#endregion
4
254
  //#region src/digraphTypes.d.ts
5
255
  type CanvasColor = undefined | 'green' | 'red' | 'purple' | 'blue' | 'orange' | 'yellow' | 'pink' | 'teal';
6
256
  type ExtractorGuard = {
@@ -306,7 +556,7 @@ interface StatelyGuard {
306
556
  interface StatelyInvoke {
307
557
  src: string;
308
558
  id: string;
309
- input?: Record<string, unknown>;
559
+ input?: Record<string, unknown> | CodeExpression;
310
560
  }
311
561
  interface StatelyNodeData {
312
562
  key: string;
@@ -390,4 +640,4 @@ declare function toStudioMachine(graph: StatelyGraph): StudioMachine;
390
640
  declare function fromStudioMachine(studioMachine: StudioMachine): StatelyGraph;
391
641
  declare const studioMachineConverter: _statelyai_graph0.GraphFormatConverter<DigraphConfig, StatelyNodeData, StatelyEdgeData, StatelyGraphData>;
392
642
  //#endregion
393
- export { EventTypeData as C, DigraphNodeConfig as S, studioMachineConverter as _, StatelyGraphData as a, DigraphConfig as b, StatelyInvoke as c, StudioAction as d, StudioEdge as f, fromStudioMachine as g, StudioNode as h, StatelyGraph as i, StatelyNodeData as l, StudioMachine as m, StatelyActorImplementation as n, StatelyGuard as o, StudioEventTypeData as p, StatelyEdgeData as r, StatelyImplementation as s, StatelyAction as t, StatelyTagImplementation as u, toStudioMachine as v, StateNodeJSONData as w, DigraphEdgeConfig as x, DigraphAction as y };
643
+ export { EventTypeData as C, JSONSchema7 as E, DigraphNodeConfig as S, CodeGenGraph as T, studioMachineConverter as _, StatelyGraphData as a, DigraphConfig as b, StatelyInvoke as c, StudioAction as d, StudioEdge as f, fromStudioMachine as g, StudioNode as h, StatelyGraph as i, StatelyNodeData as l, StudioMachine as m, StatelyActorImplementation as n, StatelyGuard as o, StudioEventTypeData as p, StatelyEdgeData as r, StatelyImplementation as s, StatelyAction as t, StatelyTagImplementation as u, toStudioMachine as v, StateNodeJSONData as w, DigraphEdgeConfig as x, DigraphAction as y };
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-CJ3N2r43.mjs";
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-DmXh22Zu.mjs";
2
2
  export { StatelyAction, StatelyActorImplementation, StatelyEdgeData, StatelyGraph, StatelyGraphData, StatelyGuard, StatelyImplementation, StatelyInvoke, StatelyNodeData, StatelyTagImplementation, StudioAction, StudioEdge, StudioEventTypeData, StudioMachine, StudioNode, fromStudioMachine, studioMachineConverter, toStudioMachine };
package/dist/index.d.mts CHANGED
@@ -2,7 +2,7 @@ import { StatelyApiClientOptions, StatelyApiError, StatelyApiUrlOptions, createS
2
2
  import { CommentsConfig, EmbedEventHandler, EmbedEventMap, EmbedEventName, EmbedMode, ExportCallOptions, ExportFormat, ExportFormatMap, InitOptions, ProjectEmbedMachine, UploadResult } from "./protocol.mjs";
3
3
  import { AssetUploadAdapter, AssetUploadContext, AssetUploadRequest, CreateS3AssetUploadAdapterOptions, CreateSupabaseAssetUploadAdapterOptions, S3UploadTarget, SupabaseStorageClient, createS3AssetUploadAdapter, createSupabaseAssetUploadAdapter } from "./assetStorage.mjs";
4
4
  import { AssetConfig, StatelyEmbed, StatelyEmbedOptions, createStatelyEmbed } from "./embed.mjs";
5
- 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-CJ3N2r43.mjs";
5
+ import { C as EventTypeData, E as JSONSchema7, S as DigraphNodeConfig, T as CodeGenGraph, _ 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-DmXh22Zu.mjs";
6
6
  import { a as ManualActorOptions, c as createPostMessageTransport, i as InspectorEvents, l as createWebSocketTransport, n as CreateInspectorOptions, o as createStatelyInspector, r as Inspector, s as Transport, t as AdoptedActor } from "./inspect-BLlM3qKf.mjs";
7
7
  import { ConnectedRepo, CreateMachineFromDefinitionInput, CreateMachineFromTemplateInput, CreateMachineInput, CreateMachineTemplate, CreateProjectInput, EnsureProjectInput, ExtractMachinesResponse, ExtractedMachine, GetMachineOptions, ProjectData, ProjectMachine, ProjectVisibility, RepoType, StudioApiError, StudioClient, StudioClientOptions, StudioMachineRecord, UpdateMachineInput, VerifyApiKeyResponse, XStateVersion, createStatelyClient } from "./studio.mjs";
8
8
  import { PlanSyncOptions, PullSyncResult, PushLocalMachineLinksResult, PushSyncOptions, PushSyncProjectOptions, PushSyncResult, ResolvedSyncInput, SyncInputFormat, SyncPlan, SyncPlanSummary } from "./sync.mjs";
@@ -31,256 +31,6 @@ declare function findStatelyPragmaAttachments(sourceText: string, fileName?: str
31
31
  declare function getStatelyPragma(sourceText: string, fileName?: string, machineIndex?: number): StatelyPragma | undefined;
32
32
  declare function upsertStatelyPragma(sourceText: string, id: string, options?: UpsertStatelyPragmaOptions): string;
33
33
  //#endregion
34
- //#region ../../node_modules/.pnpm/@types+json-schema@7.0.15/node_modules/@types/json-schema/index.d.ts
35
- // ==================================================================================================
36
- // JSON Schema Draft 07
37
- // ==================================================================================================
38
- // https://tools.ietf.org/html/draft-handrews-json-schema-validation-01
39
- // --------------------------------------------------------------------------------------------------
40
- /**
41
- * Primitive type
42
- * @see https://tools.ietf.org/html/draft-handrews-json-schema-validation-01#section-6.1.1
43
- */
44
- type JSONSchema7TypeName = "string" //
45
- | "number" | "integer" | "boolean" | "object" | "array" | "null";
46
- /**
47
- * Primitive type
48
- * @see https://tools.ietf.org/html/draft-handrews-json-schema-validation-01#section-6.1.1
49
- */
50
- type JSONSchema7Type = string //
51
- | number | boolean | JSONSchema7Object | JSONSchema7Array | null;
52
- // Workaround for infinite type recursion
53
- interface JSONSchema7Object {
54
- [key: string]: JSONSchema7Type;
55
- }
56
- // Workaround for infinite type recursion
57
- // https://github.com/Microsoft/TypeScript/issues/3496#issuecomment-128553540
58
- interface JSONSchema7Array extends Array<JSONSchema7Type> {}
59
- /**
60
- * Meta schema
61
- *
62
- * Recommended values:
63
- * - 'http://json-schema.org/schema#'
64
- * - 'http://json-schema.org/hyper-schema#'
65
- * - 'http://json-schema.org/draft-07/schema#'
66
- * - 'http://json-schema.org/draft-07/hyper-schema#'
67
- *
68
- * @see https://tools.ietf.org/html/draft-handrews-json-schema-validation-01#section-5
69
- */
70
- type JSONSchema7Version = string;
71
- /**
72
- * JSON Schema v7
73
- * @see https://tools.ietf.org/html/draft-handrews-json-schema-validation-01
74
- */
75
- type JSONSchema7Definition = JSONSchema7 | boolean;
76
- interface JSONSchema7 {
77
- $id?: string | undefined;
78
- $ref?: string | undefined;
79
- $schema?: JSONSchema7Version | undefined;
80
- $comment?: string | undefined;
81
- /**
82
- * @see https://datatracker.ietf.org/doc/html/draft-bhutton-json-schema-00#section-8.2.4
83
- * @see https://datatracker.ietf.org/doc/html/draft-bhutton-json-schema-validation-00#appendix-A
84
- */
85
- $defs?: {
86
- [key: string]: JSONSchema7Definition;
87
- } | undefined;
88
- /**
89
- * @see https://tools.ietf.org/html/draft-handrews-json-schema-validation-01#section-6.1
90
- */
91
- type?: JSONSchema7TypeName | JSONSchema7TypeName[] | undefined;
92
- enum?: JSONSchema7Type[] | undefined;
93
- const?: JSONSchema7Type | undefined;
94
- /**
95
- * @see https://tools.ietf.org/html/draft-handrews-json-schema-validation-01#section-6.2
96
- */
97
- multipleOf?: number | undefined;
98
- maximum?: number | undefined;
99
- exclusiveMaximum?: number | undefined;
100
- minimum?: number | undefined;
101
- exclusiveMinimum?: number | undefined;
102
- /**
103
- * @see https://tools.ietf.org/html/draft-handrews-json-schema-validation-01#section-6.3
104
- */
105
- maxLength?: number | undefined;
106
- minLength?: number | undefined;
107
- pattern?: string | undefined;
108
- /**
109
- * @see https://tools.ietf.org/html/draft-handrews-json-schema-validation-01#section-6.4
110
- */
111
- items?: JSONSchema7Definition | JSONSchema7Definition[] | undefined;
112
- additionalItems?: JSONSchema7Definition | undefined;
113
- maxItems?: number | undefined;
114
- minItems?: number | undefined;
115
- uniqueItems?: boolean | undefined;
116
- contains?: JSONSchema7Definition | undefined;
117
- /**
118
- * @see https://tools.ietf.org/html/draft-handrews-json-schema-validation-01#section-6.5
119
- */
120
- maxProperties?: number | undefined;
121
- minProperties?: number | undefined;
122
- required?: string[] | undefined;
123
- properties?: {
124
- [key: string]: JSONSchema7Definition;
125
- } | undefined;
126
- patternProperties?: {
127
- [key: string]: JSONSchema7Definition;
128
- } | undefined;
129
- additionalProperties?: JSONSchema7Definition | undefined;
130
- dependencies?: {
131
- [key: string]: JSONSchema7Definition | string[];
132
- } | undefined;
133
- propertyNames?: JSONSchema7Definition | undefined;
134
- /**
135
- * @see https://tools.ietf.org/html/draft-handrews-json-schema-validation-01#section-6.6
136
- */
137
- if?: JSONSchema7Definition | undefined;
138
- then?: JSONSchema7Definition | undefined;
139
- else?: JSONSchema7Definition | undefined;
140
- /**
141
- * @see https://tools.ietf.org/html/draft-handrews-json-schema-validation-01#section-6.7
142
- */
143
- allOf?: JSONSchema7Definition[] | undefined;
144
- anyOf?: JSONSchema7Definition[] | undefined;
145
- oneOf?: JSONSchema7Definition[] | undefined;
146
- not?: JSONSchema7Definition | undefined;
147
- /**
148
- * @see https://tools.ietf.org/html/draft-handrews-json-schema-validation-01#section-7
149
- */
150
- format?: string | undefined;
151
- /**
152
- * @see https://tools.ietf.org/html/draft-handrews-json-schema-validation-01#section-8
153
- */
154
- contentMediaType?: string | undefined;
155
- contentEncoding?: string | undefined;
156
- /**
157
- * @see https://tools.ietf.org/html/draft-handrews-json-schema-validation-01#section-9
158
- */
159
- definitions?: {
160
- [key: string]: JSONSchema7Definition;
161
- } | undefined;
162
- /**
163
- * @see https://tools.ietf.org/html/draft-handrews-json-schema-validation-01#section-10
164
- */
165
- title?: string | undefined;
166
- description?: string | undefined;
167
- default?: JSONSchema7Type | undefined;
168
- readOnly?: boolean | undefined;
169
- writeOnly?: boolean | undefined;
170
- examples?: JSONSchema7Type | undefined;
171
- }
172
- //#endregion
173
- //#region ../graph-tools/src/codegenTypes.d.ts
174
- interface CodeGenAction {
175
- type: string;
176
- params?: Record<string, unknown>;
177
- }
178
- interface CodeGenGuard {
179
- type: string;
180
- code?: string;
181
- params?: Record<string, unknown>;
182
- }
183
- /**
184
- * Serialized inline expression directive.
185
- *
186
- * Code generation treats this object as JavaScript/TypeScript source, not as a
187
- * machine config object. It is used for fields such as invoke `input` and
188
- * `output` where XState accepts mapper expressions.
189
- */
190
- interface CodeExpression {
191
- '@type': 'code';
192
- lang: 'js' | 'ts';
193
- expr: string;
194
- }
195
- interface CodeGenInvoke {
196
- src: string;
197
- id: string;
198
- input?: Record<string, unknown> | CodeExpression;
199
- output?: Record<string, unknown> | CodeExpression;
200
- }
201
- interface CodeGenNodeData {
202
- nodeId?: string | null;
203
- key: string;
204
- type?: 'normal' | 'parallel' | 'final' | 'history' | null;
205
- initialId?: string | null;
206
- history?: 'shallow' | 'deep' | boolean;
207
- entry?: CodeGenAction[];
208
- exit?: CodeGenAction[];
209
- invokes?: CodeGenInvoke[];
210
- tags?: Array<string | {
211
- name: string;
212
- }>;
213
- description?: string | null;
214
- meta?: Record<string, unknown> | null;
215
- color?: string;
216
- parentId?: string | null;
217
- temp?: boolean;
218
- }
219
- interface CodeGenEdgeData {
220
- eventType: string;
221
- transitionType?: 'normal' | 'targetless' | 'reenter';
222
- guard?: CodeGenGuard | null;
223
- actions?: CodeGenAction[];
224
- description?: string | null;
225
- color?: string;
226
- meta?: Record<string, unknown> | null;
227
- temp?: boolean;
228
- }
229
- interface CodeGenImplementation {
230
- id: string;
231
- name: string;
232
- description?: string | null;
233
- icon?: string;
234
- paramsSchema?: JSONSchema7 | null;
235
- code?: {
236
- body: string;
237
- lang?: string;
238
- } | null;
239
- }
240
- interface CodeGenActorImplementation {
241
- id: string;
242
- name: string;
243
- description?: string | null;
244
- icon?: string;
245
- inputSchema?: JSONSchema7 | null;
246
- outputSchema?: JSONSchema7 | null;
247
- code?: {
248
- body: string;
249
- lang?: string;
250
- } | null;
251
- }
252
- interface CodeGenGraphData {
253
- schemas?: {
254
- context?: Record<string, JSONSchema7> | null;
255
- events?: Record<string, JSONSchema7> | null;
256
- input?: JSONSchema7 | null;
257
- output?: JSONSchema7 | null;
258
- } | null;
259
- implementations?: {
260
- actions: CodeGenImplementation[];
261
- guards: CodeGenImplementation[];
262
- actors: CodeGenActorImplementation[];
263
- delays: CodeGenImplementation[];
264
- } | null;
265
- }
266
- interface CodeGenNode {
267
- id: string;
268
- parentId?: string | null;
269
- data: CodeGenNodeData;
270
- }
271
- interface CodeGenEdge {
272
- id: string;
273
- sourceId: string;
274
- targetId: string;
275
- data: CodeGenEdgeData;
276
- }
277
- interface CodeGenGraph {
278
- id: string;
279
- nodes: CodeGenNode[];
280
- edges: CodeGenEdge[];
281
- data: CodeGenGraphData;
282
- }
283
- //#endregion
284
34
  //#region ../graph-tools/src/graphToMachineConfig.d.ts
285
35
  interface MachineConfigOptions {
286
36
  showDescriptions?: boolean;
@@ -1,5 +1,5 @@
1
1
  //#region src/protocol.d.ts
2
- type EmbedMode = 'editing' | 'viewing' | 'simulating' | 'inspecting';
2
+ type EmbedMode = "editing" | "viewing" | "simulating" | "inspecting";
3
3
  interface CommentsConfig {
4
4
  roomId: string;
5
5
  userId?: string | null;
@@ -15,7 +15,7 @@ interface ProjectEmbedMachine {
15
15
  interface ValidationIssue {
16
16
  nodeIds: string[];
17
17
  edgeIds: string[];
18
- level: 'info' | 'warning' | 'error';
18
+ level: "info" | "warning" | "error";
19
19
  message: string;
20
20
  }
21
21
  interface SourceRange {
@@ -30,12 +30,12 @@ interface SourceLocation {
30
30
  }
31
31
  interface StateSourceLocation extends SourceLocation {
32
32
  path: string[];
33
- kind: 'inline' | 'objectReference' | 'createStateConfig';
33
+ kind: "inline" | "objectReference" | "createStateConfig";
34
34
  symbol?: string;
35
35
  keyRange?: SourceRange;
36
36
  referenceRange?: SourceRange;
37
37
  keySource?: {
38
- kind: 'const' | 'enumMember' | 'computedLiteral';
38
+ kind: "const" | "enumMember" | "computedLiteral";
39
39
  symbol?: string;
40
40
  valueRange?: SourceRange;
41
41
  machineLocal?: boolean;
@@ -60,7 +60,11 @@ interface ExportFormatMap {
60
60
  };
61
61
  result: string;
62
62
  };
63
- 'xstate-json': {
63
+ async: {
64
+ options: object;
65
+ result: string;
66
+ };
67
+ "xstate-json": {
64
68
  options: {
65
69
  version?: 4 | 5;
66
70
  };
@@ -86,11 +90,11 @@ interface ExportFormatMap {
86
90
  options: object;
87
91
  result: string;
88
92
  };
89
- 'asl-json': {
93
+ "asl-json": {
90
94
  options: object;
91
95
  result: string;
92
96
  };
93
- 'asl-yaml': {
97
+ "asl-yaml": {
94
98
  options: object;
95
99
  result: string;
96
100
  };
@@ -100,7 +104,7 @@ interface ExportFormatMap {
100
104
  };
101
105
  }
102
106
  type ExportFormat = keyof ExportFormatMap;
103
- type ExportCallOptions<F extends ExportFormat> = ExportFormatMap[F]['options'] & {
107
+ type ExportCallOptions<F extends ExportFormat> = ExportFormatMap[F]["options"] & {
104
108
  timeout?: number;
105
109
  };
106
110
  interface EmbedEventMap {
@@ -145,7 +149,7 @@ interface MachineInitOptions {
145
149
  machine: unknown;
146
150
  format?: string;
147
151
  mode?: EmbedMode;
148
- theme?: 'light' | 'dark';
152
+ theme?: "light" | "dark";
149
153
  readOnly?: boolean;
150
154
  depth?: number;
151
155
  panels?: {
@@ -169,14 +173,14 @@ interface MachineInitOptions {
169
173
  */
170
174
  unsavedIndicator?: {
171
175
  enabled?: boolean;
172
- mode?: 'structural' | 'all';
176
+ mode?: "structural" | "all";
173
177
  };
174
178
  }
175
179
  interface ProjectInitOptions {
176
180
  machines: ProjectEmbedMachine[];
177
181
  currentMachineId?: string;
178
182
  mode?: EmbedMode;
179
- theme?: 'light' | 'dark';
183
+ theme?: "light" | "dark";
180
184
  readOnly?: boolean;
181
185
  depth?: number;
182
186
  panels?: {
@@ -187,16 +191,16 @@ interface ProjectInitOptions {
187
191
  commentsByMachineId?: Record<string, CommentsConfig>;
188
192
  unsavedIndicator?: {
189
193
  enabled?: boolean;
190
- mode?: 'structural' | 'all';
194
+ mode?: "structural" | "all";
191
195
  };
192
196
  }
193
197
  type InitOptions = MachineInitOptions | ProjectInitOptions;
194
198
  interface InitMessage {
195
- type: '@statelyai.init';
199
+ type: "@statelyai.init";
196
200
  machine: unknown;
197
201
  format?: string;
198
202
  mode?: EmbedMode;
199
- theme?: 'light' | 'dark';
203
+ theme?: "light" | "dark";
200
204
  readOnly?: boolean;
201
205
  depth?: number;
202
206
  leftPanels?: string[];
@@ -207,17 +211,17 @@ interface InitMessage {
207
211
  /** Mirror of `InitOptions.unsavedIndicator`. */
208
212
  unsavedIndicator?: {
209
213
  enabled?: boolean;
210
- mode?: 'structural' | 'all';
214
+ mode?: "structural" | "all";
211
215
  };
212
216
  /** Optional session id override (multiplexed clients only). */
213
217
  sessionId?: string;
214
218
  }
215
219
  interface ProjectInitMessage {
216
- type: '@statelyai.project.init';
220
+ type: "@statelyai.project.init";
217
221
  machines: ProjectEmbedMachine[];
218
222
  currentMachineId?: string;
219
223
  mode?: EmbedMode;
220
- theme?: 'light' | 'dark';
224
+ theme?: "light" | "dark";
221
225
  readOnly?: boolean;
222
226
  depth?: number;
223
227
  leftPanels?: string[];
@@ -226,51 +230,51 @@ interface ProjectInitMessage {
226
230
  commentsByMachineId?: Record<string, CommentsConfig>;
227
231
  unsavedIndicator?: {
228
232
  enabled?: boolean;
229
- mode?: 'structural' | 'all';
233
+ mode?: "structural" | "all";
230
234
  };
231
235
  sessionId?: string;
232
236
  }
233
237
  interface ProjectUpdateMessage {
234
- type: '@statelyai.project.update';
238
+ type: "@statelyai.project.update";
235
239
  machines: ProjectEmbedMachine[];
236
240
  currentMachineId?: string;
237
241
  commentsByMachineId?: Record<string, CommentsConfig>;
238
242
  }
239
243
  interface ProjectSelectMachineMessage {
240
- type: '@statelyai.project.selectMachine';
244
+ type: "@statelyai.project.selectMachine";
241
245
  machineId: string;
242
246
  }
243
247
  interface UpdateMessage {
244
- type: '@statelyai.update';
248
+ type: "@statelyai.update";
245
249
  machine: unknown;
246
250
  format?: string;
247
251
  sourceLocations?: MachineSourceLocations;
248
252
  }
249
253
  interface SetModeMessage {
250
- type: '@statelyai.setMode';
254
+ type: "@statelyai.setMode";
251
255
  mode: EmbedMode;
252
256
  }
253
257
  interface SetThemeMessage {
254
- type: '@statelyai.setTheme';
255
- theme: 'light' | 'dark';
258
+ type: "@statelyai.setTheme";
259
+ theme: "light" | "dark";
256
260
  }
257
261
  interface SetSettingsMessage {
258
- type: '@statelyai.setSettings';
262
+ type: "@statelyai.setSettings";
259
263
  settings: Record<string, unknown>;
260
264
  }
261
265
  interface RetrieveMessage {
262
- type: '@statelyai.retrieve';
266
+ type: "@statelyai.retrieve";
263
267
  requestId: string;
264
268
  format: ExportFormat;
265
269
  options?: Record<string, unknown>;
266
270
  }
267
271
  interface ToastMessage {
268
- type: '@statelyai.toast';
272
+ type: "@statelyai.toast";
269
273
  message: string;
270
- toastType?: 'success' | 'error' | 'info' | 'warning';
274
+ toastType?: "success" | "error" | "info" | "warning";
271
275
  }
272
276
  interface InspectSnapshotMessage {
273
- type: '@statelyai.inspectSnapshot';
277
+ type: "@statelyai.inspectSnapshot";
274
278
  snapshot: unknown;
275
279
  event: unknown | null;
276
280
  /**
@@ -293,13 +297,13 @@ interface ActorSystemEntry {
293
297
  snapshot?: unknown;
294
298
  }
295
299
  interface SystemInitMessage {
296
- type: '@statelyai.system.init';
300
+ type: "@statelyai.system.init";
297
301
  /** All known actors at the moment the system is first streamed. */
298
302
  actors: ActorSystemEntry[];
299
303
  /** Actor id the viz should focus first. Defaults to the root. */
300
304
  selectedActorId?: string;
301
305
  mode?: EmbedMode;
302
- theme?: 'light' | 'dark';
306
+ theme?: "light" | "dark";
303
307
  readOnly?: boolean;
304
308
  depth?: number;
305
309
  leftPanels?: string[];
@@ -309,7 +313,7 @@ interface SystemInitMessage {
309
313
  }
310
314
  /** A new actor joined the system after init. */
311
315
  interface SystemActorRegisteredMessage {
312
- type: '@statelyai.system.actorRegistered';
316
+ type: "@statelyai.system.actorRegistered";
313
317
  actorId: string;
314
318
  parentActorId: string | null;
315
319
  id: string;
@@ -318,7 +322,7 @@ interface SystemActorRegisteredMessage {
318
322
  }
319
323
  /** An actor's snapshot updated. */
320
324
  interface SystemActorSnapshotMessage {
321
- type: '@statelyai.system.actorSnapshot';
325
+ type: "@statelyai.system.actorSnapshot";
322
326
  actorId: string;
323
327
  snapshot: unknown;
324
328
  event?: unknown | null;
@@ -327,21 +331,21 @@ interface SystemActorSnapshotMessage {
327
331
  }
328
332
  /** An actor reached a final state / was stopped. */
329
333
  interface SystemActorStoppedMessage {
330
- type: '@statelyai.system.actorStopped';
334
+ type: "@statelyai.system.actorStopped";
331
335
  actorId: string;
332
336
  }
333
337
  interface ReadyMessage {
334
- type: '@statelyai.ready';
338
+ type: "@statelyai.ready";
335
339
  version: string;
336
340
  }
337
341
  interface LoadedMessage {
338
- type: '@statelyai.loaded';
342
+ type: "@statelyai.loaded";
339
343
  graph: unknown;
340
344
  machineId?: string;
341
345
  sourceLocations?: MachineSourceLocations;
342
346
  }
343
347
  interface ChangeMessage {
344
- type: '@statelyai.change';
348
+ type: "@statelyai.change";
345
349
  graph: unknown;
346
350
  machineConfig: unknown;
347
351
  machineId?: string;
@@ -349,7 +353,7 @@ interface ChangeMessage {
349
353
  sourceLocations?: MachineSourceLocations;
350
354
  }
351
355
  interface SaveMessage {
352
- type: '@statelyai.save';
356
+ type: "@statelyai.save";
353
357
  graph: unknown;
354
358
  machineConfig: unknown;
355
359
  machineId?: string;
@@ -358,16 +362,16 @@ interface SaveMessage {
358
362
  sourceLocations?: MachineSourceLocations;
359
363
  }
360
364
  interface ProjectMachineSelectedMessage {
361
- type: '@statelyai.project.machineSelected';
365
+ type: "@statelyai.project.machineSelected";
362
366
  machineId: string;
363
367
  }
364
368
  interface RetrievedMessage {
365
- type: '@statelyai.retrieved';
369
+ type: "@statelyai.retrieved";
366
370
  requestId: string;
367
371
  data: unknown;
368
372
  }
369
373
  interface ErrorMessage {
370
- type: '@statelyai.error';
374
+ type: "@statelyai.error";
371
375
  code: string;
372
376
  message: string;
373
377
  requestId?: string;
@@ -394,21 +398,21 @@ interface UploadResult {
394
398
  }
395
399
  /** Viz requests the parent to upload a file. */
396
400
  interface UploadRequestMessage {
397
- type: '@statelyai.uploadRequest';
401
+ type: "@statelyai.uploadRequest";
398
402
  requestId: string;
399
403
  file: UploadFileInfo;
400
404
  stateNodeId: string;
401
405
  }
402
406
  /** Parent tells the viz the upload capabilities on init. */
403
407
  interface UploadCapabilitiesMessage {
404
- type: '@statelyai.uploadCapabilities';
408
+ type: "@statelyai.uploadCapabilities";
405
409
  enabled: boolean;
406
410
  accept?: string[];
407
411
  maxFileSize?: number;
408
412
  }
409
413
  /** Parent sends the upload result back to the viz. */
410
414
  interface UploadResponseMessage {
411
- type: '@statelyai.uploadResponse';
415
+ type: "@statelyai.uploadResponse";
412
416
  requestId: string;
413
417
  result: UploadResult;
414
418
  }
@@ -417,8 +421,8 @@ type ClientMessage = InitMessage | ProjectInitMessage | ProjectUpdateMessage | P
417
421
  /** All messages the viz can send back to a client. */
418
422
  type VizMessage = ReadyMessage | LoadedMessage | ChangeMessage | SaveMessage | ProjectMachineSelectedMessage | RetrievedMessage | ErrorMessage | UploadRequestMessage;
419
423
  interface RegisterMessage {
420
- type: '@statelyai.register';
421
- role: 'client' | 'viz';
424
+ type: "@statelyai.register";
425
+ role: "client" | "viz";
422
426
  sessionId: string;
423
427
  metadata?: {
424
428
  name?: string;
@@ -426,11 +430,11 @@ interface RegisterMessage {
426
430
  };
427
431
  }
428
432
  interface RegisteredMessage {
429
- type: '@statelyai.registered';
433
+ type: "@statelyai.registered";
430
434
  sessionId: string;
431
435
  }
432
436
  interface RequestOpenMessage {
433
- type: '@statelyai.requestOpen';
437
+ type: "@statelyai.requestOpen";
434
438
  sessionId: string;
435
439
  }
436
440
  /**
@@ -445,7 +449,7 @@ interface RequestOpenMessage {
445
449
  * the root to target a specific session (falls back to primary).
446
450
  */
447
451
  interface AddSessionMessage {
448
- type: '@statelyai.addSession';
452
+ type: "@statelyai.addSession";
449
453
  sessionId: string;
450
454
  metadata?: {
451
455
  name?: string;
@@ -454,7 +458,7 @@ interface AddSessionMessage {
454
458
  }
455
459
  /** Relay → client: acknowledgement that a session was added. */
456
460
  interface SessionAddedMessage {
457
- type: '@statelyai.sessionAdded';
461
+ type: "@statelyai.sessionAdded";
458
462
  sessionId: string;
459
463
  }
460
464
  /** All session-management messages for the WS relay. */
package/dist/sync.d.mts CHANGED
@@ -1,4 +1,4 @@
1
- import { b as DigraphConfig, i as StatelyGraph } from "./graph-CJ3N2r43.mjs";
1
+ import { b as DigraphConfig, i as StatelyGraph } from "./graph-DmXh22Zu.mjs";
2
2
  import { CreateProjectInput, ProjectData, StudioClient, StudioMachineRecord, XStateVersion } from "./studio.mjs";
3
3
  import { GraphDiff } from "@statelyai/graph";
4
4
 
@@ -45,6 +45,7 @@ interface PushSyncProjectOptions extends CreateProjectInput {
45
45
  interface PushSyncOptions extends Omit<PlanSyncOptions, 'target'> {
46
46
  project?: PushSyncProjectOptions;
47
47
  xstateVersion?: XStateVersion;
48
+ relink?: boolean;
48
49
  }
49
50
  interface PushSyncResult {
50
51
  source: ResolvedSyncInput;
package/dist/sync.mjs CHANGED
@@ -586,10 +586,15 @@ function offsetAtRangePosition(text, line, character) {
586
586
  return text.length;
587
587
  }
588
588
 
589
+ //#endregion
590
+ //#region ../graph-tools/src/codegenTypes.ts
591
+ const INLINE_EXPRESSION_DIRECTIVE_FIELDS = ["input", "output"];
592
+
589
593
  //#endregion
590
594
  //#region src/sync.ts
591
595
  const execFileAsync = promisify(execFile);
592
596
  const MAX_CAPTURED_LOCAL_MACHINES = 100;
597
+ const INLINE_EXPRESSION_FIELD_SET = new Set(INLINE_EXPRESSION_DIRECTIVE_FIELDS);
593
598
  async function extractMachinesFromLocalSource(sourcePath, contents) {
594
599
  try {
595
600
  return { machines: extractMachineConfigsFromAst(sourcePath, parseSourceToMachine(contents, createTextDocument(sourcePath, contents), { resolver: createFileSourceDocumentResolver() })) };
@@ -704,7 +709,12 @@ function evaluateExpression(expression, sourceFile, bindings, seenBindings) {
704
709
  if (!ts.isPropertyAssignment(property)) continue;
705
710
  const key = resolvePropertyNameValue(property.name, sourceFile, bindings, seenBindings);
706
711
  if (key == null) continue;
707
- result[String(key)] = evaluateExpression(property.initializer, sourceFile, bindings, seenBindings);
712
+ const fieldName = String(key);
713
+ if (shouldPreserveInlineExpression(fieldName, property.initializer, sourceFile, bindings, seenBindings)) {
714
+ result[fieldName] = createInlineExpressionDirective(property.initializer.getText(sourceFile));
715
+ continue;
716
+ }
717
+ result[fieldName] = evaluateExpression(property.initializer, sourceFile, bindings, seenBindings);
708
718
  }
709
719
  return result;
710
720
  }
@@ -728,6 +738,26 @@ function evaluateExpression(expression, sourceFile, bindings, seenBindings) {
728
738
  }
729
739
  return unwrapped.getText(sourceFile);
730
740
  }
741
+ function shouldPreserveInlineExpression(fieldName, expression, sourceFile, bindings, seenBindings) {
742
+ if (!INLINE_EXPRESSION_FIELD_SET.has(fieldName)) return false;
743
+ const unwrapped = unwrapExpression(expression);
744
+ if (ts.isIdentifier(unwrapped)) {
745
+ const binding = bindings.get(unwrapped.text);
746
+ if (!binding || binding.kind !== "value" || seenBindings.has(unwrapped.text)) return true;
747
+ const nextSeen = new Set(seenBindings);
748
+ nextSeen.add(unwrapped.text);
749
+ return shouldPreserveInlineExpression(fieldName, binding.expression, sourceFile, bindings, nextSeen);
750
+ }
751
+ if (ts.isStringLiteral(unwrapped) || ts.isNoSubstitutionTemplateLiteral(unwrapped) || ts.isNumericLiteral(unwrapped) || unwrapped.kind === ts.SyntaxKind.TrueKeyword || unwrapped.kind === ts.SyntaxKind.FalseKeyword || unwrapped.kind === ts.SyntaxKind.NullKeyword || ts.isObjectLiteralExpression(unwrapped) || ts.isArrayLiteralExpression(unwrapped)) return false;
752
+ return unwrapped.getText(sourceFile).trim().length > 0;
753
+ }
754
+ function createInlineExpressionDirective(expr) {
755
+ return {
756
+ "@type": "code",
757
+ lang: "ts",
758
+ expr
759
+ };
760
+ }
731
761
  function resolvePropertyNameValue(name, sourceFile, bindings, seenBindings) {
732
762
  if (ts.isIdentifier(name) || ts.isStringLiteral(name) || ts.isNumericLiteral(name)) return name.text;
733
763
  if (!ts.isComputedPropertyName(name)) return null;
@@ -990,7 +1020,7 @@ async function pushLocalMachineLinks(options) {
990
1020
  });
991
1021
  continue;
992
1022
  }
993
- if (attachment.pragma?.id) {
1023
+ if (attachment.pragma?.id && !options.relink) {
994
1024
  const updatedMachine = await client.machines.update({
995
1025
  id: attachment.pragma.id,
996
1026
  definition: toStudioMachine(fromXStateConfig(extractedMachine.config))
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@statelyai/sdk",
3
- "version": "0.9.0",
3
+ "version": "0.10.0",
4
4
  "license": "MIT",
5
5
  "files": [
6
6
  "dist",
@@ -52,8 +52,10 @@
52
52
  },
53
53
  "./statelyai.schema.json": "./schemas/statelyai.schema.json",
54
54
  "./schemas/statelyai.schema.json": "./schemas/statelyai.schema.json",
55
- "./xstate-json.schema.json": "./schemas/xstate-json.schema.json",
56
- "./schemas/xstate-json.schema.json": "./schemas/xstate-json.schema.json"
55
+ "./xstate.schema.json": "./schemas/xstate.schema.json",
56
+ "./schemas/xstate.schema.json": "./schemas/xstate.schema.json",
57
+ "./xstate-json.schema.json": "./schemas/xstate.schema.json",
58
+ "./schemas/xstate-json.schema.json": "./schemas/xstate.schema.json"
57
59
  },
58
60
  "dependencies": {
59
61
  "@statelyai/graph": "^0.9.0",
@@ -46,6 +46,11 @@
46
46
  "items": {
47
47
  "$ref": "#/$defs/globPattern"
48
48
  }
49
+ },
50
+ "newMachineDir": {
51
+ "type": "string",
52
+ "minLength": 1,
53
+ "description": "Directory, relative to statelyai.json, where statelyai pull should create new local files for remote-only project machines."
49
54
  }
50
55
  },
51
56
  "$defs": {
@@ -63,7 +68,8 @@
63
68
  "studioUrl": "https://stately.ai",
64
69
  "defaultXStateVersion": 5,
65
70
  "include": ["src/**/*.ts", "src/**/*.tsx"],
66
- "exclude": ["**/*.test.ts", "**/*.spec.ts"]
71
+ "exclude": ["**/*.test.ts", "**/*.spec.ts"],
72
+ "newMachineDir": "src/machines"
67
73
  }
68
74
  ]
69
75
  }
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "$schema": "https://json-schema.org/draft/2020-12/schema",
3
- "$id": "https://stately.ai/schemas/xstate-json.json",
3
+ "$id": "https://stately.ai/schemas/xstate.json",
4
4
  "title": "XState JSON machine config",
5
5
  "description": "Strict JSON subset of an XState machine config that can be passed to createMachine(config). Shorthand string forms are normalized to object and array forms.",
6
6
  "$ref": "#/$defs/machineConfig",