aia 0.5.17 → 0.8.0

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.
Files changed (51) hide show
  1. checksums.yaml +4 -4
  2. data/.envrc +1 -0
  3. data/.version +1 -2
  4. data/CHANGELOG.md +61 -22
  5. data/README.md +387 -227
  6. data/Rakefile +16 -5
  7. data/_notes.txt +231 -0
  8. data/bin/aia +3 -2
  9. data/examples/README.md +140 -0
  10. data/examples/headlines +21 -0
  11. data/justfile +16 -3
  12. data/lib/aia/ai_client_adapter.rb +210 -0
  13. data/lib/aia/chat_processor_service.rb +120 -0
  14. data/lib/aia/config.rb +473 -4
  15. data/lib/aia/context_manager.rb +58 -0
  16. data/lib/aia/directive_processor.rb +267 -0
  17. data/lib/aia/{tools/fzf.rb → fzf.rb} +9 -17
  18. data/lib/aia/history_manager.rb +85 -0
  19. data/lib/aia/prompt_handler.rb +178 -0
  20. data/lib/aia/session.rb +215 -0
  21. data/lib/aia/shell_command_executor.rb +109 -0
  22. data/lib/aia/ui_presenter.rb +110 -0
  23. data/lib/aia/utility.rb +24 -0
  24. data/lib/aia/version.rb +9 -6
  25. data/lib/aia.rb +57 -61
  26. data/lib/extensions/openstruct_merge.rb +44 -0
  27. metadata +43 -42
  28. data/LICENSE.txt +0 -21
  29. data/doc/aia_and_pre_compositional_prompts.md +0 -474
  30. data/lib/aia/clause.rb +0 -7
  31. data/lib/aia/cli.rb +0 -452
  32. data/lib/aia/directives.rb +0 -142
  33. data/lib/aia/dynamic_content.rb +0 -26
  34. data/lib/aia/logging.rb +0 -62
  35. data/lib/aia/main.rb +0 -265
  36. data/lib/aia/prompt.rb +0 -275
  37. data/lib/aia/tools/backend_common.rb +0 -58
  38. data/lib/aia/tools/client.rb +0 -197
  39. data/lib/aia/tools/editor.rb +0 -52
  40. data/lib/aia/tools/glow.rb +0 -90
  41. data/lib/aia/tools/llm.rb +0 -77
  42. data/lib/aia/tools/mods.rb +0 -100
  43. data/lib/aia/tools/sgpt.rb +0 -79
  44. data/lib/aia/tools/subl.rb +0 -68
  45. data/lib/aia/tools/vim.rb +0 -93
  46. data/lib/aia/tools.rb +0 -88
  47. data/lib/aia/user_query.rb +0 -21
  48. data/lib/core_ext/string_wrap.rb +0 -73
  49. data/lib/core_ext/tty-spinner_log.rb +0 -25
  50. data/man/aia.1 +0 -272
  51. data/man/aia.1.md +0 -236
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: ddc10008cf6ed5ee904b4ceca4126f4edb9fc9e3d28f9fc524a5d136a2fe504c
4
- data.tar.gz: 617a3bb5cdf9c6804dd3f9d33c4a46b6e475e53a5900ccef989f108599226caa
3
+ metadata.gz: 3a77cfcc71cea66fafd6eb8c17666eee983f7903a60f528e3bb396d8bdac0488
4
+ data.tar.gz: c9424c2a40f886a231b10fe569276ba0b8e3e9feb435b38a0257852a91103629
5
5
  SHA512:
6
- metadata.gz: be279990213e7e7076030f53befce105a399a3d58aca7e00f8ccb0894c88bceadc54d1552ae6da20beb5bc03de5b42ee3aeb64535e2cde232c9b8a4ec9fb7896
7
- data.tar.gz: e34424f951c6ee06cd22feef9771ffe9dc029bf20d00b67e51eafa18e520a8f74cb06e0848cc83a2879c1dc58a69124e91b1a09e7bba8f5cbc3febb35bac5821
6
+ metadata.gz: 6f96bdaafd932c34637cbd05415dc4a5c856ecaf386780426d10db5f1dade03a2368c7a767698c385754467b3882bf50faa972a8dedfcd0a5b040777b86d4bb7
7
+ data.tar.gz: 0cfd3aa1b9750a7ae83dbb21ef737647f64b9cf67cb2a428864b7f22edbccaf317c9dbee205e2995cfdb3809b883f792722aac281a82869477caba3e70d04d23
data/.envrc CHANGED
@@ -1 +1,2 @@
1
1
  export RR=`pwd`
