@adea-ai/runtime-sdk 3.1.1 → 3.2.0

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
@@ -4,9 +4,8 @@ SDK for building runtimes that plug into the Control Plane: implement the
4
4
  adapter interface, declare capabilities, and pass conformance, without
5
5
  touching Control Plane internals.
6
6
 
7
- Depends only on [`@adea-ai/contracts`](https://www.npmjs.com/package/@adea-ai/contracts)
8
- and Zod. Pair it with [`@adea-ai/contracts`](https://www.npmjs.com/package/@adea-ai/contracts)
9
- for the service boundary.
7
+ Depends only on [`@adea-ai/contracts`](https://www.npmjs.com/package/@adea-ai/contracts),
8
+ which also carries the service boundary, and Zod.
10
9
 
11
10
  ## What's inside
12
11
 
@@ -46,12 +45,8 @@ import {
46
45
  const metadata = RuntimeAdapterMetadataSchema.parse(raw)
47
46
  ```
48
47
 
49
- Run the compatibility check against your adapter implementation before
50
- registering it (repository development):
51
-
52
- ```sh
53
- bun scripts/compatibility.ts --check
54
- ```
48
+ In this repository, `bun run compatibility:check` (from the root) validates the
49
+ runtime certification matrix and its generated schema.
55
50
 
56
51
  ## License
57
52
 
@@ -1,5 +1,5 @@
1
1
  import { z } from 'zod';
2
- import { canonicalJsonStringify, IdentifierSchemas, Sha256DigestSchema, TimestampSchema, } from '@adea-ai/contracts';
2
+ import { canonicalJsonEqual, IdentifierSchemas, Sha256DigestSchema, TimestampSchema, } from '@adea-ai/contracts';
3
3
  import { PiDurableDispatchIdSchema } from './pi-durable-ids.js';
4
4
  export const PiDurableApprovalEffectDigestSchema = Sha256DigestSchema;
5
5
  export const PiDurableApprovalDecisionIdSchema = z.string().regex(/^pi-decision:[a-f0-9]{32}$/);
@@ -37,5 +37,5 @@ export const PiDurableApprovalDecisionSchema = z.strictObject({
37
37
  export function samePiDurableApprovalDecision(left, right) {
38
38
  const { decidedAt: _left, ...a } = left;
39
39
  const { decidedAt: _right, ...b } = right;
40
- return canonicalJsonStringify(a) === canonicalJsonStringify(b);
40
+ return canonicalJsonEqual(a, b);
41
41
  }
package/dist/registry.js CHANGED
@@ -220,7 +220,7 @@ export class InMemoryRuntimeConnectionRepository {
220
220
  return true;
221
221
  }
222
222
  async get(runtimeConnectionId) {
223
- return cloneOptional(this.#connections.get(runtimeConnectionId));
223
+ return structuredClone(this.#connections.get(runtimeConnectionId));
224
224
  }
225
225
  async getByIdentityDigest(identityDigest) {
226
226
  const runtimeConnectionId = this.#identities.get(identityDigest);
@@ -303,6 +303,3 @@ function latest(...timestamps) {
303
303
  function fail(code) {
304
304
  throw new RuntimeConnectionRegistryError(code);
305
305
  }
306
- function cloneOptional(value) {
307
- return value === undefined ? undefined : structuredClone(value);
308
- }
package/dist/sessions.js CHANGED
@@ -128,10 +128,10 @@ export class InMemoryExternalSessionRepository {
128
128
  return true;
129
129
  }
130
130
  async get(externalSessionId) {
131
- return cloneOptional(this.#sessions.get(externalSessionId));
131
+ return structuredClone(this.#sessions.get(externalSessionId));
132
132
  }
133
133
  async findByNativeIdentity(runtimeConnectionId, opaqueNativeSessionId) {
134
- return cloneOptional([...this.#sessions.values()].find((session) => session.runtimeConnectionId === runtimeConnectionId &&
134
+ return structuredClone([...this.#sessions.values()].find((session) => session.runtimeConnectionId === runtimeConnectionId &&
135
135
  session.opaqueNativeSessionId === opaqueNativeSessionId));
136
136
  }
137
137
  async list(scope) {
@@ -400,6 +400,3 @@ function sameRegistration(session, input) {
400
400
  function fail(code, currentVersion) {
401
401
  throw new ExternalSessionRegistryError(code, currentVersion);
402
402
  }
403
- function cloneOptional(value) {
404
- return value === undefined ? undefined : structuredClone(value);
405
- }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@adea-ai/runtime-sdk",
3
- "version": "3.1.1",
3
+ "version": "3.2.0",
4
4
  "description": "SDK for building Control Plane runtimes: adapters, capabilities, conformance, discovery, eligibility, health, sessions, transport, and routing.",
5
5
  "keywords": [
6
6
  "adapter",
@@ -21,6 +21,7 @@
21
21
  "dist"
22
22
  ],
23
23
  "type": "module",
24
+ "sideEffects": false,
24
25
  "browser": false,
25
26
  "types": "./dist/index.d.ts",
26
27
  "exports": {
@@ -42,8 +43,8 @@
42
43
  "test": "bun test src"
43
44
  },
44
45
  "dependencies": {
45
- "@adea-ai/contracts": "^5.0.4",
46
- "zod": "4.6.6"
46
+ "@adea-ai/contracts": "^5.1.0",
47
+ "zod": "4.6.7"
47
48
  },
48
49
  "engines": {
49
50
  "node": "24.21.0"