@wrenautomation/raven 0.1.1 → 0.1.2
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/triage.d.ts +3 -3
- package/dist/triage.js +2 -2
- package/dist/types.d.ts +2 -0
- package/package.json +1 -1
package/dist/triage.d.ts
CHANGED
|
@@ -4,12 +4,12 @@
|
|
|
4
4
|
* caps it; a hit the model did not name is a skip, written down as one.
|
|
5
5
|
*/
|
|
6
6
|
import { type Model } from "./model.js";
|
|
7
|
-
import { type
|
|
7
|
+
import { HitView, type HitViewIn, type Plan, type PlanFile, type Triage, type YieldRow } from "./types.js";
|
|
8
8
|
/** One hit per url, sources merged, order of first sight. */
|
|
9
|
-
export declare function dedupeHits(hits: readonly
|
|
9
|
+
export declare function dedupeHits(hits: readonly HitViewIn[]): HitView[];
|
|
10
10
|
export declare function triagePrompt(hits: readonly HitView[], plan: Plan, planFile: PlanFile, yieldRows: readonly YieldRow[]): string;
|
|
11
11
|
/** Read or skip per hit, with why. Reads over the plan's budget flip to skips, in the model's order. */
|
|
12
|
-
export declare function triage(hits: readonly
|
|
12
|
+
export declare function triage(hits: readonly HitViewIn[], plan: Plan, model: Model, options?: {
|
|
13
13
|
planFile?: PlanFile;
|
|
14
14
|
yieldRows?: readonly YieldRow[];
|
|
15
15
|
}): Promise<Triage[]>;
|
package/dist/triage.js
CHANGED
|
@@ -6,14 +6,14 @@
|
|
|
6
6
|
import { fill } from "./model.js";
|
|
7
7
|
import { defaultPlanFile } from "./plans/index.js";
|
|
8
8
|
import { lines, renderHits, renderYield } from "./render.js";
|
|
9
|
-
import { z } from "./types.js";
|
|
9
|
+
import { HitView, z, } from "./types.js";
|
|
10
10
|
const TriageAnswer = z.object({
|
|
11
11
|
hits: z.array(z.object({ url: z.string(), read: z.boolean(), why: z.string() })),
|
|
12
12
|
});
|
|
13
13
|
/** One hit per url, sources merged, order of first sight. */
|
|
14
14
|
export function dedupeHits(hits) {
|
|
15
15
|
const byUrl = new Map();
|
|
16
|
-
for (const h of hits) {
|
|
16
|
+
for (const h of hits.map((x) => HitView.parse(x))) {
|
|
17
17
|
const url = h.url.trim();
|
|
18
18
|
const have = byUrl.get(url);
|
|
19
19
|
if (!have) {
|
package/dist/types.d.ts
CHANGED
|
@@ -195,6 +195,8 @@ export declare const HitView: z.ZodObject<{
|
|
|
195
195
|
sources: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
196
196
|
}, z.core.$strip>;
|
|
197
197
|
export type HitView = z.infer<typeof HitView>;
|
|
198
|
+
/** A hit as a caller may pass it: `sources` optional. */
|
|
199
|
+
export type HitViewIn = z.input<typeof HitView>;
|
|
198
200
|
export declare const Triage: z.ZodObject<{
|
|
199
201
|
url: z.ZodString;
|
|
200
202
|
read: z.ZodBoolean;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wrenautomation/raven",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.2",
|
|
4
4
|
"description": "Ask in, plan out. The planner of Wren's research engine: typed queries with who proposed them and why, proposals merged into one plan under a plan file per ask kind, read-or-skip on hits, and the edge to take after a round. Pure functions and prompts; the model is injected.",
|
|
5
5
|
"license": "PolyForm-Shield-1.0.0",
|
|
6
6
|
"repository": {
|