wachiman 1.15.0 → 1.17.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 (87) hide show
  1. package/README.md +13 -0
  2. package/package.json +1 -1
  3. package/skills/wachiman-loop/SKILL.md +43 -0
  4. package/src/accounts/commands.ts +3 -2
  5. package/src/accounts/confirm.ts +1 -1
  6. package/src/accounts/profile-list.ts +24 -0
  7. package/src/cli.ts +91 -26
  8. package/src/config.ts +40 -8
  9. package/src/connectors/local-git.ts +128 -0
  10. package/src/connectors/working-tree.ts +23 -1
  11. package/src/doctor/checks.ts +106 -1
  12. package/src/doctor/run.ts +9 -1
  13. package/src/engine.ts +1126 -222
  14. package/src/formats.ts +44 -3
  15. package/src/help.ts +204 -7
  16. package/src/history/command.ts +5 -5
  17. package/src/history/match.ts +24 -4
  18. package/src/history/store.ts +1 -1
  19. package/src/history/types.ts +7 -2
  20. package/src/init/agents.ts +135 -0
  21. package/src/init/args.ts +7 -2
  22. package/src/init/github-login.ts +13 -0
  23. package/src/init/json.ts +82 -0
  24. package/src/init/options.ts +42 -4
  25. package/src/init/prompt.ts +46 -15
  26. package/src/init/render.ts +3 -1
  27. package/src/init/run.ts +362 -28
  28. package/src/init/settings.ts +137 -0
  29. package/src/init/write.ts +16 -102
  30. package/src/json-schema.ts +8 -0
  31. package/src/ledger.ts +2 -2
  32. package/src/local-ask.ts +5 -4
  33. package/src/local.ts +90 -17
  34. package/src/loop/command.ts +29 -7
  35. package/src/memory/candidates.ts +425 -0
  36. package/src/memory/capture.ts +298 -0
  37. package/src/memory/command.ts +195 -0
  38. package/src/memory/entries.ts +213 -0
  39. package/src/memory/hygiene.ts +291 -0
  40. package/src/memory/inspect.ts +74 -0
  41. package/src/memory/load.ts +283 -0
  42. package/src/memory/mute.ts +259 -0
  43. package/src/memory/personal.ts +253 -0
  44. package/src/memory/proposal.ts +92 -0
  45. package/src/memory/propose.ts +414 -0
  46. package/src/memory/remember.ts +187 -0
  47. package/src/memory/report.ts +250 -0
  48. package/src/memory/settings.ts +20 -0
  49. package/src/pr-template/adopt.ts +434 -0
  50. package/src/pr-template/catalog.ts +429 -0
  51. package/src/pr-template/check-run.ts +328 -0
  52. package/src/pr-template/check.ts +338 -0
  53. package/src/pr-template/describe.ts +368 -0
  54. package/src/pr-template/format.ts +399 -0
  55. package/src/pr-template/gh.ts +159 -0
  56. package/src/pr-template/install.ts +311 -0
  57. package/src/pr-template/legacy-guides.ts +50 -0
  58. package/src/pr-template/pr-risk.ts +426 -0
  59. package/src/pr-template/render.ts +302 -0
  60. package/src/pr-template/resolve.ts +65 -0
  61. package/src/pr-template/run.ts +88 -0
  62. package/src/pr-template/strip.ts +171 -0
  63. package/src/pr-template/write.ts +139 -0
  64. package/src/precision.ts +10 -2
  65. package/src/priority.ts +106 -0
  66. package/src/providers/claude-code.ts +7 -8
  67. package/src/providers/codex.ts +4 -4
  68. package/src/providers/spawn.ts +95 -0
  69. package/src/providers/types.ts +5 -2
  70. package/src/repo-settings.ts +322 -0
  71. package/src/risk.ts +38 -9
  72. package/src/setup/prompt.ts +49 -33
  73. package/src/setup/run.ts +31 -6
  74. package/src/sinks/common.ts +22 -9
  75. package/src/sinks/markdown.ts +6 -2
  76. package/src/sinks/terminal.ts +6 -2
  77. package/src/store/figures.ts +5 -4
  78. package/src/store/html.ts +1 -1
  79. package/src/upgrade/command.ts +286 -0
  80. package/src/upgrade/pin.ts +112 -0
  81. package/src/verify.ts +20 -2
  82. package/src/wizard/mascot.ts +56 -51
  83. package/src/wizard/prompt-fancy.ts +10 -2
  84. package/src/wizard/prompt.ts +17 -4
  85. package/src/wizard/ui.ts +2 -0
  86. package/templates/pr/sections.json +163 -0
  87. package/templates/wachiman-review-caller.yml +7 -7
