@pulse-compute/wasm-contracts 0.0.0 → 1.0.0-beta.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 (97) hide show
  1. package/README.md +35 -2
  2. package/package.json +124 -6
  3. package/src/assets/contracts.js +296 -0
  4. package/src/config/provider-resolution.js +54 -0
  5. package/src/config/runtime-provider-kv.js +73 -0
  6. package/src/config/symbolic-refs.js +192 -0
  7. package/src/crypto/contracts.js +647 -0
  8. package/src/definitions/config-schema.js +30 -0
  9. package/src/definitions/handler-roles.js +66 -0
  10. package/src/definitions/path-grammar.js +11 -0
  11. package/src/definitions/router-api.js +149 -0
  12. package/src/diagnostics/codes.js +42 -0
  13. package/src/diagnostics/reporter.js +20 -0
  14. package/src/diagnostics.js +139 -0
  15. package/src/dispatch-table.js +23 -0
  16. package/src/entities/catalog.d.ts +7 -0
  17. package/src/entities/catalog.js +87 -0
  18. package/src/entities/contracts.d.ts +95 -0
  19. package/src/entities/contracts.js +122 -0
  20. package/src/entities/json-rpc.d.ts +27 -0
  21. package/src/entities/json-rpc.js +69 -0
  22. package/src/entities/runtime.d.ts +67 -0
  23. package/src/entities/runtime.js +288 -0
  24. package/src/events/contracts.js +456 -0
  25. package/src/execution-plan.js +42 -0
  26. package/src/grip/contracts.js +106 -0
  27. package/src/handler/backend-json-request-body.js +58 -0
  28. package/src/handler/beta-lifecycle-golden.js +97 -0
  29. package/src/handler/canonical-native-plan.js +143 -0
  30. package/src/handler/canonical-native-runtime.js +168 -0
  31. package/src/handler/canonical-runtime.js +13 -0
  32. package/src/handler/context.js +131 -0
  33. package/src/handler/ctx-contract.js +71 -0
  34. package/src/handler/doctor-readiness-aggregator.js +67 -0
  35. package/src/handler/effects.js +446 -0
  36. package/src/handler/io-lifecycle.js +134 -0
  37. package/src/handler/lifecycle-authoring-alignment.js +56 -0
  38. package/src/handler/lifecycle-readiness-aggregate.js +93 -0
  39. package/src/handler/reference-node-lifecycle-golden.js +73 -0
  40. package/src/handler/request-json-body.js +147 -0
  41. package/src/handler/runtime-api.js +471 -0
  42. package/src/handler/schema-decode-result.js +135 -0
  43. package/src/handler/schema-response-codec.js +141 -0
  44. package/src/handler/surface-contract.js +601 -0
  45. package/src/handler/types-contract.js +51 -0
  46. package/src/handler-table.js +28 -0
  47. package/src/host/backend-capabilities.js +24 -0
  48. package/src/host/capabilities.js +273 -0
  49. package/src/host/channel-broadcaster.js +60 -0
  50. package/src/host/json-body.js +80 -0
  51. package/src/host/request-result-headers.js +38 -0
  52. package/src/host/streaming-passthrough.js +90 -0
  53. package/src/host/wasm-host-abi.js +154 -0
  54. package/src/index.js +75 -0
  55. package/src/jwt/contracts.js +427 -0
  56. package/src/library/api-surface.js +99 -0
  57. package/src/library/contracts.js +273 -0
  58. package/src/library/manifest.js +317 -0
  59. package/src/library/second-package-owned-lowering.js +39 -0
  60. package/src/library/sidecars.js +147 -0
  61. package/src/logging.js +89 -0
  62. package/src/package/package-contract.js +975 -0
  63. package/src/package/package-contract.schema.json +303 -0
  64. package/src/package/runtime-pulse-live.js +100 -0
  65. package/src/path-table.js +12 -0
  66. package/src/path.js +275 -0
  67. package/src/project/config-factory.js +48 -0
  68. package/src/project/config-plan.js +409 -0
  69. package/src/project/config-runtime.js +46 -0
  70. package/src/project/javascript-application.js +212 -0
  71. package/src/project/javascript-core-capabilities.js +44 -0
  72. package/src/project/native-optimization.js +9 -0
  73. package/src/project/package-ownership.js +242 -0
  74. package/src/project/package-product-projection.js +171 -0
  75. package/src/project/reachable-graph-identity.js +219 -0
  76. package/src/project/reachable-graph-projections.js +279 -0
  77. package/src/project/reachable-graph-resolver.js +303 -0
  78. package/src/project/reachable-graph-v2.js +430 -0
  79. package/src/project/reachable-graph-v2.schema.json +285 -0
  80. package/src/project/reachable-graph.js +199 -0
  81. package/src/project/reachable-graph.schema.json +222 -0
  82. package/src/project/target-support-evidence.js +559 -0
  83. package/src/provider/canonical-provider.js +239 -0
  84. package/src/provider/final-wasm-policy.js +87 -0
  85. package/src/provider/toolchain.js +771 -0
  86. package/src/route-plan.js +43 -0
  87. package/src/s3/contracts.js +12 -0
  88. package/src/schema-json/compile.js +63 -0
  89. package/src/schema-json/contracts.js +10 -0
  90. package/src/schema-json/generic-parser.js +62 -0
  91. package/src/schema-json/registry.js +359 -0
  92. package/src/schema-json/semantic-trace.js +241 -0
  93. package/src/schema-json/v1.js +65 -0
  94. package/src/schema-json/v2.js +110 -0
  95. package/src/sha256.js +104 -0
  96. package/src/spine.js +381 -0
  97. package/src/stable-id.js +142 -0
