@pulse-compute/cli 0.0.0 → 1.0.0-beta.1

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 (190) hide show
  1. package/API.md +539 -0
  2. package/CHANGELOG.md +47 -0
  3. package/README.md +70 -1
  4. package/bin/pulse.js +15 -0
  5. package/bin/pulsewasm-extract.js +22 -0
  6. package/cli-spec.json +575 -0
  7. package/completions/_pulse +106 -0
  8. package/completions/pulse.bash +31 -0
  9. package/completions/pulse.fish +76 -0
  10. package/docs/README.md +77 -0
  11. package/docs/architecture/current-contracts.md +381 -0
  12. package/docs/architecture/overview.md +93 -0
  13. package/docs/architecture/vision.md +515 -0
  14. package/docs/concepts/bodies.md +186 -0
  15. package/docs/concepts/compilation-and-lowering.md +496 -0
  16. package/docs/concepts/contracts-and-providers.md +158 -0
  17. package/docs/concepts/effects-and-continuations.md +243 -0
  18. package/docs/concepts/entities-and-adapters.md +71 -0
  19. package/docs/concepts/package-owned-lowering.md +175 -0
  20. package/docs/concepts/targets-and-hosts.md +62 -0
  21. package/docs/contributing/README.md +38 -0
  22. package/docs/contributing/adding-core-provider.md +315 -0
  23. package/docs/contributing/adding-first-party-lowerer.md +327 -0
  24. package/docs/contributing/entities-lowering.md +91 -0
  25. package/docs/contributing/package-lowerer-contract.md +383 -0
  26. package/docs/contributing/pulse-aware-packages.md +149 -0
  27. package/docs/examples.md +112 -0
  28. package/docs/fixtures/inspect-fetch-composition.selected.json +181 -0
  29. package/docs/getting-started.md +128 -0
  30. package/docs/guides/compatibility-imports.md +60 -0
  31. package/docs/guides/deploying-fastly.md +188 -0
  32. package/docs/guides/deploying-node.md +143 -0
  33. package/docs/guides/events.md +233 -0
  34. package/docs/guides/fastly-capabilities.md +153 -0
  35. package/docs/guides/fetching-and-composition.md +101 -0
  36. package/docs/guides/grip.md +94 -0
  37. package/docs/guides/json-schemas.md +233 -0
  38. package/docs/guides/migrating-from-express.md +192 -0
  39. package/docs/guides/project-lifecycle.md +143 -0
  40. package/docs/guides/routing.md +184 -0
  41. package/docs/guides/troubleshooting.md +47 -0
  42. package/docs/maintainers/README.md +60 -0
  43. package/docs/maintainers/codex-maintainer.md +71 -0
  44. package/docs/maintainers/documentation-deployment.md +147 -0
  45. package/docs/maintainers/documentation-system.md +58 -0
  46. package/docs/maintainers/documentation-versioning.md +65 -0
  47. package/docs/maintainers/maintainer-charter.md +84 -0
  48. package/docs/maintainers/maintenance-policy.json +778 -0
  49. package/docs/maintainers/maintenance-policy.md +124 -0
  50. package/docs/maintainers/npm-publishing.md +154 -0
  51. package/docs/maintainers/plugin-readiness.json +19 -0
  52. package/docs/maintainers/plugin-readiness.md +31 -0
  53. package/docs/maintainers/public-site.md +158 -0
  54. package/docs/maintainers/release-acceptance.md +250 -0
  55. package/docs/maintainers/release-manifest.md +88 -0
  56. package/docs/maintainers/repository-setup.md +145 -0
  57. package/docs/maintainers/scope-policy.md +93 -0
  58. package/docs/maintainers/support-and-triage.md +74 -0
  59. package/docs/maintainers/testing.md +288 -0
  60. package/docs/packages/README.md +59 -0
  61. package/docs/packages/assets.md +85 -0
  62. package/docs/packages/cli.md +190 -0
  63. package/docs/packages/crypto.md +71 -0
  64. package/docs/packages/entities.md +129 -0
  65. package/docs/packages/grip.md +82 -0
  66. package/docs/packages/implementation-packages.md +113 -0
  67. package/docs/packages/jwt.md +55 -0
  68. package/docs/packages/provider-fastly.md +217 -0
  69. package/docs/packages/pulse.md +159 -0
  70. package/docs/packages/runtime.md +256 -0
  71. package/docs/preview-scope.md +142 -0
  72. package/docs/reference/README.md +33 -0
  73. package/docs/reference/cli-spec.json +575 -0
  74. package/docs/reference/cli.md +457 -0
  75. package/docs/reference/compatibility-matrix.md +169 -0
  76. package/docs/reference/diagnostics.md +1872 -0
  77. package/docs/reference/documentation-versions.json +14 -0
  78. package/docs/reference/environment.md +347 -0
  79. package/docs/reference/handler-authoring.md +264 -0
  80. package/docs/reference/project-config.md +554 -0
  81. package/docs/reference/project-config.schema.json +918 -0
  82. package/docs/reference/release-manifest.json +427 -0
  83. package/docs/reference/shell-completion.md +23 -0
  84. package/documentation-site.json +661 -0
  85. package/documentation-versions.json +14 -0
  86. package/examples/01-hello-json/.pulse/.gitignore +3 -0
  87. package/examples/01-hello-json/.pulse/config.ts +16 -0
  88. package/examples/01-hello-json/README.md +119 -0
  89. package/examples/01-hello-json/package.json +20 -0
  90. package/examples/01-hello-json/src/index.ts +9 -0
  91. package/examples/01-hello-json/tests/pulse.harness.ts +22 -0
  92. package/examples/01-hello-json/tsconfig.json +14 -0
  93. package/examples/02-request-schema/.pulse/.gitignore +3 -0
  94. package/examples/02-request-schema/.pulse/config.ts +17 -0
  95. package/examples/02-request-schema/README.md +145 -0
  96. package/examples/02-request-schema/package.json +20 -0
  97. package/examples/02-request-schema/src/index.ts +18 -0
  98. package/examples/02-request-schema/src/schemas.ts +20 -0
  99. package/examples/02-request-schema/tests/pulse.harness.ts +37 -0
  100. package/examples/02-request-schema/tsconfig.json +14 -0
  101. package/examples/03-fetch-composition/.pulse/.gitignore +3 -0
  102. package/examples/03-fetch-composition/.pulse/config.ts +31 -0
  103. package/examples/03-fetch-composition/README.md +210 -0
  104. package/examples/03-fetch-composition/package.json +20 -0
  105. package/examples/03-fetch-composition/src/index.ts +60 -0
  106. package/examples/03-fetch-composition/tests/pulse.harness.ts +47 -0
  107. package/examples/03-fetch-composition/tsconfig.json +14 -0
  108. package/examples/05-fastly-capabilities/.pulse/.gitignore +3 -0
  109. package/examples/05-fastly-capabilities/.pulse/config.ts +57 -0
  110. package/examples/05-fastly-capabilities/README.md +257 -0
  111. package/examples/05-fastly-capabilities/package.json +22 -0
  112. package/examples/05-fastly-capabilities/src/index.ts +55 -0
  113. package/examples/05-fastly-capabilities/tests/pulse.harness.ts +66 -0
  114. package/examples/05-fastly-capabilities/tsconfig.json +14 -0
  115. package/examples/07-opaque-proxy/.pulse/.gitignore +3 -0
  116. package/examples/07-opaque-proxy/.pulse/config.ts +38 -0
  117. package/examples/07-opaque-proxy/README.md +150 -0
  118. package/examples/07-opaque-proxy/package.json +21 -0
  119. package/examples/07-opaque-proxy/src/index.ts +9 -0
  120. package/examples/07-opaque-proxy/tests/pulse.harness.ts +25 -0
  121. package/examples/07-opaque-proxy/tsconfig.json +14 -0
  122. package/examples/09-router-lowering/.pulse/.gitignore +3 -0
  123. package/examples/09-router-lowering/.pulse/config.ts +22 -0
  124. package/examples/09-router-lowering/README.md +287 -0
  125. package/examples/09-router-lowering/package.json +22 -0
  126. package/examples/09-router-lowering/src/index.ts +65 -0
  127. package/examples/09-router-lowering/tests/pulse.harness.ts +91 -0
  128. package/examples/09-router-lowering/tsconfig.json +14 -0
  129. package/examples/10-entities-tools/.pulse/.gitignore +4 -0
  130. package/examples/10-entities-tools/.pulse/config.ts +23 -0
  131. package/examples/10-entities-tools/README.md +165 -0
  132. package/examples/10-entities-tools/package.json +21 -0
  133. package/examples/10-entities-tools/src/handlers.ts +15 -0
  134. package/examples/10-entities-tools/src/index.ts +31 -0
  135. package/examples/10-entities-tools/src/schemas.ts +18 -0
  136. package/examples/10-entities-tools/tests/pulse.harness.ts +40 -0
  137. package/examples/10-entities-tools/tools-facade.cjs +158 -0
  138. package/examples/10-entities-tools/tsconfig.json +14 -0
  139. package/examples/11-events/.pulse/.gitignore +4 -0
  140. package/examples/11-events/.pulse/config.ts +24 -0
  141. package/examples/11-events/README.md +194 -0
  142. package/examples/11-events/package.json +20 -0
  143. package/examples/11-events/src/index.ts +27 -0
  144. package/examples/11-events/src/schemas.ts +19 -0
  145. package/examples/11-events/tests/pulse.harness.ts +34 -0
  146. package/examples/11-events/tsconfig.json +15 -0
  147. package/examples/12-mcp-proxy/.pulse/.gitignore +3 -0
  148. package/examples/12-mcp-proxy/.pulse/config.ts +25 -0
  149. package/examples/12-mcp-proxy/README.md +149 -0
  150. package/examples/12-mcp-proxy/package.json +20 -0
  151. package/examples/12-mcp-proxy/src/index.ts +17 -0
  152. package/examples/12-mcp-proxy/tests/pulse.harness.ts +29 -0
  153. package/examples/12-mcp-proxy/tsconfig.json +14 -0
  154. package/examples/13-jwt-es256/.pulse/config.ts +19 -0
  155. package/examples/13-jwt-es256/README.md +195 -0
  156. package/examples/13-jwt-es256/package.json +21 -0
  157. package/examples/13-jwt-es256/src/index.ts +21 -0
  158. package/examples/13-jwt-es256/tests/pulse.harness.ts +54 -0
  159. package/examples/13-jwt-es256/tsconfig.json +14 -0
  160. package/examples/README.md +36 -0
  161. package/package.json +66 -6
  162. package/project-config.schema.json +918 -0
  163. package/release-manifest.json +427 -0
  164. package/src/command-spec.js +279 -0
  165. package/src/completion.js +113 -0
  166. package/src/diagnostics.js +350 -0
  167. package/src/documentation.js +45 -0
  168. package/src/index.d.ts +133 -0
  169. package/src/index.js +15 -0
  170. package/src/internal/command-executor.d.ts +29 -0
  171. package/src/internal/command-executor.js +143 -0
  172. package/src/internal/command-plan.d.ts +9 -0
  173. package/src/internal/command-plan.js +73 -0
  174. package/src/internal/command-reporter.d.ts +15 -0
  175. package/src/internal/command-reporter.js +133 -0
  176. package/src/internal/command-request.d.ts +35 -0
  177. package/src/internal/command-request.js +154 -0
  178. package/src/internal/node-http.js +54 -0
  179. package/src/internal/project-context.d.ts +66 -0
  180. package/src/internal/project-context.js +175 -0
  181. package/src/project-config-reference.js +4 -0
  182. package/src/project-config-schema.d.ts +23 -0
  183. package/src/project-config-schema.js +271 -0
  184. package/src/project-config.js +724 -0
  185. package/src/project-execution.js +2930 -0
  186. package/src/provider-drivers.js +3 -0
  187. package/src/target-support.js +3 -0
  188. package/src/typescript-module-loader.js +269 -0
  189. package/src/workflow.js +78 -0
  190. package/src/workspace.js +82 -0
