@wipcomputer/wip-ldm-os 0.4.73-alpha.19 → 0.4.73-alpha.20

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.
@@ -191,15 +191,29 @@ ${result.content}` }] };
191
191
  server.registerTool(
192
192
  "lesa_send_message",
193
193
  {
194
- description: "Send a message to the OpenClaw agent through the gateway. Routes through the agent's full pipeline: memory, tools, personality, workspace. Use this for direct communication: asking questions, sharing findings, coordinating work, or having a discussion. Messages are prefixed with [Claude Code] so the agent knows the source.",
194
+ description: "Send a message to the OpenClaw agent through the gateway. Routes through the agent's full pipeline: memory, tools, personality, workspace. Use this for direct communication: asking questions, sharing findings, coordinating work, or having a discussion. Messages are prefixed with [Claude Code] so the agent knows the source.\n\nThis is async: returns immediately after sending. The agent's reply will arrive in your inbox (check via lesa_check_inbox or it appears automatically on your next turn).",
195
195
  inputSchema: {
196
196
  message: z.string().describe("Message to send to the OpenClaw agent")
197
197
  }
198
198
  },
199
199
  async ({ message }) => {
200
200
  try {
201
- const reply = await sendMessage(config.openclawDir, message);
202
- return { content: [{ type: "text", text: reply }] };
201
+ await sendMessage(config.openclawDir, message, { fireAndForget: true });
202
+ const { agentId, sessionName } = getSessionIdentity();
203
+ sendLdmMessage({
204
+ from: `${agentId}:${sessionName}`,
205
+ to: "lesa",
206
+ body: message,
207
+ type: "chat"
208
+ });
209
+ return {
210
+ content: [{
211
+ type: "text",
212
+ text: `Sent to L\u0113sa: "${message}"
213
+
214
+ Message delivered to the gateway (fire-and-forget). L\u0113sa will process it through her full pipeline. Her reply will arrive in your inbox. Use lesa_check_inbox to check, or it will appear automatically on your next turn.`
215
+ }]
216
+ };
203
217
  } catch (err) {
204
218
  return { content: [{ type: "text", text: `Error sending message: ${err.message}` }], isError: true };
205
219
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wipcomputer/wip-ldm-os",
3
- "version": "0.4.73-alpha.19",
3
+ "version": "0.4.73-alpha.20",
4
4
  "type": "module",
5
5
  "description": "LDM OS: identity, memory, and sovereignty infrastructure for AI agents",
6
6
  "engines": {
@@ -242,7 +242,18 @@ server.registerTool(
242
242
  }
243
243
  );
244
244
 
245
- // Tool 4: Send a message to the OpenClaw agent
245
+ // Tool 4: Send a message to the OpenClaw agent (async, non-blocking)
246
+ //
247
+ // Sends via fire-and-forget to the gateway so CC is not blocked waiting for
248
+ // the reply. The message hits Lēsa's full pipeline (visible in Parker's TUI).
249
+ // Lēsa's reply arrives in the file inbox (~/.ldm/messages/) which CC picks up
250
+ // via the UserPromptSubmit hook or check_inbox tool.
251
+ //
252
+ // Also writes the outbound message to the file inbox as a "sent" record so
253
+ // there's a complete file trail of both sides of the conversation.
254
+ //
255
+ // Changed 2026-04-06: was synchronous (blocked up to 120s). Now async.
256
+ // See ai/product/bugs/bridge/2026-04-06--cc-mini--bridge-async-inbox-plan.md
246
257
  server.registerTool(
247
258
  "lesa_send_message",
248
259
  {
@@ -250,15 +261,35 @@ server.registerTool(
250
261
  "Send a message to the OpenClaw agent through the gateway. Routes through the agent's " +
251
262
  "full pipeline: memory, tools, personality, workspace. Use this for direct communication: " +
252
263
  "asking questions, sharing findings, coordinating work, or having a discussion. " +
253
- "Messages are prefixed with [Claude Code] so the agent knows the source.",
264
+ "Messages are prefixed with [Claude Code] so the agent knows the source.\n\n" +
265
+ "This is async: returns immediately after sending. The agent's reply will arrive in " +
266
+ "your inbox (check via lesa_check_inbox or it appears automatically on your next turn).",
254
267
  inputSchema: {
255
268
  message: z.string().describe("Message to send to the OpenClaw agent"),
256
269
  },
257
270
  },
258
271
  async ({ message }) => {
259
272
  try {
260
- const reply = await sendMessage(config.openclawDir, message);
261
- return { content: [{ type: "text" as const, text: reply }] };
273
+ // 1. Fire-and-forget to gateway (Lēsa sees it in TUI, Parker sees it)
274
+ await sendMessage(config.openclawDir, message, { fireAndForget: true });
275
+
276
+ // 2. Write outbound record to file inbox so the conversation trail is complete
277
+ const { agentId, sessionName } = getSessionIdentity();
278
+ sendLdmMessage({
279
+ from: `${agentId}:${sessionName}`,
280
+ to: "lesa",
281
+ body: message,
282
+ type: "chat",
283
+ });
284
+
285
+ return {
286
+ content: [{
287
+ type: "text" as const,
288
+ text: `Sent to Lēsa: "${message}"\n\nMessage delivered to the gateway (fire-and-forget). ` +
289
+ `Lēsa will process it through her full pipeline. Her reply will arrive in your inbox. ` +
290
+ `Use lesa_check_inbox to check, or it will appear automatically on your next turn.`,
291
+ }],
292
+ };
262
293
  } catch (err: any) {
263
294
  return { content: [{ type: "text" as const, text: `Error sending message: ${err.message}` }], isError: true };
264
295
  }