@statelyai/sdk 0.39.1 → 0.41.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.
Files changed (35) hide show
  1. package/README.md +10 -0
  2. package/dist/assetStorage.d.mts +1 -1
  3. package/dist/chunk-D1OLi6Wq.mjs +46 -0
  4. package/dist/editorHostProtocol.d.mts +3 -3
  5. package/dist/embed.d.mts +4 -3
  6. package/dist/embed.mjs +10 -3
  7. package/dist/{graph-CfWCJS4m.d.mts → graph-DbZdSisK.d.mts} +1 -1
  8. package/dist/graph.d.mts +1 -1
  9. package/dist/{index-DfMkVP94.d.mts → index-DqF1xP8P.d.mts} +50 -406
  10. package/dist/index.d.mts +5 -5
  11. package/dist/index.mjs +3 -3
  12. package/dist/{inspect-DXtP_tPO.mjs → inspect-CDjr4saL.mjs} +1 -1
  13. package/dist/{inspect-JNvMtuzC.d.mts → inspect-ruD95iBM.d.mts} +1 -1
  14. package/dist/inspect.d.mts +2 -2
  15. package/dist/inspect.mjs +2 -2
  16. package/dist/machineGraph-DYtFKHlq-BpWpGU22.mjs +3 -0
  17. package/dist/machineGraph-DYtFKHlq-ChbeTHlv.mjs +1023 -0
  18. package/dist/patchTypes.d.mts +1 -1
  19. package/dist/{protocol-D3XQmmmv.d.mts → protocol-BvElOcXs.d.mts} +17 -5
  20. package/dist/protocol.d.mts +1 -1
  21. package/dist/relay.d.mts +1 -1
  22. package/dist/rolldown-runtime-95iHPtFO-Bo6l7CbO.mjs +114 -0
  23. package/dist/{studio-DL0yj2Pi.mjs → schemas-DsQ8UYlM.mjs} +36 -1642
  24. package/dist/sourceCoverage.d.mts +101 -0
  25. package/dist/sourceCoverage.mjs +3572 -0
  26. package/dist/studio-DH7OeLao.mjs +1604 -0
  27. package/dist/{studio-ClBs4caM.d.mts → studio-DRw9sxCm.d.mts} +20 -2
  28. package/dist/studio.d.mts +1 -1
  29. package/dist/studio.mjs +1 -1
  30. package/dist/{version-gEUUpYtd.mjs → version-eag6cuvm.mjs} +1 -1
  31. package/dist/xstateSource-BUCx2xA4-CWteIFJn.d.mts +451 -0
  32. package/dist/xstateSource-JvwXWv6G-KnMMoZlG.mjs +151753 -0
  33. package/package.json +9 -5
  34. /package/dist/{editor-sync-types-Ch5P5XRj.d.mts → editor-sync-types-BjgSBGxf.d.mts} +0 -0
  35. /package/dist/{patchTypes-BZ7gzwAP.d.mts → patchTypes-BFlvJTDJ.d.mts} +0 -0
package/README.md CHANGED
@@ -486,6 +486,16 @@ This loader format has its own contract: transition `actions` must be arrays, hi
486
486
 
487
487
  `@statelyai/sdk/xstate.schema.json` and `xstate-json.schema.json` continue to describe v5 definitions. The schemas are also available under the `schemas/` export paths.
488
488
 
489
+ ## Source transition coverage
490
+
491
+ <!-- Optional source coverage exports from src/sourceCoverage.ts and docs/sdk/source-coverage.md -->
492
+
493
+ The optional `@statelyai/sdk/source-coverage` entry extracts source outcomes,
494
+ instruments trusted v6 models and projects witnessed coverage onto a Viz graph.
495
+ It keeps refusal paths and separate return sites visible, including branches
496
+ sharing a destination. See [source transition coverage](../../docs/sdk/source-coverage.md)
497
+ for SDK usage, execution adapters and completeness contract.
498
+
489
499
  ## Self-hosting
490
500
 
491
501
  <!-- self-host configuration from the editor app auth and editor-sync routes -->
@@ -1,4 +1,4 @@
1
- import { Qt as UploadResult } from "./protocol-D3XQmmmv.mjs";
1
+ import { Qt as UploadResult } from "./protocol-BvElOcXs.mjs";
2
2
  //#region src/assetStorage.d.ts
