create-keel-and-deck-app 0.1.0 → 0.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-keel-and-deck-app",
3
- "version": "0.1.0",
3
+ "version": "0.1.2",
4
4
  "description": "Scaffold a Tauri 2 + React desktop app with the keel-and-deck framework",
5
5
  "type": "module",
6
6
  "bin": {
@@ -54,7 +54,7 @@ pub async fn add_channel(
54
54
  .execute(
55
55
  "INSERT INTO channels (id, channel_type, name, status, config, created_at) \
56
56
  VALUES (?1, ?2, ?3, 'disconnected', ?4, ?5)",
57
- [&id, &channel_type, &name, &config_str, &now],
57
+ [id.as_str(), channel_type.as_str(), name.as_str(), config_str.as_str(), now.as_str()],
58
58
  )
59
59
  .await
60
60
  .map_err(|e| e.to_string())?;
@@ -77,7 +77,7 @@ pub async fn remove_channel(
77
77
  state
78
78
  .db
79
79
  .conn()
80
- .execute("DELETE FROM channels WHERE id = ?1", [&channel_id])
80
+ .execute("DELETE FROM channels WHERE id = ?1", [channel_id.as_str()])
81
81
  .await
82
82
  .map_err(|e| e.to_string())?;
83
83
  Ok(())
@@ -93,7 +93,7 @@ pub async fn connect_channel(
93
93
  .conn()
94
94
  .execute(
95
95
  "UPDATE channels SET status = 'connecting' WHERE id = ?1",
96
- [&channel_id],
96
+ [channel_id.as_str()],
97
97
  )
98
98
  .await
99
99
  .map_err(|e| e.to_string())?;
@@ -111,7 +111,7 @@ pub async fn disconnect_channel(
111
111
  .conn()
112
112
  .execute(
113
113
  "UPDATE channels SET status = 'disconnected' WHERE id = ?1",
114
- [&channel_id],
114
+ [channel_id.as_str()],
115
115
  )
116
116
  .await
117
117
  .map_err(|e| e.to_string())?;
@@ -14,7 +14,6 @@ pub async fn create_project(
14
14
  name: String,
15
15
  folder_path: String,
16
16
  ) -> Result<Project, String> {
17
- // Seed workspace files (CLAUDE.md, etc.)
18
17
  workspace::seed_workspace(&folder_path);
19
18
 
20
19
  state
@@ -28,7 +27,7 @@ pub async fn create_project(
28
27
  pub async fn delete_project(
29
28
  state: State<'_, AppState>,
30
29
  project_id: String,
31
- ) -> Result<(), String> {
30
+ ) -> Result<bool, String> {
32
31
  // Only removes from DB — does NOT delete the folder on disk.
33
32
  state
34
33
  .db
@@ -3,6 +3,7 @@ use keel_tauri::chat_session::ChatSessionState;
3
3
  use keel_tauri::paths::expand_tilde;
4
4
  use keel_tauri::session_runner::{spawn_and_monitor, PersistOptions};
5
5
  use keel_tauri::state::AppState;
6
+ use std::path::Path;
6
7
  use tauri::State;
7
8
 
8
9
  #[tauri::command]
@@ -20,7 +21,7 @@ pub async fn start_session(
20
21
  .map_err(|e| e.to_string())?
21
22
  .ok_or_else(|| "Project not found".to_string())?;
22
23
 
23
- let working_dir = expand_tilde(&project.folder_path);
24
+ let working_dir = expand_tilde(Path::new(&project.folder_path));
24
25
 
25
26
  // Seed workspace files on first use.
26
27
  workspace::seed_workspace(&project.folder_path);
@@ -36,17 +37,17 @@ pub async fn start_session(
36
37
  };
37
38
 
38
39
  // Resume previous session if we have one.
39
- let resume_id = chat_state.get();
40
+ let resume_id = chat_state.get().await;
40
41
 
41
42
  let session_key = "main".to_string();
42
43
 
43
44
  let _handle = spawn_and_monitor(
44
45
  &app_handle,
45
- &session_key,
46
- &prompt,
47
- resume_id.as_deref(),
46
+ session_key.clone(),
47
+ prompt,
48
+ resume_id,
48
49
  Some(working_dir),
49
- system_prompt.as_deref(),
50
+ system_prompt,
50
51
  Some(chat_state.inner().clone()),
51
52
  Some(PersistOptions {
52
53
  db: state.db.clone(),
@@ -1,6 +1,7 @@
1
1
  use keel_tauri::paths::expand_tilde;
2
2
  use keel_tauri::state::AppState;
3
3
  use serde::Serialize;
4
+ use std::path::Path;
4
5
  use tauri::State;
5
6
 
6
7
  const KNOWN_FILES: &[(&str, &str)] = &[
@@ -26,7 +27,7 @@ pub async fn list_workspace_files(
26
27
  .map_err(|e| e.to_string())?
27
28
  .ok_or_else(|| "Project not found".to_string())?;
28
29
 
29
- let dir = expand_tilde(&project.folder_path);
30
+ let dir = expand_tilde(Path::new(&project.folder_path));
30
31
  let files = KNOWN_FILES
31
32
  .iter()
32
33
  .map(|(name, desc)| WorkspaceFileInfo {
@@ -52,11 +53,10 @@ pub async fn read_workspace_file(
52
53
  .map_err(|e| e.to_string())?
53
54
  .ok_or_else(|| "Project not found".to_string())?;
54
55
 
55
- // Only allow reading known files
56
56
  if !KNOWN_FILES.iter().any(|(name, _)| *name == file_name) {
57
57
  return Err(format!("Unknown workspace file: {file_name}"));
58
58
  }
59
59
 
60
- let path = expand_tilde(&project.folder_path).join(&file_name);
60
+ let path = expand_tilde(Path::new(&project.folder_path)).join(&file_name);
61
61
  std::fs::read_to_string(&path).map_err(|e| format!("Failed to read {file_name}: {e}"))
62
62
  }
@@ -8,6 +8,7 @@ use keel_tauri::keel_memory::MemoryStore;
8
8
  use keel_tauri::keel_scheduler::Scheduler;
9
9
  use keel_tauri::state::AppState;
10
10
  use std::sync::Arc;
11
+ use tauri::Manager;
11
12
  use tokio::sync::Mutex;
12
13
 
13
14
  pub fn run() {
@@ -22,7 +23,6 @@ pub fn run() {
22
23
  .expect("Failed to open database")
23
24
  });
24
25
 
25
- // Initialize memory store with its own connection to the same DB.
26
26
  let memory_dir = data_dir.join("memories");
27
27
  let memory_store = tauri::async_runtime::block_on(async {
28
28
  let mem_db = libsql::Builder::new_local(&db_path)
@@ -37,13 +37,8 @@ pub fn run() {
37
37
  .expect("Failed to initialize memory store")
38
38
  });
39
39
 
40
- // Initialize event queue.
41
40
  let (_event_queue, queue_handle) = EventQueue::new();
42
-
43
- // Initialize scheduler with queue handle.
44
41
  let scheduler = Scheduler::new(queue_handle.clone());
45
-
46
- // Chat session state for --resume support.
47
42
  let chat_session = ChatSessionState::default();
48
43
 
49
44
  app.manage(AppState {
@@ -57,31 +52,24 @@ pub fn run() {
57
52
  Ok(())
58
53
  })
59
54
  .invoke_handler(tauri::generate_handler![
60
- // Projects (agents)
61
55
  commands::projects::list_projects,
62
56
  commands::projects::create_project,
63
- // Issues
57
+ commands::projects::delete_project,
64
58
  commands::issues::list_issues,
65
59
  commands::issues::create_issue,
66
- // Sessions
67
60
  commands::sessions::start_session,
68
61
  commands::sessions::load_chat_feed,
69
- // Workspace
70
62
  commands::workspace::list_workspace_files,
71
63
  commands::workspace::read_workspace_file,
72
- // Memory
73
64
  commands::memory::list_memories,
74
65
  commands::memory::create_memory,
75
66
  commands::memory::delete_memory,
76
67
  commands::memory::search_memories,
77
- // Events
78
68
  commands::events::list_events,
79
- // Scheduler
80
69
  commands::scheduler::add_heartbeat,
81
70
  commands::scheduler::remove_heartbeat,
82
71
  commands::scheduler::add_cron,
83
72
  commands::scheduler::remove_cron,
84
- // Channels
85
73
  commands::channels::list_channels,
86
74
  commands::channels::add_channel,
87
75
  commands::channels::remove_channel,
@@ -1,5 +1,6 @@
1
1
  use keel_tauri::paths::expand_tilde;
2
2
  use keel_tauri::workspace::seed_file;
3
+ use std::path::Path;
3
4
 
4
5
  const CLAUDE_MD_TEMPLATE: &str = r#"# {{APP_NAME_TITLE}} Agent
5
6
 
@@ -15,7 +16,7 @@ You are a helpful AI assistant.
15
16
  /// Seed workspace files for a new agent. Creates the folder and writes
16
17
  /// CLAUDE.md if it doesn't already exist.
17
18
  pub fn seed_workspace(folder_path: &str) {
18
- let dir = expand_tilde(folder_path);
19
+ let dir = expand_tilde(Path::new(folder_path));
19
20
  std::fs::create_dir_all(&dir).ok();
20
21
  seed_file(&dir, "CLAUDE.md", CLAUDE_MD_TEMPLATE);
21
22
  }