argus-code 0.2.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.
- argus/__init__.py +3 -0
- argus/adapters/__init__.py +7 -0
- argus/adapters/base.py +108 -0
- argus/adapters/claude_code/__init__.py +5 -0
- argus/adapters/claude_code/adapter.py +63 -0
- argus/adapters/claude_code/discover.py +72 -0
- argus/adapters/claude_code/extract_tool_calls.py +86 -0
- argus/adapters/claude_code/extract_transcript.py +111 -0
- argus/adapters/claude_code/extract_turns.py +69 -0
- argus/adapters/claude_code/history_jsonl.py +138 -0
- argus/adapters/claude_code/ingest_file.py +137 -0
- argus/adapters/claude_code/model.py +11 -0
- argus/adapters/claude_code/schemas.py +77 -0
- argus/adapters/registry.py +30 -0
- argus/cli.py +384 -0
- argus/collector/__init__.py +0 -0
- argus/collector/aggregate.py +102 -0
- argus/collector/first_run.py +189 -0
- argus/collector/pipeline.py +140 -0
- argus/collector/rollup_subagents.py +27 -0
- argus/collector/scheduler.py +89 -0
- argus/collector/search_backfill.py +109 -0
- argus/collector/watcher.py +178 -0
- argus/dashboard-dist/_astro/charts.BIevw6Es.js +1 -0
- argus/dashboard-dist/_astro/format.DxC1NGYT.js +1 -0
- argus/dashboard-dist/_astro/index.astro_astro_type_script_index_0_lang.CgwSARdD.js +24 -0
- argus/dashboard-dist/_astro/index.astro_astro_type_script_index_0_lang.W18SJsr7.js +11 -0
- argus/dashboard-dist/_astro/installCanvasRenderer.D_tC6TXz.js +18 -0
- argus/dashboard-dist/_astro/models.astro_astro_type_script_index_0_lang.BHTHXYHC.js +13 -0
- argus/dashboard-dist/_astro/prompts.astro_astro_type_script_index_0_lang.DfNgiDv9.js +17 -0
- argus/dashboard-dist/_astro/session.astro_astro_type_script_index_0_lang.Dj_bfrIa.js +86 -0
- argus/dashboard-dist/_astro/settings.astro_astro_type_script_index_0_lang.d_a-uvdi.js +24 -0
- argus/dashboard-dist/_astro/tools.astro_astro_type_script_index_0_lang.Dzzau3Yt.js +12 -0
- argus/dashboard-dist/_astro/trends.astro_astro_type_script_index_0_lang.BLLeGRNa.js +5 -0
- argus/dashboard-dist/index.html +2 -0
- argus/dashboard-dist/models/index.html +1 -0
- argus/dashboard-dist/prompts/index.html +18 -0
- argus/dashboard-dist/session/index.html +2 -0
- argus/dashboard-dist/sessions/index.html +1 -0
- argus/dashboard-dist/settings/index.html +8 -0
- argus/dashboard-dist/styles/global.css +307 -0
- argus/dashboard-dist/tools/index.html +1 -0
- argus/dashboard-dist/trends/index.html +1 -0
- argus/detectors/__init__.py +6 -0
- argus/detectors/base.py +34 -0
- argus/detectors/registry.py +20 -0
- argus/detectors/tool_error_rate_spike.py +138 -0
- argus/pricing/2026-05-02.json +24 -0
- argus/pricing/__init__.py +0 -0
- argus/pricing/compute.py +46 -0
- argus/pricing/load.py +45 -0
- argus/pricing/refresh.py +91 -0
- argus/pricing/types.py +21 -0
- argus/scaffold/__init__.py +0 -0
- argus/scaffold/scaffolder.py +45 -0
- argus/scaffold/snapshot.py +73 -0
- argus/scaffold/storage.py +60 -0
- argus/schema/__init__.py +0 -0
- argus/schema/types.py +157 -0
- argus/server/__init__.py +0 -0
- argus/server/api.py +661 -0
- argus/server/app.py +97 -0
- argus/store/__init__.py +0 -0
- argus/store/db.py +103 -0
- argus/store/migrations/__init__.py +0 -0
- argus/store/migrations/inline.py +180 -0
- argus/store/repository.py +778 -0
- argus/templates/default/.claude/agents/code-reviewer.md +27 -0
- argus/templates/default/.claude/agents/security-auditor.md +28 -0
- argus/templates/default/.claude/commands/commit.md +38 -0
- argus/templates/default/.claude/commands/deploy.md +13 -0
- argus/templates/default/.claude/commands/fix-issue.md +15 -0
- argus/templates/default/.claude/commands/pr.md +38 -0
- argus/templates/default/.claude/commands/review.md +14 -0
- argus/templates/default/.claude/rules/api-conventions.md +27 -0
- argus/templates/default/.claude/rules/code-style.md +25 -0
- argus/templates/default/.claude/rules/testing.md +19 -0
- argus/templates/default/.claude/settings.json +28 -0
- argus/templates/default/.claude/skills/example/SKILL.md +11 -0
- argus/templates/default/CLAUDE.md +57 -0
- argus_code-0.2.0.dist-info/METADATA +247 -0
- argus_code-0.2.0.dist-info/RECORD +86 -0
- argus_code-0.2.0.dist-info/WHEEL +4 -0
- argus_code-0.2.0.dist-info/entry_points.txt +2 -0
- argus_code-0.2.0.dist-info/licenses/LICENSE +21 -0
- argus_code-0.2.0.dist-info/licenses/NOTICE +22 -0
argus/schema/types.py
ADDED
|
@@ -0,0 +1,157 @@
|
|
|
1
|
+
"""Core data model types — pydantic v2 BaseModels.
|
|
2
|
+
|
|
3
|
+
Same shape as the TS `interface`s in src/schema/types.ts. The `metadata`
|
|
4
|
+
field stays as a plain dict and is serialized to JSON on disk via
|
|
5
|
+
``json.dumps`` (not pydantic's serializer) to keep the byte representation
|
|
6
|
+
identical to what the TS version writes.
|
|
7
|
+
"""
|
|
8
|
+
from __future__ import annotations
|
|
9
|
+
|
|
10
|
+
from typing import Any, Literal
|
|
11
|
+
|
|
12
|
+
from pydantic import BaseModel, ConfigDict, Field
|
|
13
|
+
|
|
14
|
+
# `agent` is an open string (not a closed Literal) so future adapters
|
|
15
|
+
# (codex, openclaw, hermes) can self-register without editing this file.
|
|
16
|
+
# The Adapter registry enforces "must match a registered adapter" at the
|
|
17
|
+
# repository boundary.
|
|
18
|
+
AgentName = str
|
|
19
|
+
|
|
20
|
+
SegmentRole = Literal["user", "assistant", "thinking", "tool_result"]
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
class NormalizedCacheFields(BaseModel):
|
|
24
|
+
model_config = ConfigDict(frozen=True)
|
|
25
|
+
|
|
26
|
+
fresh_input_tokens: int
|
|
27
|
+
cache_read_tokens: int
|
|
28
|
+
cache_write_tokens: int
|
|
29
|
+
cache_write_5m_tokens: int | None
|
|
30
|
+
cache_write_1h_tokens: int | None
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
class Session(BaseModel):
|
|
34
|
+
model_config = ConfigDict(frozen=True)
|
|
35
|
+
|
|
36
|
+
id: str
|
|
37
|
+
agent: AgentName
|
|
38
|
+
agent_version: str | None
|
|
39
|
+
project_path: str
|
|
40
|
+
started_at: str
|
|
41
|
+
ended_at: str | None
|
|
42
|
+
duration_sec: int | None
|
|
43
|
+
total_fresh_input_tokens: int = 0
|
|
44
|
+
total_output_tokens: int = 0
|
|
45
|
+
total_cache_read_tokens: int = 0
|
|
46
|
+
total_cache_write_tokens: int = 0
|
|
47
|
+
total_cost_usd: float = 0.0
|
|
48
|
+
primary_model: str
|
|
49
|
+
turn_count: int = 0
|
|
50
|
+
pricing_table_version: str
|
|
51
|
+
computed_at: str
|
|
52
|
+
agent_reported_cost_usd: float | None
|
|
53
|
+
metadata: dict[str, Any] = Field(default_factory=dict)
|
|
54
|
+
|
|
55
|
+
|
|
56
|
+
class Turn(BaseModel):
|
|
57
|
+
model_config = ConfigDict(frozen=True)
|
|
58
|
+
|
|
59
|
+
id: str
|
|
60
|
+
session_id: str
|
|
61
|
+
sequence: int
|
|
62
|
+
timestamp: str
|
|
63
|
+
model: str
|
|
64
|
+
model_raw: str
|
|
65
|
+
fresh_input_tokens: int = 0
|
|
66
|
+
output_tokens: int = 0
|
|
67
|
+
cache_read_tokens: int = 0
|
|
68
|
+
cache_write_tokens: int = 0
|
|
69
|
+
cache_write_5m_tokens: int | None = None
|
|
70
|
+
cache_write_1h_tokens: int | None = None
|
|
71
|
+
tool_calls_count: int = 0
|
|
72
|
+
cost_usd: float = 0.0
|
|
73
|
+
metadata: dict[str, Any] = Field(default_factory=dict)
|
|
74
|
+
|
|
75
|
+
|
|
76
|
+
class RawTurnEvent(BaseModel):
|
|
77
|
+
model_config = ConfigDict(frozen=True)
|
|
78
|
+
|
|
79
|
+
native_turn_id: str
|
|
80
|
+
sequence: int
|
|
81
|
+
timestamp: str
|
|
82
|
+
model: str
|
|
83
|
+
model_raw: str
|
|
84
|
+
fresh_input_tokens: int = 0
|
|
85
|
+
output_tokens: int = 0
|
|
86
|
+
cache_read_tokens: int = 0
|
|
87
|
+
cache_write_tokens: int = 0
|
|
88
|
+
cache_write_5m_tokens: int | None = None
|
|
89
|
+
cache_write_1h_tokens: int | None = None
|
|
90
|
+
tool_calls_count: int = 0
|
|
91
|
+
metadata: dict[str, Any] = Field(default_factory=dict)
|
|
92
|
+
|
|
93
|
+
|
|
94
|
+
class RawSessionHeader(BaseModel):
|
|
95
|
+
model_config = ConfigDict(frozen=True)
|
|
96
|
+
|
|
97
|
+
native_session_id: str
|
|
98
|
+
agent: AgentName
|
|
99
|
+
agent_version: str | None
|
|
100
|
+
project_path: str
|
|
101
|
+
started_at: str
|
|
102
|
+
ended_at: str | None
|
|
103
|
+
agent_reported_cost_usd: float | None
|
|
104
|
+
metadata: dict[str, Any] = Field(default_factory=dict)
|
|
105
|
+
|
|
106
|
+
|
|
107
|
+
class ToolCall(BaseModel):
|
|
108
|
+
model_config = ConfigDict(frozen=True)
|
|
109
|
+
|
|
110
|
+
id: str
|
|
111
|
+
session_id: str
|
|
112
|
+
turn_index: int
|
|
113
|
+
tool_name: str
|
|
114
|
+
is_error: int # 0 | 1
|
|
115
|
+
input_size: int
|
|
116
|
+
subagent_type: str | None
|
|
117
|
+
timestamp: str
|
|
118
|
+
|
|
119
|
+
|
|
120
|
+
class Prompt(BaseModel):
|
|
121
|
+
model_config = ConfigDict(frozen=True)
|
|
122
|
+
|
|
123
|
+
id: int | None = None # autoincrement; None on insert
|
|
124
|
+
timestamp_ms: int
|
|
125
|
+
project_path: str
|
|
126
|
+
display: str
|
|
127
|
+
pasted_chars: int = 0
|
|
128
|
+
is_slash: int = 0 # 0 | 1
|
|
129
|
+
|
|
130
|
+
|
|
131
|
+
class TranscriptSegment(BaseModel):
|
|
132
|
+
model_config = ConfigDict(frozen=True)
|
|
133
|
+
|
|
134
|
+
uid: str
|
|
135
|
+
session_id: str
|
|
136
|
+
timestamp: str
|
|
137
|
+
role: SegmentRole
|
|
138
|
+
text: str
|
|
139
|
+
|
|
140
|
+
|
|
141
|
+
AlertSeverity = Literal["info", "warning", "critical"]
|
|
142
|
+
|
|
143
|
+
|
|
144
|
+
class Alert(BaseModel):
|
|
145
|
+
model_config = ConfigDict(frozen=True)
|
|
146
|
+
|
|
147
|
+
id: int | None = None
|
|
148
|
+
detector: str
|
|
149
|
+
dedup_key: str
|
|
150
|
+
severity: AlertSeverity
|
|
151
|
+
title: str
|
|
152
|
+
message: str
|
|
153
|
+
metadata: dict[str, Any] = Field(default_factory=dict)
|
|
154
|
+
first_seen_at: str
|
|
155
|
+
last_seen_at: str
|
|
156
|
+
seen_at: str | None = None
|
|
157
|
+
resolved_at: str | None = None
|
argus/server/__init__.py
ADDED
|
File without changes
|