clay-server 4.0.1-beta.1 → 4.1.0-beta.10

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 (206) hide show
  1. package/LICENSE +661 -21
  2. package/LICENSES/MIT-legacy.txt +21 -0
  3. package/LICENSES/README.md +7 -0
  4. package/README.md +2 -2
  5. package/bin/cli.js +1 -3
  6. package/lib/ask-user-request-identity.js +23 -0
  7. package/lib/autonomous-run-record.js +32 -0
  8. package/lib/autonomous-run-scheduler.js +92 -0
  9. package/lib/context-usage.js +47 -0
  10. package/lib/daemon-project-access.js +118 -0
  11. package/lib/daemon-projects.js +19 -5
  12. package/lib/daemon.js +19 -20
  13. package/lib/default-ai-runtime.js +117 -0
  14. package/lib/durable-scheduler-record.js +61 -0
  15. package/lib/durable-scheduler-store.js +185 -0
  16. package/lib/durable-scheduler.js +495 -0
  17. package/lib/git-cli.js +1 -0
  18. package/lib/issue-work-session.js +10 -0
  19. package/lib/issues-comments.js +40 -0
  20. package/lib/issues-commit-verification.js +30 -0
  21. package/lib/issues-mcp-server.js +27 -0
  22. package/lib/issues-schema.js +119 -0
  23. package/lib/issues-service.js +339 -0
  24. package/lib/issues-store.js +210 -0
  25. package/lib/loop-cron.js +47 -0
  26. package/lib/loop-durable-schedule.js +159 -0
  27. package/lib/loop-guidance.js +35 -0
  28. package/lib/loop-registry-occurrence.js +76 -0
  29. package/lib/model-entry.js +15 -0
  30. package/lib/project-ask-user.js +4 -1
  31. package/lib/project-autonomous-run.js +498 -0
  32. package/lib/project-capsule-turn.js +1 -0
  33. package/lib/project-connection.js +8 -1
  34. package/lib/project-delegated-session.js +1 -0
  35. package/lib/project-filesystem.js +10 -10
  36. package/lib/project-full-access.js +86 -0
  37. package/lib/project-http.js +3 -1
  38. package/lib/project-issue-launch.js +154 -0
  39. package/lib/project-issues.js +58 -0
  40. package/lib/project-logs-access-scope.js +94 -0
  41. package/lib/project-logs-mcp-server.js +8 -12
  42. package/lib/project-logs-query.js +3 -0
  43. package/lib/project-logs-service.js +86 -84
  44. package/lib/project-logs-store.js +5 -3
  45. package/lib/project-loop-interview.js +163 -0
  46. package/lib/project-loop.js +150 -64
  47. package/lib/project-message-delivery.js +4 -2
  48. package/lib/project-models.js +71 -3
  49. package/lib/project-notifications.js +1 -1
  50. package/lib/project-pair-autonomous-stop.js +16 -0
  51. package/lib/project-pair-lifecycle.js +140 -102
  52. package/lib/project-pair-message.js +50 -0
  53. package/lib/project-pair-owned-stop.js +18 -0
  54. package/lib/project-pair-replacement-state.js +72 -0
  55. package/lib/project-pair-task-control.js +277 -0
  56. package/lib/project-pair-usage.js +76 -0
  57. package/lib/project-pending-message-queue.js +328 -0
  58. package/lib/project-scheduled-messages.js +499 -0
  59. package/lib/project-scheduled-task-execution.js +236 -0
  60. package/lib/project-scheduled-tasks.js +481 -0
  61. package/lib/project-session-notes.js +11 -4
  62. package/lib/project-session-pair.js +123 -127
  63. package/lib/project-sessions.js +143 -32
  64. package/lib/project-tool-llm-runtime.js +48 -0
  65. package/lib/project-user-message.js +224 -62
  66. package/lib/project-worker-proposal.js +69 -58
  67. package/lib/project-workspace-query.js +25 -0
  68. package/lib/project.js +396 -73
  69. package/lib/public/app.js +96 -26
  70. package/lib/public/css/default-ai.css +33 -0
  71. package/lib/public/css/home-hub.css +15 -2
  72. package/lib/public/css/home-sidebar.css +50 -2
  73. package/lib/public/css/icon-strip.css +40 -0
  74. package/lib/public/css/input.css +160 -114
  75. package/lib/public/css/issues.css +101 -0
  76. package/lib/public/css/mates.css +0 -1
  77. package/lib/public/css/messages.css +19 -0
  78. package/lib/public/css/pane.css +98 -2
  79. package/lib/public/css/pending-message-queue.css +190 -0
  80. package/lib/public/css/rewind.css +11 -2
  81. package/lib/public/css/scheduled-tasks.css +122 -0
  82. package/lib/public/css/sticky-notes.css +24 -4
  83. package/lib/public/index.html +43 -150
  84. package/lib/public/modules/app-connection.js +3 -0
  85. package/lib/public/modules/app-cursors.js +29 -12
  86. package/lib/public/modules/app-loop-ui.js +4 -8
  87. package/lib/public/modules/app-message-router.js +8 -0
  88. package/lib/public/modules/app-messages.js +38 -22
  89. package/lib/public/modules/app-notifications.js +2 -0
  90. package/lib/public/modules/app-panels.js +9 -1
  91. package/lib/public/modules/app-projects.js +3 -0
  92. package/lib/public/modules/app-rate-limit.js +0 -179
  93. package/lib/public/modules/ask-user-state.js +66 -0
  94. package/lib/public/modules/autonomous-run.js +285 -0
  95. package/lib/public/modules/chat-render-runtime.js +0 -2
  96. package/lib/public/modules/clay-file-links.js +111 -0
  97. package/lib/public/modules/clay-issue-links.js +131 -0
  98. package/lib/public/modules/clay-log-links.js +2 -0
  99. package/lib/public/modules/cursor-sharing-preference.js +38 -0
  100. package/lib/public/modules/default-ai.js +377 -0
  101. package/lib/public/modules/filebrowser.js +43 -2
  102. package/lib/public/modules/home-sidebar.js +16 -8
  103. package/lib/public/modules/home-surface.js +5 -0
  104. package/lib/public/modules/input.js +92 -40
  105. package/lib/public/modules/issues-context.js +117 -0
  106. package/lib/public/modules/issues-render.js +29 -0
  107. package/lib/public/modules/issues.js +270 -0
  108. package/lib/public/modules/loop-interview.js +151 -0
  109. package/lib/public/modules/markdown.js +4 -0
  110. package/lib/public/modules/message-delivery.js +5 -3
  111. package/lib/public/modules/pending-message-image-editor.js +143 -0
  112. package/lib/public/modules/pending-message-queue-model.js +22 -0
  113. package/lib/public/modules/pending-message-queue.js +491 -0
  114. package/lib/public/modules/permission-hints.js +13 -0
  115. package/lib/public/modules/project-access.js +141 -0
  116. package/lib/public/modules/project-grouping.js +22 -0
  117. package/lib/public/modules/project-logs.js +2 -2
  118. package/lib/public/modules/scheduled-message-state.js +22 -0
  119. package/lib/public/modules/scheduled-task-edit-state.js +7 -0
  120. package/lib/public/modules/scheduled-task-engine.js +48 -0
  121. package/lib/public/modules/scheduled-task-form.js +122 -0
  122. package/lib/public/modules/scheduled-task-recurrence.js +46 -0
  123. package/lib/public/modules/scheduled-task-schedule-rule.js +115 -0
  124. package/lib/public/modules/scheduled-tasks.js +459 -0
  125. package/lib/public/modules/scheduler-config.js +6 -52
  126. package/lib/public/modules/scheduler.js +9 -21
  127. package/lib/public/modules/sidebar-mobile.js +3 -0
  128. package/lib/public/modules/sidebar-projects.js +14 -171
  129. package/lib/public/modules/sidebar.js +0 -11
  130. package/lib/public/modules/split-pair-ui.js +5 -0
  131. package/lib/public/modules/split-view.js +3 -0
  132. package/lib/public/modules/sticky-note-markdown.js +1 -0
  133. package/lib/public/modules/sticky-notes-browser.js +1 -1
  134. package/lib/public/modules/sticky-notes.js +117 -4
  135. package/lib/public/modules/terminal.js +2 -0
  136. package/lib/public/modules/tool-palette-order.js +3 -3
  137. package/lib/public/modules/tools.js +26 -5
  138. package/lib/public/modules/worker-proposal.js +4 -0
  139. package/lib/public/style.css +3 -0
  140. package/lib/record-revision.js +11 -0
  141. package/lib/schedule-rule.js +151 -0
  142. package/lib/schedule-validation.js +124 -0
  143. package/lib/scheduled-run-state.js +87 -0
  144. package/lib/scheduled-task-records.js +127 -0
  145. package/lib/scheduler.js +179 -196
  146. package/lib/sdk-bridge.js +191 -22
  147. package/lib/sdk-message-processor.js +32 -2
  148. package/lib/sdk-turn-queue.js +14 -0
  149. package/lib/server-admin.js +3 -3
  150. package/lib/server-cursor-sharing.js +65 -0
  151. package/lib/server-default-ai.js +265 -0
  152. package/lib/server-durable-scheduler.js +26 -0
  153. package/lib/server-global-ws.js +10 -0
  154. package/lib/server-home-chat.js +29 -9
  155. package/lib/server-home-clay-entry.js +4 -1
  156. package/lib/server-home-debate-planning.js +32 -14
  157. package/lib/server-home-mate-creation.js +30 -11
  158. package/lib/server-home-models.js +14 -6
  159. package/lib/server-issue-links.js +18 -0
  160. package/lib/server-mates.js +4 -3
  161. package/lib/server-palette.js +17 -14
  162. package/lib/server.js +247 -102
  163. package/lib/session-notes-mcp-server.js +2 -2
  164. package/lib/session-pair-factory.js +45 -4
  165. package/lib/session-pair-history.js +40 -0
  166. package/lib/session-pair-mcp-server.js +22 -4
  167. package/lib/session-pair-operation.js +11 -0
  168. package/lib/session-pair-prompts.js +31 -2
  169. package/lib/session-pair-query-start.js +22 -0
  170. package/lib/session-pair-turn-control.js +8 -3
  171. package/lib/session-provenance.js +1 -0
  172. package/lib/session-query-tool-bridge.js +52 -0
  173. package/lib/session-search.js +4 -1
  174. package/lib/session-spawn-mcp-server.js +2 -1
  175. package/lib/session-split-groups.js +35 -1
  176. package/lib/sessions.js +53 -3
  177. package/lib/tool-llm.js +1 -0
  178. package/lib/users-default-ai-preferences.js +80 -0
  179. package/lib/users-home-surface-preferences.js +2 -1
  180. package/lib/users-preferences.js +35 -0
  181. package/lib/users-scheduled-task-preferences.js +44 -0
  182. package/lib/users.js +16 -0
  183. package/lib/worker-proposal-control.js +69 -0
  184. package/lib/worker-proposal-decision.js +7 -0
  185. package/lib/worker-runtime-catalog.js +52 -0
  186. package/lib/workspace-query-access.js +3 -2
  187. package/lib/workspace-query-projection.js +29 -0
  188. package/lib/workspace-query-service.js +20 -30
  189. package/lib/worktree.js +8 -4
  190. package/lib/ws-schema.js +62 -1
  191. package/lib/yoke/adapters/antigravity.js +1 -0
  192. package/lib/yoke/adapters/claude-worker.js +22 -18
  193. package/lib/yoke/adapters/claude.js +85 -16
  194. package/lib/yoke/adapters/codex.js +28 -7
  195. package/lib/yoke/claude-context-usage.js +57 -0
  196. package/lib/yoke/claude-message-correlation.js +31 -0
  197. package/lib/yoke/claude-model-switch.js +15 -0
  198. package/lib/yoke/claude-user-input.js +2 -0
  199. package/lib/yoke/index.js +2 -0
  200. package/lib/yoke/mcp-bridge-server.js +7 -1
  201. package/lib/yoke/package.json +1 -1
  202. package/lib/yoke/session-tool-transport.js +53 -0
  203. package/lib/yoke/user-input.js +21 -7
  204. package/package.json +9 -10
  205. package/bin/claude-relay.js +0 -6
  206. package/lib/public/modules/app-loop-wizard.js +0 -439
