mustflow 2.16.0 → 2.17.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.
package/README.md CHANGED
@@ -103,7 +103,7 @@ available as a direct shell command, install mustflow globally:
103
103
  npm install -g mustflow
104
104
  mf version --check
105
105
 
106
- bun install -g mustflow
106
+ bun add -g mustflow@latest
107
107
  mf version --check
108
108
  ```
109
109
 
@@ -282,10 +282,10 @@ npx mf update --dry-run
282
282
  npx mf update --apply
283
283
  ```
284
284
 
285
- After updating the mustflow package, `mf upgrade` combines the package freshness check with the safe project-file update step. It does not install packages by itself; update npm, pnpm, or Bun first.
285
+ After updating the mustflow package, `mf upgrade` combines the package freshness check with the safe project-file update step. It does not install packages by itself; refresh mustflow with the package manager you used first. When a newer release exists, `mf version --check` and `mf upgrade` print update commands for npm, Bun, pnpm, Yarn, and Deno.
286
286
 
287
287
  ```sh
288
- bun update -g mustflow
288
+ bun add -g mustflow@latest
289
289
  mf upgrade --dry-run
290
290
  mf upgrade
291
291
  ```
@@ -331,7 +331,7 @@ mf run mustflow_update_apply
331
331
  | `mf help <topic>` | Show installed mustflow help. |
332
332
  | `mf dashboard` | Start a local inspection dashboard for status, verification recommendations, release/version-source status, template update readiness, latest run receipt, skill routes, safe preferences, and documentation review. Use `--export-json <path>` or `--export <path>` for a bounded static report. It does not execute commands or apply fixes. |
333
333
  | `mf version` | Print the installed mustflow package version. |
334
- | `mf version --check` | Compare the installed package version with the latest npm release and print an update command if a newer version exists. |
334
+ | `mf version --check` | Compare the installed package version with the latest npm release and print package-manager update commands if a newer version exists. |
335
335
  | `mf version-sources` | Inspect detected package, template, and declared version sources without modifying files. |
336
336
  | `mf impact --changed` | Report whether changed paths require a package or template version decision. |
337
337
  | `mf verify --reason <event>` | Run configured verification intents selected by `required_after` metadata. |
@@ -26,7 +26,9 @@ function printPackageCheck(check, reporter, lang) {
26
26
  if (check.updateAvailable) {
27
27
  reporter.stdout('');
28
28
  reporter.stdout(t(lang, 'version.check.updateCommand'));
29
- reporter.stdout(check.updateCommand);
29
+ for (const entry of check.updateCommands) {
30
+ reporter.stdout(`${entry.manager}: ${entry.command}`);
31
+ }
30
32
  }
31
33
  }
32
34
  export async function runUpgrade(args, reporter, lang = 'en') {
@@ -25,7 +25,7 @@ function renderVersionCheck(check, lang) {
25
25
  : t(lang, 'version.check.upToDate', { version: check.latestVersion }),
26
26
  ];
27
27
  if (check.updateAvailable) {
28
- lines.push('', t(lang, 'version.check.updateCommand'), check.updateCommand);
28
+ lines.push('', t(lang, 'version.check.updateCommand'), ...check.updateCommands.map((entry) => `${entry.manager}: ${entry.command}`));
29
29
  }
30
30
  return lines.join('\n');
31
31
  }
@@ -697,7 +697,7 @@ Read these files before working:
697
697
  "version.help.exit.ok": "Version information was printed",
698
698
  "version.check.latestAvailable": "latest {version} available",
699
699
  "version.check.upToDate": "latest {version}; already up to date",
700
- "version.check.updateCommand": "Update command:",
700
+ "version.check.updateCommand": "Update commands:",
701
701
  "version.error.checkFailed": "Could not check npm for a newer version: {message}",
702
702
  "upgrade.help.summary": "Check whether the installed mustflow package is current, then safely apply bundled workflow template updates when possible.",
703
703
  "upgrade.help.option.dryRun": "Check package status and print the project update plan without writing files",
@@ -697,7 +697,7 @@ Lee estos archivos antes de trabajar:
697
697
  "version.help.exit.ok": "Se imprimió la información de versión",
698
698
  "version.check.latestAvailable": "última versión {version} disponible",
699
699
  "version.check.upToDate": "última versión {version}; ya está actualizado",
700
- "version.check.updateCommand": "Comando de actualización:",
700
+ "version.check.updateCommand": "Comandos de actualización:",
701
701
  "version.error.checkFailed": "No se pudo consultar npm para una versión nueva: {message}",
702
702
  "upgrade.help.summary": "Comprueba si el paquete mustflow instalado está actualizado y luego aplica de forma segura las actualizaciones de la plantilla incluida cuando sea posible.",
703
703
  "upgrade.help.option.dryRun": "Comprueba el estado del paquete e imprime el plan de actualización del proyecto sin escribir archivos",
@@ -697,7 +697,7 @@ Lisez ces fichiers avant de travailler :
697
697
  "version.help.exit.ok": "Les informations de version ont été affichées",
698
698
  "version.check.latestAvailable": "dernière version {version} disponible",
699
699
  "version.check.upToDate": "dernière version {version}; déjà à jour",
700
- "version.check.updateCommand": "Commande de mise à jour :",
700
+ "version.check.updateCommand": "Commandes de mise à jour :",
701
701
  "version.error.checkFailed": "Impossible de vérifier une nouvelle version sur npm : {message}",
702
702
  "upgrade.help.summary": "Vérifie si le paquet mustflow installé est à jour, puis applique en sécurité les mises à jour du modèle inclus quand c'est possible.",
703
703
  "upgrade.help.option.dryRun": "Vérifie l'état du paquet et affiche le plan de mise à jour du projet sans écrire de fichiers",
