@cef-ai/cli 0.5.1 → 1.0.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/dist/lib/jcs.d.ts CHANGED
@@ -1,3 +1,11 @@
1
- export declare function canonicalize(value: unknown): string;
2
- export declare function canonicalizeBytes(value: unknown): Uint8Array;
1
+ /**
2
+ * RFC 8785 JSON Canonicalization Scheme (JCS).
3
+ *
4
+ * Re-exported from `@cef-ai/transport`, which wraps the same `canonicalize` npm
5
+ * package the marketplace API uses and is byte-compatible with the wallet-api
6
+ * Go `canonjson` oracle. Keeping one canonicalizer across the suite is what
7
+ * keeps `cef publish` signatures verifiable server-side; this module stays so
8
+ * existing `cef publish` call sites import `lib/jcs.js` unchanged.
9
+ */
10
+ export { canonicalize, canonicalizeBytes } from "@cef-ai/transport";
3
11
  //# sourceMappingURL=jcs.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"jcs.d.ts","sourceRoot":"","sources":["../../src/lib/jcs.ts"],"names":[],"mappings":"AAeA,wBAAgB,YAAY,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,CAOnD;AAED,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,OAAO,GAAG,UAAU,CAE5D"}
1
+ {"version":3,"file":"jcs.d.ts","sourceRoot":"","sources":["../../src/lib/jcs.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,OAAO,EAAE,YAAY,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC"}
package/dist/lib/jcs.js CHANGED
@@ -1,48 +1,11 @@
1
1
  /**
2
2
  * RFC 8785 JSON Canonicalization Scheme (JCS).
3
3
  *
4
- * Thin wrapper over the `canonicalize` npm package — the same library the
5
- * marketplace API uses. Re-exposed here as `canonicalize()` returning a
6
- * string (and `canonicalizeBytes()` returning the UTF-8 bytes that get
7
- * signed / hashed) so call sites in `cef publish` mirror the marketplace's
8
- * `lib/jcs.ts` one-to-one.
9
- *
10
- * RFC 8785 leaves the encoding of non-finite numbers / BigInt undefined; we
11
- * reject them up front rather than rely on the package's silent coercion,
12
- * matching the marketplace's behaviour.
4
+ * Re-exported from `@cef-ai/transport`, which wraps the same `canonicalize` npm
5
+ * package the marketplace API uses and is byte-compatible with the wallet-api
6
+ * Go `canonjson` oracle. Keeping one canonicalizer across the suite is what
7
+ * keeps `cef publish` signatures verifiable server-side; this module stays so
8
+ * existing `cef publish` call sites import `lib/jcs.js` unchanged.
13
9
  */
14
- import canonicalizePkg from "canonicalize";
15
- export function canonicalize(value) {
16
- assertJcsCompatible(value);
17
- const out = canonicalizePkg(value);
18
- if (out === undefined) {
19
- throw new TypeError("JCS: canonicalize() returned undefined");
20
- }
21
- return out;
22
- }
23
- export function canonicalizeBytes(value) {
24
- return new TextEncoder().encode(canonicalize(value));
25
- }
26
- function assertJcsCompatible(value) {
27
- if (typeof value === "number") {
28
- if (!Number.isFinite(value)) {
29
- throw new TypeError(`JCS: non-finite number ${String(value)}`);
30
- }
31
- return;
32
- }
33
- if (typeof value === "bigint") {
34
- throw new TypeError("JCS: bigint not supported by RFC 8785");
35
- }
36
- if (Array.isArray(value)) {
37
- for (const item of value)
38
- assertJcsCompatible(item);
39
- return;
40
- }
41
- if (value !== null && typeof value === "object") {
42
- for (const v of Object.values(value)) {
43
- if (v !== undefined)
44
- assertJcsCompatible(v);
45
- }
46
- }
47
- }
10
+ export { canonicalize, canonicalizeBytes } from "@cef-ai/transport";
48
11
  //# sourceMappingURL=jcs.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"jcs.js","sourceRoot":"","sources":["../../src/lib/jcs.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AACH,OAAO,eAAe,MAAM,cAAc,CAAC;AAE3C,MAAM,UAAU,YAAY,CAAC,KAAc;IACzC,mBAAmB,CAAC,KAAK,CAAC,CAAC;IAC3B,MAAM,GAAG,GAAG,eAAe,CAAC,KAAK,CAAC,CAAC;IACnC,IAAI,GAAG,KAAK,SAAS,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{
2
2
  "name": "@cef-ai/cli",
3
- "version": "0.5.1",
3
+ "version": "1.0.0",
4
4
  "type": "module",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",
@@ -16,12 +16,12 @@
16
16
  "dependencies": {
17
17
  "@noble/ed25519": "^2.1.0",
18
18
  "@noble/hashes": "^2.2.0",
19
- "canonicalize": "^3.0.0",
20
19
  "commander": "^12.0.0",
21
20
  "esbuild": "^0.21.0",
22
21
  "json-schema-to-typescript": "^14.0.0",
23
22
  "typescript": "^5.4.0",
24
- "@cef-ai/agent-sdk": "0.1.0"
23
+ "@cef-ai/agent-sdk": "1.0.0",
24
+ "@cef-ai/transport": "1.0.0"
25
25
  },
26
26
  "devDependencies": {
27
27
  "@types/node": "^20.11.0",