@base44-preview/cli 0.0.34-pr.228.2ae7cac → 0.0.34-pr.228.8754791

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/cli/index.js CHANGED
@@ -185439,13 +185439,18 @@ async function writeAgents(agentsDir, remoteAgents) {
185439
185439
  deleted.push(name2);
185440
185440
  }
185441
185441
  }
185442
+ const claimedPaths = new Set([...nameToEntry.values()].map((e2) => e2.filePath));
185442
185443
  const written = [];
185443
185444
  for (const agent of remoteAgents) {
185444
185445
  const existing = nameToEntry.get(agent.name);
185445
185446
  if (existing && isDeepStrictEqual(existing.raw, agent)) {
185446
185447
  continue;
185447
185448
  }
185448
- const filePath = existing?.filePath ?? join3(agentsDir, `${agent.name}.${CONFIG_FILE_EXTENSION}`);
185449
+ const defaultPath = join3(agentsDir, `${agent.name}.${CONFIG_FILE_EXTENSION}`);
185450
+ if (!existing && claimedPaths.has(defaultPath)) {
185451
+ throw new Error(`Cannot write agent "${agent.name}": file "${defaultPath}" is already used by another agent`);
185452
+ }
185453
+ const filePath = existing?.filePath ?? defaultPath;
185449
185454
  await writeJsonFile(filePath, agent);
185450
185455
  written.push(agent.name);
185451
185456
  }
@@ -200615,4 +200620,4 @@ export {
200615
200620
  CLIExitError
200616
200621
  };
200617
200622
 
200618
- //# debugId=199B0E01CD0F366764756E2164756E21
200623
+ //# debugId=40A3934F16CD09CB64756E2164756E21