automata-cli 0.4.0 → 0.5.0-develop.181

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/README.md CHANGED
@@ -115,11 +115,12 @@ See [docs/execute.md](docs/execute.md) for full details.
115
115
 
116
116
  ## `automata execute-prompt`
117
117
 
118
- Run predefined AI workflows that gather context from the current branch before invoking Claude or Codex.
118
+ Run predefined AI workflows that gather context from the current branch's PR — or from a GitHub issue's conversation — before invoking Claude or Codex.
119
119
 
120
120
  ```bash
121
121
  automata execute-prompt sonar --with claude
122
122
  automata execute-prompt fix-comments --with codex --model o3
123
+ automata execute-prompt check-issue 34 --with claude
123
124
  ```
124
125
 
125
126
  See [docs/execute-prompt.md](docs/execute-prompt.md) for full details.
@@ -1,11 +1,12 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
+ DEFAULT_CHECK_ISSUE_PROMPT,
3
4
  DEFAULT_FIX_COMMENTS_PROMPT,
4
5
  DEFAULT_SONAR_PROMPT,
5
6
  readConfig,
6
7
  readRawConfig,
7
8
  writeConfig
8
- } from "./chunk-LAIP3B6F.js";
9
+ } from "./chunk-OLM47VIK.js";
9
10
 
10
11
  // src/config/ConfigWizard.tsx
11
12
  import { useState } from "react";
@@ -27,8 +28,11 @@ var TECHNIQUE_OPTIONS = [
27
28
  { label: "By Assignee", value: "assignee" },
28
29
  { label: "By Title Contains", value: "title-contains" }
29
30
  ];
