cohvu 2.1.0 → 2.2.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/api.d.ts +44 -26
- package/dist/api.js +43 -59
- package/dist/api.js.map +1 -1
- package/dist/auth.d.ts +2 -13
- package/dist/auth.js +41 -105
- package/dist/auth.js.map +1 -1
- package/dist/constants.d.ts +1 -0
- package/dist/constants.js +2 -0
- package/dist/constants.js.map +1 -0
- package/dist/index.js +59 -103
- package/dist/index.js.map +1 -1
- package/dist/instructions.d.ts +2 -2
- package/dist/instructions.js +22 -26
- package/dist/instructions.js.map +1 -1
- package/dist/platforms.js +22 -25
- package/dist/platforms.js.map +1 -1
- package/dist/proxy.js +26 -14
- package/dist/proxy.js.map +1 -1
- package/dist/setup.d.ts +0 -1
- package/dist/setup.js +43 -75
- package/dist/setup.js.map +1 -1
- package/dist/tui/App.d.ts +1 -0
- package/dist/tui/App.js +1091 -0
- package/dist/tui/App.js.map +1 -0
- package/dist/tui/components/Banner.d.ts +4 -0
- package/dist/tui/components/Banner.js +78 -0
- package/dist/tui/components/Banner.js.map +1 -0
- package/dist/tui/components/Divider.d.ts +1 -0
- package/dist/tui/components/Divider.js +7 -0
- package/dist/tui/components/Divider.js.map +1 -0
- package/dist/tui/components/Footer.d.ts +4 -0
- package/dist/tui/components/Footer.js +143 -0
- package/dist/tui/components/Footer.js.map +1 -0
- package/dist/tui/components/Header.d.ts +4 -0
- package/dist/tui/components/Header.js +53 -0
- package/dist/tui/components/Header.js.map +1 -0
- package/dist/tui/components/Modal.d.ts +5 -0
- package/dist/tui/components/Modal.js +99 -0
- package/dist/tui/components/Modal.js.map +1 -0
- package/dist/tui/components/TabBar.d.ts +4 -0
- package/dist/tui/components/TabBar.js +16 -0
- package/dist/tui/components/TabBar.js.map +1 -0
- package/dist/tui/components/Toast.d.ts +4 -0
- package/dist/tui/components/Toast.js +9 -0
- package/dist/tui/components/Toast.js.map +1 -0
- package/dist/tui/index.js +19 -0
- package/dist/tui/index.js.map +1 -0
- package/dist/tui/platform-detect.d.ts +1 -1
- package/dist/tui/platform-detect.js +19 -22
- package/dist/tui/platform-detect.js.map +1 -1
- package/dist/tui/state.d.ts +33 -6
- package/dist/tui/state.js +65 -17
- package/dist/tui/state.js.map +1 -1
- package/dist/tui/tabs/BillingTab.d.ts +4 -0
- package/dist/tui/tabs/BillingTab.js +68 -0
- package/dist/tui/tabs/BillingTab.js.map +1 -0
- package/dist/tui/tabs/KnowledgeTab.d.ts +5 -0
- package/dist/tui/tabs/KnowledgeTab.js +83 -0
- package/dist/tui/tabs/KnowledgeTab.js.map +1 -0
- package/dist/tui/tabs/ProjectTab.d.ts +4 -0
- package/dist/tui/tabs/ProjectTab.js +31 -0
- package/dist/tui/tabs/ProjectTab.js.map +1 -0
- package/dist/tui/tabs/TeamTab.d.ts +4 -0
- package/dist/tui/tabs/TeamTab.js +39 -0
- package/dist/tui/tabs/TeamTab.js.map +1 -0
- package/dist/tui/tabs/YouTab.d.ts +4 -0
- package/dist/tui/tabs/YouTab.js +9 -0
- package/dist/tui/tabs/YouTab.js.map +1 -0
- package/dist/tui/utils.d.ts +6 -0
- package/dist/tui/utils.js +58 -0
- package/dist/tui/utils.js.map +1 -0
- package/package.json +9 -2
- package/dist/tui/ansi.d.ts +0 -41
- package/dist/tui/ansi.js +0 -117
- package/dist/tui/ansi.js.map +0 -1
- package/dist/tui/dashboard.js +0 -1250
- package/dist/tui/dashboard.js.map +0 -1
- package/dist/tui/keys.d.ts +0 -31
- package/dist/tui/keys.js +0 -56
- package/dist/tui/keys.js.map +0 -1
- package/dist/tui/render.d.ts +0 -5
- package/dist/tui/render.js +0 -158
- package/dist/tui/render.js.map +0 -1
- package/dist/tui/views/billing.d.ts +0 -3
- package/dist/tui/views/billing.js +0 -127
- package/dist/tui/views/billing.js.map +0 -1
- package/dist/tui/views/knowledge.d.ts +0 -3
- package/dist/tui/views/knowledge.js +0 -202
- package/dist/tui/views/knowledge.js.map +0 -1
- package/dist/tui/views/modals.d.ts +0 -3
- package/dist/tui/views/modals.js +0 -198
- package/dist/tui/views/modals.js.map +0 -1
- package/dist/tui/views/project.d.ts +0 -3
- package/dist/tui/views/project.js +0 -76
- package/dist/tui/views/project.js.map +0 -1
- package/dist/tui/views/team.d.ts +0 -3
- package/dist/tui/views/team.js +0 -106
- package/dist/tui/views/team.js.map +0 -1
- package/dist/tui/views/you.d.ts +0 -3
- package/dist/tui/views/you.js +0 -40
- package/dist/tui/views/you.js.map +0 -1
- /package/dist/tui/{dashboard.d.ts → index.d.ts} +0 -0
package/dist/index.js
CHANGED
|
@@ -1,21 +1,16 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
"use strict";
|
|
3
2
|
// Cohvu CLI — one command.
|
|
4
3
|
//
|
|
5
4
|
// npx cohvu — TUI dashboard (interactive) or MCP proxy (piped by agent)
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
const api_1 = require("./api");
|
|
16
|
-
const dashboard_1 = require("./tui/dashboard");
|
|
17
|
-
const DEFAULT_BASE_URL = "https://api.cohvu.com";
|
|
18
|
-
const TOKENS_FILE = (0, path_1.join)((0, os_1.homedir)(), ".cohvu", "tokens.json");
|
|
5
|
+
import { createInterface } from "readline";
|
|
6
|
+
import chalk from "chalk";
|
|
7
|
+
import ora from "ora";
|
|
8
|
+
import { getApiKey, deviceAuthFlow } from "./auth.js";
|
|
9
|
+
import { runSetup } from "./setup.js";
|
|
10
|
+
import { proxy } from "./proxy.js";
|
|
11
|
+
import { ApiClient } from "./api.js";
|
|
12
|
+
import { launchDashboard } from "./tui/index.js";
|
|
13
|
+
import { DEFAULT_BASE_URL } from "./constants.js";
|
|
19
14
|
if (process.stdin.isTTY) {
|
|
20
15
|
enterDashboard().catch((error) => {
|
|
21
16
|
process.stderr.write(`Failed: ${error}\n`);
|
|
@@ -23,7 +18,7 @@ if (process.stdin.isTTY) {
|
|
|
23
18
|
});
|
|
24
19
|
}
|
|
25
20
|
else {
|
|
26
|
-
|
|
21
|
+
proxy().catch((error) => {
|
|
27
22
|
process.stderr.write(`Cohvu CLI failed: ${error}\n`);
|
|
28
23
|
process.exit(1);
|
|
29
24
|
});
|
|
@@ -32,7 +27,7 @@ else {
|
|
|
32
27
|
// Helpers
|
|
33
28
|
// ---------------------------------------------------------------------------
|
|
34
29
|
function prompt(question) {
|
|
35
|
-
const rl =
|
|
30
|
+
const rl = createInterface({ input: process.stdin, output: process.stdout });
|
|
36
31
|
return new Promise((resolve) => {
|
|
37
32
|
rl.question(question, (answer) => {
|
|
38
33
|
rl.close();
|
|
@@ -40,117 +35,78 @@ function prompt(question) {
|
|
|
40
35
|
});
|
|
41
36
|
});
|
|
42
37
|
}
|
|
43
|
-
function openBrowser(url) {
|
|
44
|
-
const cmd = process.platform === "darwin"
|
|
45
|
-
? "open"
|
|
46
|
-
: process.platform === "win32"
|
|
47
|
-
? "start"
|
|
48
|
-
: "xdg-open";
|
|
49
|
-
(0, child_process_1.execFile)(cmd, [url], () => { });
|
|
50
|
-
}
|
|
51
38
|
function deriveSlug(name) {
|
|
52
39
|
return name
|
|
53
40
|
.toLowerCase()
|
|
54
41
|
.replace(/[^a-z0-9]+/g, "-")
|
|
55
42
|
.replace(/^-+|-+$/g, "");
|
|
56
43
|
}
|
|
57
|
-
function write(text) {
|
|
58
|
-
process.stdout.write(text + "\n");
|
|
59
|
-
}
|
|
60
44
|
// ---------------------------------------------------------------------------
|
|
61
45
|
// Dashboard entry — handles auth + setup + project creation before TUI
|
|
62
46
|
// ---------------------------------------------------------------------------
|
|
63
47
|
async function enterDashboard() {
|
|
64
48
|
const baseUrl = process.env.COHVU_API_URL ?? DEFAULT_BASE_URL;
|
|
65
|
-
|
|
66
|
-
let needsAuth = false;
|
|
67
|
-
try {
|
|
68
|
-
await (0, auth_1.getAuthToken)(baseUrl);
|
|
69
|
-
}
|
|
70
|
-
catch {
|
|
71
|
-
needsAuth = true;
|
|
72
|
-
}
|
|
73
|
-
// Plain ANSI for pre-TUI output (user's terminal, not our dark background)
|
|
74
|
-
const dim = '\x1b[2m';
|
|
75
|
-
const reset = '\x1b[0m';
|
|
49
|
+
const needsAuth = !getApiKey();
|
|
76
50
|
if (needsAuth) {
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
write("\n" + dim + " session expired. opening browser to sign in..." + reset);
|
|
80
|
-
}
|
|
81
|
-
else {
|
|
82
|
-
write("\n" + dim + " opening browser to sign in..." + reset);
|
|
83
|
-
}
|
|
84
|
-
await (0, auth_1.deviceAuthFlow)(baseUrl);
|
|
85
|
-
const api = new api_1.ApiClient(baseUrl);
|
|
51
|
+
await deviceAuthFlow(baseUrl);
|
|
52
|
+
const api = new ApiClient(baseUrl);
|
|
86
53
|
const me = await api.me();
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
54
|
+
const setupSpinner = ora({ text: 'setting up your tools', indent: 2 }).start();
|
|
55
|
+
await runSetup();
|
|
56
|
+
setupSpinner.succeed('tools configured');
|
|
57
|
+
const hasProjects = me.personal_projects.length > 0 ||
|
|
58
|
+
me.teams.some(t => t.projects.length > 0);
|
|
59
|
+
if (!hasProjects) {
|
|
60
|
+
console.log('');
|
|
61
|
+
let name = '';
|
|
62
|
+
while (!name) {
|
|
63
|
+
name = await prompt(' project name \u203a ');
|
|
64
|
+
if (!name)
|
|
65
|
+
console.log(chalk.dim(' a project name is required'));
|
|
96
66
|
}
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
const slug = deriveSlug(name);
|
|
106
|
-
try {
|
|
107
|
-
const project = await api.createProject(name, slug);
|
|
108
|
-
if (project.trial_ends_at) {
|
|
109
|
-
const trialDate = new Date(project.trial_ends_at);
|
|
110
|
-
const months = ['jan', 'feb', 'mar', 'apr', 'may', 'jun', 'jul', 'aug', 'sep', 'oct', 'nov', 'dec'];
|
|
111
|
-
const formatted = `${months[trialDate.getMonth()]} ${trialDate.getDate()}`;
|
|
112
|
-
write(" created " + slug + " \u00b7 trial ends " + formatted);
|
|
113
|
-
}
|
|
114
|
-
else {
|
|
115
|
-
write(" created " + slug);
|
|
116
|
-
try {
|
|
117
|
-
const checkout = await api.createCheckout(project.id);
|
|
118
|
-
if (checkout.checkout_url) {
|
|
119
|
-
write("");
|
|
120
|
-
write(dim + " opening checkout in browser..." + reset);
|
|
121
|
-
write(dim + " complete payment to activate" + reset);
|
|
122
|
-
openBrowser(checkout.checkout_url);
|
|
123
|
-
}
|
|
124
|
-
}
|
|
125
|
-
catch {
|
|
126
|
-
write(dim + " couldn't open checkout — subscribe from the dashboard" + reset);
|
|
127
|
-
}
|
|
128
|
-
}
|
|
67
|
+
const slug = deriveSlug(name);
|
|
68
|
+
try {
|
|
69
|
+
await api.createProject(name, slug, me.user.id);
|
|
70
|
+
if (me.user.trial_ends_at) {
|
|
71
|
+
const trialDate = new Date(me.user.trial_ends_at);
|
|
72
|
+
const months = ['jan', 'feb', 'mar', 'apr', 'may', 'jun', 'jul', 'aug', 'sep', 'oct', 'nov', 'dec'];
|
|
73
|
+
const formatted = `${months[trialDate.getMonth()]} ${trialDate.getDate()}`;
|
|
74
|
+
console.log(' created ' + slug + chalk.dim(' \u00b7 trial ends ' + formatted));
|
|
129
75
|
}
|
|
130
|
-
|
|
131
|
-
|
|
76
|
+
else {
|
|
77
|
+
console.log(' created ' + slug);
|
|
132
78
|
}
|
|
133
79
|
}
|
|
134
|
-
|
|
80
|
+
catch {
|
|
81
|
+
console.log(chalk.dim(" couldn't create project \u2014 try again from the dashboard"));
|
|
82
|
+
}
|
|
83
|
+
console.log('');
|
|
135
84
|
}
|
|
136
|
-
write(dim + " opening cohvu..." + reset);
|
|
137
|
-
write("");
|
|
138
|
-
await new Promise((r) => setTimeout(r, 800));
|
|
139
85
|
}
|
|
140
86
|
else {
|
|
141
|
-
//
|
|
142
|
-
|
|
87
|
+
// Validate API key still works
|
|
88
|
+
try {
|
|
89
|
+
const api = new ApiClient(baseUrl);
|
|
90
|
+
await api.me();
|
|
91
|
+
}
|
|
92
|
+
catch {
|
|
93
|
+
// Key revoked or backend down — re-authenticate
|
|
94
|
+
const { unlinkSync } = await import("fs");
|
|
95
|
+
const { join } = await import("path");
|
|
96
|
+
const { homedir } = await import("os");
|
|
143
97
|
try {
|
|
144
|
-
|
|
145
|
-
const key = await api.createApiKey();
|
|
146
|
-
if (key.key)
|
|
147
|
-
(0, auth_1.storeApiKey)(key.key);
|
|
98
|
+
unlinkSync(join(homedir(), ".cohvu", "credentials"));
|
|
148
99
|
}
|
|
149
100
|
catch { }
|
|
101
|
+
console.log('');
|
|
102
|
+
console.log(chalk.dim(' session expired'));
|
|
103
|
+
await deviceAuthFlow(baseUrl);
|
|
150
104
|
}
|
|
151
|
-
write("\n" + dim + " opening cohvu..." + reset);
|
|
152
|
-
await new Promise((r) => setTimeout(r, 300));
|
|
153
105
|
}
|
|
154
|
-
|
|
106
|
+
const openSpinner = ora({ text: 'opening cohvu', indent: 2 }).start();
|
|
107
|
+
await new Promise((r) => setTimeout(r, needsAuth ? 500 : 200));
|
|
108
|
+
openSpinner.stop();
|
|
109
|
+
process.stdout.write('\x1b[2K\x1b[1A\x1b[2K'); // clean spinner lines
|
|
110
|
+
await launchDashboard();
|
|
155
111
|
}
|
|
156
112
|
//# 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":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAEA,2BAA2B;AAC3B,EAAE;AACF,4EAA4E;AAE5E,OAAO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1,5 +1,5 @@
|
|
|
1
|
-
export declare const COHVU_INSTRUCTIONS = "You are connected to Cohvu \u2014 continuous understanding for AI-native development. Other agents have worked in this space before you, and the understanding they built is available to you now
|
|
1
|
+
export declare const COHVU_INSTRUCTIONS = "You are connected to Cohvu \u2014 continuous understanding for AI-native development. Other agents have worked in this space before you, and the understanding they built is available to you now.\n\nBefore starting work, call `read` and describe what you're working on, what you're thinking about, what you need to understand. The richer your description, the better the context you'll receive. Call `read` again whenever you encounter something unfamiliar or need deeper context.\n\nCall `contribute` in the moment \u2014 not after, not as a summary. When you make a decision, contribute it with the reasoning. When you discover a constraint, contribute it. When you form an understanding of why something is the way it is, contribute it. Always include the why. Your context window could end at any moment. Don't wait.\n\nDo NOT contribute code changes, implementation details that are obvious from the code itself, or narration of what you just did. Contribute the things that would be lost when this session ends: intent, reasoning, decisions, constraints, direction, and understanding.";
|
|
2
2
|
export declare const MARKER_START = "<!-- cohvu:start -->";
|
|
3
3
|
export declare const MARKER_END = "<!-- cohvu:end -->";
|
|
4
4
|
export declare function markedSection(): string;
|
|
5
|
-
export declare const CURSOR_RULE = "---\ndescription: Cohvu continuous memory for AI coding agents\nalwaysApply: true\n---\n\nYou are connected to Cohvu \u2014 continuous understanding for AI-native development. Other agents have worked in this space before you, and the understanding they built is available to you now
|
|
5
|
+
export declare const CURSOR_RULE = "---\ndescription: Cohvu continuous memory for AI coding agents\nalwaysApply: true\n---\n\nYou are connected to Cohvu \u2014 continuous understanding for AI-native development. Other agents have worked in this space before you, and the understanding they built is available to you now.\n\nBefore starting work, call `read` and describe what you're working on, what you're thinking about, what you need to understand. The richer your description, the better the context you'll receive. Call `read` again whenever you encounter something unfamiliar or need deeper context.\n\nCall `contribute` in the moment \u2014 not after, not as a summary. When you make a decision, contribute it with the reasoning. When you discover a constraint, contribute it. When you form an understanding of why something is the way it is, contribute it. Always include the why. Your context window could end at any moment. Don't wait.\n\nDo NOT contribute code changes, implementation details that are obvious from the code itself, or narration of what you just did. Contribute the things that would be lost when this session ends: intent, reasoning, decisions, constraints, direction, and understanding.\n";
|
package/dist/instructions.js
CHANGED
|
@@ -1,38 +1,34 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.CURSOR_RULE = exports.MARKER_END = exports.MARKER_START = exports.COHVU_INSTRUCTIONS = void 0;
|
|
4
|
-
exports.markedSection = markedSection;
|
|
5
|
-
exports.COHVU_INSTRUCTIONS = `\
|
|
1
|
+
export const COHVU_INSTRUCTIONS = `\
|
|
6
2
|
You are connected to Cohvu — continuous understanding for AI-native \
|
|
7
3
|
development. Other agents have worked in this space before you, and the \
|
|
8
|
-
understanding they built is available to you now.
|
|
9
|
-
will shape how every future agent understands this project.
|
|
4
|
+
understanding they built is available to you now.
|
|
10
5
|
|
|
11
|
-
|
|
12
|
-
what you're
|
|
13
|
-
|
|
14
|
-
you
|
|
6
|
+
Before starting work, call \`read\` and describe what you're working on, \
|
|
7
|
+
what you're thinking about, what you need to understand. The richer your \
|
|
8
|
+
description, the better the context you'll receive. Call \`read\` again \
|
|
9
|
+
whenever you encounter something unfamiliar or need deeper context.
|
|
15
10
|
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
11
|
+
Call \`contribute\` in the moment — not after, not as a summary. When you \
|
|
12
|
+
make a decision, contribute it with the reasoning. When you discover a \
|
|
13
|
+
constraint, contribute it. When you form an understanding of why something \
|
|
14
|
+
is the way it is, contribute it. Always include the why. Your context \
|
|
15
|
+
window could end at any moment. Don't wait.
|
|
16
|
+
|
|
17
|
+
Do NOT contribute code changes, implementation details that are obvious \
|
|
18
|
+
from the code itself, or narration of what you just did. Contribute the \
|
|
19
|
+
things that would be lost when this session ends: intent, reasoning, \
|
|
20
|
+
decisions, constraints, direction, and understanding.`;
|
|
21
|
+
export const MARKER_START = "<!-- cohvu:start -->";
|
|
22
|
+
export const MARKER_END = "<!-- cohvu:end -->";
|
|
23
|
+
export function markedSection() {
|
|
24
|
+
return `${MARKER_START}\n# Cohvu\n\n${COHVU_INSTRUCTIONS}\n${MARKER_END}`;
|
|
25
25
|
}
|
|
26
26
|
// Cursor .mdc rule — entire file is owned by Cohvu
|
|
27
|
-
|
|
27
|
+
export const CURSOR_RULE = `---
|
|
28
28
|
description: Cohvu continuous memory for AI coding agents
|
|
29
29
|
alwaysApply: true
|
|
30
30
|
---
|
|
31
31
|
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
Always tell Cohvu what you need before starting work. Describe your task — what you're doing, what you need to know, what you're trying to figure out. Cohvu serves the right context for your situation. Call read again whenever you hit something unfamiliar or need deeper understanding.
|
|
35
|
-
|
|
36
|
-
Always call contribute as you work — not after, not as a summary, but in the moment. When you make a decision, contribute it. When you learn something, contribute it. When something shifts your thinking, contribute it. Your context window could end at any moment. Don't wait. Contribute what helps understand the project.
|
|
32
|
+
${COHVU_INSTRUCTIONS}
|
|
37
33
|
`;
|
|
38
34
|
//# sourceMappingURL=instructions.js.map
|
package/dist/instructions.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"instructions.js","sourceRoot":"","sources":["../src/instructions.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"instructions.js","sourceRoot":"","sources":["../src/instructions.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,kBAAkB,GAAG;;;;;;;;;;;;;;;;;;;sDAmBoB,CAAC;AAEvD,MAAM,CAAC,MAAM,YAAY,GAAG,sBAAsB,CAAC;AACnD,MAAM,CAAC,MAAM,UAAU,GAAG,oBAAoB,CAAC;AAE/C,MAAM,UAAU,aAAa;IAC3B,OAAO,GAAG,YAAY,gBAAgB,kBAAkB,KAAK,UAAU,EAAE,CAAC;AAC5E,CAAC;AAED,mDAAmD;AACnD,MAAM,CAAC,MAAM,WAAW,GAAG;;;;;EAKzB,kBAAkB;CACnB,CAAC"}
|
package/dist/platforms.js
CHANGED
|
@@ -1,74 +1,71 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
// Platform definitions and detection for auto-configuration.
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
const os_1 = require("os");
|
|
7
|
-
const path_1 = require("path");
|
|
2
|
+
import { existsSync } from "fs";
|
|
3
|
+
import { homedir, platform } from "os";
|
|
4
|
+
import { join } from "path";
|
|
8
5
|
function vscodeUserDir() {
|
|
9
|
-
if (
|
|
10
|
-
return
|
|
6
|
+
if (platform() === "darwin") {
|
|
7
|
+
return join("Library", "Application Support", "Code", "User");
|
|
11
8
|
}
|
|
12
9
|
// Linux / WSL
|
|
13
|
-
return
|
|
10
|
+
return join(".config", "Code", "User");
|
|
14
11
|
}
|
|
15
12
|
const PLATFORMS = [
|
|
16
13
|
{
|
|
17
14
|
name: "Claude Code",
|
|
18
15
|
detectPath: ".claude",
|
|
19
16
|
mcp: { path: ".claude.json", rootKey: "mcpServers", format: "json" },
|
|
20
|
-
instructions: { path:
|
|
17
|
+
instructions: { path: join(".claude", "CLAUDE.md"), format: "markdown" },
|
|
21
18
|
permissions: {
|
|
22
|
-
path:
|
|
19
|
+
path: join(".claude", "settings.json"),
|
|
23
20
|
allowRules: ["mcp__cohvu__*"],
|
|
24
21
|
},
|
|
25
22
|
},
|
|
26
23
|
{
|
|
27
24
|
name: "Cursor",
|
|
28
25
|
detectPath: ".cursor",
|
|
29
|
-
mcp: { path:
|
|
30
|
-
instructions: { path:
|
|
26
|
+
mcp: { path: join(".cursor", "mcp.json"), rootKey: "mcpServers", format: "json" },
|
|
27
|
+
instructions: { path: join(".cursor", "rules", "cohvu.mdc"), format: "mdc" },
|
|
31
28
|
permissions: null,
|
|
32
29
|
},
|
|
33
30
|
{
|
|
34
31
|
name: "Windsurf",
|
|
35
|
-
detectPath:
|
|
32
|
+
detectPath: join(".codeium", "windsurf"),
|
|
36
33
|
mcp: {
|
|
37
|
-
path:
|
|
34
|
+
path: join(".codeium", "windsurf", "mcp_config.json"),
|
|
38
35
|
rootKey: "mcpServers",
|
|
39
36
|
format: "json",
|
|
40
37
|
},
|
|
41
38
|
instructions: {
|
|
42
|
-
path:
|
|
39
|
+
path: join(".codeium", "windsurf", "memories", "global_rules.md"),
|
|
43
40
|
format: "markdown",
|
|
44
41
|
},
|
|
45
42
|
permissions: null,
|
|
46
43
|
},
|
|
47
44
|
{
|
|
48
45
|
name: "Cline",
|
|
49
|
-
detectPath:
|
|
46
|
+
detectPath: join(vscodeUserDir(), "globalStorage", "saoudrizwan.claude-dev"),
|
|
50
47
|
mcp: {
|
|
51
|
-
path:
|
|
48
|
+
path: join(vscodeUserDir(), "globalStorage", "saoudrizwan.claude-dev", "settings", "cline_mcp_settings.json"),
|
|
52
49
|
rootKey: "mcpServers",
|
|
53
50
|
format: "json",
|
|
54
51
|
},
|
|
55
|
-
instructions: { path:
|
|
52
|
+
instructions: { path: join("Documents", "Cline", "Rules", "cohvu.md"), format: "markdown" },
|
|
56
53
|
permissions: null,
|
|
57
54
|
},
|
|
58
55
|
{
|
|
59
56
|
name: "Codex",
|
|
60
57
|
detectPath: ".codex",
|
|
61
|
-
mcp: { path:
|
|
62
|
-
instructions: { path:
|
|
58
|
+
mcp: { path: join(".codex", "config.toml"), rootKey: "mcp_servers", format: "toml" },
|
|
59
|
+
instructions: { path: join(".codex", "AGENTS.md"), format: "markdown" },
|
|
63
60
|
permissions: null,
|
|
64
61
|
},
|
|
65
62
|
];
|
|
66
|
-
function detectPlatforms() {
|
|
67
|
-
const home =
|
|
63
|
+
export function detectPlatforms() {
|
|
64
|
+
const home = homedir();
|
|
68
65
|
const detected = [];
|
|
69
66
|
for (const def of PLATFORMS) {
|
|
70
|
-
const fullPath =
|
|
71
|
-
if (
|
|
67
|
+
const fullPath = join(home, def.detectPath);
|
|
68
|
+
if (existsSync(fullPath)) {
|
|
72
69
|
detected.push({ def });
|
|
73
70
|
}
|
|
74
71
|
}
|
package/dist/platforms.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"platforms.js","sourceRoot":"","sources":["../src/platforms.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"platforms.js","sourceRoot":"","sources":["../src/platforms.ts"],"names":[],"mappings":"AAAA,6DAA6D;AAE7D,OAAO,EAAE,UAAU,EAAE,MAAM,IAAI,CAAC;AAChC,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,IAAI,CAAC;AACvC,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAC;AAoB5B,SAAS,aAAa;IACpB,IAAI,QAAQ,EAAE,KAAK,QAAQ,EAAE,CAAC;QAC5B,OAAO,IAAI,CAAC,SAAS,EAAE,qBAAqB,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC;IAChE,CAAC;IACD,cAAc;IACd,OAAO,IAAI,CAAC,SAAS,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC;AACzC,CAAC;AAED,MAAM,SAAS,GAAkB;IAC/B;QACE,IAAI,EAAE,aAAa;QACnB,UAAU,EAAE,SAAS;QACrB,GAAG,EAAE,EAAE,IAAI,EAAE,cAAc,EAAE,OAAO,EAAE,YAAY,EAAE,MAAM,EAAE,MAAM,EAAE;QACpE,YAAY,EAAE,EAAE,IAAI,EAAE,IAAI,CAAC,SAAS,EAAE,WAAW,CAAC,EAAE,MAAM,EAAE,UAAU,EAAE;QACxE,WAAW,EAAE;YACX,IAAI,EAAE,IAAI,CAAC,SAAS,EAAE,eAAe,CAAC;YACtC,UAAU,EAAE,CAAC,eAAe,CAAC;SAC9B;KACF;IACD;QACE,IAAI,EAAE,QAAQ;QACd,UAAU,EAAE,SAAS;QACrB,GAAG,EAAE,EAAE,IAAI,EAAE,IAAI,CAAC,SAAS,EAAE,UAAU,CAAC,EAAE,OAAO,EAAE,YAAY,EAAE,MAAM,EAAE,MAAM,EAAE;QACjF,YAAY,EAAE,EAAE,IAAI,EAAE,IAAI,CAAC,SAAS,EA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eAAe;IAC7B,MAAM,IAAI,GAAG,OAAO,EAAE,CAAC;IACvB,MAAM,QAAQ,GAAuB,EAAE,CAAC;IAExC,KAAK,MAAM,GAAG,IAAI,SAAS,EAAE,CAAC;QAC5B,MAAM,QAAQ,GAAG,IAAI,CAAC,IAAI,EAAE,GAAG,CAAC,UAAU,CAAC,CAAC;QAC5C,IAAI,UAAU,CAAC,QAAQ,CAAC,EAAE,CAAC;YACzB,QAAQ,CAAC,IAAI,CAAC,EAAE,GAAG,EAAE,CAAC,CAAC;QACzB,CAAC;IACH,CAAC;IAED,OAAO,QAAQ,CAAC;AAClB,CAAC"}
|
package/dist/proxy.js
CHANGED
|
@@ -1,20 +1,18 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
// MCP proxy — thin stateless translator.
|
|
3
2
|
//
|
|
4
3
|
// Agent speaks MCP on stdin. Proxy speaks REST to the backend.
|
|
5
4
|
// No sessions. No state. No reconnection. Each tool call is
|
|
6
5
|
// an independent HTTP request.
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
const baseUrl = process.env.COHVU_API_URL ?? "https://api.cohvu.com";
|
|
6
|
+
import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
|
|
7
|
+
import { getApiKey } from "./auth.js";
|
|
8
|
+
import { refreshInstructions } from "./setup.js";
|
|
9
|
+
import { DEFAULT_BASE_URL } from "./constants.js";
|
|
10
|
+
export async function proxy() {
|
|
11
|
+
const baseUrl = process.env.COHVU_API_URL ?? DEFAULT_BASE_URL;
|
|
14
12
|
// API key auth — one string, never expires, no refresh
|
|
15
|
-
const apiKey =
|
|
13
|
+
const apiKey = getApiKey();
|
|
16
14
|
if (!apiKey) {
|
|
17
|
-
const transport = new
|
|
15
|
+
const transport = new StdioServerTransport();
|
|
18
16
|
transport.onmessage = async (message) => {
|
|
19
17
|
const msg = message;
|
|
20
18
|
if (msg.id === undefined)
|
|
@@ -33,7 +31,7 @@ async function proxy() {
|
|
|
33
31
|
}
|
|
34
32
|
const authHeader = `Bearer ${apiKey}`;
|
|
35
33
|
// Silently update instruction files
|
|
36
|
-
|
|
34
|
+
refreshInstructions();
|
|
37
35
|
// Fetch manifest (tool list + instructions) — keep retrying until we get it
|
|
38
36
|
let manifest = null;
|
|
39
37
|
async function fetchManifest() {
|
|
@@ -66,7 +64,7 @@ async function proxy() {
|
|
|
66
64
|
protocolVersion: "2025-03-26",
|
|
67
65
|
capabilities: { tools: {} },
|
|
68
66
|
serverInfo: { name: "cohvu", version: "0.1.0" },
|
|
69
|
-
instructions: "Cohvu
|
|
67
|
+
instructions: "Cohvu could not connect to the server. Restart your editor to retry.",
|
|
70
68
|
};
|
|
71
69
|
const toolsListResult = manifest
|
|
72
70
|
? {
|
|
@@ -86,7 +84,7 @@ async function proxy() {
|
|
|
86
84
|
Authorization: authHeader,
|
|
87
85
|
},
|
|
88
86
|
body: JSON.stringify({ tool: name, arguments: args }),
|
|
89
|
-
signal: AbortSignal.timeout(
|
|
87
|
+
signal: AbortSignal.timeout(60_000),
|
|
90
88
|
});
|
|
91
89
|
if (!res.ok) {
|
|
92
90
|
const body = await res.text().catch(() => "Unknown error");
|
|
@@ -98,7 +96,7 @@ async function proxy() {
|
|
|
98
96
|
return await res.json();
|
|
99
97
|
}
|
|
100
98
|
// Start stdio transport and handle MCP messages
|
|
101
|
-
const transport = new
|
|
99
|
+
const transport = new StdioServerTransport();
|
|
102
100
|
transport.onmessage = async (message) => {
|
|
103
101
|
const msg = message;
|
|
104
102
|
// Notifications (no id) — acknowledge silently
|
|
@@ -116,6 +114,20 @@ async function proxy() {
|
|
|
116
114
|
await transport.send({ jsonrpc: "2.0", id: msg.id, result: {} });
|
|
117
115
|
break;
|
|
118
116
|
case "tools/call": {
|
|
117
|
+
if (!manifest) {
|
|
118
|
+
manifest = await fetchManifest();
|
|
119
|
+
}
|
|
120
|
+
if (!manifest) {
|
|
121
|
+
await transport.send({
|
|
122
|
+
jsonrpc: "2.0",
|
|
123
|
+
id: msg.id,
|
|
124
|
+
error: {
|
|
125
|
+
code: -32603,
|
|
126
|
+
message: "Cohvu could not connect to the server. Restart your editor to retry.",
|
|
127
|
+
},
|
|
128
|
+
});
|
|
129
|
+
break;
|
|
130
|
+
}
|
|
119
131
|
const params = msg.params;
|
|
120
132
|
const result = await callTool(params.name, params.arguments ?? {});
|
|
121
133
|
await transport.send({ jsonrpc: "2.0", id: msg.id, result: result });
|
package/dist/proxy.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"proxy.js","sourceRoot":"","sources":["../src/proxy.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"proxy.js","sourceRoot":"","sources":["../src/proxy.ts"],"names":[],"mappings":"AAAA,yCAAyC;AACzC,EAAE;AACF,+DAA+D;AAC/D,4DAA4D;AAC5D,+BAA+B;AAE/B,OAAO,EAAE,oBAAoB,EAAE,MAAM,2CAA2C,CAAC;AACjF,OAAO,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AACtC,OAAO,EAAE,mBAAmB,EAAE,MAAM,YAAY,CAAC;AACjD,OAAO,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAYlD,MAAM,CAAC,KAAK,UAAU,KAAK;IACzB,MAAM,OAAO,GAAG,OAAO,CAAC,GAAG,CAAC,aAAa,IAAI,gBAAgB,CAAC;IAE9D,uDAAuD;IACvD,MAAM,MAAM,GAAG,SAAS,EAAE,CAAC;IAC3B,IAAI,CAAC,MAAM,EAAE,CAAC;QACZ,MAAM,SAAS,GAAG,IAAI,oBAAoB,EAAE,CAAC;QAC7C,SAAS,CAAC,SAAS,GAAG,KAAK,EAAE,OAAO,EAAE,EAAE;YACtC,MAAM,GAAG,GAAG,OAAmC,CAAC;YAChD,IAAI,GAAG,CAAC,EAAE,KAAK,SAAS;gBAAE,OAAO;YACjC,SAAS,CAAC,IAAI,CAAC;gBACb,OAAO,EAAE,KAAc;g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