callkaro-cli-unofficial 0.7.0 → 0.7.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/commands/admin.js
CHANGED
|
@@ -174,7 +174,8 @@ async function adminImpersonateCommand(clientId, opts) {
|
|
|
174
174
|
(0, ui_1.info)(' minted a ck_ token through the admin console and stored it, scoped to that client account.');
|
|
175
175
|
(0, ui_1.info)(` Use it: cku accounts use ${clientEmail}`);
|
|
176
176
|
(0, ui_1.info)(` Or pin a folder: cku accounts bind ${clientEmail}`);
|
|
177
|
-
(0, ui_1.info)(' Also stored a dashboard session for it
|
|
177
|
+
(0, ui_1.info)(' Also stored a dashboard session for it: `cku dashboard api` reaches /v2/agents/, and model');
|
|
178
|
+
(0, ui_1.info)(' validation uses this account\'s own model list, also when another login monitors it.');
|
|
178
179
|
(0, ui_1.info)(' Both renew themselves by impersonating again.');
|
|
179
180
|
}
|
|
180
181
|
catch (err) {
|
package/dist/commands/models.js
CHANGED
|
@@ -43,7 +43,8 @@ async function readSlots() {
|
|
|
43
43
|
// Keep the validator in step with what is on screen, so a value copied from
|
|
44
44
|
// this output is not rejected a moment later.
|
|
45
45
|
(0, agentUpdate_1.applyLiveModels)(res?.catalogs);
|
|
46
|
-
|
|
46
|
+
// Lists are per account, so name whose they are.
|
|
47
|
+
return { llm, source: `the server, now${res?.email ? ` (${res.email})` : ''}` };
|
|
47
48
|
}
|
|
48
49
|
catch (err) {
|
|
49
50
|
if (!Object.keys(catalog_1.LLM_MODELS).length) {
|
|
@@ -137,8 +137,26 @@ function forgetDashboard(email) {
|
|
|
137
137
|
* session is renewed by logging in again. With a stored password that happens
|
|
138
138
|
* here, silently; without one this fails with the concrete next command.
|
|
139
139
|
*/
|
|
140
|
-
|
|
140
|
+
/**
|
|
141
|
+
* The account whose dashboard session is in effect.
|
|
142
|
+
*
|
|
143
|
+
* Normally the account in effect. But one monitoring a client (`cku monitor`,
|
|
144
|
+
* CK_ACCOUNT_ID) acts on that client over `/cli/*`, so its dashboard must be the
|
|
145
|
+
* client's too: the model catalogue is per account (Spinny's agent slot has 26
|
|
146
|
+
* models where another account has 44), and KPI or analyzer reads against the
|
|
147
|
+
* admin's own dashboard would show the wrong account. `cku admin impersonate`
|
|
148
|
+
* stores that client's session, so use it when one exists.
|
|
149
|
+
*/
|
|
150
|
+
function dashboardSlug() {
|
|
141
151
|
const slug = (0, config_1.activeAccount)();
|
|
152
|
+
const clientId = slug ? (0, config_1.monitoringAccountId)((0, config_1.loadAccount)(slug)) : process.env.CK_ACCOUNT_ID;
|
|
153
|
+
if (!clientId)
|
|
154
|
+
return slug;
|
|
155
|
+
const client = (0, config_1.listAccounts)().find((a) => a.impersonated?.clientId === clientId && a.dashboard?.token);
|
|
156
|
+
return client ? (0, config_1.slugFor)(client.email) : slug;
|
|
157
|
+
}
|
|
158
|
+
async function requireDashboard() {
|
|
159
|
+
const slug = dashboardSlug();
|
|
142
160
|
const email = slug ? (0, config_1.loadAccount)(slug).email : undefined;
|
|
143
161
|
let session = dashboardSession(email);
|
|
144
162
|
if (!session?.token) {
|