stravinsky 0.2.52__py3-none-any.whl → 0.4.18__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.

Potentially problematic release.


This version of stravinsky might be problematic. Click here for more details.

Files changed (58) hide show
  1. mcp_bridge/__init__.py +1 -1
  2. mcp_bridge/auth/token_store.py +113 -11
  3. mcp_bridge/cli/__init__.py +6 -0
  4. mcp_bridge/cli/install_hooks.py +1265 -0
  5. mcp_bridge/cli/session_report.py +585 -0
  6. mcp_bridge/config/MANIFEST_SCHEMA.md +305 -0
  7. mcp_bridge/config/README.md +276 -0
  8. mcp_bridge/config/hook_config.py +249 -0
  9. mcp_bridge/config/hooks_manifest.json +138 -0
  10. mcp_bridge/config/rate_limits.py +222 -0
  11. mcp_bridge/config/skills_manifest.json +128 -0
  12. mcp_bridge/hooks/HOOKS_SETTINGS.json +175 -0
  13. mcp_bridge/hooks/README.md +215 -0
  14. mcp_bridge/hooks/__init__.py +119 -60
  15. mcp_bridge/hooks/edit_recovery.py +42 -37
  16. mcp_bridge/hooks/git_noninteractive.py +89 -0
  17. mcp_bridge/hooks/keyword_detector.py +30 -0
  18. mcp_bridge/hooks/manager.py +8 -0
  19. mcp_bridge/hooks/notification_hook.py +103 -0
  20. mcp_bridge/hooks/parallel_execution.py +111 -0
  21. mcp_bridge/hooks/pre_compact.py +82 -183
  22. mcp_bridge/hooks/rules_injector.py +507 -0
  23. mcp_bridge/hooks/session_notifier.py +125 -0
  24. mcp_bridge/{native_hooks → hooks}/stravinsky_mode.py +51 -16
  25. mcp_bridge/hooks/subagent_stop.py +98 -0
  26. mcp_bridge/hooks/task_validator.py +73 -0
  27. mcp_bridge/hooks/tmux_manager.py +141 -0
  28. mcp_bridge/hooks/todo_continuation.py +90 -0
  29. mcp_bridge/hooks/todo_delegation.py +88 -0
  30. mcp_bridge/hooks/tool_messaging.py +267 -0
  31. mcp_bridge/hooks/truncator.py +21 -17
  32. mcp_bridge/notifications.py +151 -0
  33. mcp_bridge/prompts/multimodal.py +24 -3
  34. mcp_bridge/server.py +214 -49
  35. mcp_bridge/server_tools.py +445 -0
  36. mcp_bridge/tools/__init__.py +22 -18
  37. mcp_bridge/tools/agent_manager.py +220 -32
  38. mcp_bridge/tools/code_search.py +97 -11
  39. mcp_bridge/tools/lsp/__init__.py +7 -0
  40. mcp_bridge/tools/lsp/manager.py +448 -0
  41. mcp_bridge/tools/lsp/tools.py +637 -150
  42. mcp_bridge/tools/model_invoke.py +208 -106
  43. mcp_bridge/tools/query_classifier.py +323 -0
  44. mcp_bridge/tools/semantic_search.py +3042 -0
  45. mcp_bridge/tools/templates.py +32 -18
  46. mcp_bridge/update_manager.py +589 -0
  47. mcp_bridge/update_manager_pypi.py +299 -0
  48. stravinsky-0.4.18.dist-info/METADATA +468 -0
  49. stravinsky-0.4.18.dist-info/RECORD +88 -0
  50. stravinsky-0.4.18.dist-info/entry_points.txt +5 -0
  51. mcp_bridge/native_hooks/edit_recovery.py +0 -46
  52. mcp_bridge/native_hooks/todo_delegation.py +0 -54
  53. mcp_bridge/native_hooks/truncator.py +0 -23
  54. stravinsky-0.2.52.dist-info/METADATA +0 -204
  55. stravinsky-0.2.52.dist-info/RECORD +0 -63
  56. stravinsky-0.2.52.dist-info/entry_points.txt +0 -3
  57. /mcp_bridge/{native_hooks → hooks}/context.py +0 -0
  58. {stravinsky-0.2.52.dist-info → stravinsky-0.4.18.dist-info}/WHEEL +0 -0
