process-graph 1.1.1 → 1.2.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.
- package/dist/bin.js +1 -1
- package/dist/cli.d.ts +61 -7
- package/dist/cli.js +2 -2
- package/dist/{control-aDk9560d.js → control-DiygoEhm.js} +163 -1
- package/dist/{dist-HLlW8vgT.js → dist-BxHnxpcT.js} +178 -23
- package/dist/dist-Cw63tKU9.js +3 -0
- package/dist/{index-CCfe0csl.d.ts → index-BH1aFqkJ.d.ts} +33 -2
- package/dist/{index-DricKcyl.d.ts → index-BUheRLdG.d.ts} +2 -2
- package/dist/{index-DhbvDgK4.d.ts → index-DxWOY8f9.d.ts} +384 -9
- package/dist/index.d.ts +2 -2
- package/dist/index.js +3 -3
- package/dist/{open-CyRXJ4bt.js → open-BF-UHqeW.js} +1 -1
- package/dist/{queries-CCexJAE2.js → queries-C8kIDRiY.js} +2 -93
- package/dist/react-flow.d.ts +2 -2
- package/dist/react-flow.js +2 -2
- package/dist/react.d.ts +1 -1
- package/dist/react.js +2 -2
- package/dist/{router-D4gtTlXm.js → router-DvGGLnNt.js} +26 -1
- package/dist/{selection-BW_xXWOy.js → selection-iet5RAlP.js} +1 -1
- package/dist/store/node.d.ts +1 -1
- package/dist/store/node.js +1 -1
- package/dist/store/wasm/worker.js +2 -2
- package/dist/store/wasm.d.ts +1 -1
- package/dist/{store-BcR70CaO.js → store-BJILV4JS.js} +251 -36
- package/dist/store.d.ts +115 -3
- package/dist/store.js +43 -9
- package/dist/ui.d.ts +2 -2
- package/package.json +10 -10
- package/dist/dist-IjrgWhHQ.js +0 -3
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { createSyncEvaluator } from "trilean";
|
|
1
|
+
import { S as UnknownNodeError, b as lookup$1, c as evaluateBranches, d as isProvided, h as stronglyConnectedComponents, m as findCycles, p as assertAcyclic, r as loopTransitions, t as controlDag, x as CycleError, y as buildDag } from "./control-DiygoEhm.js";
|
|
3
2
|
//#region ../../core/graph/projection/dist/actors.js
|
|
4
3
|
const actorMap = (model) => {
|
|
5
4
|
const actors = /* @__PURE__ */ new Map();
|
|
@@ -1746,96 +1745,6 @@ const sequenceObserved = (model, scenario, observe) => {
|
|
|
1746
1745
|
*/
|
|
1747
1746
|
const toSequence = (model, scenario) => sequenceObserved(model, scenario, void 0);
|
|
1748
1747
|
//#endregion
|
|
1749
|
-
//#region ../../core/graph/domain/dist/facts.js
|
|
1750
|
-
/** The only field of a reserved key. Keys that carry it are resolved from the overlay, so a `Facts` implementation must not use it. */
|
|
1751
|
-
const elementField = "$element";
|
|
1752
|
-
/**
|
|
1753
|
-
* Builds the reserved key that reads another element's run state inside a condition. It resolves to the text `"done"` or `"open"`, and is not found (so the condition is indeterminate) when the overlay says `"unknown"` or the id is not an element of the model.
|
|
1754
|
-
*
|
|
1755
|
-
* The value is the overlay's own state, not the derived status: a condition therefore never depends on the derivation that evaluates it, and cannot form a cycle.
|
|
1756
|
-
* @param id - The element whose state is read.
|
|
1757
|
-
* @returns A key to put in a trilean `reference` node.
|
|
1758
|
-
*/
|
|
1759
|
-
const elementStatusKey = (id) => ({ [elementField]: id });
|
|
1760
|
-
/** The only field of the key the package puts to the port to ask whether an input artefact is provided. */
|
|
1761
|
-
const artefactField = "$artefact";
|
|
1762
|
-
/**
|
|
1763
|
-
* Builds the key the package asks the facts port when it needs to know whether an artefact has been provided from outside the process. An artefact is provided exactly when the port answers `{ found: true }` with the boolean `true`; a not-found or `false` answer means it is not.
|
|
1764
|
-
*
|
|
1765
|
-
* A provided artefact satisfies every consumer, whether or not an activity also produces it.
|
|
1766
|
-
* @param id - The artefact.
|
|
1767
|
-
* @returns The key the port is asked.
|
|
1768
|
-
*/
|
|
1769
|
-
const artefactKey = (id) => ({ [artefactField]: id });
|
|
1770
|
-
/**
|
|
1771
|
-
* Whether the facts port reports an artefact as provided.
|
|
1772
|
-
* @param facts - The injected source of facts.
|
|
1773
|
-
* @param id - The artefact.
|
|
1774
|
-
*/
|
|
1775
|
-
const isProvided = (facts, id) => {
|
|
1776
|
-
const answer = facts(artefactKey(id));
|
|
1777
|
-
return answer.found && answer.value.kind === "boolean" && answer.value.value;
|
|
1778
|
-
};
|
|
1779
|
-
/**
|
|
1780
|
-
* Thrown when a condition uses a node whose evaluation needs a table or a collection from the facts port, which answers single keys only.
|
|
1781
|
-
*/
|
|
1782
|
-
var UnsupportedConditionError = class extends Error {
|
|
1783
|
-
/** The kind of reference the condition used. */
|
|
1784
|
-
reference;
|
|
1785
|
-
/**
|
|
1786
|
-
* @param reference - The unsupported kind of reference.
|
|
1787
|
-
*/
|
|
1788
|
-
constructor(reference) {
|
|
1789
|
-
super(`A condition uses a ${reference} reference, which the Facts port does not answer: it resolves single keys only`);
|
|
1790
|
-
this.name = "UnsupportedConditionError";
|
|
1791
|
-
this.reference = reference;
|
|
1792
|
-
}
|
|
1793
|
-
};
|
|
1794
|
-
const evaluator = createSyncEvaluator({});
|
|
1795
|
-
const isRecord = (value) => typeof value === "object" && value !== null && !Array.isArray(value);
|
|
1796
|
-
/**
|
|
1797
|
-
* Evaluates every transition's condition.
|
|
1798
|
-
*
|
|
1799
|
-
* A definite true is `taken`, a definite false is `not-taken` and an indeterminate result is `indeterminate`. A transition without a condition is `taken`. Conditions are evaluated for every transition regardless of the state of its source.
|
|
1800
|
-
* @param model - The model whose transitions are evaluated.
|
|
1801
|
-
* @param overlay - Run state, read by `elementStatusKey` references.
|
|
1802
|
-
* @param facts - The injected source of facts.
|
|
1803
|
-
* @returns The outcome of every transition, in transition order.
|
|
1804
|
-
* @throws UnsupportedConditionError when a condition contains a `lookup`, `some`, `every` or fold node.
|
|
1805
|
-
*/
|
|
1806
|
-
const evaluateBranches = (model, overlay, facts) => {
|
|
1807
|
-
const elementIds = new Set(model.elements.map(({ id }) => id));
|
|
1808
|
-
const overlayOf = new Map(Object.entries(overlay));
|
|
1809
|
-
const resolvers = {
|
|
1810
|
-
resolveValue: (key) => {
|
|
1811
|
-
if (!isRecord(key) || !(elementField in key)) return facts(key);
|
|
1812
|
-
const id = key[elementField];
|
|
1813
|
-
if (typeof id !== "string" || !elementIds.has(id)) return { found: false };
|
|
1814
|
-
const state = overlayOf.get(id);
|
|
1815
|
-
if (state === "unknown") return { found: false };
|
|
1816
|
-
return {
|
|
1817
|
-
found: true,
|
|
1818
|
-
value: {
|
|
1819
|
-
kind: "text",
|
|
1820
|
-
value: state === "done" ? "done" : "open"
|
|
1821
|
-
}
|
|
1822
|
-
};
|
|
1823
|
-
},
|
|
1824
|
-
resolveLookup: () => {
|
|
1825
|
-
throw new UnsupportedConditionError("lookup");
|
|
1826
|
-
},
|
|
1827
|
-
resolveCollection: () => {
|
|
1828
|
-
throw new UnsupportedConditionError("collection");
|
|
1829
|
-
}
|
|
1830
|
-
};
|
|
1831
|
-
return new Map(model.transitions.map(({ id, condition }) => {
|
|
1832
|
-
if (condition === void 0) return [id, "taken"];
|
|
1833
|
-
const result = evaluator.evaluatePredicate(condition, void 0, resolvers);
|
|
1834
|
-
if (result.status === "indeterminate") return [id, "indeterminate"];
|
|
1835
|
-
return [id, result.value ? "taken" : "not-taken"];
|
|
1836
|
-
}));
|
|
1837
|
-
};
|
|
1838
|
-
//#endregion
|
|
1839
1748
|
//#region ../../core/graph/domain/dist/lookup.js
|
|
1840
1749
|
/**
|
|
1841
1750
|
* Reads a value out of a map built over every element of a model.
|
|
@@ -2199,4 +2108,4 @@ const unmetOutputs = (model, overlay, facts) => {
|
|
|
2199
2108
|
return unmet;
|
|
2200
2109
|
};
|
|
2201
2110
|
//#endregion
|
|
2202
|
-
export {
|
|
2111
|
+
export { criticalPath$1 as _, unmetOutputs as a, actorMap as b, deriveStatuses as c, stateMachineParts as d, toStateMachine as f, handoffs as g, toFlowchart as h, readySet as i, statusRules as l, flowchartParts as m, criticalPath as n, whatIfDone as o, toSwimlane as p, impact as r, explainStatus as s, blockedBy as t, toSequence as u, immediateDominators as v, topologicalLayers as y };
|
package/dist/react-flow.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { B as Status } from "./index-BH1aFqkJ.js";
|
|
2
2
|
import { G as IdSpace, O as Projection, g as Model, x as Element } from "./index-CmZOswkx.js";
|
|
3
3
|
import { A as Flowchart, E as Swimlane, x as StateMachine } from "./index-CoA6vXqe.js";
|
|
4
4
|
import { i as LayoutView, n as LayoutOptions, r as LayoutResult, s as Direction } from "./index-CrM5qWUA.js";
|
|
5
|
-
import { A as ElementFilter, rt as Run, y as NamedElement } from "./index-
|
|
5
|
+
import { A as ElementFilter, rt as Run, y as NamedElement } from "./index-BUheRLdG.js";
|
|
6
6
|
import { ReactElement } from "react";
|
|
7
7
|
import { ColorMode, Edge, EdgeProps, Node, NodeProps } from "@xyflow/react";
|
|
8
8
|
//#region ../../ui/graph/react-flow/dist/use-layout.d.ts
|
package/dist/react-flow.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { f as toStateMachine, h as toFlowchart, p as toSwimlane, u as toSequence } from "./queries-C8kIDRiY.js";
|
|
2
2
|
import { t as layout } from "./layout-CCM-KBdp.js";
|
|
3
|
-
import { d as useBlockers, f as useCriticalPath, h as useStatuses, i as filterElements, r as emptyFilter, t as useGraphSelection } from "./selection-
|
|
3
|
+
import { d as useBlockers, f as useCriticalPath, h as useStatuses, i as filterElements, r as emptyFilter, t as useGraphSelection } from "./selection-iet5RAlP.js";
|
|
4
4
|
import { c as elementLabel } from "./detail-panel-B1ZmMuJT.js";
|
|
5
5
|
import { a as Lane, n as ElementCard, s as SequenceDiagram } from "./dist-BpCBmnMl.js";
|
|
6
6
|
import { useCallback, useEffect, useMemo, useRef, useState } from "react";
|
package/dist/react.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { $ as useWhyStatus, A as ElementFilter, B as useElementFilter, C as ruleDescriptions, D as SelectionContainerProps, E as GraphSelectionOptions, F as emptyFilter, G as BlockedChain, H as ViewsByNotation, I as filterElements, J as useBlockers, K as stepWeight, L as filterOptions, M as FilterOption, N as FilterOptions, O as SelectionItemProps, P as actorsOf, Q as useStatuses, R as matchesFilter, S as elementLabel, T as GraphSelection, U as project, V as ProjectedView, W as useProjection, X as useImpact, Y as useCriticalPath, Z as useReadySet, _ as ElementCardPart, a as FilterPanelPart, b as StatusBadge, c as LegendPart, d as LanePart, et as ModelClient, f as LaneProps, g as ElementCard, h as TransitionItemProps, i as FilterPanel, it as noFacts, j as ElementFilterState, k as useGraphSelection, l as LegendProps, m as TransitionItemPart, n as DetailPanelPart, nt as useModel, o as FilterPanelProps, p as TransitionItem, q as useBlockedChain, r as DetailPanelProps, rt as Run, s as Legend, t as DetailPanel, tt as ModelState, u as Lane, v as ElementCardProps, w as statusLabels, x as StatusBadgeProps, y as NamedElement, z as sourceScope } from "./index-
|
|
1
|
+
import { $ as useWhyStatus, A as ElementFilter, B as useElementFilter, C as ruleDescriptions, D as SelectionContainerProps, E as GraphSelectionOptions, F as emptyFilter, G as BlockedChain, H as ViewsByNotation, I as filterElements, J as useBlockers, K as stepWeight, L as filterOptions, M as FilterOption, N as FilterOptions, O as SelectionItemProps, P as actorsOf, Q as useStatuses, R as matchesFilter, S as elementLabel, T as GraphSelection, U as project, V as ProjectedView, W as useProjection, X as useImpact, Y as useCriticalPath, Z as useReadySet, _ as ElementCardPart, a as FilterPanelPart, b as StatusBadge, c as LegendPart, d as LanePart, et as ModelClient, f as LaneProps, g as ElementCard, h as TransitionItemProps, i as FilterPanel, it as noFacts, j as ElementFilterState, k as useGraphSelection, l as LegendProps, m as TransitionItemPart, n as DetailPanelPart, nt as useModel, o as FilterPanelProps, p as TransitionItem, q as useBlockedChain, r as DetailPanelProps, rt as Run, s as Legend, t as DetailPanel, tt as ModelState, u as Lane, v as ElementCardProps, w as statusLabels, x as StatusBadgeProps, y as NamedElement, z as sourceScope } from "./index-BUheRLdG.js";
|
|
2
2
|
export { type BlockedChain, DetailPanel, type DetailPanelPart, type DetailPanelProps, ElementCard, type ElementCardPart, type ElementCardProps, type ElementFilter, type ElementFilterState, type FilterOption, type FilterOptions, FilterPanel, type FilterPanelPart, type FilterPanelProps, type GraphSelection, type GraphSelectionOptions, Lane, type LanePart, type LaneProps, Legend, type LegendPart, type LegendProps, type ModelClient, type ModelState, type NamedElement, type ProjectedView, type Run, type SelectionContainerProps, type SelectionItemProps, StatusBadge, type StatusBadgeProps, TransitionItem, type TransitionItemPart, type TransitionItemProps, type ViewsByNotation, actorsOf, elementLabel, emptyFilter, filterElements, filterOptions, matchesFilter, noFacts, project, ruleDescriptions, sourceScope, statusLabels, stepWeight, useBlockedChain, useBlockers, useCriticalPath, useElementFilter, useGraphSelection, useImpact, useModel, useProjection, useReadySet, useStatuses, useWhyStatus };
|
package/dist/react.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { a as filterOptions, c as useElementFilter, d as useBlockers, f as useCriticalPath, g as useWhyStatus, h as useStatuses, i as filterElements, l as stepWeight, m as useReadySet, n as actorsOf, o as matchesFilter, p as useImpact, r as emptyFilter, s as sourceScope, t as useGraphSelection, u as useBlockedChain } from "./selection-
|
|
1
|
+
import { f as toStateMachine, h as toFlowchart, p as toSwimlane, u as toSequence } from "./queries-C8kIDRiY.js";
|
|
2
|
+
import { a as filterOptions, c as useElementFilter, d as useBlockers, f as useCriticalPath, g as useWhyStatus, h as useStatuses, i as filterElements, l as stepWeight, m as useReadySet, n as actorsOf, o as matchesFilter, p as useImpact, r as emptyFilter, s as sourceScope, t as useGraphSelection, u as useBlockedChain } from "./selection-iet5RAlP.js";
|
|
3
3
|
import { a as TransitionItem, c as elementLabel, i as Lane, l as ruleDescriptions, n as FilterPanel, o as ElementCard, r as Legend, s as StatusBadge, t as DetailPanel, u as statusLabels } from "./detail-panel-B1ZmMuJT.js";
|
|
4
4
|
import { ORPCError } from "@orpc/client";
|
|
5
5
|
import { useEffect, useMemo, useState } from "react";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { r as overlaySchema, t as modelSchema } from "./schema-CVnS6HiX.js";
|
|
2
|
-
import {
|
|
2
|
+
import { A as modelIdSchema, C as boundItemsSchema, E as factClearingSchema, F as revisionSchema, I as storeChangeSchema, L as storedFactsSchema, M as reachSchema, P as relationSchema, R as storedModelSchema, T as factChangeSchema, j as modelSummarySchema, k as issueSchema, x as GraphStoreError } from "./store-BJILV4JS.js";
|
|
3
3
|
import { z } from "zod";
|
|
4
4
|
import { eventIterator, oc } from "@orpc/contract";
|
|
5
5
|
import { implement } from "@orpc/server";
|
|
@@ -44,6 +44,17 @@ const graphStoreContract = { v1: oc.errors(graphStoreErrors).router({
|
|
|
44
44
|
modelId: modelIdSchema,
|
|
45
45
|
overlay: overlaySchema
|
|
46
46
|
}).readonly()).output(written) },
|
|
47
|
+
facts: {
|
|
48
|
+
read: oc.input(modelRef).output(storedFactsSchema),
|
|
49
|
+
set: oc.input(z.strictObject({
|
|
50
|
+
modelId: modelIdSchema,
|
|
51
|
+
facts: factChangeSchema
|
|
52
|
+
}).readonly()).output(written),
|
|
53
|
+
clear: oc.input(z.strictObject({
|
|
54
|
+
modelId: modelIdSchema,
|
|
55
|
+
facts: factClearingSchema
|
|
56
|
+
}).readonly()).output(written)
|
|
57
|
+
},
|
|
47
58
|
items: { upsert: oc.input(z.strictObject({
|
|
48
59
|
modelId: modelIdSchema,
|
|
49
60
|
items: boundItemsSchema
|
|
@@ -125,6 +136,20 @@ const createGraphStoreRouter = (store) => os.router({ v1: {
|
|
|
125
136
|
...input,
|
|
126
137
|
signal
|
|
127
138
|
}) }))) },
|
|
139
|
+
facts: {
|
|
140
|
+
read: os.v1.facts.read.handler(async ({ input, signal, errors }) => call(signal, errors, async () => store.readFacts({
|
|
141
|
+
...input,
|
|
142
|
+
signal
|
|
143
|
+
}))),
|
|
144
|
+
set: os.v1.facts.set.handler(async ({ input, signal, errors }) => call(signal, errors, async () => ({ revision: await store.setFacts({
|
|
145
|
+
...input,
|
|
146
|
+
signal
|
|
147
|
+
}) }))),
|
|
148
|
+
clear: os.v1.facts.clear.handler(async ({ input, signal, errors }) => call(signal, errors, async () => ({ revision: await store.clearFacts({
|
|
149
|
+
...input,
|
|
150
|
+
signal
|
|
151
|
+
}) })))
|
|
152
|
+
},
|
|
128
153
|
items: { upsert: os.v1.items.upsert.handler(async ({ input, signal, errors }) => call(signal, errors, async () => ({ revision: await store.upsertItems({
|
|
129
154
|
...input,
|
|
130
155
|
signal
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { c as deriveStatuses, i as readySet, n as criticalPath, r as impact, s as explainStatus, t as blockedBy } from "./queries-
|
|
1
|
+
import { c as deriveStatuses, i as readySet, n as criticalPath, r as impact, s as explainStatus, t as blockedBy } from "./queries-C8kIDRiY.js";
|
|
2
2
|
import { useCallback, useMemo, useRef, useState } from "react";
|
|
3
3
|
//#region ../../ui/graph/react/dist/analysis.js
|
|
4
4
|
/**
|
package/dist/store/node.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { w as GraphStore } from "../index-DxWOY8f9.js";
|
|
2
2
|
import { DatabaseSyncOptions } from "node:sqlite";
|
|
3
3
|
import { NodeSQLiteDatabase } from "drizzle-orm/node-sqlite";
|
|
4
4
|
//#region ../../adapters/graph/sqlite-node/dist/open.d.ts
|
package/dist/store/node.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as openNodeGraphStore } from "../open-
|
|
1
|
+
import { t as openNodeGraphStore } from "../open-BF-UHqeW.js";
|
|
2
2
|
export { openNodeGraphStore };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { t as createGraphStoreRouter } from "../../router-
|
|
1
|
+
import { I as storeChangeSchema, t as createSqliteGraphStore, y as ChangeFeed } from "../../store-BJILV4JS.js";
|
|
2
|
+
import { t as createGraphStoreRouter } from "../../router-DvGGLnNt.js";
|
|
3
3
|
import sqlite3InitModule from "@sqlite.org/sqlite-wasm";
|
|
4
4
|
import { RPCHandler } from "@orpc/server/message-port";
|
|
5
5
|
import { drizzle } from "drizzle-orm/sqlite-proxy";
|
package/dist/store/wasm.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ut as GraphStoreClient } from "../index-DxWOY8f9.js";
|
|
2
2
|
//#region ../../adapters/graph/sqlite-wasm/dist/client.d.ts
|
|
3
3
|
/**
|
|
4
4
|
* A client for the graph store a worker serves with `serveGraphStoreInWorker`. Every procedure of the contract is available, with its abort signal and typed errors, as if the store were in the page.
|