@moxt-ai/mobius 0.0.469 → 0.0.470

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.469",
83
+ version: "0.0.470",
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-N3SPAVPT.js.map
174
+ //# sourceMappingURL=chunk-6IXW5QQ2.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.469\",\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.470\",\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-N3SPAVPT.js";
8
+ } from "./chunk-6IXW5QQ2.js";
9
9
 
10
10
  // ../../node_modules/.pnpm/ignore@7.0.9/node_modules/ignore/index.js
11
11
  var require_ignore = __commonJS({
@@ -76608,6 +76608,14 @@ var CLAUDE_USAGE_TIMEOUT_MILLISECONDS = 2e4;
76608
76608
  var MAX_CLI_OUTPUT_BYTES = 256 * 1024;
76609
76609
  var SESSION_WINDOW_MINUTES = 5 * 60;
76610
76610
  var WEEKLY_WINDOW_MINUTES = 7 * 24 * 60;
76611
+ var CLAUDE_AUTH_OVERRIDE_ENV_KEYS = [
76612
+ "ANTHROPIC_API_KEY",
76613
+ "ANTHROPIC_AUTH_TOKEN",
76614
+ "ANTHROPIC_BASE_URL",
76615
+ "CLAUDE_CODE_USE_BEDROCK",
76616
+ "CLAUDE_CODE_USE_VERTEX",
76617
+ "CLAUDE_CODE_USE_FOUNDRY"
76618
+ ];
76611
76619
  var authStatusSchema = external_exports.object({
76612
76620
  loggedIn: external_exports.boolean(),
76613
76621
  authMethod: external_exports.string().nullish(),
@@ -76886,13 +76894,34 @@ function claudeRateLimitEventToReport(info, observedAt) {
76886
76894
  return null;
76887
76895
  }
76888
76896
  }
76897
+ function buildClaudeSubscriptionEnvironment(environment) {
76898
+ const merged = { ...process.env, ...environment };
76899
+ for (const key of CLAUDE_AUTH_OVERRIDE_ENV_KEYS) {
76900
+ delete merged[key];
76901
+ }
76902
+ return merged;
76903
+ }
76904
+ function isClaudeAiSubscriptionAuth(auth) {
76905
+ if (!auth.loggedIn) {
76906
+ return false;
76907
+ }
76908
+ const provider = auth.apiProvider?.trim();
76909
+ const method = auth.authMethod?.trim();
76910
+ if (provider !== void 0 && provider.length > 0 && provider !== "firstParty") {
76911
+ return false;
76912
+ }
76913
+ if (method !== void 0 && method.length > 0 && method !== "claude.ai" && method !== "oauth") {
76914
+ return false;
76915
+ }
76916
+ return true;
76917
+ }
76889
76918
  async function runCliCommand(params) {
76890
76919
  params.signal.throwIfAborted();
76891
76920
  const launch = executableLaunch2(params.command, [...params.args]);
76892
76921
  const child = spawn5(launch.command, [...launch.arguments], {
76893
76922
  cwd: params.cwd,
76894
76923
  ...platformSpawnOptions,
76895
- env: { ...process.env, ...params.environment },
76924
+ env: params.env ?? { ...process.env, ...params.environment },
76896
76925
  shell: false,
76897
76926
  stdio: ["ignore", "pipe", "pipe"]
76898
76927
  });
@@ -76940,13 +76969,14 @@ async function runCliCommand(params) {
76940
76969
  });
76941
76970
  });
76942
76971
  }
