@askalf/deepdive 0.5.0 → 0.7.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.
@@ -0,0 +1,138 @@
1
+ // Cost telemetry — pure pricing math + a small registry of public list
2
+ // prices for well-known Anthropic models.
3
+ //
4
+ // Every LLM call in deepdive returns input/output token counts. We sum
5
+ // those across a run and turn them into an estimated dollar cost so the
6
+ // end-of-run summary shows what the same workload would have cost at API
7
+ // list prices — the cost-arbitrage angle the README leans on.
8
+ //
9
+ // This module is pure: no LLM, no network, no disk. Pricing constants
10
+ // live here as a hardcoded table. Drift is intentional: a PR is the right
11
+ // way to update prices, because that's also when we audit them. Users
12
+ // running unknown models can override via env vars.
13
+ // Anthropic public list pricing as of release. Verify against
14
+ // docs.anthropic.com/en/docs/about-claude/pricing before bumping.
15
+ //
16
+ // PRICE_TABLE_VERIFIED_AT records when the table was last spot-checked.
17
+ // `deepdive doctor` warns when the table is more than ~90 days stale,
18
+ // keeping the maintainer honest about audit cadence — drift is intentional
19
+ // (a PR is the right way to update prices), but undeclared drift is not.
20
+ export const PRICE_TABLE = {
21
+ "claude-sonnet-4-6": { inputPerMTok: 3, outputPerMTok: 15 },
22
+ "claude-opus-4-7": { inputPerMTok: 15, outputPerMTok: 75 },
23
+ "claude-haiku-4-5": { inputPerMTok: 0.8, outputPerMTok: 4 },
24
+ };
25
+ export const PRICE_TABLE_VERIFIED_AT = "2026-05-05";
26
+ // Threshold in days at which doctor flips the pricing check from "ok"
27
+ // to "warn". Exposed so tests can override.
28
+ export const PRICE_TABLE_STALE_AFTER_DAYS = 90;
29
+ // dario's default listening port — auto-detected to print the
30
+ // "$0 on Claude Max via dario" hint without claiming it for unrelated
31
+ // endpoints.
32
+ export const DARIO_DEFAULT_BASE_URL = "http://localhost:3456";
33
+ // Returns the price for `model`, or — if unknown — falls back to a pair
34
+ // of env-var overrides for self-hosted / unknown-named endpoints. Returns
35
+ // undefined when neither is available.
36
+ export function priceFor(model, env) {
37
+ const known = PRICE_TABLE[model];
38
+ if (known)
39
+ return known;
40
+ if (!env)
41
+ return undefined;
42
+ const inputStr = env.DEEPDIVE_PRICE_INPUT_PER_MTOK;
43
+ const outputStr = env.DEEPDIVE_PRICE_OUTPUT_PER_MTOK;
44
+ const input = parseDollars(inputStr);
45
+ const output = parseDollars(outputStr);
46
+ if (input === undefined || output === undefined)
47
+ return undefined;
48
+ return { inputPerMTok: input, outputPerMTok: output };
49
+ }
50
+ export function estimateCost(usage, model, env) {
51
+ const price = priceFor(model, env);
52
+ if (!price) {
53
+ return {
54
+ amountUsd: 0,
55
+ knownModel: false,
56
+ inputTokens: usage.inputTokens,
57
+ outputTokens: usage.outputTokens,
58
+ calls: usage.calls,
59
+ };
60
+ }
61
+ const amountUsd = (usage.inputTokens * price.inputPerMTok) / 1_000_000 +
62
+ (usage.outputTokens * price.outputPerMTok) / 1_000_000;
63
+ return {
64
+ amountUsd,
65
+ knownModel: model in PRICE_TABLE,
66
+ inputTokens: usage.inputTokens,
67
+ outputTokens: usage.outputTokens,
68
+ calls: usage.calls,
69
+ };
70
+ }
71
+ // Renders the one-line cost summary for the CLI. Two flavors:
72
+ // ~$0.034 · 12.1k in / 4.2k out · 4 LLM calls · claude-sonnet-4-6
73
+ // $? · 12.1k in / 4.2k out · 4 LLM calls · my-self-hosted
74
+ // $0.000 · 0 in / 0 out · 0 LLM calls · claude-sonnet-4-6
75
+ // Caller appends the dario hint separately when relevant.
76
+ export function formatCostLine(estimate, model) {
77
+ const cost = estimate.knownModel || estimate.amountUsd > 0
78
+ ? "~" + formatUsd(estimate.amountUsd)
79
+ : "$?";
80
+ const inK = formatTokens(estimate.inputTokens);
81
+ const outK = formatTokens(estimate.outputTokens);
82
+ const callsLabel = estimate.calls === 1 ? "1 LLM call" : `${estimate.calls} LLM calls`;
83
+ return `${cost} · ${inK} in / ${outK} out · ${callsLabel} · ${model}`;
84
+ }
85
+ // True when `baseUrl` points at the dario default. Used by the CLI to
86
+ // decide whether the "$0 on Claude Max via dario" hint is relevant.
87
+ export function looksLikeDario(baseUrl) {
88
+ return trim(baseUrl) === DARIO_DEFAULT_BASE_URL;
89
+ }
90
+ function trim(s) {
91
+ let end = s.length;
92
+ while (end > 0 && s[end - 1] === "/")
93
+ end--;
94
+ return s.slice(0, end);
95
+ }
96
+ // Exported for tests.
97
+ export function formatUsd(amount) {
98
+ if (amount === 0)
99
+ return "$0.000";
100
+ if (amount < 0.01)
101
+ return "$" + amount.toFixed(4);
102
+ if (amount < 1)
103
+ return "$" + amount.toFixed(3);
104
+ return "$" + amount.toFixed(2);
105
+ }
106
+ // Exported for tests.
107
+ export function formatTokens(n) {
108
+ if (n < 1000)
109
+ return String(n);
110
+ if (n < 10_000)
111
+ return (n / 1000).toFixed(2) + "k";
112
+ if (n < 1_000_000)
113
+ return (n / 1000).toFixed(1) + "k";
114
+ return (n / 1_000_000).toFixed(2) + "M";
115
+ }
116
+ // Whole-day delta between an ISO date string ("YYYY-MM-DD") and `now`.
117
+ // Returns NaN for malformed input. Exported for tests.
118
+ export function daysAgo(isoDate, now = Date.now()) {
119
+ const m = /^(\d{4})-(\d{2})-(\d{2})$/.exec(isoDate);
120
+ if (!m)
121
+ return NaN;
122
+ const t = Date.UTC(Number(m[1]), Number(m[2]) - 1, Number(m[3]));
123
+ if (!Number.isFinite(t))
124
+ return NaN;
125
+ return Math.floor((now - t) / 86_400_000);
126
+ }
127
+ function parseDollars(s) {
128
+ if (!s)
129
+ return undefined;
130
+ const trimmed = s.trim();
131
+ if (!/^\d+(\.\d+)?$|^\.\d+$/.test(trimmed))
132
+ return undefined;
133
+ const n = Number(trimmed);
134
+ if (!Number.isFinite(n) || n < 0)
135
+ return undefined;
136
+ return n;
137
+ }
138
+ //# sourceMappingURL=pricing.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pricing.js","sourceRoot":"","sources":["../src/pricing.ts"],"names":[],"mappings":"AAAA,uEAAuE;AACvE,0CAA0C;AAC1C,EAAE;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AAC;QAAE,OAAO,SAAS,CAAC;IACnD,OAAO,CAAC,CAAC;AACX,CAAC"}
@@ -1,8 +1,9 @@
1
1
  import { type LLMConfig } from "./llm.js";
