mastracode 0.30.0-alpha.2 → 0.30.0

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.
@@ -1486,7 +1486,7 @@ async function getDynamicWorkspace({
1486
1486
  return existing;
1487
1487
  }
1488
1488
  const userLsp = chunkT5FGP3US_cjs.loadSettings().lsp ?? {};
1489
- const mcModulePath = path12.join(path12.dirname(url.fileURLToPath((typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('chunk-ADEKFXJD.cjs', document.baseURI).href)))), "..");
1489
+ const mcModulePath = path12.join(path12.dirname(url.fileURLToPath((typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('chunk-IVLIMFFA.cjs', document.baseURI).href)))), "..");
1490
1490
  const lspConfig = {
1491
1491
  ...userLsp,
1492
1492
  packageRunner: userLsp.packageRunner || detectPackageRunner(projectPath),
@@ -4515,7 +4515,7 @@ function isInsideDirectory(targetPath, root) {
4515
4515
  function getInstallCommand(pluginRoot, packageManager, commandRoot = pluginRoot, commandPackageManager) {
4516
4516
  const manager = packageManager ?? commandPackageManager;
4517
4517
  if (manager?.startsWith("pnpm@")) {
4518
- return hasFile(pluginRoot, "pnpm-lock.yaml") ? installCommand("pnpm", ["install", "--frozen-lockfile"]) : installCommand("pnpm", ["install"]);
4518
+ return hasFile(pluginRoot, "pnpm-lock.yaml") ? installCommand("pnpm", ["install", "--ignore-workspace", "--frozen-lockfile", "--pm-on-fail=ignore"]) : installCommand("pnpm", ["install", "--ignore-workspace", "--pm-on-fail=ignore"]);
4519
4519
  }
4520
4520
  if (manager?.startsWith("npm@")) {
4521
4521
  return hasNpmLockfile(pluginRoot) ? installCommand("npm", ["ci"]) : installCommand("npm", ["install"]);
@@ -4530,10 +4530,10 @@ function getInstallCommand(pluginRoot, packageManager, commandRoot = pluginRoot,
4530
4530
  return installCommand(manager.split("@")[0] ?? manager, ["install"]);
4531
4531
  }
4532
4532
  if (hasFile(pluginRoot, "pnpm-lock.yaml")) {
4533
- return installCommand("pnpm", ["install", "--frozen-lockfile"]);
4533
+ return installCommand("pnpm", ["install", "--ignore-workspace", "--frozen-lockfile", "--pm-on-fail=ignore"]);
4534
4534
  }
4535
4535
  if (hasFile(commandRoot, "pnpm-lock.yaml")) {
4536
- return installCommand("pnpm", ["install"]);
4536
+ return installCommand("pnpm", ["install", "--ignore-workspace", "--pm-on-fail=ignore"]);
4537
4537
  }
4538
4538
  if (hasNpmLockfile(pluginRoot)) {
4539
4539
  return installCommand("npm", ["ci"]);
@@ -4943,7 +4943,24 @@ function validateManifestEntry(entry, index) {
4943
4943
  ...candidate.name ? { name: candidate.name } : {}
4944
4944
  };
4945
4945
  }
4946
- var MASTRACODE_PACKAGE_ROOT = path12__namespace.default.resolve(path12__namespace.default.dirname(url.fileURLToPath((typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('chunk-ADEKFXJD.cjs', document.baseURI).href)))), "..", "..");
4946
+ var MASTRACODE_PACKAGE_ROOT = findMastraCodePackageRoot(path12__namespace.default.dirname(url.fileURLToPath((typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('chunk-IVLIMFFA.cjs', document.baseURI).href)))));
4947
+ function findMastraCodePackageRoot(startDir) {
4948
+ let currentDir = path12__namespace.default.resolve(startDir);
4949
+ while (true) {
4950
+ const packageJsonPath = path12__namespace.default.join(currentDir, "package.json");
4951
+ if (fs8__namespace.default.existsSync(packageJsonPath)) {
4952
+ const packageJson = JSON.parse(fs8__namespace.default.readFileSync(packageJsonPath, "utf8"));
4953
+ if (packageJson.name === "mastracode") {
4954
+ return currentDir;
4955
+ }
4956
+ }
4957
+ const parentDir = path12__namespace.default.dirname(currentDir);
4958
+ if (parentDir === currentDir) {
4959
+ throw new Error(`Could not find mastracode package root from ${startDir}`);
4960
+ }
4961
+ currentDir = parentDir;
4962
+ }
4963
+ }
4947
4964
  function ensureMastraCodePackageLink(pluginDir) {
4948
4965
  if (declaresInstallableMastraCodeDependency(pluginDir)) {
4949
4966
  return;
@@ -6920,5 +6937,5 @@ exports.setupDebugLogging = setupDebugLogging;
6920
6937
  exports.truncate = truncate;
6921
6938
  exports.upsertPluginManifestEntry = upsertPluginManifestEntry;
6922
6939
  exports.wireSessionConcerns = wireSessionConcerns;
6923
- //# sourceMappingURL=chunk-ADEKFXJD.cjs.map
6924
- //# sourceMappingURL=chunk-ADEKFXJD.cjs.map
6940
+ //# sourceMappingURL=chunk-IVLIMFFA.cjs.map
6941
+ //# sourceMappingURL=chunk-IVLIMFFA.cjs.map