@statelyai/sdk 0.21.0 → 0.22.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/dist/sync.mjs CHANGED
@@ -1,5 +1,6 @@
1
- import { r as createStatelyClient } from "./studio-DHGspwII.mjs";
2
- import { f as normalizeMachineProfile, h as xstateSourceToConfig, i as INLINE_EXPRESSION_DIRECTIVE_FIELDS, m as serializeJS, n as getStatelyPragma, r as upsertStatelyPragma, s as detectXStateSourceProfile, t as findStatelyPragmaAttachments, u as graphToXStateTS } from "./statelyPragma-mii-qTXd.mjs";
1
+ import "./openapi-BTDjYWXd.mjs";
2
+ import { r as createStatelyClient } from "./studio-iNSHtNmP.mjs";
3
+ import { f as normalizeMachineProfile, h as xstateSourceToConfig, i as INLINE_EXPRESSION_DIRECTIVE_FIELDS, m as serializeJS, n as getStatelyPragma, r as upsertStatelyPragma, s as detectXStateSourceProfile, t as findStatelyPragmaAttachments, u as graphToXStateTS } from "./statelyPragma-DfKQ-kPr.mjs";
3
4
  import { fromStudioMachine, toStudioMachine } from "./graph.mjs";
4
5
  import * as ts$1 from "typescript";
5
6
  import ts from "typescript";
@@ -154,7 +155,10 @@ function collectXStateSourceLocations(sourceText, document, options = {}) {
154
155
  const rootProfile = detectXStateSourceProfile(sourceText);
155
156
  const referencedStateSymbols = new Set([...states, ...statesObjectLocations].map((state) => state.symbol).filter((symbol) => typeof symbol === "string"));
156
157
  const resolvedTransitionFunctions = collectResolvedTransitionFunctions(root, bindings);
157
- const inferredProfile = rootProfile === "xstate-v6-alpha" || resolvedTransitionFunctions.size > 0 || [...referencedStateSymbols].some((symbol) => detectXStateSourceProfile(bindings.get(symbol)?.sourceFile.text ?? "") === "xstate-v6-alpha") ? "xstate-v6-alpha" : rootProfile;
158
+ const inferredProfile = rootProfile === "xstate-v6-alpha" || resolvedTransitionFunctions.size > 0 || [...referencedStateSymbols].some((symbol) => {
159
+ const binding = bindings.get(symbol);
160
+ return binding?.kind === "createStateConfig" || detectXStateSourceProfile(binding?.sourceFile.text ?? "") === "xstate-v6-alpha";
161
+ }) ? "xstate-v6-alpha" : rootProfile;
158
162
  return {
159
163
  version: 1,
160
164
  profile: packageProfile?.profile ?? inferredProfile,
@@ -127,6 +127,7 @@ function toInitMessage(options) {
127
127
  rightPanels: options.panels?.rightPanels,
128
128
  activePanels: options.panels?.activePanels,
129
129
  commentsByMachineId: options.commentsByMachineId,
130
+ settings: options.settings,
130
131
  unsavedIndicator: options.unsavedIndicator
131
132
  };
132
133
  return {
@@ -146,6 +147,7 @@ function toInitMessage(options) {
146
147
  activePanels: options.panels?.activePanels,
147
148
  comments: options.comments,
148
149
  sourceLocations: options.sourceLocations,
150
+ settings: options.settings,
149
151
  unsavedIndicator: options.unsavedIndicator
150
152
  };
151
153
  }
@@ -329,7 +331,7 @@ function createWebSocketTransport(options) {
329
331
 
330
332
  //#endregion
331
333
  //#region src/version.ts
332
- const SDK_VERSION = "0.21.0";
334
+ const SDK_VERSION = "0.22.1";
333
335
  function inspectionRuntime() {
334
336
  if (typeof window !== "undefined") return "browser";
335
337
  if (typeof process !== "undefined" && process.versions?.node) return "node";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@statelyai/sdk",
3
- "version": "0.21.0",
3
+ "version": "0.22.1",
4
4
  "license": "MIT",
5
5
  "bin": {
6
6
  "stately-sdk": "./dist/bin.mjs"
@@ -93,8 +93,8 @@
93
93
  "jsdom": "^27.4.0",
94
94
  "tsdown": "0.21.0-beta.2",
95
95
  "vitest": "^3.2.4",
96
- "@statelyai/api-contract": "0.3.6",
97
- "@statelyai/graph-tools": "0.2.0"
96
+ "@statelyai/api-contract": "0.3.7",
97
+ "@statelyai/graph-tools": "0.2.1"
98
98
  },
99
99
  "engines": {
100
100
  "node": ">=22.4"