@ulpi/cli 0.1.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.
Files changed (92) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +200 -0
  3. package/dist/auth-PN7TMQHV-2W4ICG64.js +15 -0
  4. package/dist/chunk-247GVVKK.js +2259 -0
  5. package/dist/chunk-2CLNOKPA.js +793 -0
  6. package/dist/chunk-2HEE5OKX.js +79 -0
  7. package/dist/chunk-2MZER6ND.js +415 -0
  8. package/dist/chunk-3SBPZRB5.js +772 -0
  9. package/dist/chunk-4VNS5WPM.js +42 -0
  10. package/dist/chunk-6JCMYYBT.js +1546 -0
  11. package/dist/chunk-6OCEY7JY.js +422 -0
  12. package/dist/chunk-74WVVWJ4.js +375 -0
  13. package/dist/chunk-7AL4DOEJ.js +131 -0
  14. package/dist/chunk-7LXY5UVC.js +330 -0
  15. package/dist/chunk-DBMUNBNB.js +3048 -0
  16. package/dist/chunk-JWUUVXIV.js +13694 -0
  17. package/dist/chunk-KIKPIH6N.js +4048 -0
  18. package/dist/chunk-KLEASXUR.js +70 -0
  19. package/dist/chunk-MIAQVCFW.js +39 -0
  20. package/dist/chunk-NNUWU6CV.js +1610 -0
  21. package/dist/chunk-PKD4ASEM.js +115 -0
  22. package/dist/chunk-Q4HIY43N.js +4230 -0
  23. package/dist/chunk-QJ5GSMEC.js +146 -0
  24. package/dist/chunk-SIAQVRKG.js +2163 -0
  25. package/dist/chunk-SPOI23SB.js +197 -0
  26. package/dist/chunk-YM2HV4IA.js +505 -0
  27. package/dist/codemap-RRJIDBQ5.js +636 -0
  28. package/dist/config-EGAXXCGL.js +127 -0
  29. package/dist/dist-6G7JC2RA.js +90 -0
  30. package/dist/dist-7LHZ65GC.js +418 -0
  31. package/dist/dist-LZKZFPVX.js +140 -0
  32. package/dist/dist-R5F4MX3I.js +107 -0
  33. package/dist/dist-R5ZJ4LX5.js +56 -0
  34. package/dist/dist-RJGCUS3L.js +87 -0
  35. package/dist/dist-RKOGLK7R.js +151 -0
  36. package/dist/dist-W7K4WPAF.js +597 -0
  37. package/dist/export-import-4A5MWLIA.js +53 -0
  38. package/dist/history-ATTUKOHO.js +934 -0
  39. package/dist/index.js +2120 -0
  40. package/dist/init-AY5C2ZAS.js +393 -0
  41. package/dist/launchd-LF2QMSKZ.js +148 -0
  42. package/dist/log-TVTUXAYD.js +75 -0
  43. package/dist/mcp-installer-NQCGKQ23.js +124 -0
  44. package/dist/memory-J3G24QHS.js +406 -0
  45. package/dist/ollama-3XCUZMZT-FYKHW4TZ.js +7 -0
  46. package/dist/openai-E7G2YAHU-UYY4ZWON.js +8 -0
  47. package/dist/projects-ATHDD3D6.js +271 -0
  48. package/dist/review-ADUPV3PN.js +152 -0
  49. package/dist/rules-E427DKYJ.js +134 -0
  50. package/dist/server-MOYPE4SM-N7SE2AN7.js +18 -0
  51. package/dist/server-X5P6WH2M-7K2RY34N.js +11 -0
  52. package/dist/skills/ulpi-generate-guardian/SKILL.md +511 -0
  53. package/dist/skills/ulpi-generate-guardian/references/framework-rules.md +692 -0
  54. package/dist/skills/ulpi-generate-guardian/references/language-rules.md +596 -0
  55. package/dist/skills-CX73O3IV.js +76 -0
  56. package/dist/status-4DFHDJMN.js +66 -0
  57. package/dist/templates/biome.yml +24 -0
  58. package/dist/templates/conventional-commits.yml +18 -0
  59. package/dist/templates/django.yml +30 -0
  60. package/dist/templates/docker.yml +30 -0
  61. package/dist/templates/eslint.yml +13 -0
  62. package/dist/templates/express.yml +20 -0
  63. package/dist/templates/fastapi.yml +23 -0
  64. package/dist/templates/git-flow.yml +26 -0
  65. package/dist/templates/github-flow.yml +27 -0
  66. package/dist/templates/go.yml +33 -0
  67. package/dist/templates/jest.yml +24 -0
  68. package/dist/templates/laravel.yml +30 -0
  69. package/dist/templates/monorepo.yml +26 -0
  70. package/dist/templates/nestjs.yml +21 -0
  71. package/dist/templates/nextjs.yml +31 -0
  72. package/dist/templates/nodejs.yml +33 -0
  73. package/dist/templates/npm.yml +15 -0
  74. package/dist/templates/php.yml +25 -0
  75. package/dist/templates/pnpm.yml +15 -0
  76. package/dist/templates/prettier.yml +23 -0
  77. package/dist/templates/prisma.yml +21 -0
  78. package/dist/templates/python.yml +33 -0
  79. package/dist/templates/quality-of-life.yml +111 -0
  80. package/dist/templates/ruby.yml +25 -0
  81. package/dist/templates/rust.yml +34 -0
  82. package/dist/templates/typescript.yml +14 -0
  83. package/dist/templates/vitest.yml +24 -0
  84. package/dist/templates/yarn.yml +15 -0
  85. package/dist/templates-U7T6MARD.js +156 -0
  86. package/dist/ui-L7UAWXDY.js +167 -0
  87. package/dist/ui.html +698 -0
  88. package/dist/ulpi-RMMCUAGP-JCJ273T6.js +161 -0
  89. package/dist/uninstall-6SW35IK4.js +25 -0
  90. package/dist/update-M2B4RLGH.js +61 -0
  91. package/dist/version-checker-ANCS3IHR.js +10 -0
  92. package/package.json +92 -0
