automategraph 1.5.0 → 1.5.3

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 (88) hide show
  1. package/CHANGELOG.md +20 -0
  2. package/UPGRADE-PROPOSAL.md +141 -0
  3. package/docs/diagrams/c19-resilience-scenario.md +61 -0
  4. package/docs/diagrams/c19-resilience-scenario.mmd +28 -0
  5. package/docs/diagrams/c19-resilience-scenario.svg +181 -0
  6. package/examples/README.md +206 -0
  7. package/examples/branching-edges.ts +192 -0
  8. package/examples/branching-graph.ts +333 -0
  9. package/examples/branching-router.ts +475 -0
  10. package/examples/json-graph.ts +231 -0
  11. package/examples/json-scripts.ts +152 -0
  12. package/examples/order-flow.functions.cjs +32 -0
  13. package/examples/order-flow.graph.json +27 -0
  14. package/examples/order-flow.scripted.graph.json +68 -0
  15. package/js/examples/branching-edges.js +133 -0
  16. package/js/examples/branching-edges.js.map +1 -0
  17. package/js/examples/branching-graph.js +232 -0
  18. package/js/examples/branching-graph.js.map +1 -0
  19. package/js/examples/branching-router.js +305 -0
  20. package/js/examples/branching-router.js.map +1 -0
  21. package/js/examples/json-graph.js +197 -0
  22. package/js/examples/json-graph.js.map +1 -0
  23. package/js/examples/json-scripts.js +131 -0
  24. package/js/examples/json-scripts.js.map +1 -0
  25. package/js/tests/async.test.js +592 -0
  26. package/js/tests/async.test.js.map +1 -0
  27. package/js/tests/complex.test.js +972 -0
  28. package/js/tests/complex.test.js.map +1 -0
  29. package/js/tests/conformance.test.js +365 -0
  30. package/js/tests/conformance.test.js.map +1 -0
  31. package/js/tests/edges.test.js +702 -0
  32. package/js/tests/edges.test.js.map +1 -0
  33. package/js/tests/graphjson.test.js +504 -0
  34. package/js/tests/graphjson.test.js.map +1 -0
  35. package/js/tests/harness.js +192 -0
  36. package/js/tests/harness.js.map +1 -0
  37. package/js/tests/helpers.js +136 -0
  38. package/js/tests/helpers.js.map +1 -0
  39. package/js/tests/lint.test.js +317 -0
  40. package/js/tests/lint.test.js.map +1 -0
  41. package/js/tests/registry.test.js +705 -0
  42. package/js/tests/registry.test.js.map +1 -0
  43. package/js/tests/report.js +422 -0
  44. package/js/tests/report.js.map +1 -0
  45. package/js/tests/runner.js +67 -0
  46. package/js/tests/runner.js.map +1 -0
  47. package/js/tests/scripts.test.js +552 -0
  48. package/js/tests/scripts.test.js.map +1 -0
  49. package/js/tests/unit.test.js +1239 -0
  50. package/js/tests/unit.test.js.map +1 -0
  51. package/js/tests/upgrade.test.js +618 -0
  52. package/js/tests/upgrade.test.js.map +1 -0
  53. package/package.json +2 -9
  54. package/report/index.html +3727 -0
  55. package/report/report.json +3053 -0
  56. package/tests/async.test.ts +668 -0
  57. package/tests/complex.test.ts +1123 -0
  58. package/tests/conformance.test.ts +442 -0
  59. package/tests/edges.test.ts +848 -0
  60. package/tests/fixtures/scripts/bad-registration.cjs +4 -0
  61. package/tests/fixtures/scripts/broken.cjs +2 -0
  62. package/tests/fixtures/scripts/cjs-default.js +4 -0
  63. package/tests/fixtures/scripts/collide-a.cjs +4 -0
  64. package/tests/fixtures/scripts/collide-b.cjs +4 -0
  65. package/tests/fixtures/scripts/empty.cjs +2 -0
  66. package/tests/fixtures/scripts/esm-functions.mjs +10 -0
  67. package/tests/fixtures/scripts/esm-syntax.js +3 -0
  68. package/tests/fixtures/scripts/global-channel.cjs +6 -0
  69. package/tests/fixtures/scripts/global-channel.mjs +7 -0
  70. package/tests/fixtures/scripts/mismatch.cjs +4 -0
  71. package/tests/fixtures/scripts/needs-sibling.cjs +7 -0
  72. package/tests/fixtures/scripts/order.cjs +14 -0
  73. package/tests/fixtures/scripts/sibling-helper.cjs +3 -0
  74. package/tests/fixtures/scripts/throwing-global.mjs +6 -0
  75. package/tests/graphjson.test.ts +737 -0
  76. package/tests/harness.ts +291 -0
  77. package/tests/helpers.ts +216 -0
  78. package/tests/lint.test.ts +381 -0
  79. package/tests/registry.test.ts +1134 -0
  80. package/tests/report.ts +452 -0
  81. package/tests/runner.ts +58 -0
  82. package/tests/scripts.test.ts +970 -0
  83. package/tests/unit.test.ts +1192 -0
  84. package/tests/upgrade.test.ts +725 -0
  85. package/tools/server.mjs +152 -0
  86. package/tsconfig.browser.json +19 -0
  87. package/tsconfig.json +18 -0
  88. package/tsconfig.publish.json +13 -0
