@moxt-ai/mobius 0.0.15 → 0.0.16

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/index.js CHANGED
@@ -24672,6 +24672,7 @@ var LocalAgentSpecification = class {
24672
24672
  };
24673
24673
  createLaunchEnvironment = async (_agent, _context) => Object.freeze({});
24674
24674
  recoveryCommand = () => "";
24675
+ resolveInstalledAgentExecutables = (_context) => Promise.resolve([]);
24675
24676
  supportsInstallation = (platform, architecture) => (platform === "darwin" || platform === "linux") && (architecture === "arm64" || architecture === "x64");
24676
24677
  verifyAcp = (_connection, _initialized, _defaultWorkspace, _signal) => Promise.resolve();
24677
24678
  };
@@ -25833,7 +25834,7 @@ var PiAgentSpecification = class extends BridgedAcpAgentDefinition {
25833
25834
  };
25834
25835
 
25835
25836
  // src/agent-catalog/agents/workbuddy-agent.ts
25836
- import { join as join11 } from "node:path";
25837
+ import { isAbsolute as isAbsolute5, join as join11 } from "node:path";
25837
25838
 
25838
25839
  // src/agent-installation/workbuddy-managed-package.ts
25839
25840
  var WORKBUDDY_MANAGED_VERSION = "2.146.0";
@@ -25853,6 +25854,15 @@ var WORKBUDDY_MANAGED_PACKAGE = new WorkBuddyManagedPackage(
25853
25854
  );
25854
25855
 
25855
25856
  // src/agent-catalog/agents/workbuddy-agent.ts
