@jini-ai/mcp 0.6.15-rc.1 → 0.6.15-rc.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.
@@ -39,7 +39,7 @@ export interface FederatedToolIdentity {
39
39
  * The v2 revision (2026-09-27, "hint drift") added description and input schema: v1 grants
40
40
  * no longer matched, asked once and were saved again. A host must keep its chosen bytes stable.
41
41
  *
42
- * @complexity O(h + s) in the size of the hints and the schema.
42
+ * @complexity Core canonical serialization plus O(h + s) hashing over hints and schema bytes.
43
43
  */
44
44
  export declare function federatedToolApprovalFingerprint({ identity, fingerprintDomain }: {
45
45
  identity: FederatedToolIdentity;
@@ -1,18 +1,5 @@
1
1
  import { createHash } from "node:crypto";
2
- /** Stable JSON: object keys sorted at every depth, so the same hints always hash the same. */
3
- function canonicalJson(value) {
4
- if (Array.isArray(value))
5
- return `[${value.map(canonicalJson).join(",")}]`;
6
- if (value !== null && typeof value === "object") {
7
- const entries = Object.entries(value)
8
- .filter(([, child]) => child !== undefined)
9
- // Object.entries never yields the same key twice, so two keys are never equal and a
10
- // two-way comparison is a total order here.
11
- .sort(([a], [b]) => (a < b ? -1 : 1));
12
- return `{${entries.map(([key, child]) => `${JSON.stringify(key)}:${canonicalJson(child)}`).join(",")}}`;
13
- }
14
- return JSON.stringify(value) ?? "null";
15
- }
2
+ import { canonicalJson } from "@jini-ai/core/records";
16
3
  /**
17
4
  * The fingerprint a remembered approval is saved under and later matched against: the connection,
18
5
  * the server it reaches (its origin and admission revision), the remote tool name, its declared
@@ -25,20 +12,20 @@ function canonicalJson(value) {
25
12
  * The v2 revision (2026-09-27, "hint drift") added description and input schema: v1 grants
26
13
  * no longer matched, asked once and were saved again. A host must keep its chosen bytes stable.
27
14
  *
28
- * @complexity O(h + s) in the size of the hints and the schema.
15
+ * @complexity Core canonical serialization plus O(h + s) hashing over hints and schema bytes.
29
16
  */
30
17
  export function federatedToolApprovalFingerprint({ identity, fingerprintDomain }) {
31
18
  const origin = identity.origin === undefined ? null : identity.origin.kind === "roster" ? ["roster", identity.origin.admissionRevision] : ["preset"];
32
19
  return createHash("sha256")
33
- .update(canonicalJson([
34
- fingerprintDomain,
35
- identity.connectionId,
36
- origin,
37
- identity.remoteName,
38
- identity.declaredAnnotations ?? null,
39
- identity.description,
40
- identity.inputSchema,
41
- ]))
20
+ .update(canonicalJson({ value: [
21
+ fingerprintDomain,
22
+ identity.connectionId,
23
+ origin,
24
+ identity.remoteName,
25
+ identity.declaredAnnotations ?? null,
26
+ identity.description,
27
+ identity.inputSchema,
28
+ ] }))
42
29
  .digest("hex");
43
30
  }
44
31
  //# sourceMappingURL=tool-approvals.js.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jini-ai/mcp",
3
- "version": "0.6.15-rc.1",
3
+ "version": "0.6.15-rc.2",
4
4
  "description": "Model Context Protocol adapters: server config schema and IO, an MCP client, and agent-side MCP server installation.",
5
5
  "license": "Apache-2.0",
6
6
  "repository": {
@@ -83,12 +83,12 @@
83
83
  "registry": "https://registry.npmjs.org"
84
84
  },
85
85
  "dependencies": {
86
- "@jini-ai/core": "^0.6.15-rc.1",
87
- "@jini-ai/protocol": "^0.6.15-rc.1"
86
+ "@jini-ai/core": "^0.6.15-rc.2",
87
+ "@jini-ai/protocol": "^0.6.15-rc.2"
88
88
  },
89
89
  "peerDependencies": {
90
90
  "@cfworker/json-schema": "^4.1.1",
91
- "@jini-ai/platform": "^0.6.15-rc.1",
91
+ "@jini-ai/platform": "^0.6.15-rc.2",
92
92
  "@modelcontextprotocol/sdk": "^1.29.0"
93
93
  },
94
94
  "peerDependenciesMeta": {
@@ -105,9 +105,9 @@
105
105
  "devDependencies": {
106
106
  "@cfworker/json-schema": "^4.1.1",
107
107
  "@modelcontextprotocol/sdk": "^1.29.0",
108
- "@jini-ai/daemon": "^0.6.15-rc.1",
109
- "@jini-ai/core": "^0.6.15-rc.1",
110
- "@jini-ai/platform": "^0.6.15-rc.1"
108
+ "@jini-ai/core": "^0.6.15-rc.2",
109
+ "@jini-ai/platform": "^0.6.15-rc.2",
110
+ "@jini-ai/daemon": "^0.6.15-rc.2"
111
111
  },
112
112
  "scripts": {
113
113
  "build": "tsc -p tsconfig.json && chmod +x dist/bin/serve.js",