@devclocked/cli 1.0.0 → 2.0.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/dist/auth.d.ts +16 -0
- package/dist/auth.d.ts.map +1 -0
- package/dist/auth.js +68 -0
- package/dist/auth.js.map +1 -0
- package/dist/branding/dashboard.d.ts +26 -0
- package/dist/branding/dashboard.d.ts.map +1 -0
- package/dist/branding/dashboard.js +383 -0
- package/dist/branding/dashboard.js.map +1 -0
- package/dist/commands/mcp-health.d.ts +8 -0
- package/dist/commands/mcp-health.d.ts.map +1 -0
- package/dist/commands/mcp-health.js +75 -0
- package/dist/commands/mcp-health.js.map +1 -0
- package/dist/commands/mcp-server.d.ts +65 -0
- package/dist/commands/mcp-server.d.ts.map +1 -0
- package/dist/commands/mcp-server.js +280 -0
- package/dist/commands/mcp-server.js.map +1 -0
- package/dist/commands/summary.d.ts +6 -0
- package/dist/commands/summary.d.ts.map +1 -0
- package/dist/commands/summary.js +45 -0
- package/dist/commands/summary.js.map +1 -0
- package/dist/config.d.ts +1 -1
- package/dist/config.js +1 -1
- package/dist/index.js +8 -1
- package/dist/index.js.map +1 -1
- package/dist/mcp-utils.d.ts +15 -0
- package/dist/mcp-utils.d.ts.map +1 -0
- package/dist/mcp-utils.js +55 -0
- package/dist/mcp-utils.js.map +1 -0
- package/package.json +3 -2
package/dist/auth.d.ts
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* CLI auth helper — bootstraps TrackerClient with API key from config file.
|
|
3
|
+
*
|
|
4
|
+
* The tracker-core AuthManager holds the API key in-memory only (by design —
|
|
5
|
+
* VS Code globalState is syncable, so persisting keys there is a leak vector).
|
|
6
|
+
* But CLI commands are short-lived processes that need to read the key from
|
|
7
|
+
* disk on every invocation. This helper reads the key from cli.json and
|
|
8
|
+
* primes the in-memory state without a network roundtrip.
|
|
9
|
+
*/
|
|
10
|
+
import { TrackerClient } from '@devclocked/tracker-core';
|
|
11
|
+
/**
|
|
12
|
+
* Create a TrackerClient that is already authenticated from the CLI config file.
|
|
13
|
+
* Returns null if not authenticated.
|
|
14
|
+
*/
|
|
15
|
+
export declare function createAuthenticatedClient(): Promise<TrackerClient | null>;
|
|
16
|
+
//# sourceMappingURL=auth.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"auth.d.ts","sourceRoot":"","sources":["../src/auth.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AAWzD;;;GAGG;AACH,wBAAsB,yBAAyB,IAAI,OAAO,CAAC,aAAa,GAAG,IAAI,CAAC,CA4B/E"}
|
package/dist/auth.js
ADDED
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* CLI auth helper — bootstraps TrackerClient with API key from config file.
|
|
4
|
+
*
|
|
5
|
+
* The tracker-core AuthManager holds the API key in-memory only (by design —
|
|
6
|
+
* VS Code globalState is syncable, so persisting keys there is a leak vector).
|
|
7
|
+
* But CLI commands are short-lived processes that need to read the key from
|
|
8
|
+
* disk on every invocation. This helper reads the key from cli.json and
|
|
9
|
+
* primes the in-memory state without a network roundtrip.
|
|
10
|
+
*/
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.createAuthenticatedClient = createAuthenticatedClient;
|
|
13
|
+
const tracker_core_1 = require("@devclocked/tracker-core");
|
|
14
|
+
const FileStorageAdapter_1 = require("./storage/FileStorageAdapter");
|
|
15
|
+
const config_1 = require("./config");
|
|
16
|
+
/**
|
|
17
|
+
* Create a TrackerClient that is already authenticated from the CLI config file.
|
|
18
|
+
* Returns null if not authenticated.
|
|
19
|
+
*/
|
|
20
|
+
async function createAuthenticatedClient() {
|
|
21
|
+
const storage = new FileStorageAdapter_1.FileStorageAdapter();
|
|
22
|
+
const client = new tracker_core_1.TrackerClient({
|
|
23
|
+
supabaseUrl: config_1.SUPABASE_URL,
|
|
24
|
+
supabaseAnonKey: config_1.SUPABASE_ANON_KEY,
|
|
25
|
+
source: 'cli',
|
|
26
|
+
clientId: `cli-${Date.now()}`,
|
|
27
|
+
debug: false,
|
|
28
|
+
}, storage);
|
|
29
|
+
client.stopAutoProcessing();
|
|
30
|
+
// Try to load API key from legacy auth_state in storage
|
|
31
|
+
const authStateRaw = await storage.get('auth_state');
|
|
32
|
+
if (authStateRaw) {
|
|
33
|
+
try {
|
|
34
|
+
const parsed = JSON.parse(authStateRaw);
|
|
35
|
+
if (parsed.apiKey && parsed.apiKey.startsWith('dck_')) {
|
|
36
|
+
await bootstrapAuth(client, storage, parsed);
|
|
37
|
+
return client;
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
catch {
|
|
41
|
+
// Malformed auth_state
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
client.destroy();
|
|
45
|
+
return null;
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* Bootstrap auth into the TrackerClient's AuthManager without a network call.
|
|
49
|
+
* Sets the in-memory API key and ensures auth_metadata exists so
|
|
50
|
+
* getAuthState() works.
|
|
51
|
+
*/
|
|
52
|
+
async function bootstrapAuth(client, storage, auth) {
|
|
53
|
+
// Set API key in memory (AuthManager keeps it out of storage by design)
|
|
54
|
+
const authManager = client.authManager;
|
|
55
|
+
if (authManager) {
|
|
56
|
+
authManager.apiKeyInMemory = auth.apiKey;
|
|
57
|
+
}
|
|
58
|
+
// Ensure auth_metadata exists so getAuthState() returns non-null
|
|
59
|
+
const existing = await storage.get('auth_metadata');
|
|
60
|
+
if (!existing) {
|
|
61
|
+
await storage.set('auth_metadata', JSON.stringify({
|
|
62
|
+
userId: auth.userId,
|
|
63
|
+
email: auth.email,
|
|
64
|
+
authenticatedAt: auth.authenticatedAt,
|
|
65
|
+
}));
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
//# sourceMappingURL=auth.js.map
|
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AAC;IAChD,IAAI,WAAW,EAAE,CAAC;QAChB,WAAW,CAAC,cAAc,GAAG,IAAI,CAAC,MAAM,CAAC;IAC3C,CAAC;IAED,iEAAiE;IACjE,MAAM,QAAQ,GAAG,MAAM,OAAO,CAAC,GAAG,CAAC,eAAe,CAAC,CAAC;IACpD,IAAI,CAAC,QAAQ,EAAE,CAAC;QACd,MAAM,OAAO,CAAC,GAAG,CAAC,eAAe,EAAE,IAAI,CAAC,SAAS,CAAC;YAChD,MAAM,EAAE,IAAI,CAAC,MAAM;YACnB,KAAK,EAAE,IAAI,CAAC,KAAK;YACjB,eAAe,EAAE,IAAI,CAAC,eAAe;SACtC,CAAC,CAAC,CAAC;IACN,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Terminal dashboard renderer for `devclocked summary`
|
|
3
|
+
*/
|
|
4
|
+
import { TodayActivityResponse } from '@devclocked/tracker-core';
|
|
5
|
+
export declare function renderProgressBar(filled: number, total: number, barWidth: number): string;
|
|
6
|
+
interface RepoAggregate {
|
|
7
|
+
name: string;
|
|
8
|
+
minutes: number;
|
|
9
|
+
linesAdded: number;
|
|
10
|
+
linesDeleted: number;
|
|
11
|
+
ticks: number;
|
|
12
|
+
tokensTotal: number;
|
|
13
|
+
}
|
|
14
|
+
export declare function aggregateByRepo(data: TodayActivityResponse): RepoAggregate[];
|
|
15
|
+
export declare function buildCompactSummary(data: TodayActivityResponse): string;
|
|
16
|
+
export declare function renderCompactSummary(data: TodayActivityResponse): void;
|
|
17
|
+
export declare function buildFullDashboard(data: TodayActivityResponse): string;
|
|
18
|
+
export declare function renderFullDashboard(data: TodayActivityResponse): void;
|
|
19
|
+
export interface WeeklyDayEntry {
|
|
20
|
+
date: string;
|
|
21
|
+
data: TodayActivityResponse;
|
|
22
|
+
}
|
|
23
|
+
export declare function buildPlainWeeklySummary(days: WeeklyDayEntry[]): string;
|
|
24
|
+
export declare function buildPlainSummary(data: TodayActivityResponse): string;
|
|
25
|
+
export {};
|
|
26
|
+
//# sourceMappingURL=dashboard.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dashboard.d.ts","sourceRoot":"","sources":["../../src/branding/dashboard.ts"],"names":[],"mappings":"AAAA;;GAEG;AAGH,OAAO,EAAE,qBAAqB,EAAqB,MAAM,0BAA0B,CAAC;AAkCpF,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,MAAM,CAKzF;AAED,UAAU,aAAa;IACrB,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,EAAE,MAAM,CAAC;IACnB,YAAY,EAAE,MAAM,CAAC;IACrB,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,EAAE,MAAM,CAAC;CACrB;AAED,wBAAgB,eAAe,CAAC,IAAI,EAAE,qBAAqB,GAAG,aAAa,EAAE,CA2B5E;AAqFD,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,qBAAqB,GAAG,MAAM,CAsFvE;AAED,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,qBAAqB,GAAG,IAAI,CAEtE;AAID,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,qBAAqB,GAAG,MAAM,CAoEtE;AAED,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,qBAAqB,GAAG,IAAI,CAErE;AAID,MAAM,WAAW,cAAc;IAC7B,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,qBAAqB,CAAC;CAC7B;AAED,wBAAgB,uBAAuB,CAAC,IAAI,EAAE,cAAc,EAAE,GAAG,MAAM,CAmDtE;AAID,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,qBAAqB,GAAG,MAAM,CAgDrE"}
|
|
@@ -0,0 +1,383 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Terminal dashboard renderer for `devclocked summary`
|
|
4
|
+
*/
|
|
5
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
6
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
7
|
+
};
|
|
8
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
+
exports.renderProgressBar = renderProgressBar;
|
|
10
|
+
exports.aggregateByRepo = aggregateByRepo;
|
|
11
|
+
exports.buildCompactSummary = buildCompactSummary;
|
|
12
|
+
exports.renderCompactSummary = renderCompactSummary;
|
|
13
|
+
exports.buildFullDashboard = buildFullDashboard;
|
|
14
|
+
exports.renderFullDashboard = renderFullDashboard;
|
|
15
|
+
exports.buildPlainWeeklySummary = buildPlainWeeklySummary;
|
|
16
|
+
exports.buildPlainSummary = buildPlainSummary;
|
|
17
|
+
const chalk_1 = __importDefault(require("chalk"));
|
|
18
|
+
const GOLD = chalk_1.default.hex('#F8D74A');
|
|
19
|
+
const DIM = chalk_1.default.dim;
|
|
20
|
+
const WHITE = chalk_1.default.white;
|
|
21
|
+
const CYAN = chalk_1.default.cyan;
|
|
22
|
+
const GREEN = chalk_1.default.green;
|
|
23
|
+
const GRAY = chalk_1.default.gray;
|
|
24
|
+
// Box-drawing characters (full dashboard only)
|
|
25
|
+
const TOP_LEFT = '╭';
|
|
26
|
+
const TOP_RIGHT = '╮';
|
|
27
|
+
const BOT_LEFT = '╰';
|
|
28
|
+
const BOT_RIGHT = '╯';
|
|
29
|
+
const HORIZ = '─';
|
|
30
|
+
const VERT = '│';
|
|
31
|
+
const TEE_LEFT = '├';
|
|
32
|
+
const TEE_RIGHT = '┤';
|
|
33
|
+
const INNER_WIDTH = 68;
|
|
34
|
+
function hLine(left, right) {
|
|
35
|
+
return left + HORIZ.repeat(INNER_WIDTH) + right;
|
|
36
|
+
}
|
|
37
|
+
function padLine(content, rawLen) {
|
|
38
|
+
const padding = Math.max(0, INNER_WIDTH - 2 - rawLen);
|
|
39
|
+
return GRAY(VERT) + ' ' + content + ' '.repeat(padding) + ' ' + GRAY(VERT);
|
|
40
|
+
}
|
|
41
|
+
function emptyLine() {
|
|
42
|
+
return padLine('', 0);
|
|
43
|
+
}
|
|
44
|
+
function renderProgressBar(filled, total, barWidth) {
|
|
45
|
+
if (total === 0)
|
|
46
|
+
return DIM('░'.repeat(barWidth));
|
|
47
|
+
const filledCount = Math.min(barWidth, Math.round((filled / total) * barWidth));
|
|
48
|
+
const emptyCount = barWidth - filledCount;
|
|
49
|
+
return GOLD('█'.repeat(filledCount)) + DIM('░'.repeat(emptyCount));
|
|
50
|
+
}
|
|
51
|
+
function aggregateByRepo(data) {
|
|
52
|
+
const map = new Map();
|
|
53
|
+
for (const session of data.sessions) {
|
|
54
|
+
for (const wb of session.work_blocks) {
|
|
55
|
+
const name = wb.canonical_repo_name || 'unknown';
|
|
56
|
+
const existing = map.get(name);
|
|
57
|
+
if (existing) {
|
|
58
|
+
existing.minutes += wb.auto_minutes;
|
|
59
|
+
existing.linesAdded += wb.lines_added;
|
|
60
|
+
existing.linesDeleted += wb.lines_deleted;
|
|
61
|
+
existing.ticks += wb.tick_count;
|
|
62
|
+
existing.tokensTotal += wb.tokens_input + wb.tokens_output;
|
|
63
|
+
}
|
|
64
|
+
else {
|
|
65
|
+
map.set(name, {
|
|
66
|
+
name,
|
|
67
|
+
minutes: wb.auto_minutes,
|
|
68
|
+
linesAdded: wb.lines_added,
|
|
69
|
+
linesDeleted: wb.lines_deleted,
|
|
70
|
+
ticks: wb.tick_count,
|
|
71
|
+
tokensTotal: wb.tokens_input + wb.tokens_output,
|
|
72
|
+
});
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
return [...map.values()].sort((a, b) => b.minutes - a.minutes);
|
|
77
|
+
}
|
|
78
|
+
function formatMinutes(mins) {
|
|
79
|
+
if (mins < 1)
|
|
80
|
+
return '<1m';
|
|
81
|
+
if (mins < 60)
|
|
82
|
+
return `${Math.round(mins)}m`;
|
|
83
|
+
const h = Math.floor(mins / 60);
|
|
84
|
+
const m = Math.round(mins % 60);
|
|
85
|
+
return m > 0 ? `${h}h ${m}m` : `${h}h`;
|
|
86
|
+
}
|
|
87
|
+
function formatTokens(count) {
|
|
88
|
+
if (count < 1000)
|
|
89
|
+
return String(count);
|
|
90
|
+
if (count < 1000000)
|
|
91
|
+
return `${(count / 1000).toFixed(1)}k`;
|
|
92
|
+
return `${(count / 1000000).toFixed(1)}M`;
|
|
93
|
+
}
|
|
94
|
+
function truncate(str, maxLen) {
|
|
95
|
+
return str.length > maxLen ? str.slice(0, maxLen - 1) + '…' : str;
|
|
96
|
+
}
|
|
97
|
+
/** Get the short repo name (last segment of owner/repo) */
|
|
98
|
+
function shortRepoName(canonical) {
|
|
99
|
+
if (!canonical)
|
|
100
|
+
return 'unknown';
|
|
101
|
+
const parts = canonical.split('/');
|
|
102
|
+
return parts[parts.length - 1] || canonical;
|
|
103
|
+
}
|
|
104
|
+
/**
|
|
105
|
+
* Find the most relevant current work block:
|
|
106
|
+
* - Prefer active blocks (session is_active + block has no ended_at equivalent)
|
|
107
|
+
* - Fall back to the most recent block by effective_ended_at
|
|
108
|
+
*/
|
|
109
|
+
function findCurrentBlock(data) {
|
|
110
|
+
let best = null;
|
|
111
|
+
let bestTime = '';
|
|
112
|
+
for (const session of data.sessions) {
|
|
113
|
+
for (const wb of session.work_blocks) {
|
|
114
|
+
// Prefer blocks in active sessions, with most recent activity
|
|
115
|
+
if (session.is_active && (!best || wb.effective_ended_at > bestTime)) {
|
|
116
|
+
best = wb;
|
|
117
|
+
bestTime = wb.effective_ended_at;
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
// Fallback: most recent block across all sessions
|
|
122
|
+
if (!best) {
|
|
123
|
+
for (const session of data.sessions) {
|
|
124
|
+
for (const wb of session.work_blocks) {
|
|
125
|
+
if (!best || wb.effective_ended_at > bestTime) {
|
|
126
|
+
best = wb;
|
|
127
|
+
bestTime = wb.effective_ended_at;
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
return best;
|
|
133
|
+
}
|
|
134
|
+
function aggregateTotals(data) {
|
|
135
|
+
let totalLinesAdded = 0;
|
|
136
|
+
let totalLinesDeleted = 0;
|
|
137
|
+
let totalTokens = 0;
|
|
138
|
+
let totalTicks = 0;
|
|
139
|
+
let codingMinutes = 0;
|
|
140
|
+
for (const session of data.sessions) {
|
|
141
|
+
totalTicks += session.tick_count;
|
|
142
|
+
for (const wb of session.work_blocks) {
|
|
143
|
+
totalLinesAdded += wb.lines_added;
|
|
144
|
+
totalLinesDeleted += wb.lines_deleted;
|
|
145
|
+
totalTokens += wb.tokens_input + wb.tokens_output;
|
|
146
|
+
if (wb.work_signature && wb.work_signature.write_count > 0) {
|
|
147
|
+
codingMinutes += wb.auto_minutes;
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
return { totalLinesAdded, totalLinesDeleted, totalTokens, totalTicks, codingMinutes };
|
|
152
|
+
}
|
|
153
|
+
// ─── Compact Summary (default) ───────────────────────────────────
|
|
154
|
+
function buildCompactSummary(data) {
|
|
155
|
+
const totalMinutes = data.tracked_minutes_today;
|
|
156
|
+
const isActive = data.sessions.some(s => s.is_active);
|
|
157
|
+
const repos = aggregateByRepo(data);
|
|
158
|
+
const repoCount = repos.length;
|
|
159
|
+
const sessionCount = data.sessions.length;
|
|
160
|
+
const totals = aggregateTotals(data);
|
|
161
|
+
const block = findCurrentBlock(data);
|
|
162
|
+
// Use a fixed box width that fits most terminals
|
|
163
|
+
const boxWidth = 68;
|
|
164
|
+
const innerWidth = boxWidth - 2; // minus left/right borders
|
|
165
|
+
if (!block && totalMinutes === 0) {
|
|
166
|
+
const lines = [
|
|
167
|
+
GRAY(TOP_LEFT + HORIZ.repeat(innerWidth) + TOP_RIGHT),
|
|
168
|
+
GRAY(VERT) + ' ' + GOLD('◉') + GRAY(' No activity recorded today') + ' '.repeat(innerWidth - 28) + GRAY(VERT),
|
|
169
|
+
GRAY(BOT_LEFT + HORIZ.repeat(innerWidth) + BOT_RIGHT),
|
|
170
|
+
];
|
|
171
|
+
return lines.join('\n');
|
|
172
|
+
}
|
|
173
|
+
// Build the content for line 1: repo + bar + time + status
|
|
174
|
+
const repoName = shortRepoName(block?.canonical_repo_name ?? null);
|
|
175
|
+
const blockMins = block?.auto_minutes ?? 0;
|
|
176
|
+
const timeStr = formatMinutes(blockMins);
|
|
177
|
+
const statusText = isActive ? 'Tracking' : 'Idle';
|
|
178
|
+
const statusDot = isActive ? GREEN('●') : GRAY('○');
|
|
179
|
+
const nameDisplay = truncate(repoName, 20);
|
|
180
|
+
// Calculate bar width to fill remaining space
|
|
181
|
+
// Layout: " ◉ name bar time ● Status "
|
|
182
|
+
const fixedChars = 1 + 2 + nameDisplay.length + 2 + 2 + timeStr.length + 2 + 2 + statusText.length + 1;
|
|
183
|
+
const barWidth = Math.max(6, innerWidth - fixedChars);
|
|
184
|
+
const bar = renderProgressBar(blockMins, totalMinutes, barWidth);
|
|
185
|
+
// Build line 2 parts (plain text, measured accurately)
|
|
186
|
+
const linesStr = (totals.totalLinesAdded || totals.totalLinesDeleted)
|
|
187
|
+
? `+${formatTokens(totals.totalLinesAdded)}/-${formatTokens(totals.totalLinesDeleted)}`
|
|
188
|
+
: '';
|
|
189
|
+
const workBlockCount = data.sessions.reduce((sum, s) => sum + s.work_blocks.length, 0);
|
|
190
|
+
const totalParts = [
|
|
191
|
+
formatMinutes(totalMinutes),
|
|
192
|
+
`${repoCount} repo${repoCount !== 1 ? 's' : ''}`,
|
|
193
|
+
`${workBlockCount} block${workBlockCount !== 1 ? 's' : ''}`,
|
|
194
|
+
];
|
|
195
|
+
if (linesStr)
|
|
196
|
+
totalParts.push(linesStr);
|
|
197
|
+
totalParts.push(`${formatTokens(totals.totalTokens)} tok`);
|
|
198
|
+
const totalsPlain = 'Today: ' + totalParts.join(' \u00b7 ');
|
|
199
|
+
const expandHint = '\u25BC \u2325O';
|
|
200
|
+
// Truncate totals if it would overflow the box (leave room for expand hint)
|
|
201
|
+
const hintLen = expandHint.length + 2; // 2 gap before hint
|
|
202
|
+
const maxTotalsLen = innerWidth - 4 - hintLen; // 2 left pad + 2 right pad + hint
|
|
203
|
+
const truncatedTotals = totalsPlain.length > maxTotalsLen
|
|
204
|
+
? totalsPlain.slice(0, maxTotalsLen - 1) + '\u2026'
|
|
205
|
+
: totalsPlain;
|
|
206
|
+
// Measure display widths and build padded lines
|
|
207
|
+
// innerWidth = characters between the two │ borders
|
|
208
|
+
// Each line needs 1 char left pad + content + right pad to fill innerWidth
|
|
209
|
+
// Line 1 plain: " ◉ name ████░░░ time ● Status"
|
|
210
|
+
const line1Plain = ` \u25C9 ${nameDisplay} ${'X'.repeat(barWidth)} ${timeStr} \u25CF ${statusText}`;
|
|
211
|
+
const line1Cols = line1Plain.length;
|
|
212
|
+
const line1Pad = Math.max(1, innerWidth - line1Cols);
|
|
213
|
+
// Line 2 plain: " Today: 1h 3m · 2 repos · ... ▼ ⌥O"
|
|
214
|
+
const line2LeftPlain = ` ${truncatedTotals}`;
|
|
215
|
+
const line2Plain = line2LeftPlain + expandHint;
|
|
216
|
+
const line2Pad = 1; // right border pad
|
|
217
|
+
const line2Gap = Math.max(2, innerWidth - line2LeftPlain.length - expandHint.length - line2Pad);
|
|
218
|
+
// Render box
|
|
219
|
+
const lines = [
|
|
220
|
+
GRAY(TOP_LEFT + HORIZ.repeat(innerWidth) + TOP_RIGHT),
|
|
221
|
+
GRAY(VERT) +
|
|
222
|
+
' ' + GOLD('\u25C9') + ' ' + WHITE(nameDisplay) + ' ' + bar + ' ' + CYAN(timeStr) + ' ' + statusDot + ' ' + (isActive ? GREEN(statusText) : GRAY(statusText)) +
|
|
223
|
+
' '.repeat(line1Pad) + GRAY(VERT),
|
|
224
|
+
GRAY(VERT) +
|
|
225
|
+
' ' + GRAY(truncatedTotals) +
|
|
226
|
+
' '.repeat(line2Gap) + DIM(expandHint) +
|
|
227
|
+
' '.repeat(line2Pad) + GRAY(VERT),
|
|
228
|
+
];
|
|
229
|
+
return lines.join('\n');
|
|
230
|
+
}
|
|
231
|
+
function renderCompactSummary(data) {
|
|
232
|
+
console.log(buildCompactSummary(data));
|
|
233
|
+
}
|
|
234
|
+
// ─── Full Dashboard (--full flag) ────────────────────────────────
|
|
235
|
+
function buildFullDashboard(data) {
|
|
236
|
+
const repos = aggregateByRepo(data);
|
|
237
|
+
const totalMinutes = data.tracked_minutes_today;
|
|
238
|
+
const sessionCount = data.sessions.length;
|
|
239
|
+
const isActive = data.sessions.some(s => s.is_active);
|
|
240
|
+
const totals = aggregateTotals(data);
|
|
241
|
+
const lines = [];
|
|
242
|
+
// Top border
|
|
243
|
+
lines.push(GRAY(hLine(TOP_LEFT, TOP_RIGHT)));
|
|
244
|
+
// Header
|
|
245
|
+
const statusDot = isActive ? GREEN('●') + ' Tracking' : GRAY('○') + ' Idle';
|
|
246
|
+
const headerLeft = GOLD('◉') + ' ' + GOLD('DevClocked');
|
|
247
|
+
const headerLeftRaw = 12;
|
|
248
|
+
const statusRaw = isActive ? 10 : 6;
|
|
249
|
+
const gap = INNER_WIDTH - 2 - headerLeftRaw - statusRaw;
|
|
250
|
+
lines.push(GRAY(VERT) + ' ' + headerLeft + ' '.repeat(Math.max(1, gap)) + statusDot + ' ' + GRAY(VERT));
|
|
251
|
+
// Divider
|
|
252
|
+
lines.push(GRAY(hLine(TEE_LEFT, TEE_RIGHT)));
|
|
253
|
+
lines.push(emptyLine());
|
|
254
|
+
// Summary line
|
|
255
|
+
const sessionTime = formatMinutes(totalMinutes);
|
|
256
|
+
const codingTime = formatMinutes(totals.codingMinutes);
|
|
257
|
+
const linesChanged = totals.totalLinesAdded || totals.totalLinesDeleted
|
|
258
|
+
? `${GREEN('+' + totals.totalLinesAdded)} / ${chalk_1.default.red('-' + totals.totalLinesDeleted)}`
|
|
259
|
+
: GRAY('no changes');
|
|
260
|
+
const summaryText = `⏱ ${WHITE(sessionTime)} session ${WHITE(codingTime)} coding ${linesChanged}`;
|
|
261
|
+
const summaryRaw = `⏱ ${sessionTime} session ${codingTime} coding +${totals.totalLinesAdded} / -${totals.totalLinesDeleted}`.length;
|
|
262
|
+
lines.push(padLine(summaryText, summaryRaw));
|
|
263
|
+
lines.push(emptyLine());
|
|
264
|
+
// Repo breakdown
|
|
265
|
+
if (repos.length > 0) {
|
|
266
|
+
const maxMinutes = repos[0].minutes;
|
|
267
|
+
const BAR_WIDTH = 28;
|
|
268
|
+
const NAME_WIDTH = 26;
|
|
269
|
+
for (const repo of repos.slice(0, 6)) {
|
|
270
|
+
const name = truncate(repo.name, NAME_WIDTH);
|
|
271
|
+
const bar = renderProgressBar(repo.minutes, maxMinutes, BAR_WIDTH);
|
|
272
|
+
const time = formatMinutes(repo.minutes);
|
|
273
|
+
const namePadded = name + ' '.repeat(Math.max(0, NAME_WIDTH - name.length));
|
|
274
|
+
const timeStr = time.padStart(6);
|
|
275
|
+
const lineText = `${WHITE(namePadded)} ${bar} ${CYAN(timeStr)}`;
|
|
276
|
+
const rawLen = NAME_WIDTH + 1 + BAR_WIDTH + 1 + 6;
|
|
277
|
+
lines.push(padLine(lineText, rawLen));
|
|
278
|
+
}
|
|
279
|
+
}
|
|
280
|
+
else {
|
|
281
|
+
lines.push(padLine(GRAY('No activity recorded'), 20));
|
|
282
|
+
}
|
|
283
|
+
lines.push(emptyLine());
|
|
284
|
+
// Footer
|
|
285
|
+
const ticksStr = `Ticks ${WHITE(String(totals.totalTicks))}`;
|
|
286
|
+
const tokensStr = `Tokens ${WHITE(formatTokens(totals.totalTokens))}`;
|
|
287
|
+
const sessionsStr = `Sessions ${WHITE(String(sessionCount))}`;
|
|
288
|
+
const footerText = `${GRAY(ticksStr)} ${GRAY(tokensStr)} ${GRAY(sessionsStr)}`;
|
|
289
|
+
const footerRaw = `Ticks ${totals.totalTicks} Tokens ${formatTokens(totals.totalTokens)} Sessions ${sessionCount}`.length;
|
|
290
|
+
lines.push(padLine(footerText, footerRaw));
|
|
291
|
+
lines.push(GRAY(hLine(BOT_LEFT, BOT_RIGHT)));
|
|
292
|
+
return '\n' + lines.map(l => ' ' + l).join('\n') + '\n';
|
|
293
|
+
}
|
|
294
|
+
function renderFullDashboard(data) {
|
|
295
|
+
console.log(buildFullDashboard(data));
|
|
296
|
+
}
|
|
297
|
+
function buildPlainWeeklySummary(days) {
|
|
298
|
+
const lines = ['Weekly Summary (7 days)', ''];
|
|
299
|
+
let totalMinutes = 0;
|
|
300
|
+
let totalSessions = 0;
|
|
301
|
+
let totalLinesAdded = 0;
|
|
302
|
+
let totalLinesDeleted = 0;
|
|
303
|
+
for (const { date, data } of days) {
|
|
304
|
+
const d = new Date(date + 'T12:00:00'); // noon to avoid TZ issues
|
|
305
|
+
const dayLabel = d.toLocaleDateString('en-US', { weekday: 'short', month: 'numeric', day: 'numeric' });
|
|
306
|
+
const mins = data.tracked_minutes_today ?? 0;
|
|
307
|
+
const sessions = data.sessions?.length ?? 0;
|
|
308
|
+
let linesAdded = 0;
|
|
309
|
+
let linesDeleted = 0;
|
|
310
|
+
if (data.sessions) {
|
|
311
|
+
for (const s of data.sessions) {
|
|
312
|
+
for (const wb of s.work_blocks) {
|
|
313
|
+
linesAdded += wb.lines_added;
|
|
314
|
+
linesDeleted += wb.lines_deleted;
|
|
315
|
+
}
|
|
316
|
+
}
|
|
317
|
+
}
|
|
318
|
+
totalMinutes += mins;
|
|
319
|
+
totalSessions += sessions;
|
|
320
|
+
totalLinesAdded += linesAdded;
|
|
321
|
+
totalLinesDeleted += linesDeleted;
|
|
322
|
+
if (mins === 0 && sessions === 0) {
|
|
323
|
+
lines.push(`${dayLabel}: —`);
|
|
324
|
+
continue;
|
|
325
|
+
}
|
|
326
|
+
const parts = [formatMinutes(mins), `${sessions} session${sessions !== 1 ? 's' : ''}`];
|
|
327
|
+
if (linesAdded > 0 || linesDeleted > 0) {
|
|
328
|
+
parts.push(`+${linesAdded.toLocaleString()}/-${linesDeleted.toLocaleString()} lines`);
|
|
329
|
+
}
|
|
330
|
+
lines.push(`${dayLabel}: ${parts.join(' | ')}`);
|
|
331
|
+
}
|
|
332
|
+
lines.push('');
|
|
333
|
+
const totalParts = [formatMinutes(totalMinutes), `${totalSessions} sessions`];
|
|
334
|
+
if (totalLinesAdded > 0 || totalLinesDeleted > 0) {
|
|
335
|
+
totalParts.push(`+${totalLinesAdded.toLocaleString()}/-${totalLinesDeleted.toLocaleString()} lines`);
|
|
336
|
+
}
|
|
337
|
+
lines.push(`Total: ${totalParts.join(' | ')}`);
|
|
338
|
+
return lines.join('\n');
|
|
339
|
+
}
|
|
340
|
+
// ─── Plain-text Summary (for MCP / AI tools) ────────────────────
|
|
341
|
+
function buildPlainSummary(data) {
|
|
342
|
+
const totalMinutes = data.tracked_minutes_today;
|
|
343
|
+
const isActive = data.sessions.some(s => s.is_active);
|
|
344
|
+
const repos = aggregateByRepo(data);
|
|
345
|
+
const totals = aggregateTotals(data);
|
|
346
|
+
const block = findCurrentBlock(data);
|
|
347
|
+
const workBlockCount = data.sessions.reduce((sum, s) => sum + s.work_blocks.length, 0);
|
|
348
|
+
if (!block && totalMinutes === 0) {
|
|
349
|
+
return 'No coding activity recorded today.';
|
|
350
|
+
}
|
|
351
|
+
const lines = [];
|
|
352
|
+
// Status line
|
|
353
|
+
const status = isActive ? 'Tracking' : 'Idle';
|
|
354
|
+
lines.push(`Status: ${status} | Today: ${formatMinutes(totalMinutes)}`);
|
|
355
|
+
// Current block
|
|
356
|
+
if (block) {
|
|
357
|
+
const name = block.canonical_repo_name || 'unknown';
|
|
358
|
+
lines.push(`Current: ${name} (${formatMinutes(block.auto_minutes)})`);
|
|
359
|
+
}
|
|
360
|
+
// Stats
|
|
361
|
+
const stats = [
|
|
362
|
+
`${repos.length} repo${repos.length !== 1 ? 's' : ''}`,
|
|
363
|
+
`${workBlockCount} work block${workBlockCount !== 1 ? 's' : ''}`,
|
|
364
|
+
`${data.sessions.length} session${data.sessions.length !== 1 ? 's' : ''}`,
|
|
365
|
+
];
|
|
366
|
+
if (totals.totalLinesAdded || totals.totalLinesDeleted) {
|
|
367
|
+
stats.push(`+${totals.totalLinesAdded}/-${totals.totalLinesDeleted} lines`);
|
|
368
|
+
}
|
|
369
|
+
if (totals.totalTokens > 0) {
|
|
370
|
+
stats.push(`${formatTokens(totals.totalTokens)} tokens`);
|
|
371
|
+
}
|
|
372
|
+
lines.push(stats.join(' · '));
|
|
373
|
+
// Per-repo breakdown
|
|
374
|
+
if (repos.length > 1) {
|
|
375
|
+
lines.push('');
|
|
376
|
+
lines.push('Repos:');
|
|
377
|
+
for (const repo of repos.slice(0, 6)) {
|
|
378
|
+
lines.push(` ${repo.name}: ${formatMinutes(repo.minutes)}`);
|
|
379
|
+
}
|
|
380
|
+
}
|
|
381
|
+
return lines.join('\n');
|
|
382
|
+
}
|
|
383
|
+
//# sourceMappingURL=dashboard.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dashboard.js","sourceRoot":"","sources":["../../src/branding/dashboard.ts"],"names":[],"mappings":";AAAA;;GAEG;;;;;AAqCH,8CAKC;AAWD,0CA2BC;AAqFD,kDAsFC;AAED,oDAEC;AAID,gDAoEC;AAED,kDAEC;AASD,0DAmDC;AAID,8CAgDC;AAzbD,kDAA0B;AAG1B,MAAM,IAAI,GAAG,eAAK,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC;AAClC,MAAM,GAAG,GAAG,eAAK,CAAC,GAAG,CAAC;AACtB,MAAM,KAAK,GAAG,eAAK,CAAC,KAAK,CAAC;AAC1B,MAAM,IAAI,GAAG,eAAK,CAAC,IAAI,CAAC;AACxB,MAAM,KAAK,GAAG,eAAK,CAAC,KAAK,CAAC;AAC1B,MAAM,IAAI,GAAG,eAAK,CAAC,IAAI,CAAC;AAExB,+CAA+C;AAC/C,MAAM,QAAQ,GAAG,GAAG,CAAC;AACrB,MAAM,SAAS,GAAG,GAAG,CAAC;AACtB,MAAM,QAAQ,GAAG,GAAG,CAAC;AACrB,MAAM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AAC,IAAI,CAAC,IAAI,MAAM,CAAC,eAAe,KAAK,MAAM,CAAC,iBAAiB,QAAQ,CAAC,CAAC;IAC9E,CAAC;IACD,IAAI,MAAM,CAAC,WAAW,GAAG,CAAC,EAAE,CAAC;QAC3B,KAAK,CAAC,IAAI,CAAC,GAAG,YAAY,CAAC,MAAM,CAAC,WAAW,CAAC,SAAS,CAAC,CAAC;IAC3D,CAAC;IACD,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC;IAE9B,qBAAqB;IACrB,IAAI,KAAK,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QACrB,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;QACf,KAAK,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;QACrB,KAAK,MAAM,IAAI,IAAI,KAAK,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC;YACrC,KAAK,CAAC,IAAI,CAAC,KAAK,IAAI,CAAC,IAAI,KAAK,aAAa,CAAC,IAAI,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC;QAC/D,CAAC;IACH,CAAC;IAED,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AAC1B,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mcp-health.d.ts","sourceRoot":"","sources":["../../src/commands/mcp-health.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAMpC,eAAO,MAAM,gBAAgB,SA8DzB,CAAC"}
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* MCP Health Check — validates auth, Supabase connectivity, and tool formatting.
|
|
4
|
+
*
|
|
5
|
+
* Usage: devclocked mcp-health
|
|
6
|
+
*/
|
|
7
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8
|
+
exports.mcpHealthCommand = void 0;
|
|
9
|
+
const commander_1 = require("commander");
|
|
10
|
+
const mcp_utils_1 = require("../mcp-utils");
|
|
11
|
+
const dashboard_1 = require("../branding/dashboard");
|
|
12
|
+
const mcp_server_1 = require("./mcp-server");
|
|
13
|
+
exports.mcpHealthCommand = new commander_1.Command('mcp-health')
|
|
14
|
+
.description('Run health checks for MCP server connectivity and tools')
|
|
15
|
+
.action(async () => {
|
|
16
|
+
let failures = 0;
|
|
17
|
+
// 1. Validate auth
|
|
18
|
+
let auth;
|
|
19
|
+
try {
|
|
20
|
+
auth = (0, mcp_utils_1.getAuth)();
|
|
21
|
+
console.log(`✓ Auth OK (${auth.email})`);
|
|
22
|
+
}
|
|
23
|
+
catch (err) {
|
|
24
|
+
const msg = err instanceof Error ? err.message : String(err);
|
|
25
|
+
console.log(`✗ Auth FAILED: ${msg}`);
|
|
26
|
+
process.exit(1);
|
|
27
|
+
}
|
|
28
|
+
// 2. Ping Supabase
|
|
29
|
+
let todayData;
|
|
30
|
+
try {
|
|
31
|
+
const tz = Intl.DateTimeFormat().resolvedOptions().timeZone;
|
|
32
|
+
todayData = await (0, mcp_utils_1.callEdgeFunction)(auth, 'get-today-activity', {
|
|
33
|
+
method: 'GET',
|
|
34
|
+
queryParams: { tz },
|
|
35
|
+
});
|
|
36
|
+
console.log('✓ Supabase reachable');
|
|
37
|
+
}
|
|
38
|
+
catch (err) {
|
|
39
|
+
const msg = err instanceof Error ? err.message : String(err);
|
|
40
|
+
console.log(`✗ Supabase FAILED: ${msg}`);
|
|
41
|
+
process.exit(1);
|
|
42
|
+
}
|
|
43
|
+
// 3. Test get_summary formatting
|
|
44
|
+
try {
|
|
45
|
+
const summary = (0, dashboard_1.buildPlainSummary)(todayData);
|
|
46
|
+
if (typeof summary !== 'string' || summary.length === 0) {
|
|
47
|
+
throw new Error('Empty summary output');
|
|
48
|
+
}
|
|
49
|
+
console.log('✓ get_summary OK');
|
|
50
|
+
}
|
|
51
|
+
catch (err) {
|
|
52
|
+
const msg = err instanceof Error ? err.message : String(err);
|
|
53
|
+
console.log(`✗ get_summary FAILED: ${msg}`);
|
|
54
|
+
failures++;
|
|
55
|
+
}
|
|
56
|
+
// 4. Test get_weekly_summary formatting
|
|
57
|
+
try {
|
|
58
|
+
const tz = Intl.DateTimeFormat().resolvedOptions().timeZone;
|
|
59
|
+
const days = await (0, mcp_server_1.fetchWeeklyData)(auth, tz);
|
|
60
|
+
const weekly = (0, dashboard_1.buildPlainWeeklySummary)(days);
|
|
61
|
+
if (typeof weekly !== 'string' || weekly.length === 0) {
|
|
62
|
+
throw new Error('Empty weekly summary output');
|
|
63
|
+
}
|
|
64
|
+
console.log('✓ get_weekly_summary OK');
|
|
65
|
+
}
|
|
66
|
+
catch (err) {
|
|
67
|
+
const msg = err instanceof Error ? err.message : String(err);
|
|
68
|
+
console.log(`✗ get_weekly_summary FAILED: ${msg}`);
|
|
69
|
+
failures++;
|
|
70
|
+
}
|
|
71
|
+
if (failures > 0) {
|
|
72
|
+
process.exit(1);
|
|
73
|
+
}
|
|
74
|
+
});
|
|
75
|
+
//# sourceMappingURL=mcp-health.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mcp-health.js","sourceRoot":"","sources":["../../src/commands/mcp-health.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;;AAEH,yCAAoC;AACpC,4CAAyD;AACzD,qDAAmF;AACnF,6CAA+C;AAGlC,QAAA,gBAAgB,GAAG,IAAI,mBAAO,CAAC,YAAY,CAAC;KACtD,WAAW,CAAC,yDAAyD,CAAC;KACtE,MAAM,CAAC,KAAK,IAAI,EAAE;IACjB,IAAI,QAAQ,GAAG,CAAC,CAAC;IAEjB,mBAAmB;IACnB,IAAI,IAAI,CAAC;IACT,IAAI,CAAC;QACH,IAAI,GAAG,IAAA,mBAAO,GAAE,CAAC;QACjB,OAAO,CAAC,GAAG,CAAC,cAAc,IAAI,CAAC,KAAK,GAAG,CAAC,CAAC;I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|
4
|
+
*
|
|
5
|
+
* Usage in Claude Code settings:
|
|
6
|
+
* { "command": "devclocked", "args": ["mcp-server"] }
|
|
7
|
+
* Or via npx:
|
|
8
|
+
* { "command": "npx", "args": ["-y", "@devclocked/cli", "mcp-server"] }
|
|
9
|
+
*/
|
|
10
|
+
import { Command } from 'commander';
|
|
11
|
+
import { WeeklyDayEntry } from '../branding/dashboard';
|
|
12
|
+
import { McpAuth } from '../mcp-utils';
|
|
13
|
+
export declare function fetchWeeklyData(auth: McpAuth, timezone: string): Promise<WeeklyDayEntry[]>;
|
|
14
|
+
export declare const TOOL_DEFINITIONS: ({
|
|
15
|
+
name: string;
|
|
16
|
+
category: string;
|
|
17
|
+
returns: string;
|
|
18
|
+
stability: string;
|
|
19
|
+
description: string;
|
|
20
|
+
inputSchema: {
|
|
21
|
+
type: "object";
|
|
22
|
+
properties: {
|
|
23
|
+
date: {
|
|
24
|
+
type: string;
|
|
25
|
+
description: string;
|
|
26
|
+
};
|
|
27
|
+
tz: {
|
|
28
|
+
type: string;
|
|
29
|
+
description: string;
|
|
30
|
+
};
|
|
31
|
+
};
|
|
32
|
+
};
|
|
33
|
+
} | {
|
|
34
|
+
name: string;
|
|
35
|
+
category: string;
|
|
36
|
+
returns: string;
|
|
37
|
+
stability: string;
|
|
38
|
+
description: string;
|
|
39
|
+
inputSchema: {
|
|
40
|
+
type: "object";
|
|
41
|
+
properties: {
|
|
42
|
+
date?: undefined;
|
|
43
|
+
tz?: undefined;
|
|
44
|
+
};
|
|
45
|
+
};
|
|
46
|
+
} | {
|
|
47
|
+
name: string;
|
|
48
|
+
category: string;
|
|
49
|
+
returns: string;
|
|
50
|
+
stability: string;
|
|
51
|
+
description: string;
|
|
52
|
+
inputSchema: {
|
|
53
|
+
type: "object";
|
|
54
|
+
properties: {
|
|
55
|
+
tz: {
|
|
56
|
+
type: string;
|
|
57
|
+
description: string;
|
|
58
|
+
};
|
|
59
|
+
date?: undefined;
|
|
60
|
+
};
|
|
61
|
+
};
|
|
62
|
+
})[];
|
|
63
|
+
export declare const mcpServerCommand: Command;
|
|
64
|
+
export declare const mcpListToolsCommand: Command;
|
|
65
|
+
//# sourceMappingURL=mcp-server.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mcp-server.d.ts","sourceRoot":"","sources":["../../src/commands/mcp-server.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAA8C,cAAc,EAAE,MAAM,uBAAuB,CAAC;AACnG,OAAO,EAA6B,OAAO,EAAE,MAAM,cAAc,CAAC;AAIlE,wBAAsB,eAAe,CAAC,IAAI,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,cAAc,EAAE,CAAC,CAoBhG;AAqHD,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAmF5B,CAAC;AAEF,eAAO,MAAM,gBAAgB,SAOzB,CAAC;AAEL,eAAO,MAAM,mBAAmB,SA0B5B,CAAC"}
|
|
@@ -0,0 +1,280 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* MCP Server subcommand — exposes DevClocked data to AI tools
|
|
4
|
+
* via Model Context Protocol (stdin/stdout).
|
|
5
|
+
*
|
|
6
|
+
* Usage in Claude Code settings:
|
|
7
|
+
* { "command": "devclocked", "args": ["mcp-server"] }
|
|
8
|
+
* Or via npx:
|
|
9
|
+
* { "command": "npx", "args": ["-y", "@devclocked/cli", "mcp-server"] }
|
|
10
|
+
*/
|
|
11
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
12
|
+
if (k2 === undefined) k2 = k;
|
|
13
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
14
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
15
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
16
|
+
}
|
|
17
|
+
Object.defineProperty(o, k2, desc);
|
|
18
|
+
}) : (function(o, m, k, k2) {
|
|
19
|
+
if (k2 === undefined) k2 = k;
|
|
20
|
+
o[k2] = m[k];
|
|
21
|
+
}));
|
|
22
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
23
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
24
|
+
}) : function(o, v) {
|
|
25
|
+
o["default"] = v;
|
|
26
|
+
});
|
|
27
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
28
|
+
var ownKeys = function(o) {
|
|
29
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
30
|
+
var ar = [];
|
|
31
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
32
|
+
return ar;
|
|
33
|
+
};
|
|
34
|
+
return ownKeys(o);
|
|
35
|
+
};
|
|
36
|
+
return function (mod) {
|
|
37
|
+
if (mod && mod.__esModule) return mod;
|
|
38
|
+
var result = {};
|
|
39
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
40
|
+
__setModuleDefault(result, mod);
|
|
41
|
+
return result;
|
|
42
|
+
};
|
|
43
|
+
})();
|
|
44
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
45
|
+
exports.mcpListToolsCommand = exports.mcpServerCommand = exports.TOOL_DEFINITIONS = void 0;
|
|
46
|
+
exports.fetchWeeklyData = fetchWeeklyData;
|
|
47
|
+
const commander_1 = require("commander");
|
|
48
|
+
const dashboard_1 = require("../branding/dashboard");
|
|
49
|
+
const mcp_utils_1 = require("../mcp-utils");
|
|
50
|
+
// Helper to fetch 7 days of activity data
|
|
51
|
+
async function fetchWeeklyData(auth, timezone) {
|
|
52
|
+
const days = [];
|
|
53
|
+
for (let i = 0; i < 7; i++) {
|
|
54
|
+
const d = new Date();
|
|
55
|
+
d.setDate(d.getDate() - i);
|
|
56
|
+
const dateStr = d.toISOString().slice(0, 10);
|
|
57
|
+
try {
|
|
58
|
+
const data = await (0, mcp_utils_1.callEdgeFunction)(auth, 'get-today-activity', {
|
|
59
|
+
method: 'GET',
|
|
60
|
+
queryParams: { date: dateStr, tz: timezone },
|
|
61
|
+
});
|
|
62
|
+
days.push({ date: dateStr, data });
|
|
63
|
+
}
|
|
64
|
+
catch {
|
|
65
|
+
days.push({ date: dateStr, data: { tracked_minutes_today: 0, sessions: [], generated_at: new Date().toISOString() } });
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
return days;
|
|
69
|
+
}
|
|
70
|
+
// MCP Server
|
|
71
|
+
async function startMcpServer() {
|
|
72
|
+
// Validate auth before starting
|
|
73
|
+
let auth;
|
|
74
|
+
try {
|
|
75
|
+
auth = (0, mcp_utils_1.getAuth)();
|
|
76
|
+
}
|
|
77
|
+
catch (err) {
|
|
78
|
+
const msg = err instanceof Error ? err.message : String(err);
|
|
79
|
+
process.stderr.write(`DevClocked MCP: ${msg}\n`);
|
|
80
|
+
process.exit(1);
|
|
81
|
+
return; // unreachable but satisfies TS
|
|
82
|
+
}
|
|
83
|
+
// Dynamic import to avoid loading MCP SDK for other CLI commands
|
|
84
|
+
const { Server } = await Promise.resolve().then(() => __importStar(require('@modelcontextprotocol/sdk/server/index.js')));
|
|
85
|
+
const { StdioServerTransport } = await Promise.resolve().then(() => __importStar(require('@modelcontextprotocol/sdk/server/stdio.js')));
|
|
86
|
+
const { CallToolRequestSchema, ListToolsRequestSchema } = await Promise.resolve().then(() => __importStar(require('@modelcontextprotocol/sdk/types.js')));
|
|
87
|
+
const server = new Server({ name: 'devclocked', version: '1.0.0' }, { capabilities: { tools: {} } });
|
|
88
|
+
// List tools — only pass MCP-compatible fields
|
|
89
|
+
server.setRequestHandler(ListToolsRequestSchema, async () => ({
|
|
90
|
+
tools: exports.TOOL_DEFINITIONS.map(({ name, description, inputSchema }) => ({
|
|
91
|
+
name, description, inputSchema,
|
|
92
|
+
})),
|
|
93
|
+
}));
|
|
94
|
+
// Handle tool calls
|
|
95
|
+
server.setRequestHandler(CallToolRequestSchema, async (request) => {
|
|
96
|
+
const { name, arguments: args } = request.params;
|
|
97
|
+
try {
|
|
98
|
+
switch (name) {
|
|
99
|
+
case 'get_summary': {
|
|
100
|
+
const queryParams = {};
|
|
101
|
+
if (args?.date)
|
|
102
|
+
queryParams['date'] = String(args.date);
|
|
103
|
+
queryParams['tz'] =
|
|
104
|
+
args?.tz || Intl.DateTimeFormat().resolvedOptions().timeZone;
|
|
105
|
+
const data = await (0, mcp_utils_1.callEdgeFunction)(auth, 'get-today-activity', {
|
|
106
|
+
method: 'GET',
|
|
107
|
+
queryParams,
|
|
108
|
+
});
|
|
109
|
+
const summary = (0, dashboard_1.buildPlainSummary)(data);
|
|
110
|
+
return { content: [{ type: 'text', text: summary }] };
|
|
111
|
+
}
|
|
112
|
+
case 'get_today_activity': {
|
|
113
|
+
const queryParams = {};
|
|
114
|
+
if (args?.date)
|
|
115
|
+
queryParams['date'] = String(args.date);
|
|
116
|
+
queryParams['tz'] =
|
|
117
|
+
args?.tz || Intl.DateTimeFormat().resolvedOptions().timeZone;
|
|
118
|
+
const data = await (0, mcp_utils_1.callEdgeFunction)(auth, 'get-today-activity', {
|
|
119
|
+
method: 'GET',
|
|
120
|
+
queryParams,
|
|
121
|
+
});
|
|
122
|
+
return { content: [{ type: 'text', text: JSON.stringify(data, null, 2) }] };
|
|
123
|
+
}
|
|
124
|
+
case 'get_active_session': {
|
|
125
|
+
const data = await (0, mcp_utils_1.callEdgeFunction)(auth, 'get-active-session', {
|
|
126
|
+
method: 'POST',
|
|
127
|
+
body: {},
|
|
128
|
+
});
|
|
129
|
+
return { content: [{ type: 'text', text: JSON.stringify(data, null, 2) }] };
|
|
130
|
+
}
|
|
131
|
+
case 'get_weekly_summary': {
|
|
132
|
+
const timezone = args?.tz || Intl.DateTimeFormat().resolvedOptions().timeZone;
|
|
133
|
+
const days = await fetchWeeklyData(auth, timezone);
|
|
134
|
+
const summary = (0, dashboard_1.buildPlainWeeklySummary)(days);
|
|
135
|
+
return { content: [{ type: 'text', text: summary }] };
|
|
136
|
+
}
|
|
137
|
+
case 'get_weekly_summary_raw': {
|
|
138
|
+
const timezone = args?.tz || Intl.DateTimeFormat().resolvedOptions().timeZone;
|
|
139
|
+
const days = await fetchWeeklyData(auth, timezone);
|
|
140
|
+
return { content: [{ type: 'text', text: JSON.stringify({ days }, null, 2) }] };
|
|
141
|
+
}
|
|
142
|
+
case 'get_projects': {
|
|
143
|
+
const data = await (0, mcp_utils_1.callEdgeFunction)(auth, 'get-user-projects', {
|
|
144
|
+
method: 'POST',
|
|
145
|
+
body: { include_stats: true },
|
|
146
|
+
});
|
|
147
|
+
return { content: [{ type: 'text', text: JSON.stringify(data, null, 2) }] };
|
|
148
|
+
}
|
|
149
|
+
default:
|
|
150
|
+
return {
|
|
151
|
+
content: [{ type: 'text', text: `Unknown tool: ${name}` }],
|
|
152
|
+
isError: true,
|
|
153
|
+
};
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
catch (err) {
|
|
157
|
+
const msg = err instanceof Error ? err.message : String(err);
|
|
158
|
+
return {
|
|
159
|
+
content: [{ type: 'text', text: `DevClocked error: ${msg}` }],
|
|
160
|
+
isError: true,
|
|
161
|
+
};
|
|
162
|
+
}
|
|
163
|
+
});
|
|
164
|
+
const transport = new StdioServerTransport();
|
|
165
|
+
await server.connect(transport);
|
|
166
|
+
}
|
|
167
|
+
// Tool definitions (shared between server and list-tools command)
|
|
168
|
+
exports.TOOL_DEFINITIONS = [
|
|
169
|
+
{
|
|
170
|
+
name: 'get_summary',
|
|
171
|
+
category: 'activity',
|
|
172
|
+
returns: 'text',
|
|
173
|
+
stability: 'stable',
|
|
174
|
+
description: "Get a formatted summary of today's coding activity. Use this when the user asks how long they've been coding, what they've worked on today, or for a status update. Returns a concise human-readable summary.",
|
|
175
|
+
inputSchema: {
|
|
176
|
+
type: 'object',
|
|
177
|
+
properties: {
|
|
178
|
+
date: { type: 'string', description: 'Date in YYYY-MM-DD format (default: today)' },
|
|
179
|
+
tz: { type: 'string', description: 'IANA timezone (default: auto-detected)' },
|
|
180
|
+
},
|
|
181
|
+
},
|
|
182
|
+
},
|
|
183
|
+
{
|
|
184
|
+
name: 'get_today_activity',
|
|
185
|
+
category: 'activity',
|
|
186
|
+
returns: 'json',
|
|
187
|
+
stability: 'stable',
|
|
188
|
+
description: "Get raw JSON data for today's coding activity: sessions, work blocks, repos, lines changed, tokens used. Use get_summary instead for human-readable output.",
|
|
189
|
+
inputSchema: {
|
|
190
|
+
type: 'object',
|
|
191
|
+
properties: {
|
|
192
|
+
date: { type: 'string', description: 'Date in YYYY-MM-DD format (default: today)' },
|
|
193
|
+
tz: { type: 'string', description: 'IANA timezone (default: auto-detected)' },
|
|
194
|
+
},
|
|
195
|
+
},
|
|
196
|
+
},
|
|
197
|
+
{
|
|
198
|
+
name: 'get_active_session',
|
|
199
|
+
category: 'activity',
|
|
200
|
+
returns: 'json',
|
|
201
|
+
stability: 'stable',
|
|
202
|
+
description: 'Get the currently active tracking session, if any. Shows session duration, source, tick count.',
|
|
203
|
+
inputSchema: {
|
|
204
|
+
type: 'object',
|
|
205
|
+
properties: {},
|
|
206
|
+
},
|
|
207
|
+
},
|
|
208
|
+
{
|
|
209
|
+
name: 'get_weekly_summary',
|
|
210
|
+
category: 'activity',
|
|
211
|
+
returns: 'text',
|
|
212
|
+
stability: 'stable',
|
|
213
|
+
description: 'Get a summary of coding activity for the past 7 days. Returns daily breakdown with minutes, ticks, repos, and lines changed.',
|
|
214
|
+
inputSchema: {
|
|
215
|
+
type: 'object',
|
|
216
|
+
properties: {
|
|
217
|
+
tz: { type: 'string', description: 'IANA timezone (default: auto-detected)' },
|
|
218
|
+
},
|
|
219
|
+
},
|
|
220
|
+
},
|
|
221
|
+
{
|
|
222
|
+
name: 'get_weekly_summary_raw',
|
|
223
|
+
category: 'activity',
|
|
224
|
+
returns: 'json',
|
|
225
|
+
stability: 'beta',
|
|
226
|
+
description: 'Get raw JSON data for the past 7 days of coding activity. Warning: response can be very large. Prefer get_weekly_summary for a concise text overview.',
|
|
227
|
+
inputSchema: {
|
|
228
|
+
type: 'object',
|
|
229
|
+
properties: {
|
|
230
|
+
tz: { type: 'string', description: 'IANA timezone (default: auto-detected)' },
|
|
231
|
+
},
|
|
232
|
+
},
|
|
233
|
+
},
|
|
234
|
+
{
|
|
235
|
+
name: 'get_projects',
|
|
236
|
+
category: 'projects',
|
|
237
|
+
returns: 'json',
|
|
238
|
+
stability: 'stable',
|
|
239
|
+
description: "List the user's projects with stats (total hours, sessions, commits, active days).",
|
|
240
|
+
inputSchema: {
|
|
241
|
+
type: 'object',
|
|
242
|
+
properties: {},
|
|
243
|
+
},
|
|
244
|
+
},
|
|
245
|
+
];
|
|
246
|
+
exports.mcpServerCommand = new commander_1.Command('mcp-server')
|
|
247
|
+
.description('Start MCP server for AI tools (Claude Code, Cursor)')
|
|
248
|
+
.action(() => {
|
|
249
|
+
startMcpServer().catch((err) => {
|
|
250
|
+
process.stderr.write(`DevClocked MCP fatal: ${err}\n`);
|
|
251
|
+
process.exit(1);
|
|
252
|
+
});
|
|
253
|
+
});
|
|
254
|
+
exports.mcpListToolsCommand = new commander_1.Command('mcp-list-tools')
|
|
255
|
+
.description('List available MCP tools and their descriptions')
|
|
256
|
+
.option('--json', 'Output as JSON')
|
|
257
|
+
.action((opts) => {
|
|
258
|
+
if (opts.json) {
|
|
259
|
+
console.log(JSON.stringify(exports.TOOL_DEFINITIONS, null, 2));
|
|
260
|
+
return;
|
|
261
|
+
}
|
|
262
|
+
console.log('DevClocked MCP Tools\n');
|
|
263
|
+
for (const tool of exports.TOOL_DEFINITIONS) {
|
|
264
|
+
const meta = [tool.category, tool.returns, tool.stability].filter(Boolean).join(', ');
|
|
265
|
+
console.log(` ${tool.name}${meta ? ` [${meta}]` : ''}`);
|
|
266
|
+
console.log(` ${tool.description}`);
|
|
267
|
+
const params = Object.keys(tool.inputSchema.properties);
|
|
268
|
+
if (params.length > 0) {
|
|
269
|
+
const paramStr = params
|
|
270
|
+
.map((p) => {
|
|
271
|
+
const prop = tool.inputSchema.properties[p];
|
|
272
|
+
return `${p} — ${prop?.description || ''}`;
|
|
273
|
+
})
|
|
274
|
+
.join('; ');
|
|
275
|
+
console.log(` Params: ${paramStr}`);
|
|
276
|
+
}
|
|
277
|
+
console.log();
|
|
278
|
+
}
|
|
279
|
+
});
|
|
280
|
+
//# sourceMappingURL=mcp-server.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mcp-server.js","sourceRoot":"","sources":["../../src/commands/mcp-server.ts"],"names":[],"mappings":";AAAA;;;;;;;;GAQG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAQH,0CAoBC;AA1BD,yCAAoC;AACpC,qDAAmG;AACnG,4CAAkE;AAGlE,0CAA0C;AACnC,KAAK,UAAU,eAAe,CAAC,IAAa,EAAE,QAAgB;IACnE,MAAM,IAAI,GAAqB,EAAE,CAAC;IAElC,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;QAC3B,MAAM,CAAC,GAAG,IAAI,IAAI,EAAE,CAAC;QACrB,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,OAAO,EAAE,GAAG,CAAC,CAAC,CAAC;QAC3B,MAAM,OAAO,GAAG,CAAC,CAAC,WAAW,EAAE,CAAC,KAAK,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;QAE7C,IAAI,CAAC;YACH,MAAM,IAAI,GAAG,MAAM,IAAA,4BAAgB,EAAC,IAAI,EAAE,oBAAoB,EAAE;gBAC9D,MAAM,EAAE,KAAK;gBACb,WAAW,EAAE,EAAE,IAAI,EAAE,OAAO,EAAE,EAAE,EAAE,QAAQ,EAAE;aAC7C,C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AAC,eAAe,QAAQ,EAAE,CAAC,CAAC;QACzC,CAAC;QACD,OAAO,CAAC,GAAG,EAAE,CAAC;IAChB,CAAC;AACH,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"summary.d.ts","sourceRoot":"","sources":["../../src/commands/summary.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAsCpC,eAAO,MAAM,cAAc,SAIL,CAAC"}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Summary command — Visual dashboard of today's coding activity
|
|
4
|
+
*/
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.summaryCommand = void 0;
|
|
7
|
+
const commander_1 = require("commander");
|
|
8
|
+
const banner_1 = require("../branding/banner");
|
|
9
|
+
const dashboard_1 = require("../branding/dashboard");
|
|
10
|
+
const auth_1 = require("../auth");
|
|
11
|
+
async function showSummary(options) {
|
|
12
|
+
const client = await (0, auth_1.createAuthenticatedClient)();
|
|
13
|
+
if (!client) {
|
|
14
|
+
(0, banner_1.printHeader)('Summary');
|
|
15
|
+
(0, banner_1.printError)('Not authenticated');
|
|
16
|
+
(0, banner_1.printInfo)('Run: devclocked login');
|
|
17
|
+
process.exit(1);
|
|
18
|
+
}
|
|
19
|
+
const tz = Intl.DateTimeFormat().resolvedOptions().timeZone;
|
|
20
|
+
const data = await client.getTodayActivity({ date: options.date, tz });
|
|
21
|
+
if (!data) {
|
|
22
|
+
(0, banner_1.printHeader)('Summary');
|
|
23
|
+
(0, banner_1.printError)('Failed to fetch activity data');
|
|
24
|
+
client.destroy();
|
|
25
|
+
process.exit(1);
|
|
26
|
+
}
|
|
27
|
+
if (!process.stdout.isTTY) {
|
|
28
|
+
// Non-TTY (piped, captured, or non-interactive) — plain text only
|
|
29
|
+
console.log((0, dashboard_1.buildPlainSummary)(data));
|
|
30
|
+
}
|
|
31
|
+
else if (options.full) {
|
|
32
|
+
(0, dashboard_1.renderFullDashboard)(data);
|
|
33
|
+
}
|
|
34
|
+
else {
|
|
35
|
+
(0, dashboard_1.renderCompactSummary)(data);
|
|
36
|
+
}
|
|
37
|
+
client.destroy();
|
|
38
|
+
process.exit(0);
|
|
39
|
+
}
|
|
40
|
+
exports.summaryCommand = new commander_1.Command('summary')
|
|
41
|
+
.description('Show today\'s coding activity dashboard')
|
|
42
|
+
.option('-d, --date <date>', 'Date in YYYY-MM-DD format (default: today)')
|
|
43
|
+
.option('-f, --full', 'Show full dashboard with all repos and progress bars')
|
|
44
|
+
.action(showSummary);
|
|
45
|
+
//# sourceMappingURL=summary.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"summary.js","sourceRoot":"","sources":["../../src/commands/summary.ts"],"names":[],"mappings":";AAAA;;GAEG;;;AAEH,yCAAoC;AACpC,+CAAwE;AACxE,qDAAqG;AACrG,kCAAoD;AAEpD,KAAK,UAAU,WAAW,CAAC,OAA0C;IACnE,MAAM,MAAM,GAAG,MAAM,IAAA,gCAAyB,GAAE,CAAC;IAEjD,IAAI,CAAC,MAAM,EAAE,CAAC;QACZ,IAAA,oBAAW,EAAC,SAAS,CAAC,CAAC;QACvB,IAAA,mBAAU,EAAC,mBAAmB,CAAC,CAAC;QAChC,IAAA,kBAAS,EAAC,uBAAuB,CAAC,CAAC;QACnC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAClB,CAAC;IAED,MAAM,EAAE,GAAG,IAAI,CAAC,cAAc,EAAE,CAAC,eAAe,EAAE,CAAC,QAAQ,CAAC;IAC5D,MAAM,IAAI,GAAG,MAAM,MAAM,CAAC,gBAAgB,CAAC,EAAE,IAAI,EAAE,OAAO,CAAC,IAAI,EAAE,EAAE,EAAE,CAAC,CAAC;IAEvE,IAAI,CAAC,IAAI,EAAE,CAAC;QACV,IAAA,oBAAW,EAAC,SAAS,CAAC,CAAC;QACvB,IAAA,mBAAU,EAAC,+BAA+B,CAAC,CAAC;QAC5C,MAAM,CAAC,OAAO,EAAE,CAAC;QACjB,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAClB,CAAC;IAED,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,KAAK,EAAE,CAAC;QAC1B,kEAAkE;QAClE,OAAO,CAAC,GAAG,CAAC,IAAA,6BAAiB,EAAC,IAAI,CAAC,CAAC,CAAC;IACvC,CAAC;SAAM,IAAI,OAAO,CAAC,IAAI,EAAE,CAAC;QACxB,IAAA,+BAAmB,EAAC,IAAI,CAAC,CAAC;IAC5B,CAAC;SAAM,CAAC;QACN,IAAA,gCAAoB,EAAC,IAAI,CAAC,CAAC;IAC7B,CAAC;IAED,MAAM,CAAC,OAAO,EAAE,CAAC;IACjB,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAClB,CAAC;AAEY,QAAA,cAAc,GAAG,IAAI,mBAAO,CAAC,SAAS,CAAC;KACjD,WAAW,CAAC,yCAAyC,CAAC;KACtD,MAAM,CAAC,mBAAmB,EAAE,4CAA4C,CAAC;KACzE,MAAM,CAAC,YAAY,EAAE,sDAAsD,CAAC;KAC5E,MAAM,CAAC,WAAW,CAAC,CAAC"}
|
package/dist/config.d.ts
CHANGED
|
@@ -9,5 +9,5 @@ export declare const REUSE_ACTIVE_WITHIN_MS = 120000;
|
|
|
9
9
|
export declare const END_SESSION_DEBOUNCE_MS = 60000;
|
|
10
10
|
export declare const IDLE_TIMEOUT_MS: number;
|
|
11
11
|
export declare const TICK_INTERVAL_MS = 30000;
|
|
12
|
-
export declare const CLI_VERSION = "
|
|
12
|
+
export declare const CLI_VERSION = "2.0.0";
|
|
13
13
|
//# sourceMappingURL=config.d.ts.map
|
package/dist/config.js
CHANGED
|
@@ -18,5 +18,5 @@ exports.END_SESSION_DEBOUNCE_MS = 60000; // 1 minute
|
|
|
18
18
|
exports.IDLE_TIMEOUT_MS = 15 * 60 * 1000; // 15 minutes
|
|
19
19
|
exports.TICK_INTERVAL_MS = 30000; // 30 seconds minimum between ticks
|
|
20
20
|
// CLI version
|
|
21
|
-
exports.CLI_VERSION = '
|
|
21
|
+
exports.CLI_VERSION = '2.0.0';
|
|
22
22
|
//# sourceMappingURL=config.js.map
|
package/dist/index.js
CHANGED
|
@@ -17,15 +17,22 @@ const logout_1 = require("./commands/logout");
|
|
|
17
17
|
const session_1 = require("./commands/session");
|
|
18
18
|
const status_1 = require("./commands/status");
|
|
19
19
|
const flush_1 = require("./commands/flush");
|
|
20
|
+
const summary_1 = require("./commands/summary");
|
|
21
|
+
const mcp_server_1 = require("./commands/mcp-server");
|
|
22
|
+
const mcp_health_1 = require("./commands/mcp-health");
|
|
20
23
|
const program = new commander_1.Command();
|
|
21
24
|
program
|
|
22
25
|
.name('devclocked')
|
|
23
26
|
.description('DevClocked CLI - Terminal time tracking for developers')
|
|
24
|
-
.version('
|
|
27
|
+
.version('2.0.0');
|
|
25
28
|
program.addCommand(login_1.loginCommand);
|
|
26
29
|
program.addCommand(logout_1.logoutCommand);
|
|
27
30
|
program.addCommand(session_1.sessionCommand);
|
|
28
31
|
program.addCommand(status_1.statusCommand);
|
|
29
32
|
program.addCommand(flush_1.flushCommand);
|
|
33
|
+
program.addCommand(summary_1.summaryCommand);
|
|
34
|
+
program.addCommand(mcp_server_1.mcpServerCommand);
|
|
35
|
+
program.addCommand(mcp_server_1.mcpListToolsCommand);
|
|
36
|
+
program.addCommand(mcp_health_1.mcpHealthCommand);
|
|
30
37
|
program.parse();
|
|
31
38
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;AACA;;;;;;;;;GASG;;AAEH,yCAAoC;AACpC,4CAAgD;AAChD,8CAAkD;AAClD,gDAAoD;AACpD,8CAAkD;AAClD,4CAAgD;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;AACA;;;;;;;;;GASG;;AAEH,yCAAoC;AACpC,4CAAgD;AAChD,8CAAkD;AAClD,gDAAoD;AACpD,8CAAkD;AAClD,4CAAgD;AAChD,gDAAoD;AACpD,sDAA8E;AAC9E,sDAAyD;AAEzD,MAAM,OAAO,GAAG,IAAI,mBAAO,EAAE,CAAC;AAE9B,OAAO;KACJ,IAAI,CAAC,YAAY,CAAC;KAClB,WAAW,CAAC,wDAAwD,CAAC;KACrE,OAAO,CAAC,OAAO,CAAC,CAAC;AAEpB,OAAO,CAAC,UAAU,CAAC,oBAAY,CAAC,CAAC;AACjC,OAAO,CAAC,UAAU,CAAC,sBAAa,CAAC,CAAC;AAClC,OAAO,CAAC,UAAU,CAAC,wBAAc,CAAC,CAAC;AACnC,OAAO,CAAC,UAAU,CAAC,sBAAa,CAAC,CAAC;AAClC,OAAO,CAAC,UAAU,CAAC,oBAAY,CAAC,CAAC;AACjC,OAAO,CAAC,UAAU,CAAC,wBAAc,CAAC,CAAC;AACnC,OAAO,CAAC,UAAU,CAAC,6BAAgB,CAAC,CAAC;AACrC,OAAO,CAAC,UAAU,CAAC,gCAAmB,CAAC,CAAC;AACxC,OAAO,CAAC,UAAU,CAAC,6BAAgB,CAAC,CAAC;AAErC,OAAO,CAAC,KAAK,EAAE,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shared utilities for MCP server and MCP health commands.
|
|
3
|
+
*/
|
|
4
|
+
export interface McpAuth {
|
|
5
|
+
apiKey: string;
|
|
6
|
+
userId: string;
|
|
7
|
+
email: string;
|
|
8
|
+
}
|
|
9
|
+
export declare function getAuth(): McpAuth;
|
|
10
|
+
export declare function callEdgeFunction(auth: McpAuth, name: string, options?: {
|
|
11
|
+
method?: 'GET' | 'POST';
|
|
12
|
+
body?: Record<string, unknown>;
|
|
13
|
+
queryParams?: Record<string, string>;
|
|
14
|
+
}): Promise<unknown>;
|
|
15
|
+
//# sourceMappingURL=mcp-utils.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mcp-utils.d.ts","sourceRoot":"","sources":["../src/mcp-utils.ts"],"names":[],"mappings":"AAAA;;GAEG;AAOH,MAAM,WAAW,OAAO;IACtB,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;CACf;AAED,wBAAgB,OAAO,IAAI,OAAO,CAsBjC;AAED,wBAAsB,gBAAgB,CACpC,IAAI,EAAE,OAAO,EACb,IAAI,EAAE,MAAM,EACZ,OAAO,CAAC,EAAE;IACR,MAAM,CAAC,EAAE,KAAK,GAAG,MAAM,CAAC;IACxB,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAC/B,WAAW,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CACtC,GACA,OAAO,CAAC,OAAO,CAAC,CA2BlB"}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Shared utilities for MCP server and MCP health commands.
|
|
4
|
+
*/
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.getAuth = getAuth;
|
|
7
|
+
exports.callEdgeFunction = callEdgeFunction;
|
|
8
|
+
const fs_1 = require("fs");
|
|
9
|
+
const path_1 = require("path");
|
|
10
|
+
const os_1 = require("os");
|
|
11
|
+
const config_1 = require("./config");
|
|
12
|
+
function getAuth() {
|
|
13
|
+
const configFile = (0, path_1.join)((0, os_1.homedir)(), '.config', 'devclocked', 'cli.json');
|
|
14
|
+
let raw;
|
|
15
|
+
try {
|
|
16
|
+
raw = (0, fs_1.readFileSync)(configFile, 'utf-8');
|
|
17
|
+
}
|
|
18
|
+
catch {
|
|
19
|
+
throw new Error(`Not authenticated. Run "devclocked login" first.\nExpected config at: ${configFile}`);
|
|
20
|
+
}
|
|
21
|
+
const config = JSON.parse(raw);
|
|
22
|
+
if (!config.auth_state) {
|
|
23
|
+
throw new Error('No auth_state in config. Run "devclocked login" to authenticate.');
|
|
24
|
+
}
|
|
25
|
+
const auth = JSON.parse(config.auth_state);
|
|
26
|
+
if (!auth.apiKey) {
|
|
27
|
+
throw new Error('API key missing from auth state. Run "devclocked login".');
|
|
28
|
+
}
|
|
29
|
+
return { apiKey: auth.apiKey, userId: auth.userId, email: auth.email };
|
|
30
|
+
}
|
|
31
|
+
async function callEdgeFunction(auth, name, options) {
|
|
32
|
+
const method = options?.method ?? 'POST';
|
|
33
|
+
let url = `${config_1.SUPABASE_URL}/functions/v1/${name}`;
|
|
34
|
+
if (options?.queryParams) {
|
|
35
|
+
const params = new URLSearchParams(options.queryParams);
|
|
36
|
+
url += `?${params.toString()}`;
|
|
37
|
+
}
|
|
38
|
+
const res = await fetch(url, {
|
|
39
|
+
method,
|
|
40
|
+
headers: {
|
|
41
|
+
'Content-Type': 'application/json',
|
|
42
|
+
'Authorization': `Bearer ${config_1.SUPABASE_ANON_KEY}`,
|
|
43
|
+
'apikey': config_1.SUPABASE_ANON_KEY,
|
|
44
|
+
'x-devclocked-key': auth.apiKey,
|
|
45
|
+
'x-devclocked-source': 'mcp',
|
|
46
|
+
},
|
|
47
|
+
body: method === 'POST' ? JSON.stringify(options?.body ?? {}) : undefined,
|
|
48
|
+
});
|
|
49
|
+
if (!res.ok) {
|
|
50
|
+
const text = await res.text();
|
|
51
|
+
throw new Error(`Edge function ${name} failed: ${res.status} ${text}`);
|
|
52
|
+
}
|
|
53
|
+
return res.json();
|
|
54
|
+
}
|
|
55
|
+
//# sourceMappingURL=mcp-utils.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mcp-utils.js","sourceRoot":"","sources":["../src/mcp-utils.ts"],"names":[],"mappings":";AAAA;;GAEG;;AAaH,0BAsBC;AAED,4CAmCC;AAtED,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AM,CAAC,QAAQ,EAAE,EAAE,CAAC;IACjC,CAAC;IAED,MAAM,GAAG,GAAG,MAAM,KAAK,CAAC,GAAG,EAAE;QAC3B,MAAM;QACN,OAAO,EAAE;YACP,cAAc,EAAE,kBAAkB;YAClC,eAAe,EAAE,UAAU,0BAAiB,EAAE;YAC9C,QAAQ,EAAE,0BAAiB;YAC3B,kBAAkB,EAAE,IAAI,CAAC,MAAM;YAC/B,qBAAqB,EAAE,KAAK;SAC7B;QACD,IAAI,EAAE,MAAM,KAAK,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,OAAO,EAAE,IAAI,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC,SAAS;KAC1E,CAAC,CAAC;IAEH,IAAI,CAAC,GAAG,CAAC,EAAE,EAAE,CAAC;QACZ,MAAM,IAAI,GAAG,MAAM,GAAG,CAAC,IAAI,EAAE,CAAC;QAC9B,MAAM,IAAI,KAAK,CAAC,iBAAiB,IAAI,YAAY,GAAG,CAAC,MAAM,IAAI,IAAI,EAAE,CAAC,CAAC;IACzE,CAAC;IAED,OAAO,GAAG,CAAC,IAAI,EAAE,CAAC;AACpB,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@devclocked/cli",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "2.0.0",
|
|
4
4
|
"description": "DevClocked CLI - Terminal time tracking for developers",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -35,7 +35,8 @@
|
|
|
35
35
|
"url": "https://github.com/devclocked/trackers/issues"
|
|
36
36
|
},
|
|
37
37
|
"dependencies": {
|
|
38
|
-
"@devclocked/tracker-core": "^2.
|
|
38
|
+
"@devclocked/tracker-core": "^2.1.0",
|
|
39
|
+
"@modelcontextprotocol/sdk": "^1.12.1",
|
|
39
40
|
"chalk": "^5.3.0",
|
|
40
41
|
"commander": "^11.1.0",
|
|
41
42
|
"node-pty": "^1.0.0",
|