@mestreyoda/fabrica 0.2.24 → 0.2.26
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/index.js +48 -4
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -113905,8 +113905,8 @@ import fsSync from "node:fs";
|
|
|
113905
113905
|
import path5 from "node:path";
|
|
113906
113906
|
import { fileURLToPath as fileURLToPath3 } from "node:url";
|
|
113907
113907
|
function getCurrentVersion() {
|
|
113908
|
-
if ("0.2.
|
|
113909
|
-
return "0.2.
|
|
113908
|
+
if ("0.2.26") {
|
|
113909
|
+
return "0.2.26";
|
|
113910
113910
|
}
|
|
113911
113911
|
try {
|
|
113912
113912
|
const pkgPath = path5.join(THIS_DIR, "..", "..", "package.json");
|
|
@@ -142863,6 +142863,19 @@ function buildTopicDeepLink(chatId, topicId) {
|
|
|
142863
142863
|
function buildDmAck(projectName, topicLink, language = "pt") {
|
|
142864
142864
|
return BOOTSTRAP_MESSAGES.registered[language](projectName, topicLink);
|
|
142865
142865
|
}
|
|
142866
|
+
function buildBootstrapRuntimeStatusNote(session, language = "pt") {
|
|
142867
|
+
const issueUrl = session.issueUrl ?? null;
|
|
142868
|
+
const triageErrors = session.triageErrors ?? [];
|
|
142869
|
+
if (session.triageReadyForDispatch === false && issueUrl) {
|
|
142870
|
+
return language === "en" ? `\u26A0\uFE0F Automatic dispatch is currently paused. GitHub issue created: ${issueUrl}
|
|
142871
|
+
Triage blockers: ${triageErrors.length > 0 ? triageErrors.join(", ") : "unspecified"}` : `\u26A0\uFE0F O dispatch autom\xE1tico est\xE1 pausado no momento. Issue criada no GitHub: ${issueUrl}
|
|
142872
|
+
Bloqueios do triage: ${triageErrors.length > 0 ? triageErrors.join(", ") : "n\xE3o especificado"}`;
|
|
142873
|
+
}
|
|
142874
|
+
if (issueUrl) {
|
|
142875
|
+
return language === "en" ? `\u2705 GitHub issue created: ${issueUrl}` : `\u2705 Issue criada no GitHub: ${issueUrl}`;
|
|
142876
|
+
}
|
|
142877
|
+
return null;
|
|
142878
|
+
}
|
|
142866
142879
|
function buildTopicKickoff(projectName, idea, language = "pt") {
|
|
142867
142880
|
const header = language === "en" ? `\u{1F9F1} Project automatically registered by Fabrica.
|
|
142868
142881
|
Project: ${projectName}
|
|
@@ -143584,7 +143597,12 @@ async function completeRegisteredBootstrap(ctx, workspaceDir, session) {
|
|
|
143584
143597
|
const resolvedProjectName = session.projectName ?? session.projectSlug ?? "projeto";
|
|
143585
143598
|
const sessionLang = session.language ?? "pt";
|
|
143586
143599
|
if (!session.topicKickoffSentAt) {
|
|
143587
|
-
|
|
143600
|
+
let kickoffMessage = buildTopicKickoff(resolvedProjectName, session.rawIdea, sessionLang);
|
|
143601
|
+
const statusNote = buildBootstrapRuntimeStatusNote(session, sessionLang);
|
|
143602
|
+
if (statusNote) kickoffMessage += `
|
|
143603
|
+
|
|
143604
|
+
${statusNote}`;
|
|
143605
|
+
await sendTelegramText(ctx, projectChannelId, kickoffMessage, {
|
|
143588
143606
|
accountId: projectRoute.accountId ?? void 0,
|
|
143589
143607
|
messageThreadId
|
|
143590
143608
|
});
|
|
@@ -143643,10 +143661,15 @@ async function completeRegisteredBootstrap(ctx, workspaceDir, session) {
|
|
|
143643
143661
|
}
|
|
143644
143662
|
session = ownership.session;
|
|
143645
143663
|
if (!session.completionAckSentAt) {
|
|
143664
|
+
let dmAck = buildDmAck(resolvedProjectName, buildTopicDeepLink(String(projectChannelId), messageThreadId), sessionLang);
|
|
143665
|
+
const statusNote = buildBootstrapRuntimeStatusNote(session, sessionLang);
|
|
143666
|
+
if (statusNote) dmAck += `
|
|
143667
|
+
|
|
143668
|
+
${statusNote}`;
|
|
143646
143669
|
await sendTelegramText(
|
|
143647
143670
|
ctx,
|
|
143648
143671
|
session.conversationId,
|
|
143649
|
-
|
|
143672
|
+
dmAck
|
|
143650
143673
|
);
|
|
143651
143674
|
session = await persistDispatchProgress(workspaceDir, session, {
|
|
143652
143675
|
projectRoute,
|
|
@@ -150197,6 +150220,27 @@ function registerSubagentLifecycleHook(api, ctx) {
|
|
|
150197
150220
|
});
|
|
150198
150221
|
return;
|
|
150199
150222
|
}
|
|
150223
|
+
const workerOutcome = await handleWorkerAgentEnd({
|
|
150224
|
+
sessionKey,
|
|
150225
|
+
runId: event.runId,
|
|
150226
|
+
workspaceDir,
|
|
150227
|
+
runCommand: ctx.runCommand,
|
|
150228
|
+
runtime: ctx.runtime,
|
|
150229
|
+
pluginConfig: ctx.pluginConfig
|
|
150230
|
+
}).catch(() => null);
|
|
150231
|
+
if (workerOutcome?.applied) {
|
|
150232
|
+
wakeHeartbeat("subagent_ended").catch(() => {
|
|
150233
|
+
});
|
|
150234
|
+
return;
|
|
150235
|
+
}
|
|
150236
|
+
const refreshedProjects = await readProjects(workspaceDir);
|
|
150237
|
+
const refreshedProject = refreshedProjects.projects[projectSlug];
|
|
150238
|
+
const refreshedIssueRuntime = issueId ? refreshedProject?.issueRuntime?.[String(issueId)] : void 0;
|
|
150239
|
+
if (refreshedIssueRuntime?.sessionCompletedAt) {
|
|
150240
|
+
wakeHeartbeat("subagent_ended").catch(() => {
|
|
150241
|
+
});
|
|
150242
|
+
return;
|
|
150243
|
+
}
|
|
150200
150244
|
}
|
|
150201
150245
|
if (foundSlot.active) {
|
|
150202
150246
|
await deactivateWorker(workspaceDir, projectSlug, role, {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mestreyoda/fabrica",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.26",
|
|
4
4
|
"description": "Autonomous software engineering pipeline for OpenClaw. Turns ideas into deployed code via intake, dispatch, review, test, and merge.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|