@papi-ai/server 0.7.77 → 0.7.78

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/prompts.js CHANGED
@@ -758,6 +758,17 @@ function coerceToString(value) {
758
758
  if (value === null || value === void 0) return "";
759
759
  return JSON.stringify(value, null, 2);
760
760
  }
761
+ function coerceCarryForward(value) {
762
+ if (value === null || value === void 0) return { value: null };
763
+ if (typeof value === "string") {
764
+ const trimmed = value.trim();
765
+ return { value: trimmed.length > 0 ? trimmed : null };
766
+ }
767
+ const shape = Array.isArray(value) ? "array" : typeof value;
768
+ const warning = `cycleLogCarryForward was ${shape}, not a string \u2014 DROPPED rather than persisted. Carry-forward is prose that orient parses for the WHAT SHIPS FOR USERS / RELEASE MECHANICS labels; a non-string value cannot carry them. Re-run plan apply with cycleLogCarryForward as a single string (or null) to record one for this cycle.`;
769
+ console.error(`[plan] ${warning}`);
770
+ return { value: null, warning };
771
+ }
761
772
  function coerceStructuredOutput(parsed) {
762
773
  const cycleHandoffs = Array.isArray(parsed.cycleHandoffs) ? parsed.cycleHandoffs.map((h) => {
763
774
  const { taskId: _t, buildHandoff: _b, ...rest } = h;
@@ -797,10 +808,12 @@ function coerceStructuredOutput(parsed) {
797
808
  body: coerceToString(ad.body)
798
809
  })) : [];
799
810
  const cycleTaskIds = Array.isArray(parsed.cycleTaskIds) ? parsed.cycleTaskIds.map((id) => coerceToString(id)) : void 0;
811
+ const carryForward = coerceCarryForward(parsed.cycleLogCarryForward);
800
812
  return {
801
813
  cycleLogTitle: coerceToString(parsed.cycleLogTitle),
802
814
  cycleLogContent: coerceToString(parsed.cycleLogContent),
803
- cycleLogCarryForward: parsed.cycleLogCarryForward === null ? null : coerceToString(parsed.cycleLogCarryForward),
815
+ cycleLogCarryForward: carryForward.value,
816
+ ...carryForward.warning ? { coercionWarnings: [carryForward.warning] } : {},
804
817
  cycleLogNotes: parsed.cycleLogNotes === null ? null : coerceToString(parsed.cycleLogNotes),
805
818
  nextMode: "Full",
806
819
  boardHealth: coerceToString(parsed.boardHealth),
@@ -1686,6 +1699,7 @@ export {
1686
1699
  buildReviewSystemPrompt,
1687
1700
  buildReviewUserMessage,
1688
1701
  buildVisionTasksPrompt,
1702
+ coerceCarryForward,
1689
1703
  extractDependencyChain,
1690
1704
  parseReviewStructuredOutput,
1691
1705
  parseStrategyChangeOutput,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@papi-ai/server",
3
- "version": "0.7.77",
3
+ "version": "0.7.78",
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",