itismyskillmarket 1.3.41 → 1.3.42
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.
|
@@ -581,6 +581,56 @@ var SaitecAdapter = class extends BaseAdapter {
|
|
|
581
581
|
}
|
|
582
582
|
};
|
|
583
583
|
|
|
584
|
+
// src/adapters/codex.ts
|
|
585
|
+
import path9 from "path";
|
|
586
|
+
import os9 from "os";
|
|
587
|
+
import fs10 from "fs-extra";
|
|
588
|
+
var CodexAdapter = class extends BaseAdapter {
|
|
589
|
+
id = "codex";
|
|
590
|
+
name = "Codex CLI";
|
|
591
|
+
skillDir = path9.join(os9.homedir(), ".codex", "skills");
|
|
592
|
+
async isAvailable() {
|
|
593
|
+
if (process.env.CODEX_CLI) return true;
|
|
594
|
+
try {
|
|
595
|
+
return await fs10.pathExists(path9.join(os9.homedir(), ".codex"));
|
|
596
|
+
} catch {
|
|
597
|
+
return false;
|
|
598
|
+
}
|
|
599
|
+
}
|
|
600
|
+
async isInstalled(skillId) {
|
|
601
|
+
try {
|
|
602
|
+
return await fs10.pathExists(path9.join(this.skillDir, skillId));
|
|
603
|
+
} catch {
|
|
604
|
+
return false;
|
|
605
|
+
}
|
|
606
|
+
}
|
|
607
|
+
async install(skillId, sourceDir) {
|
|
608
|
+
await fs10.ensureDir(this.skillDir);
|
|
609
|
+
const targetDir = path9.join(this.skillDir, skillId);
|
|
610
|
+
if (await fs10.pathExists(targetDir)) {
|
|
611
|
+
await fs10.remove(targetDir);
|
|
612
|
+
}
|
|
613
|
+
await fs10.copy(sourceDir, targetDir, { recursive: true });
|
|
614
|
+
}
|
|
615
|
+
async uninstall(skillId) {
|
|
616
|
+
const targetDir = path9.join(this.skillDir, skillId);
|
|
617
|
+
if (await fs10.pathExists(targetDir)) {
|
|
618
|
+
await fs10.remove(targetDir);
|
|
619
|
+
}
|
|
620
|
+
}
|
|
621
|
+
async listInstalled() {
|
|
622
|
+
try {
|
|
623
|
+
if (!await fs10.pathExists(this.skillDir)) {
|
|
624
|
+
return [];
|
|
625
|
+
}
|
|
626
|
+
const entries = await fs10.readdir(this.skillDir, { withFileTypes: true });
|
|
627
|
+
return entries.filter((entry) => entry.isDirectory()).map((entry) => entry.name);
|
|
628
|
+
} catch {
|
|
629
|
+
return [];
|
|
630
|
+
}
|
|
631
|
+
}
|
|
632
|
+
};
|
|
633
|
+
|
|
584
634
|
// src/adapters/registry.ts
|
|
585
635
|
var adapters = /* @__PURE__ */ new Map();
|
|
586
636
|
function registerAdapters() {
|
|
@@ -590,12 +640,14 @@ function registerAdapters() {
|
|
|
590
640
|
const openclaw = new OpenClawAdapter();
|
|
591
641
|
const hermes = new HermesAdapter();
|
|
592
642
|
const saitec = new SaitecAdapter();
|
|
643
|
+
const codex = new CodexAdapter();
|
|
593
644
|
adapters.set(opencode.id, opencode);
|
|
594
645
|
adapters.set(claude.id, claude);
|
|
595
646
|
adapters.set(vscode.id, vscode);
|
|
596
647
|
adapters.set(openclaw.id, openclaw);
|
|
597
648
|
adapters.set(hermes.id, hermes);
|
|
598
649
|
adapters.set(saitec.id, saitec);
|
|
650
|
+
adapters.set(codex.id, codex);
|
|
599
651
|
}
|
|
600
652
|
registerAdapters();
|
|
601
653
|
async function detectPlatforms() {
|
|
@@ -617,8 +669,8 @@ function getAdapterByPlatform(platform) {
|
|
|
617
669
|
vscode: "vscode",
|
|
618
670
|
cursor: "opencode",
|
|
619
671
|
// Cursor uses OpenCode-compatible structure
|
|
620
|
-
codex: "
|
|
621
|
-
// Codex
|
|
672
|
+
codex: "codex",
|
|
673
|
+
// Codex has its own adapter
|
|
622
674
|
antigravity: "opencode",
|
|
623
675
|
// Antigravity uses OpenCode-compatible structure
|
|
624
676
|
openclaw: "openclaw",
|
|
@@ -629,8 +681,8 @@ function getAdapterByPlatform(platform) {
|
|
|
629
681
|
}
|
|
630
682
|
|
|
631
683
|
// src/commands/install.ts
|
|
632
|
-
import
|
|
633
|
-
import
|
|
684
|
+
import fs11 from "fs-extra";
|
|
685
|
+
import path10 from "path";
|
|
634
686
|
import { exec } from "child_process";
|
|
635
687
|
import { promisify } from "util";
|
|
636
688
|
import * as tar from "tar";
|
|
@@ -642,11 +694,11 @@ async function installSkill(skillId, version, options) {
|
|
|
642
694
|
if (options?.sourceDir) {
|
|
643
695
|
console.log(`Installing ${skillId} from local source...`);
|
|
644
696
|
pkgRoot = options.sourceDir;
|
|
645
|
-
const pkgJsonPath =
|
|
697
|
+
const pkgJsonPath = path10.join(pkgRoot, "package.json");
|
|
646
698
|
targetVersion = version || "0.0.0";
|
|
647
|
-
if (await
|
|
699
|
+
if (await fs11.pathExists(pkgJsonPath)) {
|
|
648
700
|
try {
|
|
649
|
-
const pkg = JSON.parse(await
|
|
701
|
+
const pkg = JSON.parse(await fs11.readFile(pkgJsonPath, "utf-8"));
|
|
650
702
|
if (pkg.version) targetVersion = pkg.version;
|
|
651
703
|
} catch {
|
|
652
704
|
}
|
|
@@ -663,20 +715,20 @@ async function installSkill(skillId, version, options) {
|
|
|
663
715
|
throw new Error(`No version found for ${packageName}`);
|
|
664
716
|
}
|
|
665
717
|
const cacheDir = getCacheDir();
|
|
666
|
-
const targetDir =
|
|
667
|
-
if (!await
|
|
718
|
+
const targetDir = path10.join(cacheDir, `${packageName}@${targetVersion}`);
|
|
719
|
+
if (!await fs11.pathExists(targetDir)) {
|
|
668
720
|
console.log("Downloading package...");
|
|
669
|
-
await
|
|
721
|
+
await fs11.ensureDir(cacheDir);
|
|
670
722
|
try {
|
|
671
723
|
const { stdout } = await execAsync(
|
|
672
724
|
`npm pack ${packageName}@${targetVersion} --pack-destination "${cacheDir}"`
|
|
673
725
|
);
|
|
674
726
|
const tarballName = stdout.trim();
|
|
675
|
-
const tarballPath =
|
|
676
|
-
if (await
|
|
727
|
+
const tarballPath = path10.join(cacheDir, tarballName);
|
|
728
|
+
if (await fs11.pathExists(tarballPath)) {
|
|
677
729
|
await tar.extract({ file: tarballPath, cwd: cacheDir });
|
|
678
|
-
await
|
|
679
|
-
await
|
|
730
|
+
await fs11.remove(tarballPath);
|
|
731
|
+
await fs11.move(path10.join(cacheDir, "package"), targetDir, { overwrite: true });
|
|
680
732
|
}
|
|
681
733
|
} catch (err) {
|
|
682
734
|
throw new Error(`Failed to download package: ${err}`);
|
|
@@ -685,29 +737,29 @@ async function installSkill(skillId, version, options) {
|
|
|
685
737
|
pkgRoot = targetDir;
|
|
686
738
|
}
|
|
687
739
|
const skillsDir = getSkillsDir();
|
|
688
|
-
const skillVersionDir =
|
|
740
|
+
const skillVersionDir = path10.join(skillsDir, `${skillId}@${targetVersion}`);
|
|
689
741
|
console.log("Setting up skill...");
|
|
690
|
-
await
|
|
691
|
-
if (await
|
|
692
|
-
await
|
|
693
|
-
|
|
694
|
-
|
|
742
|
+
await fs11.ensureDir(skillVersionDir);
|
|
743
|
+
if (await fs11.pathExists(path10.join(pkgRoot, "SKILL.md"))) {
|
|
744
|
+
await fs11.copy(
|
|
745
|
+
path10.join(pkgRoot, "SKILL.md"),
|
|
746
|
+
path10.join(skillVersionDir, "SKILL.md")
|
|
695
747
|
);
|
|
696
748
|
}
|
|
697
|
-
if (await
|
|
698
|
-
await
|
|
699
|
-
|
|
700
|
-
|
|
749
|
+
if (await fs11.pathExists(path10.join(pkgRoot, "metadata.json"))) {
|
|
750
|
+
await fs11.copy(
|
|
751
|
+
path10.join(pkgRoot, "metadata.json"),
|
|
752
|
+
path10.join(skillVersionDir, "metadata.json")
|
|
701
753
|
);
|
|
702
754
|
}
|
|
703
|
-
const skillDir =
|
|
704
|
-
await
|
|
705
|
-
const latestLink =
|
|
755
|
+
const skillDir = path10.join(skillsDir, skillId);
|
|
756
|
+
await fs11.ensureDir(skillDir);
|
|
757
|
+
const latestLink = path10.join(skillDir, LATEST_LINK);
|
|
706
758
|
try {
|
|
707
|
-
await
|
|
708
|
-
await
|
|
759
|
+
await fs11.remove(latestLink);
|
|
760
|
+
await fs11.symlink(skillVersionDir, latestLink, "junction");
|
|
709
761
|
} catch {
|
|
710
|
-
await
|
|
762
|
+
await fs11.copy(skillVersionDir, path10.join(skillDir, LATEST_LINK), { overwrite: true });
|
|
711
763
|
}
|
|
712
764
|
let targetAdapters = [];
|
|
713
765
|
if (options?.platforms && options.platforms.length > 0) {
|
|
@@ -768,8 +820,8 @@ Installing to ${targetAdapters.length} platform(s)...
|
|
|
768
820
|
}
|
|
769
821
|
|
|
770
822
|
// src/commands/uninstall.ts
|
|
771
|
-
import
|
|
772
|
-
import
|
|
823
|
+
import fs12 from "fs-extra";
|
|
824
|
+
import path11 from "path";
|
|
773
825
|
import readline from "readline";
|
|
774
826
|
async function askConfirmation(message) {
|
|
775
827
|
const rl = readline.createInterface({
|
|
@@ -794,12 +846,12 @@ async function getUninstallPreview(skillId, options) {
|
|
|
794
846
|
platformNames = adapters2.map((a) => a.name);
|
|
795
847
|
}
|
|
796
848
|
const skillsDir = getSkillsDir();
|
|
797
|
-
const localPath =
|
|
849
|
+
const localPath = path11.join(skillsDir, skillId);
|
|
798
850
|
const platformLinksDir = getPlatformLinksDir();
|
|
799
851
|
const platformLinks = [];
|
|
800
852
|
for (const platform of PLATFORMS) {
|
|
801
|
-
const linkPath =
|
|
802
|
-
if (await
|
|
853
|
+
const linkPath = path11.join(platformLinksDir, platform, "skills", skillId);
|
|
854
|
+
if (await fs12.pathExists(linkPath)) {
|
|
803
855
|
platformLinks.push(linkPath);
|
|
804
856
|
}
|
|
805
857
|
}
|
|
@@ -878,17 +930,17 @@ Uninstalling from ${validAdapters.length} platform(s)...
|
|
|
878
930
|
}
|
|
879
931
|
}
|
|
880
932
|
const skillsDir = getSkillsDir();
|
|
881
|
-
const skillDir =
|
|
882
|
-
if (await
|
|
883
|
-
await
|
|
933
|
+
const skillDir = path11.join(skillsDir, skillId);
|
|
934
|
+
if (await fs12.pathExists(skillDir)) {
|
|
935
|
+
await fs12.remove(skillDir);
|
|
884
936
|
console.log(`\u2705 Removed local files: ${skillDir}`);
|
|
885
937
|
}
|
|
886
938
|
const platformLinksDir = getPlatformLinksDir();
|
|
887
939
|
let removedLinks = 0;
|
|
888
940
|
for (const platform of PLATFORMS) {
|
|
889
|
-
const linkPath =
|
|
890
|
-
if (await
|
|
891
|
-
await
|
|
941
|
+
const linkPath = path11.join(platformLinksDir, platform, "skills", skillId);
|
|
942
|
+
if (await fs12.pathExists(linkPath)) {
|
|
943
|
+
await fs12.remove(linkPath);
|
|
892
944
|
removedLinks++;
|
|
893
945
|
}
|
|
894
946
|
}
|
|
@@ -1597,9 +1649,9 @@ async function adminAccess(skillId, level) {
|
|
|
1597
1649
|
}
|
|
1598
1650
|
|
|
1599
1651
|
// src/commands/config.ts
|
|
1600
|
-
import
|
|
1601
|
-
import
|
|
1602
|
-
import
|
|
1652
|
+
import path12 from "path";
|
|
1653
|
+
import fs13 from "fs-extra";
|
|
1654
|
+
import os10 from "os";
|
|
1603
1655
|
var CONFIG_DEFINITIONS = [
|
|
1604
1656
|
{
|
|
1605
1657
|
key: "npmScope",
|
|
@@ -1633,13 +1685,13 @@ var CONFIG_DEFINITIONS = [
|
|
|
1633
1685
|
}
|
|
1634
1686
|
];
|
|
1635
1687
|
function getConfigPath() {
|
|
1636
|
-
return
|
|
1688
|
+
return path12.join(os10.homedir(), ".skillmarket", "config.json");
|
|
1637
1689
|
}
|
|
1638
1690
|
async function readConfigFile() {
|
|
1639
1691
|
try {
|
|
1640
1692
|
const configPath = getConfigPath();
|
|
1641
|
-
if (await
|
|
1642
|
-
const data = await
|
|
1693
|
+
if (await fs13.pathExists(configPath)) {
|
|
1694
|
+
const data = await fs13.readJson(configPath);
|
|
1643
1695
|
const valid = {};
|
|
1644
1696
|
for (const def of CONFIG_DEFINITIONS) {
|
|
1645
1697
|
if (data[def.key] !== void 0) {
|
|
@@ -1654,11 +1706,11 @@ async function readConfigFile() {
|
|
|
1654
1706
|
}
|
|
1655
1707
|
async function writeConfigFile(updates) {
|
|
1656
1708
|
const configPath = getConfigPath();
|
|
1657
|
-
await
|
|
1709
|
+
await fs13.ensureDir(path12.dirname(configPath));
|
|
1658
1710
|
let existing = {};
|
|
1659
1711
|
try {
|
|
1660
|
-
if (await
|
|
1661
|
-
existing = await
|
|
1712
|
+
if (await fs13.pathExists(configPath)) {
|
|
1713
|
+
existing = await fs13.readJson(configPath);
|
|
1662
1714
|
}
|
|
1663
1715
|
} catch {
|
|
1664
1716
|
}
|
|
@@ -1668,25 +1720,25 @@ async function writeConfigFile(updates) {
|
|
|
1668
1720
|
delete merged[key];
|
|
1669
1721
|
}
|
|
1670
1722
|
}
|
|
1671
|
-
await
|
|
1723
|
+
await fs13.writeJson(configPath, merged, { spaces: 2 });
|
|
1672
1724
|
return merged;
|
|
1673
1725
|
}
|
|
1674
1726
|
async function removeConfigKeys(keys) {
|
|
1675
1727
|
const configPath = getConfigPath();
|
|
1676
|
-
if (!await
|
|
1728
|
+
if (!await fs13.pathExists(configPath)) return;
|
|
1677
1729
|
try {
|
|
1678
|
-
const existing = await
|
|
1730
|
+
const existing = await fs13.readJson(configPath);
|
|
1679
1731
|
for (const key of keys) {
|
|
1680
1732
|
delete existing[key];
|
|
1681
1733
|
}
|
|
1682
|
-
await
|
|
1734
|
+
await fs13.writeJson(configPath, existing, { spaces: 2 });
|
|
1683
1735
|
} catch {
|
|
1684
1736
|
}
|
|
1685
1737
|
}
|
|
1686
1738
|
async function removeConfigFile() {
|
|
1687
1739
|
const configPath = getConfigPath();
|
|
1688
|
-
if (await
|
|
1689
|
-
await
|
|
1740
|
+
if (await fs13.pathExists(configPath)) {
|
|
1741
|
+
await fs13.remove(configPath);
|
|
1690
1742
|
}
|
|
1691
1743
|
}
|
|
1692
1744
|
async function getAllConfig() {
|
package/dist/electron-entry.js
CHANGED
package/dist/index.js
CHANGED