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,69 @@
|
|
|
1
|
+
"""fp search — keyword, semantic, and hybrid search across indexed content.
|
|
2
|
+
|
|
3
|
+
Thin wrapper that delegates to :func:`footprinter.cli.search.execute_search`
|
|
4
|
+
so both ``fp search`` and direct invocations share one code path.
|
|
5
|
+
"""
|
|
6
|
+
|
|
7
|
+
from footprinter.cli._common import FORMATTER, add_json_flag, console
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
def register(subparsers) -> None:
|
|
11
|
+
"""Register ``fp search`` on the CLI router."""
|
|
12
|
+
parser = subparsers.add_parser(
|
|
13
|
+
"search",
|
|
14
|
+
help="Search across indexed content",
|
|
15
|
+
description=(
|
|
16
|
+
"Search across indexed files and chats using\nkeyword (FTS5), semantic (vector), or hybrid (both) matching."
|
|
17
|
+
),
|
|
18
|
+
epilog=(
|
|
19
|
+
"examples:\n"
|
|
20
|
+
" fp search 'database migration' Search (auto-detect mode)\n"
|
|
21
|
+
" fp search 'auth flow' --mode keyword FTS5 keyword search\n"
|
|
22
|
+
" fp search 'auth flow' --mode semantic Vector search only\n"
|
|
23
|
+
" fp search 'auth flow' --mode hybrid Keyword + semantic fusion\n"
|
|
24
|
+
" fp search 'auth flow' -n 20 Return 20 results\n"
|
|
25
|
+
" fp search 'invoice' --type .pdf Only PDF files\n"
|
|
26
|
+
" fp search oauth token refresh Multi-word query\n"
|
|
27
|
+
" fp search 'auth flow' --json JSON output"
|
|
28
|
+
),
|
|
29
|
+
formatter_class=FORMATTER,
|
|
30
|
+
)
|
|
31
|
+
parser.add_argument("query", nargs="*", help="Search query (multiple words joined)")
|
|
32
|
+
parser.add_argument(
|
|
33
|
+
"--mode",
|
|
34
|
+
choices=["keyword", "semantic", "hybrid"],
|
|
35
|
+
default=None,
|
|
36
|
+
help=(
|
|
37
|
+
"Search mode: keyword (FTS5), semantic (vectors), hybrid (both)."
|
|
38
|
+
" Default: hybrid if ML available, keyword otherwise."
|
|
39
|
+
),
|
|
40
|
+
)
|
|
41
|
+
parser.add_argument(
|
|
42
|
+
"-n",
|
|
43
|
+
"--limit",
|
|
44
|
+
type=int,
|
|
45
|
+
default=10,
|
|
46
|
+
help="Max results to return (default: 10)",
|
|
47
|
+
)
|
|
48
|
+
parser.add_argument(
|
|
49
|
+
"--type",
|
|
50
|
+
help="Filter by file type (e.g. .pdf, .md); excludes chat results",
|
|
51
|
+
)
|
|
52
|
+
add_json_flag(parser)
|
|
53
|
+
|
|
54
|
+
def _handle(args) -> None:
|
|
55
|
+
if not args.query:
|
|
56
|
+
parser.print_help()
|
|
57
|
+
return
|
|
58
|
+
from footprinter.cli.search import execute_search
|
|
59
|
+
|
|
60
|
+
execute_search(
|
|
61
|
+
query=" ".join(args.query),
|
|
62
|
+
limit=args.limit,
|
|
63
|
+
type_filter=args.type,
|
|
64
|
+
mode=args.mode,
|
|
65
|
+
output=console,
|
|
66
|
+
json_output=getattr(args, "json", False),
|
|
67
|
+
)
|
|
68
|
+
|
|
69
|
+
parser.set_defaults(func=_handle)
|