Skip to content

Commit 1c1b5f7

Browse files
committed
feat: added auto-completion for codex models and fix nest completion paths
1 parent 28de444 commit 1c1b5f7

4 files changed

Lines changed: 23 additions & 14 deletions

File tree

completions-cron/src/__generated__/completions-index.ts

Lines changed: 14 additions & 12 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "default",
3-
"version": "1.13.0-beta.3",
3+
"version": "1.13.0-beta.4",
44
"description": "Default plugin for Codify - provides 50+ declarative resources for managing development tools and system configuration across macOS and Linux",
55
"main": "dist/index.js",
66
"scripts": {

scripts/generate-completions-index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ const modules = completionFiles.map((relPath, i) => {
2828
)
2929
}
3030
const resourceType = filename.substring(0, dotIndex)
31-
const parameterPath = '/' + filename.substring(dotIndex + 1)
31+
const parameterPath = '/' + filename.substring(dotIndex + 1).replaceAll('.', '/')
3232

3333
// Path from completions-cron/src/__generated__/ back to plugin src/resources/
3434
const importPath = '../../../src/' + relPath.replace(/\.ts$/, '.js')
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
const MODELS_JSON_URL = 'https://raw.githubusercontent.com/openai/codex/main/codex-rs/models-manager/models.json';
2+
3+
export default async function loadCodexModels(): Promise<string[]> {
4+
const response = await fetch(MODELS_JSON_URL);
5+
const data = await response.json() as { models: { slug: string }[] };
6+
return data.models.map((m) => m.slug);
7+
}

0 commit comments

Comments
 (0)