@kumion/cli 0.2.0 → 0.4.0

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kumion/cli",
3
- "version": "0.2.0",
3
+ "version": "0.4.0",
4
4
  "description": "Manage your Kumion voice agents from the terminal over the Kumion Partner API",
5
5
  "author": "KAOPA株式会社",
6
6
  "license": "MIT",
@@ -34,17 +34,19 @@
34
34
  "build": "tsc -p tsconfig.build.json",
35
35
  "typecheck": "tsc --noEmit",
36
36
  "test": "vitest run",
37
+ "docs:node-config": "../../node_modules/.bin/tsx scripts/node-config-reference.ts",
38
+ "docs:parity": "../../node_modules/.bin/tsx scripts/docs-parity.ts",
37
39
  "prepack": "npm run build"
38
40
  },
39
41
  "dependencies": {
40
- "@modelcontextprotocol/sdk": "^1.30.1",
42
+ "@modelcontextprotocol/sdk": "^1.32.1",
41
43
  "@napi-rs/keyring": "^2.1.0",
42
44
  "undici": "^7.29.1",
43
- "zod": "^3.25.76"
45
+ "zod": "^4.6.7"
44
46
  },
45
47
  "devDependencies": {
46
48
  "@types/node": "^22.10.2",
47
49
  "typescript": "^5.7.2",
48
- "vitest": "^2.1.8"
50
+ "vitest": "^4.1.11"
49
51
  }
50
52
  }
@@ -11,10 +11,20 @@ repository to clone and no local agent file to keep in sync — do not create on
11
11
 
12
12
  Two ways in, same operations and same permissions:
13
13
 
14
- - **MCP tools** (`list_agents`, `get_agent`, `patch_agent`, `publish_agent`,
15
- `start_test_run`, `get_test_run`, `list_test_runs`, `create_call`, `list_calls`,
16
- `get_call`, `get_call_transcript`) when the host
17
- has the `kumion` MCP server registered.
14
+ - **MCP tools** when the host has the `kumion` MCP server registered. Each CLI
15
+ command has one: `list_agents`, `get_agent`, `patch_agent`, `publish_agent`,
16
+ `get_call_flow`, `update_call_flow`, `edit_call_flow_steps`,
17
+ `set_agent_opening_name`, `set_agent_availability`, `create_agent_from_template`,
18
+ `list_agent_templates`, `list_facts`, `edit_fact`, `confirm_facts`,
19
+ `list_staff`, `create_staff`, `update_staff`, `get_store_hours`,
20
+ `update_store_hours`, `set_store_hours_exception`, `get_booking_settings`,
21
+ `update_booking_calendar`, `create_booking_service`, `update_booking_service`,
22
+ `create_booking_resource`, `update_booking_resource`, `set_agent_booking`,
23
+ `list_booking_slots`, `list_capture_specs`, `create_capture_spec`,
24
+ `update_capture_spec`, `get_agent_capture`, `set_agent_capture`,
25
+ `upload_document`, `get_document_upload_job`, `get_document`,
26
+ `replace_document`, `start_test_run`, `get_test_run`, `list_test_runs`,
27
+ `create_call`, `list_calls`, `get_call`, `get_call_transcript`.
18
28
  - **The `kumion` CLI** otherwise (`kumion --help`). Add `--json` for machine-readable
19
29
  output.
20
30
 
@@ -40,12 +50,36 @@ A partner with several customers has one profile per customer tenant
40
50
  2. **Read it** — `get_agent` / `kumion agents get <agentId> --json`. Note `revision`.
41
51
  A flow agent's behaviour is in `draft.graph`; a prompt-only agent's in
42
52
  `draft.prompt`.
