@orchid-labs/pluxx 0.1.19 → 0.1.20
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/cli/index.js +86 -8
- package/dist/cli/publish.d.ts.map +1 -1
- package/dist/index.js +86 -8
- package/package.json +1 -1
package/dist/cli/index.js
CHANGED
|
@@ -24455,17 +24455,18 @@ function renderInstallerUserConfigSnippet(config, platform, installDirVariable)
|
|
|
24455
24455
|
if (entries.length === 0) return "";
|
|
24456
24456
|
const promptLines = entries.map((entry) => {
|
|
24457
24457
|
const functionName = entry.type === "secret" ? "pluxx_prompt_secret_config" : "pluxx_prompt_text_config";
|
|
24458
|
-
return `${functionName} ${JSON.stringify(entry.envVar)} ${JSON.stringify(entry.title)} ${entry.required ? "1" : "0"}`;
|
|
24458
|
+
return `${functionName} ${JSON.stringify(entry.key)} ${JSON.stringify(entry.envVar)} ${JSON.stringify(entry.title)} ${entry.required ? "1" : "0"}`;
|
|
24459
24459
|
});
|
|
24460
24460
|
return `
|
|
24461
24461
|
PLUXX_USER_CONFIG_SPEC="$(cat <<'PLUXX_USER_CONFIG_JSON'
|
|
24462
24462
|
${JSON.stringify(entries)}
|
|
24463
24463
|
PLUXX_USER_CONFIG_JSON
|
|
24464
24464
|
)"
|
|
24465
|
+
PLUXX_REUSED_USER_CONFIG=0
|
|
24465
24466
|
|
|
24466
24467
|
pluxx_is_placeholder_secret() {
|
|
24467
24468
|
case "$1" in
|
|
24468
|
-
*dummy*|*Dummy*|*DUMMY*|*placeholder*|*Placeholder*|*PLACEHOLDER*|*changeme*|*CHANGE_ME*|*replace*me*|*Replace*Me*|*your*key*|*YOUR*KEY*|*api*key*here*|*API*KEY*HERE*|*token*here*|*TOKEN*HERE*)
|
|
24469
|
+
*dummy*|*Dummy*|*DUMMY*|*placeholder*|*Placeholder*|*PLACEHOLDER*|*example*|*Example*|*EXAMPLE*|*changeme*|*CHANGE_ME*|*replace*me*|*Replace*Me*|*your*key*|*YOUR*KEY*|*api*key*here*|*API*KEY*HERE*|*token*here*|*TOKEN*HERE*)
|
|
24469
24470
|
return 0
|
|
24470
24471
|
;;
|
|
24471
24472
|
*)
|
|
@@ -24474,12 +24475,61 @@ pluxx_is_placeholder_secret() {
|
|
|
24474
24475
|
esac
|
|
24475
24476
|
}
|
|
24476
24477
|
|
|
24478
|
+
pluxx_saved_config_value() {
|
|
24479
|
+
local key="$1"
|
|
24480
|
+
local env_var="$2"
|
|
24481
|
+
|
|
24482
|
+
if [[ -z "\${PLUXX_SAVED_USER_CONFIG_PATH:-}" || ! -f "$PLUXX_SAVED_USER_CONFIG_PATH" ]]; then
|
|
24483
|
+
return 1
|
|
24484
|
+
fi
|
|
24485
|
+
|
|
24486
|
+
PLUXX_SAVED_CONFIG_KEY="$key" PLUXX_SAVED_CONFIG_ENV_VAR="$env_var" node <<'NODE'
|
|
24487
|
+
const fs = require('fs')
|
|
24488
|
+
|
|
24489
|
+
const filepath = process.env.PLUXX_SAVED_USER_CONFIG_PATH
|
|
24490
|
+
const key = process.env.PLUXX_SAVED_CONFIG_KEY
|
|
24491
|
+
const envVar = process.env.PLUXX_SAVED_CONFIG_ENV_VAR
|
|
24492
|
+
|
|
24493
|
+
try {
|
|
24494
|
+
const payload = JSON.parse(fs.readFileSync(filepath, 'utf8'))
|
|
24495
|
+
const candidates = [
|
|
24496
|
+
payload && payload.env && envVar ? payload.env[envVar] : undefined,
|
|
24497
|
+
payload && payload.values && key ? payload.values[key] : undefined,
|
|
24498
|
+
]
|
|
24499
|
+
|
|
24500
|
+
for (const candidate of candidates) {
|
|
24501
|
+
if (candidate === undefined || candidate === null) continue
|
|
24502
|
+
if (!['string', 'number', 'boolean'].includes(typeof candidate)) continue
|
|
24503
|
+
const value = String(candidate)
|
|
24504
|
+
if (value === '') continue
|
|
24505
|
+
process.stdout.write(value)
|
|
24506
|
+
process.exit(0)
|
|
24507
|
+
}
|
|
24508
|
+
} catch {}
|
|
24509
|
+
|
|
24510
|
+
process.exit(1)
|
|
24511
|
+
NODE
|
|
24512
|
+
}
|
|
24513
|
+
|
|
24477
24514
|
pluxx_prompt_secret_config() {
|
|
24478
|
-
local
|
|
24479
|
-
local
|
|
24480
|
-
local
|
|
24515
|
+
local key="$1"
|
|
24516
|
+
local env_var="$2"
|
|
24517
|
+
local label="$3"
|
|
24518
|
+
local required="$4"
|
|
24481
24519
|
local current_value="\${!env_var:-}"
|
|
24482
24520
|
|
|
24521
|
+
if [[ -z "$current_value" && "\${PLUXX_RECONFIGURE:-0}" != "1" ]]; then
|
|
24522
|
+
local saved_value=""
|
|
24523
|
+
if saved_value="$(pluxx_saved_config_value "$key" "$env_var")"; then
|
|
24524
|
+
if pluxx_is_placeholder_secret "$saved_value"; then
|
|
24525
|
+
echo "Ignoring placeholder-looking saved config for $env_var." >&2
|
|
24526
|
+
else
|
|
24527
|
+
current_value="$saved_value"
|
|
24528
|
+
PLUXX_REUSED_USER_CONFIG=1
|
|
24529
|
+
fi
|
|
24530
|
+
fi
|
|
24531
|
+
fi
|
|
24532
|
+
|
|
24483
24533
|
if [[ -z "$current_value" && "$required" == "1" ]]; then
|
|
24484
24534
|
if [[ -t 0 || -r /dev/tty ]]; then
|
|
24485
24535
|
read -r -s -p "$label [$env_var]: " current_value </dev/tty
|
|
@@ -24499,11 +24549,20 @@ pluxx_prompt_secret_config() {
|
|
|
24499
24549
|
}
|
|
24500
24550
|
|
|
24501
24551
|
pluxx_prompt_text_config() {
|
|
24502
|
-
local
|
|
24503
|
-
local
|
|
24504
|
-
local
|
|
24552
|
+
local key="$1"
|
|
24553
|
+
local env_var="$2"
|
|
24554
|
+
local label="$3"
|
|
24555
|
+
local required="$4"
|
|
24505
24556
|
local current_value="\${!env_var:-}"
|
|
24506
24557
|
|
|
24558
|
+
if [[ -z "$current_value" && "\${PLUXX_RECONFIGURE:-0}" != "1" ]]; then
|
|
24559
|
+
local saved_value=""
|
|
24560
|
+
if saved_value="$(pluxx_saved_config_value "$key" "$env_var")"; then
|
|
24561
|
+
current_value="$saved_value"
|
|
24562
|
+
PLUXX_REUSED_USER_CONFIG=1
|
|
24563
|
+
fi
|
|
24564
|
+
fi
|
|
24565
|
+
|
|
24507
24566
|
if [[ -z "$current_value" && "$required" == "1" ]]; then
|
|
24508
24567
|
if [[ -t 0 || -r /dev/tty ]]; then
|
|
24509
24568
|
read -r -p "$label [$env_var]: " current_value </dev/tty
|
|
@@ -24518,6 +24577,10 @@ pluxx_prompt_text_config() {
|
|
|
24518
24577
|
|
|
24519
24578
|
${promptLines.join("\n")}
|
|
24520
24579
|
|
|
24580
|
+
if [[ "$PLUXX_REUSED_USER_CONFIG" == "1" ]]; then
|
|
24581
|
+
echo "Found existing plugin config; reusing saved install values."
|
|
24582
|
+
fi
|
|
24583
|
+
|
|
24521
24584
|
export PLUXX_USER_CONFIG_SPEC
|
|
24522
24585
|
export PLUXX_INSTALL_DIR="${installDirVariable}"
|
|
24523
24586
|
|
|
@@ -24613,6 +24676,17 @@ NODE
|
|
|
24613
24676
|
function hasInstallerUserConfig(config, platform) {
|
|
24614
24677
|
return collectUserConfigEntries(config, [platform]).length > 0;
|
|
24615
24678
|
}
|
|
24679
|
+
function renderInstallerSavedUserConfigCaptureSnippet(config, platform, installDirVariable) {
|
|
24680
|
+
if (!hasInstallerUserConfig(config, platform)) return "";
|
|
24681
|
+
return `
|
|
24682
|
+
PLUXX_SAVED_USER_CONFIG_PATH=""
|
|
24683
|
+
if [[ "\${PLUXX_RECONFIGURE:-0}" != "1" && -f "${installDirVariable}/.pluxx-user.json" ]]; then
|
|
24684
|
+
PLUXX_SAVED_USER_CONFIG_PATH="$TMP_DIR/pluxx-saved-user-config.json"
|
|
24685
|
+
cp "${installDirVariable}/.pluxx-user.json" "$PLUXX_SAVED_USER_CONFIG_PATH"
|
|
24686
|
+
fi
|
|
24687
|
+
export PLUXX_SAVED_USER_CONFIG_PATH
|
|
24688
|
+
`;
|
|
24689
|
+
}
|
|
24616
24690
|
function renderInstallerMcpPathMaterializationSnippet(platform, installDirVariable) {
|
|
24617
24691
|
if (platform !== "codex") return "";
|
|
24618
24692
|
return `
|
|
@@ -24983,6 +25057,7 @@ VERSION="$(grep -E '"version"' "$PLUGIN_MANIFEST" | head -n1 | sed -E 's/.*"vers
|
|
|
24983
25057
|
DESCRIPTION="$(grep -E '"description"' "$PLUGIN_MANIFEST" | head -n1 | sed -E 's/.*"description"[[:space:]]*:[[:space:]]*"([^"]+)".*/\\1/')"
|
|
24984
25058
|
|
|
24985
25059
|
mkdir -p "$INSTALL_ROOT/.claude-plugin" "$INSTALL_ROOT/plugins"
|
|
25060
|
+
${renderInstallerSavedUserConfigCaptureSnippet(config, "claude-code", "$INSTALL_ROOT/plugins/$PLUGIN_NAME")}
|
|
24986
25061
|
rm -rf "$INSTALL_ROOT/plugins/$PLUGIN_NAME"
|
|
24987
25062
|
cp -R "$BUNDLE_DIR" "$INSTALL_ROOT/plugins/$PLUGIN_NAME"
|
|
24988
25063
|
${renderInstallerUserConfigSnippet(config, "claude-code", "$INSTALL_ROOT/plugins/$PLUGIN_NAME")}
|
|
@@ -25078,6 +25153,7 @@ if [[ ! -f "$PLUGIN_MANIFEST" ]]; then
|
|
|
25078
25153
|
fi
|
|
25079
25154
|
|
|
25080
25155
|
mkdir -p "$(dirname "$INSTALL_DIR")"
|
|
25156
|
+
${renderInstallerSavedUserConfigCaptureSnippet(config, "cursor", "$INSTALL_DIR")}
|
|
25081
25157
|
rm -rf "$INSTALL_DIR"
|
|
25082
25158
|
cp -R "$BUNDLE_DIR" "$INSTALL_DIR"
|
|
25083
25159
|
${renderInstallerUserConfigSnippet(config, "cursor", "$INSTALL_DIR")}
|
|
@@ -25138,6 +25214,7 @@ if [[ ! -f "$PLUGIN_MANIFEST" ]]; then
|
|
|
25138
25214
|
fi
|
|
25139
25215
|
|
|
25140
25216
|
mkdir -p "$(dirname "$INSTALL_DIR")"
|
|
25217
|
+
${renderInstallerSavedUserConfigCaptureSnippet(config, "codex", "$INSTALL_DIR")}
|
|
25141
25218
|
rm -rf "$INSTALL_DIR"
|
|
25142
25219
|
cp -R "$BUNDLE_DIR" "$INSTALL_DIR"
|
|
25143
25220
|
${renderInstallerUserConfigSnippet(config, "codex", "$INSTALL_DIR")}
|
|
@@ -25256,6 +25333,7 @@ if [[ ! -f "$PLUGIN_PACKAGE" ]]; then
|
|
|
25256
25333
|
fi
|
|
25257
25334
|
|
|
25258
25335
|
mkdir -p "$(dirname "$INSTALL_DIR")" "$SKILLS_ROOT"
|
|
25336
|
+
${renderInstallerSavedUserConfigCaptureSnippet(config, "opencode", "$INSTALL_DIR")}
|
|
25259
25337
|
rm -rf "$INSTALL_DIR"
|
|
25260
25338
|
cp -R "$BUNDLE_DIR" "$INSTALL_DIR"
|
|
25261
25339
|
${renderInstallerUserConfigSnippet(config, "opencode", "$INSTALL_DIR")}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"publish.d.ts","sourceRoot":"","sources":["../../src/cli/publish.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,YAAY,EAAE,cAAc,EAAE,MAAM,WAAW,CAAA;AAI7D,KAAK,cAAc,GAAG,KAAK,GAAG,gBAAgB,CAAA;AAC9C,KAAK,gBAAgB,GAAG,SAAS,GAAG,WAAW,GAAG,UAAU,GAAG,UAAU,CAAA;AACzE,KAAK,qBAAqB,GAAG,WAAW,GAAG,QAAQ,CAAA;AAEnD,UAAU,aAAa;IACrB,MAAM,EAAE,MAAM,GAAG,IAAI,CAAA;IACrB,MAAM,EAAE,MAAM,CAAA;IACd,MAAM,EAAE,MAAM,CAAA;CACf;AAED,KAAK,aAAa,GAAG,CACnB,OAAO,EAAE,MAAM,EACf,IAAI,EAAE,MAAM,EAAE,EACd,OAAO,CAAC,EAAE;IAAE,GAAG,CAAC,EAAE,MAAM,CAAA;CAAE,KACvB,aAAa,CAAA;AAElB,MAAM,WAAW,kBAAkB;IACjC,iBAAiB,CAAC,EAAE,cAAc,EAAE,CAAA;IACpC,OAAO,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A;QACtC,aAAa,CAAC,EAAE;YAAE,EAAE,EAAE,OAAO,CAAC;YAAC,MAAM,CAAC,EAAE,MAAM,CAAA;SAAE,CAAA;KACjD,CAAA;CACF;AAwPD,wBAAgB,WAAW,CAAC,MAAM,EAAE,YAAY,EAAE,OAAO,GAAE,kBAAuB,GAAG,WAAW,CAmD/F;AA6sCD,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,WAAW,GAAG,MAAM,EAAE,CAoC7D;AAED,wBAAgB,UAAU,CAAC,MAAM,EAAE,YAAY,EAAE,OAAO,GAAE,kBAAuB,GAAG,gBAAgB,CA8EnG"}
|
package/dist/index.js
CHANGED
|
@@ -9449,17 +9449,18 @@ function renderInstallerUserConfigSnippet(config, platform, installDirVariable)
|
|
|
9449
9449
|
if (entries.length === 0) return "";
|
|
9450
9450
|
const promptLines = entries.map((entry) => {
|
|
9451
9451
|
const functionName = entry.type === "secret" ? "pluxx_prompt_secret_config" : "pluxx_prompt_text_config";
|
|
9452
|
-
return `${functionName} ${JSON.stringify(entry.envVar)} ${JSON.stringify(entry.title)} ${entry.required ? "1" : "0"}`;
|
|
9452
|
+
return `${functionName} ${JSON.stringify(entry.key)} ${JSON.stringify(entry.envVar)} ${JSON.stringify(entry.title)} ${entry.required ? "1" : "0"}`;
|
|
9453
9453
|
});
|
|
9454
9454
|
return `
|
|
9455
9455
|
PLUXX_USER_CONFIG_SPEC="$(cat <<'PLUXX_USER_CONFIG_JSON'
|
|
9456
9456
|
${JSON.stringify(entries)}
|
|
9457
9457
|
PLUXX_USER_CONFIG_JSON
|
|
9458
9458
|
)"
|
|
9459
|
+
PLUXX_REUSED_USER_CONFIG=0
|
|
9459
9460
|
|
|
9460
9461
|
pluxx_is_placeholder_secret() {
|
|
9461
9462
|
case "$1" in
|
|
9462
|
-
*dummy*|*Dummy*|*DUMMY*|*placeholder*|*Placeholder*|*PLACEHOLDER*|*changeme*|*CHANGE_ME*|*replace*me*|*Replace*Me*|*your*key*|*YOUR*KEY*|*api*key*here*|*API*KEY*HERE*|*token*here*|*TOKEN*HERE*)
|
|
9463
|
+
*dummy*|*Dummy*|*DUMMY*|*placeholder*|*Placeholder*|*PLACEHOLDER*|*example*|*Example*|*EXAMPLE*|*changeme*|*CHANGE_ME*|*replace*me*|*Replace*Me*|*your*key*|*YOUR*KEY*|*api*key*here*|*API*KEY*HERE*|*token*here*|*TOKEN*HERE*)
|
|
9463
9464
|
return 0
|
|
9464
9465
|
;;
|
|
9465
9466
|
*)
|
|
@@ -9468,12 +9469,61 @@ pluxx_is_placeholder_secret() {
|
|
|
9468
9469
|
esac
|
|
9469
9470
|
}
|
|
9470
9471
|
|
|
9472
|
+
pluxx_saved_config_value() {
|
|
9473
|
+
local key="$1"
|
|
9474
|
+
local env_var="$2"
|
|
9475
|
+
|
|
9476
|
+
if [[ -z "\${PLUXX_SAVED_USER_CONFIG_PATH:-}" || ! -f "$PLUXX_SAVED_USER_CONFIG_PATH" ]]; then
|
|
9477
|
+
return 1
|
|
9478
|
+
fi
|
|
9479
|
+
|
|
9480
|
+
PLUXX_SAVED_CONFIG_KEY="$key" PLUXX_SAVED_CONFIG_ENV_VAR="$env_var" node <<'NODE'
|
|
9481
|
+
const fs = require('fs')
|
|
9482
|
+
|
|
9483
|
+
const filepath = process.env.PLUXX_SAVED_USER_CONFIG_PATH
|
|
9484
|
+
const key = process.env.PLUXX_SAVED_CONFIG_KEY
|
|
9485
|
+
const envVar = process.env.PLUXX_SAVED_CONFIG_ENV_VAR
|
|
9486
|
+
|
|
9487
|
+
try {
|
|
9488
|
+
const payload = JSON.parse(fs.readFileSync(filepath, 'utf8'))
|
|
9489
|
+
const candidates = [
|
|
9490
|
+
payload && payload.env && envVar ? payload.env[envVar] : undefined,
|
|
9491
|
+
payload && payload.values && key ? payload.values[key] : undefined,
|
|
9492
|
+
]
|
|
9493
|
+
|
|
9494
|
+
for (const candidate of candidates) {
|
|
9495
|
+
if (candidate === undefined || candidate === null) continue
|
|
9496
|
+
if (!['string', 'number', 'boolean'].includes(typeof candidate)) continue
|
|
9497
|
+
const value = String(candidate)
|
|
9498
|
+
if (value === '') continue
|
|
9499
|
+
process.stdout.write(value)
|
|
9500
|
+
process.exit(0)
|
|
9501
|
+
}
|
|
9502
|
+
} catch {}
|
|
9503
|
+
|
|
9504
|
+
process.exit(1)
|
|
9505
|
+
NODE
|
|
9506
|
+
}
|
|
9507
|
+
|
|
9471
9508
|
pluxx_prompt_secret_config() {
|
|
9472
|
-
local
|
|
9473
|
-
local
|
|
9474
|
-
local
|
|
9509
|
+
local key="$1"
|
|
9510
|
+
local env_var="$2"
|
|
9511
|
+
local label="$3"
|
|
9512
|
+
local required="$4"
|
|
9475
9513
|
local current_value="\${!env_var:-}"
|
|
9476
9514
|
|
|
9515
|
+
if [[ -z "$current_value" && "\${PLUXX_RECONFIGURE:-0}" != "1" ]]; then
|
|
9516
|
+
local saved_value=""
|
|
9517
|
+
if saved_value="$(pluxx_saved_config_value "$key" "$env_var")"; then
|
|
9518
|
+
if pluxx_is_placeholder_secret "$saved_value"; then
|
|
9519
|
+
echo "Ignoring placeholder-looking saved config for $env_var." >&2
|
|
9520
|
+
else
|
|
9521
|
+
current_value="$saved_value"
|
|
9522
|
+
PLUXX_REUSED_USER_CONFIG=1
|
|
9523
|
+
fi
|
|
9524
|
+
fi
|
|
9525
|
+
fi
|
|
9526
|
+
|
|
9477
9527
|
if [[ -z "$current_value" && "$required" == "1" ]]; then
|
|
9478
9528
|
if [[ -t 0 || -r /dev/tty ]]; then
|
|
9479
9529
|
read -r -s -p "$label [$env_var]: " current_value </dev/tty
|
|
@@ -9493,11 +9543,20 @@ pluxx_prompt_secret_config() {
|
|
|
9493
9543
|
}
|
|
9494
9544
|
|
|
9495
9545
|
pluxx_prompt_text_config() {
|
|
9496
|
-
local
|
|
9497
|
-
local
|
|
9498
|
-
local
|
|
9546
|
+
local key="$1"
|
|
9547
|
+
local env_var="$2"
|
|
9548
|
+
local label="$3"
|
|
9549
|
+
local required="$4"
|
|
9499
9550
|
local current_value="\${!env_var:-}"
|
|
9500
9551
|
|
|
9552
|
+
if [[ -z "$current_value" && "\${PLUXX_RECONFIGURE:-0}" != "1" ]]; then
|
|
9553
|
+
local saved_value=""
|
|
9554
|
+
if saved_value="$(pluxx_saved_config_value "$key" "$env_var")"; then
|
|
9555
|
+
current_value="$saved_value"
|
|
9556
|
+
PLUXX_REUSED_USER_CONFIG=1
|
|
9557
|
+
fi
|
|
9558
|
+
fi
|
|
9559
|
+
|
|
9501
9560
|
if [[ -z "$current_value" && "$required" == "1" ]]; then
|
|
9502
9561
|
if [[ -t 0 || -r /dev/tty ]]; then
|
|
9503
9562
|
read -r -p "$label [$env_var]: " current_value </dev/tty
|
|
@@ -9512,6 +9571,10 @@ pluxx_prompt_text_config() {
|
|
|
9512
9571
|
|
|
9513
9572
|
${promptLines.join("\n")}
|
|
9514
9573
|
|
|
9574
|
+
if [[ "$PLUXX_REUSED_USER_CONFIG" == "1" ]]; then
|
|
9575
|
+
echo "Found existing plugin config; reusing saved install values."
|
|
9576
|
+
fi
|
|
9577
|
+
|
|
9515
9578
|
export PLUXX_USER_CONFIG_SPEC
|
|
9516
9579
|
export PLUXX_INSTALL_DIR="${installDirVariable}"
|
|
9517
9580
|
|
|
@@ -9607,6 +9670,17 @@ NODE
|
|
|
9607
9670
|
function hasInstallerUserConfig(config, platform) {
|
|
9608
9671
|
return collectUserConfigEntries(config, [platform]).length > 0;
|
|
9609
9672
|
}
|
|
9673
|
+
function renderInstallerSavedUserConfigCaptureSnippet(config, platform, installDirVariable) {
|
|
9674
|
+
if (!hasInstallerUserConfig(config, platform)) return "";
|
|
9675
|
+
return `
|
|
9676
|
+
PLUXX_SAVED_USER_CONFIG_PATH=""
|
|
9677
|
+
if [[ "\${PLUXX_RECONFIGURE:-0}" != "1" && -f "${installDirVariable}/.pluxx-user.json" ]]; then
|
|
9678
|
+
PLUXX_SAVED_USER_CONFIG_PATH="$TMP_DIR/pluxx-saved-user-config.json"
|
|
9679
|
+
cp "${installDirVariable}/.pluxx-user.json" "$PLUXX_SAVED_USER_CONFIG_PATH"
|
|
9680
|
+
fi
|
|
9681
|
+
export PLUXX_SAVED_USER_CONFIG_PATH
|
|
9682
|
+
`;
|
|
9683
|
+
}
|
|
9610
9684
|
function renderInstallerMcpPathMaterializationSnippet(platform, installDirVariable) {
|
|
9611
9685
|
if (platform !== "codex") return "";
|
|
9612
9686
|
return `
|
|
@@ -9977,6 +10051,7 @@ VERSION="$(grep -E '"version"' "$PLUGIN_MANIFEST" | head -n1 | sed -E 's/.*"vers
|
|
|
9977
10051
|
DESCRIPTION="$(grep -E '"description"' "$PLUGIN_MANIFEST" | head -n1 | sed -E 's/.*"description"[[:space:]]*:[[:space:]]*"([^"]+)".*/\\1/')"
|
|
9978
10052
|
|
|
9979
10053
|
mkdir -p "$INSTALL_ROOT/.claude-plugin" "$INSTALL_ROOT/plugins"
|
|
10054
|
+
${renderInstallerSavedUserConfigCaptureSnippet(config, "claude-code", "$INSTALL_ROOT/plugins/$PLUGIN_NAME")}
|
|
9980
10055
|
rm -rf "$INSTALL_ROOT/plugins/$PLUGIN_NAME"
|
|
9981
10056
|
cp -R "$BUNDLE_DIR" "$INSTALL_ROOT/plugins/$PLUGIN_NAME"
|
|
9982
10057
|
${renderInstallerUserConfigSnippet(config, "claude-code", "$INSTALL_ROOT/plugins/$PLUGIN_NAME")}
|
|
@@ -10072,6 +10147,7 @@ if [[ ! -f "$PLUGIN_MANIFEST" ]]; then
|
|
|
10072
10147
|
fi
|
|
10073
10148
|
|
|
10074
10149
|
mkdir -p "$(dirname "$INSTALL_DIR")"
|
|
10150
|
+
${renderInstallerSavedUserConfigCaptureSnippet(config, "cursor", "$INSTALL_DIR")}
|
|
10075
10151
|
rm -rf "$INSTALL_DIR"
|
|
10076
10152
|
cp -R "$BUNDLE_DIR" "$INSTALL_DIR"
|
|
10077
10153
|
${renderInstallerUserConfigSnippet(config, "cursor", "$INSTALL_DIR")}
|
|
@@ -10132,6 +10208,7 @@ if [[ ! -f "$PLUGIN_MANIFEST" ]]; then
|
|
|
10132
10208
|
fi
|
|
10133
10209
|
|
|
10134
10210
|
mkdir -p "$(dirname "$INSTALL_DIR")"
|
|
10211
|
+
${renderInstallerSavedUserConfigCaptureSnippet(config, "codex", "$INSTALL_DIR")}
|
|
10135
10212
|
rm -rf "$INSTALL_DIR"
|
|
10136
10213
|
cp -R "$BUNDLE_DIR" "$INSTALL_DIR"
|
|
10137
10214
|
${renderInstallerUserConfigSnippet(config, "codex", "$INSTALL_DIR")}
|
|
@@ -10250,6 +10327,7 @@ if [[ ! -f "$PLUGIN_PACKAGE" ]]; then
|
|
|
10250
10327
|
fi
|
|
10251
10328
|
|
|
10252
10329
|
mkdir -p "$(dirname "$INSTALL_DIR")" "$SKILLS_ROOT"
|
|
10330
|
+
${renderInstallerSavedUserConfigCaptureSnippet(config, "opencode", "$INSTALL_DIR")}
|
|
10253
10331
|
rm -rf "$INSTALL_DIR"
|
|
10254
10332
|
cp -R "$BUNDLE_DIR" "$INSTALL_DIR"
|
|
10255
10333
|
${renderInstallerUserConfigSnippet(config, "opencode", "$INSTALL_DIR")}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@orchid-labs/pluxx",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.20",
|
|
4
4
|
"description": "Build AI agent plugins once. Prime-time on Claude Code, Cursor, Codex, and OpenCode, with beta generators for additional hosts.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|