@lexwdex-org/opencode-dcp 3.4.14 → 4.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.en.md +72 -47
- package/README.md +43 -44
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +712 -676
- package/dist/index.js.map +1 -1
- package/dist/lib/config.d.ts +7 -12
- package/dist/lib/config.d.ts.map +1 -1
- package/dist/lib/dtc/digest.d.ts +16 -0
- package/dist/lib/dtc/digest.d.ts.map +1 -0
- package/dist/lib/dtc/engine.d.ts +54 -0
- package/dist/lib/dtc/engine.d.ts.map +1 -0
- package/dist/lib/dtc/state.d.ts +28 -0
- package/dist/lib/dtc/state.d.ts.map +1 -0
- package/dist/lib/dtc/types.d.ts +44 -0
- package/dist/lib/dtc/types.d.ts.map +1 -0
- package/dist/lib/hooks.d.ts +66 -10
- package/dist/lib/hooks.d.ts.map +1 -1
- package/dist/lib/prompts/compaction.d.ts +2 -2
- package/dist/lib/prompts/compaction.d.ts.map +1 -1
- package/dist/lib/prune-tool.d.ts +3 -2
- package/dist/lib/prune-tool.d.ts.map +1 -1
- package/dist/lib/session-events.d.ts +7 -0
- package/dist/lib/session-events.d.ts.map +1 -0
- package/dist/lib/text.d.ts +19 -0
- package/dist/lib/text.d.ts.map +1 -0
- package/package.json +1 -1
- package/dist/lib/activity.d.ts +0 -22
- package/dist/lib/activity.d.ts.map +0 -1
- package/dist/lib/auto-prune.d.ts +0 -20
- package/dist/lib/auto-prune.d.ts.map +0 -1
- package/dist/lib/prune-service.d.ts +0 -99
- package/dist/lib/prune-service.d.ts.map +0 -1
- package/dist/lib/session-model.d.ts +0 -8
- package/dist/lib/session-model.d.ts.map +0 -1
- package/dist/lib/summarize.d.ts +0 -38
- package/dist/lib/summarize.d.ts.map +0 -1
package/dist/lib/config.d.ts
CHANGED
|
@@ -1,20 +1,14 @@
|
|
|
1
1
|
import type { PluginInput } from "@opencode-ai/plugin";
|
|
2
|
+
import { type DtcConfig } from "./dtc/engine";
|
|
2
3
|
export interface Commands {
|
|
3
4
|
enabled: boolean;
|
|
4
5
|
}
|
|
5
6
|
export interface ExperimentalConfig {
|
|
6
7
|
customPrompts: boolean;
|
|
7
8
|
}
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
}
|
|
11
|
-
export interface AutoPruneConfig {
|
|
9
|
+
/** DTC engine knobs plus the master switch for request-time compression. */
|
|
10
|
+
export interface DtcPluginConfig extends DtcConfig {
|
|
12
11
|
enabled: boolean;
|
|
13
|
-
minMessages: number;
|
|
14
|
-
volumeThreshold: number;
|
|
15
|
-
driftThreshold: number;
|
|
16
|
-
idleGapMs: number;
|
|
17
|
-
cooldownMs: number;
|
|
18
12
|
}
|
|
19
13
|
export interface ToolConfig {
|
|
20
14
|
enabled: boolean;
|
|
@@ -27,11 +21,10 @@ export interface PluginConfig {
|
|
|
27
21
|
language: DcpLanguage;
|
|
28
22
|
commands: Commands;
|
|
29
23
|
experimental: ExperimentalConfig;
|
|
30
|
-
|
|
31
|
-
autoPrune: AutoPruneConfig;
|
|
24
|
+
dtc: DtcPluginConfig;
|
|
32
25
|
tool: ToolConfig;
|
|
33
26
|
}
|
|
34
|
-
export declare const
|
|
27
|
+
export declare const DEFAULT_DTC: DtcPluginConfig;
|
|
35
28
|
export declare const VALID_CONFIG_KEYS: Set<string>;
|
|
36
29
|
export declare const DEPRECATED_CONFIG_KEYS: Set<string>;
|
|
37
30
|
export declare function getDeprecatedConfigKeys(userConfig: Record<string, any>): string[];
|
|
@@ -42,6 +35,8 @@ interface ValidationError {
|
|
|
42
35
|
actual: string;
|
|
43
36
|
}
|
|
44
37
|
export declare function validateConfigTypes(config: Record<string, any>): ValidationError[];
|
|
38
|
+
/** Legacy autoPrune.driftThreshold migrates to dtc.driftThreshold. */
|
|
39
|
+
export declare function legacyDriftThreshold(configData: Record<string, any>): number | undefined;
|
|
45
40
|
export declare function getConfig(ctx: PluginInput): PluginConfig;
|
|
46
41
|
export {};
|
|
47
42
|
//# sourceMappingURL=config.d.ts.map
|
package/dist/lib/config.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../lib/config.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAA;
|
|
1
|
+
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../lib/config.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAA;AACtD,OAAO,EAAgB,KAAK,SAAS,EAAE,MAAM,cAAc,CAAA;AAE3D,MAAM,WAAW,QAAQ;IACrB,OAAO,EAAE,OAAO,CAAA;CACnB;AAED,MAAM,WAAW,kBAAkB;IAC/B,aAAa,EAAE,OAAO,CAAA;CACzB;AAED,4EAA4E;AAC5E,MAAM,WAAW,eAAgB,SAAQ,SAAS;IAC9C,OAAO,EAAE,OAAO,CAAA;CACnB;AAED,MAAM,WAAW,UAAU;IACvB,OAAO,EAAE,OAAO,CAAA;CACnB;AAED,MAAM,MAAM,WAAW,GAAG,IAAI,GAAG,IAAI,CAAA;AAErC,MAAM,WAAW,YAAY;IACzB,OAAO,EAAE,OAAO,CAAA;IAChB,UAAU,EAAE,OAAO,CAAA;IACnB,KAAK,EAAE,OAAO,CAAA;IACd,QAAQ,EAAE,WAAW,CAAA;IACrB,QAAQ,EAAE,QAAQ,CAAA;IAClB,YAAY,EAAE,kBAAkB,CAAA;IAChC,GAAG,EAAE,eAAe,CAAA;IACpB,IAAI,EAAE,UAAU,CAAA;CACnB;AAED,eAAO,MAAM,WAAW,EAAE,eAGzB,CAAA;AAED,eAAO,MAAM,iBAAiB,aAmB5B,CAAA;AAMF,eAAO,MAAM,sBAAsB,aAwDjC,CAAA;AAeF,wBAAgB,uBAAuB,CAAC,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,MAAM,EAAE,CAEjF;AAED,wBAAgB,oBAAoB,CAAC,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,MAAM,EAAE,CAI9E;AAED,UAAU,eAAe;IACrB,GAAG,EAAE,MAAM,CAAA;IACX,QAAQ,EAAE,MAAM,CAAA;IAChB,MAAM,EAAE,MAAM,CAAA;CACjB;AAED,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,eAAe,EAAE,CAoGlF;AAED,sEAAsE;AACtE,wBAAgB,oBAAoB,CAAC,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,MAAM,GAAG,SAAS,CASxF;AA2RD,wBAAgB,SAAS,CAAC,GAAG,EAAE,WAAW,GAAG,YAAY,CAsCxD"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { MessageLike, Turn } from "./types";
|
|
2
|
+
/** Builds the one-block digest that replaces a distant turn's content. */
|
|
3
|
+
export declare function digestTurn(messages: MessageLike[], turn: Turn, index: number): string;
|
|
4
|
+
/** Stable cache key: identity of the opening message + shape of the content. */
|
|
5
|
+
export declare function digestKey(messages: MessageLike[], turn: Turn): string;
|
|
6
|
+
/**
|
|
7
|
+
* Stateless topic-boundary scanner over the head region: a boundary is a
|
|
8
|
+
* substantial user message whose similarity to its predecessor drops below
|
|
9
|
+
* the drift threshold. Returns turn positions (indices into `turns`).
|
|
10
|
+
*/
|
|
11
|
+
export declare function findTopicBoundaries(messages: MessageLike[], turns: Turn[], driftThreshold: number): number[];
|
|
12
|
+
/** Token estimate of a message slice, summing every string payload. Parts
|
|
13
|
+
* folded with the host's compacted marker count as the short placeholder the
|
|
14
|
+
* host serializer will actually emit, not the stored output. */
|
|
15
|
+
export declare function estimateSlice(messages: MessageLike[], start: number, end: number): number;
|
|
16
|
+
//# sourceMappingURL=digest.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"digest.d.ts","sourceRoot":"","sources":["../../../lib/dtc/digest.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAY,IAAI,EAAE,MAAM,SAAS,CAAA;AA8C1D,0EAA0E;AAC1E,wBAAgB,UAAU,CAAC,QAAQ,EAAE,WAAW,EAAE,EAAE,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,GAAG,MAAM,CAuBrF;AAcD,gFAAgF;AAChF,wBAAgB,SAAS,CAAC,QAAQ,EAAE,WAAW,EAAE,EAAE,IAAI,EAAE,IAAI,GAAG,MAAM,CAiBrE;AAED;;;;GAIG;AACH,wBAAgB,mBAAmB,CAC/B,QAAQ,EAAE,WAAW,EAAE,EACvB,KAAK,EAAE,IAAI,EAAE,EACb,cAAc,EAAE,MAAM,GACvB,MAAM,EAAE,CAaV;AAED;;gEAEgE;AAChE,wBAAgB,aAAa,CAAC,QAAQ,EAAE,WAAW,EAAE,EAAE,KAAK,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,MAAM,CAiBzF"}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import type { Logger } from "../logger";
|
|
2
|
+
import type { DtcState } from "./state";
|
|
3
|
+
import type { MessageLike, Turn } from "./types";
|
|
4
|
+
/**
|
|
5
|
+
* The dynamic tiered compression engine. Runs inside the host's
|
|
6
|
+
* `experimental.chat.messages.transform` hook on every model request and
|
|
7
|
+
* rewrites ONLY string payloads of the request-scoped message copies:
|
|
8
|
+
*
|
|
9
|
+
* - messages and parts are never added, removed, or reordered
|
|
10
|
+
* - part IDs, tool-call pairing, and roles are never touched
|
|
11
|
+
* - distant tool outputs are folded with the host's own `time.compacted`
|
|
12
|
+
* marker, so the wire rendering is the host's native one
|
|
13
|
+
*
|
|
14
|
+
* Nothing here writes to the session; the host rebuilds this array from
|
|
15
|
+
* storage on every request, so all mutations are inherently request-scoped.
|
|
16
|
+
*/
|
|
17
|
+
export interface DtcConfig {
|
|
18
|
+
/** Turns kept completely verbatim at the end (never folded). */
|
|
19
|
+
tailTurns: number;
|
|
20
|
+
/** Below this fraction of the context window, no folding happens at all. */
|
|
21
|
+
lowWatermarkRatio: number;
|
|
22
|
+
/** Folding escalates until the estimate fits this fraction. */
|
|
23
|
+
targetRatio: number;
|
|
24
|
+
/** Jaccard similarity below which consecutive turns count as a topic change. */
|
|
25
|
+
driftThreshold: number;
|
|
26
|
+
/** C-zone tool outputs are head+tail truncated to this many characters. */
|
|
27
|
+
toolOutputKeepChars: number;
|
|
28
|
+
}
|
|
29
|
+
export declare const DTC_DEFAULTS: DtcConfig;
|
|
30
|
+
export type FoldLevel = 0 | 1 | 2 | 3;
|
|
31
|
+
export interface TransformStats {
|
|
32
|
+
messages: number;
|
|
33
|
+
userTurns: number;
|
|
34
|
+
level: FoldLevel;
|
|
35
|
+
estimatedBefore: number;
|
|
36
|
+
estimatedAfter: number;
|
|
37
|
+
contextTokens: number;
|
|
38
|
+
foldedTools: number;
|
|
39
|
+
foldedTexts: number;
|
|
40
|
+
digestedTurns: number;
|
|
41
|
+
skipped: "short" | "unknown-context" | "compaction" | undefined;
|
|
42
|
+
}
|
|
43
|
+
export interface TransformDeps {
|
|
44
|
+
state: DtcState;
|
|
45
|
+
config: DtcConfig;
|
|
46
|
+
logger?: Logger;
|
|
47
|
+
now?: () => number;
|
|
48
|
+
}
|
|
49
|
+
/** Splits the array into turns at user messages (compaction-part users are
|
|
50
|
+
* host machinery, not conversational turns — same rule as the fork's own
|
|
51
|
+
* `turns()` in session/compaction.ts). */
|
|
52
|
+
export declare function segmentTurns(messages: MessageLike[]): Turn[];
|
|
53
|
+
export declare function transformMessages(messages: MessageLike[], deps: TransformDeps): TransformStats;
|
|
54
|
+
//# sourceMappingURL=engine.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"engine.d.ts","sourceRoot":"","sources":["../../../lib/dtc/engine.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,WAAW,CAA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EAAE,aAAa,GAAG,cAAc,CAiE9F"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Per-session runtime state for the DTC engine. Everything here is
|
|
3
|
+
* request-scoped or in-memory only — nothing is ever persisted, matching the
|
|
4
|
+
* "no plugin checkpoint persistence" constraint. All maps are LRU-bounded.
|
|
5
|
+
*/
|
|
6
|
+
export declare class DtcState {
|
|
7
|
+
private readonly sessions;
|
|
8
|
+
private readonly digests;
|
|
9
|
+
observeContextLimit(sessionID: string, contextTokens: number | undefined): void;
|
|
10
|
+
contextTokens(sessionID: string): number | undefined;
|
|
11
|
+
/** Called by the compacting hook; consumed by the very next transform. */
|
|
12
|
+
armCompactionSkip(sessionID: string): void;
|
|
13
|
+
consumeCompactionSkip(sessionID: string): boolean;
|
|
14
|
+
/** `dcp_prune` / `/dcp fold`: mark a boundary now and deepen folding. */
|
|
15
|
+
markBoundary(sessionID: string, at: number, minLevel?: number): void;
|
|
16
|
+
boundaryMark(sessionID: string): number | undefined;
|
|
17
|
+
minLevel(sessionID: string): number;
|
|
18
|
+
cachedDigest(key: string): string | undefined;
|
|
19
|
+
storeDigest(key: string, digest: string): void;
|
|
20
|
+
dropSession(sessionID: string): void;
|
|
21
|
+
/** Test/inspection surface. */
|
|
22
|
+
stats(): {
|
|
23
|
+
sessions: number;
|
|
24
|
+
digests: number;
|
|
25
|
+
};
|
|
26
|
+
private session;
|
|
27
|
+
}
|
|
28
|
+
//# sourceMappingURL=state.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"state.d.ts","sourceRoot":"","sources":["../../../lib/dtc/state.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAmCH,qBAAa,QAAQ;IACjB,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAqC;IAC9D,OAAO,CAAC,QAAQ,CAAC,OAAO,CAA4B;IAEpD,mBAAmB,CAAC,SAAS,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM,GAAG,SAAS,GAAG,IAAI;IAS/E,aAAa,CAAC,SAAS,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS;IAIpD,0EAA0E;IAC1E,iBAAiB,CAAC,SAAS,EAAE,MAAM,GAAG,IAAI;IAM1C,qBAAqB,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO;IAOjD,yEAAyE;IACzE,YAAY,CAAC,SAAS,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,EAAE,QAAQ,SAAI,GAAG,IAAI;IAO/D,YAAY,CAAC,SAAS,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS;IAInD,QAAQ,CAAC,SAAS,EAAE,MAAM,GAAG,MAAM;IAInC,YAAY,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS;IAI7C,WAAW,CAAC,GAAG,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,IAAI;IAI9C,WAAW,CAAC,SAAS,EAAE,MAAM,GAAG,IAAI;IAIpC,+BAA+B;IAC/B,KAAK,IAAI;QAAE,QAAQ,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,CAAA;KAAE;IAI9C,OAAO,CAAC,OAAO;CAGlB"}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Loose structural types for session messages as delivered by the host's
|
|
3
|
+
* `experimental.chat.messages.transform` hook. Deliberately duck-typed: the
|
|
4
|
+
* engine only reads roles/part types and rewrites string payloads, so it
|
|
5
|
+
* stays compatible across host versions without importing their schemas.
|
|
6
|
+
*/
|
|
7
|
+
export interface MessageInfoLike {
|
|
8
|
+
id?: string;
|
|
9
|
+
role?: string;
|
|
10
|
+
sessionID?: string;
|
|
11
|
+
time?: {
|
|
12
|
+
created?: number;
|
|
13
|
+
};
|
|
14
|
+
summary?: boolean;
|
|
15
|
+
}
|
|
16
|
+
export interface ToolStateLike {
|
|
17
|
+
status?: string;
|
|
18
|
+
output?: string;
|
|
19
|
+
input?: Record<string, unknown>;
|
|
20
|
+
time?: {
|
|
21
|
+
compacted?: number;
|
|
22
|
+
} & Record<string, unknown>;
|
|
23
|
+
metadata?: Record<string, unknown>;
|
|
24
|
+
}
|
|
25
|
+
export interface PartLike {
|
|
26
|
+
type?: string;
|
|
27
|
+
id?: string;
|
|
28
|
+
text?: string;
|
|
29
|
+
tool?: string;
|
|
30
|
+
state?: ToolStateLike;
|
|
31
|
+
[key: string]: unknown;
|
|
32
|
+
}
|
|
33
|
+
export interface MessageLike {
|
|
34
|
+
info?: MessageInfoLike;
|
|
35
|
+
parts?: PartLike[];
|
|
36
|
+
}
|
|
37
|
+
/** A turn = a user message plus everything up to the next user message. */
|
|
38
|
+
export interface Turn {
|
|
39
|
+
/** Index of the user message that opens the turn. */
|
|
40
|
+
start: number;
|
|
41
|
+
/** Exclusive end index in the message array. */
|
|
42
|
+
end: number;
|
|
43
|
+
}
|
|
44
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../lib/dtc/types.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,MAAM,WAAW,eAAe;IAC5B,EAAE,CAAC,EAAE,MAAM,CAAA;IACX,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,IAAI,CAAC,EAAE;QAAE,OAAO,CAAC,EAAE,MAAM,CAAA;KAAE,CAAA;IAC3B,OAAO,CAAC,EAAE,OAAO,CAAA;CACpB;AAED,MAAM,WAAW,aAAa;IAC1B,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;IAC/B,IAAI,CAAC,EAAE;QAAE,SAAS,CAAC,EAAE,MAAM,CAAA;KAAE,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;IACvD,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;CACrC;AAED,MAAM,WAAW,QAAQ;IACrB,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,EAAE,CAAC,EAAE,MAAM,CAAA;IACX,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,KAAK,CAAC,EAAE,aAAa,CAAA;IACrB,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAA;CACzB;AAED,MAAM,WAAW,WAAW;IACxB,IAAI,CAAC,EAAE,eAAe,CAAA;IACtB,KAAK,CAAC,EAAE,QAAQ,EAAE,CAAA;CACrB;AAED,2EAA2E;AAC3E,MAAM,WAAW,IAAI;IACjB,qDAAqD;IACrD,KAAK,EAAE,MAAM,CAAA;IACb,gDAAgD;IAChD,GAAG,EAAE,MAAM,CAAA;CACd"}
|
package/dist/lib/hooks.d.ts
CHANGED
|
@@ -1,38 +1,94 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { PluginConfig } from "./config";
|
|
2
2
|
import type { Logger } from "./logger";
|
|
3
3
|
import type { OpenCodeClient } from "./opencode-client";
|
|
4
4
|
import type { PromptStore } from "./prompts/store";
|
|
5
|
-
import type {
|
|
6
|
-
import type { PruneService } from "./prune-service";
|
|
5
|
+
import type { DtcState } from "./dtc/state";
|
|
7
6
|
interface CompactionOutput {
|
|
8
7
|
context: string[];
|
|
9
8
|
prompt?: string;
|
|
10
9
|
}
|
|
11
|
-
|
|
10
|
+
/** Host-side tail protection DCP applies unless the user configured it. */
|
|
11
|
+
export declare const DEFAULT_TAIL_TURNS = 4;
|
|
12
|
+
export declare const DEFAULT_PRESERVE_RECENT_TOKENS = 32000;
|
|
13
|
+
/**
|
|
14
|
+
* Extracts the text of the most recent completed checkpoint (assistant
|
|
15
|
+
* message flagged `summary`) from a session messages response. The host
|
|
16
|
+
* hides prior checkpoint pairs from the summarizer input and only re-exposes
|
|
17
|
+
* them through its own default prompt — which DCP replaces. Fetching the
|
|
18
|
+
* previous checkpoint here is what keeps the checkpoint rolling instead of
|
|
19
|
+
* restarting from the retained tail each compaction.
|
|
20
|
+
*/
|
|
21
|
+
export declare function extractPreviousCheckpoint(messages: unknown): string | undefined;
|
|
22
|
+
export interface SessionCompactingDeps {
|
|
23
|
+
prompts: PromptStore;
|
|
24
|
+
logger: Logger;
|
|
25
|
+
client: OpenCodeClient;
|
|
26
|
+
state: DtcState;
|
|
27
|
+
}
|
|
28
|
+
export declare function createSessionCompactingHandler(deps: SessionCompactingDeps): (input: {
|
|
12
29
|
sessionID: string;
|
|
13
30
|
}, output: CompactionOutput) => Promise<void>;
|
|
14
|
-
|
|
31
|
+
/**
|
|
32
|
+
* `chat.params` fires on every LLM request with the resolved model. DTC only
|
|
33
|
+
* reads the context-window size from it — the budget tiers are fractions of
|
|
34
|
+
* that window, and until it is known the engine fails open (no folding).
|
|
35
|
+
*/
|
|
36
|
+
export declare function createChatParamsHandler(deps: {
|
|
37
|
+
state: DtcState;
|
|
38
|
+
logger: Logger;
|
|
39
|
+
}): (input: {
|
|
15
40
|
sessionID: string;
|
|
41
|
+
model?: {
|
|
42
|
+
limit?: {
|
|
43
|
+
context?: number;
|
|
44
|
+
};
|
|
45
|
+
};
|
|
16
46
|
}, _output?: unknown) => Promise<void>;
|
|
47
|
+
export interface TransformHandlerDeps {
|
|
48
|
+
state: DtcState;
|
|
49
|
+
config: PluginConfig["dtc"];
|
|
50
|
+
logger: Logger;
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* THE compression surface: runs inside the host's per-request messages
|
|
54
|
+
* transform. Fail-open by contract — any engine error must leave the array
|
|
55
|
+
* untouched rather than break the model call.
|
|
56
|
+
*/
|
|
57
|
+
export declare function createTransformHandler(deps: TransformHandlerDeps): (_input: unknown, output: {
|
|
58
|
+
messages: unknown[];
|
|
59
|
+
}) => Promise<void>;
|
|
17
60
|
export interface EventHandlerDeps {
|
|
18
|
-
|
|
19
|
-
prune: PruneService;
|
|
20
|
-
autoPruner: AutoPruner;
|
|
21
|
-
config: AutoPruneConfig;
|
|
61
|
+
state: DtcState;
|
|
22
62
|
logger: Logger;
|
|
23
63
|
}
|
|
64
|
+
/** Slim lifecycle feed: only session deletion needs explicit cleanup; every
|
|
65
|
+
* other DTC structure is LRU-bounded or request-scoped. */
|
|
24
66
|
export declare function createEventHandler(deps: EventHandlerDeps): (input: {
|
|
25
67
|
event: {
|
|
26
68
|
type: string;
|
|
27
69
|
properties?: Record<string, any>;
|
|
28
70
|
};
|
|
29
71
|
}) => Promise<void>;
|
|
30
|
-
export
|
|
72
|
+
export interface CommandExecuteDeps {
|
|
73
|
+
client: OpenCodeClient;
|
|
74
|
+
state: DtcState;
|
|
75
|
+
config: PluginConfig["dtc"];
|
|
76
|
+
logger: Logger;
|
|
77
|
+
}
|
|
78
|
+
export declare function createCommandExecuteHandler(deps: CommandExecuteDeps): (input: {
|
|
31
79
|
command: string;
|
|
32
80
|
sessionID: string;
|
|
33
81
|
arguments: string;
|
|
34
82
|
}, _output?: {
|
|
35
83
|
parts: unknown[];
|
|
36
84
|
}) => Promise<void>;
|
|
85
|
+
/**
|
|
86
|
+
* Mutates the host config at load time: register the `/dcp` command when
|
|
87
|
+
* enabled, and raise the host's compaction tail protection to DCP's tiered
|
|
88
|
+
* defaults (last turns kept verbatim) unless the user already configured
|
|
89
|
+
* them — this shapes the host's own overflow-compaction fallback, which is
|
|
90
|
+
* the only compaction that still writes checkpoints.
|
|
91
|
+
*/
|
|
92
|
+
export declare function createConfigHandler(config: PluginConfig, logger: Logger): (opencodeConfig: Record<string, any>) => Promise<void>;
|
|
37
93
|
export {};
|
|
38
94
|
//# sourceMappingURL=hooks.d.ts.map
|
package/dist/lib/hooks.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hooks.d.ts","sourceRoot":"","sources":["../../lib/hooks.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,
|
|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,GAAG,CAAC,KAAG,OAAO,CAAC,IAAI,CAAC,CAoBpE"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export declare const COMPACTION = "\u4F60\u6B63\u5728\u751F\u6210\u5F53\u524D\u4F1A\u8BDD\u552F\u4E00\u7684\u6EDA\u52A8\u68C0\u67E5\u70B9\u3002\u8F93\u51FA\u5C06\u66FF\u4EE3\u65E7\u5BF9\u8BDD\u524D\u7F00\uFF0C\u6210\u4E3A\u540E\u7EED\u6A21\u578B\u770B\u5230\u7684\u7B2C\u4E00\u6BB5\u4E0A\u4E0B\u6587\uFF1BOpenCode \u4F1A\u5728\
|
|
2
|
-
export declare const COMPACTION_EN = "You are generating the single rolling checkpoint for this session. Your output will replace the old conversation prefix as the first context the model sees afterwards; OpenCode keeps
|
|
1
|
+
export declare const COMPACTION = "\u4F60\u6B63\u5728\u751F\u6210\u5F53\u524D\u4F1A\u8BDD\u552F\u4E00\u7684\u6EDA\u52A8\u68C0\u67E5\u70B9\u3002\u8F93\u51FA\u5C06\u66FF\u4EE3\u65E7\u5BF9\u8BDD\u524D\u7F00\uFF0C\u6210\u4E3A\u540E\u7EED\u6A21\u578B\u770B\u5230\u7684\u7B2C\u4E00\u6BB5\u4E0A\u4E0B\u6587\uFF1BOpenCode \u4F1A\u5728\u68C0\u67E5\u70B9\u4E4B\u540E\u76F4\u63A5\u4FDD\u7559\u6700\u8FD1\u82E5\u5E72\u8F6E\u5B8C\u6574\u5BF9\u8BDD\uFF08\u4E0D\u7ECF\u538B\u7F29\uFF0C\u8303\u56F4\u7531\u5BBF\u4E3B\u914D\u7F6E\u51B3\u5B9A\uFF09\uFF0C\u8FD9\u90E8\u5206\u5C3E\u90E8\u4E0D\u5C5E\u4E8E\u538B\u7F29\u5BF9\u8C61\uFF0C\u4E0D\u8981\u590D\u8FF0\u3001\u603B\u7ED3\u6216\u6539\u5199\u5B83\u4EEC\u3002\u7CFB\u7EDF\u7EA7\u5185\u5BB9\uFF08AGENTS.md\u3001\u9879\u76EE\u89C4\u5219\u7B49\uFF09\u7531 OpenCode \u5728\u6BCF\u6B21\u8BF7\u6C42\u65F6\u72EC\u7ACB\u6CE8\u5165\uFF0C\u4E0D\u5C5E\u4E8E\u538B\u7F29\u8303\u56F4\uFF0C\u4E0D\u8981\u590D\u8FF0\u5B83\u4EEC\u3002\n\n\u8FD9\u4E0D\u662F\u804A\u5929\u8BB0\u5F55\u6458\u8981\uFF0C\u800C\u662F\u53EF\u76F4\u63A5\u7EE7\u7EED\u5DE5\u4F5C\u7684\u8BED\u4E49\u526A\u679D\u7ED3\u679C\u3002\u6309\u4EE5\u4E0B\u5206\u5C42\u89C4\u5219\u538B\u7F29\uFF1A\n\n1. \u6EDA\u52A8\u5408\u5E76\uFF1A\u5982\u679C\u8F93\u5165\u672B\u5C3E\u542B\u6709 <previous-checkpoint> \u6807\u7B7E\u5305\u88F9\u7684\u4E0A\u4E00\u4EFD\u68C0\u67E5\u70B9\uFF0C\u628A\u4ECD\u6709\u6548\u7684\u4FE1\u606F\u5408\u5E76\u8FDB\u65B0\u68C0\u67E5\u70B9\uFF1B\u4E0D\u8981\u5D4C\u5957\u3001\u5F15\u7528\u6216\u9010\u5B57\u91CD\u590D\u65E7\u68C0\u67E5\u70B9\uFF0C\u5931\u6548\u5185\u5BB9\u76F4\u63A5\u4E22\u5F03\u3002\u6CA1\u6709\u8BE5\u6807\u7B7E\u65F6\u5FFD\u7565\u672C\u6761\u3002\n2. \u8FDC\u8DDD\u79BB\u5185\u5BB9\uFF08\u65E9\u671F\u4E0E\u4E2D\u90E8\u5386\u53F2\uFF09\u91CD\u5EA6\u538B\u7F29\uFF1A\u6BCF\u4E2A\u4E3B\u9898\u53EA\u7559\u4E00\u53E5\u8BDD\u7ED3\u8BBA\uFF0C\u4E0D\u7559\u8FC7\u7A0B\u3001\u4E0D\u590D\u8FF0\u5BF9\u8BDD\u5F80\u6765\u3002\n3. \u5220\u9664\u65E0\u5173\u95F2\u804A\u3001\u5176\u4ED6\u9879\u76EE\u6216\u5176\u4ED6\u4ED3\u5E93\u7684\u5BF9\u8BDD\u3001\u91CD\u590D\u89E3\u91CA\u3001\u5DF2\u7ECF\u63A8\u7FFB\u4E14\u4E0D\u518D\u6709\u8BCA\u65AD\u4EF7\u503C\u7684\u65B9\u6848\u3002\n4. \u591A\u6B21\u5DE5\u5177\u8C03\u7528\u8BD5\u9519\u6216\u5931\u8D25\u540E\u6210\u529F\u65F6\uFF0C\u53EA\u4FDD\u7559\u6700\u7EC8\u6210\u529F\u7ED3\u679C\uFF1B\u4EC5\u5F53\u6839\u56E0\u4F1A\u5F71\u54CD\u540E\u7EED\u5DE5\u4F5C\u65F6\u4FDD\u7559\u4E00\u6B21\u7B80\u77ED\u5931\u8D25\u539F\u56E0\u3002\n5. \u540C\u4E00\u5185\u5BB9\u6216\u6587\u4EF6\u88AB\u91CD\u590D\u7F16\u8F91\u65F6\uFF0C\u53EA\u4FDD\u7559\u6700\u7EC8\u72B6\u6001\u3001\u4ECD\u6709\u6548\u7684\u5173\u952E\u51B3\u7B56\u548C\u5FC5\u8981\u7406\u7531\uFF0C\u4E0D\u590D\u8FF0\u6BCF\u8F6E\u4FEE\u6539\u3002\n6. \u8FD1\u8DDD\u79BB\u5185\u5BB9\uFF08\u81EA\u4E0A\u4E00\u4EFD\u68C0\u67E5\u70B9\u4EE5\u6765\u7684\u65B0\u5185\u5BB9\uFF0C\u4E14\u4E0D\u5C5E\u4E8E\u5BBF\u4E3B\u4FDD\u7559\u7684\u5C3E\u90E8\uFF09\u8F7B\u5EA6\u538B\u7F29\uFF1A\u5F53\u524D\u4EFB\u52A1\u3001\u76EE\u6807\u3001\u72B6\u6001\u4E0E\u8FDB\u884C\u4E2D\u7684\u60C5\u51B5\u505A\u6C47\u603B\u4F46\u4E0D\u4E22\u7EC6\u8282\u2014\u2014\u4FDD\u7559\u7EE7\u7EED\u5DE5\u4F5C\u6240\u9700\u7684\u6587\u4EF6\u8DEF\u5F84\u3001\u63A5\u53E3\u3001\u547D\u4EE4\u3001\u6D4B\u8BD5\u7ED3\u679C\u3001\u9519\u8BEF\u4E8B\u5B9E\u3001\u4ECD\u6709\u6548\u7684\u51B3\u7B56\u53CA\u7406\u7531\uFF0C\u53EA\u6298\u53E0\u91CD\u590D\u4E0E\u5DF2\u5931\u6548\u7684\u5185\u5BB9\u3002\n\n\u4F7F\u7528\u4EE5\u4E0B\u56FA\u5B9A\u7ED3\u6784\uFF0C\u7701\u7565\u786E\u5B9E\u4E3A\u7A7A\u7684\u6761\u76EE\uFF1A\n\n## \u5386\u53F2\u6982\u8981\n\u65E9\u671F\u4E0E\u4E2D\u90E8\u5386\u53F2\u7684\u4E3B\u9898\u548C\u80CC\u666F\uFF0C\u6BCF\u9879\u4E00\u53E5\u8BDD\u7ED3\u8BBA\uFF1B\u8FDC\u671F\u5DF2\u5B8C\u6210\u4EFB\u52A1\u5F52\u5165\u6B64\u5904\uFF0C\u4E0D\u542B\u6267\u884C\u8FC7\u7A0B\u3002\n\n## \u5DF2\u5B8C\u6210\u4EFB\u52A1\u7684\u6982\u62EC\n\u6700\u8FD1\u7684\u5DF2\u5B8C\u6210\u4EFB\u52A1\uFF0C\u6BCF\u4E2A\u4EFB\u52A1\u4E00\u53E5\u8BDD\u6982\u62EC\u5176\u7ED3\u679C\u4E0E\u5173\u952E\u4EA7\u51FA\u3002\n\n## \u8FDB\u884C\u4E2D\u4EFB\u52A1\u8BE6\u60C5\n\u5F53\u524D\u6B63\u5728\u8FDB\u884C\u7684\u4EFB\u52A1\u9010\u9879\u5199\u6E05\uFF1A\u76EE\u6807\u3001\u5DF2\u5B8C\u6210\u6B65\u9AA4\u3001\u6D89\u53CA\u6587\u4EF6\u8DEF\u5F84\u4E0E\u63A5\u53E3\u3001\u5173\u952E\u51B3\u7B56\u3001\u9047\u5230\u7684\u963B\u585E\u3001\u4E0B\u4E00\u6B65\u5177\u4F53\u52A8\u4F5C\u3002\u672C\u8282\u5C5E\u4E8E\u8F7B\u5EA6\u538B\u7F29\u533A\uFF0C\u5B81\u53EF\u591A\u4FDD\u7559\u7EC6\u8282\uFF0C\u4E0D\u505A\u4E8C\u6B21\u63A8\u65AD\u3002\n\n## \u672A\u89E3\u51B3\u95EE\u9898\n\u8DE8\u4EFB\u52A1\u7684\u9057\u7559\u98CE\u9669\u548C\u5F85\u786E\u8BA4\u4E8B\u9879\u3002\u53EA\u5199\u672A\u5728\u300C\u8FDB\u884C\u4E2D\u4EFB\u52A1\u8BE6\u60C5\u300D\u4E2D\u51FA\u73B0\u7684\u5185\u5BB9\uFF0C\u907F\u514D\u4E0E\u8BE5\u8282\u91CD\u590D\u3002\n\n\u4FDD\u6301\u5177\u4F53\u3001\u53EF\u9A8C\u8BC1\u548C\u9879\u76EE\u5185\u805A\u3002\u8FDB\u884C\u4E2D\u7684\u4EFB\u52A1\u5FC5\u987B\u80FD\u51ED\u68C0\u67E5\u70B9\u76F4\u63A5\u7EE7\u7EED\uFF0C\u4E0D\u8981\u4F9D\u8D56\u5DF2\u88AB\u538B\u7F29\u6389\u7684\u4E2D\u95F4\u8FC7\u7A0B\u3002\u4FDD\u7559\u6587\u4EF6\u8DEF\u5F84\u3001\u63A5\u53E3\u3001\u547D\u4EE4\u3001\u6D4B\u8BD5\u7ED3\u679C\u548C\u9519\u8BEF\u4E8B\u5B9E\u7B49\u786C\u4E8B\u5B9E\uFF0C\u4F46\u4E0D\u8981\u4FDD\u7559\u6D88\u606F ID\u3001\u5757 ID\u3001\u951A\u70B9\u3001\u5360\u4F4D\u7B26\u3001\u63A7\u5236\u6807\u7B7E\u6216\u8FC7\u7A0B\u6027\u804A\u5929\u3002";
|
|
2
|
+
export declare const COMPACTION_EN = "You are generating the single rolling checkpoint for this session. Your output will replace the old conversation prefix as the first context the model sees afterwards; OpenCode keeps the most recent conversation turns directly after the checkpoint, uncompacted (their range is a host setting). That tail is outside the compaction scope: do not restate, summarize, or rewrite it. System-level content (AGENTS.md, project rules, etc.) is injected independently by OpenCode on every request and is not part of compaction; do not restate it.\n\nThis is not a chat-log summary but a semantic pruning result one can resume working from directly. Compress by these tiered rules:\n\n1. Rolling merge: if the input ends with a <previous-checkpoint> block containing the previous checkpoint, merge its still-valid information into the new checkpoint; do not nest, quote, or repeat it verbatim, and drop stale content outright. Ignore this rule when the tag is absent.\n2. Distant content (early and middle history) is compressed heavily: one concluding sentence per topic, no process detail, no dialogue restatement.\n3. Remove irrelevant chitchat, conversations about other projects or repositories, repeated explanations, and approaches that were overturned and no longer carry diagnostic value.\n4. When repeated tool trial-and-error ends in success, keep only the final successful outcome; retain one brief failure reason only if the root cause affects future work.\n5. When the same content or file was edited repeatedly, keep only the final state, the still-valid key decisions, and the necessary rationale; do not restate each round of edits.\n6. Recent content (everything generated since the previous checkpoint, excluding the host-retained tail) is compressed lightly: summarize the current task, goals, status, and in-progress work without losing detail\u2014keep the file paths, interfaces, commands, test results, error facts, and still-valid decisions with rationale needed to continue, folding only duplicates and invalidated content.\n\nUse the following fixed structure, omitting sections that are truly empty:\n\n## History Overview\nTopics and background from early and middle history, one concluding sentence each; long-completed tasks belong here, without execution process.\n\n## Completed Task Summaries\nRecently completed tasks, one sentence per task covering its outcome and key outputs.\n\n## In-Progress Task Details\nFor the current task, itemize: goal, completed steps, file paths and interfaces involved, key decisions, blockers encountered, concrete next actions. This is the lightly-compressed zone; prefer keeping more detail and avoid second-order inference.\n\n## Unresolved Issues\nCross-task lingering risks and items awaiting confirmation. Only list items not already covered under In-Progress Task Details, to avoid duplication.\n\nStay specific, verifiable, and project-cohesive. An in-progress task must be resumable straight from this checkpoint, without relying on intermediate process that was pruned away. Keep hard facts such as file paths, interfaces, commands, test results, and error facts, but never message IDs, block IDs, anchors, placeholders, control tags, or procedural chatter.";
|
|
3
3
|
export declare function getCompactionPrompt(language?: string): string;
|
|
4
4
|
//# sourceMappingURL=compaction.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"compaction.d.ts","sourceRoot":"","sources":["../../../lib/prompts/compaction.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,UAAU,
|
|
1
|
+
{"version":3,"file":"compaction.d.ts","sourceRoot":"","sources":["../../../lib/prompts/compaction.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,UAAU,02KAyBsF,CAAA;AAE7G,eAAO,MAAM,aAAa,6pGAyBiV,CAAA;AAE3W,wBAAgB,mBAAmB,CAAC,QAAQ,CAAC,EAAE,MAAM,GAAG,MAAM,CAE7D"}
|
package/dist/lib/prune-tool.d.ts
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import type { Logger } from "./logger";
|
|
2
|
-
import type {
|
|
2
|
+
import type { DtcState } from "./dtc/state";
|
|
3
3
|
export declare const PRUNE_TOOL_NAME = "dcp_prune";
|
|
4
4
|
export interface PruneToolDeps {
|
|
5
|
-
|
|
5
|
+
state: DtcState;
|
|
6
6
|
logger: Logger;
|
|
7
|
+
now?: () => number;
|
|
7
8
|
}
|
|
8
9
|
export declare function createPruneTool(deps: PruneToolDeps): {
|
|
9
10
|
description: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"prune-tool.d.ts","sourceRoot":"","sources":["../../lib/prune-tool.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,UAAU,CAAA;AACtC,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"prune-tool.d.ts","sourceRoot":"","sources":["../../lib/prune-tool.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,UAAU,CAAA;AACtC,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAA;AAE3C,eAAO,MAAM,eAAe,cAAc,CAAA;AAU1C,MAAM,WAAW,aAAa;IAC1B,KAAK,EAAE,QAAQ,CAAA;IACf,MAAM,EAAE,MAAM,CAAA;IACd,GAAG,CAAC,EAAE,MAAM,MAAM,CAAA;CACrB;AAED,wBAAgB,eAAe,CAAC,IAAI,EAAE,aAAa;;;;EAclD"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Resolves the session ID from a host event's properties. Most events carry
|
|
3
|
+
* `sessionID` directly, but some (e.g. `session.deleted`) only carry
|
|
4
|
+
* `info: Session`. Returns `undefined` when neither is a non-empty string.
|
|
5
|
+
*/
|
|
6
|
+
export declare function eventSessionID(properties?: Record<string, any>): string | undefined;
|
|
7
|
+
//# sourceMappingURL=session-events.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"session-events.d.ts","sourceRoot":"","sources":["../../lib/session-events.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,wBAAgB,cAAc,CAAC,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,MAAM,GAAG,SAAS,CAMnF"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shared text utilities for the dynamic tiered compression engine and the
|
|
3
|
+
* topic-boundary scanner. Pure functions only — everything here must stay
|
|
4
|
+
* deterministic so folded output and digests are stable across requests.
|
|
5
|
+
*/
|
|
6
|
+
export declare function tokenize(text: string): Set<string>;
|
|
7
|
+
export declare function jaccard(a: Set<string>, b: Set<string>): number;
|
|
8
|
+
/**
|
|
9
|
+
* Cheap deterministic token estimate: CJK characters count ~0.7 tokens each,
|
|
10
|
+
* everything else ~0.25 (the standard chars/4 approximation). Precise enough
|
|
11
|
+
* for budget decisions — the escalation loop re-measures after every level.
|
|
12
|
+
*/
|
|
13
|
+
export declare function estimateTokens(text: string): number;
|
|
14
|
+
/** djb2 string hash — stable digest cache keys without storing content. */
|
|
15
|
+
export declare function hashString(text: string): string;
|
|
16
|
+
export declare function firstLine(text: string, maxChars: number): string;
|
|
17
|
+
export declare function truncateMiddle(text: string, keepChars: number, note: string): string;
|
|
18
|
+
export declare function extractTextParts(parts: unknown[]): string;
|
|
19
|
+
//# sourceMappingURL=text.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"text.d.ts","sourceRoot":"","sources":["../../lib/text.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,wBAAgB,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,GAAG,CAAC,MAAM,CAAC,CAiBlD;AAED,wBAAgB,OAAO,CAAC,CAAC,EAAE,GAAG,CAAC,MAAM,CAAC,EAAE,CAAC,EAAE,GAAG,CAAC,MAAM,CAAC,GAAG,MAAM,CAO9D;AAED;;;;GAIG;AACH,wBAAgB,cAAc,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CASnD;AAED,2EAA2E;AAC3E,wBAAgB,UAAU,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAM/C;AAED,wBAAgB,SAAS,CAAC,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,MAAM,CAGhE;AAED,wBAAgB,cAAc,CAAC,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,MAAM,CAKpF;AAED,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,OAAO,EAAE,GAAG,MAAM,CAazD"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "https://json.schemastore.org/package.json",
|
|
3
3
|
"name": "@lexwdex-org/opencode-dcp",
|
|
4
|
-
"version": "
|
|
4
|
+
"version": "4.0.0",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"description": "Semantic pruning for OpenCode native context compaction",
|
|
7
7
|
"main": "./dist/index.js",
|
package/dist/lib/activity.d.ts
DELETED
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
export type ActivityState = "busy" | "idle" | "unknown";
|
|
2
|
-
/**
|
|
3
|
-
* Tracks per-session busy/idle state from host events so compression can be
|
|
4
|
-
* gated on real session activity instead of optimistic assumptions.
|
|
5
|
-
*
|
|
6
|
-
* State sources (in order of preference):
|
|
7
|
-
* - `session.status` events carrying `{ status: { type: "busy" | "idle" } }`
|
|
8
|
-
* - `session.idle` events (authoritative turn-boundary signal)
|
|
9
|
-
*
|
|
10
|
-
* Sessions with no observed events report "unknown"; callers decide what
|
|
11
|
-
* fail-open means for their own trigger surface.
|
|
12
|
-
*/
|
|
13
|
-
export declare class SessionActivityTracker {
|
|
14
|
-
private readonly sessions;
|
|
15
|
-
private readonly now;
|
|
16
|
-
constructor(now?: () => number);
|
|
17
|
-
observe(type: string, properties?: Record<string, any>): void;
|
|
18
|
-
state(sessionID: string): ActivityState;
|
|
19
|
-
dropSession(sessionID: string): void;
|
|
20
|
-
private set;
|
|
21
|
-
}
|
|
22
|
-
//# sourceMappingURL=activity.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"activity.d.ts","sourceRoot":"","sources":["../../lib/activity.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,aAAa,GAAG,MAAM,GAAG,MAAM,GAAG,SAAS,CAAA;AAYvD;;;;;;;;;;GAUG;AACH,qBAAa,sBAAsB;IAC/B,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAqC;IAC9D,OAAO,CAAC,QAAQ,CAAC,GAAG,CAAc;gBAEtB,GAAG,CAAC,EAAE,MAAM,MAAM;IAI9B,OAAO,CAAC,IAAI,EAAE,MAAM,EAAE,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,IAAI;IAe7D,KAAK,CAAC,SAAS,EAAE,MAAM,GAAG,aAAa;IAOvC,WAAW,CAAC,SAAS,EAAE,MAAM,GAAG,IAAI;IAIpC,OAAO,CAAC,GAAG;CAUd"}
|
package/dist/lib/auto-prune.d.ts
DELETED
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import type { AutoPruneConfig } from "./config";
|
|
2
|
-
export type PruneSignal = "topic-drift" | "volume" | "idle-gap";
|
|
3
|
-
export interface ObserveResult {
|
|
4
|
-
signals: PruneSignal[];
|
|
5
|
-
}
|
|
6
|
-
export declare function tokenize(text: string): Set<string>;
|
|
7
|
-
export declare function jaccard(a: Set<string>, b: Set<string>): number;
|
|
8
|
-
export declare class AutoPruner {
|
|
9
|
-
private readonly config;
|
|
10
|
-
private readonly sessions;
|
|
11
|
-
private readonly now;
|
|
12
|
-
constructor(config: AutoPruneConfig, now?: () => number);
|
|
13
|
-
observeUserMessage(sessionID: string, parts: unknown[], at?: number): ObserveResult;
|
|
14
|
-
consumePending(sessionID: string, at?: number): PruneSignal[] | null;
|
|
15
|
-
markPruned(sessionID: string, at?: number): void;
|
|
16
|
-
dropSession(sessionID: string): void;
|
|
17
|
-
private evaluate;
|
|
18
|
-
private state;
|
|
19
|
-
}
|
|
20
|
-
//# sourceMappingURL=auto-prune.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"auto-prune.d.ts","sourceRoot":"","sources":["../../lib/auto-prune.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,UAAU,CAAA;AAE/C,MAAM,MAAM,WAAW,GAAG,aAAa,GAAG,QAAQ,GAAG,UAAU,CAAA;AAE/D,MAAM,WAAW,aAAa;IAC1B,OAAO,EAAE,WAAW,EAAE,CAAA;CACzB;AAUD,wBAAgB,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,GAAG,CAAC,MAAM,CAAC,CAiBlD;AAED,wBAAgB,OAAO,CAAC,CAAC,EAAE,GAAG,CAAC,MAAM,CAAC,EAAE,CAAC,EAAE,GAAG,CAAC,MAAM,CAAC,GAAG,MAAM,CAO9D;AAwBD,qBAAa,UAAU;IAKf,OAAO,CAAC,QAAQ,CAAC,MAAM;IAJ3B,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAkC;IAC3D,OAAO,CAAC,QAAQ,CAAC,GAAG,CAAc;gBAGb,MAAM,EAAE,eAAe,EACxC,GAAG,CAAC,EAAE,MAAM,MAAM;IAKtB,kBAAkB,CAAC,SAAS,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,EAAE,EAAE,EAAE,SAAa,GAAG,aAAa;IAoBvF,cAAc,CAAC,SAAS,EAAE,MAAM,EAAE,EAAE,SAAa,GAAG,WAAW,EAAE,GAAG,IAAI;IAUxE,UAAU,CAAC,SAAS,EAAE,MAAM,EAAE,EAAE,SAAa,GAAG,IAAI;IASpD,WAAW,CAAC,SAAS,EAAE,MAAM,GAAG,IAAI;IAIpC,OAAO,CAAC,QAAQ;IA6BhB,OAAO,CAAC,KAAK;CAYhB"}
|
|
@@ -1,99 +0,0 @@
|
|
|
1
|
-
import type { SessionActivityTracker } from "./activity";
|
|
2
|
-
import type { Logger } from "./logger";
|
|
3
|
-
import type { OpenCodeClient } from "./opencode-client";
|
|
4
|
-
import type { SummarizeCoordinator } from "./summarize";
|
|
5
|
-
/**
|
|
6
|
-
* How a trigger surface wants the service to react when the session is (or may
|
|
7
|
-
* be) mid-turn:
|
|
8
|
-
* - `"defer"`: compaction must never interrupt a running turn. Queue the prune
|
|
9
|
-
* and execute it at the next observed turn boundary. Used by the
|
|
10
|
-
* model-invokable tool, which by definition executes mid-turn.
|
|
11
|
-
* - `"proceed"`: fire at turn boundaries anyway; only stand down on positive
|
|
12
|
-
* busy evidence. Used by idle-driven auto prune and the manual command.
|
|
13
|
-
*/
|
|
14
|
-
export type PruneBusyPolicy = "defer" | "proceed";
|
|
15
|
-
export type PruneOutcome = {
|
|
16
|
-
status: "succeeded";
|
|
17
|
-
} | {
|
|
18
|
-
status: "deferred";
|
|
19
|
-
} | {
|
|
20
|
-
status: "busy";
|
|
21
|
-
} | {
|
|
22
|
-
status: "no-model";
|
|
23
|
-
} | {
|
|
24
|
-
status: "cooldown";
|
|
25
|
-
retryAfterMs: number;
|
|
26
|
-
} | {
|
|
27
|
-
status: "failed";
|
|
28
|
-
error: string;
|
|
29
|
-
};
|
|
30
|
-
export interface PruneRequest {
|
|
31
|
-
sessionID: string;
|
|
32
|
-
onBusy: PruneBusyPolicy;
|
|
33
|
-
}
|
|
34
|
-
export interface PruneServiceDeps {
|
|
35
|
-
client: OpenCodeClient;
|
|
36
|
-
summarize: SummarizeCoordinator;
|
|
37
|
-
activity: SessionActivityTracker;
|
|
38
|
-
logger: Logger;
|
|
39
|
-
}
|
|
40
|
-
/** Host event names this service derives safety decisions from. */
|
|
41
|
-
export type PruneEventName = "session.idle" | "session.status" | "session.compacted" | "session.deleted" | (string & {});
|
|
42
|
-
/** Ceil a cooldown to whole seconds for user-facing copy. */
|
|
43
|
-
export declare function retrySeconds(retryAfterMs: number): number;
|
|
44
|
-
/**
|
|
45
|
-
* Resolves the session ID from a host event's properties. Most events carry
|
|
46
|
-
* `sessionID` directly, but some (e.g. `session.deleted`) only carry
|
|
47
|
-
* `info: Session`. Returns `undefined` when neither is a non-empty string.
|
|
48
|
-
*/
|
|
49
|
-
export declare function eventSessionID(properties?: Record<string, any>): string | undefined;
|
|
50
|
-
/**
|
|
51
|
-
* The single compression entry point. Every trigger surface (model tool,
|
|
52
|
-
* heuristic auto prune, manual command) goes through `request`; the service
|
|
53
|
-
* owns everything a caller must not have to know: session busy state, the
|
|
54
|
-
* never-interrupt-a-running-turn invariant, deferral to the next turn
|
|
55
|
-
* boundary, session model resolution, and delegation to the native
|
|
56
|
-
* summarize coordinator (single-flight + failure cooldown).
|
|
57
|
-
*
|
|
58
|
-
* `request` never rejects: every failure mode is a `PruneOutcome`.
|
|
59
|
-
*/
|
|
60
|
-
export declare class PruneService {
|
|
61
|
-
private readonly deferred;
|
|
62
|
-
private readonly client;
|
|
63
|
-
private readonly summarize;
|
|
64
|
-
private readonly activity;
|
|
65
|
-
private readonly logger;
|
|
66
|
-
constructor(deps: PruneServiceDeps);
|
|
67
|
-
/**
|
|
68
|
-
* Feed every host event through here. Drains the deferral queue on
|
|
69
|
-
* `session.idle` and forgets queued prunes once a compaction (or the
|
|
70
|
-
* session itself) is gone.
|
|
71
|
-
*/
|
|
72
|
-
observeEvent(type: PruneEventName, properties?: Record<string, any>): void;
|
|
73
|
-
request(request: PruneRequest): Promise<PruneOutcome>;
|
|
74
|
-
/** One admission check; `null` means the request may proceed. */
|
|
75
|
-
private gate;
|
|
76
|
-
/**
|
|
77
|
-
* Executes a queued prune at the idle boundary. The tool already promised
|
|
78
|
-
* its caller this prune would run; losing the busy race must not silently
|
|
79
|
-
* break that promise, so a busy outcome re-queues for the next idle
|
|
80
|
-
* boundary. Every other outcome is terminal: it is logged and never
|
|
81
|
-
* retried — new prune demand arrives through new triggers only.
|
|
82
|
-
* Execution is re-guarded on every attempt, so re-queueing never violates
|
|
83
|
-
* the never-interrupt invariant.
|
|
84
|
-
*/
|
|
85
|
-
private drainQueued;
|
|
86
|
-
/**
|
|
87
|
-
* Turns an admission decision into a terminal outcome, or `null` when the
|
|
88
|
-
* request may proceed. Deferral additionally enqueues the session.
|
|
89
|
-
*/
|
|
90
|
-
private outcomeFor;
|
|
91
|
-
private admit;
|
|
92
|
-
/**
|
|
93
|
-
* Queries the host's live session status. Returns `null` when the answer
|
|
94
|
-
* is unknown (endpoint or SDK method missing, request failed) — callers
|
|
95
|
-
* must fail open in that case.
|
|
96
|
-
*/
|
|
97
|
-
private isBusyOnServer;
|
|
98
|
-
}
|
|
99
|
-
//# sourceMappingURL=prune-service.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"prune-service.d.ts","sourceRoot":"","sources":["../../lib/prune-service.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,YAAY,CAAA;AACxD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,UAAU,CAAA;AACtC,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAA;AAEvD,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAA;AAEvD;;;;;;;;GAQG;AACH,MAAM,MAAM,eAAe,GAAG,OAAO,GAAG,SAAS,CAAA;AAEjD,MAAM,MAAM,YAAY,GAClB;IAAE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I,EAAE,cAAc,EAAE,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,IAAI;IAoBpE,OAAO,CAAC,OAAO,EAAE,YAAY,GAAG,OAAO,CAAC,YAAY,CAAC;IAmC3D,iEAAiE;IACjE,OAAO,CAAC,IAAI;IAIZ;;;;;;;;OAQG;YACW,WAAW;IAqBzB;;;OAGG;YACW,UAAU;IAaxB,OAAO,CAAC,KAAK;IAUb;;;;OAIG;YACW,cAAc;CAe/B"}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import type { OpenCodeClient } from "./opencode-client";
|
|
2
|
-
export interface SessionModel {
|
|
3
|
-
providerID: string;
|
|
4
|
-
modelID: string;
|
|
5
|
-
}
|
|
6
|
-
export declare function latestUserModel(messages: unknown): SessionModel | null;
|
|
7
|
-
export declare function resolveSessionModel(client: OpenCodeClient, sessionID: string): Promise<SessionModel | null>;
|
|
8
|
-
//# sourceMappingURL=session-model.d.ts.map
|