@powerhousedao/ph-cli 0.40.73-dev.0 → 0.40.74-dev.1
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/package.json +4 -2
- package/dist/src/commands/index.d.ts.map +1 -1
- package/dist/src/commands/index.js +3 -1
- package/dist/src/commands/index.js.map +1 -1
- package/dist/src/commands/list.d.ts.map +1 -1
- package/dist/src/commands/list.js +2 -1
- package/dist/src/commands/list.js.map +1 -1
- package/dist/src/commands/reactor.d.ts +9 -0
- package/dist/src/commands/reactor.d.ts.map +1 -0
- package/dist/src/commands/reactor.js +39 -0
- package/dist/src/commands/reactor.js.map +1 -0
- package/dist/src/commands/switchboard.d.ts +5 -5
- package/dist/src/commands/switchboard.d.ts.map +1 -1
- package/dist/src/commands/switchboard.js +13 -12
- package/dist/src/commands/switchboard.js.map +1 -1
- package/dist/src/help.d.ts +5 -1
- package/dist/src/help.d.ts.map +1 -1
- package/dist/src/help.js +46 -13
- package/dist/src/help.js.map +1 -1
- package/dist/src/services/dev.d.ts.map +1 -1
- package/dist/src/services/dev.js +2 -2
- package/dist/src/services/dev.js.map +1 -1
- package/dist/src/services/reactor.d.ts +32 -0
- package/dist/src/services/reactor.d.ts.map +1 -0
- package/dist/src/services/reactor.js +66 -0
- package/dist/src/services/reactor.js.map +1 -0
- package/dist/src/services/switchboard.d.ts +2 -31
- package/dist/src/services/switchboard.d.ts.map +1 -1
- package/dist/src/services/switchboard.js +23 -57
- package/dist/src/services/switchboard.js.map +1 -1
- package/dist/src/version.d.ts +1 -1
- package/dist/src/version.js +1 -1
- package/dist/tsconfig.lib.tsbuildinfo +1 -1
- package/package.json +11 -9
package/dist/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@powerhousedao/ph-cli",
|
|
3
|
-
"version": "0.40.
|
|
3
|
+
"version": "0.40.74-dev.1",
|
|
4
4
|
"description": "",
|
|
5
5
|
"license": "AGPL-3.0-only",
|
|
6
6
|
"type": "module",
|
|
@@ -30,9 +30,10 @@
|
|
|
30
30
|
"keywords": [],
|
|
31
31
|
"author": "",
|
|
32
32
|
"devDependencies": {
|
|
33
|
+
"@types/node": "^22.14.1",
|
|
33
34
|
"concurrently": "^9.1.2",
|
|
34
35
|
"nodemon": "^3.1.9",
|
|
35
|
-
"vitest": "^3.
|
|
36
|
+
"vitest": "^3.1.2"
|
|
36
37
|
},
|
|
37
38
|
"dependencies": {
|
|
38
39
|
"@powerhousedao/builder-tools": "workspace:*",
|
|
@@ -40,6 +41,7 @@
|
|
|
40
41
|
"@powerhousedao/config": "workspace:*",
|
|
41
42
|
"@powerhousedao/connect": "workspace:*",
|
|
42
43
|
"@powerhousedao/reactor-local": "workspace:*",
|
|
44
|
+
"@powerhousedao/switchboard": "workspace:*",
|
|
43
45
|
"colorette": "^2.0.20",
|
|
44
46
|
"commander": "^12.1.0",
|
|
45
47
|
"document-drive": "workspace:*",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/commands/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,OAAO,EAAE,MAAM,WAAW,CAAC;AACzC,OAAO,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/commands/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,OAAO,EAAE,MAAM,WAAW,CAAC;AACzC,OAAO,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAY9C,eAAO,MAAM,QAAQ,2BAYpB,CAAC;AAEF,MAAM,CAAC,OAAO,UAAU,gBAAgB,CAAC,OAAO,EAAE,OAAO,QAExD"}
|
|
@@ -5,8 +5,9 @@ import { helpCommand } from "./help.js";
|
|
|
5
5
|
import { inspectCommand } from "./inspect.js";
|
|
6
6
|
import { installCommand } from "./install.js";
|
|
7
7
|
import { listCommand } from "./list.js";
|
|
8
|
+
import { reactorCommand } from "./reactor.js";
|
|
8
9
|
import { serviceCommand } from "./service.js";
|
|
9
|
-
import {
|
|
10
|
+
import { switchboardCommand } from "./switchboard.js";
|
|
10
11
|
import { uninstallCommand } from "./uninstall.js";
|
|
11
12
|
export const commands = [
|
|
12
13
|
// devCommand,
|
|
@@ -19,6 +20,7 @@ export const commands = [
|
|
|
19
20
|
serviceCommand,
|
|
20
21
|
listCommand,
|
|
21
22
|
inspectCommand,
|
|
23
|
+
switchboardCommand,
|
|
22
24
|
];
|
|
23
25
|
export default function registerCommands(program) {
|
|
24
26
|
commands.forEach((command) => command(program));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/commands/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAC9C,yCAAyC;AACzC,OAAO,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAChD,OAAO,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AACxC,OAAO,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAC9C,OAAO,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAC9C,OAAO,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AACxC,OAAO,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAC9C,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/commands/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAC9C,yCAAyC;AACzC,OAAO,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAChD,OAAO,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AACxC,OAAO,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAC9C,OAAO,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAC9C,OAAO,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AACxC,OAAO,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAC9C,OAAO,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAC9C,OAAO,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AACtD,OAAO,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAElD,MAAM,CAAC,MAAM,QAAQ,GAAG;IACtB,cAAc;IACd,cAAc;IACd,eAAe;IACf,cAAc;IACd,WAAW;IACX,cAAc;IACd,gBAAgB;IAChB,cAAc;IACd,WAAW;IACX,cAAc;IACd,kBAAkB;CACnB,CAAC;AAEF,MAAM,CAAC,OAAO,UAAU,gBAAgB,CAAC,OAAgB;IACvD,QAAQ,CAAC,OAAO,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,CAAC;AAClD,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"list.d.ts","sourceRoot":"","sources":["../../../src/commands/list.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,OAAO,EAAE,MAAM,WAAW,CAAC;AAEzC,OAAO,EAAE,KAAK,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAGrD,eAAO,MAAM,IAAI,EAAE,iBAAiB,CAClC;IACE;QACE,KAAK,CAAC,EAAE,OAAO,CAAC;KACjB;CACF,
|
|
1
|
+
{"version":3,"file":"list.d.ts","sourceRoot":"","sources":["../../../src/commands/list.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,OAAO,EAAE,MAAM,WAAW,CAAC;AAEzC,OAAO,EAAE,KAAK,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAGrD,eAAO,MAAM,IAAI,EAAE,iBAAiB,CAClC;IACE;QACE,KAAK,CAAC,EAAE,OAAO,CAAC;KACjB;CACF,CA2BF,CAAC;AAEF,wBAAgB,WAAW,CAAC,OAAO,EAAE,OAAO,QAS3C"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
+
import { getConfig } from "@powerhousedao/config/utils";
|
|
1
2
|
import { listHelp } from "../help.js";
|
|
2
|
-
import {
|
|
3
|
+
import { getProjectInfo, setCustomHelp } from "../utils.js";
|
|
3
4
|
export const list = async (options) => {
|
|
4
5
|
if (options.debug) {
|
|
5
6
|
console.log(">>> command arguments", { options });
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"list.js","sourceRoot":"","sources":["../../../src/commands/list.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"list.js","sourceRoot":"","sources":["../../../src/commands/list.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,6BAA6B,CAAC;AAExD,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAEtC,OAAO,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAE5D,MAAM,CAAC,MAAM,IAAI,GAMb,KAAK,EAAE,OAAO,EAAE,EAAE;IACpB,IAAI,OAAO,CAAC,KAAK,EAAE,CAAC;QAClB,OAAO,CAAC,GAAG,CAAC,uBAAuB,EAAE,EAAE,OAAO,EAAE,CAAC,CAAC;IACpD,CAAC;IAED,MAAM,WAAW,GAAG,cAAc,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;IAElD,IAAI,OAAO,CAAC,KAAK,EAAE,CAAC;QAClB,OAAO,CAAC,GAAG,CAAC,mBAAmB,EAAE,WAAW,CAAC,CAAC;IAChD,CAAC;IAED,IAAI,CAAC;QACH,MAAM,QAAQ,GAAG,SAAS,CAAC,WAAW,CAAC,IAAI,GAAG,yBAAyB,CAAC,CAAC;QAEzE,IAAI,CAAC,QAAQ,CAAC,QAAQ,IAAI,QAAQ,CAAC,QAAQ,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;YACzD,OAAO,CAAC,GAAG,CAAC,kCAAkC,CAAC,CAAC;YAChD,OAAO;QACT,CAAC;QAED,OAAO,CAAC,GAAG,CAAC,uBAAuB,CAAC,CAAC;QACrC,QAAQ,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC,GAAG,EAAE,EAAE;YAChC,OAAO,CAAC,GAAG,CAAC,GAAG,CAAC,WAAW,CAAC,CAAC;QAC/B,CAAC,CAAC,CAAC;IACL,CAAC;IAAC,OAAO,CAAC,EAAE,CAAC;QACX,OAAO,CAAC,GAAG,CAAC,kCAAkC,CAAC,CAAC;IAClD,CAAC;AACH,CAAC,CAAC;AAEF,MAAM,UAAU,WAAW,CAAC,OAAgB;IAC1C,MAAM,OAAO,GAAG,OAAO;SACpB,OAAO,CAAC,MAAM,CAAC;SACf,KAAK,CAAC,GAAG,CAAC;SACV,WAAW,CAAC,yBAAyB,CAAC;SACtC,MAAM,CAAC,SAAS,EAAE,sBAAsB,CAAC;SACzC,MAAM,CAAC,IAAI,CAAC,CAAC;IAEhB,aAAa,CAAC,OAAO,EAAE,QAAQ,CAAC,CAAC;AACnC,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { type LocalReactor } from "@powerhousedao/reactor-local";
|
|
2
|
+
import { type Command } from "commander";
|
|
3
|
+
import { type ReactorOptions } from "../services/reactor.js";
|
|
4
|
+
import { type CommandActionType } from "../types.js";
|
|
5
|
+
export declare const switchboard: CommandActionType<[
|
|
6
|
+
ReactorOptions
|
|
7
|
+
], Promise<LocalReactor>>;
|
|
8
|
+
export declare function reactorCommand(program: Command): void;
|
|
9
|
+
//# sourceMappingURL=reactor.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"reactor.d.ts","sourceRoot":"","sources":["../../../src/commands/reactor.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,8BAA8B,CAAC;AACjE,OAAO,EAAE,KAAK,OAAO,EAAE,MAAM,WAAW,CAAC;AAEzC,OAAO,EAAE,KAAK,cAAc,EAAE,MAAM,wBAAwB,CAAC;AAC7D,OAAO,EAAE,KAAK,iBAAiB,EAAE,MAAM,aAAa,CAAC;AASrD,eAAO,MAAM,WAAW,EAAE,iBAAiB,CACzC;IAAC,cAAc;CAAC,EAChB,OAAO,CAAC,YAAY,CAAC,CAGtB,CAAC;AAEF,wBAAgB,cAAc,CAAC,OAAO,EAAE,OAAO,QA2B9C"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { reactorHelp } from "../help.js";
|
|
2
|
+
import { setCustomHelp } from "../utils.js";
|
|
3
|
+
async function startLocalSwitchboard(options) {
|
|
4
|
+
const Switchboard = await import("../services/reactor.js");
|
|
5
|
+
const { startLocalReactor } = Switchboard;
|
|
6
|
+
return startLocalReactor(options);
|
|
7
|
+
}
|
|
8
|
+
export const switchboard = async (options) => {
|
|
9
|
+
return startLocalSwitchboard(options);
|
|
10
|
+
};
|
|
11
|
+
export function reactorCommand(program) {
|
|
12
|
+
const command = program
|
|
13
|
+
.command("reactor")
|
|
14
|
+
.description("Starts local reactor")
|
|
15
|
+
.option("--port <PORT>", "port to host the api", "4001")
|
|
16
|
+
.option("--config-file <configFile>", "Path to the powerhouse.config.js file", "./powerhouse.config.json")
|
|
17
|
+
.option("--generate", "generate code when document model is updated")
|
|
18
|
+
.option("--db-path <DB_PATH>", "path to the database")
|
|
19
|
+
.option("--https-key-file <HTTPS_KEY_FILE>", "path to the ssl key file")
|
|
20
|
+
.option("--https-cert-file <HTTPS_CERT_FILE>", "path to the ssl cert file")
|
|
21
|
+
.option("-w, --watch", "if the reactor should watch for local changes to document models and processors")
|
|
22
|
+
.option("--packages <packages...>", "list of packages to be loaded, if defined then packages on config file are ignored")
|
|
23
|
+
.action(async (...args) => {
|
|
24
|
+
await switchboard(...args);
|
|
25
|
+
});
|
|
26
|
+
setCustomHelp(command, reactorHelp);
|
|
27
|
+
}
|
|
28
|
+
if (process.argv.at(2) === "spawn") {
|
|
29
|
+
const optionsArg = process.argv.at(3);
|
|
30
|
+
const options = optionsArg ? JSON.parse(optionsArg) : {};
|
|
31
|
+
startLocalSwitchboard(options)
|
|
32
|
+
.then((switchboard) => {
|
|
33
|
+
process.send?.(`driveUrl:${switchboard.driveUrl}`);
|
|
34
|
+
})
|
|
35
|
+
.catch((e) => {
|
|
36
|
+
throw e;
|
|
37
|
+
});
|
|
38
|
+
}
|
|
39
|
+
//# sourceMappingURL=reactor.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"reactor.js","sourceRoot":"","sources":["../../../src/commands/reactor.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAGzC,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAE5C,KAAK,UAAU,qBAAqB,CAAC,OAAuB;IAC1D,MAAM,WAAW,GAAG,MAAM,MAAM,CAAC,wBAAwB,CAAC,CAAC;IAC3D,MAAM,EAAE,iBAAiB,EAAE,GAAG,WAAW,CAAC;IAC1C,OAAO,iBAAiB,CAAC,OAAO,CAAC,CAAC;AACpC,CAAC;AAED,MAAM,CAAC,MAAM,WAAW,GAGpB,KAAK,EAAE,OAAO,EAAE,EAAE;IACpB,OAAO,qBAAqB,CAAC,OAAO,CAAC,CAAC;AACxC,CAAC,CAAC;AAEF,MAAM,UAAU,cAAc,CAAC,OAAgB;IAC7C,MAAM,OAAO,GAAG,OAAO;SACpB,OAAO,CAAC,SAAS,CAAC;SAClB,WAAW,CAAC,sBAAsB,CAAC;SACnC,MAAM,CAAC,eAAe,EAAE,sBAAsB,EAAE,MAAM,CAAC;SACvD,MAAM,CACL,4BAA4B,EAC5B,uCAAuC,EACvC,0BAA0B,CAC3B;SACA,MAAM,CAAC,YAAY,EAAE,8CAA8C,CAAC;SACpE,MAAM,CAAC,qBAAqB,EAAE,sBAAsB,CAAC;SACrD,MAAM,CAAC,mCAAmC,EAAE,0BAA0B,CAAC;SACvE,MAAM,CAAC,qCAAqC,EAAE,2BAA2B,CAAC;SAC1E,MAAM,CACL,aAAa,EACb,iFAAiF,CAClF;SACA,MAAM,CACL,0BAA0B,EAC1B,oFAAoF,CACrF;SACA,MAAM,CAAC,KAAK,EAAE,GAAG,IAAsB,EAAE,EAAE;QAC1C,MAAM,WAAW,CAAC,GAAG,IAAI,CAAC,CAAC;IAC7B,CAAC,CAAC,CAAC;IAEL,aAAa,CAAC,OAAO,EAAE,WAAW,CAAC,CAAC;AACtC,CAAC;AAED,IAAI,OAAO,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC,CAAC,KAAK,OAAO,EAAE,CAAC;IACnC,MAAM,UAAU,GAAG,OAAO,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;IACtC,MAAM,OAAO,GAAG,UAAU,CAAC,CAAC,CAAE,IAAI,CAAC,KAAK,CAAC,UAAU,CAAoB,CAAC,CAAC,CAAC,EAAE,CAAC;IAC7E,qBAAqB,CAAC,OAAO,CAAC;SAC3B,IAAI,CAAC,CAAC,WAAW,EAAE,EAAE;QACpB,OAAO,CAAC,IAAI,EAAE,CAAC,YAAY,WAAW,CAAC,QAAQ,EAAE,CAAC,CAAC;IACrD,CAAC,CAAC;SACD,KAAK,CAAC,CAAC,CAAU,EAAE,EAAE;QACpB,MAAM,CAAC,CAAC;IACV,CAAC,CAAC,CAAC;AACP,CAAC"}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { type
|
|
1
|
+
import { type SwitchboardReactor } from "@powerhousedao/switchboard/server";
|
|
2
2
|
import { type Command } from "commander";
|
|
3
|
-
import { type
|
|
3
|
+
import { type ReactorOptions } from "../services/reactor.js";
|
|
4
4
|
import { type CommandActionType } from "../types.js";
|
|
5
5
|
export declare const switchboard: CommandActionType<[
|
|
6
|
-
|
|
7
|
-
], Promise<
|
|
8
|
-
export declare function
|
|
6
|
+
ReactorOptions
|
|
7
|
+
], Promise<SwitchboardReactor>>;
|
|
8
|
+
export declare function switchboardCommand(program: Command): void;
|
|
9
9
|
//# sourceMappingURL=switchboard.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"switchboard.d.ts","sourceRoot":"","sources":["../../../src/commands/switchboard.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,
|
|
1
|
+
{"version":3,"file":"switchboard.d.ts","sourceRoot":"","sources":["../../../src/commands/switchboard.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,kBAAkB,EAAE,MAAM,mCAAmC,CAAC;AAC5E,OAAO,EAAE,KAAK,OAAO,EAAE,MAAM,WAAW,CAAC;AAEzC,OAAO,EAAE,KAAK,cAAc,EAAE,MAAM,wBAAwB,CAAC;AAC7D,OAAO,EAAE,KAAK,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAerD,eAAO,MAAM,WAAW,EAAE,iBAAiB,CACzC;IAAC,cAAc;CAAC,EAChB,OAAO,CAAC,kBAAkB,CAAC,CAG5B,CAAC;AAEF,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,OAAO,QAwBlD"}
|
|
@@ -1,17 +1,20 @@
|
|
|
1
1
|
import { switchboardHelp } from "../help.js";
|
|
2
2
|
import { setCustomHelp } from "../utils.js";
|
|
3
3
|
async function startLocalSwitchboard(options) {
|
|
4
|
+
console.log("Starting switchboard", options);
|
|
4
5
|
const Switchboard = await import("../services/switchboard.js");
|
|
5
|
-
const {
|
|
6
|
-
return
|
|
6
|
+
const { startSwitchboard } = Switchboard;
|
|
7
|
+
return startSwitchboard({
|
|
8
|
+
...options,
|
|
9
|
+
port: typeof options.port === "string" ? parseInt(options.port) : options.port,
|
|
10
|
+
});
|
|
7
11
|
}
|
|
8
12
|
export const switchboard = async (options) => {
|
|
9
|
-
return startLocalSwitchboard(options);
|
|
13
|
+
return await startLocalSwitchboard(options);
|
|
10
14
|
};
|
|
11
|
-
export function
|
|
15
|
+
export function switchboardCommand(program) {
|
|
12
16
|
const command = program
|
|
13
17
|
.command("switchboard")
|
|
14
|
-
.alias("reactor")
|
|
15
18
|
.description("Starts local switchboard")
|
|
16
19
|
.option("--port <PORT>", "port to host the api", "4001")
|
|
17
20
|
.option("--config-file <configFile>", "Path to the powerhouse.config.js file", "./powerhouse.config.json")
|
|
@@ -19,21 +22,19 @@ export function reactorCommand(program) {
|
|
|
19
22
|
.option("--db-path <DB_PATH>", "path to the database")
|
|
20
23
|
.option("--https-key-file <HTTPS_KEY_FILE>", "path to the ssl key file")
|
|
21
24
|
.option("--https-cert-file <HTTPS_CERT_FILE>", "path to the ssl cert file")
|
|
22
|
-
.option("-w, --watch", "if the reactor should watch for local changes to document models and processors")
|
|
23
25
|
.option("--packages <packages...>", "list of packages to be loaded, if defined then packages on config file are ignored")
|
|
24
26
|
.action(async (...args) => {
|
|
25
|
-
await switchboard(...args);
|
|
27
|
+
const { defaultDriveUrl } = await switchboard(...args);
|
|
28
|
+
console.log(" ➜ Switchboard:", defaultDriveUrl);
|
|
26
29
|
});
|
|
27
30
|
setCustomHelp(command, switchboardHelp);
|
|
28
31
|
}
|
|
29
32
|
if (process.argv.at(2) === "spawn") {
|
|
30
33
|
const optionsArg = process.argv.at(3);
|
|
31
|
-
const options = optionsArg
|
|
32
|
-
? JSON.parse(optionsArg)
|
|
33
|
-
: {};
|
|
34
|
+
const options = optionsArg ? JSON.parse(optionsArg) : {};
|
|
34
35
|
startLocalSwitchboard(options)
|
|
35
|
-
.then((
|
|
36
|
-
process.send?.(`driveUrl:${
|
|
36
|
+
.then((reactor) => {
|
|
37
|
+
process.send?.(`driveUrl:${reactor.defaultDriveUrl}`);
|
|
37
38
|
})
|
|
38
39
|
.catch((e) => {
|
|
39
40
|
throw e;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"switchboard.js","sourceRoot":"","sources":["../../../src/commands/switchboard.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAG7C,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAE5C,KAAK,UAAU,qBAAqB,CAAC,
|
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ACrF;SACA,MAAM,CAAC,KAAK,EAAE,GAAG,IAAsB,EAAE,EAAE;QAC1C,MAAM,EAAE,eAAe,EAAE,GAAG,MAAM,WAAW,CAAC,GAAG,IAAI,CAAC,CAAC;QACvD,OAAO,CAAC,GAAG,CAAC,oBAAoB,EAAE,eAAe,CAAC,CAAC;IACrD,CAAC,CAAC,CAAC;IAEL,aAAa,CAAC,OAAO,EAAE,eAAe,CAAC,CAAC;AAC1C,CAAC;AAED,IAAI,OAAO,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC,CAAC,KAAK,OAAO,EAAE,CAAC;IACnC,MAAM,UAAU,GAAG,OAAO,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;IACtC,MAAM,OAAO,GAAG,UAAU,CAAC,CAAC,CAAE,IAAI,CAAC,KAAK,CAAC,UAAU,CAAoB,CAAC,CAAC,CAAC,EAAE,CAAC;IAC7E,qBAAqB,CAAC,OAAO,CAAC;SAC3B,IAAI,CAAC,CAAC,OAAO,EAAE,EAAE;QAChB,OAAO,CAAC,IAAI,EAAE,CAAC,YAAY,OAAO,CAAC,eAAe,EAAE,CAAC,CAAC;IACxD,CAAC,CAAC;SACD,KAAK,CAAC,CAAC,CAAU,EAAE,EAAE;QACpB,MAAM,CAAC,CAAC;IACV,CAAC,CAAC,CAAC;AACP,CAAC"}
|
package/dist/src/help.d.ts
CHANGED
|
@@ -33,7 +33,11 @@ export declare const serviceHelp = "\nCommand Overview:\n The service command m
|
|
|
33
33
|
/**
|
|
34
34
|
* Help text for the switchboard command
|
|
35
35
|
*/
|
|
36
|
-
export declare const switchboardHelp = "\nCommand Overview:\n The switchboard command
|
|
36
|
+
export declare const switchboardHelp = "\nCommand Overview:\n The switchboard command starts a local Switchboard instance, which acts as the document\n processing engine for Powerhouse projects. It provides the infrastructure for document\n models, processors, and real-time updates.\n\n This command:\n 1. Starts a local switchboard server\n 2. Loads document models and processors\n 3. Provides an API for document operations\n 4. Enables real-time document processing\n\nOptions:\n --port <PORT> Port to host the API. Default is 4001.\n \n --config-file <path> Path to the powerhouse.config.js file. Default is \n './powerhouse.config.json'. This configures the switchboard behavior.\n \n --db-path <DB_PATH> Path to the database for storing document data.\n \n --https-key-file <path> Path to the SSL key file if using HTTPS for secure connections.\n \n --https-cert-file <path> Path to the SSL certificate file if using HTTPS.\n \n --packages <pkg...> List of packages to be loaded. If defined, packages specified\n in the config file are ignored.\n\nExamples:\n $ ph switchboard # Start switchboard with default settings\n $ ph switchboard --port 5000 # Use custom port 5000\n $ ph switchboard --config-file custom.json # Use custom configuration file\n $ ph switchboard --packages pkg1 pkg2 # Load specific packages\n";
|
|
37
|
+
/**
|
|
38
|
+
* Help text for the reactor command
|
|
39
|
+
*/
|
|
40
|
+
export declare const reactorHelp = "\nCommand Overview:\n The reactor command starts a local Switchboard instance,\n which acts as the document processing engine for Powerhouse projects. It provides\n the infrastructure for document models, processors, and real-time updates.\n\n This command:\n 1. Starts a local reactor server\n 2. Loads document models and processors\n 3. Provides an API for document operations\n 4. Supports real-time updates and code generation\n\nOptions:\n --port <PORT> Port to host the API. Default is 4001.\n \n --config-file <path> Path to the powerhouse.config.js file. Default is \n './powerhouse.config.json'. This configures the reactor behavior.\n \n --generate Generate code automatically when document models are updated.\n \n --db-path <DB_PATH> Path to the database for storing document data.\n \n --https-key-file <path> Path to the SSL key file if using HTTPS for secure connections.\n \n --https-cert-file <path> Path to the SSL certificate file if using HTTPS.\n \n -w, --watch Watch for local changes to document models and processors,\n and automatically update the reactor accordingly.\n \n --packages <pkg...> List of packages to be loaded. If defined, packages specified\n in the config file are ignored.\n\nExamples:\n $ ph reactor # Start reactor with default settings\n $ ph reactor --port 5000 # Use custom port 5000\n $ ph reactor --generate # Enable auto code generation\n $ ph reactor --watch # Watch for local file changes\n $ ph reactor --config-file custom.json # Use custom configuration file\n $ ph reactor --packages pkg1 pkg2 # Load specific packages\n";
|
|
37
41
|
/**
|
|
38
42
|
* Help text for the version command
|
|
39
43
|
*/
|
package/dist/src/help.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"help.d.ts","sourceRoot":"","sources":["../../src/help.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,eAAO,MAAM,WAAW,itDAkCvB,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,YAAY,kpGA0DxB,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,WAAW,+jEAsCvB,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,aAAa,4pEAwCzB,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,QAAQ,ypCA2BpB,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,OAAO,m7DAoCnB,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,WAAW,miDAkCvB,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,WAAW,+mEAuCvB,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,eAAe,
|
|
1
|
+
{"version":3,"file":"help.d.ts","sourceRoot":"","sources":["../../src/help.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,eAAO,MAAM,WAAW,itDAkCvB,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,YAAY,kpGA0DxB,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,WAAW,+jEAsCvB,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,aAAa,4pEAwCzB,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,QAAQ,ypCA2BpB,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,OAAO,m7DAoCnB,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,WAAW,miDAkCvB,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,WAAW,+mEAuCvB,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,eAAe,8/CAgC3B,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,WAAW,s6DAuCvB,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,WAAW,2kCA0BvB,CAAC"}
|
package/dist/src/help.js
CHANGED
|
@@ -341,12 +341,48 @@ Notes:
|
|
|
341
341
|
*/
|
|
342
342
|
export const switchboardHelp = `
|
|
343
343
|
Command Overview:
|
|
344
|
-
The switchboard command
|
|
344
|
+
The switchboard command starts a local Switchboard instance, which acts as the document
|
|
345
|
+
processing engine for Powerhouse projects. It provides the infrastructure for document
|
|
346
|
+
models, processors, and real-time updates.
|
|
347
|
+
|
|
348
|
+
This command:
|
|
349
|
+
1. Starts a local switchboard server
|
|
350
|
+
2. Loads document models and processors
|
|
351
|
+
3. Provides an API for document operations
|
|
352
|
+
4. Enables real-time document processing
|
|
353
|
+
|
|
354
|
+
Options:
|
|
355
|
+
--port <PORT> Port to host the API. Default is 4001.
|
|
356
|
+
|
|
357
|
+
--config-file <path> Path to the powerhouse.config.js file. Default is
|
|
358
|
+
'./powerhouse.config.json'. This configures the switchboard behavior.
|
|
359
|
+
|
|
360
|
+
--db-path <DB_PATH> Path to the database for storing document data.
|
|
361
|
+
|
|
362
|
+
--https-key-file <path> Path to the SSL key file if using HTTPS for secure connections.
|
|
363
|
+
|
|
364
|
+
--https-cert-file <path> Path to the SSL certificate file if using HTTPS.
|
|
365
|
+
|
|
366
|
+
--packages <pkg...> List of packages to be loaded. If defined, packages specified
|
|
367
|
+
in the config file are ignored.
|
|
368
|
+
|
|
369
|
+
Examples:
|
|
370
|
+
$ ph switchboard # Start switchboard with default settings
|
|
371
|
+
$ ph switchboard --port 5000 # Use custom port 5000
|
|
372
|
+
$ ph switchboard --config-file custom.json # Use custom configuration file
|
|
373
|
+
$ ph switchboard --packages pkg1 pkg2 # Load specific packages
|
|
374
|
+
`;
|
|
375
|
+
/**
|
|
376
|
+
* Help text for the reactor command
|
|
377
|
+
*/
|
|
378
|
+
export const reactorHelp = `
|
|
379
|
+
Command Overview:
|
|
380
|
+
The reactor command starts a local Switchboard instance,
|
|
345
381
|
which acts as the document processing engine for Powerhouse projects. It provides
|
|
346
382
|
the infrastructure for document models, processors, and real-time updates.
|
|
347
383
|
|
|
348
384
|
This command:
|
|
349
|
-
1. Starts a local
|
|
385
|
+
1. Starts a local reactor server
|
|
350
386
|
2. Loads document models and processors
|
|
351
387
|
3. Provides an API for document operations
|
|
352
388
|
4. Supports real-time updates and code generation
|
|
@@ -355,7 +391,7 @@ Options:
|
|
|
355
391
|
--port <PORT> Port to host the API. Default is 4001.
|
|
356
392
|
|
|
357
393
|
--config-file <path> Path to the powerhouse.config.js file. Default is
|
|
358
|
-
'./powerhouse.config.json'. This configures the
|
|
394
|
+
'./powerhouse.config.json'. This configures the reactor behavior.
|
|
359
395
|
|
|
360
396
|
--generate Generate code automatically when document models are updated.
|
|
361
397
|
|
|
@@ -366,21 +402,18 @@ Options:
|
|
|
366
402
|
--https-cert-file <path> Path to the SSL certificate file if using HTTPS.
|
|
367
403
|
|
|
368
404
|
-w, --watch Watch for local changes to document models and processors,
|
|
369
|
-
and automatically update the
|
|
405
|
+
and automatically update the reactor accordingly.
|
|
370
406
|
|
|
371
407
|
--packages <pkg...> List of packages to be loaded. If defined, packages specified
|
|
372
408
|
in the config file are ignored.
|
|
373
409
|
|
|
374
410
|
Examples:
|
|
375
|
-
$ ph
|
|
376
|
-
$ ph
|
|
377
|
-
$ ph
|
|
378
|
-
$ ph
|
|
379
|
-
$ ph
|
|
380
|
-
$ ph
|
|
381
|
-
|
|
382
|
-
Aliases:
|
|
383
|
-
$ ph reactor # Alias for switchboard
|
|
411
|
+
$ ph reactor # Start reactor with default settings
|
|
412
|
+
$ ph reactor --port 5000 # Use custom port 5000
|
|
413
|
+
$ ph reactor --generate # Enable auto code generation
|
|
414
|
+
$ ph reactor --watch # Watch for local file changes
|
|
415
|
+
$ ph reactor --config-file custom.json # Use custom configuration file
|
|
416
|
+
$ ph reactor --packages pkg1 pkg2 # Load specific packages
|
|
384
417
|
`;
|
|
385
418
|
/**
|
|
386
419
|
* Help text for the version command
|
package/dist/src/help.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"help.js","sourceRoot":"","sources":["../../src/help.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,CAAC,MAAM,WAAW,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAkC1B,CAAC;AAEF;;GAEG;AACH,MAAM,CAAC,MAAM,YAAY,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA0D3B,CAAC;AAEF;;GAEG;AACH,MAAM,CAAC,MAAM,WAAW,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAsC1B,CAAC;AAEF;;GAEG;AACH,MAAM,CAAC,MAAM,aAAa,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAwC5B,CAAC;AAEF;;GAEG;AACH,MAAM,CAAC,MAAM,QAAQ,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;CA2BvB,CAAC;AAEF;;GAEG;AACH,MAAM,CAAC,MAAM,OAAO,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAoCtB,CAAC;AAEF;;GAEG;AACH,MAAM,CAAC,MAAM,WAAW,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAkC1B,CAAC;AAEF;;GAEG;AACH,MAAM,CAAC,MAAM,WAAW,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAuC1B,CAAC;AAEF;;GAEG;AACH,MAAM,CAAC,MAAM,eAAe,GAAG
|
|
1
|
+
{"version":3,"file":"help.js","sourceRoot":"","sources":["../../src/help.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,CAAC,MAAM,WAAW,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAkC1B,CAAC;AAEF;;GAEG;AACH,MAAM,CAAC,MAAM,YAAY,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA0D3B,CAAC;AAEF;;GAEG;AACH,MAAM,CAAC,MAAM,WAAW,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAsC1B,CAAC;AAEF;;GAEG;AACH,MAAM,CAAC,MAAM,aAAa,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAwC5B,CAAC;AAEF;;GAEG;AACH,MAAM,CAAC,MAAM,QAAQ,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;CA2BvB,CAAC;AAEF;;GAEG;AACH,MAAM,CAAC,MAAM,OAAO,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAoCtB,CAAC;AAEF;;GAEG;AACH,MAAM,CAAC,MAAM,WAAW,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAkC1B,CAAC;AAEF;;GAEG;AACH,MAAM,CAAC,MAAM,WAAW,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAuC1B,CAAC;AAEF;;GAEG;AACH,MAAM,CAAC,MAAM,eAAe,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAgC9B,CAAC;AAEF;;GAEG;AACH,MAAM,CAAC,MAAM,WAAW,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAuC1B,CAAC;AAEF;;GAEG;AACH,MAAM,CAAC,MAAM,WAAW,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;CA0B1B,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dev.d.ts","sourceRoot":"","sources":["../../../src/services/dev.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"dev.d.ts","sourceRoot":"","sources":["../../../src/services/dev.ts"],"names":[],"mappings":"AAWA,MAAM,MAAM,UAAU,GAAG;IACvB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB,CAAC;AA0EF,wBAAsB,QAAQ,CAAC,EAC7B,QAAQ,EACR,KAAK,EACL,eAA4C,EAC5C,UAAU,GACX,EAAE,UAAU,iBAcZ"}
|
package/dist/src/services/dev.js
CHANGED
|
@@ -3,7 +3,7 @@ import { fork } from "node:child_process";
|
|
|
3
3
|
import path, { dirname } from "node:path";
|
|
4
4
|
import { fileURLToPath } from "node:url";
|
|
5
5
|
import { getConfig } from "../utils.js";
|
|
6
|
-
import {
|
|
6
|
+
import { DefaultReactorOptions } from "./reactor.js";
|
|
7
7
|
const __dirname = import.meta.dirname || dirname(fileURLToPath(import.meta.url));
|
|
8
8
|
function spawnLocalSwitchboard(options) {
|
|
9
9
|
const child = fork(path.join(dirname(__dirname), "commands", "switchboard.js"), ["spawn", JSON.stringify(options)], { silent: true });
|
|
@@ -56,7 +56,7 @@ async function spawnConnect(options, localReactorUrl) {
|
|
|
56
56
|
});
|
|
57
57
|
});
|
|
58
58
|
}
|
|
59
|
-
export async function startDev({ generate, watch, switchboardPort =
|
|
59
|
+
export async function startDev({ generate, watch, switchboardPort = DefaultReactorOptions.port, configFile, }) {
|
|
60
60
|
try {
|
|
61
61
|
const baseConfig = getConfig(configFile);
|
|
62
62
|
const https = baseConfig.reactor?.https;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dev.js","sourceRoot":"","sources":["../../../src/services/dev.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,IAAI,EAAE,KAAK,EAAE,GAAG,EAAE,MAAM,WAAW,CAAC;AAC7C,OAAO,EAAuC,IAAI,EAAE,MAAM,oBAAoB,CAAC;AAC/E,OAAO,IAAI,EAAE,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAC1C,O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AE,KAAK,CAAC;QACxC,MAAM,EAAE,QAAQ,EAAE,GAAG,MAAM,qBAAqB,CAAC;YAC/C,QAAQ;YACR,IAAI,EAAE,eAAe;YACrB,KAAK;YACL,KAAK;SACN,CAAC,CAAC;QACH,MAAM,YAAY,CAAC,EAAE,UAAU,EAAE,EAAE,QAAQ,CAAC,CAAC;IAC/C,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;IACvB,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { type LocalReactor, type StartServerOptions } from "@powerhousedao/reactor-local";
|
|
2
|
+
export type ReactorOptions = StartServerOptions & {
|
|
3
|
+
configFile?: string;
|
|
4
|
+
generate?: boolean;
|
|
5
|
+
watch?: boolean;
|
|
6
|
+
dbPath?: string;
|
|
7
|
+
};
|
|
8
|
+
export declare const DefaultReactorOptions: {
|
|
9
|
+
dev: boolean;
|
|
10
|
+
port: number;
|
|
11
|
+
storage: {
|
|
12
|
+
type: "filesystem";
|
|
13
|
+
filesystemPath: string;
|
|
14
|
+
};
|
|
15
|
+
dbPath: string;
|
|
16
|
+
drive: {
|
|
17
|
+
id: string;
|
|
18
|
+
slug: string;
|
|
19
|
+
global: {
|
|
20
|
+
name: string;
|
|
21
|
+
icon: string;
|
|
22
|
+
};
|
|
23
|
+
local: {
|
|
24
|
+
availableOffline: true;
|
|
25
|
+
listeners: never[];
|
|
26
|
+
sharingType: string;
|
|
27
|
+
triggers: never[];
|
|
28
|
+
};
|
|
29
|
+
};
|
|
30
|
+
};
|
|
31
|
+
export declare function startLocalReactor(reactorOptions: ReactorOptions): Promise<LocalReactor>;
|
|
32
|
+
//# sourceMappingURL=reactor.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"reactor.d.ts","sourceRoot":"","sources":["../../../src/services/reactor.ts"],"names":[],"mappings":"AAGA,OAAO,EAGL,KAAK,YAAY,EACjB,KAAK,kBAAkB,EACxB,MAAM,8BAA8B,CAAC;AAStC,MAAM,MAAM,cAAc,GAAG,kBAAkB,GAAG;IAChD,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB,CAAC;AAEF,eAAO,MAAM,qBAAqB;;;;;;;;;;;;;;;;;;;;;;CAGjC,CAAC;AAEF,wBAAsB,iBAAiB,CAAC,cAAc,EAAE,cAAc,yBAoBrE"}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import { generateFromFile } from "@powerhousedao/codegen";
|
|
2
|
+
import { getConfig } from "@powerhousedao/config/utils";
|
|
3
|
+
import { DefaultStartServerOptions, startServer, } from "@powerhousedao/reactor-local";
|
|
4
|
+
import { InternalTransmitter, } from "document-drive/server/listener/transmitter/internal";
|
|
5
|
+
export const DefaultReactorOptions = {
|
|
6
|
+
...DefaultStartServerOptions,
|
|
7
|
+
dev: true,
|
|
8
|
+
};
|
|
9
|
+
export async function startLocalReactor(reactorOptions) {
|
|
10
|
+
const baseConfig = getConfig(reactorOptions.configFile);
|
|
11
|
+
const options = {
|
|
12
|
+
...DefaultReactorOptions,
|
|
13
|
+
...reactorOptions,
|
|
14
|
+
};
|
|
15
|
+
const { https } = baseConfig.reactor ?? { https: false };
|
|
16
|
+
const reactor = await startServer({
|
|
17
|
+
...options,
|
|
18
|
+
https,
|
|
19
|
+
logLevel: baseConfig.logLevel,
|
|
20
|
+
storage: baseConfig.reactor?.storage || options.storage,
|
|
21
|
+
});
|
|
22
|
+
if (options.generate) {
|
|
23
|
+
await addGenerateTransmitter(reactor, baseConfig);
|
|
24
|
+
}
|
|
25
|
+
return reactor;
|
|
26
|
+
}
|
|
27
|
+
// TODO: instead of doing this by hand, we should use the processor manager
|
|
28
|
+
async function addGenerateTransmitter(reactor, config) {
|
|
29
|
+
const processor = {
|
|
30
|
+
onStrands: async function (strands) {
|
|
31
|
+
const documentPaths = new Set();
|
|
32
|
+
for (const strand of strands) {
|
|
33
|
+
documentPaths.add(reactor.getDocumentPath(strand.driveId, strand.documentId));
|
|
34
|
+
}
|
|
35
|
+
for (const path of documentPaths) {
|
|
36
|
+
await generateFromFile(path, config);
|
|
37
|
+
}
|
|
38
|
+
return Promise.resolve();
|
|
39
|
+
},
|
|
40
|
+
onDisconnect: () => Promise.resolve(),
|
|
41
|
+
};
|
|
42
|
+
const listenerManager = reactor.server.listeners;
|
|
43
|
+
// todo: simplify
|
|
44
|
+
const listener = {
|
|
45
|
+
driveId: "powerhouse",
|
|
46
|
+
listenerId: "reactor-local-document-model-generator",
|
|
47
|
+
label: "reactor-local-document-model-generator",
|
|
48
|
+
filter: {
|
|
49
|
+
documentType: ["powerhouse/document-model"],
|
|
50
|
+
scope: ["global"],
|
|
51
|
+
branch: ["*"],
|
|
52
|
+
documentId: ["*"],
|
|
53
|
+
},
|
|
54
|
+
block: false,
|
|
55
|
+
system: false,
|
|
56
|
+
callInfo: {
|
|
57
|
+
data: "",
|
|
58
|
+
name: "reactor-local-document-model-generator",
|
|
59
|
+
transmitterType: "Internal",
|
|
60
|
+
},
|
|
61
|
+
};
|
|
62
|
+
const transmitter = new InternalTransmitter(reactor.server, processor);
|
|
63
|
+
listener.transmitter = transmitter;
|
|
64
|
+
await listenerManager.setListener(listener.driveId, listener);
|
|
65
|
+
}
|
|
66
|
+
//# sourceMappingURL=reactor.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"reactor.js","sourceRoot":"","sources":["../../../src/services/reactor.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAE1D,OAAO,EAAE,SAAS,EAAE,MAAM,6BAA6B,CAAC;AACxD,OAAO,EACL,yBAAyB,EACzB,WAAW,GAGZ,MAAM,8BAA8B,CAAC;AAEtC,OAAO,EACL,mBAAm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;YACD,OAAO,OAAO,CAAC,OAAO,EAAE,CAAC;QAC3B,CAAC;QACD,YAAY,EAAE,GAAG,EAAE,CAAC,OAAO,CAAC,OAAO,EAAE;KACtC,CAAC;IAEF,MAAM,eAAe,GAAG,OAAO,CAAC,MAAM,CAAC,SAAS,CAAC;IAEjD,iBAAiB;IACjB,MAAM,QAAQ,GAAa;QACzB,OAAO,EAAE,YAAY;QACrB,UAAU,EAAE,wCAAwC;QACpD,KAAK,EAAE,wCAAwC;QAC/C,MAAM,EAAE;YACN,YAAY,EAAE,CAAC,2BAA2B,CAAC;YAC3C,KAAK,EAAE,CAAC,QAAQ,CAAC;YACjB,MAAM,EAAE,CAAC,GAAG,CAAC;YACb,UAAU,EAAE,CAAC,GAAG,CAAC;SAClB;QACD,KAAK,EAAE,KAAK;QACZ,MAAM,EAAE,KAAK;QACb,QAAQ,EAAE;YACR,IAAI,EAAE,EAAE;YACR,IAAI,EAAE,wCAAwC;YAC9C,eAAe,EAAE,UAAU;SAC5B;KACF,CAAC;IAEF,MAAM,WAAW,GAAG,IAAI,mBAAmB,CAAC,OAAO,CAAC,MAAM,EAAE,SAAS,CAAC,CAAC;IAEvE,QAAQ,CAAC,WAAW,GAAG,WAAW,CAAC;IAEnC,MAAM,eAAe,CAAC,WAAW,CAAC,QAAQ,CAAC,OAAO,EAAE,QAAQ,CAAC,CAAC;AAChE,CAAC"}
|
|
@@ -1,32 +1,3 @@
|
|
|
1
|
-
import { type
|
|
2
|
-
export
|
|
3
|
-
configFile?: string;
|
|
4
|
-
generate?: boolean;
|
|
5
|
-
watch?: boolean;
|
|
6
|
-
dbPath?: string;
|
|
7
|
-
};
|
|
8
|
-
export declare const DefaultSwitchboardOptions: {
|
|
9
|
-
dev: boolean;
|
|
10
|
-
port: number;
|
|
11
|
-
storage: {
|
|
12
|
-
type: "filesystem";
|
|
13
|
-
filesystemPath: string;
|
|
14
|
-
};
|
|
15
|
-
dbPath: string;
|
|
16
|
-
drive: {
|
|
17
|
-
id: string;
|
|
18
|
-
slug: string;
|
|
19
|
-
global: {
|
|
20
|
-
name: string;
|
|
21
|
-
icon: string;
|
|
22
|
-
};
|
|
23
|
-
local: {
|
|
24
|
-
availableOffline: true;
|
|
25
|
-
listeners: never[];
|
|
26
|
-
sharingType: string;
|
|
27
|
-
triggers: never[];
|
|
28
|
-
};
|
|
29
|
-
};
|
|
30
|
-
};
|
|
31
|
-
export declare function startLocalSwitchboard(switchboardOptions: SwitchboardOptions): Promise<LocalReactor>;
|
|
1
|
+
import { type StartServerOptions } from "@powerhousedao/switchboard/server";
|
|
2
|
+
export declare function startSwitchboard(options: StartServerOptions): Promise<import("@powerhousedao/switchboard/server").SwitchboardReactor>;
|
|
32
3
|
//# sourceMappingURL=switchboard.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"switchboard.d.ts","sourceRoot":"","sources":["../../../src/services/switchboard.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"switchboard.d.ts","sourceRoot":"","sources":["../../../src/services/switchboard.ts"],"names":[],"mappings":"AACA,OAAO,EACL,KAAK,kBAAkB,EAExB,MAAM,mCAAmC,CAAC;AAsB3C,wBAAsB,gBAAgB,CAAC,OAAO,EAAE,kBAAkB,2EAYjE"}
|