@cossistant/types 0.0.30 → 0.0.32
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/api/ai-agent.d.ts +147 -1
- package/api/ai-agent.d.ts.map +1 -1
- package/api/ai-agent.js +133 -1
- package/api/ai-agent.js.map +1 -1
- package/api/common.d.ts.map +1 -1
- package/api/conversation.d.ts +32 -9
- package/api/conversation.d.ts.map +1 -1
- package/api/conversation.js +14 -1
- package/api/conversation.js.map +1 -1
- package/api/feedback.d.ts +98 -0
- package/api/feedback.d.ts.map +1 -0
- package/api/feedback.js +68 -0
- package/api/feedback.js.map +1 -0
- package/api/index.d.ts +4 -3
- package/api/index.js +4 -3
- package/api/timeline-item.d.ts +9 -6
- package/api/timeline-item.d.ts.map +1 -1
- package/api/timeline-item.js +3 -2
- package/api/timeline-item.js.map +1 -1
- package/enums.d.ts +1 -0
- package/enums.d.ts.map +1 -1
- package/enums.js +2 -1
- package/enums.js.map +1 -1
- package/index.d.ts +5 -4
- package/index.d.ts.map +1 -1
- package/index.js +5 -4
- package/package.json +1 -1
- package/realtime-events.d.ts +31 -6
- package/realtime-events.d.ts.map +1 -1
- package/realtime-events.js +22 -4
- package/realtime-events.js.map +1 -1
- package/schemas.d.ts +5 -2
- package/schemas.d.ts.map +1 -1
- package/schemas.js +2 -0
- package/schemas.js.map +1 -1
- package/trpc/conversation.d.ts +59 -10
- package/trpc/conversation.d.ts.map +1 -1
- package/trpc/conversation.js +32 -1
- package/trpc/conversation.js.map +1 -1
- package/trpc/visitor.d.ts +3 -1
- package/trpc/visitor.d.ts.map +1 -1
package/api/ai-agent.d.ts
CHANGED
|
@@ -67,6 +67,39 @@ declare const AI_AGENT_GOALS: readonly [{
|
|
|
67
67
|
readonly label: "Collect customer feedback";
|
|
68
68
|
}];
|
|
69
69
|
type AIAgentGoal = (typeof AI_AGENT_GOALS)[number]["value"];
|
|
70
|
+
declare const AI_AGENT_CORE_PROMPT_DOCUMENT_NAMES: readonly ["agent.md", "security.md", "behaviour.md", "participation.md", "grounding.md", "capabilities.md"];
|
|
71
|
+
type AiAgentCorePromptDocumentName = (typeof AI_AGENT_CORE_PROMPT_DOCUMENT_NAMES)[number];
|
|
72
|
+
declare const aiAgentPromptDocumentKindSchema: z.ZodEnum<{
|
|
73
|
+
core: "core";
|
|
74
|
+
skill: "skill";
|
|
75
|
+
}>;
|
|
76
|
+
declare const aiAgentCorePromptDocumentNameSchema: z.ZodEnum<{
|
|
77
|
+
"agent.md": "agent.md";
|
|
78
|
+
"security.md": "security.md";
|
|
79
|
+
"behaviour.md": "behaviour.md";
|
|
80
|
+
"participation.md": "participation.md";
|
|
81
|
+
"grounding.md": "grounding.md";
|
|
82
|
+
"capabilities.md": "capabilities.md";
|
|
83
|
+
}>;
|
|
84
|
+
declare const aiAgentSkillPromptDocumentNameSchema: z.ZodString;
|
|
85
|
+
declare const aiAgentPromptDocumentResponseSchema: z.ZodObject<{
|
|
86
|
+
id: z.ZodULID;
|
|
87
|
+
organizationId: z.ZodULID;
|
|
88
|
+
websiteId: z.ZodULID;
|
|
89
|
+
aiAgentId: z.ZodULID;
|
|
90
|
+
kind: z.ZodEnum<{
|
|
91
|
+
core: "core";
|
|
92
|
+
skill: "skill";
|
|
93
|
+
}>;
|
|
94
|
+
name: z.ZodString;
|
|
95
|
+
content: z.ZodString;
|
|
96
|
+
enabled: z.ZodBoolean;
|
|
97
|
+
priority: z.ZodNumber;
|
|
98
|
+
createdByUserId: z.ZodNullable<z.ZodULID>;
|
|
99
|
+
updatedByUserId: z.ZodNullable<z.ZodULID>;
|
|
100
|
+
createdAt: z.ZodString;
|
|
101
|
+
updatedAt: z.ZodString;
|
|
102
|
+
}, z.core.$strip>;
|
|
70
103
|
/**
|
|
71
104
|
* AI Agent response schema
|
|
72
105
|
*/
|
|
@@ -158,6 +191,91 @@ declare const generateBasePromptResponseSchema: z.ZodObject<{
|
|
|
158
191
|
favicon: z.ZodNullable<z.ZodString>;
|
|
159
192
|
discoveredLinksCount: z.ZodNumber;
|
|
160
193
|
}, z.core.$strip>;
|
|
194
|
+
declare const listPromptDocumentsRequestSchema: z.ZodObject<{
|
|
195
|
+
websiteSlug: z.ZodString;
|
|
196
|
+
aiAgentId: z.ZodULID;
|
|
197
|
+
}, z.core.$strip>;
|
|
198
|
+
declare const listPromptDocumentsResponseSchema: z.ZodObject<{
|
|
199
|
+
coreDocuments: z.ZodArray<z.ZodObject<{
|
|
200
|
+
id: z.ZodULID;
|
|
201
|
+
organizationId: z.ZodULID;
|
|
202
|
+
websiteId: z.ZodULID;
|
|
203
|
+
aiAgentId: z.ZodULID;
|
|
204
|
+
kind: z.ZodEnum<{
|
|
205
|
+
core: "core";
|
|
206
|
+
skill: "skill";
|
|
207
|
+
}>;
|
|
208
|
+
name: z.ZodString;
|
|
209
|
+
content: z.ZodString;
|
|
210
|
+
enabled: z.ZodBoolean;
|
|
211
|
+
priority: z.ZodNumber;
|
|
212
|
+
createdByUserId: z.ZodNullable<z.ZodULID>;
|
|
213
|
+
updatedByUserId: z.ZodNullable<z.ZodULID>;
|
|
214
|
+
createdAt: z.ZodString;
|
|
215
|
+
updatedAt: z.ZodString;
|
|
216
|
+
}, z.core.$strip>>;
|
|
217
|
+
skillDocuments: z.ZodArray<z.ZodObject<{
|
|
218
|
+
id: z.ZodULID;
|
|
219
|
+
organizationId: z.ZodULID;
|
|
220
|
+
websiteId: z.ZodULID;
|
|
221
|
+
aiAgentId: z.ZodULID;
|
|
222
|
+
kind: z.ZodEnum<{
|
|
223
|
+
core: "core";
|
|
224
|
+
skill: "skill";
|
|
225
|
+
}>;
|
|
226
|
+
name: z.ZodString;
|
|
227
|
+
content: z.ZodString;
|
|
228
|
+
enabled: z.ZodBoolean;
|
|
229
|
+
priority: z.ZodNumber;
|
|
230
|
+
createdByUserId: z.ZodNullable<z.ZodULID>;
|
|
231
|
+
updatedByUserId: z.ZodNullable<z.ZodULID>;
|
|
232
|
+
createdAt: z.ZodString;
|
|
233
|
+
updatedAt: z.ZodString;
|
|
234
|
+
}, z.core.$strip>>;
|
|
235
|
+
}, z.core.$strip>;
|
|
236
|
+
declare const upsertCoreDocumentRequestSchema: z.ZodObject<{
|
|
237
|
+
websiteSlug: z.ZodString;
|
|
238
|
+
aiAgentId: z.ZodULID;
|
|
239
|
+
name: z.ZodEnum<{
|
|
240
|
+
"agent.md": "agent.md";
|
|
241
|
+
"security.md": "security.md";
|
|
242
|
+
"behaviour.md": "behaviour.md";
|
|
243
|
+
"participation.md": "participation.md";
|
|
244
|
+
"grounding.md": "grounding.md";
|
|
245
|
+
"capabilities.md": "capabilities.md";
|
|
246
|
+
}>;
|
|
247
|
+
content: z.ZodString;
|
|
248
|
+
enabled: z.ZodOptional<z.ZodBoolean>;
|
|
249
|
+
priority: z.ZodOptional<z.ZodNumber>;
|
|
250
|
+
}, z.core.$strip>;
|
|
251
|
+
declare const createSkillDocumentRequestSchema: z.ZodObject<{
|
|
252
|
+
websiteSlug: z.ZodString;
|
|
253
|
+
aiAgentId: z.ZodULID;
|
|
254
|
+
name: z.ZodString;
|
|
255
|
+
content: z.ZodString;
|
|
256
|
+
enabled: z.ZodOptional<z.ZodBoolean>;
|
|
257
|
+
priority: z.ZodOptional<z.ZodNumber>;
|
|
258
|
+
}, z.core.$strip>;
|
|
259
|
+
declare const updateSkillDocumentRequestSchema: z.ZodObject<{
|
|
260
|
+
websiteSlug: z.ZodString;
|
|
261
|
+
aiAgentId: z.ZodULID;
|
|
262
|
+
skillDocumentId: z.ZodULID;
|
|
263
|
+
name: z.ZodOptional<z.ZodString>;
|
|
264
|
+
content: z.ZodOptional<z.ZodString>;
|
|
265
|
+
enabled: z.ZodOptional<z.ZodBoolean>;
|
|
266
|
+
priority: z.ZodOptional<z.ZodNumber>;
|
|
267
|
+
}, z.core.$strip>;
|
|
268
|
+
declare const deleteSkillDocumentRequestSchema: z.ZodObject<{
|
|
269
|
+
websiteSlug: z.ZodString;
|
|
270
|
+
aiAgentId: z.ZodULID;
|
|
271
|
+
skillDocumentId: z.ZodULID;
|
|
272
|
+
}, z.core.$strip>;
|
|
273
|
+
declare const toggleSkillDocumentRequestSchema: z.ZodObject<{
|
|
274
|
+
websiteSlug: z.ZodString;
|
|
275
|
+
aiAgentId: z.ZodULID;
|
|
276
|
+
skillDocumentId: z.ZodULID;
|
|
277
|
+
enabled: z.ZodBoolean;
|
|
278
|
+
}, z.core.$strip>;
|
|
161
279
|
type AiAgentResponse = z.infer<typeof aiAgentResponseSchema>;
|
|
162
280
|
type CreateAiAgentRequest = z.infer<typeof createAiAgentRequestSchema>;
|
|
163
281
|
type UpdateAiAgentRequest = z.infer<typeof updateAiAgentRequestSchema>;
|
|
@@ -166,6 +284,14 @@ type DeleteAiAgentRequest = z.infer<typeof deleteAiAgentRequestSchema>;
|
|
|
166
284
|
type GetAiAgentRequest = z.infer<typeof getAiAgentRequestSchema>;
|
|
167
285
|
type GenerateBasePromptRequest = z.infer<typeof generateBasePromptRequestSchema>;
|
|
168
286
|
type GenerateBasePromptResponse = z.infer<typeof generateBasePromptResponseSchema>;
|
|
287
|
+
type AiAgentPromptDocumentResponse = z.infer<typeof aiAgentPromptDocumentResponseSchema>;
|
|
288
|
+
type ListPromptDocumentsRequest = z.infer<typeof listPromptDocumentsRequestSchema>;
|
|
289
|
+
type ListPromptDocumentsResponse = z.infer<typeof listPromptDocumentsResponseSchema>;
|
|
290
|
+
type UpsertCoreDocumentRequest = z.infer<typeof upsertCoreDocumentRequestSchema>;
|
|
291
|
+
type CreateSkillDocumentRequest = z.infer<typeof createSkillDocumentRequestSchema>;
|
|
292
|
+
type UpdateSkillDocumentRequest = z.infer<typeof updateSkillDocumentRequestSchema>;
|
|
293
|
+
type DeleteSkillDocumentRequest = z.infer<typeof deleteSkillDocumentRequestSchema>;
|
|
294
|
+
type ToggleSkillDocumentRequest = z.infer<typeof toggleSkillDocumentRequestSchema>;
|
|
169
295
|
/**
|
|
170
296
|
* AI Agent Behavior Settings Schema
|
|
171
297
|
*
|
|
@@ -181,6 +307,11 @@ declare const aiAgentBehaviorSettingsSchema: z.ZodObject<{
|
|
|
181
307
|
canCategorize: z.ZodBoolean;
|
|
182
308
|
canEscalate: z.ZodBoolean;
|
|
183
309
|
defaultEscalationUserId: z.ZodNullable<z.ZodString>;
|
|
310
|
+
visitorContactPolicy: z.ZodEnum<{
|
|
311
|
+
only_if_needed: "only_if_needed";
|
|
312
|
+
ask_early: "ask_early";
|
|
313
|
+
ask_after_time: "ask_after_time";
|
|
314
|
+
}>;
|
|
184
315
|
autoAnalyzeSentiment: z.ZodBoolean;
|
|
185
316
|
autoGenerateTitle: z.ZodBoolean;
|
|
186
317
|
autoCategorize: z.ZodBoolean;
|
|
@@ -203,6 +334,11 @@ declare const getBehaviorSettingsResponseSchema: z.ZodObject<{
|
|
|
203
334
|
canCategorize: z.ZodBoolean;
|
|
204
335
|
canEscalate: z.ZodBoolean;
|
|
205
336
|
defaultEscalationUserId: z.ZodNullable<z.ZodString>;
|
|
337
|
+
visitorContactPolicy: z.ZodEnum<{
|
|
338
|
+
only_if_needed: "only_if_needed";
|
|
339
|
+
ask_early: "ask_early";
|
|
340
|
+
ask_after_time: "ask_after_time";
|
|
341
|
+
}>;
|
|
206
342
|
autoAnalyzeSentiment: z.ZodBoolean;
|
|
207
343
|
autoGenerateTitle: z.ZodBoolean;
|
|
208
344
|
autoCategorize: z.ZodBoolean;
|
|
@@ -222,6 +358,11 @@ declare const updateBehaviorSettingsRequestSchema: z.ZodObject<{
|
|
|
222
358
|
canCategorize: z.ZodOptional<z.ZodBoolean>;
|
|
223
359
|
canEscalate: z.ZodOptional<z.ZodBoolean>;
|
|
224
360
|
defaultEscalationUserId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
361
|
+
visitorContactPolicy: z.ZodOptional<z.ZodEnum<{
|
|
362
|
+
only_if_needed: "only_if_needed";
|
|
363
|
+
ask_early: "ask_early";
|
|
364
|
+
ask_after_time: "ask_after_time";
|
|
365
|
+
}>>;
|
|
225
366
|
autoAnalyzeSentiment: z.ZodOptional<z.ZodBoolean>;
|
|
226
367
|
autoGenerateTitle: z.ZodOptional<z.ZodBoolean>;
|
|
227
368
|
autoCategorize: z.ZodOptional<z.ZodBoolean>;
|
|
@@ -238,6 +379,11 @@ declare const updateBehaviorSettingsResponseSchema: z.ZodObject<{
|
|
|
238
379
|
canCategorize: z.ZodBoolean;
|
|
239
380
|
canEscalate: z.ZodBoolean;
|
|
240
381
|
defaultEscalationUserId: z.ZodNullable<z.ZodString>;
|
|
382
|
+
visitorContactPolicy: z.ZodEnum<{
|
|
383
|
+
only_if_needed: "only_if_needed";
|
|
384
|
+
ask_early: "ask_early";
|
|
385
|
+
ask_after_time: "ask_after_time";
|
|
386
|
+
}>;
|
|
241
387
|
autoAnalyzeSentiment: z.ZodBoolean;
|
|
242
388
|
autoGenerateTitle: z.ZodBoolean;
|
|
243
389
|
autoCategorize: z.ZodBoolean;
|
|
@@ -247,5 +393,5 @@ type GetBehaviorSettingsResponse = z.infer<typeof getBehaviorSettingsResponseSch
|
|
|
247
393
|
type UpdateBehaviorSettingsRequest = z.infer<typeof updateBehaviorSettingsRequestSchema>;
|
|
248
394
|
type UpdateBehaviorSettingsResponse = z.infer<typeof updateBehaviorSettingsResponseSchema>;
|
|
249
395
|
//#endregion
|
|
250
|
-
export { AIAgentGoal, AIModel, AIModelConfig, AI_AGENT_GOALS, AI_MODELS, AiAgentBehaviorSettings, AiAgentResponse, CreateAiAgentRequest, DeleteAiAgentRequest, GenerateBasePromptRequest, GenerateBasePromptResponse, GetAiAgentRequest, GetBehaviorSettingsRequest, GetBehaviorSettingsResponse, ToggleAiAgentActiveRequest, UpdateAiAgentRequest, UpdateBehaviorSettingsRequest, UpdateBehaviorSettingsResponse, aiAgentBehaviorSettingsSchema, aiAgentResponseSchema, createAiAgentRequestSchema, deleteAiAgentRequestSchema, generateBasePromptRequestSchema, generateBasePromptResponseSchema, getAiAgentRequestSchema, getBehaviorSettingsRequestSchema, getBehaviorSettingsResponseSchema, toggleAiAgentActiveRequestSchema, updateAiAgentRequestSchema, updateBehaviorSettingsRequestSchema, updateBehaviorSettingsResponseSchema };
|
|
396
|
+
export { AIAgentGoal, AIModel, AIModelConfig, AI_AGENT_CORE_PROMPT_DOCUMENT_NAMES, AI_AGENT_GOALS, AI_MODELS, AiAgentBehaviorSettings, AiAgentCorePromptDocumentName, AiAgentPromptDocumentResponse, AiAgentResponse, CreateAiAgentRequest, CreateSkillDocumentRequest, DeleteAiAgentRequest, DeleteSkillDocumentRequest, GenerateBasePromptRequest, GenerateBasePromptResponse, GetAiAgentRequest, GetBehaviorSettingsRequest, GetBehaviorSettingsResponse, ListPromptDocumentsRequest, ListPromptDocumentsResponse, ToggleAiAgentActiveRequest, ToggleSkillDocumentRequest, UpdateAiAgentRequest, UpdateBehaviorSettingsRequest, UpdateBehaviorSettingsResponse, UpdateSkillDocumentRequest, UpsertCoreDocumentRequest, aiAgentBehaviorSettingsSchema, aiAgentCorePromptDocumentNameSchema, aiAgentPromptDocumentKindSchema, aiAgentPromptDocumentResponseSchema, aiAgentResponseSchema, aiAgentSkillPromptDocumentNameSchema, createAiAgentRequestSchema, createSkillDocumentRequestSchema, deleteAiAgentRequestSchema, deleteSkillDocumentRequestSchema, generateBasePromptRequestSchema, generateBasePromptResponseSchema, getAiAgentRequestSchema, getBehaviorSettingsRequestSchema, getBehaviorSettingsResponseSchema, listPromptDocumentsRequestSchema, listPromptDocumentsResponseSchema, toggleAiAgentActiveRequestSchema, toggleSkillDocumentRequestSchema, updateAiAgentRequestSchema, updateBehaviorSettingsRequestSchema, updateBehaviorSettingsResponseSchema, updateSkillDocumentRequestSchema, upsertCoreDocumentRequestSchema };
|
|
251
397
|
//# sourceMappingURL=ai-agent.d.ts.map
|
package/api/ai-agent.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ai-agent.d.ts","names":[],"sources":["../../src/api/ai-agent.ts"],"sourcesContent":[],"mappings":";;;;;;AAKA;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AA4B,CAAA,CAAE,aAClC;KAEI,0BAAA,GAA6B,CAAA,CAAE,aACnC;KAEI,0BAAA,GAA6B,CAAA,CAAE,aACnC;KAEI,0BAAA,GAA6B,CAAA,CAAE,aACnC;KAEI,0BAAA,GAA6B,CAAA,CAAE,aACnC;;;;;;;;AA6FsC,cAnFjC,6BAmFiC,EAnFJ,CAAA,CAAA,SAmFI,CAAA;EAcjC,UAAA,cAAA;;;;;;;;;;;;;;;;KAnCD,uBAAA,GAA0B,CAAA,CAAE,aAChC;;;;cAMK,kCAAgC,CAAA,CAAA;;;;;;cAchC,mCAAiC,CAAA,CAAA;;;EAcE,SAAA,cAAA;EAAA,cAAA,cAAA;EAmBnC,aAAA,cAAA;;;;;;;;;;;;;;;;AAKD,cAxBC,mCAyBL,EAzBwC,CAAA,CAAA,SAyBxC,CAAA;EAEI,WAAA,aAAA;EAGA,SAAA,WAAA;EAGA,QAAA,aAAA,CAAA;;;;;;;;;;;;;;;;;;;;;cAdC,sCAAoC,CAAA,CAAA;;;;;;;;;;;;;;;;;KAKrC,0BAAA,GAA6B,CAAA,CAAE,aACnC;KAEI,2BAAA,GAA8B,CAAA,CAAE,aACpC;KAEI,6BAAA,GAAgC,CAAA,CAAE,aACtC;KAEI,8BAAA,GAAiC,CAAA,CAAE,aACvC"}
|
package/api/ai-agent.js
CHANGED
|
@@ -77,6 +77,32 @@ const AI_AGENT_GOALS = [
|
|
|
77
77
|
label: "Collect customer feedback"
|
|
78
78
|
}
|
|
79
79
|
];
|
|
80
|
+
const AI_AGENT_CORE_PROMPT_DOCUMENT_NAMES = [
|
|
81
|
+
"agent.md",
|
|
82
|
+
"security.md",
|
|
83
|
+
"behaviour.md",
|
|
84
|
+
"participation.md",
|
|
85
|
+
"grounding.md",
|
|
86
|
+
"capabilities.md"
|
|
87
|
+
];
|
|
88
|
+
const aiAgentPromptDocumentKindSchema = z.enum(["core", "skill"]);
|
|
89
|
+
const aiAgentCorePromptDocumentNameSchema = z.enum(AI_AGENT_CORE_PROMPT_DOCUMENT_NAMES);
|
|
90
|
+
const aiAgentSkillPromptDocumentNameSchema = z.string().regex(/^[a-z0-9][a-z0-9-]{1,62}\.md$/, { message: "Skill name must match ^[a-z0-9][a-z0-9-]{1,62}\\.md$" }).refine((value) => !AI_AGENT_CORE_PROMPT_DOCUMENT_NAMES.includes(value), { message: "Skill name cannot use reserved core document names." });
|
|
91
|
+
const aiAgentPromptDocumentResponseSchema = z.object({
|
|
92
|
+
id: z.ulid(),
|
|
93
|
+
organizationId: z.ulid(),
|
|
94
|
+
websiteId: z.ulid(),
|
|
95
|
+
aiAgentId: z.ulid(),
|
|
96
|
+
kind: aiAgentPromptDocumentKindSchema,
|
|
97
|
+
name: z.string(),
|
|
98
|
+
content: z.string(),
|
|
99
|
+
enabled: z.boolean(),
|
|
100
|
+
priority: z.number().int(),
|
|
101
|
+
createdByUserId: z.ulid().nullable(),
|
|
102
|
+
updatedByUserId: z.ulid().nullable(),
|
|
103
|
+
createdAt: z.string(),
|
|
104
|
+
updatedAt: z.string()
|
|
105
|
+
});
|
|
80
106
|
/**
|
|
81
107
|
* AI Agent response schema
|
|
82
108
|
*/
|
|
@@ -316,6 +342,104 @@ const generateBasePromptResponseSchema = z.object({
|
|
|
316
342
|
example: 47
|
|
317
343
|
})
|
|
318
344
|
}).openapi({ description: "Response containing the generated base prompt and brand info." });
|
|
345
|
+
const listPromptDocumentsRequestSchema = z.object({
|
|
346
|
+
websiteSlug: z.string().openapi({
|
|
347
|
+
description: "The website slug.",
|
|
348
|
+
example: "my-website"
|
|
349
|
+
}),
|
|
350
|
+
aiAgentId: z.ulid().openapi({
|
|
351
|
+
description: "The AI agent ID.",
|
|
352
|
+
example: "01JG000000000000000000000"
|
|
353
|
+
})
|
|
354
|
+
});
|
|
355
|
+
const listPromptDocumentsResponseSchema = z.object({
|
|
356
|
+
coreDocuments: z.array(aiAgentPromptDocumentResponseSchema),
|
|
357
|
+
skillDocuments: z.array(aiAgentPromptDocumentResponseSchema)
|
|
358
|
+
});
|
|
359
|
+
const upsertCoreDocumentRequestSchema = z.object({
|
|
360
|
+
websiteSlug: z.string().openapi({
|
|
361
|
+
description: "The website slug.",
|
|
362
|
+
example: "my-website"
|
|
363
|
+
}),
|
|
364
|
+
aiAgentId: z.ulid().openapi({
|
|
365
|
+
description: "The AI agent ID.",
|
|
366
|
+
example: "01JG000000000000000000000"
|
|
367
|
+
}),
|
|
368
|
+
name: aiAgentCorePromptDocumentNameSchema,
|
|
369
|
+
content: z.string().max(5e4).openapi({
|
|
370
|
+
description: "Markdown content for the core document.",
|
|
371
|
+
example: "## Instructions\\nFollow these rules."
|
|
372
|
+
}),
|
|
373
|
+
enabled: z.boolean().optional(),
|
|
374
|
+
priority: z.number().int().min(-100).max(100).optional()
|
|
375
|
+
});
|
|
376
|
+
const createSkillDocumentRequestSchema = z.object({
|
|
377
|
+
websiteSlug: z.string().openapi({
|
|
378
|
+
description: "The website slug.",
|
|
379
|
+
example: "my-website"
|
|
380
|
+
}),
|
|
381
|
+
aiAgentId: z.ulid().openapi({
|
|
382
|
+
description: "The AI agent ID.",
|
|
383
|
+
example: "01JG000000000000000000000"
|
|
384
|
+
}),
|
|
385
|
+
name: aiAgentSkillPromptDocumentNameSchema,
|
|
386
|
+
content: z.string().max(5e4).openapi({
|
|
387
|
+
description: "Markdown content for the skill document.",
|
|
388
|
+
example: "## Workflow\\nWhen refund appears, collect order ID first."
|
|
389
|
+
}),
|
|
390
|
+
enabled: z.boolean().optional(),
|
|
391
|
+
priority: z.number().int().min(-100).max(100).optional()
|
|
392
|
+
});
|
|
393
|
+
const updateSkillDocumentRequestSchema = z.object({
|
|
394
|
+
websiteSlug: z.string().openapi({
|
|
395
|
+
description: "The website slug.",
|
|
396
|
+
example: "my-website"
|
|
397
|
+
}),
|
|
398
|
+
aiAgentId: z.ulid().openapi({
|
|
399
|
+
description: "The AI agent ID.",
|
|
400
|
+
example: "01JG000000000000000000000"
|
|
401
|
+
}),
|
|
402
|
+
skillDocumentId: z.ulid().openapi({
|
|
403
|
+
description: "The skill prompt document ID.",
|
|
404
|
+
example: "01JG000000000000000000000"
|
|
405
|
+
}),
|
|
406
|
+
name: aiAgentSkillPromptDocumentNameSchema.optional(),
|
|
407
|
+
content: z.string().max(5e4).optional(),
|
|
408
|
+
enabled: z.boolean().optional(),
|
|
409
|
+
priority: z.number().int().min(-100).max(100).optional()
|
|
410
|
+
}).refine((data) => data.name !== void 0 || data.content !== void 0 || data.enabled !== void 0 || data.priority !== void 0, { message: "At least one field must be provided." });
|
|
411
|
+
const deleteSkillDocumentRequestSchema = z.object({
|
|
412
|
+
websiteSlug: z.string().openapi({
|
|
413
|
+
description: "The website slug.",
|
|
414
|
+
example: "my-website"
|
|
415
|
+
}),
|
|
416
|
+
aiAgentId: z.ulid().openapi({
|
|
417
|
+
description: "The AI agent ID.",
|
|
418
|
+
example: "01JG000000000000000000000"
|
|
419
|
+
}),
|
|
420
|
+
skillDocumentId: z.ulid().openapi({
|
|
421
|
+
description: "The skill prompt document ID.",
|
|
422
|
+
example: "01JG000000000000000000000"
|
|
423
|
+
})
|
|
424
|
+
});
|
|
425
|
+
const toggleSkillDocumentRequestSchema = z.object({
|
|
426
|
+
websiteSlug: z.string().openapi({
|
|
427
|
+
description: "The website slug.",
|
|
428
|
+
example: "my-website"
|
|
429
|
+
}),
|
|
430
|
+
aiAgentId: z.ulid().openapi({
|
|
431
|
+
description: "The AI agent ID.",
|
|
432
|
+
example: "01JG000000000000000000000"
|
|
433
|
+
}),
|
|
434
|
+
skillDocumentId: z.ulid().openapi({
|
|
435
|
+
description: "The skill prompt document ID.",
|
|
436
|
+
example: "01JG000000000000000000000"
|
|
437
|
+
}),
|
|
438
|
+
enabled: z.boolean().openapi({
|
|
439
|
+
description: "Whether the skill is enabled for runtime selection.",
|
|
440
|
+
example: true
|
|
441
|
+
})
|
|
442
|
+
});
|
|
319
443
|
/**
|
|
320
444
|
* AI Agent Behavior Settings Schema
|
|
321
445
|
*
|
|
@@ -352,6 +476,14 @@ const aiAgentBehaviorSettingsSchema = z.object({
|
|
|
352
476
|
description: "Default user ID to assign escalated conversations to.",
|
|
353
477
|
example: null
|
|
354
478
|
}),
|
|
479
|
+
visitorContactPolicy: z.enum([
|
|
480
|
+
"only_if_needed",
|
|
481
|
+
"ask_early",
|
|
482
|
+
"ask_after_time"
|
|
483
|
+
]).openapi({
|
|
484
|
+
description: "How aggressively the AI should ask for visitor contact information.",
|
|
485
|
+
example: "only_if_needed"
|
|
486
|
+
}),
|
|
355
487
|
autoAnalyzeSentiment: z.boolean().openapi({
|
|
356
488
|
description: "Whether to automatically analyze conversation sentiment.",
|
|
357
489
|
example: true
|
|
@@ -396,5 +528,5 @@ const updateBehaviorSettingsRequestSchema = z.object({
|
|
|
396
528
|
const updateBehaviorSettingsResponseSchema = aiAgentBehaviorSettingsSchema.openapi({ description: "The updated behavior settings." });
|
|
397
529
|
|
|
398
530
|
//#endregion
|
|
399
|
-
export { AI_AGENT_GOALS, AI_MODELS, aiAgentBehaviorSettingsSchema, aiAgentResponseSchema, createAiAgentRequestSchema, deleteAiAgentRequestSchema, generateBasePromptRequestSchema, generateBasePromptResponseSchema, getAiAgentRequestSchema, getBehaviorSettingsRequestSchema, getBehaviorSettingsResponseSchema, toggleAiAgentActiveRequestSchema, updateAiAgentRequestSchema, updateBehaviorSettingsRequestSchema, updateBehaviorSettingsResponseSchema };
|
|
531
|
+
export { AI_AGENT_CORE_PROMPT_DOCUMENT_NAMES, AI_AGENT_GOALS, AI_MODELS, aiAgentBehaviorSettingsSchema, aiAgentCorePromptDocumentNameSchema, aiAgentPromptDocumentKindSchema, aiAgentPromptDocumentResponseSchema, aiAgentResponseSchema, aiAgentSkillPromptDocumentNameSchema, createAiAgentRequestSchema, createSkillDocumentRequestSchema, deleteAiAgentRequestSchema, deleteSkillDocumentRequestSchema, generateBasePromptRequestSchema, generateBasePromptResponseSchema, getAiAgentRequestSchema, getBehaviorSettingsRequestSchema, getBehaviorSettingsResponseSchema, listPromptDocumentsRequestSchema, listPromptDocumentsResponseSchema, toggleAiAgentActiveRequestSchema, toggleSkillDocumentRequestSchema, updateAiAgentRequestSchema, updateBehaviorSettingsRequestSchema, updateBehaviorSettingsResponseSchema, updateSkillDocumentRequestSchema, upsertCoreDocumentRequestSchema };
|
|
400
532
|
//# sourceMappingURL=ai-agent.js.map
|
package/api/ai-agent.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ai-agent.js","names":[],"sources":["../../src/api/ai-agent.ts"],"sourcesContent":["import { z } from \"@hono/zod-openapi\";\n\n/**\n * Available AI models from OpenRouter\n */\nexport const AI_MODELS = [\n\t{\n\t\tvalue: \"moonshotai/kimi-k2-0905\",\n\t\tlabel: \"Kimi K2\",\n\t\tprovider: \"Moonshot AI\",\n\t\ticon: \"agent\",\n\t\tfreeOnly: true,\n\t},\n\t{\n\t\tvalue: \"moonshotai/kimi-k2.5\",\n\t\tlabel: \"Kimi K2.5\",\n\t\tprovider: \"Moonshot AI\",\n\t\ticon: \"agent\",\n\t\tfreeOnly: true,\n\t},\n\t{\n\t\tvalue: \"openai/gpt-5.2-chat\",\n\t\tlabel: \"GPT-5.2\",\n\t\tprovider: \"OpenAI\",\n\t\ticon: \"star\",\n\t\trequiresPaid: true,\n\t},\n\t{\n\t\tvalue: \"openai/gpt-5.1-chat\",\n\t\tlabel: \"GPT-5.1\",\n\t\tprovider: \"OpenAI\",\n\t\ticon: \"star\",\n\t\trequiresPaid: true,\n\t},\n\t{\n\t\tvalue: \"openai/gpt-5-mini\",\n\t\tlabel: \"GPT-5 Mini\",\n\t\tprovider: \"OpenAI\",\n\t\ticon: \"star\",\n\t\trequiresPaid: true,\n\t},\n\t{\n\t\tvalue: \"google/gemini-3-flash-preview\",\n\t\tlabel: \"Gemini 3 Flash\",\n\t\tprovider: \"Google\",\n\t\ticon: \"dashboard\",\n\t\trequiresPaid: true,\n\t},\n] as const;\n\nexport type AIModel = (typeof AI_MODELS)[number][\"value\"];\nexport type AIModelConfig = (typeof AI_MODELS)[number];\n\n/**\n * Available AI agent goals/intents\n */\nexport const AI_AGENT_GOALS = [\n\t{ value: \"sales\", label: \"Increase sales conversions\" },\n\t{ value: \"support\", label: \"Provide customer support\" },\n\t{ value: \"product_qa\", label: \"Answer product questions\" },\n\t{ value: \"lead_qualification\", label: \"Qualify leads\" },\n\t{ value: \"scheduling\", label: \"Schedule appointments\" },\n\t{ value: \"feedback\", label: \"Collect customer feedback\" },\n] as const;\n\nexport type AIAgentGoal = (typeof AI_AGENT_GOALS)[number][\"value\"];\n\n/**\n * AI Agent response schema\n */\nexport const aiAgentResponseSchema = z.object({\n\tid: z.ulid().openapi({\n\t\tdescription: \"The AI agent's unique identifier.\",\n\t\texample: \"01JG000000000000000000000\",\n\t}),\n\tname: z.string().openapi({\n\t\tdescription: \"The AI agent's display name.\",\n\t\texample: \"Support Assistant\",\n\t}),\n\tdescription: z.string().nullable().openapi({\n\t\tdescription: \"A brief description of the AI agent's purpose.\",\n\t\texample: \"Helps users with common support questions.\",\n\t}),\n\tbasePrompt: z.string().openapi({\n\t\tdescription: \"The system prompt that defines the AI agent's behavior.\",\n\t\texample: \"You are a helpful support assistant...\",\n\t}),\n\tmodel: z.string().openapi({\n\t\tdescription: \"The OpenRouter model identifier.\",\n\t\texample: \"anthropic/claude-sonnet-4-20250514\",\n\t}),\n\ttemperature: z.number().nullable().openapi({\n\t\tdescription: \"The temperature setting for response generation (0-2).\",\n\t\texample: 0.7,\n\t}),\n\tmaxOutputTokens: z.number().nullable().openapi({\n\t\tdescription: \"Maximum tokens for response generation.\",\n\t\texample: 1024,\n\t}),\n\tisActive: z.boolean().openapi({\n\t\tdescription: \"Whether the AI agent is currently active.\",\n\t\texample: true,\n\t}),\n\tlastUsedAt: z.string().nullable().openapi({\n\t\tdescription: \"When the AI agent was last used.\",\n\t\texample: \"2024-01-01T00:00:00.000Z\",\n\t}),\n\tusageCount: z.number().openapi({\n\t\tdescription: \"Total number of times the AI agent has been used.\",\n\t\texample: 42,\n\t}),\n\tgoals: z\n\t\t.array(z.string())\n\t\t.nullable()\n\t\t.openapi({\n\t\t\tdescription: \"The goals/intents for this AI agent.\",\n\t\t\texample: [\"support\", \"product_qa\"],\n\t\t}),\n\tcreatedAt: z.string().openapi({\n\t\tdescription: \"When the AI agent was created.\",\n\t\texample: \"2024-01-01T00:00:00.000Z\",\n\t}),\n\tupdatedAt: z.string().openapi({\n\t\tdescription: \"When the AI agent was last updated.\",\n\t\texample: \"2024-01-01T00:00:00.000Z\",\n\t}),\n\tonboardingCompletedAt: z.string().nullable().openapi({\n\t\tdescription:\n\t\t\t\"When onboarding was completed. Null if still in onboarding flow.\",\n\t\texample: \"2024-01-01T00:00:00.000Z\",\n\t}),\n});\n\n/**\n * Create AI Agent request schema\n */\nexport const createAiAgentRequestSchema = z\n\t.object({\n\t\twebsiteSlug: z.string().openapi({\n\t\t\tdescription: \"The website slug to create the AI agent for.\",\n\t\t\texample: \"my-website\",\n\t\t}),\n\t\tname: z\n\t\t\t.string()\n\t\t\t.min(1, { message: \"Name is required.\" })\n\t\t\t.max(100, { message: \"Name must be 100 characters or fewer.\" })\n\t\t\t.openapi({\n\t\t\t\tdescription: \"The AI agent's display name.\",\n\t\t\t\texample: \"Support Assistant\",\n\t\t\t}),\n\t\tdescription: z\n\t\t\t.string()\n\t\t\t.max(500, { message: \"Description must be 500 characters or fewer.\" })\n\t\t\t.optional()\n\t\t\t.openapi({\n\t\t\t\tdescription: \"A brief description of the AI agent's purpose.\",\n\t\t\t\texample: \"Helps users with common support questions.\",\n\t\t\t}),\n\t\tbasePrompt: z\n\t\t\t.string()\n\t\t\t.min(1, { message: \"Base prompt is required.\" })\n\t\t\t.max(10_000, {\n\t\t\t\tmessage: \"Base prompt must be 10,000 characters or fewer.\",\n\t\t\t})\n\t\t\t.openapi({\n\t\t\t\tdescription: \"The system prompt that defines the AI agent's behavior.\",\n\t\t\t\texample: \"You are a helpful support assistant...\",\n\t\t\t}),\n\t\tmodel: z.string().min(1, { message: \"Model is required.\" }).openapi({\n\t\t\tdescription: \"The OpenRouter model identifier.\",\n\t\t\texample: \"anthropic/claude-sonnet-4-20250514\",\n\t\t}),\n\t\ttemperature: z\n\t\t\t.number()\n\t\t\t.min(0, { message: \"Temperature must be at least 0.\" })\n\t\t\t.max(2, { message: \"Temperature must be at most 2.\" })\n\t\t\t.optional()\n\t\t\t.openapi({\n\t\t\t\tdescription: \"The temperature setting for response generation (0-2).\",\n\t\t\t\texample: 0.7,\n\t\t\t}),\n\t\tmaxOutputTokens: z\n\t\t\t.number()\n\t\t\t.min(100, { message: \"Max tokens must be at least 100.\" })\n\t\t\t.max(16_000, { message: \"Max tokens must be at most 16,000.\" })\n\t\t\t.optional()\n\t\t\t.openapi({\n\t\t\t\tdescription: \"Maximum tokens for response generation.\",\n\t\t\t\texample: 1024,\n\t\t\t}),\n\t\tgoals: z\n\t\t\t.array(z.string())\n\t\t\t.optional()\n\t\t\t.openapi({\n\t\t\t\tdescription: \"The goals/intents for this AI agent.\",\n\t\t\t\texample: [\"support\", \"product_qa\"],\n\t\t\t}),\n\t})\n\t.openapi({\n\t\tdescription: \"Payload used to create a new AI agent.\",\n\t});\n\n/**\n * Update AI Agent request schema\n */\nexport const updateAiAgentRequestSchema = z\n\t.object({\n\t\twebsiteSlug: z.string().openapi({\n\t\t\tdescription: \"The website slug.\",\n\t\t\texample: \"my-website\",\n\t\t}),\n\t\taiAgentId: z.ulid().openapi({\n\t\t\tdescription: \"The AI agent's unique identifier.\",\n\t\t\texample: \"01JG000000000000000000000\",\n\t\t}),\n\t\tname: z\n\t\t\t.string()\n\t\t\t.min(1, { message: \"Name is required.\" })\n\t\t\t.max(100, { message: \"Name must be 100 characters or fewer.\" })\n\t\t\t.openapi({\n\t\t\t\tdescription: \"The AI agent's display name.\",\n\t\t\t\texample: \"Support Assistant\",\n\t\t\t}),\n\t\tdescription: z\n\t\t\t.string()\n\t\t\t.max(500, { message: \"Description must be 500 characters or fewer.\" })\n\t\t\t.nullable()\n\t\t\t.optional()\n\t\t\t.openapi({\n\t\t\t\tdescription: \"A brief description of the AI agent's purpose.\",\n\t\t\t\texample: \"Helps users with common support questions.\",\n\t\t\t}),\n\t\tbasePrompt: z\n\t\t\t.string()\n\t\t\t.min(1, { message: \"Base prompt is required.\" })\n\t\t\t.max(10_000, {\n\t\t\t\tmessage: \"Base prompt must be 10,000 characters or fewer.\",\n\t\t\t})\n\t\t\t.openapi({\n\t\t\t\tdescription: \"The system prompt that defines the AI agent's behavior.\",\n\t\t\t\texample: \"You are a helpful support assistant...\",\n\t\t\t}),\n\t\tmodel: z.string().min(1, { message: \"Model is required.\" }).openapi({\n\t\t\tdescription: \"The OpenRouter model identifier.\",\n\t\t\texample: \"anthropic/claude-sonnet-4-20250514\",\n\t\t}),\n\t\ttemperature: z\n\t\t\t.number()\n\t\t\t.min(0, { message: \"Temperature must be at least 0.\" })\n\t\t\t.max(2, { message: \"Temperature must be at most 2.\" })\n\t\t\t.nullable()\n\t\t\t.optional()\n\t\t\t.openapi({\n\t\t\t\tdescription: \"The temperature setting for response generation (0-2).\",\n\t\t\t\texample: 0.7,\n\t\t\t}),\n\t\tmaxOutputTokens: z\n\t\t\t.number()\n\t\t\t.min(100, { message: \"Max tokens must be at least 100.\" })\n\t\t\t.max(16_000, { message: \"Max tokens must be at most 16,000.\" })\n\t\t\t.nullable()\n\t\t\t.optional()\n\t\t\t.openapi({\n\t\t\t\tdescription: \"Maximum tokens for response generation.\",\n\t\t\t\texample: 1024,\n\t\t\t}),\n\t\tgoals: z\n\t\t\t.array(z.string())\n\t\t\t.nullable()\n\t\t\t.optional()\n\t\t\t.openapi({\n\t\t\t\tdescription: \"The goals/intents for this AI agent.\",\n\t\t\t\texample: [\"support\", \"product_qa\"],\n\t\t\t}),\n\t\tonboardingCompletedAt: z.string().nullable().optional().openapi({\n\t\t\tdescription:\n\t\t\t\t\"Mark onboarding as complete by setting this timestamp. Set to current ISO timestamp to complete onboarding.\",\n\t\t\texample: \"2024-01-01T00:00:00.000Z\",\n\t\t}),\n\t})\n\t.openapi({\n\t\tdescription: \"Payload used to update an existing AI agent.\",\n\t});\n\n/**\n * Toggle AI Agent active status request schema\n */\nexport const toggleAiAgentActiveRequestSchema = z\n\t.object({\n\t\twebsiteSlug: z.string().openapi({\n\t\t\tdescription: \"The website slug.\",\n\t\t\texample: \"my-website\",\n\t\t}),\n\t\taiAgentId: z.ulid().openapi({\n\t\t\tdescription: \"The AI agent's unique identifier.\",\n\t\t\texample: \"01JG000000000000000000000\",\n\t\t}),\n\t\tisActive: z.boolean().openapi({\n\t\t\tdescription: \"Whether the AI agent should be active.\",\n\t\t\texample: true,\n\t\t}),\n\t})\n\t.openapi({\n\t\tdescription: \"Payload used to toggle an AI agent's active status.\",\n\t});\n\n/**\n * Delete AI Agent request schema\n */\nexport const deleteAiAgentRequestSchema = z\n\t.object({\n\t\twebsiteSlug: z.string().openapi({\n\t\t\tdescription: \"The website slug.\",\n\t\t\texample: \"my-website\",\n\t\t}),\n\t\taiAgentId: z.ulid().openapi({\n\t\t\tdescription: \"The AI agent's unique identifier.\",\n\t\t\texample: \"01JG000000000000000000000\",\n\t\t}),\n\t})\n\t.openapi({\n\t\tdescription: \"Payload used to permanently delete an AI agent.\",\n\t});\n\n/**\n * Get AI Agent request schema\n */\nexport const getAiAgentRequestSchema = z\n\t.object({\n\t\twebsiteSlug: z.string().openapi({\n\t\t\tdescription: \"The website slug.\",\n\t\t\texample: \"my-website\",\n\t\t}),\n\t})\n\t.openapi({\n\t\tdescription: \"Request to get the AI agent for a website.\",\n\t});\n\n/**\n * Generate Base Prompt request schema\n * Used to scrape a website and generate a tailored base prompt for the AI agent\n */\nexport const generateBasePromptRequestSchema = z\n\t.object({\n\t\twebsiteSlug: z.string().openapi({\n\t\t\tdescription: \"The website slug.\",\n\t\t\texample: \"my-website\",\n\t\t}),\n\t\tsourceUrl: z\n\t\t\t.string()\n\t\t\t.url({ message: \"Please enter a valid URL.\" })\n\t\t\t.optional()\n\t\t\t.openapi({\n\t\t\t\tdescription:\n\t\t\t\t\t\"The URL to scrape for content and brand information. Optional - if not provided, manualDescription should be used.\",\n\t\t\t\texample: \"https://example.com\",\n\t\t\t}),\n\t\tagentName: z\n\t\t\t.string()\n\t\t\t.min(1, { message: \"Agent name is required.\" })\n\t\t\t.max(100, { message: \"Agent name must be 100 characters or fewer.\" })\n\t\t\t.openapi({\n\t\t\t\tdescription: \"The name for the AI agent.\",\n\t\t\t\texample: \"Support Assistant\",\n\t\t\t}),\n\t\tgoals: z.array(z.string()).openapi({\n\t\t\tdescription: \"The goals/intents for this AI agent.\",\n\t\t\texample: [\"support\", \"product_qa\"],\n\t\t}),\n\t\tmanualDescription: z\n\t\t\t.string()\n\t\t\t.max(1000, {\n\t\t\t\tmessage: \"Description must be 1000 characters or fewer.\",\n\t\t\t})\n\t\t\t.optional()\n\t\t\t.openapi({\n\t\t\t\tdescription:\n\t\t\t\t\t\"Manual description of the business, used when scraping returns no description or no URL is provided.\",\n\t\t\t\texample: \"We help small businesses manage their inventory efficiently.\",\n\t\t\t}),\n\t})\n\t.openapi({\n\t\tdescription:\n\t\t\t\"Request to generate a base prompt by scraping a website and using AI.\",\n\t});\n\n/**\n * Generate Base Prompt response schema\n */\nexport const generateBasePromptResponseSchema = z\n\t.object({\n\t\tbasePrompt: z.string().openapi({\n\t\t\tdescription: \"The generated base prompt for the AI agent.\",\n\t\t\texample: \"You are a helpful support assistant for Acme Corp...\",\n\t\t}),\n\t\tisGenerated: z.boolean().openapi({\n\t\t\tdescription:\n\t\t\t\t\"Whether the prompt was AI-generated (true) or fell back to default (false).\",\n\t\t\texample: true,\n\t\t}),\n\t\tcompanyName: z.string().nullable().openapi({\n\t\t\tdescription: \"The company name extracted from the website.\",\n\t\t\texample: \"Acme Corp\",\n\t\t}),\n\t\twebsiteDescription: z.string().nullable().openapi({\n\t\t\tdescription: \"The description extracted from the website.\",\n\t\t\texample: \"Acme Corp helps businesses grow with innovative solutions.\",\n\t\t}),\n\t\tlogo: z.string().nullable().openapi({\n\t\t\tdescription: \"The logo URL extracted from the website (og:image).\",\n\t\t\texample: \"https://example.com/logo.png\",\n\t\t}),\n\t\tfavicon: z.string().nullable().openapi({\n\t\t\tdescription: \"The favicon URL extracted from the website.\",\n\t\t\texample: \"https://example.com/favicon.ico\",\n\t\t}),\n\t\tdiscoveredLinksCount: z.number().openapi({\n\t\t\tdescription:\n\t\t\t\t\"Number of pages discovered on the website for future knowledge base training.\",\n\t\t\texample: 47,\n\t\t}),\n\t})\n\t.openapi({\n\t\tdescription:\n\t\t\t\"Response containing the generated base prompt and brand info.\",\n\t});\n\nexport type AiAgentResponse = z.infer<typeof aiAgentResponseSchema>;\nexport type CreateAiAgentRequest = z.infer<typeof createAiAgentRequestSchema>;\nexport type UpdateAiAgentRequest = z.infer<typeof updateAiAgentRequestSchema>;\nexport type ToggleAiAgentActiveRequest = z.infer<\n\ttypeof toggleAiAgentActiveRequestSchema\n>;\nexport type DeleteAiAgentRequest = z.infer<typeof deleteAiAgentRequestSchema>;\nexport type GetAiAgentRequest = z.infer<typeof getAiAgentRequestSchema>;\nexport type GenerateBasePromptRequest = z.infer<\n\ttypeof generateBasePromptRequestSchema\n>;\nexport type GenerateBasePromptResponse = z.infer<\n\ttypeof generateBasePromptResponseSchema\n>;\n\n/**\n * AI Agent Behavior Settings Schema\n *\n * Controls how the AI agent behaves in conversations.\n * Simplified for MVP - AI responds immediately and decides when to respond\n * based on context, not configuration.\n */\nexport const aiAgentBehaviorSettingsSchema = z\n\t.object({\n\t\t// Capability toggles\n\t\tcanResolve: z.boolean().openapi({\n\t\t\tdescription: \"Whether the AI can mark conversations as resolved.\",\n\t\t\texample: true,\n\t\t}),\n\t\tcanMarkSpam: z.boolean().openapi({\n\t\t\tdescription: \"Whether the AI can mark conversations as spam.\",\n\t\t\texample: true,\n\t\t}),\n\t\tcanAssign: z.boolean().openapi({\n\t\t\tdescription: \"Whether the AI can assign conversations to team members.\",\n\t\t\texample: true,\n\t\t}),\n\t\tcanSetPriority: z.boolean().openapi({\n\t\t\tdescription: \"Whether the AI can change conversation priority.\",\n\t\t\texample: true,\n\t\t}),\n\t\tcanCategorize: z.boolean().openapi({\n\t\t\tdescription: \"Whether the AI can add conversations to views.\",\n\t\t\texample: true,\n\t\t}),\n\t\tcanEscalate: z.boolean().openapi({\n\t\t\tdescription: \"Whether the AI can escalate conversations to human agents.\",\n\t\t\texample: true,\n\t\t}),\n\n\t\t// Escalation config\n\t\tdefaultEscalationUserId: z.string().nullable().openapi({\n\t\t\tdescription: \"Default user ID to assign escalated conversations to.\",\n\t\t\texample: null,\n\t\t}),\n\n\t\t// Background analysis\n\t\tautoAnalyzeSentiment: z.boolean().openapi({\n\t\t\tdescription: \"Whether to automatically analyze conversation sentiment.\",\n\t\t\texample: true,\n\t\t}),\n\t\tautoGenerateTitle: z.boolean().openapi({\n\t\t\tdescription: \"Whether to automatically generate conversation titles.\",\n\t\t\texample: true,\n\t\t}),\n\t\tautoCategorize: z.boolean().openapi({\n\t\t\tdescription:\n\t\t\t\t\"Whether to automatically add conversations to matching views.\",\n\t\t\texample: false,\n\t\t}),\n\t})\n\t.openapi({\n\t\tdescription: \"AI agent behavior settings.\",\n\t});\n\nexport type AiAgentBehaviorSettings = z.infer<\n\ttypeof aiAgentBehaviorSettingsSchema\n>;\n\n/**\n * Get Behavior Settings request schema\n */\nexport const getBehaviorSettingsRequestSchema = z\n\t.object({\n\t\twebsiteSlug: z.string().openapi({\n\t\t\tdescription: \"The website slug.\",\n\t\t\texample: \"my-website\",\n\t\t}),\n\t})\n\t.openapi({\n\t\tdescription: \"Request to get behavior settings for an AI agent.\",\n\t});\n\n/**\n * Get Behavior Settings response schema\n */\nexport const getBehaviorSettingsResponseSchema = aiAgentBehaviorSettingsSchema\n\t.extend({\n\t\taiAgentId: z.ulid().openapi({\n\t\t\tdescription: \"The AI agent's unique identifier.\",\n\t\t\texample: \"01JG000000000000000000000\",\n\t\t}),\n\t})\n\t.openapi({\n\t\tdescription: \"Response containing the AI agent's behavior settings.\",\n\t});\n\n/**\n * Update Behavior Settings request schema\n */\nexport const updateBehaviorSettingsRequestSchema = z\n\t.object({\n\t\twebsiteSlug: z.string().openapi({\n\t\t\tdescription: \"The website slug.\",\n\t\t\texample: \"my-website\",\n\t\t}),\n\t\taiAgentId: z.ulid().openapi({\n\t\t\tdescription: \"The AI agent's unique identifier.\",\n\t\t\texample: \"01JG000000000000000000000\",\n\t\t}),\n\t\tsettings: aiAgentBehaviorSettingsSchema.partial().openapi({\n\t\t\tdescription: \"Partial behavior settings to update.\",\n\t\t}),\n\t})\n\t.openapi({\n\t\tdescription: \"Payload used to update an AI agent's behavior settings.\",\n\t}); /**\n * Update Behavior Settings response schema\n */\nexport const updateBehaviorSettingsResponseSchema =\n\taiAgentBehaviorSettingsSchema.openapi({\n\t\tdescription: \"The updated behavior settings.\",\n\t});\n\nexport type GetBehaviorSettingsRequest = z.infer<\n\ttypeof getBehaviorSettingsRequestSchema\n>;\nexport type GetBehaviorSettingsResponse = z.infer<\n\ttypeof getBehaviorSettingsResponseSchema\n>;\nexport type UpdateBehaviorSettingsRequest = z.infer<\n\ttypeof updateBehaviorSettingsRequestSchema\n>;\nexport type UpdateBehaviorSettingsResponse = z.infer<\n\ttypeof updateBehaviorSettingsResponseSchema\n>;\n"],"mappings":";;;;;;AAKA,MAAa,YAAY;CACxB;EACC,OAAO;EACP,OAAO;EACP,UAAU;EACV,MAAM;EACN,UAAU;EACV;CACD;EACC,OAAO;EACP,OAAO;EACP,UAAU;EACV,MAAM;EACN,UAAU;EACV;CACD;EACC,OAAO;EACP,OAAO;EACP,UAAU;EACV,MAAM;EACN,cAAc;EACd;CACD;EACC,OAAO;EACP,OAAO;EACP,UAAU;EACV,MAAM;EACN,cAAc;EACd;CACD;EACC,OAAO;EACP,OAAO;EACP,UAAU;EACV,MAAM;EACN,cAAc;EACd;CACD;EACC,OAAO;EACP,OAAO;EACP,UAAU;EACV,MAAM;EACN,cAAc;EACd;CAC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"}
|
|
1
|
+
{"version":3,"file":"ai-agent.js","names":[],"sources":["../../src/api/ai-agent.ts"],"sourcesContent":["import { z } from \"@hono/zod-openapi\";\n\n/**\n * Available AI models from OpenRouter\n */\nexport const AI_MODELS = [\n\t{\n\t\tvalue: \"moonshotai/kimi-k2-0905\",\n\t\tlabel: \"Kimi K2\",\n\t\tprovider: \"Moonshot AI\",\n\t\ticon: \"agent\",\n\t\tfreeOnly: true,\n\t},\n\t{\n\t\tvalue: \"moonshotai/kimi-k2.5\",\n\t\tlabel: \"Kimi K2.5\",\n\t\tprovider: \"Moonshot AI\",\n\t\ticon: \"agent\",\n\t\tfreeOnly: true,\n\t},\n\t{\n\t\tvalue: \"openai/gpt-5.2-chat\",\n\t\tlabel: \"GPT-5.2\",\n\t\tprovider: \"OpenAI\",\n\t\ticon: \"star\",\n\t\trequiresPaid: true,\n\t},\n\t{\n\t\tvalue: \"openai/gpt-5.1-chat\",\n\t\tlabel: \"GPT-5.1\",\n\t\tprovider: \"OpenAI\",\n\t\ticon: \"star\",\n\t\trequiresPaid: true,\n\t},\n\t{\n\t\tvalue: \"openai/gpt-5-mini\",\n\t\tlabel: \"GPT-5 Mini\",\n\t\tprovider: \"OpenAI\",\n\t\ticon: \"star\",\n\t\trequiresPaid: true,\n\t},\n\t{\n\t\tvalue: \"google/gemini-3-flash-preview\",\n\t\tlabel: \"Gemini 3 Flash\",\n\t\tprovider: \"Google\",\n\t\ticon: \"dashboard\",\n\t\trequiresPaid: true,\n\t},\n] as const;\n\nexport type AIModel = (typeof AI_MODELS)[number][\"value\"];\nexport type AIModelConfig = (typeof AI_MODELS)[number];\n\n/**\n * Available AI agent goals/intents\n */\nexport const AI_AGENT_GOALS = [\n\t{ value: \"sales\", label: \"Increase sales conversions\" },\n\t{ value: \"support\", label: \"Provide customer support\" },\n\t{ value: \"product_qa\", label: \"Answer product questions\" },\n\t{ value: \"lead_qualification\", label: \"Qualify leads\" },\n\t{ value: \"scheduling\", label: \"Schedule appointments\" },\n\t{ value: \"feedback\", label: \"Collect customer feedback\" },\n] as const;\n\nexport type AIAgentGoal = (typeof AI_AGENT_GOALS)[number][\"value\"];\n\nexport const AI_AGENT_CORE_PROMPT_DOCUMENT_NAMES = [\n\t\"agent.md\",\n\t\"security.md\",\n\t\"behaviour.md\",\n\t\"participation.md\",\n\t\"grounding.md\",\n\t\"capabilities.md\",\n] as const;\nexport type AiAgentCorePromptDocumentName =\n\t(typeof AI_AGENT_CORE_PROMPT_DOCUMENT_NAMES)[number];\n\nexport const aiAgentPromptDocumentKindSchema = z.enum([\"core\", \"skill\"]);\nexport const aiAgentCorePromptDocumentNameSchema = z.enum(\n\tAI_AGENT_CORE_PROMPT_DOCUMENT_NAMES\n);\n\nexport const aiAgentSkillPromptDocumentNameSchema = z\n\t.string()\n\t.regex(/^[a-z0-9][a-z0-9-]{1,62}\\.md$/, {\n\t\tmessage: \"Skill name must match ^[a-z0-9][a-z0-9-]{1,62}\\\\.md$\",\n\t})\n\t.refine(\n\t\t(value) => !AI_AGENT_CORE_PROMPT_DOCUMENT_NAMES.includes(value as never),\n\t\t{\n\t\t\tmessage: \"Skill name cannot use reserved core document names.\",\n\t\t}\n\t);\n\nexport const aiAgentPromptDocumentResponseSchema = z.object({\n\tid: z.ulid(),\n\torganizationId: z.ulid(),\n\twebsiteId: z.ulid(),\n\taiAgentId: z.ulid(),\n\tkind: aiAgentPromptDocumentKindSchema,\n\tname: z.string(),\n\tcontent: z.string(),\n\tenabled: z.boolean(),\n\tpriority: z.number().int(),\n\tcreatedByUserId: z.ulid().nullable(),\n\tupdatedByUserId: z.ulid().nullable(),\n\tcreatedAt: z.string(),\n\tupdatedAt: z.string(),\n});\n\n/**\n * AI Agent response schema\n */\nexport const aiAgentResponseSchema = z.object({\n\tid: z.ulid().openapi({\n\t\tdescription: \"The AI agent's unique identifier.\",\n\t\texample: \"01JG000000000000000000000\",\n\t}),\n\tname: z.string().openapi({\n\t\tdescription: \"The AI agent's display name.\",\n\t\texample: \"Support Assistant\",\n\t}),\n\tdescription: z.string().nullable().openapi({\n\t\tdescription: \"A brief description of the AI agent's purpose.\",\n\t\texample: \"Helps users with common support questions.\",\n\t}),\n\tbasePrompt: z.string().openapi({\n\t\tdescription: \"The system prompt that defines the AI agent's behavior.\",\n\t\texample: \"You are a helpful support assistant...\",\n\t}),\n\tmodel: z.string().openapi({\n\t\tdescription: \"The OpenRouter model identifier.\",\n\t\texample: \"anthropic/claude-sonnet-4-20250514\",\n\t}),\n\ttemperature: z.number().nullable().openapi({\n\t\tdescription: \"The temperature setting for response generation (0-2).\",\n\t\texample: 0.7,\n\t}),\n\tmaxOutputTokens: z.number().nullable().openapi({\n\t\tdescription: \"Maximum tokens for response generation.\",\n\t\texample: 1024,\n\t}),\n\tisActive: z.boolean().openapi({\n\t\tdescription: \"Whether the AI agent is currently active.\",\n\t\texample: true,\n\t}),\n\tlastUsedAt: z.string().nullable().openapi({\n\t\tdescription: \"When the AI agent was last used.\",\n\t\texample: \"2024-01-01T00:00:00.000Z\",\n\t}),\n\tusageCount: z.number().openapi({\n\t\tdescription: \"Total number of times the AI agent has been used.\",\n\t\texample: 42,\n\t}),\n\tgoals: z\n\t\t.array(z.string())\n\t\t.nullable()\n\t\t.openapi({\n\t\t\tdescription: \"The goals/intents for this AI agent.\",\n\t\t\texample: [\"support\", \"product_qa\"],\n\t\t}),\n\tcreatedAt: z.string().openapi({\n\t\tdescription: \"When the AI agent was created.\",\n\t\texample: \"2024-01-01T00:00:00.000Z\",\n\t}),\n\tupdatedAt: z.string().openapi({\n\t\tdescription: \"When the AI agent was last updated.\",\n\t\texample: \"2024-01-01T00:00:00.000Z\",\n\t}),\n\tonboardingCompletedAt: z.string().nullable().openapi({\n\t\tdescription:\n\t\t\t\"When onboarding was completed. Null if still in onboarding flow.\",\n\t\texample: \"2024-01-01T00:00:00.000Z\",\n\t}),\n});\n\n/**\n * Create AI Agent request schema\n */\nexport const createAiAgentRequestSchema = z\n\t.object({\n\t\twebsiteSlug: z.string().openapi({\n\t\t\tdescription: \"The website slug to create the AI agent for.\",\n\t\t\texample: \"my-website\",\n\t\t}),\n\t\tname: z\n\t\t\t.string()\n\t\t\t.min(1, { message: \"Name is required.\" })\n\t\t\t.max(100, { message: \"Name must be 100 characters or fewer.\" })\n\t\t\t.openapi({\n\t\t\t\tdescription: \"The AI agent's display name.\",\n\t\t\t\texample: \"Support Assistant\",\n\t\t\t}),\n\t\tdescription: z\n\t\t\t.string()\n\t\t\t.max(500, { message: \"Description must be 500 characters or fewer.\" })\n\t\t\t.optional()\n\t\t\t.openapi({\n\t\t\t\tdescription: \"A brief description of the AI agent's purpose.\",\n\t\t\t\texample: \"Helps users with common support questions.\",\n\t\t\t}),\n\t\tbasePrompt: z\n\t\t\t.string()\n\t\t\t.min(1, { message: \"Base prompt is required.\" })\n\t\t\t.max(10_000, {\n\t\t\t\tmessage: \"Base prompt must be 10,000 characters or fewer.\",\n\t\t\t})\n\t\t\t.openapi({\n\t\t\t\tdescription: \"The system prompt that defines the AI agent's behavior.\",\n\t\t\t\texample: \"You are a helpful support assistant...\",\n\t\t\t}),\n\t\tmodel: z.string().min(1, { message: \"Model is required.\" }).openapi({\n\t\t\tdescription: \"The OpenRouter model identifier.\",\n\t\t\texample: \"anthropic/claude-sonnet-4-20250514\",\n\t\t}),\n\t\ttemperature: z\n\t\t\t.number()\n\t\t\t.min(0, { message: \"Temperature must be at least 0.\" })\n\t\t\t.max(2, { message: \"Temperature must be at most 2.\" })\n\t\t\t.optional()\n\t\t\t.openapi({\n\t\t\t\tdescription: \"The temperature setting for response generation (0-2).\",\n\t\t\t\texample: 0.7,\n\t\t\t}),\n\t\tmaxOutputTokens: z\n\t\t\t.number()\n\t\t\t.min(100, { message: \"Max tokens must be at least 100.\" })\n\t\t\t.max(16_000, { message: \"Max tokens must be at most 16,000.\" })\n\t\t\t.optional()\n\t\t\t.openapi({\n\t\t\t\tdescription: \"Maximum tokens for response generation.\",\n\t\t\t\texample: 1024,\n\t\t\t}),\n\t\tgoals: z\n\t\t\t.array(z.string())\n\t\t\t.optional()\n\t\t\t.openapi({\n\t\t\t\tdescription: \"The goals/intents for this AI agent.\",\n\t\t\t\texample: [\"support\", \"product_qa\"],\n\t\t\t}),\n\t})\n\t.openapi({\n\t\tdescription: \"Payload used to create a new AI agent.\",\n\t});\n\n/**\n * Update AI Agent request schema\n */\nexport const updateAiAgentRequestSchema = z\n\t.object({\n\t\twebsiteSlug: z.string().openapi({\n\t\t\tdescription: \"The website slug.\",\n\t\t\texample: \"my-website\",\n\t\t}),\n\t\taiAgentId: z.ulid().openapi({\n\t\t\tdescription: \"The AI agent's unique identifier.\",\n\t\t\texample: \"01JG000000000000000000000\",\n\t\t}),\n\t\tname: z\n\t\t\t.string()\n\t\t\t.min(1, { message: \"Name is required.\" })\n\t\t\t.max(100, { message: \"Name must be 100 characters or fewer.\" })\n\t\t\t.openapi({\n\t\t\t\tdescription: \"The AI agent's display name.\",\n\t\t\t\texample: \"Support Assistant\",\n\t\t\t}),\n\t\tdescription: z\n\t\t\t.string()\n\t\t\t.max(500, { message: \"Description must be 500 characters or fewer.\" })\n\t\t\t.nullable()\n\t\t\t.optional()\n\t\t\t.openapi({\n\t\t\t\tdescription: \"A brief description of the AI agent's purpose.\",\n\t\t\t\texample: \"Helps users with common support questions.\",\n\t\t\t}),\n\t\tbasePrompt: z\n\t\t\t.string()\n\t\t\t.min(1, { message: \"Base prompt is required.\" })\n\t\t\t.max(10_000, {\n\t\t\t\tmessage: \"Base prompt must be 10,000 characters or fewer.\",\n\t\t\t})\n\t\t\t.openapi({\n\t\t\t\tdescription: \"The system prompt that defines the AI agent's behavior.\",\n\t\t\t\texample: \"You are a helpful support assistant...\",\n\t\t\t}),\n\t\tmodel: z.string().min(1, { message: \"Model is required.\" }).openapi({\n\t\t\tdescription: \"The OpenRouter model identifier.\",\n\t\t\texample: \"anthropic/claude-sonnet-4-20250514\",\n\t\t}),\n\t\ttemperature: z\n\t\t\t.number()\n\t\t\t.min(0, { message: \"Temperature must be at least 0.\" })\n\t\t\t.max(2, { message: \"Temperature must be at most 2.\" })\n\t\t\t.nullable()\n\t\t\t.optional()\n\t\t\t.openapi({\n\t\t\t\tdescription: \"The temperature setting for response generation (0-2).\",\n\t\t\t\texample: 0.7,\n\t\t\t}),\n\t\tmaxOutputTokens: z\n\t\t\t.number()\n\t\t\t.min(100, { message: \"Max tokens must be at least 100.\" })\n\t\t\t.max(16_000, { message: \"Max tokens must be at most 16,000.\" })\n\t\t\t.nullable()\n\t\t\t.optional()\n\t\t\t.openapi({\n\t\t\t\tdescription: \"Maximum tokens for response generation.\",\n\t\t\t\texample: 1024,\n\t\t\t}),\n\t\tgoals: z\n\t\t\t.array(z.string())\n\t\t\t.nullable()\n\t\t\t.optional()\n\t\t\t.openapi({\n\t\t\t\tdescription: \"The goals/intents for this AI agent.\",\n\t\t\t\texample: [\"support\", \"product_qa\"],\n\t\t\t}),\n\t\tonboardingCompletedAt: z.string().nullable().optional().openapi({\n\t\t\tdescription:\n\t\t\t\t\"Mark onboarding as complete by setting this timestamp. Set to current ISO timestamp to complete onboarding.\",\n\t\t\texample: \"2024-01-01T00:00:00.000Z\",\n\t\t}),\n\t})\n\t.openapi({\n\t\tdescription: \"Payload used to update an existing AI agent.\",\n\t});\n\n/**\n * Toggle AI Agent active status request schema\n */\nexport const toggleAiAgentActiveRequestSchema = z\n\t.object({\n\t\twebsiteSlug: z.string().openapi({\n\t\t\tdescription: \"The website slug.\",\n\t\t\texample: \"my-website\",\n\t\t}),\n\t\taiAgentId: z.ulid().openapi({\n\t\t\tdescription: \"The AI agent's unique identifier.\",\n\t\t\texample: \"01JG000000000000000000000\",\n\t\t}),\n\t\tisActive: z.boolean().openapi({\n\t\t\tdescription: \"Whether the AI agent should be active.\",\n\t\t\texample: true,\n\t\t}),\n\t})\n\t.openapi({\n\t\tdescription: \"Payload used to toggle an AI agent's active status.\",\n\t});\n\n/**\n * Delete AI Agent request schema\n */\nexport const deleteAiAgentRequestSchema = z\n\t.object({\n\t\twebsiteSlug: z.string().openapi({\n\t\t\tdescription: \"The website slug.\",\n\t\t\texample: \"my-website\",\n\t\t}),\n\t\taiAgentId: z.ulid().openapi({\n\t\t\tdescription: \"The AI agent's unique identifier.\",\n\t\t\texample: \"01JG000000000000000000000\",\n\t\t}),\n\t})\n\t.openapi({\n\t\tdescription: \"Payload used to permanently delete an AI agent.\",\n\t});\n\n/**\n * Get AI Agent request schema\n */\nexport const getAiAgentRequestSchema = z\n\t.object({\n\t\twebsiteSlug: z.string().openapi({\n\t\t\tdescription: \"The website slug.\",\n\t\t\texample: \"my-website\",\n\t\t}),\n\t})\n\t.openapi({\n\t\tdescription: \"Request to get the AI agent for a website.\",\n\t});\n\n/**\n * Generate Base Prompt request schema\n * Used to scrape a website and generate a tailored base prompt for the AI agent\n */\nexport const generateBasePromptRequestSchema = z\n\t.object({\n\t\twebsiteSlug: z.string().openapi({\n\t\t\tdescription: \"The website slug.\",\n\t\t\texample: \"my-website\",\n\t\t}),\n\t\tsourceUrl: z\n\t\t\t.string()\n\t\t\t.url({ message: \"Please enter a valid URL.\" })\n\t\t\t.optional()\n\t\t\t.openapi({\n\t\t\t\tdescription:\n\t\t\t\t\t\"The URL to scrape for content and brand information. Optional - if not provided, manualDescription should be used.\",\n\t\t\t\texample: \"https://example.com\",\n\t\t\t}),\n\t\tagentName: z\n\t\t\t.string()\n\t\t\t.min(1, { message: \"Agent name is required.\" })\n\t\t\t.max(100, { message: \"Agent name must be 100 characters or fewer.\" })\n\t\t\t.openapi({\n\t\t\t\tdescription: \"The name for the AI agent.\",\n\t\t\t\texample: \"Support Assistant\",\n\t\t\t}),\n\t\tgoals: z.array(z.string()).openapi({\n\t\t\tdescription: \"The goals/intents for this AI agent.\",\n\t\t\texample: [\"support\", \"product_qa\"],\n\t\t}),\n\t\tmanualDescription: z\n\t\t\t.string()\n\t\t\t.max(1000, {\n\t\t\t\tmessage: \"Description must be 1000 characters or fewer.\",\n\t\t\t})\n\t\t\t.optional()\n\t\t\t.openapi({\n\t\t\t\tdescription:\n\t\t\t\t\t\"Manual description of the business, used when scraping returns no description or no URL is provided.\",\n\t\t\t\texample: \"We help small businesses manage their inventory efficiently.\",\n\t\t\t}),\n\t})\n\t.openapi({\n\t\tdescription:\n\t\t\t\"Request to generate a base prompt by scraping a website and using AI.\",\n\t});\n\n/**\n * Generate Base Prompt response schema\n */\nexport const generateBasePromptResponseSchema = z\n\t.object({\n\t\tbasePrompt: z.string().openapi({\n\t\t\tdescription: \"The generated base prompt for the AI agent.\",\n\t\t\texample: \"You are a helpful support assistant for Acme Corp...\",\n\t\t}),\n\t\tisGenerated: z.boolean().openapi({\n\t\t\tdescription:\n\t\t\t\t\"Whether the prompt was AI-generated (true) or fell back to default (false).\",\n\t\t\texample: true,\n\t\t}),\n\t\tcompanyName: z.string().nullable().openapi({\n\t\t\tdescription: \"The company name extracted from the website.\",\n\t\t\texample: \"Acme Corp\",\n\t\t}),\n\t\twebsiteDescription: z.string().nullable().openapi({\n\t\t\tdescription: \"The description extracted from the website.\",\n\t\t\texample: \"Acme Corp helps businesses grow with innovative solutions.\",\n\t\t}),\n\t\tlogo: z.string().nullable().openapi({\n\t\t\tdescription: \"The logo URL extracted from the website (og:image).\",\n\t\t\texample: \"https://example.com/logo.png\",\n\t\t}),\n\t\tfavicon: z.string().nullable().openapi({\n\t\t\tdescription: \"The favicon URL extracted from the website.\",\n\t\t\texample: \"https://example.com/favicon.ico\",\n\t\t}),\n\t\tdiscoveredLinksCount: z.number().openapi({\n\t\t\tdescription:\n\t\t\t\t\"Number of pages discovered on the website for future knowledge base training.\",\n\t\t\texample: 47,\n\t\t}),\n\t})\n\t.openapi({\n\t\tdescription:\n\t\t\t\"Response containing the generated base prompt and brand info.\",\n\t});\n\nexport const listPromptDocumentsRequestSchema = z.object({\n\twebsiteSlug: z.string().openapi({\n\t\tdescription: \"The website slug.\",\n\t\texample: \"my-website\",\n\t}),\n\taiAgentId: z.ulid().openapi({\n\t\tdescription: \"The AI agent ID.\",\n\t\texample: \"01JG000000000000000000000\",\n\t}),\n});\n\nexport const listPromptDocumentsResponseSchema = z.object({\n\tcoreDocuments: z.array(aiAgentPromptDocumentResponseSchema),\n\tskillDocuments: z.array(aiAgentPromptDocumentResponseSchema),\n});\n\nexport const upsertCoreDocumentRequestSchema = z.object({\n\twebsiteSlug: z.string().openapi({\n\t\tdescription: \"The website slug.\",\n\t\texample: \"my-website\",\n\t}),\n\taiAgentId: z.ulid().openapi({\n\t\tdescription: \"The AI agent ID.\",\n\t\texample: \"01JG000000000000000000000\",\n\t}),\n\tname: aiAgentCorePromptDocumentNameSchema,\n\tcontent: z.string().max(50_000).openapi({\n\t\tdescription: \"Markdown content for the core document.\",\n\t\texample: \"## Instructions\\\\nFollow these rules.\",\n\t}),\n\tenabled: z.boolean().optional(),\n\tpriority: z.number().int().min(-100).max(100).optional(),\n});\n\nexport const createSkillDocumentRequestSchema = z.object({\n\twebsiteSlug: z.string().openapi({\n\t\tdescription: \"The website slug.\",\n\t\texample: \"my-website\",\n\t}),\n\taiAgentId: z.ulid().openapi({\n\t\tdescription: \"The AI agent ID.\",\n\t\texample: \"01JG000000000000000000000\",\n\t}),\n\tname: aiAgentSkillPromptDocumentNameSchema,\n\tcontent: z.string().max(50_000).openapi({\n\t\tdescription: \"Markdown content for the skill document.\",\n\t\texample: \"## Workflow\\\\nWhen refund appears, collect order ID first.\",\n\t}),\n\tenabled: z.boolean().optional(),\n\tpriority: z.number().int().min(-100).max(100).optional(),\n});\n\nexport const updateSkillDocumentRequestSchema = z\n\t.object({\n\t\twebsiteSlug: z.string().openapi({\n\t\t\tdescription: \"The website slug.\",\n\t\t\texample: \"my-website\",\n\t\t}),\n\t\taiAgentId: z.ulid().openapi({\n\t\t\tdescription: \"The AI agent ID.\",\n\t\t\texample: \"01JG000000000000000000000\",\n\t\t}),\n\t\tskillDocumentId: z.ulid().openapi({\n\t\t\tdescription: \"The skill prompt document ID.\",\n\t\t\texample: \"01JG000000000000000000000\",\n\t\t}),\n\t\tname: aiAgentSkillPromptDocumentNameSchema.optional(),\n\t\tcontent: z.string().max(50_000).optional(),\n\t\tenabled: z.boolean().optional(),\n\t\tpriority: z.number().int().min(-100).max(100).optional(),\n\t})\n\t.refine(\n\t\t(data) =>\n\t\t\tdata.name !== undefined ||\n\t\t\tdata.content !== undefined ||\n\t\t\tdata.enabled !== undefined ||\n\t\t\tdata.priority !== undefined,\n\t\t{\n\t\t\tmessage: \"At least one field must be provided.\",\n\t\t}\n\t);\n\nexport const deleteSkillDocumentRequestSchema = z.object({\n\twebsiteSlug: z.string().openapi({\n\t\tdescription: \"The website slug.\",\n\t\texample: \"my-website\",\n\t}),\n\taiAgentId: z.ulid().openapi({\n\t\tdescription: \"The AI agent ID.\",\n\t\texample: \"01JG000000000000000000000\",\n\t}),\n\tskillDocumentId: z.ulid().openapi({\n\t\tdescription: \"The skill prompt document ID.\",\n\t\texample: \"01JG000000000000000000000\",\n\t}),\n});\n\nexport const toggleSkillDocumentRequestSchema = z.object({\n\twebsiteSlug: z.string().openapi({\n\t\tdescription: \"The website slug.\",\n\t\texample: \"my-website\",\n\t}),\n\taiAgentId: z.ulid().openapi({\n\t\tdescription: \"The AI agent ID.\",\n\t\texample: \"01JG000000000000000000000\",\n\t}),\n\tskillDocumentId: z.ulid().openapi({\n\t\tdescription: \"The skill prompt document ID.\",\n\t\texample: \"01JG000000000000000000000\",\n\t}),\n\tenabled: z.boolean().openapi({\n\t\tdescription: \"Whether the skill is enabled for runtime selection.\",\n\t\texample: true,\n\t}),\n});\n\nexport type AiAgentResponse = z.infer<typeof aiAgentResponseSchema>;\nexport type CreateAiAgentRequest = z.infer<typeof createAiAgentRequestSchema>;\nexport type UpdateAiAgentRequest = z.infer<typeof updateAiAgentRequestSchema>;\nexport type ToggleAiAgentActiveRequest = z.infer<\n\ttypeof toggleAiAgentActiveRequestSchema\n>;\nexport type DeleteAiAgentRequest = z.infer<typeof deleteAiAgentRequestSchema>;\nexport type GetAiAgentRequest = z.infer<typeof getAiAgentRequestSchema>;\nexport type GenerateBasePromptRequest = z.infer<\n\ttypeof generateBasePromptRequestSchema\n>;\nexport type GenerateBasePromptResponse = z.infer<\n\ttypeof generateBasePromptResponseSchema\n>;\nexport type AiAgentPromptDocumentResponse = z.infer<\n\ttypeof aiAgentPromptDocumentResponseSchema\n>;\nexport type ListPromptDocumentsRequest = z.infer<\n\ttypeof listPromptDocumentsRequestSchema\n>;\nexport type ListPromptDocumentsResponse = z.infer<\n\ttypeof listPromptDocumentsResponseSchema\n>;\nexport type UpsertCoreDocumentRequest = z.infer<\n\ttypeof upsertCoreDocumentRequestSchema\n>;\nexport type CreateSkillDocumentRequest = z.infer<\n\ttypeof createSkillDocumentRequestSchema\n>;\nexport type UpdateSkillDocumentRequest = z.infer<\n\ttypeof updateSkillDocumentRequestSchema\n>;\nexport type DeleteSkillDocumentRequest = z.infer<\n\ttypeof deleteSkillDocumentRequestSchema\n>;\nexport type ToggleSkillDocumentRequest = z.infer<\n\ttypeof toggleSkillDocumentRequestSchema\n>;\n\n/**\n * AI Agent Behavior Settings Schema\n *\n * Controls how the AI agent behaves in conversations.\n * Simplified for MVP - AI responds immediately and decides when to respond\n * based on context, not configuration.\n */\nexport const aiAgentBehaviorSettingsSchema = z\n\t.object({\n\t\t// Capability toggles\n\t\tcanResolve: z.boolean().openapi({\n\t\t\tdescription: \"Whether the AI can mark conversations as resolved.\",\n\t\t\texample: true,\n\t\t}),\n\t\tcanMarkSpam: z.boolean().openapi({\n\t\t\tdescription: \"Whether the AI can mark conversations as spam.\",\n\t\t\texample: true,\n\t\t}),\n\t\tcanAssign: z.boolean().openapi({\n\t\t\tdescription: \"Whether the AI can assign conversations to team members.\",\n\t\t\texample: true,\n\t\t}),\n\t\tcanSetPriority: z.boolean().openapi({\n\t\t\tdescription: \"Whether the AI can change conversation priority.\",\n\t\t\texample: true,\n\t\t}),\n\t\tcanCategorize: z.boolean().openapi({\n\t\t\tdescription: \"Whether the AI can add conversations to views.\",\n\t\t\texample: true,\n\t\t}),\n\t\tcanEscalate: z.boolean().openapi({\n\t\t\tdescription: \"Whether the AI can escalate conversations to human agents.\",\n\t\t\texample: true,\n\t\t}),\n\n\t\t// Escalation config\n\t\tdefaultEscalationUserId: z.string().nullable().openapi({\n\t\t\tdescription: \"Default user ID to assign escalated conversations to.\",\n\t\t\texample: null,\n\t\t}),\n\n\t\t// Visitor identification\n\t\tvisitorContactPolicy: z\n\t\t\t.enum([\"only_if_needed\", \"ask_early\", \"ask_after_time\"])\n\t\t\t.openapi({\n\t\t\t\tdescription:\n\t\t\t\t\t\"How aggressively the AI should ask for visitor contact information.\",\n\t\t\t\texample: \"only_if_needed\",\n\t\t\t}),\n\n\t\t// Background analysis\n\t\tautoAnalyzeSentiment: z.boolean().openapi({\n\t\t\tdescription: \"Whether to automatically analyze conversation sentiment.\",\n\t\t\texample: true,\n\t\t}),\n\t\tautoGenerateTitle: z.boolean().openapi({\n\t\t\tdescription: \"Whether to automatically generate conversation titles.\",\n\t\t\texample: true,\n\t\t}),\n\t\tautoCategorize: z.boolean().openapi({\n\t\t\tdescription:\n\t\t\t\t\"Whether to automatically add conversations to matching views.\",\n\t\t\texample: false,\n\t\t}),\n\t})\n\t.openapi({\n\t\tdescription: \"AI agent behavior settings.\",\n\t});\n\nexport type AiAgentBehaviorSettings = z.infer<\n\ttypeof aiAgentBehaviorSettingsSchema\n>;\n\n/**\n * Get Behavior Settings request schema\n */\nexport const getBehaviorSettingsRequestSchema = z\n\t.object({\n\t\twebsiteSlug: z.string().openapi({\n\t\t\tdescription: \"The website slug.\",\n\t\t\texample: \"my-website\",\n\t\t}),\n\t})\n\t.openapi({\n\t\tdescription: \"Request to get behavior settings for an AI agent.\",\n\t});\n\n/**\n * Get Behavior Settings response schema\n */\nexport const getBehaviorSettingsResponseSchema = aiAgentBehaviorSettingsSchema\n\t.extend({\n\t\taiAgentId: z.ulid().openapi({\n\t\t\tdescription: \"The AI agent's unique identifier.\",\n\t\t\texample: \"01JG000000000000000000000\",\n\t\t}),\n\t})\n\t.openapi({\n\t\tdescription: \"Response containing the AI agent's behavior settings.\",\n\t});\n\n/**\n * Update Behavior Settings request schema\n */\nexport const updateBehaviorSettingsRequestSchema = z\n\t.object({\n\t\twebsiteSlug: z.string().openapi({\n\t\t\tdescription: \"The website slug.\",\n\t\t\texample: \"my-website\",\n\t\t}),\n\t\taiAgentId: z.ulid().openapi({\n\t\t\tdescription: \"The AI agent's unique identifier.\",\n\t\t\texample: \"01JG000000000000000000000\",\n\t\t}),\n\t\tsettings: aiAgentBehaviorSettingsSchema.partial().openapi({\n\t\t\tdescription: \"Partial behavior settings to update.\",\n\t\t}),\n\t})\n\t.openapi({\n\t\tdescription: \"Payload used to update an AI agent's behavior settings.\",\n\t}); /**\n * Update Behavior Settings response schema\n */\nexport const updateBehaviorSettingsResponseSchema =\n\taiAgentBehaviorSettingsSchema.openapi({\n\t\tdescription: \"The updated behavior settings.\",\n\t});\n\nexport type GetBehaviorSettingsRequest = z.infer<\n\ttypeof getBehaviorSettingsRequestSchema\n>;\nexport type GetBehaviorSettingsResponse = z.infer<\n\ttypeof getBehaviorSettingsResponseSchema\n>;\nexport type UpdateBehaviorSettingsRequest = z.infer<\n\ttypeof updateBehaviorSettingsRequestSchema\n>;\nexport type UpdateBehaviorSettingsResponse = z.infer<\n\ttypeof updateBehaviorSettingsResponseSchema\n>;\n"],"mappings":";;;;;;AAKA,MAAa,YAAY;CACxB;EACC,OAAO;EACP,OAAO;EACP,UAAU;EACV,MAAM;EACN,UAAU;EACV;CACD;EACC,OAAO;EACP,OAAO;EACP,UAAU;EACV,MAAM;EACN,UAAU;EACV;CACD;EACC,OAAO;EACP,OAAO;EACP,UAAU;EACV,MAAM;EACN,cAAc;EACd;CACD;EACC,OAAO;EACP,OAAO;EACP,UAAU;EACV,MAAM;EACN,cAAc;EACd;CACD;EACC,OAAO;EACP,OAAO;EACP,UAAU;EACV,MAAM;EACN,cAAc;EACd;CACD;EACC,OAAO;EACP,OAAO;EACP,U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AASH,MAAa,mCAAmC,EAC9C,OAAO,EACP,aAAa,EAAE,QAAQ,CAAC,QAAQ;CAC/B,aAAa;CACb,SAAS;CACT,CAAC,EACF,CAAC,CACD,QAAQ,EACR,aAAa,qDACb,CAAC;;;;AAKH,MAAa,oCAAoC,8BAC/C,OAAO,EACP,WAAW,EAAE,MAAM,CAAC,QAAQ;CAC3B,aAAa;CACb,SAAS;CACT,CAAC,EACF,CAAC,CACD,QAAQ,EACR,aAAa,yDACb,CAAC;;;;AAKH,MAAa,sCAAsC,EACjD,OAAO;CACP,aAAa,EAAE,QAAQ,CAAC,QAAQ;EAC/B,aAAa;EACb,SAAS;EACT,CAAC;CACF,WAAW,EAAE,MAAM,CAAC,QAAQ;EAC3B,aAAa;EACb,SAAS;EACT,CAAC;CACF,UAAU,8BAA8B,SAAS,CAAC,QAAQ,EACzD,aAAa,wCACb,CAAC;CACF,CAAC,CACD,QAAQ,EACR,aAAa,2DACb,CAAC;AAGH,MAAa,uCACZ,8BAA8B,QAAQ,EACrC,aAAa,kCACb,CAAC"}
|
package/api/common.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"common.d.ts","names":[],"sources":["../../src/api/common.ts"],"sourcesContent":[],"mappings":";;;;;;AASA;AAQA;AAQA;AAQA;cAxBa,aAAW,CAAA,CAAA;;;;cAQX,cAAY,CAAA,CAAA;;;AA2BzB;AAKa,cAxBA,oBAyCX,EAzC+B,CAAA,CAAA,WAyC/B,CAzC+B,CAAA,CAAA,OAyC/B,CAAA;;;;cAjCW,kBAAgB,CAAA,CAAA;;EAgBQ,KAAA,cAAA,mBAAA,CAAA,OAAA,CAAA,CAAA;CAAA,eAAA,CAAA;AAmBzB,KAxBA,eAAA,GAAkB,CAAA,CAAE,
|
|
1
|
+
{"version":3,"file":"common.d.ts","names":[],"sources":["../../src/api/common.ts"],"sourcesContent":[],"mappings":";;;;;;AASA;AAQA;AAQA;AAQA;cAxBa,aAAW,CAAA,CAAA;;;;cAQX,cAAY,CAAA,CAAA;;;AA2BzB;AAKa,cAxBA,oBAyCX,EAzC+B,CAAA,CAAA,WAyC/B,CAzC+B,CAAA,CAAA,OAyC/B,CAAA;;;;cAjCW,kBAAgB,CAAA,CAAA;;EAgBQ,KAAA,cAAA,mBAAA,CAAA,OAAA,CAAA,CAAA;CAAA,eAAA,CAAA;AAmBzB,KAxBA,eAAA,GAAkB,CAAA,CAAE,KAwBgB,CAAA,OAxBH,gBAwBG,CAAA;;;;cAnBnC,0BAAwB,CAAA,CAAA;;;;;;KAmBzB,kBAAA,GAAqB,CAAA,CAAE,aAAa"}
|