clay-server 2.27.1 → 2.28.0-beta.1

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.
@@ -1672,6 +1672,7 @@
1672
1672
  <div class="ralph-preview-tabs">
1673
1673
  <button class="ralph-tab active" data-tab="prompt">PROMPT.md</button>
1674
1674
  <button class="ralph-tab" data-tab="judge">JUDGE.md</button>
1675
+ <button class="ralph-tab" data-tab="model">Model</button>
1675
1676
  </div>
1676
1677
  <div id="ralph-preview-body" class="ralph-preview-body"></div>
1677
1678
  <div class="ralph-preview-footer" id="ralph-preview-footer">
@@ -1899,8 +1900,6 @@
1899
1900
  <div class="sched-create-date-chips">
1900
1901
  <input type="date" class="sched-create-date-input" id="sched-create-date-picker" value="">
1901
1902
  <input type="time" class="sched-create-time-input" id="sched-create-time" value="09:00">
1902
- <button class="sched-create-recurrence-btn" id="sched-create-recurrence-btn" title="Recurrence"><i data-lucide="repeat"></i></button>
1903
- <button class="sched-create-interval-btn" id="sched-create-interval-btn" title="Interval"><i data-lucide="timer"></i></button>
1904
1903
  </div>
1905
1904
  <button class="sched-create-close-btn" id="sched-create-cancel" title="Close"><i data-lucide="x"></i></button>
1906
1905
  </div>
@@ -1925,7 +1924,7 @@
1925
1924
  </div>
1926
1925
  <input type="text" class="sched-create-title-input" id="sched-create-title" placeholder="Schedule Title" maxlength="80" spellcheck="false" autocomplete="off">
1927
1926
  </div>
1928
- <!-- Task (JS dropdown) -->
1927
+ <!-- Task -->
1929
1928
  <div class="sched-create-row">
1930
1929
  <i data-lucide="list-todo" class="sched-create-row-icon"></i>
1931
1930
  <div class="sched-create-task-dropdown" id="sched-create-task-wrap">
@@ -1937,31 +1936,40 @@
1937
1936
  <div class="sched-create-task-list hidden" id="sched-create-task-list"></div>
1938
1937
  </div>
1939
1938
  </div>
1940
- <!-- Description -->
1939
+ <!-- Review toggle -->
1941
1940
  <div class="sched-create-row">
1941
+ <div class="sched-create-row-icon-spacer"></div>
1942
+ <label class="sched-review-toggle">
1943
+ <input type="checkbox" id="sched-review-check">
1944
+ <span class="sched-review-label">Review multiple times</span>
1945
+ <span class="sched-review-count hidden" id="sched-review-count">
1946
+ <input type="number" id="sched-create-iterations" min="2" max="100" value="3" class="sched-create-iter-input">
1947
+ <span class="sched-create-iter-hint">x</span>
1948
+ </span>
1949
+ </label>
1950
+ </div>
1951
+ <!-- Description (shown only when editing a record that has one) -->
1952
+ <div class="sched-create-row hidden" id="sched-create-desc-row">
1942
1953
  <i data-lucide="align-left" class="sched-create-row-icon"></i>
1943
- <textarea class="sched-create-row-textarea" id="sched-create-desc" rows="3" placeholder="Description"></textarea>
1954
+ <textarea class="sched-create-row-textarea" id="sched-create-desc" rows="2" placeholder="Description"></textarea>
1944
1955
  </div>
