moflo 4.8.76 → 4.8.77
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.
|
@@ -26,6 +26,16 @@ const CONFIG = {
|
|
|
26
26
|
|
|
27
27
|
const CWD = process.env.CLAUDE_PROJECT_DIR || process.cwd();
|
|
28
28
|
|
|
29
|
+
// Claude Code pipes session JSON (incl. current model) via stdin. Read it
|
|
30
|
+
// synchronously — authoritative source, no file lookups needed.
|
|
31
|
+
let STDIN_PAYLOAD = null;
|
|
32
|
+
try {
|
|
33
|
+
if (!process.stdin.isTTY) {
|
|
34
|
+
const raw = fs.readFileSync(0, 'utf8');
|
|
35
|
+
if (raw.trim()) STDIN_PAYLOAD = JSON.parse(raw);
|
|
36
|
+
}
|
|
37
|
+
} catch { /* ignore */ }
|
|
38
|
+
|
|
29
39
|
// Load status_line config from moflo.yaml (show/hide individual items)
|
|
30
40
|
function loadStatusLineConfig() {
|
|
31
41
|
const defaults = {
|
|
@@ -199,8 +209,12 @@ function getGitInfo() {
|
|
|
199
209
|
return result;
|
|
200
210
|
}
|
|
201
211
|
|
|
202
|
-
// Detect model name from Claude
|
|
212
|
+
// Detect model name. Prefers stdin payload from Claude Code (authoritative),
|
|
213
|
+
// then falls back to file-based lookups for manual/CLI invocations.
|
|
203
214
|
function getModelName() {
|
|
215
|
+
const m = STDIN_PAYLOAD?.model;
|
|
216
|
+
if (m?.display_name) return m.display_name.replace(/\s*\([^)]*\)\s*$/, '').trim();
|
|
217
|
+
if (m?.id) return formatModelName(m.id);
|
|
204
218
|
try {
|
|
205
219
|
const claudeConfig = readJSON(path.join(os.homedir(), '.claude.json'));
|
|
206
220
|
if (claudeConfig?.projects) {
|
|
@@ -218,10 +232,7 @@ function getModelName() {
|
|
|
218
232
|
const ts = usage[id]?.lastUsedAt ? new Date(usage[id].lastUsedAt).getTime() : 0;
|
|
219
233
|
if (ts > latest) { latest = ts; modelId = id; }
|
|
220
234
|
}
|
|
221
|
-
|
|
222
|
-
if (modelId.includes('sonnet')) return 'Sonnet 4.6';
|
|
223
|
-
if (modelId.includes('haiku')) return 'Haiku 4.5';
|
|
224
|
-
return modelId.split('-').slice(1, 3).join(' ');
|
|
235
|
+
return formatModelName(modelId);
|
|
225
236
|
}
|
|
226
237
|
}
|
|
227
238
|
break;
|
|
@@ -232,12 +243,16 @@ function getModelName() {
|
|
|
232
243
|
|
|
233
244
|
// Fallback: settings.json model field
|
|
234
245
|
const settings = getSettings();
|
|
235
|
-
if (settings?.model)
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
246
|
+
if (settings?.model) return formatModelName(settings.model);
|
|
247
|
+
return 'Claude Code';
|
|
248
|
+
}
|
|
249
|
+
|
|
250
|
+
function formatModelName(modelId) {
|
|
251
|
+
const m = modelId.match(/claude-(opus|sonnet|haiku)-(\d+)-(\d+)/);
|
|
252
|
+
if (m) return `${m[1][0].toUpperCase()}${m[1].slice(1)} ${m[2]}.${m[3]}`;
|
|
253
|
+
if (modelId.includes('opus')) return 'Opus';
|
|
254
|
+
if (modelId.includes('sonnet')) return 'Sonnet';
|
|
255
|
+
if (modelId.includes('haiku')) return 'Haiku';
|
|
241
256
|
return 'Claude Code';
|
|
242
257
|
}
|
|
243
258
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "moflo",
|
|
3
|
-
"version": "4.8.
|
|
3
|
+
"version": "4.8.77",
|
|
4
4
|
"description": "MoFlo — AI agent orchestration for Claude Code. Forked from ruflo/claude-flow with patches applied to source, plus feature-level orchestration.",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"type": "module",
|
|
@@ -112,7 +112,7 @@
|
|
|
112
112
|
"@types/js-yaml": "^4.0.9",
|
|
113
113
|
"@types/node": "^20.19.37",
|
|
114
114
|
"eslint": "^8.0.0",
|
|
115
|
-
"moflo": "^4.8.
|
|
115
|
+
"moflo": "^4.8.76",
|
|
116
116
|
"tsx": "^4.21.0",
|
|
117
117
|
"typescript": "^5.9.3",
|
|
118
118
|
"vitest": "^4.0.0"
|