mirror of
https://gitlab.com/soapbox-pub/shakespeare.git
synced 2026-12-05 16:23:36 +00:00
Remove DeployProjectTool for now
This commit is contained in:
3 files changed
+2
-78
No files matched your search
@@ -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`
|
||||
|
||||
@@ -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]);
|
||||
|
||||
@@ -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)}`);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user