@awebai/claude-channel 1.3.1 → 1.3.3

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.
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "aweb-channel",
3
3
  "description": "aweb agent coordination channel — receive mail, chat, tasks, and control signals from your agent team in real time.",
4
- "version": "1.3.1",
4
+ "version": "1.3.3",
5
5
  "author": {
6
6
  "name": "awebai"
7
7
  },
package/dist/index.js CHANGED
@@ -25163,6 +25163,7 @@ async function resolveConfig(workdir) {
25163
25163
  const did = computeDIDKey(getPublicKey(signingKey));
25164
25164
  const stableID = (identity?.stable_id || "").trim() || (certificate.member_did_aw || "").trim();
25165
25165
  const address = (certificate.member_address || "").trim() || (identity?.address || "").trim();
25166
+ const registryURL = (identity?.registry_url || "").trim();
25166
25167
  if ((identity?.did || "").trim() && did !== identity?.did?.trim()) {
25167
25168
  throw new Error("identity.yaml did does not match .aw/signing.key");
25168
25169
  }
@@ -25182,6 +25183,7 @@ async function resolveConfig(workdir) {
25182
25183
  address,
25183
25184
  alias,
25184
25185
  teamID,
25186
+ registryURL,
25185
25187
  signingKey,
25186
25188
  teamCertificateHeader: encodeTeamCertificateHeader(certificate)
25187
25189
  };
@@ -26312,19 +26314,21 @@ function escapeJSON2(s) {
26312
26314
  etc.sha512Sync = (...m) => sha512(etc.concatBytes(...m));
26313
26315
  var ANNOUNCEMENT_MAX_AGE_MS = 7 * 24 * 60 * 60 * 1e3;
26314
26316
  var SenderTrustManager = class {
26315
- constructor(client, registry2, teamID, selfDid) {
26317
+ constructor(client, registry2, teamID, selfDid, selfStableID = "") {
26316
26318
  this.client = client;
26317
26319
  this.registry = registry2;
26318
26320
  this.teamID = teamID;
26319
26321
  this.selfDid = selfDid;
26322
+ this.selfStableID = selfStableID;
26320
26323
  }
26321
26324
  client;
26322
26325
  registry;
26323
26326
  teamID;
26324
26327
  selfDid;
26328
+ selfStableID;
26325
26329
  metaCache = /* @__PURE__ */ new Map();
26326
- async normalizeTrust(store, verificationStatus, rawAddress, fromDID, fromStableID, toDID, rotationAnnouncement, replacementAnnouncement, verificationAddress) {
26327
- let status = this.checkRecipientBinding(verificationStatus, toDID);
26330
+ async normalizeTrust(store, verificationStatus, rawAddress, fromDID, fromStableID, toDID, toStableID, rotationAnnouncement, replacementAnnouncement, verificationAddress) {
26331
+ let status = this.checkRecipientBinding(verificationStatus, toDID, toStableID);
26328
26332
  if (!status || !rawAddress.trim()) {
26329
26333
  return { status, stored: false };
26330
26334
  }
@@ -26350,11 +26354,21 @@ var SenderTrustManager = class {
26350
26354
  registryCheck.confirmedCurrentKey
26351
26355
  );
26352
26356
  }
26353
- checkRecipientBinding(status, toDID) {
26354
- if (status !== "verified" || !toDID || !this.selfDid) {
26357
+ checkRecipientBinding(status, toDID, toStableID) {
26358
+ if (status !== "verified") {
26355
26359
  return status;
26356
26360
  }
26357
- return toDID === this.selfDid ? status : "identity_mismatch";
26361
+ const selfStableID = this.selfStableID.trim();
26362
+ const recipientStableID = (toStableID || "").trim();
26363
+ if (selfStableID && recipientStableID) {
26364
+ return recipientStableID.toLowerCase() === selfStableID.toLowerCase() ? status : "identity_mismatch";
26365
+ }
26366
+ const selfDID = this.selfDid.trim();
26367
+ const recipientDID = (toDID || "").trim();
26368
+ if (!recipientDID || !selfDID) {
26369
+ return status;
26370
+ }
26371
+ return recipientDID === selfDID ? status : "identity_mismatch";
26358
26372
  }
26359
26373
  async checkStableIdentityRegistry(status, trustAddress, fromDID, fromStableID) {
26360
26374
  if (status !== "verified" || !fromDID || !fromStableID?.startsWith("did:aw:")) {
@@ -26681,13 +26695,14 @@ async function main() {
26681
26695
  });
26682
26696
  const pinStore = await loadPinStore();
26683
26697
  const registry2 = new RegistryResolver(fetch, void 0, void 0, {
26684
- fallbackRegistryURL: embeddedRegistryFallbackURL(config2.baseURL)
26698
+ fallbackRegistryURL: resolveRegistryFallbackURL(config2.baseURL, config2.registryURL)
26685
26699
  });
26686
26700
  const trust = new SenderTrustManager(
26687
26701
  client,
26688
26702
  registry2,
26689
26703
  config2.teamID,
26690
- config2.did
26704
+ config2.did,
26705
+ config2.stableID
26691
26706
  );
26692
26707
  const mcp = new Server(
26693
26708
  { name: "aweb", version: "0.1.0" },
@@ -26724,8 +26739,13 @@ Control events (type="control") are operational signals. On "pause", stop curren
26724
26739
  abort.signal
26725
26740
  );
26726
26741
  }
26727
- function embeddedRegistryFallbackURL(baseURL) {
26728
- return (process.env.AWID_REGISTRY_URL || "").trim().toLowerCase() === "local" ? baseURL : void 0;
26742
+ function resolveRegistryFallbackURL(baseURL, identityRegistryURL = "") {
26743
+ const envRegistryURL = (process.env.AWID_REGISTRY_URL || "").trim();
26744
+ if (envRegistryURL) {
26745
+ return envRegistryURL.toLowerCase() === "local" ? baseURL : envRegistryURL;
26746
+ }
26747
+ const configuredRegistryURL = identityRegistryURL.trim();
26748
+ return configuredRegistryURL || void 0;
26729
26749
  }
26730
26750
  async function startEventLoop(mcp, client, pinStore, trust, self, signal) {
26731
26751
  const dispatched = /* @__PURE__ */ new Set();
@@ -26755,6 +26775,7 @@ async function dispatchEvent(mcp, client, pinStore, trust, self, dispatched, eve
26755
26775
  msg.from_did,
26756
26776
  msg.from_stable_id,
26757
26777
  msg.to_did,
26778
+ msg.to_stable_id,
26758
26779
  msg.rotation_announcement,
26759
26780
  msg.replacement_announcement,
26760
26781
  msg.from_address || msg.from_alias || ""
@@ -26797,6 +26818,7 @@ async function dispatchEvent(mcp, client, pinStore, trust, self, dispatched, eve
26797
26818
  msg.from_did,
26798
26819
  msg.from_stable_id,
26799
26820
  msg.to_did,
26821
+ msg.to_stable_id,
26800
26822
  msg.rotation_announcement,
26801
26823
  msg.replacement_announcement,
26802
26824
  msg.from_address || msg.from_agent || ""
@@ -26932,7 +26954,8 @@ if (isDirectExecution(import.meta.url)) {
26932
26954
  }
26933
26955
  export {
26934
26956
  dispatchEvent,
26935
- isDirectExecution
26957
+ isDirectExecution,
26958
+ resolveRegistryFallbackURL
26936
26959
  };
26937
26960
  /*! Bundled license information:
26938
26961
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@awebai/claude-channel",
3
- "version": "1.3.1",
3
+ "version": "1.3.3",
4
4
  "type": "module",
5
5
  "main": "./dist/index.js",
6
6
  "bin": "./dist/index.js",