Update promptBuilder.js
This commit is contained in:
@@ -224,7 +224,7 @@ export function generateJSONTrackerInstructions(includeHtmlPrompt = true, includ
|
||||
const enabledStats = trackerConfig?.userStats?.customStats?.filter(s => s?.enabled && s?.name) || [];
|
||||
if (enabledStats.length > 0) {
|
||||
let statsJson = ' "stats": {\n';
|
||||
statsJson += enabledStats.map(s => ` "${s.name}": 75`).join(',\n');
|
||||
statsJson += enabledStats.map(s => ` "${s.name}": X`).join(',\n');
|
||||
statsJson += '\n }';
|
||||
sections.push(statsJson);
|
||||
}
|
||||
@@ -235,7 +235,7 @@ export function generateJSONTrackerInstructions(includeHtmlPrompt = true, includ
|
||||
let statusJson = ' "status": {\n';
|
||||
const statusParts = [];
|
||||
if (statusConfig.showMoodEmoji) {
|
||||
statusParts.push(' "mood": "😊"');
|
||||
statusParts.push(' "mood": "[Mood Emoji]"');
|
||||
}
|
||||
const customFields = statusConfig.customFields || [];
|
||||
if (customFields.length > 0) {
|
||||
@@ -250,7 +250,7 @@ export function generateJSONTrackerInstructions(includeHtmlPrompt = true, includ
|
||||
// Skills section
|
||||
const skillsSectionEnabled = trackerConfig?.userStats?.skillsSection?.enabled || false;
|
||||
if (skillsSectionEnabled && !extensionSettings.showSkills) {
|
||||
sections.push(` "skills": "Skill1, Skill2, Skill3"`);
|
||||
sections.push(` "skills": "[Skills]"`);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -290,15 +290,15 @@ export function generateJSONTrackerInstructions(includeHtmlPrompt = true, includ
|
||||
if (showInfoBox) {
|
||||
const widgets = trackerConfig?.infoBox?.widgets || {};
|
||||
const infoParts = [];
|
||||
if (widgets.date?.enabled) infoParts.push(' "date": "Monday, March 15, 1242"');
|
||||
if (widgets.time?.enabled) infoParts.push(' "time": "14:00 → 15:30"');
|
||||
if (widgets.weather?.enabled) infoParts.push(' "weather": "☀️ Sunny"');
|
||||
if (widgets.date?.enabled) infoParts.push(' "date": "[Day, Month, Year]"');
|
||||
if (widgets.time?.enabled) infoParts.push(' "time": "[Time Start → Time End]"');
|
||||
if (widgets.weather?.enabled) infoParts.push(' "weather": "[Weather Emoji, Weather]"');
|
||||
if (widgets.temperature?.enabled) {
|
||||
const unit = widgets.temperature.unit === 'F' ? '°F' : '°C';
|
||||
infoParts.push(` "temperature": "22${unit}"`);
|
||||
infoParts.push(` "temperature": "X${unit}"`);
|
||||
}
|
||||
if (widgets.location?.enabled) infoParts.push(' "location": "Forest Clearing"');
|
||||
if (widgets.recentEvents?.enabled) infoParts.push(' "recentEvents": ["Event 1", "Event 2"]');
|
||||
if (widgets.location?.enabled) infoParts.push(' "location": "[Location]"');
|
||||
if (widgets.recentEvents?.enabled) infoParts.push(' "recentEvents": "[Events]"');
|
||||
|
||||
if (infoParts.length > 0) {
|
||||
sections.push(' "infoBox": {\n' + infoParts.join(',\n') + '\n }');
|
||||
@@ -308,12 +308,12 @@ export function generateJSONTrackerInstructions(includeHtmlPrompt = true, includ
|
||||
// Characters section
|
||||
if (showCharacters) {
|
||||
const charConfig = trackerConfig?.presentCharacters || {};
|
||||
let charExample = ' {\n "name": "Character Name",\n "emoji": "🧑"';
|
||||
let charExample = ' {\n "name": "Character Name",\n "emoji": "[Character Emoji]"';
|
||||
|
||||
if (charConfig.relationshipFields?.length > 0) {
|
||||
// Show allowed relationship values as explanation
|
||||
const allowedRelationships = charConfig.relationshipFields.join(' | ');
|
||||
charExample += `,\n "relationship": "(${allowedRelationships})"`;
|
||||
charExample += `,\n "relationship": "[${allowedRelationships}]"`;
|
||||
}
|
||||
|
||||
const enabledFields = charConfig.customFields?.filter(f => f.enabled) || [];
|
||||
@@ -326,7 +326,7 @@ export function generateJSONTrackerInstructions(includeHtmlPrompt = true, includ
|
||||
const charStatsConfig = charConfig.characterStats;
|
||||
const enabledCharStats = charStatsConfig?.enabled && charStatsConfig?.customStats?.filter(s => s?.enabled && s?.name) || [];
|
||||
if (enabledCharStats.length > 0) {
|
||||
const statsJson = enabledCharStats.map(s => ` "${s.name}": 75`).join(',\n');
|
||||
const statsJson = enabledCharStats.map(s => ` "${s.name}": X`).join(',\n');
|
||||
charExample += `,\n "stats": {\n${statsJson}\n }`;
|
||||
}
|
||||
|
||||
@@ -344,20 +344,20 @@ export function generateJSONTrackerInstructions(includeHtmlPrompt = true, includ
|
||||
|
||||
if (extensionSettings.useSimplifiedInventory) {
|
||||
// Simplified: single list
|
||||
let itemExample = '{ "name": "Item Name", "description": "What it is" }';
|
||||
let itemExample = '{ "name": "Item Name", "description": "[What It Is]" }';
|
||||
if (enableItemSkillLinks) {
|
||||
itemExample = '{ "name": "Iron Sword", "description": "A sturdy blade", "grantsSkill": "Sword Fighting" }';
|
||||
itemExample = '{ "name": "Iron Sword", "description": "[What It Is]", "grantsSkill": "[Skill]" }';
|
||||
}
|
||||
invSection += ` "items": [${itemExample}]\n`;
|
||||
} else {
|
||||
// Full categorized inventory
|
||||
let itemExample = '{ "name": "Item", "description": "Description" }';
|
||||
if (enableItemSkillLinks) {
|
||||
itemExample = '{ "name": "Iron Sword", "description": "A sturdy blade", "grantsSkill": "Sword Fighting" }';
|
||||
itemExample = '{ "name": "Iron Sword", "description": "[What It Is]", "grantsSkill": "[Skill]" }';
|
||||
}
|
||||
invSection += ` "onPerson": [${itemExample}],\n`;
|
||||
invSection += ' "stored": { "Location Name": [{ "name": "Stored Item", "description": "Description" }] },\n';
|
||||
invSection += ' "assets": [{ "name": "Property/Vehicle", "description": "Description" }]\n';
|
||||
invSection += ' "stored": { "Location Name": [{ "name": "Stored Item", "description": "[What It Is]" }] },\n';
|
||||
invSection += ' "assets": [{ "name": "[Property/Vehicle]", "description": "[What It Is]" }]\n';
|
||||
}
|
||||
|
||||
invSection += ' }';
|
||||
@@ -374,9 +374,9 @@ export function generateJSONTrackerInstructions(includeHtmlPrompt = true, includ
|
||||
let skillsSection = ' "skills": {\n';
|
||||
const categoryExamples = enabledCategories.map(cat => {
|
||||
const catName = cat.name;
|
||||
let skillExample = '{ "name": "Ability Name", "description": "What this ability does" }';
|
||||
let skillExample = '{ "name": "Ability Name", "description": "[What This Ability Does]" }';
|
||||
if (enableItemSkillLinks) {
|
||||
skillExample = '{ "name": "Ability", "description": "Description", "grantedBy": "Item Name" }';
|
||||
skillExample = '{ "name": "Ability", "description": "[Description]", "grantedBy": "[Item Name]" }';
|
||||
}
|
||||
return ` "${catName}": [${skillExample}]`;
|
||||
});
|
||||
@@ -389,8 +389,8 @@ export function generateJSONTrackerInstructions(includeHtmlPrompt = true, includ
|
||||
// Quests section
|
||||
if (showQuests) {
|
||||
let questsSection = ' "quests": {\n';
|
||||
questsSection += ' "main": { "name": "Main Quest Title", "description": "Primary objective" },\n';
|
||||
questsSection += ' "optional": [{ "name": "Side Quest", "description": "Optional objective" }]\n';
|
||||
questsSection += ' "main": { "name": "Main Quest Title", "description": "[Primary objective]" },\n';
|
||||
questsSection += ' "optional": [{ "name": "Side Quest", "description": "[Optional objective]" }]\n';
|
||||
questsSection += ' }';
|
||||
sections.push(questsSection);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user