obol-ai 0.3.26 → 0.3.27
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/package.json +1 -1
- package/src/curiosity/dispatch.js +2 -2
- package/src/curiosity/humor.js +2 -2
- package/src/utils/timing.js +10 -4
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "obol-ai",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.27",
|
|
4
4
|
"description": "Self-evolving AI assistant that learns, remembers, and acts on its own. Persistent vector memory, self-rewriting personality, proactive heartbeats.",
|
|
5
5
|
"main": "src/index.js",
|
|
6
6
|
"bin": {
|
|
@@ -50,7 +50,7 @@ async function runCuriosityDispatch(client, selfMemory, users) {
|
|
|
50
50
|
properties: {
|
|
51
51
|
user_id: { type: 'string', description: 'The user ID to share with' },
|
|
52
52
|
hint: { type: 'string', description: 'The insight or finding to share, in your own words' },
|
|
53
|
-
delay: { type: 'string', description: 'When to share it — e.g. "2h", "1d", "
|
|
53
|
+
delay: { type: 'string', description: 'When to share it — e.g. "2h", "1d", "2d", "3d" (max 3 days)' },
|
|
54
54
|
},
|
|
55
55
|
required: ['user_id', 'hint', 'delay'],
|
|
56
56
|
},
|
|
@@ -132,7 +132,7 @@ async function handleTool(name, input, selfMemory, userMap) {
|
|
|
132
132
|
if (!user) return 'User not found';
|
|
133
133
|
if (!user.scheduler) return 'User has no scheduler';
|
|
134
134
|
|
|
135
|
-
const dueAt = resolveDelay(input.delay);
|
|
135
|
+
const dueAt = resolveDelay(input.delay, user.timezone, null, 3 * 86400000);
|
|
136
136
|
const instructions = `You came across something during your own free exploration: "${input.hint}". If it feels relevant and the moment is right, bring it up naturally — like you just thought of it. Keep it casual. Don't reference any system.`;
|
|
137
137
|
|
|
138
138
|
try {
|
package/src/curiosity/humor.js
CHANGED
|
@@ -51,7 +51,7 @@ async function runCuriosityHumor(client, selfMemory, users) {
|
|
|
51
51
|
properties: {
|
|
52
52
|
user_id: { type: 'string', description: 'The user ID to share with' },
|
|
53
53
|
hint: { type: 'string', description: 'The pun, funny connection, or inside joke — just the content itself. Can include a URL if a news article or link is part of what makes it funny.' },
|
|
54
|
-
delay: { type: 'string', description: 'When to drop it — e.g. "2h", "1d", "
|
|
54
|
+
delay: { type: 'string', description: 'When to drop it — e.g. "2h", "1d", "2d", "3d" (max 3 days)' },
|
|
55
55
|
},
|
|
56
56
|
required: ['user_id', 'hint', 'delay'],
|
|
57
57
|
},
|
|
@@ -153,7 +153,7 @@ async function handleTool(name, input, selfMemory, userMap) {
|
|
|
153
153
|
if (!user) return 'User not found';
|
|
154
154
|
if (!user.scheduler) return 'User has no scheduler';
|
|
155
155
|
|
|
156
|
-
const dueAt = resolveDelay(input.delay);
|
|
156
|
+
const dueAt = resolveDelay(input.delay, user.timezone, null, 3 * 86400000);
|
|
157
157
|
const instructions = `You spotted something funny during your own explorations: "${input.hint}". If the moment is right, drop it casually — a pun you just thought of, a funny connection, an inside reference. Don't explain it. Don't say it's a joke. Just let it land.`;
|
|
158
158
|
|
|
159
159
|
try {
|
package/src/utils/timing.js
CHANGED
|
@@ -1,15 +1,21 @@
|
|
|
1
1
|
const DEFAULT_PEAK_HOUR = 20;
|
|
2
2
|
|
|
3
|
-
function resolveDelay(input, timezone, timingData) {
|
|
3
|
+
function resolveDelay(input, timezone, timingData, maxMs) {
|
|
4
4
|
const dt = parseDateTime(input, timezone, timingData);
|
|
5
|
-
if (dt) return dt;
|
|
5
|
+
if (dt) return clamp(dt, maxMs);
|
|
6
6
|
|
|
7
7
|
const legacy = parseLegacy(input);
|
|
8
|
-
if (legacy) return legacy;
|
|
8
|
+
if (legacy) return clamp(legacy, maxMs);
|
|
9
9
|
|
|
10
10
|
const peakHour = extractPeakHour(timingData);
|
|
11
11
|
const now = localNow(timezone);
|
|
12
|
-
return targetPeak(now, peakHour, 1, timezone);
|
|
12
|
+
return clamp(targetPeak(now, peakHour, 1, timezone), maxMs);
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
function clamp(iso, maxMs) {
|
|
16
|
+
if (!maxMs) return iso;
|
|
17
|
+
const ceiling = new Date(Date.now() + maxMs);
|
|
18
|
+
return new Date(iso) > ceiling ? ceiling.toISOString() : iso;
|
|
13
19
|
}
|
|
14
20
|
|
|
15
21
|
function parseDateTime(input, timezone, timingData) {
|