sync: temporal-awareness from private repo

- Surface created_at, updated_at, event_date in queryNodes + queryDimensionNodes responses
- Add date range filters (createdAfter/Before, eventAfter/Before) to NodeFilters + nodeService.getNodes()

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
“BeeRad”
2026-02-15 14:34:55 +11:00
co-authored by Claude Opus 4.6
parent 0095641278
commit 9954792b1d
4 changed files with 54 additions and 14 deletions
+4 -1
View File
@@ -5,7 +5,7 @@ import { formatNodeForChat } from '../infrastructure/nodeFormatter';
import type { Node } from '@/types/database';
export const queryDimensionNodesTool = tool({
description: 'Query all nodes within a specific dimension. Returns nodes sorted by edge count (most connected first).',
description: 'Get nodes in a dimension, sorted by connection count.',
inputSchema: z.object({
dimension: z.string().describe('The dimension name to query nodes from'),
limit: z.number().optional().default(20).describe('Maximum number of nodes to return (default: 20)'),
@@ -43,6 +43,9 @@ export const queryDimensionNodesTool = tool({
}),
edgeCount: node.edge_count || 0,
dimensions: node.dimensions || [],
created_at: node.created_at,
updated_at: node.updated_at,
event_date: node.event_date ?? null,
};
if (includeContent && node.notes) {
+16 -2
View File
@@ -10,7 +10,11 @@ export const queryNodesTool = tool({
filters: z.object({
dimensions: z.array(z.string()).describe('Filter by dimensions (e.g., ["research", "ai", "technology"]). Replaces old type/stage filtering.').optional(),
search: z.string().describe('Search term to match against title or notes').optional(),
limit: z.number().min(1).max(50).default(10).describe('Maximum number of results to return')
limit: z.number().min(1).max(50).default(10).describe('Maximum number of results to return'),
createdAfter: z.string().optional().describe('ISO date (YYYY-MM-DD). Only return nodes created on or after this date.'),
createdBefore: z.string().optional().describe('ISO date (YYYY-MM-DD). Only return nodes created before this date.'),
eventAfter: z.string().optional().describe('ISO date (YYYY-MM-DD). Only return nodes with event_date on or after this date.'),
eventBefore: z.string().optional().describe('ISO date (YYYY-MM-DD). Only return nodes with event_date before this date.'),
}).optional()
}),
execute: async ({ filters = {} }) => {
@@ -47,6 +51,9 @@ export const queryNodesTool = tool({
id: node.id,
title: node.title,
dimensions: node.dimensions || [],
created_at: node.created_at,
updated_at: node.updated_at,
event_date: node.event_date ?? null,
formatted_display: formatted,
}],
count: 1,
@@ -65,7 +72,11 @@ export const queryNodesTool = tool({
const nodesPromise: Promise<Node[] | undefined> = nodeService.getNodes({
limit,
dimensions: filters.dimensions,
search: filters.search
search: filters.search,
createdAfter: filters.createdAfter,
createdBefore: filters.createdBefore,
eventAfter: filters.eventAfter,
eventBefore: filters.eventBefore,
});
const nodes = await Promise.race<Node[] | undefined>([nodesPromise, timeoutPromise]);
@@ -85,6 +96,9 @@ export const queryNodesTool = tool({
id: node.id,
title: node.title,
dimensions: node.dimensions || [],
created_at: node.created_at,
updated_at: node.updated_at,
event_date: node.event_date ?? null,
formatted_display: formatted
};
});