aia 0.3.4 → 0.3.20

Sign up to get free protection for your applications and to get access to all the features.
data/lib/aia/tools.rb ADDED
@@ -0,0 +1,50 @@
1
+ # lib/aia/tools.rb
2
+
3
+ require 'hashie'
4
+
5
+ class AIA::Tools
6
+ @@catalog = []
7
+
8
+ class << self
9
+ def inherited(subclass)
10
+ subclass_meta = Hashie::Mash.new(klass: subclass)
11
+ subclass.instance_variable_set(:@_metadata, subclass_meta)
12
+
13
+ @@catalog << subclass_meta
14
+ end
15
+
16
+
17
+ def meta(metadata = nil)
18
+ return @_metadata if metadata.nil?
19
+
20
+ @_metadata = Hashie::Mash.new(metadata)
21
+ entry = @@catalog.detect { |item| item[:klass] == self }
22
+
23
+ entry.merge!(metadata) if entry
24
+ end
25
+
26
+
27
+ def get_meta
28
+ @_metadata
29
+ end
30
+
31
+
32
+ def search_for(criteria = {})
33
+ @@catalog.select do |meta|
34
+ criteria.all? { |k, v| meta[k] == v }
35
+ end
36
+ end
37
+
38
+
39
+ def catalog
40
+ @@catalog
41
+ end
42
+
43
+
44
+ def load_tools
45
+ Dir.glob(File.join(File.dirname(__FILE__), 'tools', '*.rb')).each do |file|
46
+ require file
47
+ end
48
+ end
49
+ end
50
+ end
data/lib/aia/version.rb CHANGED
@@ -1,6 +1,10 @@
1
1
  # lib/aia/version.rb
2
2
  # frozen_string_literal: true
3
3
 
4
+ require 'semver'
5
+
4
6
  module AIA
5
- VERSION = "0.3.4"
7
+ # .semver is located at the gem's root directory
8
+ version_file_path = File.join(__dir__, '..', '..')
9
+ VERSION = SemVer.find(version_file_path).to_s[1..]
6
10
  end
data/lib/aia.rb CHANGED
@@ -1,7 +1,12 @@
1
1
  # lib/aia.rb
2
2
 
3
+ require 'debug_me'
4
+ include DebugMe
5
+
6
+ require 'hashie'
3
7
  require 'pathname'
4
8
  require 'readline'
9
+ require 'shellwords'
5
10
  require 'tempfile'
6
11
 
7
12
  require 'prompt_manager'
@@ -12,9 +17,19 @@ require_relative "aia/main"
12
17
  require_relative "core_ext/string_wrap"
13
18
 
14
19
  module AIA
15
- def self.run(args=ARGV)
16
- args = args.split(' ') if args.is_a?(String)
17
- AIA::Main.new(args).call
20
+ class << self
21
+ attr_accessor :config
22
+
23
+ def run(args=ARGV)
24
+ args = args.split(' ') if args.is_a?(String)
25
+
26
+ # TODO: Currently this is a one and done architecture.
27
+ # If the args contain an "-i" or and "--interactive"
28
+ # flag could this turn into some kind of
29
+ # conversation REPL?
30
+
31
+ AIA::Main.new(args).call
32
+ end
18
33
  end
19
34
  end
20
35
 
