feat(FN-4400): complete Step 2 — add heartbeat prompt template settings
Fusion-Task-Id: FN-4400 Fusion-Task-Lineage: 0d4f9c48-5b8b-49eb-9cf3-d1d585ffe7fc
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
import type {
|
||||
DirectMergeCommitStrategy,
|
||||
GithubAuthMode,
|
||||
HeartbeatPromptTemplate,
|
||||
HeartbeatScopeDisciplineMode,
|
||||
UnavailableNodePolicy,
|
||||
} from "./types.js";
|
||||
@@ -14,6 +15,10 @@ const HEARTBEAT_SCOPE_DISCIPLINE_MODES: readonly HeartbeatScopeDisciplineMode[]
|
||||
"lite",
|
||||
"off",
|
||||
] as const;
|
||||
const HEARTBEAT_PROMPT_TEMPLATES: readonly HeartbeatPromptTemplate[] = [
|
||||
"default",
|
||||
"compact",
|
||||
] as const;
|
||||
|
||||
/**
|
||||
* Validates a project unavailable-node routing policy value.
|
||||
@@ -83,3 +88,16 @@ export function validateHeartbeatScopeDisciplineMode(value: unknown): HeartbeatS
|
||||
? (value as HeartbeatScopeDisciplineMode)
|
||||
: undefined;
|
||||
}
|
||||
|
||||
/** Returns a validated heartbeat prompt template for project/agent settings, otherwise undefined. */
|
||||
export function validateHeartbeatPromptTemplate(value: unknown): HeartbeatPromptTemplate | undefined {
|
||||
if (value === undefined) {
|
||||
return undefined;
|
||||
}
|
||||
if (typeof value !== "string") {
|
||||
return undefined;
|
||||
}
|
||||
return (HEARTBEAT_PROMPT_TEMPLATES as readonly string[]).includes(value)
|
||||
? (value as HeartbeatPromptTemplate)
|
||||
: undefined;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user