footprinter-cli 1.0.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.
- footprinter/__init__.py +8 -0
- footprinter/access.py +444 -0
- footprinter/api/__init__.py +1 -0
- footprinter/api/db.py +61 -0
- footprinter/api/entities.py +250 -0
- footprinter/api/search.py +47 -0
- footprinter/api/semantic.py +33 -0
- footprinter/api/server.py +66 -0
- footprinter/api/status.py +15 -0
- footprinter/bundled/__init__.py +0 -0
- footprinter/bundled/config.example.yaml +161 -0
- footprinter/bundled/patterns/context_patterns.yaml +18 -0
- footprinter/bundled/patterns/extensions.yaml +283 -0
- footprinter/bundled/patterns/filename_patterns.yaml +61 -0
- footprinter/bundled/patterns/mime_mappings.yaml +68 -0
- footprinter/bundled/patterns/salesforce_rules.yaml +84 -0
- footprinter/bundled/patterns/security_patterns.yaml +27 -0
- footprinter/cli/__init__.py +128 -0
- footprinter/cli/__main__.py +6 -0
- footprinter/cli/_common.py +332 -0
- footprinter/cli/_policy_helpers.py +646 -0
- footprinter/cli/_prompt.py +220 -0
- footprinter/cli/api_cmd.py +32 -0
- footprinter/cli/connect.py +591 -0
- footprinter/cli/data.py +879 -0
- footprinter/cli/delete.py +128 -0
- footprinter/cli/ingest.py +579 -0
- footprinter/cli/mcp_cmd.py +750 -0
- footprinter/cli/mcp_setup.py +306 -0
- footprinter/cli/search.py +393 -0
- footprinter/cli/search_cmd.py +69 -0
- footprinter/cli/setup.py +1836 -0
- footprinter/cli/status.py +729 -0
- footprinter/cli/status_cmd.py +104 -0
- footprinter/cli/upsert.py +794 -0
- footprinter/cli/vectorize_cmd.py +215 -0
- footprinter/cli/view.py +322 -0
- footprinter/connectors/__init__.py +171 -0
- footprinter/connectors/config_utils.py +141 -0
- footprinter/db/__init__.py +37 -0
- footprinter/db/browser.py +198 -0
- footprinter/db/chats.py +610 -0
- footprinter/db/clients.py +307 -0
- footprinter/db/emails.py +279 -0
- footprinter/db/files.py +741 -0
- footprinter/db/folders.py +659 -0
- footprinter/db/messages.py +192 -0
- footprinter/db/policies.py +151 -0
- footprinter/db/projects.py +673 -0
- footprinter/db/search.py +573 -0
- footprinter/db/sql_utils.py +168 -0
- footprinter/db/status.py +320 -0
- footprinter/db/uploads.py +70 -0
- footprinter/ingest/__init__.py +0 -0
- footprinter/ingest/adapters/__init__.py +33 -0
- footprinter/ingest/adapters/browser.py +54 -0
- footprinter/ingest/adapters/chat.py +57 -0
- footprinter/ingest/adapters/ingest.py +146 -0
- footprinter/ingest/adapters/local_files.py +68 -0
- footprinter/ingest/adapters/local_folders.py +52 -0
- footprinter/ingest/adapters/protocol.py +174 -0
- footprinter/ingest/browser_indexer.py +216 -0
- footprinter/ingest/chat_dedup.py +156 -0
- footprinter/ingest/chat_indexer.py +515 -0
- footprinter/ingest/chat_parsers/__init__.py +8 -0
- footprinter/ingest/chat_parsers/chatgpt_parser.py +229 -0
- footprinter/ingest/chat_parsers/claude_parser.py +161 -0
- footprinter/ingest/cli.py +827 -0
- footprinter/ingest/content_extractors.py +117 -0
- footprinter/ingest/database.py +36 -0
- footprinter/ingest/db/__init__.py +1 -0
- footprinter/ingest/db/connector_schema.py +47 -0
- footprinter/ingest/db/migration.py +328 -0
- footprinter/ingest/db/schema.py +1043 -0
- footprinter/ingest/db/security.py +6 -0
- footprinter/ingest/file_indexer.py +261 -0
- footprinter/ingest/file_scanner.py +277 -0
- footprinter/ingest/folder_indexer.py +226 -0
- footprinter/ingest/full_content_extractor.py +321 -0
- footprinter/ingest/orchestrator.py +125 -0
- footprinter/ingest/pipe_runner.py +217 -0
- footprinter/ingest/processing.py +165 -0
- footprinter/ingest/registry.py +201 -0
- footprinter/ingest/run_record.py +91 -0
- footprinter/ingest/status.py +346 -0
- footprinter/mcp/__init__.py +0 -0
- footprinter/mcp/__main__.py +5 -0
- footprinter/mcp/db.py +57 -0
- footprinter/mcp/errors.py +102 -0
- footprinter/mcp/extraction.py +226 -0
- footprinter/mcp/server.py +39 -0
- footprinter/mcp/tools/__init__.py +0 -0
- footprinter/mcp/tools/navigation.py +70 -0
- footprinter/mcp/tools/read.py +75 -0
- footprinter/mcp/tools/search.py +158 -0
- footprinter/mcp/tools/semantic.py +79 -0
- footprinter/mcp/tools/status.py +15 -0
- footprinter/paths.py +91 -0
- footprinter/permissions.py +1160 -0
- footprinter/semantic/__init__.py +13 -0
- footprinter/semantic/chunking.py +52 -0
- footprinter/semantic/embeddings.py +23 -0
- footprinter/semantic/hybrid_search.py +273 -0
- footprinter/semantic/vector_store.py +471 -0
- footprinter/services/__init__.py +49 -0
- footprinter/services/access_service.py +342 -0
- footprinter/services/chat_service.py +85 -0
- footprinter/services/client_service.py +267 -0
- footprinter/services/content_service.py +181 -0
- footprinter/services/email_service.py +89 -0
- footprinter/services/file_service.py +83 -0
- footprinter/services/folder_service.py +122 -0
- footprinter/services/includes.py +19 -0
- footprinter/services/ingest_service.py +231 -0
- footprinter/services/project_service.py +262 -0
- footprinter/services/roles.py +25 -0
- footprinter/services/search_service.py +177 -0
- footprinter/services/semantic_service.py +360 -0
- footprinter/services/status_service.py +18 -0
- footprinter/services/visit_service.py +65 -0
- footprinter/source_registry.py +194 -0
- footprinter/utils/__init__.py +7 -0
- footprinter/utils/hash_utils.py +59 -0
- footprinter/utils/logging_config.py +68 -0
- footprinter/utils/mime.py +30 -0
- footprinter/utils/text.py +6 -0
- footprinter/utils/time.py +11 -0
- footprinter/visibility.py +1272 -0
- footprinter_cli-1.0.0.dist-info/LICENSE +21 -0
- footprinter_cli-1.0.0.dist-info/METADATA +229 -0
- footprinter_cli-1.0.0.dist-info/RECORD +134 -0
- footprinter_cli-1.0.0.dist-info/WHEEL +5 -0
- footprinter_cli-1.0.0.dist-info/entry_points.txt +2 -0
- footprinter_cli-1.0.0.dist-info/top_level.txt +1 -0
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
"""fp status — show data counts and system health.
|
|
2
|
+
|
|
3
|
+
Delegates to the existing functions in ``footprinter.cli.status`` so the
|
|
4
|
+
standalone ``fp status`` command and this router entry share one code path.
|
|
5
|
+
"""
|
|
6
|
+
|
|
7
|
+
from footprinter.cli._common import add_json_flag, console, output_json
|
|
8
|
+
from footprinter.cli.status import (
|
|
9
|
+
get_data_counts,
|
|
10
|
+
get_source_health,
|
|
11
|
+
print_status,
|
|
12
|
+
)
|
|
13
|
+
from footprinter.paths import get_config_path, get_db_path
|
|
14
|
+
from footprinter.source_registry import get_config
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
def register(subparsers) -> None:
|
|
18
|
+
"""Register ``fp status`` on the CLI router."""
|
|
19
|
+
from footprinter.cli._common import FORMATTER
|
|
20
|
+
|
|
21
|
+
parser = subparsers.add_parser(
|
|
22
|
+
"status",
|
|
23
|
+
help="Show data counts and system health",
|
|
24
|
+
description=(
|
|
25
|
+
"Display data counts, database info, and source health.\n"
|
|
26
|
+
"Shows a summary of all indexed content and connector status."
|
|
27
|
+
),
|
|
28
|
+
epilog=(
|
|
29
|
+
"examples:\n"
|
|
30
|
+
" fp status Full status overview\n"
|
|
31
|
+
" fp status --last-run Details from the last pipeline run\n"
|
|
32
|
+
" fp status --json Machine-readable output"
|
|
33
|
+
),
|
|
34
|
+
formatter_class=FORMATTER,
|
|
35
|
+
)
|
|
36
|
+
parser.add_argument(
|
|
37
|
+
"--last-run",
|
|
38
|
+
action="store_true",
|
|
39
|
+
help="Show details from the last pipeline run",
|
|
40
|
+
)
|
|
41
|
+
add_json_flag(parser)
|
|
42
|
+
parser.set_defaults(func=_handle)
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
def _handle(args) -> None:
|
|
46
|
+
"""Route ``fp status`` to the appropriate handler."""
|
|
47
|
+
# --last-run takes priority over everything
|
|
48
|
+
if getattr(args, "last_run", False):
|
|
49
|
+
from footprinter.cli.status import print_last_run
|
|
50
|
+
from footprinter.ingest.run_record import load_run_record
|
|
51
|
+
|
|
52
|
+
print_last_run(load_run_record())
|
|
53
|
+
return
|
|
54
|
+
|
|
55
|
+
db_path = get_db_path()
|
|
56
|
+
config_path = get_config_path()
|
|
57
|
+
|
|
58
|
+
# Full status — build structured data dict
|
|
59
|
+
data: dict = {
|
|
60
|
+
"database": {
|
|
61
|
+
"path": str(db_path),
|
|
62
|
+
"exists": db_path.exists(),
|
|
63
|
+
"size_mb": (round(db_path.stat().st_size / 1024 / 1024, 1) if db_path.exists() else 0),
|
|
64
|
+
},
|
|
65
|
+
"config": {
|
|
66
|
+
"path": str(config_path),
|
|
67
|
+
"exists": config_path.exists(),
|
|
68
|
+
},
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
if not db_path.exists():
|
|
72
|
+
if getattr(args, "json", False):
|
|
73
|
+
data["counts"] = {}
|
|
74
|
+
data["health"] = {}
|
|
75
|
+
data["last_run"] = None
|
|
76
|
+
output_json(data)
|
|
77
|
+
else:
|
|
78
|
+
from rich.panel import Panel
|
|
79
|
+
|
|
80
|
+
console.print(
|
|
81
|
+
Panel(
|
|
82
|
+
f"No database found at [cyan]{db_path}[/cyan]\nRun [bold]fp ingest[/bold] to start indexing.",
|
|
83
|
+
title="Footprinter Status",
|
|
84
|
+
expand=False,
|
|
85
|
+
)
|
|
86
|
+
)
|
|
87
|
+
return
|
|
88
|
+
|
|
89
|
+
try:
|
|
90
|
+
config = get_config()
|
|
91
|
+
except Exception:
|
|
92
|
+
config = None
|
|
93
|
+
|
|
94
|
+
counts = get_data_counts(db_path)
|
|
95
|
+
health = get_source_health(config)
|
|
96
|
+
|
|
97
|
+
data["counts"] = counts
|
|
98
|
+
data["health"] = health
|
|
99
|
+
data["last_run"] = counts.get("last_run")
|
|
100
|
+
|
|
101
|
+
if getattr(args, "json", False):
|
|
102
|
+
output_json(data)
|
|
103
|
+
else:
|
|
104
|
+
print_status(data, health)
|