anhedral 0.11.0 → 0.11.2

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 (149) hide show
  1. package/README.md +50 -170
  2. package/assets/patches/LICENSE.braces +21 -0
  3. package/assets/patches/LICENSE.node-forge +50 -0
  4. package/assets/patches/audit-deps.mjs +167 -0
  5. package/assets/patches/braces@3.0.3.patch +127 -0
  6. package/assets/patches/node-forge@1.4.0.patch +41 -0
  7. package/dist/auth-schema.js +3 -3
  8. package/dist/bin.js +15 -11
  9. package/dist/capabilities.d.ts +4 -4
  10. package/dist/capabilities.js +6 -2
  11. package/dist/capability-contract.js +22 -5
  12. package/dist/catalog-model.d.ts +24 -0
  13. package/dist/catalog-model.js +1 -0
  14. package/dist/catalog-registration.d.ts +16 -0
  15. package/dist/catalog-registration.js +22 -0
  16. package/dist/catalog-snapshot.d.ts +5 -0
  17. package/dist/catalog-snapshot.js +97 -0
  18. package/dist/cli-arguments.js +1 -1
  19. package/dist/cli-output.js +27 -2
  20. package/dist/cloudflare.d.ts +7 -1
  21. package/dist/cloudflare.js +36 -6
  22. package/dist/command-schema.js +49 -5
  23. package/dist/delivery.d.ts +10 -3
  24. package/dist/delivery.js +154 -37
  25. package/dist/dependencies.d.ts +24 -0
  26. package/dist/dependencies.js +48 -0
  27. package/dist/dependency-patches.d.ts +7 -0
  28. package/dist/dependency-patches.js +125 -0
  29. package/dist/index.d.ts +3 -0
  30. package/dist/index.js +2 -0
  31. package/dist/inspector-model.d.ts +9 -1
  32. package/dist/integration-service-readers.d.ts +13 -0
  33. package/dist/integration-service-readers.js +173 -0
  34. package/dist/lifecycle.d.ts +0 -1
  35. package/dist/lifecycle.js +0 -1
  36. package/dist/neon-service-data.d.ts +8 -0
  37. package/dist/neon-service-data.js +117 -0
  38. package/dist/pnpm-policy.d.ts +2 -2
  39. package/dist/pnpm-policy.js +19 -45
  40. package/dist/project-catalog.d.ts +41 -0
  41. package/dist/project-catalog.js +288 -0
  42. package/dist/project-config.d.ts +14 -0
  43. package/dist/project-config.js +89 -0
  44. package/dist/project-inspector.js +73 -17
  45. package/dist/project-lifecycle.d.ts +25 -0
  46. package/dist/project-lifecycle.js +57 -0
  47. package/dist/project-state.d.ts +5 -1
  48. package/dist/project-state.js +122 -16
  49. package/dist/provider-auth.js +2 -3
  50. package/dist/provider-readiness.js +27 -10
  51. package/dist/providers/adapters.js +4 -1
  52. package/dist/providers/api.d.ts +1 -0
  53. package/dist/providers/api.js +1 -0
  54. package/dist/providers/config.js +6 -8
  55. package/dist/providers/provision.js +1 -1
  56. package/dist/providers/recovery.d.ts +1 -1
  57. package/dist/providers/runtime.d.ts +1 -1
  58. package/dist/providers/runtime.js +46 -23
  59. package/dist/providers/state.d.ts +1 -2
  60. package/dist/providers/state.js +14 -54
  61. package/dist/provision.d.ts +9 -0
  62. package/dist/provision.js +30 -1
  63. package/dist/r2-service-data.d.ts +2 -0
  64. package/dist/r2-service-data.js +136 -0
  65. package/dist/readiness.js +9 -13
  66. package/dist/registry/add.js +64 -21
  67. package/dist/registry/commands.js +7 -9
  68. package/dist/registry/options.d.ts +1 -1
  69. package/dist/registry/options.js +4 -4
  70. package/dist/registry/receipt.d.ts +1 -0
  71. package/dist/registry/receipt.js +19 -4
  72. package/dist/registry/resolve.js +5 -1
  73. package/dist/registry/usage.js +1 -5
  74. package/dist/render.d.ts +2 -0
  75. package/dist/render.js +6 -0
  76. package/dist/runtime-policy.d.ts +4 -0
  77. package/dist/runtime-policy.js +21 -0
  78. package/dist/scaffold/bootstrap.js +2 -2
  79. package/dist/scaffold/compose.js +9 -3
  80. package/dist/scaffold/database.js +107 -25
  81. package/dist/scaffold/documentation.js +18 -13
  82. package/dist/scaffold/lint.d.ts +4 -0
  83. package/dist/scaffold/lint.js +56 -0
  84. package/dist/scaffold/neon-realtime.d.ts +2 -0
  85. package/dist/scaffold/neon-realtime.js +97 -0
  86. package/dist/scaffold/stack-documentation.js +1 -1
  87. package/dist/scaffold/void.d.ts +4 -0
  88. package/dist/scaffold/void.js +256 -0
  89. package/dist/scaffold/web.js +7 -1
  90. package/dist/scaffold/workspace.js +120 -29
  91. package/dist/service-deletion.d.ts +29 -0
  92. package/dist/service-deletion.js +195 -0
  93. package/dist/service-descriptor.d.ts +10 -0
  94. package/dist/service-descriptor.js +78 -0
  95. package/dist/service-model.d.ts +49 -0
  96. package/dist/service-model.js +8 -0
  97. package/dist/service-operations.d.ts +29 -0
  98. package/dist/service-operations.js +78 -0
  99. package/dist/service-readers.d.ts +8 -0
  100. package/dist/service-readers.js +247 -0
  101. package/dist/services-command.d.ts +39 -0
  102. package/dist/services-command.js +100 -0
  103. package/dist/ship.d.ts +36 -8
  104. package/dist/ship.js +39 -13
  105. package/dist/stack-registry.d.ts +4 -2
  106. package/dist/stack-registry.js +41 -11
  107. package/dist/standard.js +23 -4
  108. package/dist/transaction.d.ts +2 -0
  109. package/dist/transaction.js +10 -0
  110. package/dist/util.js +17 -2
  111. package/dist/vercel.d.ts +2 -0
  112. package/dist/vercel.js +69 -13
  113. package/dist/version.d.ts +1 -1
  114. package/dist/version.js +1 -1
  115. package/dist/vinext.d.ts +1 -0
  116. package/dist/vinext.js +13 -1
  117. package/dist/void-execution.d.ts +10 -0
  118. package/dist/void-execution.js +94 -0
  119. package/dist/void-migrations.d.ts +6 -0
  120. package/dist/void-migrations.js +110 -0
  121. package/dist/void-state.d.ts +16 -0
  122. package/dist/void-state.js +65 -0
  123. package/dist/void.d.ts +3 -0
  124. package/dist/void.js +5 -0
  125. package/docs/cli-design.md +2 -2
  126. package/docs/plugin-ui.md +51 -10
  127. package/docs/provider-configuration.md +10 -11
  128. package/docs/software-factory.md +192 -0
  129. package/docs/stack-standard.md +142 -0
  130. package/docs/void-verification.md +185 -0
  131. package/package.json +23 -21
  132. package/assets/anhedral-mark.svg +0 -4
  133. package/assets/anhedral-stack-technical.svg +0 -322
  134. package/assets/anhedral-stack.svg +0 -322
  135. package/assets/anhedral.svg +0 -4
  136. package/assets/favicon.ico +0 -0
  137. package/assets/security/LICENSES.txt +0 -63
  138. package/assets/security/audit-deps.mjs +0 -300
  139. package/assets/security/braces-regression.mjs +0 -102
  140. package/assets/security/braces@3.0.3.patch +0 -285
  141. package/assets/security/decode-uri-component@0.2.2.patch +0 -149
  142. package/assets/security/decoder-regression.mjs +0 -37
  143. package/assets/security/forge-regression.mjs +0 -46
  144. package/assets/security/manifest.json +0 -53
  145. package/assets/security/node-forge@1.4.0.patch +0 -26
  146. package/dist/security-backports.d.ts +0 -3
  147. package/dist/security-backports.js +0 -26
  148. package/docs/application-stack-standard.md +0 -75
  149. package/docs/delivery-workflow.md +0 -97
