claude-code-swarm 0.3.19 → 0.3.21

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,6 +1,6 @@
1
1
  {
2
2
  "name": "claude-code-swarm",
3
- "version": "0.3.19",
3
+ "version": "0.3.21",
4
4
  "description": "Launch Claude Code with swarmkit capabilities, including team orchestration, MAP observability, and session tracking.",
5
5
  "owner": {
6
6
  "name": "alexngai"
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "claude-code-swarm",
3
3
  "description": "Spin up Claude Code agent teams from openteams YAML topologies with optional MAP (Multi-Agent Protocol) observability and coordination. Provides hooks for session lifecycle, agent spawn/complete tracking, and a /swarm skill to launch team configurations.",
4
- "version": "0.3.19",
4
+ "version": "0.3.21",
5
5
  "author": {
6
6
  "name": "alexngai"
7
7
  },
package/CLAUDE.md CHANGED
@@ -398,6 +398,15 @@ Both modes:
398
398
  - Report trajectory checkpoints via `trajectory/checkpoint` (with broadcast fallback)
399
399
  - Self-terminate after 30 minutes of inactivity (session mode)
400
400
 
401
+ **MAP capabilities declared** (in `src/map-connection.mjs`):
402
+ - `messaging: { canSend: true, canReceive: true }` — can exchange MAP scope messages
403
+ - `mail: { canCreate: true, canJoin: true, canViewHistory: true }` — supports agent-inbox conversations (enables Mail chat mode in OpenHive session view)
404
+ - `trajectory: { canReport: true, canServeContent: true }` — reports checkpoints, serves transcript content on demand
405
+ - `tasks: { canCreate, canAssign, canUpdate, canList }` — task management
406
+ - `opentasks: { canQuery, canLink, canAnnotate, canTask }` — conditional, when task_graph configured
407
+
408
+ Message delivery is **pull-based**: the `UserPromptSubmit` hook reads the inbox on each turn and injects messages into Claude Code's prompt context. No real-time push delivery.
409
+
401
410
  The hook helper (`scripts/map-hook.mjs`) includes best-effort auto-recovery: if the sidecar is down, it attempts to restart it, with a fire-and-forget fallback (mesh or direct WebSocket) if recovery fails.
402
411
 
403
412
  ### OpenTasks integration
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "claude-code-swarm",
3
- "version": "0.3.19",
3
+ "version": "0.3.21",
4
4
  "description": "Claude Code plugin for launching agent teams from openteams topologies with MAP observability",
5
5
  "type": "module",
6
6
  "exports": {
@@ -191,12 +191,15 @@ process.on("unhandledRejection", (reason) => {
191
191
  function attachReconnectionListener(conn) {
192
192
  if (!conn?.onReconnection) return;
193
193
 
194
- conn.onReconnection((event) => {
194
+ conn.onReconnection(async (event) => {
195
195
  if (event.type === "reconnectFailed") {
196
196
  log.warn("SDK reconnection exhausted, starting slow retry loop", { error: event.error?.message, intervalMs: RECONNECT_INTERVAL_MS });
197
197
  startSlowReconnectLoop();
198
198
  } else if (event.type === "reconnected") {
199
- log.info("SDK reconnected to MAP server");
199
+ log.info("SDK reconnected to MAP server, re-registering agents");
200
+ // The server lost session state on restart — re-register all agents
201
+ // so the hub's connection registry knows about them again.
202
+ await reRegisterAgents(conn);
200
203
  } else if (event.type === "disconnected") {
201
204
  log.warn("disconnected from MAP server, SDK will attempt reconnection");
202
205
  }
@@ -221,6 +224,7 @@ function startSlowReconnectLoop() {
221
224
  systemId: SYSTEM_ID,
222
225
  credential: AUTH_CREDENTIAL || undefined,
223
226
  projectContext: PROJECT_CONTEXT,
227
+ inboxEnabled: !!INBOX_CONFIG || MESH_ENABLED,
224
228
  onMessage: () => resetInactivityTimer(),
225
229
  });
226
230
 
@@ -406,6 +410,7 @@ async function startWebSocketTransport() {
406
410
  systemId: SYSTEM_ID,
407
411
  credential: AUTH_CREDENTIAL || undefined,
408
412
  projectContext: PROJECT_CONTEXT,
413
+ inboxEnabled: !!INBOX_CONFIG || MESH_ENABLED,
409
414
  onMessage: () => {
410
415
  resetInactivityTimer();
411
416
  },
@@ -24,7 +24,7 @@ const log = createLogger("map");
24
24
  * authRequired challenge with the server's preferred method + this credential.
25
25
  * When absent, uses the standard SDK connect() for open mode servers.
26
26
  */
27
- export async function connectToMAP({ server, scope, systemId, onMessage, credential, projectContext }) {
27
+ export async function connectToMAP({ server, scope, systemId, onMessage, credential, projectContext, inboxEnabled }) {
28
28
  try {
29
29
  const mapSdk = await resolvePackage("@multi-agent-protocol/sdk");
30
30
  if (!mapSdk) throw new Error("@multi-agent-protocol/sdk not available");
@@ -38,6 +38,12 @@ export async function connectToMAP({ server, scope, systemId, onMessage, credent
38
38
  role: "sidecar",
39
39
  scopes: [scope],
40
40
  capabilities: {
41
+ // Messaging and mail capabilities are conditional on agent-inbox being available.
42
+ // Without inbox, the sidecar can't receive messages or participate in conversations.
43
+ ...(inboxEnabled ? {
44
+ messaging: { canSend: true, canReceive: true },
45
+ mail: { canCreate: true, canJoin: true, canViewHistory: true },
46
+ } : {}),
41
47
  trajectory: { canReport: true, canServeContent: true },
42
48
  tasks: { canCreate: true, canAssign: true, canUpdate: true, canList: true },
43
49
  ...(projectContext?.task_graph ? {