package/src/init/args.ts CHANGED
@@ -3,25 +3,30 @@ import { parseFlags } from "../flags";
3
3
  import type { RawInitFlags } from "./options";
4
4
 
5
5
  export const initUsage =
6
- "wachiman init [--mode github|local|both] [--operator <login>] [--version <tag>] [--path <file>] [--force] [--dry-run] [--yes] [--repo-dir <dir>]";
6
+ "wachiman init [--mode github|local|both] [--project-kind monorepo|single] [--operator <login>] [--version <tag>] [--path <file>] [--force] [--dry-run] [--pr-template | --no-pr-template] [--no-agent-pointer] [--yes] [--json] [--repo-dir <dir>]";
7
7
 
8
8
  /** The arguments after `init` (`--repo-dir` is already taken out and arrives as `repoDir`). Pure; an unknown flag is a usage error. */
9
9
  export function parseInitFlags(argv: string[], repoDir: string): RawInitFlags {
10
10
  if (argv.includes("--help") || argv.includes("-h")) return { help: true, repoDir };
11
11
  const { positionals, values, booleans } = parseFlags(
12
12
  argv,
13
- { values: ["--mode", "--operator", "--version", "--path"], booleans: ["--force", "--dry-run", "--yes"] },
13
+ { values: ["--mode", "--project-kind", "--operator", "--version", "--path"], booleans: ["--force", "--dry-run", "--yes", "--json", "--pr-template", "--no-pr-template", "--no-agent-pointer"] },
14
14
  "init",
15
15
  );
16
16
  if (positionals.length > 0) throw new UsageError(`init takes no argument "${positionals[0]}".`);
17
+ if (booleans["--pr-template"] && booleans["--no-pr-template"]) throw new UsageError("--pr-template and --no-pr-template contradict each other; give one.");
17
18
  return {
18
19
  ...(values["--mode"] !== undefined ? { mode: values["--mode"] } : {}),
20
+ ...(values["--project-kind"] !== undefined ? { projectKind: values["--project-kind"] } : {}),
19
21
  ...(values["--operator"] !== undefined ? { operator: values["--operator"] } : {}),
20
22
  ...(values["--version"] !== undefined ? { version: values["--version"] } : {}),
21
23
  ...(values["--path"] !== undefined ? { path: values["--path"] } : {}),
22
24
  ...(booleans["--force"] ? { force: true } : {}),
23
25
  ...(booleans["--dry-run"] ? { dryRun: true } : {}),
24
26
  ...(booleans["--yes"] ? { yes: true } : {}),
27
+ ...(booleans["--json"] ? { json: true } : {}),
28
+ ...(booleans["--pr-template"] ? { prTemplate: true } : booleans["--no-pr-template"] ? { prTemplate: false } : {}),
29
+ ...(booleans["--no-agent-pointer"] ? { agentPointer: false } : {}),
25
30
  repoDir,
26
31
  };
27
32
  }
