@wipcomputer/wip-ldm-os 0.4.73-alpha.2 → 0.4.73-alpha.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.
- package/bin/ldm.js +80 -29
- package/dist/bridge/{chunk-LF7EMFBY.js → chunk-24DJYS7Z.js} +95 -48
- package/dist/bridge/cli.js +1 -1
- package/dist/bridge/core.d.ts +1 -0
- package/dist/bridge/core.js +1 -1
- package/dist/bridge/mcp-server.js +40 -7
- package/dist/bridge/openclaw.d.ts +5 -0
- package/dist/bridge/openclaw.js +9 -0
- package/docs/doc-pipeline/README.md +74 -0
- package/docs/doc-pipeline/TECHNICAL.md +79 -0
- package/lib/deploy.mjs +66 -10
- package/lib/detect.mjs +20 -6
- package/package.json +2 -2
- package/shared/docs/how-install-works.md.tmpl +22 -2
- package/shared/docs/how-releases-work.md.tmpl +57 -43
- package/shared/rules/git-conventions.md +3 -3
- package/shared/rules/release-pipeline.md +1 -1
- package/shared/rules/security.md +1 -1
- package/shared/rules/workspace-boundaries.md +1 -1
- package/shared/rules/writing-style.md +1 -1
- package/src/bridge/core.ts +113 -53
- package/src/bridge/mcp-server.ts +77 -8
- package/src/bridge/openclaw.ts +14 -0
- package/src/hooks/inbox-check-hook.mjs +176 -0
- package/src/hosted-mcp/demo/agent.html +300 -0
- package/src/hosted-mcp/demo/agent.txt +84 -0
- package/src/hosted-mcp/demo/fallback.jpg +0 -0
- package/src/hosted-mcp/demo/footer.js +16 -0
- package/src/hosted-mcp/demo/index.html +1291 -0
- package/src/hosted-mcp/demo/privacy.html +230 -0
- package/src/hosted-mcp/demo/sprites.jpg +0 -0
- package/src/hosted-mcp/demo/sprites.png +0 -0
- package/src/hosted-mcp/demo/tos.html +205 -0
- package/src/hosted-mcp/deploy.sh +70 -0
- package/src/hosted-mcp/inbox.mjs +64 -0
- package/src/hosted-mcp/package.json +21 -0
- package/src/hosted-mcp/server.mjs +1625 -0
- package/src/hosted-mcp/tools.mjs +73 -0
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
// tools.mjs: MCP tool definitions. Bridge (messaging) + placeholder memory tools.
|
|
2
|
+
|
|
3
|
+
import { z } from "zod";
|
|
4
|
+
import { pushMessage, getMessages, countPending } from "./inbox.mjs";
|
|
5
|
+
|
|
6
|
+
/** Register all tools on an McpServer instance. */
|
|
7
|
+
export function registerTools(server, getIdentity) {
|
|
8
|
+
|
|
9
|
+
server.registerTool("send_message", {
|
|
10
|
+
description: "Send a message to any agent. Stored in inbox until read. " +
|
|
11
|
+
"Target: 'agent', 'agent:session', 'agent:*' (all sessions), '*' (broadcast).",
|
|
12
|
+
inputSchema: {
|
|
13
|
+
to: z.string().describe("Recipient"),
|
|
14
|
+
body: z.string().describe("Message body"),
|
|
15
|
+
type: z.string().optional().default("chat").describe("chat, system, or task"),
|
|
16
|
+
},
|
|
17
|
+
}, async ({ to, body, type }) => {
|
|
18
|
+
const id = pushMessage({ from: getIdentity().agentId, to, body, type });
|
|
19
|
+
return { content: [{ type: "text", text: `Sent (id: ${id}) to ${to}` }] };
|
|
20
|
+
});
|
|
21
|
+
|
|
22
|
+
server.registerTool("check_inbox", {
|
|
23
|
+
description: "Check for pending messages. Returns unread messages and marks them read.",
|
|
24
|
+
inputSchema: {},
|
|
25
|
+
}, async () => {
|
|
26
|
+
const msgs = getMessages(getIdentity().agentId, true);
|
|
27
|
+
if (!msgs.length) return { content: [{ type: "text", text: "No pending messages." }] };
|
|
28
|
+
const text = msgs.map((m) => `**${m.from}** [${m.type}] (${m.timestamp}):\n${m.body}`).join("\n\n---\n\n");
|
|
29
|
+
return { content: [{ type: "text", text: `${msgs.length} message(s):\n\n${text}` }] };
|
|
30
|
+
});
|
|
31
|
+
|
|
32
|
+
server.registerTool("search_memory", {
|
|
33
|
+
description: "Search semantic memory (Crystal). Placeholder... coming soon.",
|
|
34
|
+
inputSchema: { query: z.string().describe("Search query") },
|
|
35
|
+
}, async ({ query }) => {
|
|
36
|
+
return { content: [{ type: "text", text: `Memory search coming soon. Query: "${query}"` }] };
|
|
37
|
+
});
|
|
38
|
+
|
|
39
|
+
server.registerTool("remember", {
|
|
40
|
+
description: "Store a fact in memory (Crystal). Placeholder... coming soon.",
|
|
41
|
+
inputSchema: {
|
|
42
|
+
text: z.string().describe("What to remember"),
|
|
43
|
+
tags: z.string().optional().describe("Comma-separated tags"),
|
|
44
|
+
},
|
|
45
|
+
}, async ({ text, tags }) => {
|
|
46
|
+
return { content: [{ type: "text", text: `Memory storage coming soon. Would remember: "${text}"${tags ? ` (tags: ${tags})` : ""}` }] };
|
|
47
|
+
});
|
|
48
|
+
|
|
49
|
+
server.registerTool("status", {
|
|
50
|
+
description: "Show connection info and pending message count.",
|
|
51
|
+
inputSchema: {},
|
|
52
|
+
}, async () => {
|
|
53
|
+
const { agentId, apiKey } = getIdentity();
|
|
54
|
+
const masked = apiKey.slice(0, 7) + "..." + apiKey.slice(-4);
|
|
55
|
+
return { content: [{ type: "text", text: `Agent: ${agentId}\nAPI key: ${masked}\nPending: ${countPending(agentId)}\nServer: wip.computer hosted MCP` }] };
|
|
56
|
+
});
|
|
57
|
+
|
|
58
|
+
server.registerTool("list_agents", {
|
|
59
|
+
description: "List all known agents on the Bridge. Shows who you can send messages to.",
|
|
60
|
+
inputSchema: {},
|
|
61
|
+
}, async () => {
|
|
62
|
+
// Read API_KEYS from server to find known agents
|
|
63
|
+
// For now, return hardcoded list plus any OAuth-registered agents
|
|
64
|
+
const known = [
|
|
65
|
+
{ id: "cc-mini", description: "Claude Code on Mac mini (CLI)" },
|
|
66
|
+
{ id: "lesa", description: "Lesa (OpenClaw agent on Mac mini)" },
|
|
67
|
+
{ id: "parker", description: "Parker (human, any device)" },
|
|
68
|
+
];
|
|
69
|
+
const text = known.map(a => `**${a.id}** ... ${a.description}`).join("\n");
|
|
70
|
+
return { content: [{ type: "text", text: `Known agents:\n\n${text}\n\nSend with: send_message(to: "agent-id", body: "your message")` }] };
|
|
71
|
+
});
|
|
72
|
+
|
|
73
|
+
}
|