prompt_navigator 0.3.0 → 2.0.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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 5b2382f515204e007fd69b49339cc98afc15184c544a1dab7fc0b3957e18a220
4
- data.tar.gz: 345a5c6c9e29695394cfb333a181cd6530a9697fe2b9a4b23bccb4ee1af910b6
3
+ metadata.gz: 1519a5a4fc2a28bda0f3795d7ce91f15afeeab646db88d53888cce56ef031869
4
+ data.tar.gz: 6dd58cf6962f7db2fcdb51937147926588d69c8d2c9d71e32d7e923632038789
5
5
  SHA512:
6
- metadata.gz: cf0eebdf61457d792bca663deaaff47320aad9f97f53922d9b7dd22509b554d148adee965871145b398780d7ceef6a3e400bc0aa02ca40d35f7ad28080b2fb75
7
- data.tar.gz: ebabe858fda114acc8a9b7c2066a91938807d72fe653a95a4d406f4d11abbf1017e8d66d30158db32d0bbb33553e8c8863bbbea0a5fce590fab8798e17b16a59
6
+ metadata.gz: cf79eba4420fc941941e99cc7701b3b0970227f62e171b23b43750ea5342b90b4600efdac5290a309f8d1773dfe71673719cfd7d11da9718b4e96e99a558afe0
7
+ data.tar.gz: 1146200b8a8eecd25555f3b83f858039d323b775832566cd4c8a2d80584417c224cb61fb7400e5637359f7b6071aa5257fa873c5dd0d3c7e352ee3afe1e76b25
data/README.md CHANGED
@@ -14,7 +14,7 @@ A Rails engine for managing and visualizing LLM prompt execution history. It pro
14
14
 
15
15
  ## Requirements
16
16
 
17
- - Ruby >= 3.2.0
17
+ - Ruby >= 3.4.9
18
18
  - Rails >= 8.1.2
19
19
  - Stimulus ([Hotwire](https://hotwired.dev/))
20
20
 
@@ -53,6 +53,23 @@
53
53
  -webkit-box-orient: vertical;
54
54
  }
55
55
 
56
+ .history-card-platform-label {
57
+ font-size: 10px;
58
+ font-weight: 700;
59
+ letter-spacing: 0.02em;
60
+ margin-left: auto;
61
+ flex-shrink: 0;
62
+ padding: 2px 6px;
63
+ border-radius: 4px;
64
+ min-width: 28px;
65
+ text-align: center;
66
+
67
+ &[data-platform="openai"] { color: #10a37f; background: rgba(16, 163, 127, 0.1); }
68
+ &[data-platform="anthropic"] { color: #c4956e; background: rgba(212, 162, 127, 0.12); }
69
+ &[data-platform="google"] { color: #4285f4; background: rgba(66, 133, 244, 0.1); }
70
+ &[data-platform="ollama"] { color: #555; background: rgba(0, 0, 0, 0.06); }
71
+ }
72
+
56
73
  .history-arrows {
57
74
  position: absolute;
58
75
  top: 0;
@@ -13,6 +13,22 @@ module PromptNavigator
13
13
  end
14
14
  end
15
15
 
16
+ # Bulk-delete a set of PromptExecutions, tolerating the self-referential
17
+ # `previous_id` foreign key by first nulling intra-set links. Callers
18
+ # (e.g. a host's Chat#destroy flow) pass the ids of orphaned executions
19
+ # after their owning records (Messages) have been destroyed.
20
+ #
21
+ # Raises ActiveRecord::InvalidForeignKey if any PE in the set is still
22
+ # referenced from outside the set (e.g. another chat's branch); callers
23
+ # decide whether to rescue and leave the orphans in place.
24
+ def self.delete_set!(ids)
25
+ ids = Array(ids).compact
26
+ return if ids.empty?
27
+
28
+ where(id: ids).update_all(previous_id: nil)
29
+ where(id: ids).delete_all
30
+ end
31
+
16
32
  private
17
33
 
18
34
  # Returns ancestor PromptExecutions in chronological order (oldest first),
@@ -9,6 +9,9 @@
9
9
  <div class="history-card<%= ' is-active' if is_active %>" data-history-target="cards" data-uuid="<%= ann.execution_id %>" data-parent-uuid="<%= parent_uuid %>">
10
10
  <%= link_to card_path.call(ann.execution_id), class: "history-card-link" do %>
11
11
  <div class="history-card-prompt"><%= truncate(ann.prompt.to_s, length: 30) %></div>
12
+ <% if ann.llm_platform.present? %>
13
+ <span class="history-card-platform-label" data-platform="<%= ann.llm_platform %>"><%= { "openai" => "GPT", "anthropic" => "A", "google" => "G", "ollama" => "O" }[ann.llm_platform] || ann.llm_platform %></span>
14
+ <% end %>
12
15
  <% end %>
13
16
  </div>
14
17
 
@@ -1,3 +1,3 @@
1
1
  module PromptNavigator
2
- VERSION = "0.3.0"
2
+ VERSION = "2.0.0"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: prompt_navigator
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 2.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - dhq_boiler
@@ -79,14 +79,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
79
79
  requirements:
80
80
  - - ">="
81
81
  - !ruby/object:Gem::Version
82
- version: 3.2.0
82
+ version: 3.4.9
83
83
  required_rubygems_version: !ruby/object:Gem::Requirement
84
84
  requirements:
85
85
  - - ">="
86
86
  - !ruby/object:Gem::Version
87
87
  version: '0'
88
88
  requirements: []
89
- rubygems_version: 4.0.3
89
+ rubygems_version: 3.6.9
90
90
  specification_version: 4
91
91
  summary: A Rails engine for managing and visualizing LLM prompt execution history.
92
92
  test_files: []