deploy/v1

A project's code on an app: its pb_* folders except pb_data (pb_hooks, pb_migrations, pb_pages, pb_public, pb_templates) and packages (package.json, the lockfile, node_modules). Clients send only the files the app lacks, then swap the new set in at once. Restart and logs are remote/v1's, which it requires.

A routed contract (deploy.go): its provider is an http.Handler serving the file API below. A multisite host can provide it for its instances.

Use

HTTP What it does
POST /api/_c/deploy/v1/check which files the app lacks (JSON)
POST /api/_c/deploy/v1/blobs upload them (gzip bytes)
POST /api/_c/deploy/v1/commit swap the new code set in (JSON)
GET /api/_c/deploy/v1/files list deployed files
DELETE /api/_c/deploy/v1/files delete files
GET / PUT /api/_c/deploy/v1/files/raw read or write one file (raw bytes)
POST /api/_c/deploy/v1/files/bundle read many files at once ({"paths"} → a gzipped bundle, the upload's format)
GET /api/_c/deploy/v1/tree the app's code tree, for two-way sync (deep=1: every folder in one answer)

Token scopes: deploy (everything) and deploy:read (list, read, tree). The CLI: pocketone deploy, dev, pull.

Provide

Provide an http.Handler that serves the API under deployv1.Prefix:

deployv1.Contract.ProvideDefault(app, handler)

A host provides it for its instances with deployv1.Contract.ProvideForInstances(host, factory) and extkit.HostRoutes(host, deployv1.Contract, multisite.InstanceID, next) in its instance routes (multisite.Host.InstanceRoutes, after the gates).

Commands and APIs

Its own HTTP API under /api/_c/deploy/v1/, described above. It has no generated commands or MCP tools. Remote CLI explains how PocketOne apps are managed from afar.

Extensions

Extension
deploy provides (default)

License

MIT