acp-kernel 0.0.65-pr.261.113 → 0.0.65

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "acp-kernel",
3
- "version": "0.0.65-pr.261.113",
3
+ "version": "0.0.65",
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",
@@ -1,5 +0,0 @@
1
- import type { Pack, PackSource } from "./types.js";
2
- export declare const defaultPack: Pack;
3
- export declare const leanPack: Pack;
4
- export declare const builtinSource: PackSource;
5
- //# sourceMappingURL=builtin.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"builtin.d.ts","sourceRoot":"","sources":["../../src/packs/builtin.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAEnD,eAAO,MAAM,WAAW,EAAE,IAMzB,CAAC;AASF,eAAO,MAAM,QAAQ,EAAE,IAuCtB,CAAC;AAQF,eAAO,MAAM,aAAa,EAAE,UAQ3B,CAAC"}
@@ -1,8 +0,0 @@
1
- import { type PackSource } from "./types.js";
2
- /**
3
- * A pack directory source: `<dir>/<name>.json` files. One factory serves any
4
- * directory origin (project-local, user-global, installer-managed); the caller
5
- * decides which directories exist and their priority order.
6
- */
7
- export declare function createDirPackSource(id: string, dir: string): PackSource;
8
- //# sourceMappingURL=dir.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"dir.d.ts","sourceRoot":"","sources":["../../src/packs/dir.ts"],"names":[],"mappings":"AAGA,OAAO,EAGL,KAAK,UAAU,EAEhB,MAAM,YAAY,CAAC;AAapB;;;;GAIG;AACH,wBAAgB,mBAAmB,CAAC,EAAE,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,UAAU,CAgCvE"}
@@ -1,25 +0,0 @@
1
- import { type Pack, type PackSource } from "./types.js";
2
- /**
3
- * Ordered pack resolution over pluggable sources. The first non-null wins;
4
- * `listPacks` dedupes by name with the same priority. Custom sources (e.g. an
5
- * installer-managed registry) can be prepended without touching core code.
6
- */
7
- export interface PackResolver {
8
- readonly sources: readonly PackSource[];
9
- resolve(name: string): Pack | null;
10
- listPacks(): Pack[];
11
- }
12
- export declare function createPackResolver(sources: readonly PackSource[]): PackResolver;
13
- export interface DefaultPackSourcesOptions {
14
- /** Project-local pack directory (host decides where that lives). */
15
- projectDir?: string;
16
- /** User-global pack directories, in priority order. */
17
- userDirs?: readonly string[];
18
- }
19
- /**
20
- * The default source chain: project dir > user dirs (in order) > builtins.
21
- * Directory paths are host policy — the kernel never derives them from cwd or
22
- * homedir. Omitting both yields builtins only.
23
- */
24
- export declare function defaultPackSources(options?: DefaultPackSourcesOptions): PackSource[];
25
- //# sourceMappingURL=resolver.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"resolver.d.ts","sourceRoot":"","sources":["../../src/packs/resolver.ts"],"names":[],"mappings":"AAEA,OAAO,EAAmB,KAAK,IAAI,EAAE,KAAK,UAAU,EAAE,MAAM,YAAY,CAAC;AAEzE;;;;GAIG;AACH,MAAM,WAAW,YAAY;IAC3B,QAAQ,CAAC,OAAO,EAAE,SAAS,UAAU,EAAE,CAAC;IACxC,OAAO,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,GAAG,IAAI,CAAC;IACnC,SAAS,IAAI,IAAI,EAAE,CAAC;CACrB;AAED,wBAAgB,kBAAkB,CAChC,OAAO,EAAE,SAAS,UAAU,EAAE,GAC7B,YAAY,CAyBd;AAED,MAAM,WAAW,yBAAyB;IACxC,oEAAoE;IACpE,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,uDAAuD;IACvD,QAAQ,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;CAC9B;AAED;;;;GAIG;AACH,wBAAgB,kBAAkB,CAChC,OAAO,GAAE,yBAA8B,GACtC,UAAU,EAAE,CASd"}
@@ -1,10 +0,0 @@
1
- import type { PackSurface, PromptPackFile } from "./types.js";
2
- /**
3
- * Narrow a raw pack file into a sanitized {@link PackSurface}. Unknown keys,
4
- * wrong types, and empty results are dropped — a bad pack degrades to "no
5
- * override", never corrupts a good default. `adapters` is kept opaquely when
6
- * it is a plain object (shallow-copied so later mutation cannot reach the
7
- * source file's parsed tree).
8
- */
9
- export declare function sanitizePackSurface(pack: PromptPackFile | null | undefined): PackSurface;
10
- //# sourceMappingURL=sanitize.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"sanitize.d.ts","sourceRoot":"","sources":["../../src/packs/sanitize.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,WAAW,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAoE9D;;;;;;GAMG;AACH,wBAAgB,mBAAmB,CACjC,IAAI,EAAE,cAAc,GAAG,IAAI,GAAG,SAAS,GACtC,WAAW,CAyCb"}
@@ -1,65 +0,0 @@
1
- import type { Prompts } from "../prompts.js";
2
- import type { CompressPromptSections, ToolPrompts } from "../surface-config.js";
3
- import type { NudgePromptSections } from "../nudge-text.js";
4
- /**
5
- * Raw on-disk pack JSON schema (user-authored file or future installer
6
- * payload). Every field optional and untyped: {@link sanitizePackSurface}
7
- * narrows it into a {@link PackSurface} before use, so a malformed pack
8
- * degrades to "no override" and never clobbers a good default.
9
- */
10
- export interface PromptPackFile {
11
- name?: string;
12
- version?: string;
13
- description?: string;
14
- prompts?: unknown;
15
- promptSections?: unknown;
16
- nudgeSections?: unknown;
17
- toolPrompts?: unknown;
18
- adapters?: unknown;
19
- }
20
- /**
21
- * Sanitized surface bundle a pack contributes. Every field layers on the
22
- * kernel's surface primitives: `promptSections` applies through the three
23
- * `build*SystemPrompt` builders, `nudgeSections` through `renderNudgeText`,
24
- * `toolPrompts` through `applyAcpToolOverrides`. `adapters.<hostId>` is
25
- * opaque data owned by that host — the kernel stores but never interprets it.
26
- */
27
- export interface PackSurface {
28
- /**
29
- * Load-bearing compression rules. Apply via resolvePrompts(surface.prompts,
30
- * { acknowledgeRisk: true }) — overriding them can degrade summary quality.
31
- */
32
- prompts?: Partial<Prompts>;
33
- promptSections?: CompressPromptSections;
34
- nudgeSections?: NudgePromptSections;
35
- toolPrompts?: ToolPrompts;
36
- adapters?: Record<string, unknown>;
37
- }
38
- /**
39
- * A resolved prompt pack: a name plus a sanitized surface, tagged with its
40
- * provenance (`builtin:lean`, `file:/home/u/.acp/packs/x.json`, …). Built-in
41
- * packs, user file packs, and future installer-managed packs all implement
42
- * this single contract.
43
- */
44
- export interface Pack {
45
- name: string;
46
- version?: string;
47
- description?: string;
48
- surface: PackSurface;
49
- source: string;
50
- }
51
- /**
52
- * A pluggable pack origin. Sources are consulted in resolver order; the first
53
- * non-null wins. Implementations must be safe to call per turn (sync, no throw).
54
- */
55
- export interface PackSource {
56
- readonly id: string;
57
- resolve(name: string): Pack | null;
58
- list?(): Pack[];
59
- }
60
- /**
61
- * Pack names are path-safe identifiers; also guards the `<dir>/<name>.json`
62
- * join in directory sources (rejects traversal and dot-leading names).
63
- */
64
- export declare function isValidPackName(name: string): boolean;
65
- //# sourceMappingURL=types.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/packs/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AAC7C,OAAO,KAAK,EAAE,sBAAsB,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AAChF,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AAE5D;;;;;GAKG;AACH,MAAM,WAAW,cAAc;IAC7B,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,cAAc,CAAC,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