moflo 4.8.71 → 4.8.72

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "moflo",
3
- "version": "4.8.71",
3
+ "version": "4.8.72",
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.70",
115
+ "moflo": "^4.8.71",
116
116
  "tsx": "^4.21.0",
117
117
  "typescript": "^5.9.3",
118
118
  "vitest": "^4.0.0"
@@ -2,5 +2,5 @@
2
2
  * Auto-generated by build. Do not edit manually.
3
3
  * Source of truth: root package.json → scripts/sync-version.mjs
4
4
  */
5
- export const VERSION = '4.8.71';
5
+ export const VERSION = '4.8.72';
6
6
  //# sourceMappingURL=version.js.map
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@moflo/cli",
3
- "version": "4.8.71",
3
+ "version": "4.8.72",
4
4
  "type": "module",
5
5
  "main": "dist/src/index.js",
6
6
  "types": "dist/src/index.d.ts",
@@ -20,7 +20,7 @@ export const DEFAULT_SANDBOX_CONFIG = {
20
20
  tier: 'auto',
21
21
  };
22
22
  /** Recommended image for first-time Windows Docker sandbox setup. */
23
- export const RECOMMENDED_DOCKER_IMAGE = 'node:20-bookworm-slim';
23
+ export const RECOMMENDED_DOCKER_IMAGE = 'node:20-bookworm';
24
24
  // ============================================================================
25
25
  // Detection (cached)
26
26
  // ============================================================================
@@ -174,19 +174,20 @@ export function resolveEffectiveSandbox(config, capability = detectSandboxCapabi
174
174
  displayStatus: `OS sandbox: disabled (denylist active)`,
175
175
  };
176
176
  }
177
- // Windows: give beginner-friendly setup instructions when sandboxing is
178
- // enabled but Docker isn't ready. Runs before the generic "not available"
179
- // branch so Windows users see actionable guidance instead of a terse
180
- // "not available (win32)" message.
177
+ // Windows: Docker is required for OS sandboxing. If Docker is available,
178
+ // auto-default the image and auto-pull it on first use so the user doesn't
179
+ // have to do manual setup. Only throw if Docker itself isn't installed/running.
181
180
  if (capability.platform === 'win32') {
182
181
  if (!capability.available) {
183
182
  throw new Error(formatWindowsDockerNotReadyMessage());
184
183
  }
184
+ const image = config.dockerImage || RECOMMENDED_DOCKER_IMAGE;
185
185
  if (!config.dockerImage) {
186
- throw new Error(formatWindowsDockerImageMissingMessage());
186
+ // Mutate config to carry the defaulted image through the rest of the pipeline
187
+ config = { ...config, dockerImage: image };
187
188
  }
188
- if (!dockerImageExists(config.dockerImage)) {
189
- throw new Error(formatWindowsDockerImageNotPulledMessage(config.dockerImage));
189
+ if (!dockerImageExists(image)) {
190
+ dockerPullImage(image);
190
191
  }
191
192
  }
192
193
  // tier: full — require OS sandbox on non-Windows platforms
@@ -222,6 +223,22 @@ function dockerImageExists(image) {
222
223
  return false;
223
224
  }
224
225
  }
226
+ /**
227
+ * Pull a Docker image, printing a one-time setup banner so the user knows
228
+ * what's happening and why. Throws if the pull fails.
229
+ */
230
+ function dockerPullImage(image) {
231
+ console.log(`[spell] One-time setup: pulling Docker image ${image} for sandboxing...\n` +
232
+ ` This only happens once — Docker caches the image afterwards.`);
233
+ try {
234
+ execSync(`docker pull ${shellQuote(image)}`, { stdio: 'inherit', timeout: 300_000 });
235
+ console.log(`[spell] Docker image ${image} is ready.`);
236
+ }
237
+ catch {
238
+ throw new Error(`Failed to pull Docker image "${image}".\n\n` +
239
+ 'Make sure Docker Desktop is running and you have internet access, then try again.');
240
+ }
241
+ }
225
242
  /** Minimal shell quoting for image names — keeps the execSync call safe. */
226
243
  function shellQuote(value) {
227
244
  return `"${value.replace(/"/g, '\\"')}"`;
@@ -241,51 +258,13 @@ function formatWindowsDockerNotReadyMessage() {
241
258
  ' Wait for the whale icon in your system tray to stop animating —',
242
259
  ' that means Docker is ready.',
243
260
  '',
244
- ' 3. Open PowerShell (or any terminal) and pull the recommended image:',
245
- ` docker pull ${RECOMMENDED_DOCKER_IMAGE}`,
246
- '',
247
- ' 4. Add this to your moflo.yaml:',
248
- ' sandbox:',
249
- ' enabled: true',
250
- ` dockerImage: ${RECOMMENDED_DOCKER_IMAGE}`,
261
+ `MoFlo will auto-pull the default image (${RECOMMENDED_DOCKER_IMAGE}) on`,
262
+ 'the first spell run.',
251
263
  '',
252
- 'Not ready to set this up? You can turn sandboxing off instead by setting',
264
+ 'Not ready to set this up? Turn sandboxing off by setting',
253
265
  '`sandbox.enabled: false` in moflo.yaml.',
254
266
  ].join('\n');
255
267
  }
256
- function formatWindowsDockerImageMissingMessage() {
257
- return [
258
- 'Sandboxing is enabled, but no Docker image is configured.',
259
- '',
260
- 'Docker is ready on this machine — it just needs to know which image to',
261
- 'run your spell steps inside. This is a one-time setup:',
262
- '',
263
- ' 1. Open PowerShell (or any terminal) and pull the recommended image:',
264
- ` docker pull ${RECOMMENDED_DOCKER_IMAGE}`,
265
- '',
266
- ' 2. Add this to your moflo.yaml:',
267
- ' sandbox:',
268
- ' enabled: true',
269
- ` dockerImage: ${RECOMMENDED_DOCKER_IMAGE}`,
270
- '',
271
- `The recommended image (${RECOMMENDED_DOCKER_IMAGE}) includes node, npm,`,
272
- 'bash, git, and curl. Any image with bash will work.',
273
- ].join('\n');
274
- }
275
- function formatWindowsDockerImageNotPulledMessage(image) {
276
- return [
277
- `Sandboxing is enabled, but the Docker image "${image}" is not available`,
278
- 'on this machine yet.',
279
- '',
280
- 'To fix this, open PowerShell (or any terminal) and run:',
281
- ` docker pull ${image}`,
282
- '',
283
- 'This only needs to happen once — Docker caches the image afterwards.',
284
- '',
285
- 'If Docker Desktop is not running, start it from the Start menu first',
286
- 'and wait for the whale icon in your system tray to stop animating.',
287
- ].join('\n');
288
- }
289
268
  /**
290
269
  * Format a one-line log message for spell startup.
291
270
  */