prompt_navigator 2.1.0 → 2.2.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:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: f448c834c18a600ebf636fad362e51f7dd80c354484e1971388a884cdd9ffb80
|
|
4
|
+
data.tar.gz: d9a983063d1afe013001e7017b64ecc49f60467ea6e24a4179c20f37698d7eb4
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 7e3e53891c90ffa1fe59767eeb2de6f10b215eef872c4ca815384329b61e315aca9de871ed6f91761c22ef3c252d00415d6741b9158cf46b1ff51284b0c5db46
|
|
7
|
+
data.tar.gz: 35998b74c979da62e030e6bec1609bc35aea630fb205ffed49718f39a3b594879bb0d5c30340b0c9f5b6e38d8fc211b18c7f273d3d788f84a5e64843b09be3ba
|
|
@@ -6,14 +6,13 @@
|
|
|
6
6
|
card_path = locals[:card_path]
|
|
7
7
|
delete_path = locals[:delete_path]
|
|
8
8
|
is_leaf = locals[:is_leaf]
|
|
9
|
-
%>
|
|
10
9
|
|
|
11
|
-
<%
|
|
12
10
|
# Hide leading attached-image data URIs (``).
|
|
13
11
|
# The base64 blob isn't useful in a 30-char preview — replace each with a
|
|
14
12
|
# short marker so the rest of the prompt text is visible.
|
|
15
13
|
display_prompt = ann.prompt.to_s.gsub(/!\[[^\]]*\]\(data:[^)]+\)/m, "[image]").strip
|
|
16
14
|
%>
|
|
15
|
+
|
|
17
16
|
<div class="history-card<%= ' is-active' if is_active %>" data-history-target="cards" data-uuid="<%= ann.execution_id %>" data-parent-uuid="<%= parent_uuid %>">
|
|
18
17
|
<div class="history-card-row">
|
|
19
18
|
<%= link_to card_path.call(ann.execution_id), class: "history-card-link" do %>
|
|
@@ -30,14 +29,19 @@
|
|
|
30
29
|
<% end %>
|
|
31
30
|
<% end %>
|
|
32
31
|
<% if ann.llm_platform.present? %>
|
|
33
|
-
<% platform_label =
|
|
32
|
+
<% platform_label = PromptNavigator.label_for(platform: ann.llm_platform, model: ann.model) %>
|
|
34
33
|
<% tooltip = ann.model.present? ? "#{ann.model} (#{ann.llm_platform})" : ann.llm_platform.to_s %>
|
|
35
34
|
<span class="history-card-platform-label" data-platform="<%= ann.llm_platform %>" title="<%= tooltip %>"><%= platform_label %></span>
|
|
36
35
|
<% end %>
|
|
37
36
|
</div>
|
|
38
37
|
</div>
|
|
39
38
|
|
|
40
|
-
<%#
|
|
41
|
-
|
|
42
|
-
|
|
39
|
+
<%# Direction-agnostic adjacency arrow: detect whether the next card is this card's
|
|
40
|
+
parent (newest-first ordering → "↑") or its child (oldest-first ordering → "↓"). %>
|
|
41
|
+
<% if next_ann %>
|
|
42
|
+
<% if parent_uuid == next_ann.execution_id %>
|
|
43
|
+
<div class="history-straight-arrow">↑</div>
|
|
44
|
+
<% elsif next_ann.previous_id == ann.id %>
|
|
45
|
+
<div class="history-straight-arrow">↓</div>
|
|
46
|
+
<% end %>
|
|
43
47
|
<% end %>
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module PromptNavigator
|
|
4
|
+
# Host-overridable display config for the history sidebar.
|
|
5
|
+
#
|
|
6
|
+
# Usage from a host app initializer:
|
|
7
|
+
#
|
|
8
|
+
# PromptNavigator.configure do |c|
|
|
9
|
+
# c.platform_labels["openai"] = "OAI" # override platform default
|
|
10
|
+
# c.model_labels["claude-opus-4-7"] = "Opus" # per-model override
|
|
11
|
+
# end
|
|
12
|
+
class Configuration
|
|
13
|
+
DEFAULT_PLATFORM_LABELS = {
|
|
14
|
+
"openai" => "GPT",
|
|
15
|
+
"anthropic" => "Claude",
|
|
16
|
+
"google" => "Gemini",
|
|
17
|
+
"ollama" => "Ollama"
|
|
18
|
+
}.freeze
|
|
19
|
+
|
|
20
|
+
attr_accessor :platform_labels, :model_labels
|
|
21
|
+
|
|
22
|
+
def initialize
|
|
23
|
+
@platform_labels = DEFAULT_PLATFORM_LABELS.dup
|
|
24
|
+
@model_labels = {}
|
|
25
|
+
end
|
|
26
|
+
end
|
|
27
|
+
|
|
28
|
+
def self.config
|
|
29
|
+
@config ||= Configuration.new
|
|
30
|
+
end
|
|
31
|
+
|
|
32
|
+
def self.configure
|
|
33
|
+
yield config
|
|
34
|
+
end
|
|
35
|
+
|
|
36
|
+
# Resolution order: per-model override → per-platform → raw platform string.
|
|
37
|
+
# Returns "" only when both inputs are blank.
|
|
38
|
+
def self.label_for(platform:, model: nil)
|
|
39
|
+
model_key = model.to_s
|
|
40
|
+
return config.model_labels[model_key] if model_key != "" && config.model_labels.key?(model_key)
|
|
41
|
+
platform_key = platform.to_s
|
|
42
|
+
config.platform_labels[platform_key] || platform_key
|
|
43
|
+
end
|
|
44
|
+
end
|
data/lib/prompt_navigator.rb
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
3
|
require "prompt_navigator/version"
|
|
4
|
+
require "prompt_navigator/configuration"
|
|
4
5
|
require "prompt_navigator/engine"
|
|
5
6
|
require "prompt_navigator/helpers"
|
|
6
7
|
require_relative "../app/controllers/concerns/prompt_navigator/history_manageable"
|
|
7
8
|
|
|
8
9
|
module PromptNavigator
|
|
9
|
-
# Your code goes here...
|
|
10
10
|
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: 2.
|
|
4
|
+
version: 2.2.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- dhq_boiler
|
|
@@ -60,6 +60,7 @@ files:
|
|
|
60
60
|
- lib/generators/prompt_navigator/modeling/modeling_generator.rb
|
|
61
61
|
- lib/generators/prompt_navigator/modeling/templates/db/migrate/20260129073026_create_prompt_navigator_prompt_executions.rb
|
|
62
62
|
- lib/prompt_navigator.rb
|
|
63
|
+
- lib/prompt_navigator/configuration.rb
|
|
63
64
|
- lib/prompt_navigator/engine.rb
|
|
64
65
|
- lib/prompt_navigator/helpers.rb
|
|
65
66
|
- lib/prompt_navigator/version.rb
|