grov 0.6.16 → 0.6.17
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.
|
@@ -36,18 +36,12 @@ export interface UpdateMemoryInput extends CreateMemoryInput {
|
|
|
36
36
|
/**
|
|
37
37
|
* Convert local Task to CreateMemoryInput for API
|
|
38
38
|
*/
|
|
39
|
-
export declare function taskToMemory(task: Task): CreateMemoryInput;
|
|
39
|
+
export declare function taskToMemory(task: Task, taskType?: 'information' | 'planning' | 'implementation'): CreateMemoryInput;
|
|
40
40
|
/**
|
|
41
41
|
* Prepare sync payload for UPDATE path
|
|
42
42
|
* Merges existing memory with new data based on shouldUpdateMemory result
|
|
43
|
-
*
|
|
44
|
-
* @param existingMemory - The memory that was matched
|
|
45
|
-
* @param newData - Extracted reasoning and decisions from current session
|
|
46
|
-
* @param updateResult - Result from shouldUpdateMemory Haiku call
|
|
47
|
-
* @param task - The current task being synced
|
|
48
|
-
* @returns Payload ready for sync with memory_id for UPDATE
|
|
49
43
|
*/
|
|
50
|
-
export declare function prepareSyncPayload(existingMemory: Memory, newData: ExtractedReasoningAndDecisions, updateResult: ShouldUpdateResult, task: Task): UpdateMemoryInput;
|
|
44
|
+
export declare function prepareSyncPayload(existingMemory: Memory, newData: ExtractedReasoningAndDecisions, updateResult: ShouldUpdateResult, task: Task, taskType?: 'information' | 'planning' | 'implementation'): UpdateMemoryInput;
|
|
51
45
|
/**
|
|
52
46
|
* Check if sync is enabled and configured
|
|
53
47
|
*/
|
|
@@ -12,13 +12,13 @@ const SYNC_CONFIG = {
|
|
|
12
12
|
/**
|
|
13
13
|
* Convert local Task to CreateMemoryInput for API
|
|
14
14
|
*/
|
|
15
|
-
export function taskToMemory(task) {
|
|
15
|
+
export function taskToMemory(task, taskType) {
|
|
16
16
|
return {
|
|
17
17
|
client_task_id: task.id,
|
|
18
18
|
project_path: task.project_path,
|
|
19
19
|
original_query: task.original_query,
|
|
20
20
|
goal: task.goal,
|
|
21
|
-
system_name: task.system_name,
|
|
21
|
+
system_name: task.system_name,
|
|
22
22
|
summary: task.summary,
|
|
23
23
|
reasoning_trace: task.reasoning_trace,
|
|
24
24
|
files_touched: task.files_touched,
|
|
@@ -26,6 +26,7 @@ export function taskToMemory(task) {
|
|
|
26
26
|
constraints: task.constraints,
|
|
27
27
|
tags: task.tags,
|
|
28
28
|
status: task.status,
|
|
29
|
+
task_type: taskType,
|
|
29
30
|
linked_commit: task.linked_commit,
|
|
30
31
|
};
|
|
31
32
|
}
|
|
@@ -38,14 +39,8 @@ function getToday() {
|
|
|
38
39
|
/**
|
|
39
40
|
* Prepare sync payload for UPDATE path
|
|
40
41
|
* Merges existing memory with new data based on shouldUpdateMemory result
|
|
41
|
-
*
|
|
42
|
-
* @param existingMemory - The memory that was matched
|
|
43
|
-
* @param newData - Extracted reasoning and decisions from current session
|
|
44
|
-
* @param updateResult - Result from shouldUpdateMemory Haiku call
|
|
45
|
-
* @param task - The current task being synced
|
|
46
|
-
* @returns Payload ready for sync with memory_id for UPDATE
|
|
47
42
|
*/
|
|
48
|
-
export function prepareSyncPayload(existingMemory, newData, updateResult, task) {
|
|
43
|
+
export function prepareSyncPayload(existingMemory, newData, updateResult, task, taskType) {
|
|
49
44
|
const today = getToday();
|
|
50
45
|
// 1. Get existing decisions with proper typing
|
|
51
46
|
const existingDecisions = (existingMemory.decisions || []);
|
|
@@ -109,18 +104,19 @@ export function prepareSyncPayload(existingMemory, newData, updateResult, task)
|
|
|
109
104
|
const finalReasoningEvolution = reasoningEvolution.slice(-MAX_REASONING_EVOLUTION);
|
|
110
105
|
// 8. Build final payload
|
|
111
106
|
return {
|
|
112
|
-
memory_id: existingMemory.id,
|
|
107
|
+
memory_id: existingMemory.id,
|
|
113
108
|
client_task_id: task.id,
|
|
114
109
|
project_path: task.project_path,
|
|
115
110
|
original_query: task.original_query,
|
|
116
111
|
goal: task.goal,
|
|
117
|
-
system_name: newData.system_name || task.system_name,
|
|
118
|
-
reasoning_trace: newData.reasoning_trace,
|
|
112
|
+
system_name: newData.system_name || task.system_name,
|
|
113
|
+
reasoning_trace: newData.reasoning_trace,
|
|
119
114
|
files_touched: task.files_touched,
|
|
120
115
|
decisions: finalDecisions,
|
|
121
116
|
constraints: task.constraints,
|
|
122
117
|
tags: task.tags,
|
|
123
118
|
status: task.status,
|
|
119
|
+
task_type: taskType,
|
|
124
120
|
linked_commit: task.linked_commit,
|
|
125
121
|
evolution_steps: finalEvolutionSteps,
|
|
126
122
|
reasoning_evolution: finalReasoningEvolution,
|
|
@@ -188,7 +184,7 @@ export async function syncTask(task, extractedData, taskType, headers) {
|
|
|
188
184
|
});
|
|
189
185
|
// Step 2: If no match, INSERT as new memory
|
|
190
186
|
if (!matchResult.match) {
|
|
191
|
-
const memory = taskToMemory(task);
|
|
187
|
+
const memory = taskToMemory(task, taskType);
|
|
192
188
|
const result = await syncMemories(teamId, { memories: [memory] });
|
|
193
189
|
console.log(`[SYNC TO CLOUD] ${taskId} -> INSERT (${taskType || 'unknown'})`);
|
|
194
190
|
return result.synced === 1;
|
|
@@ -197,7 +193,7 @@ export async function syncTask(task, extractedData, taskType, headers) {
|
|
|
197
193
|
const score = matchResult.combined_score?.toFixed(3) || '-';
|
|
198
194
|
// If no extracted data, INSERT anyway
|
|
199
195
|
if (!effectiveExtractedData) {
|
|
200
|
-
const memory = taskToMemory(task);
|
|
196
|
+
const memory = taskToMemory(task, taskType);
|
|
201
197
|
const result = await syncMemories(teamId, { memories: [memory] });
|
|
202
198
|
console.log(`[SYNC TO CLOUD] ${taskId} -> INSERT (${taskType || 'unknown'})`);
|
|
203
199
|
return result.synced === 1;
|
|
@@ -223,7 +219,7 @@ export async function syncTask(task, extractedData, taskType, headers) {
|
|
|
223
219
|
return true;
|
|
224
220
|
}
|
|
225
221
|
// Prepare payload for UPDATE
|
|
226
|
-
const payload = prepareSyncPayload(matchResult.match, effectiveExtractedData, updateResult, task);
|
|
222
|
+
const payload = prepareSyncPayload(matchResult.match, effectiveExtractedData, updateResult, task, taskType);
|
|
227
223
|
// Sync with memory_id for UPDATE path
|
|
228
224
|
const result = await syncMemories(teamId, { memories: [payload] });
|
|
229
225
|
console.log(`[SYNC TO CLOUD] ${taskId} -> UPDATE (${taskType || 'unknown'}) [matched: ${matchedId}]`);
|
|
@@ -269,7 +265,7 @@ export async function syncTasks(tasks) {
|
|
|
269
265
|
};
|
|
270
266
|
}
|
|
271
267
|
// Convert tasks to memories
|
|
272
|
-
const memories = tasks.map(taskToMemory);
|
|
268
|
+
const memories = tasks.map(t => taskToMemory(t));
|
|
273
269
|
// Batch and sync
|
|
274
270
|
const batches = [];
|
|
275
271
|
for (let i = 0; i < memories.length; i += SYNC_CONFIG.batchSize) {
|
package/package.json
CHANGED