@moxt-ai/mobius 0.0.423 → 0.0.424
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-UJGF6H4V.js → chunk-PWNESRGO.js} +2 -2
- package/dist/{chunk-UJGF6H4V.js.map → chunk-PWNESRGO.js.map} +1 -1
- package/dist/{chunk-LQ6CAUDA.js → chunk-RSYDC4H6.js} +2 -2
- package/dist/{cli-2BEWEMVR.js → cli-RWGALMSD.js} +60 -6
- package/dist/{cli-2BEWEMVR.js.map → cli-RWGALMSD.js.map} +3 -3
- package/dist/cli.js +2 -2
- package/dist/engine.js +2 -2
- package/dist/storage/daemon/daemon-lock.d.ts +1 -4
- package/dist/storage/daemon/daemon-lock.d.ts.map +1 -1
- package/dist/storage/daemon/daemon-lock.js +73 -5
- package/dist/storage/daemon/daemon-lock.js.map +1 -1
- package/package.json +1 -1
- /package/dist/{chunk-LQ6CAUDA.js.map → chunk-RSYDC4H6.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.424",
|
|
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-PWNESRGO.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.424\",\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 \"undici\": \"8.12.2\"\n },\n \"devDependencies\": {\n \"@agentclientprotocol/sdk\": \"^1.4.0\",\n \"@anthropic-ai/claude-agent-sdk\": \"0.3.257\",\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 \"commander\": \"15.0.0\",\n \"drizzle-kit\": \"1.0.0-rc.4\",\n \"drizzle-orm\": \"1.0.0-rc.4\",\n \"esbuild\": \"0.28.2\",\n \"semver\": \"^7.8.5\",\n \"valibot\": \"1.5.0\",\n \"ws\": \"^8.21.3\",\n \"zod\": \"^4.6.7\"\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,QAAU;AAAA,EACd;AAAA,EACA,iBAAmB;AAAA,IACf,4BAA4B;AAAA,IAC5B,kCAAkC;AAAA,IAClC,qBAAqB;AAAA,IACrB,uBAAuB;AAAA,IACvB,wBAAwB;AAAA,IACxB,eAAe;AAAA,IACf,iBAAiB;AAAA,IACjB,aAAa;AAAA,IACb,WAAa;AAAA,IACb,eAAe;AAAA,IACf,eAAe;AAAA,IACf,SAAW;AAAA,IACX,QAAU;AAAA,IACV,SAAW;AAAA,IACX,IAAM;AAAA,IACN,KAAO;AAAA,EACX;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-PWNESRGO.js";
|
|
7
7
|
|
|
8
8
|
// src/engine/runtime/relay/runtime-revocation.ts
|
|
9
9
|
var runtimeRevocationCloseCode = 1008;
|
|
@@ -97684,4 +97684,4 @@ export {
|
|
|
97684
97684
|
* MIT Licensed
|
|
97685
97685
|
*)
|
|
97686
97686
|
*/
|
|
97687
|
-
//# sourceMappingURL=chunk-
|
|
97687
|
+
//# sourceMappingURL=chunk-RSYDC4H6.js.map
|
|
@@ -32,10 +32,10 @@ import {
|
|
|
32
32
|
unhandledRejectionLogFilename,
|
|
33
33
|
validateLocalPath,
|
|
34
34
|
validatePairingId
|
|
35
|
-
} from "./chunk-
|
|
35
|
+
} from "./chunk-RSYDC4H6.js";
|
|
36
36
|
import {
|
|
37
37
|
package_default
|
|
38
|
-
} from "./chunk-
|
|
38
|
+
} from "./chunk-PWNESRGO.js";
|
|
39
39
|
|
|
40
40
|
// ../../node_modules/.pnpm/commander@15.0.0/node_modules/commander/lib/error.js
|
|
41
41
|
var CommanderError = class extends Error {
|
|
@@ -3868,6 +3868,9 @@ var RuntimeAgentProcesses = class {
|
|
|
3868
3868
|
import { randomUUID as randomUUID2 } from "node:crypto";
|
|
3869
3869
|
import { readFile as readFile3, rename, unlink } from "node:fs/promises";
|
|
3870
3870
|
import { join as join7 } from "node:path";
|
|
3871
|
+
import { DatabaseSync } from "node:sqlite";
|
|
3872
|
+
var SQLITE_BUSY = 5;
|
|
3873
|
+
var OWNERSHIP_CONTENTION_MILLISECONDS = 2e3;
|
|
3871
3874
|
async function removeLockFile(path2) {
|
|
3872
3875
|
const released = `${path2}.${randomUUID2()}.released`;
|
|
3873
3876
|
try {
|
|
@@ -3877,8 +3880,36 @@ async function removeLockFile(path2) {
|
|
|
3877
3880
|
}
|
|
3878
3881
|
await unlink(released).catch(() => void 0);
|
|
3879
3882
|
}
|
|
3880
|
-
|
|
3881
|
-
const
|
|
3883
|
+
function holdDaemonOwnership(path2) {
|
|
3884
|
+
const database = new DatabaseSync(path2);
|
|
3885
|
+
try {
|
|
3886
|
+
database.exec(`PRAGMA busy_timeout = ${OWNERSHIP_CONTENTION_MILLISECONDS.toString()}`);
|
|
3887
|
+
database.exec("BEGIN EXCLUSIVE");
|
|
3888
|
+
database.exec("PRAGMA locking_mode = EXCLUSIVE");
|
|
3889
|
+
} catch (cause) {
|
|
3890
|
+
database.close();
|
|
3891
|
+
if (cause instanceof Error && "errcode" in cause && cause.errcode === SQLITE_BUSY) {
|
|
3892
|
+
return null;
|
|
3893
|
+
}
|
|
3894
|
+
throw cause;
|
|
3895
|
+
}
|
|
3896
|
+
try {
|
|
3897
|
+
database.exec(
|
|
3898
|
+
"CREATE TABLE IF NOT EXISTS daemon_owner (singleton INTEGER PRIMARY KEY CHECK (singleton = 1), pid INTEGER NOT NULL)"
|
|
3899
|
+
);
|
|
3900
|
+
const previous = database.prepare("SELECT pid FROM daemon_owner").get();
|
|
3901
|
+
database.prepare("INSERT OR REPLACE INTO daemon_owner (singleton, pid) VALUES (1, ?)").run(process.pid);
|
|
3902
|
+
database.exec("COMMIT");
|
|
3903
|
+
return {
|
|
3904
|
+
previousOwner: typeof previous?.["pid"] === "number" ? previous["pid"] : null,
|
|
3905
|
+
release: () => database.close()
|
|
3906
|
+
};
|
|
3907
|
+
} catch (cause) {
|
|
3908
|
+
database.close();
|
|
3909
|
+
throw cause;
|
|
3910
|
+
}
|
|
3911
|
+
}
|
|
3912
|
+
async function takeLockFile(path2, previousOwner) {
|
|
3882
3913
|
for (let attempt = 0; attempt < 2; attempt += 1) {
|
|
3883
3914
|
try {
|
|
3884
3915
|
await createInstallationFile(path2, `${process.pid.toString()}
|
|
@@ -3890,7 +3921,7 @@ async function acquireDaemonLock(stateDirectory, filename = "manager.lock") {
|
|
|
3890
3921
|
}
|
|
3891
3922
|
const encoded = await readFile3(path2, "utf8").catch(() => "");
|
|
3892
3923
|
const pid = Number(encoded.trim());
|
|
3893
|
-
if (Number.isSafeInteger(pid) && pid > 1) {
|
|
3924
|
+
if (Number.isSafeInteger(pid) && pid > 1 && pid !== previousOwner) {
|
|
3894
3925
|
try {
|
|
3895
3926
|
process.kill(pid, 0);
|
|
3896
3927
|
return null;
|
|
@@ -3905,6 +3936,29 @@ async function acquireDaemonLock(stateDirectory, filename = "manager.lock") {
|
|
|
3905
3936
|
}
|
|
3906
3937
|
return null;
|
|
3907
3938
|
}
|
|
3939
|
+
async function acquireDaemonLock(stateDirectory, filename = "manager.lock") {
|
|
3940
|
+
const path2 = join7(stateDirectory, filename);
|
|
3941
|
+
const ownership = holdDaemonOwnership(`${path2}.sqlite`);
|
|
3942
|
+
if (ownership === null) {
|
|
3943
|
+
return null;
|
|
3944
|
+
}
|
|
3945
|
+
let releaseLockFile = null;
|
|
3946
|
+
try {
|
|
3947
|
+
releaseLockFile = await takeLockFile(path2, ownership.previousOwner);
|
|
3948
|
+
} finally {
|
|
3949
|
+
if (releaseLockFile === null) {
|
|
3950
|
+
ownership.release();
|
|
3951
|
+
}
|
|
3952
|
+
}
|
|
3953
|
+
if (releaseLockFile === null) {
|
|
3954
|
+
return null;
|
|
3955
|
+
}
|
|
3956
|
+
const release = releaseLockFile;
|
|
3957
|
+
return async () => {
|
|
3958
|
+
await release();
|
|
3959
|
+
ownership.release();
|
|
3960
|
+
};
|
|
3961
|
+
}
|
|
3908
3962
|
async function daemonLockExists(stateDirectory, filename = "manager.lock") {
|
|
3909
3963
|
try {
|
|
3910
3964
|
const pid = Number((await readFile3(join7(stateDirectory, filename), "utf8")).trim());
|
|
@@ -5734,4 +5788,4 @@ async function runCLI() {
|
|
|
5734
5788
|
export {
|
|
5735
5789
|
runCLI
|
|
5736
5790
|
};
|
|
5737
|
-
//# sourceMappingURL=cli-
|
|
5791
|
+
//# sourceMappingURL=cli-RWGALMSD.js.map
|