@@ -0,0 +1,13 @@
1
+ import { spawnSync } from "node:child_process";
2
+
3
+ /** The login of the account `gh` is signed in as, or undefined when `gh` is missing, signed out or fails. Only ever a suggestion. */
4
+ export function ghLogin(): string | undefined {
5
+ try {
6
+ const run = spawnSync("gh", ["api", "user", "--jq", ".login"], { encoding: "utf8", timeout: 10_000, stdio: ["ignore", "pipe", "ignore"] });
7
+ if (run.error || run.status !== 0) return undefined;
8
+ const login = run.stdout.trim();
9
+ return login === "" ? undefined : login;
10
+ } catch {
11
+ return undefined;
12
+ }
13
+ }
@@ -0,0 +1,82 @@
1
+ /**
2
+ * The `wachiman.init/1` document that `wachiman init --json` prints on stdout: one JSON object, for
3
+ * a result and for a failure alike, so a program (a coding agent) never has to parse human text.
4
+ * Every human status line goes to stderr in that mode. See docs/specs/2026-11-18-agent-operated-setup-design.md.
5
+ */
6
+ import { quoteArgument } from "../wizard/command";
7
+ import type { InitMode } from "./options";
8
+
9
+ export const INIT_FORMAT = "wachiman.init/1";
10
+
11
+ export type FileAction = "created" | "replaced" | "unchanged" | "would-create" | "would-replace" | "refused";
12
+
13
+ export interface InitFile {
14
+ /** Relative to the repository top level. */
15
+ path: string;
16
+ action: FileAction;
17
+ /** Where the earlier file was kept, relative to the repository when it is inside it. */
18
+ backup?: string;
19
+ /** The rendered workflow, only in a dry run (stdout stays one document). */
20
+ content?: string;
21
+ }
22
+
23
+ /** What `runInit` records as it works; `buildDocument` turns it into the file list. */
24
+ export interface InitReport {
25
+ workflow?: InitFile;
26
+ settings?: InitFile;
27
+ template?: InitFile[];
28
+ agentPointer?: InitFile;
29
+ }
30
+
31
+ /** `init` alone never makes a side ready: binding is `setup`, and GitHub needs a secret and a merge. */
32
+ export type Readiness = "pending" | "not-used";
33
+
34
+ export interface InitDocument {
35
+ format: typeof INIT_FORMAT;
36
+ ok: boolean;
37
+ mode: InitMode | null;
38
+ dryRun: boolean;
39
+ repoDir: string;
40
+ files: InitFile[];
41
+ local: { status: Readiness; pending: string[] };
42
+ github: { status: Readiness; pending: string[] };
43
+ error: { code: "usage" | "failed"; message: string } | null;
44
+ }
45
+
46
+ const filesOf = (report: InitReport): InitFile[] => [report.workflow, report.settings, ...(report.template ?? []), report.agentPointer].filter((f): f is InitFile => f !== undefined);
47
+
48
+ /** `init` never binds without a terminal and never touches GitHub, so a mode that includes either leaves it pending. */
49
+ export function buildDocument(p: { mode: InitMode; dryRun: boolean; repoDir: string; report: InitReport }): InitDocument {
50
+ const { mode } = p;
51
+ return {
52
+ format: INIT_FORMAT,
53
+ ok: true,
54
+ mode,
55
+ dryRun: p.dryRun,
56
+ repoDir: p.repoDir,
57
+ files: filesOf(p.report),
58
+ local:
59
+ mode === "github"
60
+ ? { status: "not-used", pending: [] }
61
+ : { status: "pending", pending: [`wachiman setup --profile <name> --yes --repo-dir ${quoteArgument(p.repoDir, "posix")}`] },
62
+ github: mode === "local" ? { status: "not-used", pending: [] } : { status: "pending", pending: ["add ANTHROPIC_API_KEY secret", "commit and open a PR"] },
63
+ error: null,
64
+ };
65
+ }
66
+
67
+ /** A failure: `files` holds what was already written or refused, and the other fields say what is known. */
68
+ export function failureDocument(p: { mode: InitMode | null; dryRun: boolean; repoDir: string; report: InitReport; code: "usage" | "failed"; message: string }): InitDocument {
69
+ return {
70
+ format: INIT_FORMAT,
71
+ ok: false,
72
+ mode: p.mode,
73
+ dryRun: p.dryRun,
74
+ repoDir: p.repoDir,
75
+ files: filesOf(p.report),
76
+ local: { status: "not-used", pending: [] },
77
+ github: { status: "not-used", pending: [] },
78
+ error: { code: p.code, message: p.message },
79
+ };
80
+ }
81
+
82
+ export const printDocument = (stdout: (text: string) => void, doc: InitDocument) => stdout(`${JSON.stringify(doc, null, 2)}\n`);
@@ -6,14 +6,32 @@ import { posix } from "node:path";
6
6
 
7
7
  export type InitMode = "github" | "local" | "both";
8
8
 
