ruby_todo 1.0.8 → 1.0.9

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: 674c8336357f505a1e280c70b25f6e2202de7535da7f51a66a8fc511de855656
4
- data.tar.gz: 2772f818887aa4a20d4490f46c2d619720f27a135c3166f98c8412f7f216e968
3
+ metadata.gz: dae18c7aa5f0c69b22d8322958d2bb91dfb44eb69633f0c5f720daa5e10e7dfd
4
+ data.tar.gz: f5fcb64983a413d618d4a878d10545d5e7c161387431d71d3a6dc0560a52f262
5
5
  SHA512:
6
- metadata.gz: 282597c10ca5471923d5f2f617fe56c10b7daec5e8a03e7440a6266e5d4b1b4bec4a3ae5bb78fecd696041d76c89c4cfc29b36595cbd53b27e5278947232c189
7
- data.tar.gz: 0ee9b319591eb7e00e9a84cd029882e1850ee5ac800e547e17418be488d60ece0b7282785d888c372c2c284043b92b68f89e8de99a19a968da2894fd3d236544
6
+ metadata.gz: e3865f71aa4da7b42cecc475b383013f92b6981dbd1c61529b2c4932e6528c3f2a359290f7ee06f34db4c1e3623540158dc1797c675cf36d75f99819ace4af12
7
+ data.tar.gz: 8d5a54bfe135dbdb8fe20087db97f779375481954cf7b7bb1f5c380216cd69936c486c95e79ccbf41f1601622fde7eeb23b3e6a10e98783cc5f16ccda7f0f86a
data/CHANGELOG.md CHANGED
@@ -1,3 +1,8 @@
1
+ ## [1.0.9] - 2025-03-31
2
+
3
+ * Manual release
4
+
5
+
1
6
  ## [1.0.8] - 2025-03-31
2
7
 
3
8
  * Manual release
@@ -32,10 +32,11 @@ module RubyTodo
32
32
 
33
33
  # Extract task description from the prompt
34
34
  def extract_task_description(prompt)
35
- if prompt =~ /create(?:\s+a)?\s+(?:new\s+)?task\s+(?:to|for|about)\s+(.+)/i
35
+ # Match common task creation patterns
36
+ if prompt =~ /(?:create|add|make|set\s+up)(?:\s+a)?\s+(?:new\s+)?task\s+(?:to|for|about|:)\s+(.+)/i
36
37
  Regexp.last_match(1).strip
37
38
  else
38
- ""
39
+ prompt.strip
39
40
  end
40
41
  end
41
42
 
@@ -45,6 +46,7 @@ module RubyTodo
45
46
  task_query = build_task_query(task_description)
46
47
 
47
48
  # Query OpenAI for task details
49
+ say "Enhancing task title and generating details..." if @options && @options[:verbose]
48
50
  content = query_openai_for_task_details(task_query, api_key)
49
51
 
50
52
  # Parse the response
@@ -56,7 +58,9 @@ module RubyTodo
56
58
  "Generate a professional task with the following information:\n" \
57
59
  "Task description: #{task_description}\n" \
58
60
  "Please generate a JSON response with these fields:\n" \
59
- "- title: A concise, professional title for the task\n" \
61
+ "- title: A concise, professional title for the task. Transform basic descriptions into more professional, " \
62
+ "action-oriented titles. For example, 'add new relic infra to questions-engine' should become " \
63
+ "'Integrate New Relic Infrastructure with Questions Engine'\n" \
60
64
  "- description: A detailed description of what the task involves\n" \
61
65
  "- priority: Suggested priority (high, medium, or low)\n" \
62
66
  "- tags: Relevant tags as a comma-separated string"
@@ -68,21 +72,48 @@ module RubyTodo
68
72
  # Query OpenAI for task details
69
73
  def query_openai_for_task_details(task_query, api_key)
70
74
  client = OpenAI::Client.new(access_token: api_key)
75
+ system_prompt = <<~PROMPT
76
+ You are a task management assistant that generates professional task details.
77
+
78
+ Transform simple task descriptions into professional, action-oriented titles that clearly communicate purpose.
79
+
80
+ Examples of transformations:
81
+ - "add new relic infra to questions-engine" → "Integrate New Relic Infrastructure with Questions Engine"
82
+ - "update docker image for app" → "Update and Standardize Docker Image Configuration for Application"
83
+ - "fix login bug" → "Resolve Authentication Issue in Login System"
84
+ - "add monitoring to service" → "Implement Comprehensive Monitoring Solution for Service"
85
+ - "migrate repo to new org" → "Migrate Repository to New Organization Structure"
86
+
87
+ Create concise but descriptive titles that use proper capitalization and professional terminology.
88
+ PROMPT
89
+
71
90
  messages = [
72
- { role: "system", content: "You are a task management assistant that generates professional task details." },
91
+ { role: "system", content: system_prompt },
73
92
  { role: "user", content: task_query }
74
93
  ]
75
94
 
76
95
  say "Generating professional task details..." if @options[:verbose]
77
96
 
78
97
  response = client.chat(parameters: {
79
- model: "gpt-4o-mini",
98
+ model: "gpt-4o",
80
99
  messages: messages,
81
- temperature: 0.7,
100
+ temperature: 0.6,
82
101
  max_tokens: 500
83
102
  })
84
103
 
85
104
  response["choices"][0]["message"]["content"]
105
+ rescue StandardError => e
106
+ # If gpt-4o fails (not available), fallback to gpt-4o-mini
107
+ if e.message.include?("gpt-4o")
108
+ client.chat(parameters: {
109
+ model: "gpt-4o-mini",
110
+ messages: messages,
111
+ temperature: 0.6,
112
+ max_tokens: 500
113
+ })["choices"][0]["message"]["content"]
114
+ else
115
+ raise e
116
+ end
86
117
  end
87
118
  end
88
119
 
@@ -137,6 +168,13 @@ module RubyTodo
137
168
  end
138
169
  end
139
170
 
171
+ # Display the improved task title if there's a significant difference
172
+ if task_details["title"] && task_details["description"] &&
173
+ task_details["title"] != task_details["description"] &&
174
+ task_details["title"] != "Task from #{task_details["description"]}"
175
+ say "✨ Enhanced title: \"#{task_details["title"]}\"", :green
176
+ end
177
+
140
178
  args = ["task:add", notebook_name, task_details["title"]]
141
179
  args << "--description" << task_details["description"] if task_details["description"]
142
180
  args << "--priority" << task_details["priority"] if task_details["priority"]
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module RubyTodo
4
- VERSION = "1.0.8"
4
+ VERSION = "1.0.9"
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ruby_todo
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.8
4
+ version: 1.0.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jeremiah Parrack