ruboty-ai_agent 0.1.0 → 0.3.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 (89) hide show
  1. checksums.yaml +4 -4
  2. data/.rubocop.yml +19 -0
  3. data/AGENTS.md +8 -0
  4. data/CHANGELOG.md +14 -2
  5. data/Gemfile +10 -3
  6. data/README.md +2 -0
  7. data/Rakefile +4 -0
  8. data/Steepfile +1 -0
  9. data/lib/ruboty/ai_agent/actions/add_ai_command.rb +16 -1
  10. data/lib/ruboty/ai_agent/actions/add_mcp.rb +7 -2
  11. data/lib/ruboty/ai_agent/actions/base.rb +11 -1
  12. data/lib/ruboty/ai_agent/actions/chat.rb +56 -19
  13. data/lib/ruboty/ai_agent/actions/list_ai_commands.rb +20 -4
  14. data/lib/ruboty/ai_agent/actions/list_mcp.rb +50 -3
  15. data/lib/ruboty/ai_agent/actions/remove_ai_command.rb +7 -1
  16. data/lib/ruboty/ai_agent/actions/show_system_prompt.rb +1 -1
  17. data/lib/ruboty/ai_agent/agent.rb +3 -3
  18. data/lib/ruboty/ai_agent/chat_message.rb +7 -2
  19. data/lib/ruboty/ai_agent/chat_thread_messages.rb +40 -0
  20. data/lib/ruboty/ai_agent/commands/base.rb +16 -14
  21. data/lib/ruboty/ai_agent/commands/builtin_base.rb +39 -0
  22. data/lib/ruboty/ai_agent/commands/clear.rb +2 -14
  23. data/lib/ruboty/ai_agent/commands/compact.rb +4 -47
  24. data/lib/ruboty/ai_agent/commands/prompt_command.rb +60 -0
  25. data/lib/ruboty/ai_agent/commands/usage.rb +2 -14
  26. data/lib/ruboty/ai_agent/commands.rb +9 -17
  27. data/lib/ruboty/ai_agent/database/query_methods.rb +31 -6
  28. data/lib/ruboty/ai_agent/database.rb +2 -1
  29. data/lib/ruboty/ai_agent/http_mcp_client.rb +5 -2
  30. data/lib/ruboty/ai_agent/llm/openai.rb +6 -6
  31. data/lib/ruboty/ai_agent/mcp_clients.rb +5 -12
  32. data/lib/ruboty/ai_agent/mcp_configuration.rb +3 -2
  33. data/lib/ruboty/ai_agent/prompt_command_definition.rb +17 -0
  34. data/lib/ruboty/ai_agent/record_set.rb +9 -5
  35. data/lib/ruboty/ai_agent/recordable.rb +11 -9
  36. data/lib/ruboty/ai_agent/request.rb +17 -0
  37. data/lib/ruboty/ai_agent/token_usage.rb +10 -0
  38. data/lib/ruboty/ai_agent/tool.rb +11 -3
  39. data/lib/ruboty/ai_agent/tool_definitions/base.rb +84 -0
  40. data/lib/ruboty/ai_agent/tool_definitions/think.rb +41 -0
  41. data/lib/ruboty/ai_agent/tool_definitions.rb +19 -0
  42. data/lib/ruboty/ai_agent/user.rb +5 -0
  43. data/lib/ruboty/ai_agent/user_mcp_caches.rb +2 -2
  44. data/lib/ruboty/ai_agent/user_mcp_client.rb +5 -4
  45. data/lib/ruboty/ai_agent/user_prompt_command_definitions.rb +17 -0
  46. data/lib/ruboty/ai_agent/version.rb +1 -1
  47. data/lib/ruboty/ai_agent.rb +13 -0
  48. data/lib/ruboty/handlers/ai_agent.rb +28 -16
  49. data/rbs_collection.yaml +1 -0
  50. data/ruboty-ai_agent.gemspec +2 -6
  51. data/script/clean-orphaned-rbs.rb +105 -0
  52. data/script/generate-concern-rbs.rb +5 -5
  53. data/script/generate-data-rbs.rb +3 -5
  54. data/script/generate-memorized-ivar-rbs.rb +6 -11
  55. data/sig/generated/ruboty/ai_agent/actions/add_ai_command.rbs +4 -0
  56. data/sig/generated/ruboty/ai_agent/actions/base.rbs +4 -0
  57. data/sig/generated/ruboty/ai_agent/actions/chat.rbs +10 -0
  58. data/sig/generated/ruboty/ai_agent/actions/list_mcp.rbs +11 -0
  59. data/sig/generated/ruboty/ai_agent/agent.rbs +1 -1
  60. data/sig/generated/ruboty/ai_agent/chat_message.rbs +5 -2
  61. data/sig/generated/ruboty/ai_agent/chat_thread_messages.rbs +14 -0
  62. data/sig/generated/ruboty/ai_agent/commands/base.rbs +8 -19
  63. data/sig/generated/ruboty/ai_agent/commands/builtin_base.rbs +40 -0
  64. data/sig/generated/ruboty/ai_agent/commands/clear.rbs +2 -10
  65. data/sig/generated/ruboty/ai_agent/commands/compact.rbs +2 -20
  66. data/sig/generated/ruboty/ai_agent/commands/prompt_command.rbs +26 -0
  67. data/sig/generated/ruboty/ai_agent/commands/usage.rbs +2 -10
  68. data/sig/generated/ruboty/ai_agent/commands.rbs +3 -4
  69. data/sig/generated/ruboty/ai_agent/database/query_methods.rbs +18 -12
  70. data/sig/generated/ruboty/ai_agent/database.rbs +3 -1
  71. data/sig/generated/ruboty/ai_agent/llm/openai.rbs +3 -3
  72. data/sig/generated/ruboty/ai_agent/mcp_clients.rbs +0 -5
  73. data/sig/generated/ruboty/ai_agent/mcp_configuration.rbs +4 -2
  74. data/sig/generated/ruboty/ai_agent/prompt_command_definition.rbs +23 -0
  75. data/sig/generated/ruboty/ai_agent/record_set.rbs +11 -9
  76. data/sig/generated/ruboty/ai_agent/recordable.rbs +6 -6
  77. data/sig/generated/ruboty/ai_agent/request.rbs +23 -0
  78. data/sig/generated/ruboty/ai_agent/token_usage.rbs +4 -0
  79. data/sig/generated/ruboty/ai_agent/tool.rbs +9 -3
  80. data/sig/generated/ruboty/ai_agent/tool_definitions/base.rbs +52 -0
  81. data/sig/generated/ruboty/ai_agent/tool_definitions/think.rbs +17 -0
  82. data/sig/generated/ruboty/ai_agent/tool_definitions.rbs +12 -0
  83. data/sig/generated/ruboty/ai_agent/user.rbs +4 -0
  84. data/sig/generated/ruboty/ai_agent/user_mcp_client.rbs +4 -2
  85. data/sig/generated/ruboty/ai_agent/user_prompt_command_definitions.rbs +12 -0
  86. data/sig/generated/ruboty/handlers/ai_agent.rbs +12 -12
  87. data/sig/generated-by-scripts/concerns.rbs +5 -0
  88. data/sig/generated-by-scripts/memorized_ivars.rbs +19 -0
  89. metadata +19 -57
