Initial import: open-design source for helix-mind.ai distribution
Some checks failed
ci / Validate workspace (push) Successful in 12m32s
landing-page-ci / Validate landing page (push) Successful in 9m41s
landing-page-deploy / Deploy landing page (push) Failing after 5m23s
github-metrics / Generate repository metrics SVG (push) Failing after 2m6s
refresh-contributors-wall / Refresh contributors wall cache bust (push) Failing after 12s
Some checks failed
ci / Validate workspace (push) Successful in 12m32s
landing-page-ci / Validate landing page (push) Successful in 9m41s
landing-page-deploy / Deploy landing page (push) Failing after 5m23s
github-metrics / Generate repository metrics SVG (push) Failing after 2m6s
refresh-contributors-wall / Refresh contributors wall cache bust (push) Failing after 12s
This repository contains the open-design daemon CLI source code, built and packaged at https://helix-mind.ai/cli/open-design/latest.tgz for use by the HelixMind /design slash command. Licenses: Apache-2.0 (root) + MIT (skills/*)
This commit is contained in:
95
tools/launcher/OpenDesignLauncher.cs
Normal file
95
tools/launcher/OpenDesignLauncher.cs
Normal file
@@ -0,0 +1,95 @@
|
||||
using System;
|
||||
using System.Diagnostics;
|
||||
using System.IO;
|
||||
|
||||
namespace OpenDesignLauncher
|
||||
{
|
||||
internal static class Program
|
||||
{
|
||||
private static int Main()
|
||||
{
|
||||
Console.Title = "Open Design Launcher";
|
||||
Console.WriteLine("Open Design launcher");
|
||||
Console.WriteLine();
|
||||
|
||||
string repoRoot = FindRepoRoot(AppDomain.CurrentDomain.BaseDirectory);
|
||||
if (repoRoot == null)
|
||||
{
|
||||
Console.Error.WriteLine("Could not find the Open Design repository root.");
|
||||
Console.Error.WriteLine("Place OpenDesign.exe in the repository root next to package.json.");
|
||||
Pause();
|
||||
return 1;
|
||||
}
|
||||
|
||||
Console.WriteLine("Repository: " + repoRoot);
|
||||
|
||||
if (!Directory.Exists(Path.Combine(repoRoot, "node_modules", ".pnpm")))
|
||||
{
|
||||
Console.WriteLine("Dependencies are missing. Running pnpm install first...");
|
||||
// Requires corepack (bundled with Node 16.9+) so future maintainers know the dependency.
|
||||
int installExit = RunCommand(repoRoot, "corepack pnpm install");
|
||||
if (installExit != 0)
|
||||
{
|
||||
Console.Error.WriteLine("pnpm install failed with exit code " + installExit + ".");
|
||||
Pause();
|
||||
return installExit;
|
||||
}
|
||||
}
|
||||
|
||||
Console.WriteLine("Starting Open Design with pnpm tools-dev...");
|
||||
Console.WriteLine();
|
||||
int exitCode = RunCommand(repoRoot, "corepack pnpm tools-dev");
|
||||
if (exitCode != 0)
|
||||
{
|
||||
Console.Error.WriteLine();
|
||||
Console.Error.WriteLine("Open Design exited with code " + exitCode + ".");
|
||||
Pause();
|
||||
}
|
||||
else
|
||||
{
|
||||
Console.WriteLine();
|
||||
Console.WriteLine("Open Design command completed. Press any key to close this window.");
|
||||
Console.ReadKey(true);
|
||||
}
|
||||
|
||||
return exitCode;
|
||||
}
|
||||
|
||||
private static string FindRepoRoot(string startDirectory)
|
||||
{
|
||||
DirectoryInfo current = new DirectoryInfo(startDirectory);
|
||||
while (current != null)
|
||||
{
|
||||
string packageJson = Path.Combine(current.FullName, "package.json");
|
||||
string workspace = Path.Combine(current.FullName, "pnpm-workspace.yaml");
|
||||
if (File.Exists(packageJson) && File.Exists(workspace))
|
||||
{
|
||||
return current.FullName;
|
||||
}
|
||||
current = current.Parent;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
private static int RunCommand(string workingDirectory, string command)
|
||||
{
|
||||
ProcessStartInfo info = new ProcessStartInfo();
|
||||
info.FileName = "cmd.exe";
|
||||
info.Arguments = "/d /c \"" + command + "\"";
|
||||
info.WorkingDirectory = workingDirectory;
|
||||
info.UseShellExecute = false;
|
||||
|
||||
using (Process process = Process.Start(info))
|
||||
{
|
||||
process.WaitForExit();
|
||||
return process.ExitCode;
|
||||
}
|
||||
}
|
||||
|
||||
private static void Pause()
|
||||
{
|
||||
Console.WriteLine("Press any key to close this window.");
|
||||
Console.ReadKey(true);
|
||||
}
|
||||
}
|
||||
}
|
||||
34
tools/launcher/README.md
Normal file
34
tools/launcher/README.md
Normal file
@@ -0,0 +1,34 @@
|
||||
# Open Design Windows Launcher
|
||||
|
||||
`OpenDesignLauncher.cs` builds a small Windows console executable that starts the
|
||||
local development app without typing the normal commands by hand.
|
||||
|
||||
The compiled `OpenDesign.exe` is intentionally not committed to git. Build it
|
||||
locally when you want the shortcut, or download a trusted build from GitHub
|
||||
Releases if the project publishes one.
|
||||
|
||||
## Build
|
||||
|
||||
From the repository root on Windows:
|
||||
|
||||
```powershell
|
||||
C:\Windows\Microsoft.NET\Framework64\v4.0.30319\csc.exe /target:exe /out:OpenDesign.exe /win32icon:tools\pack\resources\win\icon.ico tools\launcher\OpenDesignLauncher.cs
|
||||
```
|
||||
|
||||
If your Windows installation only has the 32-bit .NET Framework compiler, use:
|
||||
|
||||
```powershell
|
||||
C:\Windows\Microsoft.NET\Framework\v4.0.30319\csc.exe /target:exe /out:OpenDesign.exe /win32icon:tools\pack\resources\win\icon.ico tools\launcher\OpenDesignLauncher.cs
|
||||
```
|
||||
|
||||
## Run
|
||||
|
||||
Place the built `OpenDesign.exe` in the repository root next to `package.json`,
|
||||
then double-click it.
|
||||
|
||||
The launcher checks for dependencies and runs:
|
||||
|
||||
```powershell
|
||||
corepack pnpm install
|
||||
corepack pnpm tools-dev
|
||||
```
|
||||
Reference in New Issue
Block a user