summaryrefslogtreecommitdiffhomepage
path: root/js/src
diff options
context:
space:
mode:
authorDax Raad <[email protected]>2025-05-28 17:24:15 -0400
committerDax Raad <[email protected]>2025-05-28 17:24:21 -0400
commite88264075a8b67c46b57d13db8488f4f01e7f9f1 (patch)
tree74aeb70ee3625355ab5c0440451505ca10997a80 /js/src
parent041a080a139a06402d9c0ce4d37622f9eb49e729 (diff)
downloadopencode-e88264075a8b67c46b57d13db8488f4f01e7f9f1.tar.gz
opencode-e88264075a8b67c46b57d13db8488f4f01e7f9f1.zip
sync
Diffstat (limited to 'js/src')
-rw-r--r--js/src/app/config.ts2
-rw-r--r--js/src/app/index.ts2
-rw-r--r--js/src/app/path.ts2
-rw-r--r--js/src/bun/index.ts2
-rw-r--r--js/src/id/id.ts2
-rw-r--r--js/src/index.ts4
-rw-r--r--js/src/llm/llm.ts2
-rw-r--r--js/src/lsp/client.ts4
-rw-r--r--js/src/lsp/index.ts2
-rw-r--r--js/src/session/session.ts5
-rw-r--r--js/src/storage/storage.ts2
-rw-r--r--js/src/tool/bash.ts4
-rw-r--r--js/src/tool/edit.ts2
-rw-r--r--js/src/tool/grep.ts6
-rw-r--r--js/src/tool/ls.ts4
-rw-r--r--js/src/tool/lsp-diagnostics.ts2
-rw-r--r--js/src/tool/lsp-hover.ts2
-rw-r--r--js/src/tool/patch.ts4
-rw-r--r--js/src/tool/view.ts4
-rw-r--r--js/src/util/context.ts2
-rw-r--r--js/src/util/log.ts4
21 files changed, 30 insertions, 33 deletions
diff --git a/js/src/app/config.ts b/js/src/app/config.ts
index 3ebb8734b..1f1491540 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 b6713d930..f0d371a34 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 7621cae3b..972d18c41 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 6eb6e1bde..35e8cbbf9 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 5dd503788..62c6a12bf 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 1977f7c7d..49920f534 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 1f8f08567..9c409c604 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 1de187a94..fda77948a 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 f8b019e04..ee5a8b2d7 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 6c89457a5..1bbafc78b 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 390b3c087..3b4c63cb8 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 2043093ad..f6a9fa6e2 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 f041a4748..3f784d616 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 21f242244..d5c2d700c 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 c481b4d8d..62c3d113b 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 41c33f822..c1372b0e9 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 9957920a2..9b6290ef5 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 209a2d927..137877a7b 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 c3d9fa72b..b36fa94f6 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 ec686293e..bcaf7ee3c 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 df460cc50..abaddfa37 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) => {