eve-knowledge 0.1.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 ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 eve-knowledge contributors
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,175 @@
1
+ # eve-knowledge
2
+
3
+ Add a cited `agent/knowledge/` folder to Eve agents.
4
+
5
+ `agent/knowledge/` is an `eve-knowledge` convention, not a native Eve slot. The package indexes those files explicitly and exposes them through a generated `search_knowledge` Eve tool.
6
+
7
+ ## Quickstart
8
+
9
+ Requires Node.js 24 or newer, matching Eve's current runtime requirement.
10
+
11
+ ```bash
12
+ npm install eve-knowledge
13
+ npx eve-knowledge init
14
+ npx eve-knowledge index
15
+ npx eve-knowledge search "refund policy"
16
+ ```
17
+
18
+ `init` creates:
19
+
20
+ ```txt
21
+ agent/
22
+ knowledge/
23
+ README.md
24
+ .eveknowledgeignore
25
+ tools/
26
+ search_knowledge.ts
27
+ skills/
28
+ answer-with-citations.md
29
+ eve-knowledge.config.json
30
+ ```
31
+
32
+ ## Mental Model
33
+
34
+ - `instructions.md` tells the agent how to behave.
35
+ - `tools/` exposes typed runtime actions.
36
+ - `skills/` are load-on-demand procedures and playbooks.
37
+ - `connections/` connect external MCP or OpenAPI services.
38
+ - `agent/knowledge/` is reference material indexed by `eve-knowledge`.
39
+
40
+ ## When To Use What
41
+
42
+ | Need | Use | Why |
43
+ | --- | --- | --- |
44
+ | Permanent behavior and personality | `agent/instructions.md` | Always-on guidance for the agent. |
45
+ | A typed runtime action | `agent/tools/` | Tools execute code and can access runtime services. |
46
+ | A procedure the model should load on demand | `agent/skills/` | Skills are playbooks, not document stores. |
47
+ | External SaaS/API/MCP capabilities | `agent/connections/` | Connections hide credentials and expose remote tools. |
48
+ | Product docs, runbooks, policies, decisions | `agent/knowledge/` with `eve-knowledge` | Reference material should be searched and cited, not stuffed into prompts. |
49
+ | Runtime-learned user facts | Future memory layer | Mutable memory needs approval, retention, delete, export, and audit rules. |
50
+
51
+ ## File Conventions
52
+
53
+ Supported files:
54
+
55
+ - Markdown
56
+ - MDX
57
+ - Plain text
58
+ - JSON
59
+ - YAML
60
+
61
+ Markdown frontmatter becomes metadata. Headings become citation context. `.eveknowledgeignore` adds project-specific ignore rules on top of safe defaults for env files, keys, build output, dependencies, and the local `.eve-knowledge/` store.
62
+
63
+ ## Config
64
+
65
+ ```json
66
+ {
67
+ "knowledgeDir": "agent/knowledge",
68
+ "storeDir": ".eve-knowledge",
69
+ "redaction": {
70
+ "mode": "warn"
71
+ }
72
+ }
73
+ ```
74
+
75
+ `index` warns on likely secrets by default. `check` runs with fail-fast redaction semantics for CI.
76
+
77
+ Executable `eve-knowledge.config.ts/js/mjs` files are trusted-code only and require `--trusted-config`. CI should use `eve-knowledge.config.json`.
78
+
79
+ ## Embeddings
80
+
81
+ The MVP uses lexical search so development, tests, and evals work without an embedding provider. The public contracts include `EmbeddingProvider` and `KnowledgeStore` so production adapters can add vector search without changing the generated Eve tool.
82
+
83
+ If you add embeddings, keep provider configuration explicit. Do not silently send private docs to a third-party embedding provider.
84
+
85
+ ## CLI
86
+
87
+ ```bash
88
+ npx eve-knowledge init --dry-run
89
+ npx eve-knowledge init --force
90
+ npx eve-knowledge index
91
+ npx eve-knowledge check
92
+ npx eve-knowledge search "SOC 2"
93
+ ```
94
+
95
+ `init` detects Eve projects through `agent/instructions.md`, `agent/agent.ts`, `agent/tools/`, or an `eve` dependency. Use `--allow-non-eve` only for tests, templates, or unusual project layouts.
96
+
97
+ ## Evals
98
+
99
+ ```ts
100
+ import { runKnowledgeEvals } from "eve-knowledge";
101
+
102
+ const results = await runKnowledgeEvals({
103
+ cases: [
104
+ {
105
+ name: "refund citation",
106
+ query: "refund window",
107
+ expectPath: "agent/knowledge/product/refunds.md",
108
+ },
109
+ {
110
+ name: "no answer",
111
+ query: "HIPAA attestation",
112
+ expectNoResults: true,
113
+ },
114
+ ],
115
+ });
116
+ ```
117
+
118
+ ## Memory Versus Knowledge
119
+
120
+ Reference knowledge is committed source material. Mutable memory is learned at runtime. `eve-knowledge` keeps memory disabled by default and does not silently persist user facts.
121
+
122
+ Future memory support must include provenance, approval, delete, forget, export, retention, and redaction hooks before it becomes a default feature.
123
+
124
+ ## Common Examples
125
+
126
+ Support runbook:
127
+
128
+ ```txt
129
+ agent/knowledge/runbooks/refunds.md
130
+ agent/knowledge/runbooks/escalations.md
131
+ ```
132
+
133
+ Repo decisions:
134
+
135
+ ```txt
136
+ agent/knowledge/decisions/0001-use-postgres.md
137
+ agent/knowledge/decisions/0002-agent-memory-policy.md
138
+ ```
139
+
140
+ Product docs:
141
+
142
+ ```txt
143
+ agent/knowledge/product/pricing.md
144
+ agent/knowledge/product/security.md
145
+ ```
146
+
147
+ Personal memory:
148
+
149
+ Keep mutable personal memory out of reference docs until you have explicit approval, retention, delete, export, and audit rules. Use committed reference docs for stable facts and policies.
150
+
151
+ ## Storage
152
+
153
+ The built-in local JSON store is for development and tests. For production, use a durable adapter that implements the exported `KnowledgeStore` contract. See [docs/production-storage.md](docs/production-storage.md).
154
+
155
+ ## Native Eve Knowledge Slot
156
+
157
+ If Eve later ships a native `agent/knowledge/` slot, this package should become the migration bridge:
158
+
159
+ 1. Keep the same folder convention.
160
+ 2. Reuse existing chunk metadata and citations where possible.
161
+ 3. Replace the generated `search_knowledge` tool with Eve's native capability.
162
+ 4. Keep `eve-knowledge check` as a CI/eval layer if it remains useful.
163
+
164
+ Until that exists, `agent/knowledge/` is only an `eve-knowledge` convention.
165
+
166
+ ## Privacy
167
+
168
+ Do not index private customer data, personal data, credentials, or regulated records unless you have consent, retention rules, deletion procedures, and an appropriate production store. The default scanner ignores common secret files and warns on secret-looking content, but those checks are guardrails, not a substitute for data governance.
169
+
170
+ ## Troubleshooting
171
+
172
+ - No Eve project detected: add `agent/instructions.md`, `agent/agent.ts`, `agent/tools/`, or an `eve` dependency.
173
+ - Search returns no results: run `npx eve-knowledge index` and check `.eve-knowledge/index.json`.
174
+ - CI fails on redaction: remove the unsafe file, add a safe ignore rule, or move sensitive data to a governed system.
175
+ - Production warning: do not use local filesystem storage for durable serverless workloads.
package/dist/cli.d.ts ADDED
@@ -0,0 +1,6 @@
1
+ import { Command } from 'commander';
2
+
3
+ declare function createCli(): Command;
4
+ declare function runCli(argv?: string[]): Promise<void>;
5
+
6
+ export { createCli, runCli };