seshi 0.11.0__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.
- seshi-0.11.0/.gitignore +19 -0
- seshi-0.11.0/LICENSE +21 -0
- seshi-0.11.0/PKG-INFO +75 -0
- seshi-0.11.0/README.md +48 -0
- seshi-0.11.0/pyproject.toml +74 -0
- seshi-0.11.0/src/seshi/__init__.py +119 -0
- seshi-0.11.0/src/seshi/_calls.py +482 -0
- seshi-0.11.0/src/seshi/_routes.py +84 -0
- seshi-0.11.0/src/seshi/_version.py +3 -0
- seshi-0.11.0/src/seshi/client.py +809 -0
- seshi-0.11.0/src/seshi/errors.py +74 -0
- seshi-0.11.0/src/seshi/models.py +1093 -0
- seshi-0.11.0/src/seshi/py.typed +0 -0
seshi-0.11.0/.gitignore
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
node_modules/
|
|
2
|
+
.env
|
|
3
|
+
.env.*
|
|
4
|
+
!.env.example
|
|
5
|
+
.DS_Store
|
|
6
|
+
dist/
|
|
7
|
+
|
|
8
|
+
# Claude Code lays the plugin API types here when it loads the plugin from this folder.
|
|
9
|
+
integrations/claude-code/plugin/.claude-plugin/types/
|
|
10
|
+
|
|
11
|
+
# Evidence from .claude/skills/verify-seshi (control-seshi).
|
|
12
|
+
.verify/
|
|
13
|
+
|
|
14
|
+
# The Python client's (packages/py/client) environment and tool caches.
|
|
15
|
+
.venv/
|
|
16
|
+
__pycache__/
|
|
17
|
+
.pytest_cache/
|
|
18
|
+
.mypy_cache/
|
|
19
|
+
.ruff_cache/
|
seshi-0.11.0/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Dosu
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
seshi-0.11.0/PKG-INFO
ADDED
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
Metadata-Version: 2.5
|
|
2
|
+
Name: seshi
|
|
3
|
+
Version: 0.11.0
|
|
4
|
+
Summary: The typed Python client for a seshi server: store, read, search and tail coding-agent sessions.
|
|
5
|
+
Project-URL: Homepage, https://github.com/dosu-ai/seshi
|
|
6
|
+
Project-URL: Documentation, https://github.com/dosu-ai/seshi/blob/main/docs/client.md
|
|
7
|
+
Project-URL: Source, https://github.com/dosu-ai/seshi/tree/main/packages/py/client
|
|
8
|
+
Project-URL: Changelog, https://github.com/dosu-ai/seshi/blob/main/CHANGELOG.md
|
|
9
|
+
Author: Dosu
|
|
10
|
+
License-Expression: MIT
|
|
11
|
+
License-File: LICENSE
|
|
12
|
+
Keywords: claude-code,codex,coding-agent,seshi,sessions,traces
|
|
13
|
+
Classifier: Development Status :: 4 - Beta
|
|
14
|
+
Classifier: Intended Audience :: Developers
|
|
15
|
+
Classifier: Programming Language :: Python :: 3
|
|
16
|
+
Classifier: Programming Language :: Python :: 3 :: Only
|
|
17
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
18
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
19
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
20
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
21
|
+
Classifier: Programming Language :: Python :: 3.14
|
|
22
|
+
Classifier: Typing :: Typed
|
|
23
|
+
Requires-Python: >=3.10
|
|
24
|
+
Requires-Dist: httpx<1,>=0.27
|
|
25
|
+
Requires-Dist: pydantic<3,>=2.7
|
|
26
|
+
Description-Content-Type: text/markdown
|
|
27
|
+
|
|
28
|
+
# seshi
|
|
29
|
+
|
|
30
|
+
The typed Python client for a [seshi](https://github.com/dosu-ai/seshi) server: store, read,
|
|
31
|
+
search and tail coding-agent sessions. The Python counterpart of `@dosu/seshi-client`, released
|
|
32
|
+
at the same version as the server.
|
|
33
|
+
|
|
34
|
+
```sh
|
|
35
|
+
pip install seshi # or: uv add seshi
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
Python 3.10+, on [httpx](https://www.python-httpx.org/) and [pydantic](https://docs.pydantic.dev/) v2,
|
|
39
|
+
with a sync and an async client.
|
|
40
|
+
|
|
41
|
+
```python
|
|
42
|
+
import os
|
|
43
|
+
from seshi import OffsetMismatch, SeshiClient, Upload
|
|
44
|
+
|
|
45
|
+
with SeshiClient(
|
|
46
|
+
"https://seshi.acme.internal",
|
|
47
|
+
os.environ["ACME_SESHI_TOKEN"], # a device, service, admin or static token, or the org key
|
|
48
|
+
user="alice@acme.com", # with the org key only: the username to write as
|
|
49
|
+
) as db:
|
|
50
|
+
answer = db.ingest(Upload(agent="claude-code", session_id="8f1c…", transcript=log))
|
|
51
|
+
# Stored(status='stored', content_hash='…', records_total=41, bytes_total=48213, …)
|
|
52
|
+
|
|
53
|
+
# As the log grows, send only what it gained, from where the last answer ended.
|
|
54
|
+
db.ingest(
|
|
55
|
+
Upload(agent="claude-code", session_id="8f1c…", transcript=tail, offset=answer.bytes_total)
|
|
56
|
+
)
|
|
57
|
+
|
|
58
|
+
session = db.get_session("claude-code", "8f1c…")
|
|
59
|
+
trace = db.get_trace("claude-code", "8f1c…", format="otlp")
|
|
60
|
+
for entry in db.iter_changes(after=cursor):
|
|
61
|
+
...
|
|
62
|
+
found = db.search("flaky checkout test", repo="widget", sort="recent")
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
`AsyncSeshiClient` has the same calls as coroutines:
|
|
66
|
+
|
|
67
|
+
```python
|
|
68
|
+
async with AsyncSeshiClient(server, token) as db:
|
|
69
|
+
async for entry in db.iter_all_changes(since="2026-11-01T00:00:00.000Z"):
|
|
70
|
+
...
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
The calls, options and errors are documented in
|
|
74
|
+
[docs/client.md](https://github.com/dosu-ai/seshi/blob/main/docs/client.md#python-seshi); the HTTP
|
|
75
|
+
contract is [spec/openapi.yaml](https://github.com/dosu-ai/seshi/blob/main/spec/openapi.yaml).
|
seshi-0.11.0/README.md
ADDED
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
# seshi
|
|
2
|
+
|
|
3
|
+
The typed Python client for a [seshi](https://github.com/dosu-ai/seshi) server: store, read,
|
|
4
|
+
search and tail coding-agent sessions. The Python counterpart of `@dosu/seshi-client`, released
|
|
5
|
+
at the same version as the server.
|
|
6
|
+
|
|
7
|
+
```sh
|
|
8
|
+
pip install seshi # or: uv add seshi
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
Python 3.10+, on [httpx](https://www.python-httpx.org/) and [pydantic](https://docs.pydantic.dev/) v2,
|
|
12
|
+
with a sync and an async client.
|
|
13
|
+
|
|
14
|
+
```python
|
|
15
|
+
import os
|
|
16
|
+
from seshi import OffsetMismatch, SeshiClient, Upload
|
|
17
|
+
|
|
18
|
+
with SeshiClient(
|
|
19
|
+
"https://seshi.acme.internal",
|
|
20
|
+
os.environ["ACME_SESHI_TOKEN"], # a device, service, admin or static token, or the org key
|
|
21
|
+
user="alice@acme.com", # with the org key only: the username to write as
|
|
22
|
+
) as db:
|
|
23
|
+
answer = db.ingest(Upload(agent="claude-code", session_id="8f1c…", transcript=log))
|
|
24
|
+
# Stored(status='stored', content_hash='…', records_total=41, bytes_total=48213, …)
|
|
25
|
+
|
|
26
|
+
# As the log grows, send only what it gained, from where the last answer ended.
|
|
27
|
+
db.ingest(
|
|
28
|
+
Upload(agent="claude-code", session_id="8f1c…", transcript=tail, offset=answer.bytes_total)
|
|
29
|
+
)
|
|
30
|
+
|
|
31
|
+
session = db.get_session("claude-code", "8f1c…")
|
|
32
|
+
trace = db.get_trace("claude-code", "8f1c…", format="otlp")
|
|
33
|
+
for entry in db.iter_changes(after=cursor):
|
|
34
|
+
...
|
|
35
|
+
found = db.search("flaky checkout test", repo="widget", sort="recent")
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
`AsyncSeshiClient` has the same calls as coroutines:
|
|
39
|
+
|
|
40
|
+
```python
|
|
41
|
+
async with AsyncSeshiClient(server, token) as db:
|
|
42
|
+
async for entry in db.iter_all_changes(since="2026-11-01T00:00:00.000Z"):
|
|
43
|
+
...
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
The calls, options and errors are documented in
|
|
47
|
+
[docs/client.md](https://github.com/dosu-ai/seshi/blob/main/docs/client.md#python-seshi); the HTTP
|
|
48
|
+
contract is [spec/openapi.yaml](https://github.com/dosu-ai/seshi/blob/main/spec/openapi.yaml).
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
[project]
|
|
2
|
+
name = "seshi"
|
|
3
|
+
dynamic = ["version"]
|
|
4
|
+
description = "The typed Python client for a seshi server: store, read, search and tail coding-agent sessions."
|
|
5
|
+
readme = "README.md"
|
|
6
|
+
license = "MIT"
|
|
7
|
+
license-files = ["LICENSE"]
|
|
8
|
+
requires-python = ">=3.10"
|
|
9
|
+
authors = [{ name = "Dosu" }]
|
|
10
|
+
keywords = ["seshi", "coding-agent", "sessions", "traces", "claude-code", "codex"]
|
|
11
|
+
classifiers = [
|
|
12
|
+
"Development Status :: 4 - Beta",
|
|
13
|
+
"Intended Audience :: Developers",
|
|
14
|
+
"Programming Language :: Python :: 3",
|
|
15
|
+
"Programming Language :: Python :: 3 :: Only",
|
|
16
|
+
"Programming Language :: Python :: 3.10",
|
|
17
|
+
"Programming Language :: Python :: 3.11",
|
|
18
|
+
"Programming Language :: Python :: 3.12",
|
|
19
|
+
"Programming Language :: Python :: 3.13",
|
|
20
|
+
"Programming Language :: Python :: 3.14",
|
|
21
|
+
"Typing :: Typed",
|
|
22
|
+
]
|
|
23
|
+
dependencies = ["httpx>=0.27,<1", "pydantic>=2.7,<3"]
|
|
24
|
+
|
|
25
|
+
[project.urls]
|
|
26
|
+
Homepage = "https://github.com/dosu-ai/seshi"
|
|
27
|
+
Documentation = "https://github.com/dosu-ai/seshi/blob/main/docs/client.md"
|
|
28
|
+
Source = "https://github.com/dosu-ai/seshi/tree/main/packages/py/client"
|
|
29
|
+
Changelog = "https://github.com/dosu-ai/seshi/blob/main/CHANGELOG.md"
|
|
30
|
+
|
|
31
|
+
[dependency-groups]
|
|
32
|
+
dev = [
|
|
33
|
+
"mypy>=1.13",
|
|
34
|
+
"pytest>=8.3",
|
|
35
|
+
"pyyaml>=6.0",
|
|
36
|
+
"ruff>=0.8",
|
|
37
|
+
"types-pyyaml>=6.0",
|
|
38
|
+
]
|
|
39
|
+
|
|
40
|
+
[build-system]
|
|
41
|
+
requires = ["hatchling>=1.27"]
|
|
42
|
+
build-backend = "hatchling.build"
|
|
43
|
+
|
|
44
|
+
# The version is the release's, as packages/ts/model/package.json holds it:
|
|
45
|
+
# scripts/release-version.ts writes both, and tests/test_version.py holds them together.
|
|
46
|
+
[tool.hatch.version]
|
|
47
|
+
path = "src/seshi/_version.py"
|
|
48
|
+
|
|
49
|
+
[tool.hatch.build.targets.wheel]
|
|
50
|
+
packages = ["src/seshi"]
|
|
51
|
+
|
|
52
|
+
# The tests start a server from the seshi repository, so they stay there.
|
|
53
|
+
[tool.hatch.build.targets.sdist]
|
|
54
|
+
only-include = ["src", "README.md", "LICENSE", "pyproject.toml"]
|
|
55
|
+
|
|
56
|
+
[tool.pytest.ini_options]
|
|
57
|
+
testpaths = ["tests"]
|
|
58
|
+
addopts = ["-ra", "--strict-markers"]
|
|
59
|
+
markers = ["live: runs against a real seshi server started from this repository"]
|
|
60
|
+
|
|
61
|
+
[tool.ruff]
|
|
62
|
+
line-length = 100
|
|
63
|
+
target-version = "py310"
|
|
64
|
+
|
|
65
|
+
[tool.ruff.lint]
|
|
66
|
+
select = ["E", "F", "W", "I", "B", "UP", "SIM", "RUF", "PT", "ASYNC", "C4", "PIE", "RET"]
|
|
67
|
+
# `assert a is not None and a.x == 1` reads better than two asserts in a test.
|
|
68
|
+
ignore = ["PT018"]
|
|
69
|
+
|
|
70
|
+
[tool.mypy]
|
|
71
|
+
strict = true
|
|
72
|
+
python_version = "3.10"
|
|
73
|
+
plugins = ["pydantic.mypy"]
|
|
74
|
+
files = ["src", "tests"]
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
"""The typed Python client for a seshi server.
|
|
2
|
+
|
|
3
|
+
from seshi import SeshiClient, Upload
|
|
4
|
+
|
|
5
|
+
with SeshiClient("https://seshi.acme.internal", token) as db:
|
|
6
|
+
answer = db.ingest(Upload(agent="claude-code", session_id="8f1c…", transcript=log))
|
|
7
|
+
|
|
8
|
+
See docs/client.md in the seshi repository.
|
|
9
|
+
"""
|
|
10
|
+
|
|
11
|
+
from ._calls import RETRACT_HEADER, rfc3339
|
|
12
|
+
from ._version import __version__
|
|
13
|
+
from .client import AsyncSeshiClient, SeshiClient, auth_config, exchange_id_token
|
|
14
|
+
from .errors import (
|
|
15
|
+
Forbidden,
|
|
16
|
+
OffsetMismatch,
|
|
17
|
+
ServerError,
|
|
18
|
+
SeshiError,
|
|
19
|
+
SessionConflict,
|
|
20
|
+
SessionRejected,
|
|
21
|
+
StoreError,
|
|
22
|
+
)
|
|
23
|
+
from .models import (
|
|
24
|
+
AllChangesPage,
|
|
25
|
+
AtifDocument,
|
|
26
|
+
AuthConfig,
|
|
27
|
+
Change,
|
|
28
|
+
ChangeEntry,
|
|
29
|
+
ChangesPage,
|
|
30
|
+
ConfigStatus,
|
|
31
|
+
CreatedToken,
|
|
32
|
+
ExchangeRequest,
|
|
33
|
+
ExchangeResult,
|
|
34
|
+
Health,
|
|
35
|
+
Identity,
|
|
36
|
+
IngestResult,
|
|
37
|
+
JobsStatus,
|
|
38
|
+
LettaTrace,
|
|
39
|
+
NotWritten,
|
|
40
|
+
OtlpTrace,
|
|
41
|
+
OwnedChange,
|
|
42
|
+
OwnersPage,
|
|
43
|
+
RecordsPage,
|
|
44
|
+
RedactionRules,
|
|
45
|
+
RedactionRulesAnswer,
|
|
46
|
+
ReloadReport,
|
|
47
|
+
ReloadResult,
|
|
48
|
+
Removed,
|
|
49
|
+
ReviewDecision,
|
|
50
|
+
SearchRequest,
|
|
51
|
+
SearchResult,
|
|
52
|
+
SearchResults,
|
|
53
|
+
SessionMetadata,
|
|
54
|
+
SessionsPage,
|
|
55
|
+
SourceStatus,
|
|
56
|
+
StaleSessionsPage,
|
|
57
|
+
Stored,
|
|
58
|
+
StoredTrace,
|
|
59
|
+
TokenInfo,
|
|
60
|
+
TokenRequest,
|
|
61
|
+
Trace,
|
|
62
|
+
Upload,
|
|
63
|
+
)
|
|
64
|
+
|
|
65
|
+
__all__ = [
|
|
66
|
+
"RETRACT_HEADER",
|
|
67
|
+
"AllChangesPage",
|
|
68
|
+
"AsyncSeshiClient",
|
|
69
|
+
"AtifDocument",
|
|
70
|
+
"AuthConfig",
|
|
71
|
+
"Change",
|
|
72
|
+
"ChangeEntry",
|
|
73
|
+
"ChangesPage",
|
|
74
|
+
"ConfigStatus",
|
|
75
|
+
"CreatedToken",
|
|
76
|
+
"ExchangeRequest",
|
|
77
|
+
"ExchangeResult",
|
|
78
|
+
"Forbidden",
|
|
79
|
+
"Health",
|
|
80
|
+
"Identity",
|
|
81
|
+
"IngestResult",
|
|
82
|
+
"JobsStatus",
|
|
83
|
+
"LettaTrace",
|
|
84
|
+
"NotWritten",
|
|
85
|
+
"OffsetMismatch",
|
|
86
|
+
"OtlpTrace",
|
|
87
|
+
"OwnedChange",
|
|
88
|
+
"OwnersPage",
|
|
89
|
+
"RecordsPage",
|
|
90
|
+
"RedactionRules",
|
|
91
|
+
"RedactionRulesAnswer",
|
|
92
|
+
"ReloadReport",
|
|
93
|
+
"ReloadResult",
|
|
94
|
+
"Removed",
|
|
95
|
+
"ReviewDecision",
|
|
96
|
+
"SearchRequest",
|
|
97
|
+
"SearchResult",
|
|
98
|
+
"SearchResults",
|
|
99
|
+
"ServerError",
|
|
100
|
+
"SeshiClient",
|
|
101
|
+
"SeshiError",
|
|
102
|
+
"SessionConflict",
|
|
103
|
+
"SessionMetadata",
|
|
104
|
+
"SessionRejected",
|
|
105
|
+
"SessionsPage",
|
|
106
|
+
"SourceStatus",
|
|
107
|
+
"StaleSessionsPage",
|
|
108
|
+
"StoreError",
|
|
109
|
+
"Stored",
|
|
110
|
+
"StoredTrace",
|
|
111
|
+
"TokenInfo",
|
|
112
|
+
"TokenRequest",
|
|
113
|
+
"Trace",
|
|
114
|
+
"Upload",
|
|
115
|
+
"__version__",
|
|
116
|
+
"auth_config",
|
|
117
|
+
"exchange_id_token",
|
|
118
|
+
"rfc3339",
|
|
119
|
+
]
|