lynxprompt 1.0.7 → 1.0.8
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 +107 -31
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -2149,7 +2149,8 @@ function generateConfig(options) {
|
|
|
2149
2149
|
files[filename] = generateFileContent(options, platform2);
|
|
2150
2150
|
}
|
|
2151
2151
|
}
|
|
2152
|
-
|
|
2152
|
+
const createLocalStaticFiles = options.staticFileHandling !== "config_only";
|
|
2153
|
+
if (options.staticFiles && options.staticFiles.length > 0 && createLocalStaticFiles) {
|
|
2153
2154
|
for (const fileKey of options.staticFiles) {
|
|
2154
2155
|
const filePath = STATIC_FILE_PATHS[fileKey];
|
|
2155
2156
|
if (!filePath) continue;
|
|
@@ -2163,7 +2164,7 @@ function generateConfig(options) {
|
|
|
2163
2164
|
}
|
|
2164
2165
|
}
|
|
2165
2166
|
}
|
|
2166
|
-
if (options.includeFunding && !options.staticFiles?.includes("funding")) {
|
|
2167
|
+
if (options.includeFunding && !options.staticFiles?.includes("funding") && createLocalStaticFiles) {
|
|
2167
2168
|
files[".github/FUNDING.yml"] = STATIC_FILE_TEMPLATES.funding(options);
|
|
2168
2169
|
}
|
|
2169
2170
|
if (options.variables && Object.keys(options.variables).length > 0) {
|
|
@@ -2192,6 +2193,12 @@ function generateFileContent(options, platform2) {
|
|
|
2192
2193
|
return generateJsonConfig(options, platform2);
|
|
2193
2194
|
}
|
|
2194
2195
|
const projectName = bpVar(bp, "PROJECT_NAME", options.name);
|
|
2196
|
+
const repoHost = bpVar(bp, "REPO_HOST", options.repoHost || "");
|
|
2197
|
+
const license = bpVar(bp, "LICENSE", options.license || "");
|
|
2198
|
+
const authorName = bpVar(bp, "AUTHOR_NAME", options.userName || "");
|
|
2199
|
+
const authorEmail = bpVar(bp, "AUTHOR_EMAIL", options.userEmail || "");
|
|
2200
|
+
const architecture = bpVar(bp, "ARCHITECTURE", options.architecture || "");
|
|
2201
|
+
const cicd = bpVar(bp, "CI_CD", options.cicd || "");
|
|
2195
2202
|
if (isMdc) {
|
|
2196
2203
|
sections.push("---");
|
|
2197
2204
|
sections.push(`description: "${projectName} - AI coding rules"`);
|
|
@@ -2313,10 +2320,16 @@ function generateFileContent(options, platform2) {
|
|
|
2313
2320
|
sections.push("## Repository & Infrastructure");
|
|
2314
2321
|
sections.push("");
|
|
2315
2322
|
if (options.repoHost) {
|
|
2316
|
-
sections.push(`- **Host:** ${options.repoHost.charAt(0).toUpperCase() + options.repoHost.slice(1)}`);
|
|
2323
|
+
sections.push(`- **Host:** ${repoHost || options.repoHost.charAt(0).toUpperCase() + options.repoHost.slice(1)}`);
|
|
2317
2324
|
}
|
|
2318
2325
|
if (options.license && options.license !== "none") {
|
|
2319
|
-
sections.push(`- **License:** ${options.license.toUpperCase()}`);
|
|
2326
|
+
sections.push(`- **License:** ${license || options.license.toUpperCase()}`);
|
|
2327
|
+
}
|
|
2328
|
+
if (options.architecture) {
|
|
2329
|
+
sections.push(`- **Architecture:** ${architecture || options.architecture}`);
|
|
2330
|
+
}
|
|
2331
|
+
if (options.cicd) {
|
|
2332
|
+
sections.push(`- **CI/CD:** ${cicd || options.cicd}`);
|
|
2320
2333
|
}
|
|
2321
2334
|
if (options.conventionalCommits) {
|
|
2322
2335
|
sections.push("- **Commits:** Follow [Conventional Commits](https://conventionalcommits.org) format");
|
|
@@ -2457,10 +2470,10 @@ function generateFileContent(options, platform2) {
|
|
|
2457
2470
|
if (options.userName || options.userEmail || options.userRole || options.userExpertise) {
|
|
2458
2471
|
const identityLines = [];
|
|
2459
2472
|
if (options.userName) {
|
|
2460
|
-
identityLines.push(`- **Name:** ${options.userName}`);
|
|
2473
|
+
identityLines.push(`- **Name:** ${authorName || options.userName}`);
|
|
2461
2474
|
}
|
|
2462
2475
|
if (options.userEmail) {
|
|
2463
|
-
identityLines.push(`- **Email:** ${options.userEmail}`);
|
|
2476
|
+
identityLines.push(`- **Email:** ${authorEmail || options.userEmail}`);
|
|
2464
2477
|
}
|
|
2465
2478
|
if (options.userRole) {
|
|
2466
2479
|
identityLines.push(`- **Role:** ${options.userRole}`);
|
|
@@ -2796,6 +2809,35 @@ function generateFileContent(options, platform2) {
|
|
|
2796
2809
|
sections.push("SECURITY AUDIT: When making changes involving auth, data, APIs, or deps, offer to review security.");
|
|
2797
2810
|
sections.push("");
|
|
2798
2811
|
}
|
|
2812
|
+
if (options.staticFileHandling === "config_only" && options.staticFiles && options.staticFiles.length > 0) {
|
|
2813
|
+
if (isMarkdown || isMdc) {
|
|
2814
|
+
sections.push("## \u{1F4C4} Static Files Reference");
|
|
2815
|
+
sections.push("");
|
|
2816
|
+
sections.push("The following static file contents are included for AI context. These are not separate files.");
|
|
2817
|
+
sections.push("");
|
|
2818
|
+
for (const fileKey of options.staticFiles) {
|
|
2819
|
+
const filePath = STATIC_FILE_PATHS[fileKey];
|
|
2820
|
+
if (!filePath) continue;
|
|
2821
|
+
let content;
|
|
2822
|
+
if (options.staticFileContents?.[fileKey]) {
|
|
2823
|
+
content = options.staticFileContents[fileKey];
|
|
2824
|
+
} else {
|
|
2825
|
+
const templateFn = STATIC_FILE_TEMPLATES[fileKey];
|
|
2826
|
+
if (templateFn) {
|
|
2827
|
+
content = templateFn(options);
|
|
2828
|
+
} else {
|
|
2829
|
+
continue;
|
|
2830
|
+
}
|
|
2831
|
+
}
|
|
2832
|
+
sections.push(`### ${filePath}`);
|
|
2833
|
+
sections.push("");
|
|
2834
|
+
sections.push("```");
|
|
2835
|
+
sections.push(content.trim());
|
|
2836
|
+
sections.push("```");
|
|
2837
|
+
sections.push("");
|
|
2838
|
+
}
|
|
2839
|
+
}
|
|
2840
|
+
}
|
|
2799
2841
|
if (isMarkdown || isMdc) {
|
|
2800
2842
|
sections.push("---");
|
|
2801
2843
|
sections.push("");
|
|
@@ -4327,7 +4369,7 @@ async function runInteractiveWizard(options, detected, userTier) {
|
|
|
4327
4369
|
name: "devOS",
|
|
4328
4370
|
message: chalk7.white("Development environment(s) (type to search):"),
|
|
4329
4371
|
choices: DEV_OS_OPTIONS.map((o) => ({
|
|
4330
|
-
title: `${o.icon} ${o.label}`,
|
|
4372
|
+
title: o.id === currentOS ? `${o.icon} ${o.label} ${chalk7.green("(detected by your current system)")}` : `${o.icon} ${o.label}`,
|
|
4331
4373
|
value: o.id,
|
|
4332
4374
|
selected: o.id === currentOS
|
|
4333
4375
|
// Pre-select current OS
|
|
@@ -4961,48 +5003,50 @@ async function runInteractiveWizard(options, detected, userTier) {
|
|
|
4961
5003
|
console.log();
|
|
4962
5004
|
console.log(chalk7.gray(" \u2500\u2500\u2500 Cloud & AI Options \u2500\u2500\u2500"));
|
|
4963
5005
|
console.log();
|
|
4964
|
-
console.log(chalk7.gray(" \u{1F9E0}
|
|
4965
|
-
console.log(chalk7.gray("
|
|
4966
|
-
console.log(chalk7.gray("
|
|
5006
|
+
console.log(chalk7.gray(" \u{1F9E0} Write instructions in the generated config telling AI it can suggest improvements."));
|
|
5007
|
+
console.log(chalk7.gray(" The AI will learn your patterns and propose better rules, new conventions,"));
|
|
5008
|
+
console.log(chalk7.gray(" and optimizations over time. You review and approve any changes."));
|
|
4967
5009
|
const selfImproveResponse = await prompts3({
|
|
4968
5010
|
type: "toggle",
|
|
4969
5011
|
name: "selfImprove",
|
|
4970
|
-
message: chalk7.white("
|
|
5012
|
+
message: chalk7.white("Enable self-improving AI config rules?"),
|
|
4971
5013
|
initial: false,
|
|
4972
5014
|
active: "Yes",
|
|
4973
5015
|
inactive: "No",
|
|
4974
|
-
hint: chalk7.gray("AI
|
|
5016
|
+
hint: chalk7.gray("Instructs AI to suggest improvements")
|
|
4975
5017
|
}, promptConfig);
|
|
4976
5018
|
answers.selfImprove = selfImproveResponse.selfImprove || false;
|
|
4977
5019
|
console.log();
|
|
4978
|
-
console.log(chalk7.gray(" \u2601\uFE0F
|
|
4979
|
-
console.log(chalk7.gray("
|
|
4980
|
-
console.log(chalk7.gray(" \u2022
|
|
4981
|
-
console.log(chalk7.gray(" \u2022
|
|
5020
|
+
console.log(chalk7.gray(" \u2601\uFE0F Store your config on LynxPrompt cloud for team sharing and version control."));
|
|
5021
|
+
console.log(chalk7.gray(" Benefits:"));
|
|
5022
|
+
console.log(chalk7.gray(" \u2022 Share configs across devices and team members"));
|
|
5023
|
+
console.log(chalk7.gray(" \u2022 Track changes and rollback if needed"));
|
|
5024
|
+
console.log(chalk7.gray(" \u2022 Instructions added to config so AI can sync automatically"));
|
|
4982
5025
|
const enableAutoUpdateResponse = await prompts3({
|
|
4983
5026
|
type: "toggle",
|
|
4984
5027
|
name: "enableAutoUpdate",
|
|
4985
|
-
message: chalk7.white("
|
|
5028
|
+
message: chalk7.white("Enable cloud synchronization?"),
|
|
4986
5029
|
initial: false,
|
|
4987
5030
|
active: "Yes",
|
|
4988
5031
|
inactive: "No",
|
|
4989
|
-
hint: chalk7.gray("
|
|
5032
|
+
hint: chalk7.gray("Enables push/pull/diff with LynxPrompt cloud")
|
|
4990
5033
|
}, promptConfig);
|
|
4991
5034
|
answers.enableAutoUpdate = enableAutoUpdateResponse.enableAutoUpdate || false;
|
|
4992
5035
|
answers.preferCliSync = true;
|
|
4993
5036
|
answers.tokenEnvVar = "LYNXPROMPT_API_TOKEN";
|
|
4994
5037
|
if (answers.enableAutoUpdate && api) {
|
|
4995
5038
|
console.log();
|
|
4996
|
-
console.log(chalk7.gray(" \u{1F4E6}
|
|
5039
|
+
console.log(chalk7.gray(" \u{1F4E6} How should the AI perform sync operations?"));
|
|
4997
5040
|
console.log();
|
|
4998
5041
|
console.log(chalk7.green.bold(" CLI (Recommended):"));
|
|
4999
|
-
console.log(chalk7.gray(" \u2022
|
|
5000
|
-
console.log(chalk7.gray(" \u2022 AI
|
|
5001
|
-
console.log(chalk7.gray(" \u2022 Requires
|
|
5042
|
+
console.log(chalk7.gray(" \u2022 Most secure - no tokens stored anywhere"));
|
|
5043
|
+
console.log(chalk7.gray(" \u2022 AI runs lynxp commands directly"));
|
|
5044
|
+
console.log(chalk7.gray(" \u2022 Requires CLI installed: npm install -g lynxprompt"));
|
|
5002
5045
|
console.log();
|
|
5003
|
-
console.log(chalk7.yellow("
|
|
5046
|
+
console.log(chalk7.yellow(" curl/token/env variable:"));
|
|
5047
|
+
console.log(chalk7.gray(" \u2022 Works without CLI installed"));
|
|
5004
5048
|
console.log(chalk7.gray(" \u2022 Token stored in environment variable (not in file)"));
|
|
5005
|
-
console.log(chalk7.gray(" \u2022
|
|
5049
|
+
console.log(chalk7.gray(" \u2022 Less convenient but still secure"));
|
|
5006
5050
|
console.log();
|
|
5007
5051
|
const syncMethodResponse = await prompts3({
|
|
5008
5052
|
type: "toggle",
|
|
@@ -5011,17 +5055,17 @@ async function runInteractiveWizard(options, detected, userTier) {
|
|
|
5011
5055
|
initial: true,
|
|
5012
5056
|
// Default to yes - strongly recommended
|
|
5013
5057
|
active: "Yes, use CLI (recommended)",
|
|
5014
|
-
inactive: "No, use env variable",
|
|
5058
|
+
inactive: "No, use curl/token/env variable",
|
|
5015
5059
|
hint: chalk7.green("Strongly recommended for security")
|
|
5016
5060
|
}, promptConfig);
|
|
5017
5061
|
answers.preferCliSync = syncMethodResponse.preferCliSync ?? true;
|
|
5018
5062
|
if (answers.preferCliSync) {
|
|
5019
|
-
console.log(chalk7.green(" \u2713 Perfect!
|
|
5063
|
+
console.log(chalk7.green(" \u2713 Perfect! Config will include lynxp CLI commands for syncing"));
|
|
5020
5064
|
console.log(chalk7.gray(" Make sure CLI is installed: npm install -g lynxprompt"));
|
|
5021
5065
|
} else {
|
|
5022
5066
|
console.log();
|
|
5023
|
-
console.log(chalk7.gray(" \u{1F510}
|
|
5024
|
-
console.log(chalk7.gray("
|
|
5067
|
+
console.log(chalk7.gray(" \u{1F510} Config will include curl commands using an environment variable."));
|
|
5068
|
+
console.log(chalk7.gray(" Your API token will NOT be stored in the config file."));
|
|
5025
5069
|
const envVarResponse = await prompts3({
|
|
5026
5070
|
type: "text",
|
|
5027
5071
|
name: "tokenEnvVar",
|
|
@@ -5030,8 +5074,8 @@ async function runInteractiveWizard(options, detected, userTier) {
|
|
|
5030
5074
|
hint: chalk7.gray("e.g., LYNXPROMPT_API_TOKEN, LP_TOKEN")
|
|
5031
5075
|
}, promptConfig);
|
|
5032
5076
|
answers.tokenEnvVar = envVarResponse.tokenEnvVar || "LYNXPROMPT_API_TOKEN";
|
|
5033
|
-
console.log(chalk7.green(` \u2713
|
|
5034
|
-
console.log(chalk7.gray(`
|
|
5077
|
+
console.log(chalk7.green(` \u2713 Config will reference $${answers.tokenEnvVar}`));
|
|
5078
|
+
console.log(chalk7.gray(` Remember to set: export ${answers.tokenEnvVar}="your_token_here"`));
|
|
5035
5079
|
}
|
|
5036
5080
|
}
|
|
5037
5081
|
if (answers.enableAutoUpdate && !api) {
|
|
@@ -5039,6 +5083,20 @@ async function runInteractiveWizard(options, detected, userTier) {
|
|
|
5039
5083
|
console.log(chalk7.gray(" Continuing without cloud sync..."));
|
|
5040
5084
|
answers.enableAutoUpdate = false;
|
|
5041
5085
|
}
|
|
5086
|
+
const selectedPlatforms = answers.platforms;
|
|
5087
|
+
if (answers.enableAutoUpdate && selectedPlatforms && selectedPlatforms.length > 1) {
|
|
5088
|
+
console.log();
|
|
5089
|
+
console.log(chalk7.yellow(" \u26A0\uFE0F You selected multiple output formats but only one can be synced to cloud."));
|
|
5090
|
+
const primaryFormatResponse = await prompts3({
|
|
5091
|
+
type: "select",
|
|
5092
|
+
name: "primaryFormat",
|
|
5093
|
+
message: chalk7.white("Which format should be the cloud-synced version?"),
|
|
5094
|
+
choices: selectedPlatforms.map((p) => ({ title: p, value: p })),
|
|
5095
|
+
hint: chalk7.gray("This version will be uploaded to LynxPrompt cloud")
|
|
5096
|
+
}, promptConfig);
|
|
5097
|
+
answers.primarySyncFormat = primaryFormatResponse.primaryFormat || selectedPlatforms[0];
|
|
5098
|
+
console.log(chalk7.green(` \u2713 ${answers.primarySyncFormat} will be synced to cloud, others are local-only`));
|
|
5099
|
+
}
|
|
5042
5100
|
console.log();
|
|
5043
5101
|
console.log(chalk7.gray(" \u{1F464} Include your profile info (name, email, persona) in the generated config."));
|
|
5044
5102
|
console.log(chalk7.gray(" This helps AI tools personalize responses to your expertise level."));
|
|
@@ -5184,7 +5242,24 @@ async function runInteractiveWizard(options, detected, userTier) {
|
|
|
5184
5242
|
if (canAccessTier(userTier, "advanced")) {
|
|
5185
5243
|
const staticStep = getCurrentStep("static");
|
|
5186
5244
|
showStep(currentStepNum, staticStep, userTier);
|
|
5187
|
-
console.log(chalk7.gray("
|
|
5245
|
+
console.log(chalk7.gray(" How should static file content be handled?"));
|
|
5246
|
+
console.log();
|
|
5247
|
+
console.log(chalk7.gray(" \u{1F4C4} Config only: Content embedded in AI config file (AI has context, no local files)"));
|
|
5248
|
+
console.log(chalk7.gray(" \u{1F4C1} Both: Create local files AND embed content in AI config file"));
|
|
5249
|
+
console.log();
|
|
5250
|
+
const staticFileHandlingResponse = await prompts3({
|
|
5251
|
+
type: "select",
|
|
5252
|
+
name: "handling",
|
|
5253
|
+
message: chalk7.white("Where to add static file content?"),
|
|
5254
|
+
choices: [
|
|
5255
|
+
{ title: "\u{1F4C4} Config file only (recommended)", value: "config_only", description: "Content goes in AI config, no separate files created" },
|
|
5256
|
+
{ title: "\u{1F4C1} Both local files AND config", value: "both", description: "Create files locally AND embed in AI config" }
|
|
5257
|
+
],
|
|
5258
|
+
initial: 0
|
|
5259
|
+
}, promptConfig);
|
|
5260
|
+
answers.staticFileHandling = staticFileHandlingResponse.handling || "config_only";
|
|
5261
|
+
console.log();
|
|
5262
|
+
console.log(chalk7.gray(" Select project files to include:"));
|
|
5188
5263
|
console.log();
|
|
5189
5264
|
const STATIC_FILE_OPTIONS = [
|
|
5190
5265
|
{ title: "\u{1F4DD} .editorconfig", value: "editorconfig", desc: "Consistent code formatting" },
|
|
@@ -5419,6 +5494,7 @@ async function runInteractiveWizard(options, detected, userTier) {
|
|
|
5419
5494
|
testNotes: answers.testNotes,
|
|
5420
5495
|
staticFiles: answers.staticFiles,
|
|
5421
5496
|
staticFileContents: answers.staticFileContents,
|
|
5497
|
+
staticFileHandling: answers.staticFileHandling,
|
|
5422
5498
|
includeFunding: answers.includeFunding,
|
|
5423
5499
|
extraNotes: answers.extraNotes,
|
|
5424
5500
|
semver: answers.semver,
|