@infodb/p3 0.12.0 → 0.14.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.
Files changed (219) hide show
  1. package/README.md +33 -35
  2. package/bin/p3.mjs +3 -2
  3. package/dist/web/assets/CompletionReview-BD7d6Yzt.js +1 -0
  4. package/dist/web/assets/ImprovementDialog-BoAZN1KR.js +1 -0
  5. package/dist/web/assets/Outputs-D-ZouoxF.js +1 -0
  6. package/dist/web/assets/RequestStatus-Bl3fdSbM.js +1 -0
  7. package/dist/web/assets/Tabs-CxeceOL-.js +1 -0
  8. package/dist/web/assets/TagInput-CeAbmGRR.js +1 -0
  9. package/dist/web/assets/TaskDrawer-BCriSnhe.js +6 -0
  10. package/dist/web/assets/_requestId-CZKMe_mC.js +1 -0
  11. package/dist/web/assets/_requestId-Fx4lLkFo.js +1 -0
  12. package/dist/web/assets/appCtx-BdxbkSZa.js +1 -0
  13. package/dist/web/assets/archive-D5IIxcSV.js +1 -0
  14. package/dist/web/assets/board-p6R9KMqd.js +1 -0
  15. package/dist/web/assets/done-BTOF188x.js +1 -0
  16. package/dist/web/assets/draft-BWYpm3PD.js +2 -0
  17. package/dist/web/assets/index-DFbY8NAR.css +2 -0
  18. package/dist/web/assets/index-Dpqi2dcC.js +12 -0
  19. package/dist/web/assets/link-D481whDt.js +1 -0
  20. package/dist/web/assets/metrics-CAzP6V8I.js +1 -0
  21. package/dist/web/assets/new-C65IJJg3.js +1 -0
  22. package/dist/web/assets/outputs-CXqnjSqV.js +1 -0
  23. package/dist/web/assets/preflightInput-ClKwkp8R.js +2 -0
  24. package/dist/web/assets/preload-helper-_dAYMct_.js +1 -0
  25. package/dist/web/assets/{quality-Pu6EISAM.js → quality-RFd-7k3r.js} +1 -1
  26. package/dist/web/assets/release-notes-Dtif8xsQ.js +5 -0
  27. package/dist/web/assets/requestData-SPc36t8Q.js +1 -0
  28. package/dist/web/assets/routes-DJj8CWuk.js +6 -0
  29. package/dist/web/assets/settings-DKJd7CLe.js +1 -0
  30. package/dist/web/assets/ui-CbEOnPnF.js +1 -0
  31. package/dist/web/assets/workTarget-DavxMs-c.js +30 -0
  32. package/dist/web/index.html +6 -4
  33. package/docs/architecture.md +430 -72
  34. package/docs/chatgpt-sign-in.md +2 -2
  35. package/docs/development.md +141 -64
  36. package/docs/feature-inventory.md +139 -0
  37. package/docs/how-to-use.md +389 -31
  38. package/docs/installation.md +261 -147
  39. package/docs/publishing.md +33 -14
  40. package/docs/refactoring.md +332 -0
  41. package/lib/cli/agentsStatus.js +198 -0
  42. package/lib/cli/guide.js +27 -0
  43. package/lib/cli/guide.md +217 -0
  44. package/lib/cli/help.js +45 -7
  45. package/lib/cli/main.js +58 -207
  46. package/lib/cli/project.js +34 -294
  47. package/lib/core/projectRegistry.js +2 -2
  48. package/lib/kit/appInfo.js +13 -0
  49. package/lib/kit/usage.js +27 -0
  50. package/lib/server/api/projectsRoutes.js +5 -5
  51. package/lib/server/server.js +7 -4
  52. package/lib/{cli → tasks/cli}/args.js +73 -9
  53. package/lib/{cli → tasks/cli}/chatgpt.js +1 -1
  54. package/lib/{cli → tasks/cli}/codex.js +1 -1
  55. package/lib/{cli → tasks/cli}/output.js +12 -2
  56. package/lib/{cli → tasks/cli}/preflightCommands.js +1 -1
  57. package/lib/tasks/cli/readOnly.js +75 -0
  58. package/lib/{cli → tasks/cli}/render.js +1 -1
  59. package/lib/{cli → tasks/cli}/requestCommands.js +24 -7
  60. package/lib/tasks/cli/showView.js +279 -0
  61. package/lib/{cli → tasks/cli}/taskCommands.js +55 -21
  62. package/lib/tasks/cli/tasksCli.js +149 -0
  63. package/lib/{core → tasks/core}/context.js +6 -9
  64. package/lib/tasks/core/errorOutcome.js +125 -0
  65. package/lib/{core → tasks/core}/hierarchy.js +1 -1
  66. package/lib/{core → tasks/core}/ops.js +17 -2
  67. package/lib/{core → tasks/core}/preflight/carryover.js +5 -1
  68. package/lib/{core → tasks/core}/preflight/codexEngine.js +36 -28
  69. package/lib/{core → tasks/core}/preflight/diagnose.js +4 -9
  70. package/lib/{core → tasks/core}/preflight/engine.js +9 -0
  71. package/lib/tasks/core/preflight/hostPaths.js +299 -0
  72. package/lib/{core → tasks/core}/preflight/input.js +33 -5
  73. package/lib/{core → tasks/core}/preflight/instructions.js +19 -2
  74. package/lib/{core → tasks/core}/preflight/mockEngine.js +27 -8
  75. package/lib/{core → tasks/core}/preflight/render.js +22 -3
  76. package/lib/{core → tasks/core}/preflight/service.js +86 -11
  77. package/lib/{core → tasks/core}/preflight/uiRender.js +5 -2
  78. package/lib/{core → tasks/core}/requestOps.js +214 -17
  79. package/lib/{core → tasks/core}/reviewRuns.js +127 -22
  80. package/lib/{core → tasks/core}/store/attachments.js +3 -2
  81. package/lib/{core → tasks/core}/store/collection.js +21 -2
  82. package/lib/tasks/core/store/fieldGroups.js +30 -0
  83. package/lib/tasks/core/store/jsonRecord.js +30 -0
  84. package/lib/{core → tasks/core}/store/normalize.js +15 -10
  85. package/lib/{core → tasks/core}/store/noteStore.js +2 -2
  86. package/lib/{core → tasks/core}/store/preflightStore.js +59 -22
  87. package/lib/{core → tasks/core}/store/projectFile.js +1 -1
  88. package/lib/{core → tasks/core}/store/workspace.js +28 -6
  89. package/lib/{core → tasks/core}/userConfig.js +1 -1
  90. package/lib/{core → tasks/core}/workTargets.js +1 -1
  91. package/lib/tasks/features/metrics/cli/metricsCommands.js +77 -0
  92. package/lib/tasks/features/metrics/core/definitions.js +445 -0
  93. package/lib/tasks/features/metrics/core/index.js +112 -0
  94. package/lib/tasks/features/metrics/core/manual.js +179 -0
  95. package/lib/tasks/features/metrics/server/metricsRoutes.js +8 -0
  96. package/lib/tasks/features/metrics/shared/metrics.js +42 -0
  97. package/lib/{core/milestoneReview → tasks/features/milestoneReview/core}/code.js +2 -11
  98. package/lib/{core/milestoneReview → tasks/features/milestoneReview/core}/material.js +5 -6
  99. package/lib/{core/milestoneReview → tasks/features/milestoneReview/core}/review.js +2 -2
  100. package/lib/{core/milestoneReview → tasks/features/milestoneReview/core}/service.js +38 -100
  101. package/lib/{core/milestoneReview → tasks/features/milestoneReview/core}/store.js +3 -3
  102. package/lib/{server/api → tasks/features/milestoneReview/server}/milestoneReviewRoutes.js +7 -13
  103. package/lib/{cli → tasks/features/quality/cli}/qualityCommands.js +36 -11
  104. package/lib/{core → tasks/features/quality/core}/qualityImprovement.js +16 -15
  105. package/lib/tasks/features/records/cli/revisitCommands.js +73 -0
  106. package/lib/tasks/features/records/core/completionRefs.js +46 -0
  107. package/lib/tasks/features/records/core/reviewCandidates.js +76 -0
  108. package/lib/tasks/features/records/shared/completionRecord.js +329 -0
  109. package/lib/tasks/features/records/shared/reviewCandidate.js +313 -0
  110. package/lib/tasks/features/records/shared/reworkHistory.js +86 -0
  111. package/lib/{cli → tasks/features/releaseNotes/cli}/releaseNotesCommands.js +7 -7
  112. package/lib/{core/releaseNotes → tasks/features/releaseNotes/core}/completeRequests.js +5 -6
  113. package/lib/{core/releaseNotes → tasks/features/releaseNotes/core}/generate.js +3 -14
  114. package/lib/{core/releaseNotes → tasks/features/releaseNotes/core}/material.js +3 -4
  115. package/lib/{core/releaseNotes → tasks/features/releaseNotes/core}/service.js +1 -1
  116. package/lib/{core/releaseNotes → tasks/features/releaseNotes/core}/store.js +2 -2
  117. package/lib/{server/api → tasks/features/releaseNotes/server}/releaseNoteRoutes.js +11 -20
  118. package/lib/tasks/features/requirements/cli/requirementCommands.js +289 -0
  119. package/lib/{shared → tasks/features/requirements/shared}/acceptance.js +292 -18
  120. package/lib/tasks/features/requirements/shared/requirementSource.js +635 -0
  121. package/lib/tasks/features/retro/cli/retroCommands.js +106 -0
  122. package/lib/tasks/features/retro/core/retrospective.js +197 -0
  123. package/lib/tasks/features/retro/shared/retrospective.js +286 -0
  124. package/lib/tasks/features/settings/cli/projectSettings.js +245 -0
  125. package/lib/{cli → tasks/features/settings/cli}/userConfig.js +50 -3
  126. package/lib/{core → tasks/features/settings/core}/machineSettingsEdit.js +2 -2
  127. package/lib/{core → tasks/features/settings/core}/repoAdmin.js +3 -3
  128. package/lib/{core → tasks/features/settings/core}/userTheme.js +2 -2
  129. package/lib/{server/api → tasks/features/settings/server}/repoRoutes.js +2 -2
  130. package/lib/{server/api → tasks/features/settings/server}/userThemeRoutes.js +3 -3
  131. package/lib/{cli → tasks/features/taskReview/cli}/taskReviewCommands.js +5 -5
  132. package/lib/{core/taskReview → tasks/features/taskReview/core}/material.js +13 -7
  133. package/lib/{core/taskReview → tasks/features/taskReview/core}/review.js +10 -3
  134. package/lib/{core/taskReview → tasks/features/taskReview/core}/service.js +24 -85
  135. package/lib/{core/taskReview → tasks/features/taskReview/core}/store.js +4 -4
  136. package/lib/{server/api → tasks/features/taskReview/server}/taskReviewRoutes.js +7 -14
  137. package/lib/{server → tasks/server}/api/manifest.js +51 -3
  138. package/lib/{server → tasks/server}/api/routes.js +134 -65
  139. package/lib/tasks/shared/commitRefs.js +10 -0
  140. package/lib/{shared → tasks/shared}/preflightInput.js +1 -1
  141. package/package.json +1 -43
  142. package/skills/p3/SKILL.md +9 -181
  143. package/dist/web/assets/ImprovementDialog-kQaVBGWH.js +0 -1
  144. package/dist/web/assets/Outputs-_nU_p3nu.js +0 -1
  145. package/dist/web/assets/RequestStatus-RG-OVQYY.js +0 -1
  146. package/dist/web/assets/Tabs-ew9i5SKX.js +0 -1
  147. package/dist/web/assets/TagInput-BtlJTF7i.js +0 -1
  148. package/dist/web/assets/TaskDrawer-DW8GyJqI.js +0 -6
  149. package/dist/web/assets/_requestId-6Nb727dD.js +0 -1
  150. package/dist/web/assets/_requestId-BykTgPax.js +0 -1
  151. package/dist/web/assets/appCtx-CxDdXABS.js +0 -1
  152. package/dist/web/assets/archive-Ckh295Xe.js +0 -1
  153. package/dist/web/assets/board-BVAIjK-Y.js +0 -1
  154. package/dist/web/assets/done-BGfA-3MA.js +0 -1
  155. package/dist/web/assets/draft-CfJeyLOl.js +0 -1
  156. package/dist/web/assets/index-CgRU744I.css +0 -2
  157. package/dist/web/assets/index-DacQ0yl4.js +0 -12
  158. package/dist/web/assets/new-DVygWvVc.js +0 -1
  159. package/dist/web/assets/outputs-B6xDsLZf.js +0 -1
  160. package/dist/web/assets/preflightInput-BAeEJYUK.js +0 -2
  161. package/dist/web/assets/preload-helper-DyCqp21K.js +0 -1
  162. package/dist/web/assets/release-notes-CCpzyiNf.js +0 -5
  163. package/dist/web/assets/requestData-D5vBnuMh.js +0 -1
  164. package/dist/web/assets/routes-Q91zvNc0.js +0 -4
  165. package/dist/web/assets/settings-BzRgcmUm.js +0 -1
  166. package/dist/web/assets/workTarget-C9c57JAO.js +0 -30
  167. package/lib/cli/readOnly.js +0 -38
  168. package/lib/cli/showView.js +0 -166
  169. /package/lib/{core/store → kit}/frontmatter.js +0 -0
  170. /package/lib/{core/store → kit}/fsutil.js +0 -0
  171. /package/lib/{cli → tasks/cli}/format.js +0 -0
  172. /package/lib/{core → tasks/core}/chatgpt.js +0 -0
  173. /package/lib/{core → tasks/core}/machineSettings.js +0 -0
  174. /package/lib/{core → tasks/core}/preflight/codexImage.js +0 -0
  175. /package/lib/{core → tasks/core}/preflight/docker.js +0 -0
  176. /package/lib/{core → tasks/core}/preflight/launch.js +0 -0
  177. /package/lib/{core → tasks/core}/preflight/launcher.mjs +0 -0
  178. /package/lib/{core → tasks/core}/preflight/mock-ui.html +0 -0
  179. /package/lib/{core → tasks/core}/preflight/mock-ui.png +0 -0
  180. /package/lib/{core → tasks/core}/preflight/owner.js +0 -0
  181. /package/lib/{core → tasks/core}/preflight/render-image/Dockerfile +0 -0
  182. /package/lib/{core → tasks/core}/preflight/render-image/fonts-ja.conf +0 -0
  183. /package/lib/{core → tasks/core}/preflight/render-image/render.mjs +0 -0
  184. /package/lib/{core → tasks/core}/preflight/split.js +0 -0
  185. /package/lib/{core → tasks/core}/preflight/uiMaterials.js +0 -0
  186. /package/lib/{core → tasks/core}/preflight/wireframe.js +0 -0
  187. /package/lib/{core → tasks/core}/preflight/xlsx.js +0 -0
  188. /package/lib/{core → tasks/core}/redact.js +0 -0
  189. /package/lib/{core → tasks/core}/repoRefs.js +0 -0
  190. /package/lib/{core → tasks/core}/requestStatus.js +0 -0
  191. /package/lib/{core → tasks/core}/store/archivedTasks.js +0 -0
  192. /package/lib/{core → tasks/core}/store/dataWatcher.js +0 -0
  193. /package/lib/{core → tasks/core}/store/locate.js +0 -0
  194. /package/lib/{core → tasks/core}/supersede.js +0 -0
  195. /package/lib/{core/milestoneReview → tasks/features/milestoneReview/core}/mockReviewer.js +0 -0
  196. /package/lib/{shared → tasks/features/milestoneReview/shared}/milestoneReview.js +0 -0
  197. /package/lib/{core → tasks/features/quality/core}/quality.js +0 -0
  198. /package/lib/{shared → tasks/features/quality/shared}/quality.js +0 -0
  199. /package/lib/{shared → tasks/features/quality/shared}/qualityImprovement.js +0 -0
  200. /package/lib/{shared → tasks/features/quality/shared}/qualityTemplates.js +0 -0
  201. /package/lib/{core/releaseNotes → tasks/features/releaseNotes/core}/mockSummarizer.js +0 -0
  202. /package/lib/{core/taskReview → tasks/features/taskReview/core}/mockReviewer.js +0 -0
  203. /package/lib/{core/taskReview → tasks/features/taskReview/core}/paths.js +0 -0
  204. /package/lib/{shared → tasks/features/taskReview/shared}/taskReview.js +0 -0
  205. /package/lib/{server → tasks/server}/api/chatgptRoutes.js +0 -0
  206. /package/lib/{server → tasks/server}/api/local.js +0 -0
  207. /package/lib/{shared → tasks/shared}/dates.js +0 -0
  208. /package/lib/{shared → tasks/shared}/directTask.js +0 -0
  209. /package/lib/{shared → tasks/shared}/hierarchy.js +0 -0
  210. /package/lib/{shared → tasks/shared}/milestoneGoals.js +0 -0
  211. /package/lib/{shared → tasks/shared}/milestoneOrder.js +0 -0
  212. /package/lib/{shared → tasks/shared}/preflightRunner.js +0 -0
  213. /package/lib/{shared → tasks/shared}/refs.js +0 -0
  214. /package/lib/{shared → tasks/shared}/repos.js +0 -0
  215. /package/lib/{shared → tasks/shared}/scopeView.js +0 -0
  216. /package/lib/{shared → tasks/shared}/tags.js +0 -0
  217. /package/lib/{shared → tasks/shared}/taskBlock.js +0 -0
  218. /package/lib/{shared → tasks/shared}/types.js +0 -0
  219. /package/lib/{shared → tasks/shared}/workTarget.js +0 -0
