@qilin-agent/output-retention 3.1.7 → 3.1.9
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/lib/index.js +7 -0
- package/lib/types/index.d.ts +7 -0
- package/package.json +3 -3
package/lib/index.js
CHANGED
|
@@ -290,6 +290,13 @@ function truncateWithoutSplittingSurrogatePair(text, maxChars) {
|
|
|
290
290
|
const capped = text.slice(0, maxChars);
|
|
291
291
|
return /[\uD800-\uDBFF]$/.test(capped) ? capped.slice(0, -1) : capped;
|
|
292
292
|
}
|
|
293
|
+
/**
|
|
294
|
+
* Render one retention notice as a single line: the omitted-work summary, then
|
|
295
|
+
* the recovery hint.
|
|
296
|
+
* @param notice - what the retention policy dropped.
|
|
297
|
+
* @param recovery - renders the human-facing recovery hint for the notice.
|
|
298
|
+
* @returns the joined notice text, empty parts skipped.
|
|
299
|
+
*/
|
|
293
300
|
function formatRetentionNotice(notice, recovery) {
|
|
294
301
|
return [describeOmitted(notice.omitted, notice.unit), recovery(notice)].filter((part) => part.length > 0).join(" ");
|
|
295
302
|
}
|
package/lib/types/index.d.ts
CHANGED
|
@@ -229,5 +229,12 @@ export declare function describeOmitted(omitted: Omitted, unit: RetentionNotice[
|
|
|
229
229
|
* @returns the capped text, unchanged when it already fits.
|
|
230
230
|
*/
|
|
231
231
|
export declare function truncateWithoutSplittingSurrogatePair(text: string, maxChars: number): string;
|
|
232
|
+
/**
|
|
233
|
+
* Render one retention notice as a single line: the omitted-work summary, then
|
|
234
|
+
* the recovery hint.
|
|
235
|
+
* @param notice - what the retention policy dropped.
|
|
236
|
+
* @param recovery - renders the human-facing recovery hint for the notice.
|
|
237
|
+
* @returns the joined notice text, empty parts skipped.
|
|
238
|
+
*/
|
|
232
239
|
export declare function formatRetentionNotice(notice: RetentionNotice, recovery: (notice: RetentionNotice) => string): string;
|
|
233
240
|
//# sourceMappingURL=index.d.ts.map
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@qilin-agent/output-retention",
|
|
3
3
|
"description": "Zero-dependency bounded-retention primitive: ItemRetainer/TextRetainer + neutral notice helpers (what did we keep, what did we omit)",
|
|
4
|
-
"version": "3.1.
|
|
4
|
+
"version": "3.1.9",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
7
7
|
},
|
|
@@ -30,9 +30,9 @@
|
|
|
30
30
|
],
|
|
31
31
|
"license": "MIT",
|
|
32
32
|
"peerDependencies": {
|
|
33
|
-
"@qilin-agent/kylin": "~4.0.
|
|
33
|
+
"@qilin-agent/kylin": "~4.0.7"
|
|
34
34
|
},
|
|
35
35
|
"devDependencies": {
|
|
36
|
-
"@qilin-agent/kylin": "~4.0.
|
|
36
|
+
"@qilin-agent/kylin": "~4.0.7"
|
|
37
37
|
}
|
|
38
38
|
}
|