openclacky 1.5.12 → 1.5.13

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 (57) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +48 -0
  3. data/lib/clacky/access_key.rb +59 -0
  4. data/lib/clacky/agent/message_compressor_helper.rb +52 -1
  5. data/lib/clacky/agent/session_serializer.rb +35 -2
  6. data/lib/clacky/agent/time_machine.rb +9 -1
  7. data/lib/clacky/agent.rb +11 -7
  8. data/lib/clacky/agent_config.rb +40 -0
  9. data/lib/clacky/agent_profile.rb +5 -5
  10. data/lib/clacky/billing/platform_billing.rb +84 -1
  11. data/lib/clacky/brand_config.rb +4 -3
  12. data/lib/clacky/cli.rb +4 -2
  13. data/lib/clacky/client.rb +107 -0
  14. data/lib/clacky/default_extensions/ext-studio/api/handler.rb +3 -0
  15. data/lib/clacky/default_extensions/ext-studio/panels/studio/view.js +40 -21
  16. data/lib/clacky/default_extensions/git/ext.yml +1 -1
  17. data/lib/clacky/default_extensions/git/panels/git/view.js +483 -77
  18. data/lib/clacky/default_extensions/meeting/ext.yml +2 -1
  19. data/lib/clacky/default_extensions/time_machine/ext.yml +1 -1
  20. data/lib/clacky/default_extensions/time_machine/panels/time_machine/view.js +186 -208
  21. data/lib/clacky/extension/packager.rb +4 -2
  22. data/lib/clacky/extension/verifier.rb +14 -1
  23. data/lib/clacky/message_format/open_ai.rb +5 -1
  24. data/lib/clacky/message_format/open_ai_responses.rb +409 -0
  25. data/lib/clacky/message_history.rb +6 -2
  26. data/lib/clacky/openai_responses_stream_aggregator.rb +294 -0
  27. data/lib/clacky/providers.rb +18 -6
  28. data/lib/clacky/server/dir_picker.rb +154 -0
  29. data/lib/clacky/server/git_panel.rb +61 -9
  30. data/lib/clacky/server/http_server.rb +147 -103
  31. data/lib/clacky/tools/terminal.rb +27 -3
  32. data/lib/clacky/ui2/markdown_renderer.rb +15 -12
  33. data/lib/clacky/ui2/strings_cjk_patch.rb +132 -0
  34. data/lib/clacky/ui2/themes/hacker_theme.rb +1 -1
  35. data/lib/clacky/ui2/themes/minimal_theme.rb +1 -1
  36. data/lib/clacky/utils/model_pricing.rb +70 -4
  37. data/lib/clacky/version.rb +1 -1
  38. data/lib/clacky/web/app.css +412 -108
  39. data/lib/clacky/web/components/composer.js +45 -7
  40. data/lib/clacky/web/components/custom-select.js +136 -0
  41. data/lib/clacky/web/components/mentions.js +58 -2
  42. data/lib/clacky/web/components/model-picker.js +527 -0
  43. data/lib/clacky/web/components/onboard.js +29 -55
  44. data/lib/clacky/web/core/ext.js +38 -0
  45. data/lib/clacky/web/features/billing/view.js +20 -6
  46. data/lib/clacky/web/features/extensions/view.js +22 -10
  47. data/lib/clacky/web/features/new-session/store.js +15 -1
  48. data/lib/clacky/web/features/new-session/view.js +31 -22
  49. data/lib/clacky/web/features/trash/view.js +31 -19
  50. data/lib/clacky/web/features/workspace/store.js +1 -0
  51. data/lib/clacky/web/features/workspace/view.js +54 -3
  52. data/lib/clacky/web/i18n.js +73 -11
  53. data/lib/clacky/web/index.html +92 -37
  54. data/lib/clacky/web/sessions.js +550 -592
  55. data/lib/clacky/web/settings.js +163 -190
  56. data/lib/clacky.rb +3 -0
  57. metadata +8 -1
