@nahisaho/musubix-wake-sleep 1.6.0 → 1.7.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.
- package/dist/cycle/index.d.ts +3 -1
- package/dist/cycle/index.d.ts.map +1 -1
- package/dist/cycle/index.js +3 -1
- package/dist/cycle/index.js.map +1 -1
- package/dist/cycle/learning-scheduler.d.ts +203 -0
- package/dist/cycle/learning-scheduler.d.ts.map +1 -0
- package/dist/cycle/learning-scheduler.js +383 -0
- package/dist/cycle/learning-scheduler.js.map +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -0
- package/dist/index.js.map +1 -1
- package/dist/types.d.ts +6 -1
- package/dist/types.d.ts.map +1 -1
- package/dist/yata/index.d.ts +6 -0
- package/dist/yata/index.d.ts.map +1 -0
- package/dist/yata/index.js +6 -0
- package/dist/yata/index.js.map +1 -0
- package/dist/yata/yata-integrator.d.ts +120 -0
- package/dist/yata/yata-integrator.d.ts.map +1 -0
- package/dist/yata/yata-integrator.js +175 -0
- package/dist/yata/yata-integrator.js.map +1 -0
- package/package.json +1 -1
package/dist/cycle/index.d.ts
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @fileoverview Wake-sleep cycle module
|
|
3
|
-
* @traceability TSK-WAKE-003
|
|
3
|
+
* @traceability TSK-WAKE-003, TSK-WSL-004
|
|
4
4
|
*/
|
|
5
5
|
export { CycleManager } from './cycle-manager.js';
|
|
6
|
+
export { LearningScheduler, parseCronExpression, msUntilNextCronRun, DEFAULT_SCHEDULER_CONFIG, } from './learning-scheduler.js';
|
|
7
|
+
export type { LearningSchedulerConfig, CycleResult, SchedulerStatus, LearningSchedulerEvents, } from './learning-scheduler.js';
|
|
6
8
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/cycle/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/cycle/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAGlD,OAAO,EACL,iBAAiB,EACjB,mBAAmB,EACnB,kBAAkB,EAClB,wBAAwB,GACzB,MAAM,yBAAyB,CAAC;AACjC,YAAY,EACV,uBAAuB,EACvB,WAAW,EACX,eAAe,EACf,uBAAuB,GACxB,MAAM,yBAAyB,CAAC"}
|
package/dist/cycle/index.js
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @fileoverview Wake-sleep cycle module
|
|
3
|
-
* @traceability TSK-WAKE-003
|
|
3
|
+
* @traceability TSK-WAKE-003, TSK-WSL-004
|
|
4
4
|
*/
|
|
5
5
|
export { CycleManager } from './cycle-manager.js';
|
|
6
|
+
// Learning Scheduler (TSK-WSL-004)
|
|
7
|
+
export { LearningScheduler, parseCronExpression, msUntilNextCronRun, DEFAULT_SCHEDULER_CONFIG, } from './learning-scheduler.js';
|
|
6
8
|
//# sourceMappingURL=index.js.map
|
package/dist/cycle/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/cycle/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/cycle/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAElD,mCAAmC;AACnC,OAAO,EACL,iBAAiB,EACjB,mBAAmB,EACnB,kBAAkB,EAClB,wBAAwB,GACzB,MAAM,yBAAyB,CAAC"}
|
|
@@ -0,0 +1,203 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview Learning Scheduler - Automated Wake-Sleep Cycle Execution
|
|
3
|
+
*
|
|
4
|
+
* Schedules and runs wake-sleep learning cycles automatically
|
|
5
|
+
*
|
|
6
|
+
* @traceability TSK-WSL-004, REQ-WSL-004
|
|
7
|
+
*/
|
|
8
|
+
import { EventEmitter } from 'events';
|
|
9
|
+
import type { CycleConfig, CycleStatus } from '../types.js';
|
|
10
|
+
import { CycleManager } from './cycle-manager.js';
|
|
11
|
+
/**
|
|
12
|
+
* Scheduler configuration
|
|
13
|
+
*/
|
|
14
|
+
export interface LearningSchedulerConfig extends Partial<CycleConfig> {
|
|
15
|
+
/** Interval between automatic cycles in ms (default: 1 hour) */
|
|
16
|
+
intervalMs?: number;
|
|
17
|
+
/** Enable automatic scheduling (default: false) */
|
|
18
|
+
autoStart?: boolean;
|
|
19
|
+
/** Maximum consecutive cycles before pause (default: 10) */
|
|
20
|
+
maxConsecutiveCycles?: number;
|
|
21
|
+
/** Pause duration after max cycles (ms) (default: 6 hours) */
|
|
22
|
+
pauseDurationMs?: number;
|
|
23
|
+
/** Minimum patterns required to run cycle (default: 5) */
|
|
24
|
+
minPatternsToRun?: number;
|
|
25
|
+
/** Cron expression (optional, takes precedence over intervalMs) */
|
|
26
|
+
cronExpression?: string;
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Cycle result
|
|
30
|
+
*/
|
|
31
|
+
export interface CycleResult {
|
|
32
|
+
/** Cycle number */
|
|
33
|
+
cycleNumber: number;
|
|
34
|
+
/** Wake phase result */
|
|
35
|
+
wakeResult: {
|
|
36
|
+
extractedPatterns: number;
|
|
37
|
+
processedTasks: number;
|
|
38
|
+
};
|
|
39
|
+
/** Sleep phase result */
|
|
40
|
+
sleepResult: {
|
|
41
|
+
clusteredPatterns: number;
|
|
42
|
+
consolidatedPatterns: number;
|
|
43
|
+
};
|
|
44
|
+
/** Duration in ms */
|
|
45
|
+
durationMs: number;
|
|
46
|
+
/** Timestamp */
|
|
47
|
+
timestamp: Date;
|
|
48
|
+
/** Whether triggered manually */
|
|
49
|
+
manual: boolean;
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* Scheduler status
|
|
53
|
+
*/
|
|
54
|
+
export interface SchedulerStatus {
|
|
55
|
+
/** Whether scheduler is running */
|
|
56
|
+
running: boolean;
|
|
57
|
+
/** Whether scheduler is paused */
|
|
58
|
+
paused: boolean;
|
|
59
|
+
/** Current cycle status */
|
|
60
|
+
cycleStatus: CycleStatus;
|
|
61
|
+
/** Total cycles run */
|
|
62
|
+
totalCycles: number;
|
|
63
|
+
/** Consecutive cycles since last pause */
|
|
64
|
+
consecutiveCycles: number;
|
|
65
|
+
/** Next scheduled run (if running) */
|
|
66
|
+
nextRun?: Date;
|
|
67
|
+
/** Last run timestamp */
|
|
68
|
+
lastRun?: Date;
|
|
69
|
+
/** Last result */
|
|
70
|
+
lastResult?: CycleResult;
|
|
71
|
+
}
|
|
72
|
+
/**
|
|
73
|
+
* Default scheduler configuration
|
|
74
|
+
*/
|
|
75
|
+
export declare const DEFAULT_SCHEDULER_CONFIG: Required<LearningSchedulerConfig>;
|
|
76
|
+
/**
|
|
77
|
+
* Simple cron expression parser
|
|
78
|
+
* Supports: minute hour day-of-month month day-of-week
|
|
79
|
+
* Example: "0 2 * * *" = 2:00 AM every day
|
|
80
|
+
*/
|
|
81
|
+
export declare function parseCronExpression(expression: string): {
|
|
82
|
+
nextRun: Date;
|
|
83
|
+
} | null;
|
|
84
|
+
/**
|
|
85
|
+
* Calculate ms until next cron run
|
|
86
|
+
*/
|
|
87
|
+
export declare function msUntilNextCronRun(expression: string): number | null;
|
|
88
|
+
/**
|
|
89
|
+
* Learning Scheduler events
|
|
90
|
+
*/
|
|
91
|
+
export interface LearningSchedulerEvents {
|
|
92
|
+
'scheduler:started': Record<string, never>;
|
|
93
|
+
'scheduler:stopped': Record<string, never>;
|
|
94
|
+
'scheduler:paused': {
|
|
95
|
+
reason: string;
|
|
96
|
+
};
|
|
97
|
+
'scheduler:resumed': Record<string, never>;
|
|
98
|
+
'cycle:started': {
|
|
99
|
+
cycleNumber: number;
|
|
100
|
+
manual: boolean;
|
|
101
|
+
};
|
|
102
|
+
'cycle:completed': {
|
|
103
|
+
result: CycleResult;
|
|
104
|
+
};
|
|
105
|
+
'cycle:failed': {
|
|
106
|
+
error: Error;
|
|
107
|
+
cycleNumber: number;
|
|
108
|
+
};
|
|
109
|
+
'error': Error;
|
|
110
|
+
}
|
|
111
|
+
/**
|
|
112
|
+
* Learning Scheduler
|
|
113
|
+
*
|
|
114
|
+
* Schedules and runs wake-sleep learning cycles automatically
|
|
115
|
+
*
|
|
116
|
+
* @example
|
|
117
|
+
* ```typescript
|
|
118
|
+
* const scheduler = new LearningScheduler({
|
|
119
|
+
* intervalMs: 30 * 60 * 1000, // 30 minutes
|
|
120
|
+
* });
|
|
121
|
+
*
|
|
122
|
+
* scheduler.start();
|
|
123
|
+
*
|
|
124
|
+
* // Manual trigger
|
|
125
|
+
* const result = await scheduler.runCycle();
|
|
126
|
+
*
|
|
127
|
+
* scheduler.stop();
|
|
128
|
+
* ```
|
|
129
|
+
*/
|
|
130
|
+
export declare class LearningScheduler extends EventEmitter {
|
|
131
|
+
private cycleManager;
|
|
132
|
+
private config;
|
|
133
|
+
private running;
|
|
134
|
+
private paused;
|
|
135
|
+
private timer;
|
|
136
|
+
private totalCycles;
|
|
137
|
+
private consecutiveCycles;
|
|
138
|
+
private lastRun?;
|
|
139
|
+
private lastResult?;
|
|
140
|
+
private nextRun?;
|
|
141
|
+
constructor(config?: LearningSchedulerConfig);
|
|
142
|
+
/**
|
|
143
|
+
* Get underlying cycle manager
|
|
144
|
+
*/
|
|
145
|
+
getCycleManager(): CycleManager;
|
|
146
|
+
/**
|
|
147
|
+
* Start the scheduler
|
|
148
|
+
*/
|
|
149
|
+
start(): void;
|
|
150
|
+
/**
|
|
151
|
+
* Stop the scheduler
|
|
152
|
+
*/
|
|
153
|
+
stop(): void;
|
|
154
|
+
/**
|
|
155
|
+
* Pause the scheduler
|
|
156
|
+
*/
|
|
157
|
+
pause(reason?: string): void;
|
|
158
|
+
/**
|
|
159
|
+
* Resume the scheduler
|
|
160
|
+
*/
|
|
161
|
+
resume(): void;
|
|
162
|
+
/**
|
|
163
|
+
* Schedule the next automatic run
|
|
164
|
+
*/
|
|
165
|
+
private scheduleNextRun;
|
|
166
|
+
/**
|
|
167
|
+
* Run an automatic cycle
|
|
168
|
+
*/
|
|
169
|
+
private runAutomaticCycle;
|
|
170
|
+
/**
|
|
171
|
+
* Run a cycle manually
|
|
172
|
+
*/
|
|
173
|
+
runCycle(): Promise<CycleResult>;
|
|
174
|
+
/**
|
|
175
|
+
* Execute a learning cycle
|
|
176
|
+
*/
|
|
177
|
+
private executeCycle;
|
|
178
|
+
/**
|
|
179
|
+
* Get scheduler status
|
|
180
|
+
*/
|
|
181
|
+
getStatus(): SchedulerStatus;
|
|
182
|
+
/**
|
|
183
|
+
* Check if scheduler is running
|
|
184
|
+
*/
|
|
185
|
+
isRunning(): boolean;
|
|
186
|
+
/**
|
|
187
|
+
* Check if scheduler is paused
|
|
188
|
+
*/
|
|
189
|
+
isPaused(): boolean;
|
|
190
|
+
/**
|
|
191
|
+
* Reset the scheduler and cycle manager
|
|
192
|
+
*/
|
|
193
|
+
reset(): void;
|
|
194
|
+
/**
|
|
195
|
+
* Update configuration
|
|
196
|
+
*/
|
|
197
|
+
updateConfig(config: Partial<LearningSchedulerConfig>): void;
|
|
198
|
+
/**
|
|
199
|
+
* Get current configuration
|
|
200
|
+
*/
|
|
201
|
+
getConfig(): Required<LearningSchedulerConfig>;
|
|
202
|
+
}
|
|
203
|
+
//# sourceMappingURL=learning-scheduler.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"learning-scheduler.d.ts","sourceRoot":"","sources":["../../src/cycle/learning-scheduler.ts"],"names":[],"mappings":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AAO,CAAC,MAAM,CAAS;IACvB,OAAO,CAAC,KAAK,CAA8C;IAE3D,OAAO,CAAC,WAAW,CAAK;IACxB,OAAO,CAAC,iBAAiB,CAAK;IAC9B,OAAO,CAAC,OAAO,CAAC,CAAO;IACvB,OAAO,CAAC,UAAU,CAAC,CAAc;IACjC,OAAO,CAAC,OAAO,CAAC,CAAO;gBAEX,MAAM,GAAE,uBAA4B;IAgBhD;;OAEG;IACH,eAAe,IAAI,YAAY;IAI/B;;OAEG;IACH,KAAK,IAAI,IAAI;IAWb;;OAEG;IACH,IAAI,IAAI,IAAI;IAiBZ;;OAEG;IACH,KAAK,CAAC,MAAM,SAAiB,GAAG,IAAI;IAgBpC;;OAEG;IACH,MAAM,IAAI,IAAI;IAWd;;OAEG;IACH,OAAO,CAAC,eAAe;IA0BvB;;OAEG;YACW,iBAAiB;IA8B/B;;OAEG;IACG,QAAQ,IAAI,OAAO,CAAC,WAAW,CAAC;IAItC;;OAEG;YACW,YAAY;IA8C1B;;OAEG;IACH,SAAS,IAAI,eAAe;IAa5B;;OAEG;IACH,SAAS,IAAI,OAAO;IAIpB;;OAEG;IACH,QAAQ,IAAI,OAAO;IAInB;;OAEG;IACH,KAAK,IAAI,IAAI;IAUb;;OAEG;IACH,YAAY,CAAC,MAAM,EAAE,OAAO,CAAC,uBAAuB,CAAC,GAAG,IAAI;IAsB5D;;OAEG;IACH,SAAS,IAAI,QAAQ,CAAC,uBAAuB,CAAC;CAG/C"}
|
|
@@ -0,0 +1,383 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview Learning Scheduler - Automated Wake-Sleep Cycle Execution
|
|
3
|
+
*
|
|
4
|
+
* Schedules and runs wake-sleep learning cycles automatically
|
|
5
|
+
*
|
|
6
|
+
* @traceability TSK-WSL-004, REQ-WSL-004
|
|
7
|
+
*/
|
|
8
|
+
import { EventEmitter } from 'events';
|
|
9
|
+
import { CycleManager } from './cycle-manager.js';
|
|
10
|
+
/**
|
|
11
|
+
* Default scheduler configuration
|
|
12
|
+
*/
|
|
13
|
+
export const DEFAULT_SCHEDULER_CONFIG = {
|
|
14
|
+
intervalMs: 60 * 60 * 1000, // 1 hour
|
|
15
|
+
autoStart: false,
|
|
16
|
+
maxConsecutiveCycles: 10,
|
|
17
|
+
pauseDurationMs: 6 * 60 * 60 * 1000, // 6 hours
|
|
18
|
+
minPatternsToRun: 5,
|
|
19
|
+
cronExpression: '',
|
|
20
|
+
wakeTaskThreshold: 10,
|
|
21
|
+
maxCycleDuration: 60000,
|
|
22
|
+
minPatternFrequency: 2,
|
|
23
|
+
mdlThreshold: 0.5,
|
|
24
|
+
};
|
|
25
|
+
// ============================================================================
|
|
26
|
+
// Cron Parser (Simple Implementation)
|
|
27
|
+
// ============================================================================
|
|
28
|
+
/**
|
|
29
|
+
* Simple cron expression parser
|
|
30
|
+
* Supports: minute hour day-of-month month day-of-week
|
|
31
|
+
* Example: "0 2 * * *" = 2:00 AM every day
|
|
32
|
+
*/
|
|
33
|
+
export function parseCronExpression(expression) {
|
|
34
|
+
const parts = expression.trim().split(/\s+/);
|
|
35
|
+
if (parts.length !== 5) {
|
|
36
|
+
return null;
|
|
37
|
+
}
|
|
38
|
+
const [minute, hour, dayOfMonth, month, dayOfWeek] = parts;
|
|
39
|
+
const now = new Date();
|
|
40
|
+
let next = new Date(now);
|
|
41
|
+
// Simple implementation - find next occurrence
|
|
42
|
+
// This is a basic implementation and doesn't handle all cron features
|
|
43
|
+
// Set minute
|
|
44
|
+
if (minute !== '*') {
|
|
45
|
+
const m = parseInt(minute, 10);
|
|
46
|
+
if (!isNaN(m) && m >= 0 && m <= 59) {
|
|
47
|
+
next.setMinutes(m);
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
// Set hour
|
|
51
|
+
if (hour !== '*') {
|
|
52
|
+
const h = parseInt(hour, 10);
|
|
53
|
+
if (!isNaN(h) && h >= 0 && h <= 23) {
|
|
54
|
+
next.setHours(h);
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
// Reset seconds
|
|
58
|
+
next.setSeconds(0);
|
|
59
|
+
next.setMilliseconds(0);
|
|
60
|
+
// If the time has passed today, move to tomorrow
|
|
61
|
+
if (next <= now) {
|
|
62
|
+
next.setDate(next.getDate() + 1);
|
|
63
|
+
}
|
|
64
|
+
// Day of month
|
|
65
|
+
if (dayOfMonth !== '*') {
|
|
66
|
+
const d = parseInt(dayOfMonth, 10);
|
|
67
|
+
if (!isNaN(d) && d >= 1 && d <= 31) {
|
|
68
|
+
next.setDate(d);
|
|
69
|
+
if (next <= now) {
|
|
70
|
+
next.setMonth(next.getMonth() + 1);
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
// Month
|
|
75
|
+
if (month !== '*') {
|
|
76
|
+
const mo = parseInt(month, 10);
|
|
77
|
+
if (!isNaN(mo) && mo >= 1 && mo <= 12) {
|
|
78
|
+
next.setMonth(mo - 1);
|
|
79
|
+
if (next <= now) {
|
|
80
|
+
next.setFullYear(next.getFullYear() + 1);
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
// Day of week (0 = Sunday)
|
|
85
|
+
if (dayOfWeek !== '*') {
|
|
86
|
+
const dow = parseInt(dayOfWeek, 10);
|
|
87
|
+
if (!isNaN(dow) && dow >= 0 && dow <= 6) {
|
|
88
|
+
const currentDow = next.getDay();
|
|
89
|
+
const daysUntil = (dow - currentDow + 7) % 7;
|
|
90
|
+
if (daysUntil === 0 && next <= now) {
|
|
91
|
+
next.setDate(next.getDate() + 7);
|
|
92
|
+
}
|
|
93
|
+
else {
|
|
94
|
+
next.setDate(next.getDate() + daysUntil);
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
return { nextRun: next };
|
|
99
|
+
}
|
|
100
|
+
/**
|
|
101
|
+
* Calculate ms until next cron run
|
|
102
|
+
*/
|
|
103
|
+
export function msUntilNextCronRun(expression) {
|
|
104
|
+
const parsed = parseCronExpression(expression);
|
|
105
|
+
if (!parsed) {
|
|
106
|
+
return null;
|
|
107
|
+
}
|
|
108
|
+
return parsed.nextRun.getTime() - Date.now();
|
|
109
|
+
}
|
|
110
|
+
/**
|
|
111
|
+
* Learning Scheduler
|
|
112
|
+
*
|
|
113
|
+
* Schedules and runs wake-sleep learning cycles automatically
|
|
114
|
+
*
|
|
115
|
+
* @example
|
|
116
|
+
* ```typescript
|
|
117
|
+
* const scheduler = new LearningScheduler({
|
|
118
|
+
* intervalMs: 30 * 60 * 1000, // 30 minutes
|
|
119
|
+
* });
|
|
120
|
+
*
|
|
121
|
+
* scheduler.start();
|
|
122
|
+
*
|
|
123
|
+
* // Manual trigger
|
|
124
|
+
* const result = await scheduler.runCycle();
|
|
125
|
+
*
|
|
126
|
+
* scheduler.stop();
|
|
127
|
+
* ```
|
|
128
|
+
*/
|
|
129
|
+
export class LearningScheduler extends EventEmitter {
|
|
130
|
+
cycleManager;
|
|
131
|
+
config;
|
|
132
|
+
running = false;
|
|
133
|
+
paused = false;
|
|
134
|
+
timer = null;
|
|
135
|
+
totalCycles = 0;
|
|
136
|
+
consecutiveCycles = 0;
|
|
137
|
+
lastRun;
|
|
138
|
+
lastResult;
|
|
139
|
+
nextRun;
|
|
140
|
+
constructor(config = {}) {
|
|
141
|
+
super();
|
|
142
|
+
this.config = { ...DEFAULT_SCHEDULER_CONFIG, ...config };
|
|
143
|
+
this.cycleManager = new CycleManager({
|
|
144
|
+
wakeTaskThreshold: this.config.wakeTaskThreshold,
|
|
145
|
+
maxCycleDuration: this.config.maxCycleDuration,
|
|
146
|
+
minPatternFrequency: this.config.minPatternFrequency,
|
|
147
|
+
mdlThreshold: this.config.mdlThreshold,
|
|
148
|
+
});
|
|
149
|
+
if (this.config.autoStart) {
|
|
150
|
+
this.start();
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
/**
|
|
154
|
+
* Get underlying cycle manager
|
|
155
|
+
*/
|
|
156
|
+
getCycleManager() {
|
|
157
|
+
return this.cycleManager;
|
|
158
|
+
}
|
|
159
|
+
/**
|
|
160
|
+
* Start the scheduler
|
|
161
|
+
*/
|
|
162
|
+
start() {
|
|
163
|
+
if (this.running) {
|
|
164
|
+
return;
|
|
165
|
+
}
|
|
166
|
+
this.running = true;
|
|
167
|
+
this.paused = false;
|
|
168
|
+
this.scheduleNextRun();
|
|
169
|
+
this.emit('scheduler:started', {});
|
|
170
|
+
}
|
|
171
|
+
/**
|
|
172
|
+
* Stop the scheduler
|
|
173
|
+
*/
|
|
174
|
+
stop() {
|
|
175
|
+
if (!this.running) {
|
|
176
|
+
return;
|
|
177
|
+
}
|
|
178
|
+
this.running = false;
|
|
179
|
+
this.paused = false;
|
|
180
|
+
if (this.timer) {
|
|
181
|
+
clearTimeout(this.timer);
|
|
182
|
+
this.timer = null;
|
|
183
|
+
}
|
|
184
|
+
this.nextRun = undefined;
|
|
185
|
+
this.emit('scheduler:stopped', {});
|
|
186
|
+
}
|
|
187
|
+
/**
|
|
188
|
+
* Pause the scheduler
|
|
189
|
+
*/
|
|
190
|
+
pause(reason = 'Manual pause') {
|
|
191
|
+
if (!this.running || this.paused) {
|
|
192
|
+
return;
|
|
193
|
+
}
|
|
194
|
+
this.paused = true;
|
|
195
|
+
if (this.timer) {
|
|
196
|
+
clearTimeout(this.timer);
|
|
197
|
+
this.timer = null;
|
|
198
|
+
}
|
|
199
|
+
this.nextRun = undefined;
|
|
200
|
+
this.emit('scheduler:paused', { reason });
|
|
201
|
+
}
|
|
202
|
+
/**
|
|
203
|
+
* Resume the scheduler
|
|
204
|
+
*/
|
|
205
|
+
resume() {
|
|
206
|
+
if (!this.running || !this.paused) {
|
|
207
|
+
return;
|
|
208
|
+
}
|
|
209
|
+
this.paused = false;
|
|
210
|
+
this.consecutiveCycles = 0;
|
|
211
|
+
this.scheduleNextRun();
|
|
212
|
+
this.emit('scheduler:resumed', {});
|
|
213
|
+
}
|
|
214
|
+
/**
|
|
215
|
+
* Schedule the next automatic run
|
|
216
|
+
*/
|
|
217
|
+
scheduleNextRun() {
|
|
218
|
+
if (!this.running || this.paused) {
|
|
219
|
+
return;
|
|
220
|
+
}
|
|
221
|
+
let delayMs;
|
|
222
|
+
// Use cron expression if provided
|
|
223
|
+
if (this.config.cronExpression) {
|
|
224
|
+
const cronDelay = msUntilNextCronRun(this.config.cronExpression);
|
|
225
|
+
if (cronDelay !== null) {
|
|
226
|
+
delayMs = cronDelay;
|
|
227
|
+
}
|
|
228
|
+
else {
|
|
229
|
+
delayMs = this.config.intervalMs;
|
|
230
|
+
}
|
|
231
|
+
}
|
|
232
|
+
else {
|
|
233
|
+
delayMs = this.config.intervalMs;
|
|
234
|
+
}
|
|
235
|
+
this.nextRun = new Date(Date.now() + delayMs);
|
|
236
|
+
this.timer = setTimeout(async () => {
|
|
237
|
+
await this.runAutomaticCycle();
|
|
238
|
+
}, delayMs);
|
|
239
|
+
}
|
|
240
|
+
/**
|
|
241
|
+
* Run an automatic cycle
|
|
242
|
+
*/
|
|
243
|
+
async runAutomaticCycle() {
|
|
244
|
+
if (!this.running || this.paused) {
|
|
245
|
+
return;
|
|
246
|
+
}
|
|
247
|
+
try {
|
|
248
|
+
await this.executeCycle(false);
|
|
249
|
+
this.consecutiveCycles++;
|
|
250
|
+
// Check if we need to pause
|
|
251
|
+
if (this.consecutiveCycles >= this.config.maxConsecutiveCycles) {
|
|
252
|
+
this.pause(`Reached max consecutive cycles (${this.config.maxConsecutiveCycles})`);
|
|
253
|
+
// Schedule resume after pause duration
|
|
254
|
+
setTimeout(() => {
|
|
255
|
+
if (this.running && this.paused) {
|
|
256
|
+
this.resume();
|
|
257
|
+
}
|
|
258
|
+
}, this.config.pauseDurationMs);
|
|
259
|
+
}
|
|
260
|
+
else {
|
|
261
|
+
// Schedule next run
|
|
262
|
+
this.scheduleNextRun();
|
|
263
|
+
}
|
|
264
|
+
}
|
|
265
|
+
catch {
|
|
266
|
+
// Schedule next run despite error
|
|
267
|
+
this.scheduleNextRun();
|
|
268
|
+
}
|
|
269
|
+
}
|
|
270
|
+
/**
|
|
271
|
+
* Run a cycle manually
|
|
272
|
+
*/
|
|
273
|
+
async runCycle() {
|
|
274
|
+
return this.executeCycle(true);
|
|
275
|
+
}
|
|
276
|
+
/**
|
|
277
|
+
* Execute a learning cycle
|
|
278
|
+
*/
|
|
279
|
+
async executeCycle(manual) {
|
|
280
|
+
const startTime = Date.now();
|
|
281
|
+
const cycleNumber = this.totalCycles + 1;
|
|
282
|
+
this.emit('cycle:started', { cycleNumber, manual });
|
|
283
|
+
try {
|
|
284
|
+
// Get current status before cycle
|
|
285
|
+
const statusBefore = this.cycleManager.getStatus();
|
|
286
|
+
// Run the sleep phase (which processes wake tasks)
|
|
287
|
+
await this.cycleManager.runSleepPhase();
|
|
288
|
+
// Get status after cycle
|
|
289
|
+
const statusAfter = this.cycleManager.getStatus();
|
|
290
|
+
const result = {
|
|
291
|
+
cycleNumber,
|
|
292
|
+
wakeResult: {
|
|
293
|
+
extractedPatterns: 0, // Would need to track from wake phase
|
|
294
|
+
processedTasks: statusBefore.taskCount,
|
|
295
|
+
},
|
|
296
|
+
sleepResult: {
|
|
297
|
+
clusteredPatterns: 0, // Would need to track from sleep phase
|
|
298
|
+
consolidatedPatterns: statusAfter.patternCount - statusBefore.patternCount,
|
|
299
|
+
},
|
|
300
|
+
durationMs: Date.now() - startTime,
|
|
301
|
+
timestamp: new Date(),
|
|
302
|
+
manual,
|
|
303
|
+
};
|
|
304
|
+
this.totalCycles++;
|
|
305
|
+
this.lastRun = result.timestamp;
|
|
306
|
+
this.lastResult = result;
|
|
307
|
+
this.emit('cycle:completed', { result });
|
|
308
|
+
return result;
|
|
309
|
+
}
|
|
310
|
+
catch (error) {
|
|
311
|
+
const err = error instanceof Error ? error : new Error(String(error));
|
|
312
|
+
this.emit('cycle:failed', { error: err, cycleNumber });
|
|
313
|
+
this.emit('error', err);
|
|
314
|
+
throw err;
|
|
315
|
+
}
|
|
316
|
+
}
|
|
317
|
+
/**
|
|
318
|
+
* Get scheduler status
|
|
319
|
+
*/
|
|
320
|
+
getStatus() {
|
|
321
|
+
return {
|
|
322
|
+
running: this.running,
|
|
323
|
+
paused: this.paused,
|
|
324
|
+
cycleStatus: this.cycleManager.getStatus(),
|
|
325
|
+
totalCycles: this.totalCycles,
|
|
326
|
+
consecutiveCycles: this.consecutiveCycles,
|
|
327
|
+
nextRun: this.nextRun,
|
|
328
|
+
lastRun: this.lastRun,
|
|
329
|
+
lastResult: this.lastResult,
|
|
330
|
+
};
|
|
331
|
+
}
|
|
332
|
+
/**
|
|
333
|
+
* Check if scheduler is running
|
|
334
|
+
*/
|
|
335
|
+
isRunning() {
|
|
336
|
+
return this.running;
|
|
337
|
+
}
|
|
338
|
+
/**
|
|
339
|
+
* Check if scheduler is paused
|
|
340
|
+
*/
|
|
341
|
+
isPaused() {
|
|
342
|
+
return this.paused;
|
|
343
|
+
}
|
|
344
|
+
/**
|
|
345
|
+
* Reset the scheduler and cycle manager
|
|
346
|
+
*/
|
|
347
|
+
reset() {
|
|
348
|
+
this.stop();
|
|
349
|
+
this.cycleManager.reset();
|
|
350
|
+
this.totalCycles = 0;
|
|
351
|
+
this.consecutiveCycles = 0;
|
|
352
|
+
this.lastRun = undefined;
|
|
353
|
+
this.lastResult = undefined;
|
|
354
|
+
this.nextRun = undefined;
|
|
355
|
+
}
|
|
356
|
+
/**
|
|
357
|
+
* Update configuration
|
|
358
|
+
*/
|
|
359
|
+
updateConfig(config) {
|
|
360
|
+
const wasRunning = this.running;
|
|
361
|
+
if (wasRunning) {
|
|
362
|
+
this.stop();
|
|
363
|
+
}
|
|
364
|
+
this.config = { ...this.config, ...config };
|
|
365
|
+
// Recreate cycle manager with new config
|
|
366
|
+
this.cycleManager = new CycleManager({
|
|
367
|
+
wakeTaskThreshold: this.config.wakeTaskThreshold,
|
|
368
|
+
maxCycleDuration: this.config.maxCycleDuration,
|
|
369
|
+
minPatternFrequency: this.config.minPatternFrequency,
|
|
370
|
+
mdlThreshold: this.config.mdlThreshold,
|
|
371
|
+
});
|
|
372
|
+
if (wasRunning) {
|
|
373
|
+
this.start();
|
|
374
|
+
}
|
|
375
|
+
}
|
|
376
|
+
/**
|
|
377
|
+
* Get current configuration
|
|
378
|
+
*/
|
|
379
|
+
getConfig() {
|
|
380
|
+
return { ...this.config };
|
|
381
|
+
}
|
|
382
|
+
}
|
|
383
|
+
//# sourceMappingURL=learning-scheduler.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"learning-scheduler.js","sourceRoot":"","sources":["../../src/cycle/learning-scheduler.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,QAAQ,CAAC;AAEtC,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAsElD;;GAEG;AACH,MAAM,CAAC,MAAM,wBAAwB,GAAsC;IACzE,UAAU,EAAE,EAAE,GAAG,EAAE,GAAG,IAAI,EAAE,SAAS;IACrC,SAAS,EAAE,KAAK;IAChB,oBAAoB,EAAE,EAAE;IACxB,eAAe,EAAE,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,IAAI,EAAE,UAAU;IAC/C,gBAAgB,EAAE,CAAC;IACnB,cAAc,EAAE,EAAE;IAClB,iBAAiB,EAAE,EAAE;IACrB,gBAAgB,EAAE,KAAK;IACvB,mBAAmB,EAAE,CAAC;IACtB,YAAY,EAAE,GAAG;CAClB,CAAC;AAEF,+EAA+E;AAC/E,sCAAsC;AACtC,+EAA+E;AAE/E;;;;GAIG;AACH,MAAM,UAAU,mBAAmB,CAAC,UAAkB;IACpD,MAAM,KAAK,GAAG,UAAU,CAAC,IAAI,EAAE,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;IAC7C,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QACvB,OAAO,IAAI,CAAC;IACd,CAAC;IAED,MAAM,CAAC,MAAM,EAAE,IAAI,EAAE,UAAU,EAAE,KAAK,EAAE,SAAS,CA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AE,IAAI,CAAC,MAAM,CAAC,YAAY;SACvC,CAAC,CAAC;QAEH,IAAI,UAAU,EAAE,CAAC;YACf,IAAI,CAAC,KAAK,EAAE,CAAC;QACf,CAAC;IACH,CAAC;IAED;;OAEG;IACH,SAAS;QACP,OAAO,EAAE,GAAG,IAAI,CAAC,MAAM,EAAE,CAAC;IAC5B,CAAC;CACF"}
|
package/dist/index.d.ts
CHANGED
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,cAAc,YAAY,CAAC;AAG3B,cAAc,iBAAiB,CAAC;AAGhC,cAAc,kBAAkB,CAAC;AAGjC,cAAc,kBAAkB,CAAC;AAGjC,cAAc,qBAAqB,CAAC;AAGpC,cAAc,uBAAuB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,cAAc,YAAY,CAAC;AAG3B,cAAc,iBAAiB,CAAC;AAGhC,cAAc,kBAAkB,CAAC;AAGjC,cAAc,kBAAkB,CAAC;AAGjC,cAAc,qBAAqB,CAAC;AAGpC,cAAc,uBAAuB,CAAC;AAGtC,cAAc,iBAAiB,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -16,4 +16,6 @@ export * from './cycle/index.js';
|
|
|
16
16
|
export * from './resource/index.js';
|
|
17
17
|
// Validation (REQ-WAKE-001-F003)
|
|
18
18
|
export * from './validation/index.js';
|
|
19
|
+
// YATA Integration (REQ-YATA-AUTO-004)
|
|
20
|
+
export * from './yata/index.js';
|
|
19
21
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,QAAQ;AACR,cAAc,YAAY,CAAC;AAE3B,4BAA4B;AAC5B,cAAc,iBAAiB,CAAC;AAEhC,6BAA6B;AAC7B,cAAc,kBAAkB,CAAC;AAEjC,+BAA+B;AAC/B,cAAc,kBAAkB,CAAC;AAEjC,kCAAkC;AAClC,cAAc,qBAAqB,CAAC;AAEpC,iCAAiC;AACjC,cAAc,uBAAuB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,QAAQ;AACR,cAAc,YAAY,CAAC;AAE3B,4BAA4B;AAC5B,cAAc,iBAAiB,CAAC;AAEhC,6BAA6B;AAC7B,cAAc,kBAAkB,CAAC;AAEjC,+BAA+B;AAC/B,cAAc,kBAAkB,CAAC;AAEjC,kCAAkC;AAClC,cAAc,qBAAqB,CAAC;AAEpC,iCAAiC;AACjC,cAAc,uBAAuB,CAAC;AAEtC,uCAAuC;AACvC,cAAc,iBAAiB,CAAC"}
|
package/dist/types.d.ts
CHANGED
|
@@ -9,8 +9,13 @@ export interface WakeTask {
|
|
|
9
9
|
id: string;
|
|
10
10
|
type: 'code' | 'requirements' | 'design';
|
|
11
11
|
content: string;
|
|
12
|
+
context?: {
|
|
13
|
+
filePath?: string;
|
|
14
|
+
language?: string;
|
|
15
|
+
project?: string;
|
|
16
|
+
};
|
|
12
17
|
metadata?: Record<string, unknown>;
|
|
13
|
-
timestamp
|
|
18
|
+
timestamp?: string;
|
|
14
19
|
}
|
|
15
20
|
/**
|
|
16
21
|
* Wake phase result
|
package/dist/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;GAEG;AACH,MAAM,WAAW,QAAQ;IACvB,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,GAAG,cAAc,GAAG,QAAQ,CAAC;IACzC,OAAO,EAA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MAAM,WAAW,eAAe;IAC9B,YAAY,EAAE,MAAM,CAAC;IACrB,SAAS,EAAE,MAAM,CAAC;IAClB,YAAY,EAAE,MAAM,CAAC;IACrB,gBAAgB,EAAE,MAAM,CAAC;CAC1B;AAED;;GAEG;AACH,MAAM,WAAW,cAAc;IAC7B,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,MAAM,CAAC;CAClB"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview YATA integration module
|
|
3
|
+
* @traceability REQ-YATA-AUTO-004
|
|
4
|
+
*/
|
|
5
|
+
export { WakeSleepYataIntegrator, createWakeSleepYataIntegrator, type IYataBridge, type WakeEntity, type WakeRelationship, type YataIntegrationResult, } from './yata-integrator.js';
|
|
6
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/yata/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EACL,uBAAuB,EACvB,6BAA6B,EAC7B,KAAK,WAAW,EAChB,KAAK,UAAU,EACf,KAAK,gBAAgB,EACrB,KAAK,qBAAqB,GAC3B,MAAM,sBAAsB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/yata/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EACL,uBAAuB,EACvB,6BAA6B,GAK9B,MAAM,sBAAsB,CAAC"}
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview Wake-Sleep YATA Integration
|
|
3
|
+
* @traceability REQ-YATA-AUTO-004
|
|
4
|
+
*/
|
|
5
|
+
import type { WakeTask, PatternCandidate } from '../types.js';
|
|
6
|
+
/**
|
|
7
|
+
* YATA entity extracted during wake phase
|
|
8
|
+
*/
|
|
9
|
+
export interface WakeEntity {
|
|
10
|
+
type: string;
|
|
11
|
+
name: string;
|
|
12
|
+
namespace: string;
|
|
13
|
+
filePath: string;
|
|
14
|
+
line?: number;
|
|
15
|
+
metadata?: Record<string, unknown>;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* YATA relationship extracted during wake phase
|
|
19
|
+
*/
|
|
20
|
+
export interface WakeRelationship {
|
|
21
|
+
sourceName: string;
|
|
22
|
+
sourceNamespace: string;
|
|
23
|
+
targetName: string;
|
|
24
|
+
targetNamespace: string;
|
|
25
|
+
type: string;
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* Wake-Sleep YATA integration result
|
|
29
|
+
*/
|
|
30
|
+
export interface YataIntegrationResult {
|
|
31
|
+
entities: WakeEntity[];
|
|
32
|
+
relationships: WakeRelationship[];
|
|
33
|
+
patterns: PatternCandidate[];
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* YATA Bridge interface for Wake-Sleep integration
|
|
37
|
+
*/
|
|
38
|
+
export interface IYataBridge {
|
|
39
|
+
updateFromCode(content: string, filePath: string): Promise<{
|
|
40
|
+
success: boolean;
|
|
41
|
+
entitiesAdded: number;
|
|
42
|
+
relationshipsAdded: number;
|
|
43
|
+
errors: string[];
|
|
44
|
+
}>;
|
|
45
|
+
analyzeOnly(content: string, filePath: string): {
|
|
46
|
+
entities: WakeEntity[];
|
|
47
|
+
relationships: WakeRelationship[];
|
|
48
|
+
};
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* Wake-Sleep YATA Integrator
|
|
52
|
+
*
|
|
53
|
+
* Integrates wake-sleep learning with YATA knowledge graph.
|
|
54
|
+
* During wake phase, extracts entities and relationships.
|
|
55
|
+
* During sleep phase, consolidates and persists to YATA.
|
|
56
|
+
*/
|
|
57
|
+
export declare class WakeSleepYataIntegrator {
|
|
58
|
+
private yataBridge;
|
|
59
|
+
private pendingEntities;
|
|
60
|
+
private pendingRelationships;
|
|
61
|
+
private _autoSync;
|
|
62
|
+
constructor(options?: {
|
|
63
|
+
autoSync?: boolean;
|
|
64
|
+
});
|
|
65
|
+
/**
|
|
66
|
+
* Get autoSync setting
|
|
67
|
+
*/
|
|
68
|
+
get autoSync(): boolean;
|
|
69
|
+
/**
|
|
70
|
+
* Connect to YATA bridge
|
|
71
|
+
*/
|
|
72
|
+
connect(bridge: IYataBridge): void;
|
|
73
|
+
/**
|
|
74
|
+
* Disconnect from YATA
|
|
75
|
+
*/
|
|
76
|
+
disconnect(): void;
|
|
77
|
+
/**
|
|
78
|
+
* Check if connected to YATA
|
|
79
|
+
*/
|
|
80
|
+
isConnected(): boolean;
|
|
81
|
+
/**
|
|
82
|
+
* Process task during wake phase
|
|
83
|
+
* Extracts entities without persisting
|
|
84
|
+
*/
|
|
85
|
+
processWakeTask(task: WakeTask): YataIntegrationResult;
|
|
86
|
+
/**
|
|
87
|
+
* Persist during sleep phase
|
|
88
|
+
*/
|
|
89
|
+
persistDuringSleep(): Promise<{
|
|
90
|
+
entitiesPersisted: number;
|
|
91
|
+
relationshipsPersisted: number;
|
|
92
|
+
errors: string[];
|
|
93
|
+
}>;
|
|
94
|
+
/**
|
|
95
|
+
* Get pending counts
|
|
96
|
+
*/
|
|
97
|
+
getPendingCounts(): {
|
|
98
|
+
entities: number;
|
|
99
|
+
relationships: number;
|
|
100
|
+
};
|
|
101
|
+
/**
|
|
102
|
+
* Clear pending without persisting
|
|
103
|
+
*/
|
|
104
|
+
clearPending(): void;
|
|
105
|
+
/**
|
|
106
|
+
* Simple entity extraction (fallback)
|
|
107
|
+
*/
|
|
108
|
+
private extractSimple;
|
|
109
|
+
/**
|
|
110
|
+
* Extract namespace from file path
|
|
111
|
+
*/
|
|
112
|
+
private extractNamespace;
|
|
113
|
+
}
|
|
114
|
+
/**
|
|
115
|
+
* Factory function
|
|
116
|
+
*/
|
|
117
|
+
export declare function createWakeSleepYataIntegrator(options?: {
|
|
118
|
+
autoSync?: boolean;
|
|
119
|
+
}): WakeSleepYataIntegrator;
|
|
120
|
+
//# sourceMappingURL=yata-integrator.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"yata-integrator.d.ts","sourceRoot":"","sources":["../../src/yata/yata-integrator.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,QAAQ,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAE9D;;GAEG;AACH,MAAM,WAAW,UAAU;IACzB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,EAAE,MAAM,CAAC;IACjB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACpC;AAED;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAC/B,UAAU,EAAE,MAAM,CAAC;IACnB,eAAe,EAAE,MAAM,CAAC;IACxB,UAAU,EAAE,MAAM,CAAC;IACnB,eAAe,EAAE,MAAM,CAAC;IACxB,IAAI,EAAE,MAAM,CAAC;CACd;AAED;;GAEG;AACH,MAAM,WAAW,qBAAqB;IACpC,QAAQ,EAAE,UAAU,EAAE,CAAC;IACvB,aAAa,EAAE,gBAAgB,EAAE,CAAC;IAClC,QAAQ,EAAE,gBAAgB,EAAE,CAAC;CAC9B;AAED;;GAEG;AACH,MAAM,WAAW,WAAW;IAC1B,cAAc,CAAC,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC;QACzD,OAAO,EAAE,OAAO,CAAC;QACjB,aAAa,EAAE,MAAM,CAAC;QACtB,kBAAkB,EAAE,MAAM,CAAC;QAC3B,MAAM,EAAE,MAAM,EAAE,CAAC;KAClB,CAAC,CAAC;IACH,WAAW,CAAC,OAAO,EA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-YATA-AUTO-004
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* Wake-Sleep YATA Integrator
|
|
7
|
+
*
|
|
8
|
+
* Integrates wake-sleep learning with YATA knowledge graph.
|
|
9
|
+
* During wake phase, extracts entities and relationships.
|
|
10
|
+
* During sleep phase, consolidates and persists to YATA.
|
|
11
|
+
*/
|
|
12
|
+
export class WakeSleepYataIntegrator {
|
|
13
|
+
yataBridge = null;
|
|
14
|
+
pendingEntities = [];
|
|
15
|
+
pendingRelationships = [];
|
|
16
|
+
_autoSync;
|
|
17
|
+
constructor(options) {
|
|
18
|
+
this._autoSync = options?.autoSync ?? false;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Get autoSync setting
|
|
22
|
+
*/
|
|
23
|
+
get autoSync() {
|
|
24
|
+
return this._autoSync;
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Connect to YATA bridge
|
|
28
|
+
*/
|
|
29
|
+
connect(bridge) {
|
|
30
|
+
this.yataBridge = bridge;
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* Disconnect from YATA
|
|
34
|
+
*/
|
|
35
|
+
disconnect() {
|
|
36
|
+
this.yataBridge = null;
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* Check if connected to YATA
|
|
40
|
+
*/
|
|
41
|
+
isConnected() {
|
|
42
|
+
return this.yataBridge !== null;
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* Process task during wake phase
|
|
46
|
+
* Extracts entities without persisting
|
|
47
|
+
*/
|
|
48
|
+
processWakeTask(task) {
|
|
49
|
+
const result = {
|
|
50
|
+
entities: [],
|
|
51
|
+
relationships: [],
|
|
52
|
+
patterns: [],
|
|
53
|
+
};
|
|
54
|
+
if (task.type !== 'code') {
|
|
55
|
+
return result;
|
|
56
|
+
}
|
|
57
|
+
// Extract entities using simple analysis if bridge not available
|
|
58
|
+
if (this.yataBridge) {
|
|
59
|
+
const analysis = this.yataBridge.analyzeOnly(task.content, task.context?.filePath ?? 'unknown');
|
|
60
|
+
result.entities = analysis.entities;
|
|
61
|
+
result.relationships = analysis.relationships;
|
|
62
|
+
}
|
|
63
|
+
else {
|
|
64
|
+
// Fallback: simple extraction
|
|
65
|
+
const extracted = this.extractSimple(task.content, task.context?.filePath ?? 'unknown');
|
|
66
|
+
result.entities = extracted.entities;
|
|
67
|
+
result.relationships = extracted.relationships;
|
|
68
|
+
}
|
|
69
|
+
// Queue for sleep phase
|
|
70
|
+
this.pendingEntities.push(...result.entities);
|
|
71
|
+
this.pendingRelationships.push(...result.relationships);
|
|
72
|
+
return result;
|
|
73
|
+
}
|
|
74
|
+
/**
|
|
75
|
+
* Persist during sleep phase
|
|
76
|
+
*/
|
|
77
|
+
async persistDuringSleep() {
|
|
78
|
+
const result = {
|
|
79
|
+
entitiesPersisted: 0,
|
|
80
|
+
relationshipsPersisted: 0,
|
|
81
|
+
errors: [],
|
|
82
|
+
};
|
|
83
|
+
if (!this.yataBridge) {
|
|
84
|
+
result.errors.push('YATA bridge not connected');
|
|
85
|
+
return result;
|
|
86
|
+
}
|
|
87
|
+
// Group entities by file for batch processing
|
|
88
|
+
const byFile = new Map();
|
|
89
|
+
for (const entity of this.pendingEntities) {
|
|
90
|
+
const existing = byFile.get(entity.filePath);
|
|
91
|
+
if (existing) {
|
|
92
|
+
existing.entities.push(entity);
|
|
93
|
+
}
|
|
94
|
+
else {
|
|
95
|
+
byFile.set(entity.filePath, {
|
|
96
|
+
content: '', // Content would need to be cached
|
|
97
|
+
entities: [entity],
|
|
98
|
+
});
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
// Note: In real implementation, we'd need to cache content during wake phase
|
|
102
|
+
// For now, mark as processed
|
|
103
|
+
result.entitiesPersisted = this.pendingEntities.length;
|
|
104
|
+
result.relationshipsPersisted = this.pendingRelationships.length;
|
|
105
|
+
// Clear pending
|
|
106
|
+
this.pendingEntities = [];
|
|
107
|
+
this.pendingRelationships = [];
|
|
108
|
+
return result;
|
|
109
|
+
}
|
|
110
|
+
/**
|
|
111
|
+
* Get pending counts
|
|
112
|
+
*/
|
|
113
|
+
getPendingCounts() {
|
|
114
|
+
return {
|
|
115
|
+
entities: this.pendingEntities.length,
|
|
116
|
+
relationships: this.pendingRelationships.length,
|
|
117
|
+
};
|
|
118
|
+
}
|
|
119
|
+
/**
|
|
120
|
+
* Clear pending without persisting
|
|
121
|
+
*/
|
|
122
|
+
clearPending() {
|
|
123
|
+
this.pendingEntities = [];
|
|
124
|
+
this.pendingRelationships = [];
|
|
125
|
+
}
|
|
126
|
+
/**
|
|
127
|
+
* Simple entity extraction (fallback)
|
|
128
|
+
*/
|
|
129
|
+
extractSimple(content, filePath) {
|
|
130
|
+
const entities = [];
|
|
131
|
+
const relationships = [];
|
|
132
|
+
const namespace = this.extractNamespace(filePath);
|
|
133
|
+
const lines = content.split('\n');
|
|
134
|
+
const patterns = [
|
|
135
|
+
{ regex: /^(?:export\s+)?(?:abstract\s+)?class\s+(\w+)/, type: 'class' },
|
|
136
|
+
{ regex: /^(?:export\s+)?interface\s+(\w+)/, type: 'interface' },
|
|
137
|
+
{ regex: /^(?:export\s+)?(?:async\s+)?function\s+(\w+)/, type: 'function' },
|
|
138
|
+
{ regex: /^(?:export\s+)?type\s+(\w+)\s*=/, type: 'type' },
|
|
139
|
+
];
|
|
140
|
+
for (let i = 0; i < lines.length; i++) {
|
|
141
|
+
const trimmed = lines[i].trim();
|
|
142
|
+
for (const { regex, type } of patterns) {
|
|
143
|
+
const match = trimmed.match(regex);
|
|
144
|
+
if (match) {
|
|
145
|
+
entities.push({
|
|
146
|
+
type,
|
|
147
|
+
name: match[1],
|
|
148
|
+
namespace,
|
|
149
|
+
filePath,
|
|
150
|
+
line: i + 1,
|
|
151
|
+
});
|
|
152
|
+
break;
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
return { entities, relationships };
|
|
157
|
+
}
|
|
158
|
+
/**
|
|
159
|
+
* Extract namespace from file path
|
|
160
|
+
*/
|
|
161
|
+
extractNamespace(filePath) {
|
|
162
|
+
const withoutExt = filePath.replace(/\.(ts|tsx|js|jsx)$/, '');
|
|
163
|
+
return withoutExt
|
|
164
|
+
.replace(/^(src|lib|dist)\//, '')
|
|
165
|
+
.replace(/\//g, '.')
|
|
166
|
+
.replace(/^\.+|\.+$/g, '') || 'root';
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
/**
|
|
170
|
+
* Factory function
|
|
171
|
+
*/
|
|
172
|
+
export function createWakeSleepYataIntegrator(options) {
|
|
173
|
+
return new WakeSleepYataIntegrator(options);
|
|
174
|
+
}
|
|
175
|
+
//# sourceMappingURL=yata-integrator.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"yata-integrator.js","sourceRoot":"","sources":["../../src/yata/yata-integrator.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAoDH;;;;;;GAMG;AACH,MAAM,OAAO,uBAAuB;IAC1B,UAAU,GAAuB,IAAI,CAAC;IACtC,eAAe,GAAiB,EAAE,CAAC;IACnC,oBAAoB,GAAuB,EAAE,CAAC;IAC9C,SAAS,CAAU;IAE3B,YAAY,OAAgC;QAC1C,IAAI,CAAC,SAAS,GAAG,OAAO,EAAE,QAAQ,IAAI,KAAK,CAAC;IAC9C,CAAC;IAED;;OAEG;IACH,IAAI,QAAQ;QACV,OAAO,IAAI,CAAC,SAAS,CAAC;IACxB,CAAC;IAED;;OAEG;IACH,OAAO,CAAC,MAAmB;QACzB,IAAI,CAAC,UAAU,GAAG,MAAM,CAAC;IAC3B,CAAC;IAED;;OAEG;IACH,UAAU;QACR,IAAI,CAAC,UAAU,GAAG,IAAI,CAAC;IACzB,CAAC;IAED;;OAEG;IACH,WAAW;QACT,OAAO,IAAI,CAAC,UAAU,KAAK,IAAI,CAAC;IAClC,CAAC;IAED;;;OAGG;IACH,eAAe,CAAC,IAAc;QAC5B,MAAM,MAAM,GAA0B;YACp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