@logic-joe/fleek 0.2.12 → 0.2.14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/fleek.mjs +79 -22
- 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.
|
|
4655
|
+
exports.FLEEK_CLI_SETUP_VERSION_DEFAULT = "0.2.14";
|
|
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 =
|
|
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,9 +36119,19 @@ 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: {},
|
|
36134
|
+
NOT_FOUND: { reason: oneOf3(["no_setup"]) },
|
|
36101
36135
|
ACCESS_DENIED: { reason: oneOf3(["approval_denied", "field_right", "variant_admin"]), field: bindingField, changeRequest },
|
|
36102
36136
|
// ENGINE-AUTHORITY: engine setup refusals (`workflows.engine.*`) - closed lists only
|
|
36103
36137
|
CONFLICT: {
|
|
@@ -36116,7 +36150,7 @@ var require_agent_error_details = __commonJS({
|
|
|
36116
36150
|
// PRIVACY-WORKCTX: additive `holderRef` (person ref of the holder, null without a handle key / release owner)
|
|
36117
36151
|
ALREADY_CLAIMED: { holderLabel: string4, expiresAt: string4, holderRef: personRef },
|
|
36118
36152
|
CLAIMED_BY_OTHER: { holderLabel: string4, expiresAt: string4, holderRef: personRef },
|
|
36119
|
-
CLAIM_REQUIRED: { issueIds: list2 },
|
|
36153
|
+
CLAIM_REQUIRED: { issueIds: list2, requiredPurpose: oneOf3(["work"]), providedPurpose: oneOf3(["review"]) },
|
|
36120
36154
|
RENEW_LIMIT: { hardExpiresAt: string4 },
|
|
36121
36155
|
NOT_READY: { readySelector: string4 },
|
|
36122
36156
|
REVISION_CONFLICT: { currentRevision: integer },
|
|
@@ -36259,6 +36293,8 @@ var require_agent_error_details = __commonJS({
|
|
|
36259
36293
|
"repository",
|
|
36260
36294
|
// AGD-62 LJK-1: the typed result's acceptance verdict (work.complete; explicit, not only through the guest refusal list)
|
|
36261
36295
|
"acceptance",
|
|
36296
|
+
// DEVX-START follow-up: the delivered branch + head commit of work.complete
|
|
36297
|
+
"delivery",
|
|
36262
36298
|
// KNOW-INGEST: run / submit / review inputs (names only)
|
|
36263
36299
|
...types_1.KNOWLEDGE_INGEST_INVALID_FIELDS,
|
|
36264
36300
|
// AGENT-ATTACH: the file of `issues.attachFile` (names only, never the value)
|
|
@@ -36274,8 +36310,10 @@ var require_agent_error_details = __commonJS({
|
|
|
36274
36310
|
]),
|
|
36275
36311
|
index: integer,
|
|
36276
36312
|
path: (value) => (0, types_1.isProjectInitPath)(value) || (0, types_1.isKnowledgeSubmitPath)(value),
|
|
36313
|
+
// MCP-FIX-M `handoff_target` = fleek_complete_work handoff names not exactly one of toUserId / toAgent;
|
|
36314
|
+
// ONF-306 (F38): `page_not_internal` / `page_not_in_project_space` / `profile_schema_missing` = a profile page binding refused for a readable page;
|
|
36277
36315
|
// 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]),
|
|
36316
|
+
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
36317
|
maxBytes: integer,
|
|
36280
36318
|
maxItems: integer,
|
|
36281
36319
|
messageKey: oneOf3(["agentWorkSkills.errors.fieldLimit", "agentWorkSkills.errors.countLimit"]),
|
|
@@ -36325,7 +36363,8 @@ var require_agent_error_details = __commonJS({
|
|
|
36325
36363
|
// AGD-51: `openPoints` = the same closed key shape (condition / checklist keys; only for a proven unrestricted human)
|
|
36326
36364
|
TRANSITION_DENIED: { reason: oneOf3(types_1.TRANSITION_DENIED_REASONS), toStateId: uuid, collectingStateId: uuid, missing: transitionKeys, openPoints: transitionKeys },
|
|
36327
36365
|
TEAM_PROCESS_INVALID: { reason: oneOf3(types_1.TEAM_PROCESS_INVALID_REASONS) },
|
|
36328
|
-
|
|
36366
|
+
// TES-403: `estimate` = the legacy point estimate a restricted actor never writes
|
|
36367
|
+
FIELD_LOCKED: { field: oneOf3([...types_1.TEAM_PROCESS_LOCKED_FIELDS, "projectReleaseId", "estimate"]) },
|
|
36329
36368
|
// AGD COST-LIMITS-a: the unit only (never an amount)
|
|
36330
36369
|
COST_LIMIT_REACHED: { unit: oneOf3(["tokens", "eur"]) },
|
|
36331
36370
|
// AGD TRIAGE-a: the project only
|
|
@@ -37337,6 +37376,7 @@ var EN = {
|
|
|
37337
37376
|
"link.confirmStart": 'Start {key} "{title}" in Orca with {agent}? Task: {task}.',
|
|
37338
37377
|
"errors.startForeignClaim": "{key} is being worked on by {holder} until {expires}. Nothing was started.",
|
|
37339
37378
|
"errors.startReviewNoBranch": "{key}: origin has no branch with this ticket key, so nothing has been delivered for review. Nothing was started.",
|
|
37379
|
+
"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
37380
|
"errors.startReviewBranches": "{key}: several branches carry this ticket key: {branches}. Nothing was started.",
|
|
37341
37381
|
"errors.startReviewBranches.next": "fleek start {key} after removing or renaming the other branches",
|
|
37342
37382
|
"errors.startReviewRefused": "{key}: the server does not allow a review claim right now.",
|
|
@@ -38103,6 +38143,7 @@ var DE = {
|
|
|
38103
38143
|
"link.confirmStart": "{key} „{title}“ mit {agent} in Orca starten? Auftrag: {task}.",
|
|
38104
38144
|
"errors.startForeignClaim": "{key} wird gerade von {holder} bearbeitet, bis {expires}. Es wurde nichts gestartet.",
|
|
38105
38145
|
"errors.startReviewNoBranch": "{key}: Auf origin gibt es keinen Branch mit diesem Ticket-Key, also wurde nichts zum Review abgeliefert. Es wurde nichts gestartet.",
|
|
38146
|
+
"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
38147
|
"errors.startReviewBranches": "{key}: Mehrere Branches tragen diesen Ticket-Key: {branches}. Es wurde nichts gestartet.",
|
|
38107
38148
|
"errors.startReviewBranches.next": "fleek start {key}, nachdem die anderen Branches entfernt oder umbenannt sind",
|
|
38108
38149
|
"errors.startReviewRefused": "{key}: Der Server erlaubt gerade keinen Review-Claim.",
|
|
@@ -40147,11 +40188,17 @@ function matchResponse(raw, id) {
|
|
|
40147
40188
|
}
|
|
40148
40189
|
return null;
|
|
40149
40190
|
}
|
|
40150
|
-
function retrySafe(message) {
|
|
40191
|
+
function retrySafe(message, readOnlyTools = /* @__PURE__ */ new Set()) {
|
|
40151
40192
|
if (message.method !== "tools/call") return true;
|
|
40152
|
-
const
|
|
40193
|
+
const params = object2(message.params) ? message.params : void 0;
|
|
40194
|
+
if (params && typeof params.name === "string" && readOnlyTools.has(params.name)) return true;
|
|
40195
|
+
const args = params ? params.arguments : void 0;
|
|
40153
40196
|
return object2(args) && typeof args.idempotencyKey === "string" && args.idempotencyKey.length > 0;
|
|
40154
40197
|
}
|
|
40198
|
+
function readOnlyToolNames(answer2) {
|
|
40199
|
+
const tools = object2(answer2.result) && Array.isArray(answer2.result.tools) ? answer2.result.tools : [];
|
|
40200
|
+
return tools.filter((tool) => object2(tool) && typeof tool.name === "string" && object2(tool.annotations) && tool.annotations.readOnlyHint === true).map((tool) => tool.name);
|
|
40201
|
+
}
|
|
40155
40202
|
var CODE = /^[A-Z_]{1,64}$/;
|
|
40156
40203
|
var PROFILE_HINT = {
|
|
40157
40204
|
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 +40221,7 @@ async function runProxy(options) {
|
|
|
40174
40221
|
let session = null;
|
|
40175
40222
|
let loginHinted = false;
|
|
40176
40223
|
const reported = /* @__PURE__ */ new Set();
|
|
40224
|
+
const readOnlyTools = /* @__PURE__ */ new Set();
|
|
40177
40225
|
let closed = false;
|
|
40178
40226
|
const write2 = (message) => {
|
|
40179
40227
|
if (closed) return;
|
|
@@ -40272,6 +40320,7 @@ async function runProxy(options) {
|
|
|
40272
40320
|
try {
|
|
40273
40321
|
const answer2 = await post(message, id, signal);
|
|
40274
40322
|
if (answer2 && message.method === "initialize" && object2(answer2.result) && typeof answer2.result.protocolVersion === "string" && PROXY_LEGACY_VERSIONS.includes(answer2.result.protocolVersion)) version2 = answer2.result.protocolVersion;
|
|
40323
|
+
if (answer2 && message.method === "tools/list") for (const name of readOnlyToolNames(answer2)) readOnlyTools.add(name);
|
|
40275
40324
|
if (answer2 && !signal.aborted) write2(answer2);
|
|
40276
40325
|
if (answer2 && message.method === "initialize" && !object2(answer2.error)) loginHinted = false;
|
|
40277
40326
|
return;
|
|
@@ -40287,7 +40336,7 @@ async function runProxy(options) {
|
|
|
40287
40336
|
return;
|
|
40288
40337
|
}
|
|
40289
40338
|
const transient = error instanceof TransientError;
|
|
40290
|
-
if (transient && attempt < retryDelays.length && retrySafe(message)) {
|
|
40339
|
+
if (transient && attempt < retryDelays.length && retrySafe(message, readOnlyTools)) {
|
|
40291
40340
|
await new Promise((resolve9) => setTimeout(resolve9, retryDelays[attempt]));
|
|
40292
40341
|
if (signal.aborted) return;
|
|
40293
40342
|
continue;
|
|
@@ -40299,7 +40348,7 @@ async function runProxy(options) {
|
|
|
40299
40348
|
options.diagnostic(`fleek mcp proxy: request failed (${code})${PROFILE_HINT[code] ? ` - ${PROFILE_HINT[code]}` : ""}`);
|
|
40300
40349
|
}
|
|
40301
40350
|
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."));
|
|
40351
|
+
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
40352
|
}
|
|
40304
40353
|
return;
|
|
40305
40354
|
}
|
|
@@ -50082,13 +50131,12 @@ function causeOf(error) {
|
|
|
50082
50131
|
|
|
50083
50132
|
// src/start.ts
|
|
50084
50133
|
var AGENT = /^[a-z][a-z0-9-]{0,31}$/;
|
|
50085
|
-
var
|
|
50086
|
-
var validBranch = (name) => BRANCH.test(name) && !name.includes("..") && !name.includes("//") && !name.endsWith("/") && !name.endsWith(".lock");
|
|
50134
|
+
var validBranch = import_types6.validDeliveryBranch;
|
|
50087
50135
|
var CANDIDATES_SHOWN = 10;
|
|
50088
50136
|
var string3 = (value) => typeof value === "string" ? value : "";
|
|
50089
50137
|
async function liveFacts(client, task) {
|
|
50090
50138
|
const tools = await client.availableTools();
|
|
50091
|
-
if (!tools.has(WIRE.context)) return { step: null, claims: [], providers: null };
|
|
50139
|
+
if (!tools.has(WIRE.context)) return { step: null, claims: [], providers: null, delivery: null };
|
|
50092
50140
|
const context = (await client.callTool(WIRE.context, { issueId: task.id, format: "json", include: ["task", "work", "conventions"] })).structured;
|
|
50093
50141
|
const work2 = object3(context.work) ? context.work : {};
|
|
50094
50142
|
const claims = (Array.isArray(work2.claims) ? work2.claims : []).filter(object3).map((claim) => ({
|
|
@@ -50098,6 +50146,8 @@ async function liveFacts(client, task) {
|
|
|
50098
50146
|
holder: object3(claim.holder) ? string3(claim.holder.text) : "",
|
|
50099
50147
|
expiresAt: string3(claim.expiresAt)
|
|
50100
50148
|
}));
|
|
50149
|
+
const recorded = object3(work2.delivery) ? work2.delivery : null;
|
|
50150
|
+
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
50151
|
const conventions = object3(context.conventions) ? context.conventions : {};
|
|
50102
50152
|
const providers = Array.isArray(conventions.aiProviders) ? conventions.aiProviders.filter((entry) => typeof entry === "string") : null;
|
|
50103
50153
|
const taskSection = object3(context.task) ? context.task : {};
|
|
@@ -50107,7 +50157,7 @@ async function liveFacts(client, task) {
|
|
|
50107
50157
|
const state = (await pages(client, "fleek_list_workflow_states", { teamId: task.projectId }, 200)).find((row) => string3(row.id).toLowerCase() === stateId);
|
|
50108
50158
|
step = state && (0, import_types6.isOpenInStep)(state.role) ? state.role : null;
|
|
50109
50159
|
}
|
|
50110
|
-
return { step, claims, providers };
|
|
50160
|
+
return { step, claims, providers, delivery };
|
|
50111
50161
|
}
|
|
50112
50162
|
function defaultAgent(providers) {
|
|
50113
50163
|
return providers && providers.length && !providers.includes("anthropic") && providers.includes("openai") ? "codex" : "claude";
|
|
@@ -50162,7 +50212,14 @@ function branchesOfTicket(lsRemote, key) {
|
|
|
50162
50212
|
const token = new RegExp(`(^|[^a-z0-9])${key.toLowerCase().replace(/[^a-z0-9-]/g, "")}($|[^a-z0-9])`, "i");
|
|
50163
50213
|
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
50214
|
}
|
|
50165
|
-
async function deliveredBranch(deps, root, key) {
|
|
50215
|
+
async function deliveredBranch(deps, root, key, recorded) {
|
|
50216
|
+
if (recorded) {
|
|
50217
|
+
if ((await fetchBranch(deps, root, recorded.branch)).code !== 0) throw new CliError("errors.startGit", EXIT.failed, { key, path: neutralizeLine(root) }, "GIT_FAILED");
|
|
50218
|
+
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());
|
|
50219
|
+
if (!head2) throw new CliError("errors.startGit", EXIT.failed, { key, path: neutralizeLine(root) }, "GIT_FAILED");
|
|
50220
|
+
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");
|
|
50221
|
+
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) };
|
|
50222
|
+
}
|
|
50166
50223
|
const remote = await git(deps, root, ["ls-remote", "--heads", "origin"]);
|
|
50167
50224
|
if (remote.code !== 0) throw new CliError("errors.startGit", EXIT.failed, { key, path: neutralizeLine(root) }, "GIT_FAILED");
|
|
50168
50225
|
const found = branchesOfTicket(remote.stdout, key);
|
|
@@ -50255,7 +50312,7 @@ async function runStart(deps, input) {
|
|
|
50255
50312
|
let target = purpose === "work" ? existing[0] ?? null : null;
|
|
50256
50313
|
if (purpose === "review") {
|
|
50257
50314
|
try {
|
|
50258
|
-
delivered = await deliveredBranch(deps, root, task.key);
|
|
50315
|
+
delivered = await deliveredBranch(deps, root, task.key, live.delivery);
|
|
50259
50316
|
} catch (error) {
|
|
50260
50317
|
target = existing.find((entry) => entry.terminal) ?? null;
|
|
50261
50318
|
if (!target) throw error;
|
|
@@ -51678,7 +51735,7 @@ var USER_SKILL_MARKER = "<!-- Generated by scripts/agent-guidance/generate.mjs f
|
|
|
51678
51735
|
var USER_SKILLS = [
|
|
51679
51736
|
{
|
|
51680
51737
|
"name": "fleek-orca-coordinator",
|
|
51681
|
-
"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
|
|
51738
|
+
"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"
|
|
51682
51739
|
}
|
|
51683
51740
|
];
|
|
51684
51741
|
|
package/package.json
CHANGED