@@ -4,29 +4,29 @@ module Ruboty
4
4
  module Handlers
5
5
  # Handler for AI agent commands
6
6
  class AiAgent < Base
7
- def chat: (untyped message) -> untyped
7
+ def chat: (untyped message) -> true
8
8
 
9
- def add_mcp: (untyped message) -> untyped
9
+ def add_mcp: (untyped message) -> true
10
10
 
11
- def remove_mcp: (untyped message) -> untyped
11
+ def remove_mcp: (untyped message) -> true
12
12
 
13
- def list_mcp: (untyped message) -> untyped
13
+ def list_mcp: (untyped message) -> true
14
14
 
15
- def set_system_prompt: (untyped message) -> untyped
15
+ def set_system_prompt: (untyped message) -> true
16
16
 
17
- def show_system_prompt: (untyped message) -> untyped
17
+ def show_system_prompt: (untyped message) -> true
18
18
 
19
- def add_ai_memory: (untyped message) -> untyped
19
+ def add_ai_memory: (untyped message) -> true
20
20
 
21
- def remove_ai_memory: (untyped message) -> untyped
21
+ def remove_ai_memory: (untyped message) -> true
22
22
 
23
- def list_ai_memories: (untyped message) -> untyped
23
+ def list_ai_memories: (untyped message) -> true
24
24
 
25
- def add_ai_command: (untyped message) -> untyped
25
+ def add_ai_command: (untyped message) -> true
26
26
 
27
- def remove_ai_command: (untyped message) -> untyped
27
+ def remove_ai_command: (untyped message) -> true
28
28
 
29
- def list_ai_commands: (untyped message) -> untyped
29
+ def list_ai_commands: (untyped message) -> true
30
30
  end
31
31
  end
32
32
  end
@@ -18,6 +18,11 @@ module Ruboty
18
18
  prepend Recordable::PrependMethods
19
19
  end
20
20
 
21
+ class PromptCommandDefinition
22
+ extend Recordable::ClassMethods
23
+ prepend Recordable::PrependMethods
24
+ end
25
+
21
26
  class TokenUsage
22
27
  extend Recordable::ClassMethods
