# Workspace layout (`.fetchcatch/`)

The `.fetchcatch/` directory is the sync root for a FetchCatch workspace. Commit it to version control.

## Directory tree

```
.fetchcatch/
├── AGENTS.md              # AI agent guide (created by fcc init)
├── project.json           # Workspace + API config
├── sync-state.json        # Sync metadata (hashes, revision)
├── flows/
│   └── {slug}.json        # One file per flow
├── response-types/
│   └── {slug}.json        # One file per response type
└── generated/             # Reserved for future CLI output
```

## `project.json`

```json
{
  "schemaVersion": 1,
  "apiBaseUrl": "https://api.fetchcatch.com",
  "tenantSlug": "my-tenant",
  "tenantId": "00000000-0000-0000-0000-000000000001",
  "workspaceSlug": "my-project",
  "workspaceId": "00000000-0000-0000-0000-000000000002"
}
```

| Field | Set by | Description |
|-------|--------|-------------|
| `schemaVersion` | CLI | Config format version (currently `1`) |
| `apiBaseUrl` | `fcc init` | API base URL |
| `workspaceSlug` | `fcc init` | Normalized workspace slug |
| `tenantSlug`, `tenantId`, `workspaceId` | `fcc login` | Filled after authentication |

## `sync-state.json`

Managed by `fcc pull` and `fcc apply`. Tracks:

- `remoteRevision` — server manifest revision
- `lastPulledUtc`, `lastAppliedUtc`
- `resources` — per-file remote/local content hashes

**Do not hand-edit** unless you understand hash-based conflict detection.

## Resource paths

| Type | Path pattern | Sync type string |
|------|--------------|------------------|
| Flow | `flows/{slug}.json` | `flow` |
| Response type | `response-types/{slug}.json` | `response-type` |

Slugs are lowercase kebab-case. File name must match the `slug` field inside the JSON.

To remove a flow from git, delete `flows/{slug}.json` and run `fcc apply` (or delete in the
console and run `fcc pull` to drop the local file).

## What to commit

| Commit | Ignore |
|--------|--------|
| `project.json`, `flows/`, `response-types/`, `AGENTS.md` | `~/.fetchcatch/` credentials |
| `sync-state.json` (recommended) | secrets, `.env` |

## `AGENTS.md`

Auto-generated on `fcc init`. Points AI coding agents to public documentation and safe edit rules. Safe to customize; re-created only if missing on a fresh init layout.