43
- 3. **Edit the draft** — `patch_agent` with the `revision` you read /
44
- `kumion agents patch <agentId> --revision <rev> --prompt-file … | --graph-file …`.
45
- Send the whole edited graph, not a fragment. The draft is not live.
53
+ 3. **Edit the draft** — read the flow first: `get_call_flow` /
54
+ `kumion flow get <agentId> --json`. It is the view the Portal's canvas assistant
55
+ works on, with the `revision`, the pre-publish `findings`, and `staffChoices`
56
+ (who a 用件 can transfer to). Its `editLayer` picks the tool:
57
+ - `"flow"` (用件 form): `update_call_flow` / `kumion flow update <agentId>
58
+ --revision <rev> --patch-file <path>`. Send only what changes: `leaves[]` by
59
+ `key` with an `action` (`keep`, `add`, `remove`, `merge_into`), plus
60
+ `personaPrompt`, `openingSpeech`, `noRouteSpeech`, `examples` when they change.
61
+ To transfer a 用件 to someone, set its `transferContactKey` to a key from
62
+ `staffChoices`; `removeTransfer` turns it back into a message.
63
+ - `"steps"` (step-by-step graph, `flow` is null): `edit_call_flow_steps` /
64
+ `kumion flow edit-steps <agentId> --revision <rev> --ops-file <path>`. A batch of
65
+ `{ "op": …, …arguments }` from `set_node_field`, `set_edge_words`, `add_step`,
66
+ `remove_step`, `connect_steps`, `reconnect`, `disconnect`. It is all or nothing.
67
+ - Both accept `dryRun` / `--dry-run`: try it first and read the changes back.
68
+ - `patch_agent` / `kumion agents patch` replaces the prompt or the whole graph. Use
69
+ it only for a prompt-only agent or a change the two above cannot express, and
70
+ send the whole edited graph, not a fragment. External send settings (webhook,
71
+ pre-call fetch, notification, transfer target, opening recording, IVR menu
72
+ recording) must be sent
73
+ back unchanged: a write that adds or changes one is refused with
74
+ `external_field_closed` (`paths` says which). Those are edited in the Portal.
75
+
76
+ The draft is not live.
46
77
  - **Conflict (409)**: someone saved the agent since you read it. Nothing was
47
- written. Read it again, re-apply your change to the new draft, patch with the
78
+ written. Read it again, re-apply your change to the new draft, write with the
48
79
  new revision. Never retry with a revision you did not just read.
80
+ - **No one to transfer to**: `staffChoices` is empty or lacks the person. Register
81
+ them with `create_staff` / `kumion staff create --name … --transfer-target …`
82
+ (only when the user gave the name and number), then use the key it returns.
49
83
  4. **Test** — `start_test_run` (then `get_test_run` until it leaves `running`) /
50
84
  `kumion test-runs start <agentId>` (waits; exit 0 only on pass). Fix failures in
51
85
  the draft and test again.
@@ -55,21 +89,204 @@ A partner with several customers has one profile per customer tenant
55
89
  cases come back: fix, test, publish again. There is no skip or override; do not
56
90
  look for one.
57
91
  6. **Try it** (optional) — `create_call` / `kumion calls create <agentId>` starts a web
