mirror of
https://github.com/anomalyco/opencode.git
synced 2026-04-24 06:45:22 +00:00
cleanup
This commit is contained in:
@@ -26,7 +26,6 @@ import type { SessionID } from "../../session/schema"
|
||||
import { MessageID, PartID } from "../../session/schema"
|
||||
import { Provider } from "../../provider/provider"
|
||||
import { Bus } from "../../bus"
|
||||
import { SyncEvent } from "../../sync"
|
||||
import { MessageV2 } from "../../session/message-v2"
|
||||
import { SessionPrompt } from "@/session/prompt"
|
||||
import { setTimeout as sleep } from "node:timers/promises"
|
||||
|
||||
@@ -3,6 +3,7 @@ import { Config } from "../config/config"
|
||||
import { Bus } from "../bus"
|
||||
import { Log } from "../util/log"
|
||||
import { createOpencodeClient } from "@opencode-ai/sdk"
|
||||
import { Server } from "../server/server"
|
||||
import { BunProc } from "../bun"
|
||||
import { Flag } from "../flag/flag"
|
||||
import { CodexAuthPlugin } from "./codex"
|
||||
@@ -56,8 +57,6 @@ export namespace Plugin {
|
||||
const hooks: Hooks[] = []
|
||||
|
||||
yield* Effect.promise(async () => {
|
||||
const { Server } = await import("../server/server")
|
||||
|
||||
const client = createOpencodeClient({
|
||||
baseUrl: "http://localhost:4096",
|
||||
directory: ctx.directory,
|
||||
|
||||
@@ -54,23 +54,6 @@ export function toPartialRow(info: DeepPartial<Session.Info>) {
|
||||
|
||||
export default [
|
||||
SyncEvent.project(Session.Event.Created, (db, data) => {
|
||||
const existing = db
|
||||
.select({ id: ProjectTable.id })
|
||||
.from(ProjectTable)
|
||||
.where(eq(ProjectTable.id, data.info.projectID))
|
||||
.get()
|
||||
if (!existing) {
|
||||
// Create a (temporary) project to make this work. In the future
|
||||
// we should separate sessions and projects
|
||||
db.insert(ProjectTable)
|
||||
.values({
|
||||
id: data.info.projectID,
|
||||
worktree: data.info.directory,
|
||||
sandboxes: [],
|
||||
})
|
||||
.run()
|
||||
}
|
||||
|
||||
db.insert(SessionTable).values(Session.toRow(data.info)).run()
|
||||
}),
|
||||
|
||||
|
||||
@@ -50,7 +50,6 @@ Instructions here.
|
||||
directory: tmp.path,
|
||||
fn: async () => {
|
||||
const skills = await Skill.all()
|
||||
console.log(skills)
|
||||
expect(skills.length).toBe(1)
|
||||
const testSkill = skills.find((s) => s.name === "test-skill")
|
||||
expect(testSkill).toBeDefined()
|
||||
|
||||
Reference in New Issue
Block a user