minimal-forge-work-pack-sync 0.1.26 → 0.1.27
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 +27 -2
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -7548,7 +7548,7 @@ var DEFAULT_DEBUG_TRACE_LIMITS = {
|
|
|
7548
7548
|
};
|
|
7549
7549
|
|
|
7550
7550
|
// packages/shared/src/contracts/settings.ts
|
|
7551
|
-
var WORK_PACK_SYNC_PLUGIN_VERSION = "0.1.
|
|
7551
|
+
var WORK_PACK_SYNC_PLUGIN_VERSION = "0.1.27";
|
|
7552
7552
|
var WORK_PACK_SYNC_PLUGIN_PACKAGE = `minimal-forge-work-pack-sync@${WORK_PACK_SYNC_PLUGIN_VERSION}`;
|
|
7553
7553
|
var WORK_PACK_SYNC_PLUGIN_FILENAME = `minimal-forge-work-pack-sync-${WORK_PACK_SYNC_PLUGIN_VERSION}.tgz`;
|
|
7554
7554
|
var FIRECRAWL_KEYLESS_MCP_NAME = "firecrawl";
|
|
@@ -25165,7 +25165,7 @@ function isRecord(value) {
|
|
|
25165
25165
|
}
|
|
25166
25166
|
|
|
25167
25167
|
// packages/cli/src/workPackSyncPlugin.ts
|
|
25168
|
-
var PLUGIN_VERSION = "0.1.
|
|
25168
|
+
var PLUGIN_VERSION = "0.1.27";
|
|
25169
25169
|
var FORGE_DECISION_TIMEOUT_MS = 11e4;
|
|
25170
25170
|
var STATUS_FILENAME = "work-pack-startup-status.json";
|
|
25171
25171
|
var activeSync = /* @__PURE__ */ new Map();
|
|
@@ -25224,6 +25224,7 @@ var ForgeWorkPackSyncServer = async (_input, options) => {
|
|
|
25224
25224
|
},
|
|
25225
25225
|
tool: {
|
|
25226
25226
|
forge_decide: createForgeDecisionTool(forgeBaseUrl, state.decisionBaseUrl, state.paths),
|
|
25227
|
+
forge_generate_codebook: createForgeCodebookTool(forgeBaseUrl, state.decisionBaseUrl, state.paths),
|
|
25227
25228
|
forge_feedback: createForgeFeedbackTool(forgeBaseUrl, state.paths)
|
|
25228
25229
|
}
|
|
25229
25230
|
};
|
|
@@ -25278,6 +25279,30 @@ function createForgeDecisionTool(forgeBaseUrl, decisionBaseUrl, paths) {
|
|
|
25278
25279
|
}
|
|
25279
25280
|
});
|
|
25280
25281
|
}
|
|
25282
|
+
function createForgeCodebookTool(forgeBaseUrl, gatewayBaseUrl, paths) {
|
|
25283
|
+
return tool({
|
|
25284
|
+
description: "Gera um rascunho de codebook em portugu\xEAs europeu a partir de uma pergunta e das respostas. Apresentar para aprova\xE7\xE3o humana antes de codificar; n\xE3o aplica c\xF3digos nem altera ficheiros.",
|
|
25285
|
+
args: {
|
|
25286
|
+
question: tool.schema.string().trim().min(1).max(1e4).describe("Texto da pergunta aberta"),
|
|
25287
|
+
responses: tool.schema.array(tool.schema.string().trim().min(1).max(2e4)).min(1).max(2e3).describe("Respostas da mesma pergunta, sem identificadores pessoais desnecess\xE1rios")
|
|
25288
|
+
},
|
|
25289
|
+
async execute(args, context) {
|
|
25290
|
+
const credentials = await readWellKnownForgeCredentials(paths.opencodeAuthPath, forgeBaseUrl);
|
|
25291
|
+
const response = await fetch(`${gatewayBaseUrl}/v1/codebooks`, {
|
|
25292
|
+
method: "POST",
|
|
25293
|
+
redirect: "error",
|
|
25294
|
+
headers: { authorization: `Bearer ${credentials.forgeApiKey}`, "content-type": "application/json" },
|
|
25295
|
+
body: JSON.stringify({ question: args.question, responses: args.responses }),
|
|
25296
|
+
signal: AbortSignal.any([context.abort, AbortSignal.timeout(FORGE_DECISION_TIMEOUT_MS)])
|
|
25297
|
+
});
|
|
25298
|
+
const body = await response.json().catch(() => void 0);
|
|
25299
|
+
if (response.ok && body && typeof body.codebook === "object" && body.codebook !== null) {
|
|
25300
|
+
return JSON.stringify(body, null, 2);
|
|
25301
|
+
}
|
|
25302
|
+
throw new Error(`O Forge n\xE3o concluiu o codebook (HTTP ${response.status}). Pe\xE7a ao respons\xE1vel para verificar a liga\xE7\xE3o Groq.`);
|
|
25303
|
+
}
|
|
25304
|
+
});
|
|
25305
|
+
}
|
|
25281
25306
|
function createForgeFeedbackTool(forgeBaseUrl, paths) {
|
|
25282
25307
|
return tool({
|
|
25283
25308
|
description: "Envia ao respons\xE1vel pelo Forge apenas a mensagem de feedback ou pedido de ajuda aprovada pela pessoa.",
|