@@ -697,7 +697,7 @@ export const hiMessages = {
697
697
  "version.help.exit.ok": "Version जानकारी प्रिंट की गई",
698
698
  "version.check.latestAvailable": "latest {version} उपलब्ध है",
699
699
  "version.check.upToDate": "latest {version}; पहले से up to date",
700
- "version.check.updateCommand": "Update command:",
700
+ "version.check.updateCommand": "Update commands:",
701
701
  "version.error.checkFailed": "npm पर नया version जाँचा नहीं जा सका: {message}",
702
702
  "upgrade.help.summary": "जाँचें कि installed mustflow package current है या नहीं, फिर संभव होने पर current CLI में bundled workflow template updates सुरक्षित रूप से लागू करें.",
703
703
  "upgrade.help.option.dryRun": "Package status जाँचें और files लिखे बिना project update plan प्रिंट करें",
@@ -1,5 +1,42 @@
1
1
  const DEFAULT_NPM_REGISTRY_URL = 'https://registry.npmjs.org';
2
2
  const DEFAULT_VERSION_CHECK_TIMEOUT_MS = 3_000;
3
+ const PACKAGE_MANAGER_COMMANDS = [
4
+ {
5
+ id: 'npm',
6
+ label: 'npm',
7
+ command(packageName) {
8
+ return `npm install -g ${packageName}@latest`;
9
+ },
10
+ },
11
+ {
12
+ id: 'bun',
13
+ label: 'bun',
14
+ command(packageName) {
15
+ return `bun add -g ${packageName}@latest`;
16
+ },
17
+ },
18
+ {
19
+ id: 'pnpm',
20
+ label: 'pnpm',
21
+ command(packageName) {
22
+ return `pnpm add -g ${packageName}@latest`;
23
+ },
24
+ },
25
+ {
26
+ id: 'yarn',
27
+ label: 'yarn',
28
+ command(packageName) {
29
+ return `yarn global add ${packageName}@latest`;
30
+ },
31
+ },
32
+ {
33
+ id: 'deno',
34
+ label: 'deno',
35
+ command(packageName) {
36
+ return `deno install -g -A -n mf npm:${packageName}@latest`;
37
+ },
38
+ },
39
+ ];
3
40
  function isRecord(value) {
4
41
  return typeof value === 'object' && value !== null && !Array.isArray(value);
5
42
  }
@@ -65,6 +102,37 @@ function getTimeoutMs() {
65
102
  const parsed = rawValue ? Number(rawValue) : DEFAULT_VERSION_CHECK_TIMEOUT_MS;
66
103
  return Number.isSafeInteger(parsed) && parsed > 0 ? parsed : DEFAULT_VERSION_CHECK_TIMEOUT_MS;
67
104
  }
105
+ function detectPackageManagerId() {
106
+ const signals = [
107
+ process.env.npm_config_user_agent,
108
+ process.env.npm_execpath,
109
+ process.execPath,
110
+ process.argv[1],
111
+ import.meta.url,
112
+ ]
113
+ .filter((signal) => typeof signal === 'string' && signal.length > 0)
114
+ .map((signal) => signal.toLowerCase());
115
+ for (const id of ['bun', 'pnpm', 'yarn', 'deno', 'npm']) {
116
+ if (signals.some((signal) => signal.includes(id))) {
117
+ return id;
118
+ }
119
+ }
120
+ return null;
121
+ }
122
+ function getPackageInstallCommands(packageName) {
123
+ const detectedId = detectPackageManagerId();
124
+ const commands = [...PACKAGE_MANAGER_COMMANDS];
125
+ const recommendedIndex = detectedId ? commands.findIndex((entry) => entry.id === detectedId) : -1;
126
+ if (recommendedIndex > 0) {
127
+ const [recommended] = commands.splice(recommendedIndex, 1);
128
+ commands.unshift(recommended);
129
+ }
130
+ return commands.map((entry, index) => ({
131
+ manager: entry.label,
132
+ command: entry.command(packageName),
133
+ recommended: index === 0 && detectedId === entry.id,
134
+ }));
135
+ }
68
136
  function buildLatestPackageUrl(registryUrl, packageName) {
69
137
  const trimmedRegistryUrl = registryUrl.replace(/\/+$/u, '');
70
138
  const encodedPackageName = packageName.startsWith('@')
@@ -86,12 +154,14 @@ export async function checkNpmLatestVersion(metadata) {
86
154
  if (!latestVersion) {
87
155
  throw new Error('npm registry response did not include a version');
88
156
  }
157
+ const updateCommands = getPackageInstallCommands(metadata.name);
89
158
  return {
90
159
  packageName: metadata.name,
91
160
  currentVersion: metadata.version,
92
161
  latestVersion,
93
162
  updateAvailable: comparePackageVersions(metadata.version, latestVersion) < 0,
94
163
  registryUrl,
95
- updateCommand: `npm install -g ${metadata.name}@latest`,
164
+ updateCommand: updateCommands[0]?.command ?? `npm install -g ${metadata.name}@latest`,
165
+ updateCommands,
96
166
  };
97
167
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mustflow",
3
- "version": "2.16.0",
3
+ "version": "2.17.0",
4
4
  "description": "Agent workflow documents and CLI for mustflow repository roots.",
5
5
  "type": "module",
6
6
  "license": "MIT-0",
@@ -1,6 +1,6 @@
1
1
  id = "default"
2
2
  name = "default"
3
- version = "2.16.0"
3
+ version = "2.17.0"
4
4
  description = "Minimal workflow for LLM agents to read, edit, and verify their work in a repository."
5
5
  common_root = "common"
6
6
  locales_root = "locales"