@testany/hephos 0.3.8 → 0.3.10
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/out/repl/ReplModeInk.d.ts.map +1 -1
- package/out/repl/ReplModeInk.js +258 -7
- package/out/repl/ReplModeInk.js.map +1 -1
- package/out/repl/components/HistoryOverlay.d.ts +20 -0
- package/out/repl/components/HistoryOverlay.d.ts.map +1 -0
- package/out/repl/components/HistoryOverlay.js +66 -0
- package/out/repl/components/HistoryOverlay.js.map +1 -0
- package/out/repl/components/Logo.d.ts +8 -0
- package/out/repl/components/Logo.d.ts.map +1 -0
- package/out/repl/components/Logo.js +33 -0
- package/out/repl/components/Logo.js.map +1 -0
- package/out/repl/components/StreamingDisplay.d.ts.map +1 -1
- package/out/repl/components/StreamingDisplay.js +21 -1
- package/out/repl/components/StreamingDisplay.js.map +1 -1
- package/out/repl/hooks/useHistory.d.ts +56 -0
- package/out/repl/hooks/useHistory.d.ts.map +1 -0
- package/out/repl/hooks/useHistory.js +514 -0
- package/out/repl/hooks/useHistory.js.map +1 -0
- package/out/utils/versionChecker.d.ts +19 -0
- package/out/utils/versionChecker.d.ts.map +1 -0
- package/out/utils/versionChecker.js +77 -0
- package/out/utils/versionChecker.js.map +1 -0
- package/package.json +1 -1
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Version Checker Utility
|
|
3
|
+
*
|
|
4
|
+
* Checks for newer versions of CLI and Core packages on npm registry
|
|
5
|
+
*/
|
|
6
|
+
import https from 'https';
|
|
7
|
+
/**
|
|
8
|
+
* Fetch latest version from npm registry
|
|
9
|
+
*/
|
|
10
|
+
async function fetchLatestVersion(packageName) {
|
|
11
|
+
return new Promise((resolve) => {
|
|
12
|
+
const timeout = setTimeout(() => resolve(null), 3000); // 3s timeout
|
|
13
|
+
const req = https.get(`https://registry.npmjs.org/${packageName}/latest`, { headers: { 'Accept': 'application/json' } }, (res) => {
|
|
14
|
+
if (res.statusCode !== 200) {
|
|
15
|
+
clearTimeout(timeout);
|
|
16
|
+
resolve(null);
|
|
17
|
+
return;
|
|
18
|
+
}
|
|
19
|
+
let data = '';
|
|
20
|
+
res.on('data', chunk => data += chunk);
|
|
21
|
+
res.on('end', () => {
|
|
22
|
+
clearTimeout(timeout);
|
|
23
|
+
try {
|
|
24
|
+
const json = JSON.parse(data);
|
|
25
|
+
resolve(json.version || null);
|
|
26
|
+
}
|
|
27
|
+
catch {
|
|
28
|
+
resolve(null);
|
|
29
|
+
}
|
|
30
|
+
});
|
|
31
|
+
});
|
|
32
|
+
req.on('error', () => {
|
|
33
|
+
clearTimeout(timeout);
|
|
34
|
+
resolve(null);
|
|
35
|
+
});
|
|
36
|
+
req.end();
|
|
37
|
+
});
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* Compare semver versions
|
|
41
|
+
* Returns true if latest > current
|
|
42
|
+
*/
|
|
43
|
+
function isNewerVersion(current, latest) {
|
|
44
|
+
const currentParts = current.split('.').map(Number);
|
|
45
|
+
const latestParts = latest.split('.').map(Number);
|
|
46
|
+
for (let i = 0; i < 3; i++) {
|
|
47
|
+
const c = currentParts[i] || 0;
|
|
48
|
+
const l = latestParts[i] || 0;
|
|
49
|
+
if (l > c)
|
|
50
|
+
return true;
|
|
51
|
+
if (l < c)
|
|
52
|
+
return false;
|
|
53
|
+
}
|
|
54
|
+
return false;
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* Check versions for both CLI and Core packages
|
|
58
|
+
*/
|
|
59
|
+
export async function checkVersions(cliVersion, coreVersion) {
|
|
60
|
+
const [latestCli, latestCore] = await Promise.all([
|
|
61
|
+
fetchLatestVersion('@testany/hephos'),
|
|
62
|
+
fetchLatestVersion('@testany/agent-chatter-core')
|
|
63
|
+
]);
|
|
64
|
+
return {
|
|
65
|
+
cli: {
|
|
66
|
+
current: cliVersion,
|
|
67
|
+
latest: latestCli,
|
|
68
|
+
hasUpdate: latestCli ? isNewerVersion(cliVersion, latestCli) : false
|
|
69
|
+
},
|
|
70
|
+
core: {
|
|
71
|
+
current: coreVersion,
|
|
72
|
+
latest: latestCore,
|
|
73
|
+
hasUpdate: latestCore ? isNewerVersion(coreVersion, latestCore) : false
|
|
74
|
+
}
|
|
75
|
+
};
|
|
76
|
+
}
|
|
77
|
+
//# sourceMappingURL=versionChecker.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"versionChecker.js","sourceRoot":"","sources":["../../src/utils/versionChecker.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,MAAM,OAAO,CAAC;AAa1B;;GAEG;AACH,KAAK,UAAU,kBAAkB,CAAC,WAAmB;IACnD,OAAO,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,EAAE;QAC7B,MAAM,OAAO,GAAG,UAAU,CAAC,GAAG,EAAE,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE,IAAI,CAAC,CAAC,CAAC,aAAa;QAEpE,MAAM,GAAG,GAAG,KAAK,CAAC,GAAG,CACnB,8BAA8B,WAAW,SAAS,EAClD,EAAE,OAAO,EAAE,EAAE,QAAQ,EAAE,kBAAkB,EAAE,EAAE,EAC7C,CAAC,GAAG,EAAE,EAAE;YACN,IAAI,GAAG,CAAC,UAAU,KAAK,GAAG,EAAE,CAAC;gBAC3B,YAAY,CAAC,OAAO,CAAC,CAAC;gBACtB,OAAO,CAAC,IAAI,CAAC,CAAC;gBACd,OAAO;YACT,CAAC;YAED,IAAI,IAAI,GAAG,EAAE,CAAC;YACd,GAAG,CAAC,EAAE,CAAC,MAAM,EAAE,KAAK,CAAC,EAAE,CAAC,IAAI,IAAI,KAAK,CAAC,CAAC;YACvC,GAAG,CAAC,EAAE,CAAC,KAAK,EAAE,GAAG,EAAE;gBACjB,YAAY,CAAC,OAAO,CAAC,CAAC;gBACtB,IAAI,CAAC;oBACH,MAAM,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;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