narada 0.2.7__tar.gz → 0.2.8__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.
- {narada-0.2.7 → narada-0.2.8}/PKG-INFO +2 -2
- {narada-0.2.7 → narada-0.2.8}/pyproject.toml +2 -2
- narada-0.2.8/tests/test_action_trace.py +80 -0
- {narada-0.2.7 → narada-0.2.8}/.gitignore +0 -0
- {narada-0.2.7 → narada-0.2.8}/README.md +0 -0
- {narada-0.2.7 → narada-0.2.8}/src/narada/__init__.py +0 -0
- {narada-0.2.7 → narada-0.2.8}/src/narada/agent.py +0 -0
- {narada-0.2.7 → narada-0.2.8}/src/narada/config.py +0 -0
- {narada-0.2.7 → narada-0.2.8}/src/narada/environment.py +0 -0
- {narada-0.2.7 → narada-0.2.8}/src/narada/py.typed +0 -0
- {narada-0.2.7 → narada-0.2.8}/src/narada/utils.py +0 -0
- {narada-0.2.7 → narada-0.2.8}/src/narada/version.py +0 -0
- {narada-0.2.7 → narada-0.2.8}/tests/test_agent.py +0 -0
- {narada-0.2.7 → narada-0.2.8}/tests/test_browser_environment_login.py +0 -0
- {narada-0.2.7 → narada-0.2.8}/tests/test_client.py +0 -0
- {narada-0.2.7 → narada-0.2.8}/tests/test_cloud_browser.py +0 -0
- {narada-0.2.7 → narada-0.2.8}/tests/test_input_variables.py +0 -0
- {narada-0.2.7 → narada-0.2.8}/tests/test_window_human_interaction.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: narada
|
|
3
|
-
Version: 0.2.
|
|
3
|
+
Version: 0.2.8
|
|
4
4
|
Summary: Python client SDK for Narada
|
|
5
5
|
Project-URL: Homepage, https://github.com/NaradaAI/narada-python-sdk/narada
|
|
6
6
|
Project-URL: Repository, https://github.com/NaradaAI/narada-python-sdk
|
|
@@ -9,7 +9,7 @@ Author-email: Narada <support@narada.ai>
|
|
|
9
9
|
License-Expression: Apache-2.0
|
|
10
10
|
Requires-Python: >=3.12
|
|
11
11
|
Requires-Dist: aiohttp>=3.12.13
|
|
12
|
-
Requires-Dist: narada-core==0.1.
|
|
12
|
+
Requires-Dist: narada-core==0.1.5
|
|
13
13
|
Requires-Dist: packaging==24.2
|
|
14
14
|
Requires-Dist: playwright>=1.53.0
|
|
15
15
|
Requires-Dist: rich>=14.0.0
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
[project]
|
|
2
2
|
name = "narada"
|
|
3
|
-
version = "0.2.
|
|
3
|
+
version = "0.2.8"
|
|
4
4
|
description = "Python client SDK for Narada"
|
|
5
5
|
license = "Apache-2.0"
|
|
6
6
|
readme = "README.md"
|
|
7
7
|
authors = [{ name = "Narada", email = "support@narada.ai" }]
|
|
8
8
|
requires-python = ">=3.12"
|
|
9
9
|
dependencies = [
|
|
10
|
-
"narada-core==0.1.
|
|
10
|
+
"narada-core==0.1.5",
|
|
11
11
|
"aiohttp>=3.12.13",
|
|
12
12
|
"playwright>=1.53.0",
|
|
13
13
|
"rich>=14.0.0",
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
|
|
3
|
+
import pytest
|
|
4
|
+
from narada_core.tracing.model import OperatorActionTraceItem, parse_action_trace
|
|
5
|
+
from pydantic import ValidationError
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
def test_parse_operator_action_trace_exposes_timestamps() -> None:
|
|
9
|
+
trace = parse_action_trace(
|
|
10
|
+
[
|
|
11
|
+
{
|
|
12
|
+
"url": "https://example.com",
|
|
13
|
+
"action": "Clicked Submit",
|
|
14
|
+
"startTs": "2026-07-20T17:00:00.000Z",
|
|
15
|
+
"endTs": "2026-07-20T17:00:01.500Z",
|
|
16
|
+
"durationMs": 1_500,
|
|
17
|
+
}
|
|
18
|
+
]
|
|
19
|
+
)
|
|
20
|
+
|
|
21
|
+
item = trace[0]
|
|
22
|
+
assert isinstance(item, OperatorActionTraceItem)
|
|
23
|
+
assert item.start_ts == "2026-07-20T17:00:00.000Z"
|
|
24
|
+
assert item.end_ts == "2026-07-20T17:00:01.500Z"
|
|
25
|
+
assert item.duration_ms == 1_500
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
@pytest.mark.parametrize(
|
|
29
|
+
"timestamps",
|
|
30
|
+
[
|
|
31
|
+
{"startTs": "2026-07-20T17:00:00.000Z", "durationMs": 1_000},
|
|
32
|
+
{"endTs": "2026-07-20T17:00:01.000Z", "durationMs": 1_000},
|
|
33
|
+
{
|
|
34
|
+
"startTs": "2026-07-20T17:00:02.000Z",
|
|
35
|
+
"endTs": "2026-07-20T17:00:01.000Z",
|
|
36
|
+
"durationMs": 0,
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
"startTs": "not-a-timestamp",
|
|
40
|
+
"endTs": "2026-07-20T17:00:01.000Z",
|
|
41
|
+
"durationMs": 1_000,
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
"startTs": "2026-07-20T17:00:00",
|
|
45
|
+
"endTs": "2026-07-20T17:00:01",
|
|
46
|
+
"durationMs": 1_000,
|
|
47
|
+
},
|
|
48
|
+
{"startTs": 1_000, "endTs": 2_000, "durationMs": 1_000},
|
|
49
|
+
{
|
|
50
|
+
"startTs": "2026-07-20T17:00:00.000Z",
|
|
51
|
+
"endTs": "2026-07-20T17:00:01.000Z",
|
|
52
|
+
},
|
|
53
|
+
{
|
|
54
|
+
"startTs": "2026-07-20T17:00:00.000Z",
|
|
55
|
+
"endTs": "2026-07-20T17:00:01.000Z",
|
|
56
|
+
"durationMs": 999,
|
|
57
|
+
},
|
|
58
|
+
],
|
|
59
|
+
)
|
|
60
|
+
def test_operator_action_trace_rejects_invalid_timing(
|
|
61
|
+
timestamps: dict[str, str | int],
|
|
62
|
+
) -> None:
|
|
63
|
+
with pytest.raises(ValidationError):
|
|
64
|
+
OperatorActionTraceItem(
|
|
65
|
+
url="https://example.com",
|
|
66
|
+
action="Clicked Submit",
|
|
67
|
+
**timestamps,
|
|
68
|
+
)
|
|
69
|
+
|
|
70
|
+
|
|
71
|
+
def test_operator_action_trace_accepts_explicit_utc_offset() -> None:
|
|
72
|
+
item = OperatorActionTraceItem(
|
|
73
|
+
url="https://example.com",
|
|
74
|
+
action="Clicked Submit",
|
|
75
|
+
startTs="2026-07-20T17:00:00.000+00:00",
|
|
76
|
+
endTs="2026-07-20T17:00:01.000+00:00",
|
|
77
|
+
durationMs=1_000,
|
|
78
|
+
)
|
|
79
|
+
|
|
80
|
+
assert item.start_ts.endswith("+00:00")
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|