@statelyai/sdk 0.20.0 → 0.20.2

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.
@@ -1,4 +1,4 @@
1
- import { a as literal, c as record, d as unknown, l as string, n as array, o as number, r as boolean, s as object, t as _enum, u as union } from "./schemas-C2raUv-n.mjs";
1
+ import { c as object, d as union, f as unknown, l as record, n as array, o as literal, r as boolean, s as number, t as _enum, u as string } from "./schemas-b9wG-zYl.mjs";
2
2
  import { createAuthorizationHeader, getCredentialToken } from "./auth.mjs";
3
3
 
4
4
  //#region ../api-contract/dist/errors.mjs
@@ -1,4 +1,4 @@
1
- import { A as $strip, C as ZodObject, D as ZodUnion, E as ZodString, O as ZodUnknown, S as ZodNumber, T as ZodRecord, b as ZodLiteral, k as output, v as ZodArray, w as ZodOptional, x as ZodNullable, y as ZodEnum } from "./index-CKFbG_Ix.mjs";
1
+ import { A as $strip, C as ZodObject, D as ZodUnion, E as ZodString, O as ZodUnknown, S as ZodNumber, T as ZodRecord, b as ZodLiteral, k as output, v as ZodArray, w as ZodOptional, x as ZodNullable, y as ZodEnum } from "./index-BAkQThnl.mjs";
2
2
  import { n as StatelyCredential, t as StatelyAuthMode } from "./auth-B0ZTKri2.mjs";
3
3
 
4
4
  //#region ../api-contract/dist/errors.d.mts
package/dist/studio.d.mts CHANGED
@@ -1,2 +1,2 @@
1
- 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, p as LegacyExtractMachinesOptions, 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-DLduJRSp.mjs";
1
+ 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, p as LegacyExtractMachinesOptions, 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-YSppd-am.mjs";
2
2
  export { ConnectedRepo, CreateMachineFromDefinitionInput, CreateMachineFromTemplateInput, CreateMachineInput, CreateMachineTemplate, CreateProjectInput, DEFAULT_STATELY_BASE_URL, EnsureProjectInput, ExtractMachinesInput, ExtractMachinesResponse, ExtractedMachine, ExtractedMachines, GetMachineOptions, LegacyExtractMachinesOptions, LegacyProjectVisibility, LegacyUpdateMachineInput, Machine, MachineVersion, Project, ProjectData, ProjectMachine, ProjectMachineSummary, ProjectSummary, ProjectVisibility, RepoType, ResourceErrorCode, StudioApiError, StudioApiErrorOptions, StudioClient, StudioClientOptions, StudioMachineRecord, StudioRequestOptions, UpdateMachineInput, UpdateProjectInput, VerifyApiKeyResponse, VerifyResult, XStateVersion, createStatelyClient };
package/dist/studio.mjs CHANGED
@@ -1,3 +1,3 @@
1
- import { n as StudioApiError, r as createStatelyClient, t as DEFAULT_STATELY_BASE_URL } from "./studio-EKd7cQN7.mjs";
1
+ import { n as StudioApiError, r as createStatelyClient, t as DEFAULT_STATELY_BASE_URL } from "./studio-DHGspwII.mjs";
2
2
 
3
3
  export { DEFAULT_STATELY_BASE_URL, StudioApiError, createStatelyClient };
package/dist/sync.d.mts CHANGED
@@ -1,5 +1,5 @@
1
- import { b as DigraphConfig, i as StatelyGraph } from "./graph-DxeqWHC3.mjs";
2
- import { C as StudioMachineRecord, L as XStateVersion, g as ProjectData, o as CreateProjectInput, x as StudioClient } from "./studio-DLduJRSp.mjs";
1
+ import { b as DigraphConfig, i as StatelyGraph } from "./graph-yDK-MM3G.mjs";
2
+ import { C as StudioMachineRecord, L as XStateVersion, g as ProjectData, o as CreateProjectInput, x as StudioClient } from "./studio-YSppd-am.mjs";
3
3
  import { GraphDiff } from "@statelyai/graph";