data/main.just ADDED
@@ -0,0 +1,56 @@
1
+ # aia/main.just
2
+ #
3
+ # Support man pages with ...
4
+ # gem install kramdown-man
5
+ #
6
+
7
+ RR := env_var('RR')
8
+
9
+ with ~/.justfile
10
+
11
+ # FIXME: justprep module process still has an issue with ~ and $HOME
12
+ # FIXME: justprep does not like more than one space between module name and path.
13
+
14
+ module repo /Users/dewayne/sandbox/git_repos/repo.just
15
+ module gem /Users/dewayne/sandbox/git_repos/gem.just
16
+ module version /Users/dewayne/just_modules/version.just
17
+
18
+
19
+ # Preview man page
20
+ preview_man_page:
21
+ kramdown-man {{RR}}/man/aia.1.md
22
+
23
+
24
+ # View man page
25
+ view_man_page: create_man_page
26
+ man {{RR}}/man/aia.1
27
+
28
+
29
+ # Create man page
30
+ create_man_page:
31
+ rake man
32
+
33
+ ##########################################
34
+
35
+ # Tag the current commit, push it, then bump the version
36
+ tag_push_and_bump: tag push bump
37
+
38
+
39
+ # Create a git tag for the current version
40
+ tag:
41
+ git tag $(semver)
42
+
43
+ # Push the git current working directory and all tags
44
+ push:
45
+ git push
46
+ git push origin --tags
47
+
48
+
49
+ alias inc := bump
50
+
51
+ # Increament version's level: major.minor.patch
52
+ @bump level='patch':
53
+ semver increment {{level}}
54
+ echo "Now working on: $(semver)"
55
+ git add {{RR}}/.semver
56
+
data/man/aia.1 ADDED
@@ -0,0 +1,134 @@
1
+ .\" Generated by kramdown-man 1.0.1
2
+ .\" https://github.com/postmodern/kramdown-man#readme
3
+ .TH aia 1 "2024-01-01" AIA "User Manuals"
4
+ .SH NAME
5
+ .PP
6
+ aia \- command\-line interface for an AI assistant
7
+ .SH SYNOPSIS
8
+ .PP
9
+ aia \[lB]options\[rB]* PROMPT\[ru]ID \[lB]CONTEXT\[ru]FILE\[rB]* \[lB]\-\- EXTERNAL\[ru]OPTIONS\[pl]\[rB]
10
+ .SH DESCRIPTION
11
+ .PP
12
+ The aia command\-line tool is an interface for interacting with an AI model backend, providing a simple way to send prompts and receive responses\. The CLI supports various options to customize the interaction, load a configuration file, edit prompts, set debugging levels, and more\.
13
+ .SH ARGUMENTS
14
+ .TP
15
+ \fIPROMPT\[ru]ID\fP
16
+ This is a required argument\.
17
+ .TP
18
+ \fICONTEXT\[ru]FILES\fP
19
+ This is an optional argument\. One or more files can be added to the prompt as context for the backend gen\-AI tool to process\.
20
+ .TP
21
+ \fIEXTERNAL\[ru]OPTIONS\fP
22
+ External options are optional\. Anything that follow \[lq] \-\- \[lq] will be sent to the backend gen\-AI tool\. For example \[lq]\-\- \-C \-m gpt4\-128k\[rq] will send the options \[lq]\-C \-m gpt4\-128k\[rq] to the backend gen\-AI tool\. \fBaia\fR will not validate these external options before sending them to the backend gen\-AI tool\.
23
+ .SH OPTIONS
24
+ .TP
25
+ \fB\-c\fR, \fB\-\-config\fR \fIPATH\[ru]TO\[ru]CONFIG\[ru]FILE\fP
26
+ Load Config File \- default: nil
27
+ .TP
28
+ \fB\-\-dump\fR \fIFORMAT\fP
29
+ .TP
30
+ \fB\-e\fR, \fB\-\-edit\fR
31
+ Edit the Prompt File \- default: false
32
+ .TP
33
+ \fB\-d\fR, \fB\-\-debug\fR
34
+ Turn On Debugging \- default: false
35
+ .TP
36
+ \fB\-v\fR, \fB\-\-verbose\fR
37
+ Be Verbose \- default: false
38
+ .TP
39
+ \fB\-\-version\fR
40
+ Print Version \- default: false
41
+ .TP
42
+ \fB\-h\fR, \fB\-\-help\fR
43
+ Show Usage \- default: false
44
+ .TP
45
+ \fB\-s\fR, \fB\-\-search\fR \fITERM\fP
46
+ Search for prompts contain TERM \- default: nil
47
+ .TP
48
+ \fB\-f\fR, \-\-fuzzy\`
49
+ Use Fuzzy Matching when searching for a prompt \- default: false
50
+ .TP
51
+ \fB\-\-completion\fR \fISHELL\[ru]NAME\fP
52
+ .TP
53
+ \fB\-o\fR, \fB\-\-\[lB]no\[rB]\-output\fR \fIPATH\[ru]TO\[ru]OUTPUT\[ru]FILE\fP
54
+ Out FILENAME \- default: \.\[sl]temp\.md
55
+ .TP
56
+ \fB\-l\fR, \fB\-\-\[lB]no\[rB]\-log\fR \fIPATH\[ru]TO\[ru]LOG\[ru]FILE\fP
57
+ Log FILEPATH \- default: \[Do]HOME\[sl]\.prompts\[sl]prompts\.log
58
+ .TP
59
+ \fB\-m\fR, \fB\-\-\[lB]no\[rB]\-markdown\fR
60
+ Format with Markdown \- default: true
61
+ .TP
62
+ \fB\-\-model\fR \fINAME\fP
63
+ Name of the LLM model to use \- default: gpt\-4\-1106\-preview
64
+ .TP
65
+ \fB\-p\fR, \fB\-\-prompts\fR \fIPATH\[ru]TO\[ru]DIRECTORY\fP
66
+ Directory containing the prompt files \- default: \[ti]\[sl]\.prompts
67
+ .TP
68
+ \fB\-b\fR, \fB\-\-\[lB]no\[rB]\-backend\fR \fILLM TOOL\fP
69
+ Specify the backend prompt resolver \- default: :mods
70
+ .SH ENVIRONMENT
71
+ .PP
72
+ The aia CLI uses the following environment variables:
73
+ .RS
74
+ .IP \(bu 2
75
+ \fBAIA\[ru]PROMPTS\[ru]DIR\fR: Path to the directory containing prompts files \- default: \fB\[Do]HOME\[sl]\.prompts\[ru]dir\fR
76
+ .IP \(bu 2
77
+ \fBAIA\[ru]BACKEND\fR: The AI command\-line program used \- default: \fBmods\fR
78
+ .IP \(bu 2
79
+ \fBEDITOR\fR: The text editor used by the edit option \- default: edit
80
+ .IP \(bu 2
81
+ \fBAIA\[ru]MODEL\fR: The AI model specification \- default: \fBgpt\-4\-1106\-preview\fR
82
+ .IP \(bu 2
83
+ \fBAIA\[ru]OUTPUT\fR: The default filename for output \- default: \fB\.\[sl]temp\.md\fR
84
+ .IP \(bu 2
85
+ \fBAIA\[ru]PROMPT\[ru]LOG\fR: The default filepath for the prompts log \- default: \fB\[Do]HOME\[sl]\.prompts\[sl]\[ru]prompts\.log\fR
86
+ .RE
87
+ .PP
88
+ Additionally, the program requires an OpenAI access key, which can be specified using one of the following environment variables:
89
+ .RS
90
+ .IP \(bu 2
91
+ \fBOPENAI\[ru]ACCESS\[ru]TOKEN\fR
92
+ .IP \(bu 2
93
+ \fBOPENAI\[ru]API\[ru]KEY\fR
94
+ .RE
95
+ .PP
96
+ Currently there is not specific standard for name of the OpenAI key\. Some programs use one name, while others use a different name\. Both of the envars listed above mean the same thing\. If you use more than one tool to access OpenAI resources, you may have to set several envars to the same key value\.
97
+ .PP
98
+ To acquire an OpenAI access key, first create an account on the OpenAI platform, where further documentation is available\.
99
+ .SH USAGE NOTES
100
+ .PP
101
+ \fBaia\fR is designed for flexibility, allowing users to pass prompt ids and context files as arguments\. Some options change the behavior of the output, such as \fB\-\-output\fR for specifying a file or \fB\-\-no\-output\fR for disabling file output in favor of standard output\.
102
+ .PP
103
+ The \fB\-\-completion\fR option displays a script that enables prompt ID auto\-completion for bash, zsh, or fish shells\. It\[cq]s crucial to integrate the script into the shell\[cq]s runtime to take effect\.
104
+ .SH SEE ALSO
105
+ .RS
106
+ .IP \(bu 2
107
+ OpenAI Platform Documentation
108
+ .UR https:\[sl]\[sl]platform\.openai\.com\[sl]docs\[sl]overview
109
+ .UE
110
+ for more information on obtaining access tokens
111
+ .UR https:\[sl]\[sl]platform\.openai\.com\[sl]account\[sl]api\-keys
112
+ .UE
113
+ and working with OpenAI models\.
114
+ .IP \(bu 2
115
+ mods
116
+ .UR https:\[sl]\[sl]github\.com\[sl]charmbracelet\[sl]mods
117
+ .UE
118
+ for more information on \fBmods\fR \- AI for the command line, built for pipelines\. LLM based AI is really good at interpreting the output of commands and returning the results in CLI friendly text formats like Markdown\. Mods is a simple tool that makes it super easy to use AI on the command line and in your pipelines\. Mods works with OpenAI
119
+ .UR https:\[sl]\[sl]platform\.openai\.com\[sl]account\[sl]api\-keys
120
+ .UE
121
+ and LocalAI
122
+ .UR https:\[sl]\[sl]github\.com\[sl]go\-skynet\[sl]LocalAI
123
+ .UE
124
+ .IP \(bu 2
125
+ sgpt
126
+ .UR https:\[sl]\[sl]github\.com\[sl]tbckr\[sl]sgpt
127
+ .UE
128
+ (aka shell\-gpt) is a powerful command\-line interface (CLI) tool designed for seamless interaction with OpenAI models directly from your terminal\. Effortlessly run queries, generate shell commands or code, create images from text, and more, using simple commands\. Streamline your workflow and enhance productivity with this powerful and user\-friendly CLI tool\.
129
+ .RE
130
+ .SH AUTHOR
131
+ .PP
132
+ Dewayne VanHoozer
133
+ .MT dvanhoozer\[at]gmail\.com
134
+ .ME
data/man/aia.1.md ADDED
@@ -0,0 +1,107 @@
1
+ # aia 1 "2024-01-01" AIA "User Manuals"
2
+
3
+ ## NAME
4
+ aia - command-line interface for an AI assistant
5
+
6
+ ## SYNOPSIS
7
+ aia [options]* PROMPT_ID [CONTEXT_FILE]* [-- EXTERNAL_OPTIONS+]
8
+
9
+ ## DESCRIPTION
10
+
11
+ The aia command-line tool is an interface for interacting with an AI model backend, providing a simple way to send prompts and receive responses. The CLI supports various options to customize the interaction, load a configuration file, edit prompts, set debugging levels, and more.
12
+
13
+ ## ARGUMENTS
14
+
15
+ *PROMPT_ID*
16
+ : This is a required argument.
17
+
18
+ *CONTEXT_FILES*
19
+ : This is an optional argument. One or more files can be added to the prompt as context for the backend gen-AI tool to process.
20
+
21
+ *EXTERNAL_OPTIONS*
22
+ : External options are optional. Anything that follow " -- " will be sent to the backend gen-AI tool. For example "-- -C -m gpt4-128k" will send the options "-C -m gpt4-128k" to the backend gen-AI tool. `aia` will not validate these external options before sending them to the backend gen-AI tool.
23
+
24
+ ## OPTIONS
25
+
26
+ `-c`, `--config` *PATH_TO_CONFIG_FILE*
27
+ : Load Config File - default: nil
28
+
29
+ `--dump` *FORMAT*
30
+ : Dump a Config File in [yaml | toml] to STDOUT - default: nil
31
+
32
+ `-e`, `--edit`
33
+ : Edit the Prompt File - default: false
34
+
35
+ `-d`, `--debug`
36
+ : Turn On Debugging - default: false
37
+
38
+ `-v`, `--verbose`
39
+ : Be Verbose - default: false
40
+
41
+ `--version`
42
+ : Print Version - default: false
43
+
44
+ `-h`, `--help`
45
+ : Show Usage - default: false
46
+
47
+ `-s`, `--search` *TERM*
48
+ : Search for prompts contain TERM - default: nil
49
+
50
+ `-f`, --fuzzy`
51
+ : Use Fuzzy Matching when searching for a prompt - default: false
52
+
53
+ `--completion` *SHELL_NAME*
54
+ : Show completion script for bash|zsh|fish - default: nil
55
+
56
+ `-o`, `--[no]-output` *PATH_TO_OUTPUT_FILE*
57
+ : Out FILENAME - default: ./temp.md
58
+
59
+ `-l`, `--[no]-log` *PATH_TO_LOG_FILE*
60
+ : Log FILEPATH - default: $HOME/.prompts/prompts.log
61
+
62
+ `-m`, `--[no]-markdown`
63
+ : Format with Markdown - default: true
64
+
65
+ `--model` *NAME*
66
+ : Name of the LLM model to use - default: gpt-4-1106-preview
67
+
68
+ `-p`, `--prompts` *PATH_TO_DIRECTORY*
69
+ : Directory containing the prompt files - default: ~/.prompts
70
+
71
+ `-b`, `--[no]-backend` *LLM TOOL*
72
+ : Specify the backend prompt resolver - default: :mods
73
+
74
+ ## ENVIRONMENT
75
+ The aia CLI uses the following environment variables:
76
+
77
+ - `AIA_PROMPTS_DIR`: Path to the directory containing prompts files - default: `$HOME/.prompts_dir`
78
+ - `AIA_BACKEND`: The AI command-line program used - default: `mods`
79
+ - `EDITOR`: The text editor used by the edit option - default: edit
80
+ - `AIA_MODEL`: The AI model specification - default: `gpt-4-1106-preview`
81
+ - `AIA_OUTPUT`: The default filename for output - default: `./temp.md`
82
+ - `AIA_PROMPT_LOG`: The default filepath for the prompts log - default: `$HOME/.prompts/_prompts.log`
83
+
84
+ Additionally, the program requires an OpenAI access key, which can be specified using one of the following environment variables:
85
+
86
+ - `OPENAI_ACCESS_TOKEN`
87
+ - `OPENAI_API_KEY`
88
+
89
+ Currently there is not specific standard for name of the OpenAI key. Some programs use one name, while others use a different name. Both of the envars listed above mean the same thing. If you use more than one tool to access OpenAI resources, you may have to set several envars to the same key value.
90
+
91
+ To acquire an OpenAI access key, first create an account on the OpenAI platform, where further documentation is available.
92
+
93
+ ## USAGE NOTES
94
+ `aia` is designed for flexibility, allowing users to pass prompt ids and context files as arguments. Some options change the behavior of the output, such as `--output` for specifying a file or `--no-output` for disabling file output in favor of standard output.
95
+
96
+ The `--completion` option displays a script that enables prompt ID auto-completion for bash, zsh, or fish shells. It's crucial to integrate the script into the shell's runtime to take effect.
97
+
98
+ ## SEE ALSO
99
+ - [OpenAI Platform Documentation](https://platform.openai.com/docs/overview) for more information on [obtaining access tokens](https://platform.openai.com/account/api-keys) and working with OpenAI models.
100
+
101
+ - [mods](https://github.com/charmbracelet/mods) for more information on `mods` - AI for the command line, built for pipelines. LLM based AI is really good at interpreting the output of commands and returning the results in CLI friendly text formats like Markdown. Mods is a simple tool that makes it super easy to use AI on the command line and in your pipelines. Mods works with [OpenAI](https://platform.openai.com/account/api-keys) and [LocalAI](https://github.com/go-skynet/LocalAI)
102
+
103
+ - [sgpt](https://github.com/tbckr/sgpt) (aka shell-gpt) is a powerful command-line interface (CLI) tool designed for seamless interaction with OpenAI models directly from your terminal. Effortlessly run queries, generate shell commands or code, create images from text, and more, using simple commands. Streamline your workflow and enhance productivity with this powerful and user-friendly CLI tool.
104
+
105
+ ## AUTHOR
106
+
107
+ Dewayne VanHoozer <dvanhoozer@gmail.com>
metadata CHANGED
@@ -1,15 +1,29 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: aia
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.4
4
+ version: 0.3.20
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dewayne VanHoozer
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-12-02 00:00:00.000000000 Z
11
+ date: 2023-12-28 00:00:00.000000000 Z
12
12
  dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: hashie
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ">="
18
+ - !ruby/object:Gem::Version
19
+ version: '0'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ">="
25
+ - !ruby/object:Gem::Version
26
+ version: '0'
13
27
  - !ruby/object:Gem::Dependency
14
28
  name: prompt_manager
15
29
  requirement: !ruby/object:Gem::Requirement
@@ -24,6 +38,62 @@ dependencies:
24
38
  - - ">="
25
39
  - !ruby/object:Gem::Version
26
40
  version: '0'
41
+ - !ruby/object:Gem::Dependency
42
+ name: semver2
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - ">="
46
+ - !ruby/object:Gem::Version
47
+ version: '0'
48
+ type: :runtime
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - ">="
53
+ - !ruby/object:Gem::Version
54
+ version: '0'
55
+ - !ruby/object:Gem::Dependency
56
+ name: shellwords
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - ">="
60
+ - !ruby/object:Gem::Version
61
+ version: '0'
62
+ type: :runtime
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - ">="
67
+ - !ruby/object:Gem::Version
68
+ version: '0'
69
+ - !ruby/object:Gem::Dependency
70
+ name: toml-rb
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - ">="
74
+ - !ruby/object:Gem::Version
75
+ version: '0'
76
+ type: :runtime
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - ">="
81
+ - !ruby/object:Gem::Version
82
+ version: '0'
83
+ - !ruby/object:Gem::Dependency
84
+ name: minitest
85
+ requirement: !ruby/object:Gem::Requirement
86
+ requirements:
87
+ - - ">="
88
+ - !ruby/object:Gem::Version
89
+ version: '0'
90
+ type: :development
91
+ prerelease: false
92
+ version_requirements: !ruby/object:Gem::Requirement
93
+ requirements:
94
+ - - ">="
95
+ - !ruby/object:Gem::Version
96
+ version: '0'
27
97
  - !ruby/object:Gem::Dependency
28
98
  name: amazing_print
29
99
  requirement: !ruby/object:Gem::Requirement
@@ -53,7 +123,7 @@ dependencies:
53
123
  - !ruby/object:Gem::Version
54
124
  version: '0'
55
125
  - !ruby/object:Gem::Dependency
56
- name: minitest
126
+ name: kramdown-man
57
127
  requirement: !ruby/object:Gem::Requirement
58
128
  requirements:
59
129
  - - ">="
@@ -94,37 +164,36 @@ extensions: []
94
164
  extra_rdoc_files: []
95
165
  files:
96
166
  - ".envrc"
167
+ - ".semver"
97
168
  - CHANGELOG.md
98
169
  - LICENSE
99
170
  - LICENSE.txt
100
171
  - README.md
101
172
  - Rakefile
102
173
  - bin/aia
174
+ - justfile
103
175
  - lib/aia.rb
104
176
  - lib/aia/aia_completion.bash
105
177
  - lib/aia/aia_completion.fish
106
178
  - lib/aia/aia_completion.zsh
107
179
  - lib/aia/cli.rb
108
- - lib/aia/configuration.rb
109
- - lib/aia/external.rb
110
- - lib/aia/external/,keep
111
- - lib/aia/external/.irbrc
112
- - lib/aia/external/ag.rb
113
- - lib/aia/external/bat.rb
114
- - lib/aia/external/fzf.rb
115
- - lib/aia/external/glow.rb
116
- - lib/aia/external/mods.rb
117
- - lib/aia/external/rg.rb
118
- - lib/aia/external/sgpt.rb
119
- - lib/aia/external/subl.rb
120
- - lib/aia/external/tool.rb
121
- - lib/aia/external_two.rb
180
+ - lib/aia/config.rb
122
181
  - lib/aia/logging.rb
123
182
  - lib/aia/main.rb
124
183
  - lib/aia/prompt_processing.rb
184
+ - lib/aia/tools.rb
185
+ - lib/aia/tools/editor.rb
186
+ - lib/aia/tools/mods.rb
187
+ - lib/aia/tools/sgpt.rb
188
+ - lib/aia/tools/subl.rb
189
+ - lib/aia/tools/temp.md
190
+ - lib/aia/tools/vim.rb
125
191
  - lib/aia/version.rb
126
192
  - lib/core_ext/string_wrap.rb
127
193
  - lib/modularization_plan.md
194
+ - main.just
195
+ - man/aia.1
196
+ - man/aia.1.md
128
197
  homepage: https://github.com/MadBomber/aia
129
198
  licenses:
130
199
  - MIT
@@ -148,7 +217,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
148
217
  - !ruby/object:Gem::Version
149
218
  version: '0'
150
219
  requirements: []
151
- rubygems_version: 3.4.22
220
+ rubygems_version: 3.5.3
152
221
  signing_key:
153
222
  specification_version: 4
154
223
  summary: AI Assistant (aia) a command-line (CLI) utility
@@ -1,39 +0,0 @@
1
- # lib/aia/configuration.rb
2
-
3
- HOME = Pathname.new(ENV['HOME'])
4
- PROMPTS_DIR = Pathname.new(ENV['PROMPTS_DIR'] || (HOME + ".prompts_dir"))
5
-
6
- AI_CLI_PROGRAM = "mods"
7
- EDITOR = ENV['EDITOR'] || 'edit'
8
- MY_NAME = "aia"
9
- MODS_MODEL = ENV['MODS_MODEL'] || 'gpt-4-1106-preview'
10
- OUTPUT = Pathname.pwd + "temp.md"
11
- PROMPT_LOG = PROMPTS_DIR + "_prompts.log"
12
-
13
-
14
- module AIA::Configuration
15
- def setup_configuration
16
- @prompt = nil
17
-
18
- PromptManager::Prompt.storage_adapter =
19
- PromptManager::Storage::FileSystemAdapter.config do |config|
20
- config.prompts_dir = PROMPTS_DIR
21
- config.prompt_extension = '.txt'
22
- config.params_extension = '.json'
23
- config.search_proc = nil
24
- # TODO: add the rgfzz script for search_proc
25
- end.new
26
- end
27
-
28
-
29
- # Get the additional CLI arguments intended for the
30
- # backend gen-AI processor.
31
- def extract_extra_options
32
- extra_index = @arguments.index('--')
33
- if extra_index.nil?
34
- @extra_options = []
35
- else
36
- @extra_options = @arguments.slice!(extra_index..-1)[1..]
37
- end
38
- end
39
- end
File without changes
@@ -1,11 +0,0 @@
1
-
2
-
3
-
4
- module AIA
5
- module External
6
- end
7
- end
8
-
9
- require_relative 'tool'
10
- include AIA
11
- include External