@papi-ai/server 0.7.44 → 0.7.46

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.
@@ -1163,6 +1163,10 @@ var init_proxy_adapter = __esm({
1163
1163
  "claimReview",
1164
1164
  "getSiblingAds",
1165
1165
  "getSiblingRepoTasks"
1166
+ // task-2489 (C320): recordProgressStep is now wired to the edge data-proxy
1167
+ // (case handler + ALLOWED_METHODS/WRITE_METHODS entries), so it forwards for
1168
+ // hosted callers and persists a project-scoped cycle_progress_steps row. Removed
1169
+ // from NO_FORWARD (was the task-2484 pg-only gap) — hosted parity restored.
1166
1170
  ]);
1167
1171
  ProxyPapiAdapter = class _ProxyPapiAdapter {
1168
1172
  endpoint;
@@ -1879,31 +1883,18 @@ import { pathToFileURL } from "url";
1879
1883
  import path2 from "path";
1880
1884
  import { execSync } from "child_process";
1881
1885
 
1882
- // ../../../../../packages/adapter-md/dist/index.js
1886
+ // ../adapter-md/dist/index.js
1883
1887
  import { readFile, writeFile, access } from "fs/promises";
1884
1888
  import { randomUUID as randomUUID6 } from "crypto";
1885
1889
  import { join } from "path";
1886
-
1887
- // ../../../../../packages/shared/dist/index.js
1888
- var VALID_TRANSITIONS = {
1889
- "Backlog": ["In Cycle", "Ready", "In Progress", "Blocked", "Cancelled", "Deferred", "Done"],
1890
- "In Cycle": ["In Progress", "Backlog", "Blocked", "Cancelled"],
1891
- "Ready": ["In Progress", "Backlog", "Blocked", "Cancelled"],
1892
- "In Progress": ["In Review", "Backlog", "Blocked", "Cancelled"],
1893
- "In Review": ["Done", "In Progress", "Blocked", "Cancelled"],
1894
- "Done": [],
1895
- "Blocked": ["Backlog", "Ready", "In Cycle", "In Progress", "Cancelled"],
1896
- "Cancelled": [],
1897
- "Deferred": ["Backlog", "Cancelled"]
1898
- };
1899
- var RETIRED_DECISION_OUTCOMES = ["resolved", "abandoned", "superseded"];
1900
- function isLiveDecision(d) {
1901
- if (d.superseded === true) return false;
1902
- if (d.outcome != null && RETIRED_DECISION_OUTCOMES.includes(d.outcome)) return false;
1903
- return true;
1904
- }
1905
-
1906
- // ../../../../../packages/adapter-md/dist/index.js
1890
+ import {
1891
+ VALID_TRANSITIONS as _VALID_TRANSITIONS,
1892
+ isValidTransition as _isValidTransition,
1893
+ validateTransition as _validateTransition,
1894
+ isValidStatus as _isValidStatus,
1895
+ isLiveDecision as _isLiveDecision,
1896
+ RETIRED_DECISION_OUTCOMES as _RETIRED_DECISION_OUTCOMES
1897
+ } from "@papi-ai/shared";
1907
1898
  import { randomUUID } from "crypto";
1908
1899
  import { randomUUID as randomUUID3 } from "crypto";
1909
1900
  import yaml from "js-yaml";
@@ -1912,8 +1903,8 @@ import { randomUUID as randomUUID4 } from "crypto";
1912
1903
  import { randomUUID as randomUUID5 } from "crypto";
1913
1904
  import yaml2 from "js-yaml";
1914
1905
  import yaml3 from "js-yaml";
1915
- var VALID_TRANSITIONS2 = VALID_TRANSITIONS;
1916
- var isLiveDecision2 = isLiveDecision;
1906
+ var VALID_TRANSITIONS = _VALID_TRANSITIONS;
1907
+ var isLiveDecision = _isLiveDecision;
1917
1908
  function extractSection(content, heading) {
1918
1909
  const headingPattern = new RegExp(`^## ${heading}\\s*$`, "m");
1919
1910
  const start = content.search(headingPattern);
@@ -3106,6 +3097,7 @@ function toCycle(raw) {
3106
3097
  };
3107
3098
  if (raw.end_date) cycle.endDate = raw.end_date;
3108
3099
  if (raw.user_id) cycle.userId = raw.user_id;
3100
+ if (raw.dependency_chain) cycle.dependencyChain = raw.dependency_chain;
3109
3101
  return cycle;
3110
3102
  }
3111
3103
  function fromCycle(cycle) {
@@ -3120,6 +3112,7 @@ function fromCycle(cycle) {
3120
3112
  };
3121
3113
  if (cycle.endDate) raw.end_date = cycle.endDate;
3122
3114
  if (cycle.userId) raw.user_id = cycle.userId;
3115
+ if (cycle.dependencyChain) raw.dependency_chain = cycle.dependencyChain;
3123
3116
  return raw;
3124
3117
  }
3125
3118
  function extractYamlBlock2(content) {
@@ -3164,7 +3157,7 @@ function prependCycle(cycle, content) {
3164
3157
  const yamlStr = yaml2.dump({ cycles: [raw] }, { lineWidth: 120, quotingType: '"' });
3165
3158
  return header + YAML_START2 + "\n" + yamlStr + YAML_END2 + "\n";
3166
3159
  }
3167
- const existing = parseCycles(content);
3160
+ const existing = parseCycles(content).filter((c) => c.number !== cycle.number);
3168
3161
  const merged = [cycle, ...existing];
3169
3162
  return serializeCycles(merged, content);
3170
3163
  }
@@ -3261,7 +3254,7 @@ var MdFileAdapter = class {
3261
3254
  if (!content) return [];
3262
3255
  const all = parseActiveDecisions(content);
3263
3256
  if (options?.includeRetired) return all;
3264
- return all.filter(isLiveDecision2);
3257
+ return all.filter(isLiveDecision);
3265
3258
  }
3266
3259
  /** Read cycle log entries (newest first), optionally limited to {@link limit} entries. */
3267
3260
  async getCycleLog(limit) {
@@ -3298,14 +3291,27 @@ var MdFileAdapter = class {
3298
3291
  notes: review.notes
3299
3292
  });
3300
3293
  }
