basic-memory 0.15.0__py3-none-any.whl → 0.15.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.
Potentially problematic release.
This version of basic-memory might be problematic. Click here for more details.
- basic_memory/__init__.py +1 -1
- basic_memory/api/routers/directory_router.py +23 -2
- basic_memory/api/routers/project_router.py +1 -0
- basic_memory/cli/auth.py +2 -2
- basic_memory/cli/commands/cloud/__init__.py +2 -1
- basic_memory/cli/commands/cloud/bisync_commands.py +4 -57
- basic_memory/cli/commands/cloud/cloud_utils.py +100 -0
- basic_memory/cli/commands/cloud/upload.py +128 -0
- basic_memory/cli/commands/cloud/upload_command.py +93 -0
- basic_memory/cli/commands/command_utils.py +11 -28
- basic_memory/cli/commands/mcp.py +72 -67
- basic_memory/cli/commands/project.py +140 -120
- basic_memory/cli/commands/status.py +6 -15
- basic_memory/config.py +55 -9
- basic_memory/deps.py +7 -5
- basic_memory/ignore_utils.py +7 -7
- basic_memory/mcp/async_client.py +102 -4
- basic_memory/mcp/prompts/continue_conversation.py +16 -15
- basic_memory/mcp/prompts/search.py +12 -11
- basic_memory/mcp/resources/ai_assistant_guide.md +185 -453
- basic_memory/mcp/resources/project_info.py +9 -7
- basic_memory/mcp/tools/build_context.py +40 -39
- basic_memory/mcp/tools/canvas.py +21 -20
- basic_memory/mcp/tools/chatgpt_tools.py +11 -2
- basic_memory/mcp/tools/delete_note.py +22 -21
- basic_memory/mcp/tools/edit_note.py +105 -104
- basic_memory/mcp/tools/list_directory.py +98 -95
- basic_memory/mcp/tools/move_note.py +127 -125
- basic_memory/mcp/tools/project_management.py +101 -98
- basic_memory/mcp/tools/read_content.py +64 -63
- basic_memory/mcp/tools/read_note.py +88 -88
- basic_memory/mcp/tools/recent_activity.py +139 -135
- basic_memory/mcp/tools/search.py +27 -26
- basic_memory/mcp/tools/sync_status.py +133 -128
- basic_memory/mcp/tools/utils.py +0 -15
- basic_memory/mcp/tools/view_note.py +14 -28
- basic_memory/mcp/tools/write_note.py +97 -87
- basic_memory/repository/entity_repository.py +60 -0
- basic_memory/repository/repository.py +16 -3
- basic_memory/repository/search_repository.py +42 -0
- basic_memory/schemas/cloud.py +7 -3
- basic_memory/schemas/project_info.py +1 -1
- basic_memory/services/directory_service.py +124 -3
- basic_memory/services/entity_service.py +31 -9
- basic_memory/services/project_service.py +97 -10
- basic_memory/services/search_service.py +16 -8
- basic_memory/sync/sync_service.py +28 -13
- {basic_memory-0.15.0.dist-info → basic_memory-0.15.2.dist-info}/METADATA +51 -4
- {basic_memory-0.15.0.dist-info → basic_memory-0.15.2.dist-info}/RECORD +52 -50
- basic_memory/mcp/tools/headers.py +0 -44
- {basic_memory-0.15.0.dist-info → basic_memory-0.15.2.dist-info}/WHEEL +0 -0
- {basic_memory-0.15.0.dist-info → basic_memory-0.15.2.dist-info}/entry_points.txt +0 -0
- {basic_memory-0.15.0.dist-info → basic_memory-0.15.2.dist-info}/licenses/LICENSE +0 -0
|
@@ -10,6 +10,7 @@ from pathlib import Path
|
|
|
10
10
|
from typing import Dict, Optional, Set, Tuple
|
|
11
11
|
|
|
12
12
|
from loguru import logger
|
|
13
|
+
from sqlalchemy import select
|
|
13
14
|
from sqlalchemy.exc import IntegrityError
|
|
14
15
|
|
|
15
16
|
from basic_memory import db
|
|
@@ -274,15 +275,25 @@ class SyncService:
|
|
|
274
275
|
|
|
275
276
|
async def get_db_file_state(self) -> Dict[str, str]:
|
|
276
277
|
"""Get file_path and checksums from database.
|
|
277
|
-
|
|
278
|
-
|
|
278
|
+
|
|
279
|
+
Optimized to query only the columns we need (file_path, checksum) without
|
|
280
|
+
loading full entities or their relationships. This is 10-100x faster for
|
|
281
|
+
large projects compared to loading all entities with observations/relations.
|
|
282
|
+
|
|
279
283
|
Returns:
|
|
280
|
-
Dict mapping file paths to
|
|
281
|
-
:param db_records: the data from the db
|
|
284
|
+
Dict mapping file paths to checksums
|
|
282
285
|
"""
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
+
# Query only the columns we need - no entity objects or relationships
|
|
287
|
+
query = select(Entity.file_path, Entity.checksum).where(
|
|
288
|
+
Entity.project_id == self.entity_repository.project_id
|
|
289
|
+
)
|
|
290
|
+
|
|
291
|
+
async with db.scoped_session(self.entity_repository.session_maker) as session:
|
|
292
|
+
result = await session.execute(query)
|
|
293
|
+
rows = result.all()
|
|
294
|
+
|
|
295
|
+
logger.info(f"Found {len(rows)} db file records")
|
|
296
|
+
return {row.file_path: row.checksum or "" for row in rows}
|
|
286
297
|
|
|
287
298
|
async def sync_file(
|
|
288
299
|
self, path: str, new: bool = True
|
|
@@ -340,8 +351,10 @@ class SyncService:
|
|
|
340
351
|
|
|
341
352
|
# if the file contains frontmatter, resolve a permalink (unless disabled)
|
|
342
353
|
if file_contains_frontmatter and not self.app_config.disable_permalinks:
|
|
343
|
-
# Resolve permalink -
|
|
344
|
-
permalink = await self.entity_service.resolve_permalink(
|
|
354
|
+
# Resolve permalink - skip conflict checks during bulk sync for performance
|
|
355
|
+
permalink = await self.entity_service.resolve_permalink(
|
|
356
|
+
path, markdown=entity_markdown, skip_conflict_check=True
|
|
357
|
+
)
|
|
345
358
|
|
|
346
359
|
# If permalink changed, update the file
|
|
347
360
|
if permalink != entity_markdown.frontmatter.permalink:
|
|
@@ -395,8 +408,8 @@ class SyncService:
|
|
|
395
408
|
"""
|
|
396
409
|
checksum = await self._compute_checksum_async(path)
|
|
397
410
|
if new:
|
|
398
|
-
# Generate permalink from path
|
|
399
|
-
await self.entity_service.resolve_permalink(path)
|
|
411
|
+
# Generate permalink from path - skip conflict checks during bulk sync
|
|
412
|
+
await self.entity_service.resolve_permalink(path, skip_conflict_check=True)
|
|
400
413
|
|
|
401
414
|
# get file timestamps
|
|
402
415
|
file_stats = self.file_service.file_stats(path)
|
|
@@ -535,8 +548,10 @@ class SyncService:
|
|
|
535
548
|
and not self.app_config.disable_permalinks
|
|
536
549
|
and self.file_service.is_markdown(new_path)
|
|
537
550
|
):
|
|
538
|
-
# generate new permalink value
|
|
539
|
-
new_permalink = await self.entity_service.resolve_permalink(
|
|
551
|
+
# generate new permalink value - skip conflict checks during bulk sync
|
|
552
|
+
new_permalink = await self.entity_service.resolve_permalink(
|
|
553
|
+
new_path, skip_conflict_check=True
|
|
554
|
+
)
|
|
540
555
|
|
|
541
556
|
# write to file and get new checksum
|
|
542
557
|
new_checksum = await self.file_service.update_frontmatter(
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: basic-memory
|
|
3
|
-
Version: 0.15.
|
|
3
|
+
Version: 0.15.2
|
|
4
4
|
Summary: Local-first knowledge management combining Zettelkasten with knowledge graphs
|
|
5
5
|
Project-URL: Homepage, https://github.com/basicmachines-co/basic-memory
|
|
6
6
|
Project-URL: Repository, https://github.com/basicmachines-co/basic-memory
|
|
@@ -8,7 +8,7 @@ Project-URL: Documentation, https://github.com/basicmachines-co/basic-memory#rea
|
|
|
8
8
|
Author-email: Basic Machines <hello@basic-machines.co>
|
|
9
9
|
License: AGPL-3.0-or-later
|
|
10
10
|
License-File: LICENSE
|
|
11
|
-
Requires-Python: >=3.12
|
|
11
|
+
Requires-Python: >=3.12
|
|
12
12
|
Requires-Dist: aiofiles>=24.1.0
|
|
13
13
|
Requires-Dist: aiosqlite>=0.20.0
|
|
14
14
|
Requires-Dist: alembic>=1.14.1
|
|
@@ -139,6 +139,9 @@ With Basic Memory, you can:
|
|
|
139
139
|
- Keep everything local and under your control
|
|
140
140
|
- Use familiar tools like Obsidian to view and edit notes
|
|
141
141
|
- Build a personal knowledge base that grows over time
|
|
142
|
+
- Sync your knowledge to the cloud with bidirectional synchronization
|
|
143
|
+
- Authenticate and manage cloud projects with subscription validation
|
|
144
|
+
- Mount cloud storage for direct file access
|
|
142
145
|
|
|
143
146
|
## How It Works in Practice
|
|
144
147
|
|
|
@@ -385,14 +388,57 @@ basic-memory sync
|
|
|
385
388
|
basic-memory sync --watch
|
|
386
389
|
```
|
|
387
390
|
|
|
388
|
-
3.
|
|
391
|
+
3. Cloud features (optional, requires subscription):
|
|
389
392
|
|
|
393
|
+
```bash
|
|
394
|
+
# Authenticate with cloud
|
|
395
|
+
basic-memory cloud login
|
|
396
|
+
|
|
397
|
+
# Bidirectional sync with cloud
|
|
398
|
+
basic-memory cloud sync
|
|
399
|
+
|
|
400
|
+
# Verify cloud integrity
|
|
401
|
+
basic-memory cloud check
|
|
402
|
+
|
|
403
|
+
# Mount cloud storage
|
|
404
|
+
basic-memory cloud mount
|
|
405
|
+
```
|
|
406
|
+
|
|
407
|
+
4. In Claude Desktop, the LLM can now use these tools:
|
|
408
|
+
|
|
409
|
+
**Content Management:**
|
|
390
410
|
```
|
|
391
411
|
write_note(title, content, folder, tags) - Create or update notes
|
|
392
412
|
read_note(identifier, page, page_size) - Read notes by title or permalink
|
|
413
|
+
read_content(path) - Read raw file content (text, images, binaries)
|
|
414
|
+
view_note(identifier) - View notes as formatted artifacts
|
|
415
|
+
edit_note(identifier, operation, content) - Edit notes incrementally
|
|
416
|
+
move_note(identifier, destination_path) - Move notes with database consistency
|
|
417
|
+
delete_note(identifier) - Delete notes from knowledge base
|
|
418
|
+
```
|
|
419
|
+
|
|
420
|
+
**Knowledge Graph Navigation:**
|
|
421
|
+
```
|
|
393
422
|
build_context(url, depth, timeframe) - Navigate knowledge graph via memory:// URLs
|
|
394
|
-
search(query, page, page_size) - Search across your knowledge base
|
|
395
423
|
recent_activity(type, depth, timeframe) - Find recently updated information
|
|
424
|
+
list_directory(dir_name, depth) - Browse directory contents with filtering
|
|
425
|
+
```
|
|
426
|
+
|
|
427
|
+
**Search & Discovery:**
|
|
428
|
+
```
|
|
429
|
+
search(query, page, page_size) - Search across your knowledge base
|
|
430
|
+
```
|
|
431
|
+
|
|
432
|
+
**Project Management:**
|
|
433
|
+
```
|
|
434
|
+
list_memory_projects() - List all available projects
|
|
435
|
+
create_memory_project(project_name, project_path) - Create new projects
|
|
436
|
+
get_current_project() - Show current project stats
|
|
437
|
+
sync_status() - Check synchronization status
|
|
438
|
+
```
|
|
439
|
+
|
|
440
|
+
**Visualization:**
|
|
441
|
+
```
|
|
396
442
|
canvas(nodes, edges, title, folder) - Generate knowledge visualizations
|
|
397
443
|
```
|
|
398
444
|
|
|
@@ -412,6 +458,7 @@ See the [Documentation](https://memory.basicmachines.co/) for more info, includi
|
|
|
412
458
|
|
|
413
459
|
- [Complete User Guide](https://docs.basicmemory.com/user-guide/)
|
|
414
460
|
- [CLI tools](https://docs.basicmemory.com/guides/cli-reference/)
|
|
461
|
+
- [Cloud CLI and Sync](https://docs.basicmemory.com/guides/cloud-cli/)
|
|
415
462
|
- [Managing multiple Projects](https://docs.basicmemory.com/guides/cli-reference/#project)
|
|
416
463
|
- [Importing data from OpenAI/Claude Projects](https://docs.basicmemory.com/guides/cli-reference/#import)
|
|
417
464
|
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
basic_memory/__init__.py,sha256=
|
|
2
|
-
basic_memory/config.py,sha256=
|
|
1
|
+
basic_memory/__init__.py,sha256=CsY6W4VzF1LT42OnWaL4Ycc5BYKhSBn8LzNbjgLAuPY,256
|
|
2
|
+
basic_memory/config.py,sha256=bHpnPTTYxPR_dtT1j9mE4y5ucmsow4hn4MplES446bI,17446
|
|
3
3
|
basic_memory/db.py,sha256=Gc-d639GPVzUhNkzkfvOYYuEGeIX9YFqhu6kG_5tR1A,11711
|
|
4
|
-
basic_memory/deps.py,sha256=
|
|
4
|
+
basic_memory/deps.py,sha256=VpDqUsFHt6TIE4aR4U5jiq6R9sP0bZJGFMYEluuO7ac,13051
|
|
5
5
|
basic_memory/file_utils.py,sha256=5YUlj4qk9SqKmEDwcBeW08XyLW5y2b7bpUHX5xARLLc,9145
|
|
6
|
-
basic_memory/ignore_utils.py,sha256=
|
|
6
|
+
basic_memory/ignore_utils.py,sha256=o7cOfXHWerY-e05ZokHqKc5oujsHp4qhNQkX96xS3TY,7561
|
|
7
7
|
basic_memory/utils.py,sha256=NDlLbOme6_XzvaiorhWP0Q-HCzg038jDvfyCrTOKXTI,12875
|
|
8
8
|
basic_memory/alembic/alembic.ini,sha256=IEZsnF8CbbZnkwBr67LzKKNobHuzTaQNUvM8Psop5xc,3733
|
|
9
9
|
basic_memory/alembic/env.py,sha256=4kHZh-rfzVARy9ndvsuDPTBt6Hk3dZ2BwI030EppBrA,2838
|
|
@@ -20,39 +20,42 @@ basic_memory/api/__init__.py,sha256=wCpj-21j1D0KzKl9Ql6unLBVFY0K1uGp_FeSZRKtqpk,
|
|
|
20
20
|
basic_memory/api/app.py,sha256=2qNUMFutFJtIU32i167br83bvCLgPkGUQD0xaf3Cx2I,3194
|
|
21
21
|
basic_memory/api/template_loader.py,sha256=exbTeXyJRgyLFmSjNeroxjT7X2DWFm2X5qUVa3drbYM,8607
|
|
22
22
|
basic_memory/api/routers/__init__.py,sha256=REO5CKQ96o5vtGWACcsIxIpWybIUSeKXc83RWbWc8BQ,398
|
|
23
|
-
basic_memory/api/routers/directory_router.py,sha256=
|
|
23
|
+
basic_memory/api/routers/directory_router.py,sha256=eKl9P6uYZnmA4J58ZPydbLkDPtiYH_84LcVFclkL364,2832
|
|
24
24
|
basic_memory/api/routers/importer_router.py,sha256=xFUCorkPWo8AF0ya0UrcLmXNf8CjPZdAqddQIH8PO-o,4513
|
|
25
25
|
basic_memory/api/routers/knowledge_router.py,sha256=A7IYVk4_ab0NbrEs7ZWC2KBApY-VsEO1X5X8UImjG7s,10284
|
|
26
26
|
basic_memory/api/routers/management_router.py,sha256=zbzilNzsYUbFbE2uFXRM33cDn9IbI-73y8C1-b-19O4,2730
|
|
27
27
|
basic_memory/api/routers/memory_router.py,sha256=a9Cnx3XgwSkO-2ABFzI3wM3PoMGxuyfJFFp7NfFZapc,3003
|
|
28
|
-
basic_memory/api/routers/project_router.py,sha256=
|
|
28
|
+
basic_memory/api/routers/project_router.py,sha256=ikgH1rtzXlHQ5Y1S0lMuN45TMT6laCJhLVoCA2jE5qE,11618
|
|
29
29
|
basic_memory/api/routers/prompt_router.py,sha256=4wxq6-NREgVJM8N9C0YsN1AAUDD8nkTCOzWyzSqTSFw,9948
|
|
30
30
|
basic_memory/api/routers/resource_router.py,sha256=Uko0RLea8DTXl0hPyGjay_YNyYE5852VrBXhlWs8YGc,8097
|
|
31
31
|
basic_memory/api/routers/search_router.py,sha256=GD62jlCQTiL_VNsdibi-b1f6H40KCWo9SX2Cl7YH4QU,1226
|
|
32
32
|
basic_memory/api/routers/utils.py,sha256=nmD1faJOHcnWQjbCanojUwA9xhinf764U8SUqjNXpXw,5159
|
|
33
33
|
basic_memory/cli/__init__.py,sha256=arcKLAWRDhPD7x5t80MlviZeYzwHZ0GZigyy3NKVoGk,33
|
|
34
34
|
basic_memory/cli/app.py,sha256=dMLoiCDJId2ic32Z7F4EiDPTYjb5j8jEwXwurn755_A,1392
|
|
35
|
-
basic_memory/cli/auth.py,sha256=
|
|
35
|
+
basic_memory/cli/auth.py,sha256=VG9VgHjcXXfMRcJJxif40XhTB1PX2ECD1xEvWqQUWMI,10595
|
|
36
36
|
basic_memory/cli/main.py,sha256=h3oGzJn1wEqY0_nPzb1pDKkBzTPRDgjW4YOOmxHn0hU,476
|
|
37
37
|
basic_memory/cli/commands/__init__.py,sha256=3oojcC-Y-4RPqff9vtwWziT_T4uvBVicL0pSHNilVkU,393
|
|
38
|
-
basic_memory/cli/commands/command_utils.py,sha256=
|
|
38
|
+
basic_memory/cli/commands/command_utils.py,sha256=e5j3mkBl75q25zpnStYFY6hfEQ8f4EPvP82VyvHING0,1480
|
|
39
39
|
basic_memory/cli/commands/db.py,sha256=cEoQltgKudEuJH0Cn-YiPpNaDQzu5-YVwCD0anIIKOA,1480
|
|
40
40
|
basic_memory/cli/commands/import_chatgpt.py,sha256=iVfMo6yrY1EzViSlGL3BnZVkh-k9ht0bbCMJ6dWFCuU,2856
|
|
41
41
|
basic_memory/cli/commands/import_claude_conversations.py,sha256=e8l4OHMr8A9PtKgOO6T9-86Jca6FzCrJAsOzo-EQrlc,2946
|
|
42
42
|
basic_memory/cli/commands/import_claude_projects.py,sha256=YyFXcHWAHJmtR6DNwTtao8nKECoFyo8GripRElqMQ7w,2891
|
|
43
43
|
basic_memory/cli/commands/import_memory_json.py,sha256=3ESHFGdrVQmlh93GYm-AzhKKnDx5cK375ea9EjiKWQw,2867
|
|
44
|
-
basic_memory/cli/commands/mcp.py,sha256=
|
|
45
|
-
basic_memory/cli/commands/project.py,sha256=
|
|
46
|
-
basic_memory/cli/commands/status.py,sha256=
|
|
44
|
+
basic_memory/cli/commands/mcp.py,sha256=KNyeut5vjXvBjBncZs078YwJTDWb5-CjYpx0bzA4Kjs,3462
|
|
45
|
+
basic_memory/cli/commands/project.py,sha256=KCNgZrN_0Hm8dsnsVX4wo4UTE988VGAESxQ8p9c9J30,13815
|
|
46
|
+
basic_memory/cli/commands/status.py,sha256=KHrBD6cPFckbmqoadlnFACHao524ZF_v_TzYC_yRPgQ,5872
|
|
47
47
|
basic_memory/cli/commands/sync.py,sha256=OckRY5JWJ2ZCi4-75DuEF-uWMSJX_1FmSRp27AkYtI4,1782
|
|
48
48
|
basic_memory/cli/commands/tool.py,sha256=8bsbYfaYEfAEvLfciQx1fZ0vssgbahMvrbmWzYg9188,11971
|
|
49
|
-
basic_memory/cli/commands/cloud/__init__.py,sha256=
|
|
49
|
+
basic_memory/cli/commands/cloud/__init__.py,sha256=WYDh_GRqKMqhQI21maV2RD1QsDdkgzvRrV9XWa0MJf4,353
|
|
50
50
|
basic_memory/cli/commands/cloud/api_client.py,sha256=e14v_YTkkEuyUuZBzaQTSHpNmT017A3ym5dWMEly5JQ,4263
|
|
51
|
-
basic_memory/cli/commands/cloud/bisync_commands.py,sha256=
|
|
51
|
+
basic_memory/cli/commands/cloud/bisync_commands.py,sha256=8RlClVWpNaXXj170AkF4hAEKSVdZOpol1CG1NT1yRvw,26914
|
|
52
|
+
basic_memory/cli/commands/cloud/cloud_utils.py,sha256=Q3B2UG1el4JSTa89ruFLquZqLJBPfmxQbmXZXQUQ3O0,2977
|
|
52
53
|
basic_memory/cli/commands/cloud/core_commands.py,sha256=OVSVTC9f2_Smp3oNUUCErs3terFZdJIc-GXRvcfK68Q,9694
|
|
53
54
|
basic_memory/cli/commands/cloud/mount_commands.py,sha256=2CZPza3rPiECI5dOLowq3SEzmRQTFdUjopn_W_QQU9Y,10430
|
|
54
55
|
basic_memory/cli/commands/cloud/rclone_config.py,sha256=LpI3_PBKT5qYPG2tV3L9erl4WQQedm97g4x8PC20BP0,8155
|
|
55
56
|
basic_memory/cli/commands/cloud/rclone_installer.py,sha256=x62TjzwDUSwWTy7NVjdwtu9SKO7N5NVls_tfqp2_DDw,7399
|
|
57
|
+
basic_memory/cli/commands/cloud/upload.py,sha256=EPI6aFh3x4XFSE6wKcP-bD2SlXxh0lHYrRVXM7LC5M0,4064
|
|
58
|
+
basic_memory/cli/commands/cloud/upload_command.py,sha256=OsERVwVctgdkFi7ci3C5PWXDwGPqNXOdBtFfElJx6-o,3011
|
|
56
59
|
basic_memory/importers/__init__.py,sha256=BTcBW97P3thcsWa5w9tQsvOu8ynHDgw2-8tPgkCZoh8,795
|
|
57
60
|
basic_memory/importers/base.py,sha256=awwe_U-CfzSINKoM6iro7ru4QqLlsfXzdHztDvebnxM,2531
|
|
58
61
|
basic_memory/importers/chatgpt_importer.py,sha256=3BJZUOVSX0cg9G6WdMTDQTscMoG6eWuf6E-c9Qhi0v4,7687
|
|
@@ -67,56 +70,55 @@ basic_memory/markdown/plugins.py,sha256=3z5U6yX7UuzEJAq5jzT5LmhmJ-tF3CJThwfwDwCE
|
|
|
67
70
|
basic_memory/markdown/schemas.py,sha256=eyxYCr1hVyWmImcle0asE5It_DD6ARkqaBZYu1KK5n4,1896
|
|
68
71
|
basic_memory/markdown/utils.py,sha256=cm3h3C1eFz-zklXx5xaNRE-EBv8d-S5tixbTa5WqubQ,3416
|
|
69
72
|
basic_memory/mcp/__init__.py,sha256=dsDOhKqjYeIbCULbHIxfcItTbqudEuEg1Np86eq0GEQ,35
|
|
70
|
-
basic_memory/mcp/async_client.py,sha256=
|
|
73
|
+
basic_memory/mcp/async_client.py,sha256=oHR-cscOQAh9914Pjf_annICzauaRHfK0POd0hzEJUg,5170
|
|
71
74
|
basic_memory/mcp/project_context.py,sha256=29ZwMriGcLfE8E0hNyWn9GpnzOsKG7TbP8FSq8UGEDY,4930
|
|
72
75
|
basic_memory/mcp/server.py,sha256=vICzbGc36u59Z5P2RjXhL2OxJxOVKC8gU4OqWeCwsq8,109
|
|
73
76
|
basic_memory/mcp/prompts/__init__.py,sha256=-Bl9Dgj2TD9PULjzggPqXuvPEjWCRy7S9Yg03h2-U7A,615
|
|
74
77
|
basic_memory/mcp/prompts/ai_assistant_guide.py,sha256=NLdtkb9EahAzKLT8kT4CMQezxDgd3fUc2WB6dIixQUg,2558
|
|
75
|
-
basic_memory/mcp/prompts/continue_conversation.py,sha256=
|
|
78
|
+
basic_memory/mcp/prompts/continue_conversation.py,sha256=L-f_hKIBWnILzmYuQii948EdXyDSYh1qWVQAbJQU3l8,2097
|
|
76
79
|
basic_memory/mcp/prompts/recent_activity.py,sha256=h9hT7CdMNpPIqwptlY8N64trPkpCCeMTX4Wfr8C5WAE,6466
|
|
77
|
-
basic_memory/mcp/prompts/search.py,sha256=
|
|
80
|
+
basic_memory/mcp/prompts/search.py,sha256=QCX8fOI-BBxHSzPBvvVq6jZPklPO1jHG0560LVkks98,1775
|
|
78
81
|
basic_memory/mcp/prompts/utils.py,sha256=k7UUwbEgtE75jZftq3DT0PpZL2Un5dwPT8L3Vxl_GIw,5733
|
|
79
|
-
basic_memory/mcp/resources/ai_assistant_guide.md,sha256=
|
|
80
|
-
basic_memory/mcp/resources/project_info.py,sha256=
|
|
82
|
+
basic_memory/mcp/resources/ai_assistant_guide.md,sha256=u3vjEgCQvVTbOqEGx6lnu-KJDBDgx22SimCy4h0KxFg,7286
|
|
83
|
+
basic_memory/mcp/resources/project_info.py,sha256=68Z00eE4bxBK6PB3uf4abQXaMIcBPIONuHfF3VsEtLA,2553
|
|
81
84
|
basic_memory/mcp/tools/__init__.py,sha256=EU905pci4cHHfSmWeTmqcyKmtXGByAnm-HW0MND1IT4,1591
|
|
82
|
-
basic_memory/mcp/tools/build_context.py,sha256=
|
|
83
|
-
basic_memory/mcp/tools/canvas.py,sha256=
|
|
84
|
-
basic_memory/mcp/tools/chatgpt_tools.py,sha256=
|
|
85
|
-
basic_memory/mcp/tools/delete_note.py,sha256=
|
|
86
|
-
basic_memory/mcp/tools/edit_note.py,sha256=
|
|
87
|
-
basic_memory/mcp/tools/
|
|
88
|
-
basic_memory/mcp/tools/
|
|
89
|
-
basic_memory/mcp/tools/
|
|
90
|
-
basic_memory/mcp/tools/
|
|
91
|
-
basic_memory/mcp/tools/
|
|
92
|
-
basic_memory/mcp/tools/
|
|
93
|
-
basic_memory/mcp/tools/
|
|
94
|
-
basic_memory/mcp/tools/
|
|
95
|
-
basic_memory/mcp/tools/
|
|
96
|
-
basic_memory/mcp/tools/
|
|
97
|
-
basic_memory/mcp/tools/
|
|
98
|
-
basic_memory/mcp/tools/write_note.py,sha256=6jYdrr2YlY4jq6ksJW1FftQ3DoGjgyLCYAKA1zWf_bk,8505
|
|
85
|
+
basic_memory/mcp/tools/build_context.py,sha256=NapOVwaPxtqsgJKt-80A7trVonrJi7_vLcyH-uTB2T4,5641
|
|
86
|
+
basic_memory/mcp/tools/canvas.py,sha256=uz1ccdPlG5evntDG5o3pS3aTX2g4LKlXnGhihIMBNHo,4406
|
|
87
|
+
basic_memory/mcp/tools/chatgpt_tools.py,sha256=CyCpvGi5QFc1C5lccPAATBpcr6JU2LQcnIUTb3NEzvw,6903
|
|
88
|
+
basic_memory/mcp/tools/delete_note.py,sha256=ZrQVFDJTtU4TYe_4AipAo8-Vra6ScMSpQQ_zN_Nf2yk,9223
|
|
89
|
+
basic_memory/mcp/tools/edit_note.py,sha256=pOB7pLrBxp_kpBaAFeW3ibKljFDg4VCYj13Jbi1kO54,15533
|
|
90
|
+
basic_memory/mcp/tools/list_directory.py,sha256=1glwoRPT9C5qrgxLXarO3RIaMFNMBmOPQz1HXS3QFUk,5954
|
|
91
|
+
basic_memory/mcp/tools/move_note.py,sha256=Ea8W-Gs9qp7dA2l2_UhWVjjn8Yek71ZRhOebxVay7vU,21702
|
|
92
|
+
basic_memory/mcp/tools/project_management.py,sha256=QBG25b-wqjCKRurYIQimHiZpgWotzmStEe5nRcxrUU4,8082
|
|
93
|
+
basic_memory/mcp/tools/read_content.py,sha256=nT4sfRKZEFY5Sien-hTCMKoQaJlV2eTT3L9Oq1HH1hU,10012
|
|
94
|
+
basic_memory/mcp/tools/read_note.py,sha256=uWAeuQvQGAmoiSWorDJ7FEioOFVaiC7teYfEoy6pxOQ,9994
|
|
95
|
+
basic_memory/mcp/tools/recent_activity.py,sha256=4ycPEEaNQlognylT7lRNQzLrpwEnzYh2ITZeFCfRW4I,21256
|
|
96
|
+
basic_memory/mcp/tools/search.py,sha256=uUtCSYnhHU5jDlYNjRMQisD8DMlGcjJPWqXZRjmXJcM,16874
|
|
97
|
+
basic_memory/mcp/tools/sync_status.py,sha256=qGYGoK01yKRLsrZnQtqTMRZDm8R_IVLFhZm4hIE5qiQ,11190
|
|
98
|
+
basic_memory/mcp/tools/utils.py,sha256=S1YzuxLK3lsd6TTebxRQnuLpKY2IwTy6V-CVGZbNNEA,20896
|
|
99
|
+
basic_memory/mcp/tools/view_note.py,sha256=4SKwbF18wuLVvZ5g4rNhVTBjbwZ86QSNBEAlN13svqc,2442
|
|
100
|
+
basic_memory/mcp/tools/write_note.py,sha256=mk1VSk1BxnqoPn1tvSnaMsjQcXXiVary6RcQMohlOuQ,9130
|
|
99
101
|
basic_memory/models/__init__.py,sha256=j0C4dtFi-FOEaQKR8dQWEG-dJtdQ15NBTiJg4nbIXNU,333
|
|
100
102
|
basic_memory/models/base.py,sha256=4hAXJ8CE1RnjKhb23lPd-QM7G_FXIdTowMJ9bRixspU,225
|
|
101
103
|
basic_memory/models/knowledge.py,sha256=MaGpxluOWjsu7ZRZfp8HyUorpMuqejN5qzeMzf-gU1k,7727
|
|
102
104
|
basic_memory/models/project.py,sha256=yZ6QsX4YeISf_wetCqvJcr9ei5XpyRXPtmkxouRj0lo,2869
|
|
103
105
|
basic_memory/models/search.py,sha256=PhQ8w4taApSvjh1DpPhB4cH9GTt2E2po-DFZzhnoZkY,1300
|
|
104
106
|
basic_memory/repository/__init__.py,sha256=MWK-o8QikqzOpe5SyPbKQ2ioB5BWA0Upz65tgg-E0DU,327
|
|
105
|
-
basic_memory/repository/entity_repository.py,sha256=
|
|
107
|
+
basic_memory/repository/entity_repository.py,sha256=iJwunsG7o4JsBtnAXtHTwFeHkz5CtRoD-PQEaOzTe-Q,10622
|
|
106
108
|
basic_memory/repository/observation_repository.py,sha256=qhMvHLSjaoT3Fa_cQOKsT5jYPj66GXSytEBMwLAgygQ,2943
|
|
107
109
|
basic_memory/repository/project_info_repository.py,sha256=8XLVAYKkBWQ6GbKj1iqA9OK0FGPHdTlOs7ZtfeUf9t8,338
|
|
108
110
|
basic_memory/repository/project_repository.py,sha256=Fvo_pCylz8okFiv3FD3nv6PNQknLuC7f3S11fJNQkic,3795
|
|
109
111
|
basic_memory/repository/relation_repository.py,sha256=tpgyg5MTXAkdDgNpLYnHFQsYeiVSyfk3lasniw3DuRc,3718
|
|
110
|
-
basic_memory/repository/repository.py,sha256=
|
|
111
|
-
basic_memory/repository/search_repository.py,sha256=
|
|
112
|
+
basic_memory/repository/repository.py,sha256=GUKlgBOFvMeFBkmqh80MNyC2YKQdMdPQjlT_vAYlvwo,15638
|
|
113
|
+
basic_memory/repository/search_repository.py,sha256=bs9FXekHY_AYDOzA7L6ZCzf1EtHi1Q3k8HjjCbBXl8E,23989
|
|
112
114
|
basic_memory/schemas/__init__.py,sha256=6bZUVwc-Bvd6yKdNigUslYS3jFYgIQ9eqT-eujtEXY4,1785
|
|
113
115
|
basic_memory/schemas/base.py,sha256=t7F7f40EeQEQVJswMdoQJDd2Uh8LUgLHXVFIP6ugx8U,9551
|
|
114
|
-
basic_memory/schemas/cloud.py,sha256=
|
|
116
|
+
basic_memory/schemas/cloud.py,sha256=4cxS5-Lo0teASdP5q9N6dYlR5TdCpO2_5h2zdB84nu8,1847
|
|
115
117
|
basic_memory/schemas/delete.py,sha256=UAR2JK99WMj3gP-yoGWlHD3eZEkvlTSRf8QoYIE-Wfw,1180
|
|
116
118
|
basic_memory/schemas/directory.py,sha256=F9_LrJqRqb_kO08GDKJzXLb2nhbYG2PdVUo5eDD_Kf4,881
|
|
117
119
|
basic_memory/schemas/importer.py,sha256=rDPfQjyjKyjOe26pwp1UH4eDqGwMKfeNs1Fjv5PxOc0,693
|
|
118
120
|
basic_memory/schemas/memory.py,sha256=LMAb4HfAAvosy9GrYzBM_lnviWHSS4Lez67zhgT9bf4,8894
|
|
119
|
-
basic_memory/schemas/project_info.py,sha256=
|
|
121
|
+
basic_memory/schemas/project_info.py,sha256=1D9Q0QyWdizw44vk_eQX1UUAcBCiLjbfM-R_BYAads4,6832
|
|
120
122
|
basic_memory/schemas/prompt.py,sha256=SpIVfZprQT8E5uP40j3CpBc2nHKflwOo3iZD7BFPIHE,3648
|
|
121
123
|
basic_memory/schemas/request.py,sha256=Mv5EvrLZlFIiPr8dOjo_4QXvkseYhQI7cd_X2zDsxQM,3760
|
|
122
124
|
basic_memory/schemas/response.py,sha256=XupGYKKr5I2D7Qg9HCSD_c-0A-C1BPA8FNIvHK6Gars,6450
|
|
@@ -124,24 +126,24 @@ basic_memory/schemas/search.py,sha256=ywMsDGAQK2sO2TT5lc-da_k67OKW1x1TenXormHHWv
|
|
|
124
126
|
basic_memory/schemas/sync_report.py,sha256=JfxSr44Zxhp_R3cOfIc4G0Wj6hl2SPlIUwiYFLFK2sY,1600
|
|
125
127
|
basic_memory/services/__init__.py,sha256=XGt8WX3fX_0K9L37Msy8HF8nlMZYIG3uQ6mUX6_iJtg,259
|
|
126
128
|
basic_memory/services/context_service.py,sha256=73meCXDdDvW7LXlnTvQG_rU-Yp-ogAZoPgyw0WEX2Yw,15742
|
|
127
|
-
basic_memory/services/directory_service.py,sha256=
|
|
128
|
-
basic_memory/services/entity_service.py,sha256=
|
|
129
|
+
basic_memory/services/directory_service.py,sha256=VCVPYN8WVMIlh6o-Qsutb7eZsM7eI0-j9ABtVUjvEgo,11216
|
|
130
|
+
basic_memory/services/entity_service.py,sha256=j-aFJxO_PbUKhiHf7nUK1ClKE7dA5oURlgQ85Z9pH90,34750
|
|
129
131
|
basic_memory/services/exceptions.py,sha256=oVjQr50XQqnFq1-MNKBilI2ShtHDxypavyDk1UeyHhw,390
|
|
130
132
|
basic_memory/services/file_service.py,sha256=jCrmnEkTQ4t9HF7L_M6BL7tdDqjjzty9hpTo9AzwhvM,10059
|
|
131
133
|
basic_memory/services/initialization.py,sha256=OtdP1iCQIFvPQKtl7x0yfAkdFXH88Ro71I9dWLq0sPI,7520
|
|
132
134
|
basic_memory/services/link_resolver.py,sha256=1-_VFsvqdT5rVBHe8Jrq63U59XQ0hxGezxY8c24Tiow,4594
|
|
133
|
-
basic_memory/services/project_service.py,sha256=
|
|
134
|
-
basic_memory/services/search_service.py,sha256=
|
|
135
|
+
basic_memory/services/project_service.py,sha256=Hoifww_goAQZfsYZgwfLYJDRIjP0i1MBgPE0MctmGPY,33813
|
|
136
|
+
basic_memory/services/search_service.py,sha256=Ld0fyWKF2PZq2ni0rZimKslOsH5K_psi0qq8ty3_1Co,13159
|
|
135
137
|
basic_memory/services/service.py,sha256=V-d_8gOV07zGIQDpL-Ksqs3ZN9l3qf3HZOK1f_YNTag,336
|
|
136
138
|
basic_memory/services/sync_status_service.py,sha256=CgJdaJ6OFvFjKHIQSVIQX8kEU389Mrz_WS6x8dx2-7c,7504
|
|
137
139
|
basic_memory/sync/__init__.py,sha256=CVHguYH457h2u2xoM8KvOilJC71XJlZ-qUh8lHcjYj4,156
|
|
138
140
|
basic_memory/sync/background_sync.py,sha256=VJr2SukRKLdsbfB-9Re4LehcpK15a-RLXAFB-sAdRRM,726
|
|
139
|
-
basic_memory/sync/sync_service.py,sha256=
|
|
141
|
+
basic_memory/sync/sync_service.py,sha256=WrR0iyvWtHmMyMTaViqoE1aRnYVqYIjnuWgFCTwBKBw,32564
|
|
140
142
|
basic_memory/sync/watch_service.py,sha256=vzVdiJh0eLbqYIkLIJp8hwRIj4z52am6Q-_OubC6mbY,19855
|
|
141
143
|
basic_memory/templates/prompts/continue_conversation.hbs,sha256=trrDHSXA5S0JCbInMoUJL04xvCGRB_ku1RHNQHtl6ZI,3076
|
|
142
144
|
basic_memory/templates/prompts/search.hbs,sha256=H1cCIsHKp4VC1GrH2KeUB8pGe5vXFPqb2VPotypmeCA,3098
|
|
143
|
-
basic_memory-0.15.
|
|
144
|
-
basic_memory-0.15.
|
|
145
|
-
basic_memory-0.15.
|
|
146
|
-
basic_memory-0.15.
|
|
147
|
-
basic_memory-0.15.
|
|
145
|
+
basic_memory-0.15.2.dist-info/METADATA,sha256=89H6M6A_nH2JSouO3PgI1z2Kv0ZbV4kJvTVm2SSOGBQ,15670
|
|
146
|
+
basic_memory-0.15.2.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
|
147
|
+
basic_memory-0.15.2.dist-info/entry_points.txt,sha256=wvE2mRF6-Pg4weIYcfQ-86NOLZD4WJg7F7TIsRVFLb8,90
|
|
148
|
+
basic_memory-0.15.2.dist-info/licenses/LICENSE,sha256=hIahDEOTzuHCU5J2nd07LWwkLW7Hko4UFO__ffsvB-8,34523
|
|
149
|
+
basic_memory-0.15.2.dist-info/RECORD,,
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
from httpx._types import (
|
|
2
|
-
HeaderTypes,
|
|
3
|
-
)
|
|
4
|
-
from loguru import logger
|
|
5
|
-
from fastmcp.server.dependencies import get_http_headers
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
def inject_auth_header(headers: HeaderTypes | None = None) -> HeaderTypes:
|
|
9
|
-
"""
|
|
10
|
-
Inject JWT token from FastMCP context into headers if available.
|
|
11
|
-
|
|
12
|
-
Args:
|
|
13
|
-
headers: Existing headers dict or None
|
|
14
|
-
|
|
15
|
-
Returns:
|
|
16
|
-
Headers dict with Authorization header added if JWT is available
|
|
17
|
-
"""
|
|
18
|
-
# Start with existing headers or empty dict
|
|
19
|
-
if headers is None:
|
|
20
|
-
headers = {}
|
|
21
|
-
elif not isinstance(headers, dict):
|
|
22
|
-
# Convert other header types to dict
|
|
23
|
-
headers = dict(headers) # type: ignore
|
|
24
|
-
else:
|
|
25
|
-
# Make a copy to avoid modifying the original
|
|
26
|
-
headers = headers.copy()
|
|
27
|
-
|
|
28
|
-
http_headers = get_http_headers()
|
|
29
|
-
|
|
30
|
-
# Log only non-sensitive header keys for debugging
|
|
31
|
-
if logger.opt(lazy=True).debug:
|
|
32
|
-
sensitive_headers = {"authorization", "cookie", "x-api-key", "x-auth-token", "api-key"}
|
|
33
|
-
safe_headers = {k for k in http_headers.keys() if k.lower() not in sensitive_headers}
|
|
34
|
-
logger.debug(f"HTTP headers present: {list(safe_headers)}")
|
|
35
|
-
|
|
36
|
-
authorization = http_headers.get("Authorization") or http_headers.get("authorization")
|
|
37
|
-
if authorization:
|
|
38
|
-
headers["Authorization"] = authorization # type: ignore
|
|
39
|
-
# Log only that auth was injected, not the token value
|
|
40
|
-
logger.debug("Injected authorization header into request")
|
|
41
|
-
else:
|
|
42
|
-
logger.debug("No authorization header found in request")
|
|
43
|
-
|
|
44
|
-
return headers
|
|
File without changes
|
|
File without changes
|
|
File without changes
|