@kirosnn/mosaic 0.73.0 → 0.74.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/README.md CHANGED
@@ -5,7 +5,7 @@
5
5
  <h1 align="center">Mosaic CLI</h1>
6
6
 
7
7
  <p align="center">
8
- <strong>Version 0.73.0</strong>
8
+ <strong>Version 0.74.0</strong>
9
9
  </p>
10
10
 
11
11
  <p align="center">
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kirosnn/mosaic",
3
- "version": "0.73.0",
3
+ "version": "0.74.0",
4
4
  "description": "The open source coding agent.",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -5,7 +5,7 @@ import { getToolsPrompt } from './toolsPrompt';
5
5
 
6
6
  export const DEFAULT_SYSTEM_PROMPT = `You are Mosaic, an AI coding agent operating in the user's terminal.
7
7
  You assist with software engineering tasks: coding, debugging, refactoring, testing, and documentation.
8
- Version : 0.73.0 *(Beta)*
8
+ Version : 0.74.0 *(Beta)*
9
9
 
10
10
  # Environment
11
11
 
@@ -1,3 +1,9 @@
1
+ import { NATIVE_SERVER_IDS } from '../../mcp/types';
2
+
3
+ const NATIVE_SERVER_LABELS: Record<string, string> = {
4
+ navigation: 'Browser Navigation',
5
+ };
6
+
1
7
  export const TOOLS_PROMPT = `
2
8
  # Available Tools
3
9
 
@@ -235,8 +241,63 @@ export function getToolsPrompt(mcpToolInfos?: Array<{ serverId: string; name: st
235
241
  return TOOLS_PROMPT;
236
242
  }
237
243
 
238
- const mcpSection = buildMcpToolsSection(mcpToolInfos);
239
- return TOOLS_PROMPT + '\n\n' + mcpSection;
244
+ const nativeTools = mcpToolInfos.filter(t => NATIVE_SERVER_IDS.has(t.serverId));
245
+ const externalTools = mcpToolInfos.filter(t => !NATIVE_SERVER_IDS.has(t.serverId));
246
+
247
+ let result = TOOLS_PROMPT;
248
+
249
+ if (nativeTools.length > 0) {
250
+ result += '\n\n' + buildNativeToolsSection(nativeTools);
251
+ }
252
+
253
+ if (externalTools.length > 0) {
254
+ result += '\n\n' + buildMcpToolsSection(externalTools);
255
+ }
256
+
257
+ return result;
258
+ }
259
+
260
+ function buildNativeToolsSection(tools: Array<{ serverId: string; name: string; description: string; inputSchema: Record<string, unknown>; canonicalId: string; safeId: string }>): string {
261
+ const lines: string[] = [];
262
+
263
+ const byServer = new Map<string, typeof tools>();
264
+ for (const t of tools) {
265
+ const list = byServer.get(t.serverId) || [];
266
+ list.push(t);
267
+ byServer.set(t.serverId, list);
268
+ }
269
+
270
+ for (const [serverId, serverTools] of byServer) {
271
+ const label = NATIVE_SERVER_LABELS[serverId] || serverId.charAt(0).toUpperCase() + serverId.slice(1);
272
+ lines.push(`## ${label}`);
273
+ lines.push('');
274
+
275
+ for (const t of serverTools) {
276
+ lines.push(`### ${t.safeId}`);
277
+ if (t.description) {
278
+ lines.push(t.description);
279
+ }
280
+ const schema = t.inputSchema;
281
+ if (schema && typeof schema === 'object' && schema.properties) {
282
+ const props = schema.properties as Record<string, Record<string, unknown>>;
283
+ const required = (schema.required || []) as string[];
284
+ const paramLines: string[] = [];
285
+ for (const [key, propSchema] of Object.entries(props)) {
286
+ const type = propSchema.type || 'unknown';
287
+ const desc = propSchema.description || '';
288
+ const req = required.includes(key) ? 'required' : 'optional';
289
+ paramLines.push(`- ${key} (${type}, ${req})${desc ? ': ' + desc : ''}`);
290
+ }
291
+ if (paramLines.length > 0) {
292
+ lines.push('Parameters:');
293
+ lines.push(...paramLines);
294
+ }
295
+ }
296
+ lines.push('');
297
+ }
298
+ }
299
+
300
+ return lines.join('\n');
240
301
  }
241
302
 
242
303
  function buildMcpToolsSection(tools: Array<{ serverId: string; name: string; description: string; inputSchema: Record<string, unknown>; canonicalId: string; safeId: string }>): string {
@@ -283,4 +344,4 @@ function buildMcpToolsSection(tools: Array<{ serverId: string; name: string; des
283
344
  }
284
345
 
285
346
  return lines.join('\n');
286
- }
347
+ }