lampline 0.5.1__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (93) hide show
  1. lampline-0.5.1/PKG-INFO +436 -0
  2. lampline-0.5.1/README.md +412 -0
  3. lampline-0.5.1/pyproject.toml +46 -0
  4. lampline-0.5.1/setup.cfg +4 -0
  5. lampline-0.5.1/src/lampline.egg-info/PKG-INFO +436 -0
  6. lampline-0.5.1/src/lampline.egg-info/SOURCES.txt +91 -0
  7. lampline-0.5.1/src/lampline.egg-info/dependency_links.txt +1 -0
  8. lampline-0.5.1/src/lampline.egg-info/entry_points.txt +2 -0
  9. lampline-0.5.1/src/lampline.egg-info/requires.txt +5 -0
  10. lampline-0.5.1/src/lampline.egg-info/top_level.txt +1 -0
  11. lampline-0.5.1/src/vk/__init__.py +3 -0
  12. lampline-0.5.1/src/vk/__main__.py +3 -0
  13. lampline-0.5.1/src/vk/agentfs.py +203 -0
  14. lampline-0.5.1/src/vk/cli.py +503 -0
  15. lampline-0.5.1/src/vk/connectors.py +174 -0
  16. lampline-0.5.1/src/vk/engine_client.py +91 -0
  17. lampline-0.5.1/src/vk/exporters/__init__.py +39 -0
  18. lampline-0.5.1/src/vk/exporters/ces.py +210 -0
  19. lampline-0.5.1/src/vk/exporters/common.py +254 -0
  20. lampline-0.5.1/src/vk/exporters/dfcx.py +581 -0
  21. lampline-0.5.1/src/vk/google_targets.py +249 -0
  22. lampline-0.5.1/src/vk/importers/__init__.py +43 -0
  23. lampline-0.5.1/src/vk/importers/ces.py +306 -0
  24. lampline-0.5.1/src/vk/importers/common.py +296 -0
  25. lampline-0.5.1/src/vk/importers/dfcx.py +794 -0
  26. lampline-0.5.1/src/vk/lint.py +453 -0
  27. lampline-0.5.1/src/vk/mcp_server.py +289 -0
  28. lampline-0.5.1/src/vk/pages.py +550 -0
  29. lampline-0.5.1/src/vk/phi.py +95 -0
  30. lampline-0.5.1/src/vk/scenario.py +311 -0
  31. lampline-0.5.1/src/vk/skills/dialogflow-tester/SKILL.md +119 -0
  32. lampline-0.5.1/src/vk/skills/voice-agent-builder/SKILL.md +145 -0
  33. lampline-0.5.1/src/vk/skills/voice-agent-fixer/SKILL.md +112 -0
  34. lampline-0.5.1/src/vk/skills/voice-agent-reviewer/SKILL.md +56 -0
  35. lampline-0.5.1/src/vk/templates/appointment-finder/agent.yaml +95 -0
  36. lampline-0.5.1/src/vk/templates/appointment-finder/prompts/find-a-time.md +8 -0
  37. lampline-0.5.1/src/vk/templates/appointment-finder/prompts/goodbye.md +1 -0
  38. lampline-0.5.1/src/vk/templates/appointment-finder/prompts/persona.md +1 -0
  39. lampline-0.5.1/src/vk/templates/appointment-finder/prompts/start.md +1 -0
  40. lampline-0.5.1/src/vk/templates/appointment-finder/tests/finds-a-time.yaml +8 -0
  41. lampline-0.5.1/src/vk/templates/appointment-scheduling/agent.yaml +137 -0
  42. lampline-0.5.1/src/vk/templates/appointment-scheduling/prompts/collect-details.extraction.md +1 -0
  43. lampline-0.5.1/src/vk/templates/appointment-scheduling/prompts/collect-details.md +7 -0
  44. lampline-0.5.1/src/vk/templates/appointment-scheduling/prompts/confirm.md +1 -0
  45. lampline-0.5.1/src/vk/templates/appointment-scheduling/prompts/greeting.md +1 -0
  46. lampline-0.5.1/src/vk/templates/appointment-scheduling/prompts/not-scheduling.md +1 -0
  47. lampline-0.5.1/src/vk/templates/appointment-scheduling/prompts/persona.md +9 -0
  48. lampline-0.5.1/src/vk/templates/appointment-scheduling/prompts/request-booked.md +1 -0
  49. lampline-0.5.1/src/vk/templates/appointment-scheduling/tests/new-patient.yaml +9 -0
  50. lampline-0.5.1/src/vk/templates/appointment-scheduling/tests/other-request.yaml +7 -0
  51. lampline-0.5.1/src/vk/templates/bilingual-front-desk/agent.yaml +158 -0
  52. lampline-0.5.1/src/vk/templates/bilingual-front-desk/prompts/appointments.extraction.md +1 -0
  53. lampline-0.5.1/src/vk/templates/bilingual-front-desk/prompts/appointments.md +1 -0
  54. lampline-0.5.1/src/vk/templates/bilingual-front-desk/prompts/goodbye.md +1 -0
  55. lampline-0.5.1/src/vk/templates/bilingual-front-desk/prompts/greeting.extraction.md +1 -0
  56. lampline-0.5.1/src/vk/templates/bilingual-front-desk/prompts/greeting.md +1 -0
  57. lampline-0.5.1/src/vk/templates/bilingual-front-desk/prompts/hours-and-location.md +4 -0
  58. lampline-0.5.1/src/vk/templates/bilingual-front-desk/prompts/persona.md +14 -0
  59. lampline-0.5.1/src/vk/templates/bilingual-front-desk/prompts/router.md +1 -0
  60. lampline-0.5.1/src/vk/templates/bilingual-front-desk/tests/english-location.yaml +6 -0
  61. lampline-0.5.1/src/vk/templates/bilingual-front-desk/tests/spanish-appointment.yaml +8 -0
  62. lampline-0.5.1/src/vk/templates/bilingual-front-desk/tests/spanish-hours.yaml +6 -0
  63. lampline-0.5.1/src/vk/templates/front-desk/agent.yaml +203 -0
  64. lampline-0.5.1/src/vk/templates/front-desk/prompts/appointments.extraction.md +1 -0
  65. lampline-0.5.1/src/vk/templates/front-desk/prompts/appointments.md +8 -0
  66. lampline-0.5.1/src/vk/templates/front-desk/prompts/billing.md +1 -0
  67. lampline-0.5.1/src/vk/templates/front-desk/prompts/goodbye.md +1 -0
  68. lampline-0.5.1/src/vk/templates/front-desk/prompts/greeting.md +1 -0
  69. lampline-0.5.1/src/vk/templates/front-desk/prompts/hours-and-location.md +4 -0
  70. lampline-0.5.1/src/vk/templates/front-desk/prompts/persona.md +9 -0
  71. lampline-0.5.1/src/vk/templates/front-desk/prompts/router.md +1 -0
  72. lampline-0.5.1/src/vk/templates/front-desk/prompts/transfer-to-staff.md +1 -0
  73. lampline-0.5.1/src/vk/templates/front-desk/tests/appointment.yaml +10 -0
  74. lampline-0.5.1/src/vk/templates/front-desk/tests/billing-handoff.yaml +9 -0
  75. lampline-0.5.1/src/vk/templates/front-desk/tests/emergency.yaml +5 -0
  76. lampline-0.5.1/src/vk/templates/front-desk/tests/hours.yaml +7 -0
  77. lampline-0.5.1/src/vk/templates/front-desk/tests/impatient-billing-caller.yaml +9 -0
  78. lampline-0.5.1/src/vk/templates/nurse-callback/agent.yaml +93 -0
  79. lampline-0.5.1/src/vk/templates/nurse-callback/prompts/greeting.md +1 -0
  80. lampline-0.5.1/src/vk/templates/nurse-callback/tests/callback.yaml +11 -0
  81. lampline-0.5.1/src/vk/templates/test-caller/agent.yaml +72 -0
  82. lampline-0.5.1/src/vk/templates/test-caller/tests/answers-the-agent.yaml +6 -0
  83. lampline-0.5.1/src/vk/tools.py +242 -0
  84. lampline-0.5.1/src/vk/triggers.py +231 -0
  85. lampline-0.5.1/tests/test_agentfs.py +104 -0
  86. lampline-0.5.1/tests/test_cli.py +180 -0
  87. lampline-0.5.1/tests/test_exporters.py +308 -0
  88. lampline-0.5.1/tests/test_google_targets.py +130 -0
  89. lampline-0.5.1/tests/test_importers.py +444 -0
  90. lampline-0.5.1/tests/test_lint.py +148 -0
  91. lampline-0.5.1/tests/test_mcp_server.py +127 -0
  92. lampline-0.5.1/tests/test_phi.py +62 -0
  93. lampline-0.5.1/tests/test_scenario.py +193 -0
