@kumion/cli 0.6.1 → 0.6.2

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 CHANGED
@@ -167,7 +167,10 @@ them. `calls list` returns one page (20 by default, at most 100) and prints the
167
167
  `--offset` of the next one. Every call in `calls list` and `calls get` carries what it came to: `outcome`
168
168
  (`ai_resolved`, `ai_unresolved_hangup`, `invalid_call`, `handoff`, `system_ended`, or `na` when not judged),
169
169
  `endedAtNode` (the node it ended on), `durationSec`, `transferred`, and `capturedItems` (the names of the
170
- items it recorded, never their values). A transcript holds only what the caller and the agent said.
170
+ items it recorded, never their values). `calls get` also returns `direction` (the raw value stored with
171
+ the call: `inbound`, `outbound`, `on_net`) and `portalDirection`, which is the 着信/発信 the Portal's call history
172
+ shows: `inbound`, `outbound`, or `null` when the call is neither (a trigger run, say). An `on_net` web call is
173
+ `inbound` there. Count 着信/発信 from `portalDirection`. A transcript's `turns` hold only what the caller and the agent said. A call handed to a person adds `handoffSegment` (`status` `transcribed` / `failed` / `not_sent`, `reason`, `fromSec` / `toSec`, and `turns` of `speaker`, `text`, `offsetSec`, in seconds into the call recording); `not_sent` means the tenant's contract forbids sending the recording out, so it has no text.
171
174
  Add `--json` to any command for the API's JSON instead of a summary.
172
175
 
173
176
  `hours` is the shop clock the call answers 「何時までですか」 from, and it is one calendar for the
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.6.1";
8
+ export const VERSION = "0.6.2";
9
9
  const HELP = `kumion — manage your Kumion voice agents over the Partner API
10
10
 
11
11
  Usage: kumion <command> [options]
@@ -2008,6 +2008,7 @@ async function callsGet(args, deps) {
2008
2008
  `Call ${call.id}`,
2009
2009
  `Agent: ${call.agentName ?? "-"}${call.agentId ? ` (${call.agentId})` : ""}`,
2010
2010
  `Source: ${call.source}${call.direction ? ` (${call.direction})` : ""}`,
2011
+ `Direction: ${call.portalDirection ?? "-"}`,
2011
2012
  `Caller: ${call.remoteE164 ?? "-"}${call.localE164 ? ` → ${call.localE164}` : ""}`,
2012
2013
  `Started: ${call.startedAt}`,
2013
2014
  `Answered: ${call.answeredAt ?? "-"}`,
@@ -2026,11 +2027,21 @@ export function formatTranscript(transcript) {
2026
2027
  if (!transcript.available) {
2027
2028
  return "No transcript yet — it is written when the call ends, and a call that never connected has none.";
2028
2029
  }
2029
- if (transcript.turns.length === 0)
2030
+ const segment = transcript.handoffSegment;
2031
+ if (transcript.turns.length === 0 && !segment)
2030
2032
  return "The transcript is empty: nobody said anything.";
2031
- return transcript.turns
2032
- .map((t) => `${t.at ? `[${t.at}] ` : ""}${t.role === "user" ? "Caller" : "Agent "}: ${t.text}`)
2033
- .join("\n");
2033
+ const lines = transcript.turns.map((t) => `${t.at ? `[${t.at}] ` : ""}${t.role === "user" ? "Caller" : "Agent "}: ${t.text}`);
2034
+ if (segment) {
2035
+ lines.push("--- After the handover to a person ---");
2036
+ if (segment.status === "not_sent")
2037
+ lines.push("Not transcribed: the tenant's contract forbids sending the recording out.");
2038
+ else if (segment.status === "failed")
2039
+ lines.push(`Transcription failed${segment.reason ? ` (${segment.reason})` : ""}.`);
2040
+ for (const t of segment.turns) {
2041
+ lines.push(`${t.offsetSec !== null ? `[+${t.offsetSec}s] ` : ""}${t.speaker !== null ? `Person (speaker ${t.speaker})` : "Person"}: ${t.text}`);
2042
+ }
2043
+ }
2044
+ return lines.join("\n");
2034
2045
  }
2035
2046
  async function callsTranscript(args, deps) {
2036
2047
  const { values, positionals } = parse(args, {});
package/dist/mcp.js CHANGED
@@ -414,7 +414,7 @@ export function createKumionMcpServer(client, options) {
414
414
  annotations: { readOnlyHint: true },
415
415
  }, (args) => attempt(() => client.listCalls(args)));
416
416
  server.registerTool("get_call", {
417
- description: "Read one call: agent, source and direction, numbers, when it started, was answered and ended, how it " +
417
+ description: "Read one call: agent, source, `direction` (the raw column) and `portalDirection` (inbound / outbound as the Portal 通話履歴 counts it; null when neither), numbers, when it started, was answered and ended, how it " +
418
418
  "ended, its result (`outcome`, `endedAtNode`, `durationSec`, `transferred`, `capturedItems`), and whether " +
419
419
  "a transcript exists (read it with get_call_transcript). The channel is only on list_calls. Needs calls:read.",
420
420
  inputSchema: { callId },
@@ -423,7 +423,10 @@ export function createKumionMcpServer(client, options) {
423
423
  server.registerTool("get_call_transcript", {
424
424
  description: "Read what the caller (`user`) and the agent (`assistant`) said on one call, in order. Tool calls and " +
425
425
  "the agent's instructions are not included. `available: false` means no transcript has been written " +
426
- "yet (the call is still up, or never connected) — not that the call was silent. Needs calls:read.",
426
+ "yet (the call is still up, or never connected) — not that the call was silent. A call handed to a " +
427
+ "person also carries `handoffSegment`: what the person said after the pickup (`status` transcribed / " +
428
+ "failed / not_sent; not_sent means the tenant's contract forbids sending the recording out, so there is " +
429
+ "no text). Needs calls:read.",
427
430
  inputSchema: { callId },
428
431
  annotations: { readOnlyHint: true },
429
432
  }, (args) => attempt(async () => ({ transcript: await client.getTranscript(args.callId) })));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kumion/cli",
3
- "version": "0.6.1",
3
+ "version": "0.6.2",
4
4
  "description": "Manage your Kumion voice agents from the terminal over the Kumion Partner API",
5
5
  "author": "KAOPA株式会社",
6
6
  "license": "MIT",
@@ -152,7 +152,11 @@ channel, time range, or caller number). Each call already carries its result (`o
152
152
  transcript only for the call you need. `get_call_transcript` /
153
153
  `kumion calls transcript <callId>` returns what the caller (`user`) and the agent
154
154
  (`assistant`) said. `available: false` means no transcript has been written yet, not a
155
- silent call. Use a transcript to find where the agent went wrong before editing its
155
+ silent call. A call handed to a person also has `handoffSegment`: what the person said after
156
+ the pickup (`status` is `transcribed`, `failed` or `not_sent`; `not_sent` means the tenant's
157
+ contract forbids sending the recording out, so there is no text). `turns` stays the AI part. `get_call` carries `direction` (the raw stored value) and `portalDirection` (`inbound` /
158
+ `outbound` / null: the 着信/発信 the Portal call history shows); count from `portalDirection`.
159
+ Use a transcript to find where the agent went wrong before editing its
156
160
  draft. Transcripts are the tenant's customers' conversations: quote only what the task
157
161
  needs.
158
162