@kumion/cli 0.6.10 → 0.6.11
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/README.md +36 -0
- package/dist/client.js +14 -0
- package/dist/data-ops.js +25 -1
- package/dist/main.js +89 -1
- package/dist/mcp.js +40 -0
- package/package.json +1 -1
- package/skills/kumion/SKILL.md +50 -1
package/README.md
CHANGED
|
@@ -150,6 +150,12 @@ would use.
|
|
|
150
150
|
| `kumion documents version-diff <documentId> --from <n> --to <n>` | `agents:read` |
|
|
151
151
|
| `kumion documents rollback <documentId> --target-version <n>` | `agents:live` (live: no publish) |
|
|
152
152
|
| `kumion analytics get [--agent <text>] [--channel <text>] [--from <text>] [--to <text>] [--spec <text>] [--field-key <text>]` | `analytics:read` |
|
|
153
|
+
| `kumion data-tables list` | `agents:read` (data tables need a plan that includes them) |
|
|
154
|
+
| `kumion data-tables get <tableId>` | `agents:read` (columns, their switches and the live version id) |
|
|
155
|
+
| `kumion data-tables rows <tableId> [--q <text>] [--filter <columnId>=<value> ...] [--offset <n>] [--limit <n>]` | `agents:read` |
|
|
156
|
+
| `kumion data-tables columns create <tableId> --data-file <path>` | `agents:live` (live: no publish) |
|
|
157
|
+
| `kumion data-tables columns update <tableId> <columnId> --patch-file <path>` | `agents:live` (live: no publish) |
|
|
158
|
+
| `kumion data-tables rows save <tableId> --base-version <id> --data-file <path> [--dry-run]` | `agents:live` (live: no publish; see [Data tables](#data-tables)) |
|
|
153
159
|
| `kumion hours get [--from <date>] [--to <date>] [--json]` | `agents:read` |
|
|
154
160
|
| `kumion hours update --revision <rev> [--business-hours-file <path>] [--closed-rules-file <path>] [--observe-jp-holidays true\|false] [--dry-run]` | `agents:live` (live: no publish) |
|
|
155
161
|
| `kumion hours exception set <date> --revision <rev> --kind closed\|open\|inherit [--hours-file <path>] [--note <text>] [--dry-run]` | `agents:live` (live: no publish) |
|
|
@@ -703,6 +709,36 @@ saving. A `--revision` that is no longer the draft's is refused with a 412 and n
|
|
|
703
709
|
and re-apply the change. `publish` is refused (422) while any finding is an error, and `--revision` makes it refuse
|
|
704
710
|
a draft that moved since you read it.
|
|
705
711
|
|
|
712
|
+
## Data tables
|
|
713
|
+
|
|
714
|
+
The tables a call looks up. Reads need `agents:read`, writes `agents:live`; a write is live, so the next call reads it
|
|
715
|
+
with no publish. The tenant's plan must include data tables.
|
|
716
|
+
|
|
717
|
+
```bash
|
|
718
|
+
kumion data-tables list
|
|
719
|
+
kumion data-tables get <tableId> # column ids, switches, liveVersionId
|
|
720
|
+
kumion data-tables rows <tableId> # rowUid, cells by column id, versionId
|
|
721
|
+
echo '{"name": "condition", "useFilter": true}' > column.json
|
|
722
|
+
kumion data-tables columns create <tableId> --data-file column.json
|
|
723
|
+
echo '{"useFilter": true}' > patch.json
|
|
724
|
+
kumion data-tables columns update <tableId> <columnId> --patch-file patch.json
|
|
725
|
+
kumion data-tables rows save <tableId> --base-version <versionId> --data-file rows.json --dry-run
|
|
726
|
+
kumion data-tables rows save <tableId> --base-version <versionId> --data-file rows.json
|
|
727
|
+
```
|
|
728
|
+
|
|
729
|
+
`rows.json` is `{"add": [{"cells": {…}}], "update": [{"rowUid": "…", "cells": {…}}], "delete": ["<rowUid>"]}`, with
|
|
730
|
+
cells keyed by column id.
|
|
731
|
+
|
|
732
|
+
- **An update replaces the row's cells.** Send every cell you want to keep; a column you leave out becomes empty. On a
|
|
733
|
+
table synced from a source, only your own columns that you pass change, and rows cannot be added or removed.
|
|
734
|
+
`--dry-run` shows each updated row before and after.
|
|
735
|
+
- A save naming a column or row the version does not have is refused (400). A save whose `--base-version` is no longer
|
|
736
|
+
live is refused (409) and writes nothing: read the rows again.
|
|
737
|
+
- A column added to a synced table is kept across syncs. On other tables, re-uploading a file without that column
|
|
738
|
+
leaves it empty.
|
|
739
|
+
- Saves by the same person in quick succession replace the previous hand-edited version instead of adding one.
|
|
740
|
+
- Deleting a table or column, renaming a table, and uploads or sync sources are done in the Portal.
|
|
741
|
+
|
|
706
742
|
## Use it from an AI coding assistant (MCP)
|
|
707
743
|
|
|
708
744
|
`kumion mcp` serves the same operations as MCP tools over stdio, for Claude Code,
|
package/dist/client.js
CHANGED
|
@@ -410,6 +410,20 @@ export class KumionClient {
|
|
|
410
410
|
const { body } = await this.request("POST", this.tenantPath(`/booking/services${options.dryRun ? "?dryRun=1" : ""}`), "agents:live", { body: input, ifMatch: revision });
|
|
411
411
|
return body;
|
|
412
412
|
}
|
|
413
|
+
async createDataTableColumn(tableId, column) {
|
|
414
|
+
const { body } = await this.request("POST", this.tenantPath(`/data-tables/${encodeURIComponent(tableId)}/columns`), "agents:live", {
|
|
415
|
+
body: column,
|
|
416
|
+
});
|
|
417
|
+
return body;
|
|
418
|
+
}
|
|
419
|
+
async updateDataTableColumn(tableId, columnId, patch) {
|
|
420
|
+
const { body } = await this.request("PATCH", this.tenantPath(`/data-tables/${encodeURIComponent(tableId)}/columns/${encodeURIComponent(columnId)}`), "agents:live", { body: patch });
|
|
421
|
+
return body;
|
|
422
|
+
}
|
|
423
|
+
async saveDataTableRows(tableId, edits, options = {}) {
|
|
424
|
+
const { body } = await this.request("POST", this.tenantPath(`/data-tables/${encodeURIComponent(tableId)}/rows/save${options.dryRun ? "?dryRun=1" : ""}`), "agents:live", { body: edits });
|
|
425
|
+
return body;
|
|
426
|
+
}
|
|
413
427
|
async updateBookingService(serviceId, patch, revision, options = {}) {
|
|
414
428
|
const { body } = await this.request("PATCH", this.tenantPath(`/booking/services/${encodeURIComponent(serviceId)}${options.dryRun ? "?dryRun=1" : ""}`), "agents:live", { body: patch, ifMatch: revision });
|
|
415
429
|
return body;
|
package/dist/data-ops.js
CHANGED
|
@@ -146,6 +146,24 @@ export const DATA_OPS = [
|
|
|
146
146
|
],
|
|
147
147
|
description: "The analytics screen's numbers; filters are the call list's. specId + fieldKey add that select field's distribution. Needs analytics:read.",
|
|
148
148
|
},
|
|
149
|
+
{
|
|
150
|
+
cli: "data-tables list", mcp: "list_data_tables", method: "GET", path: "/data-tables", scope: "agents:read",
|
|
151
|
+
description: "List the tenant's data tables (id, key, name). Needs agents:read.",
|
|
152
|
+
},
|
|
153
|
+
{
|
|
154
|
+
cli: "data-tables get", mcp: "get_data_table", method: "GET", path: "/data-tables/{tableId}", scope: "agents:read",
|
|
155
|
+
description: "Read one data table's columns (id, name, type, the search / filter / return-to-AI switches, origin) and its live version id. Needs agents:read.",
|
|
156
|
+
},
|
|
157
|
+
{
|
|
158
|
+
cli: "data-tables rows", mcp: "list_data_table_rows", method: "GET", path: "/data-tables/{tableId}/rows", scope: "agents:read",
|
|
159
|
+
query: [
|
|
160
|
+
{ name: "q", kind: "string", help: "search text over every column" },
|
|
161
|
+
{ name: "filters", kind: "map", flag: "filter", queryPrefix: "f.", help: "<columnId>=<value>, rows whose column contains the value (repeat the flag; an unknown column id is ignored)" },
|
|
162
|
+
{ name: "offset", kind: "number", help: "rows to skip" },
|
|
163
|
+
{ name: "limit", kind: "number", help: "page size (default 100, at most 1000)" },
|
|
164
|
+
],
|
|
165
|
+
description: "The rows of a data table's live version, keyed by column id, with versionId (the baseVersionId of a save), total and the columns. Needs agents:read.",
|
|
166
|
+
},
|
|
149
167
|
];
|
|
150
168
|
export function pathArgs(op) {
|
|
151
169
|
return [...op.path.matchAll(/\{(\w+)\}/g)].map((m) => m[1]);
|
|
@@ -156,7 +174,13 @@ export async function runDataOp(client, op, input) {
|
|
|
156
174
|
const query = new URLSearchParams();
|
|
157
175
|
for (const field of op.query ?? []) {
|
|
158
176
|
const value = input[field.name];
|
|
159
|
-
if (value
|
|
177
|
+
if (value === undefined || value === "")
|
|
178
|
+
continue;
|
|
179
|
+
if (field.queryPrefix) {
|
|
180
|
+
for (const [key, entry] of Object.entries(value))
|
|
181
|
+
query.set(`${field.queryPrefix}${key}`, entry);
|
|
182
|
+
}
|
|
183
|
+
else
|
|
160
184
|
query.set(field.name, String(value));
|
|
161
185
|
}
|
|
162
186
|
const qs = query.toString();
|
package/dist/main.js
CHANGED
|
@@ -6,7 +6,7 @@ import { ApiError, KumionClient, isTextFile, specText, } from "./client.js";
|
|
|
6
6
|
import { DEFAULT_BASE_URL, keyPrefix, looksLikeApiKey, normalizeBaseUrl, resolveCredentials, } from "./credentials.js";
|
|
7
7
|
import { DEFAULT_DEVICE_SCOPES, deviceLogin } from "./device-login.js";
|
|
8
8
|
import { describeError, ReportedFailure, UsageError } from "./errors.js";
|
|
9
|
-
export const VERSION = "0.6.
|
|
9
|
+
export const VERSION = "0.6.11";
|
|
10
10
|
const HELP = `kumion — manage your Kumion voice agents over the Partner API
|
|
11
11
|
|
|
12
12
|
Usage: kumion <command> [options]
|
|
@@ -242,6 +242,32 @@ Capture specs (記録項目 — what the agent records after a call)
|
|
|
242
242
|
call's summary is written from the new set, no publish
|
|
243
243
|
(needs agents:live)
|
|
244
244
|
|
|
245
|
+
Data tables (the tables a call looks up; plans with data tables only)
|
|
246
|
+
data-tables list List the tables: id, key, name (needs agents:read)
|
|
247
|
+
data-tables get <tableId> Show the columns (id, name, type, search / filter / return-to-AI
|
|
248
|
+
switches, origin) and the live version id
|
|
249
|
+
data-tables rows <tableId> [--q <text>] [--filter <columnId>=<value> ...] [--offset <n>] [--limit <n>]
|
|
250
|
+
List the live version's rows, keyed by column id. --filter keeps
|
|
251
|
+
rows whose column contains the value; an unknown column id is
|
|
252
|
+
ignored. The answer's versionId is the --base-version of a save
|
|
253
|
+
data-tables columns create <tableId> --data-file <path>
|
|
254
|
+
Add one column: name, optional type (text|number|amount|date),
|
|
255
|
+
useSearch, useFilter, returnToAi, isAlias, position. On a table
|
|
256
|
+
synced from a source the column is kept across syncs. LIVE: the
|
|
257
|
+
next call reads it, no publish (needs agents:live)
|
|
258
|
+
data-tables columns update <tableId> <columnId> --patch-file <path>
|
|
259
|
+
Change a column; an omitted field is left alone. LIVE, no
|
|
260
|
+
publish (needs agents:live)
|
|
261
|
+
data-tables rows save <tableId> --base-version <id> --data-file <path> [--dry-run]
|
|
262
|
+
Save {"add": [{"cells": {<columnId>: <text>}}],
|
|
263
|
+
"update": [{"rowUid": ..., "cells": {...}}], "delete": [rowUid]}
|
|
264
|
+
as one new version. An update REPLACES the row's cells: send
|
|
265
|
+
every cell to keep (on a synced table only your own columns you
|
|
266
|
+
pass change, and rows cannot be added or removed). 409, nothing
|
|
267
|
+
written, when the table changed since --base-version. LIVE: the
|
|
268
|
+
next call reads it, no publish (needs agents:live). --dry-run
|
|
269
|
+
prints what would change and saves nothing
|
|
270
|
+
|
|
245
271
|
Documents (資料 — the source an agent's facts are extracted from)
|
|
246
272
|
documents upload (--text-file <path> | --file <path> [--file <path> ...])
|
|
247
273
|
--title <title> --idempotency-key <key> [--template <templateId>] [--dry-run]
|
|
@@ -460,6 +486,9 @@ export const COMMANDS = {
|
|
|
460
486
|
"capture-specs update": captureSpecsUpdate,
|
|
461
487
|
"agents capture get": agentsCaptureGet,
|
|
462
488
|
"agents capture set": agentsCaptureSet,
|
|
489
|
+
"data-tables columns create": dataTablesColumnsCreate,
|
|
490
|
+
"data-tables columns update": dataTablesColumnsUpdate,
|
|
491
|
+
"data-tables rows save": dataTablesRowsSave,
|
|
463
492
|
"documents upload": documentsUpload,
|
|
464
493
|
"documents jobs get": documentsJobsGet,
|
|
465
494
|
"documents get": documentsGet,
|
|
@@ -2454,6 +2483,65 @@ function dataOpHandler(op) {
|
|
|
2454
2483
|
return 0;
|
|
2455
2484
|
};
|
|
2456
2485
|
}
|
|
2486
|
+
async function dataTablesColumnsCreate(args, deps) {
|
|
2487
|
+
const { values, positionals } = parse(args, { "data-file": { type: "string" } });
|
|
2488
|
+
const tableId = need(positionals, 0, "tableId");
|
|
2489
|
+
if (values["data-file"] === undefined) {
|
|
2490
|
+
throw new UsageError("Pass --data-file <path> holding name, and optionally type, useSearch, useFilter, returnToAi, isAlias, position.");
|
|
2491
|
+
}
|
|
2492
|
+
const column = await readJsonObjectFile(values["data-file"]);
|
|
2493
|
+
const result = await (await clientFor(values, deps)).createDataTableColumn(tableId, column);
|
|
2494
|
+
if (values.json) {
|
|
2495
|
+
printJson(deps, result);
|
|
2496
|
+
return 0;
|
|
2497
|
+
}
|
|
2498
|
+
deps.io.out(`Added column ${result.column.id} ${result.column.name} (${result.column.type})`);
|
|
2499
|
+
deps.io.out("Saved and live now — no publish needed; the next call reads it.");
|
|
2500
|
+
return 0;
|
|
2501
|
+
}
|
|
2502
|
+
async function dataTablesColumnsUpdate(args, deps) {
|
|
2503
|
+
const { values, positionals } = parse(args, { "patch-file": { type: "string" } });
|
|
2504
|
+
const tableId = need(positionals, 0, "tableId");
|
|
2505
|
+
const columnId = need(positionals, 1, "columnId");
|
|
2506
|
+
if (values["patch-file"] === undefined) {
|
|
2507
|
+
throw new UsageError("Pass --patch-file <path> holding any of name, type, useSearch, useFilter, returnToAi, isAlias.");
|
|
2508
|
+
}
|
|
2509
|
+
const patch = await readJsonObjectFile(values["patch-file"]);
|
|
2510
|
+
const result = await (await clientFor(values, deps)).updateDataTableColumn(tableId, columnId, patch);
|
|
2511
|
+
printJson(deps, result);
|
|
2512
|
+
if (!values.json)
|
|
2513
|
+
deps.io.out("Saved and live now — no publish needed; the next call reads it.");
|
|
2514
|
+
return 0;
|
|
2515
|
+
}
|
|
2516
|
+
async function dataTablesRowsSave(args, deps) {
|
|
2517
|
+
const { values, positionals } = parse(args, {
|
|
2518
|
+
"base-version": { type: "string" },
|
|
2519
|
+
"data-file": { type: "string" },
|
|
2520
|
+
"dry-run": { type: "boolean" },
|
|
2521
|
+
});
|
|
2522
|
+
const tableId = need(positionals, 0, "tableId");
|
|
2523
|
+
const baseVersionId = values["base-version"];
|
|
2524
|
+
if (!baseVersionId)
|
|
2525
|
+
throw new UsageError("Pass --base-version <id> — the versionId `data-tables rows` answered.");
|
|
2526
|
+
if (values["data-file"] === undefined)
|
|
2527
|
+
throw new UsageError("Pass --data-file <path> holding add, update and/or delete.");
|
|
2528
|
+
const file = await readJsonObjectFile(values["data-file"]);
|
|
2529
|
+
const unknown = Object.keys(file).filter((key) => !["add", "update", "delete"].includes(key));
|
|
2530
|
+
if (unknown.length > 0)
|
|
2531
|
+
throw new UsageError(`--data-file holds add, update and delete only; found ${unknown.join(", ")}.`);
|
|
2532
|
+
const result = await (await clientFor(values, deps)).saveDataTableRows(tableId, { ...file, baseVersionId }, { dryRun: values["dry-run"] });
|
|
2533
|
+
if (values.json) {
|
|
2534
|
+
printJson(deps, result);
|
|
2535
|
+
return 0;
|
|
2536
|
+
}
|
|
2537
|
+
if (values["dry-run"]) {
|
|
2538
|
+
deps.io.out("Dry run: nothing was saved. The save would change:");
|
|
2539
|
+
printJson(deps, result);
|
|
2540
|
+
return 0;
|
|
2541
|
+
}
|
|
2542
|
+
deps.io.out(`Saved and live now — no publish needed. New version: ${String(result.versionId)} (${String(result.rowCount)} rows)`);
|
|
2543
|
+
return 0;
|
|
2544
|
+
}
|
|
2457
2545
|
async function callsList(args, deps) {
|
|
2458
2546
|
const { values } = parse(args, {
|
|
2459
2547
|
agent: { type: "string" },
|
package/dist/mcp.js
CHANGED
|
@@ -1160,6 +1160,46 @@ export function createKumionMcpServer(client, options) {
|
|
|
1160
1160
|
inputSchema: { chatAgentId },
|
|
1161
1161
|
annotations: { readOnlyHint: true },
|
|
1162
1162
|
}, (args) => attempt(() => client.listChatAgentVersions(args.chatAgentId)));
|
|
1163
|
+
const columnSettings = {
|
|
1164
|
+
type: z.enum(["text", "number", "amount", "date"]).optional().describe("Column type."),
|
|
1165
|
+
useSearch: z.boolean().optional().describe("Searched by the table lookup."),
|
|
1166
|
+
useFilter: z.boolean().optional().describe("Usable as a filter condition by the lookup."),
|
|
1167
|
+
returnToAi: z.boolean().optional().describe("Returned to the AI in a lookup result."),
|
|
1168
|
+
isAlias: z.boolean().optional().describe("Holds other names for the row."),
|
|
1169
|
+
};
|
|
1170
|
+
const cells = z.record(z.string(), z.string()).describe("Cell text by column id.");
|
|
1171
|
+
server.registerTool("create_data_table_column", {
|
|
1172
|
+
description: "Add one column to a data table; existing rows get an empty cell. On a table synced from a source the column is kept across syncs. LIVE: the next call reads it, no publish — confirm with the person first. Needs agents:live.",
|
|
1173
|
+
inputSchema: {
|
|
1174
|
+
tableId: z.string().min(1).describe("The tableId."),
|
|
1175
|
+
name: z.string().min(1).describe("Column name (at most 100 characters)."),
|
|
1176
|
+
...columnSettings,
|
|
1177
|
+
position: z.number().int().min(0).optional().describe("0 is first; omitted appends."),
|
|
1178
|
+
},
|
|
1179
|
+
annotations: { destructiveHint: true, idempotentHint: false },
|
|
1180
|
+
}, ({ tableId, ...column }) => attempt(() => client.createDataTableColumn(tableId, column)));
|
|
1181
|
+
server.registerTool("update_data_table_column", {
|
|
1182
|
+
description: "Change a data table column's name, type or switches; an omitted field is left alone. A type change answers parseFailures, the cells that no longer read as the type. LIVE: the next call reads it, no publish — confirm with the person first. Needs agents:live.",
|
|
1183
|
+
inputSchema: {
|
|
1184
|
+
tableId: z.string().min(1).describe("The tableId."),
|
|
1185
|
+
columnId: z.string().min(1).describe("The columnId, from get_data_table."),
|
|
1186
|
+
name: z.string().min(1).optional().describe("New name."),
|
|
1187
|
+
...columnSettings,
|
|
1188
|
+
},
|
|
1189
|
+
annotations: { destructiveHint: true, idempotentHint: true },
|
|
1190
|
+
}, ({ tableId, columnId, ...patch }) => attempt(() => client.updateDataTableColumn(tableId, columnId, patch)));
|
|
1191
|
+
server.registerTool("save_data_table_rows", {
|
|
1192
|
+
description: "Save row edits to a data table as one new version. An update REPLACES the row's cells, so send every cell to keep (on a synced table only your own columns you pass change, and rows cannot be added or removed). Refused with 409, writing nothing, when the table changed since baseVersionId. LIVE: the next call reads it, no publish — run with dryRun first and confirm with the person. Needs agents:live.",
|
|
1193
|
+
inputSchema: {
|
|
1194
|
+
tableId: z.string().min(1).describe("The tableId."),
|
|
1195
|
+
baseVersionId: z.string().min(1).describe("The versionId from list_data_table_rows."),
|
|
1196
|
+
add: z.array(z.object({ cells })).optional().describe("Rows to add."),
|
|
1197
|
+
update: z.array(z.object({ rowUid: z.string(), cells })).optional().describe("Rows to change."),
|
|
1198
|
+
delete: z.array(z.string()).optional().describe("rowUid of each row to delete."),
|
|
1199
|
+
dryRun: z.boolean().optional().describe("true: answer with what would change and save nothing."),
|
|
1200
|
+
},
|
|
1201
|
+
annotations: { destructiveHint: true, idempotentHint: false },
|
|
1202
|
+
}, ({ tableId, dryRun, ...edits }) => attempt(() => client.saveDataTableRows(tableId, edits, { dryRun })));
|
|
1163
1203
|
for (const op of DATA_OPS) {
|
|
1164
1204
|
server.registerTool(op.mcp, {
|
|
1165
1205
|
description: op.description,
|
package/package.json
CHANGED
package/skills/kumion/SKILL.md
CHANGED
|
@@ -13,7 +13,7 @@ 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
15
|
command has one: `list_agents`, `get_agent`, `get_agent_spec`, `patch_agent`,
|
|
16
|
-
`publish_agent`, `list_chat_agents`, `get_chat_agent`, `get_chat_agent_draft`, `update_chat_agent_draft`, `get_chat_agent_diagnostics`, `publish_chat_agent`, `list_chat_agent_versions`, `get_call_flow`, `update_call_flow`, `edit_call_flow_steps`,
|
|
16
|
+
`publish_agent`, `list_chat_agents`, `get_chat_agent`, `get_chat_agent_draft`, `update_chat_agent_draft`, `get_chat_agent_diagnostics`, `publish_chat_agent`, `list_chat_agent_versions`, `list_data_tables`, `get_data_table`, `list_data_table_rows`, `create_data_table_column`, `update_data_table_column`, `save_data_table_rows`, `get_call_flow`, `update_call_flow`, `edit_call_flow_steps`,
|
|
17
17
|
`set_agent_opening_name`, `set_agent_availability`, `get_webcall_access`, `set_webcall_access`, `list_widget_signing_keys`, `create_widget_signing_key`, `revoke_widget_signing_key`, `delete_document`, `create_agent_from_template`,
|
|
18
18
|
`list_agent_templates`, `list_facts`, `edit_fact`, `confirm_facts`,
|
|
19
19
|
`list_staff`, `create_staff`, `update_staff`, `get_store_hours`,
|
|
@@ -65,6 +65,8 @@ A partner with several customers has one profile per customer tenant
|
|
|
65
65
|
`kumion flow edit-steps <agentId> --revision <rev> --ops-file <path>`. A batch of
|
|
66
66
|
`{ "op": …, …arguments }` from `set_node_field`, `set_edge_words`, `add_step`,
|
|
67
67
|
`remove_step`, `connect_steps`, `reconnect`, `disconnect`. It is all or nothing.
|
|
68
|
+
- Before writing a prompt or a connection's words, read 「Writing node prompts, connections
|
|
69
|
+
and tools」 below.
|
|
68
70
|
- Both accept `dryRun` / `--dry-run`: try it first and read the changes back.
|
|
69
71
|
- `patch_agent` / `kumion agents patch` replaces the prompt or the whole graph. Use
|
|
70
72
|
it only for a prompt-only agent or a change the two above cannot express, and
|
|
@@ -148,6 +150,46 @@ number. `--json` everywhere; the names below are the CLI's, the MCP tool is in t
|
|
|
148
150
|
`publishState.live: true`, `unpublishedChanges: false`, and the publish answer's
|
|
149
151
|
`agent.publishedSnapshotId`. `unconfirmedFacts` above zero means the agent is not finished.
|
|
150
152
|
|
|
153
|
+
## Writing node prompts, connections and tools
|
|
154
|
+
|
|
155
|
+
Follow these from the first version of a voice flow, whatever model answers the call. The
|
|
156
|
+
model reads a node's prompt as instructions, a connection's `condition` as the description of
|
|
157
|
+
the tool that takes it, and a tool's own description as the reason to call it. Tools and a data
|
|
158
|
+
table's description are written in the Portal (a tool's 「いつ呼ぶか」, a table's description), not
|
|
159
|
+
with this CLI; the same rules apply when you tell the user what to put there.
|
|
160
|
+
|
|
161
|
+
1. **One tool, one meaning, and say when not to use it.** Name the one case that calls it,
|
|
162
|
+
then the near cases that must not and what to do in them. Wording does not separate every
|
|
163
|
+
pair of cases: test both sides with `turns`.
|
|
164
|
+
- Not: "Use when the caller cannot answer." (also read as "I have to check first")
|
|
165
|
+
- Evidence: ORB-5171, ORB-5174.
|
|
166
|
+
2. **Never write that a step moves on or ends without speaking.** The caller has just said
|
|
167
|
+
something; leave the model free to answer it before it moves. Do not ask it to repeat what
|
|
168
|
+
the platform says on the way: a connection's `transitionSpeech` and an end step's
|
|
169
|
+
`end_speech`.
|
|
170
|
+
- Not: "If the caller cannot choose a time, go to the end without speaking."
|
|
171
|
+
- Evidence: ORB-5174.
|
|
172
|
+
3. **Put instructions in a prompt, not status sentences, asides or bracketed notes.** The
|
|
173
|
+
model may say them to the caller, or repeat the step's internal instructions. State what to
|
|
174
|
+
do, and when (if ever) the caller should hear about something already done; leave a
|
|
175
|
+
lookup's or a send's outcome to the tool result.
|
|
176
|
+
- Not: "The confirmation message has been sent. Do not resend it." or "(message sent)"
|
|
177
|
+
- Instead: "Ask whether there is anything else. The message went out before this step, so
|
|
178
|
+
do not offer to send it again, and mention it only if the caller asks."
|
|
179
|
+
- Evidence: ORB-5161, ORB-5129.
|
|
180
|
+
4. **Do not leave the model a turn where its job is to wait or stay quiet.** It may speak a
|
|
181
|
+
stage direction such as "(waiting)". Where a step needs the caller to go and do something,
|
|
182
|
+
set `quiet_wait` on that node (the platform waits after the AI has spoken, once per entry
|
|
183
|
+
into the node) instead of describing the wait in the prompt.
|
|
184
|
+
- Not: "After the caller agrees, say one short line and wait for their next utterance."
|
|
185
|
+
- Evidence: ORB-5171, ORB-5174.
|
|
186
|
+
5. **A lookup returns one row, or the prompt says how to choose among several.** Make the
|
|
187
|
+
columns that tell rows apart filters of the data table, and have the step collect their
|
|
188
|
+
values before it looks up.
|
|
189
|
+
- Not: searching a price table by plan name alone when two rows match and differ by
|
|
190
|
+
eligibility.
|
|
191
|
+
- Evidence: ORB-5161.
|
|
192
|
+
|
|
151
193
|
## Chat agents (チャットエージェント)
|
|
152
194
|
|
|
153
195
|
A chat agent is the text agent: its own ids (`list_chat_agents` / `kumion chat-agents list`, never `list_agents`), its
|
|
@@ -371,6 +413,13 @@ These cover what the Portal's 顧客, 通話 and 分析 screens already do. Each
|
|
|
371
413
|
- `get_document_history`, `get_document_version_diff` (`agents:read`); `rollback_document` (`agents:live`): LIVE, the next call reads the restored version with no publish, so confirm with the person first.
|
|
372
414
|
- `get_analytics` (`analytics:read`).
|
|
373
415
|
|
|
416
|
+
## Data tables
|
|
417
|
+
|
|
418
|
+
- `list_data_tables`, `get_data_table`, `list_data_table_rows` (`agents:read`): `kumion data-tables list | get <tableId> | rows <tableId>`. Cells are keyed by column id.
|
|
419
|
+
- `create_data_table_column`, `update_data_table_column`, `save_data_table_rows` (`agents:live`): `kumion data-tables columns create | columns update | rows save`. LIVE, the next call reads it with no publish, so confirm with the person first.
|
|
420
|
+
- An update in `rows save` replaces the row's cells: start from the cells `rows` answered and change them. Run `--dry-run` first and show the person the before and after. A 409 means the table moved on: read the rows again.
|
|
421
|
+
- Nothing here deletes a table or column; tables are created, renamed, uploaded and synced in the Portal.
|
|
422
|
+
|
|
374
423
|
## When it refuses
|
|
375
424
|
|
|
376
425
|
- **401** — key wrong, revoked, expired, or for another tenant. A personal key from
|