{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"$schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"URL of this JSON Schema; lets editors validate the file."},"scripts":{"anyOf":[{"$ref":"#/$defs/EnvironmentScripts"},{"type":"null"}]},"env":{"anyOf":[{"type":"object","additionalProperties":{"type":"string"}},{"type":"null"}],"description":"Non-secret environment variables, available to every phase."}},"additionalProperties":false,"title":"The Company Company environment configuration","description":"Schema for `.company/environment.json`: how The Company Company builds and runs this repository in the cloud.","$defs":{"EnvironmentScript":{"type":"object","properties":{"command":{"type":"string","allOf":[{"minLength":1,"description":"Shell command to run for this phase."}]},"timeout":{"anyOf":[{"type":"integer","allOf":[{"exclusiveMinimum":0}]},{"type":"null"}],"description":"Maximum seconds the command may run before it is stopped. The platform applies a default when omitted."}},"required":["command"],"additionalProperties":false,"title":"Environment script","description":"A shell command run during one phase of the environment lifecycle."},"EnvironmentScripts":{"type":"object","properties":{"install":{"anyOf":[{"$ref":"#/$defs/EnvironmentScript"},{"type":"null"}],"description":"Runs once while building the cached snapshot: install system packages, runtimes, and dependencies. Internet is available; its output must contain no secrets."},"prepare":{"anyOf":[{"$ref":"#/$defs/EnvironmentScript"},{"type":"null"}],"description":"Runs on every task after the branch is checked out: reconcile the environment with the current commit (install new dependencies, run migrations, regenerate codegen). Keep it fast and idempotent."},"worktree":{"anyOf":[{"$ref":"#/$defs/EnvironmentScript"},{"type":"null"}],"description":"Deprecated and ignored: the agent installs dependencies in each worktree itself. Accepted so existing files keep decoding; remove it."},"start":{"anyOf":[{"$ref":"#/$defs/EnvironmentScript"},{"type":"null"}],"description":"Runs on every task after prepare: start the long-running services the agent needs (dev server, database, queue worker). Launched in the background and kept running for the task; it is never awaited, so `timeout` does not apply."}},"additionalProperties":false,"title":"Environment scripts","description":"Lifecycle scripts that build the environment once and ready it for each task."}}}