acp-kernel 0.0.95-pr.457.308 → 0.0.95-pr.457.313
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 +3 -3
- package/dist/compress.d.ts.map +1 -1
- package/dist/index.js +44 -0
- package/dist/index.js.map +1 -1
- package/dist/instance-reid.d.ts +30 -0
- package/dist/instance-reid.d.ts.map +1 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -37,9 +37,9 @@ const state = createInitialState();
|
|
|
37
37
|
const config = defaultConfig(200000); // modelContextLimit (positional); optional overrides as 2nd arg
|
|
38
38
|
|
|
39
39
|
// processTurn runs the canonical node pipeline every turn:
|
|
40
|
-
// assign-refs → sync-blocks → prune → ccr-store →
|
|
41
|
-
// absorb-prompt → filter → hide-compress-calls →
|
|
42
|
-
// → emergency-truncate → render-refs
|
|
40
|
+
// reconcile-live-ids → assign-refs → sync-blocks → prune → ccr-store →
|
|
41
|
+
// absorb-hide → crush → absorb-prompt → filter → hide-compress-calls →
|
|
42
|
+
// recommend → nudge-inject → emergency-truncate → render-refs
|
|
43
43
|
const {
|
|
44
44
|
messages,
|
|
45
45
|
state: nextState,
|
package/dist/compress.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"compress.d.ts","sourceRoot":"","sources":["../src/compress.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"compress.d.ts","sourceRoot":"","sources":["../src/compress.ts"],"names":[],"mappings":"AAKA,OAAO,EAAkC,kBAAkB,EAAE,MAAM,YAAY,CAAC;AAgBhF,OAAO,KAAK,EAAE,mBAAmB,EAAa,MAAM,UAAU,CAAC;AAE/D,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAC;AAI9D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAgBvD,OAAO,EAGL,KAAK,YAAY,EAGlB,MAAM,eAAe,CAAC;AACvB,OAA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M,CAAC;QACf,cAAc,CAAC,EAAE,MAAM,CAAC;QACxB,eAAe,CAAC,EAAE,MAAM,CAAC;KAC1B,EAAE,CAAC;IACJ,QAAQ,EAAE,WAAW,EAAE,CAAC;IACxB,KAAK,EAAE,gBAAgB,CAAC;IACxB,MAAM,EAAE,MAAM,CAAC;IACf,mBAAmB,CAAC,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC;CACnC;AAqND,wBAAgB,UAAU,CAAC,KAAK,GAAE,KAAU,GAAG,eAAe,CA6d7D;AA+qCD,OAAO,EAAE,kBAAkB,EAAE,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -290,6 +290,43 @@ function stripOrphanedReasoning(messages) {
|
|
|
290
290
|
return messages.filter((_, i) => !drop.has(i));
|
|
291
291
|
}
|
|
292
292
|
|
|
293
|
+
// src/instance-reid.ts
|
|
294
|
+
var CONTENT_HASH_ROOT = /^h_([0-9a-f]{16})(?:_\d+)?(?:#.*)?$/;
|
|
295
|
+
function clusterRoot(id) {
|
|
296
|
+
const m = CONTENT_HASH_ROOT.exec(id);
|
|
297
|
+
return m ? `h_${m[1]}` : null;
|
|
298
|
+
}
|
|
299
|
+
function remintCoveredLiveIds(messages, state) {
|
|
300
|
+
const covered = /* @__PURE__ */ new Set();
|
|
301
|
+
for (const id of coveredMessageIds(state)) covered.add(baseIdOf(id));
|
|
302
|
+
if (covered.size === 0) return messages;
|
|
303
|
+
const groups = /* @__PURE__ */ new Map();
|
|
304
|
+
for (let i = 0; i < messages.length; i++) {
|
|
305
|
+
const root = clusterRoot(messages[i].id);
|
|
306
|
+
if (root === null) continue;
|
|
307
|
+
const idxs = groups.get(root);
|
|
308
|
+
if (idxs) idxs.push(i);
|
|
309
|
+
else groups.set(root, [i]);
|
|
310
|
+
}
|
|
311
|
+
const next = [...messages];
|
|
312
|
+
let changed = false;
|
|
313
|
+
for (const [root, idxs] of groups) {
|
|
314
|
+
const conflict = idxs.some((i) => covered.has(baseIdOf(messages[i].id)));
|
|
315
|
+
if (!conflict) continue;
|
|
316
|
+
let k = 1;
|
|
317
|
+
for (const i of idxs) {
|
|
318
|
+
while (covered.has(`${root}_${k}`)) k++;
|
|
319
|
+
const id = messages[i].id;
|
|
320
|
+
const hash = id.indexOf("#");
|
|
321
|
+
const tail = hash > 0 ? id.slice(hash) : "";
|
|
322
|
+
next[i] = { ...messages[i], id: `${root}_${k}${tail}` };
|
|
323
|
+
k++;
|
|
324
|
+
changed = true;
|
|
325
|
+
}
|
|
326
|
+
}
|
|
327
|
+
return changed ? next : messages;
|
|
328
|
+
}
|
|
329
|
+
|
|
293
330
|
// src/sync.ts
|
|
294
331
|
function syncBlocks(messages, state) {
|
|
295
332
|
const presentIds = new Set(messages.map((message) => message.id));
|
|
@@ -5013,6 +5050,7 @@ function createCore(ports = {}) {
|
|
|
5013
5050
|
}
|
|
5014
5051
|
function buildNodes(strategy) {
|
|
5015
5052
|
const base = [
|
|
5053
|
+
reconcileLiveIdsNode,
|
|
5016
5054
|
assignRefsNode,
|
|
5017
5055
|
syncBlocksNode,
|
|
5018
5056
|
pruneNode,
|
|
@@ -5039,6 +5077,12 @@ function createCore(ports = {}) {
|
|
|
5039
5077
|
status
|
|
5040
5078
|
};
|
|
5041
5079
|
}
|
|
5080
|
+
var reconcileLiveIdsNode = {
|
|
5081
|
+
name: "reconcile-live-ids",
|
|
5082
|
+
run(io) {
|
|
5083
|
+
return { ...io, messages: remintCoveredLiveIds(io.messages, io.state) };
|
|
5084
|
+
}
|
|
5085
|
+
};
|
|
5042
5086
|
var assignRefsNode = {
|
|
5043
5087
|
name: "assign-refs",
|
|
5044
5088
|
run(io, ctx) {
|