@stevederico/dotbot 0.19.0 → 0.20.1
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/CHANGELOG.md +12 -0
- package/README.md +3 -2
- package/bin/dotbot.js +8 -2
- package/core/browser-launcher.js +246 -0
- package/core/cdp.js +617 -0
- package/dotbot.db +0 -0
- package/index.js +0 -5
- package/package.json +4 -6
- package/storage/MemoryStore.js +1 -1
- package/storage/SQLiteAdapter.js +36 -1
- package/storage/index.js +2 -7
- package/tools/browser.js +479 -384
- package/storage/MongoAdapter.js +0 -291
- package/storage/MongoCronAdapter.js +0 -347
- package/storage/MongoTaskAdapter.js +0 -242
- package/storage/MongoTriggerAdapter.js +0 -158
package/storage/SQLiteAdapter.js
CHANGED
|
@@ -1,9 +1,44 @@
|
|
|
1
1
|
import crypto from 'crypto';
|
|
2
2
|
import { DatabaseSync } from 'node:sqlite';
|
|
3
3
|
import { SessionStore } from './SessionStore.js';
|
|
4
|
-
import { defaultSystemPrompt } from './MongoAdapter.js';
|
|
5
4
|
import { toStandardFormat } from '../core/normalize.js';
|
|
6
5
|
|
|
6
|
+
/**
|
|
7
|
+
* Default system prompt builder for the agent.
|
|
8
|
+
*
|
|
9
|
+
* @param {Object} options - Prompt options
|
|
10
|
+
* @param {string} options.agentName - Agent display name
|
|
11
|
+
* @param {string} options.agentPersonality - Personality description
|
|
12
|
+
* @returns {string} System prompt
|
|
13
|
+
*/
|
|
14
|
+
export function defaultSystemPrompt({ agentName = 'Dottie', agentPersonality = '' } = {}) {
|
|
15
|
+
const now = new Date().toISOString();
|
|
16
|
+
return `You are a helpful personal AI assistant called ${agentName}.${agentPersonality ? `\nYour personality and tone: ${agentPersonality}. Embody this in all responses.` : ''}
|
|
17
|
+
You have access to tools for searching the web, reading/writing files, fetching URLs, running code, long-term memory, and scheduled tasks.
|
|
18
|
+
The current date and time is ${now}.
|
|
19
|
+
|
|
20
|
+
Use tools when they would help answer the user's question — don't guess when you can look things up.
|
|
21
|
+
Keep responses concise and useful. When you use a tool, explain what you found.
|
|
22
|
+
|
|
23
|
+
Memory guidelines:
|
|
24
|
+
- When the user shares personal info (name, preferences, projects, goals), save it with memory_save.
|
|
25
|
+
- When the user references past conversations or asks "do you remember", search with memory_search.
|
|
26
|
+
- When the user asks to forget something, use memory_search to find the key, then memory_delete to remove it.
|
|
27
|
+
- Be selective — only save things worth recalling in future conversations.
|
|
28
|
+
- Don't announce every memory save unless the user would want to know.
|
|
29
|
+
|
|
30
|
+
Scheduling guidelines:
|
|
31
|
+
- When the user asks for a reminder, periodic check, or recurring job, use schedule_job.
|
|
32
|
+
- Write the prompt as if the user is asking you to do something when the job fires.
|
|
33
|
+
- For recurring jobs, suggest a reasonable interval if the user doesn't specify one.
|
|
34
|
+
|
|
35
|
+
Follow-up suggestions:
|
|
36
|
+
- At the end of every response, suggest one natural follow-up question the user might ask next.
|
|
37
|
+
- Format: <followup>Your suggested question here</followup>
|
|
38
|
+
- Keep it short, specific to the conversation context, and genuinely useful.
|
|
39
|
+
- Do not include the followup tag when using tools or in error responses.`;
|
|
40
|
+
}
|
|
41
|
+
|
|
7
42
|
/**
|
|
8
43
|
* SQLite-backed SessionStore implementation
|
|
9
44
|
*
|
package/storage/index.js
CHANGED
|
@@ -1,19 +1,14 @@
|
|
|
1
1
|
export { SessionStore } from './SessionStore.js';
|
|
2
|
-
export {
|
|
3
|
-
export { SQLiteSessionStore } from './SQLiteAdapter.js';
|
|
2
|
+
export { SQLiteSessionStore, defaultSystemPrompt } from './SQLiteAdapter.js';
|
|
4
3
|
export { MemorySessionStore } from './MemoryStore.js';
|
|
5
4
|
export { CronStore } from './CronStore.js';
|
|
6
|
-
export {
|
|
7
|
-
export { SQLiteCronStore } from './SQLiteCronAdapter.js';
|
|
5
|
+
export { SQLiteCronStore, parseInterval, HEARTBEAT_INTERVAL_MS, HEARTBEAT_PROMPT } from './SQLiteCronAdapter.js';
|
|
8
6
|
export { TaskStore } from './TaskStore.js';
|
|
9
|
-
export { MongoTaskStore } from './MongoTaskAdapter.js';
|
|
10
7
|
export { SQLiteTaskStore } from './SQLiteTaskAdapter.js';
|
|
11
8
|
// Backwards compatibility aliases
|
|
12
9
|
export { TaskStore as GoalStore } from './TaskStore.js';
|
|
13
|
-
export { MongoTaskStore as MongoGoalStore } from './MongoTaskAdapter.js';
|
|
14
10
|
export { SQLiteTaskStore as SQLiteGoalStore } from './SQLiteTaskAdapter.js';
|
|
15
11
|
export { TriggerStore } from './TriggerStore.js';
|
|
16
|
-
export { MongoTriggerStore } from './MongoTriggerAdapter.js';
|
|
17
12
|
export { SQLiteTriggerStore } from './SQLiteTriggerAdapter.js';
|
|
18
13
|
export { SQLiteMemoryStore } from './SQLiteMemoryAdapter.js';
|
|
19
14
|
export { EventStore } from './EventStore.js';
|