mirror of
https://github.com/aljazceru/opencode.git
synced 2025-12-24 11:14:23 +01:00
wip: cloud
This commit is contained in:
@@ -1,4 +1,3 @@
|
||||
import { Resource } from "sst"
|
||||
import { z } from "zod"
|
||||
import { issuer } from "@openauthjs/openauth"
|
||||
import type { Theme } from "@openauthjs/openauth/ui/theme"
|
||||
@@ -10,6 +9,7 @@ import { CloudflareStorage } from "@openauthjs/openauth/storage/cloudflare"
|
||||
import { Account } from "@opencode/cloud-core/account.js"
|
||||
import { Workspace } from "@opencode/cloud-core/workspace.js"
|
||||
import { Actor } from "@opencode/cloud-core/actor.js"
|
||||
import { Resource } from "@opencode/cloud-core/util/resource.js"
|
||||
|
||||
type Env = {
|
||||
AuthStorage: KVNamespace
|
||||
@@ -28,8 +28,8 @@ export const subjects = createSubjects({
|
||||
|
||||
const MY_THEME: Theme = {
|
||||
...THEME_OPENAUTH,
|
||||
logo: "https://opencode.ai/favicon.svg"
|
||||
};
|
||||
logo: "https://opencode.ai/favicon.svg",
|
||||
}
|
||||
|
||||
export default {
|
||||
async fetch(request: Request, env: Env, ctx: ExecutionContext) {
|
||||
|
||||
@@ -3,7 +3,7 @@ import { Hono, MiddlewareHandler } from "hono"
|
||||
import { cors } from "hono/cors"
|
||||
import { HTTPException } from "hono/http-exception"
|
||||
import { zValidator } from "@hono/zod-validator"
|
||||
import { Resource } from "sst"
|
||||
import { Resource } from "@opencode/cloud-core/util/resource.js"
|
||||
import { type ProviderMetadata, type LanguageModelUsage, generateText, streamText } from "ai"
|
||||
import { createAnthropic } from "@ai-sdk/anthropic"
|
||||
import { createOpenAI } from "@ai-sdk/openai"
|
||||
|
||||
Reference in New Issue
Block a user