@memtensor/memos-local-openclaw-plugin 1.0.6-beta.8 → 1.0.6
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/openclaw.plugin.json +1 -1
- package/package.json +3 -5
- package/prebuilds/darwin-arm64/better_sqlite3.node +0 -0
- package/prebuilds/darwin-x64/better_sqlite3.node +0 -0
- package/prebuilds/linux-x64/better_sqlite3.node +0 -0
- package/prebuilds/win32-x64/better_sqlite3.node +0 -0
- package/scripts/postinstall.cjs +44 -44
- package/skill/memos-memory-guide/SKILL.md +20 -0
- package/src/update-check.ts +2 -7
- package/src/viewer/html.ts +4 -4
- package/src/viewer/server.ts +13 -3
- package/telemetry.credentials.json +5 -0
- package/dist/capture/index.d.ts +0 -26
- package/dist/capture/index.d.ts.map +0 -1
- package/dist/capture/index.js +0 -283
- package/dist/capture/index.js.map +0 -1
- package/dist/client/connector.d.ts +0 -34
- package/dist/client/connector.d.ts.map +0 -1
- package/dist/client/connector.js +0 -381
- package/dist/client/connector.js.map +0 -1
- package/dist/client/hub.d.ts +0 -61
- package/dist/client/hub.d.ts.map +0 -1
- package/dist/client/hub.js +0 -174
- package/dist/client/hub.js.map +0 -1
- package/dist/client/skill-sync.d.ts +0 -36
- package/dist/client/skill-sync.d.ts.map +0 -1
- package/dist/client/skill-sync.js +0 -226
- package/dist/client/skill-sync.js.map +0 -1
- package/dist/config.d.ts +0 -5
- package/dist/config.d.ts.map +0 -1
- package/dist/config.js +0 -171
- package/dist/config.js.map +0 -1
- package/dist/embedding/index.d.ts +0 -14
- package/dist/embedding/index.d.ts.map +0 -1
- package/dist/embedding/index.js +0 -105
- package/dist/embedding/index.js.map +0 -1
- package/dist/embedding/local.d.ts +0 -3
- package/dist/embedding/local.d.ts.map +0 -1
- package/dist/embedding/local.js +0 -66
- package/dist/embedding/local.js.map +0 -1
- package/dist/embedding/providers/cohere.d.ts +0 -4
- package/dist/embedding/providers/cohere.d.ts.map +0 -1
- package/dist/embedding/providers/cohere.js +0 -57
- package/dist/embedding/providers/cohere.js.map +0 -1
- package/dist/embedding/providers/gemini.d.ts +0 -3
- package/dist/embedding/providers/gemini.d.ts.map +0 -1
- package/dist/embedding/providers/gemini.js +0 -31
- package/dist/embedding/providers/gemini.js.map +0 -1
- package/dist/embedding/providers/mistral.d.ts +0 -3
- package/dist/embedding/providers/mistral.d.ts.map +0 -1
- package/dist/embedding/providers/mistral.js +0 -25
- package/dist/embedding/providers/mistral.js.map +0 -1
- package/dist/embedding/providers/openai.d.ts +0 -3
- package/dist/embedding/providers/openai.d.ts.map +0 -1
- package/dist/embedding/providers/openai.js +0 -35
- package/dist/embedding/providers/openai.js.map +0 -1
- package/dist/embedding/providers/voyage.d.ts +0 -3
- package/dist/embedding/providers/voyage.d.ts.map +0 -1
- package/dist/embedding/providers/voyage.js +0 -25
- package/dist/embedding/providers/voyage.js.map +0 -1
- package/dist/hub/auth.d.ts +0 -19
- package/dist/hub/auth.d.ts.map +0 -1
- package/dist/hub/auth.js +0 -70
- package/dist/hub/auth.js.map +0 -1
- package/dist/hub/server.d.ts +0 -52
- package/dist/hub/server.d.ts.map +0 -1
- package/dist/hub/server.js +0 -1197
- package/dist/hub/server.js.map +0 -1
- package/dist/hub/user-manager.d.ts +0 -40
- package/dist/hub/user-manager.d.ts.map +0 -1
- package/dist/hub/user-manager.js +0 -153
- package/dist/hub/user-manager.js.map +0 -1
- package/dist/index.d.ts +0 -46
- package/dist/index.d.ts.map +0 -1
- package/dist/index.js +0 -82
- package/dist/index.js.map +0 -1
- package/dist/ingest/chunker.d.ts +0 -15
- package/dist/ingest/chunker.d.ts.map +0 -1
- package/dist/ingest/chunker.js +0 -192
- package/dist/ingest/chunker.js.map +0 -1
- package/dist/ingest/dedup.d.ts +0 -19
- package/dist/ingest/dedup.d.ts.map +0 -1
- package/dist/ingest/dedup.js +0 -50
- package/dist/ingest/dedup.js.map +0 -1
- package/dist/ingest/providers/anthropic.d.ts +0 -21
- package/dist/ingest/providers/anthropic.d.ts.map +0 -1
- package/dist/ingest/providers/anthropic.js +0 -314
- package/dist/ingest/providers/anthropic.js.map +0 -1
- package/dist/ingest/providers/bedrock.d.ts +0 -21
- package/dist/ingest/providers/bedrock.d.ts.map +0 -1
- package/dist/ingest/providers/bedrock.js +0 -313
- package/dist/ingest/providers/bedrock.js.map +0 -1
- package/dist/ingest/providers/gemini.d.ts +0 -21
- package/dist/ingest/providers/gemini.d.ts.map +0 -1
- package/dist/ingest/providers/gemini.js +0 -298
- package/dist/ingest/providers/gemini.js.map +0 -1
- package/dist/ingest/providers/index.d.ts +0 -68
- package/dist/ingest/providers/index.d.ts.map +0 -1
- package/dist/ingest/providers/index.js +0 -611
- package/dist/ingest/providers/index.js.map +0 -1
- package/dist/ingest/providers/openai.d.ts +0 -30
- package/dist/ingest/providers/openai.d.ts.map +0 -1
- package/dist/ingest/providers/openai.js +0 -387
- package/dist/ingest/providers/openai.js.map +0 -1
- package/dist/ingest/task-processor.d.ts +0 -91
- package/dist/ingest/task-processor.d.ts.map +0 -1
- package/dist/ingest/task-processor.js +0 -478
- package/dist/ingest/task-processor.js.map +0 -1
- package/dist/ingest/worker.d.ts +0 -23
- package/dist/ingest/worker.d.ts.map +0 -1
- package/dist/ingest/worker.js +0 -255
- package/dist/ingest/worker.js.map +0 -1
- package/dist/openclaw-api.d.ts +0 -53
- package/dist/openclaw-api.d.ts.map +0 -1
- package/dist/openclaw-api.js +0 -189
- package/dist/openclaw-api.js.map +0 -1
- package/dist/recall/engine.d.ts +0 -28
- package/dist/recall/engine.d.ts.map +0 -1
- package/dist/recall/engine.js +0 -343
- package/dist/recall/engine.js.map +0 -1
- package/dist/recall/mmr.d.ts +0 -17
- package/dist/recall/mmr.d.ts.map +0 -1
- package/dist/recall/mmr.js +0 -53
- package/dist/recall/mmr.js.map +0 -1
- package/dist/recall/recency.d.ts +0 -20
- package/dist/recall/recency.d.ts.map +0 -1
- package/dist/recall/recency.js +0 -26
- package/dist/recall/recency.js.map +0 -1
- package/dist/recall/rrf.d.ts +0 -16
- package/dist/recall/rrf.d.ts.map +0 -1
- package/dist/recall/rrf.js +0 -15
- package/dist/recall/rrf.js.map +0 -1
- package/dist/shared/llm-call.d.ts +0 -30
- package/dist/shared/llm-call.d.ts.map +0 -1
- package/dist/shared/llm-call.js +0 -253
- package/dist/shared/llm-call.js.map +0 -1
- package/dist/sharing/types.contract.d.ts +0 -2
- package/dist/sharing/types.contract.d.ts.map +0 -1
- package/dist/sharing/types.contract.js +0 -3
- package/dist/sharing/types.contract.js.map +0 -1
- package/dist/sharing/types.d.ts +0 -80
- package/dist/sharing/types.d.ts.map +0 -1
- package/dist/sharing/types.js +0 -3
- package/dist/sharing/types.js.map +0 -1
- package/dist/skill/bundled-memory-guide.d.ts +0 -2
- package/dist/skill/bundled-memory-guide.d.ts.map +0 -1
- package/dist/skill/bundled-memory-guide.js +0 -45
- package/dist/skill/bundled-memory-guide.js.map +0 -1
- package/dist/skill/evaluator.d.ts +0 -28
- package/dist/skill/evaluator.d.ts.map +0 -1
- package/dist/skill/evaluator.js +0 -169
- package/dist/skill/evaluator.js.map +0 -1
- package/dist/skill/evolver.d.ts +0 -48
- package/dist/skill/evolver.d.ts.map +0 -1
- package/dist/skill/evolver.js +0 -406
- package/dist/skill/evolver.js.map +0 -1
- package/dist/skill/generator.d.ts +0 -26
- package/dist/skill/generator.d.ts.map +0 -1
- package/dist/skill/generator.js +0 -521
- package/dist/skill/generator.js.map +0 -1
- package/dist/skill/installer.d.ts +0 -42
- package/dist/skill/installer.d.ts.map +0 -1
- package/dist/skill/installer.js +0 -165
- package/dist/skill/installer.js.map +0 -1
- package/dist/skill/upgrader.d.ts +0 -19
- package/dist/skill/upgrader.d.ts.map +0 -1
- package/dist/skill/upgrader.js +0 -366
- package/dist/skill/upgrader.js.map +0 -1
- package/dist/skill/validator.d.ts +0 -30
- package/dist/skill/validator.d.ts.map +0 -1
- package/dist/skill/validator.js +0 -272
- package/dist/skill/validator.js.map +0 -1
- package/dist/storage/ensure-binding.d.ts +0 -12
- package/dist/storage/ensure-binding.d.ts.map +0 -1
- package/dist/storage/ensure-binding.js +0 -53
- package/dist/storage/ensure-binding.js.map +0 -1
- package/dist/storage/sqlite.d.ts +0 -649
- package/dist/storage/sqlite.d.ts.map +0 -1
- package/dist/storage/sqlite.js +0 -2657
- package/dist/storage/sqlite.js.map +0 -1
- package/dist/storage/vector.d.ts +0 -12
- package/dist/storage/vector.d.ts.map +0 -1
- package/dist/storage/vector.js +0 -34
- package/dist/storage/vector.js.map +0 -1
- package/dist/telemetry.d.ts +0 -47
- package/dist/telemetry.d.ts.map +0 -1
- package/dist/telemetry.js +0 -312
- package/dist/telemetry.js.map +0 -1
- package/dist/tools/index.d.ts +0 -5
- package/dist/tools/index.d.ts.map +0 -1
- package/dist/tools/index.js +0 -12
- package/dist/tools/index.js.map +0 -1
- package/dist/tools/memory-get.d.ts +0 -4
- package/dist/tools/memory-get.d.ts.map +0 -1
- package/dist/tools/memory-get.js +0 -64
- package/dist/tools/memory-get.js.map +0 -1
- package/dist/tools/memory-search.d.ts +0 -7
- package/dist/tools/memory-search.d.ts.map +0 -1
- package/dist/tools/memory-search.js +0 -84
- package/dist/tools/memory-search.js.map +0 -1
- package/dist/tools/memory-timeline.d.ts +0 -4
- package/dist/tools/memory-timeline.d.ts.map +0 -1
- package/dist/tools/memory-timeline.js +0 -73
- package/dist/tools/memory-timeline.js.map +0 -1
- package/dist/tools/network-memory-detail.d.ts +0 -4
- package/dist/tools/network-memory-detail.d.ts.map +0 -1
- package/dist/tools/network-memory-detail.js +0 -34
- package/dist/tools/network-memory-detail.js.map +0 -1
- package/dist/types.d.ts +0 -330
- package/dist/types.d.ts.map +0 -1
- package/dist/types.js +0 -38
- package/dist/types.js.map +0 -1
- package/dist/update-check.d.ts +0 -21
- package/dist/update-check.d.ts.map +0 -1
- package/dist/update-check.js +0 -110
- package/dist/update-check.js.map +0 -1
- package/dist/viewer/html.d.ts +0 -2
- package/dist/viewer/html.d.ts.map +0 -1
- package/dist/viewer/html.js +0 -9168
- package/dist/viewer/html.js.map +0 -1
- package/dist/viewer/server.d.ts +0 -205
- package/dist/viewer/server.d.ts.map +0 -1
- package/dist/viewer/server.js +0 -4876
- package/dist/viewer/server.js.map +0 -1
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import type { SummarizerConfig, Logger } from "../../types";
|
|
2
|
-
export declare function summarizeTaskOpenAI(text: string, cfg: SummarizerConfig, log: Logger): Promise<string>;
|
|
3
|
-
export declare function generateTaskTitleOpenAI(text: string, cfg: SummarizerConfig, log: Logger): Promise<string>;
|
|
4
|
-
export declare function summarizeOpenAI(text: string, cfg: SummarizerConfig, log: Logger): Promise<string>;
|
|
5
|
-
export declare function judgeNewTopicOpenAI(currentContext: string, newMessage: string, cfg: SummarizerConfig, log: Logger): Promise<boolean>;
|
|
6
|
-
export interface FilterResult {
|
|
7
|
-
relevant: number[];
|
|
8
|
-
sufficient: boolean;
|
|
9
|
-
}
|
|
10
|
-
export declare function filterRelevantOpenAI(query: string, candidates: Array<{
|
|
11
|
-
index: number;
|
|
12
|
-
role: string;
|
|
13
|
-
content: string;
|
|
14
|
-
time?: string;
|
|
15
|
-
}>, cfg: SummarizerConfig, log: Logger): Promise<FilterResult>;
|
|
16
|
-
export declare function parseFilterResult(raw: string, log: Logger): FilterResult;
|
|
17
|
-
export declare const DEDUP_JUDGE_PROMPT = "You are a memory deduplication system.\n\nLANGUAGE RULE (MUST FOLLOW): You MUST reply in the SAME language as the input memories. \u5982\u679C\u8F93\u5165\u662F\u4E2D\u6587\uFF0Creason \u548C mergedSummary \u5FC5\u987B\u7528\u4E2D\u6587\u3002If input is English, reply in English. This applies to ALL text fields in your JSON output.\n\nGiven a NEW memory summary and several EXISTING memory summaries, determine the relationship.\n\nFor each EXISTING memory, the NEW memory is either:\n- \"DUPLICATE\": NEW conveys the same intent/meaning as an EXISTING memory, even if worded differently. Examples: \"\u8BF7\u544A\u8BC9\u6211\u4F60\u7684\u540D\u5B57\" vs \"\u4F60\u5E0C\u671B\u6211\u600E\u4E48\u79F0\u547C\u4F60\"; \"\u65B0\u4F1A\u8BDD\u5DF2\u5F00\u59CB\" vs \"New session started\"; greetings with minor variations. If the core information/intent is the same, it IS a duplicate.\n- \"UPDATE\": NEW contains meaningful additional information that supplements an EXISTING memory (new data, status change, concrete detail not present before)\n- \"NEW\": NEW covers a genuinely different topic/event with no semantic overlap\n\nIMPORTANT: Lean toward DUPLICATE when memories share the same intent, topic, or factual content. Only choose NEW when the topics are truly unrelated. Repetitive conversational patterns (greetings, session starts, identity questions, capability descriptions) across different sessions should be treated as DUPLICATE.\n\nPick the BEST match among all candidates. If none match well, choose \"NEW\".\n\nOutput a single JSON object (reason and mergedSummary MUST match input language):\n- If DUPLICATE: {\"action\":\"DUPLICATE\",\"targetIndex\":2,\"reason\":\"\u4E0E\u5DF2\u6709\u8BB0\u5FC6\u610F\u56FE\u76F8\u540C\"}\n- If UPDATE: {\"action\":\"UPDATE\",\"targetIndex\":3,\"reason\":\"\u65B0\u8BB0\u5FC6\u8865\u5145\u4E86\u989D\u5916\u7EC6\u8282\",\"mergedSummary\":\"\u5408\u5E76\u540E\u7684\u5B8C\u6574\u6458\u8981\uFF0C\u4FDD\u7559\u65B0\u65E7\u6240\u6709\u4FE1\u606F\"}\n- If NEW: {\"action\":\"NEW\",\"reason\":\"\u4E0D\u540C\u4E3B\u9898\uFF0C\u65E0\u5173\u8054\"}\n\nOutput ONLY the JSON object, no other text.";
|
|
18
|
-
export interface DedupResult {
|
|
19
|
-
action: "DUPLICATE" | "UPDATE" | "NEW";
|
|
20
|
-
targetIndex?: number;
|
|
21
|
-
reason: string;
|
|
22
|
-
mergedSummary?: string;
|
|
23
|
-
}
|
|
24
|
-
export declare function judgeDedupOpenAI(newSummary: string, candidates: Array<{
|
|
25
|
-
index: number;
|
|
26
|
-
summary: string;
|
|
27
|
-
chunkId: string;
|
|
28
|
-
}>, cfg: SummarizerConfig, log: Logger): Promise<DedupResult>;
|
|
29
|
-
export declare function parseDedupResult(raw: string, log: Logger): DedupResult;
|
|
30
|
-
//# sourceMappingURL=openai.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"openai.d.ts","sourceRoot":"","sources":["../../../src/ingest/providers/openai.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAwD5D,wBAAsB,mBAAmB,CACvC,IAAI,EAAE,MAAM,EACZ,GAAG,EAAE,gBAAgB,EACrB,GAAG,EAAE,MAAM,GACV,OAAO,CAAC,MAAM,CAAC,CA+BjB;AAcD,wBAAsB,uBAAuB,CAC3C,IAAI,EAAE,MAAM,EACZ,GAAG,EAAE,gBAAgB,EACrB,GAAG,EAAE,MAAM,GACV,OAAO,CAAC,MAAM,CAAC,CA+BjB;AAED,wBAAsB,eAAe,CACnC,IAAI,EAAE,MAAM,EACZ,GAAG,EAAE,gBAAgB,EACrB,GAAG,EAAE,MAAM,GACV,OAAO,CAAC,MAAM,CAAC,CAgCjB;AA4BD,wBAAsB,mBAAmB,CACvC,cAAc,EAAE,MAAM,EACtB,UAAU,EAAE,MAAM,EAClB,GAAG,EAAE,gBAAgB,EACrB,GAAG,EAAE,MAAM,GACV,OAAO,CAAC,OAAO,CAAC,CAmClB;AAqBD,MAAM,WAAW,YAAY;IAC3B,QAAQ,EAAE,MAAM,EAAE,CAAC;IACnB,UAAU,EAAE,OAAO,CAAC;CACrB;AAED,wBAAsB,oBAAoB,CACxC,KAAK,EAAE,MAAM,EACb,UAAU,EAAE,KAAK,CAAC;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,MAAM,CAAC;IAAC,IAAI,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC,EAClF,GAAG,EAAE,gBAAgB,EACrB,GAAG,EAAE,MAAM,GACV,OAAO,CAAC,YAAY,CAAC,CAwCvB;AAED,wBAAgB,iBAAiB,CAAC,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,YAAY,CAexE;AAID,eAAO,MAAM,kBAAkB,imEAoBa,CAAC;AAE7C,MAAM,WAAW,WAAW;IAC1B,MAAM,EAAE,WAAW,GAAG,QAAQ,GAAG,KAAK,CAAC;IACvC,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,MAAM,EAAE,MAAM,CAAC;IACf,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAED,wBAAsB,gBAAgB,CACpC,UAAU,EAAE,MAAM,EAClB,UAAU,EAAE,KAAK,CAAC;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAAE,CAAC,EACtE,GAAG,EAAE,gBAAgB,EACrB,GAAG,EAAE,MAAM,GACV,OAAO,CAAC,WAAW,CAAC,CAoCtB;AAED,wBAAgB,gBAAgB,CAAC,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,WAAW,CAiBtE"}
|
|
@@ -1,387 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.DEDUP_JUDGE_PROMPT = void 0;
|
|
4
|
-
exports.summarizeTaskOpenAI = summarizeTaskOpenAI;
|
|
5
|
-
exports.generateTaskTitleOpenAI = generateTaskTitleOpenAI;
|
|
6
|
-
exports.summarizeOpenAI = summarizeOpenAI;
|
|
7
|
-
exports.judgeNewTopicOpenAI = judgeNewTopicOpenAI;
|
|
8
|
-
exports.filterRelevantOpenAI = filterRelevantOpenAI;
|
|
9
|
-
exports.parseFilterResult = parseFilterResult;
|
|
10
|
-
exports.judgeDedupOpenAI = judgeDedupOpenAI;
|
|
11
|
-
exports.parseDedupResult = parseDedupResult;
|
|
12
|
-
const SYSTEM_PROMPT = `You generate a retrieval-friendly title.
|
|
13
|
-
|
|
14
|
-
Return exactly one noun phrase that names the topic AND its key details.
|
|
15
|
-
|
|
16
|
-
Requirements:
|
|
17
|
-
- Same language as input
|
|
18
|
-
- Keep proper nouns, API/function names, specific parameters, versions, error codes
|
|
19
|
-
- Include WHO/WHAT/WHERE details when present (e.g. person name + event, tool name + what it does)
|
|
20
|
-
- Prefer concrete topic words over generic words
|
|
21
|
-
- No verbs unless unavoidable
|
|
22
|
-
- No generic endings like:
|
|
23
|
-
功能说明、使用说明、简介、介绍、用途、summary、overview、basics
|
|
24
|
-
- Chinese: 10-50 characters (aim for 15-30)
|
|
25
|
-
- Non-Chinese: 5-15 words (aim for 8-12)
|
|
26
|
-
- Output title only`;
|
|
27
|
-
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.
|
|
28
|
-
|
|
29
|
-
## LANGUAGE RULE (HIGHEST PRIORITY)
|
|
30
|
-
Detect the PRIMARY language of the user's messages. If most user messages are Chinese, ALL output (title, goal, steps, result, details) MUST be in Chinese. If English, output in English. NEVER mix. This rule overrides everything below.
|
|
31
|
-
|
|
32
|
-
Output EXACTLY this structure:
|
|
33
|
-
|
|
34
|
-
📌 Title / 标题
|
|
35
|
-
A short, descriptive title (10-30 characters). Same language as user messages.
|
|
36
|
-
|
|
37
|
-
🎯 Goal / 目标
|
|
38
|
-
One sentence: what the user wanted to accomplish.
|
|
39
|
-
|
|
40
|
-
📋 Key Steps / 关键步骤
|
|
41
|
-
- Describe each meaningful step in detail
|
|
42
|
-
- Include the ACTUAL content produced: code snippets, commands, config blocks, formulas, key paragraphs
|
|
43
|
-
- For code: include the function signature and core logic (up to ~30 lines per block), use fenced code blocks
|
|
44
|
-
- For configs: include the actual config values and structure
|
|
45
|
-
- For lists/instructions: include the actual items, not just "provided a list"
|
|
46
|
-
- Merge only truly trivial back-and-forth (like "ok" / "sure")
|
|
47
|
-
- Do NOT over-summarize: "provided a function" is BAD; show the actual function
|
|
48
|
-
|
|
49
|
-
✅ Result / 结果
|
|
50
|
-
What was the final outcome? Include the final version of any code/config/content produced.
|
|
51
|
-
|
|
52
|
-
💡 Key Details / 关键细节
|
|
53
|
-
- Decisions made, trade-offs discussed, caveats noted, alternative approaches mentioned
|
|
54
|
-
- Specific values: numbers, versions, thresholds, URLs, file paths, model names
|
|
55
|
-
- Omit this section only if there truly are no noteworthy details
|
|
56
|
-
|
|
57
|
-
RULES:
|
|
58
|
-
- This summary is a KNOWLEDGE BASE ENTRY, not a brief note. Be thorough.
|
|
59
|
-
- PRESERVE verbatim: code, commands, URLs, file paths, error messages, config values, version numbers, names, amounts
|
|
60
|
-
- DISCARD only: greetings, filler, the assistant explaining what it will do before doing it
|
|
61
|
-
- Replace secrets (API keys, tokens, passwords) with [REDACTED]
|
|
62
|
-
- Target length: 30-50% of the original conversation length. Longer conversations need longer summaries.
|
|
63
|
-
- Output summary only, no preamble.`;
|
|
64
|
-
async function summarizeTaskOpenAI(text, cfg, log) {
|
|
65
|
-
const endpoint = normalizeChatEndpoint(cfg.endpoint ?? "https://api.openai.com/v1/chat/completions");
|
|
66
|
-
const model = cfg.model ?? "gpt-4o-mini";
|
|
67
|
-
const headers = {
|
|
68
|
-
"Content-Type": "application/json",
|
|
69
|
-
Authorization: `Bearer ${cfg.apiKey}`,
|
|
70
|
-
...cfg.headers,
|
|
71
|
-
};
|
|
72
|
-
const resp = await fetch(endpoint, {
|
|
73
|
-
method: "POST",
|
|
74
|
-
headers,
|
|
75
|
-
body: JSON.stringify(buildRequestBody(cfg, {
|
|
76
|
-
model,
|
|
77
|
-
temperature: cfg.temperature ?? 0.1,
|
|
78
|
-
max_tokens: 4096,
|
|
79
|
-
messages: [
|
|
80
|
-
{ role: "system", content: TASK_SUMMARY_PROMPT },
|
|
81
|
-
{ role: "user", content: text },
|
|
82
|
-
],
|
|
83
|
-
})),
|
|
84
|
-
signal: AbortSignal.timeout(cfg.timeoutMs ?? 60_000),
|
|
85
|
-
});
|
|
86
|
-
if (!resp.ok) {
|
|
87
|
-
const body = await resp.text();
|
|
88
|
-
throw new Error(`OpenAI task-summarize failed (${resp.status}): ${body}`);
|
|
89
|
-
}
|
|
90
|
-
const json = (await resp.json());
|
|
91
|
-
return json.choices[0]?.message?.content?.trim() ?? "";
|
|
92
|
-
}
|
|
93
|
-
const TASK_TITLE_PROMPT = `Generate a short title for a conversation task.
|
|
94
|
-
|
|
95
|
-
Input: the first few user messages from a conversation.
|
|
96
|
-
Output: a concise title (5-20 characters for Chinese, 3-8 words for English).
|
|
97
|
-
|
|
98
|
-
Rules:
|
|
99
|
-
- Same language as user messages
|
|
100
|
-
- Describe WHAT the user wanted to do, not system/technical details
|
|
101
|
-
- Ignore system prompts, session startup messages, or boilerplate instructions — focus on the user's actual intent
|
|
102
|
-
- If the user only asked one question, use that question as the title (shortened if needed)
|
|
103
|
-
- Output the title only, no quotes, no prefix, no explanation`;
|
|
104
|
-
async function generateTaskTitleOpenAI(text, cfg, log) {
|
|
105
|
-
const endpoint = normalizeChatEndpoint(cfg.endpoint ?? "https://api.openai.com/v1/chat/completions");
|
|
106
|
-
const model = cfg.model ?? "gpt-4o-mini";
|
|
107
|
-
const headers = {
|
|
108
|
-
"Content-Type": "application/json",
|
|
109
|
-
Authorization: `Bearer ${cfg.apiKey}`,
|
|
110
|
-
...cfg.headers,
|
|
111
|
-
};
|
|
112
|
-
const resp = await fetch(endpoint, {
|
|
113
|
-
method: "POST",
|
|
114
|
-
headers,
|
|
115
|
-
body: JSON.stringify(buildRequestBody(cfg, {
|
|
116
|
-
model,
|
|
117
|
-
temperature: 0,
|
|
118
|
-
max_tokens: 100,
|
|
119
|
-
messages: [
|
|
120
|
-
{ role: "system", content: TASK_TITLE_PROMPT },
|
|
121
|
-
{ role: "user", content: text },
|
|
122
|
-
],
|
|
123
|
-
})),
|
|
124
|
-
signal: AbortSignal.timeout(cfg.timeoutMs ?? 15_000),
|
|
125
|
-
});
|
|
126
|
-
if (!resp.ok) {
|
|
127
|
-
const body = await resp.text();
|
|
128
|
-
throw new Error(`OpenAI task-title failed (${resp.status}): ${body}`);
|
|
129
|
-
}
|
|
130
|
-
const json = (await resp.json());
|
|
131
|
-
return json.choices[0]?.message?.content?.trim() ?? "";
|
|
132
|
-
}
|
|
133
|
-
async function summarizeOpenAI(text, cfg, log) {
|
|
134
|
-
const endpoint = normalizeChatEndpoint(cfg.endpoint ?? "https://api.openai.com/v1/chat/completions");
|
|
135
|
-
const model = cfg.model ?? "gpt-4o-mini";
|
|
136
|
-
const headers = {
|
|
137
|
-
"Content-Type": "application/json",
|
|
138
|
-
Authorization: `Bearer ${cfg.apiKey}`,
|
|
139
|
-
...cfg.headers,
|
|
140
|
-
};
|
|
141
|
-
const resp = await fetch(endpoint, {
|
|
142
|
-
method: "POST",
|
|
143
|
-
headers,
|
|
144
|
-
body: JSON.stringify(buildRequestBody(cfg, {
|
|
145
|
-
model,
|
|
146
|
-
temperature: cfg.temperature ?? 0,
|
|
147
|
-
messages: [
|
|
148
|
-
{ role: "system", content: SYSTEM_PROMPT },
|
|
149
|
-
{ role: "user", content: `[TEXT TO SUMMARIZE]\n${text}\n[/TEXT TO SUMMARIZE]` },
|
|
150
|
-
],
|
|
151
|
-
})),
|
|
152
|
-
signal: AbortSignal.timeout(cfg.timeoutMs ?? 30_000),
|
|
153
|
-
});
|
|
154
|
-
if (!resp.ok) {
|
|
155
|
-
const body = await resp.text();
|
|
156
|
-
throw new Error(`OpenAI summarize failed (${resp.status}): ${body}`);
|
|
157
|
-
}
|
|
158
|
-
const json = (await resp.json());
|
|
159
|
-
return json.choices[0]?.message?.content?.trim() ?? "";
|
|
160
|
-
}
|
|
161
|
-
const TOPIC_JUDGE_PROMPT = `You are a conversation topic boundary detector. Given the CURRENT task context and a NEW user message, decide if the new message belongs to the SAME task or starts a NEW one.
|
|
162
|
-
|
|
163
|
-
Answer ONLY "NEW" or "SAME".
|
|
164
|
-
|
|
165
|
-
SAME — the new message:
|
|
166
|
-
- Continues, follows up on, refines, or corrects the same subject/project/task
|
|
167
|
-
- Asks a clarification or next-step question about what was just discussed
|
|
168
|
-
- Reports a result, error, or feedback about the current task
|
|
169
|
-
- Discusses different tools or approaches for the SAME goal (e.g., learning English via BBC → via ChatGPT = SAME)
|
|
170
|
-
- Is a short acknowledgment (ok, thanks, 好的) in response to the current flow
|
|
171
|
-
|
|
172
|
-
NEW — the new message:
|
|
173
|
-
- Introduces a subject from a DIFFERENT domain than the current task (e.g., tech → cooking, work → personal life, database → travel)
|
|
174
|
-
- Has NO logical connection to what was being discussed
|
|
175
|
-
- Starts a request about a different project, system, or life area
|
|
176
|
-
- Begins with a new greeting/reset followed by a different topic
|
|
177
|
-
|
|
178
|
-
Key principles:
|
|
179
|
-
- If the topic domain clearly changed (e.g., server config → recipe, code review → vacation plan), choose NEW
|
|
180
|
-
- Different aspects of the SAME project/system are SAME (e.g., Nginx SSL → Nginx gzip = SAME)
|
|
181
|
-
- Different unrelated technologies discussed independently are NEW (e.g., Redis config → cooking recipe = NEW)
|
|
182
|
-
- When unsure, lean toward SAME for closely related topics, but do NOT hesitate to mark NEW for obvious domain shifts
|
|
183
|
-
- Examples: "配置Nginx" → "加gzip压缩" = SAME; "配置Nginx" → "做红烧肉" = NEW; "MySQL配置" → "K8s部署" in same infra project = SAME; "部署服务器" → "年会安排" = NEW
|
|
184
|
-
|
|
185
|
-
Output exactly one word: NEW or SAME`;
|
|
186
|
-
async function judgeNewTopicOpenAI(currentContext, newMessage, cfg, log) {
|
|
187
|
-
const endpoint = normalizeChatEndpoint(cfg.endpoint ?? "https://api.openai.com/v1/chat/completions");
|
|
188
|
-
const model = cfg.model ?? "gpt-4o-mini";
|
|
189
|
-
const headers = {
|
|
190
|
-
"Content-Type": "application/json",
|
|
191
|
-
Authorization: `Bearer ${cfg.apiKey}`,
|
|
192
|
-
...cfg.headers,
|
|
193
|
-
};
|
|
194
|
-
const userContent = `CURRENT TASK CONTEXT:\n${currentContext}\n\n---\n\nNEW USER MESSAGE:\n${newMessage}`;
|
|
195
|
-
const resp = await fetch(endpoint, {
|
|
196
|
-
method: "POST",
|
|
197
|
-
headers,
|
|
198
|
-
body: JSON.stringify(buildRequestBody(cfg, {
|
|
199
|
-
model,
|
|
200
|
-
temperature: 0,
|
|
201
|
-
max_tokens: 10,
|
|
202
|
-
messages: [
|
|
203
|
-
{ role: "system", content: TOPIC_JUDGE_PROMPT },
|
|
204
|
-
{ role: "user", content: userContent },
|
|
205
|
-
],
|
|
206
|
-
})),
|
|
207
|
-
signal: AbortSignal.timeout(cfg.timeoutMs ?? 15_000),
|
|
208
|
-
});
|
|
209
|
-
if (!resp.ok) {
|
|
210
|
-
const body = await resp.text();
|
|
211
|
-
throw new Error(`OpenAI topic-judge failed (${resp.status}): ${body}`);
|
|
212
|
-
}
|
|
213
|
-
const json = (await resp.json());
|
|
214
|
-
const answer = json.choices[0]?.message?.content?.trim().toUpperCase() ?? "";
|
|
215
|
-
log.debug(`Topic judge result: "${answer}"`);
|
|
216
|
-
return answer.startsWith("NEW");
|
|
217
|
-
}
|
|
218
|
-
const FILTER_RELEVANT_PROMPT = `You are a memory relevance judge.
|
|
219
|
-
|
|
220
|
-
Given a QUERY and CANDIDATE memories, decide: does each candidate's content contain information that would HELP ANSWER the query?
|
|
221
|
-
|
|
222
|
-
CORE QUESTION: "If I include this memory, will it help produce a better answer?"
|
|
223
|
-
- YES → include
|
|
224
|
-
- NO → exclude
|
|
225
|
-
|
|
226
|
-
RULES:
|
|
227
|
-
1. A candidate is relevant if its content provides facts, context, or data that directly supports answering the query.
|
|
228
|
-
2. A candidate that merely shares the same broad topic/domain but contains NO useful information for answering is NOT relevant.
|
|
229
|
-
3. If NO candidate can help answer the query, return {"relevant":[],"sufficient":false} — do NOT force-pick the "least irrelevant" one.
|
|
230
|
-
4. DEDUPLICATION: When multiple candidates convey the same or very similar information, keep ONLY the most complete/detailed one and exclude the rest. Do NOT return near-duplicate snippets.
|
|
231
|
-
|
|
232
|
-
OUTPUT — JSON only:
|
|
233
|
-
{"relevant":[1,3],"sufficient":true}
|
|
234
|
-
- "relevant": candidate numbers whose content helps answer the query. [] if none can help. Duplicates removed — only unique information.
|
|
235
|
-
- "sufficient": true only if the selected memories fully answer the query.`;
|
|
236
|
-
async function filterRelevantOpenAI(query, candidates, cfg, log) {
|
|
237
|
-
const endpoint = normalizeChatEndpoint(cfg.endpoint ?? "https://api.openai.com/v1/chat/completions");
|
|
238
|
-
const model = cfg.model ?? "gpt-4o-mini";
|
|
239
|
-
const headers = {
|
|
240
|
-
"Content-Type": "application/json",
|
|
241
|
-
Authorization: `Bearer ${cfg.apiKey}`,
|
|
242
|
-
...cfg.headers,
|
|
243
|
-
};
|
|
244
|
-
const candidateText = candidates
|
|
245
|
-
.map((c) => {
|
|
246
|
-
const timeTag = c.time ? ` (${c.time})` : "";
|
|
247
|
-
return `${c.index}. [${c.role}]${timeTag}\n ${c.content}`;
|
|
248
|
-
})
|
|
249
|
-
.join("\n");
|
|
250
|
-
const resp = await fetch(endpoint, {
|
|
251
|
-
method: "POST",
|
|
252
|
-
headers,
|
|
253
|
-
body: JSON.stringify(buildRequestBody(cfg, {
|
|
254
|
-
model,
|
|
255
|
-
temperature: 0,
|
|
256
|
-
max_tokens: 200,
|
|
257
|
-
messages: [
|
|
258
|
-
{ role: "system", content: FILTER_RELEVANT_PROMPT },
|
|
259
|
-
{ role: "user", content: `QUERY: ${query}\n\nCANDIDATES:\n${candidateText}` },
|
|
260
|
-
],
|
|
261
|
-
})),
|
|
262
|
-
signal: AbortSignal.timeout(cfg.timeoutMs ?? 15_000),
|
|
263
|
-
});
|
|
264
|
-
if (!resp.ok) {
|
|
265
|
-
const body = await resp.text();
|
|
266
|
-
throw new Error(`OpenAI filter-relevant failed (${resp.status}): ${body}`);
|
|
267
|
-
}
|
|
268
|
-
const json = (await resp.json());
|
|
269
|
-
const raw = json.choices[0]?.message?.content?.trim() ?? "{}";
|
|
270
|
-
log.debug(`filterRelevant raw LLM response: "${raw}"`);
|
|
271
|
-
return parseFilterResult(raw, log);
|
|
272
|
-
}
|
|
273
|
-
function parseFilterResult(raw, log) {
|
|
274
|
-
try {
|
|
275
|
-
const match = raw.match(/\{[\s\S]*\}/);
|
|
276
|
-
if (match) {
|
|
277
|
-
const obj = JSON.parse(match[0]);
|
|
278
|
-
if (obj && Array.isArray(obj.relevant)) {
|
|
279
|
-
return {
|
|
280
|
-
relevant: obj.relevant.filter((n) => typeof n === "number"),
|
|
281
|
-
sufficient: obj.sufficient === true,
|
|
282
|
-
};
|
|
283
|
-
}
|
|
284
|
-
}
|
|
285
|
-
}
|
|
286
|
-
catch { }
|
|
287
|
-
log.warn(`filterRelevant: failed to parse LLM output: "${raw}", fallback to all+insufficient`);
|
|
288
|
-
return { relevant: [], sufficient: false };
|
|
289
|
-
}
|
|
290
|
-
// ─── Smart Dedup: judge whether new memory is DUPLICATE / UPDATE / NEW ───
|
|
291
|
-
exports.DEDUP_JUDGE_PROMPT = `You are a memory deduplication system.
|
|
292
|
-
|
|
293
|
-
LANGUAGE RULE (MUST FOLLOW): You MUST reply in the SAME language as the input memories. 如果输入是中文,reason 和 mergedSummary 必须用中文。If input is English, reply in English. This applies to ALL text fields in your JSON output.
|
|
294
|
-
|
|
295
|
-
Given a NEW memory summary and several EXISTING memory summaries, determine the relationship.
|
|
296
|
-
|
|
297
|
-
For each EXISTING memory, the NEW memory is either:
|
|
298
|
-
- "DUPLICATE": NEW conveys the same intent/meaning as an EXISTING memory, even if worded differently. Examples: "请告诉我你的名字" vs "你希望我怎么称呼你"; "新会话已开始" vs "New session started"; greetings with minor variations. If the core information/intent is the same, it IS a duplicate.
|
|
299
|
-
- "UPDATE": NEW contains meaningful additional information that supplements an EXISTING memory (new data, status change, concrete detail not present before)
|
|
300
|
-
- "NEW": NEW covers a genuinely different topic/event with no semantic overlap
|
|
301
|
-
|
|
302
|
-
IMPORTANT: Lean toward DUPLICATE when memories share the same intent, topic, or factual content. Only choose NEW when the topics are truly unrelated. Repetitive conversational patterns (greetings, session starts, identity questions, capability descriptions) across different sessions should be treated as DUPLICATE.
|
|
303
|
-
|
|
304
|
-
Pick the BEST match among all candidates. If none match well, choose "NEW".
|
|
305
|
-
|
|
306
|
-
Output a single JSON object (reason and mergedSummary MUST match input language):
|
|
307
|
-
- If DUPLICATE: {"action":"DUPLICATE","targetIndex":2,"reason":"与已有记忆意图相同"}
|
|
308
|
-
- If UPDATE: {"action":"UPDATE","targetIndex":3,"reason":"新记忆补充了额外细节","mergedSummary":"合并后的完整摘要,保留新旧所有信息"}
|
|
309
|
-
- If NEW: {"action":"NEW","reason":"不同主题,无关联"}
|
|
310
|
-
|
|
311
|
-
Output ONLY the JSON object, no other text.`;
|
|
312
|
-
async function judgeDedupOpenAI(newSummary, candidates, cfg, log) {
|
|
313
|
-
const endpoint = normalizeChatEndpoint(cfg.endpoint ?? "https://api.openai.com/v1/chat/completions");
|
|
314
|
-
const model = cfg.model ?? "gpt-4o-mini";
|
|
315
|
-
const headers = {
|
|
316
|
-
"Content-Type": "application/json",
|
|
317
|
-
Authorization: `Bearer ${cfg.apiKey}`,
|
|
318
|
-
...cfg.headers,
|
|
319
|
-
};
|
|
320
|
-
const candidateText = candidates
|
|
321
|
-
.map((c) => `${c.index}. ${c.summary}`)
|
|
322
|
-
.join("\n");
|
|
323
|
-
const resp = await fetch(endpoint, {
|
|
324
|
-
method: "POST",
|
|
325
|
-
headers,
|
|
326
|
-
body: JSON.stringify(buildRequestBody(cfg, {
|
|
327
|
-
model,
|
|
328
|
-
temperature: 0,
|
|
329
|
-
max_tokens: 300,
|
|
330
|
-
messages: [
|
|
331
|
-
{ role: "system", content: exports.DEDUP_JUDGE_PROMPT },
|
|
332
|
-
{ role: "user", content: `NEW MEMORY:\n${newSummary}\n\nEXISTING MEMORIES:\n${candidateText}` },
|
|
333
|
-
],
|
|
334
|
-
})),
|
|
335
|
-
signal: AbortSignal.timeout(cfg.timeoutMs ?? 15_000),
|
|
336
|
-
});
|
|
337
|
-
if (!resp.ok) {
|
|
338
|
-
const body = await resp.text();
|
|
339
|
-
throw new Error(`OpenAI dedup-judge failed (${resp.status}): ${body}`);
|
|
340
|
-
}
|
|
341
|
-
const json = (await resp.json());
|
|
342
|
-
const raw = json.choices[0]?.message?.content?.trim() ?? "{}";
|
|
343
|
-
return parseDedupResult(raw, log);
|
|
344
|
-
}
|
|
345
|
-
function parseDedupResult(raw, log) {
|
|
346
|
-
try {
|
|
347
|
-
const match = raw.match(/\{[\s\S]*\}/);
|
|
348
|
-
if (match) {
|
|
349
|
-
const obj = JSON.parse(match[0]);
|
|
350
|
-
if (obj && typeof obj.action === "string") {
|
|
351
|
-
return {
|
|
352
|
-
action: obj.action,
|
|
353
|
-
targetIndex: typeof obj.targetIndex === "number" ? obj.targetIndex : undefined,
|
|
354
|
-
reason: obj.reason || "",
|
|
355
|
-
mergedSummary: obj.mergedSummary || undefined,
|
|
356
|
-
};
|
|
357
|
-
}
|
|
358
|
-
}
|
|
359
|
-
}
|
|
360
|
-
catch { }
|
|
361
|
-
log.warn(`judgeDedup: failed to parse LLM output: "${raw}", fallback to NEW`);
|
|
362
|
-
return { action: "NEW", reason: "parse_failed" };
|
|
363
|
-
}
|
|
364
|
-
function normalizeChatEndpoint(url) {
|
|
365
|
-
const stripped = url.replace(/\/+$/, "");
|
|
366
|
-
if (stripped.endsWith("/chat/completions"))
|
|
367
|
-
return stripped;
|
|
368
|
-
if (stripped.endsWith("/completions"))
|
|
369
|
-
return stripped;
|
|
370
|
-
return `${stripped}/chat/completions`;
|
|
371
|
-
}
|
|
372
|
-
/**
|
|
373
|
-
* Zhipu AI (glm-4.7, glm-5, etc.) uses reasoning tokens that consume max_tokens budget,
|
|
374
|
-
* leaving no room for actual output. This helper injects {"thinking":{"type":"disabled"}}
|
|
375
|
-
* for zhipu endpoints to disable the built-in reasoning mode.
|
|
376
|
-
*/
|
|
377
|
-
function isZhipuEndpoint(endpoint) {
|
|
378
|
-
return /bigmodel\.cn|zhipuai/.test(endpoint);
|
|
379
|
-
}
|
|
380
|
-
function buildRequestBody(cfg, body) {
|
|
381
|
-
const endpoint = cfg.endpoint ?? "";
|
|
382
|
-
if (isZhipuEndpoint(endpoint)) {
|
|
383
|
-
body.thinking = { type: "disabled" };
|
|
384
|
-
}
|
|
385
|
-
return body;
|
|
386
|
-
}
|
|
387
|
-
//# sourceMappingURL=openai.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"openai.js","sourceRoot":"","sources":["../../../src/ingest/providers/openai.ts"],"names":[],"mappings":";;;AAwDA,kDAmCC;AAcD,0DAmCC;AAED,0CAoCC;AA4BD,kDAwCC;AA0BD,oDA6CC;AAED,8CAeC;AAiCD,4CAyCC;AAED,4CAiBC;AAzaD,MAAM,aAAa,GAAG;;;;;;;;;;;;;;oBAcF,CAAC;AAErB,MAAM,mBAAmB,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;oCAoCQ,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,gBAAgB,CAAC,GAAG,EAAE;YACzC,KAAK;YACL,WAAW,EAAE,GAAG,CAAC,WAAW,IAAI,GAAG;YACnC,UAAU,EAAE,IAAI;YAChB,QAAQ,EAAE;gBACR,EAAE,IAAI,EAAE,QAAQ,EAAE,OAAO,EAAE,mBAAmB,E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vD,OAAO,GAAG,QAAQ,mBAAmB,CAAC;AACxC,CAAC;AAED;;;;GAIG;AACH,SAAS,eAAe,CAAC,QAAgB;IACvC,OAAO,sBAAsB,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;AAC/C,CAAC;AAED,SAAS,gBAAgB,CAAC,GAAqB,EAAE,IAA6B;IAC5E,MAAM,QAAQ,GAAG,GAAG,CAAC,QAAQ,IAAI,EAAE,CAAC;IACpC,IAAI,eAAe,CAAC,QAAQ,CAAC,EAAE,CAAC;QAC9B,IAAI,CAAC,QAAQ,GAAG,EAAE,IAAI,EAAE,UAAU,EAAE,CAAC;IACvC,CAAC;IACD,OAAO,IAAI,CAAC;AACd,CAAC"}
|
|
@@ -1,91 +0,0 @@
|
|
|
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
|
-
private pendingEvents;
|
|
22
|
-
private drainPromise;
|
|
23
|
-
private onTaskCompletedCallback?;
|
|
24
|
-
constructor(store: SqliteStore, ctx: PluginContext);
|
|
25
|
-
onTaskCompleted(cb: (task: Task) => void): void;
|
|
26
|
-
/**
|
|
27
|
-
* Called after new chunks are ingested.
|
|
28
|
-
* Determines if a new task boundary was crossed and handles transition.
|
|
29
|
-
*/
|
|
30
|
-
onChunksIngested(sessionKey: string, latestTimestamp: number, owner?: string): Promise<void>;
|
|
31
|
-
private drainPending;
|
|
32
|
-
private detectAndProcess;
|
|
33
|
-
/**
|
|
34
|
-
* Process unassigned chunks one user-turn at a time.
|
|
35
|
-
*
|
|
36
|
-
* Strategy:
|
|
37
|
-
* - Need at least 1 user turn in the current task before starting LLM judgment
|
|
38
|
-
* (0 turns = no reference point for comparison).
|
|
39
|
-
* - Each subsequent user turn is individually checked against the full task context.
|
|
40
|
-
* - Time gap > 2h always triggers a split regardless of topic.
|
|
41
|
-
*/
|
|
42
|
-
private processChunksIncrementally;
|
|
43
|
-
/**
|
|
44
|
-
* Group chunks into user-turns: each turn starts with a user message
|
|
45
|
-
* and includes all subsequent non-user messages until the next user message.
|
|
46
|
-
*/
|
|
47
|
-
private groupIntoTurns;
|
|
48
|
-
/**
|
|
49
|
-
* Build context from existing task chunks for the LLM topic judge.
|
|
50
|
-
* Includes both the task's opening topic and recent exchanges,
|
|
51
|
-
* so the LLM understands both what the task was originally about
|
|
52
|
-
* and where the conversation currently is.
|
|
53
|
-
*
|
|
54
|
-
* For user messages, include full content (up to 500 chars) since
|
|
55
|
-
* they carry the topic signal. For assistant messages, use summary
|
|
56
|
-
* or truncated content since they mostly elaborate.
|
|
57
|
-
*/
|
|
58
|
-
private buildContextSummary;
|
|
59
|
-
private createNewTaskReturn;
|
|
60
|
-
private createNewTask;
|
|
61
|
-
private assignChunksToTask;
|
|
62
|
-
private assignUnassignedChunks;
|
|
63
|
-
finalizeTask(task: Task): Promise<void>;
|
|
64
|
-
/**
|
|
65
|
-
* Determine if a task is too trivial to warrant an LLM summary call.
|
|
66
|
-
* Returns a skip reason string, or null if summary should proceed.
|
|
67
|
-
*
|
|
68
|
-
* Skip conditions (any one triggers skip):
|
|
69
|
-
* 1. Total chunks < 4 — too few messages to form a meaningful task
|
|
70
|
-
* 2. Real conversation turns < 2 — no back-and-forth dialogue
|
|
71
|
-
* 3. No user messages — purely system/tool generated, no user intent
|
|
72
|
-
* 4. Total content < 200 chars — not enough substance
|
|
73
|
-
* 5. User content is trivial/test data — "hello", "test", "ok" etc.
|
|
74
|
-
* 6. All messages are tool results — automated output, no conversation
|
|
75
|
-
* 7. High content repetition — user repeated the same thing (debug loops)
|
|
76
|
-
*/
|
|
77
|
-
private shouldSkipSummary;
|
|
78
|
-
private looksLikeTrivialContent;
|
|
79
|
-
private buildConversationText;
|
|
80
|
-
/**
|
|
81
|
-
* Extract the LLM-generated title from the summary output.
|
|
82
|
-
* The LLM is prompted to output "📌 Title\n<title text>" as the first section.
|
|
83
|
-
* Returns the title and the remaining body (with the title section stripped).
|
|
84
|
-
*/
|
|
85
|
-
private parseTitleFromSummary;
|
|
86
|
-
private generateTitle;
|
|
87
|
-
private extractTitle;
|
|
88
|
-
private humanReadableSkipReason;
|
|
89
|
-
private fallbackSummary;
|
|
90
|
-
}
|
|
91
|
-
//# sourceMappingURL=task-processor.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
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;IAQtB,OAAO,CAAC,KAAK;IACb,OAAO,CAAC,GAAG;IARb,OAAO,CAAC,UAAU,CAAa;IAC/B,OAAO,CAAC,UAAU,CAAS;IAC3B,OAAO,CAAC,aAAa,CAA6E;IAClG,OAAO,CAAC,YAAY,CAA8B;IAClD,OAAO,CAAC,uBAAuB,CAAC,CAAuB;gBAG7C,KAAK,EAAE,WAAW,EAClB,GAAG,EAAE,aAAa;IAM5B,eAAe,CAAC,EAAE,EAAE,CAAC,IAAI,EAAE,IAAI,KAAK,IAAI,GAAG,IAAI;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