SourceIndex 0.1.0__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.
- sourceindex-0.1.0/.gitignore +15 -0
- sourceindex-0.1.0/GETTING_STARTED.md +51 -0
- sourceindex-0.1.0/PKG-INFO +73 -0
- sourceindex-0.1.0/pyproject.toml +52 -0
- sourceindex-0.1.0/sourceindex/__init__.py +30 -0
- sourceindex-0.1.0/sourceindex/build/__init__.py +592 -0
- sourceindex-0.1.0/sourceindex/build/indexer.py +403 -0
- sourceindex-0.1.0/sourceindex/build/linerange/__init__.py +24 -0
- sourceindex-0.1.0/sourceindex/build/linerange/python_ast.py +155 -0
- sourceindex-0.1.0/sourceindex/build/linerange/treesitter.py +397 -0
- sourceindex-0.1.0/sourceindex/build/prompts.py +76 -0
- sourceindex-0.1.0/sourceindex/build/state.py +261 -0
- sourceindex-0.1.0/sourceindex/build/walker.py +94 -0
- sourceindex-0.1.0/sourceindex/claudecode/__init__.py +0 -0
- sourceindex-0.1.0/sourceindex/claudecode/savings.py +325 -0
- sourceindex-0.1.0/sourceindex/claudecode/savings_summary.py +88 -0
- sourceindex-0.1.0/sourceindex/claudecode/statusline.py +116 -0
- sourceindex-0.1.0/sourceindex/cli/__init__.py +304 -0
- sourceindex-0.1.0/sourceindex/cli/__main__.py +10 -0
- sourceindex-0.1.0/sourceindex/cli/api_key.py +171 -0
- sourceindex-0.1.0/sourceindex/cli/commands.py +678 -0
- sourceindex-0.1.0/sourceindex/cli/install.py +378 -0
- sourceindex-0.1.0/sourceindex/daemon/__init__.py +83 -0
- sourceindex-0.1.0/sourceindex/daemon/client.py +141 -0
- sourceindex-0.1.0/sourceindex/daemon/crypto.py +48 -0
- sourceindex-0.1.0/sourceindex/daemon/keyring_store.py +129 -0
- sourceindex-0.1.0/sourceindex/daemon/lifecycle.py +237 -0
- sourceindex-0.1.0/sourceindex/daemon/protocol.py +134 -0
- sourceindex-0.1.0/sourceindex/daemon/server.py +389 -0
- sourceindex-0.1.0/sourceindex/daemon/store.py +426 -0
- sourceindex-0.1.0/sourceindex/lib/__init__.py +0 -0
- sourceindex-0.1.0/sourceindex/lib/backend.py +240 -0
- sourceindex-0.1.0/sourceindex/lib/cost.py +96 -0
- sourceindex-0.1.0/sourceindex/lib/env.py +30 -0
- sourceindex-0.1.0/sourceindex/lib/git.py +33 -0
- sourceindex-0.1.0/sourceindex/lib/languages.py +406 -0
- sourceindex-0.1.0/sourceindex/lib/llm.py +298 -0
- sourceindex-0.1.0/sourceindex/lib/log.py +228 -0
- sourceindex-0.1.0/sourceindex/lib/registry.py +75 -0
- sourceindex-0.1.0/sourceindex/lib/timing.py +10 -0
- sourceindex-0.1.0/sourceindex/search/__init__.py +251 -0
- sourceindex-0.1.0/sourceindex/search/experiments.py +276 -0
- sourceindex-0.1.0/sourceindex/search/imports.py +155 -0
- sourceindex-0.1.0/sourceindex/search/passes.py +51 -0
- sourceindex-0.1.0/sourceindex/search/prompts.py +379 -0
- sourceindex-0.1.0/sourceindex/search/roadmap.py +265 -0
- sourceindex-0.1.0/sourceindex/server.py +127 -0
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
# Getting Started with sourceindex
|
|
2
|
+
|
|
3
|
+
Hey — and thank you! You're the very first person outside the team to try
|
|
4
|
+
sourceindex, and that genuinely means a lot. I'm really glad you're giving
|
|
5
|
+
it a go.
|
|
6
|
+
|
|
7
|
+
Anything you notice along the way — good, bad, broken, or just "huh, that's
|
|
8
|
+
weird" — would be hugely helpful to hear. No feedback is too small.
|
|
9
|
+
|
|
10
|
+
## What it is
|
|
11
|
+
|
|
12
|
+
When you ask a coding agent to fix or build something, it has to find the
|
|
13
|
+
relevant code first. By default Claude Code does that live, in your session.
|
|
14
|
+
`sourceindex` does it ahead of time so the agent jumps straight to the right
|
|
15
|
+
files.
|
|
16
|
+
|
|
17
|
+
**Best on an existing repo you didn't fully write yourself.** Not very useful
|
|
18
|
+
on a brand-new empty project.
|
|
19
|
+
|
|
20
|
+
## Install and set up
|
|
21
|
+
|
|
22
|
+
You'll need Python 3.10+ and a sourceindex API key (starts with `sk-si-`).
|
|
23
|
+
Ask me — I'll send you one.
|
|
24
|
+
|
|
25
|
+
**Easiest path:** open this file in Claude Code and tell it "set sourceindex
|
|
26
|
+
up in this repo." It can run the steps for you.
|
|
27
|
+
|
|
28
|
+
If you'd rather do it by hand:
|
|
29
|
+
|
|
30
|
+
```bash
|
|
31
|
+
pip install sourceindex
|
|
32
|
+
cd /path/to/your/repo
|
|
33
|
+
sourceindex init
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
It'll prompt for the key, set up some git hooks plus a Claude subagent, and
|
|
37
|
+
scan your repo. A few minutes, once per repo. If you don't have a `CLAUDE.md`
|
|
38
|
+
yet, run `/init` in Claude Code first.
|
|
39
|
+
|
|
40
|
+
## Day-to-day
|
|
41
|
+
|
|
42
|
+
Nothing. Open the repo in Claude Code as usual — it'll use sourceindex on
|
|
43
|
+
its own.
|
|
44
|
+
|
|
45
|
+
## Feedback I'd love
|
|
46
|
+
|
|
47
|
+
- Did `sourceindex init` finish cleanly?
|
|
48
|
+
- Does the agent feel different? Even "I can't tell" is useful.
|
|
49
|
+
- Anything in this doc that didn't land.
|
|
50
|
+
|
|
51
|
+
Thanks!
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: SourceIndex
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: Codebase index for agentic coding
|
|
5
|
+
Requires-Python: >=3.10
|
|
6
|
+
Requires-Dist: cryptography>=42
|
|
7
|
+
Requires-Dist: keyring>=24
|
|
8
|
+
Requires-Dist: litellm>=1.50
|
|
9
|
+
Requires-Dist: tree-sitter-c>=0.23
|
|
10
|
+
Requires-Dist: tree-sitter-cpp>=0.23
|
|
11
|
+
Requires-Dist: tree-sitter-go>=0.23
|
|
12
|
+
Requires-Dist: tree-sitter-java>=0.23
|
|
13
|
+
Requires-Dist: tree-sitter-javascript>=0.23
|
|
14
|
+
Requires-Dist: tree-sitter-kotlin>=1.0
|
|
15
|
+
Requires-Dist: tree-sitter-ruby>=0.23
|
|
16
|
+
Requires-Dist: tree-sitter-rust>=0.23
|
|
17
|
+
Requires-Dist: tree-sitter-typescript>=0.23
|
|
18
|
+
Requires-Dist: tree-sitter>=0.23
|
|
19
|
+
Provides-Extra: mcp
|
|
20
|
+
Requires-Dist: mcp<2,>=1.0.0; extra == 'mcp'
|
|
21
|
+
Description-Content-Type: text/markdown
|
|
22
|
+
|
|
23
|
+
# Getting Started with sourceindex
|
|
24
|
+
|
|
25
|
+
Hey — and thank you! You're the very first person outside the team to try
|
|
26
|
+
sourceindex, and that genuinely means a lot. I'm really glad you're giving
|
|
27
|
+
it a go.
|
|
28
|
+
|
|
29
|
+
Anything you notice along the way — good, bad, broken, or just "huh, that's
|
|
30
|
+
weird" — would be hugely helpful to hear. No feedback is too small.
|
|
31
|
+
|
|
32
|
+
## What it is
|
|
33
|
+
|
|
34
|
+
When you ask a coding agent to fix or build something, it has to find the
|
|
35
|
+
relevant code first. By default Claude Code does that live, in your session.
|
|
36
|
+
`sourceindex` does it ahead of time so the agent jumps straight to the right
|
|
37
|
+
files.
|
|
38
|
+
|
|
39
|
+
**Best on an existing repo you didn't fully write yourself.** Not very useful
|
|
40
|
+
on a brand-new empty project.
|
|
41
|
+
|
|
42
|
+
## Install and set up
|
|
43
|
+
|
|
44
|
+
You'll need Python 3.10+ and a sourceindex API key (starts with `sk-si-`).
|
|
45
|
+
Ask me — I'll send you one.
|
|
46
|
+
|
|
47
|
+
**Easiest path:** open this file in Claude Code and tell it "set sourceindex
|
|
48
|
+
up in this repo." It can run the steps for you.
|
|
49
|
+
|
|
50
|
+
If you'd rather do it by hand:
|
|
51
|
+
|
|
52
|
+
```bash
|
|
53
|
+
pip install sourceindex
|
|
54
|
+
cd /path/to/your/repo
|
|
55
|
+
sourceindex init
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
It'll prompt for the key, set up some git hooks plus a Claude subagent, and
|
|
59
|
+
scan your repo. A few minutes, once per repo. If you don't have a `CLAUDE.md`
|
|
60
|
+
yet, run `/init` in Claude Code first.
|
|
61
|
+
|
|
62
|
+
## Day-to-day
|
|
63
|
+
|
|
64
|
+
Nothing. Open the repo in Claude Code as usual — it'll use sourceindex on
|
|
65
|
+
its own.
|
|
66
|
+
|
|
67
|
+
## Feedback I'd love
|
|
68
|
+
|
|
69
|
+
- Did `sourceindex init` finish cleanly?
|
|
70
|
+
- Does the agent feel different? Even "I can't tell" is useful.
|
|
71
|
+
- Anything in this doc that didn't land.
|
|
72
|
+
|
|
73
|
+
Thanks!
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
[build-system]
|
|
2
|
+
requires = ["hatchling"]
|
|
3
|
+
build-backend = "hatchling.build"
|
|
4
|
+
|
|
5
|
+
[project]
|
|
6
|
+
name = "SourceIndex"
|
|
7
|
+
version = "0.1.0"
|
|
8
|
+
description = "Codebase index for agentic coding"
|
|
9
|
+
readme = "GETTING_STARTED.md"
|
|
10
|
+
requires-python = ">=3.10"
|
|
11
|
+
dependencies = [
|
|
12
|
+
"litellm>=1.50",
|
|
13
|
+
"tree-sitter>=0.23",
|
|
14
|
+
# AES-GCM at-rest encryption for the daemon-owned .sourceindex/ store.
|
|
15
|
+
"cryptography>=42",
|
|
16
|
+
# OS keychain wrapper. Fallback path to a 0600 file is supported if no
|
|
17
|
+
# keyring backend is present (Docker, headless CI) — install never fails.
|
|
18
|
+
"keyring>=24",
|
|
19
|
+
# Per-language grammars for the languages in build/linerange/treesitter.py
|
|
20
|
+
# LANG_CFG. Each wheel is ~60-330 KB; collectively ~3 MB vs 183 MB for
|
|
21
|
+
# the all-in-one tree-sitter-language-pack. Languages added later that
|
|
22
|
+
# aren't listed here are auto-installed at first use when
|
|
23
|
+
# SOURCEINDEX_AUTO_INSTALL_GRAMMARS=1.
|
|
24
|
+
"tree-sitter-c>=0.23",
|
|
25
|
+
"tree-sitter-cpp>=0.23",
|
|
26
|
+
"tree-sitter-go>=0.23",
|
|
27
|
+
"tree-sitter-java>=0.23",
|
|
28
|
+
"tree-sitter-javascript>=0.23",
|
|
29
|
+
"tree-sitter-kotlin>=1.0",
|
|
30
|
+
"tree-sitter-ruby>=0.23",
|
|
31
|
+
"tree-sitter-rust>=0.23",
|
|
32
|
+
"tree-sitter-typescript>=0.23",
|
|
33
|
+
]
|
|
34
|
+
|
|
35
|
+
[project.optional-dependencies]
|
|
36
|
+
mcp = ["mcp>=1.0.0,<2"]
|
|
37
|
+
|
|
38
|
+
[project.scripts]
|
|
39
|
+
sourceindex = "sourceindex.cli:main"
|
|
40
|
+
|
|
41
|
+
[tool.hatch.build.targets.wheel]
|
|
42
|
+
packages = ["sourceindex"]
|
|
43
|
+
|
|
44
|
+
# The repo's `.git` is a submodule pointer, so hatchling can't use VCS to scope
|
|
45
|
+
# the sdist and would otherwise sweep in the whole workspace (backend/, logs/,
|
|
46
|
+
# test_repo/, .claude/, …). Restrict it to the package + install metadata.
|
|
47
|
+
[tool.hatch.build.targets.sdist]
|
|
48
|
+
include = [
|
|
49
|
+
"sourceindex/",
|
|
50
|
+
"pyproject.toml",
|
|
51
|
+
"GETTING_STARTED.md",
|
|
52
|
+
]
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
__version__ = "0.1.0"
|
|
2
|
+
|
|
3
|
+
# Surfaced at the top level so the CLI's argparse setup can use it for
|
|
4
|
+
# --workers help/default without importing the build pipeline (which
|
|
5
|
+
# transitively pulls litellm and inflates `sourceindex statusline` startup
|
|
6
|
+
# from ~20ms to ~2.3s on every render tick).
|
|
7
|
+
REALTIME_MAX_WORKERS = 128
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
# Suppress LiteLLM's bedrock/sagemaker pre-load warnings. They fire at import
|
|
11
|
+
# from litellm.litellm_core_utils.common_utils when botocore isn't installed
|
|
12
|
+
# — a baseline "expected" state for our shipped wheel (we route through
|
|
13
|
+
# OpenAI/Anthropic/OpenRouter, never Bedrock or SageMaker, and don't pull in
|
|
14
|
+
# a 100MB+ botocore just to satisfy that startup probe). Installed at package
|
|
15
|
+
# import so it runs before any submodule imports litellm.
|
|
16
|
+
import logging as _logging
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
class _LiteLLMBotocorePreloadFilter(_logging.Filter):
|
|
20
|
+
_SUPPRESS = (
|
|
21
|
+
"could not pre-load bedrock-runtime",
|
|
22
|
+
"could not pre-load sagemaker-runtime",
|
|
23
|
+
)
|
|
24
|
+
|
|
25
|
+
def filter(self, record: _logging.LogRecord) -> bool:
|
|
26
|
+
msg = record.getMessage()
|
|
27
|
+
return not any(s in msg for s in self._SUPPRESS)
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
_logging.getLogger("LiteLLM").addFilter(_LiteLLMBotocorePreloadFilter())
|