@primitivedotdev/cli 0.35.1 → 0.37.0
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.
|
@@ -1090,6 +1090,24 @@ function acquireCliCredentialsLock(configDir, options = {}) {
|
|
|
1090
1090
|
});
|
|
1091
1091
|
};
|
|
1092
1092
|
}
|
|
1093
|
+
/**
|
|
1094
|
+
* Detect the PRIMITIVE_KEY vs PRIMITIVE_API_KEY rename trap.
|
|
1095
|
+
*
|
|
1096
|
+
* AGX feedback: users on older docs (or coming from other tools) set
|
|
1097
|
+
* `PRIMITIVE_KEY` and then cannot figure out why the CLI reports no
|
|
1098
|
+
* API key. The CLI reads `PRIMITIVE_API_KEY` only. Returns a stderr
|
|
1099
|
+
* hint when `PRIMITIVE_KEY` is set but `PRIMITIVE_API_KEY` is not,
|
|
1100
|
+
* otherwise null. Exported as a helper so both `doctor` and the
|
|
1101
|
+
* general auth-resolution path surface the same guidance from the
|
|
1102
|
+
* first command the user runs, instead of forcing them to discover
|
|
1103
|
+
* the rename via `doctor` after the fact.
|
|
1104
|
+
*/
|
|
1105
|
+
function detectPrimitiveKeyEnvMisname(env = process.env) {
|
|
1106
|
+
const primitiveKey = env.PRIMITIVE_KEY;
|
|
1107
|
+
const primitiveApiKey = env.PRIMITIVE_API_KEY;
|
|
1108
|
+
if ((primitiveKey?.length ?? 0) > 0 && (primitiveApiKey?.length ?? 0) === 0) return "PRIMITIVE_KEY is set but the CLI reads PRIMITIVE_API_KEY. Rename your env var, or re-run with PRIMITIVE_API_KEY=$PRIMITIVE_KEY.";
|
|
1109
|
+
return null;
|
|
1110
|
+
}
|
|
1093
1111
|
function resolveCliAuth(params) {
|
|
1094
1112
|
const apiKey = params.apiKey?.trim();
|
|
1095
1113
|
const apiBaseUrl = normalizeApiBaseUrl(params.apiBaseUrl);
|
|
@@ -1293,4 +1311,4 @@ function redactCliEnvironment(environment) {
|
|
|
1293
1311
|
};
|
|
1294
1312
|
}
|
|
1295
1313
|
//#endregion
|
|
1296
|
-
export {
|
|
1314
|
+
export { createClient as A, saveCliCredentials as C, loadChatConversationByLocalId as D, loadActiveChatState as E, saveActiveChatState as O, resolveCliAuth as S, deleteChatState as T, deleteCliCredentials as _, normalizeCliEnvironmentName as a, loadCliCredentials as b, resolveConfigEnvironment as c, validateCliHeaderName as d, validateCliHeaderValue as f, credentialsPath as g, credentialsLockPath as h, loadCliConfig as i, createConfig as j, PrimitiveApiClient as k, saveCliConfig as l, cliAccessTokenExpiresAt as m, deleteCliConfig as n, redactCliEnvironment as o, acquireCliCredentialsLock as p, emptyCliConfig as r, removeCliEnvironment as s, DEFAULT_ENVIRONMENT as t, upsertCliEnvironment as u, deleteCliCredentialsLock as v, chatStatePath as w, normalizeApiBaseUrl as x, detectPrimitiveKeyEnvMisname as y };
|