From e1e782177d8808d01674293fdfaf0faa2fe8683e Mon Sep 17 00:00:00 2001 From: Kayos Date: Wed, 13 May 2026 11:30:13 -0700 Subject: [PATCH] =?UTF-8?q?vendor/clawdforge:=20refresh=20SDK=20=E2=80=94?= =?UTF-8?q?=20adds=20SystemMode::Replace=20for=20personas?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Re-vendored from clawdforge@d4c3a9d. RunRequest now carries `system_mode: Option` 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). --- vendor/clawdforge/src/lib.rs | 2 +- vendor/clawdforge/src/types.rs | 35 +++++++++++++++++++++++++++++++++- 2 files changed, 35 insertions(+), 2 deletions(-) diff --git a/vendor/clawdforge/src/lib.rs b/vendor/clawdforge/src/lib.rs index 59d8313..bf3c207 100644 --- a/vendor/clawdforge/src/lib.rs +++ b/vendor/clawdforge/src/lib.rs @@ -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, }; diff --git a/vendor/clawdforge/src/types.rs b/vendor/clawdforge/src/types.rs index 1774539..6f62b9d 100644 --- a/vendor/clawdforge/src/types.rs +++ b/vendor/clawdforge/src/types.rs @@ -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, - /// 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, + /// 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, + /// File tokens previously returned from [`Client::upload_file`]. /// /// [`Client::upload_file`]: crate::Client::upload_file