@@ -0,0 +1,71 @@
1
+ # `@pulse-compute/crypto`
2
+
3
+ `@pulse-compute/crypto` provides bounded, provider-neutral cryptographic
4
+ verification for Pulse applications and first-party capability packages.
5
+
6
+ ```bash
7
+ npm install @pulse-compute/crypto@1.0.0-beta.1
8
+ ```
9
+
10
+ ## Verification surface
11
+
12
+ Applications may import the package root and request MAC or signature
13
+ verification. Inputs are explicit bytes; the package does not perform ambient
14
+ string encoding or expose backend objects.
15
+
16
+ ```ts
17
+ import { crypto } from '@pulse-compute/crypto'
18
+
19
+ const result = await crypto.mac.verify({
20
+ algorithm: 'HS256',
21
+ key: {
22
+ type: 'hmac-key-bytes',
23
+ bytes: secretBytes,
24
+ },
25
+ data: messageBytes,
26
+ tag: authenticatorBytes,
27
+ })
28
+ ```
29
+
30
+ The result is one frozen status:
31
+
32
+ - `valid`
33
+ - `invalid-authenticator`
34
+ - `invalid-key`
35
+ - `invalid-input`
36
+ - `realization-failure`
37
+
38
+ HS256 accepts bounded key, data, and authenticator bytes. ES256 accepts an
39
+ exact P-256 public point, the original signing input bytes, and an exact JOSE
40
+ signature. Neither algorithm retries another realization after failure.
41
+
42
+ ## Profiles and realization
43
+
44
+ Profiles declare the exact algorithms a project may use:
45
+
46
+ ```ts
47
+ export default {
48
+ prod: {
49
+ crypto: ['HS256', 'ES256'],
50
+ },
51
+ }
52
+ ```
53
+
54
+ Planning proves that reachable demand is covered by the selected profile and
55
+ target capability. JavaScript providers use their selected Web Crypto
56
+ realization. Native compilation links the selected first-party guest
57
+ realization. Target probing and automatic fallback are prohibited.
58
+
59
+ ## Boundary
60
+
61
+ The package root is the supported application contract. Native integration,
62
+ guest provenance, and realization records are toolchain-owned surfaces. JWT
63
+ owns compact-JWS parsing, key selection, and claims semantics; this package
64
+ owns normalized cryptographic verification.
65
+
66
+ ## Related material
67
+
68
+ - [JWT verification](./jwt.md)
69
+ - [Project configuration](../reference/project-config.md)
70
+ - [Provider and target compatibility](../reference/compatibility-matrix.md)
71
+ - [Package-owned lowering](../concepts/package-owned-lowering.md)
@@ -0,0 +1,129 @@
1
+ # `@pulse-compute/entities`
2
+
3
+ `@pulse-compute/entities` provides bounded, statically declared, schema-bound
4
+ operations through the first-party JSON-RPC adapter.
5
+
6
+ ```bash
7
+ npm install @pulse-compute/entities@1.0.0-beta.1
8
+ ```
9
+
10
+ ## Declare an entity router
11
+
12
+ ```ts
13
+ import { EntityRouter, jsonRpc } from '@pulse-compute/entities'
14
+
15
+ const rpc = new EntityRouter({
16
+ adapter: jsonRpc({ namedParamsOnly: true }),
17
+ })
18
+
19
+ rpc.on('customer.lookup', {
20
+ input: 'tools.CustomerLookupInput',
21
+ output: 'tools.CustomerLookupOutput',
22
+ metadata: {
23
+ title: 'Look up customer',
24
+ description: 'Returns one customer from the governed directory backend.',
25
+ },
26
+ }, lookupCustomer)
27
+
28
+ export default function handler(ctx: unknown) {
29
+ return rpc.handle(ctx as never)
30
+ }
31
+ ```
32
+
33
+ `input` and `output` are literal schema IDs declared by the selected Pulse
34
+ project, or `null`. A `null` input passes `undefined` to the handler; a `null`
35
+ output requires `undefined` and becomes JSON `null`. Metadata must be bounded,
36
+ static JSON. Handlers must be resolvable named references and may use the same
37
+ governed `ctx` effects as ordinary managed handlers.
38
+
39
+ The compiler recognizes a deliberately narrow static form: one module-level
40
+ router, an inline first-party adapter declaration, standalone module-level
41
+ registrations, and one terminal request binding. It rejects aliases, dynamic
42
+ names, computed schema IDs, conditional registration, chained registration,
43
+ and multiple request-body owners.
44
+
45
+ ## JSON-RPC behavior
46
+
47
+ The first adapter accepts JSON-RPC 2.0 request objects and named object params.
48
+ It does not accept batches or positional params. It selects an entity before
49
+ schema decoding, invokes the handler once, validates output, and emits stable
50
+ JSON-RPC failures without application exception details.
51
+
52
+ | Input | HTTP result | JSON-RPC result |
53
+ |---|---:|---|
54
+ | Valid request with `id` | `200` | `result` or a stable `error` with the same `id` |
55
+ | Notification without `id` | `204` | Empty body after synchronous completion |
56
+ | Unknown method | `200` | `-32601` / `Method not found` |
57
+ | Invalid params or schema input | `200` | `-32602` / `Invalid params` |
58
+ | Handler or output failure | `200` | `-32603` / `Internal error` |
59
+ | Malformed JSON | `200` | `-32700` / `Parse error` |
60
+
61
+ `acceptEmptyObjectForNoInput: true` additionally permits `{}` for an operation
62
+ whose input is `null`. `namedParamsOnly` can only be `true` in this contract.
63
+
64
+ ## Inspect and release evidence
65
+
66
+ Inspect the static declaration and run the focused candidate proof from this
67
+ source checkout:
68
+
69
+ ```bash
70
+ pulse inspect
71
+ node wasm/scripts/run-wasm-tests.cjs --task entities-orchestration-demo --no-report
72
+ ```
73
+
74
+ `pulse inspect` reports the entity plan, deterministic catalog, schema linkage,
75
+ redacted handler effects, and target evidence. A successful build writes:
76
+
77
+ - `entities-catalog.json`: protocol-neutral discovery metadata;
78
+ - `entities-inspection.json`: declarations, handler identities/effects, and
79
+ eligibility/measured-execution evidence.
80
+
81
+ Both artifacts are static and checkout-independent. They intentionally omit
82
+ request/runtime values, request IDs, raw payloads, resolved secrets, and
83
+ provider objects. Consumers such as a tools facade should project discovery
84
+ from the catalog and invoke a governed adapter boundary; they should not gain a
85
+ direct handler or runtime-registry API.
86
+
87
+ ## Target status
88
+
89
+ | Mode | Beta evidence | Important boundary |
90
+ |---|---|---|
91
+ | Node JavaScript | Measured execution | Package JavaScript runtime |
92
+ | Fastly JavaScript | Measured with Viceroy 0.20.1 | Provider JavaScript package/runtime |
93
+ | Node Native | Measured execution | Package-owned Native source |
94
+ | Fastly Native | Measured with Viceroy 0.20.1 | Explicit provider-owned adapter; not the ordinary project build path |
95
+
96
+ Native remains `provider-dependent`, and every target keeps automatic fallback
97
+ disabled. The complete matrix is in [Provider and target compatibility](../reference/compatibility-matrix.md).
98
+
99
+ ## Diagnostics
100
+
101
+ These codes are package-owned entries in the synchronized Beta diagnostic
102
+ catalog.
103
+
104
+ | Code or family | Meaning | Remediation |
105
+ |---|---|---|
106
+ | `PULSE_ENTITIES_ADAPTER_STATIC_REQUIRED` | Router/adapter declaration is not the supported static form. | Construct one module-level `const` router with inline `adapter: jsonRpc(...)`. |
107
+ | `PULSE_ENTITIES_ADAPTER_UNSUPPORTED` | The adapter is not the first-party JSON-RPC adapter. | Use `jsonRpc()`; third-party adapter authoring is not open. |
108
+ | `PULSE_ENTITIES_ADAPTER_OPTIONS_INVALID` | Adapter options are unknown or dynamic. | Use literal `namedParamsOnly: true` and an optional literal boolean `acceptEmptyObjectForNoInput`. |
109
+ | `PULSE_ENTITIES_DISCRIMINATOR_STATIC_REQUIRED`, `..._INVALID`, `..._DUPLICATE` | An operation name is dynamic, malformed, or repeated. | Use one unique bounded string literal per router. |
110
+ | `PULSE_ENTITIES_SCHEMA_MISSING`, `..._ID_INVALID` | `input`/`output` is absent or not a declared literal schema ID/`null`. | Declare both fields and synchronize the project schema registry. |
111
+ | `PULSE_ENTITIES_HANDLER_UNRESOLVED`, `..._INVALID` | The handler is not a resolvable named function. | Pass a named module-level function reference. |
112
+ | `PULSE_ENTITIES_REGISTRATION_UNSUPPORTED` | Registration is conditional, nested, chained, or otherwise dynamic. | Use standalone module-level `rpc.on(...)` statements. |
113
+ | `PULSE_ENTITIES_BINDING_UNSUPPORTED` | The request binding is not one terminal `return rpc.handle(ctx)`. | Return the call directly from the request handler. |
114
+ | `PULSE_ENTITIES_BODY_CONSUMER_CONFLICT` | Another owner also consumes the request body. | Give the entity adapter exclusive ownership of the request body. |
115
+ | `PULSE_ENTITIES_METADATA_INVALID`, `PULSE_ENTITIES_LIMIT_INVALID`, `PULSE_ENTITIES_LIMIT_EXCEEDED` | Static metadata or bounded data exceeds the contract. | Reduce or correct the declaration; limits are package-owned and not app-configurable. |
116
+ | `PULSE_ENTITIES_TARGET_INELIGIBLE` | The chosen provider/target cannot realize the declaration. | Select an evidenced mode or supply the separately governed provider integration. Never rely on fallback. |
117
+
118
+ Malformed envelopes can additionally produce bounded scanner codes such as
119
+ `PULSE_ENTITIES_JSON_MALFORMED`, `PULSE_ENTITIES_JSON_TOO_DEEP`,
120
+ `PULSE_ENTITIES_ENVELOPE_TOO_LARGE`, and
121
+ `PULSE_ENTITIES_PAYLOAD_TOO_LARGE`. Clients receive only the stable JSON-RPC
122
+ mapping, while provider observability records a redacted failure category.
123
+
124
+ ## Related material
125
+
126
+ - [Entity engine, adapters, and facades](../concepts/entities-and-adapters.md)
127
+ - [Canonical API](../../API.md#entities-api)
128
+ - [Entities lowering maintainer reference](../contributing/entities-lowering.md)
129
+ - [Executable Entities tools example](../../examples/10-entities-tools/)
@@ -0,0 +1,82 @@
1
+ # `@pulse-compute/grip`
2
+
3
+ `@pulse-compute/grip` provides stateless HTTP framing for an external GRIP/Fanout gateway. Pulse does not own WebSocket objects, connection registries, backpressure, reconnect behavior, or connection-length continuations. The gateway owns the open connection; Pulse classifies requests, returns subscription or handoff instructions, and emits outbound broadcast effects.
4
+
5
+ ## Install
6
+
7
+ ```bash
8
+ npm install @pulse-compute/grip@1.0.0-beta.1
9
+ ```
10
+
11
+ ## Package-root API
12
+
13
+ ```ts
14
+ import { Router } from '@pulse-compute/runtime'
15
+ import { grip } from '@pulse-compute/grip'
16
+
17
+ const app = new Router()
18
+
19
+ app.get('/events/:accountId', async (ctx) => {
20
+ const channel = `account:${ctx.param('accountId')}`
21
+
22
+ if (grip.isWebSocket(ctx.req)) {
23
+ return grip.handoff({ channel })
24
+ }
25
+
26
+ return grip.subscribe(
27
+ new Response(null, { status: 200 }),
28
+ { channel, mode: 'stream' },
29
+ )
30
+ })
31
+
32
+ app.post('/publish/:accountId', async (ctx) => {
33
+ const data = await ctx.req.json()
34
+ await grip.broadcast(ctx, {
35
+ channel: `account:${ctx.param('accountId')}`,
36
+ data,
37
+ })
38
+ return ctx.json({ accepted: true }, { status: 202 })
39
+ })
40
+
41
+ export default app
42
+ ```
43
+
44
+ The root API separates pure HTTP behavior from provider interaction:
45
+
46
+ - `grip.isWebSocket(request)` — pure request classification;
47
+ - `grip.subscribe(response, options)` — pure response decoration with GRIP subscription headers;
48
+ - `grip.handoff(options)` — pure HTTP response construction for gateway handoff;
49
+ - `grip.broadcast(ctx, message)` — request-bound outbound effect, directly awaitable and valid inside `ctx.parallel({ ... })`.
50
+
51
+ ## Realization boundary
52
+
53
+ The canonical root has bounded JavaScript and Native framing realization.
54
+ Configured Node and Fastly providers realize `grip.broadcast`; a missing publish
55
+ capability fails with a stable capability-required diagnostic rather than
56
+ falling back or taking ownership of a connection. Native options and messages
57
+ must use supported static shapes, and unsupported expressions fail at the exact
58
+ source boundary.
59
+
60
+ The publish/control endpoint, named backend, authentication, and optional
61
+ trusted-proxy verification are provider-owned configuration. Public gateway
62
+ URLs and ingress routes are separate. Configuration stores only secret
63
+ references; values remain inside the shared secret/redaction boundary.
64
+
65
+ Cross-target conformance covers framing, cancellation, bounds,
66
+ acknowledgements, redaction, and deterministic Node/Fastly provider artifacts.
67
+ This bounded realization is included in both generally available JavaScript
68
+ targets.
69
+
70
+ ## Compatibility Native facade
71
+
72
+ `@pulse-compute/grip/pulsewasm` remains a compatibility surface for the Native
73
+ `channel`, `hold`, and `publish` contract. It is not the recommended API for
74
+ new applications and is not evidence that Pulse owns WebSocket lifecycle. See
75
+ [Compatibility imports and migration](../guides/compatibility-imports.md).
76
+
77
+ ## Related documentation
78
+
79
+ - [GRIP and Fanout guide](../guides/grip.md)
80
+ - [Contracts and providers](../concepts/contracts-and-providers.md)
81
+ - [Package-owned lowering](../concepts/package-owned-lowering.md)
82
+ - [Diagnostics](../reference/diagnostics.md)
@@ -0,0 +1,113 @@
1
+ # Implementation packages
2
+
3
+ <!-- Generated by wasm/scripts/sync-reference-docs.cjs. Edit the source catalog, not this file. -->
4
+
5
+ These packages are synchronized parts of the release set for compiler, provider, runtime, and package-lowering maintainers. They are not application-author SDKs.
6
+
7
+ The package status and supported entry-point lists below come from the synchronized Pulse 1.0.0-beta.1 release policy.
8
+
9
+ ## `@pulse-compute/wasm-build-support`
10
+
11
+ Pulse release-set and compiler maintainers.
12
+
13
+ - **Install directly:** No for application projects; it is installed transitively where required.
14
+ - **Stability:** Internal release-set interface; exported modules may change with compiler implementation needs.
15
+
16
+ ### Supported entry points
17
+
18
+ - `None for application authors.`
19
+
20
+ ## `@pulse-compute/wasm-compiler`
21
+
22
+ Pulse compiler and release maintainers.
23
+
24
+ - **Install directly:** No for application projects; use the pulse CLI.
25
+ - **Stability:** Internal compiler interface; no application-author compatibility guarantee.
26
+ - **Canonical replacement:** `@pulse-compute/cli`
27
+
28
+ ### Supported entry points
29
+
30
+ - `None for application authors.`
31
+
32
+ ## `@pulse-compute/wasm-guest-link`
33
+
34
+ Pulse compiler, release, and first-party guest-unit maintainers.
35
+
36
+ - **Install directly:** No for application projects; it is an internal synchronized compiler dependency.
37
+ - **Stability:** Internal first-party prebuilt guest-link interface synchronized with the compiler; no application-author or third-party guest compatibility guarantee.
38
+
39
+ ### Supported entry points
40
+
41
+ - `None for application authors.`
42
+
43
+ ## `@pulse-compute/wasm-contracts`
44
+
45
+ Pulse compiler, runtime, provider, and package-lowering maintainers.
46
+
47
+ - **Install directly:** Provider toolchain authors may install it for the versioned bootstrap contract; application projects receive it transitively.
48
+ - **Stability:** The provider toolchain contract is versioned and supported for the Beta; other protocol and proof interfaces remain internal.
49
+
50
+ ### Supported entry points
51
+
52
+ - `@pulse-compute/wasm-contracts/provider/toolchain`
53
+
54
+ ## `@pulse-compute/wasm-host-runtime`
55
+
56
+ Pulse host-runtime and provider maintainers.
57
+
58
+ - **Install directly:** No for application projects; it is installed transitively.
59
+ - **Stability:** Internal compiler/runtime interface synchronized with this release set.
60
+
61
+ ### Supported entry points
62
+
63
+ - `None for application authors.`
64
+
65
+ ## `@pulse-compute/wasm-library-kit`
66
+
67
+ Pulse package-lowering and compiler maintainers.
68
+
69
+ - **Install directly:** No for application projects; it is installed transitively.
70
+ - **Stability:** Internal package-lowering interface synchronized with this release set.
71
+
72
+ ### Supported entry points
73
+
74
+ - `None for application authors.`
75
+
76
+ ## `@pulse-compute/provider-node`
77
+
78
+ Pulse canonical Node provider and compiler maintainers.
79
+
80
+ - **Install directly:** No for application projects; select provider: node through the CLI.
81
+ - **Stability:** The listed built-in toolchain entry is synchronized with the Beta bootstrap contract; other canonical Node provider interfaces remain internal.
82
+ - **Canonical replacement:** `provider: 'node' through @pulse-compute/cli`
83
+
84
+ ### Supported entry points
85
+
86
+ - `@pulse-compute/provider-node/toolchain`
87
+
88
+ ## `@pulse-compute/wasm-runtime-core-as`
89
+
90
+ Pulse AssemblyScript runtime-core and compiler maintainers.
91
+
92
+ - **Install directly:** No for application projects; it is installed transitively.
93
+ - **Stability:** Internal code-generation interface synchronized with this release set.
94
+
95
+ ### Supported entry points
96
+
97
+ - `None for application authors.`
98
+
99
+ ## `@pulse-compute/wasm-schema-json`
100
+
101
+ Pulse schema compiler and runtime maintainers.
102
+
103
+ - **Install directly:** No for application projects; declare schemas in the selected .pulse/config.ts profile.
104
+ - **Stability:** Internal schema compiler interface synchronized with this release set.
105
+ - **Canonical replacement:** `schemas in .pulse/config.ts through the Pulse project workflow`
106
+
107
+ ### Supported entry points
108
+
109
+ - `None for application authors.`
110
+
111
+ ## Support boundary
112
+
113
+ Only the entry points explicitly listed above carry the stated release promise. Exported implementation subpaths are not promoted into application-author APIs merely because npm can resolve them.
@@ -0,0 +1,55 @@
1
+ # `@pulse-compute/jwt`
2
+
3
+ `@pulse-compute/jwt` provides bounded, provider-neutral JWT verification for
4
+ Pulse handlers.
5
+
6
+ ```bash
7
+ npm install @pulse-compute/jwt@1.0.0-beta.1
8
+ ```
9
+
10
+ ## Verify a bearer token
11
+
12
+ ```ts
13
+ import { jwt } from '@pulse-compute/jwt'
14
+
15
+ const verified = await jwt.verify(
16
+ ctx,
17
+ jwt.bearer(ctx.req),
18
+ {
19
+ algorithms: ['HS256'],
20
+ key: { type: 'secret', binding: 'JWT_SECRET' },
21
+ issuer: 'https://issuer.example',
22
+ audience: 'pulse-api',
23
+ },
24
+ )
25
+ ```
26
+
27
+ The provider resolves request-owned secret material and passes bounded bytes to
28
+ `@pulse-compute/crypto`. JWT authenticates the compact JWS before exposing
29
+ claims, captures one wall-clock instant after authenticity, evaluates
30
+ registered claims, and then applies an optional runtime schema. Results are
31
+ detached and deeply frozen.
32
+
33
+ ## Algorithms and keys
34
+
35
+ The Beta supports HS256 and ES256 verification. ES256 accepts inline public
36
+ P-256 JWKs or static JWKS values with at most 16 entries. Key selection is
37
+ deterministic and fails closed for duplicate, missing, ambiguous, or unknown
38
+ identities.
39
+
40
+ RS256, EdDSA, signing, remote discovery, custom crypto providers, and automatic
41
+ fallback are not part of this release.
42
+
43
+ ## Boundary
44
+
45
+ JWT verifies identity claims; it does not authorize application or host
46
+ behavior. The package root is the supported application contract. Provider,
47
+ compiler, and Native lowering exports are first-party integration surfaces and
48
+ are not application APIs.
49
+
50
+ ## Related material
51
+
52
+ - [Crypto verification](./crypto.md)
53
+ - [Project configuration](../reference/project-config.md)
54
+ - [Provider and target compatibility](../reference/compatibility-matrix.md)
55
+ - [Package-owned lowering](../concepts/package-owned-lowering.md)
@@ -0,0 +1,217 @@
1
+ # `@pulse-compute/provider-fastly`
2
+
3
+ `@pulse-compute/provider-fastly` supplies typed Fastly project configuration,
4
+ canonical capability lowering, direct JavaScript execution, local conformance
5
+ runtimes, Native and JavaScript Compute target generation, and an explicit
6
+ Fastly CLI boundary.
7
+
8
+ Install it only in projects that select the Fastly provider.
9
+
10
+ ## Install
11
+
12
+ ```bash
13
+ npm install @pulse-compute/provider-fastly@1.0.0-beta.1
14
+ ```
15
+
16
+ ## Configure a project
17
+
18
+ <!-- pulse-doc-source: examples/05-fastly-capabilities/.pulse/config.ts -->
19
+ ```ts
20
+ import { defineConfig } from '@pulse-compute/pulse'
21
+
22
+ export default defineConfig((scope) => ({
23
+ pulse: {
24
+ entry: 'src/index.ts',
25
+ tests: 'tests/pulse.harness.ts',
26
+ defaultProfile: 'local',
27
+ strict: true,
28
+ },
29
+ local: {
30
+ host: 'fastly',
31
+ target: 'native',
32
+ outDir: 'dist',
33
+ apiBase: scope.config('API_BASE'),
34
+ apiToken: scope.secret('API_TOKEN'),
35
+ dev: {
36
+ config: { API_BASE: 'https://api.example.com' },
37
+ secrets: {
38
+ API_TOKEN: 'local-example-secret',
39
+ GRIP_TOKEN: 'local-grip-secret',
40
+ },
41
+ kv: {
42
+ sessions: { 'session:123': { userId: 123 } },
43
+ },
44
+ fetches: {
45
+ 'https://api.example.com/users/7': {
46
+ value: { id: 7, name: 'Ada' },
47
+ },
48
+ 'POST https://publisher.example.com/publish': {
49
+ status: 202,
50
+ value: { accepted: true, messageId: 'message-1' },
51
+ },
52
+ },
53
+ },
54
+ fastly: {
55
+ bindings: {
56
+ configStore: 'app_config',
57
+ secretStore: 'app_secrets',
58
+ kv: { sessions: 'app_sessions' },
59
+ backends: {
60
+ 'https://api.example.com': 'api_backend',
61
+ 'https://publisher.example.com': 'publisher_backend',
62
+ },
63
+ dynamicBackends: false,
64
+ grip: {
65
+ publishEndpoint: 'https://publisher.example.com/publish',
66
+ publishBackend: 'publisher_backend',
67
+ authentication: {
68
+ scheme: 'bearer',
69
+ secretRef: 'GRIP_TOKEN',
70
+ },
71
+ },
72
+ },
73
+ build: { name: 'pulse-fastly-capabilities-example' },
74
+ },
75
+ },
76
+ }))
77
+ ```
78
+ <!-- /pulse-doc-source -->
79
+
80
+ The provider maps logical origins and stores used by canonical handler calls to Fastly deployment resources. Local values and fixtures do not create or populate deployed resources.
81
+
82
+ ## Configuration groups
83
+
84
+ The root `fastly()` helper supports:
85
+
86
+ - Config Store and Secret Store names;
87
+ - logical KV namespace to Fastly KV Store mappings;
88
+ - origin to backend-name mappings;
89
+ - explicit dynamic-backend policy;
90
+ - GRIP/Fanout hold and publish bindings;
91
+ - package name, description, and authors;
92
+ - local network-fetch policy.
93
+
94
+ See [Project configuration](../reference/project-config.md#fastly-provider-options) for field-level defaults, precedence, and constraints.
95
+
96
+ ## Build outputs
97
+
98
+ The active `.pulse/config.ts` profile selects one target explicitly:
99
+
100
+ ```bash
101
+ pulse build ./my-app
102
+ ```
103
+
104
+ ### Fastly Native
105
+
106
+ `target: 'native'` compiles the provider-neutral plan and emits generated
107
+ `src/main.as.ts` plus compact `bin/main.wasm` importing the required `fastly_*`
108
+ hostcalls directly. It contains no JavaScript runtime image, `pulse_host`, or
109
+ WASI dependency.
110
+
111
+ ### Fastly JavaScript
112
+
113
+ `target: 'javascript'` emits a deterministic, self-contained source closure:
114
+
115
+ ```text
116
+ src/index.js
117
+ src/application.js
118
+ fastly.toml
119
+ package.json
120
+ pulse-esbuild.config.js
121
+ pulse-fastly-javascript-candidate.json
122
+ pulse-fastly-javascript-deployment.json
123
+ pulse-fastly-javascript-source-package.json
124
+ ```
125
+
126
+ The closure pins `esbuild` and `@fastly/js-compute`, bundles the reachable Pulse
127
+ application and package implementations, and contains no Pulse Native artifact.
128
+ The generated build first produces `dist/index.js`, then the pinned Fastly
129
+ JavaScript compiler produces `bin/main.wasm`. Candidate, source-package,
130
+ deployment, and top-level manifests agree on the selected `fastly-javascript`
131
+ target and retain `automaticFallback: false`.
132
+
133
+ The release gate builds the source closure twice, compares its bytes, and
134
+ successfully invokes the pinned downstream compiler. The resulting runtime Wasm
135
+ is bound to the candidate by SHA-256. Wizer-owned runtime snapshot bytes are not
136
+ claimed byte-reproducible; the Pulse-owned closure and deployment metadata are.
137
+
138
+ Provider selection is configuration-owned. Removed public `--provider` and
139
+ `--source-only` flags are rejected with stable diagnostics.
140
+
141
+ Use:
142
+
143
+ ```bash
144
+ pulse doctor ./my-app --json
145
+ ```
146
+
147
+ to inspect compiler and Fastly CLI readiness before a release build.
148
+
149
+ ## Local conformance and external reality
150
+
151
+ For Fastly Native, `pulse test` and `pulse dev` use the provider’s local
152
+ canonical runtime. For Fastly JavaScript, they use explicit provider emulation
153
+ and the same provider-owned bundled application closure. Both paths use
154
+ configured values, fixtures, and optional network fetch; neither silently runs
155
+ through the Node provider.
156
+
157
+ The native provider module is checked by the explicit reality profile through an inspected local Compute launcher. `PULSE_FASTLY_BIN` selects CLI-owned `fastly compute serve --file`; `PULSE_VICEROY_BIN` selects direct `viceroy serve` when no explicit Fastly CLI launcher is selected. Both are documented in [Environment variables](../reference/environment.md#pulse-fastly-bin).
158
+
159
+ The Fastly reality gate proves Native local host-ABI compatibility through real
160
+ HTTP requests covering schemas, configuration, secrets, KV persistence,
161
+ named-backend fetch, opaque bytes, repeated headers, and GRIP hold/publish. The
162
+ JavaScript candidate gate proves downstream runtime compilation but does not
163
+ invoke `fastly compute serve`. Neither gate claims that remote resources or a
164
+ deployed Fastly service are healthy; remote deployment remains separately
165
+ unvalidated.
166
+
167
+ Fastly JavaScript is generally available under the full-target-support policy:
168
+ all declared runtime, capability, packaging, four-mode, tooling, and offline
169
+ candidate gates are satisfied. General availability is a supported-target
170
+ statement, not evidence that a particular candidate was deployed.
171
+
172
+ ## Public entry points
173
+
174
+ | Entry point | Purpose |
175
+ |---|---|
176
+ | `@pulse-compute/provider-fastly` | Typed `fastly()` project configuration. |
177
+ | `@pulse-compute/provider-fastly/contract` | Canonical descriptor and lowering-plan integration. |
178
+ | `@pulse-compute/provider-fastly/runtime/canonical-api-runtime` | Local canonical runtime used by project execution. |
179
+ | `@pulse-compute/provider-fastly/build/canonical-target` | Fastly source/target writer. |
180
+ | `@pulse-compute/provider-fastly/testing/fastly-cli` | Explicit Fastly CLI discovery and serve boundary. |
181
+
182
+ Other exported compiler/runtime subpaths are compatibility or implementation surfaces and do not gain the same application-facing promise.
183
+
184
+ ## Handler isolation
185
+
186
+ Application source continues to import only `@pulse-compute/runtime` and supported package facades. The provider plan records:
187
+
188
+ ```json
189
+ {
190
+ "providerSpecificUserland": false,
191
+ "providerSdkUserland": false,
192
+ "capabilityDiscoveryFromUserland": false
193
+ }
194
+ ```
195
+
196
+ Do not import Fastly SDK objects into canonical handlers. Bindings belong in project configuration.
197
+
198
+ ## Current limitations
199
+
200
+ - The official `fastly` shorthand resolves this package's explicit
201
+ `./toolchain` export. That narrow bootstrap is not automatic plugin
202
+ discovery, self-registration, or a lowerer extension API.
203
+ - Local fixtures do not provision Fastly resources.
204
+ - Offline candidate validation does not deploy, activate, or publish a Fastly service.
205
+ - Dynamic backends are disabled unless explicitly enabled.
206
+ - GRIP requires the documented Fanout/publish bindings for the operations used.
207
+ - Full userland stream processing and provider SDK escape hatches remain
208
+ outside the Beta.
209
+
210
+ ## Related documentation
211
+
212
+ - [Fastly deployment candidates](../guides/deploying-fastly.md)
213
+ - [Fastly config, secrets, and KV](../guides/fastly-capabilities.md)
214
+ - [GRIP and Fanout](../guides/grip.md)
215
+ - [Contracts and providers](../concepts/contracts-and-providers.md)
216
+ - [Add a core provider](../contributing/adding-core-provider.md)
217
+ - [Fastly diagnostics](../reference/diagnostics.md#toolchain-diagnostics)