2
2
  import type { Source } from "./citations.js";
3
+ import type { UsageSink } from "./plan.js";
3
4
  export interface SourceWithContent extends Source {
4
5
  content: string;
5
6
  }
6
- export declare function synthesize(question: string, sources: SourceWithContent[], config: LLMConfig, signal?: AbortSignal, onToken?: (text: string) => void): Promise<string>;
7
+ export declare function synthesize(question: string, sources: SourceWithContent[], config: LLMConfig, signal?: AbortSignal, onToken?: (text: string) => void, onUsage?: UsageSink): Promise<string>;
7
8
  export declare function buildSourcePacket(sources: SourceWithContent[]): string;
8
9
  //# sourceMappingURL=synthesize.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"synthesize.d.ts","sourceRoot":"","sources":["../src/synthesize.ts"],"names":[],"mappings":"AAOA,OAAO,EAAW,KAAK,SAAS,EAAE,MAAM,UAAU,CAAC;AAEnD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAC;AAE7C,MAAM,WAAW,iBAAkB,SAAQ,MAAM;IAC/C,OAAO,EAAE,MAAM,CAAC;CACjB;AAkBD,wBAAsB,UAAU,CAC9B,QAAQ,EAAE,MAAM,EAChB,OAAO,EAAE,iBAAiB,EAAE,EAC5B,MAAM,EAAE,SAAS,EACjB,MAAM,CAAC,EAAE,WAAW,EACpB,OAAO,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,GAC/B,OAAO,CAAC,MAAM,CAAC,CAsBjB;AAGD,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,iBAAiB,EAAE,GAAG,MAAM,CAOtE"}
