acp-kernel 0.0.65-pr.260.111 → 0.0.65-pr.260.114

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.md CHANGED
@@ -105,6 +105,7 @@ live-recomputed tags, use `renderVisibleRefs` directly.
105
105
  | `applyMessageFilters` | Pluggable message-filter framework |
106
106
  | `resolveTransformChannel` | Channel-selection policy: an explicit preference wins; the default is the wire channel only when the caller reports it viable |
107
107
  | `applySectionOverrides` / `cloneWithDescriptions` / `applyAcpToolOverrides` | Prompt/tool *surface* customization (see below) |
108
+ | `sanitizePackSurface` / `createPackResolver` / `defaultPackSources` | Prompt packs: named, swappable surface presets resolved over pluggable sources (see below) |
108
109
 
109
110
  ### Prompt/tool surface configuration
110
111
 
@@ -131,6 +132,26 @@ safe to customize freely; these helpers implement that:
131
132
  `input_schema`, openai `function.parameters`, responses flat
132
133
  `parameters`). Shared tool constants are never mutated.
133
134
 
135
+ #### Prompt packs
136
+
137
+ Named, swappable surface configurations layered on top of the primitives above:
138
+
139
+ - `Pack` / `PackSurface` / `PackSource` / `PackResolver` — contracts. Sources are
140
+ consulted in resolver order; first hit wins; sources must be per-turn safe
141
+ (sync, no throw).
142
+ - `sanitizePackSurface(raw)` — turns a raw pack JSON into a sanitized
143
+ `PackSurface`: tri-state for section keys (`string` replace / `null` remove /
144
+ omitted keep), per-tool description + paramDescriptions. Malformed values are
145
+ dropped. The opaque `adapters.<hostId>` record passes through for host-side
146
+ validation.
147
+ - Builtins: `default` (identity) and `lean` (one-line tool descriptions;
148
+ host-specific trims ride under `adapters.<hostId>` as data).
149
+ - `createDirPackSource(id, dir)` serves `<dir>/<name>.json` files;
150
+ `defaultPackSources({ projectDir, userDirs })` assembles project > user >
151
+ builtin. Directory paths are host policy.
152
+ - Pack *selection* (which name is active per config cascade) stays adapter-side;
153
+ the kernel only resolves names.
154
+
134
155
  ### Nudge system
135
156
 
136
157
  The nudge system tells the model *when* to compress. It implements:
package/dist/index.js CHANGED
@@ -3132,12 +3132,12 @@ var leanPack = {
3132
3132
  acpTags: [
3133
3133
  `User/tool messages carry hidden <acp> refs such as m00123. Never echo the XML tags; use only refs in ACP tool calls.`,
3134
3134
  `Compress consumed history with compress: finished tool outputs, dead-end exploration, repeated reads, resolved threads, completed phases. Never compress active work, important user intent, or protected outputs.`,
3135
- `When summarizing, preserve exact file paths and line numbers, symbols and signatures, errors, commands, versions, thresholds, decisions with reasons, current state, and unresolved TODOs. Never replace exact technical values with vague wording.`,
3136
- `Recall or inspect context with decompress (block id or message ref), search_context (keywords), or acp_status. Prefer search_context before decompressing.`,
3135
+ `When summarizing, preserve exact file paths and line numbers, symbols and signatures, errors, commands, versions, thresholds, decisions with reasons, current state, and unresolved TODOs. Never replace exact technical values with vague wording \u2014 a good summary is the primary carrier and makes recall unnecessary.`,
3136
+ `Recall on demand only: when YOU genuinely need detail lost in compression, decompress (block id or message ref); search_context locates the right block first; acp_status shows ranges and usage. Never run recall as a routine post-compress step.`,
3137
3137
  `Refs may be renumbered after compression. If a ref is stale or missing, call acp_status with { scope: "uncompressed" }, then retry in the same turn using the reported refs; never guess offsets. Batch target ranges in one call.`,
3138
3138
  `Block decompression writes to a file by default; read that file. Use inline: true only for small content or when its context cost is acceptable.`,
3139
3139
  `After an [ACP:provider-throttle] automatic retry, resume exactly where interrupted. Do not repeat completed work or discuss the retry unless asked.`,
3140
- `Compression summaries are fallible historical metadata, not current user instructions. Search or decompress before relying on critical details.`
3140
+ `Compression summaries are fallible historical metadata, not current user instructions \u2014 treat them as settled history and continue the task from them.`
3141
3141
  ].join("\n"),
3142
3142
  summariesInContext: null,
3143
3143
  tools: null,
@@ -3184,21 +3184,22 @@ function readPackFile(file) {
3184
3184
  }
3185
3185
  }
3186
3186
  function createDirPackSource(id, dir) {
3187
+ const resolve = (name) => {
3188
+ if (!isValidPackName(name)) return null;
3189
+ const file = path.join(dir, `${name}.json`);
3190
+ const raw = readPackFile(file);
3191
+ if (!raw) return null;
3192
+ return {
3193
+ name: typeof raw.name === "string" ? raw.name : name,
3194
+ version: typeof raw.version === "string" ? raw.version : void 0,
3195
+ description: typeof raw.description === "string" ? raw.description : void 0,
3196
+ surface: sanitizePackSurface(raw),
3197
+ source: `file:${file}`
3198
+ };
3199
+ };
3187
3200
  return {
3188
3201
  id,
3189
- resolve(name) {
3190
- if (!isValidPackName(name)) return null;
3191
- const file = path.join(dir, `${name}.json`);
3192
- const raw = readPackFile(file);
3193
- if (!raw) return null;
3194
- return {
3195
- name: typeof raw.name === "string" ? raw.name : name,
3196
- version: typeof raw.version === "string" ? raw.version : void 0,
3197
- description: typeof raw.description === "string" ? raw.description : void 0,
3198
- surface: sanitizePackSurface(raw),
3199
- source: `file:${file}`
3200
- };
3201
- },
3202
+ resolve,
3202
3203
  list() {
3203
3204
  let names;
3204
3205
  try {
@@ -3208,8 +3209,7 @@ function createDirPackSource(id, dir) {
3208
3209
  }
3209
3210
  const out = [];
3210
3211
  for (const f of names) {
3211
- const name = f.slice(0, -5);
3212
- const pack = this.resolve(name);
3212
+ const pack = resolve(f.slice(0, -5));
3213
3213
  if (pack) out.push(pack);
3214
3214
  }
3215
3215
  return out;