Remove DeployProjectTool for now

This commit is contained in:
Alex Gleason committed 2025-12-21 01:11:15 -06:00
1 parent 91130cbd89
commit 0689f1cbf7
3 files changed
+2 -78

No files matched your search

+1 -2
View File
@@ -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`
+1 -7
View File
@@ -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<ChatPaneRef, ChatPaneProps>(({
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<ChatPaneRef, ChatPaneProps>(({
}
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]);
-69
View File
@@ -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<DeployProjectParams> {
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<ToolResult> {
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)}`);
}
}
}