openclacky 0.9.34 → 0.9.35

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.
Files changed (63) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +30 -0
  3. data/lib/clacky/agent/cost_tracker.rb +1 -1
  4. data/lib/clacky/agent/llm_caller.rb +14 -10
  5. data/lib/clacky/agent/memory_updater.rb +1 -1
  6. data/lib/clacky/agent/session_serializer.rb +2 -0
  7. data/lib/clacky/agent/skill_manager.rb +1 -1
  8. data/lib/clacky/agent/tool_executor.rb +13 -16
  9. data/lib/clacky/agent/tool_registry.rb +0 -3
  10. data/lib/clacky/agent.rb +63 -38
  11. data/lib/clacky/agent_config.rb +5 -1
  12. data/lib/clacky/brand_config.rb +11 -27
  13. data/lib/clacky/cli.rb +36 -0
  14. data/lib/clacky/default_skills/channel-setup/SKILL.md +1 -1
  15. data/lib/clacky/default_skills/deploy/scripts/rails_deploy.rb +1 -1
  16. data/lib/clacky/default_skills/new/SKILL.md +1 -1
  17. data/lib/clacky/default_skills/product-help/SKILL.md +1 -1
  18. data/lib/clacky/default_skills/recall-memory/SKILL.md +1 -1
  19. data/lib/clacky/default_skills/skill-creator/SKILL.md +1 -1
  20. data/lib/clacky/idle_compression_timer.rb +8 -0
  21. data/lib/clacky/json_ui_controller.rb +2 -1
  22. data/lib/clacky/plain_ui_controller.rb +10 -3
  23. data/lib/clacky/platform_http_client.rb +161 -1
  24. data/lib/clacky/server/channel/channel_manager.rb +5 -3
  25. data/lib/clacky/server/channel/channel_ui_controller.rb +6 -2
  26. data/lib/clacky/server/http_server.rb +235 -40
  27. data/lib/clacky/server/scheduler.rb +17 -16
  28. data/lib/clacky/server/session_registry.rb +1 -5
  29. data/lib/clacky/server/web_ui_controller.rb +7 -6
  30. data/lib/clacky/session_manager.rb +22 -0
  31. data/lib/clacky/skill.rb +19 -3
  32. data/lib/clacky/skill_loader.rb +5 -59
  33. data/lib/clacky/tools/browser.rb +25 -73
  34. data/lib/clacky/tools/security.rb +326 -0
  35. data/lib/clacky/tools/terminal/output_cleaner.rb +63 -0
  36. data/lib/clacky/tools/terminal/persistent_session.rb +247 -0
  37. data/lib/clacky/tools/terminal/session_manager.rb +208 -0
  38. data/lib/clacky/tools/terminal.rb +818 -0
  39. data/lib/clacky/tools/todo_manager.rb +6 -16
  40. data/lib/clacky/tools/trash_manager.rb +2 -2
  41. data/lib/clacky/ui2/components/input_area.rb +11 -2
  42. data/lib/clacky/ui2/layout_manager.rb +438 -488
  43. data/lib/clacky/ui2/output_buffer.rb +310 -0
  44. data/lib/clacky/ui2/ui_controller.rb +72 -21
  45. data/lib/clacky/ui_interface.rb +1 -1
  46. data/lib/clacky/utils/encoding.rb +1 -1
  47. data/lib/clacky/utils/environment_detector.rb +43 -0
  48. data/lib/clacky/utils/model_pricing.rb +3 -3
  49. data/lib/clacky/version.rb +1 -1
  50. data/lib/clacky/web/app.css +479 -178
  51. data/lib/clacky/web/app.js +146 -4
  52. data/lib/clacky/web/auth.js +101 -0
  53. data/lib/clacky/web/i18n.js +35 -1
  54. data/lib/clacky/web/index.html +9 -2
  55. data/lib/clacky/web/sessions.js +254 -15
  56. data/lib/clacky/web/skills.js +20 -6
  57. data/lib/clacky/web/tasks.js +54 -2
  58. data/lib/clacky/web/theme.js +58 -20
  59. data/lib/clacky/web/ws.js +11 -2
  60. data/lib/clacky.rb +2 -2
  61. metadata +8 -3
  62. data/lib/clacky/tools/safe_shell.rb +0 -608
  63. data/lib/clacky/tools/shell.rb +0 -522
@@ -7,7 +7,7 @@ module Clacky
7
7
  module Tools
8
8
  class TodoManager < Base
9
9
  self.tool_name = "todo_manager"
10
- self.tool_description = "Manage TODO items for task planning and tracking. IMPORTANT: This tool is ONLY for planning - after adding all TODOs, you MUST immediately start executing them using other tools (write, edit, shell, etc). DO NOT stop after adding TODOs!"
10
+ self.tool_description = "Plan and track multi-step tasks."
11
11
  self.tool_category = "task_management"
