termux-dev 1.2.2 → 1.4.0

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.
@@ -20,20 +20,27 @@ export const bashTool = {
20
20
  return new Promise((resolve, reject) => {
21
21
  const proc = spawn(args.command, { shell: true });
22
22
  let output = '';
23
+ let isTruncated = false;
23
24
  const timeout = setTimeout(() => {
24
25
  proc.kill();
25
26
  resolve(output + '\n[Process killed due to timeout]');
26
27
  }, 30000);
27
28
  proc.stdout.on('data', (data) => {
29
+ if (isTruncated)
30
+ return;
28
31
  output += data.toString();
29
32
  if (output.length > 20000) {
33
+ isTruncated = true;
30
34
  output = output.substring(0, 20000) + '\n[Output truncated]';
31
35
  proc.kill();
32
36
  }
33
37
  });
34
38
  proc.stderr.on('data', (data) => {
39
+ if (isTruncated)
40
+ return;
35
41
  output += data.toString();
36
42
  if (output.length > 20000) {
43
+ isTruncated = true;
37
44
  output = output.substring(0, 20000) + '\n[Output truncated]';
38
45
  proc.kill();
39
46
  }
package/dist/tools/fs.js CHANGED
@@ -153,7 +153,7 @@ export const editFileTool = {
153
153
  let addCounter = startLine;
154
154
  addedArr.forEach((l) => diffLines.push(`${addCounter++} + ${l}`));
155
155
  contextAfter.forEach((l) => diffLines.push(`${addCounter++} ${l}`));
156
- const newContent = content.replace(target, args.replacement);
156
+ const newContent = content.slice(0, targetIndex) + args.replacement + content.slice(targetIndex + target.length);
157
157
  await fs.writeFile(args.path, newContent, 'utf8');
158
158
  return JSON.stringify({
159
159
  status: 'success',
@@ -9,11 +9,13 @@ import { saveMemoryTool } from '../core/memory.js';
9
9
  import { planReadyTool, lastPlanReady, resetPlanReady } from './plan.js';
10
10
  import { todoListTool, currentTodoList, resetTodoList } from './todo.js';
11
11
  import { servePreviewTool } from './server.js';
12
+ import { MCPManager } from '../mcp/manager.js';
12
13
  export function getTools(planMode) {
13
14
  const baseTools = [readFileTool, listDirTool, searchTool, askQuestionsTool, webSearchTool, fetchUrlTool, saveMemoryTool, planReadyTool, todoListTool];
15
+ const mcpTools = MCPManager.getInstance().getTools();
14
16
  if (planMode) {
15
- return baseTools;
17
+ return [...baseTools, ...mcpTools];
16
18
  }
17
- return [...baseTools, writeFileTool, editFileTool, mkdirTool, bashTool, diagnoseCodeTool, installPackageTool, servePreviewTool];
19
+ return [...baseTools, writeFileTool, editFileTool, mkdirTool, bashTool, diagnoseCodeTool, installPackageTool, servePreviewTool, ...mcpTools];
18
20
  }
19
21
  export { webSearchTool, fetchUrlTool, diagnoseCodeTool, installPackageTool, saveMemoryTool, planReadyTool, lastPlanReady, resetPlanReady, todoListTool, currentTodoList, resetTodoList, servePreviewTool };
package/dist/tools/web.js CHANGED
@@ -1,8 +1,8 @@
1
1
  function stripHtml(html) {
2
2
  return html
3
- .replace(/<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi, '')
4
- .replace(/<style\b[^<]*(?:(?!<\/style>)<[^<]*)*<\/style>/gi, '')
5
- .replace(/<svg\b[^<]*(?:(?!<\/svg>)<[^<]*)*<\/svg>/gi, '')
3
+ .replace(/<script\b[\s\S]*?<\/script>/gi, '')
4
+ .replace(/<style\b[\s\S]*?<\/style>/gi, '')
5
+ .replace(/<svg\b[\s\S]*?<\/svg>/gi, '')
6
6
  .replace(/<[^>]+>/g, ' ')
7
7
  .replace(/&quot;/g, '"')
8
8
  .replace(/&amp;/g, '&')
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "termux-dev",
3
- "version": "1.2.2",
3
+ "version": "1.4.0",
4
4
  "description": "Ultra-fast, terminal-native AI coding assistant and agent built for Android Termux, Windows, macOS, and Linux.",
5
5
  "main": "dist/cli/index.js",
6
6
  "type": "module",