@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
@@ -1,318 +1,155 @@
1
1
  ---
2
2
  name: agent-builder
3
- description: Build and configure Indemn AI agents — create agents, set prompts, add functions/tools, manage knowledge bases, and test via chat. Use when creating, configuring, or testing agents.
3
+ description: Build and configure Indemn AI agents — create agents with their basics, set prompts and models, add skills and knowledge bases, set voice, publish on a website, and test via chat. Use when creating, configuring, or testing agents.
4
4
  ---
5
5
 
6
6
  # Agent Builder
7
7
 
8
- You build and configure AI agents using the `indemn` CLI. This skill covers the full lifecycle: create an agent, set its prompt, attach functions and knowledge bases, and test via chat.
8
+ You build and configure Indemn AI agents with the `indemn` CLI (or the same actions as `indemn` MCP tools). Lifecycle: create the agent with its basics, set the prompt and model, add skills and knowledge, test by chatting, then publish.
9
9
 
10
- **Prerequisite:** The `indemn` CLI must be installed and authenticated. Run `indemn whoami` to verify.
10
+ **Before anything:** run `indemn whoami`. It shows the platform (dev or production), the user, the session expiry, and which org commands here act on.
11
11
 
12
12
  ---
13
13
 
14
- ## Workflow
14
+ ## Rules that keep you safe
15
15
 
16
- Create agent -> Set prompt & model -> Add functions -> Add knowledge bases -> Link KBs -> Test via chat -> Iterate.
16
+ - **Orgs are never guessed.** Commands act on `--org <id>`, else the folder linked with `indemn link`, else the user's only org. With several orgs and none chosen, the CLI asks, or exits with code 2 and lists them. In MCP, tools take an optional `org_id`; a `needs_input` answer means: ask the user which org, then call again with `org_id`.
17
+ - **Chats are always test conversations.** `indemn chat` and `chat_with_agent` never create billed or analytics-counted conversations; the dashboard shows them with the tester's name.
18
+ - **Changes ask first.** Deletes, imports, prompt and model changes, lifecycle changes and runs show what they would do. In a terminal the CLI asks; scripts pass `--yes`. In MCP, when the host shows an approval form, that form is the question: call the tool and do not ask again in chat. Otherwise the tool returns a `dry_run`; show it, and call again with `confirm: true` only after the user agreed to that exact change. Published agents need `--confirm-published` (CLI) or `confirm_published: true` (MCP) as well.
19
+ - **Exit codes:** 0 ok, 1 error, 2 a choice is needed, 3 log in again (`indemn login`).
20
+ - **Talk in names.** When you report back, call agents, knowledge bases, skills, test sets and runs by their names; show ids only when asked or to tell two items apart. Plain words, short answers, details on request.
17
21
 
18
22
  ---
19
23
 
20
- ## Step 1: Create the Agent
24
+ ## Step 1: Create the agent with its basics
21
25
 
22
- Before creating, determine: name/purpose, channels (WEB, WHATSAPP, etc.), persona, functions needed, knowledge sources, and model (`indemn models [--json]`).
26
+ Decide: name, purpose (one line), channels (`indemn channels list`), system prompt, model (`indemn models`).
23
27
 
24
28
  ```bash
25
- indemn agents create --name "Acme Insurance Assistant" --channels "WEB,WHATSAPP"
29
+ indemn agents create --name "Acme Renewals" --description "Handles policy renewals" \
30
+ --channels WEB --prompt-file ./prompts/renewals.md --model openai/gpt-4.1
26
31
  ```
27
32
 
28
- - `--channels` defaults to `"WEB"` if omitted. Comma-separated for multiple.
29
- - Save the returned agent ID -- every subsequent command needs it.
33
+ - Missing basics are asked in a terminal. An agent with the same name in the org is refused (`--allow-duplicate` overrides).
34
+ - From a template: `indemn templates list`, then `indemn agents create --name "Acme Renewals" --template <template-id>` (copies prompt, model, skills and knowledge; not phone numbers, voice or website paths).
35
+ - MCP: `create_agent` asks the user for missing basics when the host can ask, otherwise returns `needs_input` listing them (`minimal: true` creates with a name only).
30
36
 
31
- ### Other Agent Operations
37
+ Other agent operations:
32
38
 