@@ -357,6 +357,11 @@ def get_tool_definitions() -> List[Tool]:
357
357
  "description": "Maximum execution time in seconds",
358
358
  "default": 300,
359
359
  },
360
+ "blocking": {
361
+ "type": "boolean",
362
+ "description": "If true, wait for agent completion and return result directly. Recommended for delphi consultations.",
363
+ "default": False,
364
+ },
360
365
  },
361
366
  "required": ["prompt"],
362
367
  },
@@ -568,6 +573,55 @@ def get_tool_definitions() -> List[Tool]:
568
573
  "required": ["file_path", "line", "character"],
569
574
  },
570
575
  ),
576
+ Tool(
577
+ name="lsp_code_action_resolve",
578
+ description="Apply a specific code action/fix to a file (e.g., fix F401 unused import).",
579
+ inputSchema={
580
+ "type": "object",
581
+ "properties": {
582
+ "file_path": {"type": "string", "description": "Absolute path to the file"},
583
+ "action_code": {
584
+ "type": "string",
585
+ "description": "Code action ID to apply (e.g., 'F401', 'E501' for Python)",
586
+ },
587
+ "line": {
588
+ "type": "integer",
589
+ "description": "Optional line number filter (1-indexed)",
590
+ },
591
+ },
592
+ "required": ["file_path", "action_code"],
593
+ },
594
+ ),
595
+ Tool(
596
+ name="lsp_extract_refactor",
597
+ description="Extract code to a function or variable (Python via jedi).",
598
+ inputSchema={
599
+ "type": "object",
600
+ "properties": {
601
+ "file_path": {"type": "string", "description": "Absolute path to the file"},
602
+ "start_line": {"type": "integer", "description": "Start line (1-indexed)"},
603
+ "start_char": {"type": "integer", "description": "Start character (0-indexed)"},
604
+ "end_line": {"type": "integer", "description": "End line (1-indexed)"},
605
+ "end_char": {"type": "integer", "description": "End character (0-indexed)"},
606
+ "new_name": {
607
+ "type": "string",
608
+ "description": "Name for extracted function/variable",
609
+ },
610
+ "kind": {
611
+ "type": "string",
612
+ "description": "'function' or 'variable' (default: function)",
613
+ },
614
+ },
615
+ "required": [
616
+ "file_path",
617
+ "start_line",
618
+ "start_char",
619
+ "end_line",
620
+ "end_char",
621
+ "new_name",
622
+ ],
623
+ },
624
+ ),
571
625
  Tool(
572
626
  name="lsp_servers",
573
627
  description="List available LSP servers and their installation status.",
@@ -608,6 +662,397 @@ def get_tool_definitions() -> List[Tool]:
608
662
  "required": ["pattern", "replacement"],
609
663
  },
610
664
  ),
