@vellumai/assistant 0.3.24 → 0.3.26
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/__tests__/reminder-store.test.ts +5 -5
- package/src/__tests__/reminder.test.ts +4 -4
- package/src/config/bundled-skills/reminder/TOOLS.json +1 -1
- package/src/memory/schema.ts +1 -1
- package/src/runtime/http-server.ts +7 -0
- package/src/tools/reminder/reminder-store.ts +1 -1
- package/src/tools/reminder/reminder.ts +1 -1
package/package.json
CHANGED
|
@@ -45,7 +45,7 @@ describe('reminder-store', () => {
|
|
|
45
45
|
expect(r.status).toBe('pending');
|
|
46
46
|
expect(r.firedAt).toBeNull();
|
|
47
47
|
expect(r.conversationId).toBeNull();
|
|
48
|
-
expect(r.routingIntent).toBe('
|
|
48
|
+
expect(r.routingIntent).toBe('all_channels');
|
|
49
49
|
expect(r.routingHints).toEqual({});
|
|
50
50
|
expect(r.createdAt).toBeGreaterThan(0);
|
|
51
51
|
expect(r.updatedAt).toBeGreaterThan(0);
|
|
@@ -69,7 +69,7 @@ describe('reminder-store', () => {
|
|
|
69
69
|
expect(fetched!.routingHints).toEqual({ preferred: ['telegram', 'sms'] });
|
|
70
70
|
});
|
|
71
71
|
|
|
72
|
-
test('insertReminder defaults routingIntent to
|
|
72
|
+
test('insertReminder defaults routingIntent to all_channels when omitted', () => {
|
|
73
73
|
const r = insertReminder({
|
|
74
74
|
label: 'No routing',
|
|
75
75
|
message: 'Should default',
|
|
@@ -77,11 +77,11 @@ describe('reminder-store', () => {
|
|
|
77
77
|
mode: 'notify',
|
|
78
78
|
});
|
|
79
79
|
|
|
80
|
-
expect(r.routingIntent).toBe('
|
|
80
|
+
expect(r.routingIntent).toBe('all_channels');
|
|
81
81
|
expect(r.routingHints).toEqual({});
|
|
82
82
|
|
|
83
83
|
const fetched = getReminder(r.id);
|
|
84
|
-
expect(fetched!.routingIntent).toBe('
|
|
84
|
+
expect(fetched!.routingIntent).toBe('all_channels');
|
|
85
85
|
expect(fetched!.routingHints).toEqual({});
|
|
86
86
|
});
|
|
87
87
|
|
|
@@ -113,7 +113,7 @@ describe('reminder-store', () => {
|
|
|
113
113
|
|
|
114
114
|
const all = listReminders();
|
|
115
115
|
expect(all).toHaveLength(2);
|
|
116
|
-
expect(all[0].routingIntent).toBe('
|
|
116
|
+
expect(all[0].routingIntent).toBe('all_channels');
|
|
117
117
|
expect(all[1].routingIntent).toBe('multi_channel');
|
|
118
118
|
});
|
|
119
119
|
|
|
@@ -154,16 +154,16 @@ describe('reminder tool', () => {
|
|
|
154
154
|
|
|
155
155
|
// ── routing ────────────────────────────────────────────────────────
|
|
156
156
|
|
|
157
|
-
test('create defaults routing_intent to
|
|
157
|
+
test('create defaults routing_intent to all_channels', async () => {
|
|
158
158
|
const future = new Date(Date.now() + 60_000).toISOString();
|
|
159
159
|
const result = executeReminderCreate({
|
|
160
160
|
fire_at: future,
|
|
161
161
|
label: 'Default routing',
|
|
162
|
-
message: 'Should default to
|
|
162
|
+
message: 'Should default to all_channels',
|
|
163
163
|
});
|
|
164
164
|
|
|
165
165
|
expect(result.isError).toBe(false);
|
|
166
|
-
expect(result.content).toContain('Routing:
|
|
166
|
+
expect(result.content).toContain('Routing: all_channels');
|
|
167
167
|
});
|
|
168
168
|
|
|
169
169
|
test('create with routing_intent all_channels succeeds', async () => {
|
|
@@ -242,7 +242,7 @@ describe('reminder tool', () => {
|
|
|
242
242
|
|
|
243
243
|
expect(result.isError).toBe(false);
|
|
244
244
|
expect(result.content).toContain('Reminder created');
|
|
245
|
-
expect(result.content).toContain('Routing:
|
|
245
|
+
expect(result.content).toContain('Routing: all_channels');
|
|
246
246
|
});
|
|
247
247
|
|
|
248
248
|
// ── list ────────────────────────────────────────────────────────────
|
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
"routing_intent": {
|
|
30
30
|
"type": "string",
|
|
31
31
|
"enum": ["single_channel", "multi_channel", "all_channels"],
|
|
32
|
-
"description": "How the reminder is routed at trigger time. single_channel
|
|
32
|
+
"description": "How the reminder is routed at trigger time. single_channel delivers to one best channel, multi_channel delivers to a subset, all_channels (default) delivers everywhere."
|
|
33
33
|
},
|
|
34
34
|
"routing_hints": {
|
|
35
35
|
"type": "object",
|
package/src/memory/schema.ts
CHANGED
|
@@ -246,7 +246,7 @@ export const reminders = sqliteTable('reminders', {
|
|
|
246
246
|
status: text('status').notNull(), // 'pending' | 'firing' | 'fired' | 'cancelled'
|
|
247
247
|
firedAt: integer('fired_at'),
|
|
248
248
|
conversationId: text('conversation_id'),
|
|
249
|
-
routingIntent: text('routing_intent').notNull().default('
|
|
249
|
+
routingIntent: text('routing_intent').notNull().default('all_channels'), // 'single_channel' | 'multi_channel' | 'all_channels'
|
|
250
250
|
routingHintsJson: text('routing_hints_json').notNull().default('{}'),
|
|
251
251
|
createdAt: integer('created_at').notNull(),
|
|
252
252
|
updatedAt: integer('updated_at').notNull(),
|
|
@@ -277,6 +277,7 @@ export class RuntimeHttpServer {
|
|
|
277
277
|
this.server = Bun.serve<AllWebSocketData>({
|
|
278
278
|
port: this.port,
|
|
279
279
|
hostname: this.hostname,
|
|
280
|
+
idleTimeout: 0,
|
|
280
281
|
maxRequestBodySize: MAX_REQUEST_BODY_BYTES,
|
|
281
282
|
fetch: (req, server) => this.handleRequest(req, server),
|
|
282
283
|
websocket: {
|
|
@@ -372,6 +373,12 @@ export class RuntimeHttpServer {
|
|
|
372
373
|
}
|
|
373
374
|
|
|
374
375
|
private async handleRequest(req: Request, server: ReturnType<typeof Bun.serve>): Promise<Response> {
|
|
376
|
+
server.timeout(req, 1800);
|
|
377
|
+
// Skip request logging for health-check probes to reduce log noise.
|
|
378
|
+
const url = new URL(req.url);
|
|
379
|
+
if (url.pathname === '/healthz' && req.method === 'GET') {
|
|
380
|
+
return this.routeRequest(req, server);
|
|
381
|
+
}
|
|
375
382
|
return withRequestLogging(req, () => this.routeRequest(req, server));
|
|
376
383
|
}
|
|
377
384
|
|
|
@@ -52,7 +52,7 @@ export function insertReminder(params: {
|
|
|
52
52
|
const db = getDb();
|
|
53
53
|
const id = uuid();
|
|
54
54
|
const now = Date.now();
|
|
55
|
-
const routingIntent = params.routingIntent ?? '
|
|
55
|
+
const routingIntent = params.routingIntent ?? 'all_channels';
|
|
56
56
|
const routingHints = params.routingHints ?? {};
|
|
57
57
|
const row = {
|
|
58
58
|
id,
|
|
@@ -38,7 +38,7 @@ export function executeReminderCreate(input: Record<string, unknown>): ToolExecu
|
|
|
38
38
|
}
|
|
39
39
|
|
|
40
40
|
// Validate routing_intent if provided
|
|
41
|
-
const routingIntent: RoutingIntent = (routingIntentRaw as RoutingIntent) ?? '
|
|
41
|
+
const routingIntent: RoutingIntent = (routingIntentRaw as RoutingIntent) ?? 'all_channels';
|
|
42
42
|
if (routingIntentRaw !== undefined && !VALID_ROUTING_INTENTS.has(routingIntentRaw)) {
|
|
43
43
|
return {
|
|
44
44
|
content: `Error: routing_intent must be one of: single_channel, multi_channel, all_channels`,
|