@statelyai/sdk 0.7.1 → 0.8.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.
@@ -1,3 +1,5 @@
1
+ import { PREFIX } from "./protocol.mjs";
2
+
1
3
  //#region src/clientUtils.ts
2
4
  const jsonResultFormats = new Set([
3
5
  "digraph",
@@ -120,10 +122,6 @@ function toInitMessage(options) {
120
122
  };
121
123
  }
122
124
 
123
- //#endregion
124
- //#region src/protocol.ts
125
- const PREFIX = "@statelyai.";
126
-
127
125
  //#endregion
128
126
  //#region src/transport.ts
129
127
  function createPostMessageTransport(options) {
package/package.json CHANGED
@@ -1,10 +1,7 @@
1
1
  {
2
2
  "name": "@statelyai/sdk",
3
- "version": "0.7.1",
3
+ "version": "0.8.1",
4
4
  "license": "MIT",
5
- "bin": {
6
- "statelyai": "./dist/cli.mjs"
7
- },
8
5
  "files": [
9
6
  "dist",
10
7
  "schemas"
@@ -37,10 +34,6 @@
37
34
  "types": "./dist/sync.d.mts",
38
35
  "import": "./dist/sync.mjs"
39
36
  },
40
- "./cli": {
41
- "types": "./dist/cli.d.mts",
42
- "import": "./dist/cli.mjs"
43
- },
44
37
  "./studio": {
45
38
  "types": "./dist/studio.d.mts",
46
39
  "import": "./dist/studio.mjs"
@@ -53,13 +46,16 @@
53
46
  "types": "./dist/assetStorage.d.mts",
54
47
  "import": "./dist/assetStorage.mjs"
55
48
  },
49
+ "./protocol": {
50
+ "types": "./dist/protocol.d.mts",
51
+ "import": "./dist/protocol.mjs"
52
+ },
56
53
  "./statelyai.schema.json": "./schemas/statelyai.schema.json",
57
54
  "./schemas/statelyai.schema.json": "./schemas/statelyai.schema.json",
58
55
  "./xstate-json.schema.json": "./schemas/xstate-json.schema.json",
59
56
  "./schemas/xstate-json.schema.json": "./schemas/xstate-json.schema.json"
60
57
  },
61
58
  "dependencies": {
62
- "@oclif/core": "^4.10.3",
63
59
  "@statelyai/graph": "^0.9.0",
64
60
  "esbuild": "^0.27.0",
65
61
  "typescript": "^5.9.3",
@@ -71,15 +67,6 @@
71
67
  "tsdown": "0.21.0-beta.2",
72
68
  "vitest": "^3.2.4"
73
69
  },
74
- "oclif": {
75
- "bin": "statelyai",
76
- "commands": {
77
- "identifier": "COMMANDS",
78
- "strategy": "explicit",
79
- "target": "./dist/cli.mjs"
80
- },
81
- "topicSeparator": " "
82
- },
83
70
  "scripts": {
84
71
  "build": "tsdown",
85
72
  "test": "vitest run",
package/dist/cli.d.mts DELETED
@@ -1,203 +0,0 @@
1
- import { ConnectedRepo, CreateProjectInput, ProjectData, StudioClient } from "./studio.mjs";
2
- import { SyncPlan } from "./sync.mjs";
3
- import { Command } from "@oclif/core";
4
- import * as _oclif_core_interfaces0 from "@oclif/core/interfaces";
5
-
6
- //#region src/projectConfig.d.ts
7
- interface StatelySourceConfig {
8
- include: string[];
9
- exclude?: string[];
10
- format: 'xstate' | 'redux' | 'zustand' | 'xgraph' | 'digraph' | 'mermaid' | 'scxml' | 'xstate-json' | 'asl-json' | 'asl-yaml' | 'auto';
11
- xstateVersion?: number;
12
- }
13
- interface StatelyProjectConfig {
14
- $schema: string;
15
- version: string;
16
- projectId: string;
17
- studioUrl: string;
18
- defaultXStateVersion: number;
19
- sources: StatelySourceConfig[];
20
- }
21
- declare function createStatelyProjectConfig(options: {
22
- projectId: string;
23
- studioUrl: string;
24
- defaultXStateVersion?: number;
25
- }): StatelyProjectConfig;
26
- //#endregion
27
- //#region src/cli.d.ts
28
- interface InitProjectOptions {
29
- apiKey: string;
30
- baseUrl?: string;
31
- cwd?: string;
32
- client?: StudioClient;
33
- configPath?: string;
34
- defaultXStateVersion?: number;
35
- force?: boolean;
36
- project?: Partial<CreateProjectInput>;
37
- }
38
- interface InitProjectResult {
39
- config: StatelyProjectConfig;
40
- configPath: string;
41
- project: ProjectData;
42
- }
43
- interface ScanProjectSourcesOptions {
44
- cwd?: string;
45
- defaultXStateVersion?: number;
46
- }
47
- type ApiKeyResolution = {
48
- apiKey: string;
49
- detail: string;
50
- source: 'env' | 'flag' | 'stored';
51
- } | {
52
- apiKey?: undefined;
53
- detail?: undefined;
54
- source: 'missing';
55
- };
56
- declare function getEnvApiKey(): {
57
- apiKey: string;
58
- variable: 'NEXT_PUBLIC_STATELY_API_KEY' | 'STATELY_API_KEY';
59
- } | undefined;
60
- declare function resolveApiKey(explicitApiKey?: string): Promise<ApiKeyResolution>;
61
- declare function inferInitProjectName(cwd: string, repo?: ConnectedRepo): string;
62
- declare function initProject(options: InitProjectOptions): Promise<InitProjectResult>;
63
- declare function scanProjectSources(options: ScanProjectSourcesOptions): Promise<StatelySourceConfig[]>;
64
- declare function formatPlanSummary(plan: SyncPlan): string;
65
- declare abstract class BaseSyncCommand extends Command {
66
- static enableJsonFlag: boolean;
67
- static flags: {
68
- help: _oclif_core_interfaces0.BooleanFlag<void>;
69
- 'fail-on-changes': _oclif_core_interfaces0.BooleanFlag<boolean>;
70
- 'api-key': _oclif_core_interfaces0.OptionFlag<string | undefined, _oclif_core_interfaces0.CustomOptions>;
71
- 'base-url': _oclif_core_interfaces0.OptionFlag<string | undefined, _oclif_core_interfaces0.CustomOptions>;
72
- };
73
- }
74
- declare abstract class ParsedSyncCommand extends BaseSyncCommand {
75
- protected parseSync<T extends typeof BaseSyncCommand>(command: T): Promise<_oclif_core_interfaces0.ParserOutput<{
76
- help: void;
77
- 'fail-on-changes': boolean;
78
- 'api-key': string | undefined;
79
- 'base-url': string | undefined;
80
- }, {
81
- [flag: string]: any;
82
- }, {
83
- [arg: string]: any;
84
- }>>;
85
- }
86
- declare class PlanCommand extends ParsedSyncCommand {
87
- static summary: string;
88
- static description: string;
89
- static args: {
90
- source: _oclif_core_interfaces0.Arg<string, Record<string, unknown>>;
91
- target: _oclif_core_interfaces0.Arg<string, Record<string, unknown>>;
92
- };
93
- run(): Promise<void>;
94
- }
95
- declare class DiffCommand extends ParsedSyncCommand {
96
- static summary: string;
97
- static description: string;
98
- static args: {
99
- source: _oclif_core_interfaces0.Arg<string, Record<string, unknown>>;
100
- target: _oclif_core_interfaces0.Arg<string, Record<string, unknown>>;
101
- };
102
- run(): Promise<void>;
103
- }
104
- declare class PullCommand extends ParsedSyncCommand {
105
- static summary: string;
106
- static description: string;
107
- static args: {
108
- source: _oclif_core_interfaces0.Arg<string, Record<string, unknown>>;
109
- target: _oclif_core_interfaces0.Arg<string | undefined, Record<string, unknown>>;
110
- };
111
- run(): Promise<void>;
112
- }
113
- declare class PushCommand extends Command {
114
- static enableJsonFlag: boolean;
115
- static summary: string;
116
- static description: string;
117
- static args: {
118
- file: _oclif_core_interfaces0.Arg<string | undefined, Record<string, unknown>>;
119
- };
120
- static flags: {
121
- help: _oclif_core_interfaces0.BooleanFlag<void>;
122
- 'api-key': _oclif_core_interfaces0.OptionFlag<string | undefined, _oclif_core_interfaces0.CustomOptions>;
123
- 'base-url': _oclif_core_interfaces0.OptionFlag<string | undefined, _oclif_core_interfaces0.CustomOptions>;
124
- config: _oclif_core_interfaces0.OptionFlag<string | undefined, _oclif_core_interfaces0.CustomOptions>;
125
- };
126
- run(): Promise<void>;
127
- }
128
- declare class OpenCommand extends Command {
129
- static enableJsonFlag: boolean;
130
- static summary: string;
131
- static description: string;
132
- static args: {
133
- file: _oclif_core_interfaces0.Arg<string, Record<string, unknown>>;
134
- };
135
- static flags: {
136
- help: _oclif_core_interfaces0.BooleanFlag<void>;
137
- 'api-key': _oclif_core_interfaces0.OptionFlag<string | undefined, _oclif_core_interfaces0.CustomOptions>;
138
- 'editor-url': _oclif_core_interfaces0.OptionFlag<string | undefined, _oclif_core_interfaces0.CustomOptions>;
139
- host: _oclif_core_interfaces0.OptionFlag<string, _oclif_core_interfaces0.CustomOptions>;
140
- port: _oclif_core_interfaces0.OptionFlag<number, _oclif_core_interfaces0.CustomOptions>;
141
- open: _oclif_core_interfaces0.BooleanFlag<boolean>;
142
- debug: _oclif_core_interfaces0.BooleanFlag<boolean>;
143
- };
144
- run(): Promise<void>;
145
- }
146
- declare class InitCommand extends Command {
147
- static enableJsonFlag: boolean;
148
- static summary: string;
149
- static description: string;
150
- static flags: {
151
- help: _oclif_core_interfaces0.BooleanFlag<void>;
152
- 'api-key': _oclif_core_interfaces0.OptionFlag<string | undefined, _oclif_core_interfaces0.CustomOptions>;
153
- 'base-url': _oclif_core_interfaces0.OptionFlag<string | undefined, _oclif_core_interfaces0.CustomOptions>;
154
- name: _oclif_core_interfaces0.OptionFlag<string | undefined, _oclif_core_interfaces0.CustomOptions>;
155
- visibility: _oclif_core_interfaces0.OptionFlag<string, _oclif_core_interfaces0.CustomOptions>;
156
- force: _oclif_core_interfaces0.BooleanFlag<boolean>;
157
- scan: _oclif_core_interfaces0.BooleanFlag<boolean>;
158
- };
159
- run(): Promise<void>;
160
- }
161
- declare class LoginCommand extends Command {
162
- static enableJsonFlag: boolean;
163
- static summary: string;
164
- static description: string;
165
- static flags: {
166
- help: _oclif_core_interfaces0.BooleanFlag<void>;
167
- 'api-key': _oclif_core_interfaces0.OptionFlag<string | undefined, _oclif_core_interfaces0.CustomOptions>;
168
- stdin: _oclif_core_interfaces0.BooleanFlag<boolean>;
169
- };
170
- run(): Promise<void>;
171
- }
172
- declare class LogoutCommand extends Command {
173
- static enableJsonFlag: boolean;
174
- static summary: string;
175
- static description: string;
176
- static flags: {
177
- help: _oclif_core_interfaces0.BooleanFlag<void>;
178
- };
179
- run(): Promise<void>;
180
- }
181
- declare class AuthStatusCommand extends Command {
182
- static enableJsonFlag: boolean;
183
- static summary: string;
184
- static description: string;
185
- static flags: {
186
- help: _oclif_core_interfaces0.BooleanFlag<void>;
187
- };
188
- run(): Promise<void>;
189
- }
190
- declare const COMMANDS: {
191
- plan: typeof PlanCommand;
192
- diff: typeof DiffCommand;
193
- pull: typeof PullCommand;
194
- push: typeof PushCommand;
195
- open: typeof OpenCommand;
196
- init: typeof InitCommand;
197
- login: typeof LoginCommand;
198
- logout: typeof LogoutCommand;
199
- 'auth:status': typeof AuthStatusCommand;
200
- };
201
- declare function run(argv?: string[], entryUrl?: string): Promise<void>;
202
- //#endregion
203
- export { ApiKeyResolution, COMMANDS, InitProjectOptions, InitProjectResult, ScanProjectSourcesOptions, createStatelyProjectConfig, formatPlanSummary, getEnvApiKey, inferInitProjectName, initProject, resolveApiKey, run, scanProjectSources };