Skip to content

The open source coding agent.

TypeScript

sync

Dax Raade88264075a8b
diff --git a/js/example/cli.ts b/js/example/cli.ts
index 476286ecb55..9c9e07edd0f 100644
--- a/js/example/cli.ts
+++ b/js/example/cli.ts
@@ -1,5 +1,5 @@
import { App } from "../src/app";
-import path from "node:path";
+import path from "path";
import { edit } from "../src/tool";
import { FileTimes } from "../src/tool/util/file-times";
diff --git a/js/src/app/config.ts b/js/src/app/config.ts
index 3ebb8734bda..1f149154089 100644
--- a/js/src/app/config.ts
+++ b/js/src/app/config.ts
@@ -1,4 +1,4 @@
-import path from "node:path";
+import path from "path";
import { Log } from "../util/log";
import { z } from "zod";
import { LLM } from "../llm/llm";
diff --git a/js/src/app/index.ts b/js/src/app/index.ts
index b6713d930ef..f0d371a34f5 100644
--- a/js/src/app/index.ts
+++ b/js/src/app/index.ts
@@ -1,4 +1,4 @@
-import fs from "node:fs/promises";
+import fs from "fs/promises";
import { AppPath } from "./path";
import { Log } from "../util/log";
import { Context } from "../util/context";
diff --git a/js/src/app/path.ts b/js/src/app/path.ts
index 7621cae3bcf..972d18c41ca 100644
--- a/js/src/app/path.ts
+++ b/js/src/app/path.ts
@@ -1,4 +1,4 @@
-import path from "node:path";
+import path from "path";
export namespace AppPath {
export function data(input: string) {
diff --git a/js/src/bun/index.ts b/js/src/bun/index.ts
index 6eb6e1bdeba..35e8cbbf97c 100644
--- a/js/src/bun/index.ts
+++ b/js/src/bun/index.ts
@@ -1,4 +1,4 @@
-import path from "node:path";
+import path from "path";
import { Log } from "../util/log";
export namespace BunProc {
const log = Log.create({ service: "bun" });
diff --git a/js/src/id/id.ts b/js/src/id/id.ts
index 5dd503788cd..62c6a12bf86 100644
--- a/js/src/id/id.ts
+++ b/js/src/id/id.ts
@@ -1,5 +1,5 @@
import { z } from "zod";
-import { randomBytes } from "node:crypto";
+import { randomBytes } from "crypto";
export namespace Identifier {
const prefixes = {
diff --git a/js/src/index.ts b/js/src/index.ts
index 1977f7c7d0a..49920f53421 100644
--- a/js/src/index.ts
+++ b/js/src/index.ts
@@ -1,7 +1,7 @@
import { App } from "./app";
import { Server } from "./server/server";
-import fs from "node:fs/promises";
-import path from "node:path";
+import fs from "fs/promises";
+import path from "path";
import { Bus } from "./bus";
import { Session } from "./session/session";
import cac from "cac";
diff --git a/js/src/llm/llm.ts b/js/src/llm/llm.ts
index 1f8f085673e..9c409c60492 100644
--- a/js/src/llm/llm.ts
+++ b/js/src/llm/llm.ts
@@ -1,7 +1,7 @@
import { App } from "../app";
import { Log } from "../util/log";
import { mergeDeep } from "remeda";
-import path from "node:path";
+import path from "path";
import type { LanguageModel, Provider } from "ai";
import { NoSuchModelError } from "ai";
diff --git a/js/src/lsp/client.ts b/js/src/lsp/client.ts
index 1de187a94e4..fda77948a0f 100644
--- a/js/src/lsp/client.ts
+++ b/js/src/lsp/client.ts
@@ -1,5 +1,5 @@
-import { spawn } from "node:child_process";
-import path from "node:path";
+import { spawn } from "child_process";
+import path from "path";
import {
createMessageConnection,
StreamMessageReader,
diff --git a/js/src/lsp/index.ts b/js/src/lsp/index.ts
index f8b019e0413..ee5a8b2d7fd 100644
--- a/js/src/lsp/index.ts
+++ b/js/src/lsp/index.ts
@@ -1,7 +1,7 @@
import { App } from "../app";
import { Log } from "../util/log";
import { LSPClient } from "./client";
-import path from "node:path";
+import path from "path";
export namespace LSP {
const log = Log.create({ service: "lsp" });
diff --git a/js/src/session/session.ts b/js/src/session/session.ts
index 6c89457a597..1bbafc78b1f 100644
--- a/js/src/session/session.ts
+++ b/js/src/session/session.ts
@@ -1,4 +1,4 @@
-import path from "node:path";
+import path from "path";
import { App } from "../app/";
import { Identifier } from "../id/id";
import { LLM } from "../llm/llm";
@@ -6,6 +6,7 @@ import { Storage } from "../storage/storage";
import { Log } from "../util/log";
import {
convertToModelMessages,
+ generateText,
stepCountIs,
streamText,
type TextUIPart,
@@ -181,7 +182,6 @@ export namespace Session {
}
msgs.push(system);
state().messages.set(input.sessionID, msgs);
- /*
generateText({
messages: convertToModelMessages([
{
@@ -204,7 +204,6 @@ export namespace Session {
draft.title = result.text;
});
});
- */
await write(system);
}
const msg: Message = {
diff --git a/js/src/storage/storage.ts b/js/src/storage/storage.ts
index 390b3c087b6..3b4c63cb884 100644
--- a/js/src/storage/storage.ts
+++ b/js/src/storage/storage.ts
@@ -1,6 +1,6 @@
import { FileStorage } from "@flystorage/file-storage";
import { LocalStorageAdapter } from "@flystorage/local-fs";
-import fs from "node:fs/promises";
+import fs from "fs/promises";
import { Log } from "../util/log";
import { App } from "../app";
import { AppPath } from "../app/path";
diff --git a/js/src/tool/bash.ts b/js/src/tool/bash.ts
index 2043093ad2f..f6a9fa6e263 100644
--- a/js/src/tool/bash.ts
+++ b/js/src/tool/bash.ts
@@ -193,9 +193,7 @@ export const bash = Tool.define({
timeout: timeout,
});
return {
- output: {
- content: process.stdout.toString("utf-8"),
- },
+ output: process.stdout.toString("utf-8"),
};
},
});
diff --git a/js/src/tool/edit.ts b/js/src/tool/edit.ts
index f041a474835..3f784d616e7 100644
--- a/js/src/tool/edit.ts
+++ b/js/src/tool/edit.ts
@@ -1,5 +1,5 @@
import { z } from "zod";
-import * as path from "node:path";
+import * as path from "path";
import { Log } from "../util/log";
import { Tool } from "./tool";
import { FileTimes } from "./util/file-times";
diff --git a/js/src/tool/grep.ts b/js/src/tool/grep.ts
index 21f242244ad..d5c2d700c47 100644
--- a/js/src/tool/grep.ts
+++ b/js/src/tool/grep.ts
@@ -1,9 +1,9 @@
import { z } from "zod";
import { Tool } from "./tool";
import { App } from "../app";
-import { spawn } from "node:child_process";
-import { promises as fs } from "node:fs";
-import path from "node:path";
+import { spawn } from "child_process";
+import { promises as fs } from "fs";
+import path from "path";
const DESCRIPTION = `Fast content search tool that finds files containing specific text or patterns, returning matching file paths sorted by modification time (newest first).
diff --git a/js/src/tool/ls.ts b/js/src/tool/ls.ts
index c481b4d8dde..62c3d113bd9 100644
--- a/js/src/tool/ls.ts
+++ b/js/src/tool/ls.ts
@@ -1,8 +1,8 @@
import { z } from "zod";
import { Tool } from "./tool";
import { App } from "../app";
-import * as path from "node:path";
-import * as fs from "node:fs";
+import * as path from "path";
+import * as fs from "fs";
const DESCRIPTION = `Directory listing tool that shows files and subdirectories in a tree structure, helping you explore and understand the project organization.
diff --git a/js/src/tool/lsp-diagnostics.ts b/js/src/tool/lsp-diagnostics.ts
index 41c33f82235..c1372b0e955 100644
--- a/js/src/tool/lsp-diagnostics.ts
+++ b/js/src/tool/lsp-diagnostics.ts
@@ -1,6 +1,6 @@
import { z } from "zod";
import { Tool } from "./tool";
-import path from "node:path";
+import path from "path";
import { LSP } from "../lsp";
import { App } from "../app";
diff --git a/js/src/tool/lsp-hover.ts b/js/src/tool/lsp-hover.ts
index 9957920a231..9b6290ef5f4 100644
--- a/js/src/tool/lsp-hover.ts
+++ b/js/src/tool/lsp-hover.ts
@@ -1,6 +1,6 @@
import { z } from "zod";
import { Tool } from "./tool";
-import path from "node:path";
+import path from "path";
import { LSP } from "../lsp";
import { App } from "../app";
diff --git a/js/src/tool/patch.ts b/js/src/tool/patch.ts
index 209a2d927b5..137877a7b2c 100644
--- a/js/src/tool/patch.ts
+++ b/js/src/tool/patch.ts
@@ -1,6 +1,6 @@
import { z } from "zod";
-import * as path from "node:path";
-import * as fs from "node:fs/promises";
+import * as path from "path";
+import * as fs from "fs/promises";
import { Tool } from "./tool";
import { FileTimes } from "./util/file-times";
diff --git a/js/src/tool/view.ts b/js/src/tool/view.ts
index c3d9fa72b8b..b36fa94f61f 100644
--- a/js/src/tool/view.ts
+++ b/js/src/tool/view.ts
@@ -1,6 +1,6 @@
import { z } from "zod";
-import * as fs from "node:fs";
-import * as path from "node:path";
+import * as fs from "fs";
+import * as path from "path";
import { Tool } from "./tool";
import { LSP } from "../lsp";
import { FileTimes } from "./util/file-times";
diff --git a/js/src/util/context.ts b/js/src/util/context.ts
index ec686293ebe..bcaf7ee3c35 100644
--- a/js/src/util/context.ts
+++ b/js/src/util/context.ts
@@ -1,4 +1,4 @@
-import { AsyncLocalStorage } from "node:async_hooks";
+import { AsyncLocalStorage } from "async_hooks";
export namespace Context {
export class NotFound extends Error {
diff --git a/js/src/util/log.ts b/js/src/util/log.ts
index df460cc5049..abaddfa373c 100644
--- a/js/src/util/log.ts
+++ b/js/src/util/log.ts
@@ -1,6 +1,6 @@
-import path from "node:path";
+import path from "path";
import { AppPath } from "../app/path";
-import fs from "node:fs/promises";
+import fs from "fs/promises";
export namespace Log {
const write = {
out: (msg: string) => {