diff --git a/calcit.cirru b/calcit.cirru index cac3bac..7ece150 100644 --- a/calcit.cirru +++ b/calcit.cirru @@ -514,6 +514,7 @@ let abort-controller $ unsafe-coerce abort 'Dynamic do (js/console.warn |Aborting-prev) (.!abort abort-controller) + , &unit <> t =< 8 nil <> "|✕" style-abort-close @@ -627,7 +628,7 @@ :preview $ decode-map-as @*viewing-archive-session 'app.schema/ChatSession div {} (:class-name style-archive-close) - :on-click $ fn (e d!) (reset! *viewing-archive-session false) + :on-click $ fn (e d!) (reset! *viewing-archive-session false) &unit <> "|✕" ; Messages list $ read only div @@ -670,7 +671,7 @@ :inner-text "|All Archived Sessions" div {} (:class-name style-archive-close) - :on-click $ fn (e d!) (reset! *archived-sessions false) (reset! *viewing-archive-session false) + :on-click $ fn (e d!) (reset! *archived-sessions false) (reset! *viewing-archive-session false) &unit <> "|✕" ; List div @@ -701,7 +702,7 @@ div {} (:role |button) :style $ {} (:flex |1) (:cursor :pointer) (:min-width 0) (:overflow :hidden) - :on-click $ fn (e d!) (reset! *viewing-archive-session session) + :on-click $ fn (e d!) (reset! *viewing-archive-session session) &unit div {} $ :style {} (:font-size |12px) @@ -728,6 +729,7 @@ archive-key $ :archive-key site js-await $ db-set archive-key (format-cirru-edn new-archives) d! $ :: :update-archived-count (count new-archives) + , &unit <> "|✕" ; Else render normal chat view div @@ -742,7 +744,7 @@ div {} (:class-name css/row-middle) (:title |History) (:role |button) (:aria-label |history-open) :style $ {} (:cursor :pointer) - :on-click $ fn (e d!) (.show sessions-plugin d!) + :on-click $ fn (e d!) (.show sessions-plugin d!) &unit div {} $ :class-name style-history-button comp-i |clock @@ -807,6 +809,7 @@ :on-click $ fn (e d!) .show reply-plugin d! $ fn (text) submit-message! cursor state text (:search? message-box-state) (:think? message-box-state) model d! + , &unit <> |Reply if (:focus-mode? message-box-state) nil $ a {} (:class-name style-focus-link) (:inner-text |Focus) (:role |button) (:aria-label |focus-composer) @@ -821,6 +824,7 @@ get (>> states :message-box) :cursor [] assoc message-box-state :focus-mode? true + , &unit , nil if (:loading? state) div ({}) (comp-abort |Loading...) @@ -847,6 +851,7 @@ :on-click $ fn (e d!) ; d! $ :: :change-model .show model-plugin d! + , &unit fn (text search? think? d!) do when @@ -887,6 +892,7 @@ :on-click $ fn (e d!) when chrome-extension? $ js/chrome.runtime.sendMessage js-object (:action |fill-text) (:text text) + , &unit comp-i :send 12 :currentColor :examples $ [] :schema $ :: 'Dynamic @@ -915,6 +921,7 @@ fn () $ .!focus unsafe-coerce (js/document.querySelector |#message) 'Dynamic , 0 + , &unit <> $ if blank? $ :content state , "|Click to expand and type..." (:content state) @@ -928,6 +935,7 @@ :on-input $ fn (e d!) d! cursor $ assoc state :content str $ option:unwrap-or (get e :value) | + , &unit :on-keydown $ fn (e d!) if and @@ -936,6 +944,7 @@ option:unwrap-or (get e :meta?) false option:unwrap-or (get e :ctrl?) false on-submit (:content state) (:search? state) (:think? state) d! + , &unit :on-focus $ fn (e d!) let target $ unsafe-coerce @@ -951,6 +960,7 @@ if not $ unsafe-coerce (.!contains box-class |focus-within) 'Bool .!add box-class |focus-within + , &unit :on-blur $ fn (e d!) let target $ unsafe-coerce @@ -966,6 +976,7 @@ if unsafe-coerce (.!contains box-class |focus-within) 'Bool .!remove box-class |focus-within + , &unit if not $ :focus-mode? state do (=< nil 4) @@ -980,6 +991,7 @@ :on-click $ fn (e d!) d! cursor $ assoc state :content | .!focus $ unsafe-coerce (js/document.querySelector |#message) 'Dynamic + , &unit span $ {} (:class-name style-clear) div {} $ :class-name (str-spaced css/row style-gap12) @@ -992,6 +1004,7 @@ :on-click $ fn (e d!) d! cursor $ assoc state :think? not $ :think? state + , &unit input $ {} :checked $ :think? state :type |checkbox @@ -1005,6 +1018,7 @@ :on-click $ fn (e d!) d! cursor $ assoc state :search? not $ :search? state + , &unit input $ {} :checked $ :search? state :type |checkbox @@ -1016,6 +1030,7 @@ :inner-text |Submit :on-click $ fn (e d!) on-submit (:content state) (:search? state) (:think? state) d! + , &unit , nil :examples $ [] :schema $ :: 'Fn @@ -1044,7 +1059,7 @@ button {} (:class-name css/button) :style $ {} (:cursor :pointer) - :on-click $ fn (e d!) (on-close d!) (on-view-archive d!) + :on-click $ fn (e d!) (on-close d!) (on-view-archive d!) &unit <> "|View Archive" if (empty? sessions) div @@ -1071,7 +1086,7 @@ {} (:role |button) :aria-label $ str |session-select: preview :style $ {} (:flex |1) (:cursor :pointer) (:min-width 0) (:overflow :hidden) - :on-click $ fn (e d!) (on-select session-id d!) (on-close d!) + :on-click $ fn (e d!) (on-select session-id d!) (on-close d!) &unit div {} $ :style {} (:font-size |12px) @@ -1091,6 +1106,7 @@ , 'Dynamic .!stopPropagation event d! $ :: :remove-session session-id + , &unit <> "|✕" if > (count sessions) 0 @@ -1103,9 +1119,9 @@ div {} $ :class-name (str-spaced css/row css/gap8) a $ {} (:class-name style-clear) (:inner-text |Data) (:role |button) (:aria-label |sessions-export-data) - :on-click $ fn (e d!) (tab-echo! sessions :edn) + :on-click $ fn (e d!) (tab-echo! sessions :edn) &unit a $ {} (:class-name style-clear) (:inner-text |Download) (:role |button) (:aria-label |sessions-download) - :on-click $ fn (e d!) (download-sessions! sessions) + :on-click $ fn (e d!) (download-sessions! sessions) &unit if > (count sessions) 0 a $ {} (:class-name style-clear) (:inner-text "|Archive all") (:role |button) (:aria-label |sessions-archive-all) @@ -1121,6 +1137,7 @@ new-archives $ concat old-archives sessions js-await $ db-set archive-key (format-cirru-edn new-archives) d! $ :: :archive-sessions (count new-archives) + , &unit span $ {} div $ {} :style $ {} (:height 200) @@ -1786,10 +1803,11 @@ :deepseek-v4-pro $ js-await (call-openrouter! cursor state1 prompt-text |deepseek-v4-pro true d! *text) :deepseek-v4-flash $ js-await (call-openrouter! cursor state1 prompt-text |deepseek-v4-flash true d! *text) fn (e) - let - err-text $ str "|Failed to load: " e - d! cursor $ -> state (assoc :answer err-text) (assoc :loading? false) (assoc :done? true) - assoc :messages $ upsert-assistant-message (:messages state) err-text nil + do (js/console.error :msg-buffer-request-failed e) + let + err-text $ str |Failed-to-load: e + d! cursor $ -> state (assoc :answer err-text) (assoc :loading? false) (assoc :done? true) + assoc :messages $ upsert-assistant-message (:messages state) err-text nil :examples $ [] :schema $ :: 'Fn {} (:return 'Dynamic) diff --git a/deps.cirru b/deps.cirru index fb0cb1d..f432d8c 100644 --- a/deps.cirru +++ b/deps.cirru @@ -1,9 +1,9 @@ -{} (:calcit-version |0.13.33) +{} (:calcit-version |0.13.42) :version |0.0.3 :dependencies $ {} (|Respo/alerts.calcit |0.10.19) |Respo/reel.calcit |0.6.7 |Respo/respo-feather.calcit |0.4.4 - |Respo/respo-markdown.calcit |0.4.24 + |Respo/respo-markdown.calcit |0.4.25 |Respo/respo-ui.calcit |0.7.10 - |Respo/respo.calcit |0.16.83 + |Respo/respo.calcit |0.16.85 diff --git a/history/20260824-upgrade-calcit-01340.md b/history/20260824-upgrade-calcit-01340.md new file mode 100644 index 0000000..d394442 --- /dev/null +++ b/history/20260824-upgrade-calcit-01340.md @@ -0,0 +1,6 @@ +# 2026-08-24 Calcit 0.13.40 upgrade + +- Updated the Calcit compiler and `@calcit/procs` runtime to 0.13.40. +- Updated Respo to 0.16.85 for the latest Calcit schema compatibility fixes. +- Made DOM event handlers return `Unit` explicitly, matching Respo's typed event contract. +- Revalidated type checks, quality checks, JavaScript generation, the production build, and Gemini streaming runtime calls. diff --git a/history/202608241230-use-explicit-unit-event-handlers.md b/history/202608241230-use-explicit-unit-event-handlers.md new file mode 100644 index 0000000..9204a00 --- /dev/null +++ b/history/202608241230-use-explicit-unit-event-handlers.md @@ -0,0 +1,8 @@ +# Use explicit Unit values for event handlers + +- Replaced the legacy `;nil` event-handler tails with Calcit's explicit + `&unit` literal after introducing the corresponding compiler support. +- This makes UI callback returns semantically distinct from application `nil`; + the JavaScript backend emits `void 0` for the handlers. +- Verified static checking, the project quality baseline, JS generation, Vite + production build, browser event interaction, and Gemini streaming requests. diff --git a/history/202608241245-upgrade-calcit-01341.md b/history/202608241245-upgrade-calcit-01341.md new file mode 100644 index 0000000..9c66818 --- /dev/null +++ b/history/202608241245-upgrade-calcit-01341.md @@ -0,0 +1,5 @@ +# Upgrade to Calcit 0.13.41 + +- Upgraded the compiler and `@calcit/procs` runtime to the released 0.13.41. +- This release provides the explicit `&unit` value used by the UI event + handlers, avoiding the legacy `;nil` compatibility form. diff --git a/history/202608241320-upgrade-genai-error-logging.md b/history/202608241320-upgrade-genai-error-logging.md new file mode 100644 index 0000000..77dad55 --- /dev/null +++ b/history/202608241320-upgrade-genai-error-logging.md @@ -0,0 +1,9 @@ +# Upgrade Gemini SDK and log request failures + +- Upgraded `@google/genai` to 2.18.0 and retained the streaming request shape + supported by the current SDK. +- The top-level submit handler now writes the original caught error to + `console.error` before rendering the user-facing failure message, preserving + a useful browser debugging trail without exposing configured credentials. +- The Markdown table renderer fix is released separately from respo-markdown; + msg-buffer will consume it after that package release. diff --git a/package.json b/package.json index bfbc31e..1682866 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "dependencies": { - "@calcit/procs": "^0.13.33", - "@google/genai": "^2.13.0", + "@calcit/procs": "^0.13.42", + "@google/genai": "^2.18.0", "@tiye/main-fonts": "0.0.1", "axios": "^1.15.0", "cirru-color": "^0.2.4", diff --git a/yarn.lock b/yarn.lock index 3235152..060cec2 100644 --- a/yarn.lock +++ b/yarn.lock @@ -5,14 +5,14 @@ __metadata: version: 8 cacheKey: 10c0 -"@calcit/procs@npm:^0.13.33": - version: 0.13.33 - resolution: "@calcit/procs@npm:0.13.33" +"@calcit/procs@npm:^0.13.42": + version: 0.13.42 + resolution: "@calcit/procs@npm:0.13.42" dependencies: "@calcit/ternary-tree": "npm:0.0.26" "@cirru/parser.ts": "npm:^0.0.9" "@cirru/writer.ts": "npm:^0.1.9" - checksum: 10c0/132fa43ee4b5edb12bbdb04b11f528e73842752d2b7ec8dd716357129aa6e35f80fac35da87b8d09a17f0ad5f78572d8359bf7a9b7aa0c2cbc4e313569cdab6e + checksum: 10c0/14559120b68263b0c38a16fcb71f5898af837f1a32ab51abb30585f978e32eae150b6ad84491632a0dcb9ae7b800a48ab41370fba7e6efb3f92d8d88ad1069b1 languageName: node linkType: hard @@ -65,9 +65,9 @@ __metadata: languageName: node linkType: hard -"@google/genai@npm:^2.13.0": - version: 2.17.1 - resolution: "@google/genai@npm:2.17.1" +"@google/genai@npm:^2.18.0": + version: 2.18.0 + resolution: "@google/genai@npm:2.18.0" dependencies: google-auth-library: "npm:^10.3.0" p-retry: "npm:^4.6.2" @@ -78,7 +78,7 @@ __metadata: peerDependenciesMeta: "@modelcontextprotocol/sdk": optional: true - checksum: 10c0/f94efe55f23a10a1b54d0297a607747acc98d5ad1e26a4dabbc7a81869ef68bc15b2c056517b7870fa866fdb6aa77c7c39e8ce407e89dcac26ec363fb6a96aa2 + checksum: 10c0/c3d1dafac8d467748504317bb3a11dbb219cffba3cfef7e371291d947c64f592a7367332b66278ff6c4ada8b7cfd7dbabf6622e8c49c6723dbd0317cbc317d37 languageName: node linkType: hard @@ -1573,8 +1573,8 @@ __metadata: version: 0.0.0-use.local resolution: "root-workspace-0b6124@workspace:." dependencies: - "@calcit/procs": "npm:^0.13.33" - "@google/genai": "npm:^2.13.0" + "@calcit/procs": "npm:^0.13.42" + "@google/genai": "npm:^2.18.0" "@tiye/main-fonts": "npm:0.0.1" axios: "npm:^1.15.0" bottom-tip: "npm:^0.1.5"