76943
- async function readClaudeAuthStatus(options) {
76972
+ async function readClaudeAuthStatus(options, probe) {
76944
76973
  try {
76945
76974
  const result = await runCliCommand({
76946
76975
  command: options.command,
76947
- args: ["auth", "status"],
76976
+ args: probe.args,
76948
76977
  cwd: options.cwd,
76949
76978
  environment: options.environment,
76979
+ ...probe.env === void 0 ? {} : { env: probe.env },
76950
76980
  signal: options.signal,
76951
76981
  timeoutMs: CLAUDE_AUTH_TIMEOUT_MILLISECONDS
76952
76982
  });
@@ -77373,7 +77403,7 @@ function parseClaudeCliUsageOutput(output2, auth, checkedAt) {
77373
77403
  ...credits === void 0 ? {} : { credits }
77374
77404
  };
77375
77405
  }
77376
- async function readClaudeUsageViaSdk(options, auth, checkedAt) {
77406
+ async function readClaudeUsageViaSdk(options, auth, checkedAt, env) {
77377
77407
  const probeController = new AbortController();
77378
77408
  const timeoutSignal = AbortSignal.any([
77379
77409
  options.signal,
@@ -77390,8 +77420,7 @@ async function readClaudeUsageViaSdk(options, auth, checkedAt) {
77390
77420
  abortController: probeController,
77391
77421
  cwd: options.cwd,
77392
77422
  env: {
77393
- ...process.env,
77394
- ...options.environment,
77423
+ ...env,
77395
77424
  CLAUDE_CODE_EXECUTABLE: options.command
77396
77425
  },
77397
77426
  pathToClaudeCodeExecutable: options.command,
@@ -77422,30 +77451,43 @@ async function readClaudeUsageViaSdk(options, auth, checkedAt) {
77422
77451
  async function readClaudeUsageQuota(options) {
77423
77452
  options.signal.throwIfAborted();
77424
77453
  const checkedAt = (/* @__PURE__ */ new Date()).toISOString();
77425
- const auth = await readClaudeAuthStatus(options);
77426
- if (auth !== null) {
77427
- if (!auth.loggedIn) {
77428
- return {
77429
- agentId: "claude",
77430
- status: "unauthenticated",
77431
- checkedAt,
77432
- message: "Sign in to Claude Code on this computer to view subscription quotas."
77433
- };
77434
- }
77435
- const provider = auth.apiProvider?.trim();
77436
- const method = auth.authMethod?.trim();
77437
- if (provider !== void 0 && provider.length > 0 && provider !== "firstParty" || method !== void 0 && method.length > 0 && method !== "claude.ai" && method !== "oauth") {
77438
- return {
77439
- agentId: "claude",
77440
- status: "unsupported",
77441
- checkedAt,
77442
- reason: "api_key",
77443
- message: "Claude Code is not using a Claude.ai subscription."
77444
- };
77454
+ const subscriptionEnv = buildClaudeSubscriptionEnvironment(options.environment);
77455
+ const storedAuth = await readClaudeAuthStatus(options, {
77456
+ args: ["--setting-sources", "", "auth", "status"],
77457
+ env: subscriptionEnv
77458
+ });
77459
+ let auth = null;
77460
+ let useStoredLogin = false;
77461
+ if (storedAuth !== null && isClaudeAiSubscriptionAuth(storedAuth)) {
77462
+ auth = storedAuth;
77463
+ useStoredLogin = true;
77464
+ } else {
77465
+ const defaultAuth = await readClaudeAuthStatus(options, { args: ["auth", "status"] });
77466
+ const effectiveAuth = defaultAuth ?? storedAuth;
77467
+ if (effectiveAuth !== null) {
77468
+ if (!effectiveAuth.loggedIn) {
77469
+ return {
77470
+ agentId: "claude",
77471
+ status: "unauthenticated",
77472
+ checkedAt,
77473
+ message: "Sign in to Claude Code on this computer to view subscription quotas."
77474
+ };
77475
+ }
77476
+ if (!isClaudeAiSubscriptionAuth(effectiveAuth)) {
77477
+ return {
77478
+ agentId: "claude",
77479
+ status: "unsupported",
77480
+ checkedAt,
77481
+ reason: "api_key",
77482
+ message: "Claude Code is not using a Claude.ai subscription."
77483
+ };
77484
+ }
77485
+ auth = effectiveAuth;
77445
77486
  }
77446
77487
  }
77488
+ const probeEnv = useStoredLogin ? subscriptionEnv : { ...process.env, ...options.environment };
77447
77489
  try {
77448
- return await readClaudeUsageViaSdk(options, auth, checkedAt);
77490
+ return await readClaudeUsageViaSdk(options, auth, checkedAt, probeEnv);
77449
77491
  } catch (sdkError) {
77450
77492
  if (options.signal.aborted) {
77451
77493
  throw options.signal.reason ?? sdkError;
@@ -77453,9 +77495,10 @@ async function readClaudeUsageQuota(options) {
77453
77495
  try {
77454
77496
  const cliResult = await runCliCommand({
77455
77497
  command: options.command,
77456
- args: ["-p", "/usage"],
77498
+ args: useStoredLogin ? ["-p", "/usage", "--setting-sources", ""] : ["-p", "/usage"],
77457
77499
  cwd: options.cwd,
77458
77500
  environment: options.environment,
77501
+ env: probeEnv,
77459
77502
  signal: options.signal,
77460
77503
  timeoutMs: CLAUDE_USAGE_TIMEOUT_MILLISECONDS
77461
77504
  });
@@ -106242,4 +106285,4 @@ export {
106242
106285
  * MIT Licensed
106243
106286
  *)
106244
106287
  */
106245
- //# sourceMappingURL=chunk-YEFL2MHP.js.map
106288
+ //# sourceMappingURL=chunk-IGRR6CBP.js.map