package/lib/public/app.js CHANGED
@@ -1,3 +1,6 @@
1
+ import { initIssueLinks } from './modules/clay-issue-links.js';
2
+ import { initIssues, closeIssues } from './modules/issues.js';
3
+ import { initIssuesContext } from './modules/issues-context.js';
1
4
  import { avatarUrl, userAvatarUrl, mateAvatarUrl } from './modules/avatar.js';
2
5
  import { showToast, escapeHtml } from './modules/utils.js';
3
6
  import { refreshIcons, iconHtml } from './modules/icons.js';
@@ -28,9 +31,11 @@ import { initQrCode, triggerShare } from './modules/qrcode.js';
28
31
  import { initFileBrowser, loadRootDirectory, refreshTree, handleFsList, handleFsRead, handleDirChanged, refreshIfOpen, handleFileChanged, handleFileHistory, handleGitDiff, handleFileAt, getPendingNavigate, closeFileViewer, resetFileBrowser } from './modules/filebrowser.js';
29
32
  import { initGitPanel } from './modules/git-panel.js';
30
33
  import { initWorkerPaneLock } from './modules/worker-pane-lock.js';
34
+ import { initAutonomousRun } from './modules/autonomous-run.js';
35
+ import { initLoopInterview } from './modules/loop-interview.js';
31
36
  import { initTerminal, openTerminal, closeTerminal, resetTerminals, handleTermList, handleTermCreated, handleTermOutput, handleTermResized, handleTermExited, handleTermClosed, sendTerminalCommand } from './modules/terminal.js';