3301
- /** Get the cycle number of the last strategy review. */
3302
- async getLastStrategyReviewCycle() {
3294
+ /**
3295
+ * Get the cycle number of the last strategy review.
3296
+ * task-2416 (C315): `excludeZoomOut` is accepted for interface parity with the pg
3297
+ * adapter. The md adapter already matches strategy-review titles only (zoom-out logs
3298
+ * carry a "Zoom-Out" title, not a strategy-review one), so the flag is a no-op here —
3299
+ * legacy/best-effort path.
3300
+ */
3301
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
3302
+ async getLastStrategyReviewCycle(_opts) {
3303
3303
  const log = await this.getCycleLog();
3304
3304
  const entry = log.find(
3305
3305
  (e) => /strategy.*review|strategic.*shift/i.test(e.title)
3306
3306
  );
3307
3307
  return entry?.cycleNumber ?? 0;
3308
3308
  }
3309
+ /** task-2416 (C315): cycle of the last zoom-out retrospective. md best-effort — matches the log title. */
3310
+ async getLastZoomOutCycle() {
3311
+ const log = await this.getCycleLog();
3312
+ const entry = log.find((e) => /zoom[-\s]?out/i.test(e.title));
3313
+ return entry?.cycleNumber ?? 0;
3314
+ }
3309
3315
  /** Get strategy reviews — md adapter returns empty (reviews live in cycle log). */
3310
3316
  async getStrategyReviews(_limit, _includeFullAnalysis) {
3311
3317
  return [];
@@ -3416,7 +3422,7 @@ var MdFileAdapter = class {
3416
3422
  }
3417
3423
  if (updates.status && updates.status !== tasks[idx].status && !options?.force) {
3418
3424
  const from = tasks[idx].status;
3419
- const allowed = VALID_TRANSITIONS2[from];
3425
+ const allowed = VALID_TRANSITIONS[from];
3420
3426
  if (!allowed.includes(updates.status)) {
3421
3427
  console.warn(`[papi] Warning: invalid status transition "${from}" \u2192 "${updates.status}" for task ${id}. Allowed from "${from}": ${allowed.length > 0 ? allowed.join(", ") : "none"}`);
3422
3428
  }