@logic-joe/fleek 0.2.10 → 0.2.11

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 +39 -26
  2. package/package.json +1 -1
package/dist/fleek.mjs CHANGED
@@ -4632,7 +4632,7 @@ var require_setup_session = __commonJS({
4632
4632
  exports.SETUP_SESSION_TTL_MINUTES = 30;
4633
4633
  exports.SETUP_SESSION_OPEN_MAX = 10;
4634
4634
  exports.SETUP_SESSION_CLAIM_LIMIT = 10;
4635
- exports.FLEEK_CLI_SETUP_VERSION_DEFAULT = "0.2.10";
4635
+ exports.FLEEK_CLI_SETUP_VERSION_DEFAULT = "0.2.11";
4636
4636
  exports.FLEEK_CLI_PACKAGE = "@logic-joe/fleek";
4637
4637
  exports.FLEEK_CANONICAL_SERVER = "https://api.onfleek.app";
4638
4638
  exports.SETUP_CLIENT_APPS = ["claude-code", "codex", "orca", "cursor", "other"];
@@ -31856,8 +31856,8 @@ var require_secret_shape = __commonJS({
31856
31856
  }
31857
31857
  return hostEnd > start2;
31858
31858
  }
31859
- function scanUrl(text6, start2, end, sep11) {
31860
- const authorityStart = sep11 + 3;
31859
+ function scanUrl(text6, start2, end, sep10) {
31860
+ const authorityStart = sep10 + 3;
31861
31861
  let authorityEnd = authorityStart;
31862
31862
  while (authorityEnd < end) {
31863
31863
  const code = text6.charCodeAt(authorityEnd);
@@ -31868,7 +31868,7 @@ var require_secret_shape = __commonJS({
31868
31868
  for (let i2 = authorityStart; i2 < authorityEnd; i2++)
31869
31869
  if (text6.charCodeAt(i2) === 64)
31870
31870
  return "url_userinfo";
31871
- const scheme = lowerAscii(text6, start2, sep11);
31871
+ const scheme = lowerAscii(text6, start2, sep10);
31872
31872
  if (scheme !== "https" && scheme !== "http" || !validUrlHost(text6, authorityStart, authorityEnd))
31873
31873
  return scanTokens(text6, start2, end, true);
31874
31874
  const head = lowerAscii(text6, start2, Math.min(end, start2 + 48));
@@ -31907,9 +31907,9 @@ var require_secret_shape = __commonJS({
31907
31907
  }
31908
31908
  return null;
31909
31909
  }
31910
- function schemeStart(text6, sep11, floor) {
31911
- let s = sep11;
31912
- const limit = Math.max(floor, sep11 - 32);
31910
+ function schemeStart(text6, sep10, floor) {
31911
+ let s = sep10;
31912
+ const limit = Math.max(floor, sep10 - 32);
31913
31913
  while (s > limit) {
31914
31914
  const code = text6.charCodeAt(s - 1);
31915
31915
  const letter = code >= 65 && code <= 90 || code >= 97 && code <= 122;
@@ -31918,7 +31918,7 @@ var require_secret_shape = __commonJS({
31918
31918
  else
31919
31919
  break;
31920
31920
  }
31921
- while (s < sep11) {
31921
+ while (s < sep10) {
31922
31922
  const code = text6.charCodeAt(s);
31923
31923
  if (code >= 65 && code <= 90 || code >= 97 && code <= 122)
31924
31924
  return s;
@@ -36097,9 +36097,9 @@ var require_dist2 = __commonJS({
36097
36097
  var import_types10 = __toESM(require_dist(), 1);
36098
36098
  import { spawn as spawn9 } from "node:child_process";
36099
36099
  import { createHash as createHash9, randomBytes as randomBytes12 } from "node:crypto";
36100
- import { realpath as realpath20, rm as rm13 } from "node:fs/promises";
36100
+ import { rm as rm13 } from "node:fs/promises";
36101
36101
  import { hostname as osHostname2 } from "node:os";
36102
- import { join as join33, sep as sep10 } from "node:path";
36102
+ import { join as join33 } from "node:path";
36103
36103
  import { parseArgs } from "node:util";
36104
36104
 
36105
36105
  // src/config.ts
@@ -37311,7 +37311,8 @@ var EN = {
37311
37311
  "kit.offline": "Server not reachable: status unknown. The installed kits keep working.",
37312
37312
  "kit.doubleE1": "{target}: Fleek Work Protocol installed twice (global and bundle). Run fleek kit pull again.",
37313
37313
  "kit.disabled": "{kit} removed from the bundle.",
37314
- "kit.cleanupPending": "Not cleaned up yet ({reason}): withdrawn kit files are still in {path}. Fix it and run fleek kit status again.",
37314
+ "kit.cleanupPending": "Not cleaned up yet ({reason}): withdrawn kit files are still in {path}. Fix it and run {command}.",
37315
+ "kit.cleanupPendingSummary": "Not cleaned up yet ({reason}): withdrawn kit files are still in {path}.",
37315
37316
  "kit.none": "No kits.",
37316
37317
  "kit.installed": "installed: {version}",
37317
37318
  "kit.localLine": "{project}: {kits}",
@@ -37493,7 +37494,7 @@ var EN = {
37493
37494
  "errors.kitProjectRequired": "Which project? Pass --project <key or id> (or run it in a pulled checkout).",
37494
37495
  "errors.kitKeyUnknown": "No project you can access has the key {key}.",
37495
37496
  "kit.formerOffline": "Could not check former project {project} (offline) - it is checked again next time.",
37496
- "errors.kitRunCleanupPending": "Withdrawn kit parts are still in {path} (cleanup pending). Not started - fix the reported problem, then run fleek kit status.",
37497
+ "errors.kitRunCleanupPending": "Withdrawn kit parts from project {project} remain in {path}. Fix the reported problem, then run {command}.",
37497
37498
  "errors.kitRunCodexCheckout": "Codex reads kit skills only inside a project checkout. Start fleek kit run codex in the project's git checkout.",
37498
37499
  "errors.kitNoCheckout": "Not a git checkout.",
37499
37500
  "errors.kitNotPulled": "No kits pulled for {project}.",
@@ -38076,7 +38077,8 @@ var DE = {
38076
38077
  "kit.offline": "Server nicht erreichbar: Status unbekannt. Die installierten Kits funktionieren weiter.",
38077
38078
  "kit.doubleE1": "{target}: Fleek Work Protocol doppelt installiert (global und im Bundle). Führe fleek kit pull erneut aus.",
38078
38079
  "kit.disabled": "{kit} aus dem Bundle entfernt.",
38079
- "kit.cleanupPending": "Noch nicht aufgeräumt ({reason}): Zurückgezogene Kit-Dateien liegen noch in {path}. Behebe das und führe fleek kit status erneut aus.",
38080
+ "kit.cleanupPending": "Noch nicht aufgeräumt ({reason}): Zurückgezogene Kit-Dateien liegen noch in {path}. Behebe das und führe {command} aus.",
38081
+ "kit.cleanupPendingSummary": "Noch nicht aufgeräumt ({reason}): Zurückgezogene Kit-Dateien liegen noch in {path}.",
38080
38082
  "kit.none": "Keine Kits.",
38081
38083
  "kit.installed": "installiert: {version}",
38082
38084
  "kit.localLine": "{project}: {kits}",
@@ -38258,7 +38260,7 @@ var DE = {
38258
38260
  "errors.kitProjectRequired": "Welches Projekt? Nutze --project <Schlüssel oder ID> (oder führe es in einem Checkout mit geholten Kits aus).",
38259
38261
  "errors.kitKeyUnknown": "Kein Projekt, auf das du zugreifen kannst, hat den Schlüssel {key}.",
38260
38262
  "kit.formerOffline": "Früheres Projekt {project} konnte nicht geprüft werden (offline) - es wird beim nächsten Mal erneut geprüft.",
38261
- "errors.kitRunCleanupPending": "Zurückgezogene Kit-Teile liegen noch in {path} (Bereinigung ausstehend). Nicht gestartet - behebe das gemeldete Problem und führe dann fleek kit status aus.",
38263
+ "errors.kitRunCleanupPending": "Zurückgezogene Kit-Teile aus Projekt {project} liegen noch in {path}. Behebe das gemeldete Problem und führe dann {command} aus.",
38262
38264
  "errors.kitRunCodexCheckout": "Codex liest Kit-Skills nur in einem Projekt-Checkout. Starte fleek kit run codex im Git-Checkout des Projekts.",
38263
38265
  "errors.kitNoCheckout": "Kein Git-Checkout.",
38264
38266
  "errors.kitNotPulled": "Für {project} sind keine Kits geholt.",
@@ -55945,6 +55947,9 @@ function installedOf(kit2, previous2, downgraded) {
55945
55947
  const minVersion = downgraded ? kit2.version : Math.max(previous2?.minVersion ?? kit2.version, kit2.version);
55946
55948
  return { kitKey: kit2.kitKey, kind: kit2.kind, role: kit2.role, version: kit2.version, versionId: kit2.versionId, contentHash: kit2.contentHash, placement: kit2.placement, minVersion };
55947
55949
  }
55950
+ function cleanupStatusCommand(profileKey2, projectId) {
55951
+ return `fleek --profile ${profileKey2} kit status --project ${projectId}`;
55952
+ }
55948
55953
  var tupleId = (kitKey, version2) => `${kitKey}@${version2}`;
55949
55954
  function checkoutTuples(checkouts) {
55950
55955
  const out = /* @__PURE__ */ new Map();
@@ -56255,7 +56260,7 @@ async function settleFormerProjects(ctx, profile, exclude) {
56255
56260
  return { pending, offline };
56256
56261
  }
56257
56262
  function reportFormer(ctx, settlement) {
56258
- for (const item2 of settlement?.pending ?? []) ctx.out.error(ctx.out.style.warn(ctx.t("kit.cleanupPending", { path: neutralizeLine(item2.root), reason: item2.reason })));
56263
+ for (const item2 of settlement?.pending ?? []) ctx.out.error(ctx.out.style.warn(ctx.t("kit.cleanupPendingSummary", { path: neutralizeLine(item2.root), reason: neutralizeLine(item2.reason) })));
56259
56264
  for (const projectId of settlement?.offline ?? []) ctx.out.error(ctx.out.style.warn(ctx.t("kit.formerOffline", { project: projectId })));
56260
56265
  }
56261
56266
  async function staleKeyRefusal(ctx, profile, project) {
@@ -56414,7 +56419,7 @@ async function kitPull(ctx, projectRef, values, options = {}) {
56414
56419
  for (const entry of listedMcp) ctx.out.line(s.warn(ctx.t("kit.mcpManual", { target: entry.target, entry: s.cmd(neutralizeLine(`${entry.name} ${entry.url}`)) })));
56415
56420
  for (const key of unsigned2) ctx.out.line(s.warn(ctx.t("kit.unsignedPending", { kit: key })));
56416
56421
  ctx.out.line(s.ok(summary.changed ? ctx.t("kit.pulled", { count: installed.length }) : ctx.t("kit.upToDate")));
56417
- for (const pending of skippedRoots) ctx.out.error(s.warn(ctx.t("kit.cleanupPending", { path: neutralizeLine(pending.root), reason: pending.reason })));
56422
+ for (const pending of skippedRoots) ctx.out.error(s.warn(ctx.t("kit.cleanupPending", { path: neutralizeLine(pending.root), reason: neutralizeLine(pending.reason), command: cleanupStatusCommand(profile.key, projectId) })));
56418
56423
  const runnable = targets.find((target) => KIT_CAPABILITIES[target].launcher);
56419
56424
  if (options.nextStep !== false && runnable && !skippedRoots.length && !former.pending.length) {
56420
56425
  ctx.out.line(` ${ctx.t("next.step", { command: s.cmd(`fleek kit run ${runnable}${here ? "" : ` --project ${ref}`}`) })}`);
@@ -56548,7 +56553,7 @@ async function kitStatus(ctx, values, options = {}) {
56548
56553
  for (const [target, value] of Object.entries(e1)) if (value === "both") ctx.out.line(s.warn(ctx.t("kit.doubleE1", { target })));
56549
56554
  for (const key of withdrawn.keys()) ctx.out.line(s.warn(ctx.t("kit.disabled", { kit: key })));
56550
56555
  for (const tuple of checkoutWithdrawn) ctx.out.line(s.warn(ctx.t("kit.disabled", { kit: tuple })));
56551
- for (const pending of cleanupPending) ctx.out.error(s.warn(ctx.t("kit.cleanupPending", { path: neutralizeLine(pending.root), reason: pending.reason })));
56556
+ for (const pending of cleanupPending) ctx.out.error(s.warn(ctx.t("kit.cleanupPending", { path: neutralizeLine(pending.root), reason: neutralizeLine(pending.reason), command: cleanupStatusCommand(profileHint.key, projectId) })));
56552
56557
  if (rows.some((row) => row.state === "update")) {
56553
56558
  ctx.out.line(` ${ctx.t("next.step", { command: s.cmd(`fleek kit pull${values.project ? ` ${neutralizeLine(values.project)}` : ""}`) })}`);
56554
56559
  }
@@ -56640,6 +56645,20 @@ function defaultSpawn(program, args, options) {
56640
56645
  child.once("exit", (code, signal) => done(code ?? (signal ? 128 : 1)));
56641
56646
  });
56642
56647
  }
56648
+ async function assertKitCleanup(ctx, profileKey2) {
56649
+ const pendingCleanup = [];
56650
+ for (const projectId of await localProjects(ctx.configDir, profileKey2)) {
56651
+ for (const item2 of await new KitDomain(ctx.configDir, profileKey2, projectId).cleanupPending()) pendingCleanup.push({ ...item2, projectId });
56652
+ }
56653
+ for (const item2 of pendingCleanup) ctx.out.error(ctx.out.style.warn(ctx.t("kit.cleanupPending", { path: neutralizeLine(item2.root), reason: neutralizeLine(item2.reason), command: cleanupStatusCommand(profileKey2, item2.projectId) })));
56654
+ const here = await realpath16(ctx.deps.cwd ?? process.cwd()).catch(() => null);
56655
+ const blocking = here ? pendingCleanup.find((item2) => here === item2.root || here.startsWith(item2.root + sep8)) : void 0;
56656
+ if (blocking) throw new CliError("errors.kitRunCleanupPending", KIT_EXIT.revokedOrNotEntitled, {
56657
+ path: neutralizeLine(blocking.root),
56658
+ project: blocking.projectId,
56659
+ command: cleanupStatusCommand(profileKey2, blocking.projectId)
56660
+ }, "CLEANUP_PENDING");
56661
+ }
56643
56662
  async function kitRun(ctx, client, values, userArgs) {
56644
56663
  if (!client || !KIT_TARGETS.includes(client)) throw usage2();
56645
56664
  const target = client;
@@ -56664,11 +56683,7 @@ async function kitRun(ctx, client, values, userArgs) {
56664
56683
  else ctx.info(notice);
56665
56684
  }
56666
56685
  }
56667
- const pendingCleanup = await domain.cleanupPending();
56668
- for (const item2 of pendingCleanup) ctx.out.error(ctx.out.style.warn(ctx.t("kit.cleanupPending", { path: neutralizeLine(item2.root), reason: item2.reason })));
56669
- const here = await realpath16(ctx.deps.cwd ?? process.cwd()).catch(() => null);
56670
- const blocking = here ? pendingCleanup.find((item2) => here === item2.root || here.startsWith(item2.root + sep8)) : void 0;
56671
- if (blocking) throw new CliError("errors.kitRunCleanupPending", KIT_EXIT.revokedOrNotEntitled, { path: blocking.root }, "CLEANUP_PENDING");
56686
+ await assertKitCleanup(ctx, profile.key);
56672
56687
  const gen = await domain.current();
56673
56688
  if (!gen) throw new CliError("errors.kitNotPulled", EXIT.failed, { project: projectId }, "KIT_NOT_PULLED");
56674
56689
  const state = gen.state.targets[target];
@@ -60486,12 +60501,10 @@ async function kitAuto(ctx, values, client, passthrough) {
60486
60501
  return await kitRun({ ...kitCtx, deps: { ...ctx.deps, spawn: spawnWith } }, client, { ...values, project: found.projectId, orcaLaunch: true, program }, passthrough);
60487
60502
  } catch (error) {
60488
60503
  if (!(error instanceof CliError) || !["NEEDS_LOGIN", "TRANSIENT", "KIT_PROXY_UNAVAILABLE", "RATE_LIMITED", "UNAVAILABLE_ON_SERVER"].includes(error.code ?? "")) throw error;
60489
- const here = await realpath20(cwd), pending = domain ? await domain.cleanupPending() : [];
60490
- const blocking = pending.find((item2) => here === item2.root || here.startsWith(item2.root + sep10));
60491
- if (blocking) throw new CliError("errors.kitRunCleanupPending", KIT_EXIT.revokedOrNotEntitled, { path: blocking.root }, "CLEANUP_PENDING");
60504
+ await assertKitCleanup(kitCtx, found.profile.key);
60492
60505
  ctx.out.error(ctx.s.warn(ctx.t(values["dry-run"] ? "kit.autoDryRunFallback" : "kit.autoFallback", { code: error instanceof CliError ? error.code ?? error.key : "INTERNAL" })));
60493
60506
  }
60494
- }
60507
+ } else if (found) await assertKitCleanup(kitContext(ctx, values, found), found.profile.key);
60495
60508
  if (values["dry-run"]) {
60496
60509
  ctx.out.json({ program, args: passthrough, attached: false });
60497
60510
  return EXIT.ok;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@logic-joe/fleek",
3
- "version": "0.2.10",
3
+ "version": "0.2.11",
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",