@@ -7,6 +7,23 @@ module Clacky
7
7
  # Pricing per 1M tokens (MTok) in USD
8
8
  # All pricing is based on official API documentation
9
9
  PRICING_TABLE = {
10
+ # Claude Fable 5.1 — same input/output as Fable 5, but cache read is
11
+ # $0.25/MTok (vs $1.00 for Fable 5). Source: Anthropic pricing table.
12
+ "claude-fable-5-1" => {
13
+ input: {
14
+ default: 10.00, # $10/MTok for prompts ≤ 200K tokens
15
+ over_200k: 10.00
16
+ },
17
+ output: {
18
+ default: 50.00, # $50/MTok for prompts ≤ 200K tokens
19
+ over_200k: 50.00
20
+ },
21
+ cache: {
22
+ write: 12.50, # $12.50/MTok cache write (5-min tier)
23
+ read: 0.25 # $0.25/MTok cache read
24
+ }
25
+ },
26
+
10
27
  # Claude 4.5 models - tiered pricing based on prompt length
11
28
  "claude-fable-5" => {
12
29
  input: {
@@ -408,6 +425,26 @@ module Clacky
408
425
  }
409
426
  },
410
427
 
428
+ # Gemini 3.8 Flash. Flat pricing, 1M context, 64K max output.
429
+ # Same list price as 3.7/3.6 Flash; intro rate $0.75/$3.75 through
430
+ # 2026-12-31 before settling at $1.50/$7.50 (list price shown).
431
+ # Cache write billed at input rate (Vertex doesn't expose a separate
432
+ # cache-write charge in the OpenAI shim usage response).
433
+ "gemini-3.8-flash" => {
434
+ input: {
435
+ default: 1.50,
436
+ over_200k: 1.50
437
+ },
438
+ output: {
439
+ default: 7.50,
440
+ over_200k: 7.50
441
+ },
442
+ cache: {
443
+ write: 1.50,
444
+ read: 0.15
445
+ }
446
+ },
447
+
411
448
  # Gemini 3.7 Flash. Flat pricing, 1M context, 64K max output.
412
449
  # Same list price as 3.6 Flash; both carry an intro rate of $0.75/$3.75
413
450
  # through 2026-12-31 before settling at $1.50/$7.50 (list price shown).
@@ -617,6 +654,18 @@ module Clacky
617
654
  # GLM-5.3 shares GLM-5.2's base model (all gains are post-training per
618
655
  # Z.ai's release notes) and Z.ai's pricing page does not list a separate
619
656
  # GLM-5.3 row yet, so it is billed at the GLM-5.2 flat rate.
657
+ # GLM-5.3-Flash: GLM-5's first natively-multimodal model (image/video/
658
+ # file input). Listed at the non-promotional Z.ai rates — input $0.15,
659
+ # output $0.50, cache read $0.03 per 1M tokens; the 50%-off launch promo
660
+ # ($0.075 / $0.25 / $0.015, ends 2026-09-09) is ignored per the
661
+ # "displayed ≤ actual" rule. Cache write bills at the input miss rate
662
+ # (storage is "Limited-time Free").
663
+ "glm-5.3-flash" => {
664
+ input: { default: 0.15, over_200k: 0.15 },
665
+ output: { default: 0.50, over_200k: 0.50 },
666
+ cache: { write: 0.15, read: 0.03 }
667
+ },
668
+
620
669
  "glm-5.3" => {
621
670
  input: { default: 1.40, over_200k: 1.40 },
622
671
  output: { default: 4.40, over_200k: 4.40 },
@@ -724,6 +773,15 @@ module Clacky
724
773
  # - cache.read = official explicit-cache-hit price.
725
774
  # - When a model has NO published explicit-cache price (e.g. qwen3.6-27b,
726
775
  # qwen-plus-latest), cache.write/read fall back to the input rate.
776
+ # qwen3.8-max: NOT tiered (single flat tier). Reuses qwen3.7-max's
777
+ # international list rates (2.5 / 7.5 / 3.125 / 0.25) — the billing
778
+ # page hasn't listed qwen3.8-max yet, so this is a safe upper bound.
779
+ "qwen3.8-max" => {
780
+ input: { default: 2.5, over_200k: 2.5 },
781
+ output: { default: 7.5, over_200k: 7.5 },
782
+ cache: { write: 3.125, read: 0.25 }
783
+ },
784
+
727
785
  # qwen3.7-max: NOT tiered (single flat tier per Alibaba's definition).
728
786
  # List price: input 2.5, output 7.5, explicit write 3.125, explicit read 0.25.
729
787
  "qwen3.7-max" => {
@@ -908,6 +966,8 @@ module Clacky
908
966
  # Support both dot and dash separators (e.g., "4.5", "4-5", "4-6")
909
967
  # Also handles Bedrock cross-region prefixes (e.g. "jp.anthropic.claude-sonnet-4-6")
910
968
  case model
969
+ when /claude.*fable.*5[.-]1/i
970
+ "claude-fable-5-1"
911
971
  when /claude.*fable.*5/i
912
972
  "claude-fable-5"
913
973
  # Claude Sonnet 5 / Opus 5 (2026) — anchored on the literal "sonnet-5"
@@ -975,6 +1035,8 @@ module Clacky
975
1035
  # (mainland bigmodel.cn vs intl z.ai) the user configured.
976
1036
  # Strict anchored match so unrelated strings like "glm-5-x-foo"
977
1037
  # don't silently borrow a nearby model's rate.
1038
+ when /^glm-5\.3-flash$/i
1039
+ "glm-5.3-flash"
978
1040
  when /^glm-5\.3$/i
979
1041
  "glm-5.3"
980
1042
  when /^glm-5\.2$/i
@@ -998,10 +1060,12 @@ module Clacky
998
1060
  "minimax-m2.5"
999
1061
 
1000
1062
  # Qwen (Alibaba DashScope) — strict anchored match per registered
1001
- # model id in providers.rb. qwen3.7-* is the latest flagship line;
1002
- # qwen3.6-* are the previous generation; qwen-plus-latest is the
1003
- # rolling alias for the latest Qwen-Plus release; qwen3-vl-plus is
1004
- # the multimodal SKU (replaces the retired qwen-vl-plus/max).
1063
+ # model id in providers.rb. qwen3.8-max is the latest flagship;
1064
+ # qwen3.7-* / qwen3.6-* are previous generations; qwen-plus-latest
1065
+ # is the rolling alias for the latest Qwen-Plus release; qwen3-vl-plus
1066
+ # is the multimodal SKU (replaces the retired qwen-vl-plus/max).
1067
+ when /^qwen3\.8-max$/i
1068
+ "qwen3.8-max"
1005
1069
  when /^qwen3\.7-max$/i
1006
1070
  "qwen3.7-max"
1007
1071
  when /^qwen3\.7-plus$/i
@@ -1029,6 +1093,8 @@ module Clacky
1029
1093
  "gemini-3.6-flash"
1030
1094
  when /^or-gemini-3-7-flash$/i, /^gemini-3\.7-flash$/i
1031
1095
  "gemini-3.7-flash"
1096
+ when /^or-gemini-3-8-flash$/i, /^gemini-3\.8-flash$/i
1097
+ "gemini-3.8-flash"
1032
1098
 
1033
1099
  # OpenAI GPT-5.x models - match various dashed/dotted/compact forms
1034
1100
  # (e.g. "gpt-5.5", "gpt-5-5", "gpt5.5", "gpt55")
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Clacky
4
- VERSION = "1.5.12"
4
+ VERSION = "1.5.13"
5
5
  end