@unikode/cli 1.0.18 → 1.0.19

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.
Files changed (2) hide show
  1. package/dist/index.js +22 -50
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -925,7 +925,7 @@ function ThemedRoot({ children }) {
925
925
  import { createContext as createContext5, useContext as useContext5, useState as useState5, useCallback as useCallback5 } from "react";
926
926
 
927
927
  // ../shared/src/models.ts
928
- var SUPPORTED_CHAT_MODELS = [
928
+ var STATIC_CHAT_MODELS = [
929
929
  {
930
930
  id: "claude-sonnet-4-6",
931
931
  provider: "anthropic",
@@ -1006,53 +1006,9 @@ var SUPPORTED_CHAT_MODELS = [
1006
1006
  outputUsdPerMillionTokens: 2
1007
1007
  },
1008
1008
  tools: true
1009
- },
1010
- {
1011
- id: "gpt-oss:20b",
1012
- provider: "local-ollama",
1013
- pricing: {
1014
- inputUsdPerMillionTokens: 30,
1015
- outputUsdPerMillionTokens: 30
1016
- },
1017
- tools: true
1018
- },
1019
- {
1020
- id: "llama3.1:8b-instruct-fp16",
1021
- provider: "local-ollama",
1022
- pricing: {
1023
- inputUsdPerMillionTokens: 3,
1024
- outputUsdPerMillionTokens: 3
1025
- },
1026
- tools: true
1027
- },
1028
- {
1029
- id: "gpt-oss:20b-cloud",
1030
- provider: "local-ollama",
1031
- pricing: {
1032
- inputUsdPerMillionTokens: 30,
1033
- outputUsdPerMillionTokens: 30
1034
- },
1035
- tools: true
1036
- },
1037
- {
1038
- id: "qwen3:4b",
1039
- provider: "local-ollama",
1040
- pricing: {
1041
- inputUsdPerMillionTokens: 30,
1042
- outputUsdPerMillionTokens: 30
1043
- },
1044
- tools: true
1045
- },
1046
- {
1047
- id: "gpt-oss:120b-cloud",
1048
- provider: "local-ollama",
1049
- pricing: {
1050
- inputUsdPerMillionTokens: 30,
1051
- outputUsdPerMillionTokens: 30
1052
- },
1053
- tools: true
1054
1009
  }
1055
1010
  ];
1011
+ var SUPPORTED_CHAT_MODELS = [...STATIC_CHAT_MODELS];
1056
1012
  function findSupportedChatModel(modelId) {
1057
1013
  return SUPPORTED_CHAT_MODELS.find((model) => model.id === modelId);
1058
1014
  }
@@ -1891,11 +1847,27 @@ var COMMANDS = [
1891
1847
  name: "models",
1892
1848
  description: "select an AI model for generaftion",
1893
1849
  value: "/models",
1894
- action: (ctx) => {
1850
+ action: async (ctx) => {
1851
+ let modelIds;
1852
+ try {
1853
+ const res = await apiClient.models.$get();
1854
+ if (res.ok) {
1855
+ const data = await res.json();
1856
+ if (Array.isArray(data)) {
1857
+ modelIds = data.map((m) => m.id);
1858
+ } else {
1859
+ modelIds = SUPPORTED_CHAT_MODELS.map((m) => m.id);
1860
+ }
1861
+ } else {
1862
+ modelIds = SUPPORTED_CHAT_MODELS.map((m) => m.id);
1863
+ }
1864
+ } catch {
1865
+ modelIds = SUPPORTED_CHAT_MODELS.map((m) => m.id);
1866
+ }
1895
1867
  ctx.dialog.open({
1896
- title: "Agent Selection",
1868
+ title: "Model Selection",
1897
1869
  children: /* @__PURE__ */ jsxDEV14(ModelsDialogContent, {
1898
- models: SUPPORTED_CHAT_MODELS.map((model) => model.id),
1870
+ models: modelIds,
1899
1871
  onSelectModel: ctx.setModel
1900
1872
  }, undefined, false, undefined, this)
1901
1873
  });
@@ -4323,7 +4295,7 @@ var sessionLocationSchema = z3.object({
4323
4295
  initialPrompt: z3.object({
4324
4296
  message: z3.string(),
4325
4297
  mode: z3.custom(),
4326
- model: z3.custom()
4298
+ model: z3.string()
4327
4299
  }).optional()
4328
4300
  });
4329
4301
  function ChatMessage({
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@unikode/cli",
3
- "version": "1.0.18",
3
+ "version": "1.0.19",
4
4
  "type": "module",
5
5
  "main": "./dist/index.js",
6
6
  "bin": {