acp-kernel 0.0.65-pr.260.111 → 0.0.65-pr.260.112
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 +21 -0
- package/dist/index.js +15 -15
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
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
|
@@ -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
|
|
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
|
|
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;
|