@femtomc/mu-server 26.2.42 → 26.2.43

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 CHANGED
@@ -115,7 +115,7 @@ 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 operator chat):
118
+ The easiest way to run the server with the bundled web interface (and default terminal operator session):
119
119
 
120
120
  ```bash
121
121
  # From any mu repository
@@ -124,7 +124,7 @@ mu serve --no-open # Skip browser auto-open (headless/SSH)
124
124
  mu serve --port 8080 # Custom shared API/web UI port
125
125
  ```
126
126
 
127
- Type `/exit` (or press Ctrl+C) to stop both the chat session and server.
127
+ Type `/exit` (or press Ctrl+C) to stop both the operator session and server.
128
128
 
129
129
  ### Standalone Server
130
130
 
@@ -1,4 +1,4 @@
1
- import { ApprovedCommandBroker, CommandContextResolver, MessagingOperatorRuntime, PiMessagingOperatorBackend, serveExtensionPaths, } from "@femtomc/mu-agent";
1
+ import { ApprovedCommandBroker, CommandContextResolver, MessagingOperatorRuntime, PiMessagingOperatorBackend, operatorExtensionPaths, } from "@femtomc/mu-agent";
2
2
  import { ControlPlaneCommandPipeline, ControlPlaneOutbox, ControlPlaneOutboxDispatcher, correlationFromCommandRecord, ControlPlaneRuntime, DiscordControlPlaneAdapter, getControlPlanePaths, SlackControlPlaneAdapter, TelegramControlPlaneAdapter, } from "@femtomc/mu-control-plane";
3
3
  import { DEFAULT_MU_CONFIG } from "./config.js";
4
4
  import { ControlPlaneRunSupervisor, } from "./run_supervisor.js";
@@ -145,7 +145,7 @@ function buildMessagingOperatorRuntime(opts) {
145
145
  new PiMessagingOperatorBackend({
146
146
  provider: opts.config.operator.provider ?? undefined,
147
147
  model: opts.config.operator.model ?? undefined,
148
- extensionPaths: serveExtensionPaths,
148
+ extensionPaths: operatorExtensionPaths,
149
149
  });
150
150
  return new MessagingOperatorRuntime({
151
151
  backend,
@@ -167,6 +167,7 @@ export async function bootstrapControlPlane(opts) {
167
167
  let pipeline = null;
168
168
  let runSupervisor = null;
169
169
  let drainInterval = null;
170
+ const adapterMap = new Map();
170
171
  try {
171
172
  await runtime.start();
172
173
  const operator = opts.operatorRuntime !== undefined
@@ -293,7 +294,6 @@ export async function bootstrapControlPlane(opts) {
293
294
  });
294
295
  await pipeline.start();
295
296
  let telegramBotToken = null;
296
- const adapterMap = new Map();
297
297
  for (const d of detected) {
298
298
  let adapter;
299
299
  switch (d.name) {
@@ -317,6 +317,10 @@ export async function bootstrapControlPlane(opts) {
317
317
  outbox,
318
318
  webhookSecret: d.webhookSecret,
319
319
  botUsername: d.botUsername ?? undefined,
320
+ deferredIngress: true,
321
+ onOutboxEnqueued: () => {
322
+ scheduleOutboxDrainRef?.();
323
+ },
320
324
  });
321
325
  if (d.botToken) {
322
326
  telegramBotToken = d.botToken;
@@ -465,6 +469,14 @@ export async function bootstrapControlPlane(opts) {
465
469
  clearInterval(drainInterval);
466
470
  drainInterval = null;
467
471
  }
472
+ for (const { adapter } of adapterMap.values()) {
473
+ try {
474
+ await adapter.stop?.();
475
+ }
476
+ catch {
477
+ // Best effort adapter cleanup.
478
+ }
479
+ }
468
480
  await runSupervisor?.stop();
469
481
  try {
470
482
  await pipeline?.stop();
@@ -480,6 +492,14 @@ export async function bootstrapControlPlane(opts) {
480
492
  clearInterval(drainInterval);
481
493
  drainInterval = null;
482
494
  }
495
+ for (const { adapter } of adapterMap.values()) {
496
+ try {
497
+ await adapter.stop?.();
498
+ }
499
+ catch {
500
+ // Best effort cleanup.
501
+ }
502
+ }
483
503
  try {
484
504
  await runSupervisor?.stop();
485
505
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@femtomc/mu-server",
3
- "version": "26.2.42",
3
+ "version": "26.2.43",
4
4
  "description": "HTTP API server for mu status, work items, messaging setup, and web UI.",
5
5
  "keywords": [
6
6
  "mu",
@@ -31,10 +31,10 @@
31
31
  "start": "bun run dist/cli.js"
32
32
  },
33
33
  "dependencies": {
34
- "@femtomc/mu-agent": "26.2.42",
35
- "@femtomc/mu-control-plane": "26.2.42",
36
- "@femtomc/mu-core": "26.2.42",
37
- "@femtomc/mu-forum": "26.2.42",
38
- "@femtomc/mu-issue": "26.2.42"
34
+ "@femtomc/mu-agent": "26.2.43",
35
+ "@femtomc/mu-control-plane": "26.2.43",
36
+ "@femtomc/mu-core": "26.2.43",
37
+ "@femtomc/mu-forum": "26.2.43",
38
+ "@femtomc/mu-issue": "26.2.43"
39
39
  }
40
40
  }