@kumion/cli 0.5.0 → 0.6.1
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 +22 -5
- package/dist/client.js +9 -4
- package/dist/errors.js +6 -0
- package/dist/main.js +51 -17
- package/dist/mcp.js +14 -3
- package/package.json +1 -1
- package/skills/kumion/SKILL.md +12 -3
package/README.md
CHANGED
|
@@ -15,7 +15,7 @@ npm i -g @kumion/cli
|
|
|
15
15
|
kumion --help
|
|
16
16
|
```
|
|
17
17
|
|
|
18
|
-
Requires Node.js 20.18 or later.
|
|
18
|
+
Requires Node.js 20.18.1 or later.
|
|
19
19
|
|
|
20
20
|
By default the CLI talks to `https://app.kumion.jp`. Another environment can be
|
|
21
21
|
selected with `--base-url` or `KUMION_API_BASE` (see [Options and environment](#options-and-environment)).
|
|
@@ -106,7 +106,7 @@ would use.
|
|
|
106
106
|
| `kumion agents get <agentId> [--json]` | `agents:read` |
|
|
107
107
|
| `kumion agents spec <agentId> [--version published\|draft\|<n>] [--format pdf\|docx\|markdown] [--out <path>]` | `agents:read` (the 応対仕様書 as a file: PDF by default, Word and Markdown too; `--out`, or a file in the current directory for PDF/Word) |
|
|
108
108
|
| `kumion agents patch <agentId> --revision <rev> [--prompt <text> \| --prompt-file <path>] [--graph-file <path>]` | `agents:write` |
|
|
109
|
-
| `kumion agents publish <agentId> [--revision <rev>]` | `agents:publish` |
|
|
109
|
+
| `kumion agents publish <agentId> [--revision <rev>] [--accept-intermittent]` | `agents:publish` |
|
|
110
110
|
| `kumion agents opening-name <agentId> --revision <rev> (--on \| --off)` | `agents:write` (a draft write: live after the next publish) |
|
|
111
111
|
| `kumion agents availability <agentId> --revision <rev> [--operating-hours-file <path>] [--off-hours-file <path>]` | `agents:live` (live: no publish) |
|
|
112
112
|
| `kumion agents create-from-template --template <id> --business-name <name> [--name <name>] [--url <url> \| --document <documentId>] [--idempotency-key <key>]` | `agents:write` (a `url` makes it read an external site and call the model; the key makes a resend return the first agent) |
|
|
@@ -145,7 +145,7 @@ would use.
|
|
|
145
145
|
| `kumion test-runs list <agentId>` | `tests:run` |
|
|
146
146
|
| `kumion calls create <agentId> [--to <phone>] [--campaign-contact <id>] [--var <name>=<value> ...]` | `calls:create` |
|
|
147
147
|
| `kumion calls list [--agent <id>] [--channel webcall\|sip_did\|trigger] [--from <iso>] [--to <iso>] [--search <text>] [--limit <n>] [--offset <n>]` | `calls:read` |
|
|
148
|
-
| `kumion scheduled-calls create <agentId> --to <phone> --at <iso8601-with-offset
|
|
148
|
+
| `kumion scheduled-calls create <agentId> --to <phone> --at <iso8601-with-offset> [--var <name>=<value> ...]` | `calls:create` |
|
|
149
149
|
| `kumion scheduled-calls list` | `calls:read` |
|
|
150
150
|
| `kumion scheduled-calls cancel <id>` | `calls:create` |
|
|
151
151
|
| `kumion calls get <callId>` | `calls:read` |
|
|
@@ -153,7 +153,9 @@ would use.
|
|
|
153
153
|
|
|
154
154
|
A command whose key lacks the scope fails with a message naming the scope it needs.
|
|
155
155
|
|
|
156
|
-
`scheduled-calls create`
|
|
156
|
+
`scheduled-calls create` takes `--var <name>=<value>` (repeatable; MCP `variables`) like `calls create`; see
|
|
157
|
+
"Per-call variables". The values are stored with the schedule and handed to the call when it is placed.
|
|
158
|
+
It places one dial at the time you give: `--at` must carry a timezone offset
|
|
157
159
|
(`2026-10-31T13:00:00+09:00`; a bare `13:00` is refused), be in the future, and the number a domestic one.
|
|
158
160
|
The dial happens once, with no automatic redial. It is refused with 403 when the tenant's automatic
|
|
159
161
|
outbound dialing is off or the plan is `free`, and with 409 when that number already has a scheduled or
|
|
@@ -220,6 +222,14 @@ body: an object of strings, at most 50 names, 1000 characters per value, 10000 i
|
|
|
220
222
|
larger or non-string value is a 400 naming the item). With `--campaign-contact`, the list row's
|
|
221
223
|
columns are the base and `--var` wins. A name that is not passed reads as an empty string.
|
|
222
224
|
|
|
225
|
+
The flag splits at the first `=` (`--var url=https://x.test/?a=b` keeps the second one in the value;
|
|
226
|
+
`--var tag=` is an empty value). `--var foo` and `--var =x` are refused before anything is sent.
|
|
227
|
+
A name takes letters, digits and `_` only. Passing the same name twice keeps the last one. With no `--var`
|
|
228
|
+
the request carries no `variables`. A variable the agent's published version marks 必須 must be given a
|
|
229
|
+
value: otherwise the call is not placed (`calls create`) or not scheduled (`scheduled-calls create`), with
|
|
230
|
+
`400 missing_variables` and the names in `missing`. `scheduled-calls create` takes `--var` the same way and
|
|
231
|
+
checks the same rules at the time you schedule, not when the dial happens.
|
|
232
|
+
|
|
223
233
|
### Dialing a phone
|
|
224
234
|
|
|
225
235
|
`calls create <agentId> --to 08012345678` places a real call from the phone number assigned to
|
|
@@ -353,6 +363,9 @@ A key a node does not store follows the agent's setting (会話の運用) or the
|
|
|
353
363
|
| `opening_speech` | start | `required` | `string` | The opening line. Supports {{variables}}. |
|
|
354
364
|
| `items` | start, agent | `required` | `{key,label?,example?,source?,value_type?,options?,must_ask?,min_digits?,max_digits?,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). `min_digits` / `max_digits`: for a `code` item, the fewest / most digits the value may hold, counted by the platform (the same number twice = exact length). `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). |
|
|
355
365
|
| `allow_interruptions` | start, agent | `tune` | `boolean` | Absent means the caller may interrupt. Only an explicit false is stored. |
|
|
366
|
+
| `route_judge` | start | `tune` | `boolean` | Absent means off. Only an explicit true is stored. On: while the call stays on this start step, each caller turn is first read by the call model's own probability readout (at most 400 ms, before the AI answers); when it is sure which of the step's three connections fits, the call moves on without a model turn. Offered only for a call model whose endpoint has a calibrated readout; the step needs exactly three AI connections without items and no fixed connections (graph diagnostics `route_judge_not_applicable`). |
|
|
367
|
+
| `wait_for_first_word` | start | `tune` | `boolean` | Absent means off. Only an explicit true is stored. On: an outbound call waits for the customer to speak first and says the opening line when they finish or `first_word_wait_seconds` runs out. An inbound call never reads it (graph diagnostics `first_word_wait_outbound_only`). |
|
|
368
|
+
| `first_word_wait_seconds` | start | `tune` | `number` | Seconds `wait_for_first_word` waits (1 to 10, default 3). Absent means the default. Read only when `wait_for_first_word` is true. |
|
|
356
369
|
| `respond_on_enter` | agent | `tune` | `boolean` | Absent means the node answers on arrival. Only an explicit false (wait for the caller) is stored. |
|
|
357
370
|
| `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. |
|
|
358
371
|
| `confirm_before_end_keys` | agent | `internal` | `string[]` | Set by the compiler on a 伝言 step. With `confirm_before_end` on, the end readback reads only these item keys (the call-back number); absent means every item the ending requires. |
|
|
@@ -413,7 +426,11 @@ kumion agents publish <agentId> # runs the pre-publish check, then publishe
|
|
|
413
426
|
`test-runs start` checks the draft without publishing anything. `agents publish` runs
|
|
414
427
|
the Portal's pre-publish check and publishes only when it passes; when it does not, the
|
|
415
428
|
failing cases are printed and nothing goes live. The CLI has no way to skip or override
|
|
416
|
-
|
|
429
|
+
a case that failed again on re-run (`[reproduced]`). A refusal that carries no re-run verdict (for example a structural problem) is not intermittent either: fix its cause. The one exception: a case that failed only in some of its re-runs is marked
|
|
430
|
+
`[intermittent]` (one that failed again is `[reproduced]`), and when nothing else is wrong the refusal
|
|
431
|
+
says so and `agents publish <agentId> --accept-intermittent` (MCP: `acceptIntermittent`) publishes it
|
|
432
|
+
anyway. It never applies to a check that failed every time. `test-runs get` marks the same cases and lists
|
|
433
|
+
each re-run's outcome. When a check before the test calls refuses (most often the dependency check:
|
|
417
434
|
コンタクト or the booking calendar not connected, a tool not enabled), there are no
|
|
418
435
|
cases to print: the server's message after `Server said:` is the whole reason, one
|
|
419
436
|
problem per line.
|
package/dist/client.js
CHANGED
|
@@ -236,9 +236,9 @@ export class KumionClient {
|
|
|
236
236
|
});
|
|
237
237
|
return body;
|
|
238
238
|
}
|
|
239
|
-
async publishAgent(agentId, revision) {
|
|
239
|
+
async publishAgent(agentId, revision, options = {}) {
|
|
240
240
|
const { body } = await this.request("POST", this.agentPath(agentId, "/publish"), "agents:publish", {
|
|
241
|
-
body: {},
|
|
241
|
+
body: options.acceptIntermittent ? { acceptIntermittent: true } : {},
|
|
242
242
|
ifMatch: revision,
|
|
243
243
|
});
|
|
244
244
|
return body;
|
|
@@ -277,10 +277,15 @@ export class KumionClient {
|
|
|
277
277
|
const { body } = await this.request("GET", this.tenantPath(`/calls${qs ? `?${qs}` : ""}`), "calls:read");
|
|
278
278
|
return body;
|
|
279
279
|
}
|
|
280
|
-
async createScheduledCall(agentId, phoneNumber, scheduledAt) {
|
|
280
|
+
async createScheduledCall(agentId, phoneNumber, scheduledAt, variables) {
|
|
281
281
|
try {
|
|
282
282
|
const { body } = await this.request("POST", this.tenantPath("/scheduled-calls"), "calls:create", {
|
|
283
|
-
body: {
|
|
283
|
+
body: {
|
|
284
|
+
agentId,
|
|
285
|
+
phoneNumber,
|
|
286
|
+
scheduledAt,
|
|
287
|
+
...(variables && Object.keys(variables).length > 0 ? { variables } : {}),
|
|
288
|
+
},
|
|
284
289
|
});
|
|
285
290
|
return body;
|
|
286
291
|
}
|
package/dist/errors.js
CHANGED
|
@@ -46,6 +46,12 @@ export function describeApiError(err) {
|
|
|
46
46
|
if (err.code === "invalid_version") {
|
|
47
47
|
return `--version takes published, draft, or a version number (400 invalid_version).${serverSaid(err)}`;
|
|
48
48
|
}
|
|
49
|
+
if (err.code === "missing_variables") {
|
|
50
|
+
const missing = Array.isArray(err.body.missing) ? err.body.missing.map(String).join(", ") : "";
|
|
51
|
+
return (`The call was not placed (400 missing_variables): the agent's published version has 必須 call variables that were ` +
|
|
52
|
+
`left empty${missing ? ` (${missing})` : ""}. Nothing was dialed or scheduled. Pass each one as ` +
|
|
53
|
+
`\`--var <name>=<value>\`.${serverSaid(err)}`);
|
|
54
|
+
}
|
|
49
55
|
return `Request failed (400).${serverSaid(err)}`;
|
|
50
56
|
case 404:
|
|
51
57
|
if (err.code === "not_published") {
|
package/dist/main.js
CHANGED
|
@@ -5,7 +5,7 @@ import { ApiError, KumionClient, isTextFile, specText, } from "./client.js";
|
|
|
5
5
|
import { DEFAULT_BASE_URL, keyPrefix, looksLikeApiKey, normalizeBaseUrl, resolveCredentials, } from "./credentials.js";
|
|
6
6
|
import { DEFAULT_DEVICE_SCOPES, deviceLogin } from "./device-login.js";
|
|
7
7
|
import { describeError, ReportedFailure, UsageError } from "./errors.js";
|
|
8
|
-
export const VERSION = "0.
|
|
8
|
+
export const VERSION = "0.6.1";
|
|
9
9
|
const HELP = `kumion — manage your Kumion voice agents over the Partner API
|
|
10
10
|
|
|
11
11
|
Usage: kumion <command> [options]
|
|
@@ -34,7 +34,7 @@ Agents
|
|
|
34
34
|
出力日時 on the cover is the moment of the export
|
|
35
35
|
agents patch <agentId> --revision <rev> [--prompt <text> | --prompt-file <path>] [--graph-file <path>]
|
|
36
36
|
Edit the draft (never goes live by itself)
|
|
37
|
-
agents publish <agentId> [--revision <rev>]
|
|
37
|
+
agents publish <agentId> [--revision <rev>] [--accept-intermittent]
|
|
38
38
|
Publish the draft through the pre-publish check
|
|
39
39
|
agents opening-name <agentId> --revision <rev> (--on | --off)
|
|
40
40
|
Whether the opening line uses the caller's name (a draft write:
|
|
@@ -196,7 +196,7 @@ Calls
|
|
|
196
196
|
calls list [--agent <id>] [--channel webcall|sip_did|trigger] [--from <iso>] [--to <iso>]
|
|
197
197
|
[--search <text>] [--limit <n>] [--offset <n>]
|
|
198
198
|
List the tenant's call history, newest first (20 per page)
|
|
199
|
-
scheduled-calls create <agentId> --to <phone> --at <iso8601-with-offset>
|
|
199
|
+
scheduled-calls create <agentId> --to <phone> --at <iso8601-with-offset> [--var <name>=<value> ...]
|
|
200
200
|
Schedule one dial at that time (e.g. 2026-10-31T13:00:00+09:00)
|
|
201
201
|
scheduled-calls list List the dials scheduled through the API, newest first
|
|
202
202
|
scheduled-calls cancel <id> Cancel a scheduled dial that has not started
|
|
@@ -1562,16 +1562,19 @@ async function factsConfirm(args, deps) {
|
|
|
1562
1562
|
}
|
|
1563
1563
|
return 0;
|
|
1564
1564
|
}
|
|
1565
|
+
function gateTag(gate) {
|
|
1566
|
+
return gate ? ` [${gate}]` : "";
|
|
1567
|
+
}
|
|
1565
1568
|
function formatFindings(findings, indent) {
|
|
1566
1569
|
return (findings ?? []).map((f) => `${indent}- ${f.kind}${f.nodeKey ? ` @${f.nodeKey}` : ""}: ${f.detail}`);
|
|
1567
1570
|
}
|
|
1568
1571
|
async function agentsPublish(args, deps) {
|
|
1569
|
-
const { values, positionals } = parse(args, { revision: { type: "string" } });
|
|
1572
|
+
const { values, positionals } = parse(args, { revision: { type: "string" }, "accept-intermittent": { type: "boolean" } });
|
|
1570
1573
|
const agentId = need(positionals, 0, "agentId");
|
|
1571
1574
|
const client = await clientFor(values, deps);
|
|
1572
1575
|
deps.io.err("Publishing — the pre-publish check runs first and can take a few minutes…");
|
|
1573
1576
|
try {
|
|
1574
|
-
const result = await client.publishAgent(agentId, values.revision);
|
|
1577
|
+
const result = await client.publishAgent(agentId, values.revision, { acceptIntermittent: values["accept-intermittent"] === true });
|
|
1575
1578
|
if (values.json)
|
|
1576
1579
|
printJson(deps, result);
|
|
1577
1580
|
else {
|
|
@@ -1603,13 +1606,31 @@ async function agentsPublish(args, deps) {
|
|
|
1603
1606
|
for (const c of verdict.cases) {
|
|
1604
1607
|
if (!c.failures?.length)
|
|
1605
1608
|
continue;
|
|
1606
|
-
lines.push(` case ${c.caseId ?? "?"}${c.expectedLeafKey ? ` (→ ${c.expectedLeafKey})` : ""}:`);
|
|
1609
|
+
lines.push(` case ${c.caseId ?? "?"}${c.expectedLeafKey ? ` (→ ${c.expectedLeafKey})` : ""}${gateTag(c.gate)}:`);
|
|
1607
1610
|
lines.push(...formatFindings(c.failures, " "));
|
|
1608
1611
|
}
|
|
1609
1612
|
}
|
|
1610
1613
|
if (body.publishRunId)
|
|
1611
1614
|
lines.push(`Publish run: ${String(body.publishRunId)} (details in the Portal).`);
|
|
1612
|
-
|
|
1615
|
+
if (body.code === "intermittent") {
|
|
1616
|
+
const detail = Array.isArray(body.intermittent) ? body.intermittent : [];
|
|
1617
|
+
for (const c of detail) {
|
|
1618
|
+
lines.push(`Case ${c.caseId ?? "?"} ran ${c.attempts?.length ?? 0} time(s):`);
|
|
1619
|
+
for (const a of c.attempts ?? []) {
|
|
1620
|
+
lines.push(` #${a.attempt} ${a.outcome}`);
|
|
1621
|
+
lines.push(...(a.reasons ?? []).map((r) => ` - ${r.kind}: ${r.detail}`));
|
|
1622
|
+
}
|
|
1623
|
+
}
|
|
1624
|
+
lines.push("The check failed only in some of its runs (intermittent) and nothing else is wrong. " +
|
|
1625
|
+
"If the reasons above are acceptable, publish anyway with `kumion agents publish " + agentId + " --accept-intermittent`. " +
|
|
1626
|
+
"Do not pass it unless the user has read them and agreed.");
|
|
1627
|
+
}
|
|
1628
|
+
else if (verdict?.cases?.some((c) => c.gate === "reproduced")) {
|
|
1629
|
+
lines.push("A failing case failed again on re-run (reproduced), so it cannot be skipped: fix the draft, run `kumion test-runs start`, and publish again.");
|
|
1630
|
+
}
|
|
1631
|
+
else {
|
|
1632
|
+
lines.push("The CLI cannot publish past this refusal: fix the cause above, run `kumion test-runs start`, and publish again.");
|
|
1633
|
+
}
|
|
1613
1634
|
throw new ReportedFailure(lines.join("\n"));
|
|
1614
1635
|
}
|
|
1615
1636
|
}
|
|
@@ -1770,10 +1791,18 @@ export function summarizeTestRun(run) {
|
|
|
1770
1791
|
for (const r of run.results ?? []) {
|
|
1771
1792
|
if (!r.failures?.length)
|
|
1772
1793
|
continue;
|
|
1773
|
-
lines.push(`Case ${r.caseId}${r.expectedLeafKey ? ` (→ ${r.expectedLeafKey})` : ""}:`);
|
|
1794
|
+
lines.push(`Case ${r.caseId}${r.expectedLeafKey ? ` (→ ${r.expectedLeafKey})` : ""}${gateTag(r.gate)}:`);
|
|
1795
|
+
if (r.attempts?.length)
|
|
1796
|
+
lines.push(` runs: ${r.attempts.map((a) => `#${a.attempt} ${a.outcome}`).join(", ")}`);
|
|
1774
1797
|
lines.push(...formatFindings(r.failures, " "));
|
|
1775
1798
|
}
|
|
1776
1799
|
}
|
|
1800
|
+
const gates = new Set((run.results ?? []).filter((r) => r.failures?.length).map((r) => r.gate));
|
|
1801
|
+
if (run.status === "failed" && gates.has("reproduced"))
|
|
1802
|
+
lines.push("[reproduced] cases failed again on re-run: fix the draft.");
|
|
1803
|
+
if (run.status === "failed" && gates.has("intermittent")) {
|
|
1804
|
+
lines.push("[intermittent] cases failed only in some runs. `agents publish --accept-intermittent` can publish past them if the user accepts the reasons.");
|
|
1805
|
+
}
|
|
1777
1806
|
return lines.join("\n");
|
|
1778
1807
|
}
|
|
1779
1808
|
async function testRunsStart(args, deps) {
|
|
@@ -1841,14 +1870,25 @@ async function testRunsList(args, deps) {
|
|
|
1841
1870
|
deps.io.out(`${r.id} ${r.status.padEnd(13)} ${r.casesDone}/${r.casesTotal} ${r.startedAt}`);
|
|
1842
1871
|
return 0;
|
|
1843
1872
|
}
|
|
1873
|
+
function parseVarFlags(pairs) {
|
|
1874
|
+
const variables = {};
|
|
1875
|
+
for (const pair of pairs ?? []) {
|
|
1876
|
+
const at = pair.indexOf("=");
|
|
1877
|
+
if (at < 1)
|
|
1878
|
+
throw new UsageError(`--var must be <name>=<value> (got "${pair}").`);
|
|
1879
|
+
variables[pair.slice(0, at)] = pair.slice(at + 1);
|
|
1880
|
+
}
|
|
1881
|
+
return variables;
|
|
1882
|
+
}
|
|
1844
1883
|
async function scheduledCallsCreate(args, deps) {
|
|
1845
|
-
const { values, positionals } = parse(args, { to: { type: "string" }, at: { type: "string" } });
|
|
1884
|
+
const { values, positionals } = parse(args, { to: { type: "string" }, at: { type: "string" }, var: { type: "string", multiple: true } });
|
|
1846
1885
|
const agentId = need(positionals, 0, "agentId");
|
|
1886
|
+
const variables = parseVarFlags(values.var);
|
|
1847
1887
|
if (!values.to)
|
|
1848
1888
|
throw new UsageError("--to <phone> is required.");
|
|
1849
1889
|
if (!values.at)
|
|
1850
1890
|
throw new UsageError("--at <iso8601 with offset> is required.");
|
|
1851
|
-
const result = await (await clientFor(values, deps)).createScheduledCall(agentId, values.to, values.at);
|
|
1891
|
+
const result = await (await clientFor(values, deps)).createScheduledCall(agentId, values.to, values.at, variables);
|
|
1852
1892
|
if (values.json)
|
|
1853
1893
|
printJson(deps, result);
|
|
1854
1894
|
else
|
|
@@ -1884,13 +1924,7 @@ async function callsCreate(args, deps) {
|
|
|
1884
1924
|
var: { type: "string", multiple: true },
|
|
1885
1925
|
});
|
|
1886
1926
|
const agentId = need(positionals, 0, "agentId");
|
|
1887
|
-
const variables =
|
|
1888
|
-
for (const pair of values.var ?? []) {
|
|
1889
|
-
const at = pair.indexOf("=");
|
|
1890
|
-
if (at < 1)
|
|
1891
|
-
throw new UsageError(`--var must be <name>=<value> (got "${pair}").`);
|
|
1892
|
-
variables[pair.slice(0, at)] = pair.slice(at + 1);
|
|
1893
|
-
}
|
|
1927
|
+
const variables = parseVarFlags(values.var);
|
|
1894
1928
|
const result = await (await clientFor(values, deps)).createCall(agentId, values["campaign-contact"], variables, values.to);
|
|
1895
1929
|
if (values.json)
|
|
1896
1930
|
printJson(deps, result);
|
package/dist/mcp.js
CHANGED
|
@@ -302,16 +302,23 @@ export function createKumionMcpServer(client, options) {
|
|
|
302
302
|
}, (args) => attempt(() => client.confirmFacts(args.agentId, args.factIds)));
|
|
303
303
|
server.registerTool("publish_agent", {
|
|
304
304
|
description: "Publish the agent's draft so callers get it. Runs the same pre-publish check as the Portal first and " +
|
|
305
|
-
"publishes only if it passes;
|
|
305
|
+
"publishes only if it passes; a check that failed again on re-run (`gate: reproduced`) cannot be skipped. " +
|
|
306
|
+
"The exception: a check that failed " +
|
|
307
|
+
"only in some of its runs comes back with code `intermittent` and the cases (`gate: intermittent`), and " +
|
|
308
|
+
"`acceptIntermittent` publishes it anyway; pass it only after the user has seen each run's reasons and explicitly agreed. Can take a few minutes. On failure the " +
|
|
306
309
|
"failing cases are returned. A success carries `unconfirmedFacts`: how many of the agent's 資料 facts " +
|
|
307
310
|
"nobody has confirmed yet — for each of them the agent says it will check and call back instead of " +
|
|
308
311
|
"stating it (confirm_facts confirms them). Needs agents:publish.",
|
|
309
312
|
inputSchema: {
|
|
310
313
|
agentId,
|
|
311
314
|
revision: z.string().optional().describe("Refuse to publish if the draft is no longer at this revision."),
|
|
315
|
+
acceptIntermittent: z
|
|
316
|
+
.boolean()
|
|
317
|
+
.optional()
|
|
318
|
+
.describe("Publish although the check failed only in some of its runs (code `intermittent`). Pass only after the user has seen each run's reasons and explicitly agreed. Has no effect on a check that failed again on re-run."),
|
|
312
319
|
},
|
|
313
320
|
annotations: { destructiveHint: true, idempotentHint: false },
|
|
314
|
-
}, (args) => attempt(() => client.publishAgent(args.agentId, args.revision)));
|
|
321
|
+
}, (args) => attempt(() => client.publishAgent(args.agentId, args.revision, { acceptIntermittent: args.acceptIntermittent === true })));
|
|
315
322
|
server.registerTool("start_test_run", {
|
|
316
323
|
description: "Run the agent's regression tests against its draft (publishes nothing). Returns at once with the run " +
|
|
317
324
|
`unless waitSeconds is set (at most ${MAX_TEST_RUN_WAIT_SECONDS}); follow a running run with ` +
|
|
@@ -373,9 +380,13 @@ export function createKumionMcpServer(client, options) {
|
|
|
373
380
|
agentId,
|
|
374
381
|
phoneNumber: z.string().describe("Domestic Japanese number to dial."),
|
|
375
382
|
scheduledAt: z.string().describe("When to dial, ISO 8601 with a timezone offset."),
|
|
383
|
+
variables: z
|
|
384
|
+
.record(z.string(), z.string())
|
|
385
|
+
.optional()
|
|
386
|
+
.describe("Values for {{vars.<name>}} in the agent's prompts, opening line and edge conditions (optional)."),
|
|
376
387
|
},
|
|
377
388
|
annotations: { idempotentHint: false },
|
|
378
|
-
}, (args) => attempt(() => client.createScheduledCall(args.agentId, args.phoneNumber, args.scheduledAt)));
|
|
389
|
+
}, (args) => attempt(() => client.createScheduledCall(args.agentId, args.phoneNumber, args.scheduledAt, args.variables)));
|
|
379
390
|
server.registerTool("list_scheduled_calls", {
|
|
380
391
|
description: "List the calls scheduled through the API, newest first (at most 100), with state and reason. Needs calls:read.",
|
|
381
392
|
inputSchema: {},
|
package/package.json
CHANGED
package/skills/kumion/SKILL.md
CHANGED
|
@@ -24,7 +24,8 @@ Two ways in, same operations and same permissions:
|
|
|
24
24
|
`update_capture_spec`, `get_agent_capture`, `set_agent_capture`,
|
|
25
25
|
`upload_document`, `get_document_upload_job`, `get_document`,
|
|
26
26
|
`replace_document`, `start_test_run`, `get_test_run`, `list_test_runs`,
|
|
27
|
-
`create_call`, `
|
|
27
|
+
`create_call`, `create_scheduled_call`, `list_scheduled_calls`,
|
|
28
|
+
`cancel_scheduled_call`, `list_calls`, `get_call`, `get_call_transcript`.
|
|
28
29
|
- **The `kumion` CLI** otherwise (`kumion --help`). Add `--json` for machine-readable
|
|
29
30
|
output.
|
|
30
31
|
|
|
@@ -86,8 +87,10 @@ A partner with several customers has one profile per customer tenant
|
|
|
86
87
|
5. **Publish** — only when the user asked for it. `publish_agent` /
|
|
87
88
|
`kumion agents publish <agentId>`. It runs the same pre-publish check as the Portal
|
|
88
89
|
and can take a few minutes. If the check fails, nothing goes live and the failing
|
|
89
|
-
cases come back: fix, test, publish again.
|
|
90
|
-
look for one.
|
|
90
|
+
cases come back: fix, test, publish again. A reproduced failure (`[reproduced]`) has no skip or
|
|
91
|
+
override; do not look for one. A refusal with no re-run verdict is not intermittent: fix its cause. One case is the exception: when the refusal says the check failed only
|
|
92
|
+
intermittently (`[intermittent]`, code `intermittent`), `--accept-intermittent` /
|
|
93
|
+
`acceptIntermittent` publishes it. Use it only after the user has seen each run's reasons and said to accept that risk.
|
|
91
94
|
6. **Try it** (optional) — `create_call` / `kumion calls create <agentId>` starts a web
|
|
92
95
|
test call and returns a LiveKit room and token. With `phoneNumber` / `--to <phone>` it
|
|
93
96
|
places a real outbound call instead (a domestic number; the agent must be published
|
|
@@ -96,6 +99,9 @@ A partner with several customers has one profile per customer tenant
|
|
|
96
99
|
To dial at a stated time instead, `create_scheduled_call` / `kumion scheduled-calls create <agentId> --to <phone> --at <iso8601-with-offset>`
|
|
97
100
|
(the offset is required, the time must be in the future, one dial with no redial; 403 when the tenant's
|
|
98
101
|
automatic outbound dialing is off or the plan is free, 409 when the number already has a pending dial).
|
|
102
|
+
Both take per-call values, `--var <name>=<value>` (repeatable) / `variables`, read as `{{vars.<name>}}` in
|
|
103
|
+
the agent's prompts and opening line. The flag splits at the first `=`; a name left out reads as empty; a
|
|
104
|
+
変数 marked 必須 must be given or the call is refused (400 `missing_variables`).
|
|
99
105
|
`list_scheduled_calls` shows the state; `cancel_scheduled_call` works only before the dial starts.
|
|
100
106
|
|
|
101
107
|
## From a template to a published agent
|
|
@@ -258,6 +264,9 @@ A key a node does not store follows the agent's setting (会話の運用) or the
|
|
|
258
264
|
| `opening_speech` | start | `required` | `string` | The opening line. Supports {{variables}}. |
|
|
259
265
|
| `items` | start, agent | `required` | `{key,label?,example?,source?,value_type?,options?,must_ask?,min_digits?,max_digits?,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). `min_digits` / `max_digits`: for a `code` item, the fewest / most digits the value may hold, counted by the platform (the same number twice = exact length). `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). |
|
|
260
266
|
| `allow_interruptions` | start, agent | `tune` | `boolean` | Absent means the caller may interrupt. Only an explicit false is stored. |
|
|
267
|
+
| `route_judge` | start | `tune` | `boolean` | Absent means off. Only an explicit true is stored. On: while the call stays on this start step, each caller turn is first read by the call model's own probability readout (at most 400 ms, before the AI answers); when it is sure which of the step's three connections fits, the call moves on without a model turn. Offered only for a call model whose endpoint has a calibrated readout; the step needs exactly three AI connections without items and no fixed connections (graph diagnostics `route_judge_not_applicable`). |
|
|
268
|
+
| `wait_for_first_word` | start | `tune` | `boolean` | Absent means off. Only an explicit true is stored. On: an outbound call waits for the customer to speak first and says the opening line when they finish or `first_word_wait_seconds` runs out. An inbound call never reads it (graph diagnostics `first_word_wait_outbound_only`). |
|
|
269
|
+
| `first_word_wait_seconds` | start | `tune` | `number` | Seconds `wait_for_first_word` waits (1 to 10, default 3). Absent means the default. Read only when `wait_for_first_word` is true. |
|
|
261
270
|
| `respond_on_enter` | agent | `tune` | `boolean` | Absent means the node answers on arrival. Only an explicit false (wait for the caller) is stored. |
|
|
262
271
|
| `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. |
|
|
263
272
|
| `confirm_before_end_keys` | agent | `internal` | `string[]` | Set by the compiler on a 伝言 step. With `confirm_before_end` on, the end readback reads only these item keys (the call-back number); absent means every item the ending requires. |
|