prompt_navigator 2.2.0 → 2.3.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: f448c834c18a600ebf636fad362e51f7dd80c354484e1971388a884cdd9ffb80
4
- data.tar.gz: d9a983063d1afe013001e7017b64ecc49f60467ea6e24a4179c20f37698d7eb4
3
+ metadata.gz: d8d6d7f53a86bd7346042c4bd0fc8453ab6730c32c2a82db980a8baa48ab57b8
4
+ data.tar.gz: c1f9ba3a7a01b7e96c9b910f8ef2f74bb36ea985fe46fc7f651fedf6d178cee6
5
5
  SHA512:
6
- metadata.gz: 7e3e53891c90ffa1fe59767eeb2de6f10b215eef872c4ca815384329b61e315aca9de871ed6f91761c22ef3c252d00415d6741b9158cf46b1ff51284b0c5db46
7
- data.tar.gz: 35998b74c979da62e030e6bec1609bc35aea630fb205ffed49718f39a3b594879bb0d5c30340b0c9f5b6e38d8fc211b18c7f273d3d788f84a5e64843b09be3ba
6
+ metadata.gz: 49ad4dd6cc6818466ebe23421dbe05472ebe616854a1add8b3804ba08c6aa816085075240ae761f5c23e349b2a58347dcf1847c6e7cda8d7a077556e5f2bcdf5
7
+ data.tar.gz: 2079bd5b058312231a66c5e666ac747a2a3736e76fc0734ff6a99402cc7d72d4b6f4140e103cf8e54ce08244f92e1b1d32708e19eaabee7be63dbebefd3904eb
@@ -7,10 +7,14 @@
7
7
  delete_path = locals[:delete_path]
8
8
  is_leaf = locals[:is_leaf]
9
9
 
10
- # Hide leading attached-image data URIs (`![](data:image/png;base64,…)`).
11
- # The base64 blob isn't useful in a 30-char preview replace each with a
12
- # short marker so the rest of the prompt text is visible.
13
- display_prompt = ann.prompt.to_s.gsub(/!\[[^\]]*\]\(data:[^)]+\)/m, "[image]").strip
10
+ # Hide attached-file data URIs so the base64 blob doesn't dominate the
11
+ # 30-char preview. Images use `![alt](data:…)` and get replaced with `[image]`;
12
+ # documents use `[filename](data:…)` and get replaced with `[filename]`
13
+ # (or `[document]` if the filename slot is empty).
14
+ display_prompt = ann.prompt.to_s
15
+ .gsub(/!\[[^\]]*\]\(data:[^)]+\)/m, "[image]")
16
+ .gsub(/(?<!!)\[([^\]]*)\]\(data:[^)]+\)/m) { "[#{Regexp.last_match(1).presence || 'document'}]" }
17
+ .strip
14
18
  %>
15
19
 
16
20
  <div class="history-card<%= ' is-active' if is_active %>" data-history-target="cards" data-uuid="<%= ann.execution_id %>" data-parent-uuid="<%= parent_uuid %>">
@@ -1,3 +1,3 @@
1
1
  module PromptNavigator
2
- VERSION = "2.2.0"
2
+ VERSION = "2.3.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: 2.2.0
4
+ version: 2.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - dhq_boiler