@ondrej-svec/hog 1.18.0 → 1.19.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/cli.js CHANGED
@@ -175,7 +175,8 @@ var init_config = __esm({
175
175
  localPath: z.string().refine((p) => isAbsolute(p), { message: "localPath must be an absolute path" }).refine((p) => normalize(p) === p, {
176
176
  message: "localPath must be normalized (no .. segments)"
177
177
  }).refine((p) => !p.includes("\0"), { message: "localPath must not contain null bytes" }).optional(),
178
- claudeStartCommand: CLAUDE_START_COMMAND_SCHEMA.optional()
178
+ claudeStartCommand: CLAUDE_START_COMMAND_SCHEMA.optional(),
179
+ claudePrompt: z.string().optional()
179
180
  });
180
181
  BOARD_CONFIG_SCHEMA = z.object({
181
182
  refreshInterval: z.number().int().min(10).default(60),
@@ -183,6 +184,7 @@ var init_config = __esm({
183
184
  assignee: z.string().min(1),
184
185
  focusDuration: z.number().int().min(60).default(1500),
185
186
  claudeStartCommand: CLAUDE_START_COMMAND_SCHEMA.optional(),
187
+ claudePrompt: z.string().optional(),
186
188
  claudeLaunchMode: z.enum(["auto", "tmux", "terminal"]).optional(),
187
189
  claudeTerminalApp: z.enum(["Terminal", "iTerm", "Ghostty", "WezTerm", "Kitty", "Alacritty"]).optional()
188
190
  });
@@ -2867,9 +2869,12 @@ __export(launch_claude_exports, {
2867
2869
  });
2868
2870
  import { spawn, spawnSync } from "child_process";
2869
2871
  import { existsSync as existsSync5 } from "fs";
2870
- function buildPrompt(issue) {
2871
- return `Issue #${issue.number}: ${issue.title}
2872
+ function buildPrompt(issue, template) {
2873
+ if (!template) {
2874
+ return `Issue #${issue.number}: ${issue.title}
2872
2875
  URL: ${issue.url}`;
2876
+ }
2877
+ return template.replace(/\{number\}/g, String(issue.number)).replace(/\{title\}/g, issue.title).replace(/\{url\}/g, issue.url);
2873
2878
  }
2874
2879
  function isClaudeInPath() {
2875
2880
  const result = spawnSync("which", ["claude"], { stdio: "pipe" });
@@ -2891,7 +2896,7 @@ function resolveCommand(opts) {
2891
2896
  function launchViaTmux(opts) {
2892
2897
  const { localPath, issue, repoFullName } = opts;
2893
2898
  const { command, extraArgs } = resolveCommand(opts);
2894
- const prompt = buildPrompt(issue);
2899
+ const prompt = buildPrompt(issue, opts.promptTemplate);
2895
2900
  const windowName = `claude-${issue.number}`;
2896
2901
  const tmuxArgs = [
2897
2902
  "new-window",
@@ -2914,7 +2919,7 @@ function launchViaTmux(opts) {
2914
2919
  function launchViaTerminalApp(terminalApp, opts) {
2915
2920
  const { localPath, issue } = opts;
2916
2921
  const { command, extraArgs } = resolveCommand(opts);
2917
- const prompt = buildPrompt(issue);
2922
+ const prompt = buildPrompt(issue, opts.promptTemplate);
2918
2923
  const fullCmd = [command, ...extraArgs, "--", prompt].join(" ");
2919
2924
  switch (terminalApp) {
2920
2925
  case "iTerm": {
@@ -3015,7 +3020,7 @@ function launchViaDetectedTerminal(opts) {
3015
3020
  }
3016
3021
  const { localPath, issue } = opts;
3017
3022
  const { command, extraArgs } = resolveCommand(opts);
3018
- const prompt = buildPrompt(issue);
3023
+ const prompt = buildPrompt(issue, opts.promptTemplate);
3019
3024
  const child = spawn(
3020
3025
  "xdg-terminal-exec",
3021
3026
  ["bash", "-c", `cd ${localPath} && ${[command, ...extraArgs, "--", prompt].join(" ")}`],
@@ -5993,10 +5998,12 @@ function Dashboard({ config: config2, options, activeProfile }) {
5993
5998
  return;
5994
5999
  }
5995
6000
  const resolvedStartCommand = rc.claudeStartCommand ?? config2.board.claudeStartCommand;
6001
+ const resolvedPromptTemplate = rc.claudePrompt ?? config2.board.claudePrompt;
5996
6002
  const result = launchClaude({
5997
6003
  localPath: rc.localPath,
5998
6004
  issue: { number: found.issue.number, title: found.issue.title, url: found.issue.url },
5999
6005
  ...resolvedStartCommand ? { startCommand: resolvedStartCommand } : {},
6006
+ ...resolvedPromptTemplate ? { promptTemplate: resolvedPromptTemplate } : {},
6000
6007
  launchMode: config2.board.claudeLaunchMode ?? "auto",
6001
6008
  ...config2.board.claudeTerminalApp ? { terminalApp: config2.board.claudeTerminalApp } : {},
6002
6009
  repoFullName: found.repoName
@@ -7687,7 +7694,7 @@ function resolveProjectId(projectId) {
7687
7694
  process.exit(1);
7688
7695
  }
7689
7696
  var program = new Command();
7690
- program.name("hog").description("Personal command deck \u2014 unified task dashboard for GitHub Projects + TickTick").version("1.18.0").option("--json", "Force JSON output").option("--human", "Force human-readable output").hook("preAction", (thisCommand) => {
7697
+ program.name("hog").description("Personal command deck \u2014 unified task dashboard for GitHub Projects + TickTick").version("1.19.0").option("--json", "Force JSON output").option("--human", "Force human-readable output").hook("preAction", (thisCommand) => {
7691
7698
  const opts = thisCommand.opts();
7692
7699
  if (opts.json) setFormat("json");
7693
7700
  if (opts.human) setFormat("human");