acp-kernel 0.0.86 → 0.0.87-pr.393.249
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/dist/cache-report.d.ts +4 -2
- package/dist/cache-report.d.ts.map +1 -1
- package/dist/{chunk-6RNVHY67.js → chunk-NUQZKPQS.js} +2 -2
- package/dist/{chunk-6RNVHY67.js.map → chunk-NUQZKPQS.js.map} +1 -1
- package/dist/compress-tools.d.ts +352 -55
- package/dist/compress-tools.d.ts.map +1 -1
- package/dist/index.js +87 -87
- package/dist/index.js.map +1 -1
- package/dist/panel/index.js +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -16,7 +16,7 @@ import {
|
|
|
16
16
|
resolvePrompts,
|
|
17
17
|
thinkingTokenValue,
|
|
18
18
|
viableRanges
|
|
19
|
-
} from "./chunk-
|
|
19
|
+
} from "./chunk-NUQZKPQS.js";
|
|
20
20
|
import {
|
|
21
21
|
activeBlocks,
|
|
22
22
|
advanceSurvival,
|
|
@@ -588,50 +588,89 @@ var ACP_SEARCH_OPEN = "<acp_search>";
|
|
|
588
588
|
var ACP_SEARCH_CLOSE = "</acp_search>";
|
|
589
589
|
var ACP_DECOMPRESS_OPEN = "<acp_decompress>";
|
|
590
590
|
var ACP_DECOMPRESS_CLOSE = "</acp_decompress>";
|
|
591
|
-
var
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
591
|
+
var COMPRESS_RANGE_OBJECT = {
|
|
592
|
+
type: "object",
|
|
593
|
+
properties: {
|
|
594
|
+
topic: { type: "string" },
|
|
595
|
+
startId: {
|
|
596
|
+
type: "string",
|
|
597
|
+
description: "mNNNNN ref at the start of the range"
|
|
598
|
+
},
|
|
599
|
+
endId: {
|
|
600
|
+
type: "string",
|
|
601
|
+
description: "mNNNNN ref at the end of the range"
|
|
602
|
+
},
|
|
603
|
+
startRef: {
|
|
604
|
+
type: "string",
|
|
605
|
+
description: "Alternate spelling of startId"
|
|
606
|
+
},
|
|
607
|
+
endRef: {
|
|
608
|
+
type: "string",
|
|
609
|
+
description: "Alternate spelling of endId"
|
|
610
|
+
},
|
|
611
|
+
summary: {
|
|
612
|
+
type: "string",
|
|
613
|
+
description: "Self-contained summary replacing the range"
|
|
614
|
+
}
|
|
615
|
+
},
|
|
616
|
+
anyOf: [
|
|
617
|
+
{ required: ["startId", "endId", "summary"] },
|
|
618
|
+
{ required: ["startRef", "endRef", "summary"] }
|
|
619
|
+
]
|
|
620
|
+
};
|
|
621
|
+
var COMPRESS_PARAMETERS = {
|
|
622
|
+
type: "object",
|
|
623
|
+
properties: {
|
|
624
|
+
topic: {
|
|
625
|
+
type: "string",
|
|
626
|
+
description: "Optional short title for the compressed range"
|
|
627
|
+
},
|
|
628
|
+
content: {
|
|
629
|
+
type: ["array", "string"],
|
|
630
|
+
description: "One or more ranges to compress into separate summary blocks. Array form (preferred): one entry per range \u2014 line form (one STRING per range: first line 'm00150\u2013m00220 optional topic', remaining lines the markdown summary verbatim) or object form {startId,endId,summary,topic?}. String form also accepted: bare line-form text, or a JSON-encoded array of ranges (some gateways stringify arrays). REQUIRED unless the flat single-range form is used.",
|
|
631
|
+
items: {
|
|
632
|
+
anyOf: [
|
|
633
|
+
{
|
|
634
|
+
type: "string",
|
|
635
|
+
description: "Line form: first line 'm00150\u2013m00220 optional topic', remaining lines the summary markdown, verbatim (no JSON escaping)"
|
|
636
|
+
},
|
|
637
|
+
COMPRESS_RANGE_OBJECT
|
|
638
|
+
]
|
|
631
639
|
}
|
|
632
640
|
},
|
|
633
|
-
|
|
634
|
-
|
|
641
|
+
startId: {
|
|
642
|
+
type: "string",
|
|
643
|
+
description: "Flat single-range form (no content): mNNNNN ref at the start of the range"
|
|
644
|
+
},
|
|
645
|
+
endId: {
|
|
646
|
+
type: "string",
|
|
647
|
+
description: "Flat single-range form (no content): mNNNNN ref at the end of the range"
|
|
648
|
+
},
|
|
649
|
+
startRef: {
|
|
650
|
+
type: "string",
|
|
651
|
+
description: "Flat single-range form: alternate spelling of startId"
|
|
652
|
+
},
|
|
653
|
+
endRef: {
|
|
654
|
+
type: "string",
|
|
655
|
+
description: "Flat single-range form: alternate spelling of endId"
|
|
656
|
+
},
|
|
657
|
+
summary: {
|
|
658
|
+
type: "string",
|
|
659
|
+
description: "Flat single-range form (no content): self-contained summary replacing the range"
|
|
660
|
+
}
|
|
661
|
+
},
|
|
662
|
+
anyOf: [
|
|
663
|
+
{ required: ["content"] },
|
|
664
|
+
{
|
|
665
|
+
required: ["summary"],
|
|
666
|
+
anyOf: [{ required: ["startId", "endId"] }, { required: ["startRef", "endRef"] }]
|
|
667
|
+
}
|
|
668
|
+
]
|
|
669
|
+
};
|
|
670
|
+
var COMPRESS_TOOL = {
|
|
671
|
+
name: COMPRESS_TOOL_NAME,
|
|
672
|
+
description: "Replace consumed conversation ranges with self-contained summaries you write, identified by their refs. Line form (preferred): content = one STRING per range \u2014 first line 'm00150\u2013m00220 optional topic', remaining lines the markdown summary written verbatim (no JSON structure, no escaping). Also accepted: object entries {startId,endId,summary,topic?} in the content array, content as a single string (bare line form or JSON-encoded array), and a flat single-range call {startId,endId,summary,topic?} without content. Use when content is genuinely consumed. REQUIRED \u2014 compress without content or flat range fields is invalid.",
|
|
673
|
+
input_schema: COMPRESS_PARAMETERS
|
|
635
674
|
};
|
|
636
675
|
function parseCompressInput(input, callId, onWarn) {
|
|
637
676
|
if (!input || typeof input !== "object") {
|
|
@@ -681,47 +720,7 @@ var COMPRESS_TOOL_OPENAI = {
|
|
|
681
720
|
function: {
|
|
682
721
|
name: COMPRESS_TOOL_NAME,
|
|
683
722
|
description: COMPRESS_TOOL.description,
|
|
684
|
-
parameters:
|
|
685
|
-
type: "object",
|
|
686
|
-
properties: {
|
|
687
|
-
topic: {
|
|
688
|
-
type: "string",
|
|
689
|
-
description: "Optional short title for the compressed range"
|
|
690
|
-
},
|
|
691
|
-
content: {
|
|
692
|
-
type: "array",
|
|
693
|
-
description: "One or more ranges to compress into separate summary blocks. Line form (preferred): one string per range \u2014 first line 'm00150\u2013m00220 optional topic', remaining lines the markdown summary verbatim. Object form also accepted. REQUIRED \u2014 compress without content is invalid.",
|
|
694
|
-
items: {
|
|
695
|
-
anyOf: [
|
|
696
|
-
{
|
|
697
|
-
type: "string",
|
|
698
|
-
description: "Line form: first line 'm00150\u2013m00220 optional topic', remaining lines the summary markdown, verbatim (no JSON escaping)"
|
|
699
|
-
},
|
|
700
|
-
{
|
|
701
|
-
type: "object",
|
|
702
|
-
properties: {
|
|
703
|
-
topic: { type: "string" },
|
|
704
|
-
startId: {
|
|
705
|
-
type: "string",
|
|
706
|
-
description: "mNNNNN ref at the start of the range"
|
|
707
|
-
},
|
|
708
|
-
endId: {
|
|
709
|
-
type: "string",
|
|
710
|
-
description: "mNNNNN ref at the end of the range"
|
|
711
|
-
},
|
|
712
|
-
summary: {
|
|
713
|
-
type: "string",
|
|
714
|
-
description: "Self-contained summary replacing the range"
|
|
715
|
-
}
|
|
716
|
-
},
|
|
717
|
-
required: ["startId", "endId", "summary"]
|
|
718
|
-
}
|
|
719
|
-
]
|
|
720
|
-
}
|
|
721
|
-
}
|
|
722
|
-
},
|
|
723
|
-
required: ["content"]
|
|
724
|
-
}
|
|
723
|
+
parameters: COMPRESS_PARAMETERS
|
|
725
724
|
}
|
|
726
725
|
};
|
|
727
726
|
var FUNCTION_PROMPT_SECTIONS = [
|
|
@@ -907,7 +906,7 @@ var ACP_STATUS_TOOL_OPENAI = {
|
|
|
907
906
|
}
|
|
908
907
|
}
|
|
909
908
|
};
|
|
910
|
-
var ACP_CACHE_TOOL_DESCRIPTION = `Prompt-cache reconciliation: grand ledger (total input/cached/output, overall hit rate) with every request's miss split into new content / compression re-pay /
|
|
909
|
+
var ACP_CACHE_TOOL_DESCRIPTION = `Prompt-cache reconciliation: grand ledger (total input/cached/output, overall hit rate) with every request's miss split into new content / compression re-pay / upstream-ttl-or-client-rewrite (unattributed stable-prefix misses), plus per-fold economics (breakeven turns vs measured cadence). Defaults to a compact summary (totals + verdicts + anomalies only); pass detail="full" for every fold and line item. Read-only. Call when asked about cache hits, cache invalidation, or what compression costs.`;
|
|
911
910
|
var ACP_CACHE_TOOL_OPENAI = {
|
|
912
911
|
type: "function",
|
|
913
912
|
function: {
|
|
@@ -6202,7 +6201,7 @@ function formatCacheReportFull(report) {
|
|
|
6202
6201
|
);
|
|
6203
6202
|
out.push(` compress re-pay ${fmtTok(t.compRepay)} tok (caused by folds)`);
|
|
6204
6203
|
out.push(
|
|
6205
|
-
` ttl
|
|
6204
|
+
` upstream-ttl-or-client-rewrite (unattributed) ${fmtTok(t.ttlRepay)} tok (stable-prefix misses: upstream TTL expiry / eviction or client-side wire rewrite \u2014 kernel cannot distinguish)`
|
|
6206
6205
|
);
|
|
6207
6206
|
out.push(
|
|
6208
6207
|
` identity check ${t.balanced ? "OK" : "BROKEN"} \u2014 ${fmtTok(t.input)} = ${fmtTok(t.cached)} + ${fmtTok(t.newContent)} + ${fmtTok(t.compRepay)} + ${fmtTok(t.ttlRepay)} (residual ${t.residual})`
|
|
@@ -6282,7 +6281,7 @@ function formatCacheReportSummary(report) {
|
|
|
6282
6281
|
return `#${l.seq} ${fmtTok(l.ttlRepay)}${idle}`;
|
|
6283
6282
|
}).join(" \xB7 ");
|
|
6284
6283
|
out.push(
|
|
6285
|
-
` ttl
|
|
6284
|
+
` upstream-ttl-or-client-rewrite (unattributed) ${fmtTok(t.ttlRepay)} tok (stable-prefix misses: upstream TTL expiry / eviction or client-side wire rewrite \u2014 kernel cannot distinguish${spikeText ? `; top spikes: ${spikeText}` : ""})`
|
|
6286
6285
|
);
|
|
6287
6286
|
out.push(
|
|
6288
6287
|
` identity check ${t.balanced ? "OK" : "BROKEN"} \u2014 ${fmtTok(t.input)} = ${fmtTok(t.cached)} + ${fmtTok(t.newContent)} + ${fmtTok(t.compRepay)} + ${fmtTok(t.ttlRepay)} (residual ${t.residual})`
|
|
@@ -7895,6 +7894,7 @@ export {
|
|
|
7895
7894
|
ACP_TOOL_NAMES,
|
|
7896
7895
|
BLOCKED_REF,
|
|
7897
7896
|
BoundaryNotFoundError,
|
|
7897
|
+
COMPRESS_PARAMETERS,
|
|
7898
7898
|
COMPRESS_PHILOSOPHY,
|
|
7899
7899
|
COMPRESS_TOOL,
|
|
7900
7900
|
COMPRESS_TOOL_GOOGLE,
|