Skip to content

Commit 30ec231

Browse files
chore: generate
1 parent 1ff1910 commit 30ec231

19 files changed

Lines changed: 3573 additions & 2863 deletions

File tree

packages/cli/bin/lildax.cjs

Lines changed: 21 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -88,8 +88,17 @@ const names = (() => {
8888
return false
8989
}
9090
})()
91-
if (musl) return arch === "x64" ? (baseline ? [`${base}-baseline-musl`, `${base}-musl`, `${base}-baseline`, base] : [`${base}-musl`, `${base}-baseline-musl`, base, `${base}-baseline`]) : [`${base}-musl`, base]
92-
return arch === "x64" ? (baseline ? [`${base}-baseline`, base, `${base}-baseline-musl`, `${base}-musl`] : [base, `${base}-baseline`, `${base}-musl`, `${base}-baseline-musl`]) : [base, `${base}-musl`]
91+
if (musl)
92+
return arch === "x64"
93+
? baseline
94+
? [`${base}-baseline-musl`, `${base}-musl`, `${base}-baseline`, base]
95+
: [`${base}-musl`, `${base}-baseline-musl`, base, `${base}-baseline`]
96+
: [`${base}-musl`, base]
97+
return arch === "x64"
98+
? baseline
99+
? [`${base}-baseline`, base, `${base}-baseline-musl`, `${base}-musl`]
100+
: [base, `${base}-baseline`, `${base}-musl`, `${base}-baseline-musl`]
101+
: [base, `${base}-musl`]
93102
}
94103
return arch === "x64" ? (baseline ? [`${base}-baseline`, base] : [base, `${base}-baseline`]) : [base]
95104
})()
@@ -98,10 +107,11 @@ function findBinary(startDir) {
98107
let current = startDir
99108
for (;;) {
100109
const modules = path.join(current, "node_modules")
101-
if (fs.existsSync(modules)) for (const name of names) {
102-
const candidate = path.join(modules, name, "bin", binary)
103-
if (fs.existsSync(candidate)) return candidate
104-
}
110+
if (fs.existsSync(modules))
111+
for (const name of names) {
112+
const candidate = path.join(modules, name, "bin", binary)
113+
if (fs.existsSync(candidate)) return candidate
114+
}
105115
const parent = path.dirname(current)
106116
if (parent === current) return
107117
current = parent
@@ -110,7 +120,11 @@ function findBinary(startDir) {
110120

111121
const resolved = envPath || (fs.existsSync(cached) ? cached : findBinary(scriptDir))
112122
if (!resolved) {
113-
console.error("It seems that your package manager failed to install the right lildax CLI package. Try manually installing " + names.map((name) => `"${name}"`).join(" or ") + " package")
123+
console.error(
124+
"It seems that your package manager failed to install the right lildax CLI package. Try manually installing " +
125+
names.map((name) => `"${name}"`).join(" or ") +
126+
" package",
127+
)
114128
process.exit(1)
115129
}
116130
run(resolved)

packages/cli/script/publish.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,5 +44,9 @@ await Bun.file(`./dist/${pkg.name}/package.json`).write(
4444
),
4545
)
4646

47-
await Promise.all(Object.entries(binaries).map(([name, version]) => publish(`./dist/${name.replace("@opencode-ai/", "")}`, name, version)))
47+
await Promise.all(
48+
Object.entries(binaries).map(([name, version]) =>
49+
publish(`./dist/${name.replace("@opencode-ai/", "")}`, name, version),
50+
),
51+
)
4852
await publish(`./dist/${pkg.name}`, pkg.name, version)

packages/cli/src/framework/runtime.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,9 @@ export type Input<Value> =
1111
: never
1212

1313
type RuntimeHandler = (input: unknown) => Effect.Effect<void, unknown, Daemon.Service>
14-
type Loader<Node extends Spec.Any> = () => Promise<{ default: (input: Input<Node>) => Effect.Effect<void, any, Daemon.Service> }>
14+
type Loader<Node extends Spec.Any> = () => Promise<{
15+
default: (input: Input<Node>) => Effect.Effect<void, any, Daemon.Service>
16+
}>
1517
type ProvidedCommand = Command.Command<string, unknown, unknown, unknown, Daemon.Service>
1618

1719
export type Handlers<Node extends Spec.Any> = keyof Node["commands"] extends never

packages/cli/src/services/daemon.ts

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -125,11 +125,9 @@ export const layer = Layer.effect(
125125
const register = Effect.fn("cli.daemon.register")(function* (address: HttpServer.Address) {
126126
const temp = file + ".tmp"
127127
yield* fs.makeDirectory(directory, { recursive: true })
128-
yield* fs.writeFileString(
129-
temp,
130-
JSON.stringify({ url: HttpServer.formatAddress(address), pid: process.pid }),
131-
{ mode: 0o600 },
132-
)
128+
yield* fs.writeFileString(temp, JSON.stringify({ url: HttpServer.formatAddress(address), pid: process.pid }), {
129+
mode: 0o600,
130+
})
133131
yield* fs.rename(temp, file)
134132
// The metadata file represents this live listener, not persistent config.
135133
// Scope shutdown removes it when the server exits normally.

packages/core/src/config/plugin/command.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,9 @@ export const Plugin = PluginV2.define({
2222
const documents = yield* Effect.forEach(yield* config.entries(), (entry) => {
2323
if (entry.type === "document") return Effect.succeed([{ commands: entry.info.commands }])
2424
return loadDirectory(fs, entry.path).pipe(
25-
Effect.map((commands) => [{ commands: Object.fromEntries(commands.map((command) => [command.name, command.info])) }]),
25+
Effect.map((commands) => [
26+
{ commands: Object.fromEntries(commands.map((command) => [command.name, command.info])) },
27+
]),
2628
)
2729
}).pipe(Effect.map((documents) => documents.flat()))
2830

packages/core/src/config/plugin/skill.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,12 @@ export const Plugin = PluginV2.define({
2323

2424
yield* transform((editor) => {
2525
for (const directory of directories) {
26-
editor.source(new SkillV2.DirectorySource({ type: "directory", path: AbsolutePath.make(path.join(directory, "skill")) }))
27-
editor.source(new SkillV2.DirectorySource({ type: "directory", path: AbsolutePath.make(path.join(directory, "skills")) }))
26+
editor.source(
27+
new SkillV2.DirectorySource({ type: "directory", path: AbsolutePath.make(path.join(directory, "skill")) }),
28+
)
29+
editor.source(
30+
new SkillV2.DirectorySource({ type: "directory", path: AbsolutePath.make(path.join(directory, "skills")) }),
31+
)
2832
}
2933
for (const item of items) {
3034
if (URL.canParse(item) && /^(https?:)$/.test(new URL(item).protocol)) {

packages/core/src/plugin/skill.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,9 @@ export const Plugin = PluginV2.define({
1010
effect: Effect.gen(function* () {
1111
const skill = yield* SkillV2.Service
1212
const transform = yield* skill.transform()
13-
const content = yield* Effect.promise(() => Bun.file(new URL("./skill/customize-opencode.md", import.meta.url)).text())
13+
const content = yield* Effect.promise(() =>
14+
Bun.file(new URL("./skill/customize-opencode.md", import.meta.url)).text(),
15+
)
1416

1517
yield* transform((editor) => {
1618
editor.source(

packages/core/src/skill.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,11 @@ export const Source = Schema.Union([DirectorySource, UrlSource, EmbeddedSource])
3737
return false
3838
},
3939
key: (source: DirectorySource | UrlSource | EmbeddedSource) =>
40-
source.type === "directory" ? `directory:${source.path}` : source.type === "url" ? `url:${source.url}` : `embedded:${source.skill.name}`,
40+
source.type === "directory"
41+
? `directory:${source.path}`
42+
: source.type === "url"
43+
? `url:${source.url}`
44+
: `embedded:${source.skill.name}`,
4145
})),
4246
)
4347
export type Source = typeof Source.Type

packages/core/test/plugin/command.test.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,7 @@ const project = AbsolutePath.make("/repo")
1212
const it = testEffect(
1313
CommandV2.locationLayer.pipe(
1414
Layer.provide(
15-
Layer.succeed(
16-
Location.Service,
17-
Location.Service.of(location({ directory }, { projectDirectory: project })),
18-
),
15+
Layer.succeed(Location.Service, Location.Service.of(location({ directory }, { projectDirectory: project }))),
1916
),
2017
),
2118
)
@@ -26,7 +23,10 @@ describe("CommandPlugin.Plugin", () => {
2623
const command = yield* CommandV2.Service
2724
yield* CommandPlugin.Plugin.effect.pipe(
2825
Effect.provideService(CommandV2.Service, command),
29-
Effect.provideService(Location.Service, Location.Service.of(location({ directory }, { projectDirectory: project }))),
26+
Effect.provideService(
27+
Location.Service,
28+
Location.Service.of(location({ directory }, { projectDirectory: project })),
29+
),
3030
)
3131

3232
expect(yield* command.get("init")).toMatchObject({

packages/opencode/src/provider/provider.ts

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1017,20 +1017,14 @@ export type Error = ModelNotFoundError | InitError | NoProvidersError | NoModels
10171017
export interface Interface {
10181018
readonly list: () => Effect.Effect<Record<ProviderV2.ID, Info>>
10191019
readonly getProvider: (providerID: ProviderV2.ID) => Effect.Effect<Info>
1020-
readonly getModel: (
1021-
providerID: ProviderV2.ID,
1022-
modelID: ModelV2.ID,
1023-
) => Effect.Effect<Model, ModelNotFoundError>
1020+
readonly getModel: (providerID: ProviderV2.ID, modelID: ModelV2.ID) => Effect.Effect<Model, ModelNotFoundError>
10241021
readonly getLanguage: (model: Model) => Effect.Effect<LanguageModelV3, ModelNotFoundError>
10251022
readonly closest: (
10261023
providerID: ProviderV2.ID,
10271024
query: string[],
10281025
) => Effect.Effect<{ providerID: ProviderV2.ID; modelID: string } | undefined>
10291026
readonly getSmallModel: (providerID: ProviderV2.ID) => Effect.Effect<Model | undefined>
1030-
readonly defaultModel: () => Effect.Effect<
1031-
{ providerID: ProviderV2.ID; modelID: ModelV2.ID },
1032-
DefaultModelError
1033-
>
1027+
readonly defaultModel: () => Effect.Effect<{ providerID: ProviderV2.ID; modelID: ModelV2.ID }, DefaultModelError>
10341028
}
10351029

10361030
interface State {

0 commit comments

Comments
 (0)