aia 0.8.4 → 0.8.5

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 8e3b68ad8d2e1a8fb2d1e8ad7f914f1660be948bd591027884fac746f22bc006
4
- data.tar.gz: 9ca5aaadda10b6f09cc559140f2d79210e93ea9c1106a41c1309e93e8eafe670
3
+ metadata.gz: 307fe4fba0b6c2134cba097ffd9b01750eea1f3e06d6c6de5131099435caaa16
4
+ data.tar.gz: ac46548236f1c9162d62af9a999776d9a01ffa5cc8ff283ed9bfd774414ddc85
5
5
  SHA512:
6
- metadata.gz: 7a2002dbc191d05a8aa6c70f534049f049f8ed8721cacc6b93873f25a12deb256364ae324fd90971456a609ae0cb1cc899a5dc50a827175bc379a73c20614108
7
- data.tar.gz: 3845d59a7f7a026f1cd60566cfc5eaf39658c7c49bc822e195c622d9e5799d2ebe76b52d26f2d1ece5093c22a7a811e6e19ab1985d8b13ad723260dcd329f47c
6
+ metadata.gz: '09ec4085dabf70365ccc74a95126891a6075eefc57ad1a652432278b38355f55d2c503ebc6e10b52d9f77e3d7788fef0a9b1d9d6e6aa3b7d72b2cda82d337c08'
7
+ data.tar.gz: 84eed4f09f8d9d506887ea91cd9b810cc47e77a724c3031e43b464779e5cfcaf5f0a92cc30304bf0d6ffea0eb31e35a23dc2baabff1671cff1bca8852b7e7801
data/.version CHANGED
@@ -1 +1 @@
1
- 0.8.4
1
+ 0.8.5
data/CHANGELOG.md CHANGED
@@ -2,6 +2,11 @@
2
2
  ## [Unreleased]
3
3
 
4
4
  ## Released
5
+ ### [0.8.5] 2025-04-49
6
+ - documentation updates
7
+ - integrated the https://pure.md web service for inserting web pages into the context window
8
+ - //include http?://example.com/stuff
9
+ - //webpage http?://example.com/stuff
5
10
 
6
11
  ### [0.8.2] 2025-04-18
7
12
  - fixed problems with pre-loaded context and chat repl