33
39
  ```bash
34
- indemn agents list [--json] [--limit 20] [--page 2]
35
- indemn agents get <agent-id> [--json]
36
- indemn agents update <agent-id> --name "New Name" --description "Updated description"
37
- indemn agents update <agent-id> --webhook-url "https://example.com/webhook"
38
- indemn agents clone <agent-id>
39
- indemn agents delete <agent-id> # requires confirmation
40
- indemn agents card <agent-id> --output ./agent-card.pdf # branded PDF
40
+ indemn agents list | get <id> | update <id> --name/--description
41
+ indemn agents summary <id> [--full] # what the agent does, before you change it
42
+ indemn agents stats <id> [--from --to] # conversation metrics (test chats excluded)
43
+ indemn agents clone <id> [--name] # copy within the org
44
+ indemn agents export <id> -o agent.json # prompt, greeting, model, skills (secrets redacted), KB ids
45
+ indemn agents import agent.json [--name] [--link-kbs] # recreate in the chosen org
46
+ indemn agents lifecycle <id> prototype|beta|published # owner or org admin only
47
+ indemn agents owner <id> [<user-id>] # show or transfer ownership
48
+ indemn agents delete <id>
41
49
  ```
42
50
 
43
51
  ---
44
52
 
45
- ## Step 2: Set the System Prompt and Model
46
-
47
- ### Inline prompt
48
-
49
- ```bash
50
- indemn config set <agent-id> --prompt "You are an insurance assistant for Acme Corp..."
51
- ```
52
-
53
- ### Prompt from file (preferred for long prompts)
54
-
55
- ```bash
56
- indemn config set <agent-id> --prompt-file ./prompts/acme-assistant.txt
57
- ```
58
-
59
- If both `--prompt` and `--prompt-file` are provided, `--prompt-file` takes precedence.
60
-
61
- ### Set the model
62
-
63
- This controls which LLM the agent uses to generate responses — in conversations and during evaluations. The provider is auto-detected from the model name (claude -> anthropic, gemini -> google, default -> openai). This is NOT the evaluation judge model — that is set per-run via `eval run --eval-model`.
53
+ ## Step 2: Prompt, greeting and model
64
54
 
65
55
  ```bash
66
- indemn config set <agent-id> --model "claude-sonnet-4-20250514"
56
+ indemn config get <agent-id> [--field prompt|greeting|model]
57
+ indemn config set <agent-id> --prompt-file ./prompts/renewals.md # shows a diff and asks
58
+ indemn config set <agent-id> --greeting "Hi! How can I help with your renewal?"
59
+ indemn config set <agent-id> --model anthropic/claude-sonnet-4-6 --dry-run
67
60
  ```
68
61
 
69
- Combine prompt and model in one call:
70
-
71
- ```bash
72
- indemn config set <agent-id> --prompt-file ./prompts/acme.txt --model "claude-sonnet-4-20250514"
73
- ```
74
-
75
- ### Read current configuration
76
-
77
- ```bash
78
- indemn config get <agent-id> [--json]
79
- indemn config get <agent-id> --field prompt
80
- indemn config get <agent-id> --field model
81
- indemn config get <agent-id> --field greeting
82
- ```
62
+ - The CLI reads the configuration back after saving and reports anything that did not save.
63
+ - MCP: `set_prompt` or `set_config`; the confirmation shows the prompt diff.
83
64
 
84
65
  ---
85
66
 
86
- ## Step 3: Add Functions (Tools)
87
-
88
- Functions are tools the agent can invoke during conversation (e.g., generate a quote, transfer to a human, look up policy details).
67
+ ## Step 3: Skills (actions the agent can take)
89
68
 
90
- ### Create a function
69
+ `skills` was called `functions`; both names work.
91
70
 
92
71
  ```bash
93
- indemn functions create <agent-id> --type ACTION --name "get_quote" --description "Generate an insurance quote"
72
+ indemn skills list <agent-id>
73
+ indemn skills create <agent-id> --type rest_api --name get_quote --description "Get a quote" \
74
+ --endpoint https://api.acme.com/quote --method POST --payload-file ./payload.json \
75
+ --auth-type bearer-token --auth-token env:ACME_TOKEN
76
+ indemn skills params add <agent-id> <skill-id> --name zip --type string --description "ZIP code" --required
77
+ indemn skills test <agent-id> <skill-id>
78
+ indemn skills generate <agent-id> --file ./api-description.pdf -o proposal.json # propose, review, then:
79
+ indemn skills bulk-create <agent-id> --file proposal.json
80
+ indemn skills export <agent-id>
81
+ indemn skills import <agent-id> --url <json-url> # REPLACES every skill, including built-in handoff and FAQ retriever
82
+ indemn skills delete <agent-id> <skill-id>
94
83
  ```