12
12
  self.tool_parameters = {
13
13
  type: "object",
@@ -15,26 +15,16 @@ module Clacky
15
15
  action: {
16
16
  type: "string",
17
17
  enum: ["add", "list", "complete", "remove", "clear"],
18
- description: "Action to perform: 'add' (add new todo(s)), 'list' (show all todos), 'complete' (mark as done), 'remove' (delete todo), 'clear' (remove all todos)"
18
+ description: "add | list | complete | remove | clear"
19
19
  },
20
20
  tasks: {
21
21
  type: "array",
22
22
  items: { type: "string" },
23
- description: "Array of task descriptions to add (for 'add' action). Example: ['Task 1', 'Task 2', 'Task 3']"
23
+ description: "add: multiple task descriptions"
24
24
  },
25
- task: {
26
- type: "string",
27
- description: "Single task description (for 'add' action). Use 'tasks' array for adding multiple tasks at once."
28
- },
29
- id: {
30
- type: "integer",
31
- description: "The task ID (required for 'complete' and 'remove' actions)"
32
- },
33
- ids: {
34
- type: "array",
35
- items: { type: "integer" },
36
- description: "Array of task IDs for batch removal (for 'remove' action). Example: [1, 3, 5]"
37
- }
25
+ task: { type: "string", description: "add: single task description" },
26
+ id: { type: "integer", description: "complete/remove: task id" },
27
+ ids: { type: "array", items: { type: "integer" }, description: "remove: batch task ids" }
38
28
  },
39
29
  required: ["action"]
40
30
  }
@@ -237,7 +237,7 @@ module Clacky
237
237
  help_text = <<~HELP
238
238
  🗑️ Trash Manager Help
239
239
 
240
- The SafeShell tool automatically moves deleted files to a trash directory
240
+ The `terminal` tool automatically moves deleted files to a trash directory
241
241
  instead of permanently deleting them. This tool helps you manage those files.
242
242
 
243
243
  Available actions:
@@ -260,7 +260,7 @@ module Clacky
260
260
  - Use 'list' to see what files are in trash
261
261
  - Use 'restore' to get back accidentally deleted files
262
262
  - Use 'empty' periodically to free up disk space
263
- - All deletions by SafeShell are logged in ~/.clacky/safety_logs/
263
+ - All deletions by `terminal` are logged in ~/.clacky/safety_logs/
264
264
  HELP
265
265
 
266
266
  {
@@ -62,6 +62,7 @@ module Clacky
62
62
  model: nil,
63
63
  tasks: 0,
64
64
  cost: 0.0,
65
+ cost_source: nil, # nil / :api / :price / :default — :default means pricing unknown, show N/A
65
66
  status: 'idle' # Workspace status: 'idle' or 'working'
66
67
  }
67
68
 
@@ -142,13 +143,15 @@ module Clacky
142
143
  # @param model [String] AI model name
143
144
  # @param tasks [Integer] Number of completed tasks
144
145
  # @param cost [Float] Total cost
146
+ # @param cost_source [Symbol, nil] :api / :price / :default — :default renders as N/A
145
147
  # @param status [String] Workspace status ('idle' or 'working')
146
- def update_sessionbar(working_dir: nil, mode: nil, model: nil, tasks: nil, cost: nil, status: nil)
148
+ def update_sessionbar(working_dir: nil, mode: nil, model: nil, tasks: nil, cost: nil, cost_source: nil, status: nil)
147
149
  @sessionbar_info[:working_dir] = working_dir if working_dir
148
150
  @sessionbar_info[:mode] = mode if mode
149
151
  @sessionbar_info[:model] = model if model
150
152
  @sessionbar_info[:tasks] = tasks if tasks
151
153
  @sessionbar_info[:cost] = cost if cost
154
+ @sessionbar_info[:cost_source] = cost_source if cost_source
152
155
  @sessionbar_info[:status] = status if status
153
156
  end
154
157
 
@@ -1154,7 +1157,13 @@ module Clacky
1154
1157
  parts << theme.format_text("#{@sessionbar_info[:tasks]} tasks", :statusbar_secondary)
1155
1158
 
1156
1159
  # Cost
1157
- cost_display = format("$%.1f", @sessionbar_info[:cost])
1160
+ # If cost_source is :default (pricing unknown for this model), show N/A
1161
+ # to stay consistent with the per-iteration token line.
1162
+ cost_display = if @sessionbar_info[:cost_source] == :default
1163
+ "$N/A"
1164
+ else
1165
+ format("$%.1f", @sessionbar_info[:cost])
1166
+ end
1158
1167
  parts << theme.format_text(cost_display, :statusbar_secondary)
1159
1168
 
1160
1169
  " " + parts.join(separator)