turnkit 0.2.5 → 0.2.7
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 +4 -4
- data/CHANGELOG.md +4 -0
- data/README.md +155 -321
- data/lib/turnkit/adapters/ruby_llm.rb +69 -5
- data/lib/turnkit/agent.rb +20 -2
- data/lib/turnkit/client.rb +5 -1
- data/lib/turnkit/compaction.rb +406 -0
- data/lib/turnkit/conversation.rb +11 -4
- data/lib/turnkit/error.rb +3 -0
- data/lib/turnkit/event.rb +25 -0
- data/lib/turnkit/generators/turnkit/install/templates/create_turnkit_tables.rb +1 -0
- data/lib/turnkit/generators/turnkit/install/templates/initializer.rb +6 -0
- data/lib/turnkit/generators/turnkit/install_generator.rb +6 -0
- data/lib/turnkit/message.rb +21 -1
- data/lib/turnkit/message_projection.rb +28 -1
- data/lib/turnkit/model_request.rb +35 -0
- data/lib/turnkit/record.rb +2 -1
- data/lib/turnkit/result.rb +3 -2
- data/lib/turnkit/stores/active_record_store.rb +14 -4
- data/lib/turnkit/sub_agent_tool.rb +13 -4
- data/lib/turnkit/tool.rb +117 -4
- data/lib/turnkit/tool_call.rb +3 -1
- data/lib/turnkit/tool_runner.rb +8 -1
- data/lib/turnkit/turn.rb +101 -16
- data/lib/turnkit/version.rb +1 -1
- data/lib/turnkit.rb +7 -0
- metadata +8 -6
data/lib/turnkit/version.rb
CHANGED
data/lib/turnkit.rb
CHANGED
|
@@ -12,6 +12,8 @@ require_relative "turnkit/id"
|
|
|
12
12
|
require_relative "turnkit/clock"
|
|
13
13
|
require_relative "turnkit/cost"
|
|
14
14
|
require_relative "turnkit/budget"
|
|
15
|
+
require_relative "turnkit/event"
|
|
16
|
+
require_relative "turnkit/model_request"
|
|
15
17
|
require_relative "turnkit/agent"
|
|
16
18
|
require_relative "turnkit/client"
|
|
17
19
|
require_relative "turnkit/conversation"
|
|
@@ -25,6 +27,7 @@ require_relative "turnkit/prompt_contribution"
|
|
|
25
27
|
require_relative "turnkit/system_prompt"
|
|
26
28
|
require_relative "turnkit/store"
|
|
27
29
|
require_relative "turnkit/memory_store"
|
|
30
|
+
require_relative "turnkit/compaction"
|
|
28
31
|
require_relative "turnkit/tool"
|
|
29
32
|
require_relative "turnkit/tool_call"
|
|
30
33
|
require_relative "turnkit/tool_execution"
|
|
@@ -43,10 +46,12 @@ module TurnKit
|
|
|
43
46
|
attr_accessor :default_model, :client, :store, :logger
|
|
44
47
|
attr_accessor :max_iterations, :timeout, :max_depth, :max_tool_executions
|
|
45
48
|
attr_accessor :cost_limit, :prompt_cache
|
|
49
|
+
attr_accessor :compaction
|
|
46
50
|
attr_accessor :cost_rates, :cost_calculator
|
|
47
51
|
attr_accessor :prompt_sections, :prompt_behavior, :available_skills
|
|
48
52
|
attr_accessor :prompt_data_max_chars, :context_contributors
|
|
49
53
|
attr_accessor :system_prompt_contributors, :model_prompt_contributors
|
|
54
|
+
attr_accessor :on_event
|
|
50
55
|
attr_accessor :conversation_record_class, :turn_record_class
|
|
51
56
|
attr_accessor :message_record_class, :tool_execution_record_class
|
|
52
57
|
end
|
|
@@ -59,6 +64,7 @@ module TurnKit
|
|
|
59
64
|
self.max_depth = 3
|
|
60
65
|
self.max_tool_executions = 100
|
|
61
66
|
self.prompt_cache = :auto
|
|
67
|
+
self.compaction = true
|
|
62
68
|
self.cost_rates = {}
|
|
63
69
|
self.prompt_sections = SystemPrompt::DEFAULT_SECTIONS.dup
|
|
64
70
|
self.prompt_data_max_chars = 20_000
|
|
@@ -66,6 +72,7 @@ module TurnKit
|
|
|
66
72
|
self.context_contributors = []
|
|
67
73
|
self.system_prompt_contributors = []
|
|
68
74
|
self.model_prompt_contributors = {}
|
|
75
|
+
self.on_event = nil
|
|
69
76
|
|
|
70
77
|
def self.reconcile_stale!(before: Clock.now - (timeout || 300))
|
|
71
78
|
store.find_stale_turns(before: before).each do |turn|
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: turnkit
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.2.
|
|
4
|
+
version: 0.2.7
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Sam Couch
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2026-06-
|
|
11
|
+
date: 2026-06-07 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: ruby_llm
|
|
@@ -24,9 +24,8 @@ dependencies:
|
|
|
24
24
|
- - "~>"
|
|
25
25
|
- !ruby/object:Gem::Version
|
|
26
26
|
version: '1.14'
|
|
27
|
-
description: TurnKit
|
|
28
|
-
|
|
29
|
-
persistence.
|
|
27
|
+
description: TurnKit is a Ruby/Rails agent runtime for durable AI conversations, tool
|
|
28
|
+
calling, skills, sub-agents, context compaction, and persistence.
|
|
30
29
|
email:
|
|
31
30
|
- sam@samcouch.com
|
|
32
31
|
executables: []
|
|
@@ -42,9 +41,11 @@ files:
|
|
|
42
41
|
- lib/turnkit/budget.rb
|
|
43
42
|
- lib/turnkit/client.rb
|
|
44
43
|
- lib/turnkit/clock.rb
|
|
44
|
+
- lib/turnkit/compaction.rb
|
|
45
45
|
- lib/turnkit/conversation.rb
|
|
46
46
|
- lib/turnkit/cost.rb
|
|
47
47
|
- lib/turnkit/error.rb
|
|
48
|
+
- lib/turnkit/event.rb
|
|
48
49
|
- lib/turnkit/generators/turnkit/install/templates/conversation.rb
|
|
49
50
|
- lib/turnkit/generators/turnkit/install/templates/create_turnkit_tables.rb
|
|
50
51
|
- lib/turnkit/generators/turnkit/install/templates/initializer.rb
|
|
@@ -56,6 +57,7 @@ files:
|
|
|
56
57
|
- lib/turnkit/memory_store.rb
|
|
57
58
|
- lib/turnkit/message.rb
|
|
58
59
|
- lib/turnkit/message_projection.rb
|
|
60
|
+
- lib/turnkit/model_request.rb
|
|
59
61
|
- lib/turnkit/prompt_context.rb
|
|
60
62
|
- lib/turnkit/prompt_contribution.rb
|
|
61
63
|
- lib/turnkit/prompt_data.rb
|
|
@@ -101,5 +103,5 @@ requirements: []
|
|
|
101
103
|
rubygems_version: 3.5.22
|
|
102
104
|
signing_key:
|
|
103
105
|
specification_version: 4
|
|
104
|
-
summary:
|
|
106
|
+
summary: Ruby/Rails agent runtime for durable AI conversations.
|
|
105
107
|
test_files: []
|