@infodb/p3 0.1.0 → 0.3.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 (72) hide show
  1. package/README.md +6 -1
  2. package/dist/web/assets/{Outputs-Ni3pNuGU.js → Outputs-DqJdybkd.js} +1 -1
  3. package/dist/web/assets/{RequestStatus-K8TZwpur.js → RequestStatus-DN-2iAM0.js} +1 -1
  4. package/dist/web/assets/TagInput-D-1ILLDX.js +1 -0
  5. package/dist/web/assets/TaskDrawer-CHD7T-Su.js +3 -0
  6. package/dist/web/assets/_requestId-BzSepQIV.js +30 -0
  7. package/dist/web/assets/_requestId-pIds2tFU.js +1 -0
  8. package/dist/web/assets/board-BIkOpuC4.js +1 -0
  9. package/dist/web/assets/directTask-Dk3H5Q2B.js +1 -0
  10. package/dist/web/assets/done-BUAUhIRr.js +1 -0
  11. package/dist/web/assets/draft-CfJeyLOl.js +1 -0
  12. package/dist/web/assets/index-Byv9j77D.js +12 -0
  13. package/dist/web/assets/index-DTfUhuQw.css +2 -0
  14. package/dist/web/assets/new-6kly4-PX.js +1 -0
  15. package/dist/web/assets/preload-helper-DlN0ouRj.js +1 -0
  16. package/dist/web/assets/release-notes-iwQWmfX6.js +3 -0
  17. package/dist/web/assets/requestData-DJ1Rlx-u.js +1 -0
  18. package/dist/web/assets/routes-Ciot9p4x.js +2 -0
  19. package/dist/web/assets/settings-DBCi6lAY.js +1 -0
  20. package/dist/web/assets/ui-Sz7y5_TS.js +1 -0
  21. package/dist/web/assets/workTarget-Cijqq4yH.js +1 -0
  22. package/dist/web/index.html +4 -5
  23. package/docs/architecture.md +70 -14
  24. package/docs/development.md +83 -7
  25. package/docs/how-to-use.md +105 -12
  26. package/docs/installation.md +157 -11
  27. package/docs/publishing.md +27 -3
  28. package/package.json +8 -5
  29. package/skills/p3/SKILL.md +2 -0
  30. package/src/cli/args.ts +9 -2
  31. package/src/cli/help.ts +10 -4
  32. package/src/cli/main.ts +73 -4
  33. package/src/cli/output.ts +18 -0
  34. package/src/cli/preflightCommands.ts +10 -2
  35. package/src/cli/project.ts +269 -98
  36. package/src/cli/releaseNotesCommands.ts +21 -1
  37. package/src/core/context.ts +3 -2
  38. package/src/core/preflight/codexEngine.ts +2 -1
  39. package/src/core/preflight/render-image/Dockerfile +3 -0
  40. package/src/core/preflight/render-image/fonts-ja.conf +28 -0
  41. package/src/core/preflight/render-image/render.mjs +10 -1
  42. package/src/core/preflight/render.ts +5 -2
  43. package/src/core/preflight/service.ts +19 -2
  44. package/src/core/projectRegistry.ts +264 -0
  45. package/src/core/releaseNotes/generate.ts +12 -0
  46. package/src/core/store/locate.ts +6 -6
  47. package/src/core/userConfig.ts +25 -0
  48. package/src/server/api/chatgptRoutes.ts +6 -5
  49. package/src/server/api/manifest.ts +9 -0
  50. package/src/server/api/projectsRoutes.ts +89 -0
  51. package/src/server/api/routes.ts +33 -25
  52. package/src/server/server.ts +74 -15
  53. package/src/shared/directTask.ts +20 -0
  54. package/src/shared/types.ts +1 -1
  55. package/dist/web/assets/TagInput-BICKVH2x.js +0 -1
  56. package/dist/web/assets/TaskDrawer-BkDIstIN.js +0 -3
  57. package/dist/web/assets/_requestId-B5O_ytaq.js +0 -1
  58. package/dist/web/assets/_requestId-C66puEMO.js +0 -30
  59. package/dist/web/assets/board-CbfDjkls.js +0 -1
  60. package/dist/web/assets/done-CPQbCFHg.js +0 -1
  61. package/dist/web/assets/draft-dT3gLDIt.js +0 -1
  62. package/dist/web/assets/index-BUcs2J6N.js +0 -12
  63. package/dist/web/assets/index-C3DkqwJ9.css +0 -2
  64. package/dist/web/assets/link-_s8ndNKS.js +0 -1
  65. package/dist/web/assets/new-T60RB7de.js +0 -1
  66. package/dist/web/assets/preload-helper-dXqN7N-I.js +0 -1
  67. package/dist/web/assets/release-notes-DxrPhDbt.js +0 -3
  68. package/dist/web/assets/requestData-D8ZiSZss.js +0 -1
  69. package/dist/web/assets/routes-D9ZxXoLk.js +0 -2
  70. package/dist/web/assets/settings-DsHVyqzJ.js +0 -1
  71. package/dist/web/assets/supersede-CLXlhCq0.js +0 -1
  72. package/dist/web/assets/ui-Cvke4y4X.js +0 -1
@@ -1,10 +1,11 @@
1
1
  import { execFileSync } from "node:child_process";
2
2
  import { existsSync, readFileSync } from "node:fs";
3
- import { appendFile, copyFile, mkdir } from "node:fs/promises";
3
+ import { appendFile, copyFile, mkdir, readFile, stat, writeFile } from "node:fs/promises";
4
4
  import { homedir, userInfo } from "node:os";
5
5
  import { basename, dirname, join, relative, resolve } from "node:path";
6
6
  import { createInterface } from "node:readline/promises";
7
7
  import { fileURLToPath } from "node:url";
8
+ import YAML from "yaml";
8
9
  import { REQUEST_ID } from "../shared/refs.ts";
9
10
  import type { ProjectConfig } from "../shared/types.ts";
10
11
  import type { P3Context } from "../core/context.ts";
@@ -12,9 +13,10 @@ import { resolveRequestId } from "../core/ops.ts";
12
13
  import { writeProjectFile, writeRepoEntry } from "../core/store/projectFile.ts";
13
14
  import { repoNameProblem } from "../shared/repos.ts";
14
15
  import { addRepo, checkFolder, RepoAdminError, removeRepo, setLocalRepoPath, updateRepo, type RepoPatch } from "../core/repoAdmin.ts";
