@iinm/plain-agent 1.7.2 → 1.7.3
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/package.json +1 -1
- package/src/cliPasteTransform.mjs +13 -11
package/package.json
CHANGED
|
@@ -32,16 +32,17 @@ export function resolvePastePlaceholders(input) {
|
|
|
32
32
|
const contexts = [];
|
|
33
33
|
|
|
34
34
|
// Collect paste content for context tags while keeping placeholders
|
|
35
|
-
const text = input.replace(
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
pastedContentStore.
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
35
|
+
const text = input.replace(
|
|
36
|
+
/\[Pasted text #([a-f0-9]{6}),/g,
|
|
37
|
+
(match, hash) => {
|
|
38
|
+
const content = pastedContentStore.get(hash);
|
|
39
|
+
if (content !== undefined) {
|
|
40
|
+
pastedContentStore.delete(hash); // Clean up after use
|
|
41
|
+
contexts.push(`<context id="pasted#${hash}">\n${content}\n</context>`);
|
|
42
|
+
}
|
|
43
|
+
return match; // Keep placeholder in text
|
|
44
|
+
},
|
|
45
|
+
);
|
|
45
46
|
|
|
46
47
|
// Append contexts to the end of input
|
|
47
48
|
if (contexts.length > 0) {
|
|
@@ -93,7 +94,8 @@ export function createPasteTransform(onCtrlC) {
|
|
|
93
94
|
// For multi-line paste, use placeholder
|
|
94
95
|
const hash = generatePasteHash(pasteBuffer);
|
|
95
96
|
pastedContentStore.set(hash, pasteBuffer);
|
|
96
|
-
|
|
97
|
+
const lines = pasteBuffer.split("\n");
|
|
98
|
+
this.push(`[Pasted text #${hash}, ${lines.length} lines]`);
|
|
97
99
|
}
|
|
98
100
|
}
|
|
99
101
|
pasteBuffer = "";
|