9
+ /** The shape of the repository. Metadata only for now: nothing else in Wachiman reads it. */
10
+ export type ProjectKind = "monorepo" | "single";
11
+ export const projectKinds: readonly ProjectKind[] = ["monorepo", "single"];
12
+
13
+ /** Why `kind` cannot be recorded, or undefined when it can. */
14
+ export function projectKindProblem(kind: string): string | undefined {
15
+ if (projectKinds.includes(kind as ProjectKind)) return undefined;
16
+ if (kind === "distributed") return '--project-kind distributed is not available yet; use monorepo or single.';
17
+ return `--project-kind must be monorepo or single, got "${kind}".`;
18
+ }
19
+
9
20
  export interface RawInitFlags {
10
21
  mode?: string;
11
22
  operator?: string;
12
23
  version?: string;
13
24
  path?: string;
25
+ projectKind?: string;
14
26
  force?: boolean;
15
27
  dryRun?: boolean;
28
+ /** Print one `wachiman.init/1` document on stdout; never prompt. */
29
+ json?: boolean;
16
30
  yes?: boolean;
31
+ /** `--pr-template` is true, `--no-pr-template` is false; absent means not given. */
32
+ prTemplate?: boolean;
33
+ /** `--no-agent-pointer` is false; absent means the pointer is written. */
34
+ agentPointer?: boolean;
17
35
  repoDir?: string;
18
36
  help?: boolean;
19
37
  }
@@ -22,6 +40,14 @@ export interface InitOptions {
22
40
  mode: InitMode;
23
41
  /** Present iff mode !== "local". */
24
42
  github?: { operator: string; tag: string; path: string; force: boolean; dryRun: boolean };
43
+ /** Install the PR description template after the workflow work. Absent means no: a script that did not ask gets no new file. */
44
+ prTemplate?: boolean;
45
+ /** False (`--no-agent-pointer`) skips the pointer in AGENTS.md or CLAUDE.md; absent means write it. */
46
+ agentPointer?: false;
47
+ /** Present iff the kind was given (flag or answer); then `.wachiman.yml` is written or checked. `force` allows changing a different `kind:` without asking. */
48
+ settings?: { kind: ProjectKind; force: boolean };
49
+ /** Set only in local mode (github mode carries it in `github.dryRun`): preview `.wachiman.yml` and the PR template, write nothing. */
50
+ dryRun?: true;
25
51
  repoDir: string;
26
52
  interactive: boolean;
27
53
  }
@@ -34,7 +60,7 @@ export type ResolveResult<T> = { ok: true; options: T } | { ok: false; error: st
34
60
  * docs/releasing.md); the CLI's own version is never a substitute,
35
61
  * because an unreleased or unrelated version would pin a workflow that does not exist.
36
62
  */
37
- export const DEFAULT_WORKFLOW_REF: string | undefined = "v1.15.0"; // x-release-please-version
63
+ export const DEFAULT_WORKFLOW_REF: string | undefined = "v1.17.0"; // x-release-please-version
38
64
 
39
65
  export const DEFAULT_WORKFLOW_PATH = ".github/workflows/wachiman-review.yml";
40
66
  const WORKFLOWS_DIR = ".github/workflows/";
@@ -46,7 +72,6 @@ const GITHUB_ONLY_FLAGS = [
46
72
  ["version", "--version"],
47
73
  ["path", "--path"],
48
74
  ["force", "--force"],
49
- ["dryRun", "--dry-run"],
50
75
  ] as const;
51
76
 
52
77
  export const initModes: readonly InitMode[] = ["github", "local", "both"];
