@uncensoredcode/openbridge 0.1.0 → 0.1.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/package.json +1 -1
- package/packages/cli/dist/args.js +23 -2
- package/packages/server/dist/cli/run-bridge-server-cli.d.ts +81 -0
- package/packages/server/dist/cli/run-bridge-server-cli.js +961 -46
- package/packages/server/dist/client/bridge-api-client.d.ts +81 -1
- package/packages/server/dist/client/bridge-api-client.js +184 -1
- package/packages/server/dist/client/index.d.ts +39 -1
- package/packages/server/dist/client/index.js +20 -1
package/package.json
CHANGED
|
@@ -1,5 +1,16 @@
|
|
|
1
1
|
const DEFAULT_BASE_URL = "http://127.0.0.1:4318";
|
|
2
|
-
const SERVER_SUBCOMMANDS = new Set([
|
|
2
|
+
const SERVER_SUBCOMMANDS = new Set([
|
|
3
|
+
"start",
|
|
4
|
+
"status",
|
|
5
|
+
"stop",
|
|
6
|
+
"logs",
|
|
7
|
+
"chat",
|
|
8
|
+
"live-canary",
|
|
9
|
+
"clear-session-vault",
|
|
10
|
+
"providers",
|
|
11
|
+
"models",
|
|
12
|
+
"sessions"
|
|
13
|
+
]);
|
|
3
14
|
function parseBridgeCliArgs(input) {
|
|
4
15
|
const env = input.env ?? process.env;
|
|
5
16
|
const args = [...input.argv];
|
|
@@ -55,8 +66,14 @@ function getBridgeCliHelpText() {
|
|
|
55
66
|
"openbridge",
|
|
56
67
|
"",
|
|
57
68
|
"Usage:",
|
|
58
|
-
" openbridge start [--host <host>] [--port <port>] [--token <token>]",
|
|
69
|
+
" openbridge start [--host <host>] [--port <port>] [--token <token>] [--foreground]",
|
|
70
|
+
" openbridge status [--state-root <path>]",
|
|
71
|
+
" openbridge stop [--state-root <path>]",
|
|
72
|
+
" openbridge logs [--follow] [--lines <count>] [--state-root <path>]",
|
|
59
73
|
" openbridge health [--base-url <url>]",
|
|
74
|
+
" openbridge providers <list|get|add|remove|enable|disable|import-session|session-status|clear-session> ...",
|
|
75
|
+
" openbridge models <list|add> ...",
|
|
76
|
+
" openbridge sessions <list|get|remove> ...",
|
|
60
77
|
" openbridge --session <id> [--input <text>] [--base-url <url>] [--provider <id>] [--model <id>] [--metadata <json>]",
|
|
61
78
|
" openbridge chat --model <id> --message <text> [--system <text>] [--base-url <url>] [--stream]",
|
|
62
79
|
" openbridge live-canary [--state-root <path>] [--provider <id>] [--model <id>]",
|
|
@@ -64,7 +81,11 @@ function getBridgeCliHelpText() {
|
|
|
64
81
|
"",
|
|
65
82
|
"Examples:",
|
|
66
83
|
" openbridge start",
|
|
84
|
+
" openbridge status",
|
|
85
|
+
" openbridge logs --follow",
|
|
67
86
|
" openbridge health",
|
|
87
|
+
" openbridge providers list",
|
|
88
|
+
" openbridge providers import-session provider-a --file ./session-package.json",
|
|
68
89
|
' openbridge --session demo "Read README.md"',
|
|
69
90
|
' openbridge --base-url http://127.0.0.1:4318 --session s1 --input "Run git status"'
|
|
70
91
|
].join("\n");
|
|
@@ -8,6 +8,77 @@ type BridgeServerCliCommand = {
|
|
|
8
8
|
} | {
|
|
9
9
|
kind: "serve";
|
|
10
10
|
config: BridgeServerConfig;
|
|
11
|
+
foreground: boolean;
|
|
12
|
+
} | {
|
|
13
|
+
kind: "status";
|
|
14
|
+
config: BridgeServerConfig;
|
|
15
|
+
} | {
|
|
16
|
+
kind: "stop";
|
|
17
|
+
config: BridgeServerConfig;
|
|
18
|
+
} | {
|
|
19
|
+
kind: "logs";
|
|
20
|
+
config: BridgeServerConfig;
|
|
21
|
+
follow: boolean;
|
|
22
|
+
lines: number;
|
|
23
|
+
} | {
|
|
24
|
+
kind: "providers-list";
|
|
25
|
+
baseUrl: string;
|
|
26
|
+
} | {
|
|
27
|
+
kind: "providers-get";
|
|
28
|
+
baseUrl: string;
|
|
29
|
+
id: string;
|
|
30
|
+
} | {
|
|
31
|
+
kind: "providers-add";
|
|
32
|
+
baseUrl: string;
|
|
33
|
+
id: string;
|
|
34
|
+
providerKind: string;
|
|
35
|
+
label: string;
|
|
36
|
+
enabled: boolean;
|
|
37
|
+
config: Record<string, unknown> | undefined;
|
|
38
|
+
} | {
|
|
39
|
+
kind: "providers-remove";
|
|
40
|
+
baseUrl: string;
|
|
41
|
+
id: string;
|
|
42
|
+
} | {
|
|
43
|
+
kind: "providers-enable";
|
|
44
|
+
baseUrl: string;
|
|
45
|
+
id: string;
|
|
46
|
+
} | {
|
|
47
|
+
kind: "providers-disable";
|
|
48
|
+
baseUrl: string;
|
|
49
|
+
id: string;
|
|
50
|
+
} | {
|
|
51
|
+
kind: "providers-import-session";
|
|
52
|
+
baseUrl: string;
|
|
53
|
+
id: string;
|
|
54
|
+
filePath?: string;
|
|
55
|
+
} | {
|
|
56
|
+
kind: "providers-session-status";
|
|
57
|
+
baseUrl: string;
|
|
58
|
+
id: string;
|
|
59
|
+
} | {
|
|
60
|
+
kind: "providers-clear-session";
|
|
61
|
+
baseUrl: string;
|
|
62
|
+
id: string;
|
|
63
|
+
} | {
|
|
64
|
+
kind: "models-list";
|
|
65
|
+
baseUrl: string;
|
|
66
|
+
} | {
|
|
67
|
+
kind: "models-add";
|
|
68
|
+
baseUrl: string;
|
|
69
|
+
provider: string;
|
|
70
|
+
model: string;
|
|
71
|
+
} | {
|
|
72
|
+
kind: "sessions-list";
|
|
73
|
+
baseUrl: string;
|
|
74
|
+
} | {
|
|
75
|
+
kind: "sessions-get";
|
|
76
|
+
baseUrl: string;
|
|
77
|
+
id: string;
|
|
78
|
+
} | {
|
|
79
|
+
kind: "sessions-remove";
|
|
80
|
+
baseUrl: string;
|
|
81
|
+
id: string;
|
|
11
82
|
} | {
|
|
12
83
|
kind: "clear-session-vault";
|
|
13
84
|
config: BridgeServerConfig;
|
|
@@ -39,6 +110,16 @@ type RunBridgeServerCliInput = {
|
|
|
39
110
|
keyPath: string;
|
|
40
111
|
stdin: NodeJS.ReadStream;
|
|
41
112
|
}) => Promise<string>;
|
|
113
|
+
spawnDetachedServerProcess?: (input: SpawnDetachedServerProcessInput) => Promise<SpawnDetachedServerProcessResult>;
|
|
114
|
+
};
|
|
115
|
+
type SpawnDetachedServerProcessInput = {
|
|
116
|
+
argv: string[];
|
|
117
|
+
env: NodeJS.ProcessEnv;
|
|
118
|
+
logPath: string;
|
|
119
|
+
cwd: string;
|
|
120
|
+
};
|
|
121
|
+
type SpawnDetachedServerProcessResult = {
|
|
122
|
+
pid: number;
|
|
42
123
|
};
|
|
43
124
|
declare function runBridgeServerCli(input: RunBridgeServerCliInput): Promise<number>;
|
|
44
125
|
declare function parseBridgeServerCliArgs(input: {
|