Skip to content

Pull in context from apps #43

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 4 commits into
base: v0.2.3-updates
Choose a base branch
from
Draft
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
15 changes: 15 additions & 0 deletions src/app_context.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#!/usr/bin/env sh
# shellcheck enable=all

# Pull in context from mail app

# Pull in context from calendar app

# Pull in context from notes app

# Pull in context from reminders app

# Pull in context from terminal app

# Pull in context from safari app

8 changes: 8 additions & 0 deletions src/llm_session_management.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,14 @@ generate_prompt() {
add_system_info=$8
add_directory_info=$9
add_clipboard_info=${10}
add_screenshot_info=${11}
add_text_info=${12}
add_mail_info=${13}
add_calendar_info=${14}
add_notes_info=${15}
add_reminders_info=${16}
add_terminal_info=${17}
add_safari_info=${18}

# Check that inputs are valid
check_mode mode || return 1
Expand Down
37 changes: 36 additions & 1 deletion src/main.sh
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ esac
. "${DIR}/tokens.sh"
. "${DIR}/content_processing.sh"
. "${DIR}/prompt_generators.sh"
. "${DIR}/app_context.sh"
. "${DIR}/llm_session_management.sh"

# Write a settings file if there isn't one already
Expand All @@ -55,6 +56,8 @@ search_term_list=""
surf_and_add_results=false
add_directory_info=false add_system_info=false add_clipboard_info=false add_usage_info=false
task_model_override=false casual_model_override=false balanced_model_override=false serious_model_override=false
add_screenshot_info=false add_text_info=false
add_mail_info=false add_calendar_info=false add_notes_info=false add_reminders_info=false add_terminal_info=false add_safari_info=false

# Make verbose a global variable
VERBOSE=false
Expand Down Expand Up @@ -206,6 +209,30 @@ while [ $# -gt 0 ]; do
surf_and_add_results=true
;;

# Add screenshot info
-sc|--screenshot) add_screenshot_info=true ;;

# Add text info
-t|--text) add_text_info=true ;;

# Pull in context from mail app
--mail) add_mail_info=true ;;

# Pull in context from calendar app
--calendar) add_calendar_info=true ;;

# Pull in context from notes app
--notes) add_notes_info=true ;;

# Pull in context from reminders app
--reminders) add_reminders_info=true ;;

# Pull in context from terminal app
--terminal) add_terminal_info=true ;;

# Pull in context from safari app
--safari) add_safari_info=true ;;

# Add system information to the context
-y | --system) add_system_info=true ;;

Expand Down Expand Up @@ -299,7 +326,15 @@ prompt=$(
"${add_usage_info}" \
"${add_system_info}" \
"${add_directory_info}" \
"${add_clipboard_info}"
"${add_clipboard_info}" \
"${add_screenshot_info}" \
"${add_text_info}" \
"${add_mail_info}" \
"${add_calendar_info}" \
"${add_notes_info}" \
"${add_reminders_info}" \
"${add_terminal_info}" \
"${add_safari_info}"
) || {
echo "Error: Failed to generate prompt." >&2
exit 1
Expand Down
Loading