yapout 0.3.0 → 0.3.1
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/index.js +77 -23
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -245,17 +245,46 @@ def main():
|
|
|
245
245
|
)
|
|
246
246
|
elif action == "enrich":
|
|
247
247
|
prompt = (
|
|
248
|
-
f'
|
|
249
|
-
f'
|
|
250
|
-
f'
|
|
251
|
-
f'
|
|
252
|
-
f'
|
|
253
|
-
f
|
|
254
|
-
f'
|
|
255
|
-
f'5. Scope assessment (is this too large for one PR?)\\n\\n'
|
|
256
|
-
f'Call yapout_save_enrichment with your analysis. '
|
|
257
|
-
f'If no questions were generated, also call yapout_sync_to_linear to create the Linear ticket.'
|
|
248
|
+
f'Use yapout to enrich a finding.\\n'
|
|
249
|
+
f'\\n'
|
|
250
|
+
f'Start with filter: {{ findingIds: ["{ticket_id}"] }}\\n'
|
|
251
|
+
f'\\n'
|
|
252
|
+
f'Call yapout_start_enrichment, then yapout_enrich_next to claim it.\\n'
|
|
253
|
+
f'Read the codebase, ask me questions if needed, then call yapout_save_enrichment\\n'
|
|
254
|
+
f'with a clean description, acceptance criteria, and implementation brief.'
|
|
258
255
|
)
|
|
256
|
+
elif action == "enrich-bulk":
|
|
257
|
+
tags = qs.get("tags", [""])[0]
|
|
258
|
+
finding_ids = qs.get("findingIds", [""])[0]
|
|
259
|
+
lines = [
|
|
260
|
+
"Use yapout to enrich findings for this project. Start a bulk enrichment session and work through each finding one by one.",
|
|
261
|
+
"",
|
|
262
|
+
"For each finding:",
|
|
263
|
+
"1. Call yapout_start_enrichment to begin" + (" with the filter below" if (tags or finding_ids) else ""),
|
|
264
|
+
"2. Call yapout_enrich_next to get the next finding",
|
|
265
|
+
"3. Read relevant code in the repository to understand the finding's context",
|
|
266
|
+
"4. Ask me any clarifying questions (only if genuinely needed)",
|
|
267
|
+
"5. Call yapout_save_enrichment with:",
|
|
268
|
+
" - A clean, specific title",
|
|
269
|
+
" - A description a senior engineer would write",
|
|
270
|
+
" - Concrete acceptance criteria",
|
|
271
|
+
" - An implementation brief (which files, approach, edge cases)",
|
|
272
|
+
'6. If I say "skip", call yapout_enrich_next with skip=true',
|
|
273
|
+
"7. After saving, if compactionHint is true or every 5 findings, run /compact",
|
|
274
|
+
"8. Repeat until done",
|
|
275
|
+
"",
|
|
276
|
+
"Keep the pace steady. Don't over-ask \u2014 use your judgment from the code.",
|
|
277
|
+
]
|
|
278
|
+
if finding_ids:
|
|
279
|
+
ids = [fid.strip() for fid in finding_ids.split(",") if fid.strip()]
|
|
280
|
+
lines.append("")
|
|
281
|
+
lines.append("These findings are bundled \u2014 enrich them as one cohesive problem.")
|
|
282
|
+
lines.append(f'Start with filter: {{ findingIds: {json.dumps(ids)} }}')
|
|
283
|
+
elif tags:
|
|
284
|
+
tag_list = [t.strip() for t in tags.split(",") if t.strip()]
|
|
285
|
+
lines.append("")
|
|
286
|
+
lines.append(f'Start with filter: {{ tags: {json.dumps(tag_list)} }}')
|
|
287
|
+
prompt = "\\n".join(lines)
|
|
259
288
|
elif action == "yap":
|
|
260
289
|
prompt = "Let's have a yap session"
|
|
261
290
|
if topic:
|
|
@@ -4112,7 +4141,7 @@ import { Command as Command15 } from "commander";
|
|
|
4112
4141
|
import { spawn as spawn2 } from "child_process";
|
|
4113
4142
|
import { platform as platform2 } from "os";
|
|
4114
4143
|
import chalk16 from "chalk";
|
|
4115
|
-
var VALID_ACTIONS = ["claim", "enrich", "yap", "compact"];
|
|
4144
|
+
var VALID_ACTIONS = ["claim", "enrich", "enrich-bulk", "yap", "compact"];
|
|
4116
4145
|
function parseYapoutUri(raw) {
|
|
4117
4146
|
const url = new URL(raw);
|
|
4118
4147
|
const action = url.hostname;
|
|
@@ -4123,13 +4152,15 @@ function parseYapoutUri(raw) {
|
|
|
4123
4152
|
}
|
|
4124
4153
|
const ticketId = url.pathname.replace(/^\//, "") || void 0;
|
|
4125
4154
|
if ((action === "claim" || action === "enrich") && !ticketId) {
|
|
4126
|
-
throw new Error(`Missing
|
|
4155
|
+
throw new Error(`Missing finding ID in URI: ${raw}`);
|
|
4127
4156
|
}
|
|
4128
4157
|
return {
|
|
4129
4158
|
action,
|
|
4130
4159
|
ticketId,
|
|
4131
4160
|
topic: url.searchParams.get("topic") || void 0,
|
|
4132
|
-
persona: url.searchParams.get("persona") || void 0
|
|
4161
|
+
persona: url.searchParams.get("persona") || void 0,
|
|
4162
|
+
tags: url.searchParams.get("tags")?.split(",").filter(Boolean) || void 0,
|
|
4163
|
+
findingIds: url.searchParams.get("findingIds")?.split(",").filter(Boolean) || void 0
|
|
4133
4164
|
};
|
|
4134
4165
|
}
|
|
4135
4166
|
function buildPrompt(parsed) {
|
|
@@ -4142,19 +4173,42 @@ function buildPrompt(parsed) {
|
|
|
4142
4173
|
].join(" ");
|
|
4143
4174
|
case "enrich":
|
|
4144
4175
|
return [
|
|
4145
|
-
`
|
|
4146
|
-
`Call yapout_get_unenriched_ticket with ticketId for "${parsed.ticketId}" to fetch the ticket details.`,
|
|
4176
|
+
`Use yapout to enrich a finding.`,
|
|
4147
4177
|
``,
|
|
4148
|
-
`
|
|
4149
|
-
`1. An implementation brief (3-5 sentences, specific files/patterns involved)`,
|
|
4150
|
-
`2. An enriched description with technical context`,
|
|
4151
|
-
`3. Clarifying questions (0-5) where the answer can't be inferred`,
|
|
4152
|
-
`4. Duplicate check \u2014 call yapout_get_existing_tickets and compare`,
|
|
4153
|
-
`5. Scope assessment (is this too large for one PR?)`,
|
|
4178
|
+
`Start with filter: { findingIds: ["${parsed.ticketId}"] }`,
|
|
4154
4179
|
``,
|
|
4155
|
-
`Call
|
|
4156
|
-
`
|
|
4180
|
+
`Call yapout_start_enrichment, then yapout_enrich_next to claim it.`,
|
|
4181
|
+
`Read the codebase, ask me questions if needed, then call yapout_save_enrichment`,
|
|
4182
|
+
`with a clean description, acceptance criteria, and implementation brief.`
|
|
4157
4183
|
].join("\n");
|
|
4184
|
+
case "enrich-bulk": {
|
|
4185
|
+
const lines = [
|
|
4186
|
+
"Use yapout to enrich findings for this project. Start a bulk enrichment session and work through each finding one by one.",
|
|
4187
|
+
"",
|
|
4188
|
+
"For each finding:",
|
|
4189
|
+
"1. Call yapout_start_enrichment to begin" + (parsed.tags || parsed.findingIds ? " with the filter below" : ""),
|
|
4190
|
+
"2. Call yapout_enrich_next to get the next finding",
|
|
4191
|
+
"3. Read relevant code in the repository to understand the finding's context",
|
|
4192
|
+
"4. Ask me any clarifying questions (only if genuinely needed)",
|
|
4193
|
+
"5. Call yapout_save_enrichment with:",
|
|
4194
|
+
" - A clean, specific title",
|
|
4195
|
+
" - A description a senior engineer would write",
|
|
4196
|
+
" - Concrete acceptance criteria",
|
|
4197
|
+
" - An implementation brief (which files, approach, edge cases)",
|
|
4198
|
+
'6. If I say "skip", call yapout_enrich_next with skip=true',
|
|
4199
|
+
"7. After saving, if compactionHint is true or every 5 findings, run /compact",
|
|
4200
|
+
"8. Repeat until done",
|
|
4201
|
+
"",
|
|
4202
|
+
"Keep the pace steady. Don't over-ask \u2014 use your judgment from the code."
|
|
4203
|
+
];
|
|
4204
|
+
if (parsed.findingIds?.length) {
|
|
4205
|
+
lines.push("", `These findings are bundled \u2014 enrich them as one cohesive problem.`);
|
|
4206
|
+
lines.push(`Start with filter: { findingIds: ${JSON.stringify(parsed.findingIds)} }`);
|
|
4207
|
+
} else if (parsed.tags?.length) {
|
|
4208
|
+
lines.push("", `Start with filter: { tags: ${JSON.stringify(parsed.tags)} }`);
|
|
4209
|
+
}
|
|
4210
|
+
return lines.join("\n");
|
|
4211
|
+
}
|
|
4158
4212
|
case "yap": {
|
|
4159
4213
|
const parts = ["Let's have a yap session"];
|
|
4160
4214
|
if (parsed.topic) parts[0] += ` about ${parsed.topic}`;
|