@@ -0,0 +1,436 @@
1
+ Metadata-Version: 2.4
2
+ Name: lampline
3
+ Version: 0.5.1
4
+ Summary: vk: build, check and test Lampline voice agents from the terminal, CI, or a coding agent
5
+ Author: Rohan Salvi
6
+ License-Expression: Apache-2.0
7
+ Project-URL: Homepage, https://github.com/C4rohan/Lampline
8
+ Project-URL: Documentation, https://github.com/C4rohan/Lampline/blob/prod/cli/README.md
9
+ Project-URL: Issues, https://github.com/C4rohan/Lampline/issues
10
+ Project-URL: Changelog, https://github.com/C4rohan/Lampline/blob/prod/CHANGELOG.md
11
+ Keywords: voice-agents,phone,ivr,testing,dialogflow-cx,conversational-ai,mcp
12
+ Classifier: Development Status :: 4 - Beta
13
+ Classifier: Environment :: Console
14
+ Classifier: Intended Audience :: Developers
15
+ Classifier: Programming Language :: Python :: 3
16
+ Classifier: Topic :: Software Development :: Testing
17
+ Classifier: Topic :: Communications :: Telephony
18
+ Requires-Python: >=3.10
19
+ Description-Content-Type: text/markdown
20
+ Requires-Dist: httpx>=0.27
21
+ Requires-Dist: PyYAML>=6.0
22
+ Provides-Extra: dev
23
+ Requires-Dist: pytest>=8; extra == "dev"
24
+
25
+ # vk: agents as code for Lampline
26
+
27
+ `vk` lets you build, check and test Lampline voice agents from a terminal, a CI
28
+ job, or an AI coding agent (Claude Code, Gemini CLI, Codex), alongside the
29
+ engine's drag-and-drop builder. Agents are folders the engine runs as they are
30
+ on disk, so there's nothing to upload: edit, lint, test, commit.
31
+
32
+ ```bash
33
+ pipx install lampline # installs the vk command; Python 3.10+
34
+ ```
35
+
36
+ `pip install lampline` works too, and `uvx --from lampline vk --help` runs it
37
+ without installing. Working on Lampline itself? From a clone of the repo:
38
+ `pip install -e cli`.
39
+
40
+ `vk test` talks to a running engine: `VK_ENGINE_URL` (default
41
+ `http://localhost:7860`) and, when the engine needs one, its API key in
42
+ `VK_ENGINE_KEY`. The key is never written into an agent folder.
43
+
44
+ ## An agent is a folder
45
+
46
+ ```
47
+ agents/front-desk/
48
+ agent.yaml # graph: nodes, edges, settings, context variables
49
+ prompts/greeting.md # one Markdown file per prompt
50
+ prompts/router.md
51
+ prompts/reschedule.extraction.md
52
+ tests/ # optional; scanned for patient data by vk lint
53
+ ```
54
+
55
+ `agent.yaml` points at prompt files (`prompt: {file: prompts/router.md}`), so a
56
+ prompt change shows up in git as a Markdown diff. Folder ↔ JSON conversion
57
+ is lossless, including fields vk doesn't know about.
58
+
59
+ Two sections are notes for you and your tools, not part of the agent itself:
60
+ - `setup`: answers to the new-agent questions (purpose, LLM cloud vs local,
61
+ whether real patient data is involved, and so on).
62
+ - `lint`: `prompt_budget_chars` and `ignore` (a code like `VK105`, or
63
+ `VK105:<node-id>` for one node).
64
+
65
+ ## Commands
66
+
67
+ | Command | What it does |
68
+ |---|---|
69
+ | `vk lint DIR... [--format json] [--strict]` | Offline checks; exit 1 on errors (`--strict`: on warnings too) |
70
+ | `vk test DIR [-k TEXT] [--url URL] [--format json] [-v] [--live-tools] [--repeat N] [--allow-flaky]` | Run `tests/*.yaml` conversations on the engine, with the folder as it is on disk |
71
+ | `vk test DIR --target dfcx\|ces\|engine,dfcx --agent RESOURCE` | Run the same tests against your live Dialogflow CX agent or CX Agent Studio app, or side by side with the engine |
72
+ | `vk templates list` / `vk templates install NAME [--dir D] [--name N]` | Starter agents |
73
+ | `vk import dfcx\|ces\|auto EXPORT [--dir D] [--name N]` | Turn a Dialogflow CX or CX Agent Studio export (zip or folder) into an agent folder, offline. See [Import](#import) |
74
+ | `vk export ces\|dfcx DIR [--out F] [--folder]` | Write an agent folder as a CX Agent Studio app or a Dialogflow CX agent, offline. See [Export](#export) |
75
+ | `vk skills install --target claude\|agents\|gemini` | Install the coding-agent skills (builder, fixer, Dialogflow tester, reviewer) |
76
+ | `vk mcp [--dir agents] [--url URL]` | Serve the agent folders and their tests to MCP clients over stdio ([MCP server](#mcp-server)) |
77
+
78
+ Changes reach real callers when the folder does: review them as pull requests
79
+ and promote dev → qa → prod ([docs/BRANCHES.md](https://github.com/C4rohan/Lampline/blob/prod/docs/BRANCHES.md)), with
80
+ `vk lint` and `vk test` in CI.
81
+
82
+ Exit codes: 0 ok, 1 failure (including lint errors), 2 bad usage.
83
+
84
+ ## Tests
85
+
86
+ A test is a scripted conversation in `tests/*.yaml`. `vk test` runs each one
87
+ through the engine's text chat, with the folder as it is on disk and the model
88
+ set on the engine's Integrations page, so you're testing exactly what a call
89
+ would do.
90
+
91
+ ```yaml
92
+ name: caller moves an appointment
93
+ context: {first_name: Sam} # optional values for {{variables}}
94
+ turns:
95
+ - user: I need to move my appointment to Tuesday.
96
+ expect: {reaches: Appointments} # optional check after this turn
97
+ - user: Morning, please. That's everything.
98
+ expect:
99
+ reaches: [Router, Appointments, Goodbye] # step names or ids, in order
100
+ not_reaches: [Billing]
101
+ calls_tool: [find_slots] # a tool, or a transition's tool name
102
+ says: [call back] # case-insensitive
103
+ not_says: [account number]
104
+ ends: true # reached an end step
105
+ ```
106
+
107
+ ```
108
+ $ vk test agents/front-desk
109
+ PASS caller moves an appointment (3 turn(s), 4.1s) Greeting → Router → Appointments → Goodbye
110
+ FAIL caller asks about Saturday hours (1 turn(s), 1.9s) Greeting → Router
111
+ - expected to reach 'Hours and location'; steps were Greeting → Router
112
+ caller: What time are you open on Saturday?
113
+ agent: ...
114
+ ```
115
+
116
+ ### Let a model play the caller
117
+
118
+ For conversations you don't want to script line by line, describe the caller
119
+ and let a model play them. The engine's own model plays the caller, so `vk`
120
+ needs no key of its own:
121
+
122
+ ```yaml
123
+ name: impatient caller with a billing question
124
+ caller:
125
+ persona: Sam, in a hurry, confused by a late fee on this month's bill
126
+ goal: get the fee explained or talk to someone in billing
127
+ opening: Hi, I've got a question about my bill. # optional first line
128
+ max_turns: 8 # optional, 1 to 30 (default 8)
129
+ expect:
130
+ reaches: Billing
131
+ not_says: [card number, social security]
132
+ ```
133
+
134
+ The caller answers the agent's questions with made-up details and stops when
135
+ its goal is met, the agent says goodbye, or `max_turns` runs out. It says
136
+ something different every run, so keep `expect` to what any good conversation
137
+ must do, and run it a few times after changing the agent (`--repeat`, below).
138
+ A file has either `turns` or a `caller`, not both.
139
+
140
+ ### Catch flaky tests
141
+
142
+ Models answer differently from run to run, so one passing run proves little.
143
+ `--repeat N` runs every test N times (up to 10). For example:
144
+
145
+ ```
146
+ $ vk test agents/front-desk --repeat 3
147
+ PASS billing question goes to the billing team (2 turn(s), 2.4s, passed 3 of 3 runs) Greeting → Router → Billing
148
+ FLAKY caller asks about Saturday hours (1 turn(s), 2.5s, passed 2 of 3 runs) Greeting → Router
149
+ - expected to reach 'Hours and location'; steps were Greeting → Router
150
+
151
+ 1 passed, 0 failed, 1 flaky
152
+ ```
153
+
154
+ A flaky test shows its failing run, which usually points at two transition
155
+ conditions that overlap. It fails the run like a failed test does; add
156
+ `--allow-flaky` to let it pass. With `--format json`, each test has `runs`,
157
+ `passes` and `flaky`.
158
+
159
+ ### Test the original Google agent, side by side
160
+
161
+ The same test files run against a live Dialogflow CX agent or CX Agent Studio
162
+ app, so a folder you imported can be checked against the original. New to
163
+ this? Follow the step-by-step guide:
164
+ [Test a Dialogflow CX agent in 10 minutes](https://github.com/C4rohan/Lampline/blob/prod/docs/TEST-DIALOGFLOW.md).
165
+
166
+ ```bash
167
+ gcloud auth login # your own Google account; vk uses `gcloud auth print-access-token`
168
+ vk test agents/clinic --target dfcx --agent projects/my-project/locations/global/agents/AGENT_ID
169
+ vk test agents/clinic --target ces --agent projects/my-project/locations/us/apps/APP_ID --deployment DEPLOYMENT_ID
170
+ vk test agents/clinic --target engine,dfcx --agent projects/... # both, then a side-by-side table
171
+ ```
172
+
173
+ ```
174
+ Side by side
175
+ test engine dfcx
176
+ caller moves an appointment PASS PASS
177
+ caller asks for billing PASS FAIL ← differs
178
+ ```
179
+
180
+ - **What's checked:** for Dialogflow CX, `reaches` matches the pages, flows and
181
+ playbooks the agent went through; for CX Agent Studio, the agents it
182
+ transferred to. Imported folders use the same names, so one test file fits
183
+ both. `calls_tool` matches tool display names, `says` the agent's text, and
184
+ `ends` an end of session, a live-agent handoff or a phone transfer.
185
+ - **Context:** `context:` values go in as session parameters (Dialogflow CX)
186
+ or variables (CX Agent Studio) on the first turn.
187
+ - **Model callers:** tests with a `caller:` block need the Lampline engine
188
+ too (`--url`), because its model plays the caller.
189
+ - **Options:** `--environment` (Dialogflow CX, default the draft),
190
+ `--deployment` (CX Agent Studio), `--language` (default `en`).
191
+ - **Your own agents only.** The access token is yours (`gcloud`, or
192
+ `VK_GOOGLE_TOKEN`), used for these requests and never saved. Tests talk to
193
+ the real agent, so its webhooks and tools run for real: use a test project
194
+ and synthetic data, and never a production agent you aren't responsible for.
195
+ - Text only for now; voice (calling the agent's phone number) is next.
196
+
197
+ - Moving between steps is reported as a call to the transition's tool, named
198
+ from its label (`hours or location` → `hours_or_location`).
199
+ - LLMs phrase things differently every run: assert on where the call goes and on
200
+ must/must-not phrases, not exact sentences. Each test costs a few LLM calls.
201
+ - `vk lint` checks tests offline too: VK110 flags a test that names a step the
202
+ agent doesn't have, or a malformed test file.
203
+ - HTTP tools answer with their mock responses, so tests never
204
+ touch real services. `--live-tools` calls the real ones. Check a tool was used
205
+ with `calls_tool: [find_open_slots]`.
206
+
207
+ ## Templates
208
+
209
+ | Template | What it is |
210
+ |---|---|
211
+ | `front-desk` | Root agent routing to appointments, hours and location, billing, or a person |
212
+ | `appointment-scheduling` | Guided steps: collect details, read back, confirm |
213
+ | `bilingual-front-desk` | English and Spanish front desk that answers in the caller's language |
214
+ | `appointment-finder` | Root agent with an HTTP tool that looks up open times (mock answers until you add a URL) |
215
+ | `nurse-callback` | A scripted page that takes a callback request word for word: exact lines, a form, rule transfers, and no model calls at all |
216
+ | `test-caller` | An AI caller with a persona and a goal, for testing another phone agent from your laptop ([docs/PHONE-TESTING.md](https://github.com/C4rohan/Lampline/blob/prod/docs/PHONE-TESTING.md)); its Start waits for the other side to speak first |
217
+
218
+ Each comes with prompts, tests, a fictional business (Riverside Clinic) in
219
+ `context_variables`, and `setup.real_data: false`. Edit the context variables
220
+ and prompts, then `vk lint` and `vk test`.
221
+
222
+ ## Import
223
+
224
+ Bring an agent over from Google's tools. Export it there, then:
225
+
226
+ ```bash
227
+ vk import dfcx ~/Downloads/front-desk.zip # Dialogflow CX: Agent settings → Export, JSON package
228
+ vk import ces ~/Downloads/front-desk.zip # CX Agent Studio: Export app (JSON or YAML)
229
+ vk import auto ~/Downloads/front-desk.zip --dir agents/front-desk
230
+ ```
231
+
232
+ The builder's **New agent → Import** tab does the same. The conversion runs on
233
+ your computer, reads only the export, and never runs code from it.
234
+ `import-report.md` in the new folder lists everything to review.
235
+
236
+ | Dialogflow CX | Becomes |
237
+ |---|---|
238
+ | start flow | Start (greeting from the welcome route), then a "Main menu" step with the flow's routes |
239
+ | flows | a flow name on their steps; a start page that only passes the caller on is skipped |
240
+ | pages | [scripted pages](https://github.com/C4rohan/Lampline/blob/prod/engine/README.md#scripted-pages-and-flows): the entry message is said word for word; an entry webhook runs on entry (`on_entry`), a webhook on the form-complete route once the form is complete (`on_done`) |
241
+ | form parameters | form fields (`@sys.number` → number, `@sys.date` → date, custom entities → choices with synonyms, regexp entities → patterns, DTMF → keypad); reprompts carry over |
242
+ | intent routes | transfers the model decides, from the intent's description or up to four English training phrases |
243
+ | condition routes | rules (`$session.params.age >= 18` → `age >= 18`); `$page.params.status = "FINAL"` → otherwise; expressions with functions become transfers for the model (review these) |
244
+ | `sys.no-match-N` handlers | a "no match" transfer after N tries; the default handler's message is what the page says when it doesn't understand |
245
+ | route groups | their routes are added to every flow or page that uses them |
246
+ | route fulfillment | what the agent says while transferring |
247
+ | End Session / End Flow | an End call step (from a page: "Hang up", which ends without another word); End Flow With Human Escalation → "Hand off to a person" |
248
+ | playbooks | steps with the goal, guidelines and steps; referenced playbooks and flows become transfers |
249
+ | OpenAPI tools | HTTP tools, one per operation |
250
+ | webhooks | tools with a mock answer (Dialogflow's webhook format differs from ours) |
251
+ | data store tools | `knowledge.search` tools on a local knowledge base of the same name (upload the documents on the Knowledge page) |
252
+
253
+ | CX Agent Studio | Becomes |
254
+ |---|---|
255
+ | root agent | Start (no fixed greeting: the root agent opens, as in CX Agent Studio), then the root agent |
256
+ | agents, `childAgents` | steps, with a transfer to each child (its description says when) and back |
257
+ | `end_session` tool | a transfer to an End call step |
258
+ | global instruction, variables | global instructions, context variables with their defaults |
259
+ | `{@TOOL: x}`, `{@AGENT: y}`, `{var}` | plain names and `{{var}}` |
260
+ | OpenAPI tools and toolsets | HTTP tools (a toolset's chosen operations only) |
261
+ | Python and client-function tools | tools with a mock answer until you put them behind an HTTP endpoint |
262
+ | data store and file search tools | `knowledge.search` tools on a local knowledge base of the same name |
263
+
264
+ Not carried over yet, and listed in the report: other event handlers
265
+ (no-input, custom events), webhooks on routes, conditional responses,
266
+ generators, callbacks, guardrails, examples and
267
+ evaluations, and languages other than the default. Values webhooks set
268
+ (`$session.params.x` that no form collects) become context variables, blank or
269
+ null, for you to fill in. Tools need their real address and secrets
270
+ (Integrations → Tool secrets) before live calls; until then `vk test`
271
+ and the builder's Test chat use the mock answers. Test with synthetic data.
272
+
273
+ ## Export
274
+
275
+ The other direction: an agent folder as something Google's tools import.
276
+
277
+ ```bash
278
+ vk export ces agents/front-desk # front-desk-cx-agent-studio.zip: CX Agent Studio → Import app
279
+ vk export dfcx agents/front-desk --time-zone America/Chicago # Dialogflow CX: Agent settings → Restore, then Validate
280
+ vk export ces agents/front-desk --folder --out build/front-desk # files instead of a zip, to diff or edit
281
+ ```
282
+
283
+ The builder's **Export** menu does the same. Secrets never leave:
284
+ `{{secrets.NAME}}` headers become an API-key entry in the OpenAPI schema for
285
+ you to fill in there.
286
+
287
+ | Ours | CX Agent Studio | Dialogflow CX |
288
+ |---|---|---|
289
+ | root agent (Start's hand-over) | `rootAgent`; its instruction opens with Start's greeting | the start playbook (`startPlaybook`) |
290
+ | steps | agents with `instruction.txt` | playbooks (goal, steps) |
291
+ | transfers | child agents, plus `{@AGENT: x}` rules in the instruction | `${PLAYBOOK:x}` in the steps |
292
+ | End call | the `end_session` system tool | an "End Conversation" flow, reached with `${FLOW:End Conversation}` |
293
+ | global instructions | `global_instruction.txt` | added to every playbook |
294
+ | variables, details to collect | `variableDeclarations` | `$session.params.x` in the text; output parameters |
295
+ | HTTP tools | OpenAPI toolsets (one per service address) | OpenAPI tools with `schema.yaml` |
296
+ | tools with only a mock | Python tools that return the example answer | function tools |
297
+ | scripted pages | instructions written from the script (say exactly, ask these questions, rules in words) | pages in flows: entry fulfillment, form parameters, entity types for choices, yes/no and patterns |
298
+ | flows | | flows; a page entered from outside its flow (when the flow already starts elsewhere) gets a flow of its own |
299
+ | rules, otherwise, no match | rules in words | condition routes (gated on `$page.params.status = "FINAL"` when the page has a form), `sys.no-match-N` handlers |
300
+ | transfers the model decides, from a scripted page | | intents (training phrases from “quoted” examples in the condition) |
301
+ | tools a page runs (`on_entry`, `on_done`) | listed with the agent's tools | webhooks on the entry fulfillment and on the routes out |
302
+ | data and knowledge tools | Python tools with the example answer, and a note | function tools, and a note to use your own database or a data store |
303
+
304
+ Ids are stable (the same agent exports to the same files), and importing an
305
+ export gives back the same steps, transfers, greeting and variables, which the
306
+ tests check for every bundled template and for a mixed scripted agent (pages,
307
+ forms, rules and flows survive a Dialogflow CX round trip; checks like a
308
+ field's 1–8 range and read-back confirmations don't, as Dialogflow forms have
309
+ no place for them, and the report says so). CX Agent Studio can check an import
310
+ without applying it (`importOptions.validateOnly`); for Dialogflow CX, restore
311
+ into a test agent and press Validate. Triggers, connector and MCP tools, and
312
+ the API Trigger and Webhook nodes have no direct equivalent and are listed
313
+ in the notes.
314
+
315
+ ## Lint
316
+
317
+ | Code | Severity | Check |
318
+ |---|---|---|
319
+ | VK001 | error | exactly one start node |
320
+ | VK003 | error | at most one global node and one trigger |
321
+ | VK004 | error | edge points at a missing node |
322
+ | VK005 | error | transition without a label or condition |
323
+ | VK006 | error | two transitions from one node become the same tool name |
324
+ | VK007 | error | connection rules (end has no outgoing, global/trigger are detached, …) |
325
+ | VK008 | error | agent or end node with no incoming edge |
326
+ | VK101 | warning | node unreachable from start |
327
+ | VK102 | warning | no end node |
328
+ | VK103 | warning | dead end (agent node with no way out) |
329
+ | VK104 | warning | empty prompt |
330
+ | VK105 | warning | prompt over budget (default 8000 chars) |
331
+ | VK106 | warning | sibling transitions with identical conditions |
332
+ | VK107 | warning | `{{variable}}` that nothing provides |
333
+ | VK108 | warning | webhook or pre-call fetch without a URL |
334
+ | VK109 | warning | duplicate node names |
335
+ | VK110 | error | a test names a step the agent doesn't have, or a test file is malformed |
336
+ | VK111 | error / warning | a tool definition problem: name, URL, method, parameters, a pasted key in a header, caller values in the address |
337
+ | VK112 | error | two tools with the same name |
338
+ | VK113 | error | a step lists a tool the agent doesn't define |
339
+ | VK114 | error | a step's tool has the same name as one of its transfers |
340
+ | VK115 | warning | a tool no step uses |
341
+ | VK116 | warning | a tool uses `{{name}}` that isn't a parameter or a known variable |
342
+ | VK120 | error / warning | a trigger definition problem: type, channel, cron, recipients, send settings |
343
+ | VK121 | error | two triggers with the same id |
344
+ | VK122 | error | two message triggers answer the same channel |
345
+ | VK130 | error / warning | a scripted page's settings: field types, choices, limits, patterns, attempts |
346
+ | VK131 | error / warning | a rule that can't be read or uses a variable nothing provides; otherwise / no match from an LLM step; a rule on Start |
347
+ | VK132 | warning | a scripted page that never moves on once its form is complete, or reads answers exactly but has transfers for the model |
348
+ | VK133 | error / warning | a page's `on_entry` / `on_done` names a tool that doesn't exist, or one whose arguments no variable provides |
349
+ | VK134 | error / warning | a transfer to a person: only on End call steps, to a phone number (E.164) or SIP address; details and variables it sends must exist; warns when the address comes from what the caller said |
350
+ | VK201 / 202 / 206 | error | looks like an SSN, a Luhn-valid card number, a medical record or member ID |
351
+ | VK203 / 204 / 205 | warning | full date, phone number, email |
352
+
353
+ The VK2xx scan covers prompts, greetings, transitions, context variables, tools'
354
+ descriptions, URLs, bodies, fixed values and mock answers, triggers' recipients and
355
+ messages, and `tests/*.yaml`. Obvious fakes are allowed: `123-45-6789`, `555-01xx` numbers,
356
+ `@example.com`. It is a guard rail for copy-paste mistakes, not a compliance
357
+ control: it cannot prove text is free of patient data. Use synthetic data.
358
+
359
+ The graph rules (VK0xx) catch what would stop an agent running: a missing or
360
+ second Start step, routes to steps that don't exist, steps nobody can reach,
361
+ and the like.
362
+
363
+ ## Skills for coding agents
364
+
365
+ `vk skills install --target claude` copies four skills into `.claude/skills/`
366
+ (`agents` → `.agents/skills/`, `gemini` → `.gemini/skills/`):
367
+
368
+ - **voice-agent-builder**: asks the ten setup questions, writes tests from the
369
+ example calls, builds the folder (often from a template), lints, and
370
+ iterates until `vk test` passes. Never merges anything toward production.
371
+ - **voice-agent-fixer**: runs `vk test`, names the cause of each failure,
372
+ changes only the prompt or transition behind it, and keeps a change only if
373
+ more tests pass and none that passed breaks. Never edits a test to pass it.
374
+ - **dialogflow-tester**: imports a Dialogflow CX or CX Agent Studio export,
375
+ writes tests for it, and runs them against the live Google agent
376
+ (`--target dfcx|ces`), or side by side with Lampline (`--target engine,dfcx`).
377
+ - **voice-agent-reviewer**: lint, the diff against what's live, tests, a prompt
378
+ and privacy review, then approves the merge only after you say yes.
379
+
380
+ The same four install as a Claude Code plugin: `/plugin marketplace add C4rohan/lampline`,
381
+ then `/plugin install lampline@lampline`.
382
+
383
+ ## MCP server
384
+
385
+ `vk mcp` serves your agent folders to MCP clients that don't run a terminal,
386
+ like Claude Desktop and Cursor, over stdio. Its tools:
387
+
388
+ | Tool | What it does |
389
+ |---|---|
390
+ | `list_agents` | the agent folders, with their step and test counts |
391
+ | `lint_agent` | `vk lint`, as findings |
392
+ | `run_tests` | `vk test` (same JSON as `--format json`), with an optional `match` and `repeat` |
393
+ | `read_prompt` | one step's prompt, plus every step's name and id |
394
+ | `write_prompt` | replace one step's prompt |
395
+ | `list_failed_calls` | real calls whose call checks failed: when, and which checks failed and why |
396
+
397
+ On purpose, it can't change steps, routes, tools, triggers or webhooks (they
398
+ can use secrets or contact people), and it never returns call transcripts or
399
+ callers' numbers: MCP results go to the model. A prompt write is refused if it
400
+ drops a `{{variable}}` the step uses, or if it looks like real personal data.
401
+ It only reads inside the agents folder.
402
+
403
+ **Claude Code:**
404
+
405
+ ```bash
406
+ claude mcp add lampline -- vk mcp --dir "$PWD/agents"
407
+ ```
408
+
409
+ **Claude Desktop** (`claude_desktop_config.json`) or **Cursor** (`.cursor/mcp.json`):
410
+
411
+ ```json
412
+ {
413
+ "mcpServers": {
414
+ "lampline": {
415
+ "command": "vk",
416
+ "args": ["mcp", "--dir", "/full/path/to/your/agents"],
417
+ "env": { "VK_ENGINE_URL": "http://localhost:7860" }
418
+ }
419
+ }
420
+ }
421
+ ```
422
+
423
+ Use the full path to `vk` (`which vk`) if the app can't find it. `run_tests`
424
+ and `list_failed_calls` need the engine running; add `VK_ENGINE_KEY` to `env`
425
+ if it uses a key.
426
+
427
+ ## Develop
428
+
429
+ ```bash
430
+ pip install -e "cli[dev]"
431
+ pytest -q cli/tests
432
+ ```
433
+
434
+ Tests run against an in-memory fake of the engine's text chat. The engine's own
435
+ test suite also runs `vk test` end to end against a real engine driven by a
436
+ deterministic fake model.