stache-tools 0.1.0__tar.gz
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.
- stache_tools-0.1.0/.env.example +72 -0
- stache_tools-0.1.0/.gitignore +81 -0
- stache_tools-0.1.0/CHANGELOG.md +17 -0
- stache_tools-0.1.0/LICENSE +21 -0
- stache_tools-0.1.0/PKG-INFO +720 -0
- stache_tools-0.1.0/README.md +675 -0
- stache_tools-0.1.0/SETUP.md +100 -0
- stache_tools-0.1.0/pyproject.toml +129 -0
- stache_tools-0.1.0/src/stache_tools/__init__.py +33 -0
- stache_tools-0.1.0/src/stache_tools/cli/__init__.py +5 -0
- stache_tools-0.1.0/src/stache_tools/cli/__main__.py +6 -0
- stache_tools-0.1.0/src/stache_tools/cli/documents.py +120 -0
- stache_tools-0.1.0/src/stache_tools/cli/health.py +67 -0
- stache_tools-0.1.0/src/stache_tools/cli/ingest.py +215 -0
- stache_tools-0.1.0/src/stache_tools/cli/main.py +49 -0
- stache_tools-0.1.0/src/stache_tools/cli/models.py +58 -0
- stache_tools-0.1.0/src/stache_tools/cli/namespaces.py +167 -0
- stache_tools-0.1.0/src/stache_tools/cli/search.py +92 -0
- stache_tools-0.1.0/src/stache_tools/client/__init__.py +67 -0
- stache_tools-0.1.0/src/stache_tools/client/api.py +340 -0
- stache_tools-0.1.0/src/stache_tools/client/config.py +147 -0
- stache_tools-0.1.0/src/stache_tools/client/exceptions.py +55 -0
- stache_tools-0.1.0/src/stache_tools/client/factory.py +49 -0
- stache_tools-0.1.0/src/stache_tools/client/http.py +237 -0
- stache_tools-0.1.0/src/stache_tools/client/lambda_transport.py +355 -0
- stache_tools-0.1.0/src/stache_tools/client/retry.py +91 -0
- stache_tools-0.1.0/src/stache_tools/client/transport.py +114 -0
- stache_tools-0.1.0/src/stache_tools/loaders/__init__.py +43 -0
- stache_tools-0.1.0/src/stache_tools/loaders/base.py +40 -0
- stache_tools-0.1.0/src/stache_tools/loaders/pdf.py +45 -0
- stache_tools-0.1.0/src/stache_tools/loaders/registry.py +108 -0
- stache_tools-0.1.0/src/stache_tools/loaders/text.py +45 -0
- stache_tools-0.1.0/src/stache_tools/mcp/__init__.py +5 -0
- stache_tools-0.1.0/src/stache_tools/mcp/__main__.py +6 -0
- stache_tools-0.1.0/src/stache_tools/mcp/formatters.py +89 -0
- stache_tools-0.1.0/src/stache_tools/mcp/server.py +79 -0
- stache_tools-0.1.0/src/stache_tools/mcp/tools.py +364 -0
- stache_tools-0.1.0/src/stache_tools/plugins/__init__.py +20 -0
- stache_tools-0.1.0/src/stache_tools/plugins/base.py +27 -0
- stache_tools-0.1.0/src/stache_tools/plugins/enrichment.py +64 -0
- stache_tools-0.1.0/src/stache_tools/plugins/ocr.py +63 -0
- stache_tools-0.1.0/src/stache_tools/py.typed +0 -0
- stache_tools-0.1.0/tests/__init__.py +1 -0
- stache_tools-0.1.0/tests/cli/__init__.py +1 -0
- stache_tools-0.1.0/tests/client/__init__.py +1 -0
- stache_tools-0.1.0/tests/client/test_lambda_transport.py +408 -0
- stache_tools-0.1.0/tests/conftest.py +82 -0
- stache_tools-0.1.0/tests/loaders/__init__.py +1 -0
- stache_tools-0.1.0/tests/mcp/__init__.py +1 -0
- stache_tools-0.1.0/tests/test_client.py +84 -0
- stache_tools-0.1.0/tests/test_loaders.py +80 -0
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
# Stache Tools Configuration
|
|
2
|
+
# Copy this file to .env and update with your values
|
|
3
|
+
|
|
4
|
+
# =============================================================================
|
|
5
|
+
# Transport Selection
|
|
6
|
+
# =============================================================================
|
|
7
|
+
|
|
8
|
+
# Transport mode: auto, http, or lambda
|
|
9
|
+
# - auto (default): Uses Lambda if STACHE_LAMBDA_FUNCTION is set, otherwise HTTP
|
|
10
|
+
# - http: Forces HTTP transport (requires API URL and optionally OAuth)
|
|
11
|
+
# - lambda: Forces Lambda transport (requires AWS credentials)
|
|
12
|
+
STACHE_TRANSPORT=auto
|
|
13
|
+
|
|
14
|
+
# Request timeout in seconds (1-300)
|
|
15
|
+
# Default: 60 seconds
|
|
16
|
+
STACHE_TIMEOUT=60.0
|
|
17
|
+
|
|
18
|
+
# =============================================================================
|
|
19
|
+
# HTTP Transport Settings
|
|
20
|
+
# =============================================================================
|
|
21
|
+
|
|
22
|
+
# Stache API URL
|
|
23
|
+
# For local development: http://localhost:8000/
|
|
24
|
+
# For AWS deployment: https://xxx.execute-api.region.amazonaws.com/Prod/
|
|
25
|
+
STACHE_API_URL=http://localhost:8000/
|
|
26
|
+
|
|
27
|
+
# =============================================================================
|
|
28
|
+
# OAuth/Cognito Settings (for HTTP transport with auth)
|
|
29
|
+
# =============================================================================
|
|
30
|
+
# Required for authentication with AWS deployed Stache instances
|
|
31
|
+
# Leave blank for local development without authentication
|
|
32
|
+
|
|
33
|
+
# Cognito OAuth Client ID
|
|
34
|
+
# Get from AWS Cognito User Pool App Client (stache-tools-client)
|
|
35
|
+
STACHE_COGNITO_CLIENT_ID=
|
|
36
|
+
|
|
37
|
+
# Cognito OAuth Client Secret
|
|
38
|
+
# Get from AWS Cognito User Pool App Client
|
|
39
|
+
STACHE_COGNITO_CLIENT_SECRET=
|
|
40
|
+
|
|
41
|
+
# Cognito Token URL
|
|
42
|
+
# Format: https://your-domain.auth.region.amazoncognito.com/oauth2/token
|
|
43
|
+
STACHE_COGNITO_TOKEN_URL=
|
|
44
|
+
|
|
45
|
+
# OAuth scope for token requests
|
|
46
|
+
# Format: resource-server/scope resource-server/scope
|
|
47
|
+
STACHE_COGNITO_SCOPE=stache-serverless-api/read stache-serverless-api/write
|
|
48
|
+
|
|
49
|
+
# =============================================================================
|
|
50
|
+
# Lambda Transport Settings
|
|
51
|
+
# =============================================================================
|
|
52
|
+
# Uses AWS credentials directly - no OAuth setup needed
|
|
53
|
+
# When set, auto transport will use Lambda
|
|
54
|
+
|
|
55
|
+
# Lambda function name or ARN
|
|
56
|
+
# Get from CloudFormation outputs: stache-api
|
|
57
|
+
STACHE_LAMBDA_FUNCTION=
|
|
58
|
+
|
|
59
|
+
# AWS region (defaults to us-east-1)
|
|
60
|
+
AWS_REGION=us-east-1
|
|
61
|
+
|
|
62
|
+
# AWS profile (optional, uses default credential chain if not set)
|
|
63
|
+
# AWS_PROFILE=my-profile
|
|
64
|
+
|
|
65
|
+
# =============================================================================
|
|
66
|
+
# Logging
|
|
67
|
+
# =============================================================================
|
|
68
|
+
|
|
69
|
+
# Log level for stache-tools client
|
|
70
|
+
# Valid values: DEBUG, INFO, WARNING, ERROR, CRITICAL
|
|
71
|
+
# Default: INFO
|
|
72
|
+
STACHE_LOG_LEVEL=INFO
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
# Byte-compiled / optimized / DLL files
|
|
2
|
+
__pycache__/
|
|
3
|
+
*.py[cod]
|
|
4
|
+
*$py.class
|
|
5
|
+
*.so
|
|
6
|
+
|
|
7
|
+
# Distribution / packaging
|
|
8
|
+
.Python
|
|
9
|
+
build/
|
|
10
|
+
develop-eggs/
|
|
11
|
+
dist/
|
|
12
|
+
downloads/
|
|
13
|
+
eggs/
|
|
14
|
+
.eggs/
|
|
15
|
+
lib/
|
|
16
|
+
lib64/
|
|
17
|
+
parts/
|
|
18
|
+
sdist/
|
|
19
|
+
var/
|
|
20
|
+
wheels/
|
|
21
|
+
pip-wheel-metadata/
|
|
22
|
+
share/python-wheels/
|
|
23
|
+
*.egg-info/
|
|
24
|
+
.installed.cfg
|
|
25
|
+
*.egg
|
|
26
|
+
MANIFEST
|
|
27
|
+
|
|
28
|
+
# Virtual environments
|
|
29
|
+
venv/
|
|
30
|
+
.venv/
|
|
31
|
+
env/
|
|
32
|
+
ENV/
|
|
33
|
+
env.bak/
|
|
34
|
+
venv.bak/
|
|
35
|
+
|
|
36
|
+
# PyTest
|
|
37
|
+
.pytest_cache/
|
|
38
|
+
.tox/
|
|
39
|
+
.nox/
|
|
40
|
+
|
|
41
|
+
# Coverage reports
|
|
42
|
+
htmlcov/
|
|
43
|
+
.coverage
|
|
44
|
+
.coverage.*
|
|
45
|
+
coverage.xml
|
|
46
|
+
*.cover
|
|
47
|
+
*.py,cover
|
|
48
|
+
.hypothesis/
|
|
49
|
+
|
|
50
|
+
# Type checking
|
|
51
|
+
.mypy_cache/
|
|
52
|
+
.dmypy.json
|
|
53
|
+
dmypy.json
|
|
54
|
+
.pyre/
|
|
55
|
+
.pytype/
|
|
56
|
+
|
|
57
|
+
# Linting
|
|
58
|
+
.ruff_cache/
|
|
59
|
+
|
|
60
|
+
# Environment variables
|
|
61
|
+
.env
|
|
62
|
+
|
|
63
|
+
# Local MCP config files (contain credentials)
|
|
64
|
+
mcp-config-*.json
|
|
65
|
+
|
|
66
|
+
# Logs
|
|
67
|
+
*.log
|
|
68
|
+
|
|
69
|
+
# OS files
|
|
70
|
+
.DS_Store
|
|
71
|
+
Thumbs.db
|
|
72
|
+
|
|
73
|
+
# IDE / Editor files
|
|
74
|
+
.idea/
|
|
75
|
+
.vscode/
|
|
76
|
+
*.swp
|
|
77
|
+
*.swo
|
|
78
|
+
*~
|
|
79
|
+
.project
|
|
80
|
+
.pydevproject
|
|
81
|
+
.settings/
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
All notable changes to this project will be documented in this file.
|
|
4
|
+
|
|
5
|
+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
|
|
6
|
+
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
|
+
|
|
8
|
+
## [0.1.0] - 2025-01-01
|
|
9
|
+
|
|
10
|
+
### Added
|
|
11
|
+
- Python API client (`StacheAPI`) with OAuth2 client credentials support
|
|
12
|
+
- CLI (`stache`) with commands: search, ingest, namespace, doc, health
|
|
13
|
+
- MCP server (`stache-mcp`) for Claude Desktop integration
|
|
14
|
+
- Document loaders for PDF, Markdown, and plain text
|
|
15
|
+
- Plugin system for custom loaders via entry points
|
|
16
|
+
- Automatic retry with exponential backoff for transient failures
|
|
17
|
+
- Request ID tracking for debugging
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 Stache Team
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|