@clagentic/console 1.9.0 → 1.10.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/LICENSE +117 -12
- package/LICENSES/MIT-legacy.txt +22 -0
- package/LICENSES/README.md +15 -0
- package/README.md +8 -2
- package/bin/cli.js +30 -5
- package/deploy/clagentic-console.service +10 -6
- package/lib/audit.js +3 -2
- package/lib/build-sha.json +2 -2
- package/lib/build-update-check.js +138 -0
- package/lib/cli/daemon-launch.js +17 -17
- package/lib/config.js +32 -20
- package/lib/daemon-env-settings.js +84 -0
- package/lib/daemon-projects.js +38 -0
- package/lib/daemon.js +202 -158
- package/lib/drain.js +74 -17
- package/lib/env-compat.js +61 -0
- package/lib/extension-commands.js +45 -0
- package/lib/history-visibility.js +4 -0
- package/lib/idle-adapter-reaper.js +71 -0
- package/lib/link-trap.js +78 -0
- package/lib/lore-attestation.js +73 -0
- package/lib/mcp-local.js +8 -6
- package/lib/mcp-tool-input.js +116 -0
- package/lib/mcp-tool-schema.js +179 -0
- package/lib/memory-limits.js +61 -5
- package/lib/memory-setting-validate.js +65 -0
- package/lib/new-work-gate.js +47 -0
- package/lib/os-users.js +5 -3
- package/lib/project-access.js +139 -0
- package/lib/project-connection.js +23 -22
- package/lib/project-external-trigger.js +103 -10
- package/lib/project-file-scope.js +172 -0
- package/lib/project-file-watch.js +86 -61
- package/lib/project-filesystem.js +144 -128
- package/lib/project-git.js +119 -0
- package/lib/project-http.js +44 -28
- package/lib/project-loop.js +12 -5
- package/lib/project-mcp.js +53 -72
- package/lib/project-message-gate.js +70 -0
- package/lib/project-notifications.js +31 -4
- package/lib/project-prompt-responses.js +216 -0
- package/lib/project-sessions.js +164 -302
- package/lib/project-user-message.js +36 -11
- package/lib/project.js +189 -142
- package/lib/projects-dir.js +90 -0
- package/lib/prompt-access.js +22 -0
- package/lib/prompt-kinds/answer-limits.js +15 -0
- package/lib/prompt-kinds/ask-user.js +58 -0
- package/lib/prompt-kinds/codecs.js +97 -0
- package/lib/prompt-kinds/elicitation.js +77 -0
- package/lib/prompt-kinds/extension.js +39 -0
- package/lib/prompt-kinds/index.js +68 -0
- package/lib/prompt-kinds/permission.js +114 -0
- package/lib/prompt-kinds/plan.js +79 -0
- package/lib/prompt-kinds/tool-call.js +38 -0
- package/lib/prompt-registry.js +673 -0
- package/lib/public/app.js +1 -1
- package/lib/public/css/diagnostics.css +50 -0
- package/lib/public/css/input.css +17 -3
- package/lib/public/css/menus.css +10 -0
- package/lib/public/css/messages.css +5 -0
- package/lib/public/css/rewind.css +22 -0
- package/lib/public/index.html +4 -12
- package/lib/public/modules/app-connection.js +7 -0
- package/lib/public/modules/app-cursors.js +7 -5
- package/lib/public/modules/app-messages.js +45 -45
- package/lib/public/modules/app-notifications.js +47 -71
- package/lib/public/modules/app-panels.js +61 -58
- package/lib/public/modules/app-projects.js +2 -1
- package/lib/public/modules/app-rendering.js +4 -10
- package/lib/public/modules/diagnostics.js +60 -16
- package/lib/public/modules/filebrowser.js +18 -16
- package/lib/public/modules/history-visibility.js +4 -0
- package/lib/public/modules/mention.js +3 -2
- package/lib/public/modules/mode-options.js +38 -0
- package/lib/public/modules/project-settings.js +19 -8
- package/lib/public/modules/prompt-banner.js +78 -0
- package/lib/public/modules/prompt-card.js +201 -0
- package/lib/public/modules/prompt-kinds/ask-user-codec.js +131 -0
- package/lib/public/modules/prompt-kinds/ask-user.js +213 -0
- package/lib/public/modules/prompt-kinds/elicitation-codec.js +343 -0
- package/lib/public/modules/prompt-kinds/elicitation.js +176 -0
- package/lib/public/modules/prompt-kinds/index.js +18 -0
- package/lib/public/modules/prompt-kinds/own-key.js +29 -0
- package/lib/public/modules/prompt-kinds/package.json +3 -0
- package/lib/public/modules/prompt-kinds/permission-choices.js +31 -0
- package/lib/public/modules/prompt-kinds/permission.js +209 -0
- package/lib/public/modules/prompt-kinds/plan.js +102 -0
- package/lib/public/modules/prompt-state.js +142 -0
- package/lib/public/modules/prompts.js +134 -0
- package/lib/public/modules/rewind.js +4 -1
- package/lib/public/modules/server-settings.js +2 -4
- package/lib/public/modules/sidebar-mobile.js +19 -9
- package/lib/public/modules/sidebar-sessions.js +21 -14
- package/lib/public/modules/sticky-notes.js +3 -2
- package/lib/public/modules/team-panel.js +5 -4
- package/lib/public/modules/tools.js +67 -904
- package/lib/public/modules/vendor-picker.js +53 -0
- package/lib/public/modules/vendor-registry.js +133 -0
- package/lib/public/sw.js +3 -1
- package/lib/rc-migrate.js +44 -0
- package/lib/runtime-env-keys.js +109 -0
- package/lib/runtime-env.js +236 -0
- package/lib/sdk-bridge.js +290 -273
- package/lib/sdk-message-processor.js +125 -145
- package/lib/server-hub-sessions.js +13 -10
- package/lib/server-palette.js +28 -19
- package/lib/server.js +141 -113
- package/lib/service-install.js +96 -0
- package/lib/session-capabilities.js +76 -0
- package/lib/sessions.js +45 -28
- package/lib/users-permissions.js +9 -6
- package/lib/users.js +9 -0
- package/lib/utils.js +4 -2
- package/lib/vendor-auth.js +22 -0
- package/lib/vendor-registry-message.js +65 -0
- package/lib/ws-origin.js +99 -0
- package/lib/ws-schema.js +33 -22
- package/lib/yoke/adapters/claude-capabilities.js +38 -0
- package/lib/yoke/adapters/claude-vendor.js +35 -0
- package/lib/yoke/adapters/claude-worker.js +55 -87
- package/lib/yoke/adapters/claude.js +156 -62
- package/lib/yoke/adapters/codex-capabilities.js +37 -0
- package/lib/yoke/adapters/codex-vendor.js +46 -0
- package/lib/yoke/adapters/codex.js +347 -156
- package/lib/yoke/adapters/effort-control.js +34 -0
- package/lib/yoke/adapters/permission-relay.js +58 -0
- package/lib/yoke/adapters/worker-mcp-servers.js +81 -0
- package/lib/yoke/auth-checks.js +104 -0
- package/lib/yoke/capabilities.js +49 -0
- package/lib/yoke/codex-app-server.js +23 -5
- package/lib/yoke/env-ownership.js +40 -0
- package/lib/yoke/index.js +67 -173
- package/lib/yoke/install-probe.js +121 -0
- package/lib/yoke/instructions.js +7 -11
- package/lib/yoke/interface.js +199 -3
- package/lib/yoke/package.json +1 -1
- package/lib/yoke/provider-credentials.js +96 -0
- package/lib/yoke/registry.js +340 -0
- package/package.json +12 -8
- package/scripts/check-sdk-lock-drift.js +160 -0
- package/scripts/check-test-count.js +76 -1
- package/scripts/postinstall.js +218 -136
- package/scripts/prompt-harness-history.js +202 -0
- package/scripts/verify-installed.js +67 -0
- package/lib/sdk-permission-ownership.js +0 -136
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
var path = require("path");
|
|
2
2
|
var fs = require("fs");
|
|
3
|
+
var { promptsFor } = require("./prompt-registry");
|
|
4
|
+
var { putOwn } = require("./prompt-kinds/codecs");
|
|
5
|
+
var { isKnownVendor } = require("./yoke");
|
|
3
6
|
|
|
4
7
|
/**
|
|
5
8
|
* Attach user-message handler and remaining small handlers
|
|
@@ -17,7 +20,7 @@ var fs = require("fs");
|
|
|
17
20
|
* hydrateImageRefs, saveImageFile, imagesDir,
|
|
18
21
|
* onProcessingChanged, onSessionDone,
|
|
19
22
|
* _loop - { handleLoopMessage: fn(ws, msg) }
|
|
20
|
-
* browserState - { _browserTabList, _extensionWs
|
|
23
|
+
* browserState - { _browserTabList, _extensionWs } (mutable refs)
|
|
21
24
|
* sendExtensionCommandAny, requestTabContext,
|
|
22
25
|
* startFileWatch, stopFileWatch,
|
|
23
26
|
* scheduleMessage, cancelScheduledMessage,
|
|
@@ -110,6 +113,8 @@ function attachUserMessage(ctx) {
|
|
|
110
113
|
var _loop = ctx._loop;
|
|
111
114
|
var browserState = ctx.browserState;
|
|
112
115
|
|
|
116
|
+
// Without a binding to the sockets commands were sent to, nothing may answer.
|
|
117
|
+
var mayAnswerExtensionCommand = ctx.mayAnswerExtensionCommand || function () { return false; };
|
|
113
118
|
var sendExtensionCommandAny = ctx.sendExtensionCommandAny;
|
|
114
119
|
var requestTabContext = ctx.requestTabContext;
|
|
115
120
|
|
|
@@ -274,21 +279,25 @@ function attachUserMessage(ctx) {
|
|
|
274
279
|
if (msg.type === "browser_tab_list") {
|
|
275
280
|
browserState._extensionWs = ws; // Track which client has the extension
|
|
276
281
|
if (msg.extensionId) browserState._extensionId = msg.extensionId;
|
|
277
|
-
var tabs = msg.tabs
|
|
278
|
-
|
|
282
|
+
var tabs = Array.isArray(msg.tabs) ? msg.tabs : [];
|
|
283
|
+
// Updated in place: the list is shared with the HTTP bridge, and its keys
|
|
284
|
+
// are tab ids from the client, so it is a prototype-less map filled only
|
|
285
|
+
// from entries that carry a numeric id.
|
|
286
|
+
var tabList = browserState._browserTabList;
|
|
287
|
+
Object.keys(tabList).forEach(function (staleId) { delete tabList[staleId]; });
|
|
279
288
|
for (var bti = 0; bti < tabs.length; bti++) {
|
|
280
|
-
|
|
289
|
+
var tab = tabs[bti];
|
|
290
|
+
if (!tab || typeof tab !== "object" || typeof tab.id !== "number" || !isFinite(tab.id)) continue;
|
|
291
|
+
putOwn(tabList, String(tab.id), tab);
|
|
281
292
|
}
|
|
282
293
|
return true;
|
|
283
294
|
}
|
|
284
295
|
|
|
296
|
+
// Only the socket a command was sent to can answer it: any other
|
|
297
|
+
// authenticated client's extension_result is ignored.
|
|
285
298
|
if (msg.type === "extension_result") {
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
clearTimeout(pending.timer);
|
|
289
|
-
pending.resolve(msg.result);
|
|
290
|
-
delete browserState.pendingExtensionRequests[msg.requestId];
|
|
291
|
-
}
|
|
299
|
+
if (!mayAnswerExtensionCommand(msg.requestId, ws)) return true;
|
|
300
|
+
promptsFor(sm).respond(msg.requestId, { result: msg.result }, { kinds: ["extension"] });
|
|
292
301
|
return true;
|
|
293
302
|
}
|
|
294
303
|
|
|
@@ -329,6 +338,10 @@ function attachUserMessage(ctx) {
|
|
|
329
338
|
if (msg.type === "send_scheduled_now") {
|
|
330
339
|
var nowSession = getSessionForWs(ws);
|
|
331
340
|
if (!nowSession || !nowSession.scheduledMessage) return true;
|
|
341
|
+
// lr-f7c100: reachable only via a live WS client explicitly forcing a
|
|
342
|
+
// scheduled send — same human-presence rationale as the "message"
|
|
343
|
+
// handler above.
|
|
344
|
+
nowSession.humanOriginated = true;
|
|
332
345
|
var schedText = nowSession.scheduledMessage.text;
|
|
333
346
|
clearTimeout(nowSession.scheduledMessage.timer);
|
|
334
347
|
nowSession.scheduledMessage = null;
|
|
@@ -367,8 +380,20 @@ function attachUserMessage(ctx) {
|
|
|
367
380
|
return true;
|
|
368
381
|
}
|
|
369
382
|
|
|
383
|
+
// lr-f7c100: this handler is reachable ONLY via a live WebSocket client
|
|
384
|
+
// sending a {type:"message"} frame — headless session drivers
|
|
385
|
+
// (project-loop.js's Ralph Loop iterations, project-external-trigger.js,
|
|
386
|
+
// scheduler.js) build their own history entries and call sdk.startQuery
|
|
387
|
+
// directly, never through here. That makes this the one structural (not
|
|
388
|
+
// heuristic) point in the codebase where "a human is in this session" is
|
|
389
|
+
// true by construction, independent of session state that a headless
|
|
390
|
+
// caller could otherwise set. Sticky once set — later processing (e.g. a
|
|
391
|
+
// scheduled message firing for the same session) never has a chance to
|
|
392
|
+
// clear it, matching the "a session mints iff a human is in it" rule.
|
|
393
|
+
session.humanOriginated = true;
|
|
394
|
+
|
|
370
395
|
// Bind vendor to session on first message (if not already set)
|
|
371
|
-
if (!session.vendor && msg.vendor) {
|
|
396
|
+
if (!session.vendor && isKnownVendor(msg.vendor)) {
|
|
372
397
|
session.vendor = msg.vendor;
|
|
373
398
|
sm.saveSessionFile(session);
|
|
374
399
|
sm.broadcastSessionList();
|