agentledger-inspector 1.3.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.
- agentledger_inspector-1.3.0/.gitignore +64 -0
- agentledger_inspector-1.3.0/PKG-INFO +83 -0
- agentledger_inspector-1.3.0/README.md +68 -0
- agentledger_inspector-1.3.0/pyproject.toml +23 -0
- agentledger_inspector-1.3.0/src/agentledger_inspector/__init__.py +20 -0
- agentledger_inspector-1.3.0/tests/test_import.py +8 -0
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
.agentledger/
|
|
2
|
+
go/.agentledger-go/
|
|
3
|
+
rust/.agentledger-rust/
|
|
4
|
+
*.db
|
|
5
|
+
*.sqlite
|
|
6
|
+
*.sqlite3
|
|
7
|
+
|
|
8
|
+
__pycache__/
|
|
9
|
+
**/__pycache__/
|
|
10
|
+
*.py[cod]
|
|
11
|
+
*.pyo
|
|
12
|
+
*.pyd
|
|
13
|
+
$py.class
|
|
14
|
+
.pytest_cache/
|
|
15
|
+
.mypy_cache/
|
|
16
|
+
.ruff_cache/
|
|
17
|
+
.coverage
|
|
18
|
+
coverage.xml
|
|
19
|
+
dist/
|
|
20
|
+
build/
|
|
21
|
+
*.egg-info/
|
|
22
|
+
.venv/
|
|
23
|
+
venv/
|
|
24
|
+
.env
|
|
25
|
+
.DS_Store
|
|
26
|
+
**/.DS_Store
|
|
27
|
+
node_modules/
|
|
28
|
+
**/node_modules/
|
|
29
|
+
npm-debug.log*
|
|
30
|
+
yarn-debug.log*
|
|
31
|
+
yarn-error.log*
|
|
32
|
+
pnpm-debug.log*
|
|
33
|
+
|
|
34
|
+
# Local notes, research dumps, and generated reports that should not ship.
|
|
35
|
+
.claude/
|
|
36
|
+
AI_Agent_Runtime_开源项目构想.md
|
|
37
|
+
*.pdf
|
|
38
|
+
*.docx
|
|
39
|
+
*.pptx
|
|
40
|
+
*.pages
|
|
41
|
+
*.key
|
|
42
|
+
evidence/
|
|
43
|
+
evidence*.html
|
|
44
|
+
time-travel*.html
|
|
45
|
+
|
|
46
|
+
# Local external installer/download artifacts.
|
|
47
|
+
rce
|
|
48
|
+
|
|
49
|
+
# Rust build outputs.
|
|
50
|
+
target/
|
|
51
|
+
**/target/
|
|
52
|
+
rust/crates/*/Cargo.lock
|
|
53
|
+
# Local transient files
|
|
54
|
+
*.tmp
|
|
55
|
+
*.log
|
|
56
|
+
*.bak
|
|
57
|
+
*.swp
|
|
58
|
+
*.swo
|
|
59
|
+
*.orig
|
|
60
|
+
|
|
61
|
+
# Python/pytest leftovers not always covered by tool output
|
|
62
|
+
.coverage.*
|
|
63
|
+
htmlcov/
|
|
64
|
+
.ipynb_checkpoints/
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: agentledger-inspector
|
|
3
|
+
Version: 1.3.0
|
|
4
|
+
Summary: Read-only Inspector and evidence viewer package for AgentLedger
|
|
5
|
+
Project-URL: Homepage, https://github.com/yaogdu/AgentLedger
|
|
6
|
+
Project-URL: Repository, https://github.com/yaogdu/AgentLedger
|
|
7
|
+
Project-URL: Documentation, https://github.com/yaogdu/AgentLedger/tree/main/docs
|
|
8
|
+
Project-URL: Issues, https://github.com/yaogdu/AgentLedger/issues
|
|
9
|
+
Author: AgentLedger Contributors
|
|
10
|
+
License: Apache-2.0
|
|
11
|
+
Keywords: agents,debug,evidence,inspector,runtime
|
|
12
|
+
Requires-Python: >=3.11
|
|
13
|
+
Requires-Dist: agentledger-runtime<2,>=1.3
|
|
14
|
+
Description-Content-Type: text/markdown
|
|
15
|
+
|
|
16
|
+
# agentledger-inspector
|
|
17
|
+
|
|
18
|
+
Read-only Inspector and evidence viewer package for AgentLedger.
|
|
19
|
+
|
|
20
|
+
This package is language-neutral. It is implemented once as a companion evidence consumer and can inspect evidence/runtime metadata produced by Python, Go, TypeScript, or Rust implementations when they follow the AgentLedger contract.
|
|
21
|
+
|
|
22
|
+
```bash
|
|
23
|
+
pip install agentledger-inspector
|
|
24
|
+
pip install "agentledger-runtime[inspector]"
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
Inspect a local runtime database:
|
|
28
|
+
|
|
29
|
+
```bash
|
|
30
|
+
agentledger inspector run <run_id> --root .agentledger --html ./inspector.html
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
Inspect an exported evidence bundle:
|
|
34
|
+
|
|
35
|
+
```bash
|
|
36
|
+
agentledger inspector evidence ./evidence/<run_id> --html ./inspector.html
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
For Postgres or MySQL, use a read-only database credential and pass the local blob root that contains the referenced payload blobs. Inspector uses read-only store wrappers and does not run migrations or create tables:
|
|
40
|
+
|
|
41
|
+
```bash
|
|
42
|
+
agentledger inspector run <run_id> --backend postgres --dsn "$AGENTLEDGER_POSTGRES_DSN" --blob-root .agentledger/blobs --html ./inspector.html
|
|
43
|
+
agentledger inspector run <run_id> --backend mysql --dsn "$AGENTLEDGER_MYSQL_DSN" --blob-root .agentledger/blobs --html ./inspector.html
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
The Inspector does not start a server, mutate runtime state, call tools, approve requests, or contact model providers. It builds a language-neutral read model from AgentLedger runtime metadata or exported evidence bundles. AgentLedger does not add a separate permission layer for Inspector; use database grants, filesystem ACLs, and deployment policy.
|
|
47
|
+
|
|
48
|
+
Extension API:
|
|
49
|
+
|
|
50
|
+
```python
|
|
51
|
+
from agentledger_inspector import EvidenceBlobStoreProtocol, EvidenceStateStoreProtocol, InspectorDataSource, InspectorReportBuilder
|
|
52
|
+
|
|
53
|
+
report = InspectorDataSource().from_evidence_path("./evidence/run-1")
|
|
54
|
+
data = report.to_dict()
|
|
55
|
+
html = report.to_html()
|
|
56
|
+
|
|
57
|
+
builder = InspectorReportBuilder()
|
|
58
|
+
custom_report = builder.from_evidence_path("./evidence/run-1")
|
|
59
|
+
|
|
60
|
+
custom_source_report = InspectorDataSource().from_runtime_store(
|
|
61
|
+
store=my_read_only_state_store,
|
|
62
|
+
blobs=my_read_only_blob_store,
|
|
63
|
+
run_id="run_123",
|
|
64
|
+
)
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
The default HTML renderer is a reference renderer. Users can build their own UI by consuming `InspectorReport.to_dict()` and preserving `schema_version == agentledger.inspector.v1`.
|
|
68
|
+
|
|
69
|
+
`EvidenceStateStoreProtocol` and `EvidenceBlobStoreProtocol` describe the minimal read API for custom database/blob backends.
|
|
70
|
+
|
|
71
|
+
Custom viewers should depend on the read model and protocols instead of undocumented SQL tables. Keep write/control actions outside Inspector surfaces; use runtime APIs for approve, deny, cancel, or recover operations.
|
|
72
|
+
|
|
73
|
+
Runnable custom-viewer example:
|
|
74
|
+
|
|
75
|
+
```bash
|
|
76
|
+
git clone https://github.com/yaogdu/AgentLedger.git
|
|
77
|
+
cd AgentLedger
|
|
78
|
+
PYTHONPATH=src python3 examples/inspector/custom_viewer.py
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
That example creates a temporary runtime, reads SQLite metadata, exports an evidence bundle, writes JSON/HTML reports, and builds a compact custom UI/API payload from `InspectorReport.to_dict()`.
|
|
82
|
+
|
|
83
|
+
Security note: Inspector output may include tool arguments, model metadata, artifact references, approval reasons, and failure details. Treat exported JSON/HTML as sensitive operational evidence.
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
# agentledger-inspector
|
|
2
|
+
|
|
3
|
+
Read-only Inspector and evidence viewer package for AgentLedger.
|
|
4
|
+
|
|
5
|
+
This package is language-neutral. It is implemented once as a companion evidence consumer and can inspect evidence/runtime metadata produced by Python, Go, TypeScript, or Rust implementations when they follow the AgentLedger contract.
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
pip install agentledger-inspector
|
|
9
|
+
pip install "agentledger-runtime[inspector]"
|
|
10
|
+
```
|
|
11
|
+
|
|
12
|
+
Inspect a local runtime database:
|
|
13
|
+
|
|
14
|
+
```bash
|
|
15
|
+
agentledger inspector run <run_id> --root .agentledger --html ./inspector.html
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
Inspect an exported evidence bundle:
|
|
19
|
+
|
|
20
|
+
```bash
|
|
21
|
+
agentledger inspector evidence ./evidence/<run_id> --html ./inspector.html
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
For Postgres or MySQL, use a read-only database credential and pass the local blob root that contains the referenced payload blobs. Inspector uses read-only store wrappers and does not run migrations or create tables:
|
|
25
|
+
|
|
26
|
+
```bash
|
|
27
|
+
agentledger inspector run <run_id> --backend postgres --dsn "$AGENTLEDGER_POSTGRES_DSN" --blob-root .agentledger/blobs --html ./inspector.html
|
|
28
|
+
agentledger inspector run <run_id> --backend mysql --dsn "$AGENTLEDGER_MYSQL_DSN" --blob-root .agentledger/blobs --html ./inspector.html
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
The Inspector does not start a server, mutate runtime state, call tools, approve requests, or contact model providers. It builds a language-neutral read model from AgentLedger runtime metadata or exported evidence bundles. AgentLedger does not add a separate permission layer for Inspector; use database grants, filesystem ACLs, and deployment policy.
|
|
32
|
+
|
|
33
|
+
Extension API:
|
|
34
|
+
|
|
35
|
+
```python
|
|
36
|
+
from agentledger_inspector import EvidenceBlobStoreProtocol, EvidenceStateStoreProtocol, InspectorDataSource, InspectorReportBuilder
|
|
37
|
+
|
|
38
|
+
report = InspectorDataSource().from_evidence_path("./evidence/run-1")
|
|
39
|
+
data = report.to_dict()
|
|
40
|
+
html = report.to_html()
|
|
41
|
+
|
|
42
|
+
builder = InspectorReportBuilder()
|
|
43
|
+
custom_report = builder.from_evidence_path("./evidence/run-1")
|
|
44
|
+
|
|
45
|
+
custom_source_report = InspectorDataSource().from_runtime_store(
|
|
46
|
+
store=my_read_only_state_store,
|
|
47
|
+
blobs=my_read_only_blob_store,
|
|
48
|
+
run_id="run_123",
|
|
49
|
+
)
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
The default HTML renderer is a reference renderer. Users can build their own UI by consuming `InspectorReport.to_dict()` and preserving `schema_version == agentledger.inspector.v1`.
|
|
53
|
+
|
|
54
|
+
`EvidenceStateStoreProtocol` and `EvidenceBlobStoreProtocol` describe the minimal read API for custom database/blob backends.
|
|
55
|
+
|
|
56
|
+
Custom viewers should depend on the read model and protocols instead of undocumented SQL tables. Keep write/control actions outside Inspector surfaces; use runtime APIs for approve, deny, cancel, or recover operations.
|
|
57
|
+
|
|
58
|
+
Runnable custom-viewer example:
|
|
59
|
+
|
|
60
|
+
```bash
|
|
61
|
+
git clone https://github.com/yaogdu/AgentLedger.git
|
|
62
|
+
cd AgentLedger
|
|
63
|
+
PYTHONPATH=src python3 examples/inspector/custom_viewer.py
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
That example creates a temporary runtime, reads SQLite metadata, exports an evidence bundle, writes JSON/HTML reports, and builds a compact custom UI/API payload from `InspectorReport.to_dict()`.
|
|
67
|
+
|
|
68
|
+
Security note: Inspector output may include tool arguments, model metadata, artifact references, approval reasons, and failure details. Treat exported JSON/HTML as sensitive operational evidence.
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
[build-system]
|
|
2
|
+
requires = ["hatchling"]
|
|
3
|
+
build-backend = "hatchling.build"
|
|
4
|
+
|
|
5
|
+
[project]
|
|
6
|
+
name = "agentledger-inspector"
|
|
7
|
+
version = "1.3.0"
|
|
8
|
+
description = "Read-only Inspector and evidence viewer package for AgentLedger"
|
|
9
|
+
readme = "README.md"
|
|
10
|
+
requires-python = ">=3.11"
|
|
11
|
+
license = {text = "Apache-2.0"}
|
|
12
|
+
authors = [{name = "AgentLedger Contributors"}]
|
|
13
|
+
keywords = ["agents", "runtime", "inspector", "debug", "evidence"]
|
|
14
|
+
dependencies = ["agentledger-runtime>=1.3,<2"]
|
|
15
|
+
|
|
16
|
+
[project.urls]
|
|
17
|
+
Homepage = "https://github.com/yaogdu/AgentLedger"
|
|
18
|
+
Repository = "https://github.com/yaogdu/AgentLedger"
|
|
19
|
+
Documentation = "https://github.com/yaogdu/AgentLedger/tree/main/docs"
|
|
20
|
+
Issues = "https://github.com/yaogdu/AgentLedger/issues"
|
|
21
|
+
|
|
22
|
+
[tool.hatch.build.targets.wheel]
|
|
23
|
+
packages = ["src/agentledger_inspector"]
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"""Read-only Inspector package for AgentLedger."""
|
|
2
|
+
|
|
3
|
+
__version__ = "1.3.0"
|
|
4
|
+
|
|
5
|
+
from agentledger.inspector import INSPECTOR_SCHEMA_VERSION, InspectorDataSource, InspectorReport, InspectorReportBuilder, ReadOnlyLocalBlobStore, ReadOnlyMySQLStore, ReadOnlyPostgresStore, ReadOnlySQLiteStore
|
|
6
|
+
from agentledger.protocol import EvidenceBlobStoreProtocol, EvidenceStateStoreProtocol
|
|
7
|
+
|
|
8
|
+
__all__ = [
|
|
9
|
+
"INSPECTOR_SCHEMA_VERSION",
|
|
10
|
+
"EvidenceBlobStoreProtocol",
|
|
11
|
+
"EvidenceStateStoreProtocol",
|
|
12
|
+
"InspectorDataSource",
|
|
13
|
+
"InspectorReport",
|
|
14
|
+
"InspectorReportBuilder",
|
|
15
|
+
"ReadOnlyLocalBlobStore",
|
|
16
|
+
"ReadOnlyMySQLStore",
|
|
17
|
+
"ReadOnlyPostgresStore",
|
|
18
|
+
"ReadOnlySQLiteStore",
|
|
19
|
+
"__version__",
|
|
20
|
+
]
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
def test_imports() -> None:
|
|
2
|
+
from agentledger_inspector import INSPECTOR_SCHEMA_VERSION, EvidenceStateStoreProtocol, InspectorDataSource, InspectorReportBuilder, ReadOnlyPostgresStore
|
|
3
|
+
|
|
4
|
+
assert INSPECTOR_SCHEMA_VERSION == "agentledger.inspector.v1"
|
|
5
|
+
assert EvidenceStateStoreProtocol.__name__ == "EvidenceStateStoreProtocol"
|
|
6
|
+
assert InspectorDataSource.__name__ == "InspectorDataSource"
|
|
7
|
+
assert InspectorReportBuilder.__name__ == "InspectorReportBuilder"
|
|
8
|
+
assert ReadOnlyPostgresStore.__name__ == "ReadOnlyPostgresStore"
|