ruboty-ai_agent 0.1.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 (124) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +19 -0
  3. data/.rspec +3 -0
  4. data/.rubocop.yml +45 -0
  5. data/AGENTS.md +22 -0
  6. data/CHANGELOG.md +3 -0
  7. data/CLAUDE.md +1 -0
  8. data/CODE_OF_CONDUCT.md +74 -0
  9. data/Gemfile +14 -0
  10. data/README.md +118 -0
  11. data/Rakefile +47 -0
  12. data/Steepfile +12 -0
  13. data/bin/console +15 -0
  14. data/bin/ruboty +34 -0
  15. data/bin/setup +8 -0
  16. data/lib/ruboty/ai_agent/actions/add_ai_command.rb +22 -0
  17. data/lib/ruboty/ai_agent/actions/add_ai_memory.rb +20 -0
  18. data/lib/ruboty/ai_agent/actions/add_mcp.rb +94 -0
  19. data/lib/ruboty/ai_agent/actions/base.rb +43 -0
  20. data/lib/ruboty/ai_agent/actions/chat.rb +64 -0
  21. data/lib/ruboty/ai_agent/actions/list_ai_commands.rb +19 -0
  22. data/lib/ruboty/ai_agent/actions/list_ai_memories.rb +18 -0
  23. data/lib/ruboty/ai_agent/actions/list_mcp.rb +18 -0
  24. data/lib/ruboty/ai_agent/actions/remove_ai_command.rb +18 -0
  25. data/lib/ruboty/ai_agent/actions/remove_ai_memory.rb +25 -0
  26. data/lib/ruboty/ai_agent/actions/remove_mcp.rb +24 -0
  27. data/lib/ruboty/ai_agent/actions/set_system_prompt.rb +31 -0
  28. data/lib/ruboty/ai_agent/actions/show_system_prompt.rb +30 -0
  29. data/lib/ruboty/ai_agent/actions.rb +22 -0
  30. data/lib/ruboty/ai_agent/agent.rb +71 -0
  31. data/lib/ruboty/ai_agent/cached_value.rb +43 -0
  32. data/lib/ruboty/ai_agent/chat_message.rb +60 -0
  33. data/lib/ruboty/ai_agent/chat_thread.rb +31 -0
  34. data/lib/ruboty/ai_agent/chat_thread_associations.rb +34 -0
  35. data/lib/ruboty/ai_agent/chat_thread_messages.rb +17 -0
  36. data/lib/ruboty/ai_agent/commands/base.rb +39 -0
  37. data/lib/ruboty/ai_agent/commands/clear.rb +29 -0
  38. data/lib/ruboty/ai_agent/commands/compact.rb +80 -0
  39. data/lib/ruboty/ai_agent/commands/usage.rb +52 -0
  40. data/lib/ruboty/ai_agent/commands.rb +33 -0
  41. data/lib/ruboty/ai_agent/database/query_methods.rb +84 -0
  42. data/lib/ruboty/ai_agent/database.rb +40 -0
  43. data/lib/ruboty/ai_agent/global_settings.rb +33 -0
  44. data/lib/ruboty/ai_agent/http_mcp_client.rb +215 -0
  45. data/lib/ruboty/ai_agent/llm/openai/model.rb +29 -0
  46. data/lib/ruboty/ai_agent/llm/openai.rb +181 -0
  47. data/lib/ruboty/ai_agent/llm/response.rb +21 -0
  48. data/lib/ruboty/ai_agent/llm.rb +11 -0
  49. data/lib/ruboty/ai_agent/mcp_clients.rb +48 -0
  50. data/lib/ruboty/ai_agent/mcp_configuration.rb +31 -0
  51. data/lib/ruboty/ai_agent/record_set.rb +71 -0
  52. data/lib/ruboty/ai_agent/recordable.rb +116 -0
  53. data/lib/ruboty/ai_agent/token_usage.rb +45 -0
  54. data/lib/ruboty/ai_agent/tool.rb +29 -0
  55. data/lib/ruboty/ai_agent/user.rb +52 -0
  56. data/lib/ruboty/ai_agent/user_ai_memories.rb +17 -0
  57. data/lib/ruboty/ai_agent/user_associations.rb +34 -0
  58. data/lib/ruboty/ai_agent/user_mcp_caches.rb +90 -0
  59. data/lib/ruboty/ai_agent/user_mcp_client.rb +93 -0
  60. data/lib/ruboty/ai_agent/user_mcp_configurations.rb +15 -0
  61. data/lib/ruboty/ai_agent/user_mcp_tools_caches.rb +14 -0
  62. data/lib/ruboty/ai_agent/version.rb +7 -0
  63. data/lib/ruboty/ai_agent.rb +40 -0
  64. data/lib/ruboty/handlers/ai_agent.rb +84 -0
  65. data/rbs_collection.yaml +23 -0
  66. data/ruboty-ai_agent.gemspec +49 -0
  67. data/script/generate-concern-rbs.rb +351 -0
  68. data/script/generate-data-rbs.rb +250 -0
  69. data/script/generate-memorized-ivar-rbs.rb +292 -0
  70. data/sig/generated/ruboty/ai_agent/actions/add_ai_command.rbs +16 -0
  71. data/sig/generated/ruboty/ai_agent/actions/add_ai_memory.rbs +14 -0
  72. data/sig/generated/ruboty/ai_agent/actions/add_mcp.rbs +26 -0
  73. data/sig/generated/ruboty/ai_agent/actions/base.rbs +34 -0
  74. data/sig/generated/ruboty/ai_agent/actions/chat.rbs +17 -0
  75. data/sig/generated/ruboty/ai_agent/actions/list_ai_commands.rbs +13 -0
  76. data/sig/generated/ruboty/ai_agent/actions/list_ai_memories.rbs +12 -0
  77. data/sig/generated/ruboty/ai_agent/actions/list_mcp.rbs +12 -0
  78. data/sig/generated/ruboty/ai_agent/actions/remove_ai_command.rbs +14 -0
  79. data/sig/generated/ruboty/ai_agent/actions/remove_ai_memory.rbs +14 -0
  80. data/sig/generated/ruboty/ai_agent/actions/remove_mcp.rbs +14 -0
  81. data/sig/generated/ruboty/ai_agent/actions/set_system_prompt.rbs +16 -0
  82. data/sig/generated/ruboty/ai_agent/actions/show_system_prompt.rbs +12 -0
  83. data/sig/generated/ruboty/ai_agent/actions.rbs +9 -0
  84. data/sig/generated/ruboty/ai_agent/agent.rbs +29 -0
  85. data/sig/generated/ruboty/ai_agent/cached_value.rbs +28 -0
  86. data/sig/generated/ruboty/ai_agent/chat_message.rbs +34 -0
  87. data/sig/generated/ruboty/ai_agent/chat_thread.rbs +22 -0
  88. data/sig/generated/ruboty/ai_agent/chat_thread_associations.rbs +21 -0
  89. data/sig/generated/ruboty/ai_agent/chat_thread_messages.rbs +13 -0
  90. data/sig/generated/ruboty/ai_agent/commands/base.rbs +40 -0
  91. data/sig/generated/ruboty/ai_agent/commands/clear.rbs +20 -0
  92. data/sig/generated/ruboty/ai_agent/commands/compact.rbs +30 -0
  93. data/sig/generated/ruboty/ai_agent/commands/usage.rbs +26 -0
  94. data/sig/generated/ruboty/ai_agent/commands.rbs +13 -0
  95. data/sig/generated/ruboty/ai_agent/database/query_methods.rbs +39 -0
  96. data/sig/generated/ruboty/ai_agent/database.rbs +27 -0
  97. data/sig/generated/ruboty/ai_agent/global_settings.rbs +23 -0
  98. data/sig/generated/ruboty/ai_agent/http_mcp_client.rbs +62 -0
  99. data/sig/generated/ruboty/ai_agent/llm/openai/model.rbs +21 -0
  100. data/sig/generated/ruboty/ai_agent/llm/openai.rbs +54 -0
  101. data/sig/generated/ruboty/ai_agent/llm/response.rbs +29 -0
  102. data/sig/generated/ruboty/ai_agent/llm.rbs +9 -0
  103. data/sig/generated/ruboty/ai_agent/mcp_clients.rbs +24 -0
  104. data/sig/generated/ruboty/ai_agent/mcp_configuration.rbs +35 -0
  105. data/sig/generated/ruboty/ai_agent/record_set.rbs +42 -0
  106. data/sig/generated/ruboty/ai_agent/recordable.rbs +56 -0
  107. data/sig/generated/ruboty/ai_agent/token_usage.rbs +30 -0
  108. data/sig/generated/ruboty/ai_agent/tool.rbs +27 -0
  109. data/sig/generated/ruboty/ai_agent/user.rbs +35 -0
  110. data/sig/generated/ruboty/ai_agent/user_ai_memories.rbs +11 -0
  111. data/sig/generated/ruboty/ai_agent/user_associations.rbs +21 -0
  112. data/sig/generated/ruboty/ai_agent/user_mcp_caches.rbs +44 -0
  113. data/sig/generated/ruboty/ai_agent/user_mcp_client.rbs +58 -0
  114. data/sig/generated/ruboty/ai_agent/user_mcp_configurations.rbs +11 -0
  115. data/sig/generated/ruboty/ai_agent/user_mcp_tools_caches.rbs +11 -0
  116. data/sig/generated/ruboty/ai_agent/version.rbs +7 -0
  117. data/sig/generated/ruboty/ai_agent.rbs +9 -0
  118. data/sig/generated/ruboty/handlers/ai_agent.rbs +32 -0
  119. data/sig/generated-by-scripts/concerns.rbs +27 -0
  120. data/sig/generated-by-scripts/memorized_ivars.rbs +42 -0
  121. data/sig-lib/event_stream_parser/event_stream_parser.rbs +21 -0
  122. data/sig-lib/mem/mem.rbs +19 -0
  123. data/sig-lib/ruboty/ruboty.rbs +421 -0
  124. metadata +263 -0