data/README.md CHANGED
@@ -17,64 +17,60 @@
17
17
  AIA leverages the [prompt_manager gem](https://github.com/madbomber/prompt_manager) to manage prompts. It utilizes the [CLI tool fzf](https://github.com/junegunn/fzf) for prompt selection.
18
18
 
19
19
  **Most Recent Change**: Refer to the [Changelog](CHANGELOG.md)
20
+ - //include directive now supports web URLs
21
+ - //webpage insert web URL content as markdown into context
20
22
 
21
- **Notable Recent Changes:**
22
- - **Directive Processing in Chat and Prompts:** You can now use directives in chat sessions and prompt files with the syntax: `//command args`. Supported directives include:
23
- - `shell`/`sh`: Execute shell commands
24
- - `ruby`/`rb`: Execute Ruby code
25
- - `config`/`cfg`: Display or update configuration
26
- - `include`/`inc`: Include file content
27
- - `next`: Specify the next prompt ID in a sequence
28
- - `pipeline`: Specify a pipeline of prompt IDs to process
29
- - `clear`: Clear the context (handy in a chat session)
30
- - `help`: Show available directives
23
+ **Wiki**: [Checkout the AIA Wiki](https://github.com/MadBomber/aia/wiki)
31
24
 
25
+ **Notable Recent Changes:**
26
+ - **Directive Processing in Chat and Prompts:** You can now use directives in chat sessions and prompt files. Use the directive **//help** to get a list of available directives.
32
27
 
33
28
  <!-- Tocer[start]: Auto-generated, don't remove. -->
34
29
 
35
30
  ## Table of Contents
36
31
 
37
- - [Table of Contents](#table-of-contents)
38
- - [Installation](#installation)
39
- - [What is a Prompt ID?](#what-is-a-prompt-id)
40
- - [Configuration Options](#configuration-options)
41
- - [Configuration Flexibility](#configuration-flexibility)
42
- - [Expandable Configuration](#expandable-configuration)
43
- - [Shell Integration inside of a Prompt](#shell-integration-inside-of-a-prompt)
44
- - [Dynamic Shell Commands](#dynamic-shell-commands)
45
- - [Shell Command Safety](#shell-command-safety)
46
- - [Chat Session Use](#chat-session-use)
47
- - [*E*mbedded *R*u*B*y (ERB)](#embedded-ruby-erb)
48
- - [Prompt Directives](#prompt-directives)
49
- - [Parameter and Shell Substitution in Directives](#parameter-and-shell-substitution-in-directives)
50
- - [Directive Syntax](#directive-syntax)
51
- - [AIA Specific Directive Commands](#aia-specific-directive-commands)
52
- - [//config](#config)
53
- - [//include](#include)
54
- - [//ruby](#ruby)
55
- - [//shell](#shell)
56
- - [//next](#next)
57
- - [//pipeline](#pipeline)
58
- - [Using Directives in Chat Sessions](#using-directives-in-chat-sessions)
59
- - [Prompt Sequences](#prompt-sequences)
60
- - [--next](#--next)
61
- - [--pipeline](#--pipeline)
62
- - [Best Practices ??](#best-practices-)
63
- - [Example pipeline](#example-pipeline)
64
- - [All About ROLES](#all-about-roles)
65
- - [The --roles\_prefix (AIA\_ROLES\_PREFIX)](#the---roles_prefix-aia_roles_prefix)
66
- - [The --role Option](#the---role-option)
67
- - [Other Ways to Insert Roles into Prompts](#other-ways-to-insert-roles-into-prompts)
68
- - [External CLI Tools Used](#external-cli-tools-used)
69
- - [Shell Completion](#shell-completion)
70
- - [My Most Powerful Prompt](#my-most-powerful-prompt)
71
- - [My Configuration](#my-configuration)
72
- - [Executable Prompts](#executable-prompts)
73
- - [Development](#development)
74
- - [Contributing](#contributing)
75
- - [History of Development](#history-of-development)
76
- - [Roadmap](#roadmap)
77
- - [License](#license)
32
+ - [Installation](#installation)
33
+ - [What is a Prompt ID?](#what-is-a-prompt-id)
34
+ - [Embedded Parameters as Placeholders](#embedded-parameters-as-placeholders)
35
+ - [Usage](#usage)
36
+ - [Configuration Options](#configuration-options)
37
+ - [Configuration Flexibility](#configuration-flexibility)
38
+ - [Expandable Configuration](#expandable-configuration)
39
+ - [Shell Integration inside of a Prompt](#shell-integration-inside-of-a-prompt)
40
+ - [Dynamic Shell Commands](#dynamic-shell-commands)
41
+ - [Shell Command Safety](#shell-command-safety)
42
+ - [Chat Session Use](#chat-session-use)
43
+ - [*E*mbedded *R*u*B*y (ERB)](#embedded-ruby-erb)
44
+ - [Prompt Directives](#prompt-directives)
45
+ - [Parameter and Shell Substitution in Directives](#parameter-and-shell-substitution-in-directives)
46
+ - [Directive Syntax](#directive-syntax)
47
+ - [AIA Specific Directive Commands](#aia-specific-directive-commands)
48
+ - [//config](#config)
49
+ - [//include](#include)
50
+ - [//ruby](#ruby)
51
+ - [//shell](#shell)
52
+ - [//next](#next)
53
+ - [//pipeline](#pipeline)
54
+ - [Using Directives in Chat Sessions](#using-directives-in-chat-sessions)
55
+ - [Prompt Sequences](#prompt-sequences)
56
+ - [--next](#--next)
57
+ - [--pipeline](#--pipeline)
58
+ - [Best Practices ??](#best-practices-)
59
+ - [Example pipeline](#example-pipeline)
60
+ - [All About ROLES](#all-about-roles)
61
+ - [The --roles_prefix (AIA_ROLES_PREFIX)](#the---roles_prefix-aia_roles_prefix)
62
+ - [The --role Option](#the---role-option)
63
+ - [Other Ways to Insert Roles into Prompts](#other-ways-to-insert-roles-into-prompts)
64
+ - [External CLI Tools Used](#external-cli-tools-used)
65
+ - [Shell Completion](#shell-completion)
66
+ - [My Most Powerful Prompt](#my-most-powerful-prompt)
67
+ - [My Configuration](#my-configuration)
68
+ - [Executable Prompts](#executable-prompts)
69
+ - [Development](#development)
70
+ - [Contributing](#contributing)
71
+ - [History of Development](#history-of-development)
72
+ - [Roadmap](#roadmap)
73
+ - [License](#license)
78
74
 
79
75
  <!-- Tocer[finish]: Auto-generated, don't remove. -->
80
76
 
@@ -89,7 +85,7 @@ Install the command-line utilities by executing:
89
85
 
90
86
  brew install fzf
91
87
 
92
- You will also need to establish a directory in your file system where your prompt text files, last used parameters and usage log files are kept.
88
+ You will also need to establish a directory in your filesystem where your prompt text files, last used parameters and usage log files are kept.
93
89
 
94
90
  Setup a system environment variable (envar) named "AIA_PROMPTS_DIR" that points to your prompts directory. The default is in your HOME directory named ".prompts". The envar "AIA_ROLES_PREFIX" points to your role prefix where you have prompts that define the different roles you want the LLM to assume when it is doing its work. The default roles prefix is "roles".
95
91
 
@@ -103,7 +99,7 @@ aia --completion bash
103
99
 
104
100
  ## What is a Prompt ID?
105
101
 
106
- A prompt ID is the basename of a text file (extension *.txt) located in a prompts directory. The prompts directory is specified by the environment variable "AIA_PROMPTS_DIR". If this variable is not set, the default is in your HOME directory named ".prompts". It can also be set on the command line with the `--prompts-dir` option.
102
+ A prompt ID is the basename of a text file (extension *.txt) located in a prompts directory. The prompts directory is specified by the environment variable "AIA_PROMPTS_DIR". If this variable is not set, the default is in your HOME directory named ".prompts". It can also be set on the command line with the `--prompts-dir` option.
107
103
 
108
104
  This file contains the context and instructions for the LLM to follow. The prompt ID is what you use as an option on the command line to specify which prompt text file to use. Prompt files can have comments, parameters, directives and ERB blocks along with the instruction text to feed to the LLM. It can also have shell commands and use system environment variables. Consider the following example:
109
105
 
@@ -141,7 +137,7 @@ Tell me how to do something for a $(uname -s) platform that would rename all
141
137
  of the files in the directory $MY_DIRECTORY to have a prefix of for its filename
142
138
  that is [PREFIX] and a ${SUFFIX}
143
139
 
144
- <!--
140
+ <!--
145
141
  directives, ERB blocks and other junk can be used
146
142
  anywhere in the file mixing dynamic context/instructions with
147
143
  the static stuff.
@@ -1,7 +1,10 @@
1
1
  # lib/aia/directive_processor.rb
2
2
 
3
+ require 'faraday'
4
+
3
5
  module AIA
4
6
  class DirectiveProcessor
7
+ PUREMD_API_KEY = ENV.fetch('PUREMD_API_KEY', nil)
5
8
  EXCLUDED_METHODS = %w[ run initialize private? ]
6
9
  @descriptions = {}
7
10
  @aliases = {}
@@ -100,10 +103,32 @@ module AIA
100
103
  !respond_to?(method_name) && respond_to?(method_name, true)
101
104
  end
102
105
 
106
+
103
107
  ################
104
108
  ## Directives ##
105
109
  ################
106
110
 
111
+
112
+ desc "webpage inserted as markdown to context using pure.md"
113
+ def webpage(args, context_manager=nil)
114
+ if PUREMD_API_KEY.nil?
115
+ "ERROR: PUREMD_API_KEY is required in order to include a webpage"
116
+ else
117
+ url = `echo #{args.shift}`.strip
118
+ puremd_url = "https://pure.md/#{url}"
119
+
120
+ response = Faraday.get(puremd_url) do |req|
121
+ req.headers['x-puremd-api-token'] = PUREMD_API_KEY
122
+ end
123
+
124
+ if 200 == response.status
125
+ response.body
126
+ else
127
+ "Error: wtatus was #{r.status}\n#{ap response}"
128
+ end
129
+ end
130
+ end
131
+
107
132
  desc "Specify the next prompt ID to process after this one"
108
133
  def next(args = [])
109
134
  if args.empty?
@@ -129,6 +154,10 @@ module AIA
129
154
  # echo takes care of envars and tilde expansion
130
155
  file_path = `echo #{args.shift}`.strip
131
156
 
157
+ if file_path.start_with?(/http?:\/\//)
158
+ return webpage(args)
159
+ end
160
+
132
161
  if @included_files.include?(file_path)
133
162
  ""
134
163
  else
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: aia
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.8.4
4
+ version: 0.8.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dewayne VanHoozer
@@ -37,6 +37,20 @@ dependencies:
37
37
  - - ">="
38
38
  - !ruby/object:Gem::Version
39
39
  version: '0'
40
+ - !ruby/object:Gem::Dependency
41
+ name: faraday
42
+ requirement: !ruby/object:Gem::Requirement
43
+ requirements:
44
+ - - ">="
45
+ - !ruby/object:Gem::Version
46
+ version: '0'
47
+ type: :runtime
48
+ prerelease: false
49
+ version_requirements: !ruby/object:Gem::Requirement
50
+ requirements:
51
+ - - ">="
52
+ - !ruby/object:Gem::Version
53
+ version: '0'
40
54
  - !ruby/object:Gem::Dependency
41
55
  name: os
42
56
  requirement: !ruby/object:Gem::Requirement
@@ -247,17 +261,13 @@ dependencies:
247
261
  - - ">="
248
262
  - !ruby/object:Gem::Version
249
263
  version: '0'
250
- description: A command-line AI Assistante (aia) that provides pre-compositional template
251
- prompt management to various backend gen-AI processes such as llm, mods and sgpt
252
- support processing of prompts both via remote API calls as well as keeping everything
253
- local through the use of locally managed models and the LocalAI API. Complete shell
254
- integration allows a prompt to access system environment variables and execut shell
255
- commands as part of the prompt content. In addition full embedded Ruby support
256
- is provided given even more dynamic prompt conditional content. It is a generalized
257
- power house that rivals specialized gen-AI tools. aia currently supports "mods"
258
- and "sgpt" CLI tools. aia uses "ripgrep" and "fzf" CLI utilities to search for
259
- and select prompt files to send to the backend gen-AI tool along with supported
260
- context files.
264
+ description: |
265
+ Unleash the full power of AI from your terminal! AIA is a cutting-edge CLI
266
+ assistant for generative AI workflows, offering dynamic prompt management,
267
+ seamless shell and Ruby integration, interactive chat, and advanced automation.
268
+ Effortlessly craft, manage, and execute prompts with embedded directives,
269
+ history, and flexible configuration. Experience next-level productivity for
270
+ developers, power users, and AI enthusiasts—all from your command line.
261
271
  email:
262
272
  - dvanhoozer@gmail.com
263
273
  executables:
@@ -321,5 +331,6 @@ required_rubygems_version: !ruby/object:Gem::Requirement
321
331
  requirements: []
322
332
  rubygems_version: 3.6.8
323
333
  specification_version: 4
324
- summary: AI Assistant (aia) a command-line (CLI) utility
334
+ summary: 'AI Assistant: dynamic prompts, shell & Ruby integration, and seamless chat
335
+ workflows.'
325
336
  test_files: []