Copy a site's served files into a new source tree
promote_dist_to_sourceCreate the editable source tree of a site that has none by copying the files it serves, so later changes can use write_source_files, apply_edits(target:'source') and build_and_deploy. The served files do not change, and a site that already has source is left as is. Use mode 'force' only after telling the user that build output (minified bundles) is not original source.
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": "promote_dist_to_source"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| mode | No | auto (default): copy plain static files only and refuse build output such as hashed bundles. force: copy build output too. | |
| name | No | Site name as shown by list_sites, e.g. my-portfolio. Provide name or siteId. | |
| siteId | No | Site id from list_sites or get_site. Use instead of name. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| hint | No | Next step when nothing was copied. | |
| mode | Yes | ||
| name | Yes | ||
| reason | No | Why nothing was copied: the site already has a source tree, or auto mode found build output. | |
| siteId | Yes | ||
| noBuild | No | True when no package.json was copied: build_and_deploy then publishes the source as is. | |
| promoted | Yes | True when this call created the source tree. |