@evident-ai/cli 3.0.1-dev.bf495ea → 3.0.1-dev.c138873
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 +11 -22
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
|
|
3
3
|
// src/index.ts
|
|
4
|
-
import { createRequire } from "module";
|
|
5
4
|
import { Command } from "commander";
|
|
6
5
|
|
|
7
6
|
// src/commands/login.ts
|
|
@@ -716,13 +715,13 @@ async function waitForOpenCodeHealth(port, timeoutMs = 3e4) {
|
|
|
716
715
|
|
|
717
716
|
// src/lib/opencode/opencode-version-gate.ts
|
|
718
717
|
var QUEUE_VALIDATED_OPENCODE_VERSIONS = ["1.17.11"];
|
|
719
|
-
function isQueueValidatedVersion(
|
|
720
|
-
if (!
|
|
721
|
-
return QUEUE_VALIDATED_OPENCODE_VERSIONS.includes(
|
|
718
|
+
function isQueueValidatedVersion(version) {
|
|
719
|
+
if (!version) return false;
|
|
720
|
+
return QUEUE_VALIDATED_OPENCODE_VERSIONS.includes(version);
|
|
722
721
|
}
|
|
723
|
-
function buildOpenCodeVersionWarning(
|
|
724
|
-
if (isQueueValidatedVersion(
|
|
725
|
-
const detected =
|
|
722
|
+
function buildOpenCodeVersionWarning(version) {
|
|
723
|
+
if (isQueueValidatedVersion(version)) return null;
|
|
724
|
+
const detected = version ? `v${version}` : "unknown";
|
|
726
725
|
const validated = QUEUE_VALIDATED_OPENCODE_VERSIONS.map((v) => `v${v}`).join(", ");
|
|
727
726
|
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.`;
|
|
728
727
|
}
|
|
@@ -2686,7 +2685,6 @@ async function handleAuthError(state, error2) {
|
|
|
2686
2685
|
}
|
|
2687
2686
|
async function driveChannels(state, driver) {
|
|
2688
2687
|
let idlePolls = 0;
|
|
2689
|
-
let lastSeenProxiedActivityAt = state.lastProxiedActivityAt;
|
|
2690
2688
|
while (state.running) {
|
|
2691
2689
|
if (state.connection?.reconnecting && state.connection.reconnectPromise) {
|
|
2692
2690
|
logActivity(state, { type: "info", message: "Waiting for tunnel reconnection..." });
|
|
@@ -2696,9 +2694,7 @@ async function driveChannels(state, driver) {
|
|
|
2696
2694
|
try {
|
|
2697
2695
|
const processed = await driver.drainPending();
|
|
2698
2696
|
state.messageCount += processed;
|
|
2699
|
-
|
|
2700
|
-
lastSeenProxiedActivityAt = state.lastProxiedActivityAt;
|
|
2701
|
-
if (processed > 0 || driver.hasInFlightWatchers() || proxiedActivity) {
|
|
2697
|
+
if (processed > 0 || driver.hasInFlightWatchers()) {
|
|
2702
2698
|
idlePolls = 0;
|
|
2703
2699
|
if (processed > 0 && state.interactive) displayStatus(state);
|
|
2704
2700
|
} else if (state.idleTimeout !== null) {
|
|
@@ -2773,7 +2769,6 @@ async function run(options) {
|
|
|
2773
2769
|
running: true,
|
|
2774
2770
|
activityLog: [],
|
|
2775
2771
|
messageCount: 0,
|
|
2776
|
-
lastProxiedActivityAt: null,
|
|
2777
2772
|
authHeader: ""
|
|
2778
2773
|
};
|
|
2779
2774
|
if (state.idleTimeout === null && (process.env.GITHUB_ACTIONS || process.env.CI)) {
|
|
@@ -2890,8 +2885,8 @@ async function run(options) {
|
|
|
2890
2885
|
state.opencodeProcess = oc.process;
|
|
2891
2886
|
state.opencodeVersion = oc.version;
|
|
2892
2887
|
state.opencodeConnected = oc.process !== null || oc.version !== null;
|
|
2893
|
-
const
|
|
2894
|
-
ocSpinner?.succeed(`OpenCode running on port ${state.port}${
|
|
2888
|
+
const version = state.opencodeVersion ? ` (v${state.opencodeVersion})` : "";
|
|
2889
|
+
ocSpinner?.succeed(`OpenCode running on port ${state.port}${version}`);
|
|
2895
2890
|
const versionWarning = buildOpenCodeVersionWarning(state.opencodeVersion);
|
|
2896
2891
|
if (versionWarning) {
|
|
2897
2892
|
log2(state, versionWarning, false);
|
|
@@ -2963,14 +2958,9 @@ async function run(options) {
|
|
|
2963
2958
|
logActivity(state, { type: "error", error: error2 });
|
|
2964
2959
|
if (state.interactive) displayStatus(state);
|
|
2965
2960
|
},
|
|
2966
|
-
// Web traffic is proxied transparently; note opencode is live
|
|
2967
|
-
// proxied activity so the idle loop treats interactive proxy use as work.
|
|
2968
|
-
// Fires per forwarded response head (incl. every SSE open) and excludes
|
|
2969
|
-
// the internal drain-ping, so an actively-used proxy keeps the timer
|
|
2970
|
-
// fresh while a lone idle SSE with no follow-up requests still ages out.
|
|
2961
|
+
// Web traffic is proxied transparently; only note opencode is live.
|
|
2971
2962
|
onResponse: () => {
|
|
2972
2963
|
state.opencodeConnected = true;
|
|
2973
|
-
state.lastProxiedActivityAt = Date.now();
|
|
2974
2964
|
},
|
|
2975
2965
|
// A channel message was queued and the api-worker pinged us over the
|
|
2976
2966
|
// tunnel to drain immediately instead of waiting for the next poll tick.
|
|
@@ -3043,9 +3033,8 @@ async function run(options) {
|
|
|
3043
3033
|
}
|
|
3044
3034
|
|
|
3045
3035
|
// src/index.ts
|
|
3046
|
-
var { version } = createRequire(import.meta.url)("../package.json");
|
|
3047
3036
|
var program = new Command();
|
|
3048
|
-
program.name("evident").description("Run OpenCode locally and connect it to Evident").version(
|
|
3037
|
+
program.name("evident").description("Run OpenCode locally and connect it to Evident").version("0.1.0").option(
|
|
3049
3038
|
"--endpoint <url>",
|
|
3050
3039
|
"Evident API base URL (default: production; e.g. http://localhost:3001)"
|
|
3051
3040
|
).option("--tunnel <url>", "Tunnel WebSocket URL (default: production; e.g. ws://localhost:8787)").hook("preAction", (thisCommand) => {
|