@logic-joe/fleek 0.2.14 → 0.2.15

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.
Files changed (2) hide show
  1. package/dist/fleek.mjs +68 -13
  2. package/package.json +1 -1
package/dist/fleek.mjs CHANGED
@@ -4652,7 +4652,7 @@ var require_setup_session = __commonJS({
4652
4652
  exports.SETUP_SESSION_TTL_MINUTES = 30;
4653
4653
  exports.SETUP_SESSION_OPEN_MAX = 10;
4654
4654
  exports.SETUP_SESSION_CLAIM_LIMIT = 10;
4655
- exports.FLEEK_CLI_SETUP_VERSION_DEFAULT = "0.2.14";
4655
+ exports.FLEEK_CLI_SETUP_VERSION_DEFAULT = "0.2.15";
4656
4656
  exports.FLEEK_CLI_PACKAGE = "@logic-joe/fleek";
4657
4657
  exports.FLEEK_CANONICAL_SERVER = "https://api.onfleek.app";
4658
4658
  exports.SETUP_CLIENT_APPS = ["claude-code", "codex", "orca", "cursor", "other"];
@@ -37484,6 +37484,7 @@ var EN = {
37484
37484
  "errors.setupInstall": "The pinned CLI could not be installed permanently.",
37485
37485
  "init.agentMissing": "Claude Code was not found. Manual mode is available.",
37486
37486
  "init.agentUnknown": "Claude Code {version} is not yet verified for the analysis.",
37487
+ "init.agentOutdated": "Claude Code {version} is older than {minimum} and likely fails the analysis. Run claude update first.",
37487
37488
  "init.confirmUnknownAgent": "Start it anyway with the same safety settings? (y/N)",
37488
37489
  "init.agentBoundary": "Claude receives the prepared files with MCP, hooks and customizations disabled. Your provider sign-in remains available; this does not isolate the whole computer.",
37489
37490
  "init.confirmAgent": "Start the read-only analysis now? (y/N)",
@@ -37491,7 +37492,14 @@ var EN = {
37491
37492
  "errors.initAgentTimeout": "The analysis timed out; the agent was stopped.",
37492
37493
  "errors.initAgentOutput": "The agent output exceeds the allowed size; nothing sent.",
37493
37494
  "errors.initAgentStart": "Could not start Claude Code directly. Use --agent manual --verbose.",
37494
- "errors.initAgentFailed": "Claude exited with code {code}. Shell aliases/functions are bypassed; update Claude or use --agent manual --verbose.",
37495
+ "errors.initAgentFailed": "Claude exited with code {code} for an unknown reason; its output is not shown here. Rerun with --agent manual --verbose: Claude's own message is then in agent-output.json.tmp in the output directory.",
37496
+ "errors.initAgentFailed.next": "fleek init --agent manual --verbose",
37497
+ "errors.initAgentSignIn": "Claude is not signed in or its sign-in is no longer valid (code {code}). Sign in again, then rerun fleek init.",
37498
+ "errors.initAgentSignIn.next": "claude auth login",
37499
+ "errors.initAgentVersion": "Claude Code does not support the analysis start (code {code}); it is probably outdated. Update it, then rerun fleek init.",
37500
+ "errors.initAgentVersion.next": "claude update",
37501
+ "errors.initAgentRateLimit": "Claude reports a rate limit or overload (code {code}). Wait a moment, then rerun fleek init.",
37502
+ "errors.initAgentNetwork": "Claude could not reach its service (code {code}). Check the network connection, then rerun fleek init.",
37495
37503
  "errors.initManualFallback": "Automatic analysis was not started. Continue with --agent manual --verbose.",
37496
37504
  "login.serviceVisit": "Open {url} on your own computer and enter code {code}",
37497
37505
  "login.serviceSetupConfirm": 'Confirm in the Fleek window where you generated the command ("Server asks to sign in"). Code: {code}',
@@ -37922,7 +37930,7 @@ var EN = {
37922
37930
  "init.detected": "Detected: {sources}",
37923
37931
  "init.detectedNone": "no verified design sources",
37924
37932
  "init.manualCommand": "In a separate terminal, with approved current Claude Code (keep every isolation flag):",
37925
- "init.manualCommandHint": "Copy it whole, with the outer parentheses. command claude bypasses shell aliases and functions; keep every isolation flag.",
37933
+ "init.manualCommandHint": "Copy it whole, with the outer parentheses. command claude bypasses shell aliases and functions; keep every isolation flag. If Claude fails, its message is in agent-output.json.tmp in the output directory.",
37926
37934
  "init.manualPrompt": "Read FLEEK-INIT.md and fleek-input.json. Read only the staged files. Return only the agent-output.json JSON object on stdout, without Markdown; the launcher saves it. Do not write files, run commands, use MCP or access the network.",
37927
37935
  "init.manualBoundary": "You start the agent yourself: the file selection is only a recommendation, the agent may read more on your machine.",
37928
37936
  "init.outputTimeout": "{app}: no output file in time.",
@@ -38251,6 +38259,7 @@ var DE = {
38251
38259
  "errors.setupInstall": "Die festgelegte CLI-Version konnte nicht dauerhaft installiert werden.",
38252
38260
  "init.agentMissing": "Claude Code wurde nicht gefunden. Der manuelle Modus ist verfügbar.",
38253
38261
  "init.agentUnknown": "Claude Code {version} ist für die Analyse noch nicht geprüft.",
38262
+ "init.agentOutdated": "Claude Code {version} ist älter als {minimum} und scheitert wahrscheinlich an der Analyse. Führe zuerst claude update aus.",
38254
38263
  "init.confirmUnknownAgent": "Trotzdem mit denselben Schutzeinstellungen starten? (j/N)",
38255
38264
  "init.agentBoundary": "Claude erhält die vorbereiteten Dateien; MCP, Hooks und Anpassungen sind deaktiviert. Deine Anbieteranmeldung bleibt verfügbar; der Rechner wird dabei nicht vollständig isoliert.",
38256
38265
  "init.confirmAgent": "Die Analyse jetzt nur lesend starten? (j/N)",
@@ -38258,7 +38267,14 @@ var DE = {
38258
38267
  "errors.initAgentTimeout": "Die Analyse hat die Frist überschritten; der Agent wurde gestoppt.",
38259
38268
  "errors.initAgentOutput": "Die Agentenausgabe überschreitet die erlaubte Größe; nichts gesendet.",
38260
38269
  "errors.initAgentStart": "Claude Code konnte nicht direkt gestartet werden. Nutze --agent manual --verbose.",
38261
- "errors.initAgentFailed": "Claude wurde mit Code {code} beendet. Shell-Aliase und Funktionen werden umgangen; aktualisiere Claude oder nutze --agent manual --verbose.",
38270
+ "errors.initAgentFailed": "Claude wurde aus unbekanntem Grund mit Code {code} beendet; seine Ausgabe wird hier nicht angezeigt. Starte erneut mit --agent manual --verbose: Claudes eigene Meldung steht dann in agent-output.json.tmp im Ausgabeverzeichnis.",
38271
+ "errors.initAgentFailed.next": "fleek init --agent manual --verbose",
38272
+ "errors.initAgentSignIn": "Claude ist nicht angemeldet oder die Anmeldung ist nicht mehr gültig (Code {code}). Melde dich neu an und starte fleek init dann erneut.",
38273
+ "errors.initAgentSignIn.next": "claude auth login",
38274
+ "errors.initAgentVersion": "Claude Code unterstützt den Analysestart nicht (Code {code}); vermutlich ist es veraltet. Aktualisiere es und starte fleek init dann erneut.",
38275
+ "errors.initAgentVersion.next": "claude update",
38276
+ "errors.initAgentRateLimit": "Claude meldet ein Nutzungslimit oder eine Überlastung (Code {code}). Warte kurz und starte fleek init dann erneut.",
38277
+ "errors.initAgentNetwork": "Claude konnte seinen Dienst nicht erreichen (Code {code}). Prüfe die Netzwerkverbindung und starte fleek init dann erneut.",
38262
38278
  "errors.initManualFallback": "Die automatische Analyse wurde nicht gestartet. Fahre mit --agent manual --verbose fort.",
38263
38279
  "login.serviceVisit": "Öffne {url} am eigenen Rechner und gib den Code {code} ein.",
38264
38280
  "login.serviceSetupConfirm": "Bestätige im Fleek-Fenster, in dem du den Befehl erzeugt hast (‚Server fragt Anmeldung an‘). Code: {code}",
@@ -38689,7 +38705,7 @@ var DE = {
38689
38705
  "init.detected": "Erkannt: {sources}",
38690
38706
  "init.detectedNone": "keine belegten Design-Quellen",
38691
38707
  "init.manualCommand": "In einem separaten Terminal mit freigegebenem aktuellem Claude Code (alle Isolationsflags beibehalten):",
38692
- "init.manualCommandHint": "Ganz kopieren, mit den äußeren Klammern. command claude umgeht Shell-Aliase und Funktionen; behalte alle Isolationsflags bei.",
38708
+ "init.manualCommandHint": "Ganz kopieren, mit den äußeren Klammern. command claude umgeht Shell-Aliase und Funktionen; behalte alle Isolationsflags bei. Scheitert Claude, steht seine Meldung in agent-output.json.tmp im Ausgabeverzeichnis.",
38693
38709
  "init.manualPrompt": "Lies FLEEK-INIT.md und fleek-input.json. Lies nur die bereitgestellten Dateien. Gib nur das JSON-Objekt für agent-output.json auf stdout aus, ohne Markdown; der Startbefehl speichert es. Keine Dateien schreiben, keine Befehle, kein MCP und kein Netzzugriff.",
38694
38710
  "init.manualBoundary": "Du startest den Agenten selbst: Die Dateiauswahl ist nur eine Empfehlung, der Agent kann auf deinem Rechner mehr lesen.",
38695
38711
  "init.outputTimeout": "{app}: keine Ausgabedatei innerhalb der Frist.",
@@ -51147,7 +51163,7 @@ var KIT_CAPABILITIES = Object.freeze({
51147
51163
  checkout: { filePrefix: ".claude/", instructions: "CLAUDE.md", mcpFile: ".mcp.json", mcpWithType: true },
51148
51164
  globalE1: { path: ".claude/skills/fleek-work/SKILL.md" },
51149
51165
  verifiedWith: "Claude Code 2.1.303",
51150
- initIsolation: ["2.1.310"]
51166
+ initIsolation: ["2.1.310", "2.1.319"]
51151
51167
  },
51152
51168
  // Orca terminals run Claude Code: same mechanism, Orca rendering (plan §4.4 "Orca as Claude").
51153
51169
  orca: {
@@ -51157,7 +51173,7 @@ var KIT_CAPABILITIES = Object.freeze({
51157
51173
  checkout: { filePrefix: ".claude/", instructions: "CLAUDE.md", mcpFile: ".mcp.json", mcpWithType: true },
51158
51174
  globalE1: { path: ".claude/skills/fleek-work/SKILL.md" },
51159
51175
  verifiedWith: "Claude Code 2.1.303 (inside Orca)",
51160
- initIsolation: ["2.1.310"]
51176
+ initIsolation: ["2.1.310", "2.1.319"]
51161
51177
  },
51162
51178
  codex: {
51163
51179
  target: "codex",
@@ -51991,6 +52007,19 @@ function initAgentEnv(env) {
51991
52007
  }
51992
52008
  return result;
51993
52009
  }
52010
+ var CLASS_LINES = 5;
52011
+ var FAILURE_CLASSES = [
52012
+ // 401 only with an HTTP/auth context, never a bare number (a file diagnosis "line 401" is not a sign-in failure)
52013
+ ["signIn", /Not logged in|Failed to authenticate|\bauthentication[_ ](?:error|failed)\b|\b401 Unauthorized\b|\b(?:HTTP|status(?: code)?:?)\s*401\b|\b(?:OAuth )?token (?:has been |was )?(?:revoked|expired)\b|Invalid API key/i],
52014
+ ["version", /\b(?:unknown|unrecognized) (?:option|argument|flag)\b|\bclaude update\b|\b(?:requires|needs) (?:a )?newer version\b|\bversion\b.*\b(?:not supported|unsupported|outdated)\b/i],
52015
+ ["rateLimit", /\brate[ _-]?limit|\boverloaded(?:_error)?\b|\busage limit\b|\b429 Too Many Requests\b|\b(?:HTTP|status(?: code)?:?)\s*(?:429|529)\b/i],
52016
+ ["network", /\b(?:ECONNREFUSED|ECONNRESET|ENOTFOUND|ETIMEDOUT|EAI_AGAIN|ENETUNREACH)\b|\bnetwork error\b|\bsocket hang up\b|\bfetch failed\b|\bunable to connect\b/i]
52017
+ ];
52018
+ function classifyInitFailure(result) {
52019
+ const tail = `${result.stderr ?? ""}
52020
+ ${result.stdout}`.split(/\r?\n/).filter((line) => line.trim()).slice(-CLASS_LINES).join("\n");
52021
+ return FAILURE_CLASSES.find(([, pattern]) => pattern.test(tail))?.[0] ?? "unknown";
52022
+ }
51994
52023
  var runInitProcess = (program, args, options) => new Promise((resolve9, reject) => {
51995
52024
  if (options.signal?.aborted) {
51996
52025
  reject(new CliError("errors.aborted", EXIT.failed, {}, "ABORTED"));
@@ -52001,9 +52030,10 @@ var runInitProcess = (program, args, options) => new Promise((resolve9, reject)
52001
52030
  env: options.env,
52002
52031
  shell: false,
52003
52032
  detached: process.platform !== "win32",
52004
- stdio: ["ignore", "pipe", "ignore"]
52033
+ stdio: ["ignore", "pipe", "pipe"]
52005
52034
  });
52006
52035
  const chunks = [];
52036
+ let errorTail = Buffer.alloc(0);
52007
52037
  let bytes = 0, failure2;
52008
52038
  const kill = (signal) => {
52009
52039
  try {
@@ -52028,6 +52058,10 @@ var runInitProcess = (program, args, options) => new Promise((resolve9, reject)
52028
52058
  if (bytes > options.maxBytes) stop(new CliError("errors.initAgentOutput", EXIT.failed, {}, "AGENT_OUTPUT_LIMIT"));
52029
52059
  else chunks.push(chunk);
52030
52060
  });
52061
+ child.stderr.on("data", (chunk) => {
52062
+ errorTail = Buffer.concat([errorTail, chunk]);
52063
+ if (errorTail.length > options.maxBytes) errorTail = errorTail.subarray(errorTail.length - options.maxBytes);
52064
+ });
52031
52065
  const cleanup = () => {
52032
52066
  clearTimeout(timer);
52033
52067
  if (hard) clearTimeout(hard);
@@ -52040,7 +52074,7 @@ var runInitProcess = (program, args, options) => new Promise((resolve9, reject)
52040
52074
  child.once("close", (code) => {
52041
52075
  cleanup();
52042
52076
  if (failure2) reject(failure2);
52043
- else resolve9({ code: code ?? 1, stdout: Buffer.concat(chunks).toString("utf8") });
52077
+ else resolve9({ code: code ?? 1, stdout: Buffer.concat(chunks).toString("utf8"), stderr: errorTail.toString("utf8") });
52044
52078
  });
52045
52079
  });
52046
52080
 
@@ -57328,6 +57362,19 @@ async function ask(ctx, lines) {
57328
57362
  rl.close();
57329
57363
  }
57330
57364
  }
57365
+ var MIN_INIT_CLAUDE = "2.1.310";
57366
+ function olderThan(version2, minimum) {
57367
+ const a = version2.split(".").map(Number), b = minimum.split(".").map(Number);
57368
+ for (let i = 0; i < 3; i++) if (a[i] !== b[i]) return a[i] < b[i];
57369
+ return false;
57370
+ }
57371
+ var AGENT_FAILURE_KEYS = {
57372
+ signIn: "errors.initAgentSignIn",
57373
+ version: "errors.initAgentVersion",
57374
+ rateLimit: "errors.initAgentRateLimit",
57375
+ network: "errors.initAgentNetwork",
57376
+ unknown: "errors.initAgentFailed"
57377
+ };
57331
57378
  async function startAgent(ctx, values, stagingDir, outputFile, timeoutMs, app) {
57332
57379
  if (values.agent !== "claude") return false;
57333
57380
  const program = await resolveExecutable("claude", ctx.env);
@@ -57340,7 +57387,8 @@ async function startAgent(ctx, values, stagingDir, outputFile, timeoutMs, app) {
57340
57387
  const versionResult = await run2(program, ["--version"], { cwd: stagingDir, env, signal: ctx.deps.signal, timeoutMs: 1e4, maxBytes: 1024 });
57341
57388
  const version2 = versionResult.code === 0 ? versionResult.stdout.trim().match(/^(\d+\.\d+\.\d+) \(Claude Code\)$/)?.[1] : void 0;
57342
57389
  if (!version2 || !KIT_CAPABILITIES.claude.initIsolation?.includes(version2)) {
57343
- if (!await ask(ctx, [ctx.t("init.agentUnknown", { version: version2 ?? "?" }), ctx.t("init.confirmUnknownAgent")])) return false;
57390
+ const outdated = !!version2 && olderThan(version2, MIN_INIT_CLAUDE);
57391
+ if (!await ask(ctx, [ctx.t(outdated ? "init.agentOutdated" : "init.agentUnknown", { version: version2 ?? "?", minimum: MIN_INIT_CLAUDE }), ctx.t("init.confirmUnknownAgent")])) return false;
57344
57392
  }
57345
57393
  if (!await ask(ctx, [ctx.t("init.agentBoundary"), ctx.t("init.confirmAgent")])) return false;
57346
57394
  if (values.verbose && !ctx.json) ctx.info(ctx.out.style.cmd(neutralizeLine(program)));
@@ -57353,7 +57401,10 @@ async function startAgent(ctx, values, stagingDir, outputFile, timeoutMs, app) {
57353
57401
  timeoutMs: Math.max(1, timeoutMs),
57354
57402
  maxBytes: import_validation3.PROJECT_INIT_LIMITS.summaryBytes
57355
57403
  }));
57356
- if (result.code !== 0) throw new CliError("errors.initAgentFailed", EXIT.failed, { code: result.code }, "AGENT_FAILED");
57404
+ if (result.code !== 0) {
57405
+ const diagnosis = classifyInitFailure(result);
57406
+ throw new CliError(AGENT_FAILURE_KEYS[diagnosis], EXIT.failed, { code: result.code, diagnosis }, "AGENT_FAILED");
57407
+ }
57357
57408
  const temporary = `${outputFile}.tmp`;
57358
57409
  await writeFile6(temporary, result.stdout, { mode: 384, flag: "wx" });
57359
57410
  await rename4(temporary, outputFile);
@@ -57560,8 +57611,12 @@ async function initCommand(ctx, values) {
57560
57611
  failed2++;
57561
57612
  if (error instanceof CliError && error.code === "UNKNOWN_OUTCOME") unknownOutcome = true;
57562
57613
  if (error instanceof CliError && error.exitCode === EXIT.needsLogin) throw error;
57563
- emit(ctx, { event: "error", app: app.key, code: errorCode(error) });
57564
- if (!ctx.json) ctx.out.error(s.fail(error instanceof CliError && /^AGENT_/.test(error.code ?? "") ? ctx.t(error.key, error.params) : ctx.t("init.appFailed", { app: app.key, code: errorCode(error) })));
57614
+ const agentError = error instanceof CliError && /^AGENT_/.test(error.code ?? "") ? error : null;
57615
+ emit(ctx, { event: "error", app: app.key, code: errorCode(error), ...typeof agentError?.params.diagnosis === "string" ? { diagnosis: agentError.params.diagnosis } : {} });
57616
+ if (!ctx.json) {
57617
+ ctx.out.error(s.fail(agentError ? ctx.t(agentError.key, agentError.params) : ctx.t("init.appFailed", { app: app.key, code: errorCode(error) })));
57618
+ if (agentError && `${agentError.key}.next` in EN) ctx.out.error(` ${ctx.t("next.step", { command: s.cmd(ctx.t(`${agentError.key}.next`)) })}`);
57619
+ }
57565
57620
  }
57566
57621
  }
57567
57622
  if (values.keep && !unknownOutcome) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@logic-joe/fleek",
3
- "version": "0.2.14",
3
+ "version": "0.2.15",
4
4
  "description": "fleek - command line client for the Fleek agent hub (MCP over OAuth, OS keychain, signed role/project kits)",
5
5
  "license": "Apache-2.0",
6
6
  "type": "module",