token-optimizer-opencode 1.0.6 → 1.0.13
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/continuity/matcher.d.ts +18 -0
- package/dist/continuity/matcher.d.ts.map +1 -1
- package/dist/continuity/matcher.js +34 -1
- package/dist/continuity/matcher.js.map +1 -1
- package/dist/continuity/restore.d.ts +8 -1
- package/dist/continuity/restore.d.ts.map +1 -1
- package/dist/continuity/restore.js +43 -1
- package/dist/continuity/restore.js.map +1 -1
- package/dist/continuity/resume-lean.d.ts +126 -0
- package/dist/continuity/resume-lean.d.ts.map +1 -0
- package/dist/continuity/resume-lean.js +437 -0
- package/dist/continuity/resume-lean.js.map +1 -0
- package/dist/dashboard/generator.d.ts.map +1 -1
- package/dist/dashboard/generator.js +232 -36
- package/dist/dashboard/generator.js.map +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +90 -4
- package/dist/index.js.map +1 -1
- package/dist/nudges/fresh-session-nudge.d.ts +72 -0
- package/dist/nudges/fresh-session-nudge.d.ts.map +1 -0
- package/dist/nudges/fresh-session-nudge.js +190 -0
- package/dist/nudges/fresh-session-nudge.js.map +1 -0
- package/dist/nudges/verbosity-steer.d.ts +28 -0
- package/dist/nudges/verbosity-steer.d.ts.map +1 -0
- package/dist/nudges/verbosity-steer.js +61 -0
- package/dist/nudges/verbosity-steer.js.map +1 -0
- package/dist/pricing.d.ts +58 -0
- package/dist/pricing.d.ts.map +1 -0
- package/dist/pricing.js +307 -0
- package/dist/pricing.js.map +1 -0
- package/dist/savings.baseline.test.d.ts +2 -0
- package/dist/savings.baseline.test.d.ts.map +1 -0
- package/dist/savings.baseline.test.js +100 -0
- package/dist/savings.baseline.test.js.map +1 -0
- package/dist/savings.d.ts +41 -3
- package/dist/savings.d.ts.map +1 -1
- package/dist/savings.js +296 -86
- package/dist/savings.js.map +1 -1
- package/dist/storage/trends.d.ts +74 -0
- package/dist/storage/trends.d.ts.map +1 -1
- package/dist/storage/trends.js +199 -0
- package/dist/storage/trends.js.map +1 -1
- package/dist/util/context-window.d.ts.map +1 -1
- package/dist/util/context-window.js +2 -1
- package/dist/util/context-window.js.map +1 -1
- package/dist/util/env.d.ts +2 -0
- package/dist/util/env.d.ts.map +1 -1
- package/dist/util/env.js +4 -0
- package/dist/util/env.js.map +1 -1
- package/package.json +1 -1
- package/dist/nudges/tool-call-warn.d.ts +0 -7
- package/dist/nudges/tool-call-warn.d.ts.map +0 -1
- package/dist/nudges/tool-call-warn.js +0 -20
- package/dist/nudges/tool-call-warn.js.map +0 -1
|
@@ -4,7 +4,25 @@ export interface CheckpointMatch {
|
|
|
4
4
|
score: number;
|
|
5
5
|
sessionId: string;
|
|
6
6
|
mode: string;
|
|
7
|
+
/** Byte length of the full checkpoint content before truncation.
|
|
8
|
+
* Used as the floor input to the checkpoint_restore savings estimate. */
|
|
9
|
+
rawBytes: number;
|
|
7
10
|
}
|
|
11
|
+
/**
|
|
12
|
+
* Make raw checkpoint body safe to inject after a [RECOVERED DATA ...] sentinel.
|
|
13
|
+
*
|
|
14
|
+
* The body is prior-conversation text and may be attacker-influenced (a pasted
|
|
15
|
+
* file, fetched web content, a crafted message). Strip C0 control chars and
|
|
16
|
+
* DEFANG any forged RECOVERED-DATA sentinel / role-prefix so the body cannot
|
|
17
|
+
* "close" the data fence and smuggle the following lines in as live instructions.
|
|
18
|
+
*
|
|
19
|
+
* Mirrors Python's _neutralize_recovered_body() in measure.py exactly:
|
|
20
|
+
* - Strip C0 control chars except TAB and LF.
|
|
21
|
+
* - Defang forged "[RECOVERED..." sentinels: leading bracket becomes paren.
|
|
22
|
+
* - Bracket role-prefix lines (system:, user:, assistant:, etc.) so they
|
|
23
|
+
* cannot read as a new turn or system instruction.
|
|
24
|
+
*/
|
|
25
|
+
export declare function neutralizeRecoveredBody(text: string): string;
|
|
8
26
|
export declare function findBestCheckpoint(userPrompt: string, checkpoints: Array<{
|
|
9
27
|
session_id: string;
|
|
10
28
|
content: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"matcher.d.ts","sourceRoot":"","sources":["../../src/continuity/matcher.ts"],"names":[],"mappings":"AAwBA,wBAAgB,cAAc,CAAC,UAAU,EAAE,MAAM,EAAE,iBAAiB,EAAE,MAAM,GAAG,MAAM,CAcpF;AAED,MAAM,WAAW,eAAe;IAC9B,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,EAAE,MAAM,CAAC;IAClB,IAAI,EAAE,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"matcher.d.ts","sourceRoot":"","sources":["../../src/continuity/matcher.ts"],"names":[],"mappings":"AAwBA,wBAAgB,cAAc,CAAC,UAAU,EAAE,MAAM,EAAE,iBAAiB,EAAE,MAAM,GAAG,MAAM,CAcpF;AAED,MAAM,WAAW,eAAe;IAC9B,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,EAAE,MAAM,CAAC;IAClB,IAAI,EAAE,MAAM,CAAC;IACb;8EAC0E;IAC1E,QAAQ,EAAE,MAAM,CAAC;CAClB;AAUD;;;;;;;;;;;;;GAaG;AACH,wBAAgB,uBAAuB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAY5D;AAED,wBAAgB,kBAAkB,CAChC,UAAU,EAAE,MAAM,EAClB,WAAW,EAAE,KAAK,CAAC;IAAE,UAAU,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAC;IAAC,UAAU,EAAE,MAAM,CAAA;CAAE,CAAC,EAC7F,SAAS,EAAE,MAAM,EACjB,QAAQ,GAAE,MAAa,GACtB,eAAe,GAAG,IAAI,CA0BxB"}
|
|
@@ -43,6 +43,31 @@ function safeSlice(str, maxChars) {
|
|
|
43
43
|
end--;
|
|
44
44
|
return str.slice(0, end) + "\n[... truncated]";
|
|
45
45
|
}
|
|
46
|
+
/**
|
|
47
|
+
* Make raw checkpoint body safe to inject after a [RECOVERED DATA ...] sentinel.
|
|
48
|
+
*
|
|
49
|
+
* The body is prior-conversation text and may be attacker-influenced (a pasted
|
|
50
|
+
* file, fetched web content, a crafted message). Strip C0 control chars and
|
|
51
|
+
* DEFANG any forged RECOVERED-DATA sentinel / role-prefix so the body cannot
|
|
52
|
+
* "close" the data fence and smuggle the following lines in as live instructions.
|
|
53
|
+
*
|
|
54
|
+
* Mirrors Python's _neutralize_recovered_body() in measure.py exactly:
|
|
55
|
+
* - Strip C0 control chars except TAB and LF.
|
|
56
|
+
* - Defang forged "[RECOVERED..." sentinels: leading bracket becomes paren.
|
|
57
|
+
* - Bracket role-prefix lines (system:, user:, assistant:, etc.) so they
|
|
58
|
+
* cannot read as a new turn or system instruction.
|
|
59
|
+
*/
|
|
60
|
+
export function neutralizeRecoveredBody(text) {
|
|
61
|
+
if (!text)
|
|
62
|
+
return "";
|
|
63
|
+
// Strip C0 control chars except tab (\x09) and newline (\x0a).
|
|
64
|
+
text = text.replace(/[\x00-\x08\x0b\x0c\x0e-\x1f\x7f]/g, " ");
|
|
65
|
+
// Defang forged open/close sentinels: "[RECOVERED...", "[/RECOVERED...", etc.
|
|
66
|
+
text = text.replace(/\[(\s*\/?\s*RECOVERED\b)/gi, "($1");
|
|
67
|
+
// Defang role-prefix lines that could read as a new turn / system instruction.
|
|
68
|
+
text = text.replace(/^(\s*)(system|assistant|user|human|developer|tool|instructions?)(\s*:)/gim, "$1[$2]$3");
|
|
69
|
+
return text;
|
|
70
|
+
}
|
|
46
71
|
export function findBestCheckpoint(userPrompt, checkpoints, threshold, maxChars = 2000) {
|
|
47
72
|
let best = null;
|
|
48
73
|
let bestScore = 0;
|
|
@@ -50,11 +75,19 @@ export function findBestCheckpoint(userPrompt, checkpoints, threshold, maxChars
|
|
|
50
75
|
const score = scoreRelevance(userPrompt, cp.content);
|
|
51
76
|
if (score > bestScore && score >= threshold) {
|
|
52
77
|
bestScore = score;
|
|
78
|
+
// Neutralize forged sentinels / control chars before injecting.
|
|
79
|
+
// The raw checkpoint body is replayed prior-conversation text and is
|
|
80
|
+
// attacker-influenceable; it must not be able to break the data fence.
|
|
81
|
+
const safeContent = neutralizeRecoveredBody(safeSlice(cp.content, maxChars));
|
|
53
82
|
best = {
|
|
54
|
-
content:
|
|
83
|
+
content: safeContent,
|
|
55
84
|
score,
|
|
56
85
|
sessionId: cp.session_id,
|
|
57
86
|
mode: cp.mode,
|
|
87
|
+
// Preserve the full byte length BEFORE truncation so the caller can
|
|
88
|
+
// compute a checkpoint_restore floor estimate from the real checkpoint
|
|
89
|
+
// size rather than the (possibly truncated) injected excerpt.
|
|
90
|
+
rawBytes: Buffer.byteLength(cp.content, "utf8"),
|
|
58
91
|
};
|
|
59
92
|
}
|
|
60
93
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"matcher.js","sourceRoot":"","sources":["../../src/continuity/matcher.ts"],"names":[],"mappings":"AAAA,MAAM,UAAU,GAAG,IAAI,GAAG,CAAC;IACzB,KAAK,EAAE,GAAG,EAAE,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO;IACnE,MAAM,EAAE,KAAK,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO;IACnE,QAAQ,EAAE,KAAK,EAAE,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI;IAClE,KAAK,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO;IAC9D,MAAM,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM;IAClE,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,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aAChD,CAAC;QACJ,CAAC;IACH,CAAC;IAED,OAAO,IAAI,CAAC;AACd,CAAC"}
|
|
@@ -1,4 +1,11 @@
|
|
|
1
1
|
import { type CheckpointMatch } from "./matcher.js";
|
|
2
2
|
import type { TokenOptimizerConfig } from "../util/env.js";
|
|
3
|
-
|
|
3
|
+
import type { TrendsStore } from "../storage/trends.js";
|
|
4
|
+
export declare function restoreCheckpoint(dataDir: string, userPrompt: string, currentSessionId: string, config: TokenOptimizerConfig,
|
|
5
|
+
/** Optional: when supplied and the prompt shows resume-intent, the lean
|
|
6
|
+
* reconstruction path fires and savings are credited to trends.db. */
|
|
7
|
+
trendsStore?: TrendsStore,
|
|
8
|
+
/** Working directory for same-project scoping. Comes from ctx.project.path
|
|
9
|
+
* or process.cwd() at call time (the caller decides). */
|
|
10
|
+
cwd?: string): CheckpointMatch | null;
|
|
4
11
|
//# sourceMappingURL=restore.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"restore.d.ts","sourceRoot":"","sources":["../../src/continuity/restore.ts"],"names":[],"mappings":"AAGA,OAAO,EAAsB,KAAK,eAAe,EAAE,MAAM,cAAc,CAAC;AAExE,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,gBAAgB,CAAC;
|
|
1
|
+
{"version":3,"file":"restore.d.ts","sourceRoot":"","sources":["../../src/continuity/restore.ts"],"names":[],"mappings":"AAGA,OAAO,EAAsB,KAAK,eAAe,EAAE,MAAM,cAAc,CAAC;AAExE,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,gBAAgB,CAAC;AAM3D,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AAExD,wBAAgB,iBAAiB,CAC/B,OAAO,EAAE,MAAM,EACf,UAAU,EAAE,MAAM,EAClB,gBAAgB,EAAE,MAAM,EACxB,MAAM,EAAE,oBAAoB;AAC5B;uEACuE;AACvE,WAAW,CAAC,EAAE,WAAW;AACzB;0DAC0D;AAC1D,GAAG,CAAC,EAAE,MAAM,GACX,eAAe,GAAG,IAAI,CAsIxB"}
|
|
@@ -3,7 +3,14 @@ import { join } from "node:path";
|
|
|
3
3
|
import { Database } from "bun:sqlite";
|
|
4
4
|
import { findBestCheckpoint } from "./matcher.js";
|
|
5
5
|
import { sanitizeSessionId } from "../storage/session-store.js";
|
|
6
|
-
|
|
6
|
+
import { resumeIntent, buildResumeLeanBlock, logResumeLeanSavings, } from "./resume-lean.js";
|
|
7
|
+
export function restoreCheckpoint(dataDir, userPrompt, currentSessionId, config,
|
|
8
|
+
/** Optional: when supplied and the prompt shows resume-intent, the lean
|
|
9
|
+
* reconstruction path fires and savings are credited to trends.db. */
|
|
10
|
+
trendsStore,
|
|
11
|
+
/** Working directory for same-project scoping. Comes from ctx.project.path
|
|
12
|
+
* or process.cwd() at call time (the caller decides). */
|
|
13
|
+
cwd) {
|
|
7
14
|
if (!config.features.continuity)
|
|
8
15
|
return null;
|
|
9
16
|
const sessDir = join(dataDir, "token-optimizer", "sessions");
|
|
@@ -12,6 +19,41 @@ export function restoreCheckpoint(dataDir, userPrompt, currentSessionId, config)
|
|
|
12
19
|
// DB filenames are the sanitized session id, so compare like-for-like or a
|
|
13
20
|
// session whose id contains special chars would fail to exclude its own file.
|
|
14
21
|
const safeCurrentId = sanitizeSessionId(currentSessionId);
|
|
22
|
+
// ---------------------------------------------------------------------------
|
|
23
|
+
// Resume-lean path: natural-language "continue prior work" → full lean block.
|
|
24
|
+
// Fires BEFORE the lightweight keyword-hint path so a deliberate "continue
|
|
25
|
+
// the token-optimizer work" request returns a full reconstruction, not a hint.
|
|
26
|
+
// Falls through to the lightweight hint when no same-project match is found.
|
|
27
|
+
// ---------------------------------------------------------------------------
|
|
28
|
+
if (config.features.continuity && cwd && resumeIntent(userPrompt)) {
|
|
29
|
+
try {
|
|
30
|
+
const [leanBlock, targetSid] = buildResumeLeanBlock(userPrompt, dataDir, safeCurrentId, cwd, config.checkpointRetentionDays, config.checkpointRetentionMax);
|
|
31
|
+
if (leanBlock && targetSid) {
|
|
32
|
+
// Credit the avoided cold-resume cost. Best-effort: never breaks injection.
|
|
33
|
+
if (trendsStore) {
|
|
34
|
+
const leanRawBytes = Buffer.byteLength(leanBlock, "utf8");
|
|
35
|
+
logResumeLeanSavings(trendsStore, targetSid, leanBlock, leanRawBytes);
|
|
36
|
+
}
|
|
37
|
+
// Wrap as a CheckpointMatch so the caller can inject it uniformly.
|
|
38
|
+
return {
|
|
39
|
+
content: leanBlock,
|
|
40
|
+
score: 1.0,
|
|
41
|
+
sessionId: targetSid,
|
|
42
|
+
mode: "resume_lean",
|
|
43
|
+
rawBytes: Buffer.byteLength(leanBlock, "utf8"),
|
|
44
|
+
};
|
|
45
|
+
}
|
|
46
|
+
// No same-project match. When cwd is known, do NOT fall through to the
|
|
47
|
+
// (un-gated) lightweight hint — that could surface a DIFFERENT project's
|
|
48
|
+
// checkpoint for an explicit "continue our work" request. Return null
|
|
49
|
+
// instead. Only fall through when cwd is absent (best-effort mode).
|
|
50
|
+
if (cwd)
|
|
51
|
+
return null;
|
|
52
|
+
}
|
|
53
|
+
catch {
|
|
54
|
+
// Best-effort: never break normal continuity over the lean path.
|
|
55
|
+
}
|
|
56
|
+
}
|
|
15
57
|
const cutoff = config.checkpointRetentionDays <= 0
|
|
16
58
|
? 0
|
|
17
59
|
: Date.now() / 1000 - config.checkpointRetentionDays * 86400;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"restore.js","sourceRoot":"","sources":["../../src/continuity/restore.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AACpE,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACtC,OAAO,EAAE,kBAAkB,EAAwB,MAAM,cAAc,CAAC;AACxE,OAAO,EAAE,iBAAiB,EAAE,MAA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AE,MAAM,CAAC,sBAAsB,CAAC,CAAC;IAE1E,OAAO,kBAAkB,CAAC,UAAU,EAAE,UAAU,EAAE,MAAM,CAAC,kBAAkB,EAAE,MAAM,CAAC,kBAAkB,CAAC,CAAC;AAC1G,CAAC"}
|
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Cold-resume-lean: natural-language auto-resume for OpenCode.
|
|
3
|
+
*
|
|
4
|
+
* When the user's first message shows resume intent ("continue the token-optimizer
|
|
5
|
+
* work", "what we discussed last session"), inject a FULL lean reconstruction of
|
|
6
|
+
* the right same-project prior session — no command, no id.
|
|
7
|
+
*
|
|
8
|
+
* Token-free: pure SQLite + in-memory reads; no LLM, no subprocess.
|
|
9
|
+
*
|
|
10
|
+
* Port from Python: skills/token-optimizer/scripts/measure.py
|
|
11
|
+
* Functions ported: _resume_intent, _RESUME_INTENT_RE, _RESUME_TOPIC_STOPWORDS,
|
|
12
|
+
* _resume_topic_score, _checkpoint_in_project, _continuity_resume_block,
|
|
13
|
+
* build_lean_resume_context, _resume_lean_already_credited, _log_resume_lean_savings.
|
|
14
|
+
*
|
|
15
|
+
* Key structural difference from Python: opencode stores checkpoints in per-session
|
|
16
|
+
* SQLite DBs (session_store.ts checkpoints table) — NOT in JSON sidecar files. The
|
|
17
|
+
* sidecar fields (active_task, continuation, open_questions, recent_reads, git,
|
|
18
|
+
* quality) don't exist; we reconstruct from what IS available: active_files[]
|
|
19
|
+
* (JSON), decisions[] (JSON), and the content text. The "thin tier" is therefore
|
|
20
|
+
* more common here. Savings use tokens_cache_write (closest proxy to Python's
|
|
21
|
+
* cache_create tokens) or rawBytes fallback.
|
|
22
|
+
*/
|
|
23
|
+
import type { TrendsStore } from "../storage/trends.js";
|
|
24
|
+
/**
|
|
25
|
+
* Matches natural-language cues that the user wants to pick up prior work.
|
|
26
|
+
* Kept tight to avoid firing on incidental "continue to the next file".
|
|
27
|
+
* MUST NOT match bare "continue" without a contextual modifier.
|
|
28
|
+
*/
|
|
29
|
+
export declare const RESUME_INTENT_RE: RegExp;
|
|
30
|
+
/** True when the prompt asks to continue/recall prior work. */
|
|
31
|
+
export declare function resumeIntent(text: string): boolean;
|
|
32
|
+
/**
|
|
33
|
+
* Generic glue words that carry no topic once the resume cue is removed.
|
|
34
|
+
* Keeping them would let "session"/"work" falsely match every checkpoint.
|
|
35
|
+
*
|
|
36
|
+
* Note: opencode's scoreRelevance in matcher.ts already strips STOP_WORDS and
|
|
37
|
+
* uses pure keyword precision, but it would short-circuit on "continue"/"resume"
|
|
38
|
+
* inflating every checkpoint to a high score. We compute residual precision
|
|
39
|
+
* against the checkpoint's stored content instead.
|
|
40
|
+
*/
|
|
41
|
+
export declare const RESUME_TOPIC_STOPWORDS: Set<string>;
|
|
42
|
+
/**
|
|
43
|
+
* Precision of the prompt's RESIDUAL topic words (after removing resume cues)
|
|
44
|
+
* against a checkpoint's content text.
|
|
45
|
+
*
|
|
46
|
+
* Unlike scoreRelevance (matcher.ts), this does NOT short-circuit on bare
|
|
47
|
+
* "continue"/"resume" cues, so a named topic ("the keepwarm one") scores
|
|
48
|
+
* higher than a vague "continue last session" → residual empty → score 0.0.
|
|
49
|
+
*
|
|
50
|
+
* @param prompt The user's first message.
|
|
51
|
+
* @param content The checkpoint's full content string from the DB.
|
|
52
|
+
*/
|
|
53
|
+
export declare function resumeTopicScore(prompt: string, content: string): number;
|
|
54
|
+
/**
|
|
55
|
+
* True when a checkpoint's working set lives under the current project dir.
|
|
56
|
+
*
|
|
57
|
+
* In opencode, active_files is a JSON-encoded string[] column from the
|
|
58
|
+
* checkpoints table. We use it as the "recent_reads + modified_files"
|
|
59
|
+
* equivalent. Path-prefix based, no DB join needed.
|
|
60
|
+
*/
|
|
61
|
+
export declare function checkpointInProject(activeFilesJson: string, cwd: string): boolean;
|
|
62
|
+
/** Topic bar: above this, the prompt names a topic (keyword winner); below it, most-recent. */
|
|
63
|
+
export declare const RESUME_TOPIC_BAR: number;
|
|
64
|
+
/**
|
|
65
|
+
* A DB row from the checkpoints table, enriched with the session DB file path
|
|
66
|
+
* and mtime (for recency ordering).
|
|
67
|
+
*/
|
|
68
|
+
interface CheckpointRow {
|
|
69
|
+
session_id: string;
|
|
70
|
+
trigger: string;
|
|
71
|
+
mode: string;
|
|
72
|
+
quality_score: number | null;
|
|
73
|
+
fill_pct: number | null;
|
|
74
|
+
active_files: string;
|
|
75
|
+
decisions: string;
|
|
76
|
+
content: string;
|
|
77
|
+
created_at: number;
|
|
78
|
+
/** Path of the session DB file that holds this checkpoint (for dedup) */
|
|
79
|
+
dbPath: string;
|
|
80
|
+
}
|
|
81
|
+
/**
|
|
82
|
+
* Build a LEAN context block from a checkpoint row.
|
|
83
|
+
*
|
|
84
|
+
* Faithful tier (checkpoint present): active files, decisions, topic summary,
|
|
85
|
+
* quality, mode. Thin tier (no decisions / empty content): clearly flagged.
|
|
86
|
+
* Fenced as RECOVERED DATA so a fresh session treats it as context, not instructions.
|
|
87
|
+
*
|
|
88
|
+
* DEVIATION from Python: Python's sidecar has rich fields (active_task,
|
|
89
|
+
* continuation, open_questions, recent_reads, git). opencode's checkpoint DB
|
|
90
|
+
* stores (active_files[], decisions[], content text, mode, quality_score,
|
|
91
|
+
* fill_pct). We surface what we have; the "thin tier" is hit more often here.
|
|
92
|
+
*/
|
|
93
|
+
export declare function buildLeanResumeContext(cp: CheckpointRow, sessionId: string, maxChars?: number): string;
|
|
94
|
+
/**
|
|
95
|
+
* When the user asks to continue prior work, return a FULL lean reconstruction
|
|
96
|
+
* of the right same-project session, or "" to fall through to the lightweight
|
|
97
|
+
* hint (or no-op when no match).
|
|
98
|
+
*
|
|
99
|
+
* Selection ("both", per spec):
|
|
100
|
+
* - best residual score >= RESUME_TOPIC_BAR → keyword winner (recency breaks ties)
|
|
101
|
+
* - else → most-recent same-project checkpoint
|
|
102
|
+
*
|
|
103
|
+
* Returns [block, targetSessionId] or ["", ""] on no match.
|
|
104
|
+
*/
|
|
105
|
+
export declare function buildResumeLeanBlock(userPrompt: string, dataDir: string, currentSessionId: string, cwd: string, retentionDays?: number, maxCandidates?: number): [string, string];
|
|
106
|
+
/**
|
|
107
|
+
* Credit the cold-resume cost avoided by reconstructing a session lean instead
|
|
108
|
+
* of a full --resume cold-rewrite.
|
|
109
|
+
*
|
|
110
|
+
* Avoided cost (in priority order, matching Python's _log_resume_lean_savings):
|
|
111
|
+
* 1. tokens_cache_write from session_log (the real cold-rewrite cost, closest
|
|
112
|
+
* proxy to Python's cache_create_1h_tokens + cache_create_5m_tokens).
|
|
113
|
+
* 2. checkpointRawBytes / CHARS_PER_TOKEN (conservative byte-size proxy).
|
|
114
|
+
* 3. If neither is available: credit 0. NO generous heuristic (e.g. lean*10).
|
|
115
|
+
* Per PRIME DIRECTIVE: never-overcount wins every tradeoff.
|
|
116
|
+
*
|
|
117
|
+
* Cross-session dedup: calls TrendsStore.hasRecentSavingsEvent to ensure the
|
|
118
|
+
* same cold session is credited at most once per 6h window, even if reopened
|
|
119
|
+
* from two different fresh sessions. Mirrors Python's _resume_lean_already_credited
|
|
120
|
+
* which dedups on the TARGET session_uuid within 6h.
|
|
121
|
+
*
|
|
122
|
+
* Idempotent per target session within ~6h. Best-effort: never breaks injection.
|
|
123
|
+
*/
|
|
124
|
+
export declare function logResumeLeanSavings(trendsStore: TrendsStore, targetSessionId: string, leanBlock: string, checkpointRawBytes?: number): void;
|
|
125
|
+
export {};
|
|
126
|
+
//# sourceMappingURL=resume-lean.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"resume-lean.d.ts","sourceRoot":"","sources":["../../src/continuity/resume-lean.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAKH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AAMxD;;;;GAIG;AACH,eAAO,MAAM,gBAAgB,QAqB5B,CAAC;AAEF,+DAA+D;AAC/D,wBAAgB,YAAY,CAAC,IAAI,EAAE,MAAM,GA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