@memtensor/memos-local-openclaw-plugin 0.1.2 → 0.1.4
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/.env.example +13 -5
- package/README.md +180 -68
- package/dist/capture/index.d.ts +5 -7
- package/dist/capture/index.d.ts.map +1 -1
- package/dist/capture/index.js +72 -43
- package/dist/capture/index.js.map +1 -1
- package/dist/ingest/providers/anthropic.d.ts +2 -0
- package/dist/ingest/providers/anthropic.d.ts.map +1 -1
- package/dist/ingest/providers/anthropic.js +110 -1
- package/dist/ingest/providers/anthropic.js.map +1 -1
- package/dist/ingest/providers/bedrock.d.ts +2 -5
- package/dist/ingest/providers/bedrock.d.ts.map +1 -1
- package/dist/ingest/providers/bedrock.js +110 -6
- package/dist/ingest/providers/bedrock.js.map +1 -1
- package/dist/ingest/providers/gemini.d.ts +2 -0
- package/dist/ingest/providers/gemini.d.ts.map +1 -1
- package/dist/ingest/providers/gemini.js +106 -1
- package/dist/ingest/providers/gemini.js.map +1 -1
- package/dist/ingest/providers/index.d.ts +9 -0
- package/dist/ingest/providers/index.d.ts.map +1 -1
- package/dist/ingest/providers/index.js +66 -4
- package/dist/ingest/providers/index.js.map +1 -1
- package/dist/ingest/providers/openai.d.ts +2 -0
- package/dist/ingest/providers/openai.d.ts.map +1 -1
- package/dist/ingest/providers/openai.js +112 -1
- package/dist/ingest/providers/openai.js.map +1 -1
- package/dist/ingest/task-processor.d.ts +63 -0
- package/dist/ingest/task-processor.d.ts.map +1 -0
- package/dist/ingest/task-processor.js +339 -0
- package/dist/ingest/task-processor.js.map +1 -0
- package/dist/ingest/worker.d.ts +1 -1
- package/dist/ingest/worker.d.ts.map +1 -1
- package/dist/ingest/worker.js +18 -13
- package/dist/ingest/worker.js.map +1 -1
- package/dist/recall/engine.d.ts +1 -0
- package/dist/recall/engine.d.ts.map +1 -1
- package/dist/recall/engine.js +21 -11
- package/dist/recall/engine.js.map +1 -1
- package/dist/recall/mmr.d.ts.map +1 -1
- package/dist/recall/mmr.js +3 -1
- package/dist/recall/mmr.js.map +1 -1
- package/dist/storage/sqlite.d.ts +67 -1
- package/dist/storage/sqlite.d.ts.map +1 -1
- package/dist/storage/sqlite.js +251 -5
- package/dist/storage/sqlite.js.map +1 -1
- package/dist/types.d.ts +15 -0
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js +2 -0
- package/dist/types.js.map +1 -1
- package/dist/viewer/html.d.ts +1 -1
- package/dist/viewer/html.d.ts.map +1 -1
- package/dist/viewer/html.js +955 -115
- package/dist/viewer/html.js.map +1 -1
- package/dist/viewer/server.d.ts +3 -0
- package/dist/viewer/server.d.ts.map +1 -1
- package/dist/viewer/server.js +59 -1
- package/dist/viewer/server.js.map +1 -1
- package/index.ts +221 -45
- package/openclaw.plugin.json +20 -45
- package/package.json +3 -4
- package/skill/SKILL.md +59 -0
- package/src/capture/index.ts +85 -45
- package/src/ingest/providers/anthropic.ts +128 -1
- package/src/ingest/providers/bedrock.ts +130 -6
- package/src/ingest/providers/gemini.ts +128 -1
- package/src/ingest/providers/index.ts +74 -8
- package/src/ingest/providers/openai.ts +130 -1
- package/src/ingest/task-processor.ts +380 -0
- package/src/ingest/worker.ts +21 -15
- package/src/recall/engine.ts +22 -12
- package/src/recall/mmr.ts +3 -1
- package/src/storage/sqlite.ts +298 -5
- package/src/types.ts +19 -0
- package/src/viewer/html.ts +955 -115
- package/src/viewer/server.ts +63 -1
- package/SKILL.md +0 -43
- package/www/index.html +0 -606
|
@@ -1,7 +1,74 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.summarizeTaskOpenAI = summarizeTaskOpenAI;
|
|
3
4
|
exports.summarizeOpenAI = summarizeOpenAI;
|
|
4
|
-
|
|
5
|
+
exports.judgeNewTopicOpenAI = judgeNewTopicOpenAI;
|
|
6
|
+
const SYSTEM_PROMPT = `Summarize the text in ONE concise sentence (max 120 characters). IMPORTANT: Use the SAME language as the input text — if the input is Chinese, write Chinese; if English, write English. Preserve exact names, commands, error codes. No bullet points, no preamble — output only the sentence.`;
|
|
7
|
+
const TASK_SUMMARY_PROMPT = `You create a DETAILED task summary from a multi-turn conversation. This summary will be the ONLY record of this conversation, so it must preserve ALL important information.
|
|
8
|
+
|
|
9
|
+
CRITICAL LANGUAGE RULE: You MUST write in the SAME language as the user's messages. Chinese input → Chinese output. English input → English output. NEVER mix languages.
|
|
10
|
+
|
|
11
|
+
Output EXACTLY this structure:
|
|
12
|
+
|
|
13
|
+
📌 Title
|
|
14
|
+
A short, descriptive title (10-30 characters). Like a chat group name.
|
|
15
|
+
|
|
16
|
+
🎯 Goal
|
|
17
|
+
One sentence: what the user wanted to accomplish.
|
|
18
|
+
|
|
19
|
+
📋 Key Steps
|
|
20
|
+
- Describe each meaningful step in detail
|
|
21
|
+
- Include the ACTUAL content produced: code snippets, commands, config blocks, formulas, key paragraphs
|
|
22
|
+
- For code: include the function signature and core logic (up to ~30 lines per block), use fenced code blocks
|
|
23
|
+
- For configs: include the actual config values and structure
|
|
24
|
+
- For lists/instructions: include the actual items, not just "provided a list"
|
|
25
|
+
- Merge only truly trivial back-and-forth (like "ok" / "sure")
|
|
26
|
+
- Do NOT over-summarize: "provided a function" is BAD; show the actual function
|
|
27
|
+
|
|
28
|
+
✅ Result
|
|
29
|
+
What was the final outcome? Include the final version of any code/config/content produced.
|
|
30
|
+
|
|
31
|
+
💡 Key Details
|
|
32
|
+
- Decisions made, trade-offs discussed, caveats noted, alternative approaches mentioned
|
|
33
|
+
- Specific values: numbers, versions, thresholds, URLs, file paths, model names
|
|
34
|
+
- Omit this section only if there truly are no noteworthy details
|
|
35
|
+
|
|
36
|
+
RULES:
|
|
37
|
+
- This summary is a KNOWLEDGE BASE ENTRY, not a brief note. Be thorough.
|
|
38
|
+
- PRESERVE verbatim: code, commands, URLs, file paths, error messages, config values, version numbers, names, amounts
|
|
39
|
+
- DISCARD only: greetings, filler, the assistant explaining what it will do before doing it
|
|
40
|
+
- Replace secrets (API keys, tokens, passwords) with [REDACTED]
|
|
41
|
+
- Target length: 30-50% of the original conversation length. Longer conversations need longer summaries.
|
|
42
|
+
- Output summary only, no preamble.`;
|
|
43
|
+
async function summarizeTaskOpenAI(text, cfg, log) {
|
|
44
|
+
const endpoint = normalizeChatEndpoint(cfg.endpoint ?? "https://api.openai.com/v1/chat/completions");
|
|
45
|
+
const model = cfg.model ?? "gpt-4o-mini";
|
|
46
|
+
const headers = {
|
|
47
|
+
"Content-Type": "application/json",
|
|
48
|
+
Authorization: `Bearer ${cfg.apiKey}`,
|
|
49
|
+
...cfg.headers,
|
|
50
|
+
};
|
|
51
|
+
const resp = await fetch(endpoint, {
|
|
52
|
+
method: "POST",
|
|
53
|
+
headers,
|
|
54
|
+
body: JSON.stringify({
|
|
55
|
+
model,
|
|
56
|
+
temperature: cfg.temperature ?? 0.1,
|
|
57
|
+
max_tokens: 4096,
|
|
58
|
+
messages: [
|
|
59
|
+
{ role: "system", content: TASK_SUMMARY_PROMPT },
|
|
60
|
+
{ role: "user", content: text },
|
|
61
|
+
],
|
|
62
|
+
}),
|
|
63
|
+
signal: AbortSignal.timeout(cfg.timeoutMs ?? 60_000),
|
|
64
|
+
});
|
|
65
|
+
if (!resp.ok) {
|
|
66
|
+
const body = await resp.text();
|
|
67
|
+
throw new Error(`OpenAI task-summarize failed (${resp.status}): ${body}`);
|
|
68
|
+
}
|
|
69
|
+
const json = (await resp.json());
|
|
70
|
+
return json.choices[0]?.message?.content?.trim() ?? "";
|
|
71
|
+
}
|
|
5
72
|
async function summarizeOpenAI(text, cfg, log) {
|
|
6
73
|
const endpoint = normalizeChatEndpoint(cfg.endpoint ?? "https://api.openai.com/v1/chat/completions");
|
|
7
74
|
const model = cfg.model ?? "gpt-4o-mini";
|
|
@@ -30,6 +97,50 @@ async function summarizeOpenAI(text, cfg, log) {
|
|
|
30
97
|
const json = (await resp.json());
|
|
31
98
|
return json.choices[0]?.message?.content?.trim() ?? "";
|
|
32
99
|
}
|
|
100
|
+
const TOPIC_JUDGE_PROMPT = `You are a conversation topic boundary detector. Given a summary of the CURRENT conversation and a NEW user message, determine if the new message starts a DIFFERENT topic/task.
|
|
101
|
+
|
|
102
|
+
Answer ONLY "NEW" or "SAME".
|
|
103
|
+
|
|
104
|
+
Rules:
|
|
105
|
+
- "NEW" = the new message is about a completely different subject, project, or task
|
|
106
|
+
- "SAME" = the new message continues, follows up on, or is closely related to the current topic
|
|
107
|
+
- Follow-up questions, clarifications, refinements, bug fixes, or next steps on the same task = SAME
|
|
108
|
+
- Greetings or meta-questions like "你好" or "谢谢" without new substance = SAME
|
|
109
|
+
- A clearly unrelated request (e.g., current topic is deployment, new message asks about cooking) = NEW
|
|
110
|
+
|
|
111
|
+
Output exactly one word: NEW or SAME`;
|
|
112
|
+
async function judgeNewTopicOpenAI(currentContext, newMessage, cfg, log) {
|
|
113
|
+
const endpoint = normalizeChatEndpoint(cfg.endpoint ?? "https://api.openai.com/v1/chat/completions");
|
|
114
|
+
const model = cfg.model ?? "gpt-4o-mini";
|
|
115
|
+
const headers = {
|
|
116
|
+
"Content-Type": "application/json",
|
|
117
|
+
Authorization: `Bearer ${cfg.apiKey}`,
|
|
118
|
+
...cfg.headers,
|
|
119
|
+
};
|
|
120
|
+
const userContent = `CURRENT CONVERSATION SUMMARY:\n${currentContext}\n\nNEW USER MESSAGE:\n${newMessage}`;
|
|
121
|
+
const resp = await fetch(endpoint, {
|
|
122
|
+
method: "POST",
|
|
123
|
+
headers,
|
|
124
|
+
body: JSON.stringify({
|
|
125
|
+
model,
|
|
126
|
+
temperature: 0,
|
|
127
|
+
max_tokens: 10,
|
|
128
|
+
messages: [
|
|
129
|
+
{ role: "system", content: TOPIC_JUDGE_PROMPT },
|
|
130
|
+
{ role: "user", content: userContent },
|
|
131
|
+
],
|
|
132
|
+
}),
|
|
133
|
+
signal: AbortSignal.timeout(cfg.timeoutMs ?? 15_000),
|
|
134
|
+
});
|
|
135
|
+
if (!resp.ok) {
|
|
136
|
+
const body = await resp.text();
|
|
137
|
+
throw new Error(`OpenAI topic-judge failed (${resp.status}): ${body}`);
|
|
138
|
+
}
|
|
139
|
+
const json = (await resp.json());
|
|
140
|
+
const answer = json.choices[0]?.message?.content?.trim().toUpperCase() ?? "";
|
|
141
|
+
log.debug(`Topic judge result: "${answer}"`);
|
|
142
|
+
return answer.startsWith("NEW");
|
|
143
|
+
}
|
|
33
144
|
function normalizeChatEndpoint(url) {
|
|
34
145
|
const stripped = url.replace(/\/+$/, "");
|
|
35
146
|
if (stripped.endsWith("/chat/completions"))
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"openai.js","sourceRoot":"","sources":["../../../src/ingest/providers/openai.ts"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"openai.js","sourceRoot":"","sources":["../../../src/ingest/providers/openai.ts"],"names":[],"mappings":";;AAyCA,kDAmCC;AAED,0CAoCC;AAeD,kDAwCC;AAvKD,MAAM,aAAa,GAAG,iSAAiS,CAAC;AAExT,MAAM,mBAAmB,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;oCAmCQ,CAAC;AAE9B,KAAK,UAAU,mBAAmB,CACvC,IAAY,EACZ,GAAqB,EACrB,GAAW;IAEX,MAAM,QAAQ,GAAG,qBAAqB,CAAC,GAAG,CAAC,QAAQ,IAAI,4CAA4C,CAAC,CAAC;IACrG,MAAM,KAAK,GAAG,GAAG,CAAC,KAAK,IAAI,aAAa,CAAC;IACzC,MAAM,OAAO,GAA2B;QACtC,cAAc,EAAE,kBAAkB;QAClC,aAAa,EAAE,UAAU,GAAG,CAAC,MAAM,EAAE;QACrC,GAAG,GAAG,CAAC,OAAO;KACf,CAAC;IAEF,MAAM,IAAI,GAAG,MAAM,KAAK,CAAC,QAAQ,EAAE;QACjC,MAAM,EAAE,MAAM;QACd,OAAO;QACP,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC;YACnB,KAAK;YACL,WAAW,EAA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C"}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import type { SqliteStore } from "../storage/sqlite";
|
|
2
|
+
import type { PluginContext, Task } from "../types";
|
|
3
|
+
/**
|
|
4
|
+
* Asynchronous task-level processor.
|
|
5
|
+
*
|
|
6
|
+
* After each ingestion batch, checks whether the current conversation
|
|
7
|
+
* constitutes a "new task" compared to the previous one. If so:
|
|
8
|
+
* 1. Finalizes the previous task (generates a detailed summary).
|
|
9
|
+
* 2. Creates a new active task for incoming chunks.
|
|
10
|
+
*
|
|
11
|
+
* Task boundary detection:
|
|
12
|
+
* - Session change → always new task
|
|
13
|
+
* - Time gap > 2h → always new task
|
|
14
|
+
* - LLM judges whether new user message starts a different topic
|
|
15
|
+
*/
|
|
16
|
+
export declare class TaskProcessor {
|
|
17
|
+
private store;
|
|
18
|
+
private ctx;
|
|
19
|
+
private summarizer;
|
|
20
|
+
private processing;
|
|
21
|
+
constructor(store: SqliteStore, ctx: PluginContext);
|
|
22
|
+
/**
|
|
23
|
+
* Called after new chunks are ingested.
|
|
24
|
+
* Determines if a new task boundary was crossed and handles transition.
|
|
25
|
+
*/
|
|
26
|
+
onChunksIngested(sessionKey: string, latestTimestamp: number): Promise<void>;
|
|
27
|
+
private detectAndProcess;
|
|
28
|
+
private isTaskBoundary;
|
|
29
|
+
/**
|
|
30
|
+
* Build a concise context string from existing task chunks for the LLM topic judge.
|
|
31
|
+
* Takes recent user/assistant summaries to keep token usage low.
|
|
32
|
+
*/
|
|
33
|
+
private buildContextSummary;
|
|
34
|
+
private createNewTask;
|
|
35
|
+
private assignUnassignedChunks;
|
|
36
|
+
finalizeTask(task: Task): Promise<void>;
|
|
37
|
+
/**
|
|
38
|
+
* Determine if a task is too trivial to warrant an LLM summary call.
|
|
39
|
+
* Returns a skip reason string, or null if summary should proceed.
|
|
40
|
+
*
|
|
41
|
+
* Skip conditions (any one triggers skip):
|
|
42
|
+
* 1. Total chunks < 4 — too few messages to form a meaningful task
|
|
43
|
+
* 2. Real conversation turns < 2 — no back-and-forth dialogue
|
|
44
|
+
* 3. No user messages — purely system/tool generated, no user intent
|
|
45
|
+
* 4. Total content < 200 chars — not enough substance
|
|
46
|
+
* 5. User content is trivial/test data — "hello", "test", "ok" etc.
|
|
47
|
+
* 6. All messages are tool results — automated output, no conversation
|
|
48
|
+
* 7. High content repetition — user repeated the same thing (debug loops)
|
|
49
|
+
*/
|
|
50
|
+
private shouldSkipSummary;
|
|
51
|
+
private looksLikeTrivialContent;
|
|
52
|
+
private buildConversationText;
|
|
53
|
+
/**
|
|
54
|
+
* Extract the LLM-generated title from the summary output.
|
|
55
|
+
* The LLM is prompted to output "📌 Title\n<title text>" as the first section.
|
|
56
|
+
* Returns the title and the remaining body (with the title section stripped).
|
|
57
|
+
*/
|
|
58
|
+
private parseTitleFromSummary;
|
|
59
|
+
private extractTitle;
|
|
60
|
+
private humanReadableSkipReason;
|
|
61
|
+
private fallbackSummary;
|
|
62
|
+
}
|
|
63
|
+
//# sourceMappingURL=task-processor.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"task-processor.d.ts","sourceRoot":"","sources":["../../src/ingest/task-processor.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AACrD,OAAO,KAAK,EAAE,aAAa,EAAE,IAAI,EAAS,MAAM,UAAU,CAAC;AAc3D;;;;;;;;;;;;GAYG;AACH,qBAAa,aAAa;IAKtB,OAAO,CAAC,KAAK;IACb,OAAO,CAAC,GAAG;IALb,OAAO,CAAC,UAAU,CAAa;IAC/B,OAAO,CAAC,UAAU,CAAS;gBAGjB,KAAK,EAAE,WAAW,EAClB,GAAG,EAAE,aAAa;IAK5B;;;OAGG;IACG,gBAAgB,CAAC,UAAU,EAAE,MAAM,EAAE,eAAe,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;YAgBpE,gBAAgB;YA+BhB,cAAc;IA2C5B;;;OAGG;IACH,OAAO,CAAC,mBAAmB;YAUb,aAAa;IAiB3B,OAAO,CAAC,sBAAsB;IAUxB,YAAY,CAAC,IAAI,EAAE,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC;IA2C7C;;;;;;;;;;;;OAYG;IACH,OAAO,CAAC,iBAAiB;IA6DzB,OAAO,CAAC,uBAAuB;IAa/B,OAAO,CAAC,qBAAqB;IAS7B;;;;OAIG;IACH,OAAO,CAAC,qBAAqB;IAU7B,OAAO,CAAC,YAAY;IAQpB,OAAO,CAAC,uBAAuB;IA4B/B,OAAO,CAAC,eAAe;CAcxB"}
|
|
@@ -0,0 +1,339 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.TaskProcessor = void 0;
|
|
4
|
+
const uuid_1 = require("uuid");
|
|
5
|
+
const types_1 = require("../types");
|
|
6
|
+
const providers_1 = require("./providers");
|
|
7
|
+
const TRIVIAL_PATTERNS = [
|
|
8
|
+
/^(test|testing|hello|hi|hey|ok|okay|yes|no|yeah|nope|sure|thanks|thank you|thx|ping|pong|哈哈|好的|嗯|是的|不是|谢谢|你好|测试)\s*[.!?。!?]*$/,
|
|
9
|
+
/^(aaa+|bbb+|xxx+|zzz+|123+|asdf+|qwer+|haha+|lol+|hmm+)\s*$/,
|
|
10
|
+
/^[\s\p{P}\p{S}]*$/u,
|
|
11
|
+
];
|
|
12
|
+
const SKIP_REASONS = {
|
|
13
|
+
noChunks: "该任务没有对话内容,已自动跳过。",
|
|
14
|
+
};
|
|
15
|
+
/**
|
|
16
|
+
* Asynchronous task-level processor.
|
|
17
|
+
*
|
|
18
|
+
* After each ingestion batch, checks whether the current conversation
|
|
19
|
+
* constitutes a "new task" compared to the previous one. If so:
|
|
20
|
+
* 1. Finalizes the previous task (generates a detailed summary).
|
|
21
|
+
* 2. Creates a new active task for incoming chunks.
|
|
22
|
+
*
|
|
23
|
+
* Task boundary detection:
|
|
24
|
+
* - Session change → always new task
|
|
25
|
+
* - Time gap > 2h → always new task
|
|
26
|
+
* - LLM judges whether new user message starts a different topic
|
|
27
|
+
*/
|
|
28
|
+
class TaskProcessor {
|
|
29
|
+
store;
|
|
30
|
+
ctx;
|
|
31
|
+
summarizer;
|
|
32
|
+
processing = false;
|
|
33
|
+
constructor(store, ctx) {
|
|
34
|
+
this.store = store;
|
|
35
|
+
this.ctx = ctx;
|
|
36
|
+
this.summarizer = new providers_1.Summarizer(ctx.config.summarizer, ctx.log);
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* Called after new chunks are ingested.
|
|
40
|
+
* Determines if a new task boundary was crossed and handles transition.
|
|
41
|
+
*/
|
|
42
|
+
async onChunksIngested(sessionKey, latestTimestamp) {
|
|
43
|
+
this.ctx.log.debug(`TaskProcessor.onChunksIngested called session=${sessionKey} ts=${latestTimestamp} processing=${this.processing}`);
|
|
44
|
+
if (this.processing) {
|
|
45
|
+
this.ctx.log.debug("TaskProcessor.onChunksIngested skipped — already processing");
|
|
46
|
+
return;
|
|
47
|
+
}
|
|
48
|
+
this.processing = true;
|
|
49
|
+
try {
|
|
50
|
+
await this.detectAndProcess(sessionKey, latestTimestamp);
|
|
51
|
+
}
|
|
52
|
+
catch (err) {
|
|
53
|
+
this.ctx.log.error(`TaskProcessor error: ${err}`);
|
|
54
|
+
}
|
|
55
|
+
finally {
|
|
56
|
+
this.processing = false;
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
async detectAndProcess(sessionKey, latestTimestamp) {
|
|
60
|
+
this.ctx.log.debug(`TaskProcessor.detectAndProcess session=${sessionKey}`);
|
|
61
|
+
// Finalize any active tasks from OTHER sessions (session change = task boundary)
|
|
62
|
+
const allActive = this.store.getAllActiveTasks();
|
|
63
|
+
for (const t of allActive) {
|
|
64
|
+
if (t.sessionKey !== sessionKey) {
|
|
65
|
+
this.ctx.log.info(`Session changed: finalizing task=${t.id} from session=${t.sessionKey}`);
|
|
66
|
+
await this.finalizeTask(t);
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
const activeTask = this.store.getActiveTask(sessionKey);
|
|
70
|
+
this.ctx.log.debug(`TaskProcessor.detectAndProcess activeTask=${activeTask?.id ?? "none"}`);
|
|
71
|
+
if (!activeTask) {
|
|
72
|
+
await this.createNewTask(sessionKey, latestTimestamp);
|
|
73
|
+
return;
|
|
74
|
+
}
|
|
75
|
+
const isNewTask = await this.isTaskBoundary(activeTask, sessionKey, latestTimestamp);
|
|
76
|
+
if (isNewTask) {
|
|
77
|
+
await this.finalizeTask(activeTask);
|
|
78
|
+
await this.createNewTask(sessionKey, latestTimestamp);
|
|
79
|
+
}
|
|
80
|
+
else {
|
|
81
|
+
this.assignUnassignedChunks(sessionKey, activeTask.id);
|
|
82
|
+
this.store.updateTask(activeTask.id, { endedAt: undefined });
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
async isTaskBoundary(activeTask, sessionKey, latestTimestamp) {
|
|
86
|
+
if (activeTask.sessionKey !== sessionKey)
|
|
87
|
+
return true;
|
|
88
|
+
const chunks = this.store.getChunksByTask(activeTask.id);
|
|
89
|
+
if (chunks.length === 0)
|
|
90
|
+
return false;
|
|
91
|
+
const lastChunkTs = Math.max(...chunks.map((c) => c.createdAt));
|
|
92
|
+
const gap = latestTimestamp - lastChunkTs;
|
|
93
|
+
// Hard timeout: always split after 2h regardless of topic
|
|
94
|
+
if (gap > types_1.DEFAULTS.taskIdleTimeoutMs) {
|
|
95
|
+
this.ctx.log.info(`Task boundary: time gap ${Math.round(gap / 60000)}min > ${Math.round(types_1.DEFAULTS.taskIdleTimeoutMs / 60000)}min`);
|
|
96
|
+
return true;
|
|
97
|
+
}
|
|
98
|
+
// LLM topic judgment: build context from existing task and compare with new message
|
|
99
|
+
const newUserChunks = this.store.getUnassignedChunks(sessionKey).filter((c) => c.role === "user");
|
|
100
|
+
if (newUserChunks.length === 0)
|
|
101
|
+
return false;
|
|
102
|
+
const existingUserChunks = chunks.filter((c) => c.role === "user");
|
|
103
|
+
if (existingUserChunks.length === 0)
|
|
104
|
+
return false;
|
|
105
|
+
const currentContext = this.buildContextSummary(chunks);
|
|
106
|
+
const newMessage = newUserChunks.map((c) => c.content).join("\n");
|
|
107
|
+
const isNew = await this.summarizer.judgeNewTopic(currentContext, newMessage);
|
|
108
|
+
if (isNew === null) {
|
|
109
|
+
this.ctx.log.debug("Topic judge unavailable (no LLM configured), keeping current task");
|
|
110
|
+
return false;
|
|
111
|
+
}
|
|
112
|
+
if (isNew) {
|
|
113
|
+
this.ctx.log.info(`Task boundary: LLM judged new topic. New message: "${newMessage.slice(0, 80)}..."`);
|
|
114
|
+
}
|
|
115
|
+
else {
|
|
116
|
+
this.ctx.log.debug(`LLM judged SAME topic, continuing task=${activeTask.id}`);
|
|
117
|
+
}
|
|
118
|
+
return isNew;
|
|
119
|
+
}
|
|
120
|
+
/**
|
|
121
|
+
* Build a concise context string from existing task chunks for the LLM topic judge.
|
|
122
|
+
* Takes recent user/assistant summaries to keep token usage low.
|
|
123
|
+
*/
|
|
124
|
+
buildContextSummary(chunks) {
|
|
125
|
+
const relevant = chunks
|
|
126
|
+
.filter((c) => c.role === "user" || c.role === "assistant")
|
|
127
|
+
.slice(-6);
|
|
128
|
+
return relevant
|
|
129
|
+
.map((c) => `[${c.role === "user" ? "User" : "Assistant"}]: ${c.summary || c.content.slice(0, 150)}`)
|
|
130
|
+
.join("\n");
|
|
131
|
+
}
|
|
132
|
+
async createNewTask(sessionKey, timestamp) {
|
|
133
|
+
const taskId = (0, uuid_1.v4)();
|
|
134
|
+
const task = {
|
|
135
|
+
id: taskId,
|
|
136
|
+
sessionKey,
|
|
137
|
+
title: "",
|
|
138
|
+
summary: "",
|
|
139
|
+
status: "active",
|
|
140
|
+
startedAt: timestamp,
|
|
141
|
+
endedAt: null,
|
|
142
|
+
updatedAt: timestamp,
|
|
143
|
+
};
|
|
144
|
+
this.store.insertTask(task);
|
|
145
|
+
this.assignUnassignedChunks(sessionKey, taskId);
|
|
146
|
+
this.ctx.log.info(`Created new task=${taskId} session=${sessionKey}`);
|
|
147
|
+
}
|
|
148
|
+
assignUnassignedChunks(sessionKey, taskId) {
|
|
149
|
+
const unassigned = this.store.getUnassignedChunks(sessionKey);
|
|
150
|
+
for (const chunk of unassigned) {
|
|
151
|
+
this.store.setChunkTaskId(chunk.id, taskId);
|
|
152
|
+
}
|
|
153
|
+
if (unassigned.length > 0) {
|
|
154
|
+
this.ctx.log.debug(`Assigned ${unassigned.length} chunks to task=${taskId}`);
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
async finalizeTask(task) {
|
|
158
|
+
const chunks = this.store.getChunksByTask(task.id);
|
|
159
|
+
const fallbackTitle = chunks.length > 0 ? this.extractTitle(chunks) : "";
|
|
160
|
+
if (chunks.length === 0) {
|
|
161
|
+
this.ctx.log.info(`Task ${task.id} skipped: no chunks`);
|
|
162
|
+
this.store.updateTask(task.id, { title: fallbackTitle, summary: SKIP_REASONS.noChunks, status: "skipped", endedAt: Date.now() });
|
|
163
|
+
return;
|
|
164
|
+
}
|
|
165
|
+
const skipReason = this.shouldSkipSummary(chunks);
|
|
166
|
+
if (skipReason) {
|
|
167
|
+
this.ctx.log.info(`Task ${task.id} skipped: ${skipReason} (chunks=${chunks.length}, title="${fallbackTitle}")`);
|
|
168
|
+
const reason = this.humanReadableSkipReason(skipReason, chunks);
|
|
169
|
+
this.store.updateTask(task.id, { title: fallbackTitle, summary: reason, status: "skipped", endedAt: Date.now() });
|
|
170
|
+
return;
|
|
171
|
+
}
|
|
172
|
+
const conversationText = this.buildConversationText(chunks);
|
|
173
|
+
let summary;
|
|
174
|
+
try {
|
|
175
|
+
summary = await this.summarizer.summarizeTask(conversationText);
|
|
176
|
+
}
|
|
177
|
+
catch (err) {
|
|
178
|
+
this.ctx.log.warn(`Task summary generation failed for task=${task.id}: ${err}`);
|
|
179
|
+
summary = this.fallbackSummary(chunks);
|
|
180
|
+
}
|
|
181
|
+
const { title: llmTitle, body } = this.parseTitleFromSummary(summary);
|
|
182
|
+
const title = llmTitle || fallbackTitle;
|
|
183
|
+
this.store.updateTask(task.id, {
|
|
184
|
+
title,
|
|
185
|
+
summary: body,
|
|
186
|
+
status: "completed",
|
|
187
|
+
endedAt: Date.now(),
|
|
188
|
+
});
|
|
189
|
+
this.ctx.log.info(`Finalized task=${task.id} title="${title}" chunks=${chunks.length} summaryLen=${body.length}`);
|
|
190
|
+
}
|
|
191
|
+
/**
|
|
192
|
+
* Determine if a task is too trivial to warrant an LLM summary call.
|
|
193
|
+
* Returns a skip reason string, or null if summary should proceed.
|
|
194
|
+
*
|
|
195
|
+
* Skip conditions (any one triggers skip):
|
|
196
|
+
* 1. Total chunks < 4 — too few messages to form a meaningful task
|
|
197
|
+
* 2. Real conversation turns < 2 — no back-and-forth dialogue
|
|
198
|
+
* 3. No user messages — purely system/tool generated, no user intent
|
|
199
|
+
* 4. Total content < 200 chars — not enough substance
|
|
200
|
+
* 5. User content is trivial/test data — "hello", "test", "ok" etc.
|
|
201
|
+
* 6. All messages are tool results — automated output, no conversation
|
|
202
|
+
* 7. High content repetition — user repeated the same thing (debug loops)
|
|
203
|
+
*/
|
|
204
|
+
shouldSkipSummary(chunks) {
|
|
205
|
+
const userChunks = chunks.filter((c) => c.role === "user");
|
|
206
|
+
const assistantChunks = chunks.filter((c) => c.role === "assistant");
|
|
207
|
+
const toolChunks = chunks.filter((c) => c.role === "tool");
|
|
208
|
+
// 1. Too few chunks
|
|
209
|
+
if (chunks.length < 4) {
|
|
210
|
+
return `too few chunks (${chunks.length} < 4 minimum)`;
|
|
211
|
+
}
|
|
212
|
+
// 2. Not enough real conversation turns (need at least 2 user-assistant exchanges)
|
|
213
|
+
const turns = Math.min(userChunks.length, assistantChunks.length);
|
|
214
|
+
if (turns < 2) {
|
|
215
|
+
return `too few conversation turns (${turns} < 2 minimum)`;
|
|
216
|
+
}
|
|
217
|
+
// 3. No user messages at all — purely automated
|
|
218
|
+
if (userChunks.length === 0) {
|
|
219
|
+
return "no user messages — task appears to be automated/system-generated";
|
|
220
|
+
}
|
|
221
|
+
// 4. Total content too short
|
|
222
|
+
// CJK characters carry more info per char, so use a lower threshold
|
|
223
|
+
const totalContentLen = chunks.reduce((sum, c) => sum + c.content.length, 0);
|
|
224
|
+
const hasCJK = /[\u4e00-\u9fff\u3040-\u30ff\uac00-\ud7af]/.test(userChunks[0]?.content ?? "");
|
|
225
|
+
const minContentLen = hasCJK ? 80 : 200;
|
|
226
|
+
if (totalContentLen < minContentLen) {
|
|
227
|
+
return `content too short (${totalContentLen} chars < ${minContentLen} minimum)`;
|
|
228
|
+
}
|
|
229
|
+
// 5. User content is trivial/test data
|
|
230
|
+
const userContent = userChunks.map((c) => c.content).join("\n");
|
|
231
|
+
if (this.looksLikeTrivialContent(userContent)) {
|
|
232
|
+
return "user content appears to be test/trivial data";
|
|
233
|
+
}
|
|
234
|
+
// 6. Assistant content is also trivial (both sides are low-value)
|
|
235
|
+
const assistantContent = assistantChunks.map((c) => c.content).join("\n");
|
|
236
|
+
if (this.looksLikeTrivialContent(userContent + "\n" + assistantContent)) {
|
|
237
|
+
return "conversation content (both user and assistant) appears trivial";
|
|
238
|
+
}
|
|
239
|
+
// 7. Almost all messages are tool results with minimal user interaction
|
|
240
|
+
if (toolChunks.length > 0 && toolChunks.length >= chunks.length * 0.7 && userChunks.length <= 1) {
|
|
241
|
+
return `dominated by tool results (${toolChunks.length}/${chunks.length} chunks) with minimal user input`;
|
|
242
|
+
}
|
|
243
|
+
// 8. High repetition — user keeps saying the same thing
|
|
244
|
+
if (userChunks.length >= 3) {
|
|
245
|
+
const uniqueUserMsgs = new Set(userChunks.map((c) => c.content.trim().toLowerCase()));
|
|
246
|
+
const uniqueRatio = uniqueUserMsgs.size / userChunks.length;
|
|
247
|
+
if (uniqueRatio < 0.4) {
|
|
248
|
+
return `high content repetition (${uniqueUserMsgs.size} unique out of ${userChunks.length} user messages)`;
|
|
249
|
+
}
|
|
250
|
+
}
|
|
251
|
+
return null;
|
|
252
|
+
}
|
|
253
|
+
looksLikeTrivialContent(text) {
|
|
254
|
+
const lines = text.toLowerCase().split(/\n/).map((l) => l.trim()).filter(Boolean);
|
|
255
|
+
if (lines.length === 0)
|
|
256
|
+
return true;
|
|
257
|
+
const trivialCount = lines.filter((line) => {
|
|
258
|
+
if (line.length < 5)
|
|
259
|
+
return true;
|
|
260
|
+
if (TRIVIAL_PATTERNS.some((p) => p.test(line)))
|
|
261
|
+
return true;
|
|
262
|
+
return false;
|
|
263
|
+
}).length;
|
|
264
|
+
return trivialCount / lines.length > 0.7;
|
|
265
|
+
}
|
|
266
|
+
buildConversationText(chunks) {
|
|
267
|
+
const lines = [];
|
|
268
|
+
for (const c of chunks) {
|
|
269
|
+
const roleLabel = c.role === "user" ? "User" : c.role === "assistant" ? "Assistant" : c.role;
|
|
270
|
+
lines.push(`[${roleLabel}]: ${c.content}`);
|
|
271
|
+
}
|
|
272
|
+
return lines.join("\n\n");
|
|
273
|
+
}
|
|
274
|
+
/**
|
|
275
|
+
* Extract the LLM-generated title from the summary output.
|
|
276
|
+
* The LLM is prompted to output "📌 Title\n<title text>" as the first section.
|
|
277
|
+
* Returns the title and the remaining body (with the title section stripped).
|
|
278
|
+
*/
|
|
279
|
+
parseTitleFromSummary(summary) {
|
|
280
|
+
const titleMatch = summary.match(/📌\s*(?:Title|标题)\s*\n(.+)/);
|
|
281
|
+
if (titleMatch) {
|
|
282
|
+
const title = titleMatch[1].trim().slice(0, 80);
|
|
283
|
+
const body = summary.replace(/📌\s*(?:Title|标题)\s*\n.+\n?/, "").trim();
|
|
284
|
+
return { title, body };
|
|
285
|
+
}
|
|
286
|
+
return { title: "", body: summary };
|
|
287
|
+
}
|
|
288
|
+
extractTitle(chunks) {
|
|
289
|
+
const firstUser = chunks.find((c) => c.role === "user");
|
|
290
|
+
if (!firstUser)
|
|
291
|
+
return "Untitled Task";
|
|
292
|
+
const text = firstUser.content.trim();
|
|
293
|
+
if (text.length <= 60)
|
|
294
|
+
return text;
|
|
295
|
+
return text.slice(0, 57) + "...";
|
|
296
|
+
}
|
|
297
|
+
humanReadableSkipReason(reason, chunks) {
|
|
298
|
+
const userCount = chunks.filter((c) => c.role === "user").length;
|
|
299
|
+
const assistantCount = chunks.filter((c) => c.role === "assistant").length;
|
|
300
|
+
if (reason.includes("too few chunks")) {
|
|
301
|
+
return `对话内容过少(${chunks.length} 条消息),不足以生成有效摘要。至少需要 4 条消息。`;
|
|
302
|
+
}
|
|
303
|
+
if (reason.includes("too few conversation turns")) {
|
|
304
|
+
return `对话轮次不足(${Math.min(userCount, assistantCount)} 轮),需要至少 2 轮完整的问答交互才能生成摘要。`;
|
|
305
|
+
}
|
|
306
|
+
if (reason.includes("no user messages")) {
|
|
307
|
+
return "该任务没有用户消息,仅包含系统或工具自动生成的内容。";
|
|
308
|
+
}
|
|
309
|
+
if (reason.includes("content too short")) {
|
|
310
|
+
return "对话内容过短,信息量不足以生成有意义的摘要。";
|
|
311
|
+
}
|
|
312
|
+
if (reason.includes("trivial")) {
|
|
313
|
+
return "对话内容为简单问候或测试数据(如 hello、test、ok),无需生成摘要。";
|
|
314
|
+
}
|
|
315
|
+
if (reason.includes("tool results")) {
|
|
316
|
+
return "该任务主要由工具执行结果组成,缺少足够的用户交互内容。";
|
|
317
|
+
}
|
|
318
|
+
if (reason.includes("repetition")) {
|
|
319
|
+
return "对话中存在大量重复内容,无法提取有效信息生成摘要。";
|
|
320
|
+
}
|
|
321
|
+
return `对话未达到生成摘要的条件:${reason}`;
|
|
322
|
+
}
|
|
323
|
+
fallbackSummary(chunks) {
|
|
324
|
+
const title = this.extractTitle(chunks);
|
|
325
|
+
const summaries = chunks
|
|
326
|
+
.filter((c) => c.summary)
|
|
327
|
+
.map((c) => `- ${c.summary}`);
|
|
328
|
+
const lines = [
|
|
329
|
+
`🎯 Goal`,
|
|
330
|
+
title,
|
|
331
|
+
``,
|
|
332
|
+
`📋 Key Steps`,
|
|
333
|
+
...summaries.slice(0, 20),
|
|
334
|
+
];
|
|
335
|
+
return lines.join("\n");
|
|
336
|
+
}
|
|
337
|
+
}
|
|
338
|
+
exports.TaskProcessor = TaskProcessor;
|
|
339
|
+
//# sourceMappingURL=task-processor.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"task-processor.js","sourceRoot":"","sources":["../../src/ingest/task-processor.ts"],"names":[],"mappings":";;;AAAA,+BAAkC;AAGlC,oCAAoC;AACpC,2CAAyC;AAEzC,MAAM,gBAAgB,GAAG;IACvB,+HAA+H;IAC/H,6DAA6D;IAC7D,oBAAoB;CACrB,CAAC;AAEF,MAAM,YAAY,GAAG;IACnB,QAAQ,EAAE,kBAAkB;CACpB,CAAC;AAEX;;;;;;;;;;;;GAYG;AACH,MAAa,aAAa;IAKd;IACA;IALF,UAAU,CAAa;IACvB,UAAU,GAAG,KAAK,CAAC;IAE3B,YACU,KAAkB,EAClB,GAAkB;QADlB,UAAK,GAAL,KAAK,CAAa;QAClB,QAAG,GAAH,GAAG,CAAe;QAE1B,IAAI,CAAC,UAAU,GAAG,IAAI,sBAAU,CAAC,GAAG,CAAC,MAAM,CAAC,UAAU,EAAE,GAAG,CAAC,GAAG,CAAC,CAAC;IACnE,CAAC;IAED;;;OAGG;IACH,KAAK,CAAC,gBAAgB,CAAC,UAAkB,EAAE,eAAuB;QAChE,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,KAAK,CAAC,iDAAiD,UAAU,OAAO,eAAe,eAAe,IAAI,CAAC,UAAU,EAAE,CAAC,CAAC;QACtI,IAAI,IAAI,CAAC,UAAU,EAAE,CAAC;YACpB,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,KAAK,CAAC,6DAA6D,CAAC,CAAC;YAClF,OAAO;QACT,CAAC;QACD,IAAI,CAAC,UAAU,GAAG,IAAI,CAAC;QACvB,IAAI,CAAC;YACH,MAAM,IAAI,CAAC,gBAAgB,CAAC,UAAU,EAAE,eAAe,CAAC,CAAC;QAC3D,CAAC;QAAC,OAAO,GAAG,EAAE,CAAC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ANGED
|
@@ -6,6 +6,7 @@ export declare class IngestWorker {
|
|
|
6
6
|
private embedder;
|
|
7
7
|
private ctx;
|
|
8
8
|
private summarizer;
|
|
9
|
+
private taskProcessor;
|
|
9
10
|
private queue;
|
|
10
11
|
private processing;
|
|
11
12
|
private flushResolvers;
|
|
@@ -15,7 +16,6 @@ export declare class IngestWorker {
|
|
|
15
16
|
flush(): Promise<void>;
|
|
16
17
|
private processQueue;
|
|
17
18
|
private ingestMessage;
|
|
18
|
-
private ingestToolResult;
|
|
19
19
|
private storeChunk;
|
|
20
20
|
}
|
|
21
21
|
//# sourceMappingURL=worker.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"worker.d.ts","sourceRoot":"","sources":["../../src/ingest/worker.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"worker.d.ts","sourceRoot":"","sources":["../../src/ingest/worker.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,mBAAmB,EAAS,aAAa,EAAE,MAAM,UAAU,CAAC;AAC1E,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AACrD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AAK7C,qBAAa,YAAY;IAQrB,OAAO,CAAC,KAAK;IACb,OAAO,CAAC,QAAQ;IAChB,OAAO,CAAC,GAAG;IATb,OAAO,CAAC,UAAU,CAAa;IAC/B,OAAO,CAAC,aAAa,CAAgB;IACrC,OAAO,CAAC,KAAK,CAA6B;IAC1C,OAAO,CAAC,UAAU,CAAS;IAC3B,OAAO,CAAC,cAAc,CAAyB;gBAGrC,KAAK,EAAE,WAAW,EAClB,QAAQ,EAAE,QAAQ,EAClB,GAAG,EAAE,aAAa;IAM5B,OAAO,CAAC,QAAQ,EAAE,mBAAmB,EAAE,GAAG,IAAI;IAU9C,0DAA0D;IACpD,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;YAOd,YAAY;YA6BZ,aAAa;YAUb,UAAU;CAqDzB"}
|