clay-server 4.0.0-beta.2 → 4.0.0-beta.21
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/background-task-timing.js +105 -0
- package/lib/capsule-display-floor.js +51 -0
- package/lib/capsule-frame-server.js +255 -0
- package/lib/capsule-mate-turn.js +105 -0
- package/lib/capsule-pig-logic.js +300 -0
- package/lib/capsule-server-runtimes.js +39 -0
- package/lib/capsules/pig/display.js +198 -0
- package/lib/capsules/pig/manifest.json +9 -0
- package/lib/capsules/pig/ui.json +84 -0
- package/lib/config.js +25 -1
- package/lib/daemon-projects.js +13 -8
- package/lib/daemon.js +127 -14
- package/lib/git-cli.js +95 -1
- package/lib/knowledge-import.js +436 -0
- package/lib/knowledge-record-store.js +188 -0
- package/lib/knowledge-search.js +240 -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/migrate-single-user.js +2 -0
- package/lib/notes-lifecycle.js +149 -0
- package/lib/notes.js +60 -3
- package/lib/os-users.js +3 -1
- package/lib/project-capsule-catalog.js +9 -1
- package/lib/project-capsule-turn.js +96 -0
- package/lib/project-connection.js +14 -1
- package/lib/project-http.js +15 -1
- package/lib/project-knowledge.js +22 -0
- package/lib/project-log-context.js +172 -0
- package/lib/project-log-feedback-delivery.js +118 -0
- package/lib/project-logs-comments.js +137 -0
- package/lib/project-logs-context-state.js +42 -0
- package/lib/project-logs-mcp-server.js +328 -0
- package/lib/project-logs-query.js +185 -0
- package/lib/project-logs-root.js +75 -0
- package/lib/project-logs-schema.js +259 -0
- package/lib/project-logs-service.js +463 -0
- package/lib/project-logs-snapshot.js +205 -0
- package/lib/project-logs-store.js +495 -0
- package/lib/project-logs-versioning.js +132 -0
- package/lib/project-logs.js +400 -0
- package/lib/project-mate-interaction.js +14 -0
- package/lib/project-mate-knowledge.js +110 -0
- package/lib/project-memory.js +22 -0
- package/lib/project-message-delivery.js +70 -0
- package/lib/project-pair-lifecycle.js +460 -0
- package/lib/project-session-handoff.js +1 -1
- package/lib/project-session-notes.js +64 -13
- package/lib/project-session-pair.js +159 -146
- package/lib/project-session-spawn.js +1 -1
- package/lib/project-sessions.js +58 -13
- package/lib/project-user-message.js +53 -4
- package/lib/project-vendor-login.js +20 -3
- package/lib/project-worker-permission.js +430 -0
- package/lib/project-worker-proposal.js +208 -62
- package/lib/project.js +178 -6
- package/lib/public/app.js +58 -35
- package/lib/public/css/admin.css +2 -2
- package/lib/public/css/capsule-ui.css +38 -0
- package/lib/public/css/command-palette.css +19 -9
- package/lib/public/css/git-placard.css +154 -0
- package/lib/public/css/home-hub.css +4 -0
- package/lib/public/css/home-session-actions.css +66 -0
- package/lib/public/css/home-sidebar.css +66 -0
- package/lib/public/css/input.css +163 -28
- package/lib/public/css/mobile-nav.css +80 -0
- package/lib/public/css/notifications-center.css +67 -0
- package/lib/public/css/pane.css +52 -0
- package/lib/public/css/project-logs.css +198 -0
- package/lib/public/css/scheduler.css +1 -1
- package/lib/public/css/session-actions.css +16 -101
- package/lib/public/css/sidebar.css +103 -0
- package/lib/public/css/sticky-notes.css +237 -229
- package/lib/public/css/worker-proposal.css +34 -1
- package/lib/public/index.html +45 -11
- package/lib/public/modules/admin.js +8 -8
- package/lib/public/modules/app-connection.js +109 -4
- package/lib/public/modules/app-home-hub.js +19 -7
- package/lib/public/modules/app-message-cards.js +2 -1
- package/lib/public/modules/app-messages.js +84 -7
- package/lib/public/modules/app-misc.js +2 -14
- package/lib/public/modules/app-notifications.js +11 -7
- package/lib/public/modules/app-panels.js +46 -4
- package/lib/public/modules/app-projects.js +13 -8
- package/lib/public/modules/app-rendering.js +1 -0
- package/lib/public/modules/background-tasks-ui.js +139 -16
- package/lib/public/modules/capsule-preference.js +44 -0
- package/lib/public/modules/chat-bubble-renderer.js +1 -1
- package/lib/public/modules/clay-log-links.js +70 -0
- package/lib/public/modules/command-palette.js +52 -15
- package/lib/public/modules/context-sources.js +0 -3
- package/lib/public/modules/git-agent-sessions.js +85 -0
- package/lib/public/modules/git-panel.js +111 -84
- package/lib/public/modules/git-placard.js +161 -0
- package/lib/public/modules/home-chat-empty-state.js +39 -0
- package/lib/public/modules/home-chat-identity.js +9 -0
- package/lib/public/modules/home-conversations-sheet.js +102 -48
- package/lib/public/modules/home-mate-chat.js +15 -35
- package/lib/public/modules/home-session-actions.js +6 -0
- package/lib/public/modules/home-sidebar-chat-list.js +101 -41
- package/lib/public/modules/home-sidebar.js +7 -0
- package/lib/public/modules/home-tool-frame.js +182 -0
- package/lib/public/modules/home-tools.js +138 -1
- package/lib/public/modules/input.js +38 -7
- package/lib/public/modules/markdown.js +2 -0
- package/lib/public/modules/mate-sidebar.js +0 -8
- package/lib/public/modules/message-delivery.js +97 -0
- package/lib/public/modules/paste-modal.js +84 -0
- package/lib/public/modules/project-logs-render.js +405 -0
- package/lib/public/modules/project-logs.js +461 -0
- package/lib/public/modules/project-removal-target.js +26 -0
- package/lib/public/modules/scheduler.js +17 -3
- package/lib/public/modules/session-actions.js +29 -105
- package/lib/public/modules/session-hierarchy.js +54 -0
- package/lib/public/modules/sidebar-mobile.js +40 -15
- package/lib/public/modules/sidebar-session-hierarchy.js +214 -0
- package/lib/public/modules/sidebar-sessions.js +77 -11
- package/lib/public/modules/sidebar.js +17 -5
- package/lib/public/modules/split-group-helpers.js +8 -0
- package/lib/public/modules/split-view.js +5 -2
- package/lib/public/modules/sticky-note-markdown.js +5 -0
- package/lib/public/modules/sticky-notes-browser.js +326 -0
- package/lib/public/modules/sticky-notes-card.js +360 -0
- package/lib/public/modules/sticky-notes-editor.js +291 -0
- package/lib/public/modules/sticky-notes-shared.js +90 -0
- package/lib/public/modules/sticky-notes.js +170 -946
- package/lib/public/modules/tool-palette-order.js +143 -0
- package/lib/public/modules/tool-palette-overlays.js +159 -0
- package/lib/public/modules/tool-palette.js +21 -188
- package/lib/public/modules/tools.js +21 -1
- package/lib/public/modules/update-snooze.js +169 -0
- package/lib/public/modules/user-settings.js +4 -0
- package/lib/public/modules/worker-pane-lock.js +176 -0
- package/lib/public/modules/worker-proposal-state.js +16 -0
- package/lib/public/modules/worker-proposal.js +49 -12
- package/lib/public/style.css +3 -1
- package/lib/sdk-bridge.js +132 -46
- package/lib/sdk-message-processor.js +60 -14
- package/lib/server-experimental-settings.js +49 -0
- package/lib/server-global-ws.js +11 -0
- package/lib/server-home-chat-events.js +31 -1
- package/lib/server-home-chat.js +27 -4
- package/lib/server-home-clay-entry.js +1 -1
- package/lib/server-home-clay-session-links.js +34 -5
- package/lib/server-settings.js +5 -0
- package/lib/server-tools.js +127 -9
- package/lib/server.js +124 -18
- package/lib/session-driver-eligibility.js +38 -0
- package/lib/session-driver-orchestration.js +31 -0
- package/lib/session-hygiene.js +3 -0
- package/lib/session-notes-mcp-server.js +25 -5
- package/lib/session-pair-factory.js +247 -0
- package/lib/session-pair-mcp-server.js +46 -8
- package/lib/session-pair-prompts.js +79 -0
- package/lib/session-pair-turn-control.js +153 -0
- package/lib/session-provenance.js +119 -0
- package/lib/session-spawn-mcp-server.js +1 -1
- package/lib/session-split-groups.js +4 -1
- package/lib/session-title-policy.js +60 -0
- package/lib/session-visibility.js +39 -0
- package/lib/sessions.js +61 -11
- package/lib/tools-registry.js +89 -10
- package/lib/update-snooze.js +437 -0
- package/lib/users-experimental-preferences.js +30 -0
- package/lib/users-permissions.js +2 -2
- package/lib/users.js +22 -16
- package/lib/workspace-query-access.js +102 -0
- package/lib/workspace-query-service.js +24 -17
- package/lib/worktree.js +25 -38
- package/lib/ws-schema.js +38 -7
- package/lib/yoke/adapters/claude-worker.js +16 -6
- package/lib/yoke/adapters/claude.js +81 -4
- package/lib/yoke/adapters/codex.js +63 -15
- package/lib/yoke/codex-background-tasks.js +8 -2
- package/lib/yoke/vendor-registry.js +1 -1
- package/package.json +3 -3
|
@@ -12,6 +12,38 @@ var { resolveOsUserInfo } = require("../../os-users");
|
|
|
12
12
|
var backgroundTasks = require("../codex-background-tasks");
|
|
13
13
|
var codexUserInput = require("../codex-user-input");
|
|
14
14
|
|
|
15
|
+
// --- Reasoning defaults ---
|
|
16
|
+
// Reasoning summaries are the only readable thinking channel Codex offers:
|
|
17
|
+
// raw reasoning content is encrypted for ChatGPT-authenticated models, so the
|
|
18
|
+
// item/reasoning/* events this adapter already maps to thinking only carry
|
|
19
|
+
// text when the app-server is asked for summaries. The CLI default
|
|
20
|
+
// (`model_reasoning_summary = "auto"`) frequently produces none at all, and the
|
|
21
|
+
// app-server otherwise inherits whatever is in the user's ~/.codex/config.toml,
|
|
22
|
+
// so Clay asks for detailed summaries explicitly.
|
|
23
|
+
//
|
|
24
|
+
// `show_raw_agent_reasoning` is deliberately absent: it is encrypted on
|
|
25
|
+
// ChatGPT-auth models and noisy elsewhere, so it stays a user opt-in.
|
|
26
|
+
// Everything here is overridable via adapterOptions.CODEX.config.
|
|
27
|
+
var CODEX_REASONING_DEFAULTS = {
|
|
28
|
+
model_reasoning_summary: "detailed",
|
|
29
|
+
model_supports_reasoning_summaries: true,
|
|
30
|
+
};
|
|
31
|
+
var DEFAULT_CODEX_MODEL = "gpt-6-astra";
|
|
32
|
+
var CODEX_NOTE_TOOLS = {
|
|
33
|
+
list_notes: true,
|
|
34
|
+
write_note: true,
|
|
35
|
+
close_note: true,
|
|
36
|
+
reopen_note: true,
|
|
37
|
+
remove_note: true,
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
function canonicalDynamicPermissionToolName(toolName) {
|
|
41
|
+
if (CODEX_NOTE_TOOLS[toolName]) return "mcp__clay-notes__" + toolName;
|
|
42
|
+
if (toolName === "send_to_partner" || toolName === "read_partner") return "mcp__clay-sessions__" + toolName;
|
|
43
|
+
if (toolName === "present_markdown_edit") return "mcp__clay-documents__" + toolName;
|
|
44
|
+
return toolName;
|
|
45
|
+
}
|
|
46
|
+
|
|
15
47
|
// --- Event flattening ---
|
|
16
48
|
// Converts app-server JSON-RPC notifications into flat objects with a yokeType field.
|
|
17
49
|
//
|
|
@@ -706,7 +738,7 @@ function createEventState(model) {
|
|
|
706
738
|
done: false,
|
|
707
739
|
aborted: false,
|
|
708
740
|
loopStarted: false,
|
|
709
|
-
model: model ||
|
|
741
|
+
model: model || DEFAULT_CODEX_MODEL,
|
|
710
742
|
textBlocks: {},
|
|
711
743
|
textLengths: {},
|
|
712
744
|
thinkingBlocks: {},
|
|
@@ -895,14 +927,7 @@ function createCodexQueryHandle(appServer, queryOpts) {
|
|
|
895
927
|
appServer.respond(msg.id, { contentItems: contentItems, success: !(result && result.isError) });
|
|
896
928
|
});
|
|
897
929
|
}
|
|
898
|
-
var permissionToolName = dynamicParams.tool;
|
|
899
|
-
if (permissionToolName === "list_notes" || permissionToolName === "write_note" || permissionToolName === "remove_note") {
|
|
900
|
-
permissionToolName = "mcp__clay-notes__" + permissionToolName;
|
|
901
|
-
} else if (permissionToolName === "send_to_partner" || permissionToolName === "read_partner") {
|
|
902
|
-
permissionToolName = "mcp__clay-sessions__" + permissionToolName;
|
|
903
|
-
} else if (permissionToolName === "present_markdown_edit") {
|
|
904
|
-
permissionToolName = "mcp__clay-documents__" + permissionToolName;
|
|
905
|
-
}
|
|
930
|
+
var permissionToolName = canonicalDynamicPermissionToolName(dynamicParams.tool);
|
|
906
931
|
var permission = canUseTool
|
|
907
932
|
? Promise.resolve(canUseTool(permissionToolName, dynamicParams.arguments || {}, {
|
|
908
933
|
toolUseID: dynamicParams.callId || String(msg.id),
|
|
@@ -1056,7 +1081,7 @@ function createCodexQueryHandle(appServer, queryOpts) {
|
|
|
1056
1081
|
|
|
1057
1082
|
// Start or resume thread
|
|
1058
1083
|
var threadParams = {
|
|
1059
|
-
model: queryOpts.model ||
|
|
1084
|
+
model: queryOpts.model || DEFAULT_CODEX_MODEL,
|
|
1060
1085
|
sandbox: queryOpts.sandboxMode || "workspace-write",
|
|
1061
1086
|
approvalPolicy: queryOpts.approvalPolicy || "on-request",
|
|
1062
1087
|
cwd: queryOpts.cwd,
|
|
@@ -1224,7 +1249,7 @@ function createCodexQueryHandle(appServer, queryOpts) {
|
|
|
1224
1249
|
},
|
|
1225
1250
|
|
|
1226
1251
|
setModel: function(model) {
|
|
1227
|
-
state.model = model ||
|
|
1252
|
+
state.model = model || DEFAULT_CODEX_MODEL;
|
|
1228
1253
|
return Promise.resolve();
|
|
1229
1254
|
},
|
|
1230
1255
|
|
|
@@ -1313,9 +1338,10 @@ function createCodexAdapter(opts) {
|
|
|
1313
1338
|
// slow/failed `initialize` leaves the picker empty and the chip shows the
|
|
1314
1339
|
// previous vendor's model.
|
|
1315
1340
|
// Kept in sync with what `model/list` reports for the bundled codex build
|
|
1316
|
-
// (0.
|
|
1341
|
+
// (0.153.4). Models the CLI no longer offers are rejected at turn/start, so
|
|
1317
1342
|
// listing them would only surface a runtime failure in the model picker.
|
|
1318
1343
|
var CODEX_MODELS = [
|
|
1344
|
+
"gpt-6-astra",
|
|
1319
1345
|
"gpt-5.6-terra",
|
|
1320
1346
|
"gpt-5.6-sol",
|
|
1321
1347
|
"gpt-5.6-luna",
|
|
@@ -1413,7 +1439,7 @@ function createCodexAdapter(opts) {
|
|
|
1413
1439
|
function buildReadyResponse(skillNames) {
|
|
1414
1440
|
return {
|
|
1415
1441
|
models: _cachedModels,
|
|
1416
|
-
defaultModel:
|
|
1442
|
+
defaultModel: DEFAULT_CODEX_MODEL,
|
|
1417
1443
|
skills: skillNames || [],
|
|
1418
1444
|
slashCommands: skillNames || [],
|
|
1419
1445
|
fastModeState: null,
|
|
@@ -1567,12 +1593,16 @@ function createCodexAdapter(opts) {
|
|
|
1567
1593
|
serverOpts.osUserInfo = _resolveOsUserInfo(_runtimeLinuxUser);
|
|
1568
1594
|
}
|
|
1569
1595
|
|
|
1596
|
+
// Clay's config defaults go in first so any user-supplied
|
|
1597
|
+
// adapterOptions.CODEX.config key of the same name overrides them.
|
|
1598
|
+
serverOpts.config = Object.assign({}, CODEX_REASONING_DEFAULTS);
|
|
1599
|
+
|
|
1570
1600
|
// Extract adapter options
|
|
1571
1601
|
if (effectiveInitOpts && effectiveInitOpts.adapterOptions && effectiveInitOpts.adapterOptions.CODEX) {
|
|
1572
1602
|
var co = effectiveInitOpts.adapterOptions.CODEX;
|
|
1573
1603
|
if (co.apiKey) serverOpts.env = Object.assign({}, serverOpts.env || {}, { OPENAI_API_KEY: co.apiKey });
|
|
1574
1604
|
if (co.baseUrl) serverOpts.env = Object.assign({}, serverOpts.env || {}, { OPENAI_BASE_URL: co.baseUrl });
|
|
1575
|
-
if (co.config) serverOpts.config = co.config;
|
|
1605
|
+
if (co.config) serverOpts.config = Object.assign(serverOpts.config, co.config);
|
|
1576
1606
|
}
|
|
1577
1607
|
|
|
1578
1608
|
// Track 1: Read local MCP server definitions from ~/.clay/mcp.json
|
|
@@ -1746,7 +1776,7 @@ function createCodexAdapter(opts) {
|
|
|
1746
1776
|
throw new Error("[yoke/codex] Adapter not initialized. Call init() first.");
|
|
1747
1777
|
}
|
|
1748
1778
|
|
|
1749
|
-
var model = queryOpts.model ||
|
|
1779
|
+
var model = queryOpts.model || DEFAULT_CODEX_MODEL;
|
|
1750
1780
|
var ac = queryOpts.abortController || new AbortController();
|
|
1751
1781
|
var activeEntry = {
|
|
1752
1782
|
abort: function() {
|
|
@@ -1922,6 +1952,23 @@ function createCodexAdapter(opts) {
|
|
|
1922
1952
|
]).then(function() { return true; });
|
|
1923
1953
|
},
|
|
1924
1954
|
|
|
1955
|
+
// A device login writes credentials for one OS identity. Refresh only
|
|
1956
|
+
// that identity in OS-isolated deployments; single-user projects restart
|
|
1957
|
+
// their sole app-server.
|
|
1958
|
+
refreshAuthIdentity: function(linuxUser) {
|
|
1959
|
+
if (!_runtimeLinuxUser && linuxUser) {
|
|
1960
|
+
var userRuntime = _userRuntimes[linuxUser];
|
|
1961
|
+
if (!userRuntime) return Promise.resolve(false);
|
|
1962
|
+
return userRuntime.shutdown().then(function() {
|
|
1963
|
+
delete _userRuntimes[linuxUser];
|
|
1964
|
+
return true;
|
|
1965
|
+
});
|
|
1966
|
+
}
|
|
1967
|
+
if (_runtimeLinuxUser && linuxUser !== _runtimeLinuxUser) return Promise.resolve(false);
|
|
1968
|
+
if (_requiresLinuxUser) return Promise.resolve(false);
|
|
1969
|
+
return adapter.shutdown();
|
|
1970
|
+
},
|
|
1971
|
+
|
|
1925
1972
|
shutdownIfIdle: function(idleMs) {
|
|
1926
1973
|
if (!_runtimeLinuxUser && Object.keys(_userRuntimes).length > 0) {
|
|
1927
1974
|
return shutdownUserRuntimes("shutdownIfIdle", idleMs).then(function(results) {
|
|
@@ -1946,6 +1993,7 @@ function createCodexAdapter(opts) {
|
|
|
1946
1993
|
module.exports = {
|
|
1947
1994
|
createCodexAdapter: createCodexAdapter,
|
|
1948
1995
|
contractTestKit: {
|
|
1996
|
+
canonicalDynamicPermissionToolName: canonicalDynamicPermissionToolName,
|
|
1949
1997
|
createEventState: createEventState,
|
|
1950
1998
|
createQueryHandle: createCodexQueryHandle,
|
|
1951
1999
|
normalizeEvent: flattenEvent,
|
|
@@ -19,11 +19,17 @@ function mapTerminals(result) {
|
|
|
19
19
|
var terminal = terminals[i] || {};
|
|
20
20
|
var taskId = terminal.id || terminal.terminalId || terminal.taskId || "";
|
|
21
21
|
if (!taskId || !isLiveTerminal(terminal)) continue;
|
|
22
|
-
|
|
22
|
+
var task = {
|
|
23
23
|
task_id: String(taskId),
|
|
24
24
|
task_type: "shell",
|
|
25
25
|
description: terminal.commandLine || terminal.command || terminal.name || "",
|
|
26
|
-
}
|
|
26
|
+
};
|
|
27
|
+
// Forward the terminal's own start time when the app-server reports one,
|
|
28
|
+
// so elapsed time survives a Clay restart. Falls back to first-seen
|
|
29
|
+
// stamping in background-task-timing.js when absent.
|
|
30
|
+
var startedAt = terminal.startedAt || terminal.started_at || terminal.createdAt || terminal.created_at;
|
|
31
|
+
if (startedAt) task.started_at = startedAt;
|
|
32
|
+
tasks.push(task);
|
|
27
33
|
}
|
|
28
34
|
return tasks;
|
|
29
35
|
}
|
|
@@ -32,7 +32,7 @@ var VENDOR_REGISTRY = {
|
|
|
32
32
|
binaryName: "codex",
|
|
33
33
|
avatar: "/codex-avatar.png",
|
|
34
34
|
sessionModes: ["gui"],
|
|
35
|
-
effortLevels: ["
|
|
35
|
+
effortLevels: ["low", "medium", "high", "xhigh", "max"],
|
|
36
36
|
osUserIsolation: true,
|
|
37
37
|
sessionBoundTools: false,
|
|
38
38
|
usageDashboard: {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "clay-server",
|
|
3
|
-
"version": "4.0.0-beta.
|
|
3
|
+
"version": "4.0.0-beta.21",
|
|
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",
|
|
@@ -49,9 +49,9 @@
|
|
|
49
49
|
"homepage": "https://github.com/chadbyte/clay#readme",
|
|
50
50
|
"author": "Chad",
|
|
51
51
|
"dependencies": {
|
|
52
|
-
"@anthropic-ai/claude-agent-sdk": "^0.3.
|
|
52
|
+
"@anthropic-ai/claude-agent-sdk": "^0.3.258",
|
|
53
53
|
"@lydell/node-pty": "^1.2.0-beta.3",
|
|
54
|
-
"@openai/codex": "^0.
|
|
54
|
+
"@openai/codex": "^0.153.4",
|
|
55
55
|
"@seald-io/nedb": "^4.1.2",
|
|
56
56
|
"imapflow": "^1.3.1",
|
|
57
57
|
"nodemailer": "^9.0.5",
|