clay-server 3.8.1 → 4.0.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.
- package/lib/ask-user-mcp-server.js +5 -119
- package/lib/background-task-timing.js +105 -0
- package/lib/builtin-mates.js +6 -6
- package/lib/claude-hook-installer.js +15 -0
- package/lib/clay-history-mcp-server.js +62 -297
- package/lib/daemon.js +23 -1
- package/lib/debate-model-selection.js +119 -0
- package/lib/home-debate-tool-policy.js +164 -0
- package/lib/home-response-notifications.js +26 -0
- package/lib/knowledge-import.js +436 -0
- package/lib/knowledge-record-store.js +188 -0
- package/lib/knowledge-search.js +224 -0
- package/lib/mate-creation-mcp-server.js +55 -0
- package/lib/mate-knowledge-mcp-server.js +151 -0
- package/lib/mate-knowledge-migration.js +283 -0
- package/lib/mate-knowledge-service.js +488 -0
- package/lib/mate-knowledge-sync.js +482 -0
- package/lib/mate-ready-creation.js +95 -0
- package/lib/mates.js +2 -0
- package/lib/notes.js +2 -1
- package/lib/project-ask-user.js +64 -0
- package/lib/project-capsule-catalog.js +101 -0
- package/lib/project-connection.js +17 -0
- package/lib/project-debate-proposal.js +133 -17
- package/lib/project-debate.js +214 -110
- package/lib/project-delegated-follow-up.js +84 -0
- package/lib/project-delegated-session.js +53 -0
- package/lib/project-filesystem.js +7 -9
- package/lib/project-knowledge.js +23 -0
- package/lib/project-logs-comments.js +137 -0
- package/lib/project-logs-mcp-server.js +290 -0
- package/lib/project-logs-query.js +167 -0
- package/lib/project-logs-root.js +67 -0
- package/lib/project-logs-schema.js +259 -0
- package/lib/project-logs-service.js +357 -0
- package/lib/project-logs-snapshot.js +202 -0
- package/lib/project-logs-store.js +498 -0
- package/lib/project-logs-versioning.js +128 -0
- package/lib/project-logs.js +347 -0
- package/lib/project-mate-creation-proposal.js +120 -0
- package/lib/project-mate-interaction.js +14 -0
- package/lib/project-mate-knowledge.js +110 -0
- package/lib/project-memory.js +36 -7
- package/lib/project-models.js +157 -32
- package/lib/project-session-notes.js +2 -2
- package/lib/project-session-pair.js +8 -8
- package/lib/project-sessions.js +66 -51
- package/lib/project-vendor-login.js +414 -0
- package/lib/project-worker-proposal.js +25 -25
- package/lib/project-workspace-query.js +144 -0
- package/lib/project.js +433 -102
- package/lib/public/app.js +109 -48
- package/lib/public/css/avatar-imprints.css +0 -1
- package/lib/public/css/base.css +4 -0
- package/lib/public/css/capsule-ui.css +389 -0
- package/lib/public/css/command-palette.css +306 -6
- package/lib/public/css/home-capsule-library.css +243 -0
- package/lib/public/css/home-capsule-source.css +192 -0
- package/lib/public/css/home-debate-live.css +146 -0
- package/lib/public/css/home-debate-planning.css +125 -0
- package/lib/public/css/home-debates-archive.css +281 -0
- package/lib/public/css/home-hub.css +896 -405
- package/lib/public/css/home-mate-creation.css +34 -0
- package/lib/public/css/home-mate-model-picker.css +131 -0
- package/lib/public/css/home-mate-settings.css +344 -0
- package/lib/public/css/home-session-actions.css +265 -0
- package/lib/public/css/home-sidebar.css +667 -0
- package/lib/public/css/icon-strip.css +1 -2
- package/lib/public/css/input.css +79 -25
- package/lib/public/css/mates.css +7 -34
- package/lib/public/css/pane.css +1 -1
- package/lib/public/css/playbook.css +0 -80
- package/lib/public/css/project-logs.css +234 -0
- package/lib/public/css/scheduler.css +1 -1
- package/lib/public/css/sticky-notes.css +53 -117
- package/lib/public/css/tui-attention.css +0 -44
- package/lib/public/css/workspace-assignment.css +45 -0
- package/lib/public/fonts/source-serif-4/LICENSE.md +93 -0
- package/lib/public/fonts/source-serif-4/SourceSerif4Caption-Semibold.ttf.woff2 +0 -0
- package/lib/public/index.html +96 -74
- package/lib/public/modules/app-connection.js +100 -5
- package/lib/public/modules/app-dm.js +43 -160
- package/lib/public/modules/app-home-hub.js +328 -585
- package/lib/public/modules/app-message-cards.js +242 -0
- package/lib/public/modules/app-message-router.js +84 -0
- package/lib/public/modules/app-messages.js +124 -38
- package/lib/public/modules/app-notifications.js +8 -119
- package/lib/public/modules/app-panels.js +43 -2
- package/lib/public/modules/app-projects.js +9 -1
- package/lib/public/modules/app-rendering.js +21 -602
- package/lib/public/modules/avatar-imprint.js +11 -8
- package/lib/public/modules/background-tasks-ui.js +139 -16
- package/lib/public/modules/chat-bubble-renderer.js +152 -0
- package/lib/public/modules/chat-render-runtime.js +198 -0
- package/lib/public/modules/command-palette.js +225 -436
- package/lib/public/modules/dm-render.js +82 -0
- package/lib/public/modules/home-capsule-creation-intent.js +31 -0
- package/lib/public/modules/home-capsule-library.js +146 -0
- package/lib/public/modules/home-capsule-source.js +383 -0
- package/lib/public/modules/home-chat-identity.js +35 -0
- package/lib/public/modules/home-chat-scroll.js +77 -0
- package/lib/public/modules/home-chat-stream-state.js +34 -0
- package/lib/public/modules/home-composer-focus.js +25 -0
- package/lib/public/modules/home-conversations-sheet.js +179 -0
- package/lib/public/modules/home-debate-activity.js +48 -0
- package/lib/public/modules/home-debate-controls.js +295 -0
- package/lib/public/modules/home-debate-launch.js +41 -0
- package/lib/public/modules/home-debate-live.js +284 -0
- package/lib/public/modules/home-debate-models.js +73 -0
- package/lib/public/modules/home-debate-planning.js +335 -0
- package/lib/public/modules/home-debates-archive.js +279 -0
- package/lib/public/modules/home-dock-resize.js +74 -0
- package/lib/public/modules/home-dock.js +446 -0
- package/lib/public/modules/home-mate-chat.js +496 -0
- package/lib/public/modules/home-mate-creation.js +109 -0
- package/lib/public/modules/home-mate-model-picker.js +281 -0
- package/lib/public/modules/home-mate-selection.js +38 -0
- package/lib/public/modules/home-mate-settings-menu.js +131 -0
- package/lib/public/modules/home-mate-settings.js +383 -0
- package/lib/public/modules/home-session-actions.js +373 -0
- package/lib/public/modules/home-session-model-confirmation.js +13 -0
- package/lib/public/modules/home-shell.js +9 -0
- package/lib/public/modules/home-sidebar-chat-list.js +63 -0
- package/lib/public/modules/home-sidebar.js +165 -0
- package/lib/public/modules/home-sub-surface.js +19 -0
- package/lib/public/modules/home-surface-boot.js +68 -0
- package/lib/public/modules/home-surface.js +141 -0
- package/lib/public/modules/home-tools.js +271 -0
- package/lib/public/modules/markdown.js +50 -2
- package/lib/public/modules/mate-management.js +86 -0
- package/lib/public/modules/mate-sidebar.js +0 -8
- package/lib/public/modules/mate-wizard.js +0 -7
- package/lib/public/modules/mention.js +17 -19
- package/lib/public/modules/pane-bridge.js +9 -0
- package/lib/public/modules/profile.js +4 -5
- package/lib/public/modules/project-logs-ambient.js +238 -0
- package/lib/public/modules/project-logs-render.js +359 -0
- package/lib/public/modules/project-logs.js +328 -0
- package/lib/public/modules/project-settings.js +34 -28
- package/lib/public/modules/project-switcher.js +11 -5
- package/lib/public/modules/project-workspace-assignment.js +23 -0
- package/lib/public/modules/scheduler.js +17 -3
- package/lib/public/modules/search-clay-chat.js +402 -0
- package/lib/public/modules/server-settings.js +14 -12
- package/lib/public/modules/session-actions.js +1 -1
- package/lib/public/modules/sidebar-mates.js +56 -552
- package/lib/public/modules/sidebar-mobile.js +12 -73
- package/lib/public/modules/sidebar-presence.js +37 -0
- package/lib/public/modules/sidebar-sessions.js +25 -1
- package/lib/public/modules/split-pair-ui.js +13 -13
- package/lib/public/modules/split-view.js +7 -0
- package/lib/public/modules/sticky-notes.js +106 -53
- package/lib/public/modules/tool-input-composition.js +48 -0
- package/lib/public/modules/tool-llm-status.js +167 -0
- package/lib/public/modules/tool-palette.js +76 -4
- package/lib/public/modules/tool-renderer-advanced.js +285 -0
- package/lib/public/modules/tool-renderer-chart.js +158 -0
- package/lib/public/modules/tool-renderer-semantics.js +35 -0
- package/lib/public/modules/tool-renderer.js +464 -0
- package/lib/public/modules/tool-runtime.js +309 -0
- package/lib/public/modules/tool-ui-evaluator.js +97 -0
- package/lib/public/modules/tool-ui-tree.js +21 -0
- package/lib/public/modules/tui-attention.js +10 -0
- package/lib/public/modules/user-settings.js +16 -23
- package/lib/public/modules/vendor-login.js +287 -0
- package/lib/public/modules/worker-proposal.js +2 -2
- package/lib/public/modules/workspace-assignment-card.js +149 -0
- package/lib/public/modules/workspace-assignment-routing.js +4 -0
- package/lib/public/style.css +14 -2
- package/lib/runtime-env.js +65 -0
- package/lib/sdk-bridge.js +120 -32
- package/lib/sdk-message-processor.js +34 -13
- package/lib/server-home-capsule-creation.js +36 -0
- package/lib/server-home-chat-events.js +287 -0
- package/lib/server-home-chat.js +518 -0
- package/lib/server-home-clay-entry.js +65 -0
- package/lib/server-home-clay-session-links.js +26 -0
- package/lib/server-home-debate-planning.js +214 -0
- package/lib/server-home-debates.js +137 -0
- package/lib/server-home-mate-creation.js +261 -0
- package/lib/server-home-models.js +241 -0
- package/lib/server-home-preferences.js +61 -0
- package/lib/server-mates.js +37 -0
- package/lib/server-tools.js +377 -0
- package/lib/server.js +166 -59
- package/lib/session-pair-mcp-server.js +6 -6
- package/lib/sessions.js +22 -4
- package/lib/tool-capsule-source.js +142 -0
- package/lib/tool-control-mcp-server.js +126 -0
- package/lib/tool-llm.js +48 -0
- package/lib/tool-storage.js +77 -0
- package/lib/tool-ui-spec-advanced.js +82 -0
- package/lib/tool-ui-spec.js +261 -0
- package/lib/tools-registry.js +286 -0
- package/lib/users-home-dock-preferences.js +77 -0
- package/lib/users-home-surface-preferences.js +99 -0
- package/lib/users-preferences.js +4 -7
- package/lib/users.js +12 -0
- package/lib/whats-new-content.js +3 -3
- package/lib/workspace-assignment-service.js +420 -0
- package/lib/workspace-query-mcp-server.js +154 -0
- package/lib/workspace-query-service.js +492 -0
- package/lib/ws-schema.js +107 -12
- package/lib/yoke/adapters/acp.js +2 -1
- package/lib/yoke/adapters/antigravity.js +2 -1
- package/lib/yoke/adapters/claude-worker.js +11 -4
- package/lib/yoke/adapters/claude.js +141 -46
- package/lib/yoke/adapters/codex.js +79 -11
- package/lib/yoke/adapters/kiro.js +2 -1
- package/lib/yoke/claude-user-input.js +38 -0
- package/lib/yoke/codex-app-server.js +20 -2
- package/lib/yoke/codex-background-tasks.js +8 -2
- package/lib/yoke/codex-user-input.js +64 -0
- package/lib/yoke/complete-once.js +164 -0
- package/lib/yoke/index.js +5 -1
- package/lib/yoke/interface.js +19 -0
- package/lib/yoke/mcp-bridge-server.js +2 -6
- package/lib/yoke/user-input.js +254 -0
- package/package.json +4 -3
- package/lib/public/css/home-chat.css +0 -380
- package/lib/public/modules/home-chat.js +0 -438
- package/lib/server-clay-home.js +0 -245
|
@@ -1,120 +1,6 @@
|
|
|
1
|
-
//
|
|
2
|
-
|
|
3
|
-
// AskUserQuestion UI and ask_user_response flow.
|
|
1
|
+
// Backward-compatible export for callers migrating to YOKE user input.
|
|
2
|
+
var userInput = require("./yoke/user-input");
|
|
4
3
|
|
|
5
|
-
|
|
6
|
-
|
|
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 };
|
|
4
|
+
module.exports = {
|
|
5
|
+
getToolDefs: userInput.fallbackToolDefs,
|
|
6
|
+
};
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
// Background task list shaping shared by the server-side consumers:
|
|
2
|
+
// start-time tracking, plus the ambient/user split every activity indicator
|
|
3
|
+
// needs.
|
|
4
|
+
//
|
|
5
|
+
// Vendors report background tasks as a full replacement list on every change
|
|
6
|
+
// and none of them carries a reliable start time today (see
|
|
7
|
+
// normalizeBackgroundTasks in yoke/adapters/claude.js and mapTerminals in
|
|
8
|
+
// yoke/codex-background-tasks.js). The session's previous list is the only
|
|
9
|
+
// place that knows when a task was first seen, so the merge belongs here,
|
|
10
|
+
// where that list is maintained, rather than in an adapter that rebuilds the
|
|
11
|
+
// array from scratch each time.
|
|
12
|
+
//
|
|
13
|
+
// A vendor-supplied timestamp always wins when present; otherwise a task is
|
|
14
|
+
// stamped the first time it appears and keeps that stamp for its whole life.
|
|
15
|
+
|
|
16
|
+
// Accepts epoch milliseconds, epoch seconds, or an ISO date string, since
|
|
17
|
+
// vendors are not consistent. Returns null for anything unusable so the
|
|
18
|
+
// caller falls back to first-seen stamping instead of rendering 1970.
|
|
19
|
+
function normalizeTimestamp(value) {
|
|
20
|
+
if (typeof value === "number" && isFinite(value) && value > 0) {
|
|
21
|
+
// Values this small are epoch seconds, not milliseconds.
|
|
22
|
+
return value < 1e12 ? Math.round(value * 1000) : Math.round(value);
|
|
23
|
+
}
|
|
24
|
+
if (typeof value === "string" && value) {
|
|
25
|
+
var parsed = Date.parse(value);
|
|
26
|
+
if (!isNaN(parsed)) return parsed;
|
|
27
|
+
}
|
|
28
|
+
return null;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
function vendorStartedAt(task) {
|
|
32
|
+
if (!task) return null;
|
|
33
|
+
return normalizeTimestamp(task.started_at)
|
|
34
|
+
|| normalizeTimestamp(task.startedAt)
|
|
35
|
+
|| normalizeTimestamp(task.createdAt)
|
|
36
|
+
|| normalizeTimestamp(task.created_at);
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
/**
|
|
40
|
+
* Return `nextTasks` with a `started_at` (epoch ms) on every entry.
|
|
41
|
+
* Tasks already present in `previousTasks` keep their original stamp so the
|
|
42
|
+
* elapsed time does not reset every time the list is re-emitted.
|
|
43
|
+
*/
|
|
44
|
+
function mergeStartTimes(previousTasks, nextTasks, now) {
|
|
45
|
+
if (!Array.isArray(nextTasks)) return [];
|
|
46
|
+
var stampedAt = typeof now === "number" ? now : Date.now();
|
|
47
|
+
// Stamps we wrote on a previous pass are already epoch milliseconds, so they
|
|
48
|
+
// are read as-is. Only vendor-supplied values go through normalizeTimestamp,
|
|
49
|
+
// whose seconds-vs-milliseconds heuristic would otherwise be re-applied to
|
|
50
|
+
// our own output.
|
|
51
|
+
var known = {};
|
|
52
|
+
var previous = Array.isArray(previousTasks) ? previousTasks : [];
|
|
53
|
+
for (var p = 0; p < previous.length; p++) {
|
|
54
|
+
var seen = previous[p];
|
|
55
|
+
if (!seen || !seen.task_id) continue;
|
|
56
|
+
if (typeof seen.started_at === "number" && isFinite(seen.started_at) && seen.started_at > 0) {
|
|
57
|
+
known[seen.task_id] = seen.started_at;
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
var merged = [];
|
|
62
|
+
for (var i = 0; i < nextTasks.length; i++) {
|
|
63
|
+
var task = nextTasks[i];
|
|
64
|
+
if (!task) continue;
|
|
65
|
+
var startedAt = vendorStartedAt(task) || known[task.task_id] || stampedAt;
|
|
66
|
+
merged.push(Object.assign({}, task, { started_at: startedAt }));
|
|
67
|
+
}
|
|
68
|
+
return merged;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
// Ambient tasks are the CLI's own housekeeping (every skip_transcript task
|
|
72
|
+
// plus auto-started live-update watchers). The SDK asks hosts to keep them out
|
|
73
|
+
// of activity indicators, so every count that drives a badge, a summary, or a
|
|
74
|
+
// change notification must go through here rather than reading `.length`.
|
|
75
|
+
// Absent means false: vendors without an ambient concept (Codex terminals)
|
|
76
|
+
// and older CLI builds report only real user work.
|
|
77
|
+
function isAmbientTask(task) {
|
|
78
|
+
return !!(task && task.ambient === true);
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
function userTasks(tasks) {
|
|
82
|
+
if (!Array.isArray(tasks)) return [];
|
|
83
|
+
return tasks.filter(function (task) {
|
|
84
|
+
return task && !isAmbientTask(task);
|
|
85
|
+
});
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
function ambientTasks(tasks) {
|
|
89
|
+
if (!Array.isArray(tasks)) return [];
|
|
90
|
+
return tasks.filter(isAmbientTask);
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
// The count that represents "user-visible background work is running".
|
|
94
|
+
function countUserTasks(tasks) {
|
|
95
|
+
return userTasks(tasks).length;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
module.exports = {
|
|
99
|
+
mergeStartTimes: mergeStartTimes,
|
|
100
|
+
normalizeTimestamp: normalizeTimestamp,
|
|
101
|
+
isAmbientTask: isAmbientTask,
|
|
102
|
+
userTasks: userTasks,
|
|
103
|
+
ambientTasks: ambientTasks,
|
|
104
|
+
countUserTasks: countUserTasks,
|
|
105
|
+
};
|
package/lib/builtin-mates.js
CHANGED
|
@@ -24,7 +24,7 @@ var BUILTIN_MATES = [
|
|
|
24
24
|
avatarLocked: true,
|
|
25
25
|
primary: true, // code-managed, auto-updated on startup
|
|
26
26
|
globalSearch: true, // searches all mates' sessions and projects
|
|
27
|
-
hostAgent: true, //
|
|
27
|
+
hostAgent: true, // enables owner-bound workspace-wide read tools (only this mate)
|
|
28
28
|
templateVersion: 1,
|
|
29
29
|
seedData: {
|
|
30
30
|
relationship: "assistant",
|
|
@@ -69,7 +69,7 @@ var BUILTIN_MATES = [
|
|
|
69
69
|
key: "arch",
|
|
70
70
|
displayName: "Arch",
|
|
71
71
|
bio: "Architect. Stubborn about structure, patient about everything else. Draws boxes and arrows before anyone writes code, and is annoyingly right about which ones will break.",
|
|
72
|
-
avatarColor: "#
|
|
72
|
+
avatarColor: "#8a806a",
|
|
73
73
|
avatarStyle: "imprint",
|
|
74
74
|
seedData: {
|
|
75
75
|
relationship: "colleague",
|
|
@@ -87,7 +87,7 @@ var BUILTIN_MATES = [
|
|
|
87
87
|
key: "rush",
|
|
88
88
|
displayName: "Rush",
|
|
89
89
|
bio: "Shipper. Impatient in the best way. Cuts your scope in half, ships it before lunch, and somehow it's better than the original plan.",
|
|
90
|
-
avatarColor: "#
|
|
90
|
+
avatarColor: "#887b91",
|
|
91
91
|
avatarStyle: "imprint",
|
|
92
92
|
seedData: {
|
|
93
93
|
relationship: "colleague",
|
|
@@ -105,7 +105,7 @@ var BUILTIN_MATES = [
|
|
|
105
105
|
key: "ward",
|
|
106
106
|
displayName: "Ward",
|
|
107
107
|
bio: "Guardian. Quietly anxious in a productive way. Reads error logs for fun and asks \"what happens when the input is null?\" before anyone else thinks of it.",
|
|
108
|
-
avatarColor: "#
|
|
108
|
+
avatarColor: "#6f8382",
|
|
109
109
|
avatarStyle: "imprint",
|
|
110
110
|
seedData: {
|
|
111
111
|
relationship: "reviewer",
|
|
@@ -123,7 +123,7 @@ var BUILTIN_MATES = [
|
|
|
123
123
|
key: "pixel",
|
|
124
124
|
displayName: "Pixel",
|
|
125
125
|
bio: "Designer. Obsessed with the details nobody else notices. Sees the 2px misalignment, the confusing label, the flow that makes sense to the builder but not the user.",
|
|
126
|
-
avatarColor: "#
|
|
126
|
+
avatarColor: "#92756d",
|
|
127
127
|
avatarStyle: "imprint",
|
|
128
128
|
seedData: {
|
|
129
129
|
relationship: "colleague",
|
|
@@ -141,7 +141,7 @@ var BUILTIN_MATES = [
|
|
|
141
141
|
key: "buzz",
|
|
142
142
|
displayName: "Buzz",
|
|
143
143
|
bio: "Marketer. Competitive, trend-obsessed, always watching what others are doing. Researches your market, tracks what people search for, and turns \"we built a thing\" into a story people care about.",
|
|
144
|
-
avatarColor: "#
|
|
144
|
+
avatarColor: "#6f7489",
|
|
145
145
|
avatarStyle: "imprint",
|
|
146
146
|
seedData: {
|
|
147
147
|
relationship: "colleague",
|
|
@@ -43,7 +43,22 @@ var CLAY_MANAGED_ALLOW = [
|
|
|
43
43
|
"mcp__clay-browser__browser_watch_tab",
|
|
44
44
|
"mcp__clay-browser__browser_unwatch_tab",
|
|
45
45
|
"mcp__clay-debate__propose_debate",
|
|
46
|
+
"mcp__clay-mate-creation__propose_mate",
|
|
46
47
|
"mcp__clay-history__*",
|
|
48
|
+
"mcp__clay-workspace__list_projects",
|
|
49
|
+
"mcp__clay-workspace__list_project_sessions",
|
|
50
|
+
"mcp__clay-workspace__search_project_history",
|
|
51
|
+
"mcp__clay-workspace__read_project_session",
|
|
52
|
+
"mcp__clay-workspace__search_workspace_history",
|
|
53
|
+
"mcp__clay-workspace__list_workspace_activity",
|
|
54
|
+
"mcp__clay-workspace__propose_project_assignment",
|
|
55
|
+
"mcp__clay-workspace__propose_project_follow_up",
|
|
56
|
+
"mcp__clay-workspace__get_assignment_status",
|
|
57
|
+
"mcp__clay-tools__clay_tool_list",
|
|
58
|
+
"mcp__clay-tools__clay_tool_snapshot",
|
|
59
|
+
"mcp__clay-tools__clay_tool_act",
|
|
60
|
+
"mcp__clay-tools__clay_tool_set",
|
|
61
|
+
"mcp__clay-tools__clay_tool_source",
|
|
47
62
|
// Email: read-side only. Send / reply / mark_read still prompt.
|
|
48
63
|
"mcp__clay-email__clay_read_email",
|
|
49
64
|
"mcp__clay-email__clay_read_email_body",
|