msdevflow 0.8.0 → 0.8.1

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/LICENSE CHANGED
@@ -1,6 +1,6 @@
1
1
  MIT License
2
2
 
3
- Copyright (c) [year] [fullname]
3
+ Copyright (c) 2025-2026 GitCode msdevflow contributors
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  of this software and associated documentation files (the "Software"), to deal
package/lib/bootstrap.js CHANGED
@@ -1180,10 +1180,16 @@ function npmGitcodeDiagnosis(executable, doctor) {
1180
1180
  };
1181
1181
  }
1182
1182
  } catch {
1183
- // Fall through to the fail-closed ownership error.
1183
+ // Fall through to coexist.
1184
1184
  }
1185
1185
  }
1186
- throw new BootstrapError(`Existing gitcode has unknown ownership: ${executable}. Refusing to overwrite it.`, 3);
1186
+ // doctor failed: existing gitcode is not the npm official CLI.
1187
+ // Coexist by installing npm CLI alongside and using gitcode-npm.
1188
+ return {
1189
+ classification: "python", // triggers coexist mode, installs npm CLI separately
1190
+ existingExecutable: executable,
1191
+ workflowCommand: "gitcode-npm",
1192
+ };
1187
1193
  }
1188
1194
 
1189
1195
  export function diagnoseGitcode(run, platform) {
@@ -1562,6 +1568,32 @@ function writeWrapper(details, platform) {
1562
1568
  }
1563
1569
  }
1564
1570
 
1571
+ function removeNpmGitcodeShims(npmPrefix, platform) {
1572
+ const pathApi = platform === "win32" ? path.win32 : path.posix;
1573
+ const candidates = platform === "win32"
1574
+ ? ["gitcode.cmd", "gitcode"]
1575
+ : ["gitcode"];
1576
+ for (const name of candidates) {
1577
+ const file = pathApi.join(npmPrefix, name);
1578
+ try {
1579
+ const metadata = lstatSync(file);
1580
+ if (metadata.isSymbolicLink() || !metadata.isFile()) {
1581
+ continue;
1582
+ }
1583
+ const content = readFileSync(file, "utf8");
1584
+ // Only remove if it looks like an npm shim for @gitcode-cli/cli.
1585
+ if (!/@gitcode-cli|gitcode\.js/i.test(content)) {
1586
+ continue;
1587
+ }
1588
+ unlinkSync(file);
1589
+ } catch (error) {
1590
+ if (error?.code !== "ENOENT") {
1591
+ throw error;
1592
+ }
1593
+ }
1594
+ }
1595
+ }
1596
+
1565
1597
  async function installGitcode(plan, runLong, run, platform) {
1566
1598
  await runLong(plan.installInvocation);
1567
1599
  if (plan.gitcodeInstall.mode === "coexist") {
@@ -1570,6 +1602,8 @@ async function installGitcode(plan, runLong, run, platform) {
1570
1602
  `Installed GitCode npm CLI target not found: ${plan.gitcodeInstall.cliTarget}.`,
1571
1603
  );
1572
1604
  writeWrapper(plan.gitcodeInstall, platform);
1605
+ // Remove any global npm gitcode shims so PATH falls through to Python gitcode.
1606
+ removeNpmGitcodeShims(plan.gitcodeInstall.wrapperDir, platform);
1573
1607
  return {
1574
1608
  command: plan.gitcodeInstall.workflowCommand,
1575
1609
  executable: plan.gitcodeInstall.wrapper,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "msdevflow",
3
- "version": "0.8.0",
3
+ "version": "0.8.1",
4
4
  "description": "Install the msdevflow GitCode skill and its runtime dependencies",
5
5
  "type": "module",
6
6
  "bin": {
@@ -27,5 +27,5 @@
27
27
  "gitcode",
28
28
  "setup"
29
29
  ],
30
- "license": "UNLICENSED"
30
+ "license": "MIT"
31
31
  }