@@ -86,11 +111,22 @@ export function resolveInitOptions(
86
111
  if (!initModes.includes(flags.mode as InitMode)) return fail(`--mode must be github, local or both, got "${flags.mode}".`);
87
112
  const mode = flags.mode as InitMode;
88
113
  const repoDir = flags.repoDir ?? ".";
114
+ const optionalFiles = {
115
+ ...(flags.prTemplate === true ? { prTemplate: true } : {}),
116
+ ...(flags.agentPointer === false ? { agentPointer: false as const } : {}),
117
+ };
118
+ if (flags.projectKind !== undefined) {
119
+ const kindError = projectKindProblem(flags.projectKind);
120
+ if (kindError) return fail(kindError);
121
+ }
122
+ const settings = flags.projectKind === undefined ? undefined : { kind: flags.projectKind as ProjectKind, force: flags.force === true };
89
123
 
90
124
  if (mode === "local") {
91
- const given = GITHUB_ONLY_FLAGS.filter(([key]) => flags[key] !== undefined && flags[key] !== false).map(([, name]) => name);
125
+ // With a kind, --force means "change a different kind in the settings file", which local mode does write.
126
+ const given = GITHUB_ONLY_FLAGS.filter(([key]) => flags[key] !== undefined && flags[key] !== false && !(key === "force" && settings))
127
+ .map(([, name]) => name);
92
128
  if (given.length > 0) return fail(`${given.join(", ")} only apply to a workflow; --mode local writes none. Drop them, or use --mode github or both.`);
93
- return { ok: true, options: { mode, repoDir, interactive: ctx.interactive } };
129
+ return { ok: true, options: { mode, ...optionalFiles, ...(settings ? { settings } : {}), ...(flags.dryRun ? { dryRun: true as const } : {}), repoDir, interactive: ctx.interactive } };
94
130
  }
95
131
 
96
132
  if (flags.operator === undefined) return fail(`init --mode ${mode} needs --operator <github login> when it cannot ask: the one person whose /wachiman comments start a run.`);
@@ -117,6 +153,8 @@ export function resolveInitOptions(
117
153
  options: {
118
154
  mode,
119
155
  github: { operator: flags.operator, tag, path: path.path, force: flags.force === true, dryRun: flags.dryRun === true },
156
+ ...optionalFiles,
157
+ ...(settings ? { settings } : {}),
120
158
  repoDir,
121
159
  interactive: ctx.interactive,
122
160
  },
@@ -1,11 +1,12 @@
1
1
  import { UsageError } from "../config";
2
2
  import type { Prompter } from "../wizard/prompt";
3
- import { DEFAULT_WORKFLOW_PATH, initModes, normaliseWorkflowPath, operatorProblem, tagProblem, type InitMode, type RawInitFlags } from "./options";
3
+ import { DEFAULT_WORKFLOW_PATH, initModes, normaliseWorkflowPath, operatorProblem, projectKindProblem, tagProblem, type InitMode, type ProjectKind, type RawInitFlags } from "./options";
4
4
 
5
5
  /** The values given on the command line are held to the same rules as answers: a bad one is exit 2, never silently asked again. */
6
6
  export function checkSupplied(flags: RawInitFlags) {
7
7
  if (flags.mode !== undefined && !initModes.includes(flags.mode as InitMode)) throw new UsageError(`--mode must be github, local or both, got "${flags.mode}".`);
8
8
  const problem =
9
+ (flags.projectKind !== undefined ? projectKindProblem(flags.projectKind) : undefined) ??
9
10
  (flags.operator !== undefined ? operatorProblem(flags.operator) : undefined) ??
10
11
  (flags.version !== undefined ? tagProblem(flags.version) : undefined) ??
11
12
  (flags.path !== undefined ? (() => { const p = normaliseWorkflowPath(flags.path!); return p.ok ? undefined : p.problem; })() : undefined);
@@ -17,9 +18,26 @@ export function checkSupplied(flags: RawInitFlags) {
17
18
  * (`null`: the person cancelled). Answers are validated as they are typed; the pure resolver
18
19
  * validates everything again.
19
20
  */
20
- export async function promptForInit(flags: RawInitFlags, ctx: { defaultWorkflowRef?: string }, prompter: Prompter): Promise<RawInitFlags | null> {
21
+ export async function promptForInit(flags: RawInitFlags, ctx: { defaultWorkflowRef?: string; githubLogin?: () => string | undefined }, prompter: Prompter): Promise<RawInitFlags | null> {
21
22
  checkSupplied(flags);
22
- prompter.step("Review mode", 2);
23
+ prompter.step("Project type", 2);
24
+ let projectKind = flags.projectKind as ProjectKind | undefined;
25
+ if (projectKind === undefined) {
26
+ const picked = await prompter.select<ProjectKind | "distributed">(
27
+ "What kind of repository is this?",
28
+ [
29
+ { label: "Monorepo", value: "monorepo" },
30
+ { label: "Single project", value: "single" },
31
+ { label: "Distributed repository", value: "distributed", disabled: true },
32
+ ],
33
+ 0,
34
+ );
35
+ if (picked === null) return null;
36
+ projectKind = picked as ProjectKind;
37
+ }
38
+ flags = { ...flags, projectKind };
39
+
40
+ prompter.step("Review mode", 3);
23
41
  let mode = flags.mode as InitMode | undefined;
24
42
  if (mode === undefined) {
25
43
  const picked = await prompter.select<InitMode>(
@@ -34,21 +52,34 @@ export async function promptForInit(flags: RawInitFlags, ctx: { defaultWorkflowR
34
52
  if (picked === null) return null;
35
53
  mode = picked;
36
54
  }
37
- if (mode === "local") return { ...flags, mode };
55
+ if (mode === "local") {
56
+ const prTemplate = await askPrTemplate(flags, prompter);
57
+ return prTemplate === null ? null : { ...flags, mode, prTemplate };
58
+ }
38
59
 
39
- prompter.step("GitHub workflow", 3, mode === "both" ? 6 : 4);
60
+ prompter.step("GitHub workflow", 4, mode === "both" ? 6 : 5);
40
61
 
62
+ // The signed-in `gh` user is the likely answer; a login that fails the same rule is not offered.
63
+ // `gh` is only spawned when the operator is going to be asked: `--operator` makes the guess useless.
64
+ const guess = flags.operator === undefined ? ctx.githubLogin?.() : undefined;
65
+ const suggested = guess !== undefined && operatorProblem(guess) === undefined ? guess : undefined;
66
+ if (suggested !== undefined) prompter.say(`Signed in to GitHub as https://github.com/${suggested}; press Enter to use it.`, "muted");
41
67
  const operator =
42
- flags.operator ?? (await prompter.text("GitHub login of the operator (the one person whose /wachiman comments start a run)", undefined, (v) => operatorProblem(v)));
68
+ flags.operator ??
69
+ (await prompter.text("Your GitHub username, as in https://github.com/<username>: only this person's /wachiman comments start a paid run", suggested, (v) => operatorProblem(v)));
43
70
  if (operator === null) return null;
44
- const version = flags.version ?? (await prompter.text("Release tag to pin", ctx.defaultWorkflowRef, (v) => tagProblem(v)));
71
+ // The release this CLI was published as, and the standard workflow path: neither is asked. `--version` and `--path` still override them.
72
+ const version = flags.version ?? ctx.defaultWorkflowRef ?? (await prompter.text("Release tag to pin", undefined, (v) => tagProblem(v)));
45
73
  if (version === null) return null;
46
- const path =
47
- flags.path ??
48
- (await prompter.text("Workflow file", DEFAULT_WORKFLOW_PATH, (v) => {
49
- const p = normaliseWorkflowPath(v);
50
- return p.ok ? undefined : p.problem;
51
- }));
52
- if (path === null) return null;
53
- return { ...flags, mode, operator, version, path };
74
+ const path = flags.path ?? DEFAULT_WORKFLOW_PATH;
75
+ const prTemplate = await askPrTemplate(flags, prompter);
76
+ return prTemplate === null ? null : { ...flags, mode, operator, version, path, prTemplate };
77
+ }
78
+
79
+ /** The flag when it was given; otherwise the question (`null`: cancelled). Asked once, in every mode, because the template belongs to the repository, not to a review mode. */
80
+ async function askPrTemplate(flags: RawInitFlags, prompter: Prompter): Promise<boolean | null> {
81
+ if (flags.prTemplate !== undefined) return flags.prTemplate;
82
+ // A dry run writes nothing, so it asks nothing about a file.
83
+ if (flags.dryRun) return false;
84
+ return prompter.confirm("Also install the PR description template? An existing .github/pull_request_template.md is adopted and replaced (a backup is kept); nothing is committed.", true);
54
85
  }
@@ -26,6 +26,8 @@ export function renderCallerWorkflow(template: string, p: { operator: string; ta
26
26
  }
27
27
  const body = template
28
28
  .replace(OPERATOR_ANCHOR, () => `operator: "${p.operator}"`)
29
- .replace(PIN_ANCHOR, (_match, prefix: string) => `${prefix}${p.tag}`);
29
+ .replace(PIN_ANCHOR, (_match, prefix: string) => `${prefix}${p.tag}`)
30
+ // The template marks its pin for release-please; that marker is not for the file the user gets.
31
+ .replace(/[ \t]+# x-release-please-version$/m, "");
30
32
  return p.header === undefined ? body : `${p.header}\n${body}`;
31
33
  }