@wrenautomation/birdwatch 0.0.0-stage → 0.30.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/LICENSE.md +61 -0
- package/README.md +320 -2
- package/dist/app/cli.d.ts +4 -0
- package/dist/app/cli.js +149 -0
- package/dist/app/cli.js.map +1 -0
- package/dist/app/engine-cli.d.ts +44 -0
- package/dist/app/engine-cli.js +596 -0
- package/dist/app/engine-cli.js.map +1 -0
- package/dist/app/index.d.ts +6 -0
- package/dist/app/index.js +7 -0
- package/dist/app/index.js.map +1 -0
- package/dist/app/serve.d.ts +14 -0
- package/dist/app/serve.js +102 -0
- package/dist/app/serve.js.map +1 -0
- package/dist/document/body.d.ts +6 -0
- package/dist/document/body.js +18 -0
- package/dist/document/body.js.map +1 -0
- package/dist/document/check.d.ts +35 -0
- package/dist/document/check.js +68 -0
- package/dist/document/check.js.map +1 -0
- package/dist/document/extract.d.ts +81 -0
- package/dist/document/extract.js +226 -0
- package/dist/document/extract.js.map +1 -0
- package/dist/document/index.d.ts +11 -0
- package/dist/document/index.js +12 -0
- package/dist/document/index.js.map +1 -0
- package/dist/document/model.d.ts +10 -0
- package/dist/document/model.js +2 -0
- package/dist/document/model.js.map +1 -0
- package/dist/document/readers.d.ts +24 -0
- package/dist/document/readers.js +87 -0
- package/dist/document/readers.js.map +1 -0
- package/dist/document/types.d.ts +99 -0
- package/dist/document/types.js +93 -0
- package/dist/document/types.js.map +1 -0
- package/dist/engine/agent.d.ts +475 -0
- package/dist/engine/agent.js +990 -0
- package/dist/engine/agent.js.map +1 -0
- package/dist/engine/canonical.d.ts +4 -0
- package/dist/engine/canonical.js +55 -0
- package/dist/engine/canonical.js.map +1 -0
- package/dist/engine/context.d.ts +9 -0
- package/dist/engine/context.js +141 -0
- package/dist/engine/context.js.map +1 -0
- package/dist/engine/cost.d.ts +13 -0
- package/dist/engine/cost.js +31 -0
- package/dist/engine/cost.js.map +1 -0
- package/dist/engine/index.d.ts +16 -0
- package/dist/engine/index.js +17 -0
- package/dist/engine/index.js.map +1 -0
- package/dist/engine/judge.d.ts +158 -0
- package/dist/engine/judge.js +323 -0
- package/dist/engine/judge.js.map +1 -0
- package/dist/engine/people.d.ts +34 -0
- package/dist/engine/people.js +125 -0
- package/dist/engine/people.js.map +1 -0
- package/dist/engine/plan.d.ts +6 -0
- package/dist/engine/plan.js +7 -0
- package/dist/engine/plan.js.map +1 -0
- package/dist/engine/plans/index.d.ts +19 -0
- package/dist/engine/plans/index.js +104 -0
- package/dist/engine/plans/index.js.map +1 -0
- package/dist/engine/ports.d.ts +76 -0
- package/dist/engine/ports.js +28 -0
- package/dist/engine/ports.js.map +1 -0
- package/dist/engine/recall.d.ts +42 -0
- package/dist/engine/recall.js +71 -0
- package/dist/engine/recall.js.map +1 -0
- package/dist/engine/state.d.ts +96 -0
- package/dist/engine/state.js +162 -0
- package/dist/engine/state.js.map +1 -0
- package/dist/engine/steps.d.ts +98 -0
- package/dist/engine/steps.js +435 -0
- package/dist/engine/steps.js.map +1 -0
- package/dist/engine/tree.d.ts +76 -0
- package/dist/engine/tree.js +148 -0
- package/dist/engine/tree.js.map +1 -0
- package/dist/engine/types.d.ts +250 -0
- package/dist/engine/types.js +168 -0
- package/dist/engine/types.js.map +1 -0
- package/dist/engine/view.d.ts +138 -0
- package/dist/engine/view.js +188 -0
- package/dist/engine/view.js.map +1 -0
- package/dist/index.d.ts +15 -0
- package/dist/index.js +16 -0
- package/dist/index.js.map +1 -0
- package/dist/ledger/files.d.ts +39 -0
- package/dist/ledger/files.js +113 -0
- package/dist/ledger/files.js.map +1 -0
- package/dist/ledger/ids.d.ts +4 -0
- package/dist/ledger/ids.js +9 -0
- package/dist/ledger/ids.js.map +1 -0
- package/dist/ledger/index.d.ts +11 -0
- package/dist/ledger/index.js +12 -0
- package/dist/ledger/index.js.map +1 -0
- package/dist/ledger/ledger.d.ts +46 -0
- package/dist/ledger/ledger.js +105 -0
- package/dist/ledger/ledger.js.map +1 -0
- package/dist/ledger/memory.d.ts +19 -0
- package/dist/ledger/memory.js +19 -0
- package/dist/ledger/memory.js.map +1 -0
- package/dist/ledger/records.d.ts +1424 -0
- package/dist/ledger/records.js +292 -0
- package/dist/ledger/records.js.map +1 -0
- package/dist/sources/arxiv.d.ts +105 -0
- package/dist/sources/arxiv.js +321 -0
- package/dist/sources/arxiv.js.map +1 -0
- package/dist/sources/exa.d.ts +19 -0
- package/dist/sources/exa.js +59 -0
- package/dist/sources/exa.js.map +1 -0
- package/dist/sources/fetcher.d.ts +35 -0
- package/dist/sources/fetcher.js +67 -0
- package/dist/sources/fetcher.js.map +1 -0
- package/dist/sources/google.d.ts +16 -0
- package/dist/sources/google.js +64 -0
- package/dist/sources/google.js.map +1 -0
- package/dist/sources/index.d.ts +17 -0
- package/dist/sources/index.js +18 -0
- package/dist/sources/index.js.map +1 -0
- package/dist/sources/junk.d.ts +10 -0
- package/dist/sources/junk.js +16 -0
- package/dist/sources/junk.js.map +1 -0
- package/dist/sources/ladder.d.ts +47 -0
- package/dist/sources/ladder.js +158 -0
- package/dist/sources/ladder.js.map +1 -0
- package/dist/sources/ledger.d.ts +7 -0
- package/dist/sources/ledger.js +35 -0
- package/dist/sources/ledger.js.map +1 -0
- package/dist/sources/paste.d.ts +8 -0
- package/dist/sources/paste.js +22 -0
- package/dist/sources/paste.js.map +1 -0
- package/dist/sources/searxng.d.ts +11 -0
- package/dist/sources/searxng.js +38 -0
- package/dist/sources/searxng.js.map +1 -0
- package/dist/sources/sites.d.ts +53 -0
- package/dist/sources/sites.js +285 -0
- package/dist/sources/sites.js.map +1 -0
- package/dist/sources/ytdlp.d.ts +43 -0
- package/dist/sources/ytdlp.js +117 -0
- package/dist/sources/ytdlp.js.map +1 -0
- package/package.json +61 -3
|
@@ -0,0 +1,148 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The run tree: a child run names its parent on every snapshot. A wide run finds the niches;
|
|
3
|
+
* a child per niche goes deep; a stopped child's patterns and dead ends reach the parent's next
|
|
4
|
+
* plan. Each child keeps its own budget, stop and resume. A child's budget is never more than
|
|
5
|
+
* its parent's. The depth and the children per round are guard rails: past the depth a warning.
|
|
6
|
+
* The one hard stop is the pages the whole tree reads, pinned on the root's snapshot: depth costs
|
|
7
|
+
* nothing a sibling would not, so only the total is worth a wall.
|
|
8
|
+
*/
|
|
9
|
+
import { costOf } from "./cost.js";
|
|
10
|
+
import { recall } from "./recall.js";
|
|
11
|
+
import { classesOf, fold } from "./state.js";
|
|
12
|
+
/** The caps when the plan file names none: the root and its children; six children per round. */
|
|
13
|
+
export const RUNS = { depth: 2, children: 6 };
|
|
14
|
+
const stateOf = async (deps, run) => fold(run, await deps.ledger.trace(run));
|
|
15
|
+
/** The runs that name this one as parent, each by its first snapshot, in the order they began. */
|
|
16
|
+
export async function childrenOf(deps, run) {
|
|
17
|
+
const out = new Map();
|
|
18
|
+
for (const r of await deps.ledger.scan({ type: ["snapshot"] }))
|
|
19
|
+
if (r.type === "snapshot" && r.parent?.run === run && !out.has(r.run))
|
|
20
|
+
out.set(r.run, r);
|
|
21
|
+
return [...out.values()];
|
|
22
|
+
}
|
|
23
|
+
/** The pages a tree may read, for a root's snapshot: the plan file's, else from the root's budget. */
|
|
24
|
+
export const treeReadsOf = (planFile, budget) => planFile.runs?.reads ??
|
|
25
|
+
budget.reads * budget.rounds * ((planFile.runs?.children ?? RUNS.children) + 1);
|
|
26
|
+
/** The run's ancestors, root first, each by its latest snapshot. */
|
|
27
|
+
export async function lineageOf(deps, run) {
|
|
28
|
+
const out = [];
|
|
29
|
+
for (let s = (await stateOf(deps, run)).snapshot; s?.parent;) {
|
|
30
|
+
s = (await stateOf(deps, s.parent.run)).snapshot;
|
|
31
|
+
if (s)
|
|
32
|
+
out.unshift(s);
|
|
33
|
+
}
|
|
34
|
+
return out;
|
|
35
|
+
}
|
|
36
|
+
/** What the tree the run sits in may still read; null for a tree with no cap (a run before 0.21). */
|
|
37
|
+
export async function treeRoom(deps, run) {
|
|
38
|
+
const root = (await lineageOf(deps, run))[0] ?? (await stateOf(deps, run)).snapshot;
|
|
39
|
+
if (!root?.treeReads)
|
|
40
|
+
return null;
|
|
41
|
+
const read = (await runTree(deps, root.run)).reads;
|
|
42
|
+
return { root: root.run, cap: root.treeReads, read, left: Math.max(0, root.treeReads - read) };
|
|
43
|
+
}
|
|
44
|
+
/** Per field, the smaller: a child never gets more than its parent. */
|
|
45
|
+
export const minBudget = (a, b) => ({
|
|
46
|
+
queries: Math.min(a.queries, b.queries),
|
|
47
|
+
reads: Math.min(a.reads, b.reads),
|
|
48
|
+
rounds: Math.min(a.rounds, b.rounds),
|
|
49
|
+
checks: Math.min(a.checks, b.checks),
|
|
50
|
+
});
|
|
51
|
+
/** The plan file's budget, capped by the parent's on each round of a child. */
|
|
52
|
+
export async function budgetUnder(deps, parent, budget) {
|
|
53
|
+
const up = parent && (await stateOf(deps, parent.run)).snapshot;
|
|
54
|
+
return up ? minBudget(budget, up.budget) : budget;
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* A new child's link, checked: the parent has a plan, its round has room for one more child, and
|
|
58
|
+
* the tree has pages left to read. Past the depth, a warning: the why says why deeper beats a
|
|
59
|
+
* sibling.
|
|
60
|
+
*/
|
|
61
|
+
export async function linkTo(deps, to, planFile) {
|
|
62
|
+
if (!to.why.trim())
|
|
63
|
+
throw new Error("--parent: why this child?");
|
|
64
|
+
const up = (await stateOf(deps, to.run)).snapshot;
|
|
65
|
+
if (!up)
|
|
66
|
+
throw new Error(`parent ${to.run}: no plan yet`);
|
|
67
|
+
const caps = { ...RUNS, ...planFile.runs };
|
|
68
|
+
const level = (await lineageOf(deps, to.run)).length + 2;
|
|
69
|
+
const room = await treeRoom(deps, to.run);
|
|
70
|
+
if (room && !room.left)
|
|
71
|
+
throw new Error(`--parent: the tree under ${room.root} read ${room.read} pages, its cap ${room.cap} (plan file runs.reads on the root)`);
|
|
72
|
+
const siblings = (await childrenOf(deps, to.run)).filter((c) => c.parent?.round === up.round).length;
|
|
73
|
+
if (siblings >= caps.children)
|
|
74
|
+
throw new Error(`--parent: round ${up.round} of ${to.run} has ${siblings} children, the cap (plan file runs.children)`);
|
|
75
|
+
const warnings = [];
|
|
76
|
+
if (level > caps.depth)
|
|
77
|
+
warnings.push(`level ${level}, past runs.depth ${caps.depth}: a guard rail; the why says why a deeper run beats a sibling`);
|
|
78
|
+
const reads = (await runTree(deps, to.run)).reads;
|
|
79
|
+
const cap = up.budget.reads * up.budget.rounds;
|
|
80
|
+
if (reads >= cap)
|
|
81
|
+
warnings.push(`the tree under ${to.run} read ${reads} pages, past its budget of ${cap}: a guard rail, not a stop`);
|
|
82
|
+
return {
|
|
83
|
+
parent: { run: to.run, round: up.round, why: to.why },
|
|
84
|
+
warnings,
|
|
85
|
+
};
|
|
86
|
+
}
|
|
87
|
+
/**
|
|
88
|
+
* What a parent's next plan reads from its children. A stopped child gives known lines: its
|
|
89
|
+
* stop, its patterns with their sites per class, its dead ends (facets to skip). A child still
|
|
90
|
+
* going is open. The lines name the child run and the pattern: the ledger is their source.
|
|
91
|
+
*/
|
|
92
|
+
export async function fromChildren(deps, run) {
|
|
93
|
+
const known = [];
|
|
94
|
+
const open = [];
|
|
95
|
+
for (const c of await childrenOf(deps, run)) {
|
|
96
|
+
const s = await stateOf(deps, c.run);
|
|
97
|
+
const ask = `"${c.ask.text}"`;
|
|
98
|
+
if (s.next) {
|
|
99
|
+
open.push(`child run ${c.run} (${ask}) has not stopped`);
|
|
100
|
+
continue;
|
|
101
|
+
}
|
|
102
|
+
const stop = s.edges.filter((e) => e.next === "stop").at(-1);
|
|
103
|
+
known.push(`child run ${c.run} (${ask}) stopped${stop ? `: ${stop.why}` : ""}`);
|
|
104
|
+
for (const p of s.patterns) {
|
|
105
|
+
const classes = Object.entries(classesOf(s, p.findings))
|
|
106
|
+
.map(([k, n]) => `${k} ${n}`)
|
|
107
|
+
.join(", ");
|
|
108
|
+
known.push(`${p.text} (run ${c.run}, pattern ${p.id}; sources: ${classes || "none kept"})`);
|
|
109
|
+
}
|
|
110
|
+
for (const d of s.dead)
|
|
111
|
+
known.push(`dead end, skip it: ${d.facet}: ${d.why} (run ${c.run})`);
|
|
112
|
+
}
|
|
113
|
+
return { known, open };
|
|
114
|
+
}
|
|
115
|
+
/** For a new child: what its parent and siblings already found that bears on its ask, with URLs. */
|
|
116
|
+
export async function fromSiblings(deps, parent, ask, n = 10) {
|
|
117
|
+
const runs = [parent, ...(await childrenOf(deps, parent)).map((c) => c.run)];
|
|
118
|
+
return (await recall(deps.ledger, ask, { runs, n })).map((r) => `${r.text} (${r.url})`);
|
|
119
|
+
}
|
|
120
|
+
/** The run's children, and what the whole tree under it read and cost. */
|
|
121
|
+
export async function runTree(deps, run) {
|
|
122
|
+
const spends = [];
|
|
123
|
+
let reads = 0;
|
|
124
|
+
const children = [];
|
|
125
|
+
const walk = async (id, top) => {
|
|
126
|
+
const s = await stateOf(deps, id);
|
|
127
|
+
spends.push(...s.spends);
|
|
128
|
+
reads += s.documents.length;
|
|
129
|
+
for (const c of await childrenOf(deps, id)) {
|
|
130
|
+
if (top) {
|
|
131
|
+
const cs = await stateOf(deps, c.run);
|
|
132
|
+
children.push({
|
|
133
|
+
run: c.run,
|
|
134
|
+
ask: c.ask.text,
|
|
135
|
+
why: c.parent?.why ?? "",
|
|
136
|
+
round: c.parent?.round ?? 1,
|
|
137
|
+
stopped: !cs.next,
|
|
138
|
+
patterns: cs.patterns.length,
|
|
139
|
+
reads: cs.documents.length,
|
|
140
|
+
});
|
|
141
|
+
}
|
|
142
|
+
await walk(c.run, false);
|
|
143
|
+
}
|
|
144
|
+
};
|
|
145
|
+
await walk(run, true);
|
|
146
|
+
return { children, reads, cost: costOf(spends) };
|
|
147
|
+
}
|
|
148
|
+
//# sourceMappingURL=tree.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tree.js","sourceRoot":"","sources":["../../src/engine/tree.ts"],"names":[],"mappings":"AAAA;;;;;;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and its plan file: what to look for, who asked, the tuned recipe per ask kind (sources,
|
|
3
|
+
* budget, tree guide). The agent plans; these are its shapes. `HitView` is a hit's free fields;
|
|
4
|
+
* the ledger's records extend these, so old ledgers still parse.
|
|
5
|
+
*/
|
|
6
|
+
import { z } from "zod";
|
|
7
|
+
export declare const AskKind: z.ZodEnum<{
|
|
8
|
+
video: "video";
|
|
9
|
+
channel: "channel";
|
|
10
|
+
web: "web";
|
|
11
|
+
person: "person";
|
|
12
|
+
site: "site";
|
|
13
|
+
}>;
|
|
14
|
+
export type AskKind = z.infer<typeof AskKind>;
|
|
15
|
+
/** Who wrote a record: the agent or a person. */
|
|
16
|
+
export declare const From: z.ZodEnum<{
|
|
17
|
+
ai: "ai";
|
|
18
|
+
human: "human";
|
|
19
|
+
}>;
|
|
20
|
+
export type From = z.infer<typeof From>;
|
|
21
|
+
/**
|
|
22
|
+
* One yes-or-no test a good source passes, named: the judge answers it on every hit and every
|
|
23
|
+
* page read whole. A hint and a router, never a gate.
|
|
24
|
+
*/
|
|
25
|
+
export declare const Criterion: z.ZodObject<{
|
|
26
|
+
name: z.ZodString;
|
|
27
|
+
question: z.ZodString;
|
|
28
|
+
}, z.core.$strip>;
|
|
29
|
+
export type Criterion = z.infer<typeof Criterion>;
|
|
30
|
+
/** What someone wants to know, and what is known already. */
|
|
31
|
+
export declare const Ask: z.ZodObject<{
|
|
32
|
+
text: z.ZodString;
|
|
33
|
+
kind: z.ZodEnum<{
|
|
34
|
+
video: "video";
|
|
35
|
+
channel: "channel";
|
|
36
|
+
web: "web";
|
|
37
|
+
person: "person";
|
|
38
|
+
site: "site";
|
|
39
|
+
}>;
|
|
40
|
+
known: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
41
|
+
premises: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
42
|
+
steer: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
43
|
+
open: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
44
|
+
criteria: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
45
|
+
name: z.ZodString;
|
|
46
|
+
question: z.ZodString;
|
|
47
|
+
}, z.core.$strip>>>;
|
|
48
|
+
site: z.ZodOptional<z.ZodString>;
|
|
49
|
+
}, z.core.$strip>;
|
|
50
|
+
export type Ask = z.infer<typeof Ask>;
|
|
51
|
+
/** One thing to look for. `terms` is what a person would type; a source adapter forms its own call from it. */
|
|
52
|
+
export declare const Query: z.ZodObject<{
|
|
53
|
+
kind: z.ZodEnum<{
|
|
54
|
+
video: "video";
|
|
55
|
+
channel: "channel";
|
|
56
|
+
web: "web";
|
|
57
|
+
person: "person";
|
|
58
|
+
site: "site";
|
|
59
|
+
}>;
|
|
60
|
+
terms: z.ZodString;
|
|
61
|
+
site: z.ZodOptional<z.ZodString>;
|
|
62
|
+
why: z.ZodString;
|
|
63
|
+
facet: z.ZodOptional<z.ZodString>;
|
|
64
|
+
tier: z.ZodOptional<z.ZodNumber>;
|
|
65
|
+
needs: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
66
|
+
from: z.ZodEnum<{
|
|
67
|
+
ai: "ai";
|
|
68
|
+
human: "human";
|
|
69
|
+
}>;
|
|
70
|
+
by: z.ZodString;
|
|
71
|
+
}, z.core.$strip>;
|
|
72
|
+
export type Query = z.infer<typeof Query>;
|
|
73
|
+
/** One query as a leaf of the tree: what a person would type, and why. */
|
|
74
|
+
export declare const Leaf: z.ZodObject<{
|
|
75
|
+
terms: z.ZodString;
|
|
76
|
+
why: z.ZodString;
|
|
77
|
+
site: z.ZodOptional<z.ZodString>;
|
|
78
|
+
}, z.core.$strip>;
|
|
79
|
+
export type Leaf = z.infer<typeof Leaf>;
|
|
80
|
+
/**
|
|
81
|
+
* One side of the ask a researcher covers: a number, a how, a who, a counter-view, a primary
|
|
82
|
+
* source. `tries` are its alternatives in order: the first runs; the next runs only when the
|
|
83
|
+
* one before it yielded thin (fewer new hits than the guide's `thin`), or when the agent asks.
|
|
84
|
+
*/
|
|
85
|
+
export declare const Facet: z.ZodObject<{
|
|
86
|
+
name: z.ZodString;
|
|
87
|
+
why: z.ZodString;
|
|
88
|
+
needs: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
89
|
+
tries: z.ZodArray<z.ZodArray<z.ZodObject<{
|
|
90
|
+
terms: z.ZodString;
|
|
91
|
+
why: z.ZodString;
|
|
92
|
+
site: z.ZodOptional<z.ZodString>;
|
|
93
|
+
}, z.core.$strip>>>;
|
|
94
|
+
}, z.core.$strip>;
|
|
95
|
+
export type Facet = z.infer<typeof Facet>;
|
|
96
|
+
/** The fan-out for one round: the facets, each with its tries. The agent writes it; birdwatch runs it. */
|
|
97
|
+
export declare const QueryTree: z.ZodObject<{
|
|
98
|
+
facets: z.ZodArray<z.ZodObject<{
|
|
99
|
+
name: z.ZodString;
|
|
100
|
+
why: z.ZodString;
|
|
101
|
+
needs: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
102
|
+
tries: z.ZodArray<z.ZodArray<z.ZodObject<{
|
|
103
|
+
terms: z.ZodString;
|
|
104
|
+
why: z.ZodString;
|
|
105
|
+
site: z.ZodOptional<z.ZodString>;
|
|
106
|
+
}, z.core.$strip>>>;
|
|
107
|
+
}, z.core.$strip>>;
|
|
108
|
+
}, z.core.$strip>;
|
|
109
|
+
export type QueryTree = z.infer<typeof QueryTree>;
|
|
110
|
+
/** The plan file's guide for a tree: the facets a tree of this kind covers, and what thin means. A guide, not a cap: a tree may add facets; one it leaves out is a warning. */
|
|
111
|
+
export declare const TreeGuide: z.ZodObject<{
|
|
112
|
+
facets: z.ZodArray<z.ZodObject<{
|
|
113
|
+
name: z.ZodString;
|
|
114
|
+
why: z.ZodString;
|
|
115
|
+
}, z.core.$strip>>;
|
|
116
|
+
thin: z.ZodNumber;
|
|
117
|
+
}, z.core.$strip>;
|
|
118
|
+
export type TreeGuide = z.infer<typeof TreeGuide>;
|
|
119
|
+
export declare const Budget: z.ZodObject<{
|
|
120
|
+
queries: z.ZodNumber;
|
|
121
|
+
reads: z.ZodNumber;
|
|
122
|
+
rounds: z.ZodNumber;
|
|
123
|
+
checks: z.ZodDefault<z.ZodNumber>;
|
|
124
|
+
}, z.core.$strip>;
|
|
125
|
+
export type Budget = z.infer<typeof Budget>;
|
|
126
|
+
/**
|
|
127
|
+
* The recipe for one ask kind: the sources it may use, the budget, the tree guide. Versioned and
|
|
128
|
+
* tuned like an SOP, stored beside the ledger. A file from before 0.30.0 carries the old
|
|
129
|
+
* model planner's prompts: parsing drops them.
|
|
130
|
+
*/
|
|
131
|
+
export declare const PlanFile: z.ZodObject<{
|
|
132
|
+
id: z.ZodString;
|
|
133
|
+
kind: z.ZodEnum<{
|
|
134
|
+
video: "video";
|
|
135
|
+
channel: "channel";
|
|
136
|
+
web: "web";
|
|
137
|
+
person: "person";
|
|
138
|
+
site: "site";
|
|
139
|
+
}>;
|
|
140
|
+
version: z.ZodNumber;
|
|
141
|
+
sources: z.ZodArray<z.ZodString>;
|
|
142
|
+
budget: z.ZodObject<{
|
|
143
|
+
queries: z.ZodNumber;
|
|
144
|
+
reads: z.ZodNumber;
|
|
145
|
+
rounds: z.ZodNumber;
|
|
146
|
+
checks: z.ZodDefault<z.ZodNumber>;
|
|
147
|
+
}, z.core.$strip>;
|
|
148
|
+
age: z.ZodOptional<z.ZodString>;
|
|
149
|
+
rules: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
150
|
+
tree: z.ZodOptional<z.ZodObject<{
|
|
151
|
+
facets: z.ZodArray<z.ZodObject<{
|
|
152
|
+
name: z.ZodString;
|
|
153
|
+
why: z.ZodString;
|
|
154
|
+
}, z.core.$strip>>;
|
|
155
|
+
thin: z.ZodNumber;
|
|
156
|
+
}, z.core.$strip>>;
|
|
157
|
+
runs: z.ZodOptional<z.ZodObject<{
|
|
158
|
+
depth: z.ZodNumber;
|
|
159
|
+
children: z.ZodNumber;
|
|
160
|
+
reads: z.ZodOptional<z.ZodNumber>;
|
|
161
|
+
}, z.core.$strip>>;
|
|
162
|
+
}, z.core.$strip>;
|
|
163
|
+
export type PlanFile = z.infer<typeof PlanFile>;
|
|
164
|
+
/** What a source, channel or proposer yielded before. The files ledger writes it. */
|
|
165
|
+
export declare const YieldRow: z.ZodObject<{
|
|
166
|
+
by: z.ZodOptional<z.ZodString>;
|
|
167
|
+
source: z.ZodOptional<z.ZodString>;
|
|
168
|
+
channel: z.ZodOptional<z.ZodString>;
|
|
169
|
+
kind: z.ZodOptional<z.ZodEnum<{
|
|
170
|
+
video: "video";
|
|
171
|
+
channel: "channel";
|
|
172
|
+
web: "web";
|
|
173
|
+
person: "person";
|
|
174
|
+
site: "site";
|
|
175
|
+
}>>;
|
|
176
|
+
hits: z.ZodNumber;
|
|
177
|
+
reads: z.ZodNumber;
|
|
178
|
+
proposed: z.ZodNumber;
|
|
179
|
+
kept: z.ZodNumber;
|
|
180
|
+
}, z.core.$strip>;
|
|
181
|
+
export type YieldRow = z.infer<typeof YieldRow>;
|
|
182
|
+
/** What a round was planned from, kept with its snapshot. */
|
|
183
|
+
export declare const Snapshot: z.ZodObject<{
|
|
184
|
+
at: z.ZodString;
|
|
185
|
+
known: z.ZodArray<z.ZodString>;
|
|
186
|
+
planFile: z.ZodObject<{
|
|
187
|
+
id: z.ZodString;
|
|
188
|
+
version: z.ZodNumber;
|
|
189
|
+
}, z.core.$strip>;
|
|
190
|
+
model: z.ZodNullable<z.ZodString>;
|
|
191
|
+
yieldRows: z.ZodNumber;
|
|
192
|
+
}, z.core.$strip>;
|
|
193
|
+
export type Snapshot = z.infer<typeof Snapshot>;
|
|
194
|
+
/** A hit as a source shows it for free: no read has happened. `sources` is every source that returned it. */
|
|
195
|
+
export declare const HitView: z.ZodObject<{
|
|
196
|
+
url: z.ZodString;
|
|
197
|
+
title: z.ZodOptional<z.ZodString>;
|
|
198
|
+
channel: z.ZodOptional<z.ZodString>;
|
|
199
|
+
length: z.ZodOptional<z.ZodNumber>;
|
|
200
|
+
date: z.ZodOptional<z.ZodString>;
|
|
201
|
+
snippet: z.ZodOptional<z.ZodString>;
|
|
202
|
+
sources: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
203
|
+
odds: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodNumber>>;
|
|
204
|
+
}, z.core.$strip>;
|
|
205
|
+
export type HitView = z.infer<typeof HitView>;
|
|
206
|
+
/** A hit as a caller may pass it: `sources` optional. */
|
|
207
|
+
export type HitViewIn = z.input<typeof HitView>;
|
|
208
|
+
/** The extractor's word on one read document: how much of the ask it served, what is still missing. */
|
|
209
|
+
export declare const Verdict: z.ZodObject<{
|
|
210
|
+
url: z.ZodString;
|
|
211
|
+
quality: z.ZodEnum<{
|
|
212
|
+
rich: "rich";
|
|
213
|
+
thin: "thin";
|
|
214
|
+
off: "off";
|
|
215
|
+
empty: "empty";
|
|
216
|
+
}>;
|
|
217
|
+
gap: z.ZodOptional<z.ZodString>;
|
|
218
|
+
}, z.core.$strip>;
|
|
219
|
+
export type Verdict = z.infer<typeof Verdict>;
|
|
220
|
+
export declare const Step: z.ZodEnum<{
|
|
221
|
+
plan: "plan";
|
|
222
|
+
fetch: "fetch";
|
|
223
|
+
triage: "triage";
|
|
224
|
+
read: "read";
|
|
225
|
+
extract: "extract";
|
|
226
|
+
}>;
|
|
227
|
+
export type Step = z.infer<typeof Step>;
|
|
228
|
+
/** The edge out of a round. `again` is a new round from `plan`; `back` reruns one step of this round. */
|
|
229
|
+
export declare const Edge: z.ZodObject<{
|
|
230
|
+
next: z.ZodEnum<{
|
|
231
|
+
stop: "stop";
|
|
232
|
+
again: "again";
|
|
233
|
+
back: "back";
|
|
234
|
+
}>;
|
|
235
|
+
to: z.ZodOptional<z.ZodEnum<{
|
|
236
|
+
plan: "plan";
|
|
237
|
+
fetch: "fetch";
|
|
238
|
+
triage: "triage";
|
|
239
|
+
read: "read";
|
|
240
|
+
extract: "extract";
|
|
241
|
+
}>>;
|
|
242
|
+
why: z.ZodString;
|
|
243
|
+
from: z.ZodEnum<{
|
|
244
|
+
ai: "ai";
|
|
245
|
+
human: "human";
|
|
246
|
+
}>;
|
|
247
|
+
by: z.ZodString;
|
|
248
|
+
}, z.core.$strip>;
|
|
249
|
+
export type Edge = z.infer<typeof Edge>;
|
|
250
|
+
export { z };
|
|
@@ -0,0 +1,168 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The ask and its plan file: what to look for, who asked, the tuned recipe per ask kind (sources,
|
|
3
|
+
* budget, tree guide). The agent plans; these are its shapes. `HitView` is a hit's free fields;
|
|
4
|
+
* the ledger's records extend these, so old ledgers still parse.
|
|
5
|
+
*/
|
|
6
|
+
import { z } from "zod";
|
|
7
|
+
export const AskKind = z.enum(["web", "video", "channel", "person", "site"]);
|
|
8
|
+
/** Who wrote a record: the agent or a person. */
|
|
9
|
+
export const From = z.enum(["ai", "human"]);
|
|
10
|
+
/**
|
|
11
|
+
* One yes-or-no test a good source passes, named: the judge answers it on every hit and every
|
|
12
|
+
* page read whole. A hint and a router, never a gate.
|
|
13
|
+
*/
|
|
14
|
+
export const Criterion = z.object({
|
|
15
|
+
name: z.string().regex(/^[a-z][a-z0-9_]*$/),
|
|
16
|
+
question: z.string().min(1),
|
|
17
|
+
});
|
|
18
|
+
/** What someone wants to know, and what is known already. */
|
|
19
|
+
export const Ask = z.object({
|
|
20
|
+
text: z.string().min(1),
|
|
21
|
+
kind: AskKind,
|
|
22
|
+
/** Facts already in hand, one line each: the plan looks past them. */
|
|
23
|
+
known: z.array(z.string()).default([]),
|
|
24
|
+
/** Lines taken as given with no source behind them: the plan tests each, never looks past it. */
|
|
25
|
+
premises: z.array(z.string()).default([]),
|
|
26
|
+
/** What the person said along the way, one line each: the brief shows it first. */
|
|
27
|
+
steer: z.array(z.string()).default([]),
|
|
28
|
+
/** What the last round left open, one line each: its edge's why, its gaps. The next plan looks there first. */
|
|
29
|
+
open: z.array(z.string()).default([]),
|
|
30
|
+
/** The person's tests of a good source; empty: none. */
|
|
31
|
+
criteria: z.array(Criterion).default([]),
|
|
32
|
+
/** Only for kind `site`, or when a query must stay on one host. */
|
|
33
|
+
site: z.string().optional(),
|
|
34
|
+
});
|
|
35
|
+
/** One thing to look for. `terms` is what a person would type; a source adapter forms its own call from it. */
|
|
36
|
+
export const Query = z.object({
|
|
37
|
+
kind: AskKind,
|
|
38
|
+
terms: z.string().min(1),
|
|
39
|
+
site: z.string().optional(),
|
|
40
|
+
/** Why this query serves the ask: the line a reviewer reads first. */
|
|
41
|
+
why: z.string(),
|
|
42
|
+
/** The tree's facet it serves, and which try (1 = the first). Absent on a flat query. */
|
|
43
|
+
facet: z.string().optional(),
|
|
44
|
+
tier: z.number().int().positive().optional(),
|
|
45
|
+
/** The source classes the facet needs (a spend claim: survey, primary_data); the engine checks the names. */
|
|
46
|
+
needs: z.array(z.string().min(1)).optional(),
|
|
47
|
+
from: From,
|
|
48
|
+
/** Model id, plan file id or a person's name. */
|
|
49
|
+
by: z.string(),
|
|
50
|
+
});
|
|
51
|
+
/** One query as a leaf of the tree: what a person would type, and why. */
|
|
52
|
+
export const Leaf = z.object({
|
|
53
|
+
terms: z.string().min(1),
|
|
54
|
+
why: z.string(),
|
|
55
|
+
site: z.string().optional(),
|
|
56
|
+
});
|
|
57
|
+
/**
|
|
58
|
+
* One side of the ask a researcher covers: a number, a how, a who, a counter-view, a primary
|
|
59
|
+
* source. `tries` are its alternatives in order: the first runs; the next runs only when the
|
|
60
|
+
* one before it yielded thin (fewer new hits than the guide's `thin`), or when the agent asks.
|
|
61
|
+
*/
|
|
62
|
+
export const Facet = z.object({
|
|
63
|
+
name: z.string().min(1),
|
|
64
|
+
/** What this facet would prove. */
|
|
65
|
+
why: z.string(),
|
|
66
|
+
/** The source classes that can prove it; a facet whose read pages have none of them is flagged. */
|
|
67
|
+
needs: z.array(z.string().min(1)).optional(),
|
|
68
|
+
tries: z.array(z.array(Leaf).min(1)).min(1),
|
|
69
|
+
});
|
|
70
|
+
/** The fan-out for one round: the facets, each with its tries. The agent writes it; birdwatch runs it. */
|
|
71
|
+
export const QueryTree = z.object({ facets: z.array(Facet).min(1) });
|
|
72
|
+
/** The plan file's guide for a tree: the facets a tree of this kind covers, and what thin means. A guide, not a cap: a tree may add facets; one it leaves out is a warning. */
|
|
73
|
+
export const TreeGuide = z.object({
|
|
74
|
+
facets: z.array(z.object({ name: z.string().min(1), why: z.string() })),
|
|
75
|
+
/** New hits under which a try counts as thin, so the next try runs. */
|
|
76
|
+
thin: z.number().int().nonnegative(),
|
|
77
|
+
});
|
|
78
|
+
export const Budget = z.object({
|
|
79
|
+
/** Queries per round: a guard rail the brief shows, never a cap. */
|
|
80
|
+
queries: z.number().int().positive(),
|
|
81
|
+
/** Documents to read per round. */
|
|
82
|
+
reads: z.number().int().positive(),
|
|
83
|
+
/** Rounds before a review should stop: a guard rail; past it the why says why. */
|
|
84
|
+
rounds: z.number().int().positive(),
|
|
85
|
+
/** Kept findings per round that a model checks against their document: a sample spread across the documents. 0: none. */
|
|
86
|
+
checks: z.number().int().nonnegative().default(3),
|
|
87
|
+
});
|
|
88
|
+
/**
|
|
89
|
+
* The recipe for one ask kind: the sources it may use, the budget, the tree guide. Versioned and
|
|
90
|
+
* tuned like an SOP, stored beside the ledger. A file from before 0.30.0 carries the old
|
|
91
|
+
* model planner's prompts: parsing drops them.
|
|
92
|
+
*/
|
|
93
|
+
export const PlanFile = z.object({
|
|
94
|
+
id: z.string().min(1),
|
|
95
|
+
kind: AskKind,
|
|
96
|
+
version: z.number().int().positive(),
|
|
97
|
+
/** Source names a run may use, in order of preference. A run can narrow the list, never widen it. */
|
|
98
|
+
sources: z.array(z.string()),
|
|
99
|
+
budget: Budget,
|
|
100
|
+
/** How much a source's age counts for this kind, one sentence the brief shows. Never a cutoff. */
|
|
101
|
+
age: z.string().optional(),
|
|
102
|
+
/** What the agent heeds for this kind when it plans and triages, one line each. Absent: the kind's default. */
|
|
103
|
+
rules: z.array(z.string().min(1)).optional(),
|
|
104
|
+
/** The facets a query tree of this kind covers. Absent on a file from before version 6: the kind's default. */
|
|
105
|
+
tree: TreeGuide.optional(),
|
|
106
|
+
/**
|
|
107
|
+
* The run tree's caps. `depth`: levels from the root (2: the root and its children); past it a
|
|
108
|
+
* warning, not a stop. `children`: per parent round. `reads`: pages the whole tree may read, the
|
|
109
|
+
* one hard stop; absent, the root's reads times rounds times (children + 1). Absent: 2 and 6.
|
|
110
|
+
*/
|
|
111
|
+
runs: z
|
|
112
|
+
.object({
|
|
113
|
+
depth: z.number().int().positive(),
|
|
114
|
+
children: z.number().int().positive(),
|
|
115
|
+
reads: z.number().int().positive().optional(),
|
|
116
|
+
})
|
|
117
|
+
.optional(),
|
|
118
|
+
});
|
|
119
|
+
/** What a source, channel or proposer yielded before. The files ledger writes it. */
|
|
120
|
+
export const YieldRow = z.object({
|
|
121
|
+
by: z.string().optional(),
|
|
122
|
+
source: z.string().optional(),
|
|
123
|
+
channel: z.string().optional(),
|
|
124
|
+
kind: AskKind.optional(),
|
|
125
|
+
hits: z.number().int().nonnegative(),
|
|
126
|
+
reads: z.number().int().nonnegative(),
|
|
127
|
+
proposed: z.number().int().nonnegative(),
|
|
128
|
+
kept: z.number().int().nonnegative(),
|
|
129
|
+
});
|
|
130
|
+
/** What a round was planned from, kept with its snapshot. */
|
|
131
|
+
export const Snapshot = z.object({
|
|
132
|
+
at: z.string(),
|
|
133
|
+
known: z.array(z.string()),
|
|
134
|
+
planFile: z.object({ id: z.string(), version: z.number().int() }),
|
|
135
|
+
model: z.string().nullable(),
|
|
136
|
+
yieldRows: z.number().int().nonnegative(),
|
|
137
|
+
});
|
|
138
|
+
/** A hit as a source shows it for free: no read has happened. `sources` is every source that returned it. */
|
|
139
|
+
export const HitView = z.object({
|
|
140
|
+
url: z.string().min(1),
|
|
141
|
+
title: z.string().optional(),
|
|
142
|
+
channel: z.string().optional(),
|
|
143
|
+
/** Seconds, for video and audio. */
|
|
144
|
+
length: z.number().nonnegative().optional(),
|
|
145
|
+
/** ISO date, when the source gives one. */
|
|
146
|
+
date: z.string().optional(),
|
|
147
|
+
snippet: z.string().optional(),
|
|
148
|
+
sources: z.array(z.string()).default([]),
|
|
149
|
+
/** The judge's yes odds by question (serves, each criterion): a hint the brief shows. */
|
|
150
|
+
odds: z.record(z.string(), z.number()).optional(),
|
|
151
|
+
});
|
|
152
|
+
/** The extractor's word on one read document: how much of the ask it served, what is still missing. */
|
|
153
|
+
export const Verdict = z.object({
|
|
154
|
+
url: z.string(),
|
|
155
|
+
quality: z.enum(["rich", "thin", "off", "empty"]),
|
|
156
|
+
gap: z.string().optional(),
|
|
157
|
+
});
|
|
158
|
+
export const Step = z.enum(["plan", "fetch", "triage", "read", "extract"]);
|
|
159
|
+
/** The edge out of a round. `again` is a new round from `plan`; `back` reruns one step of this round. */
|
|
160
|
+
export const Edge = z.object({
|
|
161
|
+
next: z.enum(["stop", "again", "back"]),
|
|
162
|
+
to: Step.optional(),
|
|
163
|
+
why: z.string(),
|
|
164
|
+
from: From,
|
|
165
|
+
by: z.string(),
|
|
166
|
+
});
|
|
167
|
+
export { z };
|
|
168
|
+
//# sourceMappingURL=types.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/engine/types.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,MAAM,CAAC,MAAM,OAAO,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC,KAAK,EAAE,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,CAAC,CAAC,CAAC;AAG7E,iDAAiD;AACjD,MAAM,CAAC,MAAM,IAAI,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC,CAAC;AAG5C;;;GAGG;AACH,MAAM,CAAC,MAAM,SAAS,GAAG,CAAC,CAAC,MAAM,CAAC;IAChC,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,KAAK,CAAC,mBAAmB,CAAC;IAC3C,QAAQ,EAA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