deploy_files #
On this page
Generated automatically from the published contract sources.
A script calls this action over HTTPS at POST https://tzcloud.turnzero.ai/v1/deploy_files, with a bearer credential and the action's payload as the JSON body. An MCP connection lists this action as the tool tzcloud_deploy_files.
OAuth access tokens and minted tokens, including the turnzero command's computer token, are bearer credentials. The action determines which kinds, scopes and grants it accepts (Sign-in, sessions, and tokens).
Build metadata: Registered in this build. Registration describes the default dispatcher in this build. It does not guarantee that a caller has the required credential or grant, that a tool is listed for that connection, or that the required service is configured.
Contract description #
Deploy your inline or stored files. ZIPs use deploy and a folder uses deploy_command.
No folder path or ZIP is accepted. With a shell and the app's whole folder, use deploy_command where it works. With a shell, use the upload route beyond this tool's total or entry caps. Use deploy_files wherever the command cannot run, or for a disposable simple test app's first deploy.
One complete files call starts deployment. Your files must contain no secret values. Unreadable binary content needs an app storage area and a user upload. Get the page's address from read_status's dashboard, passing brief: false. Ask your user to sign in there and use Upload a file.
A non-platform response leaves the start uncertain. A retry needs read_status to show that deployment did not start.
Details: read_documentation /cloud/getting-started/ways-to-deploy/.
More about this action #
The calls are stateless: each list call is whole, and no state but the kept files spans calls. A file call checks its file and keeps it under its SHA-256 in the application's deploy area, in the partition of the environment the deploy targets. A list naming a hash that partition lacks reads it from the application's other environment, where an earlier call kept it, and keeps it again in the target's. Where it passes sha256, content whose hash differs is refused deploy_files_hash_mismatch and nothing is kept. Line endings, a trailing newline, or a byte-order mark often make a hash differ, and the platform never changes a file's bytes. Where it passes none, the answer's kept gives the hash the platform computed. A path with a segment a deploy leaves out is refused before anything is kept.
An entry of files may carry the file's text as content, or its bytes in base64 with encoding base64, or the sha256 of a file an earlier call kept, or both.
Every entry carrying content is checked as a file call's file is, and each that passes is kept, though another is refused. The refusal gives the first refused path, kept each kept file's hash, earlier calls' files among them, and refused each refused file, with received_sha256 after a hash mismatch. After a hash or syntax refusal, fix it and send the list again, or that file first as file; an inline file over 512 KiB can use a stored entry instead. Such an entry whose path has a segment a deploy leaves out is refused, since its text was sent; an entry by sha256 alone is returned under left_out. A refusal after the keep, the total cap or the deploy's own, leaves the contents kept.
A list refused for missing stored files returns refused, each refused entry's path and error, with artifact_not_found for every stored file it could not find. kept gives the passing files' paths and hashes, stored files read among them. This also holds with check_only true. Read refused to ask the person for the missing uploads together, then resend kept files by their sha256.
The syntax check reads a .json file by a JSON parse, and a tsconfig or jsconfig file with comments and trailing commas allowed, as TypeScript reads it. It reads a JavaScript or TypeScript file by a parser chosen by its extension, so it refuses no file Node or TypeScript reads. A failure is refused deploy_files_syntax_error: its detail gives the path, line, column, and parser's reason as a fixed sentence or a Babel reason code, and no text of the file. Where the call sent the text, room allowing, it adds up to three unseen characters on that line, nearest first, such as U+2028, by code point and column, counting the rest. Every other file is kept unchecked. Text with U+FEFF, a byte-order mark, is kept too, and content_notice gives the first such file and line, since a tool's JSON encoding may have turned an escape into that character.
A serverless zip holds client/, functions/ or both, with manifest.json. It may also hold a root package.json, lib/ and migrations/. It needs no start script, server.js, PORT listener or health path. A function is a JavaScript module whose default export has fetch(request) returning a Response. Keep shared code and library copies under lib/; every file under functions/ counts as a function. The deploy start refuses function_native_module for a .node file under functions/ or lib/, and function_count_exceeded for too many files under functions/. These checks write no version row and start no build. They also run with check_only.
For a serverless function that only reads, request its file's path without the functions/ prefix or extension, on the deploy's hostname. For example, functions/api/notes.js serves /api/notes. Without a fetch tool, call request_route with the application, the deploy's environment and that path; follow skill:deploy:verify for sign-in and writes.
A list call refuses a path that is absolute or has a backslash, an empty, ., or .. segment, a path listed twice, and, for a server, a list with no package.json at the root. Where a file is missing, it first returns the refusals a deploy's start would make before it reads any zip, including deploys_per_day_exceeded, so you learn of them before you send a file. Where none is missing, the platform builds the turnzero command's own zip from the listed files, checks each entry again by its listed path, and, without check_only, starts the deploy: every refusal after that is the deploy's own, and the answer is the deploy's. A failed deploy can leave changes to data in place while the previous version keeps serving.
With check_only true, it builds the same zip and runs the start's checks: a refusal is returned as the deploy's, and otherwise the call returns 200 files_checked with the notices, left_out, warnings, filled, and kept, each file's path and hash. It keeps the files it was sent, so the deploying call gives each by that sha256, and starts nothing. The platform never reads your folder, so a file the list leaves out is not in the new version, even where an earlier version held it.
A library entry's copy you took is the one exception: where the root package.json declares @turnzero/<name> as a file: path in dependencies, the recorded manifest's packages lists the entry, and the list has no file under it, the platform fills it from the library. Where that row is at a version the library does not serve, or for an entry it does not serve, the call is refused library_entry_not_served. Where such a copy has no file the list gives at or under its path, and the platform does not fill it, the call is refused file_dependency_not_sent before any deploy starts. Any other file: dependency is neither filled nor refused.
Kept files a version's list named stay while that version serves or deploys in either environment until the environment that kept them is deleted; any other waits at least a day and at most two from its last keep. While the application's stored data is over, nothing is carried across. The next list call returns a file neither environment keeps as missing, and you send it again. The call mints no grant and returns none.
Choose the route with read_documentation, page /cloud/getting-started/ways-to-deploy/.
Follow the same route policy for later work, trying available in-tool routes before asking the person to run a command.
Pass the application. environment is optional: production with one environment, development with two, as check_deploy targets by default. A file call's kept gives the hash the platform computed, so no hash command runs in your shell. The list call's answer lists under missing each file the platform does not have, and under warnings the files whose names look like keys or credentials. It lists under left_out the files a deploy never includes: node_modules, .git, .env, every .env.*, and the AI coding tools' own files, such as .claude and .mcp.json. The list call without check_only that leaves nothing missing starts the deploy and replies as deploy does. Store secrets on the site's secrets page.
Inline files are limited to 512 KiB each. Stored entries have no per-file cap. Both count toward 200 entries and 4 MiB total; filled library files also count toward the total. A JSON, JavaScript, or TypeScript file that does not parse is refused. Send binary bytes as base64 with encoding base64, or use stored: { area, name }. The JSON body has a separate 4 MiB limit, refused request_too_large. Base64 adds about a third. To stay within the JSON limit, split inline files across file calls. Each inline file still has the 512 KiB limit.
Beyond the total or entry caps, use the command where it works, otherwise the ZIP upload route. Declare a storage area if needed, call mint_upload_grant, upload the ZIP, then call deploy with it as artifact. This ZIP route needs a shell; with no shell, ask the person to deploy from a computer with one.
The wait_seconds argument: On the call that starts the deploy, the seconds, 1 to 45, counted from the call's arrival, that the call waits for the version-history row it started; it replies when that row ends or the seconds pass. A value outside that range is refused invalid_request, and its detail gives 45 as the bound.
check_only true only checks the files, the library fill and the zip checks among its checks, and counts no deploy. A library copy you took and left out is filled where packages lists it. A file too large for one call goes first as file, and files lists it by its kept hash. The platform keeps each file under the SHA-256 of its bytes, decoded where they arrive as base64.
Access and action metadata #
{
"name": "deploy_files",
"resource": "environment",
"tier": "reversible",
"surface": "tzcloud",
"addresses": [
"tzcloud"
],
"product": "cloud",
"summary": "Deploy a small application through the signed-in connection with inline content or files stored in its storage areas. It takes no folder path or ZIP. Choose the route with read_documentation, page /cloud/getting-started/ways-to-deploy/.\n\nPass the application and environment as `deploy` takes them. Send `files` in one call, each with `path` and either `content` or `stored`, including root `package.json` for a server (a serverless application needs none); the platform hashes the bytes it receives, so no hash command runs in your shell. Where the files together are too large for one call, send some first as `file`, and list them in `files` by the `sha256` the answer's `kept` gives. The answer lists under `missing` each file the platform does not have, and under `warnings` the files whose names look like keys or credentials. It lists under `left_out` the files a deploy never includes: `node_modules`, `.git`, `.env`, every `.env.*`, and the AI coding tools' own files, such as `.claude` and `.mcp.json`. The list call that leaves nothing missing starts the deploy and replies as `deploy` does. `check_only` true only checks them. \n\nFor a binary file you cannot read, declare a storage area with `declare_storage_area` if the application has none. Get the page's address from `read_status`'s `dashboard`, passing `brief: false`. Ask your user to sign in there and use Upload a file, then use `{ path, stored: { area, name } }`. Send no file holding a secret value; store secrets on the site's secrets page.\n\nThe platform never reads your folder, so a file the list leaves out is not in the new version, even where an earlier version held it. A library entry's copy you took is the one exception: where your `package.json` declares it and the list leaves it out, the platform fills it from the library.\n\nInline files are limited to 512 KiB each. Stored entries have no per-file cap. Both count toward 200 entries and 4 MiB total; filled library files also count toward the total. A JSON, JavaScript, or TypeScript file that does not parse is refused. Send binary bytes as base64 with `encoding` `base64`, or use `stored: { area, name }`. The JSON body has a separate 4 MiB limit, refused `request_too_large`. Base64 adds about a third. To stay within the JSON limit, split inline files across `file` calls. Each inline file still has the 512 KiB limit.\n\nBeyond the total or entry caps, use the command if it works and you have a shell and the app's whole folder or the upload route if the command cannot work and you have a shell. Declare a storage area if needed, call `mint_upload_grant`, upload the ZIP, then call `deploy` with it as `artifact`. The ZIP route needs a shell; with no shell, ask the person to deploy from a computer with one.\n\nAn answer that is not this platform's own says nothing about whether the deploy started: read `read_status` with `wait_seconds` first, and call again only where it shows no start.",
"annotations": {
"readOnlyHint": false,
"destructiveHint": true,
"openWorldHint": true
}
}
MCP catalog entry #
{
"name": "deploy_files",
"title": "Deploy files",
"tier": "reversible",
"scenario": "CHI-L0-07",
"summary": "Deploy your inline or stored files. ZIPs use `deploy` and a folder uses `deploy_command`.\n\nNo folder path or ZIP is accepted. With a shell and the app's whole folder, use `deploy_command` where it works. With a shell, use the upload route beyond this tool's total or entry caps. Use `deploy_files` wherever the command cannot run, or for a disposable simple test app's first deploy.\n\nOne complete `files` call starts deployment. Your files must contain no secret values. Unreadable binary content needs an app storage area and a user upload. Get the page's address from `read_status`'s `dashboard`, passing `brief: false`. Ask your user to sign in there and use Upload a file.\n\nA non-platform response leaves the start uncertain. A retry needs `read_status` to show that deployment did not start.\n\nDetails: read_documentation /cloud/getting-started/ways-to-deploy/.",
"owners": [
"API-L0-25",
"MAPI-04",
"MAPI-26",
"OST-L0-01",
"OST-L0-03",
"OST-L0-05",
"PLD-L0-63",
"PLD-L0-86",
"PLD-L0-94",
"PLD-L0-96"
]
}
request #
| JSON pointer | Description and constraints |
|---|---|
| "" (root) | Type: object Required fields: ["application"] |
| / |
Your account's application id from list_applications, not its name or label.Type: string |
| / |
Default deploy target: production with one environment, development with two. Type: string Allowed values: ["development","production"] |
| / |
Complete version. A server needs root package.json; a serverless application does not. Omitted files are absent. Omitted library copies fill only from manifest packages, with [] filling none. The result lists missing. With none missing, it deploys, or checks with check_only.Type: array Maximum items: 200 |
| / |
Type: object Required fields: ["path"] Additional properties: false |
| / |
Relative app path, with / separators.Type: string Minimum length: 1 Maximum length: 1024 |
| / |
Text, or base64 bytes with encoding, at most 512 KiB.Type: string |
| / |
Hash of file bytes, checked with content or stored. Reuse needs path and sha256 from an answer's kept or list_versions' kept. Checks keep accepted content too. If missing lists the hash, resend with content.Type: string Pattern: ^[0-9a-f]{64}$ |
| / |
Type: string |
| / |
App storage file already uploaded before this call, copied byte-for-byte without the inline 512 KiB cap. Excludes content and encoding. Missing files give artifact_not_found in refused, including checks.Type: object Required fields: ["area","name"] Additional properties: false |
| / |
App storage area from list_storage_areas. If none exists, declare_storage_area creates one.Type: string Minimum length: 1 |
| / |
Filename shown on the app's page. Type: string Minimum length: 1 |
| / |
Keeps one file before a list call, for content too large for that call. Type: object Required fields: ["path","content"] Additional properties: false |
| / |
Relative app path, with / separators.Type: string Minimum length: 1 Maximum length: 1024 |
| / |
Text, or base64 bytes with encoding, at most 512 KiB.Type: string |
| / |
Hash of file bytes. A mismatch keeps nothing. Type: string Pattern: ^[0-9a-f]{64}$ |
| / |
Type: string |
| / |
True keeps accepted files and runs pre-deploy checks without starting or counting a deploy. It returns deploy refusals, or files_checked with deploy notes. If a stored file is missing, the refusal lists passing paths and hashes under kept.Type: boolean |
| / |
On a starting call, seconds to wait for its end. Unfinished deploys give read_status in next.Type: integer Minimum: 1 Maximum: 45 |
response #
| JSON pointer | Description and constraints |
|---|---|
| "" (root) | 200 with file_kept, awaiting_files, or files_checked where the call started nothing; where a list call without check_only leaves nothing missing, the deploy's own answer, 202 at once with deploying, or 200 where wait_seconds saw it end. No call mints or returns a grant.Type: object Required fields: ["contract_version","application","environment","state"] |
| / |
Required value: 1 |
| / |
The short reference the platform recorded your call under: ten lowercase hexadecimal characters, the value in the call’s record row. Quote it when you report the call. Type: string Pattern: ^[0-9a-f]{10}$ |
| / |
On a call that started the deploy, the deploy's own summary without its invitation warning. The warning stays on completed detail and is not repeated here.Type: string |
| / |
Type: string |
| / |
Type: string |
| / |
The version number the deploy started: returned with deploying, deployed, and failed.Type: integer |
| / |
file_kept on a call carrying file alone, awaiting_files on a list call while a file is missing, and files_checked on a check_only list call that nothing refused, each 200. Otherwise the deploy's own state: deploying on the 202 answer, and deployed or failed where wait_seconds saw the deploy end.Type: string Pattern: ^(file_kept|awaiting_files|files_checked|deploying|deployed|failed)$ |
| / |
The hostname of the environment the deploy goes to, where the call started it. Type: string |
| / |
The recorded manifest's health path the deploy's gate will probe, cut at 256 characters, where the call started it. Type: string |
| / |
Present where the call started the deploy and carried wait_seconds, as deploy returns it.Type: boolean |
| / |
Present where the call started the deploy and carried wait_seconds.Type: integer Minimum: 0 |
| / |
Present where the wait settled: the row's outcome as list_versions returns it.Type: object |
| / |
Present where the wait saw the row end deployed: the router's 5xx responses since the version began serving, as check_deploy's last_release counts them. count runs from since, the later of the row's end and seven days before the read. It is capped at 500, and capped is true where the cap was met, the count then a floor. It covers only the routes requested in that time, so a route nobody requested counts nothing. A route listed in the manifest's smoke_paths is checked before each deploy and promote switches, and that check is not in this count. Where the read failed, unread carries its reason. Absent on every other response. |
| / |
Type: object Required fields: ["count","since","capped"] |
| / |
Type: integer Minimum: 0 Maximum: 500 |
| / |
Type: string |
| / |
Type: boolean |
| / |
Type: object Required fields: ["unread"] Additional properties: false |
| / |
Why the count was not read: failed, timed_out, or read_status's own word for its server_errors member, such as unavailable.Type: string |
| / |
With file_kept, or awaiting_files on a call carrying file: the file this call kept, its path and the SHA-256 the platform computed of its content. With files_checked: each listed file, in the list's order, its path and the SHA-256 it is kept under, as a refusal's kept lists them; a library copy the platform filled is under filled. A later list call gives each by that sha256. |
| / |
Type: object Required fields: ["path","sha256"] Additional properties: false |
| / |
Type: string |
| / |
Type: string Pattern: ^[0-9a-f]{64}$ |
| / |
Type: array |
| / |
Type: object Required fields: ["path","sha256"] Additional properties: false |
| / |
Type: string |
| / |
Type: string Pattern: ^[0-9a-f]{64}$ |
| / |
With awaiting_files: each listed file the platform does not hold, to send as file.Type: array |
| / |
Type: object Required fields: ["path","sha256"] Additional properties: false |
| / |
Type: string |
| / |
Type: string Pattern: ^[0-9a-f]{64}$ |
| / |
On a list call: the listed paths a deploy never carries (node_modules, .git, .env, every .env.*, and the AI coding tools' own files, such as .claude and .mcp.json), never asked for. A file the list does not name is not listed here; it is not in the version, unless it is a library copy the platform fills, which filled lists. A @turnzero/<name> copy that package.json declares as a file: dependency, neither listed nor filled, is refused file_dependency_not_sent before any deploy starts.Type: array |
| / |
Type: string |
| / |
On a list call: the listed paths whose names look like keys or credentials; send one only where it holds no secret value. Type: array |
| / |
Type: string |
| / |
Where the call started the deploy, or with files_checked would start it: each library copy the project took and the list left out, which the platform filled from the library. Each is given by the entry's name, the version the library serves, and the copy's path. Absent where none was filled.Type: array |
| / |
Type: object Required fields: ["name","version","path"] Additional properties: false |
| / |
Type: string |
| / |
Type: ["string","null"] |
| / |
Type: string |
| / |
On a list call with an accepted stored file: each stored entry, in the list's order, by its path, area, and name, with the size and SHA-256 of the bytes the platform copied. A later list call may give each by that sha256. Absent when the list contains no stored entries.Type: array |
| / |
Type: object Required fields: ["path","area","name","size","sha256"] Additional properties: false |
| / |
Type: string |
| / |
Type: string |
| / |
Type: string |
| / |
Type: integer Minimum: 0 |
| / |
Type: string Pattern: ^[0-9a-f]{64}$ |
| / |
Where the call started the deploy: the exact read_status call that reads it to its end.Type: object Required fields: ["action","arguments"] Additional properties: false |
| / |
Required value: read_status |
| / |
Type: object Required fields: ["application","environment","wait_seconds"] Additional properties: false |
| / |
Type: string |
| / |
Type: string Pattern: ^(development|production)$ |
| / |
Type: integer Minimum: 1 Maximum: 45 |
| / |
With file_kept, awaiting_files, and files_checked, what to send next, the awaiting_files one with the common causes of a hash that misses; where the call started the deploy, the deploy's own detail. The awaiting_files and files_checked ones also say manifest.json needs no application id, since the call gives the application. The file_kept and awaiting_files ones ask for every file the deploy includes, the folder's package-lock.json among them where it has one, since the deploy installs from it.If a completed deployment ran no health check or smoke check, the detail says so. Request the pages or routes yourself and read read_logs for errors. Behind sign-in, use request_route with test_end_user and environment.Where this call's production deploy ended deployed and still serves, the detail may close with an invitation warning. This applies to an invited audience whose production realm is absent, or holds no end user other than test end users and no standing invitation. The warning says no invited user can sign in to production yet and tells the caller to use invite_end_user. It is added last, only if the whole detail fits its budget. A failed realm read adds no warning.Type: string |
| / |
present where the zip's manifest.json, less its application member, differs or does not parse, or a lib/ copy is unread, uncompared, or unpaired. Type: string |
| / |
present where the build will not run an install script or rebuild a binding.gyp of the root or a workspace member, listing each and each member package.json left unread. If the root package.json declares something to install and no root lockfile was sent, the notice first recommends exact versions for direct dependencies to a tool without a shell, then explains uploading an available lockfile. It omits that warning when the root installs only local Turn Zero library copies and each copy’s package.json declares nothing to install. Type: string |
| / |
present where the zip's client/ folder holds a file beyond the shell or a name the publish skips: counts the files the router serves at their own paths, listing twenty beyond the shell and twenty skipped, then counting the rest. Type: string |
| / |
present where the target environment declares or holds a database and the deploy serves APP_DATABASE_URL on the pooler's port. The fixed notice describes transaction pooling's limits and APP_DATABASE_DIRECT_URL for work requiring one held server connection. It rides an at-once answer and a held answer, and deploy_files with check_only, but no preparing answer. It refuses nothing. Type: string |
| / |
present while the application's usage state is over, absent otherwise, as deploy returns it.Type: string |
| / |
Present when sent text holds U+FEFF, which JSON may have decoded from an escape. It gives the first file and line, distinguishes a leading mark from an embedded character, and counts other affected files. It shows how to keep a literal escape in JSON. It refuses nothing. Type: string |
Complete payload contract #
{
"request": {
"type": "object",
"required": [
"application"
],
"properties": {
"application": {
"type": "string",
"description": "Your account's application `id` from `list_applications`, not its name or label."
},
"environment": {
"type": "string",
"enum": [
"development",
"production"
],
"description": "Default deploy target: production with one environment, development with two."
},
"files": {
"type": "array",
"maxItems": 200,
"items": {
"type": "object",
"required": [
"path"
],
"properties": {
"path": {
"type": "string",
"minLength": 1,
"maxLength": 1024,
"description": "Relative app path, with `/` separators."
},
"content": {
"type": "string",
"description": "Text, or base64 bytes with `encoding`, at most 512 KiB."
},
"sha256": {
"type": "string",
"pattern": "^[0-9a-f]{64}$",
"description": "Hash of file bytes, checked with `content` or `stored`. Reuse needs `path` and `sha256` from an answer's `kept` or `list_versions`' `kept`. Checks keep accepted content too. If `missing` lists the hash, resend with `content`."
},
"encoding": {
"type": "string"
},
"stored": {
"type": "object",
"required": [
"area",
"name"
],
"properties": {
"area": {
"type": "string",
"minLength": 1,
"description": "App storage area from `list_storage_areas`. If none exists, `declare_storage_area` creates one."
},
"name": {
"type": "string",
"minLength": 1,
"description": "Filename shown on the app's page."
}
},
"additionalProperties": false,
"description": "App storage file already uploaded before this call, copied byte-for-byte without the inline 512 KiB cap. Excludes `content` and `encoding`. Missing files give `artifact_not_found` in `refused`, including checks."
}
},
"additionalProperties": false
},
"description": "Complete version. A server needs root `package.json`; a serverless application does not. Omitted files are absent. Omitted library copies fill only from manifest `packages`, with `[]` filling none. The result lists `missing`. With none missing, it deploys, or checks with `check_only`."
},
"file": {
"type": "object",
"required": [
"path",
"content"
],
"properties": {
"path": {
"type": "string",
"minLength": 1,
"maxLength": 1024,
"description": "Relative app path, with `/` separators."
},
"content": {
"type": "string",
"description": "Text, or base64 bytes with `encoding`, at most 512 KiB."
},
"sha256": {
"type": "string",
"pattern": "^[0-9a-f]{64}$",
"description": "Hash of file bytes. A mismatch keeps nothing."
},
"encoding": {
"type": "string"
}
},
"additionalProperties": false,
"description": "Keeps one file before a list call, for content too large for that call."
},
"check_only": {
"type": "boolean",
"description": "True keeps accepted files and runs pre-deploy checks without starting or counting a deploy. It returns deploy refusals, or `files_checked` with deploy notes. If a stored file is missing, the refusal lists passing paths and hashes under `kept`."
},
"wait_seconds": {
"type": "integer",
"minimum": 1,
"maximum": 45,
"description": "On a starting call, seconds to wait for its end. Unfinished deploys give `read_status` in `next`."
}
}
},
"response": {
"type": "object",
"required": [
"contract_version",
"application",
"environment",
"state"
],
"properties": {
"contract_version": {
"const": 1
},
"reference": {
"type": "string",
"pattern": "^[0-9a-f]{10}$",
"description": "The short reference the platform recorded your call under: ten lowercase hexadecimal characters, the value in the call’s record row. Quote it when you report the call."
},
"summary": {
"type": "string",
"description": "On a call that started the deploy, the deploy's own summary without its invitation warning (PLD-L0-63). The warning stays on completed `detail` and is not repeated here."
},
"application": {
"type": "string"
},
"environment": {
"type": "string"
},
"version": {
"type": "integer",
"description": "The version number the deploy started: returned with `deploying`, `deployed`, and `failed`."
},
"state": {
"type": "string",
"pattern": "^(file_kept|awaiting_files|files_checked|deploying|deployed|failed)$",
"description": "`file_kept` on a call carrying `file` alone, `awaiting_files` on a list call while a file is missing, and `files_checked` on a `check_only` list call that nothing refused, each 200. Otherwise the deploy's own state: `deploying` on the 202 answer, and `deployed` or `failed` where `wait_seconds` saw the deploy end."
},
"hostname": {
"type": "string",
"description": "The hostname of the environment the deploy goes to, where the call started it."
},
"health_path": {
"type": "string",
"description": "The recorded manifest's health path the deploy's gate will probe, cut at 256 characters, where the call started it."
},
"settled": {
"type": "boolean",
"description": "Present where the call started the deploy and carried `wait_seconds`, as `deploy` returns it."
},
"waited_ms": {
"type": "integer",
"minimum": 0,
"description": "Present where the call started the deploy and carried `wait_seconds`."
},
"outcome": {
"type": "object",
"description": "Present where the wait settled: the row's `outcome` as `list_versions` returns it."
},
"server_errors_since": {
"oneOf": [
{
"type": "object",
"required": [
"count",
"since",
"capped"
],
"properties": {
"count": {
"type": "integer",
"minimum": 0,
"maximum": 500
},
"since": {
"type": "string"
},
"capped": {
"type": "boolean"
}
}
},
{
"type": "object",
"required": [
"unread"
],
"properties": {
"unread": {
"type": "string",
"description": "Why the count was not read: `failed`, `timed_out`, or `read_status`'s own word for its `server_errors` member, such as `unavailable`."
}
},
"additionalProperties": false
}
],
"description": "Present where the wait saw the row end `deployed`: the router's 5xx responses since the version began serving, as `check_deploy`'s `last_release` counts them. `count` runs from `since`, the later of the row's end and seven days before the read. It is capped at 500, and `capped` is true where the cap was met, the count then a floor. It covers only the routes requested in that time, so a route nobody requested counts nothing. A route listed in the manifest's `smoke_paths` is checked before each deploy and promote switches, and that check is not in this count. Where the read failed, `unread` carries its reason. Absent on every other response."
},
"kept": {
"oneOf": [
{
"type": "object",
"required": [
"path",
"sha256"
],
"properties": {
"path": {
"type": "string"
},
"sha256": {
"type": "string",
"pattern": "^[0-9a-f]{64}$"
}
},
"additionalProperties": false
},
{
"type": "array",
"items": {
"type": "object",
"required": [
"path",
"sha256"
],
"properties": {
"path": {
"type": "string"
},
"sha256": {
"type": "string",
"pattern": "^[0-9a-f]{64}$"
}
},
"additionalProperties": false
}
}
],
"description": "With `file_kept`, or `awaiting_files` on a call carrying `file`: the file this call kept, its path and the SHA-256 the platform computed of its content. With `files_checked`: each listed file, in the list's order, its path and the SHA-256 it is kept under, as a refusal's `kept` lists them; a library copy the platform filled is under `filled`. A later list call gives each by that `sha256`."
},
"missing": {
"type": "array",
"items": {
"type": "object",
"required": [
"path",
"sha256"
],
"properties": {
"path": {
"type": "string"
},
"sha256": {
"type": "string",
"pattern": "^[0-9a-f]{64}$"
}
},
"additionalProperties": false
},
"description": "With `awaiting_files`: each listed file the platform does not hold, to send as `file`."
},
"left_out": {
"type": "array",
"items": {
"type": "string"
},
"description": "On a list call: the listed paths a deploy never carries (`node_modules`, `.git`, `.env`, every `.env.*`, and the AI coding tools' own files, such as `.claude` and `.mcp.json`), never asked for. A file the list does not name is not listed here; it is not in the version, unless it is a library copy the platform fills, which `filled` lists. A `@turnzero/<name>` copy that `package.json` declares as a `file:` dependency, neither listed nor filled, is refused `file_dependency_not_sent` before any deploy starts."
},
"warnings": {
"type": "array",
"items": {
"type": "string"
},
"description": "On a list call: the listed paths whose names look like keys or credentials; send one only where it holds no secret value."
},
"filled": {
"type": "array",
"items": {
"type": "object",
"required": [
"name",
"version",
"path"
],
"properties": {
"name": {
"type": "string"
},
"version": {
"type": [
"string",
"null"
]
},
"path": {
"type": "string"
}
},
"additionalProperties": false
},
"description": "Where the call started the deploy, or with `files_checked` would start it: each library copy the project took and the list left out, which the platform filled from the library. Each is given by the entry's name, the version the library serves, and the copy's path. Absent where none was filled."
},
"stored": {
"type": "array",
"items": {
"type": "object",
"required": [
"path",
"area",
"name",
"size",
"sha256"
],
"properties": {
"path": {
"type": "string"
},
"area": {
"type": "string"
},
"name": {
"type": "string"
},
"size": {
"type": "integer",
"minimum": 0
},
"sha256": {
"type": "string",
"pattern": "^[0-9a-f]{64}$"
}
},
"additionalProperties": false
},
"description": "On a list call with an accepted stored file: each stored entry, in the list's order, by its path, area, and name, with the size and SHA-256 of the bytes the platform copied. A later list call may give each by that `sha256`. Absent when the list contains no stored entries."
},
"next": {
"type": "object",
"required": [
"action",
"arguments"
],
"properties": {
"action": {
"const": "read_status"
},
"arguments": {
"type": "object",
"required": [
"application",
"environment",
"wait_seconds"
],
"properties": {
"application": {
"type": "string"
},
"environment": {
"type": "string",
"pattern": "^(development|production)$"
},
"wait_seconds": {
"type": "integer",
"minimum": 1,
"maximum": 45
}
},
"additionalProperties": false
}
},
"additionalProperties": false,
"description": "Where the call started the deploy: the exact `read_status` call that reads it to its end."
},
"detail": {
"type": "string",
"description": "With `file_kept`, `awaiting_files`, and `files_checked`, what to send next, the `awaiting_files` one with the common causes of a hash that misses; where the call started the deploy, the deploy's own detail. The `awaiting_files` and `files_checked` ones also say manifest.json needs no application id, since the call gives the application. The `file_kept` and `awaiting_files` ones ask for every file the deploy includes, the folder's package-lock.json among them where it has one, since the deploy installs from it.\n\nIf a completed deployment ran no health check or smoke check, the detail says so. Request the pages or routes yourself and read `read_logs` for errors. Behind sign-in, use `request_route` with `test_end_user` and `environment`.\n\nWhere this call's production deploy ended `deployed` and still serves, the detail may close with an invitation warning. This applies to an `invited` audience whose production realm is absent, or holds no end user other than test end users and no standing invitation. The warning says no invited user can sign in to production yet and tells the caller to use `invite_end_user`. It is added last, only if the whole detail fits its budget. A failed realm read adds no warning."
},
"manifest_notice": {
"type": "string",
"description": "present where the zip's manifest.json, less its application member, differs or does not parse, or a lib/ copy is unread, uncompared, or unpaired (PLD-L0-63)."
},
"artifact_notice": {
"type": "string",
"description": "present where the build will not run an install script or rebuild a binding.gyp of the root or a workspace member, listing each and each member package.json left unread (PLD-L0-60). If the root package.json declares something to install and no root lockfile was sent, the notice first recommends exact versions for direct dependencies to a tool without a shell, then explains uploading an available lockfile. It omits that warning when the root installs only local Turn Zero library copies and each copy’s package.json declares nothing to install."
},
"client_notice": {
"type": "string",
"description": "present where the zip's client/ folder holds a file beyond the shell or a name the publish skips: counts the files the router serves at their own paths, listing twenty beyond the shell and twenty skipped, then counting the rest (SVC-L0-26)."
},
"database_notice": {
"type": "string",
"description": "present where the target environment declares or holds a database and the deploy serves APP_DATABASE_URL on the pooler's port (PLD-L0-63; DBS-L0-02). The fixed notice describes transaction pooling's limits and APP_DATABASE_DIRECT_URL for work requiring one held server connection. It rides an at-once answer and a held answer, and deploy_files with check_only, but no preparing answer. It refuses nothing."
},
"usage_notice": {
"type": "string",
"description": "present while the application's usage state is over, absent otherwise, as `deploy` returns it (ACB-L0-26)."
},
"content_notice": {
"type": "string",
"description": "Present when sent text holds U+FEFF, which JSON may have decoded from an escape. It gives the first file and line, distinguishes a leading mark from an embedded character, and counts other affected files. It shows how to keep a literal escape in JSON. It refuses nothing (MAPI-26)."
}
},
"description": "200 with `file_kept`, `awaiting_files`, or `files_checked` where the call started nothing; where a list call without `check_only` leaves nothing missing, the deploy's own answer, 202 at once with `deploying`, or 200 where `wait_seconds` saw it end. No call mints or returns a grant."
}
}
Shared contracts #
- Refusals: every refusal, by surface, with its cause and its remedy
- schemas/wire_error.schema.json
- schemas/wire_errors.json
- schemas/action_payloads.json (includes shared shapes)
- management_api_contract.md