omni-cortex 1.17.2__py3-none-any.whl → 1.17.3__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.
- omni_cortex/_bundled/dashboard/backend/.env.example +12 -0
- omni_cortex/_bundled/dashboard/backend/backfill_summaries.py +280 -0
- omni_cortex/_bundled/dashboard/backend/chat_service.py +631 -0
- omni_cortex/_bundled/dashboard/backend/database.py +1773 -0
- omni_cortex/_bundled/dashboard/backend/image_service.py +552 -0
- omni_cortex/_bundled/dashboard/backend/logging_config.py +122 -0
- omni_cortex/_bundled/dashboard/backend/main.py +1888 -0
- omni_cortex/_bundled/dashboard/backend/models.py +472 -0
- omni_cortex/_bundled/dashboard/backend/project_config.py +170 -0
- omni_cortex/_bundled/dashboard/backend/project_scanner.py +164 -0
- omni_cortex/_bundled/dashboard/backend/prompt_security.py +111 -0
- omni_cortex/_bundled/dashboard/backend/pyproject.toml +23 -0
- omni_cortex/_bundled/dashboard/backend/security.py +104 -0
- omni_cortex/_bundled/dashboard/backend/uv.lock +1110 -0
- omni_cortex/_bundled/dashboard/backend/websocket_manager.py +104 -0
- omni_cortex/_bundled/hooks/post_tool_use.py +497 -0
- omni_cortex/_bundled/hooks/pre_tool_use.py +277 -0
- omni_cortex/_bundled/hooks/session_utils.py +186 -0
- omni_cortex/_bundled/hooks/stop.py +219 -0
- omni_cortex/_bundled/hooks/subagent_stop.py +120 -0
- omni_cortex/_bundled/hooks/user_prompt.py +220 -0
- omni_cortex/dashboard.py +10 -4
- omni_cortex/setup.py +14 -8
- {omni_cortex-1.17.2.dist-info → omni_cortex-1.17.3.dist-info}/METADATA +1 -1
- {omni_cortex-1.17.2.dist-info → omni_cortex-1.17.3.dist-info}/RECORD +49 -28
- {omni_cortex-1.17.2.data → omni_cortex-1.17.3.data}/data/share/omni-cortex/dashboard/backend/.env.example +0 -0
- {omni_cortex-1.17.2.data → omni_cortex-1.17.3.data}/data/share/omni-cortex/dashboard/backend/backfill_summaries.py +0 -0
- {omni_cortex-1.17.2.data → omni_cortex-1.17.3.data}/data/share/omni-cortex/dashboard/backend/chat_service.py +0 -0
- {omni_cortex-1.17.2.data → omni_cortex-1.17.3.data}/data/share/omni-cortex/dashboard/backend/database.py +0 -0
- {omni_cortex-1.17.2.data → omni_cortex-1.17.3.data}/data/share/omni-cortex/dashboard/backend/image_service.py +0 -0
- {omni_cortex-1.17.2.data → omni_cortex-1.17.3.data}/data/share/omni-cortex/dashboard/backend/logging_config.py +0 -0
- {omni_cortex-1.17.2.data → omni_cortex-1.17.3.data}/data/share/omni-cortex/dashboard/backend/main.py +0 -0
- {omni_cortex-1.17.2.data → omni_cortex-1.17.3.data}/data/share/omni-cortex/dashboard/backend/models.py +0 -0
- {omni_cortex-1.17.2.data → omni_cortex-1.17.3.data}/data/share/omni-cortex/dashboard/backend/project_config.py +0 -0
- {omni_cortex-1.17.2.data → omni_cortex-1.17.3.data}/data/share/omni-cortex/dashboard/backend/project_scanner.py +0 -0
- {omni_cortex-1.17.2.data → omni_cortex-1.17.3.data}/data/share/omni-cortex/dashboard/backend/prompt_security.py +0 -0
- {omni_cortex-1.17.2.data → omni_cortex-1.17.3.data}/data/share/omni-cortex/dashboard/backend/pyproject.toml +0 -0
- {omni_cortex-1.17.2.data → omni_cortex-1.17.3.data}/data/share/omni-cortex/dashboard/backend/security.py +0 -0
- {omni_cortex-1.17.2.data → omni_cortex-1.17.3.data}/data/share/omni-cortex/dashboard/backend/uv.lock +0 -0
- {omni_cortex-1.17.2.data → omni_cortex-1.17.3.data}/data/share/omni-cortex/dashboard/backend/websocket_manager.py +0 -0
- {omni_cortex-1.17.2.data → omni_cortex-1.17.3.data}/data/share/omni-cortex/hooks/post_tool_use.py +0 -0
- {omni_cortex-1.17.2.data → omni_cortex-1.17.3.data}/data/share/omni-cortex/hooks/pre_tool_use.py +0 -0
- {omni_cortex-1.17.2.data → omni_cortex-1.17.3.data}/data/share/omni-cortex/hooks/session_utils.py +0 -0
- {omni_cortex-1.17.2.data → omni_cortex-1.17.3.data}/data/share/omni-cortex/hooks/stop.py +0 -0
- {omni_cortex-1.17.2.data → omni_cortex-1.17.3.data}/data/share/omni-cortex/hooks/subagent_stop.py +0 -0
- {omni_cortex-1.17.2.data → omni_cortex-1.17.3.data}/data/share/omni-cortex/hooks/user_prompt.py +0 -0
- {omni_cortex-1.17.2.dist-info → omni_cortex-1.17.3.dist-info}/WHEEL +0 -0
- {omni_cortex-1.17.2.dist-info → omni_cortex-1.17.3.dist-info}/entry_points.txt +0 -0
- {omni_cortex-1.17.2.dist-info → omni_cortex-1.17.3.dist-info}/licenses/LICENSE +0 -0
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
#!/usr/bin/env python3
|
|
2
|
+
"""SubagentStop hook - logs when a subagent completes.
|
|
3
|
+
|
|
4
|
+
This hook is called when a subagent (spawned by the Task tool) finishes.
|
|
5
|
+
It logs the subagent completion and any results.
|
|
6
|
+
|
|
7
|
+
Hook configuration for settings.json:
|
|
8
|
+
{
|
|
9
|
+
"hooks": {
|
|
10
|
+
"SubagentStop": [
|
|
11
|
+
{
|
|
12
|
+
"type": "command",
|
|
13
|
+
"command": "python hooks/subagent_stop.py"
|
|
14
|
+
}
|
|
15
|
+
]
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
"""
|
|
19
|
+
|
|
20
|
+
import json
|
|
21
|
+
import sys
|
|
22
|
+
import os
|
|
23
|
+
import sqlite3
|
|
24
|
+
from datetime import datetime, timezone
|
|
25
|
+
from pathlib import Path
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
def get_db_path() -> Path:
|
|
29
|
+
"""Get the database path for the current project."""
|
|
30
|
+
project_path = os.environ.get("CLAUDE_PROJECT_DIR", os.getcwd())
|
|
31
|
+
return Path(project_path) / ".omni-cortex" / "cortex.db"
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
def generate_id() -> str:
|
|
35
|
+
"""Generate a unique activity ID."""
|
|
36
|
+
timestamp_ms = int(datetime.now().timestamp() * 1000)
|
|
37
|
+
random_hex = os.urandom(4).hex()
|
|
38
|
+
return f"act_{timestamp_ms}_{random_hex}"
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
def truncate(text: str, max_length: int = 10000) -> str:
|
|
42
|
+
"""Truncate text to max length."""
|
|
43
|
+
if len(text) <= max_length:
|
|
44
|
+
return text
|
|
45
|
+
return text[:max_length - 20] + "\n... [truncated]"
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
def main():
|
|
49
|
+
"""Process SubagentStop hook."""
|
|
50
|
+
try:
|
|
51
|
+
# Read input from stdin
|
|
52
|
+
input_data = json.load(sys.stdin)
|
|
53
|
+
|
|
54
|
+
db_path = get_db_path()
|
|
55
|
+
|
|
56
|
+
# Only log if database exists
|
|
57
|
+
if not db_path.exists():
|
|
58
|
+
print(json.dumps({}))
|
|
59
|
+
return
|
|
60
|
+
|
|
61
|
+
# Extract data from hook input
|
|
62
|
+
subagent_id = input_data.get("subagent_id")
|
|
63
|
+
subagent_type = input_data.get("subagent_type", "subagent")
|
|
64
|
+
result = input_data.get("result", {})
|
|
65
|
+
|
|
66
|
+
session_id = os.environ.get("CLAUDE_SESSION_ID")
|
|
67
|
+
project_path = os.environ.get("CLAUDE_PROJECT_DIR", os.getcwd())
|
|
68
|
+
now = datetime.now(timezone.utc).isoformat()
|
|
69
|
+
|
|
70
|
+
# Connect to database
|
|
71
|
+
conn = sqlite3.connect(str(db_path))
|
|
72
|
+
cursor = conn.cursor()
|
|
73
|
+
|
|
74
|
+
# Log the subagent completion as an activity
|
|
75
|
+
cursor.execute(
|
|
76
|
+
"""
|
|
77
|
+
INSERT INTO activities (
|
|
78
|
+
id, session_id, agent_id, timestamp, event_type,
|
|
79
|
+
tool_name, tool_output, success, project_path
|
|
80
|
+
) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?)
|
|
81
|
+
""",
|
|
82
|
+
(
|
|
83
|
+
generate_id(),
|
|
84
|
+
session_id,
|
|
85
|
+
subagent_id,
|
|
86
|
+
now,
|
|
87
|
+
"subagent_stop",
|
|
88
|
+
f"subagent_{subagent_type}",
|
|
89
|
+
truncate(json.dumps(result, default=str)),
|
|
90
|
+
1,
|
|
91
|
+
project_path,
|
|
92
|
+
),
|
|
93
|
+
)
|
|
94
|
+
|
|
95
|
+
# Update or create agent record
|
|
96
|
+
cursor.execute(
|
|
97
|
+
"""
|
|
98
|
+
INSERT INTO agents (id, name, type, first_seen, last_seen, total_activities)
|
|
99
|
+
VALUES (?, ?, ?, ?, ?, 1)
|
|
100
|
+
ON CONFLICT(id) DO UPDATE SET
|
|
101
|
+
last_seen = ?,
|
|
102
|
+
total_activities = total_activities + 1
|
|
103
|
+
""",
|
|
104
|
+
(subagent_id, None, "subagent", now, now, now),
|
|
105
|
+
)
|
|
106
|
+
|
|
107
|
+
conn.commit()
|
|
108
|
+
conn.close()
|
|
109
|
+
|
|
110
|
+
print(json.dumps({}))
|
|
111
|
+
|
|
112
|
+
except Exception as e:
|
|
113
|
+
# Hooks should never block
|
|
114
|
+
print(json.dumps({"systemMessage": f"Cortex subagent_stop: {e}"}))
|
|
115
|
+
|
|
116
|
+
sys.exit(0)
|
|
117
|
+
|
|
118
|
+
|
|
119
|
+
if __name__ == "__main__":
|
|
120
|
+
main()
|
|
@@ -0,0 +1,220 @@
|
|
|
1
|
+
#!/usr/bin/env python3
|
|
2
|
+
"""UserPromptSubmit hook - captures user messages for style analysis.
|
|
3
|
+
|
|
4
|
+
This hook is called by Claude Code when the user submits a prompt.
|
|
5
|
+
It logs the user message to the Cortex database for later style analysis.
|
|
6
|
+
|
|
7
|
+
Hook configuration for settings.json:
|
|
8
|
+
{
|
|
9
|
+
"hooks": {
|
|
10
|
+
"UserPromptSubmit": [
|
|
11
|
+
{
|
|
12
|
+
"hooks": [
|
|
13
|
+
{
|
|
14
|
+
"type": "command",
|
|
15
|
+
"command": "python hooks/user_prompt.py"
|
|
16
|
+
}
|
|
17
|
+
]
|
|
18
|
+
}
|
|
19
|
+
]
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
"""
|
|
23
|
+
|
|
24
|
+
import json
|
|
25
|
+
import re
|
|
26
|
+
import sys
|
|
27
|
+
import os
|
|
28
|
+
import sqlite3
|
|
29
|
+
from datetime import datetime, timezone
|
|
30
|
+
from pathlib import Path
|
|
31
|
+
|
|
32
|
+
# Import shared session management
|
|
33
|
+
from session_utils import get_or_create_session
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
def get_db_path() -> Path:
|
|
37
|
+
"""Get the database path for the current project."""
|
|
38
|
+
project_path = os.environ.get("CLAUDE_PROJECT_DIR", os.getcwd())
|
|
39
|
+
return Path(project_path) / ".omni-cortex" / "cortex.db"
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
def ensure_database(db_path: Path) -> sqlite3.Connection:
|
|
43
|
+
"""Ensure database exists and has user_messages table."""
|
|
44
|
+
db_path.parent.mkdir(parents=True, exist_ok=True)
|
|
45
|
+
conn = sqlite3.connect(str(db_path))
|
|
46
|
+
|
|
47
|
+
# Check if user_messages table exists
|
|
48
|
+
cursor = conn.cursor()
|
|
49
|
+
cursor.execute("SELECT name FROM sqlite_master WHERE type='table' AND name='user_messages'")
|
|
50
|
+
if cursor.fetchone() is None:
|
|
51
|
+
# Apply minimal schema for user_messages
|
|
52
|
+
conn.executescript("""
|
|
53
|
+
CREATE TABLE IF NOT EXISTS user_messages (
|
|
54
|
+
id TEXT PRIMARY KEY,
|
|
55
|
+
session_id TEXT,
|
|
56
|
+
timestamp TEXT NOT NULL,
|
|
57
|
+
content TEXT NOT NULL,
|
|
58
|
+
word_count INTEGER,
|
|
59
|
+
char_count INTEGER,
|
|
60
|
+
line_count INTEGER,
|
|
61
|
+
has_code_blocks INTEGER DEFAULT 0,
|
|
62
|
+
has_questions INTEGER DEFAULT 0,
|
|
63
|
+
has_commands INTEGER DEFAULT 0,
|
|
64
|
+
tone_indicators TEXT,
|
|
65
|
+
project_path TEXT,
|
|
66
|
+
metadata TEXT
|
|
67
|
+
);
|
|
68
|
+
CREATE INDEX IF NOT EXISTS idx_user_messages_timestamp ON user_messages(timestamp DESC);
|
|
69
|
+
""")
|
|
70
|
+
conn.commit()
|
|
71
|
+
|
|
72
|
+
return conn
|
|
73
|
+
|
|
74
|
+
|
|
75
|
+
def generate_id() -> str:
|
|
76
|
+
"""Generate a unique message ID."""
|
|
77
|
+
timestamp_ms = int(datetime.now().timestamp() * 1000)
|
|
78
|
+
random_hex = os.urandom(4).hex()
|
|
79
|
+
return f"msg_{timestamp_ms}_{random_hex}"
|
|
80
|
+
|
|
81
|
+
|
|
82
|
+
def analyze_message(content: str) -> dict:
|
|
83
|
+
"""Analyze message characteristics for style profiling."""
|
|
84
|
+
# Basic counts
|
|
85
|
+
word_count = len(content.split())
|
|
86
|
+
char_count = len(content)
|
|
87
|
+
line_count = len(content.splitlines()) or 1
|
|
88
|
+
|
|
89
|
+
# Detect code blocks
|
|
90
|
+
has_code_blocks = 1 if re.search(r'```[\s\S]*?```|`[^`]+`', content) else 0
|
|
91
|
+
|
|
92
|
+
# Detect questions
|
|
93
|
+
has_questions = 1 if re.search(r'\?|^(what|how|why|when|where|who|which|can|could|would|should|is|are|do|does|did)\b', content, re.IGNORECASE | re.MULTILINE) else 0
|
|
94
|
+
|
|
95
|
+
# Detect slash commands
|
|
96
|
+
has_commands = 1 if content.strip().startswith('/') else 0
|
|
97
|
+
|
|
98
|
+
# Tone indicators
|
|
99
|
+
tone_indicators = []
|
|
100
|
+
|
|
101
|
+
# Urgency markers
|
|
102
|
+
if re.search(r'\b(urgent|asap|immediately|quick|fast|hurry)\b', content, re.IGNORECASE):
|
|
103
|
+
tone_indicators.append("urgent")
|
|
104
|
+
|
|
105
|
+
# Polite markers
|
|
106
|
+
if re.search(r'\b(please|thanks|thank you|appreciate|kindly)\b', content, re.IGNORECASE):
|
|
107
|
+
tone_indicators.append("polite")
|
|
108
|
+
|
|
109
|
+
# Direct/imperative
|
|
110
|
+
if re.match(r'^(fix|add|remove|update|change|create|delete|run|test|check|show|list|find)\b', content.strip(), re.IGNORECASE):
|
|
111
|
+
tone_indicators.append("direct")
|
|
112
|
+
|
|
113
|
+
# Questioning/exploratory
|
|
114
|
+
if has_questions:
|
|
115
|
+
tone_indicators.append("inquisitive")
|
|
116
|
+
|
|
117
|
+
# Technical
|
|
118
|
+
if re.search(r'\b(function|class|method|variable|api|database|server|error|bug|issue)\b', content, re.IGNORECASE):
|
|
119
|
+
tone_indicators.append("technical")
|
|
120
|
+
|
|
121
|
+
# Casual
|
|
122
|
+
if re.search(r'\b(hey|hi|yo|cool|awesome|great|nice)\b', content, re.IGNORECASE):
|
|
123
|
+
tone_indicators.append("casual")
|
|
124
|
+
|
|
125
|
+
return {
|
|
126
|
+
"word_count": word_count,
|
|
127
|
+
"char_count": char_count,
|
|
128
|
+
"line_count": line_count,
|
|
129
|
+
"has_code_blocks": has_code_blocks,
|
|
130
|
+
"has_questions": has_questions,
|
|
131
|
+
"has_commands": has_commands,
|
|
132
|
+
"tone_indicators": json.dumps(tone_indicators),
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
|
|
136
|
+
def main():
|
|
137
|
+
"""Process UserPromptSubmit hook."""
|
|
138
|
+
try:
|
|
139
|
+
# Read input from stdin
|
|
140
|
+
import select
|
|
141
|
+
if sys.platform != "win32":
|
|
142
|
+
ready, _, _ = select.select([sys.stdin], [], [], 5.0)
|
|
143
|
+
if not ready:
|
|
144
|
+
print(json.dumps({}))
|
|
145
|
+
return
|
|
146
|
+
|
|
147
|
+
raw_input = sys.stdin.read()
|
|
148
|
+
if not raw_input or not raw_input.strip():
|
|
149
|
+
print(json.dumps({}))
|
|
150
|
+
return
|
|
151
|
+
|
|
152
|
+
input_data = json.loads(raw_input)
|
|
153
|
+
|
|
154
|
+
# Extract user prompt
|
|
155
|
+
prompt = input_data.get("prompt", "")
|
|
156
|
+
if not prompt or not prompt.strip():
|
|
157
|
+
print(json.dumps({}))
|
|
158
|
+
return
|
|
159
|
+
|
|
160
|
+
# Skip very short messages (likely just commands)
|
|
161
|
+
if len(prompt.strip()) < 3:
|
|
162
|
+
print(json.dumps({}))
|
|
163
|
+
return
|
|
164
|
+
|
|
165
|
+
project_path = os.environ.get("CLAUDE_PROJECT_DIR", os.getcwd())
|
|
166
|
+
|
|
167
|
+
# Initialize database
|
|
168
|
+
db_path = get_db_path()
|
|
169
|
+
conn = ensure_database(db_path)
|
|
170
|
+
|
|
171
|
+
# Get or create session
|
|
172
|
+
session_id = get_or_create_session(conn, project_path)
|
|
173
|
+
|
|
174
|
+
# Analyze message
|
|
175
|
+
analysis = analyze_message(prompt)
|
|
176
|
+
|
|
177
|
+
# Generate message ID
|
|
178
|
+
message_id = generate_id()
|
|
179
|
+
|
|
180
|
+
# Insert message record
|
|
181
|
+
cursor = conn.cursor()
|
|
182
|
+
cursor.execute(
|
|
183
|
+
"""
|
|
184
|
+
INSERT INTO user_messages (
|
|
185
|
+
id, session_id, timestamp, content, word_count, char_count,
|
|
186
|
+
line_count, has_code_blocks, has_questions, has_commands,
|
|
187
|
+
tone_indicators, project_path
|
|
188
|
+
) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
|
|
189
|
+
""",
|
|
190
|
+
(
|
|
191
|
+
message_id,
|
|
192
|
+
session_id,
|
|
193
|
+
datetime.now(timezone.utc).isoformat(),
|
|
194
|
+
prompt,
|
|
195
|
+
analysis["word_count"],
|
|
196
|
+
analysis["char_count"],
|
|
197
|
+
analysis["line_count"],
|
|
198
|
+
analysis["has_code_blocks"],
|
|
199
|
+
analysis["has_questions"],
|
|
200
|
+
analysis["has_commands"],
|
|
201
|
+
analysis["tone_indicators"],
|
|
202
|
+
project_path,
|
|
203
|
+
),
|
|
204
|
+
)
|
|
205
|
+
conn.commit()
|
|
206
|
+
conn.close()
|
|
207
|
+
|
|
208
|
+
# Return empty response (don't modify prompt)
|
|
209
|
+
print(json.dumps({}))
|
|
210
|
+
|
|
211
|
+
except Exception as e:
|
|
212
|
+
# Hooks should never block - log error but continue
|
|
213
|
+
# Don't print system message to avoid polluting user experience
|
|
214
|
+
print(json.dumps({}))
|
|
215
|
+
|
|
216
|
+
sys.exit(0)
|
|
217
|
+
|
|
218
|
+
|
|
219
|
+
if __name__ == "__main__":
|
|
220
|
+
main()
|
omni_cortex/dashboard.py
CHANGED
|
@@ -61,12 +61,18 @@ def find_dashboard_dir() -> Path | None:
|
|
|
61
61
|
"""Find the dashboard directory.
|
|
62
62
|
|
|
63
63
|
Searches in order:
|
|
64
|
-
1.
|
|
65
|
-
2.
|
|
66
|
-
3.
|
|
64
|
+
1. Bundled inside package (works for user and system installs)
|
|
65
|
+
2. Development directory (cloned repo)
|
|
66
|
+
3. Package shared-data (installed via pip system-wide)
|
|
67
|
+
4. Site-packages share location
|
|
67
68
|
"""
|
|
68
69
|
package_dir = Path(__file__).parent
|
|
69
70
|
|
|
71
|
+
# Check for bundled dashboard inside package (most reliable for pip installs)
|
|
72
|
+
bundled_dashboard = package_dir / "_bundled" / "dashboard"
|
|
73
|
+
if bundled_dashboard.exists() and (bundled_dashboard / "backend" / "main.py").exists():
|
|
74
|
+
return bundled_dashboard
|
|
75
|
+
|
|
70
76
|
# Check for development directory (repo structure)
|
|
71
77
|
# Go up from src/omni_cortex to repo root, then dashboard
|
|
72
78
|
repo_root = package_dir.parent.parent
|
|
@@ -74,7 +80,7 @@ def find_dashboard_dir() -> Path | None:
|
|
|
74
80
|
if dashboard_in_repo.exists() and (dashboard_in_repo / "backend" / "main.py").exists():
|
|
75
81
|
return dashboard_in_repo
|
|
76
82
|
|
|
77
|
-
# Check pip shared-data location
|
|
83
|
+
# Check pip shared-data location (for backwards compatibility)
|
|
78
84
|
# On Unix: ~/.local/share/omni-cortex/dashboard
|
|
79
85
|
# On Windows: %APPDATA%/Python/share/omni-cortex/dashboard
|
|
80
86
|
import site
|
omni_cortex/setup.py
CHANGED
|
@@ -56,21 +56,27 @@ def get_hooks_dir() -> Path:
|
|
|
56
56
|
"""Get the hooks directory.
|
|
57
57
|
|
|
58
58
|
Checks multiple locations for hooks:
|
|
59
|
-
1.
|
|
60
|
-
2.
|
|
61
|
-
3. Installed: <
|
|
59
|
+
1. Bundled inside package (works for user and system installs)
|
|
60
|
+
2. Development: <project>/hooks/
|
|
61
|
+
3. Installed: <site-packages>/../share/omni-cortex/hooks/
|
|
62
|
+
4. Installed: <prefix>/share/omni-cortex/hooks/
|
|
62
63
|
"""
|
|
64
|
+
# Try relative to package first (bundled location)
|
|
65
|
+
import omni_cortex
|
|
66
|
+
pkg_path = Path(omni_cortex.__file__).parent
|
|
67
|
+
|
|
68
|
+
# Check bundled location inside package (most reliable for pip installs)
|
|
69
|
+
bundled_hooks = pkg_path / "_bundled" / "hooks"
|
|
70
|
+
if bundled_hooks.exists():
|
|
71
|
+
return bundled_hooks
|
|
72
|
+
|
|
63
73
|
# Try development location
|
|
64
74
|
package_dir = get_package_dir()
|
|
65
75
|
hooks_dir = package_dir / "hooks"
|
|
66
76
|
if hooks_dir.exists():
|
|
67
77
|
return hooks_dir
|
|
68
78
|
|
|
69
|
-
#
|
|
70
|
-
import omni_cortex
|
|
71
|
-
pkg_path = Path(omni_cortex.__file__).parent
|
|
72
|
-
|
|
73
|
-
# Check various installed locations
|
|
79
|
+
# Check various installed locations (shared-data, for backwards compatibility)
|
|
74
80
|
candidates = [
|
|
75
81
|
pkg_path.parent.parent / "hooks",
|
|
76
82
|
pkg_path.parent.parent / "share" / "omni-cortex" / "hooks",
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: omni-cortex
|
|
3
|
-
Version: 1.17.
|
|
3
|
+
Version: 1.17.3
|
|
4
4
|
Summary: Give Claude Code a perfect memory - auto-logs everything, searches smartly, and gets smarter over time
|
|
5
5
|
Project-URL: Homepage, https://github.com/AllCytes/Omni-Cortex
|
|
6
6
|
Project-URL: Repository, https://github.com/AllCytes/Omni-Cortex
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
omni_cortex/__init__.py,sha256=l6tpzaA2jtei2B0cfc33f3k7vrZd1-VVPZi7_jGtcwE,89
|
|
2
2
|
omni_cortex/config.py,sha256=oUxl6caRqkRXjMCjnhxgmjPJZGMllqrZTvZueZ1Rzjc,4125
|
|
3
|
-
omni_cortex/dashboard.py,sha256=
|
|
3
|
+
omni_cortex/dashboard.py,sha256=wAXzOdcSypjoGoNMg__ytAQRuY1LZTj7siz6-eVySBs,8139
|
|
4
4
|
omni_cortex/server.py,sha256=y-knqn-rSJqK5houuV40nLtiBJJMlPkGIKE3HIQxHhA,11729
|
|
5
|
-
omni_cortex/setup.py,sha256=
|
|
5
|
+
omni_cortex/setup.py,sha256=ZHmoD9k_6LCACFCbNzU34NULREKOotRlsOBCBo305cI,8684
|
|
6
6
|
omni_cortex/categorization/__init__.py,sha256=9W6kQqbnOVor8kcNz8gtOFx0g-iEK_7AaNhlv-W93VQ,180
|
|
7
7
|
omni_cortex/categorization/auto_tags.py,sha256=oi6muOyzM9d7kPQwxgcMHIPkR4T-1ovVCQIQ7gJ9Zak,5517
|
|
8
8
|
omni_cortex/categorization/auto_type.py,sha256=_EZUTA7TvUudQKCPICV2ImViM3SjMsQOM8vMxocfxHs,4953
|
|
@@ -37,29 +37,50 @@ omni_cortex/utils/formatting.py,sha256=FondMrbOav_IAhxeJ0b0tbDEOtI7Y6UssvSojQs58
|
|
|
37
37
|
omni_cortex/utils/ids.py,sha256=moymnXvSoE-SSvlpnR8jGN009WudYVv4Ww3f5RB30aU,1555
|
|
38
38
|
omni_cortex/utils/timestamps.py,sha256=DsT4o9HuhZ2GQ76HjAUrtaljWuKOEp4olO-lT8jY24o,3310
|
|
39
39
|
omni_cortex/utils/truncation.py,sha256=LjW0IGBX8Mc3zA8uG4a_0nYktawTUynWHnvHRdROeec,3293
|
|
40
|
-
omni_cortex
|
|
41
|
-
omni_cortex
|
|
42
|
-
omni_cortex
|
|
43
|
-
omni_cortex
|
|
44
|
-
omni_cortex
|
|
45
|
-
omni_cortex
|
|
46
|
-
omni_cortex
|
|
47
|
-
omni_cortex
|
|
48
|
-
omni_cortex
|
|
49
|
-
omni_cortex
|
|
50
|
-
omni_cortex
|
|
51
|
-
omni_cortex
|
|
52
|
-
omni_cortex
|
|
53
|
-
omni_cortex
|
|
54
|
-
omni_cortex
|
|
55
|
-
omni_cortex
|
|
56
|
-
omni_cortex
|
|
57
|
-
omni_cortex
|
|
58
|
-
omni_cortex
|
|
59
|
-
omni_cortex
|
|
60
|
-
omni_cortex
|
|
61
|
-
omni_cortex-1.17.
|
|
62
|
-
omni_cortex-1.17.
|
|
63
|
-
omni_cortex-1.17.
|
|
64
|
-
omni_cortex-1.17.
|
|
65
|
-
omni_cortex-1.17.
|
|
40
|
+
omni_cortex/_bundled/hooks/post_tool_use.py,sha256=zdaKChi8zOghRlHswisCBSQE3kW1MtmM6AFfI_ivvpI,16581
|
|
41
|
+
omni_cortex/_bundled/hooks/pre_tool_use.py,sha256=3_V6Qw5m40eGrMmm5i94vINzeVxmcJvivdPa69H3AOI,8585
|
|
42
|
+
omni_cortex/_bundled/hooks/session_utils.py,sha256=3SKPCytqWuRPOupWdzmwBoKBDJqtLcT1Nle_pueDQUY,5746
|
|
43
|
+
omni_cortex/_bundled/hooks/stop.py,sha256=UroliJsyIS9_lj29-1d_r-80V4AfTMUFCaOjJZv3lwM,6976
|
|
44
|
+
omni_cortex/_bundled/hooks/subagent_stop.py,sha256=V9HQSFGNOfkg8ZCstPEy4h5V8BP4AbrVr8teFzN1kNk,3314
|
|
45
|
+
omni_cortex/_bundled/hooks/user_prompt.py,sha256=WNHJvhnkb9rXQ_HDpr6eLpM5vwy1Y1xl1EUoqyNC-x8,6859
|
|
46
|
+
omni_cortex/_bundled/dashboard/backend/.env.example,sha256=9xS7-UiWlMddRwzlyyyKNHAMlNTsgH-2sPV266guJpQ,372
|
|
47
|
+
omni_cortex/_bundled/dashboard/backend/backfill_summaries.py,sha256=ElchfcBv4pmVr2PsePCgFlCyuvf4_jDJj_C3AmMhu7U,8973
|
|
48
|
+
omni_cortex/_bundled/dashboard/backend/chat_service.py,sha256=iEDpAw8OVaHM2312VPcAM-w6dYabUpjaTvWl1jGhqi0,20948
|
|
49
|
+
omni_cortex/_bundled/dashboard/backend/database.py,sha256=byISCVgVziqFhJ8j8FC99ueTAoo-E0BJ6bk8KUvW3Mg,57610
|
|
50
|
+
omni_cortex/_bundled/dashboard/backend/image_service.py,sha256=NP6ojFpHb6iNTYRkXqYu1CL6WvooZpZ54mjLiWSWG_g,19205
|
|
51
|
+
omni_cortex/_bundled/dashboard/backend/logging_config.py,sha256=WnunFGET9zlsn9WBpVsio2zI7BiUQanE0xzAQQxIhII,3944
|
|
52
|
+
omni_cortex/_bundled/dashboard/backend/main.py,sha256=9-GDfhtqvYZuLaqgmEzn0t-dxCiLdntnD1JA2rNAeCg,67165
|
|
53
|
+
omni_cortex/_bundled/dashboard/backend/models.py,sha256=mP_szTXuVE4ZWHGubLeCt1-ltroO8OO0vrGC3IM6AJ0,13122
|
|
54
|
+
omni_cortex/_bundled/dashboard/backend/project_config.py,sha256=ZxGoeRpHvN5qQyf2hRxrAZiHrPSwdQp59f0di6O1LKM,4352
|
|
55
|
+
omni_cortex/_bundled/dashboard/backend/project_scanner.py,sha256=lwFXS8iJbOoxf7FAyo2TjH25neaMHiJ8B3jS57XxtDI,5713
|
|
56
|
+
omni_cortex/_bundled/dashboard/backend/prompt_security.py,sha256=LcdZhYy1CfpSq_4BPO6lMJ15phc2ZXLUSBAnAvODVCI,3423
|
|
57
|
+
omni_cortex/_bundled/dashboard/backend/pyproject.toml,sha256=9pbbGQXLe1Xd06nZAtDySCHIlfMWvPaB-C6tGZR6umc,502
|
|
58
|
+
omni_cortex/_bundled/dashboard/backend/security.py,sha256=nQsoPE0n5dtY9ive00d33W1gL48GgK7C5Ae0BK2oW2k,3479
|
|
59
|
+
omni_cortex/_bundled/dashboard/backend/uv.lock,sha256=miB9zGGSirBkjDE-OZTPCnv43Yc98xuAz_Ne8vTNFHg,186004
|
|
60
|
+
omni_cortex/_bundled/dashboard/backend/websocket_manager.py,sha256=gNQLd94AcC-InumGQmUolREhiogCzilYWpLN8SRZjHI,3645
|
|
61
|
+
omni_cortex-1.17.3.data/data/share/omni-cortex/hooks/post_tool_use.py,sha256=zdaKChi8zOghRlHswisCBSQE3kW1MtmM6AFfI_ivvpI,16581
|
|
62
|
+
omni_cortex-1.17.3.data/data/share/omni-cortex/hooks/pre_tool_use.py,sha256=3_V6Qw5m40eGrMmm5i94vINzeVxmcJvivdPa69H3AOI,8585
|
|
63
|
+
omni_cortex-1.17.3.data/data/share/omni-cortex/hooks/session_utils.py,sha256=3SKPCytqWuRPOupWdzmwBoKBDJqtLcT1Nle_pueDQUY,5746
|
|
64
|
+
omni_cortex-1.17.3.data/data/share/omni-cortex/hooks/stop.py,sha256=UroliJsyIS9_lj29-1d_r-80V4AfTMUFCaOjJZv3lwM,6976
|
|
65
|
+
omni_cortex-1.17.3.data/data/share/omni-cortex/hooks/subagent_stop.py,sha256=V9HQSFGNOfkg8ZCstPEy4h5V8BP4AbrVr8teFzN1kNk,3314
|
|
66
|
+
omni_cortex-1.17.3.data/data/share/omni-cortex/hooks/user_prompt.py,sha256=WNHJvhnkb9rXQ_HDpr6eLpM5vwy1Y1xl1EUoqyNC-x8,6859
|
|
67
|
+
omni_cortex-1.17.3.data/data/share/omni-cortex/dashboard/backend/.env.example,sha256=9xS7-UiWlMddRwzlyyyKNHAMlNTsgH-2sPV266guJpQ,372
|
|
68
|
+
omni_cortex-1.17.3.data/data/share/omni-cortex/dashboard/backend/backfill_summaries.py,sha256=ElchfcBv4pmVr2PsePCgFlCyuvf4_jDJj_C3AmMhu7U,8973
|
|
69
|
+
omni_cortex-1.17.3.data/data/share/omni-cortex/dashboard/backend/chat_service.py,sha256=iEDpAw8OVaHM2312VPcAM-w6dYabUpjaTvWl1jGhqi0,20948
|
|
70
|
+
omni_cortex-1.17.3.data/data/share/omni-cortex/dashboard/backend/database.py,sha256=byISCVgVziqFhJ8j8FC99ueTAoo-E0BJ6bk8KUvW3Mg,57610
|
|
71
|
+
omni_cortex-1.17.3.data/data/share/omni-cortex/dashboard/backend/image_service.py,sha256=NP6ojFpHb6iNTYRkXqYu1CL6WvooZpZ54mjLiWSWG_g,19205
|
|
72
|
+
omni_cortex-1.17.3.data/data/share/omni-cortex/dashboard/backend/logging_config.py,sha256=WnunFGET9zlsn9WBpVsio2zI7BiUQanE0xzAQQxIhII,3944
|
|
73
|
+
omni_cortex-1.17.3.data/data/share/omni-cortex/dashboard/backend/main.py,sha256=9-GDfhtqvYZuLaqgmEzn0t-dxCiLdntnD1JA2rNAeCg,67165
|
|
74
|
+
omni_cortex-1.17.3.data/data/share/omni-cortex/dashboard/backend/models.py,sha256=mP_szTXuVE4ZWHGubLeCt1-ltroO8OO0vrGC3IM6AJ0,13122
|
|
75
|
+
omni_cortex-1.17.3.data/data/share/omni-cortex/dashboard/backend/project_config.py,sha256=ZxGoeRpHvN5qQyf2hRxrAZiHrPSwdQp59f0di6O1LKM,4352
|
|
76
|
+
omni_cortex-1.17.3.data/data/share/omni-cortex/dashboard/backend/project_scanner.py,sha256=lwFXS8iJbOoxf7FAyo2TjH25neaMHiJ8B3jS57XxtDI,5713
|
|
77
|
+
omni_cortex-1.17.3.data/data/share/omni-cortex/dashboard/backend/prompt_security.py,sha256=LcdZhYy1CfpSq_4BPO6lMJ15phc2ZXLUSBAnAvODVCI,3423
|
|
78
|
+
omni_cortex-1.17.3.data/data/share/omni-cortex/dashboard/backend/pyproject.toml,sha256=9pbbGQXLe1Xd06nZAtDySCHIlfMWvPaB-C6tGZR6umc,502
|
|
79
|
+
omni_cortex-1.17.3.data/data/share/omni-cortex/dashboard/backend/security.py,sha256=nQsoPE0n5dtY9ive00d33W1gL48GgK7C5Ae0BK2oW2k,3479
|
|
80
|
+
omni_cortex-1.17.3.data/data/share/omni-cortex/dashboard/backend/uv.lock,sha256=miB9zGGSirBkjDE-OZTPCnv43Yc98xuAz_Ne8vTNFHg,186004
|
|
81
|
+
omni_cortex-1.17.3.data/data/share/omni-cortex/dashboard/backend/websocket_manager.py,sha256=gNQLd94AcC-InumGQmUolREhiogCzilYWpLN8SRZjHI,3645
|
|
82
|
+
omni_cortex-1.17.3.dist-info/METADATA,sha256=IltAdBerajG7u8_js1_hZtmZ6h-j5DdpOXM5tQIMpbw,15712
|
|
83
|
+
omni_cortex-1.17.3.dist-info/WHEEL,sha256=WLgqFyCfm_KASv4WHyYy0P3pM_m7J5L9k2skdKLirC8,87
|
|
84
|
+
omni_cortex-1.17.3.dist-info/entry_points.txt,sha256=rohx4mFH2ffZmMb9QXPZmFf-ZGjA3jpKVDVeET-ttiM,150
|
|
85
|
+
omni_cortex-1.17.3.dist-info/licenses/LICENSE,sha256=oG_397owMmi-Umxp5sYocJ6RPohp9_bDNnnEu9OUphg,1072
|
|
86
|
+
omni_cortex-1.17.3.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{omni_cortex-1.17.2.data → omni_cortex-1.17.3.data}/data/share/omni-cortex/dashboard/backend/main.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{omni_cortex-1.17.2.data → omni_cortex-1.17.3.data}/data/share/omni-cortex/dashboard/backend/uv.lock
RENAMED
|
File without changes
|
|
File without changes
|
{omni_cortex-1.17.2.data → omni_cortex-1.17.3.data}/data/share/omni-cortex/hooks/post_tool_use.py
RENAMED
|
File without changes
|
{omni_cortex-1.17.2.data → omni_cortex-1.17.3.data}/data/share/omni-cortex/hooks/pre_tool_use.py
RENAMED
|
File without changes
|
{omni_cortex-1.17.2.data → omni_cortex-1.17.3.data}/data/share/omni-cortex/hooks/session_utils.py
RENAMED
|
File without changes
|
|
File without changes
|
{omni_cortex-1.17.2.data → omni_cortex-1.17.3.data}/data/share/omni-cortex/hooks/subagent_stop.py
RENAMED
|
File without changes
|
{omni_cortex-1.17.2.data → omni_cortex-1.17.3.data}/data/share/omni-cortex/hooks/user_prompt.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|