15
- import { Workspace as WorkspaceStore } from "../core/store/workspace.ts";
16
+ import { normalizeProject } from "../core/store/normalize.ts";
16
17
  import { requestWorkstreams } from "../shared/workTarget.ts";
17
18
  import type { Workspace } from "../core/store/workspace.ts";
19
+ import { DATA_DIR_NAME } from "../core/store/locate.ts";
18
20
  import { loadUserConfig, PROJECT_NAME, setProjectNode, updateUserConfig, userConfigPath } from "../core/userConfig.ts";
19
21
 
20
22
  /** プロジェクトの初期設定・設定変更、変更者と「今の要望」の判定(CLI) */
@@ -108,18 +110,34 @@ const DOC_ENTRIES = ["README.md", "index.md"];
108
110
 
109
111
  const AGENTS_MARK = "タスク管理(infodb p3)";
110
112
 
113
+ /** AI 向けの使い方を置く先(リポジトリのルートからの相対パス。どれも同じ原本 skills/p3/SKILL.md を写す) */
114
+ export const AGENT_TARGETS = {
115
+ claude: { path: ".claude/skills/p3/SKILL.md", agent: "Claude Code" },
116
+ codex: { path: ".agents/skills/p3/SKILL.md", agent: "Codex" },
117
+ } as const;
118
+ export type AgentKind = keyof typeof AGENT_TARGETS;
119
+ /** --agents / p3 agents の選び方(値なしの --agents は both) */
120
+ export const AGENT_CHOICES = { claude: ["claude"], codex: ["codex"], both: ["claude", "codex"] } as const satisfies Record<string, readonly AgentKind[]>;
121
+ export type AgentChoice = keyof typeof AGENT_CHOICES;
122
+ export const isAgentChoice = (v: unknown): v is AgentChoice => typeof v === "string" && Object.hasOwn(AGENT_CHOICES, v);
123
+ const KINDS = Object.keys(AGENT_TARGETS) as AgentKind[];
124
+
111
125
  /**
112
- * p3 init --agents で AGENTS.md / CLAUDE.md に追記する指示。手順の詳しい版は同梱のスキル(skills/p3/SKILL.md)で、
113
- * 役割と終わり方はそちらとそろえる(test/agents.test.ts が確かめる)
126
+ * AGENTS.md / CLAUDE.md に書く指示(節)。スキルの参照は、置いた先(と既にある先)だけを書く。手順の詳しい版は同梱のスキル
127
+ * (skills/p3/SKILL.md)で、役割と終わり方はそちらとそろえる(test/agents.test.ts が確かめる)
114
128
  */
115
- export const AGENTS_SNIPPET = `
129
+ export function agentsSnippet(kinds: readonly AgentKind[]): string {
130
+ const list = KINDS.filter((k) => kinds.includes(k));
131
+ const skills = list.map((k) => `\`${AGENT_TARGETS[k].path}\`(${AGENT_TARGETS[k].agent})`).join("・") + (list.length > 1 ? "。中身は同じ" : "");
132
+ return `
116
133
  ## ${AGENTS_MARK}
117
134
 
118
135
  - 作業の単位は要望。タスクは \`p3\` CLI(入っていなければ \`pnpx @infodb/p3\`)で操作し、\`--json\` で結果を読むこと(データのフォルダを直接編集しない)。
119
- 詳しい手順はスキル \`.claude/skills/p3/SKILL.md\`(Claude Code)・\`.agents/skills/p3/SKILL.md\`(Codex)。中身は同じ
136
+ 詳しい手順はスキル ${skills}
120
137
  - 変更するときは環境変数 \`P3_ACTOR=ai:<エージェント名>\` を付ける
121
138
  - 操作する要望は \`--req <要望ID>\` で指定する(要望の作業ツリーの中なら省ける)。まず \`p3 whoami --json\` で確かめる
122
139
  - \`whoami\` の \`via\`(プロジェクトの決まり方)が \`cwd\` でなければ(\`dir\` / \`project\` / \`legacy\` / \`only\`)、それ以上 p3 を操作せず、対象のプロジェクトでよいか人に確かめる(推測した \`--project\` / \`--dir\` で避けない。人が指定・確認した後はその対象のまま続ける)
140
+ - プロジェクトが無い・未登録のときは \`p3 init\` / \`p3 join\` を自分から実行せず、新しく作る(\`init\`)のか共有されたものに参加する(\`join\`)のかを人に確かめる
123
141
  - 新しい作業を頼まれたら \`p3 request new "<タイトル>" --body "..."\` で要望を登録し、ID を伝えて終える。
124
142
  Preflight(\`preflight\`)とタスク化(\`accept\`)は人が行う(AI は実行しない。結果を \`p3 drafts\` で読むのと、頼まれたメモの保存 \`--note-only\` はよい)
125
143
  - 着手する前に \`p3 show T003 --brief --json\` で本文・依存とその状態(\`dependencies\`)・置き換えの注意(\`warnings\`)を読む
@@ -129,44 +147,101 @@ export const AGENTS_SNIPPET = `
129
147
  - 置き換えられたタスク(\`p3 ls\` の \`※置換\`、\`--json\` の \`superseded\`)からは始めない。\`move\` が \`warnings\` を返したら止めて人に確かめる
130
148
  - 作業中に新しく必要になった作業は \`p3 new "<タイトル>" --body "..."\` でタスクにする(人への質問はタスクにしない)
131
149
  `;
150
+ }
151
+
152
+ /** 両方に置いたときの節(docs/architecture.md に載せる例。test/agents.test.ts が同じことを確かめる) */
153
+ export const AGENTS_SNIPPET = agentsSnippet(KINDS);
132
154
 
133
155
  /**
134
- * 同梱のスキルの原本と、プロジェクトに置く場所(リポジトリのルートからの相対パス。同じ原本を写す)。
135
- * 置くのはプロジェクトの中だけ(個人のスキルの場所に置くと、p3 を使わないプロジェクトでも読まれる)
156
+ * 同梱のスキルの原本。置くのはプロジェクトの中だけ(個人のスキルの場所に置くと、p3 を使わないプロジェクトでも読まれる)
136
157
  */
137
158
  export const SKILL_SOURCE = fileURLToPath(new URL("../../skills/p3/SKILL.md", import.meta.url));
