Create an app from its files, or change one.
A change takes `app_id` and `base_version` (the version `get_app_context` or the last `publish` returned) and only the files and assets that changed. To change part of a file, send `edits` instead of the file: `"edits": [{"path": "index.html", "find": "old text", "replace": "new text"}]`. `find` must occur once, unless `count` says how many times, and a miss refuses the publish and says what it found. Without `base_version` a publish replaces every file. A stale base is refused, so someone else's change is reloaded rather than overwritten. An app is named by an `app_id` from a reply or `list_apps`, never found by name.
A create omits `app_id` and takes `intent`. Files are a single client-side page: `index.html` plus css/js, plain text, no build step, no server. Files with SKILL.md at the root and no index.html publish a skill, in one call with all its files. A picture, font or sound is an asset: listed in `assets` with its sha256 and byte count, and the reply says where to PUT its bytes before publishing again. Changes start from the files `get_app_context` returned, not the HTML at the app URL. Files carry literal angle brackets.
Every call takes `work_context` (goal, current_state, decisions, open_work, verification, known_issues; no credentials, transcripts, or stored records) and `summary` (one line of 200 characters or fewer, in the person's words).
An app that stores data uses `window.cloche` and declares collections in `schema`. `get_deploy_instructions` returns the runtime API, the purpose-built AI surface and the authoring rules, and the icon rule for a create's `icon`.
A local folder with server code (Flask, Express, SQLite, login routes, database URLs) is rewritten into this shape before publishing. Its server is neither uploaded nor run, its credentials are dropped, and no auth is invented: `window.cloche` and `schema` replace them. A rewrite of any existing tool, including a browser localStorage app, keeps every persisted entity and field from the source store, including optional fields and nested groups such as folders, as schema collections and fields, and adds no feature the source lacked.
Data from another service is never rows in files or `work_context`. `request_source_data` asks the person to pick it, and `get_app_status` returns the collections and fields they chose. Those collections are shared in `schema`, and the app reads them through `window.cloche.data` like stored ones. A company database is asked for the same way: `source` is its address from `get_deploy_instructions` and `database` names the table, columns, filters and changes, never SQL.
The result's `bundle_bytes` is what the app's files now total, for checking the change. An app far smaller than before was sent truncated, not edited. `get_app_context` with `version` returns a past version. Its files published against the live `base_version` put a damaged live version back.
The result says what looks like personal data in the version and where, when the organization checks for it.
Files are live only when this call returns `ready`.