@statelyai/graph 0.10.0 → 0.11.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 (48) hide show
  1. package/dist/{algorithms-C-S7u40k.mjs → algorithms-BHHg7lGq.mjs} +1509 -2132
  2. package/dist/algorithms-BlM-qoJb.d.mts +178 -0
  3. package/dist/algorithms.d.mts +1 -1
  4. package/dist/algorithms.mjs +1 -1
  5. package/dist/{converter-B5CUD0r9.mjs → converter-Dspillnn.mjs} +2 -2
  6. package/dist/format-support.d.mts +22 -0
  7. package/dist/format-support.mjs +294 -0
  8. package/dist/formats/adjacency-list/index.d.mts +1 -1
  9. package/dist/formats/adjacency-list/index.mjs +1 -1
  10. package/dist/formats/converter/index.d.mts +1 -1
  11. package/dist/formats/converter/index.mjs +1 -1
  12. package/dist/formats/cytoscape/index.d.mts +1 -1
  13. package/dist/formats/cytoscape/index.mjs +1 -1
  14. package/dist/formats/d3/index.d.mts +1 -1
  15. package/dist/formats/d3/index.mjs +1 -1
  16. package/dist/formats/dot/index.d.mts +1 -1
  17. package/dist/formats/dot/index.mjs +1 -1
  18. package/dist/formats/edge-list/index.d.mts +1 -1
  19. package/dist/formats/edge-list/index.mjs +1 -1
  20. package/dist/formats/elk/index.d.mts +1 -1
  21. package/dist/formats/gexf/index.d.mts +1 -1
  22. package/dist/formats/gexf/index.mjs +1 -1
  23. package/dist/formats/gml/index.d.mts +1 -1
  24. package/dist/formats/gml/index.mjs +1 -1
  25. package/dist/formats/graphml/index.d.mts +1 -1
  26. package/dist/formats/graphml/index.mjs +1 -1
  27. package/dist/formats/jgf/index.d.mts +1 -1
  28. package/dist/formats/jgf/index.mjs +1 -1
  29. package/dist/formats/mermaid/index.d.mts +1 -1
  30. package/dist/formats/mermaid/index.mjs +1 -1
  31. package/dist/formats/tgf/index.d.mts +1 -1
  32. package/dist/formats/tgf/index.mjs +1 -1
  33. package/dist/formats/xyflow/index.d.mts +1 -1
  34. package/dist/index.d.mts +2 -2
  35. package/dist/index.mjs +3 -3
  36. package/dist/queries.d.mts +1 -1
  37. package/dist/queries.mjs +1 -1
  38. package/dist/schemas.d.mts +50 -1
  39. package/dist/schemas.mjs +21 -2
  40. package/package.json +5 -2
  41. package/schemas/edge.schema.json +16 -1
  42. package/schemas/graph.schema.json +72 -3
  43. package/schemas/node.schema.json +56 -1
  44. package/dist/algorithms-DdjFO-ft.d.mts +0 -787
  45. /package/dist/{adjacency-list-fldj-QAL.mjs → adjacency-list-Ca0VjKIf.mjs} +0 -0
  46. /package/dist/{edge-list-Br05wXMg.mjs → edge-list-gKe8-iRa.mjs} +0 -0
  47. /package/dist/{indexing-DyfgLuzw.mjs → indexing-CJc-ul8e.mjs} +0 -0
  48. /package/dist/{types-F3j-sr2X.d.mts → types-CnZ01raw.d.mts} +0 -0
@@ -1,4 +1,4 @@
1
- import { h as GraphFormatConverter, u as Graph } from "../../types-F3j-sr2X.mjs";
1
+ import { h as GraphFormatConverter, u as Graph } from "../../types-CnZ01raw.mjs";
2
2
 
3
3
  //#region src/formats/jgf/index.d.ts
