@cogitator-ai/core 0.7.0 → 0.8.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -46,7 +46,7 @@ console.log(result.output);
46
46
  - **Type-Safe Tools** - Zod-validated tool definitions
47
47
  - **Streaming Responses** - Real-time token streaming
48
48
  - **Memory Integration** - Redis, PostgreSQL, in-memory adapters
49
- - **20+ Built-in Tools** - Calculator, filesystem, HTTP, regex, and more
49
+ - **26 Built-in Tools** - Web search, SQL, email, GitHub, filesystem, and more
50
50
  - **Reflection Engine** - Self-improvement through tool call analysis
51
51
  - **Tree-of-Thought** - Advanced reasoning with branch exploration
52
52
  - **Agent Optimizer** - DSPy-style learning from traces
@@ -222,6 +222,8 @@ const schemas = registry.getSchemas();
222
222
 
223
223
  ### Built-in Tools
224
224
 
225
+ #### Utility Tools
226
+
225
227
  | Tool | Description |
226
228
  | --------------- | -------------------------------- |
227
229
  | `calculator` | Evaluate math expressions |
@@ -245,6 +247,32 @@ const schemas = registry.getSchemas();
245
247
  | `httpRequest` | Make HTTP requests |
246
248
  | `exec` | Execute shell commands |
247
249
 
250
+ #### Web & Search Tools
251
+
252
+ | Tool | Description |
253
+ | ----------- | -------------------------------------- |
254
+ | `webSearch` | Search the web (Tavily, Brave, Serper) |
255
+ | `webScrape` | Extract content from web pages |
256
+
257
+ #### Database Tools
258
+
259
+ | Tool | Description |
260
+ | -------------- | ------------------------------------------ |
261
+ | `sqlQuery` | Execute SQL queries (PostgreSQL, SQLite) |
262
+ | `vectorSearch` | Semantic search with embeddings (pgvector) |
263
+
264
+ #### Communication Tools
265
+
266
+ | Tool | Description |
267
+ | ----------- | ------------------------------ |
268
+ | `sendEmail` | Send emails (Resend API, SMTP) |
269
+
270
+ #### Development Tools
271
+
272
+ | Tool | Description |
273
+ | ----------- | ------------------------------------------------ |
274
+ | `githubApi` | GitHub API (issues, PRs, files, commits, search) |
275
+
248
276
  ```typescript
249
277
  import { builtinTools, calculator, datetime } from '@cogitator-ai/core';
250
278
 
@@ -256,6 +284,106 @@ const agent = new Agent({
256
284
  });
257
285
  ```
258
286
 
287
+ ### Web Search Tool
288
+
289
+ Search the web using Tavily, Brave, or Serper APIs:
290
+
291
+ ```typescript
292
+ import { webSearch } from '@cogitator-ai/core';
293
+
294
+ // Auto-detects from TAVILY_API_KEY, BRAVE_API_KEY, or SERPER_API_KEY
295
+ const agent = new Agent({
296
+ tools: [webSearch],
297
+ });
298
+
299
+ // Or specify provider explicitly in tool call
300
+ // provider: 'tavily' | 'brave' | 'serper'
301
+ ```
302
+
303
+ ### Web Scrape Tool
304
+
305
+ Extract content from web pages:
306
+
307
+ ```typescript
308
+ import { webScrape } from '@cogitator-ai/core';
309
+
310
+ const agent = new Agent({
311
+ tools: [webScrape],
312
+ });
313
+
314
+ // Supports CSS selectors, text/markdown/html output, link/image extraction
315
+ ```
316
+
317
+ ### SQL Query Tool
318
+
319
+ Execute SQL queries against PostgreSQL or SQLite:
320
+
321
+ ```typescript
322
+ import { sqlQuery } from '@cogitator-ai/core';
323
+
324
+ const agent = new Agent({
325
+ tools: [sqlQuery],
326
+ });
327
+
328
+ // Uses DATABASE_URL env var by default
329
+ // Supports parameterized queries for safety
330
+ // Read-only by default (SELECT, WITH, SHOW, DESCRIBE, EXPLAIN)
331
+ ```
332
+
333
+ **Dependencies:** `pg` for PostgreSQL, `better-sqlite3` for SQLite
334
+
335
+ ### Vector Search Tool
336
+
337
+ Semantic search using embeddings with pgvector:
338
+
339
+ ```typescript
340
+ import { vectorSearch } from '@cogitator-ai/core';
341
+
342
+ const agent = new Agent({
343
+ tools: [vectorSearch],
344
+ });
345
+
346
+ // Embedding providers: OpenAI, Ollama, Google
347
+ // Auto-detects from OPENAI_API_KEY, OLLAMA_BASE_URL, or GOOGLE_API_KEY
348
+ ```
349
+
350
+ **Dependencies:** `pg` with pgvector extension
351
+
352
+ ### Email Tool
353
+
354
+ Send emails via Resend API or SMTP:
355
+
356
+ ```typescript
357
+ import { sendEmail } from '@cogitator-ai/core';
358
+
359
+ const agent = new Agent({
360
+ tools: [sendEmail],
361
+ });
362
+
363
+ // Resend: Set RESEND_API_KEY
364
+ // SMTP: Set SMTP_HOST, SMTP_USER, SMTP_PASS
365
+ // Supports HTML, CC/BCC, reply-to
366
+ ```
367
+
368
+ **Dependencies:** `nodemailer` for SMTP
369
+
370
+ ### GitHub API Tool
371
+
372
+ Interact with GitHub repositories:
373
+
374
+ ```typescript
375
+ import { githubApi } from '@cogitator-ai/core';
376
+
377
+ const agent = new Agent({
378
+ tools: [githubApi],
379
+ });
380
+
381
+ // Set GITHUB_TOKEN env var
382
+ // Actions: get_repo, list_issues, get_issue, create_issue, update_issue,
383
+ // list_prs, get_pr, create_pr, get_file, list_commits,
384
+ // search_code, search_issues
385
+ ```
386
+
259
387
  ---