58
- test call and returns a LiveKit room and token.
92
+ test call and returns a LiveKit room and token. With `phoneNumber` / `--to <phone>` it
93
+ places a real outbound call instead (a domestic number; the agent must be published
94
+ and have a phone number assigned) — only when the user asked to dial a real person.
95
+ The outcome is on `get_call` / `kumion calls get`.
96
+
97
+ ## From a template to a published agent
98
+
99
+ When the tenant has only a template, this is the path. Every write takes the `revision` the read
100
+ before it printed; a 409 means something moved in between — read again, never retry with the old
101
+ number. `--json` everywhere; the names below are the CLI's, the MCP tool is in the list above or in
102
+ `kumion --help`.
103
+
104
+ 1. **Create** — `kumion agents create-from-template --template <id> --business-name <name>
105
+ --idempotency-key <key> --json`. Keep `agent.id` (`A`), `workflow.id` and `document.id` (`D`);
106
+ the draft's `revision` comes later, from `get_agent` / `get_call_flow`. Nothing is published, and
107
+ a resend with the same key answers the same agent.
108
+ 2. **Upload the real 資料** — `kumion documents upload --text-file <path> --title <title>
109
+ --idempotency-key <key> [--template <id>] --json` (or repeated `--file` for pdf/docx/xlsx, up to
110
+ 10 files / 20 MiB). `--dry-run` writes nothing, spends no allowance and calls no model. Ten
111
+ extractions per key per hour and the tenant's own cap; one upload in flight per key.
112
+ 3. **Wait** — `kumion documents jobs get <jobId>` until `succeeded`; `failed` and `timed_out` exit
113
+ non-zero and nothing is retried for you (a new attempt needs a new idempotency key). Then
114
+ `kumion documents get <S>` for the fields and `revision`.
115
+ 4. **Replace** — `kumion documents replace <D> --source <S> --source-revision <rev> --revision <rev>
116
+ --json`. `D` keeps its id, so the agent keeps pointing at it. Every fact is pending again, an item
117
+ the new 資料 does not mention stays empty, and no model is called.
118
+ 5. **Confirm the facts** — `kumion facts list <A> --json`, then `facts edit` / `facts confirm`. An
119
+ unconfirmed fact is not an answer the agent may read out; publish counts them as `unconfirmedFacts`.
120
+ 6. **Shop hours** — `kumion hours get --json`, then `kumion hours update` with the revision it
121
+ printed (see 「The shop clock」 below).
122
+ 7. **Booking** — `kumion booking get <A> --json`, then create a 内容 and a 担当, then
123
+ `kumion booking mount <A> --mounted true --revision <rev>`. Read back `mounted: true` and
124
+ `bookableResourceCount > 0` — a template's agent starts neither mounted nor with a 担当.
125
+ `kumion booking slots <A> --resource <id> --date <YYYY-MM-DD>` shows the openings a call would
126
+ offer and reserves nothing.
127
+ 8. **記録項目** — `kumion agents capture get <A> --json` shows what this agent records; expect
128
+ `readiness.ready: true`. `kumion capture-specs list|create|update` and `kumion agents capture set`
129
+ (the whole set; `--clear` = nothing) change it.
130
+ 9. **Flow** — `kumion flow get <A> --json`, then `flow update` (or `flow edit-steps` when `editLayer`
131
+ is `"steps"`). A new 資料 does not recompile the flow. Before publishing there must be no
132
+ `severity: "error"` entry in `findings.canvas` and `findings.structural` must be empty.
133
+ 10. **Publish** — `kumion agents publish <A> --revision <rev> --json`, then `kumion agents get <A>`:
134
+ `publishState.live: true`, `unpublishedChanges: false`, and the publish answer's
135
+ `publishedSnapshotId`. `unconfirmedFacts` above zero means the agent is not finished.
59
136
 
60
137
  ## Reading real calls
61
138
 
62
139
  `list_calls` / `kumion calls list` pages through the call history (filter by agent,
63
- channel, time range, or caller number); `get_call_transcript` /
140
+ channel, time range, or caller number). Each call already carries its result (`outcome`,
141
+ `endedAtNode`, `durationSec`, `transferred`, `capturedItems`): start from that, and read a
142
+ transcript only for the call you need. `get_call_transcript` /
64
143
  `kumion calls transcript <callId>` returns what the caller (`user`) and the agent
65
144
  (`assistant`) said. `available: false` means no transcript has been written yet, not a
66
145
  silent call. Use a transcript to find where the agent went wrong before editing its
67
146
  draft. Transcripts are the tenant's customers' conversations: quote only what the task
68
147
  needs.
69
148
 
