@hevmind/ask 0.1.1 → 0.3.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 +33 -13
- package/openapi.yaml +53 -7
- package/package.json +6 -6
- package/skills/build-digest/SKILL.md +70 -120
- package/src/digest/build.ts +54 -16
- package/src/digest/cli.ts +19 -7
- package/src/digest/frontmatter.ts +7 -0
- package/src/digest/schema.ts +3 -0
- package/src/digest/tree.ts +259 -0
- package/src/digest/verify.ts +2 -11
- package/src/endpoint.ts +121 -5
- package/src/index.ts +1 -1
- package/src/integration.ts +16 -14
- package/src/llm-openai.ts +330 -0
- package/src/observability.ts +3 -1
- package/src/providers.ts +81 -0
- package/src/search/loop.ts +219 -4
- package/src/types.ts +34 -6
package/src/types.ts
CHANGED
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
/** Inference providers the search loop and digest builder can run against. */
|
|
2
|
+
export type ProviderName = 'anthropic' | 'openai' | 'openrouter';
|
|
3
|
+
|
|
1
4
|
export interface HevAskOptions {
|
|
2
5
|
/**
|
|
3
6
|
* Content collection name(s) to index and search over.
|
|
@@ -6,8 +9,24 @@ export interface HevAskOptions {
|
|
|
6
9
|
collections?: string[];
|
|
7
10
|
|
|
8
11
|
/**
|
|
9
|
-
*
|
|
10
|
-
*
|
|
12
|
+
* Inference provider for the agentic loop and the digest builder. Each
|
|
13
|
+
* provider reads its own key from the environment: `ANTHROPIC_API_KEY`,
|
|
14
|
+
* `OPENAI_API_KEY`, or `OPENROUTER_API_KEY`.
|
|
15
|
+
* @default 'anthropic'
|
|
16
|
+
*/
|
|
17
|
+
provider?: ProviderName;
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* Override the provider's API base URL. Applies to the OpenAI-compatible
|
|
21
|
+
* providers only, so any Chat Completions-compatible endpoint works
|
|
22
|
+
* (e.g. a proxy or a self-hosted gateway).
|
|
23
|
+
*/
|
|
24
|
+
providerBaseUrl?: string;
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* Model used by the bounded search loop. Defaults per provider:
|
|
28
|
+
* `claude-haiku-4-5` (anthropic), `gpt-4.1-mini` (openai),
|
|
29
|
+
* `anthropic/claude-haiku-4.5` (openrouter).
|
|
11
30
|
*/
|
|
12
31
|
model?: string;
|
|
13
32
|
|
|
@@ -38,8 +57,9 @@ export interface HevAskOptions {
|
|
|
38
57
|
answerMaxTokens?: number;
|
|
39
58
|
|
|
40
59
|
/**
|
|
41
|
-
* Model used by the offline digest builder.
|
|
42
|
-
*
|
|
60
|
+
* Model used by the offline digest builder. Defaults per provider:
|
|
61
|
+
* `claude-opus-4-8` (anthropic), `gpt-5.1` (openai),
|
|
62
|
+
* `anthropic/claude-opus-4.8` (openrouter).
|
|
43
63
|
*/
|
|
44
64
|
digestModel?: string;
|
|
45
65
|
|
|
@@ -69,8 +89,14 @@ export interface HevAskOptions {
|
|
|
69
89
|
perDocCap?: number;
|
|
70
90
|
|
|
71
91
|
/**
|
|
72
|
-
* Path to the committed ask digest
|
|
73
|
-
* @default '.hev-ask
|
|
92
|
+
* Path to the committed ask digest tree, relative to the site root.
|
|
93
|
+
* @default '.hev-ask'
|
|
94
|
+
*/
|
|
95
|
+
digestDir?: string;
|
|
96
|
+
|
|
97
|
+
/**
|
|
98
|
+
* Deprecated alias for `digestDir`.
|
|
99
|
+
* @default '.hev-ask'
|
|
74
100
|
*/
|
|
75
101
|
digestPath?: string;
|
|
76
102
|
|
|
@@ -84,6 +110,8 @@ export interface HevAskOptions {
|
|
|
84
110
|
/** The shape the integration serializes into `virtual:hev-ask/config`. */
|
|
85
111
|
export interface ResolvedConfig {
|
|
86
112
|
collections: string[] | null;
|
|
113
|
+
provider: ProviderName;
|
|
114
|
+
providerBaseUrl?: string;
|
|
87
115
|
model: string;
|
|
88
116
|
digestModel: string;
|
|
89
117
|
endpoint: string;
|