GeezerVisonThe World Wide Web, restored to 800 pixels of glory. |
| Home|About|Gaming cabinet|Archives|How it works|Starter sites |
GeezerVison is showing github.com — opencode/packages/opencode/script/seed-e2e.ts at dev · cbarber/opencode Expand file tree/ Copy pathseed-e2e.tsMore file actions 60 lines (56 loc) · 2.02 KB / Copy pathseed-e2e.tsFile metadata and controls60 lines (56 loc) · 2.02 KB 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 const dir = process.env.OPENCODE_E2E_PROJECT_DIR ?? process.cwd() const title = process.env.OPENCODE_E2E_SESSION_TITLE ?? "E2E Session" const text = process.env.OPENCODE_E2E_MESSAGE ?? "Seeded for UI e2e" const model = process.env.OPENCODE_E2E_MODEL ?? "opencode/gpt-5-nano" const parts = model.split("/") const providerID = parts[0] ?? "opencode" const modelID = parts[1] ?? "gpt-5-nano" const now = Date.now() const seed = async () => { const { Instance } = await import("../src/project/instance") const { InstanceBootstrap } = await import("../src/project/bootstrap") const { Config } = await import("../src/config/config") const { Session } = await import("../src/session") const { MessageID, PartID } = await import("../src/session/schema") const { Project } = await import("../src/project/project") const { ModelID, ProviderID } = await import("../src/provider/schema") const { ToolRegistry } = await import("../src/tool/registry") try { await Instance.provide({ directory: dir, init: InstanceBootstrap, fn: async () => { await Config.waitForDependencies() await ToolRegistry.ids() const session = await Session.create({ title }) const messageID = MessageID.ascending() const partID = PartID.ascending() const message = { id: messageID, sessionID: session.id, role: "user" as const, time: { created: now }, agent: "build", model: { providerID: ProviderID.make(providerID), modelID: ModelID.make(modelID), }, } const part = { id: partID, sessionID: session.id, messageID, type: "text" as const, text, time: { start: now }, } await Session.updateMessage(message) await Session.updatePart(part) await Project.update({ projectID: Instance.project.id, name: "E2E Project" }) }, }) } finally { await Instance.disposeAll().catch(() => {}) } } await seed() |
| You are visitor 01402792 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |