multicorn-shield 1.3.4 → 1.3.5

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/CHANGELOG.md CHANGED
@@ -9,6 +9,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
9
9
 
10
10
  - Bump `version` in `package.json` before publishing to npm.
11
11
 
12
+ ## [1.3.5] - 2026-05-08
13
+
14
+ ### Fixed
15
+
16
+ - Replace flow no longer shows duplicate agent names (deduplication fix from 1.3.4 was incomplete)
17
+
12
18
  ## [1.3.3] - 2026-05-08
13
19
 
14
20
  ### Fixed
@@ -1988,31 +1988,41 @@ function printPlatformSnippet(platform, routingToken, shortName, apiKey) {
1988
1988
  process.stderr.write(style.dim("Start a new Goose session after updating config.") + "\n");
1989
1989
  }
1990
1990
  }
1991
- function dedupeAgentsByName(agents) {
1992
- const seen = /* @__PURE__ */ new Set();
1993
- const out = [];
1994
- for (const a of agents) {
1995
- if (seen.has(a.name)) continue;
1996
- seen.add(a.name);
1997
- out.push(a);
1998
- }
1999
- return out;
1991
+ function agentDisplayNameDedupeKey(name) {
1992
+ return name.trim().toLowerCase();
1993
+ }
1994
+ function normalizeAgentEntryForMerge(a) {
1995
+ const name = a.name.trim();
1996
+ const ws = typeof a.workspacePath === "string" && a.workspacePath.length > 0 ? a.workspacePath : void 0;
1997
+ return ws !== void 0 ? { name, platform: a.platform, workspacePath: ws } : { name, platform: a.platform };
1998
+ }
1999
+ function mergeAgentEntryDupPair(first, second) {
2000
+ const name = first.name.trim();
2001
+ const platform = first.platform;
2002
+ const ws = typeof first.workspacePath === "string" && first.workspacePath.length > 0 ? first.workspacePath : typeof second.workspacePath === "string" && second.workspacePath.length > 0 ? second.workspacePath : void 0;
2003
+ return ws !== void 0 ? { name, platform, workspacePath: ws } : { name, platform };
2004
+ }
2005
+ function mergeAgentsForUniqueNames(agents) {
2006
+ const byKey = /* @__PURE__ */ new Map();
2007
+ for (const raw of agents) {
2008
+ const key = agentDisplayNameDedupeKey(raw.name);
2009
+ const candidate = normalizeAgentEntryForMerge(raw);
2010
+ const prev = byKey.get(key);
2011
+ byKey.set(key, prev === void 0 ? candidate : mergeAgentEntryDupPair(prev, candidate));
2012
+ }
2013
+ return [...byKey.values()];
2000
2014
  }
2001
2015
  function mergeAgentsForPlatform(localAgents, remoteAgents, selectedPlatform) {
2002
- const byName = /* @__PURE__ */ new Map();
2016
+ const merged = [];
2003
2017
  for (const a of localAgents) {
2004
2018
  if (a.platform !== selectedPlatform) continue;
2005
- if (!byName.has(a.name)) {
2006
- byName.set(a.name, { ...a });
2007
- }
2019
+ merged.push(a);
2008
2020
  }
2009
2021
  for (const r of remoteAgents) {
2010
2022
  if (r.platform !== selectedPlatform) continue;
2011
- if (!byName.has(r.name)) {
2012
- byName.set(r.name, { name: r.name, platform: selectedPlatform });
2013
- }
2023
+ merged.push({ name: r.name, platform: selectedPlatform });
2014
2024
  }
2015
- return [...byName.values()];
2025
+ return mergeAgentsForUniqueNames(merged);
2016
2026
  }
2017
2027
  async function runInit(explicitBaseUrl, options) {
2018
2028
  const verbose = options?.verbose === true;
@@ -2151,8 +2161,10 @@ async function runInit(explicitBaseUrl, options) {
2151
2161
  continue;
2152
2162
  }
2153
2163
  const remoteAccountAgents = await fetchRemoteAgentsSummaries(apiKey, resolvedBaseUrl);
2154
- const agentsForPlatform = dedupeAgentsByName(
2155
- mergeAgentsForPlatform(currentAgents, remoteAccountAgents, selectedPlatform)
2164
+ const agentsForPlatform = mergeAgentsForPlatform(
2165
+ currentAgents,
2166
+ remoteAccountAgents,
2167
+ selectedPlatform
2156
2168
  );
2157
2169
  const localForPlatformCount = currentAgents.filter(
2158
2170
  (a) => a.platform === selectedPlatform
@@ -2659,7 +2671,10 @@ You have ${String(agentsForPlatform.length)} agent(s) connected for ${selectedLa
2659
2671
  }
2660
2672
  if (setupSucceeded) {
2661
2673
  if (removeAgentNameBeforeSave !== void 0) {
2662
- currentAgents = currentAgents.filter((a) => a.name !== removeAgentNameBeforeSave);
2674
+ const removeKey = agentDisplayNameDedupeKey(removeAgentNameBeforeSave);
2675
+ currentAgents = currentAgents.filter(
2676
+ (a) => agentDisplayNameDedupeKey(a.name) !== removeKey
2677
+ );
2663
2678
  }
2664
2679
  currentAgents.push({
2665
2680
  name: agentName,
@@ -2059,31 +2059,41 @@ function printPlatformSnippet(platform, routingToken, shortName, apiKey) {
2059
2059
  process.stderr.write(style.dim("Start a new Goose session after updating config.") + "\n");
2060
2060
  }
2061
2061
  }
2062
- function dedupeAgentsByName(agents) {
2063
- const seen = /* @__PURE__ */ new Set();
2064
- const out = [];
2065
- for (const a of agents) {
2066
- if (seen.has(a.name)) continue;
2067
- seen.add(a.name);
2068
- out.push(a);
2069
- }
2070
- return out;
2062
+ function agentDisplayNameDedupeKey(name) {
2063
+ return name.trim().toLowerCase();
2064
+ }
2065
+ function normalizeAgentEntryForMerge(a) {
2066
+ const name = a.name.trim();
2067
+ const ws = typeof a.workspacePath === "string" && a.workspacePath.length > 0 ? a.workspacePath : void 0;
2068
+ return ws !== void 0 ? { name, platform: a.platform, workspacePath: ws } : { name, platform: a.platform };
2069
+ }
2070
+ function mergeAgentEntryDupPair(first, second) {
2071
+ const name = first.name.trim();
2072
+ const platform = first.platform;
2073
+ const ws = typeof first.workspacePath === "string" && first.workspacePath.length > 0 ? first.workspacePath : typeof second.workspacePath === "string" && second.workspacePath.length > 0 ? second.workspacePath : void 0;
2074
+ return ws !== void 0 ? { name, platform, workspacePath: ws } : { name, platform };
2075
+ }
2076
+ function mergeAgentsForUniqueNames(agents) {
2077
+ const byKey = /* @__PURE__ */ new Map();
2078
+ for (const raw of agents) {
2079
+ const key = agentDisplayNameDedupeKey(raw.name);
2080
+ const candidate = normalizeAgentEntryForMerge(raw);
2081
+ const prev = byKey.get(key);
2082
+ byKey.set(key, prev === void 0 ? candidate : mergeAgentEntryDupPair(prev, candidate));
2083
+ }
2084
+ return [...byKey.values()];
2071
2085
  }
2072
2086
  function mergeAgentsForPlatform(localAgents, remoteAgents, selectedPlatform) {
2073
- const byName = /* @__PURE__ */ new Map();
2087
+ const merged = [];
2074
2088
  for (const a of localAgents) {
2075
2089
  if (a.platform !== selectedPlatform) continue;
2076
- if (!byName.has(a.name)) {
2077
- byName.set(a.name, { ...a });
2078
- }
2090
+ merged.push(a);
2079
2091
  }
2080
2092
  for (const r of remoteAgents) {
2081
2093
  if (r.platform !== selectedPlatform) continue;
2082
- if (!byName.has(r.name)) {
2083
- byName.set(r.name, { name: r.name, platform: selectedPlatform });
2084
- }
2094
+ merged.push({ name: r.name, platform: selectedPlatform });
2085
2095
  }
2086
- return [...byName.values()];
2096
+ return mergeAgentsForUniqueNames(merged);
2087
2097
  }
2088
2098
  var DEFAULT_SHIELD_API_BASE_URL = "https://api.multicorn.ai";
2089
2099
  async function runInit(explicitBaseUrl, options) {
@@ -2223,8 +2233,10 @@ async function runInit(explicitBaseUrl, options) {
2223
2233
  continue;
2224
2234
  }
2225
2235
  const remoteAccountAgents = await fetchRemoteAgentsSummaries(apiKey, resolvedBaseUrl);
2226
- const agentsForPlatform = dedupeAgentsByName(
2227
- mergeAgentsForPlatform(currentAgents, remoteAccountAgents, selectedPlatform)
2236
+ const agentsForPlatform = mergeAgentsForPlatform(
2237
+ currentAgents,
2238
+ remoteAccountAgents,
2239
+ selectedPlatform
2228
2240
  );
2229
2241
  const localForPlatformCount = currentAgents.filter(
2230
2242
  (a) => a.platform === selectedPlatform
@@ -2731,7 +2743,10 @@ You have ${String(agentsForPlatform.length)} agent(s) connected for ${selectedLa
2731
2743
  }
2732
2744
  if (setupSucceeded) {
2733
2745
  if (removeAgentNameBeforeSave !== void 0) {
2734
- currentAgents = currentAgents.filter((a) => a.name !== removeAgentNameBeforeSave);
2746
+ const removeKey = agentDisplayNameDedupeKey(removeAgentNameBeforeSave);
2747
+ currentAgents = currentAgents.filter(
2748
+ (a) => agentDisplayNameDedupeKey(a.name) !== removeKey
2749
+ );
2735
2750
  }
2736
2751
  currentAgents.push({
2737
2752
  name: agentName,
@@ -22417,7 +22417,7 @@ async function writeExtensionBackup(claudeDesktopConfigPath, mcpServers) {
22417
22417
 
22418
22418
  // package.json
22419
22419
  var package_default = {
22420
- version: "1.3.4"};
22420
+ version: "1.3.5"};
22421
22421
 
22422
22422
  // src/package-meta.ts
22423
22423
  var PACKAGE_VERSION = package_default.version;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "multicorn-shield",
3
- "version": "1.3.4",
3
+ "version": "1.3.5",
4
4
  "description": "The control layer for AI agents: permissions, consent, spending limits, and audit logging.",
5
5
  "license": "MIT",
6
6
  "author": "Multicorn AI Pty Ltd",