cadre-ai 1.1.0 → 1.1.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/package.json +1 -1
- package/scripts/cadre-cli.js +7 -11
package/package.json
CHANGED
package/scripts/cadre-cli.js
CHANGED
|
@@ -33,6 +33,7 @@ var import_node_path = __toESM(require("node:path"));
|
|
|
33
33
|
var import_node_child_process = require("node:child_process");
|
|
34
34
|
var PACKAGE_PLUGIN_NAME = "cadre";
|
|
35
35
|
var PACKAGE_DISPLAY_NAME = "Cadre";
|
|
36
|
+
var MARKETPLACE_PLUGIN_SOURCE = "./plugins/cadre";
|
|
36
37
|
function usage() {
|
|
37
38
|
return [
|
|
38
39
|
"Cadre CLI",
|
|
@@ -89,11 +90,7 @@ function runtimePaths() {
|
|
|
89
90
|
};
|
|
90
91
|
}
|
|
91
92
|
function commandExists(command) {
|
|
92
|
-
const result =
|
|
93
|
-
encoding: "utf8",
|
|
94
|
-
shell: process.platform !== "win32",
|
|
95
|
-
stdio: "ignore"
|
|
96
|
-
});
|
|
93
|
+
const result = process.platform === "win32" ? (0, import_node_child_process.spawnSync)("where", [command], { stdio: "ignore" }) : (0, import_node_child_process.spawnSync)("which", [command], { stdio: "ignore" });
|
|
97
94
|
return result.status === 0;
|
|
98
95
|
}
|
|
99
96
|
function selectedTargets(options) {
|
|
@@ -102,10 +99,9 @@ function selectedTargets(options) {
|
|
|
102
99
|
return ["codex", "claude"].filter((target) => commandExists(target));
|
|
103
100
|
}
|
|
104
101
|
function targetPaths(home, target) {
|
|
105
|
-
const pluginRoot = import_node_path.default.join(home, "plugins", target, PACKAGE_PLUGIN_NAME);
|
|
106
102
|
const marketplaceRoot = import_node_path.default.join(home, "marketplaces", target);
|
|
107
103
|
return {
|
|
108
|
-
pluginRoot,
|
|
104
|
+
pluginRoot: import_node_path.default.join(marketplaceRoot, "plugins", PACKAGE_PLUGIN_NAME),
|
|
109
105
|
marketplaceRoot,
|
|
110
106
|
marketplaceFile: target === "codex" ? import_node_path.default.join(marketplaceRoot, ".agents", "plugins", "marketplace.json") : import_node_path.default.join(marketplaceRoot, ".claude-plugin", "marketplace.json")
|
|
111
107
|
};
|
|
@@ -172,7 +168,7 @@ function mcpConfig(runtime) {
|
|
|
172
168
|
}
|
|
173
169
|
};
|
|
174
170
|
}
|
|
175
|
-
function marketplace(target,
|
|
171
|
+
function marketplace(target, runtime) {
|
|
176
172
|
const metadata = readPackageMetadata(runtime.runtimeRoot);
|
|
177
173
|
if (target === "codex") {
|
|
178
174
|
return {
|
|
@@ -180,7 +176,7 @@ function marketplace(target, pluginRoot, runtime) {
|
|
|
180
176
|
interface: { displayName: PACKAGE_DISPLAY_NAME },
|
|
181
177
|
plugins: [{
|
|
182
178
|
name: PACKAGE_PLUGIN_NAME,
|
|
183
|
-
source: { source: "local", path:
|
|
179
|
+
source: { source: "local", path: MARKETPLACE_PLUGIN_SOURCE },
|
|
184
180
|
policy: { installation: "AVAILABLE", authentication: "ON_INSTALL" },
|
|
185
181
|
category: "Productivity"
|
|
186
182
|
}]
|
|
@@ -192,7 +188,7 @@ function marketplace(target, pluginRoot, runtime) {
|
|
|
192
188
|
description: "Cadre MCP-first workflows for Claude Code.",
|
|
193
189
|
plugins: [{
|
|
194
190
|
name: PACKAGE_PLUGIN_NAME,
|
|
195
|
-
source:
|
|
191
|
+
source: MARKETPLACE_PLUGIN_SOURCE,
|
|
196
192
|
description: metadata.description,
|
|
197
193
|
version: metadata.version,
|
|
198
194
|
author: { name: "Vishal Kumar" },
|
|
@@ -221,7 +217,7 @@ function writeThinPlugin(target, paths, runtime, skillShim) {
|
|
|
221
217
|
writeJson(import_node_path.default.join(paths.pluginRoot, ".claude-plugin", "plugin.json"), pluginManifest(target, runtime));
|
|
222
218
|
writeJson(import_node_path.default.join(paths.pluginRoot, "mcp-config.json"), mcpConfig(runtime));
|
|
223
219
|
}
|
|
224
|
-
writeJson(paths.marketplaceFile, marketplace(target,
|
|
220
|
+
writeJson(paths.marketplaceFile, marketplace(target, runtime));
|
|
225
221
|
}
|
|
226
222
|
function installCommands(target, paths, scope) {
|
|
227
223
|
if (target === "codex") {
|