@logic-joe/fleek 0.2.8 → 0.2.9
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 +389 -66
- package/package.json +1 -1
package/dist/fleek.mjs
CHANGED
|
@@ -1341,6 +1341,7 @@ var require_error_codes = __commonJS({
|
|
|
1341
1341
|
RESULT_TOO_LARGE: { http: 422, mcpLegacy: "CONTENT_TOO_LARGE", group: "generic" },
|
|
1342
1342
|
RATE_LIMITED: { http: 429, mcpLegacy: "RATE_LIMITED", group: "generic" },
|
|
1343
1343
|
UNAVAILABLE: { http: 503, mcpLegacy: "UNAVAILABLE", group: "generic" },
|
|
1344
|
+
CALLS_DISABLED: { http: 503, mcpLegacy: "UNAVAILABLE", group: "generic" },
|
|
1344
1345
|
TIMEOUT: { http: 504, mcpLegacy: "TIMEOUT", group: "generic" },
|
|
1345
1346
|
// §9.2 hub / authority
|
|
1346
1347
|
ALREADY_CLAIMED: { http: 409, mcpLegacy: "CONFLICT", group: "hub" },
|
|
@@ -4645,6 +4646,153 @@ var require_setup_session = __commonJS({
|
|
|
4645
4646
|
}
|
|
4646
4647
|
});
|
|
4647
4648
|
|
|
4649
|
+
// ../types/dist/agent-platform/open-in.js
|
|
4650
|
+
var require_open_in = __commonJS({
|
|
4651
|
+
"../types/dist/agent-platform/open-in.js"(exports) {
|
|
4652
|
+
"use strict";
|
|
4653
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4654
|
+
exports.isOpenInRole = exports.isOpenInStep = exports.isOpenInLocale = exports.isOpenInAgent = exports.OPEN_IN_URL_MAX = exports.OPEN_IN_TEXT_MAX = exports.OPEN_IN_LINK_MAX = exports.OPEN_IN_LINK_SCHEME = exports.OPEN_IN_KEY = exports.OPEN_IN_SLUG = exports.OPEN_IN_CHATS = exports.OPEN_IN_LOCALES = exports.OPEN_IN_AGENTS = void 0;
|
|
4655
|
+
exports.openInTask = openInTask2;
|
|
4656
|
+
exports.openInStartText = openInStartText2;
|
|
4657
|
+
exports.openInLink = openInLink2;
|
|
4658
|
+
exports.parseOpenInLink = parseOpenInLink2;
|
|
4659
|
+
exports.openInCommand = openInCommand;
|
|
4660
|
+
exports.openInChatUrl = openInChatUrl;
|
|
4661
|
+
var team_process_js_1 = require_team_process();
|
|
4662
|
+
exports.OPEN_IN_AGENTS = ["claude", "codex"];
|
|
4663
|
+
exports.OPEN_IN_LOCALES = ["en", "de"];
|
|
4664
|
+
exports.OPEN_IN_CHATS = ["claude", "chatgpt"];
|
|
4665
|
+
exports.OPEN_IN_SLUG = /^[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?$/;
|
|
4666
|
+
exports.OPEN_IN_KEY = /^[A-Z0-9]{2,10}-[1-9][0-9]{0,8}$/;
|
|
4667
|
+
exports.OPEN_IN_LINK_SCHEME = "fleek-orca";
|
|
4668
|
+
exports.OPEN_IN_LINK_MAX = 512;
|
|
4669
|
+
exports.OPEN_IN_TEXT_MAX = 1500;
|
|
4670
|
+
exports.OPEN_IN_URL_MAX = 4e3;
|
|
4671
|
+
var member = (list2, value) => typeof value === "string" && list2.includes(value);
|
|
4672
|
+
var isOpenInAgent = (value) => member(exports.OPEN_IN_AGENTS, value);
|
|
4673
|
+
exports.isOpenInAgent = isOpenInAgent;
|
|
4674
|
+
var isOpenInLocale = (value) => member(exports.OPEN_IN_LOCALES, value);
|
|
4675
|
+
exports.isOpenInLocale = isOpenInLocale;
|
|
4676
|
+
var isOpenInStep = (value) => member(team_process_js_1.TEAM_STATE_ROLES, value);
|
|
4677
|
+
exports.isOpenInStep = isOpenInStep;
|
|
4678
|
+
var isOpenInRole = (value) => member(team_process_js_1.PROJECT_MEMBER_ROLES, value);
|
|
4679
|
+
exports.isOpenInRole = isOpenInRole;
|
|
4680
|
+
var ROW = {
|
|
4681
|
+
collecting: "intake",
|
|
4682
|
+
intake_review: "intake",
|
|
4683
|
+
clarification: "clarification",
|
|
4684
|
+
ready: "ready",
|
|
4685
|
+
analysis: "analysis",
|
|
4686
|
+
design: "design",
|
|
4687
|
+
implementation: "implementation",
|
|
4688
|
+
review: "review",
|
|
4689
|
+
acceptance: "acceptance",
|
|
4690
|
+
done: "closed",
|
|
4691
|
+
cancelled: "closed"
|
|
4692
|
+
};
|
|
4693
|
+
var CELLS = {
|
|
4694
|
+
de: {
|
|
4695
|
+
intake: { default: "Ziel, Kriterien und die wichtigste offene Frage formulieren; nichts bauen", designer: "Nutzerfluss und UX-Fragen skizzieren; nichts bauen", developer: "Duplikate, Machbarkeit und Risiken prüfen; nichts bauen" },
|
|
4696
|
+
clarification: { default: "eine Antwort auf die offene Frage vorformulieren, nichts entscheiden", designer: "eine UX-Antwort vorformulieren, nichts entscheiden", developer: "eine technische Antwort vorformulieren, nichts entscheiden" },
|
|
4697
|
+
ready: { default: "einen Plan erstellen, dann übernehmen und starten", product_owner: "Lücken vor dem Start nennen" },
|
|
4698
|
+
analysis: { default: "einen Konzeptvorschlag erstellen, kein Produktcode", product_owner: "Entscheidungen vorbereiten", designer: "UX-Folgen nennen" },
|
|
4699
|
+
design: { default: "einen Designvorschlag erstellen: Zustände, Texte, Figma-Link; kein Code", product_owner: "das Design gegen das Ziel prüfen", developer: "die Umsetzbarkeit prüfen" },
|
|
4700
|
+
implementation: { default: "im eigenen Branch bauen, Prüfungen laufen lassen, zur Prüfung liefern", product_owner: "den Stand verständlich zusammenfassen", designer: "Abweichungen vom Design melden" },
|
|
4701
|
+
review: { default: "gegen Kriterien und Checkliste prüfen, nichts ändern", product_owner: "das Ergebnis für die Abnahme zusammenfassen", designer: "visuell prüfen, nichts ändern", developer: "Befunde beheben (eigener Lauf)" },
|
|
4702
|
+
acceptance: { default: "die Abnahme vorbereiten, nicht entscheiden" },
|
|
4703
|
+
closed: { default: "nur lesen und zusammenfassen" },
|
|
4704
|
+
unknown: { default: "den aktuellen Schritt in Fleek lesen und nur ihn bearbeiten" }
|
|
4705
|
+
},
|
|
4706
|
+
en: {
|
|
4707
|
+
intake: { default: "state the goal, the criteria and the most important open question; build nothing", designer: "sketch the user flow and UX questions; build nothing", developer: "check duplicates, feasibility and risks; build nothing" },
|
|
4708
|
+
clarification: { default: "draft an answer to the open question, decide nothing", designer: "draft a UX answer, decide nothing", developer: "draft a technical answer, decide nothing" },
|
|
4709
|
+
ready: { default: "make a plan, then claim and start", product_owner: "name the gaps before the start" },
|
|
4710
|
+
analysis: { default: "write a concept proposal, no product code", product_owner: "prepare the decisions", designer: "name the UX consequences" },
|
|
4711
|
+
design: { default: "write a design proposal: states, texts, Figma link; no code", product_owner: "check the design against the goal", developer: "check feasibility" },
|
|
4712
|
+
implementation: { default: "build in your own branch, run the checks, deliver for review", product_owner: "summarise the state in plain words", designer: "report deviations from the design" },
|
|
4713
|
+
review: { default: "review against the criteria and the checklist, change nothing", product_owner: "summarise the result for the acceptance", designer: "review visually, change nothing", developer: "fix the findings (own run)" },
|
|
4714
|
+
acceptance: { default: "prepare the acceptance, do not decide it" },
|
|
4715
|
+
closed: { default: "only read and summarise" },
|
|
4716
|
+
unknown: { default: "read the current step in Fleek and work only on it" }
|
|
4717
|
+
}
|
|
4718
|
+
};
|
|
4719
|
+
function openInTask2(step, role, locale2 = "en") {
|
|
4720
|
+
const cells2 = CELLS[(0, exports.isOpenInLocale)(locale2) ? locale2 : "en"][(0, exports.isOpenInStep)(step) ? ROW[step] : "unknown"];
|
|
4721
|
+
return ((0, exports.isOpenInRole)(role) ? cells2[role] : void 0) ?? cells2.default;
|
|
4722
|
+
}
|
|
4723
|
+
function openInStartText2(input) {
|
|
4724
|
+
const workspace = String(input.workspace ?? "").toLowerCase();
|
|
4725
|
+
const ticket = String(input.ticket ?? "").toUpperCase();
|
|
4726
|
+
if (!exports.OPEN_IN_SLUG.test(workspace) || !exports.OPEN_IN_KEY.test(ticket))
|
|
4727
|
+
return null;
|
|
4728
|
+
const locale2 = (0, exports.isOpenInLocale)(input.locale) ? input.locale : "en";
|
|
4729
|
+
const task = openInTask2(input.step, input.role, locale2);
|
|
4730
|
+
return locale2 === "de" ? `Fleek-Ticket ${ticket} (Workspace ${workspace}). Lies Ticket, Kriterien und Vorgaben live in Fleek. Jetzt: ${task}. Vor Änderungen übernehmen; Fragen und Ergebnis ins Ticket. Folge dem Prozess des Projekts: verschiebe das Ticket nur dorthin, wohin er dich lässt, nie selbst auf Erledigt.` : `Fleek ticket ${ticket} (workspace ${workspace}). Read the ticket, criteria and guidance live in Fleek. Now: ${task}. Claim it before any change; questions and results go into the ticket. Follow the project's process: move the ticket only where it lets you, never to Done yourself.`;
|
|
4731
|
+
}
|
|
4732
|
+
var OPTIONAL = ["agent", "step", "role", "lang"];
|
|
4733
|
+
var CHECK = { agent: exports.isOpenInAgent, step: exports.isOpenInStep, role: exports.isOpenInRole, lang: exports.isOpenInLocale };
|
|
4734
|
+
function openInLink2(workspace, ticket, options = {}) {
|
|
4735
|
+
const slug = String(workspace ?? "").toLowerCase();
|
|
4736
|
+
const key = String(ticket ?? "").toUpperCase();
|
|
4737
|
+
if (!exports.OPEN_IN_SLUG.test(slug) || !exports.OPEN_IN_KEY.test(key))
|
|
4738
|
+
return null;
|
|
4739
|
+
const extra = OPTIONAL.filter((name) => options[name] !== void 0 && CHECK[name](options[name])).map((name) => `&${name}=${options[name]}`).join("");
|
|
4740
|
+
return `${exports.OPEN_IN_LINK_SCHEME}://open?workspace=${slug}&ticket=${key}${extra}`;
|
|
4741
|
+
}
|
|
4742
|
+
var LINK_PREFIX = new RegExp(`^${exports.OPEN_IN_LINK_SCHEME}://open/?\\?([^#]*)$`, "i");
|
|
4743
|
+
function parseOpenInLink2(input) {
|
|
4744
|
+
if (typeof input !== "string" || input.length > exports.OPEN_IN_LINK_MAX || /[\s\u0000-\u001f\u007f]/.test(input))
|
|
4745
|
+
return null;
|
|
4746
|
+
const query = LINK_PREFIX.exec(input)?.[1];
|
|
4747
|
+
if (!query)
|
|
4748
|
+
return null;
|
|
4749
|
+
const values = /* @__PURE__ */ new Map();
|
|
4750
|
+
for (const pair of query.split("&")) {
|
|
4751
|
+
const at = pair.indexOf("=");
|
|
4752
|
+
if (at <= 0)
|
|
4753
|
+
return null;
|
|
4754
|
+
let name, value;
|
|
4755
|
+
try {
|
|
4756
|
+
name = decodeURIComponent(pair.slice(0, at).replace(/\+/g, " "));
|
|
4757
|
+
value = decodeURIComponent(pair.slice(at + 1).replace(/\+/g, " "));
|
|
4758
|
+
} catch {
|
|
4759
|
+
return null;
|
|
4760
|
+
}
|
|
4761
|
+
if (values.has(name))
|
|
4762
|
+
return null;
|
|
4763
|
+
values.set(name, value);
|
|
4764
|
+
}
|
|
4765
|
+
if (!values.has("workspace") || !values.has("ticket"))
|
|
4766
|
+
return null;
|
|
4767
|
+
if ([...values.keys()].some((name) => name !== "workspace" && name !== "ticket" && !OPTIONAL.includes(name)))
|
|
4768
|
+
return null;
|
|
4769
|
+
const workspace = values.get("workspace").toLowerCase();
|
|
4770
|
+
const ticket = values.get("ticket").toUpperCase();
|
|
4771
|
+
if (!exports.OPEN_IN_SLUG.test(workspace) || !exports.OPEN_IN_KEY.test(ticket))
|
|
4772
|
+
return null;
|
|
4773
|
+
const options = {};
|
|
4774
|
+
for (const name of OPTIONAL) {
|
|
4775
|
+
const value = values.get(name);
|
|
4776
|
+
if (value === void 0)
|
|
4777
|
+
continue;
|
|
4778
|
+
if (!CHECK[name](value))
|
|
4779
|
+
return null;
|
|
4780
|
+
options[name] = value;
|
|
4781
|
+
}
|
|
4782
|
+
return { workspace, ticket, ...options };
|
|
4783
|
+
}
|
|
4784
|
+
function openInCommand(link3) {
|
|
4785
|
+
return `fleek link open "${link3}"`;
|
|
4786
|
+
}
|
|
4787
|
+
function openInChatUrl(chat, text6) {
|
|
4788
|
+
if (!member(exports.OPEN_IN_CHATS, chat) || typeof text6 !== "string" || !text6 || text6.length > exports.OPEN_IN_TEXT_MAX)
|
|
4789
|
+
return null;
|
|
4790
|
+
const url = `${chat === "claude" ? "https://claude.ai/new" : "https://chatgpt.com/"}?q=${encodeURIComponent(text6)}`;
|
|
4791
|
+
return url.length <= exports.OPEN_IN_URL_MAX ? url : null;
|
|
4792
|
+
}
|
|
4793
|
+
}
|
|
4794
|
+
});
|
|
4795
|
+
|
|
4648
4796
|
// ../types/dist/agent-platform/index.js
|
|
4649
4797
|
var require_agent_platform = __commonJS({
|
|
4650
4798
|
"../types/dist/agent-platform/index.js"(exports) {
|
|
@@ -4701,6 +4849,7 @@ var require_agent_platform = __commonJS({
|
|
|
4701
4849
|
__exportStar(require_knowledge_ingest(), exports);
|
|
4702
4850
|
__exportStar(require_service_accounts(), exports);
|
|
4703
4851
|
__exportStar(require_setup_session(), exports);
|
|
4852
|
+
__exportStar(require_open_in(), exports);
|
|
4704
4853
|
}
|
|
4705
4854
|
});
|
|
4706
4855
|
|
|
@@ -4912,6 +5061,172 @@ var require_ticket_references = __commonJS({
|
|
|
4912
5061
|
}
|
|
4913
5062
|
});
|
|
4914
5063
|
|
|
5064
|
+
// ../types/dist/admin-todo.js
|
|
5065
|
+
var require_admin_todo = __commonJS({
|
|
5066
|
+
"../types/dist/admin-todo.js"(exports) {
|
|
5067
|
+
"use strict";
|
|
5068
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5069
|
+
exports.newerVersion = newerVersion2;
|
|
5070
|
+
exports.todoRows = todoRows;
|
|
5071
|
+
var setup_session_js_1 = require_setup_session();
|
|
5072
|
+
function newerVersion2(current2, candidate) {
|
|
5073
|
+
const parse2 = (v) => /^(\d+)(?:\.(\d+))?(?:\.(\d+))?(?:-([\w.]+))?$/.exec(v.replace(/^V/, ""));
|
|
5074
|
+
const a = parse2(current2), b = parse2(candidate);
|
|
5075
|
+
if (!a || !b)
|
|
5076
|
+
return null;
|
|
5077
|
+
for (let n = 1; n <= 3; n++) {
|
|
5078
|
+
const delta = Number(b[n] ?? 0) - Number(a[n] ?? 0);
|
|
5079
|
+
if (delta)
|
|
5080
|
+
return delta > 0;
|
|
5081
|
+
}
|
|
5082
|
+
return !!a[4] && !b[4];
|
|
5083
|
+
}
|
|
5084
|
+
function todoRows(data, projectHref) {
|
|
5085
|
+
const rows = [];
|
|
5086
|
+
const add = (id, subject, label, href, action = "review", state = "open", group = 0, extra = {}) => rows.push({ id, subject, label, href, action, state, group, ...extra });
|
|
5087
|
+
const projects = new Map((data.setup?.projects ?? []).map((p) => [p.teamId.toLowerCase(), p]));
|
|
5088
|
+
for (const p of data.packages ?? [])
|
|
5089
|
+
if (p.state !== "applied" && p.state !== "discarded")
|
|
5090
|
+
add(`package:${p.id}`, p.title, "setup", `/admin/agent-work/setup/${p.id}`, "continue");
|
|
5091
|
+
for (const p of projects.values()) {
|
|
5092
|
+
const href = projectHref(p.key, "/settings/process");
|
|
5093
|
+
if (!p.template)
|
|
5094
|
+
add(`process:${p.teamId}`, p.name, "process", href, "assign");
|
|
5095
|
+
if (!p.productOwner)
|
|
5096
|
+
add(`owner:${p.teamId}`, p.name, "owner", href, "assign");
|
|
5097
|
+
if ((p.guidanceBehind ?? 0) > 0)
|
|
5098
|
+
add(`guidance-update:${p.teamId}`, p.name, "guidanceUpdate", projectHref(p.key, "/settings/delivery"), "switch", "new", 2);
|
|
5099
|
+
for (const c of p.checklists)
|
|
5100
|
+
if (["adoptable", "draft", "missing", "blocked"].includes(c.status))
|
|
5101
|
+
add(`checklist:${p.teamId}:${c.role}`, p.name, `checklist.${c.role}`, href, c.status === "adoptable" ? "assign" : "review", c.status === "blocked" ? "waiting" : "open");
|
|
5102
|
+
for (const c of p.checklists)
|
|
5103
|
+
if (c.status === "other")
|
|
5104
|
+
add(`checklist:${p.teamId}:${c.role}`, p.name, "checklistUpdate", href, "switch", "new", 2, { values: { role: c.role } });
|
|
5105
|
+
const t = data.templates?.find((t2) => t2.templateId === p.template?.templateId && !t2.archived);
|
|
5106
|
+
if (p.template && t?.approved && newerVersion2(p.template.version, t.approved))
|
|
5107
|
+
add(`template-update:${p.teamId}`, p.name, "templateUpdate", href, "switch", "new", 2, { values: { version: t.approved } });
|
|
5108
|
+
}
|
|
5109
|
+
for (const pin of data.pins ?? []) {
|
|
5110
|
+
const p = projects.get(pin.teamId.toLowerCase());
|
|
5111
|
+
if (!p)
|
|
5112
|
+
continue;
|
|
5113
|
+
if (pin.status === "revoked" || pin.latestApproved !== null && pin.latestApproved > pin.version)
|
|
5114
|
+
add(`pin:${p.teamId}:${pin.kitKey}`, p.name, pin.status === "revoked" ? "kitRevoked" : "kitUpdate", projectHref(p.key, "/settings/delivery"), "switch", pin.status === "revoked" ? "open" : "new", pin.status === "revoked" ? 0 : 2, { values: { kit: pin.kitKey } });
|
|
5115
|
+
}
|
|
5116
|
+
for (const t of data.templates ?? [])
|
|
5117
|
+
if (!t.archived && t.draft?.pendingApproval)
|
|
5118
|
+
add(`template:${t.templateId}`, t.name, "approval", `/admin/agent-work/processes/${t.templateId}`, "review", "waiting", 1);
|
|
5119
|
+
for (const e of data.examples ?? [])
|
|
5120
|
+
if (!e.templateId && !data.openedExamples?.includes(`process:${e.key}`))
|
|
5121
|
+
add(`available:process:${e.key}`, e.name, "exampleAvailable", `/admin/agent-work/processes`, "adopt", "new", 2);
|
|
5122
|
+
for (const e of data.kitExamples ?? [])
|
|
5123
|
+
if (data.kits && !data.incomplete.includes("kits") && !data.kits.some((k) => k.key === e.key) && !data.openedExamples?.includes(`kit:${e.key}`))
|
|
5124
|
+
add(`available:kit:${e.key}`, e.name, "exampleAvailable", `/admin/agent-work/kits`, "adopt", "new", 2);
|
|
5125
|
+
if (data.agentsKilled)
|
|
5126
|
+
add("agents-killed", "", "agentsStopped", "/admin/ai-apps", "open", "check", 3);
|
|
5127
|
+
for (const e of data.examples ?? [])
|
|
5128
|
+
if (e.outdated && e.templateId)
|
|
5129
|
+
add(`example:${e.key}`, e.name, "exampleUpdate", `/admin/agent-work/processes/${e.templateId}`, "update", "new", 2);
|
|
5130
|
+
for (const k of data.kits ?? []) {
|
|
5131
|
+
if (k.archived || k.audienceClass === "client" || k.teamId && !projects.has(k.teamId.toLowerCase()))
|
|
5132
|
+
continue;
|
|
5133
|
+
const href = `/admin/agent-work/kits/${k.id}`;
|
|
5134
|
+
if (k.draft?.submitted)
|
|
5135
|
+
add(`kit:${k.id}`, k.name, "approval", href, "review", "waiting", 1);
|
|
5136
|
+
if (k.latest && data.pins && !data.incomplete.includes("pins") && !data.pins.some((p) => p.kitKey === k.key))
|
|
5137
|
+
add(`unassigned:${k.id}`, k.name, "unassigned", href, "assign", "open", 0);
|
|
5138
|
+
if (data.kitUpdates?.includes(k.id))
|
|
5139
|
+
add(`kit-example:${k.id}`, k.name, "exampleUpdate", href, "update", "new", 2);
|
|
5140
|
+
}
|
|
5141
|
+
for (const g of data.guidance ?? [])
|
|
5142
|
+
if (g.layer !== "checklist" && g.draft && (!g.teamId || projects.has(g.teamId.toLowerCase())))
|
|
5143
|
+
add(`guidance:${g.id}`, g.name, "approval", `/admin/agent-work/guidance/${g.id}`, "review", "waiting", 1);
|
|
5144
|
+
for (const h of data.hosts ?? [])
|
|
5145
|
+
if (h.status === "draft")
|
|
5146
|
+
add(`host:${h.id}`, h.label, "hostApproval", "/admin/agent-work/kits/hosts", "review", "waiting", 1);
|
|
5147
|
+
const newestMachineProject = /* @__PURE__ */ new Map();
|
|
5148
|
+
const newestMachineTime = /* @__PURE__ */ new Map();
|
|
5149
|
+
for (const entry of data.health ?? [])
|
|
5150
|
+
if (projects.has(entry.teamId.toLowerCase()))
|
|
5151
|
+
for (const c of entry.value?.operations?.computers ?? []) {
|
|
5152
|
+
const time = Date.parse(c.cliReportedAt ?? c.reportedAt ?? "") || 0;
|
|
5153
|
+
if (!newestMachineProject.has(c.id.toLowerCase()) || time > (newestMachineTime.get(c.id.toLowerCase()) ?? 0)) {
|
|
5154
|
+
newestMachineProject.set(c.id.toLowerCase(), entry.teamId.toLowerCase());
|
|
5155
|
+
newestMachineTime.set(c.id.toLowerCase(), time);
|
|
5156
|
+
}
|
|
5157
|
+
}
|
|
5158
|
+
const machines = /* @__PURE__ */ new Set();
|
|
5159
|
+
for (const entry of [...data.health ?? []].sort((a, b) => (projects.get(a.teamId.toLowerCase())?.name ?? "").localeCompare(projects.get(b.teamId.toLowerCase())?.name ?? ""))) {
|
|
5160
|
+
const p = projects.get(entry.teamId.toLowerCase());
|
|
5161
|
+
if (!p || !entry.value)
|
|
5162
|
+
continue;
|
|
5163
|
+
const agent = entry.value.rows.find((r) => r.key === "review_agent");
|
|
5164
|
+
if (agent && ["areas_missing", "scopes_missing", "kit_outdated", "login_expires"].includes(agent.reason ?? ""))
|
|
5165
|
+
add(`agent:${p.teamId}`, p.name, "agent", projectHref(p.key, "/settings/process"), "open", agent.status === "unreachable" ? "check" : "open", 3);
|
|
5166
|
+
if (entry.value.operations?.more)
|
|
5167
|
+
add(`computer-more:${p.teamId}`, p.name, "computersIncomplete", projectHref(p.key, "/settings/process"), "open", "check", 3);
|
|
5168
|
+
for (const c of entry.value.operations?.computers ?? []) {
|
|
5169
|
+
if (machines.has(c.id.toLowerCase()) || newestMachineProject.get(c.id.toLowerCase()) !== entry.teamId.toLowerCase())
|
|
5170
|
+
continue;
|
|
5171
|
+
machines.add(c.id.toLowerCase());
|
|
5172
|
+
const subject = c.label ? `${p.name} · ${c.label}` : p.name;
|
|
5173
|
+
const release = entry.value.operations.releaseVersion;
|
|
5174
|
+
const stale = !!c.reportedAt && Date.parse(entry.value.checkedAt) - Date.parse(c.reportedAt) > setup_session_js_1.SETUP_HOST_FRESH_MINUTES * 6e4;
|
|
5175
|
+
if (c.service && (!c.reportedAt || !c.providerAuth || c.providerAuth !== "ok" || stale))
|
|
5176
|
+
add(`machine:${c.id}`, subject, "service", projectHref(p.key, "/settings/process"), "open", "check", 3, { observedAt: c.reportedAt });
|
|
5177
|
+
else if (c.cliVersion && newerVersion2(c.cliVersion, release))
|
|
5178
|
+
add(`machine:${c.id}`, subject, "cliUpdate", c.service ? projectHref(p.key, "/settings/process") : `/settings/connections?project=${encodeURIComponent(p.teamId)}#machine-setup`, "open", "new", 2, { values: { version: c.cliVersion, release }, observedAt: c.cliReportedAt });
|
|
5179
|
+
}
|
|
5180
|
+
}
|
|
5181
|
+
for (const a of data.accounts ?? []) {
|
|
5182
|
+
if (a.status !== "active")
|
|
5183
|
+
continue;
|
|
5184
|
+
const reason = a.loginCount === 0 ? a.credentialState?.revoked ? "loginRevoked" : a.credentialState?.expired ? "loginExpired" : "loginMissing" : a.credentialState?.expiresSoon ?? a.loginsExpireSoon ? "loginExpires" : a.credentialState?.neverUsed ? "loginUnused" : null;
|
|
5185
|
+
if (reason)
|
|
5186
|
+
add(`account:${a.id}`, a.name, reason, "/admin/bots", "open", "check", 3, { observedAt: a.lastActiveAt, observation: "activity" });
|
|
5187
|
+
}
|
|
5188
|
+
for (const b of data.slack ?? [])
|
|
5189
|
+
if (b.installationStatus !== "active")
|
|
5190
|
+
add(`slack:${b.id}`, b.teamName ?? "", "slack", "/admin/integrations", "open", "check", 4);
|
|
5191
|
+
for (const [i, c] of (data.code ?? []).entries())
|
|
5192
|
+
if (c.state !== "active")
|
|
5193
|
+
add(`code:${c.id ?? i}`, "", c.provider === "gitlab" ? "gitlab" : "github", "/admin/integrations", "open", "check", 4);
|
|
5194
|
+
for (const installation2 of data.platform?.installations ?? [])
|
|
5195
|
+
if (installation2.connectorId === "fleek.gitlab" && installation2.enabled) {
|
|
5196
|
+
const connections = data.platform.connections.filter((c) => c.installationId === installation2.id);
|
|
5197
|
+
if (!installation2.connectorEnabled || !connections.some((c) => c.status === "active"))
|
|
5198
|
+
add(`gitlab:${installation2.id}`, "", "gitlab", "/settings/integration-platform", "open", "check", 4);
|
|
5199
|
+
}
|
|
5200
|
+
for (const source of data.errors)
|
|
5201
|
+
add(`error:${source}`, "", "sourceError", "", "retry", "error", -1, { values: { source } });
|
|
5202
|
+
const sourceHref = {
|
|
5203
|
+
accounts: "/admin/bots",
|
|
5204
|
+
slack: "/admin/integrations",
|
|
5205
|
+
code: "/admin/integrations",
|
|
5206
|
+
integrations: "/settings/integration-platform",
|
|
5207
|
+
templates: "/admin/agent-work/processes",
|
|
5208
|
+
kits: "/admin/agent-work/kits",
|
|
5209
|
+
pins: "/admin/agent-work/kits",
|
|
5210
|
+
hosts: "/admin/agent-work/kits/hosts",
|
|
5211
|
+
guidance: "/admin/agent-work/guidance"
|
|
5212
|
+
};
|
|
5213
|
+
for (const source of data.incomplete)
|
|
5214
|
+
add(`more:${source}`, "", "incomplete", sourceHref[source] ?? "/admin/agent-work/setup", "open", "check", 3, { values: { source } });
|
|
5215
|
+
return rows.sort((a, b) => a.group - b.group || a.subject.localeCompare(b.subject) || a.id.localeCompare(b.id));
|
|
5216
|
+
}
|
|
5217
|
+
}
|
|
5218
|
+
});
|
|
5219
|
+
|
|
5220
|
+
// ../types/dist/skill-limits.js
|
|
5221
|
+
var require_skill_limits = __commonJS({
|
|
5222
|
+
"../types/dist/skill-limits.js"(exports) {
|
|
5223
|
+
"use strict";
|
|
5224
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5225
|
+
exports.SKILL_LIMITS = void 0;
|
|
5226
|
+
exports.SKILL_LIMITS = Object.freeze({ active: 4, key: 24, name: 48, sourceUrl: 128, sourceLabel: 48, version: 24, purpose: 128, installHint: 96, summary: 192, item: 768 });
|
|
5227
|
+
}
|
|
5228
|
+
});
|
|
5229
|
+
|
|
4915
5230
|
// ../types/dist/index.js
|
|
4916
5231
|
var require_dist = __commonJS({
|
|
4917
5232
|
"../types/dist/index.js"(exports) {
|
|
@@ -4948,6 +5263,8 @@ var require_dist = __commonJS({
|
|
|
4948
5263
|
__exportStar(require_focus(), exports);
|
|
4949
5264
|
__exportStar(require_access_request(), exports);
|
|
4950
5265
|
__exportStar(require_ticket_references(), exports);
|
|
5266
|
+
__exportStar(require_admin_todo(), exports);
|
|
5267
|
+
__exportStar(require_skill_limits(), exports);
|
|
4951
5268
|
}
|
|
4952
5269
|
});
|
|
4953
5270
|
|
|
@@ -30596,6 +30913,7 @@ var require_process_template2 = __commonJS({
|
|
|
30596
30913
|
"use strict";
|
|
30597
30914
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
30598
30915
|
exports.processTemplateDocumentSchema = exports.processTemplateChecklistItemKey = exports.processTemplateName = exports.processTemplateKey = void 0;
|
|
30916
|
+
exports.isProcessChecklistState = isProcessChecklistState;
|
|
30599
30917
|
var zod_1 = require_zod();
|
|
30600
30918
|
var types_1 = require_dist();
|
|
30601
30919
|
var L = types_1.PROCESS_TEMPLATE_LIMITS;
|
|
@@ -30671,6 +30989,9 @@ var require_process_template2 = __commonJS({
|
|
|
30671
30989
|
routeOptions: zod_1.z.array(routeOption).max(L.routeOptions),
|
|
30672
30990
|
gateChecklists: zod_1.z.array(gateChecklist).max(L.states).optional()
|
|
30673
30991
|
}).strict();
|
|
30992
|
+
function isProcessChecklistState(document3, state2) {
|
|
30993
|
+
return !!state2 && !!state2.role && types_1.GUIDANCE_CHECKLIST_GATE_ROLES.includes(state2.role) && (state2.isGate || (state2.role === "review" || state2.role === "acceptance") && document3.rules.some((rule2) => rule2.toStateKey === state2.key && rule2.conditions.includes("checklist_complete")));
|
|
30994
|
+
}
|
|
30674
30995
|
}
|
|
30675
30996
|
});
|
|
30676
30997
|
|
|
@@ -31009,7 +31330,7 @@ var require_process_template_file_issues = __commonJS({
|
|
|
31009
31330
|
const state = keys.get(gateKey);
|
|
31010
31331
|
if (!state)
|
|
31011
31332
|
add({ at, problem: "unknown_state", field: "gateStateKey", value: clip(gateKey) });
|
|
31012
|
-
else if (state.isGate !== true || typeof state.role !== "string" || !GATE_ROLES.includes(state.role)) {
|
|
31333
|
+
else if (state.isGate !== true && !(["review", "acceptance"].includes(String(state.role)) && arrayOf(raw.rules).some((rule) => isObject2(rule) && rule.toStateKey === gateKey && arrayOf(rule.conditions).includes("checklist_complete"))) || typeof state.role !== "string" || !GATE_ROLES.includes(state.role)) {
|
|
31013
31334
|
add({ at, problem: "not_gate", field: "gateStateKey", value: clip(stateLabel(state) ?? gateKey) });
|
|
31014
31335
|
} else if (gates.has(gateKey) || roles.has(state.role))
|
|
31015
31336
|
add({ at, problem: "duplicate_checklist_role", field: "gateStateKey" });
|
|
@@ -31578,9 +31899,10 @@ var require_setup_package2 = __commonJS({
|
|
|
31578
31899
|
exports.setupWalkthroughSections = setupWalkthroughSections;
|
|
31579
31900
|
exports.setupTemplateName = setupTemplateName;
|
|
31580
31901
|
exports.uniqueSetupTemplateName = uniqueSetupTemplateName;
|
|
31902
|
+
var process_template_js_1 = require_process_template2();
|
|
31581
31903
|
var zod_1 = require_zod();
|
|
31582
31904
|
var types_1 = require_dist();
|
|
31583
|
-
var
|
|
31905
|
+
var process_template_js_2 = require_process_template2();
|
|
31584
31906
|
var process_diff_js_1 = require_process_diff();
|
|
31585
31907
|
var process_rule_defaults_js_1 = require_process_rule_defaults();
|
|
31586
31908
|
var secret_shape_js_1 = require_secret_shape();
|
|
@@ -31590,16 +31912,16 @@ var require_setup_package2 = __commonJS({
|
|
|
31590
31912
|
var gateRole = zod_1.z.enum(types_1.GUIDANCE_CHECKLIST_GATE_ROLES);
|
|
31591
31913
|
exports.setupCustomerSchema = zod_1.z.discriminatedUnion("mode", [
|
|
31592
31914
|
zod_1.z.object({ mode: zod_1.z.literal("existing"), clientGroupId: uuid }).strict(),
|
|
31593
|
-
zod_1.z.object({ mode: zod_1.z.literal("new"), name:
|
|
31915
|
+
zod_1.z.object({ mode: zod_1.z.literal("new"), name: process_template_js_2.processTemplateName }).strict(),
|
|
31594
31916
|
zod_1.z.object({ mode: zod_1.z.literal("none") }).strict()
|
|
31595
31917
|
]);
|
|
31596
31918
|
exports.setupProjectSchema = zod_1.z.discriminatedUnion("mode", [
|
|
31597
31919
|
zod_1.z.object({
|
|
31598
31920
|
mode: zod_1.z.literal("existing"),
|
|
31599
31921
|
teamId: uuid,
|
|
31600
|
-
stateMap: zod_1.z.record(
|
|
31922
|
+
stateMap: zod_1.z.record(process_template_js_2.processTemplateKey, uuid.nullable()).refine((map) => Object.keys(map).length <= types_1.PROCESS_TEMPLATE_LIMITS.states)
|
|
31601
31923
|
}).strict(),
|
|
31602
|
-
zod_1.z.object({ mode: zod_1.z.literal("new"), name:
|
|
31924
|
+
zod_1.z.object({ mode: zod_1.z.literal("new"), name: process_template_js_2.processTemplateName, key: teamKey }).strict()
|
|
31603
31925
|
]);
|
|
31604
31926
|
var plainName = (max) => zod_1.z.string().trim().min(1).max(max).regex(/^[^<>\r\n\u2028\u2029]*$/);
|
|
31605
31927
|
var spaceChoice = zod_1.z.discriminatedUnion("mode", [
|
|
@@ -31642,10 +31964,10 @@ var require_setup_package2 = __commonJS({
|
|
|
31642
31964
|
schema: zod_1.z.literal(types_1.SETUP_PACKAGE_SCHEMA),
|
|
31643
31965
|
customer: exports.setupCustomerSchema,
|
|
31644
31966
|
project: exports.setupProjectSchema,
|
|
31645
|
-
process: zod_1.z.object({ strand: zod_1.z.enum(types_1.PROCESS_TEMPLATE_STRANDS), templateName:
|
|
31967
|
+
process: zod_1.z.object({ strand: zod_1.z.enum(types_1.PROCESS_TEMPLATE_STRANDS), templateName: process_template_js_2.processTemplateName, document: process_template_js_2.processTemplateDocumentSchema }).strict(),
|
|
31646
31968
|
people: zod_1.z.array(zod_1.z.object({ userId: uuid, role: zod_1.z.enum(types_1.SETUP_PERSON_ROLES) }).strict()).max(L.people).refine((list2) => new Set(list2.map((entry) => entry.userId)).size === list2.length, { message: "duplicate person" }),
|
|
31647
31969
|
checklists: zod_1.z.array(zod_1.z.object({ gateRole, mode: zod_1.z.enum(["template", "own"]) }).strict()).max(types_1.GUIDANCE_CHECKLIST_GATE_ROLES.length).refine((list2) => new Set(list2.map((entry) => entry.gateRole)).size === list2.length, { message: "duplicate gate" }),
|
|
31648
|
-
unresolved: zod_1.z.array(zod_1.z.object({ kind: zod_1.z.enum(["decider", "pool", "handoff"]), ruleKey: zod_1.z.string().max(80).optional(), stateKey:
|
|
31970
|
+
unresolved: zod_1.z.array(zod_1.z.object({ kind: zod_1.z.enum(["decider", "pool", "handoff"]), ruleKey: zod_1.z.string().max(80).optional(), stateKey: process_template_js_2.processTemplateKey.optional() }).strict()).max(types_1.PROCESS_TEMPLATE_LIMITS.rules),
|
|
31649
31971
|
knowledge: exports.setupKnowledgeSectionSchema.optional(),
|
|
31650
31972
|
kits: exports.setupKitsSectionSchema.optional(),
|
|
31651
31973
|
pilot: zod_1.z.object({ assist: zod_1.z.boolean(), mcp: zod_1.z.boolean(), namedIdentity: zod_1.z.boolean(), guestAgents: zod_1.z.boolean(), maintainer: zod_1.z.boolean() }).strict().optional()
|
|
@@ -31657,10 +31979,10 @@ var require_setup_package2 = __commonJS({
|
|
|
31657
31979
|
exports.setupInvitesSchema = zod_1.z.array(exports.setupInviteSchema).max(L.invites).refine((list2) => new Set(list2.map((entry) => entry.email)).size === list2.length, { message: "duplicate invite" });
|
|
31658
31980
|
var stateRole = zod_1.z.enum(types_1.TEAM_STATE_ROLES);
|
|
31659
31981
|
var SETUP_C_OP_SCHEMAS = [
|
|
31660
|
-
zod_1.z.object({ op: zod_1.z.literal("renameState"), state:
|
|
31661
|
-
zod_1.z.object({ op: zod_1.z.literal("removeState"), state:
|
|
31662
|
-
zod_1.z.object({ op: zod_1.z.literal("addState"), name:
|
|
31663
|
-
zod_1.z.object({ op: zod_1.z.literal("setGateDecider"), state:
|
|
31982
|
+
zod_1.z.object({ op: zod_1.z.literal("renameState"), state: process_template_js_2.processTemplateKey, name: process_template_js_2.processTemplateName }).strict(),
|
|
31983
|
+
zod_1.z.object({ op: zod_1.z.literal("removeState"), state: process_template_js_2.processTemplateKey }).strict(),
|
|
31984
|
+
zod_1.z.object({ op: zod_1.z.literal("addState"), name: process_template_js_2.processTemplateName, role: stateRole.nullable(), isGate: zod_1.z.boolean(), after: process_template_js_2.processTemplateKey.nullable() }).strict(),
|
|
31985
|
+
zod_1.z.object({ op: zod_1.z.literal("setGateDecider"), state: process_template_js_2.processTemplateKey, role: zod_1.z.enum(types_1.TRANSITION_DECIDER_ROLES) }).strict(),
|
|
31664
31986
|
zod_1.z.object({
|
|
31665
31987
|
op: zod_1.z.literal("setClarificationBudget"),
|
|
31666
31988
|
maxQuestions: zod_1.z.number().int().min(0).max(10),
|
|
@@ -31672,24 +31994,24 @@ var require_setup_package2 = __commonJS({
|
|
|
31672
31994
|
label: zod_1.z.string().trim().min(1).max(types_1.PROCESS_TEMPLATE_LIMITS.routeLabel).regex(/^[^<>\r\n\u2028\u2029]*$/)
|
|
31673
31995
|
}).strict()).max(types_1.PROCESS_TEMPLATE_LIMITS.routeOptions) }).strict(),
|
|
31674
31996
|
zod_1.z.object({ op: zod_1.z.literal("setChecklistItems"), gateRole, items: zod_1.z.array(zod_1.z.object({
|
|
31675
|
-
key:
|
|
31997
|
+
key: process_template_js_2.processTemplateChecklistItemKey.optional(),
|
|
31676
31998
|
text: zod_1.z.string().trim().min(1).max(types_1.PROCESS_TEMPLATE_LIMITS.checklistText).regex(/^[^<>{}\r\n\u2028\u2029]*$/),
|
|
31677
31999
|
humanOnly: zod_1.z.boolean().optional()
|
|
31678
32000
|
}).strict()).min(1).max(types_1.PROCESS_TEMPLATE_LIMITS.checklistItems) }).strict()
|
|
31679
32001
|
];
|
|
31680
32002
|
var UNIFY2B_OP_SCHEMAS = [
|
|
31681
|
-
zod_1.z.object({ op: zod_1.z.literal("connect"), from:
|
|
31682
|
-
zod_1.z.object({ op: zod_1.z.literal("disconnect"), from:
|
|
32003
|
+
zod_1.z.object({ op: zod_1.z.literal("connect"), from: process_template_js_2.processTemplateKey.nullable(), to: process_template_js_2.processTemplateKey }).strict(),
|
|
32004
|
+
zod_1.z.object({ op: zod_1.z.literal("disconnect"), from: process_template_js_2.processTemplateKey.nullable(), to: process_template_js_2.processTemplateKey }).strict(),
|
|
31683
32005
|
zod_1.z.object({
|
|
31684
32006
|
op: zod_1.z.literal("setRule"),
|
|
31685
|
-
from:
|
|
31686
|
-
to:
|
|
32007
|
+
from: process_template_js_2.processTemplateKey.nullable(),
|
|
32008
|
+
to: process_template_js_2.processTemplateKey,
|
|
31687
32009
|
who: zod_1.z.enum(types_1.SETUP_RULE_WHO),
|
|
31688
32010
|
roles: zod_1.z.array(zod_1.z.enum(types_1.TRANSITION_DECIDER_ROLES)).max(3),
|
|
31689
32011
|
humanOnly: zod_1.z.boolean(),
|
|
31690
32012
|
conditions: zod_1.z.array(zod_1.z.enum(types_1.TRANSITION_CONDITIONS)).max(types_1.TRANSITION_CONDITIONS.length)
|
|
31691
32013
|
}).strict(),
|
|
31692
|
-
zod_1.z.object({ op: zod_1.z.literal("setAgent"), state:
|
|
32014
|
+
zod_1.z.object({ op: zod_1.z.literal("setAgent"), state: process_template_js_2.processTemplateKey, on: zod_1.z.boolean() }).strict()
|
|
31693
32015
|
];
|
|
31694
32016
|
exports.setupOpSchema = zod_1.z.discriminatedUnion("op", [...SETUP_C_OP_SCHEMAS, ...UNIFY2B_OP_SCHEMAS]);
|
|
31695
32017
|
exports.setupOpsSchema = zod_1.z.array(exports.setupOpSchema).max(L.ops);
|
|
@@ -31719,7 +32041,7 @@ var require_setup_package2 = __commonJS({
|
|
|
31719
32041
|
return key;
|
|
31720
32042
|
};
|
|
31721
32043
|
function gateStateOf(document3, role) {
|
|
31722
|
-
return document3.states.find((state) =>
|
|
32044
|
+
return document3.states.find((state) => (0, process_template_js_1.isProcessChecklistState)(document3, state) && state.role === role);
|
|
31723
32045
|
}
|
|
31724
32046
|
function gateEntryRules(document3, stateKey) {
|
|
31725
32047
|
const position = new Map(document3.states.map((state) => [state.key, state.position]));
|
|
@@ -33435,17 +33757,18 @@ var require_workflow_file = __commonJS({
|
|
|
33435
33757
|
exports.parseChecklistMarkdown = parseChecklistMarkdown;
|
|
33436
33758
|
exports.checkWorkflowFile = checkWorkflowFile;
|
|
33437
33759
|
exports.processFileDocument = processFileDocument;
|
|
33760
|
+
var process_template_js_1 = require_process_template2();
|
|
33438
33761
|
var zod_1 = require_zod();
|
|
33439
33762
|
var zod_compat_js_1 = require_zod_compat();
|
|
33440
33763
|
var types_1 = require_dist();
|
|
33441
33764
|
var schema_js_1 = require_schema();
|
|
33442
|
-
var
|
|
33765
|
+
var process_template_js_2 = require_process_template2();
|
|
33443
33766
|
var process_template_file_js_1 = require_process_template_file();
|
|
33444
33767
|
var process_template_file_issues_js_1 = require_process_template_file_issues();
|
|
33445
33768
|
exports.WORKFLOW_FILE_SCHEMA = "fleek.workflow-file.v1";
|
|
33446
33769
|
var checklist = zod_1.z.object({
|
|
33447
|
-
gateStateKey:
|
|
33448
|
-
title:
|
|
33770
|
+
gateStateKey: process_template_js_2.processTemplateKey,
|
|
33771
|
+
title: process_template_js_2.processTemplateName,
|
|
33449
33772
|
markdown: zod_1.z.string().max(process_template_file_js_1.PROCESS_TEMPLATE_FILE_MAX_BYTES)
|
|
33450
33773
|
}).strict();
|
|
33451
33774
|
var source = zod_1.z.object({ versionId: zod_1.z.string().guid(), contentHash: zod_1.z.string().regex(/^[0-9a-f]{64}$/) }).strict();
|
|
@@ -33526,7 +33849,7 @@ var require_workflow_file = __commonJS({
|
|
|
33526
33849
|
for (const [index, entry] of entries.entries()) {
|
|
33527
33850
|
const path = `checklists[${index}]`;
|
|
33528
33851
|
const state = file.document.states.find((state2) => state2.key === entry.gateStateKey);
|
|
33529
|
-
if (!
|
|
33852
|
+
if (!(0, process_template_js_1.isProcessChecklistState)(file.document, state) || !state?.role) {
|
|
33530
33853
|
issues.push({ path, problem: "checklist_target_unknown" });
|
|
33531
33854
|
continue;
|
|
33532
33855
|
}
|
|
@@ -33551,7 +33874,7 @@ var require_workflow_file = __commonJS({
|
|
|
33551
33874
|
}
|
|
33552
33875
|
}
|
|
33553
33876
|
const candidate = { ...file.document, ...entries.length ? { gateChecklists: content3 } : {} };
|
|
33554
|
-
const document3 =
|
|
33877
|
+
const document3 = process_template_js_2.processTemplateDocumentSchema.safeParse(candidate);
|
|
33555
33878
|
if (!document3.success)
|
|
33556
33879
|
issues.push(...document3.error.issues.map((issue) => ({ path: issue.path.join("."), problem: (0, zod_compat_js_1.legacyIssueCode)(issue, candidate) })));
|
|
33557
33880
|
if (issues.length || !document3.success)
|
|
@@ -35621,7 +35944,7 @@ var require_dist2 = __commonJS({
|
|
|
35621
35944
|
});
|
|
35622
35945
|
|
|
35623
35946
|
// src/cli.ts
|
|
35624
|
-
var
|
|
35947
|
+
var import_types10 = __toESM(require_dist(), 1);
|
|
35625
35948
|
import { spawn as spawn9 } from "node:child_process";
|
|
35626
35949
|
import { createHash as createHash9, randomBytes as randomBytes12 } from "node:crypto";
|
|
35627
35950
|
import { realpath as realpath19, rm as rm13 } from "node:fs/promises";
|
|
@@ -36454,7 +36777,7 @@ var EN = {
|
|
|
36454
36777
|
"errors.linkHandlerNoFleek": "No installed fleek found for the link handler.",
|
|
36455
36778
|
"errors.linkHandlerNoFleek.next": "fleek setup <code>",
|
|
36456
36779
|
"link.focused": "{key}: Orca worktree opened.",
|
|
36457
|
-
"link.confirmStart": 'Start {key} "{title}" in Orca? This claims the ticket for this computer and creates a worktree.',
|
|
36780
|
+
"link.confirmStart": 'Start {key} "{title}" in Orca with {agent}? Task: {task}. This claims the ticket for this computer and creates a worktree.',
|
|
36458
36781
|
"link.start": "Start",
|
|
36459
36782
|
"link.cancel": "Cancel",
|
|
36460
36783
|
"link.cancelled": "Nothing started.",
|
|
@@ -37105,7 +37428,7 @@ var DE = {
|
|
|
37105
37428
|
"errors.linkHandlerNoFleek": "Kein installiertes fleek für den Link-Handler gefunden.",
|
|
37106
37429
|
"errors.linkHandlerNoFleek.next": "fleek setup <Code>",
|
|
37107
37430
|
"link.focused": "{key}: Orca-Worktree geöffnet.",
|
|
37108
|
-
"link.confirmStart": "{key} „{title}“ in Orca starten? Das Ticket wird für diesen Rechner übernommen und ein Worktree angelegt.",
|
|
37431
|
+
"link.confirmStart": "{key} „{title}“ mit {agent} in Orca starten? Auftrag: {task}. Das Ticket wird für diesen Rechner übernommen und ein Worktree angelegt.",
|
|
37109
37432
|
"link.start": "Starten",
|
|
37110
37433
|
"link.cancel": "Abbrechen",
|
|
37111
37434
|
"link.cancelled": "Nichts gestartet.",
|
|
@@ -47149,11 +47472,6 @@ function checkMcpServers(list2, context, errors) {
|
|
|
47149
47472
|
}
|
|
47150
47473
|
closedKeys(entry, MCP_SERVER_KEYS, path, errors, FORBIDDEN_MCP_KEYS);
|
|
47151
47474
|
const { name, url } = entry;
|
|
47152
|
-
for (const [field, value] of [["name", name], ["url", url]]) {
|
|
47153
|
-
if (typeof value === "string")
|
|
47154
|
-
for (const hit of scanSecrets(value))
|
|
47155
|
-
errors.push({ reason: `secret_${hit.pattern}`, path: `${path}.${field}` });
|
|
47156
|
-
}
|
|
47157
47475
|
if (typeof name !== "string" || !MCP_SERVER_NAME.test(name))
|
|
47158
47476
|
errors.push({ reason: "mcp_name", path: `${path}.name` });
|
|
47159
47477
|
else if (names2.has(name))
|
|
@@ -47161,6 +47479,12 @@ function checkMcpServers(list2, context, errors) {
|
|
|
47161
47479
|
else
|
|
47162
47480
|
names2.add(name);
|
|
47163
47481
|
const canonical2 = canonicalHttpsUrl(url);
|
|
47482
|
+
if (typeof name === "string" && name.length <= 33)
|
|
47483
|
+
for (const hit of scanSecrets(name))
|
|
47484
|
+
errors.push({ reason: `secret_${hit.pattern}`, path: `${path}.name` });
|
|
47485
|
+
if (typeof url === "string" && url.length <= URL_MAX_LENGTH)
|
|
47486
|
+
for (const hit of scanSecrets(url))
|
|
47487
|
+
errors.push({ reason: `secret_${hit.pattern}`, path: `${path}.url` });
|
|
47164
47488
|
if (!canonical2.ok) {
|
|
47165
47489
|
errors.push({ reason: `url_${canonical2.reason}`, path: `${path}.url` });
|
|
47166
47490
|
return;
|
|
@@ -47677,7 +48001,7 @@ function reassembleKitParts(parts, verifiedPayload, versionId) {
|
|
|
47677
48001
|
const bad = () => {
|
|
47678
48002
|
throw new KitFormatError("KIT_INVALID", "transport_parts");
|
|
47679
48003
|
};
|
|
47680
|
-
if (parts.length < 1 || parts.length > KIT_MAX_PARTS)
|
|
48004
|
+
if (verifiedPayload.validatorVersion !== KIT_VALIDATOR_VERSION || parts.length < 1 || parts.length > KIT_MAX_PARTS)
|
|
47681
48005
|
return bad();
|
|
47682
48006
|
const sorted = [...parts].sort((a, b) => a.part - b.part), count = sorted.length, chunks = [];
|
|
47683
48007
|
for (let index = 0; index < count; index++) {
|
|
@@ -48587,6 +48911,7 @@ async function reloadProxyProfile(store, started) {
|
|
|
48587
48911
|
}
|
|
48588
48912
|
|
|
48589
48913
|
// src/orca.ts
|
|
48914
|
+
var import_types5 = __toESM(require_dist(), 1);
|
|
48590
48915
|
import { execFile as nodeExecFile } from "node:child_process";
|
|
48591
48916
|
|
|
48592
48917
|
// src/mutation.ts
|
|
@@ -48837,7 +49162,7 @@ async function orcaTasks(deps, values) {
|
|
|
48837
49162
|
for (const line of deps.out.style.columns(items.map((entry) => [deps.out.style.bold(entry.key), entry.mine ? deps.t("orca.mine") : "", entry.claimable ? deps.t("orca.claimable") : deps.t("orca.notClaimable"), neutralizeLine(entry.status), neutralizeLine(entry.title)]), "")) deps.out.line(line);
|
|
48838
49163
|
return EXIT.ok;
|
|
48839
49164
|
}
|
|
48840
|
-
async function oneTask(deps, found, client, key) {
|
|
49165
|
+
async function oneTask(deps, found, client, key, labels = {}) {
|
|
48841
49166
|
if (!KEY.test(key)) throw usage();
|
|
48842
49167
|
let issue;
|
|
48843
49168
|
await available(client, WIRE.getIssue);
|
|
@@ -48848,8 +49173,8 @@ async function oneTask(deps, found, client, key) {
|
|
|
48848
49173
|
throw error;
|
|
48849
49174
|
}
|
|
48850
49175
|
if (issue.identifier !== key) throw new CliError("errors.orcaTaskUnknown", EXIT.failed, {}, "NOT_FOUND");
|
|
48851
|
-
const list2 = await teams(client);
|
|
48852
|
-
const states = await statesOf(client, typeof issue.teamId === "string" ? [issue.teamId.toLowerCase()] : []);
|
|
49176
|
+
const list2 = labels.url === false ? [] : await teams(client);
|
|
49177
|
+
const states = labels.status === false ? /* @__PURE__ */ new Map() : await statesOf(client, typeof issue.teamId === "string" ? [issue.teamId.toLowerCase()] : []);
|
|
48853
49178
|
const result = item(found.profile, issue, new Map(list2.map((team) => [team.id, team])), states);
|
|
48854
49179
|
if (!result) throw new CliError("errors.orcaTaskUnknown", EXIT.failed, {}, "NOT_FOUND");
|
|
48855
49180
|
return result;
|
|
@@ -48903,7 +49228,7 @@ async function orcaStart(deps, key, values) {
|
|
|
48903
49228
|
if (!found.root) throw notBound();
|
|
48904
49229
|
const program = await orcaProgram(deps);
|
|
48905
49230
|
const client = await deps.sessionFor(found.profile);
|
|
48906
|
-
const task = await oneTask(deps, found, client, key);
|
|
49231
|
+
const task = await oneTask(deps, found, client, key, { status: false });
|
|
48907
49232
|
if (values.expectProject && found.projectId?.toLowerCase() !== values.expectProject.toLowerCase()) throw notBound();
|
|
48908
49233
|
const name = worktreeName(task.key, task.title);
|
|
48909
49234
|
const reference = referenceUrl(found.profile, task.key);
|
|
@@ -48916,6 +49241,7 @@ async function orcaStart(deps, key, values) {
|
|
|
48916
49241
|
throw error;
|
|
48917
49242
|
}
|
|
48918
49243
|
const claimId = typeof claim.claimId === "string" && UUID2.test(claim.claimId) ? claim.claimId.toLowerCase() : null;
|
|
49244
|
+
const firstPrompt = typeof values.prompt === "string" && values.prompt.length > 0 && values.prompt.length <= import_types5.OPEN_IN_TEXT_MAX ? values.prompt : null;
|
|
48919
49245
|
const args = [
|
|
48920
49246
|
"worktree",
|
|
48921
49247
|
"create",
|
|
@@ -48926,6 +49252,7 @@ async function orcaStart(deps, key, values) {
|
|
|
48926
49252
|
...reference ? ["--reference", reference] : [],
|
|
48927
49253
|
"--agent",
|
|
48928
49254
|
agent,
|
|
49255
|
+
...firstPrompt ? ["--prompt", firstPrompt] : [],
|
|
48929
49256
|
...values.activate ? ["--activate"] : [],
|
|
48930
49257
|
"--json"
|
|
48931
49258
|
];
|
|
@@ -52365,26 +52692,13 @@ async function validProgram(program, configDir) {
|
|
|
52365
52692
|
}
|
|
52366
52693
|
|
|
52367
52694
|
// src/link.ts
|
|
52695
|
+
var import_types6 = __toESM(require_dist(), 1);
|
|
52368
52696
|
import { stat as stat13 } from "node:fs/promises";
|
|
52369
52697
|
import { dirname as dirname16 } from "node:path";
|
|
52370
|
-
var LINK_SCHEME =
|
|
52371
|
-
var LINK_MAX = 512;
|
|
52372
|
-
var SLUG = /^[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?$/;
|
|
52373
|
-
var KEY2 = /^[A-Z0-9]{2,10}-[1-9][0-9]{0,8}$/;
|
|
52698
|
+
var LINK_SCHEME = import_types6.OPEN_IN_LINK_SCHEME;
|
|
52374
52699
|
function parseFleekLink(input) {
|
|
52375
|
-
|
|
52376
|
-
|
|
52377
|
-
try {
|
|
52378
|
-
url = new URL(input);
|
|
52379
|
-
} catch {
|
|
52380
|
-
return null;
|
|
52381
|
-
}
|
|
52382
|
-
if (url.protocol !== `${LINK_SCHEME}:` || url.hostname !== "open" || url.pathname !== "" && url.pathname !== "/" || url.username || url.password || url.port || url.hash) return null;
|
|
52383
|
-
const names2 = [...url.searchParams.keys()];
|
|
52384
|
-
if (names2.length !== 2 || new Set(names2).size !== 2 || !names2.includes("workspace") || !names2.includes("ticket")) return null;
|
|
52385
|
-
const workspace = url.searchParams.get("workspace").toLowerCase();
|
|
52386
|
-
const ticket = url.searchParams.get("ticket").toUpperCase();
|
|
52387
|
-
return SLUG.test(workspace) && KEY2.test(ticket) ? { action: "orca-open", workspace, ticket } : null;
|
|
52700
|
+
const link3 = (0, import_types6.parseOpenInLink)(input);
|
|
52701
|
+
return link3 ? { action: "orca-open", ...link3 } : null;
|
|
52388
52702
|
}
|
|
52389
52703
|
var object6 = (value) => !!value && typeof value === "object" && !Array.isArray(value);
|
|
52390
52704
|
var refused = (key, code, params = {}) => new CliError(key, EXIT.failed, params, code);
|
|
@@ -52483,7 +52797,7 @@ async function linkOpen(deps, url, values = {}) {
|
|
|
52483
52797
|
if (!link3) throw new CliError("errors.linkInvalid", EXIT.usage, {}, "LINK_INVALID");
|
|
52484
52798
|
const profile = await profileOf(deps, link3.workspace);
|
|
52485
52799
|
const client = await deps.sessionFor(profile);
|
|
52486
|
-
const task = await oneTask(deps, { profile }, client, link3.ticket);
|
|
52800
|
+
const task = await oneTask(deps, { profile }, client, link3.ticket, { status: false, url: false });
|
|
52487
52801
|
const root = await checkoutOf(deps.configDir, profile.key, task.projectId);
|
|
52488
52802
|
const program = await orcaProgram(deps);
|
|
52489
52803
|
const exec = (args) => (deps.execFile ?? defaultExec)(program, args, { cwd: root, env: orcaEnv(deps.env), timeoutMs: 6e4 }).catch(() => ({ code: 1, stdout: "", stderr: "" }));
|
|
@@ -52498,7 +52812,15 @@ async function linkOpen(deps, url, values = {}) {
|
|
|
52498
52812
|
else deps.out.line(deps.out.style.ok(deps.t("link.focused", { key: task.key })));
|
|
52499
52813
|
return EXIT.ok;
|
|
52500
52814
|
}
|
|
52501
|
-
const
|
|
52815
|
+
const agent = values.agent ?? link3.agent ?? "claude";
|
|
52816
|
+
const cliLang = locale(deps.env);
|
|
52817
|
+
const lang = link3.lang ?? cliLang;
|
|
52818
|
+
const question = deps.t("link.confirmStart", {
|
|
52819
|
+
key: task.key,
|
|
52820
|
+
title: neutralizeLine(task.title).slice(0, 120),
|
|
52821
|
+
agent: agent === "codex" ? "Codex" : agent === "claude" ? "Claude" : neutralizeLine(agent).slice(0, 32),
|
|
52822
|
+
task: (0, import_types6.openInTask)(link3.step, link3.role, cliLang)
|
|
52823
|
+
});
|
|
52502
52824
|
const labels = { yes: deps.t("link.start"), no: deps.t("link.cancel") };
|
|
52503
52825
|
const answer2 = deps.isTTY && deps.ask ? /^(y|yes|j|ja)$/i.test((await deps.ask(`${question} (y/N)`)).trim()) : await (deps.dialog ?? systemDialog(deps.platform ?? process.platform, deps.which, (file, args) => defaultExec(file, args, { cwd: root, env: orcaEnv(deps.env), timeoutMs: 6e5 }))).confirm(question, labels);
|
|
52504
52826
|
if (answer2 === null) throw refused("errors.linkConfirmUnavailable", "CONFIRMATION_REQUIRED", { key: task.key });
|
|
@@ -52507,7 +52829,8 @@ async function linkOpen(deps, url, values = {}) {
|
|
|
52507
52829
|
else deps.out.line(deps.out.style.note(deps.t("link.cancelled")));
|
|
52508
52830
|
return EXIT.ok;
|
|
52509
52831
|
}
|
|
52510
|
-
|
|
52832
|
+
const prompt = (0, import_types6.openInStartText)({ workspace: link3.workspace, ticket: task.key, step: link3.step ?? null, role: link3.role ?? null, locale: lang });
|
|
52833
|
+
return orcaStart({ ...deps, cwd: root }, task.key, { profile: profile.key, expectProject: task.projectId, activate: true, agent, ...prompt ? { prompt } : {} });
|
|
52511
52834
|
}
|
|
52512
52835
|
|
|
52513
52836
|
// src/link-handler.ts
|
|
@@ -52882,7 +53205,7 @@ import { spawn as spawn7 } from "node:child_process";
|
|
|
52882
53205
|
import { randomBytes as randomBytes10 } from "node:crypto";
|
|
52883
53206
|
import { readFile as readFile20, realpath as realpath15 } from "node:fs/promises";
|
|
52884
53207
|
import { isAbsolute as isAbsolute9, join as join28, resolve as resolve6, sep as sep8 } from "node:path";
|
|
52885
|
-
var
|
|
53208
|
+
var import_types7 = __toESM(require_dist(), 1);
|
|
52886
53209
|
|
|
52887
53210
|
// src/kit-keys.ts
|
|
52888
53211
|
var KIT_KEYS = Object.freeze({
|
|
@@ -54568,7 +54891,7 @@ function parseListing(result) {
|
|
|
54568
54891
|
const seen = /* @__PURE__ */ new Set();
|
|
54569
54892
|
return kits.map((raw) => {
|
|
54570
54893
|
const k = raw;
|
|
54571
|
-
if (!k || typeof k !== "object" || !isKitKey(k.kitKey) || seen.has(k.kitKey) || !KIT_KINDS.includes(String(k.kind)) || !
|
|
54894
|
+
if (!k || typeof k !== "object" || !isKitKey(k.kitKey) || seen.has(k.kitKey) || !KIT_KINDS.includes(String(k.kind)) || !import_types7.PROJECT_MEMBER_ROLES.includes(String(k.role)) || !Number.isSafeInteger(k.version) || k.version < 1 || typeof k.versionId !== "string" || !UUID.test(k.versionId) || typeof k.contentHash !== "string" || !/^[0-9a-f]{64}$/.test(k.contentHash) || !KIT_PLACEMENTS.includes(String(k.placement)) || !Number.isSafeInteger(k.parts) || k.parts < 1 || k.parts > KIT_MAX_PARTS) {
|
|
54572
54895
|
throw protocol("listing");
|
|
54573
54896
|
}
|
|
54574
54897
|
seen.add(k.kitKey);
|
|
@@ -56237,7 +56560,7 @@ async function runApplication(ctx, client, values, checkout, context, app, appli
|
|
|
56237
56560
|
}
|
|
56238
56561
|
|
|
56239
56562
|
// src/service.ts
|
|
56240
|
-
var
|
|
56563
|
+
var import_types8 = __toESM(require_dist(), 1);
|
|
56241
56564
|
import { spawn as spawn8 } from "node:child_process";
|
|
56242
56565
|
import { randomBytes as randomBytes11, randomUUID as randomUUID5 } from "node:crypto";
|
|
56243
56566
|
import { constants as fsConstants6 } from "node:fs";
|
|
@@ -56339,7 +56662,7 @@ var TokenFilter = class {
|
|
|
56339
56662
|
var usage4 = () => new CliError("errors.usage", EXIT.usage, {}, "USAGE");
|
|
56340
56663
|
function normalizeSetupCode(value) {
|
|
56341
56664
|
const code = (value ?? "").toUpperCase().replace(/[\s-]/g, "");
|
|
56342
|
-
if (code.length !==
|
|
56665
|
+
if (code.length !== import_types8.SERVICE_ACCOUNT_USER_CODE_LENGTH || [...code].some((char) => !import_types8.SERVICE_ACCOUNT_USER_CODE_CHARSET.includes(char))) throw usage4();
|
|
56343
56666
|
return code;
|
|
56344
56667
|
}
|
|
56345
56668
|
function serverArg(value) {
|
|
@@ -57223,7 +57546,7 @@ function realSystem(options = {}) {
|
|
|
57223
57546
|
}
|
|
57224
57547
|
|
|
57225
57548
|
// src/setup.ts
|
|
57226
|
-
var
|
|
57549
|
+
var import_types9 = __toESM(require_dist(), 1);
|
|
57227
57550
|
import { hostname } from "node:os";
|
|
57228
57551
|
import { join as join32, resolve as resolve8 } from "node:path";
|
|
57229
57552
|
import { realpath as realpath18 } from "node:fs/promises";
|
|
@@ -57386,7 +57709,7 @@ function createSetupProxyAdapter(ctx) {
|
|
|
57386
57709
|
// src/setup.ts
|
|
57387
57710
|
async function setupCommand(ctx, code, values) {
|
|
57388
57711
|
const normalized = (code ?? "").replace(/-/g, "").toUpperCase();
|
|
57389
|
-
if (normalized.length !== 8 || [...normalized].some((char) => !
|
|
57712
|
+
if (normalized.length !== 8 || [...normalized].some((char) => !import_types9.SERVICE_ACCOUNT_USER_CODE_CHARSET.includes(char))) {
|
|
57390
57713
|
throw new CliError("errors.setupCode", EXIT.usage, {}, "INVALID_SETUP_CODE");
|
|
57391
57714
|
}
|
|
57392
57715
|
registerSecret(code);
|
|
@@ -57880,7 +58203,7 @@ function derivedClientId(origin) {
|
|
|
57880
58203
|
const url = new URL(origin);
|
|
57881
58204
|
const labels = url.hostname.split(".");
|
|
57882
58205
|
if (url.protocol !== "https:" || labels.length < 3) return null;
|
|
57883
|
-
return (0,
|
|
58206
|
+
return (0, import_types10.fleekCliClientId)(`https://app.${labels.slice(1).join(".")}`);
|
|
57884
58207
|
}
|
|
57885
58208
|
function validClientId(value) {
|
|
57886
58209
|
let url;
|
|
@@ -58081,7 +58404,7 @@ async function login(ctx, values, guided = false) {
|
|
|
58081
58404
|
throw new CliError(pending.expiresAt <= ctx.now() ? "errors.setupDeviceExpired" : "errors.setupDeviceRestart", EXIT.needsLogin, {}, "EXPIRED_TOKEN");
|
|
58082
58405
|
}
|
|
58083
58406
|
registerSecret(pending.accessToken);
|
|
58084
|
-
const uri = `${(0,
|
|
58407
|
+
const uri = `${(0, import_types10.serviceDeviceVerificationOrigin)(info.issuer)}/device`;
|
|
58085
58408
|
device = {
|
|
58086
58409
|
deviceCode: pending.accessToken,
|
|
58087
58410
|
userCode: saved.userCode,
|
|
@@ -58363,7 +58686,7 @@ async function work(ctx, sub, args, values) {
|
|
|
58363
58686
|
WIRE.claim,
|
|
58364
58687
|
{
|
|
58365
58688
|
issueId: id,
|
|
58366
|
-
purpose: oneOf2(values.purpose,
|
|
58689
|
+
purpose: oneOf2(values.purpose, import_types10.CLAIM_PURPOSES) ?? "work",
|
|
58367
58690
|
...values.ttl ? { ttlMinutes: int(values.ttl, 1, 1440) } : {},
|
|
58368
58691
|
...values.note ? { note: text5(values.note, 280) } : {}
|
|
58369
58692
|
},
|
|
@@ -58382,7 +58705,7 @@ async function work(ctx, sub, args, values) {
|
|
|
58382
58705
|
);
|
|
58383
58706
|
case "release":
|
|
58384
58707
|
case "complete": {
|
|
58385
|
-
const outcome = sub === "release" ? oneOf2(values.outcome,
|
|
58708
|
+
const outcome = sub === "release" ? oneOf2(values.outcome, import_types10.CLAIM_RELEASE_OUTCOMES, true) : oneOf2(values.outcome, import_types10.CLAIM_COMPLETE_OUTCOMES, true);
|
|
58386
58709
|
return write(
|
|
58387
58710
|
ctx,
|
|
58388
58711
|
client,
|
package/package.json
CHANGED