You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat: add bootstrap state sync for template pushes
Refresh state and credential mappings without materializing remote org resources, and have push auto-bootstrap when local state is stale or incomplete. Also fix the existing TypeScript build issues needed to keep the repo verifiable.
Copy file name to clipboardExpand all lines: AGENTS.md
+18-15Lines changed: 18 additions & 15 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -8,25 +8,27 @@ This project manages **Vapi voice agent configurations** as code. All resources
8
8
9
9
**Environment-scoped resources:** Resources live in `resources/<env>/` (e.g. `resources/dev/`, `resources/prod/`). Each environment directory is isolated — `push:dev` only touches `resources/dev/`, `push:prod` only touches `resources/prod/`. See **`docs/environment-scoped-resources.md`** for the full promotion workflow and rationale.
10
10
11
+
**Template-safe first run:** In a fresh clone, prefer `npm run pull:dev:bootstrap` (or the matching env) to refresh `.vapi-state.<env>.json` and credential mappings without materializing the target org's resources into `resources/<env>/`. `push:<env>` will auto-run the same bootstrap sync when it detects empty or stale state for the resources being applied.
Copy file name to clipboardExpand all lines: README.md
+45-27Lines changed: 45 additions & 27 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -39,7 +39,7 @@ Manage Vapi resources via Git using YAML/Markdown as the source-of-truth.
39
39
40
40
## How to Use This Repo
41
41
42
-
1.**Sync from Vapi first** using `pull` so local files reflect platform state.
42
+
1.**Bootstrap state first** using `pull:*:bootstrap` when you need fresh platform mappings without downloading the org's resources into your working tree.
43
43
2.**Edit declarative resources** in `resources/<env>/` (`.md` assistants, `.yml` tools/squads/etc.).
44
44
3.**Push selectively while iterating** (resource type or file path), then run a full push before release.
45
45
4.**Promote by environment** (`dev` -> `stg` -> `prod`) by copying files between `resources/dev/`, `resources/stg/`, and `resources/prod/`.
@@ -50,6 +50,8 @@ Use:
50
50
-`push` for explicit deploys
51
51
-`apply` (`pull -> merge -> push`) when you want one command for sync + deploy
52
52
53
+
For template-based repos, `push` now auto-runs a bootstrap state sync when local state is missing credential mappings or contains stale IDs for the resources you're applying.
|`npm run pull:dev`| Pull platform state, preserve local changes |
88
+
|`npm run pull:stg`| Pull staging state, preserve local changes |
89
+
|`npm run pull:dev:force`| Pull platform state, overwrite everything |
90
+
|`npm run pull:stg:force`| Pull staging state, overwrite everything |
91
+
|`npm run pull:prod`| Pull from prod, preserve local changes |
92
+
|`npm run pull:prod:force`| Pull from prod, overwrite everything |
93
+
|`npm run pull:dev:bootstrap`| Refresh dev state/credentials without writing remote resources locally |
94
+
|`npm run pull:stg:bootstrap`| Refresh staging state/credentials without writing remote resources locally |
95
+
|`npm run pull:prod:bootstrap`| Refresh prod state/credentials without writing remote resources locally |
96
+
|`npm run push:dev`| Push local files to Vapi (dev) |
97
+
|`npm run push:stg`| Push local files to Vapi (staging) |
98
+
|`npm run push:prod`| Push local files to Vapi (prod) |
99
+
|`npm run apply:dev`| Pull → Merge → Push in one shot (dev) |
100
+
|`npm run apply:stg`| Pull → Merge → Push in one shot (staging) |
101
+
|`npm run apply:prod`| Pull → Merge → Push in one shot (prod) |
102
+
|`npm run push:dev assistants`| Push only assistants (dev) |
103
+
|`npm run push:dev tools`| Push only tools (dev) |
104
+
|`npm run call:dev -- -a <name>`| Start a WebSocket call to an assistant (dev) |
105
+
|`npm run call:dev -- -s <name>`| Start a WebSocket call to a squad (dev) |
106
+
|`npm run mock:webhook`| Run local webhook receiver for Vapi server messages |
102
107
103
108
### Basic Workflow
104
109
105
110
```bash
106
-
# First time: pull all resources from Vapi for your target env
107
-
npm run pull:dev:force
108
-
109
-
# Commit the initial state
110
-
git add .&& git commit -m "initial pull"
111
+
# First time in a template clone: refresh only state and credentials
112
+
npm run pull:dev:bootstrap
111
113
112
-
#Make changes to YAML/MD files under resources/
114
+
#Add or edit only the resources you actually want under resources/dev/
113
115
114
116
# Push your changes (full sync)
115
117
npm run push:dev
116
118
```
117
119
120
+
#### Bootstrap State Sync (Template-Safe First Run)
121
+
122
+
Use bootstrap pull when you need the latest platform IDs and credential mappings but do not want the repo filled with assistants, tools, and other resources from the target Vapi org:
123
+
124
+
```bash
125
+
npm run pull:dev:bootstrap
126
+
```
127
+
128
+
This mode:
129
+
130
+
- Pulls credentials into `.vapi-state.<env>.json`
131
+
- Refreshes remote resource ID mappings in the state file
132
+
- Leaves `resources/<env>/` untouched so your working tree stays focused on the resources you actually intend to manage
133
+
134
+
If you skip this step, `push` will automatically run the same bootstrap sync when it detects empty or stale state for the resources being applied.
0 commit comments