@papi-ai/server 0.7.55 → 0.7.56
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/backfill-cycle-metrics.js +4 -1
- package/dist/index.js +38 -13
- package/package.json +1 -1
|
@@ -1179,8 +1179,11 @@ var init_proxy_adapter = __esm({
|
|
|
1179
1179
|
// (2) not-yet-wired hosted gaps — shrink as data-proxy handlers land (task-2390).
|
|
1180
1180
|
// getToolCallCount + updatePhaseStatus are ABSENT: they now have edge handlers and
|
|
1181
1181
|
// are served through the forwarder (getToolCallCount = SUP-2026-026 handler #1).
|
|
1182
|
-
"createOwnerAction",
|
|
1183
1182
|
"getContributorRole",
|
|
1183
|
+
// task-2728 (C331): createOwnerAction REMOVED from NO_FORWARD — the PRODUCER half
|
|
1184
|
+
// of the owner-action queue. Six readers were wired C329 (task-2412) but the
|
|
1185
|
+
// producer stayed here, so the hosted Owner Action Queue was structurally empty
|
|
1186
|
+
// (AD-74 inverted). Now forwards; the edge binds user_id to the bearer ([C]).
|
|
1184
1187
|
"recordContributorReleasePr",
|
|
1185
1188
|
"setContributorReleasePrStatus",
|
|
1186
1189
|
"listContributorReleasePrs",
|
package/dist/index.js
CHANGED
|
@@ -1296,8 +1296,11 @@ var init_proxy_adapter = __esm({
|
|
|
1296
1296
|
// (2) not-yet-wired hosted gaps — shrink as data-proxy handlers land (task-2390).
|
|
1297
1297
|
// getToolCallCount + updatePhaseStatus are ABSENT: they now have edge handlers and
|
|
1298
1298
|
// are served through the forwarder (getToolCallCount = SUP-2026-026 handler #1).
|
|
1299
|
-
"createOwnerAction",
|
|
1300
1299
|
"getContributorRole",
|
|
1300
|
+
// task-2728 (C331): createOwnerAction REMOVED from NO_FORWARD — the PRODUCER half
|
|
1301
|
+
// of the owner-action queue. Six readers were wired C329 (task-2412) but the
|
|
1302
|
+
// producer stayed here, so the hosted Owner Action Queue was structurally empty
|
|
1303
|
+
// (AD-74 inverted). Now forwards; the edge binds user_id to the bearer ([C]).
|
|
1301
1304
|
"recordContributorReleasePr",
|
|
1302
1305
|
"setContributorReleasePrStatus",
|
|
1303
1306
|
"listContributorReleasePrs",
|
|
@@ -8169,20 +8172,27 @@ function formatDecisionLifecycleSummary(decisions) {
|
|
|
8169
8172
|
}
|
|
8170
8173
|
return parts.join(", ");
|
|
8171
8174
|
}
|
|
8172
|
-
function formatBuildReports(reports) {
|
|
8175
|
+
function formatBuildReports(reports, opts) {
|
|
8173
8176
|
if (reports.length === 0) return "No build reports yet.";
|
|
8174
|
-
|
|
8177
|
+
const capped = opts?.maxReports != null ? reports.slice(0, opts.maxReports) : reports;
|
|
8178
|
+
const budget = opts?.fieldBudget;
|
|
8179
|
+
const field = (v) => budget != null ? truncateNotes(v, budget) : v ?? "";
|
|
8180
|
+
const body = capped.map(
|
|
8175
8181
|
(r) => `### ${r.taskName} \u2014 ${r.date} \u2014 Cycle ${r.cycle}
|
|
8176
8182
|
|
|
8177
8183
|
- **Completed:** ${r.completed}
|
|
8178
8184
|
- **Actual Effort:** ${r.actualEffort} vs estimated ${r.estimatedEffort}
|
|
8179
8185
|
` + (r.correctionsCount ? `- **Corrections:** ${r.correctionsCount}
|
|
8180
8186
|
` : "") + (Array.isArray(r.briefImplications) && r.briefImplications.length ? `- **Brief Implications:** ${r.briefImplications.map((bi) => `[${bi.canvasSection}/${bi.type}] ${bi.detail}`).join("; ")}
|
|
8181
|
-
` : "") + `- **Surprises:** ${r.surprises}
|
|
8182
|
-
- **Discovered Issues:** ${r.discoveredIssues}
|
|
8183
|
-
- **Architecture Notes:** ${r.architectureNotes}` + (r.deadEnds ? `
|
|
8184
|
-
- **Dead Ends:** ${r.deadEnds}` : "")
|
|
8187
|
+
` : "") + `- **Surprises:** ${field(r.surprises)}
|
|
8188
|
+
- **Discovered Issues:** ${field(r.discoveredIssues)}
|
|
8189
|
+
- **Architecture Notes:** ${field(r.architectureNotes)}` + (r.deadEnds ? `
|
|
8190
|
+
- **Dead Ends:** ${field(r.deadEnds)}` : "")
|
|
8185
8191
|
).join("\n\n---\n\n");
|
|
8192
|
+
const omitted = capped.length < reports.length ? `
|
|
8193
|
+
|
|
8194
|
+
_\u2026and ${reports.length - capped.length} older build report(s) omitted to bound context size._` : "";
|
|
8195
|
+
return body + omitted;
|
|
8186
8196
|
}
|
|
8187
8197
|
function formatRecentlyShippedCapabilities(reports) {
|
|
8188
8198
|
const completed = reports.filter((r) => r.completed === "Yes" || r.completed === "Partial");
|
|
@@ -10425,7 +10435,9 @@ async function prepareHandoffs(adapter2, _config, taskIds, force = false) {
|
|
|
10425
10435
|
// buildHandoffsOnlyUserMessage adds +1 internally
|
|
10426
10436
|
preAssignedTasks: tasksNeedingHandoffs,
|
|
10427
10437
|
activeDecisions: formatActiveDecisionsForPlan(decisions),
|
|
10428
|
-
|
|
10438
|
+
// task-2681: truncate verbose report bodies — a couple of audit reports alone
|
|
10439
|
+
// (e.g. task-2413/2655) can push this payload past the overflow range.
|
|
10440
|
+
recentBuildReports: formatBuildReports(reports, { maxReports: 10, fieldBudget: 280 }),
|
|
10429
10441
|
productBrief: brief,
|
|
10430
10442
|
northStar
|
|
10431
10443
|
});
|
|
@@ -10946,6 +10958,7 @@ async function resolveOwnerGate(adapter2, config2) {
|
|
|
10946
10958
|
}
|
|
10947
10959
|
|
|
10948
10960
|
// src/services/plan.ts
|
|
10961
|
+
var PLAN_BUILD_REPORT_BUDGET = { maxReports: 12, fieldBudget: 280 };
|
|
10949
10962
|
async function resolvePlanScope(adapter2, config2) {
|
|
10950
10963
|
const gate = await resolveOwnerGate(adapter2, config2);
|
|
10951
10964
|
return { callerUserId: gate.callerUserId, ownerUserId: gate.ownerUserId, callerIsOwner: gate.callerIsOwner };
|
|
@@ -11794,7 +11807,7 @@ ${logLines}`);
|
|
|
11794
11807
|
cycleNumber: health.totalCycles,
|
|
11795
11808
|
productBrief,
|
|
11796
11809
|
activeDecisions: formatActiveDecisionsForPlan(decisions),
|
|
11797
|
-
recentBuildReports: formatBuildReports(cappedReports),
|
|
11810
|
+
recentBuildReports: formatBuildReports(cappedReports, PLAN_BUILD_REPORT_BUDGET),
|
|
11798
11811
|
cycleLog: formatCycleLog(log2),
|
|
11799
11812
|
board: formatBoardForPlan(plannerTasks, filters, health.totalCycles, deferredTasks),
|
|
11800
11813
|
northStar,
|
|
@@ -12580,7 +12593,7 @@ async function preparePlan(adapter2, config2, filters, focus, force, handoffsOnl
|
|
|
12580
12593
|
cycleNumber,
|
|
12581
12594
|
preAssignedTasks: preAssigned,
|
|
12582
12595
|
activeDecisions: formatActiveDecisionsForPlan(decisions),
|
|
12583
|
-
recentBuildReports: formatBuildReports(reports),
|
|
12596
|
+
recentBuildReports: formatBuildReports(reports, PLAN_BUILD_REPORT_BUDGET),
|
|
12584
12597
|
productBrief: brief,
|
|
12585
12598
|
northStar
|
|
12586
12599
|
});
|
|
@@ -20918,7 +20931,9 @@ async function completeBuild(adapter2, config2, taskId, input, options = {}, cli
|
|
|
20918
20931
|
}
|
|
20919
20932
|
}
|
|
20920
20933
|
}
|
|
20934
|
+
const AUTO_TRIAGE_MIN_SEVERITY = /* @__PURE__ */ new Set(["P0", "P1", "P2"]);
|
|
20921
20935
|
let autoTriagedCount = 0;
|
|
20936
|
+
let autoTriagedSoftSkipped = 0;
|
|
20922
20937
|
const autoTriagedIds = [];
|
|
20923
20938
|
const autoTriagedDupes = [];
|
|
20924
20939
|
if (input.discoveredIssues && input.discoveredIssues !== "None" && typeof adapter2.createTask === "function") {
|
|
@@ -20938,6 +20953,10 @@ async function completeBuild(adapter2, config2, taskId, input, options = {}, cli
|
|
|
20938
20953
|
const sevMatch = line.match(/^(P[0-3])[\s:]+/i);
|
|
20939
20954
|
if (!sevMatch) continue;
|
|
20940
20955
|
const severityLabel = sevMatch[1].toUpperCase();
|
|
20956
|
+
if (!AUTO_TRIAGE_MIN_SEVERITY.has(severityLabel)) {
|
|
20957
|
+
autoTriagedSoftSkipped++;
|
|
20958
|
+
continue;
|
|
20959
|
+
}
|
|
20941
20960
|
const priority = severityLabel === "P0" ? "P0 Critical" : severityLabel === "P1" ? "P1 High" : severityLabel === "P2" ? "P2 Medium" : "P3 Low";
|
|
20942
20961
|
const titleRaw = line.replace(/^P[0-3][\s:]+/i, "").trim();
|
|
20943
20962
|
const title = titleRaw.length > 120 ? titleRaw.slice(0, 120) : titleRaw;
|
|
@@ -21187,6 +21206,7 @@ async function completeBuild(adapter2, config2, taskId, input, options = {}, cli
|
|
|
21187
21206
|
autoTriagedCount: autoTriagedCount > 0 ? autoTriagedCount : void 0,
|
|
21188
21207
|
autoTriagedIds: autoTriagedIds.length > 0 ? autoTriagedIds : void 0,
|
|
21189
21208
|
autoTriagedDupes: autoTriagedDupes.length > 0 ? autoTriagedDupes : void 0,
|
|
21209
|
+
autoTriagedSoftSkipped: autoTriagedSoftSkipped > 0 ? autoTriagedSoftSkipped : void 0,
|
|
21190
21210
|
reportWriteVerified,
|
|
21191
21211
|
localPreview
|
|
21192
21212
|
};
|
|
@@ -22300,7 +22320,7 @@ function formatCompleteResult(result) {
|
|
|
22300
22320
|
if (result.learningsLinkedCount) {
|
|
22301
22321
|
lines.push("", `Linked ${result.learningsLinkedCount} unactioned learning(s) to this task.`);
|
|
22302
22322
|
}
|
|
22303
|
-
if (result.autoTriagedCount || result.autoTriagedDupes?.length) {
|
|
22323
|
+
if (result.autoTriagedCount || result.autoTriagedDupes?.length || result.autoTriagedSoftSkipped) {
|
|
22304
22324
|
const parts = [];
|
|
22305
22325
|
if (result.autoTriagedCount) {
|
|
22306
22326
|
const ids = result.autoTriagedIds?.length ? ` (${result.autoTriagedIds.join(", ")})` : "";
|
|
@@ -22309,6 +22329,9 @@ function formatCompleteResult(result) {
|
|
|
22309
22329
|
if (result.autoTriagedDupes?.length) {
|
|
22310
22330
|
parts.push(`Skipped ${result.autoTriagedDupes.length} duplicate issue(s) already in Backlog: ${result.autoTriagedDupes.join(", ")}.`);
|
|
22311
22331
|
}
|
|
22332
|
+
if (result.autoTriagedSoftSkipped) {
|
|
22333
|
+
parts.push(`${result.autoTriagedSoftSkipped} low-severity (P3) observation(s) recorded to learnings, not filed as tasks.`);
|
|
22334
|
+
}
|
|
22312
22335
|
lines.push("", parts.join(" "));
|
|
22313
22336
|
}
|
|
22314
22337
|
if (result.reportWriteVerified === false) {
|
|
@@ -29064,9 +29087,11 @@ ${usageLine(decision.usage)}`;
|
|
|
29064
29087
|
const clientName = server2.getClientVersion()?.name;
|
|
29065
29088
|
const metric = buildMetric(name, elapsed, usage, void 0, contextBytes, contextUtilisation, clientName);
|
|
29066
29089
|
metric.success = !isError;
|
|
29067
|
-
adapter2.appendToolMetric(metric).catch(() => {
|
|
29090
|
+
adapter2.appendToolMetric(metric).catch((err) => {
|
|
29091
|
+
console.error(`[metrics] appendToolMetric failed (non-blocking): ${err instanceof Error ? err.message : String(err)}`);
|
|
29068
29092
|
});
|
|
29069
|
-
} catch {
|
|
29093
|
+
} catch (err) {
|
|
29094
|
+
console.error(`[metrics] buildMetric/appendToolMetric threw (non-blocking): ${err instanceof Error ? err.message : String(err)}`);
|
|
29070
29095
|
}
|
|
29071
29096
|
if (config2.adapterType === "md") {
|
|
29072
29097
|
const mdProjectSlug = config2.projectRoot ? config2.projectRoot.split("/").pop() : void 0;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@papi-ai/server",
|
|
3
|
-
"version": "0.7.
|
|
3
|
+
"version": "0.7.56",
|
|
4
4
|
"description": "PAPI MCP server — AI-powered sprint planning, build execution, and strategy review for software projects",
|
|
5
5
|
"license": "Elastic-2.0",
|
|
6
6
|
"mcpName": "io.github.getpapi/papi",
|