Don't use custom dirname implementation

This commit is contained in:
Alex Gleason committed 2025-07-25 02:33:44 -05:00
1 parent 47c2d7298e
commit 155415c7d2
1 file changed
+1 -14
+1 -14
View File
@@ -1,22 +1,9 @@
import { join } from "@std/path";
import { join, dirname } from "@std/path";
import { z } from "zod";
import type { Tool, CallToolResult } from "./Tool";
import type { JSRuntimeFS } from "../JSRuntime";
// Simple dirname implementation that works in browser environments
function dirname(path: string): string {
if (path === '' || path === '.') return '.';
// Handle Windows and Unix paths
const lastSlash = Math.max(path.lastIndexOf('/'), path.lastIndexOf('\\'));
if (lastSlash === -1) return '.';
if (lastSlash === 0) return '/';
return path.slice(0, lastSlash);
}
interface TextEditorWriteParams {
path: string;
file_text: string;