rfnry-thread 0.1.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.
- rfnry_thread-0.1.0/.gitignore +15 -0
- rfnry_thread-0.1.0/LICENSE +21 -0
- rfnry_thread-0.1.0/PKG-INFO +30 -0
- rfnry_thread-0.1.0/README.md +6 -0
- rfnry_thread-0.1.0/pyproject.toml +72 -0
- rfnry_thread-0.1.0/src/rfnry_thread/__init__.py +108 -0
- rfnry_thread-0.1.0/src/rfnry_thread/client.py +749 -0
- rfnry_thread-0.1.0/src/rfnry_thread/connection.py +9 -0
- rfnry_thread-0.1.0/src/rfnry_thread/errors.py +47 -0
- rfnry_thread-0.1.0/src/rfnry_thread/hub.py +433 -0
- rfnry_thread-0.1.0/src/rfnry_thread/models.py +286 -0
- rfnry_thread-0.1.0/src/rfnry_thread/outbound.py +103 -0
- rfnry_thread-0.1.0/src/rfnry_thread/pipe.py +45 -0
- rfnry_thread-0.1.0/src/rfnry_thread/postgres.py +580 -0
- rfnry_thread-0.1.0/src/rfnry_thread/protocol.py +98 -0
- rfnry_thread-0.1.0/src/rfnry_thread/py.typed +0 -0
- rfnry_thread-0.1.0/src/rfnry_thread/resolve.py +26 -0
- rfnry_thread-0.1.0/src/rfnry_thread/server.py +407 -0
- rfnry_thread-0.1.0/src/rfnry_thread/state.py +193 -0
- rfnry_thread-0.1.0/src/rfnry_thread/storage.py +84 -0
- rfnry_thread-0.1.0/src/rfnry_thread/tools.py +199 -0
- rfnry_thread-0.1.0/src/rfnry_thread/verbs.py +436 -0
- rfnry_thread-0.1.0/src/rfnry_thread/websocket.py +57 -0
- rfnry_thread-0.1.0/tests/conftest.py +66 -0
- rfnry_thread-0.1.0/tests/database.py +14 -0
- rfnry_thread-0.1.0/tests/e2e/__init__.py +0 -0
- rfnry_thread-0.1.0/tests/e2e/conftest.py +9 -0
- rfnry_thread-0.1.0/tests/e2e/test_typescript.py +104 -0
- rfnry_thread-0.1.0/tests/fixtures/protocol/error-forbidden.json +8 -0
- rfnry_thread-0.1.0/tests/fixtures/protocol/hello-response.json +13 -0
- rfnry_thread-0.1.0/tests/fixtures/protocol/hello-wrong-protocol.json +8 -0
- rfnry_thread-0.1.0/tests/fixtures/protocol/hello.json +4 -0
- rfnry_thread-0.1.0/tests/fixtures/protocol/notify-stream-delta.json +11 -0
- rfnry_thread-0.1.0/tests/fixtures/protocol/push-event-custom.json +24 -0
- rfnry_thread-0.1.0/tests/fixtures/protocol/push-event-edit.json +27 -0
- rfnry_thread-0.1.0/tests/fixtures/protocol/push-event-member-added.json +26 -0
- rfnry_thread-0.1.0/tests/fixtures/protocol/push-event-member-removed.json +26 -0
- rfnry_thread-0.1.0/tests/fixtures/protocol/push-event-message-metadata.json +39 -0
- rfnry_thread-0.1.0/tests/fixtures/protocol/push-event-message.json +33 -0
- rfnry_thread-0.1.0/tests/fixtures/protocol/push-event-read.json +21 -0
- rfnry_thread-0.1.0/tests/fixtures/protocol/push-event-retract.json +21 -0
- rfnry_thread-0.1.0/tests/fixtures/protocol/push-event-step.json +37 -0
- rfnry_thread-0.1.0/tests/fixtures/protocol/push-event-thread-updated.json +23 -0
- rfnry_thread-0.1.0/tests/fixtures/protocol/push-joined.json +16 -0
- rfnry_thread-0.1.0/tests/fixtures/protocol/push-signal-cancel.json +20 -0
- rfnry_thread-0.1.0/tests/fixtures/protocol/push-signal-idle.json +14 -0
- rfnry_thread-0.1.0/tests/fixtures/protocol/push-signal-invited.json +22 -0
- rfnry_thread-0.1.0/tests/fixtures/protocol/push-signal-left.json +14 -0
- rfnry_thread-0.1.0/tests/fixtures/protocol/push-signal-marked.json +16 -0
- rfnry_thread-0.1.0/tests/fixtures/protocol/push-signal-present.json +14 -0
- rfnry_thread-0.1.0/tests/fixtures/protocol/push-signal-stream-delta.json +17 -0
- rfnry_thread-0.1.0/tests/fixtures/protocol/push-signal-stream-end.json +15 -0
- rfnry_thread-0.1.0/tests/fixtures/protocol/push-signal-stream-start.json +16 -0
- rfnry_thread-0.1.0/tests/fixtures/protocol/push-signal-thread-deleted.json +14 -0
- rfnry_thread-0.1.0/tests/fixtures/protocol/push-signal-working.json +15 -0
- rfnry_thread-0.1.0/tests/fixtures/protocol/request-event-send.json +23 -0
- rfnry_thread-0.1.0/tests/fixtures/protocol/request-thread-follow.json +11 -0
- rfnry_thread-0.1.0/tests/fixtures/protocol/request-thread-join-resume.json +10 -0
- rfnry_thread-0.1.0/tests/fixtures/protocol/request-thread-join.json +9 -0
- rfnry_thread-0.1.0/tests/fixtures/protocol/request-thread-mark.json +9 -0
- rfnry_thread-0.1.0/tests/fixtures/protocol/request-thread-marked.json +8 -0
- rfnry_thread-0.1.0/tests/fixtures/protocol/response-thread-follow.json +20 -0
- rfnry_thread-0.1.0/tests/fixtures/protocol/response-thread-join.json +16 -0
- rfnry_thread-0.1.0/tests/fixtures/protocol/response-thread-mark.json +8 -0
- rfnry_thread-0.1.0/tests/fixtures/protocol/response-thread-marked.json +7 -0
- rfnry_thread-0.1.0/tests/integration/__init__.py +0 -0
- rfnry_thread-0.1.0/tests/integration/test_replicas.py +315 -0
- rfnry_thread-0.1.0/tests/integration/test_storage.py +455 -0
- rfnry_thread-0.1.0/tests/integration/test_tenancy.py +70 -0
- rfnry_thread-0.1.0/tests/unit/__init__.py +0 -0
- rfnry_thread-0.1.0/tests/unit/conftest.py +28 -0
- rfnry_thread-0.1.0/tests/unit/factories.py +34 -0
- rfnry_thread-0.1.0/tests/unit/hubkit.py +34 -0
- rfnry_thread-0.1.0/tests/unit/peer.py +75 -0
- rfnry_thread-0.1.0/tests/unit/test_api.py +236 -0
- rfnry_thread-0.1.0/tests/unit/test_client.py +642 -0
- rfnry_thread-0.1.0/tests/unit/test_docs.py +44 -0
- rfnry_thread-0.1.0/tests/unit/test_docs_examples.py +114 -0
- rfnry_thread-0.1.0/tests/unit/test_errors.py +45 -0
- rfnry_thread-0.1.0/tests/unit/test_family.py +45 -0
- rfnry_thread-0.1.0/tests/unit/test_follow.py +540 -0
- rfnry_thread-0.1.0/tests/unit/test_golden.py +232 -0
- rfnry_thread-0.1.0/tests/unit/test_hub.py +355 -0
- rfnry_thread-0.1.0/tests/unit/test_messages.py +105 -0
- rfnry_thread-0.1.0/tests/unit/test_models.py +43 -0
- rfnry_thread-0.1.0/tests/unit/test_outbound.py +127 -0
- rfnry_thread-0.1.0/tests/unit/test_protocol.py +66 -0
- rfnry_thread-0.1.0/tests/unit/test_public_api.py +150 -0
- rfnry_thread-0.1.0/tests/unit/test_redact.py +204 -0
- rfnry_thread-0.1.0/tests/unit/test_replicas.py +137 -0
- rfnry_thread-0.1.0/tests/unit/test_resolve.py +56 -0
- rfnry_thread-0.1.0/tests/unit/test_server.py +107 -0
- rfnry_thread-0.1.0/tests/unit/test_shapes.py +91 -0
- rfnry_thread-0.1.0/tests/unit/test_signals.py +253 -0
- rfnry_thread-0.1.0/tests/unit/test_socket.py +659 -0
- rfnry_thread-0.1.0/tests/unit/test_state.py +148 -0
- rfnry_thread-0.1.0/tests/unit/test_thread_tools.py +96 -0
- rfnry_thread-0.1.0/tests/unit/test_tools.py +42 -0
- rfnry_thread-0.1.0/tests/unit/test_verbs.py +564 -0
- rfnry_thread-0.1.0/tests/until.py +10 -0
- rfnry_thread-0.1.0/uv.lock +736 -0
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 rfnry (github.com/rfnry)
|
|
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.
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
Metadata-Version: 2.5
|
|
2
|
+
Name: rfnry-thread
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: Conversational text interfaces for humans and machines
|
|
5
|
+
Project-URL: Repository, https://github.com/rfnry/thread
|
|
6
|
+
Project-URL: Documentation, https://github.com/rfnry/thread/blob/main/docs/thread.md
|
|
7
|
+
Project-URL: Issues, https://github.com/rfnry/thread/issues
|
|
8
|
+
Author-email: rfnry <contact@rfnry.dev>
|
|
9
|
+
License-Expression: MIT
|
|
10
|
+
License-File: LICENSE
|
|
11
|
+
Requires-Python: >=3.12
|
|
12
|
+
Requires-Dist: pydantic>=2.13.4
|
|
13
|
+
Requires-Dist: websockets>=15.0
|
|
14
|
+
Provides-Extra: dev
|
|
15
|
+
Requires-Dist: asyncpg<1.0,>=0.31.0; extra == 'dev'
|
|
16
|
+
Requires-Dist: mypy>=2.3.1; extra == 'dev'
|
|
17
|
+
Requires-Dist: poethepoet>=0.48.0; extra == 'dev'
|
|
18
|
+
Requires-Dist: pytest-asyncio>=1.4.0; extra == 'dev'
|
|
19
|
+
Requires-Dist: pytest>=9.1.1; extra == 'dev'
|
|
20
|
+
Requires-Dist: ruff>=0.16.4; extra == 'dev'
|
|
21
|
+
Provides-Extra: postgres
|
|
22
|
+
Requires-Dist: asyncpg<1.0,>=0.31.0; extra == 'postgres'
|
|
23
|
+
Description-Content-Type: text/markdown
|
|
24
|
+
|
|
25
|
+
# rfnry-thread
|
|
26
|
+
|
|
27
|
+
Conversational text interfaces for humans and machines.
|
|
28
|
+
|
|
29
|
+
[`docs/thread.md`](https://github.com/rfnry/thread/blob/main/docs/thread.md).
|
|
30
|
+
[`docs/api.md`](https://github.com/rfnry/thread/blob/main/docs/api.md).
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
[project]
|
|
2
|
+
name = "rfnry-thread"
|
|
3
|
+
version = "0.1.0"
|
|
4
|
+
description = "Conversational text interfaces for humans and machines"
|
|
5
|
+
readme = "README.md"
|
|
6
|
+
license = "MIT"
|
|
7
|
+
requires-python = ">=3.12"
|
|
8
|
+
authors = [{name = "rfnry", email = "contact@rfnry.dev"}]
|
|
9
|
+
dependencies = [
|
|
10
|
+
"pydantic>=2.13.4",
|
|
11
|
+
"websockets>=15.0",
|
|
12
|
+
]
|
|
13
|
+
|
|
14
|
+
[project.urls]
|
|
15
|
+
Repository = "https://github.com/rfnry/thread"
|
|
16
|
+
Documentation = "https://github.com/rfnry/thread/blob/main/docs/thread.md"
|
|
17
|
+
Issues = "https://github.com/rfnry/thread/issues"
|
|
18
|
+
|
|
19
|
+
[project.optional-dependencies]
|
|
20
|
+
postgres = ["asyncpg>=0.31.0,<1.0"]
|
|
21
|
+
dev = [
|
|
22
|
+
"pytest>=9.1.1",
|
|
23
|
+
"pytest-asyncio>=1.4.0",
|
|
24
|
+
"ruff>=0.16.4",
|
|
25
|
+
"mypy>=2.3.1",
|
|
26
|
+
"poethepoet>=0.48.0",
|
|
27
|
+
"asyncpg>=0.31.0,<1.0",
|
|
28
|
+
]
|
|
29
|
+
|
|
30
|
+
[build-system]
|
|
31
|
+
requires = ["hatchling"]
|
|
32
|
+
build-backend = "hatchling.build"
|
|
33
|
+
|
|
34
|
+
[tool.hatch.build.targets.wheel]
|
|
35
|
+
packages = ["src/rfnry_thread"]
|
|
36
|
+
|
|
37
|
+
[tool.pytest.ini_options]
|
|
38
|
+
asyncio_mode = "auto"
|
|
39
|
+
testpaths = ["tests"]
|
|
40
|
+
pythonpath = ["src", "tests"]
|
|
41
|
+
markers = [
|
|
42
|
+
"live: runs the TypeScript client against a live server (needs node and npm)",
|
|
43
|
+
]
|
|
44
|
+
addopts = "-m 'not live'"
|
|
45
|
+
|
|
46
|
+
[tool.ruff]
|
|
47
|
+
line-length = 100
|
|
48
|
+
target-version = "py312"
|
|
49
|
+
|
|
50
|
+
[tool.ruff.lint]
|
|
51
|
+
select = ["E", "F", "I", "W", "B", "UP", "SIM"]
|
|
52
|
+
ignore = ["E501"]
|
|
53
|
+
|
|
54
|
+
[tool.ruff.lint.isort]
|
|
55
|
+
combine-as-imports = true
|
|
56
|
+
|
|
57
|
+
[tool.poe.tasks]
|
|
58
|
+
format = { cmd = "ruff format src tests" }
|
|
59
|
+
check = { cmd = "ruff check src tests" }
|
|
60
|
+
"check:fix" = { cmd = "ruff check --fix src tests" }
|
|
61
|
+
typecheck = { cmd = "mypy" }
|
|
62
|
+
test = { cmd = "pytest -q" }
|
|
63
|
+
"test:e2e" = { cmd = "pytest -q -m live" }
|
|
64
|
+
fixtures = { cmd = "pytest -q tests/unit/test_golden.py", env = { RFNRY_WRITE_FIXTURES = "1" } }
|
|
65
|
+
|
|
66
|
+
[tool.mypy]
|
|
67
|
+
strict = true
|
|
68
|
+
files = ["src/rfnry_thread", "tests"]
|
|
69
|
+
|
|
70
|
+
[[tool.mypy.overrides]]
|
|
71
|
+
module = "asyncpg.*"
|
|
72
|
+
ignore_missing_imports = true
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
from rfnry_thread.client import Client, Stream
|
|
2
|
+
from rfnry_thread.connection import Connection
|
|
3
|
+
from rfnry_thread.errors import (
|
|
4
|
+
ConfigurationError,
|
|
5
|
+
ForbiddenError,
|
|
6
|
+
InputError,
|
|
7
|
+
NotFoundError,
|
|
8
|
+
StorageError,
|
|
9
|
+
ThreadException,
|
|
10
|
+
TransportError,
|
|
11
|
+
)
|
|
12
|
+
from rfnry_thread.models import (
|
|
13
|
+
Audio,
|
|
14
|
+
Cancel,
|
|
15
|
+
Content,
|
|
16
|
+
Custom,
|
|
17
|
+
Document,
|
|
18
|
+
Edit,
|
|
19
|
+
Event,
|
|
20
|
+
Identity,
|
|
21
|
+
IdentityLike,
|
|
22
|
+
Idle,
|
|
23
|
+
Image,
|
|
24
|
+
Invited,
|
|
25
|
+
Joined,
|
|
26
|
+
Left,
|
|
27
|
+
Marked,
|
|
28
|
+
Member,
|
|
29
|
+
MemberAdded,
|
|
30
|
+
MemberRemoved,
|
|
31
|
+
Message,
|
|
32
|
+
Part,
|
|
33
|
+
Present,
|
|
34
|
+
Read,
|
|
35
|
+
Retract,
|
|
36
|
+
Signal,
|
|
37
|
+
StatusChanged,
|
|
38
|
+
Step,
|
|
39
|
+
StreamDelta,
|
|
40
|
+
StreamEnd,
|
|
41
|
+
StreamStart,
|
|
42
|
+
Text,
|
|
43
|
+
Thread,
|
|
44
|
+
ThreadDeleted,
|
|
45
|
+
ThreadUpdated,
|
|
46
|
+
Working,
|
|
47
|
+
)
|
|
48
|
+
from rfnry_thread.postgres import PostgresStorage
|
|
49
|
+
from rfnry_thread.resolve import resolve
|
|
50
|
+
from rfnry_thread.server import Server
|
|
51
|
+
from rfnry_thread.storage import Storage
|
|
52
|
+
from rfnry_thread.tools import ThreadTools, Tool, Tools
|
|
53
|
+
|
|
54
|
+
__version__ = "0.1.0"
|
|
55
|
+
|
|
56
|
+
__all__ = [
|
|
57
|
+
"Server",
|
|
58
|
+
"Connection",
|
|
59
|
+
"Client",
|
|
60
|
+
"Stream",
|
|
61
|
+
"Joined",
|
|
62
|
+
"StatusChanged",
|
|
63
|
+
"Identity",
|
|
64
|
+
"IdentityLike",
|
|
65
|
+
"Thread",
|
|
66
|
+
"Member",
|
|
67
|
+
"Text",
|
|
68
|
+
"Image",
|
|
69
|
+
"Audio",
|
|
70
|
+
"Document",
|
|
71
|
+
"Part",
|
|
72
|
+
"Content",
|
|
73
|
+
"Message",
|
|
74
|
+
"Step",
|
|
75
|
+
"Edit",
|
|
76
|
+
"Retract",
|
|
77
|
+
"Read",
|
|
78
|
+
"MemberAdded",
|
|
79
|
+
"MemberRemoved",
|
|
80
|
+
"ThreadUpdated",
|
|
81
|
+
"Custom",
|
|
82
|
+
"Event",
|
|
83
|
+
"resolve",
|
|
84
|
+
"Working",
|
|
85
|
+
"Idle",
|
|
86
|
+
"StreamStart",
|
|
87
|
+
"StreamDelta",
|
|
88
|
+
"StreamEnd",
|
|
89
|
+
"Cancel",
|
|
90
|
+
"Present",
|
|
91
|
+
"Left",
|
|
92
|
+
"Invited",
|
|
93
|
+
"ThreadDeleted",
|
|
94
|
+
"Marked",
|
|
95
|
+
"Signal",
|
|
96
|
+
"ThreadTools",
|
|
97
|
+
"Tool",
|
|
98
|
+
"Tools",
|
|
99
|
+
"Storage",
|
|
100
|
+
"PostgresStorage",
|
|
101
|
+
"ThreadException",
|
|
102
|
+
"NotFoundError",
|
|
103
|
+
"InputError",
|
|
104
|
+
"ConfigurationError",
|
|
105
|
+
"ForbiddenError",
|
|
106
|
+
"StorageError",
|
|
107
|
+
"TransportError",
|
|
108
|
+
]
|