A Script is a self-contained TypeScript helper module whose declared synchronous functions can be called from Component expressions.
Property: Identity · Current behavior: files below scripts/
Property: Workspace · Current behavior: Logic declarations and Code source
Property: Value types · Current behavior: scalar/array string, number, boolean; object and object array
Property: Component path · Current behavior: scripts.<file>.<function>(…)
Property: MCP · Current behavior: create/update/declare/read/call
Property: Result · Current behavior: user-authored TypeScript module
Declare functions, stable parameter IDs, return types, and object/array result fields in Logic; implement them in Code. Stable identities preserve stored bindings across supported renames. Signature analysis reports differences between declarations and actual exports.
Use create-script, update-script, declare-script-function, get-script, and call-script. Call arguments are keyed by parameter name. Read declarations/source before replacement.
Script export preserves the user's TypeScript without the normal generated-file header, but the exported copy is still refreshed from the Misaki project. Keep one source of truth.
Typing bursts shorter than 600 ms coalesce into one undo step, and Preview offers Update rather than rerendering every incomplete burst. Scripts allow no imports, npm packages, React/JSX, DOM access, inter-script imports, or asynchronous callable functions. Use Code Components for rendered JSX.