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.
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module TurnKit
4
- VERSION = "0.2.5"
4
+ VERSION = "0.2.7"
5
5
  end
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.5
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-06 00:00:00.000000000 Z
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 provides a small Ruby runtime for AI agents with conversations,
28
- turns, tool calls, terminal tools, file-based skills, sub-agents, and optional Rails
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: Durable Ruby AI agent turns, tools, skills, and conversations.
106
+ summary: Ruby/Rails agent runtime for durable AI conversations.
105
107
  test_files: []