@kumion/cli 0.3.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.
@@ -12,11 +12,19 @@ repository to clone and no local agent file to keep in sync — do not create on
12
12
  Two ways in, same operations and same permissions:
13
13
 
14
14
  - **MCP tools** when the host has the `kumion` MCP server registered. Each CLI
15
- command has one: `list_agents`, `get_agent`, `get_call_flow`, `update_call_flow`,
16
- `edit_call_flow_steps`, `patch_agent`, `publish_agent`, `start_test_run`,
17
- `get_test_run`, `list_staff`, `create_staff`, `update_staff`, `create_call`,
18
- `list_calls`, `get_call`, `get_call_transcript`, and the rest in
19
- `kumion --help`.
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`.
20
28
  - **The `kumion` CLI** otherwise (`kumion --help`). Add `--json` for machine-readable
21
29
  output.
22
30
 
@@ -59,7 +67,11 @@ A partner with several customers has one profile per customer tenant
59
67
  - Both accept `dryRun` / `--dry-run`: try it first and read the changes back.
60
68
  - `patch_agent` / `kumion agents patch` replaces the prompt or the whole graph. Use
61
69
  it only for a prompt-only agent or a change the two above cannot express, and
62
- send the whole edited graph, not a fragment.
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.
63
75
 
64
76
  The draft is not live.
65
77
  - **Conflict (409)**: someone saved the agent since you read it. Nothing was
@@ -82,6 +94,46 @@ A partner with several customers has one profile per customer tenant
82
94
  and have a phone number assigned) — only when the user asked to dial a real person.
83
95
  The outcome is on `get_call` / `kumion calls get`.
84
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.
136
+
85
137
  ## Reading real calls
86
138
 
87
139
  `list_calls` / `kumion calls list` pages through the call history (filter by agent,
@@ -94,7 +146,54 @@ silent call. Use a transcript to find where the agent went wrong before editing
94
146
  draft. Transcripts are the tenant's customers' conversations: quote only what the task
95
147
  needs.
96
148
 
97
- Not available over the Partner API (do not look for a command): conversation-edit mode, the knowledge base, bookings, external-tool limits, the agent
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
98
197
  language setting, a tool's display name (表示名), the agent's call-outcome categories
99
198
  (通話の結果), and the call model with its TTS voice. Those are Portal-only. A patch
100
199
  writes only `prompt` and `graph`; `agents get` shows the model and voice read-only.