buildpartner 0.3.3 → 0.3.5
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/dist/bin/cli.js +6 -0
- package/dist/bin/cli.js.map +1 -1
- package/dist/src/api-client.d.ts +13 -9
- package/dist/src/api-client.js +14 -31
- package/dist/src/api-client.js.map +1 -1
- package/dist/src/commands/log-session.d.ts +3 -6
- package/dist/src/commands/log-session.js +10 -149
- package/dist/src/commands/log-session.js.map +1 -1
- package/dist/src/commands/reset.d.ts +1 -0
- package/dist/src/commands/reset.js +130 -0
- package/dist/src/commands/reset.js.map +1 -0
- package/dist/src/commands/setup.js +83 -398
- package/dist/src/commands/setup.js.map +1 -1
- package/dist/src/commands/sync.d.ts +6 -0
- package/dist/src/commands/sync.js +32 -0
- package/dist/src/commands/sync.js.map +1 -0
- package/dist/src/mcp/catch-up.d.ts +6 -0
- package/dist/src/mcp/catch-up.js +28 -0
- package/dist/src/mcp/catch-up.js.map +1 -0
- package/dist/src/mcp/server.d.ts +13 -0
- package/dist/src/mcp/server.js +71 -81
- package/dist/src/mcp/server.js.map +1 -1
- package/dist/src/mcp/subscription-gate.d.ts +2 -2
- package/dist/src/mcp/subscription-gate.js +4 -9
- package/dist/src/mcp/subscription-gate.js.map +1 -1
- package/dist/src/mcp/tools/get-profile.js +7 -70
- package/dist/src/mcp/tools/get-profile.js.map +1 -1
- package/dist/src/mcp/tools/get-stats.d.ts +8 -34
- package/dist/src/mcp/tools/get-stats.js +7 -97
- package/dist/src/mcp/tools/get-stats.js.map +1 -1
- package/dist/src/mcp/tools/get-suggestions.js +10 -121
- package/dist/src/mcp/tools/get-suggestions.js.map +1 -1
- package/dist/src/mcp/tools/log-highlight.d.ts +2 -10
- package/dist/src/mcp/tools/log-highlight.js +5 -19
- package/dist/src/mcp/tools/log-highlight.js.map +1 -1
- package/dist/src/mcp/tools/quest.d.ts +3 -77
- package/dist/src/mcp/tools/quest.js +6 -70
- package/dist/src/mcp/tools/quest.js.map +1 -1
- package/dist/src/readers/extract-signals.d.ts +23 -0
- package/dist/src/readers/extract-signals.js +50 -0
- package/dist/src/readers/extract-signals.js.map +1 -0
- package/dist/src/readers/session-reader.d.ts +0 -14
- package/dist/src/readers/session-reader.js +3 -122
- package/dist/src/readers/session-reader.js.map +1 -1
- package/dist/src/readers/session-sync.d.ts +24 -0
- package/dist/src/readers/session-sync.js +113 -0
- package/dist/src/readers/session-sync.js.map +1 -0
- package/dist/src/store/local-store.d.ts +12 -60
- package/dist/src/store/local-store.js +16 -113
- package/dist/src/store/local-store.js.map +1 -1
- package/dist/src/store/quest-store.d.ts +5 -68
- package/dist/src/store/quest-store.js +9 -277
- package/dist/src/store/quest-store.js.map +1 -1
- package/dist/src/store/status-store.d.ts +5 -68
- package/dist/src/store/status-store.js +8 -281
- package/dist/src/store/status-store.js.map +1 -1
- package/package.json +1 -1
- package/skills/bp-open-dashboard/SKILL.md +1 -1
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import chalk from "chalk";
|
|
2
|
+
import ora from "ora";
|
|
3
|
+
import { readAuth } from "../store/local-store.js";
|
|
4
|
+
import { scanAllSessions, syncToServer } from "../readers/session-sync.js";
|
|
5
|
+
/**
|
|
6
|
+
* Re-sync all local sessions to the server.
|
|
7
|
+
* Useful when the initial setup sync failed or was incomplete.
|
|
8
|
+
* The server deduplicates, so running this multiple times is safe.
|
|
9
|
+
*/
|
|
10
|
+
export async function sync() {
|
|
11
|
+
const auth = readAuth();
|
|
12
|
+
if (!auth?.token) {
|
|
13
|
+
console.log(chalk.red("Not set up yet. Run: npx buildpartner setup"));
|
|
14
|
+
process.exit(1);
|
|
15
|
+
}
|
|
16
|
+
const spinner = ora("Scanning all sessions...").start();
|
|
17
|
+
const sessions = scanAllSessions();
|
|
18
|
+
spinner.succeed(`Found ${sessions.length} sessions`);
|
|
19
|
+
if (sessions.length === 0) {
|
|
20
|
+
console.log(chalk.yellow("No sessions found in ~/.claude/projects/"));
|
|
21
|
+
return;
|
|
22
|
+
}
|
|
23
|
+
const syncSpinner = ora(`Syncing ${sessions.length} sessions...`).start();
|
|
24
|
+
const { synced, failed } = await syncToServer(sessions, auth.token);
|
|
25
|
+
if (failed) {
|
|
26
|
+
syncSpinner.fail(`Synced ${synced}/${sessions.length} sessions (some failed)`);
|
|
27
|
+
}
|
|
28
|
+
else {
|
|
29
|
+
syncSpinner.succeed(`Synced ${sessions.length} sessions`);
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
//# sourceMappingURL=sync.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sync.js","sourceRoot":"","sources":["../../../src/commands/sync.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,GAAG,MAAM,KAAK,CAAC;AACtB,OAAO,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAC;AACnD,OAAO,EAAE,eAAe,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAE3E;;;;GAIG;AACH,MAAM,CAAC,KAAK,UAAU,IAAI;IACxB,MAAM,IAAI,GAAG,QAAQ,EAAE,CAAC;IACxB,IAAI,CAAC,IAAI,EAAE,KAAK,EAAE,CAAC;QACjB,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,6CAA6C,CAAC,CAAC,CAAC;QACtE,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAClB,CAAC;IAED,MAAM,OAAO,GAAG,GAAG,CAAC,0BAA0B,CAAC,CAAC,KAAK,EAAE,CAAC;IACxD,MAAM,QAAQ,GAAG,eAAe,EAAE,CAAC;IACnC,OAAO,CAAC,OAAO,CAAC,SAAS,QAAQ,CAAC,MAAM,WAAW,CAAC,CAAC;IAErD,IAAI,QAAQ,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QAC1B,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,MAAM,CAAC,0CAA0C,CAAC,CAAC,CAAC;QACtE,OAAO;IACT,CAAC;IAED,MAAM,WAAW,GAAG,GAAG,CAAC,WAAW,QAAQ,CAAC,MAAM,cAAc,CAAC,CAAC,KAAK,EAAE,CAAC;IAC1E,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,GAAG,MAAM,YAAY,CAAC,QAAQ,EAAE,IAAI,CAAC,KAAK,CAAC,CAAC;IACpE,IAAI,MAAM,EAAE,CAAC;QACX,WAAW,CAAC,IAAI,CAAC,UAAU,MAAM,IAAI,QAAQ,CAAC,MAAM,yBAAyB,CAAC,CAAC;IACjF,CAAC;SAAM,CAAC;QACN,WAAW,CAAC,OAAO,CAAC,UAAU,QAAQ,CAAC,MAAM,WAAW,CAAC,CAAC;IAC5D,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Catch-up scan: sync any missed sessions on MCP server startup.
|
|
3
|
+
* Scans ~/.claude/projects/ for recent session files, extracts signals,
|
|
4
|
+
* and POSTs to the server which classifies and deduplicates.
|
|
5
|
+
*/
|
|
6
|
+
export declare function catchUpSessions(): Promise<void>;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Catch-up scan: sync any missed sessions on MCP server startup.
|
|
3
|
+
* Scans ~/.claude/projects/ for recent session files, extracts signals,
|
|
4
|
+
* and POSTs to the server which classifies and deduplicates.
|
|
5
|
+
*/
|
|
6
|
+
import { readAuth, writeAuth, logError } from "../store/local-store.js";
|
|
7
|
+
import { scanRecentSessions, syncToServer } from "../readers/session-sync.js";
|
|
8
|
+
const SEVEN_DAYS_MS = 7 * 24 * 60 * 60 * 1000;
|
|
9
|
+
export async function catchUpSessions() {
|
|
10
|
+
const auth = readAuth();
|
|
11
|
+
if (!auth?.token)
|
|
12
|
+
return;
|
|
13
|
+
const lastSync = auth.last_session_sync
|
|
14
|
+
? new Date(auth.last_session_sync).getTime()
|
|
15
|
+
: 0;
|
|
16
|
+
const cutoff = Math.max(lastSync, Date.now() - SEVEN_DAYS_MS);
|
|
17
|
+
try {
|
|
18
|
+
const sessions = scanRecentSessions(cutoff);
|
|
19
|
+
if (sessions.length > 0) {
|
|
20
|
+
await syncToServer(sessions, auth.token);
|
|
21
|
+
}
|
|
22
|
+
writeAuth({ ...auth, last_session_sync: new Date().toISOString() });
|
|
23
|
+
}
|
|
24
|
+
catch (err) {
|
|
25
|
+
logError(err);
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
//# sourceMappingURL=catch-up.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"catch-up.js","sourceRoot":"","sources":["../../../src/mcp/catch-up.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAC;AACxE,OAAO,EAAE,kBAAkB,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAE9E,MAAM,aAAa,GAAG,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,IAAI,CAAC;AAE9C,MAAM,CAAC,KAAK,UAAU,eAAe;IACnC,MAAM,IAAI,GAAG,QAAQ,EAAE,CAAC;IACxB,IAAI,CAAC,IAAI,EAAE,KAAK;QAAE,OAAO;IAEzB,MAAM,QAAQ,GAAG,IAAI,CAAC,iBAAiB;QACrC,CAAC,CAAC,IAAI,IAAI,CAAC,IAAI,CAAC,iBAAiB,CAAC,CAAC,OAAO,EAAE;QAC5C,CAAC,CAAC,CAAC,CAAC;IAEN,MAAM,MAAM,GAAG,IAAI,CAAC,GAAG,CAAC,QAAQ,EAAE,IAAI,CAAC,GAAG,EAAE,GAAG,aAAa,CAAC,CAAC;IAE9D,IAAI,CAAC;QACH,MAAM,QAAQ,GAAG,kBAAkB,CAAC,MAAM,CAAC,CAAC;QAE5C,IAAI,QAAQ,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;YACxB,MAAM,YAAY,CAAC,QAAQ,EAAE,IAAI,CAAC,KAAK,CAAC,CAAC;QAC3C,CAAC;QAED,SAAS,CAAC,EAAE,GAAG,IAAI,EAAE,iBAAiB,EAAE,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE,EAAE,CAAC,CAAC;IACtE,CAAC;IAAC,OAAO,GAAG,EAAE,CAAC;QACb,QAAQ,CAAC,GAAG,CAAC,CAAC;IAChB,CAAC;AACH,CAAC"}
|
package/dist/src/mcp/server.d.ts
CHANGED
|
@@ -1,3 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* BuildPartner MCP Server.
|
|
3
|
+
*
|
|
4
|
+
* Exposes 5 tools that Claude Code can call during skill execution.
|
|
5
|
+
* Each tool is a thin wrapper around a server API call. No local state or logic.
|
|
6
|
+
*
|
|
7
|
+
* Tools:
|
|
8
|
+
* get_personal_context - fetch user stats, profile, workspace, sessions
|
|
9
|
+
* get_expert_knowledge - search expert frameworks with personalized context
|
|
10
|
+
* save_profile - update the user's AI profile (writing style, preferences, etc.)
|
|
11
|
+
* get_quest_progress - check which quests are completed/active/locked
|
|
12
|
+
* check_status - end-of-skill bookkeeping (usage tracking, quest completion, reminders)
|
|
13
|
+
*/
|
|
1
14
|
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
|
|
2
15
|
export declare function createServer(): McpServer;
|
|
3
16
|
export declare function startServer(): Promise<void>;
|
package/dist/src/mcp/server.js
CHANGED
|
@@ -1,106 +1,96 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* BuildPartner MCP Server.
|
|
3
|
+
*
|
|
4
|
+
* Exposes 5 tools that Claude Code can call during skill execution.
|
|
5
|
+
* Each tool is a thin wrapper around a server API call. No local state or logic.
|
|
6
|
+
*
|
|
7
|
+
* Tools:
|
|
8
|
+
* get_personal_context - fetch user stats, profile, workspace, sessions
|
|
9
|
+
* get_expert_knowledge - search expert frameworks with personalized context
|
|
10
|
+
* save_profile - update the user's AI profile (writing style, preferences, etc.)
|
|
11
|
+
* get_quest_progress - check which quests are completed/active/locked
|
|
12
|
+
* check_status - end-of-skill bookkeeping (usage tracking, quest completion, reminders)
|
|
13
|
+
*/
|
|
1
14
|
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
|
|
2
15
|
import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
|
|
3
16
|
import { z } from "zod";
|
|
4
|
-
import { apiGet, apiPost
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
import { checkAccess } from "./subscription-gate.js";
|
|
8
|
-
// Tools that work even when trial is expired
|
|
9
|
-
const UNGATED_TOOLS = new Set(["check_status", "get_quest_progress"]);
|
|
10
|
-
function gated(toolName, handler) {
|
|
11
|
-
if (UNGATED_TOOLS.has(toolName))
|
|
12
|
-
return handler;
|
|
13
|
-
return async (args) => {
|
|
14
|
-
const blocked = await checkAccess();
|
|
15
|
-
if (blocked) {
|
|
16
|
-
return { content: [{ type: "text", text: blocked }] };
|
|
17
|
-
}
|
|
18
|
-
return handler(args);
|
|
19
|
-
};
|
|
20
|
-
}
|
|
17
|
+
import { apiFetch, apiGet, apiPost } from "../api-client.js";
|
|
18
|
+
/** Helper to format a text response for MCP */
|
|
19
|
+
const textResponse = (text) => ({ content: [{ type: "text", text }] });
|
|
21
20
|
export function createServer() {
|
|
22
|
-
const server = new McpServer({
|
|
23
|
-
name: "buildpartner",
|
|
24
|
-
version: "0.2.0",
|
|
25
|
-
});
|
|
26
|
-
track("mcp.server.start");
|
|
27
|
-
// ─── GET PERSONAL CONTEXT ───────────────────────────────────
|
|
28
|
-
// Returns: stats, AI profile, workspace, subscription, daily activity.
|
|
29
|
-
// Optionally includes session history for skills that need it.
|
|
21
|
+
const server = new McpServer({ name: "buildpartner", version: "0.3.0" });
|
|
30
22
|
server.tool("get_personal_context", "Get your personal context: stats, AI profile, workspace, subscription status, and optionally recent session history. This is the main data source for most skills.", {
|
|
31
23
|
include_sessions: z.boolean().optional().describe("Include last 30 session summaries. Use for skills that need session history (coach, recap, interview, enhance-claude-md). Omit for lighter payload."),
|
|
32
|
-
},
|
|
33
|
-
|
|
34
|
-
const
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
// so consultant skills only need one call.
|
|
24
|
+
}, async ({ include_sessions }) => {
|
|
25
|
+
const queryString = include_sessions ? "?include_sessions=true" : "";
|
|
26
|
+
const res = await apiFetch(`/api/buildpartner/context${queryString}`);
|
|
27
|
+
if (!res)
|
|
28
|
+
return textResponse(JSON.stringify({ error: "Could not reach server. Check your connection." }));
|
|
29
|
+
if (res.status === 403)
|
|
30
|
+
return textResponse(await res.text());
|
|
31
|
+
if (!res.ok)
|
|
32
|
+
return textResponse(JSON.stringify({ error: "Request failed." }));
|
|
33
|
+
return textResponse(JSON.stringify(await res.json(), null, 2));
|
|
34
|
+
});
|
|
44
35
|
server.tool("get_expert_knowledge", "Search or fetch expert frameworks (pricing, content, launch, AI automation, etc). Also returns your personal context for personalized advice. Use query to search, or topic to fetch a specific framework.", {
|
|
45
|
-
query: z.string().optional().describe("Search query to find relevant frameworks
|
|
46
|
-
topic: z.string().optional().describe("Specific topic key to fetch full content
|
|
47
|
-
},
|
|
48
|
-
track("mcp.tool.get_expert_knowledge", { query, topic });
|
|
36
|
+
query: z.string().optional().describe("Search query to find relevant frameworks"),
|
|
37
|
+
topic: z.string().optional().describe("Specific topic key to fetch full content"),
|
|
38
|
+
}, async ({ query, topic }) => {
|
|
49
39
|
const params = new URLSearchParams();
|
|
50
40
|
if (query)
|
|
51
41
|
params.set("query", query);
|
|
52
42
|
if (topic)
|
|
53
43
|
params.set("topic", topic);
|
|
54
|
-
const
|
|
55
|
-
const path =
|
|
56
|
-
const
|
|
57
|
-
if (!
|
|
58
|
-
return
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
44
|
+
const queryString = params.toString();
|
|
45
|
+
const path = queryString ? `/api/buildpartner/expert-knowledge?${queryString}` : "/api/buildpartner/expert-knowledge";
|
|
46
|
+
const res = await apiFetch(path);
|
|
47
|
+
if (!res)
|
|
48
|
+
return textResponse(JSON.stringify({ error: "Could not reach server. Check your connection." }));
|
|
49
|
+
if (res.status === 403)
|
|
50
|
+
return textResponse(await res.text());
|
|
51
|
+
if (!res.ok)
|
|
52
|
+
return textResponse(JSON.stringify({ error: "Request failed." }));
|
|
53
|
+
return textResponse(JSON.stringify(await res.json(), null, 2));
|
|
54
|
+
});
|
|
64
55
|
server.tool("save_profile", "Save your AI profile. Updates multiple sections at once: writing_style, preferences, tech_identity, work_patterns, personality. Used after interviews or profile building.", {
|
|
65
|
-
updates: z.record(z.string(), z.any()).describe("Object with section names as keys and section data as values.
|
|
66
|
-
signals: z.array(z.string()).optional().describe("Summary of what was learned, stored as raw signals
|
|
67
|
-
},
|
|
68
|
-
track("mcp.tool.save_profile", { sections: Object.keys(updates) });
|
|
56
|
+
updates: z.record(z.string(), z.any()).describe("Object with section names as keys and section data as values."),
|
|
57
|
+
signals: z.array(z.string()).optional().describe("Summary of what was learned, stored as raw signals."),
|
|
58
|
+
}, async ({ updates, signals }) => {
|
|
69
59
|
const payload = { ...updates };
|
|
70
60
|
if (signals)
|
|
71
61
|
payload.raw_signals = signals;
|
|
72
|
-
const
|
|
73
|
-
if (!
|
|
74
|
-
return
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
const result = await
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
server.tool("check_status", "Check system status and get reminders. Every skill should call this as its final step.", {
|
|
88
|
-
skill_name: z.string().describe("The skill that just ran (e.g., 'coach', 'recap-week')"),
|
|
62
|
+
const res = await apiFetch("/api/buildpartner/profile", { method: "POST", body: JSON.stringify(payload) });
|
|
63
|
+
if (!res)
|
|
64
|
+
return textResponse(JSON.stringify({ error: "Could not reach server." }));
|
|
65
|
+
if (res.status === 403)
|
|
66
|
+
return textResponse(await res.text());
|
|
67
|
+
if (!res.ok)
|
|
68
|
+
return textResponse(JSON.stringify({ error: "Could not save profile." }));
|
|
69
|
+
return textResponse(JSON.stringify({ saved: true, sections: Object.keys(updates) }));
|
|
70
|
+
});
|
|
71
|
+
server.tool("get_quest_progress", "Check your quest progress: which quests are completed, active, or locked.", {}, async () => {
|
|
72
|
+
const result = await apiGet("/api/buildpartner/quests");
|
|
73
|
+
if (!result)
|
|
74
|
+
return textResponse(JSON.stringify({ error: "Could not fetch quest progress." }));
|
|
75
|
+
return textResponse(JSON.stringify(result, null, 2));
|
|
76
|
+
});
|
|
77
|
+
server.tool("check_status", "Check system status and get reminders. Every skill should call this as its final step. If the response contains reminders or quest_completed, display them to the user as a visible section at the end of your response.", {
|
|
78
|
+
skill_name: z.string().describe("The skill that just ran (e.g., 'bp-coach', 'bp-recap-week')"),
|
|
89
79
|
session_context: z.string().optional().describe("Brief description of what the session involved"),
|
|
90
|
-
},
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
80
|
+
}, async ({ skill_name, session_context }) => {
|
|
81
|
+
const result = await apiPost("/api/buildpartner/check-status", { skill_name, session_context });
|
|
82
|
+
if (!result)
|
|
83
|
+
return textResponse(JSON.stringify({ status: "ok", reminders: [] }));
|
|
84
|
+
return textResponse(JSON.stringify(result, null, 2));
|
|
85
|
+
});
|
|
95
86
|
return server;
|
|
96
87
|
}
|
|
97
88
|
export async function startServer() {
|
|
98
89
|
const server = createServer();
|
|
99
90
|
const transport = new StdioServerTransport();
|
|
100
|
-
//
|
|
101
|
-
import("../installer/skill-sync.js")
|
|
102
|
-
|
|
103
|
-
.catch(() => { }); // Never block startup
|
|
91
|
+
// Background tasks on startup (non-blocking, fire-and-forget)
|
|
92
|
+
import("../installer/skill-sync.js").then(({ syncSkills }) => syncSkills()).catch(() => { });
|
|
93
|
+
import("./catch-up.js").then(({ catchUpSessions }) => catchUpSessions()).catch(() => { });
|
|
104
94
|
await server.connect(transport);
|
|
105
95
|
}
|
|
106
96
|
//# sourceMappingURL=server.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"server.js","sourceRoot":"","sources":["../../../src/mcp/server.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AACpE,OAAO,EAAE,oBAAoB,EAAE,MAAM,2CAA2C,CAAC;AACjF,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"server.js","sourceRoot":"","sources":["../../../src/mcp/server.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AACpE,OAAO,EAAE,oBAAoB,EAAE,MAAM,2CAA2C,CAAC;AACjF,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAE7D,+CAA+C;AAC/C,MAAM,YAAY,GAAG,CAAC,IAAY,EAAE,EAAE,CAAC,CAAC,EAAE,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAe,EAAE,IAAI,EAAE,CAAC,EAAE,CAAC,CAAC;AAExF,MAAM,UAAU,YAAY;IAC1B,MAAM,MAAM,GAAG,IAAI,SAAS,CAAC,EAAE,IAAI,EAAE,cAAc,EAAE,OAAO,EAAE,OAAO,EAAE,CAAC,CAAC;IAEzE,MAAM,CAAC,IAAI,CACT,sBAAsB,EACtB,oKAAoK,EACpK;QACE,gBAAgB,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,qJAAqJ,CAAC;KACzM,EACD,KAAK,EAAE,EAAE,gBAAgB,EAAE,EAAE,EAAE;QAC7B,MAAM,WAAW,GAAG,gBAAgB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AgD,CAAC;KAClG,EACD,KAAK,EAAE,EAAE,UAAU,EAAE,eAAe,EAAE,EAAE,EAAE;QACxC,MAAM,MAAM,GAAG,MAAM,OAAO,CAAC,gCAAgC,EAAE,EAAE,UAAU,EAAE,eAAe,EAAE,CAAC,CAAC;QAChG,IAAI,CAAC,MAAM;YAAE,OAAO,YAAY,CAAC,IAAI,CAAC,SAAS,CAAC,EAAE,MAAM,EAAE,IAAI,EAAE,SAAS,EAAE,EAAE,EAAE,CAAC,CAAC,CAAC;QAClF,OAAO,YAAY,CAAC,IAAI,CAAC,SAAS,CAAC,MAAM,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC;IACvD,CAAC,CACF,CAAC;IAEF,OAAO,MAAM,CAAC;AAChB,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,WAAW;IAC/B,MAAM,MAAM,GAAG,YAAY,EAAE,CAAC;IAC9B,MAAM,SAAS,GAAG,IAAI,oBAAoB,EAAE,CAAC;IAE7C,8DAA8D;IAC9D,MAAM,CAAC,4BAA4B,CAAC,CAAC,IAAI,CAAC,CAAC,EAAE,UAAU,EAAE,EAAE,EAAE,CAAC,UAAU,EAAE,CAAC,CAAC,KAAK,CAAC,GAAG,EAAE,GAAE,CAAC,CAAC,CAAC;IAC5F,MAAM,CAAC,eAAe,CAAC,CAAC,IAAI,CAAC,CAAC,EAAE,eAAe,EAAE,EAAE,EAAE,CAAC,eAAe,EAAE,CAAC,CAAC,KAAK,CAAC,GAAG,EAAE,GAAE,CAAC,CAAC,CAAC;IAEzF,MAAM,MAAM,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;AAClC,CAAC"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Subscription gate for MCP tool calls.
|
|
3
3
|
*
|
|
4
|
-
* Checks if the user has an active trial or has paid.
|
|
4
|
+
* Checks if the user has an active trial (usage-based) or has paid.
|
|
5
5
|
* Caches the result for 5 minutes to avoid hitting the API on every call.
|
|
6
6
|
*/
|
|
7
7
|
/**
|
|
@@ -14,6 +14,6 @@ export declare function checkAccess(): Promise<string | null>;
|
|
|
14
14
|
*/
|
|
15
15
|
export declare function getTrialInfo(): Promise<{
|
|
16
16
|
status: "active" | "trial" | "expired";
|
|
17
|
-
|
|
17
|
+
uses_left: number;
|
|
18
18
|
upgrade_url: string;
|
|
19
19
|
} | null>;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Subscription gate for MCP tool calls.
|
|
3
3
|
*
|
|
4
|
-
* Checks if the user has an active trial or has paid.
|
|
4
|
+
* Checks if the user has an active trial (usage-based) or has paid.
|
|
5
5
|
* Caches the result for 5 minutes to avoid hitting the API on every call.
|
|
6
6
|
*/
|
|
7
7
|
import { apiGet } from "../api-client.js";
|
|
@@ -40,16 +40,11 @@ export async function checkAccess() {
|
|
|
40
40
|
return null;
|
|
41
41
|
}
|
|
42
42
|
if (status.status === "trial") {
|
|
43
|
-
// Trial active, but remind them on last 2 days
|
|
44
|
-
if (status.trial_days_left <= 2) {
|
|
45
|
-
// Don't block, just return null. The check_status tool can remind them.
|
|
46
|
-
return null;
|
|
47
|
-
}
|
|
48
43
|
return null;
|
|
49
44
|
}
|
|
50
|
-
// Trial expired and hasn't paid
|
|
45
|
+
// Trial expired (used all free skill uses) and hasn't paid
|
|
51
46
|
return [
|
|
52
|
-
"
|
|
47
|
+
"You've used all 20 free skill runs.",
|
|
53
48
|
"",
|
|
54
49
|
"Upgrade to keep using BuildPartner ($8.99, one-time):",
|
|
55
50
|
status.upgrade_url,
|
|
@@ -67,7 +62,7 @@ export async function getTrialInfo() {
|
|
|
67
62
|
return null;
|
|
68
63
|
return {
|
|
69
64
|
status: status.status,
|
|
70
|
-
|
|
65
|
+
uses_left: status.uses_left,
|
|
71
66
|
upgrade_url: status.upgrade_url,
|
|
72
67
|
};
|
|
73
68
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"subscription-gate.js","sourceRoot":"","sources":["../../../src/mcp/subscription-gate.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAC1C,OAAO,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAC;
|
|
1
|
+
{"version":3,"file":"subscription-gate.js","sourceRoot":"","sources":["../../../src/mcp/subscription-gate.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAC1C,OAAO,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAC;AAWnD,IAAI,YAAY,GAA8B,IAAI,CAAC;AACnD,IAAI,cAAc,GAAG,CAAC,CAAC;AACvB,MAAM,YAAY,GAAG,CAAC,GAAG,EAAE,GAAG,IAAI,CAAC,CAAC,YAAY;AAEhD,KAAK,UAAU,qBAAqB;IAClC,MAAM,GAAG,GAAG,IAAI,CAAC,GAAG,EAAE,CAAC;IACvB,IAAI,YAAY,IAAI,GAAG,GAAG,cAAc,GAAG,YAAY,EAAE,CAAC;QACxD,OAAO,YAAY,CAAC;IACtB,CAAC;IAED,MAAM,MAAM,GAAG,MAAM,MAAM,CAAqB,gCAAgC,CAAC,CAAC;IAClF,IAAI,MAAM,EAAE,CAAC;QACX,YAAY,GAAG,MAAM,CAAC;QACtB,cAAc,GAAG,GAAG,CAAC;IACvB,CAAC;IACD,OAAO,MAAM,CAAC;AAChB,CAAC;AAED;;;GAGG;AACH,MAAM,CAAC,KAAK,UAAU,WAAW;IAC/B,MAAM,IAAI,GAAG,QAAQ,EAAE,CAAC;IACxB,IAAI,CAAC,IAAI,EAAE,KAAK,EAAE,CAAC;QACjB,mEAAmE;QACnE,OAAO,IAAI,CAAC;IACd,CAAC;IAED,MAAM,MAAM,GAAG,MAAM,qBAAqB,EAAE,CAAC;IAE7C,6DAA6D;IAC7D,IAAI,CAAC,MAAM,EAAE,CAAC;QACZ,OAAO,IAAI,CAAC;IACd,CAAC;IAED,IAAI,MAAM,CAAC,MAAM,KAAK,QAAQ,EAAE,CAAC;QAC/B,OAAO,IAAI,CAAC;IACd,CAAC;IAED,IAAI,MAAM,CAAC,MAAM,KAAK,OAAO,EAAE,CAAC;QAC9B,OAAO,IAAI,CAAC;IACd,CAAC;IAED,2DAA2D;IAC3D,OAAO;QACL,qCAAqC;QACrC,EAAE;QACF,uDAAuD;QACvD,MAAM,CAAC,WAAW;QAClB,EAAE;QACF,kCAAkC;QAClC,SAAS,MAAM,CAAC,WAAW,GAAG;KAC/B,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AACf,CAAC;AAED;;GAEG;AACH,MAAM,CAAC,KAAK,UAAU,YAAY;IAKhC,MAAM,MAAM,GAAG,MAAM,qBAAqB,EAAE,CAAC;IAC7C,IAAI,CAAC,MAAM;QAAE,OAAO,IAAI,CAAC;IACzB,OAAO;QACL,MAAM,EAAE,MAAM,CAAC,MAAM;QACrB,SAAS,EAAE,MAAM,CAAC,SAAS;QAC3B,WAAW,EAAE,MAAM,CAAC,WAAW;KAChC,CAAC;AACJ,CAAC"}
|
|
@@ -1,77 +1,14 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { getStatsSummary } from "../../readers/stats-reader.js";
|
|
1
|
+
import { readAuth } from "../../store/local-store.js";
|
|
3
2
|
import { apiGet } from "../../api-client.js";
|
|
4
3
|
export async function getProfile() {
|
|
5
4
|
const auth = readAuth();
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
const apiData = await apiGet(`/api/buildpartner/dashboard?username=${auth.username}`);
|
|
9
|
-
if (apiData)
|
|
10
|
-
return apiData;
|
|
5
|
+
if (!auth?.username) {
|
|
6
|
+
return { error: "Not set up. Run: npx buildpartner setup" };
|
|
11
7
|
}
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
const highlights = readHighlights();
|
|
16
|
-
const stats = getStatsSummary();
|
|
17
|
-
const recentSessions = sessions.slice(-10).reverse();
|
|
18
|
-
const mcpServerCounts = {};
|
|
19
|
-
const skillCounts = {};
|
|
20
|
-
const topTools = {};
|
|
21
|
-
for (const s of sessions) {
|
|
22
|
-
if (s.mcp_servers_used) {
|
|
23
|
-
for (const server of s.mcp_servers_used) {
|
|
24
|
-
mcpServerCounts[server] = (mcpServerCounts[server] || 0) + 1;
|
|
25
|
-
}
|
|
26
|
-
}
|
|
27
|
-
if (s.skills_invoked) {
|
|
28
|
-
for (const skill of s.skills_invoked) {
|
|
29
|
-
skillCounts[skill] = (skillCounts[skill] || 0) + 1;
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
if (s.tool_counts) {
|
|
33
|
-
for (const [tool, count] of Object.entries(s.tool_counts)) {
|
|
34
|
-
topTools[tool] = (topTools[tool] || 0) + count;
|
|
35
|
-
}
|
|
36
|
-
}
|
|
8
|
+
const data = await apiGet(`/api/buildpartner/dashboard?username=${auth.username}`);
|
|
9
|
+
if (!data) {
|
|
10
|
+
return { error: "Could not fetch profile. Check your connection." };
|
|
37
11
|
}
|
|
38
|
-
return
|
|
39
|
-
username: auth?.username ?? null,
|
|
40
|
-
email: auth?.email ?? null,
|
|
41
|
-
profile_url: auth?.profile_url ?? null,
|
|
42
|
-
path: profile?.path ?? "unknown",
|
|
43
|
-
path_scores: profile?.path_scores ?? {},
|
|
44
|
-
streak: {
|
|
45
|
-
current: profile?.streak_current ?? stats?.currentStreak ?? 0,
|
|
46
|
-
best: profile?.streak_best ?? stats?.bestStreak ?? 0,
|
|
47
|
-
},
|
|
48
|
-
totals: {
|
|
49
|
-
sessions: profile?.total_sessions ?? sessions.length,
|
|
50
|
-
tokens: profile?.total_tokens ?? 0,
|
|
51
|
-
highlights: highlights.length,
|
|
52
|
-
active_since: profile?.active_since ?? stats?.firstDate ?? null,
|
|
53
|
-
},
|
|
54
|
-
workspace: profile?.workspace ?? null,
|
|
55
|
-
tooling: {
|
|
56
|
-
mcp_servers: mcpServerCounts,
|
|
57
|
-
skills: skillCounts,
|
|
58
|
-
top_tools: Object.fromEntries(Object.entries(topTools).sort((a, b) => b[1] - a[1]).slice(0, 15)),
|
|
59
|
-
},
|
|
60
|
-
recent_sessions: recentSessions.map((s) => ({
|
|
61
|
-
timestamp: s.timestamp,
|
|
62
|
-
project: s.project,
|
|
63
|
-
activity_type: s.activity_type,
|
|
64
|
-
summary: s.summary,
|
|
65
|
-
tokens: s.tokens,
|
|
66
|
-
duration_minutes: s.duration_minutes,
|
|
67
|
-
})),
|
|
68
|
-
highlights: highlights.slice(-5).reverse().map((h) => ({
|
|
69
|
-
title: h.title,
|
|
70
|
-
description: h.description,
|
|
71
|
-
activity_type: h.activity_type,
|
|
72
|
-
tech_stack: h.tech_stack,
|
|
73
|
-
created_at: h.created_at,
|
|
74
|
-
})),
|
|
75
|
-
};
|
|
12
|
+
return data;
|
|
76
13
|
}
|
|
77
14
|
//# sourceMappingURL=get-profile.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-profile.js","sourceRoot":"","sources":["../../../../src/mcp/tools/get-profile.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"get-profile.js","sourceRoot":"","sources":["../../../../src/mcp/tools/get-profile.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,4BAA4B,CAAC;AACtD,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAE7C,MAAM,CAAC,KAAK,UAAU,UAAU;IAC9B,MAAM,IAAI,GAAG,QAAQ,EAAE,CAAC;IACxB,IAAI,CAAC,IAAI,EAAE,QAAQ,EAAE,CAAC;QACpB,OAAO,EAAE,KAAK,EAAE,yCAAyC,EAAE,CAAC;IAC9D,CAAC;IAED,MAAM,IAAI,GAAG,MAAM,MAAM,CAAC,wCAAwC,IAAI,CAAC,QAAQ,EAAE,CAAC,CAAC;IACnF,IAAI,CAAC,IAAI,EAAE,CAAC;QACV,OAAO,EAAE,KAAK,EAAE,iDAAiD,EAAE,CAAC;IACtE,CAAC;IACD,OAAO,IAAI,CAAC;AACd,CAAC"}
|
|
@@ -9,50 +9,24 @@ export declare const getStatsSchema: {
|
|
|
9
9
|
export declare function getStats({ period }: {
|
|
10
10
|
period: "week" | "month" | "all";
|
|
11
11
|
}): Promise<{
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
distribution: Record<string, number>;
|
|
20
|
-
dailyBreakdown: Record<string, {
|
|
21
|
-
sessions: number;
|
|
22
|
-
types: string[];
|
|
23
|
-
tokens: number;
|
|
24
|
-
}>;
|
|
25
|
-
streak: {
|
|
26
|
-
current: number;
|
|
27
|
-
best: number;
|
|
28
|
-
};
|
|
29
|
-
fingerprint: string;
|
|
30
|
-
pathScores: {};
|
|
31
|
-
allTime: {
|
|
32
|
-
totalSessions: number;
|
|
33
|
-
totalTokens: number;
|
|
34
|
-
activeSince: null;
|
|
35
|
-
};
|
|
12
|
+
error: string;
|
|
13
|
+
period?: undefined;
|
|
14
|
+
sessionCount?: undefined;
|
|
15
|
+
totalTokens?: undefined;
|
|
16
|
+
distribution?: undefined;
|
|
17
|
+
streak?: undefined;
|
|
18
|
+
allTime?: undefined;
|
|
36
19
|
} | {
|
|
37
20
|
period: "week" | "month" | "all";
|
|
38
21
|
sessionCount: number;
|
|
39
22
|
totalTokens: number;
|
|
40
|
-
highlights: import("../../store/local-store.js").HighlightEntry[];
|
|
41
23
|
distribution: Record<string, number>;
|
|
42
|
-
dailyBreakdown: Record<string, {
|
|
43
|
-
sessions: number;
|
|
44
|
-
types: string[];
|
|
45
|
-
tokens: number;
|
|
46
|
-
}>;
|
|
47
24
|
streak: {
|
|
48
25
|
current: number;
|
|
49
|
-
best: number;
|
|
50
26
|
};
|
|
51
|
-
fingerprint: string;
|
|
52
|
-
pathScores: Record<string, number>;
|
|
53
27
|
allTime: {
|
|
54
28
|
totalSessions: number;
|
|
55
29
|
totalTokens: number;
|
|
56
|
-
activeSince: string | null;
|
|
57
30
|
};
|
|
31
|
+
error?: undefined;
|
|
58
32
|
}>;
|