23
28
  prepend Recordable::PrependMethods
@@ -13,6 +13,16 @@ module Ruboty
13
13
  end
14
14
  end
15
15
 
16
+ module Ruboty
17
+ module AiAgent
18
+ module Actions
19
+ class Chat
20
+ @request: Request
21
+ end
22
+ end
23
+ end
24
+ end
25
+
16
26
  module Ruboty
17
27
  module AiAgent
18
28
  class ChatThread
@@ -21,6 +31,14 @@ module Ruboty
21
31
  end
22
32
  end
23
33
 
34
+ module Ruboty
35
+ module AiAgent
36
+ class Database
37
+ @global_settings: GlobalSettings
38
+ end
39
+ end
40
+ end
41
+
24
42
  module Ruboty
25
43
  module AiAgent
26
44
  module LLM
@@ -37,6 +55,7 @@ module Ruboty
37
55
  @mcp_configurations: UserMcpConfigurations
38
56
  @ai_memories: UserAiMemories
39
57
  @mcp_tools_caches: UserMcpToolsCaches
58
+ @prompt_command_definitions: UserPromptCommandDefinitions
40
59
  end
41
60
  end
42
61
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ruboty-ai_agent
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tomoya Chiba
@@ -9,62 +9,6 @@ bindir: exe
9
9
  cert_chain: []
10
10
  date: 1980-01-02 00:00:00.000000000 Z
11
11
  dependencies:
12
- - !ruby/object:Gem::Dependency
13
- name: bundler
14
- requirement: !ruby/object:Gem::Requirement
15
- requirements:
16
- - - "~>"
17
- - !ruby/object:Gem::Version
18
- version: '2'
19
- type: :development
20
- prerelease: false
21
- version_requirements: !ruby/object:Gem::Requirement
22
- requirements:
23
- - - "~>"
24
- - !ruby/object:Gem::Version
25
- version: '2'
26
- - !ruby/object:Gem::Dependency
27
- name: rake
28
- requirement: !ruby/object:Gem::Requirement
29
- requirements:
30
- - - "~>"
31
- - !ruby/object:Gem::Version
32
- version: '13'
33
- type: :development
34
- prerelease: false
35
- version_requirements: !ruby/object:Gem::Requirement
36
- requirements:
37
- - - "~>"
38
- - !ruby/object:Gem::Version
39
- version: '13'
40
- - !ruby/object:Gem::Dependency
41
- name: rspec
42
- requirement: !ruby/object:Gem::Requirement
43
- requirements:
44
- - - "~>"
45
- - !ruby/object:Gem::Version
46
- version: '3.0'
47
- type: :development
48
- prerelease: false
49
- version_requirements: !ruby/object:Gem::Requirement
50
- requirements:
51
- - - "~>"
52
- - !ruby/object:Gem::Version
53
- version: '3.0'
54
- - !ruby/object:Gem::Dependency
55
- name: webmock
56
- requirement: !ruby/object:Gem::Requirement
57
- requirements:
58
- - - "~>"
59
- - !ruby/object:Gem::Version
60
- version: '3.0'
61
- type: :development
62
- prerelease: false
63
- version_requirements: !ruby/object:Gem::Requirement
64
- requirements:
65
- - - "~>"
66
- - !ruby/object:Gem::Version
67
- version: '3.0'
68
12
  - !ruby/object:Gem::Dependency
69
13
  name: event_stream_parser
70
14
  requirement: !ruby/object:Gem::Requirement
@@ -151,8 +95,10 @@ files:
151
95
  - lib/ruboty/ai_agent/chat_thread_messages.rb
152
96
  - lib/ruboty/ai_agent/commands.rb
153
97
  - lib/ruboty/ai_agent/commands/base.rb
98
+ - lib/ruboty/ai_agent/commands/builtin_base.rb
154
99
  - lib/ruboty/ai_agent/commands/clear.rb
155
100
  - lib/ruboty/ai_agent/commands/compact.rb
101
+ - lib/ruboty/ai_agent/commands/prompt_command.rb
156
102
  - lib/ruboty/ai_agent/commands/usage.rb
157
103
  - lib/ruboty/ai_agent/database.rb
158
104
  - lib/ruboty/ai_agent/database/query_methods.rb
@@ -164,10 +110,15 @@ files:
164
110
  - lib/ruboty/ai_agent/llm/response.rb
165
111
  - lib/ruboty/ai_agent/mcp_clients.rb
166
112
  - lib/ruboty/ai_agent/mcp_configuration.rb
113
+ - lib/ruboty/ai_agent/prompt_command_definition.rb
167
114
  - lib/ruboty/ai_agent/record_set.rb
168
115
  - lib/ruboty/ai_agent/recordable.rb
