pi-durable-python 1.3.0__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.
- pi_durable/__init__.py +320 -0
- pi_durable/context.py +328 -0
- pi_durable/delta.py +269 -0
- pi_durable/documents.py +366 -0
- pi_durable/entries.py +66 -0
- pi_durable/env/__init__.py +408 -0
- pi_durable/env/decode.py +48 -0
- pi_durable/env/line_scan.py +190 -0
- pi_durable/env/posix.py +1547 -0
- pi_durable/errors.py +89 -0
- pi_durable/harness/__init__.py +1 -0
- pi_durable/harness/agent.py +344 -0
- pi_durable/harness/compaction.py +673 -0
- pi_durable/harness/context.py +515 -0
- pi_durable/harness/define.py +111 -0
- pi_durable/harness/events.py +766 -0
- pi_durable/harness/generation.py +1079 -0
- pi_durable/harness/harness.py +570 -0
- pi_durable/harness/inbox.py +255 -0
- pi_durable/harness/live.py +374 -0
- pi_durable/harness/output.py +467 -0
- pi_durable/harness/prompt.py +288 -0
- pi_durable/harness/provider.py +78 -0
- pi_durable/harness/registry.py +136 -0
- pi_durable/harness/scheduler.py +1977 -0
- pi_durable/harness/submissions.py +357 -0
- pi_durable/harness/task_graph.py +334 -0
- pi_durable/harness/tool.py +1365 -0
- pi_durable/harness/types.py +772 -0
- pi_durable/harness/usage.py +88 -0
- pi_durable/harness/util.py +204 -0
- pi_durable/harness/validation.py +460 -0
- pi_durable/harness/view.py +324 -0
- pi_durable/ids.py +63 -0
- pi_durable/json.py +186 -0
- pi_durable/providers/__init__.py +362 -0
- pi_durable/providers/anthropic.py +603 -0
- pi_durable/providers/base.py +97 -0
- pi_durable/providers/json_parse.py +117 -0
- pi_durable/providers/openai.py +574 -0
- pi_durable/providers/request.py +35 -0
- pi_durable/providers/retry.py +127 -0
- pi_durable/providers/stream.py +183 -0
- pi_durable/providers/transcript.py +224 -0
- pi_durable/providers/usage.py +58 -0
- pi_durable/py.typed +0 -0
- pi_durable/search.py +115 -0
- pi_durable/session/__init__.py +5 -0
- pi_durable/session/drafts.py +762 -0
- pi_durable/session/forks.py +109 -0
- pi_durable/session/observation.py +374 -0
- pi_durable/session/session.py +1193 -0
- pi_durable/session/transaction.py +1088 -0
- pi_durable/storage/__init__.py +5 -0
- pi_durable/storage/jsonl/__init__.py +15 -0
- pi_durable/storage/jsonl/storage.py +958 -0
- pi_durable/storage/memory.py +889 -0
- pi_durable/storage/scan.py +57 -0
- pi_durable/storage/sqlite/__init__.py +26 -0
- pi_durable/storage/sqlite/database.py +62 -0
- pi_durable/storage/sqlite/migrations.py +191 -0
- pi_durable/storage/sqlite/posix.py +314 -0
- pi_durable/storage/sqlite/schema.py +97 -0
- pi_durable/storage/sqlite/storage.py +1130 -0
- pi_durable/tasks.py +89 -0
- pi_durable/testing/__init__.py +41 -0
- pi_durable/testing/assertions.py +44 -0
- pi_durable/testing/env_conformance.py +828 -0
- pi_durable/testing/runner.py +64 -0
- pi_durable/testing/storage_conformance.py +2008 -0
- pi_durable/testing/types.py +99 -0
- pi_durable/tool_search/__init__.py +159 -0
- pi_durable/tools/__init__.py +81 -0
- pi_durable/tools/_values.py +43 -0
- pi_durable/tools/bash.py +250 -0
- pi_durable/tools/edit.py +214 -0
- pi_durable/tools/edit_diff.py +452 -0
- pi_durable/tools/env.py +19 -0
- pi_durable/tools/file_mutation_queue.py +68 -0
- pi_durable/tools/image.py +248 -0
- pi_durable/tools/image_processor.py +77 -0
- pi_durable/tools/path_utils.py +111 -0
- pi_durable/tools/read.py +506 -0
- pi_durable/tools/write.py +71 -0
- pi_durable/truncate.py +185 -0
- pi_durable/types.py +1297 -0
- pi_durable_python-1.3.0.dist-info/METADATA +276 -0
- pi_durable_python-1.3.0.dist-info/RECORD +90 -0
- pi_durable_python-1.3.0.dist-info/WHEEL +4 -0
- pi_durable_python-1.3.0.dist-info/licenses/LICENSE +21 -0
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
"""Register the runner-independent conformance cases with a test runner."""
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
|
|
5
|
+
from typing import Any, cast
|
|
6
|
+
|
|
7
|
+
from .assertions import create_expect_assertions
|
|
8
|
+
from .env_conformance import create_env_conformance
|
|
9
|
+
from .storage_conformance import create_storage_conformance
|
|
10
|
+
from .types import (
|
|
11
|
+
EnvConformanceOptions,
|
|
12
|
+
EnvConformanceProvider,
|
|
13
|
+
StorageConformanceProvider,
|
|
14
|
+
StorageConformanceRunner,
|
|
15
|
+
)
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
def register_storage_conformance(
|
|
19
|
+
runner: StorageConformanceRunner,
|
|
20
|
+
name: str,
|
|
21
|
+
with_storage: StorageConformanceProvider,
|
|
22
|
+
) -> None:
|
|
23
|
+
"""Register the runner-independent cases with a Vitest/Jest-compatible test runner."""
|
|
24
|
+
|
|
25
|
+
cases = create_storage_conformance(
|
|
26
|
+
{
|
|
27
|
+
"assertions": create_expect_assertions(runner.expect),
|
|
28
|
+
"with_storage": with_storage,
|
|
29
|
+
}
|
|
30
|
+
)
|
|
31
|
+
|
|
32
|
+
def suite() -> None:
|
|
33
|
+
for test_case in cases:
|
|
34
|
+
runner.it(test_case.name, test_case.run)
|
|
35
|
+
|
|
36
|
+
runner.describe(name, suite)
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
def register_env_conformance(
|
|
40
|
+
runner: StorageConformanceRunner,
|
|
41
|
+
name: str,
|
|
42
|
+
with_env: EnvConformanceProvider,
|
|
43
|
+
options: dict[str, Any] | None = None,
|
|
44
|
+
) -> None:
|
|
45
|
+
"""Register the runner-independent environment cases with a compatible test runner."""
|
|
46
|
+
|
|
47
|
+
input_options = cast(
|
|
48
|
+
EnvConformanceOptions,
|
|
49
|
+
{
|
|
50
|
+
"assertions": create_expect_assertions(runner.expect),
|
|
51
|
+
"with_env": with_env,
|
|
52
|
+
**(options or {}),
|
|
53
|
+
},
|
|
54
|
+
)
|
|
55
|
+
cases = create_env_conformance(input_options)
|
|
56
|
+
|
|
57
|
+
def suite() -> None:
|
|
58
|
+
for test_case in cases:
|
|
59
|
+
runner.it(test_case.name, test_case.run, test_case.timeout_ms)
|
|
60
|
+
|
|
61
|
+
runner.describe(name, suite)
|
|
62
|
+
|
|
63
|
+
|
|
64
|
+
__all__ = ["register_env_conformance", "register_storage_conformance"]
|