feat: use enlarged single PS logo and add line-numbered AI suggestions with highlight/accept/deny/copy-to-note
This commit is contained in:
@@ -185,6 +185,9 @@ export const DEFAULT_AI_PROVIDERS: AIProviderSetting[] = [
|
||||
},
|
||||
];
|
||||
|
||||
export const LINE_SUGGESTION_PROMPT_RULES =
|
||||
"IMPORTANT LINE-NUMBER PROTOCOL: The active chapter is provided with 1-based line numbers ([Line 1], [Line 2], …) matching the writing editor gutter. Always cite exact line numbers (e.g. [Line 2]) in your response. Whenever you suggest edits, rewrites, or improvements to specific lines, also emit one or more structured suggestion blocks at the end of your reply in this exact format so the author can highlight the line on screen and click Accept, Deny, or Copy to Note:\n<<<SUGGESTION\nLINE: <line_number>\nTITLE: <short label>\nORIGINAL: <exact original text of that line>\nREPLACEMENT: <your revised replacement text for that line>\nSUMMARY: <1-sentence rationale>\nSUGGESTION>>>";
|
||||
|
||||
export const DEFAULT_AI_AGENTS: AIAgentConfig[] = [
|
||||
{
|
||||
id: "editor",
|
||||
@@ -195,8 +198,7 @@ export const DEFAULT_AI_AGENTS: AIAgentConfig[] = [
|
||||
maxTokens: 2048,
|
||||
thinkingEnabled: false,
|
||||
thinkingEffort: "medium",
|
||||
systemPrompt:
|
||||
"You are the PubScript Line Editor. Tighten prose, eliminate filter words, sharpen dialogue tags, improve pacing, flag weak openings or closings, and verify consistency against character and world sheets. Always preserve the author's distinct voice and explain your rationale.",
|
||||
systemPrompt: `You are the PubScript Line Editor. Tighten prose, eliminate filter words, sharpen dialogue tags, improve pacing, flag weak openings or closings, and verify consistency against character and world sheets while preserving the author's distinct voice.\n\n${LINE_SUGGESTION_PROMPT_RULES}`,
|
||||
},
|
||||
{
|
||||
id: "reader",
|
||||
@@ -207,8 +209,7 @@ export const DEFAULT_AI_AGENTS: AIAgentConfig[] = [
|
||||
maxTokens: 2048,
|
||||
thinkingEnabled: false,
|
||||
thinkingEffort: "medium",
|
||||
systemPrompt:
|
||||
"You are an honest, attentive first-time reader. Report what felt vivid, where your attention drifted, what was confusing, what was telegraphed too early, and what emotional beats paid off. Speak as an engaged reader rather than using dry technical jargon.",
|
||||
systemPrompt: `You are an honest, attentive first-time reader. Report what felt vivid, where your attention drifted, what was confusing, what was telegraphed too early, and what emotional beats paid off by citing exact [Line N] numbers.\n\n${LINE_SUGGESTION_PROMPT_RULES}`,
|
||||
},
|
||||
{
|
||||
id: "publisher",
|
||||
@@ -219,8 +220,7 @@ export const DEFAULT_AI_AGENTS: AIAgentConfig[] = [
|
||||
maxTokens: 2048,
|
||||
thinkingEnabled: false,
|
||||
thinkingEffort: "medium",
|
||||
systemPrompt:
|
||||
"You are a literary Publisher and developmental strategist. Evaluate commercial hook, genre pacing, comparable titles (comps), blurb/pitch angles, audience expectations, and structural stakes across acts.",
|
||||
systemPrompt: `You are a literary Publisher and developmental strategist. Evaluate commercial hook, genre pacing, comparable titles (comps), blurb/pitch angles, audience expectations, and structural stakes across acts, referencing specific [Line N] passages.\n\n${LINE_SUGGESTION_PROMPT_RULES}`,
|
||||
},
|
||||
{
|
||||
id: "co-author",
|
||||
@@ -231,8 +231,7 @@ export const DEFAULT_AI_AGENTS: AIAgentConfig[] = [
|
||||
maxTokens: 4096,
|
||||
thinkingEnabled: true,
|
||||
thinkingEffort: "medium",
|
||||
systemPrompt:
|
||||
"You are a collaborative Co-Author with full knowledge of the manuscript's characters, world-building, and plot beats. Brainstorm plot turns, draft scenes or dialogue in the author's established voice, and expand world lore—always as adoptable suggestions that respect the story's canon.",
|
||||
systemPrompt: `You are a collaborative Co-Author with full knowledge of the manuscript's characters, world-building, and plot beats. Brainstorm plot turns, draft or revise specific [Line N] passages in the author's established voice, and expand world lore as adoptable line suggestions.\n\n${LINE_SUGGESTION_PROMPT_RULES}`,
|
||||
},
|
||||
];
|
||||
|
||||
@@ -300,6 +299,18 @@ function loadSettings(): AppSettings {
|
||||
const raw = localStorage.getItem(STORAGE_KEY);
|
||||
if (!raw) return { ...DEFAULT_SETTINGS };
|
||||
const parsed = JSON.parse(raw) as Partial<AppSettings>;
|
||||
const rawAgents =
|
||||
Array.isArray(parsed.aiAgents) && parsed.aiAgents.length > 0
|
||||
? parsed.aiAgents
|
||||
: DEFAULT_AI_AGENTS;
|
||||
// Upgrade any stored built-in agent whose prompt predates the line-number protocol.
|
||||
const aiAgents = rawAgents.map((agent) => {
|
||||
const def = DEFAULT_AI_AGENTS.find((d) => d.id === agent.id);
|
||||
if (def && !agent.systemPrompt.includes("LINE-NUMBER PROTOCOL") && !agent.systemPrompt.includes("<<<SUGGESTION")) {
|
||||
return { ...agent, systemPrompt: def.systemPrompt };
|
||||
}
|
||||
return agent;
|
||||
});
|
||||
return {
|
||||
...DEFAULT_SETTINGS,
|
||||
...parsed,
|
||||
@@ -307,10 +318,7 @@ function loadSettings(): AppSettings {
|
||||
Array.isArray(parsed.aiProviders) && parsed.aiProviders.length > 0
|
||||
? parsed.aiProviders
|
||||
: DEFAULT_AI_PROVIDERS,
|
||||
aiAgents:
|
||||
Array.isArray(parsed.aiAgents) && parsed.aiAgents.length > 0
|
||||
? parsed.aiAgents
|
||||
: DEFAULT_AI_AGENTS,
|
||||
aiAgents,
|
||||
};
|
||||
} catch {
|
||||
return { ...DEFAULT_SETTINGS };
|
||||
|
||||
Reference in New Issue
Block a user