95
84
 
96
- ### Add parameters to a function
97
-
98
- ```bash
99
- indemn functions params add <agent-id> <func-id> \
100
- --name "state" --type string --description "US state abbreviation" --required
101
-
102
- indemn functions params add <agent-id> <func-id> \
103
- --name "coverage_amount" --type number --description "Coverage amount in dollars"
104
-
105
- indemn functions params add <agent-id> <func-id> \
106
- --name "has_claims" --type boolean --description "Whether applicant has prior claims"
107
- ```
108
-
109
- Parameter types: `string`, `number`, `boolean`. Use `--required` for mandatory params.
110
-
111
- ### Manage parameters
112
-
113
- ```bash
114
- indemn functions params list <agent-id> <func-id> [--json]
115
- indemn functions params update <agent-id> <func-id> <param-id> --description "Updated desc" --required
116
- indemn functions params delete <agent-id> <func-id> <param-id>
117
- ```
118
-
119
- ### Import functions from an OpenAPI spec
120
-
121
- ```bash
122
- indemn functions import <agent-id> --url "https://api.example.com/openapi.json"
123
- ```
124
-
125
- This parses the spec and creates functions with parameters automatically.
126
-
127
- ### Other function operations
128
-
129
- ```bash
130
- indemn functions list <agent-id> [--json] [--limit 10] [--page 1]
131
- indemn functions update <agent-id> <func-id> --name "updated_name" --description "New desc"
132
- indemn functions test <agent-id> <func-id> [--json]
133
- indemn functions export <agent-id> [--json]
134
- indemn functions delete <agent-id> <func-id> # requires confirmation
135
- indemn functions master-list [--json] # available function templates
136
- ```
85
+ - Secrets: pass `@file`, `env:NAME` or `-` (stdin) to `--auth-token`, `--auth-value` and `--auth-password`; typed values end up in shell history.
86
+ - Names close to the built-in FAQ retriever ("FAQs Retriever", "faq retrieval tool") are refused.
137
87
 
138
88
  ---
139
89
 
140
- ## Step 4: Create and Link Knowledge Bases
141
-
142
- Knowledge bases provide the agent with reference information. Three data source types: QNA pairs, URLs, and files.
143
-
144
- ### Create a knowledge base
145
-
146
- ```bash
147
- indemn kb create --name "Acme FAQ" --type QNA
148
- indemn kb create --name "Product Pages" --type URL
149
- indemn kb create --name "Policy Documents" --type FILE
150
- ```
151
-
152
- Type defaults to `QNA` if omitted. Must be uppercased: `QNA`, `URL`, or `FILE`.
153
-
154
- ### Add data -- QNA pairs
155
-
156
- ```bash
157
- indemn kb data add <kb-id> --question "What is the deductible?" --answer "The standard deductible is $500."
158
- ```
159
-
160
- ### Add data -- URL scraping
161
-
162
- ```bash
163
- indemn kb data add <kb-id> --source-url "https://acme.com/faq"
164
- ```
165
-
166
- Scrapes the URL and ingests the content.
167
-
168
- ### Add data -- File upload
169
-
170
- ```bash
171
- indemn kb data add <kb-id> --file ./documents/policy-handbook.pdf
172
- ```
173
-
174
- Uploads the file and polls until processing is complete.
175
-
176
- ### Bulk import QNA pairs from a file
177
-
178
- ```bash
179
- indemn kb import <kb-id> --file ./qna-pairs.json
180
- ```
181
-
182
- The file must be a JSON array of `{question, answer}` objects:
183
-
184
- ```json
185
- [
186
- {"question": "What is a deductible?", "answer": "The amount you pay before coverage kicks in."},
187
- {"question": "What is a premium?", "answer": "The amount you pay for your insurance policy."}
188
- ]
189
- ```
190
-
191
- Each pair is added individually. Progress is shown during import.
192
-
193
- ### Link knowledge bases to an agent
194
-
195
- ```bash
196
- indemn kb link <agent-id> <kb-id>
197
- indemn kb link <agent-id> <kb-id-1> <kb-id-2> <kb-id-3> # link multiple at once
198
- ```
199
-
200
- The link command is variadic -- pass multiple KB IDs to link them all in one call.
201
-
202
- ### Unlink a knowledge base
90
+ ## Step 4: Knowledge bases
203
91
 
