@awebai/claude-channel 1.2.0 → 1.3.1

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.2.0",
4
+ "version": "1.3.1",
5
5
  "author": {
6
6
  "name": "awebai"
7
7
  },
package/.mcp.json CHANGED
@@ -1,6 +1,8 @@
1
1
  {
2
- "aweb": {
3
- "command": "node",
4
- "args": ["${CLAUDE_PLUGIN_ROOT}/dist/index.js"]
2
+ "mcpServers": {
3
+ "aweb": {
4
+ "command": "node",
5
+ "args": ["${CLAUDE_PLUGIN_ROOT}/dist/index.js"]
6
+ }
5
7
  }
6
8
  }
package/dist/index.js CHANGED
@@ -25130,6 +25130,7 @@ async function loadSigningKey(path) {
25130
25130
  etc.sha512Sync = (...m) => sha512(etc.concatBytes(...m));
25131
25131
  async function resolveConfig(workdir) {
25132
25132
  const workspacePath = join(workdir, ".aw", "workspace.yaml");
25133
+ const teamsPath = join(workdir, ".aw", "teams.yaml");
25133
25134
  const identityPath = join(workdir, ".aw", "identity.yaml");
25134
25135
  const signingKeyPath = join(workdir, ".aw", "signing.key");
25135
25136
  const workspace = await readYAML(workspacePath);
@@ -25143,19 +25144,25 @@ async function resolveConfig(workdir) {
25143
25144
  "This workspace is on the legacy single-team shape (.aw/workspace.yaml has team_address but no memberships). Run aw workspace migrate-multi-team to convert, then retry."
25144
25145
  );
25145
25146
  }
25146
- const activeTeam = (workspace.active_team || "").trim();
25147
- const membership = (workspace.memberships || []).find((item) => (item.team_id || "").trim() === activeTeam);
25147
+ const teamState = await readYAML(teamsPath);
25148
+ if (!teamState) {
25149
+ throw new Error("worktree team state is missing .aw/teams.yaml; run `aw init` or `aw id team add` first");
25150
+ }
25151
+ const activeTeam = (teamState.active_team || "").trim();
25152
+ const teamMembership = (teamState.memberships || []).find((item) => (item.team_id || "").trim() === activeTeam);
25153
+ const workspaceMembership = (workspace.memberships || []).find((item) => (item.team_id || "").trim() === activeTeam);
25148
25154
  const teamID = activeTeam;
25149
- const alias = (membership?.alias || "").trim();
25150
- if (!baseURL || !teamID || !membership || !alias) {
25155
+ const alias = (teamMembership?.alias || "").trim();
25156
+ const certPath = (teamMembership?.cert_path || "").trim();
25157
+ if (!baseURL || !teamID || !teamMembership || !workspaceMembership || !alias || !certPath) {
25151
25158
  throw new Error("worktree workspace binding is missing aweb_url, active_team, or the active membership alias");
25152
25159
  }
25153
25160
  const signingKey = await loadSigningKey(signingKeyPath);
25154
- const certificate = await loadActiveTeamCertificate(workdir, teamID);
25161
+ const certificate = await loadConfiguredTeamCertificate(workdir, teamID, certPath);
25155
25162
  const identity = await readYAML(identityPath);
25156
25163
  const did = computeDIDKey(getPublicKey(signingKey));
25157
25164
  const stableID = (identity?.stable_id || "").trim() || (certificate.member_did_aw || "").trim();
25158
- const address = (identity?.address || "").trim() || (certificate.member_address || "").trim();
25165
+ const address = (certificate.member_address || "").trim() || (identity?.address || "").trim();
25159
25166
  if ((identity?.did || "").trim() && did !== identity?.did?.trim()) {
25160
25167
  throw new Error("identity.yaml did does not match .aw/signing.key");
25161
25168
  }
@@ -25163,10 +25170,10 @@ async function resolveConfig(workdir) {
25163
25170
  throw new Error("team certificate member_did_key does not match .aw/signing.key");
25164
25171
  }
25165
25172
  if ((certificate.team_id || "").trim() !== teamID) {
25166
- throw new Error(`workspace.yaml active_team does not match certificate for ${teamID}`);
25173
+ throw new Error(`team certificate does not match active team ${teamID}`);
25167
25174
  }
25168
25175
  if ((certificate.alias || "").trim() !== alias) {
25169
- throw new Error("workspace.yaml active membership alias does not match the team certificate");
25176
+ throw new Error("active membership alias does not match the team certificate");
25170
25177
  }
25171
25178
  return {
25172
25179
  baseURL,
@@ -25179,6 +25186,16 @@ async function resolveConfig(workdir) {
25179
25186
  teamCertificateHeader: encodeTeamCertificateHeader(certificate)
25180
25187
  };
25181
25188
  }
25189
+ async function loadConfiguredTeamCertificate(workdir, activeTeam, certPath) {
25190
+ try {
25191
+ return await loadTeamCertificate(join(workdir, ".aw", certPath));
25192
+ } catch (error2) {
25193
+ if (error2.code !== "ENOENT") {
25194
+ throw error2;
25195
+ }
25196
+ return loadActiveTeamCertificate(workdir, activeTeam);
25197
+ }
25198
+ }
25182
25199
  async function loadActiveTeamCertificate(workdir, activeTeam) {
25183
25200
  const certsDir = join(workdir, ".aw", "team-certs");
25184
25201
  let files;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@awebai/claude-channel",
3
- "version": "1.2.0",
3
+ "version": "1.3.1",
4
4
  "type": "module",
5
5
  "main": "./dist/index.js",
6
6
  "bin": "./dist/index.js",