
Security News
Feross on the 10 Minutes or Less Podcast: Nobody Reads the Code
Socket CEO Feross Aboukhadijeh joins 10 Minutes or Less, a podcast by Ali Rohde, to discuss the recent surge in open source supply chain attacks.
qcsku-agent
Advanced tools

A starter template for building AI-powered chat agents using Cloudflare's Agent platform, powered by agents. This project provides a foundation for creating interactive chat experiences with AI, complete with a modern UI and tool integration capabilities.
Create a .dev.vars file:
OPENAI_API_KEY=your_openai_api_key
npm start
npm run deploy
├── src/
│ ├── app.tsx # Chat UI implementation
│ ├── server.ts # Chat agent logic
│ ├── tools.ts # Tool definitions
│ ├── utils.ts # Helper functions
│ └── styles.css # UI styling
Add new tools in tools.ts using the tool builder:
// Example of a tool that requires confirmation
const searchDatabase = tool({
description: "Search the database for user records",
parameters: z.object({
query: z.string(),
limit: z.number().optional()
})
// No execute function = requires confirmation
});
// Example of an auto-executing tool
const getCurrentTime = tool({
description: "Get current server time",
parameters: z.object({}),
execute: async () => new Date().toISOString()
});
// Scheduling tool implementation
const scheduleTask = tool({
description:
"schedule a task to be executed at a later time. 'when' can be a date, a delay in seconds, or a cron pattern.",
parameters: z.object({
type: z.enum(["scheduled", "delayed", "cron"]),
when: z.union([z.number(), z.string()]),
payload: z.string()
}),
execute: async ({ type, when, payload }) => {
// ... see the implementation in tools.ts
}
});
To handle tool confirmations, add execution functions to the executions object:
export const executions = {
searchDatabase: async ({
query,
limit
}: {
query: string;
limit?: number;
}) => {
// Implementation for when the tool is confirmed
const results = await db.search(query, limit);
return results;
}
// Add more execution handlers for other tools that require confirmation
};
Tools can be configured in two ways:
execute function for automatic executionexecute function, requiring confirmation and using the executions object to handle the confirmed action. NOTE: The keys in executions should match toolsRequiringConfirmation in app.tsx.The starting server.ts implementation uses the ai-sdk and the OpenAI provider, but you can use any AI model provider by:
ai-sdk, such as the workers-ai-provider or anthropic provider:For example, to use the workers-ai-provider, install the package:
npm install workers-ai-provider
Add an ai binding to wrangler.jsonc:
// rest of file
"ai": {
"binding": "AI"
}
// rest of file
Replace the @ai-sdk/openai import and usage with the workers-ai-provider:
// server.ts
// Change the imports
- import { openai } from "@ai-sdk/openai";
+ import { createWorkersAI } from 'workers-ai-provider';
// Create a Workers AI instance
+ const workersai = createWorkersAI({ binding: env.AI });
// Use it when calling the streamText method (or other methods)
// from the ai-sdk
- const model = openai("gpt-4o-2024-11-20");
+ const model = workersai("@cf/deepseek-ai/deepseek-r1-distill-qwen-32b")
Commit your changes and then run the agents-starter as per the rest of this README.
The chat interface is built with React and can be customized in app.tsx:
styles.cssCustomer Support Agent
Development Assistant
Data Analysis Assistant
Personal Productivity Assistant
Scheduling Assistant
Each use case can be implemented by:
tools.tsserver.tsFAQs

We found that qcsku-agent demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Socket CEO Feross Aboukhadijeh joins 10 Minutes or Less, a podcast by Ali Rohde, to discuss the recent surge in open source supply chain attacks.

Research
/Security News
Campaign of 108 extensions harvests identities, steals sessions, and adds backdoors to browsers, all tied to the same C2 infrastructure.

Security News
OpenAI rotated macOS signing certificates after a malicious Axios package reached its CI pipeline in a broader software supply chain attack.