@cotal-ai/connector-claude-code 0.91.0 → 0.92.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.
package/dist/index.js CHANGED
@@ -6892,6 +6892,7 @@ import { homedir as homedir3 } from "node:os";
6892
6892
  import { dirname as dirname2, join as join4, relative } from "node:path";
6893
6893
  import { fileURLToPath } from "node:url";
6894
6894
  import {
6895
+ acquireLock,
6895
6896
  globalConfigPath,
6896
6897
  mcpServerProblem as mcpServerProblem2,
6897
6898
  registry as registry3,
@@ -21781,7 +21782,7 @@ config(en_default());
21781
21782
  import { isConcreteChannel as isConcreteChannel3, channelInAllow as channelInAllow3, AmbiguousPeerError, peerLabel as peerLabel4, assertLifecycleToken as assertLifecycleToken3, isPermissionDenied as isPermissionDenied2, renderLifecycleBlocked, EpEnvelopeError as EpEnvelopeError3, LANG_PROBLEM_DETAIL_KIND, formatAge, presenceAges, presenceText } from "@cotal-ai/core";
21782
21783
 
21783
21784
  // ../connector-core/dist/orientation.js
21784
- import { peerLabel as peerLabel3 } from "@cotal-ai/core";
21785
+ import { parsePrincipalKey as parsePrincipalKey2, peerLabel as peerLabel3 } from "@cotal-ai/core";
21785
21786
 
21786
21787
  // ../connector-core/dist/docs.js
21787
21788
  var STOP = new Set("a an and are as at be by do for from has how in is it of on or that the this to use using was what when where which who with you your".split(" "));
@@ -23697,6 +23698,14 @@ function cotalHome() {
23697
23698
  function marketplaceDir() {
23698
23699
  return join4(cotalHome(), "claude-plugin");
23699
23700
  }
23701
+ function withPluginLock(run) {
23702
+ const lock = acquireLock(join4(marketplaceDir(), ".setup.lock"), { label: "Claude plugin setup" });
23703
+ try {
23704
+ return run();
23705
+ } finally {
23706
+ lock.release();
23707
+ }
23708
+ }
23700
23709
  function materialize(name, root, assets, version2, files = {}) {
23701
23710
  const market = marketplaceDir();
23702
23711
  mkdirSync(market, { recursive: true });
@@ -23981,12 +23990,14 @@ var claudeSetupProvider = {
23981
23990
  explain: "Installs Cotal messaging for Claude Code, including supported local sessions in Desktop's Code tab. Reopen Claude after setup.",
23982
23991
  context: [DOCS_URL],
23983
23992
  run({ cotal }) {
23984
- const version2 = materializeCotal(cotal);
23985
- install("cotal", "user", version2);
23986
- const app = desktop(cotal, true);
23987
- const removed = retireProjectInstalls();
23988
- const replaced = removed ? `, replacing ${removed} project install${removed === 1 ? "" : "s"}` : "";
23989
- return `cotal@${MARKETPLACE} (user scope${replaced})${app ? `; ${app}` : ""}`;
23993
+ return withPluginLock(() => {
23994
+ const version2 = materializeCotal(cotal);
23995
+ install("cotal", "user", version2);
23996
+ const app = desktop(cotal, true);
23997
+ const removed = retireProjectInstalls();
23998
+ const replaced = removed ? `, replacing ${removed} project install${removed === 1 ? "" : "s"}` : "";
23999
+ return `cotal@${MARKETPLACE} (user scope${replaced})${app ? `; ${app}` : ""}`;
24000
+ });
23990
24001
  }
23991
24002
  },
23992
24003
  refresh: {
@@ -23995,28 +24006,30 @@ var claudeSetupProvider = {
23995
24006
  explain: "Rewrites the copy of the Cotal plugin that Claude Code sessions load, and Cotal's entry in Claude Desktop, for this release.",
23996
24007
  context: [DOCS_URL],
23997
24008
  run({ cotal, skills }) {
23998
- const entries = installedForRefresh();
23999
- const installs = entries.filter((entry) => entry.id === `cotal@${MARKETPLACE}`);
24000
- const skillInstalls = entries.filter((entry) => entry.id === `cotal-skills@${MARKETPLACE}`);
24001
- const path = desktopConfigPath();
24002
- const app = path !== void 0 && readDesktopEntry(path) !== void 0;
24003
- if (!installs.length && !skillInstalls.length && !app) return "not installed";
24004
- if (skillInstalls.length && !skills) throw new Error("current skills are required to refresh the installed Claude skills plugin");
24005
- const version2 = installs.length || app ? materializeCotal(cotal) : void 0;
24006
- if (skillInstalls.length) materializeSkills(skills);
24007
- if (installs.length || skillInstalls.length) writeMarketplace();
24008
- const parts = [];
24009
- if (installs.length) {
24010
- refreshInstalls("cotal", installs, version2);
24011
- parts.push(`cotal@${MARKETPLACE} ${version2}; reload plugins or reopen Claude to load it in running sessions`);
24012
- }
24013
- if (skillInstalls.length) {
24014
- refreshInstalls("cotal-skills", skillInstalls, skills.version);
24015
- parts.push(`cotal-skills@${MARKETPLACE} ${skills.version}`);
24016
- }
24017
- const desktopText = app ? desktop(cotal, false) : void 0;
24018
- if (desktopText) parts.push(desktopText);
24019
- return parts.join("; ");
24009
+ return withPluginLock(() => {
24010
+ const entries = installedForRefresh();
24011
+ const installs = entries.filter((entry) => entry.id === `cotal@${MARKETPLACE}`);
24012
+ const skillInstalls = entries.filter((entry) => entry.id === `cotal-skills@${MARKETPLACE}`);
24013
+ const path = desktopConfigPath();
24014
+ const app = path !== void 0 && readDesktopEntry(path) !== void 0;
24015
+ if (!installs.length && !skillInstalls.length && !app) return "not installed";
24016
+ if (skillInstalls.length && !skills) throw new Error("current skills are required to refresh the installed Claude skills plugin");
24017
+ const version2 = installs.length || app ? materializeCotal(cotal) : void 0;
24018
+ if (skillInstalls.length) materializeSkills(skills);
24019
+ if (installs.length || skillInstalls.length) writeMarketplace();
24020
+ const parts = [];
24021
+ if (installs.length) {
24022
+ refreshInstalls("cotal", installs, version2);
24023
+ parts.push(`cotal@${MARKETPLACE} ${version2}; reload plugins or reopen Claude to load it in running sessions`);
24024
+ }
24025
+ if (skillInstalls.length) {
24026
+ refreshInstalls("cotal-skills", skillInstalls, skills.version);
24027
+ parts.push(`cotal-skills@${MARKETPLACE} ${skills.version}`);
24028
+ }
24029
+ const desktopText = app ? desktop(cotal, false) : void 0;
24030
+ if (desktopText) parts.push(desktopText);
24031
+ return parts.join("; ");
24032
+ });
24020
24033
  }
24021
24034
  },
24022
24035
  skills: {
@@ -24025,9 +24038,11 @@ var claudeSetupProvider = {
24025
24038
  explain: "Installs Cotal's authored skills as a Claude Code plugin.",
24026
24039
  context: [DOCS_URL],
24027
24040
  run(input) {
24028
- materializeSkills(input);
24029
- install("cotal-skills", "user", input.version);
24030
- return `cotal-skills@${MARKETPLACE} (user scope)`;
24041
+ return withPluginLock(() => {
24042
+ materializeSkills(input);
24043
+ install("cotal-skills", "user", input.version);
24044
+ return `cotal-skills@${MARKETPLACE} (user scope)`;
24045
+ });
24031
24046
  }
24032
24047
  },
24033
24048
  mcpServers: {