Save global JS
fabrement-save-global-jsWrite the SITE-WIDE script (front end only, deferred) for behaviour no single block owns. Either js = the COMPLETE file (replaces; "" deletes) or edits = exact-fragment replacements of the current file — prefer edits for changes. Pass expectedHash from get-global-js. Block behaviour belongs in the block's view.js.
Rules: get-skill-doc {id:"global-js-contract"} — read it before the first call.
Tool call template
This tool declares no required parameters. Add optional parameters from the input schema as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {},
"name": "fabrement-save-global-js"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| js | No | The COMPLETE script (replaces the current one). "" removes it. Not with `edits`. | |
| edits | No | Applied in order to one copy; all or none. `old` is an exact fragment (whitespace-insensitive fallback) that must match exactly once unless replaceAll. | |
| expectedHash | No | `hash` from get-global-js. If the file changed since, nothing is saved. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| url | No | ||
| hash | No | Of the saved file — use as expectedHash for the next save. | |
| bytes | No | ||
| saved | Yes | ||
| exists | Yes | False after an empty save (the file was removed). |