3
3
  interface AssetUploadContext {
4
4
  stateNodeId: string;
@@ -0,0 +1,46 @@
1
+ import { createRequire } from "node:module";
2
+
3
+ //#region \0rolldown/runtime.js
4
+ var __create = Object.create;
5
+ var __defProp = Object.defineProperty;
6
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
7
+ var __getOwnPropNames = Object.getOwnPropertyNames;
8
+ var __getProtoOf = Object.getPrototypeOf;
9
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
10
+ var __esmMin = (fn, res) => () => (fn && (res = fn(fn = 0)), res);
11
+ var __commonJSMin = (cb, mod) => () => (mod || cb((mod = { exports: {} }).exports, mod), mod.exports);
12
+ var __exportAll = (all, no_symbols) => {
13
+ let target = {};
14
+ for (var name in all) {
15
+ __defProp(target, name, {
16
+ get: all[name],
17
+ enumerable: true
18
+ });
19
+ }
20
+ if (!no_symbols) {
21
+ __defProp(target, Symbol.toStringTag, { value: "Module" });
22
+ }
23
+ return target;
24
+ };
25
+ var __copyProps = (to, from, except, desc) => {
26
+ if (from && typeof from === "object" || typeof from === "function") {
27
+ for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
28
+ key = keys[i];
29
+ if (!__hasOwnProp.call(to, key) && key !== except) {
30
+ __defProp(to, key, {
31
+ get: ((k) => from[k]).bind(null, key),
32
+ enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
33
+ });
34
+ }
35
+ }
36
+ }
37
+ return to;
38
+ };
39
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
40
+ value: mod,
41
+ enumerable: true
42
+ }) : target, mod));
43
+ var __require = /* @__PURE__ */ createRequire(import.meta.url);
44
+
45
+ //#endregion
46
+ export { __toESM as a, __require as i, __esmMin as n, __exportAll as r, __commonJSMin as t };
@@ -1,6 +1,6 @@
1
- import { o as GraphPatch } from "./index-DfMkVP94.mjs";
2
- import { mn as EmbedPanelConfig, mt as ProjectWorkspaceConfig, n as AuthenticationRecovery, pn as PresentationMetadataInitializer, rt as ProjectEmbedMachine } from "./protocol-D3XQmmmv.mjs";
3
- import { a as MachineSourceLocations, t as EditorCapabilities } from "./editor-sync-types-Ch5P5XRj.mjs";
1
+ import { i as GraphPatch } from "./index-DqF1xP8P.mjs";
2
+ import { mn as EmbedPanelConfig, mt as ProjectWorkspaceConfig, n as AuthenticationRecovery, pn as PresentationMetadataInitializer, rt as ProjectEmbedMachine } from "./protocol-BvElOcXs.mjs";
3
+ import { a as MachineSourceLocations, t as EditorCapabilities } from "./editor-sync-types-BjgSBGxf.mjs";
4
4
 
5
5
  //#region src/editorHostProtocol.d.ts
6
6
  declare const EDITOR_PROTOCOL_VERSION = 1;
package/dist/embed.d.mts CHANGED
@@ -1,6 +1,7 @@
1
- import { n as ProfileManifest, o as GraphPatch } from "./index-DfMkVP94.mjs";
2
- import { i as StatelyGraph } from "./graph-CfWCJS4m.mjs";
3
- import { $ as MachineVersionAutoSaveOptions, A as ExportFormat, E as EmbedMode, F as HostUpdateOptions, Q as MachineSourceLocations, Qt as UploadResult, S as EmbedEventName, X as MachineInitOptions, at as ProjectInitOptions, b as EmbedEventHandler, dt as ProjectWorkspaceActionIcon, f as CommentsConfig, gt as ProjectWorkspaceMachineOrigin, h as EditorCapabilities, hn as EmbedPanelPosition, ht as ProjectWorkspaceMachine, i as CapabilityDeniedEvent, j as ExportFormatMap, k as ExportCallOptions, mn as EmbedPanelConfig, mt as ProjectWorkspaceConfig, nn as ViewerOptions, pt as ProjectWorkspaceCapabilities, rt as ProjectEmbedMachine, ut as ProjectWorkspaceAction, v as EmbedDocument, vt as ProjectWorkspaceProject, w as EmbedExtensionsManifest, x as EmbedEventMap, y as EmbedDocumentLanguage, z as InitOptions } from "./protocol-D3XQmmmv.mjs";
1
+ import { i as GraphPatch } from "./index-DqF1xP8P.mjs";
2
+ import { r as ProfileManifest } from "./xstateSource-BUCx2xA4-CWteIFJn.mjs";
3
+ import { i as StatelyGraph } from "./graph-DbZdSisK.mjs";
4
+ import { $ as MachineVersionAutoSaveOptions, A as ExportFormat, E as EmbedMode, F as HostUpdateOptions, Q as MachineSourceLocations, Qt as UploadResult, S as EmbedEventName, X as MachineInitOptions, at as ProjectInitOptions, b as EmbedEventHandler, dt as ProjectWorkspaceActionIcon, f as CommentsConfig, gt as ProjectWorkspaceMachineOrigin, h as EditorCapabilities, hn as EmbedPanelPosition, ht as ProjectWorkspaceMachine, i as CapabilityDeniedEvent, j as ExportFormatMap, k as ExportCallOptions, mn as EmbedPanelConfig, mt as ProjectWorkspaceConfig, nn as ViewerOptions, pt as ProjectWorkspaceCapabilities, rt as ProjectEmbedMachine, ut as ProjectWorkspaceAction, v as EmbedDocument, vt as ProjectWorkspaceProject, w as EmbedExtensionsManifest, x as EmbedEventMap, y as EmbedDocumentLanguage, z as InitOptions } from "./protocol-BvElOcXs.mjs";
4
5
  import { AssetUploadAdapter } from "./assetStorage.mjs";