@@ -0,0 +1,35 @@
1
+ # Generated from lib/ruboty/ai_agent/mcp_configuration.rb with RBS::Inline
2
+
3
+ module Ruboty
4
+ module AiAgent
5
+ type transports = :http | :websocket
6
+
7
+ class McpConfiguration < Data
8
+ attr_reader name(): String
9
+
10
+ attr_reader transport(): transports
11
+
12
+ attr_reader headers(): Hash[String, String]
13
+
14
+ attr_reader url(): String
15
+
16
+ def self.new: (String name, transports transport, Hash[String, String] headers, String url) -> instance
17
+ | (name: String, transport: transports, headers: Hash[String, String], url: String) -> instance
18
+
19
+ def self.members: () -> [ :name, :transport, :headers, :url ]
20
+
21
+ def members: () -> [ :name, :transport, :headers, :url ]
22
+ end
23
+
24
+ # Save MCP configuration details.
25
+ class McpConfiguration
26
+ include Recordable
27
+
28
+ # @rbs name: String
29
+ # @rbs transport: transports
30
+ # @rbs url: String
31
+ # @rbs headers: Hash[String, String]?
32
+ def initialize: (name: String, transport: transports, url: String, ?headers: Hash[String, String]?) -> untyped
33
+ end
34
+ end
35
+ end
@@ -0,0 +1,42 @@
1
+ # Generated from lib/ruboty/ai_agent/record_set.rb with RBS::Inline
2
+
3
+ module Ruboty
4
+ module AiAgent
5
+ # A set of records.
6
+ # @rbs generic Record
7
+ class RecordSet[Record]
8
+ attr_reader database: Ruboty::AiAgent::Database
9
+
10
+ def initialize: (database: untyped) -> untyped
11
+
12
+ def namespace_keys: () -> Array[Database::keynable]
13
+
14
+ def length: () -> Integer
15
+
16
+ def all: () -> untyped
17
+
18
+ def all_values: () -> Array[Record]
19
+
20
+ def keys: () -> Array[Database::keynable]
21
+
22
+ # @rbs key: Database::keynable
23
+ # @rbs return: Record | nil
24
+ def fetch: (Database::keynable key) -> (Record | nil)
25
+
26
+ # @rbs key: Database::keynable
27
+ # @rbs record: Record
28
+ # @rbs return: void
29
+ def store: (Record record, key: Database::keynable) -> void
30
+
31
+ # @rbs key: Database::keynable
32
+ # @rbs return: void
33
+ def remove: (Database::keynable key) -> void
34
+
35
+ # @rbs key: Database::keynable
36
+ # @rbs return: boolish
37
+ def key?: (Database::keynable key) -> boolish
38
+
39
+ def clear: () -> void
40
+ end
41
+ end
42
+ end
@@ -0,0 +1,56 @@
1
+ # Generated from lib/ruboty/ai_agent/recordable.rb with RBS::Inline
2
+
3
+ module Ruboty
4
+ module AiAgent
5
+ interface _WithToH
6
+ def to_h: () -> Hash[Database::keynable, untyped]
7
+ end
8
+
9
+ # Convertable between Hash and Recordable bidirectionally.
10
+ # @rbs module-self _WithToH
11
+ module Recordable : _WithToH
12
+ def self.included: (untyped base) -> untyped
13
+
14
+ @record_types: Hash[Symbol, Class]
15
+
16
+ def self.record_types: () -> Hash[Symbol, Class]
17
+
18
+ # @rbs hash: Hash[Symbol, untyped]?
19
+ # @rbs return: bool
20
+ def self.convertable?: (Hash[Symbol, untyped]? hash) -> bool
21
+
22
+ # @rbs value: untyped
23
+ # @rbs return: untyped
24
+ def self.instantiate_recursively: (untyped value) -> untyped
25
+
26
+ # @rbs value: untyped
27
+ # @rbs return: untyped
28
+ def self.hashify_recursively: (untyped value) -> untyped
29
+
30
+ # @rbs record: Recordable
31
+ # @rbs return: Hash[Database::keynable, untyped]
32
+ def self.record_to_hash: (Recordable record) -> Hash[Database::keynable, untyped]
33
+
34
+ # @rbs hash: Hash[Symbol, untyped]
35
+ # @rbs return: Recordable
36
+ def self.record_from_hash: (Hash[Symbol, untyped] hash) -> Recordable
37
+
38
+ # @rbs module-self Class
39
+ module ClassMethods : Class
40
+ attr_accessor record_type: Symbol
41
+
42
+ # @rbs name: Symbol
43
+ def register_record_type: (Symbol name) -> untyped
44
+ end
45
+
46
+ # @rbs module-self Recordable::ClassMethods.instance
47
+ module PrependMethods : Recordable::ClassMethods
48
+ def to_h: () -> Hash[Database::keynable, untyped]
49
+ end
50
+
51
+ # @rbs %a{pure}
52
+ %a{pure}
53
+ def record_type: () -> Symbol
54
+ end
55
+ end
56
+ end
@@ -0,0 +1,30 @@
1
+ # Generated from lib/ruboty/ai_agent/token_usage.rb with RBS::Inline
2
+
3
+ module Ruboty
4
+ module AiAgent
5
+ # Token usage information from LLM responses
6
+ class TokenUsage
7
+ include Recordable
8
+
9
+ attr_reader prompt_tokens: Integer
10
+
11
+ attr_reader completion_tokens: Integer
12
+
13
+ attr_reader total_tokens: Integer
14
+
15
+ attr_reader token_limit: Integer?
16
+
17
+ # @rbs prompt_tokens: Integer
18
+ # @rbs completion_tokens: Integer
19
+ # @rbs total_tokens: Integer
20
+ # @rbs ?token_limit: Integer?
21
+ def initialize: (prompt_tokens: Integer, completion_tokens: Integer, total_tokens: Integer, ?token_limit: untyped) -> untyped
22
+
23
+ # Calculate usage percentage if token limit is available
24
+ # @rbs return: (Float | nil)
25
+ def usage_percentage: () -> (Float | nil)
26
+
27
+ def to_h: () -> Hash[Symbol, untyped]
28
+ end
29
+ end
30
+ end
@@ -0,0 +1,27 @@
1
+ # Generated from lib/ruboty/ai_agent/tool.rb with RBS::Inline
2
+
3
+ module Ruboty
4
+ module AiAgent
5
+ # Define a tool that the AI agent can use.
6
+ class Tool
7
+ attr_reader name: String
8
+
9
+ attr_reader title: String
10
+
11
+ attr_reader description: String
12
+
13
+ attr_reader input_schema: Hash[untyped, untyped]?
14
+
15
+ attr_reader on_call: (^(Hash[String, untyped]) -> String)?
16
+
17
+ # @rbs name: String
18
+ # @rbs title: String
19
+ # @rbs description: String
20
+ # @rbs input_schema: Hash[untyped, untyped]?
21
+ # @rbs &on_call: ? (Hash[String, untyped]) -> String
22
+ def initialize: (name: String, title: String, description: String, input_schema: Hash[untyped, untyped]?) ?{ (Hash[String, untyped]) -> String } -> void
23
+
24
+ def call: (untyped params) -> String?
25
+ end
26
+ end
27
+ end
@@ -0,0 +1,35 @@
1
+ # Generated from lib/ruboty/ai_agent/user.rb with RBS::Inline
2
+
3
+ module Ruboty
4
+ module AiAgent
5
+ # User class to manage user-specific data.
6
+ class User
7
+ attr_reader database: Ruboty::AiAgent::Database
8
+
9
+ attr_reader id: String
10
+
11
+ def self.find_or_create: (database: untyped, id: untyped) -> User
12
+
13
+ def initialize: (database: untyped, id: untyped) -> untyped
14
+
15
+ # @rbs %a{memorized}
16
+ %a{memorized}
17
+ def mcp_configurations: () -> UserMcpConfigurations
18
+
19
+ def mcp_clients: () -> Array[UserMcpClient]
20
+
21
+ # @rbs %a{memorized}
22
+ %a{memorized}
23
+ def ai_memories: () -> UserAiMemories
24
+
25
+ def system_prompt: () -> String?
26
+
27
+ # @rbs prompt: String?
28
+ def system_prompt=: (String? prompt) -> untyped
29
+
30
+ # @rbs %a{memorized}
31
+ %a{memorized}
32
+ def mcp_tools_caches: () -> UserMcpToolsCaches
33
+ end
34
+ end
35
+ end
@@ -0,0 +1,11 @@
1
+ # Generated from lib/ruboty/ai_agent/user_ai_memories.rb with RBS::Inline
2
+
3
+ module Ruboty
4
+ module AiAgent
5
+ # Manage Ai Memories for a specific user.
6
+ class UserAiMemories < UserAssociations[String]
7
+ # @rbs memory: String
8
+ def add: (String memory) -> void
9
+ end
10
+ end
11
+ end
@@ -0,0 +1,21 @@
1
+ # Generated from lib/ruboty/ai_agent/user_associations.rb with RBS::Inline
2
+
3
+ module Ruboty
4
+ module AiAgent
5
+ # A set of records for a specific user.
6
+ # @rbs generic Record
7
+ class UserAssociations[Record] < RecordSet[Record]
8
+ attr_reader user_id: String
9
+
10
+ def initialize: (database: untyped, user_id: untyped) -> untyped
11
+
12
+ def self.association_key: () -> Symbol
13
+
14
+ def self.association_key=: (Symbol) -> Symbol
15
+
16
+ def association_key: () -> Symbol
17
+
18
+ def namespace_keys: () -> untyped
19
+ end
20
+ end
21
+ end
@@ -0,0 +1,44 @@
1
+ # Generated from lib/ruboty/ai_agent/user_mcp_caches.rb with RBS::Inline
2
+
3
+ module Ruboty
4
+ module AiAgent
5
+ # Manage MCP caches for a specific user.
6
+ # @abstract
7
+ # @rbs generic D < Object
8
+ class UserMcpCaches[D < Object] < UserAssociations[CachedValue[D]]
9
+ def self.cache_type_key: () -> Symbol?
10
+
11
+ def self.cache_type_key=: (Symbol?) -> Symbol?
12
+
13
+ def self.cache_duration: () -> Integer?
14
+
15
+ def self.cache_duration=: (Integer?) -> Integer?
16
+
17
+ def self.association_key: () -> Symbol
18
+
19
+ def cache_type_key: () -> Symbol
20
+
21
+ def cache_duration: () -> Integer
22
+
23
+ # @rbs key: String)
24
+ # @rbs &block: () -> (D | CachedValue[D])
25
+ # @rbs return: D
26
+ def fetch_or_store_data: (String key) { () -> (D | CachedValue[D]) } -> D
27
+
28
+ # @rbs key: String
29
+ # @rbs return: D?
30
+ def fetch_data: (String key) -> D?
31
+
32
+ # @rbs override
33
+ def all: ...
34
+
35
+ # @rbs override
36
+ def fetch: ...
37
+
38
+ # @rbs key: String
39
+ # @rbs data: D
40
+ # @rbs return: void
41
+ def store_data: (D data, key: String) -> void
42
+ end
43
+ end
44
+ end
@@ -0,0 +1,58 @@
1
+ # Generated from lib/ruboty/ai_agent/user_mcp_client.rb with RBS::Inline
2
+
3
+ module Ruboty
4
+ module AiAgent
5
+ # Wrapper for MCP client with caching support for a specific user
6
+ class UserMcpClient
7
+ attr_reader user: User
8
+
9
+ attr_reader mcp_name: String
10
+
11
+ # @rbs user: User
12
+ # @rbs mcp_name: String
13
+ # @rbs return: void
14
+ def initialize: (user: User, mcp_name: String) -> void
15
+
16
+ # @rbs return: Array[tool_def]
17
+ def list_tools: () -> Array[tool_def]
18
+
19
+ # @rbs name: String
20
+ # @rbs arguments: Hash[String, untyped]
21
+ # @rbs &block: ? (Hash[String, untyped]) -> void
22
+ # @rbs return: untyped
23
+ def call_tool: (String name, ?Hash[String, untyped] arguments) ?{ (Hash[String, untyped]) -> void } -> untyped
24
+
25
+ # @rbs return: untyped
26
+ def list_prompts: () -> untyped
27
+
28
+ # @rbs name: String
29
+ # @rbs arguments: Hash[String, untyped]
30
+ # @rbs return: untyped
31
+ def get_prompt: (String name, ?Hash[String, untyped] arguments) -> untyped
32
+
33
+ # @rbs return: untyped
34
+ def list_resources: () -> untyped
35
+
36
+ # @rbs uri: String
37
+ # @rbs return: untyped
38
+ def read_resource: (String uri) -> untyped
39
+
40
+ # @rbs return: untyped
41
+ def ping: () -> untyped
42
+
43
+ # @rbs return: untyped
44
+ def initialize_session: () -> untyped
45
+
46
+ # @rbs return: untyped
47
+ def cleanup_session: () -> untyped
48
+
49
+ private
50
+
51
+ # @rbs return: McpConfiguration
52
+ def configuration: () -> McpConfiguration
53
+
54
+ # @rbs return: HttpMcpClient
55
+ def mcp_client: () -> HttpMcpClient
56
+ end
57
+ end
58
+ end
@@ -0,0 +1,11 @@
1
+ # Generated from lib/ruboty/ai_agent/user_mcp_configurations.rb with RBS::Inline
2
+
3
+ module Ruboty
4
+ module AiAgent
5
+ # Manage MCP configurations for a specific user.
6
+ class UserMcpConfigurations < UserAssociations[McpConfiguration]
7
+ # @rbs mcp_configuration: McpConfiguration:
8
+ def add: (McpConfiguration mcp_configuration) -> void
9
+ end
10
+ end
11
+ end
@@ -0,0 +1,11 @@
1
+ # Generated from lib/ruboty/ai_agent/user_mcp_tools_caches.rb with RBS::Inline
2
+
3
+ module Ruboty
4
+ module AiAgent
5
+ type tool_def = Hash[Symbol | String, untyped]
6
+
7
+ # Manage tools cache for a specific user and server.
8
+ class UserMcpToolsCaches < UserMcpCaches[Array[tool_def]]
9
+ end
10
+ end
11
+ end
@@ -0,0 +1,7 @@
1
+ # Generated from lib/ruboty/ai_agent/version.rb with RBS::Inline
2
+
3
+ module Ruboty
4
+ module AiAgent
5
+ VERSION: ::String
6
+ end
7
+ end
@@ -0,0 +1,9 @@
1
+ # Generated from lib/ruboty/ai_agent.rb with RBS::Inline
2
+
3
+ module Ruboty
4
+ # Add AI Agent feature to Ruboty.
5
+ module AiAgent
6
+ class Error < StandardError
7
+ end
8
+ end
9
+ end
@@ -0,0 +1,32 @@
1
+ # Generated from lib/ruboty/handlers/ai_agent.rb with RBS::Inline
2
+
3
+ module Ruboty
4
+ module Handlers
5
+ # Handler for AI agent commands
6
+ class AiAgent < Base
7
+ def chat: (untyped message) -> untyped
8
+
9
+ def add_mcp: (untyped message) -> untyped
10
+
11
+ def remove_mcp: (untyped message) -> untyped
12
+
13
+ def list_mcp: (untyped message) -> untyped
14
+
15
+ def set_system_prompt: (untyped message) -> untyped
16
+
17
+ def show_system_prompt: (untyped message) -> untyped
18
+
19
+ def add_ai_memory: (untyped message) -> untyped
20
+
21
+ def remove_ai_memory: (untyped message) -> untyped
22
+
23
+ def list_ai_memories: (untyped message) -> untyped
24
+
25
+ def add_ai_command: (untyped message) -> untyped
26
+
27
+ def remove_ai_command: (untyped message) -> untyped
28
+
29
+ def list_ai_commands: (untyped message) -> untyped
30
+ end
31
+ end
32
+ end
@@ -0,0 +1,27 @@
1
+ # Generated RBS definitions for concern modules
2
+ # This file is automatically generated by script/generate-concern-rbs.rb
3
+
4
+ module Ruboty
5
+ module AiAgent
6
+ class CachedValue[D < Object]
7
+ extend Recordable::ClassMethods
8
+ prepend Recordable::PrependMethods
9
+ end
10
+
11
+ class ChatMessage
12
+ extend Recordable::ClassMethods
13
+ prepend Recordable::PrependMethods
14
+ end
15
+
16
+ class McpConfiguration
17
+ extend Recordable::ClassMethods
18
+ prepend Recordable::PrependMethods
19
+ end
20
+
21
+ class TokenUsage
22
+ extend Recordable::ClassMethods
23
+ prepend Recordable::PrependMethods
24
+ end
25
+
26
+ end
27
+ end
@@ -0,0 +1,42 @@
1
+ # Generated RBS definitions for memorized instance variables
2
+ # This file is automatically generated by script/generate-memorized-ivar-rbs.rb
3
+
4
+ module Ruboty
5
+ module AiAgent
6
+ module Actions
7
+ class Base
8
+ @database: Ruboty::AiAgent::Database
9
+ @user: Ruboty::AiAgent::User
10
+ @chat_thread: Ruboty::AiAgent::ChatThread
11
+ end
12
+ end
13
+ end
14
+ end
15
+
16
+ module Ruboty
17
+ module AiAgent
18
+ class ChatThread
19
+ @messages: ChatThreadMessages
20
+ end
21
+ end
22
+ end
23
+
24
+ module Ruboty
25
+ module AiAgent
26
+ module LLM
27
+ class OpenAI
28
+ @model_info: Model
29
+ end
30
+ end
31
+ end
32
+ end
33
+
34
+ module Ruboty
35
+ module AiAgent
36
+ class User
37
+ @mcp_configurations: UserMcpConfigurations
38
+ @ai_memories: UserAiMemories
39
+ @mcp_tools_caches: UserMcpToolsCaches
40
+ end
41
+ end
42
+ end
@@ -0,0 +1,21 @@
1
+ module EventStreamParser
2
+ VERSION: ::String
3
+
4
+ class Parser
5
+ def feed: (untyped chunk) { (*untyped) -> untyped } -> untyped
6
+
7
+ def stream: () -> untyped
8
+
9
+ private
10
+
11
+ def dispatch_event: () -> untyped
12
+
13
+ def ignore: () -> untyped
14
+
15
+ def initialize: () -> void
16
+
17
+ def process_field: (untyped field, untyped value) -> untyped
18
+
19
+ def process_line: (untyped line) { (*untyped) -> untyped } -> untyped
20
+ end
21
+ end
@@ -0,0 +1,19 @@
1
+ module Mem
2
+ def self.included: (untyped base) -> untyped
3
+
4
+ def has_memoized?: (untyped key) -> untyped
5
+
6
+ def memoize: (untyped key, untyped value) -> untyped
7
+
8
+ def memoized: (untyped key) -> untyped
9
+
10
+ def memoized_table: () -> untyped
11
+
12
+ def unmemoize: (untyped key) -> untyped
13
+
14
+ VERSION: ::String
15
+
16
+ module ClassMethods
17
+ def memoize: (untyped method_name) -> untyped
18
+ end
19
+ end