axio-context-sqlite 0.8.0__tar.gz → 0.9.1__tar.gz
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.
- {axio_context_sqlite-0.8.0 → axio_context_sqlite-0.9.1}/PKG-INFO +8 -8
- {axio_context_sqlite-0.8.0 → axio_context_sqlite-0.9.1}/README.md +7 -7
- {axio_context_sqlite-0.8.0 → axio_context_sqlite-0.9.1}/pyproject.toml +5 -4
- {axio_context_sqlite-0.8.0 → axio_context_sqlite-0.9.1}/tests/test_autocompact_sqlite.py +1 -1
- {axio_context_sqlite-0.8.0 → axio_context_sqlite-0.9.1}/tests/test_store.py +1 -1
- {axio_context_sqlite-0.8.0 → axio_context_sqlite-0.9.1}/.gitignore +0 -0
- {axio_context_sqlite-0.8.0 → axio_context_sqlite-0.9.1}/src/axio_context_sqlite/__init__.py +0 -0
- {axio_context_sqlite-0.8.0 → axio_context_sqlite-0.9.1}/src/axio_context_sqlite/py.typed +0 -0
- {axio_context_sqlite-0.8.0 → axio_context_sqlite-0.9.1}/src/axio_context_sqlite/store.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: axio-context-sqlite
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.9.1
|
|
4
4
|
Summary: SQLite-backed context store for Axio
|
|
5
5
|
Project-URL: Homepage, https://github.com/mosquito/axio-agent
|
|
6
6
|
Project-URL: Repository, https://github.com/mosquito/axio-agent
|
|
@@ -48,8 +48,8 @@ Create a context store bound to one session.
|
|
|
48
48
|
|
|
49
49
|
| Parameter | Type | Default | Description |
|
|
50
50
|
|-----------|------|---------|-------------|
|
|
51
|
-
| `conn` | `aiosqlite.Connection` |
|
|
52
|
-
| `session_id` | `str` |
|
|
51
|
+
| `conn` | `aiosqlite.Connection` | - | Open database connection (from `connect()`) |
|
|
52
|
+
| `session_id` | `str` | - | Unique identifier for this conversation session |
|
|
53
53
|
| `project` | `str \| None` | `str(Path.cwd().resolve())` | Logical project scope used to group and list sessions. Defaults to the current working directory. |
|
|
54
54
|
| `db_name` | `str` | `"axio_context"` | Prefix used for the database table names (`axio_context_messages`, `axio_context_tokens`). |
|
|
55
55
|
|
|
@@ -87,16 +87,16 @@ the same database file, isolated by `session_id` and `project`.
|
|
|
87
87
|
Message content is stored as serialized JSON. Payloads larger than 512 bytes
|
|
88
88
|
are automatically compressed with gzip (compresslevel 6) and stored
|
|
89
89
|
base64-encoded with a `gzip:` prefix. Smaller payloads are stored as-is with a
|
|
90
|
-
`plain:` prefix. Decompression happens transparently on read
|
|
90
|
+
`plain:` prefix. Decompression happens transparently on read - callers never
|
|
91
91
|
see the encoded form.
|
|
92
92
|
|
|
93
93
|
#### SQLite performance settings
|
|
94
94
|
|
|
95
95
|
Every connection opened by `connect()` is configured with:
|
|
96
96
|
|
|
97
|
-
- `PRAGMA journal_mode=WAL`
|
|
98
|
-
- `PRAGMA busy_timeout=5000`
|
|
99
|
-
- `PRAGMA synchronous=NORMAL`
|
|
97
|
+
- `PRAGMA journal_mode=WAL` - enables concurrent readers alongside one writer
|
|
98
|
+
- `PRAGMA busy_timeout=5000` - waits up to 5 seconds before raising a lock error
|
|
99
|
+
- `PRAGMA synchronous=NORMAL` - balances durability and write throughput
|
|
100
100
|
|
|
101
101
|
### Agent integration
|
|
102
102
|
|
|
@@ -166,7 +166,7 @@ to call concurrently from multiple coroutines without an application-level lock.
|
|
|
166
166
|
|
|
167
167
|
### Forking
|
|
168
168
|
|
|
169
|
-
`fork()` copies the current session's messages into a new session
|
|
169
|
+
`fork()` copies the current session's messages into a new session - useful for
|
|
170
170
|
branching conversations without affecting the original:
|
|
171
171
|
|
|
172
172
|
<!-- name: test_readme_fork -->
|
|
@@ -35,8 +35,8 @@ Create a context store bound to one session.
|
|
|
35
35
|
|
|
36
36
|
| Parameter | Type | Default | Description |
|
|
37
37
|
|-----------|------|---------|-------------|
|
|
38
|
-
| `conn` | `aiosqlite.Connection` |
|
|
39
|
-
| `session_id` | `str` |
|
|
38
|
+
| `conn` | `aiosqlite.Connection` | - | Open database connection (from `connect()`) |
|
|
39
|
+
| `session_id` | `str` | - | Unique identifier for this conversation session |
|
|
40
40
|
| `project` | `str \| None` | `str(Path.cwd().resolve())` | Logical project scope used to group and list sessions. Defaults to the current working directory. |
|
|
41
41
|
| `db_name` | `str` | `"axio_context"` | Prefix used for the database table names (`axio_context_messages`, `axio_context_tokens`). |
|
|
42
42
|
|
|
@@ -74,16 +74,16 @@ the same database file, isolated by `session_id` and `project`.
|
|
|
74
74
|
Message content is stored as serialized JSON. Payloads larger than 512 bytes
|
|
75
75
|
are automatically compressed with gzip (compresslevel 6) and stored
|
|
76
76
|
base64-encoded with a `gzip:` prefix. Smaller payloads are stored as-is with a
|
|
77
|
-
`plain:` prefix. Decompression happens transparently on read
|
|
77
|
+
`plain:` prefix. Decompression happens transparently on read - callers never
|
|
78
78
|
see the encoded form.
|
|
79
79
|
|
|
80
80
|
#### SQLite performance settings
|
|
81
81
|
|
|
82
82
|
Every connection opened by `connect()` is configured with:
|
|
83
83
|
|
|
84
|
-
- `PRAGMA journal_mode=WAL`
|
|
85
|
-
- `PRAGMA busy_timeout=5000`
|
|
86
|
-
- `PRAGMA synchronous=NORMAL`
|
|
84
|
+
- `PRAGMA journal_mode=WAL` - enables concurrent readers alongside one writer
|
|
85
|
+
- `PRAGMA busy_timeout=5000` - waits up to 5 seconds before raising a lock error
|
|
86
|
+
- `PRAGMA synchronous=NORMAL` - balances durability and write throughput
|
|
87
87
|
|
|
88
88
|
### Agent integration
|
|
89
89
|
|
|
@@ -153,7 +153,7 @@ to call concurrently from multiple coroutines without an application-level lock.
|
|
|
153
153
|
|
|
154
154
|
### Forking
|
|
155
155
|
|
|
156
|
-
`fork()` copies the current session's messages into a new session
|
|
156
|
+
`fork()` copies the current session's messages into a new session - useful for
|
|
157
157
|
branching conversations without affecting the original:
|
|
158
158
|
|
|
159
159
|
<!-- name: test_readme_fork -->
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
[project]
|
|
2
2
|
name = "axio-context-sqlite"
|
|
3
|
-
version = "0.
|
|
3
|
+
version = "0.9.1"
|
|
4
4
|
description = "SQLite-backed context store for Axio"
|
|
5
5
|
readme = "README.md"
|
|
6
6
|
requires-python = ">=3.12"
|
|
@@ -26,6 +26,7 @@ testpaths = ["tests", "README.md"]
|
|
|
26
26
|
|
|
27
27
|
[tool.ruff]
|
|
28
28
|
line-length = 119
|
|
29
|
+
output-format = "concise"
|
|
29
30
|
target-version = "py312"
|
|
30
31
|
|
|
31
32
|
[tool.ruff.lint]
|
|
@@ -35,6 +36,9 @@ select = ["E", "F", "I", "UP"]
|
|
|
35
36
|
strict = true
|
|
36
37
|
python_version = "3.12"
|
|
37
38
|
|
|
39
|
+
[tool.uv.sources]
|
|
40
|
+
axio = { workspace = true }
|
|
41
|
+
|
|
38
42
|
[dependency-groups]
|
|
39
43
|
dev = [
|
|
40
44
|
"pytest>=8",
|
|
@@ -44,6 +48,3 @@ dev = [
|
|
|
44
48
|
"pytest-cov>=7.1.0",
|
|
45
49
|
"markdown-pytest>=0.6.0",
|
|
46
50
|
]
|
|
47
|
-
|
|
48
|
-
[tool.uv.sources]
|
|
49
|
-
axio = { workspace = true }
|
|
@@ -124,7 +124,7 @@ class TestAutoCompactWithSQLite:
|
|
|
124
124
|
|
|
125
125
|
assert forked.session_id != store.session_id
|
|
126
126
|
|
|
127
|
-
# append to fork
|
|
127
|
+
# append to fork - parent unaffected
|
|
128
128
|
await forked.append(_msg(text="extra"))
|
|
129
129
|
assert len(await store.get_history()) == 6
|
|
130
130
|
assert len(await forked.get_history()) == 7
|
|
@@ -121,7 +121,7 @@ async def test_large_message_compressed_on_disk(db_path: Path) -> None:
|
|
|
121
121
|
finally:
|
|
122
122
|
await c.close()
|
|
123
123
|
|
|
124
|
-
# Inspect raw bytes on disk
|
|
124
|
+
# Inspect raw bytes on disk - should start with gzip:
|
|
125
125
|
async with aiosqlite.connect(str(db_path)) as raw:
|
|
126
126
|
async with raw.execute("SELECT content FROM axio_context_messages") as cur:
|
|
127
127
|
row = await cur.fetchone()
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|