1945
- <!-- Bottom bar -->
1946
- <div class="sched-create-bottom">
1947
- <div class="sched-create-bottom-left">
1948
- <div class="sched-create-run-mode">
1949
- <button type="button" class="sched-run-mode-btn active" data-mode="single" title="Run once without iteration"><i data-lucide="play"></i> Single run</button>
1950
- <button type="button" class="sched-run-mode-btn" data-mode="multi" title="Run multiple iterations with a judge reviewing each round"><i data-lucide="repeat"></i> Multi-round</button>
1951
- <label class="sched-create-iter-label hidden" id="sched-create-iter-group">
1952
- <input type="number" id="sched-create-iterations" min="2" max="100" value="3" class="sched-create-iter-input">
1953
- <span class="sched-create-iter-hint">rounds</span>
1954
- </label>
1956
+ <!-- Repeat accordion -->
1957
+ <div class="sched-accordion" id="sched-accordion-repeat">
1958
+ <div class="sched-accordion-divider"></div>
1959
+ <button class="sched-accordion-header" id="sched-accordion-repeat-header" type="button">
1960
+ <div class="sched-accordion-header-left">
1961
+ <i data-lucide="repeat" class="sched-accordion-icon"></i>
1962
+ <div class="sched-accordion-text">
1963
+ <span class="sched-accordion-title">Repeat</span>
1964
+ <span class="sched-accordion-subtitle" id="sched-accordion-repeat-subtitle">Which days to run</span>
1965
+ </div>
1955
1966
  </div>
1956
- </div>
1957
- <div class="sched-create-bottom-right">
1958
- <button class="sched-create-delete-btn hidden" id="sched-create-delete" title="Delete"><i data-lucide="trash-2"></i></button>
1959
- <button class="sched-create-save-btn" id="sched-create-submit">Save</button>
1960
- </div>
1961
- </div>
1962
- <!-- Recurrence dropdown -->
1963
- <div class="sched-create-recurrence-dropdown hidden" id="sched-create-recurrence-dropdown">
1964
- <div class="sched-custom-repeat-panel" id="sched-custom-repeat-panel">
1967
+ <div class="sched-accordion-header-right">
1968
+ <span class="sched-accordion-clear hidden" id="sched-accordion-repeat-clear" title="Clear"><i data-lucide="x"></i></span>
1969
+ <i data-lucide="chevron-right" class="sched-accordion-chevron"></i>
1970
+ </div>
1971
+ </button>
1972
+ <div class="sched-accordion-body hidden" id="sched-accordion-repeat-body">
1965
1973
  <div class="sched-custom-row">
1966
1974
  <span class="sched-custom-label">Every</span>
1967
1975
  <input type="number" class="sched-custom-interval" id="sched-custom-interval" value="1" min="1" max="99">
@@ -2006,7 +2014,6 @@
2006
2014
  <span class="sched-custom-end-after-suffix">times</span>
2007
2015
  </div>
2008
2016
  </div>
2009
- <!-- Inline calendar for "Until" date picking -->
2010
2017
  <div class="sched-custom-end-calendar hidden" id="sched-custom-end-calendar">
2011
2018
  <div class="sched-cal-header">
2012
2019
  <span class="sched-cal-title" id="sched-cal-title">April 2026</span>
@@ -2020,48 +2027,65 @@
2020
2027
  </div>
2021
2028
  <div class="sched-cal-grid" id="sched-cal-grid"></div>
2022
2029
  </div>
2023
- <div class="sched-custom-actions">
2024
- <button class="sched-btn sched-btn-cancel" id="sched-custom-cancel">Cancel</button>
2025
- <button class="sched-btn sched-btn-save" id="sched-custom-ok">OK</button>
2026
- </div>
2027
2030
  </div>
2028
2031
  </div>
2029
- <!-- Interval dropdown -->
2030
- <div class="sched-create-interval-dropdown hidden" id="sched-create-interval-dropdown">
2031
- <div class="sched-interval-custom-row">
2032
- <span class="sched-custom-label">Every</span>
2033
- <input type="number" class="sched-custom-interval" id="sched-interval-custom-value" value="10" min="1" max="999">
2034
- <div class="sched-interval-unit-toggle" id="sched-interval-custom-unit">
2035
- <button type="button" class="sched-interval-seg active" data-unit="minute">min</button><button type="button" class="sched-interval-seg" data-unit="hour">hrs</button>
2032
+ <!-- Interval accordion -->
2033
+ <div class="sched-accordion" id="sched-accordion-interval">
2034
+ <div class="sched-accordion-divider"></div>
2035
+ <button class="sched-accordion-header" id="sched-accordion-interval-header" type="button">
2036
+ <div class="sched-accordion-header-left">
2037
+ <i data-lucide="timer" class="sched-accordion-icon"></i>
2038
+ <div class="sched-accordion-text">
2039
+ <span class="sched-accordion-title">Interval</span>
2040
+ <span class="sched-accordion-subtitle" id="sched-accordion-interval-subtitle">How often within each day</span>
2041
+ </div>
2036
2042
  </div>
