Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,9 @@ jobs:
- name: Typecheck
run: bun run typecheck

- name: Dead exports
run: bun run check:dead-exports

# Build runs beside the suite instead of before it: tests import ./src
# directly and never read ./dist, so serializing build ahead of test put
# build time on the critical path for no dependency reason.
Expand Down
2 changes: 1 addition & 1 deletion AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ bun run check
```

`bun run check` is the single pre-PR gate: it runs `lint`, `typecheck`,
`build`, and `check:projects-dir-guard` — which runs the `test` suite under
`check:dead-exports`, `build`, and `check:projects-dir-guard` — which runs the `test` suite under
the projects-dir sandbox guard — in that order, matching CI.

Run the full suite before declaring any task complete. Do not substitute individual targets. If a failure is pre-existing and unrelated to your change, say so explicitly.
Expand Down
105 changes: 102 additions & 3 deletions bun.lock

Large diffs are not rendered by default.

4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,8 @@
"test:parallel": "bun scripts/test-parallel.ts",
"lint": "oxfmt --check . && oxlint",
"check:projects-dir-guard": "bun scripts/guard-real-projects-dir.ts",
"check": "bun run lint && bun run typecheck && bun run build && bun run check:projects-dir-guard",
"check:dead-exports": "bun scripts/check-dead-exports.ts",
"check": "bun run lint && bun run typecheck && bun run check:dead-exports && bun run build && bun run check:projects-dir-guard",
"start": "bun run build && bun ./dist/index.js",
"eval:capability": "bun scripts/eval-capability.ts",
"eval:public-swe-one": "bun scripts/eval-public-swe-one.ts",
Expand Down Expand Up @@ -111,6 +112,7 @@
"@types/bun": "1.3.9",
"oxfmt": "^0.67.0",
"oxlint": "^1.82.0",
"ts-prune": "0.10.3",
"typescript": "5.9.3",
"typescript-language-server": "^4.3.4",
"ws": "^8.21.0"
Expand Down
28 changes: 0 additions & 28 deletions packages/first-class-providers/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,38 +2,10 @@ export {
FIRST_CLASS_PROVIDERS,
OPENAI_API_BASE_URL,
OPENAI_API_MAX_COMPLETION_TOKENS_MODELS,
connectListProviders,
firstClassPathAsProvider,
firstClassProviderById,
} from "./providers.js";
export type {
FirstClassAuthKind,
FirstClassBillingProduct,
FirstClassOAuthProvider,
FirstClassProviderDef,
FirstClassProviderPath,
} from "./types.js";

// Re-export Go package surface so hosts can depend on one entry for connect.
export {
OPENCODE_GO_ANTHROPIC_BASE_URL,
OPENCODE_GO_AUTH_HINT,
OPENCODE_GO_BASE_URL,
OPENCODE_GO_DEFAULT_MODEL,
OPENCODE_GO_DISPLAY_NAME,
OPENCODE_GO_MODEL_IDS,
OPENCODE_GO_MODELS,
OPENCODE_GO_PROVIDER_ID,
buildGoCatalogEntry,
fetchGoUsage,
formatGoUsage,
isKnownGoModel,
protocolForGoModel,
resolveGoEndpoint,
validateGoApiKey,
type GoCatalogEntry,
type GoEndpoint,
type GoModel,
type GoProtocol,
type GoUsage,
} from "../../opencode-go/src/index.js";
2 changes: 1 addition & 1 deletion packages/opencode-go/src/catalog.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import {
} from "./models.js";

/** Host-agnostic catalog projection for connect + model pickers. */
export interface GoCatalogEntry {
interface GoCatalogEntry {
name: typeof OPENCODE_GO_PROVIDER_ID;
displayName: typeof OPENCODE_GO_DISPLAY_NAME;
baseURL: typeof OPENCODE_GO_BASE_URL;
Expand Down
1 change: 0 additions & 1 deletion packages/opencode-go/src/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ export const OPENCODE_GO_BASE_URL = "https://opencode.ai/zen/go/v1";
export const OPENCODE_GO_ANTHROPIC_BASE_URL = "https://opencode.ai/zen/go";

export const OPENCODE_GO_USAGE_PATH = "/usage";
export const OPENCODE_GO_MODELS_PATH = "/models";

export const OPENCODE_GO_AUTH_HINT =
"Paste your OpenCode Go API key from https://opencode.ai/auth";
2 changes: 1 addition & 1 deletion packages/opencode-go/src/endpoint.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import {
} from "./constants.js";
import { type GoProtocol, protocolForGoModel } from "./models.js";

export interface GoEndpoint {
interface GoEndpoint {
protocol: GoProtocol;
/** Base URL for the selected protocol's adapter. */
baseURL: string;
Expand Down
29 changes: 5 additions & 24 deletions packages/opencode-go/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,42 +1,23 @@
export {
OPENCODE_GO_ANTHROPIC_BASE_URL,
OPENCODE_GO_AUTH_HINT,
OPENCODE_GO_BASE_URL,
OPENCODE_GO_DISPLAY_NAME,
OPENCODE_GO_MODELS_PATH,
OPENCODE_GO_PROVIDER_ID,
OPENCODE_GO_USAGE_PATH,
} from "./constants.js";

export {
OPENCODE_GO_DEFAULT_MODEL,
OPENCODE_GO_MODEL_IDS,
OPENCODE_GO_MODELS,
isKnownGoModel,
protocolForGoModel,
type GoModel,
type GoModelId,
type GoProtocol,
} from "./models.js";

export { resolveGoEndpoint, type GoEndpoint } from "./endpoint.js";
export { validateGoApiKey, type GoApiKeyValidation } from "./auth.js";
export {
fetchGoUsage,
formatGoUsage,
type GoFetch,
type GoUsage,
type GoUsageWindow,
} from "./usage.js";
export { buildGoCatalogEntry, type GoCatalogEntry } from "./catalog.js";
export { resolveGoEndpoint } from "./endpoint.js";
export { validateGoApiKey } from "./auth.js";
export { fetchGoUsage, formatGoUsage } from "./usage.js";
export { buildGoCatalogEntry } from "./catalog.js";
export {
isOpenCodeGoProvider,
isOpenCodeGoProviderId,
isOpenCodeGoURL,
} from "./identity.js";
export {
parseGoAPIError,
type GoErrorCategory,
type GoErrorKind,
type ParsedGoAPIError,
} from "./errors.js";
export { parseGoAPIError } from "./errors.js";
2 changes: 1 addition & 1 deletion packages/opencode-go/src/models.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

export type GoProtocol = "chat-completions" | "responses" | "messages";

export interface GoModel {
interface GoModel {
id: string;
name: string;
protocol: GoProtocol;
Expand Down
2 changes: 1 addition & 1 deletion packages/opencode-go/src/usage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ export interface GoUsageWindow {
resetInSec?: number;
}

export interface GoUsage {
interface GoUsage {
rolling5h?: GoUsageWindow;
weekly?: GoUsageWindow;
monthly?: GoUsageWindow;
Expand Down
2 changes: 0 additions & 2 deletions packages/zen/src/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,5 @@ export const ZEN_DEFAULT_BASE_URL = "https://opencode.ai/zen/v1";
// is the correct base for message-protocol models.
export const ZEN_BASE_URL = "https://opencode.ai/zen";

export const ZEN_MODELS_PATH = "/models";

export const ZEN_AUTH_HINT =
"OpenCode Zen pay-as-you-go credits — paste your API key from https://opencode.ai/auth";
19 changes: 3 additions & 16 deletions packages/zen/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,22 +1,9 @@
export {
ZEN_AUTH_HINT,
ZEN_BASE_URL,
ZEN_DEFAULT_BASE_URL,
ZEN_DISPLAY_NAME,
ZEN_MODELS_PATH,
ZEN_PROVIDER_ID,
} from "./constants.js";
export {
resolveZenEndpoint,
zenProtocolForModel,
type ZenEndpoint,
type ZenEndpointKind,
} from "./endpoint.js";
export { isZenProvider, isZenProviderId, isZenURL } from "./identity.js";
export {
isKnownZenModel,
protocolForZenModel,
ZEN_DEFAULT_MODEL,
ZEN_MODEL_IDS,
type ZenProtocol,
} from "./models.js";
export { resolveZenEndpoint } from "./endpoint.js";
export { isZenProvider, isZenProviderId } from "./identity.js";
export { isKnownZenModel, ZEN_DEFAULT_MODEL, ZEN_MODEL_IDS } from "./models.js";
Loading
Loading