acp-kernel 0.0.42 → 0.0.43

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.
@@ -0,0 +1,32 @@
1
+ import type { CompressRangeSpec } from "./types.js";
2
+ export type CompressParseKind = "ok" | "empty-input" | "not-object" | "missing-content" | "content-not-array" | "malformed-json" | "truncated" | "no-valid-ranges";
3
+ export interface CompressParseDiagnostics {
4
+ /** true only when at least one range was recovered. */
5
+ ok: boolean;
6
+ /** Why the input parsed the way it did. */
7
+ kind: CompressParseKind;
8
+ /** First 800 chars of the raw string input (string inputs only). */
9
+ rawPrefix?: string;
10
+ /** Raw string input length (string inputs only). */
11
+ length?: number;
12
+ /** Top-level keys of the parsed object — catches `content` vs `ranges` drift. */
13
+ keys?: string[];
14
+ /** Entries dropped because they were not valid ranges. */
15
+ invalidItems: number;
16
+ }
17
+ export interface ParsedCompressInput {
18
+ ranges: CompressRangeSpec[];
19
+ diagnostics: CompressParseDiagnostics;
20
+ }
21
+ /**
22
+ * Parse compress tool arguments in any host wire shape.
23
+ *
24
+ * Accepts a decoded object, a JSON string (possibly fenced, trailing-comma,
25
+ * raw-newline, or double-stringified), or a truncated JSON prefix (salvage
26
+ * mode). Invalid entries are skipped, never fatal; the reason is in
27
+ * `diagnostics.kind`.
28
+ */
29
+ export declare function parseCompressArgs(input: unknown, opts?: {
30
+ callId?: string;
31
+ }): ParsedCompressInput;
32
+ //# sourceMappingURL=parse-compress-input.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"parse-compress-input.d.ts","sourceRoot":"","sources":["../src/parse-compress-input.ts"],"names":[],"mappings":"AAsBA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AAEpD,MAAM,MAAM,iBAAiB,GACvB,IAAI,GACJ,aAAa,GACb,YAAY,GACZ,iBAAiB,GACjB,mBAAmB,GACnB,gBAAgB,GAChB,WAAW,GACX,iBAAiB,CAAC;AAExB,MAAM,WAAW,wBAAwB;IACrC,uDAAuD;IACvD,EAAE,EAAE,OAAO,CAAC;IACZ,2CAA2C;IAC3C,IAAI,EAAE,iBAAiB,CAAC;IACxB,oEAAoE;IACpE,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,oDAAoD;IACpD,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,iFAAiF;IACjF,IAAI,CAAC,EAAE,MAAM,EAAE,CAAC;IAChB,0DAA0D;IAC1D,YAAY,EAAE,MAAM,CAAC;CACxB;AAED,MAAM,WAAW,mBAAmB;IAChC,MAAM,EAAE,iBAAiB,EAAE,CAAC;IAC5B,WAAW,EAAE,wBAAwB,CAAC;CACzC;AAED;;;;;;;GAOG;AACH,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,OAAO,EAAE,IAAI,CAAC,EAAE;IAAE,MAAM,CAAC,EAAE,MAAM,CAAA;CAAE,GAAG,mBAAmB,CAmBjG"}
package/dist/rebuild.d.ts CHANGED
@@ -1,11 +1,4 @@
1
1
  import type { CompressionState, CoreMessage } from "./types.js";
2
- export interface CompressInputEntry {
3
- startId?: string;
4
- endId?: string;
5
- messageId?: string;
6
- summary: string;
7
- topic?: string;
8
- }
9
2
  export interface RebuildResult {
10
3
  state: CompressionState;
11
4
  blocksRebuilt: number;
@@ -19,7 +12,9 @@ export interface RebuildPorts {
19
12
  * message order, so they are fork-stable — a ref in a historical compress
20
13
  * input points to the same logical message after a fork regenerates IDs.
21
14
  * The rebuilt state is an approximation: only raw model summaries are
22
- * replayed (no protected-content enrichments).
15
+ * replayed (no protected-content enrichments). Arguments are parsed with
16
+ * the lenient parseCompressArgs, so truncated or stringified historical
17
+ * inputs are salvaged instead of silently dropped.
23
18
  */
24
19
  export declare function rebuildCompressionState(state: CompressionState, messages: CoreMessage[], config: import("./types.js").Config, ports?: RebuildPorts): RebuildResult;
25
20
  //# sourceMappingURL=rebuild.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"rebuild.d.ts","sourceRoot":"","sources":["../src/rebuild.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,gBAAgB,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAEhE,MAAM,WAAW,kBAAkB;IAC/B,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,CAAC,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,WAAW,aAAa;IAC1B,KAAK,EAAE,gBAAgB,CAAC;IACxB,aAAa,EAAE,MAAM,CAAC;CACzB;AAED,MAAM,WAAW,YAAY;IACzB,WAAW,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,MAAM,CAAC;CAC1C;AAED;;;;;;;GAOG;AACH,wBAAgB,uBAAuB,CACnC,KAAK,EAAE,gBAAgB,EACvB,QAAQ,EAAE,WAAW,EAAE,EACvB,MAAM,EAAE,OAAO,YAAY,EAAE,MAAM,EACnC,KAAK,GAAE,YAAiB,GACzB,aAAa,CAoBf"}
1
+ {"version":3,"file":"rebuild.d.ts","sourceRoot":"","sources":["../src/rebuild.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,gBAAgB,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAEhE,MAAM,WAAW,aAAa;IAC1B,KAAK,EAAE,gBAAgB,CAAC;IACxB,aAAa,EAAE,MAAM,CAAC;CACzB;AAED,MAAM,WAAW,YAAY;IACzB,WAAW,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,MAAM,CAAC;CAC1C;AAED;;;;;;;;;GASG;AACH,wBAAgB,uBAAuB,CACnC,KAAK,EAAE,gBAAgB,EACvB,QAAQ,EAAE,WAAW,EAAE,EACvB,MAAM,EAAE,OAAO,YAAY,EAAE,MAAM,EACnC,KAAK,GAAE,YAAiB,GACzB,aAAa,CAoBf"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "acp-kernel",
3
- "version": "0.0.42",
3
+ "version": "0.0.43",
4
4
  "description": "Framework-agnostic context-compression engine (model-driven, 3-tier LSM). Pure core: no host dependency.",
5
5
  "license": "MIT",
6
6
  "author": "ranxianglei",