lynxprompt 1.0.6 → 1.0.7
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/index.js +98 -70
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -2208,51 +2208,40 @@ function generateFileContent(options, platform2) {
|
|
|
2208
2208
|
}
|
|
2209
2209
|
if (options.enableAutoUpdate && options.blueprintId && (isMarkdown || isMdc)) {
|
|
2210
2210
|
const bpId = options.blueprintId.startsWith("bp_") ? options.blueprintId : `bp_${options.blueprintId}`;
|
|
2211
|
-
const
|
|
2212
|
-
const
|
|
2213
|
-
const hasWindows = osList.includes("windows");
|
|
2214
|
-
const hasUnix = osList.some((os2) => ["linux", "macos", "wsl"].includes(os2));
|
|
2215
|
-
const isMultiPlatform = hasWindows && hasUnix || osList.length > 1;
|
|
2211
|
+
const preferCli = options.preferCliSync !== false;
|
|
2212
|
+
const tokenEnvVar = options.tokenEnvVar || "LYNXPROMPT_API_TOKEN";
|
|
2216
2213
|
sections.push("<!--");
|
|
2217
|
-
sections.push(
|
|
2214
|
+
sections.push(`This file is synced with LynxPrompt (Blueprint: ${bpId})`);
|
|
2218
2215
|
sections.push("");
|
|
2219
|
-
|
|
2220
|
-
|
|
2221
|
-
sections.push(`curl -X PUT "https://lynxprompt.com/api/v1/blueprints/${bpId}" \\`);
|
|
2222
|
-
sections.push(' -H "Authorization: Bearer $LYNXPROMPT_API_TOKEN" \\');
|
|
2223
|
-
sections.push(' -H "Content-Type: application/json" \\');
|
|
2224
|
-
sections.push(` -d "{\\"content\\": \\"$(cat ${fileName} | jq -Rs .)\\"}"`);
|
|
2216
|
+
sections.push("Sync Commands:");
|
|
2217
|
+
if (preferCli) {
|
|
2225
2218
|
sections.push("");
|
|
2226
|
-
sections.push("#
|
|
2227
|
-
sections.push(
|
|
2228
|
-
sections.push(
|
|
2229
|
-
sections.push(
|
|
2230
|
-
sections.push(' -Method PUT -Headers @{ "Authorization" = "Bearer $env:LYNXPROMPT_API_TOKEN" } `');
|
|
2231
|
-
sections.push(' -ContentType "application/json" -Body $body');
|
|
2232
|
-
} else if (hasWindows) {
|
|
2233
|
-
sections.push("# PowerShell (Windows)");
|
|
2234
|
-
sections.push(`$content = (Get-Content "${fileName}" -Raw) -replace '"', '\\"'`);
|
|
2235
|
-
sections.push(`$body = @{ content = $content } | ConvertTo-Json`);
|
|
2236
|
-
sections.push(`Invoke-RestMethod -Uri "https://lynxprompt.com/api/v1/blueprints/${bpId}" \``);
|
|
2237
|
-
sections.push(' -Method PUT -Headers @{ "Authorization" = "Bearer $env:LYNXPROMPT_API_TOKEN" } `');
|
|
2238
|
-
sections.push(' -ContentType "application/json" -Body $body');
|
|
2239
|
-
} else if (hasUnix) {
|
|
2240
|
-
sections.push("# Bash (Linux/macOS/WSL)");
|
|
2241
|
-
sections.push(`curl -X PUT "https://lynxprompt.com/api/v1/blueprints/${bpId}" \\`);
|
|
2242
|
-
sections.push(' -H "Authorization: Bearer $LYNXPROMPT_API_TOKEN" \\');
|
|
2243
|
-
sections.push(' -H "Content-Type: application/json" \\');
|
|
2244
|
-
sections.push(` -d "{\\"content\\": \\"$(cat ${fileName} | jq -Rs .)\\"}"`);
|
|
2219
|
+
sections.push("# Using LynxPrompt CLI (recommended):");
|
|
2220
|
+
sections.push("lynxp push # Upload local changes to cloud");
|
|
2221
|
+
sections.push("lynxp pull # Download cloud changes to local");
|
|
2222
|
+
sections.push("lynxp diff # Compare local vs cloud versions");
|
|
2245
2223
|
sections.push("");
|
|
2246
|
-
sections.push("#
|
|
2224
|
+
sections.push("# Install CLI: npm install -g lynxprompt");
|
|
2225
|
+
sections.push("# Login: lynxp login");
|
|
2247
2226
|
} else {
|
|
2248
|
-
|
|
2227
|
+
const fileName = platform2 === "cursor" ? ".cursor/rules/agents.mdc" : "AGENTS.md";
|
|
2228
|
+
sections.push("");
|
|
2229
|
+
sections.push(`# Using curl with environment variable (token stored in $${tokenEnvVar}):`);
|
|
2230
|
+
sections.push("");
|
|
2231
|
+
sections.push("# Push local changes to cloud:");
|
|
2249
2232
|
sections.push(`curl -X PUT "https://lynxprompt.com/api/v1/blueprints/${bpId}" \\`);
|
|
2250
|
-
sections.push(
|
|
2233
|
+
sections.push(` -H "Authorization: Bearer $${tokenEnvVar}" \\`);
|
|
2251
2234
|
sections.push(' -H "Content-Type: application/json" \\');
|
|
2252
2235
|
sections.push(` -d "{\\"content\\": \\"$(cat ${fileName} | jq -Rs .)\\"}"`);
|
|
2236
|
+
sections.push("");
|
|
2237
|
+
sections.push("# Pull cloud changes to local:");
|
|
2238
|
+
sections.push(`curl -s "https://lynxprompt.com/api/v1/blueprints/${bpId}" \\`);
|
|
2239
|
+
sections.push(` -H "Authorization: Bearer $${tokenEnvVar}" | jq -r '.content' > ${fileName}`);
|
|
2240
|
+
sections.push("");
|
|
2241
|
+
sections.push(`# Set your token: export ${tokenEnvVar}="your_token_here"`);
|
|
2242
|
+
sections.push("# Generate token at: https://lynxprompt.com/settings");
|
|
2253
2243
|
}
|
|
2254
2244
|
sections.push("");
|
|
2255
|
-
sections.push("Generate an API token at: https://lynxprompt.com/settings");
|
|
2256
2245
|
sections.push("Docs: https://lynxprompt.com/docs/api");
|
|
2257
2246
|
sections.push("-->");
|
|
2258
2247
|
sections.push("");
|
|
@@ -4754,11 +4743,14 @@ async function runInteractiveWizard(options, detected, userTier) {
|
|
|
4754
4743
|
showStep(currentStepNum, commandsStep, userTier);
|
|
4755
4744
|
console.log(chalk7.gray(" Select common commands for your project (type to search):"));
|
|
4756
4745
|
console.log();
|
|
4757
|
-
const buildChoices = sortSelectedFirst(COMMON_COMMANDS.build.map((c) =>
|
|
4758
|
-
|
|
4759
|
-
|
|
4760
|
-
|
|
4761
|
-
|
|
4746
|
+
const buildChoices = sortSelectedFirst(COMMON_COMMANDS.build.map((c) => {
|
|
4747
|
+
const isDetected = detected?.commands?.build === c;
|
|
4748
|
+
return {
|
|
4749
|
+
title: isDetected ? `${chalk7.cyan(c)} ${chalk7.green("(detected)")}` : chalk7.cyan(c),
|
|
4750
|
+
value: c,
|
|
4751
|
+
selected: isDetected
|
|
4752
|
+
};
|
|
4753
|
+
}));
|
|
4762
4754
|
const buildResponse = await prompts3({
|
|
4763
4755
|
type: "autocompleteMultiselect",
|
|
4764
4756
|
name: "build",
|
|
@@ -4767,11 +4759,14 @@ async function runInteractiveWizard(options, detected, userTier) {
|
|
|
4767
4759
|
hint: chalk7.gray("type to filter \u2022 space select \u2022 enter confirm"),
|
|
4768
4760
|
instructions: false
|
|
4769
4761
|
}, promptConfig);
|
|
4770
|
-
const testChoices = sortSelectedFirst(COMMON_COMMANDS.test.map((c) =>
|
|
4771
|
-
|
|
4772
|
-
|
|
4773
|
-
|
|
4774
|
-
|
|
4762
|
+
const testChoices = sortSelectedFirst(COMMON_COMMANDS.test.map((c) => {
|
|
4763
|
+
const isDetected = detected?.commands?.test === c;
|
|
4764
|
+
return {
|
|
4765
|
+
title: isDetected ? `${chalk7.yellow(c)} ${chalk7.green("(detected)")}` : chalk7.yellow(c),
|
|
4766
|
+
value: c,
|
|
4767
|
+
selected: isDetected
|
|
4768
|
+
};
|
|
4769
|
+
}));
|
|
4775
4770
|
const testResponse = await prompts3({
|
|
4776
4771
|
type: "autocompleteMultiselect",
|
|
4777
4772
|
name: "test",
|
|
@@ -4780,11 +4775,14 @@ async function runInteractiveWizard(options, detected, userTier) {
|
|
|
4780
4775
|
hint: chalk7.gray("type to filter \u2022 space select \u2022 enter confirm"),
|
|
4781
4776
|
instructions: false
|
|
4782
4777
|
}, promptConfig);
|
|
4783
|
-
const lintChoices = sortSelectedFirst(COMMON_COMMANDS.lint.map((c) =>
|
|
4784
|
-
|
|
4785
|
-
|
|
4786
|
-
|
|
4787
|
-
|
|
4778
|
+
const lintChoices = sortSelectedFirst(COMMON_COMMANDS.lint.map((c) => {
|
|
4779
|
+
const isDetected = detected?.commands?.lint === c;
|
|
4780
|
+
return {
|
|
4781
|
+
title: isDetected ? `${chalk7.green(c)} ${chalk7.green("(detected)")}` : chalk7.green(c),
|
|
4782
|
+
value: c,
|
|
4783
|
+
selected: isDetected
|
|
4784
|
+
};
|
|
4785
|
+
}));
|
|
4788
4786
|
const lintResponse = await prompts3({
|
|
4789
4787
|
type: "autocompleteMultiselect",
|
|
4790
4788
|
name: "lint",
|
|
@@ -4793,11 +4791,14 @@ async function runInteractiveWizard(options, detected, userTier) {
|
|
|
4793
4791
|
hint: chalk7.gray("type to filter \u2022 space select \u2022 enter confirm"),
|
|
4794
4792
|
instructions: false
|
|
4795
4793
|
}, promptConfig);
|
|
4796
|
-
const devChoices = sortSelectedFirst(COMMON_COMMANDS.dev.map((c) =>
|
|
4797
|
-
|
|
4798
|
-
|
|
4799
|
-
|
|
4800
|
-
|
|
4794
|
+
const devChoices = sortSelectedFirst(COMMON_COMMANDS.dev.map((c) => {
|
|
4795
|
+
const isDetected = detected?.commands?.dev === c;
|
|
4796
|
+
return {
|
|
4797
|
+
title: isDetected ? `${chalk7.magenta(c)} ${chalk7.green("(detected)")}` : chalk7.magenta(c),
|
|
4798
|
+
value: c,
|
|
4799
|
+
selected: isDetected
|
|
4800
|
+
};
|
|
4801
|
+
}));
|
|
4801
4802
|
const devResponse = await prompts3({
|
|
4802
4803
|
type: "autocompleteMultiselect",
|
|
4803
4804
|
name: "dev",
|
|
@@ -4974,39 +4975,63 @@ async function runInteractiveWizard(options, detected, userTier) {
|
|
|
4974
4975
|
}, promptConfig);
|
|
4975
4976
|
answers.selfImprove = selfImproveResponse.selfImprove || false;
|
|
4976
4977
|
console.log();
|
|
4977
|
-
console.log(chalk7.gray(" \u2601\uFE0F Save your config to LynxPrompt cloud for
|
|
4978
|
-
console.log(chalk7.gray("
|
|
4979
|
-
console.log(chalk7.gray(" to
|
|
4978
|
+
console.log(chalk7.gray(" \u2601\uFE0F Save your config to LynxPrompt cloud for synchronization."));
|
|
4979
|
+
console.log(chalk7.gray(" \u2022 Use 'lynxp push' to upload local changes to the cloud"));
|
|
4980
|
+
console.log(chalk7.gray(" \u2022 Use 'lynxp pull' to download cloud changes to local"));
|
|
4981
|
+
console.log(chalk7.gray(" \u2022 Use 'lynxp diff' to compare local vs cloud versions"));
|
|
4980
4982
|
const enableAutoUpdateResponse = await prompts3({
|
|
4981
4983
|
type: "toggle",
|
|
4982
4984
|
name: "enableAutoUpdate",
|
|
4983
|
-
message: chalk7.white("Save to cloud & enable
|
|
4985
|
+
message: chalk7.white("Save to cloud & enable sync?"),
|
|
4984
4986
|
initial: false,
|
|
4985
4987
|
active: "Yes",
|
|
4986
4988
|
inactive: "No",
|
|
4987
|
-
hint: chalk7.gray("Adds sync
|
|
4989
|
+
hint: chalk7.gray("Adds sync commands to config")
|
|
4988
4990
|
}, promptConfig);
|
|
4989
4991
|
answers.enableAutoUpdate = enableAutoUpdateResponse.enableAutoUpdate || false;
|
|
4990
|
-
answers.preferCliSync =
|
|
4992
|
+
answers.preferCliSync = true;
|
|
4993
|
+
answers.tokenEnvVar = "LYNXPROMPT_API_TOKEN";
|
|
4991
4994
|
if (answers.enableAutoUpdate && api) {
|
|
4992
4995
|
console.log();
|
|
4993
|
-
console.log(chalk7.gray(" \u{
|
|
4994
|
-
console.log(
|
|
4995
|
-
console.log(chalk7.
|
|
4996
|
+
console.log(chalk7.gray(" \u{1F4E6} Choose how the AI should run sync commands:"));
|
|
4997
|
+
console.log();
|
|
4998
|
+
console.log(chalk7.green.bold(" CLI (Recommended):"));
|
|
4999
|
+
console.log(chalk7.gray(" \u2022 No API token stored in config files - more secure"));
|
|
5000
|
+
console.log(chalk7.gray(" \u2022 AI uses 'lynxp push/pull/diff' commands directly"));
|
|
5001
|
+
console.log(chalk7.gray(" \u2022 Requires LynxPrompt CLI installed in dev environment"));
|
|
5002
|
+
console.log();
|
|
5003
|
+
console.log(chalk7.yellow(" Environment Variable (if CLI not available):"));
|
|
5004
|
+
console.log(chalk7.gray(" \u2022 Token stored in environment variable (not in file)"));
|
|
5005
|
+
console.log(chalk7.gray(" \u2022 AI uses curl with $LYNXPROMPT_API_TOKEN"));
|
|
5006
|
+
console.log();
|
|
4996
5007
|
const syncMethodResponse = await prompts3({
|
|
4997
5008
|
type: "toggle",
|
|
4998
5009
|
name: "preferCliSync",
|
|
4999
|
-
message: chalk7.white("Will
|
|
5010
|
+
message: chalk7.white("Will LynxPrompt CLI be available in your dev environment?"),
|
|
5000
5011
|
initial: true,
|
|
5001
|
-
|
|
5002
|
-
|
|
5003
|
-
|
|
5012
|
+
// Default to yes - strongly recommended
|
|
5013
|
+
active: "Yes, use CLI (recommended)",
|
|
5014
|
+
inactive: "No, use env variable",
|
|
5015
|
+
hint: chalk7.green("Strongly recommended for security")
|
|
5004
5016
|
}, promptConfig);
|
|
5005
5017
|
answers.preferCliSync = syncMethodResponse.preferCliSync ?? true;
|
|
5006
5018
|
if (answers.preferCliSync) {
|
|
5007
|
-
console.log(chalk7.green(" \u2713
|
|
5019
|
+
console.log(chalk7.green(" \u2713 Perfect! AI will use 'lynxp push/pull/diff' for syncing"));
|
|
5020
|
+
console.log(chalk7.gray(" Make sure CLI is installed: npm install -g lynxprompt"));
|
|
5008
5021
|
} else {
|
|
5009
|
-
console.log(
|
|
5022
|
+
console.log();
|
|
5023
|
+
console.log(chalk7.gray(" \u{1F510} The AI will use curl with an API token from an environment variable."));
|
|
5024
|
+
console.log(chalk7.gray(" The token will NOT be stored in the config file for security."));
|
|
5025
|
+
const envVarResponse = await prompts3({
|
|
5026
|
+
type: "text",
|
|
5027
|
+
name: "tokenEnvVar",
|
|
5028
|
+
message: chalk7.white("Environment variable name for API token:"),
|
|
5029
|
+
initial: "LYNXPROMPT_API_TOKEN",
|
|
5030
|
+
hint: chalk7.gray("e.g., LYNXPROMPT_API_TOKEN, LP_TOKEN")
|
|
5031
|
+
}, promptConfig);
|
|
5032
|
+
answers.tokenEnvVar = envVarResponse.tokenEnvVar || "LYNXPROMPT_API_TOKEN";
|
|
5033
|
+
console.log(chalk7.green(` \u2713 AI will use curl with $${answers.tokenEnvVar}`));
|
|
5034
|
+
console.log(chalk7.gray(` Set your token: export ${answers.tokenEnvVar}="your_token_here"`));
|
|
5010
5035
|
}
|
|
5011
5036
|
}
|
|
5012
5037
|
if (answers.enableAutoUpdate && !api) {
|
|
@@ -5375,9 +5400,12 @@ async function runInteractiveWizard(options, detected, userTier) {
|
|
|
5375
5400
|
styleNotes: answers.styleNotes,
|
|
5376
5401
|
aiBehavior: answers.aiBehavior,
|
|
5377
5402
|
importantFiles: answers.importantFiles,
|
|
5403
|
+
importantFilesOther: answers.importantFilesOther,
|
|
5378
5404
|
selfImprove: answers.selfImprove,
|
|
5379
5405
|
includePersonalData: answers.includePersonalData,
|
|
5380
5406
|
enableAutoUpdate: answers.enableAutoUpdate,
|
|
5407
|
+
preferCliSync: answers.preferCliSync,
|
|
5408
|
+
tokenEnvVar: answers.tokenEnvVar,
|
|
5381
5409
|
userName: answers.userName,
|
|
5382
5410
|
userEmail: answers.userEmail,
|
|
5383
5411
|
userPersona: answers.userPersona,
|