@@ -0,0 +1,127 @@
1
+ diff --git a/lib/compile.js b/lib/compile.js
2
+ --- a/lib/compile.js
3
+ +++ b/lib/compile.js
4
+ @@ -2,8 +2,10 @@
5
+
6
+ const fill = require('fill-range');
7
+ const utils = require('./utils');
8
+ +const { checkAst } = require('./limits');
9
+
10
+ const compile = (ast, options = {}) => {
11
+ + checkAst(ast);
12
+ const walk = (node, parent = {}) => {
13
+ const invalidBlock = utils.isInvalidBrace(parent);
14
+ const invalidNode = node.invalid === true && options.escapeInvalid === true;
15
+ diff --git a/lib/expand.js b/lib/expand.js
16
+ --- a/lib/expand.js
17
+ +++ b/lib/expand.js
18
+ @@ -3,6 +3,7 @@
19
+ const fill = require('fill-range');
20
+ const stringify = require('./stringify');
21
+ const utils = require('./utils');
22
+ +const { checkAst } = require('./limits');
23
+
24
+ const append = (queue = '', stash = '', enclose = false) => {
25
+ const result = [];
26
+ @@ -31,6 +32,7 @@
27
+ };
28
+
29
+ const expand = (ast, options = {}) => {
30
+ + checkAst(ast, true);
31
+ const rangeLimit = options.rangeLimit === undefined ? 1000 : options.rangeLimit;
32
+
33
+ const walk = (node, parent = {}) => {
34
+ diff --git a/lib/limits.js b/lib/limits.js
35
+ new file mode 100644
36
+ --- /dev/null
37
+ +++ b/lib/limits.js
38
+ @@ -0,0 +1,44 @@
39
+ +'use strict';
40
+ +
41
+ +const MAX_DEPTH = 100;
42
+ +const fail = () => {
43
+ + throw new RangeError(`braces nesting exceeds maximum depth of ${MAX_DEPTH}`);
44
+ +};
45
+ +
46
+ +// Preflight recursive walkers iteratively. The root is not a nesting level;
47
+ +// leaves do not add a level. Normal parent links are intentionally separate
48
+ +// from child traversal, since a parsed AST links each child to its parent.
49
+ +const checkAst = (ast, checkParents = false) => {
50
+ + const active = new Set();
51
+ + const stack = [{ node: ast, depth: 0, root: true }];
52
+ + while (stack.length) {
53
+ + const frame = stack.pop();
54
+ + const node = frame.node;
55
+ + if (!node || typeof node !== 'object') continue;
56
+ + if (frame.exit) {
57
+ + active.delete(node);
58
+ + continue;
59
+ + }
60
+ + if (active.has(node)) fail();
61
+ + const children = Array.isArray(node.nodes) ? node.nodes : [];
62
+ + const depth = frame.depth + (Array.isArray(node.nodes) && !(frame.root && node.type === 'root') ? 1 : 0);
63
+ + if (depth > MAX_DEPTH) fail();
64
+ + if (checkParents) {
65
+ + const parents = new Set();
66
+ + let parent = node;
67
+ + let count = 0;
68
+ + while (parent && parent.type !== 'brace' && parent.type !== 'root' && parent.parent) {
69
+ + if (parents.has(parent) || ++count > MAX_DEPTH + 1) fail();
70
+ + parents.add(parent);
71
+ + parent = parent.parent;
72
+ + }
73
+ + }
74
+ + active.add(node);
75
+ + stack.push({ node, exit: true });
76
+ + for (let index = children.length - 1; index >= 0; index--) {
77
+ + stack.push({ node: children[index], depth });
78
+ + }
79
+ + }
80
+ +};
81
+ +
82
+ +module.exports = { MAX_DEPTH, checkAst };
83
+ diff --git a/lib/parse.js b/lib/parse.js
84
+ --- a/lib/parse.js
85
+ +++ b/lib/parse.js
86
+ @@ -1,6 +1,7 @@
87
+ 'use strict';
88
+
89
+ const stringify = require('./stringify');
90
+ +const { MAX_DEPTH } = require('./limits');
91
+
92
+ /**
93
+ * Constants
94
+ @@ -143,6 +144,9 @@
95
+ */
96
+
97
+ if (value === CHAR_LEFT_PARENTHESES) {
98
+ + if (stack.length > MAX_DEPTH) {
99
+ + throw new RangeError(`braces nesting exceeds maximum depth of ${MAX_DEPTH}`);
100
+ + }
101
+ block = push({ type: 'paren', nodes: [] });
102
+ stack.push(block);
103
+ push({ type: 'text', value });
104
+ @@ -195,6 +199,9 @@
105
+ */
106
+
107
+ if (value === CHAR_LEFT_CURLY_BRACE) {
108
+ + if (stack.length > MAX_DEPTH) {
109
+ + throw new RangeError(`braces nesting exceeds maximum depth of ${MAX_DEPTH}`);
110
+ + }
111
+ depth++;
112
+
113
+ const dollar = prev.value && prev.value.slice(-1) === '$' || block.dollar === true;
114
+ diff --git a/lib/stringify.js b/lib/stringify.js
115
+ --- a/lib/stringify.js
116
+ +++ b/lib/stringify.js
117
+ @@ -1,8 +1,10 @@
118
+ 'use strict';
119
+
120
+ const utils = require('./utils');
121
+ +const { checkAst } = require('./limits');
122
+
123
+ module.exports = (ast, options = {}) => {
124
+ + checkAst(ast);
125
+ const stringify = (node, parent = {}) => {
126
+ const invalidBlock = options.escapeInvalid && utils.isInvalidBrace(parent);
127
+ const invalidNode = node.invalid === true && options.escapeInvalid === true;