@arbol-ai/cli 3.13.0 → 3.15.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 (2) hide show
  1. package/dist/index.js +2781 -632
  2. package/package.json +4 -4
package/dist/index.js CHANGED
@@ -14213,12 +14213,12 @@ var commands = {
14213
14213
  }
14214
14214
  ]
14215
14215
  },
14216
- integrationSkills: {
14217
- description: "Text Agents. Skills a connection publishes (`listConnections`, checked live in Account), each saved with its current text and offered beside `skills`; names must differ from the Agent's own skills. In an update, the complete new set.",
14216
+ integrationProcedures: {
14217
+ description: "Text Agents. Procedures a connection publishes (`listConnections`, checked live in Account), each saved with its current text and run as a free-form procedure beside `procedures`. In an update, the complete new set.",
14218
14218
  maxItems: 32,
14219
14219
  type: "array",
14220
14220
  items: {
14221
- $ref: "#/components/schemas/RaizAgentIntegrationSkillInput"
14221
+ $ref: "#/components/schemas/RaizAgentIntegrationProcedureInput"
14222
14222
  }
14223
14223
  },
14224
14224
  integrationTools: {
@@ -14251,18 +14251,18 @@ var commands = {
14251
14251
  pattern: "^[a-z]{2,3}(-[A-Za-z0-9]{2,8})*$",
14252
14252
  type: "string"
14253
14253
  },
14254
- settings: {
14255
- $ref: "#/components/schemas/RaizAgentSettingsInput",
14256
- description: "How the Agent behaves. In an update, the complete new settings: keys left out return to their default. Text and voice settings apply only to Agents of that modality."
14257
- },
14258
- skills: {
14259
- maxItems: 32,
14260
- description: "Text-only procedures and references loaded on demand. Names and resource paths must be unique; the complete set is limited to 256 KiB. In an update, this replaces the whole set. Skills never grant additional business tools or execute scripts.",
14254
+ procedures: {
14255
+ description: "The Agent's procedures, as a complete set: a procedure left out is removed. Keep each existing procedure's `id`; a new one may omit it.",
14256
+ maxItems: 64,
14261
14257
  type: "array",
14262
14258
  items: {
14263
- $ref: "#/components/schemas/RaizAgentSkill"
14259
+ $ref: "#/components/schemas/RaizAgentProcedureInput"
14264
14260
  }
14265
14261
  },
14262
+ settings: {
14263
+ $ref: "#/components/schemas/RaizAgentSettingsInput",
14264
+ description: "How the Agent behaves. In an update, the complete new settings: keys left out return to their default. Text and voice settings apply only to Agents of that modality."
14265
+ },
14266
14266
  status: {
14267
14267
  description: "A paused Agent answers nothing and places no calls.",
14268
14268
  anyOf: [
@@ -14313,7 +14313,7 @@ var commands = {
14313
14313
  }
14314
14314
  },
14315
14315
  title: "Create an Agent",
14316
- description: "Create an Agent that talks to the organization's contacts. Choose `modality` (`voice`: phone calls; `text`: WhatsApp and web chat) and a `name`; then give it `instructions` (role, goal, limits), and optionally a `firstMessage`, `language`, `timeZone`, `settings`, Knowledge (`knowledgeDocumentIds` of ready documents from `list_knowledge_documents`) and `integrationTools` (connection + tool pairs of the organization's connections in Account, checked live: INTEGRATION_TOOL_UNAVAILABLE), and for a text Agent `integrationSkills` (connection + skill pairs a connection publishes, checked live: INTEGRATION_SKILL_UNAVAILABLE). Next: assign it to a channel with `update_channel`; a voice Agent is published in the background, so check `synced` with `get_agent`. Read the `create-agent` skill (`get_skill`) first.",
14316
+ description: "Create an Agent that talks to the organization's contacts. Choose `modality` (`voice`: phone calls; `text`: WhatsApp and web chat) and a `name`; then give it `instructions` (role, goal, limits), and optionally a `firstMessage`, `language`, `timeZone`, `settings`, Knowledge (`knowledgeDocumentIds` of ready documents from `list_knowledge_documents`) and `integrationTools` (connection + tool pairs of the organization's connections in Account, checked live: INTEGRATION_TOOL_UNAVAILABLE), `procedures` (each a trigger plus free-form Markdown or structured steps, with inline references to the Agent's tools, Knowledge and other procedures: AGENT_PROCEDURES_INVALID says where one is wrong), and for a text Agent `integrationProcedures` (connection + procedure pairs a connection publishes, checked live: INTEGRATION_PROCEDURE_UNAVAILABLE). Next: assign it to a channel with `update_channel`; a voice Agent is published in the background, so check `synced` with `get_agent`. Read the `create-agent` skill (`get_skill`) first.",
14317
14317
  effect: "write",
14318
14318
  confirmation: null,
14319
14319
  hidden: false
@@ -14345,7 +14345,7 @@ var commands = {
14345
14345
  additionalProperties: false
14346
14346
  },
14347
14347
  title: "Get an Agent",
14348
- description: "Read one Agent's complete setup: instructions, first message, language, time zone, settings, integration tools (each with its connection and effect), Knowledge document ids, text-only skills and their references, and channels. `ready` says whether it can hold conversations; for a voice Agent, `synced` says whether its phone line already runs this version, and `syncErrorCode` why not. Read it before `update_agent` and send its `version` as `expectedVersion`.",
14348
+ description: "Read one Agent's complete setup: instructions, first message, language, time zone, settings, integration tools (each with its connection and effect), Knowledge document ids, procedures (trigger plus free-form instructions or structured steps) and connection procedures, and channels. `ready` says whether it can hold conversations; for a voice Agent, `synced` says whether its phone line already runs this version, and `syncErrorCode` why not. Read it before `update_agent` and send its `version` as `expectedVersion`.",
14349
14349
  effect: "read",
14350
14350
  confirmation: null,
14351
14351
  hidden: false
@@ -14624,12 +14624,12 @@ var commands = {
14624
14624
  }
14625
14625
  ]
14626
14626
  },
14627
- integrationSkills: {
14628
- description: "Text Agents. Skills a connection publishes (`listConnections`, checked live in Account), each saved with its current text and offered beside `skills`; names must differ from the Agent's own skills. In an update, the complete new set.",
14627
+ integrationProcedures: {
14628
+ description: "Text Agents. Procedures a connection publishes (`listConnections`, checked live in Account), each saved with its current text and run as a free-form procedure beside `procedures`. In an update, the complete new set.",
14629
14629
  maxItems: 32,
14630
14630
  type: "array",
14631
14631
  items: {
14632
- $ref: "#/components/schemas/RaizAgentIntegrationSkillInput"
14632
+ $ref: "#/components/schemas/RaizAgentIntegrationProcedureInput"
14633
14633
  }
14634
14634
  },
14635
14635
  integrationTools: {
@@ -14662,18 +14662,18 @@ var commands = {
14662
14662
  pattern: "^[a-z]{2,3}(-[A-Za-z0-9]{2,8})*$",
14663
14663
  type: "string"
14664
14664
  },
14665
- settings: {
14666
- $ref: "#/components/schemas/RaizAgentSettingsInput",
14667
- description: "How the Agent behaves. In an update, the complete new settings: keys left out return to their default. Text and voice settings apply only to Agents of that modality."
14668
- },
14669
- skills: {
14670
- maxItems: 32,
14671
- description: "Text-only procedures and references loaded on demand. Names and resource paths must be unique; the complete set is limited to 256 KiB. In an update, this replaces the whole set. Skills never grant additional business tools or execute scripts.",
14665
+ procedures: {
14666
+ description: "The Agent's procedures, as a complete set: a procedure left out is removed. Keep each existing procedure's `id`; a new one may omit it.",
14667
+ maxItems: 64,
14672
14668
  type: "array",
14673
14669
  items: {
14674
- $ref: "#/components/schemas/RaizAgentSkill"
14670
+ $ref: "#/components/schemas/RaizAgentProcedureInput"
14675
14671
  }
14676
14672
  },
14673
+ settings: {
14674
+ $ref: "#/components/schemas/RaizAgentSettingsInput",
14675
+ description: "How the Agent behaves. In an update, the complete new settings: keys left out return to their default. Text and voice settings apply only to Agents of that modality."
14676
+ },
14677
14677
  status: {
14678
14678
  description: "A paused Agent answers nothing and places no calls.",
14679
14679
  anyOf: [
@@ -14745,7 +14745,7 @@ var commands = {
14745
14745
  }
14746
14746
  },
14747
14747
  title: "Update an Agent",
14748
- description: "Change an Agent: instructions, first message, name, language, time zone, settings, integration tools, Knowledge, text-only skills, connection skills or status. Omitted fields stay and `null` clears one; `settings`, `integrationTools`, `integrationSkills`, `skills` and `knowledgeDocumentIds` replace the whole value when given, so read the Agent with `get_agent` first and send its `version` as `expectedVersion` (VERSION_CONFLICT: read it again). `status: paused` stops it from answering and calling. `modality` changes only while it has no channels and no published voice line (AGENT_MODALITY_LOCKED). A voice Agent republishes in the background: check `synced`.",
14748
+ description: "Change an Agent: instructions, first message, name, language, time zone, settings, integration tools, Knowledge, procedures, connection procedures or status. Omitted fields stay and `null` clears one; `settings`, `integrationTools`, `integrationProcedures`, `procedures` and `knowledgeDocumentIds` replace the whole value when given (keep each existing procedure's `id`), so read the Agent with `get_agent` first and send its `version` as `expectedVersion` (VERSION_CONFLICT: read it again). `status: paused` stops it from answering and calling. `modality` changes only while it has no channels and no published voice line (AGENT_MODALITY_LOCKED). A voice Agent republishes in the background: check `synced`.",
14749
14749
  effect: "write",
14750
14750
  confirmation: null,
14751
14751
  hidden: false
@@ -19820,7 +19820,7 @@ var commands = {
19820
19820
  type: "string"
19821
19821
  },
19822
19822
  candidate: {
19823
- description: "The candidate version: what changes in what the model reads. Omitted fields keep the live Agent's; `integrationSkills` and `skills` are complete sets, as in `updateAgent`.",
19823
+ description: "The candidate version: what changes in what the model reads. Omitted fields keep the live Agent's; `integrationProcedures` and `procedures` are complete sets, as in `updateAgent`.",
19824
19824
  additionalProperties: false,
19825
19825
  type: "object",
19826
19826
  properties: {
@@ -19837,12 +19837,12 @@ var commands = {
19837
19837
  }
19838
19838
  ]
19839
19839
  },
19840
- integrationSkills: {
19841
- description: "Text Agents. Skills a connection publishes (`listConnections`, checked live in Account), each saved with its current text and offered beside `skills`; names must differ from the Agent's own skills. In an update, the complete new set.",
19840
+ integrationProcedures: {
19841
+ description: "Text Agents. Procedures a connection publishes (`listConnections`, checked live in Account), each saved with its current text and run as a free-form procedure beside `procedures`. In an update, the complete new set.",
19842
19842
  maxItems: 32,
19843
19843
  type: "array",
19844
19844
  items: {
19845
- $ref: "#/components/schemas/RaizAgentIntegrationSkillInput"
19845
+ $ref: "#/components/schemas/RaizAgentIntegrationProcedureInput"
19846
19846
  }
19847
19847
  },
19848
19848
  model: {
@@ -19873,6 +19873,14 @@ var commands = {
19873
19873
  }
19874
19874
  ]
19875
19875
  },
19876
+ procedures: {
19877
+ description: "The Agent's procedures, as a complete set: a procedure left out is removed. Keep each existing procedure's `id`; a new one may omit it.",
19878
+ maxItems: 64,
19879
+ type: "array",
19880
+ items: {
19881
+ $ref: "#/components/schemas/RaizAgentProcedureInput"
19882
+ }
19883
+ },
19876
19884
  reasoningEffort: {
19877
19885
  anyOf: [
19878
19886
  {
@@ -19904,14 +19912,6 @@ var commands = {
19904
19912
  type: "null"
19905
19913
  }
19906
19914
  ]
19907
- },
19908
- skills: {
19909
- maxItems: 32,
19910
- description: "Text-only procedures and references loaded on demand. Names and resource paths must be unique; the complete set is limited to 256 KiB. In an update, this replaces the whole set. Skills never grant additional business tools or execute scripts.",
19911
- type: "array",
19912
- items: {
19913
- $ref: "#/components/schemas/RaizAgentSkill"
19914
- }
19915
19915
  }
19916
19916
  }
19917
19917
  },
@@ -19946,7 +19946,7 @@ var commands = {
19946
19946
  }
19947
19947
  },
19948
19948
  title: "Replay evaluation cases on a candidate",
19949
- description: "With feedbackCaseId, prepare conditional guidance from that kept correction and test it with the Agent’s newest kept cases, always including the source. Do not combine feedbackCaseId with candidate or caseIds. This does not publish. Requires conversation read access. Voice Agents use a spoken-content rehearsal with an independent model (evaluationMode voice_text), not the live voice model, audio, interruptions or telephony. A person must review its applicability to calls before approval. Otherwise measure a candidate version on its kept evaluation cases before publishing it: the WhatsApp Agent rewrites each case's reply with the candidate's `instructions`, `skills`, `integrationSkills`, `model` and `reasoningEffort` (omitted ones stay as the live Agent has them), without running any integration tool (each answers with what it answered in the original conversation) and without sending anything; then a judge model compares each new reply with what the team expects. Replays every kept case, or `caseIds`, at most 50. It calls paid models, so it needs `confirmCost: true`. Follow it with `getEvalRun`; with the Agent's `settings.evalGate`, `updateAgent` publishes exactly this content with `evalRunId`. EVAL_CASES_UNAVAILABLE: no kept case to replay. Not an AI tool.",
19949
+ description: "With feedbackCaseId, prepare conditional guidance from that kept correction and test it with the Agent’s newest kept cases, always including the source. Do not combine feedbackCaseId with candidate or caseIds. This does not publish. Requires conversation read access. Voice Agents use a spoken-content rehearsal with an independent model (evaluationMode voice_text), not the live voice model, audio, interruptions or telephony. A person must review its applicability to calls before approval. Otherwise measure a candidate version on its kept evaluation cases before publishing it: the WhatsApp Agent rewrites each case's reply with the candidate's `instructions`, `procedures`, `integrationProcedures`, `model` and `reasoningEffort` (omitted ones stay as the live Agent has them), without running any integration tool (each answers with what it answered in the original conversation) and without sending anything; then a judge model compares each new reply with what the team expects. Replays every kept case, or `caseIds`, at most 50. It calls paid models, so it needs `confirmCost: true`. Follow it with `getEvalRun`; with the Agent's `settings.evalGate`, `updateAgent` publishes exactly this content with `evalRunId`. EVAL_CASES_UNAVAILABLE: no kept case to replay. Not an AI tool.",
19950
19950
  effect: "write",
19951
19951
  confirmation: null,
19952
19952
  hidden: false
@@ -23263,7 +23263,7 @@ var commands = {
23263
23263
  }
23264
23264
  },
23265
23265
  title: "Look up an exact IPS invoice reference",
23266
- description: "Look up one exact invoice prefix and number in the active billing connection’s institution. Returns only the number of matching report rows. A successful empty report does not establish rejection, payment or a filing receipt.",
23266
+ description: "Look up one exact invoice prefix and number in the active billing connection’s institution. Returns the number of matching rows. Outside the provider’s live reporting hours, REPORTING_WINDOW_CLOSED gives the opening hour (inclusive), closing hour (exclusive) and time zone. Payment or rejection requires separate evidence.",
23267
23267
  effect: "read",
23268
23268
  confirmation: null,
23269
23269
  hidden: false
@@ -67002,11 +67002,11 @@ var schemaComponents = {
67002
67002
  "version",
67003
67003
  "channels",
67004
67004
  "instructions",
67005
- "integrationSkills",
67005
+ "integrationProcedures",
67006
67006
  "integrationTools",
67007
67007
  "knowledgeDocumentIds",
67008
- "settings",
67009
- "skills"
67008
+ "procedures",
67009
+ "settings"
67010
67010
  ],
67011
67011
  properties: {
67012
67012
  channelCount: {
@@ -67211,8 +67211,8 @@ var schemaComponents = {
67211
67211
  }
67212
67212
  ]
67213
67213
  },
67214
- integrationSkills: {
67215
- description: "The skills the Agent takes from its connections, each saved with the text its connection published then. Offered beside `skills`.",
67214
+ integrationProcedures: {
67215
+ description: "The procedures the Agent takes from its connections, each saved with the text its connection published then. They run as free-form procedures beside `procedures`.",
67216
67216
  maxItems: 32,
67217
67217
  type: "array",
67218
67218
  items: {
@@ -67221,7 +67221,7 @@ var schemaComponents = {
67221
67221
  required: [
67222
67222
  "connectionId",
67223
67223
  "digest",
67224
- "skill"
67224
+ "procedure"
67225
67225
  ],
67226
67226
  properties: {
67227
67227
  connectionId: {
@@ -67232,13 +67232,13 @@ var schemaComponents = {
67232
67232
  type: "string"
67233
67233
  },
67234
67234
  digest: {
67235
- description: "The digest of the skill the Agent was saved with. When the connection's skill (`listConnections`) has another digest, it changed: the Agent keeps this text until it is saved again.",
67235
+ description: "The digest of the procedure the Agent was saved with. When the connection's procedure (`listConnections`) has another digest, it changed: the Agent keeps this text until it is saved again.",
67236
67236
  maxLength: 64,
67237
67237
  minLength: 1,
67238
67238
  type: "string"
67239
67239
  },
67240
- skill: {
67241
- description: "The skill's name, as its connection lists it.",
67240
+ procedure: {
67241
+ description: "The procedure's name, as its connection lists it.",
67242
67242
  maxLength: 64,
67243
67243
  minLength: 1,
67244
67244
  pattern: "^[a-z0-9]+(-[a-z0-9]+)*$",
@@ -67315,16 +67315,16 @@ var schemaComponents = {
67315
67315
  type: "string"
67316
67316
  }
67317
67317
  },
67318
- settings: {
67319
- $ref: "#/components/schemas/RaizAgentSettings"
67320
- },
67321
- skills: {
67322
- maxItems: 32,
67323
- description: "Text-only procedures and references loaded on demand. Names and resource paths must be unique; the complete set is limited to 256 KiB. In an update, this replaces the whole set. Skills never grant additional business tools or execute scripts.",
67318
+ procedures: {
67319
+ description: "The Agent's procedures. The model reads only the triggers until a conversation matches one, then loads that procedure. In an update, the complete new set.",
67320
+ maxItems: 64,
67324
67321
  type: "array",
67325
67322
  items: {
67326
- $ref: "#/components/schemas/RaizAgentSkill"
67323
+ $ref: "#/components/schemas/RaizAgentProcedure"
67327
67324
  }
67325
+ },
67326
+ settings: {
67327
+ $ref: "#/components/schemas/RaizAgentSettings"
67328
67328
  }
67329
67329
  }
67330
67330
  },
@@ -67399,12 +67399,12 @@ var schemaComponents = {
67399
67399
  }
67400
67400
  ]
67401
67401
  },
67402
- RaizAgentIntegrationSkillInput: {
67402
+ RaizAgentIntegrationProcedureInput: {
67403
67403
  additionalProperties: false,
67404
67404
  type: "object",
67405
67405
  required: [
67406
67406
  "connectionId",
67407
- "skill"
67407
+ "procedure"
67408
67408
  ],
67409
67409
  properties: {
67410
67410
  connectionId: {
@@ -67414,8 +67414,8 @@ var schemaComponents = {
67414
67414
  pattern: "^[A-Za-z0-9_-]+$",
67415
67415
  type: "string"
67416
67416
  },
67417
- skill: {
67418
- description: "The skill's name, as its connection lists it.",
67417
+ procedure: {
67418
+ description: "The procedure's name, as its connection lists it.",
67419
67419
  maxLength: 64,
67420
67420
  minLength: 1,
67421
67421
  pattern: "^[a-z0-9]+(-[a-z0-9]+)*$",
@@ -67540,451 +67540,2574 @@ var schemaComponents = {
67540
67540
  }
67541
67541
  }
67542
67542
  },
67543
- RaizAgentSettings: {
67543
+ RaizAgentProcedure: {
67544
67544
  additionalProperties: false,
67545
67545
  type: "object",
67546
67546
  required: [
67547
- "humanEscalation",
67548
- "recoveryManager",
67549
- "automaticKnowledge",
67550
- "attachmentReader",
67551
- "budgetExhaustedMessage",
67552
- "closingMessage",
67553
- "evalGate",
67554
- "followUpAfterMinutes",
67555
- "followUpMessage",
67556
- "greeting",
67557
- "handoffMessage",
67558
- "humanReplyTimeoutMinutes",
67559
- "investigationsEnabled",
67560
- "model",
67561
- "modelTrial",
67562
- "monthlyTokenBudget",
67563
- "pauseOnHumanReply",
67564
- "policy",
67565
- "pollPendingOperations",
67566
- "reasoningEffort",
67567
- "replyChoices",
67568
- "sessionCloseAfterMinutes",
67569
- "temperature",
67570
- "toolDiscovery",
67571
- "voice"
67547
+ "content",
67548
+ "id",
67549
+ "name",
67550
+ "status",
67551
+ "steps",
67552
+ "trigger",
67553
+ "type"
67572
67554
  ],
67573
67555
  properties: {
67574
- humanEscalation: {
67575
- anyOf: [
67576
- {
67577
- description: "Per-Agent human escalation policy. Instructions apply to voice and text. Null keeps the default instructions. A WhatsApp handoff stays with the team until a person explicitly resumes AI; no timeout resumes it.",
67578
- additionalProperties: false,
67579
- type: "object",
67580
- required: [
67581
- "instructions"
67582
- ],
67583
- properties: {
67584
- instructions: {
67585
- anyOf: [
67586
- {
67587
- maxLength: 4000,
67588
- description: "When this Agent should ask the business's team to intervene, using only its available handoff capabilities. Null keeps the default instructions; an explicit request for a person is always respected.",
67589
- type: "string"
67590
- },
67591
- {
67592
- type: "null"
67593
- }
67594
- ]
67595
- }
67596
- }
67597
- },
67598
- {
67599
- type: "null"
67600
- }
67601
- ]
67602
- },
67603
- recoveryManager: {
67604
- anyOf: [
67605
- {
67606
- description: "Optional WhatsApp recovery advisor. Null or enabled=false disables it. A journaled evidence check precedes any paid review. One tool-free model call per turn before autonomous escalation or after terminal provider failure; unresolved terminal recovery hands off. Completed handoffs and conservatively recognized human requests bypass generation. Model selects the existing provider route. Prices must be conservative upper bounds including provider overhead; missing or invalid prices disable recovery. The cost bound covers only the advisor. No tools or automatic provider retries.",
67607
- additionalProperties: false,
67608
- type: "object",
67609
- required: [
67610
- "enabled",
67611
- "model",
67612
- "maxAttempts",
67613
- "timeoutMs",
67614
- "maxInputTokens",
67615
- "maxOutputTokens",
67616
- "maxCostUsd",
67617
- "inputUsdPerMillion",
67618
- "outputUsdPerMillion"
67619
- ],
67620
- properties: {
67621
- enabled: {
67622
- type: "boolean"
67623
- },
67624
- instructions: {
67625
- anyOf: [
67626
- {
67627
- maxLength: 4000,
67628
- description: "Operator criteria for when the recovery advisor should help or leave the case to a person. They never override consent, tool permissions, unknown-write fences or an explicit human request. Null keeps the default criteria.",
67629
- type: "string"
67630
- },
67631
- {
67632
- type: "null"
67633
- }
67634
- ]
67635
- },
67636
- advisorAgentId: {
67637
- anyOf: [
67638
- {
67639
- description: "Optional active text Agent in the same organization, other than this Agent, whose instructions and skills provide specialist guidance. The configured recovery model and cost bounds stay unchanged; no specialist tools or conversation history are accessed.",
67640
- examples: [
67641
- "agt_01m45h8q2rf3t9w6y7z0b1c2d3"
67642
- ],
67643
- pattern: "^agt_(?:[0-7][0-9a-hjkmnp-tv-z]{25}|(?:[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}|[a-f0-9]{32}))$",
67644
- type: "string"
67645
- },
67646
- {
67647
- type: "null"
67648
- }
67649
- ]
67650
- },
67651
- model: {
67652
- description: "`arbolito/agile`: quickest and least expensive, for direct conversations. `arbolito/balanced`: more deliberate answers at moderate cost. `arbolito/advanced`: strong reasoning for complex instructions and many tools, with an adjustable `reasoningEffort`. `arbolito/top`: the most capable, for the hardest cases, with an adjustable `reasoningEffort` up to `xhigh`. Every tier reads images and PDF documents.",
67653
- anyOf: [
67654
- {
67655
- const: "arbolito/agile",
67656
- type: "string"
67657
- },
67658
- {
67659
- const: "arbolito/balanced",
67660
- type: "string"
67661
- },
67662
- {
67663
- const: "arbolito/advanced",
67664
- type: "string"
67665
- },
67666
- {
67667
- const: "arbolito/top",
67668
- type: "string"
67669
- }
67670
- ]
67671
- },
67672
- maxAttempts: {
67673
- const: 1,
67674
- type: "number"
67675
- },
67676
- timeoutMs: {
67677
- minimum: 100,
67678
- maximum: 15000,
67679
- type: "integer"
67680
- },
67681
- maxInputTokens: {
67682
- minimum: 4096,
67683
- maximum: 131072,
67684
- type: "integer"
67685
- },
67686
- maxOutputTokens: {
67687
- minimum: 128,
67688
- maximum: 1024,
67689
- type: "integer"
67690
- },
67691
- maxCostUsd: {
67692
- exclusiveMinimum: 0,
67693
- maximum: 1,
67694
- type: "number"
67695
- },
67696
- inputUsdPerMillion: {
67697
- exclusiveMinimum: 0,
67698
- maximum: 1000,
67699
- type: "number"
67700
- },
67701
- outputUsdPerMillion: {
67702
- exclusiveMinimum: 0,
67703
- maximum: 1000,
67704
- type: "number"
67705
- }
67706
- }
67707
- },
67708
- {
67709
- type: "null"
67710
- }
67711
- ]
67712
- },
67713
- automaticKnowledge: {
67714
- anyOf: [
67715
- {
67716
- description: "Text Agents. Retrieve relevant passages from this Agent's active Knowledge before a substantive contact message, without a model tool call. Null or false: on-demand search only. Does not store contact memories or learn unreviewed answers.",
67717
- type: "boolean"
67718
- },
67719
- {
67720
- type: "null"
67721
- }
67722
- ]
67723
- },
67724
- attachmentReader: {
67725
- anyOf: [
67726
- {
67727
- description: "Text Agents on WhatsApp. Who reads an image or PDF when the Agent calls `read_attachment`: `vision` (a vision model describes and transcribes it, with a stronger one when the first reads nothing) or `ocr` (text recognition, which also answers the `fields` the Agent asks for, each null when absent or unclear; the vision model reads the file when recognition cannot). With `ocr` the Agent sees files as markers and reads them with `read_attachment`; with `vision`, tiers that read files themselves see the original. Null: `vision`.",
67728
- anyOf: [
67729
- {
67730
- const: "vision",
67731
- type: "string"
67732
- },
67733
- {
67734
- const: "ocr",
67735
- type: "string"
67736
- }
67737
- ]
67738
- },
67739
- {
67740
- type: "null"
67741
- }
67742
- ]
67743
- },
67744
- budgetExhaustedMessage: {
67745
- anyOf: [
67746
- {
67747
- description: "Text Agents on WhatsApp. What the contact reads when the Agent has used its `monthlyTokenBudget`: the conversation then goes to the team, as an escalation does, and the Agent writes nothing until the budget is raised or the month ends. Null: `handoffMessage`, including an empty notice when disabled.",
67748
- maxLength: 1000,
67749
- minLength: 1,
67750
- type: "string"
67751
- },
67752
- {
67753
- type: "null"
67754
- }
67755
- ]
67756
- },
67757
- closingMessage: {
67758
- anyOf: [
67759
- {
67760
- description: "Text Agents on WhatsApp. After a reply that completed an action (an integration tool that changes data succeeded), explicitly finished the case with end_conversation and left nothing pending (no question, no offered choices, no handoff), a contact message that only thanks or closes («gracias», «ok», «listo», an emoji) gets this text at once, without the model; the Agent still reads both in its next turn. Write it in the Agent's language and ask nothing in it. Null: the Agent answers such messages itself.",
67761
- maxLength: 1000,
67762
- minLength: 1,
67763
- type: "string"
67764
- },
67765
- {
67766
- type: "null"
67767
- }
67768
- ]
67556
+ content: {
67557
+ description: 'Free-form procedures: what to do, in Markdown, with inline references such as `[tool id="buscar_citas"]`, `[kb id="kdc_…"]`, `[procedure id="prc_…"]`, `[system_tool id="end_conversation"]` and `{{contact_name}}`. Empty for structured procedures.',
67558
+ maxLength: 50000,
67559
+ type: "string"
67769
67560
  },
67770
- evalGate: {
67771
- anyOf: [
67772
- {
67773
- description: "Text and voice Agents. When true, an `updateAgent` that changes what the model reads (instructions, skills, connection skills, `model` or `reasoningEffort`) must send `evalRunId`: a completed `createEvalRun` of this Agent with exactly that content, in which every case passed (EVAL_GATE_UNMET otherwise). Null: no requirement.",
67774
- type: "boolean"
67775
- },
67776
- {
67777
- type: "null"
67778
- }
67779
- ]
67561
+ id: {
67562
+ description: "The procedure's id (`prc_…`), stable for the Agent's life.",
67563
+ examples: [
67564
+ "prc_01k8f3w2pqv6xs9mhdr0tz7n3b"
67565
+ ],
67566
+ pattern: "^prc_[0-7][0-9a-hjkmnp-tv-z]{25}$",
67567
+ type: "string"
67780
67568
  },
67781
- followUpAfterMinutes: {
67782
- anyOf: [
67783
- {
67784
- description: "Text Agents. When the Agent spoke last and asked something, send `followUpMessage` once after this many minutes of silence (WhatsApp only, inside its 24-hour window). Null disables follow-ups.",
67785
- maximum: 1440,
67786
- minimum: 1,
67787
- type: "integer"
67788
- },
67789
- {
67790
- type: "null"
67791
- }
67792
- ]
67569
+ name: {
67570
+ description: "A short label for people. The model never reads it.",
67571
+ maxLength: 120,
67572
+ minLength: 1,
67573
+ type: "string"
67793
67574
  },
67794
- followUpMessage: {
67575
+ status: {
67576
+ description: "A paused procedure runs on no channel.",
67795
67577
  anyOf: [
67796
67578
  {
67797
- description: "Text Agents. The follow-up text. Null uses a short default in the Agent's language.",
67798
- maxLength: 1000,
67799
- minLength: 1,
67579
+ const: "active",
67800
67580
  type: "string"
67801
67581
  },
67802
67582
  {
67803
- type: "null"
67804
- }
67805
- ]
67806
- },
67807
- greeting: {
67808
- anyOf: [
67809
- {
67810
- $ref: "#/components/schemas/RaizAgentGreeting",
67811
- description: "Text Agents on WhatsApp. How the Agent answers when a contact opens a conversation and nobody from the business has answered it yet. Null: the Agent answers the first message with its own instructions alone."
67812
- },
67813
- {
67814
- type: "null"
67815
- }
67816
- ]
67817
- },
67818
- handoffMessage: {
67819
- anyOf: [
67820
- {
67821
- description: "Text Agents on WhatsApp. The notice appended after an escalation or a requested human handoff. Null: the current localized review notice or the case-specific notice supplied under the Agent's instructions. An empty string disables the notice; the handoff and pause still happen. The model does not write this notice.",
67822
- maxLength: 1000,
67583
+ const: "paused",
67823
67584
  type: "string"
67824
- },
67825
- {
67826
- type: "null"
67827
- }
67828
- ]
67829
- },
67830
- humanReplyTimeoutMinutes: {
67831
- anyOf: [
67832
- {
67833
- description: "Text Agents on WhatsApp. After a manual takeover, resume automatic replies when the contact's newest message waits this many minutes. An Agent handoff always stays with the team until a person explicitly resumes AI. Null: only a person resumes automatic replies.",
67834
- maximum: 1440,
67835
- minimum: 1,
67836
- type: "integer"
67837
- },
67838
- {
67839
- type: "null"
67840
67585
  }
67841
67586
  ]
67842
67587
  },
67843
- investigationsEnabled: {
67844
- anyOf: [
67845
- {
67846
- description: "Opt this Agent into internal root-cause investigations of tool failures, human escalations, failed outcomes and negative feedback. Incidents are grouped only with participating Agents in the same organization. Null or false: disabled. Turning this off stops new events and pending dispatch when no participating Agent remains; an already active investigation may finish.",
67847
- type: "boolean"
67848
- },
67849
- {
67850
- type: "null"
67851
- }
67852
- ]
67853
- },
67854
- model: {
67855
- anyOf: [
67856
- {
67857
- description: "Text Agents. The tier that writes replies. `arbolito/agile`: quickest and least expensive, for direct conversations. `arbolito/balanced`: more deliberate answers at moderate cost. `arbolito/advanced`: strong reasoning for complex instructions and many tools, with an adjustable `reasoningEffort`. `arbolito/top`: the most capable, for the hardest cases, with an adjustable `reasoningEffort` up to `xhigh`. Every tier reads images and PDF documents. Null: the default, as `arbolito/agile`.",
67858
- anyOf: [
67859
- {
67860
- const: "arbolito/agile",
67861
- type: "string"
67862
- },
67863
- {
67864
- const: "arbolito/balanced",
67865
- type: "string"
67866
- },
67867
- {
67868
- const: "arbolito/advanced",
67869
- type: "string"
67870
- },
67871
- {
67872
- const: "arbolito/top",
67873
- type: "string"
67588
+ steps: {
67589
+ description: "Structured procedures: the steps, in order. Empty for free-form procedures.",
67590
+ maxItems: 40,
67591
+ type: "array",
67592
+ items: {
67593
+ anyOf: [
67594
+ {
67595
+ additionalProperties: false,
67596
+ type: "object",
67597
+ required: [
67598
+ "instruction",
67599
+ "type"
67600
+ ],
67601
+ properties: {
67602
+ instruction: {
67603
+ description: "What to ask, and when an answer counts. The procedure waits here until the contact answers.",
67604
+ maxLength: 2000,
67605
+ minLength: 1,
67606
+ type: "string"
67607
+ },
67608
+ type: {
67609
+ const: "ask",
67610
+ type: "string"
67611
+ }
67874
67612
  }
67875
- ]
67876
- },
67877
- {
67878
- type: "null"
67879
- }
67880
- ]
67881
- },
67882
- modelTrial: {
67883
- anyOf: [
67884
- {
67885
- $ref: "#/components/schemas/RaizAgentModelTrial",
67886
- description: "Text Agents on WhatsApp. Answer a stable share of the Agent's new conversations with another tier, to compare it with `model` on real traffic. A conversation keeps the tier its first reply used while the trial lasts (one already open when the trial starts stays on `model`); removing the trial returns every conversation to `model`. Null: no trial."
67887
- },
67888
- {
67889
- type: "null"
67890
- }
67891
- ]
67892
- },
67893
- monthlyTokenBudget: {
67894
- anyOf: [
67895
- {
67896
- description: "Text Agents. Tokens (input, cached input included, plus output) the Agent may use per calendar month (UTC), on every channel. On WhatsApp, a reply that would start past it does not run: the contact reads `budgetExhaustedMessage` and the team continues; at 80 % the API logs an alert once a month. Null: no limit.",
67897
- maximum: 1000000000000,
67898
- minimum: 1e4,
67899
- type: "integer"
67900
- },
67901
- {
67902
- type: "null"
67903
- }
67904
- ]
67905
- },
67906
- pauseOnHumanReply: {
67907
- anyOf: [
67908
- {
67909
- description: "Text Agents on WhatsApp: pause automatic replies when a live WhatsApp Business App message that says something (not a reaction, an edit or a deletion) proves a person took over. Null: disabled. The recipient stays paused until resumed or until that conversation closes; their next conversation starts with the AI.",
67910
- type: "boolean"
67911
- },
67912
- {
67913
- type: "null"
67914
- }
67915
- ]
67916
- },
67917
- policy: {
67918
- anyOf: [
67919
- {
67920
- $ref: "#/components/schemas/RaizAgentTurnPolicy",
67921
- description: "Text Agents on WhatsApp. Limits on each reply: model calls, output, writes per step, repeated reads, cached reads and deferred tools. Null keeps every default."
67922
- },
67923
- {
67924
- type: "null"
67925
- }
67926
- ]
67927
- },
67928
- pollPendingOperations: {
67929
- anyOf: [
67930
- {
67931
- description: "Text Agents on WhatsApp: when a reply ends while an integration answered that its work is still pending (`status: pending` with an `operationId`) and the same connection offers `getOperation`, Raíz checks it again on its own and the Agent answers with the result, without waiting for the contact to write. Null: disabled.",
67932
- type: "boolean"
67933
- },
67934
- {
67935
- type: "null"
67936
- }
67937
- ]
67938
- },
67939
- reasoningEffort: {
67940
- anyOf: [
67941
- {
67942
- description: "Text Agents whose tier reasons (`arbolito/advanced`, `arbolito/top`, or an Agent already running a model that reasons): `none` answers fastest, `high` deliberates most, and `xhigh`, on `arbolito/advanced` and `arbolito/top`, deliberates past it. Null: the tier's default. A tier that does not reason refuses it (AGENT_SETTINGS_INVALID).",
67943
- anyOf: [
67944
- {
67945
- const: "none",
67946
- type: "string"
67947
- },
67948
- {
67949
- const: "low",
67950
- type: "string"
67951
- },
67952
- {
67953
- const: "medium",
67954
- type: "string"
67955
- },
67956
- {
67957
- const: "high",
67958
- type: "string"
67959
- },
67960
- {
67961
- const: "xhigh",
67962
- type: "string"
67613
+ },
67614
+ {
67615
+ additionalProperties: false,
67616
+ type: "object",
67617
+ required: [
67618
+ "instruction",
67619
+ "type"
67620
+ ],
67621
+ properties: {
67622
+ instruction: {
67623
+ description: "What to convey, in the Agent's own words. The procedure continues without waiting.",
67624
+ maxLength: 2000,
67625
+ minLength: 1,
67626
+ type: "string"
67627
+ },
67628
+ type: {
67629
+ const: "tell",
67630
+ type: "string"
67631
+ }
67963
67632
  }
67964
- ]
67965
- },
67966
- {
67967
- type: "null"
67968
- }
67969
- ]
67970
- },
67971
- replyChoices: {
67972
- anyOf: [
67973
- {
67974
- description: "Text Agents. Let the Agent offer tap-to-answer options (WhatsApp buttons and lists, web reply options). Null: allowed.",
67975
- type: "boolean"
67976
- },
67977
- {
67978
- type: "null"
67979
- }
67980
- ]
67981
- },
67982
- sessionCloseAfterMinutes: {
67983
- anyOf: [
67984
- {
67985
- description: "Text Agents. Close a conversation after this many minutes without messages. Null: 1440 on WhatsApp, 30 on web.",
67986
- maximum: 10080,
67987
- minimum: 5,
67633
+ },
67634
+ {
67635
+ additionalProperties: false,
67636
+ type: "object",
67637
+ required: [
67638
+ "message",
67639
+ "type"
67640
+ ],
67641
+ properties: {
67642
+ message: {
67643
+ description: "What to say, word for word.",
67644
+ maxLength: 2000,
67645
+ minLength: 1,
67646
+ type: "string"
67647
+ },
67648
+ translations: {
67649
+ description: "The exact message in other languages, by BCP 47 tag, for an Agent that speaks several.",
67650
+ type: "object",
67651
+ patternProperties: {
67652
+ "^[a-z]{2,3}(-[A-Za-z0-9]{2,8})*$": {
67653
+ maxLength: 2000,
67654
+ minLength: 1,
67655
+ type: "string"
67656
+ }
67657
+ }
67658
+ },
67659
+ type: {
67660
+ const: "say",
67661
+ type: "string"
67662
+ }
67663
+ }
67664
+ },
67665
+ {
67666
+ additionalProperties: false,
67667
+ type: "object",
67668
+ required: [
67669
+ "tool",
67670
+ "type"
67671
+ ],
67672
+ properties: {
67673
+ arguments: {
67674
+ description: "Parameters whose value is fixed, by name; the model fills the others.",
67675
+ type: "object",
67676
+ patternProperties: {
67677
+ "^[A-Za-z0-9_.-]{1,128}$": {
67678
+ anyOf: [
67679
+ {
67680
+ additionalProperties: false,
67681
+ type: "object",
67682
+ required: [
67683
+ "value"
67684
+ ],
67685
+ properties: {
67686
+ value: {
67687
+ description: "Always this value."
67688
+ }
67689
+ }
67690
+ },
67691
+ {
67692
+ additionalProperties: false,
67693
+ type: "object",
67694
+ required: [
67695
+ "variable"
67696
+ ],
67697
+ properties: {
67698
+ variable: {
67699
+ description: "The current value of this runtime variable.",
67700
+ pattern: "^[A-Za-z_][A-Za-z0-9_]{0,63}$",
67701
+ type: "string"
67702
+ }
67703
+ }
67704
+ },
67705
+ {
67706
+ additionalProperties: false,
67707
+ type: "object",
67708
+ required: [
67709
+ "omit"
67710
+ ],
67711
+ properties: {
67712
+ omit: {
67713
+ description: "Leave the parameter out of the call.",
67714
+ const: true,
67715
+ type: "boolean"
67716
+ }
67717
+ }
67718
+ }
67719
+ ]
67720
+ }
67721
+ }
67722
+ },
67723
+ instruction: {
67724
+ description: "How to fill the tool's parameters; omitted leaves it to the model.",
67725
+ maxLength: 2000,
67726
+ type: "string"
67727
+ },
67728
+ onFailure: {
67729
+ description: "What to do when the call fails. Omitted or empty: the procedure stops and the Agent handles the failure under its instructions.",
67730
+ maxItems: 40,
67731
+ type: "array",
67732
+ items: {
67733
+ anyOf: [
67734
+ {
67735
+ additionalProperties: false,
67736
+ type: "object",
67737
+ required: [
67738
+ "instruction",
67739
+ "type"
67740
+ ],
67741
+ properties: {
67742
+ instruction: {
67743
+ description: "What to ask, and when an answer counts. The procedure waits here until the contact answers.",
67744
+ maxLength: 2000,
67745
+ minLength: 1,
67746
+ type: "string"
67747
+ },
67748
+ type: {
67749
+ const: "ask",
67750
+ type: "string"
67751
+ }
67752
+ }
67753
+ },
67754
+ {
67755
+ additionalProperties: false,
67756
+ type: "object",
67757
+ required: [
67758
+ "instruction",
67759
+ "type"
67760
+ ],
67761
+ properties: {
67762
+ instruction: {
67763
+ description: "What to convey, in the Agent's own words. The procedure continues without waiting.",
67764
+ maxLength: 2000,
67765
+ minLength: 1,
67766
+ type: "string"
67767
+ },
67768
+ type: {
67769
+ const: "tell",
67770
+ type: "string"
67771
+ }
67772
+ }
67773
+ },
67774
+ {
67775
+ additionalProperties: false,
67776
+ type: "object",
67777
+ required: [
67778
+ "message",
67779
+ "type"
67780
+ ],
67781
+ properties: {
67782
+ message: {
67783
+ description: "What to say, word for word.",
67784
+ maxLength: 2000,
67785
+ minLength: 1,
67786
+ type: "string"
67787
+ },
67788
+ translations: {
67789
+ description: "The exact message in other languages, by BCP 47 tag, for an Agent that speaks several.",
67790
+ type: "object",
67791
+ patternProperties: {
67792
+ "^[a-z]{2,3}(-[A-Za-z0-9]{2,8})*$": {
67793
+ maxLength: 2000,
67794
+ minLength: 1,
67795
+ type: "string"
67796
+ }
67797
+ }
67798
+ },
67799
+ type: {
67800
+ const: "say",
67801
+ type: "string"
67802
+ }
67803
+ }
67804
+ },
67805
+ {
67806
+ additionalProperties: false,
67807
+ type: "object",
67808
+ required: [
67809
+ "procedureId",
67810
+ "type"
67811
+ ],
67812
+ properties: {
67813
+ procedureId: {
67814
+ description: "Another structured procedure of this Agent. It runs to its end, then this procedure continues.",
67815
+ pattern: "^prc_[0-7][0-9a-hjkmnp-tv-z]{25}$",
67816
+ type: "string"
67817
+ },
67818
+ type: {
67819
+ const: "procedure",
67820
+ type: "string"
67821
+ }
67822
+ }
67823
+ },
67824
+ {
67825
+ additionalProperties: false,
67826
+ description: "Finish the conversation after this reply (on a call, hang up). Always the last step of its list.",
67827
+ type: "object",
67828
+ required: [
67829
+ "type"
67830
+ ],
67831
+ properties: {
67832
+ type: {
67833
+ const: "end",
67834
+ type: "string"
67835
+ }
67836
+ }
67837
+ },
67838
+ {
67839
+ additionalProperties: false,
67840
+ description: "Call the failed tool again and, if it fails again, run its failure steps again. Only the last step of a failure handler.",
67841
+ type: "object",
67842
+ required: [
67843
+ "maxRetries",
67844
+ "type"
67845
+ ],
67846
+ properties: {
67847
+ maxRetries: {
67848
+ description: "Calls of the tool after the first one.",
67849
+ maximum: 3,
67850
+ minimum: 1,
67851
+ type: "integer"
67852
+ },
67853
+ type: {
67854
+ const: "retry",
67855
+ type: "string"
67856
+ }
67857
+ }
67858
+ }
67859
+ ]
67860
+ }
67861
+ },
67862
+ tool: {
67863
+ description: "One of the Agent's integration tools by its tool name, or one of Raíz's own tools (`search_knowledge`, `escalate_to_team`, `transfer_to_human`).",
67864
+ pattern: "^[A-Za-z0-9_.-]{1,128}$",
67865
+ type: "string"
67866
+ },
67867
+ type: {
67868
+ const: "tool",
67869
+ type: "string"
67870
+ }
67871
+ }
67872
+ },
67873
+ {
67874
+ additionalProperties: false,
67875
+ description: "The first condition that holds runs its steps; then the procedure continues after the branch.",
67876
+ type: "object",
67877
+ required: [
67878
+ "branches",
67879
+ "type"
67880
+ ],
67881
+ properties: {
67882
+ branches: {
67883
+ maxItems: 8,
67884
+ minItems: 1,
67885
+ type: "array",
67886
+ items: {
67887
+ additionalProperties: false,
67888
+ type: "object",
67889
+ required: [
67890
+ "steps",
67891
+ "when"
67892
+ ],
67893
+ properties: {
67894
+ steps: {
67895
+ maxItems: 40,
67896
+ minItems: 1,
67897
+ type: "array",
67898
+ items: {
67899
+ anyOf: [
67900
+ {
67901
+ additionalProperties: false,
67902
+ type: "object",
67903
+ required: [
67904
+ "instruction",
67905
+ "type"
67906
+ ],
67907
+ properties: {
67908
+ instruction: {
67909
+ description: "What to ask, and when an answer counts. The procedure waits here until the contact answers.",
67910
+ maxLength: 2000,
67911
+ minLength: 1,
67912
+ type: "string"
67913
+ },
67914
+ type: {
67915
+ const: "ask",
67916
+ type: "string"
67917
+ }
67918
+ }
67919
+ },
67920
+ {
67921
+ additionalProperties: false,
67922
+ type: "object",
67923
+ required: [
67924
+ "instruction",
67925
+ "type"
67926
+ ],
67927
+ properties: {
67928
+ instruction: {
67929
+ description: "What to convey, in the Agent's own words. The procedure continues without waiting.",
67930
+ maxLength: 2000,
67931
+ minLength: 1,
67932
+ type: "string"
67933
+ },
67934
+ type: {
67935
+ const: "tell",
67936
+ type: "string"
67937
+ }
67938
+ }
67939
+ },
67940
+ {
67941
+ additionalProperties: false,
67942
+ type: "object",
67943
+ required: [
67944
+ "message",
67945
+ "type"
67946
+ ],
67947
+ properties: {
67948
+ message: {
67949
+ description: "What to say, word for word.",
67950
+ maxLength: 2000,
67951
+ minLength: 1,
67952
+ type: "string"
67953
+ },
67954
+ translations: {
67955
+ description: "The exact message in other languages, by BCP 47 tag, for an Agent that speaks several.",
67956
+ type: "object",
67957
+ patternProperties: {
67958
+ "^[a-z]{2,3}(-[A-Za-z0-9]{2,8})*$": {
67959
+ maxLength: 2000,
67960
+ minLength: 1,
67961
+ type: "string"
67962
+ }
67963
+ }
67964
+ },
67965
+ type: {
67966
+ const: "say",
67967
+ type: "string"
67968
+ }
67969
+ }
67970
+ },
67971
+ {
67972
+ additionalProperties: false,
67973
+ type: "object",
67974
+ required: [
67975
+ "tool",
67976
+ "type"
67977
+ ],
67978
+ properties: {
67979
+ arguments: {
67980
+ description: "Parameters whose value is fixed, by name; the model fills the others.",
67981
+ type: "object",
67982
+ patternProperties: {
67983
+ "^[A-Za-z0-9_.-]{1,128}$": {
67984
+ anyOf: [
67985
+ {
67986
+ additionalProperties: false,
67987
+ type: "object",
67988
+ required: [
67989
+ "value"
67990
+ ],
67991
+ properties: {
67992
+ value: {
67993
+ description: "Always this value."
67994
+ }
67995
+ }
67996
+ },
67997
+ {
67998
+ additionalProperties: false,
67999
+ type: "object",
68000
+ required: [
68001
+ "variable"
68002
+ ],
68003
+ properties: {
68004
+ variable: {
68005
+ description: "The current value of this runtime variable.",
68006
+ pattern: "^[A-Za-z_][A-Za-z0-9_]{0,63}$",
68007
+ type: "string"
68008
+ }
68009
+ }
68010
+ },
68011
+ {
68012
+ additionalProperties: false,
68013
+ type: "object",
68014
+ required: [
68015
+ "omit"
68016
+ ],
68017
+ properties: {
68018
+ omit: {
68019
+ description: "Leave the parameter out of the call.",
68020
+ const: true,
68021
+ type: "boolean"
68022
+ }
68023
+ }
68024
+ }
68025
+ ]
68026
+ }
68027
+ }
68028
+ },
68029
+ instruction: {
68030
+ description: "How to fill the tool's parameters; omitted leaves it to the model.",
68031
+ maxLength: 2000,
68032
+ type: "string"
68033
+ },
68034
+ onFailure: {
68035
+ description: "What to do when the call fails. Omitted or empty: the procedure stops and the Agent handles the failure under its instructions.",
68036
+ maxItems: 40,
68037
+ type: "array",
68038
+ items: {
68039
+ anyOf: [
68040
+ {
68041
+ additionalProperties: false,
68042
+ type: "object",
68043
+ required: [
68044
+ "instruction",
68045
+ "type"
68046
+ ],
68047
+ properties: {
68048
+ instruction: {
68049
+ description: "What to ask, and when an answer counts. The procedure waits here until the contact answers.",
68050
+ maxLength: 2000,
68051
+ minLength: 1,
68052
+ type: "string"
68053
+ },
68054
+ type: {
68055
+ const: "ask",
68056
+ type: "string"
68057
+ }
68058
+ }
68059
+ },
68060
+ {
68061
+ additionalProperties: false,
68062
+ type: "object",
68063
+ required: [
68064
+ "instruction",
68065
+ "type"
68066
+ ],
68067
+ properties: {
68068
+ instruction: {
68069
+ description: "What to convey, in the Agent's own words. The procedure continues without waiting.",
68070
+ maxLength: 2000,
68071
+ minLength: 1,
68072
+ type: "string"
68073
+ },
68074
+ type: {
68075
+ const: "tell",
68076
+ type: "string"
68077
+ }
68078
+ }
68079
+ },
68080
+ {
68081
+ additionalProperties: false,
68082
+ type: "object",
68083
+ required: [
68084
+ "message",
68085
+ "type"
68086
+ ],
68087
+ properties: {
68088
+ message: {
68089
+ description: "What to say, word for word.",
68090
+ maxLength: 2000,
68091
+ minLength: 1,
68092
+ type: "string"
68093
+ },
68094
+ translations: {
68095
+ description: "The exact message in other languages, by BCP 47 tag, for an Agent that speaks several.",
68096
+ type: "object",
68097
+ patternProperties: {
68098
+ "^[a-z]{2,3}(-[A-Za-z0-9]{2,8})*$": {
68099
+ maxLength: 2000,
68100
+ minLength: 1,
68101
+ type: "string"
68102
+ }
68103
+ }
68104
+ },
68105
+ type: {
68106
+ const: "say",
68107
+ type: "string"
68108
+ }
68109
+ }
68110
+ },
68111
+ {
68112
+ additionalProperties: false,
68113
+ type: "object",
68114
+ required: [
68115
+ "procedureId",
68116
+ "type"
68117
+ ],
68118
+ properties: {
68119
+ procedureId: {
68120
+ description: "Another structured procedure of this Agent. It runs to its end, then this procedure continues.",
68121
+ pattern: "^prc_[0-7][0-9a-hjkmnp-tv-z]{25}$",
68122
+ type: "string"
68123
+ },
68124
+ type: {
68125
+ const: "procedure",
68126
+ type: "string"
68127
+ }
68128
+ }
68129
+ },
68130
+ {
68131
+ additionalProperties: false,
68132
+ description: "Finish the conversation after this reply (on a call, hang up). Always the last step of its list.",
68133
+ type: "object",
68134
+ required: [
68135
+ "type"
68136
+ ],
68137
+ properties: {
68138
+ type: {
68139
+ const: "end",
68140
+ type: "string"
68141
+ }
68142
+ }
68143
+ },
68144
+ {
68145
+ additionalProperties: false,
68146
+ description: "Call the failed tool again and, if it fails again, run its failure steps again. Only the last step of a failure handler.",
68147
+ type: "object",
68148
+ required: [
68149
+ "maxRetries",
68150
+ "type"
68151
+ ],
68152
+ properties: {
68153
+ maxRetries: {
68154
+ description: "Calls of the tool after the first one.",
68155
+ maximum: 3,
68156
+ minimum: 1,
68157
+ type: "integer"
68158
+ },
68159
+ type: {
68160
+ const: "retry",
68161
+ type: "string"
68162
+ }
68163
+ }
68164
+ }
68165
+ ]
68166
+ }
68167
+ },
68168
+ tool: {
68169
+ description: "One of the Agent's integration tools by its tool name, or one of Raíz's own tools (`search_knowledge`, `escalate_to_team`, `transfer_to_human`).",
68170
+ pattern: "^[A-Za-z0-9_.-]{1,128}$",
68171
+ type: "string"
68172
+ },
68173
+ type: {
68174
+ const: "tool",
68175
+ type: "string"
68176
+ }
68177
+ }
68178
+ },
68179
+ {
68180
+ additionalProperties: false,
68181
+ type: "object",
68182
+ required: [
68183
+ "procedureId",
68184
+ "type"
68185
+ ],
68186
+ properties: {
68187
+ procedureId: {
68188
+ description: "Another structured procedure of this Agent. It runs to its end, then this procedure continues.",
68189
+ pattern: "^prc_[0-7][0-9a-hjkmnp-tv-z]{25}$",
68190
+ type: "string"
68191
+ },
68192
+ type: {
68193
+ const: "procedure",
68194
+ type: "string"
68195
+ }
68196
+ }
68197
+ },
68198
+ {
68199
+ additionalProperties: false,
68200
+ description: "Finish the conversation after this reply (on a call, hang up). Always the last step of its list.",
68201
+ type: "object",
68202
+ required: [
68203
+ "type"
68204
+ ],
68205
+ properties: {
68206
+ type: {
68207
+ const: "end",
68208
+ type: "string"
68209
+ }
68210
+ }
68211
+ }
68212
+ ]
68213
+ }
68214
+ },
68215
+ when: {
68216
+ description: "A condition the Agent judges from the conversation, such as: The contact says the order already shipped.",
68217
+ maxLength: 2000,
68218
+ minLength: 1,
68219
+ type: "string"
68220
+ }
68221
+ }
68222
+ }
68223
+ },
68224
+ otherwise: {
68225
+ description: "What to do when no condition holds; omitted or empty continues.",
68226
+ maxItems: 40,
68227
+ type: "array",
68228
+ items: {
68229
+ anyOf: [
68230
+ {
68231
+ additionalProperties: false,
68232
+ type: "object",
68233
+ required: [
68234
+ "instruction",
68235
+ "type"
68236
+ ],
68237
+ properties: {
68238
+ instruction: {
68239
+ description: "What to ask, and when an answer counts. The procedure waits here until the contact answers.",
68240
+ maxLength: 2000,
68241
+ minLength: 1,
68242
+ type: "string"
68243
+ },
68244
+ type: {
68245
+ const: "ask",
68246
+ type: "string"
68247
+ }
68248
+ }
68249
+ },
68250
+ {
68251
+ additionalProperties: false,
68252
+ type: "object",
68253
+ required: [
68254
+ "instruction",
68255
+ "type"
68256
+ ],
68257
+ properties: {
68258
+ instruction: {
68259
+ description: "What to convey, in the Agent's own words. The procedure continues without waiting.",
68260
+ maxLength: 2000,
68261
+ minLength: 1,
68262
+ type: "string"
68263
+ },
68264
+ type: {
68265
+ const: "tell",
68266
+ type: "string"
68267
+ }
68268
+ }
68269
+ },
68270
+ {
68271
+ additionalProperties: false,
68272
+ type: "object",
68273
+ required: [
68274
+ "message",
68275
+ "type"
68276
+ ],
68277
+ properties: {
68278
+ message: {
68279
+ description: "What to say, word for word.",
68280
+ maxLength: 2000,
68281
+ minLength: 1,
68282
+ type: "string"
68283
+ },
68284
+ translations: {
68285
+ description: "The exact message in other languages, by BCP 47 tag, for an Agent that speaks several.",
68286
+ type: "object",
68287
+ patternProperties: {
68288
+ "^[a-z]{2,3}(-[A-Za-z0-9]{2,8})*$": {
68289
+ maxLength: 2000,
68290
+ minLength: 1,
68291
+ type: "string"
68292
+ }
68293
+ }
68294
+ },
68295
+ type: {
68296
+ const: "say",
68297
+ type: "string"
68298
+ }
68299
+ }
68300
+ },
68301
+ {
68302
+ additionalProperties: false,
68303
+ type: "object",
68304
+ required: [
68305
+ "tool",
68306
+ "type"
68307
+ ],
68308
+ properties: {
68309
+ arguments: {
68310
+ description: "Parameters whose value is fixed, by name; the model fills the others.",
68311
+ type: "object",
68312
+ patternProperties: {
68313
+ "^[A-Za-z0-9_.-]{1,128}$": {
68314
+ anyOf: [
68315
+ {
68316
+ additionalProperties: false,
68317
+ type: "object",
68318
+ required: [
68319
+ "value"
68320
+ ],
68321
+ properties: {
68322
+ value: {
68323
+ description: "Always this value."
68324
+ }
68325
+ }
68326
+ },
68327
+ {
68328
+ additionalProperties: false,
68329
+ type: "object",
68330
+ required: [
68331
+ "variable"
68332
+ ],
68333
+ properties: {
68334
+ variable: {
68335
+ description: "The current value of this runtime variable.",
68336
+ pattern: "^[A-Za-z_][A-Za-z0-9_]{0,63}$",
68337
+ type: "string"
68338
+ }
68339
+ }
68340
+ },
68341
+ {
68342
+ additionalProperties: false,
68343
+ type: "object",
68344
+ required: [
68345
+ "omit"
68346
+ ],
68347
+ properties: {
68348
+ omit: {
68349
+ description: "Leave the parameter out of the call.",
68350
+ const: true,
68351
+ type: "boolean"
68352
+ }
68353
+ }
68354
+ }
68355
+ ]
68356
+ }
68357
+ }
68358
+ },
68359
+ instruction: {
68360
+ description: "How to fill the tool's parameters; omitted leaves it to the model.",
68361
+ maxLength: 2000,
68362
+ type: "string"
68363
+ },
68364
+ onFailure: {
68365
+ description: "What to do when the call fails. Omitted or empty: the procedure stops and the Agent handles the failure under its instructions.",
68366
+ maxItems: 40,
68367
+ type: "array",
68368
+ items: {
68369
+ anyOf: [
68370
+ {
68371
+ additionalProperties: false,
68372
+ type: "object",
68373
+ required: [
68374
+ "instruction",
68375
+ "type"
68376
+ ],
68377
+ properties: {
68378
+ instruction: {
68379
+ description: "What to ask, and when an answer counts. The procedure waits here until the contact answers.",
68380
+ maxLength: 2000,
68381
+ minLength: 1,
68382
+ type: "string"
68383
+ },
68384
+ type: {
68385
+ const: "ask",
68386
+ type: "string"
68387
+ }
68388
+ }
68389
+ },
68390
+ {
68391
+ additionalProperties: false,
68392
+ type: "object",
68393
+ required: [
68394
+ "instruction",
68395
+ "type"
68396
+ ],
68397
+ properties: {
68398
+ instruction: {
68399
+ description: "What to convey, in the Agent's own words. The procedure continues without waiting.",
68400
+ maxLength: 2000,
68401
+ minLength: 1,
68402
+ type: "string"
68403
+ },
68404
+ type: {
68405
+ const: "tell",
68406
+ type: "string"
68407
+ }
68408
+ }
68409
+ },
68410
+ {
68411
+ additionalProperties: false,
68412
+ type: "object",
68413
+ required: [
68414
+ "message",
68415
+ "type"
68416
+ ],
68417
+ properties: {
68418
+ message: {
68419
+ description: "What to say, word for word.",
68420
+ maxLength: 2000,
68421
+ minLength: 1,
68422
+ type: "string"
68423
+ },
68424
+ translations: {
68425
+ description: "The exact message in other languages, by BCP 47 tag, for an Agent that speaks several.",
68426
+ type: "object",
68427
+ patternProperties: {
68428
+ "^[a-z]{2,3}(-[A-Za-z0-9]{2,8})*$": {
68429
+ maxLength: 2000,
68430
+ minLength: 1,
68431
+ type: "string"
68432
+ }
68433
+ }
68434
+ },
68435
+ type: {
68436
+ const: "say",
68437
+ type: "string"
68438
+ }
68439
+ }
68440
+ },
68441
+ {
68442
+ additionalProperties: false,
68443
+ type: "object",
68444
+ required: [
68445
+ "procedureId",
68446
+ "type"
68447
+ ],
68448
+ properties: {
68449
+ procedureId: {
68450
+ description: "Another structured procedure of this Agent. It runs to its end, then this procedure continues.",
68451
+ pattern: "^prc_[0-7][0-9a-hjkmnp-tv-z]{25}$",
68452
+ type: "string"
68453
+ },
68454
+ type: {
68455
+ const: "procedure",
68456
+ type: "string"
68457
+ }
68458
+ }
68459
+ },
68460
+ {
68461
+ additionalProperties: false,
68462
+ description: "Finish the conversation after this reply (on a call, hang up). Always the last step of its list.",
68463
+ type: "object",
68464
+ required: [
68465
+ "type"
68466
+ ],
68467
+ properties: {
68468
+ type: {
68469
+ const: "end",
68470
+ type: "string"
68471
+ }
68472
+ }
68473
+ },
68474
+ {
68475
+ additionalProperties: false,
68476
+ description: "Call the failed tool again and, if it fails again, run its failure steps again. Only the last step of a failure handler.",
68477
+ type: "object",
68478
+ required: [
68479
+ "maxRetries",
68480
+ "type"
68481
+ ],
68482
+ properties: {
68483
+ maxRetries: {
68484
+ description: "Calls of the tool after the first one.",
68485
+ maximum: 3,
68486
+ minimum: 1,
68487
+ type: "integer"
68488
+ },
68489
+ type: {
68490
+ const: "retry",
68491
+ type: "string"
68492
+ }
68493
+ }
68494
+ }
68495
+ ]
68496
+ }
68497
+ },
68498
+ tool: {
68499
+ description: "One of the Agent's integration tools by its tool name, or one of Raíz's own tools (`search_knowledge`, `escalate_to_team`, `transfer_to_human`).",
68500
+ pattern: "^[A-Za-z0-9_.-]{1,128}$",
68501
+ type: "string"
68502
+ },
68503
+ type: {
68504
+ const: "tool",
68505
+ type: "string"
68506
+ }
68507
+ }
68508
+ },
68509
+ {
68510
+ additionalProperties: false,
68511
+ type: "object",
68512
+ required: [
68513
+ "procedureId",
68514
+ "type"
68515
+ ],
68516
+ properties: {
68517
+ procedureId: {
68518
+ description: "Another structured procedure of this Agent. It runs to its end, then this procedure continues.",
68519
+ pattern: "^prc_[0-7][0-9a-hjkmnp-tv-z]{25}$",
68520
+ type: "string"
68521
+ },
68522
+ type: {
68523
+ const: "procedure",
68524
+ type: "string"
68525
+ }
68526
+ }
68527
+ },
68528
+ {
68529
+ additionalProperties: false,
68530
+ description: "Finish the conversation after this reply (on a call, hang up). Always the last step of its list.",
68531
+ type: "object",
68532
+ required: [
68533
+ "type"
68534
+ ],
68535
+ properties: {
68536
+ type: {
68537
+ const: "end",
68538
+ type: "string"
68539
+ }
68540
+ }
68541
+ }
68542
+ ]
68543
+ }
68544
+ },
68545
+ type: {
68546
+ const: "branch",
68547
+ type: "string"
68548
+ }
68549
+ }
68550
+ },
68551
+ {
68552
+ additionalProperties: false,
68553
+ type: "object",
68554
+ required: [
68555
+ "procedureId",
68556
+ "type"
68557
+ ],
68558
+ properties: {
68559
+ procedureId: {
68560
+ description: "Another structured procedure of this Agent. It runs to its end, then this procedure continues.",
68561
+ pattern: "^prc_[0-7][0-9a-hjkmnp-tv-z]{25}$",
68562
+ type: "string"
68563
+ },
68564
+ type: {
68565
+ const: "procedure",
68566
+ type: "string"
68567
+ }
68568
+ }
68569
+ },
68570
+ {
68571
+ additionalProperties: false,
68572
+ description: "Finish the conversation after this reply (on a call, hang up). Always the last step of its list.",
68573
+ type: "object",
68574
+ required: [
68575
+ "type"
68576
+ ],
68577
+ properties: {
68578
+ type: {
68579
+ const: "end",
68580
+ type: "string"
68581
+ }
68582
+ }
68583
+ }
68584
+ ]
68585
+ }
68586
+ },
68587
+ trigger: {
68588
+ description: "When it applies, from the contact's side: When the contact asks to book or move an appointment. Empty makes a sub-procedure, which only runs when another procedure references it.",
68589
+ maxLength: 1000,
68590
+ type: "string"
68591
+ },
68592
+ type: {
68593
+ description: "`free_form`: instructions the Agent adapts. `structured`: steps that run the same way every time. Fixed once created.",
68594
+ anyOf: [
68595
+ {
68596
+ const: "free_form",
68597
+ type: "string"
68598
+ },
68599
+ {
68600
+ const: "structured",
68601
+ type: "string"
68602
+ }
68603
+ ]
68604
+ }
68605
+ }
68606
+ },
68607
+ RaizAgentProcedureInput: {
68608
+ additionalProperties: false,
68609
+ type: "object",
68610
+ required: [
68611
+ "name",
68612
+ "type"
68613
+ ],
68614
+ properties: {
68615
+ content: {
68616
+ description: 'Free-form procedures: what to do, in Markdown, with inline references such as `[tool id="buscar_citas"]`, `[kb id="kdc_…"]`, `[procedure id="prc_…"]`, `[system_tool id="end_conversation"]` and `{{contact_name}}`. Empty for structured procedures.',
68617
+ maxLength: 50000,
68618
+ type: "string"
68619
+ },
68620
+ id: {
68621
+ description: "The procedure's id (`prc_…`), stable for the Agent's life.",
68622
+ examples: [
68623
+ "prc_01k8f3w2pqv6xs9mhdr0tz7n3b"
68624
+ ],
68625
+ pattern: "^prc_[0-7][0-9a-hjkmnp-tv-z]{25}$",
68626
+ type: "string"
68627
+ },
68628
+ name: {
68629
+ description: "A short label for people. The model never reads it.",
68630
+ maxLength: 120,
68631
+ minLength: 1,
68632
+ type: "string"
68633
+ },
68634
+ status: {
68635
+ description: "A paused procedure runs on no channel.",
68636
+ anyOf: [
68637
+ {
68638
+ const: "active",
68639
+ type: "string"
68640
+ },
68641
+ {
68642
+ const: "paused",
68643
+ type: "string"
68644
+ }
68645
+ ]
68646
+ },
68647
+ steps: {
68648
+ description: "Structured procedures: the steps, in order. Empty for free-form procedures.",
68649
+ maxItems: 40,
68650
+ type: "array",
68651
+ items: {
68652
+ anyOf: [
68653
+ {
68654
+ additionalProperties: false,
68655
+ type: "object",
68656
+ required: [
68657
+ "instruction",
68658
+ "type"
68659
+ ],
68660
+ properties: {
68661
+ instruction: {
68662
+ description: "What to ask, and when an answer counts. The procedure waits here until the contact answers.",
68663
+ maxLength: 2000,
68664
+ minLength: 1,
68665
+ type: "string"
68666
+ },
68667
+ type: {
68668
+ const: "ask",
68669
+ type: "string"
68670
+ }
68671
+ }
68672
+ },
68673
+ {
68674
+ additionalProperties: false,
68675
+ type: "object",
68676
+ required: [
68677
+ "instruction",
68678
+ "type"
68679
+ ],
68680
+ properties: {
68681
+ instruction: {
68682
+ description: "What to convey, in the Agent's own words. The procedure continues without waiting.",
68683
+ maxLength: 2000,
68684
+ minLength: 1,
68685
+ type: "string"
68686
+ },
68687
+ type: {
68688
+ const: "tell",
68689
+ type: "string"
68690
+ }
68691
+ }
68692
+ },
68693
+ {
68694
+ additionalProperties: false,
68695
+ type: "object",
68696
+ required: [
68697
+ "message",
68698
+ "type"
68699
+ ],
68700
+ properties: {
68701
+ message: {
68702
+ description: "What to say, word for word.",
68703
+ maxLength: 2000,
68704
+ minLength: 1,
68705
+ type: "string"
68706
+ },
68707
+ translations: {
68708
+ description: "The exact message in other languages, by BCP 47 tag, for an Agent that speaks several.",
68709
+ type: "object",
68710
+ patternProperties: {
68711
+ "^[a-z]{2,3}(-[A-Za-z0-9]{2,8})*$": {
68712
+ maxLength: 2000,
68713
+ minLength: 1,
68714
+ type: "string"
68715
+ }
68716
+ }
68717
+ },
68718
+ type: {
68719
+ const: "say",
68720
+ type: "string"
68721
+ }
68722
+ }
68723
+ },
68724
+ {
68725
+ additionalProperties: false,
68726
+ type: "object",
68727
+ required: [
68728
+ "tool",
68729
+ "type"
68730
+ ],
68731
+ properties: {
68732
+ arguments: {
68733
+ description: "Parameters whose value is fixed, by name; the model fills the others.",
68734
+ type: "object",
68735
+ patternProperties: {
68736
+ "^[A-Za-z0-9_.-]{1,128}$": {
68737
+ anyOf: [
68738
+ {
68739
+ additionalProperties: false,
68740
+ type: "object",
68741
+ required: [
68742
+ "value"
68743
+ ],
68744
+ properties: {
68745
+ value: {
68746
+ description: "Always this value."
68747
+ }
68748
+ }
68749
+ },
68750
+ {
68751
+ additionalProperties: false,
68752
+ type: "object",
68753
+ required: [
68754
+ "variable"
68755
+ ],
68756
+ properties: {
68757
+ variable: {
68758
+ description: "The current value of this runtime variable.",
68759
+ pattern: "^[A-Za-z_][A-Za-z0-9_]{0,63}$",
68760
+ type: "string"
68761
+ }
68762
+ }
68763
+ },
68764
+ {
68765
+ additionalProperties: false,
68766
+ type: "object",
68767
+ required: [
68768
+ "omit"
68769
+ ],
68770
+ properties: {
68771
+ omit: {
68772
+ description: "Leave the parameter out of the call.",
68773
+ const: true,
68774
+ type: "boolean"
68775
+ }
68776
+ }
68777
+ }
68778
+ ]
68779
+ }
68780
+ }
68781
+ },
68782
+ instruction: {
68783
+ description: "How to fill the tool's parameters; omitted leaves it to the model.",
68784
+ maxLength: 2000,
68785
+ type: "string"
68786
+ },
68787
+ onFailure: {
68788
+ description: "What to do when the call fails. Omitted or empty: the procedure stops and the Agent handles the failure under its instructions.",
68789
+ maxItems: 40,
68790
+ type: "array",
68791
+ items: {
68792
+ anyOf: [
68793
+ {
68794
+ additionalProperties: false,
68795
+ type: "object",
68796
+ required: [
68797
+ "instruction",
68798
+ "type"
68799
+ ],
68800
+ properties: {
68801
+ instruction: {
68802
+ description: "What to ask, and when an answer counts. The procedure waits here until the contact answers.",
68803
+ maxLength: 2000,
68804
+ minLength: 1,
68805
+ type: "string"
68806
+ },
68807
+ type: {
68808
+ const: "ask",
68809
+ type: "string"
68810
+ }
68811
+ }
68812
+ },
68813
+ {
68814
+ additionalProperties: false,
68815
+ type: "object",
68816
+ required: [
68817
+ "instruction",
68818
+ "type"
68819
+ ],
68820
+ properties: {
68821
+ instruction: {
68822
+ description: "What to convey, in the Agent's own words. The procedure continues without waiting.",
68823
+ maxLength: 2000,
68824
+ minLength: 1,
68825
+ type: "string"
68826
+ },
68827
+ type: {
68828
+ const: "tell",
68829
+ type: "string"
68830
+ }
68831
+ }
68832
+ },
68833
+ {
68834
+ additionalProperties: false,
68835
+ type: "object",
68836
+ required: [
68837
+ "message",
68838
+ "type"
68839
+ ],
68840
+ properties: {
68841
+ message: {
68842
+ description: "What to say, word for word.",
68843
+ maxLength: 2000,
68844
+ minLength: 1,
68845
+ type: "string"
68846
+ },
68847
+ translations: {
68848
+ description: "The exact message in other languages, by BCP 47 tag, for an Agent that speaks several.",
68849
+ type: "object",
68850
+ patternProperties: {
68851
+ "^[a-z]{2,3}(-[A-Za-z0-9]{2,8})*$": {
68852
+ maxLength: 2000,
68853
+ minLength: 1,
68854
+ type: "string"
68855
+ }
68856
+ }
68857
+ },
68858
+ type: {
68859
+ const: "say",
68860
+ type: "string"
68861
+ }
68862
+ }
68863
+ },
68864
+ {
68865
+ additionalProperties: false,
68866
+ type: "object",
68867
+ required: [
68868
+ "procedureId",
68869
+ "type"
68870
+ ],
68871
+ properties: {
68872
+ procedureId: {
68873
+ description: "Another structured procedure of this Agent. It runs to its end, then this procedure continues.",
68874
+ pattern: "^prc_[0-7][0-9a-hjkmnp-tv-z]{25}$",
68875
+ type: "string"
68876
+ },
68877
+ type: {
68878
+ const: "procedure",
68879
+ type: "string"
68880
+ }
68881
+ }
68882
+ },
68883
+ {
68884
+ additionalProperties: false,
68885
+ description: "Finish the conversation after this reply (on a call, hang up). Always the last step of its list.",
68886
+ type: "object",
68887
+ required: [
68888
+ "type"
68889
+ ],
68890
+ properties: {
68891
+ type: {
68892
+ const: "end",
68893
+ type: "string"
68894
+ }
68895
+ }
68896
+ },
68897
+ {
68898
+ additionalProperties: false,
68899
+ description: "Call the failed tool again and, if it fails again, run its failure steps again. Only the last step of a failure handler.",
68900
+ type: "object",
68901
+ required: [
68902
+ "maxRetries",
68903
+ "type"
68904
+ ],
68905
+ properties: {
68906
+ maxRetries: {
68907
+ description: "Calls of the tool after the first one.",
68908
+ maximum: 3,
68909
+ minimum: 1,
68910
+ type: "integer"
68911
+ },
68912
+ type: {
68913
+ const: "retry",
68914
+ type: "string"
68915
+ }
68916
+ }
68917
+ }
68918
+ ]
68919
+ }
68920
+ },
68921
+ tool: {
68922
+ description: "One of the Agent's integration tools by its tool name, or one of Raíz's own tools (`search_knowledge`, `escalate_to_team`, `transfer_to_human`).",
68923
+ pattern: "^[A-Za-z0-9_.-]{1,128}$",
68924
+ type: "string"
68925
+ },
68926
+ type: {
68927
+ const: "tool",
68928
+ type: "string"
68929
+ }
68930
+ }
68931
+ },
68932
+ {
68933
+ additionalProperties: false,
68934
+ description: "The first condition that holds runs its steps; then the procedure continues after the branch.",
68935
+ type: "object",
68936
+ required: [
68937
+ "branches",
68938
+ "type"
68939
+ ],
68940
+ properties: {
68941
+ branches: {
68942
+ maxItems: 8,
68943
+ minItems: 1,
68944
+ type: "array",
68945
+ items: {
68946
+ additionalProperties: false,
68947
+ type: "object",
68948
+ required: [
68949
+ "steps",
68950
+ "when"
68951
+ ],
68952
+ properties: {
68953
+ steps: {
68954
+ maxItems: 40,
68955
+ minItems: 1,
68956
+ type: "array",
68957
+ items: {
68958
+ anyOf: [
68959
+ {
68960
+ additionalProperties: false,
68961
+ type: "object",
68962
+ required: [
68963
+ "instruction",
68964
+ "type"
68965
+ ],
68966
+ properties: {
68967
+ instruction: {
68968
+ description: "What to ask, and when an answer counts. The procedure waits here until the contact answers.",
68969
+ maxLength: 2000,
68970
+ minLength: 1,
68971
+ type: "string"
68972
+ },
68973
+ type: {
68974
+ const: "ask",
68975
+ type: "string"
68976
+ }
68977
+ }
68978
+ },
68979
+ {
68980
+ additionalProperties: false,
68981
+ type: "object",
68982
+ required: [
68983
+ "instruction",
68984
+ "type"
68985
+ ],
68986
+ properties: {
68987
+ instruction: {
68988
+ description: "What to convey, in the Agent's own words. The procedure continues without waiting.",
68989
+ maxLength: 2000,
68990
+ minLength: 1,
68991
+ type: "string"
68992
+ },
68993
+ type: {
68994
+ const: "tell",
68995
+ type: "string"
68996
+ }
68997
+ }
68998
+ },
68999
+ {
69000
+ additionalProperties: false,
69001
+ type: "object",
69002
+ required: [
69003
+ "message",
69004
+ "type"
69005
+ ],
69006
+ properties: {
69007
+ message: {
69008
+ description: "What to say, word for word.",
69009
+ maxLength: 2000,
69010
+ minLength: 1,
69011
+ type: "string"
69012
+ },
69013
+ translations: {
69014
+ description: "The exact message in other languages, by BCP 47 tag, for an Agent that speaks several.",
69015
+ type: "object",
69016
+ patternProperties: {
69017
+ "^[a-z]{2,3}(-[A-Za-z0-9]{2,8})*$": {
69018
+ maxLength: 2000,
69019
+ minLength: 1,
69020
+ type: "string"
69021
+ }
69022
+ }
69023
+ },
69024
+ type: {
69025
+ const: "say",
69026
+ type: "string"
69027
+ }
69028
+ }
69029
+ },
69030
+ {
69031
+ additionalProperties: false,
69032
+ type: "object",
69033
+ required: [
69034
+ "tool",
69035
+ "type"
69036
+ ],
69037
+ properties: {
69038
+ arguments: {
69039
+ description: "Parameters whose value is fixed, by name; the model fills the others.",
69040
+ type: "object",
69041
+ patternProperties: {
69042
+ "^[A-Za-z0-9_.-]{1,128}$": {
69043
+ anyOf: [
69044
+ {
69045
+ additionalProperties: false,
69046
+ type: "object",
69047
+ required: [
69048
+ "value"
69049
+ ],
69050
+ properties: {
69051
+ value: {
69052
+ description: "Always this value."
69053
+ }
69054
+ }
69055
+ },
69056
+ {
69057
+ additionalProperties: false,
69058
+ type: "object",
69059
+ required: [
69060
+ "variable"
69061
+ ],
69062
+ properties: {
69063
+ variable: {
69064
+ description: "The current value of this runtime variable.",
69065
+ pattern: "^[A-Za-z_][A-Za-z0-9_]{0,63}$",
69066
+ type: "string"
69067
+ }
69068
+ }
69069
+ },
69070
+ {
69071
+ additionalProperties: false,
69072
+ type: "object",
69073
+ required: [
69074
+ "omit"
69075
+ ],
69076
+ properties: {
69077
+ omit: {
69078
+ description: "Leave the parameter out of the call.",
69079
+ const: true,
69080
+ type: "boolean"
69081
+ }
69082
+ }
69083
+ }
69084
+ ]
69085
+ }
69086
+ }
69087
+ },
69088
+ instruction: {
69089
+ description: "How to fill the tool's parameters; omitted leaves it to the model.",
69090
+ maxLength: 2000,
69091
+ type: "string"
69092
+ },
69093
+ onFailure: {
69094
+ description: "What to do when the call fails. Omitted or empty: the procedure stops and the Agent handles the failure under its instructions.",
69095
+ maxItems: 40,
69096
+ type: "array",
69097
+ items: {
69098
+ anyOf: [
69099
+ {
69100
+ additionalProperties: false,
69101
+ type: "object",
69102
+ required: [
69103
+ "instruction",
69104
+ "type"
69105
+ ],
69106
+ properties: {
69107
+ instruction: {
69108
+ description: "What to ask, and when an answer counts. The procedure waits here until the contact answers.",
69109
+ maxLength: 2000,
69110
+ minLength: 1,
69111
+ type: "string"
69112
+ },
69113
+ type: {
69114
+ const: "ask",
69115
+ type: "string"
69116
+ }
69117
+ }
69118
+ },
69119
+ {
69120
+ additionalProperties: false,
69121
+ type: "object",
69122
+ required: [
69123
+ "instruction",
69124
+ "type"
69125
+ ],
69126
+ properties: {
69127
+ instruction: {
69128
+ description: "What to convey, in the Agent's own words. The procedure continues without waiting.",
69129
+ maxLength: 2000,
69130
+ minLength: 1,
69131
+ type: "string"
69132
+ },
69133
+ type: {
69134
+ const: "tell",
69135
+ type: "string"
69136
+ }
69137
+ }
69138
+ },
69139
+ {
69140
+ additionalProperties: false,
69141
+ type: "object",
69142
+ required: [
69143
+ "message",
69144
+ "type"
69145
+ ],
69146
+ properties: {
69147
+ message: {
69148
+ description: "What to say, word for word.",
69149
+ maxLength: 2000,
69150
+ minLength: 1,
69151
+ type: "string"
69152
+ },
69153
+ translations: {
69154
+ description: "The exact message in other languages, by BCP 47 tag, for an Agent that speaks several.",
69155
+ type: "object",
69156
+ patternProperties: {
69157
+ "^[a-z]{2,3}(-[A-Za-z0-9]{2,8})*$": {
69158
+ maxLength: 2000,
69159
+ minLength: 1,
69160
+ type: "string"
69161
+ }
69162
+ }
69163
+ },
69164
+ type: {
69165
+ const: "say",
69166
+ type: "string"
69167
+ }
69168
+ }
69169
+ },
69170
+ {
69171
+ additionalProperties: false,
69172
+ type: "object",
69173
+ required: [
69174
+ "procedureId",
69175
+ "type"
69176
+ ],
69177
+ properties: {
69178
+ procedureId: {
69179
+ description: "Another structured procedure of this Agent. It runs to its end, then this procedure continues.",
69180
+ pattern: "^prc_[0-7][0-9a-hjkmnp-tv-z]{25}$",
69181
+ type: "string"
69182
+ },
69183
+ type: {
69184
+ const: "procedure",
69185
+ type: "string"
69186
+ }
69187
+ }
69188
+ },
69189
+ {
69190
+ additionalProperties: false,
69191
+ description: "Finish the conversation after this reply (on a call, hang up). Always the last step of its list.",
69192
+ type: "object",
69193
+ required: [
69194
+ "type"
69195
+ ],
69196
+ properties: {
69197
+ type: {
69198
+ const: "end",
69199
+ type: "string"
69200
+ }
69201
+ }
69202
+ },
69203
+ {
69204
+ additionalProperties: false,
69205
+ description: "Call the failed tool again and, if it fails again, run its failure steps again. Only the last step of a failure handler.",
69206
+ type: "object",
69207
+ required: [
69208
+ "maxRetries",
69209
+ "type"
69210
+ ],
69211
+ properties: {
69212
+ maxRetries: {
69213
+ description: "Calls of the tool after the first one.",
69214
+ maximum: 3,
69215
+ minimum: 1,
69216
+ type: "integer"
69217
+ },
69218
+ type: {
69219
+ const: "retry",
69220
+ type: "string"
69221
+ }
69222
+ }
69223
+ }
69224
+ ]
69225
+ }
69226
+ },
69227
+ tool: {
69228
+ description: "One of the Agent's integration tools by its tool name, or one of Raíz's own tools (`search_knowledge`, `escalate_to_team`, `transfer_to_human`).",
69229
+ pattern: "^[A-Za-z0-9_.-]{1,128}$",
69230
+ type: "string"
69231
+ },
69232
+ type: {
69233
+ const: "tool",
69234
+ type: "string"
69235
+ }
69236
+ }
69237
+ },
69238
+ {
69239
+ additionalProperties: false,
69240
+ type: "object",
69241
+ required: [
69242
+ "procedureId",
69243
+ "type"
69244
+ ],
69245
+ properties: {
69246
+ procedureId: {
69247
+ description: "Another structured procedure of this Agent. It runs to its end, then this procedure continues.",
69248
+ pattern: "^prc_[0-7][0-9a-hjkmnp-tv-z]{25}$",
69249
+ type: "string"
69250
+ },
69251
+ type: {
69252
+ const: "procedure",
69253
+ type: "string"
69254
+ }
69255
+ }
69256
+ },
69257
+ {
69258
+ additionalProperties: false,
69259
+ description: "Finish the conversation after this reply (on a call, hang up). Always the last step of its list.",
69260
+ type: "object",
69261
+ required: [
69262
+ "type"
69263
+ ],
69264
+ properties: {
69265
+ type: {
69266
+ const: "end",
69267
+ type: "string"
69268
+ }
69269
+ }
69270
+ }
69271
+ ]
69272
+ }
69273
+ },
69274
+ when: {
69275
+ description: "A condition the Agent judges from the conversation, such as: The contact says the order already shipped.",
69276
+ maxLength: 2000,
69277
+ minLength: 1,
69278
+ type: "string"
69279
+ }
69280
+ }
69281
+ }
69282
+ },
69283
+ otherwise: {
69284
+ description: "What to do when no condition holds; omitted or empty continues.",
69285
+ maxItems: 40,
69286
+ type: "array",
69287
+ items: {
69288
+ anyOf: [
69289
+ {
69290
+ additionalProperties: false,
69291
+ type: "object",
69292
+ required: [
69293
+ "instruction",
69294
+ "type"
69295
+ ],
69296
+ properties: {
69297
+ instruction: {
69298
+ description: "What to ask, and when an answer counts. The procedure waits here until the contact answers.",
69299
+ maxLength: 2000,
69300
+ minLength: 1,
69301
+ type: "string"
69302
+ },
69303
+ type: {
69304
+ const: "ask",
69305
+ type: "string"
69306
+ }
69307
+ }
69308
+ },
69309
+ {
69310
+ additionalProperties: false,
69311
+ type: "object",
69312
+ required: [
69313
+ "instruction",
69314
+ "type"
69315
+ ],
69316
+ properties: {
69317
+ instruction: {
69318
+ description: "What to convey, in the Agent's own words. The procedure continues without waiting.",
69319
+ maxLength: 2000,
69320
+ minLength: 1,
69321
+ type: "string"
69322
+ },
69323
+ type: {
69324
+ const: "tell",
69325
+ type: "string"
69326
+ }
69327
+ }
69328
+ },
69329
+ {
69330
+ additionalProperties: false,
69331
+ type: "object",
69332
+ required: [
69333
+ "message",
69334
+ "type"
69335
+ ],
69336
+ properties: {
69337
+ message: {
69338
+ description: "What to say, word for word.",
69339
+ maxLength: 2000,
69340
+ minLength: 1,
69341
+ type: "string"
69342
+ },
69343
+ translations: {
69344
+ description: "The exact message in other languages, by BCP 47 tag, for an Agent that speaks several.",
69345
+ type: "object",
69346
+ patternProperties: {
69347
+ "^[a-z]{2,3}(-[A-Za-z0-9]{2,8})*$": {
69348
+ maxLength: 2000,
69349
+ minLength: 1,
69350
+ type: "string"
69351
+ }
69352
+ }
69353
+ },
69354
+ type: {
69355
+ const: "say",
69356
+ type: "string"
69357
+ }
69358
+ }
69359
+ },
69360
+ {
69361
+ additionalProperties: false,
69362
+ type: "object",
69363
+ required: [
69364
+ "tool",
69365
+ "type"
69366
+ ],
69367
+ properties: {
69368
+ arguments: {
69369
+ description: "Parameters whose value is fixed, by name; the model fills the others.",
69370
+ type: "object",
69371
+ patternProperties: {
69372
+ "^[A-Za-z0-9_.-]{1,128}$": {
69373
+ anyOf: [
69374
+ {
69375
+ additionalProperties: false,
69376
+ type: "object",
69377
+ required: [
69378
+ "value"
69379
+ ],
69380
+ properties: {
69381
+ value: {
69382
+ description: "Always this value."
69383
+ }
69384
+ }
69385
+ },
69386
+ {
69387
+ additionalProperties: false,
69388
+ type: "object",
69389
+ required: [
69390
+ "variable"
69391
+ ],
69392
+ properties: {
69393
+ variable: {
69394
+ description: "The current value of this runtime variable.",
69395
+ pattern: "^[A-Za-z_][A-Za-z0-9_]{0,63}$",
69396
+ type: "string"
69397
+ }
69398
+ }
69399
+ },
69400
+ {
69401
+ additionalProperties: false,
69402
+ type: "object",
69403
+ required: [
69404
+ "omit"
69405
+ ],
69406
+ properties: {
69407
+ omit: {
69408
+ description: "Leave the parameter out of the call.",
69409
+ const: true,
69410
+ type: "boolean"
69411
+ }
69412
+ }
69413
+ }
69414
+ ]
69415
+ }
69416
+ }
69417
+ },
69418
+ instruction: {
69419
+ description: "How to fill the tool's parameters; omitted leaves it to the model.",
69420
+ maxLength: 2000,
69421
+ type: "string"
69422
+ },
69423
+ onFailure: {
69424
+ description: "What to do when the call fails. Omitted or empty: the procedure stops and the Agent handles the failure under its instructions.",
69425
+ maxItems: 40,
69426
+ type: "array",
69427
+ items: {
69428
+ anyOf: [
69429
+ {
69430
+ additionalProperties: false,
69431
+ type: "object",
69432
+ required: [
69433
+ "instruction",
69434
+ "type"
69435
+ ],
69436
+ properties: {
69437
+ instruction: {
69438
+ description: "What to ask, and when an answer counts. The procedure waits here until the contact answers.",
69439
+ maxLength: 2000,
69440
+ minLength: 1,
69441
+ type: "string"
69442
+ },
69443
+ type: {
69444
+ const: "ask",
69445
+ type: "string"
69446
+ }
69447
+ }
69448
+ },
69449
+ {
69450
+ additionalProperties: false,
69451
+ type: "object",
69452
+ required: [
69453
+ "instruction",
69454
+ "type"
69455
+ ],
69456
+ properties: {
69457
+ instruction: {
69458
+ description: "What to convey, in the Agent's own words. The procedure continues without waiting.",
69459
+ maxLength: 2000,
69460
+ minLength: 1,
69461
+ type: "string"
69462
+ },
69463
+ type: {
69464
+ const: "tell",
69465
+ type: "string"
69466
+ }
69467
+ }
69468
+ },
69469
+ {
69470
+ additionalProperties: false,
69471
+ type: "object",
69472
+ required: [
69473
+ "message",
69474
+ "type"
69475
+ ],
69476
+ properties: {
69477
+ message: {
69478
+ description: "What to say, word for word.",
69479
+ maxLength: 2000,
69480
+ minLength: 1,
69481
+ type: "string"
69482
+ },
69483
+ translations: {
69484
+ description: "The exact message in other languages, by BCP 47 tag, for an Agent that speaks several.",
69485
+ type: "object",
69486
+ patternProperties: {
69487
+ "^[a-z]{2,3}(-[A-Za-z0-9]{2,8})*$": {
69488
+ maxLength: 2000,
69489
+ minLength: 1,
69490
+ type: "string"
69491
+ }
69492
+ }
69493
+ },
69494
+ type: {
69495
+ const: "say",
69496
+ type: "string"
69497
+ }
69498
+ }
69499
+ },
69500
+ {
69501
+ additionalProperties: false,
69502
+ type: "object",
69503
+ required: [
69504
+ "procedureId",
69505
+ "type"
69506
+ ],
69507
+ properties: {
69508
+ procedureId: {
69509
+ description: "Another structured procedure of this Agent. It runs to its end, then this procedure continues.",
69510
+ pattern: "^prc_[0-7][0-9a-hjkmnp-tv-z]{25}$",
69511
+ type: "string"
69512
+ },
69513
+ type: {
69514
+ const: "procedure",
69515
+ type: "string"
69516
+ }
69517
+ }
69518
+ },
69519
+ {
69520
+ additionalProperties: false,
69521
+ description: "Finish the conversation after this reply (on a call, hang up). Always the last step of its list.",
69522
+ type: "object",
69523
+ required: [
69524
+ "type"
69525
+ ],
69526
+ properties: {
69527
+ type: {
69528
+ const: "end",
69529
+ type: "string"
69530
+ }
69531
+ }
69532
+ },
69533
+ {
69534
+ additionalProperties: false,
69535
+ description: "Call the failed tool again and, if it fails again, run its failure steps again. Only the last step of a failure handler.",
69536
+ type: "object",
69537
+ required: [
69538
+ "maxRetries",
69539
+ "type"
69540
+ ],
69541
+ properties: {
69542
+ maxRetries: {
69543
+ description: "Calls of the tool after the first one.",
69544
+ maximum: 3,
69545
+ minimum: 1,
69546
+ type: "integer"
69547
+ },
69548
+ type: {
69549
+ const: "retry",
69550
+ type: "string"
69551
+ }
69552
+ }
69553
+ }
69554
+ ]
69555
+ }
69556
+ },
69557
+ tool: {
69558
+ description: "One of the Agent's integration tools by its tool name, or one of Raíz's own tools (`search_knowledge`, `escalate_to_team`, `transfer_to_human`).",
69559
+ pattern: "^[A-Za-z0-9_.-]{1,128}$",
69560
+ type: "string"
69561
+ },
69562
+ type: {
69563
+ const: "tool",
69564
+ type: "string"
69565
+ }
69566
+ }
69567
+ },
69568
+ {
69569
+ additionalProperties: false,
69570
+ type: "object",
69571
+ required: [
69572
+ "procedureId",
69573
+ "type"
69574
+ ],
69575
+ properties: {
69576
+ procedureId: {
69577
+ description: "Another structured procedure of this Agent. It runs to its end, then this procedure continues.",
69578
+ pattern: "^prc_[0-7][0-9a-hjkmnp-tv-z]{25}$",
69579
+ type: "string"
69580
+ },
69581
+ type: {
69582
+ const: "procedure",
69583
+ type: "string"
69584
+ }
69585
+ }
69586
+ },
69587
+ {
69588
+ additionalProperties: false,
69589
+ description: "Finish the conversation after this reply (on a call, hang up). Always the last step of its list.",
69590
+ type: "object",
69591
+ required: [
69592
+ "type"
69593
+ ],
69594
+ properties: {
69595
+ type: {
69596
+ const: "end",
69597
+ type: "string"
69598
+ }
69599
+ }
69600
+ }
69601
+ ]
69602
+ }
69603
+ },
69604
+ type: {
69605
+ const: "branch",
69606
+ type: "string"
69607
+ }
69608
+ }
69609
+ },
69610
+ {
69611
+ additionalProperties: false,
69612
+ type: "object",
69613
+ required: [
69614
+ "procedureId",
69615
+ "type"
69616
+ ],
69617
+ properties: {
69618
+ procedureId: {
69619
+ description: "Another structured procedure of this Agent. It runs to its end, then this procedure continues.",
69620
+ pattern: "^prc_[0-7][0-9a-hjkmnp-tv-z]{25}$",
69621
+ type: "string"
69622
+ },
69623
+ type: {
69624
+ const: "procedure",
69625
+ type: "string"
69626
+ }
69627
+ }
69628
+ },
69629
+ {
69630
+ additionalProperties: false,
69631
+ description: "Finish the conversation after this reply (on a call, hang up). Always the last step of its list.",
69632
+ type: "object",
69633
+ required: [
69634
+ "type"
69635
+ ],
69636
+ properties: {
69637
+ type: {
69638
+ const: "end",
69639
+ type: "string"
69640
+ }
69641
+ }
69642
+ }
69643
+ ]
69644
+ }
69645
+ },
69646
+ trigger: {
69647
+ description: "When it applies, from the contact's side: When the contact asks to book or move an appointment. Empty makes a sub-procedure, which only runs when another procedure references it.",
69648
+ maxLength: 1000,
69649
+ type: "string"
69650
+ },
69651
+ type: {
69652
+ description: "`free_form`: instructions the Agent adapts. `structured`: steps that run the same way every time. Fixed once created.",
69653
+ anyOf: [
69654
+ {
69655
+ const: "free_form",
69656
+ type: "string"
69657
+ },
69658
+ {
69659
+ const: "structured",
69660
+ type: "string"
69661
+ }
69662
+ ]
69663
+ }
69664
+ }
69665
+ },
69666
+ RaizAgentSettings: {
69667
+ additionalProperties: false,
69668
+ type: "object",
69669
+ required: [
69670
+ "humanEscalation",
69671
+ "recoveryManager",
69672
+ "automaticKnowledge",
69673
+ "attachmentReader",
69674
+ "budgetExhaustedMessage",
69675
+ "closingMessage",
69676
+ "evalGate",
69677
+ "followUpAfterMinutes",
69678
+ "followUpMessage",
69679
+ "greeting",
69680
+ "handoffMessage",
69681
+ "humanReplyTimeoutMinutes",
69682
+ "investigationsEnabled",
69683
+ "model",
69684
+ "modelTrial",
69685
+ "monthlyTokenBudget",
69686
+ "pauseOnHumanReply",
69687
+ "policy",
69688
+ "pollPendingOperations",
69689
+ "reasoningEffort",
69690
+ "replyChoices",
69691
+ "sessionCloseAfterMinutes",
69692
+ "temperature",
69693
+ "toolDiscovery",
69694
+ "voice"
69695
+ ],
69696
+ properties: {
69697
+ humanEscalation: {
69698
+ anyOf: [
69699
+ {
69700
+ description: "Per-Agent human escalation policy. Instructions apply to voice and text. Null keeps the default instructions. A WhatsApp handoff stays with the team until a person explicitly resumes AI; no timeout resumes it.",
69701
+ additionalProperties: false,
69702
+ type: "object",
69703
+ required: [
69704
+ "instructions"
69705
+ ],
69706
+ properties: {
69707
+ instructions: {
69708
+ anyOf: [
69709
+ {
69710
+ maxLength: 4000,
69711
+ description: "When this Agent should ask the business's team to intervene, using only its available handoff capabilities. Null keeps the default instructions; an explicit request for a person is always respected.",
69712
+ type: "string"
69713
+ },
69714
+ {
69715
+ type: "null"
69716
+ }
69717
+ ]
69718
+ }
69719
+ }
69720
+ },
69721
+ {
69722
+ type: "null"
69723
+ }
69724
+ ]
69725
+ },
69726
+ recoveryManager: {
69727
+ anyOf: [
69728
+ {
69729
+ description: "Optional WhatsApp recovery advisor. Null or enabled=false disables it. A journaled evidence check precedes any paid review. One tool-free model call per turn before autonomous escalation or after terminal provider failure; unresolved terminal recovery hands off. Completed handoffs and conservatively recognized human requests bypass generation. Model selects the existing provider route. Prices must be conservative upper bounds including provider overhead; missing or invalid prices disable recovery. The cost bound covers only the advisor. No tools or automatic provider retries.",
69730
+ additionalProperties: false,
69731
+ type: "object",
69732
+ required: [
69733
+ "enabled",
69734
+ "model",
69735
+ "maxAttempts",
69736
+ "timeoutMs",
69737
+ "maxInputTokens",
69738
+ "maxOutputTokens",
69739
+ "maxCostUsd",
69740
+ "inputUsdPerMillion",
69741
+ "outputUsdPerMillion"
69742
+ ],
69743
+ properties: {
69744
+ enabled: {
69745
+ type: "boolean"
69746
+ },
69747
+ instructions: {
69748
+ anyOf: [
69749
+ {
69750
+ maxLength: 4000,
69751
+ description: "Operator criteria for when the recovery advisor should help or leave the case to a person. They never override consent, tool permissions, unknown-write fences or an explicit human request. Null keeps the default criteria.",
69752
+ type: "string"
69753
+ },
69754
+ {
69755
+ type: "null"
69756
+ }
69757
+ ]
69758
+ },
69759
+ advisorAgentId: {
69760
+ anyOf: [
69761
+ {
69762
+ description: "Optional active text Agent in the same organization, other than this Agent, whose instructions and procedures provide specialist guidance. The configured recovery model and cost bounds stay unchanged; no specialist tools or conversation history are accessed.",
69763
+ examples: [
69764
+ "agt_01m45h8q2rf3t9w6y7z0b1c2d3"
69765
+ ],
69766
+ pattern: "^agt_(?:[0-7][0-9a-hjkmnp-tv-z]{25}|(?:[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}|[a-f0-9]{32}))$",
69767
+ type: "string"
69768
+ },
69769
+ {
69770
+ type: "null"
69771
+ }
69772
+ ]
69773
+ },
69774
+ model: {
69775
+ description: "`arbolito/agile`: quickest and least expensive, for direct conversations. `arbolito/balanced`: more deliberate answers at moderate cost. `arbolito/advanced`: strong reasoning for complex instructions and many tools, with an adjustable `reasoningEffort`. `arbolito/top`: the most capable, for the hardest cases, with an adjustable `reasoningEffort` up to `xhigh`. Every tier reads images and PDF documents.",
69776
+ anyOf: [
69777
+ {
69778
+ const: "arbolito/agile",
69779
+ type: "string"
69780
+ },
69781
+ {
69782
+ const: "arbolito/balanced",
69783
+ type: "string"
69784
+ },
69785
+ {
69786
+ const: "arbolito/advanced",
69787
+ type: "string"
69788
+ },
69789
+ {
69790
+ const: "arbolito/top",
69791
+ type: "string"
69792
+ }
69793
+ ]
69794
+ },
69795
+ maxAttempts: {
69796
+ const: 1,
69797
+ type: "number"
69798
+ },
69799
+ timeoutMs: {
69800
+ minimum: 100,
69801
+ maximum: 15000,
69802
+ type: "integer"
69803
+ },
69804
+ maxInputTokens: {
69805
+ minimum: 4096,
69806
+ maximum: 131072,
69807
+ type: "integer"
69808
+ },
69809
+ maxOutputTokens: {
69810
+ minimum: 128,
69811
+ maximum: 1024,
69812
+ type: "integer"
69813
+ },
69814
+ maxCostUsd: {
69815
+ exclusiveMinimum: 0,
69816
+ maximum: 1,
69817
+ type: "number"
69818
+ },
69819
+ inputUsdPerMillion: {
69820
+ exclusiveMinimum: 0,
69821
+ maximum: 1000,
69822
+ type: "number"
69823
+ },
69824
+ outputUsdPerMillion: {
69825
+ exclusiveMinimum: 0,
69826
+ maximum: 1000,
69827
+ type: "number"
69828
+ }
69829
+ }
69830
+ },
69831
+ {
69832
+ type: "null"
69833
+ }
69834
+ ]
69835
+ },
69836
+ automaticKnowledge: {
69837
+ anyOf: [
69838
+ {
69839
+ description: "Text Agents. Retrieve relevant passages from this Agent's active Knowledge before a substantive contact message, without a model tool call. Null or false: on-demand search only. Does not store contact memories or learn unreviewed answers.",
69840
+ type: "boolean"
69841
+ },
69842
+ {
69843
+ type: "null"
69844
+ }
69845
+ ]
69846
+ },
69847
+ attachmentReader: {
69848
+ anyOf: [
69849
+ {
69850
+ description: "Text Agents on WhatsApp. Who reads an image or PDF when the Agent calls `read_attachment`: `vision` (a vision model describes and transcribes it, with a stronger one when the first reads nothing) or `ocr` (text recognition, which also answers the `fields` the Agent asks for, each null when absent or unclear; the vision model reads the file when recognition cannot). With `ocr` the Agent sees files as markers and reads them with `read_attachment`; with `vision`, tiers that read files themselves see the original. Null: `vision`.",
69851
+ anyOf: [
69852
+ {
69853
+ const: "vision",
69854
+ type: "string"
69855
+ },
69856
+ {
69857
+ const: "ocr",
69858
+ type: "string"
69859
+ }
69860
+ ]
69861
+ },
69862
+ {
69863
+ type: "null"
69864
+ }
69865
+ ]
69866
+ },
69867
+ budgetExhaustedMessage: {
69868
+ anyOf: [
69869
+ {
69870
+ description: "Text Agents on WhatsApp. What the contact reads when the Agent has used its `monthlyTokenBudget`: the conversation then goes to the team, as an escalation does, and the Agent writes nothing until the budget is raised or the month ends. Null: `handoffMessage`, including an empty notice when disabled.",
69871
+ maxLength: 1000,
69872
+ minLength: 1,
69873
+ type: "string"
69874
+ },
69875
+ {
69876
+ type: "null"
69877
+ }
69878
+ ]
69879
+ },
69880
+ closingMessage: {
69881
+ anyOf: [
69882
+ {
69883
+ description: "Text Agents on WhatsApp. After a reply that completed an action (an integration tool that changes data succeeded), explicitly finished the case with end_conversation and left nothing pending (no question, no offered choices, no handoff), a contact message that only thanks or closes («gracias», «ok», «listo», an emoji) gets this text at once, without the model; the Agent still reads both in its next turn. Write it in the Agent's language and ask nothing in it. Null: the Agent answers such messages itself.",
69884
+ maxLength: 1000,
69885
+ minLength: 1,
69886
+ type: "string"
69887
+ },
69888
+ {
69889
+ type: "null"
69890
+ }
69891
+ ]
69892
+ },
69893
+ evalGate: {
69894
+ anyOf: [
69895
+ {
69896
+ description: "Text and voice Agents. When true, an `updateAgent` that changes what the model reads (instructions, procedures, connection procedures, `model` or `reasoningEffort`) must send `evalRunId`: a completed `createEvalRun` of this Agent with exactly that content, in which every case passed (EVAL_GATE_UNMET otherwise). Null: no requirement.",
69897
+ type: "boolean"
69898
+ },
69899
+ {
69900
+ type: "null"
69901
+ }
69902
+ ]
69903
+ },
69904
+ followUpAfterMinutes: {
69905
+ anyOf: [
69906
+ {
69907
+ description: "Text Agents. When the Agent spoke last and asked something, send `followUpMessage` once after this many minutes of silence (WhatsApp only, inside its 24-hour window). Null disables follow-ups.",
69908
+ maximum: 1440,
69909
+ minimum: 1,
69910
+ type: "integer"
69911
+ },
69912
+ {
69913
+ type: "null"
69914
+ }
69915
+ ]
69916
+ },
69917
+ followUpMessage: {
69918
+ anyOf: [
69919
+ {
69920
+ description: "Text Agents. The follow-up text. Null uses a short default in the Agent's language.",
69921
+ maxLength: 1000,
69922
+ minLength: 1,
69923
+ type: "string"
69924
+ },
69925
+ {
69926
+ type: "null"
69927
+ }
69928
+ ]
69929
+ },
69930
+ greeting: {
69931
+ anyOf: [
69932
+ {
69933
+ $ref: "#/components/schemas/RaizAgentGreeting",
69934
+ description: "Text Agents on WhatsApp. How the Agent answers when a contact opens a conversation and nobody from the business has answered it yet. Null: the Agent answers the first message with its own instructions alone."
69935
+ },
69936
+ {
69937
+ type: "null"
69938
+ }
69939
+ ]
69940
+ },
69941
+ handoffMessage: {
69942
+ anyOf: [
69943
+ {
69944
+ description: "Text Agents on WhatsApp. The notice appended after an escalation or a requested human handoff. Null: the current localized review notice or the case-specific notice supplied under the Agent's instructions. An empty string disables the notice; the handoff and pause still happen. The model does not write this notice.",
69945
+ maxLength: 1000,
69946
+ type: "string"
69947
+ },
69948
+ {
69949
+ type: "null"
69950
+ }
69951
+ ]
69952
+ },
69953
+ humanReplyTimeoutMinutes: {
69954
+ anyOf: [
69955
+ {
69956
+ description: "Text Agents on WhatsApp. After a manual takeover, resume automatic replies when the contact's newest message waits this many minutes. An Agent handoff always stays with the team until a person explicitly resumes AI. Null: only a person resumes automatic replies.",
69957
+ maximum: 1440,
69958
+ minimum: 1,
69959
+ type: "integer"
69960
+ },
69961
+ {
69962
+ type: "null"
69963
+ }
69964
+ ]
69965
+ },
69966
+ investigationsEnabled: {
69967
+ anyOf: [
69968
+ {
69969
+ description: "Opt this Agent into internal root-cause investigations of tool failures, human escalations, failed outcomes and negative feedback. Incidents are grouped only with participating Agents in the same organization. Null or false: disabled. Turning this off stops new events and pending dispatch when no participating Agent remains; an already active investigation may finish.",
69970
+ type: "boolean"
69971
+ },
69972
+ {
69973
+ type: "null"
69974
+ }
69975
+ ]
69976
+ },
69977
+ model: {
69978
+ anyOf: [
69979
+ {
69980
+ description: "Text Agents. The tier that writes replies. `arbolito/agile`: quickest and least expensive, for direct conversations. `arbolito/balanced`: more deliberate answers at moderate cost. `arbolito/advanced`: strong reasoning for complex instructions and many tools, with an adjustable `reasoningEffort`. `arbolito/top`: the most capable, for the hardest cases, with an adjustable `reasoningEffort` up to `xhigh`. Every tier reads images and PDF documents. Null: the default, as `arbolito/agile`.",
69981
+ anyOf: [
69982
+ {
69983
+ const: "arbolito/agile",
69984
+ type: "string"
69985
+ },
69986
+ {
69987
+ const: "arbolito/balanced",
69988
+ type: "string"
69989
+ },
69990
+ {
69991
+ const: "arbolito/advanced",
69992
+ type: "string"
69993
+ },
69994
+ {
69995
+ const: "arbolito/top",
69996
+ type: "string"
69997
+ }
69998
+ ]
69999
+ },
70000
+ {
70001
+ type: "null"
70002
+ }
70003
+ ]
70004
+ },
70005
+ modelTrial: {
70006
+ anyOf: [
70007
+ {
70008
+ $ref: "#/components/schemas/RaizAgentModelTrial",
70009
+ description: "Text Agents on WhatsApp. Answer a stable share of the Agent's new conversations with another tier, to compare it with `model` on real traffic. A conversation keeps the tier its first reply used while the trial lasts (one already open when the trial starts stays on `model`); removing the trial returns every conversation to `model`. Null: no trial."
70010
+ },
70011
+ {
70012
+ type: "null"
70013
+ }
70014
+ ]
70015
+ },
70016
+ monthlyTokenBudget: {
70017
+ anyOf: [
70018
+ {
70019
+ description: "Text Agents. Tokens (input, cached input included, plus output) the Agent may use per calendar month (UTC), on every channel. On WhatsApp, a reply that would start past it does not run: the contact reads `budgetExhaustedMessage` and the team continues; at 80 % the API logs an alert once a month. Null: no limit.",
70020
+ maximum: 1000000000000,
70021
+ minimum: 1e4,
70022
+ type: "integer"
70023
+ },
70024
+ {
70025
+ type: "null"
70026
+ }
70027
+ ]
70028
+ },
70029
+ pauseOnHumanReply: {
70030
+ anyOf: [
70031
+ {
70032
+ description: "Text Agents on WhatsApp: pause automatic replies when a live WhatsApp Business App message that says something (not a reaction, an edit or a deletion) proves a person took over. Null: disabled. The recipient stays paused until resumed or until that conversation closes; their next conversation starts with the AI.",
70033
+ type: "boolean"
70034
+ },
70035
+ {
70036
+ type: "null"
70037
+ }
70038
+ ]
70039
+ },
70040
+ policy: {
70041
+ anyOf: [
70042
+ {
70043
+ $ref: "#/components/schemas/RaizAgentTurnPolicy",
70044
+ description: "Text Agents on WhatsApp. Limits on each reply: model calls, output, writes per step, repeated reads, cached reads and deferred tools. Null keeps every default."
70045
+ },
70046
+ {
70047
+ type: "null"
70048
+ }
70049
+ ]
70050
+ },
70051
+ pollPendingOperations: {
70052
+ anyOf: [
70053
+ {
70054
+ description: "Text Agents on WhatsApp: when a reply ends while an integration answered that its work is still pending (`status: pending` with an `operationId`) and the same connection offers `getOperation`, Raíz checks it again on its own and the Agent answers with the result, without waiting for the contact to write. Null: disabled.",
70055
+ type: "boolean"
70056
+ },
70057
+ {
70058
+ type: "null"
70059
+ }
70060
+ ]
70061
+ },
70062
+ reasoningEffort: {
70063
+ anyOf: [
70064
+ {
70065
+ description: "Text Agents whose tier reasons (`arbolito/advanced`, `arbolito/top`, or an Agent already running a model that reasons): `none` answers fastest, `high` deliberates most, and `xhigh`, on `arbolito/advanced` and `arbolito/top`, deliberates past it. Null: the tier's default. A tier that does not reason refuses it (AGENT_SETTINGS_INVALID).",
70066
+ anyOf: [
70067
+ {
70068
+ const: "none",
70069
+ type: "string"
70070
+ },
70071
+ {
70072
+ const: "low",
70073
+ type: "string"
70074
+ },
70075
+ {
70076
+ const: "medium",
70077
+ type: "string"
70078
+ },
70079
+ {
70080
+ const: "high",
70081
+ type: "string"
70082
+ },
70083
+ {
70084
+ const: "xhigh",
70085
+ type: "string"
70086
+ }
70087
+ ]
70088
+ },
70089
+ {
70090
+ type: "null"
70091
+ }
70092
+ ]
70093
+ },
70094
+ replyChoices: {
70095
+ anyOf: [
70096
+ {
70097
+ description: "Text Agents. Let the Agent offer tap-to-answer options (WhatsApp buttons and lists, web reply options). Null: allowed.",
70098
+ type: "boolean"
70099
+ },
70100
+ {
70101
+ type: "null"
70102
+ }
70103
+ ]
70104
+ },
70105
+ sessionCloseAfterMinutes: {
70106
+ anyOf: [
70107
+ {
70108
+ description: "Text Agents. Close a conversation after this many minutes without messages. Null: 1440 on WhatsApp, 30 on web.",
70109
+ maximum: 10080,
70110
+ minimum: 5,
67988
70111
  type: "integer"
67989
70112
  },
67990
70113
  {
@@ -68098,7 +70221,7 @@ var schemaComponents = {
68098
70221
  advisorAgentId: {
68099
70222
  anyOf: [
68100
70223
  {
68101
- description: "Optional active text Agent in the same organization, other than this Agent, whose instructions and skills provide specialist guidance. The configured recovery model and cost bounds stay unchanged; no specialist tools or conversation history are accessed.",
70224
+ description: "Optional active text Agent in the same organization, other than this Agent, whose instructions and procedures provide specialist guidance. The configured recovery model and cost bounds stay unchanged; no specialist tools or conversation history are accessed.",
68102
70225
  examples: [
68103
70226
  "agt_01m45h8q2rf3t9w6y7z0b1c2d3"
68104
70227
  ],
@@ -68244,7 +70367,7 @@ var schemaComponents = {
68244
70367
  evalGate: {
68245
70368
  anyOf: [
68246
70369
  {
68247
- description: "Text and voice Agents. When true, an `updateAgent` that changes what the model reads (instructions, skills, connection skills, `model` or `reasoningEffort`) must send `evalRunId`: a completed `createEvalRun` of this Agent with exactly that content, in which every case passed (EVAL_GATE_UNMET otherwise). Null: no requirement.",
70370
+ description: "Text and voice Agents. When true, an `updateAgent` that changes what the model reads (instructions, procedures, connection procedures, `model` or `reasoningEffort`) must send `evalRunId`: a completed `createEvalRun` of this Agent with exactly that content, in which every case passed (EVAL_GATE_UNMET otherwise). Null: no requirement.",
68248
70371
  type: "boolean"
68249
70372
  },
68250
70373
  {
@@ -68503,83 +70626,6 @@ var schemaComponents = {
68503
70626
  }
68504
70627
  }
68505
70628
  },
68506
- RaizAgentSkill: {
68507
- additionalProperties: false,
68508
- type: "object",
68509
- required: [
68510
- "name",
68511
- "description",
68512
- "instructions",
68513
- "status",
68514
- "resources"
68515
- ],
68516
- properties: {
68517
- name: {
68518
- minLength: 1,
68519
- maxLength: 64,
68520
- pattern: "^[a-z0-9]+(-[a-z0-9]+)*$",
68521
- type: "string"
68522
- },
68523
- description: {
68524
- minLength: 1,
68525
- maxLength: 500,
68526
- pattern: "^[^\\r\\n]+$",
68527
- type: "string"
68528
- },
68529
- instructions: {
68530
- minLength: 1,
68531
- maxLength: 30000,
68532
- type: "string"
68533
- },
68534
- status: {
68535
- anyOf: [
68536
- {
68537
- const: "active",
68538
- type: "string"
68539
- },
68540
- {
68541
- const: "paused",
68542
- type: "string"
68543
- }
68544
- ]
68545
- },
68546
- tools: {
68547
- description: "WhatsApp: while this skill is active in a reply, the model is offered only these tools plus Raíz's own (choices, attachments, skills, escalation). Omitted: every tool stays offered. Narrowing changes the request's tool list, so the provider's cached prefix restarts for that reply.",
68548
- maxItems: 32,
68549
- uniqueItems: true,
68550
- type: "array",
68551
- items: {
68552
- pattern: "^[A-Za-z0-9_-]{1,64}$",
68553
- type: "string"
68554
- }
68555
- },
68556
- resources: {
68557
- maxItems: 16,
68558
- type: "array",
68559
- items: {
68560
- additionalProperties: false,
68561
- type: "object",
68562
- required: [
68563
- "path",
68564
- "content"
68565
- ],
68566
- properties: {
68567
- path: {
68568
- minLength: 1,
68569
- maxLength: 200,
68570
- pattern: "^references/[a-zA-Z0-9_-]+(?:/[a-zA-Z0-9_-]+)*\\.(?:md|txt|json|csv)$",
68571
- type: "string"
68572
- },
68573
- content: {
68574
- minLength: 1,
68575
- maxLength: 20000,
68576
- type: "string"
68577
- }
68578
- }
68579
- }
68580
- }
68581
- }
68582
- },
68583
70629
  RaizAgentTurnPolicy: {
68584
70630
  additionalProperties: false,
68585
70631
  type: "object",
@@ -70328,7 +72374,7 @@ var schemaComponents = {
70328
72374
  "kind",
70329
72375
  "name",
70330
72376
  "status",
70331
- "skills",
72377
+ "procedures",
70332
72378
  "summary",
70333
72379
  "tools",
70334
72380
  "toolsVersion"
@@ -70379,8 +72425,8 @@ var schemaComponents = {
70379
72425
  }
70380
72426
  ]
70381
72427
  },
70382
- skills: {
70383
- description: "The procedures a custom server publishes beside its tools. An Agent pins the ones it uses (`integrationSkills`).",
72428
+ procedures: {
72429
+ description: "The procedures a custom server publishes beside its tools. An Agent pins the ones it uses (`integrationProcedures`).",
70384
72430
  maxItems: 64,
70385
72431
  type: "array",
70386
72432
  items: {
@@ -70393,17 +72439,17 @@ var schemaComponents = {
70393
72439
  ],
70394
72440
  properties: {
70395
72441
  description: {
70396
- description: "One line: what the procedure achieves and when to load it.",
72442
+ description: "One line: what the procedure achieves and when it applies. It is the procedure's trigger.",
70397
72443
  type: "string"
70398
72444
  },
70399
72445
  digest: {
70400
- description: "A digest of the skill (its name, description and procedure). Equal digests, equal skills.",
72446
+ description: "A digest of the procedure (its name, description and instructions). Equal digests, equal procedures.",
70401
72447
  maxLength: 64,
70402
72448
  minLength: 1,
70403
72449
  type: "string"
70404
72450
  },
70405
72451
  name: {
70406
- description: "The skill's name, as its connection lists it.",
72452
+ description: "The procedure's name, as its connection lists it.",
70407
72453
  maxLength: 64,
70408
72454
  minLength: 1,
70409
72455
  pattern: "^[a-z0-9]+(-[a-z0-9]+)*$",
@@ -73092,7 +75138,7 @@ var schemaComponents = {
73092
75138
  ]
73093
75139
  },
73094
75140
  contentSha256: {
73095
- description: "SHA-256 of the candidate's content (instructions, skills, connection skills, model, reasoning effort): what `settings.evalGate` compares with an update's.",
75141
+ description: "SHA-256 of the candidate's content (instructions, procedures, connection procedures, model, reasoning effort): what `settings.evalGate` compares with an update's.",
73096
75142
  pattern: "^[a-f0-9]{64}$",
73097
75143
  type: "string"
73098
75144
  },
@@ -75724,11 +77770,11 @@ var schemaComponents = {
75724
77770
  ],
75725
77771
  properties: {
75726
77772
  code: {
75727
- const: "AGENT_SKILLS_INVALID",
77773
+ const: "AGENT_PROCEDURES_INVALID",
75728
77774
  type: "string"
75729
77775
  },
75730
77776
  message: {
75731
- const: "Skills require a text Agent, unique names and resource paths, nonempty instructions, and at most 256 KiB in total.",
77777
+ const: "A procedure is incomplete, references a tool, document or procedure the Agent does not have, or breaks the structured step rules. `issues` says where.",
75732
77778
  type: "string"
75733
77779
  },
75734
77780
  retryable: {
@@ -75738,7 +77784,33 @@ var schemaComponents = {
75738
77784
  data: {
75739
77785
  additionalProperties: false,
75740
77786
  type: "object",
75741
- properties: {}
77787
+ required: [
77788
+ "issues"
77789
+ ],
77790
+ properties: {
77791
+ issues: {
77792
+ maxItems: 20,
77793
+ type: "array",
77794
+ items: {
77795
+ additionalProperties: false,
77796
+ type: "object",
77797
+ required: [
77798
+ "code",
77799
+ "path"
77800
+ ],
77801
+ properties: {
77802
+ code: {
77803
+ description: "Why, as a label: content_required, steps_required, unknown_tool, unknown_knowledge, unknown_procedure, sub_procedure_not_structured, consecutive_branches, end_not_last, retry_not_last, type_changed, procedure_cycle, reference_not_allowed, unsupported_on_calls…",
77804
+ type: "string"
77805
+ },
77806
+ path: {
77807
+ description: "RFC 6901 pointer to the refused field, such as `/procedures/2/steps/1`.",
77808
+ type: "string"
77809
+ }
77810
+ }
77811
+ }
77812
+ }
77813
+ }
75742
77814
  }
75743
77815
  }
75744
77816
  },
@@ -76014,11 +78086,11 @@ var schemaComponents = {
76014
78086
  ],
76015
78087
  properties: {
76016
78088
  code: {
76017
- const: "INTEGRATION_SKILL_UNAVAILABLE",
78089
+ const: "INTEGRATION_PROCEDURE_UNAVAILABLE",
76018
78090
  type: "string"
76019
78091
  },
76020
78092
  message: {
76021
- const: "A skill does not exist in this organization's connections, Raíz cannot run its connection, or its name repeats one of the Agent's skills.",
78093
+ const: "A procedure does not exist in this organization's connections, Raíz cannot run its connection, or the Agent is not a text Agent.",
76022
78094
  type: "string"
76023
78095
  },
76024
78096
  retryable: {
@@ -82637,30 +84709,44 @@ var schemaComponents = {
82637
84709
  }
82638
84710
  },
82639
84711
  SaludTotalInvoiceLookupResult: {
82640
- additionalProperties: false,
82641
- type: "object",
82642
- required: [
82643
- "status",
82644
- "recordCount"
82645
- ],
82646
- properties: {
82647
- status: {
82648
- anyOf: [
82649
- {
84712
+ anyOf: [
84713
+ {
84714
+ additionalProperties: false,
84715
+ type: "object",
84716
+ required: [
84717
+ "status",
84718
+ "recordCount"
84719
+ ],
84720
+ properties: {
84721
+ status: {
82650
84722
  const: "no_match",
82651
84723
  type: "string"
82652
84724
  },
82653
- {
84725
+ recordCount: {
84726
+ const: 0,
84727
+ type: "number"
84728
+ }
84729
+ }
84730
+ },
84731
+ {
84732
+ additionalProperties: false,
84733
+ type: "object",
84734
+ required: [
84735
+ "status",
84736
+ "recordCount"
84737
+ ],
84738
+ properties: {
84739
+ status: {
82654
84740
  const: "records_found",
82655
84741
  type: "string"
84742
+ },
84743
+ recordCount: {
84744
+ minimum: 1,
84745
+ type: "integer"
82656
84746
  }
82657
- ]
82658
- },
82659
- recordCount: {
82660
- minimum: 0,
82661
- type: "integer"
84747
+ }
82662
84748
  }
82663
- }
84749
+ ]
82664
84750
  },
82665
84751
  SaludTotalInvoiceLookupResultResponse: {
82666
84752
  type: "object",
@@ -83438,6 +85524,9 @@ var schemaComponents = {
83438
85524
  },
83439
85525
  SaludTotalLookupInvoiceConflictFailure: {
83440
85526
  oneOf: [
85527
+ {
85528
+ $ref: "#/components/schemas/SaludTotalReportingWindowClosedFailure"
85529
+ },
83441
85530
  {
83442
85531
  $ref: "#/components/schemas/SaludTotalConnectionUnavailableFailure"
83443
85532
  },
@@ -83457,6 +85546,7 @@ var schemaComponents = {
83457
85546
  discriminator: {
83458
85547
  propertyName: "code",
83459
85548
  mapping: {
85549
+ REPORTING_WINDOW_CLOSED: "#/components/schemas/SaludTotalReportingWindowClosedFailure",
83460
85550
  CONNECTION_UNAVAILABLE: "#/components/schemas/SaludTotalConnectionUnavailableFailure",
83461
85551
  SESSION_CLOSED: "#/components/schemas/SaludTotalSessionClosedFailure",
83462
85552
  INTERACTIVE_VERIFICATION_REQUIRED: "#/components/schemas/SaludTotalInteractiveVerificationRequiredFailure",
@@ -83884,6 +85974,65 @@ var schemaComponents = {
83884
85974
  }
83885
85975
  }
83886
85976
  },
85977
+ SaludTotalReportingWindowClosedFailure: {
85978
+ type: "object",
85979
+ description: "Invoice reporting is closed. Retry during the provider’s reporting hours.",
85980
+ additionalProperties: false,
85981
+ required: [
85982
+ "code",
85983
+ "message",
85984
+ "retryable",
85985
+ "data"
85986
+ ],
85987
+ properties: {
85988
+ code: {
85989
+ type: "string",
85990
+ enum: [
85991
+ "REPORTING_WINDOW_CLOSED"
85992
+ ],
85993
+ description: "The failure code, stable across releases."
85994
+ },
85995
+ message: {
85996
+ type: "string",
85997
+ description: "What went wrong, for people; it never contains input values."
85998
+ },
85999
+ retryable: {
86000
+ type: "boolean",
86001
+ enum: [
86002
+ true
86003
+ ],
86004
+ description: "Whether repeating the same request may succeed."
86005
+ },
86006
+ data: {
86007
+ $ref: "#/components/schemas/SaludTotalReportingWindowClosedFailureData"
86008
+ }
86009
+ }
86010
+ },
86011
+ SaludTotalReportingWindowClosedFailureData: {
86012
+ additionalProperties: false,
86013
+ type: "object",
86014
+ required: [
86015
+ "opensAtHour",
86016
+ "closesAtHour",
86017
+ "timeZone"
86018
+ ],
86019
+ properties: {
86020
+ opensAtHour: {
86021
+ minimum: 0,
86022
+ maximum: 23,
86023
+ type: "integer"
86024
+ },
86025
+ closesAtHour: {
86026
+ minimum: 1,
86027
+ maximum: 24,
86028
+ type: "integer"
86029
+ },
86030
+ timeZone: {
86031
+ const: "America/Bogota",
86032
+ type: "string"
86033
+ }
86034
+ }
86035
+ },
83887
86036
  SaludTotalScopedDayLookup: {
83888
86037
  additionalProperties: false,
83889
86038
  type: "object",
@@ -105086,12 +107235,12 @@ var schemaComponents = {
105086
107235
  }
105087
107236
  ]
105088
107237
  },
105089
- integrationSkills: {
105090
- description: "Text Agents. Skills a connection publishes (`listConnections`, checked live in Account), each saved with its current text and offered beside `skills`; names must differ from the Agent's own skills. In an update, the complete new set.",
107238
+ integrationProcedures: {
107239
+ description: "Text Agents. Procedures a connection publishes (`listConnections`, checked live in Account), each saved with its current text and run as a free-form procedure beside `procedures`. In an update, the complete new set.",
105091
107240
  maxItems: 32,
105092
107241
  type: "array",
105093
107242
  items: {
105094
- $ref: "#/components/schemas/RaizAgentIntegrationSkillInput"
107243
+ $ref: "#/components/schemas/RaizAgentIntegrationProcedureInput"
105095
107244
  }
105096
107245
  },
105097
107246
  integrationTools: {
@@ -105124,18 +107273,18 @@ var schemaComponents = {
105124
107273
  pattern: "^[a-z]{2,3}(-[A-Za-z0-9]{2,8})*$",
105125
107274
  type: "string"
105126
107275
  },
105127
- settings: {
105128
- $ref: "#/components/schemas/RaizAgentSettingsInput",
105129
- description: "How the Agent behaves. In an update, the complete new settings: keys left out return to their default. Text and voice settings apply only to Agents of that modality."
105130
- },
105131
- skills: {
105132
- maxItems: 32,
105133
- description: "Text-only procedures and references loaded on demand. Names and resource paths must be unique; the complete set is limited to 256 KiB. In an update, this replaces the whole set. Skills never grant additional business tools or execute scripts.",
107276
+ procedures: {
107277
+ description: "The Agent's procedures, as a complete set: a procedure left out is removed. Keep each existing procedure's `id`; a new one may omit it.",
107278
+ maxItems: 64,
105134
107279
  type: "array",
105135
107280
  items: {
105136
- $ref: "#/components/schemas/RaizAgentSkill"
107281
+ $ref: "#/components/schemas/RaizAgentProcedureInput"
105137
107282
  }
105138
107283
  },
107284
+ settings: {
107285
+ $ref: "#/components/schemas/RaizAgentSettingsInput",
107286
+ description: "How the Agent behaves. In an update, the complete new settings: keys left out return to their default. Text and voice settings apply only to Agents of that modality."
107287
+ },
105139
107288
  status: {
105140
107289
  description: "A paused Agent answers nothing and places no calls.",
105141
107290
  anyOf: [
@@ -105246,12 +107395,12 @@ var schemaComponents = {
105246
107395
  }
105247
107396
  ]
105248
107397
  },
105249
- integrationSkills: {
105250
- description: "Text Agents. Skills a connection publishes (`listConnections`, checked live in Account), each saved with its current text and offered beside `skills`; names must differ from the Agent's own skills. In an update, the complete new set.",
107398
+ integrationProcedures: {
107399
+ description: "Text Agents. Procedures a connection publishes (`listConnections`, checked live in Account), each saved with its current text and run as a free-form procedure beside `procedures`. In an update, the complete new set.",
105251
107400
  maxItems: 32,
105252
107401
  type: "array",
105253
107402
  items: {
105254
- $ref: "#/components/schemas/RaizAgentIntegrationSkillInput"
107403
+ $ref: "#/components/schemas/RaizAgentIntegrationProcedureInput"
105255
107404
  }
105256
107405
  },
105257
107406
  integrationTools: {
@@ -105284,18 +107433,18 @@ var schemaComponents = {
105284
107433
  pattern: "^[a-z]{2,3}(-[A-Za-z0-9]{2,8})*$",
105285
107434
  type: "string"
105286
107435
  },
105287
- settings: {
105288
- $ref: "#/components/schemas/RaizAgentSettingsInput",
105289
- description: "How the Agent behaves. In an update, the complete new settings: keys left out return to their default. Text and voice settings apply only to Agents of that modality."
105290
- },
105291
- skills: {
105292
- maxItems: 32,
105293
- description: "Text-only procedures and references loaded on demand. Names and resource paths must be unique; the complete set is limited to 256 KiB. In an update, this replaces the whole set. Skills never grant additional business tools or execute scripts.",
107436
+ procedures: {
107437
+ description: "The Agent's procedures, as a complete set: a procedure left out is removed. Keep each existing procedure's `id`; a new one may omit it.",
107438
+ maxItems: 64,
105294
107439
  type: "array",
105295
107440
  items: {
105296
- $ref: "#/components/schemas/RaizAgentSkill"
107441
+ $ref: "#/components/schemas/RaizAgentProcedureInput"
105297
107442
  }
105298
107443
  },
107444
+ settings: {
107445
+ $ref: "#/components/schemas/RaizAgentSettingsInput",
107446
+ description: "How the Agent behaves. In an update, the complete new settings: keys left out return to their default. Text and voice settings apply only to Agents of that modality."
107447
+ },
105299
107448
  status: {
105300
107449
  description: "A paused Agent answers nothing and places no calls.",
105301
107450
  anyOf: [
@@ -108246,7 +110395,7 @@ var schemaComponents = {
108246
110395
  type: "string"
108247
110396
  },
108248
110397
  candidate: {
108249
- description: "The candidate version: what changes in what the model reads. Omitted fields keep the live Agent's; `integrationSkills` and `skills` are complete sets, as in `updateAgent`.",
110398
+ description: "The candidate version: what changes in what the model reads. Omitted fields keep the live Agent's; `integrationProcedures` and `procedures` are complete sets, as in `updateAgent`.",
108250
110399
  additionalProperties: false,
108251
110400
  type: "object",
108252
110401
  properties: {
@@ -108263,12 +110412,12 @@ var schemaComponents = {
108263
110412
  }
108264
110413
  ]
108265
110414
  },
108266
- integrationSkills: {
108267
- description: "Text Agents. Skills a connection publishes (`listConnections`, checked live in Account), each saved with its current text and offered beside `skills`; names must differ from the Agent's own skills. In an update, the complete new set.",
110415
+ integrationProcedures: {
110416
+ description: "Text Agents. Procedures a connection publishes (`listConnections`, checked live in Account), each saved with its current text and run as a free-form procedure beside `procedures`. In an update, the complete new set.",
108268
110417
  maxItems: 32,
108269
110418
  type: "array",
108270
110419
  items: {
108271
- $ref: "#/components/schemas/RaizAgentIntegrationSkillInput"
110420
+ $ref: "#/components/schemas/RaizAgentIntegrationProcedureInput"
108272
110421
  }
108273
110422
  },
108274
110423
  model: {
@@ -108299,6 +110448,14 @@ var schemaComponents = {
108299
110448
  }
108300
110449
  ]
108301
110450
  },
110451
+ procedures: {
110452
+ description: "The Agent's procedures, as a complete set: a procedure left out is removed. Keep each existing procedure's `id`; a new one may omit it.",
110453
+ maxItems: 64,
110454
+ type: "array",
110455
+ items: {
110456
+ $ref: "#/components/schemas/RaizAgentProcedureInput"
110457
+ }
110458
+ },
108302
110459
  reasoningEffort: {
108303
110460
  anyOf: [
108304
110461
  {
@@ -108330,14 +110487,6 @@ var schemaComponents = {
108330
110487
  type: "null"
108331
110488
  }
108332
110489
  ]
108333
- },
108334
- skills: {
108335
- maxItems: 32,
108336
- description: "Text-only procedures and references loaded on demand. Names and resource paths must be unique; the complete set is limited to 256 KiB. In an update, this replaces the whole set. Skills never grant additional business tools or execute scripts.",
108337
- type: "array",
108338
- items: {
108339
- $ref: "#/components/schemas/RaizAgentSkill"
108340
- }
108341
110490
  }
108342
110491
  }
108343
110492
  },
@@ -114039,9 +116188,9 @@ var schemaComponents = {
114039
116188
  // src/generated/generation.json
114040
116189
  var generation_default = {
114041
116190
  formatVersion: 6,
114042
- release: "1.20261031.231351",
114043
- openapiSha256: "8fa3a94dd756c3979d4396836eeef6a41068fdcc3d61365d7fd7fc64121755dc",
114044
- openapiContentSha256: "4890ffbf2df6526c63f819d997c3e4bbce5f010efd1492b2079be9e8e12e80f6",
116191
+ release: "1.20261101.1149",
116192
+ openapiSha256: "93cc9ff7bde9c4d0011413c408e08dc907b2701c78831042f93bff6d66c2f019",
116193
+ openapiContentSha256: "ea84a99894927badee6af4fd1b9b6e39e845eb87fe5b2b8bcedb20bce67e956d",
114045
116194
  forge: {
114046
116195
  repository: "https://github.com/cloudflare/forge",
114047
116196
  commit: "7f86447210b7bea3779bfdab3cd5655eade0eadb",
@@ -114054,7 +116203,7 @@ var generation_default = {
114054
116203
  outputs: [
114055
116204
  {
114056
116205
  path: "src/generated/commands.ts",
114057
- sha256: "bd7c06262d60aec72bdec72b8fa04a6e4db3e8f71502b75989f947d53db76f4a"
116206
+ sha256: "d6df1959c27aa72de66834304545b639ea07f829876399a8e120c592c3209f59"
114058
116207
  }
114059
116208
  ]
114060
116209
  };
@@ -114409,7 +116558,7 @@ ${name}`);
114409
116558
  }
114410
116559
 
114411
116560
  // src/index.ts
114412
- var VERSION = "3.13.0";
116561
+ var VERSION = "3.15.0";
114413
116562
  var RELEASE = generation_default.release;
114414
116563
  var SDK_PATHS = new Map(Object.values(commands).map((command) => [command.operation, command.sdkPath]));
114415
116564
  var SERVICES = [...new Set(Object.keys(commands).map((name) => name.split(" ")[0]))].toSorted();