@evident-ai/cli 3.1.1-dev.3b9fb81 → 3.1.1-dev.4159d3a

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/index.js CHANGED
@@ -734,7 +734,7 @@ function buildOpenCodeVersionWarning(version2) {
734
734
  if (isQueueValidatedVersion(version2)) return null;
735
735
  const detected = version2 ? `v${version2}` : "unknown";
736
736
  const validated = QUEUE_VALIDATED_OPENCODE_VERSIONS.map((v) => `v${v}`).join(", ");
737
- return `Warning: opencode ${detected} is not a queue-validated version (validated: ${validated}). Native message queuing \u2014 which channel (Slack/WhatsApp) message handling relies on \u2014 is unverified on this version; queued/follow-up messages may behave unexpectedly. Continuing anyway. Bumping the validated set requires re-running the queue validation.`;
737
+ return `Warning: opencode ${detected} is not a queue-validated version (validated: ${validated}). Native message queuing \u2014 which channel (Slack) message handling relies on \u2014 is unverified on this version; queued/follow-up messages may behave unexpectedly. Continuing anyway. Bumping the validated set requires re-running the queue validation.`;
738
738
  }
739
739
 
740
740
  // src/lib/opencode/process.ts
@@ -1026,6 +1026,12 @@ async function promptOpenCodeInstall(interactive) {
1026
1026
  return action;
1027
1027
  }
1028
1028
 
1029
+ // src/lib/opencode/provider-check.ts
1030
+ function buildNoProviderWarning(hasProvider) {
1031
+ if (hasProvider !== false) return null;
1032
+ return "Warning: opencode has no authenticated model provider configured, so it won't be able to answer prompts. Run `opencode auth login` to set one up (see https://opencode.ai for details).";
1033
+ }
1034
+
1029
1035
  // src/lib/opencode/session.ts
1030
1036
  function opencodeBase(port) {
1031
1037
  return `http://127.0.0.1:${port}`;
@@ -1228,6 +1234,11 @@ async function getModelAttachmentCapability(port, model) {
1228
1234
  }
1229
1235
  const entry = provider.models[modelId];
1230
1236
  if (!entry || typeof entry !== "object") return null;
1237
+ if (entry.capabilities && typeof entry.capabilities === "object") {
1238
+ if (typeof entry.capabilities.attachment === "boolean") {
1239
+ return entry.capabilities.attachment;
1240
+ }
1241
+ }
1231
1242
  return typeof entry.attachment === "boolean" ? entry.attachment : null;
1232
1243
  } catch (err) {
1233
1244
  console.error(
@@ -1484,6 +1495,37 @@ function hasRunningAssistantExcept(messages, exceptUserMessageId) {
1484
1495
  (m) => roleOf(m) === "assistant" && parentIdOf(m) !== exceptUserMessageId && isAssistantInFlight(m)
1485
1496
  );
1486
1497
  }
1498
+ async function hasAnyConfiguredProvider(port) {
1499
+ try {
1500
+ const res = await fetch(`${opencodeBase(port)}/config/providers`);
1501
+ if (!res.ok) {
1502
+ console.error(
1503
+ `[hasAnyConfiguredProvider] GET /config/providers returned HTTP ${res.status} (port ${port})`
1504
+ );
1505
+ return null;
1506
+ }
1507
+ const body = await res.json();
1508
+ if (!body || typeof body !== "object" || Array.isArray(body)) {
1509
+ console.error(
1510
+ `[hasAnyConfiguredProvider] GET /config/providers body was not a plain object (port ${port})`
1511
+ );
1512
+ return null;
1513
+ }
1514
+ const defaults2 = body.default;
1515
+ if (!defaults2 || typeof defaults2 !== "object" || Array.isArray(defaults2)) {
1516
+ console.error(
1517
+ `[hasAnyConfiguredProvider] GET /config/providers body had no \`default\` object (port ${port})`
1518
+ );
1519
+ return null;
1520
+ }
1521
+ return Object.keys(defaults2).length > 0;
1522
+ } catch (err) {
1523
+ console.error(
1524
+ `[hasAnyConfiguredProvider] GET /config/providers failed (port ${port}): ${err instanceof Error ? err.message : String(err)}`
1525
+ );
1526
+ return null;
1527
+ }
1528
+ }
1487
1529
 
1488
1530
  // src/lib/opencode/session-cleanup.ts
1489
1531
  var DURATION_UNIT_MS = {
@@ -4872,6 +4914,21 @@ async function run(options) {
4872
4914
  logActivity(state, { type: "info", level: "warn", message: versionWarning });
4873
4915
  }
4874
4916
  }
4917
+ const noProviderWarning = buildNoProviderWarning(await hasAnyConfiguredProvider(state.port));
4918
+ if (noProviderWarning) {
4919
+ log2(state, noProviderWarning, "warn");
4920
+ if (state.interactive && !state.json) {
4921
+ logActivity(state, { type: "info", level: "warn", message: noProviderWarning });
4922
+ blank();
4923
+ console.log(chalk6.yellow("\u26A0 No OpenCode model provider is configured."));
4924
+ console.log(
4925
+ chalk6.dim(
4926
+ `Run ${chalk6.cyan("opencode auth login")} to set one up \u2014 messages will fail until then.`
4927
+ )
4928
+ );
4929
+ blank();
4930
+ }
4931
+ }
4875
4932
  } catch (error2) {
4876
4933
  ocSpinner?.fail(error2.message);
4877
4934
  throw error2;