@hatk/hatk 0.0.1-alpha.11 → 0.0.1-alpha.111
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/adapter.d.ts +19 -0
- package/dist/adapter.d.ts.map +1 -0
- package/dist/adapter.js +113 -0
- package/dist/backfill.d.ts +36 -2
- package/dist/backfill.d.ts.map +1 -1
- package/dist/backfill.js +153 -37
- package/dist/car.js +1 -1
- package/dist/classifiers.d.ts +228 -0
- package/dist/classifiers.d.ts.map +1 -0
- package/dist/classifiers.js +688 -0
- package/dist/cli.js +248 -1043
- package/dist/config.d.ts +179 -1
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js +78 -8
- package/dist/database/adapter-factory.d.ts +6 -0
- package/dist/database/adapter-factory.d.ts.map +1 -0
- package/dist/database/adapter-factory.js +20 -0
- package/dist/database/adapters/duckdb-search.d.ts +12 -0
- package/dist/database/adapters/duckdb-search.d.ts.map +1 -0
- package/dist/database/adapters/duckdb-search.js +27 -0
- package/dist/database/adapters/duckdb.d.ts +25 -0
- package/dist/database/adapters/duckdb.d.ts.map +1 -0
- package/dist/database/adapters/duckdb.js +161 -0
- package/dist/database/adapters/sqlite-search.d.ts +16 -0
- package/dist/database/adapters/sqlite-search.d.ts.map +1 -0
- package/dist/database/adapters/sqlite-search.js +76 -0
- package/dist/database/adapters/sqlite.d.ts +18 -0
- package/dist/database/adapters/sqlite.d.ts.map +1 -0
- package/dist/database/adapters/sqlite.js +88 -0
- package/dist/database/db.d.ts +290 -0
- package/dist/database/db.d.ts.map +1 -0
- package/dist/database/db.js +2073 -0
- package/dist/database/dialect.d.ts +45 -0
- package/dist/database/dialect.d.ts.map +1 -0
- package/dist/database/dialect.js +72 -0
- package/dist/{fts.d.ts → database/fts.d.ts} +7 -0
- package/dist/database/fts.d.ts.map +1 -0
- package/dist/{fts.js → database/fts.js} +122 -34
- package/dist/database/index.d.ts +7 -0
- package/dist/database/index.d.ts.map +1 -0
- package/dist/database/index.js +6 -0
- package/dist/database/ports.d.ts +50 -0
- package/dist/database/ports.d.ts.map +1 -0
- package/dist/database/ports.js +1 -0
- package/dist/database/schema.d.ts +91 -0
- package/dist/database/schema.d.ts.map +1 -0
- package/dist/{schema.js → database/schema.js} +153 -54
- package/dist/dev-entry.d.ts +8 -0
- package/dist/dev-entry.d.ts.map +1 -0
- package/dist/dev-entry.js +131 -0
- package/dist/feeds.d.ts +26 -8
- package/dist/feeds.d.ts.map +1 -1
- package/dist/feeds.js +72 -16
- package/dist/hooks.d.ts +102 -0
- package/dist/hooks.d.ts.map +1 -0
- package/dist/hooks.js +186 -0
- package/dist/hydrate.d.ts +55 -6
- package/dist/hydrate.d.ts.map +1 -1
- package/dist/hydrate.js +21 -20
- package/dist/indexer.d.ts +194 -3
- package/dist/indexer.d.ts.map +1 -1
- package/dist/indexer.js +627 -92
- package/dist/jetstream.d.ts +118 -0
- package/dist/jetstream.d.ts.map +1 -0
- package/dist/jetstream.js +238 -0
- package/dist/labels.d.ts +36 -0
- package/dist/labels.d.ts.map +1 -1
- package/dist/labels.js +71 -6
- package/dist/lex-types.d.ts +2 -0
- package/dist/lex-types.d.ts.map +1 -1
- package/dist/lexicon-resolve.d.ts.map +1 -1
- package/dist/lexicon-resolve.js +27 -112
- package/dist/lexicons/com/atproto/label/defs.json +75 -0
- package/dist/lexicons/com/atproto/moderation/defs.json +30 -0
- package/dist/lexicons/com/atproto/repo/strongRef.json +21 -0
- package/dist/lexicons/dev/hatk/applyWrites.json +87 -0
- package/dist/lexicons/dev/hatk/createRecord.json +40 -0
- package/dist/lexicons/dev/hatk/createReport.json +48 -0
- package/dist/lexicons/dev/hatk/deleteRecord.json +25 -0
- package/dist/lexicons/dev/hatk/describeCollections.json +41 -0
- package/dist/lexicons/dev/hatk/describeFeeds.json +29 -0
- package/dist/lexicons/dev/hatk/describeLabels.json +45 -0
- package/dist/lexicons/dev/hatk/getFeed.json +30 -0
- package/dist/lexicons/dev/hatk/getPreferences.json +19 -0
- package/dist/lexicons/dev/hatk/getRecord.json +26 -0
- package/dist/lexicons/dev/hatk/getRecords.json +32 -0
- package/dist/lexicons/dev/hatk/putPreference.json +28 -0
- package/dist/lexicons/dev/hatk/putRecord.json +41 -0
- package/dist/lexicons/dev/hatk/searchRecords.json +32 -0
- package/dist/lexicons/dev/hatk/uploadBlob.json +23 -0
- package/dist/logger.d.ts +29 -0
- package/dist/logger.d.ts.map +1 -1
- package/dist/logger.js +29 -0
- package/dist/main.js +212 -75
- package/dist/mst.d.ts +15 -0
- package/dist/mst.d.ts.map +1 -1
- package/dist/mst.js +13 -0
- package/dist/oauth/db.d.ts +27 -1
- package/dist/oauth/db.d.ts.map +1 -1
- package/dist/oauth/db.js +80 -19
- package/dist/oauth/discovery.d.ts +10 -0
- package/dist/oauth/discovery.d.ts.map +1 -1
- package/dist/oauth/discovery.js +54 -2
- package/dist/oauth/server.d.ts +131 -1
- package/dist/oauth/server.d.ts.map +1 -1
- package/dist/oauth/server.js +504 -39
- package/dist/oauth/service-describe.d.ts +42 -0
- package/dist/oauth/service-describe.d.ts.map +1 -0
- package/dist/oauth/service-describe.js +108 -0
- package/dist/oauth/session.d.ts +32 -0
- package/dist/oauth/session.d.ts.map +1 -0
- package/dist/oauth/session.js +131 -0
- package/dist/opengraph.d.ts +10 -0
- package/dist/opengraph.d.ts.map +1 -1
- package/dist/opengraph.js +94 -42
- package/dist/pds-proxy.d.ts +92 -0
- package/dist/pds-proxy.d.ts.map +1 -0
- package/dist/pds-proxy.js +396 -0
- package/dist/private-collections.d.ts +13 -0
- package/dist/private-collections.d.ts.map +1 -0
- package/dist/private-collections.js +27 -0
- package/dist/push.d.ts +54 -0
- package/dist/push.d.ts.map +1 -0
- package/dist/push.js +367 -0
- package/dist/renderer.d.ts +27 -0
- package/dist/renderer.d.ts.map +1 -0
- package/dist/renderer.js +46 -0
- package/dist/resolve-hatk.d.ts +6 -0
- package/dist/resolve-hatk.d.ts.map +1 -0
- package/dist/resolve-hatk.js +20 -0
- package/dist/response.d.ts +16 -0
- package/dist/response.d.ts.map +1 -0
- package/dist/response.js +69 -0
- package/dist/scanner.d.ts +22 -0
- package/dist/scanner.d.ts.map +1 -0
- package/dist/scanner.js +92 -0
- package/dist/seed.d.ts +19 -0
- package/dist/seed.d.ts.map +1 -1
- package/dist/seed.js +43 -4
- package/dist/server-init.d.ts +8 -0
- package/dist/server-init.d.ts.map +1 -0
- package/dist/server-init.js +75 -0
- package/dist/server.d.ts +46 -3
- package/dist/server.d.ts.map +1 -1
- package/dist/server.js +1137 -649
- package/dist/setup.d.ts +28 -1
- package/dist/setup.d.ts.map +1 -1
- package/dist/setup.js +50 -3
- package/dist/spaces/blob.d.ts +112 -0
- package/dist/spaces/blob.d.ts.map +1 -0
- package/dist/spaces/blob.js +460 -0
- package/dist/spaces/credential.d.ts +82 -0
- package/dist/spaces/credential.d.ts.map +1 -0
- package/dist/spaces/credential.js +220 -0
- package/dist/spaces/engine.d.ts +97 -0
- package/dist/spaces/engine.d.ts.map +1 -0
- package/dist/spaces/engine.js +563 -0
- package/dist/spaces/guard.d.ts +41 -0
- package/dist/spaces/guard.d.ts.map +1 -0
- package/dist/spaces/guard.js +79 -0
- package/dist/spaces/identity.d.ts +37 -0
- package/dist/spaces/identity.d.ts.map +1 -0
- package/dist/spaces/identity.js +93 -0
- package/dist/spaces/index.d.ts +56 -0
- package/dist/spaces/index.d.ts.map +1 -0
- package/dist/spaces/index.js +134 -0
- package/dist/spaces/notify.d.ts +60 -0
- package/dist/spaces/notify.d.ts.map +1 -0
- package/dist/spaces/notify.js +128 -0
- package/dist/spaces/records.d.ts +37 -0
- package/dist/spaces/records.d.ts.map +1 -0
- package/dist/spaces/records.js +63 -0
- package/dist/spaces/signature.d.ts +36 -0
- package/dist/spaces/signature.d.ts.map +1 -0
- package/dist/spaces/signature.js +83 -0
- package/dist/spaces/store.d.ts +51 -0
- package/dist/spaces/store.d.ts.map +1 -0
- package/dist/spaces/store.js +99 -0
- package/dist/spaces/uri.d.ts +60 -0
- package/dist/spaces/uri.d.ts.map +1 -0
- package/dist/spaces/uri.js +97 -0
- package/dist/spaces/verify.d.ts +46 -0
- package/dist/spaces/verify.d.ts.map +1 -0
- package/dist/spaces/verify.js +94 -0
- package/dist/spaces/viewer.d.ts +51 -0
- package/dist/spaces/viewer.d.ts.map +1 -0
- package/dist/spaces/viewer.js +167 -0
- package/dist/spaces/visibility.d.ts +57 -0
- package/dist/spaces/visibility.d.ts.map +1 -0
- package/dist/spaces/visibility.js +81 -0
- package/dist/templates/feed.tpl +18 -0
- package/dist/templates/hook.tpl +5 -0
- package/dist/templates/label.tpl +15 -0
- package/dist/templates/og.tpl +17 -0
- package/dist/templates/seed.tpl +11 -0
- package/dist/templates/setup.tpl +5 -0
- package/dist/templates/test-feed.tpl +19 -0
- package/dist/templates/test-xrpc.tpl +19 -0
- package/dist/templates/xrpc.tpl +53 -0
- package/dist/test.d.ts +3 -1
- package/dist/test.d.ts.map +1 -1
- package/dist/test.js +60 -36
- package/dist/views.js +1 -1
- package/dist/vite-plugin.d.ts +1 -1
- package/dist/vite-plugin.d.ts.map +1 -1
- package/dist/vite-plugin.js +254 -66
- package/dist/xrpc.d.ts +143 -12
- package/dist/xrpc.d.ts.map +1 -1
- package/dist/xrpc.js +282 -55
- package/package.json +29 -9
- package/public/admin-auth.js +271 -306
- package/public/admin.html +652 -61
- package/dist/db.d.ts +0 -135
- package/dist/db.d.ts.map +0 -1
- package/dist/db.js +0 -1365
- package/dist/fts.d.ts.map +0 -1
- package/dist/oauth/hooks.d.ts +0 -10
- package/dist/oauth/hooks.d.ts.map +0 -1
- package/dist/oauth/hooks.js +0 -40
- package/dist/schema.d.ts +0 -51
- package/dist/schema.d.ts.map +0 -1
- package/dist/test-browser.d.ts +0 -14
- package/dist/test-browser.d.ts.map +0 -1
- package/dist/test-browser.js +0 -26
|
@@ -0,0 +1,228 @@
|
|
|
1
|
+
/** A typed question in the shape Clef accepts. */
|
|
2
|
+
export interface ClassifierQuestion {
|
|
3
|
+
type: 'noul' | 'choice' | 'score';
|
|
4
|
+
instructions: string | Record<string, unknown> | unknown[];
|
|
5
|
+
criteria?: unknown;
|
|
6
|
+
}
|
|
7
|
+
/** The thing being scored: an account (by DID) or a single record. */
|
|
8
|
+
export interface ClassifierSubject {
|
|
9
|
+
/** `at://` URI for a record subject; the bare DID for an account subject. */
|
|
10
|
+
uri: string;
|
|
11
|
+
did: string;
|
|
12
|
+
handle?: string | null;
|
|
13
|
+
collection?: string;
|
|
14
|
+
value?: Record<string, any>;
|
|
15
|
+
}
|
|
16
|
+
export interface ClassifierContext {
|
|
17
|
+
db: {
|
|
18
|
+
query: (sql: string, params?: any[]) => Promise<any[]>;
|
|
19
|
+
run: (sql: string, ...params: any[]) => Promise<void>;
|
|
20
|
+
};
|
|
21
|
+
subject: ClassifierSubject;
|
|
22
|
+
}
|
|
23
|
+
export interface ClassifierModule {
|
|
24
|
+
/** `account` scans every indexed repo; `record` scans rows of `collections`. */
|
|
25
|
+
subject: 'account' | 'record';
|
|
26
|
+
/** Collections to scan. Required when `subject` is `record`. */
|
|
27
|
+
collections?: string[];
|
|
28
|
+
/** The questions to ask. Answers come back under the same keys. Omit when
|
|
29
|
+
* the classifier supplies its own `classify`. */
|
|
30
|
+
questions?: Record<string, ClassifierQuestion>;
|
|
31
|
+
/**
|
|
32
|
+
* Produce signals without asking Clef.
|
|
33
|
+
*
|
|
34
|
+
* A classifier that runs its own model — an image classifier on the host, a
|
|
35
|
+
* hash lookup, a heuristic — sets this instead of `questions`. Everything
|
|
36
|
+
* downstream is unchanged: the same thresholds, the same report, the same
|
|
37
|
+
* review card. Return a bare number for a plain score.
|
|
38
|
+
*/
|
|
39
|
+
classify?: (state: Record<string, unknown>, ctx: ClassifierContext) => Promise<Record<string, number | Signal>>;
|
|
40
|
+
/**
|
|
41
|
+
* Build the model `state` for this subject. Return `null` to skip it — a
|
|
42
|
+
* skipped subject costs no tokens. Gate on whatever makes the question
|
|
43
|
+
* answerable: an account with no content cannot be judged on its content.
|
|
44
|
+
*/
|
|
45
|
+
buildState: (ctx: ClassifierContext) => Promise<Record<string, unknown> | null>;
|
|
46
|
+
/**
|
|
47
|
+
* URLs of images to show the model alongside `state`, at most four. hatk
|
|
48
|
+
* fetches each and embeds it in the request, since Clef takes images inline
|
|
49
|
+
* rather than by reference.
|
|
50
|
+
*
|
|
51
|
+
* Return small renditions. Clef's context window is counted on the encoded
|
|
52
|
+
* bytes, so a full-size photo can overflow it where a 512px one never does.
|
|
53
|
+
* The state should carry whatever identifies the image — a blob CID — so
|
|
54
|
+
* that a changed image changes the fingerprint and is scored again.
|
|
55
|
+
*/
|
|
56
|
+
images?: (state: Record<string, unknown>, ctx: ClassifierContext) => Promise<string[]> | string[];
|
|
57
|
+
/**
|
|
58
|
+
* Score at or above which a signal files a report. A number applies to every
|
|
59
|
+
* question; a map sets it per question. Questions absent from the map never
|
|
60
|
+
* file, though their scores are still stored and shown.
|
|
61
|
+
*/
|
|
62
|
+
threshold?: number | Record<string, number>;
|
|
63
|
+
/** Label the filed report carries. A function receives the crossing signal. */
|
|
64
|
+
label?: string | ((signal: string, score: number) => string);
|
|
65
|
+
}
|
|
66
|
+
export declare function defineClassifier(module: ClassifierModule): {
|
|
67
|
+
/** `account` scans every indexed repo; `record` scans rows of `collections`. */
|
|
68
|
+
subject: "account" | "record";
|
|
69
|
+
/** Collections to scan. Required when `subject` is `record`. */
|
|
70
|
+
collections?: string[];
|
|
71
|
+
/** The questions to ask. Answers come back under the same keys. Omit when
|
|
72
|
+
* the classifier supplies its own `classify`. */
|
|
73
|
+
questions?: Record<string, ClassifierQuestion>;
|
|
74
|
+
/**
|
|
75
|
+
* Produce signals without asking Clef.
|
|
76
|
+
*
|
|
77
|
+
* A classifier that runs its own model — an image classifier on the host, a
|
|
78
|
+
* hash lookup, a heuristic — sets this instead of `questions`. Everything
|
|
79
|
+
* downstream is unchanged: the same thresholds, the same report, the same
|
|
80
|
+
* review card. Return a bare number for a plain score.
|
|
81
|
+
*/
|
|
82
|
+
classify?: (state: Record<string, unknown>, ctx: ClassifierContext) => Promise<Record<string, number | Signal>>;
|
|
83
|
+
/**
|
|
84
|
+
* Build the model `state` for this subject. Return `null` to skip it — a
|
|
85
|
+
* skipped subject costs no tokens. Gate on whatever makes the question
|
|
86
|
+
* answerable: an account with no content cannot be judged on its content.
|
|
87
|
+
*/
|
|
88
|
+
buildState: (ctx: ClassifierContext) => Promise<Record<string, unknown> | null>;
|
|
89
|
+
/**
|
|
90
|
+
* URLs of images to show the model alongside `state`, at most four. hatk
|
|
91
|
+
* fetches each and embeds it in the request, since Clef takes images inline
|
|
92
|
+
* rather than by reference.
|
|
93
|
+
*
|
|
94
|
+
* Return small renditions. Clef's context window is counted on the encoded
|
|
95
|
+
* bytes, so a full-size photo can overflow it where a 512px one never does.
|
|
96
|
+
* The state should carry whatever identifies the image — a blob CID — so
|
|
97
|
+
* that a changed image changes the fingerprint and is scored again.
|
|
98
|
+
*/
|
|
99
|
+
images?: (state: Record<string, unknown>, ctx: ClassifierContext) => Promise<string[]> | string[];
|
|
100
|
+
/**
|
|
101
|
+
* Score at or above which a signal files a report. A number applies to every
|
|
102
|
+
* question; a map sets it per question. Questions absent from the map never
|
|
103
|
+
* file, though their scores are still stored and shown.
|
|
104
|
+
*/
|
|
105
|
+
threshold?: number | Record<string, number>;
|
|
106
|
+
/** Label the filed report carries. A function receives the crossing signal. */
|
|
107
|
+
label?: string | ((signal: string, score: number) => string);
|
|
108
|
+
__type: "classifiers";
|
|
109
|
+
};
|
|
110
|
+
interface LoadedClassifier extends ClassifierModule {
|
|
111
|
+
name: string;
|
|
112
|
+
}
|
|
113
|
+
/** Discover and load classifier modules from the `classifiers/` directory. */
|
|
114
|
+
export declare function initClassifiers(classifiersDir: string): Promise<void>;
|
|
115
|
+
/**
|
|
116
|
+
* Register a classifier directly, bypassing directory discovery.
|
|
117
|
+
*
|
|
118
|
+
* Mirrors {@link registerLabelModule}: tests and embedders that build their own
|
|
119
|
+
* module graph have no `classifiers/` directory to read.
|
|
120
|
+
*/
|
|
121
|
+
export declare function registerClassifier(name: string, module: ClassifierModule): void;
|
|
122
|
+
/** Clear all registered classifiers (for hot-reload). */
|
|
123
|
+
export declare function clearClassifiers(): void;
|
|
124
|
+
/** Names of all loaded classifiers. */
|
|
125
|
+
export declare function listClassifiers(): string[];
|
|
126
|
+
export declare function getClassifier(name: string): LoadedClassifier | undefined;
|
|
127
|
+
export interface ClefClientConfig {
|
|
128
|
+
apiToken: string;
|
|
129
|
+
model: string;
|
|
130
|
+
endpoint: string;
|
|
131
|
+
}
|
|
132
|
+
export declare function configureClef(config: ClefClientConfig | null): void;
|
|
133
|
+
export declare function isClefConfigured(): boolean;
|
|
134
|
+
/** A single answer, normalized to a 0–1 score regardless of question type. */
|
|
135
|
+
export interface Signal {
|
|
136
|
+
score: number;
|
|
137
|
+
type: string;
|
|
138
|
+
/** Choice/Score only: the selected option and its confidence. */
|
|
139
|
+
choice?: string;
|
|
140
|
+
confidence?: number;
|
|
141
|
+
}
|
|
142
|
+
/**
|
|
143
|
+
* Ask Clef one request's worth of questions about one state.
|
|
144
|
+
*
|
|
145
|
+
* Retries on 429 and 5xx, honoring `retry-after` when the response carries one.
|
|
146
|
+
* The caller's concurrency is what keeps us under the rate limit; this only
|
|
147
|
+
* recovers the requests that still slip past it.
|
|
148
|
+
*/
|
|
149
|
+
export declare function askClef(state: Record<string, unknown>, questions: Record<string, ClassifierQuestion>, opts?: {
|
|
150
|
+
images?: string[];
|
|
151
|
+
attempts?: number;
|
|
152
|
+
signal?: AbortSignal;
|
|
153
|
+
}): Promise<{
|
|
154
|
+
answers: Record<string, Signal>;
|
|
155
|
+
model: string;
|
|
156
|
+
inputTokens: number;
|
|
157
|
+
}>;
|
|
158
|
+
export interface ScanProgress {
|
|
159
|
+
/** Subjects considered. */
|
|
160
|
+
scanned: number;
|
|
161
|
+
/** Gated out by `buildState` returning null, or unchanged since the last scan. */
|
|
162
|
+
skipped: number;
|
|
163
|
+
/** Sent to the model and stored. */
|
|
164
|
+
scored: number;
|
|
165
|
+
/** Reports filed for crossing a threshold. */
|
|
166
|
+
filed: number;
|
|
167
|
+
errors: number;
|
|
168
|
+
inputTokens: number;
|
|
169
|
+
running: boolean;
|
|
170
|
+
startedAt: string;
|
|
171
|
+
finishedAt?: string;
|
|
172
|
+
error?: string;
|
|
173
|
+
}
|
|
174
|
+
/** When a TID record key was minted, or null if the key is not a TID. */
|
|
175
|
+
export declare function tidTime(rkey: string): Date | null;
|
|
176
|
+
/** Progress of the scan in flight, or the last one to finish. */
|
|
177
|
+
export declare function getScanProgress(): ScanProgress | null;
|
|
178
|
+
/**
|
|
179
|
+
* Score every subject a classifier applies to, storing results and filing a
|
|
180
|
+
* report for each crossing signal.
|
|
181
|
+
*
|
|
182
|
+
* Subjects whose state is unchanged since the last scan are skipped unless
|
|
183
|
+
* `force` is set, so a repeat scan costs only what actually moved.
|
|
184
|
+
*/
|
|
185
|
+
export declare function runScan(opts?: {
|
|
186
|
+
classifier?: string;
|
|
187
|
+
force?: boolean;
|
|
188
|
+
limit?: number;
|
|
189
|
+
concurrency?: number;
|
|
190
|
+
signal?: AbortSignal;
|
|
191
|
+
/** Only subjects new after this ISO time; see {@link enumerateSubjects}. */
|
|
192
|
+
since?: string;
|
|
193
|
+
}): Promise<ScanProgress>;
|
|
194
|
+
/** For tests: run the boot catch-up after `ms` rather than a minute. */
|
|
195
|
+
export declare function _setCatchUpDelayForTests(ms: number): void;
|
|
196
|
+
/**
|
|
197
|
+
* Score new content as it is indexed, from the moment this was first switched
|
|
198
|
+
* on. What existed before then is never scored here — a pass over the existing
|
|
199
|
+
* library is a deliberate, manual scan from /admin.
|
|
200
|
+
*
|
|
201
|
+
* Starts with one catch-up pass over everything new since that moment, which
|
|
202
|
+
* picks up what a restart dropped from the queue; anything already scored is
|
|
203
|
+
* skipped on its fingerprint before it costs a model call.
|
|
204
|
+
*/
|
|
205
|
+
export declare function startScoringOnIndex(): Promise<void>;
|
|
206
|
+
export declare function stopScoringOnIndex(): void;
|
|
207
|
+
/**
|
|
208
|
+
* Called by the indexer with each batch it applied. Queues every new record for
|
|
209
|
+
* the record classifiers that cover its collection, and its author for the
|
|
210
|
+
* account classifiers once the author has settled. Returns immediately: the
|
|
211
|
+
* indexer never waits on a model.
|
|
212
|
+
*/
|
|
213
|
+
export declare function noteIndexed(items: Array<{
|
|
214
|
+
action: 'create' | 'delete';
|
|
215
|
+
collection: string;
|
|
216
|
+
uri: string;
|
|
217
|
+
authorDid: string;
|
|
218
|
+
}>): void;
|
|
219
|
+
/**
|
|
220
|
+
* Called by the indexer when a repo backfill lands. Its rows were written
|
|
221
|
+
* without passing through {@link noteIndexed} — a new account's first posts
|
|
222
|
+
* arrive this way — so queue whatever in it is new.
|
|
223
|
+
*/
|
|
224
|
+
export declare function noteBackfilled(did: string): void;
|
|
225
|
+
/** Items waiting to be scored, for tests and the admin view. */
|
|
226
|
+
export declare function pendingCount(): number;
|
|
227
|
+
export {};
|
|
228
|
+
//# sourceMappingURL=classifiers.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"classifiers.d.ts","sourceRoot":"","sources":["../src/classifiers.ts"],"names":[],"mappings":"AAoDA,kDAAkD;AAClD,MAAM,WAAW,kBAAkB;IACjC,IAAI,EAAE,MAAM,GAAG,QAAQ,GAAG,OAAO,CAAA;IACjC,YAAY,EAAE,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,OAAO,EAAE,CAAA;IAC1D,QAAQ,CAAC,EAAE,OAAO,CAAA;CACnB;AAED,sEAAsE;AACtE,MAAM,WAAW,iBAAiB;IAChC,6EAA6E;IAC7E,GAAG,EAAE,MAAM,CAAA;IACX,GAAG,EAAE,MAAM,CAAA;IACX,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IACtB,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,EAA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