@exreve/exk 1.0.68 → 1.0.70
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/cli/agentSession.js +1 -1
- package/dist/cli/app-child.js +9 -2
- package/dist/cli/index.js +13 -4
- package/dist/ttc-cli.tar.gz +0 -0
- package/package.json +1 -1
package/dist/cli/agentSession.js
CHANGED
package/dist/cli/app-child.js
CHANGED
|
@@ -164,8 +164,6 @@ async function writeDeviceConfigMerged(partial) {
|
|
|
164
164
|
await fs.writeFile(DEVICE_CONFIG_FILE, JSON.stringify(out, null, 2));
|
|
165
165
|
}
|
|
166
166
|
async function maybeFetchAiConfigIfMissing() {
|
|
167
|
-
if (hasAiCredentials())
|
|
168
|
-
return;
|
|
169
167
|
const jwt = await readDeviceAuthToken();
|
|
170
168
|
if (!jwt)
|
|
171
169
|
return;
|
|
@@ -176,11 +174,20 @@ async function maybeFetchAiConfigIfMissing() {
|
|
|
176
174
|
}
|
|
177
175
|
}
|
|
178
176
|
function scheduleAiConfigSync(authToken) {
|
|
177
|
+
// Fetch immediately
|
|
179
178
|
void fetchAiConfig(authToken).then((ok) => {
|
|
180
179
|
if (!ok && !hasAiCredentials()) {
|
|
181
180
|
console.warn('[CLI] AI config sync failed; check backend /config/ai and apiUrl.');
|
|
182
181
|
}
|
|
183
182
|
});
|
|
183
|
+
// Refresh every 5 minutes to pick up model config changes
|
|
184
|
+
setInterval(() => {
|
|
185
|
+
void fetchAiConfig(authToken).then((ok) => {
|
|
186
|
+
if (!ok && !hasAiCredentials()) {
|
|
187
|
+
console.warn('[CLI] AI config sync failed; check backend /config/ai and apiUrl.');
|
|
188
|
+
}
|
|
189
|
+
});
|
|
190
|
+
}, 5 * 60 * 1000);
|
|
184
191
|
}
|
|
185
192
|
async function getDeviceId() {
|
|
186
193
|
try {
|
package/dist/cli/index.js
CHANGED
|
@@ -60,7 +60,9 @@ async function fetchAiConfig(authToken) {
|
|
|
60
60
|
console.log('[fetchAiConfig] No AI config available for this user');
|
|
61
61
|
return false;
|
|
62
62
|
}
|
|
63
|
-
|
|
63
|
+
// Save aiConfig + models together so agentSession can build provider registry dynamically
|
|
64
|
+
const configPayload = { ...data.aiConfig, models: data.models || [] };
|
|
65
|
+
await fs.writeFile(AI_CONFIG_FILE, JSON.stringify(configPayload, null, 2));
|
|
64
66
|
console.log('[fetchAiConfig] AI config saved successfully');
|
|
65
67
|
return true;
|
|
66
68
|
}
|
|
@@ -162,10 +164,8 @@ async function writeDeviceConfigMerged(partial) {
|
|
|
162
164
|
await fs.mkdir(CONFIG_DIR, { recursive: true });
|
|
163
165
|
await fs.writeFile(DEVICE_CONFIG_FILE, JSON.stringify(out, null, 2));
|
|
164
166
|
}
|
|
165
|
-
/** If AI cache is empty but we have a device JWT, try GET /config/ai
|
|
167
|
+
/** If AI cache is empty but we have a device JWT, try GET /config/ai (non-fatal). */
|
|
166
168
|
async function maybeFetchAiConfigIfMissing() {
|
|
167
|
-
if (hasAiCredentials())
|
|
168
|
-
return;
|
|
169
169
|
const jwt = await readDeviceAuthToken();
|
|
170
170
|
if (!jwt)
|
|
171
171
|
return;
|
|
@@ -176,11 +176,20 @@ async function maybeFetchAiConfigIfMissing() {
|
|
|
176
176
|
}
|
|
177
177
|
}
|
|
178
178
|
function scheduleAiConfigSync(authToken) {
|
|
179
|
+
// Fetch immediately
|
|
179
180
|
void fetchAiConfig(authToken).then((ok) => {
|
|
180
181
|
if (!ok && !hasAiCredentials()) {
|
|
181
182
|
console.warn('[CLI] AI config sync failed; check backend /config/ai and apiUrl.');
|
|
182
183
|
}
|
|
183
184
|
});
|
|
185
|
+
// Refresh every 5 minutes to pick up model config changes
|
|
186
|
+
setInterval(() => {
|
|
187
|
+
void fetchAiConfig(authToken).then((ok) => {
|
|
188
|
+
if (!ok && !hasAiCredentials()) {
|
|
189
|
+
console.warn('[CLI] AI config sync failed; check backend /config/ai and apiUrl.');
|
|
190
|
+
}
|
|
191
|
+
});
|
|
192
|
+
}, 5 * 60 * 1000);
|
|
184
193
|
}
|
|
185
194
|
async function getDeviceId() {
|
|
186
195
|
try {
|
package/dist/ttc-cli.tar.gz
CHANGED
|
Binary file
|