@pulse-compute/provider-fastly 1.0.0-beta.7 → 1.0.0-beta.9
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 +6 -6
- package/dist/config-schema.json +13 -0
- package/dist/index.d.ts +8 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -0
- package/dist/index.js.map +1 -1
- package/package.json +11 -11
- package/src/build/canonical-target.js +7 -0
- package/src/build/entities-native.js +6 -13
- package/src/build/kv-native.as.ts +10 -6
- package/src/build/native-application-errors.js +14 -8
- package/src/build/native-body-forwarding.as.ts +334 -0
- package/src/build/native-body-forwarding.js +69 -0
- package/src/build/native-fetch-deadlines.as.ts +161 -0
- package/src/build/native-fetch-deadlines.js +27 -0
- package/src/build/native-fetch-errors.js +40 -0
- package/src/build/native-handle-ownership.js +127 -0
- package/src/build/native-header-lookup.js +54 -0
- package/src/build/native-http-effects.js +6 -1
- package/src/build/native-platform-capabilities.js +99 -33
- package/src/build/native-stdio.js +20 -0
- package/src/build/native-string-values.js +2 -2
- package/src/build/native-value-budget.js +33 -1
- package/src/build/request-budget.js +3 -1
- package/src/build/schema-admission.js +3 -3
- package/src/config-api.js +1 -0
- package/src/config-schema.json +13 -0
- package/src/index.ts +11 -0
- package/src/provider-contract.js +6 -3
- package/src/testing/native-platform-capabilities-host.js +139 -24
- package/src/toolchain/body-forwarding.js +25 -0
- package/src/toolchain/config.js +4 -0
- package/src/toolchain/index.js +4 -2
- package/src/toolchain/native-execution.js +7 -1
package/README.md
CHANGED
|
@@ -7,9 +7,9 @@
|
|
|
7
7
|
> **Supported entry points:** `@pulse-compute/provider-fastly`, `@pulse-compute/provider-fastly/contract`, `@pulse-compute/provider-fastly/toolchain`, `@pulse-compute/provider-fastly/config-schema`, `@pulse-compute/provider-fastly/runtime/canonical-api-runtime`, `@pulse-compute/provider-fastly/build/canonical-target`, `@pulse-compute/provider-fastly/testing/fastly-cli`<br>
|
|
8
8
|
> **Stability:** The listed entry points are supported for the Beta; all other exported subpaths are implementation-only.<br>
|
|
9
9
|
> **npm:** [`@pulse-compute/provider-fastly`](https://www.npmjs.com/package/@pulse-compute/provider-fastly)<br>
|
|
10
|
-
> **Canonical documentation:** [Package guide](https://pulsecompute.io/v1.0.0-beta.
|
|
10
|
+
> **Canonical documentation:** [Package guide](https://pulsecompute.io/v1.0.0-beta.9/packages/provider-fastly/)
|
|
11
11
|
>
|
|
12
|
-
> This release-status block is generated from the synchronized `Pulse 1.0.0-beta.
|
|
12
|
+
> This release-status block is generated from the synchronized `Pulse 1.0.0-beta.9` package policy.
|
|
13
13
|
<!-- pulse-package-status:end -->
|
|
14
14
|
|
|
15
15
|
Fastly provider configuration, canonical capability lowering, local conformance execution, Compute target generation, and explicit external-tool boundaries.
|
|
@@ -49,7 +49,7 @@ trusted wall-clock authority. It does not fall back to Node execution.
|
|
|
49
49
|
|
|
50
50
|
## Documentation
|
|
51
51
|
|
|
52
|
-
- [Fastly package guide](https://pulsecompute.io/v1.0.0-beta.
|
|
53
|
-
- [Project configuration](https://pulsecompute.io/v1.0.0-beta.
|
|
54
|
-
- [Fastly capabilities guide](https://pulsecompute.io/v1.0.0-beta.
|
|
55
|
-
- [Environment variables](https://pulsecompute.io/v1.0.0-beta.
|
|
52
|
+
- [Fastly package guide](https://pulsecompute.io/v1.0.0-beta.9/packages/provider-fastly/)
|
|
53
|
+
- [Project configuration](https://pulsecompute.io/v1.0.0-beta.9/reference/project-config/#fastly-provider-options)
|
|
54
|
+
- [Fastly capabilities guide](https://pulsecompute.io/v1.0.0-beta.9/guides/fastly-capabilities/)
|
|
55
|
+
- [Environment variables](https://pulsecompute.io/v1.0.0-beta.9/reference/environment/#pulse-fastly-bin)
|
package/dist/config-schema.json
CHANGED
|
@@ -82,6 +82,19 @@
|
|
|
82
82
|
},
|
|
83
83
|
"fastly.maxWasmBytes": {
|
|
84
84
|
"kind": "positive-safe-integer"
|
|
85
|
+
},
|
|
86
|
+
"fastly.bodyForwarding": {
|
|
87
|
+
"kind": "object"
|
|
88
|
+
},
|
|
89
|
+
"fastly.bodyForwarding.requestMaxBytes": {
|
|
90
|
+
"kind": "integer",
|
|
91
|
+
"minimum": 1,
|
|
92
|
+
"maximum": 1048576
|
|
93
|
+
},
|
|
94
|
+
"fastly.bodyForwarding.responseMaxBytes": {
|
|
95
|
+
"kind": "integer",
|
|
96
|
+
"minimum": 1,
|
|
97
|
+
"maximum": 1048576
|
|
85
98
|
}
|
|
86
99
|
}
|
|
87
100
|
}
|
package/dist/index.d.ts
CHANGED
|
@@ -13,10 +13,16 @@ export interface PulseFastlyGripOptions {
|
|
|
13
13
|
export interface PulseFastlyLocalOptions {
|
|
14
14
|
readonly networkFetch?: boolean;
|
|
15
15
|
}
|
|
16
|
+
export interface PulseFastlyBodyForwardingOptions {
|
|
17
|
+
readonly requestMaxBytes: number;
|
|
18
|
+
readonly responseMaxBytes: number;
|
|
19
|
+
}
|
|
16
20
|
export interface PulseFastlyProviderOptions {
|
|
17
21
|
/** Inclusive final Native Wasm byte budget; default 4 MiB. */
|
|
18
22
|
readonly maxWasmBytes?: number;
|
|
19
23
|
readonly maxDurationMs?: number;
|
|
24
|
+
/** Experimental Native metered pump; final close hands delivery to Fastly. */
|
|
25
|
+
readonly bodyForwarding?: PulseFastlyBodyForwardingOptions;
|
|
20
26
|
readonly configStore?: string;
|
|
21
27
|
readonly secretStore?: string;
|
|
22
28
|
readonly kv?: Readonly<Record<string, string>>;
|
|
@@ -30,6 +36,8 @@ export interface PulseFastlyProviderOptions {
|
|
|
30
36
|
}
|
|
31
37
|
export interface PulseFastlyProviderConfig {
|
|
32
38
|
readonly maxDurationMs?: number;
|
|
39
|
+
/** Experimental Native metered pump; final close hands delivery to Fastly. */
|
|
40
|
+
readonly bodyForwarding?: PulseFastlyBodyForwardingOptions;
|
|
33
41
|
readonly kind: 'fastly';
|
|
34
42
|
readonly version: typeof FASTLY_PROVIDER_API_VERSION;
|
|
35
43
|
readonly bindings: {
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AASA,eAAO,MAAM,2BAA2B,EAAG,8BAAuC,CAAC;AAEnF,MAAM,WAAW,sBAAsB;IACrC,QAAQ,CAAC,aAAa,CAAC,EAAE,MAAM,CAAC;IAChC,QAAQ,CAAC,eAAe,CAAC,EAAE,MAAM,CAAC;IAClC,QAAQ,CAAC,UAAU,CAAC,EAAE,MAAM,CAAC;IAC7B,QAAQ,CAAC,cAAc,CAAC,EAAE,MAAM,CAAC;IACjC,QAAQ,CAAC,cAAc,CAAC,EAAE;QACxB,QAAQ,CAAC,MAAM,CAAC,EAAE,QAAQ,CAAC;QAC3B,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;KAC5B,CAAC;IACF,QAAQ,CAAC,UAAU,CAAC,EAAE,OAAO,CAAC;CAC/B;AAED,MAAM,WAAW,uBAAuB;IACtC,QAAQ,CAAC,YAAY,CAAC,EAAE,OAAO,CAAC;CACjC;AAED,MAAM,WAAW,gCAAgC;IAC/C,QAAQ,CAAC,eAAe,EAAE,MAAM,CAAC;IACjC,QAAQ,CAAC,gBAAgB,EAAE,MAAM,CAAC;CACnC;AAED,MAAM,WAAW,0BAA0B;IACzC,8DAA8D;IAC9D,QAAQ,CAAC,YAAY,CAAC,EAAE,MAAM,CAAC;IAC/B,QAAQ,CAAC,aAAa,CAAC,EAAE,MAAM,CAAC;IAChC,8EAA8E;IAC9E,QAAQ,CAAC,cAAc,CAAC,EAAE,gCAAgC,CAAC;IAC3D,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,CAAC;IAC9B,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,CAAC;IAC9B,QAAQ,CAAC,EAAE,CAAC,EAAE,QAAQ,CAAC,MAAM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AAE,MAAM,CAAC;YACjC,QAAQ,CAAC,cAAc,CAAC,EAAE;gBACxB,QAAQ,CAAC,MAAM,EAAE,QAAQ,CAAC;gBAC1B,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;aAC5B,CAAC;YACF,QAAQ,CAAC,UAAU,EAAE,OAAO,CAAC;SAC9B,CAAC;QACF,QAAQ,CAAC,eAAe,EAAE,OAAO,CAAC;KACnC,CAAC;IACF,QAAQ,CAAC,KAAK,EAAE;QACd,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAC;QAC9B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;QACtB,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;QAC7B,QAAQ,CAAC,OAAO,EAAE,SAAS,MAAM,EAAE,CAAC;QACpC,QAAQ,CAAC,QAAQ,EAAE,OAAO,CAAC;KAC5B,CAAC;IACF,QAAQ,CAAC,KAAK,EAAE;QACd,QAAQ,CAAC,YAAY,EAAE,OAAO,CAAC;KAChC,CAAC;IACF,QAAQ,CAAC,wBAAwB,EAAE,KAAK,CAAC;CAC1C;AA2BD,wBAAgB,MAAM,CAAC,OAAO,GAAE,0BAA+B,GAAG,yBAAyB,CAyB1F"}
|
package/dist/index.js
CHANGED
|
@@ -5,6 +5,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.FASTLY_PROVIDER_API_VERSION = void 0;
|
|
7
7
|
exports.fastly = fastly;
|
|
8
|
+
const { normalizeBodyForwarding } = require('../src/toolchain/body-forwarding.js');
|
|
8
9
|
const { normalizeFastlyMaxWasmBytes } = require('../src/build/wasm-budget.js');
|
|
9
10
|
const { normalizeRequestDuration } = require('@pulse-compute/runtime/host');
|
|
10
11
|
const config_schema_json_1 = __importDefault(require("./config-schema.json"));
|
|
@@ -40,6 +41,7 @@ function fastly(options = {}) {
|
|
|
40
41
|
return Object.freeze({
|
|
41
42
|
kind: 'fastly',
|
|
42
43
|
maxDurationMs: normalizeRequestDuration(options.maxDurationMs),
|
|
44
|
+
bodyForwarding: normalizeBodyForwarding(options.bodyForwarding, options.maxDurationMs),
|
|
43
45
|
version: exports.FASTLY_PROVIDER_API_VERSION,
|
|
44
46
|
bindings: Object.freeze({
|
|
45
47
|
configStore: String(options.configStore ?? fastlyDefaults['fastly.configStore']),
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;AAgHA,wBAyBC;AAzID,MAAM,EAAE,uBAAuB,EAAE,GAAG,OAAO,CAAC,qCAAqC,CAA2J,CAAC;AAC7O,MAAM,EAAE,2BAA2B,EAAE,GAAG,OAAO,CAAC,6BAA6B,CAA4D,CAAC;AAC1I,MAAM,EAAE,wBAAwB,EAAE,GAAG,OAAO,CAAC,6BAA6B,CAAqE,CAAC;AAChJ,8EAAwD;AAGxD,MAAM,kBAAkB,GAAG,4BAAoB,CAAC,MAAoD,CAAC;AACrG,MAAM,cAAc,GAAG,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,WAAW,CAAC,MAAM,CAAC,OAAO,CAAC,kBAAkB,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,IAAI,CAAC,EAAE,EAAE,CAAC,MAAM,CAAC,SAAS,CAAC,cAAc,CAAC,IAAI,CAAC,IAAI,EAAE,SAAS,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,EAAE,IAAI,CAAC,EAAE,EAAE,CAAC,CAAC,GAAG,EAAE,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,CAAsC,CAAC;AAE3O,QAAA,2BAA2B,GAAG,8BAAuC,CAAC;AA8EnF,SAAS,SAAS,CAAC,KAAmD;IACpE,OAAO,MAAM,CAAC,MAA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AAe,KAAK,IAAI;SAC9I,CAAC;QACF,KAAK,EAAE,MAAM,CAAC,MAAM,CAAC;YACnB,YAAY,EAAE,2BAA2B,CAAC,OAAO,CAAC,YAAY,CAAC;YAC/D,IAAI,EAAE,MAAM,CAAC,OAAO,CAAC,IAAI,IAAI,cAAc,CAAC,aAAa,CAAC,CAAC;YAC3D,WAAW,EAAE,MAAM,CAAC,OAAO,CAAC,WAAW,IAAI,cAAc,CAAC,oBAAoB,CAAC,CAAC;YAChF,OAAO,EAAE,MAAM,CAAC,MAAM,CAAC,CAAC,OAAO,CAAC,OAAO,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,cAAc,CAAC,gBAAgB,CAAC,CAAC,CAAC,CAAC,CAAC,cAAc,CAAC,gBAAgB,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;YAClJ,QAAQ,EAAE,OAAO;SAClB,CAAC;QACF,KAAK,EAAE,MAAM,CAAC,MAAM,CAAC,EAAE,YAAY,EAAE,OAAO,CAAC,OAAO,CAAC,KAAK,EAAE,YAAY,IAAI,cAAc,CAAC,2BAA2B,CAAC,CAAC,EAAE,CAAC;QAC3H,wBAAwB,EAAE,KAAK;KAChC,CAAC,CAAC;AACL,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pulse-compute/provider-fastly",
|
|
3
|
-
"version": "1.0.0-beta.
|
|
3
|
+
"version": "1.0.0-beta.9",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"engines": {
|
|
6
6
|
"node": "^22.14.0 || ^24.0.0"
|
|
@@ -59,15 +59,15 @@
|
|
|
59
59
|
}
|
|
60
60
|
},
|
|
61
61
|
"dependencies": {
|
|
62
|
-
"@pulse-compute/crypto": "1.0.0-beta.
|
|
63
|
-
"@pulse-compute/jwt": "1.0.0-beta.
|
|
64
|
-
"@pulse-compute/runtime": "1.0.0-beta.
|
|
65
|
-
"@pulse-compute/s3": "1.0.0-beta.
|
|
66
|
-
"@pulse-compute/wasm-build-support": "1.0.0-beta.
|
|
67
|
-
"@pulse-compute/wasm-contracts": "1.0.0-beta.
|
|
68
|
-
"@pulse-compute/wasm-guest-link": "1.0.0-beta.
|
|
69
|
-
"@pulse-compute/wasm-host-runtime": "1.0.0-beta.
|
|
70
|
-
"@pulse-compute/wasm-runtime-core-as": "1.0.0-beta.
|
|
62
|
+
"@pulse-compute/crypto": "1.0.0-beta.9",
|
|
63
|
+
"@pulse-compute/jwt": "1.0.0-beta.9",
|
|
64
|
+
"@pulse-compute/runtime": "1.0.0-beta.9",
|
|
65
|
+
"@pulse-compute/s3": "1.0.0-beta.9",
|
|
66
|
+
"@pulse-compute/wasm-build-support": "1.0.0-beta.9",
|
|
67
|
+
"@pulse-compute/wasm-contracts": "1.0.0-beta.9",
|
|
68
|
+
"@pulse-compute/wasm-guest-link": "1.0.0-beta.9",
|
|
69
|
+
"@pulse-compute/wasm-host-runtime": "1.0.0-beta.9",
|
|
70
|
+
"@pulse-compute/wasm-runtime-core-as": "1.0.0-beta.9",
|
|
71
71
|
"esbuild": "0.28.1"
|
|
72
72
|
},
|
|
73
73
|
"types": "./dist/index.d.ts",
|
|
@@ -87,7 +87,7 @@
|
|
|
87
87
|
"url": "git+https://github.com/pulse-compute/pulse.git",
|
|
88
88
|
"directory": "packages/provider-fastly"
|
|
89
89
|
},
|
|
90
|
-
"homepage": "https://pulsecompute.io/v1.0.0-beta.
|
|
90
|
+
"homepage": "https://pulsecompute.io/v1.0.0-beta.9/packages/provider-fastly/",
|
|
91
91
|
"bugs": {
|
|
92
92
|
"url": "https://github.com/pulse-compute/pulse/issues"
|
|
93
93
|
},
|
|
@@ -233,6 +233,7 @@ function inspectFastlyCanonicalTarget(options = {}) {
|
|
|
233
233
|
profile: options.profile,
|
|
234
234
|
bindings,
|
|
235
235
|
maxDurationMs: providerConfig.maxDurationMs,
|
|
236
|
+
bodyForwarding: providerConfig.bodyForwarding,
|
|
236
237
|
maxWasmBytes,
|
|
237
238
|
requirePlatformCapability: false,
|
|
238
239
|
canonicalBuild: true,
|
|
@@ -244,6 +245,7 @@ function inspectFastlyCanonicalTarget(options = {}) {
|
|
|
244
245
|
|| (options.native && options.native.guestUnits),
|
|
245
246
|
nativeOptimization: options.nativeOptimization
|
|
246
247
|
|| (options.experimentalNativeSize === true ? 'experimental-native-size' : undefined),
|
|
248
|
+
elideJsonCacheArena: options.elideJsonCacheArena,
|
|
247
249
|
emitWat: options.emitWat,
|
|
248
250
|
timeoutMs: options.compileTimeoutMs
|
|
249
251
|
});
|
|
@@ -251,6 +253,10 @@ function inspectFastlyCanonicalTarget(options = {}) {
|
|
|
251
253
|
if (native.manifest.bindings?.maxDurationMs !== duration) {
|
|
252
254
|
throw providerBuildError('PULSE_REQUEST_DURATION_ARTIFACT_MISMATCH', 'Fastly artifact request deadline does not match the selected provider profile.');
|
|
253
255
|
}
|
|
256
|
+
const forwarding = require('../toolchain/body-forwarding.js').normalizeBodyForwarding(providerConfig.bodyForwarding, duration);
|
|
257
|
+
if (JSON.stringify(native.manifest.bindings?.bodyForwarding) !== JSON.stringify(forwarding)) {
|
|
258
|
+
throw providerBuildError('PULSE_FASTLY_BODY_FORWARDING_ARTIFACT_MISMATCH', 'Fastly artifact forwarding bounds do not match the selected provider profile.');
|
|
259
|
+
}
|
|
254
260
|
return Object.freeze({
|
|
255
261
|
target: FASTLY_CANONICAL_TARGET,
|
|
256
262
|
provider: 'fastly',
|
|
@@ -320,6 +326,7 @@ function writeFastlyCanonicalTarget(options = {}) {
|
|
|
320
326
|
|| (options.native && options.native.guestUnits),
|
|
321
327
|
nativeOptimization: options.nativeOptimization
|
|
322
328
|
|| (options.experimentalNativeSize === true ? 'experimental-native-size' : undefined),
|
|
329
|
+
elideJsonCacheArena: options.elideJsonCacheArena,
|
|
323
330
|
emitWat: options.emitWat,
|
|
324
331
|
compileTimeoutMs: options.compileTimeoutMs
|
|
325
332
|
});
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
+
const { nativeStdioSource } = require('./native-stdio.js');
|
|
3
4
|
const crypto = require('node:crypto');
|
|
4
5
|
const fs = require('node:fs');
|
|
5
6
|
const os = require('node:os');
|
|
@@ -41,8 +42,7 @@ const ALLOWED_IMPORTS = new Set([
|
|
|
41
42
|
'fastly_http_resp:new',
|
|
42
43
|
'fastly_http_resp:send_downstream',
|
|
43
44
|
'fastly_http_resp:status_set',
|
|
44
|
-
'
|
|
45
|
-
'fastly_log:write',
|
|
45
|
+
'wasi_snapshot_preview1:fd_write',
|
|
46
46
|
'fastly_secret_store:get',
|
|
47
47
|
'fastly_secret_store:open',
|
|
48
48
|
'fastly_secret_store:plaintext'
|
|
@@ -178,8 +178,7 @@ function providerRuntimeSource(bindings, options) {
|
|
|
178
178
|
@external("fastly_secret_store", "open") declare function fastly_secret_store_open(name: usize, nameLength: i32, handleOut: usize): i32
|
|
179
179
|
@external("fastly_secret_store", "get") declare function fastly_secret_store_get(handle: i32, key: usize, keyLength: i32, secretOut: usize): i32
|
|
180
180
|
@external("fastly_secret_store", "plaintext") declare function fastly_secret_store_plaintext(secret: i32, value: usize, valueLength: i32, writtenOut: usize): i32
|
|
181
|
-
|
|
182
|
-
@external("fastly_log", "write") declare function fastly_log_write(handle: i32, message: usize, messageLength: i32, writtenOut: usize): i32
|
|
181
|
+
${nativeStdioSource}
|
|
183
182
|
|
|
184
183
|
const __PULSE_FASTLY_ENTITIES_ABI: i64 = 1
|
|
185
184
|
const __PULSE_FASTLY_ENTITIES_BUFFER: i32 = ${BUFFER_BYTES}
|
|
@@ -191,7 +190,6 @@ let __pulse_fastly_entities_results = new Array<string>()
|
|
|
191
190
|
let __pulse_fastly_entities_ready = new Array<i32>()
|
|
192
191
|
let __pulse_fastly_entities_ok = new Array<i32>()
|
|
193
192
|
let __pulse_fastly_entities_redactions = new Array<string>()
|
|
194
|
-
let __pulse_fastly_entities_log_handle: i32 = -1
|
|
195
193
|
|
|
196
194
|
function __pulse_fastly_entities_out(): StaticArray<i32> { return new StaticArray<i32>(1) }
|
|
197
195
|
function __pulse_fastly_entities_out_value(value: StaticArray<i32>): i32 { return load<i32>(changetype<usize>(value)) }
|
|
@@ -327,15 +325,8 @@ function pulse_entities_host_effect_begin(effectIndex: i32, payloadPointer: i32,
|
|
|
327
325
|
}
|
|
328
326
|
function pulse_entities_host_log(level: i32, payloadPointer: i32, payloadLength: i32): void {
|
|
329
327
|
if (payloadPointer <= 0 || payloadLength < 0) return
|
|
330
|
-
if (__pulse_fastly_entities_log_handle < 0) {
|
|
331
|
-
const endpoint = __pulse_fastly_entities_utf8("stdout")
|
|
332
|
-
const handleOut = __pulse_fastly_entities_out()
|
|
333
|
-
if (fastly_log_endpoint_get(changetype<usize>(endpoint), endpoint.byteLength, changetype<usize>(handleOut)) != __PULSE_FASTLY_OK) return
|
|
334
|
-
__pulse_fastly_entities_log_handle = __pulse_fastly_entities_out_value(handleOut)
|
|
335
|
-
}
|
|
336
328
|
const message = __pulse_fastly_entities_utf8("[pulse:entities:" + level.toString() + "] " + __pulse_fastly_entities_redact(changetype<string>(payloadPointer)) + "\n")
|
|
337
|
-
|
|
338
|
-
fastly_log_write(__pulse_fastly_entities_log_handle, changetype<usize>(message), message.byteLength, changetype<usize>(written))
|
|
329
|
+
__pulse_fastly_write_stdout(message)
|
|
339
330
|
}
|
|
340
331
|
function __pulse_fastly_entities_write_body(handle: i32, value: string): i32 {
|
|
341
332
|
const bytes = __pulse_fastly_entities_utf8(value)
|
|
@@ -496,6 +487,7 @@ function compileFastlyEntitiesNative(sourceArtifact, options = {}) {
|
|
|
496
487
|
'--path', path.join(compilerFallback, 'node_modules'),
|
|
497
488
|
'--path', path.dirname(jsonAsRoot)
|
|
498
489
|
];
|
|
490
|
+
require('@pulse-compute/wasm-build-support/native-optimization').appendJsonCacheArenaArgs(args, options.elideJsonCacheArena, true);
|
|
499
491
|
const startedAt = Date.now();
|
|
500
492
|
const result = spawnSync(asc.executable, args, {
|
|
501
493
|
cwd: staging,
|
|
@@ -546,6 +538,7 @@ function compileFastlyEntitiesNative(sourceArtifact, options = {}) {
|
|
|
546
538
|
package: 'assemblyscript',
|
|
547
539
|
version: JSON.parse(fs.readFileSync(path.join(asc.packageRoot, 'package.json'), 'utf8')).version,
|
|
548
540
|
jsonAs: jsonAsManifest.version,
|
|
541
|
+
elideDisabledCacheArena: options.elideJsonCacheArena === true,
|
|
549
542
|
durationMs: Date.now() - startedAt
|
|
550
543
|
}),
|
|
551
544
|
policy: generated.policy
|
|
@@ -80,12 +80,16 @@ function __kv_number(value: f64): string {
|
|
|
80
80
|
// Count the portable serialized value budget, including this boundary case.
|
|
81
81
|
return text.endsWith('.0') ? text.substring(0, text.length - 2) : text;
|
|
82
82
|
}
|
|
83
|
-
//
|
|
84
|
-
//
|
|
85
|
-
|
|
86
|
-
|
|
83
|
+
// Object field names are complete quoted tokens, not substring secrets: a field
|
|
84
|
+
// named "id" must not corrupt "considered", "invalidAcks", or numeric metrics.
|
|
85
|
+
// Values, lookup keys and generations retain raw and JSON-escaped protection.
|
|
86
|
+
function __kv_private(text: string, field: bool = false): string {
|
|
87
87
|
const encoded = __pulse_fastly_quote(text);
|
|
88
|
-
__pulse_fastly_remember_secret(encoded
|
|
88
|
+
if (field) __pulse_fastly_remember_secret(encoded, true);
|
|
89
|
+
else {
|
|
90
|
+
__pulse_fastly_remember_secret(text);
|
|
91
|
+
__pulse_fastly_remember_secret(encoded.substring(1, encoded.length - 1));
|
|
92
|
+
}
|
|
89
93
|
return encoded;
|
|
90
94
|
}
|
|
91
95
|
class __KvEncoder {
|
|
@@ -107,7 +111,7 @@ class __KvEncoder {
|
|
|
107
111
|
const object = value.kind == PULSE_VALUE_OBJECT; this.add(object ? '{' : '[');
|
|
108
112
|
for (let i = 0; i < value.values.length && !this.reason.length; i++) {
|
|
109
113
|
if (i) this.add(',');
|
|
110
|
-
if (object) this.add(__kv_private(value.keys[i]) + ':');
|
|
114
|
+
if (object) this.add(__kv_private(value.keys[i], true) + ':');
|
|
111
115
|
this.visit(value.values[i], depth + 1);
|
|
112
116
|
}
|
|
113
117
|
this.add(object ? '}' : ']');
|
|
@@ -4,8 +4,13 @@ function enabled(plan) {
|
|
|
4
4
|
return (plan.routing?.entries || []).some(entry => entry.kind === 'error');
|
|
5
5
|
}
|
|
6
6
|
|
|
7
|
+
// Fetch-only applications also drain failed groups before their terminal response.
|
|
8
|
+
function settlementEnabled(plan) {
|
|
9
|
+
return enabled(plan) || (!plan.packages?.application && (plan.effects || []).some(effect => effect.kind === 'fetch'));
|
|
10
|
+
}
|
|
11
|
+
|
|
7
12
|
// Capture provider diagnostics before clearing them. A failed continuation is
|
|
8
|
-
// drained once; only
|
|
13
|
+
// drained once; only an admitted application error can enter the next Router lane.
|
|
9
14
|
function runtimeSource(plan) {
|
|
10
15
|
const jwt = ['TOKEN_REQUIRED', 'BEARER_INVALID', 'MALFORMED', 'LIMIT_EXCEEDED',
|
|
11
16
|
'ALGORITHM_NOT_ALLOWED', 'KEY_INVALID', 'SIGNATURE_INVALID', 'CLOCK_INVALID',
|
|
@@ -14,6 +19,7 @@ function runtimeSource(plan) {
|
|
|
14
19
|
let __pulse_application_schema: i32 = 0
|
|
15
20
|
let __pulse_application_failed_schema: i32 = 0
|
|
16
21
|
function __pulse_application_code(): string {
|
|
22
|
+
if (__pulse_fastly_last_error == PULSE_ERROR_TRANSPORT && __pulse_fetch_failed()) return __pulse_fastly_error_stage == 271 ? "PULSE_FETCH_TIMEOUT" : "PULSE_FETCH_NETWORK"
|
|
17
23
|
if (__pulse_fastly_last_error == PULSE_ERROR_REQUEST_BODY)
|
|
18
24
|
return __pulse_fastly_error_stage == 21 ? "PULSE_BODY_TOO_LARGE" : "PULSE_REQUEST_BODY_INVALID_UTF8"
|
|
19
25
|
if (__pulse_fastly_jwt_error > 0) {
|
|
@@ -40,7 +46,7 @@ function __pulse_application_clear(): void {
|
|
|
40
46
|
__pulse_fastly_last_error = 0; __pulse_fastly_error_stage = 0; __pulse_fastly_error_effect = -1
|
|
41
47
|
__pulse_fastly_jwt_error = 0; __pulse_application_failed_schema = 0
|
|
42
48
|
}
|
|
43
|
-
${(plan?.effects || []).length > 0 ? settlementSource() : ''}
|
|
49
|
+
${(plan?.effects || []).length > 0 ? settlementSource(plan) : ''}
|
|
44
50
|
function host_router_error_take(): i32 {
|
|
45
51
|
if (__pulse_fastly_last_error == 0) return 0
|
|
46
52
|
const code = __pulse_application_code()
|
|
@@ -52,7 +58,7 @@ function host_router_error_take(): i32 {
|
|
|
52
58
|
const error = host_value_object()
|
|
53
59
|
host_value_object_set(error, __pulse_fastly_string_value("code"), __pulse_fastly_string_value(code))
|
|
54
60
|
host_value_object_set(error, __pulse_fastly_string_value("name"), __pulse_fastly_string_value("PulseApplicationError"))
|
|
55
|
-
host_value_object_set(error, __pulse_fastly_string_value("message"), __pulse_fastly_string_value("Pulse application data validation failed."))
|
|
61
|
+
host_value_object_set(error, __pulse_fastly_string_value("message"), __pulse_fastly_string_value(code == "PULSE_FETCH_TIMEOUT" ? "Fetch header deadline exceeded." : code == "PULSE_FETCH_NETWORK" ? "Fetch transport failed." : "Pulse application data validation failed."))
|
|
56
62
|
return error
|
|
57
63
|
}
|
|
58
64
|
`;
|
|
@@ -61,7 +67,7 @@ function host_router_error_take(): i32 {
|
|
|
61
67
|
// The caller retains the static pending-slot guards. The shared body owns one
|
|
62
68
|
// site's resolution and authenticated settlement; diagnostics carry the saved
|
|
63
69
|
// failure between calls without allocating an accumulator or merging slot state.
|
|
64
|
-
function settlementSource() {
|
|
70
|
+
function settlementSource(plan) {
|
|
65
71
|
return `
|
|
66
72
|
// Returns 0 for recoverable/no failure, 1 for fatal, -1 for rejected settlement.
|
|
67
73
|
function __pulse_application_settle_effect(index: i32, fatal: bool): i32 {
|
|
@@ -78,7 +84,7 @@ function __pulse_application_settle_effect(index: i32, fatal: bool): i32 {
|
|
|
78
84
|
if (result <= 0 && __pulse_fastly_last_error == 0) __pulse_fastly_fail(PULSE_ERROR_STATE, 101, index)
|
|
79
85
|
} else if (failure == 0) __pulse_fastly_fail(PULSE_ERROR_STATE, 101, index)
|
|
80
86
|
if (__pulse_fastly_last_error != 0) {
|
|
81
|
-
const terminal = __pulse_application_code().length == 0
|
|
87
|
+
const terminal = ${enabled(plan) ? '__pulse_application_code().length == 0' : 'true'}
|
|
82
88
|
if (failure == 0 || (!fatal && terminal)) {
|
|
83
89
|
failure = __pulse_fastly_last_error; stage = __pulse_fastly_error_stage; effect = __pulse_fastly_error_effect
|
|
84
90
|
jwt = __pulse_fastly_jwt_error; schema = __pulse_application_failed_schema; fatal = terminal
|
|
@@ -99,13 +105,13 @@ function __pulse_application_settle_effect(index: i32, fatal: bool): i32 {
|
|
|
99
105
|
// Preserve the fatal-return boundary consumed by request-budget instrumentation.
|
|
100
106
|
function driverLoop(plan) {
|
|
101
107
|
return ` while (runStatus == 1) {
|
|
102
|
-
let fatal = __pulse_fastly_last_error != 0 && __pulse_application_code().length == 0
|
|
108
|
+
let fatal = __pulse_fastly_last_error != 0${enabled(plan) ? ' && __pulse_application_code().length == 0' : ''}
|
|
103
109
|
${(plan.effects || []).map((_, index) => ` if (__pulse_effect_pending_${index} != 0) {
|
|
104
110
|
const settled = __pulse_application_settle_effect(${index}, fatal)
|
|
105
111
|
if (settled < 0) return
|
|
106
112
|
fatal = settled != 0
|
|
107
113
|
}`).join('\n')}
|
|
108
|
-
if (fatal) return
|
|
114
|
+
${enabled(plan) ? 'if (fatal) return' : 'if (fatal) { __pulse_fastly_jwt_send_error(); return }'}
|
|
109
115
|
runStatus = pulse_resume()
|
|
110
116
|
}`;
|
|
111
117
|
}
|
|
@@ -137,4 +143,4 @@ function instrument(source) {
|
|
|
137
143
|
return source;
|
|
138
144
|
}
|
|
139
145
|
|
|
140
|
-
module.exports = Object.freeze({ enabled, runtimeSource, driverLoop, instrument });
|
|
146
|
+
module.exports = Object.freeze({ enabled, settlementEnabled, runtimeSource, driverLoop, instrument });
|