204
92
  ```bash
93
+ indemn kb create --name "Acme FAQ" --type QNA # QNA, URL or FILE
94
+ indemn kb data add <kb-id> --question "What is the deductible?" --answer "$500."
95
+ indemn kb data add <kb-id> --source-url https://acme.com/faq
96
+ indemn kb data add <kb-id> --file ./policy-handbook.pdf
97
+ indemn kb status <kb-id> # crawl and import progress
98
+ indemn kb data chunks <kb-id> <source-id> # what the agent actually learned
99
+ indemn kb data reimport <kb-id> <source-id> # re-crawl after the site changed
100
+ indemn kb link <agent-id> <kb-id> [<kb-id>...]
101
+ indemn kb check "Can I pay monthly?" # would the knowledge answer this?
102
+ indemn kb gaps --agent <agent-id> [--themes] # questions agents could not answer
205
103
  indemn kb unlink <agent-id> <kb-id>
206
- ```
207
-
208
- ### Other KB operations
209
-
210
- ```bash
211
- indemn kb list [--json] [--limit 20] [--page 1]
212
- indemn kb get <kb-id> [--json]
213
- indemn kb update <kb-id> --name "Updated Name"
214
- indemn kb delete <kb-id> # requires confirmation
215
- indemn kb data list <kb-id> [--json] [--limit 20] [--page 1] # shows Total, Page X of Y
216
- indemn kb data update <kb-id> <source-id> --question "New Q" --answer "New A"
217
- indemn kb data update <kb-id> <source-id> --source-url "https://new-url.com"
218
- indemn kb data update <kb-id> <source-id> --content "Replacement content"
219
- indemn kb data delete <kb-id> <source-id> # requires confirmation
220
- indemn kb export <kb-id> --format csv # or xlsx
221
- indemn kb import <kb-id> --file ./qna-pairs.json # bulk import QNA pairs
104
+ indemn kb delete <kb-id> # unlink from agents first
222
105
  ```
223
106
 
224
107
  ---
225
108
 
226
- ## Step 5: Test via Chat
227
-
228
- ### Interactive mode
109
+ ## Step 5: Test by chatting
229
110
 
230
111
  ```bash
231
- indemn chat <agent-id>
112
+ indemn chat <agent-id> # interactive
113
+ indemn chat <agent-id> --message "I want to renew" --json
114
+ indemn conversations list --agent <agent-id> --cli-only
115
+ indemn conversations get <conversation-id> --agent <agent-id>
116
+ indemn conversations export <conversation-id> --agent <agent-id> --as-testset -o case.json
232
117
  ```
233
118
 
234
- Opens a live chat session. Type messages, see responses in real time. Ctrl+C to exit.
235
-
236
- ### Single message (scripting / quick check)
237
-
238
- ```bash
239
- indemn chat <agent-id> --message "What types of insurance do you offer?"
240
- ```
119
+ - The CLI checks the conversation was stored as a test in the right org before sending anything, and prints its dashboard link.
120
+ - MCP: `chat_with_agent` returns `session_id`; pass it back to continue, and `end_conversation: true` on the last turn.
121
+ - A live conversation opened by mistake: `indemn conversations mark-test <ids...> --agent <agent-id>`.
241
122
 
242
- Sends one message, prints the response, exits.
123
+ ---
243
124
 
244
- ### Resume a previous session
125
+ ## Step 6: Voice (agents with a phone number)
245
126
 
246
127
  ```bash
247
- indemn chat <agent-id> --session <session-id>
128
+ indemn agents numbers list # numbers the org owns
129
+ indemn agents numbers search --area-code 331 # free; ask first: local (which area code) or toll-free; show 4-5
130
+ indemn agents numbers buy <agent-id> <+1331...> # only after the person chose that number: costs money monthly
131
+ indemn agents numbers get <agent-id> # the agent's number, location and voice settings
132
+ indemn agents numbers attach <agent-id> <+1555...> # a number the org already owns
133
+ indemn voices list --provider cartesia --language en --gender feminine
134
+ indemn agents voice set <agent-id> --voice-id <id> --name <name> --gender <g> --language en --country US
135
+ indemn agents voice play <agent-id> -o sample.mp3
136
+ indemn agents voice-preview <agent-id> # browser link for a test call (1 hour)
248
137
  ```
249
138
 
250
- Continues an existing conversation thread with its history intact.
251
-
252
139
  ---
253
140
 
