@moxt-ai/mobius 0.0.400 → 0.0.401
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/{chunk-QYYMBZ56.js → chunk-6XG7XQ36.js} +2 -2
- package/dist/{chunk-QYYMBZ56.js.map → chunk-6XG7XQ36.js.map} +1 -1
- package/dist/{chunk-VAIQ6KYK.js → chunk-IWT4C7CT.js} +7 -2
- package/dist/cli/handler/agents/index.d.ts.map +1 -1
- package/dist/cli/handler/agents/index.js +2 -1
- package/dist/cli/handler/agents/index.js.map +1 -1
- package/dist/cli/handler/pair/remove.d.ts.map +1 -1
- package/dist/cli/handler/pair/remove.js +6 -0
- package/dist/cli/handler/pair/remove.js.map +1 -1
- package/dist/{cli-VJHRRDWH.js → cli-A2ZF2SX5.js} +137 -115
- package/dist/cli-A2ZF2SX5.js.map +7 -0
- package/dist/cli.js +2 -2
- package/dist/daemon/config.js +2 -2
- package/dist/daemon/lifecycle/daemon.d.ts.map +1 -1
- package/dist/daemon/lifecycle/daemon.js +0 -4
- package/dist/daemon/lifecycle/daemon.js.map +1 -1
- package/dist/daemon/pairing/pair-local-machine.d.ts +0 -1
- package/dist/daemon/pairing/pair-local-machine.d.ts.map +1 -1
- package/dist/daemon/pairing/pair-local-machine.js +5 -12
- package/dist/daemon/pairing/pair-local-machine.js.map +1 -1
- package/dist/engine.js +2 -2
- package/dist/storage/daemon/current-data.d.ts +9 -0
- package/dist/storage/daemon/current-data.d.ts.map +1 -0
- package/dist/storage/daemon/current-data.js +94 -0
- package/dist/storage/daemon/current-data.js.map +1 -0
- package/dist/storage/daemon/pairing-copies.d.ts +4 -0
- package/dist/storage/daemon/pairing-copies.d.ts.map +1 -0
- package/dist/storage/daemon/pairing-copies.js +66 -0
- package/dist/storage/daemon/pairing-copies.js.map +1 -0
- package/dist/storage/state-directory.d.ts +2 -2
- package/dist/storage/state-root-layout.d.ts +2 -2
- package/dist/storage/state-root-layout.d.ts.map +1 -1
- package/dist/storage/state-root-layout.js +2 -2
- package/dist/storage/state-root-layout.js.map +1 -1
- package/package.json +1 -1
- package/dist/cli-VJHRRDWH.js.map +0 -7
- package/dist/daemon/upgrades/data.d.ts +0 -3
- package/dist/daemon/upgrades/data.d.ts.map +0 -1
- package/dist/daemon/upgrades/data.js +0 -22
- package/dist/daemon/upgrades/data.js.map +0 -1
- package/dist/storage/daemon/version-data.d.ts +0 -18
- package/dist/storage/daemon/version-data.d.ts.map +0 -1
- package/dist/storage/daemon/version-data.js +0 -131
- package/dist/storage/daemon/version-data.js.map +0 -1
- /package/dist/{chunk-VAIQ6KYK.js.map → chunk-IWT4C7CT.js.map} +0 -0
|
@@ -80,7 +80,7 @@ var __callDispose = (stack, error, hasError) => {
|
|
|
80
80
|
// package.json
|
|
81
81
|
var package_default = {
|
|
82
82
|
name: "@moxt-ai/mobius",
|
|
83
|
-
version: "0.0.
|
|
83
|
+
version: "0.0.401",
|
|
84
84
|
description: "Mobius CLI for pairing and running local AI agent services.",
|
|
85
85
|
type: "module",
|
|
86
86
|
bin: {
|
|
@@ -171,4 +171,4 @@ export {
|
|
|
171
171
|
__callDispose,
|
|
172
172
|
package_default
|
|
173
173
|
};
|
|
174
|
-
//# sourceMappingURL=chunk-
|
|
174
|
+
//# sourceMappingURL=chunk-6XG7XQ36.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../package.json"],
|
|
4
|
-
"sourcesContent": ["{\n \"name\": \"@moxt-ai/mobius\",\n \"version\": \"0.0.
|
|
4
|
+
"sourcesContent": ["{\n \"name\": \"@moxt-ai/mobius\",\n \"version\": \"0.0.401\",\n \"description\": \"Mobius CLI for pairing and running local AI agent services.\",\n \"type\": \"module\",\n \"bin\": {\n \"mobius\": \"dist/cli.js\"\n },\n \"exports\": {\n \"./engine\": {\n \"mobius-source\": \"./src/exports/engine.ts\",\n \"types\": \"./dist/exports/engine.d.ts\",\n \"default\": \"./dist/engine.js\"\n }\n },\n \"files\": [\n \"dist\",\n \"NOTICE\",\n \"THIRD-PARTY-NOTICES.txt\"\n ],\n \"engines\": {\n \"node\": \">=22.19.0\"\n },\n \"publishConfig\": {\n \"access\": \"public\",\n \"exports\": {\n \"./engine\": {\n \"types\": \"./dist/exports/engine.d.ts\",\n \"import\": \"./dist/engine.js\",\n \"default\": \"./dist/engine.js\"\n }\n }\n },\n \"repository\": {\n \"type\": \"git\",\n \"url\": \"git+https://github.com/moxt-ai/mobius.git\",\n \"directory\": \"packages/cli\"\n },\n \"scripts\": {\n \"prebuild\": \"tsc --project src/engine/acp/harness/claude/upstream/tsconfig.json && tsc --project src/engine/acp/harness/pi/upstream/tsconfig.json\",\n \"build\": \"node scripts/build.ts && tsc --project tsconfig.build.json\",\n \"dev\": \"node --watch src/cli/entrypoint.ts\",\n \"pretypecheck\": \"tsc --project src/engine/acp/harness/claude/upstream/tsconfig.json && tsc --project src/engine/acp/harness/pi/upstream/tsconfig.json\",\n \"prepack\": \"pnpm build\",\n \"start\": \"node dist/cli.js\",\n \"typecheck\": \"tsc --project tsconfig.json && tsc --project tests/tsconfig.json\",\n \"pretest:controlled\": \"pnpm build\",\n \"test:controlled\": \"vitest run tests/sessions tests/runtime\",\n \"pretest:manual\": \"pnpm pretest:controlled\",\n \"test:manual\": \"vitest run tests/manual\",\n \"pretest:agents\": \"pnpm build\",\n \"test:agents\": \"vitest run tests/agents --maxWorkers=2\",\n \"pretest:pressure\": \"tsc --project src/engine/acp/harness/claude/upstream/tsconfig.json && tsc --project src/engine/acp/harness/pi/upstream/tsconfig.json\",\n \"test:pressure\": \"node tests/pressure/concurrent-sessions.mjs\"\n },\n \"dependencies\": {\n \"@agentclientprotocol/sdk\": \"^1.4.0\",\n \"@anthropic-ai/claude-agent-sdk\": \"0.3.257\",\n \"commander\": \"15.0.0\",\n \"semver\": \"^7.8.5\",\n \"undici\": \"8.12.2\",\n \"zod\": \"^4.6.7\"\n },\n \"devDependencies\": {\n \"@anthropic-ai/sdk\": \"0.122.0\",\n \"@moxt-ai/mobius-sdk\": \"workspace:*\",\n \"@moxt-ai/mobius-test\": \"workspace:*\",\n \"@types/node\": \"^24.13.5\",\n \"@types/semver\": \"^7.8.0\",\n \"@types/ws\": \"^8.18.1\",\n \"drizzle-kit\": \"1.0.0-rc.4\",\n \"drizzle-orm\": \"1.0.0-rc.4\",\n \"esbuild\": \"0.28.2\",\n \"valibot\": \"1.5.0\",\n \"ws\": \"^8.21.3\"\n },\n \"keywords\": [],\n \"author\": \"Moxt\",\n \"license\": \"Apache-2.0\",\n \"bugs\": {\n \"url\": \"https://github.com/moxt-ai/mobius/issues\"\n },\n \"homepage\": \"https://github.com/moxt-ai/mobius#readme\"\n}\n"],
|
|
5
5
|
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA,EACI,MAAQ;AAAA,EACR,SAAW;AAAA,EACX,aAAe;AAAA,EACf,MAAQ;AAAA,EACR,KAAO;AAAA,IACH,QAAU;AAAA,EACd;AAAA,EACA,SAAW;AAAA,IACP,YAAY;AAAA,MACR,iBAAiB;AAAA,MACjB,OAAS;AAAA,MACT,SAAW;AAAA,IACf;AAAA,EACJ;AAAA,EACA,OAAS;AAAA,IACL;AAAA,IACA;AAAA,IACA;AAAA,EACJ;AAAA,EACA,SAAW;AAAA,IACP,MAAQ;AAAA,EACZ;AAAA,EACA,eAAiB;AAAA,IACb,QAAU;AAAA,IACV,SAAW;AAAA,MACP,YAAY;AAAA,QACR,OAAS;AAAA,QACT,QAAU;AAAA,QACV,SAAW;AAAA,MACf;AAAA,IACJ;AAAA,EACJ;AAAA,EACA,YAAc;AAAA,IACV,MAAQ;AAAA,IACR,KAAO;AAAA,IACP,WAAa;AAAA,EACjB;AAAA,EACA,SAAW;AAAA,IACP,UAAY;AAAA,IACZ,OAAS;AAAA,IACT,KAAO;AAAA,IACP,cAAgB;AAAA,IAChB,SAAW;AAAA,IACX,OAAS;AAAA,IACT,WAAa;AAAA,IACb,sBAAsB;AAAA,IACtB,mBAAmB;AAAA,IACnB,kBAAkB;AAAA,IAClB,eAAe;AAAA,IACf,kBAAkB;AAAA,IAClB,eAAe;AAAA,IACf,oBAAoB;AAAA,IACpB,iBAAiB;AAAA,EACrB;AAAA,EACA,cAAgB;AAAA,IACZ,4BAA4B;AAAA,IAC5B,kCAAkC;AAAA,IAClC,WAAa;AAAA,IACb,QAAU;AAAA,IACV,QAAU;AAAA,IACV,KAAO;AAAA,EACX;AAAA,EACA,iBAAmB;AAAA,IACf,qBAAqB;AAAA,IACrB,uBAAuB;AAAA,IACvB,wBAAwB;AAAA,IACxB,eAAe;AAAA,IACf,iBAAiB;AAAA,IACjB,aAAa;AAAA,IACb,eAAe;AAAA,IACf,eAAe;AAAA,IACf,SAAW;AAAA,IACX,SAAW;AAAA,IACX,IAAM;AAAA,EACV;AAAA,EACA,UAAY,CAAC;AAAA,EACb,QAAU;AAAA,EACV,SAAW;AAAA,EACX,MAAQ;AAAA,IACJ,KAAO;AAAA,EACX;AAAA,EACA,UAAY;AAChB;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -3,7 +3,7 @@ import {
|
|
|
3
3
|
__export,
|
|
4
4
|
__using,
|
|
5
5
|
package_default
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-6XG7XQ36.js";
|
|
7
7
|
|
|
8
8
|
// src/engine/runtime/relay/runtime-revocation.ts
|
|
9
9
|
var runtimeRevocationCloseCode = 1008;
|
|
@@ -93841,6 +93841,11 @@ export {
|
|
|
93841
93841
|
external_exports,
|
|
93842
93842
|
isNodeError,
|
|
93843
93843
|
installationPointerPath,
|
|
93844
|
+
connectionFilePath,
|
|
93845
|
+
channelIndexFilePath,
|
|
93846
|
+
readInstallationFile,
|
|
93847
|
+
removeInstallationFile,
|
|
93848
|
+
isIdentifier,
|
|
93844
93849
|
decodeRuntimeUpgradeVersion,
|
|
93845
93850
|
ensurePrivateDirectory,
|
|
93846
93851
|
platformSupportFor,
|
|
@@ -93877,4 +93882,4 @@ export {
|
|
|
93877
93882
|
* MIT Licensed
|
|
93878
93883
|
*)
|
|
93879
93884
|
*/
|
|
93880
|
-
//# sourceMappingURL=chunk-
|
|
93885
|
+
//# sourceMappingURL=chunk-IWT4C7CT.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/cli/handler/agents/index.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/cli/handler/agents/index.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAMzC,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAUnD,wBAAgB,qBAAqB,CAAC,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,UAAU,GAAG,IAAI,CA6BjF"}
|
|
@@ -3,6 +3,7 @@ import { openMobiusCliInstallation } from "../../../daemon/pairing/pair-local-ma
|
|
|
3
3
|
import { discoverLocalAgentInventory } from "../../../engine/agent/discovery/discover-local-agents.js";
|
|
4
4
|
import { RuntimeLocalContext } from "../../../engine/runtime/config.js";
|
|
5
5
|
import { ensurePrivateDirectory } from "../../../engine/storage/files/local-files.js";
|
|
6
|
+
import { readStateDirectory } from "../../../storage/state-directory.js";
|
|
6
7
|
import { valueOption } from "../../util/options.js";
|
|
7
8
|
import { formatAgentDiagnostics, writeAgentDiagnostics } from "./logic/agent-diagnostics.js";
|
|
8
9
|
export function registerAgentsHandler(program, context) {
|
|
@@ -15,7 +16,7 @@ export function registerAgentsHandler(program, context) {
|
|
|
15
16
|
.action(async (options) => {
|
|
16
17
|
const installation = await openMobiusCliInstallation(context.shutdownSignal, process.env);
|
|
17
18
|
const localContext = new RuntimeLocalContext(installation.stateDirectory, process.env);
|
|
18
|
-
const defaultWorkspace = join(
|
|
19
|
+
const defaultWorkspace = join(readStateDirectory(), "workspace");
|
|
19
20
|
await ensurePrivateDirectory(defaultWorkspace);
|
|
20
21
|
const inventory = await discoverLocalAgentInventory({
|
|
21
22
|
defaultWorkspace,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/cli/handler/agents/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAE1C,OAAO,EAAE,yBAAyB,EAAE,MAAM,+CAA+C,CAAC;AAC1F,OAAO,EAAE,2BAA2B,EAAE,MAAM,0DAA0D,CAAC;AACvG,OAAO,EAAE,mBAAmB,EAAE,MAAM,mCAAmC,CAAC;AACxE,OAAO,EAAE,sBAAsB,EAAE,MAAM,8CAA8C,CAAC;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/cli/handler/agents/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAE1C,OAAO,EAAE,yBAAyB,EAAE,MAAM,+CAA+C,CAAC;AAC1F,OAAO,EAAE,2BAA2B,EAAE,MAAM,0DAA0D,CAAC;AACvG,OAAO,EAAE,mBAAmB,EAAE,MAAM,mCAAmC,CAAC;AACxE,OAAO,EAAE,sBAAsB,EAAE,MAAM,8CAA8C,CAAC;AACtF,OAAO,EAAE,kBAAkB,EAAE,MAAM,qCAAqC,CAAC;AAEzE,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AACpD,OAAO,EAAE,sBAAsB,EAAE,qBAAqB,EAAE,MAAM,8BAA8B,CAAC;AAQ7F,MAAM,UAAU,qBAAqB,CAAC,OAAgB,EAAE,OAAmB;IACvE,OAAO;SACF,OAAO,CAAC,QAAQ,CAAC;SACjB,WAAW,CAAC,sDAAsD,CAAC;SACnE,MAAM,CAAC,QAAQ,EAAE,mCAAmC,CAAC;SACrD,SAAS,CAAC,WAAW,CAAC,oCAAoC,EAAE,8CAA8C,CAAC,CAAC;SAC5G,MAAM,CAAC,WAAW,EAAE,oCAAoC,CAAC;SACzD,MAAM,CAAC,KAAK,EAAE,OAAqB,EAAE,EAAE;QACpC,MAAM,YAAY,GAAG,MAAM,yBAAyB,CAAC,OAAO,CAAC,cAAc,EAAE,OAAO,CAAC,GAAG,CAAC,CAAC;QAC1F,MAAM,YAAY,GAAG,IAAI,mBAAmB,CAAC,YAAY,CAAC,cAAc,EAAE,OAAO,CAAC,GAAG,CAAC,CAAC;QACvF,MAAM,gBAAgB,GAAG,IAAI,CAAC,kBAAkB,EAAE,EAAE,WAAW,CAAC,CAAC;QACjE,MAAM,sBAAsB,CAAC,gBAAgB,CAAC,CAAC;QAC/C,MAAM,SAAS,GAAG,MAAM,2BAA2B,CAAC;YAChD,gBAAgB;YAChB,aAAa,EAAE,YAAY,CAAC,cAAc;YAC1C,WAAW,EAAE,YAAY,CAAC,sBAAsB;YAChD,MAAM,EAAE,OAAO,CAAC,cAAc;SACjC,CAAC,CAAC;QACH,IAAI,OAAO,CAAC,UAAU,KAAK,SAAS,EAAE,CAAC;YACnC,MAAM,qBAAqB,CACvB,OAAO,CAAC,OAAO,CAAC,UAAU,CAAC,EAC3B,SAAS,EACT,OAAO,CAAC,OAAO,KAAK,IAAI,EACxB,OAAO,CAAC,cAAc,CACzB,CAAC;YACF,OAAO;QACX,CAAC;QACD,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,sBAAsB,CAAC,SAAS,EAAE,OAAO,CAAC,IAAI,KAAK,IAAI,EAAE,OAAO,CAAC,OAAO,KAAK,IAAI,CAAC,CAAC,CAAC;IAC7G,CAAC,CAAC,CAAC;AACX,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"remove.d.ts","sourceRoot":"","sources":["../../../../src/cli/handler/pair/remove.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"remove.d.ts","sourceRoot":"","sources":["../../../../src/cli/handler/pair/remove.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AASzC,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAInD,wBAAgB,yBAAyB,CAAC,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,UAAU,GAAG,IAAI,CAuBrF"}
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import { reloadDaemon } from "../../../daemon/lifecycle/daemon.js";
|
|
2
2
|
import { openMobiusCliInstallation, openMobiusControlInstallation, } from "../../../daemon/pairing/pair-local-machine.js";
|
|
3
|
+
import { removeHistoricalPairingFiles } from "../../../storage/daemon/pairing-copies.js";
|
|
4
|
+
import { readStateDirectory } from "../../../storage/state-directory.js";
|
|
3
5
|
import { valueOption } from "../../util/options.js";
|
|
4
6
|
export function registerPairRemoveCommand(command, context) {
|
|
5
7
|
command
|
|
@@ -8,6 +10,10 @@ export function registerPairRemoveCommand(command, context) {
|
|
|
8
10
|
.addOption(valueOption("--connection <connection-id>", "saved Runtime connection identifier", true))
|
|
9
11
|
.action(async (options) => {
|
|
10
12
|
const installation = await openMobiusCliInstallation(context.shutdownSignal, process.env);
|
|
13
|
+
const connection = await installation.readConnection(options.connection, context.shutdownSignal);
|
|
14
|
+
// Keep the authoritative record until cleanup succeeds, so a failed
|
|
15
|
+
// cleanup can be retried without losing the pairing's identity.
|
|
16
|
+
await removeHistoricalPairingFiles(readStateDirectory(), installation.stateDirectory, installation.installationId, connection.connectionId, connection.channelId, context.shutdownSignal);
|
|
11
17
|
await installation.removeConnection(options.connection, context.shutdownSignal);
|
|
12
18
|
const control = await openMobiusControlInstallation(context.shutdownSignal, process.env);
|
|
13
19
|
await reloadDaemon(control.stateDirectory, context.shutdownSignal);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"remove.js","sourceRoot":"","sources":["../../../../src/cli/handler/pair/remove.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,YAAY,EAAE,MAAM,qCAAqC,CAAC;AACnE,OAAO,EACH,yBAAyB,EACzB,6BAA6B,GAChC,MAAM,+CAA+C,CAAC;
|
|
1
|
+
{"version":3,"file":"remove.js","sourceRoot":"","sources":["../../../../src/cli/handler/pair/remove.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,YAAY,EAAE,MAAM,qCAAqC,CAAC;AACnE,OAAO,EACH,yBAAyB,EACzB,6BAA6B,GAChC,MAAM,+CAA+C,CAAC;AACvD,OAAO,EAAE,4BAA4B,EAAE,MAAM,2CAA2C,CAAC;AACzF,OAAO,EAAE,kBAAkB,EAAE,MAAM,qCAAqC,CAAC;AAEzE,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AAGpD,MAAM,UAAU,yBAAyB,CAAC,OAAgB,EAAE,OAAmB;IAC3E,OAAO;SACF,OAAO,CAAC,QAAQ,CAAC;SACjB,WAAW,CAAC,wBAAwB,CAAC;SACrC,SAAS,CAAC,WAAW,CAAC,8BAA8B,EAAE,qCAAqC,EAAE,IAAI,CAAC,CAAC;SACnG,MAAM,CAAC,KAAK,EAAE,OAA0B,EAAE,EAAE;QACzC,MAAM,YAAY,GAAG,MAAM,yBAAyB,CAAC,OAAO,CAAC,cAAc,EAAE,OAAO,CAAC,GAAG,CAAC,CAAC;QAC1F,MAAM,UAAU,GAAG,MAAM,YAAY,CAAC,cAAc,CAAC,OAAO,CAAC,UAAU,EAAE,OAAO,CAAC,cAAc,CAAC,CAAC;QACjG,oEAAoE;QACpE,gEAAgE;QAChE,MAAM,4BAA4B,CAC9B,kBAAkB,EAAE,EACpB,YAAY,CAAC,cAAc,EAC3B,YAAY,CAAC,cAAc,EAC3B,UAAU,CAAC,YAAY,EACvB,UAAU,CAAC,SAAS,EACpB,OAAO,CAAC,cAAc,CACzB,CAAC;QACF,MAAM,YAAY,CAAC,gBAAgB,CAAC,OAAO,CAAC,UAAU,EAAE,OAAO,CAAC,cAAc,CAAC,CAAC;QAChF,MAAM,OAAO,GAAG,MAAM,6BAA6B,CAAC,OAAO,CAAC,cAAc,EAAE,OAAO,CAAC,GAAG,CAAC,CAAC;QACzF,MAAM,YAAY,CAAC,OAAO,CAAC,cAAc,EAAE,OAAO,CAAC,cAAc,CAAC,CAAC;QACnE,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,oBAAoB,OAAO,CAAC,UAAU,IAAI,CAAC,CAAC;IACrE,CAAC,CAAC,CAAC;AACX,CAAC"}
|
|
@@ -10,26 +10,31 @@ import {
|
|
|
10
10
|
RuntimeTurnActivity,
|
|
11
11
|
UnsupportedAgentVersion,
|
|
12
12
|
WORKER_LIFECYCLE_LOG_FILENAME,
|
|
13
|
+
channelIndexFilePath,
|
|
14
|
+
connectionFilePath,
|
|
13
15
|
decodeRuntimeUpgradeVersion,
|
|
14
16
|
describeRelayFailure,
|
|
15
17
|
discoverLocalAgentInventory,
|
|
16
18
|
ensurePrivateDirectory,
|
|
17
19
|
external_exports,
|
|
18
20
|
installationPointerPath,
|
|
21
|
+
isIdentifier,
|
|
19
22
|
isNodeError,
|
|
20
23
|
logDirectory,
|
|
21
24
|
parsePairingCode,
|
|
22
25
|
parseRelayOrigin,
|
|
23
26
|
platformSupportFor,
|
|
24
27
|
prepareRuntimeConnection,
|
|
28
|
+
readInstallationFile,
|
|
25
29
|
refreshAgentCatalog,
|
|
30
|
+
removeInstallationFile,
|
|
26
31
|
unhandledRejectionLogFilename,
|
|
27
32
|
validateLocalPath,
|
|
28
33
|
validatePairingId
|
|
29
|
-
} from "./chunk-
|
|
34
|
+
} from "./chunk-IWT4C7CT.js";
|
|
30
35
|
import {
|
|
31
36
|
package_default
|
|
32
|
-
} from "./chunk-
|
|
37
|
+
} from "./chunk-6XG7XQ36.js";
|
|
33
38
|
|
|
34
39
|
// ../../node_modules/.pnpm/commander@15.0.0/node_modules/commander/lib/error.js
|
|
35
40
|
var CommanderError = class extends Error {
|
|
@@ -3416,11 +3421,11 @@ function readStateDirectory(environment = process.env) {
|
|
|
3416
3421
|
|
|
3417
3422
|
// src/storage/state-root-layout.ts
|
|
3418
3423
|
var STATE_ROOT_LAYOUT = Object.freeze({
|
|
3419
|
-
/** Names the
|
|
3424
|
+
/** Names the shared data container in the format understood by installed CLIs. */
|
|
3420
3425
|
currentData: "current-data.txt",
|
|
3421
3426
|
/** Applications' installations: `installations/<application>/<installation>`. */
|
|
3422
3427
|
installations: "installations",
|
|
3423
|
-
/**
|
|
3428
|
+
/** Existing data containers; executable upgrades reuse the current one. */
|
|
3424
3429
|
versions: "versions"
|
|
3425
3430
|
});
|
|
3426
3431
|
|
|
@@ -3477,32 +3482,23 @@ import { join as join6, resolve as resolve2 } from "node:path";
|
|
|
3477
3482
|
// src/daemon/pairing/pair-local-machine.ts
|
|
3478
3483
|
import { join as join5 } from "node:path";
|
|
3479
3484
|
|
|
3480
|
-
// src/
|
|
3485
|
+
// src/daemon/config.ts
|
|
3486
|
+
import { join as join4 } from "node:path";
|
|
3487
|
+
|
|
3488
|
+
// src/storage/daemon/current-data.ts
|
|
3481
3489
|
import { randomUUID } from "node:crypto";
|
|
3482
|
-
import {
|
|
3490
|
+
import { link, readdir, readFile as readFile2, rm, writeFile } from "node:fs/promises";
|
|
3483
3491
|
import { join as join3 } from "node:path";
|
|
3484
|
-
var
|
|
3492
|
+
var CurrentDataError = class extends Error {
|
|
3485
3493
|
code = "data_inheritance_failed";
|
|
3486
3494
|
};
|
|
3487
|
-
async function prepareVersionDataDirectory(root, version, signal) {
|
|
3488
|
-
signal.throwIfAborted();
|
|
3489
|
-
const directory = join3(root, STATE_ROOT_LAYOUT.versions, decodeRuntimeUpgradeVersion(version));
|
|
3490
|
-
try {
|
|
3491
|
-
await ensurePrivateDirectory(directory);
|
|
3492
|
-
await validateLocalPath(directory, true, true, signal);
|
|
3493
|
-
} catch (cause) {
|
|
3494
|
-
signal.throwIfAborted();
|
|
3495
|
-
throw new DataInheritanceError("The version data directory cannot be initialized", { cause });
|
|
3496
|
-
}
|
|
3497
|
-
return directory;
|
|
3498
|
-
}
|
|
3499
3495
|
async function readCurrentDataVersion(root, signal) {
|
|
3500
3496
|
const pointer = join3(root, STATE_ROOT_LAYOUT.currentData);
|
|
3501
3497
|
try {
|
|
3502
3498
|
await validateLocalPath(pointer, false, true, signal);
|
|
3503
3499
|
const value = (await readFile2(pointer, { encoding: "utf8", signal })).trim();
|
|
3504
3500
|
if (!value.startsWith("versions/")) {
|
|
3505
|
-
throw new
|
|
3501
|
+
throw new CurrentDataError("The current data pointer must name a version directory");
|
|
3506
3502
|
}
|
|
3507
3503
|
return decodeRuntimeUpgradeVersion(value.slice("versions/".length));
|
|
3508
3504
|
} catch (cause) {
|
|
@@ -3512,81 +3508,66 @@ async function readCurrentDataVersion(root, signal) {
|
|
|
3512
3508
|
throw cause;
|
|
3513
3509
|
}
|
|
3514
3510
|
}
|
|
3515
|
-
async function
|
|
3516
|
-
|
|
3517
|
-
|
|
3518
|
-
|
|
3519
|
-
} catch (cause) {
|
|
3520
|
-
if (!isNodeError(cause, "ENOENT")) {
|
|
3521
|
-
throw cause;
|
|
3522
|
-
}
|
|
3523
|
-
return false;
|
|
3524
|
-
}
|
|
3511
|
+
async function prepareDirectory(directory, signal) {
|
|
3512
|
+
signal.throwIfAborted();
|
|
3513
|
+
await ensurePrivateDirectory(directory);
|
|
3514
|
+
await validateLocalPath(directory, true, true, signal);
|
|
3525
3515
|
}
|
|
3526
|
-
async function
|
|
3527
|
-
const versions = join3(root, STATE_ROOT_LAYOUT.versions);
|
|
3528
|
-
const source = join3(versions, sourceVersion);
|
|
3529
|
-
const target = join3(versions, targetVersion);
|
|
3530
|
-
await validateLocalPath(root, true, true, signal);
|
|
3531
|
-
await validateLocalPath(versions, true, true, signal);
|
|
3532
|
-
await validateLocalPath(source, true, true, signal);
|
|
3533
|
-
const staging = await mkdtemp(join3(versions, `.${targetVersion}-`));
|
|
3516
|
+
async function prepareCurrentDataDirectory(root, initialVersion, signal) {
|
|
3534
3517
|
try {
|
|
3535
|
-
await
|
|
3536
|
-
|
|
3537
|
-
|
|
3518
|
+
await prepareDirectory(root, signal);
|
|
3519
|
+
const versions = join3(root, STATE_ROOT_LAYOUT.versions);
|
|
3520
|
+
await prepareDirectory(versions, signal);
|
|
3521
|
+
let current = await readCurrentDataVersion(root, signal);
|
|
3522
|
+
if (current === null) {
|
|
3523
|
+
const candidate = decodeRuntimeUpgradeVersion(initialVersion);
|
|
3524
|
+
await prepareDirectory(join3(versions, candidate), signal);
|
|
3525
|
+
const temporary = join3(root, `.current-data-${randomUUID()}.txt`);
|
|
3526
|
+
try {
|
|
3527
|
+
await writeFile(temporary, `versions/${candidate}
|
|
3528
|
+
`, { mode: 384, flag: "wx", signal });
|
|
3538
3529
|
signal.throwIfAborted();
|
|
3539
|
-
|
|
3540
|
-
|
|
3530
|
+
try {
|
|
3531
|
+
await link(temporary, join3(root, STATE_ROOT_LAYOUT.currentData));
|
|
3532
|
+
} catch (cause) {
|
|
3533
|
+
if (!isNodeError(cause, "EEXIST")) {
|
|
3534
|
+
throw cause;
|
|
3535
|
+
}
|
|
3541
3536
|
}
|
|
3542
|
-
|
|
3537
|
+
} finally {
|
|
3538
|
+
await rm(temporary, { force: true });
|
|
3543
3539
|
}
|
|
3544
|
-
|
|
3545
|
-
|
|
3546
|
-
|
|
3547
|
-
await rename(staging, target);
|
|
3548
|
-
} catch (cause) {
|
|
3549
|
-
if (!isNodeError(cause, "EEXIST") && !isNodeError(cause, "ENOTEMPTY")) {
|
|
3550
|
-
throw cause;
|
|
3540
|
+
current = await readCurrentDataVersion(root, signal);
|
|
3541
|
+
if (current === null) {
|
|
3542
|
+
throw new CurrentDataError("The current data pointer disappeared during initialization");
|
|
3551
3543
|
}
|
|
3552
|
-
await validateLocalPath(target, true, true, signal);
|
|
3553
3544
|
}
|
|
3554
|
-
|
|
3555
|
-
await
|
|
3556
|
-
|
|
3557
|
-
}
|
|
3558
|
-
async function discardVersionData(root, version, signal) {
|
|
3559
|
-
if (await readCurrentDataVersion(root, signal) === version || !await versionDataExists(root, version, signal)) {
|
|
3560
|
-
return;
|
|
3561
|
-
}
|
|
3562
|
-
const versions = join3(root, STATE_ROOT_LAYOUT.versions);
|
|
3563
|
-
const discarded = join3(versions, `.${version}-discarded-${randomUUID()}`);
|
|
3564
|
-
try {
|
|
3565
|
-
await rename(join3(versions, version), discarded);
|
|
3545
|
+
const directory = join3(versions, current);
|
|
3546
|
+
await prepareDirectory(directory, signal);
|
|
3547
|
+
return directory;
|
|
3566
3548
|
} catch (cause) {
|
|
3567
|
-
|
|
3568
|
-
|
|
3569
|
-
}
|
|
3570
|
-
throw cause;
|
|
3549
|
+
signal.throwIfAborted();
|
|
3550
|
+
throw new CurrentDataError("The current data directory cannot be initialized", { cause });
|
|
3571
3551
|
}
|
|
3572
|
-
await rm(discarded, { recursive: true, force: true });
|
|
3573
3552
|
}
|
|
3574
|
-
async function
|
|
3553
|
+
async function listVersionDataDirectories(root, signal) {
|
|
3554
|
+
const versions = join3(root, STATE_ROOT_LAYOUT.versions);
|
|
3575
3555
|
await validateLocalPath(root, true, true, signal);
|
|
3576
|
-
await validateLocalPath(
|
|
3577
|
-
const
|
|
3578
|
-
|
|
3579
|
-
await writeFile(temporary, `versions/${version}
|
|
3580
|
-
`, { mode: 384, flag: "wx", signal });
|
|
3556
|
+
await validateLocalPath(versions, true, true, signal);
|
|
3557
|
+
const directories = [];
|
|
3558
|
+
for (const entry of await readdir(versions, { withFileTypes: true })) {
|
|
3581
3559
|
signal.throwIfAborted();
|
|
3582
|
-
|
|
3583
|
-
|
|
3584
|
-
|
|
3560
|
+
if (!entry.isDirectory()) {
|
|
3561
|
+
continue;
|
|
3562
|
+
}
|
|
3563
|
+
const directory = join3(versions, entry.name);
|
|
3564
|
+
await validateLocalPath(directory, true, true, signal);
|
|
3565
|
+
directories.push(directory);
|
|
3585
3566
|
}
|
|
3567
|
+
return directories;
|
|
3586
3568
|
}
|
|
3587
3569
|
|
|
3588
3570
|
// src/daemon/config.ts
|
|
3589
|
-
import { join as join4 } from "node:path";
|
|
3590
3571
|
function resolveMaxAcpProcesses(environment) {
|
|
3591
3572
|
const configured = environment["MOBIUS_MAX_ACP_PROCESSES"];
|
|
3592
3573
|
if (configured === void 0 || configured === "") {
|
|
@@ -3599,7 +3580,7 @@ function resolveMaxAcpProcesses(environment) {
|
|
|
3599
3580
|
return parsed;
|
|
3600
3581
|
}
|
|
3601
3582
|
async function prepareMobiusEngineDataDir(version, signal, environment) {
|
|
3602
|
-
const directory = await
|
|
3583
|
+
const directory = await prepareCurrentDataDirectory(readStateDirectory(environment), version, signal);
|
|
3603
3584
|
return join4(directory, "installations", "dev.mobius.cli");
|
|
3604
3585
|
}
|
|
3605
3586
|
|
|
@@ -3652,19 +3633,16 @@ async function openMobiusControlInstallation(signal, environment) {
|
|
|
3652
3633
|
return await RuntimeInstallationStore.open(join5(root, "installations", "dev.mobius.cli"), signal);
|
|
3653
3634
|
}
|
|
3654
3635
|
async function openMobiusCliInstallation(signal, environment) {
|
|
3655
|
-
|
|
3656
|
-
|
|
3657
|
-
|
|
3658
|
-
|
|
3659
|
-
async function openMobiusVersionInstallation(version, signal, environment) {
|
|
3660
|
-
return await RuntimeInstallationStore.open(await prepareMobiusEngineDataDir(version, signal, environment), signal);
|
|
3636
|
+
return await RuntimeInstallationStore.open(
|
|
3637
|
+
await prepareMobiusEngineDataDir(package_default.version, signal, environment),
|
|
3638
|
+
signal
|
|
3639
|
+
);
|
|
3661
3640
|
}
|
|
3662
3641
|
async function pairLocalMachine(arguments_, signal = new AbortController().signal) {
|
|
3663
3642
|
const requested = parsePairCommand(arguments_, "");
|
|
3664
|
-
const
|
|
3665
|
-
const engineDataDir = await prepareMobiusEngineDataDir(version, signal, process.env);
|
|
3643
|
+
const engineDataDir = await prepareMobiusEngineDataDir(package_default.version, signal, process.env);
|
|
3666
3644
|
const engine = new MobiusRuntimeEngine({ engineDataDir, agentLaunchEnvironment: process.env });
|
|
3667
|
-
const installation = await
|
|
3645
|
+
const installation = await RuntimeInstallationStore.open(engineDataDir, signal);
|
|
3668
3646
|
if (requested.pairingId.length > 0) {
|
|
3669
3647
|
const existing = await installation.readConnectionForPairing(requested.pairingId, signal);
|
|
3670
3648
|
if (existing !== null) {
|
|
@@ -3683,7 +3661,7 @@ async function pairLocalMachine(arguments_, signal = new AbortController().signa
|
|
|
3683
3661
|
pairingCode: requested.code,
|
|
3684
3662
|
pairingId: requested.pairingId,
|
|
3685
3663
|
relayOrigin: requested.relayOrigin.toString(),
|
|
3686
|
-
defaultWorkspace: arguments_.includes("--workspace") ? requested.workspace : join5(
|
|
3664
|
+
defaultWorkspace: arguments_.includes("--workspace") ? requested.workspace : join5(readStateDirectory(), "workspace")
|
|
3687
3665
|
},
|
|
3688
3666
|
signal
|
|
3689
3667
|
);
|
|
@@ -3846,7 +3824,7 @@ function registerAgentsHandler(program2, context) {
|
|
|
3846
3824
|
program2.command("agents").description("show detected, missing, and integration-ready Agents").option("--json", "write the Agent inventory as JSON").addOption(valueOption("--output-json <existing-file.json>", "write the JSON inventory to an existing file")).option("--verbose", "include per-Agent detection timing").action(async (options) => {
|
|
3847
3825
|
const installation = await openMobiusCliInstallation(context.shutdownSignal, process.env);
|
|
3848
3826
|
const localContext = new RuntimeLocalContext(installation.stateDirectory, process.env);
|
|
3849
|
-
const defaultWorkspace = join6(
|
|
3827
|
+
const defaultWorkspace = join6(readStateDirectory(), "workspace");
|
|
3850
3828
|
await ensurePrivateDirectory(defaultWorkspace);
|
|
3851
3829
|
const inventory = await discoverLocalAgentInventory({
|
|
3852
3830
|
defaultWorkspace,
|
|
@@ -4110,22 +4088,6 @@ async function serveLocalControl(stateDirectory, endpoint, signal, handle, onLis
|
|
|
4110
4088
|
}
|
|
4111
4089
|
}
|
|
4112
4090
|
|
|
4113
|
-
// src/daemon/upgrades/data.ts
|
|
4114
|
-
async function prepareVersionData(version, signal) {
|
|
4115
|
-
signal.throwIfAborted();
|
|
4116
|
-
const root = readStateDirectory();
|
|
4117
|
-
const targetVersion = decodeRuntimeUpgradeVersion(version);
|
|
4118
|
-
const current = await readCurrentDataVersion(root, signal);
|
|
4119
|
-
if (current === null || current === targetVersion) {
|
|
4120
|
-
return;
|
|
4121
|
-
}
|
|
4122
|
-
await discardVersionData(root, targetVersion, signal);
|
|
4123
|
-
await copyVersionData(root, current, targetVersion, signal);
|
|
4124
|
-
}
|
|
4125
|
-
async function recordCurrentData(version, signal) {
|
|
4126
|
-
await writeCurrentDataVersion(readStateDirectory(), decodeRuntimeUpgradeVersion(version), signal);
|
|
4127
|
-
}
|
|
4128
|
-
|
|
4129
4091
|
// src/daemon/lifecycle/unhandled-rejection.ts
|
|
4130
4092
|
var MAXIMUM_REJECTION_LOG_BYTES = 512 * 1024;
|
|
4131
4093
|
var MAXIMUM_REJECTION_TEXT_BYTES = 2048;
|
|
@@ -4289,7 +4251,6 @@ async function runDaemonRuntime(version, combined, shutdown, rejectionGuard, own
|
|
|
4289
4251
|
}
|
|
4290
4252
|
deadline.throwIfAborted();
|
|
4291
4253
|
}
|
|
4292
|
-
await prepareVersionData(version, combined);
|
|
4293
4254
|
const engineDataDir = await prepareMobiusEngineDataDir(version, combined, process.env);
|
|
4294
4255
|
const installation = await RuntimeInstallationStore.open(engineDataDir, combined);
|
|
4295
4256
|
rejectionGuard.bindStateDirectory(control.stateDirectory);
|
|
@@ -4396,7 +4357,6 @@ async function runDaemonRuntime(version, combined, shutdown, rejectionGuard, own
|
|
|
4396
4357
|
};
|
|
4397
4358
|
try {
|
|
4398
4359
|
await reconcile();
|
|
4399
|
-
await recordCurrentData(version, combined);
|
|
4400
4360
|
lifecycleLog.record(
|
|
4401
4361
|
JSON.stringify({
|
|
4402
4362
|
kind: "daemon_ready",
|
|
@@ -5269,7 +5229,7 @@ function registerDiagnoseCommand(program2, context) {
|
|
|
5269
5229
|
import { join as join13, relative as relative2, resolve as resolve4 } from "node:path";
|
|
5270
5230
|
|
|
5271
5231
|
// src/storage/logs/log-files.ts
|
|
5272
|
-
import { lstat as
|
|
5232
|
+
import { lstat, readdir as readdir2, readFile as readFile6 } from "node:fs/promises";
|
|
5273
5233
|
import { join as join12, relative } from "node:path";
|
|
5274
5234
|
var LOG_FILE_NAME_PATTERN = /^[\w.-]{1,128}\.log$/u;
|
|
5275
5235
|
var INSTALLATIONS_DIRECTORY = "installations";
|
|
@@ -5303,7 +5263,7 @@ async function findLogDirectories(root, unreadable, signal) {
|
|
|
5303
5263
|
async function listDirectories(path2, root, unreadable, signal) {
|
|
5304
5264
|
signal.throwIfAborted();
|
|
5305
5265
|
try {
|
|
5306
|
-
const entries = await
|
|
5266
|
+
const entries = await readdir2(path2, { withFileTypes: true });
|
|
5307
5267
|
return entries.filter((entry) => entry.isDirectory() && !entry.isSymbolicLink()).map((entry) => entry.name);
|
|
5308
5268
|
} catch (cause) {
|
|
5309
5269
|
if (!isAbsent(cause)) {
|
|
@@ -5314,7 +5274,7 @@ async function listDirectories(path2, root, unreadable, signal) {
|
|
|
5314
5274
|
}
|
|
5315
5275
|
async function listLogFiles(directory, root, unreadable) {
|
|
5316
5276
|
try {
|
|
5317
|
-
const entries = await
|
|
5277
|
+
const entries = await readdir2(directory, { withFileTypes: true });
|
|
5318
5278
|
return entries.filter((entry) => entry.isFile() && !entry.isSymbolicLink() && LOG_FILE_NAME_PATTERN.test(entry.name)).map((entry) => entry.name).sort();
|
|
5319
5279
|
} catch (cause) {
|
|
5320
5280
|
if (!isAbsent(cause)) {
|
|
@@ -5326,7 +5286,7 @@ async function listLogFiles(directory, root, unreadable) {
|
|
|
5326
5286
|
async function directoryStatus(path2) {
|
|
5327
5287
|
let metadata;
|
|
5328
5288
|
try {
|
|
5329
|
-
metadata = await
|
|
5289
|
+
metadata = await lstat(path2);
|
|
5330
5290
|
} catch (cause) {
|
|
5331
5291
|
return isAbsent(cause) ? "skipped" : "unreadable";
|
|
5332
5292
|
}
|
|
@@ -5338,7 +5298,7 @@ async function directoryStatus(path2) {
|
|
|
5338
5298
|
async function readOwnedLogFile(path2, signal) {
|
|
5339
5299
|
let metadata;
|
|
5340
5300
|
try {
|
|
5341
|
-
metadata = await
|
|
5301
|
+
metadata = await lstat(path2);
|
|
5342
5302
|
} catch (cause) {
|
|
5343
5303
|
return isAbsent(cause) ? { kind: "skipped" } : { kind: "unreadable" };
|
|
5344
5304
|
}
|
|
@@ -5572,10 +5532,72 @@ Connection ID: ${connection.connectionId}
|
|
|
5572
5532
|
});
|
|
5573
5533
|
}
|
|
5574
5534
|
|
|
5535
|
+
// src/storage/daemon/pairing-copies.ts
|
|
5536
|
+
import { dirname as dirname2, join as join14 } from "node:path";
|
|
5537
|
+
async function removeHistoricalPairingFiles(root, currentInstallation, installationId, connectionId, channelId, signal) {
|
|
5538
|
+
if (![installationId, connectionId, channelId].every(isIdentifier)) {
|
|
5539
|
+
throw new CurrentDataError("Invalid pairing identity");
|
|
5540
|
+
}
|
|
5541
|
+
for (const data of await listVersionDataDirectories(root, signal)) {
|
|
5542
|
+
const installation = join14(data, "installations", "dev.mobius.cli", installationId);
|
|
5543
|
+
if (installation === currentInstallation) {
|
|
5544
|
+
continue;
|
|
5545
|
+
}
|
|
5546
|
+
try {
|
|
5547
|
+
await validateLocalPath(join14(data, "installations"), true, true, signal);
|
|
5548
|
+
await validateLocalPath(join14(data, "installations", "dev.mobius.cli"), true, true, signal);
|
|
5549
|
+
await validateLocalPath(installation, true, true, signal);
|
|
5550
|
+
} catch (cause) {
|
|
5551
|
+
if (isNodeError(cause, "ENOENT")) {
|
|
5552
|
+
continue;
|
|
5553
|
+
}
|
|
5554
|
+
throw cause;
|
|
5555
|
+
}
|
|
5556
|
+
await removeSavedFile(connectionFilePath(join14(installation, "connections"), connectionId), signal);
|
|
5557
|
+
const indexPath = channelIndexFilePath(installation, channelId);
|
|
5558
|
+
try {
|
|
5559
|
+
await validateLocalPath(dirname2(indexPath), true, true, signal);
|
|
5560
|
+
await validateLocalPath(indexPath, false, true, signal);
|
|
5561
|
+
} catch (cause) {
|
|
5562
|
+
if (isNodeError(cause, "ENOENT")) {
|
|
5563
|
+
continue;
|
|
5564
|
+
}
|
|
5565
|
+
throw cause;
|
|
5566
|
+
}
|
|
5567
|
+
const stored = await readInstallationFile(indexPath);
|
|
5568
|
+
if (stored.kind === "read") {
|
|
5569
|
+
const index = JSON.parse(stored.text);
|
|
5570
|
+
if (typeof index === "object" && index !== null && "connectionId" in index && index.connectionId === connectionId) {
|
|
5571
|
+
await removeSavedFile(indexPath, signal);
|
|
5572
|
+
}
|
|
5573
|
+
}
|
|
5574
|
+
}
|
|
5575
|
+
}
|
|
5576
|
+
async function removeSavedFile(path2, signal) {
|
|
5577
|
+
try {
|
|
5578
|
+
await validateLocalPath(dirname2(path2), true, true, signal);
|
|
5579
|
+
signal.throwIfAborted();
|
|
5580
|
+
await removeInstallationFile(path2);
|
|
5581
|
+
} catch (cause) {
|
|
5582
|
+
if (!isNodeError(cause, "ENOENT")) {
|
|
5583
|
+
throw cause;
|
|
5584
|
+
}
|
|
5585
|
+
}
|
|
5586
|
+
}
|
|
5587
|
+
|
|
5575
5588
|
// src/cli/handler/pair/remove.ts
|
|
5576
5589
|
function registerPairRemoveCommand(command, context) {
|
|
5577
5590
|
command.command("remove").description("remove a saved pairing").addOption(valueOption("--connection <connection-id>", "saved Runtime connection identifier", true)).action(async (options) => {
|
|
5578
5591
|
const installation = await openMobiusCliInstallation(context.shutdownSignal, process.env);
|
|
5592
|
+
const connection = await installation.readConnection(options.connection, context.shutdownSignal);
|
|
5593
|
+
await removeHistoricalPairingFiles(
|
|
5594
|
+
readStateDirectory(),
|
|
5595
|
+
installation.stateDirectory,
|
|
5596
|
+
installation.installationId,
|
|
5597
|
+
connection.connectionId,
|
|
5598
|
+
connection.channelId,
|
|
5599
|
+
context.shutdownSignal
|
|
5600
|
+
);
|
|
5579
5601
|
await installation.removeConnection(options.connection, context.shutdownSignal);
|
|
5580
5602
|
const control = await openMobiusControlInstallation(context.shutdownSignal, process.env);
|
|
5581
5603
|
await reloadDaemon(control.stateDirectory, context.shutdownSignal);
|
|
@@ -5675,4 +5697,4 @@ async function runCLI() {
|
|
|
5675
5697
|
export {
|
|
5676
5698
|
runCLI
|
|
5677
5699
|
};
|
|
5678
|
-
//# sourceMappingURL=cli-
|
|
5700
|
+
//# sourceMappingURL=cli-A2ZF2SX5.js.map
|