evo360-types 1.3.353 → 1.3.355
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/apps/evo-chat/chatbee/zod-schemas.d.ts +1080 -0
- package/dist/apps/evo-chat/chatbee/zod-schemas.js +73 -1
- package/dist/apps/evo-chat/chatbee/zod-schemas.ts +80 -0
- package/dist/apps/evo-hub-ia/v1/adapter-tool-registry.d.ts +46 -0
- package/dist/apps/evo-hub-ia/v1/adapter-tool-registry.js +16 -0
- package/dist/apps/evo-hub-ia/v1/adapter-tool-registry.ts +55 -0
- package/dist/apps/evo-hub-ia/v1/zod-schemas.d.ts +452 -6
- package/dist/apps/evo-hub-ia/v1/zod-schemas.js +70 -2
- package/dist/apps/evo-hub-ia/v1/zod-schemas.ts +77 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/dist/index.ts +1 -0
- package/package.json +1 -1
|
@@ -8,6 +8,12 @@ export type IHubiaAttendanceMode = z.infer<typeof zHubiaAttendanceModeSchema>;
|
|
|
8
8
|
|
|
9
9
|
// ───────── Channel Config (evo-hubia-v1 automation config per channel) ─────────
|
|
10
10
|
|
|
11
|
+
const zHubiaInlinePromptSchema = z.object({
|
|
12
|
+
text: z.string().default(""),
|
|
13
|
+
version: z.number().default(1),
|
|
14
|
+
updated_at: z.any().optional(),
|
|
15
|
+
}).partial();
|
|
16
|
+
|
|
11
17
|
export const zHubiaV1ChannelConfigSchema = zFireDocSchema.extend({
|
|
12
18
|
evo_chat_channel_id: z.string(),
|
|
13
19
|
channel_name: z.string(),
|
|
@@ -17,23 +23,73 @@ export const zHubiaV1ChannelConfigSchema = zFireDocSchema.extend({
|
|
|
17
23
|
llm_model: z.string().default("claude-sonnet-4-20250514"),
|
|
18
24
|
llm_temperature: z.number().min(0).max(1).default(0.3),
|
|
19
25
|
llm_max_tokens: z.number().default(2048),
|
|
26
|
+
/** @deprecated Coleção `apps/evo-hubia-v1/prompts/{id}` virou histórico (Q5=B em decisions.md). Após a migração, runtime ignora este campo. */
|
|
20
27
|
prompt_ids: z.array(z.string()).default([]),
|
|
28
|
+
/** Prompts inline herdados pelos bindings que apontam para este canal.
|
|
29
|
+
* Identity/safety/channel_custom específicos do canal.
|
|
30
|
+
* Migrados a partir da coleção legada `apps/evo-hubia-v1/prompts/{id}` (Q5=B em decisions.md). */
|
|
31
|
+
prompts: z.object({
|
|
32
|
+
identity: zHubiaInlinePromptSchema.optional(),
|
|
33
|
+
safety: zHubiaInlinePromptSchema.optional(),
|
|
34
|
+
channel_custom: zHubiaInlinePromptSchema.optional(),
|
|
35
|
+
}).optional(),
|
|
21
36
|
toolkit_id: z.string().nullable().optional(),
|
|
22
37
|
max_rounds: z.number().default(5),
|
|
23
38
|
max_tool_calls: z.number().default(10),
|
|
24
39
|
execution_timeout_ms: z.number().default(30000),
|
|
40
|
+
/** @deprecated Movido para `binding.capabilities`. Permanece como fallback indefinido (Q2=C em decisions.md). Não deve ser editado pela nova UI. */
|
|
25
41
|
capabilities: z.object({
|
|
26
42
|
can_schedule: z.boolean().default(false),
|
|
27
43
|
can_reschedule: z.boolean().default(false),
|
|
28
44
|
can_cancel: z.boolean().default(false),
|
|
29
45
|
can_handoff: z.boolean().default(true),
|
|
30
46
|
can_read_finops: z.boolean().default(false),
|
|
31
|
-
}),
|
|
47
|
+
}).optional(),
|
|
32
48
|
timezone: z.string().default("America/Sao_Paulo"),
|
|
49
|
+
|
|
50
|
+
// ───── Multi-provider (chatbee adapter) ─────
|
|
51
|
+
/** Provider que entrega mensagens deste canal. Quando ausente, runtime assume 'hub-waba' (back-compat). */
|
|
52
|
+
provider: z.enum(["chatbee", "hub-waba"]).optional(),
|
|
53
|
+
/** Para provider='chatbee': id do canal no Chatbee (numérico stringificado). */
|
|
54
|
+
chatbee_channel_id: z.string().optional(),
|
|
55
|
+
/** Para provider='chatbee': company_id que resolve a API key do Chatbee. */
|
|
56
|
+
chatbee_company_id: z.number().optional(),
|
|
57
|
+
/** Department padrão para AI router. Para Chatbee, único caminho (não há canal v3). Para hub-waba, fallback caso ticket não tenha department. */
|
|
58
|
+
default_department_id: z.string().optional(),
|
|
59
|
+
/** Quantidade máxima de mensagens carregadas pela tool `get_conversation_history` (auto-injection). Default runtime: 30. */
|
|
60
|
+
history_size: z.number().int().positive().optional(),
|
|
33
61
|
}).passthrough();
|
|
34
62
|
|
|
35
63
|
export type IHubiaV1ChannelConfig = z.infer<typeof zHubiaV1ChannelConfigSchema>;
|
|
36
64
|
|
|
65
|
+
// ───────── Conversation Message (histórico provider-agnostic) ─────────
|
|
66
|
+
//
|
|
67
|
+
// Schema usado pela tool `get_conversation_history` (DA-7/DA-8).
|
|
68
|
+
// Hub-waba lê de `apps/evo-chat/threads/{tid}/messages` (v3 existente).
|
|
69
|
+
// Chatbee lê de `apps/evo-chatbee-adapter/conversations/{cb}/messages` (criada pelo adapter).
|
|
70
|
+
|
|
71
|
+
export const zHubiaConversationMessageSchema = z.object({
|
|
72
|
+
id: z.string(),
|
|
73
|
+
direction: z.enum(["in", "out"]),
|
|
74
|
+
/** Role pronto para LLM (Anthropic messages API). */
|
|
75
|
+
role: z.enum(["user", "assistant"]),
|
|
76
|
+
text: z.string().default(""),
|
|
77
|
+
type: z.enum(["text", "audio", "image", "document", "event"]).default("text"),
|
|
78
|
+
audio_transcript: z.string().optional(),
|
|
79
|
+
source: z.enum(["patient", "ai", "operator", "n8n"]),
|
|
80
|
+
provider: z.enum(["chatbee", "hub-waba"]),
|
|
81
|
+
provider_message_id: z.string(),
|
|
82
|
+
execution_id: z.string().optional(),
|
|
83
|
+
created_by: z.object({
|
|
84
|
+
user_id: z.string().optional(),
|
|
85
|
+
agent: z.string().optional(),
|
|
86
|
+
}).optional(),
|
|
87
|
+
/** Timestamp do payload original — NÃO serverTimestamp (preserva ordem cronológica real). */
|
|
88
|
+
occurred_at: z.any(),
|
|
89
|
+
}).passthrough();
|
|
90
|
+
|
|
91
|
+
export type IHubiaConversationMessage = z.infer<typeof zHubiaConversationMessageSchema>;
|
|
92
|
+
|
|
37
93
|
// ───────── Conversation Mode ─────────
|
|
38
94
|
|
|
39
95
|
export const zHubiaConversationModeSchema = z.enum(["ai_only", "hybrid_assist", "human_only", "blocked"]);
|
|
@@ -41,6 +97,20 @@ export type IHubiaConversationMode = z.infer<typeof zHubiaConversationModeSchema
|
|
|
41
97
|
|
|
42
98
|
// ───────── AI Binding (department → AI agent routing) ─────────
|
|
43
99
|
|
|
100
|
+
const zHubiaCapabilitiesSchema = z.object({
|
|
101
|
+
can_schedule: z.boolean().default(false),
|
|
102
|
+
can_reschedule: z.boolean().default(false),
|
|
103
|
+
can_cancel: z.boolean().default(false),
|
|
104
|
+
can_handoff: z.boolean().default(true),
|
|
105
|
+
can_read_finops: z.boolean().default(false),
|
|
106
|
+
}).partial();
|
|
107
|
+
|
|
108
|
+
const zHubiaPromptOverridesSchema = z.object({
|
|
109
|
+
behavior: z.string().optional(),
|
|
110
|
+
routing: z.string().optional(),
|
|
111
|
+
tool_usage: z.string().optional(),
|
|
112
|
+
});
|
|
113
|
+
|
|
44
114
|
export const zAiBindingSchema = zFireDocSchema.extend({
|
|
45
115
|
agent_type: z.string(), // 'evo-hubia-v1', future: 'evo-hubia-v2', etc.
|
|
46
116
|
agent_config_id: z.string(), // ref to the agent's channel config doc
|
|
@@ -53,6 +123,12 @@ export const zAiBindingSchema = zFireDocSchema.extend({
|
|
|
53
123
|
* human_only — AI disabled, operator can switch to other modes
|
|
54
124
|
* blocked — AI disabled, operator CANNOT change mode (admin lock) */
|
|
55
125
|
default_mode: zHubiaConversationModeSchema.default("ai_only"),
|
|
126
|
+
/** Capacidades efetivas para tools deste departamento.
|
|
127
|
+
* Quando ausente, runtime aplica `channel.capabilities` como fallback. */
|
|
128
|
+
capabilities: zHubiaCapabilitiesSchema.optional(),
|
|
129
|
+
/** Prompts específicos do fluxo do departamento (texto inline).
|
|
130
|
+
* Empilhados após identity/safety/channel_custom do canal. */
|
|
131
|
+
prompt_overrides: zHubiaPromptOverridesSchema.optional(),
|
|
56
132
|
}).passthrough();
|
|
57
133
|
|
|
58
134
|
export type IAiBinding = z.infer<typeof zAiBindingSchema>;
|
package/dist/index.d.ts
CHANGED
|
@@ -46,6 +46,7 @@ export * from "./apps/evo-chat/waba-setup/zod-schemas";
|
|
|
46
46
|
export * from "./apps/evo-chat/quick-reply/zod-schemas";
|
|
47
47
|
export * from "./apps/evo-hub-ia/channel/zod-schemas";
|
|
48
48
|
export * from "./apps/evo-hub-ia/v1/zod-schemas";
|
|
49
|
+
export * from "./apps/evo-hub-ia/v1/adapter-tool-registry";
|
|
49
50
|
export * from "./apps/evo-med/calendar/zod-schemas";
|
|
50
51
|
export * from "./apps/evo-med/appointment/zod-schemas";
|
|
51
52
|
export * from "./apps/evo-med/dic/zod-schemas";
|
package/dist/index.js
CHANGED
|
@@ -64,6 +64,7 @@ __exportStar(require("./apps/evo-chat/waba-setup/zod-schemas"), exports);
|
|
|
64
64
|
__exportStar(require("./apps/evo-chat/quick-reply/zod-schemas"), exports);
|
|
65
65
|
__exportStar(require("./apps/evo-hub-ia/channel/zod-schemas"), exports);
|
|
66
66
|
__exportStar(require("./apps/evo-hub-ia/v1/zod-schemas"), exports);
|
|
67
|
+
__exportStar(require("./apps/evo-hub-ia/v1/adapter-tool-registry"), exports);
|
|
67
68
|
__exportStar(require("./apps/evo-med/calendar/zod-schemas"), exports);
|
|
68
69
|
__exportStar(require("./apps/evo-med/appointment/zod-schemas"), exports);
|
|
69
70
|
__exportStar(require("./apps/evo-med/dic/zod-schemas"), exports);
|
package/dist/index.ts
CHANGED
|
@@ -49,6 +49,7 @@ export * from "./apps/evo-chat/waba-setup/zod-schemas";
|
|
|
49
49
|
export * from "./apps/evo-chat/quick-reply/zod-schemas";
|
|
50
50
|
export * from "./apps/evo-hub-ia/channel/zod-schemas";
|
|
51
51
|
export * from "./apps/evo-hub-ia/v1/zod-schemas";
|
|
52
|
+
export * from "./apps/evo-hub-ia/v1/adapter-tool-registry";
|
|
52
53
|
export * from "./apps/evo-med/calendar/zod-schemas";
|
|
53
54
|
export * from "./apps/evo-med/appointment/zod-schemas";
|
|
54
55
|
export * from "./apps/evo-med/dic/zod-schemas";
|