@statelyai/sdk 0.40.0 → 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 +1 -1
  7. package/dist/{graph-9CApplKH.d.mts → graph-DbZdSisK.d.mts} +1 -1
  8. package/dist/graph.d.mts +1 -1
  9. package/dist/{index-gyYPC8rD.d.mts → index-DqF1xP8P.d.mts} +50 -399
  10. package/dist/index.d.mts +5 -5
  11. package/dist/index.mjs +3 -3
  12. package/dist/{inspect-COd1d8sJ.mjs → inspect-CDjr4saL.mjs} +1 -1
  13. package/dist/{inspect-C8SpNJKF.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-DUehXGus.d.mts → protocol-BvElOcXs.d.mts} +4 -3
  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-D0XNCqKr.mjs → schemas-DsQ8UYlM.mjs} +36 -1649
  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-DeFtdrGS.d.mts → studio-DRw9sxCm.d.mts} +10 -2
  28. package/dist/studio.d.mts +1 -1
  29. package/dist/studio.mjs +1 -1
  30. package/dist/{version-CRlxeCo2.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 +7 -3
  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
@@ -0,0 +1,101 @@
1
+ import { n as Graph } from "./xstateSource-BUCx2xA4-CWteIFJn.mjs";
2
+ //#region ../graph-tools/dist/typescript.d.mts
3
+ //#endregion
4
+ //#region src/sourceCoverage.d.ts
5
+ /** Data-only protocol shared with @statelyai/graph and @xstate/test. */
6
+ interface XStateSourceCoverageManifest {
7
+ schemaVersion: 1;
8
+ criterion: 'transition-outcomes';
9
+ source: {
10
+ fileName: string;
11
+ hash: string;
12
+ algorithm: 'SHA-256';
13
+ };
14
+ extractor: string;
15
+ complete: boolean;
16
+ machineCount: number;
17
+ obligations: XStateSourceCoverageObligation[];
18
+ diagnostics: Array<{
19
+ code: string;
20
+ message: string;
21
+ path: string;
22
+ start: number;
23
+ end: number;
24
+ }>;
25
+ }
26
+ interface XStateSourceCoverageObligation {
27
+ id: string;
28
+ machineIndex: number;
29
+ path: string;
30
+ eventType: string;
31
+ kind: 'transition' | 'targetless' | 'refusal';
32
+ targets: string[];
33
+ /** Alternative conjunctions: any alternative suffices to reach this site. */
34
+ predicates: string[][];
35
+ location: {
36
+ start: number;
37
+ end: number;
38
+ line: number;
39
+ column: number;
40
+ };
41
+ }
42
+ interface XStateSourceCoverageControl {
43
+ observer: ((id: string) => void) | undefined;
44
+ faults: number;
45
+ }
46
+ /** Extracts all supported outcomes; unresolved syntax prevents completeness. */
47
+ declare function extractXStateSourceCoverage(source: string, options?: {
48
+ fileName?: string;
49
+ }): Promise<XStateSourceCoverageManifest>;
50
+ /**
51
+ * Adds file-local instrumentation without evaluating source. The host imports
52
+ * the returned control export and installs an observer during synchronous
53
+ * transition calculation. No globals or shared process-wide recorder are used.
54
+ */
55
+ declare function instrumentXStateSourceCoverage(source: string, options?: {
56
+ fileName?: string;
57
+ }): Promise<{
58
+ manifest: XStateSourceCoverageManifest;
59
+ controlExport: string;
60
+ source: string;
61
+ metadataKey: string;
62
+ }>;
63
+ /** Portable presentation data; no compiler or schema-library types escape. */
64
+ type XStateSourceCoverageGraph = Graph<{
65
+ key: string;
66
+ [key: string]: unknown;
67
+ }, {
68
+ eventType: string;
69
+ color?: string | null;
70
+ meta?: Record<string, unknown> | null;
71
+ [key: string]: unknown;
72
+ }, {
73
+ sourceCoverage: {
74
+ sourceHash: string;
75
+ extractionComplete: boolean;
76
+ diagnostics: XStateSourceCoverageManifest['diagnostics'];
77
+ refusals: Array<XStateSourceCoverageObligation & {
78
+ covered: boolean;
79
+ }>;
80
+ };
81
+ [key: string]: unknown;
82
+ }>;
83
+ /** Produces a source-linked coverage graph that the existing Viz canvas can render. */
84
+ declare function createXStateSourceCoverageGraph(source: string, report?: {
85
+ sourceHash: string;
86
+ covered: string[];
87
+ counts: Record<string, number>;
88
+ }, options?: {
89
+ fileName?: string;
90
+ machineIndex?: number;
91
+ profile?: 'xstate-v5' | 'xstate-v6-alpha';
92
+ }): Promise<{
93
+ manifest: XStateSourceCoverageManifest;
94
+ graph: XStateSourceCoverageGraph;
95
+ }>;
96
+ /** Boundary suggestions, not evidence: every candidate still needs execution. */
97
+ declare function getXStateSourceCoverageEventCases(manifest: XStateSourceCoverageManifest, state: {
98
+ context?: Record<string, unknown>;
99
+ }, seeds: readonly Record<string, unknown>[]): Record<string, unknown>[]; //#endregion
100
+ //#endregion
101
+ export { type XStateSourceCoverageControl, type XStateSourceCoverageGraph, type XStateSourceCoverageManifest, type XStateSourceCoverageObligation, createXStateSourceCoverageGraph, extractXStateSourceCoverage, getXStateSourceCoverageEventCases, instrumentXStateSourceCoverage };