665
+ # --- SEMANTIC SEARCH ---
666
+ Tool(
667
+ name="semantic_search",
668
+ description=(
669
+ "Search codebase using natural language queries. Uses vector embeddings to find "
670
+ "semantically related code even without exact pattern matches. "
671
+ "Supports filtering by language and node type. "
672
+ "Example: 'find authentication logic' or 'error handling patterns'."
673
+ ),
674
+ inputSchema={
675
+ "type": "object",
676
+ "properties": {
677
+ "query": {
678
+ "type": "string",
679
+ "description": "Natural language search query (e.g., 'find authentication logic')",
680
+ },
681
+ "project_path": {
682
+ "type": "string",
683
+ "description": "Path to the project root",
684
+ "default": ".",
685
+ },
686
+ "n_results": {
687
+ "type": "integer",
688
+ "description": "Maximum number of results to return",
689
+ "default": 10,
690
+ },
691
+ "language": {
692
+ "type": "string",
693
+ "description": "Filter by language (e.g., 'py', 'ts', 'js')",
694
+ },
695
+ "node_type": {
696
+ "type": "string",
697
+ "description": "Filter by node type (e.g., 'function', 'class', 'method')",
698
+ },
699
+ "provider": {
700
+ "type": "string",
701
+ "description": "Embedding provider: ollama/mxbai (local/free), gemini (cloud/OAuth), openai (cloud/OAuth), huggingface (cloud)",
702
+ "enum": ["ollama", "mxbai", "gemini", "openai", "huggingface"],
703
+ "default": "ollama",
704
+ },
705
+ },
706
+ "required": ["query"],
707
+ },
708
+ ),
709
+ Tool(
710
+ name="hybrid_search",
711
+ description=(
712
+ "Hybrid search combining semantic similarity with structural AST matching. "
713
+ "Use when you need both natural language understanding AND structural patterns. "
714
+ "Example: query='find authentication logic' + pattern='def $FUNC($$$):'"
715
+ ),
716
+ inputSchema={
717
+ "type": "object",
718
+ "properties": {
719
+ "query": {
720
+ "type": "string",
721
+ "description": "Natural language search query",
722
+ },
723
+ "pattern": {
724
+ "type": "string",
725
+ "description": "ast-grep pattern for structural matching (optional)",
726
+ },
727
+ "project_path": {
728
+ "type": "string",
729
+ "description": "Path to the project root",
730
+ "default": ".",
731
+ },
732
+ "n_results": {
733
+ "type": "integer",
734
+ "description": "Maximum number of results to return",
735
+ "default": 10,
736
+ },
737
+ "language": {
738
+ "type": "string",
739
+ "description": "Filter by language (e.g., 'py', 'ts', 'js')",
740
+ },
741
+ "node_type": {
742
+ "type": "string",
743
+ "description": "Filter by node type (e.g., 'function', 'class', 'method')",
744
+ },
745
+ "decorator": {
746
+ "type": "string",
747
+ "description": "Filter by decorator (e.g., '@property', '@staticmethod')",
748
+ },
749
+ "is_async": {
750
+ "type": "boolean",
751
+ "description": "Filter by async status (True = async only, False = sync only)",
752
+ },
753
+ "base_class": {
754
+ "type": "string",
755
+ "description": "Filter by base class (e.g., 'BaseClass')",
756
+ },
757
+ "provider": {
758
+ "type": "string",
759
+ "description": "Embedding provider: ollama/mxbai (local/free), gemini (cloud/OAuth), openai (cloud/OAuth), huggingface (cloud)",
760
+ "enum": ["ollama", "mxbai", "gemini", "openai", "huggingface"],
761
+ "default": "ollama",
762
+ },
763
+ },
764
+ "required": ["query"],
765
+ },
766
+ ),
767
+ Tool(
768
+ name="semantic_index",
769
+ description=(
770
+ "Index a codebase for semantic search. Creates vector embeddings for all code files. "
771
+ "Run this before using semantic_search on a new project."
772
+ ),
773
+ inputSchema={
774
+ "type": "object",
775
+ "properties": {
776
+ "project_path": {
777
+ "type": "string",
778
+ "description": "Path to the project root",
779
+ "default": ".",
780
+ },
781
+ "force": {
782
+ "type": "boolean",
783
+ "description": "If true, reindex everything. Otherwise, only new/changed files.",
784
+ "default": False,
785
+ },
786
+ "provider": {
787
+ "type": "string",
788
+ "description": "Embedding provider: ollama/mxbai (local/free), gemini (cloud/OAuth), openai (cloud/OAuth), huggingface (cloud)",
789
+ "enum": ["ollama", "mxbai", "gemini", "openai", "huggingface"],
790
+ "default": "ollama",
791
+ },
792
+ },
793
+ },
794
+ ),
795
+ Tool(
796
+ name="semantic_stats",
797
+ description="Get statistics about the semantic search index for a project.",
798
+ inputSchema={
799
+ "type": "object",
800
+ "properties": {
801
+ "project_path": {
802
+ "type": "string",
803
+ "description": "Path to the project root",
804
+ "default": ".",
805
+ },
806
+ "provider": {
807
+ "type": "string",
808
+ "description": "Embedding provider: ollama/mxbai (local/free), gemini (cloud/OAuth), openai (cloud/OAuth), huggingface (cloud)",
809
+ "enum": ["ollama", "mxbai", "gemini", "openai", "huggingface"],
810
+ "default": "ollama",
811
+ },
812
+ },
813
+ },
814
+ ),
815
+ Tool(
816
+ name="start_file_watcher",
817
+ description=(
818
+ "Start automatic background reindexing when code files change. "
819
+ "Watches for .py file changes and triggers semantic_index automatically. "
820
+ "Run semantic_index() first before starting the watcher."
821
+ ),
822
+ inputSchema={
823
+ "type": "object",
824
+ "properties": {
825
+ "project_path": {
826
+ "type": "string",
827
+ "description": "Path to the project root",
828
+ "default": ".",
829
+ },
830
+ "provider": {
831
+ "type": "string",
832
+ "description": "Embedding provider: ollama/mxbai (local/free), gemini (cloud/OAuth), openai (cloud/OAuth), huggingface (cloud)",
833
+ "enum": ["ollama", "mxbai", "gemini", "openai", "huggingface"],
834
+ "default": "ollama",
835
+ },
836
+ "debounce_seconds": {
837
+ "type": "number",
838
+ "description": "Wait time after file changes before reindexing (default: 2.0)",
839
+ "default": 2.0,
840
+ },
841
+ },
842
+ },
843
+ ),
844
+ Tool(
845
+ name="stop_file_watcher",
846
+ description="Stop the file watcher for a project.",
847
+ inputSchema={
848
+ "type": "object",
849
+ "properties": {
850
+ "project_path": {
851
+ "type": "string",
852
+ "description": "Path to the project root",
853
+ "default": ".",
854
+ },
855
+ },
856
+ },
857
+ ),
858
+ Tool(
859
+ name="cancel_indexing",
860
+ description=(
861
+ "Cancel an ongoing semantic indexing operation. "
862
+ "Cancellation happens gracefully between batches - the current batch will complete before stopping."
863
+ ),
864
+ inputSchema={
865
+ "type": "object",
866
+ "properties": {
867
+ "project_path": {
868
+ "type": "string",
869
+ "description": "Path to the project root",
870
+ "default": ".",
871
+ },
872
+ "provider": {
873
+ "type": "string",
874
+ "description": "Embedding provider (must match the one used for indexing)",
875
+ "enum": ["ollama", "mxbai", "gemini", "openai", "huggingface"],
876
+ "default": "ollama",
877
+ },
878
+ },
879
+ },
880
+ ),
881
+ Tool(
882
+ name="delete_index",
883
+ description=(
884
+ "Delete semantic search index(es). Can delete for specific project+provider, "
885
+ "all providers for a project, or all indexes globally."
886
+ ),
887
+ inputSchema={
888
+ "type": "object",
889
+ "properties": {
890
+ "project_path": {
891
+ "type": "string",
892
+ "description": "Path to the project root (ignored if delete_all=true)",
893
+ "default": ".",
894
+ },
895
+ "provider": {
896
+ "type": "string",
897
+ "description": "Specific provider to delete (if not specified, deletes all providers for project)",
898
+ "enum": ["ollama", "mxbai", "gemini", "openai", "huggingface"],
899
+ },
900
+ "delete_all": {
901
+ "type": "boolean",
902
+ "description": "If true, delete ALL indexes for ALL projects (ignores project_path and provider)",
903
+ "default": False,
904
+ },
905
+ },
906
+ },
907
+ ),
908
+ Tool(
909
+ name="list_file_watchers",
910
+ description="List all active file watchers across all projects.",
911
+ inputSchema={
912
+ "type": "object",
913
+ "properties": {},
914
+ },
915
+ ),
916
+ Tool(
917
+ name="multi_query_search",
918
+ description=(
919
+ "Search with LLM-expanded query variations for better recall. "
920
+ "Rephrases query into multiple semantic variations (e.g., 'database connection' -> "
921
+ "['SQLAlchemy engine setup', 'postgres connection', 'db session factory']) "
922
+ "and aggregates results using reciprocal rank fusion."
923
+ ),
924
+ inputSchema={
925
+ "type": "object",
926
+ "properties": {
927
+ "query": {
928
+ "type": "string",
929
+ "description": "Natural language search query",
930
+ },
931
+ "project_path": {
932
+ "type": "string",
933
+ "description": "Path to the project root",
934
+ "default": ".",
935
+ },
936
+ "n_results": {
937
+ "type": "integer",
938
+ "description": "Maximum number of results to return",
939
+ "default": 10,
940
+ },
941
+ "num_expansions": {
942
+ "type": "integer",
943
+ "description": "Number of query variations to generate",
944
+ "default": 3,
945
+ },
946
+ "language": {
947
+ "type": "string",
948
+ "description": "Filter by language (e.g., 'py', 'ts')",
949
+ },
950
+ "node_type": {
951
+ "type": "string",
952
+ "description": "Filter by node type (e.g., 'function', 'class')",
953
+ },
954
+ "provider": {
955
+ "type": "string",
956
+ "description": "Embedding provider: ollama/mxbai (local/free), gemini (cloud/OAuth), openai (cloud/OAuth), huggingface (cloud)",
957
+ "enum": ["ollama", "mxbai", "gemini", "openai", "huggingface"],
958
+ "default": "ollama",
959
+ },
960
+ },
961
+ "required": ["query"],
962
+ },
963
+ ),
964
+ Tool(
965
+ name="decomposed_search",
966
+ description=(
967
+ "Search by decomposing complex queries into focused sub-questions. "
968
+ "Breaks multi-part queries like 'Initialize the DB and create a user model' "
969
+ "into separate searches ('database initialization', 'user model definition') "
970
+ "and returns organized results for each part."
971
+ ),
972
+ inputSchema={
973
+ "type": "object",
974
+ "properties": {
975
+ "query": {
976
+ "type": "string",
977
+ "description": "Complex search query (may contain multiple concepts)",
978
+ },
979
+ "project_path": {
980
+ "type": "string",
981
+ "description": "Path to the project root",
982
+ "default": ".",
983
+ },
984
+ "n_results": {
985
+ "type": "integer",
986
+ "description": "Maximum results per sub-query",
987
+ "default": 10,
988
+ },
989
+ "language": {
990
+ "type": "string",
991
+ "description": "Filter by language",
992
+ },
993
+ "node_type": {
994
+ "type": "string",
995
+ "description": "Filter by node type",
996
+ },
997
+ "provider": {
998
+ "type": "string",
999
+ "description": "Embedding provider: ollama/mxbai (local/free), gemini (cloud/OAuth), openai (cloud/OAuth), huggingface (cloud)",
1000
+ "enum": ["ollama", "mxbai", "gemini", "openai", "huggingface"],
1001
+ "default": "ollama",
1002
+ },
1003
+ },
1004
+ "required": ["query"],
1005
+ },
1006
+ ),
1007
+ Tool(
1008
+ name="enhanced_search",
1009
+ description=(
1010
+ "Unified enhanced search combining query expansion and decomposition. "
1011
+ "Automatically selects strategy based on query complexity: "
1012
+ "simple queries use multi-query expansion, complex queries use decomposition. "
1013
+ "Use mode='auto' (default), 'expand', 'decompose', or 'both'."
1014
+ ),
1015
+ inputSchema={
1016
+ "type": "object",
1017
+ "properties": {
1018
+ "query": {
1019
+ "type": "string",
1020
+ "description": "Search query (simple or complex)",
1021
+ },
1022
+ "project_path": {
1023
+ "type": "string",
1024
+ "description": "Path to the project root",
1025
+ "default": ".",
1026
+ },
1027
+ "n_results": {
1028
+ "type": "integer",
1029
+ "description": "Maximum number of results",
1030
+ "default": 10,
1031
+ },
1032
+ "mode": {
1033
+ "type": "string",
1034
+ "description": "Search mode: 'auto' (default), 'expand', 'decompose', or 'both'",
1035
+ "enum": ["auto", "expand", "decompose", "both"],
1036
+ "default": "auto",
1037
+ },
1038
+ "language": {
1039
+ "type": "string",
1040
+ "description": "Filter by language",
1041
+ },
1042
+ "node_type": {
1043
+ "type": "string",
1044
+ "description": "Filter by node type",
1045
+ },
1046
+ "provider": {
1047
+ "type": "string",
1048
+ "description": "Embedding provider: ollama/mxbai (local/free), gemini (cloud/OAuth), openai (cloud/OAuth), huggingface (cloud)",
1049
+ "enum": ["ollama", "mxbai", "gemini", "openai", "huggingface"],
1050
+ "default": "ollama",
1051
+ },
1052
+ },
1053
+ "required": ["query"],
1054
+ },
1055
+ ),
611
1056
  ]
