@peac/adapter-openclaw 0.10.12 → 0.10.14

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
@@ -30,9 +30,9 @@ plugin.instance.start();
30
30
 
31
31
  Every tool call your agent makes is captured as a tamper-evident record:
32
32
 
33
- - **Tool name, timing, status** -- what ran, when, whether it succeeded
34
- - **Input/output digests** -- SHA-256 hashes by default (payloads are never stored in plaintext unless you explicitly allowlist a tool)
35
- - **Chain linkage** -- each record links to the previous one, so gaps or reordering are detectable
33
+ - **Tool name, timing, status**: what ran, when, whether it succeeded
34
+ - **Input/output digests**: SHA-256 hashes by default (payloads are never stored in plaintext unless you explicitly allowlist a tool)
35
+ - **Chain linkage**: each record links to the previous one, so gaps or reordering are detectable
36
36
 
37
37
  Records are signed with your key and written to disk as individual `.peac.json` files.
38
38
 
package/dist/index.cjs CHANGED
@@ -24,6 +24,8 @@ function _interopNamespace(e) {
24
24
  return Object.freeze(n);
25
25
  }
26
26
 
27
+ var crypto__namespace = /*#__PURE__*/_interopNamespace(crypto);
28
+ var captureCore__namespace = /*#__PURE__*/_interopNamespace(captureCore);
27
29
  var path__namespace = /*#__PURE__*/_interopNamespace(path);
28
30
  var fs2__namespace = /*#__PURE__*/_interopNamespace(fs2);
29
31
 
@@ -509,10 +511,10 @@ function createJwkSigner(jwk, issuer, audience) {
509
511
  if (!jwk.d) {
510
512
  throw new Error("JWK must include private key (d parameter)");
511
513
  }
512
- const privateKeyBytes = crypto.base64urlDecode(jwk.d);
514
+ const privateKeyBytes = crypto__namespace.base64urlDecode(jwk.d);
513
515
  return {
514
516
  async sign(payload) {
515
- return crypto.sign(payload, privateKeyBytes, kid);
517
+ return crypto__namespace.sign(payload, privateKeyBytes, kid);
516
518
  },
517
519
  getKeyId() {
518
520
  return kid;
@@ -617,8 +619,8 @@ async function createPluginInstance(options) {
617
619
  batchSize = 100,
618
620
  onError
619
621
  } = options;
620
- const hasher = await captureCore.createHasher();
621
- const session = captureCore.createCaptureSession({
622
+ const hasher = await captureCore__namespace.createHasher();
623
+ const session = captureCore__namespace.createCaptureSession({
622
624
  store,
623
625
  dedupe,
624
626
  hasher
@@ -733,6 +735,10 @@ function decodeReceiptPayload(receipt) {
733
735
  return null;
734
736
  }
735
737
  }
738
+ function stripRedundantFields(content) {
739
+ const { auth, evidence, ...rest } = content;
740
+ return rest;
741
+ }
736
742
  var ALG_KEY_TYPE_MAP = {
737
743
  EdDSA: { kty: "OKP", crv: ["Ed25519", "Ed448"] },
738
744
  ES256: { kty: "EC", crv: ["P-256"] },
@@ -923,9 +929,11 @@ function createExportBundleTool(outputDir, logger) {
923
929
  const receiptsDir = pathModule.join(bundleDir, "receipts");
924
930
  await fs3.promises.mkdir(receiptsDir, { recursive: true });
925
931
  for (const receipt of receipts) {
932
+ const content = receipt.content;
933
+ const written = typeof content._jws === "string" ? stripRedundantFields(content) : content;
926
934
  await fs3.promises.writeFile(
927
935
  pathModule.join(receiptsDir, receipt.file),
928
- JSON.stringify(receipt.content, null, 2)
936
+ JSON.stringify(written, null, 2)
929
937
  );
930
938
  }
931
939
  logger.info(`Exported ${receipts.length} receipts to ${bundleDir}`);