codecane 1.0.170 → 1.0.171

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.
@@ -9,21 +9,27 @@ export interface TagHandler {
9
9
  /**
10
10
  * XmlStreamProcessor handles XML tags that may be split across multiple chunks.
11
11
  * It processes tool-related XML tags and executes callbacks when nested tags are completed.
12
+ * The processor maintains a complete response buffer and processes character by character
13
+ * to ensure tags are fully completed before outputting content.
12
14
  */
13
15
  export declare class XmlStreamProcessor {
14
16
  private tagStack;
15
17
  private currentContent;
16
18
  private tagHandlers;
17
- private processedLength;
19
+ private responseBuffer;
18
20
  private lastOutput;
19
21
  constructor(tagHandlers: Record<string, TagHandler>);
20
22
  /**
21
- * Process a buffer of text that may contain XML tags
22
- * @param buffer The complete buffer to process
23
+ * Process a chunk of text that may contain XML tags
24
+ * @param chunk The new chunk to process
23
25
  * @returns Processed text with XML tags handled according to the tag handlers
24
26
  */
25
- process(buffer: string): string;
26
- private handleClosingTag;
27
+ process(chunk: string): string;
28
+ /**
29
+ * Reset the processor state after a stream is complete
30
+ * This clears all internal state variables to prepare for a new stream
31
+ */
32
+ reset(): void;
27
33
  }
28
34
  /**
29
35
  * Default tag handlers for common XML tags
@@ -15,142 +15,154 @@ const formatTagName = (tagName) => {
15
15
  /**
16
16
  * XmlStreamProcessor handles XML tags that may be split across multiple chunks.
17
17
  * It processes tool-related XML tags and executes callbacks when nested tags are completed.
18
+ * The processor maintains a complete response buffer and processes character by character
19
+ * to ensure tags are fully completed before outputting content.
18
20
  */
19
21
  class XmlStreamProcessor {
20
22
  tagStack = [];
21
23
  currentContent = '';
22
24
  tagHandlers;
23
- processedLength = 0;
25
+ responseBuffer = '';
24
26
  lastOutput = '';
25
27
  constructor(tagHandlers) {
26
28
  this.tagHandlers = tagHandlers;
27
29
  }
28
30
  /**
29
- * Process a buffer of text that may contain XML tags
30
- * @param buffer The complete buffer to process
31
+ * Process a chunk of text that may contain XML tags
32
+ * @param chunk The new chunk to process
31
33
  * @returns Processed text with XML tags handled according to the tag handlers
32
34
  */
33
- process(buffer) {
34
- // Only process new content since last call
35
- const newContent = buffer.slice(this.processedLength);
36
- if (!newContent) {
37
- return '';
38
- }
39
- // Process the entire buffer
40
- let output = this.lastOutput;
41
- let position = this.processedLength;
42
- // Look for opening and closing tags in the buffer
43
- while (position < buffer.length) {
44
- // Look for opening tag
45
- const openTagMatch = buffer.slice(position).match(/<([a-zA-Z_]+)>/);
46
- // Look for closing tag
47
- const closeTagMatch = buffer.slice(position).match(/<\/([a-zA-Z_]+)>/);
48
- if (this.tagStack.length === 0) {
49
- // Not inside any tag - look for opening tag or add text to output
50
- if (openTagMatch && openTagMatch.index !== undefined) {
51
- // Add text before the tag to output
52
- output += buffer.slice(position, position + openTagMatch.index);
53
- // Get tag name
54
- const tagName = openTagMatch[1];
55
- // Handle opening tag display
35
+ process(chunk) {
36
+ // Append new chunk to the response buffer
37
+ this.responseBuffer += chunk;
38
+ // Process the buffer character by character
39
+ let output = '';
40
+ let position = 0;
41
+ let inTag = false;
42
+ let tagName = '';
43
+ let isClosingTag = false;
44
+ // Process each character in the buffer
45
+ while (position < this.responseBuffer.length) {
46
+ const currentChar = this.responseBuffer[position];
47
+ // Check for start of a tag
48
+ if (currentChar === '<') {
49
+ inTag = true;
50
+ tagName = '';
51
+ isClosingTag = false;
52
+ position++;
53
+ // Check if it's a closing tag
54
+ if (position < this.responseBuffer.length &&
55
+ this.responseBuffer[position] === '/') {
56
+ isClosingTag = true;
57
+ position++;
58
+ }
59
+ // Extract the tag name
60
+ while (position < this.responseBuffer.length &&
61
+ this.responseBuffer[position] !== '>' &&
62
+ this.responseBuffer[position] !== ' ') {
63
+ tagName += this.responseBuffer[position];
64
+ position++;
65
+ }
66
+ // Skip any attributes (not fully supported, just skipping them)
67
+ while (position < this.responseBuffer.length &&
68
+ this.responseBuffer[position] !== '>') {
69
+ position++;
70
+ }
71
+ // Move past the closing '>'
72
+ if (position < this.responseBuffer.length &&
73
+ this.responseBuffer[position] === '>') {
74
+ position++;
75
+ }
76
+ else {
77
+ // We've reached the end of the buffer without finding the closing '>'
78
+ // Reset position to before the tag and wait for more data
79
+ position = this.responseBuffer.indexOf('<');
80
+ inTag = false;
81
+ break;
82
+ }
83
+ // Handle the tag
84
+ if (isClosingTag) {
85
+ // Handle closing tag
86
+ if (this.tagStack.length > 0) {
87
+ const openTag = this.tagStack.pop();
88
+ // If tag names match, process the content
89
+ if (openTag === tagName) {
90
+ // If we're closing a nested tag
91
+ if (this.tagStack.length === 1) {
92
+ const parentTag = this.tagStack[0];
93
+ const handler = this.tagHandlers[parentTag];
94
+ if (handler) {
95
+ const result = handler.onTagEnd(tagName, this.currentContent);
96
+ if (result !== null) {
97
+ output += result;
98
+ }
99
+ }
100
+ }
101
+ // If we're closing the main tag, reset content
102
+ if (this.tagStack.length === 0) {
103
+ this.currentContent = '';
104
+ }
105
+ }
106
+ else {
107
+ // Tag mismatch, push the popped tag back
108
+ if (openTag) {
109
+ this.tagStack.push(openTag);
110
+ }
111
+ }
112
+ }
113
+ }
114
+ else {
115
+ // Handle opening tag - call onTagStart immediately if it exists
56
116
  const handler = this.tagHandlers[tagName];
57
- if (handler && handler.onTagStart) {
117
+ if (handler && handler.onTagStart && this.tagStack.length === 0) {
58
118
  const tagDisplay = handler.onTagStart(tagName);
59
119
  if (tagDisplay !== null) {
60
120
  output += tagDisplay;
61
121
  }
62
122
  }
63
- // Move position to after the opening tag
64
- position += openTagMatch.index + openTagMatch[0].length;
65
- // Push tag name to stack
123
+ // Push tag to stack
66
124
  this.tagStack.push(tagName);
67
- this.currentContent = '';
68
- }
69
- else {
70
- // No opening tag found, add remaining text to output
71
- output += buffer.slice(position);
72
- position = buffer.length;
125
+ // Reset current content if this is a new top-level tag
126
+ if (this.tagStack.length === 1) {
127
+ this.currentContent = '';
128
+ }
73
129
  }
130
+ inTag = false;
74
131
  }
75
132
  else {
76
- // Inside a tag - look for nested opening tag or closing tag
77
- if (openTagMatch &&
78
- closeTagMatch &&
79
- openTagMatch.index !== undefined &&
80
- closeTagMatch.index !== undefined) {
81
- // Both opening and closing tags found, check which comes first
82
- if (openTagMatch.index < closeTagMatch.index) {
83
- // Opening tag comes first
84
- this.currentContent += buffer.slice(position, position + openTagMatch.index);
85
- position += openTagMatch.index + openTagMatch[0].length;
86
- this.tagStack.push(openTagMatch[1]);
87
- }
88
- else {
89
- // Closing tag comes first
90
- this.currentContent += buffer.slice(position, position + closeTagMatch.index);
91
- position += closeTagMatch.index + closeTagMatch[0].length;
92
- const result = this.handleClosingTag(closeTagMatch[1]);
93
- if (result !== null) {
94
- output += result;
95
- }
96
- }
97
- }
98
- else if (closeTagMatch && closeTagMatch.index !== undefined) {
99
- // Only closing tag found
100
- this.currentContent += buffer.slice(position, position + closeTagMatch.index);
101
- position += closeTagMatch.index + closeTagMatch[0].length;
102
- const result = this.handleClosingTag(closeTagMatch[1]);
103
- if (result !== null) {
104
- output += result;
105
- }
106
- }
107
- else if (openTagMatch && openTagMatch.index !== undefined) {
108
- // Only opening tag found
109
- this.currentContent += buffer.slice(position, position + openTagMatch.index);
110
- position += openTagMatch.index + openTagMatch[0].length;
111
- this.tagStack.push(openTagMatch[1]);
133
+ // Regular content
134
+ if (this.tagStack.length > 0) {
135
+ // Inside a tag, add to current content
136
+ this.currentContent += currentChar;
112
137
  }
113
138
  else {
114
- // No tags found, add everything to current content
115
- this.currentContent += buffer.slice(position);
116
- position = buffer.length;
139
+ // Outside any tag, add directly to output
140
+ output += currentChar;
117
141
  }
142
+ position++;
118
143
  }
119
144
  }
120
- // Update processed length and last output
121
- this.processedLength = position;
145
+ // If we've processed the entire buffer, update it to only include unprocessed content
146
+ if (position >= this.responseBuffer.length) {
147
+ this.responseBuffer = '';
148
+ }
149
+ else {
150
+ this.responseBuffer = this.responseBuffer.substring(position);
151
+ }
122
152
  // Calculate new output since last call
123
153
  const newOutput = output.slice(this.lastOutput.length);
124
154
  this.lastOutput = output;
125
155
  return newOutput;
126
156
  }
127
- handleClosingTag(tagName) {
128
- // Check if this closing tag matches the current tag on the stack
129
- if (this.tagStack.length > 0) {
130
- const currentTag = this.tagStack.pop();
131
- // If tag names don't match, attempt to recover by ignoring this closing tag
132
- if (currentTag !== tagName) {
133
- // Push the popped tag back onto the stack
134
- if (currentTag) {
135
- this.tagStack.push(currentTag);
136
- }
137
- return null;
138
- }
139
- // If we're closing a nested tag
140
- if (this.tagStack.length === 1) {
141
- const parentTag = this.tagStack[0];
142
- const handler = this.tagHandlers[parentTag];
143
- if (handler) {
144
- const result = handler.onTagEnd(tagName, this.currentContent);
145
- return result;
146
- }
147
- }
148
- // If we're closing the main tag, reset content
149
- if (this.tagStack.length === 0) {
150
- this.currentContent = '';
151
- }
152
- }
153
- return null;
157
+ /**
158
+ * Reset the processor state after a stream is complete
159
+ * This clears all internal state variables to prepare for a new stream
160
+ */
161
+ reset() {
162
+ this.tagStack = [];
163
+ this.currentContent = '';
164
+ this.responseBuffer = '';
165
+ this.lastOutput = '';
154
166
  }
155
167
  }
156
168
  exports.XmlStreamProcessor = XmlStreamProcessor;
@@ -1 +1 @@
1
- {"version":3,"file":"process-xml-chunks.js","sourceRoot":"","sources":["../../src/utils/process-xml-chunks.ts"],"names":[],"mappings":";;;AAAA,kDAAiE;AACjE,+CAAqD;AACrD,2CAAiC;AAEjC;;;;GAIG;AACH,MAAM,aAAa,GAAG,CAAC,OAAe,EAAU,EAAE;IAChD,OAAO,MAAM,IAAA,iBAAI,EAAC,IAAA,yBAAgB,EAAC,OAAO,CAAC,CAAC,IAAI,CAAA;AAClD,CAAC,CAAA;AAgBD;;;GAGG;AACH,MAAa,kBAAkB;IACrB,QAAQ,GAAa,EAAE,CAAA;IACvB,cAAc,GAAW,EAAE,CAAA;IAC3B,WAAW,CAA4B;IACvC,eAAe,GAAW,CAAC,CAAA;IAC3B,UAAU,GAAW,EAAE,CAAA;IAE/B,YAAY,WAAuC;QACjD,IAAI,CAAC,WAAW,GAAG,WAAW,CAAA;IAChC,C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AAa,CAAC,OAAO,CAAC;QAC/C,QAAQ,EAAE,CAAC,OAAO,EAAE,OAAO,EAAE,EAAE;YAC7B,iBAAiB;YACjB,IAAI,OAAO,KAAK,OAAO,EAAE,CAAC;gBACxB,OAAO,OAAO,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAA;YACtC,CAAC;YACD,OAAO,OAAO,CAAA;QAChB,CAAC;KACF;IAED,UAAU,EAAE;QACV,UAAU,EAAE,CAAC,OAAO,EAAE,EAAE,CAAC,aAAa,CAAC,OAAO,CAAC;QAC/C,QAAQ,EAAE,CAAC,OAAO,EAAE,OAAO,EAAE,EAAE;YAC7B,OAAO,OAAO,CAAA;QAChB,CAAC;KACF;IAED,WAAW,EAAE;QACX,UAAU,EAAE,CAAC,OAAO,EAAE,EAAE,CAAC,aAAa,CAAC,OAAO,CAAC;QAC/C,QAAQ,EAAE,CAAC,OAAO,EAAE,OAAO,EAAE,EAAE;YAC7B,mBAAmB;YACnB,IAAI,OAAO,KAAK,SAAS,EAAE,CAAC;gBAC1B,OAAO,IAAI,CAAA;YACb,CAAC;YACD,OAAO,OAAO,CAAA;QAChB,CAAC;KACF;CACF,CAAA"}
@@ -6,7 +6,7 @@ if (worker_threads_1.parentPort) {
6
6
  const parentPort = worker_threads_1.parentPort;
7
7
  parentPort.on('message', async ({ dir }) => {
8
8
  (0, project_files_1.setProjectRoot)(dir);
9
- const initFileContext = await (0, project_files_1.getProjectFileContext)(dir, {}, [], {});
9
+ const initFileContext = await (0, project_files_1.getProjectFileContext)(dir, {}, []);
10
10
  parentPort.postMessage(initFileContext);
11
11
  });
12
12
  }
@@ -1 +1 @@
1
- {"version":3,"file":"worker-script-project-context.js","sourceRoot":"","sources":["../src/worker-script-project-context.ts"],"names":[],"mappings":";;AAAA,mDAA8D;AAC9D,mDAAuE;AAEvE,IAAI,2BAAe,EAAE,CAAC;IACpB,MAAM,UAAU,GAAG,2BAAe,CAAA;IAElC,UAAU,CAAC,EAAE,CAAC,SAAS,EAAE,KAAK,EAAE,EAAE,GAAG,EAAE,EAAE,EAAE;QACzC,IAAA,8BAAc,EAAC,GAAG,CAAC,CAAA;QACnB,MAAM,eAAe,GAAG,MAAM,IAAA,qCAAqB,EAAC,GAAG,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,CAAC,CAAA;QACpE,UAAU,CAAC,WAAW,CAAC,eAAe,CAAC,CAAA;IACzC,CAAC,CAAC,CAAA;AACJ,CAAC"}
1
+ {"version":3,"file":"worker-script-project-context.js","sourceRoot":"","sources":["../src/worker-script-project-context.ts"],"names":[],"mappings":";;AAAA,mDAA8D;AAC9D,mDAAuE;AAEvE,IAAI,2BAAe,EAAE,CAAC;IACpB,MAAM,UAAU,GAAG,2BAAe,CAAA;IAElC,UAAU,CAAC,EAAE,CAAC,SAAS,EAAE,KAAK,EAAE,EAAE,GAAG,EAAE,EAAE,EAAE;QACzC,IAAA,8BAAc,EAAC,GAAG,CAAC,CAAA;QACnB,MAAM,eAAe,GAAG,MAAM,IAAA,qCAAqB,EAAC,GAAG,EAAE,EAAE,EAAE,EAAE,CAAC,CAAA;QAChE,UAAU,CAAC,WAAW,CAAC,eAAe,CAAC,CAAA;IACzC,CAAC,CAAC,CAAA;AACJ,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "codecane",
3
- "version": "1.0.170",
3
+ "version": "1.0.171",
4
4
  "description": "AI dev assistant",
5
5
  "license": "MIT",
6
6
  "main": "dist/index.js",