diff --git a/AGENTS.md b/AGENTS.md index e8ead5f9..4c86b836 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -41,7 +41,6 @@ Shakespeare provides AI agents with specialized tools for project development (n - **NpmAddPackageTool**: Add npm packages to projects - **NpmRemovePackageTool**: Remove npm packages from projects - **GitCommitTool**: Commit changes to Git repositories -- **DeployProjectTool**: Deploy projects to hosting platforms - **ReadWebpageTool**: Fetch and read web pages - **NostrReadNipTool**: Read Nostr protocol NIP documents - **NostrReadKindTool**: Read Nostr event kind documentation @@ -240,7 +239,7 @@ This project is a Nostr client application built with React 18.x, TailwindCSS 3. - Unix-style commands: `cat`, `cd`, `cp`, `find`, `grep`, `ls`, `mkdir`, `mv`, `rm`, etc. - `/src/lib/tools/`: AI tool implementations for project development - File operations: `TextEditorViewTool`, `TextEditorWriteTool`, `TextEditorStrReplaceTool` - - Project tools: `BuildProjectTool`, `DeployProjectTool` + - Project tools: `BuildProjectTool` - Package management: `NpmAddPackageTool`, `NpmRemovePackageTool` - Git integration: `GitCommitTool` - Shell access: `ShellTool` diff --git a/src/components/Shakespeare/ChatPane.tsx b/src/components/Shakespeare/ChatPane.tsx index 8b09de53..03ee7f06 100644 --- a/src/components/Shakespeare/ChatPane.tsx +++ b/src/components/Shakespeare/ChatPane.tsx @@ -24,7 +24,6 @@ import { NpmAddPackageTool } from '@/lib/tools/NpmAddPackageTool'; import { NpmRemovePackageTool } from '@/lib/tools/NpmRemovePackageTool'; import { GitCommitTool } from '@/lib/tools/GitCommitTool'; import { BuildProjectTool } from '@/lib/tools/BuildProjectTool'; -import { DeployProjectTool } from '@/lib/tools/DeployProjectTool'; import { NostrReadNipTool } from '@/lib/tools/NostrReadNipTool'; import { NostrFetchEventTool } from '@/lib/tools/NostrFetchEventTool'; import { NostrReadKindTool } from '@/lib/tools/NostrReadKindTool'; @@ -185,11 +184,6 @@ export const ChatPane = forwardRef(({ skill: new SkillTool(fs, pluginsPath, cwd), }; - // Add deploy tool only if user is logged in - if (user && user.signer) { - tools.deploy_project = new DeployProjectTool(fs, cwd, user.signer, projectId); - } - // Add generate_image tool if imageModel is configured if (settings.imageModel) { try { @@ -239,7 +233,7 @@ export const ChatPane = forwardRef(({ } return tools; - }, [fs, git, cwd, user, projectId, projectsPath, tmpPath, pluginsPath, config.corsProxy, settings, aiSettings, models, handleFileChanged]); + }, [fs, git, cwd, user, projectsPath, tmpPath, pluginsPath, config.corsProxy, settings, aiSettings, models, handleFileChanged]); // MCP tools wrapped for execution const mcpToolWrappers = useMemo(() => createMCPTools(mcpClients), [mcpClients]); diff --git a/src/lib/tools/DeployProjectTool.ts b/src/lib/tools/DeployProjectTool.ts deleted file mode 100644 index 3d9df33d..00000000 --- a/src/lib/tools/DeployProjectTool.ts +++ /dev/null @@ -1,69 +0,0 @@ -import { z } from "zod"; - -import type { Tool, ToolResult } from "./Tool"; -import type { JSRuntimeFS } from "../JSRuntime"; -import { ShakespeareAdapter } from "../deploy"; -import type { NostrSigner } from "@nostrify/nostrify"; - -interface DeployProjectParams { - deployServer?: string; -} - -export class DeployProjectTool implements Tool { - private fs: JSRuntimeFS; - private cwd: string; - private signer: NostrSigner; - private projectId: string; - - readonly description = "Deploy the project to a hosting server using NIP-98 authentication. Creates a ZIP of the dist directory and uploads it to the deployment server. Requires the user to be logged in with Nostr."; - - readonly inputSchema = z.object({ - deployServer: z.string().optional().describe("Deploy server domain (e.g., 'shakespeare.wtf'). If not provided, uses the default configured server."), - }); - - constructor(fs: JSRuntimeFS, cwd: string, signer: NostrSigner, projectId: string) { - this.fs = fs; - this.cwd = cwd; - this.signer = signer; - this.projectId = projectId; - } - - async execute(args: DeployProjectParams): Promise { - try { - // Use provided deployServer or default to shakespeare.wtf - const deployServer = args.deployServer || "shakespeare.wtf"; - - // Check if we're in a valid project directory - try { - await this.fs.readFile(`${this.cwd}/package.json`, "utf8"); - } catch { - throw new Error(`āŒ Could not find package.json at ${this.cwd}. Make sure you're in a valid project directory.`); - } - - // Check if dist directory exists and contains index.html - try { - await this.fs.readFile(`${this.cwd}/dist/index.html`, "utf8"); - } catch { - throw new Error(`āŒ Could not find index.html in dist directory. Please build the project first using the build tool.`); - } - - // Deploy the project using ShakespeareAdapter - const adapter = new ShakespeareAdapter({ - fs: this.fs, - signer: this.signer, - host: deployServer, - }); - - const result = await adapter.deploy({ - projectId: this.projectId, - projectPath: this.cwd, - }); - - return { - content: `āœ… Successfully deployed project!\n\n🌐 Live URL: ${result.url}\n\nšŸš€ Your project is now live and accessible to anyone with the URL!` - }; - } catch (error) { - throw new Error(`āŒ Deployment failed: ${String(error)}`); - } - } -} \ No newline at end of file