generated from nhcarrigan/template
Compare commits
4 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 79de8ace44 | |||
|
7a1ab89ad8
|
|||
| c4af551375 | |||
| b88f25a61b |
+2
-2
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "hikari-desktop",
|
"name": "hikari-desktop",
|
||||||
"version": "1.13.0",
|
"version": "1.14.0",
|
||||||
"description": "",
|
"description": "",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
@@ -56,7 +56,7 @@
|
|||||||
"@tauri-apps/api": "2.10.1",
|
"@tauri-apps/api": "2.10.1",
|
||||||
"@tauri-apps/plugin-clipboard-manager": "2.3.2",
|
"@tauri-apps/plugin-clipboard-manager": "2.3.2",
|
||||||
"@tauri-apps/plugin-dialog": "2.6.0",
|
"@tauri-apps/plugin-dialog": "2.6.0",
|
||||||
"@tauri-apps/plugin-fs": "2.4.5",
|
"@tauri-apps/plugin-fs": "2.5.0",
|
||||||
"@tauri-apps/plugin-notification": "2.3.3",
|
"@tauri-apps/plugin-notification": "2.3.3",
|
||||||
"@tauri-apps/plugin-opener": "2.5.3",
|
"@tauri-apps/plugin-opener": "2.5.3",
|
||||||
"@tauri-apps/plugin-os": "2.3.2",
|
"@tauri-apps/plugin-os": "2.3.2",
|
||||||
|
|||||||
Generated
+5
-5
@@ -96,8 +96,8 @@ importers:
|
|||||||
specifier: 2.6.0
|
specifier: 2.6.0
|
||||||
version: 2.6.0
|
version: 2.6.0
|
||||||
'@tauri-apps/plugin-fs':
|
'@tauri-apps/plugin-fs':
|
||||||
specifier: 2.4.5
|
specifier: 2.5.0
|
||||||
version: 2.4.5
|
version: 2.5.0
|
||||||
'@tauri-apps/plugin-notification':
|
'@tauri-apps/plugin-notification':
|
||||||
specifier: 2.3.3
|
specifier: 2.3.3
|
||||||
version: 2.3.3
|
version: 2.3.3
|
||||||
@@ -993,8 +993,8 @@ packages:
|
|||||||
'@tauri-apps/plugin-dialog@2.6.0':
|
'@tauri-apps/plugin-dialog@2.6.0':
|
||||||
resolution: {integrity: sha512-q4Uq3eY87TdcYzXACiYSPhmpBA76shgmQswGkSVio4C82Sz2W4iehe9TnKYwbq7weHiL88Yw19XZm7v28+Micg==}
|
resolution: {integrity: sha512-q4Uq3eY87TdcYzXACiYSPhmpBA76shgmQswGkSVio4C82Sz2W4iehe9TnKYwbq7weHiL88Yw19XZm7v28+Micg==}
|
||||||
|
|
||||||
'@tauri-apps/plugin-fs@2.4.5':
|
'@tauri-apps/plugin-fs@2.5.0':
|
||||||
resolution: {integrity: sha512-dVxWWGE6VrOxC7/jlhyE+ON/Cc2REJlM35R3PJX3UvFw2XwYhLGQVAIyrehenDdKjotipjYEVc4YjOl3qq90fA==}
|
resolution: {integrity: sha512-c83kbz61AK+rKjhS+je9+stIO27nXj7p9cqeg36TwkIUtxpCFTttlHHtqon6h6FN54cXjyAjlMPOJcW3mwE5XQ==}
|
||||||
|
|
||||||
'@tauri-apps/plugin-notification@2.3.3':
|
'@tauri-apps/plugin-notification@2.3.3':
|
||||||
resolution: {integrity: sha512-Zw+ZH18RJb41G4NrfHgIuofJiymusqN+q8fGUIIV7vyCH+5sSn5coqRv/MWB9qETsUs97vmU045q7OyseCV3Qg==}
|
resolution: {integrity: sha512-Zw+ZH18RJb41G4NrfHgIuofJiymusqN+q8fGUIIV7vyCH+5sSn5coqRv/MWB9qETsUs97vmU045q7OyseCV3Qg==}
|
||||||
@@ -2935,7 +2935,7 @@ snapshots:
|
|||||||
dependencies:
|
dependencies:
|
||||||
'@tauri-apps/api': 2.10.1
|
'@tauri-apps/api': 2.10.1
|
||||||
|
|
||||||
'@tauri-apps/plugin-fs@2.4.5':
|
'@tauri-apps/plugin-fs@2.5.0':
|
||||||
dependencies:
|
dependencies:
|
||||||
'@tauri-apps/api': 2.10.1
|
'@tauri-apps/api': 2.10.1
|
||||||
|
|
||||||
|
|||||||
Generated
+1
-1
@@ -1648,7 +1648,7 @@ checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70"
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "hikari-desktop"
|
name = "hikari-desktop"
|
||||||
version = "1.13.0"
|
version = "1.14.0"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"chrono",
|
"chrono",
|
||||||
"dirs 5.0.1",
|
"dirs 5.0.1",
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "hikari-desktop"
|
name = "hikari-desktop"
|
||||||
version = "1.13.0"
|
version = "1.14.0"
|
||||||
description = "Hikari - Claude Code Visual Assistant"
|
description = "Hikari - Claude Code Visual Assistant"
|
||||||
authors = ["Naomi Carrigan"]
|
authors = ["Naomi Carrigan"]
|
||||||
edition = "2021"
|
edition = "2021"
|
||||||
|
|||||||
@@ -2618,10 +2618,67 @@ pub async fn open_binary_file(app: AppHandle, path: String) -> Result<(), String
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// Read `~/.claude/CLAUDE.md` via WSL (for Windows).
|
||||||
|
/// Returns an empty string if the file does not exist.
|
||||||
|
#[cfg(target_os = "windows")]
|
||||||
|
async fn get_global_claude_md_via_wsl() -> Result<String, String> {
|
||||||
|
use std::process::Command;
|
||||||
|
|
||||||
|
let output = Command::new("wsl")
|
||||||
|
.hide_window()
|
||||||
|
.args(["-e", "bash", "-l", "-c", "cat ~/.claude/CLAUDE.md 2>/dev/null || true"])
|
||||||
|
.output()
|
||||||
|
.map_err(|e| format!("Failed to execute WSL command: {}", e))?;
|
||||||
|
|
||||||
|
Ok(String::from_utf8_lossy(&output.stdout).to_string())
|
||||||
|
}
|
||||||
|
|
||||||
|
/// Write content to `~/.claude/CLAUDE.md` via WSL (for Windows).
|
||||||
|
/// Creates the file (and `~/.claude/` directory) if they do not exist.
|
||||||
|
#[cfg(target_os = "windows")]
|
||||||
|
async fn save_global_claude_md_via_wsl(content: String) -> Result<(), String> {
|
||||||
|
use std::io::Write;
|
||||||
|
use std::process::{Command, Stdio};
|
||||||
|
|
||||||
|
let mut child = Command::new("wsl")
|
||||||
|
.hide_window()
|
||||||
|
.args([
|
||||||
|
"-e",
|
||||||
|
"bash",
|
||||||
|
"-l",
|
||||||
|
"-c",
|
||||||
|
"mkdir -p ~/.claude && cat > ~/.claude/CLAUDE.md",
|
||||||
|
])
|
||||||
|
.stdin(Stdio::piped())
|
||||||
|
.spawn()
|
||||||
|
.map_err(|e| format!("Failed to execute WSL command: {}", e))?;
|
||||||
|
|
||||||
|
if let Some(stdin) = child.stdin.as_mut() {
|
||||||
|
stdin
|
||||||
|
.write_all(content.as_bytes())
|
||||||
|
.map_err(|e| format!("Failed to write content to WSL stdin: {}", e))?;
|
||||||
|
}
|
||||||
|
|
||||||
|
let status = child
|
||||||
|
.wait()
|
||||||
|
.map_err(|e| format!("Failed to wait for WSL command: {}", e))?;
|
||||||
|
|
||||||
|
if !status.success() {
|
||||||
|
return Err("Failed to save CLAUDE.md via WSL".to_string());
|
||||||
|
}
|
||||||
|
|
||||||
|
Ok(())
|
||||||
|
}
|
||||||
|
|
||||||
/// Read the contents of `~/.claude/CLAUDE.md`.
|
/// Read the contents of `~/.claude/CLAUDE.md`.
|
||||||
/// Returns an empty string if the file does not exist.
|
/// Returns an empty string if the file does not exist.
|
||||||
#[tauri::command]
|
#[tauri::command]
|
||||||
pub async fn get_global_claude_md() -> Result<String, String> {
|
pub async fn get_global_claude_md() -> Result<String, String> {
|
||||||
|
#[cfg(target_os = "windows")]
|
||||||
|
return get_global_claude_md_via_wsl().await;
|
||||||
|
|
||||||
|
#[cfg(not(target_os = "windows"))]
|
||||||
|
{
|
||||||
let path = dirs::home_dir()
|
let path = dirs::home_dir()
|
||||||
.ok_or_else(|| "Could not determine home directory".to_string())?
|
.ok_or_else(|| "Could not determine home directory".to_string())?
|
||||||
.join(".claude")
|
.join(".claude")
|
||||||
@@ -2633,11 +2690,17 @@ pub async fn get_global_claude_md() -> Result<String, String> {
|
|||||||
|
|
||||||
std::fs::read_to_string(&path).map_err(|e| format!("Failed to read CLAUDE.md: {}", e))
|
std::fs::read_to_string(&path).map_err(|e| format!("Failed to read CLAUDE.md: {}", e))
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/// Write content to `~/.claude/CLAUDE.md`.
|
/// Write content to `~/.claude/CLAUDE.md`.
|
||||||
/// Creates the file (and `~/.claude/` directory) if they do not exist.
|
/// Creates the file (and `~/.claude/` directory) if they do not exist.
|
||||||
#[tauri::command]
|
#[tauri::command]
|
||||||
pub async fn save_global_claude_md(content: String) -> Result<(), String> {
|
pub async fn save_global_claude_md(content: String) -> Result<(), String> {
|
||||||
|
#[cfg(target_os = "windows")]
|
||||||
|
return save_global_claude_md_via_wsl(content).await;
|
||||||
|
|
||||||
|
#[cfg(not(target_os = "windows"))]
|
||||||
|
{
|
||||||
let claude_dir = dirs::home_dir()
|
let claude_dir = dirs::home_dir()
|
||||||
.ok_or_else(|| "Could not determine home directory".to_string())?
|
.ok_or_else(|| "Could not determine home directory".to_string())?
|
||||||
.join(".claude");
|
.join(".claude");
|
||||||
@@ -2650,6 +2713,7 @@ pub async fn save_global_claude_md(content: String) -> Result<(), String> {
|
|||||||
let path = claude_dir.join("CLAUDE.md");
|
let path = claude_dir.join("CLAUDE.md");
|
||||||
std::fs::write(&path, content).map_err(|e| format!("Failed to write CLAUDE.md: {}", e))
|
std::fs::write(&path, content).map_err(|e| format!("Failed to write CLAUDE.md: {}", e))
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
mod tests {
|
mod tests {
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"$schema": "https://schema.tauri.app/config/2",
|
"$schema": "https://schema.tauri.app/config/2",
|
||||||
"productName": "hikari-desktop",
|
"productName": "hikari-desktop",
|
||||||
"version": "1.13.0",
|
"version": "1.14.0",
|
||||||
"identifier": "com.naomi.hikari-desktop",
|
"identifier": "com.naomi.hikari-desktop",
|
||||||
"build": {
|
"build": {
|
||||||
"beforeDevCommand": "pnpm dev",
|
"beforeDevCommand": "pnpm dev",
|
||||||
|
|||||||
Reference in New Issue
Block a user