@moxt-ai/mobius 0.0.457 → 0.0.458

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.457",
83
+ version: "0.0.458",
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-SWSQPASF.js.map
174
+ //# sourceMappingURL=chunk-BHWFDFZG.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.457\",\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.458\",\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-SWSQPASF.js";
8
+ } from "./chunk-BHWFDFZG.js";
9
9
 
10
10
  // ../../node_modules/.pnpm/ignore@7.0.9/node_modules/ignore/index.js
11
11
  var require_ignore = __commonJS({
@@ -2768,18 +2768,18 @@ var validateAsync = async (schema, value, _ctx) => {
2768
2768
  return result.issues.length === 0;
2769
2769
  };
2770
2770
  var _encode = (_Err) => {
2771
- const parse5 = _parse(_Err);
2771
+ const parse6 = _parse(_Err);
2772
2772
  const fn2 = (schema, value, _ctx, _params) => {
2773
2773
  const ctx = _ctx ? { ..._ctx, direction: "backward" } : { direction: "backward" };
2774
- return parse5(schema, value, ctx, finalizeParams(fn2, _params));
2774
+ return parse6(schema, value, ctx, finalizeParams(fn2, _params));
2775
2775
  };
2776
2776
  return fn2;
2777
2777
  };
2778
2778
  var encode = /* @__PURE__ */ _encode($ZodRealError);
2779
2779
  var _decode = (_Err) => {
2780
- const parse5 = _parse(_Err);
2780
+ const parse6 = _parse(_Err);
2781
2781
  const fn2 = (schema, value, _ctx, _params) => {
2782
- return parse5(schema, value, _ctx, finalizeParams(fn2, _params));
2782
+ return parse6(schema, value, _ctx, finalizeParams(fn2, _params));
2783
2783
  };
2784
2784
  return fn2;
2785
2785
  };
@@ -4274,7 +4274,7 @@ function capSize(inst, size) {
4274
4274
  if (!caps.length)
4275
4275
  return;
4276
4276
  const cap = Math.min(...caps.map((c) => c[0]));
4277
- const parse5 = inst._zod.parse;
4277
+ const parse6 = inst._zod.parse;
4278
4278
  inst._zod.parse = (payload, ctx) => {
4279
4279
  const n = size(payload.value);
4280
4280
  if (n > cap && !ctx?.skipChecks && ctx?.direction !== "backward") {
@@ -4288,7 +4288,7 @@ function capSize(inst, size) {
4288
4288
  }
4289
4289
  }
4290
4290
  }
4291
- return parse5(payload, ctx);
4291
+ return parse6(payload, ctx);
4292
4292
  };
4293
4293
  }
4294
4294
  var arraySize = (input2) => Array.isArray(input2) ? input2.length : -1;
@@ -26708,13 +26708,13 @@ var ConnectionBuilder = class {
26708
26708
  /**
26709
26709
  * Adds a typed request handler for one method.
26710
26710
  */
26711
- onReceiveRequest(method, parse5, handler) {
26711
+ onReceiveRequest(method, parse6, handler) {
26712
26712
  return this.withHandler({
26713
26713
  handleMessage: async (message, cx2) => {
26714
26714
  if (message.kind !== "request" || message.method !== method) {
26715
26715
  return Handled.no(message);
26716
26716
  }
26717
- const request = parse5(message.params);
26717
+ const request = parse6(message.params);
26718
26718
  return await handler(request, message.responder, cx2) ?? Handled.yes();
26719
26719
  },
26720
26720
  describe: () => `${this.connectionName ?? "request"}:${method}`
@@ -26723,13 +26723,13 @@ var ConnectionBuilder = class {
26723
26723
  /**
26724
26724
  * Adds a typed notification handler for one method.
26725
26725
  */
26726
- onReceiveNotification(method, parse5, handler) {
26726
+ onReceiveNotification(method, parse6, handler) {
26727
26727
  return this.withHandler({
26728
26728
  handleMessage: async (message, cx2) => {
26729
26729
  if (message.kind !== "notification" || message.method !== method) {
26730
26730
  return Handled.no(message);
26731
26731
  }
26732
- const notification = parse5(message.params);
26732
+ const notification = parse6(message.params);
26733
26733
  return await handler(notification, cx2) ?? Handled.yes();
26734
26734
  },
26735
26735
  describe: () => `${this.connectionName ?? "notification"}:${method}`
@@ -71840,6 +71840,7 @@ var ClaudeAcpAgent = class {
71840
71840
  const backgroundTasks = /* @__PURE__ */ new Set();
71841
71841
  const awaitingBackgroundResults = /* @__PURE__ */ new Set();
71842
71842
  let processingBackgroundResults = /* @__PURE__ */ new Set();
71843
+ const deliveredBackgroundResults = /* @__PURE__ */ new Set();
71843
71844
  const backgroundTaskDetails = /* @__PURE__ */ new Map();
71844
71845
  let publishedBackgroundTasks = "[]";
71845
71846
  let hasBackgroundLevel = false;
@@ -72009,6 +72010,16 @@ var ClaudeAcpAgent = class {
72009
72010
  }
72010
72011
  };
72011
72012
  const findUnsettledTurn = (uuid3) => (session.turnQueue ?? []).find((t) => t.promptUuid === uuid3 && !t.settled);
72013
+ const deliveredTaskResults = (message) => {
72014
+ if (!("isReplay" in message) || message.isReplay !== true || message.parent_tool_use_id !== null) {
72015
+ return [];
72016
+ }
72017
+ const notification = message.origin === void 0 ? findUnsettledTurn(message.uuid) === void 0 : isTaskNotificationOrigin(message.origin);
72018
+ if (!notification) {
72019
+ return [];
72020
+ }
72021
+ return parseTaskNotifications(message.message.content, message.uuid).map((task) => task.id).filter((id) => awaitingBackgroundResults.has(id) || backgroundTasks.has(id));
72022
+ };
72012
72023
  const firstUnsettledQueuedTurn = () => (session.turnQueue ?? []).find((t) => !t.settled);
72013
72024
  const publishBackgroundTasks = async () => {
72014
72025
  const report = (taskId, state) => {
@@ -72084,6 +72095,7 @@ var ClaudeAcpAgent = class {
72084
72095
  backgroundTasks.clear();
72085
72096
  awaitingBackgroundResults.clear();
72086
72097
  processingBackgroundResults.clear();
72098
+ deliveredBackgroundResults.clear();
72087
72099
  backgroundTaskDetails.clear();
72088
72100
  try {
72089
72101
  await publishBackgroundTasks();
@@ -72899,14 +72911,22 @@ ${message.api_refusal_explanation}` : "";
72899
72911
  }
72900
72912
  }
72901
72913
  } finally {
72914
+ const handled = [...deliveredBackgroundResults];
72915
+ deliveredBackgroundResults.clear();
72916
+ for (const id of handled) {
72917
+ backgroundTasks.delete(id);
72918
+ }
72902
72919
  if (message.origin?.kind === "task-notification") {
72903
- for (const id of processingBackgroundResults) {
72904
- awaitingBackgroundResults.delete(id);
72905
- if (!backgroundTasks.has(id)) {
72906
- backgroundTaskDetails.delete(id);
72907
- }
72908
- }
72920
+ handled.push(...processingBackgroundResults);
72909
72921
  processingBackgroundResults.clear();
72922
+ }
72923
+ for (const id of handled) {
72924
+ awaitingBackgroundResults.delete(id);
72925
+ if (!backgroundTasks.has(id)) {
72926
+ backgroundTaskDetails.delete(id);
72927
+ }
72928
+ }
72929
+ if (handled.length > 0 || message.origin?.kind === "task-notification") {
72910
72930
  reportBackgroundActivity();
72911
72931
  }
72912
72932
  if (!isAutonomousResult) {
@@ -72996,6 +73016,11 @@ ${message.api_refusal_explanation}` : "";
72996
73016
  }
72997
73017
  case "user":
72998
73018
  case "assistant": {
73019
+ if (message.type === "user") {
73020
+ for (const id of deliveredTaskResults(message)) {
73021
+ deliveredBackgroundResults.add(id);
73022
+ }
73023
+ }
72999
73024
  if (message.type === "user" && isTaskNotificationOrigin(message.origin)) {
73000
73025
  const tasks = parseTaskNotifications(message.message.content, message.uuid ?? "unknown");
73001
73026
  for (const task of tasks) {
@@ -101643,7 +101668,7 @@ import { fileURLToPath as fileURLToPath2 } from "node:url";
101643
101668
  var import_ignore = __toESM(require_ignore(), 1);
101644
101669
  import { constants as constants6 } from "node:fs";
101645
101670
  import { lstat as lstat5, open as open6, readdir as readdir7, realpath as realpath8 } from "node:fs/promises";
101646
- import { dirname as dirname12, isAbsolute as isAbsolute17, join as join34, relative as relative4, sep as sep6 } from "node:path";
101671
+ import { dirname as dirname12, isAbsolute as isAbsolute17, join as join34, parse as parse5, relative as relative4, sep as sep6 } from "node:path";
101647
101672
  var MAXIMUM_NAME_LENGTH = 255;
101648
101673
  var MAXIMUM_PATH_LENGTH = 1024;
101649
101674
  var MAXIMUM_IGNORE_FILE_BYTES = 1024 * 1024;
@@ -101680,7 +101705,7 @@ async function listResolvedDirectory(root, resolved, offset, limit, signal, time
101680
101705
  let task;
101681
101706
  const deadline = new AbortController();
101682
101707
  try {
101683
- const ancestry = await recordAncestry(root, resolved);
101708
+ const ancestry = await recordAncestry(resolved);
101684
101709
  signal.throwIfAborted();
101685
101710
  task = timer.schedule(
101686
101711
  () => deadline.abort(new DOMException("Reading the workspace directory timed out", "TimeoutError")),
@@ -101831,8 +101856,8 @@ async function openValidatedDirectory(resolved) {
101831
101856
  throw cause;
101832
101857
  }
101833
101858
  }
101834
- async function recordAncestry(root, resolved) {
101835
- const top = dirname12(root);
101859
+ async function recordAncestry(resolved) {
101860
+ const top = parse5(resolved.path).root;
101836
101861
  const below = relative4(top, resolved.path);
101837
101862
  const paths = [top];
101838
101863
  for (const segment of below === "" ? [] : below.split(sep6)) {
@@ -101852,9 +101877,10 @@ async function verifyAncestryUnchanged(ancestry, resolved, handle) {
101852
101877
  if (!sameDirectory(resolved, await handle.stat({ bigint: true }))) {
101853
101878
  throw directoryChanged();
101854
101879
  }
101855
- for (const before of ancestry) {
101880
+ for (const [index2, before] of ancestry.entries()) {
101856
101881
  const after = await ancestorState(before.path);
101857
- if (after.device !== before.device || after.inode !== before.inode || after.changedAt !== before.changedAt || after.modifiedAt !== before.modifiedAt) {
101882
+ const holdsNext = index2 < ancestry.length - 1;
101883
+ if (after.device !== before.device || after.inode !== before.inode || holdsNext && (after.changedAt !== before.changedAt || after.modifiedAt !== before.modifiedAt)) {
101858
101884
  throw directoryChanged();
101859
101885
  }
101860
101886
  }
@@ -104826,4 +104852,4 @@ export {
104826
104852
  * MIT Licensed
104827
104853
  *)
104828
104854
  */
104829
- //# sourceMappingURL=chunk-VDTIJC4T.js.map
104855
+ //# sourceMappingURL=chunk-TDFSYA4U.js.map