@moxt-ai/mobius 0.0.473 → 0.0.475

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.
@@ -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.473",
83
+ version: "0.0.475",
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-ZNDBQ5XO.js.map
174
+ //# sourceMappingURL=chunk-DXY7NSHF.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.473\",\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 },\n \"dependencies\": {\n \"undici\": \"8.12.2\"\n },\n \"devDependencies\": {\n \"@moxt-ai/mobius-sdk-before-prompt-suggestions\": \"npm:@moxt-ai/mobius-sdk@0.0.181\",\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 \"ignore\": \"7.0.9\",\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"],
4
+ "sourcesContent": ["{\n \"name\": \"@moxt-ai/mobius\",\n \"version\": \"0.0.475\",\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 },\n \"dependencies\": {\n \"undici\": \"8.12.2\"\n },\n \"devDependencies\": {\n \"@moxt-ai/mobius-sdk-before-prompt-suggestions\": \"npm:@moxt-ai/mobius-sdk@0.0.181\",\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 \"ignore\": \"7.0.9\",\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,EACnB;AAAA,EACA,cAAgB;AAAA,IACZ,QAAU;AAAA,EACd;AAAA,EACA,iBAAmB;AAAA,IACf,iDAAiD;AAAA,IACjD,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,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
  }
@@ -5,7 +5,7 @@ import {
5
5
  __toESM,
6
6
  __using,
7
7
  package_default
8
- } from "./chunk-ZNDBQ5XO.js";
8
+ } from "./chunk-DXY7NSHF.js";
9
9
 
10
10
  // ../../node_modules/.pnpm/ignore@7.0.9/node_modules/ignore/index.js