@@ -0,0 +1,115 @@
1
+ import {
2
+ CLI_REGISTRY_URL,
3
+ VERSION_CACHE_FILE
4
+ } from "./chunk-7LXY5UVC.js";
5
+
6
+ // src/version-checker.ts
7
+ import * as fs from "fs";
8
+ import * as path from "path";
9
+ import * as https from "https";
10
+ var CACHE_PATH = VERSION_CACHE_FILE;
11
+ var CACHE_TTL_MS = 4 * 60 * 60 * 1e3;
12
+ var REGISTRY_URL = CLI_REGISTRY_URL;
13
+ var FETCH_TIMEOUT_MS = 5e3;
14
+ function getCurrentVersion() {
15
+ try {
16
+ return "0.1.0";
17
+ } catch {
18
+ return "0.0.0";
19
+ }
20
+ }
21
+ function isNewer(current, latest) {
22
+ const a = current.split(".").map(Number);
23
+ const b = latest.split(".").map(Number);
24
+ for (let i = 0; i < 3; i++) {
25
+ if ((b[i] ?? 0) > (a[i] ?? 0)) return true;
26
+ if ((b[i] ?? 0) < (a[i] ?? 0)) return false;
27
+ }
28
+ return false;
29
+ }
30
+ function readCache() {
31
+ try {
32
+ if (!fs.existsSync(CACHE_PATH)) return null;
33
+ const data = JSON.parse(fs.readFileSync(CACHE_PATH, "utf-8"));
34
+ if (Date.now() - data.checkedAt < CACHE_TTL_MS) return data;
35
+ return null;
36
+ } catch {
37
+ return null;
38
+ }
39
+ }
40
+ function writeCache(latest) {
41
+ try {
42
+ const dir = path.dirname(CACHE_PATH);
43
+ fs.mkdirSync(dir, { recursive: true });
44
+ fs.writeFileSync(CACHE_PATH, JSON.stringify({ latest, checkedAt: Date.now() }), "utf-8");
45
+ } catch {
46
+ }
47
+ }
48
+ function fetchLatestVersion() {
49
+ const MAX_RESPONSE_SIZE = 64 * 1024;
50
+ return new Promise((resolve) => {
51
+ const req = https.get(REGISTRY_URL, { timeout: FETCH_TIMEOUT_MS }, (res) => {
52
+ if (res.statusCode !== 200) {
53
+ resolve(null);
54
+ res.resume();
55
+ return;
56
+ }
57
+ let data = "";
58
+ res.on("data", (chunk) => {
59
+ data += chunk;
60
+ if (data.length > MAX_RESPONSE_SIZE) {
61
+ req.destroy();
62
+ resolve(null);
63
+ }
64
+ });
65
+ res.on("end", () => {
66
+ try {
67
+ const json = JSON.parse(data);
68
+ const version = json.version;
69
+ if (typeof version === "string" && /^\d+\.\d+\.\d+/.test(version)) {
70
+ resolve(version);
71
+ } else {
72
+ resolve(null);
73
+ }
74
+ } catch {
75
+ resolve(null);
76
+ }
77
+ });
78
+ });
79
+ req.on("error", () => resolve(null));
80
+ req.on("timeout", () => {
81
+ req.destroy();
82
+ resolve(null);
83
+ });
84
+ });
85
+ }
86
+ async function checkForUpdates() {
87
+ const current = getCurrentVersion();
88
+ try {
89
+ const cached = readCache();
90
+ if (cached) {
91
+ return {
92
+ current,
93
+ latest: cached.latest,
94
+ updateAvailable: isNewer(current, cached.latest)
95
+ };
96
+ }
97
+ const latest = await fetchLatestVersion();
98
+ if (!latest) {
99
+ return { current, latest: current, updateAvailable: false };
100
+ }
101
+ writeCache(latest);
102
+ return {
103
+ current,
104
+ latest,
105
+ updateAvailable: isNewer(current, latest)
106
+ };
107
+ } catch {
108
+ return { current, latest: current, updateAvailable: false };
109
+ }
110
+ }
111
+
112
+ export {
113
+ getCurrentVersion,
114
+ checkForUpdates
115
+ };