okb 1.1.1__py3-none-any.whl → 1.1.2__py3-none-any.whl
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.
okb/http_server.py
CHANGED
|
@@ -43,6 +43,7 @@ READ_ONLY_TOOLS = frozenset(
|
|
|
43
43
|
"list_sources",
|
|
44
44
|
"list_projects",
|
|
45
45
|
"list_documents_by_project",
|
|
46
|
+
"get_project_stats",
|
|
46
47
|
"recent_documents",
|
|
47
48
|
"get_actionable_items",
|
|
48
49
|
"get_database_info",
|
|
@@ -71,6 +72,8 @@ WRITE_TOOLS = frozenset(
|
|
|
71
72
|
"approve_merge",
|
|
72
73
|
"reject_merge",
|
|
73
74
|
"run_consolidation",
|
|
75
|
+
"rename_project",
|
|
76
|
+
"set_document_project",
|
|
74
77
|
}
|
|
75
78
|
)
|
|
76
79
|
|
|
@@ -246,6 +249,65 @@ class HTTPMCPServer:
|
|
|
246
249
|
output.append(f" - `{d['source_path']}`")
|
|
247
250
|
return CallToolResult(content=[TextContent(type="text", text="\n".join(output))])
|
|
248
251
|
|
|
252
|
+
elif name == "get_project_stats":
|
|
253
|
+
stats = kb.get_project_stats()
|
|
254
|
+
if not stats:
|
|
255
|
+
return CallToolResult(
|
|
256
|
+
content=[TextContent(type="text", text="No projects found.")]
|
|
257
|
+
)
|
|
258
|
+
output = ["## Project Statistics\n"]
|
|
259
|
+
for p in stats:
|
|
260
|
+
output.append(f"- **{p['project']}**: {p['document_count']} documents")
|
|
261
|
+
return CallToolResult(content=[TextContent(type="text", text="\n".join(output))])
|
|
262
|
+
|
|
263
|
+
elif name == "rename_project":
|
|
264
|
+
old_name = arguments["old_name"]
|
|
265
|
+
new_name = arguments["new_name"]
|
|
266
|
+
if old_name == new_name:
|
|
267
|
+
return CallToolResult(
|
|
268
|
+
content=[TextContent(type="text", text="Old and new names are the same.")]
|
|
269
|
+
)
|
|
270
|
+
count = kb.rename_project(old_name, new_name)
|
|
271
|
+
if count == 0:
|
|
272
|
+
return CallToolResult(
|
|
273
|
+
content=[
|
|
274
|
+
TextContent(
|
|
275
|
+
type="text", text=f"No documents found with project '{old_name}'."
|
|
276
|
+
)
|
|
277
|
+
]
|
|
278
|
+
)
|
|
279
|
+
return CallToolResult(
|
|
280
|
+
content=[
|
|
281
|
+
TextContent(
|
|
282
|
+
type="text",
|
|
283
|
+
text=f"Renamed project '{old_name}' to '{new_name}' "
|
|
284
|
+
f"({count} documents updated).",
|
|
285
|
+
)
|
|
286
|
+
]
|
|
287
|
+
)
|
|
288
|
+
|
|
289
|
+
elif name == "set_document_project":
|
|
290
|
+
source_path = arguments["source_path"]
|
|
291
|
+
project = arguments.get("project")
|
|
292
|
+
success = kb.set_document_project(source_path, project)
|
|
293
|
+
if not success:
|
|
294
|
+
return CallToolResult(
|
|
295
|
+
content=[
|
|
296
|
+
TextContent(type="text", text=f"Document not found: {source_path}")
|
|
297
|
+
]
|
|
298
|
+
)
|
|
299
|
+
if project:
|
|
300
|
+
return CallToolResult(
|
|
301
|
+
content=[
|
|
302
|
+
TextContent(
|
|
303
|
+
type="text", text=f"Set project to '{project}' for {source_path}"
|
|
304
|
+
)
|
|
305
|
+
]
|
|
306
|
+
)
|
|
307
|
+
return CallToolResult(
|
|
308
|
+
content=[TextContent(type="text", text=f"Cleared project for {source_path}")]
|
|
309
|
+
)
|
|
310
|
+
|
|
249
311
|
elif name == "recent_documents":
|
|
250
312
|
from .mcp_server import format_relative_time, get_document_date
|
|
251
313
|
|
|
@@ -2,7 +2,7 @@ okb/__init__.py,sha256=2yaWIYQbho7N2O2zwTn3ZH11b8b3SaoDVlxluVTqwy4,92
|
|
|
2
2
|
okb/cli.py,sha256=8v_SaXFOrJYrCPSr6JgIqqzFHHYpPlHvan4CLaYUDTs,88639
|
|
3
3
|
okb/config.py,sha256=vKDC6b6Tm3_XZzvn7nA9WlGCWzCT8vtV9AvLes02YW8,28562
|
|
4
4
|
okb/data/init.sql,sha256=QpsicUN7PQ7d8zyOCRNChOu5XKdUVC3xySlRDPyKSN8,2728
|
|
5
|
-
okb/http_server.py,sha256=
|
|
5
|
+
okb/http_server.py,sha256=SEu9Kv6ITAmqf5tZujeqRd7u0KBhqs4IBPti9A-tmzQ,32825
|
|
6
6
|
okb/ingest.py,sha256=D5plxCC2tQXZenMNUa482dUDqsyuaq2APAQqaIgRAqU,54505
|
|
7
7
|
okb/llm/__init__.py,sha256=4jelqgXvF-eEPyLCuAmcxagN0H923wI9pBJJZKv4r0E,2368
|
|
8
8
|
okb/llm/analyze.py,sha256=BKW308AtjWStZcZiMKaRqFmQsuTclp3Qp3W4nsdw4vk,18569
|
|
@@ -43,7 +43,7 @@ okb/rescan.py,sha256=dVdQEkVUjsrtOKAGZc0LC2uwcnkjB8hn2SOVWHnY-R8,8396
|
|
|
43
43
|
okb/scripts/__init__.py,sha256=HPp8YCtIeo9XMOtOGCtntiwYr9eCxAJ1MF9Lo9WVzUA,53
|
|
44
44
|
okb/scripts/watch.py,sha256=b8oGPTN3flNdNQJETeqQ1RNZ8U1LiKvHntLwvHRIviA,6354
|
|
45
45
|
okb/tokens.py,sha256=3Of_PwNCTTexXC3d-EAiPjLdsbyk2F_dTeY30O3mqp8,8635
|
|
46
|
-
okb-1.1.
|
|
47
|
-
okb-1.1.
|
|
48
|
-
okb-1.1.
|
|
49
|
-
okb-1.1.
|
|
46
|
+
okb-1.1.2.dist-info/METADATA,sha256=f-D1XJaDnoxxqEj1n5wCBB53pzYukb5CEkV2cKeXxBA,14113
|
|
47
|
+
okb-1.1.2.dist-info/WHEEL,sha256=b4K_helf-jlQoXBBETfwnf4B04YC67LOev0jo4fX5m8,88
|
|
48
|
+
okb-1.1.2.dist-info/entry_points.txt,sha256=YX6b8BlV9sSAXrneoIm3dkXtRcgHhSzbDaOpJ0yCKRs,230
|
|
49
|
+
okb-1.1.2.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|