@femtomc/mu-server 26.2.38 → 26.2.39
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/README.md +3 -3
- package/dist/config.d.ts +3 -3
- package/dist/config.js +39 -39
- package/dist/control_plane.d.ts +3 -3
- package/dist/control_plane.js +13 -13
- package/package.json +8 -6
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# @femtomc/mu-server
|
|
2
2
|
|
|
3
|
-
HTTP
|
|
3
|
+
HTTP API server for mu. Powers `mu serve`, the web UI, and programmatic status/control endpoints.
|
|
4
4
|
|
|
5
5
|
## Installation
|
|
6
6
|
|
|
@@ -115,11 +115,11 @@ Bun.serve(server);
|
|
|
115
115
|
|
|
116
116
|
### With Web UI (Recommended)
|
|
117
117
|
|
|
118
|
-
The easiest way to run the server with the bundled web interface (and default terminal
|
|
118
|
+
The easiest way to run the server with the bundled web interface (and default terminal operator chat):
|
|
119
119
|
|
|
120
120
|
```bash
|
|
121
121
|
# From any mu repository
|
|
122
|
-
mu serve # API + web UI + terminal
|
|
122
|
+
mu serve # API + web UI + terminal operator session
|
|
123
123
|
mu serve --no-open # Skip browser auto-open (headless/SSH)
|
|
124
124
|
mu serve --port 8080 # Custom shared API/web UI port
|
|
125
125
|
```
|
package/dist/config.d.ts
CHANGED
|
@@ -21,7 +21,7 @@ export type MuConfig = {
|
|
|
21
21
|
refresh_token: string | null;
|
|
22
22
|
};
|
|
23
23
|
};
|
|
24
|
-
|
|
24
|
+
operator: {
|
|
25
25
|
enabled: boolean;
|
|
26
26
|
run_triggers_enabled: boolean;
|
|
27
27
|
provider: string | null;
|
|
@@ -51,7 +51,7 @@ export type MuConfigPatch = {
|
|
|
51
51
|
refresh_token?: string | null;
|
|
52
52
|
};
|
|
53
53
|
};
|
|
54
|
-
|
|
54
|
+
operator?: {
|
|
55
55
|
enabled?: boolean;
|
|
56
56
|
run_triggers_enabled?: boolean;
|
|
57
57
|
provider?: string | null;
|
|
@@ -81,7 +81,7 @@ export type MuConfigPresence = {
|
|
|
81
81
|
refresh_token: boolean;
|
|
82
82
|
};
|
|
83
83
|
};
|
|
84
|
-
|
|
84
|
+
operator: {
|
|
85
85
|
enabled: boolean;
|
|
86
86
|
run_triggers_enabled: boolean;
|
|
87
87
|
provider: boolean;
|
package/dist/config.js
CHANGED
|
@@ -23,7 +23,7 @@ export const DEFAULT_MU_CONFIG = {
|
|
|
23
23
|
refresh_token: null,
|
|
24
24
|
},
|
|
25
25
|
},
|
|
26
|
-
|
|
26
|
+
operator: {
|
|
27
27
|
enabled: true,
|
|
28
28
|
run_triggers_enabled: true,
|
|
29
29
|
provider: null,
|
|
@@ -109,19 +109,19 @@ export function normalizeMuConfig(input) {
|
|
|
109
109
|
}
|
|
110
110
|
}
|
|
111
111
|
}
|
|
112
|
-
const
|
|
113
|
-
if (
|
|
114
|
-
if ("enabled" in
|
|
115
|
-
next.control_plane.
|
|
112
|
+
const operator = asRecord(controlPlane.operator);
|
|
113
|
+
if (operator) {
|
|
114
|
+
if ("enabled" in operator) {
|
|
115
|
+
next.control_plane.operator.enabled = normalizeBoolean(operator.enabled, next.control_plane.operator.enabled);
|
|
116
116
|
}
|
|
117
|
-
if ("run_triggers_enabled" in
|
|
118
|
-
next.control_plane.
|
|
117
|
+
if ("run_triggers_enabled" in operator) {
|
|
118
|
+
next.control_plane.operator.run_triggers_enabled = normalizeBoolean(operator.run_triggers_enabled, next.control_plane.operator.run_triggers_enabled);
|
|
119
119
|
}
|
|
120
|
-
if ("provider" in
|
|
121
|
-
next.control_plane.
|
|
120
|
+
if ("provider" in operator) {
|
|
121
|
+
next.control_plane.operator.provider = normalizeNullableString(operator.provider);
|
|
122
122
|
}
|
|
123
|
-
if ("model" in
|
|
124
|
-
next.control_plane.
|
|
123
|
+
if ("model" in operator) {
|
|
124
|
+
next.control_plane.operator.model = normalizeNullableString(operator.model);
|
|
125
125
|
}
|
|
126
126
|
}
|
|
127
127
|
return next;
|
|
@@ -189,23 +189,23 @@ function normalizeMuConfigPatch(input) {
|
|
|
189
189
|
}
|
|
190
190
|
}
|
|
191
191
|
}
|
|
192
|
-
const
|
|
193
|
-
if (
|
|
194
|
-
patch.control_plane.
|
|
195
|
-
if ("enabled" in
|
|
196
|
-
patch.control_plane.
|
|
192
|
+
const operator = asRecord(controlPlane.operator);
|
|
193
|
+
if (operator) {
|
|
194
|
+
patch.control_plane.operator = {};
|
|
195
|
+
if ("enabled" in operator) {
|
|
196
|
+
patch.control_plane.operator.enabled = normalizeBoolean(operator.enabled, DEFAULT_MU_CONFIG.control_plane.operator.enabled);
|
|
197
197
|
}
|
|
198
|
-
if ("run_triggers_enabled" in
|
|
199
|
-
patch.control_plane.
|
|
198
|
+
if ("run_triggers_enabled" in operator) {
|
|
199
|
+
patch.control_plane.operator.run_triggers_enabled = normalizeBoolean(operator.run_triggers_enabled, DEFAULT_MU_CONFIG.control_plane.operator.run_triggers_enabled);
|
|
200
200
|
}
|
|
201
|
-
if ("provider" in
|
|
202
|
-
patch.control_plane.
|
|
201
|
+
if ("provider" in operator) {
|
|
202
|
+
patch.control_plane.operator.provider = normalizeNullableString(operator.provider);
|
|
203
203
|
}
|
|
204
|
-
if ("model" in
|
|
205
|
-
patch.control_plane.
|
|
204
|
+
if ("model" in operator) {
|
|
205
|
+
patch.control_plane.operator.model = normalizeNullableString(operator.model);
|
|
206
206
|
}
|
|
207
|
-
if (Object.keys(patch.control_plane.
|
|
208
|
-
delete patch.control_plane.
|
|
207
|
+
if (Object.keys(patch.control_plane.operator).length === 0) {
|
|
208
|
+
delete patch.control_plane.operator;
|
|
209
209
|
}
|
|
210
210
|
}
|
|
211
211
|
if (patch.control_plane.adapters && Object.keys(patch.control_plane.adapters).length === 0) {
|
|
@@ -259,19 +259,19 @@ export function applyMuConfigPatch(base, patchInput) {
|
|
|
259
259
|
}
|
|
260
260
|
}
|
|
261
261
|
}
|
|
262
|
-
const
|
|
263
|
-
if (
|
|
264
|
-
if ("enabled" in
|
|
265
|
-
next.control_plane.
|
|
262
|
+
const operator = patch.control_plane.operator;
|
|
263
|
+
if (operator) {
|
|
264
|
+
if ("enabled" in operator && typeof operator.enabled === "boolean") {
|
|
265
|
+
next.control_plane.operator.enabled = operator.enabled;
|
|
266
266
|
}
|
|
267
|
-
if ("run_triggers_enabled" in
|
|
268
|
-
next.control_plane.
|
|
267
|
+
if ("run_triggers_enabled" in operator && typeof operator.run_triggers_enabled === "boolean") {
|
|
268
|
+
next.control_plane.operator.run_triggers_enabled = operator.run_triggers_enabled;
|
|
269
269
|
}
|
|
270
|
-
if ("provider" in
|
|
271
|
-
next.control_plane.
|
|
270
|
+
if ("provider" in operator) {
|
|
271
|
+
next.control_plane.operator.provider = operator.provider ?? null;
|
|
272
272
|
}
|
|
273
|
-
if ("model" in
|
|
274
|
-
next.control_plane.
|
|
273
|
+
if ("model" in operator) {
|
|
274
|
+
next.control_plane.operator.model = operator.model ?? null;
|
|
275
275
|
}
|
|
276
276
|
}
|
|
277
277
|
return next;
|
|
@@ -349,11 +349,11 @@ export function muConfigPresence(config) {
|
|
|
349
349
|
refresh_token: isPresent(config.control_plane.adapters.gmail.refresh_token),
|
|
350
350
|
},
|
|
351
351
|
},
|
|
352
|
-
|
|
353
|
-
enabled: config.control_plane.
|
|
354
|
-
run_triggers_enabled: config.control_plane.
|
|
355
|
-
provider: isPresent(config.control_plane.
|
|
356
|
-
model: isPresent(config.control_plane.
|
|
352
|
+
operator: {
|
|
353
|
+
enabled: config.control_plane.operator.enabled,
|
|
354
|
+
run_triggers_enabled: config.control_plane.operator.run_triggers_enabled,
|
|
355
|
+
provider: isPresent(config.control_plane.operator.provider),
|
|
356
|
+
model: isPresent(config.control_plane.operator.model),
|
|
357
357
|
},
|
|
358
358
|
},
|
|
359
359
|
};
|
package/dist/control_plane.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type
|
|
1
|
+
import { type MessagingOperatorBackend, MessagingOperatorRuntime } from "@femtomc/mu-agent";
|
|
2
2
|
import { type Channel } from "@femtomc/mu-control-plane";
|
|
3
3
|
import { type MuConfig } from "./config.js";
|
|
4
4
|
export type ActiveAdapter = {
|
|
@@ -27,8 +27,8 @@ export declare function detectAdapters(config: ControlPlaneConfig): DetectedAdap
|
|
|
27
27
|
export type BootstrapControlPlaneOpts = {
|
|
28
28
|
repoRoot: string;
|
|
29
29
|
config?: ControlPlaneConfig;
|
|
30
|
-
|
|
31
|
-
|
|
30
|
+
operatorRuntime?: MessagingOperatorRuntime | null;
|
|
31
|
+
operatorBackend?: MessagingOperatorBackend;
|
|
32
32
|
};
|
|
33
33
|
export declare function bootstrapControlPlane(opts: BootstrapControlPlaneOpts): Promise<ControlPlaneHandle | null>;
|
|
34
34
|
export {};
|
package/dist/control_plane.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ApprovedCommandBroker, CommandContextResolver,
|
|
1
|
+
import { ApprovedCommandBroker, CommandContextResolver, MessagingOperatorRuntime, PiMessagingOperatorBackend, serveExtensionPaths, } from "@femtomc/mu-agent";
|
|
2
2
|
import { ControlPlaneCommandPipeline, ControlPlaneOutbox, ControlPlaneOutboxDispatcher, ControlPlaneRuntime, DiscordControlPlaneAdapter, getControlPlanePaths, SlackControlPlaneAdapter, TelegramControlPlaneAdapter, } from "@femtomc/mu-control-plane";
|
|
3
3
|
import { DEFAULT_MU_CONFIG } from "./config.js";
|
|
4
4
|
export function detectAdapters(config) {
|
|
@@ -22,20 +22,20 @@ export function detectAdapters(config) {
|
|
|
22
22
|
}
|
|
23
23
|
return adapters;
|
|
24
24
|
}
|
|
25
|
-
function
|
|
26
|
-
if (!opts.config.
|
|
25
|
+
function buildMessagingOperatorRuntime(opts) {
|
|
26
|
+
if (!opts.config.operator.enabled) {
|
|
27
27
|
return null;
|
|
28
28
|
}
|
|
29
29
|
const backend = opts.backend ??
|
|
30
|
-
new
|
|
31
|
-
provider: opts.config.
|
|
32
|
-
model: opts.config.
|
|
30
|
+
new PiMessagingOperatorBackend({
|
|
31
|
+
provider: opts.config.operator.provider ?? undefined,
|
|
32
|
+
model: opts.config.operator.model ?? undefined,
|
|
33
33
|
extensionPaths: serveExtensionPaths,
|
|
34
34
|
});
|
|
35
|
-
return new
|
|
35
|
+
return new MessagingOperatorRuntime({
|
|
36
36
|
backend,
|
|
37
37
|
broker: new ApprovedCommandBroker({
|
|
38
|
-
runTriggersEnabled: opts.config.
|
|
38
|
+
runTriggersEnabled: opts.config.operator.run_triggers_enabled,
|
|
39
39
|
contextResolver: new CommandContextResolver({ allowedRepoRoots: [opts.repoRoot] }),
|
|
40
40
|
}),
|
|
41
41
|
enabled: true,
|
|
@@ -50,14 +50,14 @@ export async function bootstrapControlPlane(opts) {
|
|
|
50
50
|
const paths = getControlPlanePaths(opts.repoRoot);
|
|
51
51
|
const runtime = new ControlPlaneRuntime({ repoRoot: opts.repoRoot });
|
|
52
52
|
await runtime.start();
|
|
53
|
-
const
|
|
54
|
-
? opts.
|
|
55
|
-
:
|
|
53
|
+
const operator = opts.operatorRuntime !== undefined
|
|
54
|
+
? opts.operatorRuntime
|
|
55
|
+
: buildMessagingOperatorRuntime({
|
|
56
56
|
repoRoot: opts.repoRoot,
|
|
57
57
|
config: controlPlaneConfig,
|
|
58
|
-
backend: opts.
|
|
58
|
+
backend: opts.operatorBackend,
|
|
59
59
|
});
|
|
60
|
-
const pipeline = new ControlPlaneCommandPipeline({ runtime,
|
|
60
|
+
const pipeline = new ControlPlaneCommandPipeline({ runtime, operator });
|
|
61
61
|
await pipeline.start();
|
|
62
62
|
const outbox = new ControlPlaneOutbox(paths.outboxPath);
|
|
63
63
|
await outbox.load();
|
package/package.json
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@femtomc/mu-server",
|
|
3
|
-
"version": "26.2.
|
|
3
|
+
"version": "26.2.39",
|
|
4
|
+
"description": "HTTP API server for mu status, work items, messaging setup, and web UI.",
|
|
5
|
+
"keywords": ["mu", "server", "api", "web", "automation"],
|
|
4
6
|
"type": "module",
|
|
5
7
|
"main": "./dist/index.js",
|
|
6
8
|
"types": "./dist/index.d.ts",
|
|
@@ -23,10 +25,10 @@
|
|
|
23
25
|
"start": "bun run dist/cli.js"
|
|
24
26
|
},
|
|
25
27
|
"dependencies": {
|
|
26
|
-
"@femtomc/mu-agent": "26.2.
|
|
27
|
-
"@femtomc/mu-control-plane": "26.2.
|
|
28
|
-
"@femtomc/mu-core": "26.2.
|
|
29
|
-
"@femtomc/mu-forum": "26.2.
|
|
30
|
-
"@femtomc/mu-issue": "26.2.
|
|
28
|
+
"@femtomc/mu-agent": "26.2.39",
|
|
29
|
+
"@femtomc/mu-control-plane": "26.2.39",
|
|
30
|
+
"@femtomc/mu-core": "26.2.39",
|
|
31
|
+
"@femtomc/mu-forum": "26.2.39",
|
|
32
|
+
"@femtomc/mu-issue": "26.2.39"
|
|
31
33
|
}
|
|
32
34
|
}
|