2037
- </div>
2038
- <div class="sched-interval-end-section hidden" id="sched-interval-end-section">
2039
- <div class="sched-interval-end-divider"></div>
2040
- <div class="sched-interval-end-options">
2041
- <button class="sched-interval-end-opt active" data-iend="allday">All day</button>
2042
- <button class="sched-interval-end-opt" data-iend="after">Stop after</button>
2043
- <button class="sched-interval-end-opt" data-iend="until">Stop at</button>
2043
+ <div class="sched-accordion-header-right">
2044
+ <span class="sched-accordion-clear hidden" id="sched-accordion-interval-clear" title="Clear"><i data-lucide="x"></i></span>
2045
+ <i data-lucide="chevron-right" class="sched-accordion-chevron"></i>
2044
2046
  </div>
2045
- <div class="sched-interval-end-after hidden" id="sched-interval-end-after-row">
2046
- <input type="number" class="sched-interval-end-input" id="sched-interval-end-after" value="5" min="1" max="999">
2047
- <span class="sched-interval-end-label">runs</span>
2047
+ </button>
2048
+ <div class="sched-accordion-body hidden" id="sched-accordion-interval-body">
2049
+ <div class="sched-interval-custom-row">
2050
+ <span class="sched-custom-label">Every</span>
2051
+ <input type="number" class="sched-custom-interval" id="sched-interval-custom-value" value="10" min="1" max="999">
2052
+ <div class="sched-interval-unit-toggle" id="sched-interval-custom-unit">
2053
+ <button type="button" class="sched-interval-seg active" data-unit="minute">min</button><button type="button" class="sched-interval-seg" data-unit="hour">hrs</button>
2054
+ </div>
2055
+ </div>
2056
+ <div class="sched-interval-end-section hidden" id="sched-interval-end-section">
2057
+ <div class="sched-interval-end-divider"></div>
2058
+ <div class="sched-interval-end-options">
2059
+ <button class="sched-interval-end-opt active" data-iend="allday">All day</button>
2060
+ <button class="sched-interval-end-opt" data-iend="after">Stop after</button>
2061
+ <button class="sched-interval-end-opt" data-iend="until">Stop at</button>
2062
+ </div>
2063
+ <div class="sched-interval-end-after hidden" id="sched-interval-end-after-row">
2064
+ <input type="number" class="sched-interval-end-input" id="sched-interval-end-after" value="5" min="1" max="999">
2065
+ <span class="sched-interval-end-label">runs</span>
2066
+ </div>
2067
+ <div class="sched-interval-end-until hidden" id="sched-interval-end-until-row">
2068
+ <input type="time" class="sched-interval-end-time" id="sched-interval-end-time" value="18:00">
2069
+ </div>
2048
2070
  </div>
2049
- <div class="sched-interval-end-until hidden" id="sched-interval-end-until-row">
2050
- <input type="time" class="sched-interval-end-time" id="sched-interval-end-time" value="18:00">
2071
+ <div class="sched-skip-running-row" id="sched-skip-running-row">
2072
+ <label class="sched-switch-label" for="sched-skip-running">
2073
+ <div class="sched-switch">
2074
+ <input type="checkbox" id="sched-skip-running" checked>
2075
+ <span class="sched-switch-slider"></span>
2076
+ </div>
2077
+ <span class="sched-switch-text">Skip if previous run still active</span>
2078
+ </label>
2051
2079
  </div>
2052
2080
  </div>
2053
- <div class="sched-skip-running-row" id="sched-skip-running-row">
2054
- <label class="sched-switch-label" for="sched-skip-running">
2055
- <div class="sched-switch">
2056
- <input type="checkbox" id="sched-skip-running" checked>
2057
- <span class="sched-switch-slider"></span>
2058
- </div>
2059
- <span class="sched-switch-text">Skip if previous run still active</span>
2060
- </label>
2081
+ </div>
2082
+ <!-- Bottom bar -->
2083
+ <div class="sched-create-bottom">
2084
+ <div class="sched-create-bottom-left">
2085
+ <button class="sched-create-delete-btn hidden" id="sched-create-delete" title="Delete"><i data-lucide="trash-2"></i></button>
2061
2086
  </div>
