@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.
- package/CHANGELOG.md +2 -0
- package/README.md +1 -1
- package/dist/index.d.ts +12 -0
- package/dist/plugin.d.ts +45 -0
- package/dist/plugin.js +21018 -0
- package/dist/src/auth.d.ts +5 -0
- package/dist/src/catalog-break.d.ts +12 -0
- package/dist/src/catalog-release-notes.d.ts +30 -0
- package/dist/src/catalog.d.ts +104 -0
- package/dist/src/convert.d.ts +71 -0
- package/dist/src/costs-docs.d.ts +13 -0
- package/dist/src/costs-models-dev.d.ts +34 -0
- package/dist/src/cut-changelog.d.ts +1 -0
- package/dist/src/entry.d.ts +3 -0
- package/dist/src/env.d.ts +13 -0
- package/dist/src/load-result.d.ts +17 -0
- package/dist/src/manifest.d.ts +54 -0
- package/dist/src/model.d.ts +18 -0
- package/dist/src/paths.d.ts +14 -0
- package/dist/src/publish-policy.d.ts +18 -0
- package/dist/src/schemas.d.ts +96 -0
- package/dist/src/startup.d.ts +22 -0
- package/dist/src/stream.d.ts +2 -0
- package/dist/src/v2models.d.ts +36 -0
- package/manifest.json +1 -1
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
package/README.md
CHANGED
|
@@ -99,7 +99,7 @@ bun run catalog:ci # entry used by the catalog-sync workflow
|
|
|
99
99
|
|
|
100
100
|
Entry points: `plugin.ts` owns all config-hook logic (dual default `{ id, setup }` plus `server`); `index.ts` re-exports the plugin plus the `createCommandCode` SDK factory; `src/entry.ts` is bundle glue for `scripts/build-plugin.ts` only — it produces `dist/plugin.js`.
|
|
101
101
|
|
|
102
|
-
CI (`.github/workflows/catalog-sync.yml`) opens a `fix(catalog)` PR every 6 hours when Command Code ships a new catalog; if extraction fails it opens a `catalog-break` issue instead. The PR auto-merges after **check (test)**, **check (typecheck)**, **check (lint)**, **check (format)**, and **check (pack)** are green. `.github/workflows/release.yml` then runs **semantic-release** (npm publish + GitHub Release + tag). Do not push to `main`.
|
|
102
|
+
CI (`.github/workflows/catalog-sync.yml`) opens a `fix(catalog)` PR every 6 hours when Command Code ships a new catalog; if extraction fails it opens a `catalog-break` issue instead. The PR auto-merges after **check (test)**, **check (typecheck)**, **check (lint)**, **check (format)**, and **check (pack)** are green. `.github/workflows/release.yml` then runs **semantic-release** (build + verified npm publish + GitHub Release + tag). Do not push to `main`.
|
|
103
103
|
|
|
104
104
|
The GitHub Actions secret name is `NPMJS`. It is mapped to both `NPM_TOKEN` and `NODE_AUTH_TOKEN`. Use an npm **Automation** token (bypasses 2FA). A login token from `~/.npmrc` fails CI with `EOTP`. Catalog PRs get a real CI run when `RELEASE_SYNC_TOKEN` is a PAT; `GITHUB_TOKEN` can open the PR but GitHub will not start workflows from that event.
|
|
105
105
|
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { CommandCodeLanguageModel } from "./src/model.js";
|
|
2
|
+
export { default, server } from "./plugin.js";
|
|
3
|
+
export interface CommandCodeProviderOptions {
|
|
4
|
+
name?: string;
|
|
5
|
+
apiKey?: string;
|
|
6
|
+
baseURL?: string;
|
|
7
|
+
headers?: Record<string, string>;
|
|
8
|
+
authPaths?: string[];
|
|
9
|
+
}
|
|
10
|
+
export declare function createCommandCode(options?: CommandCodeProviderOptions): {
|
|
11
|
+
languageModel(modelId: string): CommandCodeLanguageModel;
|
|
12
|
+
};
|
package/dist/plugin.d.ts
ADDED
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { type ModelEntry } from "./src/catalog.js";
|
|
2
|
+
import { type EnvDeps } from "./src/env.js";
|
|
3
|
+
export type { ModelEntry };
|
|
4
|
+
export type CatalogLoad = {
|
|
5
|
+
models: ModelEntry[];
|
|
6
|
+
catalogSource: "bundled" | "cache" | "opt-in-local";
|
|
7
|
+
commandCodeVersion: string | null;
|
|
8
|
+
degraded: boolean;
|
|
9
|
+
degradedReason: string | null;
|
|
10
|
+
};
|
|
11
|
+
export declare function loadCatalogEntries(deps?: EnvDeps): CatalogLoad;
|
|
12
|
+
/** V1 entrypoint (OpenCode 1.18.29+ also accepts it via `server`). */
|
|
13
|
+
export declare function server(): Promise<{
|
|
14
|
+
config: (config: Record<string, unknown>) => Promise<void>;
|
|
15
|
+
auth: {
|
|
16
|
+
provider: string;
|
|
17
|
+
methods: {
|
|
18
|
+
type: string;
|
|
19
|
+
label: string;
|
|
20
|
+
authorize: (inputs: Record<string, unknown> | undefined) => Promise<{
|
|
21
|
+
type: "failed";
|
|
22
|
+
key?: undefined;
|
|
23
|
+
} | {
|
|
24
|
+
type: "success";
|
|
25
|
+
key: string;
|
|
26
|
+
}>;
|
|
27
|
+
}[];
|
|
28
|
+
loader: (getAuth: () => Promise<{
|
|
29
|
+
type: string;
|
|
30
|
+
key?: string;
|
|
31
|
+
} | null>) => Promise<{
|
|
32
|
+
apiKey?: undefined;
|
|
33
|
+
} | {
|
|
34
|
+
apiKey: string;
|
|
35
|
+
}>;
|
|
36
|
+
};
|
|
37
|
+
}>;
|
|
38
|
+
/** V2 setup: provider inventory + models through transforms. Auth stays V1-only for now. */
|
|
39
|
+
declare function setup(ctx: any): Promise<void>;
|
|
40
|
+
declare const _default: {
|
|
41
|
+
server: typeof server;
|
|
42
|
+
id: string;
|
|
43
|
+
setup: typeof setup;
|
|
44
|
+
};
|
|
45
|
+
export default _default;
|