25857
+ var WORKBUDDY_MACOS_EXECUTABLE_PATH = Object.freeze([
25858
+ "WorkBuddy.app",
25859
+ "Contents",
25860
+ "Resources",
25861
+ "app.asar.unpacked",
25862
+ "cli",
25863
+ "bin",
25864
+ "codebuddy"
25865
+ ]);
25856
25866
  var WorkBuddyAgentSpecification = class extends DirectAcpAgentDefinition {
25857
25867
  adapterVersion = WORKBUDDY_MANAGED_VERSION;
25858
25868
  authenticationCommand = () => "codebuddy";
@@ -25885,6 +25895,30 @@ var WorkBuddyAgentSpecification = class extends DirectAcpAgentDefinition {
25885
25895
  signal.throwIfAborted();
25886
25896
  return executable;
25887
25897
  };
25898
+ resolveInstalledAgentExecutables = async (context) => {
25899
+ context.signal.throwIfAborted();
25900
+ if ((context.platform ?? process.platform) !== "darwin") {
25901
+ return [];
25902
+ }
25903
+ const requestedPaths = [
25904
+ join11("/Applications", ...WORKBUDDY_MACOS_EXECUTABLE_PATH)
25905
+ ];
25906
+ const homeDirectory = context.environment["HOME"];
25907
+ if (homeDirectory !== void 0 && isAbsolute5(homeDirectory)) {
25908
+ requestedPaths.unshift(
25909
+ join11(homeDirectory, "Applications", ...WORKBUDDY_MACOS_EXECUTABLE_PATH)
25910
+ );
25911
+ }
25912
+ const executables = [];
25913
+ for (const requestedPath of requestedPaths) {
25914
+ const executable = await resolveExecutablePath(requestedPath, "darwin");
25915
+ context.signal.throwIfAborted();
25916
+ if (executable !== null) {
25917
+ executables.push(executable);
25918
+ }
25919
+ }
25920
+ return executables;
25921
+ };
25888
25922
  verifyAcp = async (connection, initialized, defaultWorkspace, signal) => {
25889
25923
  const capabilities = initialized.agentCapabilities ?? {};
25890
25924
  if (capabilities.loadSession !== true || (initialized.authMethods ?? []).length === 0) {
@@ -25927,7 +25961,7 @@ import {
25927
25961
  } from "@agentclientprotocol/sdk";
25928
25962
 
25929
25963
  // src/agent-catalog/executable-discovery.ts
25930
- import { isAbsolute as isAbsolute5, join as join13 } from "node:path";
25964
+ import { isAbsolute as isAbsolute6, join as join13 } from "node:path";
25931
25965
 
25932
25966
  // src/agent-installation/managed-adapter-installer.ts
25933
25967
  import { join as join12 } from "node:path";
@@ -26044,10 +26078,10 @@ async function resolveManagedAdapterExecutable(specification, context) {
26044
26078
  }
26045
26079
  return managed;
26046
26080
  }
26047
- async function resolveSpecificationExecutables(executableName, overrideVariable, resolveManaged, context) {
26081
+ async function resolveSpecificationExecutables(executableName, overrideVariable, resolveInstalled, resolveManaged, context) {
26048
26082
  const override = context.environment[overrideVariable];
26049
26083
  if (override !== void 0) {
26050
- if (override.length === 0 || !isAbsolute5(override)) {
26084
+ if (override.length === 0 || !isAbsolute6(override)) {
26051
26085
  return [];
26052
26086
  }
26053
26087
  const executable = await resolveExecutablePath(override, context.platform);
@@ -26058,19 +26092,30 @@ async function resolveSpecificationExecutables(executableName, overrideVariable,
26058
26092
  context.environment,
26059
26093
  context.platform
26060
26094
  );
26095
+ const installed = await resolveInstalled();
26061
26096
  const managed = await resolveManaged();
26062
- if (external === null) {
26063
- return managed === null ? [] : [managed];
26097
+ const executables = [];
26098
+ const paths = /* @__PURE__ */ new Set();
26099
+ if (external !== null) {
26100
+ executables.push(external);
26101
+ paths.add(external.path);
26102
+ }
26103
+ for (const executable of installed) {
26104
+ if (!paths.has(executable.path)) {
26105
+ executables.push(executable);
26106
+ paths.add(executable.path);
26107
+ }
26064
26108
  }
26065
- if (managed === null || managed.path === external.path) {
26066
- return [external];
26109
+ if (managed !== null && !paths.has(managed.path)) {
26110
+ executables.push(managed);
26067
26111
  }
26068
- return [external, managed];
26112
+ return executables;
26069
26113
  }
26070
26114
  async function resolveAgentExecutables(specification, context) {
26071
26115
  return await resolveSpecificationExecutables(
26072
26116
  specification.agentExecutable,
26073
26117
  specification.agentOverrideVariable,
26118
+ async () => await specification.resolveInstalledAgentExecutables(context),
26074
26119
  async () => await resolveManagedExecutable(specification, context),
26075
26120
  context
26076
26121
  );
@@ -26085,6 +26130,7 @@ async function resolveAdapterExecutables(specification, context) {
26085
26130
  return await resolveSpecificationExecutables(
26086
26131
  specification.adapterExecutable,
26087
26132
  specification.adapterOverrideVariable,
26133
+ () => Promise.resolve([]),
26088
26134
  async () => await resolveManagedAdapterExecutable(specification, context),
26089
26135
  context
26090
26136
  );
@@ -27509,11 +27555,11 @@ var FixedAgentInstallRecipe = class {
27509
27555
 
27510
27556
  // src/agent-installation/grok-build-install-recipe.ts
27511
27557
  import { mkdir as mkdir4, realpath as realpath7, stat as stat6 } from "node:fs/promises";
27512
- import { delimiter as delimiter2, dirname as dirname5, isAbsolute as isAbsolute6, join as join15, relative as relative4, sep as sep4 } from "node:path";
27558
+ import { delimiter as delimiter2, dirname as dirname5, isAbsolute as isAbsolute7, join as join15, relative as relative4, sep as sep4 } from "node:path";
27513
27559
  var INSTALL_TIMEOUT_MILLISECONDS2 = 5 * 60 * 1e3;
27514
27560
  function isContainedPath4(root, candidate) {
27515
27561
  const difference = relative4(root, candidate);
27516
- return difference.length > 0 && difference !== ".." && !difference.startsWith(`..${sep4}`) && !isAbsolute6(difference);
27562
+ return difference.length > 0 && difference !== ".." && !difference.startsWith(`..${sep4}`) && !isAbsolute7(difference);
27517
27563
  }
27518
27564
  async function resolveLifecycleScript(packageRoot) {
27519
27565
  try {
@@ -28345,7 +28391,7 @@ import { homedir as homedir2 } from "node:os";
28345
28391
  import {
28346
28392
  basename as basename2,
28347
28393
  dirname as dirname6,
28348
- isAbsolute as isAbsolute7,
28394
+ isAbsolute as isAbsolute8,
28349
28395
  join as join18,
28350
28396
  normalize as normalize2,
28351
28397
  relative as relative5
@@ -28398,20 +28444,20 @@ var WorkspaceDirectoryService = class {
28398
28444
  if (id === "home") return homedir2();
28399
28445
  if (id.startsWith("path-")) {
28400
28446
  const path2 = decodePath(id, "path-");
28401
- if (isAbsolute7(path2)) return path2;
28447
+ if (isAbsolute8(path2)) return path2;
28402
28448
  }
28403
28449
  throw new LocalAuthorizationError("The directory identifier is invalid");
28404
28450
  };
28405
28451
  resolvePath = async (requested, signal) => {
28406
28452
  signal.throwIfAborted();
28407
- if (!isAbsolute7(requested) || requested.includes("\0") || normalize2(requested) !== requested)
28453
+ if (!isAbsolute8(requested) || requested.includes("\0") || normalize2(requested) !== requested)
28408
28454
  throw new LocalAuthorizationError("The local directory path is invalid");
28409
28455
  try {
28410
28456
  const target = await realpath8(requested);
28411
28457
  signal.throwIfAborted();
28412
28458
  const metadata = await stat7(target);
28413
28459
  signal.throwIfAborted();
28414
- if (!isAbsolute7(target) || normalize2(target) !== target || !metadata.isDirectory())
28460
+ if (!isAbsolute8(target) || normalize2(target) !== target || !metadata.isDirectory())
28415
28461
  throw new LocalAuthorizationError(
28416
28462
  "The selected location is not a directory"
28417
28463
  );
@@ -28427,7 +28473,7 @@ var WorkspaceDirectoryService = class {
28427
28473
  };
28428
28474
  label = (path2) => {
28429
28475
  const suffix = relative5(homedir2(), path2);
28430
- return suffix === "" ? "~" : !isAbsolute7(suffix) && suffix !== ".." && !suffix.startsWith(`..${process.platform === "win32" ? "\\" : "/"}`) ? `~/${suffix.replaceAll("\\", "/")}` : path2;
28476
+ return suffix === "" ? "~" : !isAbsolute8(suffix) && suffix !== ".." && !suffix.startsWith(`..${process.platform === "win32" ? "\\" : "/"}`) ? `~/${suffix.replaceAll("\\", "/")}` : path2;
28431
28477
  };
28432
28478
  identify = async (bindingId, requestedPath, signal) => {
28433
28479
  this.authorizeMachine(bindingId);