MCPcopy
hub / github.com/dataelement/Clawith / AgentActivityLog

Class AgentActivityLog

backend/app/models/activity_log.py:13–33  ·  view source on GitHub ↗

Records every action taken by a digital employee.

Source from the content-addressed store, hash-verified

11
12
13class AgentActivityLog(Base):
14 """Records every action taken by a digital employee."""
15
16 __tablename__ = "agent_activity_logs"
17
18 id: Mapped[uuid.UUID] = mapped_column(UUID(as_uuid=True), primary_key=True, default=uuid.uuid4)
19 agent_id: Mapped[uuid.UUID] = mapped_column(UUID(as_uuid=True), ForeignKey("agents.id"), nullable=False, index=True)
20 action_type: Mapped[str] = mapped_column(
21 Enum(
22 "chat_reply", "tool_call", "feishu_msg_sent", "agent_msg_sent",
23 "web_msg_sent", "task_created", "task_updated", "file_written", "error",
24 "schedule_run", "heartbeat", "plaza_post",
25 name="activity_action_enum",
26 create_constraint=False,
27 ),
28 nullable=False,
29 )
30 summary: Mapped[str] = mapped_column(String(500), nullable=False)
31 detail_json: Mapped[dict | None] = mapped_column(JSON, default=None)
32 related_id: Mapped[uuid.UUID | None] = mapped_column(UUID(as_uuid=True))
33 created_at: Mapped[datetime] = mapped_column(DateTime(timezone=True), server_default=func.now(), index=True)
34
35class DailyTokenUsage(Base):
36 """Rolled up token consumption per agent per day for time-series analytics."""

Callers 2

log_activityFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected