@myvillage/cli 2.9.0 → 2.10.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": "2.9.0",
3
+ "version": "2.10.0",
4
4
  "description": "MyVillageOS CLI for community developers",
5
5
  "type": "module",
6
6
  "bin": {
@@ -59,3 +59,25 @@ export const BUILTIN_TOOL_DEFS = [
59
59
  builtin: true,
60
60
  },
61
61
  ];
62
+
63
+ /** One line telling an agent what a local model is for and what it takes. */
64
+ export function describeLocalModel(m) {
65
+ const f = m.featurization ?? {};
66
+ const modality = f.modality ?? m.modality;
67
+ let takes;
68
+ if (modality === 'image') takes = 'a local image file path (.jpg/.png)';
69
+ else if (modality === 'audio') takes = 'a local .wav file path';
70
+ else if (modality === 'text') takes = 'some writing';
71
+ else if (Array.isArray(f.columns)) {
72
+ takes = 'a table row with ' + f.columns.map((c) => `${JSON.stringify(c.name)} (${c.type})`).join(', ');
73
+ } else if (Array.isArray(m.featureNames) && m.featureNames.length) {
74
+ takes = 'a table row of numbers: ' + m.featureNames.map((n) => JSON.stringify(n)).join(', ');
75
+ } else {
76
+ takes = `a list of ${m.inputDim ?? 'some'} numbers`;
77
+ }
78
+ const gives =
79
+ m.taskType === 'classification' && Array.isArray(m.labels) && m.labels.length
80
+ ? `sorts it into: ${m.labels.join(', ')}`
81
+ : 'gives back a number';
82
+ return `- "${m.slug}" (${m.name}): takes ${takes}; ${gives}.`;
83
+ }
@@ -13,6 +13,7 @@
13
13
 
14
14
  import { listDatasets } from '../utils/dataset-workspace.js';
15
15
  import { listModels } from '../utils/model-workspace.js';
16
+ import { describeLocalModel } from './builtin-tools-registry.js';
16
17
 
17
18
  export async function gatherContext(agentConfig, lastCheckIn, recentActions = []) {
18
19
  const parts = [];
@@ -52,11 +53,8 @@ export async function gatherContext(agentConfig, lastCheckIn, recentActions = []
52
53
  try {
53
54
  const models = listModels();
54
55
  if (models.length > 0) {
55
- parts.push('\nLocal models you can run with model_predict (use the slug as modelId):');
56
- for (const m of models.slice(0, 25)) {
57
- const labels = m.labels?.length ? ` → ${m.labels.join('/')}` : '';
58
- parts.push(`- ${m.slug} — ${m.modality}/${m.taskType}${labels}`);
59
- }
56
+ parts.push('\nLocal models you can run with model_predict (the quoted slug is the modelId). Use one whenever its job matches what you are doing:');
57
+ for (const m of models.slice(0, 25)) parts.push(describeLocalModel(m));
60
58
  }
61
59
  } catch {
62
60
  /* no local models / store unavailable — skip */