@rackbops/docket-types 0.18.0 → 0.20.0
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 +20 -1
- package/dist/index.d.ts +7 -5
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +8 -3
- package/dist/index.js.map +1 -1
- package/dist/news.d.ts +190 -0
- package/dist/news.d.ts.map +1 -0
- package/dist/news.js +503 -0
- package/dist/news.js.map +1 -0
- package/dist/reminder.d.ts +2 -1
- package/dist/reminder.d.ts.map +1 -1
- package/dist/reminder.js +12 -1
- package/dist/reminder.js.map +1 -1
- package/dist/want-ebay.d.ts +27 -3
- package/dist/want-ebay.d.ts.map +1 -1
- package/dist/want-ebay.js +120 -1
- package/dist/want-ebay.js.map +1 -1
- package/dist/want-sources.d.ts +17 -0
- package/dist/want-sources.d.ts.map +1 -1
- package/dist/want-sources.js.map +1 -1
- package/dist/wantjudge.d.ts.map +1 -1
- package/dist/wantjudge.js +7 -2
- package/dist/wantjudge.js.map +1 -1
- package/dist/wantlist.d.ts +35 -5
- package/dist/wantlist.d.ts.map +1 -1
- package/dist/wantlist.js +95 -14
- package/dist/wantlist.js.map +1 -1
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
The tracker's task types, built on `@rackbops/docket-core`'s contract. Shipped so far:
|
|
4
4
|
|
|
5
|
-
- `reminder` (Lepid-Labs/city-hall#7): notify lane, `once` or `calendar`, done and snooze replies.
|
|
5
|
+
- `reminder` (Lepid-Labs/city-hall#7): notify lane, `once` or `calendar`, done and snooze replies. Done on a one-off reminder finishes the task; on a recurring one it answers that run.
|
|
6
6
|
- `renewal` (Lepid-Labs/city-hall#11): a `period` schedule rolling from the renewal date, asking
|
|
7
7
|
keep / cancel / renewed at lead time; the decision and the amount recorded per period (the current
|
|
8
8
|
row in the task's state, the history in the series); cancel ends the task.
|
|
@@ -213,11 +213,30 @@ The tracker's task types, built on `@rackbops/docket-core`'s contract. Shipped s
|
|
|
213
213
|
when the source is read, so it is never told, from every source; a judged watch checks its
|
|
214
214
|
waiting listings again when it settles them (docket#77); `parseExclude` reads the list from
|
|
215
215
|
one comma-separated field, and `isExcluded` is the test.
|
|
216
|
+
Its optional `confirm` words (0.20.0) mark what the wanted thing's listings say: a listing whose
|
|
217
|
+
title has none is read in full where its source can (`Source.detail`: eBay's getItem, its item
|
|
218
|
+
specifics and description, nothing kept), then told if that has one, ruled out if its title or
|
|
219
|
+
full text has an `unconfirmed` entry, and otherwise told marked `check: not confirmed as ...`.
|
|
220
|
+
Every listing a source can read in full is read once before it is told (all of a look's reads at
|
|
221
|
+
once), so an eBay DM line also shows its shipping. A ruled-out listing is remembered as told, so
|
|
222
|
+
taking an `unconfirmed` word away later does not bring it back (`confirmListings`, `hasConfirm`).
|
|
223
|
+
A judged watch (below) reads nothing in full.
|
|
216
224
|
- `wantjudge` (category 2, plan 5.4, item 63): the same watch on the execute lane. New listings
|
|
217
225
|
are read in plain code (no charge), then one Job has the model judge each one and its seller
|
|
218
226
|
(WebFetch only on the watch's own host, never WebSearch or the runner's files; 12 turns,
|
|
219
227
|
0.50 USD, 5 minutes). The DM puts the ones worth a look first with the model's note; a look
|
|
220
228
|
that fails for good sends the listings unchecked.
|
|
229
|
+
- `news` (category 1, plan item 153, docket#78): execute lane, `calendar` every N days at the
|
|
230
|
+
owner's hour. A search Job (WebSearch and WebFetch, never eBay; 25 turns, 1.50 USD, 10
|
|
231
|
+
minutes) looks for items about one `subject` from the last 30 days that fit `include`, told
|
|
232
|
+
how to tell the subject apart (`disambiguate`) and, with `shows`, to give a show's city, venue,
|
|
233
|
+
date and tickets. Items seen before (by link, or by the title's words once sent), eBay links
|
|
234
|
+
and items whose title or kind holds an `exclude` entry are dropped in plain code; with nothing
|
|
235
|
+
left the run ends with "no news" and no DM. Otherwise a reviewer Job (12 turns, 0.75 USD, 5 minutes) checks each
|
|
236
|
+
item against its own page (the subject itself, a kind that counts, recent, nothing called on
|
|
237
|
+
sale from a snippet) and only the kept ones are DMed, each a finding with its link and date.
|
|
238
|
+
A review that fails for good sends nothing; three failed runs in a row (search or review) are
|
|
239
|
+
told once.
|
|
221
240
|
|
|
222
241
|
`reminder`, `renewal`, `price` and `wantlist` call no model.
|
|
223
242
|
|
package/dist/index.d.ts
CHANGED
|
@@ -6,13 +6,15 @@
|
|
|
6
6
|
* renewal and price-tracker slice (Lepid-Labs/city-hall#11), and `research` (category 5, E8), the
|
|
7
7
|
* first execute-lane type: a research run and a reviewer run through the runner. `scout` (category
|
|
8
8
|
* 1), `wantlist` and the judged `wantjudge` (category 2) came from the tracker plugin in 0.6.0 (E9,
|
|
9
|
-
* plan item 104).
|
|
9
|
+
* plan item 104). `news` (category 1, plan item 153) watches one subject for new items, each
|
|
10
|
+
* batch checked by a reviewer run before it is sent.
|
|
10
11
|
*/
|
|
11
12
|
import type { TaskType } from "@rackbops/docket-core";
|
|
12
13
|
export type { Lane } from "@rackbops/docket-core";
|
|
13
14
|
export { type ExtractedPrice, extractPrice, jsonLdBlocks, MAX_PATTERN_BODY_CHARS, MAX_PATTERN_CHARS, parsePrice, patternProblem, priceFromJson, priceFromMeta, priceFromPattern, } from "./extract.js";
|
|
14
15
|
export { checkDraft, INTAKE_ALLOWED_TOOLS, INTAKE_MAX_BUDGET_USD, INTAKE_MAX_TURNS, INTAKE_SCHEMA, INTAKE_STATES, INTAKE_TIMEOUT_MS, type IntakeAnswer, type IntakeContext, type IntakeDraft, type IntakeField, type IntakeLine, type IntakeRead, type IntakeState, type IntakeTask, type IntakeType, type IntakeValue, intakeJob, MAX_LINE_CHARS, MAX_REPLY_CHARS, MAX_TRANSCRIPT_CHARS, readIntake, transcriptLines, } from "./intake.js";
|
|
15
16
|
export { currencyCode, money } from "./money.js";
|
|
17
|
+
export { LOOKBACK_DAYS, MAX_DISAMBIGUATE_CHARS, MAX_INCLUDE, MAX_KIND_CHARS, MAX_NEWS_ITEMS, MAX_SEEN, MAX_SUBJECT_CHARS, NEWS_MAX_BUDGET_USD, NEWS_MAX_TURNS, NEWS_REVIEW_MAX_BUDGET_USD, NEWS_REVIEW_MAX_TURNS, NEWS_REVIEW_SCHEMA, NEWS_SCHEMA, type NewsConfig, type NewsItem, type NewsPhase, type NewsShow, type NewsState, news, newsJob, newsKeys, newsReviewJob, newsState, PROMPT_SEEN, parseNews, parseNewsReview, renderNews, titleKey, } from "./news.js";
|
|
16
18
|
export { BASELINE_RULES, type BaselineRule, DEFAULT_BASELINE, DEFAULT_DROP_PERCENT, MISSES_BEFORE_TELLING, type PriceConfig, type PriceState, price, reference, } from "./price.js";
|
|
17
19
|
export { DEFAULT_SNOOZE_MS, type ReminderConfig, reminder, snoozeUntil } from "./reminder.js";
|
|
18
20
|
export { decisionOf, isRenewalDecision, RENEWAL_DECISIONS, type RenewalConfig, type RenewalDecision, type RenewalState, renewal, } from "./renewal.js";
|
|
@@ -23,17 +25,17 @@ export { BGG_CATEGORIES, bggCategoryUrl, FIRECRAWL_TOOLS, WEB_ALLOWED_TOOLS, } f
|
|
|
23
25
|
export { RETRIED, type Retry, retryOutcome } from "./retry.js";
|
|
24
26
|
export { itemKey, LENS_TEXT, LENSES, type Lens, lensOf, MAX_FOR_CHARS, MAX_INTEREST_CHARS, MAX_INTERESTS, MAX_ITEMS, MAX_SCOUT_NOTES, MAX_SHOWN, MIN_ITEMS, PROMPT_SHOWN, parseScout, renderScout, SCOUT_MAX_BUDGET_USD, SCOUT_MAX_TURNS, SCOUT_SCHEMA, SCOUT_TIMEOUT_MS, type ScoutConfig, type ScoutItem, type ScoutState, type ShownItem, scout, scoutJob, scoutState, } from "./scout.js";
|
|
25
27
|
export { BGG_ATTRIBUTION, BGG_HOST, BGG_SPACING_MS, type BggOptions, bggSource, bggThingUrl, MAX_SCANNED, parseBggThingId, parseMarketplace, } from "./want-bgg.js";
|
|
26
|
-
export { EBAY_ATTRIBUTION, EBAY_CURRENCY, EBAY_LIMIT, EBAY_MARKETPLACE, EBAY_SEARCH_PATH, type EbayBrowse, type EbayRequest, type EbaySearch, ebayRequest, ebaySource, parseEbayAnswer, } from "./want-ebay.js";
|
|
28
|
+
export { DETAIL_CHARS, EBAY_ATTRIBUTION, EBAY_CURRENCY, EBAY_ITEM_ID, EBAY_ITEM_PATH, EBAY_LIMIT, EBAY_MARKETPLACE, EBAY_SEARCH_PATH, type EbayBrowse, type EbayRequest, type EbaySearch, ebayItemRequest, ebayRequest, ebaySource, parseEbayAnswer, parseEbayItem, } from "./want-ebay.js";
|
|
27
29
|
export { matchesWords, minorUnits, parseShopifyAnswer, SHOPIFY_ATTRIBUTION, SHOPIFY_CAPABILITY, SHOPIFY_COUNTRY, SHOPIFY_CREDITS, SHOPIFY_CURRENCY, SHOPIFY_LIMIT, SHOPIFY_PROVIDER, type ShopifyRequest, type ShopifyScrape, type ShopifySearch, searchWords, shopifyQuery, shopifyRequest, shopifySource, } from "./want-shopify.js";
|
|
28
|
-
export { inboxSource, isEbayHost, type Listing, listingKey, MAX_LISTINGS, NEVER_EBAY, pageSource, type ReadInbox, readListings, type SearchLimits, SOURCE_IDS, type Source, type SourceId, SourceMiss, SourceUnavailableError, type Submitted, submittedListing, } from "./want-sources.js";
|
|
30
|
+
export { inboxSource, isEbayHost, type Listing, type ListingDetail, listingKey, MAX_LISTINGS, NEVER_EBAY, pageSource, type ReadInbox, readListings, type SearchLimits, SOURCE_IDS, type Source, type SourceId, SourceMiss, SourceUnavailableError, type Submitted, submittedListing, } from "./want-sources.js";
|
|
29
31
|
export { SOURCE_TEXT, type SourceText, sourceText } from "./want-text.js";
|
|
30
32
|
export { FITS, type Fit, JUDGE_MAX_BUDGET_USD, JUDGE_MAX_TURNS, JUDGE_SCHEMA, JUDGE_TIMEOUT_MS, type JudgeOptions, type JudgeState, type JudgeVerdict, judgeHosts, judgeJob, judgeState, parseVerdicts, RETRY_GRACE_MS, renderJudged, renderUnchecked, wantjudgeType, } from "./wantjudge.js";
|
|
31
|
-
export { clip, EXCLUDE_CHARS, inert, isExcluded, keepsFindings, listingFinding, listingLine, MAX_DM_CHARS, MAX_EXCLUDE, MAX_NEW_PER_RUN, MAX_REPORTED, miss, moreLine, type Polled, parseExclude, pollWant, priceText, renderWant, SHOWN_IN_DM, type WantConfig, type WantState, wanted, wantlistType, wantState, withinLimits, } from "./wantlist.js";
|
|
33
|
+
export { checkMark, clip, confirmListings, EXCLUDE_CHARS, hasConfirm, inert, isExcluded, keepsFindings, listingFinding, listingLine, MAX_DM_CHARS, MAX_EXCLUDE, MAX_NEW_PER_RUN, MAX_REPORTED, miss, moreLine, type Polled, parseExclude, pollWant, priceText, renderWant, SHOWN_IN_DM, type WantConfig, type WantState, wanted, wantlistType, wantState, withinLimits, } from "./wantlist.js";
|
|
32
34
|
/**
|
|
33
35
|
* The six task categories the tracker starts with (plan section 1.2), as type identifiers, then
|
|
34
36
|
* `wantjudge`: category 2's watch with the model's look first (plan 5.4), a type of its own.
|
|
35
37
|
*/
|
|
36
|
-
export declare const TYPE_IDS: readonly ["reminder", "renewal", "price", "research", "scout", "wantlist", "wantjudge"];
|
|
38
|
+
export declare const TYPE_IDS: readonly ["reminder", "renewal", "price", "research", "scout", "wantlist", "wantjudge", "news"];
|
|
37
39
|
export type TypeId = (typeof TYPE_IDS)[number];
|
|
38
40
|
/** True when `value` names a task type. Narrows a string read from storage or the wire. */
|
|
39
41
|
export declare function isTypeId(value: string): value is TypeId;
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAA;AAWrD,YAAY,EAAE,IAAI,EAAE,MAAM,uBAAuB,CAAA;AACjD,OAAO,EACL,KAAK,cA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AC,MAAM,EAAE,QAAQ,CAAC,OAAO,CAAC,CAAC,CAUjE,CAAA"}
|
package/dist/index.js
CHANGED
|
@@ -6,8 +6,10 @@
|
|
|
6
6
|
* renewal and price-tracker slice (Lepid-Labs/city-hall#11), and `research` (category 5, E8), the
|
|
7
7
|
* first execute-lane type: a research run and a reviewer run through the runner. `scout` (category
|
|
8
8
|
* 1), `wantlist` and the judged `wantjudge` (category 2) came from the tracker plugin in 0.6.0 (E9,
|
|
9
|
-
* plan item 104).
|
|
9
|
+
* plan item 104). `news` (category 1, plan item 153) watches one subject for new items, each
|
|
10
|
+
* batch checked by a reviewer run before it is sent.
|
|
10
11
|
*/
|
|
12
|
+
import { news } from "./news.js";
|
|
11
13
|
import { price } from "./price.js";
|
|
12
14
|
import { reminder } from "./reminder.js";
|
|
13
15
|
import { renewal } from "./renewal.js";
|
|
@@ -19,6 +21,7 @@ import { wantlistType } from "./wantlist.js";
|
|
|
19
21
|
export { extractPrice, jsonLdBlocks, MAX_PATTERN_BODY_CHARS, MAX_PATTERN_CHARS, parsePrice, patternProblem, priceFromJson, priceFromMeta, priceFromPattern, } from "./extract.js";
|
|
20
22
|
export { checkDraft, INTAKE_ALLOWED_TOOLS, INTAKE_MAX_BUDGET_USD, INTAKE_MAX_TURNS, INTAKE_SCHEMA, INTAKE_STATES, INTAKE_TIMEOUT_MS, intakeJob, MAX_LINE_CHARS, MAX_REPLY_CHARS, MAX_TRANSCRIPT_CHARS, readIntake, transcriptLines, } from "./intake.js";
|
|
21
23
|
export { currencyCode, money } from "./money.js";
|
|
24
|
+
export { LOOKBACK_DAYS, MAX_DISAMBIGUATE_CHARS, MAX_INCLUDE, MAX_KIND_CHARS, MAX_NEWS_ITEMS, MAX_SEEN, MAX_SUBJECT_CHARS, NEWS_MAX_BUDGET_USD, NEWS_MAX_TURNS, NEWS_REVIEW_MAX_BUDGET_USD, NEWS_REVIEW_MAX_TURNS, NEWS_REVIEW_SCHEMA, NEWS_SCHEMA, news, newsJob, newsKeys, newsReviewJob, newsState, PROMPT_SEEN, parseNews, parseNewsReview, renderNews, titleKey, } from "./news.js";
|
|
22
25
|
export { BASELINE_RULES, DEFAULT_BASELINE, DEFAULT_DROP_PERCENT, MISSES_BEFORE_TELLING, price, reference, } from "./price.js";
|
|
23
26
|
export { DEFAULT_SNOOZE_MS, reminder, snoozeUntil } from "./reminder.js";
|
|
24
27
|
export { decisionOf, isRenewalDecision, RENEWAL_DECISIONS, renewal, } from "./renewal.js";
|
|
@@ -29,12 +32,12 @@ export { BGG_CATEGORIES, bggCategoryUrl, FIRECRAWL_TOOLS, WEB_ALLOWED_TOOLS, } f
|
|
|
29
32
|
export { RETRIED, retryOutcome } from "./retry.js";
|
|
30
33
|
export { itemKey, LENS_TEXT, LENSES, lensOf, MAX_FOR_CHARS, MAX_INTEREST_CHARS, MAX_INTERESTS, MAX_ITEMS, MAX_SCOUT_NOTES, MAX_SHOWN, MIN_ITEMS, PROMPT_SHOWN, parseScout, renderScout, SCOUT_MAX_BUDGET_USD, SCOUT_MAX_TURNS, SCOUT_SCHEMA, SCOUT_TIMEOUT_MS, scout, scoutJob, scoutState, } from "./scout.js";
|
|
31
34
|
export { BGG_ATTRIBUTION, BGG_HOST, BGG_SPACING_MS, bggSource, bggThingUrl, MAX_SCANNED, parseBggThingId, parseMarketplace, } from "./want-bgg.js";
|
|
32
|
-
export { EBAY_ATTRIBUTION, EBAY_CURRENCY, EBAY_LIMIT, EBAY_MARKETPLACE, EBAY_SEARCH_PATH, ebayRequest, ebaySource, parseEbayAnswer, } from "./want-ebay.js";
|
|
35
|
+
export { DETAIL_CHARS, EBAY_ATTRIBUTION, EBAY_CURRENCY, EBAY_ITEM_ID, EBAY_ITEM_PATH, EBAY_LIMIT, EBAY_MARKETPLACE, EBAY_SEARCH_PATH, ebayItemRequest, ebayRequest, ebaySource, parseEbayAnswer, parseEbayItem, } from "./want-ebay.js";
|
|
33
36
|
export { matchesWords, minorUnits, parseShopifyAnswer, SHOPIFY_ATTRIBUTION, SHOPIFY_CAPABILITY, SHOPIFY_COUNTRY, SHOPIFY_CREDITS, SHOPIFY_CURRENCY, SHOPIFY_LIMIT, SHOPIFY_PROVIDER, searchWords, shopifyQuery, shopifyRequest, shopifySource, } from "./want-shopify.js";
|
|
34
37
|
export { inboxSource, isEbayHost, listingKey, MAX_LISTINGS, NEVER_EBAY, pageSource, readListings, SOURCE_IDS, SourceMiss, SourceUnavailableError, submittedListing, } from "./want-sources.js";
|
|
35
38
|
export { SOURCE_TEXT, sourceText } from "./want-text.js";
|
|
36
39
|
export { FITS, JUDGE_MAX_BUDGET_USD, JUDGE_MAX_TURNS, JUDGE_SCHEMA, JUDGE_TIMEOUT_MS, judgeHosts, judgeJob, judgeState, parseVerdicts, RETRY_GRACE_MS, renderJudged, renderUnchecked, wantjudgeType, } from "./wantjudge.js";
|
|
37
|
-
export { clip, EXCLUDE_CHARS, inert, isExcluded, keepsFindings, listingFinding, listingLine, MAX_DM_CHARS, MAX_EXCLUDE, MAX_NEW_PER_RUN, MAX_REPORTED, miss, moreLine, parseExclude, pollWant, priceText, renderWant, SHOWN_IN_DM, wanted, wantlistType, wantState, withinLimits, } from "./wantlist.js";
|
|
40
|
+
export { checkMark, clip, confirmListings, EXCLUDE_CHARS, hasConfirm, inert, isExcluded, keepsFindings, listingFinding, listingLine, MAX_DM_CHARS, MAX_EXCLUDE, MAX_NEW_PER_RUN, MAX_REPORTED, miss, moreLine, parseExclude, pollWant, priceText, renderWant, SHOWN_IN_DM, wanted, wantlistType, wantState, withinLimits, } from "./wantlist.js";
|
|
38
41
|
/**
|
|
39
42
|
* The six task categories the tracker starts with (plan section 1.2), as type identifiers, then
|
|
40
43
|
* `wantjudge`: category 2's watch with the model's look first (plan 5.4), a type of its own.
|
|
@@ -47,6 +50,7 @@ export const TYPE_IDS = [
|
|
|
47
50
|
"scout",
|
|
48
51
|
"wantlist",
|
|
49
52
|
"wantjudge",
|
|
53
|
+
"news",
|
|
50
54
|
];
|
|
51
55
|
/** True when `value` names a task type. Narrows a string read from storage or the wire. */
|
|
52
56
|
export function isTypeId(value) {
|
|
@@ -62,5 +66,6 @@ export const TASK_TYPES = Object.freeze({
|
|
|
62
66
|
// Over the page source only: BGG needs a host's token, so a host with one builds its own.
|
|
63
67
|
wantlist: wantlistType({ page: pageSource }),
|
|
64
68
|
wantjudge: wantjudgeType({ page: pageSource }),
|
|
69
|
+
news: news,
|
|
65
70
|
});
|
|
66
71
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAGH,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAA;AAChC,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAA;AAClC,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAA;AACxC,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAA;AACtC,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAA;AACxC,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAA;AAClC,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAA;AAC9C,OAAO,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAA;AAC9C,OAAO,EAAE,YAAY,EAAE,MAAM,eAAe,CAAA;AAG5C,OAAO,EAEL,YAAY,EACZ,YAAY,EACZ,sBAAsB,EACtB,iBAAiB,EACjB,UAAU,EACV,cAAc,EACd,aAAa,EACb,aAAa,EACb,gBAAgB,GACjB,MAAM,cAAc,CAAA;AACrB,OAAO,EACL,UAAU,EACV,oBAAoB,EACpB,qBAAqB,EACrB,gBAAgB,EAChB,aAAa,EACb,aAAa,EACb,iBAAiB,EAWjB,SAAS,EACT,cAAc,EACd,eAAe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0FAA0F;IAC1F,QAAQ,EAAE,YAAY,CAAC,EAAE,IAAI,EAAE,UAAU,EAAE,CAAsB;IACjE,SAAS,EAAE,aAAa,CAAC,EAAE,IAAI,EAAE,UAAU,EAAE,CAAsB;IACnE,IAAI,EAAE,IAAyB;CAChC,CAAC,CAAA"}
|
package/dist/news.d.ts
ADDED
|
@@ -0,0 +1,190 @@
|
|
|
1
|
+
import { type JobSpec } from "@rackbops/docket-core";
|
|
2
|
+
/**
|
|
3
|
+
* The news watch (plan item 153, docket#78; the Platinum Blonde and Rhythm Corps pilots of
|
|
4
|
+
* rackbops-bot-plugins#368): recurring research about one subject that DMs only what is new and
|
|
5
|
+
* passed a reviewer, and says nothing when there is nothing. Execute lane, a `calendar` schedule
|
|
6
|
+
* (every N days at the owner's hour), tier 0 only: the type declares `notify` and nothing else
|
|
7
|
+
* (plan 5.6). Every model call is a `claude -p` Job the runner executes on the subscription (5.12).
|
|
8
|
+
*
|
|
9
|
+
* Two runs per batch, through the state, as research's draft and review (item 62):
|
|
10
|
+
*
|
|
11
|
+
* 1. the scheduled run's search Job looks for items about the subject that fit `include` (web
|
|
12
|
+
* search and fetch, never eBay). `finish` drops what it was told of before (`seen`: a digest of
|
|
13
|
+
* the link and one of the title's words, so the same item linked two ways is one item) and what
|
|
14
|
+
* `exclude` rules out (docket-types' `isExcluded`, on the title and the kind). With nothing left,
|
|
15
|
+
* the run ends there: no DM, and "no news" in its history. Otherwise the items wait as `pending`
|
|
16
|
+
* and a follow-up asks for the review;
|
|
17
|
+
* 2. the review Job checks each pending item against its own page: about this subject (not a
|
|
18
|
+
* similarly named act or thing, with `disambiguate`'s notes), of a kind `include` names and none
|
|
19
|
+
* `exclude` does, recent, and saying only what its page says ("on sale" or "available to buy"
|
|
20
|
+
* never from a search snippet). Only the items it keeps are DMed, each a finding with its link
|
|
21
|
+
* and date. Every pending item's link is remembered in `seen` once reviewed, kept or not, so a
|
|
22
|
+
* rejected page is not reviewed again each run; a sent item's title is remembered too.
|
|
23
|
+
*
|
|
24
|
+
* A review that fails for good sends nothing: its pending items are dropped unseen, so a later run
|
|
25
|
+
* may find them again. A search or review that fails for good is a missed run; the owner hears once,
|
|
26
|
+
* at `MISSES_BEFORE_TELLING` in a row (the price tracker's rule). Failures retry as research's do
|
|
27
|
+
* (`retry.ts`); a usage limit never reaches `finish`. Model output is data: every field is capped,
|
|
28
|
+
* cleaned, a link must be http(s) (`safeUrl`), and an item linking to eBay is never kept.
|
|
29
|
+
*/
|
|
30
|
+
export interface NewsConfig {
|
|
31
|
+
/** Who or what to watch: "Platinum Blonde (the Canadian band)". */
|
|
32
|
+
subject: string;
|
|
33
|
+
/**
|
|
34
|
+
* What counts, one kind per entry: "new music", "reissues", "show announcements". A string is
|
|
35
|
+
* read as one comma-separated field, as the intake gives it.
|
|
36
|
+
*/
|
|
37
|
+
include?: string[] | string;
|
|
38
|
+
/** What never counts, words or phrases: "concert", "tour dates"; a string as `include`. */
|
|
39
|
+
exclude?: string[] | string;
|
|
40
|
+
/** How to tell the subject from similarly named ones: "not the 1980s US band Rhythm Corps of ...". */
|
|
41
|
+
disambiguate?: string;
|
|
42
|
+
/** Report shows with their city, venue, date and tickets. */
|
|
43
|
+
shows?: boolean;
|
|
44
|
+
}
|
|
45
|
+
export interface NewsShow {
|
|
46
|
+
city: string;
|
|
47
|
+
venue: string;
|
|
48
|
+
date: string;
|
|
49
|
+
tickets: string;
|
|
50
|
+
}
|
|
51
|
+
export interface NewsItem {
|
|
52
|
+
title: string;
|
|
53
|
+
/** Which `include` kind it is, in the model's words. */
|
|
54
|
+
kind: string;
|
|
55
|
+
summary: string;
|
|
56
|
+
url: string;
|
|
57
|
+
/** When it was published or announced, as the page says. */
|
|
58
|
+
date: string;
|
|
59
|
+
show?: NewsShow;
|
|
60
|
+
}
|
|
61
|
+
export type NewsPhase = "search" | "review";
|
|
62
|
+
export interface NewsState {
|
|
63
|
+
phase: NewsPhase;
|
|
64
|
+
/** Items found and not reviewed yet; at most `MAX_ITEMS`. */
|
|
65
|
+
pending: NewsItem[];
|
|
66
|
+
/** Keys of the items reviewed (a link's and a title's), oldest first, at most `MAX_SEEN`. */
|
|
67
|
+
seen: string[];
|
|
68
|
+
/** Titles of the items sent, oldest first, at most `PROMPT_SEEN`: the search is told of them. */
|
|
69
|
+
recent: string[];
|
|
70
|
+
/** Failed tries of the current phase. */
|
|
71
|
+
failures: number;
|
|
72
|
+
/** Runs in a row that failed for good. */
|
|
73
|
+
missed: number;
|
|
74
|
+
/** Whether this run of misses has been told about already. */
|
|
75
|
+
warned: boolean;
|
|
76
|
+
}
|
|
77
|
+
export declare const MAX_SUBJECT_CHARS = 200;
|
|
78
|
+
export declare const MAX_INCLUDE = 10;
|
|
79
|
+
export declare const MAX_KIND_CHARS = 80;
|
|
80
|
+
export declare const MAX_DISAMBIGUATE_CHARS = 500;
|
|
81
|
+
/** Items one search may return, and so one DM may carry. */
|
|
82
|
+
export declare const MAX_NEWS_ITEMS = 10;
|
|
83
|
+
/** Keys remembered (two per item); past this the oldest may come back, months later. */
|
|
84
|
+
export declare const MAX_SEEN = 600;
|
|
85
|
+
/** Titles of sent items the search prompt names. */
|
|
86
|
+
export declare const PROMPT_SEEN = 30;
|
|
87
|
+
/** How far back an item may be, in the prompts: the watch looks for news, not the archive. */
|
|
88
|
+
export declare const LOOKBACK_DAYS = 30;
|
|
89
|
+
/** Proposed, like the scout's (item 61): a search is a scout-sized look, a review a short one. */
|
|
90
|
+
export declare const NEWS_MAX_TURNS = 25;
|
|
91
|
+
export declare const NEWS_MAX_BUDGET_USD = 1.5;
|
|
92
|
+
export declare const NEWS_TIMEOUT_MS = 600000;
|
|
93
|
+
export declare const NEWS_REVIEW_MAX_TURNS = 12;
|
|
94
|
+
export declare const NEWS_REVIEW_MAX_BUDGET_USD = 0.75;
|
|
95
|
+
export declare const NEWS_REVIEW_TIMEOUT_MS = 300000;
|
|
96
|
+
export declare const NEWS_SCHEMA: {
|
|
97
|
+
readonly type: "object";
|
|
98
|
+
readonly properties: {
|
|
99
|
+
readonly items: {
|
|
100
|
+
readonly type: "array";
|
|
101
|
+
readonly items: {
|
|
102
|
+
readonly type: "object";
|
|
103
|
+
readonly properties: {
|
|
104
|
+
readonly title: {
|
|
105
|
+
readonly type: "string";
|
|
106
|
+
};
|
|
107
|
+
readonly kind: {
|
|
108
|
+
readonly type: "string";
|
|
109
|
+
};
|
|
110
|
+
readonly summary: {
|
|
111
|
+
readonly type: "string";
|
|
112
|
+
};
|
|
113
|
+
readonly url: {
|
|
114
|
+
readonly type: "string";
|
|
115
|
+
};
|
|
116
|
+
readonly date: {
|
|
117
|
+
readonly type: "string";
|
|
118
|
+
readonly description: "When it was published or announced.";
|
|
119
|
+
};
|
|
120
|
+
readonly show: {
|
|
121
|
+
readonly type: "object";
|
|
122
|
+
readonly properties: {
|
|
123
|
+
readonly city: {
|
|
124
|
+
readonly type: "string";
|
|
125
|
+
};
|
|
126
|
+
readonly venue: {
|
|
127
|
+
readonly type: "string";
|
|
128
|
+
};
|
|
129
|
+
readonly date: {
|
|
130
|
+
readonly type: "string";
|
|
131
|
+
};
|
|
132
|
+
readonly tickets: {
|
|
133
|
+
readonly type: "string";
|
|
134
|
+
readonly description: "Where tickets are sold, a link or a site's name.";
|
|
135
|
+
};
|
|
136
|
+
};
|
|
137
|
+
readonly required: readonly ["city", "venue", "date"];
|
|
138
|
+
};
|
|
139
|
+
};
|
|
140
|
+
readonly required: readonly ["title", "kind", "summary", "url", "date"];
|
|
141
|
+
};
|
|
142
|
+
readonly maxItems: 10;
|
|
143
|
+
};
|
|
144
|
+
};
|
|
145
|
+
readonly required: readonly ["items"];
|
|
146
|
+
};
|
|
147
|
+
export declare const NEWS_REVIEW_SCHEMA: {
|
|
148
|
+
readonly type: "object";
|
|
149
|
+
readonly properties: {
|
|
150
|
+
readonly verdicts: {
|
|
151
|
+
readonly type: "array";
|
|
152
|
+
readonly items: {
|
|
153
|
+
readonly type: "object";
|
|
154
|
+
readonly properties: {
|
|
155
|
+
readonly n: {
|
|
156
|
+
readonly type: "integer";
|
|
157
|
+
readonly description: "The item's number, as given.";
|
|
158
|
+
};
|
|
159
|
+
readonly keep: {
|
|
160
|
+
readonly type: "boolean";
|
|
161
|
+
};
|
|
162
|
+
readonly why: {
|
|
163
|
+
readonly type: "string";
|
|
164
|
+
};
|
|
165
|
+
};
|
|
166
|
+
readonly required: readonly ["n", "keep", "why"];
|
|
167
|
+
};
|
|
168
|
+
readonly maxItems: 10;
|
|
169
|
+
};
|
|
170
|
+
};
|
|
171
|
+
readonly required: readonly ["verdicts"];
|
|
172
|
+
};
|
|
173
|
+
/** The key a title is remembered by: a digest of its words, so case and punctuation do not matter. */
|
|
174
|
+
export declare function titleKey(title: string): string;
|
|
175
|
+
/** Both keys an item is remembered by: its link's and its title's. */
|
|
176
|
+
export declare function newsKeys(item: Pick<NewsItem, "url" | "title">): [string, string];
|
|
177
|
+
/** The state as stored, or a fresh one; anything unreadable in it is dropped. */
|
|
178
|
+
export declare function newsState(value: unknown): NewsState;
|
|
179
|
+
/** The search run: the subject and its kinds, what was already reported, and the rules for an item. */
|
|
180
|
+
export declare function newsJob(config: NewsConfig, state: NewsState, now: Date): JobSpec;
|
|
181
|
+
/** The review run: the pending items, numbered, as escaped JSON data, and what to check. */
|
|
182
|
+
export declare function newsReviewJob(config: NewsConfig, pending: readonly NewsItem[], now: Date): JobSpec;
|
|
183
|
+
/** The search's items, cleaned; null when it is no answer at all. */
|
|
184
|
+
export declare function parseNews(value: unknown, shows: boolean): NewsItem[] | null;
|
|
185
|
+
/** The kept items' numbers, each with why; null when it is no answer. First verdict per number wins. */
|
|
186
|
+
export declare function parseNewsReview(value: unknown, count: number): Map<number, string> | null;
|
|
187
|
+
/** The DM a reviewed batch goes out as, at most `MAX_MESSAGE_CHARS`; the title is the owner's own. */
|
|
188
|
+
export declare function renderNews(title: string, items: readonly NewsItem[]): string;
|
|
189
|
+
export declare const news: import("@rackbops/docket-core").TaskType<NewsConfig>;
|
|
190
|
+
//# sour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