minder-cli 0.2.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.
- minder/__init__.py +12 -0
- minder/api/routers/prompts.py +177 -0
- minder/application/__init__.py +1 -0
- minder/application/admin/__init__.py +11 -0
- minder/application/admin/dto.py +453 -0
- minder/application/admin/jobs.py +327 -0
- minder/application/admin/use_cases.py +1895 -0
- minder/auth/__init__.py +12 -0
- minder/auth/context.py +26 -0
- minder/auth/middleware.py +70 -0
- minder/auth/principal.py +59 -0
- minder/auth/rate_limiter.py +89 -0
- minder/auth/rbac.py +60 -0
- minder/auth/service.py +541 -0
- minder/bootstrap/__init__.py +9 -0
- minder/bootstrap/providers.py +109 -0
- minder/bootstrap/transport.py +807 -0
- minder/cache/__init__.py +10 -0
- minder/cache/providers.py +140 -0
- minder/chunking/__init__.py +4 -0
- minder/chunking/code_splitter.py +184 -0
- minder/chunking/splitter.py +136 -0
- minder/cli.py +1542 -0
- minder/config.py +179 -0
- minder/continuity.py +363 -0
- minder/dev.py +160 -0
- minder/embedding/__init__.py +9 -0
- minder/embedding/base.py +7 -0
- minder/embedding/local.py +65 -0
- minder/embedding/openai.py +7 -0
- minder/graph/__init__.py +11 -0
- minder/graph/edges.py +13 -0
- minder/graph/executor.py +127 -0
- minder/graph/graph.py +263 -0
- minder/graph/nodes/__init__.py +27 -0
- minder/graph/nodes/evaluator.py +21 -0
- minder/graph/nodes/guard.py +64 -0
- minder/graph/nodes/llm.py +59 -0
- minder/graph/nodes/planning.py +30 -0
- minder/graph/nodes/reasoning.py +87 -0
- minder/graph/nodes/reranker.py +141 -0
- minder/graph/nodes/retriever.py +86 -0
- minder/graph/nodes/verification.py +230 -0
- minder/graph/nodes/workflow_planner.py +250 -0
- minder/graph/runtime.py +15 -0
- minder/graph/state.py +26 -0
- minder/llm/__init__.py +5 -0
- minder/llm/base.py +14 -0
- minder/llm/local.py +381 -0
- minder/llm/openai.py +89 -0
- minder/models/__init__.py +109 -0
- minder/models/base.py +10 -0
- minder/models/client.py +137 -0
- minder/models/document.py +34 -0
- minder/models/error.py +32 -0
- minder/models/graph.py +114 -0
- minder/models/history.py +32 -0
- minder/models/job.py +62 -0
- minder/models/prompt.py +41 -0
- minder/models/repository.py +62 -0
- minder/models/rule.py +68 -0
- minder/models/session.py +51 -0
- minder/models/skill.py +52 -0
- minder/models/user.py +41 -0
- minder/models/workflow.py +35 -0
- minder/observability/__init__.py +57 -0
- minder/observability/audit.py +243 -0
- minder/observability/logging.py +253 -0
- minder/observability/metrics.py +448 -0
- minder/observability/tracing.py +215 -0
- minder/presentation/__init__.py +1 -0
- minder/presentation/http/__init__.py +1 -0
- minder/presentation/http/admin/__init__.py +3 -0
- minder/presentation/http/admin/api.py +1309 -0
- minder/presentation/http/admin/context.py +94 -0
- minder/presentation/http/admin/dashboard.py +111 -0
- minder/presentation/http/admin/jobs.py +208 -0
- minder/presentation/http/admin/memories.py +185 -0
- minder/presentation/http/admin/prompts.py +219 -0
- minder/presentation/http/admin/routes.py +127 -0
- minder/presentation/http/admin/runtime.py +650 -0
- minder/presentation/http/admin/search.py +368 -0
- minder/presentation/http/admin/skills.py +230 -0
- minder/prompts/__init__.py +646 -0
- minder/prompts/formatter.py +142 -0
- minder/resources/__init__.py +318 -0
- minder/retrieval/__init__.py +5 -0
- minder/retrieval/hybrid.py +178 -0
- minder/retrieval/mmr.py +116 -0
- minder/retrieval/multi_hop.py +115 -0
- minder/runtime.py +15 -0
- minder/server.py +145 -0
- minder/store/__init__.py +64 -0
- minder/store/document.py +115 -0
- minder/store/error.py +82 -0
- minder/store/feedback.py +114 -0
- minder/store/graph.py +588 -0
- minder/store/history.py +57 -0
- minder/store/interfaces.py +512 -0
- minder/store/milvus/__init__.py +11 -0
- minder/store/milvus/client.py +26 -0
- minder/store/milvus/collections.py +15 -0
- minder/store/milvus/vector_store.py +232 -0
- minder/store/mongodb/__init__.py +11 -0
- minder/store/mongodb/client.py +49 -0
- minder/store/mongodb/indexes.py +90 -0
- minder/store/mongodb/operational_store.py +993 -0
- minder/store/relational.py +1087 -0
- minder/store/repo_state.py +58 -0
- minder/store/rule.py +93 -0
- minder/store/vector.py +79 -0
- minder/tools/__init__.py +47 -0
- minder/tools/auth.py +94 -0
- minder/tools/graph.py +839 -0
- minder/tools/ingest.py +353 -0
- minder/tools/memory.py +381 -0
- minder/tools/query.py +307 -0
- minder/tools/registry.py +269 -0
- minder/tools/repo_scanner.py +1266 -0
- minder/tools/search.py +15 -0
- minder/tools/session.py +316 -0
- minder/tools/skills.py +899 -0
- minder/tools/workflow.py +215 -0
- minder/transport/__init__.py +4 -0
- minder/transport/base.py +286 -0
- minder/transport/sse.py +252 -0
- minder/transport/stdio.py +29 -0
- minder_cli-0.2.0.dist-info/METADATA +318 -0
- minder_cli-0.2.0.dist-info/RECORD +132 -0
- minder_cli-0.2.0.dist-info/WHEEL +4 -0
- minder_cli-0.2.0.dist-info/entry_points.txt +2 -0
- minder_cli-0.2.0.dist-info/licenses/LICENSE +201 -0
minder/tools/registry.py
ADDED
|
@@ -0,0 +1,269 @@
|
|
|
1
|
+
"""
|
|
2
|
+
Tool Registry — single source of truth for tool names, descriptions, and scope metadata.
|
|
3
|
+
|
|
4
|
+
Import TOOL_DESCRIPTIONS in bootstrap/transport.py to register tools.
|
|
5
|
+
Import SCOPEABLE_TOOLS in admin use-cases to populate the tool-scope picker.
|
|
6
|
+
"""
|
|
7
|
+
|
|
8
|
+
from __future__ import annotations
|
|
9
|
+
|
|
10
|
+
from dataclasses import dataclass
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
@dataclass(frozen=True)
|
|
14
|
+
class ToolMeta:
|
|
15
|
+
name: str
|
|
16
|
+
description: str
|
|
17
|
+
scopeable: bool = True
|
|
18
|
+
"""Whether this tool can be granted to client principals via tool_scopes."""
|
|
19
|
+
always_available: bool = False
|
|
20
|
+
"""If True, ClientPrincipal can call this tool regardless of their tool_scopes grant list."""
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
# All registered MCP tools — ordered for display
|
|
24
|
+
ALL_TOOLS: list[ToolMeta] = [
|
|
25
|
+
# ── Memory ────────────────────────────────────────────────────────────────
|
|
26
|
+
ToolMeta(
|
|
27
|
+
name="minder_memory_store",
|
|
28
|
+
description="Store a memory entry with title, content, tags, and language metadata.",
|
|
29
|
+
),
|
|
30
|
+
ToolMeta(
|
|
31
|
+
name="minder_memory_recall",
|
|
32
|
+
description="Search stored memory entries by semantic similarity.",
|
|
33
|
+
),
|
|
34
|
+
ToolMeta(
|
|
35
|
+
name="minder_memory_list",
|
|
36
|
+
description="List the currently stored memory entries.",
|
|
37
|
+
),
|
|
38
|
+
ToolMeta(
|
|
39
|
+
name="minder_memory_delete",
|
|
40
|
+
description="Delete a stored memory entry by its ID.",
|
|
41
|
+
),
|
|
42
|
+
ToolMeta(
|
|
43
|
+
name="minder_memory_compact",
|
|
44
|
+
description="Review and compact duplicate memory entries by merging selected memories into a canonical entry.",
|
|
45
|
+
),
|
|
46
|
+
ToolMeta(
|
|
47
|
+
name="minder_skill_store",
|
|
48
|
+
description="Store a reusable workflow-aware skill with step, artifact, provenance, and quality metadata.",
|
|
49
|
+
),
|
|
50
|
+
ToolMeta(
|
|
51
|
+
name="minder_skill_recall",
|
|
52
|
+
description="Retrieve reusable skills ranked by workflow-step compatibility, semantic similarity, and quality score.",
|
|
53
|
+
),
|
|
54
|
+
ToolMeta(
|
|
55
|
+
name="minder_skill_list",
|
|
56
|
+
description="List stored skills with optional workflow-step, tag, and quality filters.",
|
|
57
|
+
),
|
|
58
|
+
ToolMeta(
|
|
59
|
+
name="minder_skill_update",
|
|
60
|
+
description="Update skill content, metadata, and quality signals for an existing stored skill.",
|
|
61
|
+
),
|
|
62
|
+
ToolMeta(
|
|
63
|
+
name="minder_skill_delete",
|
|
64
|
+
description="Delete a stored skill by its ID.",
|
|
65
|
+
),
|
|
66
|
+
ToolMeta(
|
|
67
|
+
name="minder_skill_import_git",
|
|
68
|
+
description="Import supported skill documents from a Git repository path and upsert them with source metadata.",
|
|
69
|
+
),
|
|
70
|
+
# ── Search & Query ────────────────────────────────────────────────────────
|
|
71
|
+
ToolMeta(
|
|
72
|
+
name="minder_search",
|
|
73
|
+
description="Search Minder knowledge and stored project context.",
|
|
74
|
+
),
|
|
75
|
+
ToolMeta(
|
|
76
|
+
name="minder_search_code",
|
|
77
|
+
description="Search indexed repository code for relevant files and snippets.",
|
|
78
|
+
),
|
|
79
|
+
ToolMeta(
|
|
80
|
+
name="minder_search_errors",
|
|
81
|
+
description="Search indexed errors and troubleshooting history for relevant matches.",
|
|
82
|
+
),
|
|
83
|
+
ToolMeta(
|
|
84
|
+
name="minder_query",
|
|
85
|
+
description="Run a full Minder repository query with retrieval, reasoning, and verification.",
|
|
86
|
+
),
|
|
87
|
+
ToolMeta(
|
|
88
|
+
name="minder_find_impact",
|
|
89
|
+
description="Traverse the repository graph to show upstream and downstream impact for a file, symbol, route, or dependency.",
|
|
90
|
+
),
|
|
91
|
+
ToolMeta(
|
|
92
|
+
name="minder_search_graph",
|
|
93
|
+
description="Search the repository graph for matching files, symbols, routes, todos, or dependencies within a repo scope.",
|
|
94
|
+
),
|
|
95
|
+
# ── Workflow ──────────────────────────────────────────────────────────────
|
|
96
|
+
ToolMeta(
|
|
97
|
+
name="minder_workflow_get",
|
|
98
|
+
description="Fetch the workflow assigned to a repository and sync repo-state files.",
|
|
99
|
+
),
|
|
100
|
+
ToolMeta(
|
|
101
|
+
name="minder_workflow_step",
|
|
102
|
+
description="Return the current workflow step for a repository and sync repo-state files.",
|
|
103
|
+
),
|
|
104
|
+
ToolMeta(
|
|
105
|
+
name="minder_workflow_update",
|
|
106
|
+
description="Mark a workflow step complete and optionally persist an artifact for the repository.",
|
|
107
|
+
),
|
|
108
|
+
ToolMeta(
|
|
109
|
+
name="minder_workflow_guard",
|
|
110
|
+
description="Check whether a requested workflow step is currently allowed for the repository.",
|
|
111
|
+
),
|
|
112
|
+
# ── Session ───────────────────────────────────────────────────────────────
|
|
113
|
+
ToolMeta(
|
|
114
|
+
name="minder_session_create",
|
|
115
|
+
description=(
|
|
116
|
+
"Create a named, persisted Minder session for the calling principal. "
|
|
117
|
+
"Pass a stable project slug as 'name' (e.g. 'omi-channel-phase5') so the "
|
|
118
|
+
"session can be recovered from any machine using the same client API key."
|
|
119
|
+
),
|
|
120
|
+
always_available=True,
|
|
121
|
+
),
|
|
122
|
+
ToolMeta(
|
|
123
|
+
name="minder_session_find",
|
|
124
|
+
description=(
|
|
125
|
+
"Find a session by name for the calling principal — the primary cross-environment "
|
|
126
|
+
"recovery tool. Returns full state and context so the LLM can resume after a "
|
|
127
|
+
"/compact or machine switch without needing to remember the session UUID."
|
|
128
|
+
),
|
|
129
|
+
always_available=True,
|
|
130
|
+
),
|
|
131
|
+
ToolMeta(
|
|
132
|
+
name="minder_session_list",
|
|
133
|
+
description=(
|
|
134
|
+
"List all sessions owned by the calling principal, newest-first. "
|
|
135
|
+
"Use minder_session_find when you know the session name."
|
|
136
|
+
),
|
|
137
|
+
always_available=True,
|
|
138
|
+
),
|
|
139
|
+
ToolMeta(
|
|
140
|
+
name="minder_session_save",
|
|
141
|
+
description=(
|
|
142
|
+
"Persist task state and active skill context for an existing session. "
|
|
143
|
+
"Call after each significant wave of work so context survives /compact."
|
|
144
|
+
),
|
|
145
|
+
always_available=True,
|
|
146
|
+
),
|
|
147
|
+
ToolMeta(
|
|
148
|
+
name="minder_session_restore",
|
|
149
|
+
description="Load saved state and context for an existing session by UUID.",
|
|
150
|
+
always_available=True,
|
|
151
|
+
),
|
|
152
|
+
ToolMeta(
|
|
153
|
+
name="minder_session_context",
|
|
154
|
+
description="Update branch and open-file context for an existing Minder session.",
|
|
155
|
+
always_available=True,
|
|
156
|
+
),
|
|
157
|
+
ToolMeta(
|
|
158
|
+
name="minder_session_cleanup",
|
|
159
|
+
description="Delete expired sessions owned by the calling principal and remove their persisted history records.",
|
|
160
|
+
always_available=True,
|
|
161
|
+
),
|
|
162
|
+
# ── Auth (internal — not grantable to client principals) ─────────────────
|
|
163
|
+
ToolMeta(
|
|
164
|
+
name="minder_auth_ping",
|
|
165
|
+
description="Verify that MCP authentication is working and the current principal can reach protected tools.",
|
|
166
|
+
scopeable=False,
|
|
167
|
+
),
|
|
168
|
+
ToolMeta(
|
|
169
|
+
name="minder_auth_login",
|
|
170
|
+
description="Exchange a human admin API key for a JWT bearer token.",
|
|
171
|
+
scopeable=False,
|
|
172
|
+
),
|
|
173
|
+
ToolMeta(
|
|
174
|
+
name="minder_auth_exchange_client_key",
|
|
175
|
+
description="Exchange a client API key for a scoped client access token.",
|
|
176
|
+
scopeable=False,
|
|
177
|
+
),
|
|
178
|
+
ToolMeta(
|
|
179
|
+
name="minder_auth_whoami",
|
|
180
|
+
description="Return the authenticated principal identity, role, and any active scopes.",
|
|
181
|
+
scopeable=False,
|
|
182
|
+
always_available=True,
|
|
183
|
+
),
|
|
184
|
+
ToolMeta(
|
|
185
|
+
name="minder_auth_manage",
|
|
186
|
+
description="Run admin-only authentication management actions such as listing registered users.",
|
|
187
|
+
scopeable=False,
|
|
188
|
+
),
|
|
189
|
+
ToolMeta(
|
|
190
|
+
name="minder_auth_create_client",
|
|
191
|
+
description="Create a new MCP client and issue its initial client API key.",
|
|
192
|
+
scopeable=False,
|
|
193
|
+
),
|
|
194
|
+
]
|
|
195
|
+
|
|
196
|
+
# Flat dict for fast lookup by name (used in bootstrap/transport.py)
|
|
197
|
+
TOOL_DESCRIPTIONS: dict[str, str] = {tool.name: tool.description for tool in ALL_TOOLS}
|
|
198
|
+
|
|
199
|
+
# Tools that can be granted to client principals
|
|
200
|
+
SCOPEABLE_TOOLS: list[ToolMeta] = [tool for tool in ALL_TOOLS if tool.scopeable]
|
|
201
|
+
|
|
202
|
+
# Tools always callable by any authenticated ClientPrincipal (no scope grant required)
|
|
203
|
+
ALWAYS_AVAILABLE_FOR_CLIENTS: frozenset[str] = frozenset(
|
|
204
|
+
tool.name for tool in ALL_TOOLS if tool.always_available
|
|
205
|
+
)
|
|
206
|
+
|
|
207
|
+
|
|
208
|
+
def _tool_category(tool_name: str) -> str:
|
|
209
|
+
if tool_name.startswith("minder_memory_"):
|
|
210
|
+
return "Memory"
|
|
211
|
+
if tool_name.startswith("minder_skill_"):
|
|
212
|
+
return "Skills"
|
|
213
|
+
if tool_name.startswith("minder_search_") or tool_name in {
|
|
214
|
+
"minder_search",
|
|
215
|
+
"minder_query",
|
|
216
|
+
"minder_find_impact",
|
|
217
|
+
}:
|
|
218
|
+
return "Search and query"
|
|
219
|
+
if tool_name.startswith("minder_workflow_"):
|
|
220
|
+
return "Workflow"
|
|
221
|
+
if tool_name.startswith("minder_session_"):
|
|
222
|
+
return "Sessions"
|
|
223
|
+
if tool_name.startswith("minder_auth_"):
|
|
224
|
+
return "Auth and identity"
|
|
225
|
+
return "Other"
|
|
226
|
+
|
|
227
|
+
|
|
228
|
+
def tool_capability_manifest() -> str:
|
|
229
|
+
grouped: dict[str, list[ToolMeta]] = {}
|
|
230
|
+
for tool in ALL_TOOLS:
|
|
231
|
+
grouped.setdefault(_tool_category(tool.name), []).append(tool)
|
|
232
|
+
|
|
233
|
+
ordered_categories = [
|
|
234
|
+
"Memory",
|
|
235
|
+
"Skills",
|
|
236
|
+
"Search and query",
|
|
237
|
+
"Workflow",
|
|
238
|
+
"Sessions",
|
|
239
|
+
"Auth and identity",
|
|
240
|
+
"Other",
|
|
241
|
+
]
|
|
242
|
+
lines = [
|
|
243
|
+
"Minder has built-in tools and internal data capabilities even when no repository is selected.",
|
|
244
|
+
"Repo-scoped query, graph, and impact tools need a repository path or repository selection before they can inspect code context.",
|
|
245
|
+
]
|
|
246
|
+
for category in ordered_categories:
|
|
247
|
+
tools = grouped.get(category, [])
|
|
248
|
+
if not tools:
|
|
249
|
+
continue
|
|
250
|
+
lines.append(f"{category}:")
|
|
251
|
+
for tool in tools:
|
|
252
|
+
availability = (
|
|
253
|
+
"always available to authenticated clients"
|
|
254
|
+
if tool.always_available
|
|
255
|
+
else "scoped" if tool.scopeable else "admin/internal"
|
|
256
|
+
)
|
|
257
|
+
lines.append(f"- {tool.name}: {tool.description} [{availability}]")
|
|
258
|
+
return "\n".join(lines)
|
|
259
|
+
|
|
260
|
+
|
|
261
|
+
def tool_data_access_policy() -> str:
|
|
262
|
+
return "\n".join(
|
|
263
|
+
[
|
|
264
|
+
"Minder may read and update its own operational data where matching tools exist, including memories, skills, workflow state, sessions, client credentials, and repository metadata.",
|
|
265
|
+
"User account records are read-only. Minder may inspect identity information through read-only auth tools such as whoami or list_users, but it must not claim it can create, edit, rotate, deactivate, or delete users.",
|
|
266
|
+
"Repository-aware search, graph traversal, and query actions require repository context before they can inspect code or graph state.",
|
|
267
|
+
"If a request asks what Minder can do, answer from the tool capability manifest instead of saying no tools are available.",
|
|
268
|
+
]
|
|
269
|
+
)
|