@devness/useai 0.3.5 → 0.3.7
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/LICENSE +21 -0
- package/dist/index.js +36 -14
- package/package.json +11 -12
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 useai.dev
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/dist/index.js
CHANGED
|
@@ -264,7 +264,8 @@ function createTool(def) {
|
|
|
264
264
|
remove: () => {
|
|
265
265
|
handler.remove(def.configPath);
|
|
266
266
|
if (def.instructions) removeInstructions(def.instructions);
|
|
267
|
-
}
|
|
267
|
+
},
|
|
268
|
+
getManualHint: () => def.instructions ? null : def.manualHint ?? null
|
|
268
269
|
};
|
|
269
270
|
}
|
|
270
271
|
function matchesTool(tool, query) {
|
|
@@ -288,10 +289,16 @@ function resolveTools(names) {
|
|
|
288
289
|
}
|
|
289
290
|
return { matched, unmatched };
|
|
290
291
|
}
|
|
291
|
-
var MCP_ENTRY, home, INSTRUCTIONS_START, INSTRUCTIONS_END, USEAI_INSTRUCTIONS, USEAI_INSTRUCTIONS_BLOCK, formatHandlers, appSupport, AI_TOOLS;
|
|
292
|
+
var USEAI_INSTRUCTIONS_TEXT, MCP_ENTRY, home, INSTRUCTIONS_START, INSTRUCTIONS_END, USEAI_INSTRUCTIONS, USEAI_INSTRUCTIONS_BLOCK, formatHandlers, appSupport, AI_TOOLS;
|
|
292
293
|
var init_tools = __esm({
|
|
293
294
|
"src/tools.ts"() {
|
|
294
295
|
"use strict";
|
|
296
|
+
USEAI_INSTRUCTIONS_TEXT = [
|
|
297
|
+
"## UseAI Session Tracking",
|
|
298
|
+
"- At the START of every conversation, call `useai_session_start` with the appropriate task_type.",
|
|
299
|
+
"- For LONG sessions (15+ min), call `useai_heartbeat` periodically.",
|
|
300
|
+
"- At the END of every conversation, call `useai_session_end` with languages used, files_touched_count, and milestones (generic descriptions only \u2014 no project names, file paths, or company names)."
|
|
301
|
+
].join("\n");
|
|
295
302
|
MCP_ENTRY = {
|
|
296
303
|
command: "npx",
|
|
297
304
|
args: ["-y", "@devness/useai"]
|
|
@@ -325,19 +332,13 @@ ${INSTRUCTIONS_END}`;
|
|
|
325
332
|
detect: () => hasBinary("claude") || existsSync3(join3(home, ".claude.json")),
|
|
326
333
|
instructions: { method: "append", path: join3(home, ".claude", "CLAUDE.md") }
|
|
327
334
|
}),
|
|
328
|
-
createTool({
|
|
329
|
-
id: "claude-desktop",
|
|
330
|
-
name: "Claude Desktop",
|
|
331
|
-
configFormat: "standard",
|
|
332
|
-
configPath: join3(appSupport, "Claude", "claude_desktop_config.json"),
|
|
333
|
-
detect: () => existsSync3(join3(appSupport, "Claude")) || existsSync3("/Applications/Claude.app")
|
|
334
|
-
}),
|
|
335
335
|
createTool({
|
|
336
336
|
id: "cursor",
|
|
337
337
|
name: "Cursor",
|
|
338
338
|
configFormat: "standard",
|
|
339
339
|
configPath: join3(home, ".cursor", "mcp.json"),
|
|
340
|
-
detect: () => existsSync3(join3(home, ".cursor"))
|
|
340
|
+
detect: () => existsSync3(join3(home, ".cursor")),
|
|
341
|
+
manualHint: "Open Cursor Settings \u2192 Rules \u2192 User Rules and paste the instructions below."
|
|
341
342
|
}),
|
|
342
343
|
createTool({
|
|
343
344
|
id: "windsurf",
|
|
@@ -376,7 +377,8 @@ ${INSTRUCTIONS_END}`;
|
|
|
376
377
|
name: "Zed",
|
|
377
378
|
configFormat: "zed",
|
|
378
379
|
configPath: join3(appSupport, "Zed", "settings.json"),
|
|
379
|
-
detect: () => existsSync3(join3(appSupport, "Zed"))
|
|
380
|
+
detect: () => existsSync3(join3(appSupport, "Zed")),
|
|
381
|
+
manualHint: "Open Rules Library (\u2318\u2325L) \u2192 click + \u2192 paste the instructions below."
|
|
380
382
|
}),
|
|
381
383
|
createTool({
|
|
382
384
|
id: "cline",
|
|
@@ -419,14 +421,16 @@ ${INSTRUCTIONS_END}`;
|
|
|
419
421
|
name: "Amazon Q CLI",
|
|
420
422
|
configFormat: "standard",
|
|
421
423
|
configPath: join3(home, ".aws", "amazonq", "mcp.json"),
|
|
422
|
-
detect: () => hasBinary("q") || existsSync3(join3(home, ".aws", "amazonq"))
|
|
424
|
+
detect: () => hasBinary("q") || existsSync3(join3(home, ".aws", "amazonq")),
|
|
425
|
+
manualHint: "Create .amazonq/rules/useai.md in your project root with the instructions below."
|
|
423
426
|
}),
|
|
424
427
|
createTool({
|
|
425
428
|
id: "amazon-q-ide",
|
|
426
429
|
name: "Amazon Q IDE",
|
|
427
430
|
configFormat: "standard",
|
|
428
431
|
configPath: join3(home, ".aws", "amazonq", "default.json"),
|
|
429
|
-
detect: () => existsSync3(join3(home, ".amazonq")) || existsSync3(join3(home, ".aws", "amazonq"))
|
|
432
|
+
detect: () => existsSync3(join3(home, ".amazonq")) || existsSync3(join3(home, ".aws", "amazonq")),
|
|
433
|
+
manualHint: "Create .amazonq/rules/useai.md in your project root with the instructions below."
|
|
430
434
|
}),
|
|
431
435
|
createTool({
|
|
432
436
|
id: "codex",
|
|
@@ -457,7 +461,8 @@ ${INSTRUCTIONS_END}`;
|
|
|
457
461
|
name: "Junie",
|
|
458
462
|
configFormat: "standard",
|
|
459
463
|
configPath: join3(home, ".junie", "mcp", "mcp.json"),
|
|
460
|
-
detect: () => existsSync3(join3(home, ".junie"))
|
|
464
|
+
detect: () => existsSync3(join3(home, ".junie")),
|
|
465
|
+
manualHint: "Add the instructions below to .junie/guidelines.md in your project root."
|
|
461
466
|
})
|
|
462
467
|
];
|
|
463
468
|
}
|
|
@@ -488,6 +493,21 @@ function err(text) {
|
|
|
488
493
|
function dim(text) {
|
|
489
494
|
return chalk.dim(` ${text}`);
|
|
490
495
|
}
|
|
496
|
+
function showManualHints(installedTools) {
|
|
497
|
+
const hints = installedTools.map((t) => ({ name: t.name, hint: t.getManualHint() })).filter((h) => h.hint !== null);
|
|
498
|
+
if (hints.length === 0) return;
|
|
499
|
+
console.log(chalk.yellow(`
|
|
500
|
+
\u26A0 Manual setup needed for ${hints.length} tool${hints.length === 1 ? "" : "s"}:
|
|
501
|
+
`));
|
|
502
|
+
for (const { name, hint } of hints) {
|
|
503
|
+
console.log(` ${chalk.bold(name)}: ${hint}`);
|
|
504
|
+
}
|
|
505
|
+
console.log(chalk.dim("\n \u250C\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510"));
|
|
506
|
+
for (const line of USEAI_INSTRUCTIONS_TEXT.split("\n")) {
|
|
507
|
+
console.log(chalk.dim(" \u2502 ") + line);
|
|
508
|
+
}
|
|
509
|
+
console.log(chalk.dim(" \u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518\n"));
|
|
510
|
+
}
|
|
491
511
|
function showStatus(tools) {
|
|
492
512
|
console.log(header("AI Tool MCP Status"));
|
|
493
513
|
const rows = [];
|
|
@@ -527,6 +547,7 @@ async function installFlow(tools, autoYes, explicit) {
|
|
|
527
547
|
console.log(err(`\u2717 ${tool.name.padEnd(18)} \u2014 ${e.message}`));
|
|
528
548
|
}
|
|
529
549
|
}
|
|
550
|
+
showManualHints(tools);
|
|
530
551
|
console.log();
|
|
531
552
|
return;
|
|
532
553
|
}
|
|
@@ -592,6 +613,7 @@ async function installFlow(tools, autoYes, explicit) {
|
|
|
592
613
|
} catch {
|
|
593
614
|
}
|
|
594
615
|
}
|
|
616
|
+
showManualHints([...toInstall, ...alreadyConfigured]);
|
|
595
617
|
console.log(`
|
|
596
618
|
Done! UseAI MCP server configured in ${chalk.bold(String(toInstall.length))} tool${toInstall.length === 1 ? "" : "s"}.
|
|
597
619
|
`);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@devness/useai",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.7",
|
|
4
4
|
"description": "Track your AI-assisted development workflow. MCP server that records usage metrics across all your AI tools.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"mcp",
|
|
@@ -28,14 +28,6 @@
|
|
|
28
28
|
"README.md",
|
|
29
29
|
"LICENSE"
|
|
30
30
|
],
|
|
31
|
-
"scripts": {
|
|
32
|
-
"build": "tsc -p tsconfig.build.json",
|
|
33
|
-
"dev": "tsc --watch",
|
|
34
|
-
"bundle": "tsup src/index.ts --format esm --target node18 --no-splitting",
|
|
35
|
-
"prepublishOnly": "pnpm run bundle",
|
|
36
|
-
"typecheck": "tsc --noEmit",
|
|
37
|
-
"clean": "rm -rf dist"
|
|
38
|
-
},
|
|
39
31
|
"dependencies": {
|
|
40
32
|
"@inquirer/prompts": "^8.2.1",
|
|
41
33
|
"@modelcontextprotocol/sdk": "^1.12.1",
|
|
@@ -46,9 +38,9 @@
|
|
|
46
38
|
},
|
|
47
39
|
"devDependencies": {
|
|
48
40
|
"@types/node": "^22.13.4",
|
|
49
|
-
"@useai/shared": "workspace:*",
|
|
50
41
|
"tsup": "^8.0.0",
|
|
51
|
-
"typescript": "^5.7.3"
|
|
42
|
+
"typescript": "^5.7.3",
|
|
43
|
+
"@useai/shared": "0.2.0"
|
|
52
44
|
},
|
|
53
45
|
"repository": {
|
|
54
46
|
"type": "git",
|
|
@@ -57,5 +49,12 @@
|
|
|
57
49
|
"homepage": "https://useai.dev",
|
|
58
50
|
"engines": {
|
|
59
51
|
"node": ">=18"
|
|
52
|
+
},
|
|
53
|
+
"scripts": {
|
|
54
|
+
"build": "tsc -p tsconfig.build.json",
|
|
55
|
+
"dev": "tsc --watch",
|
|
56
|
+
"bundle": "tsup src/index.ts --format esm --target node18 --no-splitting",
|
|
57
|
+
"typecheck": "tsc --noEmit",
|
|
58
|
+
"clean": "rm -rf dist"
|
|
60
59
|
}
|
|
61
|
-
}
|
|
60
|
+
}
|