2
+ # PATH_add $RR/bin
data/.version CHANGED
@@ -1,2 +1 @@
1
- 0.5.17
2
-
1
+ 0.8.0
data/CHANGELOG.md CHANGED
@@ -1,9 +1,48 @@
1
+ # Changelog
1
2
  ## [Unreleased]
2
3
 
3
- ## [0.5.17] 2024-05-17
4
+ ## Released
5
+
6
+ ### [0.8.0] WIP - 2025-04-15
7
+ - Updated PromptManager to v0.5.1 which has some of the functionality that was originally developed in the AIA.
8
+ - Enhanced README.md to include a comprehensive table of configuration options with defaults and associated environment variables.
9
+ - Added a note in README.md about the expandability of configuration options from a config file for dynamic prompt generation.
10
+ - Improved shell command protection by ensuring dangerous patterns are checked and confirmed before execution.
11
+ - Ensured version consistency across `.version`, `aia.gemspec`, and `lib/aia/version.rb`.
12
+ - Verified and updated documentation to ensure readiness for release on RubyGems.org.
13
+
14
+ ### [0.7.1] WIP - 2025-03-22
15
+ - Added `UIPresenter` class for handling user interface presentation.
16
+ - Added `DirectiveProcessor` class for processing chat-based directives.
17
+ - Added `HistoryManager` class for managing conversation and variable history.
18
+ - Added `ShellCommandExecutor` class for executing shell commands.
19
+ - Added `ChatProcessorService` class for managing conversation processing logic.
20
+ - Added `PromptProcessor` class for processing prompts.
21
+ - Enhanced `Session` class to manage interactive session logic.
22
+ - Updated `Config` class to handle new configuration options and defaults.
23
+ - Improved handling of chat prompts and AI interactions.
24
+ - Added support for dynamic content processing in prompts, including shell commands and ERB.
25
+ - Improved error handling and user feedback for directive processing.
26
+ - Enhanced logging and output options for chat sessions.
27
+
28
+ ### [0.7.0] WIP - 2025-03-17
29
+ - Major code refactoring for better organization and maintainability:
30
+ - Extracted `DirectiveProcessor` class to handle chat-based directives
31
+ - Extracted `HistoryManager` class for conversation and variable history management
32
+ - Extracted `UIPresenter` class for UI-related functionality
33
+ - Extracted `ChatProcessorService` class for prompt processing and AI interactions
34
+ - Significantly reduced complexity of the `Session` class by applying separation of concerns
35
+ - Enhanced the `//clear` directive to properly reset conversation context
36
+ - Improved output handling to suppress STDOUT when chat mode is off and output file is specified
37
+ - Updated spinner format in the process_prompt method for better user experience
38
+
39
+ ### [0.6.?] WIP
40
+ - Implemented Tony Stark's Clean Slate Protocol on the develop branch
41
+
42
+ ### [0.5.17] 2024-05-17
4
43
  - removed replaced `semver` with `versionaire`
5
44
 
6
- ## [0.5.16] 2024-04-02
45
+ ### [0.5.16] 2024-04-02
7
46
  - fixed prompt pipelines
8
47
  - added //next and //pipeline directives as shortcuts to //config [next,pipeline]
9
48
  - Added new backend "client" as an internal OpenAI client
@@ -13,82 +52,82 @@
13
52
  - Added --image_size and --image_quality (--is --iq)
14
53
 
15
54
 
16
- ## [0.5.15] 2024-03-30
55
+ ### [0.5.15] 2024-03-30
17
56
  - Added the ability to accept piped in text to be appeded to the end of the prompt text: curl $URL | aia ad_hoc
18
57
  - Fixed bugs with entering directives as follow-up prompts during a chat session
19
58
 
20
- ## [0.5.14] 2024-03-09
59
+ ### [0.5.14] 2024-03-09
21
60
  - Directly access OpenAI to do text to speech when using the `--speak` option
22
61
  - Added --voice to specify which voice to use
23
62
  - Added --speech_model to specify which TTS model to use
24
63
 
25
- ## [0.5.13] 2024-03-03
64
+ ### [0.5.13] 2024-03-03
26
65
  - Added CLI-utility `llm` as a backend processor
27
66
 
28
- ## [0.5.12] 2024-02-24
67
+ ### [0.5.12] 2024-02-24
29
68
  - Happy Birthday Ruby!
30
69
  - Added --next CLI option
31
70
  - Added --pipeline CLI option
32
71
 