@@ -0,0 +1,4 @@
1
+ /* Registers a non-function: the loader must reject the table itself. */
2
+ globalThis.GraphEngine.registerEngineNamespace("badmin", {
3
+ notAFunction: 42
4
+ });
@@ -0,0 +1,2 @@
1
+ /* Throws while the module body runs. */
2
+ throw new Error("fixture-broken: immediate failure");
@@ -0,0 +1,4 @@
1
+ /* A .js file without ESM syntax — the detector defaults to CommonJS. */
2
+ module.exports = {
3
+ plainCjs: () => "plain cjs"
4
+ };
@@ -0,0 +1,4 @@
1
+ module.exports = {
2
+ shared: () => "from A",
3
+ onlyA: () => "A"
4
+ };
@@ -0,0 +1,4 @@
1
+ module.exports = {
2
+ shared: () => "from B",
3
+ onlyB: () => "B"
4
+ };
@@ -0,0 +1,2 @@
1
+ /* Provides no functions at all — only data. */
2
+ module.exports = { answer: 42 };
@@ -0,0 +1,10 @@
1
+ /* ESM fixture — named exports only. */
2
+ export const classifyOrder = () => "standard";
3
+ export const isPriority = value => value === "priority";
4
+ export const chargeCard = () => "charged";
5
+ export const shipOrder = () => "shipped";
6
+ export const manualReview = () => "queued";
7
+ export const rejectOrder = () => "rejected";
8
+
9
+ /* non-function export: ignored + reported */
10
+ export const version = "fixture-esm";
@@ -0,0 +1,3 @@
1
+ /* A .js file with ESM syntax — the auto-detector must pick ESM. */
2
+ export const greetFromJs = () => "hello from .js ESM";
3
+ export const isHigh = value => value === "high";
@@ -0,0 +1,6 @@
1
+ /* Strategy A, self-registration: the script calls the engine global
2
+ * that the loader installs for the duration of the load. */
3
+ globalThis.GraphEngine.registerEngineNamespace("billing", {
4
+ invoiceOrder: () => "invoiced",
5
+ isBillable: value => value === "priority"
6
+ });
@@ -0,0 +1,7 @@
1
+ /* ESM + global registration in one script: the registered table and the
2
+ * exported functions both land in the namespace. */
3
+ globalThis.GraphEngine.registerEngineNamespace("telemetry", {
4
+ recordRun: () => "recorded"
5
+ });
6
+
7
+ export const traceId = () => "trace-1";
@@ -0,0 +1,4 @@
1
+ /* Declared as one namespace, registers another. */
2
+ globalThis.GraphEngine.registerEngineNamespace("other", {
3
+ nope: () => 1
4
+ });
@@ -0,0 +1,7 @@
1
+ /* Proves the script gets a REAL require() resolved from its own
2
+ * directory — same-realm loading, not an isolated evaluator. */
3
+ const { helper } = require("./sibling-helper.cjs");
4
+
5
+ module.exports = {
6
+ usesSibling: () => `sibling said ${helper()}`
7
+ };
@@ -0,0 +1,14 @@
1
+ /* CJS fixture — a plain { name: function } export table.
2
+ * `STATUS` is deliberately a non-function export: the loader ignores it
3
+ * and reports it under `ignoredExports`. */
4
+ const STATUS = "fixture-order";
5
+
6
+ module.exports = {
7
+ classifyOrder: () => "priority",
8
+ isPriority: value => value === "priority",
9
+ chargeCard: context => `charged@${context.attempt}`,
10
+ shipOrder: () => "shipped",
11
+ manualReview: () => "queued for a human",
12
+ rejectOrder: () => "rejected",
13
+ STATUS
14
+ };
@@ -0,0 +1,3 @@
1
+ module.exports = {
2
+ helper: () => "hi"
3
+ };
@@ -0,0 +1,6 @@
1
+ /* Uses the global, then throws — the claim survives, the load fails. */
2
+ globalThis.GraphEngine.registerEngineNamespace("halfway", {
3
+ halfwayDone: () => "claimed"
4
+ });
5
+
6
+ throw new Error("fixture: exploded after registering");