openclacky 1.5.21 → 1.5.23
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 +4 -4
- data/CHANGELOG.md +119 -0
- data/docs/secretary-prototype.md +286 -0
- data/lib/clacky/agent/session_serializer.rb +15 -11
- data/lib/clacky/agent.rb +58 -15
- data/lib/clacky/agent_config.rb +3 -1
- data/lib/clacky/agent_profile.rb +33 -6
- data/lib/clacky/billing/platform_billing.rb +9 -0
- data/lib/clacky/default_extensions/advisor/README.md +25 -0
- data/lib/clacky/default_extensions/advisor/README.zh.md +25 -0
- data/lib/clacky/default_extensions/advisor/ext.yml +1 -1
- data/lib/clacky/default_extensions/advisor/icon.svg +14 -0
- data/lib/clacky/default_extensions/coding/ext.yml +0 -1
- data/lib/clacky/default_extensions/computer-use/README.md +48 -0
- data/lib/clacky/default_extensions/computer-use/README.zh.md +48 -0
- data/lib/clacky/default_extensions/computer-use/ext.yml +1 -1
- data/lib/clacky/default_extensions/computer-use/icon.svg +16 -0
- data/lib/clacky/default_extensions/ext-studio/ext.yml +0 -1
- data/lib/clacky/default_extensions/general/ext.yml +0 -1
- data/lib/clacky/default_extensions/git/README.md +41 -0
- data/lib/clacky/default_extensions/git/README.zh.md +41 -0
- data/lib/clacky/default_extensions/git/ext.yml +1 -1
- data/lib/clacky/default_extensions/git/icon.svg +15 -0
- data/lib/clacky/default_extensions/git/panels/git/view.js +1960 -399
- data/lib/clacky/default_extensions/meeting/README.md +46 -0
- data/lib/clacky/default_extensions/meeting/README.zh.md +47 -0
- data/lib/clacky/default_extensions/meeting/ext.yml +1 -1
- data/lib/clacky/default_extensions/meeting/icon.svg +13 -0
- data/lib/clacky/default_extensions/preview/README.md +29 -0
- data/lib/clacky/default_extensions/preview/README.zh.md +29 -0
- data/lib/clacky/default_extensions/preview/ext.yml +1 -1
- data/lib/clacky/default_extensions/preview/icon.svg +13 -0
- data/lib/clacky/default_extensions/preview/panels/preview/view.js +199 -34
- data/lib/clacky/default_extensions/secretary/agents/secretary.md +41 -0
- data/lib/clacky/default_extensions/secretary/agents/worker.md +35 -0
- data/lib/clacky/default_extensions/secretary/api/handler.rb +8 -0
- data/lib/clacky/default_extensions/secretary/ext.yml +39 -0
- data/lib/clacky/default_extensions/secretary/panels/work/view.js +344 -0
- data/lib/clacky/default_extensions/secretary/tools/delegate_work.rb +37 -0
- data/lib/clacky/default_extensions/secretary/tools/manage_work.rb +22 -0
- data/lib/clacky/default_extensions/secretary/tools/yield_work.rb +35 -0
- data/lib/clacky/default_extensions/time_machine/README.md +32 -0
- data/lib/clacky/default_extensions/time_machine/README.zh.md +32 -0
- data/lib/clacky/default_extensions/time_machine/ext.yml +1 -1
- data/lib/clacky/default_extensions/time_machine/icon.svg +14 -0
- data/lib/clacky/default_skills/channel-manager/SKILL.md +79 -8
- data/lib/clacky/default_skills/channel-manager/discord_setup.rb +5 -1
- data/lib/clacky/default_skills/channel-manager/weixin_setup.rb +8 -1
- data/lib/clacky/default_skills/cron-task-creator/SKILL.md +183 -206
- data/lib/clacky/default_skills/cron-task-creator/evals/evals.json +45 -0
- data/lib/clacky/default_skills/media-gen/SKILL.md +17 -8
- data/lib/clacky/extension/api_extension.rb +10 -2
- data/lib/clacky/extension/loader.rb +2 -0
- data/lib/clacky/extension/verifier.rb +2 -2
- data/lib/clacky/locales/en.rb +14 -0
- data/lib/clacky/locales/zh.rb +14 -0
- data/lib/clacky/prompts/base.md +1 -1
- data/lib/clacky/providers.rb +68 -31
- data/lib/clacky/search_config.rb +33 -11
- data/lib/clacky/server/channel/adapters/base.rb +18 -0
- data/lib/clacky/server/channel/adapters/feishu/message_parser.rb +1 -0
- data/lib/clacky/server/channel/adapters/telegram/adapter.rb +1 -0
- data/lib/clacky/server/channel/channel_config.rb +185 -48
- data/lib/clacky/server/channel/channel_manager.rb +179 -66
- data/lib/clacky/server/git_panel.rb +362 -35
- data/lib/clacky/server/http_server.rb +530 -181
- data/lib/clacky/server/preview.rb +118 -17
- data/lib/clacky/server/scheduler.rb +211 -51
- data/lib/clacky/server/web_ui_controller.rb +35 -27
- data/lib/clacky/session_manager.rb +56 -6
- data/lib/clacky/tools/base.rb +7 -1
- data/lib/clacky/utils/file_processor.rb +20 -10
- data/lib/clacky/utils/mac_app_detector.rb +8 -7
- data/lib/clacky/utils/model_pricing.rb +60 -2
- data/lib/clacky/utils/windows_app_detector.rb +3 -1
- data/lib/clacky/version.rb +1 -1
- data/lib/clacky/web/app.css +1114 -205
- data/lib/clacky/web/app.js +143 -8
- data/lib/clacky/web/auth.js +1 -1
- data/lib/clacky/web/components/code-editor.js +73 -4
- data/lib/clacky/web/components/composer.js +107 -8
- data/lib/clacky/web/components/image-zoom.js +165 -0
- data/lib/clacky/web/components/model-picker.js +7 -5
- data/lib/clacky/web/components/notify.js +39 -12
- data/lib/clacky/web/components/onboard.js +1 -1
- data/lib/clacky/web/core/aside.js +60 -3
- data/lib/clacky/web/features/billing/view.js +2 -2
- data/lib/clacky/web/features/channels/store.js +19 -4
- data/lib/clacky/web/features/channels/view.js +92 -28
- data/lib/clacky/web/features/extensions/view.js +17 -10
- data/lib/clacky/web/features/new-session/store.js +79 -2
- data/lib/clacky/web/features/new-session/view.js +516 -75
- data/lib/clacky/web/features/skills/store.js +1 -1
- data/lib/clacky/web/features/tasks/store.js +5 -3
- data/lib/clacky/web/features/tasks/view.js +249 -66
- data/lib/clacky/web/features/workspace/store.js +13 -6
- data/lib/clacky/web/features/workspace/view.js +340 -214
- data/lib/clacky/web/i18n.js +366 -68
- data/lib/clacky/web/index.html +196 -165
- data/lib/clacky/web/projects.js +37 -4
- data/lib/clacky/web/sessions.js +263 -146
- data/lib/clacky/web/settings.js +241 -53
- data/lib/clacky/web/skills.js +2 -2
- data/lib/clacky/web/theme.js +17 -2
- data/lib/clacky/web/utils.js +234 -2
- data/lib/clacky/web/weixin-qr.html +2 -1
- data/lib/clacky/web/ws-dispatcher.js +14 -31
- data/lib/clacky/work/service.rb +542 -0
- data/lib/clacky/work/store.rb +57 -0
- metadata +31 -1
data/lib/clacky/agent.rb
CHANGED
|
@@ -51,6 +51,8 @@ module Clacky
|
|
|
51
51
|
:status, :error, :updated_at, :source, :config,
|
|
52
52
|
:latest_latency, # Hash of latency metrics from the most recent LLM call (see Client#send_messages_with_tools)
|
|
53
53
|
:reasoning_effort
|
|
54
|
+
attr_accessor :work_service
|
|
55
|
+
attr_reader :tool_registry
|
|
54
56
|
attr_accessor :pinned
|
|
55
57
|
attr_accessor :channel_info
|
|
56
58
|
attr_accessor :project_id
|
|
@@ -520,7 +522,7 @@ module Clacky
|
|
|
520
522
|
@name = new_name.to_s.strip
|
|
521
523
|
end
|
|
522
524
|
|
|
523
|
-
def run(user_input, files: nil, reference_contexts: nil, display_text: nil, created_at: nil
|
|
525
|
+
def run(user_input, files: nil, reference_contexts: nil, display_text: nil, created_at: nil)
|
|
524
526
|
# Initialized here (not mid-body) because run's rescue/ensure are
|
|
525
527
|
# method-level and must be able to reference them on any exit path.
|
|
526
528
|
result = nil
|
|
@@ -556,7 +558,11 @@ module Clacky
|
|
|
556
558
|
@cancel_flag = CancelFlag.new
|
|
557
559
|
|
|
558
560
|
# Start new task for Time Machine
|
|
559
|
-
|
|
561
|
+
task_title = display_text.to_s.empty? ? user_input.to_s : display_text.to_s
|
|
562
|
+
if task_title.strip.empty?
|
|
563
|
+
task_title = display_files_for(files).map { |f| f[:name] }.join(", ")
|
|
564
|
+
end
|
|
565
|
+
task_id = start_new_task(title: task_title)
|
|
560
566
|
run_context = { session_id: @session_id, run_id: task_id.to_s,
|
|
561
567
|
source: @source.to_s, input_created_at: created_at,
|
|
562
568
|
observed_at: Time.now.utc.iso8601(6), status: "running" }
|
|
@@ -622,7 +628,7 @@ module Clacky
|
|
|
622
628
|
|
|
623
629
|
append_user_input(user_input, files: files, reference_contexts: reference_contexts,
|
|
624
630
|
display_text: display_text, created_at: created_at,
|
|
625
|
-
|
|
631
|
+
task_id: task_id)
|
|
626
632
|
@total_tasks += 1
|
|
627
633
|
run_turn_started = true
|
|
628
634
|
|
|
@@ -641,8 +647,14 @@ module Clacky
|
|
|
641
647
|
return result = hook_result[:result]
|
|
642
648
|
end
|
|
643
649
|
|
|
650
|
+
work_context = @work_service&.turn_context(self)
|
|
651
|
+
@history.append(role: "user", content: work_context, system_injected: true, task_id: task_id) if work_context
|
|
652
|
+
|
|
644
653
|
# Track if ask_user was called
|
|
645
654
|
awaiting_user_feedback = false
|
|
655
|
+
# A tool handed control back; distinct from finishing a normal reply.
|
|
656
|
+
yielded = false
|
|
657
|
+
notify_user = true
|
|
646
658
|
# Heuristic sibling of the above: the reply merely ended with a question
|
|
647
659
|
# mark. Kept separate because it must never reach build_result — the
|
|
648
660
|
# session status it feeds shows a "waiting" badge to the user, and a
|
|
@@ -657,6 +669,7 @@ module Clacky
|
|
|
657
669
|
@hooks.trigger(:on_iteration, @iterations)
|
|
658
670
|
|
|
659
671
|
consume_steering_inputs
|
|
672
|
+
@work_service&.guard!(self) if Thread.current[:clacky_work]
|
|
660
673
|
|
|
661
674
|
# Think: LLM reasoning with tool support
|
|
662
675
|
response = think
|
|
@@ -794,9 +807,10 @@ module Clacky
|
|
|
794
807
|
# Act: Execute tool calls
|
|
795
808
|
action_result = act(response[:tool_calls], assistant_message: response.delete(:history_message))
|
|
796
809
|
|
|
797
|
-
|
|
798
|
-
if action_result[:awaiting_feedback]
|
|
799
|
-
awaiting_user_feedback =
|
|
810
|
+
notify_user = false if action_result[:notify_user] == false
|
|
811
|
+
if action_result[:awaiting_feedback] || action_result[:end_turn]
|
|
812
|
+
awaiting_user_feedback = !!action_result[:awaiting_feedback]
|
|
813
|
+
yielded = !!action_result[:end_turn]
|
|
800
814
|
observe(response, action_result[:tool_results])
|
|
801
815
|
flush_pending_injections
|
|
802
816
|
break
|
|
@@ -834,13 +848,14 @@ module Clacky
|
|
|
834
848
|
@input_mutex.synchronize { @accepting_steering = false }
|
|
835
849
|
notify_input_queue
|
|
836
850
|
result = build_result(awaiting_user_feedback: awaiting_user_feedback)
|
|
851
|
+
result[:notify_user] = false if !notify_user && !awaiting_user_feedback
|
|
837
852
|
result[:queue_paused] = true if awaiting_user_feedback || task_interrupted
|
|
838
853
|
run_context[:reason] = "tool_denied" if task_interrupted
|
|
839
854
|
|
|
840
855
|
# Run skill evolution hooks after main loop completes
|
|
841
856
|
# Skip if task was interrupted by user (denied tool) or awaiting user feedback
|
|
842
857
|
# Only for main agent (not subagents) to avoid recursive evolution
|
|
843
|
-
unless @is_subagent || task_interrupted || awaiting_user_feedback || turn_unfinished
|
|
858
|
+
unless @is_subagent || task_interrupted || yielded || awaiting_user_feedback || turn_unfinished
|
|
844
859
|
run_skill_evolution_hooks
|
|
845
860
|
end
|
|
846
861
|
|
|
@@ -851,7 +866,7 @@ module Clacky
|
|
|
851
866
|
# and only then [OK] Task Complete is printed. No cleanup dance,
|
|
852
867
|
# no cross-method progress handle holding.
|
|
853
868
|
# Skip on interrupt / feedback / subagent (self-guarded inside too).
|
|
854
|
-
unless @is_subagent || task_interrupted || awaiting_user_feedback || turn_unfinished
|
|
869
|
+
unless @is_subagent || task_interrupted || yielded || awaiting_user_feedback || turn_unfinished
|
|
855
870
|
run_memory_update_subagent
|
|
856
871
|
end
|
|
857
872
|
|
|
@@ -876,7 +891,7 @@ module Clacky
|
|
|
876
891
|
# in this same thread. Skipped for subagents and interrupts.
|
|
877
892
|
# An explicit request for user feedback pauses the goal as well as the
|
|
878
893
|
# queue. Mere question punctuation still leaves the goal judge in charge.
|
|
879
|
-
unless @is_subagent || task_interrupted || awaiting_user_feedback
|
|
894
|
+
unless @is_subagent || task_interrupted || yielded || awaiting_user_feedback
|
|
880
895
|
continuation = maybe_continue_goal(result)
|
|
881
896
|
return continuation if continuation
|
|
882
897
|
end
|
|
@@ -959,9 +974,16 @@ module Clacky
|
|
|
959
974
|
context.merge(status: status, observed_at: Time.now.utc.iso8601(6)))
|
|
960
975
|
end
|
|
961
976
|
|
|
977
|
+
# Resolved context is model-only; retain only reference metadata for UI/replay.
|
|
978
|
+
private def display_references(contexts)
|
|
979
|
+
Array(contexts).select { |ref| ref.is_a?(Hash) }.map do |ref|
|
|
980
|
+
ref.reject { |key, _| key.to_s == "context" }
|
|
981
|
+
end
|
|
982
|
+
end
|
|
983
|
+
|
|
962
984
|
# Shared by initial input and steering; only the execution thread writes history.
|
|
963
985
|
private def append_user_input(user_input, files: nil, reference_contexts: nil,
|
|
964
|
-
display_text: nil, created_at: nil,
|
|
986
|
+
display_text: nil, created_at: nil,
|
|
965
987
|
task_id: @current_task_id)
|
|
966
988
|
# Resolve lightweight metadata first, then commit the accepted user turn
|
|
967
989
|
# before any attachment parser/OCR/sidecar work can block or fail. Session
|
|
@@ -980,7 +1002,7 @@ module Clacky
|
|
|
980
1002
|
display_text: display_text,
|
|
981
1003
|
skill_command: skill_command[:found] ? skill_command[:skill_name] : nil,
|
|
982
1004
|
skill_command_display: skill_command_display,
|
|
983
|
-
display_references:
|
|
1005
|
+
display_references: display_references(reference_contexts)
|
|
984
1006
|
}
|
|
985
1007
|
if staged
|
|
986
1008
|
@history.append(message_metadata.merge(
|
|
@@ -1178,7 +1200,8 @@ module Clacky
|
|
|
1178
1200
|
# Inject referenced past chats (the @mention "send as reference" behavior)
|
|
1179
1201
|
# as a system_injected message — same mechanism as file references: the LLM
|
|
1180
1202
|
# sees the context, but replay_history skips it and no user bubble renders.
|
|
1181
|
-
Array(reference_contexts).each do |
|
|
1203
|
+
Array(reference_contexts).each do |reference|
|
|
1204
|
+
ctx = reference.is_a?(Hash) ? (reference[:context] || reference["context"]) : reference
|
|
1182
1205
|
next if ctx.to_s.strip.empty?
|
|
1183
1206
|
@history.append({ role: "user", content: ctx, system_injected: true, task_id: task_id })
|
|
1184
1207
|
end
|
|
@@ -1320,7 +1343,8 @@ module Clacky
|
|
|
1320
1343
|
source = options.delete(:source) || :web
|
|
1321
1344
|
notify_input_queue
|
|
1322
1345
|
@ui.show_user_message(options[:display_text] || entry[:content], created_at: options[:created_at],
|
|
1323
|
-
files: options[:files] || [], source: source, steering: true
|
|
1346
|
+
files: options[:files] || [], source: source, steering: true,
|
|
1347
|
+
**(!Array(options[:reference_contexts]).any? { |ref| ref.is_a?(Hash) } ? {} : { references: display_references(options[:reference_contexts]) })) if @ui&.respond_to?(:show_user_message)
|
|
1324
1348
|
run(entry[:content], **options)
|
|
1325
1349
|
end
|
|
1326
1350
|
|
|
@@ -1362,7 +1386,8 @@ module Clacky
|
|
|
1362
1386
|
end
|
|
1363
1387
|
committed += 1
|
|
1364
1388
|
@ui&.show_user_message(options[:display_text] || entry[:content],
|
|
1365
|
-
created_at: options[:created_at], files: options[:files] || [], source: source, steering: true
|
|
1389
|
+
created_at: options[:created_at], files: options[:files] || [], source: source, steering: true,
|
|
1390
|
+
**(!Array(options[:reference_contexts]).any? { |ref| ref.is_a?(Hash) } ? {} : { references: display_references(options[:reference_contexts]) })) if @ui&.respond_to?(:show_user_message)
|
|
1366
1391
|
end
|
|
1367
1392
|
notify_input_queue unless entries.empty?
|
|
1368
1393
|
!entries.empty?
|
|
@@ -1589,6 +1614,8 @@ module Clacky
|
|
|
1589
1614
|
feedback = nil
|
|
1590
1615
|
results = []
|
|
1591
1616
|
awaiting_feedback = false
|
|
1617
|
+
end_turn = false
|
|
1618
|
+
notify_user = true
|
|
1592
1619
|
|
|
1593
1620
|
tool_calls.each_with_index do |call, index|
|
|
1594
1621
|
# Resolve tool name: handle case-insensitive and common alias mismatches
|
|
@@ -1607,6 +1634,8 @@ module Clacky
|
|
|
1607
1634
|
# Tool truly not found — let the rescue below handle it with a clear message
|
|
1608
1635
|
end
|
|
1609
1636
|
|
|
1637
|
+
@work_service&.guard!(self)
|
|
1638
|
+
|
|
1610
1639
|
# Hook: before_tool_use
|
|
1611
1640
|
hook_result = @hooks.trigger(:before_tool_use, call)
|
|
1612
1641
|
if hook_result[:action] == :deny
|
|
@@ -1747,6 +1776,8 @@ module Clacky
|
|
|
1747
1776
|
result = tool.execute(**args)
|
|
1748
1777
|
end
|
|
1749
1778
|
|
|
1779
|
+
notify_user = false if result.is_a?(Hash) && result[:notify_user] == false
|
|
1780
|
+
|
|
1750
1781
|
# Hook: after_tool_use
|
|
1751
1782
|
@hooks.trigger(:after_tool_use, call, result)
|
|
1752
1783
|
|
|
@@ -1807,6 +1838,16 @@ module Clacky
|
|
|
1807
1838
|
end
|
|
1808
1839
|
|
|
1809
1840
|
results << build_success_result(call, result)
|
|
1841
|
+
# Tools may end this turn after committing their result (e.g. a durable wait).
|
|
1842
|
+
if result.is_a?(Hash) && result[:end_turn] == true
|
|
1843
|
+
end_turn = true
|
|
1844
|
+
awaiting_feedback = result[:awaiting_feedback] == true
|
|
1845
|
+
# Settle every call in this batch, but execute nothing after yielding.
|
|
1846
|
+
tool_calls.drop(index + 1).each do |remaining|
|
|
1847
|
+
results << build_denied_result(remaining, "Turn ended; remaining calls were not executed", true)
|
|
1848
|
+
end
|
|
1849
|
+
break
|
|
1850
|
+
end
|
|
1810
1851
|
rescue StandardError => e
|
|
1811
1852
|
# Log complete error information to debug_logs for troubleshooting
|
|
1812
1853
|
@debug_logs << {
|
|
@@ -1831,7 +1872,9 @@ module Clacky
|
|
|
1831
1872
|
denied: denied,
|
|
1832
1873
|
feedback: feedback,
|
|
1833
1874
|
tool_results: results,
|
|
1834
|
-
awaiting_feedback: awaiting_feedback
|
|
1875
|
+
awaiting_feedback: awaiting_feedback,
|
|
1876
|
+
end_turn: end_turn,
|
|
1877
|
+
notify_user: notify_user
|
|
1835
1878
|
}
|
|
1836
1879
|
end
|
|
1837
1880
|
|
data/lib/clacky/agent_config.rb
CHANGED
|
@@ -1255,8 +1255,10 @@ module Clacky
|
|
|
1255
1255
|
m = @models.find { |mm| mm["id"] == @current_model_id }
|
|
1256
1256
|
return m if m
|
|
1257
1257
|
# id no longer exists (model was deleted). Fall through to other
|
|
1258
|
-
# resolution strategies below, and clear the stale id.
|
|
1258
|
+
# resolution strategies below, and clear the stale id. The sub-model
|
|
1259
|
+
# pin belonged to the deleted card's provider, so it goes too.
|
|
1259
1260
|
@current_model_id = nil
|
|
1261
|
+
@session_model_overlay = nil
|
|
1260
1262
|
end
|
|
1261
1263
|
|
|
1262
1264
|
default_model = find_model_by_type("default")
|
data/lib/clacky/agent_profile.rb
CHANGED
|
@@ -12,6 +12,8 @@ module Clacky
|
|
|
12
12
|
# Each user profile directory (opt-in override) contains:
|
|
13
13
|
# - profile.yml — name, description, skills whitelist
|
|
14
14
|
# - system_prompt.md — agent-specific system prompt content
|
|
15
|
+
# - base_agent: <extension-agent-id> reuses that agent's rules/tools/panels
|
|
16
|
+
# while retaining this profile's name and additional prompt.
|
|
15
17
|
#
|
|
16
18
|
# Global files (shared across all agents) are user-only overrides:
|
|
17
19
|
# - ~/.clacky/agents/SOUL.md — agent personality/values (else DEFAULT_SOUL)
|
|
@@ -43,13 +45,36 @@ module Clacky
|
|
|
43
45
|
@profile_data = load_profile_yml
|
|
44
46
|
@description = @profile_data["description"] || ""
|
|
45
47
|
@system_prompt_content = load_agent_file("system_prompt.md")
|
|
48
|
+
base = @profile_data["base_agent"].to_s.strip
|
|
49
|
+
unless base.empty?
|
|
50
|
+
@base_unit = result&.agents&.find { |unit| unit.id == base }
|
|
51
|
+
raise ArgumentError, "Base agent '#{base}' is not available from an enabled extension" unless @base_unit
|
|
52
|
+
unless @base_unit.spec["base_agent"].to_s.empty?
|
|
53
|
+
raise ArgumentError, "Chained base_agent references are not supported"
|
|
54
|
+
end
|
|
55
|
+
prompt = @base_unit.spec["prompt_abs"]
|
|
56
|
+
shared = prompt && File.file?(prompt) ? File.read(prompt).strip : ""
|
|
57
|
+
@system_prompt_content = [shared, @system_prompt_content].reject(&:empty?).uniq.join("\n\n")
|
|
58
|
+
end
|
|
59
|
+
end
|
|
60
|
+
|
|
61
|
+
# Extensions can recognize their agent even when a user customizes its name.
|
|
62
|
+
def based_on?(id)
|
|
63
|
+
name == id.to_s || (!!@base_unit && @base_unit.id == id.to_s)
|
|
64
|
+
end
|
|
65
|
+
|
|
66
|
+
# Optional worker profile used for delegated work; user profiles inherit it.
|
|
67
|
+
def work_agent
|
|
68
|
+
value = @profile_data["work_agent"]
|
|
69
|
+
value = @base_unit&.spec&.dig("work_agent") if value.nil?
|
|
70
|
+
value.to_s.strip
|
|
46
71
|
end
|
|
47
72
|
|
|
48
73
|
# Skills explicitly disabled for this agent, matched by skill identifier.
|
|
49
74
|
# Declared via `disabled_skills` in profile.yml or the ext agent spec.
|
|
50
75
|
# @return [Array<String>]
|
|
51
76
|
def disabled_skills
|
|
52
|
-
@disabled_skills ||= Array(@profile_data["disabled_skills"]).map(&:to_s)
|
|
77
|
+
@disabled_skills ||= (Array(@base_unit&.spec&.dig("disabled_skills")) + Array(@profile_data["disabled_skills"])).map(&:to_s).uniq
|
|
53
78
|
end
|
|
54
79
|
|
|
55
80
|
# Extension tools this agent opts into, via `tools:` in profile.yml or the
|
|
@@ -57,15 +82,15 @@ module Clacky
|
|
|
57
82
|
# id is a bare tool id in the agent's own container: `tools/<id>.rb`.
|
|
58
83
|
# @return [Array<String>]
|
|
59
84
|
def tools
|
|
60
|
-
@tools ||= Array(@profile_data["tools"]).map(&:to_s)
|
|
85
|
+
@tools ||= Array((@base_unit ? @base_unit.spec : @profile_data)["tools"]).map(&:to_s)
|
|
61
86
|
end
|
|
62
87
|
|
|
63
88
|
# Directory of the ext container this agent belongs to, or nil for a user
|
|
64
|
-
# profile
|
|
65
|
-
# cannot
|
|
89
|
+
# profile without a base. A derived profile uses its base container and
|
|
90
|
+
# declared tool set; it cannot add arbitrary cross-container tools.
|
|
66
91
|
# @return [String, nil]
|
|
67
92
|
def container_dir
|
|
68
|
-
@ext_unit&.dir
|
|
93
|
+
(@base_unit || @ext_unit)&.dir
|
|
69
94
|
end
|
|
70
95
|
|
|
71
96
|
# Whether a skill is usable by this agent: it must not be in the agent's
|
|
@@ -74,7 +99,7 @@ module Clacky
|
|
|
74
99
|
# @return [Boolean]
|
|
75
100
|
def skill_allowed?(skill)
|
|
76
101
|
return false if disabled_skills.include?(skill.identifier)
|
|
77
|
-
skill.allowed_for_agent?(name)
|
|
102
|
+
skill.allowed_for_agent?(name) || (!!@base_unit && skill.allowed_for_agent?(@base_unit.id))
|
|
78
103
|
end
|
|
79
104
|
|
|
80
105
|
# @param name [String, Symbol] profile name (e.g. "coding", "general")
|
|
@@ -207,6 +232,8 @@ module Clacky
|
|
|
207
232
|
if @ext_unit
|
|
208
233
|
return {
|
|
209
234
|
"name" => @name,
|
|
235
|
+
"base_agent" => @ext_unit.spec["base_agent"],
|
|
236
|
+
"work_agent" => @ext_unit.spec["work_agent"],
|
|
210
237
|
"description" => @ext_unit.spec["description"],
|
|
211
238
|
"panels" => @ext_unit.spec["panels"],
|
|
212
239
|
"skills" => @ext_unit.spec["skills"],
|
|
@@ -18,7 +18,10 @@ module Clacky
|
|
|
18
18
|
# Retired aliases stay here so usage recorded under them still resolves.
|
|
19
19
|
ALIAS_TO_REAL = {
|
|
20
20
|
# deepseek (dsk-)
|
|
21
|
+
# REAL_TO_ALIAS is built with Hash#invert, which keeps the last entry
|
|
22
|
+
# per real id — list the current alias after its retired predecessor.
|
|
21
23
|
"dsk-deepseek-flash" => "deepseek-flash",
|
|
24
|
+
"dsk-deepseek-v4.1-flash" => "deepseek-flash",
|
|
22
25
|
"dsk-deepseek-v4-pro" => "deepseek-v4-pro",
|
|
23
26
|
"dsk-deepseek-v4-flash" => "deepseek-v4-flash",
|
|
24
27
|
"dsk-deepseek-v4-flash-vision-exp" => "deepseek-v4-flash-vision-exp",
|
|
@@ -62,14 +65,20 @@ module Clacky
|
|
|
62
65
|
"or-gemini-3-6-flash" => "gemini-3.6-flash",
|
|
63
66
|
"or-gemini-3-5-flash" => "gemini-3.5-flash",
|
|
64
67
|
# image generation (or-)
|
|
68
|
+
"or-gemini-nano-banana-2-1" => "gemini-nano-banana-2.1",
|
|
65
69
|
"or-gemini-3-pro-image" => "gemini-3-pro-image",
|
|
66
70
|
"or-gemini-3-1-flash-image" => "gemini-3.1-flash-image",
|
|
71
|
+
"or-gemini-3-1-flash-lite-image" => "gemini-3.1-flash-lite-image",
|
|
72
|
+
"or-gpt-image-2-5" => "openai/gpt-image-2.5-sunburst",
|
|
73
|
+
"or-gpt-image-2-5-flare" => "openai/gpt-image-2.5-flare",
|
|
67
74
|
"or-gpt-image-2" => "openai/gpt-5.4-image-2",
|
|
68
75
|
# video generation (or-)
|
|
69
76
|
"or-veo-3" => "veo-3.0-generate-001",
|
|
70
77
|
"or-veo-3-fast" => "veo-3.0-fast-generate-001",
|
|
71
78
|
"or-veo-3-1" => "veo-3.1-generate-001",
|
|
72
79
|
"or-veo-3-1-fast" => "veo-3.1-fast-generate-001",
|
|
80
|
+
"or-veo-3-1-lite" => "veo-3.1-lite-generate-001",
|
|
81
|
+
"or-gemini-omni-flash" => "gemini-omni-1.2-flash",
|
|
73
82
|
# text-to-speech (or-)
|
|
74
83
|
"or-tts-gemini-2-5-flash" => "gemini-2.5-flash-tts",
|
|
75
84
|
"or-tts-gemini-2-5-pro" => "gemini-2.5-pro-tts",
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
# Advisor
|
|
2
|
+
|
|
3
|
+
After each round of work, the AI reviews what it just did and shows **3 suggested next steps** above the input box, so you never have to wonder what to do next.
|
|
4
|
+
|
|
5
|
+
## How to use
|
|
6
|
+
|
|
7
|
+
1. Chat with the AI and let it work as usual.
|
|
8
|
+
2. When a round finishes, a "Next steps" card appears above the input box (it shows a loading state while generating).
|
|
9
|
+
3. For any suggestion:
|
|
10
|
+
- **Click the text** to fill it into the input box, then edit and send it yourself.
|
|
11
|
+
- **Click "Send now"** to send it to the AI as-is.
|
|
12
|
+
4. Click **✕ (Dismiss)** to hide the card for this round; it comes back next round.
|
|
13
|
+
|
|
14
|
+
Suggestions usually cover three different directions: continue / fix, verify, and wrap up. Nothing runs automatically — you are always in control.
|
|
15
|
+
|
|
16
|
+
## Turning it on and off
|
|
17
|
+
|
|
18
|
+
- The **⏻** button on the card turns the advisor off.
|
|
19
|
+
- Turn it back on any time in **Settings → Advisor**.
|
|
20
|
+
- You can also disable the whole extension from Extensions.
|
|
21
|
+
|
|
22
|
+
## Tips
|
|
23
|
+
|
|
24
|
+
- Suggestions are based only on what actually happened in the round — no invented files or commands.
|
|
25
|
+
- If there is no sensible next step, no card is shown.
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
# 工作建议
|
|
2
|
+
|
|
3
|
+
每轮任务结束后,AI 会回顾刚完成的工作,在输入框上方给出 **3 条下一步建议**,让你不用想"接下来该做什么"。
|
|
4
|
+
|
|
5
|
+
## 怎么用
|
|
6
|
+
|
|
7
|
+
1. 正常和 AI 对话、让它干活。
|
|
8
|
+
2. 一轮任务完成后,输入框上方会出现「接下来建议」卡片(生成时显示「正在生成建议…」)。
|
|
9
|
+
3. 对任意一条建议:
|
|
10
|
+
- **点击建议文字**:内容会填进输入框,你可以先修改再发送。
|
|
11
|
+
- **点击「直接发送」**:原样发给 AI,立即执行。
|
|
12
|
+
4. 不需要时点卡片右上角 **✕(收起本次)**,下一轮会重新出现。
|
|
13
|
+
|
|
14
|
+
建议通常覆盖三个不同方向:继续 / 修复、验证、收尾。不会自动执行任何操作,一切由你决定。
|
|
15
|
+
|
|
16
|
+
## 开关
|
|
17
|
+
|
|
18
|
+
- 卡片上的 **⏻** 按钮可一键关闭工作建议。
|
|
19
|
+
- 关闭后可在「设置 → 工作建议」中重新开启。
|
|
20
|
+
- 也可以在扩展管理里整体停用本扩展。
|
|
21
|
+
|
|
22
|
+
## 小贴士
|
|
23
|
+
|
|
24
|
+
- 建议只基于本轮实际发生的事情生成,不会编造文件或命令。
|
|
25
|
+
- 如果没有合理的下一步,卡片不会出现。
|
|
@@ -5,8 +5,8 @@ display_name_zh: 工作建议
|
|
|
5
5
|
description: Recommends next steps after each task, based on your own workflow
|
|
6
6
|
description_zh: 每轮任务结束后,基于你的专属流程推荐下一步工作
|
|
7
7
|
version: "0.1.0"
|
|
8
|
+
icon: icon.svg
|
|
8
9
|
author: OpenClacky
|
|
9
|
-
homepage: https://www.openclacky.com
|
|
10
10
|
license: MIT
|
|
11
11
|
contributes:
|
|
12
12
|
agents:
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
<svg width="36" height="36" viewBox="0 0 36 36" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2
|
+
<defs>
|
|
3
|
+
<linearGradient id="advisor-bg" x1="18" y1="0" x2="18" y2="36" gradientUnits="userSpaceOnUse">
|
|
4
|
+
<stop stop-color="#9F7AEA"/>
|
|
5
|
+
<stop offset="1" stop-color="#7C3AED"/>
|
|
6
|
+
</linearGradient>
|
|
7
|
+
</defs>
|
|
8
|
+
<rect width="36" height="36" fill="url(#advisor-bg)"/>
|
|
9
|
+
<g transform="translate(8 8) scale(0.8333)" stroke="#fff" stroke-width="2.2" stroke-linecap="round" stroke-linejoin="round">
|
|
10
|
+
<path d="M15 14c.2-1 .7-1.7 1.5-2.5 1-.9 1.5-2.2 1.5-3.5A6 6 0 0 0 6 8c0 1 .2 2.2 1.5 3.5.7.7 1.3 1.5 1.5 2.5"/>
|
|
11
|
+
<path d="M9 18h6"/>
|
|
12
|
+
<path d="M10 22h4"/>
|
|
13
|
+
</g>
|
|
14
|
+
</svg>
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
# Computer Use
|
|
2
|
+
|
|
3
|
+
Let the AI operate your desktop the way a person would: take a screenshot to see the screen, then click and type. Use it for things the terminal and browser cannot reach.
|
|
4
|
+
|
|
5
|
+
> This extension is **off by default**. Click **Enable** in Extensions to turn it on.
|
|
6
|
+
|
|
7
|
+
## What it is good for
|
|
8
|
+
|
|
9
|
+
- Native apps, System Settings, installers
|
|
10
|
+
- Dialogs, menu bars and file pickers
|
|
11
|
+
- Anything else that can only be done by clicking on screen
|
|
12
|
+
|
|
13
|
+
For web automation, prefer the built-in browser capability — it is faster and more reliable. Fall back to Computer Use only when the browser cannot do the job.
|
|
14
|
+
|
|
15
|
+
## Setup
|
|
16
|
+
|
|
17
|
+
**macOS**
|
|
18
|
+
|
|
19
|
+
In **System Settings → Privacy & Security**, grant the app running Clacky (your terminal or the Clacky app):
|
|
20
|
+
|
|
21
|
+
- **Screen Recording** (for screenshots)
|
|
22
|
+
- **Accessibility** (to control mouse and keyboard)
|
|
23
|
+
|
|
24
|
+
You may need to restart that app after granting.
|
|
25
|
+
|
|
26
|
+
**Windows**
|
|
27
|
+
|
|
28
|
+
Run Clacky inside **WSL**, from a logged-in desktop session (not a background service or SSH session). Otherwise screenshots come back black and input goes nowhere.
|
|
29
|
+
|
|
30
|
+
> Plain Linux is not supported.
|
|
31
|
+
|
|
32
|
+
## How to use
|
|
33
|
+
|
|
34
|
+
Once enabled, just describe the task in plain language, for example:
|
|
35
|
+
|
|
36
|
+
- "Open System Settings and turn the display brightness all the way up"
|
|
37
|
+
- "In the file picker that just opened, select report.pdf on the Desktop"
|
|
38
|
+
|
|
39
|
+
The AI takes a screenshot first, clicks and types by coordinates, and re-checks the screen after each step.
|
|
40
|
+
|
|
41
|
+
## Troubleshooting
|
|
42
|
+
|
|
43
|
+
Ask the AI to "run the computer-use doctor check". It verifies permissions and environment and tells you what is missing.
|
|
44
|
+
|
|
45
|
+
## Notes
|
|
46
|
+
|
|
47
|
+
- Avoid using the mouse and keyboard while the AI is working, so you don't interfere with each other.
|
|
48
|
+
- Keep an eye on each step for sensitive actions such as payments or deletions.
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
# 电脑操作
|
|
2
|
+
|
|
3
|
+
让 AI 像人一样操作你的电脑桌面:截屏看界面,再用鼠标点击、键盘输入。适合处理终端和浏览器够不到的事情。
|
|
4
|
+
|
|
5
|
+
> 本扩展**默认关闭**。在扩展管理中点击「启用」后生效。
|
|
6
|
+
|
|
7
|
+
## 适合做什么
|
|
8
|
+
|
|
9
|
+
- 操作原生应用、系统设置、安装程序
|
|
10
|
+
- 处理弹窗、菜单栏、文件选择器
|
|
11
|
+
- 其他只能"用手点"的桌面操作
|
|
12
|
+
|
|
13
|
+
网页上的自动化任务建议优先使用内置的浏览器能力,更快也更稳定;只有浏览器搞不定时再用电脑操作。
|
|
14
|
+
|
|
15
|
+
## 使用前准备
|
|
16
|
+
|
|
17
|
+
**macOS**
|
|
18
|
+
|
|
19
|
+
在「系统设置 → 隐私与安全性」中,为运行 Clacky 的程序(如终端或 Clacky 应用)授予:
|
|
20
|
+
|
|
21
|
+
- **屏幕录制**(用于截屏)
|
|
22
|
+
- **辅助功能**(用于控制鼠标和键盘)
|
|
23
|
+
|
|
24
|
+
授权后可能需要重启该程序。
|
|
25
|
+
|
|
26
|
+
**Windows**
|
|
27
|
+
|
|
28
|
+
需要在 **WSL** 中运行 Clacky,并且是在已登录的桌面会话里(不能是后台服务或 SSH 远程会话),否则截屏会是黑屏、点击无效。
|
|
29
|
+
|
|
30
|
+
> 纯 Linux 系统暂不支持。
|
|
31
|
+
|
|
32
|
+
## 怎么用
|
|
33
|
+
|
|
34
|
+
启用后直接用自然语言描述任务即可,例如:
|
|
35
|
+
|
|
36
|
+
- 「打开系统设置,把显示器亮度调到最高」
|
|
37
|
+
- 「在弹出的文件选择框里选中桌面上的 report.pdf」
|
|
38
|
+
|
|
39
|
+
AI 会先截屏查看当前屏幕,再按坐标点击、输入,每一步之后重新截屏确认结果。
|
|
40
|
+
|
|
41
|
+
## 遇到问题
|
|
42
|
+
|
|
43
|
+
对 AI 说「运行 computer-use 的 doctor 自检」,它会检查权限和环境,并告诉你缺什么。
|
|
44
|
+
|
|
45
|
+
## 注意事项
|
|
46
|
+
|
|
47
|
+
- AI 操作期间请尽量不要动鼠标键盘,以免互相干扰。
|
|
48
|
+
- 涉及付款、删除等敏感操作时,请留意 AI 的每一步。
|
|
@@ -5,8 +5,8 @@ display_name_zh: 电脑操作
|
|
|
5
5
|
description: Let the AI drive your desktop — macOS, or Windows through WSL — with screenshots, mouse and keyboard.
|
|
6
6
|
description_zh: 让 AI 直接操作桌面(macOS,或 WSL 下的 Windows)——截屏、鼠标、键盘。
|
|
7
7
|
version: "0.1.0"
|
|
8
|
+
icon: icon.svg
|
|
8
9
|
author: OpenClacky
|
|
9
|
-
homepage: https://www.openclacky.com
|
|
10
10
|
license: MIT
|
|
11
11
|
origin: self
|
|
12
12
|
enabled_by_default: false
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
<svg width="36" height="36" viewBox="0 0 36 36" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2
|
+
<defs>
|
|
3
|
+
<linearGradient id="computeruse-bg" x1="18" y1="0" x2="18" y2="36" gradientUnits="userSpaceOnUse">
|
|
4
|
+
<stop stop-color="#FB9A2C"/>
|
|
5
|
+
<stop offset="1" stop-color="#F26B12"/>
|
|
6
|
+
</linearGradient>
|
|
7
|
+
</defs>
|
|
8
|
+
<rect width="36" height="36" fill="url(#computeruse-bg)"/>
|
|
9
|
+
<g transform="translate(8 8) scale(0.8333)" stroke="#fff" stroke-width="2.2" stroke-linecap="round" stroke-linejoin="round">
|
|
10
|
+
<path d="M14 4.1 12 6"/>
|
|
11
|
+
<path d="m5.1 8-2.9-.8"/>
|
|
12
|
+
<path d="m6 12-1.9 2"/>
|
|
13
|
+
<path d="M7.2 2.2 8 5.1"/>
|
|
14
|
+
<path d="M9.037 9.69a.498.498 0 0 1 .653-.653l11 4.5a.5.5 0 0 1-.074.949l-4.349 1.041a1 1 0 0 0-.74.739l-1.04 4.35a.5.5 0 0 1-.95.074z"/>
|
|
15
|
+
</g>
|
|
16
|
+
</svg>
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
# Git
|
|
2
|
+
|
|
3
|
+
A friendly review panel for changes: see exactly which files and lines the AI touched, and review them like a pull request.
|
|
4
|
+
|
|
5
|
+
> The session's working directory must be a Git repository.
|
|
6
|
+
|
|
7
|
+
## Opening it
|
|
8
|
+
|
|
9
|
+
Switch to the **Git** tab in the session's side panel.
|
|
10
|
+
|
|
11
|
+
## Choosing what to look at
|
|
12
|
+
|
|
13
|
+
Use the scope dropdown at the top:
|
|
14
|
+
|
|
15
|
+
| Scope | What it shows |
|
|
16
|
+
|---|---|
|
|
17
|
+
| Last turn | Only what the AI changed in its last round (most common) |
|
|
18
|
+
| Uncommitted | Everything changed since the last commit |
|
|
19
|
+
| Unstaged / Staged | Changes split by the Git index |
|
|
20
|
+
| Committed | Commits on the current branch vs. the base branch |
|
|
21
|
+
| Unpushed commits | Commits not yet pushed, one by one |
|
|
22
|
+
| Branch | Compare against any branch |
|
|
23
|
+
|
|
24
|
+
## Reading the diff
|
|
25
|
+
|
|
26
|
+
- **File tree** on the left lists every changed file. Drag to resize (double-click to reset) or hide it.
|
|
27
|
+
- **Go to file** filters the list by name.
|
|
28
|
+
- **Diff layout**: auto / split / unified — click to switch.
|
|
29
|
+
- **Wrap** long lines when needed.
|
|
30
|
+
- Unchanged code collapses into "N unchanged lines"; click to expand.
|
|
31
|
+
- Very large diffs load on demand — click to show them.
|
|
32
|
+
|
|
33
|
+
## File actions
|
|
34
|
+
|
|
35
|
+
- **Discard changes**: the revert button on a file header discards that file's changes after a second confirmation. This cannot be undone.
|
|
36
|
+
- **More menu / right-click**: copy path, copy relative path, open in editor, add to chat, reveal in folder, download.
|
|
37
|
+
|
|
38
|
+
## Tips
|
|
39
|
+
|
|
40
|
+
- Want the AI to keep working on a file? Use **Add to chat** to reference it in the input box.
|
|
41
|
+
- To look back at a single step or roll everything back, pair this with the **Time Machine** extension.
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
# Git 管理
|
|
2
|
+
|
|
3
|
+
一个直观的改动审阅面板:AI 改了哪些文件、改了哪几行,一眼看清,像审阅代码一样逐个确认。
|
|
4
|
+
|
|
5
|
+
> 需要当前会话的工作目录是一个 Git 仓库。
|
|
6
|
+
|
|
7
|
+
## 怎么打开
|
|
8
|
+
|
|
9
|
+
在会话右侧面板中切换到 **「Git 管理」** 标签页。
|
|
10
|
+
|
|
11
|
+
## 选择查看范围
|
|
12
|
+
|
|
13
|
+
点击顶部的范围下拉框,可以切换要看的改动:
|
|
14
|
+
|
|
15
|
+
| 范围 | 说明 |
|
|
16
|
+
|---|---|
|
|
17
|
+
| 上一轮 | 只看 AI 上一轮任务改了什么(最常用) |
|
|
18
|
+
| 未提交 | 自上次提交以来的全部改动 |
|
|
19
|
+
| 未暂存 / 已暂存 | 按 Git 暂存区拆分查看 |
|
|
20
|
+
| 已提交 | 当前分支相对基线分支的提交 |
|
|
21
|
+
| 未推送的提交 | 还没 push 到远端的提交,可逐个查看 |
|
|
22
|
+
| 分支 | 选择任意分支进行对比 |
|
|
23
|
+
|
|
24
|
+
## 浏览改动
|
|
25
|
+
|
|
26
|
+
- **左侧文件树**:列出所有改动文件,可拖动调整宽度(双击复位),也可以收起。
|
|
27
|
+
- **跳转到文件**:输入文件名快速筛选定位。
|
|
28
|
+
- **差异布局**:自动 / 并排 / 行内,点击切换。
|
|
29
|
+
- **自动换行**:长行太多时打开。
|
|
30
|
+
- 未修改的代码会折叠成「N 行未修改」,点击展开。
|
|
31
|
+
- 改动很大的文件会延迟加载,点一下再显示。
|
|
32
|
+
|
|
33
|
+
## 对文件进行操作
|
|
34
|
+
|
|
35
|
+
- **撤销此文件的改动**:点文件头部的撤销按钮,再次确认后丢弃该文件的改动(不可恢复,请谨慎)。
|
|
36
|
+
- **更多菜单 / 右键**:复制路径、复制相对路径、在编辑器中打开、添加到聊天、打开所在文件夹、下载。
|
|
37
|
+
|
|
38
|
+
## 小贴士
|
|
39
|
+
|
|
40
|
+
- 想让 AI 针对某个文件继续修改?用「添加到聊天」把它带进输入框。
|
|
41
|
+
- 只想回看 AI 某一步的改动,或整体回退,可配合「时光机」扩展使用。
|