tokensave 6.1.2

Code intelligence tool that builds a semantic knowledge graph from Rust, Go, Java, Scala, TypeScript, Python, C, C++, Kotlin, C#, Swift, and many more codebases
"""C++ probe inputs for scripts/mcp_probe/probe.py.

Mirrors the shape of `tools/rust.py`: returns `{tool_name: [args_dict, ...]}`
with exactly 5 query variants per tool. Paths cover the common
`src` / `include` split as well as more modern monorepo layouts that ship
public headers alongside sources. Base lookups use the standard library
suspects (`exception`, `runtime_error`, `enable_shared_from_this`, …) plus
the generic `Base` name that handcrafted hierarchies often pick.
"""

DEFAULT_NAMES = ["main", "init", "update", "render", "process"]
DEFAULT_BASES = [
    "exception",
    "runtime_error",
    "enable_shared_from_this",
    "Base",
    "noncopyable",
]
DEFAULT_TYPE_NAMES = ["string", "vector", "shared_ptr", "unique_ptr", "map"]
DEFAULT_TASKS = [
    "error handling",
    "memory management",
    "threading",
    "template metaprogramming",
    "serialization",
]
DEFAULT_PATHS = ["src", "include", "lib", "tests", "test"]


def probes_for(d):
    ids = d["ids"]
    qns = d["qnames"]
    names = d["names"] or DEFAULT_NAMES
    files = d["files"]
    return {
        # core
        "tokensave_search":            [{"query": q} for q in
                                        ["main", "init", "process", "shared_ptr", "exception"]],
        "tokensave_context":           [{"task": t} for t in DEFAULT_TASKS],
        "tokensave_node":              [{"node_id": i} for i in ids],
        "tokensave_by_qualified_name": [{"qualified_name": q} for q in qns],
        "tokensave_signature":         [{"node_id": i} for i in ids],
        "tokensave_body":              [{"symbol": n} for n in names],
        # traversal
        "tokensave_callers":           [{"node_id": i} for i in ids],
        "tokensave_callees":           [{"node_id": i} for i in ids],
        "tokensave_callers_for":       [{"node_ids": [i]} for i in ids],
        "tokensave_impls":             [{"name": n} for n in DEFAULT_BASES],
        "tokensave_derives":           [{"qualified_name": q} for q in qns],
        "tokensave_type_hierarchy":    [{"node_id": i} for i in ids],
        "tokensave_similar":           [{"symbol": n} for n in names],
        "tokensave_rank":              [{"edge_kind": k} for k in
                                        ["implements", "extends", "calls", "uses", "contains"]],
        "tokensave_impact":            [{"node_id": i} for i in ids],
        "tokensave_rename_preview":    [{"node_id": i, "new_name": "renamed"} for i in ids],
        # analysis (whole-DB sweeps)
        "tokensave_hotspots":          [{}, {"limit": 10}, {"path": "src"}, {"path": "include"}, {"path": "lib"}],
        "tokensave_complexity":        [{}, {"limit": 10}, {"path": "src"}, {"path": "include"}, {"path": "lib"}],
        "tokensave_dead_code":         [{}, {"limit": 10}, {"include_public": False},
                                        {"path": "src"}, {"path": "lib"}],
        "tokensave_circular":          [{}, {"limit": 5}, {"path": "src"}, {"path": "include"}, {"path": "lib"}],
        "tokensave_doc_coverage":      [{}, {"limit": 10}, {"path": "src"}, {"path": "include"}, {"path": files[0]}],
        "tokensave_god_class":         [{}, {"limit": 10}, {"path": "src"}, {"path": "include"}, {"path": "lib"}],
        "tokensave_dependency_depth":  [{}, {"limit": 10}, {"path": "src"}, {"path": "include"}, {"path": "lib"}],
        "tokensave_inheritance_depth": [{}, {"limit": 10}, {"path": "src"}, {"path": "include"}, {"path": "lib"}],
        "tokensave_distribution":      [{}, {"path": "src"}, {"path": "include"}, {"path": "lib"}, {"path": "tests"}],
        "tokensave_gini":              [{}, {"path": "src"}, {"path": "include"}, {"path": "lib"}, {"path": "tests"}],
        "tokensave_largest":           [{}, {"limit": 10}, {"path": "src"}, {"path": "include"}, {"path": "lib"}],
        "tokensave_recursion":         [{}, {"limit": 10}, {"path": "src"}, {"path": "include"}, {"path": "lib"}],
        "tokensave_coupling":          [{}, {"path": "src"}, {"path": "include"}, {"path": "lib"}, {"path": files[0]}],
        "tokensave_dsm":               [{}, {"path": "src"}, {"path": "include"}, {"path": "lib"}, {"path": "tests"}],
        "tokensave_module_api":        [{"path": f} for f in files],
        "tokensave_simplify_scan":     [{"files": [f]} for f in files],
        "tokensave_unused_imports":    [{}, {"limit": 10}, {"path": "src"}, {"path": "include"}, {"path": "lib"}],
        "tokensave_test_map":          [{"file": f} for f in files],
        "tokensave_test_risk":         [{}, {"limit": 10}, {"path": "src"}, {"path": "lib"}, {"path": "tests"}],
        "tokensave_todos":             [{}, {"limit": 10}, {"path": "src"}, {"path": "lib"}, {"path": "include"}],
        "tokensave_files":             [{}, {"path": "src"}, {"path": "include"}, {"path": "lib"}, {"path": "tests"}],
        "tokensave_status":            [{}] * 5,
        "tokensave_health":            [{}] * 5,
        "tokensave_diagnose":          [{"cargo_output": "src/lib.cpp:1:5: error: use of undeclared identifier 'foo'"}] * 5,
        # port
        "tokensave_port_status":       [
            {"source_dir": "src", "target_dir": "tests"},
            {"source_dir": "lib", "target_dir": "tests"},
            {"source_dir": "src", "target_dir": "include"},
            {"source_dir": "include", "target_dir": "src"},
            {"source_dir": "tests", "target_dir": "src"},
        ],
        "tokensave_port_order":        [{"source_dir": d} for d in DEFAULT_PATHS],
        # git/branch
        "tokensave_branch_list":       [{}] * 5,
        "tokensave_branch_diff":       [
            {"base": "master", "head": "master"},
            {"base": "main", "head": "main"},
            {},
            {"base": "HEAD", "head": "HEAD"},
            {"base": "HEAD~1", "head": "HEAD"},
        ],
        "tokensave_branch_search":     [
            {"branch": "main", "query": "main"},
            {"branch": "master", "query": "main"},
            {"branch": "main", "query": "init"},
            {"branch": "main", "query": "shared_ptr"},
            {"branch": "master", "query": "exception"},
        ],
        "tokensave_changelog":         [
            {"from_ref": "HEAD~10", "to_ref": "HEAD"},
            {"from_ref": "HEAD~5", "to_ref": "HEAD"},
            {"from_ref": "HEAD~1", "to_ref": "HEAD"},
            {"from_ref": "HEAD~20", "to_ref": "HEAD~5"},
            {"from_ref": "HEAD~3", "to_ref": "HEAD"},
        ],
        "tokensave_pr_context":        [{}, {"base_ref": "main"}, {"base_ref": "master"},
                                        {"base_ref": "HEAD~5"}, {"base_ref": "HEAD~1"}],
        "tokensave_diff_context":      [{"files": [f]} for f in files],
        "tokensave_commit_context":    [{}, {"commit": "HEAD"}, {"commit": "HEAD~1"},
                                        {"commit": "HEAD~5"}, {"commit": "HEAD~10"}],
        "tokensave_affected":          [{"files": [f]} for f in files],
    }