@mcowger/opencode-plexus 1.1.1 → 1.1.2

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 +11 -1
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -103,13 +103,23 @@ function fallbackDir() {
103
103
  function getDir() {
104
104
  return fallbackDir();
105
105
  }
106
+ function filterCachedModels(models) {
107
+ return Object.fromEntries(Object.entries(models).filter(([, model]) => isChatModel({
108
+ id: model.id,
109
+ name: model.name,
110
+ architecture: {
111
+ input_modalities: model.modalities.input,
112
+ output_modalities: model.modalities.output
113
+ }
114
+ })));
115
+ }
106
116
  async function readCachedModels(_client) {
107
117
  try {
108
118
  const dir = getDir();
109
119
  const content = await readFile(join(dir, CACHE_FILE), "utf8");
110
120
  const parsed = JSON.parse(content);
111
121
  if (parsed && typeof parsed.models === "object" && !Array.isArray(parsed.models)) {
112
- return parsed.models;
122
+ return filterCachedModels(parsed.models);
113
123
  }
114
124
  return null;
115
125
  } catch {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mcowger/opencode-plexus",
3
- "version": "1.1.1",
3
+ "version": "1.1.2",
4
4
  "description": "OpenCode plugin: Plexus provider with dynamic model discovery",
5
5
  "type": "module",
6
6
  "module": "./dist/index.js",