opencode-actualyze 2.0.0 → 2.0.1

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/dist/rpc.d.ts CHANGED
@@ -64,8 +64,8 @@ interface CatalogModelRecord {
64
64
  context: ScalarEvidence<number>;
65
65
  /**
66
66
  * `unknown` when no output limit was observed; the emitted
67
- * `limit.output` is then 0, which the host treats as "fit to the
68
- * remaining context".
67
+ * `limit.output` is then 0, which the host treats as unknown: it asks for
68
+ * up to 32 000 output tokens, fewer when the prompt leaves less room.
69
69
  */
70
70
  output: ScalarEvidence<number>;
71
71
  family: ScalarEvidence<string>;
package/dist/server.js CHANGED
@@ -1,5 +1,5 @@
1
1
  // package.json
2
- var version = "2.0.0";
2
+ var version = "2.0.1";
3
3
 
4
4
  // src/constants.ts
5
5
  var PLUGIN_ID = "opencode-actualyze";
@@ -10,9 +10,6 @@ var ACTUALYZE_NAME = "Actualyze";
10
10
  var ACTUALYZE_BASE_URL = "https://app.actualyze.ai/openai/v1";
11
11
  var ACTUALYZE_PACKAGE = "@opencode/ai/providers/openai-compatible";
12
12
  var ACTUALYZE_ENV = "ACTUALYZE_API_KEY";
13
- var PROBE_ID_ALIASES = {
14
- atlas: ACTUALYZE_PROBE_ID
15
- };
16
13
  var NEVER_PROBED_PROVIDER_IDS = /* @__PURE__ */ new Set([
17
14
  "ollama",
18
15
  "lmstudio",
@@ -872,7 +869,7 @@ var probeKoboldcpp = async (baseURL, apiKey, context) => {
872
869
  };
873
870
 
874
871
  // src/probes/actualyze.ts
875
- var ACTUALYZE_OWNERS = /* @__PURE__ */ new Set(["actualyze", "atlas"]);
872
+ var ACTUALYZE_OWNER = "actualyze";
876
873
  var ACTUALYZE_DETAIL_CONCURRENCY = 8;
877
874
  var INPUT_MODALITIES2 = [
878
875
  "text",
@@ -882,7 +879,7 @@ var INPUT_MODALITIES2 = [
882
879
  "video"
883
880
  ];
884
881
  function isActualyzeOwner(value) {
885
- return typeof value === "string" && ACTUALYZE_OWNERS.has(value);
882
+ return value === ACTUALYZE_OWNER;
886
883
  }
887
884
  function isRecord(value) {
888
885
  return typeof value === "object" && value !== null && !Array.isArray(value);
@@ -1170,10 +1167,8 @@ var PROBES = {
1170
1167
  function isProbeKey(value) {
1171
1168
  return Object.hasOwn(PROBES, value);
1172
1169
  }
1173
- function canonicalProbeKey(type) {
1174
- if (!type) return void 0;
1175
- const id = Object.hasOwn(PROBE_ID_ALIASES, type) ? PROBE_ID_ALIASES[type] : type;
1176
- return isProbeKey(id) ? id : void 0;
1170
+ function toProbeKey(type) {
1171
+ return type !== void 0 && isProbeKey(type) ? type : void 0;
1177
1172
  }
1178
1173
  async function resolveProbe(type, baseURL, apiKey, context, signal) {
1179
1174
  if (!type) return { probe: void 0 };
@@ -1193,7 +1188,7 @@ async function resolveProbe(type, baseURL, apiKey, context, signal) {
1193
1188
  detectedServer: detected
1194
1189
  };
1195
1190
  }
1196
- const key = canonicalProbeKey(type);
1191
+ const key = toProbeKey(type);
1197
1192
  return key ? { probe: PROBES[key], key } : { probe: void 0 };
1198
1193
  }
1199
1194
 
@@ -2073,7 +2068,7 @@ function eligibleTarget(provider, recorded) {
2073
2068
  keys: targetKeys({
2074
2069
  providerID: provider.id,
2075
2070
  baseURL: normalizeBaseURL(baseURL),
2076
- probe: probe === void 0 || probe === "auto" ? probe : canonicalProbeKey(probe) ?? probe,
2071
+ probe,
2077
2072
  apiKey,
2078
2073
  headers
2079
2074
  })
@@ -2266,7 +2261,7 @@ var KEY_HEADERS = /* @__PURE__ */ new Set([
2266
2261
  ]);
2267
2262
  function headersReplaceKey(target, resolvedProbe) {
2268
2263
  if (!target.headers) return false;
2269
- const actualyze = canonicalProbeKey(target.probe) === ACTUALYZE_PROBE_ID || resolvedProbe === ACTUALYZE_PROBE_ID;
2264
+ const actualyze = target.probe === ACTUALYZE_PROBE_ID || resolvedProbe === ACTUALYZE_PROBE_ID;
2270
2265
  const names = actualyze ? ACTUALYZE_KEY_HEADERS : KEY_HEADERS;
2271
2266
  return Object.keys(target.headers).some(
2272
2267
  (name) => names.has(name.toLowerCase())
@@ -2320,7 +2315,7 @@ function readInventory(value) {
2320
2315
  return void 0;
2321
2316
  if (typeof value.probeAttempt !== "string" || !PROBE_ATTEMPTS2.has(value.probeAttempt))
2322
2317
  return void 0;
2323
- const resolvedProbe = typeof value.resolvedProbe === "string" ? canonicalProbeKey(value.resolvedProbe) : void 0;
2318
+ const resolvedProbe = typeof value.resolvedProbe === "string" ? toProbeKey(value.resolvedProbe) : void 0;
2324
2319
  const endpointOrigin = sanitizeEndpointOrigin(value.endpointOrigin);
2325
2320
  const models = [];
2326
2321
  const seen = /* @__PURE__ */ new Set();
package/dist/tui.js CHANGED
@@ -1,6 +1,17 @@
1
1
  // src/constants.ts
2
2
  var PLUGIN_ID = "opencode-actualyze";
3
3
  var COMMAND_NAME = "modelscout";
4
+ var ACTUALYZE_PROBE_ID = "actualyze";
5
+ var PROBE_KEYS = [
6
+ ACTUALYZE_PROBE_ID,
7
+ "ollama",
8
+ "omlx",
9
+ "vllm",
10
+ "tgi",
11
+ "sglang",
12
+ "lmstudio",
13
+ "koboldcpp"
14
+ ];
4
15
  var ACTUALYZE_PROVIDER_ID = "actualyze";
5
16
  var ACTUALYZE_INTEGRATION_ID = ACTUALYZE_PROVIDER_ID;
6
17
  var ACTUALYZE_NAME = "Actualyze";
@@ -1500,6 +1511,19 @@ function failureLabel(failure) {
1500
1511
  return { text: "\u25B2 failed", role: "warn" };
1501
1512
  }
1502
1513
  }
1514
+ var KNOWN_PROBES = new Set(PROBE_KEYS);
1515
+ function isProbeKey(value) {
1516
+ return KNOWN_PROBES.has(value);
1517
+ }
1518
+ function unknownProbe(record2) {
1519
+ const configured = record2?.configuredProbe;
1520
+ if (configured?.state !== "known") return void 0;
1521
+ return configured.value === "auto" || isProbeKey(configured.value) ? void 0 : configured.value;
1522
+ }
1523
+ function unknownProbeWarning(probe) {
1524
+ return `Unknown probe ${JSON.stringify(probe)}; use auto or one of: ${PROBE_KEYS.join(", ")}`;
1525
+ }
1526
+ var UNKNOWN_PROBE_EFFECT = "No probe runs, so the models get no limits, prices, or capabilities from the server.";
1503
1527
  function providerStatus(record2) {
1504
1528
  if (!record2) return void 0;
1505
1529
  if (record2.discovering) return { text: "\u25CB checking", role: "info" };
@@ -1508,11 +1532,13 @@ function providerStatus(record2) {
1508
1532
  if (record2.resultEpoch !== record2.credentialEpoch)
1509
1533
  return { text: "\u25CB waiting", role: "info" };
1510
1534
  if (record2.failure) return failureLabel(record2.failure);
1535
+ if (unknownProbe(record2) !== void 0)
1536
+ return { text: "\u25B2 unknown probe", role: "warn" };
1511
1537
  if (record2.lastGoodAt) return { text: "\u25CF ready", role: "ok" };
1512
1538
  return { text: "\u25CB waiting", role: "info" };
1513
1539
  }
1514
1540
  function needsAttention(record2) {
1515
- return record2 !== void 0 && record2.failure !== null && record2.resultEpoch === record2.credentialEpoch;
1541
+ return record2 !== void 0 && record2.resultEpoch === record2.credentialEpoch && (record2.failure !== null || unknownProbe(record2) !== void 0);
1516
1542
  }
1517
1543
  function failureSentences(failure, origin, retryInSeconds) {
1518
1544
  const host = origin ?? "the endpoint";
@@ -1705,7 +1731,7 @@ function outputValue(model) {
1705
1731
  const certainty = modelCertainty(model).output;
1706
1732
  if (model.output === void 0 || certainty === "not-reported")
1707
1733
  return {
1708
- text: "Not reported; OpenCode fits output to the remaining context",
1734
+ text: "Not reported; OpenCode asks for up to 32,000, fewer if the prompt leaves less room",
1709
1735
  role: "faint"
1710
1736
  };
1711
1737
  if (certainty === "assumed")
@@ -1762,7 +1788,7 @@ function modelDetailLines(group, model, context) {
1762
1788
  lines.push(
1763
1789
  ...labeled(
1764
1790
  "Inferred",
1765
- `${inferred.join(", ")} (from models.dev or the name)`,
1791
+ `${inferred.join(", ")} (from a models.dev match)`,
1766
1792
  width,
1767
1793
  "muted"
1768
1794
  )
@@ -1839,24 +1865,24 @@ function modelSummaryLine(model, width) {
1839
1865
  }
1840
1866
  var PROBE_NAMES = {
1841
1867
  actualyze: "Actualyze",
1868
+ ollama: "Ollama",
1869
+ omlx: "oMLX",
1842
1870
  vllm: "vLLM",
1871
+ tgi: "TGI",
1843
1872
  sglang: "SGLang",
1844
- omlx: "oMLX",
1845
- ollama: "Ollama",
1846
1873
  lmstudio: "LM Studio",
1847
- llamacpp: "llama.cpp",
1848
- litellm: "LiteLLM"
1874
+ koboldcpp: "KoboldCpp"
1849
1875
  };
1850
1876
  function probeName(id) {
1851
- return PROBE_NAMES[id] ?? id;
1877
+ return isProbeKey(id) ? PROBE_NAMES[id] : id;
1852
1878
  }
1853
- function serverType(group) {
1879
+ function serverType(group, probeUnknown) {
1880
+ const chosen = group.configuredProbe === "auto" ? void 0 : group.configuredProbe;
1854
1881
  if (group.resolvedProbe) {
1855
1882
  const name = probeName(group.resolvedProbe);
1856
- return group.configuredProbe ? name : `${name}, detected automatically`;
1883
+ return chosen ? name : `${name}, detected automatically`;
1857
1884
  }
1858
- if (group.configuredProbe)
1859
- return `${probeName(group.configuredProbe)} (not resolved yet)`;
1885
+ if (chosen && !probeUnknown) return `${probeName(chosen)} (not resolved yet)`;
1860
1886
  return "OpenAI-compatible, no probe";
1861
1887
  }
1862
1888
  function credentialWords(source) {
@@ -1941,6 +1967,14 @@ function providerDetailLines(group, record2, context) {
1941
1967
  seg(checked ? ` \xB7 checked ${checked}` : "", "muted")
1942
1968
  ]);
1943
1969
  }
1970
+ const probe = unknownProbe(record2);
1971
+ if (probe !== void 0) {
1972
+ lines.push([]);
1973
+ lines.push(
1974
+ ...paragraph(`\u25B2 ${unknownProbeWarning(probe)}`, width, "warn"),
1975
+ ...paragraph(UNKNOWN_PROBE_EFFECT, width, "base")
1976
+ );
1977
+ }
1944
1978
  lines.push([]);
1945
1979
  const chat = group.models.filter(
1946
1980
  (model) => model.type !== "embedding"
@@ -1949,7 +1983,9 @@ function providerDetailLines(group, record2, context) {
1949
1983
  const declared = group.models.filter(
1950
1984
  (model) => model.origin === "pre-existing"
1951
1985
  ).length;
1952
- lines.push(...labeled("Server type", serverType(group), width));
1986
+ lines.push(
1987
+ ...labeled("Server type", serverType(group, probe !== void 0), width)
1988
+ );
1953
1989
  lines.push(
1954
1990
  ...labeled(
1955
1991
  "Models",
@@ -5248,6 +5284,7 @@ function checkedAge(record2, now) {
5248
5284
  var DROP_AGE = 3;
5249
5285
  var DROP_KEY = 2;
5250
5286
  var DROP_DETAIL = 1;
5287
+ var DROP_WARNING = 0;
5251
5288
  function statusLine(glyph, glyphRole, headline, parts, width) {
5252
5289
  const head = [seg2(glyph, glyphRole), seg2(` ${headline}`)];
5253
5290
  const fitted = fitStatusParts(
@@ -5316,6 +5353,7 @@ function statusSegments(view, now, width) {
5316
5353
  "\u25CF",
5317
5354
  "ok",
5318
5355
  "Catalog accessible",
5356
+ unknownProbe(record2) === void 0 ? void 0 : { text: "\u25B2 unknown probe", role: "warn", drop: DROP_WARNING },
5319
5357
  keyPart,
5320
5358
  {
5321
5359
  text: `${count} ${count === 1 ? "model" : "models"}`,
@@ -5565,13 +5603,24 @@ function describe(session, view, width, now) {
5565
5603
  const record2 = view.state.record;
5566
5604
  const origin = view.endpoint?.origin;
5567
5605
  const described = { status, card, link: origin ? link : void 0 };
5568
- if (!RESULT_ROWS.has(view.state.row) || record2?.credentialSource !== "headers")
5569
- return described;
5570
- const notice = new CardWriter("info", width);
5571
- notice.text(HEADERS_NOTICE, "info");
5606
+ if (!RESULT_ROWS.has(view.state.row)) return described;
5607
+ const notices = [];
5608
+ const probe = unknownProbe(record2);
5609
+ if (probe !== void 0) {
5610
+ const notice = new CardWriter("warn", width);
5611
+ notice.text(unknownProbeWarning(probe), "warn");
5612
+ notice.text(UNKNOWN_PROBE_EFFECT, "muted");
5613
+ notices.push(...notice.lines);
5614
+ }
5615
+ if (record2?.credentialSource === "headers") {
5616
+ const notice = new CardWriter("info", width);
5617
+ notice.text(HEADERS_NOTICE, "info");
5618
+ notices.push(...notice.lines);
5619
+ }
5620
+ if (notices.length === 0) return described;
5572
5621
  return {
5573
5622
  ...described,
5574
- card: card ? { ...card, lines: [...card.lines, ...notice.lines] } : { placement: "above", lines: notice.lines }
5623
+ card: card ? { ...card, lines: [...card.lines, ...notices] } : { placement: "above", lines: notices }
5575
5624
  };
5576
5625
  }
5577
5626
  function describeRow(session, view, width, now) {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "$schema": "https://json.schemastore.org/package.json",
3
3
  "name": "opencode-actualyze",
4
- "version": "2.0.0",
4
+ "version": "2.0.1",
5
5
  "description": "Actualyze's OpenCode plugin: adds the Actualyze provider and auto-discovers models from OpenAI-compatible providers, enriched with context window sizes, capability flags, prices, and model metadata. Supports Actualyze, Ollama, oMLX, vLLM, TGI, SGLang, LM Studio, KoboldCpp, llama.cpp, and LocalAI.",
6
6
  "type": "module",
7
7
  "main": "./dist/server.js",