1
+ {"version":3,"file":"synthesize.d.ts","sourceRoot":"","sources":["../src/synthesize.ts"],"names":[],"mappings":"AAOA,OAAO,EAAW,KAAK,SAAS,EAAkB,MAAM,UAAU,CAAC;AAEnE,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAC;AAC7C,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AAE3C,MAAM,WAAW,iBAAkB,SAAQ,MAAM;IAC/C,OAAO,EAAE,MAAM,CAAC;CACjB;AAkBD,wBAAsB,UAAU,CAC9B,QAAQ,EAAE,MAAM,EAChB,OAAO,EAAE,iBAAiB,EAAE,EAC5B,MAAM,EAAE,SAAS,EACjB,MAAM,CAAC,EAAE,WAAW,EACpB,OAAO,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,EAChC,OAAO,CAAC,EAAE,SAAS,GAClB,OAAO,CAAC,MAAM,CAAC,CAwBjB;AAGD,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,iBAAiB,EAAE,GAAG,MAAM,CAOtE"}
@@ -21,7 +21,7 @@ Rules:
21
21
  - If the sources do not answer the question, say so — do not hallucinate.
22
22
  - Do not include a "Sources" section yourself — the caller appends it.
23
23
  - Length: match the complexity of the question. A one-line question can get a paragraph; a comparison question may need headers and a table.`;
24
- export async function synthesize(question, sources, config, signal, onToken) {
24
+ export async function synthesize(question, sources, config, signal, onToken, onUsage) {
25
25
  if (sources.length === 0) {
26
26
  return "_No sources could be fetched or extracted. Unable to answer._";
27
27
  }
@@ -30,12 +30,16 @@ export async function synthesize(question, sources, config, signal, onToken) {
30
30
  `Sources (${sources.length}):\n\n${packet}\n\n` +
31
31
  `Write the cited markdown answer now.`;
32
32
  const messages = [{ role: "user", content: userMessage }];
33
+ let result;
33
34
  if (onToken) {
34
- const { text } = await callLLMStream(messages, SYNTH_SYSTEM, config, { onToken }, signal);
35
- return text;
35
+ result = await callLLMStream(messages, SYNTH_SYSTEM, config, { onToken }, signal);
36
36
  }
37
- const { text } = await callLLM(messages, SYNTH_SYSTEM, config, signal);
38
- return text;
37
+ else {
38
+ result = await callLLM(messages, SYNTH_SYSTEM, config, signal);
39
+ }
40
+ if (result.usage && onUsage)
41
+ onUsage(result.usage);
42
+ return result.text;
39
43
  }
40
44
  // Exported for unit tests.
41
45
  export function buildSourcePacket(sources) {
@@ -1 +1 @@
1
- {"version":3,"file":"synthesize.js","sourceRoot":"","sources":["../src/synthesize.ts"],"names":[],"mappings":"AAAA,yEAAyE;AACzE,wEAAwE;AACxE,2EAA2E;AAC3E,EAAE;AACF,2EAA2E;AAC3E,2EAA2E;AAE3E,OAAO,EAAE,OAAO,EAAkB,MAAM,UAAU,CAAC;AACnD,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAOhD,MAAM,YAAY,GAAG;;;;;;;;;;;;;;6IAcwH,CAAC;AAE9I,MAAM,CAAC,KAAK,UAAU,UAAU,CAC9B,QAAgB,EAChB,OAA4B,EAC5B,MAAiB,EACjB,MAAoB,EACpB,OAAgC;IAEhC,IAAI,OAAO,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QACzB,OAAO,+DAA+D,CAAC;IACzE,CAAC;IACD,MAAM,MAAM,GAAG,iBAAiB,CAAC,OAAO,CAAC,CAAC;IAC1C,MAAM,WAAW,GACf,aAAa,QAAQ,MAAM;QAC3B,YAAY,OAAO,CAAC,MAAM,SAAS,MAAM,MAAM;QAC/C,sCAAsC,CAAC;IACzC,MAAM,QAAQ,GAAG,CAAC,EAAE,IAAI,EAAE,MAAe,EAAE,OAAO,EAAE,WAAW,EAAE,CAAC,CAAC;IACnE,IAAI,OAAO,EAAE,CAAC;QACZ,MAAM,EAAE,IAAI,EAAE,GAAG,MAAM,aAAa,CAClC,QAAQ,EACR,YAAY,EACZ,MAAM,EACN,EAAE,OAAO,EAAE,EACX,MAAM,CACP,CAAC;QACF,OAAO,IAAI,CAAC;IACd,CAAC;IACD,MAAM,EAAE,IAAI,EAAE,GAAG,MAAM,OAAO,CAAC,QAAQ,EAAE,YAAY,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC;IACvE,OAAO,IAAI,CAAC;AACd,CAAC;AAED,2BAA2B;AAC3B,MAAM,UAAU,iBAAiB,CAAC,OAA4B;IAC5D,OAA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EACX,MAAM,CACP,CAAC;IACJ,CAAC;SAAM,CAAC;QACN,MAAM,GAAG,MAAM,OAAO,CAAC,QAAQ,EAAE,YAAY,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC;IACjE,CAAC;IACD,IAAI,MAAM,CAAC,KAAK,IAAI,OAAO;QAAE,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;IACnD,OAAO,MAAM,CAAC,IAAI,CAAC;AACrB,CAAC;AAED,2BAA2B;AAC3B,MAAM,UAAU,iBAAiB,CAAC,OAA4B;IAC5D,OAAO,OAAO;SACX,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE;QACT,MAAM,MAAM,GAAG,IAAI,CAAC,CAAC,EAAE,KAAK,CAAC,CAAC,KAAK,IAAI,YAAY,MAAM,CAAC,CAAC,GAAG,EAAE,CAAC;QACjE,OAAO,GAAG,MAAM,OAAO,CAAC,CAAC,OAAO,EAAE,CAAC;IACrC,CAAC,CAAC;SACD,IAAI,CAAC,aAAa,CAAC,CAAC;AACzB,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@askalf/deepdive",
3
- "version": "0.5.0",
3
+ "version": "0.7.0",
4
4
  "description": "A local research agent. One command, cited answer. Routes every LLM call through your own proxy (dario, Anthropic-compat, OpenAI-compat). Headless browser + pluggable search + multi-provider LLM — zero hosted dependencies.",
5
5
  "type": "module",
6
6
  "bin": {
@@ -62,6 +62,7 @@
62
62
  },
63
63
  "devDependencies": {
64
64
  "@types/node": "^25.6.0",
65
+ "pdfjs-dist": "^5.7.284",
65
66
  "tsx": "^4.19.0",
66
67
  "typescript": "^5.7.0"
67
68
  }