30
- var MAIN_MENU_OPTIONS = ["Remote / Mode", "Implement-Next", "Prompts"];
31
- var PROMPTS_MENU_OPTIONS = ["Sonar", "Fix-Comments"];
31
+ var MAIN_MENU_OPTIONS = ["Remote / Mode", "Implement-Next", "Prompts", "Issue Watch"];
32
+ var PROMPTS_MENU_OPTIONS = ["Sonar", "Fix-Comments", "Check-Issue"];
33
+ function parseAllowedUsers(value) {
34
+ return value.split(",").map((user) => user.trim()).filter((user) => user.length > 0);
35
+ }
32
36
  function ConfigWizard() {
33
37
  const existing = readConfig();
34
38
  const rawExisting = readRawConfig();
@@ -45,6 +49,9 @@ function ConfigWizard() {
45
49
  const [fixCommentsPrompt, setFixCommentsPrompt] = useState(
46
50
  existing.prompts?.fixComments ?? DEFAULT_FIX_COMMENTS_PROMPT
47
51
  );
52
+ const [checkIssuePrompt, setCheckIssuePrompt] = useState(existing.prompts?.checkIssue ?? DEFAULT_CHECK_ISSUE_PROMPT);
53
+ const [allowedUsers, setAllowedUsers] = useState((existing.allowedUsers ?? []).join(", "));
54
+ const [agentUser, setAgentUser] = useState(existing.agentUser ?? "");
48
55
  const [pendingRemote, setPendingRemote] = useState(existing.remoteType ?? "gh");
49
56
  const [pendingTechnique, setPendingTechnique] = useState(
50
57
  existing.issueDiscoveryTechnique ?? "label"
@@ -62,6 +69,8 @@ function ConfigWizard() {
62
69
  setScreen("remote");
63
70
  } else if (chosen === "Implement-Next") {
64
71
  setScreen("technique");
72
+ } else if (chosen === "Issue Watch") {
73
+ setScreen("allowed-users");
65
74
  } else {
66
75
  setScreen("prompts-menu");
67
76
  }
@@ -146,8 +155,10 @@ function ConfigWizard() {
146
155
  const chosen = PROMPTS_MENU_OPTIONS[promptsMenuIndex];
147
156
  if (chosen === "Sonar") {
148
157
  setScreen("sonar-prompt");
149
- } else {
158
+ } else if (chosen === "Fix-Comments") {
150
159
  setScreen("fix-comments-prompt");
160
+ } else {
161
+ setScreen("check-issue-prompt");
151
162
  }
152
163
  } else if (key.escape) {
153
164
  setScreen("main");
@@ -198,6 +209,59 @@ function ConfigWizard() {
198
209
  } else if (input && !key.ctrl && !key.meta) {
199
210
  setFixCommentsPrompt((v) => v + input);
200
211
  }
212
+ } else if (screen === "check-issue-prompt") {
213
+ if (key.return) {
214
+ let checkIssueValue;
215
+ if (checkIssuePrompt) {
216
+ writePromptFile("check-issue-prompt.md", checkIssuePrompt);
217
+ checkIssueValue = "check-issue-prompt.md";
218
+ }
219
+ const current = readRawConfig();
220
+ writeConfig({
221
+ ...current,
222
+ prompts: { ...current.prompts, checkIssue: checkIssueValue }
223
+ });
224
+ setScreen("prompts-menu");
225
+ } else if (key.backspace || key.delete) {
226
+ setCheckIssuePrompt((v) => v.slice(0, -1));
227
+ } else if (key.escape) {
228
+ setScreen("prompts-menu");
229
+ } else if (key.ctrl && input === "c") {
230
+ exit();
231
+ } else if (input && !key.ctrl && !key.meta) {
232
+ setCheckIssuePrompt((v) => v + input);
233
+ }
234
+ } else if (screen === "allowed-users") {
235
+ if (key.return) {
236
+ setScreen("agent-user");
237
+ } else if (key.backspace || key.delete) {
238
+ setAllowedUsers((v) => v.slice(0, -1));
239
+ } else if (key.escape) {
240
+ setScreen("main");
241
+ } else if (key.ctrl && input === "c") {
242
+ exit();
243
+ } else if (input && !key.ctrl && !key.meta) {
244
+ setAllowedUsers((v) => v + input);
245
+ }
246
+ } else if (screen === "agent-user") {
247
+ if (key.return) {
248
+ const parsedUsers = parseAllowedUsers(allowedUsers);
249
+ const current = readRawConfig();
250
+ writeConfig({
251
+ ...current,
252
+ allowedUsers: parsedUsers.length > 0 ? parsedUsers : void 0,
253
+ agentUser: agentUser.trim() || void 0
254
+ });
255
+ exit();
256
+ } else if (key.backspace || key.delete) {
257
+ setAgentUser((v) => v.slice(0, -1));
258
+ } else if (key.escape) {
259
+ setScreen("allowed-users");
260
+ } else if (key.ctrl && input === "c") {
261
+ exit();
262
+ } else if (input && !key.ctrl && !key.meta) {
263
+ setAgentUser((v) => v + input);
264
+ }
201
265
  }
202
266
  });
203
267
  if (screen === "main") {
@@ -300,6 +364,54 @@ function ConfigWizard() {
300
364
  /* @__PURE__ */ jsx(Text, { dimColor: true, children: "Type prompt \xB7 Enter to save \xB7 Esc to go back \xB7 Ctrl+C to cancel" })
301
365
  ] });
302
366
  }
