grepmax 0.1.0
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.
- package/LICENSE +202 -0
- package/NOTICE +33 -0
- package/README.md +375 -0
- package/dist/commands/claude-code.js +60 -0
- package/dist/commands/codex.js +98 -0
- package/dist/commands/doctor.js +92 -0
- package/dist/commands/droid.js +189 -0
- package/dist/commands/index.js +125 -0
- package/dist/commands/list.js +120 -0
- package/dist/commands/mcp.js +567 -0
- package/dist/commands/opencode.js +199 -0
- package/dist/commands/search.js +539 -0
- package/dist/commands/serve.js +502 -0
- package/dist/commands/setup.js +160 -0
- package/dist/commands/skeleton.js +288 -0
- package/dist/commands/symbols.js +129 -0
- package/dist/commands/trace.js +50 -0
- package/dist/commands/verify.js +174 -0
- package/dist/config.js +120 -0
- package/dist/eval.js +618 -0
- package/dist/index.js +82 -0
- package/dist/lib/core/languages.js +237 -0
- package/dist/lib/graph/graph-builder.js +105 -0
- package/dist/lib/index/chunker.js +663 -0
- package/dist/lib/index/grammar-loader.js +110 -0
- package/dist/lib/index/ignore-patterns.js +63 -0
- package/dist/lib/index/index-config.js +86 -0
- package/dist/lib/index/sync-helpers.js +97 -0
- package/dist/lib/index/syncer.js +396 -0
- package/dist/lib/index/walker.js +164 -0
- package/dist/lib/index/watcher.js +245 -0
- package/dist/lib/output/formatter.js +161 -0
- package/dist/lib/output/json-formatter.js +6 -0
- package/dist/lib/search/intent.js +23 -0
- package/dist/lib/search/searcher.js +475 -0
- package/dist/lib/setup/model-loader.js +107 -0
- package/dist/lib/setup/setup-helpers.js +106 -0
- package/dist/lib/skeleton/body-fields.js +175 -0
- package/dist/lib/skeleton/index.js +24 -0
- package/dist/lib/skeleton/retriever.js +36 -0
- package/dist/lib/skeleton/skeletonizer.js +483 -0
- package/dist/lib/skeleton/summary-formatter.js +92 -0
- package/dist/lib/store/meta-cache.js +143 -0
- package/dist/lib/store/types.js +2 -0
- package/dist/lib/store/vector-db.js +340 -0
- package/dist/lib/utils/cleanup.js +33 -0
- package/dist/lib/utils/exit.js +38 -0
- package/dist/lib/utils/file-utils.js +131 -0
- package/dist/lib/utils/filter-builder.js +17 -0
- package/dist/lib/utils/formatter.js +230 -0
- package/dist/lib/utils/git.js +83 -0
- package/dist/lib/utils/lock.js +157 -0
- package/dist/lib/utils/project-root.js +107 -0
- package/dist/lib/utils/server-registry.js +97 -0
- package/dist/lib/workers/colbert-math.js +107 -0
- package/dist/lib/workers/colbert-tokenizer.js +113 -0
- package/dist/lib/workers/download-worker.js +169 -0
- package/dist/lib/workers/embeddings/colbert.js +213 -0
- package/dist/lib/workers/embeddings/granite.js +180 -0
- package/dist/lib/workers/embeddings/mlx-client.js +144 -0
- package/dist/lib/workers/orchestrator.js +350 -0
- package/dist/lib/workers/pool.js +373 -0
- package/dist/lib/workers/process-child.js +92 -0
- package/dist/lib/workers/worker.js +31 -0
- package/package.json +80 -0
- package/plugins/osgrep/.claude-plugin/plugin.json +20 -0
- package/plugins/osgrep/hooks/start.js +90 -0
- package/plugins/osgrep/hooks/stop.js +3 -0
- package/plugins/osgrep/hooks.json +26 -0
- package/plugins/osgrep/skills/osgrep/SKILL.md +82 -0
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
{
|
|
2
|
+
"hooks": {
|
|
3
|
+
"SessionStart": [
|
|
4
|
+
{
|
|
5
|
+
"hooks": [
|
|
6
|
+
{
|
|
7
|
+
"type": "command",
|
|
8
|
+
"command": "node ${CLAUDE_PLUGIN_ROOT}/hooks/start.js",
|
|
9
|
+
"timeout": 10
|
|
10
|
+
}
|
|
11
|
+
]
|
|
12
|
+
}
|
|
13
|
+
],
|
|
14
|
+
"SessionEnd": [
|
|
15
|
+
{
|
|
16
|
+
"hooks": [
|
|
17
|
+
{
|
|
18
|
+
"type": "command",
|
|
19
|
+
"command": "node ${CLAUDE_PLUGIN_ROOT}/hooks/stop.js",
|
|
20
|
+
"timeout": 10
|
|
21
|
+
}
|
|
22
|
+
]
|
|
23
|
+
}
|
|
24
|
+
]
|
|
25
|
+
}
|
|
26
|
+
}
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: osgrep
|
|
3
|
+
description: Semantic code search. Use alongside grep - grep for exact strings, osgrep for concepts.
|
|
4
|
+
allowed-tools: "mcp__osgrep__semantic_search, mcp__osgrep__code_skeleton, mcp__osgrep__trace_calls, mcp__osgrep__list_symbols, Bash(osgrep:*), Read"
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## What osgrep does
|
|
8
|
+
|
|
9
|
+
Finds code by meaning. When you'd ask a colleague "where do we handle auth?", use osgrep.
|
|
10
|
+
|
|
11
|
+
- grep/ripgrep: exact string match, fast
|
|
12
|
+
- osgrep: concept match, finds code you couldn't grep for
|
|
13
|
+
|
|
14
|
+
## MCP tools (preferred)
|
|
15
|
+
|
|
16
|
+
Use these structured tools when available — they return typed JSON and don't need output parsing.
|
|
17
|
+
|
|
18
|
+
### semantic_search
|
|
19
|
+
Search code by meaning. Returns ranked snippets with file paths, line numbers, scores.
|
|
20
|
+
- `query` (required): Natural language. Be specific — more words = better results.
|
|
21
|
+
- `limit` (optional): Max results (default 10, max 50)
|
|
22
|
+
- `path` (optional): Restrict to path prefix (e.g. "src/auth/")
|
|
23
|
+
- `min_score` (optional): Filter by minimum relevance score (0-1)
|
|
24
|
+
- `max_per_file` (optional): Cap results per file for diversity
|
|
25
|
+
|
|
26
|
+
### code_skeleton
|
|
27
|
+
Show file structure — signatures with bodies collapsed (~4x fewer tokens).
|
|
28
|
+
- `target` (required): File path relative to project root
|
|
29
|
+
|
|
30
|
+
### trace_calls
|
|
31
|
+
Trace call graph — who calls a symbol and what it calls.
|
|
32
|
+
- `symbol` (required): Function/method/class name (e.g. "handleAuth")
|
|
33
|
+
|
|
34
|
+
### list_symbols
|
|
35
|
+
List indexed symbols with definition locations.
|
|
36
|
+
- `pattern` (optional): Filter by name (case-insensitive substring)
|
|
37
|
+
- `limit` (optional): Max results (default 20, max 100)
|
|
38
|
+
- `path` (optional): Only symbols under this path prefix
|
|
39
|
+
|
|
40
|
+
### index_status
|
|
41
|
+
Check index and daemon health — file count, chunks, embed mode, age, watching status.
|
|
42
|
+
|
|
43
|
+
## CLI fallback
|
|
44
|
+
|
|
45
|
+
If MCP tools aren't available, use the CLI via Bash:
|
|
46
|
+
|
|
47
|
+
```bash
|
|
48
|
+
osgrep "where do we validate user permissions" # Semantic search
|
|
49
|
+
osgrep "authentication" --compact # Just file paths + line ranges
|
|
50
|
+
osgrep skeleton src/giant-2000-line-file.ts # File structure
|
|
51
|
+
osgrep trace handleAuth # Call graph
|
|
52
|
+
osgrep symbols booking # Find symbols by name
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
## Output explained (CLI)
|
|
56
|
+
```
|
|
57
|
+
ORCHESTRATION src/auth/handler.ts:45
|
|
58
|
+
Defines: handleAuth | Calls: validate, checkRole, respond | Score: .94
|
|
59
|
+
|
|
60
|
+
export async function handleAuth(req: Request) {
|
|
61
|
+
const token = req.headers.get("Authorization");
|
|
62
|
+
const claims = await validateToken(token);
|
|
63
|
+
...
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
- **ORCHESTRATION** = contains logic, coordinates other code
|
|
67
|
+
- **DEFINITION** = types, interfaces, classes
|
|
68
|
+
- **Score** = relevance (1 = best match)
|
|
69
|
+
- **Calls** = what this code calls (helps trace flow)
|
|
70
|
+
|
|
71
|
+
## Tips
|
|
72
|
+
|
|
73
|
+
- More words = better results. "auth" is vague. "where does the server validate JWT tokens" is specific.
|
|
74
|
+
- ORCH results contain the logic — prioritize these.
|
|
75
|
+
- Don't read entire files. Use the line ranges from results.
|
|
76
|
+
- If results seem off, rephrase like you'd ask a teammate.
|
|
77
|
+
- Use `code_skeleton` before reading large files — understand structure first.
|
|
78
|
+
- Use `trace_calls` to understand how functions connect across the codebase.
|
|
79
|
+
|
|
80
|
+
## If Index is Building
|
|
81
|
+
|
|
82
|
+
If you see "Indexing" or daemon not ready: tell the user. Ask if they want to wait or proceed with partial results.
|