know-cli 0.3.3__tar.gz → 0.3.4__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.
- {know_cli-0.3.3 → know_cli-0.3.4}/PKG-INFO +1 -1
- {know_cli-0.3.3 → know_cli-0.3.4}/pyproject.toml +1 -1
- {know_cli-0.3.3 → know_cli-0.3.4}/src/know/semantic_search.py +47 -0
- {know_cli-0.3.3 → know_cli-0.3.4}/.github/actions/know-cli/action.yml +0 -0
- {know_cli-0.3.3 → know_cli-0.3.4}/.github/workflows/example-advanced.yml +0 -0
- {know_cli-0.3.3 → know_cli-0.3.4}/.github/workflows/example-basic.yml +0 -0
- {know_cli-0.3.3 → know_cli-0.3.4}/.gitignore +0 -0
- {know_cli-0.3.3 → know_cli-0.3.4}/AGENTS.md +0 -0
- {know_cli-0.3.3 → know_cli-0.3.4}/KNOW_SKILL.md +0 -0
- {know_cli-0.3.3 → know_cli-0.3.4}/README.md +0 -0
- {know_cli-0.3.3 → know_cli-0.3.4}/docs/IMPLEMENTATION_PLAN.md +0 -0
- {know_cli-0.3.3 → know_cli-0.3.4}/docs/IMPROVEMENTS.md +0 -0
- {know_cli-0.3.3 → know_cli-0.3.4}/docs/STRATEGIC_AUDIT.md +0 -0
- {know_cli-0.3.3 → know_cli-0.3.4}/docs/arc.md +0 -0
- {know_cli-0.3.3 → know_cli-0.3.4}/docs/architecture-diff.md +0 -0
- {know_cli-0.3.3 → know_cli-0.3.4}/docs/architecture.md +0 -0
- {know_cli-0.3.3 → know_cli-0.3.4}/docs/dependencies.md +0 -0
- {know_cli-0.3.3 → know_cli-0.3.4}/docs/digest-compact.md +0 -0
- {know_cli-0.3.3 → know_cli-0.3.4}/docs/digest-llm.md +0 -0
- {know_cli-0.3.3 → know_cli-0.3.4}/docs/onboarding-new-devs.md +0 -0
- {know_cli-0.3.3 → know_cli-0.3.4}/docs/onboarding-new_devs.md +0 -0
- {know_cli-0.3.3 → know_cli-0.3.4}/src/know/__init__.py +0 -0
- {know_cli-0.3.3 → know_cli-0.3.4}/src/know/ai.py +0 -0
- {know_cli-0.3.3 → know_cli-0.3.4}/src/know/cli.py +0 -0
- {know_cli-0.3.3 → know_cli-0.3.4}/src/know/config.py +0 -0
- {know_cli-0.3.3 → know_cli-0.3.4}/src/know/context_engine.py +0 -0
- {know_cli-0.3.3 → know_cli-0.3.4}/src/know/cost.py +0 -0
- {know_cli-0.3.3 → know_cli-0.3.4}/src/know/diff.py +0 -0
- {know_cli-0.3.3 → know_cli-0.3.4}/src/know/exceptions.py +0 -0
- {know_cli-0.3.3 → know_cli-0.3.4}/src/know/generator.py +0 -0
- {know_cli-0.3.3 → know_cli-0.3.4}/src/know/git_hooks.py +0 -0
- {know_cli-0.3.3 → know_cli-0.3.4}/src/know/history.py +0 -0
- {know_cli-0.3.3 → know_cli-0.3.4}/src/know/import_graph.py +0 -0
- {know_cli-0.3.3 → know_cli-0.3.4}/src/know/index.py +0 -0
- {know_cli-0.3.3 → know_cli-0.3.4}/src/know/knowledge_base.py +0 -0
- {know_cli-0.3.3 → know_cli-0.3.4}/src/know/lexical_index.py +0 -0
- {know_cli-0.3.3 → know_cli-0.3.4}/src/know/logger.py +0 -0
- {know_cli-0.3.3 → know_cli-0.3.4}/src/know/mcp_server.py +0 -0
- {know_cli-0.3.3 → know_cli-0.3.4}/src/know/models.py +0 -0
- {know_cli-0.3.3 → know_cli-0.3.4}/src/know/parsers.py +0 -0
- {know_cli-0.3.3 → know_cli-0.3.4}/src/know/quality.py +0 -0
- {know_cli-0.3.3 → know_cli-0.3.4}/src/know/scanner.py +0 -0
- {know_cli-0.3.3 → know_cli-0.3.4}/src/know/state.py +0 -0
- {know_cli-0.3.3 → know_cli-0.3.4}/src/know/stats.py +0 -0
- {know_cli-0.3.3 → know_cli-0.3.4}/src/know/token_counter.py +0 -0
- {know_cli-0.3.3 → know_cli-0.3.4}/src/know/tools.py +0 -0
- {know_cli-0.3.3 → know_cli-0.3.4}/src/know/watcher.py +0 -0
- {know_cli-0.3.3 → know_cli-0.3.4}/tests/README.md +0 -0
- {know_cli-0.3.3 → know_cli-0.3.4}/tests/conftest.py +0 -0
- {know_cli-0.3.3 → know_cli-0.3.4}/tests/mcp_stub/mcp/__init__.py +0 -0
- {know_cli-0.3.3 → know_cli-0.3.4}/tests/mcp_stub/mcp/server/__init__.py +0 -0
- {know_cli-0.3.3 → know_cli-0.3.4}/tests/mcp_stub/mcp/server/fastmcp.py +0 -0
- {know_cli-0.3.3 → know_cli-0.3.4}/tests/test_efficiency.py +0 -0
- {know_cli-0.3.3 → know_cli-0.3.4}/tests/test_history_cost.py +0 -0
- {know_cli-0.3.3 → know_cli-0.3.4}/tests/test_know.py +0 -0
- {know_cli-0.3.3 → know_cli-0.3.4}/tests/test_search_hybrid.py +0 -0
- {know_cli-0.3.3 → know_cli-0.3.4}/tests/test_state.py +0 -0
- {know_cli-0.3.3 → know_cli-0.3.4}/tests/test_unit.py +0 -0
- {know_cli-0.3.3 → know_cli-0.3.4}/tests/test_week2.py +0 -0
- {know_cli-0.3.3 → know_cli-0.3.4}/tests/test_week3.py +0 -0
- {know_cli-0.3.3 → know_cli-0.3.4}/tests/test_week4.py +0 -0
- {know_cli-0.3.3 → know_cli-0.3.4}/tests/test_week6_tools.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: know-cli
|
|
3
|
-
Version: 0.3.
|
|
3
|
+
Version: 0.3.4
|
|
4
4
|
Summary: Context Intelligence for AI Coding Agents — smart, token-budgeted code context
|
|
5
5
|
Project-URL: Homepage, https://github.com/vic/know-cli
|
|
6
6
|
Project-URL: Repository, https://github.com/vic/know-cli
|
|
@@ -681,6 +681,53 @@ class SemanticSearcher:
|
|
|
681
681
|
}
|
|
682
682
|
results.append(out)
|
|
683
683
|
|
|
684
|
+
# Hard fallback: plain text grep when hybrid/vector/lexical all miss.
|
|
685
|
+
# This guarantees useful results for exact keyword queries in TS/React projects.
|
|
686
|
+
if not results and query.strip():
|
|
687
|
+
q = query.strip().lower()
|
|
688
|
+
exts = {".py", ".ts", ".tsx", ".js", ".jsx", ".go", ".rs", ".java", ".cpp", ".c", ".h", ".md"}
|
|
689
|
+
fallback = []
|
|
690
|
+
for p in root.rglob("*"):
|
|
691
|
+
if not p.is_file() or p.suffix.lower() not in exts:
|
|
692
|
+
continue
|
|
693
|
+
rel = str(p.relative_to(root))
|
|
694
|
+
if path_prefix and not rel.startswith(path_prefix):
|
|
695
|
+
continue
|
|
696
|
+
if type_suffix:
|
|
697
|
+
suf = type_suffix if type_suffix.startswith(".") else f".{type_suffix}"
|
|
698
|
+
if not rel.endswith(suf):
|
|
699
|
+
continue
|
|
700
|
+
if any(part.startswith(".") or part in {"node_modules", "__pycache__", "venv", ".git", "dist", "build"} for part in p.parts):
|
|
701
|
+
continue
|
|
702
|
+
try:
|
|
703
|
+
text = p.read_text(encoding="utf-8", errors="ignore")
|
|
704
|
+
except Exception:
|
|
705
|
+
continue
|
|
706
|
+
idx = text.lower().find(q)
|
|
707
|
+
if idx < 0:
|
|
708
|
+
continue
|
|
709
|
+
line_no = text[:idx].count("\n") + 1
|
|
710
|
+
snippet = _format_snippet(p, line_no, line_no, context=2, include_line_numbers=include_line_numbers)
|
|
711
|
+
fallback.append((rel, line_no, snippet))
|
|
712
|
+
if len(fallback) >= top_k:
|
|
713
|
+
break
|
|
714
|
+
|
|
715
|
+
for i, (rel, line_no, snippet) in enumerate(fallback, start=1):
|
|
716
|
+
results.append({
|
|
717
|
+
"schema": "know.search.v1",
|
|
718
|
+
"engine": "text-fallback",
|
|
719
|
+
"rank": i,
|
|
720
|
+
"doc_id": f"{rel}::line::{line_no}",
|
|
721
|
+
"path": rel,
|
|
722
|
+
"name": Path(rel).stem,
|
|
723
|
+
"chunk_type": "line",
|
|
724
|
+
"start_line": line_no,
|
|
725
|
+
"end_line": line_no,
|
|
726
|
+
"scores": {"rrf": 0.01, "lexical_bm25": None, "vector": None},
|
|
727
|
+
"snippet": snippet,
|
|
728
|
+
"rationale": {"lexical_available": lexical_available, "vector_available": vector_available},
|
|
729
|
+
})
|
|
730
|
+
|
|
684
731
|
return results
|
|
685
732
|
|
|
686
733
|
def clear_cache(self):
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|