367
+ if (screen === "check-issue-prompt") {
368
+ return /* @__PURE__ */ jsxs(Box, { flexDirection: "column", marginY: 1, children: [
369
+ /* @__PURE__ */ jsx(Text, { bold: true, children: "Prompts \u2014 Check-Issue" }),
370
+ /* @__PURE__ */ jsx(Text, { children: " " }),
371
+ /* @__PURE__ */ jsxs(Text, { children: [
372
+ "Check-Issue prompt:",
373
+ " ",
374
+ /* @__PURE__ */ jsxs(Text, { color: "cyan", children: [
375
+ checkIssuePrompt,
376
+ /* @__PURE__ */ jsx(Text, { children: "_" })
377
+ ] })
378
+ ] }),
379
+ /* @__PURE__ */ jsx(Text, { children: " " }),
380
+ /* @__PURE__ */ jsx(Text, { dimColor: true, children: "Type prompt \xB7 Enter to save \xB7 Esc to go back \xB7 Ctrl+C to cancel" })
381
+ ] });
382
+ }
383
+ if (screen === "allowed-users") {
384
+ return /* @__PURE__ */ jsxs(Box, { flexDirection: "column", marginY: 1, children: [
385
+ /* @__PURE__ */ jsx(Text, { bold: true, children: "Issue Watch \u2014 Allowed Users" }),
386
+ /* @__PURE__ */ jsx(Text, { children: " " }),
387
+ /* @__PURE__ */ jsxs(Text, { children: [
388
+ "Logins allowed to instruct the agent (comma separated):",
389
+ " ",
390
+ /* @__PURE__ */ jsxs(Text, { color: "cyan", children: [
391
+ allowedUsers,
392
+ /* @__PURE__ */ jsx(Text, { children: "_" })
393
+ ] })
394
+ ] }),
395
+ /* @__PURE__ */ jsx(Text, { children: " " }),
396
+ /* @__PURE__ */ jsx(Text, { dimColor: true, children: "Type logins \xB7 Enter to continue \xB7 Esc to go back \xB7 Ctrl+C to cancel" })
397
+ ] });
398
+ }
399
+ if (screen === "agent-user") {
400
+ return /* @__PURE__ */ jsxs(Box, { flexDirection: "column", marginY: 1, children: [
401
+ /* @__PURE__ */ jsx(Text, { bold: true, children: "Issue Watch \u2014 Agent User" }),
402
+ /* @__PURE__ */ jsx(Text, { children: " " }),
403
+ /* @__PURE__ */ jsxs(Text, { children: [
404
+ "Login the agent posts as:",
405
+ " ",
406
+ /* @__PURE__ */ jsxs(Text, { color: "cyan", children: [
407
+ agentUser,
408
+ /* @__PURE__ */ jsx(Text, { children: "_" })
409
+ ] })
410
+ ] }),
411
+ /* @__PURE__ */ jsx(Text, { children: " " }),
412
+ /* @__PURE__ */ jsx(Text, { dimColor: true, children: "Type login \xB7 Enter to save and exit \xB7 Esc to go back \xB7 Ctrl+C to cancel" })
413
+ ] });
414
+ }
303
415
  return /* @__PURE__ */ jsxs(Box, { flexDirection: "column", marginY: 1, children: [
304
416
  /* @__PURE__ */ jsx(Text, { bold: true, children: "Prompts \u2014 Fix-Comments" }),
305
417
  /* @__PURE__ */ jsx(Text, { children: " " }),
@@ -6,6 +6,7 @@ import { join, resolve, sep } from "path";
6
6
  var DEFAULT_CLAUDE_SYSTEM_PROMPT = "You are an expert software engineer. Implement the following issue according to the project's existing conventions and style. Make minimal, targeted changes that satisfy the requirements. Run tests and linting before finishing.";
7
7
  var DEFAULT_FIX_COMMENTS_PROMPT = "You are an expert software engineer reviewing a pull request. Below are the open review comments left by reviewers on this PR. Please address each comment by making the appropriate code changes. Focus on the reviewer's concerns and make minimal, targeted changes that resolve each comment without altering unrelated code.";
8
8
  var DEFAULT_SONAR_PROMPT = "You are an expert software engineer. You have been given the URL of a SonarCloud analysis for this pull request. If the `sonar-quality-gate` skill is available in this repository, use it. The project is public, so use the SonarCloud REST API directly (no authentication required) rather than scraping the URL. Inspect both the quality gate and the list of issues for this pull request. If the quality gate fails because of duplication or another metric-based condition, use the relevant Sonar APIs to identify the affected files and details instead of relying only on the issues endpoint. Fix all new issues and quality-gate failures reported. Focus on code smells, bugs, vulnerabilities, and blocking quality-gate conditions flagged in this PR. Make targeted, minimal changes that resolve each issue without altering unrelated code.";
9
+ var DEFAULT_CHECK_ISSUE_PROMPT = "You are an expert software engineer working on a GitHub issue. Below is the conversation on that issue, restricted to the people allowed to instruct you and your own previous replies. Messages marked as new arrived after your last run: treat them as the current instruction and read the earlier messages only as context. Do what the new messages ask, following the project's existing conventions and style, and make minimal, targeted changes. Run tests and linting before finishing, then reply on the issue with a short summary of what you did.";
9
10
  var CONFIG_DIR = ".automata";
10
11
  var CONFIG_FILE = "config.json";
11
12
  function configPath() {
@@ -62,6 +63,9 @@ function readConfig() {
62
63
  if (config.prompts?.fixComments) {
63
64
  config.prompts.fixComments = resolvePromptRef(config.prompts.fixComments, dir);
64
65
  }
66
+ if (config.prompts?.checkIssue) {
67
+ config.prompts.checkIssue = resolvePromptRef(config.prompts.checkIssue, dir);
68
+ }
65
69
  return config;
66
70
  }
67
71
  function writeConfig(config) {
@@ -74,6 +78,7 @@ export {
74
78
  DEFAULT_CLAUDE_SYSTEM_PROMPT,
75
79
  DEFAULT_FIX_COMMENTS_PROMPT,
76
80
  DEFAULT_SONAR_PROMPT,
81
+ DEFAULT_CHECK_ISSUE_PROMPT,
77
82
  readRawConfig,
78
83
  readConfig,
79
84
  writeConfig
package/dist/index.js CHANGED
@@ -1,12 +1,13 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
+ DEFAULT_CHECK_ISSUE_PROMPT,
3
4
  DEFAULT_CLAUDE_SYSTEM_PROMPT,
4
5
  DEFAULT_FIX_COMMENTS_PROMPT,
5
6
  DEFAULT_SONAR_PROMPT,
6
7
  readConfig,
7
8
  readRawConfig,
8
9
  writeConfig
9
- } from "./chunk-LAIP3B6F.js";
10
+ } from "./chunk-OLM47VIK.js";
10
11
 
11
12
  // src/index.ts
12
13
  import { Command as Command6 } from "commander";
@@ -57,12 +58,34 @@ var configSetClaudeSystemPrompt = new Command("claude-system-prompt").descriptio
57
58
  process.stdout.write(`Claude system prompt set.
58
59
  `);
59
60
  });
60
- var configSet = new Command("set").description("Set a configuration value").addCommand(configSetType).addCommand(configSetIssueDiscoveryTechnique).addCommand(configSetIssueDiscoveryValue).addCommand(configSetClaudeSystemPrompt);
61
+ var configSetAllowedUsers = new Command("allowed-users").description("Set the comma-separated list of users allowed to instruct the agent on an issue").argument("<value>", "Comma-separated GitHub logins, e.g. alice,bob").action((value) => {
62
+ const users = value.split(",").map((user) => user.trim()).filter((user) => user.length > 0);
63
+ if (users.length === 0) {
64
+ process.stderr.write("Error: allowed-users requires at least one login.\n");
65
+ process.exit(1);
66
+ }
67
+ const current = readRawConfig();
68
+ writeConfig({ ...current, allowedUsers: users });
69
+ process.stdout.write(`Allowed users set to: ${users.join(", ")}
70
+ `);
71
+ });
72
+ var configSetAgentUser = new Command("agent-user").description("Set the login the agent itself posts as").argument("<value>", "GitHub login used by the agent").action((value) => {
73
+ const user = value.trim();
74
+ if (user.length === 0) {
75
+ process.stderr.write("Error: agent-user requires a non-empty login.\n");
76
+ process.exit(1);
77
+ }
78
+ const current = readRawConfig();
79
+ writeConfig({ ...current, agentUser: user });
80
+ process.stdout.write(`Agent user set to: ${user}
81
+ `);
82
+ });
83
+ var configSet = new Command("set").description("Set a configuration value").addCommand(configSetType).addCommand(configSetIssueDiscoveryTechnique).addCommand(configSetIssueDiscoveryValue).addCommand(configSetClaudeSystemPrompt).addCommand(configSetAllowedUsers).addCommand(configSetAgentUser);
61
84
  var configCommand = new Command("config").description("Configure automata settings").addCommand(configSet).action(async () => {
62
85
  const [{ render }, React, { ConfigWizard }] = await Promise.all([
63
86
  import("ink"),
64
87
  import("react"),
65
- import("./ConfigWizard-WUGEM3PT.js")
88
+ import("./ConfigWizard-N473Z6LV.js")
66
89
  ]);
67
90
  const { waitUntilExit } = render(React.createElement(ConfigWizard));
68
91
  await waitUntilExit();
@@ -1237,6 +1260,34 @@ function listIssues(technique, value, limit = 10) {
1237
1260
  }
1238
1261
  return JSON.parse(stdout);
1239
1262
  }
1263
+ function getIssueConversation(issueNumber) {
1264
+ const { stdout, stderr, status } = run3("gh", [
1265
+ "issue",
1266
+ "view",
1267
+ String(issueNumber),
1268
+ "--json",
1269
+ "number,title,body,url,author,createdAt,comments"
1270
+ ]);
1271
+ if (status !== 0) {
1272
+ throw new Error(stderr.trim() || `Failed to read issue #${issueNumber}. Is \`gh\` installed and authenticated?`);
1273
+ }
1274
+ const raw = JSON.parse(stdout);
1275
+ const comments = (raw.comments ?? []).map((comment) => ({
1276
+ id: comment.id,
1277
+ author: comment.author?.login ?? "",
1278
+ body: comment.body,
1279
+ createdAt: comment.createdAt
1280
+ })).sort((a, b) => a.createdAt.localeCompare(b.createdAt));
1281
+ return {
1282
+ number: raw.number,
1283
+ title: raw.title,
1284
+ body: raw.body,
1285
+ url: raw.url,
1286
+ author: raw.author?.login ?? "",
1287
+ createdAt: raw.createdAt,
1288
+ comments
1289
+ };
1290
+ }
1240
1291
  function postComment(issueNumber, body) {
1241
1292
  const { stderr, status } = run3("gh", ["issue", "comment", String(issueNumber), "--body", body]);
1242
1293
  if (status !== 0) {
@@ -1715,6 +1766,53 @@ var executeCommand = new Command4("execute").description("Delegate work to an AI
1715
1766
 
1716
1767
  // src/commands/executePrompt.ts
1717
1768
  import { Command as Command5 } from "commander";
1769
+
1770
+ // src/github/issueConversation.ts
1771
+ function analyzeConversation(conversation, allowedUsers, agentUser) {
1772
+ const agent = agentUser.toLowerCase();
1773
+ const allowed = new Set(allowedUsers.map((user) => user.toLowerCase()));
1774
+ let lastAgentAt = null;
1775
+ for (const comment of conversation.comments) {
1776
+ if (comment.author.toLowerCase() !== agent) continue;
1777
+ if (lastAgentAt === null || comment.createdAt > lastAgentAt) {
1778
+ lastAgentAt = comment.createdAt;
1779
+ }
1780
+ }
1781
+ const entries = [
1782
+ {
1783
+ kind: "issue",
1784
+ author: conversation.author,
1785
+ body: conversation.body,
1786
+ createdAt: conversation.createdAt
1787
+ },
1788
+ ...conversation.comments.map((c) => ({
1789
+ kind: "comment",
1790
+ author: c.author,
1791
+ body: c.body,
1792
+ createdAt: c.createdAt
1793
+ }))
1794
+ ].sort((a, b) => a.createdAt.localeCompare(b.createdAt));
1795
+ const messages = [];
1796
+ for (const entry of entries) {
1797
+ const author = entry.author.toLowerCase();
1798
+ const isAgent = author === agent;
1799
+ if (!isAgent && !allowed.has(author)) continue;
1800
+ const isNew = !isAgent && (lastAgentAt === null || entry.createdAt > lastAgentAt);
1801
+ messages.push({ ...entry, isNew });
1802
+ }
1803
+ const newMessageCount = messages.filter((m) => m.isNew).length;
1804
+ return { messages, newMessageCount, hasNewMessage: newMessageCount > 0, lastAgentAt };
1805
+ }
1806
+ function formatConversation(messages) {
1807
+ return messages.map((message) => {
1808
+ const kind = message.kind === "issue" ? "issue description" : "comment";
1809
+ const marker = message.isNew ? " \xB7 NEW since last agent run" : "";
1810
+ return `[${message.author}] ${kind} \xB7 ${message.createdAt}${marker}
1811
+ ${message.body}`;
1812
+ }).join("\n\n");
1813
+ }
1814
+
1815
+ // src/commands/executePrompt.ts
1718
1816
  var PUSH_INSTRUCTION = "Once all changes are complete, stage every modified file, create a single commit with a clear and descriptive commit message that summarises what was fixed, and push the branch to the remote.";
1719
1817
  function withPush(prompt, push) {
1720
1818
  return push ? `${prompt}
@@ -1724,6 +1822,9 @@ ${PUSH_INSTRUCTION}` : prompt;
1724
1822
  function formatPrInfoContext(pr) {
1725
1823
  return JSON.stringify(pr, null, 2);
1726
1824
  }
1825
+ function pluralSuffix(count) {
1826
+ return count === 1 ? "" : "s";
1827
+ }
1727
1828
  function addAiOptions(cmd) {
1728
1829
  return cmd.requiredOption("--with <executor>", "Executor to use: claude or codex").option("--model <string>", "Model identifier to pass to the executor").option("--silent", "Suppress step-by-step Claude output; show only the final summary").option("--push", "Append instruction to commit and push changes after the AI finishes");
1729
1830
  }
@@ -1841,7 +1942,90 @@ ${formatComments(comments)}`,
1841
1942
  );
1842
1943
  await invokeSelectedExecutor(fullPrompt, executor, options);
1843
1944
  });
1844
- var executePromptCommand = new Command5("execute-prompt").description("Execute a configured custom prompt using an AI assistant").addCommand(executeSonarCmd).addCommand(executeFixCommentsCmd);
1945
+ var executeCheckIssueCmd = addAiOptions(
1946
+ new Command5("check-issue").description(
1947
+ "Check a GitHub issue for a new message from an allowed user since the last agent run and invoke the AI with the issue conversation"
1948
+ ).argument("<issue-number>", "GitHub issue number to check")
1949
+ ).option("--force", "Skip the new-message check and invoke the AI directly").action(async (issueNumberArg, options) => {
1950
+ const executor = resolveExecutor(options.with);
1951
+ const issueNumber = Number.parseInt(issueNumberArg, 10);
1952
+ if (Number.isNaN(issueNumber) || issueNumber <= 0) {
1953
+ process.stderr.write(`Error: <issue-number> must be a positive integer (got '${issueNumberArg}').
1954
+ `);
1955
+ process.exit(1);
1956
+ }
1957
+ const config = readConfig();
1958
+ if (config.remoteType === "azdo") {
1959
+ process.stderr.write(
1960
+ "Error: check-issue is not supported for Azure DevOps. See docs/azdo-gap.md for details.\n"
1961
+ );
1962
+ process.exit(1);
1963
+ }
1964
+ const allowedUsers = (config.allowedUsers ?? []).filter((user) => user.trim().length > 0);
1965
+ if (allowedUsers.length === 0) {
1966
+ process.stderr.write(
1967
+ "Error: No allowed users configured. Run `automata config` or `automata config set allowed-users <user1,user2>` to set them.\n"
1968
+ );
1969
+ process.exit(1);
1970
+ }
1971
+ const agentUser = (config.agentUser ?? "").trim();
1972
+ if (agentUser.length === 0) {
1973
+ process.stderr.write(
1974
+ "Error: No agent user configured. Run `automata config` or `automata config set agent-user <login>` to set it.\n"
1975
+ );
1976
+ process.exit(1);
1977
+ }
1978
+ let conversation;
1979
+ try {
1980
+ conversation = getIssueConversation(issueNumber);
1981
+ } catch (err) {
1982
+ process.stderr.write(`Error: ${err.message}
1983
+ `);
1984
+ process.exit(1);
1985
+ }
1986
+ const analysis = analyzeConversation(conversation, allowedUsers, agentUser);
1987
+ if (!analysis.hasNewMessage && !options.force) {
1988
+ const since = analysis.lastAgentAt === null ? "" : ` (last agent message: ${analysis.lastAgentAt})`;
1989
+ process.stdout.write(
1990
+ `No new messages from allowed users on issue #${String(issueNumber)}${since}. Use --force to invoke the AI anyway.
1991
+ `
1992
+ );
1993
+ return;
1994
+ }
1995
+ if (analysis.hasNewMessage) {
1996
+ process.stdout.write(
1997
+ `Found ${String(analysis.newMessageCount)} new message${pluralSuffix(analysis.newMessageCount)} on issue #${String(issueNumber)}. Invoking AI\u2026
1998
+ `
1999
+ );
2000
+ } else {
2001
+ process.stdout.write(`No new messages on issue #${String(issueNumber)} \u2014 forced run. Invoking AI\u2026
2002
+ `);
2003
+ }
2004
+ const promptText = config.prompts?.checkIssue ?? DEFAULT_CHECK_ISSUE_PROMPT;
2005
+ const fullPrompt = withPush(
2006
+ `${promptText}
2007
+
2008
+ Issue #${String(issueNumber)}: ${conversation.title}
2009
+ URL: ${conversation.url}
2010
+
2011
+ Conversation (only messages from allowed users and the agent, oldest first):
2012
+
2013
+ ${formatConversation(analysis.messages)}`,
2014
+ options.push
2015
+ );
2016
+ const marker = analysis.hasNewMessage ? `automata check-issue: picked up ${String(analysis.newMessageCount)} new message${pluralSuffix(analysis.newMessageCount)}, starting an agent run.` : "automata check-issue: forced run, starting an agent run.";
2017
+ try {
2018
+ postComment(issueNumber, marker);
2019
+ } catch (err) {
2020
+ process.stderr.write(
2021
+ `Error: could not post the execution marker comment on issue #${String(issueNumber)}: ${err.message}
2022
+ `
2023
+ );
2024
+ process.exit(1);
2025
+ }
2026
+ await invokeSelectedExecutor(fullPrompt, executor, options);
2027
+ });
2028
+ var executePromptCommand = new Command5("execute-prompt").description("Execute a configured custom prompt using an AI assistant").addCommand(executeSonarCmd).addCommand(executeFixCommentsCmd).addCommand(executeCheckIssueCmd);
1845
2029
 
1846
2030
  // src/index.ts
1847
2031
  var program = new Command6();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "automata-cli",
3
- "version": "0.4.0",
3
+ "version": "0.5.0-develop.181",
4
4
  "description": "Automata CLI tool",
5
5
  "type": "module",
6
6
  "bin": {