32
37
  import { initContextSources, updateTerminalList, updateBrowserTabList, handleContextSourcesState, getActiveSources, hasActiveSources } from './modules/context-sources.js';
33
- import { initStickyNotes, handleNotesList, handleNoteCreated, handleNoteUpdated, handleNoteDeleted, hideNotes, showNotes, isNotesVisible, createNote, setBrowserRefresh } from './modules/sticky-notes.js';
38
+ import { initStickyNotes, handleNotesList, handleNoteCreated, handleNoteUpdated, handleNoteDeleted, hideNotes, showNotes, isNotesVisible, createNote, setBrowserRefresh, toggleNotesTemporaryVisibility } from './modules/sticky-notes.js';
34
39
  import { initNotesBrowser, openNotesBrowser, closeNotesBrowser, isNotesBrowserOpen, renderNotesBrowser, registerExclusiveClosers } from './modules/sticky-notes-browser.js';
35
40
  import { initTheme, getThemeColor, getComputedVar, onThemeChange, getCurrentTheme, getChatLayout } from './modules/theme.js';
36
41
  import { initTools, resetToolState, saveToolState, restoreToolState, renderAskUserQuestion, markAskUserAnswered, renderPermissionRequest, markPermissionResolved, markPermissionCancelled, renderElicitationRequest, markElicitationResolved, renderPlanBanner, renderPlanCard, handleTodoWrite, handleTaskCreate, handleTaskUpdate, startThinking, appendThinking, stopThinking, resetThinkingGroup, createToolItem, updateToolExecuting, updateToolResult, markAllToolsDone, addTurnMeta, resetTurnMetaCost, enableMainInput, getTools, getPlanContent, setPlanContent, isPlanFilePath, getTodoTools, updateSubagentActivity, addSubagentToolEntry, markSubagentDone, updateSubagentProgress, initSubagentStop, closeToolGroup, removeToolFromGroup } from './modules/tools.js';
