@pulse-compute/cli 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 (191) hide show
  1. package/API.md +572 -0
  2. package/CHANGELOG.md +71 -0
  3. package/README.md +71 -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 +470 -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 +300 -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 +70 -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 +202 -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 +100 -0
  48. package/docs/maintainers/maintenance-policy.json +809 -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 +293 -0
  55. package/docs/maintainers/release-manifest.md +89 -0
  56. package/docs/maintainers/repository-setup.md +145 -0
  57. package/docs/maintainers/scope-policy.md +105 -0
  58. package/docs/maintainers/support-and-triage.md +74 -0
  59. package/docs/maintainers/testing.md +334 -0
  60. package/docs/packages/README.md +60 -0
  61. package/docs/packages/assets.md +85 -0
  62. package/docs/packages/cli.md +190 -0
  63. package/docs/packages/crypto.md +78 -0
  64. package/docs/packages/entities.md +129 -0
  65. package/docs/packages/grip.md +82 -0
  66. package/docs/packages/implementation-packages.md +122 -0
  67. package/docs/packages/jwt.md +55 -0
  68. package/docs/packages/provider-fastly.md +243 -0
  69. package/docs/packages/pulse.md +159 -0
  70. package/docs/packages/runtime.md +265 -0
  71. package/docs/packages/s3.md +101 -0
  72. package/docs/preview-scope.md +142 -0
  73. package/docs/reference/README.md +33 -0
  74. package/docs/reference/cli-spec.json +575 -0
  75. package/docs/reference/cli.md +457 -0
  76. package/docs/reference/compatibility-matrix.md +169 -0
  77. package/docs/reference/diagnostics.md +1872 -0
  78. package/docs/reference/documentation-versions.json +22 -0
  79. package/docs/reference/environment.md +347 -0
  80. package/docs/reference/handler-authoring.md +264 -0
  81. package/docs/reference/project-config.md +582 -0
  82. package/docs/reference/project-config.schema.json +981 -0
  83. package/docs/reference/release-manifest.json +441 -0
  84. package/docs/reference/shell-completion.md +23 -0
  85. package/documentation-site.json +668 -0
  86. package/documentation-versions.json +22 -0
  87. package/examples/01-hello-json/.pulse/.gitignore +3 -0
  88. package/examples/01-hello-json/.pulse/config.ts +16 -0
  89. package/examples/01-hello-json/README.md +119 -0
  90. package/examples/01-hello-json/package.json +20 -0
  91. package/examples/01-hello-json/src/index.ts +9 -0
  92. package/examples/01-hello-json/tests/pulse.harness.ts +22 -0
  93. package/examples/01-hello-json/tsconfig.json +14 -0
  94. package/examples/02-request-schema/.pulse/.gitignore +3 -0
  95. package/examples/02-request-schema/.pulse/config.ts +17 -0
  96. package/examples/02-request-schema/README.md +145 -0
  97. package/examples/02-request-schema/package.json +20 -0
  98. package/examples/02-request-schema/src/index.ts +18 -0
  99. package/examples/02-request-schema/src/schemas.ts +20 -0
  100. package/examples/02-request-schema/tests/pulse.harness.ts +37 -0
  101. package/examples/02-request-schema/tsconfig.json +14 -0
  102. package/examples/03-fetch-composition/.pulse/.gitignore +3 -0
  103. package/examples/03-fetch-composition/.pulse/config.ts +31 -0
  104. package/examples/03-fetch-composition/README.md +210 -0
  105. package/examples/03-fetch-composition/package.json +20 -0
  106. package/examples/03-fetch-composition/src/index.ts +60 -0
  107. package/examples/03-fetch-composition/tests/pulse.harness.ts +47 -0
  108. package/examples/03-fetch-composition/tsconfig.json +14 -0
  109. package/examples/05-fastly-capabilities/.pulse/.gitignore +3 -0
  110. package/examples/05-fastly-capabilities/.pulse/config.ts +57 -0
  111. package/examples/05-fastly-capabilities/README.md +257 -0
  112. package/examples/05-fastly-capabilities/package.json +22 -0
  113. package/examples/05-fastly-capabilities/src/index.ts +55 -0
  114. package/examples/05-fastly-capabilities/tests/pulse.harness.ts +66 -0
  115. package/examples/05-fastly-capabilities/tsconfig.json +14 -0
  116. package/examples/07-opaque-proxy/.pulse/.gitignore +3 -0
  117. package/examples/07-opaque-proxy/.pulse/config.ts +38 -0
  118. package/examples/07-opaque-proxy/README.md +150 -0
  119. package/examples/07-opaque-proxy/package.json +21 -0
  120. package/examples/07-opaque-proxy/src/index.ts +9 -0
  121. package/examples/07-opaque-proxy/tests/pulse.harness.ts +25 -0
  122. package/examples/07-opaque-proxy/tsconfig.json +14 -0
  123. package/examples/09-router-lowering/.pulse/.gitignore +3 -0
  124. package/examples/09-router-lowering/.pulse/config.ts +22 -0
  125. package/examples/09-router-lowering/README.md +287 -0
  126. package/examples/09-router-lowering/package.json +22 -0
  127. package/examples/09-router-lowering/src/index.ts +65 -0
  128. package/examples/09-router-lowering/tests/pulse.harness.ts +91 -0
  129. package/examples/09-router-lowering/tsconfig.json +14 -0
  130. package/examples/10-entities-tools/.pulse/.gitignore +4 -0
  131. package/examples/10-entities-tools/.pulse/config.ts +23 -0
  132. package/examples/10-entities-tools/README.md +165 -0
  133. package/examples/10-entities-tools/package.json +21 -0
  134. package/examples/10-entities-tools/src/handlers.ts +15 -0
  135. package/examples/10-entities-tools/src/index.ts +31 -0
  136. package/examples/10-entities-tools/src/schemas.ts +18 -0
  137. package/examples/10-entities-tools/tests/pulse.harness.ts +40 -0
  138. package/examples/10-entities-tools/tools-facade.cjs +158 -0
  139. package/examples/10-entities-tools/tsconfig.json +14 -0
  140. package/examples/11-events/.pulse/.gitignore +4 -0
  141. package/examples/11-events/.pulse/config.ts +24 -0
  142. package/examples/11-events/README.md +194 -0
  143. package/examples/11-events/package.json +20 -0
  144. package/examples/11-events/src/index.ts +27 -0
  145. package/examples/11-events/src/schemas.ts +19 -0
  146. package/examples/11-events/tests/pulse.harness.ts +34 -0
  147. package/examples/11-events/tsconfig.json +15 -0
  148. package/examples/12-mcp-proxy/.pulse/.gitignore +3 -0
  149. package/examples/12-mcp-proxy/.pulse/config.ts +25 -0
  150. package/examples/12-mcp-proxy/README.md +149 -0
  151. package/examples/12-mcp-proxy/package.json +20 -0
  152. package/examples/12-mcp-proxy/src/index.ts +17 -0
  153. package/examples/12-mcp-proxy/tests/pulse.harness.ts +29 -0
  154. package/examples/12-mcp-proxy/tsconfig.json +14 -0
  155. package/examples/13-jwt-es256/.pulse/config.ts +19 -0
  156. package/examples/13-jwt-es256/README.md +195 -0
  157. package/examples/13-jwt-es256/package.json +21 -0
  158. package/examples/13-jwt-es256/src/index.ts +21 -0
  159. package/examples/13-jwt-es256/tests/pulse.harness.ts +54 -0
  160. package/examples/13-jwt-es256/tsconfig.json +14 -0
  161. package/examples/README.md +36 -0
  162. package/package.json +66 -6
  163. package/project-config.schema.json +981 -0
  164. package/release-manifest.json +441 -0
  165. package/src/command-spec.js +279 -0
  166. package/src/completion.js +113 -0
  167. package/src/diagnostics.js +350 -0
  168. package/src/documentation.js +45 -0
  169. package/src/index.d.ts +133 -0
  170. package/src/index.js +15 -0
  171. package/src/internal/command-executor.d.ts +29 -0
  172. package/src/internal/command-executor.js +143 -0
  173. package/src/internal/command-plan.d.ts +9 -0
  174. package/src/internal/command-plan.js +73 -0
  175. package/src/internal/command-reporter.d.ts +15 -0
  176. package/src/internal/command-reporter.js +133 -0
  177. package/src/internal/command-request.d.ts +35 -0
  178. package/src/internal/command-request.js +154 -0
  179. package/src/internal/node-http.js +54 -0
  180. package/src/internal/project-context.d.ts +66 -0
  181. package/src/internal/project-context.js +175 -0
  182. package/src/project-config-reference.js +4 -0
  183. package/src/project-config-schema.d.ts +23 -0
  184. package/src/project-config-schema.js +271 -0
  185. package/src/project-config.js +724 -0
  186. package/src/project-execution.js +2946 -0
  187. package/src/provider-drivers.js +3 -0
  188. package/src/target-support.js +3 -0
  189. package/src/typescript-module-loader.js +269 -0
  190. package/src/workflow.js +78 -0
  191. package/src/workspace.js +82 -0
