@hemia-ai/automation-agents 0.0.1 → 0.0.2
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/index.cjs +382 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +124 -0
- package/package.json +10 -7
package/dist/index.cjs
ADDED
|
@@ -0,0 +1,382 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
|
|
20
|
+
// src/index.ts
|
|
21
|
+
var index_exports = {};
|
|
22
|
+
__export(index_exports, {
|
|
23
|
+
AUTOMATION_AGENT_KEYS: () => AUTOMATION_AGENT_KEYS,
|
|
24
|
+
AUTOMATION_TOOL_NAMES: () => AUTOMATION_TOOL_NAMES,
|
|
25
|
+
AgendaAgent: () => AgendaAgent,
|
|
26
|
+
FollowUpSchedulerAgent: () => FollowUpSchedulerAgent,
|
|
27
|
+
NotificationAgent: () => NotificationAgent,
|
|
28
|
+
ReminderAgent: () => ReminderAgent,
|
|
29
|
+
TaskAssignmentAgent: () => TaskAssignmentAgent,
|
|
30
|
+
WorkflowTriggerAgent: () => WorkflowTriggerAgent,
|
|
31
|
+
agendaActionValues: () => agendaActionValues,
|
|
32
|
+
agendaOutputSchema: () => agendaOutputSchema,
|
|
33
|
+
automationAgentDefinitions: () => automationAgentDefinitions,
|
|
34
|
+
automationPriorityValues: () => automationPriorityValues,
|
|
35
|
+
automationStatusValues: () => automationStatusValues,
|
|
36
|
+
automationToolDefinitions: () => automationToolDefinitions,
|
|
37
|
+
followUpSchedulerOutputSchema: () => followUpSchedulerOutputSchema,
|
|
38
|
+
getAutomationAgentDefinitions: () => getAutomationAgentDefinitions,
|
|
39
|
+
notificationOutputSchema: () => notificationOutputSchema,
|
|
40
|
+
registerAutomationAgents: () => registerAutomationAgents,
|
|
41
|
+
registerAutomationTools: () => registerAutomationTools,
|
|
42
|
+
reminderOutputSchema: () => reminderOutputSchema,
|
|
43
|
+
stringArraySchema: () => stringArraySchema,
|
|
44
|
+
taskAssignmentOutputSchema: () => taskAssignmentOutputSchema,
|
|
45
|
+
workflowTriggerOutputSchema: () => workflowTriggerOutputSchema
|
|
46
|
+
});
|
|
47
|
+
module.exports = __toCommonJS(index_exports);
|
|
48
|
+
|
|
49
|
+
// src/tools/tool-names.ts
|
|
50
|
+
var AUTOMATION_TOOL_NAMES = {
|
|
51
|
+
scheduleFollowUp: "automation.schedule_follow_up",
|
|
52
|
+
createReminder: "automation.create_reminder",
|
|
53
|
+
sendNotification: "automation.send_notification",
|
|
54
|
+
triggerWorkflow: "automation.trigger_workflow",
|
|
55
|
+
assignTask: "automation.assign_task",
|
|
56
|
+
createCalendarEvent: "automation.create_calendar_event"
|
|
57
|
+
};
|
|
58
|
+
|
|
59
|
+
// src/types/json-schemas.ts
|
|
60
|
+
var automationPriorityValues = ["low", "normal", "high", "urgent"];
|
|
61
|
+
var automationStatusValues = ["scheduled", "created", "sent", "triggered", "assigned", "cancelled", "failed"];
|
|
62
|
+
var agendaActionValues = ["availability_returned", "proposed_times", "scheduled", "rescheduled", "cancelled"];
|
|
63
|
+
var stringArraySchema = {
|
|
64
|
+
type: "array",
|
|
65
|
+
items: { type: "string" }
|
|
66
|
+
};
|
|
67
|
+
var reminderOutputSchema = {
|
|
68
|
+
type: "object",
|
|
69
|
+
properties: {
|
|
70
|
+
status: { type: "string", enum: [...automationStatusValues] },
|
|
71
|
+
reminderId: { type: "string" },
|
|
72
|
+
title: { type: "string" },
|
|
73
|
+
remindAt: { type: "string" },
|
|
74
|
+
timezone: { type: "string" },
|
|
75
|
+
reason: { type: "string" }
|
|
76
|
+
},
|
|
77
|
+
required: ["status", "title"],
|
|
78
|
+
additionalProperties: false
|
|
79
|
+
};
|
|
80
|
+
var notificationOutputSchema = {
|
|
81
|
+
type: "object",
|
|
82
|
+
properties: {
|
|
83
|
+
status: { type: "string", enum: [...automationStatusValues] },
|
|
84
|
+
notificationId: { type: "string" },
|
|
85
|
+
channel: { type: "string" },
|
|
86
|
+
recipient: { type: "string" },
|
|
87
|
+
message: { type: "string" },
|
|
88
|
+
reason: { type: "string" }
|
|
89
|
+
},
|
|
90
|
+
required: ["status", "channel", "message"],
|
|
91
|
+
additionalProperties: false
|
|
92
|
+
};
|
|
93
|
+
var workflowTriggerOutputSchema = {
|
|
94
|
+
type: "object",
|
|
95
|
+
properties: {
|
|
96
|
+
status: { type: "string", enum: [...automationStatusValues] },
|
|
97
|
+
workflowId: { type: "string" },
|
|
98
|
+
triggerName: { type: "string" },
|
|
99
|
+
reason: { type: "string" },
|
|
100
|
+
payload: { type: "object" }
|
|
101
|
+
},
|
|
102
|
+
required: ["status", "reason"],
|
|
103
|
+
additionalProperties: false
|
|
104
|
+
};
|
|
105
|
+
var taskAssignmentOutputSchema = {
|
|
106
|
+
type: "object",
|
|
107
|
+
properties: {
|
|
108
|
+
status: { type: "string", enum: [...automationStatusValues] },
|
|
109
|
+
taskId: { type: "string" },
|
|
110
|
+
assignee: { type: "string" },
|
|
111
|
+
team: { type: "string" },
|
|
112
|
+
priority: { type: "string", enum: [...automationPriorityValues] },
|
|
113
|
+
sla: { type: "string" },
|
|
114
|
+
queue: { type: "string" }
|
|
115
|
+
},
|
|
116
|
+
required: ["status", "priority"],
|
|
117
|
+
additionalProperties: false
|
|
118
|
+
};
|
|
119
|
+
var followUpSchedulerOutputSchema = {
|
|
120
|
+
type: "object",
|
|
121
|
+
properties: {
|
|
122
|
+
status: { type: "string", enum: [...automationStatusValues] },
|
|
123
|
+
followUpId: { type: "string" },
|
|
124
|
+
sendAfter: { type: "string" },
|
|
125
|
+
retryCount: { type: "number" },
|
|
126
|
+
message: { type: "string" },
|
|
127
|
+
reason: { type: "string" }
|
|
128
|
+
},
|
|
129
|
+
required: ["status"],
|
|
130
|
+
additionalProperties: false
|
|
131
|
+
};
|
|
132
|
+
var agendaOutputSchema = {
|
|
133
|
+
type: "object",
|
|
134
|
+
properties: {
|
|
135
|
+
action: { type: "string", enum: [...agendaActionValues] },
|
|
136
|
+
eventId: { type: "string" },
|
|
137
|
+
proposedTimes: stringArraySchema,
|
|
138
|
+
scheduledAt: { type: "string" },
|
|
139
|
+
timezone: { type: "string" },
|
|
140
|
+
reason: { type: "string" }
|
|
141
|
+
},
|
|
142
|
+
required: ["action", "proposedTimes"],
|
|
143
|
+
additionalProperties: false
|
|
144
|
+
};
|
|
145
|
+
|
|
146
|
+
// src/agents/agent-keys.ts
|
|
147
|
+
var AUTOMATION_AGENT_KEYS = {
|
|
148
|
+
reminder: "automation.reminder",
|
|
149
|
+
notification: "automation.notification",
|
|
150
|
+
workflowTrigger: "automation.workflow_trigger",
|
|
151
|
+
taskAssignment: "automation.task_assignment",
|
|
152
|
+
followUpScheduler: "automation.follow_up_scheduler",
|
|
153
|
+
agenda: "automation.agenda"
|
|
154
|
+
};
|
|
155
|
+
|
|
156
|
+
// src/agents/agent-definitions.ts
|
|
157
|
+
var packMetadata = {
|
|
158
|
+
pack: "@hemia-ai/automation-agents",
|
|
159
|
+
domain: "automation"
|
|
160
|
+
};
|
|
161
|
+
var localeInstruction = "Always respond in the user locale when context.locale is provided. If context.locale is es-MX or starts with es, respond in Spanish.";
|
|
162
|
+
var ReminderAgent = {
|
|
163
|
+
key: AUTOMATION_AGENT_KEYS.reminder,
|
|
164
|
+
name: "Reminder Agent",
|
|
165
|
+
version: "0.1.0",
|
|
166
|
+
description: "Creates reminders for appointments, demos, follow-ups, or tasks.",
|
|
167
|
+
instructions: `${localeInstruction} Create reminder decisions with title, date/time, timezone, assignee, and reason. Ask for missing schedule details when needed.`,
|
|
168
|
+
tools: [AUTOMATION_TOOL_NAMES.createReminder],
|
|
169
|
+
riskLevel: "medium",
|
|
170
|
+
outputSchema: reminderOutputSchema,
|
|
171
|
+
metadata: packMetadata
|
|
172
|
+
};
|
|
173
|
+
var NotificationAgent = {
|
|
174
|
+
key: AUTOMATION_AGENT_KEYS.notification,
|
|
175
|
+
name: "Notification Agent",
|
|
176
|
+
version: "0.1.0",
|
|
177
|
+
description: "Sends notifications by email, WhatsApp, Slack, app, or webhook.",
|
|
178
|
+
instructions: `${localeInstruction} Prepare notifications with channel, recipient, message, and reason. Avoid sending if recipient or channel is unclear.`,
|
|
179
|
+
tools: [AUTOMATION_TOOL_NAMES.sendNotification],
|
|
180
|
+
riskLevel: "medium",
|
|
181
|
+
outputSchema: notificationOutputSchema,
|
|
182
|
+
metadata: packMetadata
|
|
183
|
+
};
|
|
184
|
+
var WorkflowTriggerAgent = {
|
|
185
|
+
key: AUTOMATION_AGENT_KEYS.workflowTrigger,
|
|
186
|
+
name: "Workflow Trigger Agent",
|
|
187
|
+
version: "0.1.0",
|
|
188
|
+
description: "Triggers workflows from intent, state, or event data.",
|
|
189
|
+
instructions: `${localeInstruction} Decide whether a workflow should be triggered from intent, state, event data, or product rules. Include workflow id/name, payload, and reason.`,
|
|
190
|
+
tools: [AUTOMATION_TOOL_NAMES.triggerWorkflow],
|
|
191
|
+
riskLevel: "medium",
|
|
192
|
+
outputSchema: workflowTriggerOutputSchema,
|
|
193
|
+
metadata: packMetadata
|
|
194
|
+
};
|
|
195
|
+
var TaskAssignmentAgent = {
|
|
196
|
+
key: AUTOMATION_AGENT_KEYS.taskAssignment,
|
|
197
|
+
name: "Task Assignment Agent",
|
|
198
|
+
version: "0.1.0",
|
|
199
|
+
description: "Assigns tasks to humans, teams, queues, priorities, and SLAs.",
|
|
200
|
+
instructions: `${localeInstruction} Assign tasks with responsible person or team, priority, SLA, queue, and concise description. Ask for missing assignment details when needed.`,
|
|
201
|
+
tools: [AUTOMATION_TOOL_NAMES.assignTask],
|
|
202
|
+
riskLevel: "medium",
|
|
203
|
+
outputSchema: taskAssignmentOutputSchema,
|
|
204
|
+
metadata: packMetadata
|
|
205
|
+
};
|
|
206
|
+
var FollowUpSchedulerAgent = {
|
|
207
|
+
key: AUTOMATION_AGENT_KEYS.followUpScheduler,
|
|
208
|
+
name: "Follow Up Scheduler Agent",
|
|
209
|
+
version: "0.1.0",
|
|
210
|
+
description: "Schedules automatic follow-ups.",
|
|
211
|
+
instructions: `${localeInstruction} Schedule follow-ups with timing, retry count, and message content. Respect product rules for cooldowns and avoid duplicate follow-ups when context says one exists.`,
|
|
212
|
+
tools: [AUTOMATION_TOOL_NAMES.scheduleFollowUp],
|
|
213
|
+
riskLevel: "medium",
|
|
214
|
+
outputSchema: followUpSchedulerOutputSchema,
|
|
215
|
+
metadata: packMetadata
|
|
216
|
+
};
|
|
217
|
+
var AgendaAgent = {
|
|
218
|
+
key: AUTOMATION_AGENT_KEYS.agenda,
|
|
219
|
+
name: "Agenda Agent",
|
|
220
|
+
version: "0.1.0",
|
|
221
|
+
description: "Helps book, reschedule, or cancel appointments, demos, and calls.",
|
|
222
|
+
instructions: `${localeInstruction} Help with availability, proposed times, scheduling, rescheduling, and cancellation. Ask for missing attendees, timezone, date, or duration when needed.`,
|
|
223
|
+
tools: [AUTOMATION_TOOL_NAMES.createCalendarEvent],
|
|
224
|
+
riskLevel: "medium",
|
|
225
|
+
outputSchema: agendaOutputSchema,
|
|
226
|
+
metadata: packMetadata
|
|
227
|
+
};
|
|
228
|
+
var automationAgentDefinitions = [
|
|
229
|
+
ReminderAgent,
|
|
230
|
+
NotificationAgent,
|
|
231
|
+
WorkflowTriggerAgent,
|
|
232
|
+
TaskAssignmentAgent,
|
|
233
|
+
FollowUpSchedulerAgent,
|
|
234
|
+
AgendaAgent
|
|
235
|
+
];
|
|
236
|
+
|
|
237
|
+
// src/registration/register-automation-agents.ts
|
|
238
|
+
function getAutomationAgentDefinitions(options = {}) {
|
|
239
|
+
if (options.include === void 0) {
|
|
240
|
+
return [...automationAgentDefinitions];
|
|
241
|
+
}
|
|
242
|
+
const included = new Set(options.include);
|
|
243
|
+
return automationAgentDefinitions.filter((agent) => included.has(agent.key));
|
|
244
|
+
}
|
|
245
|
+
function registerAutomationAgents(runtime, options = {}) {
|
|
246
|
+
const definitions = getAutomationAgentDefinitions(options);
|
|
247
|
+
for (const definition of definitions) {
|
|
248
|
+
runtime.registerAgent(definition);
|
|
249
|
+
}
|
|
250
|
+
return definitions;
|
|
251
|
+
}
|
|
252
|
+
|
|
253
|
+
// src/tools/tool-definitions.ts
|
|
254
|
+
var objectSchema = (properties, required = []) => ({
|
|
255
|
+
type: "object",
|
|
256
|
+
properties,
|
|
257
|
+
required,
|
|
258
|
+
additionalProperties: false
|
|
259
|
+
});
|
|
260
|
+
var automationToolDefinitions = [
|
|
261
|
+
{
|
|
262
|
+
name: AUTOMATION_TOOL_NAMES.scheduleFollowUp,
|
|
263
|
+
description: "Schedules an automatic follow-up with timing, retries, and message content.",
|
|
264
|
+
riskLevel: "medium",
|
|
265
|
+
inputSchema: objectSchema({
|
|
266
|
+
conversationId: { type: "string" },
|
|
267
|
+
contactId: { type: "string" },
|
|
268
|
+
sendAfter: { type: "string" },
|
|
269
|
+
retryCount: { type: "number" },
|
|
270
|
+
message: { type: "string" },
|
|
271
|
+
timezone: { type: "string" }
|
|
272
|
+
}, ["sendAfter"]),
|
|
273
|
+
outputSchema: followUpSchedulerOutputSchema,
|
|
274
|
+
metadata: { alias: "scheduleFollowUpTool", pack: "@hemia-ai/automation-agents" }
|
|
275
|
+
},
|
|
276
|
+
{
|
|
277
|
+
name: AUTOMATION_TOOL_NAMES.createReminder,
|
|
278
|
+
description: "Creates a reminder for appointments, demos, follow-ups, or tasks.",
|
|
279
|
+
riskLevel: "medium",
|
|
280
|
+
inputSchema: objectSchema({
|
|
281
|
+
title: { type: "string" },
|
|
282
|
+
remindAt: { type: "string" },
|
|
283
|
+
timezone: { type: "string" },
|
|
284
|
+
assignee: { type: "string" },
|
|
285
|
+
metadata: { type: "object" }
|
|
286
|
+
}, ["title"]),
|
|
287
|
+
outputSchema: reminderOutputSchema,
|
|
288
|
+
metadata: { alias: "createReminderTool", pack: "@hemia-ai/automation-agents" }
|
|
289
|
+
},
|
|
290
|
+
{
|
|
291
|
+
name: AUTOMATION_TOOL_NAMES.sendNotification,
|
|
292
|
+
description: "Sends a notification by email, WhatsApp, Slack, app, or webhook.",
|
|
293
|
+
riskLevel: "medium",
|
|
294
|
+
inputSchema: objectSchema({
|
|
295
|
+
channel: { type: "string", enum: ["email", "whatsapp", "slack", "app", "webhook"] },
|
|
296
|
+
recipient: { type: "string" },
|
|
297
|
+
message: { type: "string" },
|
|
298
|
+
metadata: { type: "object" }
|
|
299
|
+
}, ["channel", "message"]),
|
|
300
|
+
outputSchema: notificationOutputSchema,
|
|
301
|
+
metadata: { alias: "sendNotificationTool", pack: "@hemia-ai/automation-agents" }
|
|
302
|
+
},
|
|
303
|
+
{
|
|
304
|
+
name: AUTOMATION_TOOL_NAMES.triggerWorkflow,
|
|
305
|
+
description: "Triggers a workflow from intent, state, or event data.",
|
|
306
|
+
riskLevel: "medium",
|
|
307
|
+
inputSchema: objectSchema({
|
|
308
|
+
workflowId: { type: "string" },
|
|
309
|
+
triggerName: { type: "string" },
|
|
310
|
+
reason: { type: "string" },
|
|
311
|
+
payload: { type: "object" }
|
|
312
|
+
}, ["reason"]),
|
|
313
|
+
outputSchema: workflowTriggerOutputSchema,
|
|
314
|
+
metadata: { alias: "triggerWorkflowTool", pack: "@hemia-ai/automation-agents" }
|
|
315
|
+
},
|
|
316
|
+
{
|
|
317
|
+
name: AUTOMATION_TOOL_NAMES.assignTask,
|
|
318
|
+
description: "Assigns a task to a person, team, queue, priority, and SLA.",
|
|
319
|
+
riskLevel: "medium",
|
|
320
|
+
inputSchema: objectSchema({
|
|
321
|
+
title: { type: "string" },
|
|
322
|
+
description: { type: "string" },
|
|
323
|
+
assignee: { type: "string" },
|
|
324
|
+
team: { type: "string" },
|
|
325
|
+
priority: { type: "string", enum: [...automationPriorityValues] },
|
|
326
|
+
sla: { type: "string" },
|
|
327
|
+
queue: { type: "string" }
|
|
328
|
+
}, ["title"]),
|
|
329
|
+
outputSchema: taskAssignmentOutputSchema,
|
|
330
|
+
metadata: { alias: "assignTaskTool", pack: "@hemia-ai/automation-agents" }
|
|
331
|
+
},
|
|
332
|
+
{
|
|
333
|
+
name: AUTOMATION_TOOL_NAMES.createCalendarEvent,
|
|
334
|
+
description: "Creates, reschedules, or cancels calendar events.",
|
|
335
|
+
riskLevel: "medium",
|
|
336
|
+
inputSchema: objectSchema({
|
|
337
|
+
title: { type: "string" },
|
|
338
|
+
attendee: { type: "string" },
|
|
339
|
+
startAt: { type: "string" },
|
|
340
|
+
endAt: { type: "string" },
|
|
341
|
+
timezone: { type: "string" },
|
|
342
|
+
action: { type: "string", enum: ["schedule", "reschedule", "cancel"] },
|
|
343
|
+
eventId: { type: "string" }
|
|
344
|
+
}, ["title", "action"]),
|
|
345
|
+
outputSchema: agendaOutputSchema,
|
|
346
|
+
metadata: { alias: "createCalendarEventTool", pack: "@hemia-ai/automation-agents" }
|
|
347
|
+
}
|
|
348
|
+
];
|
|
349
|
+
|
|
350
|
+
// src/tools/register-tools.ts
|
|
351
|
+
function registerAutomationTools(toolRegistry) {
|
|
352
|
+
for (const tool of automationToolDefinitions) {
|
|
353
|
+
toolRegistry.register(tool);
|
|
354
|
+
}
|
|
355
|
+
}
|
|
356
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
357
|
+
0 && (module.exports = {
|
|
358
|
+
AUTOMATION_AGENT_KEYS,
|
|
359
|
+
AUTOMATION_TOOL_NAMES,
|
|
360
|
+
AgendaAgent,
|
|
361
|
+
FollowUpSchedulerAgent,
|
|
362
|
+
NotificationAgent,
|
|
363
|
+
ReminderAgent,
|
|
364
|
+
TaskAssignmentAgent,
|
|
365
|
+
WorkflowTriggerAgent,
|
|
366
|
+
agendaActionValues,
|
|
367
|
+
agendaOutputSchema,
|
|
368
|
+
automationAgentDefinitions,
|
|
369
|
+
automationPriorityValues,
|
|
370
|
+
automationStatusValues,
|
|
371
|
+
automationToolDefinitions,
|
|
372
|
+
followUpSchedulerOutputSchema,
|
|
373
|
+
getAutomationAgentDefinitions,
|
|
374
|
+
notificationOutputSchema,
|
|
375
|
+
registerAutomationAgents,
|
|
376
|
+
registerAutomationTools,
|
|
377
|
+
reminderOutputSchema,
|
|
378
|
+
stringArraySchema,
|
|
379
|
+
taskAssignmentOutputSchema,
|
|
380
|
+
workflowTriggerOutputSchema
|
|
381
|
+
});
|
|
382
|
+
//# sourceMappingURL=index.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/index.ts","../src/tools/tool-names.ts","../src/types/json-schemas.ts","../src/agents/agent-keys.ts","../src/agents/agent-definitions.ts","../src/registration/register-automation-agents.ts","../src/tools/tool-definitions.ts","../src/tools/register-tools.ts"],"sourcesContent":["export * from './agents';\nexport * from './registration';\nexport * from './tools';\nexport * from './types';\n","export const AUTOMATION_TOOL_NAMES = {\n scheduleFollowUp: 'automation.schedule_follow_up',\n createReminder: 'automation.create_reminder',\n sendNotification: 'automation.send_notification',\n triggerWorkflow: 'automation.trigger_workflow',\n assignTask: 'automation.assign_task',\n createCalendarEvent: 'automation.create_calendar_event',\n} as const;\n\nexport type AutomationToolName = (typeof AUTOMATION_TOOL_NAMES)[keyof typeof AUTOMATION_TOOL_NAMES];\n","import type { JsonObject } from '@hemia-ai/agents-core';\n\nexport const automationPriorityValues = ['low', 'normal', 'high', 'urgent'] as const;\nexport const automationStatusValues = ['scheduled', 'created', 'sent', 'triggered', 'assigned', 'cancelled', 'failed'] as const;\nexport const agendaActionValues = ['availability_returned', 'proposed_times', 'scheduled', 'rescheduled', 'cancelled'] as const;\n\nexport const stringArraySchema: JsonObject = {\n type: 'array',\n items: { type: 'string' },\n};\n\nexport const reminderOutputSchema: JsonObject = {\n type: 'object',\n properties: {\n status: { type: 'string', enum: [...automationStatusValues] },\n reminderId: { type: 'string' },\n title: { type: 'string' },\n remindAt: { type: 'string' },\n timezone: { type: 'string' },\n reason: { type: 'string' },\n },\n required: ['status', 'title'],\n additionalProperties: false,\n};\n\nexport const notificationOutputSchema: JsonObject = {\n type: 'object',\n properties: {\n status: { type: 'string', enum: [...automationStatusValues] },\n notificationId: { type: 'string' },\n channel: { type: 'string' },\n recipient: { type: 'string' },\n message: { type: 'string' },\n reason: { type: 'string' },\n },\n required: ['status', 'channel', 'message'],\n additionalProperties: false,\n};\n\nexport const workflowTriggerOutputSchema: JsonObject = {\n type: 'object',\n properties: {\n status: { type: 'string', enum: [...automationStatusValues] },\n workflowId: { type: 'string' },\n triggerName: { type: 'string' },\n reason: { type: 'string' },\n payload: { type: 'object' },\n },\n required: ['status', 'reason'],\n additionalProperties: false,\n};\n\nexport const taskAssignmentOutputSchema: JsonObject = {\n type: 'object',\n properties: {\n status: { type: 'string', enum: [...automationStatusValues] },\n taskId: { type: 'string' },\n assignee: { type: 'string' },\n team: { type: 'string' },\n priority: { type: 'string', enum: [...automationPriorityValues] },\n sla: { type: 'string' },\n queue: { type: 'string' },\n },\n required: ['status', 'priority'],\n additionalProperties: false,\n};\n\nexport const followUpSchedulerOutputSchema: JsonObject = {\n type: 'object',\n properties: {\n status: { type: 'string', enum: [...automationStatusValues] },\n followUpId: { type: 'string' },\n sendAfter: { type: 'string' },\n retryCount: { type: 'number' },\n message: { type: 'string' },\n reason: { type: 'string' },\n },\n required: ['status'],\n additionalProperties: false,\n};\n\nexport const agendaOutputSchema: JsonObject = {\n type: 'object',\n properties: {\n action: { type: 'string', enum: [...agendaActionValues] },\n eventId: { type: 'string' },\n proposedTimes: stringArraySchema,\n scheduledAt: { type: 'string' },\n timezone: { type: 'string' },\n reason: { type: 'string' },\n },\n required: ['action', 'proposedTimes'],\n additionalProperties: false,\n};\n","export const AUTOMATION_AGENT_KEYS = {\n reminder: 'automation.reminder',\n notification: 'automation.notification',\n workflowTrigger: 'automation.workflow_trigger',\n taskAssignment: 'automation.task_assignment',\n followUpScheduler: 'automation.follow_up_scheduler',\n agenda: 'automation.agenda',\n} as const;\n\nexport type AutomationAgentKey = (typeof AUTOMATION_AGENT_KEYS)[keyof typeof AUTOMATION_AGENT_KEYS];\n","import type { AgentDefinition, JsonObject } from '@hemia-ai/agents-core';\nimport { AUTOMATION_TOOL_NAMES } from '../tools/tool-names';\nimport {\n agendaOutputSchema,\n followUpSchedulerOutputSchema,\n notificationOutputSchema,\n reminderOutputSchema,\n taskAssignmentOutputSchema,\n workflowTriggerOutputSchema,\n} from '../types/json-schemas';\nimport { AUTOMATION_AGENT_KEYS } from './agent-keys';\n\nconst packMetadata: JsonObject = {\n pack: '@hemia-ai/automation-agents',\n domain: 'automation',\n};\n\nconst localeInstruction =\n 'Always respond in the user locale when context.locale is provided. If context.locale is es-MX or starts with es, respond in Spanish.';\n\nexport const ReminderAgent: AgentDefinition = {\n key: AUTOMATION_AGENT_KEYS.reminder,\n name: 'Reminder Agent',\n version: '0.1.0',\n description: 'Creates reminders for appointments, demos, follow-ups, or tasks.',\n instructions:\n `${localeInstruction} Create reminder decisions with title, date/time, timezone, assignee, and reason. Ask for missing schedule details when needed.`,\n tools: [AUTOMATION_TOOL_NAMES.createReminder],\n riskLevel: 'medium',\n outputSchema: reminderOutputSchema,\n metadata: packMetadata,\n};\n\nexport const NotificationAgent: AgentDefinition = {\n key: AUTOMATION_AGENT_KEYS.notification,\n name: 'Notification Agent',\n version: '0.1.0',\n description: 'Sends notifications by email, WhatsApp, Slack, app, or webhook.',\n instructions:\n `${localeInstruction} Prepare notifications with channel, recipient, message, and reason. Avoid sending if recipient or channel is unclear.`,\n tools: [AUTOMATION_TOOL_NAMES.sendNotification],\n riskLevel: 'medium',\n outputSchema: notificationOutputSchema,\n metadata: packMetadata,\n};\n\nexport const WorkflowTriggerAgent: AgentDefinition = {\n key: AUTOMATION_AGENT_KEYS.workflowTrigger,\n name: 'Workflow Trigger Agent',\n version: '0.1.0',\n description: 'Triggers workflows from intent, state, or event data.',\n instructions:\n `${localeInstruction} Decide whether a workflow should be triggered from intent, state, event data, or product rules. Include workflow id/name, payload, and reason.`,\n tools: [AUTOMATION_TOOL_NAMES.triggerWorkflow],\n riskLevel: 'medium',\n outputSchema: workflowTriggerOutputSchema,\n metadata: packMetadata,\n};\n\nexport const TaskAssignmentAgent: AgentDefinition = {\n key: AUTOMATION_AGENT_KEYS.taskAssignment,\n name: 'Task Assignment Agent',\n version: '0.1.0',\n description: 'Assigns tasks to humans, teams, queues, priorities, and SLAs.',\n instructions:\n `${localeInstruction} Assign tasks with responsible person or team, priority, SLA, queue, and concise description. Ask for missing assignment details when needed.`,\n tools: [AUTOMATION_TOOL_NAMES.assignTask],\n riskLevel: 'medium',\n outputSchema: taskAssignmentOutputSchema,\n metadata: packMetadata,\n};\n\nexport const FollowUpSchedulerAgent: AgentDefinition = {\n key: AUTOMATION_AGENT_KEYS.followUpScheduler,\n name: 'Follow Up Scheduler Agent',\n version: '0.1.0',\n description: 'Schedules automatic follow-ups.',\n instructions:\n `${localeInstruction} Schedule follow-ups with timing, retry count, and message content. Respect product rules for cooldowns and avoid duplicate follow-ups when context says one exists.`,\n tools: [AUTOMATION_TOOL_NAMES.scheduleFollowUp],\n riskLevel: 'medium',\n outputSchema: followUpSchedulerOutputSchema,\n metadata: packMetadata,\n};\n\nexport const AgendaAgent: AgentDefinition = {\n key: AUTOMATION_AGENT_KEYS.agenda,\n name: 'Agenda Agent',\n version: '0.1.0',\n description: 'Helps book, reschedule, or cancel appointments, demos, and calls.',\n instructions:\n `${localeInstruction} Help with availability, proposed times, scheduling, rescheduling, and cancellation. Ask for missing attendees, timezone, date, or duration when needed.`,\n tools: [AUTOMATION_TOOL_NAMES.createCalendarEvent],\n riskLevel: 'medium',\n outputSchema: agendaOutputSchema,\n metadata: packMetadata,\n};\n\nexport const automationAgentDefinitions: AgentDefinition[] = [\n ReminderAgent,\n NotificationAgent,\n WorkflowTriggerAgent,\n TaskAssignmentAgent,\n FollowUpSchedulerAgent,\n AgendaAgent,\n];\n","import type { AgentDefinition } from '@hemia-ai/agents-core';\nimport type { HemiaAgentRuntime } from '@hemia-ai/agents-runtime';\nimport { automationAgentDefinitions } from '../agents/agent-definitions';\nimport type { AutomationAgentKey } from '../agents/agent-keys';\n\nexport interface RegisterAutomationAgentsOptions {\n include?: AutomationAgentKey[];\n}\n\nexport function getAutomationAgentDefinitions(options: RegisterAutomationAgentsOptions = {}): AgentDefinition[] {\n if (options.include === undefined) {\n return [...automationAgentDefinitions];\n }\n\n const included = new Set<string>(options.include);\n return automationAgentDefinitions.filter((agent) => included.has(agent.key));\n}\n\nexport function registerAutomationAgents(\n runtime: Pick<HemiaAgentRuntime, 'registerAgent'>,\n options: RegisterAutomationAgentsOptions = {},\n): AgentDefinition[] {\n const definitions = getAutomationAgentDefinitions(options);\n\n for (const definition of definitions) {\n runtime.registerAgent(definition);\n }\n\n return definitions;\n}\n","import type { JsonObject, ToolDefinition } from '@hemia-ai/agents-core';\nimport {\n agendaOutputSchema,\n automationPriorityValues,\n followUpSchedulerOutputSchema,\n notificationOutputSchema,\n reminderOutputSchema,\n taskAssignmentOutputSchema,\n workflowTriggerOutputSchema,\n} from '../types/json-schemas';\nimport { AUTOMATION_TOOL_NAMES } from './tool-names';\n\nconst objectSchema = (properties: JsonObject, required: string[] = []): JsonObject => ({\n type: 'object',\n properties,\n required,\n additionalProperties: false,\n});\n\nexport const automationToolDefinitions: ToolDefinition[] = [\n {\n name: AUTOMATION_TOOL_NAMES.scheduleFollowUp,\n description: 'Schedules an automatic follow-up with timing, retries, and message content.',\n riskLevel: 'medium',\n inputSchema: objectSchema({\n conversationId: { type: 'string' },\n contactId: { type: 'string' },\n sendAfter: { type: 'string' },\n retryCount: { type: 'number' },\n message: { type: 'string' },\n timezone: { type: 'string' },\n }, ['sendAfter']),\n outputSchema: followUpSchedulerOutputSchema,\n metadata: { alias: 'scheduleFollowUpTool', pack: '@hemia-ai/automation-agents' },\n },\n {\n name: AUTOMATION_TOOL_NAMES.createReminder,\n description: 'Creates a reminder for appointments, demos, follow-ups, or tasks.',\n riskLevel: 'medium',\n inputSchema: objectSchema({\n title: { type: 'string' },\n remindAt: { type: 'string' },\n timezone: { type: 'string' },\n assignee: { type: 'string' },\n metadata: { type: 'object' },\n }, ['title']),\n outputSchema: reminderOutputSchema,\n metadata: { alias: 'createReminderTool', pack: '@hemia-ai/automation-agents' },\n },\n {\n name: AUTOMATION_TOOL_NAMES.sendNotification,\n description: 'Sends a notification by email, WhatsApp, Slack, app, or webhook.',\n riskLevel: 'medium',\n inputSchema: objectSchema({\n channel: { type: 'string', enum: ['email', 'whatsapp', 'slack', 'app', 'webhook'] },\n recipient: { type: 'string' },\n message: { type: 'string' },\n metadata: { type: 'object' },\n }, ['channel', 'message']),\n outputSchema: notificationOutputSchema,\n metadata: { alias: 'sendNotificationTool', pack: '@hemia-ai/automation-agents' },\n },\n {\n name: AUTOMATION_TOOL_NAMES.triggerWorkflow,\n description: 'Triggers a workflow from intent, state, or event data.',\n riskLevel: 'medium',\n inputSchema: objectSchema({\n workflowId: { type: 'string' },\n triggerName: { type: 'string' },\n reason: { type: 'string' },\n payload: { type: 'object' },\n }, ['reason']),\n outputSchema: workflowTriggerOutputSchema,\n metadata: { alias: 'triggerWorkflowTool', pack: '@hemia-ai/automation-agents' },\n },\n {\n name: AUTOMATION_TOOL_NAMES.assignTask,\n description: 'Assigns a task to a person, team, queue, priority, and SLA.',\n riskLevel: 'medium',\n inputSchema: objectSchema({\n title: { type: 'string' },\n description: { type: 'string' },\n assignee: { type: 'string' },\n team: { type: 'string' },\n priority: { type: 'string', enum: [...automationPriorityValues] },\n sla: { type: 'string' },\n queue: { type: 'string' },\n }, ['title']),\n outputSchema: taskAssignmentOutputSchema,\n metadata: { alias: 'assignTaskTool', pack: '@hemia-ai/automation-agents' },\n },\n {\n name: AUTOMATION_TOOL_NAMES.createCalendarEvent,\n description: 'Creates, reschedules, or cancels calendar events.',\n riskLevel: 'medium',\n inputSchema: objectSchema({\n title: { type: 'string' },\n attendee: { type: 'string' },\n startAt: { type: 'string' },\n endAt: { type: 'string' },\n timezone: { type: 'string' },\n action: { type: 'string', enum: ['schedule', 'reschedule', 'cancel'] },\n eventId: { type: 'string' },\n }, ['title', 'action']),\n outputSchema: agendaOutputSchema,\n metadata: { alias: 'createCalendarEventTool', pack: '@hemia-ai/automation-agents' },\n },\n];\n","import type { ToolRegistry } from '@hemia-ai/agents-tools';\nimport { automationToolDefinitions } from './tool-definitions';\n\nexport function registerAutomationTools(toolRegistry: ToolRegistry): void {\n for (const tool of automationToolDefinitions) {\n toolRegistry.register(tool);\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAO,IAAM,wBAAwB;AAAA,EACnC,kBAAkB;AAAA,EAClB,gBAAgB;AAAA,EAChB,kBAAkB;AAAA,EAClB,iBAAiB;AAAA,EACjB,YAAY;AAAA,EACZ,qBAAqB;AACvB;;;ACLO,IAAM,2BAA2B,CAAC,OAAO,UAAU,QAAQ,QAAQ;AACnE,IAAM,yBAAyB,CAAC,aAAa,WAAW,QAAQ,aAAa,YAAY,aAAa,QAAQ;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AA2B;AAC5C,iBAAa,SAAS,IAAI;AAAA,EAC5B;AACF;","names":[]}
|
package/dist/index.d.cts
ADDED
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
import { AgentDefinition, ToolDefinition, AgentContext, JsonObject } from '@hemia-ai/agents-core';
|
|
2
|
+
import { HemiaAgentRuntime } from '@hemia-ai/agents-runtime';
|
|
3
|
+
import { ToolRegistry } from '@hemia-ai/agents-tools';
|
|
4
|
+
|
|
5
|
+
declare const ReminderAgent: AgentDefinition;
|
|
6
|
+
declare const NotificationAgent: AgentDefinition;
|
|
7
|
+
declare const WorkflowTriggerAgent: AgentDefinition;
|
|
8
|
+
declare const TaskAssignmentAgent: AgentDefinition;
|
|
9
|
+
declare const FollowUpSchedulerAgent: AgentDefinition;
|
|
10
|
+
declare const AgendaAgent: AgentDefinition;
|
|
11
|
+
declare const automationAgentDefinitions: AgentDefinition[];
|
|
12
|
+
|
|
13
|
+
declare const AUTOMATION_AGENT_KEYS: {
|
|
14
|
+
readonly reminder: "automation.reminder";
|
|
15
|
+
readonly notification: "automation.notification";
|
|
16
|
+
readonly workflowTrigger: "automation.workflow_trigger";
|
|
17
|
+
readonly taskAssignment: "automation.task_assignment";
|
|
18
|
+
readonly followUpScheduler: "automation.follow_up_scheduler";
|
|
19
|
+
readonly agenda: "automation.agenda";
|
|
20
|
+
};
|
|
21
|
+
type AutomationAgentKey = (typeof AUTOMATION_AGENT_KEYS)[keyof typeof AUTOMATION_AGENT_KEYS];
|
|
22
|
+
|
|
23
|
+
interface RegisterAutomationAgentsOptions {
|
|
24
|
+
include?: AutomationAgentKey[];
|
|
25
|
+
}
|
|
26
|
+
declare function getAutomationAgentDefinitions(options?: RegisterAutomationAgentsOptions): AgentDefinition[];
|
|
27
|
+
declare function registerAutomationAgents(runtime: Pick<HemiaAgentRuntime, 'registerAgent'>, options?: RegisterAutomationAgentsOptions): AgentDefinition[];
|
|
28
|
+
|
|
29
|
+
declare function registerAutomationTools(toolRegistry: ToolRegistry): void;
|
|
30
|
+
|
|
31
|
+
declare const automationToolDefinitions: ToolDefinition[];
|
|
32
|
+
|
|
33
|
+
declare const AUTOMATION_TOOL_NAMES: {
|
|
34
|
+
readonly scheduleFollowUp: "automation.schedule_follow_up";
|
|
35
|
+
readonly createReminder: "automation.create_reminder";
|
|
36
|
+
readonly sendNotification: "automation.send_notification";
|
|
37
|
+
readonly triggerWorkflow: "automation.trigger_workflow";
|
|
38
|
+
readonly assignTask: "automation.assign_task";
|
|
39
|
+
readonly createCalendarEvent: "automation.create_calendar_event";
|
|
40
|
+
};
|
|
41
|
+
type AutomationToolName = (typeof AUTOMATION_TOOL_NAMES)[keyof typeof AUTOMATION_TOOL_NAMES];
|
|
42
|
+
|
|
43
|
+
type AutomationChannel = 'email' | 'whatsapp' | 'slack' | 'app' | 'webhook' | 'calendar' | 'internal';
|
|
44
|
+
interface AutomationAgentContext extends AgentContext {
|
|
45
|
+
workflowId?: string;
|
|
46
|
+
conversationId?: string;
|
|
47
|
+
contactId?: string;
|
|
48
|
+
channel?: AutomationChannel;
|
|
49
|
+
locale?: string;
|
|
50
|
+
timezone?: string;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
type AutomationPriority = 'low' | 'normal' | 'high' | 'urgent';
|
|
54
|
+
type AutomationStatus = 'scheduled' | 'created' | 'sent' | 'triggered' | 'assigned' | 'cancelled' | 'failed';
|
|
55
|
+
type AgendaAction = 'availability_returned' | 'proposed_times' | 'scheduled' | 'rescheduled' | 'cancelled';
|
|
56
|
+
interface AutomationInput {
|
|
57
|
+
message?: string;
|
|
58
|
+
conversationId?: string;
|
|
59
|
+
contactId?: string;
|
|
60
|
+
workflowId?: string;
|
|
61
|
+
timezone?: string;
|
|
62
|
+
metadata?: Record<string, unknown>;
|
|
63
|
+
}
|
|
64
|
+
interface ReminderOutput {
|
|
65
|
+
status: AutomationStatus;
|
|
66
|
+
reminderId?: string;
|
|
67
|
+
title: string;
|
|
68
|
+
remindAt?: string;
|
|
69
|
+
timezone?: string;
|
|
70
|
+
reason?: string;
|
|
71
|
+
}
|
|
72
|
+
interface NotificationOutput {
|
|
73
|
+
status: AutomationStatus;
|
|
74
|
+
notificationId?: string;
|
|
75
|
+
channel: string;
|
|
76
|
+
recipient?: string;
|
|
77
|
+
message: string;
|
|
78
|
+
reason?: string;
|
|
79
|
+
}
|
|
80
|
+
interface WorkflowTriggerOutput {
|
|
81
|
+
status: AutomationStatus;
|
|
82
|
+
workflowId?: string;
|
|
83
|
+
triggerName?: string;
|
|
84
|
+
reason: string;
|
|
85
|
+
payload?: Record<string, unknown>;
|
|
86
|
+
}
|
|
87
|
+
interface TaskAssignmentOutput {
|
|
88
|
+
status: AutomationStatus;
|
|
89
|
+
taskId?: string;
|
|
90
|
+
assignee?: string;
|
|
91
|
+
team?: string;
|
|
92
|
+
priority: AutomationPriority;
|
|
93
|
+
sla?: string;
|
|
94
|
+
queue?: string;
|
|
95
|
+
}
|
|
96
|
+
interface FollowUpSchedulerOutput {
|
|
97
|
+
status: AutomationStatus;
|
|
98
|
+
followUpId?: string;
|
|
99
|
+
sendAfter?: string;
|
|
100
|
+
retryCount?: number;
|
|
101
|
+
message?: string;
|
|
102
|
+
reason?: string;
|
|
103
|
+
}
|
|
104
|
+
interface AgendaOutput {
|
|
105
|
+
action: AgendaAction;
|
|
106
|
+
eventId?: string;
|
|
107
|
+
proposedTimes: string[];
|
|
108
|
+
scheduledAt?: string;
|
|
109
|
+
timezone?: string;
|
|
110
|
+
reason?: string;
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
declare const automationPriorityValues: readonly ["low", "normal", "high", "urgent"];
|
|
114
|
+
declare const automationStatusValues: readonly ["scheduled", "created", "sent", "triggered", "assigned", "cancelled", "failed"];
|
|
115
|
+
declare const agendaActionValues: readonly ["availability_returned", "proposed_times", "scheduled", "rescheduled", "cancelled"];
|
|
116
|
+
declare const stringArraySchema: JsonObject;
|
|
117
|
+
declare const reminderOutputSchema: JsonObject;
|
|
118
|
+
declare const notificationOutputSchema: JsonObject;
|
|
119
|
+
declare const workflowTriggerOutputSchema: JsonObject;
|
|
120
|
+
declare const taskAssignmentOutputSchema: JsonObject;
|
|
121
|
+
declare const followUpSchedulerOutputSchema: JsonObject;
|
|
122
|
+
declare const agendaOutputSchema: JsonObject;
|
|
123
|
+
|
|
124
|
+
export { AUTOMATION_AGENT_KEYS, AUTOMATION_TOOL_NAMES, type AgendaAction, AgendaAgent, type AgendaOutput, type AutomationAgentContext, type AutomationAgentKey, type AutomationChannel, type AutomationInput, type AutomationPriority, type AutomationStatus, type AutomationToolName, FollowUpSchedulerAgent, type FollowUpSchedulerOutput, NotificationAgent, type NotificationOutput, type RegisterAutomationAgentsOptions, ReminderAgent, type ReminderOutput, TaskAssignmentAgent, type TaskAssignmentOutput, WorkflowTriggerAgent, type WorkflowTriggerOutput, agendaActionValues, agendaOutputSchema, automationAgentDefinitions, automationPriorityValues, automationStatusValues, automationToolDefinitions, followUpSchedulerOutputSchema, getAutomationAgentDefinitions, notificationOutputSchema, registerAutomationAgents, registerAutomationTools, reminderOutputSchema, stringArraySchema, taskAssignmentOutputSchema, workflowTriggerOutputSchema };
|
package/package.json
CHANGED
|
@@ -1,21 +1,24 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hemia-ai/automation-agents",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.2",
|
|
4
4
|
"description": "Automation, reminders, notifications, workflows, tasks, follow-up, and agenda agent definitions for Hemia AI products.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"sideEffects": false,
|
|
7
|
-
"files": [
|
|
7
|
+
"files": [
|
|
8
|
+
"dist"
|
|
9
|
+
],
|
|
8
10
|
"exports": {
|
|
9
11
|
".": {
|
|
10
12
|
"types": "./dist/index.d.ts",
|
|
11
|
-
"import": "./dist/index.js"
|
|
13
|
+
"import": "./dist/index.js",
|
|
14
|
+
"require": "./dist/index.cjs"
|
|
12
15
|
}
|
|
13
16
|
},
|
|
14
17
|
"publishConfig": {
|
|
15
18
|
"access": "public"
|
|
16
19
|
},
|
|
17
20
|
"scripts": {
|
|
18
|
-
"build": "tsup src/index.ts --format esm --dts --sourcemap --clean",
|
|
21
|
+
"build": "tsup src/index.ts --format esm,cjs --dts --sourcemap --clean",
|
|
19
22
|
"clean": "rm -rf dist *.tsbuildinfo",
|
|
20
23
|
"dev": "tsup src/index.ts --format esm --dts --watch",
|
|
21
24
|
"lint": "tsc --noEmit",
|
|
@@ -24,8 +27,8 @@
|
|
|
24
27
|
"prepack": "npm run build"
|
|
25
28
|
},
|
|
26
29
|
"dependencies": {
|
|
27
|
-
"@hemia-ai/agents-core": "^0.0.
|
|
28
|
-
"@hemia-ai/agents-runtime": "^0.0.
|
|
29
|
-
"@hemia-ai/agents-tools": "^0.0.
|
|
30
|
+
"@hemia-ai/agents-core": "^0.0.3",
|
|
31
|
+
"@hemia-ai/agents-runtime": "^0.0.4",
|
|
32
|
+
"@hemia-ai/agents-tools": "^0.0.3"
|
|
30
33
|
}
|
|
31
34
|
}
|