4
4
  interface JGFNode {
@@ -1,4 +1,4 @@
1
- import { n as createFormatConverter } from "../../converter-B5CUD0r9.mjs";
1
+ import { n as createFormatConverter } from "../../converter-Dspillnn.mjs";
2
2
 
3
3
  //#region src/formats/jgf/index.ts
4
4
  /**
@@ -1,4 +1,4 @@
1
- import { h as GraphFormatConverter, u as Graph } from "../../types-F3j-sr2X.mjs";
1
+ import { h as GraphFormatConverter, u as Graph } from "../../types-CnZ01raw.mjs";
2
2
 
3
3
  //#region src/formats/mermaid/sequence.d.ts
4
4
  interface SequenceNodeData {
@@ -1,4 +1,4 @@
1
- import { n as createFormatConverter } from "../../converter-B5CUD0r9.mjs";
1
+ import { n as createFormatConverter } from "../../converter-Dspillnn.mjs";
2
2
 
3
3
  //#region src/formats/mermaid/shared.ts
4
4
  const MERMAID_TO_DIRECTION = {
@@ -1,4 +1,4 @@
1
- import { h as GraphFormatConverter, u as Graph } from "../../types-F3j-sr2X.mjs";
1
+ import { h as GraphFormatConverter, u as Graph } from "../../types-CnZ01raw.mjs";
2
2
 
3
3
  //#region src/formats/tgf/index.d.ts
4
4
 
@@ -1,4 +1,4 @@
1
- import { n as createFormatConverter } from "../../converter-B5CUD0r9.mjs";
1
+ import { n as createFormatConverter } from "../../converter-Dspillnn.mjs";
2
2
 
3
3
  //#region src/formats/tgf/index.ts
4
4
  /**
@@ -1,4 +1,4 @@
1
- import { P as VisualGraphFormatConverter, j as VisualGraph } from "../../types-F3j-sr2X.mjs";
1
+ import { P as VisualGraphFormatConverter, j as VisualGraph } from "../../types-CnZ01raw.mjs";
2
2
  import { EdgeBase, NodeBase } from "@xyflow/system";
3
3
 
4
4
  //#region src/formats/xyflow/index.d.ts
package/dist/index.d.mts CHANGED
@@ -1,5 +1,5 @@
1
- import { A as VisualEdge, C as NodeConfig, D as SinglePathOptions, E as PortDirection, F as VisualNode, I as VisualPort, L as WalkContext, M as VisualGraphConfig, N as VisualGraphEntity, O as TransitionOptions, P as VisualGraphFormatConverter, R as WalkOptions, S as NodeChange, T as PortConfig, _ as GraphPatch, a as EdgeChange, b as GraphStep, c as EntitiesUpdate, d as GraphConfig, f as GraphDiff, g as GraphNode, h as GraphFormatConverter, i as DeleteNodeOptions, j as VisualGraph, k as TraversalOptions, l as EntityRect, m as GraphEntity, n as AllPairsShortestPathsOptions, o as EdgeConfig, p as GraphEdge, r as CoverageStats, s as EntitiesConfig, t as AStarOptions, u as Graph, v as GraphPath, w as PathOptions, x as MSTOptions, y as GraphPort, z as WeightedWalkOptions } from "./types-F3j-sr2X.mjs";
2
- import { A as getArticulationPoints, B as HITSResult, C as hasPath, D as joinPaths, E as isTree, F as genGirvanNewmanCommunities, G as getEigenvectorCentrality, H as getBetweennessCentrality, I as getGirvanNewmanCommunities, J as getOutDegreeCentrality, K as getHITS, L as getGreedyModularityCommunities, M as getBridges, N as GirvanNewmanOptions, O as IsomorphismOptions, P as LabelPropagationOptions, R as getLabelPropagationCommunities, S as getTopologicalSort, T as isConnected, U as getClosenessCentrality, V as IterativeCentralityOptions, W as getDegreeCentrality, Y as getPageRank, _ as getShortestPath, a as genPreorders, b as getSimplePaths, c as getAStarPath, d as getCycles, f as getMinimumSpanningTree, g as getPreorders, h as getPreorder, i as genPostorders, j as getBiconnectedComponents, k as isIsomorphic, l as getAllPairsShortestPaths, m as getPostorders, n as dfs, o as genShortestPaths, p as getPostorder, q as getInDegreeCentrality, r as genCycles, s as genSimplePaths, t as bfs, u as getConnectedComponents, v as getShortestPaths, w as isAcyclic, x as getStronglyConnectedComponents, y as getSimplePath, z as getModularity } from "./algorithms-DdjFO-ft.mjs";
1
+ import { A as VisualEdge, C as NodeConfig, D as SinglePathOptions, E as PortDirection, F as VisualNode, I as VisualPort, L as WalkContext, M as VisualGraphConfig, N as VisualGraphEntity, O as TransitionOptions, P as VisualGraphFormatConverter, R as WalkOptions, S as NodeChange, T as PortConfig, _ as GraphPatch, a as EdgeChange, b as GraphStep, c as EntitiesUpdate, d as GraphConfig, f as GraphDiff, g as GraphNode, h as GraphFormatConverter, i as DeleteNodeOptions, j as VisualGraph, k as TraversalOptions, l as EntityRect, m as GraphEntity, n as AllPairsShortestPathsOptions, o as EdgeConfig, p as GraphEdge, r as CoverageStats, s as EntitiesConfig, t as AStarOptions, u as Graph, v as GraphPath, w as PathOptions, x as MSTOptions, y as GraphPort, z as WeightedWalkOptions } from "./types-CnZ01raw.mjs";
2
+ import { A as genCycles, B as getStronglyConnectedComponents, C as getMinimumSpanningTree, D as getPostorders, E as getPostorder, F as getCycles, G as getTopologicalSort, H as bfs, I as getShortestPath, J as isConnected, K as hasPath, L as getShortestPaths, M as genSimplePaths, N as getAStarPath, O as getPreorder, P as getAllPairsShortestPaths, R as getSimplePath, S as getPageRank, T as genPreorders, U as dfs, V as joinPaths, W as getConnectedComponents, Y as isTree, _ as getDegreeCentrality, a as getBridges, b as getInDegreeCentrality, c as genGirvanNewmanCommunities, d as getLabelPropagationCommunities, f as getModularity, g as getClosenessCentrality, h as getBetweennessCentrality, i as getBiconnectedComponents, j as genShortestPaths, k as getPreorders, l as getGirvanNewmanCommunities, m as IterativeCentralityOptions, n as isIsomorphic, o as GirvanNewmanOptions, p as HITSResult, q as isAcyclic, r as getArticulationPoints, s as LabelPropagationOptions, t as IsomorphismOptions, u as getGreedyModularityCommunities, v as getEigenvectorCentrality, w as genPostorders, x as getOutDegreeCentrality, y as getHITS, z as getSimplePaths } from "./algorithms-BlM-qoJb.mjs";
3
3
  import { createFormatConverter } from "./formats/converter/index.mjs";
4
4
  import { getAncestors, getChildren, getDegree, getDepth, getDescendants, getEdgesBetween, getEdgesByPort, getEdgesOf, getInDegree, getInEdges, getLCA, getNeighbors, getOutDegree, getOutEdges, getParent, getPort, getPorts, getPredecessors, getRelativeDistance, getRelativeDistanceMap, getRoots, getSiblings, getSinks, getSources, getSuccessors, isCompound, isLeaf } from "./queries.mjs";
5
5
 
package/dist/index.mjs CHANGED
@@ -1,7 +1,7 @@
1
- import { o as invalidateIndex, t as getIndex } from "./indexing-DyfgLuzw.mjs";
2
- import { $ as createGraphPort, A as getBiconnectedComponents, B as getEigenvectorCentrality, C as hasPath, D as joinPaths, E as isTree, F as getLabelPropagationCommunities, G as GraphInstance, H as getInDegreeCentrality, I as getModularity, J as addNode, K as addEdge, L as getBetweennessCentrality, M as genGirvanNewmanCommunities, N as getGirvanNewmanCommunities, O as isIsomorphic, P as getGreedyModularityCommunities, Q as createGraphNode, R as getClosenessCentrality, S as getTopologicalSort, T as isConnected, U as getOutDegreeCentrality, V as getHITS, W as getPageRank, X as createGraphEdge, Y as createGraph, Z as createGraphFromTransition, _ as getShortestPath, a as genPreorders, at as getNode, b as getSimplePaths, c as getAStarPath, ct as updateEdge, d as getCycles, et as createVisualGraph, f as getMinimumSpanningTree, g as getPreorders, h as getPreorder, i as genPostorders, it as getEdge, j as getBridges, k as getArticulationPoints, l as getAllPairsShortestPaths, lt as updateEntities, m as getPostorders, n as dfs, nt as deleteEntities, o as genShortestPaths, ot as hasEdge, p as getPostorder, q as addEntities, r as genCycles, rt as deleteNode, s as genSimplePaths, st as hasNode, t as bfs, tt as deleteEdge, u as getConnectedComponents, ut as updateNode, v as getShortestPaths, w as isAcyclic, x as getStronglyConnectedComponents, y as getSimplePath, z as getDegreeCentrality } from "./algorithms-C-S7u40k.mjs";
1
+ import { o as invalidateIndex, t as getIndex } from "./indexing-CJc-ul8e.mjs";
2
+ import { $ as createGraphPort, A as isAcyclic, B as getShortestPaths, C as getPreorder, D as getConnectedComponents, E as dfs, F as genSimplePaths, G as GraphInstance, H as getSimplePaths, I as getAStarPath, J as addNode, K as addEdge, L as getAllPairsShortestPaths, M as isTree, N as genCycles, O as getTopologicalSort, P as genShortestPaths, Q as createGraphNode, R as getCycles, S as getPostorders, T as bfs, U as getStronglyConnectedComponents, V as getSimplePath, W as joinPaths, X as createGraphEdge, Y as createGraph, Z as createGraphFromTransition, _ as getPageRank, a as genGirvanNewmanCommunities, at as getNode, b as genPreorders, c as getLabelPropagationCommunities, ct as updateEdge, d as getClosenessCentrality, et as createVisualGraph, f as getDegreeCentrality, g as getOutDegreeCentrality, h as getInDegreeCentrality, i as getBridges, it as getEdge, j as isConnected, k as hasPath, l as getModularity, lt as updateEntities, m as getHITS, n as getArticulationPoints, nt as deleteEntities, o as getGirvanNewmanCommunities, ot as hasEdge, p as getEigenvectorCentrality, q as addEntities, r as getBiconnectedComponents, rt as deleteNode, s as getGreedyModularityCommunities, st as hasNode, t as isIsomorphic, tt as deleteEdge, u as getBetweennessCentrality, ut as updateNode, v as getMinimumSpanningTree, w as getPreorders, x as getPostorder, y as genPostorders, z as getShortestPath } from "./algorithms-BHHg7lGq.mjs";
3
3
  import { getAncestors, getChildren, getDegree, getDepth, getDescendants, getEdgesBetween, getEdgesByPort, getEdgesOf, getInDegree, getInEdges, getLCA, getNeighbors, getOutDegree, getOutEdges, getParent, getPort, getPorts, getPredecessors, getRelativeDistance, getRelativeDistanceMap, getRoots, getSiblings, getSinks, getSources, getSuccessors, isCompound, isLeaf } from "./queries.mjs";
4
- import { n as createFormatConverter } from "./converter-B5CUD0r9.mjs";
4
+ import { n as createFormatConverter } from "./converter-Dspillnn.mjs";
5
5
 
6
6
  //#region src/equivalence.ts
7
7
  /** Shallow-compare two values, returning true if they differ. */
@@ -1,4 +1,4 @@
1
- import { g as GraphNode, p as GraphEdge, u as Graph, y as GraphPort } from "./types-F3j-sr2X.mjs";
1
+ import { g as GraphNode, p as GraphEdge, u as Graph, y as GraphPort } from "./types-CnZ01raw.mjs";
2
2
 
3
3
  //#region src/queries.d.ts
4
4
 
package/dist/queries.mjs CHANGED
@@ -1,4 +1,4 @@
1
- import { t as getIndex } from "./indexing-DyfgLuzw.mjs";
1
+ import { t as getIndex } from "./indexing-CJc-ul8e.mjs";
2
2
 
3
3
  //#region src/queries.ts
4
4
  /**
@@ -1,6 +1,21 @@
1
1
  import * as z from "zod";
2
2
 
3
3
  //#region src/schemas.d.ts
4
+ declare const PortSchema: z.ZodObject<{
5
+ name: z.ZodString;
6
+ direction: z.ZodOptional<z.ZodEnum<{
7
+ in: "in";
8
+ out: "out";
9
+ inout: "inout";
10
+ }>>;
11
+ label: z.ZodOptional<z.ZodString>;
12
+ data: z.ZodAny;
13
+ x: z.ZodOptional<z.ZodNumber>;
14
+ y: z.ZodOptional<z.ZodNumber>;
15
+ width: z.ZodOptional<z.ZodNumber>;
16
+ height: z.ZodOptional<z.ZodNumber>;
17
+ style: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>>>;
18
+ }, z.core.$strip>;
4
19
  declare const NodeSchema: z.ZodObject<{
5
20
  type: z.ZodLiteral<"node">;
6
21
  id: z.ZodString;
@@ -15,6 +30,21 @@ declare const NodeSchema: z.ZodObject<{
15
30
  shape: z.ZodOptional<z.ZodString>;
16
31
  color: z.ZodOptional<z.ZodString>;
17
32
  style: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>>>;
33
+ ports: z.ZodOptional<z.ZodArray<z.ZodObject<{
34
+ name: z.ZodString;
35
+ direction: z.ZodOptional<z.ZodEnum<{
36
+ in: "in";
37
+ out: "out";
38
+ inout: "inout";
39
+ }>>;
40
+ label: z.ZodOptional<z.ZodString>;
41
+ data: z.ZodAny;
42
+ x: z.ZodOptional<z.ZodNumber>;
43
+ y: z.ZodOptional<z.ZodNumber>;
44
+ width: z.ZodOptional<z.ZodNumber>;
45
+ height: z.ZodOptional<z.ZodNumber>;
46
+ style: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>>>;
47
+ }, z.core.$strip>>>;
18
48
  }, z.core.$strip>;
19
49
  declare const EdgeSchema: z.ZodObject<{
20
50
  type: z.ZodLiteral<"edge">;
@@ -23,6 +53,8 @@ declare const EdgeSchema: z.ZodObject<{
23
53
  targetId: z.ZodString;
24
54
  label: z.ZodOptional<z.ZodNullable<z.ZodString>>;
25
55
  weight: z.ZodOptional<z.ZodNumber>;
56
+ sourcePort: z.ZodOptional<z.ZodString>;
57
+ targetPort: z.ZodOptional<z.ZodString>;
26
58
  data: z.ZodAny;
27
59
  x: z.ZodOptional<z.ZodNumber>;
28
60
  y: z.ZodOptional<z.ZodNumber>;
@@ -52,6 +84,21 @@ declare const GraphSchema: z.ZodObject<{
52
84
  shape: z.ZodOptional<z.ZodString>;
53
85
  color: z.ZodOptional<z.ZodString>;
54
86
  style: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>>>;
87
+ ports: z.ZodOptional<z.ZodArray<z.ZodObject<{
88
+ name: z.ZodString;
89
+ direction: z.ZodOptional<z.ZodEnum<{
90
+ in: "in";
91
+ out: "out";
92
+ inout: "inout";
93
+ }>>;
94
+ label: z.ZodOptional<z.ZodString>;
95
+ data: z.ZodAny;
96
+ x: z.ZodOptional<z.ZodNumber>;
97
+ y: z.ZodOptional<z.ZodNumber>;
98
+ width: z.ZodOptional<z.ZodNumber>;
99
+ height: z.ZodOptional<z.ZodNumber>;
100
+ style: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>>>;
101
+ }, z.core.$strip>>>;
55
102
  }, z.core.$strip>>;
56
103
  edges: z.ZodArray<z.ZodObject<{
57
104
  type: z.ZodLiteral<"edge">;
@@ -60,6 +107,8 @@ declare const GraphSchema: z.ZodObject<{
60
107
  targetId: z.ZodString;
61
108
  label: z.ZodOptional<z.ZodNullable<z.ZodString>>;
62
109
  weight: z.ZodOptional<z.ZodNumber>;
110
+ sourcePort: z.ZodOptional<z.ZodString>;
111
+ targetPort: z.ZodOptional<z.ZodString>;
63
112
  data: z.ZodAny;
64
113
  x: z.ZodOptional<z.ZodNumber>;
65
114
  y: z.ZodOptional<z.ZodNumber>;
@@ -78,4 +127,4 @@ declare const GraphSchema: z.ZodObject<{
78
127
  style: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>>>;
79
128
  }, z.core.$strip>;
80
129
  //#endregion
81
- export { EdgeSchema, GraphSchema, NodeSchema };
130
+ export { EdgeSchema, GraphSchema, NodeSchema, PortSchema };
package/dist/schemas.mjs CHANGED
@@ -2,6 +2,22 @@ import * as z from "zod";
2
2
 
3
3
  //#region src/schemas.ts
4
4
  const StyleSchema = z.record(z.string(), z.union([z.string(), z.number()]));
5
+ const PortDirectionSchema = z.enum([
6
+ "in",
7
+ "out",
8
+ "inout"
9
+ ]);
10
+ const PortSchema = z.object({
11
+ name: z.string(),
12
+ direction: PortDirectionSchema.optional(),
13
+ label: z.string().optional(),
14
+ data: z.any(),
15
+ x: z.number().optional(),
16
+ y: z.number().optional(),
17
+ width: z.number().optional(),
18
+ height: z.number().optional(),
19
+ style: StyleSchema.optional()
20
+ });
5
21
  const NodeSchema = z.object({
6
22
  type: z.literal("node"),
7
23
  id: z.string(),
@@ -15,7 +31,8 @@ const NodeSchema = z.object({
15
31
  height: z.number().optional(),
16
32
  shape: z.string().optional(),
17
33
  color: z.string().optional(),
18
- style: StyleSchema.optional()
34
+ style: StyleSchema.optional(),
35
+ ports: z.array(PortSchema).optional()
19
36
  });
20
37
  const EdgeSchema = z.object({
21
38
  type: z.literal("edge"),
@@ -24,6 +41,8 @@ const EdgeSchema = z.object({
24
41
  targetId: z.string(),
25
42
  label: z.string().nullable().optional(),
26
43
  weight: z.number().optional(),
44
+ sourcePort: z.string().optional(),
45
+ targetPort: z.string().optional(),
27
46
  data: z.any(),
28
47
  x: z.number().optional(),
29
48
  y: z.number().optional(),
@@ -49,4 +68,4 @@ const GraphSchema = z.object({
49
68
  });
50
69
 
51
70
  //#endregion
52
- export { EdgeSchema, GraphSchema, NodeSchema };
71
+ export { EdgeSchema, GraphSchema, NodeSchema, PortSchema };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@statelyai/graph",
3
3
  "type": "module",
4
- "version": "0.10.0",
4
+ "version": "0.11.0",
5
5
  "description": "A TypeScript-first graph library with plain JSON-serializable objects",
6
6
  "author": "David Khourshid <david@stately.ai>",
7
7
  "license": "MIT",
@@ -24,6 +24,7 @@
24
24
  "exports": {
25
25
  ".": "./dist/index.mjs",
26
26
  "./algorithms": "./dist/algorithms.mjs",
27
+ "./format-support": "./dist/format-support.mjs",
27
28
  "./adjacency-list": "./dist/formats/adjacency-list/index.mjs",
28
29
  "./converter": "./dist/formats/converter/index.mjs",
29
30
  "./cytoscape": "./dist/formats/cytoscape/index.mjs",
@@ -101,10 +102,12 @@
101
102
  },
102
103
  "scripts": {
103
104
  "build": "tsdown",
105
+ "bench": "vitest bench --run",
104
106
  "dev": "tsdown --watch",
105
107
  "test": "vitest",
106
108
  "typecheck": "tsc --noEmit",
107
- "verify": "pnpm typecheck && pnpm test -- --run && pnpm build && pnpm validate:package",
109
+ "check:generated": "tsx scripts/generate-json-schema.ts --check",
110
+ "verify": "pnpm typecheck && pnpm check:generated && pnpm test -- --run && pnpm build && pnpm validate:package",
108
111
  "validate:package": "publint && tsx scripts/smoke-package.ts",
109
112
  "generate-schema": "tsx scripts/generate-json-schema.ts",
110
113
  "changeset": "changeset",
@@ -16,6 +16,22 @@
16
16
  "type": "string"
17
17
  },
18
18
  "label": {
19
+ "anyOf": [
20
+ {
21
+ "type": "string"
22
+ },
23
+ {
24
+ "type": "null"
25
+ }
26
+ ]
27
+ },
28
+ "weight": {
29
+ "type": "number"
30
+ },
31
+ "sourcePort": {
32
+ "type": "string"
33
+ },
34
+ "targetPort": {
19
35
  "type": "string"
20
36
  },
21
37
  "data": {},
@@ -56,7 +72,6 @@
56
72
  "id",
57
73
  "sourceId",
58
74
  "targetId",
59
- "label",
60
75
  "data"
61
76
  ],
62
77
  "additionalProperties": false
@@ -91,12 +91,67 @@
91
91
  }
92
92
  ]
93
93
  }
94
+ },
95
+ "ports": {
96
+ "type": "array",
97
+ "items": {
98
+ "type": "object",
99
+ "properties": {
100
+ "name": {
101
+ "type": "string"
102
+ },
103
+ "direction": {
104
+ "type": "string",
105
+ "enum": [
106
+ "in",
107
+ "out",
108
+ "inout"
109
+ ]
110
+ },
111
+ "label": {
112
+ "type": "string"
113
+ },
114
+ "data": {},
115
+ "x": {
116
+ "type": "number"
117
+ },
118
+ "y": {
119
+ "type": "number"
120
+ },
121
+ "width": {
122
+ "type": "number"
123
+ },
124
+ "height": {
125
+ "type": "number"
126
+ },
127
+ "style": {
128
+ "type": "object",
129
+ "propertyNames": {
130
+ "type": "string"
131
+ },
132
+ "additionalProperties": {
133
+ "anyOf": [
134
+ {
135
+ "type": "string"
136
+ },
137
+ {
138
+ "type": "number"
139
+ }
140
+ ]
141
+ }
142
+ }
143
+ },
144
+ "required": [
145
+ "name",
146
+ "data"
147
+ ],
148
+ "additionalProperties": false
149
+ }
94
150
  }
95
151
  },
96
152
  "required": [
97
153
  "type",
98
154
  "id",
99
- "label",
100
155
  "data"
101
156
  ],
102
157
  "additionalProperties": false
@@ -121,6 +176,22 @@
121
176
  "type": "string"
122
177
  },
123
178
  "label": {
179
+ "anyOf": [
180
+ {
181
+ "type": "string"
182
+ },
183
+ {
184
+ "type": "null"
185
+ }
186
+ ]
187
+ },
188
+ "weight": {
189
+ "type": "number"
190
+ },
191
+ "sourcePort": {
192
+ "type": "string"
193
+ },
194
+ "targetPort": {
124
195
  "type": "string"
125
196
  },
126
197
  "data": {},
@@ -161,7 +232,6 @@
161
232
  "id",
162
233
  "sourceId",
163
234
  "targetId",
164
- "label",
165
235
  "data"
166
236
  ],
167
237
  "additionalProperties": false
@@ -197,7 +267,6 @@
197
267
  "required": [
198
268
  "id",
199
269
  "type",
200
- "initialNodeId",
201
270
  "nodes",
202
271
  "edges",
203
272
  "data"
@@ -66,12 +66,67 @@
66
66
  }
67
67
  ]
68
68
  }
69
+ },
70
+ "ports": {
71
+ "type": "array",
72
+ "items": {
73
+ "type": "object",
74
+ "properties": {
75
+ "name": {
76
+ "type": "string"
77
+ },
78
+ "direction": {
79
+ "type": "string",
80
+ "enum": [
81
+ "in",
82
+ "out",
83
+ "inout"
84
+ ]
85
+ },
86
+ "label": {
87
+ "type": "string"
88
+ },
89
+ "data": {},
90
+ "x": {
91
+ "type": "number"
92
+ },
93
+ "y": {
94
+ "type": "number"
95
+ },
96
+ "width": {
97
+ "type": "number"
98
+ },
99
+ "height": {
100
+ "type": "number"
101
+ },
102
+ "style": {
103
+ "type": "object",
104
+ "propertyNames": {
105
+ "type": "string"
106
+ },
107
+ "additionalProperties": {
108
+ "anyOf": [
109
+ {
110
+ "type": "string"
111
+ },
112
+ {
113
+ "type": "number"
114
+ }
115
+ ]
116
+ }
117
+ }
118
+ },
119
+ "required": [
120
+ "name",
121
+ "data"
122
+ ],
123
+ "additionalProperties": false
124
+ }
69
125
  }
70
126
  },
71
127
  "required": [
72
128
  "type",
73
129
  "id",
74
- "label",
75
130
  "data"
76
131
  ],
77
132
  "additionalProperties": false