@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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@iinm/plain-agent",
3
- "version": "1.7.2",
3
+ "version": "1.7.3",
4
4
  "description": "A lightweight CLI-based coding agent",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -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(/\[pasted#([a-f0-9]{6})\]/g, (match, hash) => {
36
- const content = pastedContentStore.get(hash);
37
- if (content !== undefined) {
38
- pastedContentStore.delete(hash); // Clean up after use
39
- contexts.push(
40
- `<context location="pasted#${hash}">\n${content}\n</context>`,
41
- );
42
- }
43
- return match; // Keep placeholder in text
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
- this.push(`[pasted#${hash}] `);
97
+ const lines = pasteBuffer.split("\n");
98
+ this.push(`[Pasted text #${hash}, ${lines.length} lines]`);
97
99
  }
98
100
  }
99
101
  pasteBuffer = "";