codemaxxing 1.0.0 → 1.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +18 -12
- package/dist/agent.d.ts +4 -0
- package/dist/agent.js +91 -16
- package/dist/commands/git.d.ts +2 -0
- package/dist/commands/git.js +50 -0
- package/dist/commands/ollama.d.ts +27 -0
- package/dist/commands/ollama.js +171 -0
- package/dist/commands/output.d.ts +2 -0
- package/dist/commands/output.js +18 -0
- package/dist/commands/registry.d.ts +2 -0
- package/dist/commands/registry.js +8 -0
- package/dist/commands/skills.d.ts +18 -0
- package/dist/commands/skills.js +121 -0
- package/dist/commands/types.d.ts +5 -0
- package/dist/commands/types.js +1 -0
- package/dist/commands/ui.d.ts +16 -0
- package/dist/commands/ui.js +79 -0
- package/dist/config.d.ts +9 -0
- package/dist/config.js +13 -3
- package/dist/exec.js +4 -1
- package/dist/index.js +75 -401
- package/dist/tools/files.js +58 -3
- package/dist/utils/context.js +6 -0
- package/dist/utils/mcp.d.ts +7 -2
- package/dist/utils/mcp.js +34 -6
- package/package.json +8 -5
- package/src/agent.ts +0 -894
- package/src/auth-cli.ts +0 -287
- package/src/cli.ts +0 -37
- package/src/config.ts +0 -352
- package/src/exec.ts +0 -183
- package/src/index.tsx +0 -2647
- package/src/skills/registry.ts +0 -1436
- package/src/themes.ts +0 -335
- package/src/tools/files.ts +0 -374
- package/src/utils/auth.ts +0 -606
- package/src/utils/context.ts +0 -174
- package/src/utils/git.ts +0 -117
- package/src/utils/hardware.ts +0 -131
- package/src/utils/lint.ts +0 -116
- package/src/utils/mcp.ts +0 -307
- package/src/utils/models.ts +0 -218
- package/src/utils/ollama.ts +0 -352
- package/src/utils/repomap.ts +0 -220
- package/src/utils/sessions.ts +0 -254
- package/src/utils/skills.ts +0 -241
- package/tsconfig.json +0 -16
package/dist/utils/mcp.js
CHANGED
|
@@ -100,6 +100,20 @@ export function getConnectedServers() {
|
|
|
100
100
|
return connectedServers;
|
|
101
101
|
}
|
|
102
102
|
// ── Tool format conversion ──
|
|
103
|
+
function encodeMcpSegment(value) {
|
|
104
|
+
return Buffer.from(value, "utf-8").toString("base64url");
|
|
105
|
+
}
|
|
106
|
+
function decodeMcpSegment(value) {
|
|
107
|
+
try {
|
|
108
|
+
return Buffer.from(value, "base64url").toString("utf-8");
|
|
109
|
+
}
|
|
110
|
+
catch {
|
|
111
|
+
return null;
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
export function buildMCPToolName(serverName, toolName) {
|
|
115
|
+
return `mcp_${encodeMcpSegment(serverName)}__${encodeMcpSegment(toolName)}`;
|
|
116
|
+
}
|
|
103
117
|
export function getAllMCPTools(servers) {
|
|
104
118
|
const tools = [];
|
|
105
119
|
for (const server of servers) {
|
|
@@ -107,7 +121,7 @@ export function getAllMCPTools(servers) {
|
|
|
107
121
|
tools.push({
|
|
108
122
|
type: "function",
|
|
109
123
|
function: {
|
|
110
|
-
name:
|
|
124
|
+
name: buildMCPToolName(server.name, tool.name),
|
|
111
125
|
description: `[MCP: ${server.name}] ${tool.description ?? tool.name}`,
|
|
112
126
|
parameters: tool.inputSchema,
|
|
113
127
|
},
|
|
@@ -118,21 +132,35 @@ export function getAllMCPTools(servers) {
|
|
|
118
132
|
}
|
|
119
133
|
/**
|
|
120
134
|
* Parse an MCP tool call name to extract server name and tool name.
|
|
121
|
-
*
|
|
122
|
-
*
|
|
135
|
+
*
|
|
136
|
+
* New format (collision-safe):
|
|
137
|
+
* mcp_<base64url(server)>__<base64url(tool)>
|
|
138
|
+
*
|
|
139
|
+
* Legacy format still supported for backwards compatibility:
|
|
140
|
+
* mcp_<serverName>_<toolName>
|
|
123
141
|
*/
|
|
124
142
|
export function parseMCPToolName(fullName) {
|
|
125
143
|
if (!fullName.startsWith("mcp_"))
|
|
126
144
|
return null;
|
|
127
|
-
const rest = fullName.slice(4);
|
|
128
|
-
|
|
145
|
+
const rest = fullName.slice(4);
|
|
146
|
+
const encodedSeparator = rest.indexOf("__");
|
|
147
|
+
if (encodedSeparator !== -1) {
|
|
148
|
+
const serverEncoded = rest.slice(0, encodedSeparator);
|
|
149
|
+
const toolEncoded = rest.slice(encodedSeparator + 2);
|
|
150
|
+
const serverName = decodeMcpSegment(serverEncoded);
|
|
151
|
+
const toolName = decodeMcpSegment(toolEncoded);
|
|
152
|
+
if (serverName && toolName) {
|
|
153
|
+
return { serverName, toolName };
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
// Legacy fallback: find the server by matching known connected server names.
|
|
129
157
|
for (const server of connectedServers) {
|
|
130
158
|
const prefix = server.name + "_";
|
|
131
159
|
if (rest.startsWith(prefix)) {
|
|
132
160
|
return { serverName: server.name, toolName: rest.slice(prefix.length) };
|
|
133
161
|
}
|
|
134
162
|
}
|
|
135
|
-
//
|
|
163
|
+
// Legacy final fallback: split on first underscore.
|
|
136
164
|
const idx = rest.indexOf("_");
|
|
137
165
|
if (idx === -1)
|
|
138
166
|
return null;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "codemaxxing",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.2",
|
|
4
4
|
"description": "Open-source terminal coding agent. Connect any LLM. Max your code.",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"bin": {
|
|
@@ -12,7 +12,8 @@
|
|
|
12
12
|
"build": "tsc",
|
|
13
13
|
"prepare": "tsc",
|
|
14
14
|
"dev": "tsx src/index.tsx",
|
|
15
|
-
"start": "node dist/index.js"
|
|
15
|
+
"start": "node dist/index.js",
|
|
16
|
+
"test": "vitest run"
|
|
16
17
|
},
|
|
17
18
|
"keywords": [
|
|
18
19
|
"ai",
|
|
@@ -43,12 +44,14 @@
|
|
|
43
44
|
"devDependencies": {
|
|
44
45
|
"@types/better-sqlite3": "^7.6.13",
|
|
45
46
|
"@types/node": "^22.0.0",
|
|
46
|
-
"typescript": "^5.5.0"
|
|
47
|
+
"typescript": "^5.5.0",
|
|
48
|
+
"vitest": "^3.2.4"
|
|
49
|
+
},
|
|
50
|
+
"engines": {
|
|
51
|
+
"node": ">=18.0.0"
|
|
47
52
|
},
|
|
48
53
|
"files": [
|
|
49
54
|
"dist",
|
|
50
|
-
"src",
|
|
51
|
-
"tsconfig.json",
|
|
52
55
|
"README.md"
|
|
53
56
|
]
|
|
54
57
|
}
|