Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"swift.disableSwiftPackageManagerIntegration": false
"swift.disableSwiftPackageManagerIntegration": true
}
41 changes: 40 additions & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ anyhow = "1"
thiserror = "2"
serde = "1"
serde_json = "1"
time = "0.3.37"

ndarray = "0.16.1"
ort = "2.0.0-rc.9"
Expand Down
2 changes: 1 addition & 1 deletion Taskfile.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ tasks:
fmt:yaml: yamlfmt .github pnpm-workspace.yaml
fmt:toml: taplo fmt apps/**/Cargo.toml crates/**/Cargo.toml Cargo.toml
fmt:rs: cargo fmt
fmt:swift: find crates/swift -type f \( -name "*.swift" \) -not -path "*/\.build/*" | xargs swift-format format -i
fmt:swift: find crates -type f \( -name "*.swift" \) -not -path "*/\.build/*" | xargs swift-format format -i
fmt:
silent: true
deps: ['fmt:yaml', 'fmt:toml', 'fmt:rs', 'fmt:swift', 'fmt:js']
8 changes: 8 additions & 0 deletions apps/desktop/src-tauri/Entitlements.plist
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>com.apple.security.personal-information.calendars</key>
<true/>
</dict>
</plist>
4 changes: 4 additions & 0 deletions apps/desktop/src-tauri/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,9 @@
<string>This app requires access to your microphone to record your voice during online meetings.</string>
<key>NSAudioCaptureUsageDescription</key>
<string>This app requires access to the microphone to capture audio from other participants in the online meeting.</string>
<key>NSCalendarsUsageDescription</key>
<string>This app requires access to your calendar to read events.</string>
<key>NSCalendarsFullAccessUsageDescription</key>
<string>This app requires access to your calendar to read events.</string>
</dict>
</plist>
18 changes: 18 additions & 0 deletions apps/desktop/src-tauri/src/commands.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,24 @@ pub async fn start_playback(_app: AppHandle, _audio_id: String) {}
#[specta::specta]
pub async fn stop_playback(_app: AppHandle, _audio_id: String) {}

#[cfg(target_os = "macos")]
#[tauri::command]
#[specta::specta]
pub fn list_apple_calendars() -> Option<Vec<hypr_calendar::apple::Calendar>> {
let handle = hypr_calendar::apple::Handle::new();
Some(handle.list_calendars())
}

#[cfg(target_os = "macos")]
#[tauri::command]
#[specta::specta]
pub fn list_apple_events(
filter: hypr_calendar::apple::EventFilter,
) -> Option<Vec<hypr_calendar::apple::Event>> {
let handle = hypr_calendar::apple::Handle::new();
Some(handle.list_events(filter))
}

#[tauri::command]
#[specta::specta]
pub fn start_recording(app: AppHandle) -> Result<(), String> {
Expand Down
4 changes: 4 additions & 0 deletions apps/desktop/src-tauri/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,13 @@ pub fn run() {
commands::stop_recording,
commands::start_playback,
commands::stop_playback,
commands::list_apple_calendars,
commands::list_apple_events,
permissions::open_permission_settings,
])
.events(tauri_specta::collect_events![events::Transcript])
.typ::<hypr_calendar::apple::Calendar>()
.typ::<hypr_calendar::apple::Event>()
.error_handling(tauri_specta::ErrorHandlingMode::Throw);

#[cfg(debug_assertions)]
Expand Down
8 changes: 5 additions & 3 deletions apps/desktop/src-tauri/tauri.conf.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
{
"$schema": "https://schema.tauri.app/config/2",
"productName": "Hypr",
"version": "0.1.0",
"identifier": "com.hyprnote.app",
"productName": "Hypr",
"mainBinaryName": "Hypr",
"identifier": "com.hyprnote.desktop",
"build": {
"beforeDevCommand": "pnpm run dev",
"devUrl": "http://localhost:1420",
Expand All @@ -26,7 +27,8 @@
"active": true,
"targets": "all",
"macOS": {
"minimumSystemVersion": "14.2"
"minimumSystemVersion": "14.2",
"entitlements": "./Entitlements.plist"
},
"icon": [
"icons/32.png",
Expand Down
1 change: 1 addition & 0 deletions apps/desktop/src/types/db.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ export type Session = {
id: string;
start: string;
end: string | null;
recording_path: string | null;
tags: string[];
raw_memo: string;
processed_memo: string;
Expand Down
12 changes: 12 additions & 0 deletions apps/desktop/src/types/tauri.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,12 @@ export const commands = {
async stopPlayback(audioId: string): Promise<void> {
await TAURI_INVOKE("stop_playback", { audioId });
},
async listAppleCalendars(): Promise<Calendar[] | null> {
return await TAURI_INVOKE("list_apple_calendars");
},
async listAppleEvents(filter: EventFilter): Promise<Event[] | null> {
return await TAURI_INVOKE("list_apple_events", { filter });
},
async openPermissionSettings(permission: OSPermission): Promise<void> {
await TAURI_INVOKE("open_permission_settings", { permission });
},
Expand All @@ -43,12 +49,18 @@ export const events = __makeEvents__<{

/** user-defined types **/

export type Calendar = { title: string };
export type Config = ConfigV0;
export type ConfigV0 = {
version: number;
language: Language;
user_name: string;
};
export type Event = { title: string; start_date: string; end_date: string };
export type EventFilter = {
last_n_days: number | null;
calendar_titles: string[];
};
export type Language = "English" | "Korean";
export type OSPermission =
| "screenRecording"
Expand Down
24 changes: 18 additions & 6 deletions crates/apple-calendar/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,22 @@ name = "apple-calendar"
version = "0.1.0"
edition = "2021"

[build-dependencies]
swift-rs = { git = "https://github.com/guillemcordoba/swift-rs", rev = "01980f981bc642a6da382cc0788f18fdd4cde6df", features = [
"build",
] }

[dependencies]
swift-rs = { git = "https://github.com/guillemcordoba/swift-rs", rev = "01980f981bc642a6da382cc0788f18fdd4cde6df" }
serde = { workspace = true, features = ["derive"] }
serde_json = { workspace = true }
specta = { workspace = true }
time = { workspace = true, features = ["formatting"] }
block2 = "0.5.1"
itertools = "0.13.0"

objc2 = "0.5.2"
objc2-event-kit = { version = "0.2.2", features = [
"EKEventStore",
"EKCalendarItem",
"EKCalendar",
"EKObject",
"EKEvent",
"EKTypes",
"block2",
] }
objc2-foundation = { version = "0.2.2", features = ["NSEnumerator"] }
6 changes: 0 additions & 6 deletions crates/apple-calendar/build.rs

This file was deleted.

Loading