@moxt-ai/mobius 0.0.11 → 0.0.12

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/cli.js CHANGED
@@ -2977,7 +2977,7 @@ async function claimPairing(options, defaultWorkspace, localAgents, installableA
2977
2977
  id: agent.id,
2978
2978
  label: agent.label
2979
2979
  }));
2980
- const endpoint = new URL("/api/pairings/claim", options.relayOrigin);
2980
+ const endpoint = new URL("/mobius/api/pairings/claim", options.relayOrigin);
2981
2981
  let response;
2982
2982
  try {
2983
2983
  response = await fetch2(endpoint, {
@@ -3114,7 +3114,7 @@ function assertInventoryUsable(inventory) {
3114
3114
  function buildPairedDaemon(connection, connectionPath, inventory) {
3115
3115
  assertInventoryUsable(inventory);
3116
3116
  const relayUrl = new URL(
3117
- `/api/channels/${encodeURIComponent(connection.channelId)}/daemon`,
3117
+ `/mobius/api/channels/${encodeURIComponent(connection.channelId)}/daemon`,
3118
3118
  connection.relayOrigin
3119
3119
  );
3120
3120
  relayUrl.protocol = relayUrl.protocol === "https:" ? "wss:" : "ws:";
@@ -3194,6 +3194,7 @@ async function resumeLocalMachine(arguments_, signal = new AbortController().sig
3194
3194
 
3195
3195
  // src/run-daemon.ts
3196
3196
  import { basename as basename3 } from "node:path";
3197
+ import { styleText } from "node:util";
3197
3198
 
3198
3199
  // ../../node_modules/.pnpm/zod@4.5.4/node_modules/zod/v4/classic/external.js
3199
3200
  var external_exports = {};
@@ -29569,10 +29570,11 @@ function waitForRelayRetry(signal, timer) {
29569
29570
  signal.addEventListener("abort", finish, { once: true });
29570
29571
  });
29571
29572
  }
29572
- async function runRelayConnection(config2, directories, audit, sessions, installations, installationObserver, nativeSessions, outbox, signal, timer) {
29573
+ async function runRelayConnection(config2, directories, audit, sessions, installations, installationObserver, nativeSessions, outbox, onConnected, signal, timer) {
29573
29574
  const relayUrl = new URL(config2.relayUrl);
29574
29575
  relayUrl.searchParams.set("liveness", "1");
29575
29576
  const socket = await connectRelay(relayUrl, signal);
29577
+ onConnected();
29576
29578
  const activeTurns = /* @__PURE__ */ new Map();
29577
29579
  const activeAttemptIds = /* @__PURE__ */ new Map();
29578
29580
  const connectionController = new AbortController();
@@ -30007,6 +30009,24 @@ async function runDaemon(config2, audit, signal, timer = systemDaemonTimer) {
30007
30009
  installationAudit
30008
30010
  );
30009
30011
  let retryAnnounced = false;
30012
+ let connectionAnnounced = false;
30013
+ const announceConnection = () => {
30014
+ if (connectionAnnounced) {
30015
+ return;
30016
+ }
30017
+ connectionAnnounced = true;
30018
+ const reconnectCommand = `npx --yes @moxt-ai/mobius start --channel ${config2.channelId}`;
30019
+ process.stdout.write("Mobius daemon connected to the relay.\n\n");
30020
+ process.stdout.write(
30021
+ `${styleText(
30022
+ ["bold", "yellow"],
30023
+ `Reconnect this channel later:
30024
+ ${reconnectCommand}`
30025
+ )}
30026
+
30027
+ `
30028
+ );
30029
+ };
30010
30030
  try {
30011
30031
  while (!signal.aborted) {
30012
30032
  try {
@@ -30020,6 +30040,7 @@ async function runDaemon(config2, audit, signal, timer = systemDaemonTimer) {
30020
30040
  installationObserver,
30021
30041
  nativeSessions,
30022
30042
  outbox,
30043
+ announceConnection,
30023
30044
  signal,
30024
30045
  timer
30025
30046
  );