116
+ - lib/ruboty/ai_agent/request.rb
169
117
  - lib/ruboty/ai_agent/token_usage.rb
170
118
  - lib/ruboty/ai_agent/tool.rb
119
+ - lib/ruboty/ai_agent/tool_definitions.rb
120
+ - lib/ruboty/ai_agent/tool_definitions/base.rb
121
+ - lib/ruboty/ai_agent/tool_definitions/think.rb
171
122
  - lib/ruboty/ai_agent/user.rb
172
123
  - lib/ruboty/ai_agent/user_ai_memories.rb
173
124
  - lib/ruboty/ai_agent/user_associations.rb
@@ -175,10 +126,12 @@ files:
175
126
  - lib/ruboty/ai_agent/user_mcp_client.rb
176
127
  - lib/ruboty/ai_agent/user_mcp_configurations.rb
177
128
  - lib/ruboty/ai_agent/user_mcp_tools_caches.rb
129
+ - lib/ruboty/ai_agent/user_prompt_command_definitions.rb
178
130
  - lib/ruboty/ai_agent/version.rb
179
131
  - lib/ruboty/handlers/ai_agent.rb
180
132
  - rbs_collection.yaml
181
133
  - ruboty-ai_agent.gemspec
134
+ - script/clean-orphaned-rbs.rb
182
135
  - script/generate-concern-rbs.rb
183
136
  - script/generate-data-rbs.rb
184
137
  - script/generate-memorized-ivar-rbs.rb
@@ -210,8 +163,10 @@ files:
210
163
  - sig/generated/ruboty/ai_agent/chat_thread_messages.rbs
211
164
  - sig/generated/ruboty/ai_agent/commands.rbs
212
165
  - sig/generated/ruboty/ai_agent/commands/base.rbs
166
+ - sig/generated/ruboty/ai_agent/commands/builtin_base.rbs
213
167
  - sig/generated/ruboty/ai_agent/commands/clear.rbs
214
168
  - sig/generated/ruboty/ai_agent/commands/compact.rbs
169
+ - sig/generated/ruboty/ai_agent/commands/prompt_command.rbs
215
170
  - sig/generated/ruboty/ai_agent/commands/usage.rbs
216
171
  - sig/generated/ruboty/ai_agent/database.rbs
217
172
  - sig/generated/ruboty/ai_agent/database/query_methods.rbs
@@ -223,10 +178,15 @@ files:
223
178
  - sig/generated/ruboty/ai_agent/llm/response.rbs
224
179
  - sig/generated/ruboty/ai_agent/mcp_clients.rbs
225
180
  - sig/generated/ruboty/ai_agent/mcp_configuration.rbs
181
+ - sig/generated/ruboty/ai_agent/prompt_command_definition.rbs
226
182
  - sig/generated/ruboty/ai_agent/record_set.rbs
227
183
  - sig/generated/ruboty/ai_agent/recordable.rbs
184
+ - sig/generated/ruboty/ai_agent/request.rbs
228
185
  - sig/generated/ruboty/ai_agent/token_usage.rbs
229
186
  - sig/generated/ruboty/ai_agent/tool.rbs
187
+ - sig/generated/ruboty/ai_agent/tool_definitions.rbs
188
+ - sig/generated/ruboty/ai_agent/tool_definitions/base.rbs
189
+ - sig/generated/ruboty/ai_agent/tool_definitions/think.rbs
230
190
  - sig/generated/ruboty/ai_agent/user.rbs
231
191
  - sig/generated/ruboty/ai_agent/user_ai_memories.rbs
232
192
  - sig/generated/ruboty/ai_agent/user_associations.rbs
@@ -234,6 +194,7 @@ files:
234
194
  - sig/generated/ruboty/ai_agent/user_mcp_client.rbs
235
195
  - sig/generated/ruboty/ai_agent/user_mcp_configurations.rbs
236
196
  - sig/generated/ruboty/ai_agent/user_mcp_tools_caches.rbs
197
+ - sig/generated/ruboty/ai_agent/user_prompt_command_definitions.rbs
237
198
  - sig/generated/ruboty/ai_agent/version.rbs
238
199
  - sig/generated/ruboty/handlers/ai_agent.rbs
239
200
  homepage: https://github.com/tomoasleep/ruboty-ai_agent
@@ -243,6 +204,7 @@ metadata:
243
204
  homepage_uri: https://github.com/tomoasleep/ruboty-ai_agent
244
205
  source_code_uri: https://github.com/tomoasleep/ruboty-ai_agent
245
206
  changelog_uri: https://github.com/tomoasleep/ruboty-ai_agent/blob/main/CHANGELOG.md
207
+ rubygems_mfa_required: 'true'
246
208
  rdoc_options: []
247
209
  require_paths:
248
210
  - lib