260
388
 
261
389
  ## Run Options
@@ -0,0 +1,24 @@
1
+ export interface EmailResult {
2
+ success: boolean;
3
+ messageId?: string;
4
+ provider: string;
5
+ to: string[];
6
+ }
7
+ export declare const sendEmail: import("@cogitator-ai/types").Tool<{
8
+ body: string;
9
+ to: string | string[];
10
+ subject: string;
11
+ provider?: "resend" | "smtp" | undefined;
12
+ html?: boolean | undefined;
13
+ from?: string | undefined;
14
+ replyTo?: string | undefined;
15
+ cc?: string | string[] | undefined;
16
+ bcc?: string | string[] | undefined;
17
+ }, EmailResult | {
18
+ error: string;
19
+ provider?: undefined;
20
+ } | {
21
+ error: string;
22
+ provider: "resend" | "smtp";
23
+ }>;
24
+ //# sourceMappingURL=email.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"email.d.ts","sourceRoot":"","sources":["../../src/tools/email.ts"],"names":[],"mappings":"AA0BA,MAAM,WAAW,WAAW;IAC1B,OAAO,EAAE,OAAO,CAAC;IACjB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,MAAM,CAAC;IACjB,EAAE,EAAE,MAAM,EAAE,CAAC;CACd;AAqID,eAAO,MAAM,SAAS;;;;;;;;;;;;;;;;EAyEpB,CAAC"}
@@ -0,0 +1,185 @@
1
+ import { z } from 'zod';
2
+ import { tool } from '../tool';
3
+ const sendEmailParams = z.object({
4
+ to: z
5
+ .union([z.string().email(), z.array(z.string().email())])
6
+ .describe('Recipient email address(es)'),
7
+ subject: z.string().min(1).describe('Email subject'),
8
+ body: z.string().min(1).describe('Email body (plain text or HTML)'),
9
+ html: z.boolean().optional().describe('Treat body as HTML (default: false)'),
10
+ from: z.string().email().optional().describe('Sender email (defaults to configured sender)'),
11
+ replyTo: z.string().email().optional().describe('Reply-to email address'),
12
+ cc: z
13
+ .union([z.string().email(), z.array(z.string().email())])
14
+ .optional()
15
+ .describe('CC recipients'),
16
+ bcc: z
17
+ .union([z.string().email(), z.array(z.string().email())])
18
+ .optional()
19
+ .describe('BCC recipients'),
20
+ provider: z
21
+ .enum(['resend', 'smtp'])
22
+ .optional()
23
+ .describe('Email provider (auto-detects from available credentials)'),
24
+ });
25
+ function toArray(value) {
26
+ if (!value)
27
+ return [];
28
+ return Array.isArray(value) ? value : [value];
29
+ }
30
+ async function sendViaResend(params) {
31
+ const { to, subject, body, html, from, replyTo, cc, bcc, apiKey } = params;
32
+ const payload = {
33
+ from: from ?? process.env.RESEND_FROM_EMAIL ?? 'onboarding@resend.dev',
34
+ to,
35
+ subject,
36
+ };
37
+ if (html) {
38
+ payload.html = body;
39
+ }
40
+ else {
41
+ payload.text = body;
42
+ }
43
+ if (replyTo)
44
+ payload.reply_to = replyTo;
45
+ if (cc && cc.length > 0)
46
+ payload.cc = cc;
47
+ if (bcc && bcc.length > 0)
48
+ payload.bcc = bcc;
49
+ const response = await fetch('https://api.resend.com/emails', {
50
+ method: 'POST',
51
+ headers: {
52
+ 'Content-Type': 'application/json',
53
+ Authorization: `Bearer ${apiKey}`,
54
+ },
55
+ body: JSON.stringify(payload),
56
+ });
57
+ if (!response.ok) {
58
+ const error = await response.text();
59
+ throw new Error(`Resend API error: ${response.status} ${error}`);
60
+ }
61
+ const data = (await response.json());
62
+ return {
63
+ success: true,
64
+ messageId: data.id,
65
+ provider: 'resend',
66
+ to,
67
+ };
68
+ }
69
+ async function sendViaSMTP(params) {
70
+ let nodemailer;
71
+ try {
72
+ nodemailer = await import('nodemailer');
73
+ }
74
+ catch {
75
+ throw new Error('nodemailer package not installed. Run: pnpm add nodemailer');
76
+ }
77
+ const { to, subject, body, html, from, replyTo, cc, bcc } = params;
78
+ const smtpHost = process.env.SMTP_HOST;
79
+ const smtpPort = process.env.SMTP_PORT;
80
+ const smtpUser = process.env.SMTP_USER;
81
+ const smtpPass = process.env.SMTP_PASS;
82
+ if (!smtpHost || !smtpUser || !smtpPass) {
83
+ throw new Error('SMTP credentials not configured. Set SMTP_HOST, SMTP_USER, SMTP_PASS environment variables.');
84
+ }
85
+ const transporter = nodemailer.createTransport({
86
+ host: smtpHost,
87
+ port: smtpPort ? parseInt(smtpPort, 10) : 587,
88
+ secure: smtpPort === '465',
89
+ auth: {
90
+ user: smtpUser,
91
+ pass: smtpPass,
92
+ },
93
+ });
94
+ const mailOptions = {
95
+ from: from ?? process.env.SMTP_FROM ?? smtpUser,
96
+ to: to.join(', '),
97
+ subject,
98
+ };
99
+ if (html) {
100
+ mailOptions.html = body;
101
+ }
102
+ else {
103
+ mailOptions.text = body;
104
+ }
105
+ if (replyTo)
106
+ mailOptions.replyTo = replyTo;
107
+ if (cc && cc.length > 0)
108
+ mailOptions.cc = cc.join(', ');
109
+ if (bcc && bcc.length > 0)
110
+ mailOptions.bcc = bcc.join(', ');
111
+ const result = await transporter.sendMail(mailOptions);
112
+ return {
113
+ success: true,
114
+ messageId: result.messageId,
115
+ provider: 'smtp',
116
+ to,
117
+ };
118
+ }
119
+ function detectProvider() {
120
+ if (process.env.RESEND_API_KEY)
121
+ return 'resend';
122
+ if (process.env.SMTP_HOST && process.env.SMTP_USER)
123
+ return 'smtp';
124
+ return null;
125
+ }
126
+ export const sendEmail = tool({
127
+ name: 'send_email',
128
+ description: 'Send an email using Resend API or SMTP. Supports plain text and HTML, CC/BCC, and reply-to. Requires RESEND_API_KEY or SMTP_* environment variables.',
129
+ parameters: sendEmailParams,
130
+ category: 'communication',
131
+ tags: ['email', 'send', 'notification', 'communication'],
132
+ sideEffects: ['network', 'external'],
133
+ execute: async ({ to, subject, body, html = false, from, replyTo, cc, bcc, provider: requestedProvider, }) => {
134
+ const toArray_ = toArray(to);
135
+ const ccArray = toArray(cc);
136
+ const bccArray = toArray(bcc);
137
+ if (toArray_.length === 0) {
138
+ return { error: 'At least one recipient required' };
139
+ }
140
+ const provider = requestedProvider ?? detectProvider();
141
+ if (!provider) {
142
+ return {
143
+ error: 'No email provider configured. Set RESEND_API_KEY or SMTP_* environment variables.',
144
+ };
145
+ }
146
+ try {
147
+ switch (provider) {
148
+ case 'resend': {
149
+ const apiKey = process.env.RESEND_API_KEY;
150
+ if (!apiKey) {
151
+ return { error: 'RESEND_API_KEY not set' };
152
+ }
153
+ return await sendViaResend({
154
+ to: toArray_,
155
+ subject,
156
+ body,
157
+ html,
158
+ from,
159
+ replyTo,
160
+ cc: ccArray,
161
+ bcc: bccArray,
162
+ apiKey,
163
+ });
164
+ }
165
+ case 'smtp':
166
+ return await sendViaSMTP({
167
+ to: toArray_,
168
+ subject,
169
+ body,
170
+ html,
171
+ from,
172
+ replyTo,
173
+ cc: ccArray,
174
+ bcc: bccArray,
175
+ });
176
+ default:
177
+ return { error: `Unknown provider: ${provider}` };
178
+ }
179
+ }
180
+ catch (err) {
181
+ return { error: err.message, provider };
182
+ }
183
+ },
184
+ });
185
+ //# sourceMappingURL=email.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"email.js","sourceRoot":"","sources":["../../src/tools/email.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,IAAI,EAAE,MAAM,SAAS,CAAC;AAE/B,MAAM,eAAe,GAAG,CAAC,CAAC,MAAM,CAAC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EAAE,wBAAwB,EAAE,CAAC;oBAC7C,CAAC;oBACD,OAAO,MAAM,aAAa,CAAC;wBACzB,EAAE,EAAE,QAAQ;wBACZ,OAAO;wBACP,IAAI;wBACJ,IAAI;wBACJ,IAAI;wBACJ,OAAO;wBACP,EAAE,EAAE,OAAO;wBACX,GAAG,EAAE,QAAQ;wBACb,MAAM;qBACP,CAAC,CAAC;gBACL,CAAC;gBAED,KAAK,MAAM;oBACT,OAAO,MAAM,WAAW,CAAC;wBACvB,EAAE,EAAE,QAAQ;wBACZ,OAAO;wBACP,IAAI;wBACJ,IAAI;wBACJ,IAAI;wBACJ,OAAO;wBACP,EAAE,EAAE,OAAO;wBACX,GAAG,EAAE,QAAQ;qBACd,CAAC,CAAC;gBAEL;oBACE,OAAO,EAAE,KAAK,EAAE,qBAAqB,QAAkB,EAAE,EAAE,CAAC;YAChE,CAAC;QACH,CAAC;QAAC,OAAO,GAAG,EAAE,CAAC;YACb,OAAO,EAAE,KAAK,EAAG,GAAa,CAAC,OAAO,EAAE,QAAQ,EAAE,CAAC;QACrD,CAAC;IACH,CAAC;CACF,CAAC,CAAC"}
@@ -0,0 +1,19 @@
1
+ export declare const githubApi: import("@cogitator-ai/types").Tool<{
2
+ action: "get_repo" | "list_issues" | "get_issue" | "create_issue" | "update_issue" | "list_prs" | "get_pr" | "create_pr" | "get_file" | "list_commits" | "search_code" | "search_issues";
3
+ owner: string;
4
+ repo: string;
5
+ number?: number | undefined;
6
+ path?: string | undefined;
7
+ query?: string | undefined;
8
+ body?: string | undefined;
9
+ title?: string | undefined;
10
+ state?: "open" | "closed" | "all" | undefined;
11
+ labels?: string[] | undefined;
12
+ assignees?: string[] | undefined;
13
+ ref?: string | undefined;
14
+ base?: string | undefined;
15
+ head?: string | undefined;
16
+ perPage?: number | undefined;
17
+ page?: number | undefined;
18
+ }, unknown>;
19
+ //# sourceMappingURL=github.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"github.d.ts","sourceRoot":"","sources":["../../src/tools/github.ts"],"names":[],"mappings":"AAwXA,eAAO,MAAM,SAAS;;;;;;;;;;;;;;;;;WAoBpB,CAAC"}