@pulse-compute/pulse 1.0.0-beta.4 → 1.0.0-beta.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -7,9 +7,9 @@
7
7
  > **Supported entry points:** `@pulse-compute/pulse`, `@pulse-compute/pulse/schema`<br>
8
8
  > **Stability:** Supported conventional application, project-configuration, and schema-authoring contract.<br>
9
9
  > **npm:** [`@pulse-compute/pulse`](https://www.npmjs.com/package/@pulse-compute/pulse)<br>
10
- > **Canonical documentation:** [Package guide](https://pulsecompute.io/v1.0.0-beta.4/packages/pulse/)
10
+ > **Canonical documentation:** [Package guide](https://pulsecompute.io/v1.0.0-beta.6/packages/pulse/)
11
11
  >
12
- > This release-status block is generated from the synchronized `Pulse 1.0.0-beta.4` package policy.
12
+ > This release-status block is generated from the synchronized `Pulse 1.0.0-beta.6` package policy.
13
13
  <!-- pulse-package-status:end -->
14
14
 
15
15
  This package owns the project-aware authoring layer above the low-level
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pulse-compute/pulse",
3
- "version": "1.0.0-beta.4",
3
+ "version": "1.0.0-beta.6",
4
4
  "license": "Apache-2.0",
5
5
  "engines": {
6
6
  "node": "^22.14.0 || ^24.0.0"
@@ -28,8 +28,8 @@
28
28
  "NOTICE"
29
29
  ],
30
30
  "dependencies": {
31
- "@pulse-compute/runtime": "1.0.0-beta.4",
32
- "@pulse-compute/wasm-contracts": "1.0.0-beta.4"
31
+ "@pulse-compute/runtime": "1.0.0-beta.6",
32
+ "@pulse-compute/wasm-contracts": "1.0.0-beta.6"
33
33
  },
34
34
  "publishConfig": {
35
35
  "access": "public"
@@ -39,7 +39,7 @@
39
39
  "url": "git+https://github.com/pulse-compute/pulse.git",
40
40
  "directory": "packages/pulse"
41
41
  },
42
- "homepage": "https://pulsecompute.io/v1.0.0-beta.4/packages/pulse/",
42
+ "homepage": "https://pulsecompute.io/v1.0.0-beta.6/packages/pulse/",
43
43
  "bugs": {
44
44
  "url": "https://github.com/pulse-compute/pulse/issues"
45
45
  }
package/src/index.d.ts CHANGED
@@ -3,10 +3,12 @@ import { Router } from '@pulse-compute/runtime';
3
3
  export type {
4
4
  HeaderPair,
5
5
  PulseEffect,
6
+ PulseTimeResult,
6
7
  PulseParallelEffect,
7
8
  PulseEffectResult,
8
9
  PulseParallelResult,
9
10
  PulseRequest,
11
+ PulseIncomingBody,
10
12
  PulseFetchInit,
11
13
  PulseStructuredResponse,
12
14
  PulseOpaqueResponse,
@@ -45,11 +47,11 @@ export type {
45
47
 
46
48
  export type PulseExecutionTarget = 'native' | 'javascript';
47
49
  export type PulseReportingLevel = 'off' | 'error' | 'warn' | 'info' | 'debug';
48
- export type PulseCryptoAlgorithm = 'HS256' | 'ES256' | 'SHA-256' | 'HMAC-SHA256';
50
+ export type PulseCryptoAlgorithm = 'HS256' | 'ES256' | 'RS256' | 'SHA-256' | 'HMAC-SHA256';
49
51
  export type PulseCryptoRealization =
50
52
  | 'runtime-builtin'
51
53
  | 'guest-source:pulse-hmac-as'
52
- | 'guest-linked:pulse-es256-rustcrypto-p256';
54
+ | 'guest-linked:pulse-es256-rustcrypto-p256' | 'guest-linked:pulse-rs256-bearssl-i31';
53
55
  export type PulseCryptoConfiguration =
54
56
  | readonly PulseCryptoAlgorithm[]
55
57
  | Readonly<Partial<Record<PulseCryptoAlgorithm, Readonly<{
package/src/schema.d.ts CHANGED
@@ -1,6 +1,37 @@
1
1
  export type Int32 = number & { readonly __pulseInt32?: never };
2
2
  export type Uint32 = number & { readonly __pulseUint32?: never };
3
3
 
4
+ /**
5
+ * An immutable scalar dictionary: at most 32 own string keys, 64 UTF-16 units
6
+ * per key, 1,024 per string value, and an 8 KiB conservative JSON byte budget.
7
+ * Numbers must be finite. Nested containers and duplicate JSON keys are invalid.
8
+ */
9
+ export type ScalarRecord = Readonly<Record<string, string | number | boolean | null>>;
10
+
11
+ /** Recursively immutable JSON. Compiled codecs reject non-finite numbers. */
12
+ export type JsonValue = string | number | boolean | null | readonly JsonValue[] | JsonObject;
13
+ /** Dynamic own string keys whose values are bounded, recursively nested JSON. */
14
+ export interface JsonObject { readonly [key: string]: JsonValue }
15
+ /**
16
+ * Declared object fields keep their types and optionality; additional own keys
17
+ * carry bounded JSON. All names at this object level must be unique in text.
18
+ */
19
+ export type OpenObject<Type extends object> = Readonly<Type> & JsonObject;
20
+
21
+ export interface JsonLimits {
22
+ readonly maxTextBytes: number;
23
+ readonly maxDepth: number;
24
+ readonly maxNodes: number;
25
+ readonly maxObjectMembers: number;
26
+ readonly maxArrayItems: number;
27
+ readonly maxKeyLength: number;
28
+ readonly maxStringLength: number;
29
+ readonly maxJsonBytes: number;
30
+ }
31
+
32
+ /** Supply a static object literal; each override must be a positive i32 literal. */
33
+ export interface SchemaOptions { readonly json?: Partial<JsonLimits> }
34
+
4
35
  declare const schemaDeclarationBrand: unique symbol;
5
36
  declare const responseCaseDeclarationBrand: unique symbol;
6
37
  declare const schemaRegistryBrand: unique symbol;
@@ -27,8 +58,12 @@ export interface SchemaRegistryDeclaration<
27
58
  readonly [schemaRegistryBrand]: true;
28
59
  }
29
60
 
30
- /** Declare one required object-root schema. The stable string key is authoritative. */
31
- export declare function schema<Type>(): SchemaDeclaration<Type>;
61
+ /**
62
+ * Declare one object-root schema. The stable string key is authoritative.
63
+ * Question-mark properties preserve absence; present values must satisfy their
64
+ * declared type. Nullable and absent are distinct; present undefined is invalid.
65
+ */
66
+ export declare function schema<Type>(options?: SchemaOptions): SchemaDeclaration<Type>;
32
67
 
33
68
  /** Map one semantic response-case ID to an HTTP status and registered schema ID. */
34
69
  export declare function response<const Status extends number, const SchemaId extends string>(
@@ -48,4 +83,4 @@ export declare function defineSchemaRegistry<
48
83
  readonly responses?: Responses;
49
84
  }): SchemaRegistryDeclaration<Schemas, Responses>;
50
85
 
51
- export declare const SCHEMA_AUTHORING_VERSION: 'pulse.schema-authoring.v1';
86
+ export declare const SCHEMA_AUTHORING_VERSION: 'pulse.schema-authoring.v3';
package/src/schema.js CHANGED
@@ -1,13 +1,15 @@
1
1
  'use strict';
2
2
 
3
- const SCHEMA_AUTHORING_VERSION = 'pulse.schema-authoring.v1';
3
+ const SCHEMA_AUTHORING_VERSION = 'pulse.schema-authoring.v3';
4
4
  const SCHEMA_DECLARATION_BRAND = Symbol.for('pulse.schema-declaration.v1');
5
5
  const RESPONSE_CASE_DECLARATION_BRAND = Symbol.for('pulse.response-case-declaration.v1');
6
6
  const SCHEMA_REGISTRY_BRAND = Symbol.for('pulse.schema-registry.v1');
7
7
 
8
- function schema() {
8
+ function schema(options) {
9
9
  return Object.freeze({
10
10
  version: SCHEMA_AUTHORING_VERSION,
11
+ ...(options === undefined ? {} : { options: Object.freeze({ ...options,
12
+ ...(options.json === undefined ? {} : { json: Object.freeze({ ...options.json }) }) }) }),
11
13
  [SCHEMA_DECLARATION_BRAND]: true
12
14
  });
13
15
  }