Project Files
A code automation project is a folder. You deploy it with type-cli automations deploy.
Directorymy-automation/
- type.json the project settings
- fixtures.json optional test cases
Directorysrc/
- main.ts the entrypoint
- format.ts other modules
Directory.type/ made by the CLI; never uploaded
- project.json
- deployment.json
type.json
Section titled “type.json”{ "name": "Hourly check", "description": "Record the scheduled time in run history", "entrypoint": "src/main.ts"}| Field | Required | Default | Rules |
|---|---|---|---|
name | Yes | — | 1 to 200 characters. Must be unique in the Space. |
description | No | — | At most 2,000 characters. |
entrypoint | No | src/main.ts | The file that default-exports automation({ deployment, output, stages }). Ends in .ts, .js, .mts, or .mjs. 1 to 255 characters. |
expiration | No | The source value | An expiration that replaces deployment.expiration in the source. null removes the expiration. |
integrationAccounts | No | — | At most 50 { "organizationIntegrationId", "integrationAccountId" } pairs. Each pair picks the saved account that the automation uses for that connection. |
type.json must be a regular file of at most 64 KiB. Type rejects unknown fields.
An expiration flag on type-cli automations deploy replaces both type.json and the source for that deploy. See CLI Reference.
Which files Type uploads
Section titled “Which files Type uploads”The CLI reads the folder and uploads only source files.
| Rule | Detail |
|---|---|
| File types | Only names that end in .ts, .js, .mts, .mjs, or .json. The CLI skips other files, for example .md, .tsx, and .yaml. |
| Hidden files | Files and folders whose names start with . are skipped, for example .env and .type/. |
| Symbolic links | Skipped. |
| Ignore files | The CLI follows .gitignore and .typeignore in each folder. Their rules apply to that folder and the folders inside it. A ! rule includes a file again. |
| Folders | node_modules, dist, build, coverage, generated, and vendor are skipped at all levels. |
| Config and secrets | type.json, package.json, tsconfig.json, credential.json, credentials.json, secret.json, secrets.json, and service-account.json are skipped. So are the same names with more text after a . or -, for example package-lock.json, tsconfig.build.json, or secrets-prod.json. The match is not case-sensitive. |
| Tests | Names that end in .test.<ext>, .spec.<ext>, .generated.<ext>, or .d.ts are skipped, for example format.test.ts. |
Root fixtures.json | Read as test cases, not uploaded as code. A fixtures.json in a subfolder is uploaded as a normal module. |
Size limits
Section titled “Size limits”- At most 256 files.
- At most 1 MiB for all files together, including
fixtures.json. - The source files, as JSON, must also fit in 1 MiB.
- Each file path is 1 to 255 characters. Paths must be relative, with no
.or..parts, backslashes, or control characters. - These paths are reserved:
node_modules,.type-installed, and.type-contract. - Each
.gitignoreand.typeignoreis at most 64 KiB.
Dependencies
Section titled “Dependencies”Type does not install packages. A package.json file is not uploaded. Your code can import only the allowed modules and relative files in the project.
fixtures.json
Section titled “fixtures.json”An optional array of test cases. Type runs them during each deploy. If one fails, the deploy fails. See Test with Fixtures.
This fixture tests the entrypoint below:
[ { "name": "records the scheduled time", "subscriptionId": "hourly", "payload": { "scheduledAt": "2026-10-07T12:00:00.000Z" }, "toolResponses": [], "expectedOutput": { "checkedAt": "2026-10-07T12:00:00.000Z" } }]import { automation, code, complete, recurringEventSchema,} from "@type-dot-com/sdk/automations";import { z } from "zod";
export default automation({ output: z.object({ checkedAt: z.string() }), deployment: { subscriptions: { hourly: { title: "Hourly check", description: "Record the scheduled time in run history", source: { kind: "recurring", schedule: { kind: "interval", everySeconds: 3600 }, }, entry: "record", }, }, }, stages: { record: code({ input: recurringEventSchema, run: ({ input }) => complete({ checkedAt: input.scheduledAt }), }), },});| Field | Required | Rules |
|---|---|---|
name | Yes | 1 to 120 characters. Unique in the file. |
subscriptionId | Yes | The subscription key to run. |
payload | Yes | The event, in the same shape as a live event. For debounce.delivery: "batch", an array of events. |
checkpoint | No | The value of ctx.checkpoint.value for this case. Without it, ctx.checkpoint is null. |
environment | No | Test values for environment variables, as strings. Fixtures never read the Space’s saved values. |
matcher | No | Simulated matcher results: { decision?: "match" | "skip", ownSlackUserId?, jev?: { model, answers } }. See Test matchers. |
toolResponses | No | At most 128 { request, response } pairs for ctx.tools.call, ctx.read.call, and ctx.write.call. |
integrationResponses | No | At most 128 { request, response } pairs for ctx.read.request and ctx.write.request. |
expectedOutput | No | The exact JSON value that the entry stage passes to complete() or blocked(). |
expectedError | No | Text that the error message must contain. 1 to 2,000 characters. |
- A file can have at most 20 cases.
- Do not set both
expectedOutputandexpectedErrorin one case. - A case runs only the subscription’s entry stage. It does not follow
next()to other stages, and it does not start agent stages. - Omit both
expectedOutputandexpectedErrorfor an event that a matcher or a resource filter skips. Such a case must not havetoolResponsesorintegrationResponses.
.type/project.json
Section titled “.type/project.json”{ "projectId": "0b5a8f2e-7c1d-4e3f-9a6b-2c4d6e8f0a1b" }The CLI makes this file at the first deploy, before it sends anything. Type uses the project ID and the Space to find the automation.
- Keep this file, and commit it to version control.
- If you delete it, the next deploy makes a new automation.
- If you copy the folder, also make a new project ID, or the two folders update the same automation.
.type/deployment.json
Section titled “.type/deployment.json”The CLI writes this file at each deploy. It records the last attempt:
{ "projectId": "0b5a8f2e-...", "deploymentId": "3f6c2a4e-...", "automationId": "atask_01k...", "serverUrl": "https://api.type.com", "space": "engineering"}The CLI saves deploymentId before it sends the project, and adds automationId, serverUrl, and space when Type answers. Use deploymentId with type-cli automations deployment to read the result of an interrupted deploy. The CLI does not read this file to continue a deploy.