@ozzylabs/feedradar 0.1.4 → 0.1.6
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.ja.md +12 -6
- package/README.md +11 -6
- package/dist/agents/claude-code.d.ts +12 -1
- package/dist/agents/claude-code.d.ts.map +1 -1
- package/dist/agents/claude-code.js +9 -5
- package/dist/agents/claude-code.js.map +1 -1
- package/dist/agents/codex-cli.d.ts +7 -1
- package/dist/agents/codex-cli.d.ts.map +1 -1
- package/dist/agents/codex-cli.js +9 -5
- package/dist/agents/codex-cli.js.map +1 -1
- package/dist/agents/copilot.d.ts +7 -1
- package/dist/agents/copilot.d.ts.map +1 -1
- package/dist/agents/copilot.js +9 -5
- package/dist/agents/copilot.js.map +1 -1
- package/dist/agents/gemini-cli.d.ts +7 -1
- package/dist/agents/gemini-cli.d.ts.map +1 -1
- package/dist/agents/gemini-cli.js +9 -5
- package/dist/agents/gemini-cli.js.map +1 -1
- package/dist/agents/index.d.ts +1 -1
- package/dist/agents/index.d.ts.map +1 -1
- package/dist/agents/types.d.ts +33 -0
- package/dist/agents/types.d.ts.map +1 -1
- package/dist/cli/_progress.d.ts +138 -0
- package/dist/cli/_progress.d.ts.map +1 -0
- package/dist/cli/_progress.js +176 -0
- package/dist/cli/_progress.js.map +1 -0
- package/dist/cli/index.d.ts.map +1 -1
- package/dist/cli/index.js +2 -0
- package/dist/cli/index.js.map +1 -1
- package/dist/cli/research.d.ts +18 -20
- package/dist/cli/research.d.ts.map +1 -1
- package/dist/cli/research.js +318 -203
- package/dist/cli/research.js.map +1 -1
- package/dist/cli/review.d.ts +7 -0
- package/dist/cli/review.d.ts.map +1 -1
- package/dist/cli/review.js +46 -1
- package/dist/cli/review.js.map +1 -1
- package/dist/cli/source.d.ts +23 -2
- package/dist/cli/source.d.ts.map +1 -1
- package/dist/cli/source.js +428 -7
- package/dist/cli/source.js.map +1 -1
- package/dist/cli/update.d.ts +7 -0
- package/dist/cli/update.d.ts.map +1 -1
- package/dist/cli/update.js +41 -1
- package/dist/cli/update.js.map +1 -1
- package/dist/cli/watch.d.ts.map +1 -1
- package/dist/cli/watch.js +67 -3
- package/dist/cli/watch.js.map +1 -1
- package/dist/cli/workflow/generate-combined.d.ts +100 -0
- package/dist/cli/workflow/generate-combined.d.ts.map +1 -0
- package/dist/cli/workflow/generate-combined.js +387 -0
- package/dist/cli/workflow/generate-combined.js.map +1 -0
- package/dist/cli/workflow/generate-watch.d.ts +142 -0
- package/dist/cli/workflow/generate-watch.d.ts.map +1 -0
- package/dist/cli/workflow/generate-watch.js +338 -0
- package/dist/cli/workflow/generate-watch.js.map +1 -0
- package/dist/cli/workflow.d.ts +29 -0
- package/dist/cli/workflow.d.ts.map +1 -0
- package/dist/cli/workflow.js +66 -0
- package/dist/cli/workflow.js.map +1 -0
- package/dist/core/feeds/_fetch.d.ts +10 -0
- package/dist/core/feeds/_fetch.d.ts.map +1 -1
- package/dist/core/feeds/_fetch.js +182 -0
- package/dist/core/feeds/_fetch.js.map +1 -1
- package/dist/core/feeds/_jsonpath.d.ts +57 -0
- package/dist/core/feeds/_jsonpath.d.ts.map +1 -0
- package/dist/core/feeds/_jsonpath.js +207 -0
- package/dist/core/feeds/_jsonpath.js.map +1 -0
- package/dist/core/feeds/html-js.d.ts +8 -0
- package/dist/core/feeds/html-js.d.ts.map +1 -1
- package/dist/core/feeds/html-js.js +47 -1
- package/dist/core/feeds/html-js.js.map +1 -1
- package/dist/core/feeds/index.d.ts +1 -1
- package/dist/core/feeds/index.d.ts.map +1 -1
- package/dist/core/feeds/index.js +4 -0
- package/dist/core/feeds/index.js.map +1 -1
- package/dist/core/feeds/json-api.d.ts +29 -0
- package/dist/core/feeds/json-api.d.ts.map +1 -0
- package/dist/core/feeds/json-api.js +860 -0
- package/dist/core/feeds/json-api.js.map +1 -0
- package/dist/core/feeds/json-feed.d.ts +11 -0
- package/dist/core/feeds/json-feed.d.ts.map +1 -0
- package/dist/core/feeds/json-feed.js +242 -0
- package/dist/core/feeds/json-feed.js.map +1 -0
- package/dist/core/feeds/types.d.ts +123 -0
- package/dist/core/feeds/types.d.ts.map +1 -1
- package/dist/core/progress.d.ts +101 -0
- package/dist/core/progress.d.ts.map +1 -0
- package/dist/core/progress.js +212 -0
- package/dist/core/progress.js.map +1 -0
- package/dist/core/recipes.d.ts +138 -0
- package/dist/core/recipes.d.ts.map +1 -0
- package/dist/core/recipes.js +242 -0
- package/dist/core/recipes.js.map +1 -0
- package/dist/core/watcher.d.ts +61 -1
- package/dist/core/watcher.d.ts.map +1 -1
- package/dist/core/watcher.js +99 -2
- package/dist/core/watcher.js.map +1 -1
- package/dist/recipes/aws-whats-new.yaml +87 -0
- package/dist/recipes/dev-to.yaml +40 -0
- package/dist/schemas/index.d.ts +1 -0
- package/dist/schemas/index.d.ts.map +1 -1
- package/dist/schemas/index.js +1 -0
- package/dist/schemas/index.js.map +1 -1
- package/dist/schemas/recipe.d.ts +127 -0
- package/dist/schemas/recipe.d.ts.map +1 -0
- package/dist/schemas/recipe.js +57 -0
- package/dist/schemas/recipe.js.map +1 -0
- package/dist/schemas/source.d.ts +222 -0
- package/dist/schemas/source.d.ts.map +1 -1
- package/dist/schemas/source.js +234 -0
- package/dist/schemas/source.js.map +1 -1
- package/dist/templates/agents/AGENTS.md +33 -3
- package/dist/templates/feedradar.md +23 -8
- package/dist/templates/workflows/combined.template.yaml.tmpl +110 -0
- package/dist/templates/workflows/watch.template.yaml.tmpl +103 -0
- package/package.json +1 -2
package/dist/schemas/source.d.ts
CHANGED
|
@@ -5,6 +5,8 @@ export declare const SourceKindSchema: z.ZodEnum<{
|
|
|
5
5
|
"html-js": "html-js";
|
|
6
6
|
"github-releases": "github-releases";
|
|
7
7
|
"npm-registry": "npm-registry";
|
|
8
|
+
"json-feed": "json-feed";
|
|
9
|
+
"json-api": "json-api";
|
|
8
10
|
}>;
|
|
9
11
|
export type SourceKind = z.infer<typeof SourceKindSchema>;
|
|
10
12
|
/**
|
|
@@ -125,6 +127,180 @@ export declare const SourceJsOptionsSchema: z.ZodObject<{
|
|
|
125
127
|
userAgent: z.ZodOptional<z.ZodString>;
|
|
126
128
|
}, z.core.$strip>;
|
|
127
129
|
export type SourceJsOptions = z.infer<typeof SourceJsOptionsSchema>;
|
|
130
|
+
/**
|
|
131
|
+
* HTTP options for `kind: json-api` sources (ADR-0012 §D2).
|
|
132
|
+
*
|
|
133
|
+
* Phase 1 supports GET only. `headers` accepts arbitrary key/value pairs and
|
|
134
|
+
* supports `${VAR}` env-var interpolation (resolved by the adapter, never
|
|
135
|
+
* persisted to log / frontmatter — see ADR-0012 §D5c).
|
|
136
|
+
*
|
|
137
|
+
* The schema deliberately does not validate header values against env names —
|
|
138
|
+
* the adapter handles unresolved `${VAR}` placeholders by omitting the header
|
|
139
|
+
* (degraded fetch). This lets public APIs work without env wiring while
|
|
140
|
+
* authenticated APIs fail-fast with a 401/403 at runtime.
|
|
141
|
+
*/
|
|
142
|
+
export declare const SourceHttpOptionsSchema: z.ZodObject<{
|
|
143
|
+
method: z.ZodDefault<z.ZodLiteral<"GET">>;
|
|
144
|
+
headers: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
145
|
+
}, z.core.$strip>;
|
|
146
|
+
export type SourceHttpOptions = z.infer<typeof SourceHttpOptionsSchema>;
|
|
147
|
+
/**
|
|
148
|
+
* Pagination configuration for `kind: json-api` sources (ADR-0012 §D2).
|
|
149
|
+
*
|
|
150
|
+
* Five wire formats are supported:
|
|
151
|
+
*
|
|
152
|
+
* page — `?page=K&pageSize=N` (e.g. AWS What's New, dev.to)
|
|
153
|
+
* offset — `?offset=K&limit=N`
|
|
154
|
+
* cursor — `?after=<cursorValue>` with `nextCursor` extracted via JSONPath
|
|
155
|
+
* link-header — `Link: <...>; rel="next"` HTTP header
|
|
156
|
+
* token — `?pageToken=<opaque>` opaque continuation token
|
|
157
|
+
* none — single request, no pagination
|
|
158
|
+
*
|
|
159
|
+
* `maxPages` is a hard cap to prevent runaway loops / DoS on misconfigured
|
|
160
|
+
* recipes. The default (20) matches a conservative bound for normal-mode
|
|
161
|
+
* fetching; `--backfill` can override via `--max-pages` to walk further.
|
|
162
|
+
*
|
|
163
|
+
* `nextCursorPath` / `totalPath` are JSONPath-lite expressions resolved against
|
|
164
|
+
* the parsed response body. `totalPath` is consulted in backfill mode to
|
|
165
|
+
* compute an upper bound on pages and short-circuit early when the total is
|
|
166
|
+
* known.
|
|
167
|
+
*/
|
|
168
|
+
export declare const SourcePaginationSchema: z.ZodObject<{
|
|
169
|
+
type: z.ZodEnum<{
|
|
170
|
+
page: "page";
|
|
171
|
+
offset: "offset";
|
|
172
|
+
cursor: "cursor";
|
|
173
|
+
"link-header": "link-header";
|
|
174
|
+
token: "token";
|
|
175
|
+
none: "none";
|
|
176
|
+
}>;
|
|
177
|
+
param: z.ZodOptional<z.ZodString>;
|
|
178
|
+
start: z.ZodOptional<z.ZodNumber>;
|
|
179
|
+
pageSize: z.ZodOptional<z.ZodNumber>;
|
|
180
|
+
pageSizeParam: z.ZodOptional<z.ZodString>;
|
|
181
|
+
nextCursorPath: z.ZodOptional<z.ZodString>;
|
|
182
|
+
totalPath: z.ZodOptional<z.ZodString>;
|
|
183
|
+
maxPages: z.ZodDefault<z.ZodNumber>;
|
|
184
|
+
}, z.core.$strip>;
|
|
185
|
+
export type SourcePagination = z.infer<typeof SourcePaginationSchema>;
|
|
186
|
+
/**
|
|
187
|
+
* Selector ruleset for `kind: json-api` sources (ADR-0012 §D2).
|
|
188
|
+
*
|
|
189
|
+
* Every selector is a JSONPath-lite expression (`src/core/feeds/_jsonpath.ts`).
|
|
190
|
+
*
|
|
191
|
+
* Every field is optional. When omitted the adapter falls back to a default
|
|
192
|
+
* selector chain per field (#174 / ADR-0012 §D2 defaults). For "simple"
|
|
193
|
+
* page-based APIs (dev.to, JSON Feed-shaped) the recipe can therefore omit
|
|
194
|
+
* `jsonSelectors` entirely (or use just `{}`) and rely on:
|
|
195
|
+
*
|
|
196
|
+
* items — `$.items[*] || $.data[*] || $.results[*] || $.posts[*] || $.entries[*] || $[*]`
|
|
197
|
+
* title — `$.title || $.name || $.headline`
|
|
198
|
+
* link — `$.url || $.link || $.permalink || $.html_url`
|
|
199
|
+
* publishedAt — `$.publishedAt || $.published_at || $.date || $.created_at || $.pubDate`
|
|
200
|
+
* summary — `$.summary || $.description || $.excerpt || $.body`
|
|
201
|
+
*
|
|
202
|
+
* - `publisherId` has no fallback chain (stable id derivation falls through
|
|
203
|
+
* to `link` URL by default; see `derive-id.ts`).
|
|
204
|
+
* - `body` / `tags` have no fallback chain (rarely needed for normalization).
|
|
205
|
+
* - `linkBase` resolves relative `link` values against an explicit base URL
|
|
206
|
+
* (defaults to `source.url`). See field-level docstring for details (#204).
|
|
207
|
+
*
|
|
208
|
+
* Note that selectors are evaluated against each item element (already
|
|
209
|
+
* dereferenced via `items`), so paths inside this schema commonly use `$` as
|
|
210
|
+
* the per-item root (e.g. `$.title`, `$.created_at`).
|
|
211
|
+
*/
|
|
212
|
+
export declare const SourceJsonApiSelectorsSchema: z.ZodObject<{
|
|
213
|
+
items: z.ZodOptional<z.ZodString>;
|
|
214
|
+
title: z.ZodOptional<z.ZodString>;
|
|
215
|
+
link: z.ZodOptional<z.ZodString>;
|
|
216
|
+
publisherId: z.ZodOptional<z.ZodString>;
|
|
217
|
+
summary: z.ZodOptional<z.ZodString>;
|
|
218
|
+
publishedAt: z.ZodOptional<z.ZodString>;
|
|
219
|
+
body: z.ZodOptional<z.ZodString>;
|
|
220
|
+
tags: z.ZodOptional<z.ZodString>;
|
|
221
|
+
linkBase: z.ZodOptional<z.ZodString>;
|
|
222
|
+
}, z.core.$strip>;
|
|
223
|
+
export type SourceJsonApiSelectors = z.infer<typeof SourceJsonApiSelectorsSchema>;
|
|
224
|
+
/**
|
|
225
|
+
* Facet sweep recipe extension for `kind: json-api` (ADR-0017).
|
|
226
|
+
*
|
|
227
|
+
* `facets` is an outer "data slice" axis that wraps the inner pagination
|
|
228
|
+
* loop. It exists because some APIs cap their offset/page traversal at a
|
|
229
|
+
* fixed total (e.g. AWS dirs API: `(page + 1) * size <= 10000`), making
|
|
230
|
+
* the upper ~half of the catalog unreachable via inner pagination alone.
|
|
231
|
+
* Splitting the request by a facet (year, category, …) keeps every slice
|
|
232
|
+
* comfortably under the cap and recovers full-history coverage.
|
|
233
|
+
*
|
|
234
|
+
* Two facet types are supported in Phase 1:
|
|
235
|
+
*
|
|
236
|
+
* - `range`: a numeric range `[start, end]` (inclusive) walked with `step`.
|
|
237
|
+
* Useful for year sweeps where the API exposes a `year=YYYY` filter.
|
|
238
|
+
* - `enum`: an explicit list of values (string / number). Useful for
|
|
239
|
+
* non-numeric or non-sequential facets (categories, regions, tags).
|
|
240
|
+
*
|
|
241
|
+
* The `template` must contain a literal `{}` placeholder which the
|
|
242
|
+
* adapter substitutes with the current facet value (e.g.
|
|
243
|
+
* `whats-new-v2#year#{}` → `whats-new-v2#year#2024`). The substituted
|
|
244
|
+
* string is injected into the URL as the value of the `param` query
|
|
245
|
+
* parameter.
|
|
246
|
+
*
|
|
247
|
+
* Multi-facet support (e.g. year × category) is explicitly deferred to a
|
|
248
|
+
* future ADR; the adapter throws when more than one facet entry is
|
|
249
|
+
* present. The schema allows a `Record<string, Facet>` purely for
|
|
250
|
+
* forward-compatibility — single entry today, additional entries later
|
|
251
|
+
* without a schema break.
|
|
252
|
+
*
|
|
253
|
+
* See ADR-0017 for the full design rationale (option A vs option D
|
|
254
|
+
* `pagination.type: facet`, lastSeenIds-as-global semantics, conditional
|
|
255
|
+
* GET disablement in facet sweep mode).
|
|
256
|
+
*/
|
|
257
|
+
export declare const SourceFacetRangeSchema: z.ZodObject<{
|
|
258
|
+
type: z.ZodLiteral<"range">;
|
|
259
|
+
param: z.ZodString;
|
|
260
|
+
template: z.ZodString;
|
|
261
|
+
range: z.ZodTuple<[z.ZodNumber, z.ZodNumber], null>;
|
|
262
|
+
step: z.ZodDefault<z.ZodNumber>;
|
|
263
|
+
}, z.core.$strip>;
|
|
264
|
+
export type SourceFacetRange = z.infer<typeof SourceFacetRangeSchema>;
|
|
265
|
+
export declare const SourceFacetEnumSchema: z.ZodObject<{
|
|
266
|
+
type: z.ZodLiteral<"enum">;
|
|
267
|
+
param: z.ZodString;
|
|
268
|
+
template: z.ZodString;
|
|
269
|
+
values: z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>>;
|
|
270
|
+
}, z.core.$strip>;
|
|
271
|
+
export type SourceFacetEnum = z.infer<typeof SourceFacetEnumSchema>;
|
|
272
|
+
export declare const SourceFacetSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
273
|
+
type: z.ZodLiteral<"range">;
|
|
274
|
+
param: z.ZodString;
|
|
275
|
+
template: z.ZodString;
|
|
276
|
+
range: z.ZodTuple<[z.ZodNumber, z.ZodNumber], null>;
|
|
277
|
+
step: z.ZodDefault<z.ZodNumber>;
|
|
278
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
279
|
+
type: z.ZodLiteral<"enum">;
|
|
280
|
+
param: z.ZodString;
|
|
281
|
+
template: z.ZodString;
|
|
282
|
+
values: z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>>;
|
|
283
|
+
}, z.core.$strip>], "type">;
|
|
284
|
+
export type SourceFacet = z.infer<typeof SourceFacetSchema>;
|
|
285
|
+
/**
|
|
286
|
+
* Map of facet-name → facet-spec. In Phase 1 the adapter enforces a
|
|
287
|
+
* single entry at runtime (multi-facet is deferred to a future ADR), but
|
|
288
|
+
* the schema accepts the record shape so future multi-facet support does
|
|
289
|
+
* not require a schema break.
|
|
290
|
+
*/
|
|
291
|
+
export declare const SourceFacetsSchema: z.ZodRecord<z.ZodString, z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
292
|
+
type: z.ZodLiteral<"range">;
|
|
293
|
+
param: z.ZodString;
|
|
294
|
+
template: z.ZodString;
|
|
295
|
+
range: z.ZodTuple<[z.ZodNumber, z.ZodNumber], null>;
|
|
296
|
+
step: z.ZodDefault<z.ZodNumber>;
|
|
297
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
298
|
+
type: z.ZodLiteral<"enum">;
|
|
299
|
+
param: z.ZodString;
|
|
300
|
+
template: z.ZodString;
|
|
301
|
+
values: z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>>;
|
|
302
|
+
}, z.core.$strip>], "type">>;
|
|
303
|
+
export type SourceFacets = z.infer<typeof SourceFacetsSchema>;
|
|
128
304
|
export declare const SourceSchema: z.ZodObject<{
|
|
129
305
|
id: z.ZodString;
|
|
130
306
|
kind: z.ZodEnum<{
|
|
@@ -133,6 +309,8 @@ export declare const SourceSchema: z.ZodObject<{
|
|
|
133
309
|
"html-js": "html-js";
|
|
134
310
|
"github-releases": "github-releases";
|
|
135
311
|
"npm-registry": "npm-registry";
|
|
312
|
+
"json-feed": "json-feed";
|
|
313
|
+
"json-api": "json-api";
|
|
136
314
|
}>;
|
|
137
315
|
url: z.ZodString;
|
|
138
316
|
name: z.ZodOptional<z.ZodString>;
|
|
@@ -172,6 +350,50 @@ export declare const SourceSchema: z.ZodObject<{
|
|
|
172
350
|
timeout: z.ZodDefault<z.ZodNumber>;
|
|
173
351
|
userAgent: z.ZodOptional<z.ZodString>;
|
|
174
352
|
}, z.core.$strip>>;
|
|
353
|
+
http: z.ZodOptional<z.ZodObject<{
|
|
354
|
+
method: z.ZodDefault<z.ZodLiteral<"GET">>;
|
|
355
|
+
headers: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
356
|
+
}, z.core.$strip>>;
|
|
357
|
+
pagination: z.ZodOptional<z.ZodObject<{
|
|
358
|
+
type: z.ZodEnum<{
|
|
359
|
+
page: "page";
|
|
360
|
+
offset: "offset";
|
|
361
|
+
cursor: "cursor";
|
|
362
|
+
"link-header": "link-header";
|
|
363
|
+
token: "token";
|
|
364
|
+
none: "none";
|
|
365
|
+
}>;
|
|
366
|
+
param: z.ZodOptional<z.ZodString>;
|
|
367
|
+
start: z.ZodOptional<z.ZodNumber>;
|
|
368
|
+
pageSize: z.ZodOptional<z.ZodNumber>;
|
|
369
|
+
pageSizeParam: z.ZodOptional<z.ZodString>;
|
|
370
|
+
nextCursorPath: z.ZodOptional<z.ZodString>;
|
|
371
|
+
totalPath: z.ZodOptional<z.ZodString>;
|
|
372
|
+
maxPages: z.ZodDefault<z.ZodNumber>;
|
|
373
|
+
}, z.core.$strip>>;
|
|
374
|
+
jsonSelectors: z.ZodOptional<z.ZodObject<{
|
|
375
|
+
items: z.ZodOptional<z.ZodString>;
|
|
376
|
+
title: z.ZodOptional<z.ZodString>;
|
|
377
|
+
link: z.ZodOptional<z.ZodString>;
|
|
378
|
+
publisherId: z.ZodOptional<z.ZodString>;
|
|
379
|
+
summary: z.ZodOptional<z.ZodString>;
|
|
380
|
+
publishedAt: z.ZodOptional<z.ZodString>;
|
|
381
|
+
body: z.ZodOptional<z.ZodString>;
|
|
382
|
+
tags: z.ZodOptional<z.ZodString>;
|
|
383
|
+
linkBase: z.ZodOptional<z.ZodString>;
|
|
384
|
+
}, z.core.$strip>>;
|
|
385
|
+
facets: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
386
|
+
type: z.ZodLiteral<"range">;
|
|
387
|
+
param: z.ZodString;
|
|
388
|
+
template: z.ZodString;
|
|
389
|
+
range: z.ZodTuple<[z.ZodNumber, z.ZodNumber], null>;
|
|
390
|
+
step: z.ZodDefault<z.ZodNumber>;
|
|
391
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
392
|
+
type: z.ZodLiteral<"enum">;
|
|
393
|
+
param: z.ZodString;
|
|
394
|
+
template: z.ZodString;
|
|
395
|
+
values: z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>>;
|
|
396
|
+
}, z.core.$strip>], "type">>>;
|
|
175
397
|
trustLevel: z.ZodDefault<z.ZodEnum<{
|
|
176
398
|
trusted: "trusted";
|
|
177
399
|
untrusted: "untrusted";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"source.d.ts","sourceRoot":"","sources":["../../src/schemas/source.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,eAAO,MAAM,gBAAgB
|
|
1
|
+
{"version":3,"file":"source.d.ts","sourceRoot":"","sources":["../../src/schemas/source.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,eAAO,MAAM,gBAAgB;;;;;;;;EAQ3B,CAAC;AACH,MAAM,MAAM,UAAU,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,gBAAgB,CAAC,CAAC;AAE1D;;;;;;;GAOG;AACH,eAAO,MAAM,eAAe;;;;EAAyC,CAAC;AACtE,MAAM,MAAM,SAAS,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,eAAe,CAAC,CAAC;AAExD,qGAAqG;AACrG,eAAO,MAAM,gBAAgB;;;;;EAA+C,CAAC;AAC7E,MAAM,MAAM,UAAU,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,gBAAgB,CAAC,CAAC;AAE1D;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,gBAAgB;;;EAAmC,CAAC;AACjE,MAAM,MAAM,UAAU,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,gBAAgB,CAAC,CAAC;AAE1D,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;iBAM9B,CAAC;AACH,MAAM,MAAM,aAAa,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,mBAAmB,CAAC,CAAC;AAEhE;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,eAAO,MAAM,qBAAqB;;;;;;;;iBAQhC,CAAC;AACH,MAAM,MAAM,eAAe,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,qBAAqB,CAAC,CAAC;AAEpE;;;;;;;;;;;;;;;;;;GAkBG;AACH,eAAO,MAAM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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAyErB,CAAC;AACL,MAAM,MAAM,MAAM,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,YAAY,CAAC,CAAC"}
|
package/dist/schemas/source.js
CHANGED
|
@@ -5,6 +5,8 @@ export const SourceKindSchema = z.enum([
|
|
|
5
5
|
"html-js",
|
|
6
6
|
"github-releases",
|
|
7
7
|
"npm-registry",
|
|
8
|
+
"json-feed",
|
|
9
|
+
"json-api",
|
|
8
10
|
]);
|
|
9
11
|
/**
|
|
10
12
|
* Match modes for keyword evaluation (ADR-0006).
|
|
@@ -93,6 +95,212 @@ export const SourceJsOptionsSchema = z.object({
|
|
|
93
95
|
timeout: z.number().int().positive().default(30000),
|
|
94
96
|
userAgent: z.string().optional(),
|
|
95
97
|
});
|
|
98
|
+
/**
|
|
99
|
+
* HTTP options for `kind: json-api` sources (ADR-0012 §D2).
|
|
100
|
+
*
|
|
101
|
+
* Phase 1 supports GET only. `headers` accepts arbitrary key/value pairs and
|
|
102
|
+
* supports `${VAR}` env-var interpolation (resolved by the adapter, never
|
|
103
|
+
* persisted to log / frontmatter — see ADR-0012 §D5c).
|
|
104
|
+
*
|
|
105
|
+
* The schema deliberately does not validate header values against env names —
|
|
106
|
+
* the adapter handles unresolved `${VAR}` placeholders by omitting the header
|
|
107
|
+
* (degraded fetch). This lets public APIs work without env wiring while
|
|
108
|
+
* authenticated APIs fail-fast with a 401/403 at runtime.
|
|
109
|
+
*/
|
|
110
|
+
export const SourceHttpOptionsSchema = z.object({
|
|
111
|
+
method: z.literal("GET").default("GET"),
|
|
112
|
+
headers: z.record(z.string(), z.string()).default({}),
|
|
113
|
+
});
|
|
114
|
+
/**
|
|
115
|
+
* Pagination configuration for `kind: json-api` sources (ADR-0012 §D2).
|
|
116
|
+
*
|
|
117
|
+
* Five wire formats are supported:
|
|
118
|
+
*
|
|
119
|
+
* page — `?page=K&pageSize=N` (e.g. AWS What's New, dev.to)
|
|
120
|
+
* offset — `?offset=K&limit=N`
|
|
121
|
+
* cursor — `?after=<cursorValue>` with `nextCursor` extracted via JSONPath
|
|
122
|
+
* link-header — `Link: <...>; rel="next"` HTTP header
|
|
123
|
+
* token — `?pageToken=<opaque>` opaque continuation token
|
|
124
|
+
* none — single request, no pagination
|
|
125
|
+
*
|
|
126
|
+
* `maxPages` is a hard cap to prevent runaway loops / DoS on misconfigured
|
|
127
|
+
* recipes. The default (20) matches a conservative bound for normal-mode
|
|
128
|
+
* fetching; `--backfill` can override via `--max-pages` to walk further.
|
|
129
|
+
*
|
|
130
|
+
* `nextCursorPath` / `totalPath` are JSONPath-lite expressions resolved against
|
|
131
|
+
* the parsed response body. `totalPath` is consulted in backfill mode to
|
|
132
|
+
* compute an upper bound on pages and short-circuit early when the total is
|
|
133
|
+
* known.
|
|
134
|
+
*/
|
|
135
|
+
export const SourcePaginationSchema = z.object({
|
|
136
|
+
type: z.enum(["page", "offset", "cursor", "link-header", "token", "none"]),
|
|
137
|
+
/**
|
|
138
|
+
* Query parameter name for the page / offset / token (e.g. `page`, `offset`,
|
|
139
|
+
* `after`, `pageToken`). Required for `page` / `offset` / `cursor` / `token`;
|
|
140
|
+
* ignored for `link-header` / `none`.
|
|
141
|
+
*/
|
|
142
|
+
param: z.string().min(1).optional(),
|
|
143
|
+
/** Initial value (e.g. 0 for offset, 1 for page-number, undefined for cursor/token). */
|
|
144
|
+
start: z.number().int().optional(),
|
|
145
|
+
/** Items per page (e.g. 100 for AWS, 30 for dev.to). */
|
|
146
|
+
pageSize: z.number().int().positive().optional(),
|
|
147
|
+
/** Query parameter name for the page-size value. Defaults to `pageSize` when present. */
|
|
148
|
+
pageSizeParam: z.string().min(1).optional(),
|
|
149
|
+
/** JSONPath-lite to the next-cursor / next-token value in the response body. */
|
|
150
|
+
nextCursorPath: z.string().min(1).optional(),
|
|
151
|
+
/** JSONPath-lite to the total-count value in the response body (backfill-mode early-stop hint). */
|
|
152
|
+
totalPath: z.string().min(1).optional(),
|
|
153
|
+
/** Hard cap on pages traversed. Default 20 (normal mode); `--max-pages` overrides in backfill. */
|
|
154
|
+
maxPages: z.number().int().positive().default(20),
|
|
155
|
+
});
|
|
156
|
+
/**
|
|
157
|
+
* Selector ruleset for `kind: json-api` sources (ADR-0012 §D2).
|
|
158
|
+
*
|
|
159
|
+
* Every selector is a JSONPath-lite expression (`src/core/feeds/_jsonpath.ts`).
|
|
160
|
+
*
|
|
161
|
+
* Every field is optional. When omitted the adapter falls back to a default
|
|
162
|
+
* selector chain per field (#174 / ADR-0012 §D2 defaults). For "simple"
|
|
163
|
+
* page-based APIs (dev.to, JSON Feed-shaped) the recipe can therefore omit
|
|
164
|
+
* `jsonSelectors` entirely (or use just `{}`) and rely on:
|
|
165
|
+
*
|
|
166
|
+
* items — `$.items[*] || $.data[*] || $.results[*] || $.posts[*] || $.entries[*] || $[*]`
|
|
167
|
+
* title — `$.title || $.name || $.headline`
|
|
168
|
+
* link — `$.url || $.link || $.permalink || $.html_url`
|
|
169
|
+
* publishedAt — `$.publishedAt || $.published_at || $.date || $.created_at || $.pubDate`
|
|
170
|
+
* summary — `$.summary || $.description || $.excerpt || $.body`
|
|
171
|
+
*
|
|
172
|
+
* - `publisherId` has no fallback chain (stable id derivation falls through
|
|
173
|
+
* to `link` URL by default; see `derive-id.ts`).
|
|
174
|
+
* - `body` / `tags` have no fallback chain (rarely needed for normalization).
|
|
175
|
+
* - `linkBase` resolves relative `link` values against an explicit base URL
|
|
176
|
+
* (defaults to `source.url`). See field-level docstring for details (#204).
|
|
177
|
+
*
|
|
178
|
+
* Note that selectors are evaluated against each item element (already
|
|
179
|
+
* dereferenced via `items`), so paths inside this schema commonly use `$` as
|
|
180
|
+
* the per-item root (e.g. `$.title`, `$.created_at`).
|
|
181
|
+
*/
|
|
182
|
+
export const SourceJsonApiSelectorsSchema = z.object({
|
|
183
|
+
items: z.string().min(1).optional(),
|
|
184
|
+
title: z.string().min(1).optional(),
|
|
185
|
+
link: z.string().min(1).optional(),
|
|
186
|
+
publisherId: z.string().min(1).optional(),
|
|
187
|
+
summary: z.string().min(1).optional(),
|
|
188
|
+
publishedAt: z.string().min(1).optional(),
|
|
189
|
+
body: z.string().min(1).optional(),
|
|
190
|
+
tags: z.string().min(1).optional(),
|
|
191
|
+
/**
|
|
192
|
+
* Base URL used to resolve relative `link` values returned by the API
|
|
193
|
+
* (#204). Many APIs (e.g. AWS What's New) return `headlineUrl` as a path
|
|
194
|
+
* like `/about-aws/whats-new/.../` instead of a full URL, which causes
|
|
195
|
+
* every item to be silently dropped at `ItemSchema` validation. When
|
|
196
|
+
* `linkBase` is set, the adapter resolves relative `link` values against
|
|
197
|
+
* it (`new URL(raw, linkBase)`); when omitted, `source.url` is used as
|
|
198
|
+
* the base, mirroring how the html adapter resolves `<a href="/...">`.
|
|
199
|
+
* Absolute links pass through untouched in either case.
|
|
200
|
+
*
|
|
201
|
+
* Must be a fully-qualified http(s) URL — invalid bases would silently
|
|
202
|
+
* mis-resolve, so we fail-fast at schema parse time.
|
|
203
|
+
*/
|
|
204
|
+
linkBase: z.string().url().optional(),
|
|
205
|
+
});
|
|
206
|
+
/**
|
|
207
|
+
* Facet sweep recipe extension for `kind: json-api` (ADR-0017).
|
|
208
|
+
*
|
|
209
|
+
* `facets` is an outer "data slice" axis that wraps the inner pagination
|
|
210
|
+
* loop. It exists because some APIs cap their offset/page traversal at a
|
|
211
|
+
* fixed total (e.g. AWS dirs API: `(page + 1) * size <= 10000`), making
|
|
212
|
+
* the upper ~half of the catalog unreachable via inner pagination alone.
|
|
213
|
+
* Splitting the request by a facet (year, category, …) keeps every slice
|
|
214
|
+
* comfortably under the cap and recovers full-history coverage.
|
|
215
|
+
*
|
|
216
|
+
* Two facet types are supported in Phase 1:
|
|
217
|
+
*
|
|
218
|
+
* - `range`: a numeric range `[start, end]` (inclusive) walked with `step`.
|
|
219
|
+
* Useful for year sweeps where the API exposes a `year=YYYY` filter.
|
|
220
|
+
* - `enum`: an explicit list of values (string / number). Useful for
|
|
221
|
+
* non-numeric or non-sequential facets (categories, regions, tags).
|
|
222
|
+
*
|
|
223
|
+
* The `template` must contain a literal `{}` placeholder which the
|
|
224
|
+
* adapter substitutes with the current facet value (e.g.
|
|
225
|
+
* `whats-new-v2#year#{}` → `whats-new-v2#year#2024`). The substituted
|
|
226
|
+
* string is injected into the URL as the value of the `param` query
|
|
227
|
+
* parameter.
|
|
228
|
+
*
|
|
229
|
+
* Multi-facet support (e.g. year × category) is explicitly deferred to a
|
|
230
|
+
* future ADR; the adapter throws when more than one facet entry is
|
|
231
|
+
* present. The schema allows a `Record<string, Facet>` purely for
|
|
232
|
+
* forward-compatibility — single entry today, additional entries later
|
|
233
|
+
* without a schema break.
|
|
234
|
+
*
|
|
235
|
+
* See ADR-0017 for the full design rationale (option A vs option D
|
|
236
|
+
* `pagination.type: facet`, lastSeenIds-as-global semantics, conditional
|
|
237
|
+
* GET disablement in facet sweep mode).
|
|
238
|
+
*/
|
|
239
|
+
export const SourceFacetRangeSchema = z
|
|
240
|
+
.object({
|
|
241
|
+
type: z.literal("range"),
|
|
242
|
+
/** Query parameter name to inject (e.g. `tags.id`). */
|
|
243
|
+
param: z.string().min(1),
|
|
244
|
+
/**
|
|
245
|
+
* Template string with a literal `{}` placeholder for the facet value.
|
|
246
|
+
* E.g. `whats-new-v2#year#{}` → injected as `whats-new-v2#year#2024`.
|
|
247
|
+
*/
|
|
248
|
+
template: z.string().min(1),
|
|
249
|
+
/** Inclusive `[start, end]` range — both endpoints are visited. */
|
|
250
|
+
range: z.tuple([z.number(), z.number()]),
|
|
251
|
+
/** Step size (default 1). Must be a positive integer. */
|
|
252
|
+
step: z.number().int().positive().default(1),
|
|
253
|
+
})
|
|
254
|
+
.superRefine((value, ctx) => {
|
|
255
|
+
if (!value.template.includes("{}")) {
|
|
256
|
+
ctx.addIssue({
|
|
257
|
+
code: "custom",
|
|
258
|
+
path: ["template"],
|
|
259
|
+
message: "template must contain '{}' placeholder",
|
|
260
|
+
});
|
|
261
|
+
}
|
|
262
|
+
if (value.range[0] > value.range[1]) {
|
|
263
|
+
ctx.addIssue({
|
|
264
|
+
code: "custom",
|
|
265
|
+
path: ["range"],
|
|
266
|
+
message: "range start must be <= end",
|
|
267
|
+
});
|
|
268
|
+
}
|
|
269
|
+
});
|
|
270
|
+
export const SourceFacetEnumSchema = z
|
|
271
|
+
.object({
|
|
272
|
+
type: z.literal("enum"),
|
|
273
|
+
/** Query parameter name to inject (e.g. `category`). */
|
|
274
|
+
param: z.string().min(1),
|
|
275
|
+
/**
|
|
276
|
+
* Template string with a literal `{}` placeholder for the facet value.
|
|
277
|
+
* The adapter coerces non-string values via `String(value)` before
|
|
278
|
+
* substitution.
|
|
279
|
+
*/
|
|
280
|
+
template: z.string().min(1),
|
|
281
|
+
/** Explicit list of facet values to sweep. */
|
|
282
|
+
values: z.array(z.union([z.string(), z.number()])).min(1),
|
|
283
|
+
})
|
|
284
|
+
.superRefine((value, ctx) => {
|
|
285
|
+
if (!value.template.includes("{}")) {
|
|
286
|
+
ctx.addIssue({
|
|
287
|
+
code: "custom",
|
|
288
|
+
path: ["template"],
|
|
289
|
+
message: "template must contain '{}' placeholder",
|
|
290
|
+
});
|
|
291
|
+
}
|
|
292
|
+
});
|
|
293
|
+
export const SourceFacetSchema = z.discriminatedUnion("type", [
|
|
294
|
+
SourceFacetRangeSchema,
|
|
295
|
+
SourceFacetEnumSchema,
|
|
296
|
+
]);
|
|
297
|
+
/**
|
|
298
|
+
* Map of facet-name → facet-spec. In Phase 1 the adapter enforces a
|
|
299
|
+
* single entry at runtime (multi-facet is deferred to a future ADR), but
|
|
300
|
+
* the schema accepts the record shape so future multi-facet support does
|
|
301
|
+
* not require a schema break.
|
|
302
|
+
*/
|
|
303
|
+
export const SourceFacetsSchema = z.record(z.string().min(1), SourceFacetSchema);
|
|
96
304
|
/**
|
|
97
305
|
* Validate `Source.url` per kind.
|
|
98
306
|
*
|
|
@@ -137,6 +345,19 @@ export const SourceSchema = z
|
|
|
137
345
|
// existing source YAMLs (and `kind: html` ones) parse unchanged; the
|
|
138
346
|
// adapter applies defaults when the field is omitted entirely.
|
|
139
347
|
js: SourceJsOptionsSchema.optional(),
|
|
348
|
+
// `http` / `pagination` / `jsonSelectors` are consulted only by the
|
|
349
|
+
// `json-api` adapter (ADR-0012). Marked optional so existing source YAMLs
|
|
350
|
+
// and other kinds parse unchanged. The `jsonSelectors` name disambiguates
|
|
351
|
+
// from the css-selector `selectors` field that html / html-js use.
|
|
352
|
+
http: SourceHttpOptionsSchema.optional(),
|
|
353
|
+
pagination: SourcePaginationSchema.optional(),
|
|
354
|
+
jsonSelectors: SourceJsonApiSelectorsSchema.optional(),
|
|
355
|
+
// Facet sweep recipe extension (ADR-0017). Independent of
|
|
356
|
+
// `pagination`: `facets` is the outer "data slice" axis, `pagination`
|
|
357
|
+
// is the inner per-request page traversal. Only consulted by the
|
|
358
|
+
// `json-api` adapter. Single-facet only in Phase 1 — multi-facet is
|
|
359
|
+
// schema-allowed for forward-compat but the adapter throws at runtime.
|
|
360
|
+
facets: SourceFacetsSchema.optional(),
|
|
140
361
|
// `trustLevel` defaults to `"untrusted"` so existing source YAMLs (which
|
|
141
362
|
// omit the field entirely) keep their current treatment. Per ADR-0009 M4
|
|
142
363
|
// this is schema-only; policy branches that read `trustLevel` arrive in a
|
|
@@ -158,5 +379,18 @@ export const SourceSchema = z
|
|
|
158
379
|
message: `selectors is required when kind is '${value.kind}'`,
|
|
159
380
|
});
|
|
160
381
|
}
|
|
382
|
+
if (value.kind === "json-api") {
|
|
383
|
+
// `jsonSelectors` is now optional — when omitted the adapter relies on
|
|
384
|
+
// its default selector chain (ADR-0012 §D2 / #174). Most "simple"
|
|
385
|
+
// page-based APIs work with just `pagination` set; complex shapes
|
|
386
|
+
// (AWS What's New, nested fields) still need explicit selectors.
|
|
387
|
+
if (value.pagination === undefined) {
|
|
388
|
+
ctx.addIssue({
|
|
389
|
+
code: "custom",
|
|
390
|
+
path: ["pagination"],
|
|
391
|
+
message: "pagination is required when kind is 'json-api'",
|
|
392
|
+
});
|
|
393
|
+
}
|
|
394
|
+
}
|
|
161
395
|
});
|
|
162
396
|
//# sourceMappingURL=source.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"source.js","sourceRoot":"","sources":["../../src/schemas/source.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,CAAC,IAAI,CAAC;IACrC,KAAK;IACL,MAAM;IACN,SAAS;IACT,iBAAiB;IACjB,cAAc;
|
|
1
|
+
{"version":3,"file":"source.js","sourceRoot":"","sources":["../../src/schemas/source.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,CAAC,IAAI,CAAC;IACrC,KAAK;IACL,MAAM;IACN,SAAS;IACT,iBAAiB;IACjB,cAAc;IACd,WAAW;IACX,UAAU;CACX,CAAC,CAAC;AAGH;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,eAAe,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC,MAAM,EAAE,WAAW,EAAE,OAAO,CAAC,CAAC,CAAC;AAGtE,qGAAqG;AACrG,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC,OAAO,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC;AAG7E;;;;;;;;;;;;GAYG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC,SAAS,EAAE,WAAW,CAAC,CAAC,CAAC;AAGjE,MAAM,CAAC,MAAM,mBAAmB,GAAG,CAAC,CAAC,MAAM,CAAC;IAC1C,QAAQ,EAAE,CAAC,C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ルを上書き
|
|
49
49
|
|
|
50
50
|
# 監視対象の管理
|
|
51
|
-
radar source add <id> --kind <rss|html|html-js|github-releases|npm-registry> --url <url> [options]
|
|
51
|
+
radar source add <id> --kind <rss|html|html-js|github-releases|npm-registry|json-feed|json-api> --url <url> [options]
|
|
52
52
|
radar source list
|
|
53
|
+
radar source recipes # バンドル recipe を一覧表示 (ADR-0012)
|
|
54
|
+
radar source add <id> --recipe <name> [--keywords ... --tags ... --name ...] # recipe ベースで 1 行追加
|
|
53
55
|
radar source test <id> [--limit N] [--show-content] # state/items を書き換えず取得 + フィルタを試す
|
|
54
56
|
radar source remove <id>
|
|
55
57
|
|
|
58
|
+
# JSON API recipe を pagination 付きで追加(ADR-0012)
|
|
59
|
+
# `facets:` (年・カテゴリ単位の sweep) は flag では設定できず recipe のみ (ADR-0017)
|
|
60
|
+
radar source add aws-whats-new --kind json-api \
|
|
61
|
+
--url "https://aws.amazon.com/api/dirs/items/search?item.directoryId=whats-new-v2&size=100&page=0" \
|
|
62
|
+
--keywords "Bedrock,Claude" \
|
|
63
|
+
--pagination-strategy page --page-size 100 --max-pages 30
|
|
64
|
+
|
|
65
|
+
# 同じことを bundled recipe で 1 行で (year facet sweep 付き、全 21,834 件カバー)
|
|
66
|
+
radar source add aws-watch --recipe aws-whats-new --keywords "Bedrock,Claude"
|
|
67
|
+
|
|
68
|
+
# JSON Feed (1.0 / 1.1) は URL のみで動く zero-config
|
|
69
|
+
radar source add example-microblog --kind json-feed \
|
|
70
|
+
--url https://example.micro.blog/feed.json \
|
|
71
|
+
--keywords "release"
|
|
72
|
+
|
|
56
73
|
# 監視実行 (新着検出 → items/*.yaml に detected で書く)
|
|
57
74
|
radar watch run
|
|
58
75
|
|
|
76
|
+
# 過去全履歴の一括取り込み (kind: json-api / github-releases / npm-registry)
|
|
77
|
+
# AWS は recipe の facets.year + per-facet maxPages=30 で 21,834 件を完全カバー (ADR-0017)
|
|
78
|
+
radar watch run --source aws-whats-new --backfill
|
|
79
|
+
|
|
59
80
|
# 検出済み item に対する操作
|
|
60
|
-
radar research <item-id> --agent <agent>
|
|
81
|
+
radar research <item-id> --agent <agent> [--verbose] # 調査レポートを生成 (status: detected -> researched)。--verbose で agent stdout を直接見る (ADR-0015)
|
|
61
82
|
radar research --digest <item-id> <item-id> ... [--agent <agent>] # 複数 item を 1 digest にまとめる (ADR-0011)
|
|
83
|
+
radar research --batch [--max-items N] [--filter-tags <list>] [--agent <agent>] # detected を一括 research (ADR-0014 D3a、--max-items 既定 10)
|
|
62
84
|
radar review <research-id> --agent <agent> # 既存レポートをレビュー (status: researched -> reviewed)
|
|
63
85
|
radar update <research-id> --agent <agent> # v+1 を生成 (item status は変えない)
|
|
64
86
|
radar dismiss <item-id> # LLM 不要、item を dismissed に
|
|
87
|
+
|
|
88
|
+
# GitHub Actions workflow の後追い生成 (ADR-0014)
|
|
89
|
+
radar workflow generate watch [--cron "<expr>"] [--agent <agent>] [--output <path>]
|
|
90
|
+
radar workflow generate combined [--watch-cron "<expr>"] [--max-items N] [--filter-tags <list>] [--agent <agent>] [--output <path>]
|
|
65
91
|
```
|
|
66
92
|
|
|
93
|
+
> **自動 research のコスト管理 (重要)**: `radar workflow generate combined` は watch → 自動 research を連鎖する workflow を生成し、`--max-items N` (既定 10) のハードキャップを YAML literal + CLI default の **二重防御**で焼き込む (ADR-0014 D3a)。`--max-items 100` のように大きい値を渡す前に必ず agent provider の billing alert を設定すること。暴走に気付いたら GitHub UI から workflow を `Disable workflow` で即停止する。詳細は `docs/user-guide.md` の「[`radar workflow generate`](https://github.com/ozzy-labs/feedradar/blob/main/docs/user-guide.md#radar-workflow-generate)」を参照。
|
|
94
|
+
>
|
|
95
|
+
> **進捗表示 (ADR-0015)**: `research` / `review` / `update` / `watch run --backfill` / html-js fetch / `source test` は stderr に phase markers + spinner + 副次メトリクス (`stdout` / `output` / `page x/N`) を出力する。`--verbose` で agent stdout を pass-through(デバッグ・「フリーズに見える」時の第一手)、`--quiet` または `RADAR_NO_PROGRESS=1` で完全に黙らせる。詳細は `docs/user-guide.md` の「[進捗表示 / verbose / quiet](https://github.com/ozzy-labs/feedradar/blob/main/docs/user-guide.md#進捗表示--verbose--quiet)」を参照。
|
|
96
|
+
|
|
67
97
|
`<agent>` の値: `claude-code` / `codex-cli` / `gemini-cli` / `copilot`
|
|
68
98
|
|
|
69
99
|
## 利用可能な slash commands (4 agent 共通)
|
|
@@ -145,7 +175,7 @@ agent の選択は CLI が強制せず、ユーザー判断です。
|
|
|
145
175
|
|
|
146
176
|
## セキュリティ警告 (untrusted external content)
|
|
147
177
|
|
|
148
|
-
`radar` が fetch する外部 feed (RSS / HTML / HTML (JS rendered, `kind: html-js`) / GitHub Releases / npm registry) のコンテンツは **untrusted** として扱われます ([ADR-0009](https://github.com/ozzy-labs/feedradar/blob/main/docs/adr/0009-untrusted-external-content-handling.md))。攻撃者が feed 内容に prompt injection を仕込む可能性があるため:
|
|
178
|
+
`radar` が fetch する外部 feed (RSS / HTML / HTML (JS rendered, `kind: html-js`) / GitHub Releases / npm registry / JSON Feed / JSON API) のコンテンツは **untrusted** として扱われます ([ADR-0009](https://github.com/ozzy-labs/feedradar/blob/main/docs/adr/0009-untrusted-external-content-handling.md))。攻撃者が feed 内容に prompt injection を仕込む可能性があるため:
|
|
149
179
|
|
|
150
180
|
- agent に渡すコンテンツは boundary marker で囲まれ、procedure 本体と分離される
|
|
151
181
|
- `sources/<id>.yaml` の `trustLevel` で `"trusted" | "untrusted"` を per-source で指定可能 (既定 `"untrusted"`)
|