@myvillage/cli 1.79.0 → 1.80.0

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@myvillage/cli",
3
- "version": "1.79.0",
3
+ "version": "1.80.0",
4
4
  "description": "MyVillageOS CLI for community developers",
5
5
  "type": "module",
6
6
  "bin": {
@@ -29,6 +29,7 @@ import {
29
29
  shareKnowledgeAsAgent,
30
30
  retryAgentTask,
31
31
  retryFailedAgentTasks,
32
+ listHostedModels,
32
33
  } from '../utils/api.js';
33
34
  import {
34
35
  getAgentDir,
@@ -139,11 +140,22 @@ export async function agentCreateLocalCommand() {
139
140
  type: 'list',
140
141
  name: 'model',
141
142
  message: 'Model:',
142
- choices: (prev) => {
143
+ choices: async (prev) => {
143
144
  if (prev.provider === 'myvillage') {
144
- return [
145
- { name: 'Vee 1.3 (recommended)', value: 'vee-1.3' },
146
- ];
145
+ // Pull the live catalog of hosted models from the gateway; fall back to
146
+ // the default slug if the network/catalog is unavailable.
147
+ try {
148
+ const models = await listHostedModels();
149
+ if (Array.isArray(models) && models.length > 0) {
150
+ return models.map((m) => ({
151
+ name: m.description ? `${m.name} — ${m.description}` : m.name || m.slug,
152
+ value: m.slug,
153
+ }));
154
+ }
155
+ } catch {
156
+ /* offline or gateway unavailable — fall through to default */
157
+ }
158
+ return [{ name: 'Vee 1.3 (recommended)', value: 'vee-1.3' }];
147
159
  }
148
160
  if (prev.provider === 'openai') {
149
161
  return [
package/src/utils/api.js CHANGED
@@ -131,6 +131,15 @@ export async function getGameStatus(gameId) {
131
131
  return response.data;
132
132
  }
133
133
 
134
+ // ── AI Gateway (MyVillage-hosted models) ────────────────
135
+
136
+ /** List the MyVillage-hosted models available through the AI Gateway. */
137
+ export async function listHostedModels() {
138
+ const client = getApiClient();
139
+ const response = await client.get('/ai/models');
140
+ return response.data?.models || [];
141
+ }
142
+
134
143
  // ── Network API Client (/api/network) ───────────────────
135
144
 
136
145
  export function getNetworkClient() {