gitgram/aitimemachine/test-ai-time-tools.mjs
caelum0x 49b183818c Unify gitgram + aitimemachine into the monorepo (de-submodule) and merge vendored engines
Convert gitgram/ and aitimemachine/ from embedded git repos (which showed as
opaque submodule gitlinks on GitHub) into fully-tracked first-party content.

AITM now merges its 7 vendored repos as first-party engines:
- memory: beads (Go task DAG) + context7 (docs SDK), unified into saved_contexts
- git: vendored C git (bundled binary) + gitnexus (in-process code intelligence)
- agentic: a2a (@a2a-js/sdk) + pal (AITM-managed Python subprocess)

Includes the full session's product build: Gitgram web/mobile/backend features,
AITM website/CLI/MCP, the unified memory layer, engine build tooling
(scripts/build-engines.sh, Dockerfile, CI), docs (README, ENGINES.md, ARCHITECTURE.md),
and extensive test suites.

Build artifacts, node_modules, external/, and gemini-cli are gitignored.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-23 14:14:09 +03:00

85 lines
2.7 KiB
JavaScript

#!/usr/bin/env node
/**
* Test script for AI Time & Concept Realization tools
*/
import { AITimeConceptTools } from './lib/mcp/ai-time-concept-tools.js';
async function testAITimeTools() {
console.log('🧪 Testing AI Time & Concept Realization Tools...\n');
try {
// Mock engine and repo for testing
const mockEngine = {
// Add minimal mock methods as needed
};
const mockRepo = {
listCheckpointsNewestFirst: (projectId, limit) => [
{
checkpointId: 'cp_123',
name: 'implementing user authentication',
createdAt: new Date(Date.now() - 3600000).toISOString(), // 1 hour ago
},
{
checkpointId: 'cp_124',
name: 'fixed auth bug',
createdAt: new Date(Date.now() - 7200000).toISOString(), // 2 hours ago
},
{
checkpointId: 'cp_125',
name: 'working on user store',
createdAt: new Date(Date.now() - 10800000).toISOString(), // 3 hours ago
}
]
};
const aiTools = new AITimeConceptTools(mockEngine, mockRepo);
console.log('1. Testing Concept Realization...');
const concepts = await aiTools.realizeCurrentConcepts();
console.log('✅ Concepts:', {
phase: concepts.currentState.conceptualPhase,
confidence: concepts.currentState.confidence,
activeThemes: concepts.conceptualMap.activeThemes,
velocity: concepts.temporalAwareness.developmentVelocity
});
console.log('\n2. Testing Time Realization...');
const timeContext = await aiTools.realizeTimeContext();
console.log('✅ Time Context:', {
sinceLastChange: timeContext.relativeTime.sinceLastChange,
workingTimeToday: timeContext.relativeTime.workingTimeToday,
avgInterval: timeContext.temporalPatterns.averageTimeBetweenCheckpoints
});
console.log('\n3. Testing Focus Suggestion...');
const focus = await aiTools.suggestConceptualFocus();
console.log('✅ Focus Suggestion:', {
primaryFocus: focus.primaryFocus,
reasoning: focus.reasoning,
timeAllocation: focus.timeAllocation
});
console.log('\n4. Testing Transition Analysis...');
const transitions = await aiTools.analyzeStateTransitions();
console.log('✅ Transitions:', {
transitionCount: transitions.transitions.length,
patterns: transitions.patterns,
recommendations: transitions.recommendations
});
console.log('\n🎉 All tests passed! AI Time & Concept tools are working.');
} catch (error) {
console.error('❌ Test failed:', error);
process.exit(1);
}
}
// Run tests if this file is executed directly
if (import.meta.url === `file://${process.argv[1]}`) {
testAITimeTools();
}