daftari 1.0.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/CHANGELOG.md +37 -0
- package/LICENSE +21 -0
- package/README.md +259 -0
- package/dist/access/locks.d.ts +19 -0
- package/dist/access/locks.d.ts.map +1 -0
- package/dist/access/locks.js +112 -0
- package/dist/access/locks.js.map +1 -0
- package/dist/access/rbac.d.ts +18 -0
- package/dist/access/rbac.d.ts.map +1 -0
- package/dist/access/rbac.js +48 -0
- package/dist/access/rbac.js.map +1 -0
- package/dist/cli.d.ts +4 -0
- package/dist/cli.d.ts.map +1 -0
- package/dist/cli.js +216 -0
- package/dist/cli.js.map +1 -0
- package/dist/curation/lint.d.ts +20 -0
- package/dist/curation/lint.d.ts.map +1 -0
- package/dist/curation/lint.js +176 -0
- package/dist/curation/lint.js.map +1 -0
- package/dist/curation/provenance.d.ts +21 -0
- package/dist/curation/provenance.d.ts.map +1 -0
- package/dist/curation/provenance.js +80 -0
- package/dist/curation/provenance.js.map +1 -0
- package/dist/curation/staleness.d.ts +19 -0
- package/dist/curation/staleness.d.ts.map +1 -0
- package/dist/curation/staleness.js +67 -0
- package/dist/curation/staleness.js.map +1 -0
- package/dist/curation/tension.d.ts +20 -0
- package/dist/curation/tension.d.ts.map +1 -0
- package/dist/curation/tension.js +134 -0
- package/dist/curation/tension.js.map +1 -0
- package/dist/frontmatter/parser.d.ts +10 -0
- package/dist/frontmatter/parser.d.ts.map +1 -0
- package/dist/frontmatter/parser.js +29 -0
- package/dist/frontmatter/parser.js.map +1 -0
- package/dist/frontmatter/schema.d.ts +7 -0
- package/dist/frontmatter/schema.d.ts.map +1 -0
- package/dist/frontmatter/schema.js +115 -0
- package/dist/frontmatter/schema.js.map +1 -0
- package/dist/frontmatter/types.d.ts +41 -0
- package/dist/frontmatter/types.d.ts.map +1 -0
- package/dist/frontmatter/types.js +8 -0
- package/dist/frontmatter/types.js.map +1 -0
- package/dist/index.d.ts +4 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +94 -0
- package/dist/index.js.map +1 -0
- package/dist/search/bm25.d.ts +19 -0
- package/dist/search/bm25.d.ts.map +1 -0
- package/dist/search/bm25.js +115 -0
- package/dist/search/bm25.js.map +1 -0
- package/dist/search/hybrid.d.ts +38 -0
- package/dist/search/hybrid.d.ts.map +1 -0
- package/dist/search/hybrid.js +162 -0
- package/dist/search/hybrid.js.map +1 -0
- package/dist/search/reindex.d.ts +15 -0
- package/dist/search/reindex.d.ts.map +1 -0
- package/dist/search/reindex.js +189 -0
- package/dist/search/reindex.js.map +1 -0
- package/dist/search/vector.d.ts +9 -0
- package/dist/search/vector.d.ts.map +1 -0
- package/dist/search/vector.js +128 -0
- package/dist/search/vector.js.map +1 -0
- package/dist/server.d.ts +6 -0
- package/dist/server.d.ts.map +1 -0
- package/dist/server.js +72 -0
- package/dist/server.js.map +1 -0
- package/dist/storage/index-db.d.ts +37 -0
- package/dist/storage/index-db.d.ts.map +1 -0
- package/dist/storage/index-db.js +145 -0
- package/dist/storage/index-db.js.map +1 -0
- package/dist/storage/local.d.ts +6 -0
- package/dist/storage/local.d.ts.map +1 -0
- package/dist/storage/local.js +57 -0
- package/dist/storage/local.js.map +1 -0
- package/dist/tools/curation.d.ts +22 -0
- package/dist/tools/curation.d.ts.map +1 -0
- package/dist/tools/curation.js +202 -0
- package/dist/tools/curation.js.map +1 -0
- package/dist/tools/read.d.ts +74 -0
- package/dist/tools/read.d.ts.map +1 -0
- package/dist/tools/read.js +254 -0
- package/dist/tools/read.js.map +1 -0
- package/dist/tools/search.d.ts +13 -0
- package/dist/tools/search.d.ts.map +1 -0
- package/dist/tools/search.js +190 -0
- package/dist/tools/search.js.map +1 -0
- package/dist/tools/write.d.ts +18 -0
- package/dist/tools/write.d.ts.map +1 -0
- package/dist/tools/write.js +465 -0
- package/dist/tools/write.js.map +1 -0
- package/dist/utils/config.d.ts +12 -0
- package/dist/utils/config.d.ts.map +1 -0
- package/dist/utils/config.js +94 -0
- package/dist/utils/config.js.map +1 -0
- package/dist/utils/git.d.ts +23 -0
- package/dist/utils/git.d.ts.map +1 -0
- package/dist/utils/git.js +114 -0
- package/dist/utils/git.js.map +1 -0
- package/package.json +69 -0
- package/templates/config.yaml +31 -0
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
// Git is Daftari's version-control layer: every write operation auto-commits,
|
|
2
|
+
// so the markdown files' history *is* the document history. There is no
|
|
3
|
+
// separate versioning system.
|
|
4
|
+
//
|
|
5
|
+
// This module shells out to the `git` CLI via execFile (argument array, no
|
|
6
|
+
// shell) rather than taking a dependency. The vault directory is the git work
|
|
7
|
+
// tree; `git -C <vaultRoot>` scopes every command to it.
|
|
8
|
+
import { execFile } from "node:child_process";
|
|
9
|
+
import { promisify } from "node:util";
|
|
10
|
+
import { err, ok } from "../frontmatter/types.js";
|
|
11
|
+
const run = promisify(execFile);
|
|
12
|
+
export function gitIdentity(identity) {
|
|
13
|
+
const slug = identity.replace(/[^a-zA-Z0-9._-]+/g, "-").replace(/^-+|-+$/g, "");
|
|
14
|
+
return {
|
|
15
|
+
name: identity,
|
|
16
|
+
email: `${slug || "unknown"}@daftari.local`,
|
|
17
|
+
};
|
|
18
|
+
}
|
|
19
|
+
async function git(vaultRoot, args) {
|
|
20
|
+
try {
|
|
21
|
+
const { stdout } = await run("git", ["-C", vaultRoot, ...args], {
|
|
22
|
+
maxBuffer: 16 * 1024 * 1024,
|
|
23
|
+
});
|
|
24
|
+
return ok(stdout);
|
|
25
|
+
}
|
|
26
|
+
catch (e) {
|
|
27
|
+
const reason = e instanceof Error && "stderr" in e && typeof e.stderr === "string"
|
|
28
|
+
? e.stderr.trim() || e.message
|
|
29
|
+
: e instanceof Error
|
|
30
|
+
? e.message
|
|
31
|
+
: String(e);
|
|
32
|
+
return err(new Error(`git ${args[0]} failed: ${reason}`));
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
export async function isGitRepo(vaultRoot) {
|
|
36
|
+
const result = await git(vaultRoot, ["rev-parse", "--is-inside-work-tree"]);
|
|
37
|
+
return result.ok && result.value.trim() === "true";
|
|
38
|
+
}
|
|
39
|
+
// Initializes a git repo at the vault root if one does not already exist.
|
|
40
|
+
// Idempotent — safe to call on every write.
|
|
41
|
+
export async function ensureGitRepo(vaultRoot) {
|
|
42
|
+
if (await isGitRepo(vaultRoot))
|
|
43
|
+
return ok(undefined);
|
|
44
|
+
const init = await git(vaultRoot, ["init", "--quiet"]);
|
|
45
|
+
if (!init.ok)
|
|
46
|
+
return init;
|
|
47
|
+
return ok(undefined);
|
|
48
|
+
}
|
|
49
|
+
// Stages the given vault-relative paths and creates a commit authored by
|
|
50
|
+
// `identity`. The commit's committer is also set to `identity` (via `-c`
|
|
51
|
+
// overrides) so commits land even in a repo with no configured user. Returns
|
|
52
|
+
// the new commit's short hash.
|
|
53
|
+
export async function commit(vaultRoot, paths, message, identity) {
|
|
54
|
+
const ready = await ensureGitRepo(vaultRoot);
|
|
55
|
+
if (!ready.ok)
|
|
56
|
+
return ready;
|
|
57
|
+
if (paths.length === 0) {
|
|
58
|
+
return err(new Error("commit requires at least one path"));
|
|
59
|
+
}
|
|
60
|
+
const staged = await git(vaultRoot, ["add", "--", ...paths]);
|
|
61
|
+
if (!staged.ok)
|
|
62
|
+
return staged;
|
|
63
|
+
const id = gitIdentity(identity);
|
|
64
|
+
const committed = await git(vaultRoot, [
|
|
65
|
+
"-c",
|
|
66
|
+
`user.name=${id.name}`,
|
|
67
|
+
"-c",
|
|
68
|
+
`user.email=${id.email}`,
|
|
69
|
+
"commit",
|
|
70
|
+
`--author=${id.name} <${id.email}>`,
|
|
71
|
+
"-m",
|
|
72
|
+
message,
|
|
73
|
+
]);
|
|
74
|
+
if (!committed.ok)
|
|
75
|
+
return committed;
|
|
76
|
+
const hash = await git(vaultRoot, ["rev-parse", "--short", "HEAD"]);
|
|
77
|
+
if (!hash.ok)
|
|
78
|
+
return hash;
|
|
79
|
+
return ok({ hash: hash.value.trim() });
|
|
80
|
+
}
|
|
81
|
+
// Returns the most recent commits, newest first. `path`, when given, scopes
|
|
82
|
+
// the log to a single file's history.
|
|
83
|
+
export async function log(vaultRoot, opts = {}) {
|
|
84
|
+
if (!(await isGitRepo(vaultRoot))) {
|
|
85
|
+
return err(new Error("not a git repository"));
|
|
86
|
+
}
|
|
87
|
+
const limit = opts.limit && opts.limit > 0 ? Math.floor(opts.limit) : 20;
|
|
88
|
+
// \x1f (unit separator) splits fields; \x1e (record separator) splits commits.
|
|
89
|
+
const format = "%H%x1f%an%x1f%ae%x1f%aI%x1f%s%x1e";
|
|
90
|
+
const args = ["log", `--pretty=format:${format}`, `-n`, String(limit)];
|
|
91
|
+
if (opts.path)
|
|
92
|
+
args.push("--", opts.path);
|
|
93
|
+
const result = await git(vaultRoot, args);
|
|
94
|
+
if (!result.ok)
|
|
95
|
+
return result;
|
|
96
|
+
const commits = [];
|
|
97
|
+
for (const record of result.value.split("\x1e")) {
|
|
98
|
+
const trimmed = record.trim();
|
|
99
|
+
if (!trimmed)
|
|
100
|
+
continue;
|
|
101
|
+
const [hash, author, email, date, subject] = trimmed.split("\x1f");
|
|
102
|
+
if (!hash)
|
|
103
|
+
continue;
|
|
104
|
+
commits.push({
|
|
105
|
+
hash,
|
|
106
|
+
author: author ?? "",
|
|
107
|
+
email: email ?? "",
|
|
108
|
+
date: date ?? "",
|
|
109
|
+
subject: subject ?? "",
|
|
110
|
+
});
|
|
111
|
+
}
|
|
112
|
+
return ok(commits);
|
|
113
|
+
}
|
|
114
|
+
//# sourceMappingURL=git.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"git.js","sourceRoot":"","sources":["../../src/utils/git.ts"],"names":[],"mappings":"AAAA,8EAA8E;AAC9E,wEAAwE;AACxE,8BAA8B;AAC9B,EAAE;AACF,2EAA2E;AAC3E,8EAA8E;AAC9E,yDAAyD;AAEzD,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAC9C,OAAO,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I;QAAE,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC;IAE1C,MAAM,MAAM,GAAG,MAAM,GAAG,CAAC,SAAS,EAAE,IAAI,CAAC,CAAC;IAC1C,IAAI,CAAC,MAAM,CAAC,EAAE;QAAE,OAAO,MAAM,CAAC;IAE9B,MAAM,OAAO,GAAoB,EAAE,CAAC;IACpC,KAAK,MAAM,MAAM,IAAI,MAAM,CAAC,KAAK,CAAC,KAAK,CAAC,MAAM,CAAC,EAAE,CAAC;QAChD,MAAM,OAAO,GAAG,MAAM,CAAC,IAAI,EAAE,CAAC;QAC9B,IAAI,CAAC,OAAO;YAAE,SAAS;QACvB,MAAM,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,IAAI,EAAE,OAAO,CAAC,GAAG,OAAO,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;QACnE,IAAI,CAAC,IAAI;YAAE,SAAS;QACpB,OAAO,CAAC,IAAI,CAAC;YACX,IAAI;YACJ,MAAM,EAAE,MAAM,IAAI,EAAE;YACpB,KAAK,EAAE,KAAK,IAAI,EAAE;YAClB,IAAI,EAAE,IAAI,IAAI,EAAE;YAChB,OAAO,EAAE,OAAO,IAAI,EAAE;SACvB,CAAC,CAAC;IACL,CAAC;IACD,OAAO,EAAE,CAAC,OAAO,CAAC,CAAC;AACrB,CAAC"}
|
package/package.json
ADDED
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "daftari",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "An open-source, multi-user knowledge vault exposed to AI agents via an MCP server.",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"author": "Mihir Wagle / mavaali",
|
|
7
|
+
"type": "module",
|
|
8
|
+
"main": "./dist/index.js",
|
|
9
|
+
"bin": {
|
|
10
|
+
"daftari": "./dist/cli.js"
|
|
11
|
+
},
|
|
12
|
+
"repository": {
|
|
13
|
+
"type": "git",
|
|
14
|
+
"url": "git+https://github.com/mavaali/daftari.git"
|
|
15
|
+
},
|
|
16
|
+
"homepage": "https://github.com/mavaali/daftari#readme",
|
|
17
|
+
"bugs": {
|
|
18
|
+
"url": "https://github.com/mavaali/daftari/issues"
|
|
19
|
+
},
|
|
20
|
+
"engines": {
|
|
21
|
+
"node": ">=20"
|
|
22
|
+
},
|
|
23
|
+
"files": [
|
|
24
|
+
"dist",
|
|
25
|
+
"templates",
|
|
26
|
+
"README.md",
|
|
27
|
+
"LICENSE",
|
|
28
|
+
"CHANGELOG.md"
|
|
29
|
+
],
|
|
30
|
+
"scripts": {
|
|
31
|
+
"build": "tsc",
|
|
32
|
+
"test": "vitest run",
|
|
33
|
+
"dev": "tsx watch src/index.ts --vault ./test/fixtures/sample-vault",
|
|
34
|
+
"lint": "biome check src test",
|
|
35
|
+
"lint:fix": "biome check --write src test",
|
|
36
|
+
"format": "biome format --write src test",
|
|
37
|
+
"prepublishOnly": "npm run build",
|
|
38
|
+
"prepare": "husky"
|
|
39
|
+
},
|
|
40
|
+
"keywords": [
|
|
41
|
+
"mcp",
|
|
42
|
+
"knowledge-vault",
|
|
43
|
+
"markdown",
|
|
44
|
+
"agents"
|
|
45
|
+
],
|
|
46
|
+
"lint-staged": {
|
|
47
|
+
"src/**/*.{ts,tsx}": ["biome check --write --no-errors-on-unmatched"],
|
|
48
|
+
"test/**/*.{ts,tsx}": ["biome check --write --no-errors-on-unmatched"]
|
|
49
|
+
},
|
|
50
|
+
"dependencies": {
|
|
51
|
+
"@huggingface/transformers": "^4.2.0",
|
|
52
|
+
"@modelcontextprotocol/sdk": "^1.29.0",
|
|
53
|
+
"better-sqlite3": "^12.10.0",
|
|
54
|
+
"glob": "^13.0.6",
|
|
55
|
+
"gray-matter": "^4.0.3",
|
|
56
|
+
"js-yaml": "^4.1.1"
|
|
57
|
+
},
|
|
58
|
+
"devDependencies": {
|
|
59
|
+
"@biomejs/biome": "^2.4.15",
|
|
60
|
+
"@types/better-sqlite3": "^7.6.13",
|
|
61
|
+
"@types/js-yaml": "^4.0.9",
|
|
62
|
+
"@types/node": "^25.8.0",
|
|
63
|
+
"husky": "^9.1.7",
|
|
64
|
+
"lint-staged": "^16.4.0",
|
|
65
|
+
"tsx": "^4.22.1",
|
|
66
|
+
"typescript": "^6.0.3",
|
|
67
|
+
"vitest": "^4.1.6"
|
|
68
|
+
}
|
|
69
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
# .daftari/config.yaml — vault configuration template.
|
|
2
|
+
#
|
|
3
|
+
# Copied into a new vault's .daftari/ directory by `daftari --init`. RBAC is
|
|
4
|
+
# config-driven: roles and their per-collection permissions are declared here,
|
|
5
|
+
# and the server is started with --role <name> to select one.
|
|
6
|
+
#
|
|
7
|
+
# read — collections whose documents the role may read/search
|
|
8
|
+
# write — collections the role may create/append/deprecate documents in
|
|
9
|
+
# promote — whether the role may promote a draft to canonical (default false)
|
|
10
|
+
#
|
|
11
|
+
# "*" in a read or write list is a wildcard matching every collection. A role
|
|
12
|
+
# that is not started with --role, or a name not listed here, falls back to an
|
|
13
|
+
# implicit "guest" with no permissions — every tool is denied.
|
|
14
|
+
#
|
|
15
|
+
# The roles below are scoped to the collections `daftari --init` scaffolds
|
|
16
|
+
# (competitive-intel, pricing, moonshot, _drafts). Edit them to match your own
|
|
17
|
+
# collections — they are examples, not a fixed schema.
|
|
18
|
+
version: 1
|
|
19
|
+
vault_name: my-vault
|
|
20
|
+
|
|
21
|
+
roles:
|
|
22
|
+
analyst:
|
|
23
|
+
read: [competitive-intel, pricing]
|
|
24
|
+
write: [competitive-intel, _drafts]
|
|
25
|
+
researcher:
|
|
26
|
+
read: ["*"]
|
|
27
|
+
write: [moonshot, _drafts]
|
|
28
|
+
admin:
|
|
29
|
+
read: ["*"]
|
|
30
|
+
write: ["*"]
|
|
31
|
+
promote: true
|