@pulse-compute/provider-node 1.0.0-beta.2 → 1.0.0-beta.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.
package/README.md CHANGED
@@ -8,9 +8,9 @@
8
8
  > **Stability:** The listed built-in toolchain entry is synchronized with the Beta bootstrap contract; other canonical Node provider interfaces remain internal.<br>
9
9
  > **npm:** [`@pulse-compute/provider-node`](https://www.npmjs.com/package/@pulse-compute/provider-node)<br>
10
10
  > **Canonical replacement:** `provider: 'node' through @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.3/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.3` package policy.
14
14
  <!-- pulse-package-status:end -->
15
15
 
16
16
  Canonical Node provider implementation used internally when a project selects `provider: 'node'`.
@@ -60,4 +60,4 @@ The package exposes focused compiler and runtime modules for the synchronized
60
60
  repository, including `runtime/canonical-api-runtime`. Those exports are
61
61
  implementation interfaces, not application-author APIs.
62
62
 
63
- See [Contracts and providers](https://pulsecompute.io/v1.0.0-beta.2/concepts/contracts-and-providers/) and [Implementation packages](https://pulsecompute.io/v1.0.0-beta.2/packages/implementation-packages/).
63
+ See [Contracts and providers](https://pulsecompute.io/v1.0.0-beta.3/concepts/contracts-and-providers/) and [Implementation packages](https://pulsecompute.io/v1.0.0-beta.3/packages/implementation-packages/).
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pulse-compute/provider-node",
3
- "version": "1.0.0-beta.2",
3
+ "version": "1.0.0-beta.3",
4
4
  "license": "Apache-2.0",
5
5
  "engines": {
6
6
  "node": "^22.14.0 || ^24.0.0"
@@ -42,13 +42,13 @@
42
42
  "./javascript/source-package": "./src/javascript/source-package.js"
43
43
  },
44
44
  "dependencies": {
45
- "@pulse-compute/crypto": "1.0.0-beta.2",
46
- "@pulse-compute/jwt": "1.0.0-beta.2",
47
- "@pulse-compute/runtime": "1.0.0-beta.2",
48
- "@pulse-compute/s3": "1.0.0-beta.2",
49
- "@pulse-compute/wasm-build-support": "1.0.0-beta.2",
50
- "@pulse-compute/wasm-contracts": "1.0.0-beta.2",
51
- "@pulse-compute/wasm-host-runtime": "1.0.0-beta.2"
45
+ "@pulse-compute/crypto": "1.0.0-beta.3",
46
+ "@pulse-compute/jwt": "1.0.0-beta.3",
47
+ "@pulse-compute/runtime": "1.0.0-beta.3",
48
+ "@pulse-compute/s3": "1.0.0-beta.3",
49
+ "@pulse-compute/wasm-build-support": "1.0.0-beta.3",
50
+ "@pulse-compute/wasm-contracts": "1.0.0-beta.3",
51
+ "@pulse-compute/wasm-host-runtime": "1.0.0-beta.3"
52
52
  },
53
53
  "publishConfig": {
54
54
  "access": "public"
@@ -64,7 +64,7 @@
64
64
  "url": "git+https://github.com/pulse-compute/pulse.git",
65
65
  "directory": "packages/provider-node"
66
66
  },
67
- "homepage": "https://pulsecompute.io/v1.0.0-beta.2/packages/implementation-packages/",
67
+ "homepage": "https://pulsecompute.io/v1.0.0-beta.3/packages/implementation-packages/",
68
68
  "bugs": {
69
69
  "url": "https://github.com/pulse-compute/pulse/issues"
70
70
  }
@@ -230,6 +230,8 @@ function createNodeJavascriptHandler(application, options = {}) {
230
230
  requestHeaders: adapted.headerPairs,
231
231
  signal: options.signal || adapted.request.signal,
232
232
  fetchImplementation: options.fetchImplementation,
233
+ s3: options.s3 || options.bindings && options.bindings.s3,
234
+ s3FetchImplementation: options.s3FetchImplementation,
233
235
  assetsLookup: options.assetsLookup,
234
236
  gripBroadcast: options.gripBroadcast,
235
237
  jwtCaptureWallClock: options.jwtCaptureWallClock,
@@ -13,7 +13,7 @@ function createNodeJavascriptS3(options, secretLookup) {
13
13
  catch { selected = null; }
14
14
  return readS3(effect, {
15
15
  s3, signal: execution.signal, registerRedactionValue: execution.registerRedactionValue,
16
- fetchImplementation: options.fetchImplementation, cryptoTarget: 'javascript',
16
+ fetchImplementation: options.s3FetchImplementation || options.fetchImplementation, cryptoTarget: 'javascript',
17
17
  cryptoVerifier: selected, cryptoRealization: selected && selected.realization
18
18
  }, (name) => secretLookup(name, execution));
19
19
  };
@@ -47,6 +47,10 @@ async function executeNodeJavascriptTestCase(application, testCase, options = {}
47
47
  effectAdapter: options.effectAdapter,
48
48
  fetchImplementation: fixtureFetch,
49
49
  gripFetchImplementation: gripFixtureFetch,
50
+ s3FetchImplementation: options.s3FetchImplementation || createNodeJavascriptFixtureFetch(
51
+ testCase.fetches || {}, options.fetchImplementation || (options.networkFetch === true ? globalThis.fetch : undefined),
52
+ { rawResponse: true }
53
+ ),
50
54
  grip: testCase.grip || options.grip,
51
55
  gripBroadcast: options.gripBroadcast,
52
56
  jwtCaptureWallClock: options.jwtCaptureWallClock,
@@ -502,7 +502,10 @@ function createNodeProviderAdapter(baseOptions = {}) {
502
502
  dispatchFetch,
503
503
  async dispatchEffect(effect, executionOptions = {}) {
504
504
  if (['s3.head', 's3.getText', 's3.putText'].includes(effect.kind)) {
505
- return require('./s3-reader.js').readS3(effect, { ...baseOptions, ...executionOptions }, (name) => bindingValue(executionOptions, 'secrets', name));
505
+ return require('./s3-reader.js').readS3(effect, { ...baseOptions, ...executionOptions,
506
+ fetchImplementation: executionOptions.s3FetchImplementation || baseOptions.s3FetchImplementation
507
+ || executionOptions.fetchImplementation || baseOptions.fetchImplementation
508
+ }, (name) => bindingValue(executionOptions, 'secrets', name));
506
509
  }
507
510
  if (effect.kind === 'fetch') return dispatchFetch(effect, executionOptions);
508
511
  if (effect.kind === 'jwt.verify') return verifyNativeJwt(effect, executionOptions);
package/src/toolchain.js CHANGED
@@ -157,6 +157,10 @@ function createDriver() {
157
157
  return Object.freeze({
158
158
  ...values,
159
159
  s3: config.bindings.s3,
160
+ s3FetchImplementation: values.s3FetchImplementation || require('./javascript/fetch-adapter.js').createNodeJavascriptFixtureFetch(
161
+ values.fetches || {}, values.fetchImplementation || (values.liveFetch === true ? globalThis.fetch : undefined),
162
+ { rawResponse: true }
163
+ ),
160
164
  providerAdapter: nodeRuntime.createNodeProviderAdapter()
161
165
  });
162
166
  },
@@ -215,6 +219,11 @@ function createDriver() {
215
219
  javascript: NODE_JAVASCRIPT_TARGET_DESCRIPTOR
216
220
  }),
217
221
  execute: nodeRuntime.executeCanonicalProgram,
222
+ prepareNativeExecution(invocation) {
223
+ const { executeCanonicalNativeModule } = require('@pulse-compute/wasm-host-runtime/runtime/canonical-native-host');
224
+ const native = { ...invocation.nativeArtifact, plan: invocation.applicationPlan };
225
+ return (options) => executeCanonicalNativeModule(native, options);
226
+ },
218
227
  createLoweringPlan(metadata, config = {}) {
219
228
  require('./config/s3.js').validateNodeS3Operations(metadata, config.bindings || {});
220
229
  return canonicalProvider.createProviderLoweringPlan(metadata, nodeRuntime.NODE_PROVIDER_DESCRIPTOR, {