138
- export const SKILL_TARGETS = [
139
- { path: ".claude/skills/p3/SKILL.md", agent: "Claude Code" },
140
- { path: ".agents/skills/p3/SKILL.md", agent: "Codex" },
141
- ] as const;
159
+
160
+ /** 2つの文の最初に違う行(1 から) */
161
+ function firstDiffLine(a: string, b: string): number {
162
+ const x = a.split("\n");
163
+ const y = b.split("\n");
164
+ let i = 0;
165
+ while (i < x.length && i < y.length && x[i] === y[i]) i++;
166
+ return i + 1;
167
+ }
168
+
169
+ /** 指示の節(見出し「タスク管理(infodb p3)」からその見出しと同じか上の段の次の見出しの前まで。コードの囲みの中は見出しに数えない) */
170
+ function findSections(text: string): { start: number; end: number; level: number }[] {
171
+ const lines = text.split("\n");
172
+ const heads: { line: number; level: number; mark: boolean }[] = [];
173
+ let fence = false;
174
+ lines.forEach((l, i) => {
175
+ if (/^\s*(```|~~~)/.test(l)) fence = !fence;
176
+ const m = fence ? null : /^(#{1,6})\s+(.*?)\s*#*\s*$/.exec(l);
177
+ if (m) heads.push({ line: i, level: m[1].length, mark: m[2] === AGENTS_MARK });
178
+ });
179
+ return heads
180
+ .filter((h) => h.mark)
181
+ .map((h) => ({ start: h.line, level: h.level, end: heads.find((n) => n.line > h.line && n.level <= h.level)?.line ?? lines.length }));
182
+ }
142
183
 
143
184
  /**
144
- * --agents: AGENTS.md(無ければ CLAUDE.md、どちらも無ければ AGENTS.md を作る)に指示を追記し、スキルを置く。
145
- * 指示は見出しがあれば足さない。スキルは置く場所ごとに、無ければ置き、同じ内容なら何もせず、違えば上書きしない
146
- * (手で直したものを消さない。片方が違っても、もう片方は置く)。
185
+ * AI 向けの使い方を置く(init --agents と p3 agents)。kinds の先だけを扱い、ほかの先は作らず・変えず・消さない。
186
+ * - スキル: 無ければ置く・同じなら何もしない・違えば上書きせず違う行と最新にする方法を出す(force なら同梱の版にする)
187
+ * - 指示: AGENTS.md(無ければ CLAUDE.md、どちらも無ければ AGENTS.md を作る)の節。スキルの参照は kinds と既にある先。
188
+ * 節が無ければ足す・同じなら何もしない・違えば変えずに知らせる(force なら節だけを置き換え、前後の文は残す)。
189
+ * 節が複数・見出しの形が分からないときは force でも変えず、手で整理するよう知らせる
147
190
  */
148
- async function placeAgents(root: string, cwd: string): Promise<string[]> {
191
+ export async function placeAgents(root: string, cwd: string, choice: AgentChoice, force = false): Promise<string[]> {
192
+ const kinds: readonly AgentKind[] = AGENT_CHOICES[choice];
149
193
  const lines: string[] = [];
150
- const agentsFile = ["AGENTS.md", "CLAUDE.md"].find((f) => existsSync(join(root, f)));
151
- const target = join(root, agentsFile ?? "AGENTS.md");
152
- if (existsSync(target) && readFileSync(target, "utf8").includes(AGENTS_MARK)) {
153
- lines.push(` AI 向けの使い方は ${relative(cwd, target) || target} に書いてあります(追記しません)`);
154
- } else {
155
- await appendFile(target, AGENTS_SNIPPET);
156
- lines.push(` AI 向けの使い方を ${relative(cwd, target) || target} に追記しました`);
157
- }
194
+ const update = `p3 agents ${choice} --force`;
158
195
  const source = readFileSync(SKILL_SOURCE, "utf8");
159
- for (const t of SKILL_TARGETS) {
196
+ for (const k of kinds) {
197
+ const t = AGENT_TARGETS[k];
160
198
  const skill = join(root, t.path);
161
- const shown = relative(cwd, skill);
199
+ const shown = relative(cwd, skill) || skill;
162
200
  if (!existsSync(skill)) {
163
201
  await mkdir(dirname(skill), { recursive: true });
164
202
  await copyFile(SKILL_SOURCE, skill);
165
- lines.push(` AI 向けのスキル(${t.agent})を ${shown} に置きました`);
166
- } else if (readFileSync(skill, "utf8") === source) {
167
- lines.push(` AI 向けのスキル(${t.agent})${shown} は最新です`);
203
+ lines.push(` 作成 AI 向けのスキル(${t.agent})を ${shown} に置きました`);
204
+ continue;
205
+ }
206
+ const now = readFileSync(skill, "utf8");
207
+ if (now === source) lines.push(` 同一 AI 向けのスキル(${t.agent})${shown} は最新です`);
208
+ else if (force) {
209
+ await copyFile(SKILL_SOURCE, skill);
210
+ lines.push(` 更新 AI 向けのスキル(${t.agent})${shown} を同梱の版にしました`);
211
+ } else {
212
+ lines.push(` 保護 ※ ${shown}(${t.agent})は既にあり、同梱の版と違うので上書きしません(${firstDiffLine(now, source)} 行目から違います)。最新にするなら ${update}(原本: ${SKILL_SOURCE})`);
213
+ }
214
+ }
215
+
216
+ // 指示の節のスキルの参照: 置いた先と、既にある先(後から片方を足したとき、もう片方も指す。無い先は書かない)
217
+ const refs = KINDS.filter((k) => kinds.includes(k) || existsSync(join(root, AGENT_TARGETS[k].path)));
218
+ const snippet = agentsSnippet(refs);
219
+ const file = ["AGENTS.md", "CLAUDE.md"].find((f) => existsSync(join(root, f))) ?? "AGENTS.md";
220
+ const target = join(root, file);
221
+ const shown = relative(cwd, target) || target;
222
+ const text = existsSync(target) ? readFileSync(target, "utf8") : "";
223
+ const sections = findSections(text);
224
+ if (!sections.length && !text.includes(AGENTS_MARK)) {
225
+ await appendFile(target, text ? snippet : snippet.replace(/^\n/, ""));
226
+ lines.push(` 作成 AI 向けの使い方を ${shown} に${text ? "追記しました" : "書きました"}`);
227
+ } else if (sections.length !== 1) {
228
+ lines.push(
229
+ ` 保護 ※ ${shown} の「${AGENTS_MARK}」の節が${sections.length ? `${sections.length} つあります` : "見出しとして見つかりません"}。どこまでが p3 の節か決められないので変えません。手で1つの節(見出し「## ${AGENTS_MARK}」)に整理してから、もう一度実行してください`,
230
+ );
231
+ } else {
232
+ const all = text.split("\n");
233
+ const { start, end, level } = sections[0];
234
+ // 見出しの段は今のもの(### などで書かれていればそのまま)
235
+ const body = snippet.replace(/^\n/, "").replace(/^## /, `${"#".repeat(level)} `);
236
+ const current = all.slice(start, end).join("\n");
237
+ if (current.trim() === body.trim()) lines.push(` 同一 AI 向けの使い方(${shown} の節)は最新です`);
238
+ else if (force) {
239
+ const before = all.slice(0, start).join("\n");
240
+ const after = all.slice(end).join("\n");
241
+ await writeFile(target, `${before}${before ? "\n" : ""}${body.trimEnd()}\n${after ? `\n${after.replace(/^\n+/, "")}` : ""}`);
242
+ lines.push(` 更新 AI 向けの使い方(${shown} の「${AGENTS_MARK}」の節)を置き換えました(前後の文はそのまま)`);
168
243
  } else {
169
- lines.push(` ※ ${shown}(${t.agent})は既にあり、同梱の版と違うので上書きしません。手で見比べて更新してください: ${SKILL_SOURCE}`);
244
+ lines.push(` 保護 ※ ${shown} の「${AGENTS_MARK}」の節は同梱の版と違うので変えません。最新にするなら ${update}(節だけを置き換えます)`);
170
245
  }
171
246
  }
172
247
  return lines;
@@ -176,86 +251,78 @@ export interface InitOptions {
176
251
  cwd: string;
177
252
  /** 個人設定に登録する名前(既定: リポジトリのフォルダ名) */
178
253
  project?: string;
179
- /** データを置くフォルダ(必須。端末では聞く) */
254
+ /** データを置くフォルダ(既定はリポジトリのルートの .p3。端末では聞く)。相対パスは実行した場所から */
180
255
  dir?: string;
181
256
  name?: string;
182
257
  description?: string;
183
258
  instructions?: string;
184
- agents?: boolean;
259
+ /** AI 向けの使い方を置く先(未指定なら、対話では聞き(Enter は置かない)、非対話では置かない) */
260
+ agents?: AgentChoice;
185
261
  yes?: boolean;
186
262
  /** このリポジトリの参照先の名前(既定はフォルダ名) */
187
263
  repoName?: string;
264
+ /** 対話の問い(既定は端末の readline。テストが答えを渡す)。渡すと対話として聞く */
265
+ prompt?: (question: string) => Promise<string>;
188
266
  }
189
267
 
268
+ /** 対話の問い(--yes・非対話なら既定値のまま)。使い終えたら close */
269
+ function prompter(o: { yes?: boolean; prompt?: (q: string) => Promise<string> }) {
270
+ const interactive = !o.yes && (!!o.prompt || (process.stdin.isTTY && process.stdout.isTTY));
271
+ const rl = interactive && !o.prompt ? createInterface({ input: process.stdin, output: process.stdout }) : undefined;
272
+ const question = o.prompt ?? (rl ? (q: string) => rl.question(q) : undefined);
273
+ const ask = async (q: string, def: string) => {
274
+ if (!question) return def;
275
+ const a = (await question(`${q}${def ? ` [${def}]` : ""}: `)).trim();
276
+ return a || def;
277
+ };
278
+ return { interactive: !!question, ask, close: () => rl?.close() };
279
+ }
280
+
281
+ /** プロジェクト名とデータのフォルダ(init・join で同じ決め方。未指定はルートの .p3、指定は相対なら実行した場所から・~・絶対) */
282
+ async function projectAndDir(o: { cwd: string; project?: string; dir?: string }, root: string, ask: (q: string, def: string) => Promise<string>, dirQuestion: string) {
283
+ const key = await ask("プロジェクト名(切り替えに使う短い名前)", o.project ?? slugifyName(basename(root)) ?? "project");
284
+ if (!PROJECT_NAME.test(key)) throw new UsageError(`プロジェクト名は英数字と . _ - で: ${key}`);
285
+ // 明示した空のパスは未指定と分けて断る
286
+ if (o.dir !== undefined && !o.dir.trim()) throw new UsageError("--dir が空です。既定(リポジトリのルートの .p3)にするなら --dir を付けずに実行してください");
287
+ const dir = resolvePath(o.cwd, o.dir ?? (await ask(dirQuestion, join(root, DATA_DIR_NAME))));
288
+ return { key, dir };
289
+ }
290
+
291
+ /** --dir の案内(既定の場所なら付けない) */
292
+ const dirHint = (dir: string, root: string) => (dir === join(root, DATA_DIR_NAME) ? "" : ` --dir ${dir}`);
293
+
190
294
  /**
191
- * p3 init。管理したいリポジトリの中で実行する。
192
- * - データを置くフォルダ(場所は自由。リポジトリの外を勧める)に project.yaml と requests/ を作る
193
- * - 既に作られたフォルダ(他の人が作って共有したもの)を指したら、作らずに参加だけする
194
- * - どちらの場合も個人設定に「プロジェクト名 → フォルダ・手元のリポジトリ」を登録する。以後はリポジトリの中なら指定が要らない
295
+ * p3 init。管理したいリポジトリの中で実行し、新しくプロジェクトを作る(作るだけ。既にあるプロジェクトへの参加は p3 join)。
296
+ * - データを置くフォルダに project.yaml と requests/ を作る。既定はリポジトリのルート(git のメインの作業ツリー。
297
+ * git 管理外なら実行した場所)の .p3。サブフォルダや追加の作業ツリーから実行してもルートの .p3 にする。
298
+ * 公開できないデータや、リポジトリと別に管理したいときは --dir でリポジトリの外を指せる
299
+ * - そのフォルダに既に project.yaml があれば、何も書かずに断って p3 join を案内する(--agents を付けても置かない)
300
+ * - 個人設定に「プロジェクト名 → フォルダ・手元のリポジトリ」を登録する。以後はリポジトリの中なら指定が要らない
195
301
  * 端末から実行すると対話式で聞き、--yes か非対話(AI・スクリプト)なら引数と推測した既定値で作る。
196
302
  */
197
303
  export async function init(o: InitOptions): Promise<string> {
198
304
  const root = repoRoot(o.cwd);
199
305
  const user = await loadUserConfig();
200
-
201
- const interactive = !o.yes && process.stdin.isTTY && process.stdout.isTTY;
202
- const rl = interactive ? createInterface({ input: process.stdin, output: process.stdout }) : undefined;
203
- const ask = async (q: string, def: string) => {
204
- if (!rl) return def;
205
- const a = (await rl.question(`${q}${def ? ` [${def}]` : ""}: `)).trim();
206
- return a || def;
207
- };
306
+ const { interactive, ask, close } = prompter(o);
208
307
 
209
308
  try {
210
- if (rl) console.log(`p3 のプロジェクトを作ります(リポジトリ: ${root})\n(Enter で [ ] 内の既定値)\n`);
211
- const key = await ask("プロジェクト名(切り替えに使う短い名前)", o.project ?? slugifyName(basename(root)) ?? "project");
212
- if (!PROJECT_NAME.test(key)) throw new UsageError(`プロジェクト名は英数字と . _ - で: ${key}`);
213
- const dirRaw = o.dir ?? (await ask("データを置くフォルダ(リポジトリの外を勧めます)", ""));
214
- if (!dirRaw) throw new UsageError("データを置くフォルダを指定してください。例: p3 init --project myapp --dir ~/p3-data/myapp");
215
- const dir = resolvePath(o.cwd, dirRaw);
216
-
309
+ if (interactive) console.log(`p3 のプロジェクトを作ります(リポジトリ: ${root})\n(Enter で [ ] 内の既定値)\n`);
310
+ const { key, dir } = await projectAndDir(o, root, ask, "データを置くフォルダ(相対パスは今いる場所から。リポジトリの外も指定できます)");
311
+
312
+ // 既にあるプロジェクト: 作らず、何も書かない(参加は join、AI 向けの使い方は agents)
313
+ if (existsSync(join(dir, "project.yaml"))) {
314
+ throw new UsageError(
315
+ [
316
+ `${dir} には既にプロジェクトがあります(init は新しく作るだけです。何も変えていません)`,
317
+ ` 参加するなら: p3 join --project ${key}${dirHint(dir, root)}`,
318
+ ...(o.agents ? [" AI 向けの使い方を置く・最新にするなら: p3 agents claude|codex|both"] : []),
319
+ ].join("\n"),
320
+ );
321
+ }
217
322
  const registered = user.projects[key];
218
323
  if (registered && registered.dir !== dir) throw new UsageError(`プロジェクト名「${key}」は別のフォルダで登録済みです: ${registered.dir}`);
219
- // このリポジトリを参照先として登録する名前(新しく作るときは本体として共有の定義も書く。参加するときは同じ名前の参照先か、
220
- // 参照先が1つならそれ。決まらなければ登録せず p3 repo path を案内する)
221
- const joining = existsSync(join(dir, "project.yaml"));
222
- const shared = joining ? (await (async () => { const ws = new WorkspaceStore(dir); await ws.load(); return ws.project.repos; })()) : [];
223
- const derived = o.repoName ?? slugifyName(basename(root)) ?? "app";
224
- const refName = joining ? (shared.find((r) => r.name === derived) ?? (shared.length === 1 ? shared[0] : undefined))?.name : derived;
225
- if (!joining && repoNameProblem(refName!)) throw new UsageError(`参照先の名前: ${repoNameProblem(refName!)}(--repo-name で指定してください)`);
226
- // 最新の個人設定の上で、このプロジェクトの登録だけを書く(聞いている間にほかで変わっていても消さない)
227
- const register = () =>
228
- updateUserConfig((doc, now) => {
229
- const prev = now.projects[key];
230
- if (prev && prev.dir !== dir) throw new UsageError(`プロジェクト名「${key}」は別のフォルダで登録済みです: ${prev.dir}`);
231
- setProjectNode(doc, key, { dir, repos: refName ? { ...prev?.repos, [refName]: root } : (prev?.repos ?? {}) });
232
- });
233
-
234
- const agentsFile = ["AGENTS.md", "CLAUDE.md"].find((f) => existsSync(join(root, f)));
235
- const askAgents = async () =>
236
- o.agents ??
237
- (rl ? /^y/i.test(await ask(`${agentsFile ?? "AGENTS.md"} と .claude/skills/・.agents/skills/ に AI 向けの p3 の使い方を置きますか (y/n)`, agentsFile ? "y" : "n")) : false);
238
-
239
- // 既に作られたフォルダなら参加だけ
240
- if (joining) {
241
- // 登録済みのリポジトリでも --agents なら、登録とデータはそのままで AI 向けの使い方だけを置く(あとから置き場所が増えたとき)
242
- const already = !!registered && (!refName || registered.repos[refName] === root);
243
- if (already && !o.agents) throw new UsageError(`${key}(${dir})は登録済みです(設定の変更は p3 config。AI 向けの使い方を置くなら --agents)`);
244
- if (already) return [`登録済みです: ${key} → ${dir}`, ...(await placeAgents(root, o.cwd))].join("\n");
245
- const addAgents = await askAgents();
246
- await register();
247
- return [
248
- `参加しました: ${key} → ${dir}`,
249
- refName
250
- ? ` 参照先 ${refName} ${root}`
251
- : ` このリポジトリを参照先として登録していません。p3 repo ls で名前を確かめ、p3 repo path <名前> ${root} で登録してください`,
252
- ...(addAgents ? await placeAgents(root, o.cwd) : []),
253
- "",
254
- "次に: p3 request ls / p3 serve",
255
- ]
256
- .filter((l, i) => l || i > 1)
257
- .join("\n");
258
- }
324
+ const refName = o.repoName ?? slugifyName(basename(root)) ?? "app";
325
+ if (repoNameProblem(refName)) throw new UsageError(`参照先の名前: ${repoNameProblem(refName)}(--repo-name で指定してください)`);
259
326
 
260
327
  // 既定値: git とリポジトリの中身から推測する
261
328
  const docsFound = DOC_CANDIDATES.filter((d) => existsSync(join(root, d)));
@@ -269,23 +336,31 @@ export async function init(o: InitOptions): Promise<string> {
269
336
  return { path: d, role: "ドキュメント", ...(entry ? { entry } : {}) };
270
337
  });
271
338
  const instructions = await ask("Preflight で重視する観点・制約(任意)", o.instructions ?? "");
272
- const addAgents = await askAgents();
339
+ // 既にある AGENTS.md / CLAUDE.md からは推測しない(Enter は置かない)
340
+ let agents = o.agents;
341
+ if (agents === undefined && interactive) {
342
+ const a = await ask("AI 向けの p3 の使い方(スキルと AGENTS.md / CLAUDE.md の節)を置く先(置かない / claude / codex / both)", "置かない");
343
+ if (!["置かない", "none", "n", "no"].includes(a)) {
344
+ if (!isAgentChoice(a)) throw new UsageError(`置く先は 置かない / claude / codex / both のどれか: ${a}`);
345
+ agents = a;
346
+ }
347
+ }
273
348
 
274
349
  const cfg: ProjectConfig = {
275
350
  name,
276
351
  description,
277
352
  // このリポジトリを本体の参照先にする(このマシンのパスは個人設定に持ち、共有するデータには書かない)
278
- repos: [{ name: refName!, role: "本体", readFirst: true, writable: true, map }],
353
+ repos: [{ name: refName, role: "本体", readFirst: true, writable: true, map }],
279
354
  milestones: [],
280
355
  branchPattern: "req/{id}-{slug}",
281
356
  preflight: { instructions },
282
357
  };
283
358
  await mkdir(join(dir, "requests"), { recursive: true });
284
359
  await writeProjectFile(join(dir, "project.yaml"), cfg);
285
- await writeRepoEntry(join(dir, "project.yaml"), refName!, cfg.repos[0]);
286
- await register();
360
+ await writeRepoEntry(join(dir, "project.yaml"), refName, cfg.repos[0]);
361
+ await register(key, dir, refName, root);
287
362
 
288
- const agentLines = addAgents ? await placeAgents(root, o.cwd) : [];
363
+ const agentLines = agents ? await placeAgents(root, o.cwd, agents) : [];
289
364
  return [
290
365
  `作りました: ${key} → ${dir}`,
291
366
  ` 参照先 ${refName}(本体) → ${root}`,
@@ -300,7 +375,103 @@ export async function init(o: InitOptions): Promise<string> {
300
375
  .join("\n")
301
376
  .trimEnd();
302
377
  } finally {
303
- rl?.close();
378
+ close();
379
+ }
380
+ }
381
+
382
+ /** 最新の個人設定の上で、このプロジェクトの登録だけを書く(聞いている間にほかで変わっていても、ほかの登録・項目は消さない) */
383
+ function register(key: string, dir: string, refName: string | undefined, root: string) {
384
+ return updateUserConfig((doc, now) => {
385
+ const prev = now.projects[key];
386
+ if (prev && prev.dir !== dir) throw new UsageError(`プロジェクト名「${key}」は別のフォルダで登録済みです: ${prev.dir}`);
387
+ setProjectNode(doc, key, { dir, repos: refName ? { ...prev?.repos, [refName]: root } : (prev?.repos ?? {}) });
388
+ });
389
+ }
390
+
391
+ /** 参加する前に、データのフォルダが読める p3 のプロジェクトかを確かめ、共有の定義(読むだけ)を返す */
392
+ async function readSharedProject(dir: string): Promise<ProjectConfig> {
393
+ const create = "新しく作るなら p3 init";
394
+ const st = await stat(dir).catch((e: NodeJS.ErrnoException) => e);
395
+ if (st instanceof Error) {
396
+ throw new UsageError(
397
+ st.code === "ENOENT"
398
+ ? `データのフォルダがありません: ${dir}(パスと、共有のフォルダがつながっているかを確かめてください。${create})`
399
+ : `データのフォルダを読めません: ${dir}(${st.code ?? st.message})`,
400
+ );
401
+ }
402
+ if (!st.isDirectory()) throw new UsageError(`データのフォルダがフォルダではありません: ${dir}`);
403
+ const file = join(dir, "project.yaml");
404
+ let text: string;
405
+ try {
406
+ text = await readFile(file, "utf8");
407
+ } catch (e) {
408
+ const code = (e as NodeJS.ErrnoException).code;
409
+ throw new UsageError(
410
+ code === "ENOENT"
411
+ ? `${dir} は p3 のプロジェクトではありません(project.yaml がありません)。指したフォルダと中身を確かめてください(参加では作りません。${create})`
412
+ : `project.yaml を読めません: ${file}(${code ?? (e as Error).message})`,
413
+ );
414
+ }
415
+ let data: unknown;
416
+ try {
417
+ data = YAML.parse(text);
418
+ } catch (e) {
419
+ throw new UsageError(`project.yaml を読めません(YAML として壊れています): ${file}: ${(e as Error).message.split("\n")[0]}`);
420
+ }
421
+ if (!data || typeof data !== "object" || Array.isArray(data)) throw new UsageError(`project.yaml の中身が p3 の設定ではありません: ${file}`);
422
+ return normalizeProject(data as Record<string, unknown>);
423
+ }
424
+
425
+ export interface JoinOptions {
426
+ cwd: string;
427
+ project?: string;
428
+ dir?: string;
429
+ repoName?: string;
430
+ yes?: boolean;
431
+ prompt?: (question: string) => Promise<string>;
432
+ }
433
+
434
+ /**
435
+ * p3 join。既にあるプロジェクト(ほかの人が作って共有したデータのフォルダ)に参加する。個人設定に
436
+ * 「プロジェクト名 → フォルダ・このリポジトリのこのマシンのパス」を登録するだけで、共有の定義・データ・
437
+ * AI 向けのファイル(スキル・AGENTS.md / CLAUDE.md)は書かない。データのフォルダの既定と指定の仕方は init と同じ。
438
+ * - このリポジトリを登録する参照先: --repo-name(共有の定義にある名前)→ フォルダ名と同じ名前 → 参照先が1つならそれ。
439
+ * 決まらなければ登録せず p3 repo path を案内する
440
+ * - 同じ名前で別のフォルダは断る。同じ名前・同じフォルダ・同じパスなら何もしない(成功)
441
+ */
442
+ export async function joinProject(o: JoinOptions): Promise<string> {
443
+ const root = repoRoot(o.cwd);
444
+ const { interactive, ask, close } = prompter(o);
445
+ try {
446
+ if (interactive) console.log(`p3 のプロジェクトに参加します(リポジトリ: ${root})\n(Enter で [ ] 内の既定値)\n`);
447
+ const { key, dir } = await projectAndDir(o, root, ask, "参加するデータのフォルダ(相対パスは今いる場所から)");
448
+ const shared = (await readSharedProject(dir)).repos;
449
+ let refName: string | undefined;
450
+ if (o.repoName !== undefined) {
451
+ if (!shared.some((r) => r.name === o.repoName)) {
452
+ throw new UsageError(`参照先「${o.repoName}」は共有の定義にありません(あるもの: ${shared.map((r) => r.name).join(", ") || "なし"})`);
453
+ }
454
+ refName = o.repoName;
455
+ } else {
456
+ const derived = slugifyName(basename(root));
457
+ refName = (shared.find((r) => r.name === derived) ?? (shared.length === 1 ? shared[0] : undefined))?.name;
458
+ }
459
+ const user = await loadUserConfig();
460
+ const prev = user.projects[key];
461
+ if (prev && prev.dir !== dir) throw new UsageError(`プロジェクト名「${key}」は別のフォルダで登録済みです: ${prev.dir}`);
462
+ if (prev && (!refName || prev.repos[refName] === root)) return `登録済みです: ${key} → ${dir}(変えていません)`;
463
+ await register(key, dir, refName, root);
464
+ return [
465
+ `参加しました: ${key} → ${dir}`,
466
+ refName
467
+ ? ` 参照先 ${refName} ${root}`
468
+ : ` このリポジトリを参照先として登録していません。p3 repo ls で名前を確かめ、p3 repo path <名前> ${root} で登録してください`,
469
+ ` 個人設定 ${userConfigPath()} に登録しました(データ・リポジトリのファイルは変えていません)`,
470
+ "",
471
+ "次に: p3 request ls / p3 serve",
472
+ ].join("\n");
473
+ } finally {
474
+ close();
304
475
  }
305
476
  }
306
477
 
@@ -320,7 +491,7 @@ export async function projectCommand(
320
491
  data: rows,
321
492
  text: rows.length
322
493
  ? rows.map((r) => `${r.current ? "*" : " "} ${r.name.padEnd(w)} ${r.dir}${Object.keys(r.repos).length ? ` (参照先 ${Object.keys(r.repos).join(", ")})` : ""}`).join("\n")
323
- : "登録済みのプロジェクトはありません。管理したいリポジトリの中で p3 init --project <名前> --dir <フォルダ>",
494
+ : "登録済みのプロジェクトはありません。管理したいリポジトリの中で p3 init --project <名前>(新しく作る)か p3 join --project <名前>(参加する)",
324
495
  };
325
496
  }
326
497
  if (sub === "add") {
@@ -5,6 +5,8 @@ import { exportReleaseNote, releaseNoteDetail, releaseOverview, saveReleaseNote,
5
5
  import { readBody, type CommandEnv } from "./args.ts";
6
6
  import { table } from "./format.ts";
7
7
  import { UsageError } from "./project.ts";
8
+ import { shellArg } from "./output.ts";
9
+ import { GenerationRejected } from "../core/releaseNotes/generate.ts";
8
10
 
9
11
  /**
10
12
  * p3 release-notes ... マイルストーンごとのリリースノート(規則と保存は core/releaseNotes)
@@ -56,7 +58,12 @@ export async function releaseNotesCommand(env: CommandEnv): Promise<number> {
56
58
 
57
59
  case "generate": {
58
60
  if (o.engine !== undefined && o.engine !== "codex" && o.engine !== "mock") throw new UsageError("--engine は codex か mock");
59
- const g = await startGeneration(ctx, need(), actor, o.engine);
61
+ const id = need();
62
+ const g = await startGeneration(ctx, id, actor, o.engine).catch((e: Error) => {
63
+ // 始められなければ手で書く道を添える(実行中は別の理由なので添えない。終了コードは変えない)
64
+ if (e instanceof GenerationRejected && e.code !== "running") e.message += `\n${manualSaveHint(id)}`;
65
+ throw e;
66
+ });
60
67
  const gen = ctx.releaseGenerator;
61
68
  // 進み具合は stderr(stdout は本文の案か JSON だけにする)
62
69
  let shown = 0;
@@ -71,6 +78,8 @@ export async function releaseNotesCommand(env: CommandEnv): Promise<number> {
71
78
  if (done.status !== "completed") {
72
79
  if (out.json) out.result(done, () => "");
73
80
  else process.stderr.write(`${failureLine(done)}\n`);
81
+ // 失敗したら手で書く道を stderr に出す(--json の stdout は変えない。取消は失敗と扱わない)
82
+ if (done.status === "failed") process.stderr.write(`${manualSaveHint(done.milestone)}\n`);
74
83
  return 1;
75
84
  }
76
85
  if (!out.json) {
@@ -123,6 +132,17 @@ function flushLog(g: ReleaseGeneration, from: number): number {
123
132
  return g.log.length;
124
133
  }
125
134
 
135
+ /** 要約を生成できないときの、本文を手で書いて保存する道(Codex・Docker・ChatGPT は要らない) */
136
+ function manualSaveHint(mid: string): string {
137
+ const m = shellArg(mid);
138
+ return [
139
+ "生成せずに、本文を手で書いて保存できます(Docker や ChatGPT の接続は要りません):",
140
+ ` p3 release-notes show ${m} # 材料(収録する要望と変更の記録)を確かめる`,
141
+ ` p3 release-notes save ${m} --file <本文.md> # 新しく保存する`,
142
+ ` 既にノートがあるときは、show で読んだ版を付けて更新します: p3 release-notes save ${m} --file <本文.md> --version <版>`,
143
+ ].join("\n");
144
+ }
145
+
126
146
  function failureLine(g: ReleaseGeneration): string {
127
147
  if (g.status === "cancelled") return "取り消しました(保存したノートは変えていません)";
128
148
  return `生成できませんでした(${g.failure}): ${g.error}(保存したノートは変えていません)`;
@@ -33,7 +33,7 @@ export interface P3Context {
33
33
  */
34
34
  export async function openProject(
35
35
  dataDir: string,
36
- opts: { repos?: Record<string, string>; settings?: MachineSettings | SettingsSource; projectName?: string } = {},
36
+ opts: { repos?: Record<string, string>; settings?: MachineSettings | SettingsSource; projectName?: string; chatgpt?: ChatGptAccount } = {},
37
37
  ): Promise<P3Context> {
38
38
  // データのフォルダと project.yaml が無ければ、空のプロジェクトとして開かずに止める(何も作らない)
39
39
  await checkDataDir(dataDir, opts.projectName);
@@ -44,7 +44,8 @@ export async function openProject(
44
44
  await ws.load();
45
45
  // 既定は Codex(ChatGPT プランか旧来の auth.json。どちらも無ければ使えない理由と次にすることを出す)。
46
46
  // Mock は preflight.engine: mock(P3_PREFLIGHT_ENGINE=mock)か --engine mock で明示したときだけ(認証の失敗を Mock の成功に見せない)
47
- const chatgpt = chatgptAccount();
47
+ // プロジェクトを跨ぐ serve では、サインインの待ち受けを全プロジェクトで1つにするため外から渡す
48
+ const chatgpt = opts.chatgpt ?? chatgptAccount();
48
49
  const codex = new CodexWorkspaceEngine({ load: async () => codexConfig(await source.get()), account: chatgpt });
49
50
  const engines: Partial<Record<PreflightEngine["name"], PreflightEngine>> = { codex, mock: new MockEngine() };
50
51
  const preflight = new PreflightService(ws, engines, {
@@ -629,7 +629,8 @@ function uiSection(paths: ContainerPaths) {
629
629
  日本語のラベル・項目・配置・主な操作(ボタン・リンク)・前提(仮のデータなど)が読めるように書いてください。
630
630
  見た目の作り込みより、何がどこにあるかが分かることを優先します。複数のタスク案を1画面にまとめてもよいが、drafts で対応を示してください。
631
631
  - 自己完結した HTML と <style> の CSS だけで書いてください。スクリプト・onclick などの属性・外のファイルや URL の参照(画像・CSS・フォント・
632
- @import・相対パス)は使えません(P3 が断ります)。画像が要るなら data: の PNG / JPEG / SVG にしてください。フォントは指定しなくても日本語が出ます。
632
+ @import・相対パス)は使えません(P3 が断ります)。画像が要るなら data: の PNG / JPEG / SVG にしてください。フォントは指定しなくても日本語のゴシック体(sans-serif)で描きます。
633
+ 明朝体・等幅が要るところだけ serif(明朝体にするなら "Noto Serif JP" などの名前)・monospace を指定してください。
633
634
  - PNG は Codex の終了後に P3 が原稿から描いて ui/index.json に書き足します。あなたは PNG を作らず、画像を見たとも書かないでください。
634
635
  - 再評価で前回の画面イメージがあれば(引き継ぎに書いてあります)、それは前回の提案で、今の画面の証拠ではありません。
635
636
  変えた案に合わせて、今回の run の ui/ に原稿を書き直してください(前回のファイルは書き換えない)。
@@ -3,6 +3,8 @@
3
3
  # Codex のコンテナとは別のイメージ。P3(ホストのプロセス)が docker run で動かし、
4
4
  # ネットワークなし・認証情報なし・リポジトリなしで、確かめた原稿(読むだけ)と出力のフォルダだけをマウントする。
5
5
  # Playwright と Chromium(headless shell)の版は固定し、日本語のフォント(Noto CJK, SIL Open Font License 1.1)を入れる。
6
+ # 日本語の既定と、イメージに無い日本語のフォント名は fonts-ja.conf で Noto CJK JP にする(Playwright の依存で入る
7
+ # 中国語の字形のフォントが先に選ばれないように)。
6
8
  FROM node:22-bookworm-slim
7
9
 
8
10
  ENV PLAYWRIGHT_BROWSERS_PATH=/ms-playwright \
@@ -16,6 +18,7 @@ RUN npm install --no-save --no-audit --no-fund --no-package-lock playwright@1.63
16
18
  && rm -rf /var/lib/apt/lists/* /root/.npm /tmp/* \
17
19
  && useradd --create-home --uid 10001 render
18
20
 
21
+ COPY fonts-ja.conf /etc/fonts/conf.d/99-p3-ja.conf
19
22
  COPY render.mjs /render/render.mjs
20
23
 
21
24
  USER render
@@ -0,0 +1,28 @@
1
+ <?xml version="1.0"?>
2
+ <!DOCTYPE fontconfig SYSTEM "fonts.dtd">
3
+ <!--
4
+ 画面イメージの描画で、日本語を Noto CJK JP で描く(Dockerfile が /etc/fonts/conf.d/ に置く)。
5
+ Playwright の依存で入る WenQuanYi Zen Hei(中国語の字形)が総称の既定に先に来るので、総称と、イメージに無い日本語の
6
+ フォント名を Noto CJK JP に寄せる。原稿が明示したほかのフォント(Noto Sans CJK SC など)と埋め込みのフォントには触れない。
7
+ -->
8
+ <fontconfig>
9
+ <!-- 総称 -->
10
+ <alias binding="strong"><family>sans-serif</family><prefer><family>Noto Sans CJK JP</family></prefer></alias>
11
+ <alias binding="strong"><family>system-ui</family><prefer><family>Noto Sans CJK JP</family></prefer></alias>
12
+ <alias binding="strong"><family>serif</family><prefer><family>Noto Serif CJK JP</family></prefer></alias>
13
+ <alias binding="strong"><family>monospace</family><prefer><family>Noto Sans Mono CJK JP</family></prefer></alias>
14
+
15
+ <!-- イメージに無い日本語のゴシック体 -->
16
+ <alias binding="strong"><family>Noto Sans JP</family><prefer><family>Noto Sans CJK JP</family></prefer></alias>
17
+ <alias binding="strong"><family>Hiragino Sans</family><prefer><family>Noto Sans CJK JP</family></prefer></alias>
18
+ <alias binding="strong"><family>Hiragino Kaku Gothic ProN</family><prefer><family>Noto Sans CJK JP</family></prefer></alias>
19
+ <alias binding="strong"><family>ヒラギノ角ゴ ProN</family><prefer><family>Noto Sans CJK JP</family></prefer></alias>
20
+ <alias binding="strong"><family>Yu Gothic</family><prefer><family>Noto Sans CJK JP</family></prefer></alias>
21
+ <alias binding="strong"><family>游ゴシック</family><prefer><family>Noto Sans CJK JP</family></prefer></alias>
22
+
23
+ <!-- イメージに無い日本語の明朝体 -->
24
+ <alias binding="strong"><family>Noto Serif JP</family><prefer><family>Noto Serif CJK JP</family></prefer></alias>
25
+ <alias binding="strong"><family>Hiragino Mincho ProN</family><prefer><family>Noto Serif CJK JP</family></prefer></alias>
26
+ <alias binding="strong"><family>Yu Mincho</family><prefer><family>Noto Serif CJK JP</family></prefer></alias>
27
+ <alias binding="strong"><family>游明朝</family><prefer><family>Noto Serif CJK JP</family></prefer></alias>
28
+ </fontconfig>