@evident-ai/cli 3.6.1-dev.ebfd455 → 3.6.1-dev.f1e65e7
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/README.md +4 -0
- package/dist/index.js +26 -41
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -125,6 +125,10 @@ Options:
|
|
|
125
125
|
- `--opencode-config-overlay <path>` — Apply a runner-provided OpenCode config
|
|
126
126
|
before starting OpenCode. Relative paths are resolved from the working directory;
|
|
127
127
|
an existing `opencode.jsonc` is replaced before `opencode.json`.
|
|
128
|
+
- `--auto-configure-credentials-proxy` — Install Evident's generated `evident-*`
|
|
129
|
+
OpenCode provider entries for the runner's credential pool. This is off by default;
|
|
130
|
+
without it, the CLI only delivers `EVIDENT_PROXY_TOKEN` and leaves provider
|
|
131
|
+
configuration to you.
|
|
128
132
|
- `--credential-sync-marker <path>` — Own the interval credential sync and write
|
|
129
133
|
this marker once the shutdown flush has finished, so the runner image's lifecycle
|
|
130
134
|
hooks can wait on it.
|
package/dist/index.js
CHANGED
|
@@ -1442,7 +1442,7 @@ import ora4 from "ora";
|
|
|
1442
1442
|
import { select as select4 } from "@inquirer/prompts";
|
|
1443
1443
|
|
|
1444
1444
|
// src/lib/telemetry.ts
|
|
1445
|
-
var CLI_VERSION = (true ? "3.6.1-dev.
|
|
1445
|
+
var CLI_VERSION = (true ? "3.6.1-dev.f1e65e7" : void 0) ?? process.env.npm_package_version ?? "unknown";
|
|
1446
1446
|
function getCliVersion() {
|
|
1447
1447
|
return CLI_VERSION;
|
|
1448
1448
|
}
|
|
@@ -13920,22 +13920,6 @@ function mergeManagedOpenCodeConfigContent(content, managedProviders) {
|
|
|
13920
13920
|
}
|
|
13921
13921
|
return JSON.stringify({ ...config, provider: { ...provider, ...managedProviders } });
|
|
13922
13922
|
}
|
|
13923
|
-
function removeManagedOpenCodeConfigContent(content) {
|
|
13924
|
-
if (!content?.trim()) return content;
|
|
13925
|
-
const config = parseConfigContent(content);
|
|
13926
|
-
if (typeof config.provider !== "object" || config.provider === null || Array.isArray(config.provider)) {
|
|
13927
|
-
return content;
|
|
13928
|
-
}
|
|
13929
|
-
const provider = { ...config.provider };
|
|
13930
|
-
let changed = false;
|
|
13931
|
-
for (const namespace of CREDENTIAL_PROXY_NATIVE_NAMESPACES) {
|
|
13932
|
-
if (namespace in provider) {
|
|
13933
|
-
delete provider[namespace];
|
|
13934
|
-
changed = true;
|
|
13935
|
-
}
|
|
13936
|
-
}
|
|
13937
|
-
return changed ? JSON.stringify({ ...config, provider }) : content;
|
|
13938
|
-
}
|
|
13939
13923
|
function isFile(filePath) {
|
|
13940
13924
|
return existsSync2(filePath) && statSync6(filePath).isFile();
|
|
13941
13925
|
}
|
|
@@ -14406,16 +14390,6 @@ function clearLocalSetup(options) {
|
|
|
14406
14390
|
const env = options.env ?? process.env;
|
|
14407
14391
|
(options.store ?? defaultStore).clear(options.agentId);
|
|
14408
14392
|
delete env.EVIDENT_PROXY_TOKEN;
|
|
14409
|
-
try {
|
|
14410
|
-
const content = removeManagedOpenCodeConfigContent(env.OPENCODE_CONFIG_CONTENT);
|
|
14411
|
-
if (content === void 0) delete env.OPENCODE_CONFIG_CONTENT;
|
|
14412
|
-
else env.OPENCODE_CONFIG_CONTENT = content;
|
|
14413
|
-
} catch (error2) {
|
|
14414
|
-
options.log(
|
|
14415
|
-
"MANAGED-INFERENCE-CLEANUP-PARTIAL: stored credentials were removed, but malformed OPENCODE_CONFIG_CONTENT could not be inspected",
|
|
14416
|
-
"warn"
|
|
14417
|
-
);
|
|
14418
|
-
}
|
|
14419
14393
|
}
|
|
14420
14394
|
async function discoverManagedInferenceSetup(options) {
|
|
14421
14395
|
const headers = requestHeaders(options);
|
|
@@ -14453,31 +14427,37 @@ async function post(options, operation, body) {
|
|
|
14453
14427
|
}
|
|
14454
14428
|
}
|
|
14455
14429
|
function applyCredential(options, credential) {
|
|
14456
|
-
const { config, unsupportedProviders } = buildCredentialProxyNativeConfig({
|
|
14457
|
-
inferenceBaseUrl: credential.inferenceBaseUrl,
|
|
14458
|
-
modelDescriptors: credential.modelDescriptors
|
|
14459
|
-
});
|
|
14460
|
-
if (unsupportedProviders.length > 0 || Object.keys(config.provider).length === 0) {
|
|
14461
|
-
return "Managed setup contains unsupported provider descriptors";
|
|
14462
|
-
}
|
|
14463
14430
|
const env = options.env ?? process.env;
|
|
14464
14431
|
let merged;
|
|
14465
|
-
|
|
14466
|
-
|
|
14467
|
-
|
|
14468
|
-
|
|
14432
|
+
if (options.autoConfigureCredentialsProxy) {
|
|
14433
|
+
const { config, unsupportedProviders } = buildCredentialProxyNativeConfig({
|
|
14434
|
+
inferenceBaseUrl: credential.inferenceBaseUrl,
|
|
14435
|
+
modelDescriptors: credential.modelDescriptors
|
|
14436
|
+
});
|
|
14437
|
+
if (unsupportedProviders.length > 0 || Object.keys(config.provider).length === 0) {
|
|
14438
|
+
return "Managed setup contains unsupported provider descriptors";
|
|
14439
|
+
}
|
|
14440
|
+
try {
|
|
14441
|
+
merged = mergeManagedOpenCodeConfigContent(env.OPENCODE_CONFIG_CONTENT, config.provider);
|
|
14442
|
+
} catch (error2) {
|
|
14443
|
+
return "OPENCODE_CONFIG_CONTENT is malformed; managed providers were not installed";
|
|
14444
|
+
}
|
|
14469
14445
|
}
|
|
14470
14446
|
try {
|
|
14471
14447
|
(options.store ?? defaultStore).set(options.agentId, credential);
|
|
14472
14448
|
} catch (error2) {
|
|
14449
|
+
const detail = (error2 instanceof Error ? error2.message : String(error2)).replaceAll(
|
|
14450
|
+
credential.token,
|
|
14451
|
+
"[redacted]"
|
|
14452
|
+
);
|
|
14473
14453
|
options.log(
|
|
14474
|
-
`MANAGED-INFERENCE-STORE-FAILED: runner=${options.agentId} generation=${credential.generation}`,
|
|
14454
|
+
`MANAGED-INFERENCE-STORE-FAILED: runner=${options.agentId} generation=${credential.generation} detail=${redactDiagnosticText(detail)}`,
|
|
14475
14455
|
"warn"
|
|
14476
14456
|
);
|
|
14477
14457
|
return "Managed credentials could not be written to the protected store";
|
|
14478
14458
|
}
|
|
14479
14459
|
env.EVIDENT_PROXY_TOKEN = credential.token;
|
|
14480
|
-
env.OPENCODE_CONFIG_CONTENT = merged;
|
|
14460
|
+
if (merged !== void 0) env.OPENCODE_CONFIG_CONTENT = merged;
|
|
14481
14461
|
return null;
|
|
14482
14462
|
}
|
|
14483
14463
|
async function reportManagedInferenceApplyFailure(options, failure) {
|
|
@@ -14566,7 +14546,7 @@ async function acknowledgeManagedInferenceSetup(options, preparation) {
|
|
|
14566
14546
|
const response = await post(options, "acknowledge", {
|
|
14567
14547
|
generation: preparation.generation,
|
|
14568
14548
|
token_id: preparation.tokenId,
|
|
14569
|
-
config_validated: true
|
|
14549
|
+
config_validated: options.autoConfigureCredentialsProxy === true
|
|
14570
14550
|
});
|
|
14571
14551
|
if (!response?.ok) {
|
|
14572
14552
|
throw new Error(
|
|
@@ -16369,6 +16349,7 @@ async function run(options) {
|
|
|
16369
16349
|
agentId: state.agentId,
|
|
16370
16350
|
apiUrl: getApiUrlConfig(),
|
|
16371
16351
|
getAuthHeader: () => state.authHeader,
|
|
16352
|
+
autoConfigureCredentialsProxy: options.autoConfigureCredentialsProxy,
|
|
16372
16353
|
log: (message, level = "info") => logActivity(state, {
|
|
16373
16354
|
type: level === "error" ? "error" : "info",
|
|
16374
16355
|
level,
|
|
@@ -16996,6 +16977,9 @@ program.command("run").description("Connect to Evident and process messages").op
|
|
|
16996
16977
|
).option(
|
|
16997
16978
|
"--opencode-config-overlay <path>",
|
|
16998
16979
|
"Apply this runner-provided OpenCode config before starting OpenCode."
|
|
16980
|
+
).option(
|
|
16981
|
+
"--auto-configure-credentials-proxy",
|
|
16982
|
+
"Install Evident's generated OpenCode providers for the runner's credential pool (off by default)."
|
|
16999
16983
|
).option(
|
|
17000
16984
|
"--credential-sync-marker <path>",
|
|
17001
16985
|
"Own the interval credential sync and write this marker once the shutdown flush has finished, so the runner image's lifecycle hooks can wait on it."
|
|
@@ -17039,6 +17023,7 @@ program.command("run").description("Connect to Evident and process messages").op
|
|
|
17039
17023
|
restoreSessionDb: options.restoreSessionDb,
|
|
17040
17024
|
restoreRunnerCredentials: options.restoreRunnerCredentials,
|
|
17041
17025
|
opencodeConfigOverlay: options.opencodeConfigOverlay,
|
|
17026
|
+
autoConfigureCredentialsProxy: options.autoConfigureCredentialsProxy,
|
|
17042
17027
|
credentialSyncMarker: options.credentialSyncMarker
|
|
17043
17028
|
});
|
|
17044
17029
|
}
|