4
4
 
5
5
  //#region src/sync.d.ts
package/dist/sync.mjs CHANGED
@@ -1,5 +1,5 @@
1
- import { r as createStatelyClient } from "./studio-EKd7cQN7.mjs";
2
- import { i as INLINE_EXPRESSION_DIRECTIVE_FIELDS, m as xstateSourceToConfig, n as getStatelyPragma, p as serializeJS, r as upsertStatelyPragma, s as detectXStateSourceProfile, t as findStatelyPragmaAttachments, u as graphToXStateTS } from "./statelyPragma-GN-bfuC_.mjs";
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-Cnj58Rua.mjs";
3
3
  import { fromStudioMachine, toStudioMachine } from "./graph.mjs";
4
4
  import * as ts$1 from "typescript";
5
5
  import ts from "typescript";
@@ -157,7 +157,8 @@ function collectXStateSourceLocations(sourceText, document, options = {}) {
157
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
158
  return {
159
159
  version: 1,
160
- profile: packageProfile ?? inferredProfile,
160
+ profile: packageProfile?.profile ?? inferredProfile,
161
+ profileRef: packageProfile?.profileRef ?? normalizeMachineProfile(inferredProfile),
161
162
  root: {
162
163
  uri,
163
164
  range: toSourceRange$1(sourceFile, root)
@@ -198,10 +199,16 @@ function detectXStatePackageProfile(packageJson) {
198
199
  }
199
200
  }
200
201
  if (!range) return void 0;
201
- const clauseProfiles = range.replace(/^(?:workspace:|npm:xstate@)/, "").split("||").map((clause) => detectXStateRangeClauseProfile(clause.trim()));
202
+ const normalizedRange = range.replace(/^(?:workspace:|npm:xstate@)/, "");
203
+ const clauseProfiles = normalizedRange.split("||").map((clause) => detectXStateRangeClauseProfile(clause.trim()));
202
204
  const profiles = new Set(clauseProfiles);
203
205
  if (profiles.size !== 1 || profiles.has(void 0)) return void 0;
204
- return clauseProfiles[0];
206
+ const profile = clauseProfiles[0];
207
+ if (!profile) return void 0;
208
+ return {
209
+ profile,
210
+ profileRef: /^\d+\.\d+\.\d+(?:-[0-9A-Za-z.-]+)?$/.test(normalizedRange) ? `@statelyai/xstate@${normalizedRange}` : normalizeMachineProfile(profile)
211
+ };
205
212
  }
206
213
  function detectXStateRangeClauseProfile(clause) {
207
214
  const normalizedClause = clause.replace(/([<>]=?)\s+/g, "$1");
@@ -328,7 +328,7 @@ function createWebSocketTransport(options) {
328
328
 
329
329
  //#endregion
330
330
  //#region src/version.ts
331
- const SDK_VERSION = "0.20.0";
331
+ const SDK_VERSION = "0.20.2";
332
332
  function inspectionRuntime() {
333
333
  if (typeof window !== "undefined") return "browser";
334
334
  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.20.0",
3
+ "version": "0.20.2",
4
4
  "license": "MIT",
5
5
  "bin": {
6
6
  "stately-sdk": "./dist/bin.mjs"
@@ -81,7 +81,7 @@
81
81
  "./schemas/xstate-json.schema.json": "./schemas/xstate.schema.json"
82
82
  },
83
83
  "dependencies": {
84
- "@statelyai/graph": "^1.0.0",
84
+ "@statelyai/graph": "^2.1.0",
85
85
  "esbuild": "^0.27.0",
86
86
  "typescript": "^5.9.3",
87
87
  "ws": "^8.19.0",
@@ -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.1.0",
97
- "@statelyai/graph-tools": "0.0.8"
96
+ "@statelyai/api-contract": "0.3.2",
97
+ "@statelyai/graph-tools": "0.1.0"
98
98
  },
99
99
  "engines": {
100
100
  "node": ">=22.4"