@ozzylabs/feedradar 0.1.5 → 0.1.7
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 +1 -1
- package/dist/cli/dismiss.d.ts +2 -1
- package/dist/cli/dismiss.d.ts.map +1 -1
- package/dist/cli/dismiss.js +4 -1
- package/dist/cli/dismiss.js.map +1 -1
- package/dist/cli/index.d.ts.map +1 -1
- package/dist/cli/index.js +7 -1
- package/dist/cli/index.js.map +1 -1
- package/dist/cli/items.d.ts +44 -0
- package/dist/cli/items.d.ts.map +1 -0
- package/dist/cli/items.js +288 -0
- package/dist/cli/items.js.map +1 -0
- package/dist/cli/research.d.ts +21 -0
- package/dist/cli/research.d.ts.map +1 -1
- package/dist/cli/research.js +54 -10
- package/dist/cli/research.js.map +1 -1
- package/dist/cli/review.d.ts +23 -0
- package/dist/cli/review.d.ts.map +1 -1
- package/dist/cli/review.js +293 -2
- package/dist/cli/review.js.map +1 -1
- package/dist/cli/source.d.ts.map +1 -1
- package/dist/cli/source.js +3 -0
- package/dist/cli/source.js.map +1 -1
- package/dist/cli/triage.d.ts +136 -0
- package/dist/cli/triage.d.ts.map +1 -0
- package/dist/cli/triage.js +1110 -0
- package/dist/cli/triage.js.map +1 -0
- package/dist/cli/undismiss.d.ts +30 -0
- package/dist/cli/undismiss.d.ts.map +1 -0
- package/dist/cli/undismiss.js +133 -0
- package/dist/cli/undismiss.js.map +1 -0
- package/dist/cli/watch.d.ts.map +1 -1
- package/dist/cli/watch.js +2 -0
- package/dist/cli/watch.js.map +1 -1
- package/dist/cli/workflow/generate-combined-with-triage.d.ts +115 -0
- package/dist/cli/workflow/generate-combined-with-triage.d.ts.map +1 -0
- package/dist/cli/workflow/generate-combined-with-triage.js +446 -0
- package/dist/cli/workflow/generate-combined-with-triage.js.map +1 -0
- package/dist/cli/workflow.d.ts +6 -5
- package/dist/cli/workflow.d.ts.map +1 -1
- package/dist/cli/workflow.js +13 -8
- package/dist/cli/workflow.js.map +1 -1
- package/dist/core/feeds/json-api.d.ts +26 -0
- package/dist/core/feeds/json-api.d.ts.map +1 -1
- package/dist/core/feeds/json-api.js +360 -223
- package/dist/core/feeds/json-api.js.map +1 -1
- package/dist/core/recipes.d.ts.map +1 -1
- package/dist/core/recipes.js +10 -0
- package/dist/core/recipes.js.map +1 -1
- package/dist/core/transitions.d.ts +30 -0
- package/dist/core/transitions.d.ts.map +1 -0
- package/dist/core/transitions.js +103 -0
- package/dist/core/transitions.js.map +1 -0
- package/dist/core/triage/adapter.d.ts +80 -0
- package/dist/core/triage/adapter.d.ts.map +1 -0
- package/dist/core/triage/adapter.js +128 -0
- package/dist/core/triage/adapter.js.map +1 -0
- package/dist/core/triage/index.d.ts +105 -0
- package/dist/core/triage/index.d.ts.map +1 -0
- package/dist/core/triage/index.js +246 -0
- package/dist/core/triage/index.js.map +1 -0
- package/dist/core/triage/prompt.d.ts +30 -0
- package/dist/core/triage/prompt.d.ts.map +1 -0
- package/dist/core/triage/prompt.js +157 -0
- package/dist/core/triage/prompt.js.map +1 -0
- package/dist/core/triage/response.d.ts +114 -0
- package/dist/core/triage/response.d.ts.map +1 -0
- package/dist/core/triage/response.js +188 -0
- package/dist/core/triage/response.js.map +1 -0
- package/dist/recipes/aws-whats-new.yaml +62 -7
- package/dist/recipes/dev-to.yaml +24 -0
- package/dist/schemas/item.d.ts +151 -5
- package/dist/schemas/item.d.ts.map +1 -1
- package/dist/schemas/item.js +164 -4
- package/dist/schemas/item.js.map +1 -1
- package/dist/schemas/recipe.d.ts +22 -0
- package/dist/schemas/recipe.d.ts.map +1 -1
- package/dist/schemas/recipe.js +13 -1
- package/dist/schemas/recipe.js.map +1 -1
- package/dist/schemas/source.d.ts +135 -0
- package/dist/schemas/source.d.ts.map +1 -1
- package/dist/schemas/source.js +138 -0
- package/dist/schemas/source.js.map +1 -1
- package/dist/templates/agents/AGENTS.md +36 -4
- package/dist/templates/workflows/combined-with-triage.template.yaml.tmpl +133 -0
- package/package.json +1 -1
|
@@ -0,0 +1,446 @@
|
|
|
1
|
+
import { access, mkdir, readFile, writeFile } from "node:fs/promises";
|
|
2
|
+
import { dirname, isAbsolute, join, normalize, relative, resolve } from "node:path";
|
|
3
|
+
import { fileURLToPath } from "node:url";
|
|
4
|
+
import { RESEARCH_BATCH_DEFAULT_MAX_ITEMS } from "../research.js";
|
|
5
|
+
import { SUPPORTED_AGENTS } from "./generate-watch.js";
|
|
6
|
+
/**
|
|
7
|
+
* `radar workflow generate combined-with-triage` (ADR-0018 §W5 / #241).
|
|
8
|
+
*
|
|
9
|
+
* Extends the `combined` generator with the LLM triage layer. The emitted
|
|
10
|
+
* workflow chains 5 steps in one job:
|
|
11
|
+
*
|
|
12
|
+
* watch run -> triage --apply -> research --batch (status=triaged_research)
|
|
13
|
+
* -> research --digest per triage-group -> review --batch (status=researched)
|
|
14
|
+
*
|
|
15
|
+
* Three distinct agents can be wired (triage / research / review) so the
|
|
16
|
+
* cheap-model channel handles triage while heavier models do the LoC-heavy
|
|
17
|
+
* research and the cross-agent review. The job-level `env:` block exposes
|
|
18
|
+
* every selected agent's API key once so each step inherits without
|
|
19
|
+
* per-step duplication (ADR-0014 D5 — API key auth only, never OAuth).
|
|
20
|
+
*
|
|
21
|
+
* A trailing `if: always()` notify step counts the `triaged_unsure` queue
|
|
22
|
+
* depth and (optionally) POSTs it to a Slack webhook so the human-review
|
|
23
|
+
* backlog cannot grow unnoticed. The notify step degrades silently when
|
|
24
|
+
* no webhook is configured.
|
|
25
|
+
*/
|
|
26
|
+
/** Default watch cron — 06:00 UTC daily, matching the #241 example. */
|
|
27
|
+
const DEFAULT_WATCH_CRON = "0 6 * * *";
|
|
28
|
+
/** Default output path under `.github/workflows/`. */
|
|
29
|
+
const DEFAULT_OUTPUT = join(".github", "workflows", "feedradar-daily.yaml");
|
|
30
|
+
/**
|
|
31
|
+
* Per-agent `env:` entries (single line each, no surrounding `env:` header).
|
|
32
|
+
*
|
|
33
|
+
* Used by `buildEnvBlock` to assemble a deduped job-level `env:` body that
|
|
34
|
+
* exposes every required secret across the three agent roles. Each line is
|
|
35
|
+
* 10-space indented so it sits under ` env:` (8 spaces, then 2-space
|
|
36
|
+
* map child indentation) when concatenated into the template.
|
|
37
|
+
*
|
|
38
|
+
* `claude-code` / `codex-cli` / `gemini-cli` each declare their API key.
|
|
39
|
+
* Every agent also gets `GITHUB_TOKEN` so the `github-releases` adapter
|
|
40
|
+
* lifts to the 5000 req/h ceiling; the watch step is the same one used in
|
|
41
|
+
* the `combined` generator, so the contract there carries over.
|
|
42
|
+
*
|
|
43
|
+
* `copilot` rides `secrets.GITHUB_TOKEN` natively (its CLI authenticates
|
|
44
|
+
* via the workflow's GH token), so it contributes no additional secret
|
|
45
|
+
* beyond the shared `GITHUB_TOKEN` line everybody gets.
|
|
46
|
+
*/
|
|
47
|
+
const AGENT_ENV_LINES = {
|
|
48
|
+
"claude-code": [" ANTHROPIC_API_KEY: $" + "{{ secrets.ANTHROPIC_API_KEY }}"],
|
|
49
|
+
"codex-cli": [" OPENAI_API_KEY: $" + "{{ secrets.OPENAI_API_KEY }}"],
|
|
50
|
+
"gemini-cli": [" GEMINI_API_KEY: $" + "{{ secrets.GEMINI_API_KEY }}"],
|
|
51
|
+
copilot: [],
|
|
52
|
+
};
|
|
53
|
+
/** Always-present line: every step benefits from a higher GH rate limit. */
|
|
54
|
+
const SHARED_GITHUB_TOKEN_LINE = " GITHUB_TOKEN: $" + "{{ secrets.GITHUB_TOKEN }}";
|
|
55
|
+
/**
|
|
56
|
+
* Per-agent human-readable secret names surfaced after a successful
|
|
57
|
+
* generation. Mirrors `generate-combined.ts` so the experience is
|
|
58
|
+
* consistent across both generators.
|
|
59
|
+
*/
|
|
60
|
+
const AGENT_SECRET_NAMES = {
|
|
61
|
+
"claude-code": ["ANTHROPIC_API_KEY"],
|
|
62
|
+
"codex-cli": ["OPENAI_API_KEY"],
|
|
63
|
+
"gemini-cli": ["GEMINI_API_KEY"],
|
|
64
|
+
copilot: [],
|
|
65
|
+
};
|
|
66
|
+
async function pathExists(p) {
|
|
67
|
+
try {
|
|
68
|
+
await access(p);
|
|
69
|
+
return true;
|
|
70
|
+
}
|
|
71
|
+
catch {
|
|
72
|
+
return false;
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
async function resolveTemplatesRoot() {
|
|
76
|
+
const here = dirname(fileURLToPath(import.meta.url));
|
|
77
|
+
return resolve(here, "..", "..", "templates");
|
|
78
|
+
}
|
|
79
|
+
/**
|
|
80
|
+
* Validate a 5-field POSIX cron expression. Same grammar check as
|
|
81
|
+
* `generate-combined.ts` / `generate-watch.ts`. Range bounds (e.g. month
|
|
82
|
+
* 1-12) are NOT enforced here; GitHub Actions rejects out-of-range
|
|
83
|
+
* expressions on workflow load.
|
|
84
|
+
*/
|
|
85
|
+
export function isValidCron(expr) {
|
|
86
|
+
const trimmed = expr.trim();
|
|
87
|
+
if (trimmed.length === 0)
|
|
88
|
+
return false;
|
|
89
|
+
const fields = trimmed.split(/\s+/);
|
|
90
|
+
if (fields.length !== 5)
|
|
91
|
+
return false;
|
|
92
|
+
const tokenPattern = /^(?:\*|\d+(?:-\d+)?)(?:\/\d+)?$/;
|
|
93
|
+
for (const field of fields) {
|
|
94
|
+
if (field.length === 0)
|
|
95
|
+
return false;
|
|
96
|
+
const tokens = field.split(",");
|
|
97
|
+
for (const token of tokens) {
|
|
98
|
+
if (token.length === 0)
|
|
99
|
+
return false;
|
|
100
|
+
if (!tokenPattern.test(token))
|
|
101
|
+
return false;
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
return true;
|
|
105
|
+
}
|
|
106
|
+
/**
|
|
107
|
+
* Validate that the requested `--output` path lands under
|
|
108
|
+
* `.github/workflows/`. Mirrors `isSafeWorkflowPath` in `generate-watch.ts`
|
|
109
|
+
* — kept inline here so the two generators don't accidentally drift on
|
|
110
|
+
* the safety contract.
|
|
111
|
+
*/
|
|
112
|
+
export function isSafeWorkflowPath(outputPath, cwd) {
|
|
113
|
+
if (isAbsolute(outputPath)) {
|
|
114
|
+
const allowedDir = resolve(cwd, ".github", "workflows");
|
|
115
|
+
const resolved = resolve(outputPath);
|
|
116
|
+
const rel = relative(allowedDir, resolved);
|
|
117
|
+
if (rel.startsWith("..") || isAbsolute(rel))
|
|
118
|
+
return false;
|
|
119
|
+
return /\.(ya?ml)$/i.test(resolved);
|
|
120
|
+
}
|
|
121
|
+
const normalized = normalize(outputPath);
|
|
122
|
+
if (normalized.split(/[\\/]/).includes(".."))
|
|
123
|
+
return false;
|
|
124
|
+
const required = `${join(".github", "workflows")}/`;
|
|
125
|
+
const unixified = normalized.replace(/\\/g, "/");
|
|
126
|
+
if (!unixified.startsWith(required.replace(/\\/g, "/")))
|
|
127
|
+
return false;
|
|
128
|
+
return /\.(ya?ml)$/i.test(unixified);
|
|
129
|
+
}
|
|
130
|
+
/**
|
|
131
|
+
* Validate `--max-items` as a positive integer (mirrors
|
|
132
|
+
* `parseMaxItems` in `src/cli/research.ts`).
|
|
133
|
+
*/
|
|
134
|
+
export function isValidMaxItems(raw) {
|
|
135
|
+
if (!/^[0-9]+$/.test(raw))
|
|
136
|
+
return false;
|
|
137
|
+
const n = Number.parseInt(raw, 10);
|
|
138
|
+
return Number.isFinite(n) && n > 0;
|
|
139
|
+
}
|
|
140
|
+
/**
|
|
141
|
+
* Validate `--slack-webhook` shape. Required form: `secrets.<NAME>` (no
|
|
142
|
+
* leading `${{`, no trailing `}}`). The generator wraps the name into a
|
|
143
|
+
* proper GitHub Actions expression at render time so the user does not
|
|
144
|
+
* have to spell it out (and so we cannot accidentally double-wrap).
|
|
145
|
+
*
|
|
146
|
+
* Exported for unit testing.
|
|
147
|
+
*/
|
|
148
|
+
export function isValidSlackWebhookRef(raw) {
|
|
149
|
+
return /^secrets\.[A-Z_][A-Z0-9_]*$/i.test(raw);
|
|
150
|
+
}
|
|
151
|
+
/**
|
|
152
|
+
* Build the deduped job-level `env:` body from the chosen triage /
|
|
153
|
+
* research / review agents. Lines are already 6-space indented (so they
|
|
154
|
+
* sit at ` env:` -> ` KEY: value` once the template inserts
|
|
155
|
+
* them at column 0 with `{{envBlock}}`).
|
|
156
|
+
*
|
|
157
|
+
* Order is deterministic (sorted) so generated workflows diff stably
|
|
158
|
+
* across regenerations. `GITHUB_TOKEN` is always last because shared
|
|
159
|
+
* lines come after agent-specific ones.
|
|
160
|
+
*/
|
|
161
|
+
export function buildEnvBlock(triageAgent, researchAgent, reviewAgent) {
|
|
162
|
+
const lines = new Set();
|
|
163
|
+
for (const agent of [triageAgent, researchAgent, reviewAgent]) {
|
|
164
|
+
for (const line of AGENT_ENV_LINES[agent]) {
|
|
165
|
+
lines.add(line);
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
lines.add(SHARED_GITHUB_TOKEN_LINE);
|
|
169
|
+
return [...lines].sort().join("\n");
|
|
170
|
+
}
|
|
171
|
+
/**
|
|
172
|
+
* Convert a `--slack-webhook secrets.<NAME>` ref into the GitHub Actions
|
|
173
|
+
* expression literal the template needs. Returns an empty string when no
|
|
174
|
+
* webhook was supplied so the `[ -n "..." ]` guard in the rendered
|
|
175
|
+
* notify step short-circuits cleanly.
|
|
176
|
+
*/
|
|
177
|
+
export function buildSlackWebhookExpr(raw) {
|
|
178
|
+
if (raw === undefined || raw.trim() === "")
|
|
179
|
+
return '""';
|
|
180
|
+
const trimmed = raw.trim();
|
|
181
|
+
// `secrets.X` -> `${{ secrets.X }}` (full Actions expression literal).
|
|
182
|
+
// biome-ignore lint/style/useTemplate: GitHub Actions expression literal — collapsing into a single template literal would re-trigger noTemplateCurlyInString
|
|
183
|
+
return "$" + `{{ ${trimmed} }}`;
|
|
184
|
+
}
|
|
185
|
+
/**
|
|
186
|
+
* Render the bundled template by substituting `{{watchCron}}` /
|
|
187
|
+
* `{{maxItems}}` / `{{triageAgent}}` / `{{researchAgent}}` /
|
|
188
|
+
* `{{reviewAgent}}` / `{{envBlock}}` / `{{slackWebhookExpr}}`.
|
|
189
|
+
*/
|
|
190
|
+
export function renderCombinedWithTriageTemplate(template, values) {
|
|
191
|
+
return template
|
|
192
|
+
.replaceAll("{{watchCron}}", values.watchCron)
|
|
193
|
+
.replaceAll("{{maxItems}}", String(values.maxItems))
|
|
194
|
+
.replaceAll("{{triageAgent}}", values.triageAgent)
|
|
195
|
+
.replaceAll("{{researchAgent}}", values.researchAgent)
|
|
196
|
+
.replaceAll("{{reviewAgent}}", values.reviewAgent)
|
|
197
|
+
.replaceAll("{{envBlock}}", values.envBlock)
|
|
198
|
+
.replaceAll("{{slackWebhookExpr}}", values.slackWebhookExpr);
|
|
199
|
+
}
|
|
200
|
+
/**
|
|
201
|
+
* Core implementation of `radar workflow generate combined-with-triage`.
|
|
202
|
+
*
|
|
203
|
+
* Validates inputs, reads the bundled template, substitutes placeholders,
|
|
204
|
+
* and writes the result. The completion stdout enumerates every secret the
|
|
205
|
+
* user must register (across all three agent roles plus the optional
|
|
206
|
+
* Slack webhook) so they do not have to grep the YAML.
|
|
207
|
+
*/
|
|
208
|
+
export async function generateCombinedWithTriage(options) {
|
|
209
|
+
const { cwd, watchCron, output, triageAgent, researchAgent, reviewAgent, maxItems, force } = options;
|
|
210
|
+
const log = options.io?.log ?? ((m) => console.log(m));
|
|
211
|
+
const warn = options.io?.warn ?? ((m) => console.warn(m));
|
|
212
|
+
if (!isValidCron(watchCron)) {
|
|
213
|
+
throw new Error(`invalid --watch-cron expression '${watchCron}' (expected 5-field POSIX cron, e.g. "0 6 * * *")`);
|
|
214
|
+
}
|
|
215
|
+
if (!isSafeWorkflowPath(output, cwd)) {
|
|
216
|
+
throw new Error(`invalid --output '${output}' (must be a relative path under .github/workflows/ ending in .yaml or .yml)`);
|
|
217
|
+
}
|
|
218
|
+
if (!Number.isInteger(maxItems) || maxItems <= 0) {
|
|
219
|
+
throw new Error(`invalid --max-items '${maxItems}' (must be a positive integer)`);
|
|
220
|
+
}
|
|
221
|
+
if (options.slackWebhook !== undefined && !isValidSlackWebhookRef(options.slackWebhook)) {
|
|
222
|
+
throw new Error(`invalid --slack-webhook '${options.slackWebhook}' (expected 'secrets.<NAME>', e.g. 'secrets.SLACK_WEBHOOK')`);
|
|
223
|
+
}
|
|
224
|
+
const templatesRoot = options.templatesRoot ?? (await resolveTemplatesRoot());
|
|
225
|
+
const templatePath = join(templatesRoot, "workflows", "combined-with-triage.template.yaml.tmpl");
|
|
226
|
+
if (!(await pathExists(templatePath))) {
|
|
227
|
+
throw new Error(`bundled template not found: ${templatePath}`);
|
|
228
|
+
}
|
|
229
|
+
const template = await readFile(templatePath, "utf8");
|
|
230
|
+
const envBlock = buildEnvBlock(triageAgent, researchAgent, reviewAgent);
|
|
231
|
+
const slackWebhookExpr = buildSlackWebhookExpr(options.slackWebhook);
|
|
232
|
+
const rendered = renderCombinedWithTriageTemplate(template, {
|
|
233
|
+
watchCron,
|
|
234
|
+
maxItems,
|
|
235
|
+
triageAgent,
|
|
236
|
+
researchAgent,
|
|
237
|
+
reviewAgent,
|
|
238
|
+
envBlock,
|
|
239
|
+
slackWebhookExpr,
|
|
240
|
+
});
|
|
241
|
+
const destAbs = isAbsolute(output) ? output : join(cwd, output);
|
|
242
|
+
const destRel = isAbsolute(output) ? relative(cwd, output) : output;
|
|
243
|
+
if ((await pathExists(destAbs)) && !force) {
|
|
244
|
+
throw new Error(`output file already exists: ${destRel} (use --force to overwrite)`);
|
|
245
|
+
}
|
|
246
|
+
if ((await pathExists(destAbs)) && force) {
|
|
247
|
+
warn(`workflow generate combined-with-triage: overwriting existing file ${destRel}`);
|
|
248
|
+
}
|
|
249
|
+
await mkdir(dirname(destAbs), { recursive: true });
|
|
250
|
+
await writeFile(destAbs, rendered, "utf8");
|
|
251
|
+
// Deduped secret list across all three agent roles + optional Slack.
|
|
252
|
+
const secrets = new Set();
|
|
253
|
+
for (const agent of [triageAgent, researchAgent, reviewAgent]) {
|
|
254
|
+
for (const s of AGENT_SECRET_NAMES[agent])
|
|
255
|
+
secrets.add(s);
|
|
256
|
+
}
|
|
257
|
+
if (options.slackWebhook !== undefined) {
|
|
258
|
+
// strip the `secrets.` prefix when surfacing to the user.
|
|
259
|
+
secrets.add(options.slackWebhook.replace(/^secrets\./, ""));
|
|
260
|
+
}
|
|
261
|
+
const sortedSecrets = [...secrets].sort();
|
|
262
|
+
log(`workflow generate combined-with-triage: wrote ${destRel}`);
|
|
263
|
+
log(` watch-cron: ${watchCron}`);
|
|
264
|
+
log(` triage-agent: ${triageAgent}`);
|
|
265
|
+
log(` research-agent: ${researchAgent}`);
|
|
266
|
+
log(` review-agent: ${reviewAgent}`);
|
|
267
|
+
log(` max-items: ${maxItems}`);
|
|
268
|
+
log(` slack-webhook: ${options.slackWebhook ?? "(none — notify step no-ops)"}`);
|
|
269
|
+
log("");
|
|
270
|
+
log("Required GitHub Actions secrets (Settings → Secrets and variables → Actions):");
|
|
271
|
+
if (sortedSecrets.length === 0) {
|
|
272
|
+
log(" (none — every selected agent rides the auto-provisioned GITHUB_TOKEN)");
|
|
273
|
+
}
|
|
274
|
+
else {
|
|
275
|
+
for (const s of sortedSecrets) {
|
|
276
|
+
log(` ${s}`);
|
|
277
|
+
}
|
|
278
|
+
}
|
|
279
|
+
log(" GITHUB_TOKEN (auto-provisioned, no setup needed)");
|
|
280
|
+
warn("workflow generate combined-with-triage: the --max-items cap is also enforced by `radar research --batch`; editing the YAML alone will not raise it");
|
|
281
|
+
return { outputPath: destRel, requiredSecrets: sortedSecrets };
|
|
282
|
+
}
|
|
283
|
+
/**
|
|
284
|
+
* Parse `workflow generate combined-with-triage` flags.
|
|
285
|
+
*
|
|
286
|
+
* Throws on missing values, unknown flags, unsupported agent choices, and
|
|
287
|
+
* malformed numeric / slack-webhook input so the caller can surface
|
|
288
|
+
* validation errors before any IO happens.
|
|
289
|
+
*/
|
|
290
|
+
export function parseGenerateCombinedWithTriageArgs(args) {
|
|
291
|
+
let watchCron = DEFAULT_WATCH_CRON;
|
|
292
|
+
let output = DEFAULT_OUTPUT;
|
|
293
|
+
let triageAgent = "gemini-cli";
|
|
294
|
+
let researchAgent = "claude-code";
|
|
295
|
+
let reviewAgent = "codex-cli";
|
|
296
|
+
let maxItems = RESEARCH_BATCH_DEFAULT_MAX_ITEMS;
|
|
297
|
+
let slackWebhook;
|
|
298
|
+
let force = false;
|
|
299
|
+
let help = false;
|
|
300
|
+
function parseAgentFlag(flag, value) {
|
|
301
|
+
if (value === undefined)
|
|
302
|
+
throw new Error(`option ${flag} requires a value`);
|
|
303
|
+
if (!SUPPORTED_AGENTS.includes(value)) {
|
|
304
|
+
throw new Error(`option ${flag} expects one of: ${SUPPORTED_AGENTS.join(" | ")}, got '${value}'`);
|
|
305
|
+
}
|
|
306
|
+
return value;
|
|
307
|
+
}
|
|
308
|
+
for (let i = 0; i < args.length; i++) {
|
|
309
|
+
const a = args[i];
|
|
310
|
+
if (a === "-h" || a === "--help") {
|
|
311
|
+
help = true;
|
|
312
|
+
continue;
|
|
313
|
+
}
|
|
314
|
+
if (a === "--watch-cron") {
|
|
315
|
+
const value = args[++i];
|
|
316
|
+
if (value === undefined)
|
|
317
|
+
throw new Error(`option ${a} requires a value`);
|
|
318
|
+
watchCron = value;
|
|
319
|
+
continue;
|
|
320
|
+
}
|
|
321
|
+
if (a === "--output") {
|
|
322
|
+
const value = args[++i];
|
|
323
|
+
if (value === undefined)
|
|
324
|
+
throw new Error(`option ${a} requires a value`);
|
|
325
|
+
output = value;
|
|
326
|
+
continue;
|
|
327
|
+
}
|
|
328
|
+
if (a === "--triage-agent") {
|
|
329
|
+
triageAgent = parseAgentFlag(a, args[++i]);
|
|
330
|
+
continue;
|
|
331
|
+
}
|
|
332
|
+
if (a === "--research-agent") {
|
|
333
|
+
researchAgent = parseAgentFlag(a, args[++i]);
|
|
334
|
+
continue;
|
|
335
|
+
}
|
|
336
|
+
if (a === "--review-agent") {
|
|
337
|
+
reviewAgent = parseAgentFlag(a, args[++i]);
|
|
338
|
+
continue;
|
|
339
|
+
}
|
|
340
|
+
if (a === "--max-items") {
|
|
341
|
+
const value = args[++i];
|
|
342
|
+
if (value === undefined)
|
|
343
|
+
throw new Error(`option ${a} requires a value`);
|
|
344
|
+
if (!isValidMaxItems(value)) {
|
|
345
|
+
throw new Error(`option --max-items expects a positive integer, got '${value}'`);
|
|
346
|
+
}
|
|
347
|
+
maxItems = Number.parseInt(value, 10);
|
|
348
|
+
continue;
|
|
349
|
+
}
|
|
350
|
+
if (a === "--slack-webhook") {
|
|
351
|
+
const value = args[++i];
|
|
352
|
+
if (value === undefined)
|
|
353
|
+
throw new Error(`option ${a} requires a value`);
|
|
354
|
+
if (!isValidSlackWebhookRef(value)) {
|
|
355
|
+
throw new Error(`option --slack-webhook expects 'secrets.<NAME>', got '${value}'`);
|
|
356
|
+
}
|
|
357
|
+
slackWebhook = value;
|
|
358
|
+
continue;
|
|
359
|
+
}
|
|
360
|
+
if (a === "--force" || a === "-f") {
|
|
361
|
+
force = true;
|
|
362
|
+
continue;
|
|
363
|
+
}
|
|
364
|
+
if (a?.startsWith("--") || a?.startsWith("-")) {
|
|
365
|
+
throw new Error(`unknown option: ${a}`);
|
|
366
|
+
}
|
|
367
|
+
throw new Error(`unexpected positional argument: ${a}`);
|
|
368
|
+
}
|
|
369
|
+
return {
|
|
370
|
+
watchCron,
|
|
371
|
+
output,
|
|
372
|
+
triageAgent,
|
|
373
|
+
researchAgent,
|
|
374
|
+
reviewAgent,
|
|
375
|
+
maxItems,
|
|
376
|
+
slackWebhook,
|
|
377
|
+
force,
|
|
378
|
+
help,
|
|
379
|
+
};
|
|
380
|
+
}
|
|
381
|
+
export function printGenerateCombinedWithTriageHelp(log) {
|
|
382
|
+
log("Usage: radar workflow generate combined-with-triage [options]");
|
|
383
|
+
log("");
|
|
384
|
+
log("Generates a GitHub Actions workflow that chains `radar watch run` ->");
|
|
385
|
+
log("`radar triage --apply` -> `radar research --batch --status triaged_research` ->");
|
|
386
|
+
log("per-group `radar research --digest` -> `radar review --batch` in one job");
|
|
387
|
+
log("(ADR-0018 §W5).");
|
|
388
|
+
log("");
|
|
389
|
+
log("Options:");
|
|
390
|
+
log(` --watch-cron <expression> 5-field cron expression (default: "${DEFAULT_WATCH_CRON}")`);
|
|
391
|
+
log(" --output <path> Output file under .github/workflows/");
|
|
392
|
+
log(` (default: ${DEFAULT_OUTPUT})`);
|
|
393
|
+
log(" --triage-agent <name> claude-code | codex-cli | gemini-cli | copilot (default: gemini-cli)");
|
|
394
|
+
log(" --research-agent <name> claude-code | codex-cli | gemini-cli | copilot (default: claude-code)");
|
|
395
|
+
log(" --review-agent <name> claude-code | codex-cli | gemini-cli | copilot (default: codex-cli)");
|
|
396
|
+
log(` --max-items N Hard cap on research --batch per run (default: ${RESEARCH_BATCH_DEFAULT_MAX_ITEMS})`);
|
|
397
|
+
log(" --slack-webhook <ref> Secret reference (e.g. secrets.SLACK_WEBHOOK) for the");
|
|
398
|
+
log(" triaged_unsure-queue alert (optional)");
|
|
399
|
+
log(" --force, -f Overwrite existing output file");
|
|
400
|
+
log("");
|
|
401
|
+
log("Required secrets (Settings → Secrets and variables → Actions):");
|
|
402
|
+
log(" ANTHROPIC_API_KEY when any role uses --agent claude-code");
|
|
403
|
+
log(" OPENAI_API_KEY when any role uses --agent codex-cli");
|
|
404
|
+
log(" GEMINI_API_KEY when any role uses --agent gemini-cli (default for triage)");
|
|
405
|
+
log(" GITHUB_TOKEN auto-provisioned (no manual setup needed)");
|
|
406
|
+
}
|
|
407
|
+
/**
|
|
408
|
+
* Entry point invoked by `runWorkflow` when the user types
|
|
409
|
+
* `radar workflow generate combined-with-triage`.
|
|
410
|
+
*/
|
|
411
|
+
export async function runGenerateCombinedWithTriage(args, io = {}, cwd = process.cwd()) {
|
|
412
|
+
const log = io.log ?? ((m) => console.log(m));
|
|
413
|
+
const error = io.error ?? ((m) => console.error(m));
|
|
414
|
+
let parsed;
|
|
415
|
+
try {
|
|
416
|
+
parsed = parseGenerateCombinedWithTriageArgs(args);
|
|
417
|
+
}
|
|
418
|
+
catch (e) {
|
|
419
|
+
error(`workflow generate combined-with-triage: ${e instanceof Error ? e.message : String(e)}`);
|
|
420
|
+
return 2;
|
|
421
|
+
}
|
|
422
|
+
if (parsed.help) {
|
|
423
|
+
printGenerateCombinedWithTriageHelp(log);
|
|
424
|
+
return 0;
|
|
425
|
+
}
|
|
426
|
+
try {
|
|
427
|
+
await generateCombinedWithTriage({
|
|
428
|
+
cwd,
|
|
429
|
+
watchCron: parsed.watchCron,
|
|
430
|
+
output: parsed.output,
|
|
431
|
+
triageAgent: parsed.triageAgent,
|
|
432
|
+
researchAgent: parsed.researchAgent,
|
|
433
|
+
reviewAgent: parsed.reviewAgent,
|
|
434
|
+
maxItems: parsed.maxItems,
|
|
435
|
+
slackWebhook: parsed.slackWebhook,
|
|
436
|
+
force: parsed.force,
|
|
437
|
+
io,
|
|
438
|
+
});
|
|
439
|
+
return 0;
|
|
440
|
+
}
|
|
441
|
+
catch (e) {
|
|
442
|
+
error(`workflow generate combined-with-triage: ${e instanceof Error ? e.message : String(e)}`);
|
|
443
|
+
return 1;
|
|
444
|
+
}
|
|
445
|
+
}
|
|
446
|
+
//# sourceMappingURL=generate-combined-with-triage.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"generate-combined-with-triage.js","sourceRoot":"","sources":["../../../src/cli/workflow/generate-combined-with-triage.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AACtE,OAAO,EAAE,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE,SAAS,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpF,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACzC,OAAO,EAAE,gCAAgC,EAAE,MAAM,gBAAgB,CAAC;AAElE,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAEvD;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,uEAAuE;AACv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AAC,GAAG,CAAC,CAAC;QACzC,OAAO,CAAC,CAAC;IACX,CAAC;IAED,IAAI,CAAC;QACH,MAAM,0BAA0B,CAAC;YAC/B,GAAG;YACH,SAAS,EAAE,MAAM,CAAC,SAAS;YAC3B,MAAM,EAAE,MAAM,CAAC,MAAM;YACrB,WAAW,EAAE,MAAM,CAAC,WAAW;YAC/B,aAAa,EAAE,MAAM,CAAC,aAAa;YACnC,WAAW,EAAE,MAAM,CAAC,WAAW;YAC/B,QAAQ,EAAE,MAAM,CAAC,QAAQ;YACzB,YAAY,EAAE,MAAM,CAAC,YAAY;YACjC,KAAK,EAAE,MAAM,CAAC,KAAK;YACnB,EAAE;SACH,CAAC,CAAC;QACH,OAAO,CAAC,CAAC;IACX,CAAC;IAAC,OAAO,CAAC,EAAE,CAAC;QACX,KAAK,CAAC,2CAA2C,CAAC,YAAY,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC;QAC/F,OAAO,CAAC,CAAC;IACX,CAAC;AACH,CAAC"}
|
package/dist/cli/workflow.d.ts
CHANGED
|
@@ -17,12 +17,13 @@ export interface WorkflowCommandOptions {
|
|
|
17
17
|
/**
|
|
18
18
|
* Dispatcher for `radar workflow <subcommand>`.
|
|
19
19
|
*
|
|
20
|
-
*
|
|
21
|
-
* `generate combined` (
|
|
22
|
-
* (`research` / `review` per #191) will land
|
|
23
|
-
* `generate` switch without changing the surface.
|
|
20
|
+
* Supported subcommands: `generate watch` (#188), `generate combined`
|
|
21
|
+
* (#189), and `generate combined-with-triage` (#241 / ADR-0018 §W5).
|
|
22
|
+
* Additional `<type>` values (`research` / `review` per #191) will land
|
|
23
|
+
* as new branches in the `generate` switch without changing the surface.
|
|
24
24
|
*
|
|
25
|
-
* See ADR-0014 (workflow generate sub-command)
|
|
25
|
+
* See ADR-0014 (workflow generate sub-command) and ADR-0018 (LLM-based
|
|
26
|
+
* triage extension) for the full design rationale.
|
|
26
27
|
*/
|
|
27
28
|
export declare function runWorkflow(args: string[], options?: WorkflowCommandOptions): Promise<number>;
|
|
28
29
|
export declare const workflowCommand: Command;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"workflow.d.ts","sourceRoot":"","sources":["../../src/cli/workflow.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"workflow.d.ts","sourceRoot":"","sources":["../../src/cli/workflow.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AAK1C;;;;GAIG;AACH,MAAM,WAAW,UAAU;IACzB,GAAG,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,CAAC;IAChC,IAAI,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,CAAC;IACjC,KAAK,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,CAAC;CACnC;AAED,MAAM,WAAW,sBAAsB;IACrC,qEAAqE;IACrE,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,EAAE,CAAC,EAAE,UAAU,CAAC;CACjB;AA6BD;;;;;;;;;;GAUG;AACH,wBAAsB,WAAW,CAC/B,IAAI,EAAE,MAAM,EAAE,EACd,OAAO,GAAE,sBAA2B,GACnC,OAAO,CAAC,MAAM,CAAC,CAmCjB;AAED,eAAO,MAAM,eAAe,EAAE,OAI7B,CAAC"}
|
package/dist/cli/workflow.js
CHANGED
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import { runGenerateCombined } from "./workflow/generate-combined.js";
|
|
2
|
+
import { runGenerateCombinedWithTriage } from "./workflow/generate-combined-with-triage.js";
|
|
2
3
|
import { runGenerateWatch } from "./workflow/generate-watch.js";
|
|
3
4
|
function printWorkflowHelp(log) {
|
|
4
5
|
log("Usage: radar workflow <subcommand> [...]");
|
|
5
6
|
log("");
|
|
6
7
|
log("Subcommands:");
|
|
7
8
|
log(" generate <type> Generate a GitHub Actions workflow YAML");
|
|
8
|
-
log(" Types: watch | combined
|
|
9
|
+
log(" Types: watch | combined | combined-with-triage");
|
|
9
10
|
log("");
|
|
10
11
|
log("Run `radar workflow generate <type> --help` for type-specific options.");
|
|
11
12
|
}
|
|
@@ -13,20 +14,22 @@ function printGenerateHelp(log) {
|
|
|
13
14
|
log("Usage: radar workflow generate <type> [options]");
|
|
14
15
|
log("");
|
|
15
16
|
log("Types:");
|
|
16
|
-
log(" watch
|
|
17
|
-
log(" combined
|
|
17
|
+
log(" watch Periodic `radar watch run` (cron + state commit with rebase retry)");
|
|
18
|
+
log(" combined Periodic `radar watch run` -> auto research --batch with hard cap (ADR-0014)");
|
|
19
|
+
log(" combined-with-triage `watch run` -> `triage --apply` -> `research --batch` -> per-group `research --digest` -> `review --batch` in one job (ADR-0018 §W5)");
|
|
18
20
|
log("");
|
|
19
21
|
log("Run `radar workflow generate <type> --help` for type-specific options.");
|
|
20
22
|
}
|
|
21
23
|
/**
|
|
22
24
|
* Dispatcher for `radar workflow <subcommand>`.
|
|
23
25
|
*
|
|
24
|
-
*
|
|
25
|
-
* `generate combined` (
|
|
26
|
-
* (`research` / `review` per #191) will land
|
|
27
|
-
* `generate` switch without changing the surface.
|
|
26
|
+
* Supported subcommands: `generate watch` (#188), `generate combined`
|
|
27
|
+
* (#189), and `generate combined-with-triage` (#241 / ADR-0018 §W5).
|
|
28
|
+
* Additional `<type>` values (`research` / `review` per #191) will land
|
|
29
|
+
* as new branches in the `generate` switch without changing the surface.
|
|
28
30
|
*
|
|
29
|
-
* See ADR-0014 (workflow generate sub-command)
|
|
31
|
+
* See ADR-0014 (workflow generate sub-command) and ADR-0018 (LLM-based
|
|
32
|
+
* triage extension) for the full design rationale.
|
|
30
33
|
*/
|
|
31
34
|
export async function runWorkflow(args, options = {}) {
|
|
32
35
|
const cwd = options.cwd ?? process.cwd();
|
|
@@ -52,6 +55,8 @@ export async function runWorkflow(args, options = {}) {
|
|
|
52
55
|
return runGenerateWatch(typeArgs, options.io ?? {}, cwd);
|
|
53
56
|
case "combined":
|
|
54
57
|
return runGenerateCombined(typeArgs, options.io ?? {}, cwd);
|
|
58
|
+
case "combined-with-triage":
|
|
59
|
+
return runGenerateCombinedWithTriage(typeArgs, options.io ?? {}, cwd);
|
|
55
60
|
default:
|
|
56
61
|
error(`workflow generate: unknown type '${type}'`);
|
|
57
62
|
printGenerateHelp(error);
|
package/dist/cli/workflow.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"workflow.js","sourceRoot":"","sources":["../../src/cli/workflow.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,mBAAmB,EAAE,MAAM,iCAAiC,CAAC;AACtE,OAAO,EAAE,gBAAgB,EAAE,MAAM,8BAA8B,CAAC;AAmBhE,SAAS,iBAAiB,CAAC,GAAwB;IACjD,GAAG,CAAC,0CAA0C,CAAC,CAAC;IAChD,GAAG,CAAC,EAAE,CAAC,CAAC;IACR,GAAG,CAAC,cAAc,CAAC,CAAC;IACpB,GAAG,CAAC,4DAA4D,CAAC,CAAC;IAClE,GAAG,CAAC,
|
|
1
|
+
{"version":3,"file":"workflow.js","sourceRoot":"","sources":["../../src/cli/workflow.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,mBAAmB,EAAE,MAAM,iCAAiC,CAAC;AACtE,OAAO,EAAE,6BAA6B,EAAE,MAAM,6CAA6C,CAAC;AAC5F,OAAO,EAAE,gBAAgB,EAAE,MAAM,8BAA8B,CAAC;AAmBhE,SAAS,iBAAiB,CAAC,GAAwB;IACjD,GAAG,CAAC,0CAA0C,CAAC,CAAC;IAChD,GAAG,CAAC,EAAE,CAAC,CAAC;IACR,GAAG,CAAC,cAAc,CAAC,CAAC;IACpB,GAAG,CAAC,4DAA4D,CAAC,CAAC;IAClE,GAAG,CAAC,mEAAmE,CAAC,CAAC;IACzE,GAAG,CAAC,EAAE,CAAC,C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C,CAAC;QAC/C,iBAAiB,CAAC,KAAK,CAAC,CAAC;QACzB,OAAO,CAAC,CAAC;IACX,CAAC;IAED,MAAM,CAAC,IAAI,EAAE,GAAG,QAAQ,CAAC,GAAG,IAAI,CAAC;IACjC,IAAI,CAAC,IAAI,IAAI,IAAI,KAAK,IAAI,IAAI,IAAI,KAAK,QAAQ,IAAI,IAAI,KAAK,MAAM,EAAE,CAAC;QACnE,iBAAiB,CAAC,GAAG,CAAC,CAAC;QACvB,OAAO,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;IACtB,CAAC;IAED,QAAQ,IAAI,EAAE,CAAC;QACb,KAAK,OAAO;YACV,OAAO,gBAAgB,CAAC,QAAQ,EAAE,OAAO,CAAC,EAAE,IAAI,EAAE,EAAE,GAAG,CAAC,CAAC;QAC3D,KAAK,UAAU;YACb,OAAO,mBAAmB,CAAC,QAAQ,EAAE,OAAO,CAAC,EAAE,IAAI,EAAE,EAAE,GAAG,CAAC,CAAC;QAC9D,KAAK,sBAAsB;YACzB,OAAO,6BAA6B,CAAC,QAAQ,EAAE,OAAO,CAAC,EAAE,IAAI,EAAE,EAAE,GAAG,CAAC,CAAC;QACxE;YACE,KAAK,CAAC,oCAAoC,IAAI,GAAG,CAAC,CAAC;YACnD,iBAAiB,CAAC,KAAK,CAAC,CAAC;YACzB,OAAO,CAAC,CAAC;IACb,CAAC;AACH,CAAC;AAED,MAAM,CAAC,MAAM,eAAe,GAAY;IACtC,IAAI,EAAE,UAAU;IAChB,OAAO,EAAE,qDAAqD;IAC9D,GAAG,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,WAAW,CAAC,IAAI,CAAC;CACjC,CAAC"}
|
|
@@ -1,3 +1,29 @@
|
|
|
1
1
|
import type { FeedAdapter } from "./types.js";
|
|
2
|
+
/**
|
|
3
|
+
* Public adapter. When `source.facets` is set, wraps {@link fetchSingle}
|
|
4
|
+
* in an outer facet sweep loop (ADR-0017). Each iteration:
|
|
5
|
+
*
|
|
6
|
+
* - injects the facet value into the URL via {@link applyFacetValue}
|
|
7
|
+
* - delegates to {@link fetchSingle} with `facets: undefined` so the
|
|
8
|
+
* inner traversal sees the modified URL but does not recurse
|
|
9
|
+
* - disables conditional GET in facet sweep mode (ADR-0017 §State —
|
|
10
|
+
* per-facet ETag tracking is deferred to a future ADR)
|
|
11
|
+
* - merges state.lastSeenIds globally across facet values (item IDs are
|
|
12
|
+
* unique across facets in the documented AWS What's New use case)
|
|
13
|
+
*
|
|
14
|
+
* Inner traversal semantics (`lastSeenIds` early-stop, `pagination.maxPages`
|
|
15
|
+
* cap, `--max-pages` override, `--backfill` full traversal) apply unchanged
|
|
16
|
+
* to each facet value. The outer loop walks every facet value in both
|
|
17
|
+
* normal and `--backfill` modes — normal mode gets the early-stop benefit
|
|
18
|
+
* inside each value but never skips a facet outright (that would silently
|
|
19
|
+
* miss items in a facet whose first page has not changed since last run).
|
|
20
|
+
*
|
|
21
|
+
* Dry-run (`source test`) iterates only the first facet value so the
|
|
22
|
+
* selector adoption preview is meaningful without walking every year.
|
|
23
|
+
*
|
|
24
|
+
* Phase 1 limitation: a single facet entry only. Multi-facet (e.g. year ×
|
|
25
|
+
* category) requires composition rules that are out of scope here — see
|
|
26
|
+
* ADR-0017 §Scope.
|
|
27
|
+
*/
|
|
2
28
|
export declare const jsonApiAdapter: FeedAdapter;
|
|
3
29
|
//# sourceMappingURL=json-api.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"json-api.d.ts","sourceRoot":"","sources":["../../../src/core/feeds/json-api.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"json-api.d.ts","sourceRoot":"","sources":["../../../src/core/feeds/json-api.ts"],"names":[],"mappings":"AAYA,OAAO,KAAK,EACV,WAAW,EAKZ,MAAM,YAAY,CAAC;AAi1BpB;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,eAAO,MAAM,cAAc,EAAE,WAmF5B,CAAC"}
|