moflo 4.8.76 → 4.8.78
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.78",
|
|
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.77",
|
|
116
116
|
"tsx": "^4.21.0",
|
|
117
117
|
"typescript": "^5.9.3",
|
|
118
118
|
"vitest": "^4.0.0"
|
|
@@ -173,6 +173,20 @@ export function buildDockerArgs(command, capabilities, projectRoot, options) {
|
|
|
173
173
|
mountedContainerPaths.add(containerPath);
|
|
174
174
|
}
|
|
175
175
|
}
|
|
176
|
+
// Override git credential.helper to the gh CLI helper. The host's
|
|
177
|
+
// bind-mounted .gitconfig declares a helper that can't run in the
|
|
178
|
+
// Linux container (Windows: `manager` .exe; macOS: `osxkeychain`;
|
|
179
|
+
// Linux: libsecret/etc — all host-OS-specific). gh is installed in
|
|
180
|
+
// the sandbox image and `.config/gh` is bind-mounted, so
|
|
181
|
+
// `gh auth git-credential` supplies the token for HTTPS git ops.
|
|
182
|
+
// First entry (empty value) resets the inherited helper list; the
|
|
183
|
+
// second entry installs the gh helper as the only one. Applied via
|
|
184
|
+
// GIT_CONFIG_* env vars so no config file is modified.
|
|
185
|
+
args.push('-e', 'GIT_CONFIG_COUNT=2');
|
|
186
|
+
args.push('-e', 'GIT_CONFIG_KEY_0=credential.helper');
|
|
187
|
+
args.push('-e', 'GIT_CONFIG_VALUE_0=');
|
|
188
|
+
args.push('-e', 'GIT_CONFIG_KEY_1=credential.helper');
|
|
189
|
+
args.push('-e', 'GIT_CONFIG_VALUE_1=!gh auth git-credential');
|
|
176
190
|
}
|
|
177
191
|
// ── Network isolation ───────────────────────────────────────────────
|
|
178
192
|
const hasNet = capabilities.some(c => c.type === 'net');
|