-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathindex.ts
More file actions
93 lines (80 loc) · 2.84 KB
/
index.ts
File metadata and controls
93 lines (80 loc) · 2.84 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
/**
* @just-every/task
*
* Task - Advanced LLM orchestration with meta-cognition
*
* This module provides the Task system which includes:
* - Hierarchical model selection based on performance scores
* - Meta-cognition for self-reflection and strategy adjustment
* - Thought delay management for pacing
* - Memory integration for learning from past tasks
*/
// ============================================================================
// Main API - Single simple interface
// ============================================================================
export {
// The one and only function you need
runTask,
// Resume a task from a previous state
resumeTask,
// Add messages to an active task
addMessageToTask,
// Get status of an active task
taskStatus,
} from './src/core/engine.js';
// ============================================================================
// Core Types
// ============================================================================
// Re-export Agent from ensemble
export type { Agent } from '@just-every/ensemble';
// Export task-specific event types
export type {
TaskStartEvent,
TaskCompleteEvent,
TaskFatalErrorEvent,
TaskEvent,
MetaMemoryEvent,
MetaCognitionEvent,
TaskStatusEvent
} from './src/types/events.js';
// Export TaskLocalState and CognitionState types
export type { TaskLocalState, CognitionState, SerializedCognitionState } from './src/types/task-state.js';
// ============================================================================
// State Management (for debugging/monitoring)
// ============================================================================
export {
setThoughtDelay,
getThoughtDelay
} from './src/core/thought_utils.js';
// ============================================================================
// Pause Control (from ensemble)
// ============================================================================
export {
pause,
resume,
isPaused,
getPauseController,
waitWhilePaused,
type PauseController
} from '@just-every/ensemble';
// ============================================================================
// Metamemory (for conversation compaction)
// ============================================================================
export {
// Main class and functions
Metamemory,
// Types
type MetamemoryState
} from './src/metamemory/index.js';
export type {
TopicTagMetadata,
MessageMetadata,
SerializedMetamemoryState
} from './src/metamemory/types/index.js';
// ============================================================================
// Utilities
// ============================================================================
export {
approximateTokens
} from './src/utils/index.js';
// That's it! Just use runTask(agent, content) and everything else is automatic.