statelyai 0.15.0 → 0.15.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/bin.mjs CHANGED
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- import { C as run } from "./cli-hfhCVqEx.mjs";
2
+ import { C as run } from "./cli-CE7KhcOJ.mjs";
3
3
 
4
4
  //#region src/bin.ts
5
5
  run();
@@ -31,7 +31,7 @@ var __commonJSMin$1 = (cb, mod) => () => (mod || cb((mod = { exports: {} }).expo
31
31
 
32
32
  //#endregion
33
33
  //#region src/version.ts
34
- const CLI_VERSION = "0.15.0";
34
+ const CLI_VERSION = "0.15.1";
35
35
 
36
36
  //#endregion
37
37
  //#region src/behaviorCi.ts
@@ -5601,7 +5601,185 @@ function createMachine(config, implementations) {
5601
5601
  }
5602
5602
 
5603
5603
  //#endregion
5604
- //#region ../graph-tools/dist/validation-Ci3ri12U.mjs
5604
+ //#region ../graph-tools/dist/validation-D8ipdyfF.mjs
5605
+ function resolveProfileData(data, namespace) {
5606
+ const prefix = `${namespace}.`;
5607
+ return Object.fromEntries(Object.entries(data).filter(([key]) => key.startsWith(prefix)).map(([key, value]) => [key.slice(prefix.length), value]));
5608
+ }
5609
+ const ARCHITECTURE_PROFILE = "@statelyai/architecture@1.0.0";
5610
+ const ARCHITECTURE_NAMESPACE = "@statelyai.architecture";
5611
+ const architectureTargetSchema = z.discriminatedUnion("kind", [z.object({
5612
+ kind: z.literal("machine"),
5613
+ machineId: z.string().min(1),
5614
+ projectId: z.string().min(1).optional()
5615
+ }), z.object({
5616
+ kind: z.literal("view"),
5617
+ viewId: z.string().min(1)
5618
+ })]);
5619
+ const architectureViewSchema = z.object({
5620
+ id: z.string().min(1),
5621
+ name: z.string().min(1),
5622
+ kind: z.enum([
5623
+ "system-context",
5624
+ "container",
5625
+ "component",
5626
+ "custom"
5627
+ ]),
5628
+ nodeIds: z.array(z.string()),
5629
+ edgeIds: z.array(z.string())
5630
+ });
5631
+ const architectureGraphDataSchema = z.object({
5632
+ version: z.literal(1),
5633
+ views: z.array(architectureViewSchema),
5634
+ activeViewId: z.string().optional(),
5635
+ projectOverview: z.boolean().optional()
5636
+ });
5637
+ const architectureNodeDataSchema = z.object({
5638
+ kind: z.string().optional(),
5639
+ externalId: z.string().optional(),
5640
+ technology: z.string().optional(),
5641
+ target: architectureTargetSchema.optional()
5642
+ });
5643
+ const architectureEdgeDataSchema = z.object({
5644
+ kind: z.string().optional(),
5645
+ externalId: z.string().optional(),
5646
+ technology: z.string().optional()
5647
+ });
5648
+ function architectureData(data) {
5649
+ return resolveProfileData(Object.fromEntries(Object.entries(data)), ARCHITECTURE_NAMESPACE);
5650
+ }
5651
+ function getArchitectureNodeData(node) {
5652
+ const data = architectureData(node.data);
5653
+ if (!Object.keys(data).length) return void 0;
5654
+ const parsed = architectureNodeDataSchema.safeParse(data);
5655
+ return parsed.success ? parsed.data : void 0;
5656
+ }
5657
+ const jsonSchema7Schema = z.lazy(() => z.object({
5658
+ $schema: z.string().optional(),
5659
+ type: z.enum([
5660
+ "object",
5661
+ "array",
5662
+ "string",
5663
+ "number",
5664
+ "integer",
5665
+ "boolean",
5666
+ "null"
5667
+ ]).optional(),
5668
+ properties: z.record(z.string(), jsonSchema7Schema).optional(),
5669
+ items: jsonSchema7Schema.optional(),
5670
+ additionalProperties: z.union([z.boolean(), jsonSchema7Schema]).optional(),
5671
+ required: z.array(z.string()).optional(),
5672
+ anyOf: z.array(jsonSchema7Schema).optional(),
5673
+ oneOf: z.array(jsonSchema7Schema).optional(),
5674
+ enum: z.array(z.union([
5675
+ z.string(),
5676
+ z.number(),
5677
+ z.boolean(),
5678
+ z.null()
5679
+ ])).optional(),
5680
+ const: z.union([
5681
+ z.string(),
5682
+ z.number(),
5683
+ z.boolean(),
5684
+ z.null()
5685
+ ]).optional(),
5686
+ minLength: z.number().optional()
5687
+ }).strict());
5688
+ function draft7Schema(schema) {
5689
+ return jsonSchema7Schema.parse(z.toJSONSchema(schema, { target: "draft-7" }));
5690
+ }
5691
+ const ARCHITECTURE_PROFILE_MANIFEST = {
5692
+ profile: ARCHITECTURE_PROFILE,
5693
+ namespace: ARCHITECTURE_NAMESPACE,
5694
+ lineage: "@statelyai/architecture",
5695
+ projection: {
5696
+ readOnlyPaths: [
5697
+ "initialNodeId",
5698
+ "nodes.*.initialNodeId",
5699
+ "nodes.*.data.initialId",
5700
+ "nodes.*.data.entry",
5701
+ "nodes.*.data.exit",
5702
+ "nodes.*.data.invokes",
5703
+ "nodes.*.data.history",
5704
+ "edges.*.data.guard",
5705
+ "edges.*.data.actions",
5706
+ "edges.*.data.transitionType"
5707
+ ],
5708
+ adapt: (graph) => ({ data: {
5709
+ nodes: Object.fromEntries(graph.nodes.map((node) => [node.id, { kind: getArchitectureNodeData(node)?.kind ?? "component" }])),
5710
+ edges: Object.fromEntries(graph.edges.map((edge) => [edge.id, { kind: "relationship" }]))
5711
+ } }),
5712
+ analyzeCompatibility: (graph) => graph.nodes.some((node) => node.data.initialId || Array.isArray(node.data.entry) && node.data.entry.length || Array.isArray(node.data.exit) && node.data.exit.length || Array.isArray(node.data.invokes) && node.data.invokes.length) || graph.edges.some((edge) => edge.data.guard || Array.isArray(edge.data.actions) && edge.data.actions.length || edge.data.transitionType && edge.data.transitionType !== "normal") ? [{
5713
+ level: "warning",
5714
+ message: "State-machine initial states, effects, guards and transition behavior are retained but read-only in Architecture. Relationships describe structure; architecture simulation is unavailable."
5715
+ }] : []
5716
+ },
5717
+ name: "Architecture",
5718
+ description: "Components, relationships, and navigable system views.",
5719
+ selectable: true,
5720
+ restrictFormatsToListed: true,
5721
+ defaultFormat: "xgraph",
5722
+ graph: { dataSchema: draft7Schema(architectureGraphDataSchema) },
5723
+ authoring: {
5724
+ terminology: {
5725
+ node: "component",
5726
+ edge: "relationship",
5727
+ graph: "architecture"
5728
+ },
5729
+ nodeTypes: [
5730
+ "element",
5731
+ "actor",
5732
+ "person",
5733
+ "system",
5734
+ "container",
5735
+ "component",
5736
+ "service",
5737
+ "database",
5738
+ "queue",
5739
+ "group",
5740
+ "junction"
5741
+ ].map((kind) => ({
5742
+ kind,
5743
+ label: kind.charAt(0).toUpperCase() + kind.slice(1),
5744
+ authorable: true,
5745
+ canContain: true,
5746
+ dataSchema: draft7Schema(architectureNodeDataSchema)
5747
+ })),
5748
+ edgeTypes: [{
5749
+ kind: "relationship",
5750
+ label: "Relationship",
5751
+ authorable: true,
5752
+ dataSchema: draft7Schema(architectureEdgeDataSchema)
5753
+ }],
5754
+ attachments: {
5755
+ actions: false,
5756
+ guards: false,
5757
+ invokes: false,
5758
+ tags: false
5759
+ },
5760
+ supportsInitialNode: false,
5761
+ supportsTargetlessEdges: false,
5762
+ supportsReenterEdges: false
5763
+ },
5764
+ operations: {
5765
+ simulate: false,
5766
+ validate: true,
5767
+ export: true
5768
+ },
5769
+ formats: [{
5770
+ format: "xgraph",
5771
+ import: true,
5772
+ export: true
5773
+ }, ...[
5774
+ "structurizr-json",
5775
+ "d2",
5776
+ "mermaid"
5777
+ ].map((format) => ({
5778
+ format,
5779
+ import: true,
5780
+ export: false
5781
+ }))]
5782
+ };
5605
5783
  const XSTATE_V5_PROFILE = "@statelyai/xstate@5.30.0";
5606
5784
  const XSTATE_V6_PROFILE = "@statelyai/xstate@6.0.0-alpha.51";
5607
5785
  const XSTATE_V6_BRANCH_DESCRIPTION_META = "@statelyai.branchDescription";
@@ -6857,7 +7035,11 @@ const XSTATE_PROFILE_MANIFESTS = [{
6857
7035
  export: true
6858
7036
  }
6859
7037
  }];
6860
- const PROFILE_MANIFESTS = new Map([...XSTATE_PROFILE_MANIFESTS, LANGGRAPH_PROFILE_MANIFEST].map((manifest) => [manifest.profile, manifest]));
7038
+ const PROFILE_MANIFESTS = new Map([
7039
+ ...XSTATE_PROFILE_MANIFESTS,
7040
+ LANGGRAPH_PROFILE_MANIFEST,
7041
+ ARCHITECTURE_PROFILE_MANIFEST
7042
+ ].map((manifest) => [manifest.profile, manifest]));
6861
7043
  function getProfileManifest(profile) {
6862
7044
  return PROFILE_MANIFESTS.get(profile);
6863
7045
  }
@@ -13227,6 +13409,14 @@ function builtInActionFromCall(call, bindings, context, depth) {
13227
13409
  ...options(2)
13228
13410
  }
13229
13411
  };
