@logic-joe/fleek 0.2.12 → 0.2.13

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 +76 -20
  2. package/package.json +1 -1
package/dist/fleek.mjs CHANGED
@@ -1055,7 +1055,8 @@ var require_claims = __commonJS({
1055
1055
  "../types/dist/agent-platform/claims.js"(exports) {
1056
1056
  "use strict";
1057
1057
  Object.defineProperty(exports, "__esModule", { value: true });
1058
- exports.CLAIM_QUOTAS = exports.AGENT_CONVENTION_DEFAULTS = exports.ANSWER_ASSURANCE_KINDS = exports.ISSUE_COMMENT_KINDS = exports.CLAIM_TTL_LIMITS = exports.CLAIM_END_REASONS_RETURNING_TO_POOL = exports.CLAIM_OUTCOME_END_REASON = exports.CLAIM_END_REASONS = exports.CLAIM_RELEASE_OUTCOMES = exports.CLAIM_COMPLETE_OUTCOMES = exports.CLAIM_PURPOSES = void 0;
1058
+ exports.CLAIM_QUOTAS = exports.AGENT_CONVENTION_DEFAULTS = exports.ANSWER_ASSURANCE_KINDS = exports.ISSUE_COMMENT_KINDS = exports.CLAIM_TTL_LIMITS = exports.CLAIM_END_REASONS_RETURNING_TO_POOL = exports.WORK_DELIVERY_SHA = exports.WORK_DELIVERY_BRANCH = exports.WORK_DELIVERY_LIMITS = exports.CLAIM_STATE_KEPT_REASONS = exports.CLAIM_OUTCOME_END_REASON = exports.CLAIM_END_REASONS = exports.CLAIM_RELEASE_OUTCOMES = exports.CLAIM_COMPLETE_OUTCOMES = exports.CLAIM_PURPOSES = void 0;
1059
+ exports.validDeliveryBranch = validDeliveryBranch2;
1059
1060
  exports.CLAIM_PURPOSES = ["work", "review"];
1060
1061
  exports.CLAIM_COMPLETE_OUTCOMES = ["done", "partial", "handed_off"];
1061
1062
  exports.CLAIM_RELEASE_OUTCOMES = ["paused", "not_doable"];
@@ -1076,6 +1077,21 @@ var require_claims = __commonJS({
1076
1077
  paused: "released",
1077
1078
  not_doable: "released"
1078
1079
  };
1080
+ exports.CLAIM_STATE_KEPT_REASONS = [
1081
+ "agents_may_complete_off",
1082
+ "target_unavailable",
1083
+ "rules_changed",
1084
+ "review_not_allowed",
1085
+ "state_changed",
1086
+ "edit_right_missing",
1087
+ "transition_denied"
1088
+ ];
1089
+ exports.WORK_DELIVERY_LIMITS = { branchChars: 200 };
1090
+ exports.WORK_DELIVERY_BRANCH = /^[A-Za-z0-9][A-Za-z0-9._/-]{0,199}$/;
1091
+ exports.WORK_DELIVERY_SHA = /^[0-9a-f]{40,64}$/;
1092
+ function validDeliveryBranch2(name) {
1093
+ return exports.WORK_DELIVERY_BRANCH.test(name) && !name.includes("..") && !name.includes("//") && !name.endsWith("/") && !name.endsWith(".lock");
1094
+ }
1079
1095
  exports.CLAIM_END_REASONS_RETURNING_TO_POOL = ["released", "expired", "force_released", "owner_inactive", "revoked"];
1080
1096
  exports.CLAIM_TTL_LIMITS = { defaultMinutes: 60, minMinutes: 15, maxMinutes: 480, hardHours: 24 };
1081
1097
  exports.ISSUE_COMMENT_KINDS = ["comment", "progress", "question", "decision_request", "answer", "handoff", "result", "system"];
@@ -1610,7 +1626,9 @@ var require_error_codes = __commonJS({
1610
1626
  // sign-in on another Fleek host replaced the shared cookie) - the web client renews its session at once (selected by the
1611
1627
  // HttpExceptionFilter from a server-owned request mark, never by a thrower)
1612
1628
  "session_mismatch",
1613
- "public_visibility"
1629
+ "public_visibility",
1630
+ // MCP-FIX-M: a claim-bound agent write into a completed status while the project setting "Agents may complete" is off
1631
+ "agents_may_complete_off"
1614
1632
  ];
1615
1633
  exports.WORKSPACE_APPS = ["chat", "projects", "documents", "whiteboards", "workflows"];
1616
1634
  exports.MAIL_DELIVERY_STATUSES = ["queued", "sending", "accepted", "ambiguous", "failed", "suppressed"];
@@ -1793,7 +1811,7 @@ var require_events = __commonJS({
1793
1811
  "issue.deleted": { inProcessEmitter: "issue.deleted", webhookWireEvent: "issue.deleted" }
1794
1812
  };
1795
1813
  exports.AGENT_EVENT_AGGREGATE_TYPES = ["issue", "approval", "workflow_run", "workflow_definition"];
1796
- exports.APPROVAL_EVENT_READER_METADATA = ["proposalId", "kind", "outcome"];
1814
+ exports.APPROVAL_EVENT_READER_METADATA = ["proposalId", "approvalId", "kind", "outcome"];
1797
1815
  exports.DOMAIN_EVENT_VISIBILITIES = ["private", "internal", "public"];
1798
1816
  exports.APPROVAL_STALE_REASONS = [
1799
1817
  "revision_changed",
@@ -3686,8 +3704,9 @@ var require_client_ai = __commonJS({
3686
3704
  // AGD-62 LJK-1: the acceptance verdict of `fleek_complete_work` is LJ-internal (never in the guest toolset)
3687
3705
  "acceptance",
3688
3706
  "nextStep",
3689
- // ONF-200 KNOW-A: the doc statement of `fleek_complete_work` is LJ-internal too
3690
- "knowledge"
3707
+ // ONF-200 KNOW-A: the doc statement of `fleek_complete_work` is LJ-internal too; PROTOCOL-NEXT-M: so is the delivered branch + sha
3708
+ "knowledge",
3709
+ "delivery"
3691
3710
  ];
3692
3711
  exports.CLIENT_AI_TOOLS = Object.freeze(Object.keys(exports.CLIENT_AI_TOOL_FIELDS).sort());
3693
3712
  function isClientAiTool(name) {
@@ -4633,7 +4652,7 @@ var require_setup_session = __commonJS({
4633
4652
  exports.SETUP_SESSION_TTL_MINUTES = 30;
4634
4653
  exports.SETUP_SESSION_OPEN_MAX = 10;
4635
4654
  exports.SETUP_SESSION_CLAIM_LIMIT = 10;
4636
- exports.FLEEK_CLI_SETUP_VERSION_DEFAULT = "0.2.12";
4655
+ exports.FLEEK_CLI_SETUP_VERSION_DEFAULT = "0.2.13";
4637
4656
  exports.FLEEK_CLI_PACKAGE = "@logic-joe/fleek";
4638
4657
  exports.FLEEK_CANONICAL_SERVER = "https://api.onfleek.app";
4639
4658
  exports.SETUP_CLIENT_APPS = ["claude-code", "codex", "orca", "cursor", "other"];
@@ -4676,6 +4695,8 @@ var require_setup_session = __commonJS({
4676
4695
  "assign_kit",
4677
4696
  "switch_kit",
4678
4697
  "choose_repo",
4698
+ "open_applications",
4699
+ "check_repo_access",
4679
4700
  "show_command",
4680
4701
  "review_init",
4681
4702
  "setup_review_agent",
@@ -32703,6 +32724,8 @@ var require_knowledge_skeleton = __commonJS({
32703
32724
  ["agent_git_commit", "Agenten dürfen committen", "Agents may commit"],
32704
32725
  ["agent_git_push", "Agenten dürfen Feature-Branch pushen", "Agents may push a feature branch"],
32705
32726
  ["agent_git_open_mr", "Agenten dürfen MR öffnen", "Agents may open a merge request"],
32727
+ // ONF-257: merging the own MR into the base (after green checks and the other model's clean review); empty / false = a person merges
32728
+ ["agent_git_merge", "Agenten dürfen eigene MR mergen", "Agents may merge their own merge request"],
32706
32729
  ["agent_git_delete_local", "Agenten dürfen lokal aufräumen", "Agents may clean up locally"],
32707
32730
  ["agent_git_delete_remote", "Agenten dürfen Remote-Branch löschen", "Agents may delete the remote branch"],
32708
32731
  ["agent_git_stop_servers", "Agenten dürfen fremde Server stoppen", "Agents may stop other servers"]
@@ -33784,6 +33807,7 @@ var require_setup_proposal2 = __commonJS({
33784
33807
  exports.setupProposeShape = {
33785
33808
  packageId: uuid.optional(),
33786
33809
  revision: zod_1.z.number().int().min(1).optional(),
33810
+ templateName: process_template_js_1.processTemplateName.optional(),
33787
33811
  entry: zod_1.z.enum(["example", "copy", "walkthrough"]),
33788
33812
  base: exports.setupBaseRefSchema,
33789
33813
  customer: zod_1.z.union([
@@ -33812,7 +33836,7 @@ var require_setup_proposal2 = __commonJS({
33812
33836
  exports.setupProposalStatusInputSchema = zod_1.z.object({ packageId: uuid }).strict();
33813
33837
  var edge = (rule) => `${rule.fromStateKey ?? "*"}>${rule.toStateKey}`;
33814
33838
  var ACTOR_RANK = { any_member: 0, lj_role: 1, named: 2, client: 3 };
33815
- function setupRisks(base, document3) {
33839
+ function setupRisks(base, document3, invites = []) {
33816
33840
  const next = document3.process.document;
33817
33841
  const out = [];
33818
33842
  const seen = /* @__PURE__ */ new Set();
@@ -33899,7 +33923,7 @@ var require_setup_proposal2 = __commonJS({
33899
33923
  if (items(base).some((text6) => !now.includes(text6)))
33900
33924
  add({ code: "checklist_items_removed", params: { gate: role } });
33901
33925
  }
33902
- const productOwner = document3.people.some((person) => person.role === "product_owner");
33926
+ const productOwner = !(0, setup_package_js_1.setupOpenPoints)(document3, invites).includes("no_product_owner");
33903
33927
  if (!productOwner && next.rules.some((rule) => rule.actorRequirement === "named" && rule.deciderRoles.includes("product_owner")))
33904
33928
  add({ code: "no_product_owner", params: {} });
33905
33929
  return out;
@@ -36095,6 +36119,15 @@ var require_agent_error_details = __commonJS({
36095
36119
  var transitionKeys = (value) => Array.isArray(value) && value.length <= 32 && value.every((item2) => typeof item2 === "string" && item2.length > 0 && item2.length <= 64 && /^[A-Za-z0-9_.:-]+$/.test(item2) && ([...types_1.TRANSITION_CONDITIONS, ...types_1.TRANSITION_REQUIRED_FIELDS].includes(item2) || /^[a-z0-9_.:-]+$/.test(item2)));
36096
36120
  var bindingField = (value) => typeof value === "string" && value.length <= 130 && (/^state:(?:[a-z][a-z0-9_]{0,31}|\+[0-9a-f-]{36})\.(?:role|gate|omitted)$/.test(value) || /^rule:\+[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/.test(value) || /^rule:(?:\*|[a-z][a-z0-9_]{0,31})>[a-z][a-z0-9_]{0,31}$/.test(value) || ["phases", "roles.defaultRole", "routeOptions", "clarification.maxQuestions", "clarification.maxQuestionsPerRound", "clarification.maxRounds", "clarification.answerWithinHours", "clarification.handoffRouteKey", "clarification.handoffUserId"].includes(value));
36097
36121
  var schema = {
36122
+ APPROVAL_EXPIRED: {
36123
+ id: uuid,
36124
+ workspaceId: uuid,
36125
+ requesterId: uuid,
36126
+ toolName: (value) => typeof value === "string" && /^fleek_[a-z0-9_]{1,100}$/.test(value),
36127
+ createdAt: (value) => typeof value === "string" && /^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}\.\d{3}Z$/.test(value),
36128
+ expiresAt: (value) => typeof value === "string" && /^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}\.\d{3}Z$/.test(value),
36129
+ outcome: oneOf3(["expired", "approved", "denied", "consumed"])
36130
+ },
36098
36131
  TICKET_TEXT_LIMIT: {},
36099
36132
  TICKET_TEXT_FORMAT: {},
36100
36133
  TICKET_TEXT_LOSSY_REPLACEMENT: {},
@@ -36259,6 +36292,8 @@ var require_agent_error_details = __commonJS({
36259
36292
  "repository",
36260
36293
  // AGD-62 LJK-1: the typed result's acceptance verdict (work.complete; explicit, not only through the guest refusal list)
36261
36294
  "acceptance",
36295
+ // DEVX-START follow-up: the delivered branch + head commit of work.complete
36296
+ "delivery",
36262
36297
  // KNOW-INGEST: run / submit / review inputs (names only)
36263
36298
  ...types_1.KNOWLEDGE_INGEST_INVALID_FIELDS,
36264
36299
  // AGENT-ATTACH: the file of `issues.attachFile` (names only, never the value)
@@ -36274,8 +36309,10 @@ var require_agent_error_details = __commonJS({
36274
36309
  ]),
36275
36310
  index: integer,
36276
36311
  path: (value) => (0, types_1.isProjectInitPath)(value) || (0, types_1.isKnowledgeSubmitPath)(value),
36312
+ // MCP-FIX-M `handoff_target` = fleek_complete_work handoff names not exactly one of toUserId / toAgent;
36313
+ // ONF-306 (F38): `page_not_internal` / `page_not_in_project_space` / `profile_schema_missing` = a profile page binding refused for a readable page;
36277
36314
  // WF-TF-2 `not_target_project`; WORK-FOLDER-b `human_only` = an agent assessment named an item only a human sets
36278
- reason: oneOf3(["release_name", ...types_1.WORK_REQUEST_INVALID_REASONS, "incompatible_work_filters", "not_target_project", "human_only", "system_item", ...types_1.SKILL_INVALID_REASONS, ...types_1.KIT_INVALID_INPUT_REASONS, ...types_1.SETUP_INVALID_REASONS, ...types_1.SETUP_PROPOSAL_INVALID_REASONS, ...types_1.KNOWLEDGE_SETUP_REASONS, ...types_1.PROJECT_INIT_INVALID_REASONS, ...types_1.KNOWLEDGE_INGEST_INVALID_REASONS]),
36315
+ reason: oneOf3(["release_name", ...types_1.WORK_REQUEST_INVALID_REASONS, "incompatible_work_filters", "handoff_target", "page_not_internal", "page_not_in_project_space", "profile_schema_missing", "not_target_project", "human_only", "system_item", ...types_1.SKILL_INVALID_REASONS, ...types_1.KIT_INVALID_INPUT_REASONS, ...types_1.SETUP_INVALID_REASONS, ...types_1.SETUP_PROPOSAL_INVALID_REASONS, ...types_1.KNOWLEDGE_SETUP_REASONS, ...types_1.PROJECT_INIT_INVALID_REASONS, ...types_1.KNOWLEDGE_INGEST_INVALID_REASONS]),
36279
36316
  maxBytes: integer,
36280
36317
  maxItems: integer,
36281
36318
  messageKey: oneOf3(["agentWorkSkills.errors.fieldLimit", "agentWorkSkills.errors.countLimit"]),
@@ -36325,7 +36362,8 @@ var require_agent_error_details = __commonJS({
36325
36362
  // AGD-51: `openPoints` = the same closed key shape (condition / checklist keys; only for a proven unrestricted human)
36326
36363
  TRANSITION_DENIED: { reason: oneOf3(types_1.TRANSITION_DENIED_REASONS), toStateId: uuid, collectingStateId: uuid, missing: transitionKeys, openPoints: transitionKeys },
36327
36364
  TEAM_PROCESS_INVALID: { reason: oneOf3(types_1.TEAM_PROCESS_INVALID_REASONS) },
36328
- FIELD_LOCKED: { field: oneOf3([...types_1.TEAM_PROCESS_LOCKED_FIELDS, "projectReleaseId"]) },
36365
+ // TES-403: `estimate` = the legacy point estimate a restricted actor never writes
36366
+ FIELD_LOCKED: { field: oneOf3([...types_1.TEAM_PROCESS_LOCKED_FIELDS, "projectReleaseId", "estimate"]) },
36329
36367
  // AGD COST-LIMITS-a: the unit only (never an amount)
36330
36368
  COST_LIMIT_REACHED: { unit: oneOf3(["tokens", "eur"]) },
36331
36369
  // AGD TRIAGE-a: the project only
@@ -37337,6 +37375,7 @@ var EN = {
37337
37375
  "link.confirmStart": 'Start {key} "{title}" in Orca with {agent}? Task: {task}.',
37338
37376
  "errors.startForeignClaim": "{key} is being worked on by {holder} until {expires}. Nothing was started.",
37339
37377
  "errors.startReviewNoBranch": "{key}: origin has no branch with this ticket key, so nothing has been delivered for review. Nothing was started.",
37378
+ "errors.startReviewMoved": "{key}: the delivered branch {branch} moved on since the delivery ({sha} delivered, origin now at {head}). Ask the builder to deliver again. Nothing was started.",
37340
37379
  "errors.startReviewBranches": "{key}: several branches carry this ticket key: {branches}. Nothing was started.",
37341
37380
  "errors.startReviewBranches.next": "fleek start {key} after removing or renaming the other branches",
37342
37381
  "errors.startReviewRefused": "{key}: the server does not allow a review claim right now.",
@@ -38103,6 +38142,7 @@ var DE = {
38103
38142
  "link.confirmStart": "{key} „{title}“ mit {agent} in Orca starten? Auftrag: {task}.",
38104
38143
  "errors.startForeignClaim": "{key} wird gerade von {holder} bearbeitet, bis {expires}. Es wurde nichts gestartet.",
38105
38144
  "errors.startReviewNoBranch": "{key}: Auf origin gibt es keinen Branch mit diesem Ticket-Key, also wurde nichts zum Review abgeliefert. Es wurde nichts gestartet.",
38145
+ "errors.startReviewMoved": "{key}: Der abgelieferte Branch {branch} hat sich seit der Ablieferung weiterbewegt ({sha} abgeliefert, origin jetzt bei {head}). Bitte den Builder, neu abzuliefern. Es wurde nichts gestartet.",
38106
38146
  "errors.startReviewBranches": "{key}: Mehrere Branches tragen diesen Ticket-Key: {branches}. Es wurde nichts gestartet.",
38107
38147
  "errors.startReviewBranches.next": "fleek start {key}, nachdem die anderen Branches entfernt oder umbenannt sind",
38108
38148
  "errors.startReviewRefused": "{key}: Der Server erlaubt gerade keinen Review-Claim.",
@@ -40147,11 +40187,17 @@ function matchResponse(raw, id) {
40147
40187
  }
40148
40188
  return null;
40149
40189
  }
40150
- function retrySafe(message) {
40190
+ function retrySafe(message, readOnlyTools = /* @__PURE__ */ new Set()) {
40151
40191
  if (message.method !== "tools/call") return true;
40152
- const args = object2(message.params) ? message.params.arguments : void 0;
40192
+ const params = object2(message.params) ? message.params : void 0;
40193
+ if (params && typeof params.name === "string" && readOnlyTools.has(params.name)) return true;
40194
+ const args = params ? params.arguments : void 0;
40153
40195
  return object2(args) && typeof args.idempotencyKey === "string" && args.idempotencyKey.length > 0;
40154
40196
  }
40197
+ function readOnlyToolNames(answer2) {
40198
+ const tools = object2(answer2.result) && Array.isArray(answer2.result.tools) ? answer2.result.tools : [];
40199
+ return tools.filter((tool) => object2(tool) && typeof tool.name === "string" && object2(tool.annotations) && tool.annotations.readOnlyHint === true).map((tool) => tool.name);
40200
+ }
40155
40201
  var CODE = /^[A-Z_]{1,64}$/;
40156
40202
  var PROFILE_HINT = {
40157
40203
  PROFILE_AMBIGUOUS: "Several Fleek sign-ins are bound to this checkout: pin one with `--profile <key>` or FLEEK_PROFILE in the MCP entry.",
@@ -40174,6 +40220,7 @@ async function runProxy(options) {
40174
40220
  let session = null;
40175
40221
  let loginHinted = false;
40176
40222
  const reported = /* @__PURE__ */ new Set();
40223
+ const readOnlyTools = /* @__PURE__ */ new Set();
40177
40224
  let closed = false;
40178
40225
  const write2 = (message) => {
40179
40226
  if (closed) return;
@@ -40272,6 +40319,7 @@ async function runProxy(options) {
40272
40319
  try {
40273
40320
  const answer2 = await post(message, id, signal);
40274
40321
  if (answer2 && message.method === "initialize" && object2(answer2.result) && typeof answer2.result.protocolVersion === "string" && PROXY_LEGACY_VERSIONS.includes(answer2.result.protocolVersion)) version2 = answer2.result.protocolVersion;
40322
+ if (answer2 && message.method === "tools/list") for (const name of readOnlyToolNames(answer2)) readOnlyTools.add(name);
40275
40323
  if (answer2 && !signal.aborted) write2(answer2);
40276
40324
  if (answer2 && message.method === "initialize" && !object2(answer2.error)) loginHinted = false;
40277
40325
  return;
@@ -40287,7 +40335,7 @@ async function runProxy(options) {
40287
40335
  return;
40288
40336
  }
40289
40337
  const transient = error instanceof TransientError;
40290
- if (transient && attempt < retryDelays.length && retrySafe(message)) {
40338
+ if (transient && attempt < retryDelays.length && retrySafe(message, readOnlyTools)) {
40291
40339
  await new Promise((resolve9) => setTimeout(resolve9, retryDelays[attempt]));
40292
40340
  if (signal.aborted) return;
40293
40341
  continue;
@@ -40299,7 +40347,7 @@ async function runProxy(options) {
40299
40347
  options.diagnostic(`fleek mcp proxy: request failed (${code})${PROFILE_HINT[code] ? ` - ${PROFILE_HINT[code]}` : ""}`);
40300
40348
  }
40301
40349
  if (id !== null) {
40302
- write2(transient ? proxyError(id, "UNAVAILABLE", retrySafe(message) ? "Fleek is unreachable right now; retry later." : "Fleek is unreachable right now; the outcome is unknown. Retry with an idempotencyKey to repeat it safely.") : proxyError(id, code, PROFILE_HINT[code] ?? "The request failed."));
40350
+ write2(transient ? proxyError(id, "UNAVAILABLE", retrySafe(message, readOnlyTools) ? "Fleek is unreachable right now; retry later." : "Fleek is unreachable right now; the outcome is unknown. Retry with an idempotencyKey to repeat it safely.") : proxyError(id, code, PROFILE_HINT[code] ?? "The request failed."));
40303
40351
  }
40304
40352
  return;
40305
40353
  }
@@ -50082,13 +50130,12 @@ function causeOf(error) {
50082
50130
 
50083
50131
  // src/start.ts
50084
50132
  var AGENT = /^[a-z][a-z0-9-]{0,31}$/;
50085
- var BRANCH = /^[A-Za-z0-9][A-Za-z0-9._/-]{0,200}$/;
50086
- var validBranch = (name) => BRANCH.test(name) && !name.includes("..") && !name.includes("//") && !name.endsWith("/") && !name.endsWith(".lock");
50133
+ var validBranch = import_types6.validDeliveryBranch;
50087
50134
  var CANDIDATES_SHOWN = 10;
50088
50135
  var string3 = (value) => typeof value === "string" ? value : "";
50089
50136
  async function liveFacts(client, task) {
50090
50137
  const tools = await client.availableTools();
50091
- if (!tools.has(WIRE.context)) return { step: null, claims: [], providers: null };
50138
+ if (!tools.has(WIRE.context)) return { step: null, claims: [], providers: null, delivery: null };
50092
50139
  const context = (await client.callTool(WIRE.context, { issueId: task.id, format: "json", include: ["task", "work", "conventions"] })).structured;
50093
50140
  const work2 = object3(context.work) ? context.work : {};
50094
50141
  const claims = (Array.isArray(work2.claims) ? work2.claims : []).filter(object3).map((claim) => ({
@@ -50098,6 +50145,8 @@ async function liveFacts(client, task) {
50098
50145
  holder: object3(claim.holder) ? string3(claim.holder.text) : "",
50099
50146
  expiresAt: string3(claim.expiresAt)
50100
50147
  }));
50148
+ const recorded = object3(work2.delivery) ? work2.delivery : null;
50149
+ const delivery = recorded && typeof recorded.branch === "string" && validBranch(recorded.branch) && typeof recorded.sha === "string" && import_types6.WORK_DELIVERY_SHA.test(recorded.sha) ? { branch: recorded.branch, sha: recorded.sha, at: string3(recorded.at) } : null;
50101
50150
  const conventions = object3(context.conventions) ? context.conventions : {};
50102
50151
  const providers = Array.isArray(conventions.aiProviders) ? conventions.aiProviders.filter((entry) => typeof entry === "string") : null;
50103
50152
  const taskSection = object3(context.task) ? context.task : {};
@@ -50107,7 +50156,7 @@ async function liveFacts(client, task) {
50107
50156
  const state = (await pages(client, "fleek_list_workflow_states", { teamId: task.projectId }, 200)).find((row) => string3(row.id).toLowerCase() === stateId);
50108
50157
  step = state && (0, import_types6.isOpenInStep)(state.role) ? state.role : null;
50109
50158
  }
50110
- return { step, claims, providers };
50159
+ return { step, claims, providers, delivery };
50111
50160
  }
50112
50161
  function defaultAgent(providers) {
50113
50162
  return providers && providers.length && !providers.includes("anthropic") && providers.includes("openai") ? "codex" : "claude";
@@ -50162,7 +50211,14 @@ function branchesOfTicket(lsRemote, key) {
50162
50211
  const token = new RegExp(`(^|[^a-z0-9])${key.toLowerCase().replace(/[^a-z0-9-]/g, "")}($|[^a-z0-9])`, "i");
50163
50212
  return lsRemote.split("\n").map((line) => /^[0-9a-f]{40,64}\s+refs\/heads\/(\S+)$/.exec(line.trim())?.[1] ?? "").filter((name) => name && validBranch(name) && token.test(name));
50164
50213
  }
50165
- async function deliveredBranch(deps, root, key) {
50214
+ async function deliveredBranch(deps, root, key, recorded) {
50215
+ if (recorded) {
50216
+ if ((await fetchBranch(deps, root, recorded.branch)).code !== 0) throw new CliError("errors.startGit", EXIT.failed, { key, path: neutralizeLine(root) }, "GIT_FAILED");
50217
+ const head2 = /^([0-9a-f]{40,64})\s+(\S+)/.exec((await git(deps, root, ["log", "-1", "--format=%H %cI", `refs/remotes/origin/${recorded.branch}`])).stdout.trim());
50218
+ if (!head2) throw new CliError("errors.startGit", EXIT.failed, { key, path: neutralizeLine(root) }, "GIT_FAILED");
50219
+ if (head2[1] !== recorded.sha) throw new CliError("errors.startReviewMoved", EXIT.failed, { key, branch: neutralizeLine(recorded.branch), sha: recorded.sha.slice(0, 10), head: head2[1].slice(0, 10) }, "REVIEW_BRANCH_MOVED");
50220
+ return { branch: recorded.branch, sha: recorded.sha, date: /^\d{4}-\d{2}-\d{2}/.test(recorded.at) ? recorded.at.slice(0, 10) : head2[2].slice(0, 10) };
50221
+ }
50166
50222
  const remote = await git(deps, root, ["ls-remote", "--heads", "origin"]);
50167
50223
  if (remote.code !== 0) throw new CliError("errors.startGit", EXIT.failed, { key, path: neutralizeLine(root) }, "GIT_FAILED");
50168
50224
  const found = branchesOfTicket(remote.stdout, key);
@@ -50255,7 +50311,7 @@ async function runStart(deps, input) {
50255
50311
  let target = purpose === "work" ? existing[0] ?? null : null;
50256
50312
  if (purpose === "review") {
50257
50313
  try {
50258
- delivered = await deliveredBranch(deps, root, task.key);
50314
+ delivered = await deliveredBranch(deps, root, task.key, live.delivery);
50259
50315
  } catch (error) {
50260
50316
  target = existing.find((entry) => entry.terminal) ?? null;
50261
50317
  if (!target) throw error;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@logic-joe/fleek",
3
- "version": "0.2.12",
3
+ "version": "0.2.13",
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",