@mestreyoda/fabrica 0.1.16 → 0.1.18
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/defaults/fabrica/prompts/developer.md +8 -8
- package/dist/index.js +35 -13
- package/dist/index.js.map +2 -2
- package/package.json +1 -1
|
@@ -132,17 +132,17 @@ gh pr edit "$PR_NUM" --body "$(printf '%s\n\n## QA Evidence\n\n```\n%s\n```\n\nE
|
|
|
132
132
|
|
|
133
133
|
**Do NOT post QA evidence only as a comment.** PR comments are not canonical QA evidence; the reviewer and the workflow both validate the PR description body.
|
|
134
134
|
|
|
135
|
-
### 5. Call work_finish
|
|
135
|
+
### 5. Call work_finish (API tool — NOT a shell command)
|
|
136
136
|
|
|
137
|
-
|
|
138
|
-
work_finish({ role: "developer", result: "done", channelId: "<project slug from 'Project:' field in task message>", summary: "<what you did>" })
|
|
139
|
-
```
|
|
137
|
+
`work_finish` is a **Fabrica API tool**. You must invoke it as a **tool call** (tool_use), the same way you call any other tool like `task_create` or `gh`. Do **NOT** run it as a bash command — it is not on your PATH, and attempting to execute it in a shell will fail with "command not found".
|
|
140
138
|
|
|
141
|
-
|
|
139
|
+
Use the `work_finish` tool with these arguments:
|
|
140
|
+
- `role`: `"developer"`
|
|
141
|
+
- `result`: `"done"` (or `"blocked"` if stuck)
|
|
142
|
+
- `channelId`: the project slug from the `"Project: <name>"` line in your task message (e.g., `"gestao-notas"`)
|
|
143
|
+
- `summary`: brief description of what you did
|
|
142
144
|
|
|
143
|
-
|
|
144
|
-
> Extract it from the "Project: <name>" line in your task message. Do NOT use the numeric
|
|
145
|
-
> channel ID — use the project slug to avoid resolution errors when channels are shared.
|
|
145
|
+
**If blocked:** call `work_finish` with `result: "blocked"` and explain why in `summary`.
|
|
146
146
|
|
|
147
147
|
**Always call work_finish** — even if you hit errors or can't complete the task.
|
|
148
148
|
|
package/dist/index.js
CHANGED
|
@@ -111337,8 +111337,8 @@ import fsSync from "node:fs";
|
|
|
111337
111337
|
import path5 from "node:path";
|
|
111338
111338
|
import { fileURLToPath as fileURLToPath3 } from "node:url";
|
|
111339
111339
|
function getCurrentVersion() {
|
|
111340
|
-
if ("0.1.
|
|
111341
|
-
return "0.1.
|
|
111340
|
+
if ("0.1.18") {
|
|
111341
|
+
return "0.1.18";
|
|
111342
111342
|
}
|
|
111343
111343
|
try {
|
|
111344
111344
|
const pkgPath = path5.join(THIS_DIR, "..", "..", "package.json");
|
|
@@ -120999,7 +120999,7 @@ function createWorkFinishTool(ctx) {
|
|
|
120999
120999
|
type: "object",
|
|
121000
121000
|
required: ["channelId", "role", "result"],
|
|
121001
121001
|
properties: {
|
|
121002
|
-
channelId: { type: "string", description: "
|
|
121002
|
+
channelId: { type: "string", description: "Project slug (e.g. 'my-project'). Use the value from the 'Channel:' or 'Project:' line in your task message. Do NOT use a numeric Telegram chat ID." },
|
|
121003
121003
|
role: { type: "string", enum: getAllRoleIds(), description: "Worker role" },
|
|
121004
121004
|
result: { type: "string", enum: ["done", "pass", "fail", "fail_infra", "refine", "blocked", "approve", "reject"], description: "Completion result. Use fail_infra (tester only) when the test toolchain is missing or broken \u2014 this keeps the issue in the test queue instead of routing it to the developer." },
|
|
121005
121005
|
summary: { type: "string", description: "Brief summary" },
|
|
@@ -122769,12 +122769,13 @@ ${issueDescription}` : ""
|
|
|
122769
122769
|
``,
|
|
122770
122770
|
`## MANDATORY: Task Completion`,
|
|
122771
122771
|
``,
|
|
122772
|
-
`When you finish this task, you MUST
|
|
122772
|
+
`When you finish this task, you MUST invoke the \`work_finish\` **tool** (API tool_use call \u2014 NOT a shell command):`,
|
|
122773
122773
|
`- \`role\`: "${role}"`,
|
|
122774
122774
|
`- \`channelId\`: "${channelId}"`,
|
|
122775
122775
|
`- \`result\`: ${availableResults}`,
|
|
122776
122776
|
`- \`summary\`: brief description of what you did`,
|
|
122777
122777
|
``,
|
|
122778
|
+
`\u26A0\uFE0F \`work_finish\` is a Fabrica tool, not a CLI command. Call it as a tool (the same way you use task_create or other tools), not via bash.`,
|
|
122778
122779
|
`\u26A0\uFE0F You MUST call work_finish even if you encounter errors or cannot finish.`,
|
|
122779
122780
|
`Use "blocked" with a summary explaining why you're stuck.`,
|
|
122780
122781
|
`Never end your session without calling work_finish.`
|
|
@@ -122816,12 +122817,13 @@ function buildConflictFixMessage(opts) {
|
|
|
122816
122817
|
``,
|
|
122817
122818
|
`## MANDATORY: Task Completion`,
|
|
122818
122819
|
``,
|
|
122819
|
-
`When you finish this task, you MUST
|
|
122820
|
+
`When you finish this task, you MUST invoke the \`work_finish\` **tool** (API tool_use call \u2014 NOT a shell command):`,
|
|
122820
122821
|
`- \`role\`: "${role}"`,
|
|
122821
122822
|
`- \`channelId\`: "${channelId}"`,
|
|
122822
122823
|
`- \`result\`: ${availableResults}`,
|
|
122823
122824
|
`- \`summary\`: brief description of what you did`,
|
|
122824
122825
|
``,
|
|
122826
|
+
`\u26A0\uFE0F \`work_finish\` is a Fabrica tool, not a CLI command. Call it as a tool (the same way you use task_create or other tools), not via bash.`,
|
|
122825
122827
|
`\u26A0\uFE0F You MUST call work_finish even if you encounter errors or cannot finish.`,
|
|
122826
122828
|
`Use "blocked" with a summary explaining why you're stuck.`,
|
|
122827
122829
|
`Never end your session without calling work_finish.`
|
|
@@ -129978,13 +129980,29 @@ function getGitHubApp(pluginConfig) {
|
|
|
129978
129980
|
async function getGitHubRepoInstallationOctokit(pluginConfig, repo) {
|
|
129979
129981
|
const app = getGitHubApp(pluginConfig);
|
|
129980
129982
|
if (!app) return null;
|
|
129981
|
-
|
|
129982
|
-
|
|
129983
|
-
|
|
129984
|
-
|
|
129985
|
-
|
|
129986
|
-
|
|
129987
|
-
|
|
129983
|
+
try {
|
|
129984
|
+
const response = await app.octokit.request("GET /repos/{owner}/{repo}/installation", repo);
|
|
129985
|
+
const installationId = Number(response.data?.id);
|
|
129986
|
+
if (Number.isInteger(installationId) && installationId > 0) {
|
|
129987
|
+
return {
|
|
129988
|
+
installationId,
|
|
129989
|
+
octokit: await app.getInstallationOctokit(installationId)
|
|
129990
|
+
};
|
|
129991
|
+
}
|
|
129992
|
+
} catch {
|
|
129993
|
+
}
|
|
129994
|
+
try {
|
|
129995
|
+
const orgResponse = await app.octokit.request("GET /orgs/{org}/installation", { org: repo.owner });
|
|
129996
|
+
const installationId = Number(orgResponse.data?.id);
|
|
129997
|
+
if (Number.isInteger(installationId) && installationId > 0) {
|
|
129998
|
+
return {
|
|
129999
|
+
installationId,
|
|
130000
|
+
octokit: await app.getInstallationOctokit(installationId)
|
|
130001
|
+
};
|
|
130002
|
+
}
|
|
130003
|
+
} catch {
|
|
130004
|
+
}
|
|
130005
|
+
return null;
|
|
129988
130006
|
}
|
|
129989
130007
|
async function getGitHubInstallationOctokit(pluginConfig, installationId) {
|
|
129990
130008
|
const app = getGitHubApp(pluginConfig);
|
|
@@ -142538,6 +142556,7 @@ function normalizeUserResponse(text) {
|
|
|
142538
142556
|
function detectStackHint(text) {
|
|
142539
142557
|
const lower2 = text.toLowerCase();
|
|
142540
142558
|
if (/\b(nextjs|next\.js)\b/.test(lower2)) return "nextjs";
|
|
142559
|
+
if (/\bnode\.?js\b/.test(lower2)) return "node-cli";
|
|
142541
142560
|
if (/\b(node-cli|typescript cli|ts cli|cli em typescript|typescript command line|typescript terminal cli)\b/.test(lower2)) return "node-cli";
|
|
142542
142561
|
if (/\bexpress\b/.test(lower2)) return "express";
|
|
142543
142562
|
if (/\b(fastapi)\b/.test(lower2)) return "fastapi";
|
|
@@ -142659,7 +142678,10 @@ function parseClarificationResponse(text, session) {
|
|
|
142659
142678
|
}
|
|
142660
142679
|
const detectedStack = detectStackHint(text);
|
|
142661
142680
|
if (detectedStack) {
|
|
142662
|
-
|
|
142681
|
+
const projectNameFromField = parseField(text, ["project name", "nome do projeto", "nome", "name"]);
|
|
142682
|
+
const nameItMatch = !projectNameFromField ? text.match(/(?:name|call|chamar?)\s+(?:it\s+)?([\w-]{2,64})/i) : null;
|
|
142683
|
+
const inlineName = projectNameFromField ?? (nameItMatch ? nameItMatch[1].toLowerCase().replace(/[^a-z0-9-]/g, "").replace(/-+/g, "-") || void 0 : void 0);
|
|
142684
|
+
return { recognized: true, stackHint: detectedStack, projectName: inlineName };
|
|
142663
142685
|
}
|
|
142664
142686
|
const lower2 = normalizeUserResponse(text);
|
|
142665
142687
|
const bareStackMap = {
|