vendor/clawdforge: refresh SDK — adds SystemMode::Replace for personas

Re-vendored from clawdforge@d4c3a9d. RunRequest now carries
`system_mode: Option<SystemMode>` where SystemMode is Append (the
default, current behavior — append to claude's base prompt) or
Replace (new — replaces claude's base prompt entirely).

Replace mode is the unlock for v0.3 author personas: Orson Black /
Bay / Kayos as authors can't have Claude's default helpful-honest
defaults bleeding through. Replace makes the model BECOME the
persona instead of 'Claude playing the persona.'

Existing skald::summarize call stays on default (Append) — the
summarizer is more 'tool-use over text' than persona, and Claude's
defaults help there. The gen + cleanup passes will switch to
Replace once authors are wired (next step).
This commit is contained in:
Kayos 2026-05-13 11:30:13 -07:00
parent 4230aa472f
commit e1e782177d
2 changed files with 35 additions and 2 deletions

View file

@ -54,5 +54,5 @@ pub use error::Error;
pub use session::{Session, SessionList, SessionOptions, SessionState, TurnEvent, TurnResult};
pub use types::{
AppToken, AppTokenInfo, FileToken, Healthz, RunFailure, RunRequest, RunResult,
TokenCreateRequest, TokenList,
SystemMode, TokenCreateRequest, TokenList,
};

View file

@ -9,6 +9,23 @@ use serde::{de::DeserializeOwned, Deserialize, Serialize};
use crate::error::Error;
/// How `system` is passed to `claude -p`. See [`RunRequest::system_mode`].
#[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize)]
#[serde(rename_all = "lowercase")]
pub enum SystemMode {
/// `--append-system-prompt` — additive on top of Claude's defaults.
Append,
/// `--system-prompt` — REPLACES Claude's default base prompt
/// entirely. Right for personas.
Replace,
}
impl Default for SystemMode {
fn default() -> Self {
Self::Append
}
}
/// `GET /healthz` response body.
#[derive(Debug, Clone, Deserialize, Serialize)]
pub struct Healthz {
@ -43,10 +60,26 @@ pub struct RunRequest {
#[serde(skip_serializing_if = "Option::is_none")]
pub model: Option<String>,
/// System prompt appended via `claude -p --append-system-prompt`.
/// System prompt. How it's passed to `claude -p` depends on
/// [`Self::system_mode`].
#[serde(skip_serializing_if = "Option::is_none")]
pub system: Option<String>,
/// How `system` is passed to `claude -p`:
///
/// - [`SystemMode::Append`] (default) → `--append-system-prompt`.
/// Claude's default base prompt stays + `system` is added.
/// Right for tool-using assistants where Claude's helpful-
/// honest defaults are useful substrate.
/// - [`SystemMode::Replace`] → `--system-prompt`. Replaces the
/// base prompt entirely. Right for personas (fiction authors,
/// chat bots, in-world characters) where Claude's defaults
/// would bleed through as friction.
///
/// `None` = server default (currently `append`).
#[serde(skip_serializing_if = "Option::is_none")]
pub system_mode: Option<SystemMode>,
/// File tokens previously returned from [`Client::upload_file`].
///
/// [`Client::upload_file`]: crate::Client::upload_file