instagit 0.1.1 → 0.1.3
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/README.md +2 -3
- package/dist/index.js +10 -11
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
#
|
|
1
|
+
# Instagit
|
|
2
2
|
|
|
3
|
-
**Let Your
|
|
3
|
+
**Let Your Agents Instantly Understand the World's Code**
|
|
4
4
|
|
|
5
5
|
An MCP server that gives coding agents instant insight into any Git repository — no guessing, no hallucination.
|
|
6
6
|
|
|
@@ -85,7 +85,6 @@ Analyze any Git repository with AI.
|
|
|
85
85
|
| `repo` | string | yes | Repository URL, shorthand (`owner/repo`), or any public Git URL |
|
|
86
86
|
| `prompt` | string | yes | What to analyze or ask about the codebase |
|
|
87
87
|
| `ref` | string | no | Branch, commit SHA, or tag (default: repository's default branch) |
|
|
88
|
-
| `fast` | boolean | no | Use fast mode for quicker responses (default: true) |
|
|
89
88
|
|
|
90
89
|
**Example prompts:**
|
|
91
90
|
- "Explain the architecture and main components"
|
package/dist/index.js
CHANGED
|
@@ -100,9 +100,8 @@ var DEFAULT_API_URL = "https://instagit--instagit-api-api.modal.run";
|
|
|
100
100
|
function getApiUrl() {
|
|
101
101
|
return process.env.INSTAGIT_API_URL || DEFAULT_API_URL;
|
|
102
102
|
}
|
|
103
|
-
function buildModelString(repo, ref
|
|
103
|
+
function buildModelString(repo, ref) {
|
|
104
104
|
let model = repo;
|
|
105
|
-
if (fast) model += ":fast";
|
|
106
105
|
if (ref) model += `@${ref}`;
|
|
107
106
|
return model;
|
|
108
107
|
}
|
|
@@ -111,13 +110,12 @@ async function analyzeRepoStreaming(opts) {
|
|
|
111
110
|
repo,
|
|
112
111
|
prompt,
|
|
113
112
|
ref = null,
|
|
114
|
-
fast = true,
|
|
115
113
|
token = null,
|
|
116
114
|
progressCallback
|
|
117
115
|
} = opts;
|
|
118
116
|
const tracker = opts.tracker ?? createProgressTracker();
|
|
119
117
|
const apiUrl = getApiUrl();
|
|
120
|
-
const model = buildModelString(repo, ref
|
|
118
|
+
const model = buildModelString(repo, ref);
|
|
121
119
|
const headers = { "Content-Type": "application/json" };
|
|
122
120
|
if (token) {
|
|
123
121
|
headers["Authorization"] = `Bearer ${token}`;
|
|
@@ -319,7 +317,7 @@ async function registerAnonymousToken(apiUrl) {
|
|
|
319
317
|
// src/index.ts
|
|
320
318
|
var server = new import_mcp.McpServer({
|
|
321
319
|
name: "instagit",
|
|
322
|
-
version: "0.1.
|
|
320
|
+
version: "0.1.3"
|
|
323
321
|
});
|
|
324
322
|
var TOOL_DESCRIPTION = `Analyze any Git repository with AI. Point it at a repo and ask questions about the codebase. Use cases include:
|
|
325
323
|
- Understanding unfamiliar codebases: 'Explain the architecture and main components'
|
|
@@ -328,7 +326,9 @@ var TOOL_DESCRIPTION = `Analyze any Git repository with AI. Point it at a repo a
|
|
|
328
326
|
- Dependency analysis: 'What external services does this app depend on?'
|
|
329
327
|
- Onboarding help: 'How would I add a new API endpoint following existing patterns?'
|
|
330
328
|
- Bug investigation: 'Where might null pointer exceptions occur in the data pipeline?'
|
|
331
|
-
- Migration planning: 'What would it take to upgrade from React 17 to 18?'
|
|
329
|
+
- Migration planning: 'What would it take to upgrade from React 17 to 18?'
|
|
330
|
+
|
|
331
|
+
If you hit a rate limit (429), the user's monthly token credits are exhausted \u2014 they can wait for the reset or upgrade their plan. Free-tier repos larger than 2 GB will be rejected with a 413 error; suggest upgrading to Pro or Max for unlimited repo size.`;
|
|
332
332
|
server.tool(
|
|
333
333
|
"ask_repo",
|
|
334
334
|
TOOL_DESCRIPTION,
|
|
@@ -337,18 +337,18 @@ server.tool(
|
|
|
337
337
|
"Repository to analyze. Accepts GitHub URLs (https://github.com/owner/repo), shorthand (owner/repo), GitLab/Bitbucket URLs, or any public Git URL"
|
|
338
338
|
),
|
|
339
339
|
prompt: import_zod.z.string().describe("What to analyze or ask about the codebase"),
|
|
340
|
-
ref: import_zod.z.string().nullable().optional().default(null).describe("Branch, commit SHA, or tag to analyze (default: repository's default branch)")
|
|
341
|
-
fast: import_zod.z.boolean().optional().default(true).describe("Use fast mode for quicker responses")
|
|
340
|
+
ref: import_zod.z.string().nullable().optional().default(null).describe("Branch, commit SHA, or tag to analyze (default: repository's default branch)")
|
|
342
341
|
},
|
|
343
|
-
async ({ repo, prompt, ref
|
|
342
|
+
async ({ repo, prompt, ref }, extra) => {
|
|
344
343
|
const apiUrl = getApiUrl();
|
|
345
344
|
const tracker = createProgressTracker();
|
|
345
|
+
const progressToken = extra._meta?.progressToken ?? `ask_repo_${Date.now()}`;
|
|
346
346
|
const sendProgress = async (message) => {
|
|
347
347
|
try {
|
|
348
348
|
await extra.sendNotification({
|
|
349
349
|
method: "notifications/progress",
|
|
350
350
|
params: {
|
|
351
|
-
progressToken
|
|
351
|
+
progressToken,
|
|
352
352
|
progress: tracker.outputTokens,
|
|
353
353
|
message
|
|
354
354
|
}
|
|
@@ -377,7 +377,6 @@ server.tool(
|
|
|
377
377
|
repo,
|
|
378
378
|
prompt,
|
|
379
379
|
ref,
|
|
380
|
-
fast,
|
|
381
380
|
token: authToken,
|
|
382
381
|
progressCallback: sendProgress,
|
|
383
382
|
tracker
|