@indemn/cli 1.6.0 → 1.7.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.
Files changed (311) hide show
  1. package/.claude-plugin/marketplace.json +3 -3
  2. package/.claude-plugin/plugin.json +9 -4
  3. package/.github/workflows/ci.yml +10 -0
  4. package/.github/workflows/publish.yml +2 -2
  5. package/.mcp.json +1 -4
  6. package/CONTRIBUTING.md +3 -1
  7. package/README.md +69 -176
  8. package/dist/cli/agents.d.ts.map +1 -1
  9. package/dist/cli/agents.js +226 -18
  10. package/dist/cli/agents.js.map +1 -1
  11. package/dist/cli/analytics.d.ts +3 -0
  12. package/dist/cli/analytics.d.ts.map +1 -0
  13. package/dist/cli/analytics.js +133 -0
  14. package/dist/cli/analytics.js.map +1 -0
  15. package/dist/cli/auth.d.ts.map +1 -1
  16. package/dist/cli/auth.js +62 -17
  17. package/dist/cli/auth.js.map +1 -1
  18. package/dist/cli/billing.d.ts +3 -0
  19. package/dist/cli/billing.d.ts.map +1 -0
  20. package/dist/cli/billing.js +23 -0
  21. package/dist/cli/billing.js.map +1 -0
  22. package/dist/cli/campaigns.d.ts +3 -0
  23. package/dist/cli/campaigns.d.ts.map +1 -0
  24. package/dist/cli/campaigns.js +34 -0
  25. package/dist/cli/campaigns.js.map +1 -0
  26. package/dist/cli/chat.d.ts.map +1 -1
  27. package/dist/cli/chat.js +69 -102
  28. package/dist/cli/chat.js.map +1 -1
  29. package/dist/cli/config.d.ts.map +1 -1
  30. package/dist/cli/config.js +71 -27
  31. package/dist/cli/config.js.map +1 -1
  32. package/dist/cli/conversations.d.ts +3 -0
  33. package/dist/cli/conversations.d.ts.map +1 -0
  34. package/dist/cli/conversations.js +129 -0
  35. package/dist/cli/conversations.js.map +1 -0
  36. package/dist/cli/distribution.d.ts +3 -0
  37. package/dist/cli/distribution.d.ts.map +1 -0
  38. package/dist/cli/distribution.js +122 -0
  39. package/dist/cli/distribution.js.map +1 -0
  40. package/dist/cli/eval.d.ts.map +1 -1
  41. package/dist/cli/eval.js +315 -71
  42. package/dist/cli/eval.js.map +1 -1
  43. package/dist/cli/functions.d.ts.map +1 -1
  44. package/dist/cli/functions.js +109 -38
  45. package/dist/cli/functions.js.map +1 -1
  46. package/dist/cli/index.js +63 -54
  47. package/dist/cli/index.js.map +1 -1
  48. package/dist/cli/init.d.ts +27 -0
  49. package/dist/cli/init.d.ts.map +1 -0
  50. package/dist/cli/init.js +152 -0
  51. package/dist/cli/init.js.map +1 -0
  52. package/dist/cli/kb.d.ts.map +1 -1
  53. package/dist/cli/kb.js +141 -15
  54. package/dist/cli/kb.js.map +1 -1
  55. package/dist/cli/link.d.ts +21 -0
  56. package/dist/cli/link.d.ts.map +1 -0
  57. package/dist/cli/link.js +112 -0
  58. package/dist/cli/link.js.map +1 -0
  59. package/dist/cli/org.d.ts.map +1 -1
  60. package/dist/cli/org.js +79 -67
  61. package/dist/cli/org.js.map +1 -1
  62. package/dist/cli/platform.d.ts +3 -0
  63. package/dist/cli/platform.d.ts.map +1 -0
  64. package/dist/cli/platform.js +133 -0
  65. package/dist/cli/platform.js.map +1 -0
  66. package/dist/cli/tickets.d.ts +3 -0
  67. package/dist/cli/tickets.d.ts.map +1 -0
  68. package/dist/cli/tickets.js +125 -0
  69. package/dist/cli/tickets.js.map +1 -0
  70. package/dist/cli/utils/output.d.ts +15 -9
  71. package/dist/cli/utils/output.d.ts.map +1 -1
  72. package/dist/cli/utils/output.js +53 -46
  73. package/dist/cli/utils/output.js.map +1 -1
  74. package/dist/cli/voice.d.ts +3 -0
  75. package/dist/cli/voice.d.ts.map +1 -0
  76. package/dist/cli/voice.js +206 -0
  77. package/dist/cli/voice.js.map +1 -0
  78. package/dist/core/diff.d.ts +16 -0
  79. package/dist/core/diff.d.ts.map +1 -0
  80. package/dist/core/diff.js +57 -0
  81. package/dist/core/diff.js.map +1 -0
  82. package/dist/core/org-resolver.d.ts +37 -0
  83. package/dist/core/org-resolver.d.ts.map +1 -0
  84. package/dist/core/org-resolver.js +73 -0
  85. package/dist/core/org-resolver.js.map +1 -0
  86. package/dist/core/runtime.d.ts +36 -0
  87. package/dist/core/runtime.d.ts.map +1 -0
  88. package/dist/core/runtime.js +62 -0
  89. package/dist/core/runtime.js.map +1 -0
  90. package/dist/core/scope.d.ts +33 -0
  91. package/dist/core/scope.d.ts.map +1 -0
  92. package/dist/core/scope.js +37 -0
  93. package/dist/core/scope.js.map +1 -0
  94. package/dist/mcp/registry.d.ts +67 -0
  95. package/dist/mcp/registry.d.ts.map +1 -0
  96. package/dist/mcp/registry.js +195 -0
  97. package/dist/mcp/registry.js.map +1 -0
  98. package/dist/mcp/server.d.ts +9 -0
  99. package/dist/mcp/server.d.ts.map +1 -1
  100. package/dist/mcp/server.js +87 -2
  101. package/dist/mcp/server.js.map +1 -1
  102. package/dist/mcp/tool-meta.d.ts +21 -0
  103. package/dist/mcp/tool-meta.d.ts.map +1 -0
  104. package/dist/mcp/tool-meta.js +203 -0
  105. package/dist/mcp/tool-meta.js.map +1 -0
  106. package/dist/mcp/tools.d.ts +2 -1
  107. package/dist/mcp/tools.d.ts.map +1 -1
  108. package/dist/mcp/tools.js +1462 -215
  109. package/dist/mcp/tools.js.map +1 -1
  110. package/dist/sdk/agent-bundle.d.ts +99 -0
  111. package/dist/sdk/agent-bundle.d.ts.map +1 -0
  112. package/dist/sdk/agent-bundle.js +211 -0
  113. package/dist/sdk/agent-bundle.js.map +1 -0
  114. package/dist/sdk/agents.d.ts +54 -1
  115. package/dist/sdk/agents.d.ts.map +1 -1
  116. package/dist/sdk/agents.js +59 -5
  117. package/dist/sdk/agents.js.map +1 -1
  118. package/dist/sdk/analytics.d.ts +158 -0
  119. package/dist/sdk/analytics.d.ts.map +1 -0
  120. package/dist/sdk/analytics.js +185 -0
  121. package/dist/sdk/analytics.js.map +1 -0
  122. package/dist/sdk/auth.d.ts +34 -12
  123. package/dist/sdk/auth.d.ts.map +1 -1
  124. package/dist/sdk/auth.js +60 -77
  125. package/dist/sdk/auth.js.map +1 -1
  126. package/dist/sdk/billing.d.ts +25 -0
  127. package/dist/sdk/billing.d.ts.map +1 -0
  128. package/dist/sdk/billing.js +61 -0
  129. package/dist/sdk/billing.js.map +1 -0
  130. package/dist/sdk/campaigns.d.ts +35 -0
  131. package/dist/sdk/campaigns.d.ts.map +1 -0
  132. package/dist/sdk/campaigns.js +59 -0
  133. package/dist/sdk/campaigns.js.map +1 -0
  134. package/dist/sdk/chat.d.ts +25 -2
  135. package/dist/sdk/chat.d.ts.map +1 -1
  136. package/dist/sdk/chat.js +37 -10
  137. package/dist/sdk/chat.js.map +1 -1
  138. package/dist/sdk/client.d.ts +93 -5
  139. package/dist/sdk/client.d.ts.map +1 -1
  140. package/dist/sdk/client.js +362 -100
  141. package/dist/sdk/client.js.map +1 -1
  142. package/dist/sdk/config-change.d.ts +74 -0
  143. package/dist/sdk/config-change.d.ts.map +1 -0
  144. package/dist/sdk/config-change.js +117 -0
  145. package/dist/sdk/config-change.js.map +1 -0
  146. package/dist/sdk/config.d.ts.map +1 -1
  147. package/dist/sdk/config.js +2 -1
  148. package/dist/sdk/config.js.map +1 -1
  149. package/dist/sdk/conversations.d.ts +101 -0
  150. package/dist/sdk/conversations.d.ts.map +1 -0
  151. package/dist/sdk/conversations.js +155 -0
  152. package/dist/sdk/conversations.js.map +1 -0
  153. package/dist/sdk/credentials.d.ts +25 -0
  154. package/dist/sdk/credentials.d.ts.map +1 -0
  155. package/dist/sdk/credentials.js +44 -0
  156. package/dist/sdk/credentials.js.map +1 -0
  157. package/dist/sdk/distribution.d.ts +94 -0
  158. package/dist/sdk/distribution.d.ts.map +1 -0
  159. package/dist/sdk/distribution.js +100 -0
  160. package/dist/sdk/distribution.js.map +1 -0
  161. package/dist/sdk/eval.d.ts +81 -0
  162. package/dist/sdk/eval.d.ts.map +1 -1
  163. package/dist/sdk/eval.js +117 -0
  164. package/dist/sdk/eval.js.map +1 -1
  165. package/dist/sdk/functions.d.ts +14 -1
  166. package/dist/sdk/functions.d.ts.map +1 -1
  167. package/dist/sdk/functions.js +48 -5
  168. package/dist/sdk/functions.js.map +1 -1
  169. package/dist/sdk/index.d.ts +2 -0
  170. package/dist/sdk/index.d.ts.map +1 -1
  171. package/dist/sdk/index.js +2 -0
  172. package/dist/sdk/index.js.map +1 -1
  173. package/dist/sdk/jarvis-chat.d.ts +28 -0
  174. package/dist/sdk/jarvis-chat.d.ts.map +1 -0
  175. package/dist/sdk/jarvis-chat.js +117 -0
  176. package/dist/sdk/jarvis-chat.js.map +1 -0
  177. package/dist/sdk/kb.d.ts +69 -1
  178. package/dist/sdk/kb.d.ts.map +1 -1
  179. package/dist/sdk/kb.js +111 -24
  180. package/dist/sdk/kb.js.map +1 -1
  181. package/dist/sdk/orgs.d.ts +13 -0
  182. package/dist/sdk/orgs.d.ts.map +1 -0
  183. package/dist/sdk/orgs.js +59 -0
  184. package/dist/sdk/orgs.js.map +1 -0
  185. package/dist/sdk/platform.d.ts +62 -0
  186. package/dist/sdk/platform.d.ts.map +1 -0
  187. package/dist/sdk/platform.js +95 -0
  188. package/dist/sdk/platform.js.map +1 -0
  189. package/dist/sdk/session.d.ts +25 -0
  190. package/dist/sdk/session.d.ts.map +1 -0
  191. package/dist/sdk/session.js +69 -0
  192. package/dist/sdk/session.js.map +1 -0
  193. package/dist/sdk/skills.d.ts +46 -0
  194. package/dist/sdk/skills.d.ts.map +1 -0
  195. package/dist/sdk/skills.js +203 -0
  196. package/dist/sdk/skills.js.map +1 -0
  197. package/dist/sdk/test-chat.d.ts +52 -0
  198. package/dist/sdk/test-chat.d.ts.map +1 -0
  199. package/dist/sdk/test-chat.js +134 -0
  200. package/dist/sdk/test-chat.js.map +1 -0
  201. package/dist/sdk/tickets.d.ts +98 -0
  202. package/dist/sdk/tickets.d.ts.map +1 -0
  203. package/dist/sdk/tickets.js +91 -0
  204. package/dist/sdk/tickets.js.map +1 -0
  205. package/dist/sdk/types.d.ts +91 -6
  206. package/dist/sdk/types.d.ts.map +1 -1
  207. package/dist/sdk/voice.d.ts +147 -0
  208. package/dist/sdk/voice.d.ts.map +1 -0
  209. package/dist/sdk/voice.js +236 -0
  210. package/dist/sdk/voice.js.map +1 -0
  211. package/package.json +22 -3
  212. package/scripts/check-skills.mjs +25 -0
  213. package/skills/agent-builder/SKILL.md +89 -252
  214. package/skills/evaluations/SKILL.md +23 -234
  215. package/skills/evaluations/references/analysis.md +95 -0
  216. package/skills/evaluations/references/cli-reference.md +28 -0
  217. package/skills/evaluations/references/json-formats.md +100 -0
  218. package/src/cli/agents.ts +202 -22
  219. package/src/cli/analytics.ts +138 -0
  220. package/src/cli/auth.ts +56 -18
  221. package/src/cli/billing.ts +25 -0
  222. package/src/cli/campaigns.ts +33 -0
  223. package/src/cli/chat.ts +66 -115
  224. package/src/cli/config.ts +65 -31
  225. package/src/cli/conversations.ts +133 -0
  226. package/src/cli/distribution.ts +116 -0
  227. package/src/cli/eval.ts +254 -70
  228. package/src/cli/functions.ts +105 -39
  229. package/src/cli/index.ts +58 -55
  230. package/src/cli/init.ts +154 -0
  231. package/src/cli/kb.ts +120 -17
  232. package/src/cli/link.ts +117 -0
  233. package/src/cli/org.ts +81 -75
  234. package/src/cli/platform.ts +128 -0
  235. package/src/cli/tickets.ts +130 -0
  236. package/src/cli/utils/output.ts +51 -42
  237. package/src/cli/voice.ts +204 -0
  238. package/src/core/diff.ts +52 -0
  239. package/src/core/org-resolver.ts +113 -0
  240. package/src/core/runtime.ts +73 -0
  241. package/src/core/scope.ts +64 -0
  242. package/src/mcp/registry.ts +236 -0
  243. package/src/mcp/server.ts +84 -2
  244. package/src/mcp/tool-meta.ts +241 -0
  245. package/src/mcp/tools.ts +1529 -265
  246. package/src/sdk/agent-bundle.ts +245 -0
  247. package/src/sdk/agents.ts +74 -5
  248. package/src/sdk/analytics.ts +220 -0
  249. package/src/sdk/auth.ts +87 -107
  250. package/src/sdk/billing.ts +59 -0
  251. package/src/sdk/campaigns.ts +60 -0
  252. package/src/sdk/chat.ts +44 -10
  253. package/src/sdk/client.ts +373 -102
  254. package/src/sdk/config-change.ts +148 -0
  255. package/src/sdk/config.ts +2 -1
  256. package/src/sdk/conversations.ts +199 -0
  257. package/src/sdk/credentials.ts +53 -0
  258. package/src/sdk/distribution.ts +132 -0
  259. package/src/sdk/eval.ts +140 -0
  260. package/src/sdk/functions.ts +52 -6
  261. package/src/sdk/index.ts +2 -0
  262. package/src/sdk/jarvis-chat.ts +112 -0
  263. package/src/sdk/kb.ts +116 -29
  264. package/src/sdk/orgs.ts +62 -0
  265. package/src/sdk/platform.ts +115 -0
  266. package/src/sdk/session.ts +90 -0
  267. package/src/sdk/skills.ts +188 -0
  268. package/src/sdk/test-chat.ts +151 -0
  269. package/src/sdk/tickets.ts +120 -0
  270. package/src/sdk/types.ts +88 -6
  271. package/src/sdk/voice.ts +262 -0
  272. package/test/cli/entry.test.ts +34 -0
  273. package/test/cli/init.test.ts +66 -0
  274. package/test/cli/link.test.ts +57 -0
  275. package/test/core/org-resolver.test.ts +92 -0
  276. package/test/core/runtime.test.ts +30 -0
  277. package/test/core/scope.test.ts +93 -0
  278. package/test/harness.test.ts +24 -0
  279. package/test/helpers/config-home.ts +22 -0
  280. package/test/helpers/fake-middleware.ts +56 -0
  281. package/test/helpers/fetch-recorder.ts +75 -0
  282. package/test/helpers/jwt.ts +9 -0
  283. package/test/helpers/mcp-pair.ts +38 -0
  284. package/test/mcp/__snapshots__/tools-snapshot.test.ts.snap +145 -0
  285. package/test/mcp/askers.test.ts +60 -0
  286. package/test/mcp/elicit-timeout.test.ts +29 -0
  287. package/test/mcp/registry.test.ts +169 -0
  288. package/test/mcp/shaping.test.ts +41 -0
  289. package/test/mcp/tools-snapshot.test.ts +42 -0
  290. package/test/sdk/agents.test.ts +232 -0
  291. package/test/sdk/analytics.test.ts +89 -0
  292. package/test/sdk/auth.test.ts +70 -0
  293. package/test/sdk/billing.test.ts +47 -0
  294. package/test/sdk/campaigns.test.ts +43 -0
  295. package/test/sdk/client.test.ts +80 -0
  296. package/test/sdk/config-change.test.ts +142 -0
  297. package/test/sdk/conversations.test.ts +80 -0
  298. package/test/sdk/credentials.test.ts +33 -0
  299. package/test/sdk/distribution.test.ts +55 -0
  300. package/test/sdk/eval.test.ts +155 -0
  301. package/test/sdk/kb-upload.test.ts +50 -0
  302. package/test/sdk/kb.test.ts +95 -0
  303. package/test/sdk/orgs.test.ts +48 -0
  304. package/test/sdk/platform.test.ts +89 -0
  305. package/test/sdk/renewal.test.ts +115 -0
  306. package/test/sdk/session.test.ts +60 -0
  307. package/test/sdk/skills.test.ts +235 -0
  308. package/test/sdk/test-chat.test.ts +112 -0
  309. package/test/sdk/tickets.test.ts +42 -0
  310. package/test/sdk/voice.test.ts +147 -0
  311. package/vitest.config.ts +11 -0
