@dendelion/paper-camp 0.6.0 → 0.7.0

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.
@@ -0,0 +1,8 @@
1
+ /**
2
+ * Feature-branch name for an entity, matching the `kind/id-slug` convention
3
+ * that `branchEntityId`/`getFeatureBranchPlanId` parse back out. Shared so
4
+ * branch creation (`ensureBranch`) and PR resolution (`resolvePrMerged`)
5
+ * target the exact same name.
6
+ */
7
+ export declare function branchName(id: string | undefined, type: string | undefined, title: string): string | undefined;
8
+ //# sourceMappingURL=branch.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"branch.d.ts","sourceRoot":"","sources":["../../src/core/branch.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,wBAAgB,UAAU,CACxB,EAAE,EAAE,MAAM,GAAG,SAAS,EACtB,IAAI,EAAE,MAAM,GAAG,SAAS,EACxB,KAAK,EAAE,MAAM,GACZ,MAAM,GAAG,SAAS,CAQpB"}
@@ -1,24 +1,24 @@
1
- import { A as e, P as t, a as r, b as n, c as i, d as o, e as p, f as m, g as E, h as l, i as d, j as S, k as c, l as P, m as f, n as F, o as y, p as I, q as A, r as g, s as N, t as T, u as h, v as _, w as C, x as D, y as O, z as u, B as L, C as G, D as Q, E as v, F as x, G as R, H as k, I as z, J as B, K as U, L as j, M as w, N as K, O as M, Q as b, R as q, S as H, T as J, U as V } from "../chunks/serializer.DbnJzwVr.js";
2
- import { AGENT_IDS as X, AGENT_LABELS as Y, AGENT_OPTIONS as Z, DEFAULT_AGENTS as $, PLAN_KINDS as aa, PLAN_STATUSES as sa, coerceAgentConfig as ea } from "../types/index.js";
1
+ import { A as e, P as t, a as r, b as n, c as i, d as o, e as p, f as m, g as E, h as d, i as l, j as S, k as c, l as P, m as f, n as F, o as y, p as I, q as A, r as g, s as h, t as N, u as T, v as D, w as _, x as u, y as C, z as O, B as L, C as v, D as G, E as Q, F as x, G as R, H as k, I as z, J as B, K as U, L as j, M as w, N as K, O as M, Q as V, R as W, S as b, T as q, U as H, V as J } from "../chunks/serializer.DiYtNSka.js";
2
+ import { AGENT_IDS as Y, AGENT_LABELS as Z, AGENT_OPTIONS as $, DEFAULT_AGENTS as aa, PLAN_KINDS as sa, PLAN_STATUSES as ea, coerceAgentConfig as ta } from "../types/index.js";
3
3
  export {
4
- X as AGENT_IDS,
5
- Y as AGENT_LABELS,
6
- Z as AGENT_OPTIONS,
4
+ Y as AGENT_IDS,
5
+ Z as AGENT_LABELS,
6
+ $ as AGENT_OPTIONS,
7
7
  e as AlreadyInitializedError,
8
- $ as DEFAULT_AGENTS,
8
+ aa as DEFAULT_AGENTS,
9
9
  t as PAPER_CAMP_VERSION,
10
- aa as PLAN_KINDS,
11
- sa as PLAN_STATUSES,
10
+ sa as PLAN_KINDS,
11
+ ea as PLAN_STATUSES,
12
12
  r as agentConfigSchema,
13
13
  n as appendBlock,
14
14
  i as applyEnvEntries,
15
15
  o as archiveEntityFile,
16
16
  p as assignEntityId,
17
17
  m as assignPlanId,
18
- ea as coerceAgentConfig,
18
+ ta as coerceAgentConfig,
19
19
  E as dateString,
20
- l as decisionFieldsSchema,
21
- d as entityFrontmatterSchema,
20
+ d as decisionFieldsSchema,
21
+ l as entityFrontmatterSchema,
22
22
  S as entityToIdea,
23
23
  c as entityToPlan,
24
24
  P as findConsistencyIssues,
@@ -28,18 +28,18 @@ export {
28
28
  I as formatIdeaFile,
29
29
  A as formatOpenQuestionEntry,
30
30
  g as formatOpenQuestions,
31
- N as formatPlanEntry,
32
- T as formatPlanFile,
33
- h as formatPlans,
34
- _ as formatProgressEntry,
35
- C as ideaFrontmatterSchema,
36
- D as initProject,
37
- O as openQuestionFieldsSchema,
38
- u as paperCampConfigSchema,
31
+ h as formatPlanEntry,
32
+ N as formatPlanFile,
33
+ T as formatPlans,
34
+ D as formatProgressEntry,
35
+ _ as ideaFrontmatterSchema,
36
+ u as initProject,
37
+ C as openQuestionFieldsSchema,
38
+ O as paperCampConfigSchema,
39
39
  L as parseDecisions,
40
- G as parseEntityFile,
41
- Q as parseEnv,
42
- v as parseFrontmatter,
40
+ v as parseEntityFile,
41
+ G as parseEnv,
42
+ Q as parseFrontmatter,
43
43
  x as parseIdeaFile,
44
44
  R as parseIdeas,
45
45
  k as parseOpenQuestions,
@@ -50,10 +50,11 @@ export {
50
50
  w as planFieldsSchema,
51
51
  K as planFrontmatterSchema,
52
52
  M as prependProgressItem,
53
- b as readEntities,
54
- q as readNoteEntries,
55
- H as readWorkEntries,
56
- J as serializeFrontmatter,
57
- V as todayDateString
53
+ V as readEntities,
54
+ W as readEntitiesWithDerivedStatus,
55
+ b as readNoteEntries,
56
+ q as readWorkEntries,
57
+ H as serializeFrontmatter,
58
+ J as todayDateString
58
59
  };
59
60
  //# sourceMappingURL=index.js.map
@@ -0,0 +1,27 @@
1
+ import { PrInfo, ReviewThread } from '../types/index';
2
+ /**
3
+ * Cache window for the resolved PR set — long enough that a worklist read doesn't
4
+ * re-shell out to `gh` on every request, short enough that a merge or state
5
+ * change shows up within the same working session.
6
+ */
7
+ export declare const PR_CACHE_TTL_MS: number;
8
+ /**
9
+ * Per-comment detail for a PR's unresolved review threads, for the fix-review
10
+ * launch path (`POST /api/agent/launch-fix-review`) to hand to
11
+ * `buildFixReviewPrompt`. Each thread is represented by its first comment, since
12
+ * that's the one that states what needs fixing. Best-effort: resolves `[]` on
13
+ * any failure so a launch with no readable threads falls back to
14
+ * `buildFixReviewPrompt`'s own empty-threads guard rather than erroring out.
15
+ */
16
+ export declare function fetchUnresolvedThreads(root: string, url: string): Promise<ReviewThread[]>;
17
+ /**
18
+ * Every PR in the repo indexed by the entity id it references, resolved via a
19
+ * single `gh pr list` and cached for `ttlMs` — see IDEA-56's PR-driven status
20
+ * derivation. `undefined` when the lookup can't resolve at all (no `gh`, not
21
+ * authenticated, offline, no GitHub remote); callers fall back to stored status.
22
+ * An entity simply absent from the returned map has no PR (a confirmed answer).
23
+ */
24
+ export declare function resolvePrsByEntity(root: string, ttlMs?: number): Promise<Map<string, PrInfo> | undefined>;
25
+ /** Test-only: clears the module-level PR cache between test cases. */
26
+ export declare function clearPrCache(): void;
27
+ //# sourceMappingURL=pr.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pr.d.ts","sourceRoot":"","sources":["../../src/core/pr.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,MAAM,EAAkB,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAW3E;;;;GAIG;AACH,eAAO,MAAM,eAAe,QAAgB,CAAC;AAkM7C;;;;;;;GAOG;AACH,wBAAsB,sBAAsB,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,YAAY,EAAE,CAAC,CAiB/F;AAoED;;;;;;GAMG;AACH,wBAAsB,kBAAkB,CACtC,IAAI,EAAE,MAAM,EACZ,KAAK,SAAkB,GACtB,OAAO,CAAC,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,SAAS,CAAC,CAS1C;AAED,sEAAsE;AACtE,wBAAgB,YAAY,IAAI,IAAI,CAEnC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=pr.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pr.test.d.ts","sourceRoot":"","sources":["../../src/core/pr.test.ts"],"names":[],"mappings":""}
@@ -1,4 +1,4 @@
1
- import { EntityEntry, IdeaEntry, ParseResult, PlanEntry } from '../types/index';
1
+ import { EntityEntry, IdeaEntry, ParseResult, PlanEntry, PrInfo } from '../types/index';
2
2
  /**
3
3
  * Reads every entity from the unified directory, including its `archive/`
4
4
  * subdirectory (done/dropped entities live there). Excludes index.md.
@@ -10,10 +10,18 @@ export declare function readEntities(ideasDir: string): Promise<ParseResult<Enti
10
10
  * PlanEntry view of a work entity (anything that isn't a note): `kind` is the
11
11
  * entity's `type`. Lets the plan-shaped pipeline (API responses, prompts, UI)
12
12
  * keep working until the UI morphs to entities directly.
13
+ *
14
+ * `status` is derived from phases + PR state rather than read straight off
15
+ * `e.status` — see `deriveStatus`. `pr` is the entity's resolved PR (or
16
+ * `undefined`); `prLookupResolved` is whether the PR listing succeeded (a
17
+ * failed/absent lookup falls back to the stored override). Note this only
18
+ * affects the *view*: `e.status` itself stays the raw stored override, so
19
+ * round-tripping an `EntityEntry` back to disk never persists a derived value.
13
20
  */
14
- export declare function entityToPlan(e: EntityEntry): PlanEntry;
21
+ export declare function entityToPlan(e: EntityEntry, pr?: PrInfo, prLookupResolved?: boolean): PlanEntry;
15
22
  /** IdeaEntry view of a note entity, for the note-shaped API/UI surface. */
16
23
  export declare function entityToIdea(e: EntityEntry): IdeaEntry;
24
+ export declare function readEntitiesWithDerivedStatus(ideasDir: string): Promise<ParseResult<EntityEntry>>;
17
25
  /** All work entities (non-notes) in PlanEntry shape — the `/api/plans` view. */
18
26
  export declare function readWorkEntries(ideasDir: string): Promise<ParseResult<PlanEntry>>;
19
27
  /** All note entities in IdeaEntry shape — the `/api/ideas` view. */
@@ -1 +1 @@
1
- {"version":3,"file":"readers.d.ts","sourceRoot":"","sources":["../../src/core/readers.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EACV,WAAW,EACX,SAAS,EAET,WAAW,EAEX,SAAS,EAEV,MAAM,gBAAgB,CAAC;AA8BxB;;;GAGG;AACH,wBAAsB,YAAY,CAChC,QAAQ,EAAE,MAAM,GACf,OAAO,CAAC,WAAW,CAAC,WAAW,CAAC,GAAG;IAAE,SAAS,EAAE,MAAM,CAAA;CAAE,CAAC,CAqB3D;AAED;;;;GAIG;AACH,wBAAgB,YAAY,CAAC,CAAC,EAAE,WAAW,GAAG,SAAS,CAkBtD;AAED,2EAA2E;AAC3E,wBAAgB,YAAY,CAAC,CAAC,EAAE,WAAW,GAAG,SAAS,CAStD;AAED,gFAAgF;AAChF,wBAAsB,eAAe,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,WAAW,CAAC,SAAS,CAAC,CAAC,CAMvF;AAED,oEAAoE;AACpE,wBAAsB,eAAe,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,WAAW,CAAC,SAAS,CAAC,CAAC,CAMvF"}
1
+ {"version":3,"file":"readers.d.ts","sourceRoot":"","sources":["../../src/core/readers.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EACV,WAAW,EACX,SAAS,EAET,WAAW,EAEX,SAAS,EAET,MAAM,EACP,MAAM,gBAAgB,CAAC;AAgCxB;;;GAGG;AACH,wBAAsB,YAAY,CAChC,QAAQ,EAAE,MAAM,GACf,OAAO,CAAC,WAAW,CAAC,WAAW,CAAC,GAAG;IAAE,SAAS,EAAE,MAAM,CAAA;CAAE,CAAC,CAqB3D;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,YAAY,CAAC,CAAC,EAAE,WAAW,EAAE,EAAE,CAAC,EAAE,MAAM,EAAE,gBAAgB,UAAQ,GAAG,SAAS,CAmB7F;AAED,2EAA2E;AAC3E,wBAAgB,YAAY,CAAC,CAAC,EAAE,WAAW,GAAG,SAAS,CAStD;AAiBD,wBAAsB,6BAA6B,CACjD,QAAQ,EAAE,MAAM,GACf,OAAO,CAAC,WAAW,CAAC,WAAW,CAAC,CAAC,CAOnC;AAED,gFAAgF;AAChF,wBAAsB,eAAe,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,WAAW,CAAC,SAAS,CAAC,CAAC,CAQvF;AAED,oEAAoE;AACpE,wBAAsB,eAAe,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,WAAW,CAAC,SAAS,CAAC,CAAC,CAMvF"}
@@ -106,7 +106,7 @@ export declare const entityFrontmatterSchema: z.ZodObject<{
106
106
  kind: z.ZodOptional<z.ZodEnum<{
107
107
  note: "note";
108
108
  }>>;
109
- status: z.ZodEnum<{
109
+ status: z.ZodOptional<z.ZodEnum<{
110
110
  idea: "idea";
111
111
  planned: "planned";
112
112
  "in-progress": "in-progress";
@@ -114,7 +114,7 @@ export declare const entityFrontmatterSchema: z.ZodObject<{
114
114
  done: "done";
115
115
  dropped: "dropped";
116
116
  open: "open";
117
- }>;
117
+ }>>;
118
118
  agent: z.ZodOptional<z.ZodEnum<{
119
119
  "claude-code": "claude-code";
120
120
  opencode: "opencode";
@@ -1 +1 @@
1
- {"version":3,"file":"schemas.d.ts","sourceRoot":"","sources":["../../src/core/schemas.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,eAAO,MAAM,iBAAiB;;;;;;;kBAO7B,CAAC;AAEF,eAAO,MAAM,UAAU,aAAiE,CAAC;AAQzF,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;;iBAS3B,CAAC;AAEH,eAAO,MAAM,oBAAoB;;;;;;;iBAI/B,CAAC;AAEH,eAAO,MAAM,wBAAwB;;;;;;;;iBAKnC,CAAC;AAYH,eAAO,MAAM,qBAAqB;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAmBhC,CAAC;AAEH,eAAO,MAAM,qBAAqB;;;;;;;;;;;;iBAgB9B,CAAC;AASL,eAAO,MAAM,uBAAuB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAwChC,CAAC;AAEL,eAAO,MAAM,qBAAqB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBA0BhC,CAAC;AAEH,MAAM,MAAM,UAAU,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,gBAAgB,CAAC,CAAC;AAC1D,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAC;AAClE,MAAM,MAAM,kBAAkB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,wBAAwB,CAAC,CAAC;AAC1E,MAAM,MAAM,eAAe,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,qBAAqB,CAAC,CAAC;AACpE,MAAM,MAAM,eAAe,GAAG,CAAC,CAA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AAM,iBAAiB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,uBAAuB,CAAC,CAAC"}
@@ -93,7 +93,7 @@ interface NewEntityFileInput {
93
93
  title: string;
94
94
  type?: string;
95
95
  kind?: string;
96
- status: string;
96
+ status?: string;
97
97
  agent?: string;
98
98
  created: string;
99
99
  updated?: string;
@@ -1 +1 @@
1
- {"version":3,"file":"serializer.d.ts","sourceRoot":"","sources":["../../src/core/serializer.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,WAAW,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAEvE,wBAAgB,eAAe,IAAI,MAAM,CAExC;AAID;;;;;;;GAOG;AACH,wBAAsB,YAAY,CAAC,UAAU,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC,CAmBhG;AAED,UAAU,YAAY;IACpB,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,IAAI,CAAC,EAAE,MAAM,EAAE,CAAC;IAChB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,MAAM,CAAC,EAAE,SAAS,EAAE,CAAC;IACrB,GAAG,CAAC,EAAE,QAAQ,EAAE,CAAC;IACjB,cAAc,CAAC,EAAE,QAAQ,EAAE,CAAC;CAC7B;AAED,wBAAgB,eAAe,CAAC,KAAK,EAAE,YAAY,GAAG,MAAM,CAqC3D;AAED,UAAU,gBAAgB;IACxB,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;IACf,YAAY,CA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E,QAAQ,EAAE,CAAC;CAC7B;AAED;;;;;GAKG;AACH,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,kBAAkB,GAAG,MAAM,CAkDlE;AAED;;;;GAIG;AACH,wBAAsB,cAAc,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC,CAEpF;AAED,UAAU,gBAAgB;IACxB,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IAEd,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,GAAG,CAAC,EAAE,QAAQ,EAAE,CAAC;CAClB;AAED;;GAEG;AACH,wBAAgB,cAAc,CAAC,KAAK,EAAE,gBAAgB,GAAG,MAAM,CAqB9D;AAED;;;;GAIG;AACH,wBAAsB,iBAAiB,CAAC,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAexF;AAMD,wBAAgB,mBAAmB,CAAC,QAAQ,EAAE,WAAW,EAAE,GAAG,MAAM,CAgBnE"}
@@ -0,0 +1,27 @@
1
+ import { EntityStatus, PhaseItem, PrInfo } from '../types/index';
2
+ /** The subset of an entity's shape the status ladder needs to look at. */
3
+ export interface StatusDerivationInput {
4
+ kind?: 'note';
5
+ status?: EntityStatus;
6
+ phases: PhaseItem[];
7
+ }
8
+ /**
9
+ * Derives lifecycle status from the entity's phases and its GitHub PR instead of
10
+ * trusting the stored `status` field, so it can't drift from reality — see
11
+ * IDEA-56. Tracking keys off the PR (matched by id), not a local branch: the PR
12
+ * is canonical across clones and survives the branch being deleted after merge.
13
+ *
14
+ * Ladder: idea (no phases) -> planned (phases, no PR) -> in-progress (PR open or
15
+ * draft) -> review (PR open/draft AND every phase checked) -> done (PR merged).
16
+ * A closed-unmerged PR reads as `dropped`. `dropped` can never be derived
17
+ * (abandonment leaves no trace), so a stored `dropped` always passes through;
18
+ * notes track open/done/dropped by hand and pass through unchanged.
19
+ *
20
+ * `pr` is the entity's resolved PR, or `undefined` when it has none / the lookup
21
+ * couldn't run. `prLookupResolved` says which: `false` (no `gh`, offline) falls
22
+ * the PR-backed rungs back to the stored override or a phases-only `planned`;
23
+ * `true` with no PR is a confirmed "no PR", so it derives `planned`/`idea` (a
24
+ * stored terminal `done` from an unmatchable legacy PR is still trusted).
25
+ */
26
+ export declare function deriveStatus(entity: StatusDerivationInput, pr: PrInfo | undefined, prLookupResolved: boolean): EntityStatus | undefined;
27
+ //# sourceMappingURL=status.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"status.d.ts","sourceRoot":"","sources":["../../src/core/status.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAC;AAEtE,0EAA0E;AAC1E,MAAM,WAAW,qBAAqB;IACpC,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,MAAM,CAAC,EAAE,YAAY,CAAC;IACtB,MAAM,EAAE,SAAS,EAAE,CAAC;CACrB;AAMD;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,YAAY,CAC1B,MAAM,EAAE,qBAAqB,EAC7B,EAAE,EAAE,MAAM,GAAG,SAAS,EACtB,gBAAgB,EAAE,OAAO,GACxB,YAAY,GAAG,SAAS,CAgB1B"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=status.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"status.test.d.ts","sourceRoot":"","sources":["../../src/core/status.test.ts"],"names":[],"mappings":""}
@@ -34,6 +34,35 @@ export interface ParseResult<T> {
34
34
  entries: T[];
35
35
  warnings: ParseWarning[];
36
36
  }
37
+ /** A PR's reviewable/mergeable state, as surfaced by `gh pr list`. */
38
+ export type PrState = 'draft' | 'open' | 'closed' | 'merged';
39
+ /** GitHub's PR review decision, as surfaced by `gh pr list --json reviewDecision`. */
40
+ export type ReviewDecision = 'approved' | 'changes-requested' | 'review-required';
41
+ /**
42
+ * A single unresolved review comment/thread on a PR — the per-comment detail
43
+ * `PrInfo.unresolvedThreadCount` only counts. Fetched by the fix-review launch
44
+ * path (not `core/pr.ts`'s worklist resolver, which only needs the count) and
45
+ * fed to `buildFixReviewPrompt` in `prompts.ts`.
46
+ */
47
+ export interface ReviewThread {
48
+ /** File path the comment is anchored to; absent for a PR-level (not diff-anchored) comment. */
49
+ path?: string;
50
+ line?: number;
51
+ author?: string;
52
+ body: string;
53
+ }
54
+ /** Live-resolved PR info for an entity's branch — see `core/pr.ts`. */
55
+ export interface PrInfo {
56
+ number: number;
57
+ url: string;
58
+ state: PrState;
59
+ /** Undefined when no review has been requested/decided, or when unresolved (offline, closed/merged PR). */
60
+ reviewDecision?: ReviewDecision;
61
+ /** Count of unresolved review threads. Only fetched for open/draft PRs; undefined when not fetched or unresolved. */
62
+ unresolvedThreadCount?: number;
63
+ /** Whether a comment or review landed after the PR's last commit — a proxy for "since the last agent pass" (a pass ends with a push). Only fetched for open/draft PRs. */
64
+ hasNewCommentsSincePush?: boolean;
65
+ }
37
66
  export interface PlanEntry {
38
67
  title: string;
39
68
  status: PlanStatus;
@@ -50,6 +79,8 @@ export interface PlanEntry {
50
79
  phases: PhaseItem[];
51
80
  log?: LogEntry[];
52
81
  clarifications?: LogEntry[];
82
+ /** Live-resolved PR for this entity's branch, when one exists — see `core/pr.ts`. */
83
+ pr?: PrInfo;
53
84
  }
54
85
  export interface DecisionEntry {
55
86
  title: string;
@@ -95,7 +126,8 @@ export interface EntityEntry {
95
126
  type?: EntityType;
96
127
  /** "note" marks an entity that never grows phases. */
97
128
  kind?: 'note';
98
- status: EntityStatus;
129
+ /** Stored override, not the source of truth — see entityFrontmatterSchema. */
130
+ status?: EntityStatus;
99
131
  agent?: AgentId;
100
132
  created: string;
101
133
  updated?: string;
@@ -170,7 +202,7 @@ export interface GitStatusResponse {
170
202
  }
171
203
  export type BranchHygieneStatus = 'clean-on-main' | 'stale-merged' | 'stale-no-upstream' | 'dirty' | 'fine';
172
204
  export type AgentTaskStatus = 'starting' | 'running' | 'stopping' | 'done' | 'error';
173
- export type TaskKind = 'phase' | 'audit' | 'batch-reconcile' | 'run-all' | 'draft' | 'extend' | 'commit-suggest' | 'sync' | 'reconcile';
205
+ export type TaskKind = 'phase' | 'audit' | 'batch-reconcile' | 'run-all' | 'draft' | 'extend' | 'commit-suggest' | 'overlap-check' | 'sync' | 'reconcile' | 'fix-review';
174
206
  export interface AgentTaskState {
175
207
  status: AgentTaskStatus;
176
208
  taskKind: TaskKind;
@@ -181,6 +213,11 @@ export interface AgentTaskState {
181
213
  agentId: AgentId;
182
214
  lines: string[];
183
215
  }
216
+ export interface OverlapVerdict {
217
+ verdict: 'existing' | 'extend' | 'new';
218
+ targetId: string | null;
219
+ reasoning: string;
220
+ }
184
221
  export interface ReconcileQueueItem {
185
222
  planId: string;
186
223
  title: string;
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,UAAU,GAAG,MAAM,GAAG,SAAS,GAAG,aAAa,GAAG,QAAQ,GAAG,MAAM,GAAG,SAAS,CAAC;AAE5F,eAAO,MAAM,aAAa,EAAE,UAAU,EAOrC,CAAC;AAEF,MAAM,WAAW,QAAQ;IACvB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;CACd;AAED,MAAM,MAAM,QAAQ,GAAG,MAAM,GAAG,KAAK,GAAG,OAAO,GAAG,MAAM,GAAG,UAAU,CAAC;AAEtE,eAAO,MAAM,UAAU,EAAE,QAAQ,EAAiD,CAAC;AAEnF,eAAO,MAAM,SAAS,sCAAuC,CAAC;AAE9D,MAAM,MAAM,OAAO,GAAG,CAAC,OAAO,SAAS,CAAC,CAAC,MAAM,CAAC,CAAC;AAEjD,eAAO,MAAM,YAAY,EAAE,MAAM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AAU,GAAG,SAAS,GAAG,UAAU,GAAG,MAAM,GAAG,OAAO,CAAC;AAErF,MAAM,MAAM,QAAQ,GAChB,OAAO,GACP,OAAO,GACP,iBAAiB,GACjB,SAAS,GACT,OAAO,GACP,QAAQ,GACR,gBAAgB,GAChB,eAAe,GACf,MAAM,GACN,WAAW,GACX,YAAY,CAAC;AAEjB,MAAM,WAAW,cAAc;IAC7B,MAAM,EAAE,eAAe,CAAC;IACxB,QAAQ,EAAE,QAAQ,CAAC;IACnB,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,OAAO,CAAC;IACjB,KAAK,EAAE,MAAM,EAAE,CAAC;CACjB;AAID,MAAM,WAAW,cAAc;IAC7B,OAAO,EAAE,UAAU,GAAG,QAAQ,GAAG,KAAK,CAAC;IACvC,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;IACxB,SAAS,EAAE,MAAM,CAAC;CACnB;AAKD,MAAM,WAAW,kBAAkB;IACjC,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,SAAS,EAAE,CAAA;KAAE,CAAC;CAC/C"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../../src/types/index.ts"],"sourcesContent":["export type PlanStatus = 'idea' | 'planned' | 'in-progress' | 'review' | 'done' | 'dropped';\n\nexport const PLAN_STATUSES: PlanStatus[] = [\n 'idea',\n 'planned',\n 'in-progress',\n 'review',\n 'done',\n 'dropped',\n];\n\nexport interface LogEntry {\n date: string;\n text: string;\n}\n\nexport type PlanKind = 'feat' | 'fix' | 'chore' | 'docs' | 'refactor';\n\nexport const PLAN_KINDS: PlanKind[] = ['feat', 'fix', 'chore', 'docs', 'refactor'];\n\nexport const AGENT_IDS = ['claude-code', 'opencode'] as const;\n\nexport type AgentId = (typeof AGENT_IDS)[number];\n\nexport const AGENT_LABELS: Record<AgentId, string> = {\n 'claude-code': 'Claude Code',\n opencode: 'OpenCode',\n};\n\nexport type DecisionStatus = 'decided' | 'superseded';\n\nexport type QuestionStatus = 'open' | 'resolved';\n\nexport interface PhaseItem {\n done: boolean;\n text: string;\n description?: string;\n source?: 'review';\n}\n\n/** Raw shape produced by the generic heading-block parser, before per-file validation. */\nexport interface RawEntry {\n title: string;\n fields: Record<string, string>;\n body: string;\n phases: PhaseItem[];\n log?: LogEntry[];\n clarifications?: LogEntry[];\n}\n\nexport interface ParseWarning {\n title: string;\n message: string;\n}\n\nexport interface ParseResult<T> {\n entries: T[];\n warnings: ParseWarning[];\n}\n\nexport interface PlanEntry {\n title: string;\n status: PlanStatus;\n kind?: PlanKind;\n id?: string;\n idea?: string;\n agent?: AgentId;\n created: string;\n updated?: string;\n audited?: string;\n auditedHash?: string;\n tags: string[];\n body: string;\n phases: PhaseItem[];\n log?: LogEntry[];\n clarifications?: LogEntry[];\n}\n\nexport interface DecisionEntry {\n title: string;\n date: string;\n status: DecisionStatus;\n supersededBy?: string;\n body: string;\n}\n\nexport interface OpenQuestionEntry {\n title: string;\n status: QuestionStatus;\n raised: string;\n resolvedBy?: string;\n blocks?: string;\n body: string;\n}\n\nexport type ConsistencyIssueKind =\n | 'dangling-resolved-by'\n | 'dangling-superseded-by'\n | 'blocked-plan-active';\n\nexport interface ConsistencyIssue {\n kind: ConsistencyIssueKind;\n section: 'decisions' | 'open-questions';\n title: string;\n message: string;\n planId?: string;\n}\n\nexport type IdeaKind = 'idea' | 'note';\n\nexport type IdeaStatus = 'open' | 'done' | 'dropped';\n\nexport interface IdeaEntry {\n id: string | null;\n title: string;\n body: string;\n kind?: IdeaKind;\n status?: IdeaStatus;\n log?: LogEntry[];\n}\n\n// ---------------------------------------------------------------------------\n// Unified entity (FEAT-42 phases 7+ — one file per entity: an \"idea\" for its\n// whole life, plan as an optional Phases section. Replaces PlanEntry/IdeaEntry\n// once the migration cutover lands.)\n// ---------------------------------------------------------------------------\n\n/** Work classification — same Conventional-Commits values as PlanKind; `kind` renamed to `type` in the unified schema. */\nexport type EntityType = PlanKind;\n\n/** Plan lifecycle plus the note-only `open`. Notes use open → done/dropped; everything else uses the PlanStatus track. */\nexport type EntityStatus = PlanStatus | 'open';\n\nexport interface EntityEntry {\n id: string;\n title: string;\n /** Absent until the entity is classified (usually when its plan is drafted). */\n type?: EntityType;\n /** \"note\" marks an entity that never grows phases. */\n kind?: 'note';\n status: EntityStatus;\n agent?: AgentId;\n created: string;\n updated?: string;\n audited?: string;\n auditedHash?: string;\n tags: string[];\n body: string;\n phases: PhaseItem[];\n log?: LogEntry[];\n clarifications?: LogEntry[];\n}\n\nexport interface ProgressEntry {\n date: string;\n items: string[];\n}\n\nexport interface EnvEntry {\n key: string;\n value: string;\n}\n\nexport interface AgentConfig {\n agent: AgentId;\n model?: string;\n effort?: string;\n}\n\n/** Model/effort passed to an adapter's buildArgs — the AgentConfig minus the agent id. */\nexport interface AgentRunOptions {\n model?: string;\n effort?: string;\n}\n\n/** Maps option names to a fixed value list (renders a Select) or null (free-text or hidden). */\nexport type AgentOptionsDescriptor = Record<string, string[] | null | undefined>;\n\nexport const AGENT_OPTIONS: Record<AgentId, AgentOptionsDescriptor> = {\n 'claude-code': {\n model: ['opus', 'sonnet', 'fable', 'haiku'],\n effort: ['low', 'medium', 'high', 'xhigh', 'max'],\n },\n opencode: {\n model: null,\n },\n};\n\nexport function coerceAgentConfig(v: unknown): AgentConfig {\n const toAgent = (a: unknown): AgentId =>\n AGENT_IDS.includes(a as AgentId) ? (a as AgentId) : 'claude-code';\n if (typeof v === 'string') return { agent: toAgent(v) };\n // Tolerate null/undefined and partial legacy entries — a missing key must not\n // throw (that would 500 the /api/config read this coercion exists to protect).\n const obj = (v ?? {}) as Record<string, unknown>;\n return {\n agent: toAgent(obj.agent),\n ...(typeof obj.model === 'string' && { model: obj.model }),\n ...(typeof obj.effort === 'string' && { effort: obj.effort }),\n };\n}\n\nexport interface DefaultAgentsMap {\n phase: AgentConfig;\n planDraft: AgentConfig;\n ideaExtend: AgentConfig;\n commitSuggest: AgentConfig;\n}\n\nexport const DEFAULT_AGENTS: DefaultAgentsMap = {\n phase: { agent: 'opencode' },\n planDraft: { agent: 'claude-code' },\n ideaExtend: { agent: 'claude-code' },\n commitSuggest: { agent: 'claude-code' },\n};\n\nexport interface PaperCampConfig {\n version: string;\n projectName: string;\n initializedAt: string;\n /** The unified-entity `idea` counter; the per-kind plan counters are legacy, present only in pre-migration configs. */\n nextId?: Partial<Record<PlanKind, number>> & { idea?: number };\n port?: number;\n defaultAgents?: DefaultAgentsMap;\n /** Off by default. When true, the PostToolUse hook logs new-file creations to progress.md. */\n autoLogNewFiles?: boolean;\n}\n\nexport type CheckStatus = 'stale' | 'running' | 'pass' | 'fail';\n\nexport interface CheckResult {\n status: CheckStatus;\n lastRun: string | null;\n output: string;\n}\n\nexport type CheckName = 'lint' | 'format' | 'test' | 'consistency';\n\nexport interface GitStatusEntry {\n path: string;\n status: string;\n staged: boolean;\n renameSource?: string;\n}\n\nexport interface GitStatusResponse {\n branch: string;\n entries: GitStatusEntry[];\n ahead: number;\n branchHygiene: BranchHygieneStatus;\n}\n\nexport type BranchHygieneStatus =\n | 'clean-on-main'\n | 'stale-merged'\n | 'stale-no-upstream'\n | 'dirty'\n | 'fine';\n\nexport type AgentTaskStatus = 'starting' | 'running' | 'stopping' | 'done' | 'error';\n\nexport type TaskKind =\n | 'phase'\n | 'audit'\n | 'batch-reconcile'\n | 'run-all'\n | 'draft'\n | 'extend'\n | 'commit-suggest'\n | 'sync'\n | 'reconcile';\n\nexport interface AgentTaskState {\n status: AgentTaskStatus;\n taskKind: TaskKind;\n planTitle: string;\n planId?: string;\n phaseIndex?: number;\n ideaId?: string;\n agentId: AgentId;\n lines: string[];\n}\n\n// A single entity's proposed rewrite from a batch reconcile sweep, held server-side\n// (see startBatchReconcile in agent.ts) and served via GET /api/agent/reconcile-queue\n// once the sweep's `before` snapshot for that entity is known to have changed.\nexport interface ReconcileQueueItem {\n planId: string;\n title: string;\n before: { body: string; phases: PhaseItem[] };\n}\n"],"names":["PLAN_STATUSES","PLAN_KINDS","AGENT_IDS","AGENT_LABELS","AGENT_OPTIONS","coerceAgentConfig","v","toAgent","a","obj","DEFAULT_AGENTS"],"mappings":"AAEO,MAAMA,IAA8B;AAAA,EACzC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,GASaC,IAAyB,CAAC,QAAQ,OAAO,SAAS,QAAQ,UAAU,GAEpEC,IAAY,CAAC,eAAe,UAAU,GAItCC,IAAwC;AAAA,EACnD,eAAe;AAAA,EACf,UAAU;AACZ,GAuJaC,IAAyD;AAAA,EACpE,eAAe;AAAA,IACb,OAAO,CAAC,QAAQ,UAAU,SAAS,OAAO;AAAA,IAC1C,QAAQ,CAAC,OAAO,UAAU,QAAQ,SAAS,KAAK;AAAA,EAAA;AAAA,EAElD,UAAU;AAAA,IACR,OAAO;AAAA,EAAA;AAEX;AAEO,SAASC,EAAkBC,GAAyB;AACzD,QAAMC,IAAU,CAACC,MACfN,EAAU,SAASM,CAAY,IAAKA,IAAgB;AACtD,MAAI,OAAOF,KAAM,SAAU,QAAO,EAAE,OAAOC,EAAQD,CAAC,EAAA;AAGpD,QAAMG,IAAOH,KAAK,CAAA;AAClB,SAAO;AAAA,IACL,OAAOC,EAAQE,EAAI,KAAK;AAAA,IACxB,GAAI,OAAOA,EAAI,SAAU,YAAY,EAAE,OAAOA,EAAI,MAAA;AAAA,IAClD,GAAI,OAAOA,EAAI,UAAW,YAAY,EAAE,QAAQA,EAAI,OAAA;AAAA,EAAO;AAE/D;AASO,MAAMC,IAAmC;AAAA,EAC9C,OAAO,EAAE,OAAO,WAAA;AAAA,EAChB,WAAW,EAAE,OAAO,cAAA;AAAA,EACpB,YAAY,EAAE,OAAO,cAAA;AAAA,EACrB,eAAe,EAAE,OAAO,cAAA;AAC1B;"}
1
+ {"version":3,"file":"index.js","sources":["../../src/types/index.ts"],"sourcesContent":["export type PlanStatus = 'idea' | 'planned' | 'in-progress' | 'review' | 'done' | 'dropped';\n\nexport const PLAN_STATUSES: PlanStatus[] = [\n 'idea',\n 'planned',\n 'in-progress',\n 'review',\n 'done',\n 'dropped',\n];\n\nexport interface LogEntry {\n date: string;\n text: string;\n}\n\nexport type PlanKind = 'feat' | 'fix' | 'chore' | 'docs' | 'refactor';\n\nexport const PLAN_KINDS: PlanKind[] = ['feat', 'fix', 'chore', 'docs', 'refactor'];\n\nexport const AGENT_IDS = ['claude-code', 'opencode'] as const;\n\nexport type AgentId = (typeof AGENT_IDS)[number];\n\nexport const AGENT_LABELS: Record<AgentId, string> = {\n 'claude-code': 'Claude Code',\n opencode: 'OpenCode',\n};\n\nexport type DecisionStatus = 'decided' | 'superseded';\n\nexport type QuestionStatus = 'open' | 'resolved';\n\nexport interface PhaseItem {\n done: boolean;\n text: string;\n description?: string;\n source?: 'review';\n}\n\n/** Raw shape produced by the generic heading-block parser, before per-file validation. */\nexport interface RawEntry {\n title: string;\n fields: Record<string, string>;\n body: string;\n phases: PhaseItem[];\n log?: LogEntry[];\n clarifications?: LogEntry[];\n}\n\nexport interface ParseWarning {\n title: string;\n message: string;\n}\n\nexport interface ParseResult<T> {\n entries: T[];\n warnings: ParseWarning[];\n}\n\n/** A PR's reviewable/mergeable state, as surfaced by `gh pr list`. */\nexport type PrState = 'draft' | 'open' | 'closed' | 'merged';\n\n/** GitHub's PR review decision, as surfaced by `gh pr list --json reviewDecision`. */\nexport type ReviewDecision = 'approved' | 'changes-requested' | 'review-required';\n\n/**\n * A single unresolved review comment/thread on a PR — the per-comment detail\n * `PrInfo.unresolvedThreadCount` only counts. Fetched by the fix-review launch\n * path (not `core/pr.ts`'s worklist resolver, which only needs the count) and\n * fed to `buildFixReviewPrompt` in `prompts.ts`.\n */\nexport interface ReviewThread {\n /** File path the comment is anchored to; absent for a PR-level (not diff-anchored) comment. */\n path?: string;\n line?: number;\n author?: string;\n body: string;\n}\n\n/** Live-resolved PR info for an entity's branch — see `core/pr.ts`. */\nexport interface PrInfo {\n number: number;\n url: string;\n state: PrState;\n /** Undefined when no review has been requested/decided, or when unresolved (offline, closed/merged PR). */\n reviewDecision?: ReviewDecision;\n /** Count of unresolved review threads. Only fetched for open/draft PRs; undefined when not fetched or unresolved. */\n unresolvedThreadCount?: number;\n /** Whether a comment or review landed after the PR's last commit — a proxy for \"since the last agent pass\" (a pass ends with a push). Only fetched for open/draft PRs. */\n hasNewCommentsSincePush?: boolean;\n}\n\nexport interface PlanEntry {\n title: string;\n status: PlanStatus;\n kind?: PlanKind;\n id?: string;\n idea?: string;\n agent?: AgentId;\n created: string;\n updated?: string;\n audited?: string;\n auditedHash?: string;\n tags: string[];\n body: string;\n phases: PhaseItem[];\n log?: LogEntry[];\n clarifications?: LogEntry[];\n /** Live-resolved PR for this entity's branch, when one exists — see `core/pr.ts`. */\n pr?: PrInfo;\n}\n\nexport interface DecisionEntry {\n title: string;\n date: string;\n status: DecisionStatus;\n supersededBy?: string;\n body: string;\n}\n\nexport interface OpenQuestionEntry {\n title: string;\n status: QuestionStatus;\n raised: string;\n resolvedBy?: string;\n blocks?: string;\n body: string;\n}\n\nexport type ConsistencyIssueKind =\n | 'dangling-resolved-by'\n | 'dangling-superseded-by'\n | 'blocked-plan-active';\n\nexport interface ConsistencyIssue {\n kind: ConsistencyIssueKind;\n section: 'decisions' | 'open-questions';\n title: string;\n message: string;\n planId?: string;\n}\n\nexport type IdeaKind = 'idea' | 'note';\n\nexport type IdeaStatus = 'open' | 'done' | 'dropped';\n\nexport interface IdeaEntry {\n id: string | null;\n title: string;\n body: string;\n kind?: IdeaKind;\n status?: IdeaStatus;\n log?: LogEntry[];\n}\n\n// ---------------------------------------------------------------------------\n// Unified entity (FEAT-42 phases 7+ — one file per entity: an \"idea\" for its\n// whole life, plan as an optional Phases section. Replaces PlanEntry/IdeaEntry\n// once the migration cutover lands.)\n// ---------------------------------------------------------------------------\n\n/** Work classification — same Conventional-Commits values as PlanKind; `kind` renamed to `type` in the unified schema. */\nexport type EntityType = PlanKind;\n\n/** Plan lifecycle plus the note-only `open`. Notes use open → done/dropped; everything else uses the PlanStatus track. */\nexport type EntityStatus = PlanStatus | 'open';\n\nexport interface EntityEntry {\n id: string;\n title: string;\n /** Absent until the entity is classified (usually when its plan is drafted). */\n type?: EntityType;\n /** \"note\" marks an entity that never grows phases. */\n kind?: 'note';\n /** Stored override, not the source of truth — see entityFrontmatterSchema. */\n status?: EntityStatus;\n agent?: AgentId;\n created: string;\n updated?: string;\n audited?: string;\n auditedHash?: string;\n tags: string[];\n body: string;\n phases: PhaseItem[];\n log?: LogEntry[];\n clarifications?: LogEntry[];\n}\n\nexport interface ProgressEntry {\n date: string;\n items: string[];\n}\n\nexport interface EnvEntry {\n key: string;\n value: string;\n}\n\nexport interface AgentConfig {\n agent: AgentId;\n model?: string;\n effort?: string;\n}\n\n/** Model/effort passed to an adapter's buildArgs — the AgentConfig minus the agent id. */\nexport interface AgentRunOptions {\n model?: string;\n effort?: string;\n}\n\n/** Maps option names to a fixed value list (renders a Select) or null (free-text or hidden). */\nexport type AgentOptionsDescriptor = Record<string, string[] | null | undefined>;\n\nexport const AGENT_OPTIONS: Record<AgentId, AgentOptionsDescriptor> = {\n 'claude-code': {\n model: ['opus', 'sonnet', 'fable', 'haiku'],\n effort: ['low', 'medium', 'high', 'xhigh', 'max'],\n },\n opencode: {\n model: null,\n },\n};\n\nexport function coerceAgentConfig(v: unknown): AgentConfig {\n const toAgent = (a: unknown): AgentId =>\n AGENT_IDS.includes(a as AgentId) ? (a as AgentId) : 'claude-code';\n if (typeof v === 'string') return { agent: toAgent(v) };\n // Tolerate null/undefined and partial legacy entries — a missing key must not\n // throw (that would 500 the /api/config read this coercion exists to protect).\n const obj = (v ?? {}) as Record<string, unknown>;\n return {\n agent: toAgent(obj.agent),\n ...(typeof obj.model === 'string' && { model: obj.model }),\n ...(typeof obj.effort === 'string' && { effort: obj.effort }),\n };\n}\n\nexport interface DefaultAgentsMap {\n phase: AgentConfig;\n planDraft: AgentConfig;\n ideaExtend: AgentConfig;\n commitSuggest: AgentConfig;\n}\n\nexport const DEFAULT_AGENTS: DefaultAgentsMap = {\n phase: { agent: 'opencode' },\n planDraft: { agent: 'claude-code' },\n ideaExtend: { agent: 'claude-code' },\n commitSuggest: { agent: 'claude-code' },\n};\n\nexport interface PaperCampConfig {\n version: string;\n projectName: string;\n initializedAt: string;\n /** The unified-entity `idea` counter; the per-kind plan counters are legacy, present only in pre-migration configs. */\n nextId?: Partial<Record<PlanKind, number>> & { idea?: number };\n port?: number;\n defaultAgents?: DefaultAgentsMap;\n /** Off by default. When true, the PostToolUse hook logs new-file creations to progress.md. */\n autoLogNewFiles?: boolean;\n}\n\nexport type CheckStatus = 'stale' | 'running' | 'pass' | 'fail';\n\nexport interface CheckResult {\n status: CheckStatus;\n lastRun: string | null;\n output: string;\n}\n\nexport type CheckName = 'lint' | 'format' | 'test' | 'consistency';\n\nexport interface GitStatusEntry {\n path: string;\n status: string;\n staged: boolean;\n renameSource?: string;\n}\n\nexport interface GitStatusResponse {\n branch: string;\n entries: GitStatusEntry[];\n ahead: number;\n branchHygiene: BranchHygieneStatus;\n}\n\nexport type BranchHygieneStatus =\n | 'clean-on-main'\n | 'stale-merged'\n | 'stale-no-upstream'\n | 'dirty'\n | 'fine';\n\nexport type AgentTaskStatus = 'starting' | 'running' | 'stopping' | 'done' | 'error';\n\nexport type TaskKind =\n | 'phase'\n | 'audit'\n | 'batch-reconcile'\n | 'run-all'\n | 'draft'\n | 'extend'\n | 'commit-suggest'\n | 'overlap-check'\n | 'sync'\n | 'reconcile'\n | 'fix-review';\n\nexport interface AgentTaskState {\n status: AgentTaskStatus;\n taskKind: TaskKind;\n planTitle: string;\n planId?: string;\n phaseIndex?: number;\n ideaId?: string;\n agentId: AgentId;\n lines: string[];\n}\n\n// The AI Check-overlap action's triage result (IDEA-44 Tier 2): does the typed\n// text belong inside an existing idea, extend one, or is it genuinely new?\nexport interface OverlapVerdict {\n verdict: 'existing' | 'extend' | 'new';\n targetId: string | null;\n reasoning: string;\n}\n\n// A single entity's proposed rewrite from a batch reconcile sweep, held server-side\n// (see startBatchReconcile in agent.ts) and served via GET /api/agent/reconcile-queue\n// once the sweep's `before` snapshot for that entity is known to have changed.\nexport interface ReconcileQueueItem {\n planId: string;\n title: string;\n before: { body: string; phases: PhaseItem[] };\n}\n"],"names":["PLAN_STATUSES","PLAN_KINDS","AGENT_IDS","AGENT_LABELS","AGENT_OPTIONS","coerceAgentConfig","v","toAgent","a","obj","DEFAULT_AGENTS"],"mappings":"AAEO,MAAMA,IAA8B;AAAA,EACzC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,GASaC,IAAyB,CAAC,QAAQ,OAAO,SAAS,QAAQ,UAAU,GAEpEC,IAAY,CAAC,eAAe,UAAU,GAItCC,IAAwC;AAAA,EACnD,eAAe;AAAA,EACf,UAAU;AACZ,GA2LaC,IAAyD;AAAA,EACpE,eAAe;AAAA,IACb,OAAO,CAAC,QAAQ,UAAU,SAAS,OAAO;AAAA,IAC1C,QAAQ,CAAC,OAAO,UAAU,QAAQ,SAAS,KAAK;AAAA,EAAA;AAAA,EAElD,UAAU;AAAA,IACR,OAAO;AAAA,EAAA;AAEX;AAEO,SAASC,EAAkBC,GAAyB;AACzD,QAAMC,IAAU,CAACC,MACfN,EAAU,SAASM,CAAY,IAAKA,IAAgB;AACtD,MAAI,OAAOF,KAAM,SAAU,QAAO,EAAE,OAAOC,EAAQD,CAAC,EAAA;AAGpD,QAAMG,IAAOH,KAAK,CAAA;AAClB,SAAO;AAAA,IACL,OAAOC,EAAQE,EAAI,KAAK;AAAA,IACxB,GAAI,OAAOA,EAAI,SAAU,YAAY,EAAE,OAAOA,EAAI,MAAA;AAAA,IAClD,GAAI,OAAOA,EAAI,UAAW,YAAY,EAAE,QAAQA,EAAI,OAAA;AAAA,EAAO;AAE/D;AASO,MAAMC,IAAmC;AAAA,EAC9C,OAAO,EAAE,OAAO,WAAA;AAAA,EAChB,WAAW,EAAE,OAAO,cAAA;AAAA,EACpB,YAAY,EAAE,OAAO,cAAA;AAAA,EACrB,eAAe,EAAE,OAAO,cAAA;AAC1B;"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dendelion/paper-camp",
3
- "version": "0.6.0",
3
+ "version": "0.7.0",
4
4
  "description": "Local-first, AI-native project management with retro aesthetics",
5
5
  "type": "module",
6
6
  "packageManager": "pnpm@10.12.1",
@@ -54,7 +54,7 @@
54
54
  "react-dom": "^18.0.0"
55
55
  },
56
56
  "dependencies": {
57
- "@dendelion/paper-ui": "0.7.1",
57
+ "@dendelion/paper-ui": "0.7.4",
58
58
  "@modelcontextprotocol/sdk": "^1.29.0",
59
59
  "@tanstack/react-router": "^1.58.3",
60
60
  "commander": "^12.0.0",