@usepipr/cli 0.1.3 → 0.2.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.
package/dist/main.mjs CHANGED
@@ -15,7 +15,7 @@ async function main() {
15
15
  function createProgram() {
16
16
  const program = new Command();
17
17
  program.name("pipr").showHelpAfterError();
18
- program.command("init").description("Create editable TypeScript config").option("--config-dir <dir>", "Config directory", ".pipr").option("--adapters <adapters>", `Adapters to initialize (${supportedOfficialInitAdapters.join(", ")}; use 'none' to skip adapter files)`).option("--recipe <recipe>", `Starter recipe (${supportedOfficialInitRecipes.join(", ")})`).option("--no-types", "Skip local TypeScript support files").option("--types-only", "Add or refresh local TypeScript support files only").option("--force", "Overwrite existing pipr files").action(runInit);
18
+ program.command("init").description("Create editable TypeScript config").option("--config-dir <dir>", "Config directory", ".pipr").option("--adapters <adapters>", `Adapters to initialize (${supportedOfficialInitAdapters.join(", ")}; use 'none' to skip adapter files)`).option("--recipe <recipe>", `Starter recipe (${supportedOfficialInitRecipes.join(", ")})`).option("--minimal", "Scaffold a single-file .pipr/config.ts without package.json").option("--force", "Overwrite existing pipr files").action(runInit);
19
19
  program.command("action").description("Run inside GitHub Docker Action").option("--config-dir <dir>", "Config directory", ".pipr").action(runAction);
20
20
  program.command("check").description("Type-load config and validate the runtime plan").option("--config-dir <dir>", "Config directory", ".pipr").option("--require-env", "Require configured provider env vars").action(runCheck);
21
21
  program.command("dry-run").description("Load config and event without publishing").requiredOption("--event <path>", "GitHub event JSON path").option("--config-dir <dir>", "Config directory", ".pipr").action(runDryRun);
@@ -39,25 +39,28 @@ function actionOptions(options) {
39
39
  };
40
40
  }
41
41
  const githubActionsLogSink = {
42
- info(message) {
43
- core.info(message);
44
- },
45
- notice(message) {
46
- core.notice(message);
47
- },
48
- warning(message) {
49
- core.warning(message);
50
- },
51
- error(message) {
52
- core.error(message);
53
- },
54
- debug(message) {
55
- core.debug(message);
42
+ log(record) {
43
+ githubActionLogWriters[record.level](formatGitHubActionLogRecord(record));
56
44
  },
57
45
  async group(name, run) {
58
46
  return await core.group(name, run);
59
47
  }
60
48
  };
49
+ const githubActionLogWriters = {
50
+ info: core.info,
51
+ notice: core.notice,
52
+ warning: core.warning,
53
+ error: core.error,
54
+ debug: core.debug
55
+ };
56
+ function formatGitHubActionLogRecord(record) {
57
+ const line = JSON.stringify({
58
+ level: record.level,
59
+ event: record.event,
60
+ ...record.fields
61
+ });
62
+ return record.text === void 0 ? line : `${line}\n${record.text}`;
63
+ }
61
64
  function writeActionResult(result) {
62
65
  if (result.kind === "ignored") {
63
66
  core.info(`pipr ignored event: ${result.reason}`);
@@ -65,35 +68,43 @@ function writeActionResult(result) {
65
68
  }
66
69
  writeLoadedActionResult(result);
67
70
  }
68
- const loadedActionResultWriters = {
69
- "command-help": (result) => {
70
- assertLoadedActionKind(result, "command-help");
71
- writeCommandHelpActionResult(result);
72
- },
73
- "command-response": (result) => {
74
- assertLoadedActionKind(result, "command-response");
75
- writeCommandResponseActionResult(result);
76
- },
77
- "dry-run": (result) => {
78
- assertLoadedActionKind(result, "dry-run");
79
- writeDryRunActionResult(result);
80
- },
81
- review: (result) => {
82
- assertLoadedActionKind(result, "review");
83
- writeReviewActionResult(result);
84
- },
85
- verifier: (result) => {
86
- assertLoadedActionKind(result, "verifier");
87
- writeVerifierActionResult(result);
88
- }
89
- };
90
71
  function writeLoadedActionResult(result) {
91
72
  core.info(`pipr loaded change #${result.event.change.number} for ${result.event.repository.slug}`);
92
73
  core.info(`pipr config source: ${result.configSource}`);
93
- loadedActionResultWriters[result.kind](result);
74
+ if (result.kind === "dry-run") {
75
+ writeDryRunActionResult(result);
76
+ return;
77
+ }
78
+ writePublishedActionResult(result);
79
+ }
80
+ function writePublishedActionResult(result) {
81
+ if (result.kind === "command-help" || result.kind === "command-response") {
82
+ writeCommandActionResult(result);
83
+ return;
84
+ }
85
+ writeReviewWorkflowActionResult(result);
86
+ }
87
+ function writeCommandActionResult(result) {
88
+ switch (result.kind) {
89
+ case "command-help":
90
+ writeCommandHelpActionResult(result);
91
+ break;
92
+ case "command-response":
93
+ writeCommandResponseActionResult(result);
94
+ break;
95
+ default:
96
+ }
94
97
  }
95
- function assertLoadedActionKind(result, kind) {
96
- if (result.kind !== kind) throw new Error(`Expected '${kind}' action result, got '${result.kind}'`);
98
+ function writeReviewWorkflowActionResult(result) {
99
+ switch (result.kind) {
100
+ case "review":
101
+ writeReviewActionResult(result);
102
+ break;
103
+ case "verifier":
104
+ writeVerifierActionResult(result);
105
+ break;
106
+ default:
107
+ }
97
108
  }
98
109
  function writeDryRunActionResult(result) {
99
110
  core.info("PIPR_DRY_RUN=1; stopping before review runtime, model, or GitHub publishing calls");
@@ -126,39 +137,16 @@ function warnInlineResolutionErrors(errors) {
126
137
  for (const error of errors) core.warning(`pipr inline resolution failed: ${error}`);
127
138
  }
128
139
  async function runInit(options) {
129
- const typeSupport = initTypeSupportMode(options);
130
140
  const result = await runInitCommand({
131
141
  rootDir: process.cwd(),
132
142
  configDir: options.configDir,
133
143
  force: options.force === true,
134
144
  adapters: parseInitAdapters(options.adapters),
135
145
  recipe: options.recipe,
136
- typeSupport
146
+ minimal: options.minimal === true
137
147
  });
138
148
  console.log(`created ${result.created.length} file(s)` + (result.overwritten.length > 0 ? `; overwrote ${result.overwritten.length}` : ""));
139
- }
140
- function initTypeSupportMode(options) {
141
- const invalidMessage = invalidTypeSupportMessage(options);
142
- if (invalidMessage) throw new Error(invalidMessage);
143
- if (options.typesOnly === true) return "only";
144
- return options.types === false ? "skip" : "include";
145
- }
146
- const invalidTypeSupportRules = [
147
- {
148
- matches: (options) => options.typesOnly === true && options.types === false,
149
- message: "--types-only cannot be combined with --no-types"
150
- },
151
- {
152
- matches: (options) => options.typesOnly === true && options.recipe !== void 0,
153
- message: "--types-only cannot be combined with --recipe"
154
- },
155
- {
156
- matches: (options) => options.typesOnly === true && options.adapters !== void 0,
157
- message: "--types-only cannot be combined with --adapters"
158
- }
159
- ];
160
- function invalidTypeSupportMessage(options) {
161
- return invalidTypeSupportRules.find((rule) => rule.matches(options))?.message;
149
+ if (options.minimal === true) console.log("For editor types, install @usepipr/sdk at the repo root: npm install -D @usepipr/sdk");
162
150
  }
163
151
  function parseInitAdapters(adapters) {
164
152
  return adapters?.split(",").map((adapter) => adapter.trim());
@@ -209,50 +197,25 @@ const stderrTaskLog = {
209
197
  }
210
198
  };
211
199
  const localConsoleLogSink = {
212
- info(message) {
213
- console.error(formatLocalLogMessage(message));
214
- },
215
- notice(message) {
216
- console.error(formatLocalLogMessage(message));
217
- },
218
- warning(message) {
219
- console.error(formatLocalLogMessage(message));
220
- },
221
- error(message) {
222
- console.error(formatLocalLogMessage(message));
223
- },
224
- debug(message) {
225
- console.error(formatLocalLogMessage(message));
200
+ log(record) {
201
+ console.error(formatLocalLogRecord(record));
226
202
  },
227
203
  async group(_name, run) {
228
204
  return await run();
229
205
  }
230
206
  };
231
- function formatLocalLogMessage(message) {
232
- const [firstLine, ...rest] = message.split("\n");
233
- const data = parseLocalLogLine(firstLine);
234
- if (!data) return message;
235
- const fields = Object.entries(data).map(([key, value]) => formatLocalLogField(key, value)).filter((field) => field !== void 0);
236
- const formatted = [...formatLocalLogPrefix(data), ...fields].join(" ");
237
- return rest.length === 0 ? formatted : [formatted, ...rest].join("\n");
207
+ function formatLocalLogRecord(record) {
208
+ const fields = Object.entries(record.fields).map(([key, value]) => formatLocalLogField(key, value)).filter((field) => field !== void 0);
209
+ const formatted = [...formatLocalLogPrefix(record), ...fields].join(" ");
210
+ return record.text === void 0 ? formatted : `${formatted}\n${record.text}`;
238
211
  }
239
- function formatLocalLogPrefix(data) {
240
- const level = typeof data.level === "string" ? data.level : "";
241
- const event = typeof data.event === "string" ? data.event : "";
212
+ function formatLocalLogPrefix(record) {
242
213
  return [
243
214
  "pipr",
244
- localLogPlainLevels.has(level) ? "" : level,
245
- event
215
+ localLogPlainLevels.has(record.level) ? "" : record.level,
216
+ record.event
246
217
  ].filter(Boolean);
247
218
  }
248
- function parseLocalLogLine(line) {
249
- if (!line?.startsWith("{")) return;
250
- try {
251
- return JSON.parse(line);
252
- } catch {
253
- return;
254
- }
255
- }
256
219
  const localLogNumberFields = {
257
220
  additions: (value) => `+${value}`,
258
221
  deletions: (value) => `-${value}`,
@@ -261,10 +224,9 @@ const localLogNumberFields = {
261
224
  stderrBytes: (value) => `stderr=${value}B`,
262
225
  stdoutBytes: (value) => `stdout=${value}B`
263
226
  };
264
- const localLogHiddenFields = new Set(["level", "event"]);
265
227
  const localLogPlainLevels = new Set(["info", "notice"]);
266
228
  function formatLocalLogField(key, value) {
267
- if (localLogHiddenFields.has(key) || value == null) return;
229
+ if (value == null) return;
268
230
  return formatLocalLogFieldValue(key, value);
269
231
  }
270
232
  function formatLocalLogFieldValue(key, value) {
@@ -315,19 +277,9 @@ function stripMainCommentMarker(comment) {
315
277
  return comment.split("\n").filter((line) => !line.startsWith("<!-- pipr:main-comment ")).join("\n").trimStart();
316
278
  }
317
279
  function localReviewJson(result) {
318
- if (result.kind === "skipped") return {
319
- kind: result.kind,
320
- skipReason: result.skipReason,
321
- mainComment: result.mainComment,
322
- inlineFindings: result.inlineCommentDrafts,
323
- droppedFindings: result.validated.droppedFindings,
324
- taskChecks: result.taskChecks,
325
- provider: result.provider,
326
- providerModels: result.publicationPlan.metadata.providerModels ?? [result.provider.model],
327
- repairAttempted: result.repairAttempted
328
- };
329
280
  return {
330
281
  kind: result.kind,
282
+ ...result.kind === "skipped" ? { skipReason: result.skipReason } : {},
331
283
  mainComment: result.mainComment,
332
284
  inlineFindings: result.inlineCommentDrafts,
333
285
  droppedFindings: result.validated.droppedFindings,
package/dist/main.mjs.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"main.mjs","names":[],"sources":["../src/main.ts"],"sourcesContent":["#!/usr/bin/env bun\nimport { inspect } from \"node:util\";\nimport * as core from \"@actions/core\";\nimport {\n type ActionCommandResult,\n type ActionLogSink,\n type InitTypeSupportMode,\n PublicationError,\n runActionCommand,\n runDryRunCommand,\n runInitCommand,\n runInspectCommand,\n runLocalReviewCommand,\n runValidateCommand,\n supportedOfficialInitAdapters,\n supportedOfficialInitRecipes,\n} from \"@usepipr/runtime\";\nimport { Command } from \"commander\";\n\ntype ActionOptions = Parameters<typeof runActionCommand>[0];\n\ntype CliOptions = {\n configDir: string;\n event?: string;\n force?: boolean;\n adapters?: string;\n recipe?: string;\n types?: boolean;\n typesOnly?: boolean;\n requireEnv?: boolean;\n base?: string;\n head?: string;\n piExecutable?: string;\n json?: boolean;\n};\n\nasync function main(): Promise<void> {\n const program = createProgram();\n if (process.argv.length <= 2) {\n program.outputHelp();\n return;\n }\n await program.parseAsync(process.argv);\n}\n\nfunction createProgram(): Command {\n const program = new Command();\n program.name(\"pipr\").showHelpAfterError();\n\n program\n .command(\"init\")\n .description(\"Create editable TypeScript config\")\n .option(\"--config-dir <dir>\", \"Config directory\", \".pipr\")\n .option(\n \"--adapters <adapters>\",\n `Adapters to initialize (${supportedOfficialInitAdapters.join(\", \")}; use 'none' to skip adapter files)`,\n )\n .option(\"--recipe <recipe>\", `Starter recipe (${supportedOfficialInitRecipes.join(\", \")})`)\n .option(\"--no-types\", \"Skip local TypeScript support files\")\n .option(\"--types-only\", \"Add or refresh local TypeScript support files only\")\n .option(\"--force\", \"Overwrite existing pipr files\")\n .action(runInit);\n\n program\n .command(\"action\")\n .description(\"Run inside GitHub Docker Action\")\n .option(\"--config-dir <dir>\", \"Config directory\", \".pipr\")\n .action(runAction);\n\n program\n .command(\"check\")\n .description(\"Type-load config and validate the runtime plan\")\n .option(\"--config-dir <dir>\", \"Config directory\", \".pipr\")\n .option(\"--require-env\", \"Require configured provider env vars\")\n .action(runCheck);\n\n program\n .command(\"dry-run\")\n .description(\"Load config and event without publishing\")\n .requiredOption(\"--event <path>\", \"GitHub event JSON path\")\n .option(\"--config-dir <dir>\", \"Config directory\", \".pipr\")\n .action(runDryRun);\n\n program\n .command(\"inspect\")\n .description(\"Print models, agents, tasks, commands, and tools\")\n .option(\"--config-dir <dir>\", \"Config directory\", \".pipr\")\n .action(runInspect);\n\n program\n .command(\"review\")\n .description(\"Run configured change-request review tasks locally without publishing\")\n .option(\"--base <sha>\", \"Base commit SHA\")\n .option(\"--head <sha>\", \"Head commit SHA or ref; omitted reviews the working tree\")\n .option(\"--config-dir <dir>\", \"Config directory\", \".pipr\")\n .option(\"--pi-executable <path>\", \"Pi executable path\")\n .option(\"--json\", \"Print structured JSON output\")\n .action(runLocalReview);\n\n return program;\n}\n\nasync function runAction(options: CliOptions): Promise<void> {\n writeActionResult(await runActionCommand(actionOptions(options)));\n}\n\nfunction actionOptions(options: CliOptions): ActionOptions {\n const eventPath = process.env.GITHUB_EVENT_PATH;\n if (!eventPath) {\n throw new Error(\"GITHUB_EVENT_PATH is required for pipr action\");\n }\n return {\n rootDir: process.env.GITHUB_WORKSPACE ?? process.cwd(),\n configDir: process.env[\"INPUT_CONFIG-DIR\"] || options.configDir,\n env: process.env,\n eventPath,\n dryRun: process.env.PIPR_DRY_RUN === \"1\",\n logSink: githubActionsLogSink,\n };\n}\n\nconst githubActionsLogSink: ActionLogSink = {\n info(message) {\n core.info(message);\n },\n notice(message) {\n core.notice(message);\n },\n warning(message) {\n core.warning(message);\n },\n error(message) {\n core.error(message);\n },\n debug(message) {\n core.debug(message);\n },\n async group(name, run) {\n return await core.group(name, run);\n },\n};\n\nfunction writeActionResult(result: ActionCommandResult): void {\n if (result.kind === \"ignored\") {\n core.info(`pipr ignored event: ${result.reason}`);\n return;\n }\n writeLoadedActionResult(result);\n}\n\ntype LoadedActionResult = Exclude<ActionCommandResult, { kind: \"ignored\" }>;\ntype LoadedActionResultWriter = (result: LoadedActionResult) => void;\n\nconst loadedActionResultWriters = {\n \"command-help\": (result) => {\n assertLoadedActionKind(result, \"command-help\");\n writeCommandHelpActionResult(result);\n },\n \"command-response\": (result) => {\n assertLoadedActionKind(result, \"command-response\");\n writeCommandResponseActionResult(result);\n },\n \"dry-run\": (result) => {\n assertLoadedActionKind(result, \"dry-run\");\n writeDryRunActionResult(result);\n },\n review: (result) => {\n assertLoadedActionKind(result, \"review\");\n writeReviewActionResult(result);\n },\n verifier: (result) => {\n assertLoadedActionKind(result, \"verifier\");\n writeVerifierActionResult(result);\n },\n} satisfies Record<LoadedActionResult[\"kind\"], LoadedActionResultWriter>;\n\nfunction writeLoadedActionResult(result: LoadedActionResult): void {\n core.info(\n `pipr loaded change #${result.event.change.number} for ${result.event.repository.slug}`,\n );\n core.info(`pipr config source: ${result.configSource}`);\n loadedActionResultWriters[result.kind](result);\n}\n\nfunction assertLoadedActionKind<K extends LoadedActionResult[\"kind\"]>(\n result: LoadedActionResult,\n kind: K,\n): asserts result is Extract<LoadedActionResult, { kind: K }> {\n if (result.kind !== kind) {\n throw new Error(`Expected '${kind}' action result, got '${result.kind}'`);\n }\n}\n\nfunction writeDryRunActionResult(result: Extract<ActionCommandResult, { kind: \"dry-run\" }>): void {\n void result;\n core.info(\"PIPR_DRY_RUN=1; stopping before review runtime, model, or GitHub publishing calls\");\n}\n\nfunction writeCommandHelpActionResult(\n result: Extract<ActionCommandResult, { kind: \"command-help\" }>,\n): void {\n core.info(`pipr command help: ${result.reason}`);\n core.setOutput(\"main-comment\", result.body);\n}\n\nfunction writeCommandResponseActionResult(\n result: Extract<ActionCommandResult, { kind: \"command-response\" }>,\n): void {\n core.info(\n `pipr command '${result.command}' published response comment (${result.publication.action})`,\n );\n core.setOutput(\"main-comment\", result.response.body);\n core.setOutput(\"publication\", JSON.stringify(result.publication));\n}\n\nfunction writeVerifierActionResult(\n result: Extract<ActionCommandResult, { kind: \"verifier\" }>,\n): void {\n core.info(\n `pipr verifier processed review comment reply with ${result.errors.length} publication error(s)`,\n );\n warnInlineResolutionErrors(result.errors);\n core.setOutput(\"publication\", JSON.stringify({ inlineResolutionErrors: result.errors }));\n}\n\nfunction writeReviewActionResult(result: Extract<ActionCommandResult, { kind: \"review\" }>): void {\n core.info(\n `pipr review produced ${result.review.validated.validFindings.length} valid inline finding(s), ` +\n `${result.review.validated.droppedFindings.length} dropped finding(s)`,\n );\n core.info(\n `pipr published main comment (${result.publication.mainComment.action}) and ` +\n `${result.publication.inlineComments.posted} inline comment(s); ` +\n `${result.publication.inlineComments.skipped} skipped`,\n );\n warnInlineResolutionErrors(result.publication.metadata.inlineResolutionErrors);\n if (result.review.repairAttempted) {\n core.info(\"pipr repaired reviewer JSON once before validation\");\n }\n core.setOutput(\"main-comment\", result.review.mainComment);\n core.setOutput(\"inline-comments\", JSON.stringify(result.review.inlineCommentDrafts));\n core.setOutput(\"dropped-findings\", JSON.stringify(result.review.validated.droppedFindings));\n core.setOutput(\"publication\", JSON.stringify(result.publication));\n}\n\nfunction warnInlineResolutionErrors(errors: string[]): void {\n for (const error of errors) {\n core.warning(`pipr inline resolution failed: ${error}`);\n }\n}\n\nasync function runInit(options: CliOptions): Promise<void> {\n const typeSupport = initTypeSupportMode(options);\n const result = await runInitCommand({\n rootDir: process.cwd(),\n configDir: options.configDir,\n force: options.force === true,\n adapters: parseInitAdapters(options.adapters),\n recipe: options.recipe,\n typeSupport,\n });\n console.log(\n `created ${result.created.length} file(s)` +\n (result.overwritten.length > 0 ? `; overwrote ${result.overwritten.length}` : \"\"),\n );\n}\n\nfunction initTypeSupportMode(options: CliOptions): InitTypeSupportMode {\n const invalidMessage = invalidTypeSupportMessage(options);\n if (invalidMessage) {\n throw new Error(invalidMessage);\n }\n if (options.typesOnly === true) {\n return \"only\";\n }\n return options.types === false ? \"skip\" : \"include\";\n}\n\nconst invalidTypeSupportRules: Array<{\n matches(options: CliOptions): boolean;\n message: string;\n}> = [\n {\n matches: (options) => options.typesOnly === true && options.types === false,\n message: \"--types-only cannot be combined with --no-types\",\n },\n {\n matches: (options) => options.typesOnly === true && options.recipe !== undefined,\n message: \"--types-only cannot be combined with --recipe\",\n },\n {\n matches: (options) => options.typesOnly === true && options.adapters !== undefined,\n message: \"--types-only cannot be combined with --adapters\",\n },\n];\n\nfunction invalidTypeSupportMessage(options: CliOptions): string | undefined {\n return invalidTypeSupportRules.find((rule) => rule.matches(options))?.message;\n}\n\nfunction parseInitAdapters(adapters: string | undefined): string[] | undefined {\n return adapters?.split(\",\").map((adapter) => adapter.trim());\n}\n\nasync function runCheck(options: CliOptions): Promise<void> {\n const settings = await runValidateCommand({\n rootDir: process.cwd(),\n configDir: options.configDir,\n env: process.env,\n requireProviderEnv: options.requireEnv === true,\n });\n console.log(`valid: ${settings.source}`);\n for (const warning of settings.warnings) {\n console.log(`warning: ${warning}`);\n }\n}\n\nasync function runInspect(options: CliOptions): Promise<void> {\n const result = await runInspectCommand({\n rootDir: process.cwd(),\n configDir: options.configDir,\n env: process.env,\n });\n console.log(inspect(result, { depth: 8, colors: false }));\n}\n\nasync function runLocalReview(options: CliOptions): Promise<void> {\n if (!options.base) {\n throw new Error(\"pipr review requires --base <sha>\");\n }\n const result = await runLocalReviewCommand({\n rootDir: process.cwd(),\n configDir: options.configDir,\n env: process.env,\n baseSha: options.base,\n headSha: options.head,\n piExecutable: options.piExecutable,\n logSink: localConsoleLogSink,\n taskLog: stderrTaskLog,\n });\n writeLocalReviewResult(result, options.json === true);\n}\n\ntype LocalReviewResult = Awaited<ReturnType<typeof runLocalReviewCommand>>;\n\nconst stderrTaskLog = {\n info(message: string) {\n console.error(`[info] ${message}`);\n },\n warn(message: string) {\n console.error(`[warn] ${message}`);\n },\n error(message: string) {\n console.error(`[error] ${message}`);\n },\n};\n\nconst localConsoleLogSink: ActionLogSink = {\n info(message) {\n console.error(formatLocalLogMessage(message));\n },\n notice(message) {\n console.error(formatLocalLogMessage(message));\n },\n warning(message) {\n console.error(formatLocalLogMessage(message));\n },\n error(message) {\n console.error(formatLocalLogMessage(message));\n },\n debug(message) {\n console.error(formatLocalLogMessage(message));\n },\n async group(_name, run) {\n return await run();\n },\n};\n\nfunction formatLocalLogMessage(message: string): string {\n const [firstLine, ...rest] = message.split(\"\\n\");\n const data = parseLocalLogLine(firstLine);\n if (!data) {\n return message;\n }\n\n const fields = Object.entries(data)\n .map(([key, value]) => formatLocalLogField(key, value))\n .filter((field): field is string => field !== undefined);\n const prefix = formatLocalLogPrefix(data);\n const formatted = [...prefix, ...fields].join(\" \");\n return rest.length === 0 ? formatted : [formatted, ...rest].join(\"\\n\");\n}\n\nfunction formatLocalLogPrefix(data: Record<string, unknown>): string[] {\n const level = typeof data.level === \"string\" ? data.level : \"\";\n const event = typeof data.event === \"string\" ? data.event : \"\";\n return [\"pipr\", localLogPlainLevels.has(level) ? \"\" : level, event].filter(Boolean);\n}\n\nfunction parseLocalLogLine(line: string | undefined): Record<string, unknown> | undefined {\n if (!line?.startsWith(\"{\")) {\n return undefined;\n }\n try {\n return JSON.parse(line) as Record<string, unknown>;\n } catch {\n return undefined;\n }\n}\n\nconst localLogNumberFields: Record<string, (value: number) => string> = {\n additions: (value) => `+${value}`,\n deletions: (value) => `-${value}`,\n durationMs: (value) =>\n `duration=${value < 1000 ? `${value}ms` : `${(value / 1000).toFixed(1)}s`}`,\n promptBytes: (value) => `prompt=${value}B`,\n stderrBytes: (value) => `stderr=${value}B`,\n stdoutBytes: (value) => `stdout=${value}B`,\n};\n\nconst localLogHiddenFields = new Set([\"level\", \"event\"]);\nconst localLogPlainLevels = new Set([\"info\", \"notice\"]);\n\nfunction formatLocalLogField(key: string, value: unknown): string | undefined {\n if (localLogHiddenFields.has(key) || value == null) {\n return undefined;\n }\n\n return formatLocalLogFieldValue(key, value);\n}\n\nfunction formatLocalLogFieldValue(key: string, value: unknown): string {\n const formattedNumber =\n typeof value === \"number\" ? localLogNumberFields[key]?.(value) : undefined;\n return formattedNumber ?? `${key}=${formatLocalLogValue(value)}`;\n}\n\nconst localLogValueFormatters: Record<string, (value: unknown) => string> = {\n boolean: String,\n number: String,\n object: (value) =>\n Array.isArray(value)\n ? value.length === 0\n ? \"-\"\n : value.map(formatLocalLogValue).join(\",\")\n : JSON.stringify(value),\n string: (value) => {\n const text = String(value);\n return /\\s/.test(text) ? JSON.stringify(text) : text;\n },\n};\n\nfunction formatLocalLogValue(value: unknown): string {\n return (localLogValueFormatters[typeof value] ?? JSON.stringify)(value);\n}\n\nfunction writeLocalReviewResult(result: LocalReviewResult, json: boolean): void {\n if (json) {\n console.log(JSON.stringify(localReviewJson(result), null, 2));\n return;\n }\n if (result.kind === \"skipped\") {\n console.log(`skipped: ${result.skipReason ?? \"no task matched\"}`);\n return;\n }\n console.log(formatLocalReview(result));\n}\n\nfunction formatLocalReview(result: Extract<LocalReviewResult, { kind: \"review\" }>): string {\n const mainComment = stripMainCommentMarker(result.mainComment);\n const inlineFindings = result.inlineCommentDrafts.map((draft, index) => {\n const range =\n draft.startLine === draft.endLine\n ? `${draft.path}:${draft.startLine}`\n : `${draft.path}:${draft.startLine}-${draft.endLine}`;\n return [\n `${index + 1}. ${range}`,\n `Range: ${draft.finding.rangeId ?? \"-\"}`,\n draft.finding.body,\n ].join(\"\\n\");\n });\n return inlineFindings.length === 0\n ? mainComment\n : [mainComment.trimEnd(), \"\", \"## Inline Findings\", \"\", inlineFindings.join(\"\\n\\n\")].join(\"\\n\");\n}\n\nfunction stripMainCommentMarker(comment: string): string {\n return comment\n .split(\"\\n\")\n .filter((line) => !line.startsWith(\"<!-- pipr:main-comment \"))\n .join(\"\\n\")\n .trimStart();\n}\n\nfunction localReviewJson(result: LocalReviewResult) {\n if (result.kind === \"skipped\") {\n return {\n kind: result.kind,\n skipReason: result.skipReason,\n mainComment: result.mainComment,\n inlineFindings: result.inlineCommentDrafts,\n droppedFindings: result.validated.droppedFindings,\n taskChecks: result.taskChecks,\n provider: result.provider,\n providerModels: result.publicationPlan.metadata.providerModels ?? [result.provider.model],\n repairAttempted: result.repairAttempted,\n };\n }\n return {\n kind: result.kind,\n mainComment: result.mainComment,\n inlineFindings: result.inlineCommentDrafts,\n droppedFindings: result.validated.droppedFindings,\n taskChecks: result.taskChecks,\n provider: result.provider,\n providerModels: result.publicationPlan.metadata.providerModels ?? [result.provider.model],\n repairAttempted: result.repairAttempted,\n };\n}\n\nasync function runDryRun(options: CliOptions): Promise<void> {\n if (!options.event) {\n throw new Error(\"dry-run requires --event <path>\");\n }\n const result = await runDryRunCommand({\n rootDir: process.cwd(),\n configDir: options.configDir,\n env: process.env,\n eventPath: options.event,\n });\n console.log(\n inspect(\n {\n configSource: result.configSource,\n event: result.event,\n },\n { depth: 6, colors: false },\n ),\n );\n}\n\nmain().catch((error: unknown) => {\n if (error instanceof PublicationError && error.result) {\n core.setOutput(\"publication\", JSON.stringify(error.result));\n core.error(`pipr publication metadata: ${JSON.stringify(error.result)}`);\n }\n const message = error instanceof Error ? error.message : String(error);\n core.setFailed(message);\n process.exitCode = 1;\n});\n"],"mappings":";;;;;;AAoCA,eAAe,OAAsB;CACnC,MAAM,UAAU,cAAc;CAC9B,IAAI,QAAQ,KAAK,UAAU,GAAG;EAC5B,QAAQ,WAAW;EACnB;CACF;CACA,MAAM,QAAQ,WAAW,QAAQ,IAAI;AACvC;AAEA,SAAS,gBAAyB;CAChC,MAAM,UAAU,IAAI,QAAQ;CAC5B,QAAQ,KAAK,MAAM,CAAC,CAAC,mBAAmB;CAExC,QACG,QAAQ,MAAM,CAAC,CACf,YAAY,mCAAmC,CAAC,CAChD,OAAO,sBAAsB,oBAAoB,OAAO,CAAC,CACzD,OACC,yBACA,2BAA2B,8BAA8B,KAAK,IAAI,EAAE,oCACtE,CAAC,CACA,OAAO,qBAAqB,mBAAmB,6BAA6B,KAAK,IAAI,EAAE,EAAE,CAAC,CAC1F,OAAO,cAAc,qCAAqC,CAAC,CAC3D,OAAO,gBAAgB,oDAAoD,CAAC,CAC5E,OAAO,WAAW,+BAA+B,CAAC,CAClD,OAAO,OAAO;CAEjB,QACG,QAAQ,QAAQ,CAAC,CACjB,YAAY,iCAAiC,CAAC,CAC9C,OAAO,sBAAsB,oBAAoB,OAAO,CAAC,CACzD,OAAO,SAAS;CAEnB,QACG,QAAQ,OAAO,CAAC,CAChB,YAAY,gDAAgD,CAAC,CAC7D,OAAO,sBAAsB,oB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B;CAClD,IAAI,OAAO,SAAS,WAClB,OAAO;EACL,MAAM,OAAO;EACb,YAAY,OAAO;EACnB,aAAa,OAAO;EACpB,gBAAgB,OAAO;EACvB,iBAAiB,OAAO,UAAU;EAClC,YAAY,OAAO;EACnB,UAAU,OAAO;EACjB,gBAAgB,OAAO,gBAAgB,SAAS,kBAAkB,CAAC,OAAO,SAAS,KAAK;EACxF,iBAAiB,OAAO;CAC1B;CAEF,OAAO;EACL,MAAM,OAAO;EACb,aAAa,OAAO;EACpB,gBAAgB,OAAO;EACvB,iBAAiB,OAAO,UAAU;EAClC,YAAY,OAAO;EACnB,UAAU,OAAO;EACjB,gBAAgB,OAAO,gBAAgB,SAAS,kBAAkB,CAAC,OAAO,SAAS,KAAK;EACxF,iBAAiB,OAAO;CAC1B;AACF;AAEA,eAAe,UAAU,SAAoC;CAC3D,IAAI,CAAC,QAAQ,OACX,MAAM,IAAI,MAAM,iCAAiC;CAEnD,MAAM,SAAS,MAAM,iBAAiB;EACpC,SAAS,QAAQ,IAAI;EACrB,WAAW,QAAQ;EACnB,KAAK,QAAQ;EACb,WAAW,QAAQ;CACrB,CAAC;CACD,QAAQ,IACN,QACE;EACE,cAAc,OAAO;EACrB,OAAO,OAAO;CAChB,GACA;EAAE,OAAO;EAAG,QAAQ;CAAM,CAC5B,CACF;AACF;AAEA,KAAK,CAAC,CAAC,OAAO,UAAmB;CAC/B,IAAI,iBAAiB,oBAAoB,MAAM,QAAQ;EACrD,KAAK,UAAU,eAAe,KAAK,UAAU,MAAM,MAAM,CAAC;EAC1D,KAAK,MAAM,8BAA8B,KAAK,UAAU,MAAM,MAAM,GAAG;CACzE;CACA,MAAM,UAAU,iBAAiB,QAAQ,MAAM,UAAU,OAAO,KAAK;CACrE,KAAK,UAAU,OAAO;CACtB,QAAQ,WAAW;AACrB,CAAC"}
1
+ {"version":3,"file":"main.mjs","names":[],"sources":["../src/main.ts"],"sourcesContent":["#!/usr/bin/env bun\nimport { inspect } from \"node:util\";\nimport * as core from \"@actions/core\";\nimport {\n type ActionCommandResult,\n type ActionLogRecord,\n type ActionLogSink,\n PublicationError,\n runActionCommand,\n runDryRunCommand,\n runInitCommand,\n runInspectCommand,\n runLocalReviewCommand,\n runValidateCommand,\n supportedOfficialInitAdapters,\n supportedOfficialInitRecipes,\n} from \"@usepipr/runtime\";\nimport { Command } from \"commander\";\n\ntype ActionOptions = Parameters<typeof runActionCommand>[0];\n\ntype CliOptions = {\n configDir: string;\n event?: string;\n force?: boolean;\n adapters?: string;\n recipe?: string;\n minimal?: boolean;\n requireEnv?: boolean;\n base?: string;\n head?: string;\n piExecutable?: string;\n json?: boolean;\n};\n\nasync function main(): Promise<void> {\n const program = createProgram();\n if (process.argv.length <= 2) {\n program.outputHelp();\n return;\n }\n await program.parseAsync(process.argv);\n}\n\nfunction createProgram(): Command {\n const program = new Command();\n program.name(\"pipr\").showHelpAfterError();\n\n program\n .command(\"init\")\n .description(\"Create editable TypeScript config\")\n .option(\"--config-dir <dir>\", \"Config directory\", \".pipr\")\n .option(\n \"--adapters <adapters>\",\n `Adapters to initialize (${supportedOfficialInitAdapters.join(\", \")}; use 'none' to skip adapter files)`,\n )\n .option(\"--recipe <recipe>\", `Starter recipe (${supportedOfficialInitRecipes.join(\", \")})`)\n .option(\"--minimal\", \"Scaffold a single-file .pipr/config.ts without package.json\")\n .option(\"--force\", \"Overwrite existing pipr files\")\n .action(runInit);\n\n program\n .command(\"action\")\n .description(\"Run inside GitHub Docker Action\")\n .option(\"--config-dir <dir>\", \"Config directory\", \".pipr\")\n .action(runAction);\n\n program\n .command(\"check\")\n .description(\"Type-load config and validate the runtime plan\")\n .option(\"--config-dir <dir>\", \"Config directory\", \".pipr\")\n .option(\"--require-env\", \"Require configured provider env vars\")\n .action(runCheck);\n\n program\n .command(\"dry-run\")\n .description(\"Load config and event without publishing\")\n .requiredOption(\"--event <path>\", \"GitHub event JSON path\")\n .option(\"--config-dir <dir>\", \"Config directory\", \".pipr\")\n .action(runDryRun);\n\n program\n .command(\"inspect\")\n .description(\"Print models, agents, tasks, commands, and tools\")\n .option(\"--config-dir <dir>\", \"Config directory\", \".pipr\")\n .action(runInspect);\n\n program\n .command(\"review\")\n .description(\"Run configured change-request review tasks locally without publishing\")\n .option(\"--base <sha>\", \"Base commit SHA\")\n .option(\"--head <sha>\", \"Head commit SHA or ref; omitted reviews the working tree\")\n .option(\"--config-dir <dir>\", \"Config directory\", \".pipr\")\n .option(\"--pi-executable <path>\", \"Pi executable path\")\n .option(\"--json\", \"Print structured JSON output\")\n .action(runLocalReview);\n\n return program;\n}\n\nasync function runAction(options: CliOptions): Promise<void> {\n writeActionResult(await runActionCommand(actionOptions(options)));\n}\n\nfunction actionOptions(options: CliOptions): ActionOptions {\n const eventPath = process.env.GITHUB_EVENT_PATH;\n if (!eventPath) {\n throw new Error(\"GITHUB_EVENT_PATH is required for pipr action\");\n }\n return {\n rootDir: process.env.GITHUB_WORKSPACE ?? process.cwd(),\n configDir: process.env[\"INPUT_CONFIG-DIR\"] || options.configDir,\n env: process.env,\n eventPath,\n dryRun: process.env.PIPR_DRY_RUN === \"1\",\n logSink: githubActionsLogSink,\n };\n}\n\nconst githubActionsLogSink: ActionLogSink = {\n log(record) {\n githubActionLogWriters[record.level](formatGitHubActionLogRecord(record));\n },\n async group(name, run) {\n return await core.group(name, run);\n },\n};\n\nconst githubActionLogWriters = {\n info: core.info,\n notice: core.notice,\n warning: core.warning,\n error: core.error,\n debug: core.debug,\n} satisfies Record<ActionLogRecord[\"level\"], (message: string) => void>;\n\nfunction formatGitHubActionLogRecord(record: ActionLogRecord): string {\n const line = JSON.stringify({\n level: record.level,\n event: record.event,\n ...record.fields,\n });\n return record.text === undefined ? line : `${line}\\n${record.text}`;\n}\n\nfunction writeActionResult(result: ActionCommandResult): void {\n if (result.kind === \"ignored\") {\n core.info(`pipr ignored event: ${result.reason}`);\n return;\n }\n writeLoadedActionResult(result);\n}\n\ntype LoadedActionResult = Exclude<ActionCommandResult, { kind: \"ignored\" }>;\ntype PublishedActionResult = Exclude<LoadedActionResult, { kind: \"dry-run\" }>;\ntype CommandActionResult = Extract<\n PublishedActionResult,\n { kind: \"command-help\" | \"command-response\" }\n>;\ntype ReviewWorkflowActionResult = Exclude<PublishedActionResult, CommandActionResult>;\n\nfunction writeLoadedActionResult(result: LoadedActionResult): void {\n core.info(\n `pipr loaded change #${result.event.change.number} for ${result.event.repository.slug}`,\n );\n core.info(`pipr config source: ${result.configSource}`);\n if (result.kind === \"dry-run\") {\n writeDryRunActionResult(result);\n return;\n }\n writePublishedActionResult(result);\n}\n\nfunction writePublishedActionResult(result: PublishedActionResult): void {\n if (result.kind === \"command-help\" || result.kind === \"command-response\") {\n writeCommandActionResult(result);\n return;\n }\n writeReviewWorkflowActionResult(result);\n}\n\nfunction writeCommandActionResult(result: CommandActionResult): void {\n switch (result.kind) {\n case \"command-help\":\n writeCommandHelpActionResult(result);\n break;\n case \"command-response\":\n writeCommandResponseActionResult(result);\n break;\n default:\n result satisfies never;\n }\n}\n\nfunction writeReviewWorkflowActionResult(result: ReviewWorkflowActionResult): void {\n switch (result.kind) {\n case \"review\":\n writeReviewActionResult(result);\n break;\n case \"verifier\":\n writeVerifierActionResult(result);\n break;\n default:\n result satisfies never;\n }\n}\n\nfunction writeDryRunActionResult(result: Extract<ActionCommandResult, { kind: \"dry-run\" }>): void {\n void result;\n core.info(\"PIPR_DRY_RUN=1; stopping before review runtime, model, or GitHub publishing calls\");\n}\n\nfunction writeCommandHelpActionResult(\n result: Extract<ActionCommandResult, { kind: \"command-help\" }>,\n): void {\n core.info(`pipr command help: ${result.reason}`);\n core.setOutput(\"main-comment\", result.body);\n}\n\nfunction writeCommandResponseActionResult(\n result: Extract<ActionCommandResult, { kind: \"command-response\" }>,\n): void {\n core.info(\n `pipr command '${result.command}' published response comment (${result.publication.action})`,\n );\n core.setOutput(\"main-comment\", result.response.body);\n core.setOutput(\"publication\", JSON.stringify(result.publication));\n}\n\nfunction writeVerifierActionResult(\n result: Extract<ActionCommandResult, { kind: \"verifier\" }>,\n): void {\n core.info(\n `pipr verifier processed review comment reply with ${result.errors.length} publication error(s)`,\n );\n warnInlineResolutionErrors(result.errors);\n core.setOutput(\"publication\", JSON.stringify({ inlineResolutionErrors: result.errors }));\n}\n\nfunction writeReviewActionResult(result: Extract<ActionCommandResult, { kind: \"review\" }>): void {\n core.info(\n `pipr review produced ${result.review.validated.validFindings.length} valid inline finding(s), ` +\n `${result.review.validated.droppedFindings.length} dropped finding(s)`,\n );\n core.info(\n `pipr published main comment (${result.publication.mainComment.action}) and ` +\n `${result.publication.inlineComments.posted} inline comment(s); ` +\n `${result.publication.inlineComments.skipped} skipped`,\n );\n warnInlineResolutionErrors(result.publication.metadata.inlineResolutionErrors);\n if (result.review.repairAttempted) {\n core.info(\"pipr repaired reviewer JSON once before validation\");\n }\n core.setOutput(\"main-comment\", result.review.mainComment);\n core.setOutput(\"inline-comments\", JSON.stringify(result.review.inlineCommentDrafts));\n core.setOutput(\"dropped-findings\", JSON.stringify(result.review.validated.droppedFindings));\n core.setOutput(\"publication\", JSON.stringify(result.publication));\n}\n\nfunction warnInlineResolutionErrors(errors: string[]): void {\n for (const error of errors) {\n core.warning(`pipr inline resolution failed: ${error}`);\n }\n}\n\nasync function runInit(options: CliOptions): Promise<void> {\n const result = await runInitCommand({\n rootDir: process.cwd(),\n configDir: options.configDir,\n force: options.force === true,\n adapters: parseInitAdapters(options.adapters),\n recipe: options.recipe,\n minimal: options.minimal === true,\n });\n console.log(\n `created ${result.created.length} file(s)` +\n (result.overwritten.length > 0 ? `; overwrote ${result.overwritten.length}` : \"\"),\n );\n if (options.minimal === true) {\n console.log(\n \"For editor types, install @usepipr/sdk at the repo root: npm install -D @usepipr/sdk\",\n );\n }\n}\n\nfunction parseInitAdapters(adapters: string | undefined): string[] | undefined {\n return adapters?.split(\",\").map((adapter) => adapter.trim());\n}\n\nasync function runCheck(options: CliOptions): Promise<void> {\n const settings = await runValidateCommand({\n rootDir: process.cwd(),\n configDir: options.configDir,\n env: process.env,\n requireProviderEnv: options.requireEnv === true,\n });\n console.log(`valid: ${settings.source}`);\n for (const warning of settings.warnings) {\n console.log(`warning: ${warning}`);\n }\n}\n\nasync function runInspect(options: CliOptions): Promise<void> {\n const result = await runInspectCommand({\n rootDir: process.cwd(),\n configDir: options.configDir,\n env: process.env,\n });\n console.log(inspect(result, { depth: 8, colors: false }));\n}\n\nasync function runLocalReview(options: CliOptions): Promise<void> {\n if (!options.base) {\n throw new Error(\"pipr review requires --base <sha>\");\n }\n const result = await runLocalReviewCommand({\n rootDir: process.cwd(),\n configDir: options.configDir,\n env: process.env,\n baseSha: options.base,\n headSha: options.head,\n piExecutable: options.piExecutable,\n logSink: localConsoleLogSink,\n taskLog: stderrTaskLog,\n });\n writeLocalReviewResult(result, options.json === true);\n}\n\ntype LocalReviewResult = Awaited<ReturnType<typeof runLocalReviewCommand>>;\n\nconst stderrTaskLog = {\n info(message: string) {\n console.error(`[info] ${message}`);\n },\n warn(message: string) {\n console.error(`[warn] ${message}`);\n },\n error(message: string) {\n console.error(`[error] ${message}`);\n },\n};\n\nconst localConsoleLogSink: ActionLogSink = {\n log(record) {\n console.error(formatLocalLogRecord(record));\n },\n async group(_name, run) {\n return await run();\n },\n};\n\nfunction formatLocalLogRecord(record: ActionLogRecord): string {\n const fields = Object.entries(record.fields)\n .map(([key, value]) => formatLocalLogField(key, value))\n .filter((field): field is string => field !== undefined);\n const prefix = formatLocalLogPrefix(record);\n const formatted = [...prefix, ...fields].join(\" \");\n return record.text === undefined ? formatted : `${formatted}\\n${record.text}`;\n}\n\nfunction formatLocalLogPrefix(record: ActionLogRecord): string[] {\n return [\"pipr\", localLogPlainLevels.has(record.level) ? \"\" : record.level, record.event].filter(\n Boolean,\n );\n}\n\nconst localLogNumberFields: Record<string, (value: number) => string> = {\n additions: (value) => `+${value}`,\n deletions: (value) => `-${value}`,\n durationMs: (value) =>\n `duration=${value < 1000 ? `${value}ms` : `${(value / 1000).toFixed(1)}s`}`,\n promptBytes: (value) => `prompt=${value}B`,\n stderrBytes: (value) => `stderr=${value}B`,\n stdoutBytes: (value) => `stdout=${value}B`,\n};\n\nconst localLogPlainLevels = new Set([\"info\", \"notice\"]);\n\nfunction formatLocalLogField(key: string, value: unknown): string | undefined {\n if (value == null) {\n return undefined;\n }\n\n return formatLocalLogFieldValue(key, value);\n}\n\nfunction formatLocalLogFieldValue(key: string, value: unknown): string {\n const formattedNumber =\n typeof value === \"number\" ? localLogNumberFields[key]?.(value) : undefined;\n return formattedNumber ?? `${key}=${formatLocalLogValue(value)}`;\n}\n\nconst localLogValueFormatters: Record<string, (value: unknown) => string> = {\n boolean: String,\n number: String,\n object: (value) =>\n Array.isArray(value)\n ? value.length === 0\n ? \"-\"\n : value.map(formatLocalLogValue).join(\",\")\n : JSON.stringify(value),\n string: (value) => {\n const text = String(value);\n return /\\s/.test(text) ? JSON.stringify(text) : text;\n },\n};\n\nfunction formatLocalLogValue(value: unknown): string {\n return (localLogValueFormatters[typeof value] ?? JSON.stringify)(value);\n}\n\nfunction writeLocalReviewResult(result: LocalReviewResult, json: boolean): void {\n if (json) {\n console.log(JSON.stringify(localReviewJson(result), null, 2));\n return;\n }\n if (result.kind === \"skipped\") {\n console.log(`skipped: ${result.skipReason ?? \"no task matched\"}`);\n return;\n }\n console.log(formatLocalReview(result));\n}\n\nfunction formatLocalReview(result: Extract<LocalReviewResult, { kind: \"review\" }>): string {\n const mainComment = stripMainCommentMarker(result.mainComment);\n const inlineFindings = result.inlineCommentDrafts.map((draft, index) => {\n const range =\n draft.startLine === draft.endLine\n ? `${draft.path}:${draft.startLine}`\n : `${draft.path}:${draft.startLine}-${draft.endLine}`;\n return [\n `${index + 1}. ${range}`,\n `Range: ${draft.finding.rangeId ?? \"-\"}`,\n draft.finding.body,\n ].join(\"\\n\");\n });\n return inlineFindings.length === 0\n ? mainComment\n : [mainComment.trimEnd(), \"\", \"## Inline Findings\", \"\", inlineFindings.join(\"\\n\\n\")].join(\"\\n\");\n}\n\nfunction stripMainCommentMarker(comment: string): string {\n return comment\n .split(\"\\n\")\n .filter((line) => !line.startsWith(\"<!-- pipr:main-comment \"))\n .join(\"\\n\")\n .trimStart();\n}\n\nfunction localReviewJson(result: LocalReviewResult) {\n return {\n kind: result.kind,\n ...(result.kind === \"skipped\" ? { skipReason: result.skipReason } : {}),\n mainComment: result.mainComment,\n inlineFindings: result.inlineCommentDrafts,\n droppedFindings: result.validated.droppedFindings,\n taskChecks: result.taskChecks,\n provider: result.provider,\n providerModels: result.publicationPlan.metadata.providerModels ?? [result.provider.model],\n repairAttempted: result.repairAttempted,\n };\n}\n\nasync function runDryRun(options: CliOptions): Promise<void> {\n if (!options.event) {\n throw new Error(\"dry-run requires --event <path>\");\n }\n const result = await runDryRunCommand({\n rootDir: process.cwd(),\n configDir: options.configDir,\n env: process.env,\n eventPath: options.event,\n });\n console.log(\n inspect(\n {\n configSource: result.configSource,\n event: result.event,\n },\n { depth: 6, colors: false },\n ),\n );\n}\n\nmain().catch((error: unknown) => {\n if (error instanceof PublicationError && error.result) {\n core.setOutput(\"publication\", JSON.stringify(error.result));\n core.error(`pipr publication metadata: ${JSON.stringify(error.result)}`);\n }\n const message = error instanceof Error ? error.message : String(error);\n core.setFailed(message);\n process.exitCode = 1;\n});\n"],"mappings":";;;;;;AAmCA,eAAe,OAAsB;CACnC,MAAM,UAAU,cAAc;CAC9B,IAAI,QAAQ,KAAK,UAAU,GAAG;EAC5B,QAAQ,WAAW;EACnB;CACF;CACA,MAAM,QAAQ,WAAW,QAAQ,IAAI;AACvC;AAEA,SAAS,gBAAyB;CAChC,MAAM,UAAU,IAAI,QAAQ;CAC5B,QAAQ,KAAK,MAAM,CAAC,CAAC,mBAAmB;CAExC,QACG,QAAQ,MAAM,CAAC,CACf,YAAY,mCAAmC,CAAC,CAChD,OAAO,sBAAsB,oBAAoB,OAAO,CAAC,CACzD,OACC,yBACA,2BAA2B,8BAA8B,KAAK,IAAI,EAAE,oCACtE,CAAC,CACA,OA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AAK,MAAM,8BAA8B,KAAK,UAAU,MAAM,MAAM,GAAG;CACzE;CACA,MAAM,UAAU,iBAAiB,QAAQ,MAAM,UAAU,OAAO,KAAK;CACrE,KAAK,UAAU,OAAO;CACtB,QAAQ,WAAW;AACrB,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@usepipr/cli",
3
- "version": "0.1.3",
3
+ "version": "0.2.0",
4
4
  "description": "Command line interface for pipr pull request review automation",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -33,8 +33,8 @@
33
33
  },
34
34
  "dependencies": {
35
35
  "@actions/core": "3.0.1",
36
- "@usepipr/runtime": "0.1.3",
37
- "@usepipr/sdk": "0.1.3",
36
+ "@usepipr/runtime": "0.2.0",
37
+ "@usepipr/sdk": "0.2.0",
38
38
  "commander": "15.0.0"
39
39
  }
40
40
  }