@lostgradient/weft 0.21.0 → 0.22.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/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # Weft
2
2
 
3
- A Bun-native durable execution engine. Current release: `0.21.0`.
3
+ A Bun-native durable execution engine. Current release: `0.22.1`.
4
4
 
5
5
  Install the library from npm as `@lostgradient/weft`:
6
6
 
@@ -406,9 +406,7 @@ Schedules also emit `schedule:fired` on the live engine each time a schedule act
406
406
  ```typescript
407
407
  import { createObservabilityInterceptors, createOpenTelemetryMetrics } from '@lostgradient/weft';
408
408
 
409
- const metrics = createOpenTelemetryMetrics({
410
- /* your meter provider */
411
- });
409
+ const metrics = createOpenTelemetryMetrics({/* your meter provider */});
412
410
  const interceptors = createObservabilityInterceptors({ metrics });
413
411
 
414
412
  const engine = new Engine({
@@ -1,7 +1,7 @@
1
1
  import { statSync } from "node:fs";
2
2
  import { dirname, join } from "node:path";
3
3
  import { fileURLToPath, pathToFileURL } from "node:url";
4
- const CONSOLE_PACKAGE_NAME = "@lostgradient/weft-console";
4
+ const CONSOLE_PACKAGE_NAME = "@lostgradient/weft-ui";
5
5
  function defaultImportModule(url) {
6
6
  return import(url);
7
7
  }
@@ -32,15 +32,15 @@ async function importConsoleModule(resolvedEntry, importModule) {
32
32
  }
33
33
  }
34
34
  function loadDashboard(module) {
35
- if (typeof module.weftConsole !== "function")
36
- throw consoleError(`${CONSOLE_PACKAGE_NAME} must export a weftConsole() function; update the package or remove --console`);
35
+ if (typeof module.weftUi !== "function")
36
+ throw consoleError(`${CONSOLE_PACKAGE_NAME} must export a weftUi() function; update the package or remove --console`);
37
37
  try {
38
- const dashboard = module.weftConsole();
38
+ const dashboard = module.weftUi();
39
39
  if (!isDashboardRouteTarget(dashboard))
40
40
  throw Error("invalid dashboard route target");
41
41
  return dashboard;
42
42
  } catch {
43
- throw consoleError(`${CONSOLE_PACKAGE_NAME} weftConsole() failed; reinstall or update it, then retry, or remove --console`);
43
+ throw consoleError(`${CONSOLE_PACKAGE_NAME} weftUi() failed; reinstall or update it, then retry, or remove --console`);
44
44
  }
45
45
  }
46
46
  function resolveConsoleAssets(resolvedEntry) {
@@ -1620,6 +1620,10 @@
1620
1620
  "inputSchema": {
1621
1621
  "additionalProperties": false,
1622
1622
  "properties": {
1623
+ "includeExpectedDelayed": {
1624
+ "default": false,
1625
+ "type": "boolean"
1626
+ },
1623
1627
  "limit": {
1624
1628
  "default": 50,
1625
1629
  "maximum": 200,
@@ -1652,6 +1656,12 @@
1652
1656
  "minimum": 0,
1653
1657
  "type": "integer"
1654
1658
  },
1659
+ "unadoptedAfterMs": {
1660
+ "default": 60000,
1661
+ "maximum": 9007199254740991,
1662
+ "minimum": 0,
1663
+ "type": "integer"
1664
+ },
1655
1665
  "workflowId": {
1656
1666
  "minLength": 1,
1657
1667
  "type": "string"
@@ -1661,6 +1671,8 @@
1661
1671
  "staleQueuedAfterMs",
1662
1672
  "staleHeartbeatAfterMs",
1663
1673
  "retryStormMinimumAttempts",
1674
+ "includeExpectedDelayed",
1675
+ "unadoptedAfterMs",
1664
1676
  "limit"
1665
1677
  ],
1666
1678
  "type": "object"
@@ -1670,90 +1682,193 @@
1670
1682
  "properties": {
1671
1683
  "items": {
1672
1684
  "items": {
1673
- "additionalProperties": false,
1674
- "properties": {
1675
- "activityName": {
1676
- "type": "string"
1677
- },
1678
- "deadLetterReason": {
1679
- "const": "result-resolution-storage-exhausted",
1680
- "type": "string"
1681
- },
1682
- "deadLetteredAt": {
1683
- "minimum": 0,
1684
- "type": "number"
1685
- },
1686
- "evidence": {
1687
- "items": {
1688
- "type": "string"
1685
+ "anyOf": [
1686
+ {
1687
+ "additionalProperties": false,
1688
+ "properties": {
1689
+ "activityName": {
1690
+ "type": "string"
1691
+ },
1692
+ "deadLetterReason": {
1693
+ "const": "result-resolution-storage-exhausted",
1694
+ "type": "string"
1695
+ },
1696
+ "deadLetteredAt": {
1697
+ "minimum": 0,
1698
+ "type": "number"
1699
+ },
1700
+ "evidence": {
1701
+ "items": {
1702
+ "type": "string"
1703
+ },
1704
+ "type": "array"
1705
+ },
1706
+ "executionLatencyMs": {
1707
+ "minimum": 0,
1708
+ "type": "number"
1709
+ },
1710
+ "heartbeatAgeMs": {
1711
+ "minimum": 0,
1712
+ "type": "number"
1713
+ },
1714
+ "kind": {
1715
+ "enum": [
1716
+ "stuck-queued",
1717
+ "stale-inflight",
1718
+ "retry-storm",
1719
+ "all-workers-at-capacity",
1720
+ "dead-lettered"
1721
+ ],
1722
+ "type": "string"
1723
+ },
1724
+ "lastRequeueReason": {
1725
+ "type": "string"
1726
+ },
1727
+ "operationId": {
1728
+ "type": "string"
1729
+ },
1730
+ "queue": {
1731
+ "type": "string"
1732
+ },
1733
+ "queueLatencyMs": {
1734
+ "minimum": 0,
1735
+ "type": "number"
1736
+ },
1737
+ "requeueCount": {
1738
+ "maximum": 9007199254740991,
1739
+ "minimum": 0,
1740
+ "type": "integer"
1741
+ },
1742
+ "resolutionReason": {
1743
+ "type": "string"
1744
+ },
1745
+ "retryAttempts": {
1746
+ "maximum": 9007199254740991,
1747
+ "minimum": 0,
1748
+ "type": "integer"
1749
+ },
1750
+ "retryCount": {
1751
+ "maximum": 9007199254740991,
1752
+ "minimum": 0,
1753
+ "type": "integer"
1754
+ },
1755
+ "state": {
1756
+ "enum": ["queued", "inflight", "resolved", "capacity", "dead-lettered"],
1757
+ "type": "string"
1758
+ },
1759
+ "storageError": {
1760
+ "type": "string"
1761
+ },
1762
+ "workerId": {
1763
+ "type": "string"
1764
+ },
1765
+ "workflowId": {
1766
+ "type": "string"
1767
+ }
1689
1768
  },
1690
- "type": "array"
1691
- },
1692
- "executionLatencyMs": {
1693
- "minimum": 0,
1694
- "type": "number"
1695
- },
1696
- "heartbeatAgeMs": {
1697
- "minimum": 0,
1698
- "type": "number"
1769
+ "required": ["kind", "state", "retryCount", "requeueCount", "evidence"],
1770
+ "type": "object"
1699
1771
  },
1700
- "kind": {
1701
- "enum": [
1702
- "stuck-queued",
1703
- "stale-inflight",
1704
- "retry-storm",
1705
- "all-workers-at-capacity",
1706
- "dead-lettered"
1772
+ {
1773
+ "additionalProperties": false,
1774
+ "properties": {
1775
+ "availableAt": {
1776
+ "minimum": 0,
1777
+ "type": "number"
1778
+ },
1779
+ "evidence": {
1780
+ "items": {
1781
+ "type": "string"
1782
+ },
1783
+ "type": "array"
1784
+ },
1785
+ "kind": {
1786
+ "const": "delayed",
1787
+ "type": "string"
1788
+ },
1789
+ "operationId": {
1790
+ "type": "string"
1791
+ },
1792
+ "queue": {
1793
+ "type": "string"
1794
+ },
1795
+ "requeueCount": {
1796
+ "maximum": 9007199254740991,
1797
+ "minimum": 0,
1798
+ "type": "integer"
1799
+ },
1800
+ "retryCount": {
1801
+ "maximum": 9007199254740991,
1802
+ "minimum": 0,
1803
+ "type": "integer"
1804
+ },
1805
+ "state": {
1806
+ "const": "queued",
1807
+ "type": "string"
1808
+ },
1809
+ "workflowId": {
1810
+ "type": "string"
1811
+ }
1812
+ },
1813
+ "required": [
1814
+ "kind",
1815
+ "state",
1816
+ "operationId",
1817
+ "queue",
1818
+ "retryCount",
1819
+ "requeueCount",
1820
+ "availableAt",
1821
+ "evidence"
1707
1822
  ],
1708
- "type": "string"
1709
- },
1710
- "lastRequeueReason": {
1711
- "type": "string"
1712
- },
1713
- "operationId": {
1714
- "type": "string"
1715
- },
1716
- "queue": {
1717
- "type": "string"
1718
- },
1719
- "queueLatencyMs": {
1720
- "minimum": 0,
1721
- "type": "number"
1722
- },
1723
- "requeueCount": {
1724
- "maximum": 9007199254740991,
1725
- "minimum": 0,
1726
- "type": "integer"
1727
- },
1728
- "resolutionReason": {
1729
- "type": "string"
1730
- },
1731
- "retryAttempts": {
1732
- "maximum": 9007199254740991,
1733
- "minimum": 0,
1734
- "type": "integer"
1735
- },
1736
- "retryCount": {
1737
- "maximum": 9007199254740991,
1738
- "minimum": 0,
1739
- "type": "integer"
1740
- },
1741
- "state": {
1742
- "enum": ["queued", "inflight", "resolved", "capacity", "dead-lettered"],
1743
- "type": "string"
1744
- },
1745
- "storageError": {
1746
- "type": "string"
1747
- },
1748
- "workerId": {
1749
- "type": "string"
1823
+ "type": "object"
1750
1824
  },
1751
- "workflowId": {
1752
- "type": "string"
1825
+ {
1826
+ "additionalProperties": false,
1827
+ "properties": {
1828
+ "adopted": {
1829
+ "const": false,
1830
+ "type": "boolean"
1831
+ },
1832
+ "evidence": {
1833
+ "items": {
1834
+ "type": "string"
1835
+ },
1836
+ "type": "array"
1837
+ },
1838
+ "kind": {
1839
+ "const": "unadopted-terminal",
1840
+ "type": "string"
1841
+ },
1842
+ "operationId": {
1843
+ "type": "string"
1844
+ },
1845
+ "queue": {
1846
+ "type": "string"
1847
+ },
1848
+ "state": {
1849
+ "const": "resolved",
1850
+ "type": "string"
1851
+ },
1852
+ "terminalAt": {
1853
+ "minimum": 0,
1854
+ "type": "number"
1855
+ },
1856
+ "workflowId": {
1857
+ "type": "string"
1858
+ }
1859
+ },
1860
+ "required": [
1861
+ "kind",
1862
+ "state",
1863
+ "operationId",
1864
+ "queue",
1865
+ "terminalAt",
1866
+ "adopted",
1867
+ "evidence"
1868
+ ],
1869
+ "type": "object"
1753
1870
  }
1754
- },
1755
- "required": ["kind", "state", "retryCount", "requeueCount", "evidence"],
1756
- "type": "object"
1871
+ ]
1757
1872
  },
1758
1873
  "type": "array"
1759
1874
  },
@@ -1775,6 +1890,11 @@
1775
1890
  "minimum": 0,
1776
1891
  "type": "integer"
1777
1892
  },
1893
+ "delayed": {
1894
+ "maximum": 9007199254740991,
1895
+ "minimum": 0,
1896
+ "type": "integer"
1897
+ },
1778
1898
  "retryStorms": {
1779
1899
  "maximum": 9007199254740991,
1780
1900
  "minimum": 0,
@@ -1789,6 +1909,11 @@
1789
1909
  "maximum": 9007199254740991,
1790
1910
  "minimum": 0,
1791
1911
  "type": "integer"
1912
+ },
1913
+ "unadoptedTerminal": {
1914
+ "maximum": 9007199254740991,
1915
+ "minimum": 0,
1916
+ "type": "integer"
1792
1917
  }
1793
1918
  },
1794
1919
  "required": [
@@ -1796,7 +1921,9 @@
1796
1921
  "staleInflight",
1797
1922
  "retryStorms",
1798
1923
  "allWorkersAtCapacity",
1799
- "deadLettered"
1924
+ "deadLettered",
1925
+ "delayed",
1926
+ "unadoptedTerminal"
1800
1927
  ],
1801
1928
  "type": "object"
1802
1929
  }