@sellable/install 0.1.77 → 0.1.78
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/bin/sellable-install.mjs +94 -9
- package/package.json +1 -1
package/bin/sellable-install.mjs
CHANGED
|
@@ -1127,15 +1127,24 @@ function agentTemplateRoot() {
|
|
|
1127
1127
|
|
|
1128
1128
|
function loadCanonicalAgents() {
|
|
1129
1129
|
const root = agentTemplateRoot();
|
|
1130
|
-
const registry = JSON.parse(
|
|
1130
|
+
const registry = JSON.parse(
|
|
1131
|
+
readFileSync(join(root, "registry.json"), "utf8")
|
|
1132
|
+
);
|
|
1131
1133
|
if (!Array.isArray(registry.agents)) {
|
|
1132
1134
|
throw new Error("Sellable agent registry is missing agents array.");
|
|
1133
1135
|
}
|
|
1134
1136
|
|
|
1135
1137
|
return registry.agents.map((agent) => {
|
|
1136
1138
|
const promptPath = join(root, agent.promptFile || "");
|
|
1137
|
-
if (
|
|
1138
|
-
|
|
1139
|
+
if (
|
|
1140
|
+
!agent.id ||
|
|
1141
|
+
!agent.name ||
|
|
1142
|
+
!agent.promptFile ||
|
|
1143
|
+
!existsSync(promptPath)
|
|
1144
|
+
) {
|
|
1145
|
+
throw new Error(
|
|
1146
|
+
`Invalid Sellable agent registry entry: ${agent.id || "unknown"}`
|
|
1147
|
+
);
|
|
1139
1148
|
}
|
|
1140
1149
|
if (agent.codex?.name && agent.codex.name !== agent.name) {
|
|
1141
1150
|
throw new Error(
|
|
@@ -1171,6 +1180,15 @@ function legacyClaudeCustomAgents() {
|
|
|
1171
1180
|
return loadCanonicalAgents().flatMap((agent) => agent.legacy?.claude || []);
|
|
1172
1181
|
}
|
|
1173
1182
|
|
|
1183
|
+
function legacyClaudeCommands() {
|
|
1184
|
+
return [
|
|
1185
|
+
{
|
|
1186
|
+
name: "sellable-create-campaign",
|
|
1187
|
+
filename: join("sellable", "create-campaign.md"),
|
|
1188
|
+
},
|
|
1189
|
+
];
|
|
1190
|
+
}
|
|
1191
|
+
|
|
1174
1192
|
function tomlArray(values) {
|
|
1175
1193
|
return `[${values.map((value) => quoteToml(value)).join(", ")}]`;
|
|
1176
1194
|
}
|
|
@@ -1246,7 +1264,9 @@ function writeCodexCustomAgents(home, opts) {
|
|
|
1246
1264
|
}
|
|
1247
1265
|
for (const agent of legacyCodexCustomAgents()) {
|
|
1248
1266
|
const legacyPath = join(home, "agents", agent.filename);
|
|
1249
|
-
logVerbose(
|
|
1267
|
+
logVerbose(
|
|
1268
|
+
`${C.grey}Removing legacy Codex scout agent ${legacyPath}${C.reset}`
|
|
1269
|
+
);
|
|
1250
1270
|
if (!opts.dryRun) rmSync(legacyPath, { force: true });
|
|
1251
1271
|
}
|
|
1252
1272
|
}
|
|
@@ -1262,9 +1282,22 @@ function writeClaudeCustomAgents(opts) {
|
|
|
1262
1282
|
}
|
|
1263
1283
|
for (const agent of legacyClaudeCustomAgents()) {
|
|
1264
1284
|
const legacyPath = join(home, "agents", agent.filename);
|
|
1265
|
-
logVerbose(
|
|
1285
|
+
logVerbose(
|
|
1286
|
+
`${C.grey}Removing legacy Claude scout agent ${legacyPath}${C.reset}`
|
|
1287
|
+
);
|
|
1266
1288
|
if (!opts.dryRun) rmSync(legacyPath, { force: true });
|
|
1267
1289
|
}
|
|
1290
|
+
removeLegacyClaudeCommands(home, opts);
|
|
1291
|
+
}
|
|
1292
|
+
|
|
1293
|
+
function removeLegacyClaudeCommands(home, opts) {
|
|
1294
|
+
for (const command of legacyClaudeCommands()) {
|
|
1295
|
+
const commandPath = join(home, "commands", command.filename);
|
|
1296
|
+
logVerbose(
|
|
1297
|
+
`${C.grey}Removing legacy Claude command ${commandPath}${C.reset}`
|
|
1298
|
+
);
|
|
1299
|
+
if (!opts.dryRun) rmSync(commandPath, { force: true });
|
|
1300
|
+
}
|
|
1268
1301
|
}
|
|
1269
1302
|
|
|
1270
1303
|
function installCodexDesktopPlugin(opts) {
|
|
@@ -1402,8 +1435,12 @@ config_file = ${quoteToml(join(home, "agents", agent.filename))}`
|
|
|
1402
1435
|
logVerbose(
|
|
1403
1436
|
`${C.grey}+ enable [features].default_mode_request_user_input in ${configPath}${C.reset}`
|
|
1404
1437
|
);
|
|
1405
|
-
logVerbose(
|
|
1406
|
-
|
|
1438
|
+
logVerbose(
|
|
1439
|
+
`${C.grey}+ write Codex custom agents in ${home}/agents${C.reset}`
|
|
1440
|
+
);
|
|
1441
|
+
logVerbose(
|
|
1442
|
+
`${C.grey}+ register Codex custom agents in ${configPath}${C.reset}`
|
|
1443
|
+
);
|
|
1407
1444
|
}
|
|
1408
1445
|
|
|
1409
1446
|
return {
|
|
@@ -1613,6 +1650,23 @@ function verify(opts) {
|
|
|
1613
1650
|
? "Claude scout MCP tool allowlists present"
|
|
1614
1651
|
: "Claude scout MCP tool allowlists missing",
|
|
1615
1652
|
});
|
|
1653
|
+
const legacyClaudePaths = [
|
|
1654
|
+
...legacyClaudeCustomAgents().map((agent) =>
|
|
1655
|
+
join(claudeHome(), "agents", agent.filename)
|
|
1656
|
+
),
|
|
1657
|
+
...legacyClaudeCommands().map((command) =>
|
|
1658
|
+
join(claudeHome(), "commands", command.filename)
|
|
1659
|
+
),
|
|
1660
|
+
];
|
|
1661
|
+
const hasNoLegacyClaudeArtifacts = legacyClaudePaths.every(
|
|
1662
|
+
(artifactPath) => !existsSync(artifactPath)
|
|
1663
|
+
);
|
|
1664
|
+
checks.push({
|
|
1665
|
+
ok: hasNoLegacyClaudeArtifacts,
|
|
1666
|
+
label: hasNoLegacyClaudeArtifacts
|
|
1667
|
+
? "Legacy Claude Sellable host artifacts cleaned"
|
|
1668
|
+
: "Legacy Claude Sellable host artifacts still present",
|
|
1669
|
+
});
|
|
1616
1670
|
}
|
|
1617
1671
|
if (opts.host === "codex" || opts.host === "all") {
|
|
1618
1672
|
checks.push({
|
|
@@ -1677,6 +1731,19 @@ function verify(opts) {
|
|
|
1677
1731
|
? "Codex custom scout agents registered"
|
|
1678
1732
|
: "Codex custom scout agents unregistered",
|
|
1679
1733
|
});
|
|
1734
|
+
const hasNoLegacyCodexAgents = legacyCodexCustomAgents().every((agent) => {
|
|
1735
|
+
const agentPath = join(codexHome(), "agents", agent.filename);
|
|
1736
|
+
return (
|
|
1737
|
+
!existsSync(agentPath) &&
|
|
1738
|
+
!configContent.includes(`[agents.${agent.name}]`)
|
|
1739
|
+
);
|
|
1740
|
+
});
|
|
1741
|
+
checks.push({
|
|
1742
|
+
ok: hasNoLegacyCodexAgents,
|
|
1743
|
+
label: hasNoLegacyCodexAgents
|
|
1744
|
+
? "Legacy Codex custom scout agents cleaned"
|
|
1745
|
+
: "Legacy Codex custom scout agents still present",
|
|
1746
|
+
});
|
|
1680
1747
|
const hasFlag = configContent.includes(
|
|
1681
1748
|
"default_mode_request_user_input = true"
|
|
1682
1749
|
);
|
|
@@ -1905,7 +1972,10 @@ function runUninstall() {
|
|
|
1905
1972
|
after = removeTomlSection(after, "marketplaces.sellable");
|
|
1906
1973
|
after = removeTomlSection(after, 'plugins."sellable@sellable"');
|
|
1907
1974
|
after = removeTomlSection(after, 'plugins."sellable@sellable-local"');
|
|
1908
|
-
for (const agent of [
|
|
1975
|
+
for (const agent of [
|
|
1976
|
+
...codexCustomAgents(),
|
|
1977
|
+
...legacyCodexCustomAgents(),
|
|
1978
|
+
]) {
|
|
1909
1979
|
after = removeTomlSection(after, `agents.${agent.name}`);
|
|
1910
1980
|
}
|
|
1911
1981
|
// Collapse 3+ blank lines that the removals may leave behind.
|
|
@@ -1955,7 +2025,10 @@ function runUninstall() {
|
|
|
1955
2025
|
skipped.push(`Claude Code CLI not found`);
|
|
1956
2026
|
}
|
|
1957
2027
|
|
|
1958
|
-
for (const agent of [
|
|
2028
|
+
for (const agent of [
|
|
2029
|
+
...claudeCustomAgents(),
|
|
2030
|
+
...legacyClaudeCustomAgents(),
|
|
2031
|
+
]) {
|
|
1959
2032
|
const agentPath = join(claudeHome(), "agents", agent.filename);
|
|
1960
2033
|
if (!existsSync(agentPath)) continue;
|
|
1961
2034
|
try {
|
|
@@ -1967,6 +2040,18 @@ function runUninstall() {
|
|
|
1967
2040
|
);
|
|
1968
2041
|
}
|
|
1969
2042
|
}
|
|
2043
|
+
for (const command of legacyClaudeCommands()) {
|
|
2044
|
+
const commandPath = join(claudeHome(), "commands", command.filename);
|
|
2045
|
+
if (!existsSync(commandPath)) continue;
|
|
2046
|
+
try {
|
|
2047
|
+
rmSync(commandPath, { force: true });
|
|
2048
|
+
removed.push(`${commandPath}`);
|
|
2049
|
+
} catch (err) {
|
|
2050
|
+
console.log(
|
|
2051
|
+
` ${C.yellow}!${C.reset} Could not remove ${commandPath}: ${err instanceof Error ? err.message : String(err)}`
|
|
2052
|
+
);
|
|
2053
|
+
}
|
|
2054
|
+
}
|
|
1970
2055
|
|
|
1971
2056
|
// 3) Surgical removal of Sellable-installed artifacts inside ~/.sellable/
|
|
1972
2057
|
const sellableDir = join(homedir(), ".sellable");
|