@@ -0,0 +1,222 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://pulsecompute.io/contracts/pulse.reachable-graph-manifest.v1.schema.json",
4
+ "title": "Pulse reachable graph manifest",
5
+ "type": "object",
6
+ "required": [
7
+ "version",
8
+ "handlerReferenceVersion",
9
+ "entry",
10
+ "modules",
11
+ "edges",
12
+ "handlers",
13
+ "cycles",
14
+ "firstUnsupportedBoundary",
15
+ "graphHash"
16
+ ],
17
+ "properties": {
18
+ "version": { "const": "pulse.reachable-graph-manifest.v1" },
19
+ "handlerReferenceVersion": { "const": "pulse.handler-reference.v1" },
20
+ "entry": { "type": "string", "minLength": 1 },
21
+ "modules": {
22
+ "type": "array",
23
+ "items": { "$ref": "#/$defs/module" }
24
+ },
25
+ "edges": {
26
+ "type": "array",
27
+ "items": { "$ref": "#/$defs/edge" }
28
+ },
29
+ "handlers": {
30
+ "type": "array",
31
+ "items": { "$ref": "#/$defs/handler" }
32
+ },
33
+ "cycles": {
34
+ "type": "array",
35
+ "items": {
36
+ "type": "array",
37
+ "minItems": 1,
38
+ "items": { "type": "string", "minLength": 1 },
39
+ "uniqueItems": true
40
+ }
41
+ },
42
+ "firstUnsupportedBoundary": {
43
+ "oneOf": [
44
+ { "type": "null" },
45
+ { "$ref": "#/$defs/unsupportedBoundary" }
46
+ ]
47
+ },
48
+ "graphHash": {
49
+ "type": "string",
50
+ "pattern": "^[0-9a-f]{64}$"
51
+ }
52
+ },
53
+ "$defs": {
54
+ "source": {
55
+ "type": "object",
56
+ "required": ["file", "line", "column"],
57
+ "properties": {
58
+ "file": { "type": "string", "minLength": 1 },
59
+ "line": { "type": "integer", "minimum": 1 },
60
+ "column": { "type": "integer", "minimum": 1 }
61
+ },
62
+ "additionalProperties": false
63
+ },
64
+ "module": {
65
+ "type": "object",
66
+ "required": [
67
+ "id",
68
+ "kind",
69
+ "owner",
70
+ "resolved",
71
+ "packageName",
72
+ "packageContract",
73
+ "contentHash",
74
+ "exports",
75
+ "reExports",
76
+ "source"
77
+ ],
78
+ "properties": {
79
+ "id": { "type": "string", "minLength": 1 },
80
+ "kind": {
81
+ "enum": ["project", "package", "generated", "external"]
82
+ },
83
+ "owner": {
84
+ "enum": [
85
+ "application",
86
+ "pulse-runtime",
87
+ "pulse-package",
88
+ "third-party",
89
+ "generated",
90
+ "external"
91
+ ]
92
+ },
93
+ "resolved": { "type": "string", "minLength": 1 },
94
+ "packageName": {
95
+ "type": ["string", "null"]
96
+ },
97
+ "packageContract": {
98
+ "type": ["string", "null"]
99
+ },
100
+ "contentHash": {
101
+ "oneOf": [
102
+ { "type": "null" },
103
+ { "type": "string", "pattern": "^[0-9a-f]{64}$" }
104
+ ]
105
+ },
106
+ "exports": {
107
+ "type": "array",
108
+ "items": { "type": "string", "minLength": 1 },
109
+ "uniqueItems": true
110
+ },
111
+ "reExports": {
112
+ "type": "array",
113
+ "items": { "type": "string", "minLength": 1 },
114
+ "uniqueItems": true
115
+ },
116
+ "source": {
117
+ "oneOf": [
118
+ { "type": "null" },
119
+ { "$ref": "#/$defs/source" }
120
+ ]
121
+ }
122
+ },
123
+ "additionalProperties": false
124
+ },
125
+ "edge": {
126
+ "type": "object",
127
+ "required": [
128
+ "id",
129
+ "kind",
130
+ "from",
131
+ "to",
132
+ "specifier",
133
+ "importedNames",
134
+ "exportedNames",
135
+ "packageContract",
136
+ "source"
137
+ ],
138
+ "properties": {
139
+ "id": { "type": "string", "minLength": 1 },
140
+ "kind": {
141
+ "enum": [
142
+ "runtime-import",
143
+ "type-import",
144
+ "re-export",
145
+ "package-contract",
146
+ "lifecycle"
147
+ ]
148
+ },
149
+ "from": { "type": "string", "minLength": 1 },
150
+ "to": { "type": "string", "minLength": 1 },
151
+ "specifier": { "type": "string", "minLength": 1 },
152
+ "importedNames": {
153
+ "type": "array",
154
+ "items": { "type": "string", "minLength": 1 },
155
+ "uniqueItems": true
156
+ },
157
+ "exportedNames": {
158
+ "type": "array",
159
+ "items": { "type": "string", "minLength": 1 },
160
+ "uniqueItems": true
161
+ },
162
+ "packageContract": {
163
+ "type": ["string", "null"]
164
+ },
165
+ "source": { "$ref": "#/$defs/source" }
166
+ },
167
+ "additionalProperties": false
168
+ },
169
+ "handler": {
170
+ "type": "object",
171
+ "required": [
172
+ "version",
173
+ "id",
174
+ "moduleId",
175
+ "exportName",
176
+ "localName",
177
+ "role",
178
+ "wrappers",
179
+ "source"
180
+ ],
181
+ "properties": {
182
+ "version": { "const": "pulse.handler-reference.v1" },
183
+ "id": { "type": "string", "minLength": 1 },
184
+ "moduleId": { "type": "string", "minLength": 1 },
185
+ "exportName": { "type": ["string", "null"] },
186
+ "localName": { "type": ["string", "null"] },
187
+ "role": {
188
+ "enum": ["handler", "route", "middleware", "event", "error-middleware", "router"]
189
+ },
190
+ "wrappers": {
191
+ "type": "array",
192
+ "items": {
193
+ "enum": ["parentheses", "as-cast", "type-assertion", "satisfies", "non-null"]
194
+ },
195
+ "uniqueItems": true
196
+ },
197
+ "source": { "$ref": "#/$defs/source" }
198
+ },
199
+ "additionalProperties": false
200
+ },
201
+ "unsupportedBoundary": {
202
+ "type": "object",
203
+ "required": ["kind", "specifier", "from", "source"],
204
+ "properties": {
205
+ "kind": {
206
+ "enum": [
207
+ "dynamic-import",
208
+ "commonjs-require",
209
+ "computed-specifier",
210
+ "loader-hook",
211
+ "unknown-runtime-side-effect"
212
+ ]
213
+ },
214
+ "specifier": { "type": "string", "minLength": 1 },
215
+ "from": { "type": ["string", "null"] },
216
+ "source": { "$ref": "#/$defs/source" }
217
+ },
218
+ "additionalProperties": false
219
+ }
220
+ },
221
+ "additionalProperties": false
222
+ }