33
- ## [0.5.11] 2024-02-18
72
+ ### [0.5.11] 2024-02-18
34
73
  - allow directives to return information that is inserted into the prompt text
35
74
  - added //shell command directive
36
75
  - added //ruby ruby_code directive
37
76
  - added //include path_to_file directive
38
77
 
39
- ## [0.5.10] 2024-02-03
78
+ ### [0.5.10] 2024-02-03
40
79
  - Added --roles_dir to isolate roles from other prompts if desired
41
80
  - Changed --prompts to --prompts_dir to be consistent
42
81
  - Refactored common fzf usage into its own tool class
43
82
 
44
- ## [0.5.9] 2024-02-01
83
+ ### [0.5.9] 2024-02-01
45
84
  - Added a "I'm working" spinner thing when "--verbose" is used as an indication that the backend is in the process of composing its response to the prompt.
46
85
 
47
- ## [0.5.8] 2024-01-17
86
+ ### [0.5.8] 2024-01-17
48
87
  - Changed the behavior of the --dump option. It must now be followed by path/to/file.ext where ext is a supported config file format: yml, yaml, toml
49
88
 
50
- ## [0.5.7] 2024-01-15
89
+ ### [0.5.7] 2024-01-15
51
90
  - Added ERB processing to the config_file
52
91
 
53
- ## [0.5.6] 2024-01-15
92
+ ### [0.5.6] 2024-01-15
54
93
  - Adding processing for directives, shell integration and erb to the follow up prompt in a chat session
55
94
  - some code refactoring.
56
95
 
57
96
  ## [0.5.3] 2024-01-14
58
97
  - adding ability to render markdown to the terminal using the "glow" CLI utility
59
98
 
60
- ## [0.5.2] 2024-01-13
99
+ ### [0.5.2] 2024-01-13
61
100
  - wrap response when its going to the terminal
62
101
 
63
- ## [0.5.1] 2024-01-12
102
+ ### [0.5.1] 2024-01-12
64
103
  - removed a wicked puts "loaded" statement
65
104
  - fixed missed code when the options were changed to --out_file and --log_file
66
105
  - fixed completion functions by updating $PROMPT_DIR to $AIA_PROMPTS_DIR to match the documentation.
67
106
 
68
- ## [0.5.0] 2024-01-05
107
+ ### [0.5.0] 2024-01-05
69
108
  - breaking changes:
70
109
  - changed `--config` to `--config_file`
71
110
  - changed `--env` to `--shell`
72
111
  - changed `--output` to `--out_file`
73
112
  - changed default `out_file` to `STDOUT`
74
113
 
75
- ## [0.4.3] 2023-12-31
114
+ ### [0.4.3] 2023-12-31
76
115
  - added --env to process embedded system environment variables and shell commands within a prompt.
77
116
  - added --erb to process Embedded RuBy within a prompt because have embedded shell commands will only get you in a trouble. Having ERB will really get you into trouble. Remember the simple prompt is usually the best prompt.
78
117
 
79
- ## [0.4.2] 2023-12-31
118
+ ### [0.4.2] 2023-12-31
80
119
  - added the --role CLI option to pre-pend a "role" prompt to the front of a primary prompt.
81
120
 
82
- ## [0.4.1] 2023-12-31
121
+ ### [0.4.1] 2023-12-31
83
122
  - added a chat mode
84
123
  - prompt directives now supported
85
124
  - version bumped to match the `prompt_manager` gem
86
125
 
87
- ## [0.3.20] 2023-12-28
126
+ ### [0.3.20] 2023-12-28
88
127
  - added work around to issue with multiple context files going to the `mods` backend
89
128
  - added shellwords gem to santize prompt text on the command line
90
129
 
91
- ## [0.3.19] 2023-12-26
130
+ ### [0.3.19] 2023-12-26
92
131
  - major code refactoring.
93
132
  - supports config files \*.yml, \*.yaml and \*.toml
94
133
  - usage implemented as a man page. --help will display the man page/
@@ -101,10 +140,10 @@
101
140
  3. envar values over-rides ...
102
141
  4. default values
103
142
 
104
- ## [0.3.0] = 2023-11-23
143
+ ### [0.3.0] = 2023-11-23
105
144
 
106
145
  - Matching version to [prompt_manager](https://github.com/prompt_manager) This version allows for the user of history in the entery of values to prompt keywords. KW_HISTORY_MAX is set at 5. Changed CLI enteraction to use historical selection and editing of prior keyword values.
107
146
 
108
- ## [0.1.0] - 2023-11-23
147
+ ### [0.1.0] - 2023-11-23
109
148
 
110
149
  - Initial release