254
- ## Step 6: Iterate
255
-
256
- After testing, refine: update the prompt (`config set --prompt-file`), add functions (`functions create`), add/update KB data (`kb data add` / `kb data update`), or switch models (`config set --model`). Repeat steps 2-5 until the agent performs correctly.
257
-
258
- ## Complete Build Example
141
+ ## Step 7: Publish on a website
259
142
 
260
143
  ```bash
261
- # 1. Create agent
262
- indemn agents create --name "Acme Wedding Insurance" --channels "WEB"
263
- # -> agent_id: abc123
264
-
265
- # 2. Set prompt and model
266
- indemn config set abc123 --prompt-file ./prompts/wedding.txt --model "claude-sonnet-4-20250514"
267
-
268
- # 3. Add functions
269
- indemn functions create abc123 --type ACTION --name "get_quote" --description "Generate a wedding insurance quote"
270
- # -> func_id: func456
271
- indemn functions params add abc123 func456 --name "event_date" --type string --description "Wedding date" --required
272
- indemn functions params add abc123 func456 --name "guest_count" --type number --description "Number of guests" --required
273
- indemn functions params add abc123 func456 --name "venue_cost" --type number --description "Total venue cost in dollars"
274
-
275
- # 4. Create and populate knowledge base
276
- indemn kb create --name "Wedding FAQ" --type QNA
277
- # -> kb_id: kb789
278
- indemn kb data add kb789 --question "What does wedding insurance cover?" --answer "Coverage includes venue damage, vendor no-shows, severe weather, and illness."
279
- indemn kb data add kb789 --source-url "https://acme.com/wedding-insurance/faq"
280
-
281
- # 5. Link KB to agent
282
- indemn kb link abc123 kb789
283
-
284
- # 6. Test
285
- indemn chat abc123 --message "Hi, I'm getting married in June and want to protect my investment."
286
- indemn chat abc123 # interactive session for deeper testing
144
+ indemn distributions create --agent <agent-id> --host www.acme.com --path /renewals
145
+ indemn agents embed <agent-id> # the script tag to put on the site
146
+ indemn agents lifecycle <agent-id> published
287
147
  ```
288
148
 
289
149
  ---
290
150
 
291
- ## CLI Quick Reference
292
-
293
- | Group | Command | Purpose |
294
- |-------|---------|---------|
295
- | **Agents** | `agents list / get / create / update / delete` | CRUD operations |
296
- | | `agents clone <id>` | Duplicate an agent |
297
- | | `agents card <id> [--output <path>]` | Generate branded PDF |
298
- | **Config** | `config get <id> [--field prompt\|model\|greeting]` | Read configuration |
299
- | | `config set <id> [--prompt\|--prompt-file\|--model]` | Write configuration |
300
- | **Functions** | `functions list / create / update / delete` | CRUD operations |
301
- | | `functions test <id> <func-id>` | Test a function |
302
- | | `functions export <id>` | Export all functions |
303
- | | `functions import <id> --url "<spec>"` | Import from OpenAPI |
304
- | | `functions master-list` | Available templates |
305
- | | `functions params list / add / update / delete` | Manage parameters |
306
- | **KB** | `kb list / get / create / update / delete` | CRUD operations |
307
- | | `kb data list / add / update / delete` | Manage KB entries |
308
- | | `kb link <agent-id> <kb-id...>` | Link KB(s) to agent |
309
- | | `kb unlink <agent-id> <kb-id>` | Unlink KB from agent |
310
- | | `kb export <kb-id> [--format csv\|xlsx]` | Export KB data |
311
- | | `kb import <kb-id> --file <path>` | Import from JSON |
312
- | **Chat** | `chat <id>` | Interactive session |
313
- | | `chat <id> --message "<text>"` | Single message mode |
314
- | | `chat <id> --session <sid>` | Resume session |
315
- | **Other** | `whoami` | Show authenticated user |
316
- | | `models` | List available LLMs |
317
-
318
- All commands accept `--json` for machine-readable output. List commands accept `--limit <n>` and `--page <n>`. Delete commands require confirmation.
151
+ ## Beyond one agent
152
+
153
+ - `indemn org list | current | members`, `indemn link --org <id> [agent-ids]` to pin a project folder.
154
+ - `indemn analytics metrics --agent <id>`, `indemn audit list`, `indemn tickets ...`, `indemn billing status` (read-only), `indemn campaigns list` (read-only).
155
+ - V2 platform and Jarvis: `indemn platform templates list`, `indemn jarvis chat "..."`, `indemn jarvis jobs create --bots <ids>` (baseline evaluations). See the evaluations skill for testing.