@kumion/cli 0.3.0 → 0.5.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/README.md +304 -16
- package/dist/client.js +212 -2
- package/dist/errors.js +38 -0
- package/dist/main.js +869 -7
- package/dist/mcp.js +573 -5
- package/package.json +3 -2
- package/skills/kumion/SKILL.md +140 -8
package/dist/errors.js
CHANGED
|
@@ -23,6 +23,11 @@ export function describeApiError(err) {
|
|
|
23
23
|
if (err.code === "plan_publish_required") {
|
|
24
24
|
return `This tenant's plan cannot publish agents (403). Upgrade the plan in the Kumion Portal; no key change helps.${serverSaid(err)}`;
|
|
25
25
|
}
|
|
26
|
+
if (err.code === "scheduled_dialing_unavailable") {
|
|
27
|
+
return ("This tenant cannot schedule calls (403): automatic outbound dialing is off for it, or its plan is free. " +
|
|
28
|
+
"Nothing was scheduled. Turn automatic dialing on in the Kumion Portal (設定), or dial now with `kumion calls create`." +
|
|
29
|
+
serverSaid(err));
|
|
30
|
+
}
|
|
26
31
|
if (err.scope === "calls:create") {
|
|
27
32
|
return ("The call was refused (403): the tenant has reached its call-minute limit (the trial minutes cap for an " +
|
|
28
33
|
"unsigned tenant, or the monthly cap), or its plan cannot start calls. Check 設定 in the Kumion Portal." +
|
|
@@ -30,7 +35,26 @@ export function describeApiError(err) {
|
|
|
30
35
|
}
|
|
31
36
|
return `Access refused (403).${serverSaid(err)}`;
|
|
32
37
|
}
|
|
38
|
+
case 400:
|
|
39
|
+
if (err.code === "no_versions") {
|
|
40
|
+
return ("This agent has no versions (400 no_versions): it answers from a prompt alone, with no canvas to publish, so " +
|
|
41
|
+
`there is no version number to name. Leave --version out.${serverSaid(err)}`);
|
|
42
|
+
}
|
|
43
|
+
if (err.code === "unsupported_format") {
|
|
44
|
+
return `That --format is not one this server produces (400 unsupported_format).${serverSaid(err)}`;
|
|
45
|
+
}
|
|
46
|
+
if (err.code === "invalid_version") {
|
|
47
|
+
return `--version takes published, draft, or a version number (400 invalid_version).${serverSaid(err)}`;
|
|
48
|
+
}
|
|
49
|
+
return `Request failed (400).${serverSaid(err)}`;
|
|
33
50
|
case 404:
|
|
51
|
+
if (err.code === "not_published") {
|
|
52
|
+
return ("This agent has never been published (404 not_published), so there is no 公開中 version to export. Pass " +
|
|
53
|
+
`--version draft to export the draft instead.${serverSaid(err)}`);
|
|
54
|
+
}
|
|
55
|
+
if (err.code === "version_not_found") {
|
|
56
|
+
return `There is no such version of this agent (404 version_not_found). See the versions in \`kumion agents get <agentId>\`.${serverSaid(err)}`;
|
|
57
|
+
}
|
|
34
58
|
return `Not found (404) — check the id, and that it belongs to this tenant.${serverSaid(err)}`;
|
|
35
59
|
case 409:
|
|
36
60
|
if (err.code === "draft_revision_conflict") {
|
|
@@ -39,6 +63,11 @@ export function describeApiError(err) {
|
|
|
39
63
|
"change on top of it, and try again." +
|
|
40
64
|
serverSaid(err));
|
|
41
65
|
}
|
|
66
|
+
if (err.code === "agent_name_taken") {
|
|
67
|
+
return ("Another agent in this tenant already has that name (409 agent_name_taken). Nothing was created or renamed. " +
|
|
68
|
+
"Pick a different name and try again." +
|
|
69
|
+
serverSaid(err));
|
|
70
|
+
}
|
|
42
71
|
if (err.code === "fact_revision_conflict") {
|
|
43
72
|
return ("That fact changed since you read it (409): someone confirmed or edited it in the Portal or from another " +
|
|
44
73
|
"client. Nothing was written. Run `kumion facts list <agentId>` for its new revision and try again." +
|
|
@@ -65,6 +94,15 @@ export function describeApiError(err) {
|
|
|
65
94
|
.map((line) => ` - ${line}`)
|
|
66
95
|
.join("\n")}`;
|
|
67
96
|
}
|
|
97
|
+
if (err.code === "external_field_closed") {
|
|
98
|
+
const paths = Array.isArray(err.body.paths)
|
|
99
|
+
? err.body.paths.filter((path) => typeof path === "string")
|
|
100
|
+
: [];
|
|
101
|
+
const listed = paths.length > 0 ? `\n${paths.map((path) => ` - ${path}`).join("\n")}` : "";
|
|
102
|
+
return ("The change was not stored (422). Nothing was written — these settings decide what a call plays, where it " +
|
|
103
|
+
`sends or whom it notifies, and the API cannot add or change them. Edit them on the Portal's canvas:${listed}` +
|
|
104
|
+
serverSaid(err));
|
|
105
|
+
}
|
|
68
106
|
if (err.code === "flow_edit_refused" && reason) {
|
|
69
107
|
const which = typeof err.body.opIndex === "number" ? `Operation ${err.body.opIndex + 1} was refused` : "The change was refused";
|
|
70
108
|
return `${which} (422). Nothing was written.\nServer said: ${reason}`;
|