13412
+ case "sendParent": return {
13413
+ type: "xstate.sendTo",
13414
+ params: {
13415
+ to: "#_parent",
13416
+ event: value(0),
13417
+ ...options(1)
13418
+ }
13419
+ };
13230
13420
  case "emit": return {
13231
13421
  type: "xstate.emit",
13232
13422
  params: { event: value(0) }
package/dist/index.mjs CHANGED
@@ -1,3 +1,3 @@
1
- import { A as formatVerificationJUnit, B as calibrateBehavior, C as run, D as resourceId, E as linkProject, F as readGraphFile, I as verifyReport, L as adoptBehavior, M as briefReport, N as changesReport, O as resolveVerificationRequest, P as pendingReport, R as behaviorCiConfigSchema, S as resolveProjectStatus, T as scanProjectSources, V as checkBehavior, _ as isFileGitDirty, a as discoverMachinesInSource, b as resolveCredentialStatus, c as formatDiscoveredMachines, d as formatProjectStatus, f as formatStoredCredentialSource, g as initProject, h as inferInitProjectName, i as discoverLinkedPullTargets, j as createStatelyProjectConfig, k as verifyProject, l as formatMissingNewMachineDirMessage, m as getEnvCredential, n as buildOAuthLoginStart, o as discoverOAuthLogin, p as getEnvApiKey, r as classifyPushCandidates, s as discoverRemoteProjectMachineTargets, t as COMMANDS, u as formatPlanSummary, v as resolveApiKey, w as scanProjectMachines, x as resolveOpenRootDir, y as resolveConfiguredPullTargets, z as behaviorCiResultsSchema } from "./cli-hfhCVqEx.mjs";
1
+ import { A as formatVerificationJUnit, B as calibrateBehavior, C as run, D as resourceId, E as linkProject, F as readGraphFile, I as verifyReport, L as adoptBehavior, M as briefReport, N as changesReport, O as resolveVerificationRequest, P as pendingReport, R as behaviorCiConfigSchema, S as resolveProjectStatus, T as scanProjectSources, V as checkBehavior, _ as isFileGitDirty, a as discoverMachinesInSource, b as resolveCredentialStatus, c as formatDiscoveredMachines, d as formatProjectStatus, f as formatStoredCredentialSource, g as initProject, h as inferInitProjectName, i as discoverLinkedPullTargets, j as createStatelyProjectConfig, k as verifyProject, l as formatMissingNewMachineDirMessage, m as getEnvCredential, n as buildOAuthLoginStart, o as discoverOAuthLogin, p as getEnvApiKey, r as classifyPushCandidates, s as discoverRemoteProjectMachineTargets, t as COMMANDS, u as formatPlanSummary, v as resolveApiKey, w as scanProjectMachines, x as resolveOpenRootDir, y as resolveConfiguredPullTargets, z as behaviorCiResultsSchema } from "./cli-CE7KhcOJ.mjs";
2
2
 
3
3
  export { COMMANDS, adoptBehavior, behaviorCiConfigSchema, behaviorCiResultsSchema, briefReport, buildOAuthLoginStart, calibrateBehavior, changesReport, checkBehavior, classifyPushCandidates, createStatelyProjectConfig, discoverLinkedPullTargets, discoverMachinesInSource, discoverOAuthLogin, discoverRemoteProjectMachineTargets, formatDiscoveredMachines, formatMissingNewMachineDirMessage, formatPlanSummary, formatProjectStatus, formatStoredCredentialSource, formatVerificationJUnit, getEnvApiKey, getEnvCredential, inferInitProjectName, initProject, isFileGitDirty, linkProject, pendingReport, readGraphFile, resolveApiKey, resolveConfiguredPullTargets, resolveCredentialStatus, resolveOpenRootDir, resolveProjectStatus, resolveVerificationRequest, resourceId, run, scanProjectMachines, scanProjectSources, verifyProject, verifyReport };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "statelyai",
3
- "version": "0.15.0",
3
+ "version": "0.15.1",
4
4
  "description": "Command-line tools for Stately",
5
5
  "license": "MIT",
6
6
  "bin": {
@@ -24,7 +24,7 @@
24
24
  "typescript": "^5.9.3",
25
25
  "ws": "^8.21.0",
26
26
  "zod": "^4.4.1",
27
- "@statelyai/mcp": "0.19.0",
27
+ "@statelyai/mcp": "0.20.0",
28
28
  "@statelyai/sdk": "0.39.1",
29
29
  "@statelyai/model-testing": "0.2.0"
30
30
  },
@@ -32,8 +32,8 @@
32
32
  "@types/ws": "^8.18.1",
33
33
  "tsdown": "0.21.0-beta.2",
34
34
  "vitest": "^3.2.4",
35
- "@statelyai/api-contract": "0.8.0",
36
- "@statelyai/editor-sync": "0.2.5"
35
+ "@statelyai/api-contract": "0.9.0",
36
+ "@statelyai/editor-sync": "0.2.6"
37
37
  },
38
38
  "oclif": {
39
39
  "bin": "statelyai",