@@ -39,6 +44,7 @@ import { initProjectSettings, handleInstructionsRead, handleInstructionsWrite, h
39
44
  import { initSkills, handleSkillInstalled, handleSkillUninstalled } from './modules/skills.js';
40
45
  import { initMcp } from './modules/mcp-ui.js';
41
46
  import { initScheduler, resetScheduler, handleLoopRegistryUpdated, handleScheduleRunStarted, handleScheduleRunFinished, handleLoopScheduled, openSchedulerToTab, isSchedulerOpen, closeScheduler, enterCraftingMode, exitCraftingMode, handleLoopRegistryFiles, getUpcomingSchedules } from './modules/scheduler.js';
47
+ import { initScheduledTasks, closeScheduledTasks } from './modules/scheduled-tasks.js';
42
48
  import { initPlaybook, openPlaybook, getPlaybooks, getPlaybookForTip, isCompleted as isPlaybookCompleted } from './modules/playbook.js';
43
49
  import { initSTT } from './modules/stt.js';
44
50
  import { initProfile, getProfileLang } from './modules/profile.js';
@@ -62,8 +68,9 @@ import { initHomeSidebar } from './modules/home-sidebar.js';
62
68
  import { openHomeMateAction } from './modules/home-mate-chat.js';
63
69
  import { initHomeSurfaceBoot } from './modules/home-surface-boot.js';
64
70
  import { rememberHomePrimarySurface } from './modules/home-surface.js';
65
- import { initRateLimit, handleRateLimitEvent as _rlHandleRateLimitEvent, updateRateLimitUsage as _rlUpdateRateLimitUsage, addScheduledMessageBubble as _rlAddScheduledMessageBubble, removeScheduledMessageBubble as _rlRemoveScheduledMessageBubble, handleFastModeState as _rlHandleFastModeState, getScheduledMsgEl, resetRateLimitState } from './modules/app-rate-limit.js';
71
+ import { initRateLimit, handleRateLimitEvent as _rlHandleRateLimitEvent, updateRateLimitUsage as _rlUpdateRateLimitUsage, handleFastModeState as _rlHandleFastModeState, resetRateLimitState } from './modules/app-rate-limit.js';
66
72
  import { initCursors, handleRemoteCursorMove as _curHandleRemoteCursorMove, handleRemoteCursorLeave as _curHandleRemoteCursorLeave, handleRemoteSelection as _curHandleRemoteSelection, clearRemoteCursors as _curClearRemoteCursors, initCursorToggle } from './modules/app-cursors.js';
73
+ import { initDefaultAi } from './modules/default-ai.js';
67
74
  import { initFavicon, updateFavicon as _favUpdateFavicon, setSendBtnMode as _favSetSendBtnMode, blinkIO as _favBlinkIO, blinkSessionDot as _favBlinkSessionDot, updateCrossProjectBlink as _favUpdateCrossProjectBlink, startUrgentBlink as _favStartUrgentBlink, stopUrgentBlink as _favStopUrgentBlink, setActivity as _favSetActivity } from './modules/app-favicon.js';
68
75
  import { initHeader, closeSessionInfoPopover as _hdrCloseSessionInfoPopover, updateHistorySentinel as _hdrUpdateHistorySentinel, requestMoreHistory as _hdrRequestMoreHistory, prependOlderHistory as _hdrPrependOlderHistory } from './modules/app-header.js';
69
76
  import { initSessionActions } from './modules/session-actions.js';
@@ -73,7 +80,7 @@ import { initSkillInstall, requireSkills as _siRequireSkills, handleSkillInstall
73
80
  import { initDebateUi, showDebateConcludeConfirm as _debShowDebateConcludeConfirm, exitDebateConcludeMode as _debExitDebateConcludeMode, handleDebateConcludeSend as _debHandleDebateConcludeSend, showDebateEndedMode as _debShowDebateEndedMode, exitDebateEndedMode as _debExitDebateEndedMode, showDebateUserFloor as _debShowDebateUserFloor, exitDebateFloorMode as _debExitDebateFloorMode, handleDebateFloorSend as _debHandleDebateFloorSend, renderDebateUserFloorDone as _debRenderDebateUserFloorDone, showDebateSticky as _debShowDebateSticky, showDebateBottomBar as _debShowDebateBottomBar, removeDebateBottomBar as _debRemoveDebateBottomBar, sendDebateStickyComment as _debSendDebateStickyComment, updateDebateRound as _debUpdateDebateRound } from './modules/app-debate-ui.js';
74
81
  import { initLoopUi, updateLoopInputVisibility as _loopUpdateLoopInputVisibility, updateLoopButton as _loopUpdateLoopButton, showLoopBanner as _loopShowLoopBanner, updateLoopBanner as _loopUpdateLoopBanner, updateRalphBars as _loopUpdateRalphBars, showRalphCraftingBar as _loopShowRalphCraftingBar, showRalphApprovalBar as _loopShowRalphApprovalBar, updateRalphApprovalStatus as _loopUpdateRalphApprovalStatus, openRalphPreviewModal as _loopOpenRalphPreviewModal, showExecModal as _loopShowExecModal, closeExecModal as _loopCloseExecModal, updateExecModalStatus as _loopUpdateExecModalStatus } from './modules/app-loop-ui.js';
75
82
  import { initBackgroundTasksUi } from './modules/background-tasks-ui.js';
76
- import { initLoopWizard, openRalphWizard as _loopOpenRalphWizard, closeRalphWizard as _loopCloseRalphWizard, getWizardSource as _loopGetWizardSource } from './modules/app-loop-wizard.js';
83
+ import { initPendingMessageQueue } from './modules/pending-message-queue.js';
77
84
  import { initAppNotifications, handleNotificationsState as _notifHandleState, handleNotificationCreated as _notifHandleCreated, handleNotificationDismissed as _notifHandleDismissed, handleNotificationDismissedAll as _notifHandleDismissedAll } from './modules/app-notifications.js';
78
85
  import { initWhatsNew, handleWhatsNewState as _wnHandleState, handleWhatsNewSeenResult as _wnHandleSeenResult } from './modules/whats-new.js';
79
86
  import { initWhatsNewArticle, openArticle as openWhatsNewArticle } from './modules/whats-new-article.js';
@@ -220,7 +227,6 @@ import { initDebate, handleDebatePreparing, handleDebateStarted, handleDebateRes
220
227
  // connected, processing, activeSessionId, sessionDrafts -> store
221
228
  // loopActive, loopAvailable, loopIteration, loopMaxIterations, loopBannerName,
222
229
  // ralphPhase, ralphCraftingSessionId, ralphCraftingSource, ralphFilesReady, ralphPreviewContent -> modules/app-loop-ui.js
223
- // wizardStep, wizardSource, wizardData, loopModeChoice, promptAuthor, judgeAuthor -> modules/app-loop-wizard.js
224
230
  // slashCommands, cliSessionId -> store
225
231
  var projectName = ""; // kept for pre-store localStorage init
226
232
  // turnCounter -> modules/app-rendering.js
@@ -269,6 +275,7 @@ import { initDebate, handleDebatePreparing, handleDebateStarted, handleDebateRes
269
275
  splitPanes: null,
270
276
  splitGroups: [],
271
277
  splitDelegations: {},
278
+ notesTemporarilyHidden: false,
272
279
  dmMode: false,
273
280
  historyFrom: 0,
274
281
  loadingMore: false,
@@ -284,16 +291,46 @@ import { initDebate, handleDebatePreparing, handleDebateStarted, handleDebateRes
284
291
  currentProjectOwnerId: null,
285
292
  isOsUsers: false,
286
293
  skipPermsEnabled: false,
294
+ autonomousSelectedMode: "normal",
295
+ autonomousArming: false,
296
+ autonomousArmToken: null,
297
+ autonomousArmRequestId: null,
298
+ autonomousArmSessionId: null,
299
+ autonomousActionRequestId: null,
300
+ autonomousActionSessionId: null,
301
+ autonomousCriteria: "",
302
+ autonomousMaxContinuations: 10,
303
+ autonomousMaxMinutes: 60,
304
+ autonomousRun: null,
305
+ autonomousExpanded: false,
306
+ loopInterviewBrief: null,
307
+ loopInterviewEditing: false,
308
+ loopInterviewRunRequestId: null,
309
+ loopInterviewRunSessionId: null,
310
+ loopInterviewStarting: false,
311
+ loopInterviewRequestId: null,
312
+ loopInterviewSessionId: null,
287
313
  slashCommands: [],
288
314
  processing: false,
315
+ scheduledMessageCorrelation: null,
289
316
  activeSessionId: null,
317
+ askUserRequests: {},
290
318
  activeBackgroundTasks: [],
291
319
  sessionVendorBound: false,
292
320
  cliSessionId: null,
293
321
  isHeadlessMode: false,
294
322
  savedMainSlug: null,
295
323
  connected: false,
324
+ fileReadRequest: null,
325
+ pendingFileNavigation: null,
326
+ cursorSharingEnabled: false,
327
+ cursorSharingHydrated: false,
296
328
  pendingOutboundMessages: [],
329
+ pendingMessageQueue: { projectSlug: null, sessionId: null, revision: 0, paused: false, items: [], loading: false, error: "" },
330
+ pendingMessageQueueRequests: {},
331
+ pendingMessageQueueEdit: null,
332
+ pendingMessageQueueDrag: null,
333
+ pendingMessageQueueFocusReturn: null,
297
334
  searchClayChatState: null,
298
335
  homeChatMateId: null,
299
336
  homeChatSessionId: null,
@@ -304,6 +341,7 @@ import { initDebate, handleDebatePreparing, handleDebateStarted, handleDebateRes
304
341
  homeActiveSessionByMate: {},
305
342
  homePreferredMateId: null,
306
343
  homeSidebarCollapsed: false,
344
+ homeMatesCollapsed: false,
307
345
  homeChatScope: "all",
308
346
  homeSubSurface: "chat",
309
347
  homeDebatesStatus: "idle",
@@ -343,11 +381,43 @@ import { initDebate, handleDebatePreparing, handleDebateStarted, handleDebateRes
343
381
  projectLogsCanDelete: false,
344
382
  projectLogsUnread: 0,
345
383
  projectLogsSeenRevisions: {},
384
+ issuesOpen: false,
385
+ issuesView: "list",
386
+ issuesSelected: null,
387
+ issuesRows: [],
388
+ issuesRequests: {},
389
+ issuesViewRequest: null,
390
+ issuesViewGeneration: 0,
391
+ issuesCache: {},
392
+ issuesEpoch: 0,
393
+ issuesSearchTimer: null,
394
+ issueLinkRequests: {},
395
+ issueLinkOpenRef: null,
396
+ scheduledTasksOpen: false,
397
+ scheduledTasksWide: false,
398
+ scheduledTasksFullscreen: false,
399
+ scheduledTaskRecords: [],
400
+ scheduledTaskDraft: null,
401
+ scheduledTaskEditingId: null,
402
+ scheduledTaskNewSessionPending: false,
403
+ scheduledTaskInterviewRequestId: null,
404
+ scheduledTaskActionRequestId: null,
405
+ scheduledTaskListRequest: null,
406
+ scheduledTaskInterviewId: null,
407
+ scheduledTaskExpandedId: null,
408
+ scheduledTaskDeleteId: null,
409
+ scheduledTaskDraftForm: null,
410
+ scheduledTaskEditForm: null,
411
+ scheduledTaskCreateMenuOpen: false,
412
+ scheduledTaskManualRequest: null,
346
413
  installedTools: [],
347
414
  capsulesEnabled: false,
348
415
  capsulesPreferenceLoaded: false,
349
416
  homeToolRegistryLoaded: false,
350
417
  toolScanErrors: [],
418
+ defaultAiState: { loading: false, saving: false, refreshRequestId: null, saveRequestId: null, catalogRequestIds: {}, catalogs: {}, preference: null, selection: null, installedVendors: [], accountAvailable: true, accountId: null, serverEpoch: null, canonicalRevision: 0, error: "" },
419
+ defaultAiDraft: { vendor: "", model: "", effort: "" },
420
+ defaultAiDraftDirty: false,
351
421
 
352
422
  // dm
353
423
  dmTargetUser: null,
@@ -479,7 +549,6 @@ import { initDebate, handleDebatePreparing, handleDebateStarted, handleDebateRes
479
549
  switchProject: function (slug) { switchProject(slug); },
480
550
  openTerminal: function () { openTerminal(); },
481
551
  showHomeHub: function () { showHomeHub(); },
482
- openRalphWizard: function (source) { openRalphWizard(source); },
483
552
  getUpcomingSchedules: getUpcomingSchedules,
484
553
  get multiUser() { return store.get('isMultiUserMode'); },
485
554
  get myUserId() { return store.get('myUserId'); },
@@ -500,6 +569,10 @@ import { initDebate, handleDebatePreparing, handleDebateStarted, handleDebateRes
500
569
  // mcp-ui.js / etc.) attach click handlers by ID.
501
570
  initToolPalettes();
502
571
  initProjectLogs();
572
+ initIssues();
573
+ initIssuesContext();
574
+ initIssueLinks();
575
+ initScheduledTasks();
503
576
  initSidebar(sidebarCtx);
504
577
  var wsGetter = function () { return _getWsRef(); };
505
578
  initMateSidebar(wsGetter);
@@ -687,7 +760,9 @@ import { initDebate, handleDebatePreparing, handleDebateStarted, handleDebateRes
687
760
 
688
761
  initLoopUi();
689
762
  initBackgroundTasksUi();
690
- initLoopWizard();
763
+ initPendingMessageQueue();
764
+ initAutonomousRun();
765
+ initLoopInterview();
691
766
 
692
767
  // --- Notifications module ---
693
768
  initAppNotifications();
@@ -769,8 +844,6 @@ import { initDebate, handleDebatePreparing, handleDebateStarted, handleDebateRes
769
844
  // --- Rate Limit / Scheduled Messages / Fast Mode (delegated to app-rate-limit.js) ---
770
845
  function handleRateLimitEvent(msg) { _rlHandleRateLimitEvent(msg); }
771
846
  function updateRateLimitUsage(msg) { _rlUpdateRateLimitUsage(msg); }
772
- function addScheduledMessageBubble(text, resetsAt) { _rlAddScheduledMessageBubble(text, resetsAt); }
773
- function removeScheduledMessageBubble() { _rlRemoveScheduledMessageBubble(); }
774
847
  function handleFastModeState(state) { _rlHandleFastModeState(state); }
775
848
 
776
849
  // --- Prompt suggestion chips (delegated to app-rendering.js) ---
@@ -948,6 +1021,7 @@ import { initDebate, handleDebatePreparing, handleDebateStarted, handleDebateRes
948
1021
  }
949
1022
  }
950
1023
  initCursorToggle();
1024
+ initDefaultAi();
951
1025
  // Apply RBAC UI gating
952
1026
  var _perms = store.get('permissions');
953
1027
  if (_perms) {
@@ -974,8 +1048,6 @@ import { initDebate, handleDebatePreparing, handleDebateStarted, handleDebateRes
974
1048
  if (msBtn) msBtn.style.display = "none";
975
1049
  }
976
1050
  if (!_perms.scheduledTasks) {
977
- var schBtn = document.getElementById("home-scheduler-btn");
978
- if (schBtn) schBtn.style.display = "none";
979
1051
  var schToolBtn = document.getElementById("scheduler-btn");
980
1052
  if (schToolBtn) schToolBtn.style.display = "none";
981
1053
  }
@@ -1118,13 +1190,14 @@ import { initDebate, handleDebatePreparing, handleDebateStarted, handleDebateRes
1118
1190
  setBrowserRefresh(function () { if (isNotesBrowserOpen()) renderNotesBrowser(); });
1119
1191
  // Opening the browser claims the single right workbench slot. Registered here
1120
1192
  // so the browser module never imports the other tools.
1121
- registerExclusiveClosers([closeProjectLogs, closeScheduler, closeFileViewer, closeTerminal]);
1193
+ registerExclusiveClosers([closeIssues, closeProjectLogs, closeScheduledTasks, closeFileViewer, closeTerminal]);
1122
1194
 
1123
1195
  // --- Sticky Notes sidebar button (create new note) ---
1124
1196
  var stickyNotesSidebarBtn = $("sticky-notes-sidebar-btn");
1125
1197
  if (stickyNotesSidebarBtn) {
1126
1198
  stickyNotesSidebarBtn.addEventListener("click", function () {
1127
1199
  closeProjectLogs();
1200
+ closeScheduledTasks();
1128
1201
  if (isSchedulerOpen()) closeScheduler();
1129
1202
  if (isNotesBrowserOpen()) closeNotesBrowser();
1130
1203
  showNotes();
@@ -1132,12 +1205,20 @@ import { initDebate, handleDebatePreparing, handleDebateStarted, handleDebateRes
1132
1205
  });
1133
1206
  }
1134
1207
 
1208
+ var stickyNotesToggleButtons = document.querySelectorAll("#sticky-notes-toggle-btn");
1209
+ for (var stickyToggleIndex = 0; stickyToggleIndex < stickyNotesToggleButtons.length; stickyToggleIndex++) {
1210
+ stickyNotesToggleButtons[stickyToggleIndex].addEventListener("click", function () {
1211
+ toggleNotesTemporaryVisibility();
1212
+ });
1213
+ }
1214
+
1135
1215
  // Sticky Notes badge click → archive toggle
1136
1216
  var stickyNotesBadge = $("sticky-notes-sidebar-count");
1137
1217
  if (stickyNotesBadge) {
1138
1218
  stickyNotesBadge.addEventListener("click", function (e) {
1139
1219
  e.stopPropagation();
1140
1220
  closeProjectLogs();
1221
+ closeScheduledTasks();
1141
1222
  if (isSchedulerOpen()) closeScheduler();
1142
1223
  if (isNotesBrowserOpen()) {
1143
1224
  closeNotesBrowser();
@@ -1151,11 +1232,11 @@ import { initDebate, handleDebatePreparing, handleDebateStarted, handleDebateRes
1151
1232
  var fileBrowserBtn = $("file-browser-btn");
1152
1233
  var gitPlacardMoreBtn = $("git-placard-more");
1153
1234
  var terminalSidebarBtn = $("terminal-sidebar-btn");
1154
- if (fileBrowserBtn) fileBrowserBtn.addEventListener("click", function () { closeProjectLogs(); if (isNotesBrowserOpen()) closeNotesBrowser(); if (isSchedulerOpen()) closeScheduler(); });
1155
- if (gitPlacardMoreBtn) gitPlacardMoreBtn.addEventListener("click", function () { closeProjectLogs(); if (isNotesBrowserOpen()) closeNotesBrowser(); if (isSchedulerOpen()) closeScheduler(); });
1156
- if (terminalSidebarBtn) terminalSidebarBtn.addEventListener("click", function () { closeProjectLogs(); if (isNotesBrowserOpen()) closeNotesBrowser(); if (isSchedulerOpen()) closeScheduler(); });
1235
+ if (fileBrowserBtn) fileBrowserBtn.addEventListener("click", function () { closeIssues(); closeProjectLogs(); closeScheduledTasks(); if (isNotesBrowserOpen()) closeNotesBrowser(); if (isSchedulerOpen()) closeScheduler(); });
1236
+ if (gitPlacardMoreBtn) gitPlacardMoreBtn.addEventListener("click", function () { closeIssues(); closeProjectLogs(); closeScheduledTasks(); if (isNotesBrowserOpen()) closeNotesBrowser(); if (isSchedulerOpen()) closeScheduler(); });
1237
+ if (terminalSidebarBtn) terminalSidebarBtn.addEventListener("click", function () { closeIssues(); closeProjectLogs(); closeScheduledTasks(); if (isNotesBrowserOpen()) closeNotesBrowser(); if (isSchedulerOpen()) closeScheduler(); });
1157
1238
 
1158
- // --- Ralph Loop UI (delegated to app-loop-ui.js + app-loop-wizard.js) ---
1239
+ // --- Legacy scheduled Loop UI ---
1159
1240
  function updateLoopInputVisibility(loop) { _loopUpdateLoopInputVisibility(loop); }
1160
1241
  function updateLoopButton() { _loopUpdateLoopButton(); }
1161
1242
  function showLoopBanner(show) { _loopShowLoopBanner(show); }
@@ -1192,9 +1273,6 @@ import { initDebate, handleDebatePreparing, handleDebateStarted, handleDebateRes
1192
1273
  });
1193
1274
  }
1194
1275
 
1195
- // --- Ralph Wizard (delegated to app-loop-wizard.js) ---
1196
- function openRalphWizard(source) { _loopOpenRalphWizard(source); }
1197
- function closeRalphWizard() { _loopCloseRalphWizard(); }
1198
1276
 
1199
1277
  // --- Debate UI (delegated to app-debate-ui.js) ---
1200
1278
  // debateStickyState, debateHandRaiseOpen, debateFloorMode, debateConcludeMode, debateEndedMode -> modules/app-debate-ui.js
@@ -1228,14 +1306,6 @@ import { initDebate, handleDebatePreparing, handleDebateStarted, handleDebateRes
1228
1306
  get activeSessionId() { return store.get('activeSessionId'); },
1229
1307
  basePath: basePath,
1230
1308
  currentSlug: currentSlug, // init-time snapshot, scheduler uses for initial setup
1231
- openRalphWizard: function (source) { openRalphWizard(source); },
1232
- requireClayRalph: function (cb) {
1233
- requireSkills({
1234
- title: "Skill Installation Required",
1235
- reason: "This feature requires the following skill to be installed.",
1236
- skills: [{ name: "clay-ralph", url: "https://github.com/chadbyte/clay-ralph", scope: "global" }]
1237
- }, cb);
1238
- },
1239
1309
  getProjects: function () { return getCachedProjects(); },
1240
1310
  });
1241
1311
 
@@ -0,0 +1,33 @@
1
+ .default-ai-popover {
2
+ position: fixed;
3
+ z-index: 10050;
4
+ box-sizing: border-box;
5
+ padding: 18px;
6
+ border: 1px solid var(--border);
7
+ border-radius: 14px;
8
+ background: var(--bg);
9
+ box-shadow: 0 18px 46px rgba(0, 0, 0, .38);
10
+ color: var(--text);
11
+ font-size: 13px;
12
+ max-height: calc(100vh - 24px);
13
+ overflow-y: auto;
14
+ }
15
+
16
+ .default-ai-popover.hidden { display: none; }
17
+
18
+ .default-ai-title { font-size: 16px; font-weight: 700; letter-spacing: -.01em; }
19
+ .default-ai-copy { margin: 5px 0 14px; color: var(--text-secondary, #9699a5); line-height: 1.45; }
20
+ .default-ai-label { display: block; margin-top: 10px; color: var(--text-secondary); font-size: 11px; font-weight: 600; }
21
+ .default-ai-select { display: block; width: 100%; min-height: 38px; margin-top: 5px; padding: 8px 30px 8px 10px; border: 1px solid var(--border); border-radius: 8px; background: var(--input-bg); color: var(--text); font: inherit; }
22
+ .default-ai-select:focus-visible, .default-ai-save:focus-visible, .default-ai-button:focus-visible { outline: 2px solid var(--accent, #8f89ff); outline-offset: 2px; }
23
+ .default-ai-save { width: 100%; min-height: 38px; margin-top: 10px; padding: 9px; border: 0; border-radius: 8px; background: var(--accent, #635bff); color: #fff; font-weight: 700; cursor: pointer; }
24
+ .default-ai-save:disabled, .default-ai-select:disabled { opacity: .48; cursor: not-allowed; }
25
+ .default-ai-status { padding: 10px 0 0; color: var(--text-secondary, #9699a5); line-height: 1.4; }
26
+ .default-ai-error { color: var(--error); }
27
+ .default-ai-button { position: relative; }
28
+ .default-ai-avatar img { display: block; width: 18px; height: 18px; border-radius: 5px; }
29
+ .default-ai-button .default-ai-avatar:empty::after { content: '✦'; color: var(--accent, #8f89ff); font-size: 16px; }
30
+
31
+ @media (max-width: 420px) {
32
+ .default-ai-popover { padding: 15px; border-radius: 12px; }
33
+ }
@@ -9,6 +9,7 @@ body.home-active #mate-sidebar-column,
9
9
  body.home-active #sidebar-resize-handle,
10
10
  body.home-active #mate-sidebar-resize-handle,
11
11
  body.home-active #sidebar-overlay,
12
+ body.home-active #mobile-tab-bar,
12
13
  body.home-active .title-bar-content,
13
14
  body.home-active #user-island { display: none !important; }
14
15
 
@@ -935,7 +936,7 @@ body.home-surface-boot-pending #connect-overlay.hidden {
935
936
  }
936
937
 
937
938
  @media (max-width: 900px) {
938
- #home-hub { padding: calc(6px + var(--safe-top)) 8px calc(68px + var(--safe-bottom, 0px)); }
939
+ #home-hub { padding: calc(6px + var(--safe-top)) 8px calc(8px + var(--safe-bottom, 0px)); }
939
940
 
940
941
  .home-hub-inner {
941
942
  height: 100%;
@@ -980,9 +981,21 @@ body.home-surface-boot-pending #connect-overlay.hidden {
980
981
  }
981
982
 
982
983
  @media (max-width: 768px) {
984
+ #home-hub:not(.dock-split):not(.dock-focus) .home-mate-chat-stage {
985
+ padding-top: 52px;
986
+ }
987
+
988
+ #home-hub:not(.dock-split):not(.dock-focus) .home-mate-chat-messages {
989
+ padding-top: 8px;
990
+ }
991
+
992
+ #home-hub:not(.dock-split):not(.dock-focus) .home-mate-chat-composer-frame {
993
+ margin-bottom: 0;
994
+ }
995
+
983
996
  #home-hub.dock-split,
984
997
  #home-hub.dock-focus {
985
- padding: var(--safe-top) 0 calc(56px + var(--safe-bottom, 0px));
998
+ padding: var(--safe-top) 0 var(--safe-bottom, 0px);
986
999
  }
987
1000
 
988
1001
  .home-workspace { flex-direction: column; }
@@ -223,6 +223,50 @@
223
223
  padding-left: 7px;
224
224
  }
225
225
 
226
+ .home-sidebar-mate-toggle {
227
+ display: flex;
228
+ align-items: center;
229
+ justify-content: space-between;
230
+ width: 100%;
231
+ min-height: 25px;
232
+ border: 0;
233
+ background: transparent;
234
+ color: var(--text-dimmer);
235
+ font: inherit;
236
+ font-size: 9px;
237
+ font-weight: 680;
238
+ letter-spacing: 0.09em;
239
+ line-height: 1.2;
240
+ text-align: left;
241
+ text-transform: uppercase;
242
+ cursor: pointer;
243
+ }
244
+
245
+ .home-sidebar-mate-toggle:hover,
246
+ .home-sidebar-mate-toggle:focus-visible {
247
+ color: var(--text-secondary);
248
+ }
249
+
250
+ .home-sidebar-mate-toggle:focus-visible {
251
+ outline: 2px solid var(--accent);
252
+ outline-offset: -2px;
253
+ border-radius: 5px;
254
+ }
255
+
256
+ .home-sidebar-mate-toggle .lucide {
257
+ width: 12px;
258
+ height: 12px;
259
+ transition: transform 140ms ease;
260
+ }
261
+
262
+ .home-sidebar-mate-toggle[aria-expanded="false"] .lucide {
263
+ transform: rotate(-90deg);
264
+ }
265
+
266
+ .home-sidebar-mates-collapsed .home-mate-list {
267
+ display: none;
268
+ }
269
+
226
270
  .home-mate-list {
227
271
  flex: 0 0 var(--home-mate-list-height);
228
272
  display: flex;
@@ -693,7 +737,7 @@
693
737
  position: absolute;
694
738
  z-index: 8;
695
739
  top: calc(8px + var(--safe-top));
696
- bottom: calc(64px + var(--safe-bottom, 0px));
740
+ bottom: calc(8px + var(--safe-bottom, 0px));
697
741
  left: 8px;
698
742
  width: min(320px, calc(100vw - 24px));
699
743
  padding: 6px;
@@ -701,6 +745,10 @@
701
745
  border-radius: 12px;
702
746
  box-shadow: 12px 18px 44px rgba(var(--shadow-rgb), 0.22);
703
747
  }
748
+ .home-sidebar-mate-toggle {
749
+ width: 100%;
750
+ min-height: 36px;
751
+ }
704
752
  .home-sidebar-backdrop {
705
753
  position: absolute;
706
754
  z-index: 7;
@@ -710,7 +758,7 @@
710
758
  background: rgba(var(--shadow-rgb), 0.13);
711
759
  }
712
760
  #home-hub.home-sidebar-collapsed .home-sidebar-backdrop { display: none; }
713
- .home-conversations-sheet { align-items: flex-end; padding: 8px 8px calc(64px + var(--safe-bottom, 0px)); }
761
+ .home-conversations-sheet { align-items: flex-end; padding: 8px 8px calc(8px + var(--safe-bottom, 0px)); }
714
762
  .home-conversations-sheet-panel { width: 100%; max-height: calc(100vh - 84px); border-radius: 14px 14px 10px 10px; }
715
763
  }
716
764
 
@@ -593,6 +593,37 @@
593
593
  line-height: 1;
594
594
  }
595
595
  .project-access-close:hover { color: var(--text); }
596
+ .project-access-scope {
597
+ display: flex;
598
+ gap: 10px;
599
+ margin: 12px 14px 4px;
600
+ padding: 10px;
601
+ color: var(--text);
602
+ background: rgba(var(--overlay-rgb), 0.045);
603
+ border: 1px solid var(--border);
604
+ border-radius: 9px;
605
+ }
606
+ .project-access-scope-icon {
607
+ display: flex;
608
+ align-items: center;
609
+ justify-content: center;
610
+ width: 28px;
611
+ height: 28px;
612
+ flex: 0 0 28px;
613
+ color: var(--accent, #6366f1);
614
+ background: var(--accent-8, rgba(99, 102, 241, 0.08));
615
+ border-radius: 7px;
616
+ }
617
+ .project-access-scope-icon .lucide { width: 15px; height: 15px; }
618
+ .project-access-scope strong,
619
+ .project-access-scope small { display: block; }
620
+ .project-access-scope strong { font-size: 12px; font-weight: 600; }
621
+ .project-access-scope small {
622
+ margin-top: 2px;
623
+ color: var(--text-secondary);
624
+ font-size: 10px;
625
+ line-height: 1.35;
626
+ }
596
627
  .project-access-section {
597
628
  padding: 10px 14px;
598
629
  }
@@ -653,6 +684,15 @@
653
684
  cursor: pointer;
654
685
  }
655
686
  .project-access-user-item:hover { color: var(--text); }
687
+ .project-access-user-item small {
688
+ margin-left: auto;
689
+ color: var(--text-tertiary);
690
+ font-size: 9px;
691
+ text-transform: uppercase;
692
+ letter-spacing: 0.04em;
693
+ }
694
+ .project-access-user-item.is-inherited { color: var(--text-secondary); cursor: default; }
695
+ .project-access-user-item.is-inherited input { cursor: default; }
656
696
  .project-access-empty {
657
697
  font-size: 12px;
658
698
  color: var(--text-tertiary);