@@ -0,0 +1,241 @@
1
+ import type { ToolAnnotations } from '@modelcontextprotocol/sdk/types.js';
2
+
3
+ /**
4
+ * Metadata for every MCP tool. The host (Claude Code, Jarvis) reads the
5
+ * annotations to decide when to ask the user. `guard` makes the registry
6
+ * require a confirmation before the tool runs; each area switches it on for
7
+ * its own tools together with a precise `describe` preview.
8
+ */
9
+ export interface ToolMeta {
10
+ title: string;
11
+ annotations: ToolAnnotations;
12
+ /** Ask before running: elicitation, else `confirm: true`, else a dry run. */
13
+ guard?: boolean;
14
+ /** One sentence naming exactly what the call would change, for the confirmation. */
15
+ describe?: (args: Record<string, unknown>) => string;
16
+ /** False for tools that never touch an org-scoped route. Default true. */
17
+ orgScoped?: boolean;
18
+ /** List tool: the registry adds limit/page and returns { items, page, limit, total, has_more }. */
19
+ paginate?: boolean;
20
+ }
21
+
22
+ const read = (title: string): ToolMeta => ({
23
+ title,
24
+ annotations: { title, readOnlyHint: true, destructiveHint: false, idempotentHint: true, openWorldHint: false },
25
+ });
26
+
27
+ const write = (title: string, extra: Partial<ToolAnnotations> = {}): ToolMeta => ({
28
+ title,
29
+ annotations: { title, readOnlyHint: false, destructiveHint: false, idempotentHint: false, openWorldHint: false, ...extra },
30
+ });
31
+
32
+ /** Overwrites or removes something that cannot be restored from the tool itself. */
33
+ const destroy = (title: string, extra: Partial<ToolAnnotations> = {}): ToolMeta => ({
34
+ title,
35
+ annotations: { title, readOnlyHint: false, destructiveHint: true, idempotentHint: false, openWorldHint: false, ...extra },
36
+ });
37
+
38
+ export const TOOL_META: Record<string, ToolMeta> = {
39
+ // Login and organizations
40
+ whoami: { ...read('Who am I'), orgScoped: false },
41
+ list_organizations: { ...read('List my organizations'), orgScoped: false },
42
+ list_org_members: { ...read('List organization members'), paginate: true },
43
+ list_channels: read('List channels'),
44
+
45
+ // Agents
46
+ list_agents: { ...read('List agents'), paginate: true },
47
+ get_agent: read('Get agent'),
48
+ create_agent: write('Create agent'),
49
+ update_agent: { ...write('Update agent', { idempotentHint: true }), guard: true, describe: (a) => `This will change agent ${a.agent_id}.` },
50
+ delete_agent: { ...destroy('Delete agent'), guard: true, describe: (a) => `This will delete agent ${a.agent_id}. It cannot be restored from the CLI.` },
51
+ agent_summary: read('Summarize agent'),
52
+ agent_stats: read('Agent conversation metrics'),
53
+ set_agent_lifecycle: {
54
+ ...write('Change agent lifecycle', { idempotentHint: true }),
55
+ guard: true,
56
+ describe: (a) => `This will move agent ${a.agent_id} to lifecycle "${a.lifecycle}". Published means live for customers.`,
57
+ },
58
+ transfer_agent_owner: {
59
+ ...write('Transfer agent ownership', { idempotentHint: true }),
60
+ guard: true,
61
+ describe: (a) => `This will make user ${a.owner_id} the owner of agent ${a.agent_id}.`,
62
+ },
63
+ clone_agent: write('Clone agent'),
64
+ export_agent: read('Export agent bundle'),
65
+ import_agent: {
66
+ ...write('Import agent bundle'),
67
+ guard: true,
68
+ describe: (a) => `This will create a new agent "${String(a.name ?? (a.bundle as { agent?: { name?: string } } | undefined)?.agent?.name ?? '')}" with ${((a.bundle as { skills?: unknown[] } | undefined)?.skills ?? []).length} skill(s).`,
69
+ },
70
+
71
+ // Prompt and configuration
72
+ get_config: read('Get agent configuration'),
73
+ set_config: { ...destroy('Change agent prompt, greeting or model', { idempotentHint: true }), guard: true },
74
+ get_prompt: read('Get agent prompt'),
75
+ set_prompt: { ...destroy('Replace agent prompt', { idempotentHint: true }), guard: true },
76
+
77
+ // Skills (the CLI still calls them functions)
78
+ list_functions: { ...read('List skills'), paginate: true },
79
+ create_function: write('Create skill'),
80
+ update_function: { ...write('Update skill', { idempotentHint: true }), guard: true, describe: (a) => `This will change skill ${a.function_id} of agent ${a.agent_id}.` },
81
+ delete_function: { ...destroy('Delete skill'), guard: true, describe: (a) => `This will delete skill ${a.function_id} from agent ${a.agent_id}.` },
82
+ test_function: write('Test skill', { openWorldHint: true }),
83
+ export_functions: read('Export skills'),
84
+ import_functions: {
85
+ ...destroy('Import skills, replacing existing ones', { openWorldHint: true }),
86
+ guard: true,
87
+ describe: (a) => `This will DELETE every skill of agent ${a.agent_id}, including the built-in handoff and FAQ retriever, and replace them with the skills in ${a.url}. There is no undo.`,
88
+ },
89
+ generate_skills_from_doc: write('Propose skills from a document', { openWorldHint: true }),
90
+ bulk_create_skills: {
91
+ ...write('Create several skills'),
92
+ guard: true,
93
+ describe: (a) => `This will create ${((a.functions as unknown[] | undefined) ?? []).length} skill(s) on agent ${a.agent_id}.`,
94
+ },
95
+ list_function_parameters: read('List skill parameters'),
96
+ add_function_parameter: write('Add skill parameter'),
97
+ update_function_parameter: write('Update skill parameter', { idempotentHint: true }),
98
+ delete_function_parameter: { ...destroy('Delete skill parameter'), guard: true, describe: (a) => `This will delete parameter ${a.parameter_id} of skill ${a.function_id} on agent ${a.agent_id}.` },
99
+ list_master_functions: { ...read('List skill templates'), paginate: true },
100
+ list_llm_models: { ...read('List LLM models'), paginate: true },
101
+
102
+ // Knowledge bases
103
+ list_knowledge_bases: { ...read('List knowledge bases'), paginate: true },
104
+ get_knowledge_base: read('Get knowledge base'),
105
+ create_knowledge_base: write('Create knowledge base'),
106
+ update_knowledge_base: write('Update knowledge base', { idempotentHint: true }),
107
+ delete_knowledge_base: { ...destroy('Delete knowledge base'), guard: true, describe: (a) => `This will delete knowledge base ${a.kb_id} with all its sources and vectors.` },
108
+ list_kb_data: read('List knowledge base entries'),
109
+ add_kb_data: write('Add knowledge base entry'),
110
+ scrape_url: write('Scrape a website into a knowledge base', { openWorldHint: true }),
111
+ upload_kb_file: write('Upload file to knowledge base'),
112
+ update_kb_data: write('Update knowledge base entry', { idempotentHint: true }),
113
+ delete_kb_data: { ...destroy('Delete knowledge base entry'), guard: true, describe: (a) => `This will delete source ${a.source_id} from knowledge base ${a.kb_id}, with its vectors.` },
114
+ link_kb: write('Link knowledge bases to agent', { idempotentHint: true }),
115
+ unlink_kb: { ...destroy('Unlink knowledge base from agent'), guard: true, describe: (a) => `This will unlink knowledge base ${a.kb_id} from agent ${a.agent_id}; the agent stops using it immediately.` },
116
+ export_kb: read('Export knowledge base'),
117
+ import_kb: { ...destroy('Import into knowledge base'), guard: true, describe: (a) => `This will import new content into knowledge base ${a.kb_id}.` },
118
+ kb_chunks: read('Show what the agent learned from a source'),
119
+ reimport_kb_source: {
120
+ ...write('Re-crawl a website source', { openWorldHint: true }),
121
+ guard: true,
122
+ describe: (a) => `This will re-crawl source ${a.source_id} of knowledge base ${a.kb_id}; its chunks are replaced when done.`,
123
+ },
124
+ kb_scrape_status: read('Crawl and import progress'),
125
+ kb_gaps: read('Unanswered questions'),
126
+ kb_check: read('Check if knowledge answers a question'),
127
+
128
+ // Conversations
129
+ list_conversations: read('List conversations of an agent'),
130
+ get_conversation: read('Get a conversation with its messages'),
131
+ mark_conversation_test: {
132
+ ...write('Mark conversations as test', { idempotentHint: true }),
133
+ guard: true,
134
+ describe: (a) => `This will mark ${(a.conversation_ids as string[] | undefined)?.length ?? 0} conversation(s) of agent ${a.agent_id} as test: removed from analytics, usage billing reversed.`,
135
+ },
136
+
137
+ // Voice
138
+ list_voices: { ...read('List voices'), orgScoped: false },
139
+ list_voice_models: read('List speech models'),
140
+ get_agent_voice: read('Get agent voice settings'),
141
+ set_agent_voice: { ...write('Change agent voice', { idempotentHint: true }), guard: true, describe: (a) => `This will change the voice of agent ${a.agent_id} to ${a.name ? `"${a.name}"` : a.voice_id}; callers hear it on the next call.` },
142
+ set_agent_transcriber: { ...write('Change agent transcriber', { idempotentHint: true }), guard: true, describe: (a) => `This will change how agent ${a.agent_id} hears callers to ${a.provider}/${a.model} (${a.language}); it applies from the next call.` },
143
+ list_agent_numbers: read('List phone numbers'),
144
+ attach_phone_number: { ...write('Attach phone number'), guard: true, describe: (a) => `This will attach ${a.phone_number} to agent ${a.agent_id}; its voice settings reset to the defaults. Numbers the org does not own are refused (never bought).` },
145
+ search_phone_numbers: read('Search phone numbers to buy'),
146
+ get_phone_number: read('Get phone number details'),
147
+ buy_phone_number: { ...write('Buy phone number'), guard: true, describe: (a) => `This will BUY ${a.phone_number} from Twilio and attach it to agent ${a.agent_id}. The org pays for it every month, and it cannot be undone from here.` },
148
+ detach_phone_number: { ...destroy('Detach phone number'), guard: true, describe: (a) => `This will detach ${a.phone_number} from agent ${a.agent_id}; calls to it stop reaching the agent.` },
149
+ voice_preview: write('Start a test voice call'),
150
+
151
+ // Distributions, templates, solutions
152
+ list_distributions: read('List website distributions'),
153
+ get_embed_code: read('Get embed code of an agent'),
154
+ create_distribution: { ...write('Open agent on a website path'), guard: true, describe: (a) => `This will open agent ${a.agent_id} on ${a.host}${a.path_expression ?? a.path}; visitors of that page see it.` },
155
+ update_distribution: { ...write('Change a website distribution', { idempotentHint: true }), guard: true, describe: (a) => `This will change distribution ${a.distribution_id}; visitors see it immediately.` },
156
+ list_templates: { ...read('List agent templates'), paginate: true },
157
+ create_template: { ...write('Publish agent as template'), guard: true, describe: (a) => `This will publish agent ${a.agent_id} as template "${a.name}"; every org on the platform can copy its prompt and skills.` },
158
+ delete_template: { ...destroy('Remove template'), guard: true, describe: (a) => `This will remove template ${a.template_id} for every org.` },
159
+ create_agent_from_template: write('Create agent from template'),
160
+ list_solutions: read('List solutions'),
161
+
162
+ // Analytics, org settings, audit
163
+ get_analytics: read('Get analytics'),
164
+ list_analytics_conversations: read('Conversations behind an analytics number'),
165
+ list_custom_charts: read('List custom charts'),
166
+ get_custom_chart: read('Get custom chart data'),
167
+ get_org_settings: read('Get org settings'),
168
+ set_org_timezone: { ...write('Set org timezone', { idempotentHint: true }), guard: true, describe: (a) => `This will set the org timezone to ${a.timezone}.` },
169
+ set_business_hours: { ...destroy('Replace business hours', { idempotentHint: true }), guard: true, describe: (a) => `This will replace the org business hours (enabled: ${a.enabled}).` },
170
+ add_holiday: { ...write('Add holiday'), guard: true, describe: (a) => `This will close the org on ${a.date} (${a.name}).` },
171
+ set_org_admin_settings: { ...write('Change org admin settings', { idempotentHint: true }), guard: true },
172
+ list_audit_logs: read('List audit log'),
173
+
174
+ // Tickets
175
+ list_tickets: read('List tickets'),
176
+ get_ticket: read('Get ticket'),
177
+ create_ticket: write('Create ticket'),
178
+ update_ticket: write('Update, assign or close a ticket'),
179
+ archive_ticket: { ...destroy('Archive ticket'), guard: true, describe: (a) => `This will archive ticket ${a.ticket_id}.` },
180
+ list_ticket_rules: read('List ticket rules'),
181
+ save_ticket_rule: write('Create or change a ticket rule'),
182
+ delete_ticket_rule: { ...destroy('Delete ticket rule'), guard: true, describe: (a) => `This will delete ticket rule ${a.rule_id}; agents stop opening tickets for it.` },
183
+
184
+ // Billing (read-only)
185
+ get_billing: read('Billing status, invoices, usage or plans'),
186
+
187
+ // Campaigns (read-only)
188
+ get_campaigns: read('Read campaigns and templates'),
189
+
190
+ // V2 platform and Jarvis (Darwin)
191
+ platform_list: read('List V2 platform items'),
192
+ platform_get: read('Get a V2 platform item'),
193
+ platform_save: { ...write('Create or change a V2 platform item'), guard: true, describe: (a) => `This will ${a.id ? `change ${a.resource} ${a.id}` : `create a ${a.resource}`} on the V2 platform.` },
194
+ platform_delete: { ...destroy('Delete a V2 platform item'), guard: true, describe: (a) => `This will delete ${a.resource} ${a.id} from the V2 platform.` },
195
+ validate_platform_template: read('Validate a V2 template'),
196
+ run_simulation: { ...write('Run V2 simulations (paid)'), guard: true, describe: (a) => `This will run simulations for V2 agent ${a.agent_id} with paid model calls.` },
197
+ simulation_status: read('Simulation jobs and results'),
198
+ org_evaluations: read('Baseline evaluation coverage'),
199
+ jarvis_create_job: { ...write('Ask Jarvis for baseline evaluations (paid)'), guard: true, describe: (a) => `This will ask Jarvis to generate baseline evaluations for ${((a.bot_ids as unknown[]) ?? []).length} agent(s) with paid model calls.` },
200
+ jarvis_jobs: read('Jarvis jobs'),
201
+ jarvis_chat: { ...write('Chat with Jarvis', { openWorldHint: true }), guard: true, describe: () => 'This sends a message to Jarvis, which may create or change templates, agents or connectors in the org.' },
202
+
203
+ // Chat
204
+ chat_with_agent: write('Chat with agent (test conversation)'),
205
+
206
+ // Evaluations
207
+ run_evaluation: {
208
+ ...write('Run evaluation (paid, cannot be cancelled)'),
209
+ guard: true,
210
+ describe: (a) => `This will evaluate agent ${a.agent_id ?? a.bot_id} on test set ${a.test_set_id}${a.limit ? ` (first ${a.limit} items)` : ''}${a.date_from ? ` against real conversations from ${a.date_from} to ${a.date_to}` : ''} with concurrency ${a.concurrency ?? 1}. It uses paid model calls and cannot be cancelled.`,
211
+ },
212
+ eval_gate_verdict: read('Judge a run like the CI gate'),
213
+ eval_trends: read('Evaluation trends'),
214
+ compare_eval_runs: read('Compare two evaluation runs'),
215
+ eval_report_link: write('Render evaluation report on the server', { idempotentHint: true }),
216
+ eval_quality_metrics: { ...read('Voice quality metric names'), orgScoped: false },
217
+ list_prod_calls: read('List production voice calls'),
218
+ promote_prod_call: { ...write('Promote a call to a regression test', { idempotentHint: true }), guard: true, describe: (a) => `This will add call ${a.session_id} to the agent's "Regressions (review)" test set.` },
219
+ evaluate_transcript: { ...write('Grade a transcript (paid)'), guard: true, describe: (a) => `This will grade a replayed transcript for agent ${a.agent_id} with paid model calls.` },
220
+ list_evaluator_configs: { ...read('List evaluator configs'), paginate: true },
221
+ get_eval_status: read('Get evaluation status'),
222
+ get_eval_results: read('Get evaluation results'),
223
+ get_bot_context: read('Get agent context for evaluation'),
224
+ list_rubrics: { ...read('List rubrics'), paginate: true },
225
+ get_rubric: read('Get rubric'),
226
+ create_rubric: write('Create rubric'),
227
+ update_rubric: write('Update rubric', { idempotentHint: true }),
228
+ delete_rubric: { ...destroy('Delete rubric'), guard: true, describe: (a) => `This will delete rubric ${a.rubric_id}.` },
229
+ list_rubric_versions: read('List rubric versions'),
230
+ list_test_sets: { ...read('List test sets'), paginate: true },
231
+ get_test_set: read('Get test set'),
232
+ create_test_set: write('Create test set'),
233
+ update_test_set: write('Update test set', { idempotentHint: true }),
234
+ delete_test_set: { ...destroy('Delete test set'), guard: true, describe: (a) => `This will delete test set ${a.test_set_id}.` },
235
+ list_test_set_versions: read('List test set versions'),
236
+
237
+ // Reports (write local files)
238
+ export_eval_markdown: { ...write('Export evaluation as Markdown file', { idempotentHint: true }), orgScoped: false },
239
+ export_eval_report: { ...write('Export evaluation PDF report', { idempotentHint: true }), orgScoped: false },
240
+ export_agent_card: write('Export agent card PDF', { idempotentHint: true }),
241
+ };