orquesta-cli 0.2.23 → 0.2.24
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.
|
@@ -37,7 +37,7 @@ import { configManager } from '../../core/config/config-manager.js';
|
|
|
37
37
|
import { logger } from '../../utils/logger.js';
|
|
38
38
|
import { usageTracker } from '../../core/usage-tracker.js';
|
|
39
39
|
import { UpdateNotification } from '../UpdateNotification.js';
|
|
40
|
-
import { checkForCliUpdate, runCliUpdate } from '../../utils/update-checker.js';
|
|
40
|
+
import { checkForCliUpdate, runCliUpdate, setSkippedVersion } from '../../utils/update-checker.js';
|
|
41
41
|
import { setToolExecutionCallback, setTellToUserCallback, setToolResponseCallback, setPlanCreatedCallback, setTodoStartCallback, setTodoCompleteCallback, setTodoFailCallback, setCompactCallback, setAssistantResponseCallback, setToolApprovalCallback, setReasoningCallback, } from '../../tools/llm/simple/file-tools.js';
|
|
42
42
|
import { createRequire } from 'module';
|
|
43
43
|
const require = createRequire(import.meta.url);
|
|
@@ -512,6 +512,7 @@ export const PlanExecuteApp = ({ llmClient: initialLlmClient, modelInfo }) => {
|
|
|
512
512
|
runCliUpdate(updateLatest, (line) => setUpdateProgress(line.slice(0, 100)))
|
|
513
513
|
.then(res => {
|
|
514
514
|
if (res.success) {
|
|
515
|
+
setSkippedVersion(updateLatest);
|
|
515
516
|
setUpdatePhase('done');
|
|
516
517
|
}
|
|
517
518
|
else {
|
|
@@ -521,7 +522,12 @@ export const PlanExecuteApp = ({ llmClient: initialLlmClient, modelInfo }) => {
|
|
|
521
522
|
});
|
|
522
523
|
return;
|
|
523
524
|
}
|
|
524
|
-
if (
|
|
525
|
+
if (inputChar === 's' || inputChar === 'S') {
|
|
526
|
+
setSkippedVersion(updateLatest);
|
|
527
|
+
setUpdatePhase('hidden');
|
|
528
|
+
return;
|
|
529
|
+
}
|
|
530
|
+
if (key.escape || inputChar === 'n' || inputChar === 'N') {
|
|
525
531
|
setUpdatePhase('hidden');
|
|
526
532
|
return;
|
|
527
533
|
}
|
|
@@ -1,6 +1,33 @@
|
|
|
1
1
|
import { spawn } from 'child_process';
|
|
2
|
+
import * as fs from 'fs';
|
|
3
|
+
import * as path from 'path';
|
|
4
|
+
import * as os from 'os';
|
|
2
5
|
import { logger } from './logger.js';
|
|
3
6
|
const REGISTRY_URL = 'https://registry.npmjs.org/orquesta-cli/latest';
|
|
7
|
+
const STATE_DIR = path.join(process.env['HOME'] || os.homedir() || '.', '.local-cli');
|
|
8
|
+
const STATE_FILE = path.join(STATE_DIR, 'update-state.json');
|
|
9
|
+
function readUpdateState() {
|
|
10
|
+
try {
|
|
11
|
+
return JSON.parse(fs.readFileSync(STATE_FILE, 'utf-8'));
|
|
12
|
+
}
|
|
13
|
+
catch {
|
|
14
|
+
return {};
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
export function getSkippedVersion() {
|
|
18
|
+
return readUpdateState().skippedVersion ?? null;
|
|
19
|
+
}
|
|
20
|
+
export function setSkippedVersion(version) {
|
|
21
|
+
try {
|
|
22
|
+
if (!fs.existsSync(STATE_DIR))
|
|
23
|
+
fs.mkdirSync(STATE_DIR, { recursive: true });
|
|
24
|
+
const state = readUpdateState();
|
|
25
|
+
state.skippedVersion = version;
|
|
26
|
+
fs.writeFileSync(STATE_FILE, JSON.stringify(state, null, 2));
|
|
27
|
+
}
|
|
28
|
+
catch {
|
|
29
|
+
}
|
|
30
|
+
}
|
|
4
31
|
function isNewer(a, b) {
|
|
5
32
|
const pa = a.split('.').map(n => parseInt(n, 10) || 0);
|
|
6
33
|
const pb = b.split('.').map(n => parseInt(n, 10) || 0);
|
|
@@ -27,6 +54,10 @@ export async function checkForCliUpdate(currentVersion, timeoutMs = 3500) {
|
|
|
27
54
|
const latest = json?.version;
|
|
28
55
|
if (!latest || !isNewer(latest, currentVersion))
|
|
29
56
|
return null;
|
|
57
|
+
if (getSkippedVersion() === latest) {
|
|
58
|
+
logger.debug?.('CLI update available but skipped by user', { latest });
|
|
59
|
+
return null;
|
|
60
|
+
}
|
|
30
61
|
logger.debug?.('CLI update available', { current: currentVersion, latest });
|
|
31
62
|
return { current: currentVersion, latest };
|
|
32
63
|
}
|