clay-server 2.38.0-beta.5 → 2.38.0-beta.7

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.
@@ -5,7 +5,11 @@ var { CODEX_DEFAULTS, getCodexConfig } = require("./codex-defaults");
5
5
 
6
6
  // Format a user's answer to an ask_user_questions card as a plain user
7
7
  // message so the MCP path can feed it back to the agent on the next turn.
8
- // The agent sees: its own question text, then the selected answer(s).
8
+ // The agent sees its own question text alongside the selected answer(s),
9
+ // which keeps the connection explicit: a bare "Phase 0" with no context
10
+ // reads as a non-sequitur to the model and triggers "I don't see an
11
+ // answer" responses, especially when a turn break sits between the tool
12
+ // call and this message.
9
13
  function formatAskUserAnswerAsMessage(input, answers) {
10
14
  var questions = (input && Array.isArray(input.questions)) ? input.questions : [];
11
15
  if (questions.length === 0) {
@@ -19,15 +23,13 @@ function formatAskUserAnswerAsMessage(input, answers) {
19
23
  var qText = (q && q.question) ? q.question : ("Question " + (i + 1));
20
24
  var ans = (answers && answers[i] != null) ? String(answers[i]) : "";
21
25
  if (!ans) continue;
22
- if (questions.length === 1) {
23
- // Single question: keep it tight.
24
- lines.push(ans);
25
- } else {
26
- lines.push("- " + qText + " → " + ans);
27
- }
26
+ lines.push("- " + qText + " → " + ans);
28
27
  }
29
28
  if (lines.length === 0) return "(no answer provided)";
30
- return lines.join("\n");
29
+ // Prefix tells the model "this is a structured answer to your previous
30
+ // AskUserQuestion call", which the bare "Q → A" alone doesn't make
31
+ // unambiguous when read out of context.
32
+ return "[Answer to your AskUserQuestion]\n" + lines.join("\n");
31
33
  }
32
34
 
33
35
  /**
package/lib/project.js CHANGED
@@ -571,7 +571,7 @@ function createProjectContext(opts) {
571
571
  return Promise.resolve({
572
572
  content: [{
573
573
  type: "text",
574
- text: "The question card has been posted to the user. End this turn now without further commentary; the user's answer will arrive as the next user message.",
574
+ text: "The question card has been posted to the user. End this turn now without further commentary; the user's answer will arrive as the next user message, prefixed with \"[Answer to your AskUserQuestion]\" so you can recognize it.",
575
575
  }],
576
576
  });
577
577
  });
@@ -855,7 +855,7 @@ function createProjectContext(opts) {
855
855
  }
856
856
 
857
857
  // --- DM messages (delegated to server-level handler) ---
858
- if (msg.type === "dm_open" || msg.type === "dm_send" || msg.type === "dm_list" || msg.type === "dm_typing" || msg.type === "dm_add_favorite" || msg.type === "dm_remove_favorite" || msg.type === "mate_create" || msg.type === "mate_list" || msg.type === "mate_delete" || msg.type === "mate_update" || msg.type === "mate_readd_builtin" || msg.type === "mate_list_available_builtins" || msg.type === "email_accounts_list" || msg.type === "email_account_add" || msg.type === "email_account_remove" || msg.type === "email_account_test") {
858
+ if (msg.type === "dm_open" || msg.type === "dm_send" || msg.type === "dm_list" || msg.type === "dm_typing" || msg.type === "dm_add_favorite" || msg.type === "dm_remove_favorite" || msg.type === "mate_create" || msg.type === "mate_list" || msg.type === "mate_delete" || msg.type === "mate_update" || msg.type === "mate_readd_builtin" || msg.type === "mate_list_available_builtins" || msg.type === "email_accounts_list" || msg.type === "email_account_add" || msg.type === "email_account_remove" || msg.type === "email_account_test" || msg.type === "home_clay_open" || msg.type === "home_clay_send" || msg.type === "home_clay_new_session" || msg.type === "home_clay_close") {
859
859
  if (typeof opts.onDmMessage === "function") {
860
860
  opts.onDmMessage(ws, msg);
861
861
  }
@@ -2294,48 +2294,7 @@
2294
2294
  </div>
2295
2295
  </div>
2296
2296
 
2297
- <!-- === Clay FAB + Popover ===
2298
- Persistent floating-action button (bottom-right) that opens a
2299
- phablet-style chat with Clay (the host agent). The popover overlays
2300
- the page content and does NOT interfere with the active project
2301
- session — talks via dedicated home_clay_* WS messages. -->
2302
- <button id="clay-fab" class="clay-fab" type="button" aria-label="Open Clay" title="Ask Clay">
2303
- <img class="clay-fab-icon" src="/icon-banded-76.png" alt="Clay">
2304
- <span class="clay-fab-pulse"></span>
2305
- </button>
2306
-
2307
- <div id="clay-popover" class="clay-popover hidden" role="dialog" aria-modal="false" aria-labelledby="home-chat-title-text">
2308
- <div class="home-chat-frame">
2309
- <div class="home-chat-header">
2310
- <div class="home-chat-avatar-wrap">
2311
- <img class="home-chat-avatar" src="/icon-banded-76.png" alt="Clay">
2312
- </div>
2313
- <div class="home-chat-title-block">
2314
- <div class="home-chat-title" id="home-chat-title-text">Clay</div>
2315
- <div class="home-chat-subtitle">Your workspace memory</div>
2316
- </div>
2317
- <button id="home-chat-new-btn" class="home-chat-icon-btn" title="Start a new conversation" aria-label="New conversation">
2318
- <i data-lucide="plus"></i>
2319
- </button>
2320
- <button id="home-chat-close-btn" class="home-chat-icon-btn" title="Close" aria-label="Close">
2321
- <i data-lucide="x"></i>
2322
- </button>
2323
- </div>
2324
- <div id="home-chat-messages" class="home-chat-messages">
2325
- <!-- messages rendered by home-chat.js -->
2326
- </div>
2327
- <div class="home-chat-typing hidden" id="home-chat-typing">
2328
- <span class="home-chat-typing-dot"></span>
2329
- <span class="home-chat-typing-dot"></span>
2330
- <span class="home-chat-typing-dot"></span>
2331
- </div>
2332
- <div class="home-chat-input-row">
2333
- <textarea id="home-chat-input" class="home-chat-input" rows="1" placeholder="Ask Clay…" autocomplete="off"></textarea>
2334
- <button id="home-chat-send-btn" class="home-chat-send-btn" disabled aria-label="Send">
2335
- <i data-lucide="arrow-up"></i>
2336
- </button>
2337
- </div>
2338
- </div>
2339
- </div>
2297
+ <!-- Clay FAB + popover disabled. Markup intentionally removed; assets
2298
+ (home-chat.js / home-chat.css) remain in repo for future re-enable. -->
2340
2299
  </body>
2341
2300
  </html>
@@ -423,11 +423,16 @@ document.addEventListener("click", function (e) {
423
423
  });
424
424
 
425
425
  // --- Initialize on DOM ready ---
426
-
427
- if (typeof document !== "undefined") {
428
- if (document.readyState === "loading") {
429
- document.addEventListener("DOMContentLoaded", initHomeChat);
430
- } else {
431
- initHomeChat();
432
- }
433
- }
426
+ // FAB chat is currently disabled. The DOM markup (#clay-fab, #clay-popover)
427
+ // has been removed from index.html, so initHomeChat() would return early
428
+ // anyway, but we skip the auto-init outright to make the disable explicit.
429
+ // To re-enable: restore the markup in index.html, the CSS import in
430
+ // style.css, and uncomment the block below.
431
+ //
432
+ // if (typeof document !== "undefined") {
433
+ // if (document.readyState === "loading") {
434
+ // document.addEventListener("DOMContentLoaded", initHomeChat);
435
+ // } else {
436
+ // initHomeChat();
437
+ // }
438
+ // }
@@ -18,7 +18,7 @@
18
18
  @import url("css/scheduler.css");
19
19
  @import url("css/scheduler-modal.css");
20
20
  @import url("css/home-hub.css");
21
- @import url("css/home-chat.css");
21
+ /* @import url("css/home-chat.css"); */ /* FAB chat disabled */
22
22
  @import url("css/playbook.css");
23
23
  @import url("css/stt.css");
24
24
  @import url("css/profile.css");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "clay-server",
3
- "version": "2.38.0-beta.5",
3
+ "version": "2.38.0-beta.7",
4
4
  "description": "Self-hosted team workspace for Claude Code and Codex. Multi-user, browser-based, with persistent AI mates.",
5
5
  "bin": {
6
6
  "clay-server": "./bin/cli.js",