@@ -1,166 +0,0 @@
1
- import { absRef, parseRef } from "../shared/refs.js";
2
- import { acceptanceStatus } from "../shared/acceptance.js";
3
- import { blockWarnings } from "../shared/taskBlock.js";
4
- import { supersededWarnings } from "../core/supersede.js";
5
- import { table } from "./format.js";
6
- import { taskWork } from "../core/workTargets.js";
7
- import { requestWorkstreams } from "../shared/workTarget.js";
8
- export function dependencyStates(ctx, task) {
9
- return task.relations
10
- .filter((r) => r.type === "depends_on")
11
- .map((r) => {
12
- const ref = absRef(r.target, task.request) ?? r.target;
13
- const p = parseRef(ref);
14
- const target = p?.task ? ctx.ws.task(ref) : ctx.ws.requests.get(ref);
15
- return { ref, title: target?.title ?? null, status: target?.status ?? null };
16
- });
17
- }
18
- /** タスクの詳細で共通に出す項目(通常・短い出力の両方) */
19
- export function taskExtras(ctx, task, marks) {
20
- const superseded = marks.get(task.ref) ?? [];
21
- const warnings = supersededWarnings(superseded, task.ref);
22
- return { superseded, dependencies: dependencyStates(ctx, task), warnings };
23
- }
24
- const BRIEF_TASK_KEYS = ["id", "ref", "request", "title", "status", "body", "rev", "outputs", "relations"];
25
- const STATE_MARK = { met: "✓ 満たした", unmet: "✗ 満たせなかった", unverified: "? 未検証", missing: "・ 証拠なし", stale: "! 再確認が必要(基準を変えた後)" };
26
- /** 停止の行(show・brief・アーカイブで共通。履歴は通常の show だけ)。停止も履歴も問題も無ければ空 */
27
- export function formatBlock(task, { history = false } = {}) {
28
- const lines = [];
29
- const b = task.block;
30
- if (b) {
31
- lines.push(`⏸ 止まっています(${b.since} から${b.updatedBy ? `・${b.updatedBy}` : ""})`, ...b.reason.split("\n").map((l) => ` ${l}`));
32
- if (b.decision)
33
- lines.push(" 決めてほしいこと:", ...b.decision.split("\n").map((l) => ` ${l}`));
34
- }
35
- for (const w of blockWarnings(task))
36
- lines.push(`※ ${w}`);
37
- if (history && task.blockHistory?.length) {
38
- lines.push("停止の履歴:");
39
- const label = { set: "付けた", update: "直した", clear: "解除した" };
40
- for (const h of task.blockHistory) {
41
- lines.push(` ${h.at} ${label[h.action]}${h.by ? ` ${h.by}` : ""}`);
42
- const shown = h.after ?? h.before;
43
- if (shown)
44
- lines.push(` 理由: ${shown.reason.split("\n")[0]}`);
45
- if (h.resolution)
46
- lines.push(` 回答・解決: ${h.resolution.split("\n").join(" / ")}`);
47
- }
48
- }
49
- return lines;
50
- }
51
- /**
52
- * 受け入れ基準と証拠・不足の行(show・criteria で共通)。基準が無いタスクは「受け入れ基準なし」の1行(emptyLine: false なら出さない)。
53
- * 証拠は作業した側の申告で、人が「済み」にする前に読むもの
54
- */
55
- export function formatAcceptance(task, { emptyLine = true } = {}) {
56
- const acc = acceptanceStatus(task);
57
- if (!acc)
58
- return emptyLine ? ["受け入れ基準なし"] : [];
59
- const lines = [`受け入れ基準(${acc.met}/${acc.total} を満たした・作業した側の申告):`];
60
- for (const i of acc.items) {
61
- lines.push(` ${i.id} ${i.text}`, ` ${STATE_MARK[i.state]}`);
62
- if (i.evidence?.evidence)
63
- lines.push(...i.evidence.evidence.split("\n").map((l) => ` ${l}`));
64
- if (i.state === "stale" && i.evidence)
65
- lines.push(` (記録したときの基準: ${i.evidence.criterionText})`);
66
- }
67
- for (const e of acc.orphans)
68
- lines.push(` ${e.criterionId} (基準は消されています: ${e.criterionText})`, ` ${STATE_MARK[e.result]}`, ...(e.evidence ? e.evidence.split("\n").map((l) => ` ${l}`) : []));
69
- if (acc.shortfalls.length)
70
- lines.push("不足:", ...acc.shortfalls.map((s) => ` - ${s}`));
71
- return lines;
72
- }
73
- export function briefTask(ctx, task, marks) {
74
- const item = Object.fromEntries(BRIEF_TASK_KEYS.map((k) => [k, task[k]]));
75
- item.relations = task.relations.filter((r) => r.type === "depends_on");
76
- if (task.repoOutputs?.length)
77
- item.repoOutputs = task.repoOutputs;
78
- // 変更の記録(完了したタスク)。経緯を知るために読む
79
- if (task.record)
80
- item.record = task.record;
81
- // 受け入れ基準と証拠(着手時に読み、完了時に項目ごとの証拠を残す)
82
- if (task.acceptanceCriteria?.length)
83
- item.acceptanceCriteria = task.acceptanceCriteria;
84
- if (task.acceptanceEvidence?.length)
85
- item.acceptanceEvidence = task.acceptanceEvidence;
86
- if (task.acceptanceProblems?.length)
87
- item.acceptanceProblems = task.acceptanceProblems;
88
- // 停止の今の値と読み取りの問題(履歴は省く)
89
- if (task.block)
90
- item.block = task.block;
91
- if (task.blockProblems?.length)
92
- item.blockProblems = task.blockProblems;
93
- // 着手先: 作業先のリポジトリとそのブランチ(作業先なしは repo: null)
94
- // 基準・証拠の状態(基準なしのタスクでは省く)
95
- const acceptance = acceptanceStatus(task);
96
- return { item, work: taskWork(ctx.ws, task), ...taskExtras(ctx, task, marks), ...(acceptance ? { acceptance } : {}) };
97
- }
98
- export function formatBriefTask(view) {
99
- const { item, work, dependencies, warnings } = view;
100
- const short = (ref) => (ref.startsWith(`${item.request}/`) ? ref.slice(item.request.length + 1) : ref);
101
- const lines = [`${item.ref} ${item.title}`, ` status ${item.status} rev ${item.rev}`];
102
- lines.push(...formatBlock(item));
103
- lines.push(` 作業先 ${work.repo ? `${work.repo}${work.branch ? ` branch ${work.branch}` : "(ブランチなし)"}${work.registered ? "" : ` ※このマシンのパスが未登録(p3 repo path ${work.repo} <パス>)`}` : "なし"}`);
104
- if (dependencies.length) {
105
- lines.push(` 依存 ${dependencies.map((d) => `${short(d.ref)} ${d.status ?? "(状態不明)"}`).join(" / ")}`);
106
- }
107
- for (const o of item.outputs)
108
- lines.push(` 成果物 ${o}`);
109
- for (const o of item.repoOutputs ?? [])
110
- lines.push(` 成果物 ${o.repo}: ${o.output}`);
111
- for (const w of warnings)
112
- lines.push(`※ ${w.message}`);
113
- if (item.body.trim())
114
- lines.push("", item.body.trim());
115
- if (item.record)
116
- lines.push("", "## 変更の記録", item.record);
117
- lines.push("", ...formatAcceptance(item));
118
- return lines.join("\n");
119
- }
120
- export function briefRequest(ctx, r, issue) {
121
- const item = {
122
- id: r.id,
123
- title: r.title,
124
- status: r.status,
125
- ...(r.parent ? { parent: r.parent } : {}),
126
- body: r.body,
127
- rev: r.rev,
128
- ...(r.workstreams ? { workstreams: r.workstreams } : {}),
129
- };
130
- const branches = requestWorkstreams(r);
131
- const tasks = ctx.ws
132
- .tasksOf(r.id)
133
- .list()
134
- .map((t) => ({ id: t.id, ref: t.ref, title: t.title, status: t.status, repo: t.repo, ...(t.block ? { blocked: true } : {}) }));
135
- return { item, branches, tasks, ...(issue ? { issue } : {}) };
136
- }
137
- /** 親子の行(祖先と直下の子。無ければ何も出さない) */
138
- export function formatFamily(f) {
139
- return [
140
- ...(f.ancestors.length ? [` 親 ${f.ancestors.map((a) => `${a.id} ${a.title}`).join(" > ")}`] : []),
141
- ...(f.children.length
142
- ? ["", `子の要望 (${f.children.length}、表示順。実行の順ではない):`, table(f.children.map((c) => [` ${c.id}`, c.status, `${c.tasks.done}/${c.tasks.total}`, c.title]))]
143
- : []),
144
- ];
145
- }
146
- export function formatBriefRequest(view) {
147
- const { item, branches, tasks, issue } = view;
148
- const family = view.ancestors && view.children && view.hierarchyIssues ? view : undefined;
149
- const names = Object.keys(branches);
150
- // ブランチは作業先ごと
151
- const branchLine = "";
152
- return [
153
- issue ? `※ ${issue}` : "",
154
- ...(family?.hierarchyIssues.map((i) => `※ ${i.message}`) ?? []),
155
- `${item.id} ${item.title}`,
156
- ` status ${item.status} rev ${item.rev}${branchLine}`,
157
- ...(branchLine ? [] : names.map((n) => ` branch ${n}: ${branches[n].branch}`)),
158
- ...(family ? formatFamily(family) : []),
159
- item.body.trim() ? `\n${item.body.trim()}` : "",
160
- "",
161
- `タスク (${tasks.length}):`,
162
- table(tasks.map((t) => [` ${t.id}`, t.status, t.repo ?? "(作業先なし)", `${t.title}${t.blocked ? " ⏸停止" : ""}`])) || " (なし)",
163
- ]
164
- .filter((l, i) => l !== "" || i > 1)
165
- .join("\n");
166
- }
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes