basic-memory 0.14.1__py3-none-any.whl → 0.14.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/mcp/auth_provider.py +8 -8
- basic_memory/mcp/supabase_auth_provider.py +5 -5
- basic_memory/mcp/tools/project_management.py +7 -2
- basic_memory/utils.py +2 -0
- {basic_memory-0.14.1.dist-info → basic_memory-0.14.2.dist-info}/METADATA +1 -1
- {basic_memory-0.14.1.dist-info → basic_memory-0.14.2.dist-info}/RECORD +10 -10
- {basic_memory-0.14.1.dist-info → basic_memory-0.14.2.dist-info}/WHEEL +0 -0
- {basic_memory-0.14.1.dist-info → basic_memory-0.14.2.dist-info}/entry_points.txt +0 -0
- {basic_memory-0.14.1.dist-info → basic_memory-0.14.2.dist-info}/licenses/LICENSE +0 -0
basic_memory/__init__.py
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"""basic-memory - Local-first knowledge management combining Zettelkasten with knowledge graphs"""
|
|
2
2
|
|
|
3
3
|
# Package version - updated by release automation
|
|
4
|
-
__version__ = "0.14.
|
|
4
|
+
__version__ = "0.14.2"
|
|
5
5
|
|
|
6
6
|
# API version for FastAPI - independent of package version
|
|
7
7
|
__api_version__ = "v0"
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"""OAuth authentication provider for Basic Memory MCP server."""
|
|
2
2
|
|
|
3
3
|
import secrets
|
|
4
|
-
from datetime import datetime, timedelta
|
|
4
|
+
from datetime import datetime, timedelta, timezone
|
|
5
5
|
from typing import Dict, Optional
|
|
6
6
|
|
|
7
7
|
import jwt
|
|
@@ -92,7 +92,7 @@ class BasicMemoryOAuthProvider(
|
|
|
92
92
|
self.authorization_codes[auth_code] = BasicMemoryAuthorizationCode(
|
|
93
93
|
code=auth_code,
|
|
94
94
|
scopes=params.scopes or [],
|
|
95
|
-
expires_at=(datetime.
|
|
95
|
+
expires_at=(datetime.now(timezone.utc) + timedelta(minutes=10)).timestamp(),
|
|
96
96
|
client_id=client.client_id,
|
|
97
97
|
code_challenge=params.code_challenge,
|
|
98
98
|
redirect_uri=params.redirect_uri,
|
|
@@ -119,7 +119,7 @@ class BasicMemoryOAuthProvider(
|
|
|
119
119
|
|
|
120
120
|
if code and code.client_id == client.client_id:
|
|
121
121
|
# Check if expired
|
|
122
|
-
if datetime.
|
|
122
|
+
if datetime.now(timezone.utc).timestamp() > code.expires_at:
|
|
123
123
|
del self.authorization_codes[authorization_code]
|
|
124
124
|
return None
|
|
125
125
|
return code
|
|
@@ -135,7 +135,7 @@ class BasicMemoryOAuthProvider(
|
|
|
135
135
|
refresh_token = secrets.token_urlsafe(32)
|
|
136
136
|
|
|
137
137
|
# Store tokens
|
|
138
|
-
expires_at = (datetime.
|
|
138
|
+
expires_at = (datetime.now(timezone.utc) + timedelta(hours=1)).timestamp()
|
|
139
139
|
|
|
140
140
|
self.access_tokens[access_token] = BasicMemoryAccessToken(
|
|
141
141
|
token=access_token,
|
|
@@ -187,7 +187,7 @@ class BasicMemoryOAuthProvider(
|
|
|
187
187
|
new_refresh_token = secrets.token_urlsafe(32)
|
|
188
188
|
|
|
189
189
|
# Store new tokens
|
|
190
|
-
expires_at = (datetime.
|
|
190
|
+
expires_at = (datetime.now(timezone.utc) + timedelta(hours=1)).timestamp()
|
|
191
191
|
|
|
192
192
|
self.access_tokens[new_access_token] = BasicMemoryAccessToken(
|
|
193
193
|
token=new_access_token,
|
|
@@ -220,7 +220,7 @@ class BasicMemoryOAuthProvider(
|
|
|
220
220
|
|
|
221
221
|
if access_token:
|
|
222
222
|
# Check if expired
|
|
223
|
-
if access_token.expires_at and datetime.
|
|
223
|
+
if access_token.expires_at and datetime.now(timezone.utc).timestamp() > access_token.expires_at:
|
|
224
224
|
logger.debug("Token found in memory but expired, removing")
|
|
225
225
|
del self.access_tokens[token]
|
|
226
226
|
return None
|
|
@@ -262,8 +262,8 @@ class BasicMemoryOAuthProvider(
|
|
|
262
262
|
"iss": self.issuer_url,
|
|
263
263
|
"sub": client_id,
|
|
264
264
|
"aud": "basic-memory",
|
|
265
|
-
"exp": datetime.
|
|
266
|
-
"iat": datetime.
|
|
265
|
+
"exp": datetime.now(timezone.utc) + timedelta(hours=1),
|
|
266
|
+
"iat": datetime.now(timezone.utc),
|
|
267
267
|
"scopes": scopes,
|
|
268
268
|
}
|
|
269
269
|
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
import os
|
|
4
4
|
import secrets
|
|
5
5
|
from dataclasses import dataclass
|
|
6
|
-
from datetime import datetime, timedelta
|
|
6
|
+
from datetime import datetime, timedelta, timezone
|
|
7
7
|
from typing import Optional, Dict, Any
|
|
8
8
|
|
|
9
9
|
import httpx
|
|
@@ -123,7 +123,7 @@ class SupabaseOAuthProvider(
|
|
|
123
123
|
self.pending_auth_codes[state] = SupabaseAuthorizationCode(
|
|
124
124
|
code=state,
|
|
125
125
|
scopes=params.scopes or [],
|
|
126
|
-
expires_at=(datetime.
|
|
126
|
+
expires_at=(datetime.now(timezone.utc) + timedelta(minutes=10)).timestamp(),
|
|
127
127
|
client_id=client.client_id,
|
|
128
128
|
code_challenge=params.code_challenge,
|
|
129
129
|
redirect_uri=params.redirect_uri,
|
|
@@ -218,7 +218,7 @@ class SupabaseOAuthProvider(
|
|
|
218
218
|
|
|
219
219
|
if code and code.client_id == client.client_id:
|
|
220
220
|
# Check expiration
|
|
221
|
-
if datetime.
|
|
221
|
+
if datetime.now(timezone.utc).timestamp() > code.expires_at:
|
|
222
222
|
del self.pending_auth_codes[authorization_code]
|
|
223
223
|
return None
|
|
224
224
|
return code
|
|
@@ -453,8 +453,8 @@ class SupabaseOAuthProvider(
|
|
|
453
453
|
"email": email,
|
|
454
454
|
"scopes": scopes,
|
|
455
455
|
"supabase_token": supabase_access_token[:10] + "...", # Reference only
|
|
456
|
-
"exp": datetime.
|
|
457
|
-
"iat": datetime.
|
|
456
|
+
"exp": datetime.now(timezone.utc) + timedelta(hours=1),
|
|
457
|
+
"iat": datetime.now(timezone.utc),
|
|
458
458
|
}
|
|
459
459
|
|
|
460
460
|
# Use Supabase JWT secret if available
|
|
@@ -5,6 +5,7 @@ and manage project context during conversations.
|
|
|
5
5
|
"""
|
|
6
6
|
|
|
7
7
|
from textwrap import dedent
|
|
8
|
+
from typing import Optional
|
|
8
9
|
|
|
9
10
|
from fastmcp import Context
|
|
10
11
|
from loguru import logger
|
|
@@ -19,7 +20,9 @@ from basic_memory.utils import generate_permalink
|
|
|
19
20
|
|
|
20
21
|
|
|
21
22
|
@mcp.tool("list_memory_projects")
|
|
22
|
-
async def list_memory_projects(
|
|
23
|
+
async def list_memory_projects(
|
|
24
|
+
ctx: Context | None = None, _compatibility: Optional[str] = None
|
|
25
|
+
) -> str:
|
|
23
26
|
"""List all available projects with their status.
|
|
24
27
|
|
|
25
28
|
Shows all Basic Memory projects that are available, indicating which one
|
|
@@ -159,7 +162,9 @@ async def switch_project(project_name: str, ctx: Context | None = None) -> str:
|
|
|
159
162
|
|
|
160
163
|
|
|
161
164
|
@mcp.tool()
|
|
162
|
-
async def get_current_project(
|
|
165
|
+
async def get_current_project(
|
|
166
|
+
ctx: Context | None = None, _compatibility: Optional[str] = None
|
|
167
|
+
) -> str:
|
|
163
168
|
"""Show the currently active project and basic stats.
|
|
164
169
|
|
|
165
170
|
Displays which project is currently active and provides basic information
|
basic_memory/utils.py
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: basic-memory
|
|
3
|
-
Version: 0.14.
|
|
3
|
+
Version: 0.14.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
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
basic_memory/__init__.py,sha256=
|
|
1
|
+
basic_memory/__init__.py,sha256=yUZJCrnWSVfSXfN_chOSAkkW-Kge2Dj3Co6TixwmN9s,256
|
|
2
2
|
basic_memory/config.py,sha256=YX6pP8aOMlIx9NoCeKLS0b5cgOnegbWhX2ijJzimLQg,11828
|
|
3
3
|
basic_memory/db.py,sha256=bFuJHj_PGEhaj5ZgRItIUSW0ujAFCGgYKO7nZsjbYD0,7582
|
|
4
4
|
basic_memory/deps.py,sha256=zXOhqXCoSVIa1iIcO8U6uUiofJn5eT4ycwJkH9I2kX4,12102
|
|
5
5
|
basic_memory/file_utils.py,sha256=eaxTKLLEbTIy_Mb_Iv_Dmt4IXAJSrZGVi-Knrpyci3E,6700
|
|
6
|
-
basic_memory/utils.py,sha256=
|
|
6
|
+
basic_memory/utils.py,sha256=yG-HHoSqw6RUD9yU0PkrLdhDAi99r6tmE8fWTvBxrgc,7636
|
|
7
7
|
basic_memory/alembic/alembic.ini,sha256=IEZsnF8CbbZnkwBr67LzKKNobHuzTaQNUvM8Psop5xc,3733
|
|
8
8
|
basic_memory/alembic/env.py,sha256=gECjMcc--Hhacy3od1WNIAFyHzv6MUi7F_eQG7k3bRQ,2812
|
|
9
9
|
basic_memory/alembic/migrations.py,sha256=lriHPXDdBLSNXEW3QTpU0SJKuVd1V-8NrVkpN3qfsUQ,718
|
|
@@ -58,11 +58,11 @@ basic_memory/markdown/schemas.py,sha256=eyxYCr1hVyWmImcle0asE5It_DD6ARkqaBZYu1KK
|
|
|
58
58
|
basic_memory/markdown/utils.py,sha256=G3V_DQbmDj6idsCy6kT-GhVqiV4JPB5gfWKG5wK_SuQ,3410
|
|
59
59
|
basic_memory/mcp/__init__.py,sha256=dsDOhKqjYeIbCULbHIxfcItTbqudEuEg1Np86eq0GEQ,35
|
|
60
60
|
basic_memory/mcp/async_client.py,sha256=Eo345wANiBRSM4u3j_Vd6Ax4YtMg7qbWd9PIoFfj61I,236
|
|
61
|
-
basic_memory/mcp/auth_provider.py,sha256=
|
|
61
|
+
basic_memory/mcp/auth_provider.py,sha256=NnnxpOUMI1sZhKkzHh4Hhoufo4FuiKByx34TdfPoBX8,10050
|
|
62
62
|
basic_memory/mcp/external_auth_provider.py,sha256=Z1GDbr6P4C-flZVHMWkIqAu30kcfeHv2iSp0EYbFuxo,11483
|
|
63
63
|
basic_memory/mcp/project_session.py,sha256=KfObBqUFUKNGlcApCfQcsqMYsmtWs72OdIcQ79ZSWhk,4142
|
|
64
64
|
basic_memory/mcp/server.py,sha256=T8utX0fTA12rAC_TjtWgsfB1z-Q6pdTWJH4HISw73vg,3764
|
|
65
|
-
basic_memory/mcp/supabase_auth_provider.py,sha256=
|
|
65
|
+
basic_memory/mcp/supabase_auth_provider.py,sha256=R_E4jzXSDOyPomoHiIqPVjx-VUhPqJSIUbg84mE2YaQ,16518
|
|
66
66
|
basic_memory/mcp/prompts/__init__.py,sha256=UvaIw5KA8PaXj3Wz1Dr-VjlkEq6T5D8AGtYFVwaHqnA,683
|
|
67
67
|
basic_memory/mcp/prompts/ai_assistant_guide.py,sha256=8TI5xObiRVcwv6w9by1xQHlX0whvyE7-LGsiqDMRTFg,821
|
|
68
68
|
basic_memory/mcp/prompts/continue_conversation.py,sha256=rsmlC2V7e7G6DAK0K825vFsPKgsRQ702HFzn6lkHaDM,1998
|
|
@@ -79,7 +79,7 @@ basic_memory/mcp/tools/delete_note.py,sha256=tSyRc_VgBmLyVeenClwX1Sk--LKcGahAMzT
|
|
|
79
79
|
basic_memory/mcp/tools/edit_note.py,sha256=q4x-f7-j_l-wzm17-AVFT1_WGCo0Cq4lI3seYSe21aY,13570
|
|
80
80
|
basic_memory/mcp/tools/list_directory.py,sha256=-FxDsCru5YD02M4qkQDAurEJWyRaC7YI4YR6zg0atR8,5236
|
|
81
81
|
basic_memory/mcp/tools/move_note.py,sha256=jAsCFXrcWXPoBWlWcW8y3Tli5MkKwCQK-n6IwUZoOK8,17357
|
|
82
|
-
basic_memory/mcp/tools/project_management.py,sha256=
|
|
82
|
+
basic_memory/mcp/tools/project_management.py,sha256=zaxzbWUSn2iahca4L44EO8hKMWV-rXqDMXcRce6qhg8,12944
|
|
83
83
|
basic_memory/mcp/tools/read_content.py,sha256=4FTw13B8UjVVhR78NJB9HKeJb_nA6-BGT1WdGtekN5Q,8596
|
|
84
84
|
basic_memory/mcp/tools/read_note.py,sha256=V08NdBqWY8Y0Q4zuwK--zN3VK7fmuCH1mOYZKwL1IT4,7614
|
|
85
85
|
basic_memory/mcp/tools/recent_activity.py,sha256=XVjNJAJnmxvzx9_Ls1A-QOd2yTR7pJlSTTuRxSivmN4,4833
|
|
@@ -131,8 +131,8 @@ basic_memory/sync/sync_service.py,sha256=AxC5J1YTcPWTmA0HdzvOZBthi4-_LZ44kNF0KQo
|
|
|
131
131
|
basic_memory/sync/watch_service.py,sha256=JAumrHUjV1lF9NtEK32jgg0myWBfLXotNXxONeIV9SM,15316
|
|
132
132
|
basic_memory/templates/prompts/continue_conversation.hbs,sha256=trrDHSXA5S0JCbInMoUJL04xvCGRB_ku1RHNQHtl6ZI,3076
|
|
133
133
|
basic_memory/templates/prompts/search.hbs,sha256=H1cCIsHKp4VC1GrH2KeUB8pGe5vXFPqb2VPotypmeCA,3098
|
|
134
|
-
basic_memory-0.14.
|
|
135
|
-
basic_memory-0.14.
|
|
136
|
-
basic_memory-0.14.
|
|
137
|
-
basic_memory-0.14.
|
|
138
|
-
basic_memory-0.14.
|
|
134
|
+
basic_memory-0.14.2.dist-info/METADATA,sha256=h7tyu5dCVDkJYGeV4XPL2RbK7hL3CrKM9n5UlrUapWc,17639
|
|
135
|
+
basic_memory-0.14.2.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
|
136
|
+
basic_memory-0.14.2.dist-info/entry_points.txt,sha256=wvE2mRF6-Pg4weIYcfQ-86NOLZD4WJg7F7TIsRVFLb8,90
|
|
137
|
+
basic_memory-0.14.2.dist-info/licenses/LICENSE,sha256=hIahDEOTzuHCU5J2nd07LWwkLW7Hko4UFO__ffsvB-8,34523
|
|
138
|
+
basic_memory-0.14.2.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|