message-cp 0.0.0-stage → 0.1.0
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/LICENSE +21 -0
- package/README.md +45 -2
- package/dist/accounts.js +279 -0
- package/dist/agents.js +507 -0
- package/dist/approve.js +260 -0
- package/dist/channels.js +262 -0
- package/dist/cli.js +523 -0
- package/dist/client-metadata.js +167 -0
- package/dist/connect.js +85 -0
- package/dist/dashboard.js +4961 -0
- package/dist/db.js +605 -0
- package/dist/http.js +1933 -0
- package/dist/index.js +21 -0
- package/dist/init.js +960 -0
- package/dist/login.js +530 -0
- package/dist/messages.js +513 -0
- package/dist/oauth.js +384 -0
- package/dist/server.js +420 -0
- package/dist/sessions.js +53 -0
- package/dist/settings.js +13 -0
- package/dist/wait.js +137 -0
- package/dist/webhooks.js +464 -0
- package/package.json +44 -4
package/dist/index.js
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
|
|
3
|
+
import { ToolError, registerFromEnv } from "./agents.js";
|
|
4
|
+
import { OWNER_ACCOUNT, openDb } from "./db.js";
|
|
5
|
+
import { Session, createServer } from "./server.js";
|
|
6
|
+
const db = openDb();
|
|
7
|
+
// stdio is the owner's account.
|
|
8
|
+
const session = new Session(OWNER_ACCOUNT);
|
|
9
|
+
try {
|
|
10
|
+
const registered = registerFromEnv(db, OWNER_ACCOUNT);
|
|
11
|
+
if (registered)
|
|
12
|
+
session.bind(registered.identity);
|
|
13
|
+
}
|
|
14
|
+
catch (err) {
|
|
15
|
+
if (!(err instanceof ToolError))
|
|
16
|
+
throw err;
|
|
17
|
+
console.error(`message-cp: ${err.message}`);
|
|
18
|
+
process.exit(1);
|
|
19
|
+
}
|
|
20
|
+
const server = createServer(db, session);
|
|
21
|
+
await server.connect(new StdioServerTransport());
|