@monoes/monomindcli 1.16.5 → 1.16.7
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/src/commands/index.d.ts.map +1 -1
- package/dist/src/commands/index.js +2 -0
- package/dist/src/commands/index.js.map +1 -1
- package/dist/src/commands/sync.d.ts +10 -0
- package/dist/src/commands/sync.d.ts.map +1 -0
- package/dist/src/commands/sync.js +100 -0
- package/dist/src/commands/sync.js.map +1 -0
- package/dist/src/init/executor.d.ts.map +1 -1
- package/dist/src/init/executor.js +22 -0
- package/dist/src/init/executor.js.map +1 -1
- package/dist/src/init/statusline-generator.d.ts.map +1 -1
- package/dist/src/init/statusline-generator.js +45 -0
- package/dist/src/init/statusline-generator.js.map +1 -1
- package/dist/src/sync/checker.d.ts +12 -0
- package/dist/src/sync/checker.d.ts.map +1 -0
- package/dist/src/sync/checker.js +26 -0
- package/dist/src/sync/checker.js.map +1 -0
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +2 -2
|
@@ -1062,6 +1062,40 @@ function generateStatusline() {
|
|
|
1062
1062
|
return parts.join(\` \${DIV} \`);
|
|
1063
1063
|
}
|
|
1064
1064
|
|
|
1065
|
+
// ── Sync / update status ────────────────────────────────────────
|
|
1066
|
+
// Returns {local, global} if local .monomind/version differs from the running CLI,
|
|
1067
|
+
// or null when in sync or no version file exists.
|
|
1068
|
+
function getSyncStatus() {
|
|
1069
|
+
try {
|
|
1070
|
+
const vf = path.join(CWD, '.monomind', 'version');
|
|
1071
|
+
if (!fs.existsSync(vf)) return null;
|
|
1072
|
+
const local = fs.readFileSync(vf, 'utf-8').trim();
|
|
1073
|
+
const global = getVersion().replace(/^v/, '');
|
|
1074
|
+
if (!local || !global || local === global) return null;
|
|
1075
|
+
return { local, global };
|
|
1076
|
+
} catch { return null; }
|
|
1077
|
+
}
|
|
1078
|
+
|
|
1079
|
+
// Returns the latest available version string if the cache shows a newer release,
|
|
1080
|
+
// null otherwise. Reads from the rate-limiter cache — no network call.
|
|
1081
|
+
function getUpdateStatus() {
|
|
1082
|
+
try {
|
|
1083
|
+
const stateFile = path.join(os.homedir(), '.monomind', 'update-state.json');
|
|
1084
|
+
if (!fs.existsSync(stateFile)) return null;
|
|
1085
|
+
const stat = safeStat(stateFile);
|
|
1086
|
+
if (!stat || stat.size > 1024 * 1024) return null;
|
|
1087
|
+
const state = JSON.parse(fs.readFileSync(stateFile, 'utf-8'));
|
|
1088
|
+
const pkgVersions = (state && typeof state.packageVersions === 'object') ? state.packageVersions : {};
|
|
1089
|
+
const latest = pkgVersions['monomind'] || pkgVersions['@monoes/monomindcli'];
|
|
1090
|
+
const current = getVersion().replace(/^v/, '');
|
|
1091
|
+
if (!latest || !current) return null;
|
|
1092
|
+
const [lMaj, lMin, lPat] = latest.split('.').map(Number);
|
|
1093
|
+
const [cMaj, cMin, cPat] = current.split('.').map(Number);
|
|
1094
|
+
const isNewer = lMaj > cMaj || (lMaj === cMaj && lMin > cMin) || (lMaj === cMaj && lMin === cMin && lPat > cPat);
|
|
1095
|
+
return isNewer ? latest : null;
|
|
1096
|
+
} catch { return null; }
|
|
1097
|
+
}
|
|
1098
|
+
|
|
1065
1099
|
// ── Multi-line dashboard (full mode) ─────────────────────────────
|
|
1066
1100
|
function generateDashboard() {
|
|
1067
1101
|
const git = getGitInfo();
|
|
@@ -1179,6 +1213,17 @@ function generateDashboard() {
|
|
|
1179
1213
|
|
|
1180
1214
|
lines.push(\`\${x.teal}🧠 CONTEXT\${x.reset} \${graphStr}\${hilStr}\`);
|
|
1181
1215
|
|
|
1216
|
+
// ── Row 3: Sync / update warnings (only when action needed) ──
|
|
1217
|
+
const sync = getSyncStatus();
|
|
1218
|
+
const upd = getUpdateStatus();
|
|
1219
|
+
if (sync || upd) {
|
|
1220
|
+
const parts = [];
|
|
1221
|
+
if (sync) parts.push(\`\${x.coral}⚠ sync: local v\${sync.local} → global v\${sync.global} (monomind sync run)\${x.reset}\`);
|
|
1222
|
+
if (upd) parts.push(\`\${x.gold}↑ v\${upd} available (npm i -g monomind)\${x.reset}\`);
|
|
1223
|
+
lines.push(SEP);
|
|
1224
|
+
lines.push(parts.join(\` \${DIV} \`));
|
|
1225
|
+
}
|
|
1226
|
+
|
|
1182
1227
|
return lines.join('\\n');
|
|
1183
1228
|
}
|
|
1184
1229
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"statusline-generator.js","sourceRoot":"","sources":["../../../src/init/statusline-generator.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAIH;;;;;;;;;GASG;AACH,MAAM,UAAU,wBAAwB,CAAC,OAAoB;IAC3D,MAAM,SAAS,GAAG,OAAO,CAAC,OAAO,CAAC,SAAS,CAAC;IAC5C,OAAO;;;;;;;;;;;;;;;;;;;;;;;eAuBM,SAAS
|
|
1
|
+
{"version":3,"file":"statusline-generator.js","sourceRoot":"","sources":["../../../src/init/statusline-generator.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAIH;;;;;;;;;GASG;AACH,MAAM,UAAU,wBAAwB,CAAC,OAAoB;IAC3D,MAAM,SAAS,GAAG,OAAO,CAAC,OAAO,CAAC,SAAS,CAAC;IAC5C,OAAO;;;;;;;;;;;;;;;;;;;;;;;eAuBM,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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AC;IAChD,CAAC;IAED,OAAO;;;;;;;;;;;;;;;;;;;;;;;;CAwBR,CAAC;AACF,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Local vs global monomind version sync checker.
|
|
3
|
+
* Reads .monomind/version (stamped by `monomind init`) and compares to
|
|
4
|
+
* the globally installed monomind package. No network calls — entirely local.
|
|
5
|
+
*/
|
|
6
|
+
export interface SyncCheckResult {
|
|
7
|
+
localVersion: string | null;
|
|
8
|
+
globalVersion: string | null;
|
|
9
|
+
needsSync: boolean;
|
|
10
|
+
}
|
|
11
|
+
export declare function checkLocalSync(projectDir?: string): SyncCheckResult;
|
|
12
|
+
//# sourceMappingURL=checker.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"checker.d.ts","sourceRoot":"","sources":["../../../src/sync/checker.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAMH,MAAM,WAAW,eAAe;IAC9B,YAAY,EAAE,MAAM,GAAG,IAAI,CAAC;IAC5B,aAAa,EAAE,MAAM,GAAG,IAAI,CAAC;IAC7B,SAAS,EAAE,OAAO,CAAC;CACpB;AAED,wBAAgB,cAAc,CAAC,UAAU,SAAgB,GAAG,eAAe,CAoB1E"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Local vs global monomind version sync checker.
|
|
3
|
+
* Reads .monomind/version (stamped by `monomind init`) and compares to
|
|
4
|
+
* the globally installed monomind package. No network calls — entirely local.
|
|
5
|
+
*/
|
|
6
|
+
import { readFileSync, existsSync } from 'fs';
|
|
7
|
+
import { join } from 'path';
|
|
8
|
+
import { getInstalledVersion } from '../update/checker.js';
|
|
9
|
+
export function checkLocalSync(projectDir = process.cwd()) {
|
|
10
|
+
let localVersion = null;
|
|
11
|
+
try {
|
|
12
|
+
const versionFile = join(projectDir, '.monomind', 'version');
|
|
13
|
+
if (existsSync(versionFile)) {
|
|
14
|
+
localVersion = readFileSync(versionFile, 'utf-8').trim() || null;
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
catch { /* pre-v1.17 project or missing .monomind */ }
|
|
18
|
+
// Try both package names — `monomind` (umbrella) and `@monoes/monomindcli` (scoped CLI)
|
|
19
|
+
const globalVersion = getInstalledVersion('monomind') ??
|
|
20
|
+
getInstalledVersion('@monoes/monomindcli');
|
|
21
|
+
const needsSync = localVersion !== null &&
|
|
22
|
+
globalVersion !== null &&
|
|
23
|
+
localVersion !== globalVersion;
|
|
24
|
+
return { localVersion, globalVersion, needsSync };
|
|
25
|
+
}
|
|
26
|
+
//# sourceMappingURL=checker.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"checker.js","sourceRoot":"","sources":["../../../src/sync/checker.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,IAAI,CAAC;AAC9C,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAC;AAC5B,OAAO,EAAE,mBAAmB,EAAE,MAAM,sBAAsB,CAAC;AAQ3D,MAAM,UAAU,cAAc,CAAC,UAAU,GAAG,OAAO,CAAC,GAAG,EAAE;IACvD,IAAI,YAAY,GAAkB,IAAI,CAAC;IACvC,IAAI,CAAC;QACH,MAAM,WAAW,GAAG,IAAI,CAAC,UAAU,EAAE,WAAW,EAAE,SAAS,CAAC,CAAC;QAC7D,IAAI,UAAU,CAAC,WAAW,CAAC,EAAE,CAAC;YAC5B,YAAY,GAAG,YAAY,CAAC,WAAW,EAAE,OAAO,CAAC,CAAC,IAAI,EAAE,IAAI,IAAI,CAAC;QACnE,CAAC;IACH,CAAC;IAAC,MAAM,CAAC,CAAC,4CAA4C,CAAC,CAAC;IAExD,wFAAwF;IACxF,MAAM,aAAa,GACjB,mBAAmB,CAAC,UAAU,CAAC;QAC/B,mBAAmB,CAAC,qBAAqB,CAAC,CAAC;IAE7C,MAAM,SAAS,GACb,YAAY,KAAK,IAAI;QACrB,aAAa,KAAK,IAAI;QACtB,YAAY,KAAK,aAAa,CAAC;IAEjC,OAAO,EAAE,YAAY,EAAE,aAAa,EAAE,SAAS,EAAE,CAAC;AACpD,CAAC"}
|