@clagentic/console 1.0.0-beta.1
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/CREDITS.md +3 -0
- package/LICENSE +21 -0
- package/README.md +250 -0
- package/bin/cli.js +2812 -0
- package/lib/agents-favorites.js +164 -0
- package/lib/agents.js +282 -0
- package/lib/ask-user-mcp-server.js +120 -0
- package/lib/browser-mcp-server.js +484 -0
- package/lib/build-user-env.js +63 -0
- package/lib/certs/fullchain.pem +47 -0
- package/lib/certs/privkey.pem +5 -0
- package/lib/cli-sessions.js +265 -0
- package/lib/codex-defaults.js +18 -0
- package/lib/config.js +332 -0
- package/lib/crisis-safety.js +60 -0
- package/lib/daemon-projects.js +164 -0
- package/lib/daemon.js +1602 -0
- package/lib/dm.js +128 -0
- package/lib/ipc.js +125 -0
- package/lib/ipv4-only.js +39 -0
- package/lib/mcp-local.js +385 -0
- package/lib/notes.js +141 -0
- package/lib/os-users.js +529 -0
- package/lib/pages.js +1325 -0
- package/lib/project-connection.js +302 -0
- package/lib/project-external-trigger.js +236 -0
- package/lib/project-file-watch.js +120 -0
- package/lib/project-filesystem.js +528 -0
- package/lib/project-http.js +753 -0
- package/lib/project-image.js +95 -0
- package/lib/project-knowledge.js +88 -0
- package/lib/project-loop.js +1304 -0
- package/lib/project-mcp.js +374 -0
- package/lib/project-memory.js +39 -0
- package/lib/project-notifications.js +262 -0
- package/lib/project-sessions.js +1581 -0
- package/lib/project-user-mention.js +193 -0
- package/lib/project-user-message.js +628 -0
- package/lib/project.js +1303 -0
- package/lib/public/app.js +1031 -0
- package/lib/public/apple-touch-icon.png +0 -0
- package/lib/public/claude-code-avatar.png +0 -0
- package/lib/public/codex-avatar.png +0 -0
- package/lib/public/console-icon.png +0 -0
- package/lib/public/css/admin.css +736 -0
- package/lib/public/css/agent-picker.css +119 -0
- package/lib/public/css/base.css +235 -0
- package/lib/public/css/channel-layout.css +441 -0
- package/lib/public/css/command-palette.css +559 -0
- package/lib/public/css/debate.css +1609 -0
- package/lib/public/css/diff.css +139 -0
- package/lib/public/css/filebrowser.css +1976 -0
- package/lib/public/css/highlight.css +144 -0
- package/lib/public/css/home-hub.css +545 -0
- package/lib/public/css/icon-strip.css +1856 -0
- package/lib/public/css/input.css +1349 -0
- package/lib/public/css/loop.css +1248 -0
- package/lib/public/css/mention.css +317 -0
- package/lib/public/css/menus.css +857 -0
- package/lib/public/css/messages.css +1833 -0
- package/lib/public/css/mobile-nav.css +1332 -0
- package/lib/public/css/notifications-center.css +296 -0
- package/lib/public/css/overlays.css +1273 -0
- package/lib/public/css/playbook.css +264 -0
- package/lib/public/css/profile.css +397 -0
- package/lib/public/css/rewind.css +671 -0
- package/lib/public/css/scheduler-modal.css +1495 -0
- package/lib/public/css/scheduler.css +1420 -0
- package/lib/public/css/server-settings.css +909 -0
- package/lib/public/css/session-search.css +159 -0
- package/lib/public/css/sidebar.css +2012 -0
- package/lib/public/css/skills.css +789 -0
- package/lib/public/css/sticky-notes.css +854 -0
- package/lib/public/css/stt.css +155 -0
- package/lib/public/css/title-bar.css +674 -0
- package/lib/public/css/tooltip.css +67 -0
- package/lib/public/css/user-settings.css +702 -0
- package/lib/public/emoji-data.json +1 -0
- package/lib/public/favicon-banded-32.png +0 -0
- package/lib/public/favicon-banded.png +0 -0
- package/lib/public/favicon-dark.svg +32 -0
- package/lib/public/favicon.svg +32 -0
- package/lib/public/icon-192.png +0 -0
- package/lib/public/icon-512.png +0 -0
- package/lib/public/icon-banded-76.png +0 -0
- package/lib/public/icon-banded-96.png +0 -0
- package/lib/public/icon-mono.svg +25 -0
- package/lib/public/icons/email/gmail.svg +7 -0
- package/lib/public/icons/email/outlook.svg +35 -0
- package/lib/public/icons/email/yahoo.svg +1 -0
- package/lib/public/index.html +1946 -0
- package/lib/public/manifest.json +27 -0
- package/lib/public/markdown-worker.js +43 -0
- package/lib/public/marked.min.js +6 -0
- package/lib/public/modules/admin.js +954 -0
- package/lib/public/modules/agent-picker.js +429 -0
- package/lib/public/modules/app-connection.js +216 -0
- package/lib/public/modules/app-cursors.js +492 -0
- package/lib/public/modules/app-dm.js +265 -0
- package/lib/public/modules/app-favicon.js +231 -0
- package/lib/public/modules/app-header.js +242 -0
- package/lib/public/modules/app-home-hub.js +432 -0
- package/lib/public/modules/app-loop-ui.js +691 -0
- package/lib/public/modules/app-loop-wizard.js +439 -0
- package/lib/public/modules/app-messages.js +1415 -0
- package/lib/public/modules/app-misc.js +463 -0
- package/lib/public/modules/app-notifications.js +651 -0
- package/lib/public/modules/app-panels.js +1061 -0
- package/lib/public/modules/app-projects.js +875 -0
- package/lib/public/modules/app-rate-limit.js +529 -0
- package/lib/public/modules/app-rendering.js +739 -0
- package/lib/public/modules/app-skills-install.js +285 -0
- package/lib/public/modules/avatar.js +36 -0
- package/lib/public/modules/command-palette.js +491 -0
- package/lib/public/modules/console-logo.js +162 -0
- package/lib/public/modules/context-sources.js +365 -0
- package/lib/public/modules/diff.js +412 -0
- package/lib/public/modules/dom-refs.js +21 -0
- package/lib/public/modules/emoji-picker.js +222 -0
- package/lib/public/modules/events.js +21 -0
- package/lib/public/modules/filebrowser.js +1966 -0
- package/lib/public/modules/fileicons.js +172 -0
- package/lib/public/modules/icons.js +80 -0
- package/lib/public/modules/input.js +1102 -0
- package/lib/public/modules/longpress.js +74 -0
- package/lib/public/modules/markdown.js +486 -0
- package/lib/public/modules/mcp-ui.js +295 -0
- package/lib/public/modules/mention.js +1093 -0
- package/lib/public/modules/notifications.js +613 -0
- package/lib/public/modules/playbook.js +578 -0
- package/lib/public/modules/profile.js +594 -0
- package/lib/public/modules/project-settings.js +849 -0
- package/lib/public/modules/project-switcher.js +375 -0
- package/lib/public/modules/qrcode.js +87 -0
- package/lib/public/modules/rewind.js +381 -0
- package/lib/public/modules/scheduler-config.js +1611 -0
- package/lib/public/modules/scheduler-history.js +131 -0
- package/lib/public/modules/scheduler.js +1689 -0
- package/lib/public/modules/server-settings.js +842 -0
- package/lib/public/modules/session-search.js +456 -0
- package/lib/public/modules/settings-defaults.js +253 -0
- package/lib/public/modules/sidebar-mobile.js +1425 -0
- package/lib/public/modules/sidebar-projects.js +2022 -0
- package/lib/public/modules/sidebar-sessions.js +1548 -0
- package/lib/public/modules/sidebar-users.js +449 -0
- package/lib/public/modules/sidebar.js +348 -0
- package/lib/public/modules/skills.js +793 -0
- package/lib/public/modules/state.js +3 -0
- package/lib/public/modules/sticky-notes.js +1221 -0
- package/lib/public/modules/store.js +34 -0
- package/lib/public/modules/stt.js +266 -0
- package/lib/public/modules/terminal.js +987 -0
- package/lib/public/modules/theme.js +812 -0
- package/lib/public/modules/tool-palette.js +562 -0
- package/lib/public/modules/tools.js +2285 -0
- package/lib/public/modules/tooltip.js +150 -0
- package/lib/public/modules/user-settings.js +544 -0
- package/lib/public/modules/utils.js +56 -0
- package/lib/public/modules/ws-ref.js +26 -0
- package/lib/public/style.css +34 -0
- package/lib/public/sw.js +159 -0
- package/lib/push.js +149 -0
- package/lib/scheduler.js +471 -0
- package/lib/sdk-bridge.js +1792 -0
- package/lib/sdk-message-processor.js +740 -0
- package/lib/sdk-message-queue.js +42 -0
- package/lib/sdk-skill-discovery.js +131 -0
- package/lib/sdk-worker.js +677 -0
- package/lib/server-admin.js +712 -0
- package/lib/server-auth.js +737 -0
- package/lib/server-dm.js +170 -0
- package/lib/server-palette.js +104 -0
- package/lib/server-settings.js +553 -0
- package/lib/server-skills.js +280 -0
- package/lib/server.js +1390 -0
- package/lib/session-search.js +693 -0
- package/lib/sessions.js +946 -0
- package/lib/smtp.js +221 -0
- package/lib/terminal-manager.js +219 -0
- package/lib/terminal.js +39 -0
- package/lib/themes/ayu-light.json +9 -0
- package/lib/themes/catppuccin-latte.json +9 -0
- package/lib/themes/catppuccin-mocha.json +9 -0
- package/lib/themes/clagentic-dark.json +10 -0
- package/lib/themes/clagentic-light.json +10 -0
- package/lib/themes/dracula.json +9 -0
- package/lib/themes/everforest-light.json +9 -0
- package/lib/themes/everforest.json +9 -0
- package/lib/themes/github-light.json +9 -0
- package/lib/themes/gruvbox-dark.json +9 -0
- package/lib/themes/gruvbox-light.json +9 -0
- package/lib/themes/monokai.json +9 -0
- package/lib/themes/nord-light.json +9 -0
- package/lib/themes/nord.json +9 -0
- package/lib/themes/one-dark.json +9 -0
- package/lib/themes/one-light.json +9 -0
- package/lib/themes/rose-pine-dawn.json +9 -0
- package/lib/themes/rose-pine.json +9 -0
- package/lib/themes/solarized-dark.json +9 -0
- package/lib/themes/solarized-light.json +9 -0
- package/lib/themes/tokyo-night-light.json +9 -0
- package/lib/themes/tokyo-night.json +9 -0
- package/lib/updater.js +124 -0
- package/lib/user-presence.js +92 -0
- package/lib/users-auth.js +146 -0
- package/lib/users-permissions.js +118 -0
- package/lib/users-preferences.js +254 -0
- package/lib/users.js +465 -0
- package/lib/utils.js +64 -0
- package/lib/worktree.js +134 -0
- package/lib/ws-schema.js +464 -0
- package/lib/yoke/adapters/claude-worker.js +759 -0
- package/lib/yoke/adapters/claude.js +1599 -0
- package/lib/yoke/adapters/codex.js +1559 -0
- package/lib/yoke/codex-app-server.js +352 -0
- package/lib/yoke/index.js +319 -0
- package/lib/yoke/instructions.js +61 -0
- package/lib/yoke/interface.js +98 -0
- package/lib/yoke/mcp-bridge-server.js +302 -0
- package/lib/yoke/package.json +7 -0
- package/package.json +72 -0
|
@@ -0,0 +1,164 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Daemon project helpers -- Worktree tracking, project filtering, config handlers.
|
|
3
|
+
*
|
|
4
|
+
* Extracted from daemon.js to keep module sizes manageable.
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
var fs = require("fs");
|
|
8
|
+
var { scanWorktrees, isWorktree } = require("./worktree");
|
|
9
|
+
|
|
10
|
+
// --- Worktree tracking state ---
|
|
11
|
+
var worktreeRegistry = {}; // parentSlug -> [wtSlug, ...]
|
|
12
|
+
var worktreeTimers = {}; // parentSlug -> intervalId
|
|
13
|
+
var worktreeScanning = {}; // parentSlug -> boolean (mutex)
|
|
14
|
+
|
|
15
|
+
function isWorktreeSlug(slug) {
|
|
16
|
+
return slug.indexOf("--") !== -1;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* Scan a parent project for worktrees and register them with the relay server.
|
|
21
|
+
* @param {object} relay - the relay server instance (has addProject, removeProject, etc.)
|
|
22
|
+
* @param {string} parentPath - absolute path to parent project
|
|
23
|
+
* @param {string} parentSlug - slug of parent project
|
|
24
|
+
* @param {string} parentIcon - icon of parent project
|
|
25
|
+
* @param {string} parentOwnerId - owner user ID
|
|
26
|
+
*/
|
|
27
|
+
function scanAndRegisterWorktrees(relay, parentPath, parentSlug, parentIcon, parentOwnerId) {
|
|
28
|
+
if (isWorktree(parentPath)) return;
|
|
29
|
+
var worktrees = scanWorktrees(parentPath);
|
|
30
|
+
if (worktrees.length === 0) return;
|
|
31
|
+
if (!worktreeRegistry[parentSlug]) worktreeRegistry[parentSlug] = [];
|
|
32
|
+
for (var i = 0; i < worktrees.length; i++) {
|
|
33
|
+
var wt = worktrees[i];
|
|
34
|
+
var wtSlug = parentSlug + "--" + wt.dirName;
|
|
35
|
+
var alreadyRegistered = false;
|
|
36
|
+
for (var j = 0; j < worktreeRegistry[parentSlug].length; j++) {
|
|
37
|
+
if (worktreeRegistry[parentSlug][j] === wtSlug) { alreadyRegistered = true; break; }
|
|
38
|
+
}
|
|
39
|
+
if (alreadyRegistered) continue;
|
|
40
|
+
var wtMeta = { parentSlug: parentSlug, branch: wt.branch || wt.dirName, accessible: wt.accessible };
|
|
41
|
+
relay.addProject(wt.path, wtSlug, wt.branch || wt.dirName, parentIcon, parentOwnerId, wtMeta);
|
|
42
|
+
worktreeRegistry[parentSlug].push(wtSlug);
|
|
43
|
+
console.log("[daemon] Registered worktree:", wtSlug, "->", wt.path, wt.accessible ? "(accessible)" : "(inaccessible)");
|
|
44
|
+
}
|
|
45
|
+
if (!worktreeTimers[parentSlug]) {
|
|
46
|
+
worktreeTimers[parentSlug] = setInterval(function () {
|
|
47
|
+
rescanWorktrees(relay, parentPath, parentSlug, parentIcon, parentOwnerId);
|
|
48
|
+
}, 10000);
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
/**
|
|
53
|
+
* Rescan worktrees for a parent project, adding new and removing stale ones.
|
|
54
|
+
* @param {object} relay - the relay server instance
|
|
55
|
+
* @param {string} parentPath - absolute path to parent project
|
|
56
|
+
* @param {string} parentSlug - slug of parent project
|
|
57
|
+
* @param {string} parentIcon - icon of parent project
|
|
58
|
+
* @param {string} parentOwnerId - owner user ID
|
|
59
|
+
* @param {object} [config] - daemon config (optional, for broadcasting project count)
|
|
60
|
+
*/
|
|
61
|
+
function rescanWorktrees(relay, parentPath, parentSlug, parentIcon, parentOwnerId, config) {
|
|
62
|
+
if (worktreeScanning[parentSlug]) return;
|
|
63
|
+
worktreeScanning[parentSlug] = true;
|
|
64
|
+
try {
|
|
65
|
+
var discovered = scanWorktrees(parentPath);
|
|
66
|
+
var changed = false;
|
|
67
|
+
var existingSlugs = worktreeRegistry[parentSlug] || [];
|
|
68
|
+
var discoveredNames = {};
|
|
69
|
+
for (var i = 0; i < discovered.length; i++) {
|
|
70
|
+
discoveredNames[discovered[i].dirName] = discovered[i];
|
|
71
|
+
}
|
|
72
|
+
for (var di = 0; di < discovered.length; di++) {
|
|
73
|
+
var wt = discovered[di];
|
|
74
|
+
var wtSlug = parentSlug + "--" + wt.dirName;
|
|
75
|
+
var found = false;
|
|
76
|
+
for (var ei = 0; ei < existingSlugs.length; ei++) {
|
|
77
|
+
if (existingSlugs[ei] === wtSlug) { found = true; break; }
|
|
78
|
+
}
|
|
79
|
+
if (!found) {
|
|
80
|
+
var wtMeta = { parentSlug: parentSlug, branch: wt.branch || wt.dirName, accessible: wt.accessible };
|
|
81
|
+
relay.addProject(wt.path, wtSlug, wt.branch || wt.dirName, parentIcon, parentOwnerId, wtMeta);
|
|
82
|
+
if (!worktreeRegistry[parentSlug]) worktreeRegistry[parentSlug] = [];
|
|
83
|
+
worktreeRegistry[parentSlug].push(wtSlug);
|
|
84
|
+
console.log("[daemon] Rescan: added worktree:", wtSlug);
|
|
85
|
+
changed = true;
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
for (var si = existingSlugs.length - 1; si >= 0; si--) {
|
|
89
|
+
var sSlug = existingSlugs[si];
|
|
90
|
+
var dirName = sSlug.split("--").slice(1).join("--");
|
|
91
|
+
if (!discoveredNames[dirName]) {
|
|
92
|
+
relay.removeProject(sSlug);
|
|
93
|
+
existingSlugs.splice(si, 1);
|
|
94
|
+
console.log("[daemon] Rescan: removed stale worktree:", sSlug);
|
|
95
|
+
changed = true;
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
if (changed) {
|
|
99
|
+
relay.broadcastAll({
|
|
100
|
+
type: "projects_updated",
|
|
101
|
+
projects: relay.getProjects(),
|
|
102
|
+
projectCount: config ? config.projects.length : 0,
|
|
103
|
+
});
|
|
104
|
+
}
|
|
105
|
+
} finally {
|
|
106
|
+
worktreeScanning[parentSlug] = false;
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
function cleanupWorktreesForParent(relay, parentSlug) {
|
|
111
|
+
var wtSlugs = worktreeRegistry[parentSlug] || [];
|
|
112
|
+
for (var i = 0; i < wtSlugs.length; i++) {
|
|
113
|
+
relay.removeProject(wtSlugs[i]);
|
|
114
|
+
console.log("[daemon] Cascade removed worktree:", wtSlugs[i]);
|
|
115
|
+
}
|
|
116
|
+
delete worktreeRegistry[parentSlug];
|
|
117
|
+
if (worktreeTimers[parentSlug]) {
|
|
118
|
+
clearInterval(worktreeTimers[parentSlug]);
|
|
119
|
+
delete worktreeTimers[parentSlug];
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
/**
|
|
124
|
+
* Filter removed projects by userId and existence.
|
|
125
|
+
* @param {object} config - daemon config with removedProjects array
|
|
126
|
+
* @param {string|null} userId - user ID to filter by (null for single-user mode)
|
|
127
|
+
*/
|
|
128
|
+
function getFilteredRemovedProjects(config, userId) {
|
|
129
|
+
if (!config.removedProjects || config.removedProjects.length === 0) return [];
|
|
130
|
+
return config.removedProjects.filter(function (rp) {
|
|
131
|
+
if (userId && rp.userId && rp.userId !== userId) return false;
|
|
132
|
+
if (!userId && rp.userId) return false;
|
|
133
|
+
return fs.existsSync(rp.path);
|
|
134
|
+
});
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
/**
|
|
138
|
+
* Register a worktree slug under a parent slug.
|
|
139
|
+
* Used by daemon.js when creating worktrees directly.
|
|
140
|
+
*/
|
|
141
|
+
function registerWorktreeSlug(parentSlug, wtSlug) {
|
|
142
|
+
if (!worktreeRegistry[parentSlug]) worktreeRegistry[parentSlug] = [];
|
|
143
|
+
worktreeRegistry[parentSlug].push(wtSlug);
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
/**
|
|
147
|
+
* Unregister a worktree slug from its parent.
|
|
148
|
+
* Used by daemon.js when removing worktree projects directly.
|
|
149
|
+
*/
|
|
150
|
+
function unregisterWorktreeSlug(parentSlug, wtSlug) {
|
|
151
|
+
if (worktreeRegistry[parentSlug]) {
|
|
152
|
+
worktreeRegistry[parentSlug] = worktreeRegistry[parentSlug].filter(function (s) { return s !== wtSlug; });
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
module.exports = {
|
|
157
|
+
isWorktreeSlug: isWorktreeSlug,
|
|
158
|
+
scanAndRegisterWorktrees: scanAndRegisterWorktrees,
|
|
159
|
+
rescanWorktrees: rescanWorktrees,
|
|
160
|
+
cleanupWorktreesForParent: cleanupWorktreesForParent,
|
|
161
|
+
getFilteredRemovedProjects: getFilteredRemovedProjects,
|
|
162
|
+
registerWorktreeSlug: registerWorktreeSlug,
|
|
163
|
+
unregisterWorktreeSlug: unregisterWorktreeSlug,
|
|
164
|
+
};
|