@brainervirus/opencode-commandcode 0.9.0 → 0.9.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,5 @@
1
+ export declare function resolveApiKey(options: {
2
+ apiKey?: string;
3
+ env?: Record<string, string | undefined>;
4
+ authPaths?: string[];
5
+ }): string | undefined;
@@ -0,0 +1,12 @@
1
+ export declare function catalogBreakTitle(commandCodeVersion: string): string;
2
+ export declare function renderCatalogBreakBody(input: {
3
+ commandCodeVersion: string;
4
+ error: string;
5
+ workflowUrl: string;
6
+ bundledCommandCodeVersion: string | null;
7
+ }): string;
8
+ export declare function catalogBreakResolvedComment(input: {
9
+ commit: string;
10
+ tag: string;
11
+ }): string;
12
+ export declare const CATALOG_BREAK_LABEL = "catalog-break";
@@ -0,0 +1,30 @@
1
+ import type { CatalogManifest, CatalogReview, CatalogStatus, CostSources } from "./manifest.js";
2
+ export type PricedModel = {
3
+ id: string;
4
+ name: string;
5
+ cost: {
6
+ input: number;
7
+ output: number;
8
+ };
9
+ };
10
+ export type CatalogReleaseInput = {
11
+ pluginVersion: string;
12
+ commandCodeVersion: string;
13
+ modelCount: number;
14
+ reasoningModelCount: number;
15
+ status: CatalogStatus;
16
+ costSources: CostSources;
17
+ models: PricedModel[];
18
+ review?: CatalogReview;
19
+ };
20
+ export declare function partitionPrices(models: PricedModel[], review: CatalogReview | undefined): {
21
+ thirdParty: PricedModel[];
22
+ free: PricedModel[];
23
+ unmatched: PricedModel[];
24
+ };
25
+ export declare function renderCatalogReleaseNotes(input: CatalogReleaseInput): string;
26
+ export declare function catalogReleaseNotesFromFiles(input: {
27
+ manifest: CatalogManifest;
28
+ models: PricedModel[];
29
+ pluginVersion?: string;
30
+ }): string;
@@ -0,0 +1,104 @@
1
+ import { z } from "zod";
2
+ import { ModelEntrySchema } from "./schemas.js";
3
+ import { type EnvDeps } from "./env.js";
4
+ import { type LoadResult } from "./load-result.js";
5
+ export declare const NPM_PACKAGE = "command-code";
6
+ export type ModelEntry = z.infer<typeof ModelEntrySchema>;
7
+ export interface CostEntry {
8
+ id: string;
9
+ provider: string;
10
+ category: string;
11
+ promptCost: number;
12
+ completionCost: number;
13
+ cacheWrite5mCost: number;
14
+ cacheWrite1hCost: number;
15
+ cacheHitCost: number;
16
+ }
17
+ export interface SnEntry {
18
+ id: string;
19
+ provider: string;
20
+ spec: string;
21
+ label: string;
22
+ name: string;
23
+ description: string;
24
+ reasoning?: boolean;
25
+ reasoningEfforts?: string[];
26
+ contextWindow?: number;
27
+ inputModalities?: string[];
28
+ maxOutputTokens?: number;
29
+ }
30
+ export interface ResolvedCommandCodePackage {
31
+ root: string;
32
+ bundlePath: string;
33
+ version: string;
34
+ }
35
+ export interface LocalCatalogResult {
36
+ models: ModelEntry[];
37
+ version: string;
38
+ root: string;
39
+ bundleSource: string;
40
+ }
41
+ export declare const FALLBACK_LIMITS: Record<string, {
42
+ context: number;
43
+ output: number;
44
+ }>;
45
+ export declare const HARDCODED_EXTRAS: SnEntry[];
46
+ export declare const TIER_MAP: Record<string, "premium" | "open-source">;
47
+ /** Object after `(` (legacy IIFE / enum form): `(Wt={...})` */
48
+ export declare function findBalancedObject(source: string, anchor: string): string;
49
+ /** All balanced `{...}` spans that contain the anchor, innermost → outermost. */
50
+ export declare function findEnclosingObjectCandidates(source: string, anchor: string, fromIndex?: number): string[];
51
+ /** Default: innermost enclosing object (good for plain catalogs). */
52
+ export declare function findEnclosingObject(source: string, anchor: string, fromIndex?: number): string;
53
+ export declare function evaluateWithContext(code: string, context: Record<string, unknown>): any;
54
+ export declare function normalizeForEval(code: string): string;
55
+ /** Prefer provider enums that include gateway/openai keys over UI-only enums. */
56
+ export declare function extractBestProviderEnum(source: string): {
57
+ name: string;
58
+ value: Record<string, string>;
59
+ } | null;
60
+ /** Collect nearby `name="value"` bindings and simple aliases (`tI=Qx`). */
61
+ export declare function extractStringBindings(source: string, endIdx: number, window?: number): Record<string, string>;
62
+ export declare function extractSpecConstants(source: string): {
63
+ chatComplete: string;
64
+ responses: string;
65
+ qt: string;
66
+ };
67
+ export declare function extractModelCatalog(source: string, wt?: Record<string, string>, wtName?: string, spec?: ReturnType<typeof extractSpecConstants>): Record<string, SnEntry>;
68
+ export declare function extractCostData(source: string, wt?: Record<string, string>, wtName?: string): Record<string, CostEntry[]>;
69
+ export declare function buildCostMap(costs: Record<string, CostEntry[]>): Map<string, CostEntry>;
70
+ export declare function buildModelEntry(entry: SnEntry, costMap: Map<string, CostEntry>): ModelEntry | null;
71
+ export declare function disambiguateModelNames(entries: ModelEntry[]): ModelEntry[];
72
+ export declare function sortModelEntries(entries: ModelEntry[]): ModelEntry[];
73
+ export declare function loadCatalogFromBundle(source: string): ModelEntry[];
74
+ export declare function resolveCommandCodePackage(options?: {
75
+ packagePath?: string;
76
+ }, deps?: EnvDeps): ResolvedCommandCodePackage | null;
77
+ /**
78
+ * Explicit local-catalog load: `ok(null)` means no package was found to try
79
+ * (opt-in unused or undiscoverable — not a failure), `err` carries the
80
+ * reason an attempted load failed, `ok(result)` is a usable catalog.
81
+ */
82
+ export declare function loadCatalogFromLocalCommandCodeResult(options?: {
83
+ packagePath?: string;
84
+ }, deps?: EnvDeps): LoadResult<LocalCatalogResult | null>;
85
+ /** Compat wrapper: value-or-null for callers that only need fail-open. */
86
+ export declare function loadCatalogFromLocalCommandCode(options?: {
87
+ packagePath?: string;
88
+ }): LocalCatalogResult | null;
89
+ /** Short OpenCode map / UI key. Wire id stays the catalog `entry.id` (vendor/…). */
90
+ export declare function toConfigKey(id: string): string;
91
+ export declare function generateOpencodeModels(entries: ModelEntry[]): Record<string, unknown>;
92
+ export declare const MODELS_API_URL = "https://api.commandcode.ai/provider/v1/models";
93
+ export interface FilteredCatalog<T extends {
94
+ id: string;
95
+ }> {
96
+ retained: T[];
97
+ unavailable: string[];
98
+ }
99
+ /** Validate the OpenAI-style `{ object: "list", data: [{ id }] }` availability payload. */
100
+ export declare function parseAvailabilityIds(payload: unknown): string[];
101
+ /** Retain only candidates whose exact ID is callable; collect sorted excluded IDs. */
102
+ export declare function filterCatalogByAvailability<T extends {
103
+ id: string;
104
+ }>(candidates: T[], availableIds: string[]): FilteredCatalog<T>;
@@ -0,0 +1,71 @@
1
+ import type { LanguageModelV3CallOptions } from "@ai-sdk/provider";
2
+ type CCMessage = {
3
+ role: "user";
4
+ content: string | unknown[];
5
+ } | {
6
+ role: "assistant";
7
+ content: CCAssistantContent[];
8
+ } | {
9
+ role: "tool";
10
+ content: CCToolResultContent[];
11
+ };
12
+ type CCAssistantContent = {
13
+ type: "text";
14
+ text: string;
15
+ } | {
16
+ type: "reasoning";
17
+ text: string;
18
+ } | {
19
+ type: "tool-call";
20
+ toolCallId: string;
21
+ toolName: string;
22
+ input: unknown;
23
+ };
24
+ type CCToolResultContent = {
25
+ type: "tool-result";
26
+ toolCallId: string;
27
+ toolName: string;
28
+ output: {
29
+ type: "text";
30
+ value: string;
31
+ } | {
32
+ type: "error-text";
33
+ value: string;
34
+ };
35
+ };
36
+ type CCTool = {
37
+ type: "function";
38
+ name: string;
39
+ description?: string;
40
+ input_schema: unknown;
41
+ };
42
+ interface CCRequestEnvelope {
43
+ config: {
44
+ workingDir: string;
45
+ date: string;
46
+ environment: string;
47
+ structure: unknown[];
48
+ isGitRepo: boolean;
49
+ currentBranch: string;
50
+ mainBranch: string;
51
+ gitStatus: string;
52
+ recentCommits: unknown[];
53
+ };
54
+ memory: string;
55
+ taste: string;
56
+ skills: null;
57
+ permissionMode: string;
58
+ params: {
59
+ model: string;
60
+ messages: CCMessage[];
61
+ tools: CCTool[];
62
+ system: string;
63
+ max_tokens: number;
64
+ stream: true;
65
+ temperature?: number;
66
+ top_p?: number;
67
+ top_k?: number;
68
+ };
69
+ }
70
+ export declare function buildRequest(modelId: string, options: LanguageModelV3CallOptions): CCRequestEnvelope;
71
+ export {};
@@ -0,0 +1,13 @@
1
+ import type { ModelEntry } from "./catalog.js";
2
+ export type DocCostRow = {
3
+ name: string;
4
+ id?: string;
5
+ input: number;
6
+ output: number;
7
+ cache_read?: number;
8
+ cache_write?: number;
9
+ };
10
+ export declare function parseMoneyCell(cell: string): number | undefined;
11
+ export declare function parseModelsTable(markdown: string): DocCostRow[];
12
+ export declare function applyDocCosts(models: ModelEntry[], rows: DocCostRow[], cliIds?: Set<string>, filledIds?: Set<string>): number;
13
+ export declare function fetchOfficialModelsMarkdown(): Promise<string>;
@@ -0,0 +1,34 @@
1
+ import type { ModelEntry } from "./catalog.js";
2
+ export declare const MODELS_DEV_URL = "https://models.dev/api.json";
3
+ export declare const FREE_COST: {
4
+ readonly input: 0;
5
+ readonly output: 0;
6
+ };
7
+ export declare const TEXT_ONLY_MODALITIES: {
8
+ readonly input: readonly ["text"];
9
+ readonly output: readonly ["text"];
10
+ };
11
+ export type ModelsDevRow = {
12
+ id: string;
13
+ name: string;
14
+ cost: {
15
+ input: number;
16
+ output: number;
17
+ cache_read?: number;
18
+ cache_write?: number;
19
+ };
20
+ attachment?: boolean;
21
+ modalities?: {
22
+ input: string[];
23
+ output: string[];
24
+ };
25
+ };
26
+ export declare function isFreeSku(model: {
27
+ id: string;
28
+ name: string;
29
+ }): boolean;
30
+ export declare function parseModelsDev(json: string): ModelsDevRow[];
31
+ export declare function applyFreeCosts(models: ModelEntry[], skipIds: Set<string>, filledIds?: Set<string>): number;
32
+ export declare function applyModelsDevModalities(models: ModelEntry[], rows: ModelsDevRow[]): number;
33
+ export declare function applyModelsDevCosts(models: ModelEntry[], rows: ModelsDevRow[], skipIds: Set<string>, filledIds?: Set<string>): number;
34
+ export declare function fetchModelsDevJson(): Promise<string>;
@@ -0,0 +1 @@
1
+ export declare function cutKeepAChangelog(markdown: string, version: string, date: string): string;
@@ -0,0 +1,3 @@
1
+ export { default } from "../plugin.js";
2
+ export { server } from "../plugin.js";
3
+ export { createCommandCode } from "../index.js";
@@ -0,0 +1,13 @@
1
+ /**
2
+ * Hermetic seam for environment access. Runtime code takes an optional
3
+ * `deps` parameter defaulting to `liveEnv`, so existing call sites behave
4
+ * identically while tests inject fakes instead of juggling `process.env`.
5
+ * Filesystem calls stay direct; only environment reads go through here.
6
+ */
7
+ export type EnvDeps = {
8
+ homedir: () => string;
9
+ getEnv: (key: string) => string | undefined;
10
+ };
11
+ export declare const liveEnv: EnvDeps;
12
+ /** Plugin state directory: explicit override wins, otherwise under home. */
13
+ export declare function resolveStateDir(deps?: EnvDeps): string;
@@ -0,0 +1,17 @@
1
+ /**
2
+ * Explicit load result: a value on success, a human-readable reason when
3
+ * there is none. Load boundaries return this instead of catching everything
4
+ * and yielding `null`, so callers can thread the reason into degraded
5
+ * reporting instead of guessing which read failed.
6
+ */
7
+ export type LoadResult<T> = {
8
+ ok: true;
9
+ value: T;
10
+ } | {
11
+ ok: false;
12
+ reason: string;
13
+ };
14
+ export declare function okResult<T>(value: T): LoadResult<T>;
15
+ export declare function errResult<T>(reason: string): LoadResult<T>;
16
+ /** One-line summary of a caught value for embedding in a reason string. */
17
+ export declare function causeMessage(cause: unknown): string;
@@ -0,0 +1,54 @@
1
+ import { z } from "zod";
2
+ import { ManifestSchema } from "./schemas.js";
3
+ export type CatalogStatus = "healthy" | "degraded" | "broken";
4
+ export type CostCatalogBest = "cli" | "docs" | "thirdParty" | "free" | "fallback" | "missing";
5
+ export type CostSources = {
6
+ cli: number;
7
+ officialDocs: number;
8
+ thirdParty: number;
9
+ free: number;
10
+ fallback: number;
11
+ unmatched: number;
12
+ };
13
+ export type UnavailableEntry = {
14
+ id: string;
15
+ reason: "not-listed-by-provider-api";
16
+ };
17
+ export type CatalogReview = {
18
+ thirdParty: string[];
19
+ free: string[];
20
+ unmatched: string[];
21
+ unavailable?: UnavailableEntry[];
22
+ };
23
+ export type CatalogManifest = z.infer<typeof ManifestSchema>;
24
+ export type BuildManifestInput = {
25
+ pluginVersion: string;
26
+ commandCodeVersion: string;
27
+ commandCodeTarball: string;
28
+ modelCount: number;
29
+ reasoningModelCount: number;
30
+ modelCatalogOk: boolean;
31
+ costSources: CostSources;
32
+ review?: CatalogReview;
33
+ generatedAt: string;
34
+ costCatalogError?: string | null;
35
+ };
36
+ export declare function withUnavailableIds(review: CatalogReview | undefined, unavailable: string[]): CatalogReview | undefined;
37
+ /** Update only the embedded plugin version; reject a missing target version. */
38
+ export declare function withPluginVersion(manifest: CatalogManifest, version: string): CatalogManifest;
39
+ export declare function bumpPatch(version: string): string;
40
+ export declare function meetsModelCountFloor(modelCount: number, lastSuccessful: number | null): boolean;
41
+ export declare function bestCostCatalog(sources: CostSources): CostCatalogBest;
42
+ export declare function catalogStatus(modelCatalogOk: boolean, sources: CostSources): CatalogStatus;
43
+ export declare function commandCodeTarballUrl(version: string): string;
44
+ export declare function buildManifest(input: BuildManifestInput): CatalogManifest;
45
+ export declare function writeManifest(path: string, manifest: CatalogManifest): void;
46
+ export declare function lastSuccessfulModelCount(manifest: CatalogManifest | null): number | null;
47
+ export declare function countCostSources(input: {
48
+ modelIds: string[];
49
+ cliIds: Set<string>;
50
+ officialDocIds: Set<string>;
51
+ thirdPartyIds: Set<string>;
52
+ freeIds: Set<string>;
53
+ fallbackIds?: Set<string>;
54
+ }): CostSources;
@@ -0,0 +1,18 @@
1
+ import type { LanguageModelV3, LanguageModelV3CallOptions, LanguageModelV3StreamResult, LanguageModelV3GenerateResult } from "@ai-sdk/provider";
2
+ export interface CommandCodeModelOptions {
3
+ apiKey: string;
4
+ baseURL?: string;
5
+ headers?: Record<string, string>;
6
+ }
7
+ export declare class CommandCodeLanguageModel implements LanguageModelV3 {
8
+ readonly specificationVersion: "v3";
9
+ readonly provider = "commandcode";
10
+ readonly modelId: string;
11
+ supportedUrls: Record<string, RegExp[]>;
12
+ private opts;
13
+ constructor(modelId: string, opts: CommandCodeModelOptions);
14
+ private get baseURL();
15
+ private buildHeaders;
16
+ doStream(options: LanguageModelV3CallOptions): Promise<LanguageModelV3StreamResult>;
17
+ doGenerate(options: LanguageModelV3CallOptions): Promise<LanguageModelV3GenerateResult>;
18
+ }
@@ -0,0 +1,14 @@
1
+ /**
2
+ * Resolve the provider package root from any layout, workit-style: source
3
+ * modules live in `src/`, the plugin entry at the package root (`plugin.ts`),
4
+ * and a future bundle in `dist/`. The nearest ancestor with a `package.json`
5
+ * wins, so moving a source file or bundling the entry can never silently
6
+ * point catalog reads at the wrong directory.
7
+ */
8
+ export declare const packageRoot: () => string;
9
+ /** Catalog artifact locations under the resolved package root. */
10
+ export declare const catalogPaths: () => {
11
+ models: string;
12
+ manifest: string;
13
+ version: string;
14
+ };
@@ -0,0 +1,18 @@
1
+ export type CatalogSyncDecision = {
2
+ extract: boolean;
3
+ publishRetry: boolean;
4
+ exit: boolean;
5
+ };
6
+ export type PublishDecision = "publish" | "skip-no-token" | "skip-already-published";
7
+ export declare function decideCatalogSync(input: {
8
+ force: boolean;
9
+ latestCommandCodeVersion: string;
10
+ bundledCommandCodeVersion: string | null;
11
+ pluginVersion: string;
12
+ publishedPluginVersions: string[];
13
+ }): CatalogSyncDecision;
14
+ export declare function decidePublish(input: {
15
+ pluginVersion: string;
16
+ publishedPluginVersions: string[];
17
+ npmTokenSet: boolean;
18
+ }): PublishDecision;
@@ -0,0 +1,96 @@
1
+ import { z } from "zod";
2
+ /** Canonical catalog model entry. Single source of truth — src/catalog.ts derives its ModelEntry type from here via z.infer; never redeclare the shape there. */
3
+ export declare const ModelEntrySchema: z.ZodObject<{
4
+ id: z.ZodString;
5
+ name: z.ZodString;
6
+ tier: z.ZodEnum<{
7
+ premium: "premium";
8
+ "open-source": "open-source";
9
+ }>;
10
+ reasoning: z.ZodBoolean;
11
+ reasoningEfforts: z.ZodOptional<z.ZodArray<z.ZodString>>;
12
+ tool_call: z.ZodBoolean;
13
+ cost: z.ZodObject<{
14
+ input: z.ZodNumber;
15
+ output: z.ZodNumber;
16
+ cache_read: z.ZodOptional<z.ZodNumber>;
17
+ cache_write: z.ZodOptional<z.ZodNumber>;
18
+ }, z.core.$strict>;
19
+ limit: z.ZodObject<{
20
+ context: z.ZodNumber;
21
+ output: z.ZodNumber;
22
+ }, z.core.$strict>;
23
+ attachment: z.ZodOptional<z.ZodBoolean>;
24
+ modalities: z.ZodOptional<z.ZodObject<{
25
+ input: z.ZodArray<z.ZodString>;
26
+ output: z.ZodArray<z.ZodString>;
27
+ }, z.core.$strict>>;
28
+ }, z.core.$strict>;
29
+ /** Canonical catalog manifest. Single source of truth — src/manifest.ts derives its CatalogManifest type from here via z.infer; never redeclare the shape there. */
30
+ export declare const ManifestSchema: z.ZodObject<{
31
+ schemaVersion: z.ZodLiteral<1>;
32
+ generatedAt: z.ZodString;
33
+ pluginVersion: z.ZodString;
34
+ commandCodeVersion: z.ZodString;
35
+ commandCodeTarball: z.ZodString;
36
+ modelCount: z.ZodNumber;
37
+ reasoningModelCount: z.ZodNumber;
38
+ extraction: z.ZodObject<{
39
+ modelCatalog: z.ZodEnum<{
40
+ ok: "ok";
41
+ failed: "failed";
42
+ }>;
43
+ costCatalog: z.ZodEnum<{
44
+ cli: "cli";
45
+ docs: "docs";
46
+ thirdParty: "thirdParty";
47
+ free: "free";
48
+ fallback: "fallback";
49
+ missing: "missing";
50
+ }>;
51
+ costCatalogError: z.ZodNullable<z.ZodString>;
52
+ }, z.core.$strict>;
53
+ costSources: z.ZodObject<{
54
+ cli: z.ZodNumber;
55
+ officialDocs: z.ZodNumber;
56
+ thirdParty: z.ZodNumber;
57
+ free: z.ZodNumber;
58
+ fallback: z.ZodNumber;
59
+ unmatched: z.ZodNumber;
60
+ }, z.core.$strict>;
61
+ review: z.ZodOptional<z.ZodObject<{
62
+ thirdParty: z.ZodArray<z.ZodString>;
63
+ free: z.ZodArray<z.ZodString>;
64
+ unmatched: z.ZodArray<z.ZodString>;
65
+ unavailable: z.ZodOptional<z.ZodArray<z.ZodObject<{
66
+ id: z.ZodString;
67
+ reason: z.ZodLiteral<"not-listed-by-provider-api">;
68
+ }, z.core.$strict>>>;
69
+ }, z.core.$strict>>;
70
+ status: z.ZodEnum<{
71
+ healthy: "healthy";
72
+ degraded: "degraded";
73
+ broken: "broken";
74
+ }>;
75
+ }, z.core.$strict>;
76
+ /**
77
+ * OpenAI-style `{ object: "list", data: [{ id }] }` availability payload.
78
+ * Items stay lenient (the provider API returns extra per-model fields);
79
+ * duplicate ids are rejected.
80
+ */
81
+ export declare const AvailabilityPayloadSchema: z.ZodObject<{
82
+ object: z.ZodLiteral<"list">;
83
+ data: z.ZodArray<z.ZodObject<{
84
+ id: z.ZodString;
85
+ }, z.core.$strip>>;
86
+ }, z.core.$strip>;
87
+ /**
88
+ * Plugin file config (`~/.config/opencode/opencode-commandcode.json`).
89
+ * Deliberately lenient: user config files may carry extra keys, so unknown
90
+ * keys are stripped and every field falls back to its default.
91
+ */
92
+ export declare const PluginFileConfigSchema: z.ZodObject<{
93
+ disableModelSync: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
94
+ commandCodePackagePath: z.ZodDefault<z.ZodOptional<z.ZodString>>;
95
+ debugStartupLogs: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
96
+ }, z.core.$strip>;
@@ -0,0 +1,22 @@
1
+ import type { ModelEntry } from "./catalog.js";
2
+ import { type EnvDeps } from "./env.js";
3
+ import { type LoadResult } from "./load-result.js";
4
+ export type { ModelEntry } from "./catalog.js";
5
+ export type StartupSummary = {
6
+ catalogSource: "bundled" | "cache" | "opt-in-local";
7
+ commandCodeVersion: string | null;
8
+ modelCount: number;
9
+ reasoningModelCount: number;
10
+ degraded: boolean;
11
+ degradedReason: string | null;
12
+ };
13
+ export declare function pluginStateDir(deps?: EnvDeps): string;
14
+ /**
15
+ * Explicit cache read: hit yields the models, anything else yields the
16
+ * reason (missing file, empty/invalid content, unreadable JSON).
17
+ */
18
+ export declare function readCatalogCacheResult(dir?: string, deps?: EnvDeps): LoadResult<ModelEntry[]>;
19
+ /** Compat wrapper: explicit-dir callers that only need value-or-null. */
20
+ export declare function readCatalogCache(dir?: string, deps?: EnvDeps): ModelEntry[] | null;
21
+ export declare function writeCatalogCache(dir: string, models: ModelEntry[]): void;
22
+ export declare function writeStartupSummary(dir: string, summary: StartupSummary): void;
@@ -0,0 +1,2 @@
1
+ import type { LanguageModelV3StreamPart } from "@ai-sdk/provider";
2
+ export declare function parseStreamEvents(body: ReadableStream<Uint8Array>): ReadableStream<LanguageModelV3StreamPart>;
@@ -0,0 +1,36 @@
1
+ import { type ModelEntry } from "./catalog.js";
2
+ /** Minimal V2 model shape (structural subset of Model.Info). */
3
+ export interface V2Model {
4
+ id: string;
5
+ modelID: string;
6
+ providerID: string;
7
+ name: string;
8
+ capabilities: {
9
+ tools: boolean;
10
+ input: string[];
11
+ output: string[];
12
+ };
13
+ cost: Array<{
14
+ input: number;
15
+ output: number;
16
+ cache: {
17
+ read: number;
18
+ write: number;
19
+ };
20
+ }>;
21
+ limit: {
22
+ context: number;
23
+ output: number;
24
+ };
25
+ variants: Array<{
26
+ id: string;
27
+ settings: Record<string, unknown>;
28
+ }>;
29
+ status: "active";
30
+ enabled: boolean;
31
+ time: {
32
+ released: number;
33
+ };
34
+ }
35
+ export declare function toV2Model(entry: ModelEntry): V2Model;
36
+ export declare function generateV2Models(entries: ModelEntry[]): V2Model[];
package/manifest.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "schemaVersion": 1,
3
3
  "generatedAt": "2026-09-26T06:01:17.803Z",
4
- "pluginVersion": "0.9.0",
4
+ "pluginVersion": "0.9.1",
5
5
  "commandCodeVersion": "1.66.0",
6
6
  "commandCodeTarball": "https://registry.npmjs.org/command-code/-/command-code-1.66.0.tgz",
7
7
  "modelCount": 82,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@brainervirus/opencode-commandcode",
3
- "version": "0.9.0",
3
+ "version": "0.9.1",
4
4
  "description": "Command Code API provider for opencode — use Claude, GPT, Gemini, DeepSeek, Qwen, Kimi, GLM, MiniMax, and Step models via Command Code",
5
5
  "keywords": [
6
6
  "ai",
@@ -66,7 +66,7 @@
66
66
  "test:integration": "bun test tests/integration/",
67
67
  "test:all": "bun test",
68
68
  "typecheck": "tsc --noEmit",
69
- "prepack": "bun run scripts/verify-manifest-version.ts",
69
+ "prepack": "bun run build && bun run scripts/verify-manifest-version.ts",
70
70
  "verify:release-candidate": "bun run scripts/verify-release-candidate.ts",
71
71
  "generate-readme": "bun run scripts/generate-readme.ts",
72
72
  "sync": "bun run scripts/sync-models.ts",