docs(agent): state the persona's template contract in its JSDoc

The AgentOptions.systemPrompt doc said the persona 'may reference'
variables without saying that every complete {{...}} group IS interpreted,
strictly, and that literal {{...}} prose has no escape syntax yet (the
RFC's recorded deferral). A persona author reads this line first; it now
carries the contract. (ds-review-bot inline finding: the escape mechanism
itself stays deferred per the RFC — pre-release, no external consumers,
and the failure is loud with the fix in the message.)
This commit is contained in:
Tianyi Cui
2026-07-05 10:48:40 +08:00
parent e890a3373e
commit 2f191cc72b
2 changed files with 16 additions and 13 deletions

View File

@@ -78,11 +78,14 @@ export interface AgentOptions {
/** Model name (must have a registered adapter at call time). */
model?: string
/**
* The agent's persona: a deployment-authored prompt-template fragment,
* The agent's persona: a deployment-authored prompt-TEMPLATE fragment,
* rendered as the order-0 section of the assembled system prompt (before
* all tool guidance). It may reference registered `{{variables}}` (e.g.
* `{{model}}`, `{{cwd}}`); it is one section of the full prompt, never the
* whole.
* whole. Template, not free-form text: every complete `{{…}}` group IS
* interpreted, strictly — an unknown or malformed reference fails the turn
* loudly — and there is no escape syntax for literal `{{…}}` prose yet (a
* deliberate deferral; see the prompt-variables RFC).
*/
systemPrompt?: string
}