70
- Not available over the Partner API (do not look for a command): operating hours,
71
- conversation-edit mode, the knowledge base, bookings, external-tool limits and the
72
- agent language setting. Those are Portal-only.
149
+ ## The shop clock (営業時間)
150
+
151
+ When the call answers 「何時までですか」, it reads the tenant's one booking calendar.
152
+ `get_store_hours` / `kumion hours get` shows 営業時間, 定休日, 祝日休み and the 例外日 in a
153
+ window, and the `revision` the two writes need. Reading never creates the calendar.
154
+
155
+ - `update_store_hours` / `kumion hours update` — `businessHours` and `closedRules`
156
+ are **whole replacements**: send the entire week you want (a `businessHours` holding
157
+ Mon–Fri makes Sat and Sun closed), and omit a field to leave it alone. It is live on
158
+ the next call, with no publish.
159
+ - `set_store_hours_exception` / `kumion hours exception set <date>` — one date. `closed`
160
+ is 臨時休業, `open` is 振替出勤 (its own `hours`, or the weekday's when omitted), and
161
+ `inherit` deletes the date's row so the weekly rule applies again. `inherit` takes
162
+ neither `hours` nor `note`.
163
+ - Both carry `revision` from the read. Anything that changes the same calendar in the
164
+ meantime — the Portal's 予約設定, a 担当 or 内容, a mount — moves it, and a stale write
165
+ is refused with a conflict and nothing saved. Read again and re-apply.
166
+ - `dryRun` / `--dry-run` answers with what would be saved and moves nothing.
167
+
168
+ ## 予約設定 (what can be booked, and by whom)
169
+
170
+ The same calendar, from the booking side. `get_booking_settings` / `kumion booking get <agentId>`
171
+ answers the slot length, the lead time, the horizon, the **内容** (what can be booked and how
172
+ long it takes), the **担当**, whether that agent is mounted, and how many 担当 can actually be
173
+ booked. It is per agent because the mount is; the settings themselves are the tenant's. The
174
+ `revision` is the one `get_store_hours` shows — one calendar, one counter.
175
+
176
+ - `update_booking_calendar` / `kumion booking calendar update` — `defaultSlotMinutes` (1–1440),
177
+ `minLeadMinutes` (0–43200) and/or `maxAdvanceDays` (1–730). Omit a field to leave it alone.
178
+ Send JSON **numbers**: `"30"` is refused, not read as 30.
179
+ - `create_booking_service` / `kumion booking services create` — `name`, and `durationMinutes`
180
+ (1–1440). `null` (or omitted) means 「枠の長さを使う」, which is what the read-back shows.
181
+ - `update_booking_service` / `kumion booking services update <serviceId>` — a name and/or a
182
+ duration; `null` goes back to the slot length. A service id that is not this tenant's is a 404.
183
+ - `create_booking_resource` / `update_booking_resource` / `kumion booking resources create|update` —
184
+ a 担当: `name`, `enabled`, `weeklyHours` and `serviceIds` (`[]` = every 内容, omitted = unchanged).
185
+ `enabled: false` takes them out of service without deleting the row.
186
+ - `set_agent_booking` / `kumion booking mount <agentId> --mounted true|false` — whether this agent
187
+ books at all, and with it the retirement of the 受付サマリー's 「仮受付」 promise. Unmounting does not
188
+ bring the old summary back.
189
+ - `list_booking_slots` / `kumion booking slots <agentId> --resource <id> --date <date>` — one 担当's
190
+ openings on one day, computed the way a call computes them (6 by default, at most 20). It reserves
191
+ nothing and returns no other customer's data.
192
+ - All of them are live (the next call uses them, no publish), and **create carries the revision
193
+ too**: two callers holding one revision cannot both add a 内容 — the second is refused. `dryRun`
194
+ allocates nothing.
195
+
196
+ Not available over the Partner API (do not look for a command): conversation-edit mode, the knowledge base, the booking RECORDS themselves (making, moving or cancelling a customer's booking, and the notifications that go with it), external-tool limits, the agent
197
+ language setting, a tool's display name (表示名), the agent's call-outcome categories
198
+ (通話の結果), and the call model with its TTS voice. Those are Portal-only. A patch
199
+ writes only `prompt` and `graph`; `agents get` shows the model and voice read-only.
200
+
201
+ ## Node configuration reference
202
+
203
+ A flow agent's steps are `draft.graph.nodes[]`; each node's settings are its `config`.
204
+ The table below is generated from the Portal's own field list. The Portal's node
205
+ inspector shows the keys in three layers: 必須 (always shown), 動きの調整 and 詳細.
206
+
207
+ <!-- BEGIN node-config-reference: generated by scripts/node-config-reference.ts (npm run docs:node-config); do not edit -->
208
+ `layer` says where the Portal's node inspector shows the key:
209
+
210
+ - `required` — always shown
211
+ - `tune` — 「動きの調整」 card: a one-line summary that opens to edit
212
+ - `advanced` — folded under 「詳細」, or a required item's 「細かい設定」
213
+ - `internal` — no editor in the Portal: set by another surface, or API only
214
+
215
+ A key a node does not store follows the agent's setting (会話の運用) or the tenant's
216
+ (運用設定); the inspector shows it as 「既定」 and a stored one as 「変更あり」.
217
+
218
+ | Key | Node types | Layer | Type | Note |
219
+ | --- | --- | --- | --- | --- |
220
+ | `display_name` | start, agent, end, global, trigger, webhook, qa, ivr, transfer, notify | `internal` | `string` | The name shown on the canvas. Edited by renaming the node. |
221
+ | `leaf_label` | start, agent | `internal` | `string` | Set by the manual compiler. The purpose name the diagnostics quote. |
222
+ | `canvas_flow` | start, agent, end, global, trigger, webhook, qa, ivr, transfer, notify | `internal` | `object` | Canvas layout state. Not a setting. |
223
+ | `flow_expectations` | global | `internal` | `object` | Written by the scenario interview. Not a setting. |
224
+ | `wait_cover` | start, agent | `tune` | `{ enabled?, on_threshold?, threshold_ms?, on_query_start?, query_grace_ms? }` | Node-level hold phrase. By default it plays only when a lookup tool is still running after `query_grace_ms` (100 to 10000, default 1000); `on_query_start: false` turns that off. `on_threshold: true` also plays it after `threshold_ms` (2000 to 15000, default 2000) of silence on an ordinary turn (default off). `enabled: false` turns it off for this node. The phrase text is set per agent. |
225
+ | `trigger_path` | trigger | `internal` | `string` | Generated. Shown read-only as the trigger URL. |
226
+ | `opening_speech` | start | `required` | `string` | The opening line. Supports {{variables}}. |
227
+ | `items` | start, agent | `required` | `{key,label?,example?,source?,value_type?,options?,must_ask?,tool?,option_writes?}[]` | What this step collects, one object per item, in the order it asks. `key`: slot key. `label`: display name. `example`: test-call example. `source`: where the value comes from (caller, derived, system, tool). `value_type`: kind (text, select, boolean, ...). `options`: choices of a select item. `must_ask`: ask the caller to confirm on the spot even if already known (advanced). `tool`: `{tool_key,result_field}` for a tool-sourced item. `option_writes`: option → tool that must succeed before that option lets the call leave (advanced). |
228
+ | `allow_interruptions` | start, agent | `tune` | `boolean` | Absent means the caller may interrupt. Only an explicit false is stored. |
229
+ | `respond_on_enter` | agent | `tune` | `boolean` | Absent means the node answers on arrival. Only an explicit false (wait for the caller) is stored. |
230
+ | `confirm_before_end` | agent | `tune` | `boolean` | Absent means off (agents published before this setting keep their behaviour); a node created on the canvas stores true, and a node compiled from a SOP or document stores true when its connection to an end node requires items (the `end_without_readback` rule). On: the platform reads the recorded items back once before the call ends, and the end opens on a later caller turn with caller_confirmed. |
231
+ | `entry_lookup` | agent | `tune` | `string` | Absent means no lookup on entry. A tool key from this step's tools (`booking_list`): the platform calls it when the call arrives at this step, and the call and its result are in the step's context before the AI speaks. |
232
+ | `quiet_wait` | start, agent | `tune` | `{ seconds, listen?, resume_speech? }` | Node-level wait. { seconds: 0 } turns the agent default off here. |
233
+ | `optional_slots` | start, agent | `tune` | `string[]` | Slots declared elsewhere that this step may record when the caller volunteers them. |
234
+ | `switch_agent_id` | agent | `tune` | `uuid` | A published agent this step hands the call to. |
235
+ | `opening_audio_url` | start | `tune` | `string` | kumion-asset:// upload (or a legacy allow-listed URL) played instead of TTS for the opening line. |
236
+ | `opening_audio_filename` | start | `internal` | `string` | Display name of the uploaded opening audio. |
237
+ | `precall_fetch_url` | start | `advanced` | `string` | URL fetched before the call starts; the response becomes call variables. |
238
+ | `precall_fetch_method` | start | `advanced` | `string` | HTTP method of the pre-call fetch. |
239
+ | `precall_fetch_headers` | start | `advanced` | `{ key, value }[]` | Headers of the pre-call fetch. |
240
+ | `no_response` | start, agent | `advanced` | `{ timeout_s, reprompt_speech?, max_reprompts, then }` | Node-level no-response timer. { timeout_s: 0 } turns the agent default off here. |
241
+ | `kb_fallback` | start, agent | `advanced` | `{ noResult?, unavailable? }` | Wording when a knowledge search finds nothing or is unavailable. Overrides the tenant operations setting. |
242
+ | `end_speech` | end | `required` | `string` | Default goodbye line. A connection into this node can override it. |
243
+ | `caller_leaves` | end | `required` | `boolean` | Marks the end a caller who walks away is sent to from every agent step, connected or not. Required on exactly one end when the flow has two or more end nodes. |
244
+ | `ivr` | ivr | `required` | `object` | Announcement, digit table and wait time. input and max_retries are fixed; other values are rejected. |
245
+ | `transfer` | transfer | `required` | `object` | Transfer target and the line spoken before transferring. |
246
+ | `notify` | notify | `required` | `object` | Recipients, subject and body templates. |
247
+ | `http_method` | webhook | `required` | `string` | GET, POST, PUT, PATCH or DELETE. |
248
+ | `endpoint_url` | webhook | `required` | `string` | Destination URL. |
249
+ | `payload_template` | webhook | `required` | `string` | Request body template with {{variables}}. |
250
+ | `custom_headers` | webhook | `advanced` | `{ key, value }[]` | Extra request headers. |
251
+ | `qa_system_prompt` | qa | `required` | `string` | Evaluation prompt. |
252
+ | `qa_sample_rate` | qa | `required` | `number` | Percentage of calls analysed, 1 to 100. |
253
+ | `qa_min_call_duration` | qa | `required` | `number` | Shortest call (seconds) that is analysed. |
254
+ | `qa_model` | qa | `advanced` | `string` | Model override for this analysis. |
255
+ | `qa_voicemail_calls` | qa | `advanced` | `boolean` | Whether voicemail calls are analysed (default true). |
256
+
257
+ A required item's 種類 is stored as a pair on the item: `source` and `value_type`.
258
+ These are the pairs the Portal offers:
259
+
260
+ | 種類 | `source` | `value_type` |
261
+ | --- | --- | --- |
262
+ | お客様の言葉のまま (`verbatim`) | `caller` | `text` |
263
+ | AIがまとめた内容 (`summary`) | `derived` | `text` |
264
+ | 番号 (`code`) | `caller` | `code` |
265
+ | 電話番号 (`phone`) | `caller` | `phone` |
266
+ | 生年月日 (`birthdate`) | `caller` | `birthdate` |
267
+ | 日時 (`datetime`) | `caller` | `datetime` |
268
+ | 選択肢 (`select`) | `derived` | `select` |
269
+ | ツールの結果 (`tool`) | `tool` | `text` |
270
+ <!-- END node-config-reference -->
271
+
272
+ The `internal` keys that are settings, not bookkeeping, have no Portal screen:
273
+
274
+ - `wait_cover` at the agent level (`model_config.wait_cover`): `threshold_ms`,
275
+ `on_threshold`, `on_query_start` and `query_grace_ms` have a card in the agent's 会話の運用 / edit screen (cascaded agents);
276
+ `text` and the repeat settings are API only. The node has a row in 「動きの調整」
277
+ for the first two; a node value overrides the agent's.
278
+ - `ivr.input` and `ivr.max_retries` (IVR nodes) — fixed. `input` must be one digit
279
+ with no finish key (`{ "mode": "single", "max_digits": 1, "finish_key": null }`)
280
+ and `max_retries` must be `0`; any other value makes the patch fail. Only
281
+ `ivr.timeout_ms` (3000–30000, default 8000) can change.
282
+
283
+ A required item whose 種類 is 選択肢 (`derived` / `select`) needs its options in
284
+ the item's `options`: the AI picks one of them and the write is checked
285
+ against the list. Give it at least two. There is no yes/no 種類; for yes/no, use 選択肢
286
+ with two options. A ツールの結果 (`tool` / `text`) item names its tool and result
287
+ field in the item's `tool` as `{ "tool_key": "…", "result_field": "…" }`;
288
+ only that tool succeeding at this step records it. Keys in `optional_slots` are
289
+ recorded only when the caller says them first; they are not required at that step.
73
290
 
74
291
  ## When it refuses
75
292
 
@@ -78,10 +295,24 @@ agent language setting. Those are Portal-only.
78
295
  tenant administrator (`kumion auth status` shows its expiry). The user re-runs
79
296
  `kumion auth login`.
80
297
  - **403 naming a scope** — the key lacks it (`agents:read`, `agents:write`,
81
- `agents:publish`, `tests:run`, `calls:create`, `calls:read`). The user issues a key with that scope
298
+ `agents:publish`, `agents:live`, `tests:run`, `calls:create`, `calls:read`). The user issues a key with that scope
82
299
  in the Portal (設定 → 開発者) and logs in again. Do not work around it.
83
300
  - **403 without a scope name** — the tenant's plan cannot publish, or `create_call` hit
84
301
  the call-minute limit. Tell the user; a new key does not help.
302
+ - **422 on publish with only a message** — a check before the test calls refused,
303
+ so no test ran. The body is `{ "error": "…" }`: no code, no test cases, no publish
304
+ run, and the CLI prints that message after `Server said:`. Most often it is the
305
+ dependency check. Its message is one Japanese sentence per problem, one per line,
306
+ each naming what is missing: コンタクト not connected, a コンタクト照合 item not set
307
+ or too few, the 予約カレンダー not connected, a tool the graph names that the
308
+ tenant does not have enabled, a 先に受け取れる項目 (`optional_slots` key) that no
309
+ step requires, or a connection whose condition reads a value nothing produces. The
310
+ other checks that answer the same way are an IVR node's settings, a transfer
311
+ target, a 会話の運用 move-to node, and a language that is no longer offered. Read
312
+ each line and fix what it names: a graph problem in the draft; a connection,
313
+ calendar or tool in the Portal, which you cannot change, so tell the user. Then
314
+ publish again. The CLI has no other way to list these reasons; in the Portal the
315
+ canvas's 「フローの問題」 list shows the dependency findings.
85
316
  - **429** — rate limited; wait the stated seconds.
86
317
 
87
318
  Callers hear what is published. Say clearly to the user what you changed in the draft,