@powerhousedao/reactor-mcp 4.1.0-dev.4 → 4.1.0-dev.5

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/dist/src/cli.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import { init } from "./index.js";
2
- init().catch((error) => {
2
+ init(process.argv.at(2)).catch((error) => {
3
3
  console.error(error);
4
4
  process.exit(1);
5
5
  });
@@ -1 +1 @@
1
- {"version":3,"file":"cli.js","sourceRoot":"","sources":["../../src/cli.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,YAAY,CAAC;AAElC,IAAI,EAAE,CAAC,KAAK,CAAC,CAAC,KAAc,EAAE,EAAE;IAC9B,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;IACrB,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAClB,CAAC,CAAC,CAAC"}
1
+ {"version":3,"file":"cli.js","sourceRoot":"","sources":["../../src/cli.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,YAAY,CAAC;AAElC,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,KAAc,EAAE,EAAE;IAChD,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;IACrB,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAClB,CAAC,CAAC,CAAC"}
@@ -1,2 +1,2 @@
1
- export declare function init(): Promise<void>;
1
+ export declare function init(remoteDrive?: string): Promise<void>;
2
2
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAIA,wBAAsB,IAAI,kBAOzB"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAuBA,wBAAsB,IAAI,CAAC,WAAW,CAAC,EAAE,MAAM,iBAkC9C"}
package/dist/src/index.js CHANGED
@@ -1,9 +1,48 @@
1
1
  import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
2
- import { initDocumentModelMcp } from "./reactor.js";
2
+ import { driveDocumentModelModule, ReactorBuilder } from "document-drive";
3
+ import { documentModelDocumentModelModule, generateId, } from "document-model";
3
4
  import { createServer } from "./server.js";
4
- export async function init() {
5
- const documentModelMcp = await initDocumentModelMcp();
6
- const server = createServer(documentModelMcp);
5
+ async function createReactor() {
6
+ const builder = new ReactorBuilder([
7
+ documentModelDocumentModelModule,
8
+ driveDocumentModelModule,
9
+ ]);
10
+ // .withStorage(
11
+ // new FilesystemStorage("./.ph/mcp/storage"),
12
+ // );
13
+ const reactor = builder.build();
14
+ await reactor.initialize();
15
+ return reactor;
16
+ }
17
+ export async function init(remoteDrive) {
18
+ const reactor = await createReactor();
19
+ const server = await createServer(reactor);
20
+ if (remoteDrive) {
21
+ await reactor.addRemoteDrive(remoteDrive, {
22
+ sharingType: "PUBLIC",
23
+ availableOffline: true,
24
+ listeners: [
25
+ {
26
+ block: true,
27
+ callInfo: {
28
+ data: remoteDrive,
29
+ name: "switchboard-push",
30
+ transmitterType: "SwitchboardPush",
31
+ },
32
+ filter: {
33
+ branch: ["main"],
34
+ documentId: ["*"],
35
+ documentType: ["*"],
36
+ scope: ["global"],
37
+ },
38
+ label: "Switchboard Sync",
39
+ listenerId: generateId(),
40
+ system: true,
41
+ },
42
+ ],
43
+ triggers: [],
44
+ });
45
+ }
7
46
  // Start receiving messages on stdin and sending messages on stdout
8
47
  const transport = new StdioServerTransport();
9
48
  await server.connect(transport);
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,2CAA2C,CAAC;AACjF,OAAO,EAAE,oBAAoB,EAAE,MAAM,cAAc,CAAC;AACpD,O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