update
Create/edit private models with full definitions or surgical changes.
tl;dr Use
updatefor private model mutations. PrefermodelIdfor deterministic targeting. It supports fullmodelDefinitionwrites and surgicalchanges[], including page paths.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
modelId | string | No | Preferred private model identifier for updates. Routes updates by ID when provided. |
name | string | No | Name fallback when ID is not provided. If both modelId and name are provided, they must refer to the same model. |
modelDefinition | object | No | Full model definition for create/replace flows. With a target (modelId or name), this replaces the existing private model in place. Without a target, this creates a new model. |
changes | array | No | Unified operations: add, replace, remove. |
normalizeInput | boolean | No | Normalizes smart quotes/dashes in page patch input. Default true. |
validate | string | No | "auto" (default), "always", or "never". |
allowDeletes | boolean | No | Required for remove operations. |
deleteConfirmation | string | No | Required confirmation token for delete operations. |
Page path support
changes[] supports page-specific paths:
/page/page/components/<ComponentName>/page/code/page/version/page/schema/page/schema/...
Use valueBase64 when payloads contain characters that can break JSON escaping.
Examples
- Replace a token:
update { modelId: "priv_1", changes: [{ op: "replace", path: "/principles/primary/$value", value: "oklch(0.7 0.2 250)" }] } - Replace a page component:
update { modelId: "priv_1", changes: [{ op: "replace", path: "/page/components/HeroSection", valueBase64: "<base64-jsx>" }] } - Replace page fields in one operation:
update { modelId: "priv_1", changes: [{ op: "replace", path: "/page", value: { version: "2.0.0", schema: { ... } } }] }
Related
Better prototypes with less prompting
Start creating