@keyoku/types 1.0.0

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.
@@ -0,0 +1,2 @@
1
+ export * from './memory.js';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC"}
package/dist/index.js ADDED
@@ -0,0 +1,2 @@
1
+ export * from './memory.js';
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC"}
@@ -0,0 +1,120 @@
1
+ /**
2
+ * Keyoku memory engine types
3
+ */
4
+ export interface Memory {
5
+ id: string;
6
+ entity_id: string;
7
+ agent_id: string;
8
+ team_id: string;
9
+ visibility: string;
10
+ content: string;
11
+ type: string;
12
+ state: string;
13
+ importance: number;
14
+ confidence: number;
15
+ sentiment: number;
16
+ tags: string[];
17
+ access_count: number;
18
+ created_at: string;
19
+ updated_at: string;
20
+ last_accessed_at: string;
21
+ expires_at: string | null;
22
+ }
23
+ export interface SearchResult {
24
+ memory: Memory;
25
+ similarity: number;
26
+ score: number;
27
+ }
28
+ export interface RememberResult {
29
+ memories_created: number;
30
+ memories_updated: number;
31
+ memories_deleted: number;
32
+ skipped: number;
33
+ }
34
+ export interface HeartbeatResult {
35
+ should_act: boolean;
36
+ pending_work: Memory[];
37
+ deadlines: Memory[];
38
+ scheduled: Memory[];
39
+ decaying: Memory[];
40
+ conflicts: Array<{
41
+ memory: Memory;
42
+ reason: string;
43
+ }>;
44
+ stale_monitors: Memory[];
45
+ summary: string;
46
+ priority_action?: string;
47
+ action_items?: string[];
48
+ urgency?: 'immediate' | 'soon' | 'can_wait';
49
+ }
50
+ export interface HeartbeatAnalysis {
51
+ should_act: boolean;
52
+ action_brief: string;
53
+ recommended_actions: string[];
54
+ urgency: 'none' | 'low' | 'medium' | 'high' | 'critical';
55
+ reasoning: string;
56
+ autonomy: 'observe' | 'suggest' | 'act';
57
+ user_facing: string;
58
+ }
59
+ export interface GoalProgress {
60
+ plan: Memory;
61
+ activities: Memory[];
62
+ progress: number;
63
+ days_left: number;
64
+ status: 'on_track' | 'at_risk' | 'stalled' | 'no_activity';
65
+ }
66
+ export interface SessionContinuity {
67
+ last_memories: Memory[];
68
+ session_age_hours: number;
69
+ was_interrupted: boolean;
70
+ resume_suggestion: string;
71
+ }
72
+ export interface SentimentTrend {
73
+ recent_avg: number;
74
+ previous_avg: number;
75
+ direction: 'improving' | 'declining' | 'stable';
76
+ delta: number;
77
+ notable: Memory[];
78
+ }
79
+ export interface RelationshipAlert {
80
+ entity_name: string;
81
+ days_silent: number;
82
+ related_plans: Memory[];
83
+ urgency: 'info' | 'attention' | 'urgent';
84
+ }
85
+ export interface KnowledgeGap {
86
+ question: string;
87
+ asked_at: string;
88
+ }
89
+ export interface BehavioralPattern {
90
+ description: string;
91
+ confidence: number;
92
+ day_of_week?: number;
93
+ topics: string[];
94
+ }
95
+ export interface HeartbeatContextResult {
96
+ should_act: boolean;
97
+ scheduled: Memory[];
98
+ deadlines: Memory[];
99
+ pending_work: Memory[];
100
+ conflicts: Array<{
101
+ memory: Memory;
102
+ reason: string;
103
+ }>;
104
+ relevant_memories: SearchResult[];
105
+ summary: string;
106
+ analysis?: HeartbeatAnalysis;
107
+ goal_progress?: GoalProgress[];
108
+ continuity?: SessionContinuity;
109
+ sentiment_trend?: SentimentTrend;
110
+ relationship_alerts?: RelationshipAlert[];
111
+ knowledge_gaps?: KnowledgeGap[];
112
+ behavioral_patterns?: BehavioralPattern[];
113
+ }
114
+ export interface MemoryStats {
115
+ total_memories: number;
116
+ active_memories: number;
117
+ by_type: Record<string, number>;
118
+ by_state: Record<string, number>;
119
+ }
120
+ //# sourceMappingURL=memory.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"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* Keyoku memory engine types
3
+ */
4
+ export {};
5
+ //# sourceMappingURL=memory.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"memory.js","sourceRoot":"","sources":["../src/memory.ts"],"names":[],"mappings":"AAAA;;GAEG"}
package/package.json ADDED
@@ -0,0 +1,15 @@
1
+ {
2
+ "name": "@keyoku/types",
3
+ "version": "1.0.0",
4
+ "description": "Shared type definitions for Keyoku memory engine",
5
+ "type": "module",
6
+ "main": "dist/index.js",
7
+ "types": "dist/index.d.ts",
8
+ "scripts": {
9
+ "build": "tsc"
10
+ },
11
+ "license": "MIT",
12
+ "engines": {
13
+ "node": ">=20"
14
+ }
15
+ }
package/src/index.ts ADDED
@@ -0,0 +1 @@
1
+ export * from './memory.js';
package/src/memory.ts ADDED
@@ -0,0 +1,128 @@
1
+ /**
2
+ * Keyoku memory engine types
3
+ */
4
+
5
+ export interface Memory {
6
+ id: string;
7
+ entity_id: string;
8
+ agent_id: string;
9
+ team_id: string;
10
+ visibility: string;
11
+ content: string;
12
+ type: string;
13
+ state: string;
14
+ importance: number;
15
+ confidence: number;
16
+ sentiment: number;
17
+ tags: string[];
18
+ access_count: number;
19
+ created_at: string;
20
+ updated_at: string;
21
+ last_accessed_at: string;
22
+ expires_at: string | null;
23
+ }
24
+
25
+ export interface SearchResult {
26
+ memory: Memory;
27
+ similarity: number;
28
+ score: number;
29
+ }
30
+
31
+ export interface RememberResult {
32
+ memories_created: number;
33
+ memories_updated: number;
34
+ memories_deleted: number;
35
+ skipped: number;
36
+ }
37
+
38
+ export interface HeartbeatResult {
39
+ should_act: boolean;
40
+ pending_work: Memory[];
41
+ deadlines: Memory[];
42
+ scheduled: Memory[];
43
+ decaying: Memory[];
44
+ conflicts: Array<{ memory: Memory; reason: string }>;
45
+ stale_monitors: Memory[];
46
+ summary: string;
47
+ priority_action?: string;
48
+ action_items?: string[];
49
+ urgency?: 'immediate' | 'soon' | 'can_wait';
50
+ }
51
+
52
+ export interface HeartbeatAnalysis {
53
+ should_act: boolean;
54
+ action_brief: string;
55
+ recommended_actions: string[];
56
+ urgency: 'none' | 'low' | 'medium' | 'high' | 'critical';
57
+ reasoning: string;
58
+ autonomy: 'observe' | 'suggest' | 'act';
59
+ user_facing: string;
60
+ }
61
+
62
+ export interface GoalProgress {
63
+ plan: Memory;
64
+ activities: Memory[];
65
+ progress: number;
66
+ days_left: number;
67
+ status: 'on_track' | 'at_risk' | 'stalled' | 'no_activity';
68
+ }
69
+
70
+ export interface SessionContinuity {
71
+ last_memories: Memory[];
72
+ session_age_hours: number;
73
+ was_interrupted: boolean;
74
+ resume_suggestion: string;
75
+ }
76
+
77
+ export interface SentimentTrend {
78
+ recent_avg: number;
79
+ previous_avg: number;
80
+ direction: 'improving' | 'declining' | 'stable';
81
+ delta: number;
82
+ notable: Memory[];
83
+ }
84
+
85
+ export interface RelationshipAlert {
86
+ entity_name: string;
87
+ days_silent: number;
88
+ related_plans: Memory[];
89
+ urgency: 'info' | 'attention' | 'urgent';
90
+ }
91
+
92
+ export interface KnowledgeGap {
93
+ question: string;
94
+ asked_at: string;
95
+ }
96
+
97
+ export interface BehavioralPattern {
98
+ description: string;
99
+ confidence: number;
100
+ day_of_week?: number;
101
+ topics: string[];
102
+ }
103
+
104
+ export interface HeartbeatContextResult {
105
+ should_act: boolean;
106
+ scheduled: Memory[];
107
+ deadlines: Memory[];
108
+ pending_work: Memory[];
109
+ conflicts: Array<{ memory: Memory; reason: string }>;
110
+ relevant_memories: SearchResult[];
111
+ summary: string;
112
+ analysis?: HeartbeatAnalysis;
113
+
114
+ // Extended signals
115
+ goal_progress?: GoalProgress[];
116
+ continuity?: SessionContinuity;
117
+ sentiment_trend?: SentimentTrend;
118
+ relationship_alerts?: RelationshipAlert[];
119
+ knowledge_gaps?: KnowledgeGap[];
120
+ behavioral_patterns?: BehavioralPattern[];
121
+ }
122
+
123
+ export interface MemoryStats {
124
+ total_memories: number;
125
+ active_memories: number;
126
+ by_type: Record<string, number>;
127
+ by_state: Record<string, number>;
128
+ }
package/tsconfig.json ADDED
@@ -0,0 +1,8 @@
1
+ {
2
+ "extends": "../../tsconfig.json",
3
+ "compilerOptions": {
4
+ "outDir": "dist",
5
+ "rootDir": "src"
6
+ },
7
+ "include": ["src"]
8
+ }