@@ -0,0 +1,190 @@
1
+ # `@pulse-compute/cli`
2
+
3
+ `@pulse-compute/cli` owns the supported `pulse` command, project configuration types, project discovery, compilation workflow, local execution, and target builds.
4
+
5
+ ## Install and initialize
6
+
7
+ The current repository CLI is a source candidate. Its conventional initializer
8
+ depends on the public `@pulse-compute/pulse` package and is validated from both
9
+ the checkout and the exact packed acceptance set:
10
+
11
+ ```bash
12
+ pnpm pulse -- init ./my-app
13
+ cd ./my-app
14
+ npm install
15
+ pulse doctor
16
+ ```
17
+
18
+ `pulse init` writes a conventional `.pulse/config.ts` workspace, an async
19
+ `Pulse` application root, a dedicated `tests/pulse.harness.ts`, strict
20
+ TypeScript configuration, and exact source-candidate package versions. It does
21
+ not run a package manager or perform hidden network work. Public npm
22
+ availability is defined by the synchronized 18-package release manifest.
23
+
24
+ ## Daily workflow
25
+
26
+ ```bash
27
+ pulse doctor
28
+ pulse inspect
29
+ pulse test
30
+ pulse dev
31
+ pulse compile
32
+ pulse build
33
+ ```
34
+
35
+ - `doctor` validates project, provider, dependencies, and external toolchain readiness.
36
+ - `inspect` compiles and reports effects, continuations, schemas, event registrations/callsites, capabilities, target eligibility, and provider lowering without executing cases.
37
+ - `test` executes configured request and explicit `kind: 'event'` cases through the provider-owned local conformance runtime.
38
+ - `dev` runs a foreground local server and watches the project by default.
39
+ - `compile` writes deterministic provider-neutral Pulse Wasm plus its native plan, generated AssemblyScript, WAT, and manifests.
40
+ - `build` writes the configured target realization: Native profiles emit provider Wasm, while JavaScript profiles emit deterministic source packages. Eligible event projects also emit `event-catalog.json` and `event-inspection.json` beside the target output. Fastly JavaScript packages carry exact downstream compiler pins and deployment-candidate metadata.
41
+
42
+ See the generated [CLI reference](../reference/cli.md) for every option, positional form, output, side effect, and exit behavior.
43
+
44
+ ## Project configuration
45
+
46
+ ```ts
47
+ import { defineConfig } from '@pulse-compute/pulse'
48
+
49
+ export default defineConfig((_scope) => ({
50
+ pulse: {
51
+ entry: 'src/index.ts',
52
+ tests: 'tests/pulse.harness.ts',
53
+ defaultProfile: 'local',
54
+ strict: true,
55
+ },
56
+ local: {
57
+ host: 'node',
58
+ target: 'native',
59
+ outDir: 'dist',
60
+ dev: { host: '127.0.0.1', port: 8787 },
61
+ },
62
+ }))
63
+ ```
64
+
65
+ The generated application imports `Pulse` from `@pulse-compute/pulse`, declares
66
+ managed handlers `async`, and keeps deterministic request cases in the separate
67
+ harness module. Workspace discovery starts from `.pulse/config.ts`.
68
+
69
+ Harness event cases require the explicit `kind: 'event'` discriminant, one
70
+ canonical input frame, and an ordered exact `expect.emitted` array. HTTP cases
71
+ retain their existing shape and default behavior. There is no public `pulse
72
+ event` command and `pulse dev` remains HTTP-only.
73
+
74
+ The complete event workflow, queue, artifact, target, and diagnostic boundary
75
+ is in [Static events and outbound emission](../guides/events.md).
76
+
77
+ ## Machine-readable contracts and shell completion
78
+
79
+ The installed package exposes release-owned machine interfaces for editors, automation, validation, and documentation tooling:
80
+
81
+ | Export or command | Contract |
82
+ |---|---|
83
+ | `pulse completion bash` | Bash completion generated from the public command specification. |
84
+ | `pulse completion zsh` | Zsh completion generated from the same specification. |
85
+ | `pulse completion fish` | Fish completion generated from the same specification. |
86
+ | `@pulse-compute/cli/cli-spec.json` | Seven commands, public options, aliases, positional forms, provider restrictions, output modes, and completion metadata. |
87
+ | `@pulse-compute/cli/project-config.schema.json` | JSON Schema bundle plus discovery, precedence, defaults, runtime rules, and provider configuration schemas. |
88
+ | `@pulse-compute/cli/release-manifest.json` | Exact release, hosted-documentation routes, package tiers, supported entry points, and publication policy. |
89
+ | `@pulse-compute/cli/documentation-versions.json` | Available documentation versions and the current `latest` target. |
90
+ | `@pulse-compute/cli/project-config-schema` | Programmatic schema, defaults, structural validation, and reference metadata. |
91
+
92
+ These files are generated from the same modules used by the parser, runtime configuration loader, package packer, and documentation release gate. See [Shell completion](../reference/shell-completion.md), the [CLI specification](../reference/cli-spec.json), the [project configuration schema](../reference/project-config.schema.json), and the [release manifest reference](../maintainers/release-manifest.md).
93
+
94
+ ## Public entry points
95
+
96
+ The supported package surface is:
97
+
98
+ | Entry point | Intended use |
99
+ |---|---|
100
+ | `pulse` binary | Application and CI workflow. |
101
+ | `@pulse-compute/cli` | `defineConfig`, project-config types, diagnostics helper, and programmatic workflow entry. |
102
+ | `@pulse-compute/cli/workflow` | CLI parsing and execution integration. |
103
+ | `@pulse-compute/cli/project-config` | Project discovery and normalization integration. |
104
+ | `@pulse-compute/cli/project-execution` | Canonical doctor/inspect/test/dev/compile/build orchestration. |
105
+ | `@pulse-compute/cli/diagnostics` | Stable public diagnostic descriptors and mappings. |
106
+
107
+ Other files present in the tarball are not automatically public APIs.
108
+
109
+ ## JSON output
110
+
111
+ Completed commands emit one JSON object with a trailing newline when `--json` is used. `pulse dev --json` emits newline-delimited event objects instead of one enclosing document. Supported events include `compiled`, `ready`, `reloaded`, `request`, `compile-error`, and `request-error`.
112
+
113
+ Stable failures include a public diagnostic code, remediation, exit class, and exact-version documentation URL. See [Diagnostics and remediation](../reference/diagnostics.md).
114
+
115
+ ## Provider behavior
116
+
117
+ The CLI supports `node`, `fastly`, and compile-only `none`. Node and Fastly each
118
+ accept an explicit `native` or `javascript` execution target:
119
+
120
+ - Node Native lowers to Pulse-owned Wasm and executes through the Node host.
121
+ - Node JavaScript loads the reachable application graph and runs the live runtime and package implementations.
122
+ - Fastly Native emits compact direct-host-ABI `bin/main.wasm`.
123
+ - Fastly JavaScript emits a deterministic source/deployment package and a structurally deployable downstream runtime candidate.
124
+ - `none` can inspect or compile canonical output but cannot serve or run tests.
125
+
126
+ For projects with reachable event registrations or `ctx.emit` callsites, Node
127
+ Native and Node JavaScript are eligible for the bounded reference workflow.
128
+ `inspect`, `doctor`, compile/build manifests, and event inspection artifacts
129
+ report the catalog, schema IDs, callsites, host requirements, and per-command
130
+ target support. `none` remains useful for compile-only catalog inspection.
131
+ Fastly Native and JavaScript fail closed with exact event-ingress or event-emit
132
+ diagnostics; Pulse does not translate that plane through HTTP or GRIP and never
133
+ changes targets automatically.
134
+
135
+ `pulse compile` is provider-neutral regardless of the configured provider. It produces the portable Pulse-owned Wasm boundary directly; `pulse build` continues to own provider realization.
136
+
137
+ Those provider IDs are configuration data, not command-layer implementation
138
+ branches. The CLI consumes a neutral facade over the compiler-owned fixed
139
+ registry; concrete provider imports, configuration policy, and target adapters
140
+ remain outside the CLI package. Node retains a deliberate reference/smoke role
141
+ for canonical Native behavior.
142
+
143
+ Both JavaScript declarations satisfy full-target-support and report general
144
+ availability. Project eligibility remains separate, and target selection never
145
+ falls back automatically. Fastly JavaScript `test` and `dev` identify their
146
+ execution mode as provider emulation; the offline candidate gate compiles a real
147
+ Fastly JavaScript runtime artifact but performs no deployment or publication.
148
+
149
+ Provider and target selection change realization, not handler APIs. See
150
+ [Contracts and providers](../concepts/contracts-and-providers.md).
151
+
152
+ ## Installed documentation payload
153
+
154
+ The CLI npm package ships:
155
+
156
+ - this public documentation hierarchy;
157
+ - the canonical API reference;
158
+ - CLI, configuration, diagnostics, environment, release, and version references;
159
+ - generated command/config/release machine interfaces and shell completions;
160
+ - package and contributor guides;
161
+ - ten complete lifecycle example projects plus the focused Entities candidate,
162
+ including static Router lowering and mixed HTTP/event authoring.
163
+
164
+ This makes diagnostic links and package README links usable from an installed exact-version release rather than depending on monorepo paths.
165
+
166
+ ## Safety boundaries
167
+
168
+ - Build output must remain a real descendant of the project root.
169
+ - `--no-clean` does not disable traversal or symbolic-link safety checks.
170
+ - Raw configured secrets are redacted from public JSON and diagnostics.
171
+ - `dev` is a foreground process, not a hidden daemon.
172
+ - Repository-only fixture/profile/task flags are excluded from installed help and the public reference.
173
+ - Fastly external execution is delegated to the Fastly CLI; the reality gate may pass an inspected Viceroy path, but Pulse does not launch Viceroy directly.
174
+
175
+ ## Related documentation
176
+
177
+ - [Getting started](../getting-started.md)
178
+ - [Project lifecycle](../guides/project-lifecycle.md)
179
+ - [Static events and outbound emission](../guides/events.md)
180
+ - [Provider and target compatibility](../reference/compatibility-matrix.md)
181
+ - [Managed handler TypeScript and JavaScript](../reference/handler-authoring.md)
182
+ - [Node build and execution](../guides/deploying-node.md)
183
+ - [Fastly deployment candidates](../guides/deploying-fastly.md)
184
+ - [CLI reference](../reference/cli.md)
185
+ - [Shell completion](../reference/shell-completion.md)
186
+ - [Project configuration](../reference/project-config.md)
187
+ - [Release manifest and package policy](../maintainers/release-manifest.md)
188
+ - [Documentation versioning](../maintainers/documentation-versioning.md)
189
+ - [Environment-variable reference](../reference/environment.md)
190
+ - [Release acceptance](../maintainers/release-acceptance.md)
@@ -0,0 +1,78 @@
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.2
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
+ Native capability packages can also select `SHA-256` and `HMAC-SHA256` for
62
+ internal byte output. Their exact `guest-source:pulse-hmac-as` realization uses
63
+ 32-byte output, at most 32 KiB of data and 8 KiB of HMAC key material. Crypto owns
64
+ a reusable, wiped host staging frame. These operations are separate from JWT's
65
+ 32-byte minimum HMAC verification key; the application verification API retains
66
+ its existing limits. JavaScript byte-output realization is not implemented yet.
67
+
68
+ The package root is the supported application contract. Native integration,
69
+ guest provenance, and realization records are toolchain-owned surfaces. JWT
70
+ owns compact-JWS parsing, key selection, and claims semantics; this package
71
+ owns normalized cryptographic verification.
72
+
73
+ ## Related material
74
+
75
+ - [JWT verification](./jwt.md)
76
+ - [Project configuration](../reference/project-config.md)
77
+ - [Provider and target compatibility](../reference/compatibility-matrix.md)
78
+ - [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.2
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.2
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,122 @@
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.2 release policy.
8
+
9
+ ## `@pulse-compute/wasm-build-support`
10
+
11
+ Pulse release-set and compiler maintainers.
12
+
13
+ - **npm:** [`@pulse-compute/wasm-build-support`](https://www.npmjs.com/package/@pulse-compute/wasm-build-support)
14
+ - **Install directly:** No for application projects; it is installed transitively where required.
15
+ - **Stability:** Internal release-set interface; exported modules may change with compiler implementation needs.
16
+
17
+ ### Supported entry points
18
+
19
+ - `None for application authors.`
20
+
21
+ ## `@pulse-compute/wasm-compiler`
22
+
23
+ Pulse compiler and release maintainers.
24
+
25
+ - **npm:** [`@pulse-compute/wasm-compiler`](https://www.npmjs.com/package/@pulse-compute/wasm-compiler)
26
+ - **Install directly:** No for application projects; use the pulse CLI.
27
+ - **Stability:** Internal compiler interface; no application-author compatibility guarantee.
28
+ - **Canonical replacement:** `@pulse-compute/cli`
29
+
30
+ ### Supported entry points
31
+
32
+ - `None for application authors.`
33
+
34
+ ## `@pulse-compute/wasm-guest-link`
35
+
36
+ Pulse compiler, release, and first-party guest-unit maintainers.
37
+
38
+ - **npm:** [`@pulse-compute/wasm-guest-link`](https://www.npmjs.com/package/@pulse-compute/wasm-guest-link)
39
+ - **Install directly:** No for application projects; it is an internal synchronized compiler dependency.
40
+ - **Stability:** Internal first-party prebuilt guest-link interface synchronized with the compiler; no application-author or third-party guest compatibility guarantee.
41
+
42
+ ### Supported entry points
43
+
44
+ - `None for application authors.`
45
+
46
+ ## `@pulse-compute/wasm-contracts`
47
+
48
+ Pulse compiler, runtime, provider, and package-lowering maintainers.
49
+
50
+ - **npm:** [`@pulse-compute/wasm-contracts`](https://www.npmjs.com/package/@pulse-compute/wasm-contracts)
51
+ - **Install directly:** Provider toolchain authors may install it for the versioned bootstrap contract; application projects receive it transitively.
52
+ - **Stability:** The provider toolchain contract is versioned and supported for the Beta; other protocol and proof interfaces remain internal.
53
+
54
+ ### Supported entry points
55
+
56
+ - `@pulse-compute/wasm-contracts/provider/toolchain`
57
+
58
+ ## `@pulse-compute/wasm-host-runtime`
59
+
60
+ Pulse host-runtime and provider maintainers.
61
+
62
+ - **npm:** [`@pulse-compute/wasm-host-runtime`](https://www.npmjs.com/package/@pulse-compute/wasm-host-runtime)
63
+ - **Install directly:** No for application projects; it is installed transitively.
64
+ - **Stability:** Internal compiler/runtime interface synchronized with this release set.
65
+
66
+ ### Supported entry points
67
+
68
+ - `None for application authors.`
69
+
70
+ ## `@pulse-compute/wasm-library-kit`
71
+
72
+ Pulse package-lowering and compiler maintainers.
73
+
74
+ - **npm:** [`@pulse-compute/wasm-library-kit`](https://www.npmjs.com/package/@pulse-compute/wasm-library-kit)
75
+ - **Install directly:** No for application projects; it is installed transitively.
76
+ - **Stability:** Internal package-lowering interface synchronized with this release set.
77
+
78
+ ### Supported entry points
79
+
80
+ - `None for application authors.`
81
+
82
+ ## `@pulse-compute/provider-node`
83
+
84
+ Pulse canonical Node provider and compiler maintainers.
85
+
86
+ - **npm:** [`@pulse-compute/provider-node`](https://www.npmjs.com/package/@pulse-compute/provider-node)
87
+ - **Install directly:** No for application projects; select provider: node through the CLI.
88
+ - **Stability:** The listed built-in toolchain entry is synchronized with the Beta bootstrap contract; other canonical Node provider interfaces remain internal.
89
+ - **Canonical replacement:** `provider: 'node' through @pulse-compute/cli`
90
+
91
+ ### Supported entry points
92
+
93
+ - `@pulse-compute/provider-node/toolchain`
94
+
95
+ ## `@pulse-compute/wasm-runtime-core-as`
96
+
97
+ Pulse AssemblyScript runtime-core and compiler maintainers.
98
+
99
+ - **npm:** [`@pulse-compute/wasm-runtime-core-as`](https://www.npmjs.com/package/@pulse-compute/wasm-runtime-core-as)
100
+ - **Install directly:** No for application projects; it is installed transitively.
101
+ - **Stability:** Internal code-generation interface synchronized with this release set.
102
+
103
+ ### Supported entry points
104
+
105
+ - `None for application authors.`
106
+
107
+ ## `@pulse-compute/wasm-schema-json`
108
+
109
+ Pulse schema compiler and runtime maintainers.
110
+
111
+ - **npm:** [`@pulse-compute/wasm-schema-json`](https://www.npmjs.com/package/@pulse-compute/wasm-schema-json)
112
+ - **Install directly:** No for application projects; declare schemas in the selected .pulse/config.ts profile.
113
+ - **Stability:** Internal schema compiler interface synchronized with this release set.
114
+ - **Canonical replacement:** `schemas in .pulse/config.ts through the Pulse project workflow`
115
+
116
+ ### Supported entry points
117
+
118
+ - `None for application authors.`
119
+
120
+ ## Support boundary
121
+
122
+ 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.2
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)