612
1057
 
613
1058
 
@@ -6,33 +6,37 @@ from .skill_loader import list_skills, get_skill, create_skill
6
6
  from .agent_manager import agent_spawn, agent_output, agent_cancel, agent_list, agent_progress, agent_retry
7
7
  from .background_tasks import task_spawn, task_status, task_list
8
8
  from .continuous_loop import enable_ralph_loop, disable_ralph_loop
9
+ from .query_classifier import classify_query, QueryCategory, QueryClassification
9
10
 
10
11
  __all__ = [
12
+ "QueryCategory",
13
+ "QueryClassification",
14
+ "agent_cancel",
15
+ "agent_list",
16
+ "agent_output",
17
+ "agent_progress",
18
+ "agent_retry",
19
+ "agent_spawn",
20
+ "ast_grep_replace",
21
+ "ast_grep_search",
22
+ "classify_query",
23
+ "create_skill",
24
+ "disable_ralph_loop",
25
+ "enable_ralph_loop",
26
+ "get_session_info",
27
+ "get_skill",
28
+ "glob_files",
29
+ "grep_search",
11
30
  "invoke_gemini",
12
31
  "invoke_gemini_agentic",
13
32
  "invoke_openai",
14
- "lsp_diagnostics",
15
- "ast_grep_search",
16
- "ast_grep_replace",
17
- "grep_search",
18
- "glob_files",
19
33
  "list_sessions",
34
+ "list_skills",
35
+ "lsp_diagnostics",
20
36
  "read_session",
21
37
  "search_sessions",
22
- "get_session_info",
23
- "list_skills",
24
- "get_skill",
25
- "create_skill",
26
- "agent_spawn",
27
- "agent_output",
28
- "agent_retry",
29
- "agent_cancel",
30
- "agent_list",
31
- "agent_progress",
38
+ "task_list",
32
39
  "task_spawn",
33
40
  "task_status",
34
- "task_list",
35
- "enable_ralph_loop",
36
- "disable_ralph_loop",
37
41
  ]
38
42