mirror of
https://gitea.toothfairyai.com/ToothFairyAI/tf_code.git
synced 2026-03-31 06:12:26 +00:00
sync
This commit is contained in:
@@ -7,17 +7,12 @@ export namespace BunProc {
|
||||
cmd: string[],
|
||||
options?: Bun.SpawnOptions.OptionsObject<any, any, any>,
|
||||
) {
|
||||
const root =
|
||||
process.argv0 !== "bun" && false
|
||||
? path.resolve(process.cwd(), process.argv0)
|
||||
: "bun"
|
||||
log.info("running", {
|
||||
cmd: [root, ...cmd],
|
||||
cmd: [which(), ...cmd],
|
||||
options,
|
||||
})
|
||||
const result = Bun.spawn([root, ...cmd], {
|
||||
const result = Bun.spawn([which(), ...cmd], {
|
||||
...options,
|
||||
argv0: "bun",
|
||||
env: {
|
||||
...process.env,
|
||||
...options?.env,
|
||||
@@ -31,4 +26,10 @@ export namespace BunProc {
|
||||
}
|
||||
return result
|
||||
}
|
||||
|
||||
export function which() {
|
||||
return process.argv0 !== "bun"
|
||||
? path.resolve(process.cwd(), process.argv0)
|
||||
: "bun"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,6 +3,7 @@ import type { App } from "../app/app"
|
||||
import path from "path"
|
||||
import { Global } from "../global"
|
||||
import { Log } from "../util/log"
|
||||
import { BunProc } from "../bun"
|
||||
|
||||
export namespace LSPServer {
|
||||
const log = Log.create({ service: "lsp.server" })
|
||||
@@ -37,15 +38,10 @@ export namespace LSPServer {
|
||||
app.path.cwd,
|
||||
).catch(() => {})
|
||||
if (!tsserver) return
|
||||
const root =
|
||||
process.argv0 !== "bun" && false
|
||||
? path.resolve(process.cwd(), process.argv0)
|
||||
: "bun"
|
||||
const proc = spawn(
|
||||
root,
|
||||
BunProc.which(),
|
||||
["x", "typescript-language-server", "--stdio"],
|
||||
{
|
||||
argv0: "bun",
|
||||
env: {
|
||||
...process.env,
|
||||
BUN_BE_BUN: "1",
|
||||
|
||||
@@ -259,11 +259,14 @@ export namespace Provider {
|
||||
}
|
||||
}
|
||||
|
||||
const priority = ["claude-sonnet-4", "gemini-2.5-pro-preview", "codex-mini"]
|
||||
const priority = ["gemini-2.5-pro-preview", "codex-mini", "claude-sonnet-4"]
|
||||
export function sort(models: Model[]) {
|
||||
return sortBy(
|
||||
models,
|
||||
[(model) => priority.indexOf(model.id), "desc"],
|
||||
[
|
||||
(model) => priority.findIndex((filter) => model.id.includes(filter)),
|
||||
"desc",
|
||||
],
|
||||
[(model) => (model.id.includes("latest") ? 0 : 1), "asc"],
|
||||
[(model) => model.id, "desc"],
|
||||
)
|
||||
|
||||
@@ -283,7 +283,7 @@ export namespace Session {
|
||||
}
|
||||
msgs.push(system)
|
||||
generateText({
|
||||
maxOutputTokens: 80,
|
||||
maxOutputTokens: 20,
|
||||
messages: convertToModelMessages([
|
||||
{
|
||||
role: "system",
|
||||
|
||||
Reference in New Issue
Block a user