homiagent 0.1.0a1__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.
- homiagent-0.1.0a1/PKG-INFO +56 -0
- homiagent-0.1.0a1/README.md +44 -0
- homiagent-0.1.0a1/pyproject.toml +33 -0
- homiagent-0.1.0a1/setup.cfg +4 -0
- homiagent-0.1.0a1/src/homiagent/__init__.py +5 -0
- homiagent-0.1.0a1/src/homiagent/contracts/__init__.py +1 -0
- homiagent-0.1.0a1/src/homiagent/contracts/memory/__init__.py +1 -0
- homiagent-0.1.0a1/src/homiagent/contracts/memory/events.py +52 -0
- homiagent-0.1.0a1/src/homiagent/contracts/memory/session.py +39 -0
- homiagent-0.1.0a1/src/homiagent/contracts/memory/worklog.py +156 -0
- homiagent-0.1.0a1/src/homiagent/rendering/__init__.py +1 -0
- homiagent-0.1.0a1/src/homiagent/rendering/worklog.py +74 -0
- homiagent-0.1.0a1/src/homiagent.egg-info/PKG-INFO +56 -0
- homiagent-0.1.0a1/src/homiagent.egg-info/SOURCES.txt +14 -0
- homiagent-0.1.0a1/src/homiagent.egg-info/dependency_links.txt +1 -0
- homiagent-0.1.0a1/src/homiagent.egg-info/top_level.txt +1 -0
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: homiagent
|
|
3
|
+
Version: 0.1.0a1
|
|
4
|
+
Summary: HomiAgent worklog data contracts and Markdown rendering
|
|
5
|
+
Project-URL: Repository, https://github.com/NativeAI-Group/HomiAgent
|
|
6
|
+
Keywords: embodied-ai,agents,memory,worklog
|
|
7
|
+
Classifier: Development Status :: 3 - Alpha
|
|
8
|
+
Classifier: Programming Language :: Python :: 3
|
|
9
|
+
Classifier: Programming Language :: Python :: 3 :: Only
|
|
10
|
+
Requires-Python: >=3.11
|
|
11
|
+
Description-Content-Type: text/markdown
|
|
12
|
+
|
|
13
|
+
# HomiAgent worklog preview
|
|
14
|
+
|
|
15
|
+
An early, independently usable subset of HomiAgent for representing session
|
|
16
|
+
worklogs and converting them to Markdown. It runs offline with Python 3.11 or
|
|
17
|
+
newer and requires no third-party runtime dependencies.
|
|
18
|
+
|
|
19
|
+
## Included functionality
|
|
20
|
+
|
|
21
|
+
- Immutable session, actor, evidence, worklog-entry and source-linked event types.
|
|
22
|
+
- Validation of record metadata, evidence paths, source spans and event ranges.
|
|
23
|
+
- Markdown export of worklog entries, corrections, events and session outcomes.
|
|
24
|
+
|
|
25
|
+
This preview does not include the HomiAgent memory API, Agent runtime, model
|
|
26
|
+
adapters, persistent storage, media processing, CLI or RoBIOS integration.
|
|
27
|
+
It does not create sessions on disk, extract events using a model or operate a robot.
|
|
28
|
+
|
|
29
|
+
## Example
|
|
30
|
+
|
|
31
|
+
```python
|
|
32
|
+
from homiagent.contracts.memory.session import SessionManifest
|
|
33
|
+
from homiagent.contracts.memory.worklog import Actor, WorkLogEntry
|
|
34
|
+
from homiagent.rendering.worklog import render_worklog
|
|
35
|
+
|
|
36
|
+
session = SessionManifest(
|
|
37
|
+
session_id="session_demo",
|
|
38
|
+
title="Kitchen task",
|
|
39
|
+
created_at="2026-11-26T00:00:00+00:00",
|
|
40
|
+
)
|
|
41
|
+
entry = WorkLogEntry(
|
|
42
|
+
seq=1,
|
|
43
|
+
entry_id="entry_1",
|
|
44
|
+
request_id="request_1",
|
|
45
|
+
recorded_at="2026-11-26T00:00:01+00:00",
|
|
46
|
+
kind="action_result",
|
|
47
|
+
actor=Actor("robot", "robot_demo"),
|
|
48
|
+
text="Placed the mug on the table.",
|
|
49
|
+
input_digest="demo-input-1",
|
|
50
|
+
)
|
|
51
|
+
markdown = render_worklog(session, [entry])
|
|
52
|
+
print(markdown)
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
The input digest is supplied by the caller. Rendering does not persist data or
|
|
56
|
+
check stored evidence files. These APIs may change in future releases.
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
# HomiAgent worklog preview
|
|
2
|
+
|
|
3
|
+
An early, independently usable subset of HomiAgent for representing session
|
|
4
|
+
worklogs and converting them to Markdown. It runs offline with Python 3.11 or
|
|
5
|
+
newer and requires no third-party runtime dependencies.
|
|
6
|
+
|
|
7
|
+
## Included functionality
|
|
8
|
+
|
|
9
|
+
- Immutable session, actor, evidence, worklog-entry and source-linked event types.
|
|
10
|
+
- Validation of record metadata, evidence paths, source spans and event ranges.
|
|
11
|
+
- Markdown export of worklog entries, corrections, events and session outcomes.
|
|
12
|
+
|
|
13
|
+
This preview does not include the HomiAgent memory API, Agent runtime, model
|
|
14
|
+
adapters, persistent storage, media processing, CLI or RoBIOS integration.
|
|
15
|
+
It does not create sessions on disk, extract events using a model or operate a robot.
|
|
16
|
+
|
|
17
|
+
## Example
|
|
18
|
+
|
|
19
|
+
```python
|
|
20
|
+
from homiagent.contracts.memory.session import SessionManifest
|
|
21
|
+
from homiagent.contracts.memory.worklog import Actor, WorkLogEntry
|
|
22
|
+
from homiagent.rendering.worklog import render_worklog
|
|
23
|
+
|
|
24
|
+
session = SessionManifest(
|
|
25
|
+
session_id="session_demo",
|
|
26
|
+
title="Kitchen task",
|
|
27
|
+
created_at="2026-11-26T00:00:00+00:00",
|
|
28
|
+
)
|
|
29
|
+
entry = WorkLogEntry(
|
|
30
|
+
seq=1,
|
|
31
|
+
entry_id="entry_1",
|
|
32
|
+
request_id="request_1",
|
|
33
|
+
recorded_at="2026-11-26T00:00:01+00:00",
|
|
34
|
+
kind="action_result",
|
|
35
|
+
actor=Actor("robot", "robot_demo"),
|
|
36
|
+
text="Placed the mug on the table.",
|
|
37
|
+
input_digest="demo-input-1",
|
|
38
|
+
)
|
|
39
|
+
markdown = render_worklog(session, [entry])
|
|
40
|
+
print(markdown)
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
The input digest is supplied by the caller. Rendering does not persist data or
|
|
44
|
+
check stored evidence files. These APIs may change in future releases.
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
[build-system]
|
|
2
|
+
requires = ["setuptools>=61"]
|
|
3
|
+
build-backend = "setuptools.build_meta"
|
|
4
|
+
|
|
5
|
+
[project]
|
|
6
|
+
name = "homiagent"
|
|
7
|
+
version = "0.1.0a1"
|
|
8
|
+
description = "HomiAgent worklog data contracts and Markdown rendering"
|
|
9
|
+
readme = "README.md"
|
|
10
|
+
requires-python = ">=3.11"
|
|
11
|
+
dependencies = []
|
|
12
|
+
keywords = ["embodied-ai", "agents", "memory", "worklog"]
|
|
13
|
+
classifiers = [
|
|
14
|
+
"Development Status :: 3 - Alpha",
|
|
15
|
+
"Programming Language :: Python :: 3",
|
|
16
|
+
"Programming Language :: Python :: 3 :: Only",
|
|
17
|
+
]
|
|
18
|
+
|
|
19
|
+
[project.urls]
|
|
20
|
+
Repository = "https://github.com/NativeAI-Group/HomiAgent"
|
|
21
|
+
|
|
22
|
+
[tool.setuptools.packages.find]
|
|
23
|
+
where = ["src"]
|
|
24
|
+
include = [
|
|
25
|
+
"homiagent",
|
|
26
|
+
"homiagent.contracts",
|
|
27
|
+
"homiagent.contracts.memory",
|
|
28
|
+
"homiagent.rendering",
|
|
29
|
+
]
|
|
30
|
+
namespaces = false
|
|
31
|
+
|
|
32
|
+
[tool.setuptools]
|
|
33
|
+
include-package-data = false
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"""Shared data contracts and module protocols."""
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"""Work logs, long-term records, candidates, and change proposals."""
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
"""Source-linked event descriptions derived from complete observation reports."""
|
|
2
|
+
|
|
3
|
+
from dataclasses import dataclass
|
|
4
|
+
from math import isfinite
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
@dataclass(frozen=True, slots=True)
|
|
8
|
+
class SourceSpan:
|
|
9
|
+
"""Python character offsets in the parent's UTF-8 decoded report."""
|
|
10
|
+
|
|
11
|
+
start: int
|
|
12
|
+
end: int
|
|
13
|
+
|
|
14
|
+
def __post_init__(self) -> None:
|
|
15
|
+
if (
|
|
16
|
+
type(self.start) is not int
|
|
17
|
+
or type(self.end) is not int
|
|
18
|
+
or not 0 <= self.start < self.end
|
|
19
|
+
):
|
|
20
|
+
raise ValueError("Source spans require integer offsets with 0 <= start < end")
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
@dataclass(frozen=True, slots=True)
|
|
24
|
+
class WorkLogEvent:
|
|
25
|
+
event_id: str
|
|
26
|
+
text: str
|
|
27
|
+
source_spans: tuple[SourceSpan, ...]
|
|
28
|
+
time_range: tuple[float, float] | None = None
|
|
29
|
+
|
|
30
|
+
def __post_init__(self) -> None:
|
|
31
|
+
if not isinstance(self.event_id, str) or not self.event_id.strip():
|
|
32
|
+
raise ValueError("Event ID must be nonempty")
|
|
33
|
+
if not isinstance(self.text, str) or not self.text.strip():
|
|
34
|
+
raise ValueError("Event description must be nonempty")
|
|
35
|
+
if (
|
|
36
|
+
not isinstance(self.source_spans, tuple)
|
|
37
|
+
or not self.source_spans
|
|
38
|
+
or any(not isinstance(s, SourceSpan) for s in self.source_spans)
|
|
39
|
+
):
|
|
40
|
+
raise ValueError("Events require original source spans")
|
|
41
|
+
if any(
|
|
42
|
+
a.end > b.start for a, b in zip(self.source_spans, self.source_spans[1:], strict=False)
|
|
43
|
+
):
|
|
44
|
+
raise ValueError("Event source spans must be ordered and nonoverlapping")
|
|
45
|
+
if self.time_range is not None:
|
|
46
|
+
if (
|
|
47
|
+
not isinstance(self.time_range, tuple)
|
|
48
|
+
or len(self.time_range) != 2
|
|
49
|
+
or any(type(t) not in (int, float) or not isfinite(t) for t in self.time_range)
|
|
50
|
+
or not 0 <= self.time_range[0] <= self.time_range[1]
|
|
51
|
+
):
|
|
52
|
+
raise ValueError("Event time range must contain finite ordered nonnegative seconds")
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
"""Session identity and fixed, caller-supplied task context."""
|
|
2
|
+
|
|
3
|
+
from dataclasses import dataclass, field
|
|
4
|
+
from datetime import UTC, datetime
|
|
5
|
+
from typing import Literal
|
|
6
|
+
|
|
7
|
+
SessionOutcome = Literal["completed", "failed", "cancelled"]
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
def utc_now() -> str:
|
|
11
|
+
return datetime.now(UTC).isoformat()
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
@dataclass(frozen=True, slots=True)
|
|
15
|
+
class SessionContext:
|
|
16
|
+
home_id: str | None = None
|
|
17
|
+
user_id: str | None = None
|
|
18
|
+
robot_id: str | None = None
|
|
19
|
+
|
|
20
|
+
def __post_init__(self) -> None:
|
|
21
|
+
for value in (self.home_id, self.user_id, self.robot_id):
|
|
22
|
+
if value is not None and (not isinstance(value, str) or not value.strip()):
|
|
23
|
+
raise ValueError("Context IDs must be nonempty strings or None")
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
@dataclass(frozen=True, slots=True)
|
|
27
|
+
class SessionManifest:
|
|
28
|
+
session_id: str
|
|
29
|
+
title: str
|
|
30
|
+
created_at: str = field(default_factory=utc_now)
|
|
31
|
+
context: SessionContext = field(default_factory=SessionContext)
|
|
32
|
+
schema_version: int = 1
|
|
33
|
+
|
|
34
|
+
def __post_init__(self) -> None:
|
|
35
|
+
if self.schema_version != 1:
|
|
36
|
+
raise ValueError("Unsupported session schema version")
|
|
37
|
+
if not self.session_id or not isinstance(self.title, str):
|
|
38
|
+
raise ValueError("Invalid session identity or title")
|
|
39
|
+
datetime.fromisoformat(self.created_at)
|
|
@@ -0,0 +1,156 @@
|
|
|
1
|
+
"""Immutable worklog records; media remains in managed evidence files."""
|
|
2
|
+
|
|
3
|
+
from dataclasses import dataclass
|
|
4
|
+
from datetime import datetime
|
|
5
|
+
from math import isfinite
|
|
6
|
+
from pathlib import PurePosixPath
|
|
7
|
+
from typing import Literal
|
|
8
|
+
|
|
9
|
+
from homiagent.contracts.memory.events import WorkLogEvent
|
|
10
|
+
from homiagent.contracts.memory.session import SessionOutcome
|
|
11
|
+
|
|
12
|
+
AudioStatus = Literal["transcribed", "no_speech", "no_audio_track", "no_audio_in_range"]
|
|
13
|
+
|
|
14
|
+
SummaryStatus = Literal["generated", "fallback"]
|
|
15
|
+
|
|
16
|
+
EntryKind = Literal["instruction", "observation", "action_result", "correction", "session_closed"]
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
@dataclass(frozen=True, slots=True)
|
|
20
|
+
class Actor:
|
|
21
|
+
type: Literal["user", "robot", "system"]
|
|
22
|
+
id: str | None = None
|
|
23
|
+
|
|
24
|
+
def __post_init__(self) -> None:
|
|
25
|
+
if self.type not in {"user", "robot", "system"}:
|
|
26
|
+
raise ValueError("Invalid actor type")
|
|
27
|
+
if self.id is not None and (not isinstance(self.id, str) or not self.id.strip()):
|
|
28
|
+
raise ValueError("Actor ID must be a nonempty string or None")
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
@dataclass(frozen=True, slots=True)
|
|
32
|
+
class EvidenceRef:
|
|
33
|
+
evidence_id: str
|
|
34
|
+
path: str
|
|
35
|
+
timestamp_s: float | None = None
|
|
36
|
+
|
|
37
|
+
def __post_init__(self) -> None:
|
|
38
|
+
path = PurePosixPath(self.path)
|
|
39
|
+
if (
|
|
40
|
+
not self.evidence_id
|
|
41
|
+
or path.is_absolute()
|
|
42
|
+
or ".." in path.parts
|
|
43
|
+
or not path.parts
|
|
44
|
+
or path.parts[0] != "evidence"
|
|
45
|
+
or "\\" in self.path
|
|
46
|
+
):
|
|
47
|
+
raise ValueError("Evidence requires a session-relative evidence path")
|
|
48
|
+
if self.timestamp_s is not None and (
|
|
49
|
+
not isfinite(self.timestamp_s) or self.timestamp_s < 0
|
|
50
|
+
):
|
|
51
|
+
raise ValueError("Evidence time must be finite and nonnegative")
|
|
52
|
+
|
|
53
|
+
|
|
54
|
+
@dataclass(frozen=True, slots=True)
|
|
55
|
+
class WorkLogEntry:
|
|
56
|
+
seq: int
|
|
57
|
+
entry_id: str
|
|
58
|
+
request_id: str
|
|
59
|
+
recorded_at: str
|
|
60
|
+
kind: EntryKind
|
|
61
|
+
actor: Actor
|
|
62
|
+
text: str
|
|
63
|
+
input_digest: str
|
|
64
|
+
evidence: tuple[EvidenceRef, ...] = ()
|
|
65
|
+
target_entry_id: str | None = None
|
|
66
|
+
model: str | None = None
|
|
67
|
+
schema_version: int = 1
|
|
68
|
+
detail_ref: EvidenceRef | None = None
|
|
69
|
+
summary_status: SummaryStatus | None = None
|
|
70
|
+
|
|
71
|
+
events: tuple[WorkLogEvent, ...] = ()
|
|
72
|
+
event_status: Literal["generated", "fallback"] | None = None
|
|
73
|
+
|
|
74
|
+
occurred_at: str | None = None
|
|
75
|
+
outcome: SessionOutcome | None = None
|
|
76
|
+
unresolved: tuple[str, ...] = ()
|
|
77
|
+
input_request_id: str | None = None
|
|
78
|
+
input_count: int = 1
|
|
79
|
+
audio_status: AudioStatus | None = None
|
|
80
|
+
|
|
81
|
+
def __post_init__(self) -> None:
|
|
82
|
+
if self.input_request_id is not None and (
|
|
83
|
+
not isinstance(self.input_request_id, str) or not self.input_request_id.strip()
|
|
84
|
+
):
|
|
85
|
+
raise ValueError("Input group ID must be nonempty")
|
|
86
|
+
if (
|
|
87
|
+
type(self.input_count) is not int
|
|
88
|
+
or self.input_count < 1
|
|
89
|
+
or (self.input_count != 1 and self.input_request_id is None)
|
|
90
|
+
):
|
|
91
|
+
raise ValueError("Invalid input group count")
|
|
92
|
+
if self.audio_status is not None and (
|
|
93
|
+
self.kind != "observation"
|
|
94
|
+
or self.audio_status
|
|
95
|
+
not in {"transcribed", "no_speech", "no_audio_track", "no_audio_in_range"}
|
|
96
|
+
):
|
|
97
|
+
raise ValueError("Invalid audio observation status")
|
|
98
|
+
if self.occurred_at is not None:
|
|
99
|
+
value = datetime.fromisoformat(self.occurred_at)
|
|
100
|
+
if value.tzinfo is None or value.utcoffset() is None:
|
|
101
|
+
raise ValueError("Occurrence time must include a timezone")
|
|
102
|
+
if self.outcome is not None and (
|
|
103
|
+
self.kind != "session_closed"
|
|
104
|
+
or self.outcome not in {"completed", "failed", "cancelled"}
|
|
105
|
+
):
|
|
106
|
+
raise ValueError("Only session closure can have an outcome")
|
|
107
|
+
if (
|
|
108
|
+
not isinstance(self.unresolved, tuple)
|
|
109
|
+
or any(not isinstance(item, str) or not item.strip() for item in self.unresolved)
|
|
110
|
+
or (self.unresolved and self.kind != "session_closed")
|
|
111
|
+
):
|
|
112
|
+
raise ValueError("Unresolved items must be nonempty strings on session closure")
|
|
113
|
+
if not isinstance(self.events, tuple) or any(
|
|
114
|
+
not isinstance(e, WorkLogEvent) for e in self.events
|
|
115
|
+
):
|
|
116
|
+
raise ValueError("Invalid observation events")
|
|
117
|
+
if len({e.event_id for e in self.events}) != len(self.events):
|
|
118
|
+
raise ValueError("Duplicate event ID")
|
|
119
|
+
if self.event_status is not None or self.events:
|
|
120
|
+
if (
|
|
121
|
+
self.kind != "observation"
|
|
122
|
+
or self.detail_ref is None
|
|
123
|
+
or self.event_status not in {"generated", "fallback"}
|
|
124
|
+
or bool(self.events) != (self.event_status == "generated")
|
|
125
|
+
):
|
|
126
|
+
raise ValueError(
|
|
127
|
+
"Event status requires a referenced observation and consistent events"
|
|
128
|
+
)
|
|
129
|
+
if type(self.seq) is not int or self.seq < 1 or self.schema_version != 1:
|
|
130
|
+
raise ValueError("Invalid worklog sequence or schema version")
|
|
131
|
+
if self.kind not in {
|
|
132
|
+
"instruction",
|
|
133
|
+
"observation",
|
|
134
|
+
"action_result",
|
|
135
|
+
"correction",
|
|
136
|
+
"session_closed",
|
|
137
|
+
}:
|
|
138
|
+
raise ValueError("Invalid worklog kind")
|
|
139
|
+
if any(
|
|
140
|
+
not isinstance(v, str) or not v.strip()
|
|
141
|
+
for v in (self.entry_id, self.request_id, self.text, self.input_digest)
|
|
142
|
+
):
|
|
143
|
+
raise ValueError("Worklog identity, text, and input digest are required")
|
|
144
|
+
if (self.kind == "correction") != (self.target_entry_id is not None):
|
|
145
|
+
raise ValueError("Only corrections require a target entry ID")
|
|
146
|
+
if self.detail_ref is not None and (
|
|
147
|
+
self.kind != "observation" or not isinstance(self.detail_ref, EvidenceRef)
|
|
148
|
+
):
|
|
149
|
+
raise ValueError("Only observations can reference a detailed report")
|
|
150
|
+
if self.summary_status is not None and (
|
|
151
|
+
self.summary_status not in {"generated", "fallback"}
|
|
152
|
+
or self.kind != "observation"
|
|
153
|
+
or self.detail_ref is None
|
|
154
|
+
):
|
|
155
|
+
raise ValueError("Summary status requires an observation with a report reference")
|
|
156
|
+
datetime.fromisoformat(self.recorded_at)
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"""Deterministic human-readable views of stored records."""
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
"""Render worklog records without model calls or reverse synchronization."""
|
|
2
|
+
|
|
3
|
+
from collections.abc import Sequence
|
|
4
|
+
from urllib.parse import quote
|
|
5
|
+
|
|
6
|
+
from homiagent.contracts.memory.session import SessionManifest
|
|
7
|
+
from homiagent.contracts.memory.worklog import WorkLogEntry
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
def render_worklog(manifest: SessionManifest, entries: Sequence[WorkLogEntry]) -> str:
|
|
11
|
+
lines = [
|
|
12
|
+
"# Session worklog",
|
|
13
|
+
"",
|
|
14
|
+
f"Session: {manifest.session_id}",
|
|
15
|
+
f"Generated through sequence: {entries[-1].seq if entries else 0}",
|
|
16
|
+
"",
|
|
17
|
+
"Title:",
|
|
18
|
+
"",
|
|
19
|
+
*("> " + line for line in manifest.title.splitlines()),
|
|
20
|
+
"",
|
|
21
|
+
]
|
|
22
|
+
for entry in entries:
|
|
23
|
+
lines.extend(
|
|
24
|
+
[
|
|
25
|
+
f"## {entry.seq}. {entry.kind}",
|
|
26
|
+
"",
|
|
27
|
+
f"Recorded: {entry.recorded_at}",
|
|
28
|
+
f"Actor: {entry.actor.type} ({entry.actor.id or 'unknown'})",
|
|
29
|
+
"",
|
|
30
|
+
*(("> " + line for line in entry.text.splitlines()) if not entry.events else ()),
|
|
31
|
+
"",
|
|
32
|
+
]
|
|
33
|
+
)
|
|
34
|
+
for event in entry.events:
|
|
35
|
+
time = (
|
|
36
|
+
f" · {event.time_range[0]:.3f}–{event.time_range[1]:.3f}s"
|
|
37
|
+
if event.time_range
|
|
38
|
+
else ""
|
|
39
|
+
)
|
|
40
|
+
lines.extend(
|
|
41
|
+
[
|
|
42
|
+
f"### Event {event.event_id}{time}",
|
|
43
|
+
"",
|
|
44
|
+
*("> " + line for line in event.text.splitlines()),
|
|
45
|
+
"",
|
|
46
|
+
]
|
|
47
|
+
)
|
|
48
|
+
if entry.detail_ref:
|
|
49
|
+
spans = ", ".join(f"[{s.start}:{s.end}]" for s in event.source_spans)
|
|
50
|
+
lines.extend(
|
|
51
|
+
[
|
|
52
|
+
f"[Original observation]({quote(entry.detail_ref.path)}) · character ranges {spans}",
|
|
53
|
+
"",
|
|
54
|
+
]
|
|
55
|
+
)
|
|
56
|
+
if entry.occurred_at:
|
|
57
|
+
lines.extend([f"Occurred: {entry.occurred_at}", ""])
|
|
58
|
+
if entry.outcome:
|
|
59
|
+
lines.extend([f"Outcome: {entry.outcome}", ""])
|
|
60
|
+
if entry.unresolved:
|
|
61
|
+
lines.extend(["Unresolved items:", "", *("> " + item for item in entry.unresolved), ""])
|
|
62
|
+
if entry.event_status:
|
|
63
|
+
lines.extend([f"Event extraction: {entry.event_status}", ""])
|
|
64
|
+
if entry.summary_status is not None:
|
|
65
|
+
lines.extend([f"Summary status: {entry.summary_status}", ""])
|
|
66
|
+
if entry.detail_ref:
|
|
67
|
+
lines.extend([f"[Detailed observation]({quote(entry.detail_ref.path)})", ""])
|
|
68
|
+
if entry.target_entry_id:
|
|
69
|
+
lines.extend([f"Corrects: {entry.target_entry_id}", ""])
|
|
70
|
+
for evidence in entry.evidence:
|
|
71
|
+
time = f" at {evidence.timestamp_s:.3f}s" if evidence.timestamp_s is not None else ""
|
|
72
|
+
lines.append(f"- [Evidence]({quote(evidence.path)}){time}")
|
|
73
|
+
lines.append("")
|
|
74
|
+
return "\n".join(lines).rstrip() + "\n"
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: homiagent
|
|
3
|
+
Version: 0.1.0a1
|
|
4
|
+
Summary: HomiAgent worklog data contracts and Markdown rendering
|
|
5
|
+
Project-URL: Repository, https://github.com/NativeAI-Group/HomiAgent
|
|
6
|
+
Keywords: embodied-ai,agents,memory,worklog
|
|
7
|
+
Classifier: Development Status :: 3 - Alpha
|
|
8
|
+
Classifier: Programming Language :: Python :: 3
|
|
9
|
+
Classifier: Programming Language :: Python :: 3 :: Only
|
|
10
|
+
Requires-Python: >=3.11
|
|
11
|
+
Description-Content-Type: text/markdown
|
|
12
|
+
|
|
13
|
+
# HomiAgent worklog preview
|
|
14
|
+
|
|
15
|
+
An early, independently usable subset of HomiAgent for representing session
|
|
16
|
+
worklogs and converting them to Markdown. It runs offline with Python 3.11 or
|
|
17
|
+
newer and requires no third-party runtime dependencies.
|
|
18
|
+
|
|
19
|
+
## Included functionality
|
|
20
|
+
|
|
21
|
+
- Immutable session, actor, evidence, worklog-entry and source-linked event types.
|
|
22
|
+
- Validation of record metadata, evidence paths, source spans and event ranges.
|
|
23
|
+
- Markdown export of worklog entries, corrections, events and session outcomes.
|
|
24
|
+
|
|
25
|
+
This preview does not include the HomiAgent memory API, Agent runtime, model
|
|
26
|
+
adapters, persistent storage, media processing, CLI or RoBIOS integration.
|
|
27
|
+
It does not create sessions on disk, extract events using a model or operate a robot.
|
|
28
|
+
|
|
29
|
+
## Example
|
|
30
|
+
|
|
31
|
+
```python
|
|
32
|
+
from homiagent.contracts.memory.session import SessionManifest
|
|
33
|
+
from homiagent.contracts.memory.worklog import Actor, WorkLogEntry
|
|
34
|
+
from homiagent.rendering.worklog import render_worklog
|
|
35
|
+
|
|
36
|
+
session = SessionManifest(
|
|
37
|
+
session_id="session_demo",
|
|
38
|
+
title="Kitchen task",
|
|
39
|
+
created_at="2026-11-26T00:00:00+00:00",
|
|
40
|
+
)
|
|
41
|
+
entry = WorkLogEntry(
|
|
42
|
+
seq=1,
|
|
43
|
+
entry_id="entry_1",
|
|
44
|
+
request_id="request_1",
|
|
45
|
+
recorded_at="2026-11-26T00:00:01+00:00",
|
|
46
|
+
kind="action_result",
|
|
47
|
+
actor=Actor("robot", "robot_demo"),
|
|
48
|
+
text="Placed the mug on the table.",
|
|
49
|
+
input_digest="demo-input-1",
|
|
50
|
+
)
|
|
51
|
+
markdown = render_worklog(session, [entry])
|
|
52
|
+
print(markdown)
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
The input digest is supplied by the caller. Rendering does not persist data or
|
|
56
|
+
check stored evidence files. These APIs may change in future releases.
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
README.md
|
|
2
|
+
pyproject.toml
|
|
3
|
+
src/homiagent/__init__.py
|
|
4
|
+
src/homiagent.egg-info/PKG-INFO
|
|
5
|
+
src/homiagent.egg-info/SOURCES.txt
|
|
6
|
+
src/homiagent.egg-info/dependency_links.txt
|
|
7
|
+
src/homiagent.egg-info/top_level.txt
|
|
8
|
+
src/homiagent/contracts/__init__.py
|
|
9
|
+
src/homiagent/contracts/memory/__init__.py
|
|
10
|
+
src/homiagent/contracts/memory/events.py
|
|
11
|
+
src/homiagent/contracts/memory/session.py
|
|
12
|
+
src/homiagent/contracts/memory/worklog.py
|
|
13
|
+
src/homiagent/rendering/__init__.py
|
|
14
|
+
src/homiagent/rendering/worklog.py
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
homiagent
|