mirror of
https://github.com/Kilo-Org/kilocode.git
synced 2026-09-01 15:32:11 +08:00
chore(sdk): rename public API to Kilo branding
This commit is contained in:
@@ -1,8 +1,8 @@
|
||||
import { createOpencodeClient, createOpencodeServer } from "@kilocode/sdk"
|
||||
import { createKiloClient, createKiloServer } from "@kilocode/sdk"
|
||||
import { pathToFileURL } from "bun"
|
||||
|
||||
const server = await createOpencodeServer()
|
||||
const client = createOpencodeClient({ baseUrl: server.url })
|
||||
const server = await createKiloServer()
|
||||
const client = createKiloClient({ baseUrl: server.url })
|
||||
|
||||
const input = await Array.fromAsync(new Bun.Glob("packages/core/*.ts").scan())
|
||||
|
||||
|
||||
@@ -25,7 +25,7 @@ await createClient({
|
||||
},
|
||||
{
|
||||
name: "@hey-api/sdk",
|
||||
instance: "OpencodeClient",
|
||||
instance: "KiloClient",
|
||||
exportFromIndex: false,
|
||||
auth: false,
|
||||
paramsStructure: "flat",
|
||||
|
||||
@@ -2,10 +2,10 @@ export * from "./gen/types.gen.js"
|
||||
|
||||
import { createClient } from "./gen/client/client.gen.js"
|
||||
import { type Config } from "./gen/client/types.gen.js"
|
||||
import { OpencodeClient } from "./gen/sdk.gen.js"
|
||||
export { type Config as OpencodeClientConfig, OpencodeClient }
|
||||
import { KiloClient } from "./gen/sdk.gen.js"
|
||||
export { type Config as KiloClientConfig, KiloClient }
|
||||
|
||||
export function createOpencodeClient(config?: Config & { directory?: string }) {
|
||||
export function createKiloClient(config?: Config & { directory?: string }) {
|
||||
if (!config?.fetch) {
|
||||
const customFetch: any = (req: any) => {
|
||||
// @ts-ignore
|
||||
@@ -26,5 +26,5 @@ export function createOpencodeClient(config?: Config & { directory?: string }) {
|
||||
}
|
||||
|
||||
const client = createClient(config)
|
||||
return new OpencodeClient({ client })
|
||||
return new KiloClient({ client })
|
||||
}
|
||||
|
||||
@@ -1,16 +1,16 @@
|
||||
export * from "./client.js"
|
||||
export * from "./server.js"
|
||||
|
||||
import { createOpencodeClient } from "./client.js"
|
||||
import { createOpencodeServer } from "./server.js"
|
||||
import { createKiloClient } from "./client.js"
|
||||
import { createKiloServer } from "./server.js"
|
||||
import type { ServerOptions } from "./server.js"
|
||||
|
||||
export async function createOpencode(options?: ServerOptions) {
|
||||
const server = await createOpencodeServer({
|
||||
export async function createKilo(options?: ServerOptions) {
|
||||
const server = await createKiloServer({
|
||||
...options,
|
||||
})
|
||||
|
||||
const client = createOpencodeClient({
|
||||
const client = createKiloClient({
|
||||
baseUrl: server.url,
|
||||
})
|
||||
|
||||
|
||||
@@ -51,7 +51,7 @@ export type TuiOptions = {
|
||||
config?: Config
|
||||
}
|
||||
|
||||
export async function createOpencodeServer(options?: ServerOptions) {
|
||||
export async function createKiloServer(options?: ServerOptions) {
|
||||
options = Object.assign(
|
||||
{
|
||||
hostname: "127.0.0.1",
|
||||
@@ -127,7 +127,7 @@ export async function createOpencodeServer(options?: ServerOptions) {
|
||||
}
|
||||
}
|
||||
|
||||
export function createOpencodeTui(options?: TuiOptions) {
|
||||
export function createKiloTui(options?: TuiOptions) {
|
||||
const args = []
|
||||
|
||||
if (options?.project) {
|
||||
|
||||
@@ -2,10 +2,10 @@ export * from "./gen/types.gen.js"
|
||||
|
||||
import { createClient } from "./gen/client/client.gen.js"
|
||||
import { type Config } from "./gen/client/types.gen.js"
|
||||
import { OpencodeClient } from "./gen/sdk.gen.js"
|
||||
export { type Config as OpencodeClientConfig, OpencodeClient }
|
||||
import { KiloClient } from "./gen/sdk.gen.js"
|
||||
export { type Config as KiloClientConfig, KiloClient }
|
||||
|
||||
export function createOpencodeClient(config?: Config & { directory?: string }) {
|
||||
export function createKiloClient(config?: Config & { directory?: string }) {
|
||||
if (!config?.fetch) {
|
||||
const customFetch: any = (req: any) => {
|
||||
// @ts-ignore
|
||||
@@ -28,5 +28,5 @@ export function createOpencodeClient(config?: Config & { directory?: string }) {
|
||||
}
|
||||
|
||||
const client = createClient(config)
|
||||
return new OpencodeClient({ client })
|
||||
return new KiloClient({ client })
|
||||
}
|
||||
|
||||
@@ -1,16 +1,16 @@
|
||||
export * from "./client.js"
|
||||
export * from "./server.js"
|
||||
|
||||
import { createOpencodeClient } from "./client.js"
|
||||
import { createOpencodeServer } from "./server.js"
|
||||
import { createKiloClient } from "./client.js"
|
||||
import { createKiloServer } from "./server.js"
|
||||
import type { ServerOptions } from "./server.js"
|
||||
|
||||
export async function createOpencode(options?: ServerOptions) {
|
||||
const server = await createOpencodeServer({
|
||||
export async function createKilo(options?: ServerOptions) {
|
||||
const server = await createKiloServer({
|
||||
...options,
|
||||
})
|
||||
|
||||
const client = createOpencodeClient({
|
||||
const client = createKiloClient({
|
||||
baseUrl: server.url,
|
||||
})
|
||||
|
||||
|
||||
@@ -51,7 +51,7 @@ export type TuiOptions = {
|
||||
config?: Config
|
||||
}
|
||||
|
||||
export async function createOpencodeServer(options?: ServerOptions) {
|
||||
export async function createKiloServer(options?: ServerOptions) {
|
||||
options = Object.assign(
|
||||
{
|
||||
hostname: "127.0.0.1",
|
||||
@@ -127,7 +127,7 @@ export async function createOpencodeServer(options?: ServerOptions) {
|
||||
}
|
||||
}
|
||||
|
||||
export function createOpencodeTui(options?: TuiOptions) {
|
||||
export function createKiloTui(options?: TuiOptions) {
|
||||
const args = []
|
||||
|
||||
if (options?.project) {
|
||||
|
||||
Reference in New Issue
Block a user