11
11
  var require_ignore = __commonJS({
@@ -87401,7 +87401,8 @@ var DAILY_ENDPOINT = "https://daily-cloudcode-pa.googleapis.com";
87401
87401
  var PROD_ENDPOINT = "https://cloudcode-pa.googleapis.com";
87402
87402
  var OAUTH_TOKEN_URL = "https://oauth2.googleapis.com/token";
87403
87403
  var HTTP_TIMEOUT_MILLISECONDS = 1e4;
87404
- var AGY_CLI_TIMEOUT_MILLISECONDS = 15e3;
87404
+ var AGY_OAUTH_REFRESH_TIMEOUT_MILLISECONDS = 15e3;
87405
+ var AGY_CLI_TIMEOUT_MILLISECONDS = 2e4;
87405
87406
  var TOKEN_EXPIRY_MARGIN_MILLISECONDS = 6e4;
87406
87407
  var SESSION_WINDOW_MINUTES3 = 5 * 60;
87407
87408
  var WEEKLY_WINDOW_MINUTES3 = 7 * 24 * 60;
@@ -87624,7 +87625,10 @@ async function refreshAgyOAuthViaCli(options) {
87624
87625
  stdio: ["ignore", "ignore", "ignore"]
87625
87626
  });
87626
87627
  const processTreePromise = captureProcessTree(child).catch(() => []);
87627
- const timeoutSignal = AbortSignal.any([options.signal, AbortSignal.timeout(AGY_CLI_TIMEOUT_MILLISECONDS)]);
87628
+ const timeoutSignal = AbortSignal.any([
87629
+ options.signal,
87630
+ AbortSignal.timeout(AGY_OAUTH_REFRESH_TIMEOUT_MILLISECONDS)
87631
+ ]);
87628
87632
  await new Promise((resolve21, reject2) => {
87629
87633
  let settled = false;
87630
87634
  const finish = (outcome) => {
@@ -87746,20 +87750,32 @@ async function readCliManagedUsage(options, checkedAt) {
87746
87750
  }
87747
87751
  } catch (error62) {
87748
87752
  options.signal.throwIfAborted();
87749
- if (error62 instanceof ProcessExecutionError && error62.code === "process_exit_failed" && await options.requiresAuthentication()) {
87750
- return {
87751
- ...base,
87752
- status: "unauthenticated",
87753
- message: "Sign in to Antigravity on this computer to view subscription quotas."
87754
- };
87753
+ if (error62 instanceof ProcessExecutionError) {
87754
+ if (error62.code === "process_timeout") {
87755
+ return unavailableCliUsage(base, "antigravity_usage_timeout", "Antigravity usage check timed out.");
87756
+ }
87757
+ if (error62.code === "process_exit_failed" && await options.requiresAuthentication()) {
87758
+ return {
87759
+ ...base,
87760
+ status: "unauthenticated",
87761
+ message: "Sign in to Antigravity on this computer to view subscription quotas."
87762
+ };
87763
+ }
87764
+ return unavailableCliUsage(base, "antigravity_usage_probe_failed", "Could not run Antigravity usage.");
87765
+ }
87766
+ if (error62 instanceof SyntaxError || error62 instanceof external_exports.ZodError) {
87767
+ return unavailableCliUsage(
87768
+ base,
87769
+ "antigravity_usage_invalid_response",
87770
+ "Antigravity returned an invalid usage response."
87771
+ );
87755
87772
  }
87773
+ throw error62;
87756
87774
  }
87757
- return {
87758
- ...base,
87759
- status: "unavailable",
87760
- errorCode: "antigravity_usage_probe_failed",
87761
- errorMessage: "Could not read Antigravity usage quotas."
87762
- };
87775
+ return unavailableCliUsage(base, "antigravity_usage_empty", "Antigravity did not return usable quota information.");
87776
+ }
87777
+ function unavailableCliUsage(base, errorCode, errorMessage) {
87778
+ return { ...base, status: "unavailable", errorCode, errorMessage };
87763
87779
  }
87764
87780
  async function readAntigravityUsageQuota(options) {
87765
87781
  options.signal.throwIfAborted();
@@ -102842,7 +102858,7 @@ function cacheTtlForAgent(agentId) {
102842
102858
  return agentId === "claude" || agentId === "antigravity" ? RATE_LIMITED_PROVIDER_CACHE_TTL_MILLISECONDS : DEFAULT_CACHE_TTL_MILLISECONDS;
102843
102859
  }
102844
102860
  function applyElapsedWindows(reading, nowMs) {
102845
- if (reading.status !== "available") {
102861
+ if (reading.status !== "available" || reading.stale !== void 0) {
102846
102862
  return reading;
102847
102863
  }
102848
102864
  let changed = false;
@@ -102982,8 +102998,8 @@ var RuntimeUsageService = class {
102982
102998
  const entry = this.#entry(agentId);
102983
102999
  const nowMs = this.#now();
102984
103000
  if (entry.inFlight !== null) {
102985
- const result = await raceWithCallerSignal(entry.inFlight, signal);
102986
- return applyElapsedWindows(result, this.#now());
103001
+ const result2 = await raceWithCallerSignal(entry.inFlight, signal);
103002
+ return applyElapsedWindows(result2, this.#now());
102987
103003
  }
102988
103004
  if (entry.lastResult !== null && entry.lastAttemptAtMs !== null) {
102989
103005
  const elapsedSinceAttempt = nowMs - entry.lastAttemptAtMs;
@@ -102995,16 +103011,12 @@ var RuntimeUsageService = class {
102995
103011
  }
102996
103012
  }
102997
103013
  const probeSignal = AbortSignal.timeout(AGENT_PROBE_TIMEOUT_MILLISECONDS);
102998
- const probe = this.#probeAgent(agentId, entry, probeSignal);
103014
+ const probe = this.#probeAgent(agentId, entry, probeSignal).finally(() => {
103015
+ entry.inFlight = null;
103016
+ });
102999
103017
  entry.inFlight = probe;
103000
- try {
103001
- const result = await raceWithCallerSignal(probe, signal);
103002
- return applyElapsedWindows(result, this.#now());
103003
- } finally {
103004
- if (entry.inFlight === probe) {
103005
- entry.inFlight = null;
103006
- }
103007
- }
103018
+ const result = await raceWithCallerSignal(probe, signal);
103019
+ return applyElapsedWindows(result, this.#now());
103008
103020
  };
103009
103021
  #probeAgent = async (agentId, entry, signal) => {
103010
103022
  const startedAtMs = this.#now();
@@ -105585,12 +105597,23 @@ function createRuntimeUsageReadCommand() {
105585
105597
  throw new Error("Command kind mismatch");
105586
105598
  }
105587
105599
  const task = (async () => {
105600
+ const startedAt = performance.now();
105588
105601
  try {
105589
105602
  const agents = await usageService.readUsage({
105590
105603
  ...message.agentIds === void 0 ? {} : { agentIds: message.agentIds },
105591
105604
  forceRefresh: message.forceRefresh ?? false,
105592
105605
  signal
105593
105606
  });
105607
+ for (const agent2 of agents) {
105608
+ const errorCode = agent2.status === "unavailable" ? agent2.errorCode : agent2.status === "available" ? agent2.stale?.errorCode : void 0;
105609
+ if (errorCode !== void 0) {
105610
+ diagnostics.daemonDiagnostic("runtime_usage_agent_probe_failed", message.requestId, {
105611
+ agentId: agent2.agentId,
105612
+ errorCode,
105613
+ requestElapsedMilliseconds: Math.round(performance.now() - startedAt).toString()
105614
+ });
105615
+ }
105616
+ }
105594
105617
  if (socket.readyState === WebSocket7.OPEN) {
105595
105618
  send(socket, {
105596
105619
  kind: RUNTIME_USAGE_RESULT_KIND,
@@ -107704,4 +107727,4 @@ export {
107704
107727
  * MIT Licensed
107705
107728
  *)
107706
107729
  */
107707
- //# sourceMappingURL=chunk-MYBYMYDN.js.map
107730
+ //# sourceMappingURL=chunk-QD2QKZUY.js.map