@kendoo.agentdesk/agentdesk 0.10.3 → 0.10.4
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/cli/prompt.mjs +84 -12
- package/package.json +1 -1
package/cli/prompt.mjs
CHANGED
|
@@ -137,7 +137,7 @@ export function buildSoloPrompt({ agentName, taskId, description, tracker, confi
|
|
|
137
137
|
}
|
|
138
138
|
|
|
139
139
|
// Extract and include tracker integration from team prompt
|
|
140
|
-
if (tracker
|
|
140
|
+
if (tracker) {
|
|
141
141
|
let teamPrompt = readFileSync(PROMPT_PATH, "utf-8");
|
|
142
142
|
|
|
143
143
|
// Extract the matching tracker block
|
|
@@ -150,8 +150,9 @@ export function buildSoloPrompt({ agentName, taskId, description, tracker, confi
|
|
|
150
150
|
}
|
|
151
151
|
|
|
152
152
|
if (trackerSection) {
|
|
153
|
-
// Substitute variables
|
|
154
|
-
|
|
153
|
+
// Substitute variables — use task ID if we have a real one
|
|
154
|
+
const hasRealTaskId = taskId && !taskId.startsWith("new-");
|
|
155
|
+
trackerSection = trackerSection.replace(/\{\{TASK_ID\}\}/g, hasRealTaskId ? taskId : "TBD");
|
|
155
156
|
trackerSection = trackerSection.replace(/\{\{SESSION_URL\}\}/g, sessionUrl || "");
|
|
156
157
|
if (config.jira?.baseUrl) {
|
|
157
158
|
trackerSection = trackerSection.replace(/\{\{JIRA_BASE_URL\}\}/g, config.jira.baseUrl.replace(/\/+$/, ""));
|
|
@@ -161,15 +162,86 @@ export function buildSoloPrompt({ agentName, taskId, description, tracker, confi
|
|
|
161
162
|
lines.push(trackerSection);
|
|
162
163
|
}
|
|
163
164
|
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
165
|
+
const hasRealTaskId = taskId && !taskId.startsWith("new-");
|
|
166
|
+
|
|
167
|
+
if (hasRealTaskId) {
|
|
168
|
+
lines.push(
|
|
169
|
+
`## Required tracker actions`,
|
|
170
|
+
``,
|
|
171
|
+
`1. Fetch the task — read summary, description, status, comments, attachments.`,
|
|
172
|
+
`2. Post a comment: "${agentName} working on this task (solo mode). Session: ${sessionUrl || ""}"`,
|
|
173
|
+
`3. Do your work.`,
|
|
174
|
+
`4. Post a final comment summarizing what was done, what was omitted, and any manual steps required.`,
|
|
175
|
+
``,
|
|
176
|
+
);
|
|
177
|
+
} else {
|
|
178
|
+
// No task ID provided — search tracker for a related task or create one
|
|
179
|
+
let searchInstr = "";
|
|
180
|
+
if (tracker === "linear") {
|
|
181
|
+
searchInstr = `Search Linear for an existing issue related to the task description using the GraphQL API:
|
|
182
|
+
- Endpoint: https://api.linear.app/graphql
|
|
183
|
+
- Auth: Authorization: $LINEAR_API_KEY
|
|
184
|
+
- Search by keywords from the description. Look for open/in-progress issues that match.`;
|
|
185
|
+
} else if (tracker === "jira") {
|
|
186
|
+
const baseUrl = (config.jira?.baseUrl || "").replace(/\/+$/, "");
|
|
187
|
+
searchInstr = `Search Jira for an existing issue related to the task description:
|
|
188
|
+
- Endpoint: ${baseUrl}/rest/api/3/search
|
|
189
|
+
- Auth: Basic auth with $JIRA_EMAIL and $JIRA_API_TOKEN
|
|
190
|
+
- Use JQL to search by text/summary matching keywords from the description. Look for open/in-progress issues.`;
|
|
191
|
+
} else if (tracker === "github") {
|
|
192
|
+
searchInstr = `Search GitHub for an existing issue related to the task description:
|
|
193
|
+
- Run: gh issue list --search "<keywords from description>" --state open
|
|
194
|
+
- Look for issues that match the task description.`;
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
let createInstr = "";
|
|
198
|
+
if (tracker === "linear") {
|
|
199
|
+
createInstr = `Create a Linear issue using the GraphQL API:
|
|
200
|
+
- Endpoint: https://api.linear.app/graphql
|
|
201
|
+
- Auth: Authorization: $LINEAR_API_KEY
|
|
202
|
+
- Set the title based on the description.`;
|
|
203
|
+
} else if (tracker === "jira") {
|
|
204
|
+
const baseUrl = (config.jira?.baseUrl || "").replace(/\/+$/, "");
|
|
205
|
+
createInstr = `Create a Jira issue:
|
|
206
|
+
- Endpoint: ${baseUrl}/rest/api/3/issue
|
|
207
|
+
- Auth: Basic auth with $JIRA_EMAIL and $JIRA_API_TOKEN
|
|
208
|
+
- Set the summary based on the description.`;
|
|
209
|
+
} else if (tracker === "github") {
|
|
210
|
+
createInstr = `Create a GitHub issue:
|
|
211
|
+
- Run: gh issue create --title "..." --body "..."`;
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
lines.push(
|
|
215
|
+
`## Required tracker actions (MANDATORY — FIRST ACTIONS)`,
|
|
216
|
+
``,
|
|
217
|
+
`### Step 1: Find or create a task`,
|
|
218
|
+
``,
|
|
219
|
+
searchInstr,
|
|
220
|
+
``,
|
|
221
|
+
`If you find a matching task:`,
|
|
222
|
+
`- Use that task ID for the rest of the session.`,
|
|
223
|
+
`- Read its full description, comments, and attachments for context.`,
|
|
224
|
+
``,
|
|
225
|
+
`If no matching task is found, create one:`,
|
|
226
|
+
``,
|
|
227
|
+
createInstr,
|
|
228
|
+
``,
|
|
229
|
+
`After finding or creating the task, output the ID on its own line:`,
|
|
230
|
+
`TASK_ID: <identifier>`,
|
|
231
|
+
``,
|
|
232
|
+
`### Step 2: Post session start`,
|
|
233
|
+
``,
|
|
234
|
+
`Post a comment on the task: "${agentName} working on this (solo mode). Session: ${sessionUrl || ""}"`,
|
|
235
|
+
`Set the task status to "In Progress".`,
|
|
236
|
+
``,
|
|
237
|
+
`### Step 3: Do your work`,
|
|
238
|
+
``,
|
|
239
|
+
`### Step 4: Post summary`,
|
|
240
|
+
``,
|
|
241
|
+
`Post a final comment on the task summarizing what was done, what was omitted, and any manual steps required.`,
|
|
242
|
+
``,
|
|
243
|
+
);
|
|
244
|
+
}
|
|
173
245
|
}
|
|
174
246
|
|
|
175
247
|
// Add custom instructions
|