2062
- <div class="sched-custom-actions">
2063
- <button class="sched-btn sched-btn-cancel" id="sched-interval-cancel">Cancel</button>
2064
- <button class="sched-btn sched-btn-save" id="sched-interval-ok">OK</button>
2087
+ <div class="sched-create-bottom-right">
2088
+ <button class="sched-create-save-btn" id="sched-create-submit">Save</button>
2065
2089
  </div>
2066
2090
  </div>
2067
2091
  </div>
@@ -8,6 +8,7 @@ import { getWs } from './ws-ref.js';
8
8
  import { showConfirm } from './app-misc.js';
9
9
  import { openRalphWizard } from './app-loop-wizard.js';
10
10
  import { openSchedulerToTab } from './scheduler.js';
11
+ import { renderModelList, renderModeList, renderEffortBar, renderThinkingBar } from './settings-defaults.js';
11
12
  import { showDebateSticky } from './app-debate-ui.js';
12
13
 
13
14
  // Execution modal: module-internal UI var (not in store)
@@ -128,7 +129,11 @@ function startLoopFromUi() {
128
129
  function sendLoopStart() {
129
130
  var ws = getWs();
130
131
  if (ws && ws.readyState === 1) {
131
- ws.send(JSON.stringify({ type: "loop_start", maxIterations: pendingIterations }));
132
+ var msg = { type: "loop_start", maxIterations: pendingIterations };
133
+ if (Object.keys(_previewLoopSettings).length > 0) {
134
+ msg.settings = _previewLoopSettings;
135
+ }
136
+ ws.send(JSON.stringify(msg));
132
137
  }
133
138
  }
134
139
 
@@ -526,10 +531,14 @@ export function updateExecModalStatus() {
526
531
  }
527
532
 
528
533
  export function openRalphPreviewModal() {
534
+ // Only show for loop (ralph) source, not scheduled tasks
535
+ var st = store.getState();
536
+ if (st.ralphCraftingSource !== "ralph") return;
537
+
529
538
  var modal = document.getElementById("ralph-preview-modal");
530
539
  if (!modal) return;
531
540
 
532
- var wizData = store.getState().wizardData || {};
541
+ var wizData = st.wizardData || {};
533
542
  var isSimple = wizData.loopMode === "simple";
534
543
 
535
544
  // Set defaults if not yet set
@@ -557,6 +566,7 @@ export function openRalphPreviewModal() {
557
566
  var runBtn = document.getElementById("ralph-preview-run");
558
567
  if (runBtn) runBtn.disabled = !store.getState().ralphFilesReady.bothReady;
559
568
 
569
+ _previewLoopSettings = {};
560
570
  showRalphPreviewTab("prompt");
561
571
  modal.classList.remove("hidden");
562
572
  refreshIcons();
@@ -568,6 +578,11 @@ function closeRalphPreviewModal() {
568
578
  if (modal) modal.classList.add("hidden");
569
579
  }
570
580
 
581
+ // Pending loop settings for the preview modal (saved to LOOP.json on launch)
582
+ var _previewLoopSettings = {};
583
+
584
+ function getPreviewLoopSettings() { return _previewLoopSettings; }
585
+
571
586
  function showRalphPreviewTab(tab) {
572
587
  var tabs = document.querySelectorAll("#ralph-preview-modal .ralph-tab");
573
588
  for (var i = 0; i < tabs.length; i++) {
@@ -579,6 +594,12 @@ function showRalphPreviewTab(tab) {
579
594
  }
580
595
  var body = document.getElementById("ralph-preview-body");
581
596
  if (!body) return;
597
+
598
+ if (tab === "model") {
599
+ renderPreviewModelTab(body);
600
+ return;
601
+ }
602
+
582
603
  var _rpc = store.getState().ralphPreviewContent;
583
604
  var content = tab === "prompt" ? _rpc.prompt : _rpc.judge;
584
605
  if (typeof marked !== "undefined" && marked.parse) {
@@ -587,3 +608,65 @@ function showRalphPreviewTab(tab) {
587
608
  body.textContent = content;
588
609
  }
589
610
  }
611
+
612
+ function renderPreviewModelTab(bodyEl) {
613
+ var s = store.getState();
614
+
615
+ bodyEl.innerHTML =
616
+ '<div class="scheduler-model-settings">' +
617
+ '<div class="settings-card"><div class="settings-field">' +
618
+ '<label class="settings-label">Model</label>' +
619
+ '<div class="settings-hint">Choose the Claude model for this loop.</div>' +
620
+ '<div id="rp-model-list" class="settings-model-list"></div>' +
621
+ '</div></div>' +
622
+ '<div class="settings-card"><div class="settings-field">' +
623
+ '<label class="settings-label">Mode</label>' +
624
+ '<div class="settings-hint">Controls how Claude handles tool use and file edits.</div>' +
625
+ '<div id="rp-mode-list" class="settings-model-list"></div>' +
626
+ '</div></div>' +
627
+ '<div class="settings-card"><div class="settings-field">' +
628
+ '<label class="settings-label">Effort</label>' +
629
+ '<div class="settings-hint">Controls how much thinking effort Claude puts into responses.</div>' +
630
+ '<div class="settings-btn-group" id="rp-effort-bar"></div>' +
631
+ '</div></div>' +
632
+ '<div class="settings-card"><div class="settings-field">' +
633
+ '<label class="settings-label">Thinking</label>' +
634
+ '<div class="settings-hint">Controls whether Claude shows its reasoning process.</div>' +
635
+ '<div class="settings-btn-group" id="rp-thinking-bar"></div>' +
636
+ '<div id="rp-thinking-budget-row" class="settings-budget-row" style="display:none">' +
637
+ '<label class="settings-budget-label">Budget tokens</label>' +
638
+ '<input id="rp-thinking-budget" type="number" class="settings-budget-input" min="1024" max="128000" step="1024" value="10000">' +
639
+ '</div>' +
640
+ '</div></div>' +
641
+ '</div>';
642
+
643
+ function savePreviewSetting(key, value) {
644
+ _previewLoopSettings[key] = value;
645
+ }
646
+
647
+ var opts = {
648
+ models: s.currentModels || [],
649
+ currentModel: _previewLoopSettings.model || "",
650
+ currentMode: _previewLoopSettings.permissionMode || "default",
651
+ currentEffort: _previewLoopSettings.effort || "medium",
652
+ currentThinking: _previewLoopSettings.thinking || "adaptive",
653
+ currentThinkingBudget: _previewLoopSettings.thinkingBudget || 10000,
654
+ sendMsg: function (msgType, data) {
655
+ if (msgType === "rp_set_model") savePreviewSetting("model", data.model);
656
+ else if (msgType === "rp_set_mode") savePreviewSetting("permissionMode", data.mode);
657
+ else if (msgType === "rp_set_effort") savePreviewSetting("effort", data.effort);
658
+ else if (msgType === "set_thinking") {
659
+ savePreviewSetting("thinking", data.thinking);
660
+ if (data.budgetTokens) savePreviewSetting("thinkingBudget", data.budgetTokens);
661
+ }
662
+ },
663
+ modelMsgType: "rp_set_model",
664
+ modeMsgType: "rp_set_mode",
665
+ effortMsgType: "rp_set_effort",
666
+ };
667
+
668
+ renderModelList("rp", opts);
669
+ renderModeList("rp", opts);
670
+ renderEffortBar("rp", opts);
671
+ renderThinkingBar("rp", opts);
672
+ }
@@ -1467,6 +1467,7 @@ export function processMessage(msg) {
1467
1467
  showLoopBanner(false);
1468
1468
  updateLoopButton();
1469
1469
  enableMainInput();
1470
+ updateLoopInputVisibility(null);
1470
1471
  var loopLabel = _lfbn || "Loop";
1471
1472
  var finishMsg = msg.reason === "pass"
1472
1473
  ? loopLabel + " completed successfully after " + msg.iterations + " iteration(s)."