@logic-joe/fleek 0.2.13 → 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 +71 -15
  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.13";
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"];
@@ -36131,6 +36131,7 @@ var require_agent_error_details = __commonJS({
36131
36131
  TICKET_TEXT_LIMIT: {},
36132
36132
  TICKET_TEXT_FORMAT: {},
36133
36133
  TICKET_TEXT_LOSSY_REPLACEMENT: {},
36134
+ NOT_FOUND: { reason: oneOf3(["no_setup"]) },
36134
36135
  ACCESS_DENIED: { reason: oneOf3(["approval_denied", "field_right", "variant_admin"]), field: bindingField, changeRequest },
36135
36136
  // ENGINE-AUTHORITY: engine setup refusals (`workflows.engine.*`) - closed lists only
36136
36137
  CONFLICT: {
@@ -36149,7 +36150,7 @@ var require_agent_error_details = __commonJS({
36149
36150
  // PRIVACY-WORKCTX: additive `holderRef` (person ref of the holder, null without a handle key / release owner)
36150
36151
  ALREADY_CLAIMED: { holderLabel: string4, expiresAt: string4, holderRef: personRef },
36151
36152
  CLAIMED_BY_OTHER: { holderLabel: string4, expiresAt: string4, holderRef: personRef },
36152
- CLAIM_REQUIRED: { issueIds: list2 },
36153
+ CLAIM_REQUIRED: { issueIds: list2, requiredPurpose: oneOf3(["work"]), providedPurpose: oneOf3(["review"]) },
36153
36154
  RENEW_LIMIT: { hardExpiresAt: string4 },
36154
36155
  NOT_READY: { readySelector: string4 },
36155
36156
  REVISION_CONFLICT: { currentRevision: integer },
@@ -37483,6 +37484,7 @@ var EN = {
37483
37484
  "errors.setupInstall": "The pinned CLI could not be installed permanently.",
37484
37485
  "init.agentMissing": "Claude Code was not found. Manual mode is available.",
37485
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.",
37486
37488
  "init.confirmUnknownAgent": "Start it anyway with the same safety settings? (y/N)",
37487
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.",
37488
37490
  "init.confirmAgent": "Start the read-only analysis now? (y/N)",
@@ -37490,7 +37492,14 @@ var EN = {
37490
37492
  "errors.initAgentTimeout": "The analysis timed out; the agent was stopped.",
37491
37493
  "errors.initAgentOutput": "The agent output exceeds the allowed size; nothing sent.",
37492
37494
  "errors.initAgentStart": "Could not start Claude Code directly. Use --agent manual --verbose.",
37493
- "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.",
37494
37503
  "errors.initManualFallback": "Automatic analysis was not started. Continue with --agent manual --verbose.",
37495
37504
  "login.serviceVisit": "Open {url} on your own computer and enter code {code}",
37496
37505
  "login.serviceSetupConfirm": 'Confirm in the Fleek window where you generated the command ("Server asks to sign in"). Code: {code}',
@@ -37921,7 +37930,7 @@ var EN = {
37921
37930
  "init.detected": "Detected: {sources}",
37922
37931
  "init.detectedNone": "no verified design sources",
37923
37932
  "init.manualCommand": "In a separate terminal, with approved current Claude Code (keep every isolation flag):",
37924
- "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.",
37925
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.",
37926
37935
  "init.manualBoundary": "You start the agent yourself: the file selection is only a recommendation, the agent may read more on your machine.",
37927
37936
  "init.outputTimeout": "{app}: no output file in time.",
@@ -38250,6 +38259,7 @@ var DE = {
38250
38259
  "errors.setupInstall": "Die festgelegte CLI-Version konnte nicht dauerhaft installiert werden.",
38251
38260
  "init.agentMissing": "Claude Code wurde nicht gefunden. Der manuelle Modus ist verfügbar.",
38252
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.",
38253
38263
  "init.confirmUnknownAgent": "Trotzdem mit denselben Schutzeinstellungen starten? (j/N)",
38254
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.",
38255
38265
  "init.confirmAgent": "Die Analyse jetzt nur lesend starten? (j/N)",
@@ -38257,7 +38267,14 @@ var DE = {
38257
38267
  "errors.initAgentTimeout": "Die Analyse hat die Frist überschritten; der Agent wurde gestoppt.",
38258
38268
  "errors.initAgentOutput": "Die Agentenausgabe überschreitet die erlaubte Größe; nichts gesendet.",
38259
38269
  "errors.initAgentStart": "Claude Code konnte nicht direkt gestartet werden. Nutze --agent manual --verbose.",
38260
- "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.",
38261
38278
  "errors.initManualFallback": "Die automatische Analyse wurde nicht gestartet. Fahre mit --agent manual --verbose fort.",
38262
38279
  "login.serviceVisit": "Öffne {url} am eigenen Rechner und gib den Code {code} ein.",
38263
38280
  "login.serviceSetupConfirm": "Bestätige im Fleek-Fenster, in dem du den Befehl erzeugt hast (‚Server fragt Anmeldung an‘). Code: {code}",
@@ -38688,7 +38705,7 @@ var DE = {
38688
38705
  "init.detected": "Erkannt: {sources}",
38689
38706
  "init.detectedNone": "keine belegten Design-Quellen",
38690
38707
  "init.manualCommand": "In einem separaten Terminal mit freigegebenem aktuellem Claude Code (alle Isolationsflags beibehalten):",
38691
- "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.",
38692
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.",
38693
38710
  "init.manualBoundary": "Du startest den Agenten selbst: Die Dateiauswahl ist nur eine Empfehlung, der Agent kann auf deinem Rechner mehr lesen.",
38694
38711
  "init.outputTimeout": "{app}: keine Ausgabedatei innerhalb der Frist.",
@@ -51146,7 +51163,7 @@ var KIT_CAPABILITIES = Object.freeze({
51146
51163
  checkout: { filePrefix: ".claude/", instructions: "CLAUDE.md", mcpFile: ".mcp.json", mcpWithType: true },
51147
51164
  globalE1: { path: ".claude/skills/fleek-work/SKILL.md" },
51148
51165
  verifiedWith: "Claude Code 2.1.303",
51149
- initIsolation: ["2.1.310"]
51166
+ initIsolation: ["2.1.310", "2.1.319"]
51150
51167
  },
51151
51168
  // Orca terminals run Claude Code: same mechanism, Orca rendering (plan §4.4 "Orca as Claude").
51152
51169
  orca: {
@@ -51156,7 +51173,7 @@ var KIT_CAPABILITIES = Object.freeze({
51156
51173
  checkout: { filePrefix: ".claude/", instructions: "CLAUDE.md", mcpFile: ".mcp.json", mcpWithType: true },
51157
51174
  globalE1: { path: ".claude/skills/fleek-work/SKILL.md" },
51158
51175
  verifiedWith: "Claude Code 2.1.303 (inside Orca)",
51159
- initIsolation: ["2.1.310"]
51176
+ initIsolation: ["2.1.310", "2.1.319"]
51160
51177
  },
51161
51178
  codex: {
51162
51179
  target: "codex",
@@ -51734,7 +51751,7 @@ var USER_SKILL_MARKER = "<!-- Generated by scripts/agent-guidance/generate.mjs f
51734
51751
  var USER_SKILLS = [
51735
51752
  {
51736
51753
  "name": "fleek-orca-coordinator",
51737
- "content": "---\nname: fleek-orca-coordinator\ndescription: \"Coordinate Fleek tickets in Orca: find claimable work, claim it for this machine, start a builder in its own worktree with the project kit, review with the other model, leave gates to people and deliver to review. Use when you coordinate Orca agents for a Fleek project.\"\nmetadata:\n protocol: fleek-work-protocol/1.13\n---\n\n<!-- Generated by scripts/agent-guidance/generate.mjs from scripts/agent-guidance/protocol.json - do not edit by hand. -->\n\n# Fleek in Orca: coordinator recipe\n\nFleek holds the tickets and every human decision; Orca runs worktrees and agents. Follow the fleek-work skill for every Fleek call. Never change Orca's code or settings.\n\n## 1. Ready check\n- `fleek doctor` in the repo: Fleek MCP current for Claude Code, Codex and every Orca account, repo bound to its Fleek project. Otherwise ask the person to run the setup command from Fleek once per machine (Settings › Connections › Set up this computer: `fleek setup <code>`). Never sign in for them.\n\n## 2. Find work\n- fleek_find_work and fleek_my_work_inbox (claimable: agent-ready or assigned to your person; addressed work first); `fleek orca tasks` lists the project's open tickets. Take only status roles where agents work: intake_review, ready, analysis, design, implementation, review. Skip tickets another holder claims.\n- Read stage in fleek_get_work_context before starting a worker, then use this role table. Do not infer a role from the displayed status name or from the ticket title.\n\n| Status role | Work and delivery |\n| --- | --- |\n| intake_review | One triage agent: duplicates, criteria and readiness; no product code or PR. |\n| ready | Claim, then re-read the live stage and use its row. A claim is not permission to skip analysis or design. |\n| analysis / design | One agent: concept or design proposal with evidence; no product code or PR. |\n| implementation | Builder, other-model review, then deliver the work claim (sections 3-5). |\n| review | One reviewer with a review claim (`fleek orca start KEY --yes --agent OTHER-MODEL` takes it on the delivered branch in its own worktree): checklist, acceptance and evidence; record the verdict, then release that review claim. No builder, implementation, PR or complete_work outcome done loop. Findings go back to the existing implementation work or to the person. |\n| collecting / clarification / acceptance / customer gate | Start no builder; prepare a draft only if requested and wait for the responsible person or customer. Never decide their gate. |\n| done / cancelled | Start nothing. |\n\n- Only implementation uses sections 3-5. `fleek orca tasks` is an overview; `fleek orca pick` works only in a person's terminal and offers only server candidates without an existing work claim. Re-read the live context after claiming: availability is not a status-role decision.\n\n## 3. Claim, worktree, builder\n- `fleek orca start KEY --yes` (the core of `fleek start` for coordinators: Orca required; a new or restarted agent stays in the background, one already running comes to the front) takes or reuses the claim for this machine, creates the Orca worktree named after the key from the project's base branch with the Fleek ticket as reference and starts the agent with a first prompt naming key and claim. You run without a terminal: only `--yes` replaces the person's confirmation, without it the command refuses with CONFIRMATION_REQUIRED. Use it only for tickets your person lets you start; the web link and a person's own terminal keep asking. With the Fleek start command as Orca's agent command (`fleek setup` names it), the agent loads the project's kit. Your own claim is reused, no error. Another holder's claim or NOT_READY: pick another ticket.\n- By hand: fleek_claim_issue (purpose work, runLabel \"orca\" plus the worktree name), then `orca worktree create --name eng-123-slug --reference TICKET-URL --agent claude` from the base branch of fleek_get_project_brief.\n- The builder's task is a pointer: key, claimId, worktree, branch, role builder. Never paste ticket text, criteria or sign-in data; the agent reads them live from Fleek.\n- Models only from providers conventions.aiProviders allows (fleek_get_work_context); a customer's code never goes to another provider.\n- Card: `orca worktree set --worktree id:WORKTREE-ID --workspace-status in-progress`.\n\n## 4. Review by the other model\n- After the builder's worker_done with a pushed commit: start a reviewer with the other model (Claude and Codex swap; only one provider allowed: a fresh session of it) in the same worktree, role reviewer. It claims purpose review, checks criteria and checklist and records its verdict at the ticket.\n- Verdict not ready or a criterion not_met: builder round 2 in the same worktree, then review again. After two rounds ask the person.\n\n## 5. Deliver\n- Clean review: load the guidance (fleek_get_work_context), then fleek_complete_work on the work claim, outcome done, with SHA, branch, PR, checks and result, acceptance per criterion and nextStep. The ticket moves to the project's review state, never Done; check moved and toStateId.\n- A coordination or review claim that only records a status writes fleek_post_progress, not a result. One completion = one fleek_complete_work; no extra summary or analysis comment. Put the recommendation in nextStep; do not add a note about your own draft or publication request.\n- Parts open: outcome partial. Blocked: fleek_release_issue outcome not_doable. Interrupted: outcome paused. A failed dispatch is never done.\n- Card in-review with the existing result; no extra ticket comment.\n\n## 6. People decide\n- Questions only a person can answer go to the ticket (fleek_ask_question); the worker waits, the card gets `--unread`. Gates, acceptance, customer text and Done are decided by a person in Fleek, by an agent only where the project rule allows it and the person approved or gave a standing mandate. Never orca gate-resolve or a terminal yes on their behalf.\n\n## 7. Keep claims alive\n- Renew by expiresAt (about every 20 minutes) while a worker runs or waits; an Orca heartbeat is no renewal. The claim belongs to the machine, so a switched account or a usage-limit pause keeps it: renew and resume. Nobody can continue before expiry: release paused.\n- After a crash read your live claims (fleek_my_work_inbox) and `orca worktree list`, then continue on the same claim (`fleek orca start KEY --yes` restarts an ended agent) or release it. Never claim or complete twice.\n\n## 8. Limits\n- One builder per ticket, one ticket per worktree. Parallel tickets: as many as the person allows, default 2, each with its reviewer; queue the rest. QUOTA_EXCEEDED: the machine's claims are used up - finish or release one first.\n- No Orca code changes, forks or pull requests on Orca. Git effects only as far as the project brief allows.\n"
51754
+ "content": "---\nname: fleek-orca-coordinator\ndescription: \"Coordinate Fleek tickets in Orca: find claimable work, claim it for this machine, start a builder in its own worktree with the project kit, review with the other model, leave gates to people and deliver to review. Use when you coordinate Orca agents for a Fleek project.\"\nmetadata:\n protocol: fleek-work-protocol/1.13\n---\n\n<!-- Generated by scripts/agent-guidance/generate.mjs from scripts/agent-guidance/protocol.json - do not edit by hand. -->\n\n# Fleek in Orca: coordinator recipe\n\nFleek holds the tickets and every human decision; Orca runs worktrees and agents. Follow the fleek-work skill for every Fleek call. Never change Orca's code or settings.\n\n## 1. Ready check\n- `fleek doctor` in the repo: Fleek MCP current for Claude Code, Codex and every Orca account, repo bound to its Fleek project. Otherwise ask the person to run the setup command from Fleek once per machine (Settings › Connections › Set up this computer: `fleek setup <code>`). Never sign in for them.\n\n## 2. Find work\n- fleek_find_work and fleek_my_work_inbox (claimable: agent-ready or assigned to your person; addressed work first); `fleek orca tasks` lists the project's open tickets. Take only status roles where agents work: intake_review, ready, analysis, design, implementation, review. Skip tickets another holder claims.\n- Read stage in fleek_get_work_context before starting a worker, then use this role table. Do not infer a role from the displayed status name or from the ticket title.\n\n| Status role | Work and delivery |\n| --- | --- |\n| intake_review | One triage agent: duplicates, criteria and readiness; no product code or PR. |\n| ready | Claim, then re-read the live stage and use its row. A claim is not permission to skip analysis or design. |\n| analysis / design | One agent: concept or design proposal with evidence; no product code or PR. |\n| implementation | Builder, other-model review, then deliver the work claim (sections 3-5). |\n| review | One reviewer with a review claim (`fleek orca start KEY --yes --agent OTHER-MODEL` takes it on the delivered branch in its own worktree): checklist, acceptance and evidence; record the verdict, then release that review claim. No builder, implementation, PR or complete_work outcome done loop. Findings go back to the existing implementation work or to the person. |\n| collecting / clarification / acceptance / customer gate | Start no builder; prepare a draft only if requested and wait for the responsible person or customer. Never decide their gate. |\n| done / cancelled | Start nothing. |\n\n- Only implementation uses sections 3-5. `fleek orca tasks` is an overview; `fleek orca pick` works only in a person's terminal and offers only server candidates without an existing work claim. Re-read the live context after claiming: availability is not a status-role decision.\n\n## 3. Claim, worktree, builder\n- `fleek orca start KEY --yes` (the core of `fleek start` for coordinators: Orca required; a new or restarted agent stays in the background, one already running comes to the front) takes or reuses the claim for this machine, creates the Orca worktree named after the key from the project's base branch with the Fleek ticket as reference and starts the agent with a first prompt naming key and claim. You run without a terminal: only `--yes` replaces the person's confirmation, without it the command refuses with CONFIRMATION_REQUIRED. Use it only for tickets your person lets you start; the web link and a person's own terminal keep asking. With the Fleek start command as Orca's agent command (`fleek setup` names it), the agent loads the project's kit. Your own claim is reused, no error. Another holder's claim or NOT_READY: pick another ticket.\n- By hand: fleek_claim_issue (purpose work, runLabel \"orca\" plus the worktree name), then `orca worktree create --name eng-123-slug --reference TICKET-URL --agent claude` from the base branch of fleek_get_project_brief.\n- The builder's task is a pointer: key, claimId, worktree, branch, role builder. Never paste ticket text, criteria or sign-in data; the agent reads them live from Fleek.\n- Models only from providers conventions.aiProviders allows (fleek_get_work_context); a customer's code never goes to another provider.\n- Card: `orca worktree set --worktree id:WORKTREE-ID --workspace-status in-progress`.\n\n## 4. Review by the other model\n- After the builder's worker_done verify its report in two reads before starting a reviewer: the fetched feature branch head equals the reported SHA and the worktree has no uncommitted changes; the test note is on the ticket when the project kit asks for one. A mismatch goes back to the builder, not to the reviewer.\n- Then start a reviewer with the other model (Claude and Codex swap; only one provider allowed: a fresh session of it) in the same worktree, role reviewer. It claims purpose review, checks criteria and checklist and records its verdict at the ticket.\n- Check the review's shape (fleek-work, In Orca, reviewer): verdict on the first line, blockers each with a reproduction, anchors only inside the reviewed range, each finding read or measured, questions for a person at the ticket. A review that misses it goes back to the reviewer once with the exact points.\n- Verdict not ready or a criterion not_met: builder round 2 in the same worktree, then review again. After two rounds ask the person.\n\n## 5. Deliver\n- Clean review: load the guidance (fleek_get_work_context), then fleek_complete_work on the work claim, outcome done, with SHA, branch, PR, checks and result, acceptance per criterion and nextStep. The ticket moves to the project's review state, never Done; check moved and toStateId.\n- A coordination or review claim that only records a status writes fleek_post_progress, not a result. One completion = one fleek_complete_work; no extra summary or analysis comment. Put the recommendation in nextStep; do not add a note about your own draft or publication request.\n- Parts open: outcome partial. Blocked: fleek_release_issue outcome not_doable. Interrupted: outcome paused. A failed dispatch is never done.\n- Card in-review with the existing result; no extra ticket comment.\n\n## 6. People decide\n- Questions only a person can answer go to the ticket (fleek_ask_question); the worker waits, the card gets `--unread`. Gates, acceptance, customer text and Done are decided by a person in Fleek, by an agent only where the project rule allows it and the person approved or gave a standing mandate. Never orca gate-resolve or a terminal yes on their behalf.\n- Answer an orca ask only when a rule or a decision recorded at the ticket settles it, and cite it. Anything else a person decides goes back as \"ask at the ticket\": the asking agent calls fleek_ask_question with the deciding person as addressee and waits. Your own person's answer in chat or terminal is recorded verbatim as an internal ticket comment (\"Answer NAME in chat, DATE: ...\"); pass it on only together with that comment, never a chat answer alone. The comment only records the factual answer of your own person; it decides no gate, customer acceptance or publication and grants or widens no mandate or agent_git_* right - those stay decisions in Fleek.\n\n## 7. Keep claims alive\n- Renew by expiresAt (about every 20 minutes) while a worker runs or waits; an Orca heartbeat is no renewal. The claim belongs to the machine, so a switched account or a usage-limit pause keeps it: renew and resume. Nobody can continue before expiry: release paused.\n- After a crash read your live claims (fleek_my_work_inbox) and `orca worktree list`, then continue on the same claim (`fleek orca start KEY --yes` restarts an ended agent) or release it. Never claim or complete twice.\n\n## 8. Limits\n- One builder per ticket, one ticket per worktree. Parallel tickets: as many as the person allows, default 2, each with its reviewer; queue the rest. QUOTA_EXCEEDED: the machine's claims are used up - finish or release one first.\n- No Orca code changes, forks or pull requests on Orca. Git effects only as far as the project brief allows.\n"
51738
51755
  }
51739
51756
  ];
51740
51757
 
@@ -51990,6 +52007,19 @@ function initAgentEnv(env) {
51990
52007
  }
51991
52008
  return result;
51992
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
+ }
51993
52023
  var runInitProcess = (program, args, options) => new Promise((resolve9, reject) => {
51994
52024
  if (options.signal?.aborted) {
51995
52025
  reject(new CliError("errors.aborted", EXIT.failed, {}, "ABORTED"));
@@ -52000,9 +52030,10 @@ var runInitProcess = (program, args, options) => new Promise((resolve9, reject)
52000
52030
  env: options.env,
52001
52031
  shell: false,
52002
52032
  detached: process.platform !== "win32",
52003
- stdio: ["ignore", "pipe", "ignore"]
52033
+ stdio: ["ignore", "pipe", "pipe"]
52004
52034
  });
52005
52035
  const chunks = [];
52036
+ let errorTail = Buffer.alloc(0);
52006
52037
  let bytes = 0, failure2;
52007
52038
  const kill = (signal) => {
52008
52039
  try {
@@ -52027,6 +52058,10 @@ var runInitProcess = (program, args, options) => new Promise((resolve9, reject)
52027
52058
  if (bytes > options.maxBytes) stop(new CliError("errors.initAgentOutput", EXIT.failed, {}, "AGENT_OUTPUT_LIMIT"));
52028
52059
  else chunks.push(chunk);
52029
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
+ });
52030
52065
  const cleanup = () => {
52031
52066
  clearTimeout(timer);
52032
52067
  if (hard) clearTimeout(hard);
@@ -52039,7 +52074,7 @@ var runInitProcess = (program, args, options) => new Promise((resolve9, reject)
52039
52074
  child.once("close", (code) => {
52040
52075
  cleanup();
52041
52076
  if (failure2) reject(failure2);
52042
- 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") });
52043
52078
  });
52044
52079
  });
52045
52080
 
@@ -57327,6 +57362,19 @@ async function ask(ctx, lines) {
57327
57362
  rl.close();
57328
57363
  }
57329
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
+ };
57330
57378
  async function startAgent(ctx, values, stagingDir, outputFile, timeoutMs, app) {
57331
57379
  if (values.agent !== "claude") return false;
57332
57380
  const program = await resolveExecutable("claude", ctx.env);
@@ -57339,7 +57387,8 @@ async function startAgent(ctx, values, stagingDir, outputFile, timeoutMs, app) {
57339
57387
  const versionResult = await run2(program, ["--version"], { cwd: stagingDir, env, signal: ctx.deps.signal, timeoutMs: 1e4, maxBytes: 1024 });
57340
57388
  const version2 = versionResult.code === 0 ? versionResult.stdout.trim().match(/^(\d+\.\d+\.\d+) \(Claude Code\)$/)?.[1] : void 0;
57341
57389
  if (!version2 || !KIT_CAPABILITIES.claude.initIsolation?.includes(version2)) {
57342
- 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;
57343
57392
  }
57344
57393
  if (!await ask(ctx, [ctx.t("init.agentBoundary"), ctx.t("init.confirmAgent")])) return false;
57345
57394
  if (values.verbose && !ctx.json) ctx.info(ctx.out.style.cmd(neutralizeLine(program)));
@@ -57352,7 +57401,10 @@ async function startAgent(ctx, values, stagingDir, outputFile, timeoutMs, app) {
57352
57401
  timeoutMs: Math.max(1, timeoutMs),
57353
57402
  maxBytes: import_validation3.PROJECT_INIT_LIMITS.summaryBytes
57354
57403
  }));
57355
- 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
+ }
57356
57408
  const temporary = `${outputFile}.tmp`;
57357
57409
  await writeFile6(temporary, result.stdout, { mode: 384, flag: "wx" });
57358
57410
  await rename4(temporary, outputFile);
@@ -57559,8 +57611,12 @@ async function initCommand(ctx, values) {
57559
57611
  failed2++;
57560
57612
  if (error instanceof CliError && error.code === "UNKNOWN_OUTCOME") unknownOutcome = true;
57561
57613
  if (error instanceof CliError && error.exitCode === EXIT.needsLogin) throw error;
57562
- emit(ctx, { event: "error", app: app.key, code: errorCode(error) });
57563
- 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
+ }
57564
57620
  }
57565
57621
  }
57566
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.13",
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",