feat(planning): grille hebdomadaire complète avec API et filtres
- Connexion API via proxy Angular (résolution CORS, base path /api) - Import CSS ng-zorro global pour les modales et composants - Filtres Camion/Show câblés sur l'affichage de la grille - Camions affichés via TrucksService (linkés au show du même créneau) - Panneau de détails : spectacles + camions du jour sélectionné - Modale de création de spectacle stylisée avec fond et centrage - Positionnement précis des events à la minute dans leur créneau - Auto-scroll vers l'heure courante au chargement - Ligne "maintenant" sur la colonne du jour actuel - Régénération des services OpenAPI (nouveaux noms de types) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Generated
Vendored
+22
-23
@@ -1,48 +1,47 @@
|
||||
// Run with: npx tsx src/examples/server/toolWithSampleServer.ts
|
||||
import { McpServer } from '../../server/mcp.js';
|
||||
import { StdioServerTransport } from '../../server/stdio.js';
|
||||
import * as z from 'zod/v4';
|
||||
import { McpServer } from "../../server/mcp.js";
|
||||
import { StdioServerTransport } from "../../server/stdio.js";
|
||||
import { z } from "zod";
|
||||
const mcpServer = new McpServer({
|
||||
name: 'tools-with-sample-server',
|
||||
version: '1.0.0'
|
||||
name: "tools-with-sample-server",
|
||||
version: "1.0.0",
|
||||
});
|
||||
// Tool that uses LLM sampling to summarize any text
|
||||
mcpServer.registerTool('summarize', {
|
||||
description: 'Summarize any text using an LLM',
|
||||
mcpServer.registerTool("summarize", {
|
||||
description: "Summarize any text using an LLM",
|
||||
inputSchema: {
|
||||
text: z.string().describe('Text to summarize')
|
||||
}
|
||||
text: z.string().describe("Text to summarize"),
|
||||
},
|
||||
}, async ({ text }) => {
|
||||
// Call the LLM through MCP sampling
|
||||
const response = await mcpServer.server.createMessage({
|
||||
messages: [
|
||||
{
|
||||
role: 'user',
|
||||
role: "user",
|
||||
content: {
|
||||
type: 'text',
|
||||
text: `Please summarize the following text concisely:\n\n${text}`
|
||||
}
|
||||
}
|
||||
type: "text",
|
||||
text: `Please summarize the following text concisely:\n\n${text}`,
|
||||
},
|
||||
},
|
||||
],
|
||||
maxTokens: 500
|
||||
maxTokens: 500,
|
||||
});
|
||||
// Since we're not passing tools param to createMessage, response.content is single content
|
||||
return {
|
||||
content: [
|
||||
{
|
||||
type: 'text',
|
||||
text: response.content.type === 'text' ? response.content.text : 'Unable to generate summary'
|
||||
}
|
||||
]
|
||||
type: "text",
|
||||
text: response.content.type === "text" ? response.content.text : "Unable to generate summary",
|
||||
},
|
||||
],
|
||||
};
|
||||
});
|
||||
async function main() {
|
||||
const transport = new StdioServerTransport();
|
||||
await mcpServer.connect(transport);
|
||||
console.log('MCP server is running...');
|
||||
console.log("MCP server is running...");
|
||||
}
|
||||
main().catch(error => {
|
||||
console.error('Server error:', error);
|
||||
main().catch((error) => {
|
||||
console.error("Server error:", error);
|
||||
process.exit(1);
|
||||
});
|
||||
//# sourceMappingURL=toolWithSampleServer.js.map
|
||||
Reference in New Issue
Block a user