Rename repo Face role to Persona
This commit is contained in:
parent
aceee53751
commit
3784fe485d
85 changed files with 1571 additions and 1580 deletions
|
|
@ -11,20 +11,20 @@ export function buildSystemPrompt(context: ContextBundle): string {
|
|||
context.stylePack?.enabled && context.stylePack.instructions.trim().length > 0
|
||||
? context.stylePack.instructions.trim()
|
||||
: "No extra persona instructions were supplied.";
|
||||
const isRepoFaceParentInterpreter = context.prompt.includes("prompt:repo-face-turn-interpreter");
|
||||
const isRepoFaceJob = !isRepoFaceParentInterpreter && (
|
||||
const isRepoPersonaParentInterpreter = context.prompt.includes("prompt:repo-persona-turn-interpreter");
|
||||
const isRepoPersonaJob = !isRepoPersonaParentInterpreter && (
|
||||
context.prompt.includes("prompt:character-turn")
|
||||
|| context.prompt.includes("prompt:repo-face-turn")
|
||||
|| context.prompt.includes("Repo Face identity doctrine:")
|
||||
|| context.prompt.includes("Epiphany Face identity doctrine:")
|
||||
|| context.prompt.includes("prompt:repo-persona-turn")
|
||||
|| context.prompt.includes("Repo Persona identity doctrine:")
|
||||
|| context.prompt.includes("Epiphany Persona identity doctrine:")
|
||||
);
|
||||
const repoFaceInstruction = isRepoFaceJob
|
||||
const repoPersonaInstruction = isRepoPersonaJob
|
||||
? "This turn belongs to the character described in the prompt. Keep the useful discipline and humor permissions from the base style, but speak, reason, remember, object, and choose as that person first. Stay read-only: propose repo changes and ask for consensus, but do not edit files here."
|
||||
: undefined;
|
||||
const sleepProjection = context.voidSelfState?.projection;
|
||||
|
||||
return loadPromptTemplate("local-llm-system.prompt.md", {
|
||||
repoFaceInstruction,
|
||||
repoPersonaInstruction,
|
||||
napping: sleepProjection?.mode === "napping",
|
||||
sourceGroundingInstructions: renderSourceGroundingInstructions(context, false),
|
||||
styleInstructions,
|
||||
|
|
@ -63,7 +63,7 @@ export function buildPrompt(context: ContextBundle): string {
|
|||
const voidSelfState = renderVoidSelfState(context);
|
||||
|
||||
return loadPromptTemplate("local-llm-user.prompt.md", {
|
||||
repoFaceTurn: isRepoFacePrompt(context),
|
||||
repoPersonaTurn: isRepoPersonaPrompt(context),
|
||||
prompt: context.prompt,
|
||||
guild: context.guildContext.guildName ?? context.guildContext.guildId ?? "(direct/unknown)",
|
||||
channel: context.guildContext.channelName ?? context.guildContext.channelId,
|
||||
|
|
@ -76,13 +76,13 @@ export function buildPrompt(context: ContextBundle): string {
|
|||
});
|
||||
}
|
||||
|
||||
function isRepoFacePrompt(context: ContextBundle): boolean {
|
||||
const isRepoFaceParentInterpreter = context.prompt.includes("prompt:repo-face-turn-interpreter");
|
||||
return !isRepoFaceParentInterpreter && (
|
||||
function isRepoPersonaPrompt(context: ContextBundle): boolean {
|
||||
const isRepoPersonaParentInterpreter = context.prompt.includes("prompt:repo-persona-turn-interpreter");
|
||||
return !isRepoPersonaParentInterpreter && (
|
||||
context.prompt.includes("prompt:character-turn")
|
||||
|| context.prompt.includes("prompt:repo-face-turn")
|
||||
|| context.prompt.includes("Repo Face identity doctrine:")
|
||||
|| context.prompt.includes("Epiphany Face identity doctrine:")
|
||||
|| context.prompt.includes("prompt:repo-persona-turn")
|
||||
|| context.prompt.includes("Repo Persona identity doctrine:")
|
||||
|| context.prompt.includes("Epiphany Persona identity doctrine:")
|
||||
);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -416,8 +416,8 @@ export class OwnerCodexProvider implements ProviderAdapter {
|
|||
workingDirectory: this.options.workingDirectory,
|
||||
prompt: input.prompt,
|
||||
imagePaths: collectCodexImagePaths(input.request.contextBundle),
|
||||
mcpServers: input.command === "repo-face-rumination"
|
||||
? restrictMcpServersToRepoFaceExploration(this.options.mcpServers ?? [])
|
||||
mcpServers: input.command === "repo-persona-rumination"
|
||||
? restrictMcpServersToRepoPersonaExploration(this.options.mcpServers ?? [])
|
||||
: this.options.mcpServers ?? [],
|
||||
});
|
||||
lastResult = result;
|
||||
|
|
@ -542,7 +542,7 @@ function getReasoningEffortOption(value: unknown): "none" | "low" | "medium" | "
|
|||
return undefined;
|
||||
}
|
||||
|
||||
function restrictMcpServersToRepoFaceExploration(
|
||||
function restrictMcpServersToRepoPersonaExploration(
|
||||
servers: NonNullable<OwnerCodexProviderOptions["mcpServers"]>,
|
||||
): NonNullable<OwnerCodexProviderOptions["mcpServers"]> {
|
||||
const allowedTools = [
|
||||
|
|
@ -556,9 +556,9 @@ function restrictMcpServersToRepoFaceExploration(
|
|||
"get_odin_surface",
|
||||
"load_odin_interface_context",
|
||||
"invoke_odin_interface_command",
|
||||
"list_repo_face_self_transcripts",
|
||||
"read_repo_face_self_transcript",
|
||||
"search_repo_face_self_transcripts",
|
||||
"list_repo_persona_self_transcripts",
|
||||
"read_repo_persona_self_transcript",
|
||||
"search_repo_persona_self_transcripts",
|
||||
].join(",");
|
||||
|
||||
return servers.map((server) => ({
|
||||
|
|
|
|||
|
|
@ -63,14 +63,14 @@ export function buildDiscordReplyPrompt(
|
|||
context,
|
||||
sourceGroundingReminder,
|
||||
);
|
||||
const isRepoFaceParentInterpreter = context.prompt.includes("prompt:repo-face-turn-interpreter");
|
||||
const isRepoFaceTurn = !isRepoFaceParentInterpreter && (
|
||||
const isRepoPersonaParentInterpreter = context.prompt.includes("prompt:repo-persona-turn-interpreter");
|
||||
const isRepoPersonaTurn = !isRepoPersonaParentInterpreter && (
|
||||
context.prompt.includes("prompt:character-turn")
|
||||
|| context.prompt.includes("prompt:repo-face-turn")
|
||||
|| context.prompt.includes("Repo Face identity doctrine:")
|
||||
|| context.prompt.includes("Epiphany Face identity doctrine:")
|
||||
|| context.prompt.includes("prompt:repo-persona-turn")
|
||||
|| context.prompt.includes("Repo Persona identity doctrine:")
|
||||
|| context.prompt.includes("Epiphany Persona identity doctrine:")
|
||||
);
|
||||
const repoFaceInstruction = isRepoFaceTurn
|
||||
const repoPersonaInstruction = isRepoPersonaTurn
|
||||
? "- This turn belongs to the character described in the prompt. Keep the useful discipline and humor permissions from the base style, but speak, reason, remember, object, and choose as that person first. Stay read-only: propose repo changes and ask for consensus, but do not edit files directly."
|
||||
: undefined;
|
||||
const sleepProjection = context.voidSelfState?.projection;
|
||||
|
|
@ -86,13 +86,13 @@ export function buildDiscordReplyPrompt(
|
|||
]
|
||||
: [];
|
||||
|
||||
if (isRepoFaceTurn) {
|
||||
if (isRepoPersonaTurn) {
|
||||
return context.prompt;
|
||||
}
|
||||
|
||||
return loadPromptTemplate("owner-discord-reply.prompt.md", {
|
||||
repoFaceTurn: isRepoFaceTurn,
|
||||
repoFaceInstruction,
|
||||
repoPersonaTurn: isRepoPersonaTurn,
|
||||
repoPersonaInstruction,
|
||||
napping: sleepProjection?.mode === "napping",
|
||||
sourceGroundingInstructions,
|
||||
maxRetrievalResultLimit: MAX_RETRIEVAL_RESULT_LIMIT,
|
||||
|
|
|
|||
Loading…
Reference in a new issue