5
6
  import { GraphDiff } from "@statelyai/graph";
6
7
 
package/dist/embed.mjs CHANGED
@@ -1,5 +1,5 @@
1
1
  import "./protocol-M3Zeun3o.mjs";
2
- import { c as createPendingExportManager, l as settingsWithViewMode, r as createPostMessageTransport, s as createEventRegistry, t as SDK_VERSION, u as toInitMessage } from "./version-gEUUpYtd.mjs";
2
+ import { c as createPendingExportManager, l as settingsWithViewMode, r as createPostMessageTransport, s as createEventRegistry, t as SDK_VERSION, u as toInitMessage } from "./version-eag6cuvm.mjs";
3
3
  import { EDITOR_PROTOCOL_VERSION } from "./editorHostProtocol.mjs";
4
4
 
5
5
  //#region src/embed.ts
@@ -34,6 +34,10 @@ function buildEmbedUrl(options) {
34
34
  const url = new URL(base);
35
35
  if (normalizeApiKey(options.apiKey)) url.searchParams.set("auth", "message");
36
36
  if (options.viewMode) url.searchParams.set("view", options.viewMode);
37
+ if (!options.machines && options.chrome?.controls === "plain") {
38
+ url.searchParams.set("chrome", "plain");
39
+ if (options.chrome.interactive) url.searchParams.set("interactive", "1");
40
+ }
37
41
  const appearance = options.settings?.appearance;
38
42
  const settingsMode = appearance && typeof appearance === "object" && "colorMode" in appearance ? appearance.colorMode : void 0;
39
43
  const colorMode = options.theme ?? settingsMode ?? "dark";
@@ -119,7 +123,10 @@ function extractInitOptions(options) {
119
123
  defaultPanelSide: options.defaultPanelSide,
120
124
  comments: options.comments,
121
125
  sourceLocations: options.sourceLocations,
122
- chrome: options.chrome?.controls ? { controls: options.chrome.controls } : void 0,
126
+ chrome: options.chrome?.controls ? {
127
+ controls: options.chrome.controls,
128
+ ...options.chrome.interactive !== void 0 && { interactive: options.chrome.interactive }
129
+ } : void 0,
123
130
  settings: settingsWithViewMode(options),
124
131
  unsavedIndicator: options.unsavedIndicator,
125
132
  versionAutoSave: options.versionAutoSave
@@ -465,7 +472,7 @@ function createStatelyEmbed(options) {
465
472
  }
466
473
  function applyIframeColorMode(el, mode) {
467
474
  el.style.colorScheme = mode === "system" ? "light dark" : mode;
468
- el.style.backgroundColor = "light-dark(#eff1f3, #15151d)";
475
+ el.style.backgroundColor = new URL(embedUrl).searchParams.get("chrome") === "plain" ? "transparent" : "light-dark(#eff1f3, #15151d)";
469
476
  }
470
477
  function prepareIframe(el) {
471
478
  restoreIframeVisibility?.();
@@ -1,4 +1,4 @@
1
- import { t as CodeExpression } from "./index-DfMkVP94.mjs";
1
+ import { t as CodeExpression } from "./xstateSource-BUCx2xA4-CWteIFJn.mjs";
2
2
  import * as _statelyai_graph0 from "@statelyai/graph";
3
3
  import { Graph } from "@statelyai/graph";
4
4
 
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-CfWCJS4m.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-DbZdSisK.mjs";
2
2
  export { StatelyAction, StatelyActorImplementation, StatelyEdgeData, StatelyGraph, StatelyGraphData, StatelyGuard, StatelyImplementation, StatelyInvoke, StatelyNodeData, StatelyTagImplementation, StudioAction, StudioEdge, StudioEventTypeData, StudioMachine, StudioNode, fromStudioMachine, studioMachineConverter, toStudioMachine };