@clagentic/console 1.6.0 → 1.7.0
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.
- package/bin/cli.js +20 -102
- package/deploy/clagentic-console.service +10 -1
- package/lib/agents-favorites.js +0 -1
- package/lib/agents.js +0 -10
- package/lib/cli-sessions.js +0 -12
- package/lib/codex-defaults.js +4 -1
- package/lib/config.js +0 -8
- package/lib/daemon.js +88 -9
- package/lib/dm.js +0 -1
- package/lib/ipc.js +129 -59
- package/lib/loop-handoff.js +5 -1
- package/lib/memory-limits.js +214 -36
- package/lib/memory-shed.js +207 -0
- package/lib/notes.js +0 -20
- package/lib/os-users.js +0 -3
- package/lib/project-connection.js +31 -5
- package/lib/project-external-trigger.js +2 -1
- package/lib/project-filesystem.js +18 -11
- package/lib/project-knowledge.js +0 -8
- package/lib/project-loop.js +162 -9
- package/lib/project-sessions.js +87 -21
- package/lib/project-user-mention.js +2 -1
- package/lib/project-user-message.js +16 -5
- package/lib/project.js +14 -25
- package/lib/public/app.js +1 -2
- package/lib/public/css/channel-layout.css +25 -158
- package/lib/public/css/diagnostics.css +17 -1
- package/lib/public/css/icon-strip.css +1 -32
- package/lib/public/css/input.css +0 -56
- package/lib/public/css/loop.css +94 -0
- package/lib/public/css/messages.css +23 -4
- package/lib/public/css/mobile-nav.css +0 -124
- package/lib/public/index.html +11 -11
- package/lib/public/modules/app-connection.js +2 -1
- package/lib/public/modules/app-favicon.js +1 -1
- package/lib/public/modules/app-loop-ui.js +140 -4
- package/lib/public/modules/app-messages.js +17 -11
- package/lib/public/modules/app-projects.js +1 -1
- package/lib/public/modules/custom-icons.js +15 -1
- package/lib/public/modules/dom-refs.js +1 -2
- package/lib/public/modules/emoji-picker.js +6 -1
- package/lib/public/modules/filebrowser.js +33 -9
- package/lib/public/modules/input.js +39 -0
- package/lib/public/modules/scheduler.js +20 -6
- package/lib/public/modules/sidebar-mobile.js +0 -64
- package/lib/public/modules/sidebar-projects.js +90 -25
- package/lib/public/modules/sidebar-sessions.js +80 -13
- package/lib/public/modules/stt.js +2 -6
- package/lib/public/modules/tool-palette.js +0 -1
- package/lib/public/modules/tools.js +2 -6
- package/lib/public/style.css +0 -1
- package/lib/scheduler.js +0 -1
- package/lib/sdk-bridge.js +126 -194
- package/lib/sdk-message-processor.js +24 -9
- package/lib/sdk-permission-ownership.js +51 -0
- package/lib/server-auth.js +25 -18
- package/lib/server-dm.js +1 -1
- package/lib/server-skills.js +9 -1
- package/lib/server.js +18 -3
- package/lib/session-search.js +4 -299
- package/lib/sessions.js +467 -82
- package/lib/smtp.js +0 -15
- package/lib/user-presence.js +0 -12
- package/lib/users-preferences.js +2 -2
- package/lib/users.js +0 -5
- package/lib/utils.js +56 -0
- package/lib/ws-schema.js +3 -14
- package/lib/yoke/adapters/codex.js +96 -10
- package/lib/yoke/codex-local-image.js +79 -0
- package/package.json +1 -1
- package/scripts/postinstall.js +16 -11
- package/lib/ask-user-mcp-server.js +0 -121
- package/lib/project-memory.js +0 -39
- package/lib/public/console-icon.png +0 -0
- package/lib/public/css/debate.css +0 -1610
- package/lib/public/favicon-banded-32.png +0 -0
- package/lib/public/favicon-dark.svg +0 -32
- package/lib/public/favicon.svg +0 -32
- package/lib/public/icon-banded-96.png +0 -0
- package/lib/public/icons/email/gmail.svg +0 -7
- package/lib/public/icons/email/outlook.svg +0 -35
- package/lib/public/icons/email/yahoo.svg +0 -1
- package/lib/public/modules/events.js +0 -21
- package/lib/public/modules/state.js +0 -3
- package/lib/sdk-worker.js +0 -730
|
@@ -1,121 +0,0 @@
|
|
|
1
|
-
// Ask User MCP Server for Clay
|
|
2
|
-
// Provides a mate-only ask_user_questions tool that reuses the existing
|
|
3
|
-
// AskUserQuestion UI and ask_user_response flow.
|
|
4
|
-
|
|
5
|
-
var z;
|
|
6
|
-
try { z = require("zod"); } catch (e) { z = null; }
|
|
7
|
-
|
|
8
|
-
// Returns a Zod "shape" object (property -> zod field) matching what
|
|
9
|
-
// Claude SDK's `sdk.tool()` expects. Do NOT wrap in z.object() here —
|
|
10
|
-
// the SDK does that internally.
|
|
11
|
-
//
|
|
12
|
-
// The schema is deliberately tight: options are required (2-6), each with
|
|
13
|
-
// a label and a short description. This pushes Codex (which treats the
|
|
14
|
-
// schema as a loose hint) toward producing well-structured multiple-choice
|
|
15
|
-
// cards instead of a bare "Other..." text field.
|
|
16
|
-
function buildQuestionShape() {
|
|
17
|
-
if (!z) return {};
|
|
18
|
-
|
|
19
|
-
var optionSchema = z.object({
|
|
20
|
-
label: z.string().min(1).max(60)
|
|
21
|
-
.describe("Short button label, 1-6 words. Shown as the primary option text."),
|
|
22
|
-
description: z.string().min(1).max(160)
|
|
23
|
-
.describe("One-line clarifier shown under the label. Concrete example or scope."),
|
|
24
|
-
markdown: z.string().optional()
|
|
25
|
-
.describe("Optional longer markdown body shown on expand. Use sparingly."),
|
|
26
|
-
}).passthrough();
|
|
27
|
-
|
|
28
|
-
var questionSchema = z.object({
|
|
29
|
-
header: z.string().min(1).max(40)
|
|
30
|
-
.describe("Short ALL-CAPS-ish section header above the question (e.g. 'FIRST THINGS FIRST', 'SCOPE'). Gives the user context for this step."),
|
|
31
|
-
question: z.string().min(1)
|
|
32
|
-
.describe("The actual question in natural spoken tone. Be specific, not generic."),
|
|
33
|
-
multiSelect: z.boolean().optional()
|
|
34
|
-
.describe("Set true only when multiple answers genuinely make sense. Default false."),
|
|
35
|
-
options: z.array(optionSchema).min(2).max(6)
|
|
36
|
-
.describe("Concrete options. Preferred count is 4; acceptable range is 2-6. FOUR is the target. Do NOT default to 3 out of habit. If you can only think of 3, push yourself: add a scope variant, edge case, or 'combined' option as the 4th. Only drop below 4 when the answer space is genuinely narrower (e.g. yes/no/unsure). Never include an 'Other' option yourself (the UI renders one automatically)."),
|
|
37
|
-
}).passthrough();
|
|
38
|
-
|
|
39
|
-
return {
|
|
40
|
-
questions: z.array(questionSchema).min(1).max(3)
|
|
41
|
-
.describe("One to three question objects to show together as a card. Prefer ONE focused question per call."),
|
|
42
|
-
};
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
var TOOL_DESCRIPTION = [
|
|
46
|
-
"Ask the user a structured multiple-choice question. Renders as a card with a header, the question, 2-6 clickable option buttons, and an always-present 'Other...' free-text field.",
|
|
47
|
-
"",
|
|
48
|
-
"WHEN TO USE:",
|
|
49
|
-
"- Interviewing the user at mate setup, or whenever you need to narrow scope before acting.",
|
|
50
|
-
"- Any branching decision where 2-6 concrete choices cover most of the space.",
|
|
51
|
-
"",
|
|
52
|
-
"REQUIRED STRUCTURE (all fields matter, do not skip):",
|
|
53
|
-
"- header: short section label, like 'FIRST THINGS FIRST' or 'SCOPE'. Gives context.",
|
|
54
|
-
"- question: one specific question in natural tone. Avoid generic 'how can I help?'.",
|
|
55
|
-
"- options: ALWAYS provide FOUR options by default. Acceptable range is 4-6; only drop to 3 if the answer space is genuinely binary-plus-one (rare). Each option has a short label (1-6 words) AND a one-line description giving a concrete example or scope. The UI already renders an 'Other...' text field, so you never need to include an 'Other' option yourself.",
|
|
56
|
-
"- multiSelect: omit or false unless multiple answers clearly apply.",
|
|
57
|
-
"",
|
|
58
|
-
"ON OPTION COUNT (IMPORTANT):",
|
|
59
|
-
"- Default to 4 options. Not 3. Models tend to gravitate to 3 because it feels tidy; resist that.",
|
|
60
|
-
"- If you're about to produce 3 options, stop and think: is there a fourth axis you're missing? A scope variant? A 'both' or 'neither'? A more niche case? Add it.",
|
|
61
|
-
"- 3 is only acceptable when the fourth option would be truly degenerate (e.g. yes/no/unsure).",
|
|
62
|
-
"- 5 or 6 is fine when the space is wide; don't cram.",
|
|
63
|
-
"",
|
|
64
|
-
"GOOD EXAMPLE:",
|
|
65
|
-
' { header: "FIRST THINGS FIRST",',
|
|
66
|
-
' question: "\'Language\' is broad, what do you actually want help with?",',
|
|
67
|
-
' options: [',
|
|
68
|
-
' { label: "A new language from scratch", description: "Pick up a language you don\'t speak yet (e.g. Japanese, Spanish)" },',
|
|
69
|
-
' { label: "Sharpen English", description: "Level up your English, writing, speaking, nuance, executive communication" },',
|
|
70
|
-
' { label: "Sharpen Korean", description: "Polish your Korean, writing style, formal register, etc." },',
|
|
71
|
-
' { label: "Teach me how to teach", description: "Help you teach language to others, like Elyse or team members" }',
|
|
72
|
-
" ] }",
|
|
73
|
-
"",
|
|
74
|
-
"BAD EXAMPLES (do not do this):",
|
|
75
|
-
"- Asking a vague question with no options and relying on the Other field.",
|
|
76
|
-
"- Options with only labels and no descriptions.",
|
|
77
|
-
"- Defaulting to exactly 3 options out of habit. Aim for 4.",
|
|
78
|
-
"- More than one question per call unless they are tightly related.",
|
|
79
|
-
"- Single-option 'questions' (use a plain message instead).",
|
|
80
|
-
].join("\n");
|
|
81
|
-
|
|
82
|
-
function getToolDefs(onAsk) {
|
|
83
|
-
var tools = [];
|
|
84
|
-
|
|
85
|
-
tools.push({
|
|
86
|
-
name: "ask_user_questions",
|
|
87
|
-
description: TOOL_DESCRIPTION,
|
|
88
|
-
inputSchema: buildQuestionShape(),
|
|
89
|
-
handler: function (args) {
|
|
90
|
-
if (!args || !Array.isArray(args.questions) || args.questions.length === 0) {
|
|
91
|
-
return Promise.resolve({
|
|
92
|
-
content: [{ type: "text", text: "Error: questions must be a non-empty array." }],
|
|
93
|
-
isError: true,
|
|
94
|
-
});
|
|
95
|
-
}
|
|
96
|
-
// Defensive structural check only: zod already enforces min 2.
|
|
97
|
-
// We do NOT reject on "only 3 options" — that's a soft preference
|
|
98
|
-
// expressed via the tool description, not a hard validation rule.
|
|
99
|
-
for (var i = 0; i < args.questions.length; i++) {
|
|
100
|
-
var q = args.questions[i];
|
|
101
|
-
if (!q || !Array.isArray(q.options) || q.options.length < 2) {
|
|
102
|
-
return Promise.resolve({
|
|
103
|
-
content: [{
|
|
104
|
-
type: "text",
|
|
105
|
-
text: "Error: question " + (i + 1) + " must include at least 2 options. "
|
|
106
|
-
+ "Provide concrete { label, description } choices (4 preferred). "
|
|
107
|
-
+ "The UI already shows an 'Other...' free-text field, so never add an 'Other' option yourself.",
|
|
108
|
-
}],
|
|
109
|
-
isError: true,
|
|
110
|
-
});
|
|
111
|
-
}
|
|
112
|
-
}
|
|
113
|
-
return onAsk(args);
|
|
114
|
-
},
|
|
115
|
-
});
|
|
116
|
-
|
|
117
|
-
return tools;
|
|
118
|
-
}
|
|
119
|
-
|
|
120
|
-
module.exports = { getToolDefs: getToolDefs };
|
|
121
|
-
|
package/lib/project-memory.js
DELETED
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Memory engine stub — memory was part of the Mates feature (removed lr-316f).
|
|
3
|
-
* This stub satisfies the project.js interface so existing call sites compile cleanly.
|
|
4
|
-
*
|
|
5
|
-
* handleMemoryList / handleMemorySearch / handleMemoryDelete are
|
|
6
|
-
* kept as no-ops; the WS message types (memory_list etc.) still
|
|
7
|
-
* exist in ws-schema.js and project.js routes them here.
|
|
8
|
-
*/
|
|
9
|
-
function attachMemory(ctx) {
|
|
10
|
-
var sendTo = ctx.sendTo;
|
|
11
|
-
|
|
12
|
-
function gateMemory() {}
|
|
13
|
-
function updateMemorySummary() {}
|
|
14
|
-
function initMemorySummary() {}
|
|
15
|
-
|
|
16
|
-
function handleMemoryList(ws) {
|
|
17
|
-
sendTo(ws, { type: "memory_list", digests: [] });
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
function handleMemorySearch(ws) {
|
|
21
|
-
sendTo(ws, { type: "memory_search_results", results: [] });
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
function handleMemoryDelete(ws) {
|
|
25
|
-
sendTo(ws, { type: "memory_deleted" });
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
return {
|
|
29
|
-
gateMemory: gateMemory,
|
|
30
|
-
updateMemorySummary: updateMemorySummary,
|
|
31
|
-
initMemorySummary: initMemorySummary,
|
|
32
|
-
handleMemoryList: handleMemoryList,
|
|
33
|
-
handleMemorySearch: handleMemorySearch,
|
|
34
|
-
handleMemoryDelete: handleMemoryDelete,
|
|
35
|
-
};
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
module.exports = { attachMemory };
|
|
39
|
-
|
|
Binary file
|