@pulse-compute/wasm-compiler 1.0.0-beta.2 → 1.0.0-beta.4

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
@@ -8,9 +8,9 @@
8
8
  > **Stability:** Internal compiler interface; no application-author compatibility guarantee.<br>
9
9
  > **npm:** [`@pulse-compute/wasm-compiler`](https://www.npmjs.com/package/@pulse-compute/wasm-compiler)<br>
10
10
  > **Canonical replacement:** `@pulse-compute/cli`<br>
11
- > **Canonical documentation:** [Package guide](https://pulsecompute.io/v1.0.0-beta.2/packages/implementation-packages/)
11
+ > **Canonical documentation:** [Package guide](https://pulsecompute.io/v1.0.0-beta.4/packages/implementation-packages/)
12
12
  >
13
- > This release-status block is generated from the synchronized `Pulse 1.0.0-beta.2` package policy.
13
+ > This release-status block is generated from the synchronized `Pulse 1.0.0-beta.4` package policy.
14
14
  <!-- pulse-package-status:end -->
15
15
 
16
16
  Whole-project compiler implementation used by the `pulse` workflow. Application projects should use `@pulse-compute/cli`, not import this package directly.
@@ -52,4 +52,4 @@ The package exports its root implementation plus focused compiler, CLI, extracto
52
52
 
53
53
  Compiler changes should be covered by focused static/lowering tests, canonical project inspection, provider-plan parity, packed-package discovery where relevant, and the release documentation gates.
54
54
 
55
- See the installed [implementation package guide](https://pulsecompute.io/v1.0.0-beta.2/packages/implementation-packages/) and [compilation concepts](https://pulsecompute.io/v1.0.0-beta.2/concepts/compilation-and-lowering/).
55
+ See the installed [implementation package guide](https://pulsecompute.io/v1.0.0-beta.4/packages/implementation-packages/) and [compilation concepts](https://pulsecompute.io/v1.0.0-beta.4/concepts/compilation-and-lowering/).
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pulse-compute/wasm-compiler",
3
- "version": "1.0.0-beta.2",
3
+ "version": "1.0.0-beta.4",
4
4
  "license": "Apache-2.0",
5
5
  "description": "PulseWasm compiler package inside the Pulse monorepo.",
6
6
  "type": "commonjs",
@@ -9,15 +9,15 @@
9
9
  "pulsewasm": "./bin/pulsewasm-extract.js"
10
10
  },
11
11
  "dependencies": {
12
- "@pulse-compute/provider-fastly": "1.0.0-beta.2",
13
- "@pulse-compute/provider-node": "1.0.0-beta.2",
14
- "@pulse-compute/wasm-build-support": "1.0.0-beta.2",
15
- "@pulse-compute/wasm-contracts": "1.0.0-beta.2",
16
- "@pulse-compute/wasm-guest-link": "1.0.0-beta.2",
17
- "@pulse-compute/wasm-host-runtime": "1.0.0-beta.2",
18
- "@pulse-compute/wasm-library-kit": "1.0.0-beta.2",
19
- "@pulse-compute/wasm-runtime-core-as": "1.0.0-beta.2",
20
- "@pulse-compute/wasm-schema-json": "1.0.0-beta.2",
12
+ "@pulse-compute/provider-fastly": "1.0.0-beta.4",
13
+ "@pulse-compute/provider-node": "1.0.0-beta.4",
14
+ "@pulse-compute/wasm-build-support": "1.0.0-beta.4",
15
+ "@pulse-compute/wasm-contracts": "1.0.0-beta.4",
16
+ "@pulse-compute/wasm-guest-link": "1.0.0-beta.4",
17
+ "@pulse-compute/wasm-host-runtime": "1.0.0-beta.4",
18
+ "@pulse-compute/wasm-library-kit": "1.0.0-beta.4",
19
+ "@pulse-compute/wasm-runtime-core-as": "1.0.0-beta.4",
20
+ "@pulse-compute/wasm-schema-json": "1.0.0-beta.4",
21
21
  "assemblyscript": "0.28.18",
22
22
  "json-as": "1.5.0",
23
23
  "typescript": "5.9.3"
@@ -58,7 +58,7 @@
58
58
  "url": "git+https://github.com/pulse-compute/pulse.git",
59
59
  "directory": "wasm/packages/compiler"
60
60
  },
61
- "homepage": "https://pulsecompute.io/v1.0.0-beta.2/packages/implementation-packages/",
61
+ "homepage": "https://pulsecompute.io/v1.0.0-beta.4/packages/implementation-packages/",
62
62
  "bugs": {
63
63
  "url": "https://github.com/pulse-compute/pulse/issues"
64
64
  },
@@ -254,7 +254,7 @@ function realizeCanonicalNativePlan(plan, options = {}, providerRequirements) {
254
254
  maxBuffer: 16 * 1024 * 1024,
255
255
  timeout: Number(options.timeoutMs || 120000),
256
256
  env: schemaCodecsActive
257
- ? { ...process.env, JSON_STRICT: 'true', JSON_USE_FAST_PATH: '0' }
257
+ ? { ...process.env, JSON_STRICT: 'true', JSON_USE_FAST_PATH: '0', JSON_MODE: 'NAIVE' }
258
258
  : process.env
259
259
  });
260
260
  const durationMs = Date.now() - startedAt;
@@ -308,7 +308,7 @@ function verifyCanonicalNativeRealization(realization) {
308
308
  assemblyScript: Object.freeze({ package: 'assemblyscript', version: realization.assemblyScriptVersion }),
309
309
  optimization: resolveNativeOptimization(realization.optimization),
310
310
  jsonAs: realization.jsonAsVersion
311
- ? Object.freeze({ package: 'json-as', version: realization.jsonAsVersion, transform: true, strict: true })
311
+ ? Object.freeze({ package: 'json-as', version: realization.jsonAsVersion, transform: true, strict: true, mode: 'NAIVE', fastPath: false })
312
312
  : null,
313
313
  wasm: Object.freeze({ bytes: inspection.bytes, sha256: inspection.sha256, magic: inspection.magic }),
314
314
  wat: Object.freeze({ bytes: Buffer.byteLength(realization.wat), sha256: sha256(realization.wat) }),
@@ -202,6 +202,7 @@ function intrinsicForContextCall(parts) {
202
202
  'req.text': ['request.text', 'string'],
203
203
  'req.json': ['request.json', 'json'],
204
204
  json: ['response.json', 'pulse-result'],
205
+ encodeJson: ['schema.encode.text', 'string'],
205
206
  text: ['response.text', 'pulse-result'],
206
207
  response: ['response.custom', 'pulse-result'],
207
208
  kv: ['kv.namespace', 'kv-namespace'],
@@ -264,6 +264,7 @@ function recognizeHandlerSurface(node, options = {}) {
264
264
  const direct = Object.freeze({
265
265
  param: 'ctx.param',
266
266
  json: 'ctx.json',
267
+ encodeJson: 'ctx.encodeJson',
267
268
  text: 'ctx.text',
268
269
  response: 'ctx.response'
269
270
  });
@@ -173,7 +173,7 @@ function analyzeHandler(sourceFile, handler, ctxName, diagnostics, schemaBundleI
173
173
  );
174
174
  return;
175
175
  }
176
- const encode = usage === 'response-encode' || usage === 'fetch-encode';
176
+ const encode = usage === 'response-encode' || usage === 'fetch-encode' || usage === 'value-encode';
177
177
  schemaReferences.push(Object.freeze({
178
178
  id: schemaId,
179
179
  usage,
@@ -335,6 +335,13 @@ function analyzeHandler(sourceFile, handler, ctxName, diagnostics, schemaBundleI
335
335
  validateFetchSchema(node);
336
336
  }
337
337
  if (surface.detail.fetch.decoderCall === node) validateDecoderCall(node, 'fetch-decode');
338
+ } else if (surface.surfaceId === 'ctx.encodeJson') {
339
+ if (node.arguments.length !== 2) {
340
+ reject(node, 'PULSE_CANONICAL_DECODER_ARGUMENTS_UNSUPPORTED', 'ctx.encodeJson requires exactly a value and a registered literal schema ID.', { usage: 'value-encode', arguments: node.arguments.length });
341
+ } else {
342
+ recordSchemaReference(node, node.arguments[1], 'value-encode');
343
+ schemaBoundJsonCount += 1;
344
+ }
338
345
  } else if (['ctx.json', 'ctx.text', 'ctx.response'].includes(surface.surfaceId)) {
339
346
  const method = surface.surfaceId.slice('ctx.'.length);
340
347
  capabilities.add(`response.${method}`);