Compare commits

..

4 Commits

Author SHA1 Message Date
Dax Raad 400623f117 sync 2025-07-23 23:32:00 -04:00
Dax Raad 4b047d3dab sync 2025-07-23 22:57:44 -04:00
Dax Raad 550d2d3f99 sync 2025-07-23 22:57:21 -04:00
Dax Raad 149f133747 sync 2025-07-23 21:56:02 -04:00
30 changed files with 969 additions and 217 deletions
+1 -1
View File
@@ -34,7 +34,7 @@ jobs:
- uses: oven-sh/setup-bun@v2
with:
bun-version: 1.2.19
bun-version: 1.2.17
- name: Install makepkg
run: |
-1
View File
@@ -25,4 +25,3 @@
| 2025-07-21 | 80,197 (+3,744) | 113,537 (+4,493) | 193,734 (+8,237) |
| 2025-07-22 | 84,251 (+4,054) | 118,073 (+4,536) | 202,324 (+8,590) |
| 2025-07-23 | 88,589 (+4,338) | 121,436 (+3,363) | 210,025 (+7,701) |
| 2025-07-24 | 92,469 (+3,880) | 124,091 (+2,655) | 216,560 (+6,535) |
+931 -25
View File
File diff suppressed because it is too large Load Diff
+1 -1
View File
@@ -3,7 +3,7 @@
"name": "opencode",
"private": true,
"type": "module",
"packageManager": "bun@1.2.19",
"packageManager": "bun@1.2.14",
"scripts": {
"dev": "bun run packages/opencode/src/index.ts",
"typecheck": "bun run --filter='*' typecheck",
@@ -1,69 +0,0 @@
{
"$schema": "https://opencode.ai/theme.json",
"defs": {
"darkBg": "#0f0f0f",
"darkBgPanel": "#15141b",
"darkBorder": "#2d2d2d",
"darkFgMuted": "#6d6d6d",
"darkFg": "#edecee",
"purple": "#a277ff",
"pink": "#f694ff",
"blue": "#82e2ff",
"red": "#ff6767",
"orange": "#ffca85",
"cyan": "#61ffca",
"green": "#9dff65"
},
"theme": {
"primary": "purple",
"secondary": "pink",
"accent": "purple",
"error": "red",
"warning": "orange",
"success": "cyan",
"info": "purple",
"text": "darkFg",
"textMuted": "darkFgMuted",
"background": "darkBg",
"backgroundPanel": "darkBgPanel",
"backgroundElement": "darkBgPanel",
"border": "darkBorder",
"borderActive": "darkFgMuted",
"borderSubtle": "darkBorder",
"diffAdded": "cyan",
"diffRemoved": "red",
"diffContext": "darkFgMuted",
"diffHunkHeader": "darkFgMuted",
"diffHighlightAdded": "cyan",
"diffHighlightRemoved": "red",
"diffAddedBg": "#354933",
"diffRemovedBg": "#3f191a",
"diffContextBg": "darkBgPanel",
"diffLineNumber": "darkBorder",
"diffAddedLineNumberBg": "#162620",
"diffRemovedLineNumberBg": "#26161a",
"markdownText": "darkFg",
"markdownHeading": "purple",
"markdownLink": "pink",
"markdownLinkText": "purple",
"markdownCode": "cyan",
"markdownBlockQuote": "darkFgMuted",
"markdownEmph": "orange",
"markdownStrong": "purple",
"markdownHorizontalRule": "darkFgMuted",
"markdownListItem": "purple",
"markdownListEnumeration": "purple",
"markdownImage": "pink",
"markdownImageText": "purple",
"markdownCodeBlock": "darkFg",
"syntaxComment": "darkFgMuted",
"syntaxKeyword": "pink",
"syntaxFunction": "purple",
"syntaxVariable": "purple",
"syntaxString": "cyan",
"syntaxNumber": "green",
"syntaxType": "purple",
"syntaxOperator": "pink",
"syntaxPunctuation": "darkFg"
}
}
+2 -12
View File
@@ -66,22 +66,12 @@ func (h *APILogHandler) Handle(ctx context.Context, r slog.Record) error {
h.mu.Lock()
for _, attr := range h.attrs {
val := attr.Value.Any()
if err, ok := val.(error); ok {
extra[attr.Key] = err.Error()
} else {
extra[attr.Key] = val
}
extra[attr.Key] = attr.Value.Any()
}
h.mu.Unlock()
r.Attrs(func(attr slog.Attr) bool {
val := attr.Value.Any()
if err, ok := val.(error); ok {
extra[attr.Key] = err.Error()
} else {
extra[attr.Key] = val
}
extra[attr.Key] = attr.Value.Any()
return true
})
+1 -1
View File
@@ -19,9 +19,9 @@
"@ai-sdk/anthropic": "1.2.12",
"@standard-schema/spec": "1.0.0",
"@tsconfig/bun": "1.0.7",
"@types/bun": "latest",
"@types/turndown": "5.0.5",
"@types/yargs": "17.0.33",
"@types/bun": "latest",
"typescript": "catalog:",
"vscode-languageserver-types": "3.17.5",
"zod-to-json-schema": "3.24.5"
+1 -1
View File
@@ -716,7 +716,7 @@ export namespace Server {
"json",
z.object({
service: z.string().openapi({ description: "Service name for the log entry" }),
level: z.enum(["debug", "info", "error", "warn"]).openapi({ description: "Log level", ref: "LogLevel" }),
level: z.enum(["debug", "info", "error", "warn"]).openapi({ description: "Log level" }),
message: z.string().openapi({ description: "Log message" }),
extra: z
.record(z.string(), z.any())
+1 -2
View File
@@ -5,7 +5,6 @@ import fs from "fs/promises"
import { Ripgrep } from "../file/ripgrep"
import { Log } from "../util/log"
import { Global } from "../global"
import { Installation } from "../installation"
export namespace Snapshot {
const log = Log.create({ service: "snapshot" })
@@ -29,7 +28,7 @@ export namespace Snapshot {
const app = App.info()
// not a git repo, check if too big to snapshot
if (!app.git || !Installation.isDev()) {
if (!app.git) {
return
const files = await Ripgrep.files({
cwd: app.path.cwd,
+1 -1
View File
@@ -4,7 +4,7 @@ import { Global } from "../global"
import z from "zod"
export namespace Log {
export const Level = z.enum(["DEBUG", "INFO", "WARN", "ERROR"])
export const Level = z.enum(["DEBUG", "INFO", "WARN", "ERROR"]).openapi({ ref: "LogLevel", description: "Log level" })
export type Level = z.infer<typeof Level>
const levelPriority: Record<Level, number> = {
-1
View File
@@ -1 +0,0 @@
dist
-1
View File
@@ -1 +0,0 @@
export * from "./plugin.js";
-1
View File
@@ -1 +0,0 @@
export * from "./plugin.js";
-2
View File
@@ -1,2 +0,0 @@
export interface Plugin {
}
-1
View File
@@ -1 +0,0 @@
export {};
+1 -8
View File
@@ -1,11 +1,4 @@
{
"$schema": "https://json.schemastore.org/package.json",
"private": false,
"name": "@opencode-ai/plugin",
"type": "module",
"version": "0.0.1",
"devDependencies": {
"@tsconfig/node22": "22.0.2",
"typescript": "catalog:"
}
"name": "@opencode-ai/plugin"
}
-11
View File
@@ -1,11 +0,0 @@
#!/usr/bin/env bun
import { $ } from "bun"
const dir = new URL("..", import.meta.url).pathname
const version = process.env["VERSION"]
if (!version) throw new Error("VERSION is required")
await $`bun pm pkg set version="${version}"`
await $`tsc`.cwd(dir)
await $`bun publish`
+1 -1
View File
@@ -1 +1 @@
export * from "./plugin.js"
export * from "./plugin"
-11
View File
@@ -1,11 +0,0 @@
{
"$schema": "https://json.schemastore.org/tsconfig",
"extends": "@tsconfig/node22/tsconfig.json",
"compilerOptions": {
"outDir": "dist",
"declaration": true
},
"include": [
"src"
]
}
+2 -2
View File
@@ -1,4 +1,4 @@
configured_endpoints: 26
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/opencode%2Fopencode-fb4caa8d0381531c44dd2d3c8c0b930b8c15a7bdde474d15bf7aeeb3b27aef56.yml
openapi_spec_hash: 3a263e46f2369eeb2410430001c60d15
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/opencode%2Fopencode-335697785b44f3928145853339226bd5e8accd5199bb9d79e2a3fd2d8ce62a57.yml
openapi_spec_hash: 74fbaad0fa44496d0d8b11d9b98eab03
config_hash: 1ae82c93499b9f0b9ba828b8919f9cb3
-4
View File
@@ -16,10 +16,6 @@ Methods:
# App
Params Types:
- <a href="https://pkg.go.dev/github.com/sst/opencode-sdk-go">opencode</a>.<a href="https://pkg.go.dev/github.com/sst/opencode-sdk-go#LogLevel">LogLevel</a>
Response Types:
- <a href="https://pkg.go.dev/github.com/sst/opencode-sdk-go">opencode</a>.<a href="https://pkg.go.dev/github.com/sst/opencode-sdk-go#App">App</a>
+19 -19
View File
@@ -145,24 +145,6 @@ func (r appTimeJSON) RawJSON() string {
return r.raw
}
// Log level
type LogLevel string
const (
LogLevelDebug LogLevel = "debug"
LogLevelInfo LogLevel = "info"
LogLevelError LogLevel = "error"
LogLevelWarn LogLevel = "warn"
)
func (r LogLevel) IsKnown() bool {
switch r {
case LogLevelDebug, LogLevelInfo, LogLevelError, LogLevelWarn:
return true
}
return false
}
type Mode struct {
Name string `json:"name,required"`
Tools map[string]bool `json:"tools,required"`
@@ -352,7 +334,7 @@ func (r appProvidersResponseJSON) RawJSON() string {
type AppLogParams struct {
// Log level
Level param.Field[LogLevel] `json:"level,required"`
Level param.Field[AppLogParamsLevel] `json:"level,required"`
// Log message
Message param.Field[string] `json:"message,required"`
// Service name for the log entry
@@ -364,3 +346,21 @@ type AppLogParams struct {
func (r AppLogParams) MarshalJSON() (data []byte, err error) {
return apijson.MarshalRoot(r)
}
// Log level
type AppLogParamsLevel string
const (
AppLogParamsLevelDebug AppLogParamsLevel = "debug"
AppLogParamsLevelInfo AppLogParamsLevel = "info"
AppLogParamsLevelError AppLogParamsLevel = "error"
AppLogParamsLevelWarn AppLogParamsLevel = "warn"
)
func (r AppLogParamsLevel) IsKnown() bool {
switch r {
case AppLogParamsLevelDebug, AppLogParamsLevelInfo, AppLogParamsLevelError, AppLogParamsLevelWarn:
return true
}
return false
}
+1 -1
View File
@@ -70,7 +70,7 @@ func TestAppLogWithOptionalParams(t *testing.T) {
option.WithBaseURL(baseURL),
)
_, err := client.App.Log(context.TODO(), opencode.AppLogParams{
Level: opencode.F(opencode.LogLevelDebug),
Level: opencode.F(opencode.AppLogParamsLevelDebug),
Message: opencode.F("message"),
Service: opencode.F("service"),
Extra: opencode.F(map[string]interface{}{
+2 -2
View File
@@ -1,4 +1,4 @@
configured_endpoints: 26
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/opencode%2Fopencode-fb4caa8d0381531c44dd2d3c8c0b930b8c15a7bdde474d15bf7aeeb3b27aef56.yml
openapi_spec_hash: 3a263e46f2369eeb2410430001c60d15
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/opencode%2Fopencode-335697785b44f3928145853339226bd5e8accd5199bb9d79e2a3fd2d8ce62a57.yml
openapi_spec_hash: 74fbaad0fa44496d0d8b11d9b98eab03
config_hash: 1ae82c93499b9f0b9ba828b8919f9cb3
-1
View File
@@ -21,7 +21,6 @@ Methods:
Types:
- <code><a href="./src/resources/app.ts">App</a></code>
- <code><a href="./src/resources/app.ts">LogLevel</a></code>
- <code><a href="./src/resources/app.ts">Mode</a></code>
- <code><a href="./src/resources/app.ts">Model</a></code>
- <code><a href="./src/resources/app.ts">Provider</a></code>
+3 -5
View File
@@ -24,7 +24,6 @@ import {
AppModesResponse,
AppProvidersResponse,
AppResource,
LogLevel,
Mode,
Model,
Provider,
@@ -90,7 +89,7 @@ import { HeadersLike, NullableHeaders, buildHeaders } from './internal/headers';
import { FinalRequestOptions, RequestOptions } from './internal/request-options';
import { readEnv } from './internal/utils/env';
import {
type LogLevel as ClientLogLevel,
type LogLevel,
type Logger,
formatRequestDetails,
loggerFor,
@@ -158,7 +157,7 @@ export interface ClientOptions {
*
* Defaults to process.env['OPENCODE_LOG'] or 'warn' if it isn't set.
*/
logLevel?: ClientLogLevel | undefined;
logLevel?: LogLevel | undefined;
/**
* Set the logger.
@@ -176,7 +175,7 @@ export class Opencode {
maxRetries: number;
timeout: number;
logger: Logger | undefined;
logLevel: ClientLogLevel | undefined;
logLevel: LogLevel | undefined;
fetchOptions: MergedRequestInit | undefined;
private fetch: Fetch;
@@ -778,7 +777,6 @@ export declare namespace Opencode {
export {
AppResource as AppResource,
type App as App,
type LogLevel as LogLevel,
type Mode as Mode,
type Model as Model,
type Provider as Provider,
+1 -7
View File
@@ -69,11 +69,6 @@ export namespace App {
}
}
/**
* Log level
*/
export type LogLevel = 'debug' | 'info' | 'error' | 'warn';
export interface Mode {
name: string;
@@ -162,7 +157,7 @@ export interface AppLogParams {
/**
* Log level
*/
level: LogLevel;
level: 'debug' | 'info' | 'error' | 'warn';
/**
* Log message
@@ -183,7 +178,6 @@ export interface AppLogParams {
export declare namespace AppResource {
export {
type App as App,
type LogLevel as LogLevel,
type Mode as Mode,
type Model as Model,
type Provider as Provider,
-1
View File
@@ -4,7 +4,6 @@ export * from './shared';
export {
AppResource,
type App,
type LogLevel,
type Mode,
type Model,
type Provider,
-9
View File
@@ -1,9 +0,0 @@
#!/usr/bin/env bun
import { $ } from "bun"
import pkg from "../package.json"
const version = process.env["VERSION"]
await import("./stainless.ts")
-15
View File
@@ -1,15 +0,0 @@
#!/usr/bin/env bun
import { $ } from "bun"
await $`bun run ./packages/opencode/src/index.ts generate > openapi.json`
await $`stl builds create --branch dev --pull --allow-empty --+target go --+target typescript`
await $`rm -rf packages/sdk`
await $`mkdir -p packages/sdk`
await $`mv opencode-go/ packages/sdk/go`
await $`rm -rf packages/sdk/go/.git`
await $`mv opencode-typescript/ packages/sdk/js`
await $`rm -rf packages/sdk/js/.git`
await $`rm -rf packages/sdk/js/yarn.lock`